@bendyline/squisq 2.3.2 → 2.4.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/dist/{Doc-BrgZC7SE.d.ts → Doc-DLpyOAXJ.d.ts} +87 -2
- package/dist/{ImageEditDoc-rum0Xb9P.d.ts → ImageEditDoc-Cu30xb9b.d.ts} +1 -1
- package/dist/{chunk-2ZWIXGAC.js → chunk-2S74DPJH.js} +4 -0
- package/dist/{chunk-ZQKZSJAX.js → chunk-2VCNTDNZ.js} +245 -0
- package/dist/{chunk-RS5AP3J4.js → chunk-AE3IUKMM.js} +1 -1
- package/dist/{chunk-QWCFK5FN.js → chunk-CUYHFOFL.js} +5 -1
- package/dist/{chunk-ACZOVWX3.js → chunk-D4LPP3P5.js} +44 -15
- package/dist/{chunk-CKZY6K5R.js → chunk-F2IEPSMA.js} +2565 -1143
- package/dist/{chunk-ZAFLMJPD.js → chunk-KPBZZVGY.js} +37 -7
- package/dist/{chunk-BCCXTMN5.js → chunk-O7JILDEF.js} +7 -0
- package/dist/{chunk-SPTY4C6F.js → chunk-REDUXXDJ.js} +1 -1
- package/dist/{chunk-BCHAXKKI.js → chunk-ZHLNKB2I.js} +1 -1
- package/dist/chunk-ZYO3DBTA.js +983 -0
- package/dist/doc/index.d.ts +111 -6
- package/dist/doc/index.js +11 -7
- package/dist/generate/index.d.ts +1 -1
- package/dist/imageEdit/index.d.ts +3 -3
- package/dist/index.d.ts +6 -6
- package/dist/index.js +34 -14
- package/dist/jsonForm/index.d.ts +1 -1
- package/dist/jsonForm/index.js +2 -2
- package/dist/markdown/index.d.ts +118 -1
- package/dist/markdown/index.js +24 -8
- package/dist/{materializePageSection-DAbyLi-k.d.ts → materializePageSection-CgNs5Qmw.d.ts} +4 -2
- package/dist/narration/index.d.ts +1 -1
- package/dist/narration/index.js +5 -5
- package/dist/recommend/index.js +2 -2
- package/dist/schemas/index.d.ts +4 -4
- package/dist/schemas/index.js +2 -2
- package/dist/{themeLibrary-DJt89gyP.d.ts → themeLibrary-RWsNtlOu.d.ts} +1 -1
- package/dist/transform/index.d.ts +2 -2
- package/dist/transform/index.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-3IGPAPQ7.js +0 -645
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SHAPE_NAMES,
|
|
3
3
|
TEMPLATE_ALIASES,
|
|
4
|
+
buildChartData,
|
|
4
5
|
buildNarrationScript,
|
|
5
6
|
coerceTemplateParams,
|
|
6
7
|
deriveTemplateInputs,
|
|
7
8
|
extractBodyPlainText,
|
|
9
|
+
extractRichListItems,
|
|
8
10
|
flattenBlocks,
|
|
9
11
|
flattenRenderableBlocks,
|
|
10
12
|
getBlockBodyText,
|
|
@@ -24,7 +26,7 @@ import {
|
|
|
24
26
|
templateRegistry,
|
|
25
27
|
writeCustomTemplatesToFrontmatter,
|
|
26
28
|
writeCustomThemesToFrontmatter
|
|
27
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-F2IEPSMA.js";
|
|
28
30
|
import {
|
|
29
31
|
ASCII_TREE_VOCAB,
|
|
30
32
|
ASCII_VOCAB,
|
|
@@ -40,11 +42,11 @@ import {
|
|
|
40
42
|
toCells,
|
|
41
43
|
toGrid,
|
|
42
44
|
traceBoxes
|
|
43
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-CUYHFOFL.js";
|
|
44
46
|
import {
|
|
45
47
|
defaultPageStyle,
|
|
46
48
|
resolveMediaSchedule
|
|
47
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-2S74DPJH.js";
|
|
48
50
|
import {
|
|
49
51
|
DEFAULT_THEME,
|
|
50
52
|
FRONTMATTER_CUSTOM_TEMPLATES_KEY,
|
|
@@ -59,17 +61,18 @@ import {
|
|
|
59
61
|
} from "./chunk-BAOV476U.js";
|
|
60
62
|
import {
|
|
61
63
|
parseMarkdown
|
|
62
|
-
} from "./chunk-
|
|
64
|
+
} from "./chunk-D4LPP3P5.js";
|
|
63
65
|
import {
|
|
64
66
|
KNOWN_BLOCK_META_KEYS,
|
|
65
67
|
coerceAnnotationValues,
|
|
66
68
|
serializeAnnotation
|
|
67
|
-
} from "./chunk-
|
|
69
|
+
} from "./chunk-2VCNTDNZ.js";
|
|
68
70
|
import {
|
|
69
71
|
extractPlainText,
|
|
70
72
|
getChildren,
|
|
73
|
+
parseHtmlToNodes,
|
|
71
74
|
readFrontmatterThemeId
|
|
72
|
-
} from "./chunk-
|
|
75
|
+
} from "./chunk-O7JILDEF.js";
|
|
73
76
|
import {
|
|
74
77
|
estimateTimeFromText
|
|
75
78
|
} from "./chunk-67L6WRJN.js";
|
|
@@ -414,10 +417,19 @@ function synthesizeAnnotationParagraph(block) {
|
|
|
414
417
|
return { type: "paragraph", children: [{ type: "text", value: text }] };
|
|
415
418
|
}
|
|
416
419
|
function synthesizeMediaParagraph(clip) {
|
|
420
|
+
if (clip.origin?.format === "html" && clip.origin.raw) {
|
|
421
|
+
return {
|
|
422
|
+
type: "htmlBlock",
|
|
423
|
+
rawHtml: clip.origin.raw,
|
|
424
|
+
htmlChildren: parseHtmlToNodes(clip.origin.raw)
|
|
425
|
+
};
|
|
426
|
+
}
|
|
417
427
|
if (clip.origin?.raw) {
|
|
418
428
|
return { type: "paragraph", children: [{ type: "text", value: clip.origin.raw }] };
|
|
419
429
|
}
|
|
420
430
|
const params = { src: clip.src };
|
|
431
|
+
if (clip.placement) params.placement = clip.placement;
|
|
432
|
+
if (clip.lockToBlock != null) params.lockToBlock = String(clip.lockToBlock);
|
|
421
433
|
if (clip.anchor === "document") params.anchor = "document";
|
|
422
434
|
if (clip.startAt) params.startAt = String(clip.startAt);
|
|
423
435
|
if (clip.clipStart != null) params.clipStart = String(clip.clipStart);
|
|
@@ -763,11 +775,16 @@ var fullBleedQuote = (input) => {
|
|
|
763
775
|
};
|
|
764
776
|
var list = (input) => {
|
|
765
777
|
const l = input;
|
|
778
|
+
const contents = input.contents;
|
|
779
|
+
const richItems = extractRichListItems(contents);
|
|
766
780
|
return {
|
|
767
781
|
kind: "item-list",
|
|
768
782
|
slots: {
|
|
769
783
|
title: l.title,
|
|
770
|
-
items: (l.items ?? []).map((item) => ({
|
|
784
|
+
items: (l.items ?? []).map((item, index) => ({
|
|
785
|
+
body: item,
|
|
786
|
+
...richItems[index]?.text === item ? { markdown: richItems[index].markdown } : {}
|
|
787
|
+
})),
|
|
771
788
|
media: accentImageMedia(l.accentImage)
|
|
772
789
|
},
|
|
773
790
|
colorScheme: l.colorScheme
|
|
@@ -897,6 +914,12 @@ var dataTable = (input) => {
|
|
|
897
914
|
colorScheme: d.colorScheme
|
|
898
915
|
};
|
|
899
916
|
};
|
|
917
|
+
var chartExtractor = (input, ctx) => {
|
|
918
|
+
const chart = input;
|
|
919
|
+
const chartable = Array.isArray(chart.headers) && Array.isArray(chart.rows) && buildChartData({ headers: chart.headers, rows: chart.rows }, chart) !== null;
|
|
920
|
+
if (chartable) return canvasDraft("chart", ctx, input);
|
|
921
|
+
return content(input, ctx);
|
|
922
|
+
};
|
|
900
923
|
var diagram = (input, ctx) => canvasDraft("diagram", ctx, input);
|
|
901
924
|
var tree = (input, ctx) => canvasDraft("tree", ctx, input);
|
|
902
925
|
var timeline = (input, ctx) => canvasDraft("timeline", ctx, input);
|
|
@@ -925,6 +948,13 @@ var sectionExtractors = {
|
|
|
925
948
|
videoWithCaption,
|
|
926
949
|
videoPullQuote,
|
|
927
950
|
dataTable,
|
|
951
|
+
barChart: chartExtractor,
|
|
952
|
+
columnChart: chartExtractor,
|
|
953
|
+
pieChart: chartExtractor,
|
|
954
|
+
donutChart: chartExtractor,
|
|
955
|
+
lineChart: chartExtractor,
|
|
956
|
+
areaChart: chartExtractor,
|
|
957
|
+
scatterChart: chartExtractor,
|
|
928
958
|
diagram,
|
|
929
959
|
tree,
|
|
930
960
|
timeline,
|
|
@@ -440,6 +440,12 @@ function formatBlockScalar(value) {
|
|
|
440
440
|
${body}`;
|
|
441
441
|
}
|
|
442
442
|
var FRONTMATTER_BLOCK_RE = /^---\r?\n([\s\S]*?)\r?\n---(\r?\n)?/;
|
|
443
|
+
var EMPTY_FRONTMATTER_BLOCK_RE = /^---\r?\n---(\r?\n)?/;
|
|
444
|
+
function splitFrontmatterBlock(source) {
|
|
445
|
+
const match = FRONTMATTER_BLOCK_RE.exec(source) ?? EMPTY_FRONTMATTER_BLOCK_RE.exec(source);
|
|
446
|
+
if (!match) return { frontmatter: null, body: source };
|
|
447
|
+
return { frontmatter: match[0], body: source.slice(match[0].length) };
|
|
448
|
+
}
|
|
443
449
|
function formatFrontmatterValue(value) {
|
|
444
450
|
if (typeof value === "boolean" || typeof value === "number") return String(value);
|
|
445
451
|
if (/[\r\n]/.test(value)) return formatBlockScalar(value.replace(/\r\n?/g, "\n"));
|
|
@@ -689,6 +695,7 @@ export {
|
|
|
689
695
|
countNodes,
|
|
690
696
|
parseFrontmatter,
|
|
691
697
|
formatBlockScalar,
|
|
698
|
+
splitFrontmatterBlock,
|
|
692
699
|
formatFrontmatterValue,
|
|
693
700
|
formatFrontmatterYaml,
|
|
694
701
|
setFrontmatterValues,
|