@pluv/crdt-yjs 0.38.14 → 0.39.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/.turbo/turbo-build.log +6 -6
- package/CHANGELOG.md +14 -0
- package/dist/index.js +6 -6
- package/dist/index.mjs +6 -6
- package/eslint.config.mjs +4 -0
- package/package.json +7 -7
- package/src/doc/CrdtYjsDoc.ts +4 -4
- package/src/xmlElement/YjsXmlElement.ts +1 -1
- package/src/xmlFragment/YjsXmlFragment.ts +1 -1
- package/.eslintrc.js +0 -4
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @pluv/crdt-yjs@0.
|
|
2
|
+
> @pluv/crdt-yjs@0.39.1 build /home/runner/work/pluv/pluv/packages/crdt-yjs
|
|
3
3
|
> tsup src/index.ts --format esm,cjs --dts
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: src/index.ts
|
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
[34mCLI[39m Target: es6
|
|
9
9
|
[34mESM[39m Build start
|
|
10
10
|
[34mCJS[39m Build start
|
|
11
|
-
[32mESM[39m [1mdist/index.mjs [22m[32m10.
|
|
12
|
-
[32mESM[39m ⚡️ Build success in
|
|
13
|
-
[32mCJS[39m [1mdist/index.js [22m[32m11.
|
|
14
|
-
[32mCJS[39m ⚡️ Build success in
|
|
11
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m10.97 KB[39m
|
|
12
|
+
[32mESM[39m ⚡️ Build success in 139ms
|
|
13
|
+
[32mCJS[39m [1mdist/index.js [22m[32m11.76 KB[39m
|
|
14
|
+
[32mCJS[39m ⚡️ Build success in 142ms
|
|
15
15
|
[34mDTS[39m Build start
|
|
16
|
-
[32mDTS[39m ⚡️ Build success in
|
|
16
|
+
[32mDTS[39m ⚡️ Build success in 2091ms
|
|
17
17
|
[32mDTS[39m [1mdist/index.d.mts [22m[32m3.95 KB[39m
|
|
18
18
|
[32mDTS[39m [1mdist/index.d.ts [22m[32m3.95 KB[39m
|
package/CHANGELOG.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -119,7 +119,7 @@ var import_yjs5 = require("yjs");
|
|
|
119
119
|
var YjsXmlElement = class extends import_yjs5.XmlElement {
|
|
120
120
|
constructor(name, value) {
|
|
121
121
|
super(name);
|
|
122
|
-
!!value.length
|
|
122
|
+
if (!!value.length) this.insert(0, value);
|
|
123
123
|
this.initialValue = value;
|
|
124
124
|
}
|
|
125
125
|
__pluvType() {
|
|
@@ -150,7 +150,7 @@ var CrdtYjsDoc = class extends import_crdt.AbstractCrdtDoc {
|
|
|
150
150
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
151
151
|
if (node instanceof YjsArray) {
|
|
152
152
|
const yArray = this.value.getArray(key);
|
|
153
|
-
!!((_a = node.initialValue) == null ? void 0 : _a.length)
|
|
153
|
+
if (!!((_a = node.initialValue) == null ? void 0 : _a.length)) yArray.insert(0, (_b = node.initialValue) == null ? void 0 : _b.slice(0));
|
|
154
154
|
return __spreadProps(__spreadValues({}, acc), { [key]: yArray });
|
|
155
155
|
}
|
|
156
156
|
if (node instanceof YjsMap) {
|
|
@@ -169,17 +169,17 @@ var CrdtYjsDoc = class extends import_crdt.AbstractCrdtDoc {
|
|
|
169
169
|
}
|
|
170
170
|
if (node instanceof YjsText) {
|
|
171
171
|
const yText = this.value.getText(key);
|
|
172
|
-
typeof node.initialValue === "string"
|
|
172
|
+
if (typeof node.initialValue === "string") yText.insert(0, node.initialValue);
|
|
173
173
|
return __spreadProps(__spreadValues({}, acc), { [key]: yText });
|
|
174
174
|
}
|
|
175
175
|
if (node instanceof YjsXmlElement) {
|
|
176
176
|
const yXmlElement = this.value.getXmlElement(key);
|
|
177
|
-
!!((_e = node.initialValue) == null ? void 0 : _e.length)
|
|
177
|
+
if (!!((_e = node.initialValue) == null ? void 0 : _e.length)) yXmlElement.insert(0, (_f = node.initialValue) == null ? void 0 : _f.slice(0));
|
|
178
178
|
return __spreadProps(__spreadValues({}, acc), { [key]: yXmlElement });
|
|
179
179
|
}
|
|
180
180
|
if (node instanceof import_yjs7.XmlFragment) {
|
|
181
181
|
const yXmlFragment = this.value.getXmlFragment(key);
|
|
182
|
-
!!((_g = node.initialValue) == null ? void 0 : _g.length)
|
|
182
|
+
if (!!((_g = node.initialValue) == null ? void 0 : _g.length)) yXmlFragment.insert(0, (_h = node.initialValue) == null ? void 0 : _h.slice(0));
|
|
183
183
|
return __spreadProps(__spreadValues({}, acc), { [key]: yXmlFragment });
|
|
184
184
|
}
|
|
185
185
|
if (node instanceof YjsXmlText) {
|
|
@@ -317,7 +317,7 @@ var import_yjs8 = require("yjs");
|
|
|
317
317
|
var YjsXmlFragment = class extends import_yjs8.XmlFragment {
|
|
318
318
|
constructor(value) {
|
|
319
319
|
super();
|
|
320
|
-
!!value.length
|
|
320
|
+
if (!!value.length) this.insert(0, value);
|
|
321
321
|
this.initialValue = value;
|
|
322
322
|
}
|
|
323
323
|
__pluvType() {
|
package/dist/index.mjs
CHANGED
|
@@ -111,7 +111,7 @@ import { XmlElement as YXmlElement } from "yjs";
|
|
|
111
111
|
var YjsXmlElement = class extends YXmlElement {
|
|
112
112
|
constructor(name, value) {
|
|
113
113
|
super(name);
|
|
114
|
-
!!value.length
|
|
114
|
+
if (!!value.length) this.insert(0, value);
|
|
115
115
|
this.initialValue = value;
|
|
116
116
|
}
|
|
117
117
|
__pluvType() {
|
|
@@ -142,7 +142,7 @@ var CrdtYjsDoc = class extends AbstractCrdtDoc {
|
|
|
142
142
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
143
143
|
if (node instanceof YjsArray) {
|
|
144
144
|
const yArray = this.value.getArray(key);
|
|
145
|
-
!!((_a = node.initialValue) == null ? void 0 : _a.length)
|
|
145
|
+
if (!!((_a = node.initialValue) == null ? void 0 : _a.length)) yArray.insert(0, (_b = node.initialValue) == null ? void 0 : _b.slice(0));
|
|
146
146
|
return __spreadProps(__spreadValues({}, acc), { [key]: yArray });
|
|
147
147
|
}
|
|
148
148
|
if (node instanceof YjsMap) {
|
|
@@ -161,17 +161,17 @@ var CrdtYjsDoc = class extends AbstractCrdtDoc {
|
|
|
161
161
|
}
|
|
162
162
|
if (node instanceof YjsText) {
|
|
163
163
|
const yText = this.value.getText(key);
|
|
164
|
-
typeof node.initialValue === "string"
|
|
164
|
+
if (typeof node.initialValue === "string") yText.insert(0, node.initialValue);
|
|
165
165
|
return __spreadProps(__spreadValues({}, acc), { [key]: yText });
|
|
166
166
|
}
|
|
167
167
|
if (node instanceof YjsXmlElement) {
|
|
168
168
|
const yXmlElement = this.value.getXmlElement(key);
|
|
169
|
-
!!((_e = node.initialValue) == null ? void 0 : _e.length)
|
|
169
|
+
if (!!((_e = node.initialValue) == null ? void 0 : _e.length)) yXmlElement.insert(0, (_f = node.initialValue) == null ? void 0 : _f.slice(0));
|
|
170
170
|
return __spreadProps(__spreadValues({}, acc), { [key]: yXmlElement });
|
|
171
171
|
}
|
|
172
172
|
if (node instanceof YXmlFragment) {
|
|
173
173
|
const yXmlFragment = this.value.getXmlFragment(key);
|
|
174
|
-
!!((_g = node.initialValue) == null ? void 0 : _g.length)
|
|
174
|
+
if (!!((_g = node.initialValue) == null ? void 0 : _g.length)) yXmlFragment.insert(0, (_h = node.initialValue) == null ? void 0 : _h.slice(0));
|
|
175
175
|
return __spreadProps(__spreadValues({}, acc), { [key]: yXmlFragment });
|
|
176
176
|
}
|
|
177
177
|
if (node instanceof YjsXmlText) {
|
|
@@ -309,7 +309,7 @@ import { XmlFragment as YXmlFragment2 } from "yjs";
|
|
|
309
309
|
var YjsXmlFragment = class extends YXmlFragment2 {
|
|
310
310
|
constructor(value) {
|
|
311
311
|
super();
|
|
312
|
-
!!value.length
|
|
312
|
+
if (!!value.length) this.insert(0, value);
|
|
313
313
|
this.initialValue = value;
|
|
314
314
|
}
|
|
315
315
|
__pluvType() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pluv/crdt-yjs",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.39.1",
|
|
4
4
|
"description": "yjs for @pluv/io",
|
|
5
5
|
"author": "leedavidcs",
|
|
6
6
|
"license": "MIT",
|
|
@@ -18,24 +18,24 @@
|
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"js-base64": "^3.7.7",
|
|
21
|
-
"@pluv/crdt": "^0.
|
|
22
|
-
"@pluv/types": "^0.
|
|
21
|
+
"@pluv/crdt": "^0.39.1",
|
|
22
|
+
"@pluv/types": "^0.39.1"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
25
|
"yjs": "^13.0.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"eslint": "^
|
|
28
|
+
"eslint": "^9.24.0",
|
|
29
29
|
"tsup": "^8.4.0",
|
|
30
30
|
"typescript": "^5.8.3",
|
|
31
31
|
"yjs": "^13.6.24",
|
|
32
|
-
"@pluv/tsconfig": "^0.
|
|
33
|
-
"eslint-config-pluv": "^0.
|
|
32
|
+
"@pluv/tsconfig": "^0.39.1",
|
|
33
|
+
"eslint-config-pluv": "^0.39.1"
|
|
34
34
|
},
|
|
35
35
|
"scripts": {
|
|
36
36
|
"build": "tsup src/index.ts --format esm,cjs --dts",
|
|
37
37
|
"dev": "tsup src/index.ts --format esm,cjs --watch --dts",
|
|
38
|
-
"lint": "eslint src/**/*.ts* --fix",
|
|
38
|
+
"lint": "eslint src/**/*.ts* --fix --max-warnings 0",
|
|
39
39
|
"clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist"
|
|
40
40
|
}
|
|
41
41
|
}
|
package/src/doc/CrdtYjsDoc.ts
CHANGED
|
@@ -37,7 +37,7 @@ export class CrdtYjsDoc<TStorage extends Record<string, YjsType<any, any>>> exte
|
|
|
37
37
|
if (node instanceof YjsArray) {
|
|
38
38
|
const yArray = this.value.getArray(key);
|
|
39
39
|
|
|
40
|
-
!!node.initialValue?.length
|
|
40
|
+
if (!!node.initialValue?.length) yArray.insert(0, node.initialValue?.slice(0));
|
|
41
41
|
|
|
42
42
|
return { ...acc, [key]: yArray };
|
|
43
43
|
}
|
|
@@ -65,7 +65,7 @@ export class CrdtYjsDoc<TStorage extends Record<string, YjsType<any, any>>> exte
|
|
|
65
65
|
if (node instanceof YjsText) {
|
|
66
66
|
const yText = this.value.getText(key);
|
|
67
67
|
|
|
68
|
-
typeof node.initialValue === "string"
|
|
68
|
+
if (typeof node.initialValue === "string") yText.insert(0, node.initialValue);
|
|
69
69
|
|
|
70
70
|
return { ...acc, [key]: yText };
|
|
71
71
|
}
|
|
@@ -73,7 +73,7 @@ export class CrdtYjsDoc<TStorage extends Record<string, YjsType<any, any>>> exte
|
|
|
73
73
|
if (node instanceof YjsXmlElement) {
|
|
74
74
|
const yXmlElement = this.value.getXmlElement(key);
|
|
75
75
|
|
|
76
|
-
!!node.initialValue?.length
|
|
76
|
+
if (!!node.initialValue?.length) yXmlElement.insert(0, node.initialValue?.slice(0));
|
|
77
77
|
|
|
78
78
|
return { ...acc, [key]: yXmlElement };
|
|
79
79
|
}
|
|
@@ -81,7 +81,7 @@ export class CrdtYjsDoc<TStorage extends Record<string, YjsType<any, any>>> exte
|
|
|
81
81
|
if (node instanceof YXmlFragment) {
|
|
82
82
|
const yXmlFragment = this.value.getXmlFragment(key);
|
|
83
83
|
|
|
84
|
-
!!node.initialValue?.length
|
|
84
|
+
if (!!node.initialValue?.length) yXmlFragment.insert(0, node.initialValue?.slice(0));
|
|
85
85
|
|
|
86
86
|
return { ...acc, [key]: yXmlFragment };
|
|
87
87
|
}
|
|
@@ -11,7 +11,7 @@ export class YjsXmlElement<T extends Record<string, any> = Record<string, any>>
|
|
|
11
11
|
constructor(name: string, value: (YXmlElement | YXmlText)[] | readonly (YXmlElement | YXmlText)[]) {
|
|
12
12
|
super(name);
|
|
13
13
|
|
|
14
|
-
!!value.length
|
|
14
|
+
if (!!value.length) this.insert(0, value as (YXmlElement | YXmlText)[]);
|
|
15
15
|
|
|
16
16
|
this.initialValue = value;
|
|
17
17
|
}
|
|
@@ -8,7 +8,7 @@ export class YjsXmlFragment extends YXmlFragment implements YjsType<YXmlFragment
|
|
|
8
8
|
constructor(value: (YXmlElement | YXmlText)[] | readonly (YXmlElement | YXmlText)[]) {
|
|
9
9
|
super();
|
|
10
10
|
|
|
11
|
-
!!value.length
|
|
11
|
+
if (!!value.length) this.insert(0, value as (YXmlElement | YXmlText)[]);
|
|
12
12
|
|
|
13
13
|
this.initialValue = value;
|
|
14
14
|
}
|
package/.eslintrc.js
DELETED