@bendyline/squisq 1.4.1 → 1.5.1

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 (254) hide show
  1. package/README.md +14 -1
  2. package/dist/{ContentContainer-DNx460y8.d.ts → ContentContainer-BXUlIf18.d.ts} +6 -2
  3. package/dist/{Doc-BeSeH2iX.d.ts → Doc-BBVGq1_9.d.ts} +922 -273
  4. package/dist/{ImageEditDoc-BTIvw0oq.d.ts → ImageEditDoc-FuyGtt6o.d.ts} +11 -4
  5. package/dist/{chunk-ZTX4PFFT.js → chunk-2OIBZYKP.js} +75 -2
  6. package/dist/chunk-2OIBZYKP.js.map +1 -0
  7. package/dist/chunk-2UQOHYE2.js +45 -0
  8. package/dist/chunk-2UQOHYE2.js.map +1 -0
  9. package/dist/chunk-6ATE2PSM.js +344 -0
  10. package/dist/chunk-6ATE2PSM.js.map +1 -0
  11. package/dist/{chunk-57CVQCFX.js → chunk-A4O7GIWE.js} +74 -23
  12. package/dist/chunk-A4O7GIWE.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-ET53IIEP.js +1 -0
  16. package/dist/chunk-ET53IIEP.js.map +1 -0
  17. package/dist/chunk-HWVFJAAH.js +362 -0
  18. package/dist/chunk-HWVFJAAH.js.map +1 -0
  19. package/dist/{chunk-2TMAWB4Y.js → chunk-IMSCRLLV.js} +1 -1
  20. package/dist/chunk-IMSCRLLV.js.map +1 -0
  21. package/dist/{chunk-B4EEON3N.js → chunk-KKNUBQ6Y.js} +536 -103
  22. package/dist/chunk-KKNUBQ6Y.js.map +1 -0
  23. package/dist/chunk-LDQ2HJIX.js +596 -0
  24. package/dist/chunk-LDQ2HJIX.js.map +1 -0
  25. package/dist/chunk-LH7I6SH7.js +7208 -0
  26. package/dist/chunk-LH7I6SH7.js.map +1 -0
  27. package/dist/chunk-PGGGKYWG.js +1 -0
  28. package/dist/chunk-PGGGKYWG.js.map +1 -0
  29. package/dist/{chunk-7UDSRZKG.js → chunk-Q3ROPT5H.js} +35 -14
  30. package/dist/chunk-Q3ROPT5H.js.map +1 -0
  31. package/dist/chunk-QE7TWGVT.js +178 -0
  32. package/dist/chunk-QE7TWGVT.js.map +1 -0
  33. package/dist/chunk-RUDYOTA6.js +345 -0
  34. package/dist/chunk-RUDYOTA6.js.map +1 -0
  35. package/dist/{chunk-K32VJONL.js → chunk-T5UK6YOB.js} +41 -2
  36. package/dist/chunk-T5UK6YOB.js.map +1 -0
  37. package/dist/{chunk-3K5OG6KI.js → chunk-TEEEILMP.js} +412 -186
  38. package/dist/chunk-TEEEILMP.js.map +1 -0
  39. package/dist/{chunk-FR2RBTKO.js → chunk-TQWLI6S2.js} +93 -27
  40. package/dist/chunk-TQWLI6S2.js.map +1 -0
  41. package/dist/{chunk-WMOI7FN3.js → chunk-UY7KGQ5R.js} +12 -2
  42. package/dist/{chunk-WMOI7FN3.js.map → chunk-UY7KGQ5R.js.map} +1 -1
  43. package/dist/{chunk-3E5F2XMR.js → chunk-VWUFZ6ZG.js} +29 -2
  44. package/dist/chunk-VWUFZ6ZG.js.map +1 -0
  45. package/dist/chunk-ZLQKNOZQ.js +1 -0
  46. package/dist/chunk-ZLQKNOZQ.js.map +1 -0
  47. package/dist/doc/index.d.ts +5 -5
  48. package/dist/doc/index.js +135 -8
  49. package/dist/generate/index.d.ts +3 -74
  50. package/dist/generate/index.js +2 -7
  51. package/dist/icons/index.d.ts +3 -26
  52. package/dist/icons/index.js +13 -0
  53. package/dist/icons/inlineIconMarker.d.ts +1 -0
  54. package/dist/icons/inlineIconMarker.js +15 -0
  55. package/dist/icons/inlineIconMarker.js.map +1 -0
  56. package/dist/imageEdit/index.d.ts +12 -6
  57. package/dist/imageEdit/index.js +4 -1
  58. package/dist/index.d.ts +14 -11
  59. package/dist/index.js +265 -37
  60. package/dist/inlineIconMarker-CiE8Hlvz.d.ts +59 -0
  61. package/dist/jsonForm/index.d.ts +42 -1
  62. package/dist/jsonForm/index.js +9 -1
  63. package/dist/markdown/index.d.ts +228 -3
  64. package/dist/markdown/index.js +42 -7
  65. package/dist/recommend/index.d.ts +1 -1
  66. package/dist/recommend/index.js +3 -2
  67. package/dist/schemas/index.d.ts +28 -8
  68. package/dist/schemas/index.js +36 -8
  69. package/dist/spatial/index.d.ts +9 -4
  70. package/dist/spatial/index.js +1 -1
  71. package/dist/storage/index.d.ts +2 -2
  72. package/dist/storage/index.js +1 -1
  73. package/dist/story/index.d.ts +1021 -41
  74. package/dist/story/index.js +135 -8
  75. package/dist/{themeLibrary-BHjJ0Qx6.d.ts → themeLibrary-CehcJhzz.d.ts} +1 -1
  76. package/dist/timing/index.js +3 -5
  77. package/dist/transform/index.d.ts +48 -10
  78. package/dist/transform/index.js +17 -481
  79. package/dist/transform/index.js.map +1 -1
  80. package/dist/{types-BdZkdJ3z.d.ts → types-DlAZ7MW4.d.ts} +115 -1
  81. package/dist/versions/index.d.ts +1 -1
  82. package/package.json +6 -1
  83. package/src/__tests__/animationUtils.test.ts +40 -0
  84. package/src/__tests__/annotationCoercion.test.ts +243 -0
  85. package/src/__tests__/applyRenderStyle.test.ts +146 -0
  86. package/src/__tests__/atmosphereLayers.test.ts +108 -0
  87. package/src/__tests__/attrTokens.test.ts +162 -0
  88. package/src/__tests__/contentExtractor.test.ts +60 -0
  89. package/src/__tests__/coverBlock.test.ts +46 -1
  90. package/src/__tests__/customTemplateSample.test.ts +144 -0
  91. package/src/__tests__/customTemplatesFrontmatter.test.ts +236 -0
  92. package/src/__tests__/customThemesFrontmatter.test.ts +145 -0
  93. package/src/__tests__/diagramBlock.test.ts +122 -0
  94. package/src/__tests__/diagramLayout.test.ts +134 -0
  95. package/src/__tests__/drawing.test.ts +109 -0
  96. package/src/__tests__/drawingBlock.test.ts +124 -0
  97. package/src/__tests__/drawingLayout.test.ts +171 -0
  98. package/src/__tests__/geohash.test.ts +6 -5
  99. package/src/__tests__/getLayers.test.ts +6 -2
  100. package/src/__tests__/getLayersFallback.test.ts +103 -0
  101. package/src/__tests__/imageEditExportSvg.test.ts +70 -0
  102. package/src/__tests__/imageEditVersions.test.ts +72 -0
  103. package/src/__tests__/inlineIconMarker.test.ts +36 -0
  104. package/src/__tests__/inputDescriptors.test.ts +162 -0
  105. package/src/__tests__/jsonForm.tokens.test.ts +84 -0
  106. package/src/__tests__/layoutBlock.test.ts +83 -0
  107. package/src/__tests__/layoutLayout.test.ts +169 -0
  108. package/src/__tests__/markdown.test.ts +87 -0
  109. package/src/__tests__/markdownSanitize.test.ts +79 -0
  110. package/src/__tests__/markdownToDoc.test.ts +391 -2
  111. package/src/__tests__/mediaAnnotations.test.ts +91 -0
  112. package/src/__tests__/mediaSchedule.test.ts +118 -0
  113. package/src/__tests__/pandocAttrParse.test.ts +187 -0
  114. package/src/__tests__/resolveDocTheme.test.ts +55 -0
  115. package/src/__tests__/rootExports.test.ts +43 -0
  116. package/src/__tests__/shapeGeometry.test.ts +89 -0
  117. package/src/__tests__/shapeVocabulary.test.ts +133 -0
  118. package/src/__tests__/structuredData.test.ts +249 -0
  119. package/src/__tests__/templateAnnotationParse.test.ts +108 -0
  120. package/src/__tests__/templateMetadata.test.ts +31 -0
  121. package/src/__tests__/templates.test.ts +257 -4
  122. package/src/__tests__/themeCompile.test.ts +42 -0
  123. package/src/__tests__/themeValidator.test.ts +6 -0
  124. package/src/__tests__/transformV2.test.ts +137 -0
  125. package/src/__tests__/transitionNormalize.test.ts +61 -0
  126. package/src/__tests__/validateDoc.test.ts +260 -0
  127. package/src/doc/annotationBlocks.ts +117 -0
  128. package/src/doc/customTemplatesFrontmatter.ts +314 -0
  129. package/src/doc/customThemesFrontmatter.ts +95 -0
  130. package/src/doc/docToMarkdown.ts +104 -5
  131. package/src/doc/getLayers.ts +49 -17
  132. package/src/doc/index.ts +47 -1
  133. package/src/doc/markdownToDoc.ts +411 -13
  134. package/src/doc/mediaAnnotations.ts +100 -0
  135. package/src/doc/resolveDocTheme.ts +55 -0
  136. package/src/doc/standaloneAnnotation.ts +58 -0
  137. package/src/doc/structuredData.ts +301 -0
  138. package/src/doc/templateInputs.ts +240 -0
  139. package/src/doc/templates/__tests__/customTemplate.test.ts +170 -0
  140. package/src/doc/templates/__tests__/customTemplateRegistry.test.ts +110 -0
  141. package/src/doc/templates/accentImage.ts +30 -6
  142. package/src/doc/templates/captionUtils.ts +23 -0
  143. package/src/doc/templates/comparisonBar.ts +33 -18
  144. package/src/doc/templates/coverBlock.ts +35 -5
  145. package/src/doc/templates/customTemplate.ts +51 -0
  146. package/src/doc/templates/dataTable.ts +37 -19
  147. package/src/doc/templates/dateEvent.ts +41 -20
  148. package/src/doc/templates/definitionCard.ts +26 -18
  149. package/src/doc/templates/diagramBlock.ts +204 -0
  150. package/src/doc/templates/diagramLayout.ts +159 -0
  151. package/src/doc/templates/drawingBlock.ts +325 -0
  152. package/src/doc/templates/drawingLayout.ts +539 -0
  153. package/src/doc/templates/factCard.ts +54 -26
  154. package/src/doc/templates/fallbackBlock.ts +123 -0
  155. package/src/doc/templates/featureBlock.ts +20 -13
  156. package/src/doc/templates/fullBleedQuote.ts +18 -8
  157. package/src/doc/templates/imageWithCaption.ts +30 -15
  158. package/src/doc/templates/index.ts +225 -46
  159. package/src/doc/templates/inputDescriptors.ts +432 -0
  160. package/src/doc/templates/layoutBlock.ts +43 -0
  161. package/src/doc/templates/layoutLayout.ts +243 -0
  162. package/src/doc/templates/listBlock.ts +56 -30
  163. package/src/doc/templates/mapBlock.ts +15 -12
  164. package/src/doc/templates/metadata.ts +120 -0
  165. package/src/doc/templates/persistentLayers.ts +129 -11
  166. package/src/doc/templates/photoGrid.ts +22 -34
  167. package/src/doc/templates/pullQuote.ts +30 -12
  168. package/src/doc/templates/quoteBlock.ts +54 -29
  169. package/src/doc/templates/sectionHeader.ts +25 -11
  170. package/src/doc/templates/statHighlight.ts +39 -22
  171. package/src/doc/templates/titleBlock.ts +59 -21
  172. package/src/doc/templates/tokens/__tests__/resolveTokens.test.ts +487 -0
  173. package/src/doc/templates/tokens/resolveTokens.ts +453 -0
  174. package/src/doc/templates/twoColumn.ts +48 -30
  175. package/src/doc/templates/videoPullQuote.ts +22 -12
  176. package/src/doc/templates/videoWithCaption.ts +21 -15
  177. package/src/doc/utils/animationUtils.ts +267 -3
  178. package/src/doc/utils/applyRenderStyle.ts +113 -0
  179. package/src/doc/utils/imageTreatment.ts +70 -0
  180. package/src/doc/utils/nearest.ts +59 -0
  181. package/src/doc/utils/shapeGeometry.ts +464 -0
  182. package/src/doc/utils/themeUtils.ts +75 -1
  183. package/src/doc/validate.ts +575 -0
  184. package/src/generate/contentExtractor.ts +148 -35
  185. package/src/generate/index.ts +0 -3
  186. package/src/icons/index.ts +8 -0
  187. package/src/icons/inlineIconMarker.ts +73 -0
  188. package/src/imageEdit/export.ts +85 -2
  189. package/src/imageEdit/index.ts +1 -0
  190. package/src/imageEdit/persistence.ts +51 -0
  191. package/src/index.ts +2 -0
  192. package/src/jsonForm/index.ts +2 -0
  193. package/src/jsonForm/tokens.ts +78 -0
  194. package/src/markdown/annotationCoercion.ts +295 -0
  195. package/src/markdown/attrTokens.ts +241 -0
  196. package/src/markdown/convert.ts +229 -26
  197. package/src/markdown/index.ts +37 -0
  198. package/src/markdown/sanitize.ts +318 -0
  199. package/src/markdown/stringify.ts +96 -6
  200. package/src/markdown/types.ts +66 -0
  201. package/src/markdown/utils.ts +111 -2
  202. package/src/recommend/templates.ts +24 -0
  203. package/src/schemas/BlockTemplates.ts +133 -4
  204. package/src/schemas/CustomTemplates.ts +126 -0
  205. package/src/schemas/Doc.ts +387 -65
  206. package/src/schemas/ImageEditDoc.ts +11 -4
  207. package/src/schemas/Media.ts +169 -0
  208. package/src/schemas/Theme.ts +23 -1
  209. package/src/schemas/Transitions.ts +224 -0
  210. package/src/schemas/colorUtils.ts +33 -0
  211. package/src/schemas/fontStacks.ts +5 -2
  212. package/src/schemas/index.ts +3 -0
  213. package/src/schemas/themeCompile.ts +24 -5
  214. package/src/schemas/themeValidator.ts +49 -11
  215. package/src/schemas/themes/cinematic.json +69 -12
  216. package/src/schemas/themes/documentary.json +58 -11
  217. package/src/schemas/themes/gezellig.json +60 -11
  218. package/src/schemas/themes/magazine.json +54 -9
  219. package/src/schemas/themes/morning-light.json +52 -9
  220. package/src/schemas/themes/standard-dark.json +48 -13
  221. package/src/schemas/themes/standard.json +44 -12
  222. package/src/schemas/themes/tech-dark.json +65 -12
  223. package/src/spatial/Geohash.ts +52 -21
  224. package/src/storage/ContentContainer.ts +6 -2
  225. package/src/transform/applyTransform.ts +43 -4
  226. package/src/transform/index.ts +1 -0
  227. package/src/transform/registry.ts +44 -13
  228. package/src/transform/styles/dataDriven.ts +2 -1
  229. package/src/transform/styles/documentary.ts +2 -1
  230. package/src/transform/styles/magazine.ts +3 -1
  231. package/src/transform/styles/minimal.ts +2 -1
  232. package/src/transform/styles/narrative.ts +3 -1
  233. package/src/transform/templateSelector.ts +87 -11
  234. package/src/transform/types.ts +35 -2
  235. package/dist/chunk-2TMAWB4Y.js.map +0 -1
  236. package/dist/chunk-3E5F2XMR.js.map +0 -1
  237. package/dist/chunk-3K5OG6KI.js.map +0 -1
  238. package/dist/chunk-4X3JQXNM.js +0 -35
  239. package/dist/chunk-4X3JQXNM.js.map +0 -1
  240. package/dist/chunk-57CVQCFX.js.map +0 -1
  241. package/dist/chunk-5WFRKURX.js.map +0 -1
  242. package/dist/chunk-7UDSRZKG.js.map +0 -1
  243. package/dist/chunk-B4EEON3N.js.map +0 -1
  244. package/dist/chunk-FR2RBTKO.js.map +0 -1
  245. package/dist/chunk-H3AXU4MJ.js +0 -179
  246. package/dist/chunk-H3AXU4MJ.js.map +0 -1
  247. package/dist/chunk-K32VJONL.js.map +0 -1
  248. package/dist/chunk-KSWJR66U.js +0 -3706
  249. package/dist/chunk-KSWJR66U.js.map +0 -1
  250. package/dist/chunk-MYIH7FWD.js +0 -145
  251. package/dist/chunk-MYIH7FWD.js.map +0 -1
  252. package/dist/chunk-ZTX4PFFT.js.map +0 -1
  253. package/src/__tests__/slideshowGenerator.test.ts +0 -128
  254. package/src/generate/slideshowGenerator.ts +0 -273
@@ -1,3 +1,6 @@
1
+ import { az as Theme, ap as SurfaceScheme } from '../Doc-BBVGq1_9.js';
2
+ import '../types-DlAZ7MW4.js';
3
+
1
4
  /**
2
5
  * JSON Form types — Squisq's hint vocabulary layered on JSON Schema.
3
6
  *
@@ -188,4 +191,42 @@ interface InferSchemaOptions {
188
191
  }
189
192
  declare function inferSchema(sample: unknown, options?: InferSchemaOptions): SquisqAnnotatedSchema;
190
193
 
191
- export { type ControlKind, type InferSchemaOptions, type JsonFormValidationError, type JsonFormValidator, type SquisqAnnotatedSchema, type SquisqHints, type SquisqWhen, arrayItemKind, chooseControl, evaluateWhen, getByPointer, inferSchema, pointerSegments, primaryType, resolveFlag, resolveRef, setByPointer, toPointer };
194
+ /**
195
+ * Pure CSS-custom-property builder shared by `<JsonView>` (read-only, in
196
+ * `@bendyline/squisq-react`) and `<JsonEditor>` (editable, in
197
+ * `@bendyline/squisq-editor-react`).
198
+ *
199
+ * Both components derive an identical token bag from a Theme + resolved
200
+ * Surface; they differ only in the CSS-var prefix (`--squisq-json` vs
201
+ * `--squisq-jsonform`) so the viewer and editor can coexist on one page.
202
+ * This function is the single source of that derivation. It is pure and
203
+ * framework-free: it performs no `window` / `matchMedia` access — the
204
+ * surface must already be resolved to a concrete `SurfaceScheme` (or left
205
+ * `undefined` to skip surface application) by the calling React hook.
206
+ */
207
+
208
+ interface BuildJsonFormTokensOptions {
209
+ /**
210
+ * CSS-var prefix WITHOUT the trailing dash, e.g. `--squisq-json` or
211
+ * `--squisq-jsonform`. Each token key is `${prefix}-${name}`.
212
+ */
213
+ prefix: string;
214
+ }
215
+ /**
216
+ * Build the CSS custom-property map for a JSON form/view surface.
217
+ *
218
+ * @param theme The theme to render with (falls back to `DEFAULT_THEME`).
219
+ * @param surface Already-resolved concrete surface, or `undefined` to leave
220
+ * the theme un-surfaced. (The `'auto'` → concrete resolution
221
+ * is the React hook's job, so this stays pure.)
222
+ * @param options `{ prefix }` — the CSS-var namespace.
223
+ */
224
+ declare function buildJsonFormTokens(theme: Theme | undefined, surface: SurfaceScheme | undefined, options: BuildJsonFormTokensOptions): Record<string, string>;
225
+ /**
226
+ * Resolve the effective theme after surface application — the companion to
227
+ * `buildJsonFormTokens` for callers that also need the `Theme` object (both
228
+ * hooks return it alongside the style bag).
229
+ */
230
+ declare function resolveJsonFormTheme(theme: Theme | undefined, surface: SurfaceScheme | undefined): Theme;
231
+
232
+ export { type BuildJsonFormTokensOptions, type ControlKind, type InferSchemaOptions, type JsonFormValidationError, type JsonFormValidator, type SquisqAnnotatedSchema, type SquisqHints, type SquisqWhen, arrayItemKind, buildJsonFormTokens, chooseControl, evaluateWhen, getByPointer, inferSchema, pointerSegments, primaryType, resolveFlag, resolveJsonFormTheme, resolveRef, setByPointer, toPointer };
@@ -1,5 +1,6 @@
1
1
  import {
2
2
  arrayItemKind,
3
+ buildJsonFormTokens,
3
4
  chooseControl,
4
5
  evaluateWhen,
5
6
  getByPointer,
@@ -7,12 +8,18 @@ import {
7
8
  pointerSegments,
8
9
  primaryType,
9
10
  resolveFlag,
11
+ resolveJsonFormTheme,
10
12
  resolveRef,
11
13
  setByPointer,
12
14
  toPointer
13
- } from "../chunk-K32VJONL.js";
15
+ } from "../chunk-T5UK6YOB.js";
16
+ import "../chunk-A4O7GIWE.js";
17
+ import "../chunk-KKNUBQ6Y.js";
18
+ import "../chunk-DLXZMS5K.js";
19
+ import "../chunk-QE7TWGVT.js";
14
20
  export {
15
21
  arrayItemKind,
22
+ buildJsonFormTokens,
16
23
  chooseControl,
17
24
  evaluateWhen,
18
25
  getByPointer,
@@ -20,6 +27,7 @@ export {
20
27
  pointerSegments,
21
28
  primaryType,
22
29
  resolveFlag,
30
+ resolveJsonFormTheme,
23
31
  resolveRef,
24
32
  setByPointer,
25
33
  toPointer
@@ -1,5 +1,5 @@
1
- import { T as ParseOptions, l as MarkdownDocument, U as StringifyOptions, c as HtmlNode, F as MarkdownNode } from '../types-BdZkdJ3z.js';
2
- export { H as HeadingTemplateAnnotation, a as HtmlComment, b as HtmlElement, d as HtmlText, M as MarkdownBlockNode, e as MarkdownBlockquote, f as MarkdownBreak, g as MarkdownCodeBlock, h as MarkdownContainerDirective, i as MarkdownDefinitionDescription, j as MarkdownDefinitionList, k as MarkdownDefinitionTerm, m as MarkdownEmphasis, n as MarkdownFootnoteDefinition, o as MarkdownFootnoteReference, p as MarkdownHeading, q as MarkdownHtmlBlock, r as MarkdownImage, s as MarkdownImageReference, t as MarkdownInlineCode, u as MarkdownInlineHtml, v as MarkdownInlineMath, w as MarkdownInlineNode, x as MarkdownLeafDirective, y as MarkdownLink, z as MarkdownLinkDefinition, A as MarkdownLinkReference, B as MarkdownList, C as MarkdownListItem, D as MarkdownMathBlock, E as MarkdownMention, G as MarkdownParagraph, I as MarkdownPoint, J as MarkdownSourcePosition, K as MarkdownStrikethrough, L as MarkdownStrong, N as MarkdownTable, O as MarkdownTableCell, P as MarkdownTableRow, Q as MarkdownText, R as MarkdownTextDirective, S as MarkdownThematicBreak } from '../types-BdZkdJ3z.js';
1
+ import { V as ParseOptions, m as MarkdownDocument, W as StringifyOptions, H as HeadingAttributes, d as HtmlNode, I as MarkdownNode } from '../types-DlAZ7MW4.js';
2
+ export { a as HeadingTemplateAnnotation, b as HtmlComment, c as HtmlElement, e as HtmlText, M as MarkdownBlockNode, f as MarkdownBlockquote, g as MarkdownBreak, h as MarkdownCodeBlock, i as MarkdownContainerDirective, j as MarkdownDefinitionDescription, k as MarkdownDefinitionList, l as MarkdownDefinitionTerm, n as MarkdownEmphasis, o as MarkdownFootnoteDefinition, p as MarkdownFootnoteReference, q as MarkdownHeading, r as MarkdownHtmlBlock, s as MarkdownImage, t as MarkdownImageReference, u as MarkdownInlineCode, v as MarkdownInlineHtml, w as MarkdownInlineMath, x as MarkdownInlineNode, y as MarkdownLeafDirective, z as MarkdownLink, A as MarkdownLinkDefinition, B as MarkdownLinkReference, C as MarkdownList, E as MarkdownListItem, F as MarkdownMathBlock, G as MarkdownMention, J as MarkdownParagraph, K as MarkdownPoint, L as MarkdownSourcePosition, N as MarkdownStrikethrough, O as MarkdownStrong, P as MarkdownTable, Q as MarkdownTableCell, R as MarkdownTableRow, S as MarkdownText, T as MarkdownTextDirective, U as MarkdownThematicBreak } from '../types-DlAZ7MW4.js';
3
3
 
4
4
  /**
5
5
  * Markdown → JSON Parser
@@ -112,6 +112,29 @@ interface MdastNode {
112
112
  attributes?: Record<string, string>;
113
113
  data?: Record<string, unknown>;
114
114
  }
115
+ /**
116
+ * Parse the inner content of a Pandoc-style `{…}` block. Tokens are
117
+ * whitespace-separated, with quoted runs (single or double) treated as
118
+ * single tokens — tokenization is shared with the `{[…]}` template
119
+ * annotation parser via {@link tokenizeAttrTokens}.
120
+ *
121
+ * - `#id` → `attributes.id`
122
+ * - `.class` → push onto `attributes.classes`
123
+ * - `key=value` or `key="quoted value"` → `attributes.params[key] = value`
124
+ *
125
+ * Empty `{}` yields `{}` (preserved as an annotation marker for round-tripping).
126
+ * Duplicate ids and keys: last wins, silent.
127
+ */
128
+ declare function parsePandocAttrTokens(inner: string): HeadingAttributes;
129
+ /**
130
+ * Serialize a HeadingAttributes object back to a Pandoc `{#id .class key=value}` string.
131
+ * Returns null when the attributes object is entirely empty (nothing to emit).
132
+ *
133
+ * Canonical key order: `#id`, then `.classes` (in original order), then
134
+ * params in their original insertion order. Values are quoted via the
135
+ * shared {@link quoteAttrValue} rule (same as `{[…]}` serialization).
136
+ */
137
+ declare function serializePandocAttributes(attrs: HeadingAttributes): string | null;
115
138
  /**
116
139
  * Convert an mdast Root node to a MarkdownDocument.
117
140
  *
@@ -130,6 +153,164 @@ declare function fromMdast(root: MdastNode, options?: {
130
153
  */
131
154
  declare function toMdast(doc: MarkdownDocument): MdastNode;
132
155
 
156
+ /**
157
+ * Shared key=value attribute machinery for the two heading annotation forms:
158
+ * the squisq-native `{[templateName key=value …]}` template annotation and
159
+ * the Pandoc-style `{#id .class key=value}` attribute block.
160
+ *
161
+ * Both forms share one interior grammar — whitespace-separated tokens whose
162
+ * values may be quoted (double or single) to include spaces, brackets, or
163
+ * quote characters. This module is the single implementation of that
164
+ * grammar: one tokenizer, one value un/escaper, one quoting rule. The
165
+ * trailing-annotation recognizers live here too so the editor bridge
166
+ * (packages/editor-react/src/tiptapBridge.ts) stays in sync by importing
167
+ * them rather than copying regexes.
168
+ *
169
+ * Value syntax:
170
+ * - Unquoted: no whitespace, quotes, or `[ ] { }` (those would collide with
171
+ * the surrounding annotation delimiters), e.g. `columns=3`, `name=O'Brien`
172
+ * (a quote *inside* an unquoted value is literal).
173
+ * - Quoted: `key="value with spaces"` or `key='…'`. Inside a quoted run,
174
+ * `\` escapes the active quote character and itself; any other `\` is
175
+ * literal. Quoted values may contain `]` and `}`.
176
+ * - Serialization emits double quotes, switching to single quotes when the
177
+ * value contains a double quote (markdown character-escape resolution
178
+ * makes backslash-escaped quotes fragile in `.md` source, so picking the
179
+ * other quote character is preferred over escaping). A value containing
180
+ * BOTH quote characters falls back to double quotes with `\"` escapes —
181
+ * that survives the API path but is best avoided in markdown source.
182
+ */
183
+ /** Result of matching a trailing annotation against a text run. */
184
+ interface TrailingAnnotationMatch {
185
+ /** Interior of the brace block (between `{[`/`{` and `]}`/`}`), untrimmed. */
186
+ inner: string;
187
+ /** Offset of the match start (including leading whitespace) in the input. */
188
+ index: number;
189
+ }
190
+ /**
191
+ * Match a trailing `{[templateName key=value …]}` annotation. Quote-aware
192
+ * (values may contain `]` when quoted), with a legacy fallback so inputs
193
+ * the old `[^\]]+` grammar accepted still match.
194
+ */
195
+ declare function matchTrailingTemplateAnnotation(text: string): TrailingAnnotationMatch | null;
196
+ /**
197
+ * Match a trailing Pandoc `{#id .class key=value}` block. Quote-aware
198
+ * (values may contain `}` when quoted), with a legacy fallback.
199
+ */
200
+ declare function matchTrailingPandocAttr(text: string): TrailingAnnotationMatch | null;
201
+ /**
202
+ * Quote-aware whitespace tokenizer for the interior of either annotation
203
+ * form.
204
+ *
205
+ * A quote run starts only at the beginning of a token or immediately after
206
+ * `=` — a quote elsewhere (e.g. `name=O'Brien`) is a literal character.
207
+ * Inside a run, `\` escapes the active quote character and itself; the
208
+ * escape pair is preserved in the returned token (callers strip and
209
+ * unescape via {@link splitKeyValueToken} / {@link unquoteAttrValue}).
210
+ * An unbalanced opening quote is tolerated: the run extends to the end of
211
+ * the input.
212
+ */
213
+ declare function tokenizeAttrTokens(input: string): string[];
214
+ /**
215
+ * Strip surrounding quotes from a raw token value and unescape the active
216
+ * quote character and backslash. Values not wrapped in matching quotes are
217
+ * returned verbatim (including any interior quotes or backslashes).
218
+ */
219
+ declare function unquoteAttrValue(raw: string): string;
220
+ /**
221
+ * Split a `key=value` token into its parts, unquoting/unescaping the value.
222
+ * Returns null for tokens with no `=` past the first character (bare words,
223
+ * `#id`, `.class`, or a leading `=`).
224
+ */
225
+ declare function splitKeyValueToken(token: string): {
226
+ key: string;
227
+ value: string;
228
+ } | null;
229
+ /**
230
+ * Whether a value must be quoted to survive tokenization and the outer
231
+ * annotation regexes: any whitespace, quote character, bracket, or brace —
232
+ * or an empty value, which would otherwise serialize as a bare `key=`.
233
+ */
234
+ declare function needsQuoting(value: string): boolean;
235
+ /**
236
+ * Serialize an attribute value, quoting when {@link needsQuoting} says the
237
+ * bare form would not round-trip.
238
+ *
239
+ * Double quotes are canonical; a value containing a double quote (but no
240
+ * single quote) is single-quoted instead, because markdown resolves
241
+ * backslash escapes in text runs before our parser sees them — switching
242
+ * the quote character round-trips through `.md` source where `\"` would
243
+ * not. Backslashes and the active quote character are escaped.
244
+ */
245
+ declare function quoteAttrValue(value: string): string;
246
+
247
+ /**
248
+ * Heading-attribute value coercion.
249
+ *
250
+ * The Pandoc-style heading attribute block `{#id .class key=value}` parses
251
+ * to a flat `Record<string, string>` of `key → raw value`. This module
252
+ * coerces a known subset of keys to typed values (numbers, time-in-seconds,
253
+ * `BlockConnection[]`) so downstream consumers don't have to re-parse them.
254
+ *
255
+ * Unknown keys are returned in `metadata` as raw strings. Malformed known-key
256
+ * values are dropped from the typed result and reported via `warnings` (the
257
+ * raw string is preserved in `params` upstream for lossless round-tripping —
258
+ * coercion failures do not corrupt the source).
259
+ */
260
+
261
+ /**
262
+ * Registry of known block-meta keys and their coercion strategies.
263
+ *
264
+ * Adding a new typed key: add an entry here, add the typed field to
265
+ * `HeadingAttributes.blockMeta` in `types.ts`, and apply the coerced value
266
+ * in `markdownToDoc.ts`.
267
+ */
268
+ declare const KNOWN_BLOCK_META_KEYS: {
269
+ readonly x: "number";
270
+ readonly y: "number";
271
+ readonly startTime: "time";
272
+ readonly duration: "time";
273
+ readonly connectsTo: "connectionList";
274
+ readonly transition: "transition";
275
+ readonly transitionDuration: "time";
276
+ readonly transitionDirection: "transitionDirection";
277
+ };
278
+ type KnownBlockMetaKey = keyof typeof KNOWN_BLOCK_META_KEYS;
279
+ /**
280
+ * Editor-facing description of a known block-meta key: what it does, and
281
+ * either its closed set of valid values or a free-form format hint. This is
282
+ * the single source the markdown editor's `{[name key=value]}` attribute
283
+ * autocomplete reads from, so the suggestion list stays in lockstep with
284
+ * `KNOWN_BLOCK_META_KEYS` and the transition vocabulary rather than drifting
285
+ * in a hand-maintained copy. `values`/`valueHint` are mutually exclusive: a
286
+ * key has a closed enum (`values`) or a format hint (`valueHint`), not both.
287
+ */
288
+ interface BlockMetaKeyDescriptor {
289
+ key: KnownBlockMetaKey;
290
+ /** One-line description, shown as the completion item's detail. */
291
+ description: string;
292
+ /** Closed set of valid values, for keys backed by an enum. */
293
+ values?: readonly string[];
294
+ /** Format hint shown when the value is free-form (no closed set). */
295
+ valueHint?: string;
296
+ }
297
+ /**
298
+ * Ordered descriptors for every key in `KNOWN_BLOCK_META_KEYS`. Order is the
299
+ * suggestion display order: the transition family first (the most common
300
+ * authoring case), then timeline timing, then diagram geometry/links.
301
+ */
302
+ declare const BLOCK_META_KEY_DESCRIPTORS: readonly BlockMetaKeyDescriptor[];
303
+ /**
304
+ * Parse a time value to seconds. Accepts:
305
+ * - bare number: `5` → 5, `5.5` → 5.5
306
+ * - `mm:ss`: `01:30` → 90
307
+ * - `mm:ss.ms`: `01:30.500` → 90.5
308
+ * - `1500ms` → 1.5
309
+ *
310
+ * Returns null on malformed input.
311
+ */
312
+ declare function parseTimeSeconds(raw: string): number | null;
313
+
133
314
  /**
134
315
  * HTML ↔ HtmlNode Conversion
135
316
  *
@@ -156,6 +337,31 @@ declare function parseHtmlToNodes(html: string): HtmlNode[];
156
337
  */
157
338
  declare function stringifyHtmlNodes(nodes: HtmlNode[]): string;
158
339
 
340
+ type HtmlPolicy = 'strip' | 'sanitize' | 'trusted';
341
+ type UrlKind = 'link' | 'media';
342
+ interface SanitizeUrlOptions {
343
+ /**
344
+ * Extra lowercase schemes allowed for `kind: 'link'` — the host-app escape
345
+ * hatch for custom link protocols it intercepts itself (e.g. an app-internal
346
+ * navigation scheme). Executable schemes are refused regardless.
347
+ */
348
+ extraLinkSchemes?: readonly string[];
349
+ }
350
+ /**
351
+ * Sanitize a URL for a rendered link or media attribute.
352
+ *
353
+ * Relative URLs are allowed. Absolute URLs are restricted to schemes that
354
+ * cannot execute script in a document context. Media URLs additionally allow
355
+ * `blob:` and image/audio/video `data:` URLs because Squisq uses both for
356
+ * browser-local media previews and self-contained exports.
357
+ */
358
+ declare function sanitizeUrl(url: string | null | undefined, kind?: UrlKind, options?: SanitizeUrlOptions): string | null;
359
+ /**
360
+ * Return a sanitized copy of an HtmlNode tree. The original parsed tree is left
361
+ * untouched so markdown stringify can still preserve source fidelity.
362
+ */
363
+ declare function sanitizeHtmlNodes(nodes: HtmlNode[]): HtmlNode[];
364
+
159
365
  /**
160
366
  * Markdown Tree Utilities
161
367
  *
@@ -228,6 +434,14 @@ declare function countNodes(node: MarkdownNode): number;
228
434
  * @returns A record of string keys to parsed values, or null
229
435
  */
230
436
  declare function parseFrontmatter(yaml: string): Record<string, unknown> | null;
437
+ /**
438
+ * Format a multi-line string as a YAML literal block scalar body, i.e.
439
+ * `|-` followed by each source line indented two spaces. Paired with
440
+ * {@link parseFrontmatter}'s block-scalar reader so multi-line frontmatter
441
+ * values (e.g. pretty-printed JSON payloads) round-trip. Blank lines stay
442
+ * blank (no trailing whitespace) so the output diffs cleanly.
443
+ */
444
+ declare function formatBlockScalar(value: string): string;
231
445
  /**
232
446
  * Update a markdown source string's YAML frontmatter block, applying the
233
447
  * given key/value updates. A `null` or `undefined` value removes the key.
@@ -273,5 +487,16 @@ declare function inferDocumentTitle(doc: MarkdownDocument): string | undefined;
273
487
  * spelling later is a one-file change.
274
488
  */
275
489
  declare function readFrontmatterThemeId(frontmatter: Record<string, unknown> | undefined): string | undefined;
490
+ /**
491
+ * Project an inline-HTML string (as stored on `TextLayer.content.html`) down
492
+ * to plain text — the value mirrored into `content.text` for plain consumers
493
+ * (PDF/markdown export, search, accessibility) and the SVG `<text>` fallback.
494
+ *
495
+ * `<br>` and block-level tags (`p`, `div`, `h1`–`h6`, `li`, `blockquote`,
496
+ * `pre`) become line breaks so multi-line rich content reads sensibly. Entity
497
+ * decoding is handled by {@link parseHtmlToNodes} (parse5-backed), so this is
498
+ * more correct than a regex tag-stripper.
499
+ */
500
+ declare function plainTextFromInlineHtml(html: string): string;
276
501
 
277
- export { HtmlNode, MarkdownDocument, MarkdownNode, ParseOptions, StringifyOptions, countNodes, createDocument, extractPlainText, findNodesByType, fromMdast, getChildren, inferDocumentTitle, parseFrontmatter, parseHtmlToNodes, parseMarkdown, readFrontmatterThemeId, setFrontmatterValues, stringifyHtmlNodes, stringifyMarkdown, toMdast, walkMarkdownTree };
502
+ export { BLOCK_META_KEY_DESCRIPTORS, type BlockMetaKeyDescriptor, HeadingAttributes, HtmlNode, type HtmlPolicy, KNOWN_BLOCK_META_KEYS, type KnownBlockMetaKey, MarkdownDocument, MarkdownNode, ParseOptions, type SanitizeUrlOptions, StringifyOptions, type TrailingAnnotationMatch, type UrlKind, countNodes, createDocument, extractPlainText, findNodesByType, formatBlockScalar, fromMdast, getChildren, inferDocumentTitle, matchTrailingPandocAttr, matchTrailingTemplateAnnotation, needsQuoting, parseFrontmatter, parseHtmlToNodes, parseMarkdown, parsePandocAttrTokens, parseTimeSeconds, plainTextFromInlineHtml, quoteAttrValue, readFrontmatterThemeId, sanitizeHtmlNodes, sanitizeUrl, serializePandocAttributes, setFrontmatterValues, splitKeyValueToken, stringifyHtmlNodes, stringifyMarkdown, toMdast, tokenizeAttrTokens, unquoteAttrValue, walkMarkdownTree };
@@ -1,40 +1,75 @@
1
1
  import {
2
+ sanitizeHtmlNodes,
3
+ sanitizeUrl,
4
+ stringifyMarkdown
5
+ } from "../chunk-6ATE2PSM.js";
6
+ import {
7
+ BLOCK_META_KEY_DESCRIPTORS,
8
+ KNOWN_BLOCK_META_KEYS,
2
9
  fromMdast,
3
- parseHtmlToNodes,
10
+ matchTrailingPandocAttr,
11
+ matchTrailingTemplateAnnotation,
12
+ needsQuoting,
4
13
  parseMarkdown,
5
- stringifyHtmlNodes,
6
- stringifyMarkdown,
7
- toMdast
8
- } from "../chunk-3K5OG6KI.js";
9
- import "../chunk-DBS6RIFL.js";
14
+ parsePandocAttrTokens,
15
+ parseTimeSeconds,
16
+ quoteAttrValue,
17
+ serializePandocAttributes,
18
+ splitKeyValueToken,
19
+ toMdast,
20
+ tokenizeAttrTokens,
21
+ unquoteAttrValue
22
+ } from "../chunk-TEEEILMP.js";
10
23
  import {
11
24
  countNodes,
12
25
  createDocument,
13
26
  extractPlainText,
14
27
  findNodesByType,
28
+ formatBlockScalar,
15
29
  getChildren,
16
30
  inferDocumentTitle,
17
31
  parseFrontmatter,
32
+ parseHtmlToNodes,
33
+ plainTextFromInlineHtml,
18
34
  readFrontmatterThemeId,
19
35
  setFrontmatterValues,
36
+ stringifyHtmlNodes,
20
37
  walkMarkdownTree
21
- } from "../chunk-H3AXU4MJ.js";
38
+ } from "../chunk-HWVFJAAH.js";
39
+ import "../chunk-DBS6RIFL.js";
40
+ import "../chunk-QE7TWGVT.js";
22
41
  export {
42
+ BLOCK_META_KEY_DESCRIPTORS,
43
+ KNOWN_BLOCK_META_KEYS,
23
44
  countNodes,
24
45
  createDocument,
25
46
  extractPlainText,
26
47
  findNodesByType,
48
+ formatBlockScalar,
27
49
  fromMdast,
28
50
  getChildren,
29
51
  inferDocumentTitle,
52
+ matchTrailingPandocAttr,
53
+ matchTrailingTemplateAnnotation,
54
+ needsQuoting,
30
55
  parseFrontmatter,
31
56
  parseHtmlToNodes,
32
57
  parseMarkdown,
58
+ parsePandocAttrTokens,
59
+ parseTimeSeconds,
60
+ plainTextFromInlineHtml,
61
+ quoteAttrValue,
33
62
  readFrontmatterThemeId,
63
+ sanitizeHtmlNodes,
64
+ sanitizeUrl,
65
+ serializePandocAttributes,
34
66
  setFrontmatterValues,
67
+ splitKeyValueToken,
35
68
  stringifyHtmlNodes,
36
69
  stringifyMarkdown,
37
70
  toMdast,
71
+ tokenizeAttrTokens,
72
+ unquoteAttrValue,
38
73
  walkMarkdownTree
39
74
  };
40
75
  //# sourceMappingURL=index.js.map
@@ -1,4 +1,4 @@
1
- import { M as MarkdownBlockNode } from '../types-BdZkdJ3z.js';
1
+ import { M as MarkdownBlockNode } from '../types-DlAZ7MW4.js';
2
2
 
3
3
  /**
4
4
  * Block template recommendations.
@@ -1,8 +1,9 @@
1
+ import "../chunk-ZLQKNOZQ.js";
1
2
  import {
2
3
  profileBlockContents,
3
4
  recommendTemplatesForBlock
4
- } from "../chunk-WMOI7FN3.js";
5
- import "../chunk-H3AXU4MJ.js";
5
+ } from "../chunk-UY7KGQ5R.js";
6
+ import "../chunk-HWVFJAAH.js";
6
7
  export {
7
8
  profileBlockContents,
8
9
  recommendTemplatesForBlock
@@ -1,10 +1,10 @@
1
1
  export { B as BoundingBox, C as Coordinates } from '../Types-sh2VRxfo.js';
2
- import { af as Theme, q as DeepPartial, aj as ThemeSeedColors, ag as ThemeColorPalette, v as FontFamilyKind, u as FontFamily } from '../Doc-BeSeH2iX.js';
3
- export { A as AccentImage, a as AccentPosition, b as Animation, c as AnimationType, d as AudioBookmark, e as AudioSegment, f as AudioTimingData, g as AudioTrack, B as Block, C as CaptionPhrase, h as CaptionTrack, i as CaptionWord, j as ColorScheme, k as ComparisonBarInput, l as CornerBrandingConfig, D as DARK_SURFACE, m as DEFAULT_DOC_FONT, n as DEFAULT_TITLE_FONT, o as DataTableInput, p as DateEventInput, r as DefinitionCardInput, s as Doc, t as DocBlock, F as FactCardInput, w as FullBleedQuoteInput, G as GradientBackgroundConfig, I as ImageBackgroundConfig, x as ImageLayer, y as ImageWithCaptionInput, L as LIGHT_SURFACE, z as Layer, E as LayoutHints, H as LeftFeatureInput, J as ListBlockInput, M as MapBlockInput, K as MapLayer, N as MapMarker, O as MapTileStyle, P as PatternBackgroundConfig, Q as PersistentLayer, R as PersistentLayerConfig, S as PersistentLayerTemplate, T as PersistentLayerTemplateConfig, U as PersistentLayerTemplateType, V as PhotoGridInput, W as Position, X as ProgressIndicatorConfig, Y as PullQuoteInput, Z as QuoteBlockInput, _ as RenderStyle, $ as RightFeatureInput, a0 as SectionHeaderInput, a1 as ShapeLayer, a2 as SolidBackgroundConfig, a3 as StartBlockConfig, a4 as StatHighlightInput, a5 as SurfaceScheme, a6 as THEME_SCHEMA_VERSION, a7 as TableLayer, a8 as TableLayerStyle, a9 as TemplateBlock, aa as TemplateContext, ab as TemplateFunction, ac as TemplateRegistry, ad as TextLayer, ae as TextStyle, ah as ThemeColorScheme, ai as ThemeSchemaVersion, ak as ThemeStyle, al as ThemeTypography, am as TitleBlockInput, an as TitleCaptionConfig, ao as Transition, ap as TransitionType, aq as TwoColumnInput, ar as VIEWPORT_PRESETS, as as VideoLayer, at as VideoPullQuoteInput, au as VideoWithCaptionInput, av as ViewportConfig, aw as ViewportOrientation, ax as ViewportPreset, ay as applySurface, az as calculateDuration, aA as calculateFontScale, aB as createTemplateContext, aC as createTheme, aD as getAspectRatioString, aE as getBlockAtTime, aF as getCaptionAtTime, aG as getLayoutHints, aH as getRegisteredThemes, aI as getSafeTextBounds, aJ as getSegmentAtTime, aK as getTwoColumnPositions, aL as getViewport, aM as getViewportOrientation, aN as isPersistentLayerTemplate, aO as isTemplateBlock, aP as layoutScaledFontSize, aQ as lookupRegisteredTheme, aR as registerTheme, aS as scaledFontSize, aT as unregisterTheme, aU as validateDoc } from '../Doc-BeSeH2iX.js';
4
- export { D as DEFAULT_THEME, a as DEFAULT_THEME_ID, T as THEMES, g as getAvailableThemes, b as getThemeSummaries, r as resolveTheme } from '../themeLibrary-BHjJ0Qx6.js';
2
+ import { az as Theme, v as DeepPartial, aD as ThemeSeedColors, aA as ThemeColorPalette, K as FontFamilyKind, J as FontFamily } from '../Doc-BBVGq1_9.js';
3
+ export { A as AccentImage, a as AccentPosition, b as AmbientGradientConfig, c as Animation, d as AnimationType, e as AudioBookmark, f as AudioSegment, g as AudioTimingData, h as AudioTrack, B as Block, i as BlockConnection, j as BorderStyle, C as CaptionPhrase, k as CaptionTrack, l as CaptionWord, m as ColorScheme, n as ComparisonBarInput, o as CornerBrandingConfig, p as CustomTemplateDefinition, q as CustomTemplateLayer, D as DARK_SURFACE, r as DEFAULT_DOC_FONT, s as DEFAULT_TITLE_FONT, t as DataTableInput, u as DateEventInput, w as DefinitionCardInput, x as DiagramBlockInput, y as Doc, z as DocBlock, E as DocDiagnostic, F as DrawingBlockInput, G as FRONTMATTER_CUSTOM_TEMPLATES_KEY, H as FRONTMATTER_CUSTOM_THEMES_KEY, I as FactCardInput, L as FullBleedQuoteInput, M as GradientBackgroundConfig, N as ImageBackgroundConfig, O as ImageLayer, P as ImageTreatment, Q as ImageWithCaptionInput, R as LIGHT_SURFACE, S as Layer, T as LayerRepeat, U as LayoutHints, V as LeftFeatureInput, W as LinearGradient, X as ListBlockInput, Y as MapBlockInput, Z as MapLayer, _ as MapMarker, $ as MapTileStyle, a0 as MarkerStyle, a1 as MediaClip, a2 as PathLayer, a3 as PatternBackgroundConfig, a4 as PersistentLayer, a5 as PersistentLayerConfig, a6 as PersistentLayerTemplate, a7 as PersistentLayerTemplateConfig, a8 as PersistentLayerTemplateType, a9 as PhotoGridInput, aa as Position, ab as ProgressIndicatorConfig, ac as PullQuoteInput, ad as QuoteBlockInput, ae as RawLayersInput, af as RenderStyle, ag as RightFeatureInput, ah as ScheduledClip, ai as SectionHeaderInput, aj as ShapeFilter, ak as ShapeLayer, al as ShapePattern, am as SolidBackgroundConfig, an as StartBlockConfig, ao as StatHighlightInput, ap as SurfaceScheme, aq as THEME_SCHEMA_VERSION, ar as TableLayer, as as TableLayerStyle, at as TemplateBlock, au as TemplateContext, av as TemplateFunction, aw as TemplateRegistry, ax as TextLayer, ay as TextStyle, aB as ThemeColorScheme, aC as ThemeSchemaVersion, aE as ThemeStyle, aF as ThemeTypography, aG as TitleBlockInput, aH as TitleCaptionConfig, aI as TwoColumnInput, aJ as VIEWPORT_PRESETS, aK as VideoLayer, aL as VideoPullQuoteInput, aM as VideoWithCaptionInput, aN as ViewportConfig, aO as ViewportOrientation, aP as ViewportPreset, aQ as VignetteConfig, aR as applySurface, aS as calculateDuration, aT as calculateFontScale, aU as createTemplateContext, aV as createTheme, aW as getAspectRatioString, aX as getBlockAtTime, aY as getCaptionAtTime, aZ as getDocPlaybackDuration, a_ as getLayoutHints, a$ as getRegisteredThemes, b0 as getSafeTextBounds, b1 as getSegmentAtTime, b2 as getTwoColumnPositions, b3 as getViewport, b4 as getViewportOrientation, b5 as isPersistentLayerTemplate, b6 as isTemplateBlock, b7 as layoutScaledFontSize, b8 as lookupRegisteredTheme, b9 as registerTheme, ba as resolveMediaSchedule, bb as scaledFontSize, bc as unregisterTheme } from '../Doc-BBVGq1_9.js';
4
+ export { D as DEFAULT_TRANSITION_DURATION_SECONDS, X as TRANSITION_DIRECTIONS, Y as TRANSITION_TYPES, Z as Transition, _ as TransitionDirection, $ as TransitionType, a0 as isTransitionType, a1 as normalizeTransitionDirection, a2 as normalizeTransitionType, a3 as resolveBlockTransition, a4 as resolveTransitionDuration } from '../types-DlAZ7MW4.js';
5
+ export { D as DEFAULT_THEME, a as DEFAULT_THEME_ID, T as THEMES, g as getAvailableThemes, b as getThemeSummaries, r as resolveTheme } from '../themeLibrary-CehcJhzz.js';
5
6
  export { M as MediaEntry, a as MediaProvider } from '../MediaProvider-wpSe21B3.js';
6
- export { E as EditorLayerMeta, I as ImageEditCanvas, a as ImageEditDoc, b as ImageEditLayer, c as ImageEditLayerKind, d as ImageEditMeta } from '../ImageEditDoc-BTIvw0oq.js';
7
- import '../types-BdZkdJ3z.js';
7
+ export { E as EditorLayerMeta, I as ImageEditCanvas, a as ImageEditDoc, b as ImageEditLayer, c as ImageEditLayerKind, d as ImageEditMeta } from '../ImageEditDoc-FuyGtt6o.js';
8
8
 
9
9
  /**
10
10
  * Theme Validator
@@ -60,11 +60,19 @@ type ContrastPreset = 'subtle' | 'balanced' | 'high';
60
60
  interface CompileOptions {
61
61
  /** Contrast level for OKLCh derivation (default 'balanced'). */
62
62
  contrast?: ContrastPreset;
63
+ /**
64
+ * Base theme to inherit from. When provided, the partial is deep-merged
65
+ * over this theme instead of the neutral `STARTER_THEME`, so the compiled
66
+ * theme inherits the base's render style, color schemes, typography, and
67
+ * persistent layers — and only the fields the user changed are overridden.
68
+ * The base's id is recorded on the result as `basedOn`.
69
+ */
70
+ base?: Theme;
63
71
  }
64
72
  /**
65
73
  * Compile a partial Theme into a complete one. Fills missing fields from
66
- * `STARTER_THEME`, derives missing color slots from `seedColors` (when
67
- * present), and validates the result.
74
+ * the base (`opts.base` when given, else `STARTER_THEME`), derives missing
75
+ * color slots from `seedColors` (when present), and validates the result.
68
76
  */
69
77
  declare function compileTheme(partial: DeepPartial<Theme>, opts?: CompileOptions): Theme;
70
78
  /**
@@ -164,6 +172,18 @@ declare function oklchSetChroma(hex: string, multiplier: number): string;
164
172
  * WCAG relative luminance of a hex color, returned as 0..1.
165
173
  */
166
174
  declare function relativeLuminance(hex: string): number;
175
+ /**
176
+ * Hue of a hex color in HSL degrees (0..360). Returns 0 for pure grays
177
+ * and on parse failure. Used by the duotone image treatment to aim its
178
+ * `hue-rotate()` at the theme's tint color.
179
+ */
180
+ declare function hexHueDegrees(hex: string): number;
181
+ /**
182
+ * Convert a hex color + alpha (0..1) to an `rgba()` string.
183
+ * Falls back to the input on parse failure (e.g. a value that is
184
+ * already an rgba()/gradient string).
185
+ */
186
+ declare function withAlpha(hex: string, alpha: number): string;
167
187
  /**
168
188
  * WCAG contrast ratio between two hex colors. Returns 1..21.
169
189
  */
@@ -185,4 +205,4 @@ declare function deriveScale(seedHex: string, spread?: number): {
185
205
  darker2: string;
186
206
  };
187
207
 
188
- export { AVAILABLE_FONT_STACKS, type CompileOptions, type ContrastPreset, DeepPartial, FONT_FALLBACKS, FontFamily, FontFamilyKind, type FontStack, STARTER_THEME, Theme, ThemeColorPalette, ThemeSeedColors, type ValidationError, type ValidationResult, assertTheme, buildGoogleFontsUrl, compileTheme, contrastRatio, deriveColorPalette, deriveScale, fontStack, getFontStack, isHex, oklchDarken, oklchLighten, oklchSetChroma, parseTheme, pickContrastingText, relativeLuminance, resolveFontFamily, serializeTheme, validateTheme };
208
+ export { AVAILABLE_FONT_STACKS, type CompileOptions, type ContrastPreset, DeepPartial, FONT_FALLBACKS, FontFamily, FontFamilyKind, type FontStack, STARTER_THEME, Theme, ThemeColorPalette, ThemeSeedColors, type ValidationError, type ValidationResult, assertTheme, buildGoogleFontsUrl, compileTheme, contrastRatio, deriveColorPalette, deriveScale, fontStack, getFontStack, hexHueDegrees, isHex, oklchDarken, oklchLighten, oklchSetChroma, parseTheme, pickContrastingText, relativeLuminance, resolveFontFamily, serializeTheme, validateTheme, withAlpha };
@@ -5,17 +5,20 @@ import {
5
5
  deriveColorPalette,
6
6
  getBlockAtTime,
7
7
  getCaptionAtTime,
8
+ getDocPlaybackDuration,
8
9
  getSegmentAtTime,
9
10
  parseTheme,
10
- serializeTheme,
11
- validateDoc
12
- } from "../chunk-57CVQCFX.js";
11
+ resolveMediaSchedule,
12
+ serializeTheme
13
+ } from "../chunk-A4O7GIWE.js";
13
14
  import {
14
15
  AVAILABLE_FONT_STACKS,
15
16
  DARK_SURFACE,
16
17
  DEFAULT_THEME,
17
18
  DEFAULT_THEME_ID,
18
19
  FONT_FALLBACKS,
20
+ FRONTMATTER_CUSTOM_TEMPLATES_KEY,
21
+ FRONTMATTER_CUSTOM_THEMES_KEY,
19
22
  LIGHT_SURFACE,
20
23
  THEMES,
21
24
  THEME_SCHEMA_VERSION,
@@ -30,6 +33,7 @@ import {
30
33
  getFontStack,
31
34
  getRegisteredThemes,
32
35
  getThemeSummaries,
36
+ hexHueDegrees,
33
37
  isHex,
34
38
  lookupRegisteredTheme,
35
39
  oklchDarken,
@@ -41,8 +45,9 @@ import {
41
45
  resolveFontFamily,
42
46
  resolveTheme,
43
47
  unregisterTheme,
44
- validateTheme
45
- } from "../chunk-B4EEON3N.js";
48
+ validateTheme,
49
+ withAlpha
50
+ } from "../chunk-KKNUBQ6Y.js";
46
51
  import {
47
52
  DEFAULT_DOC_FONT,
48
53
  DEFAULT_TITLE_FONT,
@@ -59,7 +64,17 @@ import {
59
64
  isTemplateBlock,
60
65
  scaledFontSize,
61
66
  scaledFontSize2
62
- } from "../chunk-5WFRKURX.js";
67
+ } from "../chunk-DLXZMS5K.js";
68
+ import {
69
+ DEFAULT_TRANSITION_DURATION_SECONDS,
70
+ TRANSITION_DIRECTIONS,
71
+ TRANSITION_TYPES,
72
+ isTransitionType,
73
+ normalizeTransitionDirection,
74
+ normalizeTransitionType,
75
+ resolveBlockTransition,
76
+ resolveTransitionDuration
77
+ } from "../chunk-QE7TWGVT.js";
63
78
  export {
64
79
  AVAILABLE_FONT_STACKS,
65
80
  DARK_SURFACE,
@@ -67,11 +82,16 @@ export {
67
82
  DEFAULT_THEME,
68
83
  DEFAULT_THEME_ID,
69
84
  DEFAULT_TITLE_FONT,
85
+ DEFAULT_TRANSITION_DURATION_SECONDS,
70
86
  FONT_FALLBACKS,
87
+ FRONTMATTER_CUSTOM_TEMPLATES_KEY,
88
+ FRONTMATTER_CUSTOM_THEMES_KEY,
71
89
  LIGHT_SURFACE,
72
90
  STARTER_THEME,
73
91
  THEMES,
74
92
  THEME_SCHEMA_VERSION,
93
+ TRANSITION_DIRECTIONS,
94
+ TRANSITION_TYPES,
75
95
  VIEWPORT_PRESETS,
76
96
  applySurface,
77
97
  assertTheme,
@@ -89,6 +109,7 @@ export {
89
109
  getAvailableThemes,
90
110
  getBlockAtTime,
91
111
  getCaptionAtTime,
112
+ getDocPlaybackDuration,
92
113
  getFontStack,
93
114
  getLayoutHints,
94
115
  getRegisteredThemes,
@@ -98,11 +119,15 @@ export {
98
119
  getTwoColumnPositions,
99
120
  getViewport,
100
121
  getViewportOrientation,
122
+ hexHueDegrees,
101
123
  isHex,
102
124
  isPersistentLayerTemplate,
103
125
  isTemplateBlock,
126
+ isTransitionType,
104
127
  scaledFontSize as layoutScaledFontSize,
105
128
  lookupRegisteredTheme,
129
+ normalizeTransitionDirection,
130
+ normalizeTransitionType,
106
131
  oklchDarken,
107
132
  oklchLighten,
108
133
  oklchSetChroma,
@@ -110,12 +135,15 @@ export {
110
135
  pickContrastingText,
111
136
  registerTheme,
112
137
  relativeLuminance,
138
+ resolveBlockTransition,
113
139
  resolveFontFamily,
140
+ resolveMediaSchedule,
114
141
  resolveTheme,
142
+ resolveTransitionDuration,
115
143
  scaledFontSize2 as scaledFontSize,
116
144
  serializeTheme,
117
145
  unregisterTheme,
118
- validateDoc,
119
- validateTheme
146
+ validateTheme,
147
+ withAlpha
120
148
  };
121
149
  //# sourceMappingURL=index.js.map