loro-crdt 1.5.6 → 1.5.7

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.
@@ -905,6 +905,24 @@ interface UndoManager {
905
905
  * @param listener - The callback function.
906
906
  */
907
907
  setOnPop(listener?: UndoConfig["onPop"]): void;
908
+
909
+ /**
910
+ * Starts a new grouping of undo operations.
911
+ * All changes/commits made after this call will be grouped/merged together.
912
+ * to end the group, call `groupEnd`.
913
+ *
914
+ * If a remote import is received within the group, its possible that the undo item will be
915
+ * split and the group will be automatically ended.
916
+ *
917
+ * Calling `groupStart` within an active group will throw but have no effect.
918
+ *
919
+ */
920
+ groupStart(): void;
921
+
922
+ /**
923
+ * Ends the current grouping of undo operations.
924
+ */
925
+ groupEnd(): void;
908
926
  }
909
927
  interface LoroDoc<T extends Record<string, Container> = Record<string, Container>> {
910
928
  /**
@@ -6171,6 +6171,22 @@ export class UndoManager {
6171
6171
  wasm.__wbindgen_add_to_stack_pointer(16);
6172
6172
  }
6173
6173
  }
6174
+ groupStart() {
6175
+ try {
6176
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
6177
+ wasm.undomanager_groupStart(retptr, this.__wbg_ptr);
6178
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
6179
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
6180
+ if (r1) {
6181
+ throw takeObject(r0);
6182
+ }
6183
+ } finally {
6184
+ wasm.__wbindgen_add_to_stack_pointer(16);
6185
+ }
6186
+ }
6187
+ groupEnd() {
6188
+ wasm.undomanager_groupEnd(this.__wbg_ptr);
6189
+ }
6174
6190
  /**
6175
6191
  * Can undo the last operation.
6176
6192
  * @returns {boolean}
@@ -6789,7 +6805,7 @@ export function __wbg_node_02999533c4ea02e3(arg0) {
6789
6805
  return addHeapObject(ret);
6790
6806
  };
6791
6807
 
6792
- export function __wbg_now_3e8577e703add0ba() {
6808
+ export function __wbg_now_dc4980649ae44bd7() {
6793
6809
  const ret = Date.now();
6794
6810
  return ret;
6795
6811
  };
@@ -6931,12 +6947,12 @@ export function __wbindgen_cb_drop(arg0) {
6931
6947
  };
6932
6948
 
6933
6949
  export function __wbindgen_closure_wrapper483(arg0, arg1, arg2) {
6934
- const ret = makeMutClosure(arg0, arg1, 10, __wbg_adapter_60);
6950
+ const ret = makeMutClosure(arg0, arg1, 8, __wbg_adapter_60);
6935
6951
  return addHeapObject(ret);
6936
6952
  };
6937
6953
 
6938
- export function __wbindgen_closure_wrapper485(arg0, arg1, arg2) {
6939
- const ret = makeMutClosure(arg0, arg1, 8, __wbg_adapter_63);
6954
+ export function __wbindgen_closure_wrapper486(arg0, arg1, arg2) {
6955
+ const ret = makeMutClosure(arg0, arg1, 10, __wbg_adapter_63);
6940
6956
  return addHeapObject(ret);
6941
6957
  };
6942
6958
 
Binary file
@@ -280,6 +280,8 @@ export const __wbg_undomanager_free: (a: number, b: number) => void;
280
280
  export const undomanager_new: (a: number, b: number) => number;
281
281
  export const undomanager_undo: (a: number, b: number) => void;
282
282
  export const undomanager_redo: (a: number, b: number) => void;
283
+ export const undomanager_groupStart: (a: number, b: number) => void;
284
+ export const undomanager_groupEnd: (a: number) => void;
283
285
  export const undomanager_canUndo: (a: number) => number;
284
286
  export const undomanager_canRedo: (a: number) => number;
285
287
  export const undomanager_setMaxUndoSteps: (a: number, b: number) => void;
@@ -905,6 +905,24 @@ interface UndoManager {
905
905
  * @param listener - The callback function.
906
906
  */
907
907
  setOnPop(listener?: UndoConfig["onPop"]): void;
908
+
909
+ /**
910
+ * Starts a new grouping of undo operations.
911
+ * All changes/commits made after this call will be grouped/merged together.
912
+ * to end the group, call `groupEnd`.
913
+ *
914
+ * If a remote import is received within the group, its possible that the undo item will be
915
+ * split and the group will be automatically ended.
916
+ *
917
+ * Calling `groupStart` within an active group will throw but have no effect.
918
+ *
919
+ */
920
+ groupStart(): void;
921
+
922
+ /**
923
+ * Ends the current grouping of undo operations.
924
+ */
925
+ groupEnd(): void;
908
926
  }
909
927
  interface LoroDoc<T extends Record<string, Container> = Record<string, Container>> {
910
928
  /**
@@ -6179,6 +6179,22 @@ class UndoManager {
6179
6179
  wasm.__wbindgen_add_to_stack_pointer(16);
6180
6180
  }
6181
6181
  }
6182
+ groupStart() {
6183
+ try {
6184
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
6185
+ wasm.undomanager_groupStart(retptr, this.__wbg_ptr);
6186
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
6187
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
6188
+ if (r1) {
6189
+ throw takeObject(r0);
6190
+ }
6191
+ } finally {
6192
+ wasm.__wbindgen_add_to_stack_pointer(16);
6193
+ }
6194
+ }
6195
+ groupEnd() {
6196
+ wasm.undomanager_groupEnd(this.__wbg_ptr);
6197
+ }
6182
6198
  /**
6183
6199
  * Can undo the last operation.
6184
6200
  * @returns {boolean}
@@ -6799,7 +6815,7 @@ module.exports.__wbg_node_02999533c4ea02e3 = function(arg0) {
6799
6815
  return addHeapObject(ret);
6800
6816
  };
6801
6817
 
6802
- module.exports.__wbg_now_3e8577e703add0ba = function() {
6818
+ module.exports.__wbg_now_dc4980649ae44bd7 = function() {
6803
6819
  const ret = Date.now();
6804
6820
  return ret;
6805
6821
  };
@@ -6941,12 +6957,12 @@ module.exports.__wbindgen_cb_drop = function(arg0) {
6941
6957
  };
6942
6958
 
6943
6959
  module.exports.__wbindgen_closure_wrapper483 = function(arg0, arg1, arg2) {
6944
- const ret = makeMutClosure(arg0, arg1, 10, __wbg_adapter_60);
6960
+ const ret = makeMutClosure(arg0, arg1, 8, __wbg_adapter_60);
6945
6961
  return addHeapObject(ret);
6946
6962
  };
6947
6963
 
6948
- module.exports.__wbindgen_closure_wrapper485 = function(arg0, arg1, arg2) {
6949
- const ret = makeMutClosure(arg0, arg1, 8, __wbg_adapter_63);
6964
+ module.exports.__wbindgen_closure_wrapper486 = function(arg0, arg1, arg2) {
6965
+ const ret = makeMutClosure(arg0, arg1, 10, __wbg_adapter_63);
6950
6966
  return addHeapObject(ret);
6951
6967
  };
6952
6968
 
Binary file
@@ -280,6 +280,8 @@ export const __wbg_undomanager_free: (a: number, b: number) => void;
280
280
  export const undomanager_new: (a: number, b: number) => number;
281
281
  export const undomanager_undo: (a: number, b: number) => void;
282
282
  export const undomanager_redo: (a: number, b: number) => void;
283
+ export const undomanager_groupStart: (a: number, b: number) => void;
284
+ export const undomanager_groupEnd: (a: number) => void;
283
285
  export const undomanager_canUndo: (a: number) => number;
284
286
  export const undomanager_canRedo: (a: number) => number;
285
287
  export const undomanager_setMaxUndoSteps: (a: number, b: number) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "loro-crdt",
3
- "version": "1.5.6",
3
+ "version": "1.5.7",
4
4
  "description": "Loro CRDTs is a high-performance CRDT framework that makes your app state synchronized, collaborative and maintainable effortlessly.",
5
5
  "keywords": [
6
6
  "crdt",
@@ -905,6 +905,24 @@ interface UndoManager {
905
905
  * @param listener - The callback function.
906
906
  */
907
907
  setOnPop(listener?: UndoConfig["onPop"]): void;
908
+
909
+ /**
910
+ * Starts a new grouping of undo operations.
911
+ * All changes/commits made after this call will be grouped/merged together.
912
+ * to end the group, call `groupEnd`.
913
+ *
914
+ * If a remote import is received within the group, its possible that the undo item will be
915
+ * split and the group will be automatically ended.
916
+ *
917
+ * Calling `groupStart` within an active group will throw but have no effect.
918
+ *
919
+ */
920
+ groupStart(): void;
921
+
922
+ /**
923
+ * Ends the current grouping of undo operations.
924
+ */
925
+ groupEnd(): void;
908
926
  }
909
927
  interface LoroDoc<T extends Record<string, Container> = Record<string, Container>> {
910
928
  /**
@@ -3951,6 +3969,8 @@ export interface InitOutput {
3951
3969
  readonly undomanager_new: (a: number, b: number) => number;
3952
3970
  readonly undomanager_undo: (a: number, b: number) => void;
3953
3971
  readonly undomanager_redo: (a: number, b: number) => void;
3972
+ readonly undomanager_groupStart: (a: number, b: number) => void;
3973
+ readonly undomanager_groupEnd: (a: number) => void;
3954
3974
  readonly undomanager_canUndo: (a: number) => number;
3955
3975
  readonly undomanager_canRedo: (a: number) => number;
3956
3976
  readonly undomanager_setMaxUndoSteps: (a: number, b: number) => void;
package/web/loro_wasm.js CHANGED
@@ -6163,6 +6163,22 @@ export class UndoManager {
6163
6163
  wasm.__wbindgen_add_to_stack_pointer(16);
6164
6164
  }
6165
6165
  }
6166
+ groupStart() {
6167
+ try {
6168
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
6169
+ wasm.undomanager_groupStart(retptr, this.__wbg_ptr);
6170
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
6171
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
6172
+ if (r1) {
6173
+ throw takeObject(r0);
6174
+ }
6175
+ } finally {
6176
+ wasm.__wbindgen_add_to_stack_pointer(16);
6177
+ }
6178
+ }
6179
+ groupEnd() {
6180
+ wasm.undomanager_groupEnd(this.__wbg_ptr);
6181
+ }
6166
6182
  /**
6167
6183
  * Can undo the last operation.
6168
6184
  * @returns {boolean}
@@ -6758,7 +6774,7 @@ function __wbg_get_imports() {
6758
6774
  const ret = getObject(arg0).node;
6759
6775
  return addHeapObject(ret);
6760
6776
  };
6761
- imports.wbg.__wbg_now_3e8577e703add0ba = function() {
6777
+ imports.wbg.__wbg_now_dc4980649ae44bd7 = function() {
6762
6778
  const ret = Date.now();
6763
6779
  return ret;
6764
6780
  };
@@ -6873,11 +6889,11 @@ function __wbg_get_imports() {
6873
6889
  return ret;
6874
6890
  };
6875
6891
  imports.wbg.__wbindgen_closure_wrapper483 = function(arg0, arg1, arg2) {
6876
- const ret = makeMutClosure(arg0, arg1, 10, __wbg_adapter_60);
6892
+ const ret = makeMutClosure(arg0, arg1, 8, __wbg_adapter_60);
6877
6893
  return addHeapObject(ret);
6878
6894
  };
6879
- imports.wbg.__wbindgen_closure_wrapper485 = function(arg0, arg1, arg2) {
6880
- const ret = makeMutClosure(arg0, arg1, 8, __wbg_adapter_63);
6895
+ imports.wbg.__wbindgen_closure_wrapper486 = function(arg0, arg1, arg2) {
6896
+ const ret = makeMutClosure(arg0, arg1, 10, __wbg_adapter_63);
6881
6897
  return addHeapObject(ret);
6882
6898
  };
6883
6899
  imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
Binary file
@@ -280,6 +280,8 @@ export const __wbg_undomanager_free: (a: number, b: number) => void;
280
280
  export const undomanager_new: (a: number, b: number) => number;
281
281
  export const undomanager_undo: (a: number, b: number) => void;
282
282
  export const undomanager_redo: (a: number, b: number) => void;
283
+ export const undomanager_groupStart: (a: number, b: number) => void;
284
+ export const undomanager_groupEnd: (a: number) => void;
283
285
  export const undomanager_canUndo: (a: number) => number;
284
286
  export const undomanager_canRedo: (a: number) => number;
285
287
  export const undomanager_setMaxUndoSteps: (a: number, b: number) => void;