@quillmark/wasm 0.115.0 → 0.116.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,47 +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." */
410
+ /** Example body content, shown on the blueprint's `# body e.g.` line above the body. */
431
411
  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
412
  }
438
413
 
414
+ export type QuillFieldType = "string" | "number" | "integer" | "boolean" | "array" | "object" | "date" | "datetime" | "richtext" | "plaintext" | "enum" | "matrix";
415
+
439
416
  /** Schema entry for a single field declared in a quill's `Quill.yaml`.
440
417
  *
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.
418
+ * `default` is the value an unanswered cell renders; `example` documents shape
419
+ * and never renders. An absent field without a `default` blank-fills.
446
420
  */
447
421
  export interface QuillFieldSchema {
448
- type: "string" | "number" | "integer" | "boolean" | "array" | "object" | "date" | "datetime" | "richtext" | "plaintext" | "enum" | "matrix";
422
+ /** A trailing `?` marks the cell optional: unanswered, it renders `none`
423
+ * rather than its type's blank, and it never carries a `default`. A
424
+ * consumer offers a way back to unanswered (`removeField`) on such a cell. */
425
+ type: QuillFieldType | `${Exclude<QuillFieldType, "object" | "matrix">}?`;
426
+ /** The field's label, a literal. Absent, the consumer humanizes the key
427
+ * (`memo_for` → "Memo For"). Never present on an array's `items`. */
428
+ title?: string;
449
429
  description?: string;
450
430
  default?: unknown;
451
431
  example?: unknown;
@@ -477,6 +457,9 @@ export interface QuillFieldSchema {
477
457
 
478
458
  /** Schema entry for the main card or a named card kind. */
479
459
  export interface QuillCardSchema {
460
+ /** The kind's label, a literal. Absent, the consumer humanizes the kind
461
+ * name. An instance takes its label from its own values. */
462
+ title?: string;
480
463
  description?: string;
481
464
  fields: Record<string, QuillFieldSchema>;
482
465
  ui?: QuillCardUi;
@@ -558,11 +541,6 @@ export class Document {
558
541
  * building `markOps` need not predict it.
559
542
  */
560
543
  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
544
  /**
567
545
  * The **body** markdown projection: an on-demand, lossy export (content-only
568
546
  * marks do not survive markdown). A body's type is a format fact, not a
@@ -596,11 +574,6 @@ export class Document {
596
574
  * Structural equality, excluding parse-time `warnings`.
597
575
  */
598
576
  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
577
  /**
605
578
  * Parse markdown into a typed Document. Throws on parse errors.
606
579
  */
@@ -646,12 +619,6 @@ export class Document {
646
619
  * `at` is out of range.
647
620
  */
648
621
  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
622
  /**
656
623
  * Replace this document's contents **in place** from a versioned storage DTO
657
624
  * string: the mutating twin of [`fromStored`](Document::from_stored).
@@ -660,6 +627,11 @@ export class Document {
660
627
  * variable.
661
628
  */
662
629
  loadStored(json: string): void;
630
+ /**
631
+ * The Quillmark Markdown rules, re-exposed from core. Constant across
632
+ * calls; read once and cache.
633
+ */
634
+ static markdownRules(): string;
663
635
  /**
664
636
  * Move the card at `from` to position `to`. `from == to` is a no-op.
665
637
  */
@@ -668,8 +640,8 @@ export class Document {
668
640
  * A blank document: a main card carrying only `$quill`, an empty body, and
669
641
  * no composable cards. Absent fields resolve at render time (`default`, else
670
642
  * 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.
643
+ * For one instance of every card kind use `Quill.seedDocument()`. Throws on
644
+ * an invalid quill reference.
673
645
  */
674
646
  constructor(quill_ref: string);
675
647
  /**
@@ -766,7 +738,7 @@ export class Document {
766
738
  * Store a field verbatim at `addr`, deferring coercion to render; the typed
767
739
  * write is [`commitField`](Document::commit_field). A bare string is `Addr`
768
740
  * shorthand for `{ field }`; `{ card: 2, field: "qty" }` targets a
769
- * composable card. Clears any `!must_fill` marker. A body address throws:
741
+ * composable card. A body address throws:
770
742
  * write a body with `revise` / `overwrite`. Throws on an out-of-range card
771
743
  * or a malformed name.
772
744
  */
@@ -779,11 +751,6 @@ export class Document {
779
751
  * one entry per offending field. Throws on an out-of-range card.
780
752
  */
781
753
  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
754
  /**
788
755
  * Merge a card-kind's seed `overlay` into the **main** card's `$seed` map
789
756
  * under `cardKind`, preserving sibling kinds; `$seed` is main-only, so this
@@ -833,8 +800,7 @@ export class Quill {
833
800
  * transport door (`fromMarkdown`, `fromStored`, a stored row).
834
801
  *
835
802
  * 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
803
+ * bytes survive. A value the strict write refuses stays as authored with a
838
804
  * diagnostic. Throws when `doc` declares a different `$quill`, before any
839
805
  * mutation.
840
806
  */
@@ -868,9 +834,9 @@ export class Quill {
868
834
  parse(markdown: string): Document;
869
835
  /**
870
836
  * 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.
837
+ * committing an optional per-kind seed `overlay`'s fields and `$body`
838
+ * (`overlay › absent`, body `overlay › empty`). `undefined` when
839
+ * `cardKind` is not declared in this quill's schema.
874
840
  *
875
841
  * Pass `document.seedOverlay(cardKind)` as `overlay` so a card added to a
876
842
  * template-derived document inherits its curated starting values; omit it
@@ -879,9 +845,9 @@ export class Quill {
879
845
  seedCard(card_kind: string, overlay: Record<string, unknown> | undefined): Card | undefined;
880
846
  /**
881
847
  * 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.
848
+ * of each composable card kind, each body empty and every field absent
849
+ * (interpolated at render as `default:`, else the field's blank). No
850
+ * `example:` is committed (a field's or `body.example`).
885
851
  */
886
852
  seedDocument(): Document;
887
853
  /**
@@ -902,8 +868,7 @@ export class Quill {
902
868
  /**
903
869
  * Validate `doc` against this quill's schema, returning every diagnostic
904
870
  * (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.
871
+ * `validation::*` diagnostics the engine emits.
907
872
  */
908
873
  validate(doc: Document): Diagnostic[];
909
874
  /**
@@ -965,6 +930,22 @@ export function formatDocPath(segs: DocPathSeg[]): string;
965
930
  */
966
931
  export function importMarkdown(markdown: string): Content;
967
932
 
933
+ /**
934
+ * Whether `content` satisfies the `inline` constraint of `richtext` and
935
+ * `plaintext`: one `Para` line, in no container, with no islands. Judged on
936
+ * the normalized content, which is what a write stores. Throws if `content` is
937
+ * not canonical content.
938
+ */
939
+ export function isInline(content: Content): boolean;
940
+
941
+ /**
942
+ * Whether `content` satisfies the `plaintext` constraint: no marks, no
943
+ * islands, every line a `Para` in no container. Judged on the normalized
944
+ * content, which is what a write stores. Throws if `content` is not canonical
945
+ * content.
946
+ */
947
+ export function isPlain(content: Content): boolean;
948
+
968
949
  /**
969
950
  * Where `bundle`'s text-moving channels (`delta`, then `islandOps`, then
970
951
  * `lineOps`) leave `content`'s marks: the final-text coordinates the bundle's
@@ -1030,7 +1011,6 @@ export interface InitOutput {
1030
1011
  readonly document__readerGetContentAt: (a: number, b: number, c: number, d: number, e: number) => void;
1031
1012
  readonly document__reviseField: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
1032
1013
  readonly document_applyChange: (a: number, b: number, c: number, d: number) => void;
1033
- readonly document_blueprintInstruction: (a: number, b: number, c: number) => void;
1034
1014
  readonly document_bodyMarkdown: (a: number, b: number, c: number) => void;
1035
1015
  readonly document_card: (a: number, b: number, c: number) => void;
1036
1016
  readonly document_cardCount: (a: number) => number;
@@ -1039,15 +1019,14 @@ export interface InitOutput {
1039
1019
  readonly document_clone: (a: number) => number;
1040
1020
  readonly document_currentStorageVersion: (a: number) => void;
1041
1021
  readonly document_equals: (a: number, b: number) => number;
1042
- readonly document_formatRules: (a: number) => void;
1043
1022
  readonly document_fromMarkdown: (a: number, b: number, c: number) => void;
1044
1023
  readonly document_fromStored: (a: number, b: number, c: number) => void;
1045
1024
  readonly document_getExt: (a: number, b: number, c: number) => void;
1046
1025
  readonly document_getStored: (a: number, b: number, c: number) => void;
1047
1026
  readonly document_insertCard: (a: number, b: number, c: number, d: number) => void;
1048
- readonly document_isFill: (a: number, b: number, c: number) => void;
1049
1027
  readonly document_loadStored: (a: number, b: number, c: number, d: number) => void;
1050
1028
  readonly document_main: (a: number, b: number) => void;
1029
+ readonly document_markdownRules: (a: number) => void;
1051
1030
  readonly document_moveCard: (a: number, b: number, c: number, d: number) => void;
1052
1031
  readonly document_new: (a: number, b: number, c: number) => void;
1053
1032
  readonly document_overwrite: (a: number, b: number, c: number, d: number) => void;
@@ -1065,7 +1044,6 @@ export interface InitOutput {
1065
1044
  readonly document_storeExt: (a: number, b: number, c: number, d: number) => void;
1066
1045
  readonly document_storeField: (a: number, b: number, c: number, d: number) => void;
1067
1046
  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
1047
  readonly document_storeSeedOverlay: (a: number, b: number, c: number, d: number, e: number) => void;
1070
1048
  readonly document_toMarkdown: (a: number, b: number) => void;
1071
1049
  readonly document_toStored: (a: number, b: number) => void;
@@ -1074,10 +1052,12 @@ export interface InitOutput {
1074
1052
  readonly formatDiagnostic: (a: number, b: number) => void;
1075
1053
  readonly formatDocPath: (a: number, b: number) => void;
1076
1054
  readonly importMarkdown: (a: number, b: number, c: number) => void;
1055
+ readonly isInline: (a: number, b: number) => void;
1056
+ readonly isPlain: (a: number, b: number) => void;
1077
1057
  readonly mapMarks: (a: number, b: number, c: number) => void;
1078
1058
  readonly mapPos: (a: number, b: number, c: number, d: number) => void;
1079
1059
  readonly parseDocPath: (a: number, b: number, c: number) => void;
1080
- readonly quill__resolve: (a: number, b: number, c: number) => void;
1060
+ readonly quill__resolve: (a: number, b: number, c: number, d: number, e: number) => void;
1081
1061
  readonly quill_backendId: (a: number, b: number) => void;
1082
1062
  readonly quill_blueprint: (a: number, b: number) => void;
1083
1063
  readonly quill_conform: (a: number, b: number, c: 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
@@ -1406,9 +1343,9 @@ export class Quill {
1406
1343
  }
1407
1344
  /**
1408
1345
  * 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.
1346
+ * committing an optional per-kind seed `overlay`'s fields and `$body`
1347
+ * (`overlay › absent`, body `overlay › empty`). `undefined` when
1348
+ * `cardKind` is not declared in this quill's schema.
1412
1349
  *
1413
1350
  * Pass `document.seedOverlay(cardKind)` as `overlay` so a card added to a
1414
1351
  * template-derived document inherits its curated starting values; omit it
@@ -1436,9 +1373,9 @@ export class Quill {
1436
1373
  }
1437
1374
  /**
1438
1375
  * 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.
1376
+ * of each composable card kind, each body empty and every field absent
1377
+ * (interpolated at render as `default:`, else the field's blank). No
1378
+ * `example:` is committed (a field's or `body.example`).
1442
1379
  * @returns {Document}
1443
1380
  */
1444
1381
  seedDocument() {
@@ -1482,8 +1419,7 @@ export class Quill {
1482
1419
  /**
1483
1420
  * Validate `doc` against this quill's schema, returning every diagnostic
1484
1421
  * (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.
1422
+ * `validation::*` diagnostics the engine emits.
1487
1423
  * @param {Document} doc
1488
1424
  * @returns {Diagnostic[]}
1489
1425
  */
@@ -1653,6 +1589,54 @@ export function importMarkdown(markdown) {
1653
1589
  }
1654
1590
  }
1655
1591
 
1592
+ /**
1593
+ * Whether `content` satisfies the `inline` constraint of `richtext` and
1594
+ * `plaintext`: one `Para` line, in no container, with no islands. Judged on
1595
+ * the normalized content, which is what a write stores. Throws if `content` is
1596
+ * not canonical content.
1597
+ * @param {Content} content
1598
+ * @returns {boolean}
1599
+ */
1600
+ export function isInline(content) {
1601
+ try {
1602
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1603
+ wasm.isInline(retptr, addHeapObject(content));
1604
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1605
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1606
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1607
+ if (r2) {
1608
+ throw takeObject(r1);
1609
+ }
1610
+ return r0 !== 0;
1611
+ } finally {
1612
+ wasm.__wbindgen_add_to_stack_pointer(16);
1613
+ }
1614
+ }
1615
+
1616
+ /**
1617
+ * Whether `content` satisfies the `plaintext` constraint: no marks, no
1618
+ * islands, every line a `Para` in no container. Judged on the normalized
1619
+ * content, which is what a write stores. Throws if `content` is not canonical
1620
+ * content.
1621
+ * @param {Content} content
1622
+ * @returns {boolean}
1623
+ */
1624
+ export function isPlain(content) {
1625
+ try {
1626
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1627
+ wasm.isPlain(retptr, addHeapObject(content));
1628
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1629
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1630
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1631
+ if (r2) {
1632
+ throw takeObject(r1);
1633
+ }
1634
+ return r0 !== 0;
1635
+ } finally {
1636
+ wasm.__wbindgen_add_to_stack_pointer(16);
1637
+ }
1638
+ }
1639
+
1656
1640
  /**
1657
1641
  * Where `bundle`'s text-moving channels (`delta`, then `islandOps`, then
1658
1642
  * `lineOps`) leave `content`'s marks: the final-text coordinates the bundle's
@@ -1898,6 +1882,18 @@ function __wbg_get_imports() {
1898
1882
  const ret = Array.from(getObject(arg0));
1899
1883
  return addHeapObject(ret);
1900
1884
  },
1885
+ __wbg_getDate_8e7807f062ade36a: function(arg0) {
1886
+ const ret = getObject(arg0).getDate();
1887
+ return ret;
1888
+ },
1889
+ __wbg_getFullYear_0cfd5a75cf3d5856: function(arg0) {
1890
+ const ret = getObject(arg0).getFullYear();
1891
+ return ret;
1892
+ },
1893
+ __wbg_getMonth_01ce17d889ed7e5e: function(arg0) {
1894
+ const ret = getObject(arg0).getMonth();
1895
+ return ret;
1896
+ },
1901
1897
  __wbg_get_6cf5a4d4d8ad3c5a: function() { return handleError(function (arg0, arg1) {
1902
1898
  const ret = Reflect.get(getObject(arg0), getObject(arg1));
1903
1899
  return addHeapObject(ret);
@@ -1978,6 +1974,10 @@ function __wbg_get_imports() {
1978
1974
  const ret = getObject(arg0).length;
1979
1975
  return ret;
1980
1976
  },
1977
+ __wbg_new_0_35540e542ba689d2: function() {
1978
+ const ret = new Date();
1979
+ return addHeapObject(ret);
1980
+ },
1981
1981
  __wbg_new_1da3429bc3c4541c: function(arg0) {
1982
1982
  const ret = new Uint8Array(getObject(arg0));
1983
1983
  return addHeapObject(ret);
package/core/wasm_bg.wasm CHANGED
Binary file