@pluv/crdt-loro 0.44.2 → 1.0.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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @pluv/crdt-loro@0.44.2 build /home/runner/work/pluv/pluv/packages/crdt-loro
2
+ > @pluv/crdt-loro@1.0.1 build /home/runner/work/pluv/pluv/packages/crdt-loro
3
3
  > tsup src/index.ts --format esm,cjs --dts
4
4
 
5
5
  CLI Building entry: src/index.ts
@@ -8,11 +8,11 @@
8
8
  CLI Target: es6
9
9
  ESM Build start
10
10
  CJS Build start
11
- CJS dist/index.js 9.98 KB
12
- CJS ⚡️ Build success in 58ms
13
- ESM dist/index.mjs 8.90 KB
14
- ESM ⚡️ Build success in 59ms
11
+ ESM dist/index.mjs 8.73 KB
12
+ ESM ⚡️ Build success in 83ms
13
+ CJS dist/index.js 9.78 KB
14
+ CJS ⚡️ Build success in 82ms
15
15
  DTS Build start
16
- DTS ⚡️ Build success in 1791ms
17
- DTS dist/index.d.mts 3.47 KB
18
- DTS dist/index.d.ts 3.47 KB
16
+ DTS ⚡️ Build success in 2550ms
17
+ DTS dist/index.d.mts 3.46 KB
18
+ DTS dist/index.d.ts 3.46 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,28 @@
1
1
  # @pluv/crdt-loro
2
2
 
3
+ ## 1.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - @pluv/crdt@1.0.1
8
+ - @pluv/types@1.0.1
9
+
10
+ ## 1.0.0
11
+
12
+ ### Major Changes
13
+
14
+ - af94706: pluv.io is now stable and production ready!
15
+
16
+ With this v1 release, pluv.io will now follow [semantic versioning](https://semver.org/) with more comprehensive release notes for future changes to the library.
17
+
18
+ Checkout the [full documentation here](https://pluv.io/docs/introduction) to get started today!
19
+
20
+ ### Patch Changes
21
+
22
+ - Updated dependencies [af94706]
23
+ - @pluv/crdt@1.0.0
24
+ - @pluv/types@1.0.0
25
+
3
26
  ## 0.44.2
4
27
 
5
28
  ### Patch Changes
package/README.md ADDED
@@ -0,0 +1,20 @@
1
+ ## `@pluv/crdt-loro`
2
+
3
+ > This package is currently in preview and may have breaking changes between versions.
4
+
5
+ > Yjs adapter for [@pluv/client](https://www.npmjs.com/package/@pluv/client) and [@pluv/io](https://www.npmjs.com/package/@pluv/io).
6
+
7
+ **👉 See full documentation on [pluv.io](https://pluv.io/docs/introduction). 👈**
8
+
9
+ ## Installation
10
+
11
+ ```bash
12
+ # npm
13
+ npm install @pluv/crdt-loro loro-crdt
14
+
15
+ # yarn
16
+ yarn add @pluv/crdt-loro loro-crdt
17
+
18
+ # pnpm
19
+ pnpm add @pluv/crdt-loro loro-crdt
20
+ ```
package/dist/index.d.mts CHANGED
@@ -22,6 +22,7 @@ declare class CrdtLoroDoc<TStorage extends Record<string, LoroType<any, any>>> e
22
22
  toJson(): InferCrdtJson<TStorage>;
23
23
  toJson<TKey extends keyof TStorage>(type: TKey): InferCrdtJson<TStorage[TKey]>;
24
24
  isEmpty(): boolean;
25
+ rebuildStorage(): this;
25
26
  redo(): this;
26
27
  subscribe(listener: (params: DocSubscribeCallbackParams<TStorage>) => void): () => void;
27
28
  track(): this;
@@ -38,7 +39,6 @@ declare class CrdtLoroDocFactory<TStorage extends Record<string, LoroType<any, a
38
39
  constructor(initialStorage?: () => TStorage);
39
40
  getEmpty(): CrdtLoroDoc<TStorage>;
40
41
  getFactory(initialStorage?: (() => TStorage) | undefined): CrdtLoroDocFactory<TStorage>;
41
- getFresh(): CrdtLoroDoc<TStorage>;
42
42
  getInitialized(initialStorage?: () => TStorage): CrdtLoroDoc<TStorage>;
43
43
  }
44
44
 
package/dist/index.d.ts CHANGED
@@ -22,6 +22,7 @@ declare class CrdtLoroDoc<TStorage extends Record<string, LoroType<any, any>>> e
22
22
  toJson(): InferCrdtJson<TStorage>;
23
23
  toJson<TKey extends keyof TStorage>(type: TKey): InferCrdtJson<TStorage[TKey]>;
24
24
  isEmpty(): boolean;
25
+ rebuildStorage(): this;
25
26
  redo(): this;
26
27
  subscribe(listener: (params: DocSubscribeCallbackParams<TStorage>) => void): () => void;
27
28
  track(): this;
@@ -38,7 +39,6 @@ declare class CrdtLoroDocFactory<TStorage extends Record<string, LoroType<any, a
38
39
  constructor(initialStorage?: () => TStorage);
39
40
  getEmpty(): CrdtLoroDoc<TStorage>;
40
41
  getFactory(initialStorage?: (() => TStorage) | undefined): CrdtLoroDocFactory<TStorage>;
41
- getFresh(): CrdtLoroDoc<TStorage>;
42
42
  getInitialized(initialStorage?: () => TStorage): CrdtLoroDoc<TStorage>;
43
43
  }
44
44
 
package/dist/index.js CHANGED
@@ -90,6 +90,7 @@ var CrdtLoroDoc = class extends import_crdt.AbstractCrdtDoc {
90
90
  }
91
91
  return acc;
92
92
  }, {});
93
+ this.value.commit();
93
94
  }
94
95
  applyEncodedState(params) {
95
96
  const update = typeof params.update === "string" ? (0, import_js_base64.toUint8Array)(params.update) : params.update;
@@ -155,6 +156,19 @@ var CrdtLoroDoc = class extends import_crdt.AbstractCrdtDoc {
155
156
  const serialized = this.value.toJSON();
156
157
  return !serialized || !Object.keys(serialized).length;
157
158
  }
159
+ rebuildStorage() {
160
+ const isBuilt = !!Object.keys(this._storage).length;
161
+ if (isBuilt) {
162
+ console.warn("Attempted to rebuild storage multiple times");
163
+ return this;
164
+ }
165
+ const keys = Object.keys(this.value.toJSON());
166
+ this._storage = keys.reduce((acc, key) => {
167
+ const container = this.value.getByPath(key);
168
+ return (0, import_loro_crdt.isContainer)(container) ? __spreadProps(__spreadValues({}, acc), { [key]: container }) : acc;
169
+ }, {});
170
+ return this.track();
171
+ }
158
172
  redo() {
159
173
  var _a;
160
174
  (_a = this._undoManager) == null ? void 0 : _a.redo();
@@ -213,7 +227,6 @@ var CrdtLoroDoc = class extends import_crdt.AbstractCrdtDoc {
213
227
 
214
228
  // src/doc/CrdtLoroDocFactory.ts
215
229
  var import_crdt2 = require("@pluv/crdt");
216
- var import_loro_crdt2 = require("loro-crdt");
217
230
  var CrdtLoroDocFactory = class _CrdtLoroDocFactory extends import_crdt2.AbstractCrdtDocFactory {
218
231
  constructor(initialStorage = () => ({})) {
219
232
  super();
@@ -225,23 +238,6 @@ var CrdtLoroDocFactory = class _CrdtLoroDocFactory extends import_crdt2.Abstract
225
238
  getFactory(initialStorage) {
226
239
  return new _CrdtLoroDocFactory(initialStorage != null ? initialStorage : this._initialStorage);
227
240
  }
228
- getFresh() {
229
- const storage = this._initialStorage();
230
- return new CrdtLoroDoc(
231
- Object.entries(storage).reduce((acc, [key, node]) => {
232
- if (node instanceof import_loro_crdt2.LoroList) {
233
- return __spreadProps(__spreadValues({}, acc), { [key]: new import_loro_crdt2.LoroList() });
234
- }
235
- if (node instanceof import_loro_crdt2.LoroMap) {
236
- return __spreadProps(__spreadValues({}, acc), { [key]: new import_loro_crdt2.LoroMap() });
237
- }
238
- if (node instanceof import_loro_crdt2.LoroText) {
239
- return __spreadProps(__spreadValues({}, acc), { [key]: new import_loro_crdt2.LoroText() });
240
- }
241
- return acc;
242
- }, {})
243
- );
244
- }
245
241
  getInitialized(initialStorage) {
246
242
  var _a;
247
243
  return new CrdtLoroDoc((_a = initialStorage == null ? void 0 : initialStorage()) != null ? _a : this._initialStorage());
@@ -254,61 +250,61 @@ var doc = (value = () => ({})) => {
254
250
  };
255
251
 
256
252
  // src/list.ts
257
- var import_loro_crdt3 = require("loro-crdt");
253
+ var import_loro_crdt2 = require("loro-crdt");
258
254
  var list = (value = []) => {
259
- const container = new import_loro_crdt3.LoroList();
255
+ const container = new import_loro_crdt2.LoroList();
260
256
  value.forEach((item, i) => {
261
- if ((0, import_loro_crdt3.isContainer)(item)) container.insertContainer(i, item);
257
+ if ((0, import_loro_crdt2.isContainer)(item)) container.insertContainer(i, item);
262
258
  else container.insert(i, item);
263
259
  });
264
260
  return container;
265
261
  };
266
262
 
267
263
  // src/map.ts
268
- var import_loro_crdt4 = require("loro-crdt");
264
+ var import_loro_crdt3 = require("loro-crdt");
269
265
  var map = (value = []) => {
270
- const container = new import_loro_crdt4.LoroMap();
266
+ const container = new import_loro_crdt3.LoroMap();
271
267
  value.forEach(([key, item]) => {
272
- if ((0, import_loro_crdt4.isContainer)(item)) container.setContainer(key, item);
268
+ if ((0, import_loro_crdt3.isContainer)(item)) container.setContainer(key, item);
273
269
  else container.set(key, item);
274
270
  });
275
271
  return container;
276
272
  };
277
273
 
278
274
  // src/movableList.ts
279
- var import_loro_crdt5 = require("loro-crdt");
275
+ var import_loro_crdt4 = require("loro-crdt");
280
276
  var movableList = (value = []) => {
281
- const container = new import_loro_crdt5.LoroMovableList();
277
+ const container = new import_loro_crdt4.LoroMovableList();
282
278
  value.forEach((item, i) => {
283
- if ((0, import_loro_crdt5.isContainer)(item)) container.insertContainer(i, item);
279
+ if ((0, import_loro_crdt4.isContainer)(item)) container.insertContainer(i, item);
284
280
  else container.insert(i, item);
285
281
  });
286
282
  return container;
287
283
  };
288
284
 
289
285
  // src/object.ts
290
- var import_loro_crdt6 = require("loro-crdt");
286
+ var import_loro_crdt5 = require("loro-crdt");
291
287
  var object = (value) => {
292
- const container = new import_loro_crdt6.LoroMap();
288
+ const container = new import_loro_crdt5.LoroMap();
293
289
  Object.entries(value).forEach(([key, item]) => {
294
- if ((0, import_loro_crdt6.isContainer)(item)) container.setContainer(key, item);
290
+ if ((0, import_loro_crdt5.isContainer)(item)) container.setContainer(key, item);
295
291
  else container.set(key, item);
296
292
  });
297
293
  return container;
298
294
  };
299
295
 
300
296
  // src/text.ts
301
- var import_loro_crdt7 = require("loro-crdt");
297
+ var import_loro_crdt6 = require("loro-crdt");
302
298
  var text = (value = "") => {
303
- const container = new import_loro_crdt7.LoroText();
299
+ const container = new import_loro_crdt6.LoroText();
304
300
  container.insert(0, value);
305
301
  return container;
306
302
  };
307
303
 
308
304
  // src/tree.ts
309
- var import_loro_crdt8 = require("loro-crdt");
305
+ var import_loro_crdt7 = require("loro-crdt");
310
306
  var tree = () => {
311
- const container = new import_loro_crdt8.LoroTree();
307
+ const container = new import_loro_crdt7.LoroTree();
312
308
  return container;
313
309
  };
314
310
 
package/dist/index.mjs CHANGED
@@ -39,7 +39,15 @@ __export(loro_exports, {
39
39
  // src/doc/CrdtLoroDoc.ts
40
40
  import { AbstractCrdtDoc } from "@pluv/crdt";
41
41
  import { fromUint8Array, toUint8Array } from "js-base64";
42
- import { LoroCounter, LoroDoc, LoroList, LoroMap, LoroText, UndoManager, isContainer } from "loro-crdt";
42
+ import {
43
+ LoroCounter,
44
+ LoroDoc,
45
+ LoroList,
46
+ LoroMap,
47
+ LoroText,
48
+ UndoManager,
49
+ isContainer
50
+ } from "loro-crdt";
43
51
  var MAX_UNDO_STEPS = 100;
44
52
  var MERGE_INTERVAL_MS = 1e3;
45
53
  var CrdtLoroDoc = class extends AbstractCrdtDoc {
@@ -71,6 +79,7 @@ var CrdtLoroDoc = class extends AbstractCrdtDoc {
71
79
  }
72
80
  return acc;
73
81
  }, {});
82
+ this.value.commit();
74
83
  }
75
84
  applyEncodedState(params) {
76
85
  const update = typeof params.update === "string" ? toUint8Array(params.update) : params.update;
@@ -136,6 +145,19 @@ var CrdtLoroDoc = class extends AbstractCrdtDoc {
136
145
  const serialized = this.value.toJSON();
137
146
  return !serialized || !Object.keys(serialized).length;
138
147
  }
148
+ rebuildStorage() {
149
+ const isBuilt = !!Object.keys(this._storage).length;
150
+ if (isBuilt) {
151
+ console.warn("Attempted to rebuild storage multiple times");
152
+ return this;
153
+ }
154
+ const keys = Object.keys(this.value.toJSON());
155
+ this._storage = keys.reduce((acc, key) => {
156
+ const container = this.value.getByPath(key);
157
+ return isContainer(container) ? __spreadProps(__spreadValues({}, acc), { [key]: container }) : acc;
158
+ }, {});
159
+ return this.track();
160
+ }
139
161
  redo() {
140
162
  var _a;
141
163
  (_a = this._undoManager) == null ? void 0 : _a.redo();
@@ -194,7 +216,6 @@ var CrdtLoroDoc = class extends AbstractCrdtDoc {
194
216
 
195
217
  // src/doc/CrdtLoroDocFactory.ts
196
218
  import { AbstractCrdtDocFactory } from "@pluv/crdt";
197
- import { LoroList as LoroList2, LoroMap as LoroMap2, LoroText as LoroText2 } from "loro-crdt";
198
219
  var CrdtLoroDocFactory = class _CrdtLoroDocFactory extends AbstractCrdtDocFactory {
199
220
  constructor(initialStorage = () => ({})) {
200
221
  super();
@@ -206,23 +227,6 @@ var CrdtLoroDocFactory = class _CrdtLoroDocFactory extends AbstractCrdtDocFactor
206
227
  getFactory(initialStorage) {
207
228
  return new _CrdtLoroDocFactory(initialStorage != null ? initialStorage : this._initialStorage);
208
229
  }
209
- getFresh() {
210
- const storage = this._initialStorage();
211
- return new CrdtLoroDoc(
212
- Object.entries(storage).reduce((acc, [key, node]) => {
213
- if (node instanceof LoroList2) {
214
- return __spreadProps(__spreadValues({}, acc), { [key]: new LoroList2() });
215
- }
216
- if (node instanceof LoroMap2) {
217
- return __spreadProps(__spreadValues({}, acc), { [key]: new LoroMap2() });
218
- }
219
- if (node instanceof LoroText2) {
220
- return __spreadProps(__spreadValues({}, acc), { [key]: new LoroText2() });
221
- }
222
- return acc;
223
- }, {})
224
- );
225
- }
226
230
  getInitialized(initialStorage) {
227
231
  var _a;
228
232
  return new CrdtLoroDoc((_a = initialStorage == null ? void 0 : initialStorage()) != null ? _a : this._initialStorage());
@@ -235,9 +239,9 @@ var doc = (value = () => ({})) => {
235
239
  };
236
240
 
237
241
  // src/list.ts
238
- import { LoroList as LoroList3, isContainer as isContainer2 } from "loro-crdt";
242
+ import { LoroList as LoroList2, isContainer as isContainer2 } from "loro-crdt";
239
243
  var list = (value = []) => {
240
- const container = new LoroList3();
244
+ const container = new LoroList2();
241
245
  value.forEach((item, i) => {
242
246
  if (isContainer2(item)) container.insertContainer(i, item);
243
247
  else container.insert(i, item);
@@ -246,9 +250,9 @@ var list = (value = []) => {
246
250
  };
247
251
 
248
252
  // src/map.ts
249
- import { LoroMap as LoroMap3, isContainer as isContainer3 } from "loro-crdt";
253
+ import { LoroMap as LoroMap2, isContainer as isContainer3 } from "loro-crdt";
250
254
  var map = (value = []) => {
251
- const container = new LoroMap3();
255
+ const container = new LoroMap2();
252
256
  value.forEach(([key, item]) => {
253
257
  if (isContainer3(item)) container.setContainer(key, item);
254
258
  else container.set(key, item);
@@ -268,9 +272,9 @@ var movableList = (value = []) => {
268
272
  };
269
273
 
270
274
  // src/object.ts
271
- import { LoroMap as LoroMap4, isContainer as isContainer5 } from "loro-crdt";
275
+ import { LoroMap as LoroMap3, isContainer as isContainer5 } from "loro-crdt";
272
276
  var object = (value) => {
273
- const container = new LoroMap4();
277
+ const container = new LoroMap3();
274
278
  Object.entries(value).forEach(([key, item]) => {
275
279
  if (isContainer5(item)) container.setContainer(key, item);
276
280
  else container.set(key, item);
@@ -279,9 +283,9 @@ var object = (value) => {
279
283
  };
280
284
 
281
285
  // src/text.ts
282
- import { LoroText as LoroText3 } from "loro-crdt";
286
+ import { LoroText as LoroText2 } from "loro-crdt";
283
287
  var text = (value = "") => {
284
- const container = new LoroText3();
288
+ const container = new LoroText2();
285
289
  container.insert(0, value);
286
290
  return container;
287
291
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pluv/crdt-loro",
3
- "version": "0.44.2",
3
+ "version": "1.0.1",
4
4
  "description": "loro for @pluv/io",
5
5
  "author": "leedavidcs",
6
6
  "license": "MIT",
@@ -18,8 +18,8 @@
18
18
  },
19
19
  "dependencies": {
20
20
  "js-base64": "^3.7.7",
21
- "@pluv/crdt": "^0.44.2",
22
- "@pluv/types": "^0.44.2"
21
+ "@pluv/crdt": "^1.0.1",
22
+ "@pluv/types": "^1.0.1"
23
23
  },
24
24
  "peerDependencies": {
25
25
  "loro-crdt": "^1.0.0"
@@ -29,8 +29,8 @@
29
29
  "loro-crdt": "^1.5.4",
30
30
  "tsup": "^8.4.0",
31
31
  "typescript": "^5.8.3",
32
- "@pluv/tsconfig": "^0.44.2",
33
- "eslint-config-pluv": "^0.44.2"
32
+ "@pluv/tsconfig": "^1.0.1",
33
+ "eslint-config-pluv": "^1.0.1"
34
34
  },
35
35
  "scripts": {
36
36
  "build": "tsup src/index.ts --format esm,cjs --dts",
@@ -7,13 +7,24 @@ import type {
7
7
  import { AbstractCrdtDoc } from "@pluv/crdt";
8
8
  import { fromUint8Array, toUint8Array } from "js-base64";
9
9
  import type { Container } from "loro-crdt";
10
- import { LoroCounter, LoroDoc, LoroEventBatch, LoroList, LoroMap, LoroText, UndoManager, isContainer } from "loro-crdt";
10
+ import {
11
+ LoroCounter,
12
+ LoroDoc,
13
+ LoroEventBatch,
14
+ LoroList,
15
+ LoroMap,
16
+ LoroText,
17
+ UndoManager,
18
+ isContainer,
19
+ } from "loro-crdt";
11
20
  import type { LoroType } from "../types";
12
21
 
13
22
  const MAX_UNDO_STEPS = 100;
14
23
  const MERGE_INTERVAL_MS = 1_000;
15
24
 
16
- export class CrdtLoroDoc<TStorage extends Record<string, LoroType<any, any>>> extends AbstractCrdtDoc<TStorage> {
25
+ export class CrdtLoroDoc<
26
+ TStorage extends Record<string, LoroType<any, any>>,
27
+ > extends AbstractCrdtDoc<TStorage> {
17
28
  public value: LoroDoc = new LoroDoc();
18
29
 
19
30
  private _storage: TStorage;
@@ -55,10 +66,13 @@ export class CrdtLoroDoc<TStorage extends Record<string, LoroType<any, any>>> ex
55
66
 
56
67
  return acc;
57
68
  }, {} as TStorage);
69
+
70
+ this.value.commit();
58
71
  }
59
72
 
60
73
  public applyEncodedState(params: DocApplyEncodedStateParams): this {
61
- const update = typeof params.update === "string" ? toUint8Array(params.update) : params.update;
74
+ const update =
75
+ typeof params.update === "string" ? toUint8Array(params.update) : params.update;
62
76
 
63
77
  if (!update) return this;
64
78
 
@@ -157,6 +171,25 @@ export class CrdtLoroDoc<TStorage extends Record<string, LoroType<any, any>>> ex
157
171
  return !serialized || !Object.keys(serialized).length;
158
172
  }
159
173
 
174
+ public rebuildStorage(): this {
175
+ const isBuilt = !!Object.keys(this._storage).length;
176
+
177
+ if (isBuilt) {
178
+ console.warn("Attempted to rebuild storage multiple times");
179
+ return this;
180
+ }
181
+
182
+ const keys = Object.keys(this.value.toJSON());
183
+
184
+ this._storage = keys.reduce((acc, key) => {
185
+ const container = this.value.getByPath(key);
186
+
187
+ return isContainer(container) ? { ...acc, [key]: container } : acc;
188
+ }, {} as TStorage);
189
+
190
+ return this.track();
191
+ }
192
+
160
193
  public redo(): this {
161
194
  this._undoManager?.redo();
162
195
 
@@ -1,5 +1,4 @@
1
1
  import { AbstractCrdtDocFactory } from "@pluv/crdt";
2
- import { LoroList, LoroMap, LoroText } from "loro-crdt";
3
2
  import type { LoroType } from "../types";
4
3
  import { CrdtLoroDoc } from "./CrdtLoroDoc";
5
4
 
@@ -22,28 +21,6 @@ export class CrdtLoroDocFactory<
22
21
  return new CrdtLoroDocFactory<TStorage>(initialStorage ?? this._initialStorage);
23
22
  }
24
23
 
25
- public getFresh(): CrdtLoroDoc<TStorage> {
26
- const storage = this._initialStorage();
27
-
28
- return new CrdtLoroDoc<TStorage>(
29
- Object.entries(storage).reduce((acc, [key, node]) => {
30
- if (node instanceof LoroList) {
31
- return { ...acc, [key]: new LoroList() };
32
- }
33
-
34
- if (node instanceof LoroMap) {
35
- return { ...acc, [key]: new LoroMap() };
36
- }
37
-
38
- if (node instanceof LoroText) {
39
- return { ...acc, [key]: new LoroText() };
40
- }
41
-
42
- return acc;
43
- }, {} as TStorage),
44
- );
45
- }
46
-
47
24
  public getInitialized(initialStorage?: () => TStorage): CrdtLoroDoc<TStorage> {
48
25
  return new CrdtLoroDoc<TStorage>(initialStorage?.() ?? this._initialStorage());
49
26
  }
package/src/list.ts CHANGED
@@ -2,7 +2,9 @@ import type { Container } from "loro-crdt";
2
2
  import { LoroList, isContainer } from "loro-crdt";
3
3
  import type { LoroType } from "./types";
4
4
 
5
- export const list = <T extends unknown>(value: T[] | readonly T[] = []): LoroType<LoroList<T>, T[]> => {
5
+ export const list = <T extends unknown>(
6
+ value: T[] | readonly T[] = [],
7
+ ): LoroType<LoroList<T>, T[]> => {
6
8
  const container = new LoroList();
7
9
 
8
10
  value.forEach((item, i) => {
package/tsconfig.json CHANGED
@@ -3,6 +3,6 @@
3
3
  "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
4
4
  "exclude": ["node_modules"],
5
5
  "compilerOptions": {
6
- "lib": ["esnext"]
6
+ "lib": ["dom", "esnext"]
7
7
  }
8
8
  }