@quillmark/wasm 0.82.0 → 0.84.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/README.md CHANGED
@@ -244,6 +244,24 @@ canvas.style.height = `${result.layoutHeight}px`;
244
244
  enforcement contract and includes the resolved `backendId` for
245
245
  debugging.
246
246
 
247
+ ### Schema model
248
+
249
+ A field's *cell* is inferred from whether its schema declares a `default:`:
250
+
251
+ - **Must Fill** (no `default:`) — `quill.blueprint` renders `<must-fill>`
252
+ in the value cell, and `quill.render(doc)` throws with
253
+ `validation::must_fill_absent` when the field is absent at
254
+ validate time, or `validation::must_fill_sentinel` when the
255
+ `<must-fill>` sentinel survives into the document.
256
+ - **Endorsed** (with `default:`) — `quill.blueprint` renders the
257
+ default value followed by a `; skip-ok` annotation, and the default
258
+ is used when the document omits the field.
259
+
260
+ `QuillFieldSchema` no longer carries a `required` axis. The legacy
261
+ `validation::missing_required` code has been replaced by
262
+ `validation::must_fill_absent`; the `validation::must_fill_sentinel`
263
+ code covers unreplaced sentinels.
264
+
247
265
  ### Errors
248
266
 
249
267
  Every method that can fail throws a JS `Error` with `.diagnostics` attached:
@@ -263,7 +281,7 @@ compilation failures. The same shape applies to every throw site:
263
281
  - `Document.fromMarkdown` — parse errors (missing root `$quill` metadata, YAML
264
282
  errors, `parse::input_too_large` for inputs > 10 MB).
265
283
  - `Document` mutators (`setField`, `updateCardField`, etc.) — `EditError`
266
- variants (`ReservedName`, `InvalidFieldName`, `InvalidKindName`,
284
+ variants (`InvalidFieldName`, `InvalidKindName`, `ReservedKind`,
267
285
  `IndexOutOfRange`) appear in `diagnostics[0].message` with the
268
286
  `[EditError::<Variant>]` prefix.
269
287
  - `quill.render` / `session.render` — backend compilation failures and
package/bundler/wasm.d.ts CHANGED
@@ -106,13 +106,20 @@ export interface QuillCardBody {
106
106
  example?: string;
107
107
  }
108
108
 
109
- /** Schema entry for a single field declared in a quill's `Quill.yaml`. */
109
+ /** Schema entry for a single field declared in a quill's `Quill.yaml`.
110
+ *
111
+ * A field's *cell* is determined by `default`: a field with a `default`
112
+ * is **Endorsed** (the rendered value is shippable as-is), while a field
113
+ * without a `default` is **Must Fill** (the blueprint carries a
114
+ * `<must-fill>` sentinel and validation reports
115
+ * `validation::must_fill_absent` if the field is absent at validate
116
+ * time). There is no separate `required` axis.
117
+ */
110
118
  export interface QuillFieldSchema {
111
119
  type: "string" | "number" | "integer" | "boolean" | "array" | "object" | "date" | "datetime" | "markdown";
112
120
  description?: string;
113
121
  default?: unknown;
114
122
  example?: unknown;
115
- required?: boolean;
116
123
  enum?: string[];
117
124
  ui?: QuillFieldUi;
118
125
  properties?: Record<string, QuillFieldSchema>;
@@ -130,8 +137,9 @@ export interface QuillCardSchema {
130
137
  /**
131
138
  * Document schema returned by `Quill.schema`. Includes optional `ui` keys.
132
139
  *
133
- * `main.fields.QUILL` and `card_kinds[name].fields.CARD` are required
134
- * reserved fields with `const` values telling consumers what to write.
140
+ * Describes only the user-fillable fields. The quill reference
141
+ * (constructed as `${metadata.name}@${metadata.version}`) and card-kind
142
+ * discriminators are document-level metadata, not schema fields.
135
143
  */
136
144
  export interface QuillSchema {
137
145
  main: QuillCardSchema;
@@ -202,6 +210,7 @@ export interface Artifact {
202
210
  export interface Card {
203
211
  kind: string;
204
212
  payloadItems: PayloadItem[];
213
+ ext?: Record<string, unknown> | undefined;
205
214
  body: string;
206
215
  }
207
216
 
@@ -294,8 +303,7 @@ export class Document {
294
303
  removeCardField(index: number, name: string): any;
295
304
  /**
296
305
  * Remove a payload field on the main card, returning the removed value or
297
- * `undefined`. Throws if `name` is reserved or does not match
298
- * `[a-z_][a-z0-9_]*`.
306
+ * `undefined`. Throws if `name` does not match `[a-z_][a-z0-9_]*`.
299
307
  */
300
308
  removeField(name: string): any;
301
309
  replaceBody(body: string): void;
@@ -315,8 +323,7 @@ export class Document {
315
323
  /**
316
324
  * Update a payload field on the main card. Clears any existing `!fill` marker.
317
325
  *
318
- * Throws if `name` is reserved (`BODY`, `CARDS`, `QUILL`, `CARD`) or does
319
- * not match `[a-z_][a-z0-9_]*`.
326
+ * Throws if `name` does not match `[a-z_][a-z0-9_]*`.
320
327
  */
321
328
  setField(name: string, value: any): void;
322
329
  /**
@@ -239,8 +239,7 @@ export class Document {
239
239
  }
240
240
  /**
241
241
  * Remove a payload field on the main card, returning the removed value or
242
- * `undefined`. Throws if `name` is reserved or does not match
243
- * `[a-z_][a-z0-9_]*`.
242
+ * `undefined`. Throws if `name` does not match `[a-z_][a-z0-9_]*`.
244
243
  * @param {string} name
245
244
  * @returns {any}
246
245
  */
@@ -320,8 +319,7 @@ export class Document {
320
319
  /**
321
320
  * Update a payload field on the main card. Clears any existing `!fill` marker.
322
321
  *
323
- * Throws if `name` is reserved (`BODY`, `CARDS`, `QUILL`, `CARD`) or does
324
- * not match `[a-z_][a-z0-9_]*`.
322
+ * Throws if `name` does not match `[a-z_][a-z0-9_]*`.
325
323
  * @param {string} name
326
324
  * @param {any} value
327
325
  */
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quillmark/wasm",
3
- "version": "0.82.0",
3
+ "version": "0.84.0",
4
4
  "description": "WebAssembly bindings for quillmark",
5
5
  "type": "module",
6
6
  "license": "MIT OR Apache-2.0",