@quillmark/wasm 0.77.0 → 0.78.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 +7 -7
- package/bundler/wasm.d.ts +99 -98
- package/bundler/wasm_bg.js +111 -111
- package/bundler/wasm_bg.wasm +0 -0
- package/bundler/wasm_bg.wasm.d.ts +45 -45
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -69,19 +69,19 @@ semantic equality.
|
|
|
69
69
|
|
|
70
70
|
### `doc.equals(other)`
|
|
71
71
|
Structural equality between two `Document` handles. Compares `main` and
|
|
72
|
-
`
|
|
72
|
+
`leaves` by value; parse-time `warnings` are intentionally excluded.
|
|
73
73
|
|
|
74
74
|
Use this to debounce upstream prop updates: keep the last parsed `Document`
|
|
75
75
|
and compare instead of re-parsing on every keystroke.
|
|
76
76
|
|
|
77
|
-
### `doc.
|
|
78
|
-
O(1) getter for the number of composable
|
|
79
|
-
Use this to validate indices before calling
|
|
80
|
-
`
|
|
77
|
+
### `doc.leafCount`
|
|
78
|
+
O(1) getter for the number of composable leaves (excluding the main leaf).
|
|
79
|
+
Use this to validate indices before calling leaf mutators (`removeLeaf`,
|
|
80
|
+
`updateLeafField`, etc.) without allocating the full `leaves` array.
|
|
81
81
|
|
|
82
82
|
### `quill.form(doc)`
|
|
83
83
|
|
|
84
|
-
Returns `{ main,
|
|
84
|
+
Returns `{ main, leaves, diagnostics }` — a schema-aware snapshot of `doc`
|
|
85
85
|
without invoking the backend. `diagnostics` contains validation errors and
|
|
86
86
|
warnings; an empty array means the document is valid. Useful for validating
|
|
87
87
|
content without rendering:
|
|
@@ -181,7 +181,7 @@ compilation failures. The same shape applies to every throw site:
|
|
|
181
181
|
|
|
182
182
|
- `Document.fromMarkdown` — parse errors (missing `QUILL`, YAML errors,
|
|
183
183
|
`parse::input_too_large` for inputs > 10 MB).
|
|
184
|
-
- `Document` mutators (`setField`, `
|
|
184
|
+
- `Document` mutators (`setField`, `updateLeafField`, etc.) — `EditError`
|
|
185
185
|
variants (`ReservedName`, `InvalidFieldName`, `InvalidTagName`,
|
|
186
186
|
`IndexOutOfRange`) appear in `diagnostics[0].message` with the
|
|
187
187
|
`[EditError::<Variant>]` prefix.
|
package/bundler/wasm.d.ts
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
* Input shape for `Document.
|
|
5
|
+
* Input shape for `Document.pushLeaf` and `Document.insertLeaf`.
|
|
6
6
|
*
|
|
7
7
|
* Only `tag` is required. `fields` defaults to `{}`, `body` to `""`.
|
|
8
8
|
*/
|
|
9
|
-
export interface
|
|
9
|
+
export interface LeafInput {
|
|
10
10
|
tag: string;
|
|
11
11
|
fields?: Record<string, unknown>;
|
|
12
12
|
body?: string;
|
|
@@ -93,16 +93,16 @@ export interface QuillFieldUi {
|
|
|
93
93
|
multiline?: boolean;
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
-
/** UI layout hints for a
|
|
97
|
-
export interface
|
|
96
|
+
/** UI layout hints for a leaf (main or named leaf type). */
|
|
97
|
+
export interface QuillLeafUi {
|
|
98
98
|
title?: string;
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
-
/** Body namespace for a
|
|
102
|
-
export interface
|
|
103
|
-
/** When false, consumers must not accept or store body content for this
|
|
101
|
+
/** Body namespace for a leaf (main or named leaf type). */
|
|
102
|
+
export interface QuillLeafBody {
|
|
103
|
+
/** When false, consumers must not accept or store body content for this leaf type. Defaults to true. */
|
|
104
104
|
enabled?: boolean;
|
|
105
|
-
/** Example body content embedded verbatim in the blueprint body region. Fallback is "Write <
|
|
105
|
+
/** Example body content embedded verbatim in the blueprint body region. Fallback is "Write <leaf> body here." */
|
|
106
106
|
example?: string;
|
|
107
107
|
}
|
|
108
108
|
|
|
@@ -119,24 +119,24 @@ export interface QuillFieldSchema {
|
|
|
119
119
|
items?: QuillFieldSchema;
|
|
120
120
|
}
|
|
121
121
|
|
|
122
|
-
/** Schema entry for the main
|
|
123
|
-
export interface
|
|
122
|
+
/** Schema entry for the main leaf or a named leaf type. */
|
|
123
|
+
export interface QuillLeafSchema {
|
|
124
124
|
description?: string;
|
|
125
125
|
fields: Record<string, QuillFieldSchema>;
|
|
126
|
-
ui?:
|
|
127
|
-
body?:
|
|
126
|
+
ui?: QuillLeafUi;
|
|
127
|
+
body?: QuillLeafBody;
|
|
128
128
|
}
|
|
129
129
|
|
|
130
130
|
/**
|
|
131
131
|
* Document schema returned by `Quill.schema`. Includes optional `ui` keys.
|
|
132
132
|
*
|
|
133
|
-
* `main.fields.QUILL` and `
|
|
133
|
+
* `main.fields.QUILL` and `leaf_kinds[name].fields.KIND` are required
|
|
134
134
|
* sentinels with `const` values telling consumers what to write.
|
|
135
135
|
*/
|
|
136
136
|
export interface QuillSchema {
|
|
137
|
-
main:
|
|
138
|
-
/** Present only when the quill declares at least one named
|
|
139
|
-
|
|
137
|
+
main: QuillLeafSchema;
|
|
138
|
+
/** Present only when the quill declares at least one named leaf type. */
|
|
139
|
+
leaf_kinds?: Record<string, QuillLeafSchema>;
|
|
140
140
|
}
|
|
141
141
|
|
|
142
142
|
/**
|
|
@@ -158,7 +158,7 @@ export interface QuillMetadata {
|
|
|
158
158
|
export type FormFieldSource = "document" | "default" | "missing";
|
|
159
159
|
|
|
160
160
|
/**
|
|
161
|
-
* A single field's view within a `
|
|
161
|
+
* A single field's view within a `FormLeaf`.
|
|
162
162
|
*
|
|
163
163
|
* - `value` — the document-supplied value (`null` when absent).
|
|
164
164
|
* - `default` — the schema default (`null` when no default is declared).
|
|
@@ -171,24 +171,24 @@ export interface FormFieldValue {
|
|
|
171
171
|
}
|
|
172
172
|
|
|
173
173
|
/**
|
|
174
|
-
* A
|
|
175
|
-
* `Quill.blankMain`, and `Quill.
|
|
174
|
+
* A leaf viewed through its schema, as returned by `Quill.form`,
|
|
175
|
+
* `Quill.blankMain`, and `Quill.blankLeaf`.
|
|
176
176
|
*/
|
|
177
|
-
export interface
|
|
178
|
-
schema:
|
|
177
|
+
export interface FormLeaf {
|
|
178
|
+
schema: QuillLeafSchema;
|
|
179
179
|
values: Record<string, FormFieldValue>;
|
|
180
180
|
}
|
|
181
181
|
|
|
182
182
|
/**
|
|
183
183
|
* Schema-aware form view of a document, returned by `Quill.form`.
|
|
184
184
|
*
|
|
185
|
-
* - `main` — the main
|
|
186
|
-
* - `
|
|
187
|
-
* - `diagnostics` — diagnostics from unknown
|
|
185
|
+
* - `main` — the main leaf viewed through the quill's main schema.
|
|
186
|
+
* - `leaves` — composable leaf blocks, in document order (unknown tags excluded).
|
|
187
|
+
* - `diagnostics` — diagnostics from unknown leaf tags and validation.
|
|
188
188
|
*/
|
|
189
189
|
export interface Form {
|
|
190
|
-
main:
|
|
191
|
-
|
|
190
|
+
main: FormLeaf;
|
|
191
|
+
leaves: FormLeaf[];
|
|
192
192
|
diagnostics: Diagnostic[];
|
|
193
193
|
}
|
|
194
194
|
|
|
@@ -199,23 +199,24 @@ export interface Artifact {
|
|
|
199
199
|
mimeType: string;
|
|
200
200
|
}
|
|
201
201
|
|
|
202
|
-
export interface Card {
|
|
203
|
-
sentinel: string;
|
|
204
|
-
tag: string;
|
|
205
|
-
frontmatter: Record<string, unknown>;
|
|
206
|
-
frontmatterItems: FrontmatterItem[];
|
|
207
|
-
body: string;
|
|
208
|
-
}
|
|
209
|
-
|
|
210
202
|
export interface Diagnostic {
|
|
211
203
|
severity: Severity;
|
|
212
204
|
code?: string;
|
|
213
205
|
message: string;
|
|
214
206
|
location?: Location;
|
|
207
|
+
path?: string;
|
|
215
208
|
hint?: string;
|
|
216
209
|
sourceChain: string[];
|
|
217
210
|
}
|
|
218
211
|
|
|
212
|
+
export interface Leaf {
|
|
213
|
+
sentinel: string;
|
|
214
|
+
tag: string;
|
|
215
|
+
frontmatter: Record<string, unknown>;
|
|
216
|
+
frontmatterItems: FrontmatterItem[];
|
|
217
|
+
body: string;
|
|
218
|
+
}
|
|
219
|
+
|
|
219
220
|
export interface Location {
|
|
220
221
|
file: string;
|
|
221
222
|
line: number;
|
|
@@ -249,7 +250,7 @@ export type Severity = "error" | "warning" | "note";
|
|
|
249
250
|
* - `quillRef` (string)
|
|
250
251
|
* - `frontmatter` (JS object/Record)
|
|
251
252
|
* - `body` (string)
|
|
252
|
-
* - `
|
|
253
|
+
* - `leaves` (array of Leaf objects)
|
|
253
254
|
* - `warnings` (array of Diagnostic objects)
|
|
254
255
|
*
|
|
255
256
|
* `toMarkdown()` emits canonical Quillmark Markdown that round-trips back to
|
|
@@ -271,7 +272,7 @@ export class Document {
|
|
|
271
272
|
/**
|
|
272
273
|
* Structural equality against another `Document`.
|
|
273
274
|
*
|
|
274
|
-
* Compares `main` and `
|
|
275
|
+
* Compares `main` and `leaves` by value (matching core's [`PartialEq`]).
|
|
275
276
|
* Parse-time `warnings` are intentionally excluded — they describe the
|
|
276
277
|
* source text, not the document's content.
|
|
277
278
|
*
|
|
@@ -287,54 +288,38 @@ export class Document {
|
|
|
287
288
|
*/
|
|
288
289
|
static fromMarkdown(markdown: string): Document;
|
|
289
290
|
/**
|
|
290
|
-
* Insert a
|
|
291
|
+
* Insert a leaf at the given index.
|
|
291
292
|
*
|
|
292
|
-
* `index` must be in `0..=
|
|
293
|
+
* `index` must be in `0..=leaves.length`. Out-of-range throws an `Error`.
|
|
293
294
|
*
|
|
294
295
|
* Mutators never modify `warnings`.
|
|
295
296
|
*/
|
|
296
|
-
|
|
297
|
+
insertLeaf(index: number, leaf: LeafInput): void;
|
|
297
298
|
/**
|
|
298
|
-
* Move the
|
|
299
|
+
* Move the leaf at `from` to position `to`.
|
|
299
300
|
*
|
|
300
|
-
* `from == to` is a no-op. Both indices must be in `0..
|
|
301
|
+
* `from == to` is a no-op. Both indices must be in `0..leaves.length`.
|
|
301
302
|
* Out-of-range throws an `Error`.
|
|
302
303
|
*
|
|
303
304
|
* Mutators never modify `warnings`.
|
|
304
305
|
*/
|
|
305
|
-
|
|
306
|
+
moveLeaf(from: number, to: number): void;
|
|
306
307
|
/**
|
|
307
|
-
* Append a
|
|
308
|
+
* Append a leaf to the end of the leaf list.
|
|
308
309
|
*
|
|
309
|
-
* `
|
|
310
|
+
* `leaf` must be a JS object with a `tag` string field and optional
|
|
310
311
|
* `fields` (object) and `body` (string).
|
|
311
312
|
*
|
|
312
|
-
* Throws an `Error` if `
|
|
313
|
-
*
|
|
314
|
-
* Mutators never modify `warnings`.
|
|
315
|
-
*/
|
|
316
|
-
pushCard(card: CardInput): void;
|
|
317
|
-
/**
|
|
318
|
-
* Remove the card at `index` and return it, or `undefined` if out of range.
|
|
319
|
-
*
|
|
320
|
-
* Mutators never modify `warnings`.
|
|
321
|
-
*/
|
|
322
|
-
removeCard(index: number): Card | undefined;
|
|
323
|
-
/**
|
|
324
|
-
* Remove a frontmatter field on the card at `index`, returning the
|
|
325
|
-
* removed value or `undefined` if the field was absent.
|
|
326
|
-
*
|
|
327
|
-
* Throws if `index` is out of range, `name` is reserved, or `name` does
|
|
328
|
-
* not match `[a-z_][a-z0-9_]*`.
|
|
313
|
+
* Throws an `Error` if `leaf.tag` is not a valid tag name.
|
|
329
314
|
*
|
|
330
315
|
* Mutators never modify `warnings`.
|
|
331
316
|
*/
|
|
332
|
-
|
|
317
|
+
pushLeaf(leaf: LeafInput): void;
|
|
333
318
|
/**
|
|
334
|
-
* Remove a frontmatter field on the main
|
|
319
|
+
* Remove a frontmatter field on the main leaf, returning the removed value or `undefined`.
|
|
335
320
|
*
|
|
336
321
|
* Throws an `Error` whose message includes the `EditError` variant name
|
|
337
|
-
* and details if `name` is reserved (`BODY`, `
|
|
322
|
+
* and details if `name` is reserved (`BODY`, `LEAVES`, `QUILL`, `KIND`)
|
|
338
323
|
* or does not match `[a-z_][a-z0-9_]*`. Absence of an otherwise-valid
|
|
339
324
|
* name returns `undefined`.
|
|
340
325
|
*
|
|
@@ -342,40 +327,42 @@ export class Document {
|
|
|
342
327
|
*/
|
|
343
328
|
removeField(name: string): any;
|
|
344
329
|
/**
|
|
345
|
-
*
|
|
330
|
+
* Remove the leaf at `index` and return it, or `undefined` if out of range.
|
|
346
331
|
*
|
|
347
332
|
* Mutators never modify `warnings`.
|
|
348
333
|
*/
|
|
349
|
-
|
|
334
|
+
removeLeaf(index: number): Leaf | undefined;
|
|
350
335
|
/**
|
|
351
|
-
*
|
|
336
|
+
* Remove a frontmatter field on the leaf at `index`, returning the
|
|
337
|
+
* removed value or `undefined` if the field was absent.
|
|
352
338
|
*
|
|
353
|
-
*
|
|
354
|
-
*
|
|
355
|
-
* new defaults) is the caller's responsibility; `setCardTag` is a
|
|
356
|
-
* structural primitive.
|
|
339
|
+
* Throws if `index` is out of range, `name` is reserved, or `name` does
|
|
340
|
+
* not match `[a-z_][a-z0-9_]*`.
|
|
357
341
|
*
|
|
358
|
-
*
|
|
359
|
-
|
|
342
|
+
* Mutators never modify `warnings`.
|
|
343
|
+
*/
|
|
344
|
+
removeLeafField(index: number, name: string): any;
|
|
345
|
+
/**
|
|
346
|
+
* Replace the main leaf's body (the global Markdown body).
|
|
360
347
|
*
|
|
361
348
|
* Mutators never modify `warnings`.
|
|
362
349
|
*/
|
|
363
|
-
|
|
350
|
+
replaceBody(body: string): void;
|
|
364
351
|
/**
|
|
365
|
-
* Update a frontmatter field on the main
|
|
352
|
+
* Update a frontmatter field on the main leaf.
|
|
366
353
|
*
|
|
367
354
|
* Convenience method: equivalent to `doc.mainMut().setField(name, value)`.
|
|
368
355
|
* Clears any existing `!fill` marker on the field.
|
|
369
356
|
*
|
|
370
357
|
* Throws an `Error` whose message includes the `EditError` variant name and
|
|
371
|
-
* details if `name` is reserved (`BODY`, `
|
|
358
|
+
* details if `name` is reserved (`BODY`, `LEAVES`, `QUILL`, `KIND`) or does
|
|
372
359
|
* not match `[a-z_][a-z0-9_]*`.
|
|
373
360
|
*
|
|
374
361
|
* Mutators never modify `warnings`.
|
|
375
362
|
*/
|
|
376
363
|
setField(name: string, value: any): void;
|
|
377
364
|
/**
|
|
378
|
-
* Update a frontmatter field on the main
|
|
365
|
+
* Update a frontmatter field on the main leaf AND mark it as `!fill`.
|
|
379
366
|
*
|
|
380
367
|
* Convenience method: equivalent to `doc.mainMut().setFill(name, value)`.
|
|
381
368
|
*
|
|
@@ -384,6 +371,20 @@ export class Document {
|
|
|
384
371
|
* Mutators never modify `warnings`.
|
|
385
372
|
*/
|
|
386
373
|
setFill(name: string, value: any): void;
|
|
374
|
+
/**
|
|
375
|
+
* Replace the tag of the composable leaf at `index`.
|
|
376
|
+
*
|
|
377
|
+
* Mutates only the sentinel — the leaf's frontmatter and body are
|
|
378
|
+
* untouched. Schema-aware migration (clearing orphan fields, applying
|
|
379
|
+
* new defaults) is the caller's responsibility; `setLeafKind` is a
|
|
380
|
+
* structural primitive.
|
|
381
|
+
*
|
|
382
|
+
* Throws if `index` is out of range or if `newTag` does not match
|
|
383
|
+
* `[a-z_][a-z0-9_]*`.
|
|
384
|
+
*
|
|
385
|
+
* Mutators never modify `warnings`.
|
|
386
|
+
*/
|
|
387
|
+
setLeafKind(index: number, new_tag: string): void;
|
|
387
388
|
/**
|
|
388
389
|
* Replace the QUILL reference string.
|
|
389
390
|
*
|
|
@@ -401,37 +402,37 @@ export class Document {
|
|
|
401
402
|
*/
|
|
402
403
|
toMarkdown(): string;
|
|
403
404
|
/**
|
|
404
|
-
* Replace the body of the
|
|
405
|
+
* Replace the body of the leaf at `index`.
|
|
405
406
|
*
|
|
406
407
|
* Throws if `index` is out of range.
|
|
407
408
|
*
|
|
408
409
|
* Mutators never modify `warnings`.
|
|
409
410
|
*/
|
|
410
|
-
|
|
411
|
+
updateLeafBody(index: number, body: string): void;
|
|
411
412
|
/**
|
|
412
|
-
* Update a field on the
|
|
413
|
+
* Update a field on the leaf at `index`.
|
|
413
414
|
*
|
|
414
|
-
* Convenience method: equivalent to `doc.
|
|
415
|
+
* Convenience method: equivalent to `doc.leaf_mut(index)?.set_field(name, value)`.
|
|
415
416
|
*
|
|
416
417
|
* Throws if `index` is out of range, `name` is reserved or invalid, or
|
|
417
418
|
* `value` cannot be serialized.
|
|
418
419
|
*
|
|
419
420
|
* Mutators never modify `warnings`.
|
|
420
421
|
*/
|
|
421
|
-
|
|
422
|
+
updateLeafField(index: number, name: string, value: any): void;
|
|
422
423
|
/**
|
|
423
|
-
* Number of composable
|
|
424
|
+
* Number of composable leaves (excludes the main leaf).
|
|
424
425
|
*
|
|
425
|
-
* O(1). Use this to validate indices before calling
|
|
426
|
-
* instead of allocating the full `
|
|
426
|
+
* O(1). Use this to validate indices before calling leaf mutators
|
|
427
|
+
* instead of allocating the full `leaves` array.
|
|
427
428
|
*/
|
|
428
|
-
readonly
|
|
429
|
+
readonly leafCount: number;
|
|
429
430
|
/**
|
|
430
|
-
* Ordered list of composable
|
|
431
|
+
* Ordered list of composable leaf blocks as typed `Leaf` objects.
|
|
431
432
|
*/
|
|
432
|
-
readonly
|
|
433
|
+
readonly leaves: Leaf[];
|
|
433
434
|
/**
|
|
434
|
-
* The document's main (entry)
|
|
435
|
+
* The document's main (entry) leaf.
|
|
435
436
|
*
|
|
436
437
|
* Carries the QUILL sentinel, the document-level frontmatter, and the
|
|
437
438
|
* global body. Frontmatter/body reads and mutations go through this
|
|
@@ -439,7 +440,7 @@ export class Document {
|
|
|
439
440
|
*
|
|
440
441
|
* Allocates and serializes on each call — cache locally if read in a hot loop.
|
|
441
442
|
*/
|
|
442
|
-
readonly main:
|
|
443
|
+
readonly main: Leaf;
|
|
443
444
|
/**
|
|
444
445
|
* The QUILL reference string (e.g. `"usaf_memo@0.1"`).
|
|
445
446
|
*/
|
|
@@ -458,17 +459,17 @@ export class Quill {
|
|
|
458
459
|
free(): void;
|
|
459
460
|
[Symbol.dispose](): void;
|
|
460
461
|
/**
|
|
461
|
-
* A blank form for a
|
|
462
|
+
* A blank form for a leaf of the given type — no document values supplied.
|
|
462
463
|
*
|
|
463
|
-
* Returns `null` if `
|
|
464
|
+
* Returns `null` if `leafKind` is not declared in this quill's schema.
|
|
464
465
|
* Otherwise returns a plain JS object shaped like a single entry in
|
|
465
|
-
* [`Form::
|
|
466
|
+
* [`Form::leaves`].
|
|
466
467
|
*
|
|
467
|
-
* [`Form::
|
|
468
|
+
* [`Form::leaves`]: quillmark::form::Form::leaves
|
|
468
469
|
*/
|
|
469
|
-
|
|
470
|
+
blankLeaf(leaf_kind: string): FormLeaf | null;
|
|
470
471
|
/**
|
|
471
|
-
* A blank form for the main
|
|
472
|
+
* A blank form for the main leaf — no document values supplied.
|
|
472
473
|
*
|
|
473
474
|
* Returns a plain JS object with the same shape as one entry in
|
|
474
475
|
* [`Form::main`]. Every declared field's `source` is `"default"` (when
|
|
@@ -476,7 +477,7 @@ export class Quill {
|
|
|
476
477
|
*
|
|
477
478
|
* [`Form::main`]: quillmark::form::Form::main
|
|
478
479
|
*/
|
|
479
|
-
blankMain():
|
|
480
|
+
blankMain(): FormLeaf;
|
|
480
481
|
/**
|
|
481
482
|
* The schema-aware form view of `doc`.
|
|
482
483
|
*
|
|
@@ -486,7 +487,7 @@ export class Quill {
|
|
|
486
487
|
* ```json
|
|
487
488
|
* {
|
|
488
489
|
* "main": { "schema": {...}, "values": { "field": {...} } },
|
|
489
|
-
* "
|
|
490
|
+
* "leaves": [ ... ],
|
|
490
491
|
* "diagnostics": [ ... ]
|
|
491
492
|
* }
|
|
492
493
|
* ```
|
package/bundler/wasm_bg.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* - `quillRef` (string)
|
|
6
6
|
* - `frontmatter` (JS object/Record)
|
|
7
7
|
* - `body` (string)
|
|
8
|
-
* - `
|
|
8
|
+
* - `leaves` (array of Leaf objects)
|
|
9
9
|
* - `warnings` (array of Diagnostic objects)
|
|
10
10
|
*
|
|
11
11
|
* `toMarkdown()` emits canonical Quillmark Markdown that round-trips back to
|
|
@@ -29,25 +29,6 @@ export class Document {
|
|
|
29
29
|
const ptr = this.__destroy_into_raw();
|
|
30
30
|
wasm.__wbg_document_free(ptr, 0);
|
|
31
31
|
}
|
|
32
|
-
/**
|
|
33
|
-
* Number of composable cards (excludes the main card).
|
|
34
|
-
*
|
|
35
|
-
* O(1). Use this to validate indices before calling card mutators
|
|
36
|
-
* instead of allocating the full `cards` array.
|
|
37
|
-
* @returns {number}
|
|
38
|
-
*/
|
|
39
|
-
get cardCount() {
|
|
40
|
-
const ret = wasm.document_cardCount(this.__wbg_ptr);
|
|
41
|
-
return ret >>> 0;
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Ordered list of composable card blocks as typed `Card` objects.
|
|
45
|
-
* @returns {Card[]}
|
|
46
|
-
*/
|
|
47
|
-
get cards() {
|
|
48
|
-
const ret = wasm.document_cards(this.__wbg_ptr);
|
|
49
|
-
return takeObject(ret);
|
|
50
|
-
}
|
|
51
32
|
/**
|
|
52
33
|
* Return a fresh `Document` handle with the same parse state.
|
|
53
34
|
*
|
|
@@ -64,7 +45,7 @@ export class Document {
|
|
|
64
45
|
/**
|
|
65
46
|
* Structural equality against another `Document`.
|
|
66
47
|
*
|
|
67
|
-
* Compares `main` and `
|
|
48
|
+
* Compares `main` and `leaves` by value (matching core's [`PartialEq`]).
|
|
68
49
|
* Parse-time `warnings` are intentionally excluded — they describe the
|
|
69
50
|
* source text, not the document's content.
|
|
70
51
|
*
|
|
@@ -104,18 +85,18 @@ export class Document {
|
|
|
104
85
|
}
|
|
105
86
|
}
|
|
106
87
|
/**
|
|
107
|
-
* Insert a
|
|
88
|
+
* Insert a leaf at the given index.
|
|
108
89
|
*
|
|
109
|
-
* `index` must be in `0..=
|
|
90
|
+
* `index` must be in `0..=leaves.length`. Out-of-range throws an `Error`.
|
|
110
91
|
*
|
|
111
92
|
* Mutators never modify `warnings`.
|
|
112
93
|
* @param {number} index
|
|
113
|
-
* @param {
|
|
94
|
+
* @param {LeafInput} leaf
|
|
114
95
|
*/
|
|
115
|
-
|
|
96
|
+
insertLeaf(index, leaf) {
|
|
116
97
|
try {
|
|
117
98
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
118
|
-
wasm.
|
|
99
|
+
wasm.document_insertLeaf(retptr, this.__wbg_ptr, index, addHeapObject(leaf));
|
|
119
100
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
120
101
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
121
102
|
if (r1) {
|
|
@@ -126,33 +107,52 @@ export class Document {
|
|
|
126
107
|
}
|
|
127
108
|
}
|
|
128
109
|
/**
|
|
129
|
-
*
|
|
110
|
+
* Number of composable leaves (excludes the main leaf).
|
|
111
|
+
*
|
|
112
|
+
* O(1). Use this to validate indices before calling leaf mutators
|
|
113
|
+
* instead of allocating the full `leaves` array.
|
|
114
|
+
* @returns {number}
|
|
115
|
+
*/
|
|
116
|
+
get leafCount() {
|
|
117
|
+
const ret = wasm.document_leafCount(this.__wbg_ptr);
|
|
118
|
+
return ret >>> 0;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Ordered list of composable leaf blocks as typed `Leaf` objects.
|
|
122
|
+
* @returns {Leaf[]}
|
|
123
|
+
*/
|
|
124
|
+
get leaves() {
|
|
125
|
+
const ret = wasm.document_leaves(this.__wbg_ptr);
|
|
126
|
+
return takeObject(ret);
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* The document's main (entry) leaf.
|
|
130
130
|
*
|
|
131
131
|
* Carries the QUILL sentinel, the document-level frontmatter, and the
|
|
132
132
|
* global body. Frontmatter/body reads and mutations go through this
|
|
133
133
|
* handle — there are no document-level shortcuts after the rework.
|
|
134
134
|
*
|
|
135
135
|
* Allocates and serializes on each call — cache locally if read in a hot loop.
|
|
136
|
-
* @returns {
|
|
136
|
+
* @returns {Leaf}
|
|
137
137
|
*/
|
|
138
138
|
get main() {
|
|
139
139
|
const ret = wasm.document_main(this.__wbg_ptr);
|
|
140
140
|
return takeObject(ret);
|
|
141
141
|
}
|
|
142
142
|
/**
|
|
143
|
-
* Move the
|
|
143
|
+
* Move the leaf at `from` to position `to`.
|
|
144
144
|
*
|
|
145
|
-
* `from == to` is a no-op. Both indices must be in `0..
|
|
145
|
+
* `from == to` is a no-op. Both indices must be in `0..leaves.length`.
|
|
146
146
|
* Out-of-range throws an `Error`.
|
|
147
147
|
*
|
|
148
148
|
* Mutators never modify `warnings`.
|
|
149
149
|
* @param {number} from
|
|
150
150
|
* @param {number} to
|
|
151
151
|
*/
|
|
152
|
-
|
|
152
|
+
moveLeaf(from, to) {
|
|
153
153
|
try {
|
|
154
154
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
155
|
-
wasm.
|
|
155
|
+
wasm.document_moveLeaf(retptr, this.__wbg_ptr, from, to);
|
|
156
156
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
157
157
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
158
158
|
if (r1) {
|
|
@@ -163,20 +163,20 @@ export class Document {
|
|
|
163
163
|
}
|
|
164
164
|
}
|
|
165
165
|
/**
|
|
166
|
-
* Append a
|
|
166
|
+
* Append a leaf to the end of the leaf list.
|
|
167
167
|
*
|
|
168
|
-
* `
|
|
168
|
+
* `leaf` must be a JS object with a `tag` string field and optional
|
|
169
169
|
* `fields` (object) and `body` (string).
|
|
170
170
|
*
|
|
171
|
-
* Throws an `Error` if `
|
|
171
|
+
* Throws an `Error` if `leaf.tag` is not a valid tag name.
|
|
172
172
|
*
|
|
173
173
|
* Mutators never modify `warnings`.
|
|
174
|
-
* @param {
|
|
174
|
+
* @param {LeafInput} leaf
|
|
175
175
|
*/
|
|
176
|
-
|
|
176
|
+
pushLeaf(leaf) {
|
|
177
177
|
try {
|
|
178
178
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
179
|
-
wasm.
|
|
179
|
+
wasm.document_pushLeaf(retptr, this.__wbg_ptr, addHeapObject(leaf));
|
|
180
180
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
181
181
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
182
182
|
if (r1) {
|
|
@@ -207,34 +207,23 @@ export class Document {
|
|
|
207
207
|
}
|
|
208
208
|
}
|
|
209
209
|
/**
|
|
210
|
-
* Remove
|
|
211
|
-
*
|
|
212
|
-
* Mutators never modify `warnings`.
|
|
213
|
-
* @param {number} index
|
|
214
|
-
* @returns {Card | undefined}
|
|
215
|
-
*/
|
|
216
|
-
removeCard(index) {
|
|
217
|
-
const ret = wasm.document_removeCard(this.__wbg_ptr, index);
|
|
218
|
-
return takeObject(ret);
|
|
219
|
-
}
|
|
220
|
-
/**
|
|
221
|
-
* Remove a frontmatter field on the card at `index`, returning the
|
|
222
|
-
* removed value or `undefined` if the field was absent.
|
|
210
|
+
* Remove a frontmatter field on the main leaf, returning the removed value or `undefined`.
|
|
223
211
|
*
|
|
224
|
-
* Throws
|
|
225
|
-
*
|
|
212
|
+
* Throws an `Error` whose message includes the `EditError` variant name
|
|
213
|
+
* and details if `name` is reserved (`BODY`, `LEAVES`, `QUILL`, `KIND`)
|
|
214
|
+
* or does not match `[a-z_][a-z0-9_]*`. Absence of an otherwise-valid
|
|
215
|
+
* name returns `undefined`.
|
|
226
216
|
*
|
|
227
217
|
* Mutators never modify `warnings`.
|
|
228
|
-
* @param {number} index
|
|
229
218
|
* @param {string} name
|
|
230
219
|
* @returns {any}
|
|
231
220
|
*/
|
|
232
|
-
|
|
221
|
+
removeField(name) {
|
|
233
222
|
try {
|
|
234
223
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
235
224
|
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
236
225
|
const len0 = WASM_VECTOR_LEN;
|
|
237
|
-
wasm.
|
|
226
|
+
wasm.document_removeField(retptr, this.__wbg_ptr, ptr0, len0);
|
|
238
227
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
239
228
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
240
229
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -247,23 +236,34 @@ export class Document {
|
|
|
247
236
|
}
|
|
248
237
|
}
|
|
249
238
|
/**
|
|
250
|
-
* Remove
|
|
239
|
+
* Remove the leaf at `index` and return it, or `undefined` if out of range.
|
|
251
240
|
*
|
|
252
|
-
*
|
|
253
|
-
*
|
|
254
|
-
*
|
|
255
|
-
|
|
241
|
+
* Mutators never modify `warnings`.
|
|
242
|
+
* @param {number} index
|
|
243
|
+
* @returns {Leaf | undefined}
|
|
244
|
+
*/
|
|
245
|
+
removeLeaf(index) {
|
|
246
|
+
const ret = wasm.document_removeLeaf(this.__wbg_ptr, index);
|
|
247
|
+
return takeObject(ret);
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* Remove a frontmatter field on the leaf at `index`, returning the
|
|
251
|
+
* removed value or `undefined` if the field was absent.
|
|
252
|
+
*
|
|
253
|
+
* Throws if `index` is out of range, `name` is reserved, or `name` does
|
|
254
|
+
* not match `[a-z_][a-z0-9_]*`.
|
|
256
255
|
*
|
|
257
256
|
* Mutators never modify `warnings`.
|
|
257
|
+
* @param {number} index
|
|
258
258
|
* @param {string} name
|
|
259
259
|
* @returns {any}
|
|
260
260
|
*/
|
|
261
|
-
|
|
261
|
+
removeLeafField(index, name) {
|
|
262
262
|
try {
|
|
263
263
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
264
264
|
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
265
265
|
const len0 = WASM_VECTOR_LEN;
|
|
266
|
-
wasm.
|
|
266
|
+
wasm.document_removeLeafField(retptr, this.__wbg_ptr, index, ptr0, len0);
|
|
267
267
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
268
268
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
269
269
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -276,7 +276,7 @@ export class Document {
|
|
|
276
276
|
}
|
|
277
277
|
}
|
|
278
278
|
/**
|
|
279
|
-
* Replace the main
|
|
279
|
+
* Replace the main leaf's body (the global Markdown body).
|
|
280
280
|
*
|
|
281
281
|
* Mutators never modify `warnings`.
|
|
282
282
|
* @param {string} body
|
|
@@ -287,26 +287,25 @@ export class Document {
|
|
|
287
287
|
wasm.document_replaceBody(this.__wbg_ptr, ptr0, len0);
|
|
288
288
|
}
|
|
289
289
|
/**
|
|
290
|
-
*
|
|
290
|
+
* Update a frontmatter field on the main leaf.
|
|
291
291
|
*
|
|
292
|
-
*
|
|
293
|
-
*
|
|
294
|
-
* new defaults) is the caller's responsibility; `setCardTag` is a
|
|
295
|
-
* structural primitive.
|
|
292
|
+
* Convenience method: equivalent to `doc.mainMut().setField(name, value)`.
|
|
293
|
+
* Clears any existing `!fill` marker on the field.
|
|
296
294
|
*
|
|
297
|
-
* Throws
|
|
298
|
-
* `
|
|
295
|
+
* Throws an `Error` whose message includes the `EditError` variant name and
|
|
296
|
+
* details if `name` is reserved (`BODY`, `LEAVES`, `QUILL`, `KIND`) or does
|
|
297
|
+
* not match `[a-z_][a-z0-9_]*`.
|
|
299
298
|
*
|
|
300
299
|
* Mutators never modify `warnings`.
|
|
301
|
-
* @param {
|
|
302
|
-
* @param {
|
|
300
|
+
* @param {string} name
|
|
301
|
+
* @param {any} value
|
|
303
302
|
*/
|
|
304
|
-
|
|
303
|
+
setField(name, value) {
|
|
305
304
|
try {
|
|
306
305
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
307
|
-
const ptr0 = passStringToWasm0(
|
|
306
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
308
307
|
const len0 = WASM_VECTOR_LEN;
|
|
309
|
-
wasm.
|
|
308
|
+
wasm.document_setField(retptr, this.__wbg_ptr, ptr0, len0, addHeapObject(value));
|
|
310
309
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
311
310
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
312
311
|
if (r1) {
|
|
@@ -317,25 +316,22 @@ export class Document {
|
|
|
317
316
|
}
|
|
318
317
|
}
|
|
319
318
|
/**
|
|
320
|
-
* Update a frontmatter field on the main
|
|
319
|
+
* Update a frontmatter field on the main leaf AND mark it as `!fill`.
|
|
321
320
|
*
|
|
322
|
-
* Convenience method: equivalent to `doc.mainMut().
|
|
323
|
-
* Clears any existing `!fill` marker on the field.
|
|
321
|
+
* Convenience method: equivalent to `doc.mainMut().setFill(name, value)`.
|
|
324
322
|
*
|
|
325
|
-
* Throws
|
|
326
|
-
* details if `name` is reserved (`BODY`, `CARDS`, `QUILL`, `CARD`) or does
|
|
327
|
-
* not match `[a-z_][a-z0-9_]*`.
|
|
323
|
+
* Throws on invalid name (see [`setField`](Document::set_field)).
|
|
328
324
|
*
|
|
329
325
|
* Mutators never modify `warnings`.
|
|
330
326
|
* @param {string} name
|
|
331
327
|
* @param {any} value
|
|
332
328
|
*/
|
|
333
|
-
|
|
329
|
+
setFill(name, value) {
|
|
334
330
|
try {
|
|
335
331
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
336
332
|
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
337
333
|
const len0 = WASM_VECTOR_LEN;
|
|
338
|
-
wasm.
|
|
334
|
+
wasm.document_setFill(retptr, this.__wbg_ptr, ptr0, len0, addHeapObject(value));
|
|
339
335
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
340
336
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
341
337
|
if (r1) {
|
|
@@ -346,22 +342,26 @@ export class Document {
|
|
|
346
342
|
}
|
|
347
343
|
}
|
|
348
344
|
/**
|
|
349
|
-
*
|
|
345
|
+
* Replace the tag of the composable leaf at `index`.
|
|
350
346
|
*
|
|
351
|
-
*
|
|
347
|
+
* Mutates only the sentinel — the leaf's frontmatter and body are
|
|
348
|
+
* untouched. Schema-aware migration (clearing orphan fields, applying
|
|
349
|
+
* new defaults) is the caller's responsibility; `setLeafKind` is a
|
|
350
|
+
* structural primitive.
|
|
352
351
|
*
|
|
353
|
-
* Throws
|
|
352
|
+
* Throws if `index` is out of range or if `newTag` does not match
|
|
353
|
+
* `[a-z_][a-z0-9_]*`.
|
|
354
354
|
*
|
|
355
355
|
* Mutators never modify `warnings`.
|
|
356
|
-
* @param {
|
|
357
|
-
* @param {
|
|
356
|
+
* @param {number} index
|
|
357
|
+
* @param {string} new_tag
|
|
358
358
|
*/
|
|
359
|
-
|
|
359
|
+
setLeafKind(index, new_tag) {
|
|
360
360
|
try {
|
|
361
361
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
362
|
-
const ptr0 = passStringToWasm0(
|
|
362
|
+
const ptr0 = passStringToWasm0(new_tag, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
363
363
|
const len0 = WASM_VECTOR_LEN;
|
|
364
|
-
wasm.
|
|
364
|
+
wasm.document_setLeafKind(retptr, this.__wbg_ptr, index, ptr0, len0);
|
|
365
365
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
366
366
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
367
367
|
if (r1) {
|
|
@@ -419,7 +419,7 @@ export class Document {
|
|
|
419
419
|
}
|
|
420
420
|
}
|
|
421
421
|
/**
|
|
422
|
-
* Replace the body of the
|
|
422
|
+
* Replace the body of the leaf at `index`.
|
|
423
423
|
*
|
|
424
424
|
* Throws if `index` is out of range.
|
|
425
425
|
*
|
|
@@ -427,12 +427,12 @@ export class Document {
|
|
|
427
427
|
* @param {number} index
|
|
428
428
|
* @param {string} body
|
|
429
429
|
*/
|
|
430
|
-
|
|
430
|
+
updateLeafBody(index, body) {
|
|
431
431
|
try {
|
|
432
432
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
433
433
|
const ptr0 = passStringToWasm0(body, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
434
434
|
const len0 = WASM_VECTOR_LEN;
|
|
435
|
-
wasm.
|
|
435
|
+
wasm.document_updateLeafBody(retptr, this.__wbg_ptr, index, ptr0, len0);
|
|
436
436
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
437
437
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
438
438
|
if (r1) {
|
|
@@ -443,9 +443,9 @@ export class Document {
|
|
|
443
443
|
}
|
|
444
444
|
}
|
|
445
445
|
/**
|
|
446
|
-
* Update a field on the
|
|
446
|
+
* Update a field on the leaf at `index`.
|
|
447
447
|
*
|
|
448
|
-
* Convenience method: equivalent to `doc.
|
|
448
|
+
* Convenience method: equivalent to `doc.leaf_mut(index)?.set_field(name, value)`.
|
|
449
449
|
*
|
|
450
450
|
* Throws if `index` is out of range, `name` is reserved or invalid, or
|
|
451
451
|
* `value` cannot be serialized.
|
|
@@ -455,12 +455,12 @@ export class Document {
|
|
|
455
455
|
* @param {string} name
|
|
456
456
|
* @param {any} value
|
|
457
457
|
*/
|
|
458
|
-
|
|
458
|
+
updateLeafField(index, name, value) {
|
|
459
459
|
try {
|
|
460
460
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
461
461
|
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
462
462
|
const len0 = WASM_VECTOR_LEN;
|
|
463
|
-
wasm.
|
|
463
|
+
wasm.document_updateLeafField(retptr, this.__wbg_ptr, index, ptr0, len0, addHeapObject(value));
|
|
464
464
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
465
465
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
466
466
|
if (r1) {
|
|
@@ -523,22 +523,22 @@ export class Quill {
|
|
|
523
523
|
}
|
|
524
524
|
}
|
|
525
525
|
/**
|
|
526
|
-
* A blank form for a
|
|
526
|
+
* A blank form for a leaf of the given type — no document values supplied.
|
|
527
527
|
*
|
|
528
|
-
* Returns `null` if `
|
|
528
|
+
* Returns `null` if `leafKind` is not declared in this quill's schema.
|
|
529
529
|
* Otherwise returns a plain JS object shaped like a single entry in
|
|
530
|
-
* [`Form::
|
|
530
|
+
* [`Form::leaves`].
|
|
531
531
|
*
|
|
532
|
-
* [`Form::
|
|
533
|
-
* @param {string}
|
|
534
|
-
* @returns {
|
|
532
|
+
* [`Form::leaves`]: quillmark::form::Form::leaves
|
|
533
|
+
* @param {string} leaf_kind
|
|
534
|
+
* @returns {FormLeaf | null}
|
|
535
535
|
*/
|
|
536
|
-
|
|
536
|
+
blankLeaf(leaf_kind) {
|
|
537
537
|
try {
|
|
538
538
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
539
|
-
const ptr0 = passStringToWasm0(
|
|
539
|
+
const ptr0 = passStringToWasm0(leaf_kind, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
540
540
|
const len0 = WASM_VECTOR_LEN;
|
|
541
|
-
wasm.
|
|
541
|
+
wasm.quill_blankLeaf(retptr, this.__wbg_ptr, ptr0, len0);
|
|
542
542
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
543
543
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
544
544
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -551,14 +551,14 @@ export class Quill {
|
|
|
551
551
|
}
|
|
552
552
|
}
|
|
553
553
|
/**
|
|
554
|
-
* A blank form for the main
|
|
554
|
+
* A blank form for the main leaf — no document values supplied.
|
|
555
555
|
*
|
|
556
556
|
* Returns a plain JS object with the same shape as one entry in
|
|
557
557
|
* [`Form::main`]. Every declared field's `source` is `"default"` (when
|
|
558
558
|
* the schema declares a default) or `"missing"`.
|
|
559
559
|
*
|
|
560
560
|
* [`Form::main`]: quillmark::form::Form::main
|
|
561
|
-
* @returns {
|
|
561
|
+
* @returns {FormLeaf}
|
|
562
562
|
*/
|
|
563
563
|
blankMain() {
|
|
564
564
|
try {
|
|
@@ -624,7 +624,7 @@ export class Quill {
|
|
|
624
624
|
* ```json
|
|
625
625
|
* {
|
|
626
626
|
* "main": { "schema": {...}, "values": { "field": {...} } },
|
|
627
|
-
* "
|
|
627
|
+
* "leaves": [ ... ],
|
|
628
628
|
* "diagnostics": [ ... ]
|
|
629
629
|
* }
|
|
630
630
|
* ```
|
package/bundler/wasm_bg.wasm
CHANGED
|
Binary file
|
|
@@ -1,66 +1,66 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
|
-
export const __wbg_document_free: (a: number, b: number) => void;
|
|
5
|
-
export const __wbg_quill_free: (a: number, b: number) => void;
|
|
6
4
|
export const __wbg_quillmark_free: (a: number, b: number) => void;
|
|
5
|
+
export const __wbg_quill_free: (a: number, b: number) => void;
|
|
7
6
|
export const __wbg_rendersession_free: (a: number, b: number) => void;
|
|
8
|
-
export const
|
|
9
|
-
export const
|
|
10
|
-
export const
|
|
11
|
-
export const
|
|
7
|
+
export const __wbg_document_free: (a: number, b: number) => void;
|
|
8
|
+
export const quillmark_new: () => number;
|
|
9
|
+
export const quillmark_quill: (a: number, b: number, c: number) => void;
|
|
10
|
+
export const quill_render: (a: number, b: number, c: number, d: number) => void;
|
|
11
|
+
export const quill_open: (a: number, b: number, c: number) => void;
|
|
12
|
+
export const quill_backendId: (a: number, b: number) => void;
|
|
13
|
+
export const quill_supportsCanvas: (a: number) => number;
|
|
14
|
+
export const quill_example: (a: number, b: number) => void;
|
|
15
|
+
export const quill_blueprint: (a: number, b: number) => void;
|
|
16
|
+
export const quill_schema: (a: number) => number;
|
|
17
|
+
export const quill_metadata: (a: number) => number;
|
|
18
|
+
export const quill_form: (a: number, b: number, c: number) => void;
|
|
19
|
+
export const quill_blankMain: (a: number, b: number) => void;
|
|
20
|
+
export const quill_blankLeaf: (a: number, b: number, c: number, d: number) => void;
|
|
12
21
|
export const document_fromMarkdown: (a: number, b: number, c: number) => void;
|
|
13
|
-
export const
|
|
14
|
-
export const
|
|
15
|
-
export const document_moveCard: (a: number, b: number, c: number, d: number) => void;
|
|
16
|
-
export const document_pushCard: (a: number, b: number, c: number) => void;
|
|
22
|
+
export const document_toMarkdown: (a: number, b: number) => void;
|
|
23
|
+
export const document_clone: (a: number) => number;
|
|
17
24
|
export const document_quillRef: (a: number, b: number) => void;
|
|
18
|
-
export const
|
|
19
|
-
export const
|
|
20
|
-
export const
|
|
21
|
-
export const
|
|
22
|
-
export const
|
|
25
|
+
export const document_main: (a: number) => number;
|
|
26
|
+
export const document_leaves: (a: number) => number;
|
|
27
|
+
export const document_leafCount: (a: number) => number;
|
|
28
|
+
export const document_equals: (a: number, b: number) => number;
|
|
29
|
+
export const document_warnings: (a: number) => number;
|
|
23
30
|
export const document_setField: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
24
31
|
export const document_setFill: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
32
|
+
export const document_removeField: (a: number, b: number, c: number, d: number) => void;
|
|
25
33
|
export const document_setQuillRef: (a: number, b: number, c: number, d: number) => void;
|
|
26
|
-
export const
|
|
27
|
-
export const
|
|
28
|
-
export const
|
|
29
|
-
export const
|
|
30
|
-
export const
|
|
31
|
-
export const
|
|
32
|
-
export const
|
|
33
|
-
export const
|
|
34
|
-
export const
|
|
35
|
-
export const quill_example: (a: number, b: number) => void;
|
|
36
|
-
export const quill_form: (a: number, b: number, c: number) => void;
|
|
37
|
-
export const quill_metadata: (a: number) => number;
|
|
38
|
-
export const quill_open: (a: number, b: number, c: number) => void;
|
|
39
|
-
export const quill_render: (a: number, b: number, c: number, d: number) => void;
|
|
40
|
-
export const quill_schema: (a: number) => number;
|
|
41
|
-
export const quill_supportsCanvas: (a: number) => number;
|
|
42
|
-
export const quillmark_new: () => number;
|
|
43
|
-
export const quillmark_quill: (a: number, b: number, c: number) => void;
|
|
44
|
-
export const rendersession_backendId: (a: number, b: number) => void;
|
|
34
|
+
export const document_replaceBody: (a: number, b: number, c: number) => void;
|
|
35
|
+
export const document_pushLeaf: (a: number, b: number, c: number) => void;
|
|
36
|
+
export const document_insertLeaf: (a: number, b: number, c: number, d: number) => void;
|
|
37
|
+
export const document_removeLeaf: (a: number, b: number) => number;
|
|
38
|
+
export const document_moveLeaf: (a: number, b: number, c: number, d: number) => void;
|
|
39
|
+
export const document_setLeafKind: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
40
|
+
export const document_updateLeafField: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
41
|
+
export const document_removeLeafField: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
42
|
+
export const document_updateLeafBody: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
45
43
|
export const rendersession_pageCount: (a: number) => number;
|
|
46
|
-
export const
|
|
47
|
-
export const rendersession_paint: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
48
|
-
export const rendersession_render: (a: number, b: number, c: number) => void;
|
|
44
|
+
export const rendersession_backendId: (a: number, b: number) => void;
|
|
49
45
|
export const rendersession_supportsCanvas: (a: number) => number;
|
|
50
46
|
export const rendersession_warnings: (a: number) => number;
|
|
51
|
-
export const
|
|
52
|
-
export const
|
|
47
|
+
export const rendersession_render: (a: number, b: number, c: number) => void;
|
|
48
|
+
export const rendersession_pageSize: (a: number, b: number, c: number) => void;
|
|
49
|
+
export const rendersession_paint: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
50
|
+
export const init: () => void;
|
|
51
|
+
export const qcms_profile_is_bogus: (a: number) => number;
|
|
53
52
|
export const qcms_white_point_sRGB: (a: number) => void;
|
|
54
|
-
export const
|
|
55
|
-
export const qcms_transform_data_rgba_out_lut: (a: number, b: number, c: number, d: number) => void;
|
|
56
|
-
export const qcms_transform_data_bgra_out_lut: (a: number, b: number, c: number, d: number) => void;
|
|
53
|
+
export const qcms_profile_precache_output_transform: (a: number) => void;
|
|
57
54
|
export const qcms_transform_data_rgb_out_lut_precache: (a: number, b: number, c: number, d: number) => void;
|
|
58
55
|
export const qcms_transform_data_rgba_out_lut_precache: (a: number, b: number, c: number, d: number) => void;
|
|
59
56
|
export const qcms_transform_data_bgra_out_lut_precache: (a: number, b: number, c: number, d: number) => void;
|
|
60
|
-
export const
|
|
61
|
-
export const
|
|
62
|
-
export const
|
|
57
|
+
export const qcms_transform_data_rgb_out_lut: (a: number, b: number, c: number, d: number) => void;
|
|
58
|
+
export const qcms_transform_data_rgba_out_lut: (a: number, b: number, c: number, d: number) => void;
|
|
59
|
+
export const qcms_transform_data_bgra_out_lut: (a: number, b: number, c: number, d: number) => void;
|
|
63
60
|
export const qcms_transform_release: (a: number) => void;
|
|
61
|
+
export const qcms_enable_iccv4: () => void;
|
|
62
|
+
export const lut_interp_linear16: (a: number, b: number, c: number) => number;
|
|
63
|
+
export const lut_inverse_interp16: (a: number, b: number, c: number) => number;
|
|
64
64
|
export const __wbindgen_export: (a: number, b: number) => number;
|
|
65
65
|
export const __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
|
|
66
66
|
export const __wbindgen_export3: (a: number) => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quillmark/wasm",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.78.0",
|
|
4
4
|
"description": "WebAssembly bindings for quillmark",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT OR Apache-2.0",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
},
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|
|
12
|
-
"url": "git+https://github.com/
|
|
12
|
+
"url": "git+https://github.com/quillmark-org/quillmark.git"
|
|
13
13
|
},
|
|
14
14
|
"files": [
|
|
15
15
|
"bundler/wasm_bg.wasm",
|