@pluv/crdt-loro 0.35.1 → 0.35.3
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 +16 -0
- package/dist/index.js +1 -1
- package/dist/index.mjs +2 -2
- package/package.json +7 -7
- package/src/doc/CrdtLoroDoc.ts +6 -2
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
|
|
2
|
-
> @pluv/crdt-loro@0.35.
|
|
2
|
+
> @pluv/crdt-loro@0.35.3 build /home/runner/work/pluv/pluv/packages/crdt-loro
|
|
3
3
|
> tsup src/index.ts --format esm,cjs --dts
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: src/index.ts
|
|
6
6
|
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
7
|
-
[34mCLI[39m tsup v8.3.
|
|
7
|
+
[34mCLI[39m tsup v8.3.6
|
|
8
8
|
[34mCLI[39m Target: es6
|
|
9
9
|
[34mESM[39m Build start
|
|
10
10
|
[34mCJS[39m Build start
|
|
11
|
-
[32mCJS[39m [1mdist/index.js [22m[32m9.
|
|
12
|
-
[32mCJS[39m ⚡️ Build success in
|
|
13
|
-
[32mESM[39m [1mdist/index.mjs [22m[32m8.
|
|
14
|
-
[32mESM[39m ⚡️ Build success in
|
|
11
|
+
[32mCJS[39m [1mdist/index.js [22m[32m9.98 KB[39m
|
|
12
|
+
[32mCJS[39m ⚡️ Build success in 88ms
|
|
13
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m8.87 KB[39m
|
|
14
|
+
[32mESM[39m ⚡️ Build success in 88ms
|
|
15
15
|
[34mDTS[39m Build start
|
|
16
|
-
[32mDTS[39m ⚡️ Build success in
|
|
16
|
+
[32mDTS[39m ⚡️ Build success in 2075ms
|
|
17
17
|
[32mDTS[39m [1mdist/index.d.mts [22m[32m3.48 KB[39m
|
|
18
18
|
[32mDTS[39m [1mdist/index.d.ts [22m[32m3.48 KB[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @pluv/crdt-loro
|
|
2
2
|
|
|
3
|
+
## 0.35.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 7c8e7ef: Upgraded `loro-crdt` from `1.3.1` to `1.3.2`.
|
|
8
|
+
- @pluv/crdt@0.35.3
|
|
9
|
+
- @pluv/types@0.35.3
|
|
10
|
+
|
|
11
|
+
## 0.35.2
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies [81cb692]
|
|
16
|
+
- @pluv/types@0.35.2
|
|
17
|
+
- @pluv/crdt@0.35.2
|
|
18
|
+
|
|
3
19
|
## 0.35.1
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
package/dist/index.js
CHANGED
|
@@ -141,7 +141,7 @@ var CrdtLoroDoc = class extends import_crdt.AbstractCrdtDoc {
|
|
|
141
141
|
toJson(type) {
|
|
142
142
|
if (typeof type === "string") {
|
|
143
143
|
const container = this._storage[type];
|
|
144
|
-
return container instanceof import_loro_crdt.LoroText ? container.toString() : container.toJSON();
|
|
144
|
+
return container instanceof import_loro_crdt.LoroText ? container.toString() : container instanceof import_loro_crdt.LoroCounter ? container.value : container.toJSON();
|
|
145
145
|
}
|
|
146
146
|
return Object.entries(this._storage).reduce(
|
|
147
147
|
(acc, [key, value]) => __spreadProps(__spreadValues({}, acc), {
|
package/dist/index.mjs
CHANGED
|
@@ -39,7 +39,7 @@ __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 { LoroDoc, LoroList, LoroMap, LoroText, UndoManager, isContainer } from "loro-crdt";
|
|
42
|
+
import { LoroCounter, LoroDoc, LoroList, LoroMap, LoroText, UndoManager, isContainer } from "loro-crdt";
|
|
43
43
|
var MAX_UNDO_STEPS = 100;
|
|
44
44
|
var MERGE_INTERVAL_MS = 1e3;
|
|
45
45
|
var CrdtLoroDoc = class extends AbstractCrdtDoc {
|
|
@@ -122,7 +122,7 @@ var CrdtLoroDoc = class extends AbstractCrdtDoc {
|
|
|
122
122
|
toJson(type) {
|
|
123
123
|
if (typeof type === "string") {
|
|
124
124
|
const container = this._storage[type];
|
|
125
|
-
return container instanceof LoroText ? container.toString() : container.toJSON();
|
|
125
|
+
return container instanceof LoroText ? container.toString() : container instanceof LoroCounter ? container.value : container.toJSON();
|
|
126
126
|
}
|
|
127
127
|
return Object.entries(this._storage).reduce(
|
|
128
128
|
(acc, [key, value]) => __spreadProps(__spreadValues({}, acc), {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pluv/crdt-loro",
|
|
3
|
-
"version": "0.35.
|
|
3
|
+
"version": "0.35.3",
|
|
4
4
|
"description": "loro for @pluv/io",
|
|
5
5
|
"author": "leedavidcs",
|
|
6
6
|
"license": "MIT",
|
|
@@ -18,19 +18,19 @@
|
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"js-base64": "^3.7.7",
|
|
21
|
-
"@pluv/crdt": "^0.35.
|
|
22
|
-
"@pluv/types": "^0.35.
|
|
21
|
+
"@pluv/crdt": "^0.35.3",
|
|
22
|
+
"@pluv/types": "^0.35.3"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
25
|
"loro-crdt": "^1.0.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"eslint": "^8.57.1",
|
|
29
|
-
"loro-crdt": "^1.3.
|
|
30
|
-
"tsup": "^8.3.
|
|
29
|
+
"loro-crdt": "^1.3.2",
|
|
30
|
+
"tsup": "^8.3.6",
|
|
31
31
|
"typescript": "^5.7.3",
|
|
32
|
-
"@pluv/tsconfig": "^0.35.
|
|
33
|
-
"eslint-config-pluv": "^0.35.
|
|
32
|
+
"@pluv/tsconfig": "^0.35.3",
|
|
33
|
+
"eslint-config-pluv": "^0.35.3"
|
|
34
34
|
},
|
|
35
35
|
"scripts": {
|
|
36
36
|
"build": "tsup src/index.ts --format esm,cjs --dts",
|
package/src/doc/CrdtLoroDoc.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { DocApplyEncodedStateParams, DocSubscribeCallbackParams, InferCrdtJ
|
|
|
2
2
|
import { AbstractCrdtDoc } from "@pluv/crdt";
|
|
3
3
|
import { fromUint8Array, toUint8Array } from "js-base64";
|
|
4
4
|
import type { Container } from "loro-crdt";
|
|
5
|
-
import { LoroDoc, LoroEventBatch, LoroList, LoroMap, LoroText, UndoManager, isContainer } from "loro-crdt";
|
|
5
|
+
import { LoroCounter, LoroDoc, LoroEventBatch, LoroList, LoroMap, LoroText, UndoManager, isContainer } from "loro-crdt";
|
|
6
6
|
import type { LoroType } from "../types";
|
|
7
7
|
|
|
8
8
|
const MAX_UNDO_STEPS = 100;
|
|
@@ -132,7 +132,11 @@ export class CrdtLoroDoc<TStorage extends Record<string, LoroType<any, any>>> ex
|
|
|
132
132
|
if (typeof type === "string") {
|
|
133
133
|
const container = this._storage[type] as unknown as Container;
|
|
134
134
|
|
|
135
|
-
return container instanceof LoroText
|
|
135
|
+
return container instanceof LoroText
|
|
136
|
+
? container.toString()
|
|
137
|
+
: container instanceof LoroCounter
|
|
138
|
+
? container.value
|
|
139
|
+
: container.toJSON!();
|
|
136
140
|
}
|
|
137
141
|
|
|
138
142
|
return Object.entries(this._storage).reduce(
|