@quillmark/wasm 0.87.2 → 0.87.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.
- package/CHANGELOG.md +14 -0
- package/bundler/wasm.d.ts +32 -9
- package/bundler/wasm_bg.js +89 -23
- package/bundler/wasm_bg.wasm +0 -0
- package/bundler/wasm_bg.wasm.d.ts +4 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## v0.87.3 - 2026-06-04
|
|
4
|
+
|
|
5
|
+
- Complete and consolidate the $ext mutator surface (#689)
|
|
6
|
+
- Complete the `$ext` mutator matrix with namespace-scoped removal and
|
|
7
|
+
card-indexed namespace ops: `remove_ext_namespace` (Rust `Card`,
|
|
8
|
+
`removeExtNamespace` WASM, `remove_ext_namespace` Python) plus
|
|
9
|
+
`setCardExtNamespace` / `removeCardExtNamespace`. Deleting a sub-namespace
|
|
10
|
+
is now the preferred way to clear `$ext` state — it preserves sibling
|
|
11
|
+
consumers' slots and drops `$ext` entirely once empty, where `removeExt`
|
|
12
|
+
remains a blunt clear-everything escape hatch.
|
|
13
|
+
- **Breaking (bindings):** the whole-map card mutator `updateCardExt` /
|
|
14
|
+
`update_card_ext` is renamed `setCardExt` / `set_card_ext` for naming
|
|
15
|
+
consistency with `setExt` on the main card.
|
|
16
|
+
|
|
3
17
|
## v0.87.2 - 2026-06-03
|
|
4
18
|
|
|
5
19
|
- Expose $ext write path through the editor surface and bindings (#687)
|
package/bundler/wasm.d.ts
CHANGED
|
@@ -326,20 +326,36 @@ export class Document {
|
|
|
326
326
|
static quillRefHint(): string;
|
|
327
327
|
removeCard(index: number): Card | undefined;
|
|
328
328
|
/**
|
|
329
|
-
* Remove the `$ext` map from the card at `index
|
|
330
|
-
* map or `undefined`. Throws if out of range.
|
|
329
|
+
* Remove the `$ext` map from the composable card at `index` *entirely*,
|
|
330
|
+
* returning the previous map or `undefined`. Throws if out of range.
|
|
331
|
+
* Prefer `removeCardExtNamespace` to clear only one consumer's slot.
|
|
331
332
|
*/
|
|
332
333
|
removeCardExt(index: number): Record<string, unknown> | undefined;
|
|
334
|
+
/**
|
|
335
|
+
* Remove `namespace` from the composable card's `$ext` map, returning the
|
|
336
|
+
* value stored there or `undefined`; clears `$ext` entirely once empty.
|
|
337
|
+
* The card-indexed twin of `removeExtNamespace`. Throws if out of range.
|
|
338
|
+
*/
|
|
339
|
+
removeCardExtNamespace(index: number, namespace: string): any;
|
|
333
340
|
/**
|
|
334
341
|
* Remove a field on the card at `index`. Returns the removed value or
|
|
335
342
|
* `undefined`. Throws if `index` is out of range or `name` is invalid.
|
|
336
343
|
*/
|
|
337
344
|
removeCardField(index: number, name: string): any;
|
|
338
345
|
/**
|
|
339
|
-
* Remove the `$ext` map from the main card
|
|
340
|
-
* `undefined`.
|
|
346
|
+
* Remove the `$ext` map from the main card *entirely*, returning the
|
|
347
|
+
* previous map or `undefined`. This is a blunt escape hatch that discards
|
|
348
|
+
* every namespace at once — prefer `removeExtNamespace` to clear only your
|
|
349
|
+
* own slot while leaving sibling consumers' state intact.
|
|
341
350
|
*/
|
|
342
351
|
removeExt(): Record<string, unknown> | undefined;
|
|
352
|
+
/**
|
|
353
|
+
* Remove `namespace` from the main card's `$ext` map, returning the value
|
|
354
|
+
* stored there or `undefined`. This is the recommended way to clear `$ext`
|
|
355
|
+
* state: sibling namespaces survive, and when the last namespace is removed
|
|
356
|
+
* the `$ext` entry is dropped entirely (not left as `$ext: {}`).
|
|
357
|
+
*/
|
|
358
|
+
removeExtNamespace(namespace: string): any;
|
|
343
359
|
/**
|
|
344
360
|
* Remove a payload field on the main card, returning the removed value or
|
|
345
361
|
* `undefined`. Throws if `name` does not match `[a-z_][a-z0-9_]*`.
|
|
@@ -353,6 +369,18 @@ export class Document {
|
|
|
353
369
|
* `fromJson` throws.
|
|
354
370
|
*/
|
|
355
371
|
static schemaVersionOf(json: string): string | undefined;
|
|
372
|
+
/**
|
|
373
|
+
* Replace the `$ext` map on the composable card at `index`. Throws if out
|
|
374
|
+
* of range or `value` is not a plain object. Named to mirror `setExt` on
|
|
375
|
+
* the main card; `setCardExtNamespace` is the sibling-safe alternative.
|
|
376
|
+
*/
|
|
377
|
+
setCardExt(index: number, value: any): void;
|
|
378
|
+
/**
|
|
379
|
+
* Merge `value` into the composable card's `$ext` map under `namespace`,
|
|
380
|
+
* preserving sibling namespaces. The card-indexed twin of `setExtNamespace`.
|
|
381
|
+
* Throws if out of range or `value` cannot be serialized.
|
|
382
|
+
*/
|
|
383
|
+
setCardExtNamespace(index: number, namespace: string, value: any): void;
|
|
356
384
|
/**
|
|
357
385
|
* Replace the kind of the card at `index`. Payload and body are untouched;
|
|
358
386
|
* schema-aware migration is the caller's responsibility.
|
|
@@ -416,11 +444,6 @@ export class Document {
|
|
|
416
444
|
* Replace the body of the card at `index`. Throws if out of range.
|
|
417
445
|
*/
|
|
418
446
|
updateCardBody(index: number, body: string): void;
|
|
419
|
-
/**
|
|
420
|
-
* Replace the `$ext` map on the card at `index`. Throws if out of range or
|
|
421
|
-
* `value` is not a plain object.
|
|
422
|
-
*/
|
|
423
|
-
updateCardExt(index: number, value: any): void;
|
|
424
447
|
/**
|
|
425
448
|
* Update a field on the card at `index`.
|
|
426
449
|
* Throws if `index` is out of range, `name` is reserved or invalid.
|
package/bundler/wasm_bg.js
CHANGED
|
@@ -309,8 +309,9 @@ export class Document {
|
|
|
309
309
|
return takeObject(ret);
|
|
310
310
|
}
|
|
311
311
|
/**
|
|
312
|
-
* Remove the `$ext` map from the card at `index
|
|
313
|
-
* map or `undefined`. Throws if out of range.
|
|
312
|
+
* Remove the `$ext` map from the composable card at `index` *entirely*,
|
|
313
|
+
* returning the previous map or `undefined`. Throws if out of range.
|
|
314
|
+
* Prefer `removeCardExtNamespace` to clear only one consumer's slot.
|
|
314
315
|
* @param {number} index
|
|
315
316
|
* @returns {Record<string, unknown> | undefined}
|
|
316
317
|
*/
|
|
@@ -329,6 +330,31 @@ export class Document {
|
|
|
329
330
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
330
331
|
}
|
|
331
332
|
}
|
|
333
|
+
/**
|
|
334
|
+
* Remove `namespace` from the composable card's `$ext` map, returning the
|
|
335
|
+
* value stored there or `undefined`; clears `$ext` entirely once empty.
|
|
336
|
+
* The card-indexed twin of `removeExtNamespace`. Throws if out of range.
|
|
337
|
+
* @param {number} index
|
|
338
|
+
* @param {string} namespace
|
|
339
|
+
* @returns {any}
|
|
340
|
+
*/
|
|
341
|
+
removeCardExtNamespace(index, namespace) {
|
|
342
|
+
try {
|
|
343
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
344
|
+
const ptr0 = passStringToWasm0(namespace, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
345
|
+
const len0 = WASM_VECTOR_LEN;
|
|
346
|
+
wasm.document_removeCardExtNamespace(retptr, this.__wbg_ptr, index, ptr0, len0);
|
|
347
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
348
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
349
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
350
|
+
if (r2) {
|
|
351
|
+
throw takeObject(r1);
|
|
352
|
+
}
|
|
353
|
+
return takeObject(r0);
|
|
354
|
+
} finally {
|
|
355
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
356
|
+
}
|
|
357
|
+
}
|
|
332
358
|
/**
|
|
333
359
|
* Remove a field on the card at `index`. Returns the removed value or
|
|
334
360
|
* `undefined`. Throws if `index` is out of range or `name` is invalid.
|
|
@@ -354,14 +380,30 @@ export class Document {
|
|
|
354
380
|
}
|
|
355
381
|
}
|
|
356
382
|
/**
|
|
357
|
-
* Remove the `$ext` map from the main card
|
|
358
|
-
* `undefined`.
|
|
383
|
+
* Remove the `$ext` map from the main card *entirely*, returning the
|
|
384
|
+
* previous map or `undefined`. This is a blunt escape hatch that discards
|
|
385
|
+
* every namespace at once — prefer `removeExtNamespace` to clear only your
|
|
386
|
+
* own slot while leaving sibling consumers' state intact.
|
|
359
387
|
* @returns {Record<string, unknown> | undefined}
|
|
360
388
|
*/
|
|
361
389
|
removeExt() {
|
|
362
390
|
const ret = wasm.document_removeExt(this.__wbg_ptr);
|
|
363
391
|
return takeObject(ret);
|
|
364
392
|
}
|
|
393
|
+
/**
|
|
394
|
+
* Remove `namespace` from the main card's `$ext` map, returning the value
|
|
395
|
+
* stored there or `undefined`. This is the recommended way to clear `$ext`
|
|
396
|
+
* state: sibling namespaces survive, and when the last namespace is removed
|
|
397
|
+
* the `$ext` entry is dropped entirely (not left as `$ext: {}`).
|
|
398
|
+
* @param {string} namespace
|
|
399
|
+
* @returns {any}
|
|
400
|
+
*/
|
|
401
|
+
removeExtNamespace(namespace) {
|
|
402
|
+
const ptr0 = passStringToWasm0(namespace, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
403
|
+
const len0 = WASM_VECTOR_LEN;
|
|
404
|
+
const ret = wasm.document_removeExtNamespace(this.__wbg_ptr, ptr0, len0);
|
|
405
|
+
return takeObject(ret);
|
|
406
|
+
}
|
|
365
407
|
/**
|
|
366
408
|
* Remove a payload field on the main card, returning the removed value or
|
|
367
409
|
* `undefined`. Throws if `name` does not match `[a-z_][a-z0-9_]*`.
|
|
@@ -419,6 +461,49 @@ export class Document {
|
|
|
419
461
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
420
462
|
}
|
|
421
463
|
}
|
|
464
|
+
/**
|
|
465
|
+
* Replace the `$ext` map on the composable card at `index`. Throws if out
|
|
466
|
+
* of range or `value` is not a plain object. Named to mirror `setExt` on
|
|
467
|
+
* the main card; `setCardExtNamespace` is the sibling-safe alternative.
|
|
468
|
+
* @param {number} index
|
|
469
|
+
* @param {any} value
|
|
470
|
+
*/
|
|
471
|
+
setCardExt(index, value) {
|
|
472
|
+
try {
|
|
473
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
474
|
+
wasm.document_setCardExt(retptr, this.__wbg_ptr, index, addHeapObject(value));
|
|
475
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
476
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
477
|
+
if (r1) {
|
|
478
|
+
throw takeObject(r0);
|
|
479
|
+
}
|
|
480
|
+
} finally {
|
|
481
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
/**
|
|
485
|
+
* Merge `value` into the composable card's `$ext` map under `namespace`,
|
|
486
|
+
* preserving sibling namespaces. The card-indexed twin of `setExtNamespace`.
|
|
487
|
+
* Throws if out of range or `value` cannot be serialized.
|
|
488
|
+
* @param {number} index
|
|
489
|
+
* @param {string} namespace
|
|
490
|
+
* @param {any} value
|
|
491
|
+
*/
|
|
492
|
+
setCardExtNamespace(index, namespace, value) {
|
|
493
|
+
try {
|
|
494
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
495
|
+
const ptr0 = passStringToWasm0(namespace, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
496
|
+
const len0 = WASM_VECTOR_LEN;
|
|
497
|
+
wasm.document_setCardExtNamespace(retptr, this.__wbg_ptr, index, ptr0, len0, addHeapObject(value));
|
|
498
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
499
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
500
|
+
if (r1) {
|
|
501
|
+
throw takeObject(r0);
|
|
502
|
+
}
|
|
503
|
+
} finally {
|
|
504
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
505
|
+
}
|
|
506
|
+
}
|
|
422
507
|
/**
|
|
423
508
|
* Replace the kind of the card at `index`. Payload and body are untouched;
|
|
424
509
|
* schema-aware migration is the caller's responsibility.
|
|
@@ -629,25 +714,6 @@ export class Document {
|
|
|
629
714
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
630
715
|
}
|
|
631
716
|
}
|
|
632
|
-
/**
|
|
633
|
-
* Replace the `$ext` map on the card at `index`. Throws if out of range or
|
|
634
|
-
* `value` is not a plain object.
|
|
635
|
-
* @param {number} index
|
|
636
|
-
* @param {any} value
|
|
637
|
-
*/
|
|
638
|
-
updateCardExt(index, value) {
|
|
639
|
-
try {
|
|
640
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
641
|
-
wasm.document_updateCardExt(retptr, this.__wbg_ptr, index, addHeapObject(value));
|
|
642
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
643
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
644
|
-
if (r1) {
|
|
645
|
-
throw takeObject(r0);
|
|
646
|
-
}
|
|
647
|
-
} finally {
|
|
648
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
649
|
-
}
|
|
650
|
-
}
|
|
651
717
|
/**
|
|
652
718
|
* Update a field on the card at `index`.
|
|
653
719
|
* Throws if `index` is out of range, `name` is reserved or invalid.
|
package/bundler/wasm_bg.wasm
CHANGED
|
Binary file
|
|
@@ -23,11 +23,15 @@ export const document_quillRef: (a: number, b: number) => void;
|
|
|
23
23
|
export const document_quillRefHint: (a: number) => void;
|
|
24
24
|
export const document_removeCard: (a: number, b: number) => number;
|
|
25
25
|
export const document_removeCardExt: (a: number, b: number, c: number) => void;
|
|
26
|
+
export const document_removeCardExtNamespace: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
26
27
|
export const document_removeCardField: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
27
28
|
export const document_removeExt: (a: number) => number;
|
|
29
|
+
export const document_removeExtNamespace: (a: number, b: number, c: number) => number;
|
|
28
30
|
export const document_removeField: (a: number, b: number, c: number, d: number) => void;
|
|
29
31
|
export const document_replaceBody: (a: number, b: number, c: number) => void;
|
|
30
32
|
export const document_schemaVersionOf: (a: number, b: number, c: number) => void;
|
|
33
|
+
export const document_setCardExt: (a: number, b: number, c: number, d: number) => void;
|
|
34
|
+
export const document_setCardExtNamespace: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
31
35
|
export const document_setCardKind: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
32
36
|
export const document_setExt: (a: number, b: number, c: number) => void;
|
|
33
37
|
export const document_setExtNamespace: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
@@ -38,7 +42,6 @@ export const document_toJson: (a: number, b: number) => void;
|
|
|
38
42
|
export const document_toMarkdown: (a: number, b: number) => void;
|
|
39
43
|
export const document_tryFromJson: (a: number, b: number) => number;
|
|
40
44
|
export const document_updateCardBody: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
41
|
-
export const document_updateCardExt: (a: number, b: number, c: number, d: number) => void;
|
|
42
45
|
export const document_updateCardField: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
43
46
|
export const document_warnings: (a: number) => number;
|
|
44
47
|
export const init: () => void;
|