@quillmark/wasm 0.87.1 → 0.87.2

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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## v0.87.2 - 2026-06-03
4
+
5
+ - Expose $ext write path through the editor surface and bindings (#687)
6
+ - Surface prose/canon entrypoint and fix canon documentation drift (#686)
7
+
8
+
3
9
  ## v0.87.1 - 2026-06-01
4
10
 
5
11
  - Make $quill reference grammar a single source of truth (#684)
package/bundler/wasm.d.ts CHANGED
@@ -325,11 +325,21 @@ export class Document {
325
325
  */
326
326
  static quillRefHint(): string;
327
327
  removeCard(index: number): Card | undefined;
328
+ /**
329
+ * Remove the `$ext` map from the card at `index`, returning the previous
330
+ * map or `undefined`. Throws if out of range.
331
+ */
332
+ removeCardExt(index: number): Record<string, unknown> | undefined;
328
333
  /**
329
334
  * Remove a field on the card at `index`. Returns the removed value or
330
335
  * `undefined`. Throws if `index` is out of range or `name` is invalid.
331
336
  */
332
337
  removeCardField(index: number, name: string): any;
338
+ /**
339
+ * Remove the `$ext` map from the main card, returning the previous map or
340
+ * `undefined`.
341
+ */
342
+ removeExt(): Record<string, unknown> | undefined;
333
343
  /**
334
344
  * Remove a payload field on the main card, returning the removed value or
335
345
  * `undefined`. Throws if `name` does not match `[a-z_][a-z0-9_]*`.
@@ -349,6 +359,20 @@ export class Document {
349
359
  * Throws if `index` is out of range or `newKind` is invalid.
350
360
  */
351
361
  setCardKind(index: number, new_kind: string): void;
362
+ /**
363
+ * Replace the opaque `$ext` map on the main card. `value` must be a plain
364
+ * object; throws otherwise. `$ext` carries out-of-band consumer state and
365
+ * never reaches the rendered output. Pass `{}` to record an explicit
366
+ * empty `$ext`.
367
+ */
368
+ setExt(value: any): void;
369
+ /**
370
+ * Merge `value` into the main card's `$ext` map under `namespace`, creating
371
+ * the map when absent and replacing any existing value at that key. Sibling
372
+ * namespaces are preserved, so independent consumers (`$ext.presentation`,
373
+ * `$ext.agent`, …) don't clobber each other.
374
+ */
375
+ setExtNamespace(namespace: string, value: any): void;
352
376
  /**
353
377
  * Update a payload field on the main card. Clears any existing `!fill` marker.
354
378
  *
@@ -392,6 +416,11 @@ export class Document {
392
416
  * Replace the body of the card at `index`. Throws if out of range.
393
417
  */
394
418
  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;
395
424
  /**
396
425
  * Update a field on the card at `index`.
397
426
  * Throws if `index` is out of range, `name` is reserved or invalid.
@@ -308,6 +308,27 @@ export class Document {
308
308
  const ret = wasm.document_removeCard(this.__wbg_ptr, index);
309
309
  return takeObject(ret);
310
310
  }
311
+ /**
312
+ * Remove the `$ext` map from the card at `index`, returning the previous
313
+ * map or `undefined`. Throws if out of range.
314
+ * @param {number} index
315
+ * @returns {Record<string, unknown> | undefined}
316
+ */
317
+ removeCardExt(index) {
318
+ try {
319
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
320
+ wasm.document_removeCardExt(retptr, this.__wbg_ptr, index);
321
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
322
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
323
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
324
+ if (r2) {
325
+ throw takeObject(r1);
326
+ }
327
+ return takeObject(r0);
328
+ } finally {
329
+ wasm.__wbindgen_add_to_stack_pointer(16);
330
+ }
331
+ }
311
332
  /**
312
333
  * Remove a field on the card at `index`. Returns the removed value or
313
334
  * `undefined`. Throws if `index` is out of range or `name` is invalid.
@@ -332,6 +353,15 @@ export class Document {
332
353
  wasm.__wbindgen_add_to_stack_pointer(16);
333
354
  }
334
355
  }
356
+ /**
357
+ * Remove the `$ext` map from the main card, returning the previous map or
358
+ * `undefined`.
359
+ * @returns {Record<string, unknown> | undefined}
360
+ */
361
+ removeExt() {
362
+ const ret = wasm.document_removeExt(this.__wbg_ptr);
363
+ return takeObject(ret);
364
+ }
335
365
  /**
336
366
  * Remove a payload field on the main card, returning the removed value or
337
367
  * `undefined`. Throws if `name` does not match `[a-z_][a-z0-9_]*`.
@@ -411,6 +441,49 @@ export class Document {
411
441
  wasm.__wbindgen_add_to_stack_pointer(16);
412
442
  }
413
443
  }
444
+ /**
445
+ * Replace the opaque `$ext` map on the main card. `value` must be a plain
446
+ * object; throws otherwise. `$ext` carries out-of-band consumer state and
447
+ * never reaches the rendered output. Pass `{}` to record an explicit
448
+ * empty `$ext`.
449
+ * @param {any} value
450
+ */
451
+ setExt(value) {
452
+ try {
453
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
454
+ wasm.document_setExt(retptr, this.__wbg_ptr, addHeapObject(value));
455
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
456
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
457
+ if (r1) {
458
+ throw takeObject(r0);
459
+ }
460
+ } finally {
461
+ wasm.__wbindgen_add_to_stack_pointer(16);
462
+ }
463
+ }
464
+ /**
465
+ * Merge `value` into the main card's `$ext` map under `namespace`, creating
466
+ * the map when absent and replacing any existing value at that key. Sibling
467
+ * namespaces are preserved, so independent consumers (`$ext.presentation`,
468
+ * `$ext.agent`, …) don't clobber each other.
469
+ * @param {string} namespace
470
+ * @param {any} value
471
+ */
472
+ setExtNamespace(namespace, value) {
473
+ try {
474
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
475
+ const ptr0 = passStringToWasm0(namespace, wasm.__wbindgen_export, wasm.__wbindgen_export2);
476
+ const len0 = WASM_VECTOR_LEN;
477
+ wasm.document_setExtNamespace(retptr, this.__wbg_ptr, ptr0, len0, addHeapObject(value));
478
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
479
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
480
+ if (r1) {
481
+ throw takeObject(r0);
482
+ }
483
+ } finally {
484
+ wasm.__wbindgen_add_to_stack_pointer(16);
485
+ }
486
+ }
414
487
  /**
415
488
  * Update a payload field on the main card. Clears any existing `!fill` marker.
416
489
  *
@@ -556,6 +629,25 @@ export class Document {
556
629
  wasm.__wbindgen_add_to_stack_pointer(16);
557
630
  }
558
631
  }
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
+ }
559
651
  /**
560
652
  * Update a field on the card at `index`.
561
653
  * Throws if `index` is out of range, `name` is reserved or invalid.
Binary file
@@ -22,11 +22,15 @@ export const document_pushCard: (a: number, b: number, c: number) => void;
22
22
  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
+ export const document_removeCardExt: (a: number, b: number, c: number) => void;
25
26
  export const document_removeCardField: (a: number, b: number, c: number, d: number, e: number) => void;
27
+ export const document_removeExt: (a: number) => number;
26
28
  export const document_removeField: (a: number, b: number, c: number, d: number) => void;
27
29
  export const document_replaceBody: (a: number, b: number, c: number) => void;
28
30
  export const document_schemaVersionOf: (a: number, b: number, c: number) => void;
29
31
  export const document_setCardKind: (a: number, b: number, c: number, d: number, e: number) => void;
32
+ export const document_setExt: (a: number, b: number, c: number) => void;
33
+ export const document_setExtNamespace: (a: number, b: number, c: number, d: number, e: number) => void;
30
34
  export const document_setField: (a: number, b: number, c: number, d: number, e: number) => void;
31
35
  export const document_setFill: (a: number, b: number, c: number, d: number, e: number) => void;
32
36
  export const document_setQuillRef: (a: number, b: number, c: number, d: number) => void;
@@ -34,6 +38,7 @@ export const document_toJson: (a: number, b: number) => void;
34
38
  export const document_toMarkdown: (a: number, b: number) => void;
35
39
  export const document_tryFromJson: (a: number, b: number) => number;
36
40
  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;
37
42
  export const document_updateCardField: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
38
43
  export const document_warnings: (a: number) => number;
39
44
  export const init: () => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quillmark/wasm",
3
- "version": "0.87.1",
3
+ "version": "0.87.2",
4
4
  "description": "WebAssembly bindings for quillmark",
5
5
  "type": "module",
6
6
  "license": "MIT OR Apache-2.0",