@quillmark/wasm 0.120.0 → 0.122.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,173 @@
1
1
  # Changelog
2
2
 
3
+ ## v0.122.0 - 2026-10-05
4
+
5
+ Upgrade path: [0.121 → 0.122](docs/migrations/0.121-to-0.122.md).
6
+
7
+ ### YAML booleans
8
+
9
+ - fix(core)!: **only `true` and `false`, in any letter case, are YAML
10
+ booleans**, so an unquoted `y`, `n`, `yes`, `no`, `on` or `off` is the text
11
+ written: `middle_initial: N` reaches the plate as `N` where it printed
12
+ `false`, and nothing reports the change. A card-yaml payload, `Quill.yaml` and
13
+ `QuillValue::from_yaml_str` share the reading. A word under a `boolean`,
14
+ `number` or `integer` field, a matrix member's tick included, fails
15
+ validation as `validation::type_mismatch` and the render as
16
+ `validation::coercion_failed`; in `Quill.yaml` a word where a boolean belongs
17
+ fails to load, and `values: [US, NO, DE]` loads. `!!bool` on a word fails the
18
+ parse, its hint naming the two booleans. (#2034, #2044)
19
+
20
+ ### Comment placement
21
+
22
+ - fix(core)!: **a comment keeps the slot the YAML gives it**: the prescan reads
23
+ each comment's container and slot from the parser's event stream, so one in a
24
+ sequence at its key's column, indented less than its block, in a compact
25
+ nested sequence or trailing a plain scalar's continuation line re-emits
26
+ there, where it moved or dropped. A sequence item carrying a trailer beside
27
+ its first key's emits in the bare-dash form. `parse::unsupported_yaml_tag`
28
+ warns on every tagged node at its own path. A column-zero key outside the
29
+ field grammar fails as `parse::invalid_structure` naming the field, and so
30
+ does a block whose comments and tags record more than 64 bytes of path per
31
+ byte of the block, plus 64 KiB. (#2041)
32
+ - fix(core)!: **a legacy `quillmark/document@0.82.0` row's `$id` drops with its
33
+ inline trailer**, which re-emitted on the item above. (#2041)
34
+ - fix(core): **a run of comments meets no count limit**, so a key's trailer
35
+ ahead of 32 own-line comments parses, as does any longer run 0.121 refused.
36
+ (#2044)
37
+ - fix(core): removing a `$seed` overlay keeps its siblings' order (#2041); a
38
+ comment under an empty `$ext` or `$seed` survives `to_markdown`; and a
39
+ top-level field named `null`, in any letter case, emits quoted, so the
40
+ markdown reads back. (#2044)
41
+
42
+ ### Checkbox appearance states
43
+
44
+ - fix(pdf,acroform)!: **every stamped checkbox carries both its appearance
45
+ states**, `/AP << /N << /Yes … /Off … >> >>` with `/AS` and `/V` naming the
46
+ current one, so a filler toggles it by renaming `/AS` and `/V`. A reader
47
+ taking `/N` only as a stream draws an empty box, and rendered PDF bytes move
48
+ wherever a checkbox is stamped. `StampOptions` gains `states:
49
+ AppearanceStates`: `All`, the default, is the deliverable, and `Selected`
50
+ writes each box's `/N` as the one stream `/AS` names, for a rasterizer that
51
+ cannot resolve it, as the acroform canvas does. (#2038)
52
+ - fix(pdf): **a direct `null` dictionary entry reads as absent**, so a base
53
+ PDF's `/AcroForm null` stamps where it failed as `pdf::existing_acroform`.
54
+ Nulling the key strips no widgets. (#2038)
55
+ - fix(pdf): **a stamp appends to a page's `/Annots` without rewriting the
56
+ array's bytes**, where it decoded them as lossy UTF-8, turning an inline
57
+ annotation's Latin-1 byte into U+FFFD, and could land the new refs inside a
58
+ closing `%` comment. (#2044)
59
+
60
+ ### Typst plate path
61
+
62
+ - fix(typst)!: **a `plate_file` at a path Typst's path grammar refuses fails to
63
+ open as `typst::plate_path_invalid`**, where the plate loaded as `main.typ`
64
+ and shadowed the quill's own `main.typ`. Such a path holds a `\`: separate
65
+ the path with `/`. (#2037)
66
+ - feat(typst): **a `typst::file_not_found` for a bare path in a module below the
67
+ quill root hints the rooted spelling** when the quill root holds that file.
68
+ (#2037)
69
+
70
+ ### WASM options and types
71
+
72
+ - fix(wasm)!: **an options object refuses a key the verb does not read**:
73
+ `engine.render` and `session.render` throw on a render option outside
74
+ `format`, `ppi`, `pages` and `regions`, and `new Engine` on a key other than
75
+ `backends`, so `engine.render(quill, doc, { today })` rejects, naming the
76
+ trailing argument the date belongs in, where it rendered the local date. A
77
+ null-prototype or cross-realm options object, `Addr` or `CardInput` is
78
+ checked too. (#2036)
79
+ - fix(wasm)!: **`runtime.d.ts`'s writer and reader verbs type as declared**:
80
+ `Addr`, `Content`, `Delta`, `PathStep` and `Resolved` read as `any`, so code
81
+ leaning on the `any` stops compiling. (#2043)
82
+
83
+ ### Load warnings
84
+
85
+ - fix(core,typst,cli)!: **a failed Typst compile carries the quill's load
86
+ warnings after its errors**, so a thrown error's `diagnostics` may hold
87
+ warnings; `diagnostics[0]` and the message are unchanged. `quillmark render`
88
+ prints the carried warnings ahead of the error, and `quillmark validate`
89
+ reports each once. (#2039)
90
+ - fix(typst,cli): **`quillmark workspace` prints the quill's load warnings**,
91
+ which `Workspace.warnings` carries, and its `typst watch` command passes
92
+ `--creation-timestamp=` at noon UTC of the render date, so the plate's
93
+ `datetime.today()` agrees with the render's, before 1970 too. (#2039,
94
+ #2044)
95
+
96
+ ### Raster refusals
97
+
98
+ - fix(core,typst,acroform,wasm): **a raster refusal names a ppi or scale that
99
+ fits**: a PNG export one that fits every selected page, pointing a page too
100
+ long for PNG at PDF or SVG, and a canvas a scale. Both backends size a raster
101
+ by `raster_size`, each side rounded and at least one pixel, so a tiny canvas
102
+ scale paints one pixel where acroform threw, and `paint` checks a scale as
103
+ the `f64` a JS number is before narrowing it. (#2040)
104
+ - feat(cli): **`quillmark render --ppi`** sets the PNG density. (#2040)
105
+
106
+ ### Docs
107
+
108
+ - docs(quills): **consumer-study corrections** across the quill and authoring
109
+ pages. (#2035)
110
+
111
+ ### Build
112
+
113
+ - ci: `wasm-bindgen-cli` pinned to the lockfile's 0.2.129; thiserror 2.0.21,
114
+ web-sys 0.3.106 and `taiki-e/install-action` 2.87.21. (#2032, #2033)
115
+
116
+
117
+ ## v0.121.0 - 2026-09-30
118
+
119
+ Upgrade path: [0.120 → 0.121](docs/migrations/0.120-to-0.121.md).
120
+
121
+ ### Matrix presence
122
+
123
+ - feat(core,typst,wasm)!: **a matrix member is held by being present in the
124
+ document**: a mapping is held whatever it carries, `{}` included, and a bare
125
+ scalar is the tick. A mapping naming no `held` flips from unticked to ticked,
126
+ with nothing reporting it. `held` is never stored: a member mapping storing
127
+ it fails validation as `validation::held_stored`, and the render with it, and
128
+ a `Quill.yaml` `seed:` or `default:` storing it fails to load as
129
+ `quill::seed_held_stored` / `quill::default_held_stored`. A `held: null` is
130
+ absent. The strict write rests a held member with no answers as `true`, and
131
+ the blueprint's `# e.g.` line drops `held: true`. (#2023)
132
+
133
+ ### Matrix plate
134
+
135
+ - feat(core,typst,acroform)!: **a matrix reaches the plate as the members it
136
+ holds**, each its columns keyed by id: no member carries `held` or a roster
137
+ `title`, and an unheld member is absent, so a plate reading `m.held` or
138
+ `m.title` fails to compile. `roster(dict, key)` in the Typst helper prints the
139
+ whole vocabulary as `(id, title, held, value, path)` rows, and the dictionary
140
+ declaring a matrix carries `$path` for it. A member's tick is its own address,
141
+ `<field>.<member>`: a claim on `<field>.<member>.held` fails the compile, an
142
+ acroform binding on it fails to load as `acroform::dangling_binding`, and a
143
+ bare tick the boolean coercion refuses is `validation::type_mismatch` at the
144
+ member's path. `resolve()` reports the members a matrix holds. A matrix takes
145
+ a `default:` and `type: matrix?`. The transform schema carries the roster as
146
+ `quillmark:roster` `[id, title]` pairs, and Rust `QUILLMARK_ORDER_KEY` is
147
+ `QUILLMARK_ROSTER_KEY`; `FieldSchema::members` is `FieldSchema::member`,
148
+ beside `added_item`, and `namespace_props` answers `None` for a matrix.
149
+ (#2023)
150
+
151
+ ### Open matrix
152
+
153
+ - feat(core,typst,wasm): **`open: true` on a matrix admits items a document
154
+ adds**, each keyed by a snake_case id and carrying a `title`, taking the
155
+ roster's columns. The plate and `roster` carry them after the held roster
156
+ members, sorted by id, and an added item's `title` is a cell with an address.
157
+ Any other key outside the roster is `validation::enum_violation`, which gains
158
+ an `open` arg. The transform schema declares the added item as
159
+ `additionalProperties`, `schema()` emits `open: true` (WASM
160
+ `QuillFieldSchema.open`), and an acroform quill declaring one fails to load as
161
+ `quill::open_matrix_unsupported`. `FieldType::Matrix` carries `open: bool`.
162
+ (#2023)
163
+
164
+ ### Release
165
+
166
+ - ci(release): **crate publishing retries past a crates.io index backlog**,
167
+ excluding the crates crates.io already holds at the release version, so a
168
+ re-run resumes a partial upload. (#2029)
169
+
170
+
3
171
  ## v0.120.0 - 2026-09-30
4
172
 
5
173
  Upgrade path: [0.119 → 0.120](docs/migrations/0.119-to-0.120.md).
package/README.md CHANGED
@@ -124,7 +124,8 @@ may load a backend). Pass `{ backends }` to register or override backend descrip
124
124
  Each entry is a descriptor (`{ [backendId]: { load, formats } }`) where `load`
125
125
  is the lazy thunk returning the backend module and `formats` is the
126
126
  **required** static capability manifest. A malformed descriptor throws at
127
- `new Engine(...)`, naming the backend id.
127
+ `new Engine(...)`, naming the backend id, and so does any options key other
128
+ than `backends`.
128
129
 
129
130
  **The format probe is always free.** `supportedFormats` depends only on
130
131
  `quill.backendId`, and answers from the descriptor's required `formats`
@@ -362,7 +363,7 @@ value throws `FieldDecode`; an absent field reads back `undefined` and a
362
363
  present-null `null`. A read never coerces a scalar (`qty: "3"` reads `"3"`);
363
364
  `resolve()` is the coerced view.
364
365
 
365
- ### `engine.render(quill, parsed, opts?)` vs. `engine.open(quill, parsed)`
366
+ ### `engine.render(quill, parsed, opts?, today?)` vs. `engine.open(quill, parsed, today?)`
366
367
 
367
368
  Use **`engine.render`** for one-shot exports (PDF/SVG/PNG): compiles, emits
368
369
  artifacts, done. Use **`LiveSession`** (returned by `engine.open`) for
@@ -378,6 +379,15 @@ the local date): what a `today` date field and a plate's `datetime.today()`
378
379
  render as. A session keeps the date it opened with, so a preview left open past
379
380
  midnight renders yesterday's until it is reopened.
380
381
 
382
+ `opts` takes `format`, `ppi`, `pages` and `regions`, on `engine.render` and
383
+ `session.render` alike. Any other key throws rather than reading as absent,
384
+ `today` included, so `engine.render(quill, doc, { today })` rejects instead of
385
+ rendering the local date. The date goes last:
386
+
387
+ ```js
388
+ await engine.render(quill, doc, { format: "pdf" }, "2026-03-14");
389
+ ```
390
+
381
391
  A document that compiles to zero pages still produces a valid session
382
392
  (`pageCount === 0`); `paint(ctx, 0, scale)` and `pageSize(0)` then throw. Branch on
383
393
  `pageCount === 0` to render a "no pages to preview" UI rather than relying on
@@ -478,8 +488,10 @@ throws a real `Error` and attaches the property, so there is no constructor to
478
488
  from any build or WASM instance in the page.
479
489
 
480
490
  `diagnostics` is always non-empty: length 1 for most failures, length N for
481
- backend compilation errors, and `message` is derived from it. The same shape
482
- applies to every throw site:
491
+ backend compilation errors, and `message` is derived from it. `diagnostics[0]`
492
+ is an error. A failed Typst `engine.render` or `engine.open` also carries the
493
+ quill's load warnings after its errors, so read each entry's `severity`. The
494
+ same shape applies to every throw site:
483
495
 
484
496
  - `Document.fromMarkdown`: parse errors (missing root `$quill` metadata, YAML
485
497
  errors, `parse::input_too_large` for inputs > 10 MiB).
@@ -490,6 +502,10 @@ applies to every throw site:
490
502
  `diagnostics[0].code`, never on message text.
491
503
  - `engine.render` / `session.render`: backend compilation failures and
492
504
  validation errors.
505
+ - An object argument carrying a key its verb does not read: the render
506
+ options, `new Engine` options, an `Addr`, a `CardInput`. The diagnostic
507
+ names the key and carries no `code`: it is a call site to fix, not a
508
+ condition to route on.
493
509
  - `engine.render(quill, parsed)` against a quill whose *name* differs
494
510
  (`quill::name_mismatch`) or whose *version* falls outside the document's
495
511
  selector (`quill::version_mismatch`): a throw, never a warning.
package/core/wasm.d.ts CHANGED
@@ -439,9 +439,16 @@ export interface QuillFieldSchema {
439
439
  variants?: Record<string, Record<string, QuillFieldSchema>>;
440
440
  /** The roster of a `type: "matrix"` field, required there and valid
441
441
  * nowhere else: member id to display title, key order the display order.
442
- * Each member is an object of `held` plus the field's `properties`
443
- * (the columns), addressed as `<field>.<member id>.held`. */
442
+ * A member is held by being present in the document, as a mapping of the
443
+ * field's `properties` (the columns) or a bare `true`; unticking removes
444
+ * it. Its own address `<field>.<member id>` is the tick, and each column
445
+ * addresses one step further down. */
444
446
  members?: Record<string, string>;
447
+ /** `true` on a `type: "matrix"` field admitting items a document adds
448
+ * beside the roster: each keyed by a snake_case id and carrying a
449
+ * `title` string beside the columns, held by being present. Valid only
450
+ * on a matrix. */
451
+ open?: boolean;
445
452
  ui?: QuillFieldUi;
446
453
  properties?: Record<string, QuillFieldSchema>;
447
454
  items?: QuillFieldSchema;
package/core/wasm.js CHANGED
@@ -1788,11 +1788,11 @@ export function start() {
1788
1788
  function __wbg_get_imports() {
1789
1789
  const import0 = {
1790
1790
  __proto__: null,
1791
- __wbg_Error_67e7344beaa85059: function(arg0, arg1) {
1791
+ __wbg_Error_30c8987f7c2ed4e2: function(arg0, arg1) {
1792
1792
  const ret = Error(getStringFromWasm0(arg0, arg1));
1793
1793
  return addHeapObject(ret);
1794
1794
  },
1795
- __wbg_Number_c54e7112a3fa7e3e: function(arg0) {
1795
+ __wbg_Number_14af1003b8dd5ead: function(arg0) {
1796
1796
  const ret = Number(getObject(arg0));
1797
1797
  return ret;
1798
1798
  },
@@ -1803,68 +1803,68 @@ function __wbg_get_imports() {
1803
1803
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1804
1804
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1805
1805
  },
1806
- __wbg___wbindgen_bigint_get_as_i64_b482365c149396c8: function(arg0, arg1) {
1806
+ __wbg___wbindgen_bigint_get_as_i64_a2383202b9353e4c: function(arg0, arg1) {
1807
1807
  const v = getObject(arg1);
1808
1808
  const ret = typeof(v) === 'bigint' ? v : undefined;
1809
1809
  getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
1810
1810
  getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
1811
1811
  },
1812
- __wbg___wbindgen_boolean_get_7a12af2b3f899c5a: function(arg0) {
1812
+ __wbg___wbindgen_boolean_get_5b446f51afd21013: function(arg0) {
1813
1813
  const v = getObject(arg0);
1814
1814
  const ret = typeof(v) === 'boolean' ? v : undefined;
1815
1815
  return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
1816
1816
  },
1817
- __wbg___wbindgen_debug_string_0e68cf47c9cbd9b0: function(arg0, arg1) {
1817
+ __wbg___wbindgen_debug_string_4687d8d8c2017d52: function(arg0, arg1) {
1818
1818
  const ret = debugString(getObject(arg1));
1819
1819
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1820
1820
  const len1 = WASM_VECTOR_LEN;
1821
1821
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1822
1822
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1823
1823
  },
1824
- __wbg___wbindgen_in_50072d4d6e45c193: function(arg0, arg1) {
1824
+ __wbg___wbindgen_in_92f62ee1427d9e49: function(arg0, arg1) {
1825
1825
  const ret = getObject(arg0) in getObject(arg1);
1826
1826
  return ret;
1827
1827
  },
1828
- __wbg___wbindgen_is_bigint_60fc0336cb14f5d7: function(arg0) {
1828
+ __wbg___wbindgen_is_bigint_b123553bed3bb382: function(arg0) {
1829
1829
  const ret = typeof(getObject(arg0)) === 'bigint';
1830
1830
  return ret;
1831
1831
  },
1832
- __wbg___wbindgen_is_function_fcda5e3902d732fe: function(arg0) {
1832
+ __wbg___wbindgen_is_function_1f9d30630b8b1d3d: function(arg0) {
1833
1833
  const ret = typeof(getObject(arg0)) === 'function';
1834
1834
  return ret;
1835
1835
  },
1836
- __wbg___wbindgen_is_null_5160b3e381865372: function(arg0) {
1836
+ __wbg___wbindgen_is_null_e343b7d08827ba72: function(arg0) {
1837
1837
  const ret = getObject(arg0) === null;
1838
1838
  return ret;
1839
1839
  },
1840
- __wbg___wbindgen_is_object_edb6b15aa3afe12e: function(arg0) {
1840
+ __wbg___wbindgen_is_object_3c45d4f2dde4e749: function(arg0) {
1841
1841
  const val = getObject(arg0);
1842
1842
  const ret = typeof(val) === 'object' && val !== null;
1843
1843
  return ret;
1844
1844
  },
1845
- __wbg___wbindgen_is_string_c4f7cb494a2a21f1: function(arg0) {
1845
+ __wbg___wbindgen_is_string_90b56bc79aad6f6c: function(arg0) {
1846
1846
  const ret = typeof(getObject(arg0)) === 'string';
1847
1847
  return ret;
1848
1848
  },
1849
- __wbg___wbindgen_is_undefined_8c687d0b90d5b524: function(arg0) {
1849
+ __wbg___wbindgen_is_undefined_8865fb403f8fe9d8: function(arg0) {
1850
1850
  const ret = getObject(arg0) === undefined;
1851
1851
  return ret;
1852
1852
  },
1853
- __wbg___wbindgen_jsval_eq_9fdcd3c0a860dd3b: function(arg0, arg1) {
1853
+ __wbg___wbindgen_jsval_eq_02babf21faa37971: function(arg0, arg1) {
1854
1854
  const ret = getObject(arg0) === getObject(arg1);
1855
1855
  return ret;
1856
1856
  },
1857
- __wbg___wbindgen_jsval_loose_eq_3c30021c243b64cd: function(arg0, arg1) {
1857
+ __wbg___wbindgen_jsval_loose_eq_677f21e468d6b461: function(arg0, arg1) {
1858
1858
  const ret = getObject(arg0) == getObject(arg1);
1859
1859
  return ret;
1860
1860
  },
1861
- __wbg___wbindgen_number_get_1dc732b810cb937c: function(arg0, arg1) {
1861
+ __wbg___wbindgen_number_get_2e0e7dee9f701a71: function(arg0, arg1) {
1862
1862
  const obj = getObject(arg1);
1863
1863
  const ret = typeof(obj) === 'number' ? obj : undefined;
1864
1864
  getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
1865
1865
  getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
1866
1866
  },
1867
- __wbg___wbindgen_string_get_92ab86bb19cbc12f: function(arg0, arg1) {
1867
+ __wbg___wbindgen_string_get_0380ccaa2f57f0d9: function(arg0, arg1) {
1868
1868
  const obj = getObject(arg1);
1869
1869
  const ret = typeof(obj) === 'string' ? obj : undefined;
1870
1870
  var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
@@ -1872,22 +1872,22 @@ function __wbg_get_imports() {
1872
1872
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1873
1873
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1874
1874
  },
1875
- __wbg___wbindgen_throw_5d9e815e6fdf150f: function(arg0, arg1) {
1875
+ __wbg___wbindgen_throw_41e9ee4f547fc59a: function(arg0, arg1) {
1876
1876
  throw new Error(getStringFromWasm0(arg0, arg1));
1877
1877
  },
1878
- __wbg_call_269c5566fbede3eb: function() { return handleError(function (arg0, arg1) {
1878
+ __wbg_call_6137034ef55c9d0f: function() { return handleError(function (arg0, arg1) {
1879
1879
  const ret = getObject(arg0).call(getObject(arg1));
1880
1880
  return addHeapObject(ret);
1881
1881
  }, arguments); },
1882
- __wbg_done_cffed884d87aa22e: function(arg0) {
1882
+ __wbg_done_b41a1d26cdb37fb6: function(arg0) {
1883
1883
  const ret = getObject(arg0).done;
1884
1884
  return ret;
1885
1885
  },
1886
- __wbg_entries_20b9608d57d8ddd6: function(arg0) {
1886
+ __wbg_entries_3602f27ad32994b8: function(arg0) {
1887
1887
  const ret = getObject(arg0).entries();
1888
1888
  return addHeapObject(ret);
1889
1889
  },
1890
- __wbg_entries_972a87586902cf87: function(arg0) {
1890
+ __wbg_entries_fb6397112b1de25f: function(arg0) {
1891
1891
  const ret = Object.entries(getObject(arg0));
1892
1892
  return addHeapObject(ret);
1893
1893
  },
@@ -1902,31 +1902,31 @@ function __wbg_get_imports() {
1902
1902
  wasm.__wbindgen_export4(deferred0_0, deferred0_1, 1);
1903
1903
  }
1904
1904
  },
1905
- __wbg_from_a39669ce566077da: function(arg0) {
1905
+ __wbg_from_296ca31f8d0f1c52: function(arg0) {
1906
1906
  const ret = Array.from(getObject(arg0));
1907
1907
  return addHeapObject(ret);
1908
1908
  },
1909
- __wbg_getDate_8e7807f062ade36a: function(arg0) {
1909
+ __wbg_getDate_1181c785ea4fdd21: function(arg0) {
1910
1910
  const ret = getObject(arg0).getDate();
1911
1911
  return ret;
1912
1912
  },
1913
- __wbg_getFullYear_0cfd5a75cf3d5856: function(arg0) {
1913
+ __wbg_getFullYear_32050b2c56c56cd8: function(arg0) {
1914
1914
  const ret = getObject(arg0).getFullYear();
1915
1915
  return ret;
1916
1916
  },
1917
- __wbg_getMonth_01ce17d889ed7e5e: function(arg0) {
1917
+ __wbg_getMonth_aae5f530fd173536: function(arg0) {
1918
1918
  const ret = getObject(arg0).getMonth();
1919
1919
  return ret;
1920
1920
  },
1921
- __wbg_get_6cf5a4d4d8ad3c5a: function() { return handleError(function (arg0, arg1) {
1921
+ __wbg_get_658f6698067d9515: function() { return handleError(function (arg0, arg1) {
1922
1922
  const ret = Reflect.get(getObject(arg0), getObject(arg1));
1923
1923
  return addHeapObject(ret);
1924
1924
  }, arguments); },
1925
- __wbg_get_b1f0ab13c737f856: function(arg0, arg1) {
1925
+ __wbg_get_6c896e0571ddae51: function(arg0, arg1) {
1926
1926
  const ret = getObject(arg0)[arg1 >>> 0];
1927
1927
  return addHeapObject(ret);
1928
1928
  },
1929
- __wbg_get_unchecked_363572bdd397d473: function(arg0, arg1) {
1929
+ __wbg_get_unchecked_288889d017702237: function(arg0, arg1) {
1930
1930
  const ret = getObject(arg0)[arg1 >>> 0];
1931
1931
  return addHeapObject(ret);
1932
1932
  },
@@ -1934,7 +1934,7 @@ function __wbg_get_imports() {
1934
1934
  const ret = getObject(arg0)[getObject(arg1)];
1935
1935
  return addHeapObject(ret);
1936
1936
  },
1937
- __wbg_instanceof_ArrayBuffer_d4ff01f8247925ae: function(arg0) {
1937
+ __wbg_instanceof_ArrayBuffer_a99f175873e5d9b8: function(arg0) {
1938
1938
  let result;
1939
1939
  try {
1940
1940
  result = getObject(arg0) instanceof ArrayBuffer;
@@ -1944,7 +1944,7 @@ function __wbg_get_imports() {
1944
1944
  const ret = result;
1945
1945
  return ret;
1946
1946
  },
1947
- __wbg_instanceof_Map_1ff6a2b54c899f0d: function(arg0) {
1947
+ __wbg_instanceof_Map_b2611749102d7ba3: function(arg0) {
1948
1948
  let result;
1949
1949
  try {
1950
1950
  result = getObject(arg0) instanceof Map;
@@ -1954,17 +1954,7 @@ function __wbg_get_imports() {
1954
1954
  const ret = result;
1955
1955
  return ret;
1956
1956
  },
1957
- __wbg_instanceof_Object_87732cb922ac2e2c: function(arg0) {
1958
- let result;
1959
- try {
1960
- result = getObject(arg0) instanceof Object;
1961
- } catch (_) {
1962
- result = false;
1963
- }
1964
- const ret = result;
1965
- return ret;
1966
- },
1967
- __wbg_instanceof_Uint8Array_598adc0fef426aa8: function(arg0) {
1957
+ __wbg_instanceof_Uint8Array_828cef2aaacafc31: function(arg0) {
1968
1958
  let result;
1969
1959
  try {
1970
1960
  result = getObject(arg0) instanceof Uint8Array;
@@ -1974,35 +1964,35 @@ function __wbg_get_imports() {
1974
1964
  const ret = result;
1975
1965
  return ret;
1976
1966
  },
1977
- __wbg_isArray_5674713bb7b79043: function(arg0) {
1967
+ __wbg_isArray_e15a2ff68ffdbef2: function(arg0) {
1978
1968
  const ret = Array.isArray(getObject(arg0));
1979
1969
  return ret;
1980
1970
  },
1981
- __wbg_isSafeInteger_8f51c743827d1ec5: function(arg0) {
1971
+ __wbg_isSafeInteger_717808ad6a54bd9e: function(arg0) {
1982
1972
  const ret = Number.isSafeInteger(getObject(arg0));
1983
1973
  return ret;
1984
1974
  },
1985
- __wbg_iterator_22ddeb808cf55a6f: function() {
1975
+ __wbg_iterator_e3c31c892080e444: function() {
1986
1976
  const ret = Symbol.iterator;
1987
1977
  return addHeapObject(ret);
1988
1978
  },
1989
- __wbg_keys_6efc298980178da1: function(arg0) {
1979
+ __wbg_keys_440be172f17c0265: function(arg0) {
1990
1980
  const ret = Object.keys(getObject(arg0));
1991
1981
  return addHeapObject(ret);
1992
1982
  },
1993
- __wbg_length_31bdaf014f5fbde2: function(arg0) {
1983
+ __wbg_length_7f3c00c40364105e: function(arg0) {
1994
1984
  const ret = getObject(arg0).length;
1995
1985
  return ret;
1996
1986
  },
1997
- __wbg_length_4e1adc0d42e23620: function(arg0) {
1987
+ __wbg_length_d4bdea10311bd9cf: function(arg0) {
1998
1988
  const ret = getObject(arg0).length;
1999
1989
  return ret;
2000
1990
  },
2001
- __wbg_new_0_35540e542ba689d2: function() {
1991
+ __wbg_new_0_72d020f0c63443d4: function() {
2002
1992
  const ret = new Date();
2003
1993
  return addHeapObject(ret);
2004
1994
  },
2005
- __wbg_new_1da3429bc3c4541c: function(arg0) {
1995
+ __wbg_new_1dbf7428bba60a42: function(arg0) {
2006
1996
  const ret = new Uint8Array(getObject(arg0));
2007
1997
  return addHeapObject(ret);
2008
1998
  },
@@ -2010,51 +2000,51 @@ function __wbg_get_imports() {
2010
2000
  const ret = new Error();
2011
2001
  return addHeapObject(ret);
2012
2002
  },
2013
- __wbg_new_8d36e20aa758e411: function() {
2003
+ __wbg_new_28744009d011f847: function() {
2014
2004
  const ret = new Map();
2015
2005
  return addHeapObject(ret);
2016
2006
  },
2017
- __wbg_new_a32a1ab6c6655abe: function(arg0, arg1) {
2007
+ __wbg_new_343a093a3c2ffb4e: function(arg0, arg1) {
2018
2008
  const ret = new Error(getStringFromWasm0(arg0, arg1));
2019
2009
  return addHeapObject(ret);
2020
2010
  },
2021
- __wbg_new_bebc3f4757acf305: function() {
2011
+ __wbg_new_617a8cdb8bb1130e: function() {
2022
2012
  const ret = new Object();
2023
2013
  return addHeapObject(ret);
2024
2014
  },
2025
- __wbg_new_ffa92086ea89f79c: function() {
2015
+ __wbg_new_ee2291f50781bf1d: function() {
2026
2016
  const ret = new Array();
2027
2017
  return addHeapObject(ret);
2028
2018
  },
2029
- __wbg_new_from_slice_4ee02165f9de919e: function(arg0, arg1) {
2019
+ __wbg_new_from_slice_9a868026ffa4208a: function(arg0, arg1) {
2030
2020
  const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
2031
2021
  return addHeapObject(ret);
2032
2022
  },
2033
- __wbg_next_95053e306b1c3aed: function(arg0) {
2023
+ __wbg_next_33784799010f1bbe: function(arg0) {
2034
2024
  const ret = getObject(arg0).next;
2035
2025
  return addHeapObject(ret);
2036
2026
  },
2037
- __wbg_next_f31ecb8646d2c605: function() { return handleError(function (arg0) {
2027
+ __wbg_next_f4aac29c42af995c: function() { return handleError(function (arg0) {
2038
2028
  const ret = getObject(arg0).next();
2039
2029
  return addHeapObject(ret);
2040
2030
  }, arguments); },
2041
- __wbg_prototypesetcall_ae9f5e7459250748: function(arg0, arg1, arg2) {
2031
+ __wbg_prototypesetcall_bc27214492979395: function(arg0, arg1, arg2) {
2042
2032
  Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), getObject(arg2));
2043
2033
  },
2044
- __wbg_set_13d25b81ab403f5e: function(arg0, arg1, arg2) {
2045
- getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
2046
- },
2047
- __wbg_set_6be42768c690e380: function(arg0, arg1, arg2) {
2048
- getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
2049
- },
2050
- __wbg_set_a377297433dfea63: function() { return handleError(function (arg0, arg1, arg2) {
2034
+ __wbg_set_145a351398b48c65: function() { return handleError(function (arg0, arg1, arg2) {
2051
2035
  const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
2052
2036
  return ret;
2053
2037
  }, arguments); },
2054
- __wbg_set_bf6dde4923b9b059: function(arg0, arg1, arg2) {
2038
+ __wbg_set_6ae97e73113c4f0b: function(arg0, arg1, arg2) {
2055
2039
  const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
2056
2040
  return addHeapObject(ret);
2057
2041
  },
2042
+ __wbg_set_6be42768c690e380: function(arg0, arg1, arg2) {
2043
+ getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
2044
+ },
2045
+ __wbg_set_bea140a88be9b277: function(arg0, arg1, arg2) {
2046
+ getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
2047
+ },
2058
2048
  __wbg_stack_3b0d974bbf31e44f: function(arg0, arg1) {
2059
2049
  const ret = getObject(arg1).stack;
2060
2050
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
@@ -2062,15 +2052,15 @@ function __wbg_get_imports() {
2062
2052
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
2063
2053
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
2064
2054
  },
2065
- __wbg_value_c227f843d21da141: function(arg0) {
2055
+ __wbg_value_f3c585ee8f5ba40c: function(arg0) {
2066
2056
  const ret = getObject(arg0).value;
2067
2057
  return addHeapObject(ret);
2068
2058
  },
2069
- __wbg_values_220548effc36d1d3: function(arg0) {
2059
+ __wbg_values_0861828bcc747558: function(arg0) {
2070
2060
  const ret = Object.values(getObject(arg0));
2071
2061
  return addHeapObject(ret);
2072
2062
  },
2073
- __wbg_values_85d5bcf6f1ca8248: function(arg0) {
2063
+ __wbg_values_6450e8158115fd4e: function(arg0) {
2074
2064
  const ret = getObject(arg0).values();
2075
2065
  return addHeapObject(ret);
2076
2066
  },
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.120.0",
3
+ "version": "0.122.0",
4
4
  "description": "WebAssembly bindings for Quillmark, a schema-driven document engine",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
package/render/wasm.d.ts CHANGED
@@ -450,9 +450,16 @@ export interface QuillFieldSchema {
450
450
  variants?: Record<string, Record<string, QuillFieldSchema>>;
451
451
  /** The roster of a `type: "matrix"` field, required there and valid
452
452
  * nowhere else: member id to display title, key order the display order.
453
- * Each member is an object of `held` plus the field's `properties`
454
- * (the columns), addressed as `<field>.<member id>.held`. */
453
+ * A member is held by being present in the document, as a mapping of the
454
+ * field's `properties` (the columns) or a bare `true`; unticking removes
455
+ * it. Its own address `<field>.<member id>` is the tick, and each column
456
+ * addresses one step further down. */
455
457
  members?: Record<string, string>;
458
+ /** `true` on a `type: "matrix"` field admitting items a document adds
459
+ * beside the roster: each keyed by a snake_case id and carrying a
460
+ * `title` string beside the columns, held by being present. Valid only
461
+ * on a matrix. */
462
+ open?: boolean;
456
463
  ui?: QuillFieldUi;
457
464
  properties?: Record<string, QuillFieldSchema>;
458
465
  items?: QuillFieldSchema;
@@ -976,7 +983,8 @@ export class LiveSession {
976
983
  * this call.
977
984
  *
978
985
  * Throws if `page` is out of range, `ctx` is the wrong type, or `scale` is
979
- * not finite and positive (`backend::invalid_raster_scale`).
986
+ * not finite and positive or is under `f32::MIN_POSITIVE`
987
+ * (`backend::invalid_raster_scale`).
980
988
  */
981
989
  paint(ctx: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D, page: number, scale: number): void;
982
990
  /**
package/render/wasm.js CHANGED
@@ -1296,7 +1296,8 @@ export class LiveSession {
1296
1296
  * this call.
1297
1297
  *
1298
1298
  * Throws if `page` is out of range, `ctx` is the wrong type, or `scale` is
1299
- * not finite and positive (`backend::invalid_raster_scale`).
1299
+ * not finite and positive or is under `f32::MIN_POSITIVE`
1300
+ * (`backend::invalid_raster_scale`).
1300
1301
  * @param {CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D} ctx
1301
1302
  * @param {number} page
1302
1303
  * @param {number} scale
@@ -2213,11 +2214,11 @@ export function start() {
2213
2214
  function __wbg_get_imports() {
2214
2215
  const import0 = {
2215
2216
  __proto__: null,
2216
- __wbg_Error_67e7344beaa85059: function(arg0, arg1) {
2217
+ __wbg_Error_30c8987f7c2ed4e2: function(arg0, arg1) {
2217
2218
  const ret = Error(getStringFromWasm0(arg0, arg1));
2218
2219
  return addHeapObject(ret);
2219
2220
  },
2220
- __wbg_Number_c54e7112a3fa7e3e: function(arg0) {
2221
+ __wbg_Number_14af1003b8dd5ead: function(arg0) {
2221
2222
  const ret = Number(getObject(arg0));
2222
2223
  return ret;
2223
2224
  },
@@ -2228,68 +2229,68 @@ function __wbg_get_imports() {
2228
2229
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
2229
2230
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
2230
2231
  },
2231
- __wbg___wbindgen_bigint_get_as_i64_b482365c149396c8: function(arg0, arg1) {
2232
+ __wbg___wbindgen_bigint_get_as_i64_a2383202b9353e4c: function(arg0, arg1) {
2232
2233
  const v = getObject(arg1);
2233
2234
  const ret = typeof(v) === 'bigint' ? v : undefined;
2234
2235
  getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
2235
2236
  getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
2236
2237
  },
2237
- __wbg___wbindgen_boolean_get_7a12af2b3f899c5a: function(arg0) {
2238
+ __wbg___wbindgen_boolean_get_5b446f51afd21013: function(arg0) {
2238
2239
  const v = getObject(arg0);
2239
2240
  const ret = typeof(v) === 'boolean' ? v : undefined;
2240
2241
  return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
2241
2242
  },
2242
- __wbg___wbindgen_debug_string_0e68cf47c9cbd9b0: function(arg0, arg1) {
2243
+ __wbg___wbindgen_debug_string_4687d8d8c2017d52: function(arg0, arg1) {
2243
2244
  const ret = debugString(getObject(arg1));
2244
2245
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
2245
2246
  const len1 = WASM_VECTOR_LEN;
2246
2247
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
2247
2248
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
2248
2249
  },
2249
- __wbg___wbindgen_in_50072d4d6e45c193: function(arg0, arg1) {
2250
+ __wbg___wbindgen_in_92f62ee1427d9e49: function(arg0, arg1) {
2250
2251
  const ret = getObject(arg0) in getObject(arg1);
2251
2252
  return ret;
2252
2253
  },
2253
- __wbg___wbindgen_is_bigint_60fc0336cb14f5d7: function(arg0) {
2254
+ __wbg___wbindgen_is_bigint_b123553bed3bb382: function(arg0) {
2254
2255
  const ret = typeof(getObject(arg0)) === 'bigint';
2255
2256
  return ret;
2256
2257
  },
2257
- __wbg___wbindgen_is_function_fcda5e3902d732fe: function(arg0) {
2258
+ __wbg___wbindgen_is_function_1f9d30630b8b1d3d: function(arg0) {
2258
2259
  const ret = typeof(getObject(arg0)) === 'function';
2259
2260
  return ret;
2260
2261
  },
2261
- __wbg___wbindgen_is_null_5160b3e381865372: function(arg0) {
2262
+ __wbg___wbindgen_is_null_e343b7d08827ba72: function(arg0) {
2262
2263
  const ret = getObject(arg0) === null;
2263
2264
  return ret;
2264
2265
  },
2265
- __wbg___wbindgen_is_object_edb6b15aa3afe12e: function(arg0) {
2266
+ __wbg___wbindgen_is_object_3c45d4f2dde4e749: function(arg0) {
2266
2267
  const val = getObject(arg0);
2267
2268
  const ret = typeof(val) === 'object' && val !== null;
2268
2269
  return ret;
2269
2270
  },
2270
- __wbg___wbindgen_is_string_c4f7cb494a2a21f1: function(arg0) {
2271
+ __wbg___wbindgen_is_string_90b56bc79aad6f6c: function(arg0) {
2271
2272
  const ret = typeof(getObject(arg0)) === 'string';
2272
2273
  return ret;
2273
2274
  },
2274
- __wbg___wbindgen_is_undefined_8c687d0b90d5b524: function(arg0) {
2275
+ __wbg___wbindgen_is_undefined_8865fb403f8fe9d8: function(arg0) {
2275
2276
  const ret = getObject(arg0) === undefined;
2276
2277
  return ret;
2277
2278
  },
2278
- __wbg___wbindgen_jsval_eq_9fdcd3c0a860dd3b: function(arg0, arg1) {
2279
+ __wbg___wbindgen_jsval_eq_02babf21faa37971: function(arg0, arg1) {
2279
2280
  const ret = getObject(arg0) === getObject(arg1);
2280
2281
  return ret;
2281
2282
  },
2282
- __wbg___wbindgen_jsval_loose_eq_3c30021c243b64cd: function(arg0, arg1) {
2283
+ __wbg___wbindgen_jsval_loose_eq_677f21e468d6b461: function(arg0, arg1) {
2283
2284
  const ret = getObject(arg0) == getObject(arg1);
2284
2285
  return ret;
2285
2286
  },
2286
- __wbg___wbindgen_number_get_1dc732b810cb937c: function(arg0, arg1) {
2287
+ __wbg___wbindgen_number_get_2e0e7dee9f701a71: function(arg0, arg1) {
2287
2288
  const obj = getObject(arg1);
2288
2289
  const ret = typeof(obj) === 'number' ? obj : undefined;
2289
2290
  getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
2290
2291
  getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
2291
2292
  },
2292
- __wbg___wbindgen_string_get_92ab86bb19cbc12f: function(arg0, arg1) {
2293
+ __wbg___wbindgen_string_get_0380ccaa2f57f0d9: function(arg0, arg1) {
2293
2294
  const obj = getObject(arg1);
2294
2295
  const ret = typeof(obj) === 'string' ? obj : undefined;
2295
2296
  var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
@@ -2297,30 +2298,30 @@ function __wbg_get_imports() {
2297
2298
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
2298
2299
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
2299
2300
  },
2300
- __wbg___wbindgen_throw_5d9e815e6fdf150f: function(arg0, arg1) {
2301
+ __wbg___wbindgen_throw_41e9ee4f547fc59a: function(arg0, arg1) {
2301
2302
  throw new Error(getStringFromWasm0(arg0, arg1));
2302
2303
  },
2303
- __wbg_call_269c5566fbede3eb: function() { return handleError(function (arg0, arg1) {
2304
+ __wbg_call_6137034ef55c9d0f: function() { return handleError(function (arg0, arg1) {
2304
2305
  const ret = getObject(arg0).call(getObject(arg1));
2305
2306
  return addHeapObject(ret);
2306
2307
  }, arguments); },
2307
- __wbg_canvas_128715f4edb228ef: function(arg0) {
2308
+ __wbg_canvas_2b619d4767b78c03: function(arg0) {
2308
2309
  const ret = getObject(arg0).canvas;
2309
- return addHeapObject(ret);
2310
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
2310
2311
  },
2311
- __wbg_canvas_9c3188d85ded70f9: function(arg0) {
2312
+ __wbg_canvas_e7d1eef7cc8eee84: function(arg0) {
2312
2313
  const ret = getObject(arg0).canvas;
2313
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
2314
+ return addHeapObject(ret);
2314
2315
  },
2315
- __wbg_done_cffed884d87aa22e: function(arg0) {
2316
+ __wbg_done_b41a1d26cdb37fb6: function(arg0) {
2316
2317
  const ret = getObject(arg0).done;
2317
2318
  return ret;
2318
2319
  },
2319
- __wbg_entries_20b9608d57d8ddd6: function(arg0) {
2320
+ __wbg_entries_3602f27ad32994b8: function(arg0) {
2320
2321
  const ret = getObject(arg0).entries();
2321
2322
  return addHeapObject(ret);
2322
2323
  },
2323
- __wbg_entries_972a87586902cf87: function(arg0) {
2324
+ __wbg_entries_fb6397112b1de25f: function(arg0) {
2324
2325
  const ret = Object.entries(getObject(arg0));
2325
2326
  return addHeapObject(ret);
2326
2327
  },
@@ -2335,31 +2336,31 @@ function __wbg_get_imports() {
2335
2336
  wasm.__wbindgen_export4(deferred0_0, deferred0_1, 1);
2336
2337
  }
2337
2338
  },
2338
- __wbg_from_a39669ce566077da: function(arg0) {
2339
+ __wbg_from_296ca31f8d0f1c52: function(arg0) {
2339
2340
  const ret = Array.from(getObject(arg0));
2340
2341
  return addHeapObject(ret);
2341
2342
  },
2342
- __wbg_getDate_8e7807f062ade36a: function(arg0) {
2343
+ __wbg_getDate_1181c785ea4fdd21: function(arg0) {
2343
2344
  const ret = getObject(arg0).getDate();
2344
2345
  return ret;
2345
2346
  },
2346
- __wbg_getFullYear_0cfd5a75cf3d5856: function(arg0) {
2347
+ __wbg_getFullYear_32050b2c56c56cd8: function(arg0) {
2347
2348
  const ret = getObject(arg0).getFullYear();
2348
2349
  return ret;
2349
2350
  },
2350
- __wbg_getMonth_01ce17d889ed7e5e: function(arg0) {
2351
+ __wbg_getMonth_aae5f530fd173536: function(arg0) {
2351
2352
  const ret = getObject(arg0).getMonth();
2352
2353
  return ret;
2353
2354
  },
2354
- __wbg_get_6cf5a4d4d8ad3c5a: function() { return handleError(function (arg0, arg1) {
2355
+ __wbg_get_658f6698067d9515: function() { return handleError(function (arg0, arg1) {
2355
2356
  const ret = Reflect.get(getObject(arg0), getObject(arg1));
2356
2357
  return addHeapObject(ret);
2357
2358
  }, arguments); },
2358
- __wbg_get_b1f0ab13c737f856: function(arg0, arg1) {
2359
+ __wbg_get_6c896e0571ddae51: function(arg0, arg1) {
2359
2360
  const ret = getObject(arg0)[arg1 >>> 0];
2360
2361
  return addHeapObject(ret);
2361
2362
  },
2362
- __wbg_get_unchecked_363572bdd397d473: function(arg0, arg1) {
2363
+ __wbg_get_unchecked_288889d017702237: function(arg0, arg1) {
2363
2364
  const ret = getObject(arg0)[arg1 >>> 0];
2364
2365
  return addHeapObject(ret);
2365
2366
  },
@@ -2367,7 +2368,7 @@ function __wbg_get_imports() {
2367
2368
  const ret = getObject(arg0)[getObject(arg1)];
2368
2369
  return addHeapObject(ret);
2369
2370
  },
2370
- __wbg_instanceof_ArrayBuffer_d4ff01f8247925ae: function(arg0) {
2371
+ __wbg_instanceof_ArrayBuffer_a99f175873e5d9b8: function(arg0) {
2371
2372
  let result;
2372
2373
  try {
2373
2374
  result = getObject(arg0) instanceof ArrayBuffer;
@@ -2377,7 +2378,7 @@ function __wbg_get_imports() {
2377
2378
  const ret = result;
2378
2379
  return ret;
2379
2380
  },
2380
- __wbg_instanceof_CanvasRenderingContext2d_bde5245b14027f3f: function(arg0) {
2381
+ __wbg_instanceof_CanvasRenderingContext2d_769208c72dcbf5e6: function(arg0) {
2381
2382
  let result;
2382
2383
  try {
2383
2384
  result = getObject(arg0) instanceof CanvasRenderingContext2D;
@@ -2387,7 +2388,7 @@ function __wbg_get_imports() {
2387
2388
  const ret = result;
2388
2389
  return ret;
2389
2390
  },
2390
- __wbg_instanceof_Map_1ff6a2b54c899f0d: function(arg0) {
2391
+ __wbg_instanceof_Map_b2611749102d7ba3: function(arg0) {
2391
2392
  let result;
2392
2393
  try {
2393
2394
  result = getObject(arg0) instanceof Map;
@@ -2397,17 +2398,7 @@ function __wbg_get_imports() {
2397
2398
  const ret = result;
2398
2399
  return ret;
2399
2400
  },
2400
- __wbg_instanceof_Object_87732cb922ac2e2c: function(arg0) {
2401
- let result;
2402
- try {
2403
- result = getObject(arg0) instanceof Object;
2404
- } catch (_) {
2405
- result = false;
2406
- }
2407
- const ret = result;
2408
- return ret;
2409
- },
2410
- __wbg_instanceof_OffscreenCanvasRenderingContext2d_4b64493c5055d621: function(arg0) {
2401
+ __wbg_instanceof_OffscreenCanvasRenderingContext2d_957f1a991324c9dc: function(arg0) {
2411
2402
  let result;
2412
2403
  try {
2413
2404
  result = getObject(arg0) instanceof OffscreenCanvasRenderingContext2D;
@@ -2417,7 +2408,7 @@ function __wbg_get_imports() {
2417
2408
  const ret = result;
2418
2409
  return ret;
2419
2410
  },
2420
- __wbg_instanceof_Uint8Array_598adc0fef426aa8: function(arg0) {
2411
+ __wbg_instanceof_Uint8Array_828cef2aaacafc31: function(arg0) {
2421
2412
  let result;
2422
2413
  try {
2423
2414
  result = getObject(arg0) instanceof Uint8Array;
@@ -2427,35 +2418,35 @@ function __wbg_get_imports() {
2427
2418
  const ret = result;
2428
2419
  return ret;
2429
2420
  },
2430
- __wbg_isArray_5674713bb7b79043: function(arg0) {
2421
+ __wbg_isArray_e15a2ff68ffdbef2: function(arg0) {
2431
2422
  const ret = Array.isArray(getObject(arg0));
2432
2423
  return ret;
2433
2424
  },
2434
- __wbg_isSafeInteger_8f51c743827d1ec5: function(arg0) {
2425
+ __wbg_isSafeInteger_717808ad6a54bd9e: function(arg0) {
2435
2426
  const ret = Number.isSafeInteger(getObject(arg0));
2436
2427
  return ret;
2437
2428
  },
2438
- __wbg_iterator_22ddeb808cf55a6f: function() {
2429
+ __wbg_iterator_e3c31c892080e444: function() {
2439
2430
  const ret = Symbol.iterator;
2440
2431
  return addHeapObject(ret);
2441
2432
  },
2442
- __wbg_keys_6efc298980178da1: function(arg0) {
2433
+ __wbg_keys_440be172f17c0265: function(arg0) {
2443
2434
  const ret = Object.keys(getObject(arg0));
2444
2435
  return addHeapObject(ret);
2445
2436
  },
2446
- __wbg_length_31bdaf014f5fbde2: function(arg0) {
2437
+ __wbg_length_7f3c00c40364105e: function(arg0) {
2447
2438
  const ret = getObject(arg0).length;
2448
2439
  return ret;
2449
2440
  },
2450
- __wbg_length_4e1adc0d42e23620: function(arg0) {
2441
+ __wbg_length_d4bdea10311bd9cf: function(arg0) {
2451
2442
  const ret = getObject(arg0).length;
2452
2443
  return ret;
2453
2444
  },
2454
- __wbg_new_0_35540e542ba689d2: function() {
2445
+ __wbg_new_0_72d020f0c63443d4: function() {
2455
2446
  const ret = new Date();
2456
2447
  return addHeapObject(ret);
2457
2448
  },
2458
- __wbg_new_1da3429bc3c4541c: function(arg0) {
2449
+ __wbg_new_1dbf7428bba60a42: function(arg0) {
2459
2450
  const ret = new Uint8Array(getObject(arg0));
2460
2451
  return addHeapObject(ret);
2461
2452
  },
@@ -2463,71 +2454,71 @@ function __wbg_get_imports() {
2463
2454
  const ret = new Error();
2464
2455
  return addHeapObject(ret);
2465
2456
  },
2466
- __wbg_new_8d36e20aa758e411: function() {
2457
+ __wbg_new_28744009d011f847: function() {
2467
2458
  const ret = new Map();
2468
2459
  return addHeapObject(ret);
2469
2460
  },
2470
- __wbg_new_a32a1ab6c6655abe: function(arg0, arg1) {
2461
+ __wbg_new_343a093a3c2ffb4e: function(arg0, arg1) {
2471
2462
  const ret = new Error(getStringFromWasm0(arg0, arg1));
2472
2463
  return addHeapObject(ret);
2473
2464
  },
2474
- __wbg_new_bebc3f4757acf305: function() {
2465
+ __wbg_new_617a8cdb8bb1130e: function() {
2475
2466
  const ret = new Object();
2476
2467
  return addHeapObject(ret);
2477
2468
  },
2478
- __wbg_new_ffa92086ea89f79c: function() {
2469
+ __wbg_new_ee2291f50781bf1d: function() {
2479
2470
  const ret = new Array();
2480
2471
  return addHeapObject(ret);
2481
2472
  },
2482
- __wbg_new_from_slice_4ee02165f9de919e: function(arg0, arg1) {
2473
+ __wbg_new_from_slice_9a868026ffa4208a: function(arg0, arg1) {
2483
2474
  const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
2484
2475
  return addHeapObject(ret);
2485
2476
  },
2486
- __wbg_new_with_u8_clamped_array_and_sh_15a008af56aca047: function() { return handleError(function (arg0, arg1, arg2, arg3) {
2477
+ __wbg_new_with_u8_clamped_array_and_sh_af3f0dee40638e18: function() { return handleError(function (arg0, arg1, arg2, arg3) {
2487
2478
  const ret = new ImageData(getClampedArrayU8FromWasm0(arg0, arg1), arg2 >>> 0, arg3 >>> 0);
2488
2479
  return addHeapObject(ret);
2489
2480
  }, arguments); },
2490
- __wbg_next_95053e306b1c3aed: function(arg0) {
2481
+ __wbg_next_33784799010f1bbe: function(arg0) {
2491
2482
  const ret = getObject(arg0).next;
2492
2483
  return addHeapObject(ret);
2493
2484
  },
2494
- __wbg_next_f31ecb8646d2c605: function() { return handleError(function (arg0) {
2485
+ __wbg_next_f4aac29c42af995c: function() { return handleError(function (arg0) {
2495
2486
  const ret = getObject(arg0).next();
2496
2487
  return addHeapObject(ret);
2497
2488
  }, arguments); },
2498
- __wbg_prototypesetcall_ae9f5e7459250748: function(arg0, arg1, arg2) {
2489
+ __wbg_prototypesetcall_bc27214492979395: function(arg0, arg1, arg2) {
2499
2490
  Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), getObject(arg2));
2500
2491
  },
2501
- __wbg_putImageData_080efc8615f29b4e: function() { return handleError(function (arg0, arg1, arg2, arg3) {
2492
+ __wbg_putImageData_11570c06086c9e05: function() { return handleError(function (arg0, arg1, arg2, arg3) {
2502
2493
  getObject(arg0).putImageData(getObject(arg1), arg2, arg3);
2503
2494
  }, arguments); },
2504
- __wbg_putImageData_581de52c9f40fc59: function() { return handleError(function (arg0, arg1, arg2, arg3) {
2495
+ __wbg_putImageData_7bf1e9dea494ea50: function() { return handleError(function (arg0, arg1, arg2, arg3) {
2505
2496
  getObject(arg0).putImageData(getObject(arg1), arg2, arg3);
2506
2497
  }, arguments); },
2507
- __wbg_set_13d25b81ab403f5e: function(arg0, arg1, arg2) {
2508
- getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
2509
- },
2510
- __wbg_set_6be42768c690e380: function(arg0, arg1, arg2) {
2511
- getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
2512
- },
2513
- __wbg_set_a377297433dfea63: function() { return handleError(function (arg0, arg1, arg2) {
2498
+ __wbg_set_145a351398b48c65: function() { return handleError(function (arg0, arg1, arg2) {
2514
2499
  const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
2515
2500
  return ret;
2516
2501
  }, arguments); },
2517
- __wbg_set_bf6dde4923b9b059: function(arg0, arg1, arg2) {
2502
+ __wbg_set_6ae97e73113c4f0b: function(arg0, arg1, arg2) {
2518
2503
  const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
2519
2504
  return addHeapObject(ret);
2520
2505
  },
2521
- __wbg_set_height_1202ad0eab43cbe0: function(arg0, arg1) {
2506
+ __wbg_set_6be42768c690e380: function(arg0, arg1, arg2) {
2507
+ getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
2508
+ },
2509
+ __wbg_set_bea140a88be9b277: function(arg0, arg1, arg2) {
2510
+ getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
2511
+ },
2512
+ __wbg_set_height_c9789c1c77eaedff: function(arg0, arg1) {
2522
2513
  getObject(arg0).height = arg1 >>> 0;
2523
2514
  },
2524
- __wbg_set_height_698fb3b255bc1348: function(arg0, arg1) {
2515
+ __wbg_set_height_fde391767df1ce27: function(arg0, arg1) {
2525
2516
  getObject(arg0).height = arg1 >>> 0;
2526
2517
  },
2527
- __wbg_set_width_4c3a2252e0dea033: function(arg0, arg1) {
2518
+ __wbg_set_width_0ca908d167690992: function(arg0, arg1) {
2528
2519
  getObject(arg0).width = arg1 >>> 0;
2529
2520
  },
2530
- __wbg_set_width_f52a20e39808b138: function(arg0, arg1) {
2521
+ __wbg_set_width_b0e1267db4b196b5: function(arg0, arg1) {
2531
2522
  getObject(arg0).width = arg1 >>> 0;
2532
2523
  },
2533
2524
  __wbg_stack_3b0d974bbf31e44f: function(arg0, arg1) {
@@ -2537,15 +2528,15 @@ function __wbg_get_imports() {
2537
2528
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
2538
2529
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
2539
2530
  },
2540
- __wbg_value_c227f843d21da141: function(arg0) {
2531
+ __wbg_value_f3c585ee8f5ba40c: function(arg0) {
2541
2532
  const ret = getObject(arg0).value;
2542
2533
  return addHeapObject(ret);
2543
2534
  },
2544
- __wbg_values_220548effc36d1d3: function(arg0) {
2535
+ __wbg_values_0861828bcc747558: function(arg0) {
2545
2536
  const ret = Object.values(getObject(arg0));
2546
2537
  return addHeapObject(ret);
2547
2538
  },
2548
- __wbg_values_85d5bcf6f1ca8248: function(arg0) {
2539
+ __wbg_values_6450e8158115fd4e: function(arg0) {
2549
2540
  const ret = getObject(arg0).values();
2550
2541
  return addHeapObject(ret);
2551
2542
  },
Binary file
@@ -167,9 +167,11 @@ export type {
167
167
  * This is a STRUCTURAL interface, not a class: the WASM layer throws a real
168
168
  * `Error` and attaches `diagnostics` to it, so there is no constructor to
169
169
  * `instanceof` against, narrow with {@link isQuillmarkError}. `diagnostics`
170
- * is always non-empty; `message` is the first diagnostic's message (or an
171
- * `"N error(s): …"` aggregate for multi-diagnostic failures), so iterate
172
- * `diagnostics` for per-error detail. The shape is identical to
170
+ * is always non-empty and opens with an error. A `severity: 'warning'` entry
171
+ * after the errors is one raised before the failure that can explain it, such
172
+ * as a package the quill's load skipped. `message` is the first diagnostic's
173
+ * message (or an `"N error(s): …"` aggregate for multi-error failures), so
174
+ * iterate `diagnostics` for per-error detail. The shape is identical to
173
175
  * `RenderResult.warnings` entries.
174
176
  */
175
177
  export interface QuillmarkError extends Error {
@@ -236,14 +238,19 @@ export interface Artifact {
236
238
  mimeType: string;
237
239
  }
238
240
 
239
- /** Options for one render. */
241
+ /**
242
+ * Options for one render. Any other key throws, `today` included: the render
243
+ * date is an argument of {@link Engine.render} and {@link Engine.open}, not an
244
+ * option.
245
+ */
240
246
  export interface RenderOptions {
241
247
  format?: OutputFormat;
242
248
  /**
243
249
  * Pixels per inch for raster formats (PNG); ignored by PDF and SVG.
244
- * Defaults to 144. Must be finite, above 0, and small enough to keep every
245
- * rendered page under 268435456 pixels — anything else throws
246
- * `backend::invalid_raster_scale`.
250
+ * Defaults to 144. Must be finite, above 0, and small enough to keep both
251
+ * sides of every rendered page within 16384 px — anything else throws
252
+ * `backend::invalid_raster_scale`, whose hint past the ceiling names a ppi
253
+ * that fits.
247
254
  */
248
255
  ppi?: number;
249
256
  pages?: number[];
@@ -371,6 +378,7 @@ export interface BackendDescriptor {
371
378
  formats: OutputFormat[];
372
379
  }
373
380
 
381
+ /** Options for `new Engine(...)`. A key other than `backends` throws. */
374
382
  export interface EngineOptions {
375
383
  /**
376
384
  * Extra or overriding backend descriptors, merged over the built-ins. Keys are
@@ -407,7 +415,8 @@ export declare class Engine {
407
415
  * document it opened from, so {@link LiveSession.render} carries the
408
416
  * compile's alone: read `doc.warnings` and `quill.validate(doc)` beside it.
409
417
  *
410
- * `today` reads as on {@link open}.
418
+ * `today` reads as on {@link open}. An `options` key outside
419
+ * {@link RenderOptions} rejects, `today` among them.
411
420
  */
412
421
  render(quill: Quill, doc: Document, options?: RenderOptions, today?: string): Promise<RenderResult>;
413
422
 
@@ -537,7 +546,8 @@ export declare class LiveSession {
537
546
  * neither exceeds 16384 px, so `canvas.width / widthPt` is the scale painted
538
547
  * at; the caller owns `canvas.style.*`, and a canvas styled `width: 100%`
539
548
  * needs nothing back from the paint. Throws `backend::invalid_raster_scale`
540
- * on a `scale` that is not finite and positive.
549
+ * on a `scale` that is not finite and positive, or is under the least a
550
+ * 32-bit float holds at full precision (2⁻¹²⁶, about 1.2e-38).
541
551
  *
542
552
  * The write is a whole-backing-store `putImageData`, which bypasses the 2D
543
553
  * context transform, `globalAlpha`, and clip, so give each visible page its
@@ -580,6 +590,8 @@ declare module '../core/wasm.js' {
580
590
  }
581
591
  }
582
592
 
593
+ import type { Addr, Content, Delta, PathStep, Resolved } from '../core/wasm.js';
594
+
583
595
  /**
584
596
  * A `Document` bound to its `Quill` for typed writes, from {@link Quill.writer}.
585
597
  * Speaks names, values, and markdown, so bare `set` / `setAll` / `reviseBody` /
@@ -161,6 +161,25 @@ function quillmarkError(code, message, hint) {
161
161
  return err;
162
162
  }
163
163
 
164
+ /**
165
+ * Throw on an own key of an options object outside `known`. The JS twin of the
166
+ * binding's `reject_unknown_keys`, in the uncoded shape it throws: a misspelled
167
+ * optional key would otherwise read as absent.
168
+ * @param {unknown} options
169
+ * @param {string[]} known
170
+ * @param {string} what the options' name, for the message
171
+ * @returns {void}
172
+ */
173
+ function rejectUnknownKeys(options, known, what) {
174
+ for (const key of Object.keys(options ?? {})) {
175
+ if (known.includes(key)) continue;
176
+ const message = `${what} have unknown key \`${key}\`; ${what} take only \`${known.join('`, `')}\``;
177
+ const err = /** @type {any} */ (new Error(message));
178
+ err.diagnostics = [{ severity: 'error', message }];
179
+ throw err;
180
+ }
181
+ }
182
+
164
183
  // These checks deliver the ERROR, not the rejection, at the seams that cross
165
184
  // into backend memory as DATA — `Engine` and `LiveSession.update` — where a
166
185
  // foreign handle would otherwise work silently at the price of a whole-document
@@ -374,6 +393,7 @@ export class Engine {
374
393
  * @param {{ backends?: Record<string, { load: () => Promise<unknown>, formats: string[] }> }} [options]
375
394
  */
376
395
  constructor(options) {
396
+ rejectUnknownKeys(options, ['backends'], 'Engine options');
377
397
  const merged = { ...DEFAULT_BACKENDS, ...(options?.backends ?? {}) };
378
398
  /** @type {Record<string, { load: () => Promise<unknown>, formats: string[] }>} */
379
399
  const loaders = {};