loro-crdt 1.9.0 → 1.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,48 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.10.1
4
+
5
+ ### Patch Changes
6
+
7
+ - ca76d86: fix: Empty LoroText attach error #873
8
+
9
+ ## 1.10.0
10
+
11
+ ### Minor Changes
12
+
13
+ - ce16b52: feat: add sliceDelta method to slice a span of richtext #862
14
+
15
+ Use `text.sliceDelta(start, end)` when you need a Quill-style delta for only part of a rich text field (for example, to copy a styled snippet). The method takes UTF-16 indices; use `sliceDeltaUtf8` if you want to slice by UTF-8 byte offsets instead.
16
+
17
+ ```ts
18
+ import { LoroDoc } from "loro-crdt";
19
+
20
+ const doc = new LoroDoc();
21
+ doc.configTextStyle({
22
+ bold: { expand: "after" },
23
+ comment: { expand: "none" },
24
+ });
25
+ const text = doc.getText("text");
26
+
27
+ text.insert(0, "Hello World!");
28
+ text.mark({ start: 0, end: 5 }, "bold", true);
29
+ text.mark({ start: 6, end: 11 }, "comment", "greeting");
30
+
31
+ const snippet = text.sliceDelta(1, 8);
32
+ console.log(snippet);
33
+ // [
34
+ // { insert: "ello", attributes: { bold: true } },
35
+ // { insert: " " },
36
+ // { insert: "Wo", attributes: { comment: "greeting" } },
37
+ // ]
38
+ ```
39
+
40
+ ### Patch Changes
41
+
42
+ - a78d70f: fix: avoid convert panic #858
43
+ - ee94ee4: fix: EphemeralStore apply should ignore timeout entries #865
44
+ - 9e0a613: fix: Reject symbol-keyed map objects in wasm conversion #855
45
+
3
46
  ## 1.9.0
4
47
 
5
48
  ### Minor Changes