loro-crdt 1.1.4 → 1.2.0
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 +10 -0
- package/base64/index.js +26 -23
- package/base64/loro_wasm.d.ts +6 -5
- package/base64/loro_wasm_bg-543a4cca.js +64 -0
- package/bundler/loro_wasm.d.ts +6 -5
- package/bundler/loro_wasm_bg.js +24 -21
- package/bundler/loro_wasm_bg.wasm +0 -0
- package/nodejs/loro_wasm.d.ts +6 -5
- package/nodejs/loro_wasm.js +24 -21
- package/nodejs/loro_wasm_bg.wasm +0 -0
- package/package.json +1 -1
- package/web/loro_wasm.d.ts +6 -5
- package/web/loro_wasm.js +23 -20
- package/web/loro_wasm_bg.wasm +0 -0
- package/base64/loro_wasm_bg-3397dbb8.js +0 -64
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 01fccc5: Return ImportStatus in the import_batch method
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- d08a865: fix: getOrCreateContainer should not throw if value is null #576
|
|
12
|
+
|
|
3
13
|
## 1.1.4
|
|
4
14
|
|
|
5
15
|
### Patch Changes
|
package/base64/index.js
CHANGED
|
@@ -1211,7 +1211,7 @@ class LoroDoc {
|
|
|
1211
1211
|
* @param ids - the changes to visit
|
|
1212
1212
|
* @param f - the callback function, return `true` to continue visiting, return `false` to stop
|
|
1213
1213
|
* @param {({ peer: PeerID, counter: number })[]} ids
|
|
1214
|
-
* @param {(change:
|
|
1214
|
+
* @param {(change: Change) => boolean} f
|
|
1215
1215
|
*/
|
|
1216
1216
|
travelChangeAncestors(ids, f) {
|
|
1217
1217
|
try {
|
|
@@ -2004,6 +2004,7 @@ class LoroDoc {
|
|
|
2004
2004
|
* doc2.importUpdateBatch([snapshot, updates]);
|
|
2005
2005
|
* ```
|
|
2006
2006
|
* @param {Array<any>} data
|
|
2007
|
+
* @returns {ImportStatus}
|
|
2007
2008
|
*/
|
|
2008
2009
|
importUpdateBatch(data) {
|
|
2009
2010
|
try {
|
|
@@ -2011,9 +2012,11 @@ class LoroDoc {
|
|
|
2011
2012
|
wasm.lorodoc_importUpdateBatch(retptr, this.__wbg_ptr, addHeapObject(data));
|
|
2012
2013
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
2013
2014
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
2014
|
-
|
|
2015
|
-
|
|
2015
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
2016
|
+
if (r2) {
|
|
2017
|
+
throw takeObject(r1);
|
|
2016
2018
|
}
|
|
2019
|
+
return takeObject(r0);
|
|
2017
2020
|
} finally {
|
|
2018
2021
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2019
2022
|
}
|
|
@@ -5627,36 +5630,36 @@ class VersionVector {
|
|
|
5627
5630
|
function __wbindgen_object_drop_ref(arg0) {
|
|
5628
5631
|
takeObject(arg0);
|
|
5629
5632
|
}
|
|
5630
|
-
function
|
|
5631
|
-
const ret =
|
|
5632
|
-
return addHeapObject(ret);
|
|
5633
|
-
}
|
|
5634
|
-
function __wbg_lorotree_new(arg0) {
|
|
5635
|
-
const ret = LoroTree.__wrap(arg0);
|
|
5633
|
+
function __wbg_loromap_new(arg0) {
|
|
5634
|
+
const ret = LoroMap.__wrap(arg0);
|
|
5636
5635
|
return addHeapObject(ret);
|
|
5637
5636
|
}
|
|
5638
5637
|
function __wbg_lorotext_new(arg0) {
|
|
5639
5638
|
const ret = LoroText.__wrap(arg0);
|
|
5640
5639
|
return addHeapObject(ret);
|
|
5641
5640
|
}
|
|
5642
|
-
function
|
|
5643
|
-
const ret =
|
|
5641
|
+
function __wbg_lorolist_new(arg0) {
|
|
5642
|
+
const ret = LoroList.__wrap(arg0);
|
|
5644
5643
|
return addHeapObject(ret);
|
|
5645
5644
|
}
|
|
5646
|
-
function
|
|
5647
|
-
const ret =
|
|
5645
|
+
function __wbg_lorotree_new(arg0) {
|
|
5646
|
+
const ret = LoroTree.__wrap(arg0);
|
|
5648
5647
|
return addHeapObject(ret);
|
|
5649
5648
|
}
|
|
5650
|
-
function
|
|
5651
|
-
const ret =
|
|
5649
|
+
function __wbg_cursor_new(arg0) {
|
|
5650
|
+
const ret = Cursor.__wrap(arg0);
|
|
5652
5651
|
return addHeapObject(ret);
|
|
5653
5652
|
}
|
|
5654
5653
|
function __wbg_loromovablelist_new(arg0) {
|
|
5655
5654
|
const ret = LoroMovableList.__wrap(arg0);
|
|
5656
5655
|
return addHeapObject(ret);
|
|
5657
5656
|
}
|
|
5658
|
-
function
|
|
5659
|
-
const ret =
|
|
5657
|
+
function __wbg_lorocounter_new(arg0) {
|
|
5658
|
+
const ret = LoroCounter.__wrap(arg0);
|
|
5659
|
+
return addHeapObject(ret);
|
|
5660
|
+
}
|
|
5661
|
+
function __wbg_lorotreenode_new(arg0) {
|
|
5662
|
+
const ret = LoroTreeNode.__wrap(arg0);
|
|
5660
5663
|
return addHeapObject(ret);
|
|
5661
5664
|
}
|
|
5662
5665
|
function __wbg_versionvector_new(arg0) {
|
|
@@ -6108,11 +6111,11 @@ function __wbindgen_memory() {
|
|
|
6108
6111
|
return addHeapObject(ret);
|
|
6109
6112
|
}
|
|
6110
6113
|
function __wbindgen_closure_wrapper487(arg0, arg1, arg2) {
|
|
6111
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
6114
|
+
const ret = makeMutClosure(arg0, arg1, 9, __wbg_adapter_58);
|
|
6112
6115
|
return addHeapObject(ret);
|
|
6113
6116
|
}
|
|
6114
|
-
function
|
|
6115
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
6117
|
+
function __wbindgen_closure_wrapper489(arg0, arg1, arg2) {
|
|
6118
|
+
const ret = makeMutClosure(arg0, arg1, 11, __wbg_adapter_61);
|
|
6116
6119
|
return addHeapObject(ret);
|
|
6117
6120
|
}
|
|
6118
6121
|
|
|
@@ -6214,7 +6217,7 @@ var imports = /*#__PURE__*/Object.freeze({
|
|
|
6214
6217
|
__wbindgen_boolean_get: __wbindgen_boolean_get,
|
|
6215
6218
|
__wbindgen_cb_drop: __wbindgen_cb_drop,
|
|
6216
6219
|
__wbindgen_closure_wrapper487: __wbindgen_closure_wrapper487,
|
|
6217
|
-
|
|
6220
|
+
__wbindgen_closure_wrapper489: __wbindgen_closure_wrapper489,
|
|
6218
6221
|
__wbindgen_debug_string: __wbindgen_debug_string,
|
|
6219
6222
|
__wbindgen_error_new: __wbindgen_error_new,
|
|
6220
6223
|
__wbindgen_in: __wbindgen_in,
|
|
@@ -6248,7 +6251,7 @@ var imports = /*#__PURE__*/Object.freeze({
|
|
|
6248
6251
|
// Without this patch, Cloudflare Worker would raise issue like: "Uncaught TypeError: wasm2.__wbindgen_start is not a function"
|
|
6249
6252
|
|
|
6250
6253
|
|
|
6251
|
-
import loro_wasm_bg_js from './loro_wasm_bg-
|
|
6254
|
+
import loro_wasm_bg_js from './loro_wasm_bg-543a4cca.js';
|
|
6252
6255
|
const instance = new WebAssembly.Instance(loro_wasm_bg_js(), {
|
|
6253
6256
|
"./loro_wasm_bg.js": imports,
|
|
6254
6257
|
});
|
|
@@ -6406,4 +6409,4 @@ class Awareness {
|
|
|
6406
6409
|
}
|
|
6407
6410
|
}
|
|
6408
6411
|
|
|
6409
|
-
export { Awareness, AwarenessWasm, Cursor, Loro, LoroCounter, LoroDoc, LoroList, LoroMap, LoroMovableList, LoroText, LoroTree, LoroTreeNode, UndoManager, VersionVector, __wbg_String_b9412f8799faab3e, __wbg_apply_0a5aa603881e6d79, __wbg_buffer_12d079cc21e14bdb, __wbg_call_27c0f87801dedf93, __wbg_call_8e7cb608789c2528, __wbg_call_938992c832f74314, __wbg_call_b3ca7c6051f9bec1, __wbg_crypto_1d1f22824a6a080c, __wbg_cursor_new, __wbg_done_298b57d23c0fc80c, __wbg_entries_95cc2c823b285a09, __wbg_entries_ce844941d0c51880, __wbg_error_c8c2cca30a630316, __wbg_error_f851667af71bcfc6, __wbg_getRandomValues_3aa56aa6edec874c, __wbg_get_bd8e338fbd5f5cc8, __wbg_get_e3c254076557e348, __wbg_getindex_03d06b4e7ea3475e, __wbg_getwithrefkey_edc2c8960f0f1191, __wbg_globalThis_d1e6af4856ba331b, __wbg_global_207b558942527489, __wbg_instanceof_ArrayBuffer_836825be07d4c9d2, __wbg_instanceof_Map_87917e0a7aaf4012, __wbg_instanceof_Object_71ca3c0a59266746, __wbg_instanceof_Uint8Array_2b3bbecd033d19f6, __wbg_isArray_2ab64d95e09ea0ae, __wbg_isSafeInteger_f7b04ef02296c4d2, __wbg_iterator_2cee6dadfd956dfa, __wbg_length_c20a40f15020d68a, __wbg_length_cd7af8117672b8b8, __wbg_log_aba5996d9bde071f, __wbg_log_c9486ca5d8e2cbe8, __wbg_log_d8fdbde28117925d, __wbg_lorocounter_new, __wbg_lorolist_new, __wbg_loromap_new, __wbg_loromovablelist_new, __wbg_lorotext_new, __wbg_lorotree_new, __wbg_lorotreenode_new, __wbg_mark_40e050a77cc39fea, __wbg_measure_aa7a73f17813f708, __wbg_msCrypto_eb05e62b530a1508, __wbg_new_16b304a2cfa7ff4a, __wbg_new_63b92bc8671ed464, __wbg_new_72fb9a18b5ae2624, __wbg_new_abda76e883ba8a5f, __wbg_new_d9bc3a0147634640, __wbg_newnoargs_e258087cd0daa0ea, __wbg_newwithbyteoffsetandlength_aa4a17c33a06e5cb, __wbg_newwithlength_66ae46612e7f0234, __wbg_newwithlength_e9b4878cebadb3d3, __wbg_next_196c84450b364254, __wbg_next_40fc327bfc8770e6, __wbg_node_104a2ff8d6ea03a2, __wbg_now_11683c634f92ae89, __wbg_ownKeys_658942b7f28d1fe9, __wbg_process_4a72847cc503995b, __wbg_push_a5b05aedc7234f9f, __wbg_randomFillSync_5c9c955aa56b6049, __wbg_require_cca90b1a94a0255b, __wbg_resolve_b0083a7967828ec8, __wbg_self_ce0dbfc45cf2f5be, __wbg_set_1f9b04f170055d33, __wbg_set_8417257aaedc936b, __wbg_set_a47bac70306a19a7, __wbg_set_d4638f722068f043, __wbg_set_f975102236d3c502, __wbg_set_wasm, __wbg_setindex_0b7ede192dc5eca8, __wbg_stack_658279fe44541cf6, __wbg_subarray_a1f73cd4b5b42fe1, __wbg_then_0c86a60e8fcfe9f6, __wbg_value_d93c65011f51a456, __wbg_versions_f686565e586dd935, __wbg_versionvector_new, __wbg_window_c6fb939a7f436783, __wbindgen_as_number, __wbindgen_bigint_from_i64, __wbindgen_bigint_from_u64, __wbindgen_bigint_get_as_i64, __wbindgen_boolean_get, __wbindgen_cb_drop, __wbindgen_closure_wrapper487,
|
|
6412
|
+
export { Awareness, AwarenessWasm, Cursor, Loro, LoroCounter, LoroDoc, LoroList, LoroMap, LoroMovableList, LoroText, LoroTree, LoroTreeNode, UndoManager, VersionVector, __wbg_String_b9412f8799faab3e, __wbg_apply_0a5aa603881e6d79, __wbg_buffer_12d079cc21e14bdb, __wbg_call_27c0f87801dedf93, __wbg_call_8e7cb608789c2528, __wbg_call_938992c832f74314, __wbg_call_b3ca7c6051f9bec1, __wbg_crypto_1d1f22824a6a080c, __wbg_cursor_new, __wbg_done_298b57d23c0fc80c, __wbg_entries_95cc2c823b285a09, __wbg_entries_ce844941d0c51880, __wbg_error_c8c2cca30a630316, __wbg_error_f851667af71bcfc6, __wbg_getRandomValues_3aa56aa6edec874c, __wbg_get_bd8e338fbd5f5cc8, __wbg_get_e3c254076557e348, __wbg_getindex_03d06b4e7ea3475e, __wbg_getwithrefkey_edc2c8960f0f1191, __wbg_globalThis_d1e6af4856ba331b, __wbg_global_207b558942527489, __wbg_instanceof_ArrayBuffer_836825be07d4c9d2, __wbg_instanceof_Map_87917e0a7aaf4012, __wbg_instanceof_Object_71ca3c0a59266746, __wbg_instanceof_Uint8Array_2b3bbecd033d19f6, __wbg_isArray_2ab64d95e09ea0ae, __wbg_isSafeInteger_f7b04ef02296c4d2, __wbg_iterator_2cee6dadfd956dfa, __wbg_length_c20a40f15020d68a, __wbg_length_cd7af8117672b8b8, __wbg_log_aba5996d9bde071f, __wbg_log_c9486ca5d8e2cbe8, __wbg_log_d8fdbde28117925d, __wbg_lorocounter_new, __wbg_lorolist_new, __wbg_loromap_new, __wbg_loromovablelist_new, __wbg_lorotext_new, __wbg_lorotree_new, __wbg_lorotreenode_new, __wbg_mark_40e050a77cc39fea, __wbg_measure_aa7a73f17813f708, __wbg_msCrypto_eb05e62b530a1508, __wbg_new_16b304a2cfa7ff4a, __wbg_new_63b92bc8671ed464, __wbg_new_72fb9a18b5ae2624, __wbg_new_abda76e883ba8a5f, __wbg_new_d9bc3a0147634640, __wbg_newnoargs_e258087cd0daa0ea, __wbg_newwithbyteoffsetandlength_aa4a17c33a06e5cb, __wbg_newwithlength_66ae46612e7f0234, __wbg_newwithlength_e9b4878cebadb3d3, __wbg_next_196c84450b364254, __wbg_next_40fc327bfc8770e6, __wbg_node_104a2ff8d6ea03a2, __wbg_now_11683c634f92ae89, __wbg_ownKeys_658942b7f28d1fe9, __wbg_process_4a72847cc503995b, __wbg_push_a5b05aedc7234f9f, __wbg_randomFillSync_5c9c955aa56b6049, __wbg_require_cca90b1a94a0255b, __wbg_resolve_b0083a7967828ec8, __wbg_self_ce0dbfc45cf2f5be, __wbg_set_1f9b04f170055d33, __wbg_set_8417257aaedc936b, __wbg_set_a47bac70306a19a7, __wbg_set_d4638f722068f043, __wbg_set_f975102236d3c502, __wbg_set_wasm, __wbg_setindex_0b7ede192dc5eca8, __wbg_stack_658279fe44541cf6, __wbg_subarray_a1f73cd4b5b42fe1, __wbg_then_0c86a60e8fcfe9f6, __wbg_value_d93c65011f51a456, __wbg_versions_f686565e586dd935, __wbg_versionvector_new, __wbg_window_c6fb939a7f436783, __wbindgen_as_number, __wbindgen_bigint_from_i64, __wbindgen_bigint_from_u64, __wbindgen_bigint_get_as_i64, __wbindgen_boolean_get, __wbindgen_cb_drop, __wbindgen_closure_wrapper487, __wbindgen_closure_wrapper489, __wbindgen_debug_string, __wbindgen_error_new, __wbindgen_in, __wbindgen_is_bigint, __wbindgen_is_falsy, __wbindgen_is_function, __wbindgen_is_null, __wbindgen_is_object, __wbindgen_is_string, __wbindgen_is_undefined, __wbindgen_jsval_eq, __wbindgen_jsval_loose_eq, __wbindgen_memory, __wbindgen_number_get, __wbindgen_number_new, __wbindgen_object_clone_ref, __wbindgen_object_drop_ref, __wbindgen_rethrow, __wbindgen_string_get, __wbindgen_string_new, __wbindgen_throw, __wbindgen_typeof, decodeFrontiers, decodeImportBlobMeta, encodeFrontiers, getType, isContainer, isContainerId, newContainerID, newRootContainerID, run, setDebug };
|
package/base64/loro_wasm.d.ts
CHANGED
|
@@ -359,7 +359,7 @@ export type TreeNodeJSON<T> = Omit<TreeNodeValue, 'meta' | 'children'> & {
|
|
|
359
359
|
|
|
360
360
|
interface LoroTree{
|
|
361
361
|
toArray(): TreeNodeValue[];
|
|
362
|
-
getNodes(options?: { withDeleted
|
|
362
|
+
getNodes(options?: { withDeleted?: boolean } ): LoroTreeNode[];
|
|
363
363
|
}
|
|
364
364
|
|
|
365
365
|
interface LoroMovableList {
|
|
@@ -454,7 +454,7 @@ export type ExportMode = {
|
|
|
454
454
|
} | {
|
|
455
455
|
mode: "updates-in-range",
|
|
456
456
|
spans: {
|
|
457
|
-
id:
|
|
457
|
+
id: OpId,
|
|
458
458
|
len: number,
|
|
459
459
|
}[],
|
|
460
460
|
};
|
|
@@ -1570,9 +1570,9 @@ export class LoroDoc {
|
|
|
1570
1570
|
* @param ids - the changes to visit
|
|
1571
1571
|
* @param f - the callback function, return `true` to continue visiting, return `false` to stop
|
|
1572
1572
|
* @param {({ peer: PeerID, counter: number })[]} ids
|
|
1573
|
-
* @param {(change:
|
|
1573
|
+
* @param {(change: Change) => boolean} f
|
|
1574
1574
|
*/
|
|
1575
|
-
travelChangeAncestors(ids: ({ peer: PeerID, counter: number })[], f: (change:
|
|
1575
|
+
travelChangeAncestors(ids: ({ peer: PeerID, counter: number })[], f: (change: Change) => boolean): void;
|
|
1576
1576
|
/**
|
|
1577
1577
|
* Checkout the `DocState` to a specific version.
|
|
1578
1578
|
*
|
|
@@ -1880,8 +1880,9 @@ export class LoroDoc {
|
|
|
1880
1880
|
* doc2.importUpdateBatch([snapshot, updates]);
|
|
1881
1881
|
* ```
|
|
1882
1882
|
* @param {Array<any>} data
|
|
1883
|
+
* @returns {ImportStatus}
|
|
1883
1884
|
*/
|
|
1884
|
-
importUpdateBatch(data: Array<any>):
|
|
1885
|
+
importUpdateBatch(data: Array<any>): ImportStatus;
|
|
1885
1886
|
/**
|
|
1886
1887
|
* Get the shallow json format of the document state.
|
|
1887
1888
|
*
|