@quillmark/wasm 0.91.0 → 0.92.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 +65 -29
- package/README.md +3 -4
- package/backends/typst/wasm.d.ts +86 -47
- package/backends/typst/wasm_bg.js +76 -21
- package/backends/typst/wasm_bg.wasm +0 -0
- package/backends/typst/wasm_bg.wasm.d.ts +3 -1
- package/core/wasm.d.ts +62 -23
- package/core/wasm_bg.js +76 -21
- package/core/wasm_bg.wasm +0 -0
- package/core/wasm_bg.wasm.d.ts +3 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,46 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## v0.92.0 - 2026-06-22
|
|
4
|
+
|
|
5
|
+
- 0.92 technical-debt sweep: correctness, $seed hardening, de-duplication (#727)
|
|
6
|
+
- dotnet: add $seed namespace writers (parity with Python/WASM)
|
|
7
|
+
- refactor(core): unify $ext/$seed into one out-of-band Meta concept
|
|
8
|
+
- Cleanup: simplify QuillWorld::font to a single expression
|
|
9
|
+
- Cleanup: de-narrate comments, sync canon binding tables with .NET
|
|
10
|
+
- dotnet: fix stale schema version (CI) + review-flagged polish
|
|
11
|
+
- docs(migration): cover the !fill → !must_fill rename in the 0.92 guide
|
|
12
|
+
- dotnet: fix native-lib copy to test project + two correctness bugs
|
|
13
|
+
- Remove Document.seed(kind) for strict ext/seed symmetry
|
|
14
|
+
- dotnet: expose $seed on the Card DTO
|
|
15
|
+
- refactor(dotnet): rename engine class Quillmark -> QuillmarkEngine
|
|
16
|
+
- Reject !fill: treat as a noncanonical tag, not a fill alias
|
|
17
|
+
- Fix binding build break + warn on unsupported fill positions
|
|
18
|
+
- fix(dotnet): resolve engine type in test namespace (CS0426)
|
|
19
|
+
- docs(dotnet): trim README to a dense, consumer-focused surface
|
|
20
|
+
- Address review nits: loud divergence, docs, coverage
|
|
21
|
+
- Add storage schema 0.92.0: persist nested !must_fill
|
|
22
|
+
- docs(canon): consolidate binding overviews into BINDINGS.md
|
|
23
|
+
- feat($seed): reject $seed on composable cards (root-only, like $quill)
|
|
24
|
+
- docs: move dotnet binding into canon, delete DESIGN.md
|
|
25
|
+
- docs: reframe QmBytes by-value return as a tested assumption, not a defect
|
|
26
|
+
- Carry nested !must_fill across the live wire (CardWire)
|
|
27
|
+
- Address review: trap FFI panics, fix depth-limit asymmetry, Equals contract
|
|
28
|
+
- Detect nested !must_fill on sequence-item inline first key
|
|
29
|
+
- docs($seed): correct two claims flagged in review
|
|
30
|
+
- Fix invalid '--' inside XML comment in Quillmark.csproj
|
|
31
|
+
- fix(docs): drop canon links that break mkdocs --strict
|
|
32
|
+
- Promote .NET binding: CI test job, NuGet release, first-class docs
|
|
33
|
+
- Spike: .NET binding symmetrical to the Python binding
|
|
34
|
+
- Capture and round-trip nested !must_fill markers
|
|
35
|
+
- Make QuillValue an annotated value tree (fill on nodes)
|
|
36
|
+
- fix(bindings): bump currentSchemaVersion to 0.92.0; add $seed JS test
|
|
37
|
+
- Rename !fill tag to !must_fill (accept !fill as deprecated alias)
|
|
38
|
+
- docs($seed): document the per-kind seed-overlay key across canon and spec
|
|
39
|
+
- test($seed): cover parse/emit/storage, overlay layering, advisory validation
|
|
40
|
+
- feat(core): first-class $seed key for per-card-kind seed overlays
|
|
41
|
+
- Remove RenderSession and canvas-preview APIs from Python binding (#722)
|
|
42
|
+
|
|
43
|
+
|
|
3
44
|
## v0.91.0 - 2026-06-17
|
|
4
45
|
|
|
5
46
|
- Upgrade Typst backend to 0.15 (#720)
|
|
@@ -9,35 +50,6 @@
|
|
|
9
50
|
|
|
10
51
|
## v0.90.0 - 2026-06-10
|
|
11
52
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
## v0.89.1 - 2026-06-10
|
|
15
|
-
|
|
16
|
-
- chore(release): v0.89.1-rc.1 (#714)
|
|
17
|
-
- feat(wasm)!: 0.90 canonical API — engine-free Quill, single root export, typed errors; Python parity (#713)
|
|
18
|
-
- Proposal: WASM bindings split (core + render) via backend-decoupled Quill (#710)
|
|
19
|
-
- Add version selector matching and mismatch warnings (#708)
|
|
20
|
-
- docs: density-optimization pass on user-facing docs (#703)
|
|
21
|
-
- Remove role annotation from root block metadata header (#707)
|
|
22
|
-
- canon: audit and correct all prose/canon/ docs (#704)
|
|
23
|
-
- Fix makeCard fields/body typed as required in WASM .d.ts (#702)
|
|
24
|
-
- Update CLAUDE.md
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
## v0.89.1-rc.1 - 2026-06-10
|
|
28
|
-
|
|
29
|
-
- feat(wasm)!: 0.90 canonical API — engine-free Quill, single root export, typed errors; Python parity (#713)
|
|
30
|
-
- Proposal: WASM bindings split (core + render) via backend-decoupled Quill (#710)
|
|
31
|
-
- Add version selector matching and mismatch warnings (#708)
|
|
32
|
-
- docs: density-optimization pass on user-facing docs (#703)
|
|
33
|
-
- Remove role annotation from root block metadata header (#707)
|
|
34
|
-
- canon: audit and correct all prose/canon/ docs (#704)
|
|
35
|
-
- Fix makeCard fields/body typed as required in WASM .d.ts (#702)
|
|
36
|
-
- Update CLAUDE.md
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
## Unreleased
|
|
40
|
-
|
|
41
53
|
- **Breaking (Rust API + bindings):** `Quill` is now engine-free, validated
|
|
42
54
|
data. It no longer holds a backend; the `Quillmark` engine becomes a backend
|
|
43
55
|
registry + render dispatcher. Rendering and capability move onto the engine:
|
|
@@ -134,6 +146,30 @@
|
|
|
134
146
|
bindings now use `unchecked_optional_param_type`. Callers can build a bare
|
|
135
147
|
card with `Document.makeCard('kind')`.
|
|
136
148
|
|
|
149
|
+
## v0.89.1 - 2026-06-10
|
|
150
|
+
|
|
151
|
+
- chore(release): v0.89.1-rc.1 (#714)
|
|
152
|
+
- feat(wasm)!: 0.90 canonical API — engine-free Quill, single root export, typed errors; Python parity (#713)
|
|
153
|
+
- Proposal: WASM bindings split (core + render) via backend-decoupled Quill (#710)
|
|
154
|
+
- Add version selector matching and mismatch warnings (#708)
|
|
155
|
+
- docs: density-optimization pass on user-facing docs (#703)
|
|
156
|
+
- Remove role annotation from root block metadata header (#707)
|
|
157
|
+
- canon: audit and correct all prose/canon/ docs (#704)
|
|
158
|
+
- Fix makeCard fields/body typed as required in WASM .d.ts (#702)
|
|
159
|
+
- Update CLAUDE.md
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
## v0.89.1-rc.1 - 2026-06-10
|
|
163
|
+
|
|
164
|
+
- feat(wasm)!: 0.90 canonical API — engine-free Quill, single root export, typed errors; Python parity (#713)
|
|
165
|
+
- Proposal: WASM bindings split (core + render) via backend-decoupled Quill (#710)
|
|
166
|
+
- Add version selector matching and mismatch warnings (#708)
|
|
167
|
+
- docs: density-optimization pass on user-facing docs (#703)
|
|
168
|
+
- Remove role annotation from root block metadata header (#707)
|
|
169
|
+
- canon: audit and correct all prose/canon/ docs (#704)
|
|
170
|
+
- Fix makeCard fields/body typed as required in WASM .d.ts (#702)
|
|
171
|
+
- Update CLAUDE.md
|
|
172
|
+
|
|
137
173
|
## v0.88.0 - 2026-06-05
|
|
138
174
|
|
|
139
175
|
- **Breaking (bindings + Rust API):** a single canonical **`Card` wire shape** now
|
package/README.md
CHANGED
|
@@ -329,10 +329,9 @@ A field's *cell* is inferred from whether its schema declares a `default:`:
|
|
|
329
329
|
default value followed by a `; delete-ok` annotation, and the default
|
|
330
330
|
is used when the document omits the field.
|
|
331
331
|
|
|
332
|
-
`QuillFieldSchema` no
|
|
333
|
-
`validation::
|
|
334
|
-
`validation::
|
|
335
|
-
code covers unreplaced sentinels.
|
|
332
|
+
`QuillFieldSchema` has no `required` axis. Absent Unendorsed fields emit
|
|
333
|
+
`validation::field_absent`; a surviving `<must-fill>` sentinel emits
|
|
334
|
+
`validation::must_fill_sentinel`.
|
|
336
335
|
|
|
337
336
|
### Errors
|
|
338
337
|
|
package/backends/typst/wasm.d.ts
CHANGED
|
@@ -1,6 +1,52 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* A path to a value nested inside a field `value`: `string` keys and
|
|
6
|
+
* `number` array indices, e.g. `["addr", "street"]` or `["recipients", 0, "name"]`.
|
|
7
|
+
*/
|
|
8
|
+
export type PathStep = string | number;
|
|
9
|
+
|
|
10
|
+
/** A field or comment entry in a `Card.payloadItems` list. */
|
|
11
|
+
export type PayloadItem =
|
|
12
|
+
| {
|
|
13
|
+
type: "field";
|
|
14
|
+
key: string;
|
|
15
|
+
value: unknown;
|
|
16
|
+
fill?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Paths to `!must_fill` markers nested *inside* `value` (the `value`
|
|
19
|
+
* projection itself is fill-free). Absent when the field has no nested
|
|
20
|
+
* placeholders. Preserved across `pushCard` / `makeCard`.
|
|
21
|
+
*/
|
|
22
|
+
nestedFills?: PathStep[][];
|
|
23
|
+
}
|
|
24
|
+
| { type: "comment"; text: string; inline?: boolean };
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* A single card block. The one shape exchanged in both directions: returned by
|
|
28
|
+
* `Document.main` / `Document.cards` / `Document.removeCard` / `Quill.seedCard`,
|
|
29
|
+
* and accepted by `Document.pushCard` / `Document.insertCard`. Build a fresh
|
|
30
|
+
* one with `Document.makeCard`.
|
|
31
|
+
*
|
|
32
|
+
* `$` system entries are hoisted to named fields: `kind` (the `$kind`, empty
|
|
33
|
+
* string when none), optional `quill` (the `$quill` `name@version`, main card
|
|
34
|
+
* only), optional `id` (`$id`), optional `ext` (`$ext`), and optional `seed`
|
|
35
|
+
* (the `$seed` per-kind overlay map, main card only). `payloadItems` carries
|
|
36
|
+
* user fields and comments in order.
|
|
37
|
+
*/
|
|
38
|
+
export interface Card {
|
|
39
|
+
kind: string;
|
|
40
|
+
quill?: string;
|
|
41
|
+
id?: string;
|
|
42
|
+
ext?: Record<string, unknown>;
|
|
43
|
+
seed?: Record<string, unknown>;
|
|
44
|
+
payloadItems: PayloadItem[];
|
|
45
|
+
body: string;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
4
50
|
/**
|
|
5
51
|
* Page dimensions in Typst points (1 pt = 1/72 inch).
|
|
6
52
|
*
|
|
@@ -72,33 +118,6 @@ export interface PaintResult {
|
|
|
72
118
|
|
|
73
119
|
|
|
74
120
|
|
|
75
|
-
/** A field or comment entry in a `Card.payloadItems` list. */
|
|
76
|
-
export type PayloadItem =
|
|
77
|
-
| { type: "field"; key: string; value: unknown; fill?: boolean }
|
|
78
|
-
| { type: "comment"; text: string; inline?: boolean };
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* A single card block. The one shape exchanged in both directions: returned by
|
|
82
|
-
* `Document.main` / `Document.cards` / `Document.removeCard` / `Quill.seedCard`,
|
|
83
|
-
* and accepted by `Document.pushCard` / `Document.insertCard`. Build a fresh
|
|
84
|
-
* one with `Document.makeCard`.
|
|
85
|
-
*
|
|
86
|
-
* `$` system entries are hoisted to named fields: `kind` (the `$kind`, empty
|
|
87
|
-
* string when none), optional `quill` (the `$quill` `name@version`, main card
|
|
88
|
-
* only), optional `id` (`$id`), and optional `ext` (`$ext`). `payloadItems`
|
|
89
|
-
* carries user fields and comments in order.
|
|
90
|
-
*/
|
|
91
|
-
export interface Card {
|
|
92
|
-
kind: string;
|
|
93
|
-
quill?: string;
|
|
94
|
-
id?: string;
|
|
95
|
-
ext?: Record<string, unknown>;
|
|
96
|
-
payloadItems: PayloadItem[];
|
|
97
|
-
body: string;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
121
|
/** UI layout hints for a single field. */
|
|
103
122
|
export interface QuillFieldUi {
|
|
104
123
|
group?: string;
|
|
@@ -227,8 +246,9 @@ export class Document {
|
|
|
227
246
|
[Symbol.dispose](): void;
|
|
228
247
|
/**
|
|
229
248
|
* Authoring-ergonomics header introducing a blueprint to an LLM/MCP
|
|
230
|
-
* consumer for the given `quillName`.
|
|
231
|
-
*
|
|
249
|
+
* consumer for the given `quillName`. Re-exposes core's canonical text for
|
|
250
|
+
* JS consumers; any surface that draws from the same core source stays
|
|
251
|
+
* uniform.
|
|
232
252
|
*/
|
|
233
253
|
static blueprintInstruction(quill_name: string): string;
|
|
234
254
|
clone(): Document;
|
|
@@ -244,16 +264,17 @@ export class Document {
|
|
|
244
264
|
*/
|
|
245
265
|
equals(other: Document): boolean;
|
|
246
266
|
/**
|
|
247
|
-
* Render a Diagnostic as the canonical pretty-printed text
|
|
248
|
-
*
|
|
267
|
+
* Render a Diagnostic as the canonical pretty-printed text (core's
|
|
268
|
+
* `Diagnostic::fmt_pretty`). Single source of truth so a Diagnostic looks
|
|
249
269
|
* identical no matter which consumer surfaces it.
|
|
250
270
|
*/
|
|
251
271
|
static formatDiagnostic(diag: Diagnostic): string;
|
|
252
272
|
/**
|
|
253
|
-
* Authoring-format rules for the card-yaml markdown surface
|
|
254
|
-
* text
|
|
255
|
-
*
|
|
256
|
-
* startup and cache; the value never changes
|
|
273
|
+
* Authoring-format rules for the card-yaml markdown surface. The canonical
|
|
274
|
+
* text is core's (`quillmark_core::document::FORMAT_RULES`), re-exposed
|
|
275
|
+
* here for JS consumers so it matches any other surface that draws from the
|
|
276
|
+
* same source. Read once at startup and cache; the value never changes
|
|
277
|
+
* between calls.
|
|
257
278
|
*/
|
|
258
279
|
static formatRules(): string;
|
|
259
280
|
/**
|
|
@@ -294,11 +315,11 @@ export class Document {
|
|
|
294
315
|
*/
|
|
295
316
|
pushCard(card: Card): void;
|
|
296
317
|
/**
|
|
297
|
-
* The canonical `$quill` reference grammar as author-facing text.
|
|
298
|
-
* source of truth
|
|
299
|
-
*
|
|
300
|
-
*
|
|
301
|
-
*
|
|
318
|
+
* The canonical `$quill` reference grammar as author-facing text. Core is
|
|
319
|
+
* the single source of truth: drive schema `describe` and validation
|
|
320
|
+
* messages from this instead of re-stating the rule — it matches the
|
|
321
|
+
* `hint` on `parse::invalid_quill_reference`. Cache it; the value never
|
|
322
|
+
* changes.
|
|
302
323
|
*/
|
|
303
324
|
static quillRefHint(): string;
|
|
304
325
|
removeCard(index: number): Card | undefined;
|
|
@@ -338,6 +359,12 @@ export class Document {
|
|
|
338
359
|
* `undefined`. Throws if `name` does not match `[a-z_][a-z0-9_]*`.
|
|
339
360
|
*/
|
|
340
361
|
removeField(name: string): any;
|
|
362
|
+
/**
|
|
363
|
+
* Remove `cardKind` from the main card's `$seed` map, returning its
|
|
364
|
+
* overlay or `undefined`; drops `$seed` entirely once empty. Sibling
|
|
365
|
+
* kinds survive.
|
|
366
|
+
*/
|
|
367
|
+
removeSeedNamespace(card_kind: string): any;
|
|
341
368
|
replaceBody(body: string): void;
|
|
342
369
|
/**
|
|
343
370
|
* Read the `schema` version tag from a raw storage DTO string without a
|
|
@@ -379,13 +406,13 @@ export class Document {
|
|
|
379
406
|
*/
|
|
380
407
|
setExtNamespace(namespace: string, value: any): void;
|
|
381
408
|
/**
|
|
382
|
-
* Update a payload field on the main card. Clears any existing `!
|
|
409
|
+
* Update a payload field on the main card. Clears any existing `!must_fill` marker.
|
|
383
410
|
*
|
|
384
411
|
* Throws if `name` does not match `[a-z_][a-z0-9_]*`.
|
|
385
412
|
*/
|
|
386
413
|
setField(name: string, value: any): void;
|
|
387
414
|
/**
|
|
388
|
-
* Update a payload field on the main card and mark it as `!
|
|
415
|
+
* Update a payload field on the main card and mark it as `!must_fill`.
|
|
389
416
|
* Throws on invalid name (see [`setField`](Document::set_field)).
|
|
390
417
|
*/
|
|
391
418
|
setFill(name: string, value: any): void;
|
|
@@ -393,6 +420,13 @@ export class Document {
|
|
|
393
420
|
* Replace the QUILL reference string. Throws if `ref_str` is invalid.
|
|
394
421
|
*/
|
|
395
422
|
setQuillRef(ref_str: string): void;
|
|
423
|
+
/**
|
|
424
|
+
* Merge a card-kind's seed `overlay` into the main card's `$seed` map
|
|
425
|
+
* under `cardKind`, preserving sibling kinds. Sets the starting values
|
|
426
|
+
* new cards of that kind spawn with. Throws if `overlay` cannot be
|
|
427
|
+
* serialized or nests too deep.
|
|
428
|
+
*/
|
|
429
|
+
setSeedNamespace(card_kind: string, overlay: any): void;
|
|
396
430
|
/**
|
|
397
431
|
* Serialize this document to a versioned storage DTO string.
|
|
398
432
|
*
|
|
@@ -456,12 +490,17 @@ export class Quill {
|
|
|
456
490
|
static fromTree(tree: Map<string, Uint8Array>): Quill;
|
|
457
491
|
/**
|
|
458
492
|
* Seed a starter composable `Card` of the given kind (carries `$kind`),
|
|
459
|
-
*
|
|
460
|
-
* absent. Returns `undefined` if `cardKind`
|
|
461
|
-
* quill's schema, else a `Card` that feeds
|
|
462
|
-
* `Document.pushCard` / `insertCard`.
|
|
493
|
+
* layering an optional per-kind seed `overlay` over the schema-example
|
|
494
|
+
* base (`overlay › example › absent`). Returns `undefined` if `cardKind`
|
|
495
|
+
* is not declared in this quill's schema, else a `Card` that feeds
|
|
496
|
+
* straight into `Document.pushCard` / `insertCard`.
|
|
497
|
+
*
|
|
498
|
+
* Pass `document.main.seed?.[cardKind]` as `overlay` so a card added to a
|
|
499
|
+
* template-derived document inherits its curated starting values; omit it
|
|
500
|
+
* (or pass `undefined` / `null`) for the bare schema seed. `overlay` is a
|
|
501
|
+
* plain object — this reads the document, it does not mutate it.
|
|
463
502
|
*/
|
|
464
|
-
seedCard(card_kind: string): Card | undefined;
|
|
503
|
+
seedCard(card_kind: string, overlay: Record<string, unknown> | undefined): Card | undefined;
|
|
465
504
|
/**
|
|
466
505
|
* Seed a starter `Document` from the schema — the main card plus one
|
|
467
506
|
* instance of each composable card kind, each committing its fields'
|
|
@@ -21,8 +21,9 @@ export class Document {
|
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
23
|
* Authoring-ergonomics header introducing a blueprint to an LLM/MCP
|
|
24
|
-
* consumer for the given `quillName`.
|
|
25
|
-
*
|
|
24
|
+
* consumer for the given `quillName`. Re-exposes core's canonical text for
|
|
25
|
+
* JS consumers; any surface that draws from the same core source stays
|
|
26
|
+
* uniform.
|
|
26
27
|
* @param {string} quill_name
|
|
27
28
|
* @returns {string}
|
|
28
29
|
*/
|
|
@@ -111,8 +112,8 @@ export class Document {
|
|
|
111
112
|
return ret !== 0;
|
|
112
113
|
}
|
|
113
114
|
/**
|
|
114
|
-
* Render a Diagnostic as the canonical pretty-printed text
|
|
115
|
-
*
|
|
115
|
+
* Render a Diagnostic as the canonical pretty-printed text (core's
|
|
116
|
+
* `Diagnostic::fmt_pretty`). Single source of truth so a Diagnostic looks
|
|
116
117
|
* identical no matter which consumer surfaces it.
|
|
117
118
|
* @param {Diagnostic} diag
|
|
118
119
|
* @returns {string}
|
|
@@ -134,10 +135,11 @@ export class Document {
|
|
|
134
135
|
}
|
|
135
136
|
}
|
|
136
137
|
/**
|
|
137
|
-
* Authoring-format rules for the card-yaml markdown surface
|
|
138
|
-
* text
|
|
139
|
-
*
|
|
140
|
-
* startup and cache; the value never changes
|
|
138
|
+
* Authoring-format rules for the card-yaml markdown surface. The canonical
|
|
139
|
+
* text is core's (`quillmark_core::document::FORMAT_RULES`), re-exposed
|
|
140
|
+
* here for JS consumers so it matches any other surface that draws from the
|
|
141
|
+
* same source. Read once at startup and cache; the value never changes
|
|
142
|
+
* between calls.
|
|
141
143
|
* @returns {string}
|
|
142
144
|
*/
|
|
143
145
|
static formatRules() {
|
|
@@ -332,11 +334,11 @@ export class Document {
|
|
|
332
334
|
}
|
|
333
335
|
}
|
|
334
336
|
/**
|
|
335
|
-
* The canonical `$quill` reference grammar as author-facing text.
|
|
336
|
-
* source of truth
|
|
337
|
-
*
|
|
338
|
-
*
|
|
339
|
-
*
|
|
337
|
+
* The canonical `$quill` reference grammar as author-facing text. Core is
|
|
338
|
+
* the single source of truth: drive schema `describe` and validation
|
|
339
|
+
* messages from this instead of re-stating the rule — it matches the
|
|
340
|
+
* `hint` on `parse::invalid_quill_reference`. Cache it; the value never
|
|
341
|
+
* changes.
|
|
340
342
|
* @returns {string}
|
|
341
343
|
*/
|
|
342
344
|
static quillRefHint() {
|
|
@@ -515,6 +517,30 @@ export class Document {
|
|
|
515
517
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
516
518
|
}
|
|
517
519
|
}
|
|
520
|
+
/**
|
|
521
|
+
* Remove `cardKind` from the main card's `$seed` map, returning its
|
|
522
|
+
* overlay or `undefined`; drops `$seed` entirely once empty. Sibling
|
|
523
|
+
* kinds survive.
|
|
524
|
+
* @param {string} card_kind
|
|
525
|
+
* @returns {any}
|
|
526
|
+
*/
|
|
527
|
+
removeSeedNamespace(card_kind) {
|
|
528
|
+
try {
|
|
529
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
530
|
+
const ptr0 = passStringToWasm0(card_kind, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
531
|
+
const len0 = WASM_VECTOR_LEN;
|
|
532
|
+
wasm.document_removeSeedNamespace(retptr, this.__wbg_ptr, ptr0, len0);
|
|
533
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
534
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
535
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
536
|
+
if (r2) {
|
|
537
|
+
throw takeObject(r1);
|
|
538
|
+
}
|
|
539
|
+
return takeObject(r0);
|
|
540
|
+
} finally {
|
|
541
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
542
|
+
}
|
|
543
|
+
}
|
|
518
544
|
/**
|
|
519
545
|
* @param {string} body
|
|
520
546
|
*/
|
|
@@ -658,7 +684,7 @@ export class Document {
|
|
|
658
684
|
}
|
|
659
685
|
}
|
|
660
686
|
/**
|
|
661
|
-
* Update a payload field on the main card. Clears any existing `!
|
|
687
|
+
* Update a payload field on the main card. Clears any existing `!must_fill` marker.
|
|
662
688
|
*
|
|
663
689
|
* Throws if `name` does not match `[a-z_][a-z0-9_]*`.
|
|
664
690
|
* @param {string} name
|
|
@@ -680,7 +706,7 @@ export class Document {
|
|
|
680
706
|
}
|
|
681
707
|
}
|
|
682
708
|
/**
|
|
683
|
-
* Update a payload field on the main card and mark it as `!
|
|
709
|
+
* Update a payload field on the main card and mark it as `!must_fill`.
|
|
684
710
|
* Throws on invalid name (see [`setField`](Document::set_field)).
|
|
685
711
|
* @param {string} name
|
|
686
712
|
* @param {any} value
|
|
@@ -719,6 +745,29 @@ export class Document {
|
|
|
719
745
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
720
746
|
}
|
|
721
747
|
}
|
|
748
|
+
/**
|
|
749
|
+
* Merge a card-kind's seed `overlay` into the main card's `$seed` map
|
|
750
|
+
* under `cardKind`, preserving sibling kinds. Sets the starting values
|
|
751
|
+
* new cards of that kind spawn with. Throws if `overlay` cannot be
|
|
752
|
+
* serialized or nests too deep.
|
|
753
|
+
* @param {string} card_kind
|
|
754
|
+
* @param {any} overlay
|
|
755
|
+
*/
|
|
756
|
+
setSeedNamespace(card_kind, overlay) {
|
|
757
|
+
try {
|
|
758
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
759
|
+
const ptr0 = passStringToWasm0(card_kind, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
760
|
+
const len0 = WASM_VECTOR_LEN;
|
|
761
|
+
wasm.document_setSeedNamespace(retptr, this.__wbg_ptr, ptr0, len0, addHeapObject(overlay));
|
|
762
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
763
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
764
|
+
if (r1) {
|
|
765
|
+
throw takeObject(r0);
|
|
766
|
+
}
|
|
767
|
+
} finally {
|
|
768
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
769
|
+
}
|
|
770
|
+
}
|
|
722
771
|
/**
|
|
723
772
|
* Serialize this document to a versioned storage DTO string.
|
|
724
773
|
*
|
|
@@ -976,19 +1025,25 @@ export class Quill {
|
|
|
976
1025
|
}
|
|
977
1026
|
/**
|
|
978
1027
|
* Seed a starter composable `Card` of the given kind (carries `$kind`),
|
|
979
|
-
*
|
|
980
|
-
* absent. Returns `undefined` if `cardKind`
|
|
981
|
-
* quill's schema, else a `Card` that feeds
|
|
982
|
-
* `Document.pushCard` / `insertCard`.
|
|
1028
|
+
* layering an optional per-kind seed `overlay` over the schema-example
|
|
1029
|
+
* base (`overlay › example › absent`). Returns `undefined` if `cardKind`
|
|
1030
|
+
* is not declared in this quill's schema, else a `Card` that feeds
|
|
1031
|
+
* straight into `Document.pushCard` / `insertCard`.
|
|
1032
|
+
*
|
|
1033
|
+
* Pass `document.main.seed?.[cardKind]` as `overlay` so a card added to a
|
|
1034
|
+
* template-derived document inherits its curated starting values; omit it
|
|
1035
|
+
* (or pass `undefined` / `null`) for the bare schema seed. `overlay` is a
|
|
1036
|
+
* plain object — this reads the document, it does not mutate it.
|
|
983
1037
|
* @param {string} card_kind
|
|
1038
|
+
* @param {Record<string, unknown> | undefined} overlay
|
|
984
1039
|
* @returns {Card | undefined}
|
|
985
1040
|
*/
|
|
986
|
-
seedCard(card_kind) {
|
|
1041
|
+
seedCard(card_kind, overlay) {
|
|
987
1042
|
try {
|
|
988
1043
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
989
1044
|
const ptr0 = passStringToWasm0(card_kind, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
990
1045
|
const len0 = WASM_VECTOR_LEN;
|
|
991
|
-
wasm.quill_seedCard(retptr, this.__wbg_ptr, ptr0, len0);
|
|
1046
|
+
wasm.quill_seedCard(retptr, this.__wbg_ptr, ptr0, len0, addHeapObject(overlay));
|
|
992
1047
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
993
1048
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
994
1049
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
Binary file
|
|
@@ -29,6 +29,7 @@ export const document_removeCardField: (a: number, b: number, c: number, d: numb
|
|
|
29
29
|
export const document_removeExt: (a: number, b: number) => void;
|
|
30
30
|
export const document_removeExtNamespace: (a: number, b: number, c: number, d: number) => void;
|
|
31
31
|
export const document_removeField: (a: number, b: number, c: number, d: number) => void;
|
|
32
|
+
export const document_removeSeedNamespace: (a: number, b: number, c: number, d: number) => void;
|
|
32
33
|
export const document_replaceBody: (a: number, b: number, c: number) => void;
|
|
33
34
|
export const document_schemaVersionOf: (a: number, b: number, c: number) => void;
|
|
34
35
|
export const document_setCardExt: (a: number, b: number, c: number, d: number) => void;
|
|
@@ -39,6 +40,7 @@ export const document_setExtNamespace: (a: number, b: number, c: number, d: numb
|
|
|
39
40
|
export const document_setField: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
40
41
|
export const document_setFill: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
41
42
|
export const document_setQuillRef: (a: number, b: number, c: number, d: number) => void;
|
|
43
|
+
export const document_setSeedNamespace: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
42
44
|
export const document_toJson: (a: number, b: number) => void;
|
|
43
45
|
export const document_toMarkdown: (a: number, b: number) => void;
|
|
44
46
|
export const document_tryFromJson: (a: number, b: number) => number;
|
|
@@ -51,7 +53,7 @@ export const quill_blueprint: (a: number, b: number) => void;
|
|
|
51
53
|
export const quill_fromTree: (a: number, b: number) => void;
|
|
52
54
|
export const quill_metadata: (a: number, b: number) => void;
|
|
53
55
|
export const quill_schema: (a: number, b: number) => void;
|
|
54
|
-
export const quill_seedCard: (a: number, b: number, c: number, d: number) => void;
|
|
56
|
+
export const quill_seedCard: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
55
57
|
export const quill_seedDocument: (a: number) => number;
|
|
56
58
|
export const quill_seedMain: (a: number, b: number) => void;
|
|
57
59
|
export const quill_toTree: (a: number) => number;
|
package/core/wasm.d.ts
CHANGED
|
@@ -1,9 +1,26 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* A path to a value nested inside a field `value`: `string` keys and
|
|
6
|
+
* `number` array indices, e.g. `["addr", "street"]` or `["recipients", 0, "name"]`.
|
|
7
|
+
*/
|
|
8
|
+
export type PathStep = string | number;
|
|
9
|
+
|
|
4
10
|
/** A field or comment entry in a `Card.payloadItems` list. */
|
|
5
11
|
export type PayloadItem =
|
|
6
|
-
| {
|
|
12
|
+
| {
|
|
13
|
+
type: "field";
|
|
14
|
+
key: string;
|
|
15
|
+
value: unknown;
|
|
16
|
+
fill?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Paths to `!must_fill` markers nested *inside* `value` (the `value`
|
|
19
|
+
* projection itself is fill-free). Absent when the field has no nested
|
|
20
|
+
* placeholders. Preserved across `pushCard` / `makeCard`.
|
|
21
|
+
*/
|
|
22
|
+
nestedFills?: PathStep[][];
|
|
23
|
+
}
|
|
7
24
|
| { type: "comment"; text: string; inline?: boolean };
|
|
8
25
|
|
|
9
26
|
/**
|
|
@@ -14,14 +31,16 @@ export type PayloadItem =
|
|
|
14
31
|
*
|
|
15
32
|
* `$` system entries are hoisted to named fields: `kind` (the `$kind`, empty
|
|
16
33
|
* string when none), optional `quill` (the `$quill` `name@version`, main card
|
|
17
|
-
* only), optional `id` (`$id`),
|
|
18
|
-
*
|
|
34
|
+
* only), optional `id` (`$id`), optional `ext` (`$ext`), and optional `seed`
|
|
35
|
+
* (the `$seed` per-kind overlay map, main card only). `payloadItems` carries
|
|
36
|
+
* user fields and comments in order.
|
|
19
37
|
*/
|
|
20
38
|
export interface Card {
|
|
21
39
|
kind: string;
|
|
22
40
|
quill?: string;
|
|
23
41
|
id?: string;
|
|
24
42
|
ext?: Record<string, unknown>;
|
|
43
|
+
seed?: Record<string, unknown>;
|
|
25
44
|
payloadItems: PayloadItem[];
|
|
26
45
|
body: string;
|
|
27
46
|
}
|
|
@@ -134,8 +153,9 @@ export class Document {
|
|
|
134
153
|
[Symbol.dispose](): void;
|
|
135
154
|
/**
|
|
136
155
|
* Authoring-ergonomics header introducing a blueprint to an LLM/MCP
|
|
137
|
-
* consumer for the given `quillName`.
|
|
138
|
-
*
|
|
156
|
+
* consumer for the given `quillName`. Re-exposes core's canonical text for
|
|
157
|
+
* JS consumers; any surface that draws from the same core source stays
|
|
158
|
+
* uniform.
|
|
139
159
|
*/
|
|
140
160
|
static blueprintInstruction(quill_name: string): string;
|
|
141
161
|
clone(): Document;
|
|
@@ -151,16 +171,17 @@ export class Document {
|
|
|
151
171
|
*/
|
|
152
172
|
equals(other: Document): boolean;
|
|
153
173
|
/**
|
|
154
|
-
* Render a Diagnostic as the canonical pretty-printed text
|
|
155
|
-
*
|
|
174
|
+
* Render a Diagnostic as the canonical pretty-printed text (core's
|
|
175
|
+
* `Diagnostic::fmt_pretty`). Single source of truth so a Diagnostic looks
|
|
156
176
|
* identical no matter which consumer surfaces it.
|
|
157
177
|
*/
|
|
158
178
|
static formatDiagnostic(diag: Diagnostic): string;
|
|
159
179
|
/**
|
|
160
|
-
* Authoring-format rules for the card-yaml markdown surface
|
|
161
|
-
* text
|
|
162
|
-
*
|
|
163
|
-
* startup and cache; the value never changes
|
|
180
|
+
* Authoring-format rules for the card-yaml markdown surface. The canonical
|
|
181
|
+
* text is core's (`quillmark_core::document::FORMAT_RULES`), re-exposed
|
|
182
|
+
* here for JS consumers so it matches any other surface that draws from the
|
|
183
|
+
* same source. Read once at startup and cache; the value never changes
|
|
184
|
+
* between calls.
|
|
164
185
|
*/
|
|
165
186
|
static formatRules(): string;
|
|
166
187
|
/**
|
|
@@ -201,11 +222,11 @@ export class Document {
|
|
|
201
222
|
*/
|
|
202
223
|
pushCard(card: Card): void;
|
|
203
224
|
/**
|
|
204
|
-
* The canonical `$quill` reference grammar as author-facing text.
|
|
205
|
-
* source of truth
|
|
206
|
-
*
|
|
207
|
-
*
|
|
208
|
-
*
|
|
225
|
+
* The canonical `$quill` reference grammar as author-facing text. Core is
|
|
226
|
+
* the single source of truth: drive schema `describe` and validation
|
|
227
|
+
* messages from this instead of re-stating the rule — it matches the
|
|
228
|
+
* `hint` on `parse::invalid_quill_reference`. Cache it; the value never
|
|
229
|
+
* changes.
|
|
209
230
|
*/
|
|
210
231
|
static quillRefHint(): string;
|
|
211
232
|
removeCard(index: number): Card | undefined;
|
|
@@ -245,6 +266,12 @@ export class Document {
|
|
|
245
266
|
* `undefined`. Throws if `name` does not match `[a-z_][a-z0-9_]*`.
|
|
246
267
|
*/
|
|
247
268
|
removeField(name: string): any;
|
|
269
|
+
/**
|
|
270
|
+
* Remove `cardKind` from the main card's `$seed` map, returning its
|
|
271
|
+
* overlay or `undefined`; drops `$seed` entirely once empty. Sibling
|
|
272
|
+
* kinds survive.
|
|
273
|
+
*/
|
|
274
|
+
removeSeedNamespace(card_kind: string): any;
|
|
248
275
|
replaceBody(body: string): void;
|
|
249
276
|
/**
|
|
250
277
|
* Read the `schema` version tag from a raw storage DTO string without a
|
|
@@ -286,13 +313,13 @@ export class Document {
|
|
|
286
313
|
*/
|
|
287
314
|
setExtNamespace(namespace: string, value: any): void;
|
|
288
315
|
/**
|
|
289
|
-
* Update a payload field on the main card. Clears any existing `!
|
|
316
|
+
* Update a payload field on the main card. Clears any existing `!must_fill` marker.
|
|
290
317
|
*
|
|
291
318
|
* Throws if `name` does not match `[a-z_][a-z0-9_]*`.
|
|
292
319
|
*/
|
|
293
320
|
setField(name: string, value: any): void;
|
|
294
321
|
/**
|
|
295
|
-
* Update a payload field on the main card and mark it as `!
|
|
322
|
+
* Update a payload field on the main card and mark it as `!must_fill`.
|
|
296
323
|
* Throws on invalid name (see [`setField`](Document::set_field)).
|
|
297
324
|
*/
|
|
298
325
|
setFill(name: string, value: any): void;
|
|
@@ -300,6 +327,13 @@ export class Document {
|
|
|
300
327
|
* Replace the QUILL reference string. Throws if `ref_str` is invalid.
|
|
301
328
|
*/
|
|
302
329
|
setQuillRef(ref_str: string): void;
|
|
330
|
+
/**
|
|
331
|
+
* Merge a card-kind's seed `overlay` into the main card's `$seed` map
|
|
332
|
+
* under `cardKind`, preserving sibling kinds. Sets the starting values
|
|
333
|
+
* new cards of that kind spawn with. Throws if `overlay` cannot be
|
|
334
|
+
* serialized or nests too deep.
|
|
335
|
+
*/
|
|
336
|
+
setSeedNamespace(card_kind: string, overlay: any): void;
|
|
303
337
|
/**
|
|
304
338
|
* Serialize this document to a versioned storage DTO string.
|
|
305
339
|
*
|
|
@@ -363,12 +397,17 @@ export class Quill {
|
|
|
363
397
|
static fromTree(tree: Map<string, Uint8Array>): Quill;
|
|
364
398
|
/**
|
|
365
399
|
* Seed a starter composable `Card` of the given kind (carries `$kind`),
|
|
366
|
-
*
|
|
367
|
-
* absent. Returns `undefined` if `cardKind`
|
|
368
|
-
* quill's schema, else a `Card` that feeds
|
|
369
|
-
* `Document.pushCard` / `insertCard`.
|
|
400
|
+
* layering an optional per-kind seed `overlay` over the schema-example
|
|
401
|
+
* base (`overlay › example › absent`). Returns `undefined` if `cardKind`
|
|
402
|
+
* is not declared in this quill's schema, else a `Card` that feeds
|
|
403
|
+
* straight into `Document.pushCard` / `insertCard`.
|
|
404
|
+
*
|
|
405
|
+
* Pass `document.main.seed?.[cardKind]` as `overlay` so a card added to a
|
|
406
|
+
* template-derived document inherits its curated starting values; omit it
|
|
407
|
+
* (or pass `undefined` / `null`) for the bare schema seed. `overlay` is a
|
|
408
|
+
* plain object — this reads the document, it does not mutate it.
|
|
370
409
|
*/
|
|
371
|
-
seedCard(card_kind: string): Card | undefined;
|
|
410
|
+
seedCard(card_kind: string, overlay: Record<string, unknown> | undefined): Card | undefined;
|
|
372
411
|
/**
|
|
373
412
|
* Seed a starter `Document` from the schema — the main card plus one
|
|
374
413
|
* instance of each composable card kind, each committing its fields'
|
package/core/wasm_bg.js
CHANGED
|
@@ -21,8 +21,9 @@ export class Document {
|
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
23
|
* Authoring-ergonomics header introducing a blueprint to an LLM/MCP
|
|
24
|
-
* consumer for the given `quillName`.
|
|
25
|
-
*
|
|
24
|
+
* consumer for the given `quillName`. Re-exposes core's canonical text for
|
|
25
|
+
* JS consumers; any surface that draws from the same core source stays
|
|
26
|
+
* uniform.
|
|
26
27
|
* @param {string} quill_name
|
|
27
28
|
* @returns {string}
|
|
28
29
|
*/
|
|
@@ -111,8 +112,8 @@ export class Document {
|
|
|
111
112
|
return ret !== 0;
|
|
112
113
|
}
|
|
113
114
|
/**
|
|
114
|
-
* Render a Diagnostic as the canonical pretty-printed text
|
|
115
|
-
*
|
|
115
|
+
* Render a Diagnostic as the canonical pretty-printed text (core's
|
|
116
|
+
* `Diagnostic::fmt_pretty`). Single source of truth so a Diagnostic looks
|
|
116
117
|
* identical no matter which consumer surfaces it.
|
|
117
118
|
* @param {Diagnostic} diag
|
|
118
119
|
* @returns {string}
|
|
@@ -134,10 +135,11 @@ export class Document {
|
|
|
134
135
|
}
|
|
135
136
|
}
|
|
136
137
|
/**
|
|
137
|
-
* Authoring-format rules for the card-yaml markdown surface
|
|
138
|
-
* text
|
|
139
|
-
*
|
|
140
|
-
* startup and cache; the value never changes
|
|
138
|
+
* Authoring-format rules for the card-yaml markdown surface. The canonical
|
|
139
|
+
* text is core's (`quillmark_core::document::FORMAT_RULES`), re-exposed
|
|
140
|
+
* here for JS consumers so it matches any other surface that draws from the
|
|
141
|
+
* same source. Read once at startup and cache; the value never changes
|
|
142
|
+
* between calls.
|
|
141
143
|
* @returns {string}
|
|
142
144
|
*/
|
|
143
145
|
static formatRules() {
|
|
@@ -332,11 +334,11 @@ export class Document {
|
|
|
332
334
|
}
|
|
333
335
|
}
|
|
334
336
|
/**
|
|
335
|
-
* The canonical `$quill` reference grammar as author-facing text.
|
|
336
|
-
* source of truth
|
|
337
|
-
*
|
|
338
|
-
*
|
|
339
|
-
*
|
|
337
|
+
* The canonical `$quill` reference grammar as author-facing text. Core is
|
|
338
|
+
* the single source of truth: drive schema `describe` and validation
|
|
339
|
+
* messages from this instead of re-stating the rule — it matches the
|
|
340
|
+
* `hint` on `parse::invalid_quill_reference`. Cache it; the value never
|
|
341
|
+
* changes.
|
|
340
342
|
* @returns {string}
|
|
341
343
|
*/
|
|
342
344
|
static quillRefHint() {
|
|
@@ -515,6 +517,30 @@ export class Document {
|
|
|
515
517
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
516
518
|
}
|
|
517
519
|
}
|
|
520
|
+
/**
|
|
521
|
+
* Remove `cardKind` from the main card's `$seed` map, returning its
|
|
522
|
+
* overlay or `undefined`; drops `$seed` entirely once empty. Sibling
|
|
523
|
+
* kinds survive.
|
|
524
|
+
* @param {string} card_kind
|
|
525
|
+
* @returns {any}
|
|
526
|
+
*/
|
|
527
|
+
removeSeedNamespace(card_kind) {
|
|
528
|
+
try {
|
|
529
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
530
|
+
const ptr0 = passStringToWasm0(card_kind, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
531
|
+
const len0 = WASM_VECTOR_LEN;
|
|
532
|
+
wasm.document_removeSeedNamespace(retptr, this.__wbg_ptr, ptr0, len0);
|
|
533
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
534
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
535
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
536
|
+
if (r2) {
|
|
537
|
+
throw takeObject(r1);
|
|
538
|
+
}
|
|
539
|
+
return takeObject(r0);
|
|
540
|
+
} finally {
|
|
541
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
542
|
+
}
|
|
543
|
+
}
|
|
518
544
|
/**
|
|
519
545
|
* @param {string} body
|
|
520
546
|
*/
|
|
@@ -658,7 +684,7 @@ export class Document {
|
|
|
658
684
|
}
|
|
659
685
|
}
|
|
660
686
|
/**
|
|
661
|
-
* Update a payload field on the main card. Clears any existing `!
|
|
687
|
+
* Update a payload field on the main card. Clears any existing `!must_fill` marker.
|
|
662
688
|
*
|
|
663
689
|
* Throws if `name` does not match `[a-z_][a-z0-9_]*`.
|
|
664
690
|
* @param {string} name
|
|
@@ -680,7 +706,7 @@ export class Document {
|
|
|
680
706
|
}
|
|
681
707
|
}
|
|
682
708
|
/**
|
|
683
|
-
* Update a payload field on the main card and mark it as `!
|
|
709
|
+
* Update a payload field on the main card and mark it as `!must_fill`.
|
|
684
710
|
* Throws on invalid name (see [`setField`](Document::set_field)).
|
|
685
711
|
* @param {string} name
|
|
686
712
|
* @param {any} value
|
|
@@ -719,6 +745,29 @@ export class Document {
|
|
|
719
745
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
720
746
|
}
|
|
721
747
|
}
|
|
748
|
+
/**
|
|
749
|
+
* Merge a card-kind's seed `overlay` into the main card's `$seed` map
|
|
750
|
+
* under `cardKind`, preserving sibling kinds. Sets the starting values
|
|
751
|
+
* new cards of that kind spawn with. Throws if `overlay` cannot be
|
|
752
|
+
* serialized or nests too deep.
|
|
753
|
+
* @param {string} card_kind
|
|
754
|
+
* @param {any} overlay
|
|
755
|
+
*/
|
|
756
|
+
setSeedNamespace(card_kind, overlay) {
|
|
757
|
+
try {
|
|
758
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
759
|
+
const ptr0 = passStringToWasm0(card_kind, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
760
|
+
const len0 = WASM_VECTOR_LEN;
|
|
761
|
+
wasm.document_setSeedNamespace(retptr, this.__wbg_ptr, ptr0, len0, addHeapObject(overlay));
|
|
762
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
763
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
764
|
+
if (r1) {
|
|
765
|
+
throw takeObject(r0);
|
|
766
|
+
}
|
|
767
|
+
} finally {
|
|
768
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
769
|
+
}
|
|
770
|
+
}
|
|
722
771
|
/**
|
|
723
772
|
* Serialize this document to a versioned storage DTO string.
|
|
724
773
|
*
|
|
@@ -976,19 +1025,25 @@ export class Quill {
|
|
|
976
1025
|
}
|
|
977
1026
|
/**
|
|
978
1027
|
* Seed a starter composable `Card` of the given kind (carries `$kind`),
|
|
979
|
-
*
|
|
980
|
-
* absent. Returns `undefined` if `cardKind`
|
|
981
|
-
* quill's schema, else a `Card` that feeds
|
|
982
|
-
* `Document.pushCard` / `insertCard`.
|
|
1028
|
+
* layering an optional per-kind seed `overlay` over the schema-example
|
|
1029
|
+
* base (`overlay › example › absent`). Returns `undefined` if `cardKind`
|
|
1030
|
+
* is not declared in this quill's schema, else a `Card` that feeds
|
|
1031
|
+
* straight into `Document.pushCard` / `insertCard`.
|
|
1032
|
+
*
|
|
1033
|
+
* Pass `document.main.seed?.[cardKind]` as `overlay` so a card added to a
|
|
1034
|
+
* template-derived document inherits its curated starting values; omit it
|
|
1035
|
+
* (or pass `undefined` / `null`) for the bare schema seed. `overlay` is a
|
|
1036
|
+
* plain object — this reads the document, it does not mutate it.
|
|
983
1037
|
* @param {string} card_kind
|
|
1038
|
+
* @param {Record<string, unknown> | undefined} overlay
|
|
984
1039
|
* @returns {Card | undefined}
|
|
985
1040
|
*/
|
|
986
|
-
seedCard(card_kind) {
|
|
1041
|
+
seedCard(card_kind, overlay) {
|
|
987
1042
|
try {
|
|
988
1043
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
989
1044
|
const ptr0 = passStringToWasm0(card_kind, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
990
1045
|
const len0 = WASM_VECTOR_LEN;
|
|
991
|
-
wasm.quill_seedCard(retptr, this.__wbg_ptr, ptr0, len0);
|
|
1046
|
+
wasm.quill_seedCard(retptr, this.__wbg_ptr, ptr0, len0, addHeapObject(overlay));
|
|
992
1047
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
993
1048
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
994
1049
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
package/core/wasm_bg.wasm
CHANGED
|
Binary file
|
package/core/wasm_bg.wasm.d.ts
CHANGED
|
@@ -27,6 +27,7 @@ export const document_removeCardField: (a: number, b: number, c: number, d: numb
|
|
|
27
27
|
export const document_removeExt: (a: number, b: number) => void;
|
|
28
28
|
export const document_removeExtNamespace: (a: number, b: number, c: number, d: number) => void;
|
|
29
29
|
export const document_removeField: (a: number, b: number, c: number, d: number) => void;
|
|
30
|
+
export const document_removeSeedNamespace: (a: number, b: number, c: number, d: number) => void;
|
|
30
31
|
export const document_replaceBody: (a: number, b: number, c: number) => void;
|
|
31
32
|
export const document_schemaVersionOf: (a: number, b: number, c: number) => void;
|
|
32
33
|
export const document_setCardExt: (a: number, b: number, c: number, d: number) => void;
|
|
@@ -37,6 +38,7 @@ export const document_setExtNamespace: (a: number, b: number, c: number, d: numb
|
|
|
37
38
|
export const document_setField: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
38
39
|
export const document_setFill: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
39
40
|
export const document_setQuillRef: (a: number, b: number, c: number, d: number) => void;
|
|
41
|
+
export const document_setSeedNamespace: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
40
42
|
export const document_toJson: (a: number, b: number) => void;
|
|
41
43
|
export const document_toMarkdown: (a: number, b: number) => void;
|
|
42
44
|
export const document_tryFromJson: (a: number, b: number) => number;
|
|
@@ -49,7 +51,7 @@ export const quill_blueprint: (a: number, b: number) => void;
|
|
|
49
51
|
export const quill_fromTree: (a: number, b: number) => void;
|
|
50
52
|
export const quill_metadata: (a: number, b: number) => void;
|
|
51
53
|
export const quill_schema: (a: number, b: number) => void;
|
|
52
|
-
export const quill_seedCard: (a: number, b: number, c: number, d: number) => void;
|
|
54
|
+
export const quill_seedCard: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
53
55
|
export const quill_seedDocument: (a: number) => number;
|
|
54
56
|
export const quill_seedMain: (a: number, b: number) => void;
|
|
55
57
|
export const quill_toTree: (a: number) => number;
|