@relyio/sdk 0.17.0 → 0.19.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 +35 -0
- package/dist/automations/index.cjs +71 -0
- package/dist/automations/index.d.cts +1590 -0
- package/dist/automations/index.d.ts +1590 -0
- package/dist/automations/index.js +6 -0
- package/dist/{chunk-RSHMA4KT.cjs → chunk-2SPPU2WG.cjs} +68 -68
- package/dist/{chunk-VS2DEUTN.js → chunk-356SF5Y2.js} +463 -26
- package/dist/chunk-5F3YYPLZ.cjs +19237 -0
- package/dist/chunk-7I3SC7SV.cjs +40 -0
- package/dist/chunk-DBYMG6MQ.cjs +535 -0
- package/dist/chunk-DI6KFDBO.js +43 -0
- package/dist/chunk-HDHBYYEY.js +36 -0
- package/dist/chunk-L6DXCKVQ.cjs +50 -0
- package/dist/{chunk-TZL374LS.cjs → chunk-M7MWNV3Q.cjs} +21 -21
- package/dist/{chunk-H6IBQSMM.js → chunk-NJQK5STK.js} +3 -3
- package/dist/chunk-NN45CSPZ.cjs +872 -0
- package/dist/{chunk-6E22GYPB.cjs → chunk-P23G5NXD.cjs} +781 -337
- package/dist/chunk-PZCDJFMA.js +19195 -0
- package/dist/chunk-T7LGREB3.js +848 -0
- package/dist/{chunk-BBUB7C2Z.js → chunk-W2A4OTCI.js} +3 -3
- package/dist/chunk-W2GRVXDG.js +520 -0
- package/dist/{chunk-5UMY6CS4.js → chunk-ZAKEY6DY.js} +3 -3
- package/dist/{chunk-LSRPMNPT.cjs → chunk-ZO6QDYJG.cjs} +7 -7
- package/dist/client/index.cjs +8 -7
- package/dist/client/index.d.cts +4 -3
- package/dist/client/index.d.ts +4 -3
- package/dist/client/index.js +6 -5
- package/dist/{define-content-type-AuL9-oz6.d.cts → define-content-type-BZ6X8GvL.d.cts} +4547 -842
- package/dist/{define-content-type-BGoQxqLf.d.ts → define-content-type-C12jh8cY.d.ts} +4547 -842
- package/dist/{define-schema-DgCX9YB7.d.ts → define-schema-BPlZl4a2.d.cts} +258 -10
- package/dist/{define-schema-DkXwpp0I.d.cts → define-schema-CK7TtYot.d.ts} +258 -10
- package/dist/dev-handshake/index.cjs +9 -9
- package/dist/dev-handshake/index.js +2 -2
- package/dist/extensions/index.cjs +100 -0
- package/dist/extensions/index.d.cts +6 -0
- package/dist/extensions/index.d.ts +6 -0
- package/dist/extensions/index.js +96 -0
- package/dist/functions/index.cjs +71 -0
- package/dist/functions/index.d.cts +6 -0
- package/dist/functions/index.d.ts +6 -0
- package/dist/functions/index.js +62 -0
- package/dist/{index-BBp8_tn9.d.ts → index-BxNnlc5D.d.ts} +167 -494
- package/dist/{index-DaMZ4FQ_.d.ts → index-C-MymZTe.d.ts} +1 -1
- package/dist/{index-DxRmKPrR.d.cts → index-D5jyIeQ5.d.cts} +167 -494
- package/dist/{index-Bp4AiNT3.d.cts → index-DN0l8RHw.d.cts} +1 -1
- package/dist/index.cjs +208 -185
- package/dist/index.d.cts +147 -17
- package/dist/index.d.ts +147 -17
- package/dist/index.js +11 -16
- package/dist/markdown/index.cjs +382 -382
- package/dist/markdown/index.js +1 -1
- package/dist/preview/index.cjs +11 -10
- package/dist/preview/index.js +3 -2
- package/dist/register-BiMQKVp-.d.ts +693 -0
- package/dist/register-DeMsaurp.d.cts +693 -0
- package/dist/rich-text/index.cjs +12 -12
- package/dist/rich-text/index.d.cts +2 -2
- package/dist/rich-text/index.d.ts +2 -2
- package/dist/rich-text/index.js +2 -2
- package/dist/schema/index.cjs +63 -34
- package/dist/schema/index.d.cts +14 -5
- package/dist/schema/index.d.ts +14 -5
- package/dist/schema/index.js +3 -2
- package/dist/types/index.d.cts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/utils/index.cjs +20 -20
- package/dist/utils/index.js +2 -2
- package/package.json +23 -5
- package/dist/chunk-6PTRZP5U.cjs +0 -433
- package/dist/chunk-DIZY6CKM.js +0 -950
- package/dist/chunk-GHYB6IZK.cjs +0 -983
- package/dist/chunk-MWMSFIWN.cjs +0 -17
- package/dist/chunk-OVMIHAYK.js +0 -411
- package/dist/chunk-XQ4QHWZE.js +0 -13
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { and, anyEntry, automations, defineAutomation, entries, extensionTrigger, isAutomationFile, not, on, or, records, resolveAutomation, schedule, tpl } from '../chunk-W2GRVXDG.js';
|
|
2
|
+
export { fields } from '../chunk-PZCDJFMA.js';
|
|
3
|
+
import '../chunk-T7LGREB3.js';
|
|
4
|
+
import '../chunk-DI6KFDBO.js';
|
|
5
|
+
//# sourceMappingURL=index.js.map
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkL6DXCKVQ_cjs = require('./chunk-L6DXCKVQ.cjs');
|
|
4
4
|
|
|
5
5
|
/* RelyIO SDK - Built with ❤️ by the RelyIO Team */
|
|
6
6
|
|
|
@@ -8,11 +8,11 @@ var chunkMWMSFIWN_cjs = require('./chunk-MWMSFIWN.cjs');
|
|
|
8
8
|
function richTextHeadingSlug(text) {
|
|
9
9
|
return text.trim().toLowerCase().replace(/[^\p{L}\p{M}\p{N}\s_-]/gu, "").replace(/\s/gu, "-");
|
|
10
10
|
}
|
|
11
|
-
|
|
11
|
+
chunkL6DXCKVQ_cjs.__name(richTextHeadingSlug, "richTextHeadingSlug");
|
|
12
12
|
function isRecord(value) {
|
|
13
13
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
14
14
|
}
|
|
15
|
-
|
|
15
|
+
chunkL6DXCKVQ_cjs.__name(isRecord, "isRecord");
|
|
16
16
|
var BUILT_IN_CONTAINERS = /* @__PURE__ */ new Set([
|
|
17
17
|
"paragraph",
|
|
18
18
|
"heading",
|
|
@@ -34,19 +34,19 @@ function headingText(heading) {
|
|
|
34
34
|
}
|
|
35
35
|
return text;
|
|
36
36
|
}
|
|
37
|
-
|
|
37
|
+
chunkL6DXCKVQ_cjs.__name(headingText, "headingText");
|
|
38
38
|
function richTextHeadingAnchors(value) {
|
|
39
39
|
return anchorsAcross([value]);
|
|
40
40
|
}
|
|
41
|
-
|
|
41
|
+
chunkL6DXCKVQ_cjs.__name(richTextHeadingAnchors, "richTextHeadingAnchors");
|
|
42
42
|
function entryHeadingAnchors(entry) {
|
|
43
43
|
return anchorsAcross(isRecord(entry) ? Object.values(entry) : []);
|
|
44
44
|
}
|
|
45
|
-
|
|
45
|
+
chunkL6DXCKVQ_cjs.__name(entryHeadingAnchors, "entryHeadingAnchors");
|
|
46
46
|
function anchorsAcross(values) {
|
|
47
47
|
const anchors = /* @__PURE__ */ new Map();
|
|
48
48
|
const taken = /* @__PURE__ */ new Map();
|
|
49
|
-
const unique = /* @__PURE__ */
|
|
49
|
+
const unique = /* @__PURE__ */ chunkL6DXCKVQ_cjs.__name((slug) => {
|
|
50
50
|
let anchor = slug;
|
|
51
51
|
const seen = taken.get(slug);
|
|
52
52
|
if (seen !== void 0) {
|
|
@@ -60,7 +60,7 @@ function anchorsAcross(values) {
|
|
|
60
60
|
taken.set(anchor, 0);
|
|
61
61
|
return anchor;
|
|
62
62
|
}, "unique");
|
|
63
|
-
const visit = /* @__PURE__ */
|
|
63
|
+
const visit = /* @__PURE__ */ chunkL6DXCKVQ_cjs.__name((nodes) => {
|
|
64
64
|
for (const node of nodes) {
|
|
65
65
|
if (!isRecord(node) || typeof node._type !== "string") continue;
|
|
66
66
|
if (node._type === "heading") {
|
|
@@ -78,7 +78,7 @@ function anchorsAcross(values) {
|
|
|
78
78
|
}
|
|
79
79
|
return anchors;
|
|
80
80
|
}
|
|
81
|
-
|
|
81
|
+
chunkL6DXCKVQ_cjs.__name(anchorsAcross, "anchorsAcross");
|
|
82
82
|
|
|
83
83
|
// src/binding/key-path.ts
|
|
84
84
|
var ITEM_SELECTOR = "[_key==";
|
|
@@ -86,7 +86,7 @@ function formatKeyPath(listPath, key, field) {
|
|
|
86
86
|
const item = `${listPath}${ITEM_SELECTOR}${JSON.stringify(key)}]`;
|
|
87
87
|
return field === void 0 ? item : `${item}.${field}`;
|
|
88
88
|
}
|
|
89
|
-
|
|
89
|
+
chunkL6DXCKVQ_cjs.__name(formatKeyPath, "formatKeyPath");
|
|
90
90
|
function parseKeyPath(path) {
|
|
91
91
|
const segments = [];
|
|
92
92
|
let at = 0;
|
|
@@ -123,7 +123,7 @@ function parseKeyPath(path) {
|
|
|
123
123
|
}
|
|
124
124
|
return segments.length === 0 || expectField ? null : segments;
|
|
125
125
|
}
|
|
126
|
-
|
|
126
|
+
chunkL6DXCKVQ_cjs.__name(parseKeyPath, "parseKeyPath");
|
|
127
127
|
function readQuoted(path, start) {
|
|
128
128
|
if (path[start] !== '"') return null;
|
|
129
129
|
for (let end = start + 1; end < path.length; end += 1) {
|
|
@@ -141,7 +141,7 @@ function readQuoted(path, start) {
|
|
|
141
141
|
}
|
|
142
142
|
return null;
|
|
143
143
|
}
|
|
144
|
-
|
|
144
|
+
chunkL6DXCKVQ_cjs.__name(readQuoted, "readQuoted");
|
|
145
145
|
|
|
146
146
|
// src/binding/relyio-field.ts
|
|
147
147
|
var BINDING_VERSION = "1";
|
|
@@ -160,11 +160,11 @@ function relyioField(subject, path) {
|
|
|
160
160
|
requireKeyPath("entry", field, field);
|
|
161
161
|
return attributes;
|
|
162
162
|
}
|
|
163
|
-
|
|
163
|
+
chunkL6DXCKVQ_cjs.__name(relyioField, "relyioField");
|
|
164
164
|
function isBindingShaped(value) {
|
|
165
165
|
return "data-relyio-field" in value;
|
|
166
166
|
}
|
|
167
|
-
|
|
167
|
+
chunkL6DXCKVQ_cjs.__name(isBindingShaped, "isBindingShaped");
|
|
168
168
|
function continued(binding, path) {
|
|
169
169
|
const spelled = typeof path === "string" ? path : `{ _key: ${JSON.stringify(path._key)} }`;
|
|
170
170
|
const complete = binding["data-relyio-v"] === BINDING_VERSION && [
|
|
@@ -188,14 +188,14 @@ function continued(binding, path) {
|
|
|
188
188
|
"data-relyio-v": BINDING_VERSION
|
|
189
189
|
};
|
|
190
190
|
}
|
|
191
|
-
|
|
191
|
+
chunkL6DXCKVQ_cjs.__name(continued, "continued");
|
|
192
192
|
function requireKeyPath(form, given, field) {
|
|
193
193
|
if (parseKeyPath(field) !== null) return;
|
|
194
194
|
throw new TypeError(
|
|
195
195
|
`relyioField(${form}, '${given}'): '${field}' is not a field or a key path. Name a field (\`title\`), or a value inside one by its items\u2019 keys (\`sections[_key=="k1"].heading\`).`
|
|
196
196
|
);
|
|
197
197
|
}
|
|
198
|
-
|
|
198
|
+
chunkL6DXCKVQ_cjs.__name(requireKeyPath, "requireKeyPath");
|
|
199
199
|
function requireMetadata(metadata, key, field) {
|
|
200
200
|
const value = metadata?.[key];
|
|
201
201
|
if (typeof value !== "string" || value.length === 0) {
|
|
@@ -205,7 +205,7 @@ function requireMetadata(metadata, key, field) {
|
|
|
205
205
|
}
|
|
206
206
|
return value;
|
|
207
207
|
}
|
|
208
|
-
|
|
208
|
+
chunkL6DXCKVQ_cjs.__name(requireMetadata, "requireMetadata");
|
|
209
209
|
|
|
210
210
|
// src/rich-text/render.ts
|
|
211
211
|
var RICH_TEXT_VOID_TAGS = /* @__PURE__ */ new Set([
|
|
@@ -233,7 +233,7 @@ function isDeclaredRichTextNode(node) {
|
|
|
233
233
|
const type = node._type;
|
|
234
234
|
return typeof type === "string" && type !== "" && !Object.prototype.hasOwnProperty.call(BUILT_IN_NODES, type);
|
|
235
235
|
}
|
|
236
|
-
|
|
236
|
+
chunkL6DXCKVQ_cjs.__name(isDeclaredRichTextNode, "isDeclaredRichTextNode");
|
|
237
237
|
var PLAIN = Object.freeze({ header: false });
|
|
238
238
|
var HEADER = Object.freeze({ header: true });
|
|
239
239
|
var headingAnchors = /* @__PURE__ */ new Map();
|
|
@@ -251,7 +251,7 @@ function renderRichText(value, target, options = {}) {
|
|
|
251
251
|
headingAnchors = outer;
|
|
252
252
|
}
|
|
253
253
|
}
|
|
254
|
-
|
|
254
|
+
chunkL6DXCKVQ_cjs.__name(renderRichText, "renderRichText");
|
|
255
255
|
function blocks(nodes, target) {
|
|
256
256
|
const out = [];
|
|
257
257
|
for (const node of nodes) {
|
|
@@ -260,7 +260,7 @@ function blocks(nodes, target) {
|
|
|
260
260
|
}
|
|
261
261
|
return out;
|
|
262
262
|
}
|
|
263
|
-
|
|
263
|
+
chunkL6DXCKVQ_cjs.__name(blocks, "blocks");
|
|
264
264
|
var HEADING_TAGS = {
|
|
265
265
|
1: "h1",
|
|
266
266
|
2: "h2",
|
|
@@ -334,7 +334,7 @@ function block(node, target) {
|
|
|
334
334
|
}
|
|
335
335
|
}
|
|
336
336
|
}
|
|
337
|
-
|
|
337
|
+
chunkL6DXCKVQ_cjs.__name(block, "block");
|
|
338
338
|
function list(node, target) {
|
|
339
339
|
let tag;
|
|
340
340
|
switch (node.style) {
|
|
@@ -364,7 +364,7 @@ function list(node, target) {
|
|
|
364
364
|
PLAIN
|
|
365
365
|
);
|
|
366
366
|
}
|
|
367
|
-
|
|
367
|
+
chunkL6DXCKVQ_cjs.__name(list, "list");
|
|
368
368
|
function listItem(item, task, target) {
|
|
369
369
|
return target.node(
|
|
370
370
|
item,
|
|
@@ -382,7 +382,7 @@ function listItem(item, task, target) {
|
|
|
382
382
|
PLAIN
|
|
383
383
|
);
|
|
384
384
|
}
|
|
385
|
-
|
|
385
|
+
chunkL6DXCKVQ_cjs.__name(listItem, "listItem");
|
|
386
386
|
function code(node, target) {
|
|
387
387
|
const language = typeof node.language === "string" && node.language !== "" ? node.language : void 0;
|
|
388
388
|
const caption = nonEmpty(node.filename) ?? nonEmpty(node.label);
|
|
@@ -390,7 +390,7 @@ function code(node, target) {
|
|
|
390
390
|
node,
|
|
391
391
|
[target.text(node.text)],
|
|
392
392
|
(contents) => {
|
|
393
|
-
const pre = /* @__PURE__ */
|
|
393
|
+
const pre = /* @__PURE__ */ chunkL6DXCKVQ_cjs.__name((key) => target.element(
|
|
394
394
|
"pre",
|
|
395
395
|
void 0,
|
|
396
396
|
[
|
|
@@ -417,11 +417,11 @@ function code(node, target) {
|
|
|
417
417
|
PLAIN
|
|
418
418
|
);
|
|
419
419
|
}
|
|
420
|
-
|
|
420
|
+
chunkL6DXCKVQ_cjs.__name(code, "code");
|
|
421
421
|
function nonEmpty(value) {
|
|
422
422
|
return typeof value === "string" && value !== "" ? value : void 0;
|
|
423
423
|
}
|
|
424
|
-
|
|
424
|
+
chunkL6DXCKVQ_cjs.__name(nonEmpty, "nonEmpty");
|
|
425
425
|
function table(node, target) {
|
|
426
426
|
const rows = node.children.filter((row) => row._type === "tableRow");
|
|
427
427
|
const [first, ...rest] = rows;
|
|
@@ -448,7 +448,7 @@ function table(node, target) {
|
|
|
448
448
|
PLAIN
|
|
449
449
|
);
|
|
450
450
|
}
|
|
451
|
-
|
|
451
|
+
chunkL6DXCKVQ_cjs.__name(table, "table");
|
|
452
452
|
function tableRow(row, header, target) {
|
|
453
453
|
const cells = [];
|
|
454
454
|
for (const cell of row.children) {
|
|
@@ -461,7 +461,7 @@ function tableRow(row, header, target) {
|
|
|
461
461
|
header ? HEADER : PLAIN
|
|
462
462
|
);
|
|
463
463
|
}
|
|
464
|
-
|
|
464
|
+
chunkL6DXCKVQ_cjs.__name(tableRow, "tableRow");
|
|
465
465
|
function tableCell(cell, header, target) {
|
|
466
466
|
let attributes;
|
|
467
467
|
switch (cell.align) {
|
|
@@ -487,11 +487,11 @@ function tableCell(cell, header, target) {
|
|
|
487
487
|
header ? HEADER : PLAIN
|
|
488
488
|
);
|
|
489
489
|
}
|
|
490
|
-
|
|
490
|
+
chunkL6DXCKVQ_cjs.__name(tableCell, "tableCell");
|
|
491
491
|
function inline(nodes, target) {
|
|
492
492
|
const out = [];
|
|
493
493
|
let runs = [];
|
|
494
|
-
const flush = /* @__PURE__ */
|
|
494
|
+
const flush = /* @__PURE__ */ chunkL6DXCKVQ_cjs.__name(() => {
|
|
495
495
|
if (runs.length > 0) out.push(...marked(runs, target));
|
|
496
496
|
runs = [];
|
|
497
497
|
}, "flush");
|
|
@@ -520,7 +520,7 @@ function inline(nodes, target) {
|
|
|
520
520
|
flush();
|
|
521
521
|
return out;
|
|
522
522
|
}
|
|
523
|
-
|
|
523
|
+
chunkL6DXCKVQ_cjs.__name(inline, "inline");
|
|
524
524
|
function marked(runs, target) {
|
|
525
525
|
const out = [];
|
|
526
526
|
let index = 0;
|
|
@@ -543,11 +543,11 @@ function marked(runs, target) {
|
|
|
543
543
|
}
|
|
544
544
|
return out;
|
|
545
545
|
}
|
|
546
|
-
|
|
546
|
+
chunkL6DXCKVQ_cjs.__name(marked, "marked");
|
|
547
547
|
function nextMark(run) {
|
|
548
548
|
return run.span.marks?.[run.drawn];
|
|
549
549
|
}
|
|
550
|
-
|
|
550
|
+
chunkL6DXCKVQ_cjs.__name(nextMark, "nextMark");
|
|
551
551
|
function sameMark(a, b) {
|
|
552
552
|
if (a?._type !== b._type) return false;
|
|
553
553
|
if (a._type === "link" && b._type === "link") return a.href === b.href;
|
|
@@ -556,7 +556,7 @@ function sameMark(a, b) {
|
|
|
556
556
|
}
|
|
557
557
|
return true;
|
|
558
558
|
}
|
|
559
|
-
|
|
559
|
+
chunkL6DXCKVQ_cjs.__name(sameMark, "sameMark");
|
|
560
560
|
function linkedEntryId(link) {
|
|
561
561
|
const to = link.to;
|
|
562
562
|
if (typeof to === "object" && to !== null && "_metadata" in to) {
|
|
@@ -565,7 +565,7 @@ function linkedEntryId(link) {
|
|
|
565
565
|
}
|
|
566
566
|
return to;
|
|
567
567
|
}
|
|
568
|
-
|
|
568
|
+
chunkL6DXCKVQ_cjs.__name(linkedEntryId, "linkedEntryId");
|
|
569
569
|
var MARK_TAGS = {
|
|
570
570
|
bold: "strong",
|
|
571
571
|
italic: "em",
|
|
@@ -606,7 +606,7 @@ function applyMark(mark, inner, target) {
|
|
|
606
606
|
}
|
|
607
607
|
}
|
|
608
608
|
}
|
|
609
|
-
|
|
609
|
+
chunkL6DXCKVQ_cjs.__name(applyMark, "applyMark");
|
|
610
610
|
var SAFE_SCHEMES = /* @__PURE__ */ new Set(["http", "https", "mailto", "tel"]);
|
|
611
611
|
var SCHEME = /^([a-z][a-z\d+.-]*):/i;
|
|
612
612
|
function safeRichTextHref(href) {
|
|
@@ -623,7 +623,7 @@ function safeRichTextHref(href) {
|
|
|
623
623
|
if (scheme === null) return href;
|
|
624
624
|
return SAFE_SCHEMES.has(scheme[1].toLowerCase()) ? href : void 0;
|
|
625
625
|
}
|
|
626
|
-
|
|
626
|
+
chunkL6DXCKVQ_cjs.__name(safeRichTextHref, "safeRichTextHref");
|
|
627
627
|
function trimControls(text) {
|
|
628
628
|
let start = 0;
|
|
629
629
|
let end = text.length;
|
|
@@ -631,13 +631,13 @@ function trimControls(text) {
|
|
|
631
631
|
while (end > start && text.charCodeAt(end - 1) <= 32) end -= 1;
|
|
632
632
|
return text.slice(start, end);
|
|
633
633
|
}
|
|
634
|
-
|
|
634
|
+
chunkL6DXCKVQ_cjs.__name(trimControls, "trimControls");
|
|
635
635
|
|
|
636
636
|
// src/rich-text/html.ts
|
|
637
637
|
function escapeHtml(text) {
|
|
638
638
|
return String(text).replace(/["&'<>]/g, (character) => HTML_ESCAPES[character] ?? character);
|
|
639
639
|
}
|
|
640
|
-
|
|
640
|
+
chunkL6DXCKVQ_cjs.__name(escapeHtml, "escapeHtml");
|
|
641
641
|
var HTML_ESCAPES = {
|
|
642
642
|
'"': """,
|
|
643
643
|
"&": "&",
|
|
@@ -653,7 +653,7 @@ function attributesOf(attributes) {
|
|
|
653
653
|
}
|
|
654
654
|
return written;
|
|
655
655
|
}
|
|
656
|
-
|
|
656
|
+
chunkL6DXCKVQ_cjs.__name(attributesOf, "attributesOf");
|
|
657
657
|
var VOID_ELEMENTS = /* @__PURE__ */ new Set([
|
|
658
658
|
"area",
|
|
659
659
|
"base",
|
|
@@ -685,7 +685,7 @@ function tagEnd(html, start) {
|
|
|
685
685
|
}
|
|
686
686
|
return -1;
|
|
687
687
|
}
|
|
688
|
-
|
|
688
|
+
chunkL6DXCKVQ_cjs.__name(tagEnd, "tagEnd");
|
|
689
689
|
var TAG_NAME = /^<\/?([A-Za-z][\w:-]*)/;
|
|
690
690
|
function soleElementStartTag(html) {
|
|
691
691
|
const from = html.length - html.trimStart().length;
|
|
@@ -748,7 +748,7 @@ function soleElementStartTag(html) {
|
|
|
748
748
|
}
|
|
749
749
|
return depth === 0 ? startTag : void 0;
|
|
750
750
|
}
|
|
751
|
-
|
|
751
|
+
chunkL6DXCKVQ_cjs.__name(soleElementStartTag, "soleElementStartTag");
|
|
752
752
|
function stamped(html, binding) {
|
|
753
753
|
if (binding === void 0) return html;
|
|
754
754
|
const root = soleElementStartTag(html);
|
|
@@ -756,17 +756,17 @@ function stamped(html, binding) {
|
|
|
756
756
|
if (BOUND.test(root.tag)) return html;
|
|
757
757
|
return `${html.slice(0, root.insertAt)}${attributesOf(binding)}${html.slice(root.insertAt)}`;
|
|
758
758
|
}
|
|
759
|
-
|
|
759
|
+
chunkL6DXCKVQ_cjs.__name(stamped, "stamped");
|
|
760
760
|
function htmlTarget(declared2, entryLink, field) {
|
|
761
761
|
return {
|
|
762
762
|
element(tag, attributes, children) {
|
|
763
763
|
return RICH_TEXT_VOID_TAGS.has(tag) ? `<${tag}${attributesOf(attributes)}/>` : `<${tag}${attributesOf(attributes)}>${children.join("")}</${tag}>`;
|
|
764
764
|
},
|
|
765
765
|
text: escapeHtml,
|
|
766
|
-
node: /* @__PURE__ */
|
|
767
|
-
mark: /* @__PURE__ */
|
|
766
|
+
node: /* @__PURE__ */ chunkL6DXCKVQ_cjs.__name((_node, contents, draw) => draw(contents), "node"),
|
|
767
|
+
mark: /* @__PURE__ */ chunkL6DXCKVQ_cjs.__name((_mark, contents, draw) => draw(contents), "mark"),
|
|
768
768
|
// A value built by hand holding an entry link no writer draws: its text, with no anchor
|
|
769
|
-
entryLink: /* @__PURE__ */
|
|
769
|
+
entryLink: /* @__PURE__ */ chunkL6DXCKVQ_cjs.__name((link, contents) => entryLink === void 0 ? contents.join("") : entryLink(link, contents.join("")), "entryLink"),
|
|
770
770
|
// A declared node's writer (REL-1807), handed the node's key path below the field's binding and
|
|
771
771
|
// stamped with it (REL-2142); no binding asks the core nothing
|
|
772
772
|
declared(node) {
|
|
@@ -777,7 +777,7 @@ function htmlTarget(declared2, entryLink, field) {
|
|
|
777
777
|
}
|
|
778
778
|
};
|
|
779
779
|
}
|
|
780
|
-
|
|
780
|
+
chunkL6DXCKVQ_cjs.__name(htmlTarget, "htmlTarget");
|
|
781
781
|
function richTextToHtml(value, ...[options]) {
|
|
782
782
|
if (value === void 0) return "";
|
|
783
783
|
const declared2 = options?.declared ?? {};
|
|
@@ -788,7 +788,7 @@ function richTextToHtml(value, ...[options]) {
|
|
|
788
788
|
options?.anchors === void 0 ? {} : { anchors: options.anchors }
|
|
789
789
|
).join("");
|
|
790
790
|
}
|
|
791
|
-
|
|
791
|
+
chunkL6DXCKVQ_cjs.__name(richTextToHtml, "richTextToHtml");
|
|
792
792
|
|
|
793
793
|
// src/rich-text/markdown.ts
|
|
794
794
|
var entryLinkWriter;
|
|
@@ -798,7 +798,7 @@ function declared(node) {
|
|
|
798
798
|
const write = Object.prototype.hasOwnProperty.call(writers, type) ? writers[type] : void 0;
|
|
799
799
|
return write === void 0 ? void 0 : write(node);
|
|
800
800
|
}
|
|
801
|
-
|
|
801
|
+
chunkL6DXCKVQ_cjs.__name(declared, "declared");
|
|
802
802
|
function richTextToMarkdown(value, ...[options]) {
|
|
803
803
|
if (value === void 0) return "";
|
|
804
804
|
const tree = value;
|
|
@@ -817,7 +817,7 @@ function richTextToMarkdown(value, ...[options]) {
|
|
|
817
817
|
entryLinkWriter = outerLink;
|
|
818
818
|
}
|
|
819
819
|
}
|
|
820
|
-
|
|
820
|
+
chunkL6DXCKVQ_cjs.__name(richTextToMarkdown, "richTextToMarkdown");
|
|
821
821
|
function blocks2(nodes) {
|
|
822
822
|
const out = [];
|
|
823
823
|
for (const node of nodes) {
|
|
@@ -826,7 +826,7 @@ function blocks2(nodes) {
|
|
|
826
826
|
}
|
|
827
827
|
return out;
|
|
828
828
|
}
|
|
829
|
-
|
|
829
|
+
chunkL6DXCKVQ_cjs.__name(blocks2, "blocks");
|
|
830
830
|
function block2(node) {
|
|
831
831
|
if (isDeclaredRichTextNode(node)) return declared(node);
|
|
832
832
|
switch (node._type) {
|
|
@@ -865,7 +865,7 @@ function block2(node) {
|
|
|
865
865
|
}
|
|
866
866
|
}
|
|
867
867
|
}
|
|
868
|
-
|
|
868
|
+
chunkL6DXCKVQ_cjs.__name(block2, "block");
|
|
869
869
|
function list2(node) {
|
|
870
870
|
const items = node.children.filter((item) => item._type === "listItem");
|
|
871
871
|
if (items.length === 0) return void 0;
|
|
@@ -902,12 +902,12 @@ function list2(node) {
|
|
|
902
902
|
return `${marker} ${body.split("\n").map((line, at) => at === 0 || line === "" ? line : `${indent}${line}`).join("\n")}`;
|
|
903
903
|
}).join("\n");
|
|
904
904
|
}
|
|
905
|
-
|
|
905
|
+
chunkL6DXCKVQ_cjs.__name(list2, "list");
|
|
906
906
|
function interruptsParagraph(node) {
|
|
907
907
|
if (node._type !== "list") return false;
|
|
908
908
|
return node.style !== "numbered" || node.start === void 0 || node.start === 1;
|
|
909
909
|
}
|
|
910
|
-
|
|
910
|
+
chunkL6DXCKVQ_cjs.__name(interruptsParagraph, "interruptsParagraph");
|
|
911
911
|
function code2(node) {
|
|
912
912
|
const text = typeof node.text === "string" ? node.text : "";
|
|
913
913
|
const longest = Math.max(0, ...[...text.matchAll(/`+/g)].map((run) => run[0].length));
|
|
@@ -919,7 +919,7 @@ ${fence}` : `${fence}${info}
|
|
|
919
919
|
${text}
|
|
920
920
|
${fence}`;
|
|
921
921
|
}
|
|
922
|
-
|
|
922
|
+
chunkL6DXCKVQ_cjs.__name(code2, "code");
|
|
923
923
|
function table2(node) {
|
|
924
924
|
const rows = node.children.filter((row) => row._type === "tableRow").map((row) => row.children.filter((cell) => cell._type === "tableCell"));
|
|
925
925
|
if (rows.length === 0) return void 0;
|
|
@@ -940,7 +940,7 @@ function table2(node) {
|
|
|
940
940
|
{ length: columns },
|
|
941
941
|
(_, at) => Math.max(3, ...[header, ...body].map((cells) => cells[at].length))
|
|
942
942
|
);
|
|
943
|
-
const line = /* @__PURE__ */
|
|
943
|
+
const line = /* @__PURE__ */ chunkL6DXCKVQ_cjs.__name((cells) => `| ${cells.map((cell, at) => cell.padEnd(widths[at])).join(" | ")} |`, "line");
|
|
944
944
|
const delimiter = `| ${alignments.map((align, at) => {
|
|
945
945
|
const width = widths[at];
|
|
946
946
|
switch (align) {
|
|
@@ -963,11 +963,11 @@ function table2(node) {
|
|
|
963
963
|
}).join(" | ")} |`;
|
|
964
964
|
return [line(header), delimiter, ...body.map((cells) => line(cells))].join("\n");
|
|
965
965
|
}
|
|
966
|
-
|
|
966
|
+
chunkL6DXCKVQ_cjs.__name(table2, "table");
|
|
967
967
|
function inline2(nodes, lineBreak) {
|
|
968
968
|
let out = "";
|
|
969
969
|
let runs = [];
|
|
970
|
-
const flush = /* @__PURE__ */
|
|
970
|
+
const flush = /* @__PURE__ */ chunkL6DXCKVQ_cjs.__name(() => {
|
|
971
971
|
out += marked2(runs);
|
|
972
972
|
runs = [];
|
|
973
973
|
}, "flush");
|
|
@@ -995,7 +995,7 @@ function inline2(nodes, lineBreak) {
|
|
|
995
995
|
flush();
|
|
996
996
|
return out;
|
|
997
997
|
}
|
|
998
|
-
|
|
998
|
+
chunkL6DXCKVQ_cjs.__name(inline2, "inline");
|
|
999
999
|
function marked2(runs) {
|
|
1000
1000
|
let out = "";
|
|
1001
1001
|
let index = 0;
|
|
@@ -1024,7 +1024,7 @@ function marked2(runs) {
|
|
|
1024
1024
|
}
|
|
1025
1025
|
return out;
|
|
1026
1026
|
}
|
|
1027
|
-
|
|
1027
|
+
chunkL6DXCKVQ_cjs.__name(marked2, "marked");
|
|
1028
1028
|
function applyMark2(mark, inner) {
|
|
1029
1029
|
switch (mark._type) {
|
|
1030
1030
|
case "entryLink": {
|
|
@@ -1058,36 +1058,36 @@ function applyMark2(mark, inner) {
|
|
|
1058
1058
|
}
|
|
1059
1059
|
}
|
|
1060
1060
|
}
|
|
1061
|
-
|
|
1061
|
+
chunkL6DXCKVQ_cjs.__name(applyMark2, "applyMark");
|
|
1062
1062
|
function delimit(delimiter, inner) {
|
|
1063
1063
|
const match = /^(\s*)([\s\S]*?)(\s*)$/.exec(inner);
|
|
1064
1064
|
const [, before = "", core = "", after = ""] = match;
|
|
1065
1065
|
if (core === "") return inner;
|
|
1066
1066
|
return `${before}${delimiter}${core}${delimiter}${after}`;
|
|
1067
1067
|
}
|
|
1068
|
-
|
|
1068
|
+
chunkL6DXCKVQ_cjs.__name(delimit, "delimit");
|
|
1069
1069
|
function codeSpan(text) {
|
|
1070
1070
|
const longest = Math.max(0, ...[...text.matchAll(/`+/g)].map((run) => run[0].length));
|
|
1071
1071
|
const fence = "`".repeat(longest + 1);
|
|
1072
1072
|
const padded = /^`|`$/.test(text) || /^ .*[^ ].* $/.test(text) ? ` ${text} ` : text;
|
|
1073
1073
|
return `${fence}${padded}${fence}`;
|
|
1074
1074
|
}
|
|
1075
|
-
|
|
1075
|
+
chunkL6DXCKVQ_cjs.__name(codeSpan, "codeSpan");
|
|
1076
1076
|
function destination(href) {
|
|
1077
1077
|
if (!/[\s()<>]/.test(href)) return href;
|
|
1078
1078
|
return `<${href.replace(/</g, "%3C").replace(/>/g, "%3E").replace(/\s/g, "%20")}>`;
|
|
1079
1079
|
}
|
|
1080
|
-
|
|
1080
|
+
chunkL6DXCKVQ_cjs.__name(destination, "destination");
|
|
1081
1081
|
function escapeText(text) {
|
|
1082
1082
|
return String(text).replace(/[\\`*_[\]<>~]/g, "\\$&").replace(/&(?=#?[\da-z]+;)/gi, "\\&");
|
|
1083
1083
|
}
|
|
1084
|
-
|
|
1084
|
+
chunkL6DXCKVQ_cjs.__name(escapeText, "escapeText");
|
|
1085
1085
|
function escapeLineStarts(paragraph) {
|
|
1086
1086
|
return paragraph.split("\n").map(
|
|
1087
1087
|
(line) => line.replace(/^(#{1,6})(?=\s|$)/, "\\$1").replace(/^([+=-])/, "\\$1").replace(/^(\d+)([).])/, "$1\\$2")
|
|
1088
1088
|
).join("\n");
|
|
1089
1089
|
}
|
|
1090
|
-
|
|
1090
|
+
chunkL6DXCKVQ_cjs.__name(escapeLineStarts, "escapeLineStarts");
|
|
1091
1091
|
|
|
1092
1092
|
exports.RICH_TEXT_VOID_TAGS = RICH_TEXT_VOID_TAGS;
|
|
1093
1093
|
exports.entryHeadingAnchors = entryHeadingAnchors;
|
|
@@ -1102,5 +1102,5 @@ exports.richTextHeadingSlug = richTextHeadingSlug;
|
|
|
1102
1102
|
exports.richTextToHtml = richTextToHtml;
|
|
1103
1103
|
exports.richTextToMarkdown = richTextToMarkdown;
|
|
1104
1104
|
exports.safeRichTextHref = safeRichTextHref;
|
|
1105
|
-
//# sourceMappingURL=chunk-
|
|
1106
|
-
//# sourceMappingURL=chunk-
|
|
1105
|
+
//# sourceMappingURL=chunk-2SPPU2WG.cjs.map
|
|
1106
|
+
//# sourceMappingURL=chunk-2SPPU2WG.cjs.map
|