@quillmark/wasm 0.121.0 → 0.123.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,212 @@
1
1
  # Changelog
2
2
 
3
+ ## v0.123.0 - 2026-10-06
4
+
5
+ Upgrade path: [0.122 → 0.123](docs/migrations/0.122-to-0.123.md).
6
+
7
+ ### Boolean coercion
8
+
9
+ - fix(core)!: **a number under a `boolean` field renders by whether it is
10
+ non-zero**, a matrix member's bare tick included, so a float of magnitude at
11
+ most `2.220446049250313e-16`, such as `1e-17`, renders `true` where it
12
+ rendered `false`, and nothing reports the change. `0` and `-0.0` render
13
+ `false`, and every integer reads as before. (#2053)
14
+
15
+ ### Open matrix
16
+
17
+ - fix(core)!: **an open matrix's added item whose `title` is `""` or
18
+ whitespace alone fails as `validation::enum_violation`** at its key, carrying
19
+ the `open` hint, and the render with it, where it printed a held row with
20
+ nothing beside the tick. Such an item in a `default:` fails to load as
21
+ `quill::default_not_in_enum`, and in a card kind's `seed:` as
22
+ `quill::seed_enum_violation`. (#2068)
23
+
24
+ ### Comment placement
25
+
26
+ - fix(core)!: **a comment's text drops the whitespace ending its line**, read
27
+ from markdown, a stored row or a `CardWire` alike, so `to_markdown` writes
28
+ `# note` for `# note ` and its emission reads back to the same document. A
29
+ stored row holding such a comment rewrites once when saved again, and
30
+ nothing reports the change. (#2064)
31
+ - fix(core)!: **a comment keeps the slot the YAML gives it** under a tagged
32
+ empty value (`k: !!str`, `k: !`), inside an alias key's value, and around or
33
+ inside a merge (`<<`), where `to_markdown` dropped or moved it, and nothing
34
+ reports the change. A comment at a lesser column below a tagged or anchored
35
+ empty value belongs to the collection around it. A top-level alias key keeps
36
+ its place in the field order, where its field moved to the block's end, and
37
+ a `parse::unsupported_yaml_tag` inside its value names the key's text. A
38
+ sequence item emptied by its merges emits as `- {}` with its comment after
39
+ it. (#2064)
40
+ - fix(core): **`to_markdown` indexes a field's comments once**, so emitting a
41
+ commented container costs its entries plus its comments, not their product;
42
+ the emitted markdown is byte-for-byte the same. (#2064)
43
+
44
+ ### Base PDF reading
45
+
46
+ - fix(pdf,acroform)!: **a `form.pdf` whose page `/Annots` hold a widget
47
+ annotation fails to open as `pdf::existing_acroform`**, naming the first
48
+ page holding one, whatever its catalog `/AcroForm` holds, where a base whose
49
+ `/AcroForm` was deleted or nulled stamped the fresh widgets beside its own.
50
+ An annotation whose `/Subtype` references `/Widget` is a widget. (#2064)
51
+ - fix(pdf)!: **a trailer, catalog or page-tree node naming a key twice or
52
+ with no value, or holding a token where a key belongs, fails as
53
+ `pdf::parse`** (`pdf::stamp_parse` for the catalog under `stamp`), and an
54
+ `/Info` object as `pdf::write`, where the stamp rewrote one entry of two or
55
+ appended a key that took the next token as its value. A trailer's direct
56
+ `/Info` dictionary of such a shape stamps a fresh `/Info` without its
57
+ entries. (#2064)
58
+ - fix(pdf): **`%`, `{` and `}` end a token and NUL is white-space**, so
59
+ `/AcroForm null%stripped` reads as `null` and stamps. A reference to a
60
+ `null` object or to no object reads as absent, so `/AcroForm 7 0 R` over
61
+ `7 0 obj null endobj` stamps where it failed as `pdf::existing_acroform`.
62
+ (#2064)
63
+
64
+ ### WASM options
65
+
66
+ - fix(wasm)!: **an options object, `Addr` or `CardInput` must be a plain
67
+ object**, one whose prototype is `null` or `Object.prototype` of any realm:
68
+ a class instance, `Object.create(defaults)` and a `Map` throw, where 0.122
69
+ read a class instance's and an inherited key and none of a `Map`'s entries.
70
+ A key the verb does not read throws when it is non-enumerable, such as the
71
+ `__ob__` Vue 2 defines, or holds `undefined`, and so does a `new Engine`
72
+ argument other than an object, `null` or `undefined`. Spread into a literal:
73
+ `{ ...defaults, ...options }`. (#2064)
74
+
75
+ ### Typst plate path
76
+
77
+ - fix(typst,cli): **a `plate_file` led by `./` names the file at the quill
78
+ root**, so `plate_file: ./plate.typ` loads where it failed as
79
+ `typst::plate_missing`, and `quillmark validate` accepts it where it refused
80
+ it as `cli::plate_file_escapes_quill`. A leading `/` or a `..` step still
81
+ misses, with a hint naming the spelling from the quill root. (#2064)
82
+ - fix(typst): the rooted-path hint on a `typst::file_not_found` states what the
83
+ quill root holds, true of a bare path and a rooted one alike. (#2064)
84
+
85
+ ### Parse hints
86
+
87
+ - fix(core): **an unquoted `.inf`, `.nan` or `1e999` hints its quoted
88
+ spelling**, `s: ".inf"`, and the message drops serde-saphyr's option name;
89
+ the parse still fails as `parse::yaml_error_with_location`. (#2064)
90
+ - fix(docs): card-yaml's "Quote these" table lists the number spellings a
91
+ `string` field takes as a number: an `_` between digits, a `0x`, `0o` or
92
+ `0b` prefix, an exponent, and the non-finite spellings that fail the parse.
93
+ (#2064)
94
+
95
+
96
+ ## v0.122.0 - 2026-10-05
97
+
98
+ Upgrade path: [0.121 → 0.122](docs/migrations/0.121-to-0.122.md).
99
+
100
+ ### YAML booleans
101
+
102
+ - fix(core)!: **only `true` and `false`, in any letter case, are YAML
103
+ booleans**, so an unquoted `y`, `n`, `yes`, `no`, `on` or `off` is the text
104
+ written: `middle_initial: N` reaches the plate as `N` where it printed
105
+ `false`, and nothing reports the change. A card-yaml payload, `Quill.yaml` and
106
+ `QuillValue::from_yaml_str` share the reading. A word under a `boolean`,
107
+ `number` or `integer` field, a matrix member's tick included, fails
108
+ validation as `validation::type_mismatch` and the render as
109
+ `validation::coercion_failed`; in `Quill.yaml` a word where a boolean belongs
110
+ fails to load, and `values: [US, NO, DE]` loads. `!!bool` on a word fails the
111
+ parse, its hint naming the two booleans. (#2034, #2044)
112
+
113
+ ### Comment placement
114
+
115
+ - fix(core)!: **a comment keeps the slot the YAML gives it**: the prescan reads
116
+ each comment's container and slot from the parser's event stream, so one in a
117
+ sequence at its key's column, indented less than its block, in a compact
118
+ nested sequence or trailing a plain scalar's continuation line re-emits
119
+ there, where it moved or dropped. A sequence item carrying a trailer beside
120
+ its first key's emits in the bare-dash form. `parse::unsupported_yaml_tag`
121
+ warns on every tagged node at its own path. A column-zero key outside the
122
+ field grammar fails as `parse::invalid_structure` naming the field, and so
123
+ does a block whose comments and tags record more than 64 bytes of path per
124
+ byte of the block, plus 64 KiB. (#2041)
125
+ - fix(core)!: **a legacy `quillmark/document@0.82.0` row's `$id` drops with its
126
+ inline trailer**, which re-emitted on the item above. (#2041)
127
+ - fix(core): **a run of comments meets no count limit**, so a key's trailer
128
+ ahead of 32 own-line comments parses, as does any longer run 0.121 refused.
129
+ (#2044)
130
+ - fix(core): removing a `$seed` overlay keeps its siblings' order (#2041); a
131
+ comment under an empty `$ext` or `$seed` survives `to_markdown`; and a
132
+ top-level field named `null`, in any letter case, emits quoted, so the
133
+ markdown reads back. (#2044)
134
+
135
+ ### Checkbox appearance states
136
+
137
+ - fix(pdf,acroform)!: **every stamped checkbox carries both its appearance
138
+ states**, `/AP << /N << /Yes … /Off … >> >>` with `/AS` and `/V` naming the
139
+ current one, so a filler toggles it by renaming `/AS` and `/V`. A reader
140
+ taking `/N` only as a stream draws an empty box, and rendered PDF bytes move
141
+ wherever a checkbox is stamped. `StampOptions` gains `states:
142
+ AppearanceStates`: `All`, the default, is the deliverable, and `Selected`
143
+ writes each box's `/N` as the one stream `/AS` names, for a rasterizer that
144
+ cannot resolve it, as the acroform canvas does. (#2038)
145
+ - fix(pdf): **a direct `null` dictionary entry reads as absent**, so a base
146
+ PDF's `/AcroForm null` stamps where it failed as `pdf::existing_acroform`.
147
+ Nulling the key strips no widgets. (#2038)
148
+ - fix(pdf): **a stamp appends to a page's `/Annots` without rewriting the
149
+ array's bytes**, where it decoded them as lossy UTF-8, turning an inline
150
+ annotation's Latin-1 byte into U+FFFD, and could land the new refs inside a
151
+ closing `%` comment. (#2044)
152
+
153
+ ### Typst plate path
154
+
155
+ - fix(typst)!: **a `plate_file` at a path Typst's path grammar refuses fails to
156
+ open as `typst::plate_path_invalid`**, where the plate loaded as `main.typ`
157
+ and shadowed the quill's own `main.typ`. Such a path holds a `\`: separate
158
+ the path with `/`. (#2037)
159
+ - feat(typst): **a `typst::file_not_found` for a bare path in a module below the
160
+ quill root hints the rooted spelling** when the quill root holds that file.
161
+ (#2037)
162
+
163
+ ### WASM options and types
164
+
165
+ - fix(wasm)!: **an options object refuses a key the verb does not read**:
166
+ `engine.render` and `session.render` throw on a render option outside
167
+ `format`, `ppi`, `pages` and `regions`, and `new Engine` on a key other than
168
+ `backends`, so `engine.render(quill, doc, { today })` rejects, naming the
169
+ trailing argument the date belongs in, where it rendered the local date. A
170
+ null-prototype or cross-realm options object, `Addr` or `CardInput` is
171
+ checked too. (#2036)
172
+ - fix(wasm)!: **`runtime.d.ts`'s writer and reader verbs type as declared**:
173
+ `Addr`, `Content`, `Delta`, `PathStep` and `Resolved` read as `any`, so code
174
+ leaning on the `any` stops compiling. (#2043)
175
+
176
+ ### Load warnings
177
+
178
+ - fix(core,typst,cli)!: **a failed Typst compile carries the quill's load
179
+ warnings after its errors**, so a thrown error's `diagnostics` may hold
180
+ warnings; `diagnostics[0]` and the message are unchanged. `quillmark render`
181
+ prints the carried warnings ahead of the error, and `quillmark validate`
182
+ reports each once. (#2039)
183
+ - fix(typst,cli): **`quillmark workspace` prints the quill's load warnings**,
184
+ which `Workspace.warnings` carries, and its `typst watch` command passes
185
+ `--creation-timestamp=` at noon UTC of the render date, so the plate's
186
+ `datetime.today()` agrees with the render's, before 1970 too. (#2039,
187
+ #2044)
188
+
189
+ ### Raster refusals
190
+
191
+ - fix(core,typst,acroform,wasm): **a raster refusal names a ppi or scale that
192
+ fits**: a PNG export one that fits every selected page, pointing a page too
193
+ long for PNG at PDF or SVG, and a canvas a scale. Both backends size a raster
194
+ by `raster_size`, each side rounded and at least one pixel, so a tiny canvas
195
+ scale paints one pixel where acroform threw, and `paint` checks a scale as
196
+ the `f64` a JS number is before narrowing it. (#2040)
197
+ - feat(cli): **`quillmark render --ppi`** sets the PNG density. (#2040)
198
+
199
+ ### Docs
200
+
201
+ - docs(quills): **consumer-study corrections** across the quill and authoring
202
+ pages. (#2035)
203
+
204
+ ### Build
205
+
206
+ - ci: `wasm-bindgen-cli` pinned to the lockfile's 0.2.129; thiserror 2.0.21,
207
+ web-sys 0.3.106 and `taiki-e/install-action` 2.87.21. (#2032, #2033)
208
+
209
+
3
210
  ## v0.121.0 - 2026-09-30
4
211
 
5
212
  Upgrade path: [0.120 → 0.121](docs/migrations/0.120-to-0.121.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,13 @@ 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`. Every own string
507
+ key counts, a non-enumerable one and one holding `undefined` included. The
508
+ argument must be a plain object, its prototype `null` or `Object.prototype`
509
+ of any realm, so a `Map`, a class instance or `Object.create({ … })` throws.
510
+ The diagnostic names the key or what was passed, and carries no `code`: it
511
+ is a call site to fix, not a condition to route on.
493
512
  - `engine.render(quill, parsed)` against a quill whose *name* differs
494
513
  (`quill::name_mismatch`) or whose *version* falls outside the document's
495
514
  selector (`quill::version_mismatch`): a throw, never a warning.
package/core/wasm.d.ts CHANGED
@@ -446,8 +446,8 @@ export interface QuillFieldSchema {
446
446
  members?: Record<string, string>;
447
447
  /** `true` on a `type: "matrix"` field admitting items a document adds
448
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. */
449
+ * `title` string, not blank, beside the columns, held by being present.
450
+ * Valid only on a matrix. */
451
451
  open?: boolean;
452
452
  ui?: QuillFieldUi;
453
453
  properties?: Record<string, 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,39 @@ 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_getOwnPropertyNames_f8299644de14134c: function(arg0) {
1922
+ const ret = Object.getOwnPropertyNames(getObject(arg0));
1923
+ return addHeapObject(ret);
1924
+ },
1925
+ __wbg_getPrototypeOf_4e7d85b5bf38d546: function() { return handleError(function (arg0) {
1926
+ const ret = Reflect.getPrototypeOf(getObject(arg0));
1927
+ return addHeapObject(ret);
1928
+ }, arguments); },
1929
+ __wbg_get_658f6698067d9515: function() { return handleError(function (arg0, arg1) {
1922
1930
  const ret = Reflect.get(getObject(arg0), getObject(arg1));
1923
1931
  return addHeapObject(ret);
1924
1932
  }, arguments); },
1925
- __wbg_get_b1f0ab13c737f856: function(arg0, arg1) {
1933
+ __wbg_get_6c896e0571ddae51: function(arg0, arg1) {
1926
1934
  const ret = getObject(arg0)[arg1 >>> 0];
1927
1935
  return addHeapObject(ret);
1928
1936
  },
1929
- __wbg_get_unchecked_363572bdd397d473: function(arg0, arg1) {
1937
+ __wbg_get_unchecked_288889d017702237: function(arg0, arg1) {
1930
1938
  const ret = getObject(arg0)[arg1 >>> 0];
1931
1939
  return addHeapObject(ret);
1932
1940
  },
@@ -1934,7 +1942,7 @@ function __wbg_get_imports() {
1934
1942
  const ret = getObject(arg0)[getObject(arg1)];
1935
1943
  return addHeapObject(ret);
1936
1944
  },
1937
- __wbg_instanceof_ArrayBuffer_d4ff01f8247925ae: function(arg0) {
1945
+ __wbg_instanceof_ArrayBuffer_a99f175873e5d9b8: function(arg0) {
1938
1946
  let result;
1939
1947
  try {
1940
1948
  result = getObject(arg0) instanceof ArrayBuffer;
@@ -1944,7 +1952,7 @@ function __wbg_get_imports() {
1944
1952
  const ret = result;
1945
1953
  return ret;
1946
1954
  },
1947
- __wbg_instanceof_Map_1ff6a2b54c899f0d: function(arg0) {
1955
+ __wbg_instanceof_Map_b2611749102d7ba3: function(arg0) {
1948
1956
  let result;
1949
1957
  try {
1950
1958
  result = getObject(arg0) instanceof Map;
@@ -1954,17 +1962,7 @@ function __wbg_get_imports() {
1954
1962
  const ret = result;
1955
1963
  return ret;
1956
1964
  },
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) {
1965
+ __wbg_instanceof_Uint8Array_828cef2aaacafc31: function(arg0) {
1968
1966
  let result;
1969
1967
  try {
1970
1968
  result = getObject(arg0) instanceof Uint8Array;
@@ -1974,35 +1972,31 @@ function __wbg_get_imports() {
1974
1972
  const ret = result;
1975
1973
  return ret;
1976
1974
  },
1977
- __wbg_isArray_5674713bb7b79043: function(arg0) {
1975
+ __wbg_isArray_e15a2ff68ffdbef2: function(arg0) {
1978
1976
  const ret = Array.isArray(getObject(arg0));
1979
1977
  return ret;
1980
1978
  },
1981
- __wbg_isSafeInteger_8f51c743827d1ec5: function(arg0) {
1979
+ __wbg_isSafeInteger_717808ad6a54bd9e: function(arg0) {
1982
1980
  const ret = Number.isSafeInteger(getObject(arg0));
1983
1981
  return ret;
1984
1982
  },
1985
- __wbg_iterator_22ddeb808cf55a6f: function() {
1983
+ __wbg_iterator_e3c31c892080e444: function() {
1986
1984
  const ret = Symbol.iterator;
1987
1985
  return addHeapObject(ret);
1988
1986
  },
1989
- __wbg_keys_6efc298980178da1: function(arg0) {
1990
- const ret = Object.keys(getObject(arg0));
1991
- return addHeapObject(ret);
1992
- },
1993
- __wbg_length_31bdaf014f5fbde2: function(arg0) {
1987
+ __wbg_length_7f3c00c40364105e: function(arg0) {
1994
1988
  const ret = getObject(arg0).length;
1995
1989
  return ret;
1996
1990
  },
1997
- __wbg_length_4e1adc0d42e23620: function(arg0) {
1991
+ __wbg_length_d4bdea10311bd9cf: function(arg0) {
1998
1992
  const ret = getObject(arg0).length;
1999
1993
  return ret;
2000
1994
  },
2001
- __wbg_new_0_35540e542ba689d2: function() {
1995
+ __wbg_new_0_72d020f0c63443d4: function() {
2002
1996
  const ret = new Date();
2003
1997
  return addHeapObject(ret);
2004
1998
  },
2005
- __wbg_new_1da3429bc3c4541c: function(arg0) {
1999
+ __wbg_new_1dbf7428bba60a42: function(arg0) {
2006
2000
  const ret = new Uint8Array(getObject(arg0));
2007
2001
  return addHeapObject(ret);
2008
2002
  },
@@ -2010,51 +2004,51 @@ function __wbg_get_imports() {
2010
2004
  const ret = new Error();
2011
2005
  return addHeapObject(ret);
2012
2006
  },
2013
- __wbg_new_8d36e20aa758e411: function() {
2007
+ __wbg_new_28744009d011f847: function() {
2014
2008
  const ret = new Map();
2015
2009
  return addHeapObject(ret);
2016
2010
  },
2017
- __wbg_new_a32a1ab6c6655abe: function(arg0, arg1) {
2011
+ __wbg_new_343a093a3c2ffb4e: function(arg0, arg1) {
2018
2012
  const ret = new Error(getStringFromWasm0(arg0, arg1));
2019
2013
  return addHeapObject(ret);
2020
2014
  },
2021
- __wbg_new_bebc3f4757acf305: function() {
2015
+ __wbg_new_617a8cdb8bb1130e: function() {
2022
2016
  const ret = new Object();
2023
2017
  return addHeapObject(ret);
2024
2018
  },
2025
- __wbg_new_ffa92086ea89f79c: function() {
2019
+ __wbg_new_ee2291f50781bf1d: function() {
2026
2020
  const ret = new Array();
2027
2021
  return addHeapObject(ret);
2028
2022
  },
2029
- __wbg_new_from_slice_4ee02165f9de919e: function(arg0, arg1) {
2023
+ __wbg_new_from_slice_9a868026ffa4208a: function(arg0, arg1) {
2030
2024
  const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
2031
2025
  return addHeapObject(ret);
2032
2026
  },
2033
- __wbg_next_95053e306b1c3aed: function(arg0) {
2027
+ __wbg_next_33784799010f1bbe: function(arg0) {
2034
2028
  const ret = getObject(arg0).next;
2035
2029
  return addHeapObject(ret);
2036
2030
  },
2037
- __wbg_next_f31ecb8646d2c605: function() { return handleError(function (arg0) {
2031
+ __wbg_next_f4aac29c42af995c: function() { return handleError(function (arg0) {
2038
2032
  const ret = getObject(arg0).next();
2039
2033
  return addHeapObject(ret);
2040
2034
  }, arguments); },
2041
- __wbg_prototypesetcall_ae9f5e7459250748: function(arg0, arg1, arg2) {
2035
+ __wbg_prototypesetcall_bc27214492979395: function(arg0, arg1, arg2) {
2042
2036
  Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), getObject(arg2));
2043
2037
  },
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) {
2038
+ __wbg_set_145a351398b48c65: function() { return handleError(function (arg0, arg1, arg2) {
2051
2039
  const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
2052
2040
  return ret;
2053
2041
  }, arguments); },
2054
- __wbg_set_bf6dde4923b9b059: function(arg0, arg1, arg2) {
2042
+ __wbg_set_6ae97e73113c4f0b: function(arg0, arg1, arg2) {
2055
2043
  const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
2056
2044
  return addHeapObject(ret);
2057
2045
  },
2046
+ __wbg_set_6be42768c690e380: function(arg0, arg1, arg2) {
2047
+ getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
2048
+ },
2049
+ __wbg_set_bea140a88be9b277: function(arg0, arg1, arg2) {
2050
+ getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
2051
+ },
2058
2052
  __wbg_stack_3b0d974bbf31e44f: function(arg0, arg1) {
2059
2053
  const ret = getObject(arg1).stack;
2060
2054
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
@@ -2062,15 +2056,15 @@ function __wbg_get_imports() {
2062
2056
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
2063
2057
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
2064
2058
  },
2065
- __wbg_value_c227f843d21da141: function(arg0) {
2059
+ __wbg_value_f3c585ee8f5ba40c: function(arg0) {
2066
2060
  const ret = getObject(arg0).value;
2067
2061
  return addHeapObject(ret);
2068
2062
  },
2069
- __wbg_values_220548effc36d1d3: function(arg0) {
2063
+ __wbg_values_0861828bcc747558: function(arg0) {
2070
2064
  const ret = Object.values(getObject(arg0));
2071
2065
  return addHeapObject(ret);
2072
2066
  },
2073
- __wbg_values_85d5bcf6f1ca8248: function(arg0) {
2067
+ __wbg_values_6450e8158115fd4e: function(arg0) {
2074
2068
  const ret = getObject(arg0).values();
2075
2069
  return addHeapObject(ret);
2076
2070
  },
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.121.0",
3
+ "version": "0.123.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
@@ -457,8 +457,8 @@ export interface QuillFieldSchema {
457
457
  members?: Record<string, string>;
458
458
  /** `true` on a `type: "matrix"` field admitting items a document adds
459
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. */
460
+ * `title` string, not blank, beside the columns, held by being present.
461
+ * Valid only on a matrix. */
462
462
  open?: boolean;
463
463
  ui?: QuillFieldUi;
464
464
  properties?: Record<string, QuillFieldSchema>;
@@ -983,7 +983,8 @@ export class LiveSession {
983
983
  * this call.
984
984
  *
985
985
  * Throws if `page` is out of range, `ctx` is the wrong type, or `scale` is
986
- * not finite and positive (`backend::invalid_raster_scale`).
986
+ * not finite and positive or is under `f32::MIN_POSITIVE`
987
+ * (`backend::invalid_raster_scale`).
987
988
  */
988
989
  paint(ctx: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D, page: number, scale: number): void;
989
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,39 @@ 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_getOwnPropertyNames_f8299644de14134c: function(arg0) {
2356
+ const ret = Object.getOwnPropertyNames(getObject(arg0));
2357
+ return addHeapObject(ret);
2358
+ },
2359
+ __wbg_getPrototypeOf_4e7d85b5bf38d546: function() { return handleError(function (arg0) {
2360
+ const ret = Reflect.getPrototypeOf(getObject(arg0));
2361
+ return addHeapObject(ret);
2362
+ }, arguments); },
2363
+ __wbg_get_658f6698067d9515: function() { return handleError(function (arg0, arg1) {
2355
2364
  const ret = Reflect.get(getObject(arg0), getObject(arg1));
2356
2365
  return addHeapObject(ret);
2357
2366
  }, arguments); },
2358
- __wbg_get_b1f0ab13c737f856: function(arg0, arg1) {
2367
+ __wbg_get_6c896e0571ddae51: function(arg0, arg1) {
2359
2368
  const ret = getObject(arg0)[arg1 >>> 0];
2360
2369
  return addHeapObject(ret);
2361
2370
  },
2362
- __wbg_get_unchecked_363572bdd397d473: function(arg0, arg1) {
2371
+ __wbg_get_unchecked_288889d017702237: function(arg0, arg1) {
2363
2372
  const ret = getObject(arg0)[arg1 >>> 0];
2364
2373
  return addHeapObject(ret);
2365
2374
  },
@@ -2367,7 +2376,7 @@ function __wbg_get_imports() {
2367
2376
  const ret = getObject(arg0)[getObject(arg1)];
2368
2377
  return addHeapObject(ret);
2369
2378
  },
2370
- __wbg_instanceof_ArrayBuffer_d4ff01f8247925ae: function(arg0) {
2379
+ __wbg_instanceof_ArrayBuffer_a99f175873e5d9b8: function(arg0) {
2371
2380
  let result;
2372
2381
  try {
2373
2382
  result = getObject(arg0) instanceof ArrayBuffer;
@@ -2377,7 +2386,7 @@ function __wbg_get_imports() {
2377
2386
  const ret = result;
2378
2387
  return ret;
2379
2388
  },
2380
- __wbg_instanceof_CanvasRenderingContext2d_bde5245b14027f3f: function(arg0) {
2389
+ __wbg_instanceof_CanvasRenderingContext2d_769208c72dcbf5e6: function(arg0) {
2381
2390
  let result;
2382
2391
  try {
2383
2392
  result = getObject(arg0) instanceof CanvasRenderingContext2D;
@@ -2387,7 +2396,7 @@ function __wbg_get_imports() {
2387
2396
  const ret = result;
2388
2397
  return ret;
2389
2398
  },
2390
- __wbg_instanceof_Map_1ff6a2b54c899f0d: function(arg0) {
2399
+ __wbg_instanceof_Map_b2611749102d7ba3: function(arg0) {
2391
2400
  let result;
2392
2401
  try {
2393
2402
  result = getObject(arg0) instanceof Map;
@@ -2397,17 +2406,7 @@ function __wbg_get_imports() {
2397
2406
  const ret = result;
2398
2407
  return ret;
2399
2408
  },
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) {
2409
+ __wbg_instanceof_OffscreenCanvasRenderingContext2d_957f1a991324c9dc: function(arg0) {
2411
2410
  let result;
2412
2411
  try {
2413
2412
  result = getObject(arg0) instanceof OffscreenCanvasRenderingContext2D;
@@ -2417,7 +2416,7 @@ function __wbg_get_imports() {
2417
2416
  const ret = result;
2418
2417
  return ret;
2419
2418
  },
2420
- __wbg_instanceof_Uint8Array_598adc0fef426aa8: function(arg0) {
2419
+ __wbg_instanceof_Uint8Array_828cef2aaacafc31: function(arg0) {
2421
2420
  let result;
2422
2421
  try {
2423
2422
  result = getObject(arg0) instanceof Uint8Array;
@@ -2427,35 +2426,31 @@ function __wbg_get_imports() {
2427
2426
  const ret = result;
2428
2427
  return ret;
2429
2428
  },
2430
- __wbg_isArray_5674713bb7b79043: function(arg0) {
2429
+ __wbg_isArray_e15a2ff68ffdbef2: function(arg0) {
2431
2430
  const ret = Array.isArray(getObject(arg0));
2432
2431
  return ret;
2433
2432
  },
2434
- __wbg_isSafeInteger_8f51c743827d1ec5: function(arg0) {
2433
+ __wbg_isSafeInteger_717808ad6a54bd9e: function(arg0) {
2435
2434
  const ret = Number.isSafeInteger(getObject(arg0));
2436
2435
  return ret;
2437
2436
  },
2438
- __wbg_iterator_22ddeb808cf55a6f: function() {
2437
+ __wbg_iterator_e3c31c892080e444: function() {
2439
2438
  const ret = Symbol.iterator;
2440
2439
  return addHeapObject(ret);
2441
2440
  },
2442
- __wbg_keys_6efc298980178da1: function(arg0) {
2443
- const ret = Object.keys(getObject(arg0));
2444
- return addHeapObject(ret);
2445
- },
2446
- __wbg_length_31bdaf014f5fbde2: function(arg0) {
2441
+ __wbg_length_7f3c00c40364105e: function(arg0) {
2447
2442
  const ret = getObject(arg0).length;
2448
2443
  return ret;
2449
2444
  },
2450
- __wbg_length_4e1adc0d42e23620: function(arg0) {
2445
+ __wbg_length_d4bdea10311bd9cf: function(arg0) {
2451
2446
  const ret = getObject(arg0).length;
2452
2447
  return ret;
2453
2448
  },
2454
- __wbg_new_0_35540e542ba689d2: function() {
2449
+ __wbg_new_0_72d020f0c63443d4: function() {
2455
2450
  const ret = new Date();
2456
2451
  return addHeapObject(ret);
2457
2452
  },
2458
- __wbg_new_1da3429bc3c4541c: function(arg0) {
2453
+ __wbg_new_1dbf7428bba60a42: function(arg0) {
2459
2454
  const ret = new Uint8Array(getObject(arg0));
2460
2455
  return addHeapObject(ret);
2461
2456
  },
@@ -2463,71 +2458,71 @@ function __wbg_get_imports() {
2463
2458
  const ret = new Error();
2464
2459
  return addHeapObject(ret);
2465
2460
  },
2466
- __wbg_new_8d36e20aa758e411: function() {
2461
+ __wbg_new_28744009d011f847: function() {
2467
2462
  const ret = new Map();
2468
2463
  return addHeapObject(ret);
2469
2464
  },
2470
- __wbg_new_a32a1ab6c6655abe: function(arg0, arg1) {
2465
+ __wbg_new_343a093a3c2ffb4e: function(arg0, arg1) {
2471
2466
  const ret = new Error(getStringFromWasm0(arg0, arg1));
2472
2467
  return addHeapObject(ret);
2473
2468
  },
2474
- __wbg_new_bebc3f4757acf305: function() {
2469
+ __wbg_new_617a8cdb8bb1130e: function() {
2475
2470
  const ret = new Object();
2476
2471
  return addHeapObject(ret);
2477
2472
  },
2478
- __wbg_new_ffa92086ea89f79c: function() {
2473
+ __wbg_new_ee2291f50781bf1d: function() {
2479
2474
  const ret = new Array();
2480
2475
  return addHeapObject(ret);
2481
2476
  },
2482
- __wbg_new_from_slice_4ee02165f9de919e: function(arg0, arg1) {
2477
+ __wbg_new_from_slice_9a868026ffa4208a: function(arg0, arg1) {
2483
2478
  const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
2484
2479
  return addHeapObject(ret);
2485
2480
  },
2486
- __wbg_new_with_u8_clamped_array_and_sh_15a008af56aca047: function() { return handleError(function (arg0, arg1, arg2, arg3) {
2481
+ __wbg_new_with_u8_clamped_array_and_sh_af3f0dee40638e18: function() { return handleError(function (arg0, arg1, arg2, arg3) {
2487
2482
  const ret = new ImageData(getClampedArrayU8FromWasm0(arg0, arg1), arg2 >>> 0, arg3 >>> 0);
2488
2483
  return addHeapObject(ret);
2489
2484
  }, arguments); },
2490
- __wbg_next_95053e306b1c3aed: function(arg0) {
2485
+ __wbg_next_33784799010f1bbe: function(arg0) {
2491
2486
  const ret = getObject(arg0).next;
2492
2487
  return addHeapObject(ret);
2493
2488
  },
2494
- __wbg_next_f31ecb8646d2c605: function() { return handleError(function (arg0) {
2489
+ __wbg_next_f4aac29c42af995c: function() { return handleError(function (arg0) {
2495
2490
  const ret = getObject(arg0).next();
2496
2491
  return addHeapObject(ret);
2497
2492
  }, arguments); },
2498
- __wbg_prototypesetcall_ae9f5e7459250748: function(arg0, arg1, arg2) {
2493
+ __wbg_prototypesetcall_bc27214492979395: function(arg0, arg1, arg2) {
2499
2494
  Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), getObject(arg2));
2500
2495
  },
2501
- __wbg_putImageData_080efc8615f29b4e: function() { return handleError(function (arg0, arg1, arg2, arg3) {
2496
+ __wbg_putImageData_11570c06086c9e05: function() { return handleError(function (arg0, arg1, arg2, arg3) {
2502
2497
  getObject(arg0).putImageData(getObject(arg1), arg2, arg3);
2503
2498
  }, arguments); },
2504
- __wbg_putImageData_581de52c9f40fc59: function() { return handleError(function (arg0, arg1, arg2, arg3) {
2499
+ __wbg_putImageData_7bf1e9dea494ea50: function() { return handleError(function (arg0, arg1, arg2, arg3) {
2505
2500
  getObject(arg0).putImageData(getObject(arg1), arg2, arg3);
2506
2501
  }, 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) {
2502
+ __wbg_set_145a351398b48c65: function() { return handleError(function (arg0, arg1, arg2) {
2514
2503
  const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
2515
2504
  return ret;
2516
2505
  }, arguments); },
2517
- __wbg_set_bf6dde4923b9b059: function(arg0, arg1, arg2) {
2506
+ __wbg_set_6ae97e73113c4f0b: function(arg0, arg1, arg2) {
2518
2507
  const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
2519
2508
  return addHeapObject(ret);
2520
2509
  },
2521
- __wbg_set_height_1202ad0eab43cbe0: function(arg0, arg1) {
2510
+ __wbg_set_6be42768c690e380: function(arg0, arg1, arg2) {
2511
+ getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
2512
+ },
2513
+ __wbg_set_bea140a88be9b277: function(arg0, arg1, arg2) {
2514
+ getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
2515
+ },
2516
+ __wbg_set_height_c9789c1c77eaedff: function(arg0, arg1) {
2522
2517
  getObject(arg0).height = arg1 >>> 0;
2523
2518
  },
2524
- __wbg_set_height_698fb3b255bc1348: function(arg0, arg1) {
2519
+ __wbg_set_height_fde391767df1ce27: function(arg0, arg1) {
2525
2520
  getObject(arg0).height = arg1 >>> 0;
2526
2521
  },
2527
- __wbg_set_width_4c3a2252e0dea033: function(arg0, arg1) {
2522
+ __wbg_set_width_0ca908d167690992: function(arg0, arg1) {
2528
2523
  getObject(arg0).width = arg1 >>> 0;
2529
2524
  },
2530
- __wbg_set_width_f52a20e39808b138: function(arg0, arg1) {
2525
+ __wbg_set_width_b0e1267db4b196b5: function(arg0, arg1) {
2531
2526
  getObject(arg0).width = arg1 >>> 0;
2532
2527
  },
2533
2528
  __wbg_stack_3b0d974bbf31e44f: function(arg0, arg1) {
@@ -2537,15 +2532,15 @@ function __wbg_get_imports() {
2537
2532
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
2538
2533
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
2539
2534
  },
2540
- __wbg_value_c227f843d21da141: function(arg0) {
2535
+ __wbg_value_f3c585ee8f5ba40c: function(arg0) {
2541
2536
  const ret = getObject(arg0).value;
2542
2537
  return addHeapObject(ret);
2543
2538
  },
2544
- __wbg_values_220548effc36d1d3: function(arg0) {
2539
+ __wbg_values_0861828bcc747558: function(arg0) {
2545
2540
  const ret = Object.values(getObject(arg0));
2546
2541
  return addHeapObject(ret);
2547
2542
  },
2548
- __wbg_values_85d5bcf6f1ca8248: function(arg0) {
2543
+ __wbg_values_6450e8158115fd4e: function(arg0) {
2549
2544
  const ret = getObject(arg0).values();
2550
2545
  return addHeapObject(ret);
2551
2546
  },
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,20 @@ export interface Artifact {
236
238
  mimeType: string;
237
239
  }
238
240
 
239
- /** Options for one render. */
241
+ /**
242
+ * Options for one render, as a plain object. Any other key throws, `today`
243
+ * included: the render
244
+ * date is an argument of {@link Engine.render} and {@link Engine.open}, not an
245
+ * option.
246
+ */
240
247
  export interface RenderOptions {
241
248
  format?: OutputFormat;
242
249
  /**
243
250
  * 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`.
251
+ * Defaults to 144. Must be finite, above 0, and small enough to keep both
252
+ * sides of every rendered page within 16384 px — anything else throws
253
+ * `backend::invalid_raster_scale`, whose hint past the ceiling names a ppi
254
+ * that fits.
247
255
  */
248
256
  ppi?: number;
249
257
  pages?: number[];
@@ -371,6 +379,7 @@ export interface BackendDescriptor {
371
379
  formats: OutputFormat[];
372
380
  }
373
381
 
382
+ /** Options for `new Engine(...)`, as a plain object. A key other than `backends` throws. */
374
383
  export interface EngineOptions {
375
384
  /**
376
385
  * Extra or overriding backend descriptors, merged over the built-ins. Keys are
@@ -407,7 +416,8 @@ export declare class Engine {
407
416
  * document it opened from, so {@link LiveSession.render} carries the
408
417
  * compile's alone: read `doc.warnings` and `quill.validate(doc)` beside it.
409
418
  *
410
- * `today` reads as on {@link open}.
419
+ * `today` reads as on {@link open}. An `options` key outside
420
+ * {@link RenderOptions} rejects, `today` among them.
411
421
  */
412
422
  render(quill: Quill, doc: Document, options?: RenderOptions, today?: string): Promise<RenderResult>;
413
423
 
@@ -537,7 +547,8 @@ export declare class LiveSession {
537
547
  * neither exceeds 16384 px, so `canvas.width / widthPt` is the scale painted
538
548
  * at; the caller owns `canvas.style.*`, and a canvas styled `width: 100%`
539
549
  * needs nothing back from the paint. Throws `backend::invalid_raster_scale`
540
- * on a `scale` that is not finite and positive.
550
+ * on a `scale` that is not finite and positive, or is under the least a
551
+ * 32-bit float holds at full precision (2⁻¹²⁶, about 1.2e-38).
541
552
  *
542
553
  * The write is a whole-backing-store `putImageData`, which bypasses the 2D
543
554
  * context transform, `globalAlpha`, and clip, so give each visible page its
@@ -580,6 +591,8 @@ declare module '../core/wasm.js' {
580
591
  }
581
592
  }
582
593
 
594
+ import type { Addr, Content, Delta, PathStep, Resolved } from '../core/wasm.js';
595
+
583
596
  /**
584
597
  * A `Document` bound to its `Quill` for typed writes, from {@link Quill.writer}.
585
598
  * Speaks names, values, and markdown, so bare `set` / `setAll` / `reviseBody` /
@@ -161,6 +161,39 @@ function quillmarkError(code, message, hint) {
161
161
  return err;
162
162
  }
163
163
 
164
+ /**
165
+ * Throw on options that are not a plain object, or on an own key of them
166
+ * outside `known`. The JS twin of the binding's `reject_unknown_keys`, in the
167
+ * uncoded shape it throws: a misspelled optional key would otherwise read as
168
+ * absent, and a read reaches a key up the prototype chain that no own-key walk
169
+ * sees.
170
+ * @param {unknown} options
171
+ * @param {string[]} known
172
+ * @param {string} what the options' name, for the message
173
+ * @returns {void}
174
+ */
175
+ function rejectUnknownKeys(options, known, what) {
176
+ if (options == null) return;
177
+ const proto = Object.getPrototypeOf(options);
178
+ let message;
179
+ if (proto !== null && Object.getPrototypeOf(proto) !== null) {
180
+ const passed =
181
+ options instanceof Map
182
+ ? 'a `Map`'
183
+ : typeof options === 'object'
184
+ ? 'one inheriting from another object'
185
+ : `a ${typeof options}`;
186
+ message = `${what} must be a plain object, not ${passed}`;
187
+ } else {
188
+ const key = Object.getOwnPropertyNames(options).find((k) => !known.includes(k));
189
+ if (key === undefined) return;
190
+ message = `${what} have unknown key \`${key}\`; ${what} take only \`${known.join('`, `')}\``;
191
+ }
192
+ const err = /** @type {any} */ (new Error(message));
193
+ err.diagnostics = [{ severity: 'error', message }];
194
+ throw err;
195
+ }
196
+
164
197
  // These checks deliver the ERROR, not the rejection, at the seams that cross
165
198
  // into backend memory as DATA — `Engine` and `LiveSession.update` — where a
166
199
  // foreign handle would otherwise work silently at the price of a whole-document
@@ -374,6 +407,7 @@ export class Engine {
374
407
  * @param {{ backends?: Record<string, { load: () => Promise<unknown>, formats: string[] }> }} [options]
375
408
  */
376
409
  constructor(options) {
410
+ rejectUnknownKeys(options, ['backends'], 'Engine options');
377
411
  const merged = { ...DEFAULT_BACKENDS, ...(options?.backends ?? {}) };
378
412
  /** @type {Record<string, { load: () => Promise<unknown>, formats: string[] }>} */
379
413
  const loaders = {};