@quillmark/wasm 0.112.0 → 0.113.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1487 -0
- package/README.md +91 -66
- package/core/wasm.d.ts +117 -182
- package/core/wasm.js +245 -391
- package/core/wasm_bg.wasm +0 -0
- package/core/wasm_bg.wasm.d.ts +5 -11
- package/package.json +2 -2
- package/{backends/pdfform → render}/wasm.d.ts +168 -264
- package/{backends/pdfform → render}/wasm.js +326 -450
- package/{backends/typst → render}/wasm_bg.wasm +0 -0
- package/{backends/typst → render}/wasm_bg.wasm.d.ts +7 -15
- package/runtime/runtime.d.ts +84 -178
- package/runtime/runtime.js +141 -583
- package/backends/pdfform/wasm_bg.wasm +0 -0
- package/backends/pdfform/wasm_bg.wasm.d.ts +0 -107
- package/backends/typst/wasm.d.ts +0 -1511
- package/backends/typst/wasm.js +0 -3008
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
/* @ts-self-types="./wasm.d.ts" */
|
|
2
2
|
|
|
3
|
-
/**
|
|
4
|
-
* Typed in-memory Quillmark document.
|
|
5
|
-
*/
|
|
6
3
|
export class Document {
|
|
7
4
|
static __wrap(ptr) {
|
|
8
|
-
ptr = ptr >>> 0;
|
|
9
5
|
const obj = Object.create(Document.prototype);
|
|
10
6
|
obj.__wbg_ptr = ptr;
|
|
11
7
|
DocumentFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
@@ -44,7 +40,7 @@ export class Document {
|
|
|
44
40
|
const len0 = WASM_VECTOR_LEN;
|
|
45
41
|
var ptr1 = isLikeNone(body) ? 0 : passStringToWasm0(body, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
46
42
|
var len1 = WASM_VECTOR_LEN;
|
|
47
|
-
wasm.document__addCard(retptr, this.__wbg_ptr, quill.__wbg_ptr, ptr0, len0, isLikeNone(fields) ? 0 : addHeapObject(fields), ptr1, len1, isLikeNone(at) ?
|
|
43
|
+
wasm.document__addCard(retptr, this.__wbg_ptr, quill.__wbg_ptr, ptr0, len0, isLikeNone(fields) ? 0 : addHeapObject(fields), ptr1, len1, isLikeNone(at) ? Number.MAX_SAFE_INTEGER : (at) >>> 0);
|
|
48
44
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
49
45
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
50
46
|
if (r1) {
|
|
@@ -58,10 +54,7 @@ export class Document {
|
|
|
58
54
|
* Typed field write at `addr`, resolving the field's schema `type` from
|
|
59
55
|
* `quill`: the stable ABI under the runtime `writer.set`. One verb for every
|
|
60
56
|
* field type; the schema carries the `inline` constraint, so no type token
|
|
61
|
-
* is passed.
|
|
62
|
-
* marks (anchors, island ids) and content-only marks survive compiles and
|
|
63
|
-
* the storage DTO. Values use the encoding the seam already speaks: content
|
|
64
|
-
* object or markdown string for richtext, scalar/array/object otherwise.
|
|
57
|
+
* is passed.
|
|
65
58
|
*
|
|
66
59
|
* A bare string is `Addr` shorthand for `{ field }`. A body address throws,
|
|
67
60
|
* having no field schema. A declared field is strict-committed, so a
|
|
@@ -120,30 +113,39 @@ export class Document {
|
|
|
120
113
|
}
|
|
121
114
|
}
|
|
122
115
|
/**
|
|
123
|
-
* Interpreted read
|
|
124
|
-
* `
|
|
125
|
-
*
|
|
126
|
-
*
|
|
127
|
-
*
|
|
116
|
+
* Interpreted **`Content`** read of a value nested inside the composite
|
|
117
|
+
* field at `addr`: the stable ABI under the runtime `reader.getContentAt`,
|
|
118
|
+
* and [`reader.getContent`](Self::reader_get_content) with the path spelled
|
|
119
|
+
* out. `path` is a `PathStep[]` from the field to the leaf — `[0]` an
|
|
120
|
+
* element of an `array<richtext>`, `["motto"]` an `object`'s content
|
|
121
|
+
* property, `[1, "notes"]` a leaf under both, `["controlled_by"]` a
|
|
122
|
+
* variant's cell.
|
|
128
123
|
*
|
|
129
|
-
*
|
|
130
|
-
*
|
|
131
|
-
*
|
|
132
|
-
*
|
|
133
|
-
*
|
|
134
|
-
* out-of-range `addr.card` throws.
|
|
124
|
+
* The codec is the leaf's declared type's, so the caller stops deciding
|
|
125
|
+
* what an element's stored bytes mean. Total over the storage form, as the
|
|
126
|
+
* whole-field read is. What it answers is a legal write input: the anchors
|
|
127
|
+
* and island ids the values form cannot carry ride back through
|
|
128
|
+
* `writer.set` of the whole field.
|
|
135
129
|
*
|
|
136
|
-
*
|
|
137
|
-
*
|
|
130
|
+
* `undefined` when the field is absent **and when `path` names nothing in
|
|
131
|
+
* the stored value**: a repeater's row index goes stale between derive and
|
|
132
|
+
* read, and absence there is a read, not a fault. Throws
|
|
133
|
+
* `edit::unknown_field` for an undeclared name at any depth,
|
|
134
|
+
* `edit::field_not_content` when `path` resolves to no content leaf,
|
|
135
|
+
* `edit::field_decode` for a value that decodes under neither encoding
|
|
136
|
+
* (anchored at the addressed path), and `edit::index_out_of_range` for a
|
|
137
|
+
* bad `addr.card`. A body address throws: a body has no nested content
|
|
138
|
+
* address.
|
|
138
139
|
* @param {Quill} quill
|
|
139
140
|
* @param {Addr | string} addr
|
|
140
|
-
* @
|
|
141
|
+
* @param {PathStep[]} path
|
|
142
|
+
* @returns {Content | undefined}
|
|
141
143
|
*/
|
|
142
|
-
|
|
144
|
+
_readerGetContentAt(quill, addr, path) {
|
|
143
145
|
try {
|
|
144
146
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
145
147
|
_assertClass(quill, Quill);
|
|
146
|
-
wasm.
|
|
148
|
+
wasm.document__readerGetContentAt(retptr, this.__wbg_ptr, quill.__wbg_ptr, addHeapObject(addr), addHeapObject(path));
|
|
147
149
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
148
150
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
149
151
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -191,37 +193,30 @@ export class Document {
|
|
|
191
193
|
}
|
|
192
194
|
}
|
|
193
195
|
/**
|
|
194
|
-
* Interpreted
|
|
195
|
-
*
|
|
196
|
-
*
|
|
197
|
-
*
|
|
198
|
-
*
|
|
199
|
-
* property, `[1, "notes"]` a leaf under both, `["controlled_by"]` a
|
|
200
|
-
* variant's cell.
|
|
196
|
+
* Interpreted read at `addr`, resolving the field's declared `type` from
|
|
197
|
+
* `quill`: the stable ABI under the runtime `reader.get`. The schema-plane
|
|
198
|
+
* twin of [`getStored`](Self::get_stored) — a `richtext` field returns its
|
|
199
|
+
* markdown projection, every other declared type its canonical value
|
|
200
|
+
* verbatim.
|
|
201
201
|
*
|
|
202
|
-
*
|
|
203
|
-
*
|
|
204
|
-
*
|
|
202
|
+
* A bare string is `Addr` shorthand for `{ field }`; `{ card, field }`
|
|
203
|
+
* targets a composable card. An **absent** field returns `undefined`, and an
|
|
204
|
+
* absent `addr.field` reads the body markdown. An undeclared name throws
|
|
205
|
+
* `edit::unknown_field` (the authority `bodyMarkdown` lacks), a `richtext`
|
|
206
|
+
* value that does not decode throws `edit::field_decode`, and an
|
|
207
|
+
* out-of-range `addr.card` throws.
|
|
205
208
|
*
|
|
206
|
-
* `
|
|
207
|
-
*
|
|
208
|
-
* read, and absence there is a read, not a fault. Throws
|
|
209
|
-
* `edit::unknown_field` for an undeclared name at any depth,
|
|
210
|
-
* `edit::field_not_content` when `path` resolves to no content leaf,
|
|
211
|
-
* `edit::field_decode` for a value that decodes under neither encoding
|
|
212
|
-
* (anchored at the addressed path), and `edit::index_out_of_range` for a
|
|
213
|
-
* bad `addr.card`. A body address throws: a body has no nested content
|
|
214
|
-
* address.
|
|
209
|
+
* The `quill` handle is passed per call because a `Document` carries only a
|
|
210
|
+
* `$quill` reference, not the resolved schema.
|
|
215
211
|
* @param {Quill} quill
|
|
216
212
|
* @param {Addr | string} addr
|
|
217
|
-
* @
|
|
218
|
-
* @returns {Content | undefined}
|
|
213
|
+
* @returns {unknown}
|
|
219
214
|
*/
|
|
220
|
-
|
|
215
|
+
_readerGet(quill, addr) {
|
|
221
216
|
try {
|
|
222
217
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
223
218
|
_assertClass(quill, Quill);
|
|
224
|
-
wasm.
|
|
219
|
+
wasm.document__readerGet(retptr, this.__wbg_ptr, quill.__wbg_ptr, addHeapObject(addr));
|
|
225
220
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
226
221
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
227
222
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -300,8 +295,8 @@ export class Document {
|
|
|
300
295
|
}
|
|
301
296
|
}
|
|
302
297
|
/**
|
|
303
|
-
*
|
|
304
|
-
*
|
|
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.
|
|
305
300
|
* @param {string} quill_name
|
|
306
301
|
* @returns {string}
|
|
307
302
|
*/
|
|
@@ -349,28 +344,6 @@ export class Document {
|
|
|
349
344
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
350
345
|
}
|
|
351
346
|
}
|
|
352
|
-
/**
|
|
353
|
-
* A single composable card by index, so reading one need not materialize
|
|
354
|
-
* every card via [`cards`](Self::cards). An out-of-range `index` throws
|
|
355
|
-
* `edit::index_out_of_range`.
|
|
356
|
-
* @param {number} index
|
|
357
|
-
* @returns {Card}
|
|
358
|
-
*/
|
|
359
|
-
card(index) {
|
|
360
|
-
try {
|
|
361
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
362
|
-
wasm.document_card(retptr, this.__wbg_ptr, index);
|
|
363
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
364
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
365
|
-
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
366
|
-
if (r2) {
|
|
367
|
-
throw takeObject(r1);
|
|
368
|
-
}
|
|
369
|
-
return takeObject(r0);
|
|
370
|
-
} finally {
|
|
371
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
372
|
-
}
|
|
373
|
-
}
|
|
374
347
|
/**
|
|
375
348
|
* Number of composable cards, excluding the main card.
|
|
376
349
|
* @returns {number}
|
|
@@ -403,6 +376,28 @@ export class Document {
|
|
|
403
376
|
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
404
377
|
}
|
|
405
378
|
}
|
|
379
|
+
/**
|
|
380
|
+
* A single composable card by index, so reading one need not materialize
|
|
381
|
+
* every card via [`cards`](Self::cards). An out-of-range `index` throws
|
|
382
|
+
* `edit::index_out_of_range`.
|
|
383
|
+
* @param {number} index
|
|
384
|
+
* @returns {Card}
|
|
385
|
+
*/
|
|
386
|
+
card(index) {
|
|
387
|
+
try {
|
|
388
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
389
|
+
wasm.document_card(retptr, this.__wbg_ptr, index);
|
|
390
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
391
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
392
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
393
|
+
if (r2) {
|
|
394
|
+
throw takeObject(r1);
|
|
395
|
+
}
|
|
396
|
+
return takeObject(r0);
|
|
397
|
+
} finally {
|
|
398
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
399
|
+
}
|
|
400
|
+
}
|
|
406
401
|
/**
|
|
407
402
|
* @returns {Card[]}
|
|
408
403
|
*/
|
|
@@ -429,7 +424,7 @@ export class Document {
|
|
|
429
424
|
return Document.__wrap(ret);
|
|
430
425
|
}
|
|
431
426
|
/**
|
|
432
|
-
* Storage version this build writes via [`
|
|
427
|
+
* Storage version this build writes via [`toStored`](Document::to_stored). The
|
|
433
428
|
* tag advances only when the wire format changes, not on every release.
|
|
434
429
|
* @returns {string}
|
|
435
430
|
*/
|
|
@@ -459,28 +454,6 @@ export class Document {
|
|
|
459
454
|
const ret = wasm.document_equals(this.__wbg_ptr, other.__wbg_ptr);
|
|
460
455
|
return ret !== 0;
|
|
461
456
|
}
|
|
462
|
-
/**
|
|
463
|
-
* Render a Diagnostic as the canonical pretty-printed text, so it looks
|
|
464
|
-
* identical whichever consumer surfaces it.
|
|
465
|
-
* @param {Diagnostic} diag
|
|
466
|
-
* @returns {string}
|
|
467
|
-
*/
|
|
468
|
-
static formatDiagnostic(diag) {
|
|
469
|
-
let deferred1_0;
|
|
470
|
-
let deferred1_1;
|
|
471
|
-
try {
|
|
472
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
473
|
-
wasm.document_formatDiagnostic(retptr, addHeapObject(diag));
|
|
474
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
475
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
476
|
-
deferred1_0 = r0;
|
|
477
|
-
deferred1_1 = r1;
|
|
478
|
-
return getStringFromWasm0(r0, r1);
|
|
479
|
-
} finally {
|
|
480
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
481
|
-
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
482
|
-
}
|
|
483
|
-
}
|
|
484
457
|
/**
|
|
485
458
|
* Authoring-format rules for the card-yaml markdown surface, re-exposed from
|
|
486
459
|
* core. Constant across calls; read once and cache.
|
|
@@ -503,19 +476,16 @@ export class Document {
|
|
|
503
476
|
}
|
|
504
477
|
}
|
|
505
478
|
/**
|
|
506
|
-
*
|
|
507
|
-
*
|
|
508
|
-
* Throws if `json` is not a valid storage DTO (malformed JSON, unknown
|
|
509
|
-
* `schema`, missing fields, or unparseable quill reference).
|
|
510
|
-
* @param {string} json
|
|
479
|
+
* Parse markdown into a typed Document. Throws on parse errors.
|
|
480
|
+
* @param {string} markdown
|
|
511
481
|
* @returns {Document}
|
|
512
482
|
*/
|
|
513
|
-
static
|
|
483
|
+
static fromMarkdown(markdown) {
|
|
514
484
|
try {
|
|
515
485
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
516
|
-
const ptr0 = passStringToWasm0(
|
|
486
|
+
const ptr0 = passStringToWasm0(markdown, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
517
487
|
const len0 = WASM_VECTOR_LEN;
|
|
518
|
-
wasm.
|
|
488
|
+
wasm.document_fromMarkdown(retptr, ptr0, len0);
|
|
519
489
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
520
490
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
521
491
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -528,16 +498,19 @@ export class Document {
|
|
|
528
498
|
}
|
|
529
499
|
}
|
|
530
500
|
/**
|
|
531
|
-
*
|
|
532
|
-
*
|
|
501
|
+
* Reconstruct a `Document` from a versioned storage DTO string produced by
|
|
502
|
+
* [`toStored`](Document::to_stored). The result carries no parse-time warnings.
|
|
503
|
+
* Throws if `json` is not a valid storage DTO (malformed JSON, unknown
|
|
504
|
+
* `schema`, missing fields, or unparseable quill reference).
|
|
505
|
+
* @param {string} json
|
|
533
506
|
* @returns {Document}
|
|
534
507
|
*/
|
|
535
|
-
static
|
|
508
|
+
static fromStored(json) {
|
|
536
509
|
try {
|
|
537
510
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
538
|
-
const ptr0 = passStringToWasm0(
|
|
511
|
+
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
539
512
|
const len0 = WASM_VECTOR_LEN;
|
|
540
|
-
wasm.
|
|
513
|
+
wasm.document_fromStored(retptr, ptr0, len0);
|
|
541
514
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
542
515
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
543
516
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -572,31 +545,6 @@ export class Document {
|
|
|
572
545
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
573
546
|
}
|
|
574
547
|
}
|
|
575
|
-
/**
|
|
576
|
-
* The value stored under `$ext[ns]` at `addr` (a card address, absent `card`
|
|
577
|
-
* = main), or `undefined`. Throws on a present `field` or an out-of-range
|
|
578
|
-
* card.
|
|
579
|
-
* @param {CardAddr} addr
|
|
580
|
-
* @param {string} ns
|
|
581
|
-
* @returns {unknown}
|
|
582
|
-
*/
|
|
583
|
-
getExtNamespace(addr, ns) {
|
|
584
|
-
try {
|
|
585
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
586
|
-
const ptr0 = passStringToWasm0(ns, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
587
|
-
const len0 = WASM_VECTOR_LEN;
|
|
588
|
-
wasm.document_getExtNamespace(retptr, this.__wbg_ptr, addHeapObject(addr), ptr0, len0);
|
|
589
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
590
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
591
|
-
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
592
|
-
if (r2) {
|
|
593
|
-
throw takeObject(r1);
|
|
594
|
-
}
|
|
595
|
-
return takeObject(r0);
|
|
596
|
-
} finally {
|
|
597
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
598
|
-
}
|
|
599
|
-
}
|
|
600
548
|
/**
|
|
601
549
|
* Read the **verbatim stored value** at `addr`: a field's raw payload value,
|
|
602
550
|
* or the body content when `addr.field` is absent. A bare string is `Addr`
|
|
@@ -613,9 +561,8 @@ export class Document {
|
|
|
613
561
|
* conformed, and this read reports what is there. For the `Content` either
|
|
614
562
|
* way use `reader.getContent`.
|
|
615
563
|
*
|
|
616
|
-
* The body arm is typed `Content
|
|
617
|
-
*
|
|
618
|
-
* which omit a zero: verbatim is the contract, and is why it is `unknown`.
|
|
564
|
+
* The body arm is typed `Content`; a field arm echoes the stored bytes
|
|
565
|
+
* unread, which is the contract and why it is `unknown`.
|
|
619
566
|
* @param {Addr | string} addr
|
|
620
567
|
* @returns {unknown}
|
|
621
568
|
*/
|
|
@@ -645,7 +592,7 @@ export class Document {
|
|
|
645
592
|
insertCard(card, at) {
|
|
646
593
|
try {
|
|
647
594
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
648
|
-
wasm.document_insertCard(retptr, this.__wbg_ptr, addHeapObject(card), isLikeNone(at) ?
|
|
595
|
+
wasm.document_insertCard(retptr, this.__wbg_ptr, addHeapObject(card), isLikeNone(at) ? Number.MAX_SAFE_INTEGER : (at) >>> 0);
|
|
649
596
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
650
597
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
651
598
|
if (r1) {
|
|
@@ -679,21 +626,18 @@ export class Document {
|
|
|
679
626
|
}
|
|
680
627
|
/**
|
|
681
628
|
* Replace this document's contents **in place** from a versioned storage DTO
|
|
682
|
-
* string: the mutating twin of [`
|
|
683
|
-
* `warnings` are cleared. Throws on an invalid DTO, leaving the
|
|
684
|
-
* unchanged.
|
|
685
|
-
*
|
|
686
|
-
* The cross-WASM-memory `Document` bridge: mutate a document on a
|
|
687
|
-
* backend-memory clone, then write the state back into the caller's
|
|
688
|
-
* canonical document, without the caller re-binding its variable.
|
|
629
|
+
* string: the mutating twin of [`fromStored`](Document::from_stored).
|
|
630
|
+
* Parse-time `warnings` are cleared. Throws on an invalid DTO, leaving the
|
|
631
|
+
* document unchanged. A caller holding the document need not re-bind its
|
|
632
|
+
* variable.
|
|
689
633
|
* @param {string} json
|
|
690
634
|
*/
|
|
691
|
-
|
|
635
|
+
loadStored(json) {
|
|
692
636
|
try {
|
|
693
637
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
694
638
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
695
639
|
const len0 = WASM_VECTOR_LEN;
|
|
696
|
-
wasm.
|
|
640
|
+
wasm.document_loadStored(retptr, this.__wbg_ptr, ptr0, len0);
|
|
697
641
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
698
642
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
699
643
|
if (r1) {
|
|
@@ -722,39 +666,6 @@ export class Document {
|
|
|
722
666
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
723
667
|
}
|
|
724
668
|
}
|
|
725
|
-
/**
|
|
726
|
-
* Build a fresh `Card` from a kind and a flat field map: the ergonomic
|
|
727
|
-
* constructor for `insertCard`, which also takes any `Card` object
|
|
728
|
-
* directly. Each `fields` entry becomes a card field in insertion order;
|
|
729
|
-
* `body` defaults to `""`.
|
|
730
|
-
*
|
|
731
|
-
* Checks only what a detached card can decide alone: field-name grammar and
|
|
732
|
-
* value depth. Kind validity is positional, so `insertCard` is its gate and
|
|
733
|
-
* any kind string is accepted here.
|
|
734
|
-
* @param {string} kind
|
|
735
|
-
* @param {Record<string, unknown>} [fields]
|
|
736
|
-
* @param {string} [body]
|
|
737
|
-
* @returns {Card}
|
|
738
|
-
*/
|
|
739
|
-
static makeCard(kind, fields, body) {
|
|
740
|
-
try {
|
|
741
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
742
|
-
const ptr0 = passStringToWasm0(kind, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
743
|
-
const len0 = WASM_VECTOR_LEN;
|
|
744
|
-
var ptr1 = isLikeNone(body) ? 0 : passStringToWasm0(body, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
745
|
-
var len1 = WASM_VECTOR_LEN;
|
|
746
|
-
wasm.document_makeCard(retptr, ptr0, len0, isLikeNone(fields) ? 0 : addHeapObject(fields), ptr1, len1);
|
|
747
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
748
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
749
|
-
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
750
|
-
if (r2) {
|
|
751
|
-
throw takeObject(r1);
|
|
752
|
-
}
|
|
753
|
-
return takeObject(r0);
|
|
754
|
-
} finally {
|
|
755
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
756
|
-
}
|
|
757
|
-
}
|
|
758
669
|
/**
|
|
759
670
|
* Move the card at `from` to position `to`. `from == to` is a no-op.
|
|
760
671
|
* @param {number} from
|
|
@@ -793,7 +704,7 @@ export class Document {
|
|
|
793
704
|
if (r2) {
|
|
794
705
|
throw takeObject(r1);
|
|
795
706
|
}
|
|
796
|
-
this.__wbg_ptr = r0
|
|
707
|
+
this.__wbg_ptr = r0;
|
|
797
708
|
DocumentFinalization.register(this, this.__wbg_ptr, this);
|
|
798
709
|
return this;
|
|
799
710
|
} finally {
|
|
@@ -867,14 +778,17 @@ export class Document {
|
|
|
867
778
|
}
|
|
868
779
|
}
|
|
869
780
|
/**
|
|
781
|
+
* The canonical `$quill` reference grammar as author-facing text: the same
|
|
782
|
+
* text the `parse::invalid_quill_reference` hint carries. Drive validation
|
|
783
|
+
* messages from this instead of re-stating the rule.
|
|
870
784
|
* @returns {string}
|
|
871
785
|
*/
|
|
872
|
-
|
|
786
|
+
static quillRefHint() {
|
|
873
787
|
let deferred1_0;
|
|
874
788
|
let deferred1_1;
|
|
875
789
|
try {
|
|
876
790
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
877
|
-
wasm.
|
|
791
|
+
wasm.document_quillRefHint(retptr);
|
|
878
792
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
879
793
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
880
794
|
deferred1_0 = r0;
|
|
@@ -886,17 +800,14 @@ export class Document {
|
|
|
886
800
|
}
|
|
887
801
|
}
|
|
888
802
|
/**
|
|
889
|
-
* The canonical `$quill` reference grammar as author-facing text: the same
|
|
890
|
-
* text the `parse::invalid_quill_reference` hint carries. Drive validation
|
|
891
|
-
* messages from this instead of re-stating the rule.
|
|
892
803
|
* @returns {string}
|
|
893
804
|
*/
|
|
894
|
-
|
|
805
|
+
get quillRef() {
|
|
895
806
|
let deferred1_0;
|
|
896
807
|
let deferred1_1;
|
|
897
808
|
try {
|
|
898
809
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
899
|
-
wasm.
|
|
810
|
+
wasm.document_quillRef(retptr, this.__wbg_ptr);
|
|
900
811
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
901
812
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
902
813
|
deferred1_0 = r0;
|
|
@@ -928,8 +839,8 @@ export class Document {
|
|
|
928
839
|
}
|
|
929
840
|
/**
|
|
930
841
|
* Remove the `$ext` map on the card `addr` targets entirely, returning the
|
|
931
|
-
* previous map or `undefined`. Discards every namespace at once
|
|
932
|
-
*
|
|
842
|
+
* previous map or `undefined`. Discards every namespace at once. Throws on
|
|
843
|
+
* a present `field` or an out-of-range card.
|
|
933
844
|
* @param {CardAddr} [addr]
|
|
934
845
|
* @returns {Record<string, unknown> | undefined}
|
|
935
846
|
*/
|
|
@@ -948,32 +859,6 @@ export class Document {
|
|
|
948
859
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
949
860
|
}
|
|
950
861
|
}
|
|
951
|
-
/**
|
|
952
|
-
* Remove `$ext[ns]` on the card `addr` targets, returning its value or
|
|
953
|
-
* `undefined`; drops `$ext` once empty. `addr` is a card address (absent =
|
|
954
|
-
* main). Preserves sibling namespaces. Throws on a present `field` or an
|
|
955
|
-
* out-of-range card.
|
|
956
|
-
* @param {CardAddr} addr
|
|
957
|
-
* @param {string} ns
|
|
958
|
-
* @returns {any}
|
|
959
|
-
*/
|
|
960
|
-
removeExtNamespace(addr, ns) {
|
|
961
|
-
try {
|
|
962
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
963
|
-
const ptr0 = passStringToWasm0(ns, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
964
|
-
const len0 = WASM_VECTOR_LEN;
|
|
965
|
-
wasm.document_removeExtNamespace(retptr, this.__wbg_ptr, addHeapObject(addr), ptr0, len0);
|
|
966
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
967
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
968
|
-
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
969
|
-
if (r2) {
|
|
970
|
-
throw takeObject(r1);
|
|
971
|
-
}
|
|
972
|
-
return takeObject(r0);
|
|
973
|
-
} finally {
|
|
974
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
975
|
-
}
|
|
976
|
-
}
|
|
977
862
|
/**
|
|
978
863
|
* Remove a field at `addr`, returning the removed value or `undefined`. A
|
|
979
864
|
* bare string is `Addr` shorthand for `{ field }`. A body address throws, as
|
|
@@ -1074,28 +959,6 @@ export class Document {
|
|
|
1074
959
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1075
960
|
}
|
|
1076
961
|
}
|
|
1077
|
-
/**
|
|
1078
|
-
* Replace the kind of the card at `index`. Payload and body are untouched;
|
|
1079
|
-
* schema-aware migration is the caller's responsibility.
|
|
1080
|
-
* Throws if `index` is out of range or `newKind` is invalid.
|
|
1081
|
-
* @param {number} index
|
|
1082
|
-
* @param {string} new_kind
|
|
1083
|
-
*/
|
|
1084
|
-
setCardKind(index, new_kind) {
|
|
1085
|
-
try {
|
|
1086
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1087
|
-
const ptr0 = passStringToWasm0(new_kind, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1088
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1089
|
-
wasm.document_setCardKind(retptr, this.__wbg_ptr, index, ptr0, len0);
|
|
1090
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1091
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1092
|
-
if (r1) {
|
|
1093
|
-
throw takeObject(r0);
|
|
1094
|
-
}
|
|
1095
|
-
} finally {
|
|
1096
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1097
|
-
}
|
|
1098
|
-
}
|
|
1099
962
|
/**
|
|
1100
963
|
* Replace the QUILL reference string. Throws if `ref_str` is invalid.
|
|
1101
964
|
* @param {string} ref_str
|
|
@@ -1118,7 +981,7 @@ export class Document {
|
|
|
1118
981
|
/**
|
|
1119
982
|
* Read the storage version tag from a raw storage DTO string without a full
|
|
1120
983
|
* parse, or `undefined`. Unknown future versions come back as-is, which
|
|
1121
|
-
* distinguishes "build too old" from "payload corrupt" when `
|
|
984
|
+
* distinguishes "build too old" from "payload corrupt" when `fromStored`
|
|
1122
985
|
* throws. This is the storage version, not a field schema, though the JSON
|
|
1123
986
|
* key is spelled `"schema"`: that is the DTO's serde tag.
|
|
1124
987
|
* @param {string} json
|
|
@@ -1134,7 +997,7 @@ export class Document {
|
|
|
1134
997
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1135
998
|
let v2;
|
|
1136
999
|
if (r0 !== 0) {
|
|
1137
|
-
v2 = getStringFromWasm0(r0, r1)
|
|
1000
|
+
v2 = getStringFromWasm0(r0, r1);
|
|
1138
1001
|
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
1139
1002
|
}
|
|
1140
1003
|
return v2;
|
|
@@ -1145,8 +1008,10 @@ export class Document {
|
|
|
1145
1008
|
/**
|
|
1146
1009
|
* Replace the opaque `$ext` map on the card `addr` targets (absent `card` =
|
|
1147
1010
|
* main). `value` must be a plain object. `$ext` carries out-of-band consumer
|
|
1148
|
-
* state and never reaches the rendered output.
|
|
1149
|
-
*
|
|
1011
|
+
* state and never reaches the rendered output. The whole map is the write,
|
|
1012
|
+
* so a consumer holding one namespace merges the rest:
|
|
1013
|
+
* `{...doc.getExt(addr), [ns]: v}`. Throws on a present `field` or an
|
|
1014
|
+
* out-of-range card.
|
|
1150
1015
|
* @param {CardAddr} addr
|
|
1151
1016
|
* @param {any} value
|
|
1152
1017
|
*/
|
|
@@ -1163,29 +1028,6 @@ export class Document {
|
|
|
1163
1028
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1164
1029
|
}
|
|
1165
1030
|
}
|
|
1166
|
-
/**
|
|
1167
|
-
* Merge `value` into `$ext[ns]` on the card `addr` targets, preserving
|
|
1168
|
-
* sibling namespaces: the recommended `$ext` write. Throws on a present
|
|
1169
|
-
* `field` or an out-of-range card.
|
|
1170
|
-
* @param {CardAddr} addr
|
|
1171
|
-
* @param {string} ns
|
|
1172
|
-
* @param {any} value
|
|
1173
|
-
*/
|
|
1174
|
-
storeExtNamespace(addr, ns, value) {
|
|
1175
|
-
try {
|
|
1176
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1177
|
-
const ptr0 = passStringToWasm0(ns, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1178
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1179
|
-
wasm.document_storeExtNamespace(retptr, this.__wbg_ptr, addHeapObject(addr), ptr0, len0, addHeapObject(value));
|
|
1180
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1181
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1182
|
-
if (r1) {
|
|
1183
|
-
throw takeObject(r0);
|
|
1184
|
-
}
|
|
1185
|
-
} finally {
|
|
1186
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1187
|
-
}
|
|
1188
|
-
}
|
|
1189
1031
|
/**
|
|
1190
1032
|
* Store a field verbatim at `addr`, deferring coercion to render; the typed
|
|
1191
1033
|
* write is [`commitField`](Document::commit_field). A bare string is `Addr`
|
|
@@ -1274,18 +1116,16 @@ export class Document {
|
|
|
1274
1116
|
}
|
|
1275
1117
|
}
|
|
1276
1118
|
/**
|
|
1277
|
-
*
|
|
1278
|
-
* `
|
|
1279
|
-
* version and the output is byte-deterministic within one, so equal
|
|
1280
|
-
* documents hash equal. Parse-time `warnings` are excluded.
|
|
1119
|
+
* Emit canonical Quillmark Markdown. Round-trip safe: re-parsing the
|
|
1120
|
+
* result produces a `Document` equal to `self` by value and by type.
|
|
1281
1121
|
* @returns {string}
|
|
1282
1122
|
*/
|
|
1283
|
-
|
|
1123
|
+
toMarkdown() {
|
|
1284
1124
|
let deferred1_0;
|
|
1285
1125
|
let deferred1_1;
|
|
1286
1126
|
try {
|
|
1287
1127
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1288
|
-
wasm.
|
|
1128
|
+
wasm.document_toMarkdown(retptr, this.__wbg_ptr);
|
|
1289
1129
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1290
1130
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1291
1131
|
deferred1_0 = r0;
|
|
@@ -1297,16 +1137,18 @@ export class Document {
|
|
|
1297
1137
|
}
|
|
1298
1138
|
}
|
|
1299
1139
|
/**
|
|
1300
|
-
*
|
|
1301
|
-
*
|
|
1140
|
+
* Serialize this document to a versioned storage DTO string. Prefer it over
|
|
1141
|
+
* `toMarkdown` for persistence: the wire format is frozen per `schema`
|
|
1142
|
+
* version and the output is byte-deterministic within one, so equal
|
|
1143
|
+
* documents hash equal. Parse-time `warnings` are excluded.
|
|
1302
1144
|
* @returns {string}
|
|
1303
1145
|
*/
|
|
1304
|
-
|
|
1146
|
+
toStored() {
|
|
1305
1147
|
let deferred1_0;
|
|
1306
1148
|
let deferred1_1;
|
|
1307
1149
|
try {
|
|
1308
1150
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1309
|
-
wasm.
|
|
1151
|
+
wasm.document_toStored(retptr, this.__wbg_ptr);
|
|
1310
1152
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1311
1153
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1312
1154
|
deferred1_0 = r0;
|
|
@@ -1317,24 +1159,11 @@ export class Document {
|
|
|
1317
1159
|
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
1318
1160
|
}
|
|
1319
1161
|
}
|
|
1320
|
-
/**
|
|
1321
|
-
* Like [`fromJson`](Document::from_json) but returns `undefined` instead of
|
|
1322
|
-
* throwing when `json` is not a valid storage DTO, to discriminate format
|
|
1323
|
-
* without exceptions as control flow.
|
|
1324
|
-
* @param {string} json
|
|
1325
|
-
* @returns {Document | undefined}
|
|
1326
|
-
*/
|
|
1327
|
-
static tryFromJson(json) {
|
|
1328
|
-
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1329
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1330
|
-
const ret = wasm.document_tryFromJson(ptr0, len0);
|
|
1331
|
-
return ret === 0 ? undefined : Document.__wrap(ret);
|
|
1332
|
-
}
|
|
1333
1162
|
/**
|
|
1334
1163
|
* The non-fatal diagnostics of the load that produced this document: parse
|
|
1335
1164
|
* warnings, plus `conform::*` warnings when it came through `quill.parse`.
|
|
1336
1165
|
* Session state, not document value: `equals` and the storage DTO exclude
|
|
1337
|
-
* it, and `
|
|
1166
|
+
* it, and `fromStored` / `loadStored` clear it.
|
|
1338
1167
|
* @returns {Diagnostic[]}
|
|
1339
1168
|
*/
|
|
1340
1169
|
get warnings() {
|
|
@@ -1356,18 +1185,17 @@ export class Document {
|
|
|
1356
1185
|
if (Symbol.dispose) Document.prototype[Symbol.dispose] = Document.prototype.free;
|
|
1357
1186
|
|
|
1358
1187
|
/**
|
|
1359
|
-
* Live render session: every read serves the current compile. `
|
|
1188
|
+
* Live render session: every read serves the current compile. `update(doc)`
|
|
1360
1189
|
* recompiles a whole document in place, transactionally — on throw the reads
|
|
1361
1190
|
* keep serving the last-good compile. Geometry is per-compile, so re-read it
|
|
1362
|
-
* after each committed `
|
|
1191
|
+
* after each committed `update`.
|
|
1363
1192
|
*
|
|
1364
1193
|
* A zero-page document yields a valid session (`pageCount === 0`) whose
|
|
1365
|
-
* `paint(ctx, 0)` and `pageSize(0)` throw
|
|
1366
|
-
* than catching.
|
|
1194
|
+
* `paint(ctx, 0)` and `pageSize(0)` throw as any out-of-range page does; branch
|
|
1195
|
+
* on `pageCount === 0` rather than catching.
|
|
1367
1196
|
*/
|
|
1368
1197
|
export class LiveSession {
|
|
1369
1198
|
static __wrap(ptr) {
|
|
1370
|
-
ptr = ptr >>> 0;
|
|
1371
1199
|
const obj = Object.create(LiveSession.prototype);
|
|
1372
1200
|
obj.__wbg_ptr = ptr;
|
|
1373
1201
|
LiveSessionFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
@@ -1425,12 +1253,12 @@ export class LiveSession {
|
|
|
1425
1253
|
fieldAt(page, x, y, tol_pt) {
|
|
1426
1254
|
try {
|
|
1427
1255
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1428
|
-
wasm.livesession_fieldAt(retptr, this.__wbg_ptr, page, x, y, isLikeNone(tol_pt) ?
|
|
1256
|
+
wasm.livesession_fieldAt(retptr, this.__wbg_ptr, page, x, y, isLikeNone(tol_pt) ? Number.MAX_SAFE_INTEGER : Math.fround(tol_pt));
|
|
1429
1257
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1430
1258
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1431
1259
|
let v1;
|
|
1432
1260
|
if (r0 !== 0) {
|
|
1433
|
-
v1 = getStringFromWasm0(r0, r1)
|
|
1261
|
+
v1 = getStringFromWasm0(r0, r1);
|
|
1434
1262
|
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
1435
1263
|
}
|
|
1436
1264
|
return v1;
|
|
@@ -1474,10 +1302,21 @@ export class LiveSession {
|
|
|
1474
1302
|
* @returns {FieldRegion | undefined}
|
|
1475
1303
|
*/
|
|
1476
1304
|
locate(field, pos) {
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1305
|
+
try {
|
|
1306
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1307
|
+
const ptr0 = passStringToWasm0(field, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1308
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1309
|
+
wasm.livesession_locate(retptr, this.__wbg_ptr, ptr0, len0, pos);
|
|
1310
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1311
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1312
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1313
|
+
if (r2) {
|
|
1314
|
+
throw takeObject(r1);
|
|
1315
|
+
}
|
|
1316
|
+
return takeObject(r0);
|
|
1317
|
+
} finally {
|
|
1318
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1319
|
+
}
|
|
1481
1320
|
}
|
|
1482
1321
|
/**
|
|
1483
1322
|
* @returns {number}
|
|
@@ -1487,8 +1326,8 @@ export class LiveSession {
|
|
|
1487
1326
|
return ret >>> 0;
|
|
1488
1327
|
}
|
|
1489
1328
|
/**
|
|
1490
|
-
* Page dimensions in points (1 pt = 1/72 inch).
|
|
1491
|
-
*
|
|
1329
|
+
* Page dimensions in points (1 pt = 1/72 inch). Throws if `page` is out of
|
|
1330
|
+
* range, which a zero-page compile makes true of every index.
|
|
1492
1331
|
* @param {number} page
|
|
1493
1332
|
* @returns {PageSize}
|
|
1494
1333
|
*/
|
|
@@ -1519,8 +1358,9 @@ export class LiveSession {
|
|
|
1519
1358
|
* its own `<canvas>`: no compositing, sub-rect, or transform reaches through
|
|
1520
1359
|
* this call.
|
|
1521
1360
|
*
|
|
1522
|
-
* Throws if
|
|
1523
|
-
*
|
|
1361
|
+
* Throws if `page` is out of range, `ctx` is the wrong type, either scale is
|
|
1362
|
+
* non-finite or `<= 0`, or the page cannot be rasterized at the resulting
|
|
1363
|
+
* scale (`backend::invalid_raster_scale`).
|
|
1524
1364
|
* @param {CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D} ctx
|
|
1525
1365
|
* @param {number} page
|
|
1526
1366
|
* @param {PaintOptions | undefined} opts
|
|
@@ -1558,8 +1398,19 @@ export class LiveSession {
|
|
|
1558
1398
|
* @returns {ContentHit | undefined}
|
|
1559
1399
|
*/
|
|
1560
1400
|
positionAt(page, x, y, tol_pt) {
|
|
1561
|
-
|
|
1562
|
-
|
|
1401
|
+
try {
|
|
1402
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1403
|
+
wasm.livesession_positionAt(retptr, this.__wbg_ptr, page, x, y, isLikeNone(tol_pt) ? Number.MAX_SAFE_INTEGER : Math.fround(tol_pt));
|
|
1404
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1405
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1406
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1407
|
+
if (r2) {
|
|
1408
|
+
throw takeObject(r1);
|
|
1409
|
+
}
|
|
1410
|
+
return takeObject(r0);
|
|
1411
|
+
} finally {
|
|
1412
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1413
|
+
}
|
|
1563
1414
|
}
|
|
1564
1415
|
/**
|
|
1565
1416
|
* Schema-field geometry for this compiled session: each content field's
|
|
@@ -1604,14 +1455,6 @@ export class LiveSession {
|
|
|
1604
1455
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1605
1456
|
}
|
|
1606
1457
|
}
|
|
1607
|
-
/**
|
|
1608
|
-
* `true` iff `paint` and `pageSize` will succeed for this session.
|
|
1609
|
-
* @returns {boolean}
|
|
1610
|
-
*/
|
|
1611
|
-
get supportsCanvas() {
|
|
1612
|
-
const ret = wasm.livesession_supportsCanvas(this.__wbg_ptr);
|
|
1613
|
-
return ret !== 0;
|
|
1614
|
-
}
|
|
1615
1458
|
/**
|
|
1616
1459
|
* Recompile the session against `doc`: the edit verb of a live preview. The
|
|
1617
1460
|
* document compiles through the same pipeline as `open`, then swaps in
|
|
@@ -1642,7 +1485,7 @@ export class LiveSession {
|
|
|
1642
1485
|
}
|
|
1643
1486
|
/**
|
|
1644
1487
|
* Non-fatal diagnostics of the session's **current compile**, refreshed by
|
|
1645
|
-
* each committed `
|
|
1488
|
+
* each committed `update`; a failed `update` keeps the last-good compile's.
|
|
1646
1489
|
* Also appended to `RenderResult.warnings` on each `render()`.
|
|
1647
1490
|
* @returns {Diagnostic[]}
|
|
1648
1491
|
*/
|
|
@@ -1666,7 +1509,6 @@ if (Symbol.dispose) LiveSession.prototype[Symbol.dispose] = LiveSession.prototyp
|
|
|
1666
1509
|
|
|
1667
1510
|
export class Quill {
|
|
1668
1511
|
static __wrap(ptr) {
|
|
1669
|
-
ptr = ptr >>> 0;
|
|
1670
1512
|
const obj = Object.create(Quill.prototype);
|
|
1671
1513
|
obj.__wbg_ptr = ptr;
|
|
1672
1514
|
QuillFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
@@ -1682,6 +1524,32 @@ export class Quill {
|
|
|
1682
1524
|
const ptr = this.__destroy_into_raw();
|
|
1683
1525
|
wasm.__wbg_quill_free(ptr, 0);
|
|
1684
1526
|
}
|
|
1527
|
+
/**
|
|
1528
|
+
* The resolved-value view of `doc`: the ABI under `reader.resolve()`. For
|
|
1529
|
+
* every declared field, the value the render projection would use and the
|
|
1530
|
+
* `FieldSource` rung it came from (`"authored" | "default" | "blank"`). The
|
|
1531
|
+
* card body is a `body` sibling on its card, never a row in `fields`, and
|
|
1532
|
+
* `null` when the kind enables no body. Value and provenance only;
|
|
1533
|
+
* completeness stays `validate`'s.
|
|
1534
|
+
* @param {Document} doc
|
|
1535
|
+
* @returns {Resolved}
|
|
1536
|
+
*/
|
|
1537
|
+
_resolve(doc) {
|
|
1538
|
+
try {
|
|
1539
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1540
|
+
_assertClass(doc, Document);
|
|
1541
|
+
wasm.quill__resolve(retptr, this.__wbg_ptr, doc.__wbg_ptr);
|
|
1542
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1543
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1544
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1545
|
+
if (r2) {
|
|
1546
|
+
throw takeObject(r1);
|
|
1547
|
+
}
|
|
1548
|
+
return takeObject(r0);
|
|
1549
|
+
} finally {
|
|
1550
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1551
|
+
}
|
|
1552
|
+
}
|
|
1685
1553
|
/**
|
|
1686
1554
|
* The *declared* backend identifier (e.g. `"typst"`): intent, not a
|
|
1687
1555
|
* resolved capability. Capability is read from the engine.
|
|
@@ -1726,7 +1594,7 @@ export class Quill {
|
|
|
1726
1594
|
* Land `doc`'s declared content fields at their canonical rest **in
|
|
1727
1595
|
* place**, returning the `conform::*` diagnostics for values that would not
|
|
1728
1596
|
* commit. The read-repair verb for a document that arrived through the
|
|
1729
|
-
* transport door (`fromMarkdown`, `
|
|
1597
|
+
* transport door (`fromMarkdown`, `fromStored`, a stored row).
|
|
1730
1598
|
*
|
|
1731
1599
|
* Idempotent: an equal value is not rewritten, so YAML comments and stored
|
|
1732
1600
|
* bytes survive. A `!must_fill` marker anywhere in a field's value skips
|
|
@@ -1775,9 +1643,9 @@ export class Quill {
|
|
|
1775
1643
|
}
|
|
1776
1644
|
}
|
|
1777
1645
|
/**
|
|
1778
|
-
* Identity snapshot of the `quill:` section of `Quill.yaml
|
|
1779
|
-
*
|
|
1780
|
-
*
|
|
1646
|
+
* Identity snapshot of the `quill:` section of `Quill.yaml`. Pure config:
|
|
1647
|
+
* output formats are a resolved-backend capability read from
|
|
1648
|
+
* `Quillmark.supportedFormats`, not part of this.
|
|
1781
1649
|
* @returns {QuillMetadata}
|
|
1782
1650
|
*/
|
|
1783
1651
|
get metadata() {
|
|
@@ -1826,31 +1694,6 @@ export class Quill {
|
|
|
1826
1694
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1827
1695
|
}
|
|
1828
1696
|
}
|
|
1829
|
-
/**
|
|
1830
|
-
* The resolved-value view of `doc`: for every declared field, the value the
|
|
1831
|
-
* render projection would use and the `FieldSource` rung it came from
|
|
1832
|
-
* (`"authored" | "default" | "blank"`). The card body is a `body` sibling on
|
|
1833
|
-
* its card, never a row in `fields`, and `null` when the kind enables no
|
|
1834
|
-
* body. Value and provenance only; completeness stays `validate`'s.
|
|
1835
|
-
* @param {Document} doc
|
|
1836
|
-
* @returns {Resolved}
|
|
1837
|
-
*/
|
|
1838
|
-
resolve(doc) {
|
|
1839
|
-
try {
|
|
1840
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1841
|
-
_assertClass(doc, Document);
|
|
1842
|
-
wasm.quill_resolve(retptr, this.__wbg_ptr, doc.__wbg_ptr);
|
|
1843
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1844
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1845
|
-
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1846
|
-
if (r2) {
|
|
1847
|
-
throw takeObject(r1);
|
|
1848
|
-
}
|
|
1849
|
-
return takeObject(r0);
|
|
1850
|
-
} finally {
|
|
1851
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1852
|
-
}
|
|
1853
|
-
}
|
|
1854
1697
|
/**
|
|
1855
1698
|
* Document schema for the quill: the user-fillable fields plus their `ui`
|
|
1856
1699
|
* hints. Key order in `fields`/`properties` is declaration order, the
|
|
@@ -1939,8 +1782,8 @@ export class Quill {
|
|
|
1939
1782
|
*
|
|
1940
1783
|
* This is how a quill crosses a WASM linear-memory boundary as data: a
|
|
1941
1784
|
* `Quill` built in one build cannot be passed to an engine in another, so
|
|
1942
|
-
* `@quillmark/wasm
|
|
1943
|
-
* `Quill.fromTree` on demand.
|
|
1785
|
+
* the `@quillmark/wasm` runtime layer re-feeds this tree to the backend
|
|
1786
|
+
* build's `Quill.fromTree` on demand.
|
|
1944
1787
|
* @returns {Map<string, Uint8Array>}
|
|
1945
1788
|
*/
|
|
1946
1789
|
toTree() {
|
|
@@ -1971,6 +1814,27 @@ export class Quill {
|
|
|
1971
1814
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1972
1815
|
}
|
|
1973
1816
|
}
|
|
1817
|
+
/**
|
|
1818
|
+
* The advisory diagnostics of the load that produced this quill: what is
|
|
1819
|
+
* wrong with it short of refusing it. A quill that loads clean answers
|
|
1820
|
+
* `[]`.
|
|
1821
|
+
* @returns {Diagnostic[]}
|
|
1822
|
+
*/
|
|
1823
|
+
get warnings() {
|
|
1824
|
+
try {
|
|
1825
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1826
|
+
wasm.quill_warnings(retptr, this.__wbg_ptr);
|
|
1827
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1828
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1829
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1830
|
+
if (r2) {
|
|
1831
|
+
throw takeObject(r1);
|
|
1832
|
+
}
|
|
1833
|
+
return takeObject(r0);
|
|
1834
|
+
} finally {
|
|
1835
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1836
|
+
}
|
|
1837
|
+
}
|
|
1974
1838
|
}
|
|
1975
1839
|
if (Symbol.dispose) Quill.prototype[Symbol.dispose] = Quill.prototype.free;
|
|
1976
1840
|
|
|
@@ -1991,7 +1855,7 @@ export class Quillmark {
|
|
|
1991
1855
|
}
|
|
1992
1856
|
constructor() {
|
|
1993
1857
|
const ret = wasm.quillmark_new();
|
|
1994
|
-
this.__wbg_ptr = ret
|
|
1858
|
+
this.__wbg_ptr = ret;
|
|
1995
1859
|
QuillmarkFinalization.register(this, this.__wbg_ptr, this);
|
|
1996
1860
|
return this;
|
|
1997
1861
|
}
|
|
@@ -2067,18 +1931,6 @@ export class Quillmark {
|
|
|
2067
1931
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2068
1932
|
}
|
|
2069
1933
|
}
|
|
2070
|
-
/**
|
|
2071
|
-
* Whether `quill`'s backend can paint sessions to a canvas; `false` when the
|
|
2072
|
-
* backend is unsupported. A cheap probe before mounting a preview UI. The
|
|
2073
|
-
* authoritative answer is the session's `supportsCanvas` getter.
|
|
2074
|
-
* @param {Quill} quill
|
|
2075
|
-
* @returns {boolean}
|
|
2076
|
-
*/
|
|
2077
|
-
supportsCanvas(quill) {
|
|
2078
|
-
_assertClass(quill, Quill);
|
|
2079
|
-
const ret = wasm.quillmark_supportsCanvas(this.__wbg_ptr, quill.__wbg_ptr);
|
|
2080
|
-
return ret !== 0;
|
|
2081
|
-
}
|
|
2082
1934
|
}
|
|
2083
1935
|
if (Symbol.dispose) Quillmark.prototype[Symbol.dispose] = Quillmark.prototype.free;
|
|
2084
1936
|
|
|
@@ -2297,11 +2149,11 @@ export function start() {
|
|
|
2297
2149
|
function __wbg_get_imports() {
|
|
2298
2150
|
const import0 = {
|
|
2299
2151
|
__proto__: null,
|
|
2300
|
-
|
|
2152
|
+
__wbg_Error_67e7344beaa85059: function(arg0, arg1) {
|
|
2301
2153
|
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
2302
2154
|
return addHeapObject(ret);
|
|
2303
2155
|
},
|
|
2304
|
-
|
|
2156
|
+
__wbg_Number_c54e7112a3fa7e3e: function(arg0) {
|
|
2305
2157
|
const ret = Number(getObject(arg0));
|
|
2306
2158
|
return ret;
|
|
2307
2159
|
},
|
|
@@ -2312,68 +2164,68 @@ function __wbg_get_imports() {
|
|
|
2312
2164
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
2313
2165
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
2314
2166
|
},
|
|
2315
|
-
|
|
2167
|
+
__wbg___wbindgen_bigint_get_as_i64_b482365c149396c8: function(arg0, arg1) {
|
|
2316
2168
|
const v = getObject(arg1);
|
|
2317
2169
|
const ret = typeof(v) === 'bigint' ? v : undefined;
|
|
2318
2170
|
getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
|
|
2319
2171
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
2320
2172
|
},
|
|
2321
|
-
|
|
2173
|
+
__wbg___wbindgen_boolean_get_7a12af2b3f899c5a: function(arg0) {
|
|
2322
2174
|
const v = getObject(arg0);
|
|
2323
2175
|
const ret = typeof(v) === 'boolean' ? v : undefined;
|
|
2324
2176
|
return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
|
|
2325
2177
|
},
|
|
2326
|
-
|
|
2178
|
+
__wbg___wbindgen_debug_string_0e68cf47c9cbd9b0: function(arg0, arg1) {
|
|
2327
2179
|
const ret = debugString(getObject(arg1));
|
|
2328
2180
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
2329
2181
|
const len1 = WASM_VECTOR_LEN;
|
|
2330
2182
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
2331
2183
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
2332
2184
|
},
|
|
2333
|
-
|
|
2185
|
+
__wbg___wbindgen_in_50072d4d6e45c193: function(arg0, arg1) {
|
|
2334
2186
|
const ret = getObject(arg0) in getObject(arg1);
|
|
2335
2187
|
return ret;
|
|
2336
2188
|
},
|
|
2337
|
-
|
|
2189
|
+
__wbg___wbindgen_is_bigint_60fc0336cb14f5d7: function(arg0) {
|
|
2338
2190
|
const ret = typeof(getObject(arg0)) === 'bigint';
|
|
2339
2191
|
return ret;
|
|
2340
2192
|
},
|
|
2341
|
-
|
|
2193
|
+
__wbg___wbindgen_is_function_fcda5e3902d732fe: function(arg0) {
|
|
2342
2194
|
const ret = typeof(getObject(arg0)) === 'function';
|
|
2343
2195
|
return ret;
|
|
2344
2196
|
},
|
|
2345
|
-
|
|
2197
|
+
__wbg___wbindgen_is_null_5160b3e381865372: function(arg0) {
|
|
2346
2198
|
const ret = getObject(arg0) === null;
|
|
2347
2199
|
return ret;
|
|
2348
2200
|
},
|
|
2349
|
-
|
|
2201
|
+
__wbg___wbindgen_is_object_edb6b15aa3afe12e: function(arg0) {
|
|
2350
2202
|
const val = getObject(arg0);
|
|
2351
2203
|
const ret = typeof(val) === 'object' && val !== null;
|
|
2352
2204
|
return ret;
|
|
2353
2205
|
},
|
|
2354
|
-
|
|
2206
|
+
__wbg___wbindgen_is_string_c4f7cb494a2a21f1: function(arg0) {
|
|
2355
2207
|
const ret = typeof(getObject(arg0)) === 'string';
|
|
2356
2208
|
return ret;
|
|
2357
2209
|
},
|
|
2358
|
-
|
|
2210
|
+
__wbg___wbindgen_is_undefined_8c687d0b90d5b524: function(arg0) {
|
|
2359
2211
|
const ret = getObject(arg0) === undefined;
|
|
2360
2212
|
return ret;
|
|
2361
2213
|
},
|
|
2362
|
-
|
|
2214
|
+
__wbg___wbindgen_jsval_eq_9fdcd3c0a860dd3b: function(arg0, arg1) {
|
|
2363
2215
|
const ret = getObject(arg0) === getObject(arg1);
|
|
2364
2216
|
return ret;
|
|
2365
2217
|
},
|
|
2366
|
-
|
|
2218
|
+
__wbg___wbindgen_jsval_loose_eq_3c30021c243b64cd: function(arg0, arg1) {
|
|
2367
2219
|
const ret = getObject(arg0) == getObject(arg1);
|
|
2368
2220
|
return ret;
|
|
2369
2221
|
},
|
|
2370
|
-
|
|
2222
|
+
__wbg___wbindgen_number_get_1dc732b810cb937c: function(arg0, arg1) {
|
|
2371
2223
|
const obj = getObject(arg1);
|
|
2372
2224
|
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
2373
2225
|
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
2374
2226
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
2375
2227
|
},
|
|
2376
|
-
|
|
2228
|
+
__wbg___wbindgen_string_get_92ab86bb19cbc12f: function(arg0, arg1) {
|
|
2377
2229
|
const obj = getObject(arg1);
|
|
2378
2230
|
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
2379
2231
|
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
@@ -2381,34 +2233,34 @@ function __wbg_get_imports() {
|
|
|
2381
2233
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
2382
2234
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
2383
2235
|
},
|
|
2384
|
-
|
|
2236
|
+
__wbg___wbindgen_throw_5d9e815e6fdf150f: function(arg0, arg1) {
|
|
2385
2237
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
2386
2238
|
},
|
|
2387
|
-
|
|
2239
|
+
__wbg_call_269c5566fbede3eb: function() { return handleError(function (arg0, arg1) {
|
|
2388
2240
|
const ret = getObject(arg0).call(getObject(arg1));
|
|
2389
2241
|
return addHeapObject(ret);
|
|
2390
2242
|
}, arguments); },
|
|
2391
|
-
|
|
2243
|
+
__wbg_canvas_128715f4edb228ef: function(arg0) {
|
|
2392
2244
|
const ret = getObject(arg0).canvas;
|
|
2393
|
-
return
|
|
2245
|
+
return addHeapObject(ret);
|
|
2394
2246
|
},
|
|
2395
|
-
|
|
2247
|
+
__wbg_canvas_9c3188d85ded70f9: function(arg0) {
|
|
2396
2248
|
const ret = getObject(arg0).canvas;
|
|
2397
|
-
return addHeapObject(ret);
|
|
2249
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
2398
2250
|
},
|
|
2399
|
-
|
|
2251
|
+
__wbg_done_cffed884d87aa22e: function(arg0) {
|
|
2400
2252
|
const ret = getObject(arg0).done;
|
|
2401
2253
|
return ret;
|
|
2402
2254
|
},
|
|
2403
|
-
|
|
2255
|
+
__wbg_entries_20b9608d57d8ddd6: function(arg0) {
|
|
2404
2256
|
const ret = getObject(arg0).entries();
|
|
2405
2257
|
return addHeapObject(ret);
|
|
2406
2258
|
},
|
|
2407
|
-
|
|
2259
|
+
__wbg_entries_972a87586902cf87: function(arg0) {
|
|
2408
2260
|
const ret = Object.entries(getObject(arg0));
|
|
2409
2261
|
return addHeapObject(ret);
|
|
2410
2262
|
},
|
|
2411
|
-
|
|
2263
|
+
__wbg_error_757e9472f8410341: function(arg0, arg1) {
|
|
2412
2264
|
let deferred0_0;
|
|
2413
2265
|
let deferred0_1;
|
|
2414
2266
|
try {
|
|
@@ -2419,19 +2271,35 @@ function __wbg_get_imports() {
|
|
|
2419
2271
|
wasm.__wbindgen_export4(deferred0_0, deferred0_1, 1);
|
|
2420
2272
|
}
|
|
2421
2273
|
},
|
|
2422
|
-
|
|
2274
|
+
__wbg_from_a39669ce566077da: function(arg0) {
|
|
2423
2275
|
const ret = Array.from(getObject(arg0));
|
|
2424
2276
|
return addHeapObject(ret);
|
|
2425
2277
|
},
|
|
2426
|
-
|
|
2278
|
+
__wbg_getTime_65922ba0b59d55a7: function(arg0) {
|
|
2279
|
+
const ret = getObject(arg0).getTime();
|
|
2280
|
+
return ret;
|
|
2281
|
+
},
|
|
2282
|
+
__wbg_getUTCDate_b061d7dd93ea65ec: function(arg0) {
|
|
2283
|
+
const ret = getObject(arg0).getUTCDate();
|
|
2284
|
+
return ret;
|
|
2285
|
+
},
|
|
2286
|
+
__wbg_getUTCFullYear_4f3d4172a60a56ec: function(arg0) {
|
|
2287
|
+
const ret = getObject(arg0).getUTCFullYear();
|
|
2288
|
+
return ret;
|
|
2289
|
+
},
|
|
2290
|
+
__wbg_getUTCMonth_0c3985a29f63aeb1: function(arg0) {
|
|
2291
|
+
const ret = getObject(arg0).getUTCMonth();
|
|
2292
|
+
return ret;
|
|
2293
|
+
},
|
|
2294
|
+
__wbg_get_6cf5a4d4d8ad3c5a: function() { return handleError(function (arg0, arg1) {
|
|
2427
2295
|
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
2428
2296
|
return addHeapObject(ret);
|
|
2429
2297
|
}, arguments); },
|
|
2430
|
-
|
|
2298
|
+
__wbg_get_b1f0ab13c737f856: function(arg0, arg1) {
|
|
2431
2299
|
const ret = getObject(arg0)[arg1 >>> 0];
|
|
2432
2300
|
return addHeapObject(ret);
|
|
2433
2301
|
},
|
|
2434
|
-
|
|
2302
|
+
__wbg_get_unchecked_363572bdd397d473: function(arg0, arg1) {
|
|
2435
2303
|
const ret = getObject(arg0)[arg1 >>> 0];
|
|
2436
2304
|
return addHeapObject(ret);
|
|
2437
2305
|
},
|
|
@@ -2439,7 +2307,7 @@ function __wbg_get_imports() {
|
|
|
2439
2307
|
const ret = getObject(arg0)[getObject(arg1)];
|
|
2440
2308
|
return addHeapObject(ret);
|
|
2441
2309
|
},
|
|
2442
|
-
|
|
2310
|
+
__wbg_instanceof_ArrayBuffer_d4ff01f8247925ae: function(arg0) {
|
|
2443
2311
|
let result;
|
|
2444
2312
|
try {
|
|
2445
2313
|
result = getObject(arg0) instanceof ArrayBuffer;
|
|
@@ -2449,7 +2317,7 @@ function __wbg_get_imports() {
|
|
|
2449
2317
|
const ret = result;
|
|
2450
2318
|
return ret;
|
|
2451
2319
|
},
|
|
2452
|
-
|
|
2320
|
+
__wbg_instanceof_CanvasRenderingContext2d_bde5245b14027f3f: function(arg0) {
|
|
2453
2321
|
let result;
|
|
2454
2322
|
try {
|
|
2455
2323
|
result = getObject(arg0) instanceof CanvasRenderingContext2D;
|
|
@@ -2459,7 +2327,7 @@ function __wbg_get_imports() {
|
|
|
2459
2327
|
const ret = result;
|
|
2460
2328
|
return ret;
|
|
2461
2329
|
},
|
|
2462
|
-
|
|
2330
|
+
__wbg_instanceof_Map_1ff6a2b54c899f0d: function(arg0) {
|
|
2463
2331
|
let result;
|
|
2464
2332
|
try {
|
|
2465
2333
|
result = getObject(arg0) instanceof Map;
|
|
@@ -2469,7 +2337,7 @@ function __wbg_get_imports() {
|
|
|
2469
2337
|
const ret = result;
|
|
2470
2338
|
return ret;
|
|
2471
2339
|
},
|
|
2472
|
-
|
|
2340
|
+
__wbg_instanceof_Object_87732cb922ac2e2c: function(arg0) {
|
|
2473
2341
|
let result;
|
|
2474
2342
|
try {
|
|
2475
2343
|
result = getObject(arg0) instanceof Object;
|
|
@@ -2479,7 +2347,7 @@ function __wbg_get_imports() {
|
|
|
2479
2347
|
const ret = result;
|
|
2480
2348
|
return ret;
|
|
2481
2349
|
},
|
|
2482
|
-
|
|
2350
|
+
__wbg_instanceof_OffscreenCanvasRenderingContext2d_4b64493c5055d621: function(arg0) {
|
|
2483
2351
|
let result;
|
|
2484
2352
|
try {
|
|
2485
2353
|
result = getObject(arg0) instanceof OffscreenCanvasRenderingContext2D;
|
|
@@ -2489,7 +2357,7 @@ function __wbg_get_imports() {
|
|
|
2489
2357
|
const ret = result;
|
|
2490
2358
|
return ret;
|
|
2491
2359
|
},
|
|
2492
|
-
|
|
2360
|
+
__wbg_instanceof_Uint8Array_598adc0fef426aa8: function(arg0) {
|
|
2493
2361
|
let result;
|
|
2494
2362
|
try {
|
|
2495
2363
|
result = getObject(arg0) instanceof Uint8Array;
|
|
@@ -2499,31 +2367,39 @@ function __wbg_get_imports() {
|
|
|
2499
2367
|
const ret = result;
|
|
2500
2368
|
return ret;
|
|
2501
2369
|
},
|
|
2502
|
-
|
|
2370
|
+
__wbg_isArray_5674713bb7b79043: function(arg0) {
|
|
2503
2371
|
const ret = Array.isArray(getObject(arg0));
|
|
2504
2372
|
return ret;
|
|
2505
2373
|
},
|
|
2506
|
-
|
|
2374
|
+
__wbg_isSafeInteger_8f51c743827d1ec5: function(arg0) {
|
|
2507
2375
|
const ret = Number.isSafeInteger(getObject(arg0));
|
|
2508
2376
|
return ret;
|
|
2509
2377
|
},
|
|
2510
|
-
|
|
2378
|
+
__wbg_iterator_22ddeb808cf55a6f: function() {
|
|
2511
2379
|
const ret = Symbol.iterator;
|
|
2512
2380
|
return addHeapObject(ret);
|
|
2513
2381
|
},
|
|
2514
|
-
|
|
2382
|
+
__wbg_keys_6efc298980178da1: function(arg0) {
|
|
2515
2383
|
const ret = Object.keys(getObject(arg0));
|
|
2516
2384
|
return addHeapObject(ret);
|
|
2517
2385
|
},
|
|
2518
|
-
|
|
2386
|
+
__wbg_length_31bdaf014f5fbde2: function(arg0) {
|
|
2519
2387
|
const ret = getObject(arg0).length;
|
|
2520
2388
|
return ret;
|
|
2521
2389
|
},
|
|
2522
|
-
|
|
2390
|
+
__wbg_length_4e1adc0d42e23620: function(arg0) {
|
|
2523
2391
|
const ret = getObject(arg0).length;
|
|
2524
2392
|
return ret;
|
|
2525
2393
|
},
|
|
2526
|
-
|
|
2394
|
+
__wbg_new_0_35540e542ba689d2: function() {
|
|
2395
|
+
const ret = new Date();
|
|
2396
|
+
return addHeapObject(ret);
|
|
2397
|
+
},
|
|
2398
|
+
__wbg_new_180f1022bb6ee517: function(arg0) {
|
|
2399
|
+
const ret = new Date(getObject(arg0));
|
|
2400
|
+
return addHeapObject(ret);
|
|
2401
|
+
},
|
|
2402
|
+
__wbg_new_1da3429bc3c4541c: function(arg0) {
|
|
2527
2403
|
const ret = new Uint8Array(getObject(arg0));
|
|
2528
2404
|
return addHeapObject(ret);
|
|
2529
2405
|
},
|
|
@@ -2531,75 +2407,71 @@ function __wbg_get_imports() {
|
|
|
2531
2407
|
const ret = new Error();
|
|
2532
2408
|
return addHeapObject(ret);
|
|
2533
2409
|
},
|
|
2534
|
-
|
|
2410
|
+
__wbg_new_8d36e20aa758e411: function() {
|
|
2535
2411
|
const ret = new Map();
|
|
2536
2412
|
return addHeapObject(ret);
|
|
2537
2413
|
},
|
|
2538
|
-
|
|
2414
|
+
__wbg_new_a32a1ab6c6655abe: function(arg0, arg1) {
|
|
2539
2415
|
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
2540
2416
|
return addHeapObject(ret);
|
|
2541
2417
|
},
|
|
2542
|
-
|
|
2543
|
-
const ret = new
|
|
2418
|
+
__wbg_new_bebc3f4757acf305: function() {
|
|
2419
|
+
const ret = new Object();
|
|
2544
2420
|
return addHeapObject(ret);
|
|
2545
2421
|
},
|
|
2546
|
-
|
|
2547
|
-
const ret = new
|
|
2422
|
+
__wbg_new_ffa92086ea89f79c: function() {
|
|
2423
|
+
const ret = new Array();
|
|
2548
2424
|
return addHeapObject(ret);
|
|
2549
2425
|
},
|
|
2550
|
-
|
|
2426
|
+
__wbg_new_from_slice_4ee02165f9de919e: function(arg0, arg1) {
|
|
2551
2427
|
const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
|
|
2552
2428
|
return addHeapObject(ret);
|
|
2553
2429
|
},
|
|
2554
|
-
|
|
2430
|
+
__wbg_new_with_u8_clamped_array_and_sh_15a008af56aca047: function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
2555
2431
|
const ret = new ImageData(getClampedArrayU8FromWasm0(arg0, arg1), arg2 >>> 0, arg3 >>> 0);
|
|
2556
2432
|
return addHeapObject(ret);
|
|
2557
2433
|
}, arguments); },
|
|
2558
|
-
|
|
2559
|
-
const ret = getObject(arg0).next();
|
|
2560
|
-
return addHeapObject(ret);
|
|
2561
|
-
}, arguments); },
|
|
2562
|
-
__wbg_next_7646edaa39458ef7: function(arg0) {
|
|
2434
|
+
__wbg_next_95053e306b1c3aed: function(arg0) {
|
|
2563
2435
|
const ret = getObject(arg0).next;
|
|
2564
2436
|
return addHeapObject(ret);
|
|
2565
2437
|
},
|
|
2566
|
-
|
|
2567
|
-
const ret =
|
|
2568
|
-
return ret;
|
|
2569
|
-
},
|
|
2570
|
-
|
|
2438
|
+
__wbg_next_f31ecb8646d2c605: function() { return handleError(function (arg0) {
|
|
2439
|
+
const ret = getObject(arg0).next();
|
|
2440
|
+
return addHeapObject(ret);
|
|
2441
|
+
}, arguments); },
|
|
2442
|
+
__wbg_prototypesetcall_ae9f5e7459250748: function(arg0, arg1, arg2) {
|
|
2571
2443
|
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), getObject(arg2));
|
|
2572
2444
|
},
|
|
2573
|
-
|
|
2445
|
+
__wbg_putImageData_080efc8615f29b4e: function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
2574
2446
|
getObject(arg0).putImageData(getObject(arg1), arg2, arg3);
|
|
2575
2447
|
}, arguments); },
|
|
2576
|
-
|
|
2448
|
+
__wbg_putImageData_581de52c9f40fc59: function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
2577
2449
|
getObject(arg0).putImageData(getObject(arg1), arg2, arg3);
|
|
2578
2450
|
}, arguments); },
|
|
2579
|
-
|
|
2580
|
-
const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
|
|
2581
|
-
return ret;
|
|
2582
|
-
}, arguments); },
|
|
2583
|
-
__wbg_set_3bf1de9fab0cd644: function(arg0, arg1, arg2) {
|
|
2451
|
+
__wbg_set_13d25b81ab403f5e: function(arg0, arg1, arg2) {
|
|
2584
2452
|
getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
|
|
2585
2453
|
},
|
|
2586
2454
|
__wbg_set_6be42768c690e380: function(arg0, arg1, arg2) {
|
|
2587
2455
|
getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
|
|
2588
2456
|
},
|
|
2589
|
-
|
|
2457
|
+
__wbg_set_a377297433dfea63: function() { return handleError(function (arg0, arg1, arg2) {
|
|
2458
|
+
const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
|
|
2459
|
+
return ret;
|
|
2460
|
+
}, arguments); },
|
|
2461
|
+
__wbg_set_bf6dde4923b9b059: function(arg0, arg1, arg2) {
|
|
2590
2462
|
const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
|
|
2591
2463
|
return addHeapObject(ret);
|
|
2592
2464
|
},
|
|
2593
|
-
|
|
2465
|
+
__wbg_set_height_1202ad0eab43cbe0: function(arg0, arg1) {
|
|
2594
2466
|
getObject(arg0).height = arg1 >>> 0;
|
|
2595
2467
|
},
|
|
2596
|
-
|
|
2468
|
+
__wbg_set_height_698fb3b255bc1348: function(arg0, arg1) {
|
|
2597
2469
|
getObject(arg0).height = arg1 >>> 0;
|
|
2598
2470
|
},
|
|
2599
|
-
|
|
2471
|
+
__wbg_set_width_4c3a2252e0dea033: function(arg0, arg1) {
|
|
2600
2472
|
getObject(arg0).width = arg1 >>> 0;
|
|
2601
2473
|
},
|
|
2602
|
-
|
|
2474
|
+
__wbg_set_width_f52a20e39808b138: function(arg0, arg1) {
|
|
2603
2475
|
getObject(arg0).width = arg1 >>> 0;
|
|
2604
2476
|
},
|
|
2605
2477
|
__wbg_stack_3b0d974bbf31e44f: function(arg0, arg1) {
|
|
@@ -2609,39 +2481,39 @@ function __wbg_get_imports() {
|
|
|
2609
2481
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
2610
2482
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
2611
2483
|
},
|
|
2612
|
-
|
|
2484
|
+
__wbg_value_c227f843d21da141: function(arg0) {
|
|
2613
2485
|
const ret = getObject(arg0).value;
|
|
2614
2486
|
return addHeapObject(ret);
|
|
2615
2487
|
},
|
|
2616
|
-
|
|
2617
|
-
const ret = getObject(arg0)
|
|
2488
|
+
__wbg_values_220548effc36d1d3: function(arg0) {
|
|
2489
|
+
const ret = Object.values(getObject(arg0));
|
|
2618
2490
|
return addHeapObject(ret);
|
|
2619
2491
|
},
|
|
2620
|
-
|
|
2621
|
-
const ret =
|
|
2492
|
+
__wbg_values_85d5bcf6f1ca8248: function(arg0) {
|
|
2493
|
+
const ret = getObject(arg0).values();
|
|
2622
2494
|
return addHeapObject(ret);
|
|
2623
2495
|
},
|
|
2624
|
-
|
|
2496
|
+
__wbindgen_generic_0000000000000001: function(arg0) {
|
|
2625
2497
|
// Cast intrinsic for `F64 -> Externref`.
|
|
2626
2498
|
const ret = arg0;
|
|
2627
2499
|
return addHeapObject(ret);
|
|
2628
2500
|
},
|
|
2629
|
-
|
|
2501
|
+
__wbindgen_generic_0000000000000002: function(arg0) {
|
|
2630
2502
|
// Cast intrinsic for `I64 -> Externref`.
|
|
2631
2503
|
const ret = arg0;
|
|
2632
2504
|
return addHeapObject(ret);
|
|
2633
2505
|
},
|
|
2634
|
-
|
|
2506
|
+
__wbindgen_generic_0000000000000003: function(arg0, arg1) {
|
|
2635
2507
|
// Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`.
|
|
2636
2508
|
const ret = getArrayU8FromWasm0(arg0, arg1);
|
|
2637
2509
|
return addHeapObject(ret);
|
|
2638
2510
|
},
|
|
2639
|
-
|
|
2511
|
+
__wbindgen_generic_0000000000000004: function(arg0, arg1) {
|
|
2640
2512
|
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
2641
2513
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
2642
2514
|
return addHeapObject(ret);
|
|
2643
2515
|
},
|
|
2644
|
-
|
|
2516
|
+
__wbindgen_generic_0000000000000005: function(arg0) {
|
|
2645
2517
|
// Cast intrinsic for `U64 -> Externref`.
|
|
2646
2518
|
const ret = BigInt.asUintN(64, arg0);
|
|
2647
2519
|
return addHeapObject(ret);
|
|
@@ -2662,16 +2534,16 @@ function __wbg_get_imports() {
|
|
|
2662
2534
|
|
|
2663
2535
|
const DocumentFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
2664
2536
|
? { register: () => {}, unregister: () => {} }
|
|
2665
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_document_free(ptr
|
|
2537
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_document_free(ptr, 1));
|
|
2666
2538
|
const LiveSessionFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
2667
2539
|
? { register: () => {}, unregister: () => {} }
|
|
2668
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_livesession_free(ptr
|
|
2540
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_livesession_free(ptr, 1));
|
|
2669
2541
|
const QuillFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
2670
2542
|
? { register: () => {}, unregister: () => {} }
|
|
2671
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_quill_free(ptr
|
|
2543
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_quill_free(ptr, 1));
|
|
2672
2544
|
const QuillmarkFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
2673
2545
|
? { register: () => {}, unregister: () => {} }
|
|
2674
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_quillmark_free(ptr
|
|
2546
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_quillmark_free(ptr, 1));
|
|
2675
2547
|
|
|
2676
2548
|
function addHeapObject(obj) {
|
|
2677
2549
|
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
@@ -2778,8 +2650,7 @@ function getDataViewMemory0() {
|
|
|
2778
2650
|
}
|
|
2779
2651
|
|
|
2780
2652
|
function getStringFromWasm0(ptr, len) {
|
|
2781
|
-
|
|
2782
|
-
return decodeText(ptr, len);
|
|
2653
|
+
return decodeText(ptr >>> 0, len);
|
|
2783
2654
|
}
|
|
2784
2655
|
|
|
2785
2656
|
let cachedUint8ArrayMemory0 = null;
|
|
@@ -2889,8 +2760,9 @@ if (!('encodeInto' in cachedTextEncoder)) {
|
|
|
2889
2760
|
|
|
2890
2761
|
let WASM_VECTOR_LEN = 0;
|
|
2891
2762
|
|
|
2892
|
-
let wasmModule, wasm;
|
|
2763
|
+
let wasmModule, wasmInstance, wasm;
|
|
2893
2764
|
function __wbg_finalize_init(instance, module) {
|
|
2765
|
+
wasmInstance = instance;
|
|
2894
2766
|
wasm = instance.exports;
|
|
2895
2767
|
wasmModule = module;
|
|
2896
2768
|
cachedDataViewMemory0 = null;
|
|
@@ -2902,11 +2774,15 @@ function __wbg_finalize_init(instance, module) {
|
|
|
2902
2774
|
|
|
2903
2775
|
async function __wbg_load(module, imports) {
|
|
2904
2776
|
if (typeof Response === 'function' && module instanceof Response) {
|
|
2777
|
+
if (!module.ok) {
|
|
2778
|
+
throw new Error(`failed to fetch Wasm: ${module.status} ${module.statusText} fetching '${module.url}'`);
|
|
2779
|
+
}
|
|
2780
|
+
|
|
2905
2781
|
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
2906
2782
|
try {
|
|
2907
2783
|
return await WebAssembly.instantiateStreaming(module, imports);
|
|
2908
2784
|
} catch (e) {
|
|
2909
|
-
const validResponse =
|
|
2785
|
+
const validResponse = expectedResponseType(module.type);
|
|
2910
2786
|
|
|
2911
2787
|
if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
|
|
2912
2788
|
console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
|