@bendyline/squisq 1.4.1 → 1.5.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.
Files changed (216) hide show
  1. package/dist/{Doc-BeSeH2iX.d.ts → Doc-BsMkmzH8.d.ts} +838 -268
  2. package/dist/{ImageEditDoc-BTIvw0oq.d.ts → ImageEditDoc-DvoeHMP9.d.ts} +11 -4
  3. package/dist/{chunk-ZTX4PFFT.js → chunk-2OIBZYKP.js} +75 -2
  4. package/dist/chunk-2OIBZYKP.js.map +1 -0
  5. package/dist/chunk-2UQOHYE2.js +45 -0
  6. package/dist/chunk-2UQOHYE2.js.map +1 -0
  7. package/dist/{chunk-B4EEON3N.js → chunk-4AKUQPEE.js} +536 -103
  8. package/dist/chunk-4AKUQPEE.js.map +1 -0
  9. package/dist/chunk-4ZFRZBU2.js +6582 -0
  10. package/dist/chunk-4ZFRZBU2.js.map +1 -0
  11. package/dist/{chunk-57CVQCFX.js → chunk-7MQGNR76.js} +79 -3
  12. package/dist/chunk-7MQGNR76.js.map +1 -0
  13. package/dist/{chunk-5WFRKURX.js → chunk-DLXZMS5K.js} +4 -2
  14. package/dist/chunk-DLXZMS5K.js.map +1 -0
  15. package/dist/{chunk-MYIH7FWD.js → chunk-FBKP5CAO.js} +1 -1
  16. package/dist/chunk-FBKP5CAO.js.map +1 -0
  17. package/dist/chunk-KZNXZ5SM.js +333 -0
  18. package/dist/chunk-KZNXZ5SM.js.map +1 -0
  19. package/dist/{chunk-WMOI7FN3.js → chunk-LRCV7N7F.js} +12 -2
  20. package/dist/{chunk-WMOI7FN3.js.map → chunk-LRCV7N7F.js.map} +1 -1
  21. package/dist/{chunk-3K5OG6KI.js → chunk-OH43RPTP.js} +403 -187
  22. package/dist/chunk-OH43RPTP.js.map +1 -0
  23. package/dist/{chunk-H3AXU4MJ.js → chunk-OKJOQXK4.js} +149 -2
  24. package/dist/chunk-OKJOQXK4.js.map +1 -0
  25. package/dist/chunk-PGGGKYWG.js +1 -0
  26. package/dist/chunk-PGGGKYWG.js.map +1 -0
  27. package/dist/{chunk-7UDSRZKG.js → chunk-Q3ROPT5H.js} +35 -14
  28. package/dist/chunk-Q3ROPT5H.js.map +1 -0
  29. package/dist/chunk-QE7TWGVT.js +178 -0
  30. package/dist/chunk-QE7TWGVT.js.map +1 -0
  31. package/dist/chunk-RUDYOTA6.js +345 -0
  32. package/dist/chunk-RUDYOTA6.js.map +1 -0
  33. package/dist/chunk-TVSGLUID.js +596 -0
  34. package/dist/chunk-TVSGLUID.js.map +1 -0
  35. package/dist/chunk-ZLQKNOZQ.js +1 -0
  36. package/dist/chunk-ZLQKNOZQ.js.map +1 -0
  37. package/dist/doc/index.d.ts +4 -4
  38. package/dist/doc/index.js +124 -6
  39. package/dist/generate/index.d.ts +9 -2
  40. package/dist/generate/index.js +1 -1
  41. package/dist/icons/index.d.ts +3 -26
  42. package/dist/icons/index.js +13 -0
  43. package/dist/icons/inlineIconMarker.d.ts +1 -0
  44. package/dist/icons/inlineIconMarker.js +15 -0
  45. package/dist/icons/inlineIconMarker.js.map +1 -0
  46. package/dist/imageEdit/index.d.ts +11 -5
  47. package/dist/imageEdit/index.js +4 -1
  48. package/dist/index.d.ts +11 -8
  49. package/dist/index.js +243 -24
  50. package/dist/inlineIconMarker-CiE8Hlvz.d.ts +59 -0
  51. package/dist/markdown/index.d.ts +212 -3
  52. package/dist/markdown/index.js +40 -7
  53. package/dist/recommend/index.d.ts +1 -1
  54. package/dist/recommend/index.js +3 -2
  55. package/dist/schemas/index.d.ts +28 -8
  56. package/dist/schemas/index.js +35 -5
  57. package/dist/spatial/index.d.ts +9 -4
  58. package/dist/spatial/index.js +1 -1
  59. package/dist/story/index.d.ts +906 -40
  60. package/dist/story/index.js +124 -6
  61. package/dist/{themeLibrary-BHjJ0Qx6.d.ts → themeLibrary-DQQKuRMx.d.ts} +1 -1
  62. package/dist/transform/index.d.ts +48 -10
  63. package/dist/transform/index.js +17 -481
  64. package/dist/transform/index.js.map +1 -1
  65. package/dist/{types-BdZkdJ3z.d.ts → types-DlAZ7MW4.d.ts} +115 -1
  66. package/package.json +6 -1
  67. package/src/__tests__/animationUtils.test.ts +40 -0
  68. package/src/__tests__/annotationCoercion.test.ts +243 -0
  69. package/src/__tests__/applyRenderStyle.test.ts +146 -0
  70. package/src/__tests__/atmosphereLayers.test.ts +108 -0
  71. package/src/__tests__/attrTokens.test.ts +162 -0
  72. package/src/__tests__/customTemplateSample.test.ts +83 -0
  73. package/src/__tests__/customTemplatesFrontmatter.test.ts +205 -0
  74. package/src/__tests__/customThemesFrontmatter.test.ts +118 -0
  75. package/src/__tests__/diagramBlock.test.ts +122 -0
  76. package/src/__tests__/diagramLayout.test.ts +134 -0
  77. package/src/__tests__/drawing.test.ts +109 -0
  78. package/src/__tests__/drawingBlock.test.ts +124 -0
  79. package/src/__tests__/drawingLayout.test.ts +171 -0
  80. package/src/__tests__/geohash.test.ts +6 -5
  81. package/src/__tests__/getLayers.test.ts +6 -2
  82. package/src/__tests__/getLayersFallback.test.ts +103 -0
  83. package/src/__tests__/imageEditExportSvg.test.ts +70 -0
  84. package/src/__tests__/imageEditVersions.test.ts +72 -0
  85. package/src/__tests__/inlineIconMarker.test.ts +36 -0
  86. package/src/__tests__/layoutBlock.test.ts +83 -0
  87. package/src/__tests__/layoutLayout.test.ts +169 -0
  88. package/src/__tests__/markdown.test.ts +23 -0
  89. package/src/__tests__/markdownSanitize.test.ts +64 -0
  90. package/src/__tests__/markdownToDoc.test.ts +223 -2
  91. package/src/__tests__/mediaAnnotations.test.ts +64 -0
  92. package/src/__tests__/mediaSchedule.test.ts +118 -0
  93. package/src/__tests__/pandocAttrParse.test.ts +187 -0
  94. package/src/__tests__/resolveDocTheme.test.ts +55 -0
  95. package/src/__tests__/rootExports.test.ts +43 -0
  96. package/src/__tests__/shapeGeometry.test.ts +89 -0
  97. package/src/__tests__/shapeVocabulary.test.ts +133 -0
  98. package/src/__tests__/structuredData.test.ts +179 -0
  99. package/src/__tests__/templateAnnotationParse.test.ts +108 -0
  100. package/src/__tests__/templateMetadata.test.ts +21 -0
  101. package/src/__tests__/templates.test.ts +145 -4
  102. package/src/__tests__/themeCompile.test.ts +42 -0
  103. package/src/__tests__/themeValidator.test.ts +6 -0
  104. package/src/__tests__/transformV2.test.ts +137 -0
  105. package/src/__tests__/transitionNormalize.test.ts +61 -0
  106. package/src/__tests__/validateDoc.test.ts +100 -0
  107. package/src/doc/customTemplatesFrontmatter.ts +308 -0
  108. package/src/doc/customThemesFrontmatter.ts +90 -0
  109. package/src/doc/docToMarkdown.ts +73 -4
  110. package/src/doc/getLayers.ts +40 -17
  111. package/src/doc/index.ts +35 -1
  112. package/src/doc/markdownToDoc.ts +333 -12
  113. package/src/doc/mediaAnnotations.ts +118 -0
  114. package/src/doc/resolveDocTheme.ts +55 -0
  115. package/src/doc/structuredData.ts +230 -0
  116. package/src/doc/templateInputs.ts +240 -0
  117. package/src/doc/templates/__tests__/customTemplate.test.ts +151 -0
  118. package/src/doc/templates/__tests__/customTemplateRegistry.test.ts +110 -0
  119. package/src/doc/templates/accentImage.ts +30 -6
  120. package/src/doc/templates/captionUtils.ts +23 -0
  121. package/src/doc/templates/comparisonBar.ts +26 -18
  122. package/src/doc/templates/coverBlock.ts +7 -4
  123. package/src/doc/templates/customTemplate.ts +45 -0
  124. package/src/doc/templates/dataTable.ts +37 -19
  125. package/src/doc/templates/dateEvent.ts +41 -20
  126. package/src/doc/templates/definitionCard.ts +26 -18
  127. package/src/doc/templates/diagramBlock.ts +204 -0
  128. package/src/doc/templates/diagramLayout.ts +159 -0
  129. package/src/doc/templates/drawingBlock.ts +325 -0
  130. package/src/doc/templates/drawingLayout.ts +539 -0
  131. package/src/doc/templates/factCard.ts +51 -25
  132. package/src/doc/templates/fallbackBlock.ts +123 -0
  133. package/src/doc/templates/featureBlock.ts +20 -13
  134. package/src/doc/templates/fullBleedQuote.ts +18 -8
  135. package/src/doc/templates/imageWithCaption.ts +22 -9
  136. package/src/doc/templates/index.ts +215 -46
  137. package/src/doc/templates/layoutBlock.ts +43 -0
  138. package/src/doc/templates/layoutLayout.ts +243 -0
  139. package/src/doc/templates/listBlock.ts +56 -30
  140. package/src/doc/templates/mapBlock.ts +15 -12
  141. package/src/doc/templates/metadata.ts +120 -0
  142. package/src/doc/templates/persistentLayers.ts +129 -11
  143. package/src/doc/templates/photoGrid.ts +23 -12
  144. package/src/doc/templates/pullQuote.ts +30 -12
  145. package/src/doc/templates/quoteBlock.ts +54 -29
  146. package/src/doc/templates/sectionHeader.ts +25 -11
  147. package/src/doc/templates/statHighlight.ts +39 -22
  148. package/src/doc/templates/titleBlock.ts +59 -21
  149. package/src/doc/templates/tokens/__tests__/resolveTokens.test.ts +221 -0
  150. package/src/doc/templates/tokens/resolveTokens.ts +0 -0
  151. package/src/doc/templates/twoColumn.ts +48 -30
  152. package/src/doc/templates/videoPullQuote.ts +22 -12
  153. package/src/doc/templates/videoWithCaption.ts +13 -8
  154. package/src/doc/utils/animationUtils.ts +267 -3
  155. package/src/doc/utils/applyRenderStyle.ts +113 -0
  156. package/src/doc/utils/imageTreatment.ts +70 -0
  157. package/src/doc/utils/shapeGeometry.ts +464 -0
  158. package/src/doc/utils/themeUtils.ts +75 -1
  159. package/src/doc/validate.ts +476 -0
  160. package/src/generate/slideshowGenerator.ts +7 -0
  161. package/src/icons/index.ts +8 -0
  162. package/src/icons/inlineIconMarker.ts +73 -0
  163. package/src/imageEdit/export.ts +85 -2
  164. package/src/imageEdit/index.ts +1 -0
  165. package/src/imageEdit/persistence.ts +51 -0
  166. package/src/index.ts +2 -0
  167. package/src/markdown/annotationCoercion.ts +295 -0
  168. package/src/markdown/attrTokens.ts +222 -0
  169. package/src/markdown/convert.ts +229 -26
  170. package/src/markdown/index.ts +36 -0
  171. package/src/markdown/sanitize.ts +298 -0
  172. package/src/markdown/stringify.ts +84 -3
  173. package/src/markdown/types.ts +66 -0
  174. package/src/markdown/utils.ts +49 -1
  175. package/src/recommend/templates.ts +24 -0
  176. package/src/schemas/BlockTemplates.ts +133 -4
  177. package/src/schemas/CustomTemplates.ts +74 -0
  178. package/src/schemas/Doc.ts +353 -29
  179. package/src/schemas/ImageEditDoc.ts +11 -4
  180. package/src/schemas/Media.ts +169 -0
  181. package/src/schemas/Theme.ts +23 -1
  182. package/src/schemas/Transitions.ts +224 -0
  183. package/src/schemas/colorUtils.ts +33 -0
  184. package/src/schemas/fontStacks.ts +5 -2
  185. package/src/schemas/index.ts +3 -0
  186. package/src/schemas/themeCompile.ts +23 -4
  187. package/src/schemas/themeValidator.ts +49 -11
  188. package/src/schemas/themes/cinematic.json +69 -12
  189. package/src/schemas/themes/documentary.json +58 -11
  190. package/src/schemas/themes/gezellig.json +60 -11
  191. package/src/schemas/themes/magazine.json +54 -9
  192. package/src/schemas/themes/morning-light.json +52 -9
  193. package/src/schemas/themes/standard-dark.json +48 -13
  194. package/src/schemas/themes/standard.json +44 -12
  195. package/src/schemas/themes/tech-dark.json +65 -12
  196. package/src/spatial/Geohash.ts +52 -21
  197. package/src/transform/applyTransform.ts +43 -4
  198. package/src/transform/index.ts +1 -0
  199. package/src/transform/registry.ts +44 -13
  200. package/src/transform/styles/dataDriven.ts +2 -1
  201. package/src/transform/styles/documentary.ts +2 -1
  202. package/src/transform/styles/magazine.ts +3 -1
  203. package/src/transform/styles/minimal.ts +2 -1
  204. package/src/transform/styles/narrative.ts +3 -1
  205. package/src/transform/templateSelector.ts +87 -11
  206. package/src/transform/types.ts +35 -2
  207. package/dist/chunk-3K5OG6KI.js.map +0 -1
  208. package/dist/chunk-57CVQCFX.js.map +0 -1
  209. package/dist/chunk-5WFRKURX.js.map +0 -1
  210. package/dist/chunk-7UDSRZKG.js.map +0 -1
  211. package/dist/chunk-B4EEON3N.js.map +0 -1
  212. package/dist/chunk-H3AXU4MJ.js.map +0 -1
  213. package/dist/chunk-KSWJR66U.js +0 -3706
  214. package/dist/chunk-KSWJR66U.js.map +0 -1
  215. package/dist/chunk-MYIH7FWD.js.map +0 -1
  216. package/dist/chunk-ZTX4PFFT.js.map +0 -1
@@ -0,0 +1,178 @@
1
+ // src/schemas/Transitions.ts
2
+ var DEFAULT_TRANSITION_DURATION_SECONDS = 0.7;
3
+ var TRANSITION_TYPES = [
4
+ // Existing / common transitions
5
+ "cut",
6
+ "fade",
7
+ "dissolve",
8
+ "push",
9
+ "wipe",
10
+ "split",
11
+ "reveal",
12
+ "randomBars",
13
+ "shape",
14
+ "uncover",
15
+ "cover",
16
+ "zoom",
17
+ "pan",
18
+ // PowerPoint subtle / exciting transitions
19
+ "flash",
20
+ "fallOver",
21
+ "drape",
22
+ "curtains",
23
+ "wind",
24
+ "prestige",
25
+ "fracture",
26
+ "crush",
27
+ "peelOff",
28
+ "pageCurl",
29
+ "airplane",
30
+ "origami",
31
+ "checkerboard",
32
+ "blinds",
33
+ "clock",
34
+ "ripple",
35
+ "honeycomb",
36
+ "glitter",
37
+ "vortex",
38
+ "shred",
39
+ "switch",
40
+ "flip",
41
+ "gallery",
42
+ "cube",
43
+ "doors",
44
+ "box",
45
+ "ferrisWheel",
46
+ "conveyor",
47
+ "rotate",
48
+ "window",
49
+ "orbit",
50
+ "flyThrough",
51
+ "morph",
52
+ // PresentationML/Open XML precise names and legacy aliases
53
+ "checker",
54
+ "circle",
55
+ "comb",
56
+ "diamond",
57
+ "newsflash",
58
+ "plus",
59
+ "pull",
60
+ "random",
61
+ "randomBar",
62
+ "strips",
63
+ "wedge",
64
+ "wheel",
65
+ "prism",
66
+ "warp",
67
+ "ferris",
68
+ "flythrough",
69
+ "wheelReverse",
70
+ "pageCurlDouble",
71
+ "pageCurlSingle",
72
+ "slideLeft",
73
+ "slideRight",
74
+ "slideUp",
75
+ "slideDown"
76
+ ];
77
+ var TRANSITION_DIRECTIONS = [
78
+ "left",
79
+ "right",
80
+ "up",
81
+ "down",
82
+ "in",
83
+ "out",
84
+ "horizontal",
85
+ "vertical"
86
+ ];
87
+ var TRANSITION_TYPE_SET = new Set(TRANSITION_TYPES);
88
+ var TRANSITION_TYPE_ALIASES = {
89
+ none: "cut",
90
+ randombars: "randomBars",
91
+ randombar: "randomBar",
92
+ // Self-referential spellings (`checkerboard`, `shape`, `uncover`) are
93
+ // intentionally absent: an exact valid type returns early from
94
+ // `normalizeTransitionType`, and any case variant resolves through
95
+ // `NORMALIZED_TRANSITION_TYPES`. Only the *plural* aliases need an entry.
96
+ checkerboards: "checkerboard",
97
+ shapes: "shape",
98
+ ferris: "ferrisWheel",
99
+ ferriswheel: "ferrisWheel",
100
+ flythrough: "flyThrough",
101
+ flythru: "flyThrough",
102
+ pagecurl: "pageCurl",
103
+ pagecurldouble: "pageCurlDouble",
104
+ pagecurlsingle: "pageCurlSingle",
105
+ wheelreverse: "wheelReverse",
106
+ slideleft: "slideLeft",
107
+ slideright: "slideRight",
108
+ slideup: "slideUp",
109
+ slidedown: "slideDown"
110
+ };
111
+ var NORMALIZED_TRANSITION_TYPES = new Map(
112
+ TRANSITION_TYPES.map((type) => [normalizeToken(type), type])
113
+ );
114
+ function isTransitionType(value) {
115
+ return TRANSITION_TYPE_SET.has(value);
116
+ }
117
+ function normalizeTransitionType(value) {
118
+ const trimmed = value.trim();
119
+ if (!trimmed) return null;
120
+ if (isTransitionType(trimmed)) return trimmed;
121
+ const normalized = normalizeToken(trimmed);
122
+ return TRANSITION_TYPE_ALIASES[normalized] ?? NORMALIZED_TRANSITION_TYPES.get(normalized) ?? null;
123
+ }
124
+ function normalizeTransitionDirection(value) {
125
+ const normalized = normalizeToken(value);
126
+ switch (normalized) {
127
+ case "left":
128
+ case "l":
129
+ return "left";
130
+ case "right":
131
+ case "r":
132
+ return "right";
133
+ case "up":
134
+ case "u":
135
+ return "up";
136
+ case "down":
137
+ case "d":
138
+ return "down";
139
+ case "in":
140
+ return "in";
141
+ case "out":
142
+ return "out";
143
+ case "horizontal":
144
+ case "horz":
145
+ case "h":
146
+ return "horizontal";
147
+ case "vertical":
148
+ case "vert":
149
+ case "v":
150
+ return "vertical";
151
+ default:
152
+ return null;
153
+ }
154
+ }
155
+ function resolveTransitionDuration(transition, fallback = DEFAULT_TRANSITION_DURATION_SECONDS) {
156
+ const duration = transition?.duration;
157
+ return duration != null && Number.isFinite(duration) && duration > 0 ? duration : fallback;
158
+ }
159
+ function resolveBlockTransition(block, theme, blockIndex) {
160
+ if (block.transition) return block.transition;
161
+ if (blockIndex === 0) return void 0;
162
+ return theme.renderStyle.defaultTransition;
163
+ }
164
+ function normalizeToken(value) {
165
+ return value.toLowerCase().replace(/[\s_-]+/g, "");
166
+ }
167
+
168
+ export {
169
+ DEFAULT_TRANSITION_DURATION_SECONDS,
170
+ TRANSITION_TYPES,
171
+ TRANSITION_DIRECTIONS,
172
+ isTransitionType,
173
+ normalizeTransitionType,
174
+ normalizeTransitionDirection,
175
+ resolveTransitionDuration,
176
+ resolveBlockTransition
177
+ };
178
+ //# sourceMappingURL=chunk-QE7TWGVT.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/schemas/Transitions.ts"],"sourcesContent":["/**\n * Shared transition vocabulary for block-to-block slide changes.\n *\n * The canonical names are based on PowerPoint / PresentationML transition\n * names where possible, with a few legacy renderer aliases kept so older\n * Squisq documents continue to work.\n */\n\nexport const DEFAULT_TRANSITION_DURATION_SECONDS = 0.7;\n\nexport const TRANSITION_TYPES = [\n // Existing / common transitions\n 'cut',\n 'fade',\n 'dissolve',\n 'push',\n 'wipe',\n 'split',\n 'reveal',\n 'randomBars',\n 'shape',\n 'uncover',\n 'cover',\n 'zoom',\n 'pan',\n\n // PowerPoint subtle / exciting transitions\n 'flash',\n 'fallOver',\n 'drape',\n 'curtains',\n 'wind',\n 'prestige',\n 'fracture',\n 'crush',\n 'peelOff',\n 'pageCurl',\n 'airplane',\n 'origami',\n 'checkerboard',\n 'blinds',\n 'clock',\n 'ripple',\n 'honeycomb',\n 'glitter',\n 'vortex',\n 'shred',\n 'switch',\n 'flip',\n 'gallery',\n 'cube',\n 'doors',\n 'box',\n 'ferrisWheel',\n 'conveyor',\n 'rotate',\n 'window',\n 'orbit',\n 'flyThrough',\n 'morph',\n\n // PresentationML/Open XML precise names and legacy aliases\n 'checker',\n 'circle',\n 'comb',\n 'diamond',\n 'newsflash',\n 'plus',\n 'pull',\n 'random',\n 'randomBar',\n 'strips',\n 'wedge',\n 'wheel',\n 'prism',\n 'warp',\n 'ferris',\n 'flythrough',\n 'wheelReverse',\n 'pageCurlDouble',\n 'pageCurlSingle',\n 'slideLeft',\n 'slideRight',\n 'slideUp',\n 'slideDown',\n] as const;\n\nexport type TransitionType = (typeof TRANSITION_TYPES)[number];\n\nexport const TRANSITION_DIRECTIONS = [\n 'left',\n 'right',\n 'up',\n 'down',\n 'in',\n 'out',\n 'horizontal',\n 'vertical',\n] as const;\n\nexport type TransitionDirection = (typeof TRANSITION_DIRECTIONS)[number];\n\n/**\n * Transition between blocks.\n *\n * A block's transition is the lead-in from the previous block. The same\n * transition drives the entering block and the previous block's exit.\n */\nexport interface Transition {\n /** Transition type */\n type: TransitionType;\n /** Duration in seconds. Defaults to DEFAULT_TRANSITION_DURATION_SECONDS. */\n duration?: number;\n /** Optional direction/variant for directional transitions. */\n direction?: TransitionDirection;\n}\n\nconst TRANSITION_TYPE_SET = new Set<string>(TRANSITION_TYPES);\n\nconst TRANSITION_TYPE_ALIASES: Record<string, TransitionType> = {\n none: 'cut',\n randombars: 'randomBars',\n randombar: 'randomBar',\n // Self-referential spellings (`checkerboard`, `shape`, `uncover`) are\n // intentionally absent: an exact valid type returns early from\n // `normalizeTransitionType`, and any case variant resolves through\n // `NORMALIZED_TRANSITION_TYPES`. Only the *plural* aliases need an entry.\n checkerboards: 'checkerboard',\n shapes: 'shape',\n ferris: 'ferrisWheel',\n ferriswheel: 'ferrisWheel',\n flythrough: 'flyThrough',\n flythru: 'flyThrough',\n pagecurl: 'pageCurl',\n pagecurldouble: 'pageCurlDouble',\n pagecurlsingle: 'pageCurlSingle',\n wheelreverse: 'wheelReverse',\n slideleft: 'slideLeft',\n slideright: 'slideRight',\n slideup: 'slideUp',\n slidedown: 'slideDown',\n};\n\nconst NORMALIZED_TRANSITION_TYPES = new Map<string, TransitionType>(\n TRANSITION_TYPES.map((type) => [normalizeToken(type), type]),\n);\n\nexport function isTransitionType(value: string): value is TransitionType {\n return TRANSITION_TYPE_SET.has(value);\n}\n\nexport function normalizeTransitionType(value: string): TransitionType | null {\n const trimmed = value.trim();\n if (!trimmed) return null;\n if (isTransitionType(trimmed)) return trimmed;\n const normalized = normalizeToken(trimmed);\n return TRANSITION_TYPE_ALIASES[normalized] ?? NORMALIZED_TRANSITION_TYPES.get(normalized) ?? null;\n}\n\nexport function normalizeTransitionDirection(value: string): TransitionDirection | null {\n const normalized = normalizeToken(value);\n switch (normalized) {\n case 'left':\n case 'l':\n return 'left';\n case 'right':\n case 'r':\n return 'right';\n case 'up':\n case 'u':\n return 'up';\n case 'down':\n case 'd':\n return 'down';\n case 'in':\n return 'in';\n case 'out':\n return 'out';\n case 'horizontal':\n case 'horz':\n case 'h':\n return 'horizontal';\n case 'vertical':\n case 'vert':\n case 'v':\n return 'vertical';\n default:\n return null;\n }\n}\n\nexport function resolveTransitionDuration(\n transition: Transition | undefined,\n fallback: number = DEFAULT_TRANSITION_DURATION_SECONDS,\n): number {\n const duration = transition?.duration;\n return duration != null && Number.isFinite(duration) && duration > 0 ? duration : fallback;\n}\n\n/**\n * Resolve the effective transition for a block: the authored value wins\n * (markdown frontmatter and transform styles both write `block.transition`\n * upstream), then the theme's `renderStyle.defaultTransition`, then\n * `undefined` (the player's built-in default).\n *\n * Block 0 never gets a theme default — an entrance transition on the first\n * block would dim the opening frames of every exported video.\n *\n * The theme parameter is structural (not `Theme`) to avoid a schema import\n * cycle; pass any resolved theme.\n */\nexport function resolveBlockTransition(\n block: { transition?: Transition },\n theme: { renderStyle: { defaultTransition?: Transition } },\n blockIndex: number,\n): Transition | undefined {\n if (block.transition) return block.transition;\n if (blockIndex === 0) return undefined;\n return theme.renderStyle.defaultTransition;\n}\n\nfunction normalizeToken(value: string): string {\n return value.toLowerCase().replace(/[\\s_-]+/g, '');\n}\n"],"mappings":";AAQO,IAAM,sCAAsC;AAE5C,IAAM,mBAAmB;AAAA;AAAA,EAE9B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EAGA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EAGA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAIO,IAAM,wBAAwB;AAAA,EACnC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAmBA,IAAM,sBAAsB,IAAI,IAAY,gBAAgB;AAE5D,IAAM,0BAA0D;AAAA,EAC9D,MAAM;AAAA,EACN,YAAY;AAAA,EACZ,WAAW;AAAA;AAAA;AAAA;AAAA;AAAA,EAKX,eAAe;AAAA,EACf,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,aAAa;AAAA,EACb,YAAY;AA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,MAAM;AACnC,MAAI,eAAe,EAAG,QAAO;AAC7B,SAAO,MAAM,YAAY;AAC3B;AAEA,SAAS,eAAe,OAAuB;AAC7C,SAAO,MAAM,YAAY,EAAE,QAAQ,YAAY,EAAE;AACnD;","names":[]}
@@ -0,0 +1,345 @@
1
+ // src/doc/utils/shapeGeometry.ts
2
+ var PATH_SHAPE_KINDS = /* @__PURE__ */ new Set([
3
+ "triangle",
4
+ "right-triangle",
5
+ "diamond",
6
+ "pentagon",
7
+ "hexagon",
8
+ "octagon",
9
+ "star",
10
+ "star4",
11
+ "star6",
12
+ "parallelogram",
13
+ "trapezoid",
14
+ "plus",
15
+ "chevron",
16
+ "arrow-right",
17
+ "arrow-left",
18
+ "arrow-up",
19
+ "arrow-down",
20
+ "double-arrow",
21
+ "callout",
22
+ "cylinder",
23
+ "cloud",
24
+ "heart",
25
+ "lightning"
26
+ ]);
27
+ function r(n) {
28
+ return Math.round(n * 10) / 10;
29
+ }
30
+ function poly(points) {
31
+ if (points.length === 0) return "";
32
+ const [first, ...rest] = points;
33
+ const head = `M ${r(first[0])} ${r(first[1])}`;
34
+ const tail = rest.map(([x, y]) => `L ${r(x)} ${r(y)}`).join(" ");
35
+ return `${head} ${tail} Z`;
36
+ }
37
+ function regular(cx, cy, rx, ry, sides, rotation) {
38
+ const pts = [];
39
+ for (let i = 0; i < sides; i++) {
40
+ const a = rotation + i * 2 * Math.PI / sides;
41
+ pts.push([cx + rx * Math.cos(a), cy + ry * Math.sin(a)]);
42
+ }
43
+ return pts;
44
+ }
45
+ function star(cx, cy, rx, ry, spikes, innerRatio) {
46
+ const pts = [];
47
+ const rot = -Math.PI / 2;
48
+ for (let i = 0; i < spikes * 2; i++) {
49
+ const outer = i % 2 === 0;
50
+ const a = rot + i * Math.PI / spikes;
51
+ const fx = outer ? rx : rx * innerRatio;
52
+ const fy = outer ? ry : ry * innerRatio;
53
+ pts.push([cx + fx * Math.cos(a), cy + fy * Math.sin(a)]);
54
+ }
55
+ return pts;
56
+ }
57
+ function shapePath(kind, x, y, w, h) {
58
+ const cx = x + w / 2;
59
+ const cy = y + h / 2;
60
+ const rx = w / 2;
61
+ const ry = h / 2;
62
+ const right = x + w;
63
+ const bottom = y + h;
64
+ switch (kind) {
65
+ case "triangle":
66
+ return poly([
67
+ [cx, y],
68
+ [right, bottom],
69
+ [x, bottom]
70
+ ]);
71
+ case "right-triangle":
72
+ return poly([
73
+ [x, y],
74
+ [x, bottom],
75
+ [right, bottom]
76
+ ]);
77
+ case "diamond":
78
+ return poly([
79
+ [cx, y],
80
+ [right, cy],
81
+ [cx, bottom],
82
+ [x, cy]
83
+ ]);
84
+ case "pentagon":
85
+ return poly(regular(cx, cy, rx, ry, 5, -Math.PI / 2));
86
+ case "hexagon": {
87
+ const inset = w * 0.25;
88
+ return poly([
89
+ [x + inset, y],
90
+ [right - inset, y],
91
+ [right, cy],
92
+ [right - inset, bottom],
93
+ [x + inset, bottom],
94
+ [x, cy]
95
+ ]);
96
+ }
97
+ case "octagon": {
98
+ const cut = Math.min(w, h) * 0.29;
99
+ return poly([
100
+ [x + cut, y],
101
+ [right - cut, y],
102
+ [right, y + cut],
103
+ [right, bottom - cut],
104
+ [right - cut, bottom],
105
+ [x + cut, bottom],
106
+ [x, bottom - cut],
107
+ [x, y + cut]
108
+ ]);
109
+ }
110
+ case "star":
111
+ return poly(star(cx, cy, rx, ry, 5, 0.4));
112
+ case "star4":
113
+ return poly(star(cx, cy, rx, ry, 4, 0.4));
114
+ case "star6":
115
+ return poly(star(cx, cy, rx, ry, 6, 0.5));
116
+ case "parallelogram": {
117
+ const off = w * 0.25;
118
+ return poly([
119
+ [x + off, y],
120
+ [right, y],
121
+ [right - off, bottom],
122
+ [x, bottom]
123
+ ]);
124
+ }
125
+ case "trapezoid": {
126
+ const off = w * 0.25;
127
+ return poly([
128
+ [x + off, y],
129
+ [right - off, y],
130
+ [right, bottom],
131
+ [x, bottom]
132
+ ]);
133
+ }
134
+ case "plus": {
135
+ const t = Math.min(w, h) / 3;
136
+ const lx = x + (w - t) / 2;
137
+ const rxp = lx + t;
138
+ const ty = y + (h - t) / 2;
139
+ const byp = ty + t;
140
+ return poly([
141
+ [lx, y],
142
+ [rxp, y],
143
+ [rxp, ty],
144
+ [right, ty],
145
+ [right, byp],
146
+ [rxp, byp],
147
+ [rxp, bottom],
148
+ [lx, bottom],
149
+ [lx, byp],
150
+ [x, byp],
151
+ [x, ty],
152
+ [lx, ty]
153
+ ]);
154
+ }
155
+ case "chevron": {
156
+ const notch = w * 0.25;
157
+ return poly([
158
+ [x, y],
159
+ [right - notch, y],
160
+ [right, cy],
161
+ [right - notch, bottom],
162
+ [x, bottom],
163
+ [x + notch, cy]
164
+ ]);
165
+ }
166
+ case "arrow-right":
167
+ return blockArrow(x, y, w, h, "right");
168
+ case "arrow-left":
169
+ return blockArrow(x, y, w, h, "left");
170
+ case "arrow-up":
171
+ return blockArrow(x, y, w, h, "up");
172
+ case "arrow-down":
173
+ return blockArrow(x, y, w, h, "down");
174
+ case "double-arrow": {
175
+ const head = w * 0.3;
176
+ const bodyT = h * 0.4;
177
+ const ty = cy - bodyT / 2;
178
+ const by = cy + bodyT / 2;
179
+ return poly([
180
+ [x, cy],
181
+ [x + head, y],
182
+ [x + head, ty],
183
+ [right - head, ty],
184
+ [right - head, y],
185
+ [right, cy],
186
+ [right - head, bottom],
187
+ [right - head, by],
188
+ [x + head, by],
189
+ [x + head, bottom]
190
+ ]);
191
+ }
192
+ case "callout": {
193
+ const bodyH = h * 0.78;
194
+ const bb = y + bodyH;
195
+ const tailX = x + w * 0.25;
196
+ return `M ${r(x)} ${r(y)} L ${r(right)} ${r(y)} L ${r(right)} ${r(bb)} L ${r(tailX + w * 0.12)} ${r(bb)} L ${r(tailX)} ${r(bottom)} L ${r(tailX - w * 0.02)} ${r(bb)} L ${r(x)} ${r(bb)} Z`;
197
+ }
198
+ case "cylinder": {
199
+ const ell = h * 0.16;
200
+ return `M ${r(x)} ${r(y + ell)} A ${r(rx)} ${r(ell)} 0 0 1 ${r(right)} ${r(y + ell)} L ${r(right)} ${r(bottom - ell)} A ${r(rx)} ${r(ell)} 0 0 1 ${r(x)} ${r(bottom - ell)} Z M ${r(x)} ${r(y + ell)} A ${r(rx)} ${r(ell)} 0 0 0 ${r(right)} ${r(y + ell)}`;
201
+ }
202
+ case "cloud": {
203
+ const b = h * 0.5;
204
+ return `M ${r(x + w * 0.2)} ${r(bottom)} A ${r(w * 0.2)} ${r(b)} 0 0 1 ${r(x + w * 0.15)} ${r(cy)} A ${r(w * 0.2)} ${r(b)} 0 0 1 ${r(x + w * 0.45)} ${r(y + h * 0.2)} A ${r(w * 0.2)} ${r(b)} 0 0 1 ${r(x + w * 0.8)} ${r(y + h * 0.25)} A ${r(w * 0.18)} ${r(b)} 0 0 1 ${r(x + w * 0.85)} ${r(bottom)} Z`;
205
+ }
206
+ case "heart": {
207
+ const topY = y + h * 0.3;
208
+ return `M ${r(cx)} ${r(bottom)} C ${r(x - w * 0.1)} ${r(cy)} ${r(x)} ${r(y)} ${r(cx)} ${r(topY)} C ${r(right)} ${r(y)} ${r(right + w * 0.1)} ${r(cy)} ${r(cx)} ${r(bottom)} Z`;
209
+ }
210
+ case "lightning":
211
+ return poly([
212
+ [x + w * 0.55, y],
213
+ [x + w * 0.2, y + h * 0.55],
214
+ [x + w * 0.45, y + h * 0.55],
215
+ [x + w * 0.3, bottom],
216
+ [right, y + h * 0.4],
217
+ [x + w * 0.55, y + h * 0.4]
218
+ ]);
219
+ default:
220
+ return null;
221
+ }
222
+ }
223
+ function blockArrow(x, y, w, h, dir) {
224
+ const right = x + w;
225
+ const bottom = y + h;
226
+ const cx = x + w / 2;
227
+ const cy = y + h / 2;
228
+ if (dir === "right" || dir === "left") {
229
+ const head2 = w * 0.4;
230
+ const bodyT2 = h * 0.5;
231
+ const ty = cy - bodyT2 / 2;
232
+ const by = cy + bodyT2 / 2;
233
+ if (dir === "right") {
234
+ return poly([
235
+ [x, ty],
236
+ [right - head2, ty],
237
+ [right - head2, y],
238
+ [right, cy],
239
+ [right - head2, bottom],
240
+ [right - head2, by],
241
+ [x, by]
242
+ ]);
243
+ }
244
+ return poly([
245
+ [right, ty],
246
+ [x + head2, ty],
247
+ [x + head2, y],
248
+ [x, cy],
249
+ [x + head2, bottom],
250
+ [x + head2, by],
251
+ [right, by]
252
+ ]);
253
+ }
254
+ const head = h * 0.4;
255
+ const bodyT = w * 0.5;
256
+ const lx = cx - bodyT / 2;
257
+ const rxp = cx + bodyT / 2;
258
+ if (dir === "down") {
259
+ return poly([
260
+ [lx, y],
261
+ [rxp, y],
262
+ [rxp, bottom - head],
263
+ [right, bottom - head],
264
+ [cx, bottom],
265
+ [x, bottom - head],
266
+ [lx, bottom - head]
267
+ ]);
268
+ }
269
+ return poly([
270
+ [lx, bottom],
271
+ [rxp, bottom],
272
+ [rxp, y + head],
273
+ [right, y + head],
274
+ [cx, y],
275
+ [x, y + head],
276
+ [lx, y + head]
277
+ ]);
278
+ }
279
+ function markerPath(style, dir) {
280
+ const mirror = dir === "start";
281
+ const mx = (n) => mirror ? 10 - n : n;
282
+ const tri = (closed) => `M ${mx(0)} 0 L ${mx(10)} 5 L ${mx(0)} 10${closed ? " z" : ""}`;
283
+ switch (style) {
284
+ case "arrow":
285
+ return { d: tri(true), filled: true };
286
+ case "open":
287
+ return { d: tri(false), filled: false };
288
+ case "diamond":
289
+ return { d: "M 0 5 L 5 0 L 10 5 L 5 10 z", filled: true };
290
+ case "square":
291
+ return { d: "M 1 1 L 9 1 L 9 9 L 1 9 z", filled: true };
292
+ case "circle":
293
+ return { d: "M 0 5 A 5 5 0 1 0 10 5 A 5 5 0 1 0 0 5 z", filled: true };
294
+ case "none":
295
+ default:
296
+ return null;
297
+ }
298
+ }
299
+ function clipPoint(from, to) {
300
+ const dx = to.cx - from.cx;
301
+ const dy = to.cy - from.cy;
302
+ if (dx === 0 && dy === 0) return { x: from.cx, y: from.cy };
303
+ const sx = Math.abs(dx) > 0 ? from.rx / Math.abs(dx) : Infinity;
304
+ const sy = Math.abs(dy) > 0 ? from.ry / Math.abs(dy) : Infinity;
305
+ const s = Math.min(sx, sy);
306
+ return { x: from.cx + dx * s, y: from.cy + dy * s };
307
+ }
308
+ function clipEndpoints(a, b) {
309
+ return { start: clipPoint(a, b), end: clipPoint(b, a) };
310
+ }
311
+ function connectorPath(routing, start, end) {
312
+ if (routing === "straight") {
313
+ return `M ${r(start.x)} ${r(start.y)} L ${r(end.x)} ${r(end.y)}`;
314
+ }
315
+ if (routing === "orthogonal") {
316
+ const midX = (start.x + end.x) / 2;
317
+ return `M ${r(start.x)} ${r(start.y)} L ${r(midX)} ${r(start.y)} L ${r(midX)} ${r(end.y)} L ${r(end.x)} ${r(end.y)}`;
318
+ }
319
+ const dx = Math.abs(end.x - start.x);
320
+ const cp = Math.max(40, dx / 2);
321
+ return `M ${r(start.x)} ${r(start.y)} C ${r(start.x + cp)} ${r(start.y)}, ${r(end.x - cp)} ${r(end.y)}, ${r(end.x)} ${r(end.y)}`;
322
+ }
323
+ function lineStyleDasharray(style) {
324
+ switch (style?.toLowerCase()) {
325
+ case "dashed":
326
+ case "dash":
327
+ return "8 6";
328
+ case "dotted":
329
+ case "dot":
330
+ return "2 6";
331
+ default:
332
+ return void 0;
333
+ }
334
+ }
335
+
336
+ export {
337
+ PATH_SHAPE_KINDS,
338
+ shapePath,
339
+ markerPath,
340
+ clipPoint,
341
+ clipEndpoints,
342
+ connectorPath,
343
+ lineStyleDasharray
344
+ };
345
+ //# sourceMappingURL=chunk-RUDYOTA6.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/doc/utils/shapeGeometry.ts"],"sourcesContent":["/**\n * shapeGeometry — pure SVG geometry for the drawing/diagram shape vocabulary.\n *\n * Three concerns, all deterministic and dependency-free:\n * - `shapePath(kind, x, y, w, h)` → an SVG path `d` for a named shape inscribed\n * in a bounding box. Returns null for the natively-rendered primitives\n * (rect / circle / line / text / path) so the caller can keep using a\n * `ShapeLayer` for those; everything else becomes a computed `PathLayer`.\n * - `markerPath(style, dir)` → the `<marker>` path for a line end-style, in the\n * standard 0–10 marker viewBox (shared by the SSR `PathLayer` renderer and the\n * editor's edge renderer).\n * - `connectorPath(routing, start, end)` + `clipEndpoints(a, b)` → the line/edge\n * geometry between two shapes (straight / orthogonal / curved), lifted from the\n * diagram template so drawings and diagrams draw identical connectors.\n */\n\nimport type { MarkerStyle } from '../../schemas/Doc.js';\n\n// ============================================\n// Shapes\n// ============================================\n\n/** Connector routing styles. */\nexport type ConnectorRouting = 'straight' | 'orthogonal' | 'curved';\n\n/**\n * Shape kinds rendered as computed paths (everything except the primitives the\n * renderer draws natively). Used by templates to decide ShapeLayer vs PathLayer.\n */\nexport const PATH_SHAPE_KINDS = new Set([\n 'triangle',\n 'right-triangle',\n 'diamond',\n 'pentagon',\n 'hexagon',\n 'octagon',\n 'star',\n 'star4',\n 'star6',\n 'parallelogram',\n 'trapezoid',\n 'plus',\n 'chevron',\n 'arrow-right',\n 'arrow-left',\n 'arrow-up',\n 'arrow-down',\n 'double-arrow',\n 'callout',\n 'cylinder',\n 'cloud',\n 'heart',\n 'lightning',\n]);\n\n/** Round to 1 decimal for compact, stable path output. */\nfunction r(n: number): number {\n return Math.round(n * 10) / 10;\n}\n\n/** Close a list of points into an `M … L … Z` polygon path. */\nfunction poly(points: ReadonlyArray<readonly [number, number]>): string {\n if (points.length === 0) return '';\n const [first, ...rest] = points;\n const head = `M ${r(first[0])} ${r(first[1])}`;\n const tail = rest.map(([x, y]) => `L ${r(x)} ${r(y)}`).join(' ');\n return `${head} ${tail} Z`;\n}\n\n/** Regular polygon points inscribed in the box ellipse, `rotation` in radians. */\nfunction regular(\n cx: number,\n cy: number,\n rx: number,\n ry: number,\n sides: number,\n rotation: number,\n): Array<[number, number]> {\n const pts: Array<[number, number]> = [];\n for (let i = 0; i < sides; i++) {\n const a = rotation + (i * 2 * Math.PI) / sides;\n pts.push([cx + rx * Math.cos(a), cy + ry * Math.sin(a)]);\n }\n return pts;\n}\n\n/** Star points alternating outer/inner radius. */\nfunction star(\n cx: number,\n cy: number,\n rx: number,\n ry: number,\n spikes: number,\n innerRatio: number,\n): Array<[number, number]> {\n const pts: Array<[number, number]> = [];\n const rot = -Math.PI / 2; // first point up\n for (let i = 0; i < spikes * 2; i++) {\n const outer = i % 2 === 0;\n const a = rot + (i * Math.PI) / spikes;\n const fx = outer ? rx : rx * innerRatio;\n const fy = outer ? ry : ry * innerRatio;\n pts.push([cx + fx * Math.cos(a), cy + fy * Math.sin(a)]);\n }\n return pts;\n}\n\n/**\n * SVG path `d` for a named shape inscribed in `[x, y, w, h]`, or null when the\n * kind is rendered natively (rect / circle / line / text / path / arrow).\n */\nexport function shapePath(kind: string, x: number, y: number, w: number, h: number): string | null {\n const cx = x + w / 2;\n const cy = y + h / 2;\n const rx = w / 2;\n const ry = h / 2;\n const right = x + w;\n const bottom = y + h;\n\n switch (kind) {\n case 'triangle':\n return poly([\n [cx, y],\n [right, bottom],\n [x, bottom],\n ]);\n case 'right-triangle':\n return poly([\n [x, y],\n [x, bottom],\n [right, bottom],\n ]);\n case 'diamond':\n return poly([\n [cx, y],\n [right, cy],\n [cx, bottom],\n [x, cy],\n ]);\n case 'pentagon':\n return poly(regular(cx, cy, rx, ry, 5, -Math.PI / 2));\n case 'hexagon': {\n // Flat top/bottom hexagon: inset the left/right vertices.\n const inset = w * 0.25;\n return poly([\n [x + inset, y],\n [right - inset, y],\n [right, cy],\n [right - inset, bottom],\n [x + inset, bottom],\n [x, cy],\n ]);\n }\n case 'octagon': {\n const cut = Math.min(w, h) * 0.29;\n return poly([\n [x + cut, y],\n [right - cut, y],\n [right, y + cut],\n [right, bottom - cut],\n [right - cut, bottom],\n [x + cut, bottom],\n [x, bottom - cut],\n [x, y + cut],\n ]);\n }\n case 'star':\n return poly(star(cx, cy, rx, ry, 5, 0.4));\n case 'star4':\n return poly(star(cx, cy, rx, ry, 4, 0.4));\n case 'star6':\n return poly(star(cx, cy, rx, ry, 6, 0.5));\n case 'parallelogram': {\n const off = w * 0.25;\n return poly([\n [x + off, y],\n [right, y],\n [right - off, bottom],\n [x, bottom],\n ]);\n }\n case 'trapezoid': {\n const off = w * 0.25;\n return poly([\n [x + off, y],\n [right - off, y],\n [right, bottom],\n [x, bottom],\n ]);\n }\n case 'plus': {\n const t = Math.min(w, h) / 3; // arm thickness\n const lx = x + (w - t) / 2;\n const rxp = lx + t;\n const ty = y + (h - t) / 2;\n const byp = ty + t;\n return poly([\n [lx, y],\n [rxp, y],\n [rxp, ty],\n [right, ty],\n [right, byp],\n [rxp, byp],\n [rxp, bottom],\n [lx, bottom],\n [lx, byp],\n [x, byp],\n [x, ty],\n [lx, ty],\n ]);\n }\n case 'chevron': {\n const notch = w * 0.25;\n return poly([\n [x, y],\n [right - notch, y],\n [right, cy],\n [right - notch, bottom],\n [x, bottom],\n [x + notch, cy],\n ]);\n }\n case 'arrow-right':\n return blockArrow(x, y, w, h, 'right');\n case 'arrow-left':\n return blockArrow(x, y, w, h, 'left');\n case 'arrow-up':\n return blockArrow(x, y, w, h, 'up');\n case 'arrow-down':\n return blockArrow(x, y, w, h, 'down');\n case 'double-arrow': {\n const head = w * 0.3;\n const bodyT = h * 0.4;\n const ty = cy - bodyT / 2;\n const by = cy + bodyT / 2;\n return poly([\n [x, cy],\n [x + head, y],\n [x + head, ty],\n [right - head, ty],\n [right - head, y],\n [right, cy],\n [right - head, bottom],\n [right - head, by],\n [x + head, by],\n [x + head, bottom],\n ]);\n }\n case 'callout': {\n // Speech bubble: rounded-ish body (square corners for path simplicity)\n // with a tail off the lower-left.\n const bodyH = h * 0.78;\n const bb = y + bodyH;\n const tailX = x + w * 0.25;\n return `M ${r(x)} ${r(y)} L ${r(right)} ${r(y)} L ${r(right)} ${r(bb)} L ${r(tailX + w * 0.12)} ${r(bb)} L ${r(tailX)} ${r(bottom)} L ${r(tailX - w * 0.02)} ${r(bb)} L ${r(x)} ${r(bb)} Z`;\n }\n case 'cylinder': {\n const ell = h * 0.16; // ellipse half-height\n return (\n `M ${r(x)} ${r(y + ell)} ` +\n `A ${r(rx)} ${r(ell)} 0 0 1 ${r(right)} ${r(y + ell)} ` +\n `L ${r(right)} ${r(bottom - ell)} ` +\n `A ${r(rx)} ${r(ell)} 0 0 1 ${r(x)} ${r(bottom - ell)} ` +\n `Z ` +\n // top ellipse outline\n `M ${r(x)} ${r(y + ell)} ` +\n `A ${r(rx)} ${r(ell)} 0 0 0 ${r(right)} ${r(y + ell)}`\n );\n }\n case 'cloud': {\n // Four bumps along the top + a flat-ish bottom, via arcs.\n const b = h * 0.5;\n return (\n `M ${r(x + w * 0.2)} ${r(bottom)} ` +\n `A ${r(w * 0.2)} ${r(b)} 0 0 1 ${r(x + w * 0.15)} ${r(cy)} ` +\n `A ${r(w * 0.2)} ${r(b)} 0 0 1 ${r(x + w * 0.45)} ${r(y + h * 0.2)} ` +\n `A ${r(w * 0.2)} ${r(b)} 0 0 1 ${r(x + w * 0.8)} ${r(y + h * 0.25)} ` +\n `A ${r(w * 0.18)} ${r(b)} 0 0 1 ${r(x + w * 0.85)} ${r(bottom)} ` +\n `Z`\n );\n }\n case 'heart': {\n const topY = y + h * 0.3;\n return (\n `M ${r(cx)} ${r(bottom)} ` +\n `C ${r(x - w * 0.1)} ${r(cy)} ${r(x)} ${r(y)} ${r(cx)} ${r(topY)} ` +\n `C ${r(right)} ${r(y)} ${r(right + w * 0.1)} ${r(cy)} ${r(cx)} ${r(bottom)} ` +\n `Z`\n );\n }\n case 'lightning':\n return poly([\n [x + w * 0.55, y],\n [x + w * 0.2, y + h * 0.55],\n [x + w * 0.45, y + h * 0.55],\n [x + w * 0.3, bottom],\n [right, y + h * 0.4],\n [x + w * 0.55, y + h * 0.4],\n ]);\n default:\n return null;\n }\n}\n\n/** Block arrow (body rectangle + triangular head) pointing in `dir`. */\nfunction blockArrow(\n x: number,\n y: number,\n w: number,\n h: number,\n dir: 'right' | 'left' | 'up' | 'down',\n): string {\n const right = x + w;\n const bottom = y + h;\n const cx = x + w / 2;\n const cy = y + h / 2;\n if (dir === 'right' || dir === 'left') {\n const head = w * 0.4;\n const bodyT = h * 0.5;\n const ty = cy - bodyT / 2;\n const by = cy + bodyT / 2;\n if (dir === 'right') {\n return poly([\n [x, ty],\n [right - head, ty],\n [right - head, y],\n [right, cy],\n [right - head, bottom],\n [right - head, by],\n [x, by],\n ]);\n }\n return poly([\n [right, ty],\n [x + head, ty],\n [x + head, y],\n [x, cy],\n [x + head, bottom],\n [x + head, by],\n [right, by],\n ]);\n }\n const head = h * 0.4;\n const bodyT = w * 0.5;\n const lx = cx - bodyT / 2;\n const rxp = cx + bodyT / 2;\n if (dir === 'down') {\n return poly([\n [lx, y],\n [rxp, y],\n [rxp, bottom - head],\n [right, bottom - head],\n [cx, bottom],\n [x, bottom - head],\n [lx, bottom - head],\n ]);\n }\n return poly([\n [lx, bottom],\n [rxp, bottom],\n [rxp, y + head],\n [right, y + head],\n [cx, y],\n [x, y + head],\n [lx, y + head],\n ]);\n}\n\n// ============================================\n// End markers\n// ============================================\n\n/**\n * The `<marker>` path for a line end-style, in the 0–10 marker viewBox.\n * `dir` selects orientation (`end` points along +x; `start` is mirrored).\n * Returns null for `'none'`. `filled` shapes paint with the stroke color;\n * non-filled (`open`) draw as a stroked outline.\n */\nexport function markerPath(\n style: MarkerStyle,\n dir: 'start' | 'end',\n): { d: string; filled: boolean } | null {\n const mirror = dir === 'start';\n const mx = (n: number) => (mirror ? 10 - n : n);\n const tri = (closed: boolean) => `M ${mx(0)} 0 L ${mx(10)} 5 L ${mx(0)} 10${closed ? ' z' : ''}`;\n switch (style) {\n case 'arrow':\n return { d: tri(true), filled: true };\n case 'open':\n return { d: tri(false), filled: false };\n case 'diamond':\n return { d: 'M 0 5 L 5 0 L 10 5 L 5 10 z', filled: true };\n case 'square':\n return { d: 'M 1 1 L 9 1 L 9 9 L 1 9 z', filled: true };\n case 'circle':\n return { d: 'M 0 5 A 5 5 0 1 0 10 5 A 5 5 0 1 0 0 5 z', filled: true };\n case 'none':\n default:\n return null;\n }\n}\n\n// ============================================\n// Connector routing\n// ============================================\n\nexport interface ClipBox {\n cx: number;\n cy: number;\n rx: number;\n ry: number;\n}\n\n/** Intersection of the center-to-center line with `from`'s bounding box. */\nexport function clipPoint(from: ClipBox, to: ClipBox): { x: number; y: number } {\n const dx = to.cx - from.cx;\n const dy = to.cy - from.cy;\n if (dx === 0 && dy === 0) return { x: from.cx, y: from.cy };\n const sx = Math.abs(dx) > 0 ? from.rx / Math.abs(dx) : Infinity;\n const sy = Math.abs(dy) > 0 ? from.ry / Math.abs(dy) : Infinity;\n const s = Math.min(sx, sy);\n return { x: from.cx + dx * s, y: from.cy + dy * s };\n}\n\n/** Clip both endpoints of an edge to the two shapes it joins. */\nexport function clipEndpoints(\n a: ClipBox,\n b: ClipBox,\n): { start: { x: number; y: number }; end: { x: number; y: number } } {\n return { start: clipPoint(a, b), end: clipPoint(b, a) };\n}\n\n/** Build the SVG `d` for a connector between two clipped endpoints. */\nexport function connectorPath(\n routing: ConnectorRouting,\n start: { x: number; y: number },\n end: { x: number; y: number },\n): string {\n if (routing === 'straight') {\n return `M ${r(start.x)} ${r(start.y)} L ${r(end.x)} ${r(end.y)}`;\n }\n if (routing === 'orthogonal') {\n const midX = (start.x + end.x) / 2;\n return `M ${r(start.x)} ${r(start.y)} L ${r(midX)} ${r(start.y)} L ${r(midX)} ${r(end.y)} L ${r(end.x)} ${r(end.y)}`;\n }\n // curved\n const dx = Math.abs(end.x - start.x);\n const cp = Math.max(40, dx / 2);\n return `M ${r(start.x)} ${r(start.y)} C ${r(start.x + cp)} ${r(start.y)}, ${r(end.x - cp)} ${r(end.y)}, ${r(end.x)} ${r(end.y)}`;\n}\n\n/** Map a `lineStyle` (solid|dashed|dotted) to an SVG `stroke-dasharray`. */\nexport function lineStyleDasharray(style: string | undefined): string | undefined {\n switch (style?.toLowerCase()) {\n case 'dashed':\n case 'dash':\n return '8 6';\n case 'dotted':\n case 'dot':\n return '2 6';\n default:\n return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