@pluv/crdt-yjs 0.3.5 → 0.3.7

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-yjs@0.3.5 build /home/runner/work/pluv/pluv/packages/crdt-yjs
2
+ > @pluv/crdt-yjs@0.3.7 build /home/runner/work/pluv/pluv/packages/crdt-yjs
3
3
  > tsup src/index.ts --format esm,cjs --dts
4
4
 
5
5
  CLI Building entry: src/index.ts
@@ -8,10 +8,10 @@
8
8
  CLI Target: es6
9
9
  ESM Build start
10
10
  CJS Build start
11
- ESM dist/index.mjs 3.50 KB
12
- ESM ⚡️ Build success in 29ms
13
- CJS dist/index.js 4.69 KB
14
- CJS ⚡️ Build success in 42ms
11
+ ESM dist/index.mjs 3.57 KB
12
+ ESM ⚡️ Build success in 88ms
13
+ CJS dist/index.js 4.77 KB
14
+ CJS ⚡️ Build success in 89ms
15
15
  DTS Build start
16
- DTS ⚡️ Build success in 1581ms
17
- DTS dist/index.d.ts 3.09 KB
16
+ DTS ⚡️ Build success in 2047ms
17
+ DTS dist/index.d.ts 3.10 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # @pluv/crdt-yjs
2
2
 
3
+ ## 0.3.7
4
+
5
+ ### Patch Changes
6
+
7
+ - 0dd847e: updated storage to be synced when reconnected to the room
8
+ - 3518a83: bumped dependencies
9
+ - Updated dependencies [0dd847e]
10
+ - Updated dependencies [bb2886b]
11
+ - Updated dependencies [ae679a8]
12
+ - @pluv/types@0.2.0
13
+
14
+ ## 0.3.6
15
+
16
+ ### Patch Changes
17
+
18
+ - 78fd644: updated readmes with links to the documentation website
19
+
3
20
  ## 0.3.5
4
21
 
5
22
  ### Patch Changes
package/README.md CHANGED
@@ -23,7 +23,6 @@
23
23
  <a href="https://commitizen.github.io/cz-cli/">
24
24
  <img src="https://img.shields.io/badge/commitizen-friendly-brightgreen.svg" alt="Commitizen friendly" />
25
25
  </a>
26
- <img src="https://img.shields.io/badge/docs-coming%20soon!-blue" alt="Docs coming soon!" />
27
26
  </p>
28
27
 
29
28
  <p align="center">
@@ -34,6 +33,8 @@
34
33
 
35
34
  > Yjs adapter for [@pluv/client](https://www.npmjs.com/package/@pluv/client) and [@pluv/io](https://www.npmjs.com/package/@pluv/io).
36
35
 
36
+ **👉 See full documentation on [pluv.io](https://pluv.io/docs/introduction). 👈**
37
+
37
38
  ## Installation
38
39
 
39
40
  > **Note**
package/dist/index.d.ts CHANGED
@@ -24,7 +24,7 @@ declare class YjsDoc<T extends Record<string, AbstractType<any>> = {}> {
24
24
  value: Doc;
25
25
  private get _storage();
26
26
  constructor(value?: T);
27
- applyUpdate(update: string | Uint8Array, origin?: string): this;
27
+ applyUpdate(update?: string | Uint8Array | null, origin?: string): this;
28
28
  destroy(): void;
29
29
  encodeStateAsUpdate(): string;
30
30
  get<TKey extends keyof T>(key: TKey): T[TKey];
package/dist/index.js CHANGED
@@ -74,6 +74,8 @@ var YjsDoc = class {
74
74
  return this.value.getMap("storage");
75
75
  }
76
76
  applyUpdate(update, origin) {
77
+ if (update === null || typeof update === "undefined")
78
+ return this;
77
79
  const uint8Update = typeof update === "string" ? (0, import_js_base64.toUint8Array)(update) : update;
78
80
  (0, import_yjs2.applyUpdate)(this.value, uint8Update, origin);
79
81
  return this;
package/dist/index.mjs CHANGED
@@ -43,6 +43,8 @@ var YjsDoc = class {
43
43
  return this.value.getMap("storage");
44
44
  }
45
45
  applyUpdate(update, origin) {
46
+ if (update === null || typeof update === "undefined")
47
+ return this;
46
48
  const uint8Update = typeof update === "string" ? toUint8Array(update) : update;
47
49
  applyUpdate(this.value, uint8Update, origin);
48
50
  return this;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pluv/crdt-yjs",
3
- "version": "0.3.5",
3
+ "version": "0.3.7",
4
4
  "description": "yjs for @pluv/io",
5
5
  "author": "leedavidcs",
6
6
  "license": "MIT",
@@ -18,7 +18,7 @@
18
18
  },
19
19
  "dependencies": {
20
20
  "js-base64": "^3.7.5",
21
- "@pluv/types": "^0.1.6"
21
+ "@pluv/types": "^0.2.0"
22
22
  },
23
23
  "peerDependencies": {
24
24
  "yjs": "^13.0.0"
@@ -26,9 +26,9 @@
26
26
  "devDependencies": {
27
27
  "tsup": "^6.7.0",
28
28
  "typescript": "^5.0.4",
29
- "yjs": "^13.5.52",
30
- "@pluv/tsconfig": "^0.1.5",
31
- "eslint-config-pluv": "^0.1.10"
29
+ "yjs": "^13.6.0",
30
+ "@pluv/tsconfig": "^0.1.6",
31
+ "eslint-config-pluv": "^0.1.11"
32
32
  },
33
33
  "scripts": {
34
34
  "build": "tsup src/index.ts --format esm,cjs --dts",
package/src/doc.ts CHANGED
@@ -20,7 +20,12 @@ export class YjsDoc<T extends Record<string, AbstractType<any>> = {}> {
20
20
  });
21
21
  }
22
22
 
23
- public applyUpdate(update: string | Uint8Array, origin?: string): this {
23
+ public applyUpdate(
24
+ update?: string | Uint8Array | null,
25
+ origin?: string
26
+ ): this {
27
+ if (update === null || typeof update === "undefined") return this;
28
+
24
29
  const uint8Update =
25
30
  typeof update === "string" ? toUint8Array(update) : update;
26
31