@quillmark/wasm 0.124.0 → 0.125.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,94 @@
1
1
  # Changelog
2
2
 
3
+ ## v0.125.0 - 2026-10-12
4
+
5
+ Upgrade path: [0.124 → 0.125](docs/migrations/0.124-to-0.125.md). Every Typst
6
+ plate migrates: the helper is version 0.2.0, imported `as qm`. Stored documents
7
+ load as before, under the same storage tag.
8
+
9
+ ### Regions and the helper
10
+
11
+ - feat(typst)!: **the helper is a module imported as `qm`, at version 0.2.0**,
12
+ and every other import fails the render as `typst::helper_import`.
13
+ `field-region` is `qm.region`, `ink(x).f` and `display(..)` are
14
+ `qm.ink(x, "f", ..)`, and every other member reads under `qm.`. No
15
+ dictionary carries `$ink`; `data`, every card and every typed dictionary
16
+ carry `$path`. (#2157)
17
+ - feat(typst)!: **regions come from three declared producers**: ink the helper
18
+ generates, a `qm.region` claim and a form widget. A value the plate prints
19
+ itself, `#data.subject` included, surfaces no region. (#2157)
20
+ - feat(typst)!: **a claim takes the text between its markers that has no
21
+ source position of its own**, list bullets included, and no header, footer,
22
+ background, page number, footnote or float it crosses; a claim opened
23
+ inside one of those takes its ink. `typst::unclosed_field_region` is
24
+ `typst::unclosed_region`. (#2157, #2163)
25
+ - feat(core,cli,wasm): **`LiveSession::coverage` and `quillmark check
26
+ --regions` list the filled fields no click reaches**, a printed `0` or
27
+ `false` included. (#2157, #2160)
28
+
29
+ ### Sections
30
+
31
+ - feat(core)!: **a card frames its fields in titled panels under
32
+ `sections:`**, and `ui.group` / `ui.groups` warn `quill::deprecated_groups`.
33
+ `schema()` still emits `ui.groups`, lists a grouped card's fields in display
34
+ order, and gives an object alone in its group `ui.layout: flat`. An empty
35
+ section fails the load. (#2156)
36
+
37
+ ### Validation and typed writes
38
+
39
+ - feat(core)!: **`Quill::validate` warns `backend::declined_construct`, the
40
+ render's own diagnostic**, where it warned `validation::declined_construct`,
41
+ which is gone. (#2147)
42
+ - feat(core,wasm,python)!: **a typed `set` / `setAll` returns the
43
+ `parse::dropped_construct` of each `richtext` string it writes**, at the
44
+ string's path, and `addCard` its fields' ahead of its body's. (#2147, #2160)
45
+ - fix(acroform): **a `form@0.1.0` file gets the version message**, not a
46
+ field-shape error. (#2160)
47
+
48
+ ### Markdown
49
+
50
+ - fix(core)!: **a backtick line whose info string holds a backtick opens no
51
+ code fence**, as CommonMark reads it, so a card block under it opens its
52
+ card. (#2147)
53
+ - fix(content)!: **a newline beside a hard break imports as no space, a line
54
+ whose content all drops imports as no line, and U+0000 reads as U+FFFD.**
55
+ Content stored by 0.124 keeps its space. (#2164)
56
+ - fix(content)!: **a raw tag inside a footnote definition warns nothing beside
57
+ the definition's `footnote`.** (#2160)
58
+ - fix(content): **a replaced line pairs by its word diff whatever its word
59
+ count.** (#2147)
60
+
61
+ ### Tables
62
+
63
+ - fix(typst)!: **a placed table aligns its cells as an unplaced one does**
64
+ under the plate's `table.align` and a vertical `table.cell` rule. (#2147)
65
+ - fix(content)!: **a table's `align`, `widths` or `headless` outside its set
66
+ rests as written and reads as absent**, where normalization removed it.
67
+ (#2147)
68
+ - fix(typst): **`keep` holds its run whatever the element registry holds.**
69
+ (#2147)
70
+
71
+ ### Revise
72
+
73
+ - refactor(core,wasm)!: **`droppedAnchors` holds `DocumentAnchor`s, `{ id,
74
+ path, line }`**, matched at the exact address, and an anchor dropped from
75
+ content stored out of canonical order is named. `DocumentAnchor` exports
76
+ from the WASM package root. (#2147)
77
+
78
+ ### Rust
79
+
80
+ - refactor(content)!: **`ImportWarning` is a struct, and
81
+ `Container::Element` holds a validated `carrier::Element`.** The typed
82
+ writer's `set` / `set_all` return `Vec<Diagnostic>`, and
83
+ `SessionHandle::update` takes the session's `QuillConfig`. (#2147)
84
+
85
+ ### CLI and packaging
86
+
87
+ - feat(typst,cli): **`quillmark --version` names the linked Typst**, 0.15.
88
+ (#2162)
89
+ - **`@quillmark/wasm` ships a CycloneDX SBOM of its crate graph**, and every
90
+ CI action is pinned by commit SHA. (#2132)
91
+
3
92
  ## v0.124.0 - 2026-10-10
4
93
 
5
94
  Upgrade path: [0.123 → 0.124](docs/migrations/0.123-to-0.124.md).
package/README.md CHANGED
@@ -394,8 +394,8 @@ A document that compiles to zero pages still produces a valid session
394
394
  the throw.
395
395
 
396
396
  Their `warnings` differ in reach. `engine.render` returns every
397
- `quill.validate(doc)` warning but `validation::declined_construct`, which the
398
- compile raises as `backend::declined_construct`, then the compile's own;
397
+ `quill.validate(doc)` warning but `backend::declined_construct`, then the
398
+ compile's own, a decline among them;
399
399
  `session.render` and `session.warnings` carry the compile's alone, so read
400
400
  `quill.validate(doc)` beside them. Neither carries the load's: those stay on
401
401
  `doc.warnings`, and a revise's on its receipt.
package/core/wasm.d.ts CHANGED
@@ -146,7 +146,8 @@ export interface TableCell {
146
146
 
147
147
  /** `props` of a `type: "table"` island: a pipe table normalized to one column
148
148
  * count that `header`, every row of `rows`, `aligns` and `widths` all share.
149
- * A layout key at its default is absent. */
149
+ * A layout key at its default is absent; one holding a value outside its type
150
+ * stays as written and reads as absent. */
150
151
  export interface TableProps {
151
152
  header: TableCell[];
152
153
  rows: TableCell[][];
@@ -154,7 +155,7 @@ export interface TableProps {
154
155
  aligns: ("none" | "left" | "center" | "right")[];
155
156
  /** Per-column relative weights; `null` is an auto-fit column. Absent when
156
157
  * every column is auto-fit. A weight is an integer from 1 to
157
- * `Number.MAX_SAFE_INTEGER`; any other entry drops the key. */
158
+ * `Number.MAX_SAFE_INTEGER`. */
158
159
  widths?: (number | null)[];
159
160
  /** The table's placement; absent is the quill's. */
160
161
  align?: "left" | "center" | "right";
@@ -237,14 +238,14 @@ export interface Revised {
237
238
 
238
239
  /**
239
240
  * The receipt of `writer.reviseDocument`. `droppedAnchors` names every prose
240
- * anchor the write did not carry, at its path in the stored document; a table
241
+ * anchor the write did not carry, at its path and line in the stored document; a table
241
242
  * cell's anchors drop unnamed. `warnings` are the parse's, then each revised
242
243
  * content field's `parse::dropped_construct`, then the writer's `conform::*`.
243
244
  * A field that lands rather than revises, on an inserted card or over no stored
244
245
  * content, reports no drop.
245
246
  */
246
247
  export interface DocumentRevised {
247
- droppedAnchors: { path: string; id: string }[];
248
+ droppedAnchors: DocumentAnchor[];
248
249
  warnings: Diagnostic[];
249
250
  }
250
251
 
@@ -258,7 +259,13 @@ export interface DocumentRevised {
258
259
  */
259
260
  export interface AnnotatedMarkdown {
260
261
  markdown: string;
261
- anchors: { id: string; path: string; line: string }[];
262
+ anchors: DocumentAnchor[];
263
+ }
264
+
265
+ export interface DocumentAnchor {
266
+ id: string;
267
+ path: string;
268
+ line: string;
262
269
  }
263
270
 
264
271
  /**
@@ -439,6 +446,8 @@ export interface Resolved {
439
446
  /** UI layout hints for a single field. Display order is not a hint: key order
440
447
  * in the schema's `fields`/`properties` objects is the ordering contract. */
441
448
  export interface QuillFieldUi {
449
+ /** The id of the card section holding the field, a key of the card's
450
+ * `ui.groups`. */
442
451
  group?: string;
443
452
  compact?: boolean;
444
453
  multiline?: boolean;
@@ -455,18 +464,18 @@ export interface QuillFieldUi {
455
464
  layout?: "table" | "flat";
456
465
  }
457
466
 
458
- /** One entry in a card's `ui.groups` registry: a display-label override for the
459
- * group id (the map key). An empty object carries no override, and the consumer
460
- * derives the label from the id (`memo_for` → "Memo For"). */
467
+ /** One section in a card's `ui.groups`: a display-label override for the
468
+ * section id (the map key). An empty object carries no override, and the
469
+ * consumer derives the label from the id (`memo_for` → "Memo For"). */
461
470
  export interface QuillGroupUi {
462
471
  title?: string;
463
472
  }
464
473
 
465
474
  /** UI layout hints for a card (main or named card kind). */
466
475
  export interface QuillCardUi {
467
- /** The groups a field's `ui.group` may reference, keyed by group id. Key
468
- * order is the display-order contract, as with `fields`. Absent when the
469
- * card declares no groups. */
476
+ /** The card's sections keyed by id, each holding at least one field, which
477
+ * names it in its `ui.group`. Key order is the display-order contract, as
478
+ * with `fields`. Absent when the card declares no sections. */
470
479
  groups?: Record<string, QuillGroupUi>;
471
480
  }
472
481
 
@@ -963,8 +972,9 @@ export class Quill {
963
972
  toTree(): Map<string, Uint8Array>;
964
973
  /**
965
974
  * Validate `doc` against this quill's schema, returning every diagnostic:
966
- * an error blocks a render, a warning does not. Forwards the canonical
967
- * `validation::*` diagnostics the engine emits.
975
+ * an error blocks a render, a warning does not. Forwards the engine's
976
+ * `validation::*`, a markdown string's `parse::dropped_construct` and the
977
+ * backend's `backend::declined_construct`.
968
978
  */
969
979
  validate(doc: Document): Diagnostic[];
970
980
  /**
package/core/wasm.js CHANGED
@@ -26,8 +26,8 @@ export class Document {
26
26
  * leaves the document untouched. Field errors throw the same per-field
27
27
  * bundle as [`commitFields`](Self::commit_fields); an invalid kind or body,
28
28
  * or a bad position, throws a single-entry bundle keyed `$kind` / `$body`.
29
- * Returns the body import's `parse::dropped_construct` warnings, anchored
30
- * at the placed card's body.
29
+ * Returns the fields' `parse::dropped_construct` warnings, then the body
30
+ * import's, anchored under the placed card.
31
31
  * @param {Quill} quill
32
32
  * @param {string} kind
33
33
  * @param {Record<string, unknown>} [fields]
@@ -73,9 +73,13 @@ export class Document {
73
73
  *
74
74
  * The `quill` handle is passed per call because a `Document` carries only a
75
75
  * `$quill` reference, not the resolved schema.
76
+ *
77
+ * Returns a `parse::dropped_construct` warning per construct a `richtext`
78
+ * markdown string in the value dropped, at the string's path.
76
79
  * @param {Quill} quill
77
80
  * @param {Addr | string} addr
78
81
  * @param {any} value
82
+ * @returns {Diagnostic[]}
79
83
  */
80
84
  _commitField(quill, addr, value) {
81
85
  try {
@@ -84,9 +88,11 @@ export class Document {
84
88
  wasm.document__commitField(retptr, this.__wbg_ptr, quill.__wbg_ptr, addHeapObject(addr), addHeapObject(value));
85
89
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
86
90
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
87
- if (r1) {
88
- throw takeObject(r0);
91
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
92
+ if (r2) {
93
+ throw takeObject(r1);
89
94
  }
95
+ return takeObject(r0);
90
96
  } finally {
91
97
  wasm.__wbindgen_add_to_stack_pointer(16);
92
98
  }
@@ -98,10 +104,12 @@ export class Document {
98
104
  * diagnostic contract as [`storeFields`](Document::store_fields) — nothing
99
105
  * applied on error, one `diagnostics` entry per offending field, including
100
106
  * `edit::unknown_field` for undeclared names. Throws on an out-of-range
101
- * card.
107
+ * card. Returns [`commitField`](Document::commit_field)'s warnings for
108
+ * every field, in batch order.
102
109
  * @param {Quill} quill
103
110
  * @param {CardAddr} addr
104
111
  * @param {Record<string, unknown>} fields
112
+ * @returns {Diagnostic[]}
105
113
  */
106
114
  _commitFields(quill, addr, fields) {
107
115
  try {
@@ -110,9 +118,11 @@ export class Document {
110
118
  wasm.document__commitFields(retptr, this.__wbg_ptr, quill.__wbg_ptr, addHeapObject(addr), addHeapObject(fields));
111
119
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
112
120
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
113
- if (r1) {
114
- throw takeObject(r0);
121
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
122
+ if (r2) {
123
+ throw takeObject(r1);
115
124
  }
125
+ return takeObject(r0);
116
126
  } finally {
117
127
  wasm.__wbindgen_add_to_stack_pointer(16);
118
128
  }
@@ -1500,8 +1510,9 @@ export class Quill {
1500
1510
  }
1501
1511
  /**
1502
1512
  * Validate `doc` against this quill's schema, returning every diagnostic:
1503
- * an error blocks a render, a warning does not. Forwards the canonical
1504
- * `validation::*` diagnostics the engine emits.
1513
+ * an error blocks a render, a warning does not. Forwards the engine's
1514
+ * `validation::*`, a markdown string's `parse::dropped_construct` and the
1515
+ * backend's `backend::declined_construct`.
1505
1516
  * @param {Document} doc
1506
1517
  * @returns {Diagnostic[]}
1507
1518
  */
package/core/wasm_bg.wasm CHANGED
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quillmark/wasm",
3
- "version": "0.124.0",
3
+ "version": "0.125.0",
4
4
  "description": "WebAssembly bindings for Quillmark, a schema-driven document engine",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -15,7 +15,8 @@
15
15
  "core",
16
16
  "render",
17
17
  "runtime",
18
- "CHANGELOG.md"
18
+ "CHANGELOG.md",
19
+ "sbom.cdx.json"
19
20
  ],
20
21
  "main": "./runtime/runtime.js",
21
22
  "module": "./runtime/runtime.js",
package/render/wasm.d.ts CHANGED
@@ -146,7 +146,8 @@ export interface TableCell {
146
146
 
147
147
  /** `props` of a `type: "table"` island: a pipe table normalized to one column
148
148
  * count that `header`, every row of `rows`, `aligns` and `widths` all share.
149
- * A layout key at its default is absent. */
149
+ * A layout key at its default is absent; one holding a value outside its type
150
+ * stays as written and reads as absent. */
150
151
  export interface TableProps {
151
152
  header: TableCell[];
152
153
  rows: TableCell[][];
@@ -154,7 +155,7 @@ export interface TableProps {
154
155
  aligns: ("none" | "left" | "center" | "right")[];
155
156
  /** Per-column relative weights; `null` is an auto-fit column. Absent when
156
157
  * every column is auto-fit. A weight is an integer from 1 to
157
- * `Number.MAX_SAFE_INTEGER`; any other entry drops the key. */
158
+ * `Number.MAX_SAFE_INTEGER`. */
158
159
  widths?: (number | null)[];
159
160
  /** The table's placement; absent is the quill's. */
160
161
  align?: "left" | "center" | "right";
@@ -237,14 +238,14 @@ export interface Revised {
237
238
 
238
239
  /**
239
240
  * The receipt of `writer.reviseDocument`. `droppedAnchors` names every prose
240
- * anchor the write did not carry, at its path in the stored document; a table
241
+ * anchor the write did not carry, at its path and line in the stored document; a table
241
242
  * cell's anchors drop unnamed. `warnings` are the parse's, then each revised
242
243
  * content field's `parse::dropped_construct`, then the writer's `conform::*`.
243
244
  * A field that lands rather than revises, on an inserted card or over no stored
244
245
  * content, reports no drop.
245
246
  */
246
247
  export interface DocumentRevised {
247
- droppedAnchors: { path: string; id: string }[];
248
+ droppedAnchors: DocumentAnchor[];
248
249
  warnings: Diagnostic[];
249
250
  }
250
251
 
@@ -258,7 +259,13 @@ export interface DocumentRevised {
258
259
  */
259
260
  export interface AnnotatedMarkdown {
260
261
  markdown: string;
261
- anchors: { id: string; path: string; line: string }[];
262
+ anchors: DocumentAnchor[];
263
+ }
264
+
265
+ export interface DocumentAnchor {
266
+ id: string;
267
+ path: string;
268
+ line: string;
262
269
  }
263
270
 
264
271
  /**
@@ -450,6 +457,8 @@ export interface Resolved {
450
457
  /** UI layout hints for a single field. Display order is not a hint: key order
451
458
  * in the schema's `fields`/`properties` objects is the ordering contract. */
452
459
  export interface QuillFieldUi {
460
+ /** The id of the card section holding the field, a key of the card's
461
+ * `ui.groups`. */
453
462
  group?: string;
454
463
  compact?: boolean;
455
464
  multiline?: boolean;
@@ -466,18 +475,18 @@ export interface QuillFieldUi {
466
475
  layout?: "table" | "flat";
467
476
  }
468
477
 
469
- /** One entry in a card's `ui.groups` registry: a display-label override for the
470
- * group id (the map key). An empty object carries no override, and the consumer
471
- * derives the label from the id (`memo_for` → "Memo For"). */
478
+ /** One section in a card's `ui.groups`: a display-label override for the
479
+ * section id (the map key). An empty object carries no override, and the
480
+ * consumer derives the label from the id (`memo_for` → "Memo For"). */
472
481
  export interface QuillGroupUi {
473
482
  title?: string;
474
483
  }
475
484
 
476
485
  /** UI layout hints for a card (main or named card kind). */
477
486
  export interface QuillCardUi {
478
- /** The groups a field's `ui.group` may reference, keyed by group id. Key
479
- * order is the display-order contract, as with `fields`. Absent when the
480
- * card declares no groups. */
487
+ /** The card's sections keyed by id, each holding at least one field, which
488
+ * names it in its `ui.group`. Key order is the display-order contract, as
489
+ * with `fields`. Absent when the card declares no sections. */
481
490
  groups?: Record<string, QuillGroupUi>;
482
491
  }
483
492
 
@@ -619,7 +628,8 @@ export interface FieldRegion {
619
628
  rect: [number, number, number, number];
620
629
  /**
621
630
  * The slice this box covers: USV `[start, end)` into the field's `Content`
622
- * for one content segment, `undefined` for a scalar site or widget.
631
+ * for one content segment, `undefined` for a scalar's ink, a claim or a
632
+ * widget.
623
633
  */
624
634
  span?: [number, number];
625
635
  }
@@ -630,6 +640,23 @@ export interface FieldRegion {
630
640
  */
631
641
  export type HitGranularity = "cluster" | "segment";
632
642
 
643
+ /**
644
+ * One address a compiled document fills and the region address a click
645
+ * reaches it through: the consumer's copy of this contract is
646
+ * `runtime/runtime.d.ts`.
647
+ */
648
+ export interface FieldCoverage {
649
+ /**
650
+ * Canonical `DocPath` field address, as `FieldRegion.field` spells it.
651
+ */
652
+ field: string;
653
+ /**
654
+ * The `DocPath` of the region reaching `field`: itself, or the nearest
655
+ * enclosing address a region carries. `undefined` where no click does.
656
+ */
657
+ coveredBy?: string;
658
+ }
659
+
633
660
  /**
634
661
  * Output formats supported by backends. Gated behind the engine surface so
635
662
  * tsify omits it from the core bundle, which has no rendering surface.
@@ -1010,6 +1037,13 @@ export class LiveSession {
1010
1037
  private constructor();
1011
1038
  free(): void;
1012
1039
  [Symbol.dispose](): void;
1040
+ /**
1041
+ * Each address the current compile fills that a reader could want to
1042
+ * click, and the `DocPath` of the region reaching it: the address itself,
1043
+ * the nearest enclosing one a region carries (a row claim reaching its
1044
+ * cells), or `undefined` where no click does. Reflects the current compile.
1045
+ */
1046
+ coverage(): FieldCoverage[];
1013
1047
  /**
1014
1048
  * The schema field whose content is under a point on `page`: the `DocPath`
1015
1049
  * address to focus in the editor, or `undefined` off any field's ink.
@@ -1030,9 +1064,9 @@ export class LiveSession {
1030
1064
  /**
1031
1065
  * The whole-field highlight boxes for `field`: one union rect per page over
1032
1066
  * the field's `span`-bearing content segments, the union `regions()` leaves
1033
- * derived. **Content only**: a field placed solely as a scalar reference or
1034
- * a bound widget carries no `span` and returns `[]`, its box being a single
1035
- * `regions()` rect. Reflects the current compile.
1067
+ * derived. **Content only**: a field placed solely as a scalar's ink, a
1068
+ * claim or a bound widget carries no `span` and returns `[]`, its box being
1069
+ * a single `regions()` rect. Reflects the current compile.
1036
1070
  */
1037
1071
  fieldBoxes(field: string): FieldRegion[];
1038
1072
  /**
@@ -1077,9 +1111,9 @@ export class LiveSession {
1077
1111
  */
1078
1112
  positionAt(page: number, x: number, y: number, tol_pt?: number | null): ContentHit | undefined;
1079
1113
  /**
1080
- * Schema-field geometry for this compiled session: each content field's
1081
- * **first placement** (one region per page it touches) plus widget and
1082
- * scalar-reference-site regions, keyed on the canonical `DocPath` address. A
1114
+ * Schema-field geometry for this compiled session: each piece of generated
1115
+ * ink's **first placement** (one region per page it touches) plus claim and
1116
+ * widget regions, keyed on the canonical `DocPath` address. A
1083
1117
  * field may appear more than once, so group by `field` (see `FieldRegion`).
1084
1118
  * A session-level query: no render, no byte artifact. The click direction is
1085
1119
  * `fieldAt`. Empty for backends that place no schema fields.
@@ -1197,8 +1231,9 @@ export class Quill {
1197
1231
  toTree(): Map<string, Uint8Array>;
1198
1232
  /**
1199
1233
  * Validate `doc` against this quill's schema, returning every diagnostic:
1200
- * an error blocks a render, a warning does not. Forwards the canonical
1201
- * `validation::*` diagnostics the engine emits.
1234
+ * an error blocks a render, a warning does not. Forwards the engine's
1235
+ * `validation::*`, a markdown string's `parse::dropped_construct` and the
1236
+ * backend's `backend::declined_construct`.
1202
1237
  */
1203
1238
  validate(doc: Document): Diagnostic[];
1204
1239
  /**
@@ -1242,11 +1277,10 @@ export class Quillmark {
1242
1277
  open(quill: Quill, doc: Document, today?: string | null): LiveSession;
1243
1278
  /**
1244
1279
  * Render `doc` against `quill` in one shot: `open` + `LiveSession.render`,
1245
- * with every `quill.validate` warning but `validation::declined_construct`,
1246
- * which the compile raises as `backend::declined_construct`, ahead of the
1247
- * compile's in `warnings`; the load's stay on `doc.warnings`. An unset
1248
- * `output_format` falls back to the backend's first supported format.
1249
- * `today` reads as on `open`.
1280
+ * with every `quill.validate` warning in `warnings`, a decline among the
1281
+ * compile's and the rest ahead of them; the load's stay on `doc.warnings`.
1282
+ * An unset `output_format` falls back to the backend's first supported
1283
+ * format. `today` reads as on `open`.
1250
1284
  */
1251
1285
  render(quill: Quill, doc: Document, opts?: RenderOptions | null, today?: string | null): RenderResult;
1252
1286
  /**
@@ -1422,6 +1456,7 @@ export interface InitOutput {
1422
1456
  readonly isInline: (a: number, b: number) => void;
1423
1457
  readonly isPlain: (a: number, b: number) => void;
1424
1458
  readonly livesession_backendId: (a: number, b: number) => void;
1459
+ readonly livesession_coverage: (a: number, b: number) => void;
1425
1460
  readonly livesession_fieldAt: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
1426
1461
  readonly livesession_fieldBoxes: (a: number, b: number, c: number, d: number) => void;
1427
1462
  readonly livesession_locate: (a: number, b: number, c: number, d: number, e: number) => void;
package/render/wasm.js CHANGED
@@ -26,8 +26,8 @@ export class Document {
26
26
  * leaves the document untouched. Field errors throw the same per-field
27
27
  * bundle as [`commitFields`](Self::commit_fields); an invalid kind or body,
28
28
  * or a bad position, throws a single-entry bundle keyed `$kind` / `$body`.
29
- * Returns the body import's `parse::dropped_construct` warnings, anchored
30
- * at the placed card's body.
29
+ * Returns the fields' `parse::dropped_construct` warnings, then the body
30
+ * import's, anchored under the placed card.
31
31
  * @param {Quill} quill
32
32
  * @param {string} kind
33
33
  * @param {Record<string, unknown>} [fields]
@@ -73,9 +73,13 @@ export class Document {
73
73
  *
74
74
  * The `quill` handle is passed per call because a `Document` carries only a
75
75
  * `$quill` reference, not the resolved schema.
76
+ *
77
+ * Returns a `parse::dropped_construct` warning per construct a `richtext`
78
+ * markdown string in the value dropped, at the string's path.
76
79
  * @param {Quill} quill
77
80
  * @param {Addr | string} addr
78
81
  * @param {any} value
82
+ * @returns {Diagnostic[]}
79
83
  */
80
84
  _commitField(quill, addr, value) {
81
85
  try {
@@ -84,9 +88,11 @@ export class Document {
84
88
  wasm.document__commitField(retptr, this.__wbg_ptr, quill.__wbg_ptr, addHeapObject(addr), addHeapObject(value));
85
89
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
86
90
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
87
- if (r1) {
88
- throw takeObject(r0);
91
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
92
+ if (r2) {
93
+ throw takeObject(r1);
89
94
  }
95
+ return takeObject(r0);
90
96
  } finally {
91
97
  wasm.__wbindgen_add_to_stack_pointer(16);
92
98
  }
@@ -98,10 +104,12 @@ export class Document {
98
104
  * diagnostic contract as [`storeFields`](Document::store_fields) — nothing
99
105
  * applied on error, one `diagnostics` entry per offending field, including
100
106
  * `edit::unknown_field` for undeclared names. Throws on an out-of-range
101
- * card.
107
+ * card. Returns [`commitField`](Document::commit_field)'s warnings for
108
+ * every field, in batch order.
102
109
  * @param {Quill} quill
103
110
  * @param {CardAddr} addr
104
111
  * @param {Record<string, unknown>} fields
112
+ * @returns {Diagnostic[]}
105
113
  */
106
114
  _commitFields(quill, addr, fields) {
107
115
  try {
@@ -110,9 +118,11 @@ export class Document {
110
118
  wasm.document__commitFields(retptr, this.__wbg_ptr, quill.__wbg_ptr, addHeapObject(addr), addHeapObject(fields));
111
119
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
112
120
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
113
- if (r1) {
114
- throw takeObject(r0);
121
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
122
+ if (r2) {
123
+ throw takeObject(r1);
115
124
  }
125
+ return takeObject(r0);
116
126
  } finally {
117
127
  wasm.__wbindgen_add_to_stack_pointer(16);
118
128
  }
@@ -1224,6 +1234,28 @@ export class LiveSession {
1224
1234
  wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
1225
1235
  }
1226
1236
  }
1237
+ /**
1238
+ * Each address the current compile fills that a reader could want to
1239
+ * click, and the `DocPath` of the region reaching it: the address itself,
1240
+ * the nearest enclosing one a region carries (a row claim reaching its
1241
+ * cells), or `undefined` where no click does. Reflects the current compile.
1242
+ * @returns {FieldCoverage[]}
1243
+ */
1244
+ coverage() {
1245
+ try {
1246
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1247
+ wasm.livesession_coverage(retptr, this.__wbg_ptr);
1248
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1249
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1250
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1251
+ if (r2) {
1252
+ throw takeObject(r1);
1253
+ }
1254
+ return takeObject(r0);
1255
+ } finally {
1256
+ wasm.__wbindgen_add_to_stack_pointer(16);
1257
+ }
1258
+ }
1227
1259
  /**
1228
1260
  * The schema field whose content is under a point on `page`: the `DocPath`
1229
1261
  * address to focus in the editor, or `undefined` off any field's ink.
@@ -1264,9 +1296,9 @@ export class LiveSession {
1264
1296
  /**
1265
1297
  * The whole-field highlight boxes for `field`: one union rect per page over
1266
1298
  * the field's `span`-bearing content segments, the union `regions()` leaves
1267
- * derived. **Content only**: a field placed solely as a scalar reference or
1268
- * a bound widget carries no `span` and returns `[]`, its box being a single
1269
- * `regions()` rect. Reflects the current compile.
1299
+ * derived. **Content only**: a field placed solely as a scalar's ink, a
1300
+ * claim or a bound widget carries no `span` and returns `[]`, its box being
1301
+ * a single `regions()` rect. Reflects the current compile.
1270
1302
  * @param {string} field
1271
1303
  * @returns {FieldRegion[]}
1272
1304
  */
@@ -1405,9 +1437,9 @@ export class LiveSession {
1405
1437
  }
1406
1438
  }
1407
1439
  /**
1408
- * Schema-field geometry for this compiled session: each content field's
1409
- * **first placement** (one region per page it touches) plus widget and
1410
- * scalar-reference-site regions, keyed on the canonical `DocPath` address. A
1440
+ * Schema-field geometry for this compiled session: each piece of generated
1441
+ * ink's **first placement** (one region per page it touches) plus claim and
1442
+ * widget regions, keyed on the canonical `DocPath` address. A
1411
1443
  * field may appear more than once, so group by `field` (see `FieldRegion`).
1412
1444
  * A session-level query: no render, no byte artifact. The click direction is
1413
1445
  * `fieldAt`. Empty for backends that place no schema fields.
@@ -1822,8 +1854,9 @@ export class Quill {
1822
1854
  }
1823
1855
  /**
1824
1856
  * Validate `doc` against this quill's schema, returning every diagnostic:
1825
- * an error blocks a render, a warning does not. Forwards the canonical
1826
- * `validation::*` diagnostics the engine emits.
1857
+ * an error blocks a render, a warning does not. Forwards the engine's
1858
+ * `validation::*`, a markdown string's `parse::dropped_construct` and the
1859
+ * backend's `backend::declined_construct`.
1827
1860
  * @param {Document} doc
1828
1861
  * @returns {Diagnostic[]}
1829
1862
  */
@@ -1917,11 +1950,10 @@ export class Quillmark {
1917
1950
  }
1918
1951
  /**
1919
1952
  * Render `doc` against `quill` in one shot: `open` + `LiveSession.render`,
1920
- * with every `quill.validate` warning but `validation::declined_construct`,
1921
- * which the compile raises as `backend::declined_construct`, ahead of the
1922
- * compile's in `warnings`; the load's stay on `doc.warnings`. An unset
1923
- * `output_format` falls back to the backend's first supported format.
1924
- * `today` reads as on `open`.
1953
+ * with every `quill.validate` warning in `warnings`, a decline among the
1954
+ * compile's and the rest ahead of them; the load's stay on `doc.warnings`.
1955
+ * An unset `output_format` falls back to the backend's first supported
1956
+ * format. `today` reads as on `open`.
1925
1957
  * @param {Quill} quill
1926
1958
  * @param {Document} doc
1927
1959
  * @param {RenderOptions | null} [opts]
Binary file
@@ -59,6 +59,7 @@ export const importMarkdown: (a: number, b: number, c: number) => void;
59
59
  export const isInline: (a: number, b: number) => void;
60
60
  export const isPlain: (a: number, b: number) => void;
61
61
  export const livesession_backendId: (a: number, b: number) => void;
62
+ export const livesession_coverage: (a: number, b: number) => void;
62
63
  export const livesession_fieldAt: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
63
64
  export const livesession_fieldBoxes: (a: number, b: number, c: number, d: number) => void;
64
65
  export const livesession_locate: (a: number, b: number, c: number, d: number, e: number) => void;