@bendyline/squisq 2.13.14 → 2.13.16

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.
Files changed (43) hide show
  1. package/dist/{Doc-BhvotZx_.d.ts → Doc-DLfTam0R.d.ts} +82 -6
  2. package/dist/{ImageEditDoc-D8hYio6b.d.ts → ImageEditDoc-DdSHb6sj.d.ts} +1 -1
  3. package/dist/{chunk-YQQWE4HG.js → chunk-33CAD575.js} +200 -262
  4. package/dist/{chunk-L7QZORLB.js → chunk-37RLFDIT.js} +11 -4
  5. package/dist/chunk-4R3YZTPX.js +42 -0
  6. package/dist/{chunk-DBVCSVNV.js → chunk-A4ZFYGU6.js} +13 -38
  7. package/dist/{chunk-CTT4XAGO.js → chunk-BG2OYBGC.js} +2534 -737
  8. package/dist/{chunk-2SRF5III.js → chunk-BVL3F64S.js} +1 -1
  9. package/dist/chunk-C7DKMO4H.js +88 -0
  10. package/dist/{chunk-SGNWO7OF.js → chunk-MA7XUCSQ.js} +517 -30
  11. package/dist/{chunk-JSGIWW35.js → chunk-MTIR5PWF.js} +1 -1
  12. package/dist/{chunk-C4SB3NN4.js → chunk-NBDF6SQ5.js} +22 -2
  13. package/dist/chunk-TOPEP5B7.js +515 -0
  14. package/dist/{chunk-OIQ2GO2O.js → chunk-TXN23SG2.js} +1 -1
  15. package/dist/{chunk-7MS26OXD.js → chunk-UDPPWYYM.js} +6 -0
  16. package/dist/{chunk-J2G6EOEJ.js → chunk-XY5Z23C4.js} +75 -16
  17. package/dist/{chunk-5DFFVW75.js → chunk-Z73DG6IL.js} +1 -1
  18. package/dist/doc/index.d.ts +412 -26
  19. package/dist/doc/index.js +66 -11
  20. package/dist/fence/index.d.ts +1 -1
  21. package/dist/generate/index.d.ts +1 -1
  22. package/dist/imageEdit/index.d.ts +3 -3
  23. package/dist/index.d.ts +9 -9
  24. package/dist/index.js +147 -29
  25. package/dist/jsonForm/index.d.ts +1 -1
  26. package/dist/jsonForm/index.js +5 -4
  27. package/dist/markdown/index.js +3 -3
  28. package/dist/{materializePageSection-CWxou4mX.d.ts → materializePageSection-HIoRYiZu.d.ts} +121 -8
  29. package/dist/mediaEdit/index.d.ts +154 -3
  30. package/dist/mediaEdit/index.js +241 -2
  31. package/dist/narration/index.d.ts +1 -1
  32. package/dist/narration/index.js +7 -5
  33. package/dist/recommend/index.d.ts +129 -2
  34. package/dist/recommend/index.js +13 -4
  35. package/dist/schemas/index.d.ts +26 -7
  36. package/dist/schemas/index.js +14 -8
  37. package/dist/{themeLibrary-BIYE6aLw.d.ts → themeLibrary-B2K-aAOy.d.ts} +1 -1
  38. package/dist/timing/index.d.ts +66 -2
  39. package/dist/timing/index.js +12 -0
  40. package/dist/transform/index.d.ts +173 -16
  41. package/dist/transform/index.js +58 -17
  42. package/package.json +1 -1
  43. package/dist/chunk-FCB6JLWB.js +0 -125
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-HKHOFTGM.js";
4
4
  import {
5
5
  applySavedPresentation
6
- } from "./chunk-YQQWE4HG.js";
6
+ } from "./chunk-33CAD575.js";
7
7
  import {
8
8
  SHAPE_NAMES,
9
9
  buildChartData,
@@ -28,11 +28,10 @@ import {
28
28
  placeLayersInRect,
29
29
  readCustomThemesFromFrontmatter,
30
30
  resolvePersistentLayers,
31
- splitConceptItem,
32
31
  templateRegistry,
33
32
  writeCustomTemplatesToFrontmatter,
34
33
  writeCustomThemesToFrontmatter
35
- } from "./chunk-CTT4XAGO.js";
34
+ } from "./chunk-BG2OYBGC.js";
36
35
  import {
37
36
  ASCII_TREE_VOCAB,
38
37
  ASCII_VOCAB,
@@ -43,6 +42,7 @@ import {
43
42
  cellWidth,
44
43
  deriveTemplateInputs,
45
44
  detectAsciiDiagram,
45
+ extractBlockquote,
46
46
  extractBodyPlainText,
47
47
  extractRichListItems,
48
48
  isHoriz,
@@ -52,17 +52,19 @@ import {
52
52
  isVert,
53
53
  parseAsciiDiagram,
54
54
  parseStandaloneAnnotation,
55
+ splitConceptItem,
56
+ splitStatItem,
55
57
  toCells,
56
58
  toGrid,
57
59
  traceBoxes
58
- } from "./chunk-SGNWO7OF.js";
60
+ } from "./chunk-MA7XUCSQ.js";
59
61
  import {
60
62
  iconMarker
61
63
  } from "./chunk-7ZAAICW4.js";
62
64
  import {
63
65
  defaultPageStyle,
64
66
  resolveMediaSchedule
65
- } from "./chunk-2SRF5III.js";
67
+ } from "./chunk-BVL3F64S.js";
66
68
  import {
67
69
  DEFAULT_THEME,
68
70
  FRONTMATTER_CUSTOM_TEMPLATES_KEY,
@@ -82,25 +84,26 @@ import {
82
84
  } from "./chunk-JNUNNQ74.js";
83
85
  import {
84
86
  createMediaTimeMap
85
- } from "./chunk-JSGIWW35.js";
87
+ } from "./chunk-MTIR5PWF.js";
86
88
  import {
87
89
  serializeMediaEdits
88
- } from "./chunk-L7QZORLB.js";
90
+ } from "./chunk-37RLFDIT.js";
89
91
  import {
90
92
  parseMarkdown
91
- } from "./chunk-C4SB3NN4.js";
93
+ } from "./chunk-NBDF6SQ5.js";
92
94
  import {
93
95
  TABLE_FED_TEMPLATES,
94
96
  TEMPLATE_ALIASES,
95
97
  isContainerTemplate,
96
98
  resolveTemplateName
97
- } from "./chunk-7MS26OXD.js";
99
+ } from "./chunk-UDPPWYYM.js";
98
100
  import {
99
101
  KNOWN_BLOCK_META_KEYS,
100
102
  coerceAnnotationValues,
101
103
  extractPlainText,
102
104
  findBlockVideoEmbed,
103
105
  getChildren,
106
+ isHtmlLineBreak,
104
107
  isVideoEmbedUrl,
105
108
  parseHtmlToNodes,
106
109
  parseVideoEmbedUrl,
@@ -853,8 +856,11 @@ function extractRichText(node) {
853
856
  if ("value" in node && typeof node.value === "string") {
854
857
  return node.value;
855
858
  }
859
+ if (node.type === "break") return "\n";
860
+ if (node.type === "htmlInline" && isHtmlLineBreak(node.rawHtml))
861
+ return "\n";
856
862
  const children = getChildren(node);
857
- const separator = node.type === "list" || node.type === "listItem" ? "\n" : "";
863
+ const separator = node.type === "list" || node.type === "listItem" || node.type === "table" ? "\n" : node.type === "tableRow" ? " " : "";
858
864
  return children.map(extractRichText).join(separator);
859
865
  }
860
866
  function extractBodyText(contents) {
@@ -938,14 +944,20 @@ function collectAllDocImages(blocks) {
938
944
  }
939
945
  function getTemplateDefaults(templateName, headingText, block) {
940
946
  const body = extractBodyText(block.contents);
947
+ const hasBody2 = (block.contents?.length ?? 0) > 0;
941
948
  switch (templateName) {
942
949
  case "statHighlight":
943
950
  return deriveTemplateInputs(templateName, headingText, block.contents) ?? {
944
951
  stat: headingText,
945
952
  description: body || headingText
946
953
  };
947
- case "quote":
948
- return { quote: body || headingText };
954
+ case "quote": {
955
+ const quoted = extractBlockquote(block.contents);
956
+ return quoted.text ? {
957
+ quote: quoted.text,
958
+ ...quoted.attribution ? { attribution: quoted.attribution } : {}
959
+ } : { quote: body || headingText };
960
+ }
949
961
  case "fullBleedQuote":
950
962
  case "pullQuote":
951
963
  return deriveTemplateInputs(templateName, headingText, block.contents) ?? {
@@ -954,14 +966,27 @@ function getTemplateDefaults(templateName, headingText, block) {
954
966
  case "factCard":
955
967
  return { fact: headingText, explanation: body || headingText };
956
968
  case "comparisonBar":
957
- return { leftLabel: "A", leftValue: 60, rightLabel: "B", rightValue: 40 };
969
+ return hasBody2 ? {} : { leftLabel: "A", leftValue: 60, rightLabel: "B", rightValue: 40 };
958
970
  case "list":
959
- return deriveTemplateInputs(templateName, headingText, block.contents) ?? {
960
- items: ["Item 1", "Item 2", "Item 3"]
961
- };
971
+ return deriveTemplateInputs(templateName, headingText, block.contents) ?? (hasBody2 ? {} : { items: ["Item 1", "Item 2", "Item 3"] });
972
+ case "transcript":
973
+ return deriveTemplateInputs(templateName, headingText, block.contents) ?? {};
974
+ case "twoColumn":
975
+ return deriveTemplateInputs(templateName, headingText, block.contents) ?? {};
962
976
  case "videoWithCaption":
963
977
  case "videoPullQuote":
964
978
  return deriveTemplateInputs(templateName, headingText, block.contents) ?? {};
979
+ case "cards":
980
+ case "process":
981
+ case "cycle":
982
+ case "layers":
983
+ case "stats":
984
+ case "pyramid":
985
+ case "funnel":
986
+ case "hub":
987
+ case "venn":
988
+ case "matrix":
989
+ return deriveTemplateInputs(templateName, headingText, block.contents) ?? {};
965
990
  case "definitionCard":
966
991
  return { term: headingText, definition: body || headingText };
967
992
  case "dateEvent":
@@ -1276,6 +1301,10 @@ function bodyRichText(input) {
1276
1301
  const text = contents.map((node) => extractPlainText(node)).join("\n").trim();
1277
1302
  return text ? { text, markdown: contents } : void 0;
1278
1303
  }
1304
+ function asProse(input, heading) {
1305
+ const title2 = input.title ?? heading;
1306
+ return { kind: "prose", slots: { title: title2, body: bodyRichText(input) } };
1307
+ }
1279
1308
  function accentImageMedia(accent) {
1280
1309
  if (!accent?.src) return void 0;
1281
1310
  return {
@@ -1360,6 +1389,7 @@ var statHighlight = (input) => {
1360
1389
  kind: "stat-band",
1361
1390
  variant: "single",
1362
1391
  slots: {
1392
+ title: s.headline,
1363
1393
  items: [{ value: s.stat, title: s.description, body: s.detail }],
1364
1394
  media: accentImageMedia(s.accentImage)
1365
1395
  },
@@ -1395,6 +1425,7 @@ var factCard = (input) => {
1395
1425
  };
1396
1426
  var twoColumn = (input) => {
1397
1427
  const t = input;
1428
+ if (!t.left?.label || !t.right?.label) return asProse(input, t.header);
1398
1429
  return {
1399
1430
  kind: "card-grid",
1400
1431
  variant: "two-column",
@@ -1424,6 +1455,7 @@ var dateEvent = (input) => {
1424
1455
  };
1425
1456
  var imageWithCaption = (input) => {
1426
1457
  const i = input;
1458
+ if (!i.imageSrc) return asProse(input, i.caption);
1427
1459
  const media = {
1428
1460
  type: "image",
1429
1461
  src: i.imageSrc,
@@ -1478,6 +1510,7 @@ var fullBleedQuote = (input) => {
1478
1510
  var list = (input) => {
1479
1511
  const l = input;
1480
1512
  const contents = input.contents;
1513
+ if (!l.items?.length) return asProse(input, l.title);
1481
1514
  const richItems = extractRichListItems(contents);
1482
1515
  return {
1483
1516
  kind: "item-list",
@@ -1494,6 +1527,7 @@ var list = (input) => {
1494
1527
  };
1495
1528
  var concept = (input) => {
1496
1529
  const c = input;
1530
+ if (!c.items?.length) return asProse(input, c.title);
1497
1531
  return {
1498
1532
  kind: "item-list",
1499
1533
  slots: {
@@ -1506,6 +1540,22 @@ var concept = (input) => {
1506
1540
  colorScheme: c.colorScheme
1507
1541
  };
1508
1542
  };
1543
+ var stats = (input, ctx) => {
1544
+ const s = input;
1545
+ const items = (s.items ?? []).map((item) => splitStatItem(String(item ?? "")));
1546
+ if (!items.some((item) => item.figure)) return concept(input, ctx);
1547
+ return {
1548
+ kind: "stat-band",
1549
+ variant: "row",
1550
+ slots: {
1551
+ title: s.title,
1552
+ items: items.map(
1553
+ (item) => item.figure ? { value: item.figure, title: item.caption } : { title: item.caption }
1554
+ )
1555
+ },
1556
+ colorScheme: s.colorScheme
1557
+ };
1558
+ };
1509
1559
  var photoGrid = (input) => {
1510
1560
  const p = input;
1511
1561
  const images = p.images ?? [];
@@ -1546,6 +1596,8 @@ var definitionCard = (input) => {
1546
1596
  };
1547
1597
  var comparisonBar = (input) => {
1548
1598
  const c = input;
1599
+ if (!c.leftLabel && !c.rightLabel && !Number.isFinite(c.leftValue) && !Number.isFinite(c.rightValue))
1600
+ return asProse(input);
1549
1601
  return {
1550
1602
  kind: "stat-band",
1551
1603
  variant: "comparison",
@@ -1577,6 +1629,7 @@ var pullQuote = (input) => {
1577
1629
  };
1578
1630
  var videoWithCaption = (input) => {
1579
1631
  const v = input;
1632
+ if (!v.videoSrc) return asProse(input, v.caption);
1580
1633
  if (isVideoEmbedUrl(v.videoSrc)) {
1581
1634
  return {
1582
1635
  kind: "media-figure",
@@ -1682,6 +1735,12 @@ var sectionExtractors = {
1682
1735
  process: concept,
1683
1736
  cycle: concept,
1684
1737
  layers: concept,
1738
+ stats,
1739
+ pyramid: concept,
1740
+ funnel: concept,
1741
+ hub: concept,
1742
+ venn: concept,
1743
+ matrix: concept,
1685
1744
  photoGrid,
1686
1745
  definitionCard,
1687
1746
  comparisonBar,
@@ -3,7 +3,7 @@ import {
3
3
  parseMarkdown,
4
4
  remarkWikiLinks,
5
5
  toMdast
6
- } from "./chunk-C4SB3NN4.js";
6
+ } from "./chunk-NBDF6SQ5.js";
7
7
  import {
8
8
  formatFrontmatterYaml,
9
9
  getChildren,