loro-crdt 1.5.5 → 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.
package/web/loro_wasm.js CHANGED
@@ -375,6 +375,44 @@ export function decodeImportBlobMeta(blob, check_checksum) {
375
375
  }
376
376
  }
377
377
 
378
+ /**
379
+ * Redacts sensitive content in JSON updates within the specified version range.
380
+ *
381
+ * This function allows you to share document history while removing potentially sensitive content.
382
+ * It preserves the document structure and collaboration capabilities while replacing content with
383
+ * placeholders according to these redaction rules:
384
+ *
385
+ * - Preserves delete and move operations
386
+ * - Replaces text insertion content with the Unicode replacement character
387
+ * - Substitutes list and map insert values with null
388
+ * - Maintains structure of child containers
389
+ * - Replaces text mark values with null
390
+ * - Preserves map keys and text annotation keys
391
+ *
392
+ * @param {Object|string} jsonUpdates - The JSON updates to redact (object or JSON string)
393
+ * @param {Object} versionRange - Version range defining what content to redact,
394
+ * format: { peerId: [startCounter, endCounter], ... }
395
+ * @returns {Object} The redacted JSON updates
396
+ * @param {string | JsonSchema} json_updates
397
+ * @param {any} version_range
398
+ * @returns {JsonSchema}
399
+ */
400
+ export function redactJsonUpdates(json_updates, version_range) {
401
+ try {
402
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
403
+ wasm.redactJsonUpdates(retptr, addHeapObject(json_updates), addHeapObject(version_range));
404
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
405
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
406
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
407
+ if (r2) {
408
+ throw takeObject(r1);
409
+ }
410
+ return takeObject(r0);
411
+ } finally {
412
+ wasm.__wbindgen_add_to_stack_pointer(16);
413
+ }
414
+ }
415
+
378
416
  function __wbg_adapter_60(arg0, arg1, arg2) {
379
417
  wasm.__wbindgen_export_5(arg0, arg1, addHeapObject(arg2));
380
418
  }
@@ -6125,6 +6163,22 @@ export class UndoManager {
6125
6163
  wasm.__wbindgen_add_to_stack_pointer(16);
6126
6164
  }
6127
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
+ }
6128
6182
  /**
6129
6183
  * Can undo the last operation.
6130
6184
  * @returns {boolean}
@@ -6720,7 +6774,7 @@ function __wbg_get_imports() {
6720
6774
  const ret = getObject(arg0).node;
6721
6775
  return addHeapObject(ret);
6722
6776
  };
6723
- imports.wbg.__wbg_now_3e8577e703add0ba = function() {
6777
+ imports.wbg.__wbg_now_dc4980649ae44bd7 = function() {
6724
6778
  const ret = Date.now();
6725
6779
  return ret;
6726
6780
  };
@@ -6835,11 +6889,11 @@ function __wbg_get_imports() {
6835
6889
  return ret;
6836
6890
  };
6837
6891
  imports.wbg.__wbindgen_closure_wrapper483 = function(arg0, arg1, arg2) {
6838
- const ret = makeMutClosure(arg0, arg1, 10, __wbg_adapter_60);
6892
+ const ret = makeMutClosure(arg0, arg1, 8, __wbg_adapter_60);
6839
6893
  return addHeapObject(ret);
6840
6894
  };
6841
- imports.wbg.__wbindgen_closure_wrapper485 = function(arg0, arg1, arg2) {
6842
- 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);
6843
6897
  return addHeapObject(ret);
6844
6898
  };
6845
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;
@@ -304,6 +306,7 @@ export const decodeImportBlobMeta: (a: number, b: number, c: number, d: number)
304
306
  export const __wbg_changemodifier_free: (a: number, b: number) => void;
305
307
  export const changemodifier_setMessage: (a: number, b: number, c: number) => number;
306
308
  export const changemodifier_setTimestamp: (a: number, b: number) => number;
309
+ export const redactJsonUpdates: (a: number, b: number, c: number) => void;
307
310
  export const lorodoc_importUpdateBatch: (a: number, b: number, c: number) => void;
308
311
  export const __wbg_loromovablelist_free: (a: number, b: number) => void;
309
312
  export const __wbindgen_export_0: (a: number, b: number) => number;