@quillmark/wasm 0.117.0 → 0.118.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,36 @@
1
1
  # Changelog
2
2
 
3
+ ## v0.118.0 - 2026-09-30
4
+
5
+ Upgrade path: [0.117 → 0.118](docs/migrations/0.117-to-0.118.md).
6
+
7
+ ### Kind seeds
8
+
9
+ - feat(core,wasm,python)!: **a card kind declares `seed:`**, what
10
+ `seed_card` writes into a new card of that kind: the `$seed.<kind>` shape,
11
+ fields plus an optional `$body`. `seed_document()` carries each kind's seed,
12
+ and `schema()` emits it (WASM `QuillCardSchema.seed`). `CardSchema` gains a
13
+ public `seed` field. A document's `$seed.<kind>` replaces the kind's seed
14
+ whole, `$body` included, and `$seed.<kind>: {}` seeds nothing. A kind's
15
+ seed is checked as the card it makes and fails the load under
16
+ `quill::seed_*`, plus `quill::seed_redundant` for a seed that renders as the
17
+ unanswered field does; `main` declares none (`quill::invalid_card_schema`).
18
+ (#2016)
19
+
20
+ ### Document `$seed`
21
+
22
+ - feat(core)!: **a document's `$seed` warns wherever the card it seeds
23
+ would**: an undeclared key below a seeded field
24
+ (`validation::unknown_field`), a cell outside its variant world
25
+ (`validation::out_of_variant`), a `$body` that is not a markdown string or
26
+ does not import (`validation::seed_overlay_shape`), and a seeded array past
27
+ its `max:` (`validation::cardinality`). `quillmark validate` fails a quill
28
+ whose `example.md` carries one. A `null` in `$seed.<kind>` commits nothing,
29
+ where the new card carried `field:`. (#2016)
30
+ - refactor(cli): `quillmark validate` names `seed_document`'s output
31
+ `seeded` in its render report, where it said `seed`. (#2014)
32
+
33
+
3
34
  ## v0.117.0 - 2026-09-29
4
35
 
5
36
  Upgrade path: [0.116 → 0.117](docs/migrations/0.116-to-0.117.md).
package/README.md CHANGED
@@ -223,8 +223,8 @@ values from the `Document` payload: there is no separate form-view projection.
223
223
  values are made up, pinned to the quill's `name@version`; `undefined` when
224
224
  the quill has no `example.md` at its root.
225
225
 
226
- `quill.seedDocument()` returns a starter document: one card per kind, each body
227
- empty, every field absent;
226
+ `quill.seedDocument()` returns a starter document: one card per kind, each
227
+ carrying the kind's `seed` from `Quill.yaml` and no other field;
228
228
  `quill.seedMain()` and `quill.seedCard(kind)` seed one card. All
229
229
  return the read `Card` shape of `doc.main` / `doc.cards`, which `doc.insertCard`
230
230
  accepts directly:
package/core/wasm.d.ts CHANGED
@@ -461,6 +461,10 @@ export interface QuillCardSchema {
461
461
  fields: Record<string, QuillFieldSchema>;
462
462
  ui?: QuillCardUi;
463
463
  body?: QuillCardBody;
464
+ /** What `seedCard` writes into a new card of this kind where the
465
+ * document's `$seed` carries no entry for it: the `$seed[kind]` shape, fields plus
466
+ * an optional `$body`. Never present on `main`. */
467
+ seed?: Record<string, unknown>;
464
468
  }
465
469
 
466
470
  /**
@@ -840,19 +844,20 @@ export class Quill {
840
844
  parse(markdown: string): Document;
841
845
  /**
842
846
  * Seed a starter composable `Card` of the given kind (carries `$kind`),
843
- * committing an optional per-kind seed `overlay`'s fields and `$body`
844
- * (`overlay › absent`, body `overlay › empty`). `undefined` when
845
- * `cardKind` is not declared in this quill's schema.
847
+ * committing an optional per-kind seed `overlay`'s fields and `$body` in
848
+ * place of the kind's own `seed`, else that seed's. `undefined` when `cardKind` is
849
+ * not declared in this quill's schema.
846
850
  *
847
851
  * Pass `document.seedOverlay(cardKind)` as `overlay` so a card added to a
848
852
  * template-derived document inherits its curated starting values; omit it
849
- * for the bare schema seed.
853
+ * for a card carrying the kind's seed alone.
850
854
  */
851
855
  seedCard(card_kind: string, overlay: Record<string, unknown> | undefined): Card | undefined;
852
856
  /**
853
857
  * Seed a starter `Document` from the schema: the main card plus one instance
854
- * of each composable card kind, each body empty and every field absent
855
- * (interpolated at render as `default:`, else the field's blank).
858
+ * of each composable card kind, each carrying its kind's `seed` and every
859
+ * other field absent (interpolated at render as `default:`, else the
860
+ * field's blank).
856
861
  */
857
862
  seedDocument(): Document;
858
863
  /**
package/core/wasm.js CHANGED
@@ -1367,13 +1367,13 @@ export class Quill {
1367
1367
  }
1368
1368
  /**
1369
1369
  * Seed a starter composable `Card` of the given kind (carries `$kind`),
1370
- * committing an optional per-kind seed `overlay`'s fields and `$body`
1371
- * (`overlay › absent`, body `overlay › empty`). `undefined` when
1372
- * `cardKind` is not declared in this quill's schema.
1370
+ * committing an optional per-kind seed `overlay`'s fields and `$body` in
1371
+ * place of the kind's own `seed`, else that seed's. `undefined` when `cardKind` is
1372
+ * not declared in this quill's schema.
1373
1373
  *
1374
1374
  * Pass `document.seedOverlay(cardKind)` as `overlay` so a card added to a
1375
1375
  * template-derived document inherits its curated starting values; omit it
1376
- * for the bare schema seed.
1376
+ * for a card carrying the kind's seed alone.
1377
1377
  * @param {string} card_kind
1378
1378
  * @param {Record<string, unknown> | undefined} overlay
1379
1379
  * @returns {Card | undefined}
@@ -1397,8 +1397,9 @@ export class Quill {
1397
1397
  }
1398
1398
  /**
1399
1399
  * Seed a starter `Document` from the schema: the main card plus one instance
1400
- * of each composable card kind, each body empty and every field absent
1401
- * (interpolated at render as `default:`, else the field's blank).
1400
+ * of each composable card kind, each carrying its kind's `seed` and every
1401
+ * other field absent (interpolated at render as `default:`, else the
1402
+ * field's blank).
1402
1403
  * @returns {Document}
1403
1404
  */
1404
1405
  seedDocument() {
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.117.0",
3
+ "version": "0.118.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
@@ -472,6 +472,10 @@ export interface QuillCardSchema {
472
472
  fields: Record<string, QuillFieldSchema>;
473
473
  ui?: QuillCardUi;
474
474
  body?: QuillCardBody;
475
+ /** What `seedCard` writes into a new card of this kind where the
476
+ * document's `$seed` carries no entry for it: the `$seed[kind]` shape, fields plus
477
+ * an optional `$body`. Never present on `main`. */
478
+ seed?: Record<string, unknown>;
475
479
  }
476
480
 
477
481
  /**
@@ -1073,19 +1077,20 @@ export class Quill {
1073
1077
  parse(markdown: string): Document;
1074
1078
  /**
1075
1079
  * Seed a starter composable `Card` of the given kind (carries `$kind`),
1076
- * committing an optional per-kind seed `overlay`'s fields and `$body`
1077
- * (`overlay › absent`, body `overlay › empty`). `undefined` when
1078
- * `cardKind` is not declared in this quill's schema.
1080
+ * committing an optional per-kind seed `overlay`'s fields and `$body` in
1081
+ * place of the kind's own `seed`, else that seed's. `undefined` when `cardKind` is
1082
+ * not declared in this quill's schema.
1079
1083
  *
1080
1084
  * Pass `document.seedOverlay(cardKind)` as `overlay` so a card added to a
1081
1085
  * template-derived document inherits its curated starting values; omit it
1082
- * for the bare schema seed.
1086
+ * for a card carrying the kind's seed alone.
1083
1087
  */
1084
1088
  seedCard(card_kind: string, overlay: Record<string, unknown> | undefined): Card | undefined;
1085
1089
  /**
1086
1090
  * Seed a starter `Document` from the schema: the main card plus one instance
1087
- * of each composable card kind, each body empty and every field absent
1088
- * (interpolated at render as `default:`, else the field's blank).
1091
+ * of each composable card kind, each carrying its kind's `seed` and every
1092
+ * other field absent (interpolated at render as `default:`, else the
1093
+ * field's blank).
1089
1094
  */
1090
1095
  seedDocument(): Document;
1091
1096
  /**
package/render/wasm.js CHANGED
@@ -1688,13 +1688,13 @@ export class Quill {
1688
1688
  }
1689
1689
  /**
1690
1690
  * Seed a starter composable `Card` of the given kind (carries `$kind`),
1691
- * committing an optional per-kind seed `overlay`'s fields and `$body`
1692
- * (`overlay › absent`, body `overlay › empty`). `undefined` when
1693
- * `cardKind` is not declared in this quill's schema.
1691
+ * committing an optional per-kind seed `overlay`'s fields and `$body` in
1692
+ * place of the kind's own `seed`, else that seed's. `undefined` when `cardKind` is
1693
+ * not declared in this quill's schema.
1694
1694
  *
1695
1695
  * Pass `document.seedOverlay(cardKind)` as `overlay` so a card added to a
1696
1696
  * template-derived document inherits its curated starting values; omit it
1697
- * for the bare schema seed.
1697
+ * for a card carrying the kind's seed alone.
1698
1698
  * @param {string} card_kind
1699
1699
  * @param {Record<string, unknown> | undefined} overlay
1700
1700
  * @returns {Card | undefined}
@@ -1718,8 +1718,9 @@ export class Quill {
1718
1718
  }
1719
1719
  /**
1720
1720
  * Seed a starter `Document` from the schema: the main card plus one instance
1721
- * of each composable card kind, each body empty and every field absent
1722
- * (interpolated at render as `default:`, else the field's blank).
1721
+ * of each composable card kind, each carrying its kind's `seed` and every
1722
+ * other field absent (interpolated at render as `default:`, else the
1723
+ * field's blank).
1723
1724
  * @returns {Document}
1724
1725
  */
1725
1726
  seedDocument() {
Binary file