jazz-tools 0.13.10 → 0.13.11
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/.turbo/turbo-build.log +7 -7
- package/CHANGELOG.md +10 -0
- package/dist/{chunk-NFVKGXSH.js → chunk-I7NYAGLP.js} +23 -398
- package/dist/{chunk-NFVKGXSH.js.map → chunk-I7NYAGLP.js.map} +1 -1
- package/dist/coValues/coPlainText.d.ts +7 -0
- package/dist/coValues/coPlainText.d.ts.map +1 -1
- package/dist/coValues/coRichText.d.ts +2 -257
- package/dist/coValues/coRichText.d.ts.map +1 -1
- package/dist/exports.d.ts +1 -1
- package/dist/exports.d.ts.map +1 -1
- package/dist/index.js +1 -3
- package/dist/index.js.map +1 -1
- package/dist/testing.js +1 -1
- package/package.json +2 -2
- package/src/coValues/coPlainText.ts +23 -1
- package/src/coValues/coRichText.ts +2 -660
- package/src/exports.ts +1 -7
- package/src/tests/coPlainText.test.ts +21 -3
- package/dist/tests/coRichText.test.d.ts +0 -2
- package/dist/tests/coRichText.test.d.ts.map +0 -1
- package/src/tests/coRichText.test.ts +0 -937
@@ -36,10 +36,10 @@ describe("CoPlainText", () => {
|
|
36
36
|
test("insertion", () => {
|
37
37
|
const text = CoPlainText.create("hello world", { owner: me });
|
38
38
|
|
39
|
-
text.insertAfter(
|
39
|
+
text.insertAfter(4, " cruel");
|
40
40
|
expect(text + "").toEqual("hello cruel world");
|
41
41
|
|
42
|
-
text.
|
42
|
+
text.insertBefore(0, "Hello, ");
|
43
43
|
expect(text + "").toEqual("Hello, hello cruel world");
|
44
44
|
});
|
45
45
|
|
@@ -49,6 +49,24 @@ describe("CoPlainText", () => {
|
|
49
49
|
text.deleteRange({ from: 3, to: 8 });
|
50
50
|
expect(text + "").toEqual("helrld");
|
51
51
|
});
|
52
|
+
|
53
|
+
test("applyDiff", () => {
|
54
|
+
const text = CoPlainText.create("hello world", { owner: me });
|
55
|
+
text.applyDiff("hello cruel world");
|
56
|
+
expect(text.toString()).toEqual("hello cruel world");
|
57
|
+
});
|
58
|
+
});
|
59
|
+
|
60
|
+
describe("Properties", () => {
|
61
|
+
test("length", () => {
|
62
|
+
const text = CoPlainText.create("hello world", { owner: me });
|
63
|
+
expect(text.length).toBe(11);
|
64
|
+
});
|
65
|
+
|
66
|
+
test("toString", () => {
|
67
|
+
const text = CoPlainText.create("hello world", { owner: me });
|
68
|
+
expect(text.toString()).toBe("hello world");
|
69
|
+
});
|
52
70
|
});
|
53
71
|
|
54
72
|
describe("Position operations", () => {
|
@@ -155,7 +173,7 @@ describe("CoPlainText", () => {
|
|
155
173
|
expect(update1.toString()).toBe("hello world");
|
156
174
|
|
157
175
|
// When we make a change, we should get an update
|
158
|
-
text.insertAfter(
|
176
|
+
text.insertAfter(4, " beautiful");
|
159
177
|
const update2 = (await queue.next()).value;
|
160
178
|
expect(update2.toString()).toBe("hello beautiful world");
|
161
179
|
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"coRichText.test.d.ts","sourceRoot":"","sources":["../../src/tests/coRichText.test.ts"],"names":[],"mappings":""}
|