@quillmark/wasm 0.106.0 → 0.107.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 +266 -16
- package/backends/pdfform/wasm_bg.wasm +0 -0
- package/backends/typst/wasm_bg.wasm +0 -0
- package/core/wasm_bg.wasm +0 -0
- package/package.json +1 -1
- package/runtime/runtime.d.ts +10 -0
- package/runtime/runtime.js +17 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,271 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## v0.107.0 - 2026-08-17
|
|
4
|
+
|
|
5
|
+
- fix(typst): `display(field, ..)` validates its address against the schema, the
|
|
6
|
+
assert `form-field` and `field-region` already carry. It is the one helper keyed
|
|
7
|
+
by address rather than by value, and it was the one accepting an address the
|
|
8
|
+
schema does not have: `display("issed", "[year]")` compiled, drew nothing, and
|
|
9
|
+
reported nothing — the failure a plate author is least placed to see, a card
|
|
10
|
+
address being a string the plate builds by concatenating `$path`. `_qm-display`
|
|
11
|
+
cannot catch it, carrying an entry per *present* date, so a blank date and a
|
|
12
|
+
typo are absent from it alike; `_qm-known-path` answers about the schema and
|
|
13
|
+
tells the two apart. A known address carrying no date still returns `none`, so
|
|
14
|
+
a `== none` fallback is unchanged: the assert is about the address, the `none`
|
|
15
|
+
about the value.
|
|
16
|
+
- fix: **a container's own `default:` reaches the plate as content.** The render
|
|
17
|
+
floor read `default_content` only for a `richtext`/`plaintext` leaf. An
|
|
18
|
+
`object` or `array` carrying its `default:` on the container fell through to
|
|
19
|
+
the raw literal instead, crossing as unimported markdown where every other
|
|
20
|
+
content position delivers a canonical content object. The companion was
|
|
21
|
+
already cached and never read. The floor now keys off the cache — present is
|
|
22
|
+
the form to commit, absent over a content-bearing tree blank-fills — which
|
|
23
|
+
covers leaf and container alike and drops the type test. `usaf_memo`'s
|
|
24
|
+
`references` (`array<richtext(inline)>`, `default: []`) carried the same
|
|
25
|
+
defect, invisible only because the list was empty.
|
|
26
|
+
- **breaking** a container-shaped `default:`/`example:` on a variant-bearing
|
|
27
|
+
enum is a load error (`quill::default_type_mismatch`,
|
|
28
|
+
`quill::example_type_mismatch`). A quill declaring one loaded before, so the
|
|
29
|
+
upgrade reads as a quill that stopped loading rather than as a fix.
|
|
30
|
+
The container is the shape a *document* writes. As a schema literal it cached
|
|
31
|
+
no content form and yielded no discriminant, so the field blank-filled in
|
|
32
|
+
silence as if nothing were declared. The diagnostic names the discriminant
|
|
33
|
+
spelling instead, which is where a world's cells carry their own literals.
|
|
34
|
+
Scalar literals are unaffected.
|
|
35
|
+
|
|
36
|
+
- feat: **every type nests at every depth**. A property or an element is an
|
|
37
|
+
ordinary field, so it carries whatever a card-level field carries, itself
|
|
38
|
+
included: `object<array<string>>`, `array<array<integer>>`, a typed table whose
|
|
39
|
+
row holds a typed dictionary, and a variant cell holding either.
|
|
40
|
+
`quill::nested_object_not_supported` and `quill::nested_array_not_supported`
|
|
41
|
+
are gone, and `ShapePosition`'s three positions collapse to the one question
|
|
42
|
+
the walk still asks — is this card level, where `variants:` and `ui.group` are
|
|
43
|
+
the two keys that live. A widening: every quill that loaded before loads
|
|
44
|
+
unchanged.
|
|
45
|
+
The depth budget was what the flat address tables existed for.
|
|
46
|
+
`SchemaMeta` carried six name-keyed tables (`array_fields`, `object_fields`
|
|
47
|
+
and their card twins) so the helper's `_qm-known-path` could enumerate two
|
|
48
|
+
suffix steps rather than derive a grammar; they are replaced by one address
|
|
49
|
+
tree — the schema pruned to the steps it offers — that the helper and the span
|
|
50
|
+
scan both walk, converging on the unbounded descent `pdfform::bind` always
|
|
51
|
+
had. Three components deriving an address become one walk each side of the
|
|
52
|
+
seam, and `quillmark/tests/address_grammar.rs` pins the two against the deep
|
|
53
|
+
shapes as well as the shallow ones.
|
|
54
|
+
`variants:` stays card-level, now on its own reasoning rather than by
|
|
55
|
+
inheriting the depth ban: a variant's shape is a function of the schema *and*
|
|
56
|
+
the discriminant, and the union projection, the once-bound form, the plate's
|
|
57
|
+
single branch and `validation::out_of_variant` each hold because that gap is
|
|
58
|
+
one level deep ([SCHEMAS.md](prose/canon/SCHEMAS.md) §"Enum variants"). An
|
|
59
|
+
array-valued variant cell used to report `nested_array_not_supported`, whose
|
|
60
|
+
message named array elements and object properties — neither the situation;
|
|
61
|
+
the shape is now legal and `quill::variant_placement` is left saying only what
|
|
62
|
+
it means.
|
|
63
|
+
- fix: `blueprint()` expands a container at every depth. `build_property_mapping`
|
|
64
|
+
spent each property through the scalar builder, so a nested `object` or typed
|
|
65
|
+
table rendered as `key: null # object` — its own properties, their markers and
|
|
66
|
+
their annotations absent — where the same shape one level up expanded. It now
|
|
67
|
+
recurses, and the card-level and nested paths are one implementation, so a
|
|
68
|
+
`default:` covers its subtree identically wherever it is declared. No
|
|
69
|
+
document changes shape: the shapes this fixes could not be declared before.
|
|
70
|
+
- fix: a content leaf's `default:` reaches the plate from **every** position it
|
|
71
|
+
can be declared in, not only card level. The load pass that imports each
|
|
72
|
+
richtext/plaintext literal into its companion cache walked the card's field
|
|
73
|
+
map, so an `object` property, a typed-table row property and a variant cell
|
|
74
|
+
each kept their authored `default:` and cached nothing; the render floor read
|
|
75
|
+
the leaf's empty companion and blank-filled. A document authoring only the
|
|
76
|
+
container (`dict: {}`, `rows: [{}]`, `c: {value: CUI}`) rendered correctly
|
|
77
|
+
with the author's default missing, and nothing upstream had anything to
|
|
78
|
+
report. The walk now recurses `properties` / `items` / `variants`, the shapes
|
|
79
|
+
`field_contains_content` already descended, so such a document now renders
|
|
80
|
+
**with** the author's default — a render-output change for any quill that
|
|
81
|
+
declared one. Importing a literal is also what checks it, so a nested
|
|
82
|
+
`richtext(inline)` violation — in a `default:` or an `example:` — now fails
|
|
83
|
+
load as a card-level one always has, naming the leaf's declaration path.
|
|
84
|
+
**Breaking on that second count**: the literal loaded before, so a quill
|
|
85
|
+
carrying one stops loading. Nested `example:` *surfacing* was never broken:
|
|
86
|
+
the blueprint prints the raw literal at every depth.
|
|
87
|
+
- **breaking** typst: a plate's direct read of a typed-table row cell regions on
|
|
88
|
+
the cell (`refs.0.org`), where it regioned on the whole array before — a
|
|
89
|
+
*wrong* address, not a missing one, routing a click on the org cell to the
|
|
90
|
+
entire table. The span scan was the third component deriving a schema address
|
|
91
|
+
and the one left at the one-level ceiling: 0.106 lifted the lowering walk and
|
|
92
|
+
`_qm-known-path` to the row property, so the three no longer agreed, and the
|
|
93
|
+
scan is the one that decides what a *read* is attributed to. It now takes the
|
|
94
|
+
index step (`.at(n)`, the only spelling Typst has for an array index) and then
|
|
95
|
+
the row property, gated on the `array_fields` table. Each step is its own
|
|
96
|
+
address, so a whole-row read names the row (`refs.0`) and a primitive
|
|
97
|
+
element's read names the element (`tags.0`); a negative index and an
|
|
98
|
+
undeclared row key mint nothing and fall back as before. Consumers keying on
|
|
99
|
+
the array's address for element ink see the narrower address instead. Explicit
|
|
100
|
+
`field-region` / `form-field` claims are unchanged, and the alias lane keeps
|
|
101
|
+
parity: `#let row = data.refs.at(0)` … `#row.org` regions on `refs.0.org`.
|
|
102
|
+
- test: one table pins the schema address grammar on both backends
|
|
103
|
+
(`quillmark/tests/address_grammar.rs`), covering every position the nesting
|
|
104
|
+
contract admits, each position's card twin, and the rejects that bound each
|
|
105
|
+
step. `PLATE_DATA.md` promises a plate author that one address binds on
|
|
106
|
+
either backend, and the grammar is written twice to keep it — an unbounded
|
|
107
|
+
schema walk in `pdfform::bind`, an enumeration of the suffix forms in the
|
|
108
|
+
Typst helper's `_qm-known-path` — reading two different projections of the
|
|
109
|
+
same `QuillConfig`, so either side can move alone. `pdfform` exports
|
|
110
|
+
`resolves_schema_address` (`#[doc(hidden)]`) so the pin can ask both the same
|
|
111
|
+
question. A body address is the plate grammar's alone and is pinned as such.
|
|
112
|
+
|
|
113
|
+
- **breaking** typst: lowering dispatches on the schema node beside each value
|
|
114
|
+
rather than on tables of top-level field names, so a declared type means the
|
|
115
|
+
same thing wherever it is declared. A `date`, `richtext` or `plaintext`
|
|
116
|
+
declared inside an `object` or an `array` row reached the plate as its raw
|
|
117
|
+
wire value before — a bare string for a date, and for a rich field the
|
|
118
|
+
*internal canonical-content JSON*, rendered as a Typst dict — while the same
|
|
119
|
+
type one level up lowered correctly. Ten of the twelve nested positions the
|
|
120
|
+
schema admits degraded that way, silently: core coerced and validated the
|
|
121
|
+
value correctly, so nothing upstream had anything to report. `contact.note`
|
|
122
|
+
is now a markup block, `contact.reply_by` and `rows.0.on` are `datetime`s,
|
|
123
|
+
and `_qm-plaintext` gains the nested entries that closed the
|
|
124
|
+
`plaintext(field)` escape hatch. The walk is the inverse of the one
|
|
125
|
+
`build_transform_schema` builds the node with, so it cannot be shallower than
|
|
126
|
+
the schema is.
|
|
127
|
+
- **breaking** typst: a `date` / `datetime` field lowers to a **native**
|
|
128
|
+
`datetime`, not the `(value:, display:)` wrapper. `data.issued.year()`,
|
|
129
|
+
`data.issued < data.due` and handing the field to a datetime-consuming
|
|
130
|
+
package are ordinary Typst; `.value` and the paren form `(data.issued.display)(..)`
|
|
131
|
+
are hard Typst compile errors, never a silent degrade, and all consumers are
|
|
132
|
+
first party. A date has no canonical rendering the way authored text does —
|
|
133
|
+
every rendering of `2026-01-02` is a typographic decision the plate owns — so
|
|
134
|
+
it lowers to its value and reaches ink by address instead.
|
|
135
|
+
- feat(typst): `display(field, ..args)`, a date field's content projection,
|
|
136
|
+
keyed by schema address rather than carried on the value. It places rendered
|
|
137
|
+
ink whose glyphs are born in generated source, so a date formatted through a
|
|
138
|
+
`#let` binding, a per-card loop variable, or a vendored package keeps a
|
|
139
|
+
region on its schema field — the affordance the value-object existed to buy,
|
|
140
|
+
now available to any date at any depth without shaping the value. `none` for
|
|
141
|
+
a blank date, so a `== none` fallback still fires. The rule plates follow:
|
|
142
|
+
want a value → `data.<field>`; want clickable ink → `display("<field>", ..)`.
|
|
143
|
+
- feat: a variant cell may carry **any type a card field may**, prose and dates
|
|
144
|
+
included — `quill::variant_field_type` is gone. The load error existed because
|
|
145
|
+
lowering read flat top-level name tables that could not descend into a
|
|
146
|
+
container, so a `date` or `richtext` cell inside a variant would have loaded
|
|
147
|
+
clean and reached the plate as its raw wire value; the schema-node walk reads
|
|
148
|
+
the cell's own declaration, leaving the ceiling nothing to protect. Every value
|
|
149
|
+
surface already descended per live-world cell — coercion through
|
|
150
|
+
`conform_value`, validation through `validate_value`, the render floor through
|
|
151
|
+
`resolve_value` — so the widening needed one real fix:
|
|
152
|
+
`field_contains_content` returned `false` for a variant container on the
|
|
153
|
+
strength of this very guard, which would have silently skipped the content
|
|
154
|
+
companion caches, the resting-form conversion and the seed path for a variant
|
|
155
|
+
content cell. It now answers on the union of the worlds' cells. Containers
|
|
156
|
+
are included: "every type nests at every depth" lands in this same release, so
|
|
157
|
+
a variant cell holds a typed table or a typed dictionary like any other
|
|
158
|
+
position. `variants:` itself stays card-level (`quill::variant_placement`) on
|
|
159
|
+
the reasoning stated there.
|
|
160
|
+
|
|
161
|
+
- **breaking** typst: the `plaintext(field)` helper and its `_qm-plaintext`
|
|
162
|
+
table are removed. Shipped in 0.94 as the sanctioned content→`str` coercion,
|
|
163
|
+
it never acquired a caller: no plate, no vendored package, and no binding
|
|
164
|
+
surface referenced it, and the `create-auto-grid` consumer its own docstring
|
|
165
|
+
cited passes an `array<string>` rather than a content field, so the only
|
|
166
|
+
things exercising it were its three tests. It also carried a three-way name
|
|
167
|
+
collision with the `plaintext` field type and that type's document-layer
|
|
168
|
+
resting shape, which took a standing caveat in canon and the template to hold
|
|
169
|
+
down. A plate that needs a `str` from a content field now has no route, which
|
|
170
|
+
is the honest state of the requirement: reinstating it is additive and cheap
|
|
171
|
+
when a plate actually asks.
|
|
172
|
+
- feat(typst): a typed table's row property (`refs.0.org`) is a writable
|
|
173
|
+
schema address. `form-field(field:)` and `field-region` capped at one suffix
|
|
174
|
+
step while pdfform's resolver descended unboundedly, so a shape
|
|
175
|
+
`ShapePosition` explicitly admits bound on one backend only, against
|
|
176
|
+
`PLATE_DATA.md`'s claim that one address binds on either. `array_fields` now
|
|
177
|
+
carries each array's row property names, the same shape `object_fields`
|
|
178
|
+
already had.
|
|
179
|
+
- fix(typst): a non-blank date the shared parsers reject raises
|
|
180
|
+
`backend::invalid_date` from codegen rather than a pre-pass over top-level
|
|
181
|
+
name tables, so the check covers every depth. Only a direct `apply` can
|
|
182
|
+
deliver one; coercion parses the same way.
|
|
183
|
+
- feat(typst): a scalar read through a `let` alias regions on the address the
|
|
184
|
+
chain it names would carry, so `#let c = data.classification` … `#c.poc`
|
|
185
|
+
surfaces `classification.poc` where it surfaced nothing at all — not the
|
|
186
|
+
container's address, absent. Binding a container once and stepping into it
|
|
187
|
+
three times is the refactor 0.106's property addressing invites, and it cost
|
|
188
|
+
the address silently, the document still rendering correctly. An alias holds
|
|
189
|
+
only where the plate binds the name exactly once to one whole `data` chain: a
|
|
190
|
+
name a second `let`, a closure parameter, a loop pattern, an import, or an
|
|
191
|
+
assignment could rebind is dropped rather than risk attributing another
|
|
192
|
+
value's ink to the field, and a wildcard import disqualifies every alias.
|
|
193
|
+
Which name is followed is half the rule; which *occurrence* is the other half,
|
|
194
|
+
since a schema field name collides freely with the parameter names of a callee
|
|
195
|
+
the plate never defines (`date`, `title`, `caption`, `align`, `subject`). Only
|
|
196
|
+
an occurrence that reads the binding anchors: an identifier spelling the alias
|
|
197
|
+
as a named argument (`#text(size: 12pt)`), a dict key, another value's field
|
|
198
|
+
(`#styles.subject`) or an imported item's path draws no ink off the field, and
|
|
199
|
+
a window minted over one would carry a *wrong* address rather than a missing
|
|
200
|
+
one.
|
|
201
|
+
Laundering past that — a function parameter, a destructured binding, a
|
|
202
|
+
per-card loop variable — is unchanged and still needs a `field-region` claim,
|
|
203
|
+
now stated for plate authors under "Which Reads Get Regions" in the Typst
|
|
204
|
+
backend guide. Content and date fields are unaffected: their ink is born in
|
|
205
|
+
generated code.
|
|
206
|
+
|
|
207
|
+
- feat(wasm): `VARIANT_DISCRIMINANT_KEY` joins the runtime's static exports,
|
|
208
|
+
beside `MAIN_CARD_ADDR`. v0.106.0 announced the constant as new API but shipped
|
|
209
|
+
it to Rust only, leaving a JS consumer reading or writing a variant container
|
|
210
|
+
to spell `"value"` itself — a hardcoded copy of the one value whose purpose is
|
|
211
|
+
to not be hardcoded, at the seam where the two can drift unobserved, since the
|
|
212
|
+
key crosses the boundary inside untyped container data. The `.d.ts` types it as
|
|
213
|
+
the string *literal*, which `string` would stop narrowing an index into the
|
|
214
|
+
container. `known_names_drift.rs` pins both spellings against the Rust
|
|
215
|
+
constant, the guard the hand-spelled name tables beside it already carry.
|
|
216
|
+
`VariantFields` stays Rust-only: it is a type alias the TypeScript surface
|
|
217
|
+
already inlines as `QuillFieldSchema.variants`, naming no shape a consumer
|
|
218
|
+
builds.
|
|
219
|
+
- docs: `0.105-to-0.106.md`, the migration guide v0.106.0 shipped without. It
|
|
220
|
+
leads with the region-address shift rather than the three `!` entries: the
|
|
221
|
+
changelog is organized by feature, and the address step is one clause inside a
|
|
222
|
+
long entry while being the item most likely to break a working consumer, since
|
|
223
|
+
`FieldRegion.field` is a bare `string` that no type checker reports a grammar
|
|
224
|
+
change under. The guide states both gates on the step, and points a consumer at
|
|
225
|
+
`doc.pathFor` for the prefix grammar it would otherwise match as a literal —
|
|
226
|
+
with that helper's limit stated, a field name passing through it verbatim.
|
|
227
|
+
`CONTRIBUTING.md` gains the two rules that would have caught the gap: `!` marks
|
|
228
|
+
an observable-contract shift even where no type changes, and a release carrying
|
|
229
|
+
one ships its guide.
|
|
230
|
+
- docs: `0.106-to-0.107.md`, this release's guide, under the rule the entry above
|
|
231
|
+
adds. It leads with the region-address index step — `main.refs[0].org` where
|
|
232
|
+
`main.refs` stood, a wrong address rather than a missing one — and then with
|
|
233
|
+
the two schema literals that stop a quill loading, since those read as a build
|
|
234
|
+
that broke rather than as a fix. `ERROR.md` names `display(..)` as the
|
|
235
|
+
address-keyed template-author contract, `plaintext(..)` having been removed
|
|
236
|
+
here.
|
|
237
|
+
|
|
238
|
+
<!-- seed: commits since v0.106.0, confirm the entries above cover them, then delete this comment
|
|
239
|
+
- fix: a container's own `default:` crosses as content, or is refused
|
|
240
|
+
- fix(typst): anchor a `let` alias only where the name is read
|
|
241
|
+
- fix(typst): display validates its schema address
|
|
242
|
+
- fix(docs): point the variants cross-reference at this page's own anchor
|
|
243
|
+
- fix(docs): link canon by URL, not by a path outside the docs tree
|
|
244
|
+
- docs: dense-prose pass over the nesting collapse
|
|
245
|
+
- feat: every type nests at every depth
|
|
246
|
+
- docs: dense-prose pass over the two address walks
|
|
247
|
+
- feat(typst)!: the span scan takes the index step, so a row cell read anchors on the cell
|
|
248
|
+
- fix: a nested content leaf's `default:` reaches the plate
|
|
249
|
+
- docs: dense-prose pass over the address-grammar pin
|
|
250
|
+
- test: pin the schema address grammar across both backends
|
|
251
|
+
- Carry the prose style in CLAUDE.md at minimum size
|
|
252
|
+
- Drop two CLAUDE.md lines that steer toward defaults
|
|
253
|
+
- Cut the rules that steer toward defaults
|
|
254
|
+
- docs: dense-prose pass over the lowering walk
|
|
255
|
+
- Cut two lines that restated defaults
|
|
256
|
+
- Rewrite dense-prose as a project-agnostic skill
|
|
257
|
+
- feat!: a variant carries any leaf type, prose and dates included
|
|
258
|
+
- refactor(typst)!: delete the `plaintext(field)` projection
|
|
259
|
+
- feat(typst)!: depth-invariant lowering, and `date` as a native `datetime`
|
|
260
|
+
- docs: dense-prose pass over the alias pass
|
|
261
|
+
- docs: a bound read keeps its address, and what still needs a claim
|
|
262
|
+
- fix(typst): disqualify aliases on a wildcard import in either order
|
|
263
|
+
- feat(typst): follow a single-assignment `let` alias to its schema address
|
|
264
|
+
- feat(wasm): export VARIANT_DISCRIMINANT_KEY to the runtime surface
|
|
265
|
+
- docs: the 0.105 → 0.106 migration guide, and the rules that missed it
|
|
266
|
+
-->
|
|
267
|
+
|
|
268
|
+
|
|
3
269
|
## v0.106.0 - 2026-08-16
|
|
4
270
|
|
|
5
271
|
- feat(typst,pdfform): a schema address may step one property into a declared
|
|
@@ -122,22 +388,6 @@
|
|
|
122
388
|
names, which PyPI rejected the sdist for lacking. v0.104.0 and v0.105.0 are
|
|
123
389
|
wheels only.
|
|
124
390
|
|
|
125
|
-
<!-- seed: commits since v0.105.0, confirm the entries above cover them, then delete this comment
|
|
126
|
-
- chore(repo): union-merge CHANGELOG.md
|
|
127
|
-
- feat: migrate usaf_memo to enum variants, document the axis
|
|
128
|
-
- feat(core): enum variants — fields that exist only for one enum value
|
|
129
|
-
- fix(fixtures): drop the rule under the indorsement date
|
|
130
|
-
- fix(fixtures): size the indorsement date widget in ems, not inches
|
|
131
|
-
- fix(fixtures): set the memo's indorsement date widget like a date
|
|
132
|
-
- feat(typst,pdf): font, size, and align on injected form fields
|
|
133
|
-
- Make the usaf_memo indorsement's blank date a bound fill-in widget
|
|
134
|
-
- Compress the field-region prose
|
|
135
|
-
- Add `field-region` so plates can tie composed content to a field
|
|
136
|
-
- fix(python): declare license-files so the sdist ships its LICENSE
|
|
137
|
-
- Anchor an undeclared property at the property, not at a bare name
|
|
138
|
-
-->
|
|
139
|
-
|
|
140
|
-
|
|
141
391
|
## v0.105.0 - 2026-08-14
|
|
142
392
|
|
|
143
393
|
- feat(core,wasm,python)!: a `Content` nested inside a composite field is
|
|
Binary file
|
|
Binary file
|
package/core/wasm_bg.wasm
CHANGED
|
Binary file
|
package/package.json
CHANGED
package/runtime/runtime.d.ts
CHANGED
|
@@ -84,6 +84,16 @@ import type { CardAddr } from '../core/wasm.js';
|
|
|
84
84
|
*/
|
|
85
85
|
export declare const MAIN_CARD_ADDR: CardAddr;
|
|
86
86
|
|
|
87
|
+
/**
|
|
88
|
+
* The key carrying the discriminant inside a variant-bearing enum's value. A
|
|
89
|
+
* field declaring `variants:` rests as `{value: <member>, …that member's
|
|
90
|
+
* fields}`, so reading or writing one means naming this key; it crosses the
|
|
91
|
+
* boundary inside untyped container data, with no type to read it off.
|
|
92
|
+
* Reserved: no variant may declare a field under it, and
|
|
93
|
+
* {@link QuillFieldSchema.variants}, keyed by member, never contains it.
|
|
94
|
+
*/
|
|
95
|
+
export declare const VARIANT_DISCRIMINANT_KEY: 'value';
|
|
96
|
+
|
|
87
97
|
// Core-build types consumers read off `Quill`/`Document`.
|
|
88
98
|
export type {
|
|
89
99
|
Card,
|
package/runtime/runtime.js
CHANGED
|
@@ -206,6 +206,23 @@ async function instantiateCore(source) {
|
|
|
206
206
|
*/
|
|
207
207
|
export const MAIN_CARD_ADDR = Object.freeze({});
|
|
208
208
|
|
|
209
|
+
// ── The variant discriminant key ────────────────────────────────────────────
|
|
210
|
+
/**
|
|
211
|
+
* The key carrying the discriminant inside a variant-bearing enum's value.
|
|
212
|
+
*
|
|
213
|
+
* A field declaring `variants:` rests as a container, `{value: <member>, …that
|
|
214
|
+
* member's fields}`, so reading or writing one means naming this key:
|
|
215
|
+
* `doc.storeFields(MAIN_CARD_ADDR, { classification: { [VARIANT_DISCRIMINANT_KEY]: 'CUI' } })`.
|
|
216
|
+
* It crosses the boundary inside untyped container data, with no type to read
|
|
217
|
+
* it off.
|
|
218
|
+
*
|
|
219
|
+
* Reserved: no variant may declare a field under it
|
|
220
|
+
* (`quill::variant_reserved_field_name`), and `QuillFieldSchema.variants`,
|
|
221
|
+
* keyed by member, never contains it.
|
|
222
|
+
* @type {'value'}
|
|
223
|
+
*/
|
|
224
|
+
export const VARIANT_DISCRIMINANT_KEY = 'value';
|
|
225
|
+
|
|
209
226
|
/**
|
|
210
227
|
* Narrow an unknown caught value to a `QuillmarkError`, the error every
|
|
211
228
|
* fallible method in this package throws: a real `Error` with a non-empty
|