@quillmark/wasm 0.114.0 → 0.116.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +377 -0
- package/README.md +50 -49
- package/core/wasm.d.ts +93 -118
- package/core/wasm.js +114 -102
- package/core/wasm_bg.wasm +0 -0
- package/core/wasm_bg.wasm.d.ts +5 -5
- package/package.json +1 -1
- package/render/wasm.d.ts +119 -185
- package/render/wasm.js +138 -144
- package/render/wasm_bg.wasm +0 -0
- package/render/wasm_bg.wasm.d.ts +7 -7
- package/runtime/runtime.d.ts +52 -66
- package/runtime/runtime.js +25 -13
package/render/wasm.js
CHANGED
|
@@ -294,30 +294,6 @@ export class Document {
|
|
|
294
294
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
295
295
|
}
|
|
296
296
|
}
|
|
297
|
-
/**
|
|
298
|
-
* A blueprint's fill obligation for the given `quillName`, re-exposed from
|
|
299
|
-
* core. Carries no tool name: pair it with your own next-step directive.
|
|
300
|
-
* @param {string} quill_name
|
|
301
|
-
* @returns {string}
|
|
302
|
-
*/
|
|
303
|
-
static blueprintInstruction(quill_name) {
|
|
304
|
-
let deferred2_0;
|
|
305
|
-
let deferred2_1;
|
|
306
|
-
try {
|
|
307
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
308
|
-
const ptr0 = passStringToWasm0(quill_name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
309
|
-
const len0 = WASM_VECTOR_LEN;
|
|
310
|
-
wasm.document_blueprintInstruction(retptr, ptr0, len0);
|
|
311
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
312
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
313
|
-
deferred2_0 = r0;
|
|
314
|
-
deferred2_1 = r1;
|
|
315
|
-
return getStringFromWasm0(r0, r1);
|
|
316
|
-
} finally {
|
|
317
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
318
|
-
wasm.__wbindgen_export4(deferred2_0, deferred2_1, 1);
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
297
|
/**
|
|
322
298
|
* The **body** markdown projection: an on-demand, lossy export (content-only
|
|
323
299
|
* marks do not survive markdown). A body's type is a format fact, not a
|
|
@@ -454,27 +430,6 @@ export class Document {
|
|
|
454
430
|
const ret = wasm.document_equals(this.__wbg_ptr, other.__wbg_ptr);
|
|
455
431
|
return ret !== 0;
|
|
456
432
|
}
|
|
457
|
-
/**
|
|
458
|
-
* Authoring-format rules for the card-yaml markdown surface, re-exposed from
|
|
459
|
-
* core. Constant across calls; read once and cache.
|
|
460
|
-
* @returns {string}
|
|
461
|
-
*/
|
|
462
|
-
static formatRules() {
|
|
463
|
-
let deferred1_0;
|
|
464
|
-
let deferred1_1;
|
|
465
|
-
try {
|
|
466
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
467
|
-
wasm.document_formatRules(retptr);
|
|
468
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
469
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
470
|
-
deferred1_0 = r0;
|
|
471
|
-
deferred1_1 = r1;
|
|
472
|
-
return getStringFromWasm0(r0, r1);
|
|
473
|
-
} finally {
|
|
474
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
475
|
-
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
476
|
-
}
|
|
477
|
-
}
|
|
478
433
|
/**
|
|
479
434
|
* Parse markdown into a typed Document. Throws on parse errors.
|
|
480
435
|
* @param {string} markdown
|
|
@@ -602,28 +557,6 @@ export class Document {
|
|
|
602
557
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
603
558
|
}
|
|
604
559
|
}
|
|
605
|
-
/**
|
|
606
|
-
* Whether the field at `addr` is marked `!must_fill`. A bare string is `Addr`
|
|
607
|
-
* shorthand for `{ field }`. `false` for an absent field and for a body
|
|
608
|
-
* address; only an out-of-range `addr.card` throws.
|
|
609
|
-
* @param {Addr | string} addr
|
|
610
|
-
* @returns {boolean}
|
|
611
|
-
*/
|
|
612
|
-
isFill(addr) {
|
|
613
|
-
try {
|
|
614
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
615
|
-
wasm.document_isFill(retptr, this.__wbg_ptr, addHeapObject(addr));
|
|
616
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
617
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
618
|
-
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
619
|
-
if (r2) {
|
|
620
|
-
throw takeObject(r1);
|
|
621
|
-
}
|
|
622
|
-
return r0 !== 0;
|
|
623
|
-
} finally {
|
|
624
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
625
|
-
}
|
|
626
|
-
}
|
|
627
560
|
/**
|
|
628
561
|
* Replace this document's contents **in place** from a versioned storage DTO
|
|
629
562
|
* string: the mutating twin of [`fromStored`](Document::from_stored).
|
|
@@ -666,6 +599,27 @@ export class Document {
|
|
|
666
599
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
667
600
|
}
|
|
668
601
|
}
|
|
602
|
+
/**
|
|
603
|
+
* The Quillmark Markdown rules, re-exposed from core. Constant across
|
|
604
|
+
* calls; read once and cache.
|
|
605
|
+
* @returns {string}
|
|
606
|
+
*/
|
|
607
|
+
static markdownRules() {
|
|
608
|
+
let deferred1_0;
|
|
609
|
+
let deferred1_1;
|
|
610
|
+
try {
|
|
611
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
612
|
+
wasm.document_markdownRules(retptr);
|
|
613
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
614
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
615
|
+
deferred1_0 = r0;
|
|
616
|
+
deferred1_1 = r1;
|
|
617
|
+
return getStringFromWasm0(r0, r1);
|
|
618
|
+
} finally {
|
|
619
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
620
|
+
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
621
|
+
}
|
|
622
|
+
}
|
|
669
623
|
/**
|
|
670
624
|
* Move the card at `from` to position `to`. `from == to` is a no-op.
|
|
671
625
|
* @param {number} from
|
|
@@ -688,8 +642,8 @@ export class Document {
|
|
|
688
642
|
* A blank document: a main card carrying only `$quill`, an empty body, and
|
|
689
643
|
* no composable cards. Absent fields resolve at render time (`default`, else
|
|
690
644
|
* the field's blank), so nothing the caller did not set reaches the output.
|
|
691
|
-
* For
|
|
692
|
-
* invalid quill reference.
|
|
645
|
+
* For one instance of every card kind use `Quill.seedDocument()`. Throws on
|
|
646
|
+
* an invalid quill reference.
|
|
693
647
|
* @param {string} quill_ref
|
|
694
648
|
*/
|
|
695
649
|
constructor(quill_ref) {
|
|
@@ -1032,7 +986,7 @@ export class Document {
|
|
|
1032
986
|
* Store a field verbatim at `addr`, deferring coercion to render; the typed
|
|
1033
987
|
* write is [`commitField`](Document::commit_field). A bare string is `Addr`
|
|
1034
988
|
* shorthand for `{ field }`; `{ card: 2, field: "qty" }` targets a
|
|
1035
|
-
* composable card.
|
|
989
|
+
* composable card. A body address throws:
|
|
1036
990
|
* write a body with `revise` / `overwrite`. Throws on an out-of-range card
|
|
1037
991
|
* or a malformed name.
|
|
1038
992
|
* @param {Addr | string} addr
|
|
@@ -1073,25 +1027,6 @@ export class Document {
|
|
|
1073
1027
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1074
1028
|
}
|
|
1075
1029
|
}
|
|
1076
|
-
/**
|
|
1077
|
-
* Store a field verbatim at `addr` and mark it `!must_fill`. A body address
|
|
1078
|
-
* throws; same validation as [`storeField`](Document::store_field).
|
|
1079
|
-
* @param {Addr | string} addr
|
|
1080
|
-
* @param {any} value
|
|
1081
|
-
*/
|
|
1082
|
-
storeFill(addr, value) {
|
|
1083
|
-
try {
|
|
1084
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1085
|
-
wasm.document_storeFill(retptr, this.__wbg_ptr, addHeapObject(addr), addHeapObject(value));
|
|
1086
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1087
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1088
|
-
if (r1) {
|
|
1089
|
-
throw takeObject(r0);
|
|
1090
|
-
}
|
|
1091
|
-
} finally {
|
|
1092
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1093
|
-
}
|
|
1094
|
-
}
|
|
1095
1030
|
/**
|
|
1096
1031
|
* Merge a card-kind's seed `overlay` into the **main** card's `$seed` map
|
|
1097
1032
|
* under `cardKind`, preserving sibling kinds; `$seed` is main-only, so this
|
|
@@ -1235,15 +1170,17 @@ export class LiveSession {
|
|
|
1235
1170
|
* The schema field whose content is under a point on `page`: the `DocPath`
|
|
1236
1171
|
* address to focus in the editor, or `undefined` off any field's ink.
|
|
1237
1172
|
* `x`/`y` are PDF points with a **bottom-left** origin, the same space as
|
|
1238
|
-
* `FieldRegion.rect
|
|
1239
|
-
*
|
|
1173
|
+
* `FieldRegion.rect`. A pointer event reports CSS pixels, so divide by the
|
|
1174
|
+
* CSS px per point the page is shown at, `k = canvas.clientWidth /
|
|
1175
|
+
* pageWidthPt`, not by `paint`'s `scale`, which carries `devicePixelRatio`:
|
|
1176
|
+
* `x = e.offsetX / k`, `y = pageHeightPt - e.offsetY / k`.
|
|
1240
1177
|
* Unlike `regions()`, *every* placement answers, not just the first.
|
|
1241
1178
|
*
|
|
1242
1179
|
* `tolPt` is how far off the ink a click still counts, in the same points,
|
|
1243
1180
|
* and defaults to `0` — exact. Convert the pointer slack a surface wants
|
|
1244
|
-
* from CSS pixels
|
|
1245
|
-
*
|
|
1246
|
-
*
|
|
1181
|
+
* from CSS pixels by the same `k` (`slackPx / k`), so it stays the same
|
|
1182
|
+
* size under the cursor as the page zooms. The nearest placement answers,
|
|
1183
|
+
* so raising it only fills a miss.
|
|
1247
1184
|
* @param {number} page
|
|
1248
1185
|
* @param {number} x
|
|
1249
1186
|
* @param {number} y
|
|
@@ -1348,35 +1285,31 @@ export class LiveSession {
|
|
|
1348
1285
|
}
|
|
1349
1286
|
/**
|
|
1350
1287
|
* Paint `page` into a `CanvasRenderingContext2D` or
|
|
1351
|
-
* `OffscreenCanvasRenderingContext2D
|
|
1352
|
-
*
|
|
1353
|
-
* `
|
|
1354
|
-
*
|
|
1288
|
+
* `OffscreenCanvasRenderingContext2D` at `scale` backing-store pixels per
|
|
1289
|
+
* point, reduced where it must be to keep both sides within
|
|
1290
|
+
* `MAX_RASTER_SIDE` (16384 px). The painter owns `canvas.width`/`height`;
|
|
1291
|
+
* consumers own `canvas.style.*`.
|
|
1355
1292
|
*
|
|
1356
1293
|
* `put_image_data` writes the whole backing store, bypassing the 2D
|
|
1357
1294
|
* context's transform, `globalAlpha`, and clip, so each visible page needs
|
|
1358
1295
|
* its own `<canvas>`: no compositing, sub-rect, or transform reaches through
|
|
1359
1296
|
* this call.
|
|
1360
1297
|
*
|
|
1361
|
-
* Throws if `page` is out of range, `ctx` is the wrong type,
|
|
1362
|
-
*
|
|
1363
|
-
* scale (`backend::invalid_raster_scale`).
|
|
1298
|
+
* Throws if `page` is out of range, `ctx` is the wrong type, or `scale` is
|
|
1299
|
+
* not finite and positive (`backend::invalid_raster_scale`).
|
|
1364
1300
|
* @param {CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D} ctx
|
|
1365
1301
|
* @param {number} page
|
|
1366
|
-
* @param {
|
|
1367
|
-
* @returns {PaintResult}
|
|
1302
|
+
* @param {number} scale
|
|
1368
1303
|
*/
|
|
1369
|
-
paint(ctx, page,
|
|
1304
|
+
paint(ctx, page, scale) {
|
|
1370
1305
|
try {
|
|
1371
1306
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1372
|
-
wasm.livesession_paint(retptr, this.__wbg_ptr, addHeapObject(ctx), page,
|
|
1307
|
+
wasm.livesession_paint(retptr, this.__wbg_ptr, addHeapObject(ctx), page, scale);
|
|
1373
1308
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1374
1309
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
throw takeObject(r1);
|
|
1310
|
+
if (r1) {
|
|
1311
|
+
throw takeObject(r0);
|
|
1378
1312
|
}
|
|
1379
|
-
return takeObject(r0);
|
|
1380
1313
|
} finally {
|
|
1381
1314
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1382
1315
|
}
|
|
@@ -1530,15 +1463,18 @@ export class Quill {
|
|
|
1530
1463
|
* `FieldSource` rung it came from (`"authored" | "default" | "blank"`). The
|
|
1531
1464
|
* card body is a `body` sibling on its card, never a row in `fields`, and
|
|
1532
1465
|
* `null` when the kind enables no body. Value and provenance only;
|
|
1533
|
-
*
|
|
1466
|
+
* diagnostics stay `validate`'s. `today` reads as on `Quillmark.open`.
|
|
1534
1467
|
* @param {Document} doc
|
|
1468
|
+
* @param {string | null} [today]
|
|
1535
1469
|
* @returns {Resolved}
|
|
1536
1470
|
*/
|
|
1537
|
-
_resolve(doc) {
|
|
1471
|
+
_resolve(doc, today) {
|
|
1538
1472
|
try {
|
|
1539
1473
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1540
1474
|
_assertClass(doc, Document);
|
|
1541
|
-
|
|
1475
|
+
var ptr0 = isLikeNone(today) ? 0 : passStringToWasm0(today, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1476
|
+
var len0 = WASM_VECTOR_LEN;
|
|
1477
|
+
wasm.quill__resolve(retptr, this.__wbg_ptr, doc.__wbg_ptr, ptr0, len0);
|
|
1542
1478
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1543
1479
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1544
1480
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -1597,8 +1533,7 @@ export class Quill {
|
|
|
1597
1533
|
* transport door (`fromMarkdown`, `fromStored`, a stored row).
|
|
1598
1534
|
*
|
|
1599
1535
|
* Idempotent: an equal value is not rewritten, so YAML comments and stored
|
|
1600
|
-
* bytes survive. A
|
|
1601
|
-
* that field, and a value the strict write refuses stays as authored with a
|
|
1536
|
+
* bytes survive. A value the strict write refuses stays as authored with a
|
|
1602
1537
|
* diagnostic. Throws when `doc` declares a different `$quill`, before any
|
|
1603
1538
|
* mutation.
|
|
1604
1539
|
* @param {Document} doc
|
|
@@ -1620,6 +1555,18 @@ export class Quill {
|
|
|
1620
1555
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1621
1556
|
}
|
|
1622
1557
|
}
|
|
1558
|
+
/**
|
|
1559
|
+
* The empty document: a main card carrying this quill's `$quill` and
|
|
1560
|
+
* `$kind: main`, no field committed, no composable card, no body. The
|
|
1561
|
+
* type-minimal valid input, and the document a plate is bound to render
|
|
1562
|
+
* (the quill authoring contract). `new Document(ref)` is the same document
|
|
1563
|
+
* reached by spelling the reference.
|
|
1564
|
+
* @returns {Document}
|
|
1565
|
+
*/
|
|
1566
|
+
emptyDocument() {
|
|
1567
|
+
const ret = wasm.quill_emptyDocument(this.__wbg_ptr);
|
|
1568
|
+
return Document.__wrap(ret);
|
|
1569
|
+
}
|
|
1623
1570
|
/**
|
|
1624
1571
|
* Build a quill from a file tree. Pure: the declared backend is resolved
|
|
1625
1572
|
* later, at render time. Accepts a `Map<string, Uint8Array>` or a plain
|
|
@@ -1717,9 +1664,9 @@ export class Quill {
|
|
|
1717
1664
|
}
|
|
1718
1665
|
/**
|
|
1719
1666
|
* Seed a starter composable `Card` of the given kind (carries `$kind`),
|
|
1720
|
-
*
|
|
1721
|
-
* (`overlay ›
|
|
1722
|
-
* declared in this quill's schema.
|
|
1667
|
+
* committing an optional per-kind seed `overlay`'s fields and `$body`
|
|
1668
|
+
* (`overlay › absent`, body `overlay › empty`). `undefined` when
|
|
1669
|
+
* `cardKind` is not declared in this quill's schema.
|
|
1723
1670
|
*
|
|
1724
1671
|
* Pass `document.seedOverlay(cardKind)` as `overlay` so a card added to a
|
|
1725
1672
|
* template-derived document inherits its curated starting values; omit it
|
|
@@ -1747,9 +1694,9 @@ export class Quill {
|
|
|
1747
1694
|
}
|
|
1748
1695
|
/**
|
|
1749
1696
|
* Seed a starter `Document` from the schema: the main card plus one instance
|
|
1750
|
-
* of each composable card kind, each
|
|
1751
|
-
*
|
|
1752
|
-
* `
|
|
1697
|
+
* of each composable card kind, each body empty and every field absent
|
|
1698
|
+
* (interpolated at render as `default:`, else the field's blank). No
|
|
1699
|
+
* `example:` is committed (a field's or `body.example`).
|
|
1753
1700
|
* @returns {Document}
|
|
1754
1701
|
*/
|
|
1755
1702
|
seedDocument() {
|
|
@@ -1793,8 +1740,7 @@ export class Quill {
|
|
|
1793
1740
|
/**
|
|
1794
1741
|
* Validate `doc` against this quill's schema, returning every diagnostic
|
|
1795
1742
|
* (empty when the document is valid). Forwards the canonical
|
|
1796
|
-
* `validation::*` diagnostics the engine emits
|
|
1797
|
-
* `validation::must_fill` warning per `!must_fill` marker left behind.
|
|
1743
|
+
* `validation::*` diagnostics the engine emits.
|
|
1798
1744
|
* @param {Document} doc
|
|
1799
1745
|
* @returns {Diagnostic[]}
|
|
1800
1746
|
*/
|
|
@@ -1860,17 +1806,21 @@ export class Quillmark {
|
|
|
1860
1806
|
return this;
|
|
1861
1807
|
}
|
|
1862
1808
|
/**
|
|
1863
|
-
* Open a live render session for `doc` against `quill`'s backend
|
|
1809
|
+
* Open a live render session for `doc` against `quill`'s backend, on the
|
|
1810
|
+
* render date `today` (`YYYY-MM-DD`, default the local date).
|
|
1864
1811
|
* @param {Quill} quill
|
|
1865
1812
|
* @param {Document} doc
|
|
1813
|
+
* @param {string | null} [today]
|
|
1866
1814
|
* @returns {LiveSession}
|
|
1867
1815
|
*/
|
|
1868
|
-
open(quill, doc) {
|
|
1816
|
+
open(quill, doc, today) {
|
|
1869
1817
|
try {
|
|
1870
1818
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1871
1819
|
_assertClass(quill, Quill);
|
|
1872
1820
|
_assertClass(doc, Document);
|
|
1873
|
-
|
|
1821
|
+
var ptr0 = isLikeNone(today) ? 0 : passStringToWasm0(today, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1822
|
+
var len0 = WASM_VECTOR_LEN;
|
|
1823
|
+
wasm.quillmark_open(retptr, this.__wbg_ptr, quill.__wbg_ptr, doc.__wbg_ptr, ptr0, len0);
|
|
1874
1824
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1875
1825
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1876
1826
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -1883,20 +1833,24 @@ export class Quillmark {
|
|
|
1883
1833
|
}
|
|
1884
1834
|
}
|
|
1885
1835
|
/**
|
|
1886
|
-
* Render `doc` against `quill` in one shot
|
|
1887
|
-
* `
|
|
1888
|
-
*
|
|
1836
|
+
* Render `doc` against `quill` in one shot: `open` + `LiveSession.render`,
|
|
1837
|
+
* with `doc.warnings`, then every `quill.validate` warning, ahead of the
|
|
1838
|
+
* compile's in `warnings`. An unset `output_format` falls back to the
|
|
1839
|
+
* backend's first supported format. `today` reads as on `open`.
|
|
1889
1840
|
* @param {Quill} quill
|
|
1890
1841
|
* @param {Document} doc
|
|
1891
1842
|
* @param {RenderOptions | null} [opts]
|
|
1843
|
+
* @param {string | null} [today]
|
|
1892
1844
|
* @returns {RenderResult}
|
|
1893
1845
|
*/
|
|
1894
|
-
render(quill, doc, opts) {
|
|
1846
|
+
render(quill, doc, opts, today) {
|
|
1895
1847
|
try {
|
|
1896
1848
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1897
1849
|
_assertClass(quill, Quill);
|
|
1898
1850
|
_assertClass(doc, Document);
|
|
1899
|
-
|
|
1851
|
+
var ptr0 = isLikeNone(today) ? 0 : passStringToWasm0(today, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1852
|
+
var len0 = WASM_VECTOR_LEN;
|
|
1853
|
+
wasm.quillmark_render(retptr, this.__wbg_ptr, quill.__wbg_ptr, doc.__wbg_ptr, isLikeNone(opts) ? 0 : addHeapObject(opts), ptr0, len0);
|
|
1900
1854
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1901
1855
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1902
1856
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -2060,6 +2014,54 @@ export function importMarkdown(markdown) {
|
|
|
2060
2014
|
}
|
|
2061
2015
|
}
|
|
2062
2016
|
|
|
2017
|
+
/**
|
|
2018
|
+
* Whether `content` satisfies the `inline` constraint of `richtext` and
|
|
2019
|
+
* `plaintext`: one `Para` line, in no container, with no islands. Judged on
|
|
2020
|
+
* the normalized content, which is what a write stores. Throws if `content` is
|
|
2021
|
+
* not canonical content.
|
|
2022
|
+
* @param {Content} content
|
|
2023
|
+
* @returns {boolean}
|
|
2024
|
+
*/
|
|
2025
|
+
export function isInline(content) {
|
|
2026
|
+
try {
|
|
2027
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2028
|
+
wasm.isInline(retptr, addHeapObject(content));
|
|
2029
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2030
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2031
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
2032
|
+
if (r2) {
|
|
2033
|
+
throw takeObject(r1);
|
|
2034
|
+
}
|
|
2035
|
+
return r0 !== 0;
|
|
2036
|
+
} finally {
|
|
2037
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2038
|
+
}
|
|
2039
|
+
}
|
|
2040
|
+
|
|
2041
|
+
/**
|
|
2042
|
+
* Whether `content` satisfies the `plaintext` constraint: no marks, no
|
|
2043
|
+
* islands, every line a `Para` in no container. Judged on the normalized
|
|
2044
|
+
* content, which is what a write stores. Throws if `content` is not canonical
|
|
2045
|
+
* content.
|
|
2046
|
+
* @param {Content} content
|
|
2047
|
+
* @returns {boolean}
|
|
2048
|
+
*/
|
|
2049
|
+
export function isPlain(content) {
|
|
2050
|
+
try {
|
|
2051
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2052
|
+
wasm.isPlain(retptr, addHeapObject(content));
|
|
2053
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2054
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2055
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
2056
|
+
if (r2) {
|
|
2057
|
+
throw takeObject(r1);
|
|
2058
|
+
}
|
|
2059
|
+
return r0 !== 0;
|
|
2060
|
+
} finally {
|
|
2061
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2062
|
+
}
|
|
2063
|
+
}
|
|
2064
|
+
|
|
2063
2065
|
/**
|
|
2064
2066
|
* Where `bundle`'s text-moving channels (`delta`, then `islandOps`, then
|
|
2065
2067
|
* `lineOps`) leave `content`'s marks: the final-text coordinates the bundle's
|
|
@@ -2313,20 +2315,16 @@ function __wbg_get_imports() {
|
|
|
2313
2315
|
const ret = Array.from(getObject(arg0));
|
|
2314
2316
|
return addHeapObject(ret);
|
|
2315
2317
|
},
|
|
2316
|
-
|
|
2317
|
-
const ret = getObject(arg0).
|
|
2318
|
+
__wbg_getDate_8e7807f062ade36a: function(arg0) {
|
|
2319
|
+
const ret = getObject(arg0).getDate();
|
|
2318
2320
|
return ret;
|
|
2319
2321
|
},
|
|
2320
|
-
|
|
2321
|
-
const ret = getObject(arg0).
|
|
2322
|
+
__wbg_getFullYear_0cfd5a75cf3d5856: function(arg0) {
|
|
2323
|
+
const ret = getObject(arg0).getFullYear();
|
|
2322
2324
|
return ret;
|
|
2323
2325
|
},
|
|
2324
|
-
|
|
2325
|
-
const ret = getObject(arg0).
|
|
2326
|
-
return ret;
|
|
2327
|
-
},
|
|
2328
|
-
__wbg_getUTCMonth_0c3985a29f63aeb1: function(arg0) {
|
|
2329
|
-
const ret = getObject(arg0).getUTCMonth();
|
|
2326
|
+
__wbg_getMonth_01ce17d889ed7e5e: function(arg0) {
|
|
2327
|
+
const ret = getObject(arg0).getMonth();
|
|
2330
2328
|
return ret;
|
|
2331
2329
|
},
|
|
2332
2330
|
__wbg_get_6cf5a4d4d8ad3c5a: function() { return handleError(function (arg0, arg1) {
|
|
@@ -2433,10 +2431,6 @@ function __wbg_get_imports() {
|
|
|
2433
2431
|
const ret = new Date();
|
|
2434
2432
|
return addHeapObject(ret);
|
|
2435
2433
|
},
|
|
2436
|
-
__wbg_new_180f1022bb6ee517: function(arg0) {
|
|
2437
|
-
const ret = new Date(getObject(arg0));
|
|
2438
|
-
return addHeapObject(ret);
|
|
2439
|
-
},
|
|
2440
2434
|
__wbg_new_1da3429bc3c4541c: function(arg0) {
|
|
2441
2435
|
const ret = new Uint8Array(getObject(arg0));
|
|
2442
2436
|
return addHeapObject(ret);
|
package/render/wasm_bg.wasm
CHANGED
|
Binary file
|
package/render/wasm_bg.wasm.d.ts
CHANGED
|
@@ -13,7 +13,6 @@ export const document__readerGetContent: (a: number, b: number, c: number, d: nu
|
|
|
13
13
|
export const document__readerGetContentAt: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
14
14
|
export const document__reviseField: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
15
15
|
export const document_applyChange: (a: number, b: number, c: number, d: number) => void;
|
|
16
|
-
export const document_blueprintInstruction: (a: number, b: number, c: number) => void;
|
|
17
16
|
export const document_bodyMarkdown: (a: number, b: number, c: number) => void;
|
|
18
17
|
export const document_card: (a: number, b: number, c: number) => void;
|
|
19
18
|
export const document_cardCount: (a: number) => number;
|
|
@@ -22,15 +21,14 @@ export const document_cards: (a: number, b: number) => void;
|
|
|
22
21
|
export const document_clone: (a: number) => number;
|
|
23
22
|
export const document_currentStorageVersion: (a: number) => void;
|
|
24
23
|
export const document_equals: (a: number, b: number) => number;
|
|
25
|
-
export const document_formatRules: (a: number) => void;
|
|
26
24
|
export const document_fromMarkdown: (a: number, b: number, c: number) => void;
|
|
27
25
|
export const document_fromStored: (a: number, b: number, c: number) => void;
|
|
28
26
|
export const document_getExt: (a: number, b: number, c: number) => void;
|
|
29
27
|
export const document_getStored: (a: number, b: number, c: number) => void;
|
|
30
28
|
export const document_insertCard: (a: number, b: number, c: number, d: number) => void;
|
|
31
|
-
export const document_isFill: (a: number, b: number, c: number) => void;
|
|
32
29
|
export const document_loadStored: (a: number, b: number, c: number, d: number) => void;
|
|
33
30
|
export const document_main: (a: number, b: number) => void;
|
|
31
|
+
export const document_markdownRules: (a: number) => void;
|
|
34
32
|
export const document_moveCard: (a: number, b: number, c: number, d: number) => void;
|
|
35
33
|
export const document_new: (a: number, b: number, c: number) => void;
|
|
36
34
|
export const document_overwrite: (a: number, b: number, c: number, d: number) => void;
|
|
@@ -48,7 +46,6 @@ export const document_storageVersionOf: (a: number, b: number, c: number) => voi
|
|
|
48
46
|
export const document_storeExt: (a: number, b: number, c: number, d: number) => void;
|
|
49
47
|
export const document_storeField: (a: number, b: number, c: number, d: number) => void;
|
|
50
48
|
export const document_storeFields: (a: number, b: number, c: number, d: number) => void;
|
|
51
|
-
export const document_storeFill: (a: number, b: number, c: number, d: number) => void;
|
|
52
49
|
export const document_storeSeedOverlay: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
53
50
|
export const document_toMarkdown: (a: number, b: number) => void;
|
|
54
51
|
export const document_toStored: (a: number, b: number) => void;
|
|
@@ -57,6 +54,8 @@ export const exportMarkdown: (a: number, b: number) => void;
|
|
|
57
54
|
export const formatDiagnostic: (a: number, b: number) => void;
|
|
58
55
|
export const formatDocPath: (a: number, b: number) => void;
|
|
59
56
|
export const importMarkdown: (a: number, b: number, c: number) => void;
|
|
57
|
+
export const isInline: (a: number, b: number) => void;
|
|
58
|
+
export const isPlain: (a: number, b: number) => void;
|
|
60
59
|
export const livesession_backendId: (a: number, b: number) => void;
|
|
61
60
|
export const livesession_fieldAt: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
62
61
|
export const livesession_fieldBoxes: (a: number, b: number, c: number, d: number) => void;
|
|
@@ -72,10 +71,11 @@ export const livesession_warnings: (a: number, b: number) => void;
|
|
|
72
71
|
export const mapMarks: (a: number, b: number, c: number) => void;
|
|
73
72
|
export const mapPos: (a: number, b: number, c: number, d: number) => void;
|
|
74
73
|
export const parseDocPath: (a: number, b: number, c: number) => void;
|
|
75
|
-
export const quill__resolve: (a: number, b: number, c: number) => void;
|
|
74
|
+
export const quill__resolve: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
76
75
|
export const quill_backendId: (a: number, b: number) => void;
|
|
77
76
|
export const quill_blueprint: (a: number, b: number) => void;
|
|
78
77
|
export const quill_conform: (a: number, b: number, c: number) => void;
|
|
78
|
+
export const quill_emptyDocument: (a: number) => number;
|
|
79
79
|
export const quill_fromTree: (a: number, b: number) => void;
|
|
80
80
|
export const quill_metadata: (a: number, b: number) => void;
|
|
81
81
|
export const quill_parse: (a: number, b: number, c: number, d: number) => void;
|
|
@@ -87,8 +87,8 @@ export const quill_toTree: (a: number) => number;
|
|
|
87
87
|
export const quill_validate: (a: number, b: number, c: number) => void;
|
|
88
88
|
export const quill_warnings: (a: number, b: number) => void;
|
|
89
89
|
export const quillmark_new: () => number;
|
|
90
|
-
export const quillmark_open: (a: number, b: number, c: number, d: number) => void;
|
|
91
|
-
export const quillmark_render: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
90
|
+
export const quillmark_open: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
91
|
+
export const quillmark_render: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
92
92
|
export const quillmark_supportedFormats: (a: number, b: number, c: number) => void;
|
|
93
93
|
export const rebase: (a: number, b: number, c: number, d: number) => void;
|
|
94
94
|
export const start: () => void;
|