@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.
@@ -1,18 +1,18 @@
1
1
 
2
- > @pluv/crdt-loro@0.35.1 build /home/runner/work/pluv/pluv/packages/crdt-loro
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
  CLI Building entry: src/index.ts
6
6
  CLI Using tsconfig: tsconfig.json
7
- CLI tsup v8.3.5
7
+ CLI tsup v8.3.6
8
8
  CLI Target: es6
9
9
  ESM Build start
10
10
  CJS Build start
11
- CJS dist/index.js 9.91 KB
12
- CJS ⚡️ Build success in 129ms
13
- ESM dist/index.mjs 8.81 KB
14
- ESM ⚡️ Build success in 131ms
11
+ CJS dist/index.js 9.98 KB
12
+ CJS ⚡️ Build success in 88ms
13
+ ESM dist/index.mjs 8.87 KB
14
+ ESM ⚡️ Build success in 88ms
15
15
  DTS Build start
16
- DTS ⚡️ Build success in 2274ms
16
+ DTS ⚡️ Build success in 2075ms
17
17
  DTS dist/index.d.mts 3.48 KB
18
18
  DTS dist/index.d.ts 3.48 KB
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.1",
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.1",
22
- "@pluv/types": "^0.35.1"
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.1",
30
- "tsup": "^8.3.5",
29
+ "loro-crdt": "^1.3.2",
30
+ "tsup": "^8.3.6",
31
31
  "typescript": "^5.7.3",
32
- "@pluv/tsconfig": "^0.35.1",
33
- "eslint-config-pluv": "^0.35.1"
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",
@@ -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 ? container.toString() : container.toJSON!();
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(