@quillmark/wasm 0.111.0 → 0.113.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.
@@ -1,11 +1,7 @@
1
1
  /* @ts-self-types="./wasm.d.ts" */
2
2
 
3
- /**
4
- * Typed in-memory Quillmark document.
5
- */
6
3
  export class Document {
7
4
  static __wrap(ptr) {
8
- ptr = ptr >>> 0;
9
5
  const obj = Object.create(Document.prototype);
10
6
  obj.__wbg_ptr = ptr;
11
7
  DocumentFinalization.register(obj, obj.__wbg_ptr, obj);
@@ -44,7 +40,7 @@ export class Document {
44
40
  const len0 = WASM_VECTOR_LEN;
45
41
  var ptr1 = isLikeNone(body) ? 0 : passStringToWasm0(body, wasm.__wbindgen_export, wasm.__wbindgen_export2);
46
42
  var len1 = WASM_VECTOR_LEN;
47
- wasm.document__addCard(retptr, this.__wbg_ptr, quill.__wbg_ptr, ptr0, len0, isLikeNone(fields) ? 0 : addHeapObject(fields), ptr1, len1, isLikeNone(at) ? 0x100000001 : (at) >>> 0);
43
+ wasm.document__addCard(retptr, this.__wbg_ptr, quill.__wbg_ptr, ptr0, len0, isLikeNone(fields) ? 0 : addHeapObject(fields), ptr1, len1, isLikeNone(at) ? Number.MAX_SAFE_INTEGER : (at) >>> 0);
48
44
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
49
45
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
50
46
  if (r1) {
@@ -58,10 +54,7 @@ export class Document {
58
54
  * Typed field write at `addr`, resolving the field's schema `type` from
59
55
  * `quill`: the stable ABI under the runtime `writer.set`. One verb for every
60
56
  * field type; the schema carries the `inline` constraint, so no type token
61
- * is passed. A richtext-typed field stores canonical content, so identity
62
- * marks (anchors, island ids) and content-only marks survive compiles and
63
- * the storage DTO. Values use the encoding the seam already speaks: content
64
- * object or markdown string for richtext, scalar/array/object otherwise.
57
+ * is passed.
65
58
  *
66
59
  * A bare string is `Addr` shorthand for `{ field }`. A body address throws,
67
60
  * having no field schema. A declared field is strict-committed, so a
@@ -120,30 +113,39 @@ export class Document {
120
113
  }
121
114
  }
122
115
  /**
123
- * Interpreted read at `addr`, resolving the field's declared `type` from
124
- * `quill`: the stable ABI under the runtime `reader.get`. The schema-plane
125
- * twin of [`getStored`](Self::get_stored) a `richtext` field returns its
126
- * markdown projection, every other declared type its canonical value
127
- * verbatim.
116
+ * Interpreted **`Content`** read of a value nested inside the composite
117
+ * field at `addr`: the stable ABI under the runtime `reader.getContentAt`,
118
+ * and [`reader.getContent`](Self::reader_get_content) with the path spelled
119
+ * out. `path` is a `PathStep[]` from the field to the leaf — `[0]` an
120
+ * element of an `array<richtext>`, `["motto"]` an `object`'s content
121
+ * property, `[1, "notes"]` a leaf under both, `["controlled_by"]` a
122
+ * variant's cell.
128
123
  *
129
- * A bare string is `Addr` shorthand for `{ field }`; `{ card, field }`
130
- * targets a composable card. An **absent** field returns `undefined`, and an
131
- * absent `addr.field` reads the body markdown. An undeclared name throws
132
- * `edit::unknown_field` (the authority `bodyMarkdown` lacks), a `richtext`
133
- * value that does not decode throws `edit::field_decode`, and an
134
- * out-of-range `addr.card` throws.
124
+ * The codec is the leaf's declared type's, so the caller stops deciding
125
+ * what an element's stored bytes mean. Total over the storage form, as the
126
+ * whole-field read is. What it answers is a legal write input: the anchors
127
+ * and island ids the values form cannot carry ride back through
128
+ * `writer.set` of the whole field.
135
129
  *
136
- * The `quill` handle is passed per call because a `Document` carries only a
137
- * `$quill` reference, not the resolved schema.
130
+ * `undefined` when the field is absent **and when `path` names nothing in
131
+ * the stored value**: a repeater's row index goes stale between derive and
132
+ * read, and absence there is a read, not a fault. Throws
133
+ * `edit::unknown_field` for an undeclared name at any depth,
134
+ * `edit::field_not_content` when `path` resolves to no content leaf,
135
+ * `edit::field_decode` for a value that decodes under neither encoding
136
+ * (anchored at the addressed path), and `edit::index_out_of_range` for a
137
+ * bad `addr.card`. A body address throws: a body has no nested content
138
+ * address.
138
139
  * @param {Quill} quill
139
140
  * @param {Addr | string} addr
140
- * @returns {unknown}
141
+ * @param {PathStep[]} path
142
+ * @returns {Content | undefined}
141
143
  */
142
- _readerGet(quill, addr) {
144
+ _readerGetContentAt(quill, addr, path) {
143
145
  try {
144
146
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
145
147
  _assertClass(quill, Quill);
146
- wasm.document__readerGet(retptr, this.__wbg_ptr, quill.__wbg_ptr, addHeapObject(addr));
148
+ wasm.document__readerGetContentAt(retptr, this.__wbg_ptr, quill.__wbg_ptr, addHeapObject(addr), addHeapObject(path));
147
149
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
148
150
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
149
151
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -191,37 +193,30 @@ export class Document {
191
193
  }
192
194
  }
193
195
  /**
194
- * Interpreted **`Content`** read of a value nested inside the composite
195
- * field at `addr`: the stable ABI under the runtime `reader.getContentAt`,
196
- * and [`reader.getContent`](Self::reader_get_content) with the path spelled
197
- * out. `path` is a `PathStep[]` from the field to the leaf — `[0]` an
198
- * element of an `array<richtext>`, `["motto"]` an `object`'s content
199
- * property, `[1, "notes"]` a leaf under both, `["controlled_by"]` a
200
- * variant's cell.
196
+ * Interpreted read at `addr`, resolving the field's declared `type` from
197
+ * `quill`: the stable ABI under the runtime `reader.get`. The schema-plane
198
+ * twin of [`getStored`](Self::get_stored) a `richtext` field returns its
199
+ * markdown projection, every other declared type its canonical value
200
+ * verbatim.
201
201
  *
202
- * The codec is the leaf's declared type's, so the caller stops deciding
203
- * what an element's stored bytes mean. Total over the storage form, as the
204
- * whole-field read is.
202
+ * A bare string is `Addr` shorthand for `{ field }`; `{ card, field }`
203
+ * targets a composable card. An **absent** field returns `undefined`, and an
204
+ * absent `addr.field` reads the body markdown. An undeclared name throws
205
+ * `edit::unknown_field` (the authority `bodyMarkdown` lacks), a `richtext`
206
+ * value that does not decode throws `edit::field_decode`, and an
207
+ * out-of-range `addr.card` throws.
205
208
  *
206
- * `undefined` when the field is absent **and when `path` names nothing in
207
- * the stored value**: a repeater's row index goes stale between derive and
208
- * read, and absence there is a read, not a fault. Throws
209
- * `edit::unknown_field` for an undeclared name at any depth,
210
- * `edit::field_not_content` when `path` resolves to no content leaf,
211
- * `edit::field_decode` for a value that decodes under neither encoding
212
- * (anchored at the addressed path), and `edit::index_out_of_range` for a
213
- * bad `addr.card`. A body address throws: a body has no nested content
214
- * address.
209
+ * The `quill` handle is passed per call because a `Document` carries only a
210
+ * `$quill` reference, not the resolved schema.
215
211
  * @param {Quill} quill
216
212
  * @param {Addr | string} addr
217
- * @param {PathStep[]} path
218
- * @returns {Content | undefined}
213
+ * @returns {unknown}
219
214
  */
220
- _readerGetContentAt(quill, addr, path) {
215
+ _readerGet(quill, addr) {
221
216
  try {
222
217
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
223
218
  _assertClass(quill, Quill);
224
- wasm.document__readerGetContentAt(retptr, this.__wbg_ptr, quill.__wbg_ptr, addHeapObject(addr), addHeapObject(path));
219
+ wasm.document__readerGet(retptr, this.__wbg_ptr, quill.__wbg_ptr, addHeapObject(addr));
225
220
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
226
221
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
227
222
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -300,8 +295,8 @@ export class Document {
300
295
  }
301
296
  }
302
297
  /**
303
- * Authoring-ergonomics header introducing a blueprint to an LLM/MCP consumer
304
- * for the given `quillName`, re-exposed from core.
298
+ * A blueprint's fill obligation for the given `quillName`, re-exposed from
299
+ * core. Carries no tool name: pair it with your own next-step directive.
305
300
  * @param {string} quill_name
306
301
  * @returns {string}
307
302
  */
@@ -349,28 +344,6 @@ export class Document {
349
344
  wasm.__wbindgen_add_to_stack_pointer(16);
350
345
  }
351
346
  }
352
- /**
353
- * A single composable card by index, so reading one need not materialize
354
- * every card via [`cards`](Self::cards). An out-of-range `index` throws
355
- * `edit::index_out_of_range`.
356
- * @param {number} index
357
- * @returns {Card}
358
- */
359
- card(index) {
360
- try {
361
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
362
- wasm.document_card(retptr, this.__wbg_ptr, index);
363
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
364
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
365
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
366
- if (r2) {
367
- throw takeObject(r1);
368
- }
369
- return takeObject(r0);
370
- } finally {
371
- wasm.__wbindgen_add_to_stack_pointer(16);
372
- }
373
- }
374
347
  /**
375
348
  * Number of composable cards, excluding the main card.
376
349
  * @returns {number}
@@ -403,6 +376,28 @@ export class Document {
403
376
  wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
404
377
  }
405
378
  }
379
+ /**
380
+ * A single composable card by index, so reading one need not materialize
381
+ * every card via [`cards`](Self::cards). An out-of-range `index` throws
382
+ * `edit::index_out_of_range`.
383
+ * @param {number} index
384
+ * @returns {Card}
385
+ */
386
+ card(index) {
387
+ try {
388
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
389
+ wasm.document_card(retptr, this.__wbg_ptr, index);
390
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
391
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
392
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
393
+ if (r2) {
394
+ throw takeObject(r1);
395
+ }
396
+ return takeObject(r0);
397
+ } finally {
398
+ wasm.__wbindgen_add_to_stack_pointer(16);
399
+ }
400
+ }
406
401
  /**
407
402
  * @returns {Card[]}
408
403
  */
@@ -429,7 +424,7 @@ export class Document {
429
424
  return Document.__wrap(ret);
430
425
  }
431
426
  /**
432
- * Storage version this build writes via [`toJson`](Document::to_json). The
427
+ * Storage version this build writes via [`toStored`](Document::to_stored). The
433
428
  * tag advances only when the wire format changes, not on every release.
434
429
  * @returns {string}
435
430
  */
@@ -459,28 +454,6 @@ export class Document {
459
454
  const ret = wasm.document_equals(this.__wbg_ptr, other.__wbg_ptr);
460
455
  return ret !== 0;
461
456
  }
462
- /**
463
- * Render a Diagnostic as the canonical pretty-printed text, so it looks
464
- * identical whichever consumer surfaces it.
465
- * @param {Diagnostic} diag
466
- * @returns {string}
467
- */
468
- static formatDiagnostic(diag) {
469
- let deferred1_0;
470
- let deferred1_1;
471
- try {
472
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
473
- wasm.document_formatDiagnostic(retptr, addHeapObject(diag));
474
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
475
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
476
- deferred1_0 = r0;
477
- deferred1_1 = r1;
478
- return getStringFromWasm0(r0, r1);
479
- } finally {
480
- wasm.__wbindgen_add_to_stack_pointer(16);
481
- wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
482
- }
483
- }
484
457
  /**
485
458
  * Authoring-format rules for the card-yaml markdown surface, re-exposed from
486
459
  * core. Constant across calls; read once and cache.
@@ -503,19 +476,16 @@ export class Document {
503
476
  }
504
477
  }
505
478
  /**
506
- * Reconstruct a `Document` from a versioned storage DTO string produced by
507
- * [`toJson`](Document::to_json). The result carries no parse-time warnings.
508
- * Throws if `json` is not a valid storage DTO (malformed JSON, unknown
509
- * `schema`, missing fields, or unparseable quill reference).
510
- * @param {string} json
479
+ * Parse markdown into a typed Document. Throws on parse errors.
480
+ * @param {string} markdown
511
481
  * @returns {Document}
512
482
  */
513
- static fromJson(json) {
483
+ static fromMarkdown(markdown) {
514
484
  try {
515
485
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
516
- const ptr0 = passStringToWasm0(json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
486
+ const ptr0 = passStringToWasm0(markdown, wasm.__wbindgen_export, wasm.__wbindgen_export2);
517
487
  const len0 = WASM_VECTOR_LEN;
518
- wasm.document_fromJson(retptr, ptr0, len0);
488
+ wasm.document_fromMarkdown(retptr, ptr0, len0);
519
489
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
520
490
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
521
491
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -528,16 +498,19 @@ export class Document {
528
498
  }
529
499
  }
530
500
  /**
531
- * Parse markdown into a typed Document. Throws on parse errors.
532
- * @param {string} markdown
501
+ * Reconstruct a `Document` from a versioned storage DTO string produced by
502
+ * [`toStored`](Document::to_stored). The result carries no parse-time warnings.
503
+ * Throws if `json` is not a valid storage DTO (malformed JSON, unknown
504
+ * `schema`, missing fields, or unparseable quill reference).
505
+ * @param {string} json
533
506
  * @returns {Document}
534
507
  */
535
- static fromMarkdown(markdown) {
508
+ static fromStored(json) {
536
509
  try {
537
510
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
538
- const ptr0 = passStringToWasm0(markdown, wasm.__wbindgen_export, wasm.__wbindgen_export2);
511
+ const ptr0 = passStringToWasm0(json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
539
512
  const len0 = WASM_VECTOR_LEN;
540
- wasm.document_fromMarkdown(retptr, ptr0, len0);
513
+ wasm.document_fromStored(retptr, ptr0, len0);
541
514
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
542
515
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
543
516
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -572,31 +545,6 @@ export class Document {
572
545
  wasm.__wbindgen_add_to_stack_pointer(16);
573
546
  }
574
547
  }
575
- /**
576
- * The value stored under `$ext[ns]` at `addr` (a card address, absent `card`
577
- * = main), or `undefined`. Throws on a present `field` or an out-of-range
578
- * card.
579
- * @param {CardAddr} addr
580
- * @param {string} ns
581
- * @returns {unknown}
582
- */
583
- getExtNamespace(addr, ns) {
584
- try {
585
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
586
- const ptr0 = passStringToWasm0(ns, wasm.__wbindgen_export, wasm.__wbindgen_export2);
587
- const len0 = WASM_VECTOR_LEN;
588
- wasm.document_getExtNamespace(retptr, this.__wbg_ptr, addHeapObject(addr), ptr0, len0);
589
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
590
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
591
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
592
- if (r2) {
593
- throw takeObject(r1);
594
- }
595
- return takeObject(r0);
596
- } finally {
597
- wasm.__wbindgen_add_to_stack_pointer(16);
598
- }
599
- }
600
548
  /**
601
549
  * Read the **verbatim stored value** at `addr`: a field's raw payload value,
602
550
  * or the body content when `addr.field` is absent. A bare string is `Addr`
@@ -613,9 +561,8 @@ export class Document {
613
561
  * conformed, and this read reports what is there. For the `Content` either
614
562
  * way use `reader.getContent`.
615
563
  *
616
- * The body arm is typed `Content` and answers in the seam form, spelling
617
- * every `ContentContainer.instance`. A field arm echoes the stored bytes,
618
- * which omit a zero: verbatim is the contract, and is why it is `unknown`.
564
+ * The body arm is typed `Content`; a field arm echoes the stored bytes
565
+ * unread, which is the contract and why it is `unknown`.
619
566
  * @param {Addr | string} addr
620
567
  * @returns {unknown}
621
568
  */
@@ -645,7 +592,7 @@ export class Document {
645
592
  insertCard(card, at) {
646
593
  try {
647
594
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
648
- wasm.document_insertCard(retptr, this.__wbg_ptr, addHeapObject(card), isLikeNone(at) ? 0x100000001 : (at) >>> 0);
595
+ wasm.document_insertCard(retptr, this.__wbg_ptr, addHeapObject(card), isLikeNone(at) ? Number.MAX_SAFE_INTEGER : (at) >>> 0);
649
596
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
650
597
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
651
598
  if (r1) {
@@ -679,21 +626,18 @@ export class Document {
679
626
  }
680
627
  /**
681
628
  * Replace this document's contents **in place** from a versioned storage DTO
682
- * string: the mutating twin of [`fromJson`](Document::from_json). Parse-time
683
- * `warnings` are cleared. Throws on an invalid DTO, leaving the document
684
- * unchanged.
685
- *
686
- * The cross-WASM-memory `Document` bridge: mutate a document on a
687
- * backend-memory clone, then write the state back into the caller's
688
- * canonical document, without the caller re-binding its variable.
629
+ * string: the mutating twin of [`fromStored`](Document::from_stored).
630
+ * Parse-time `warnings` are cleared. Throws on an invalid DTO, leaving the
631
+ * document unchanged. A caller holding the document need not re-bind its
632
+ * variable.
689
633
  * @param {string} json
690
634
  */
691
- loadJson(json) {
635
+ loadStored(json) {
692
636
  try {
693
637
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
694
638
  const ptr0 = passStringToWasm0(json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
695
639
  const len0 = WASM_VECTOR_LEN;
696
- wasm.document_loadJson(retptr, this.__wbg_ptr, ptr0, len0);
640
+ wasm.document_loadStored(retptr, this.__wbg_ptr, ptr0, len0);
697
641
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
698
642
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
699
643
  if (r1) {
@@ -722,39 +666,6 @@ export class Document {
722
666
  wasm.__wbindgen_add_to_stack_pointer(16);
723
667
  }
724
668
  }
725
- /**
726
- * Build a fresh `Card` from a kind and a flat field map: the ergonomic
727
- * constructor for `insertCard`, which also takes any `Card` object
728
- * directly. Each `fields` entry becomes a card field in insertion order;
729
- * `body` defaults to `""`.
730
- *
731
- * Checks only what a detached card can decide alone: field-name grammar and
732
- * value depth. Kind validity is positional, so `insertCard` is its gate and
733
- * any kind string is accepted here.
734
- * @param {string} kind
735
- * @param {Record<string, unknown>} [fields]
736
- * @param {string} [body]
737
- * @returns {Card}
738
- */
739
- static makeCard(kind, fields, body) {
740
- try {
741
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
742
- const ptr0 = passStringToWasm0(kind, wasm.__wbindgen_export, wasm.__wbindgen_export2);
743
- const len0 = WASM_VECTOR_LEN;
744
- var ptr1 = isLikeNone(body) ? 0 : passStringToWasm0(body, wasm.__wbindgen_export, wasm.__wbindgen_export2);
745
- var len1 = WASM_VECTOR_LEN;
746
- wasm.document_makeCard(retptr, ptr0, len0, isLikeNone(fields) ? 0 : addHeapObject(fields), ptr1, len1);
747
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
748
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
749
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
750
- if (r2) {
751
- throw takeObject(r1);
752
- }
753
- return takeObject(r0);
754
- } finally {
755
- wasm.__wbindgen_add_to_stack_pointer(16);
756
- }
757
- }
758
669
  /**
759
670
  * Move the card at `from` to position `to`. `from == to` is a no-op.
760
671
  * @param {number} from
@@ -793,7 +704,7 @@ export class Document {
793
704
  if (r2) {
794
705
  throw takeObject(r1);
795
706
  }
796
- this.__wbg_ptr = r0 >>> 0;
707
+ this.__wbg_ptr = r0;
797
708
  DocumentFinalization.register(this, this.__wbg_ptr, this);
798
709
  return this;
799
710
  } finally {
@@ -867,14 +778,17 @@ export class Document {
867
778
  }
868
779
  }
869
780
  /**
781
+ * The canonical `$quill` reference grammar as author-facing text: the same
782
+ * text the `parse::invalid_quill_reference` hint carries. Drive validation
783
+ * messages from this instead of re-stating the rule.
870
784
  * @returns {string}
871
785
  */
872
- get quillRef() {
786
+ static quillRefHint() {
873
787
  let deferred1_0;
874
788
  let deferred1_1;
875
789
  try {
876
790
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
877
- wasm.document_quillRef(retptr, this.__wbg_ptr);
791
+ wasm.document_quillRefHint(retptr);
878
792
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
879
793
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
880
794
  deferred1_0 = r0;
@@ -886,17 +800,14 @@ export class Document {
886
800
  }
887
801
  }
888
802
  /**
889
- * The canonical `$quill` reference grammar as author-facing text: the same
890
- * text the `parse::invalid_quill_reference` hint carries. Drive validation
891
- * messages from this instead of re-stating the rule.
892
803
  * @returns {string}
893
804
  */
894
- static quillRefHint() {
805
+ get quillRef() {
895
806
  let deferred1_0;
896
807
  let deferred1_1;
897
808
  try {
898
809
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
899
- wasm.document_quillRefHint(retptr);
810
+ wasm.document_quillRef(retptr, this.__wbg_ptr);
900
811
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
901
812
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
902
813
  deferred1_0 = r0;
@@ -928,8 +839,8 @@ export class Document {
928
839
  }
929
840
  /**
930
841
  * Remove the `$ext` map on the card `addr` targets entirely, returning the
931
- * previous map or `undefined`. Discards every namespace at once; prefer
932
- * `removeExtNamespace`. Throws on a present `field` or an out-of-range card.
842
+ * previous map or `undefined`. Discards every namespace at once. Throws on
843
+ * a present `field` or an out-of-range card.
933
844
  * @param {CardAddr} [addr]
934
845
  * @returns {Record<string, unknown> | undefined}
935
846
  */
@@ -948,32 +859,6 @@ export class Document {
948
859
  wasm.__wbindgen_add_to_stack_pointer(16);
949
860
  }
950
861
  }
951
- /**
952
- * Remove `$ext[ns]` on the card `addr` targets, returning its value or
953
- * `undefined`; drops `$ext` once empty. `addr` is a card address (absent =
954
- * main). Preserves sibling namespaces. Throws on a present `field` or an
955
- * out-of-range card.
956
- * @param {CardAddr} addr
957
- * @param {string} ns
958
- * @returns {any}
959
- */
960
- removeExtNamespace(addr, ns) {
961
- try {
962
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
963
- const ptr0 = passStringToWasm0(ns, wasm.__wbindgen_export, wasm.__wbindgen_export2);
964
- const len0 = WASM_VECTOR_LEN;
965
- wasm.document_removeExtNamespace(retptr, this.__wbg_ptr, addHeapObject(addr), ptr0, len0);
966
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
967
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
968
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
969
- if (r2) {
970
- throw takeObject(r1);
971
- }
972
- return takeObject(r0);
973
- } finally {
974
- wasm.__wbindgen_add_to_stack_pointer(16);
975
- }
976
- }
977
862
  /**
978
863
  * Remove a field at `addr`, returning the removed value or `undefined`. A
979
864
  * bare string is `Addr` shorthand for `{ field }`. A body address throws, as
@@ -1074,28 +959,6 @@ export class Document {
1074
959
  wasm.__wbindgen_add_to_stack_pointer(16);
1075
960
  }
1076
961
  }
1077
- /**
1078
- * Replace the kind of the card at `index`. Payload and body are untouched;
1079
- * schema-aware migration is the caller's responsibility.
1080
- * Throws if `index` is out of range or `newKind` is invalid.
1081
- * @param {number} index
1082
- * @param {string} new_kind
1083
- */
1084
- setCardKind(index, new_kind) {
1085
- try {
1086
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1087
- const ptr0 = passStringToWasm0(new_kind, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1088
- const len0 = WASM_VECTOR_LEN;
1089
- wasm.document_setCardKind(retptr, this.__wbg_ptr, index, ptr0, len0);
1090
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1091
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1092
- if (r1) {
1093
- throw takeObject(r0);
1094
- }
1095
- } finally {
1096
- wasm.__wbindgen_add_to_stack_pointer(16);
1097
- }
1098
- }
1099
962
  /**
1100
963
  * Replace the QUILL reference string. Throws if `ref_str` is invalid.
1101
964
  * @param {string} ref_str
@@ -1118,7 +981,7 @@ export class Document {
1118
981
  /**
1119
982
  * Read the storage version tag from a raw storage DTO string without a full
1120
983
  * parse, or `undefined`. Unknown future versions come back as-is, which
1121
- * distinguishes "build too old" from "payload corrupt" when `fromJson`
984
+ * distinguishes "build too old" from "payload corrupt" when `fromStored`
1122
985
  * throws. This is the storage version, not a field schema, though the JSON
1123
986
  * key is spelled `"schema"`: that is the DTO's serde tag.
1124
987
  * @param {string} json
@@ -1134,7 +997,7 @@ export class Document {
1134
997
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1135
998
  let v2;
1136
999
  if (r0 !== 0) {
1137
- v2 = getStringFromWasm0(r0, r1).slice();
1000
+ v2 = getStringFromWasm0(r0, r1);
1138
1001
  wasm.__wbindgen_export4(r0, r1 * 1, 1);
1139
1002
  }
1140
1003
  return v2;
@@ -1145,8 +1008,10 @@ export class Document {
1145
1008
  /**
1146
1009
  * Replace the opaque `$ext` map on the card `addr` targets (absent `card` =
1147
1010
  * main). `value` must be a plain object. `$ext` carries out-of-band consumer
1148
- * state and never reaches the rendered output. Throws on a present `field`
1149
- * or an out-of-range card.
1011
+ * state and never reaches the rendered output. The whole map is the write,
1012
+ * so a consumer holding one namespace merges the rest:
1013
+ * `{...doc.getExt(addr), [ns]: v}`. Throws on a present `field` or an
1014
+ * out-of-range card.
1150
1015
  * @param {CardAddr} addr
1151
1016
  * @param {any} value
1152
1017
  */
@@ -1163,29 +1028,6 @@ export class Document {
1163
1028
  wasm.__wbindgen_add_to_stack_pointer(16);
1164
1029
  }
1165
1030
  }
1166
- /**
1167
- * Merge `value` into `$ext[ns]` on the card `addr` targets, preserving
1168
- * sibling namespaces: the recommended `$ext` write. Throws on a present
1169
- * `field` or an out-of-range card.
1170
- * @param {CardAddr} addr
1171
- * @param {string} ns
1172
- * @param {any} value
1173
- */
1174
- storeExtNamespace(addr, ns, value) {
1175
- try {
1176
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1177
- const ptr0 = passStringToWasm0(ns, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1178
- const len0 = WASM_VECTOR_LEN;
1179
- wasm.document_storeExtNamespace(retptr, this.__wbg_ptr, addHeapObject(addr), ptr0, len0, addHeapObject(value));
1180
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1181
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1182
- if (r1) {
1183
- throw takeObject(r0);
1184
- }
1185
- } finally {
1186
- wasm.__wbindgen_add_to_stack_pointer(16);
1187
- }
1188
- }
1189
1031
  /**
1190
1032
  * Store a field verbatim at `addr`, deferring coercion to render; the typed
1191
1033
  * write is [`commitField`](Document::commit_field). A bare string is `Addr`
@@ -1274,18 +1116,16 @@ export class Document {
1274
1116
  }
1275
1117
  }
1276
1118
  /**
1277
- * Serialize this document to a versioned storage DTO string. Prefer it over
1278
- * `toMarkdown` for persistence: the wire format is frozen per `schema`
1279
- * version and the output is byte-deterministic within one, so equal
1280
- * documents hash equal. Parse-time `warnings` are excluded.
1119
+ * Emit canonical Quillmark Markdown. Round-trip safe: re-parsing the
1120
+ * result produces a `Document` equal to `self` by value and by type.
1281
1121
  * @returns {string}
1282
1122
  */
1283
- toJson() {
1123
+ toMarkdown() {
1284
1124
  let deferred1_0;
1285
1125
  let deferred1_1;
1286
1126
  try {
1287
1127
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1288
- wasm.document_toJson(retptr, this.__wbg_ptr);
1128
+ wasm.document_toMarkdown(retptr, this.__wbg_ptr);
1289
1129
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1290
1130
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1291
1131
  deferred1_0 = r0;
@@ -1297,16 +1137,18 @@ export class Document {
1297
1137
  }
1298
1138
  }
1299
1139
  /**
1300
- * Emit canonical Quillmark Markdown. Round-trip safe: re-parsing the
1301
- * result produces a `Document` equal to `self` by value and by type.
1140
+ * Serialize this document to a versioned storage DTO string. Prefer it over
1141
+ * `toMarkdown` for persistence: the wire format is frozen per `schema`
1142
+ * version and the output is byte-deterministic within one, so equal
1143
+ * documents hash equal. Parse-time `warnings` are excluded.
1302
1144
  * @returns {string}
1303
1145
  */
1304
- toMarkdown() {
1146
+ toStored() {
1305
1147
  let deferred1_0;
1306
1148
  let deferred1_1;
1307
1149
  try {
1308
1150
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1309
- wasm.document_toMarkdown(retptr, this.__wbg_ptr);
1151
+ wasm.document_toStored(retptr, this.__wbg_ptr);
1310
1152
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1311
1153
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1312
1154
  deferred1_0 = r0;
@@ -1317,24 +1159,11 @@ export class Document {
1317
1159
  wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
1318
1160
  }
1319
1161
  }
1320
- /**
1321
- * Like [`fromJson`](Document::from_json) but returns `undefined` instead of
1322
- * throwing when `json` is not a valid storage DTO, to discriminate format
1323
- * without exceptions as control flow.
1324
- * @param {string} json
1325
- * @returns {Document | undefined}
1326
- */
1327
- static tryFromJson(json) {
1328
- const ptr0 = passStringToWasm0(json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1329
- const len0 = WASM_VECTOR_LEN;
1330
- const ret = wasm.document_tryFromJson(ptr0, len0);
1331
- return ret === 0 ? undefined : Document.__wrap(ret);
1332
- }
1333
1162
  /**
1334
1163
  * The non-fatal diagnostics of the load that produced this document: parse
1335
1164
  * warnings, plus `conform::*` warnings when it came through `quill.parse`.
1336
1165
  * Session state, not document value: `equals` and the storage DTO exclude
1337
- * it, and `fromJson` / `loadJson` clear it.
1166
+ * it, and `fromStored` / `loadStored` clear it.
1338
1167
  * @returns {Diagnostic[]}
1339
1168
  */
1340
1169
  get warnings() {
@@ -1356,18 +1185,17 @@ export class Document {
1356
1185
  if (Symbol.dispose) Document.prototype[Symbol.dispose] = Document.prototype.free;
1357
1186
 
1358
1187
  /**
1359
- * Live render session: every read serves the current compile. `apply(doc)`
1188
+ * Live render session: every read serves the current compile. `update(doc)`
1360
1189
  * recompiles a whole document in place, transactionally — on throw the reads
1361
1190
  * keep serving the last-good compile. Geometry is per-compile, so re-read it
1362
- * after each committed `apply`.
1191
+ * after each committed `update`.
1363
1192
  *
1364
1193
  * A zero-page document yields a valid session (`pageCount === 0`) whose
1365
- * `paint(ctx, 0)` and `pageSize(0)` throw; branch on `pageCount === 0` rather
1366
- * than catching.
1194
+ * `paint(ctx, 0)` and `pageSize(0)` throw as any out-of-range page does; branch
1195
+ * on `pageCount === 0` rather than catching.
1367
1196
  */
1368
1197
  export class LiveSession {
1369
1198
  static __wrap(ptr) {
1370
- ptr = ptr >>> 0;
1371
1199
  const obj = Object.create(LiveSession.prototype);
1372
1200
  obj.__wbg_ptr = ptr;
1373
1201
  LiveSessionFinalization.register(obj, obj.__wbg_ptr, obj);
@@ -1410,20 +1238,27 @@ export class LiveSession {
1410
1238
  * `FieldRegion.rect`, so from a canvas click use
1411
1239
  * `x = clickPx.x / renderScale`, `y = pageHeightPt - clickPx.y / renderScale`.
1412
1240
  * Unlike `regions()`, *every* placement answers, not just the first.
1241
+ *
1242
+ * `tolPt` is how far off the ink a click still counts, in the same points,
1243
+ * and defaults to `0` — exact. Convert the pointer slack a surface wants
1244
+ * from CSS pixels at the scale it drew the page (`slackPx / renderScale`),
1245
+ * so it stays the same size under the cursor as the page zooms. The
1246
+ * nearest placement answers, so raising it only fills a miss.
1413
1247
  * @param {number} page
1414
1248
  * @param {number} x
1415
1249
  * @param {number} y
1250
+ * @param {number | null} [tol_pt]
1416
1251
  * @returns {string | undefined}
1417
1252
  */
1418
- fieldAt(page, x, y) {
1253
+ fieldAt(page, x, y, tol_pt) {
1419
1254
  try {
1420
1255
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1421
- wasm.livesession_fieldAt(retptr, this.__wbg_ptr, page, x, y);
1256
+ wasm.livesession_fieldAt(retptr, this.__wbg_ptr, page, x, y, isLikeNone(tol_pt) ? Number.MAX_SAFE_INTEGER : Math.fround(tol_pt));
1422
1257
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1423
1258
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1424
1259
  let v1;
1425
1260
  if (r0 !== 0) {
1426
- v1 = getStringFromWasm0(r0, r1).slice();
1261
+ v1 = getStringFromWasm0(r0, r1);
1427
1262
  wasm.__wbindgen_export4(r0, r1 * 1, 1);
1428
1263
  }
1429
1264
  return v1;
@@ -1467,10 +1302,21 @@ export class LiveSession {
1467
1302
  * @returns {FieldRegion | undefined}
1468
1303
  */
1469
1304
  locate(field, pos) {
1470
- const ptr0 = passStringToWasm0(field, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1471
- const len0 = WASM_VECTOR_LEN;
1472
- const ret = wasm.livesession_locate(this.__wbg_ptr, ptr0, len0, pos);
1473
- return takeObject(ret);
1305
+ try {
1306
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1307
+ const ptr0 = passStringToWasm0(field, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1308
+ const len0 = WASM_VECTOR_LEN;
1309
+ wasm.livesession_locate(retptr, this.__wbg_ptr, ptr0, len0, pos);
1310
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1311
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1312
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1313
+ if (r2) {
1314
+ throw takeObject(r1);
1315
+ }
1316
+ return takeObject(r0);
1317
+ } finally {
1318
+ wasm.__wbindgen_add_to_stack_pointer(16);
1319
+ }
1474
1320
  }
1475
1321
  /**
1476
1322
  * @returns {number}
@@ -1480,8 +1326,8 @@ export class LiveSession {
1480
1326
  return ret >>> 0;
1481
1327
  }
1482
1328
  /**
1483
- * Page dimensions in points (1 pt = 1/72 inch).
1484
- * Throws if the backend has no canvas painter or `page` is out of range.
1329
+ * Page dimensions in points (1 pt = 1/72 inch). Throws if `page` is out of
1330
+ * range, which a zero-page compile makes true of every index.
1485
1331
  * @param {number} page
1486
1332
  * @returns {PageSize}
1487
1333
  */
@@ -1512,8 +1358,9 @@ export class LiveSession {
1512
1358
  * its own `<canvas>`: no compositing, sub-rect, or transform reaches through
1513
1359
  * this call.
1514
1360
  *
1515
- * Throws if the backend has no canvas painter, `page` is out of range, `ctx`
1516
- * is the wrong type, or either scale is non-finite or `<= 0`.
1361
+ * Throws if `page` is out of range, `ctx` is the wrong type, either scale is
1362
+ * non-finite or `<= 0`, or the page cannot be rasterized at the resulting
1363
+ * scale (`backend::invalid_raster_scale`).
1517
1364
  * @param {CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D} ctx
1518
1365
  * @param {number} page
1519
1366
  * @param {PaintOptions | undefined} opts
@@ -1537,17 +1384,33 @@ export class LiveSession {
1537
1384
  /**
1538
1385
  * A point → **content position**: the field *and* a USV offset into its
1539
1386
  * `Content`, for placing a caret or mapping a selection into the content
1540
- * model, or `undefined` off all content ink. `x`/`y` are PDF points,
1541
- * bottom-left origin, as in `fieldAt`. The offset is cluster-exact and
1542
- * degrades to the containing segment's start on origin-less ink.
1387
+ * model, or `undefined` off all content ink. `x`/`y`/`tolPt` are PDF
1388
+ * points, bottom-left origin, as in `fieldAt`. The offset is cluster-exact
1389
+ * and degrades to the containing segment's start on origin-less ink.
1390
+ *
1391
+ * `tolPt` earns the most here: the leading between two lines lies inside a
1392
+ * paragraph and on no glyph, and under `tolPt` such a point takes the
1393
+ * nearer line.
1543
1394
  * @param {number} page
1544
1395
  * @param {number} x
1545
1396
  * @param {number} y
1397
+ * @param {number | null} [tol_pt]
1546
1398
  * @returns {ContentHit | undefined}
1547
1399
  */
1548
- positionAt(page, x, y) {
1549
- const ret = wasm.livesession_positionAt(this.__wbg_ptr, page, x, y);
1550
- return takeObject(ret);
1400
+ positionAt(page, x, y, tol_pt) {
1401
+ try {
1402
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1403
+ wasm.livesession_positionAt(retptr, this.__wbg_ptr, page, x, y, isLikeNone(tol_pt) ? Number.MAX_SAFE_INTEGER : Math.fround(tol_pt));
1404
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1405
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1406
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1407
+ if (r2) {
1408
+ throw takeObject(r1);
1409
+ }
1410
+ return takeObject(r0);
1411
+ } finally {
1412
+ wasm.__wbindgen_add_to_stack_pointer(16);
1413
+ }
1551
1414
  }
1552
1415
  /**
1553
1416
  * Schema-field geometry for this compiled session: each content field's
@@ -1592,14 +1455,6 @@ export class LiveSession {
1592
1455
  wasm.__wbindgen_add_to_stack_pointer(16);
1593
1456
  }
1594
1457
  }
1595
- /**
1596
- * `true` iff `paint` and `pageSize` will succeed for this session.
1597
- * @returns {boolean}
1598
- */
1599
- get supportsCanvas() {
1600
- const ret = wasm.livesession_supportsCanvas(this.__wbg_ptr);
1601
- return ret !== 0;
1602
- }
1603
1458
  /**
1604
1459
  * Recompile the session against `doc`: the edit verb of a live preview. The
1605
1460
  * document compiles through the same pipeline as `open`, then swaps in
@@ -1630,7 +1485,7 @@ export class LiveSession {
1630
1485
  }
1631
1486
  /**
1632
1487
  * Non-fatal diagnostics of the session's **current compile**, refreshed by
1633
- * each committed `apply`; a failed apply keeps the last-good compile's.
1488
+ * each committed `update`; a failed `update` keeps the last-good compile's.
1634
1489
  * Also appended to `RenderResult.warnings` on each `render()`.
1635
1490
  * @returns {Diagnostic[]}
1636
1491
  */
@@ -1654,7 +1509,6 @@ if (Symbol.dispose) LiveSession.prototype[Symbol.dispose] = LiveSession.prototyp
1654
1509
 
1655
1510
  export class Quill {
1656
1511
  static __wrap(ptr) {
1657
- ptr = ptr >>> 0;
1658
1512
  const obj = Object.create(Quill.prototype);
1659
1513
  obj.__wbg_ptr = ptr;
1660
1514
  QuillFinalization.register(obj, obj.__wbg_ptr, obj);
@@ -1670,6 +1524,32 @@ export class Quill {
1670
1524
  const ptr = this.__destroy_into_raw();
1671
1525
  wasm.__wbg_quill_free(ptr, 0);
1672
1526
  }
1527
+ /**
1528
+ * The resolved-value view of `doc`: the ABI under `reader.resolve()`. For
1529
+ * every declared field, the value the render projection would use and the
1530
+ * `FieldSource` rung it came from (`"authored" | "default" | "blank"`). The
1531
+ * card body is a `body` sibling on its card, never a row in `fields`, and
1532
+ * `null` when the kind enables no body. Value and provenance only;
1533
+ * completeness stays `validate`'s.
1534
+ * @param {Document} doc
1535
+ * @returns {Resolved}
1536
+ */
1537
+ _resolve(doc) {
1538
+ try {
1539
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1540
+ _assertClass(doc, Document);
1541
+ wasm.quill__resolve(retptr, this.__wbg_ptr, doc.__wbg_ptr);
1542
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1543
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1544
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1545
+ if (r2) {
1546
+ throw takeObject(r1);
1547
+ }
1548
+ return takeObject(r0);
1549
+ } finally {
1550
+ wasm.__wbindgen_add_to_stack_pointer(16);
1551
+ }
1552
+ }
1673
1553
  /**
1674
1554
  * The *declared* backend identifier (e.g. `"typst"`): intent, not a
1675
1555
  * resolved capability. Capability is read from the engine.
@@ -1714,7 +1594,7 @@ export class Quill {
1714
1594
  * Land `doc`'s declared content fields at their canonical rest **in
1715
1595
  * place**, returning the `conform::*` diagnostics for values that would not
1716
1596
  * commit. The read-repair verb for a document that arrived through the
1717
- * transport door (`fromMarkdown`, `fromJson`, a stored row).
1597
+ * transport door (`fromMarkdown`, `fromStored`, a stored row).
1718
1598
  *
1719
1599
  * Idempotent: an equal value is not rewritten, so YAML comments and stored
1720
1600
  * bytes survive. A `!must_fill` marker anywhere in a field's value skips
@@ -1763,9 +1643,9 @@ export class Quill {
1763
1643
  }
1764
1644
  }
1765
1645
  /**
1766
- * Identity snapshot of the `quill:` section of `Quill.yaml` plus any extra
1767
- * `quill:` keys. Pure config: output formats are a resolved-backend
1768
- * capability read from `Quillmark.supportedFormats`, not part of this.
1646
+ * Identity snapshot of the `quill:` section of `Quill.yaml`. Pure config:
1647
+ * output formats are a resolved-backend capability read from
1648
+ * `Quillmark.supportedFormats`, not part of this.
1769
1649
  * @returns {QuillMetadata}
1770
1650
  */
1771
1651
  get metadata() {
@@ -1814,31 +1694,6 @@ export class Quill {
1814
1694
  wasm.__wbindgen_add_to_stack_pointer(16);
1815
1695
  }
1816
1696
  }
1817
- /**
1818
- * The resolved-value view of `doc`: for every declared field, the value the
1819
- * render projection would use and the `FieldSource` rung it came from
1820
- * (`"authored" | "default" | "blank"`). The card body is a `body` sibling on
1821
- * its card, never a row in `fields`, and `null` when the kind enables no
1822
- * body. Value and provenance only; completeness stays `validate`'s.
1823
- * @param {Document} doc
1824
- * @returns {Resolved}
1825
- */
1826
- resolve(doc) {
1827
- try {
1828
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1829
- _assertClass(doc, Document);
1830
- wasm.quill_resolve(retptr, this.__wbg_ptr, doc.__wbg_ptr);
1831
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1832
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1833
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1834
- if (r2) {
1835
- throw takeObject(r1);
1836
- }
1837
- return takeObject(r0);
1838
- } finally {
1839
- wasm.__wbindgen_add_to_stack_pointer(16);
1840
- }
1841
- }
1842
1697
  /**
1843
1698
  * Document schema for the quill: the user-fillable fields plus their `ui`
1844
1699
  * hints. Key order in `fields`/`properties` is declaration order, the
@@ -1927,8 +1782,8 @@ export class Quill {
1927
1782
  *
1928
1783
  * This is how a quill crosses a WASM linear-memory boundary as data: a
1929
1784
  * `Quill` built in one build cannot be passed to an engine in another, so
1930
- * `@quillmark/wasm/runtime` re-feeds this tree to the backend build's
1931
- * `Quill.fromTree` on demand.
1785
+ * the `@quillmark/wasm` runtime layer re-feeds this tree to the backend
1786
+ * build's `Quill.fromTree` on demand.
1932
1787
  * @returns {Map<string, Uint8Array>}
1933
1788
  */
1934
1789
  toTree() {
@@ -1959,6 +1814,27 @@ export class Quill {
1959
1814
  wasm.__wbindgen_add_to_stack_pointer(16);
1960
1815
  }
1961
1816
  }
1817
+ /**
1818
+ * The advisory diagnostics of the load that produced this quill: what is
1819
+ * wrong with it short of refusing it. A quill that loads clean answers
1820
+ * `[]`.
1821
+ * @returns {Diagnostic[]}
1822
+ */
1823
+ get warnings() {
1824
+ try {
1825
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1826
+ wasm.quill_warnings(retptr, this.__wbg_ptr);
1827
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1828
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1829
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1830
+ if (r2) {
1831
+ throw takeObject(r1);
1832
+ }
1833
+ return takeObject(r0);
1834
+ } finally {
1835
+ wasm.__wbindgen_add_to_stack_pointer(16);
1836
+ }
1837
+ }
1962
1838
  }
1963
1839
  if (Symbol.dispose) Quill.prototype[Symbol.dispose] = Quill.prototype.free;
1964
1840
 
@@ -1979,7 +1855,7 @@ export class Quillmark {
1979
1855
  }
1980
1856
  constructor() {
1981
1857
  const ret = wasm.quillmark_new();
1982
- this.__wbg_ptr = ret >>> 0;
1858
+ this.__wbg_ptr = ret;
1983
1859
  QuillmarkFinalization.register(this, this.__wbg_ptr, this);
1984
1860
  return this;
1985
1861
  }
@@ -2055,18 +1931,6 @@ export class Quillmark {
2055
1931
  wasm.__wbindgen_add_to_stack_pointer(16);
2056
1932
  }
2057
1933
  }
2058
- /**
2059
- * Whether `quill`'s backend can paint sessions to a canvas; `false` when the
2060
- * backend is unsupported. A cheap probe before mounting a preview UI. The
2061
- * authoritative answer is the session's `supportsCanvas` getter.
2062
- * @param {Quill} quill
2063
- * @returns {boolean}
2064
- */
2065
- supportsCanvas(quill) {
2066
- _assertClass(quill, Quill);
2067
- const ret = wasm.quillmark_supportsCanvas(this.__wbg_ptr, quill.__wbg_ptr);
2068
- return ret !== 0;
2069
- }
2070
1934
  }
2071
1935
  if (Symbol.dispose) Quillmark.prototype[Symbol.dispose] = Quillmark.prototype.free;
2072
1936
 
@@ -2285,11 +2149,11 @@ export function start() {
2285
2149
  function __wbg_get_imports() {
2286
2150
  const import0 = {
2287
2151
  __proto__: null,
2288
- __wbg_Error_960c155d3d49e4c2: function(arg0, arg1) {
2152
+ __wbg_Error_67e7344beaa85059: function(arg0, arg1) {
2289
2153
  const ret = Error(getStringFromWasm0(arg0, arg1));
2290
2154
  return addHeapObject(ret);
2291
2155
  },
2292
- __wbg_Number_32bf70a599af1d4b: function(arg0) {
2156
+ __wbg_Number_c54e7112a3fa7e3e: function(arg0) {
2293
2157
  const ret = Number(getObject(arg0));
2294
2158
  return ret;
2295
2159
  },
@@ -2300,68 +2164,68 @@ function __wbg_get_imports() {
2300
2164
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
2301
2165
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
2302
2166
  },
2303
- __wbg___wbindgen_bigint_get_as_i64_3d3aba5d616c6a51: function(arg0, arg1) {
2167
+ __wbg___wbindgen_bigint_get_as_i64_b482365c149396c8: function(arg0, arg1) {
2304
2168
  const v = getObject(arg1);
2305
2169
  const ret = typeof(v) === 'bigint' ? v : undefined;
2306
2170
  getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
2307
2171
  getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
2308
2172
  },
2309
- __wbg___wbindgen_boolean_get_6ea149f0a8dcc5ff: function(arg0) {
2173
+ __wbg___wbindgen_boolean_get_7a12af2b3f899c5a: function(arg0) {
2310
2174
  const v = getObject(arg0);
2311
2175
  const ret = typeof(v) === 'boolean' ? v : undefined;
2312
2176
  return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
2313
2177
  },
2314
- __wbg___wbindgen_debug_string_ab4b34d23d6778bd: function(arg0, arg1) {
2178
+ __wbg___wbindgen_debug_string_0e68cf47c9cbd9b0: function(arg0, arg1) {
2315
2179
  const ret = debugString(getObject(arg1));
2316
2180
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
2317
2181
  const len1 = WASM_VECTOR_LEN;
2318
2182
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
2319
2183
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
2320
2184
  },
2321
- __wbg___wbindgen_in_a5d8b22e52b24dd1: function(arg0, arg1) {
2185
+ __wbg___wbindgen_in_50072d4d6e45c193: function(arg0, arg1) {
2322
2186
  const ret = getObject(arg0) in getObject(arg1);
2323
2187
  return ret;
2324
2188
  },
2325
- __wbg___wbindgen_is_bigint_ec25c7f91b4d9e93: function(arg0) {
2189
+ __wbg___wbindgen_is_bigint_60fc0336cb14f5d7: function(arg0) {
2326
2190
  const ret = typeof(getObject(arg0)) === 'bigint';
2327
2191
  return ret;
2328
2192
  },
2329
- __wbg___wbindgen_is_function_3baa9db1a987f47d: function(arg0) {
2193
+ __wbg___wbindgen_is_function_fcda5e3902d732fe: function(arg0) {
2330
2194
  const ret = typeof(getObject(arg0)) === 'function';
2331
2195
  return ret;
2332
2196
  },
2333
- __wbg___wbindgen_is_null_52ff4ec04186736f: function(arg0) {
2197
+ __wbg___wbindgen_is_null_5160b3e381865372: function(arg0) {
2334
2198
  const ret = getObject(arg0) === null;
2335
2199
  return ret;
2336
2200
  },
2337
- __wbg___wbindgen_is_object_63322ec0cd6ea4ef: function(arg0) {
2201
+ __wbg___wbindgen_is_object_edb6b15aa3afe12e: function(arg0) {
2338
2202
  const val = getObject(arg0);
2339
2203
  const ret = typeof(val) === 'object' && val !== null;
2340
2204
  return ret;
2341
2205
  },
2342
- __wbg___wbindgen_is_string_6df3bf7ef1164ed3: function(arg0) {
2206
+ __wbg___wbindgen_is_string_c4f7cb494a2a21f1: function(arg0) {
2343
2207
  const ret = typeof(getObject(arg0)) === 'string';
2344
2208
  return ret;
2345
2209
  },
2346
- __wbg___wbindgen_is_undefined_29a43b4d42920abd: function(arg0) {
2210
+ __wbg___wbindgen_is_undefined_8c687d0b90d5b524: function(arg0) {
2347
2211
  const ret = getObject(arg0) === undefined;
2348
2212
  return ret;
2349
2213
  },
2350
- __wbg___wbindgen_jsval_eq_d3465d8a07697228: function(arg0, arg1) {
2214
+ __wbg___wbindgen_jsval_eq_9fdcd3c0a860dd3b: function(arg0, arg1) {
2351
2215
  const ret = getObject(arg0) === getObject(arg1);
2352
2216
  return ret;
2353
2217
  },
2354
- __wbg___wbindgen_jsval_loose_eq_cac3565e89b4134c: function(arg0, arg1) {
2218
+ __wbg___wbindgen_jsval_loose_eq_3c30021c243b64cd: function(arg0, arg1) {
2355
2219
  const ret = getObject(arg0) == getObject(arg1);
2356
2220
  return ret;
2357
2221
  },
2358
- __wbg___wbindgen_number_get_c7f42aed0525c451: function(arg0, arg1) {
2222
+ __wbg___wbindgen_number_get_1dc732b810cb937c: function(arg0, arg1) {
2359
2223
  const obj = getObject(arg1);
2360
2224
  const ret = typeof(obj) === 'number' ? obj : undefined;
2361
2225
  getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
2362
2226
  getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
2363
2227
  },
2364
- __wbg___wbindgen_string_get_7ed5322991caaec5: function(arg0, arg1) {
2228
+ __wbg___wbindgen_string_get_92ab86bb19cbc12f: function(arg0, arg1) {
2365
2229
  const obj = getObject(arg1);
2366
2230
  const ret = typeof(obj) === 'string' ? obj : undefined;
2367
2231
  var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
@@ -2369,34 +2233,34 @@ function __wbg_get_imports() {
2369
2233
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
2370
2234
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
2371
2235
  },
2372
- __wbg___wbindgen_throw_6b64449b9b9ed33c: function(arg0, arg1) {
2236
+ __wbg___wbindgen_throw_5d9e815e6fdf150f: function(arg0, arg1) {
2373
2237
  throw new Error(getStringFromWasm0(arg0, arg1));
2374
2238
  },
2375
- __wbg_call_14b169f759b26747: function() { return handleError(function (arg0, arg1) {
2239
+ __wbg_call_269c5566fbede3eb: function() { return handleError(function (arg0, arg1) {
2376
2240
  const ret = getObject(arg0).call(getObject(arg1));
2377
2241
  return addHeapObject(ret);
2378
2242
  }, arguments); },
2379
- __wbg_canvas_2c0c6d263d4c52ad: function(arg0) {
2243
+ __wbg_canvas_128715f4edb228ef: function(arg0) {
2380
2244
  const ret = getObject(arg0).canvas;
2381
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
2245
+ return addHeapObject(ret);
2382
2246
  },
2383
- __wbg_canvas_374da9f3c5b3dd0e: function(arg0) {
2247
+ __wbg_canvas_9c3188d85ded70f9: function(arg0) {
2384
2248
  const ret = getObject(arg0).canvas;
2385
- return addHeapObject(ret);
2249
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
2386
2250
  },
2387
- __wbg_done_9158f7cc8751ba32: function(arg0) {
2251
+ __wbg_done_cffed884d87aa22e: function(arg0) {
2388
2252
  const ret = getObject(arg0).done;
2389
2253
  return ret;
2390
2254
  },
2391
- __wbg_entries_2bf997cf82353e47: function(arg0) {
2255
+ __wbg_entries_20b9608d57d8ddd6: function(arg0) {
2392
2256
  const ret = getObject(arg0).entries();
2393
2257
  return addHeapObject(ret);
2394
2258
  },
2395
- __wbg_entries_e0b73aa8571ddb56: function(arg0) {
2259
+ __wbg_entries_972a87586902cf87: function(arg0) {
2396
2260
  const ret = Object.entries(getObject(arg0));
2397
2261
  return addHeapObject(ret);
2398
2262
  },
2399
- __wbg_error_a6fa202b58aa1cd3: function(arg0, arg1) {
2263
+ __wbg_error_757e9472f8410341: function(arg0, arg1) {
2400
2264
  let deferred0_0;
2401
2265
  let deferred0_1;
2402
2266
  try {
@@ -2407,19 +2271,35 @@ function __wbg_get_imports() {
2407
2271
  wasm.__wbindgen_export4(deferred0_0, deferred0_1, 1);
2408
2272
  }
2409
2273
  },
2410
- __wbg_from_0dbf29f09e7fb200: function(arg0) {
2274
+ __wbg_from_a39669ce566077da: function(arg0) {
2411
2275
  const ret = Array.from(getObject(arg0));
2412
2276
  return addHeapObject(ret);
2413
2277
  },
2414
- __wbg_get_1affdbdd5573b16a: function() { return handleError(function (arg0, arg1) {
2278
+ __wbg_getTime_65922ba0b59d55a7: function(arg0) {
2279
+ const ret = getObject(arg0).getTime();
2280
+ return ret;
2281
+ },
2282
+ __wbg_getUTCDate_b061d7dd93ea65ec: function(arg0) {
2283
+ const ret = getObject(arg0).getUTCDate();
2284
+ return ret;
2285
+ },
2286
+ __wbg_getUTCFullYear_4f3d4172a60a56ec: function(arg0) {
2287
+ const ret = getObject(arg0).getUTCFullYear();
2288
+ return ret;
2289
+ },
2290
+ __wbg_getUTCMonth_0c3985a29f63aeb1: function(arg0) {
2291
+ const ret = getObject(arg0).getUTCMonth();
2292
+ return ret;
2293
+ },
2294
+ __wbg_get_6cf5a4d4d8ad3c5a: function() { return handleError(function (arg0, arg1) {
2415
2295
  const ret = Reflect.get(getObject(arg0), getObject(arg1));
2416
2296
  return addHeapObject(ret);
2417
2297
  }, arguments); },
2418
- __wbg_get_8360291721e2339f: function(arg0, arg1) {
2298
+ __wbg_get_b1f0ab13c737f856: function(arg0, arg1) {
2419
2299
  const ret = getObject(arg0)[arg1 >>> 0];
2420
2300
  return addHeapObject(ret);
2421
2301
  },
2422
- __wbg_get_unchecked_17f53dad852b9588: function(arg0, arg1) {
2302
+ __wbg_get_unchecked_363572bdd397d473: function(arg0, arg1) {
2423
2303
  const ret = getObject(arg0)[arg1 >>> 0];
2424
2304
  return addHeapObject(ret);
2425
2305
  },
@@ -2427,7 +2307,7 @@ function __wbg_get_imports() {
2427
2307
  const ret = getObject(arg0)[getObject(arg1)];
2428
2308
  return addHeapObject(ret);
2429
2309
  },
2430
- __wbg_instanceof_ArrayBuffer_7c8433c6ed14ffe3: function(arg0) {
2310
+ __wbg_instanceof_ArrayBuffer_d4ff01f8247925ae: function(arg0) {
2431
2311
  let result;
2432
2312
  try {
2433
2313
  result = getObject(arg0) instanceof ArrayBuffer;
@@ -2437,7 +2317,7 @@ function __wbg_get_imports() {
2437
2317
  const ret = result;
2438
2318
  return ret;
2439
2319
  },
2440
- __wbg_instanceof_CanvasRenderingContext2d_24a3fe06e62b98d7: function(arg0) {
2320
+ __wbg_instanceof_CanvasRenderingContext2d_bde5245b14027f3f: function(arg0) {
2441
2321
  let result;
2442
2322
  try {
2443
2323
  result = getObject(arg0) instanceof CanvasRenderingContext2D;
@@ -2447,7 +2327,7 @@ function __wbg_get_imports() {
2447
2327
  const ret = result;
2448
2328
  return ret;
2449
2329
  },
2450
- __wbg_instanceof_Map_1b76fd4635be43eb: function(arg0) {
2330
+ __wbg_instanceof_Map_1ff6a2b54c899f0d: function(arg0) {
2451
2331
  let result;
2452
2332
  try {
2453
2333
  result = getObject(arg0) instanceof Map;
@@ -2457,7 +2337,7 @@ function __wbg_get_imports() {
2457
2337
  const ret = result;
2458
2338
  return ret;
2459
2339
  },
2460
- __wbg_instanceof_Object_7c99480a1cdfb911: function(arg0) {
2340
+ __wbg_instanceof_Object_87732cb922ac2e2c: function(arg0) {
2461
2341
  let result;
2462
2342
  try {
2463
2343
  result = getObject(arg0) instanceof Object;
@@ -2467,7 +2347,7 @@ function __wbg_get_imports() {
2467
2347
  const ret = result;
2468
2348
  return ret;
2469
2349
  },
2470
- __wbg_instanceof_OffscreenCanvasRenderingContext2d_285a274020b4f230: function(arg0) {
2350
+ __wbg_instanceof_OffscreenCanvasRenderingContext2d_4b64493c5055d621: function(arg0) {
2471
2351
  let result;
2472
2352
  try {
2473
2353
  result = getObject(arg0) instanceof OffscreenCanvasRenderingContext2D;
@@ -2477,7 +2357,7 @@ function __wbg_get_imports() {
2477
2357
  const ret = result;
2478
2358
  return ret;
2479
2359
  },
2480
- __wbg_instanceof_Uint8Array_152ba1f289edcf3f: function(arg0) {
2360
+ __wbg_instanceof_Uint8Array_598adc0fef426aa8: function(arg0) {
2481
2361
  let result;
2482
2362
  try {
2483
2363
  result = getObject(arg0) instanceof Uint8Array;
@@ -2487,31 +2367,39 @@ function __wbg_get_imports() {
2487
2367
  const ret = result;
2488
2368
  return ret;
2489
2369
  },
2490
- __wbg_isArray_c3109d14ffc06469: function(arg0) {
2370
+ __wbg_isArray_5674713bb7b79043: function(arg0) {
2491
2371
  const ret = Array.isArray(getObject(arg0));
2492
2372
  return ret;
2493
2373
  },
2494
- __wbg_isSafeInteger_4fc213d1989d6d2a: function(arg0) {
2374
+ __wbg_isSafeInteger_8f51c743827d1ec5: function(arg0) {
2495
2375
  const ret = Number.isSafeInteger(getObject(arg0));
2496
2376
  return ret;
2497
2377
  },
2498
- __wbg_iterator_013bc09ec998c2a7: function() {
2378
+ __wbg_iterator_22ddeb808cf55a6f: function() {
2499
2379
  const ret = Symbol.iterator;
2500
2380
  return addHeapObject(ret);
2501
2381
  },
2502
- __wbg_keys_2fd1bfdda7e278ca: function(arg0) {
2382
+ __wbg_keys_6efc298980178da1: function(arg0) {
2503
2383
  const ret = Object.keys(getObject(arg0));
2504
2384
  return addHeapObject(ret);
2505
2385
  },
2506
- __wbg_length_3d4ecd04bd8d22f1: function(arg0) {
2386
+ __wbg_length_31bdaf014f5fbde2: function(arg0) {
2507
2387
  const ret = getObject(arg0).length;
2508
2388
  return ret;
2509
2389
  },
2510
- __wbg_length_9f1775224cf1d815: function(arg0) {
2390
+ __wbg_length_4e1adc0d42e23620: function(arg0) {
2511
2391
  const ret = getObject(arg0).length;
2512
2392
  return ret;
2513
2393
  },
2514
- __wbg_new_0c7403db6e782f19: function(arg0) {
2394
+ __wbg_new_0_35540e542ba689d2: function() {
2395
+ const ret = new Date();
2396
+ return addHeapObject(ret);
2397
+ },
2398
+ __wbg_new_180f1022bb6ee517: function(arg0) {
2399
+ const ret = new Date(getObject(arg0));
2400
+ return addHeapObject(ret);
2401
+ },
2402
+ __wbg_new_1da3429bc3c4541c: function(arg0) {
2515
2403
  const ret = new Uint8Array(getObject(arg0));
2516
2404
  return addHeapObject(ret);
2517
2405
  },
@@ -2519,75 +2407,71 @@ function __wbg_get_imports() {
2519
2407
  const ret = new Error();
2520
2408
  return addHeapObject(ret);
2521
2409
  },
2522
- __wbg_new_34d45cc8e36aaead: function() {
2410
+ __wbg_new_8d36e20aa758e411: function() {
2523
2411
  const ret = new Map();
2524
2412
  return addHeapObject(ret);
2525
2413
  },
2526
- __wbg_new_5e360d2ff7b9e1c3: function(arg0, arg1) {
2414
+ __wbg_new_a32a1ab6c6655abe: function(arg0, arg1) {
2527
2415
  const ret = new Error(getStringFromWasm0(arg0, arg1));
2528
2416
  return addHeapObject(ret);
2529
2417
  },
2530
- __wbg_new_682678e2f47e32bc: function() {
2531
- const ret = new Array();
2418
+ __wbg_new_bebc3f4757acf305: function() {
2419
+ const ret = new Object();
2532
2420
  return addHeapObject(ret);
2533
2421
  },
2534
- __wbg_new_aa8d0fa9762c29bd: function() {
2535
- const ret = new Object();
2422
+ __wbg_new_ffa92086ea89f79c: function() {
2423
+ const ret = new Array();
2536
2424
  return addHeapObject(ret);
2537
2425
  },
2538
- __wbg_new_from_slice_b5ea43e23f6008c0: function(arg0, arg1) {
2426
+ __wbg_new_from_slice_4ee02165f9de919e: function(arg0, arg1) {
2539
2427
  const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
2540
2428
  return addHeapObject(ret);
2541
2429
  },
2542
- __wbg_new_with_u8_clamped_array_and_sh_fe957411824b5158: function() { return handleError(function (arg0, arg1, arg2, arg3) {
2430
+ __wbg_new_with_u8_clamped_array_and_sh_15a008af56aca047: function() { return handleError(function (arg0, arg1, arg2, arg3) {
2543
2431
  const ret = new ImageData(getClampedArrayU8FromWasm0(arg0, arg1), arg2 >>> 0, arg3 >>> 0);
2544
2432
  return addHeapObject(ret);
2545
2433
  }, arguments); },
2546
- __wbg_next_0340c4ae324393c3: function() { return handleError(function (arg0) {
2547
- const ret = getObject(arg0).next();
2548
- return addHeapObject(ret);
2549
- }, arguments); },
2550
- __wbg_next_7646edaa39458ef7: function(arg0) {
2434
+ __wbg_next_95053e306b1c3aed: function(arg0) {
2551
2435
  const ret = getObject(arg0).next;
2552
2436
  return addHeapObject(ret);
2553
2437
  },
2554
- __wbg_now_a9b7df1cbee90986: function() {
2555
- const ret = Date.now();
2556
- return ret;
2557
- },
2558
- __wbg_prototypesetcall_a6b02eb00b0f4ce2: function(arg0, arg1, arg2) {
2438
+ __wbg_next_f31ecb8646d2c605: function() { return handleError(function (arg0) {
2439
+ const ret = getObject(arg0).next();
2440
+ return addHeapObject(ret);
2441
+ }, arguments); },
2442
+ __wbg_prototypesetcall_ae9f5e7459250748: function(arg0, arg1, arg2) {
2559
2443
  Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), getObject(arg2));
2560
2444
  },
2561
- __wbg_putImageData_c810e62ea70e761d: function() { return handleError(function (arg0, arg1, arg2, arg3) {
2445
+ __wbg_putImageData_080efc8615f29b4e: function() { return handleError(function (arg0, arg1, arg2, arg3) {
2562
2446
  getObject(arg0).putImageData(getObject(arg1), arg2, arg3);
2563
2447
  }, arguments); },
2564
- __wbg_putImageData_cb4de9afd58963be: function() { return handleError(function (arg0, arg1, arg2, arg3) {
2448
+ __wbg_putImageData_581de52c9f40fc59: function() { return handleError(function (arg0, arg1, arg2, arg3) {
2565
2449
  getObject(arg0).putImageData(getObject(arg1), arg2, arg3);
2566
2450
  }, arguments); },
2567
- __wbg_set_022bee52d0b05b19: function() { return handleError(function (arg0, arg1, arg2) {
2568
- const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
2569
- return ret;
2570
- }, arguments); },
2571
- __wbg_set_3bf1de9fab0cd644: function(arg0, arg1, arg2) {
2451
+ __wbg_set_13d25b81ab403f5e: function(arg0, arg1, arg2) {
2572
2452
  getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
2573
2453
  },
2574
2454
  __wbg_set_6be42768c690e380: function(arg0, arg1, arg2) {
2575
2455
  getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
2576
2456
  },
2577
- __wbg_set_fde2cec06c23692b: function(arg0, arg1, arg2) {
2457
+ __wbg_set_a377297433dfea63: function() { return handleError(function (arg0, arg1, arg2) {
2458
+ const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
2459
+ return ret;
2460
+ }, arguments); },
2461
+ __wbg_set_bf6dde4923b9b059: function(arg0, arg1, arg2) {
2578
2462
  const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
2579
2463
  return addHeapObject(ret);
2580
2464
  },
2581
- __wbg_set_height_24d07d982f176ac6: function(arg0, arg1) {
2465
+ __wbg_set_height_1202ad0eab43cbe0: function(arg0, arg1) {
2582
2466
  getObject(arg0).height = arg1 >>> 0;
2583
2467
  },
2584
- __wbg_set_height_be9b2b920bd68401: function(arg0, arg1) {
2468
+ __wbg_set_height_698fb3b255bc1348: function(arg0, arg1) {
2585
2469
  getObject(arg0).height = arg1 >>> 0;
2586
2470
  },
2587
- __wbg_set_width_5cda41d4d06a14dd: function(arg0, arg1) {
2471
+ __wbg_set_width_4c3a2252e0dea033: function(arg0, arg1) {
2588
2472
  getObject(arg0).width = arg1 >>> 0;
2589
2473
  },
2590
- __wbg_set_width_adc925bca9c5351a: function(arg0, arg1) {
2474
+ __wbg_set_width_f52a20e39808b138: function(arg0, arg1) {
2591
2475
  getObject(arg0).width = arg1 >>> 0;
2592
2476
  },
2593
2477
  __wbg_stack_3b0d974bbf31e44f: function(arg0, arg1) {
@@ -2597,39 +2481,39 @@ function __wbg_get_imports() {
2597
2481
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
2598
2482
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
2599
2483
  },
2600
- __wbg_value_ee3a06f4579184fa: function(arg0) {
2484
+ __wbg_value_c227f843d21da141: function(arg0) {
2601
2485
  const ret = getObject(arg0).value;
2602
2486
  return addHeapObject(ret);
2603
2487
  },
2604
- __wbg_values_1e6d547ce555ce44: function(arg0) {
2605
- const ret = getObject(arg0).values();
2488
+ __wbg_values_220548effc36d1d3: function(arg0) {
2489
+ const ret = Object.values(getObject(arg0));
2606
2490
  return addHeapObject(ret);
2607
2491
  },
2608
- __wbg_values_301a77363cf6c773: function(arg0) {
2609
- const ret = Object.values(getObject(arg0));
2492
+ __wbg_values_85d5bcf6f1ca8248: function(arg0) {
2493
+ const ret = getObject(arg0).values();
2610
2494
  return addHeapObject(ret);
2611
2495
  },
2612
- __wbindgen_cast_0000000000000001: function(arg0) {
2496
+ __wbindgen_generic_0000000000000001: function(arg0) {
2613
2497
  // Cast intrinsic for `F64 -> Externref`.
2614
2498
  const ret = arg0;
2615
2499
  return addHeapObject(ret);
2616
2500
  },
2617
- __wbindgen_cast_0000000000000002: function(arg0) {
2501
+ __wbindgen_generic_0000000000000002: function(arg0) {
2618
2502
  // Cast intrinsic for `I64 -> Externref`.
2619
2503
  const ret = arg0;
2620
2504
  return addHeapObject(ret);
2621
2505
  },
2622
- __wbindgen_cast_0000000000000003: function(arg0, arg1) {
2506
+ __wbindgen_generic_0000000000000003: function(arg0, arg1) {
2623
2507
  // Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`.
2624
2508
  const ret = getArrayU8FromWasm0(arg0, arg1);
2625
2509
  return addHeapObject(ret);
2626
2510
  },
2627
- __wbindgen_cast_0000000000000004: function(arg0, arg1) {
2511
+ __wbindgen_generic_0000000000000004: function(arg0, arg1) {
2628
2512
  // Cast intrinsic for `Ref(String) -> Externref`.
2629
2513
  const ret = getStringFromWasm0(arg0, arg1);
2630
2514
  return addHeapObject(ret);
2631
2515
  },
2632
- __wbindgen_cast_0000000000000005: function(arg0) {
2516
+ __wbindgen_generic_0000000000000005: function(arg0) {
2633
2517
  // Cast intrinsic for `U64 -> Externref`.
2634
2518
  const ret = BigInt.asUintN(64, arg0);
2635
2519
  return addHeapObject(ret);
@@ -2650,16 +2534,16 @@ function __wbg_get_imports() {
2650
2534
 
2651
2535
  const DocumentFinalization = (typeof FinalizationRegistry === 'undefined')
2652
2536
  ? { register: () => {}, unregister: () => {} }
2653
- : new FinalizationRegistry(ptr => wasm.__wbg_document_free(ptr >>> 0, 1));
2537
+ : new FinalizationRegistry(ptr => wasm.__wbg_document_free(ptr, 1));
2654
2538
  const LiveSessionFinalization = (typeof FinalizationRegistry === 'undefined')
2655
2539
  ? { register: () => {}, unregister: () => {} }
2656
- : new FinalizationRegistry(ptr => wasm.__wbg_livesession_free(ptr >>> 0, 1));
2540
+ : new FinalizationRegistry(ptr => wasm.__wbg_livesession_free(ptr, 1));
2657
2541
  const QuillFinalization = (typeof FinalizationRegistry === 'undefined')
2658
2542
  ? { register: () => {}, unregister: () => {} }
2659
- : new FinalizationRegistry(ptr => wasm.__wbg_quill_free(ptr >>> 0, 1));
2543
+ : new FinalizationRegistry(ptr => wasm.__wbg_quill_free(ptr, 1));
2660
2544
  const QuillmarkFinalization = (typeof FinalizationRegistry === 'undefined')
2661
2545
  ? { register: () => {}, unregister: () => {} }
2662
- : new FinalizationRegistry(ptr => wasm.__wbg_quillmark_free(ptr >>> 0, 1));
2546
+ : new FinalizationRegistry(ptr => wasm.__wbg_quillmark_free(ptr, 1));
2663
2547
 
2664
2548
  function addHeapObject(obj) {
2665
2549
  if (heap_next === heap.length) heap.push(heap.length + 1);
@@ -2766,8 +2650,7 @@ function getDataViewMemory0() {
2766
2650
  }
2767
2651
 
2768
2652
  function getStringFromWasm0(ptr, len) {
2769
- ptr = ptr >>> 0;
2770
- return decodeText(ptr, len);
2653
+ return decodeText(ptr >>> 0, len);
2771
2654
  }
2772
2655
 
2773
2656
  let cachedUint8ArrayMemory0 = null;
@@ -2877,8 +2760,9 @@ if (!('encodeInto' in cachedTextEncoder)) {
2877
2760
 
2878
2761
  let WASM_VECTOR_LEN = 0;
2879
2762
 
2880
- let wasmModule, wasm;
2763
+ let wasmModule, wasmInstance, wasm;
2881
2764
  function __wbg_finalize_init(instance, module) {
2765
+ wasmInstance = instance;
2882
2766
  wasm = instance.exports;
2883
2767
  wasmModule = module;
2884
2768
  cachedDataViewMemory0 = null;
@@ -2890,11 +2774,15 @@ function __wbg_finalize_init(instance, module) {
2890
2774
 
2891
2775
  async function __wbg_load(module, imports) {
2892
2776
  if (typeof Response === 'function' && module instanceof Response) {
2777
+ if (!module.ok) {
2778
+ throw new Error(`failed to fetch Wasm: ${module.status} ${module.statusText} fetching '${module.url}'`);
2779
+ }
2780
+
2893
2781
  if (typeof WebAssembly.instantiateStreaming === 'function') {
2894
2782
  try {
2895
2783
  return await WebAssembly.instantiateStreaming(module, imports);
2896
2784
  } catch (e) {
2897
- const validResponse = module.ok && expectedResponseType(module.type);
2785
+ const validResponse = expectedResponseType(module.type);
2898
2786
 
2899
2787
  if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
2900
2788
  console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);