You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- fix: detached loro text issues [#665](https://github.com/loro-dev/loro/pull/665)
317
345
- fix: entity index when the tree is empty [#670](https://github.com/loro-dev/loro/pull/670)
318
346
347
+
319
348
# FILE: pages/changelog/v1.2.0.mdx
320
349
321
350
---
322
351
version: "v1.2.0"
323
-
title: "release v1.2.0"
352
+
title: "Release Loro v1.2.0"
324
353
date: 2024/12/10
325
354
---
326
355
@@ -351,11 +380,12 @@ date: 2024/12/10
351
380
- fix: getOrCreateContainer should not throw if value is null [#576](https://github.com/loro-dev/loro/pull/576)
352
381
- fix: dead loop when importing updates [#570](https://github.com/loro-dev/loro/pull/570)
353
382
383
+
354
384
# FILE: pages/changelog/v1.4.0.mdx
355
385
356
386
---
357
387
version: "v1.4.0"
358
-
title: "release v1.4.0"
388
+
title: "Release Loro v1.4.0"
359
389
date: 2025/02/13
360
390
---
361
391
@@ -370,6 +400,7 @@ date: 2025/02/13
370
400
- fix: update long text may fail [#633](https://github.com/loro-dev/loro/pull/633)
371
401
- fix: map.keys() may return keys from deleted entries [#618](https://github.com/loro-dev/loro/pull/618)
372
402
403
+
373
404
# FILE: pages/docs/examples.mdx
374
405
375
406
---
@@ -417,6 +448,25 @@ import { ReactPlayer } from "components/video";
417
448
></iframe>
418
449
419
450
451
+
# FILE: pages/docs/advanced/inspector.mdx
452
+
453
+
# Loro Inspector
454
+
455
+
[Loro Inspector](https://inspector.loro.dev/) is an open-source web tool that helps developers debug and visualize Loro documents. It provides a user-friendly interface to inspect the state and history of Loro documents.
@@ -1542,6 +1592,87 @@ documents containing several million characters.
1542
1592
> To learn how rich text CRDT in Loro works under the hood, please refer to our
1543
1593
> blog: [Introduction to Loro's Rich Text CRDT](/blog/loro-richtext).
1544
1594
1595
+
## Editor Bindings
1596
+
1597
+
Loro provides official bindings for popular editors to make it easier to integrate Loro's CRDT capabilities:
1598
+
1599
+
### ProseMirror Binding
1600
+
1601
+
The [loro-prosemirror](https://github.com/loro-dev/loro-prosemirror) package provides seamless integration between Loro and ProseMirror, a powerful rich text editor framework. It includes:
1602
+
1603
+
- Document state synchronization with rich text support
1604
+
- Cursor awareness and synchronization
1605
+
- Undo/Redo support in collaborative editing
1606
+
1607
+
The ProseMirror binding can also be used with [Tiptap](https://tiptap.dev/), a popular rich text editor built on top of ProseMirror. This means you can easily add collaborative editing capabilities to your Tiptap-based applications.
1608
+
1609
+
```ts
1610
+
import {
1611
+
CursorAwareness,
1612
+
LoroCursorPlugin,
1613
+
LoroSyncPlugin,
1614
+
LoroUndoPlugin,
1615
+
undo,
1616
+
redo,
1617
+
} from "loro-prosemirror";
1618
+
import { LoroDoc } from "loro-crdt";
1619
+
import { EditorView } from "prosemirror-view";
1620
+
import { EditorState } from "prosemirror-state";
1621
+
1622
+
const doc = new LoroDoc();
1623
+
const awareness = new CursorAwareness(doc.peerIdStr);
1624
+
const plugins = [
1625
+
...pmPlugins,
1626
+
LoroSyncPlugin({ doc }),
1627
+
LoroUndoPlugin({ doc }),
1628
+
keymap({
1629
+
"Mod-z": undo,
1630
+
"Mod-y": redo,
1631
+
"Mod-Shift-z": redo,
1632
+
}),
1633
+
LoroCursorPlugin(awareness, {}),
1634
+
];
1635
+
const editor = new EditorView(editorDom, {
1636
+
state: EditorState.create({ doc, plugins }),
1637
+
});
1638
+
```
1639
+
1640
+
### CodeMirror Binding
1641
+
1642
+
The [loro-codemirror](https://github.com/loro-dev/loro-codemirror) package provides integration between Loro and CodeMirror 6, a versatile code editor. It supports:
1643
+
1644
+
- Document state synchronization
1645
+
- Cursor awareness
1646
+
- Undo/Redo functionality
1647
+
1648
+
```ts
1649
+
import { EditorState } from "@codemirror/state";
1650
+
import { EditorView } from "@codemirror/view";
1651
+
import { LoroExtensions } from "loro-codemirror";
1652
+
import { Awareness, LoroDoc, UndoManager } from "loro-crdt";
1653
+
1654
+
const doc = new LoroDoc();
1655
+
const awareness = new Awareness(doc.peerIdStr);
1656
+
const undoManager = new UndoManager(doc, {});
1657
+
1658
+
new EditorView({
1659
+
state: EditorState.create({
1660
+
extensions: [
1661
+
// ... other extensions
1662
+
LoroExtensions(
1663
+
doc,
1664
+
{
1665
+
awareness: awareness,
1666
+
user: { name: "Bob", colorClassName: "user1" },
1667
+
},
1668
+
undoManager,
1669
+
),
1670
+
],
1671
+
}),
1672
+
parent: document.querySelector("#editor")!,
1673
+
});
1674
+
```
1675
+
1545
1676
## LoroText vs String
1546
1677
1547
1678
It's important to understand that LoroText is very different from using a regular string type. So the following code has different merge results:
@@ -2641,6 +2772,8 @@ You can use Loro in your application by using:
2641
2772
- You can also find a list of examples in
2642
2773
[Loro examples in Deno](https://github.com/loro-dev/loro-examples-deno).
2643
2774
2775
+
You can use [Loro Inspector](/docs/advanced/inspector) to debug and visualize the state and history of Loro documents.
2776
+
2644
2777
The following guide will use `loro-crdt` js package as the example.
2645
2778
2646
2779
[](https://stackblitz.com/edit/loro-basic-test?file=test%2Floro-sync.test.ts)
0 commit comments