@quillmark/wasm 0.115.0 → 0.116.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +205 -0
- package/README.md +46 -47
- package/core/wasm.d.ts +57 -77
- package/core/wasm.js +102 -102
- package/core/wasm_bg.wasm +0 -0
- package/core/wasm_bg.wasm.d.ts +4 -5
- package/package.json +1 -1
- package/render/wasm.d.ts +83 -144
- package/render/wasm.js +126 -144
- package/render/wasm_bg.wasm +0 -0
- package/render/wasm_bg.wasm.d.ts +6 -7
- package/runtime/runtime.d.ts +49 -62
- package/runtime/runtime.js +15 -9
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
|
|
@@ -1729,9 +1664,9 @@ export class Quill {
|
|
|
1729
1664
|
}
|
|
1730
1665
|
/**
|
|
1731
1666
|
* Seed a starter composable `Card` of the given kind (carries `$kind`),
|
|
1732
|
-
*
|
|
1733
|
-
* (`overlay ›
|
|
1734
|
-
* 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.
|
|
1735
1670
|
*
|
|
1736
1671
|
* Pass `document.seedOverlay(cardKind)` as `overlay` so a card added to a
|
|
1737
1672
|
* template-derived document inherits its curated starting values; omit it
|
|
@@ -1759,9 +1694,9 @@ export class Quill {
|
|
|
1759
1694
|
}
|
|
1760
1695
|
/**
|
|
1761
1696
|
* Seed a starter `Document` from the schema: the main card plus one instance
|
|
1762
|
-
* of each composable card kind, each
|
|
1763
|
-
*
|
|
1764
|
-
* `
|
|
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`).
|
|
1765
1700
|
* @returns {Document}
|
|
1766
1701
|
*/
|
|
1767
1702
|
seedDocument() {
|
|
@@ -1805,8 +1740,7 @@ export class Quill {
|
|
|
1805
1740
|
/**
|
|
1806
1741
|
* Validate `doc` against this quill's schema, returning every diagnostic
|
|
1807
1742
|
* (empty when the document is valid). Forwards the canonical
|
|
1808
|
-
* `validation::*` diagnostics the engine emits
|
|
1809
|
-
* `validation::must_fill` warning per `!must_fill` marker left behind.
|
|
1743
|
+
* `validation::*` diagnostics the engine emits.
|
|
1810
1744
|
* @param {Document} doc
|
|
1811
1745
|
* @returns {Diagnostic[]}
|
|
1812
1746
|
*/
|
|
@@ -1872,17 +1806,21 @@ export class Quillmark {
|
|
|
1872
1806
|
return this;
|
|
1873
1807
|
}
|
|
1874
1808
|
/**
|
|
1875
|
-
* 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).
|
|
1876
1811
|
* @param {Quill} quill
|
|
1877
1812
|
* @param {Document} doc
|
|
1813
|
+
* @param {string | null} [today]
|
|
1878
1814
|
* @returns {LiveSession}
|
|
1879
1815
|
*/
|
|
1880
|
-
open(quill, doc) {
|
|
1816
|
+
open(quill, doc, today) {
|
|
1881
1817
|
try {
|
|
1882
1818
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1883
1819
|
_assertClass(quill, Quill);
|
|
1884
1820
|
_assertClass(doc, Document);
|
|
1885
|
-
|
|
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);
|
|
1886
1824
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1887
1825
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1888
1826
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -1895,20 +1833,24 @@ export class Quillmark {
|
|
|
1895
1833
|
}
|
|
1896
1834
|
}
|
|
1897
1835
|
/**
|
|
1898
|
-
* Render `doc` against `quill` in one shot
|
|
1899
|
-
* `
|
|
1900
|
-
*
|
|
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`.
|
|
1901
1840
|
* @param {Quill} quill
|
|
1902
1841
|
* @param {Document} doc
|
|
1903
1842
|
* @param {RenderOptions | null} [opts]
|
|
1843
|
+
* @param {string | null} [today]
|
|
1904
1844
|
* @returns {RenderResult}
|
|
1905
1845
|
*/
|
|
1906
|
-
render(quill, doc, opts) {
|
|
1846
|
+
render(quill, doc, opts, today) {
|
|
1907
1847
|
try {
|
|
1908
1848
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1909
1849
|
_assertClass(quill, Quill);
|
|
1910
1850
|
_assertClass(doc, Document);
|
|
1911
|
-
|
|
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);
|
|
1912
1854
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1913
1855
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1914
1856
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -2072,6 +2014,54 @@ export function importMarkdown(markdown) {
|
|
|
2072
2014
|
}
|
|
2073
2015
|
}
|
|
2074
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
|
+
|
|
2075
2065
|
/**
|
|
2076
2066
|
* Where `bundle`'s text-moving channels (`delta`, then `islandOps`, then
|
|
2077
2067
|
* `lineOps`) leave `content`'s marks: the final-text coordinates the bundle's
|
|
@@ -2325,20 +2315,16 @@ function __wbg_get_imports() {
|
|
|
2325
2315
|
const ret = Array.from(getObject(arg0));
|
|
2326
2316
|
return addHeapObject(ret);
|
|
2327
2317
|
},
|
|
2328
|
-
|
|
2329
|
-
const ret = getObject(arg0).
|
|
2318
|
+
__wbg_getDate_8e7807f062ade36a: function(arg0) {
|
|
2319
|
+
const ret = getObject(arg0).getDate();
|
|
2330
2320
|
return ret;
|
|
2331
2321
|
},
|
|
2332
|
-
|
|
2333
|
-
const ret = getObject(arg0).
|
|
2322
|
+
__wbg_getFullYear_0cfd5a75cf3d5856: function(arg0) {
|
|
2323
|
+
const ret = getObject(arg0).getFullYear();
|
|
2334
2324
|
return ret;
|
|
2335
2325
|
},
|
|
2336
|
-
|
|
2337
|
-
const ret = getObject(arg0).
|
|
2338
|
-
return ret;
|
|
2339
|
-
},
|
|
2340
|
-
__wbg_getUTCMonth_0c3985a29f63aeb1: function(arg0) {
|
|
2341
|
-
const ret = getObject(arg0).getUTCMonth();
|
|
2326
|
+
__wbg_getMonth_01ce17d889ed7e5e: function(arg0) {
|
|
2327
|
+
const ret = getObject(arg0).getMonth();
|
|
2342
2328
|
return ret;
|
|
2343
2329
|
},
|
|
2344
2330
|
__wbg_get_6cf5a4d4d8ad3c5a: function() { return handleError(function (arg0, arg1) {
|
|
@@ -2445,10 +2431,6 @@ function __wbg_get_imports() {
|
|
|
2445
2431
|
const ret = new Date();
|
|
2446
2432
|
return addHeapObject(ret);
|
|
2447
2433
|
},
|
|
2448
|
-
__wbg_new_180f1022bb6ee517: function(arg0) {
|
|
2449
|
-
const ret = new Date(getObject(arg0));
|
|
2450
|
-
return addHeapObject(ret);
|
|
2451
|
-
},
|
|
2452
2434
|
__wbg_new_1da3429bc3c4541c: function(arg0) {
|
|
2453
2435
|
const ret = new Uint8Array(getObject(arg0));
|
|
2454
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,7 +71,7 @@ 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;
|
|
@@ -88,8 +87,8 @@ export const quill_toTree: (a: number) => number;
|
|
|
88
87
|
export const quill_validate: (a: number, b: number, c: number) => void;
|
|
89
88
|
export const quill_warnings: (a: number, b: number) => void;
|
|
90
89
|
export const quillmark_new: () => number;
|
|
91
|
-
export const quillmark_open: (a: number, b: number, c: number, d: number) => void;
|
|
92
|
-
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;
|
|
93
92
|
export const quillmark_supportedFormats: (a: number, b: number, c: number) => void;
|
|
94
93
|
export const rebase: (a: number, b: number, c: number, d: number) => void;
|
|
95
94
|
export const start: () => void;
|