loro-crdt 1.2.2 → 1.2.4
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/CHANGELOG.md +13 -0
- package/base64/index.js +12 -27
- package/base64/loro_wasm.d.ts +9 -8
- package/base64/loro_wasm_bg-d78efef9.js +64 -0
- package/bundler/loro_wasm.d.ts +9 -8
- package/bundler/loro_wasm_bg.js +12 -27
- package/bundler/loro_wasm_bg.wasm +0 -0
- package/nodejs/loro_wasm.d.ts +9 -8
- package/nodejs/loro_wasm.js +12 -27
- package/nodejs/loro_wasm_bg.wasm +0 -0
- package/package.json +1 -1
- package/web/loro_wasm.d.ts +9 -8
- package/web/loro_wasm.js +11 -26
- package/web/loro_wasm_bg.wasm +0 -0
- package/base64/loro_wasm_bg-8056e30c.js +0 -64
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.2.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 5aa7985: Fixed incorrect subscript calculation when moving a child in the current parent
|
|
8
|
+
|
|
9
|
+
## 1.2.3
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 42949c0: Fix VersionVector ownership issue in WASM binding
|
|
14
|
+
- 1ca1275: feat: UndoManager's onPush now can access the change event
|
|
15
|
+
|
|
3
16
|
## 1.2.2
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
package/base64/index.js
CHANGED
|
@@ -1815,18 +1815,13 @@ class LoroDoc {
|
|
|
1815
1815
|
* // get updates from specific version to the latest version
|
|
1816
1816
|
* const updates2 = doc.exportFrom(version);
|
|
1817
1817
|
* ```
|
|
1818
|
-
* @param {
|
|
1818
|
+
* @param {any} vv
|
|
1819
1819
|
* @returns {Uint8Array}
|
|
1820
1820
|
*/
|
|
1821
1821
|
exportFrom(vv) {
|
|
1822
1822
|
try {
|
|
1823
1823
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1824
|
-
|
|
1825
|
-
if (!isLikeNone(vv)) {
|
|
1826
|
-
_assertClass(vv, VersionVector);
|
|
1827
|
-
ptr0 = vv.__destroy_into_raw();
|
|
1828
|
-
}
|
|
1829
|
-
wasm.lorodoc_exportFrom(retptr, this.__wbg_ptr, ptr0);
|
|
1824
|
+
wasm.lorodoc_exportFrom(retptr, this.__wbg_ptr, addHeapObject(vv));
|
|
1830
1825
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
1831
1826
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
1832
1827
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
@@ -1834,9 +1829,9 @@ class LoroDoc {
|
|
|
1834
1829
|
if (r3) {
|
|
1835
1830
|
throw takeObject(r2);
|
|
1836
1831
|
}
|
|
1837
|
-
var
|
|
1832
|
+
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
1838
1833
|
wasm.__wbindgen_export_5(r0, r1 * 1, 1);
|
|
1839
|
-
return
|
|
1834
|
+
return v1;
|
|
1840
1835
|
} finally {
|
|
1841
1836
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1842
1837
|
}
|
|
@@ -1900,24 +1895,14 @@ class LoroDoc {
|
|
|
1900
1895
|
}
|
|
1901
1896
|
/**
|
|
1902
1897
|
* Export updates in the given range in JSON format.
|
|
1903
|
-
* @param {
|
|
1904
|
-
* @param {
|
|
1898
|
+
* @param {any} start_vv
|
|
1899
|
+
* @param {any} end_vv
|
|
1905
1900
|
* @returns {JsonSchema}
|
|
1906
1901
|
*/
|
|
1907
1902
|
exportJsonUpdates(start_vv, end_vv) {
|
|
1908
1903
|
try {
|
|
1909
1904
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1910
|
-
|
|
1911
|
-
if (!isLikeNone(start_vv)) {
|
|
1912
|
-
_assertClass(start_vv, VersionVector);
|
|
1913
|
-
ptr0 = start_vv.__destroy_into_raw();
|
|
1914
|
-
}
|
|
1915
|
-
let ptr1 = 0;
|
|
1916
|
-
if (!isLikeNone(end_vv)) {
|
|
1917
|
-
_assertClass(end_vv, VersionVector);
|
|
1918
|
-
ptr1 = end_vv.__destroy_into_raw();
|
|
1919
|
-
}
|
|
1920
|
-
wasm.lorodoc_exportJsonUpdates(retptr, this.__wbg_ptr, ptr0, ptr1);
|
|
1905
|
+
wasm.lorodoc_exportJsonUpdates(retptr, this.__wbg_ptr, addHeapObject(start_vv), addHeapObject(end_vv));
|
|
1921
1906
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
1922
1907
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
1923
1908
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
@@ -5949,6 +5934,10 @@ function __wbindgen_is_string(arg0) {
|
|
|
5949
5934
|
const ret = typeof(getObject(arg0)) === 'string';
|
|
5950
5935
|
return ret;
|
|
5951
5936
|
}
|
|
5937
|
+
function __wbindgen_is_null(arg0) {
|
|
5938
|
+
const ret = getObject(arg0) === null;
|
|
5939
|
+
return ret;
|
|
5940
|
+
}
|
|
5952
5941
|
function __wbindgen_number_new(arg0) {
|
|
5953
5942
|
const ret = arg0;
|
|
5954
5943
|
return addHeapObject(ret);
|
|
@@ -5957,10 +5946,6 @@ function __wbindgen_typeof(arg0) {
|
|
|
5957
5946
|
const ret = typeof getObject(arg0);
|
|
5958
5947
|
return addHeapObject(ret);
|
|
5959
5948
|
}
|
|
5960
|
-
function __wbindgen_is_null(arg0) {
|
|
5961
|
-
const ret = getObject(arg0) === null;
|
|
5962
|
-
return ret;
|
|
5963
|
-
}
|
|
5964
5949
|
function __wbg_error_c8c2cca30a630316(arg0, arg1) {
|
|
5965
5950
|
console.error(getStringFromWasm0(arg0, arg1));
|
|
5966
5951
|
}
|
|
@@ -6453,7 +6438,7 @@ var imports = /*#__PURE__*/Object.freeze({
|
|
|
6453
6438
|
// Without this patch, Cloudflare Worker would raise issue like: "Uncaught TypeError: wasm2.__wbindgen_start is not a function"
|
|
6454
6439
|
|
|
6455
6440
|
|
|
6456
|
-
import loro_wasm_bg_js from './loro_wasm_bg-
|
|
6441
|
+
import loro_wasm_bg_js from './loro_wasm_bg-d78efef9.js';
|
|
6457
6442
|
const instance = new WebAssembly.Instance(loro_wasm_bg_js(), {
|
|
6458
6443
|
"./loro_wasm_bg.js": imports,
|
|
6459
6444
|
});
|
package/base64/loro_wasm.d.ts
CHANGED
|
@@ -268,7 +268,7 @@ export type UndoConfig = {
|
|
|
268
268
|
mergeInterval?: number,
|
|
269
269
|
maxUndoSteps?: number,
|
|
270
270
|
excludeOriginPrefixes?: string[],
|
|
271
|
-
onPush?: (isUndo: boolean, counterRange: { start: number, end: number }) => { value: Value, cursors: Cursor[] },
|
|
271
|
+
onPush?: (isUndo: boolean, counterRange: { start: number, end: number }, event?: LoroEventBatch) => { value: Value, cursors: Cursor[] },
|
|
272
272
|
onPop?: (isUndo: boolean, value: { value: Value, cursors: Cursor[] }, counterRange: { start: number, end: number }) => void
|
|
273
273
|
};
|
|
274
274
|
export type Container = LoroList | LoroMap | LoroText | LoroTree | LoroMovableList;
|
|
@@ -793,6 +793,14 @@ interface LoroDoc<T extends Record<string, Container> = Record<string, Container
|
|
|
793
793
|
*/
|
|
794
794
|
getTree<Key extends keyof T | ContainerID>(name: Key): T[Key] extends LoroTree ? T[Key] : LoroTree;
|
|
795
795
|
getText(key: string | ContainerID): LoroText;
|
|
796
|
+
/**
|
|
797
|
+
* Export the updates in the given range.
|
|
798
|
+
*
|
|
799
|
+
* @param start - The start version vector.
|
|
800
|
+
* @param end - The end version vector.
|
|
801
|
+
* @returns The updates in the given range.
|
|
802
|
+
*/
|
|
803
|
+
exportJsonUpdates(start?: VersionVector, end?: VersionVector): JsonSchema;
|
|
796
804
|
}
|
|
797
805
|
interface LoroList<T = unknown> {
|
|
798
806
|
new(): LoroList<T>;
|
|
@@ -1866,13 +1874,6 @@ export class LoroDoc {
|
|
|
1866
1874
|
*/
|
|
1867
1875
|
export(mode: ExportMode): Uint8Array;
|
|
1868
1876
|
/**
|
|
1869
|
-
* Export updates in the given range in JSON format.
|
|
1870
|
-
* @param {VersionVector | undefined} [start_vv]
|
|
1871
|
-
* @param {VersionVector | undefined} [end_vv]
|
|
1872
|
-
* @returns {JsonSchema}
|
|
1873
|
-
*/
|
|
1874
|
-
exportJsonUpdates(start_vv?: VersionVector, end_vv?: VersionVector): JsonSchema;
|
|
1875
|
-
/**
|
|
1876
1877
|
* Import updates from the JSON format.
|
|
1877
1878
|
*
|
|
1878
1879
|
* only supports backward compatibility but not forward compatibility.
|