@quillmark/wasm 0.115.0 → 0.117.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/core/wasm.d.ts CHANGED
@@ -13,13 +13,6 @@ export type PayloadItem =
13
13
  type: "field";
14
14
  key: string;
15
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 `insertCard`.
21
- */
22
- nestedFills?: PathStep[][];
23
16
  }
24
17
  | { type: "comment"; text: string; inline?: boolean };
25
18
 
@@ -27,9 +20,9 @@ export type PayloadItem =
27
20
  * A single card block, as read back from a document. Every `Card` is a valid
28
21
  * `CardInput`, so a card read from one document pushes straight into another.
29
22
  *
30
- * `$` system entries are hoisted to named fields: `kind` (the `$kind`, empty
31
- * string when none), `quill` (`$quill` `name@version`, main card only), `ext`
32
- * (`$ext`), and `seed` (the `$seed` per-kind overlay map, main card only).
23
+ * `$` system entries are hoisted to named fields: `kind` (the `$kind`),
24
+ * `quill` (`$quill` `name@version`, main card only), `ext` (`$ext`), and
25
+ * `seed` (the `$seed` per-kind overlay map, main card only).
33
26
  * `payloadItems` carries user fields and comments in order.
34
27
  */
35
28
  export interface Card {
@@ -357,11 +350,11 @@ export interface ResolvedMain {
357
350
 
358
351
  /**
359
352
  * One composable card's resolved rows in declaration order, with its authored
360
- * `kind` (`null` for an unknown-kind card), its document-array `index`, and its
353
+ * `kind` (an undeclared one included), its document-array `index`, and its
361
354
  * body row: `null` when the kind enables no body.
362
355
  */
363
356
  export interface ResolvedCard {
364
- kind: string | null;
357
+ kind: string;
365
358
  index: number;
366
359
  fields: ResolvedField[];
367
360
  body: ResolvedField | null;
@@ -369,7 +362,7 @@ export interface ResolvedCard {
369
362
 
370
363
  /**
371
364
  * The resolved-value view (`Quill.resolve`): the main card and every composable
372
- * card. Value and provenance only; completeness stays `Quill.validate`'s.
365
+ * card. Value and provenance only; diagnostics stay `Quill.validate`'s.
373
366
  */
374
367
  export interface Resolved {
375
368
  main: ResolvedMain;
@@ -381,7 +374,6 @@ export interface Resolved {
381
374
  /** UI layout hints for a single field. Display order is not a hint: key order
382
375
  * in the schema's `fields`/`properties` objects is the ordering contract. */
383
376
  export interface QuillFieldUi {
384
- title?: string;
385
377
  group?: string;
386
378
  compact?: boolean;
387
379
  multiline?: boolean;
@@ -405,50 +397,35 @@ export interface QuillGroupUi {
405
397
 
406
398
  /** UI layout hints for a card (main or named card kind). */
407
399
  export interface QuillCardUi {
408
- title?: string;
409
400
  /** The groups a field's `ui.group` may reference, keyed by group id. Key
410
401
  * order is the display-order contract, as with `fields`. Absent when the
411
402
  * card declares no groups. */
412
403
  groups?: Record<string, QuillGroupUi>;
413
404
  }
414
405
 
415
- /** A block construct a body can hold. `paragraph` is the floor and cannot be
416
- * declined, so it is absent. */
417
- export type QuillBlockConstruct =
418
- | "heading"
419
- | "rule"
420
- | "code"
421
- | "list"
422
- | "quote"
423
- | "table"
424
- | "image";
425
-
426
406
  /** Body namespace for a card (main or named card kind). */
427
407
  export interface QuillCardBody {
428
408
  /** When false, consumers must not accept or store body content for this card kind. Defaults to true. */
429
409
  enabled?: boolean;
430
- /** Example body content embedded verbatim in the blueprint body region. Fallback is "Write <card> body here." */
431
- example?: string;
432
- /** Block constructs this quill's plate does not typeset in this body;
433
- * absent or empty declines nothing. A body that holds one anyway draws a
434
- * non-fatal `plate::unsupported_construct` warning. Nothing verifies the
435
- * claim: absence from this list is not a promise the plate typesets it. */
436
- unsupported?: QuillBlockConstruct[];
437
410
  }
438
411
 
412
+ export type QuillFieldType = "string" | "number" | "integer" | "boolean" | "array" | "object" | "date" | "datetime" | "richtext" | "plaintext" | "enum" | "matrix";
413
+
439
414
  /** Schema entry for a single field declared in a quill's `Quill.yaml`.
440
415
  *
441
- * One declaration, and no `required` key. `default` and `example` say what the
442
- * cell holds, and `default`'s absence is the obligation: a field nobody
443
- * declared a value for carries a `!must_fill` marker in the blueprint and warns
444
- * `validation::must_fill` while the document leaves it unauthored. Neither
445
- * gates render: an absent field blank-fills.
416
+ * `default` is the value an unanswered cell renders. An absent field without a
417
+ * `default` blank-fills.
446
418
  */
447
419
  export interface QuillFieldSchema {
448
- type: "string" | "number" | "integer" | "boolean" | "array" | "object" | "date" | "datetime" | "richtext" | "plaintext" | "enum" | "matrix";
420
+ /** A trailing `?` marks the cell optional: unanswered, it renders `none`
421
+ * rather than its type's blank, and it never carries a `default`. A
422
+ * consumer offers a way back to unanswered (`removeField`) on such a cell. */
423
+ type: QuillFieldType | `${Exclude<QuillFieldType, "object" | "matrix">}?`;
424
+ /** The field's label, a literal. Absent, the consumer humanizes the key
425
+ * (`memo_for` → "Memo For"). Never present on an array's `items`. */
426
+ title?: string;
449
427
  description?: string;
450
428
  default?: unknown;
451
- example?: unknown;
452
429
  /** The closed set of allowed values. Required on `type: "enum"`, and valid
453
430
  * nowhere else. */
454
431
  values?: string[];
@@ -477,6 +454,9 @@ export interface QuillFieldSchema {
477
454
 
478
455
  /** Schema entry for the main card or a named card kind. */
479
456
  export interface QuillCardSchema {
457
+ /** The kind's label, a literal. Absent, the consumer humanizes the kind
458
+ * name. An instance takes its label from its own values. */
459
+ title?: string;
480
460
  description?: string;
481
461
  fields: Record<string, QuillFieldSchema>;
482
462
  ui?: QuillCardUi;
@@ -558,11 +538,6 @@ export class Document {
558
538
  * building `markOps` need not predict it.
559
539
  */
560
540
  applyChange(addr: Addr | string, bundle: ChangeBundle): void;
561
- /**
562
- * A blueprint's fill obligation for the given `quillName`, re-exposed from
563
- * core. Carries no tool name: pair it with your own next-step directive.
564
- */
565
- static blueprintInstruction(quill_name: string): string;
566
541
  /**
567
542
  * The **body** markdown projection: an on-demand, lossy export (content-only
568
543
  * marks do not survive markdown). A body's type is a format fact, not a
@@ -596,11 +571,6 @@ export class Document {
596
571
  * Structural equality, excluding parse-time `warnings`.
597
572
  */
598
573
  equals(other: Document): boolean;
599
- /**
600
- * Authoring-format rules for the card-yaml markdown surface, re-exposed from
601
- * core. Constant across calls; read once and cache.
602
- */
603
- static formatRules(): string;
604
574
  /**
605
575
  * Parse markdown into a typed Document. Throws on parse errors.
606
576
  */
@@ -646,12 +616,6 @@ export class Document {
646
616
  * `at` is out of range.
647
617
  */
648
618
  insertCard(card: CardInput, at?: number): void;
649
- /**
650
- * Whether the field at `addr` is marked `!must_fill`. A bare string is `Addr`
651
- * shorthand for `{ field }`. `false` for an absent field and for a body
652
- * address; only an out-of-range `addr.card` throws.
653
- */
654
- isFill(addr: Addr | string): boolean;
655
619
  /**
656
620
  * Replace this document's contents **in place** from a versioned storage DTO
657
621
  * string: the mutating twin of [`fromStored`](Document::from_stored).
@@ -660,6 +624,11 @@ export class Document {
660
624
  * variable.
661
625
  */
662
626
  loadStored(json: string): void;
627
+ /**
628
+ * The Quillmark Markdown rules, re-exposed from core. Constant across
629
+ * calls; read once and cache.
630
+ */
631
+ static markdownRules(): string;
663
632
  /**
664
633
  * Move the card at `from` to position `to`. `from == to` is a no-op.
665
634
  */
@@ -668,8 +637,8 @@ export class Document {
668
637
  * A blank document: a main card carrying only `$quill`, an empty body, and
669
638
  * no composable cards. Absent fields resolve at render time (`default`, else
670
639
  * the field's blank), so nothing the caller did not set reaches the output.
671
- * For an example-filled starter use `Quill.seedDocument()`. Throws on an
672
- * invalid quill reference.
640
+ * For one instance of every card kind use `Quill.seedDocument()`. Throws on
641
+ * an invalid quill reference.
673
642
  */
674
643
  constructor(quill_ref: string);
675
644
  /**
@@ -766,7 +735,7 @@ export class Document {
766
735
  * Store a field verbatim at `addr`, deferring coercion to render; the typed
767
736
  * write is [`commitField`](Document::commit_field). A bare string is `Addr`
768
737
  * shorthand for `{ field }`; `{ card: 2, field: "qty" }` targets a
769
- * composable card. Clears any `!must_fill` marker. A body address throws:
738
+ * composable card. A body address throws:
770
739
  * write a body with `revise` / `overwrite`. Throws on an out-of-range card
771
740
  * or a malformed name.
772
741
  */
@@ -779,11 +748,6 @@ export class Document {
779
748
  * one entry per offending field. Throws on an out-of-range card.
780
749
  */
781
750
  storeFields(addr: CardAddr, fields: Record<string, unknown>): void;
782
- /**
783
- * Store a field verbatim at `addr` and mark it `!must_fill`. A body address
784
- * throws; same validation as [`storeField`](Document::store_field).
785
- */
786
- storeFill(addr: Addr | string, value: any): void;
787
751
  /**
788
752
  * Merge a card-kind's seed `overlay` into the **main** card's `$seed` map
789
753
  * under `cardKind`, preserving sibling kinds; `$seed` is main-only, so this
@@ -833,8 +797,7 @@ export class Quill {
833
797
  * transport door (`fromMarkdown`, `fromStored`, a stored row).
834
798
  *
835
799
  * Idempotent: an equal value is not rewritten, so YAML comments and stored
836
- * bytes survive. A `!must_fill` marker anywhere in a field's value skips
837
- * that field, and a value the strict write refuses stays as authored with a
800
+ * bytes survive. A value the strict write refuses stays as authored with a
838
801
  * diagnostic. Throws when `doc` declares a different `$quill`, before any
839
802
  * mutation.
840
803
  */
@@ -847,6 +810,15 @@ export class Quill {
847
810
  * reached by spelling the reference.
848
811
  */
849
812
  emptyDocument(): Document;
813
+ /**
814
+ * The quill's example document, `undefined` when the quill has no
815
+ * `example.md` at its root: a filled-in page whose values are made up to show the
816
+ * quill in use, never kept. It comes back pinned to this quill's
817
+ * `name@version` and conformed as `parse` conforms, its parse and
818
+ * `conform::*` warnings on `doc.warnings`. Throws when the file does not
819
+ * parse or its `$quill` is not this quill's bare name.
820
+ */
821
+ exampleDocument(): Document | undefined;
850
822
  /**
851
823
  * Build a quill from a file tree. Pure: the declared backend is resolved
852
824
  * later, at render time. Accepts a `Map<string, Uint8Array>` or a plain
@@ -868,9 +840,9 @@ export class Quill {
868
840
  parse(markdown: string): Document;
869
841
  /**
870
842
  * Seed a starter composable `Card` of the given kind (carries `$kind`),
871
- * layering an optional per-kind seed `overlay` over the schema-example base
872
- * (`overlay › example › absent`). `undefined` when `cardKind` is not
873
- * declared in this quill's schema.
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.
874
846
  *
875
847
  * Pass `document.seedOverlay(cardKind)` as `overlay` so a card added to a
876
848
  * template-derived document inherits its curated starting values; omit it
@@ -879,9 +851,8 @@ export class Quill {
879
851
  seedCard(card_kind: string, overlay: Record<string, unknown> | undefined): Card | undefined;
880
852
  /**
881
853
  * Seed a starter `Document` from the schema: the main card plus one instance
882
- * of each composable card kind, each committing its fields' `example:`
883
- * values and leaving every other field absent (interpolated at render as
884
- * `default:`, else the field's blank). A field with both renders its example.
854
+ * of each composable card kind, each body empty and every field absent
855
+ * (interpolated at render as `default:`, else the field's blank).
885
856
  */
886
857
  seedDocument(): Document;
887
858
  /**
@@ -902,8 +873,7 @@ export class Quill {
902
873
  /**
903
874
  * Validate `doc` against this quill's schema, returning every diagnostic
904
875
  * (empty when the document is valid). Forwards the canonical
905
- * `validation::*` diagnostics the engine emits, including the non-fatal
906
- * `validation::must_fill` warning per `!must_fill` marker left behind.
876
+ * `validation::*` diagnostics the engine emits.
907
877
  */
908
878
  validate(doc: Document): Diagnostic[];
909
879
  /**
@@ -965,6 +935,22 @@ export function formatDocPath(segs: DocPathSeg[]): string;
965
935
  */
966
936
  export function importMarkdown(markdown: string): Content;
967
937
 
938
+ /**
939
+ * Whether `content` satisfies the `inline` constraint of `richtext` and
940
+ * `plaintext`: one `Para` line, in no container, with no islands. Judged on
941
+ * the normalized content, which is what a write stores. Throws if `content` is
942
+ * not canonical content.
943
+ */
944
+ export function isInline(content: Content): boolean;
945
+
946
+ /**
947
+ * Whether `content` satisfies the `plaintext` constraint: no marks, no
948
+ * islands, every line a `Para` in no container. Judged on the normalized
949
+ * content, which is what a write stores. Throws if `content` is not canonical
950
+ * content.
951
+ */
952
+ export function isPlain(content: Content): boolean;
953
+
968
954
  /**
969
955
  * Where `bundle`'s text-moving channels (`delta`, then `islandOps`, then
970
956
  * `lineOps`) leave `content`'s marks: the final-text coordinates the bundle's
@@ -1030,7 +1016,6 @@ export interface InitOutput {
1030
1016
  readonly document__readerGetContentAt: (a: number, b: number, c: number, d: number, e: number) => void;
1031
1017
  readonly document__reviseField: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
1032
1018
  readonly document_applyChange: (a: number, b: number, c: number, d: number) => void;
1033
- readonly document_blueprintInstruction: (a: number, b: number, c: number) => void;
1034
1019
  readonly document_bodyMarkdown: (a: number, b: number, c: number) => void;
1035
1020
  readonly document_card: (a: number, b: number, c: number) => void;
1036
1021
  readonly document_cardCount: (a: number) => number;
@@ -1039,15 +1024,14 @@ export interface InitOutput {
1039
1024
  readonly document_clone: (a: number) => number;
1040
1025
  readonly document_currentStorageVersion: (a: number) => void;
1041
1026
  readonly document_equals: (a: number, b: number) => number;
1042
- readonly document_formatRules: (a: number) => void;
1043
1027
  readonly document_fromMarkdown: (a: number, b: number, c: number) => void;
1044
1028
  readonly document_fromStored: (a: number, b: number, c: number) => void;
1045
1029
  readonly document_getExt: (a: number, b: number, c: number) => void;
1046
1030
  readonly document_getStored: (a: number, b: number, c: number) => void;
1047
1031
  readonly document_insertCard: (a: number, b: number, c: number, d: number) => void;
1048
- readonly document_isFill: (a: number, b: number, c: number) => void;
1049
1032
  readonly document_loadStored: (a: number, b: number, c: number, d: number) => void;
1050
1033
  readonly document_main: (a: number, b: number) => void;
1034
+ readonly document_markdownRules: (a: number) => void;
1051
1035
  readonly document_moveCard: (a: number, b: number, c: number, d: number) => void;
1052
1036
  readonly document_new: (a: number, b: number, c: number) => void;
1053
1037
  readonly document_overwrite: (a: number, b: number, c: number, d: number) => void;
@@ -1065,7 +1049,6 @@ export interface InitOutput {
1065
1049
  readonly document_storeExt: (a: number, b: number, c: number, d: number) => void;
1066
1050
  readonly document_storeField: (a: number, b: number, c: number, d: number) => void;
1067
1051
  readonly document_storeFields: (a: number, b: number, c: number, d: number) => void;
1068
- readonly document_storeFill: (a: number, b: number, c: number, d: number) => void;
1069
1052
  readonly document_storeSeedOverlay: (a: number, b: number, c: number, d: number, e: number) => void;
1070
1053
  readonly document_toMarkdown: (a: number, b: number) => void;
1071
1054
  readonly document_toStored: (a: number, b: number) => void;
@@ -1074,14 +1057,17 @@ export interface InitOutput {
1074
1057
  readonly formatDiagnostic: (a: number, b: number) => void;
1075
1058
  readonly formatDocPath: (a: number, b: number) => void;
1076
1059
  readonly importMarkdown: (a: number, b: number, c: number) => void;
1060
+ readonly isInline: (a: number, b: number) => void;
1061
+ readonly isPlain: (a: number, b: number) => void;
1077
1062
  readonly mapMarks: (a: number, b: number, c: number) => void;
1078
1063
  readonly mapPos: (a: number, b: number, c: number, d: number) => void;
1079
1064
  readonly parseDocPath: (a: number, b: number, c: number) => void;
1080
- readonly quill__resolve: (a: number, b: number, c: number) => void;
1065
+ readonly quill__resolve: (a: number, b: number, c: number, d: number, e: number) => void;
1081
1066
  readonly quill_backendId: (a: number, b: number) => void;
1082
1067
  readonly quill_blueprint: (a: number, b: number) => void;
1083
1068
  readonly quill_conform: (a: number, b: number, c: number) => void;
1084
1069
  readonly quill_emptyDocument: (a: number) => number;
1070
+ readonly quill_exampleDocument: (a: number, b: number) => void;
1085
1071
  readonly quill_fromTree: (a: number, b: number) => void;
1086
1072
  readonly quill_metadata: (a: number, b: number) => void;
1087
1073
  readonly quill_parse: (a: number, b: number, c: number, d: number) => void;
package/core/wasm.js CHANGED
@@ -294,30 +294,6 @@ export class Document {
294
294
  wasm.__wbindgen_add_to_stack_pointer(16);
295
295
  }
296
296
  }
297
- /**
298
- * A blueprint's fill obligation for the given `quillName`, re-exposed from
299
- * core. Carries no tool name: pair it with your own next-step directive.
300
- * @param {string} quill_name
301
- * @returns {string}
302
- */
303
- static blueprintInstruction(quill_name) {
304
- let deferred2_0;
305
- let deferred2_1;
306
- try {
307
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
308
- const ptr0 = passStringToWasm0(quill_name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
309
- const len0 = WASM_VECTOR_LEN;
310
- wasm.document_blueprintInstruction(retptr, ptr0, len0);
311
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
312
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
313
- deferred2_0 = r0;
314
- deferred2_1 = r1;
315
- return getStringFromWasm0(r0, r1);
316
- } finally {
317
- wasm.__wbindgen_add_to_stack_pointer(16);
318
- wasm.__wbindgen_export4(deferred2_0, deferred2_1, 1);
319
- }
320
- }
321
297
  /**
322
298
  * The **body** markdown projection: an on-demand, lossy export (content-only
323
299
  * marks do not survive markdown). A body's type is a format fact, not a
@@ -454,27 +430,6 @@ export class Document {
454
430
  const ret = wasm.document_equals(this.__wbg_ptr, other.__wbg_ptr);
455
431
  return ret !== 0;
456
432
  }
457
- /**
458
- * Authoring-format rules for the card-yaml markdown surface, re-exposed from
459
- * core. Constant across calls; read once and cache.
460
- * @returns {string}
461
- */
462
- static formatRules() {
463
- let deferred1_0;
464
- let deferred1_1;
465
- try {
466
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
467
- wasm.document_formatRules(retptr);
468
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
469
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
470
- deferred1_0 = r0;
471
- deferred1_1 = r1;
472
- return getStringFromWasm0(r0, r1);
473
- } finally {
474
- wasm.__wbindgen_add_to_stack_pointer(16);
475
- wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
476
- }
477
- }
478
433
  /**
479
434
  * Parse markdown into a typed Document. Throws on parse errors.
480
435
  * @param {string} markdown
@@ -602,28 +557,6 @@ export class Document {
602
557
  wasm.__wbindgen_add_to_stack_pointer(16);
603
558
  }
604
559
  }
605
- /**
606
- * Whether the field at `addr` is marked `!must_fill`. A bare string is `Addr`
607
- * shorthand for `{ field }`. `false` for an absent field and for a body
608
- * address; only an out-of-range `addr.card` throws.
609
- * @param {Addr | string} addr
610
- * @returns {boolean}
611
- */
612
- isFill(addr) {
613
- try {
614
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
615
- wasm.document_isFill(retptr, this.__wbg_ptr, addHeapObject(addr));
616
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
617
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
618
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
619
- if (r2) {
620
- throw takeObject(r1);
621
- }
622
- return r0 !== 0;
623
- } finally {
624
- wasm.__wbindgen_add_to_stack_pointer(16);
625
- }
626
- }
627
560
  /**
628
561
  * Replace this document's contents **in place** from a versioned storage DTO
629
562
  * string: the mutating twin of [`fromStored`](Document::from_stored).
@@ -666,6 +599,27 @@ export class Document {
666
599
  wasm.__wbindgen_add_to_stack_pointer(16);
667
600
  }
668
601
  }
602
+ /**
603
+ * The Quillmark Markdown rules, re-exposed from core. Constant across
604
+ * calls; read once and cache.
605
+ * @returns {string}
606
+ */
607
+ static markdownRules() {
608
+ let deferred1_0;
609
+ let deferred1_1;
610
+ try {
611
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
612
+ wasm.document_markdownRules(retptr);
613
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
614
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
615
+ deferred1_0 = r0;
616
+ deferred1_1 = r1;
617
+ return getStringFromWasm0(r0, r1);
618
+ } finally {
619
+ wasm.__wbindgen_add_to_stack_pointer(16);
620
+ wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
621
+ }
622
+ }
669
623
  /**
670
624
  * Move the card at `from` to position `to`. `from == to` is a no-op.
671
625
  * @param {number} from
@@ -688,8 +642,8 @@ export class Document {
688
642
  * A blank document: a main card carrying only `$quill`, an empty body, and
689
643
  * no composable cards. Absent fields resolve at render time (`default`, else
690
644
  * the field's blank), so nothing the caller did not set reaches the output.
691
- * For an example-filled starter use `Quill.seedDocument()`. Throws on an
692
- * invalid quill reference.
645
+ * For one instance of every card kind use `Quill.seedDocument()`. Throws on
646
+ * an invalid quill reference.
693
647
  * @param {string} quill_ref
694
648
  */
695
649
  constructor(quill_ref) {
@@ -1032,7 +986,7 @@ export class Document {
1032
986
  * Store a field verbatim at `addr`, deferring coercion to render; the typed
1033
987
  * write is [`commitField`](Document::commit_field). A bare string is `Addr`
1034
988
  * shorthand for `{ field }`; `{ card: 2, field: "qty" }` targets a
1035
- * composable card. Clears any `!must_fill` marker. A body address throws:
989
+ * composable card. A body address throws:
1036
990
  * write a body with `revise` / `overwrite`. Throws on an out-of-range card
1037
991
  * or a malformed name.
1038
992
  * @param {Addr | string} addr
@@ -1073,25 +1027,6 @@ export class Document {
1073
1027
  wasm.__wbindgen_add_to_stack_pointer(16);
1074
1028
  }
1075
1029
  }
1076
- /**
1077
- * Store a field verbatim at `addr` and mark it `!must_fill`. A body address
1078
- * throws; same validation as [`storeField`](Document::store_field).
1079
- * @param {Addr | string} addr
1080
- * @param {any} value
1081
- */
1082
- storeFill(addr, value) {
1083
- try {
1084
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1085
- wasm.document_storeFill(retptr, this.__wbg_ptr, addHeapObject(addr), addHeapObject(value));
1086
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1087
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1088
- if (r1) {
1089
- throw takeObject(r0);
1090
- }
1091
- } finally {
1092
- wasm.__wbindgen_add_to_stack_pointer(16);
1093
- }
1094
- }
1095
1030
  /**
1096
1031
  * Merge a card-kind's seed `overlay` into the **main** card's `$seed` map
1097
1032
  * under `cardKind`, preserving sibling kinds; `$seed` is main-only, so this
@@ -1207,15 +1142,18 @@ export class Quill {
1207
1142
  * `FieldSource` rung it came from (`"authored" | "default" | "blank"`). The
1208
1143
  * card body is a `body` sibling on its card, never a row in `fields`, and
1209
1144
  * `null` when the kind enables no body. Value and provenance only;
1210
- * completeness stays `validate`'s.
1145
+ * diagnostics stay `validate`'s. `today` reads as on `Quillmark.open`.
1211
1146
  * @param {Document} doc
1147
+ * @param {string | null} [today]
1212
1148
  * @returns {Resolved}
1213
1149
  */
1214
- _resolve(doc) {
1150
+ _resolve(doc, today) {
1215
1151
  try {
1216
1152
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1217
1153
  _assertClass(doc, Document);
1218
- wasm.quill__resolve(retptr, this.__wbg_ptr, doc.__wbg_ptr);
1154
+ var ptr0 = isLikeNone(today) ? 0 : passStringToWasm0(today, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1155
+ var len0 = WASM_VECTOR_LEN;
1156
+ wasm.quill__resolve(retptr, this.__wbg_ptr, doc.__wbg_ptr, ptr0, len0);
1219
1157
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1220
1158
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1221
1159
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -1274,8 +1212,7 @@ export class Quill {
1274
1212
  * transport door (`fromMarkdown`, `fromStored`, a stored row).
1275
1213
  *
1276
1214
  * Idempotent: an equal value is not rewritten, so YAML comments and stored
1277
- * bytes survive. A `!must_fill` marker anywhere in a field's value skips
1278
- * that field, and a value the strict write refuses stays as authored with a
1215
+ * bytes survive. A value the strict write refuses stays as authored with a
1279
1216
  * diagnostic. Throws when `doc` declares a different `$quill`, before any
1280
1217
  * mutation.
1281
1218
  * @param {Document} doc
@@ -1309,6 +1246,30 @@ export class Quill {
1309
1246
  const ret = wasm.quill_emptyDocument(this.__wbg_ptr);
1310
1247
  return Document.__wrap(ret);
1311
1248
  }
1249
+ /**
1250
+ * The quill's example document, `undefined` when the quill has no
1251
+ * `example.md` at its root: a filled-in page whose values are made up to show the
1252
+ * quill in use, never kept. It comes back pinned to this quill's
1253
+ * `name@version` and conformed as `parse` conforms, its parse and
1254
+ * `conform::*` warnings on `doc.warnings`. Throws when the file does not
1255
+ * parse or its `$quill` is not this quill's bare name.
1256
+ * @returns {Document | undefined}
1257
+ */
1258
+ exampleDocument() {
1259
+ try {
1260
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1261
+ wasm.quill_exampleDocument(retptr, this.__wbg_ptr);
1262
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1263
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1264
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1265
+ if (r2) {
1266
+ throw takeObject(r1);
1267
+ }
1268
+ return r0 === 0 ? undefined : Document.__wrap(r0);
1269
+ } finally {
1270
+ wasm.__wbindgen_add_to_stack_pointer(16);
1271
+ }
1272
+ }
1312
1273
  /**
1313
1274
  * Build a quill from a file tree. Pure: the declared backend is resolved
1314
1275
  * later, at render time. Accepts a `Map<string, Uint8Array>` or a plain
@@ -1406,9 +1367,9 @@ export class Quill {
1406
1367
  }
1407
1368
  /**
1408
1369
  * Seed a starter composable `Card` of the given kind (carries `$kind`),
1409
- * layering an optional per-kind seed `overlay` over the schema-example base
1410
- * (`overlay › example › absent`). `undefined` when `cardKind` is not
1411
- * declared in this quill's schema.
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.
1412
1373
  *
1413
1374
  * Pass `document.seedOverlay(cardKind)` as `overlay` so a card added to a
1414
1375
  * template-derived document inherits its curated starting values; omit it
@@ -1436,9 +1397,8 @@ export class Quill {
1436
1397
  }
1437
1398
  /**
1438
1399
  * Seed a starter `Document` from the schema: the main card plus one instance
1439
- * of each composable card kind, each committing its fields' `example:`
1440
- * values and leaving every other field absent (interpolated at render as
1441
- * `default:`, else the field's blank). A field with both renders its example.
1400
+ * of each composable card kind, each body empty and every field absent
1401
+ * (interpolated at render as `default:`, else the field's blank).
1442
1402
  * @returns {Document}
1443
1403
  */
1444
1404
  seedDocument() {
@@ -1482,8 +1442,7 @@ export class Quill {
1482
1442
  /**
1483
1443
  * Validate `doc` against this quill's schema, returning every diagnostic
1484
1444
  * (empty when the document is valid). Forwards the canonical
1485
- * `validation::*` diagnostics the engine emits, including the non-fatal
1486
- * `validation::must_fill` warning per `!must_fill` marker left behind.
1445
+ * `validation::*` diagnostics the engine emits.
1487
1446
  * @param {Document} doc
1488
1447
  * @returns {Diagnostic[]}
1489
1448
  */
@@ -1653,6 +1612,54 @@ export function importMarkdown(markdown) {
1653
1612
  }
1654
1613
  }
1655
1614
 
1615
+ /**
1616
+ * Whether `content` satisfies the `inline` constraint of `richtext` and
1617
+ * `plaintext`: one `Para` line, in no container, with no islands. Judged on
1618
+ * the normalized content, which is what a write stores. Throws if `content` is
1619
+ * not canonical content.
1620
+ * @param {Content} content
1621
+ * @returns {boolean}
1622
+ */
1623
+ export function isInline(content) {
1624
+ try {
1625
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1626
+ wasm.isInline(retptr, addHeapObject(content));
1627
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1628
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1629
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1630
+ if (r2) {
1631
+ throw takeObject(r1);
1632
+ }
1633
+ return r0 !== 0;
1634
+ } finally {
1635
+ wasm.__wbindgen_add_to_stack_pointer(16);
1636
+ }
1637
+ }
1638
+
1639
+ /**
1640
+ * Whether `content` satisfies the `plaintext` constraint: no marks, no
1641
+ * islands, every line a `Para` in no container. Judged on the normalized
1642
+ * content, which is what a write stores. Throws if `content` is not canonical
1643
+ * content.
1644
+ * @param {Content} content
1645
+ * @returns {boolean}
1646
+ */
1647
+ export function isPlain(content) {
1648
+ try {
1649
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1650
+ wasm.isPlain(retptr, addHeapObject(content));
1651
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1652
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1653
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1654
+ if (r2) {
1655
+ throw takeObject(r1);
1656
+ }
1657
+ return r0 !== 0;
1658
+ } finally {
1659
+ wasm.__wbindgen_add_to_stack_pointer(16);
1660
+ }
1661
+ }
1662
+
1656
1663
  /**
1657
1664
  * Where `bundle`'s text-moving channels (`delta`, then `islandOps`, then
1658
1665
  * `lineOps`) leave `content`'s marks: the final-text coordinates the bundle's
@@ -1898,6 +1905,18 @@ function __wbg_get_imports() {
1898
1905
  const ret = Array.from(getObject(arg0));
1899
1906
  return addHeapObject(ret);
1900
1907
  },
1908
+ __wbg_getDate_8e7807f062ade36a: function(arg0) {
1909
+ const ret = getObject(arg0).getDate();
1910
+ return ret;
1911
+ },
1912
+ __wbg_getFullYear_0cfd5a75cf3d5856: function(arg0) {
1913
+ const ret = getObject(arg0).getFullYear();
1914
+ return ret;
1915
+ },
1916
+ __wbg_getMonth_01ce17d889ed7e5e: function(arg0) {
1917
+ const ret = getObject(arg0).getMonth();
1918
+ return ret;
1919
+ },
1901
1920
  __wbg_get_6cf5a4d4d8ad3c5a: function() { return handleError(function (arg0, arg1) {
1902
1921
  const ret = Reflect.get(getObject(arg0), getObject(arg1));
1903
1922
  return addHeapObject(ret);
@@ -1978,6 +1997,10 @@ function __wbg_get_imports() {
1978
1997
  const ret = getObject(arg0).length;
1979
1998
  return ret;
1980
1999
  },
2000
+ __wbg_new_0_35540e542ba689d2: function() {
2001
+ const ret = new Date();
2002
+ return addHeapObject(ret);
2003
+ },
1981
2004
  __wbg_new_1da3429bc3c4541c: function(arg0) {
1982
2005
  const ret = new Uint8Array(getObject(arg0));
1983
2006
  return addHeapObject(ret);