@bendyline/squisq 1.3.0 → 1.4.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 (533) hide show
  1. package/dist/{Doc-Ch4tc3vv.d.ts → Doc-BeSeH2iX.d.ts} +118 -41
  2. package/dist/ImageEditDoc-BTIvw0oq.d.ts +84 -0
  3. package/dist/{chunk-CYQHG27J.js → chunk-2TMAWB4Y.js} +74 -1
  4. package/dist/chunk-2TMAWB4Y.js.map +1 -0
  5. package/dist/{chunk-OASJKWO5.js → chunk-3K5OG6KI.js} +92 -7
  6. package/dist/chunk-3K5OG6KI.js.map +1 -0
  7. package/dist/chunk-57CVQCFX.js +193 -0
  8. package/dist/chunk-57CVQCFX.js.map +1 -0
  9. package/dist/{chunk-QM5PKNPW.js → chunk-5WFRKURX.js} +1 -1
  10. package/dist/chunk-5WFRKURX.js.map +1 -0
  11. package/dist/chunk-B4EEON3N.js +1317 -0
  12. package/dist/chunk-B4EEON3N.js.map +1 -0
  13. package/dist/chunk-DBS6RIFL.js +81 -0
  14. package/dist/chunk-DBS6RIFL.js.map +1 -0
  15. package/dist/{chunk-MIBRIRGJ.js → chunk-FR2RBTKO.js} +3 -3
  16. package/dist/{chunk-MIBRIRGJ.js.map → chunk-FR2RBTKO.js.map} +1 -1
  17. package/dist/chunk-H3AXU4MJ.js +179 -0
  18. package/dist/chunk-H3AXU4MJ.js.map +1 -0
  19. package/dist/chunk-JELIRVDP.js +24 -0
  20. package/dist/chunk-JELIRVDP.js.map +1 -0
  21. package/dist/chunk-K32VJONL.js +193 -0
  22. package/dist/chunk-K32VJONL.js.map +1 -0
  23. package/dist/{chunk-6BAVXFYC.js → chunk-KSWJR66U.js} +218 -42
  24. package/dist/chunk-KSWJR66U.js.map +1 -0
  25. package/dist/{chunk-TSG2OSE6.js → chunk-MYIH7FWD.js} +3 -3
  26. package/dist/chunk-MYIH7FWD.js.map +1 -0
  27. package/dist/chunk-VLJJHDAC.js +218 -0
  28. package/dist/chunk-VLJJHDAC.js.map +1 -0
  29. package/dist/chunk-WMOI7FN3.js +182 -0
  30. package/dist/chunk-WMOI7FN3.js.map +1 -0
  31. package/dist/chunk-ZTX4PFFT.js +520 -0
  32. package/dist/chunk-ZTX4PFFT.js.map +1 -0
  33. package/dist/doc/index.d.ts +5 -10
  34. package/dist/doc/index.js +145 -7
  35. package/dist/doc/index.js.map +1 -1
  36. package/dist/generate/index.d.ts +99 -7
  37. package/dist/generate/index.js +16 -3
  38. package/dist/generate/index.js.map +1 -1
  39. package/dist/icons/index.d.ts +87 -0
  40. package/dist/icons/index.js +17 -0
  41. package/dist/icons/index.js.map +1 -0
  42. package/dist/imageEdit/index.d.ts +216 -0
  43. package/dist/imageEdit/index.js +54 -0
  44. package/dist/imageEdit/index.js.map +1 -0
  45. package/dist/index.d.ts +21 -9
  46. package/dist/index.js +461 -8
  47. package/dist/index.js.map +1 -1
  48. package/dist/jsonForm/index.d.ts +191 -0
  49. package/dist/jsonForm/index.js +27 -0
  50. package/dist/jsonForm/index.js.map +1 -0
  51. package/dist/markdown/index.d.ts +265 -19
  52. package/dist/markdown/index.js +39 -33
  53. package/dist/markdown/index.js.map +1 -1
  54. package/dist/random/index.d.ts +51 -2
  55. package/dist/random/index.js +9 -1
  56. package/dist/random/index.js.map +1 -1
  57. package/dist/recommend/index.d.ts +42 -0
  58. package/dist/recommend/index.js +10 -0
  59. package/dist/recommend/index.js.map +1 -0
  60. package/dist/schemas/index.d.ts +188 -10
  61. package/dist/schemas/index.js +120 -7
  62. package/dist/schemas/index.js.map +1 -1
  63. package/dist/spatial/index.d.ts +111 -3
  64. package/dist/spatial/index.js +24 -2
  65. package/dist/spatial/index.js.map +1 -1
  66. package/dist/storage/index.d.ts +159 -9
  67. package/dist/storage/index.js +20 -5
  68. package/dist/storage/index.js.map +1 -1
  69. package/dist/story/index.d.ts +53 -13
  70. package/dist/story/index.js +12 -4
  71. package/dist/themeLibrary-BHjJ0Qx6.d.ts +40 -0
  72. package/dist/timing/index.d.ts +109 -4
  73. package/dist/timing/index.js +23 -2
  74. package/dist/timing/index.js.map +1 -1
  75. package/dist/transform/index.d.ts +175 -6
  76. package/dist/transform/index.js +490 -3
  77. package/dist/transform/index.js.map +1 -1
  78. package/dist/{types-CkNttVSF.d.ts → types-BdZkdJ3z.d.ts} +17 -2
  79. package/dist/types-D98li1gV.d.ts +93 -0
  80. package/dist/versions/index.d.ts +128 -0
  81. package/dist/versions/index.js +35 -0
  82. package/dist/versions/index.js.map +1 -0
  83. package/package.json +28 -1
  84. package/src/__tests__/colorUtils.test.ts +112 -0
  85. package/src/__tests__/getLayers.test.ts +32 -7
  86. package/src/__tests__/iconResolve.test.ts +122 -0
  87. package/src/__tests__/imageEditState.test.ts +74 -0
  88. package/src/__tests__/imageEditVersions.test.ts +169 -0
  89. package/src/__tests__/inferDocumentTitle.test.ts +50 -0
  90. package/src/__tests__/jsonForm.chooseControl.test.ts +86 -0
  91. package/src/__tests__/jsonForm.evaluateWhen.test.ts +59 -0
  92. package/src/__tests__/jsonForm.inferSchema.test.ts +25 -0
  93. package/src/__tests__/jsonForm.pointer.test.ts +103 -0
  94. package/src/__tests__/markdownIcons.test.ts +104 -0
  95. package/src/__tests__/markdownToDoc.test.ts +19 -4
  96. package/src/__tests__/recommendTemplates.test.ts +183 -0
  97. package/src/__tests__/scopedContentContainer.test.ts +89 -0
  98. package/src/__tests__/slideshowGenerator.test.ts +1 -1
  99. package/src/__tests__/templateAnnotationParse.test.ts +42 -0
  100. package/src/__tests__/templates.test.ts +93 -9
  101. package/src/__tests__/themeCompile.test.ts +156 -0
  102. package/src/__tests__/themeValidator.test.ts +125 -0
  103. package/src/__tests__/versions.test.ts +415 -0
  104. package/src/doc/audioMapping.ts +55 -11
  105. package/src/doc/getLayers.ts +32 -21
  106. package/src/doc/markdownToDoc.ts +45 -7
  107. package/src/doc/templates/featureBlock.ts +202 -0
  108. package/src/doc/templates/fullBleedQuote.ts +13 -0
  109. package/src/doc/templates/index.ts +50 -16
  110. package/src/doc/templates/listBlock.ts +24 -5
  111. package/src/doc/templates/statHighlight.ts +13 -0
  112. package/src/doc/templates/titleBlock.ts +9 -0
  113. package/src/doc/utils/themeUtils.ts +8 -7
  114. package/src/generate/slideshowGenerator.ts +1 -1
  115. package/src/generate/templateMapper.ts +2 -2
  116. package/src/icons/iconData.ts +31 -0
  117. package/src/icons/index.ts +18 -0
  118. package/src/icons/resolve.ts +139 -0
  119. package/src/imageEdit/ImageEditVersionManager.ts +73 -0
  120. package/src/imageEdit/export.ts +326 -0
  121. package/src/imageEdit/index.ts +71 -0
  122. package/src/imageEdit/persistence.ts +62 -0
  123. package/src/imageEdit/state.ts +112 -0
  124. package/src/imageEdit/versionPaths.ts +57 -0
  125. package/src/imageEdit/versions.ts +231 -0
  126. package/src/index.ts +4 -0
  127. package/src/jsonForm/chooseControl.ts +88 -0
  128. package/src/jsonForm/evaluateWhen.ts +59 -0
  129. package/src/jsonForm/index.ts +22 -0
  130. package/src/jsonForm/inferSchema.ts +25 -0
  131. package/src/jsonForm/pointer.ts +109 -0
  132. package/src/jsonForm/types.ts +167 -0
  133. package/src/markdown/convert.ts +145 -5
  134. package/src/markdown/index.ts +3 -0
  135. package/src/markdown/types.ts +19 -2
  136. package/src/markdown/utils.ts +159 -0
  137. package/src/recommend/index.ts +16 -0
  138. package/src/recommend/templates.ts +273 -0
  139. package/src/schemas/BlockTemplates.ts +50 -7
  140. package/src/schemas/ImageEditDoc.ts +95 -0
  141. package/src/schemas/Theme.ts +98 -31
  142. package/src/schemas/colorUtils.ts +186 -0
  143. package/src/schemas/fontStacks.ts +257 -0
  144. package/src/schemas/index.ts +12 -0
  145. package/src/schemas/themeCompile.ts +203 -0
  146. package/src/schemas/themeLibrary.ts +18 -597
  147. package/src/schemas/themeValidator.ts +388 -0
  148. package/src/schemas/themes/bold.json +48 -0
  149. package/src/schemas/themes/cinematic.json +54 -0
  150. package/src/schemas/themes/documentary.json +49 -0
  151. package/src/schemas/themes/gezellig.json +44 -0
  152. package/src/schemas/themes/index.ts +53 -0
  153. package/src/schemas/themes/magazine.json +44 -0
  154. package/src/schemas/themes/minimalist.json +45 -0
  155. package/src/schemas/themes/morning-light.json +42 -0
  156. package/src/schemas/themes/standard-dark.json +50 -0
  157. package/src/schemas/themes/standard.json +42 -0
  158. package/src/schemas/themes/tech-dark.json +48 -0
  159. package/src/schemas/themes/warm-earth.json +50 -0
  160. package/src/storage/ScopedContentContainer.ts +113 -0
  161. package/src/storage/index.ts +1 -0
  162. package/src/versions/DocumentVersionManager.ts +70 -0
  163. package/src/versions/index.ts +54 -0
  164. package/src/versions/operations.ts +230 -0
  165. package/src/versions/paths.ts +66 -0
  166. package/src/versions/timestamp.ts +48 -0
  167. package/src/versions/types.ts +91 -0
  168. package/dist/__tests__/animationUtils.test.d.ts +0 -2
  169. package/dist/__tests__/animationUtils.test.d.ts.map +0 -1
  170. package/dist/__tests__/animationUtils.test.js +0 -60
  171. package/dist/__tests__/animationUtils.test.js.map +0 -1
  172. package/dist/__tests__/contentContainer.test.d.ts +0 -2
  173. package/dist/__tests__/contentContainer.test.d.ts.map +0 -1
  174. package/dist/__tests__/contentContainer.test.js +0 -234
  175. package/dist/__tests__/contentContainer.test.js.map +0 -1
  176. package/dist/__tests__/contentExtractor.test.d.ts +0 -2
  177. package/dist/__tests__/contentExtractor.test.d.ts.map +0 -1
  178. package/dist/__tests__/contentExtractor.test.js +0 -151
  179. package/dist/__tests__/contentExtractor.test.js.map +0 -1
  180. package/dist/__tests__/coverBlock.test.d.ts +0 -2
  181. package/dist/__tests__/coverBlock.test.d.ts.map +0 -1
  182. package/dist/__tests__/coverBlock.test.js +0 -197
  183. package/dist/__tests__/coverBlock.test.js.map +0 -1
  184. package/dist/__tests__/dataTable.test.d.ts +0 -2
  185. package/dist/__tests__/dataTable.test.d.ts.map +0 -1
  186. package/dist/__tests__/dataTable.test.js +0 -110
  187. package/dist/__tests__/dataTable.test.js.map +0 -1
  188. package/dist/__tests__/geohash.test.d.ts +0 -2
  189. package/dist/__tests__/geohash.test.d.ts.map +0 -1
  190. package/dist/__tests__/geohash.test.js +0 -87
  191. package/dist/__tests__/geohash.test.js.map +0 -1
  192. package/dist/__tests__/getLayers.test.d.ts +0 -2
  193. package/dist/__tests__/getLayers.test.d.ts.map +0 -1
  194. package/dist/__tests__/getLayers.test.js +0 -167
  195. package/dist/__tests__/getLayers.test.js.map +0 -1
  196. package/dist/__tests__/haversine.test.d.ts +0 -2
  197. package/dist/__tests__/haversine.test.d.ts.map +0 -1
  198. package/dist/__tests__/haversine.test.js +0 -56
  199. package/dist/__tests__/haversine.test.js.map +0 -1
  200. package/dist/__tests__/localForageAdapter.test.d.ts +0 -8
  201. package/dist/__tests__/localForageAdapter.test.d.ts.map +0 -1
  202. package/dist/__tests__/localForageAdapter.test.js +0 -130
  203. package/dist/__tests__/localForageAdapter.test.js.map +0 -1
  204. package/dist/__tests__/markdown.test.d.ts +0 -2
  205. package/dist/__tests__/markdown.test.d.ts.map +0 -1
  206. package/dist/__tests__/markdown.test.js +0 -715
  207. package/dist/__tests__/markdown.test.js.map +0 -1
  208. package/dist/__tests__/markdownToDoc.test.d.ts +0 -2
  209. package/dist/__tests__/markdownToDoc.test.d.ts.map +0 -1
  210. package/dist/__tests__/markdownToDoc.test.js +0 -447
  211. package/dist/__tests__/markdownToDoc.test.js.map +0 -1
  212. package/dist/__tests__/seededRandom.test.d.ts +0 -2
  213. package/dist/__tests__/seededRandom.test.d.ts.map +0 -1
  214. package/dist/__tests__/seededRandom.test.js +0 -125
  215. package/dist/__tests__/seededRandom.test.js.map +0 -1
  216. package/dist/__tests__/slideshowGenerator.test.d.ts +0 -2
  217. package/dist/__tests__/slideshowGenerator.test.d.ts.map +0 -1
  218. package/dist/__tests__/slideshowGenerator.test.js +0 -114
  219. package/dist/__tests__/slideshowGenerator.test.js.map +0 -1
  220. package/dist/__tests__/storage.test.d.ts +0 -2
  221. package/dist/__tests__/storage.test.d.ts.map +0 -1
  222. package/dist/__tests__/storage.test.js +0 -51
  223. package/dist/__tests__/storage.test.js.map +0 -1
  224. package/dist/__tests__/surface.test.d.ts +0 -2
  225. package/dist/__tests__/surface.test.d.ts.map +0 -1
  226. package/dist/__tests__/surface.test.js +0 -57
  227. package/dist/__tests__/surface.test.js.map +0 -1
  228. package/dist/__tests__/templates.test.d.ts +0 -2
  229. package/dist/__tests__/templates.test.d.ts.map +0 -1
  230. package/dist/__tests__/templates.test.js +0 -217
  231. package/dist/__tests__/templates.test.js.map +0 -1
  232. package/dist/__tests__/timing.test.d.ts +0 -2
  233. package/dist/__tests__/timing.test.d.ts.map +0 -1
  234. package/dist/__tests__/timing.test.js +0 -131
  235. package/dist/__tests__/timing.test.js.map +0 -1
  236. package/dist/chunk-6BAVXFYC.js.map +0 -1
  237. package/dist/chunk-7GF6RDED.js +0 -82
  238. package/dist/chunk-7GF6RDED.js.map +0 -1
  239. package/dist/chunk-CYQHG27J.js.map +0 -1
  240. package/dist/chunk-F22AE6BY.js +0 -121
  241. package/dist/chunk-F22AE6BY.js.map +0 -1
  242. package/dist/chunk-FIQR4AJG.js +0 -517
  243. package/dist/chunk-FIQR4AJG.js.map +0 -1
  244. package/dist/chunk-OASJKWO5.js.map +0 -1
  245. package/dist/chunk-QM5PKNPW.js.map +0 -1
  246. package/dist/chunk-TSG2OSE6.js.map +0 -1
  247. package/dist/doc/audioMapping.d.ts +0 -36
  248. package/dist/doc/audioMapping.d.ts.map +0 -1
  249. package/dist/doc/audioMapping.js +0 -315
  250. package/dist/doc/audioMapping.js.map +0 -1
  251. package/dist/doc/docToMarkdown.d.ts +0 -41
  252. package/dist/doc/docToMarkdown.d.ts.map +0 -1
  253. package/dist/doc/docToMarkdown.js +0 -88
  254. package/dist/doc/docToMarkdown.js.map +0 -1
  255. package/dist/doc/getLayers.d.ts +0 -65
  256. package/dist/doc/getLayers.d.ts.map +0 -1
  257. package/dist/doc/getLayers.js +0 -103
  258. package/dist/doc/getLayers.js.map +0 -1
  259. package/dist/doc/index.d.ts.map +0 -1
  260. package/dist/doc/markdownToDoc.d.ts +0 -75
  261. package/dist/doc/markdownToDoc.d.ts.map +0 -1
  262. package/dist/doc/markdownToDoc.js +0 -398
  263. package/dist/doc/markdownToDoc.js.map +0 -1
  264. package/dist/doc/templates/accentImage.d.ts +0 -59
  265. package/dist/doc/templates/accentImage.d.ts.map +0 -1
  266. package/dist/doc/templates/accentImage.js +0 -275
  267. package/dist/doc/templates/accentImage.js.map +0 -1
  268. package/dist/doc/templates/captionUtils.d.ts +0 -20
  269. package/dist/doc/templates/captionUtils.d.ts.map +0 -1
  270. package/dist/doc/templates/captionUtils.js +0 -29
  271. package/dist/doc/templates/captionUtils.js.map +0 -1
  272. package/dist/doc/templates/comparisonBar.d.ts +0 -13
  273. package/dist/doc/templates/comparisonBar.d.ts.map +0 -1
  274. package/dist/doc/templates/comparisonBar.js +0 -145
  275. package/dist/doc/templates/comparisonBar.js.map +0 -1
  276. package/dist/doc/templates/coverBlock.d.ts +0 -51
  277. package/dist/doc/templates/coverBlock.d.ts.map +0 -1
  278. package/dist/doc/templates/coverBlock.js +0 -153
  279. package/dist/doc/templates/coverBlock.js.map +0 -1
  280. package/dist/doc/templates/dataTable.d.ts +0 -14
  281. package/dist/doc/templates/dataTable.d.ts.map +0 -1
  282. package/dist/doc/templates/dataTable.js +0 -73
  283. package/dist/doc/templates/dataTable.js.map +0 -1
  284. package/dist/doc/templates/dateEvent.d.ts +0 -15
  285. package/dist/doc/templates/dateEvent.d.ts.map +0 -1
  286. package/dist/doc/templates/dateEvent.js +0 -114
  287. package/dist/doc/templates/dateEvent.js.map +0 -1
  288. package/dist/doc/templates/definitionCard.d.ts +0 -13
  289. package/dist/doc/templates/definitionCard.d.ts.map +0 -1
  290. package/dist/doc/templates/definitionCard.js +0 -117
  291. package/dist/doc/templates/definitionCard.js.map +0 -1
  292. package/dist/doc/templates/factCard.d.ts +0 -15
  293. package/dist/doc/templates/factCard.d.ts.map +0 -1
  294. package/dist/doc/templates/factCard.js +0 -104
  295. package/dist/doc/templates/factCard.js.map +0 -1
  296. package/dist/doc/templates/fullBleedQuote.d.ts +0 -13
  297. package/dist/doc/templates/fullBleedQuote.d.ts.map +0 -1
  298. package/dist/doc/templates/fullBleedQuote.js +0 -55
  299. package/dist/doc/templates/fullBleedQuote.js.map +0 -1
  300. package/dist/doc/templates/imageWithCaption.d.ts +0 -13
  301. package/dist/doc/templates/imageWithCaption.d.ts.map +0 -1
  302. package/dist/doc/templates/imageWithCaption.js +0 -146
  303. package/dist/doc/templates/imageWithCaption.js.map +0 -1
  304. package/dist/doc/templates/index.d.ts +0 -105
  305. package/dist/doc/templates/index.d.ts.map +0 -1
  306. package/dist/doc/templates/index.js +0 -445
  307. package/dist/doc/templates/index.js.map +0 -1
  308. package/dist/doc/templates/listBlock.d.ts +0 -13
  309. package/dist/doc/templates/listBlock.d.ts.map +0 -1
  310. package/dist/doc/templates/listBlock.js +0 -92
  311. package/dist/doc/templates/listBlock.js.map +0 -1
  312. package/dist/doc/templates/mapBlock.d.ts +0 -17
  313. package/dist/doc/templates/mapBlock.d.ts.map +0 -1
  314. package/dist/doc/templates/mapBlock.js +0 -115
  315. package/dist/doc/templates/mapBlock.js.map +0 -1
  316. package/dist/doc/templates/persistentLayers.d.ts +0 -39
  317. package/dist/doc/templates/persistentLayers.d.ts.map +0 -1
  318. package/dist/doc/templates/persistentLayers.js +0 -447
  319. package/dist/doc/templates/persistentLayers.js.map +0 -1
  320. package/dist/doc/templates/photoGrid.d.ts +0 -20
  321. package/dist/doc/templates/photoGrid.d.ts.map +0 -1
  322. package/dist/doc/templates/photoGrid.js +0 -175
  323. package/dist/doc/templates/photoGrid.js.map +0 -1
  324. package/dist/doc/templates/pullQuote.d.ts +0 -13
  325. package/dist/doc/templates/pullQuote.d.ts.map +0 -1
  326. package/dist/doc/templates/pullQuote.js +0 -113
  327. package/dist/doc/templates/pullQuote.js.map +0 -1
  328. package/dist/doc/templates/quoteBlock.d.ts +0 -15
  329. package/dist/doc/templates/quoteBlock.d.ts.map +0 -1
  330. package/dist/doc/templates/quoteBlock.js +0 -101
  331. package/dist/doc/templates/quoteBlock.js.map +0 -1
  332. package/dist/doc/templates/sectionHeader.d.ts +0 -14
  333. package/dist/doc/templates/sectionHeader.d.ts.map +0 -1
  334. package/dist/doc/templates/sectionHeader.js +0 -97
  335. package/dist/doc/templates/sectionHeader.js.map +0 -1
  336. package/dist/doc/templates/statHighlight.d.ts +0 -15
  337. package/dist/doc/templates/statHighlight.d.ts.map +0 -1
  338. package/dist/doc/templates/statHighlight.js +0 -102
  339. package/dist/doc/templates/statHighlight.js.map +0 -1
  340. package/dist/doc/templates/titleBlock.d.ts +0 -13
  341. package/dist/doc/templates/titleBlock.d.ts.map +0 -1
  342. package/dist/doc/templates/titleBlock.js +0 -95
  343. package/dist/doc/templates/titleBlock.js.map +0 -1
  344. package/dist/doc/templates/twoColumn.d.ts +0 -15
  345. package/dist/doc/templates/twoColumn.d.ts.map +0 -1
  346. package/dist/doc/templates/twoColumn.js +0 -225
  347. package/dist/doc/templates/twoColumn.js.map +0 -1
  348. package/dist/doc/templates/videoPullQuote.d.ts +0 -20
  349. package/dist/doc/templates/videoPullQuote.d.ts.map +0 -1
  350. package/dist/doc/templates/videoPullQuote.js +0 -122
  351. package/dist/doc/templates/videoPullQuote.js.map +0 -1
  352. package/dist/doc/templates/videoWithCaption.d.ts +0 -20
  353. package/dist/doc/templates/videoWithCaption.d.ts.map +0 -1
  354. package/dist/doc/templates/videoWithCaption.js +0 -107
  355. package/dist/doc/templates/videoWithCaption.js.map +0 -1
  356. package/dist/doc/utils/animationUtils.d.ts +0 -34
  357. package/dist/doc/utils/animationUtils.d.ts.map +0 -1
  358. package/dist/doc/utils/animationUtils.js +0 -110
  359. package/dist/doc/utils/animationUtils.js.map +0 -1
  360. package/dist/doc/utils/themeUtils.d.ts +0 -64
  361. package/dist/doc/utils/themeUtils.d.ts.map +0 -1
  362. package/dist/doc/utils/themeUtils.js +0 -135
  363. package/dist/doc/utils/themeUtils.js.map +0 -1
  364. package/dist/generate/contentExtractor.d.ts +0 -112
  365. package/dist/generate/contentExtractor.d.ts.map +0 -1
  366. package/dist/generate/contentExtractor.js +0 -638
  367. package/dist/generate/contentExtractor.js.map +0 -1
  368. package/dist/generate/index.d.ts.map +0 -1
  369. package/dist/generate/slideshowGenerator.d.ts +0 -72
  370. package/dist/generate/slideshowGenerator.d.ts.map +0 -1
  371. package/dist/generate/slideshowGenerator.js +0 -159
  372. package/dist/generate/slideshowGenerator.js.map +0 -1
  373. package/dist/generate/templateMapper.d.ts +0 -23
  374. package/dist/generate/templateMapper.d.ts.map +0 -1
  375. package/dist/generate/templateMapper.js +0 -114
  376. package/dist/generate/templateMapper.js.map +0 -1
  377. package/dist/index.d.ts.map +0 -1
  378. package/dist/markdown/convert.d.ts +0 -71
  379. package/dist/markdown/convert.d.ts.map +0 -1
  380. package/dist/markdown/convert.js +0 -845
  381. package/dist/markdown/convert.js.map +0 -1
  382. package/dist/markdown/htmlParse.d.ts +0 -26
  383. package/dist/markdown/htmlParse.d.ts.map +0 -1
  384. package/dist/markdown/htmlParse.js +0 -195
  385. package/dist/markdown/htmlParse.js.map +0 -1
  386. package/dist/markdown/index.d.ts.map +0 -1
  387. package/dist/markdown/parse.d.ts +0 -27
  388. package/dist/markdown/parse.d.ts.map +0 -1
  389. package/dist/markdown/parse.js +0 -90
  390. package/dist/markdown/parse.js.map +0 -1
  391. package/dist/markdown/stringify.d.ts +0 -32
  392. package/dist/markdown/stringify.d.ts.map +0 -1
  393. package/dist/markdown/stringify.js +0 -108
  394. package/dist/markdown/stringify.js.map +0 -1
  395. package/dist/markdown/types.d.ts +0 -516
  396. package/dist/markdown/types.d.ts.map +0 -1
  397. package/dist/markdown/types.js +0 -17
  398. package/dist/markdown/types.js.map +0 -1
  399. package/dist/markdown/utils.d.ts +0 -78
  400. package/dist/markdown/utils.d.ts.map +0 -1
  401. package/dist/markdown/utils.js +0 -153
  402. package/dist/markdown/utils.js.map +0 -1
  403. package/dist/random/SeededRandom.d.ts +0 -50
  404. package/dist/random/SeededRandom.d.ts.map +0 -1
  405. package/dist/random/SeededRandom.js +0 -115
  406. package/dist/random/SeededRandom.js.map +0 -1
  407. package/dist/random/index.d.ts.map +0 -1
  408. package/dist/schemas/BlockTemplates.d.ts +0 -600
  409. package/dist/schemas/BlockTemplates.d.ts.map +0 -1
  410. package/dist/schemas/BlockTemplates.js +0 -72
  411. package/dist/schemas/BlockTemplates.js.map +0 -1
  412. package/dist/schemas/Doc.d.ts +0 -503
  413. package/dist/schemas/Doc.d.ts.map +0 -1
  414. package/dist/schemas/Doc.js +0 -90
  415. package/dist/schemas/Doc.js.map +0 -1
  416. package/dist/schemas/LayoutStrategy.d.ts +0 -84
  417. package/dist/schemas/LayoutStrategy.d.ts.map +0 -1
  418. package/dist/schemas/LayoutStrategy.js +0 -123
  419. package/dist/schemas/LayoutStrategy.js.map +0 -1
  420. package/dist/schemas/MediaProvider.d.ts +0 -65
  421. package/dist/schemas/MediaProvider.d.ts.map +0 -1
  422. package/dist/schemas/MediaProvider.js +0 -13
  423. package/dist/schemas/MediaProvider.js.map +0 -1
  424. package/dist/schemas/Theme.d.ts +0 -194
  425. package/dist/schemas/Theme.d.ts.map +0 -1
  426. package/dist/schemas/Theme.js +0 -97
  427. package/dist/schemas/Theme.js.map +0 -1
  428. package/dist/schemas/Types.d.ts +0 -14
  429. package/dist/schemas/Types.d.ts.map +0 -1
  430. package/dist/schemas/Types.js +0 -5
  431. package/dist/schemas/Types.js.map +0 -1
  432. package/dist/schemas/Viewport.d.ts +0 -74
  433. package/dist/schemas/Viewport.d.ts.map +0 -1
  434. package/dist/schemas/Viewport.js +0 -63
  435. package/dist/schemas/Viewport.js.map +0 -1
  436. package/dist/schemas/index.d.ts.map +0 -1
  437. package/dist/schemas/themeLibrary.d.ts +0 -41
  438. package/dist/schemas/themeLibrary.d.ts.map +0 -1
  439. package/dist/schemas/themeLibrary.js +0 -597
  440. package/dist/schemas/themeLibrary.js.map +0 -1
  441. package/dist/spatial/Geohash.d.ts +0 -85
  442. package/dist/spatial/Geohash.d.ts.map +0 -1
  443. package/dist/spatial/Geohash.js +0 -142
  444. package/dist/spatial/Geohash.js.map +0 -1
  445. package/dist/spatial/Haversine.d.ts +0 -24
  446. package/dist/spatial/Haversine.d.ts.map +0 -1
  447. package/dist/spatial/Haversine.js +0 -48
  448. package/dist/spatial/Haversine.js.map +0 -1
  449. package/dist/spatial/index.d.ts.map +0 -1
  450. package/dist/storage/ContentContainer.d.ts +0 -87
  451. package/dist/storage/ContentContainer.d.ts.map +0 -1
  452. package/dist/storage/ContentContainer.js +0 -131
  453. package/dist/storage/ContentContainer.js.map +0 -1
  454. package/dist/storage/LocalForageAdapter.d.ts +0 -36
  455. package/dist/storage/LocalForageAdapter.d.ts.map +0 -1
  456. package/dist/storage/LocalForageAdapter.js +0 -82
  457. package/dist/storage/LocalForageAdapter.js.map +0 -1
  458. package/dist/storage/LocalStorageAdapter.d.ts +0 -16
  459. package/dist/storage/LocalStorageAdapter.d.ts.map +0 -1
  460. package/dist/storage/LocalStorageAdapter.js +0 -50
  461. package/dist/storage/LocalStorageAdapter.js.map +0 -1
  462. package/dist/storage/MediaProviderFromContainer.d.ts +0 -21
  463. package/dist/storage/MediaProviderFromContainer.d.ts.map +0 -1
  464. package/dist/storage/MediaProviderFromContainer.js +0 -79
  465. package/dist/storage/MediaProviderFromContainer.js.map +0 -1
  466. package/dist/storage/MemoryStorageAdapter.d.ts +0 -15
  467. package/dist/storage/MemoryStorageAdapter.d.ts.map +0 -1
  468. package/dist/storage/MemoryStorageAdapter.js +0 -34
  469. package/dist/storage/MemoryStorageAdapter.js.map +0 -1
  470. package/dist/storage/Storage.d.ts +0 -23
  471. package/dist/storage/Storage.d.ts.map +0 -1
  472. package/dist/storage/Storage.js +0 -9
  473. package/dist/storage/Storage.js.map +0 -1
  474. package/dist/storage/index.d.ts.map +0 -1
  475. package/dist/themeLibrary-CEo2D4b6.d.ts +0 -44
  476. package/dist/timing/index.d.ts.map +0 -1
  477. package/dist/timing/narrationTiming.d.ts +0 -54
  478. package/dist/timing/narrationTiming.d.ts.map +0 -1
  479. package/dist/timing/narrationTiming.js +0 -190
  480. package/dist/timing/narrationTiming.js.map +0 -1
  481. package/dist/timing/readingTime.d.ts +0 -54
  482. package/dist/timing/readingTime.d.ts.map +0 -1
  483. package/dist/timing/readingTime.js +0 -49
  484. package/dist/timing/readingTime.js.map +0 -1
  485. package/dist/transform/applyTransform.d.ts +0 -22
  486. package/dist/transform/applyTransform.d.ts.map +0 -1
  487. package/dist/transform/applyTransform.js +0 -68
  488. package/dist/transform/applyTransform.js.map +0 -1
  489. package/dist/transform/blockAnalyzer.d.ts +0 -48
  490. package/dist/transform/blockAnalyzer.d.ts.map +0 -1
  491. package/dist/transform/blockAnalyzer.js +0 -135
  492. package/dist/transform/blockAnalyzer.js.map +0 -1
  493. package/dist/transform/index.d.ts.map +0 -1
  494. package/dist/transform/registry.d.ts +0 -19
  495. package/dist/transform/registry.d.ts.map +0 -1
  496. package/dist/transform/registry.js +0 -41
  497. package/dist/transform/registry.js.map +0 -1
  498. package/dist/transform/styles/dataDriven.d.ts +0 -4
  499. package/dist/transform/styles/dataDriven.d.ts.map +0 -1
  500. package/dist/transform/styles/dataDriven.js +0 -15
  501. package/dist/transform/styles/dataDriven.js.map +0 -1
  502. package/dist/transform/styles/documentary.d.ts +0 -4
  503. package/dist/transform/styles/documentary.d.ts.map +0 -1
  504. package/dist/transform/styles/documentary.js +0 -15
  505. package/dist/transform/styles/documentary.js.map +0 -1
  506. package/dist/transform/styles/index.d.ts +0 -6
  507. package/dist/transform/styles/index.d.ts.map +0 -1
  508. package/dist/transform/styles/index.js +0 -6
  509. package/dist/transform/styles/index.js.map +0 -1
  510. package/dist/transform/styles/magazine.d.ts +0 -4
  511. package/dist/transform/styles/magazine.d.ts.map +0 -1
  512. package/dist/transform/styles/magazine.js +0 -15
  513. package/dist/transform/styles/magazine.js.map +0 -1
  514. package/dist/transform/styles/minimal.d.ts +0 -4
  515. package/dist/transform/styles/minimal.d.ts.map +0 -1
  516. package/dist/transform/styles/minimal.js +0 -15
  517. package/dist/transform/styles/minimal.js.map +0 -1
  518. package/dist/transform/styles/narrative.d.ts +0 -4
  519. package/dist/transform/styles/narrative.d.ts.map +0 -1
  520. package/dist/transform/styles/narrative.js +0 -15
  521. package/dist/transform/styles/narrative.js.map +0 -1
  522. package/dist/transform/templateSelector.d.ts +0 -30
  523. package/dist/transform/templateSelector.d.ts.map +0 -1
  524. package/dist/transform/templateSelector.js +0 -218
  525. package/dist/transform/templateSelector.js.map +0 -1
  526. package/dist/transform/timingAllocator.d.ts +0 -21
  527. package/dist/transform/timingAllocator.d.ts.map +0 -1
  528. package/dist/transform/timingAllocator.js +0 -111
  529. package/dist/transform/timingAllocator.js.map +0 -1
  530. package/dist/transform/types.d.ts +0 -86
  531. package/dist/transform/types.d.ts.map +0 -1
  532. package/dist/transform/types.js +0 -9
  533. package/dist/transform/types.js.map +0 -1
@@ -0,0 +1,388 @@
1
+ /**
2
+ * Theme Validator
3
+ *
4
+ * Hand-rolled validator for `Theme` JSON. No dependencies. Produces a
5
+ * flat list of typed errors with JSON paths, suitable for surfacing in
6
+ * the customizer UI or throwing at module init for built-in themes.
7
+ *
8
+ * Design: walk the candidate object, push errors for each violation.
9
+ * Coverage is exhaustive for required fields and shapes; permissive on
10
+ * forward-compatible fields (unknown keys are ignored, not rejected).
11
+ */
12
+
13
+ import type { Theme, ThemeColorPalette } from './Theme.js';
14
+ import { THEME_SCHEMA_VERSION } from './Theme.js';
15
+ import { isHex } from './colorUtils.js';
16
+
17
+ export interface ValidationError {
18
+ path: string;
19
+ message: string;
20
+ }
21
+
22
+ export interface ValidationResult {
23
+ valid: boolean;
24
+ errors: ValidationError[];
25
+ /** Present only when `valid === true`. The same input typed as `Theme`. */
26
+ theme?: Theme;
27
+ }
28
+
29
+ const VALID_FALLBACK = new Set(['serif', 'sans-serif', 'monospace', 'system-ui']);
30
+ const VALID_TITLE_WEIGHT = new Set(['normal', 'bold']);
31
+ const VALID_TRANSITION_TYPES = new Set([
32
+ 'cut',
33
+ 'fade',
34
+ 'dissolve',
35
+ 'slideLeft',
36
+ 'slideRight',
37
+ 'slideUp',
38
+ 'slideDown',
39
+ 'zoom',
40
+ ]);
41
+ const VALID_GRADIENT_PRESETS = new Set([
42
+ 'dark-vignette',
43
+ 'radial-dark',
44
+ 'warm-sunset',
45
+ 'cool-blue',
46
+ 'earth-tones',
47
+ ]);
48
+
49
+ class V {
50
+ errors: ValidationError[] = [];
51
+ err(path: string, message: string): void {
52
+ this.errors.push({ path, message });
53
+ }
54
+ isObject(v: unknown): v is Record<string, unknown> {
55
+ return typeof v === 'object' && v !== null && !Array.isArray(v);
56
+ }
57
+ isString(v: unknown): v is string {
58
+ return typeof v === 'string';
59
+ }
60
+ isNumber(v: unknown): v is number {
61
+ return typeof v === 'number' && Number.isFinite(v);
62
+ }
63
+ isBoolean(v: unknown): v is boolean {
64
+ return typeof v === 'boolean';
65
+ }
66
+ hex(path: string, v: unknown): void {
67
+ if (!this.isString(v)) {
68
+ this.err(path, `expected hex color string, got ${typeof v}`);
69
+ } else if (!isHex(v)) {
70
+ this.err(path, `expected #rgb or #rrggbb hex color, got "${v}"`);
71
+ }
72
+ }
73
+
74
+ palette(path: string, v: unknown): void {
75
+ if (!this.isObject(v)) {
76
+ this.err(path, 'expected object');
77
+ return;
78
+ }
79
+ const required: (keyof ThemeColorPalette)[] = [
80
+ 'primary',
81
+ 'secondary',
82
+ 'background',
83
+ 'backgroundLight',
84
+ 'text',
85
+ 'textMuted',
86
+ 'highlight',
87
+ 'warning',
88
+ ];
89
+ for (const k of required) this.hex(`${path}.${k}`, v[k]);
90
+ }
91
+
92
+ colorScheme(path: string, v: unknown): void {
93
+ if (!this.isObject(v)) {
94
+ this.err(path, 'expected object');
95
+ return;
96
+ }
97
+ this.hex(`${path}.bg`, v.bg);
98
+ this.hex(`${path}.text`, v.text);
99
+ this.hex(`${path}.accent`, v.accent);
100
+ }
101
+
102
+ colorSchemes(path: string, v: unknown): void {
103
+ if (!this.isObject(v)) {
104
+ this.err(path, 'expected object map');
105
+ return;
106
+ }
107
+ for (const key of Object.keys(v)) {
108
+ this.colorScheme(`${path}.${key}`, v[key]);
109
+ }
110
+ }
111
+
112
+ fontFamily(path: string, v: unknown): void {
113
+ if (!this.isObject(v)) {
114
+ this.err(path, 'expected FontFamily object ({ stackId } or { custom })');
115
+ return;
116
+ }
117
+ if ('stackId' in v) {
118
+ if (!this.isString(v.stackId) || v.stackId.length === 0) {
119
+ this.err(`${path}.stackId`, 'expected non-empty string');
120
+ }
121
+ return;
122
+ }
123
+ if ('custom' in v) {
124
+ const c = v.custom;
125
+ if (!this.isObject(c)) {
126
+ this.err(`${path}.custom`, 'expected { name, fallback } object');
127
+ return;
128
+ }
129
+ if (!this.isString(c.name) || c.name.length === 0) {
130
+ this.err(`${path}.custom.name`, 'expected non-empty string');
131
+ }
132
+ if (!this.isString(c.fallback) || !VALID_FALLBACK.has(c.fallback)) {
133
+ this.err(
134
+ `${path}.custom.fallback`,
135
+ `expected one of: serif, sans-serif, monospace, system-ui`,
136
+ );
137
+ }
138
+ return;
139
+ }
140
+ this.err(path, 'expected { stackId } or { custom: { name, fallback } }');
141
+ }
142
+
143
+ typography(path: string, v: unknown): void {
144
+ if (!this.isObject(v)) {
145
+ this.err(path, 'expected object');
146
+ return;
147
+ }
148
+ this.fontFamily(`${path}.bodyFont`, v.bodyFont);
149
+ this.fontFamily(`${path}.titleFont`, v.titleFont);
150
+ if (v.monoFont !== undefined) this.fontFamily(`${path}.monoFont`, v.monoFont);
151
+ for (const k of ['titleScale', 'bodyScale', 'lineHeight', 'titleLineHeight']) {
152
+ if (v[k] !== undefined && !this.isNumber(v[k])) {
153
+ this.err(`${path}.${k}`, `expected number, got ${typeof v[k]}`);
154
+ }
155
+ }
156
+ if (v.titleWeight !== undefined) {
157
+ if (!this.isString(v.titleWeight) || !VALID_TITLE_WEIGHT.has(v.titleWeight)) {
158
+ this.err(`${path}.titleWeight`, 'expected "normal" or "bold"');
159
+ }
160
+ }
161
+ }
162
+
163
+ style(path: string, v: unknown): void {
164
+ if (!this.isObject(v)) {
165
+ this.err(path, 'expected object');
166
+ return;
167
+ }
168
+ if (v.borderRadius !== undefined && !this.isNumber(v.borderRadius)) {
169
+ this.err(`${path}.borderRadius`, 'expected number');
170
+ }
171
+ if (v.textShadow !== undefined && !this.isBoolean(v.textShadow)) {
172
+ this.err(`${path}.textShadow`, 'expected boolean');
173
+ }
174
+ for (const k of ['overlayOpacity', 'animationSpeed']) {
175
+ if (v[k] !== undefined && !this.isNumber(v[k])) {
176
+ this.err(`${path}.${k}`, 'expected number');
177
+ }
178
+ }
179
+ if (v.blockPadding !== undefined && !this.isString(v.blockPadding)) {
180
+ this.err(`${path}.blockPadding`, 'expected string (percentage e.g. "5%")');
181
+ }
182
+ }
183
+
184
+ renderStyle(path: string, v: unknown): void {
185
+ if (!this.isObject(v)) {
186
+ this.err(path, 'expected object');
187
+ return;
188
+ }
189
+ if (!this.isString(v.name) || v.name.length === 0) {
190
+ this.err(`${path}.name`, 'expected non-empty string');
191
+ }
192
+ if (v.ambientMotion !== undefined && !this.isBoolean(v.ambientMotion)) {
193
+ this.err(`${path}.ambientMotion`, 'expected boolean');
194
+ }
195
+ for (const k of ['defaultTextAnimation', 'defaultImageAnimation']) {
196
+ if (v[k] !== undefined && !this.isString(v[k])) {
197
+ this.err(`${path}.${k}`, 'expected animation type string');
198
+ }
199
+ }
200
+ if (v.defaultTransition !== undefined) {
201
+ const t = v.defaultTransition;
202
+ if (!this.isObject(t)) {
203
+ this.err(`${path}.defaultTransition`, 'expected object');
204
+ } else {
205
+ if (!this.isString(t.type) || !VALID_TRANSITION_TYPES.has(t.type)) {
206
+ this.err(`${path}.defaultTransition.type`, 'expected valid transition type');
207
+ }
208
+ if (t.duration !== undefined && !this.isNumber(t.duration)) {
209
+ this.err(`${path}.defaultTransition.duration`, 'expected number');
210
+ }
211
+ }
212
+ }
213
+ if (v.layoutOverrides !== undefined && !this.isObject(v.layoutOverrides)) {
214
+ this.err(`${path}.layoutOverrides`, 'expected object');
215
+ }
216
+ if (v.templateHints !== undefined) {
217
+ if (!this.isObject(v.templateHints)) {
218
+ this.err(`${path}.templateHints`, 'expected object map');
219
+ } else {
220
+ for (const tplName of Object.keys(v.templateHints)) {
221
+ const hints = v.templateHints[tplName];
222
+ if (!this.isObject(hints)) {
223
+ this.err(`${path}.templateHints.${tplName}`, 'expected object');
224
+ continue;
225
+ }
226
+ for (const key of Object.keys(hints)) {
227
+ const val = hints[key];
228
+ const t = typeof val;
229
+ if (t !== 'string' && t !== 'number' && t !== 'boolean') {
230
+ this.err(
231
+ `${path}.templateHints.${tplName}.${key}`,
232
+ `expected string|number|boolean, got ${t}`,
233
+ );
234
+ }
235
+ }
236
+ }
237
+ }
238
+ }
239
+ }
240
+
241
+ seedColors(path: string, v: unknown): void {
242
+ if (!this.isObject(v)) {
243
+ this.err(path, 'expected object');
244
+ return;
245
+ }
246
+ if (v.primary === undefined) {
247
+ this.err(`${path}.primary`, 'required when seedColors is present');
248
+ } else {
249
+ this.hex(`${path}.primary`, v.primary);
250
+ }
251
+ for (const k of ['secondary', 'accent', 'background', 'text']) {
252
+ if (v[k] !== undefined) this.hex(`${path}.${k}`, v[k]);
253
+ }
254
+ }
255
+
256
+ persistentLayer(path: string, v: unknown): void {
257
+ if (!this.isObject(v)) {
258
+ this.err(path, 'expected object');
259
+ return;
260
+ }
261
+ // Either { template, config } or a raw Layer — only validate the template form here
262
+ if ('template' in v) {
263
+ if (!this.isString(v.template)) {
264
+ this.err(`${path}.template`, 'expected string');
265
+ return;
266
+ }
267
+ const cfg = v.config;
268
+ if (!this.isObject(cfg)) {
269
+ this.err(`${path}.config`, 'expected object');
270
+ return;
271
+ }
272
+ if (cfg.type !== v.template) {
273
+ this.err(`${path}.config.type`, `expected "${v.template}", got "${String(cfg.type)}"`);
274
+ }
275
+ if (v.template === 'gradientBackground' && cfg.preset !== undefined) {
276
+ if (!this.isString(cfg.preset) || !VALID_GRADIENT_PRESETS.has(cfg.preset)) {
277
+ this.err(
278
+ `${path}.config.preset`,
279
+ `expected one of: ${Array.from(VALID_GRADIENT_PRESETS).join(', ')}`,
280
+ );
281
+ }
282
+ }
283
+ if (v.template === 'gradientBackground' && 'gradient' in cfg) {
284
+ this.err(
285
+ `${path}.config.gradient`,
286
+ 'raw CSS gradient strings are not allowed in Theme JSON; use a `preset`',
287
+ );
288
+ }
289
+ }
290
+ // Raw Layer form is permissive — no schema check here
291
+ }
292
+
293
+ persistentLayers(path: string, v: unknown): void {
294
+ if (!this.isObject(v)) {
295
+ this.err(path, 'expected object');
296
+ return;
297
+ }
298
+ for (const side of ['bottomLayers', 'topLayers']) {
299
+ const arr = v[side];
300
+ if (arr === undefined) continue;
301
+ if (!Array.isArray(arr)) {
302
+ this.err(`${path}.${side}`, 'expected array');
303
+ continue;
304
+ }
305
+ arr.forEach((entry, i) => this.persistentLayer(`${path}.${side}[${i}]`, entry));
306
+ }
307
+ }
308
+ }
309
+
310
+ export function validateTheme(input: unknown): ValidationResult {
311
+ const v = new V();
312
+ if (!v.isObject(input)) {
313
+ return { valid: false, errors: [{ path: '', message: 'expected object' }] };
314
+ }
315
+
316
+ if (input.schemaVersion !== THEME_SCHEMA_VERSION) {
317
+ v.err(
318
+ 'schemaVersion',
319
+ `expected "${THEME_SCHEMA_VERSION}", got "${String(input.schemaVersion)}"`,
320
+ );
321
+ }
322
+ if (!v.isString(input.id) || input.id.length === 0) {
323
+ v.err('id', 'expected non-empty string');
324
+ }
325
+ if (!v.isString(input.name) || input.name.length === 0) {
326
+ v.err('name', 'expected non-empty string');
327
+ }
328
+ if (input.description !== undefined && !v.isString(input.description)) {
329
+ v.err('description', 'expected string');
330
+ }
331
+
332
+ if (input.seedColors !== undefined) v.seedColors('seedColors', input.seedColors);
333
+
334
+ if (input.colors === undefined) {
335
+ v.err('colors', 'required');
336
+ } else {
337
+ v.palette('colors', input.colors);
338
+ }
339
+
340
+ if (input.typography === undefined) {
341
+ v.err('typography', 'required');
342
+ } else {
343
+ v.typography('typography', input.typography);
344
+ }
345
+
346
+ if (input.style === undefined) {
347
+ v.err('style', 'required');
348
+ } else {
349
+ v.style('style', input.style);
350
+ }
351
+
352
+ if (input.renderStyle === undefined) {
353
+ v.err('renderStyle', 'required');
354
+ } else {
355
+ v.renderStyle('renderStyle', input.renderStyle);
356
+ }
357
+
358
+ if (input.colorSchemes === undefined) {
359
+ v.err('colorSchemes', 'required');
360
+ } else {
361
+ v.colorSchemes('colorSchemes', input.colorSchemes);
362
+ }
363
+
364
+ if (input.persistentLayers !== undefined) {
365
+ v.persistentLayers('persistentLayers', input.persistentLayers);
366
+ }
367
+
368
+ if (v.errors.length === 0) {
369
+ return { valid: true, errors: [], theme: input as unknown as Theme };
370
+ }
371
+ return { valid: false, errors: v.errors };
372
+ }
373
+
374
+ /** Throws on invalid input. Useful at module init for built-in themes. */
375
+ export function assertTheme(input: unknown, source = 'theme'): Theme {
376
+ const result = validateTheme(input);
377
+ if (!result.valid || !result.theme) {
378
+ const summary = result.errors
379
+ .slice(0, 5)
380
+ .map((e) => ` ${e.path || '<root>'}: ${e.message}`)
381
+ .join('\n');
382
+ const more = result.errors.length > 5 ? `\n ... and ${result.errors.length - 5} more` : '';
383
+ throw new Error(`Invalid ${source}:\n${summary}${more}`);
384
+ }
385
+ return result.theme;
386
+ }
387
+
388
+ // (Theme types are re-exported from `./Theme.js` via the schemas barrel.)
@@ -0,0 +1,48 @@
1
+ {
2
+ "schemaVersion": "1",
3
+ "id": "bold",
4
+ "name": "Bold",
5
+ "description": "High-contrast black with vivid accents and dramatic animations.",
6
+ "colors": {
7
+ "primary": "#e53e3e",
8
+ "secondary": "#ed8936",
9
+ "background": "#000000",
10
+ "backgroundLight": "#1a1a1a",
11
+ "text": "#ffffff",
12
+ "textMuted": "#cbd5e0",
13
+ "highlight": "#f6e05e",
14
+ "warning": "#fc8181"
15
+ },
16
+ "typography": {
17
+ "bodyFont": { "stackId": "roboto" },
18
+ "titleFont": { "stackId": "oswald" },
19
+ "titleWeight": "bold",
20
+ "titleScale": 1.15,
21
+ "bodyScale": 1.0,
22
+ "titleLineHeight": 1.1
23
+ },
24
+ "style": {
25
+ "textShadow": true,
26
+ "overlayOpacity": 0.6,
27
+ "animationSpeed": 0.8
28
+ },
29
+ "renderStyle": {
30
+ "name": "bold",
31
+ "defaultTextAnimation": "zoomIn",
32
+ "defaultImageAnimation": "slowZoom",
33
+ "ambientMotion": true,
34
+ "defaultTransition": { "type": "dissolve", "duration": 0.5 },
35
+ "templateHints": {
36
+ "statHighlight": { "entrance": "dramatic" },
37
+ "fullBleedQuote": { "entrance": "dramatic" }
38
+ }
39
+ },
40
+ "colorSchemes": {
41
+ "blue": { "bg": "#1a202c", "text": "#63b3ed", "accent": "#90cdf4" },
42
+ "green": { "bg": "#1a202c", "text": "#48bb78", "accent": "#68d391" },
43
+ "purple": { "bg": "#1a202c", "text": "#b794f4", "accent": "#d6bcfa" },
44
+ "red": { "bg": "#1a202c", "text": "#fc8181", "accent": "#feb2b2" },
45
+ "orange": { "bg": "#1a202c", "text": "#f6ad55", "accent": "#fbd38d" },
46
+ "teal": { "bg": "#1a202c", "text": "#4fd1c5", "accent": "#81e6d9" }
47
+ }
48
+ }
@@ -0,0 +1,54 @@
1
+ {
2
+ "schemaVersion": "1",
3
+ "id": "cinematic",
4
+ "name": "Cinematic",
5
+ "description": "Ultra-dark with moody gradients, gold accents, and slow dissolve transitions.",
6
+ "colors": {
7
+ "primary": "#d69e2e",
8
+ "secondary": "#b7791f",
9
+ "background": "#0a0f1a",
10
+ "backgroundLight": "#1a202c",
11
+ "text": "#f7fafc",
12
+ "textMuted": "#a0aec0",
13
+ "highlight": "#ecc94b",
14
+ "warning": "#fc8181"
15
+ },
16
+ "typography": {
17
+ "bodyFont": { "stackId": "crimson" },
18
+ "titleFont": { "stackId": "cormorant" },
19
+ "titleWeight": "bold",
20
+ "lineHeight": 1.5,
21
+ "titleLineHeight": 1.2
22
+ },
23
+ "style": {
24
+ "textShadow": true,
25
+ "overlayOpacity": 0.55,
26
+ "animationSpeed": 1.2
27
+ },
28
+ "renderStyle": {
29
+ "name": "cinematic",
30
+ "defaultTextAnimation": "fadeIn",
31
+ "defaultImageAnimation": "slowZoom",
32
+ "ambientMotion": true,
33
+ "defaultTransition": { "type": "dissolve", "duration": 1.2 },
34
+ "templateHints": {
35
+ "title": { "showAccentLine": true }
36
+ }
37
+ },
38
+ "colorSchemes": {
39
+ "blue": { "bg": "#0d1b2a", "text": "#90cdf4", "accent": "#63b3ed" },
40
+ "green": { "bg": "#0d1b14", "text": "#9ae6b4", "accent": "#68d391" },
41
+ "purple": { "bg": "#1a0d2e", "text": "#d6bcfa", "accent": "#b794f4" },
42
+ "red": { "bg": "#2a0d0d", "text": "#fc8181", "accent": "#feb2b2" },
43
+ "orange": { "bg": "#2a1a0d", "text": "#fbd38d", "accent": "#f6ad55" },
44
+ "teal": { "bg": "#0d2a2a", "text": "#81e6d9", "accent": "#4fd1c5" }
45
+ },
46
+ "persistentLayers": {
47
+ "bottomLayers": [
48
+ {
49
+ "template": "gradientBackground",
50
+ "config": { "type": "gradientBackground", "preset": "radial-dark" }
51
+ }
52
+ ]
53
+ }
54
+ }
@@ -0,0 +1,49 @@
1
+ {
2
+ "schemaVersion": "1",
3
+ "id": "documentary",
4
+ "name": "Documentary",
5
+ "description": "Classic dark cinematic look with elegant serif typography.",
6
+ "colors": {
7
+ "primary": "#3d5a80",
8
+ "secondary": "#63b3ed",
9
+ "background": "#1a202c",
10
+ "backgroundLight": "#2d3748",
11
+ "text": "#ffffff",
12
+ "textMuted": "#a0aec0",
13
+ "highlight": "#63b3ed",
14
+ "warning": "#fc8181"
15
+ },
16
+ "typography": {
17
+ "bodyFont": { "stackId": "source-serif" },
18
+ "titleFont": { "stackId": "playfair" },
19
+ "titleWeight": "bold"
20
+ },
21
+ "style": {
22
+ "textShadow": true,
23
+ "overlayOpacity": 0.5,
24
+ "animationSpeed": 1.0
25
+ },
26
+ "renderStyle": {
27
+ "name": "documentary",
28
+ "defaultTextAnimation": "fadeIn",
29
+ "defaultImageAnimation": "slowZoom",
30
+ "ambientMotion": true,
31
+ "defaultTransition": { "type": "fade", "duration": 0.8 }
32
+ },
33
+ "colorSchemes": {
34
+ "blue": { "bg": "#1a365d", "text": "#63b3ed", "accent": "#90cdf4" },
35
+ "green": { "bg": "#22543d", "text": "#9ae6b4", "accent": "#68d391" },
36
+ "purple": { "bg": "#44337a", "text": "#d6bcfa", "accent": "#b794f4" },
37
+ "red": { "bg": "#742a2a", "text": "#fc8181", "accent": "#feb2b2" },
38
+ "orange": { "bg": "#744210", "text": "#fbd38d", "accent": "#f6ad55" },
39
+ "teal": { "bg": "#234e52", "text": "#81e6d9", "accent": "#4fd1c5" }
40
+ },
41
+ "persistentLayers": {
42
+ "bottomLayers": [
43
+ {
44
+ "template": "gradientBackground",
45
+ "config": { "type": "gradientBackground", "preset": "dark-vignette" }
46
+ }
47
+ ]
48
+ }
49
+ }
@@ -0,0 +1,44 @@
1
+ {
2
+ "schemaVersion": "1",
3
+ "id": "gezellig",
4
+ "name": "Gezellig",
5
+ "description": "Warm sage + terracotta palette inspired by the Gezel desktop app. Subtle orange-tinted dark background, cream text, sage and terracotta accents.",
6
+ "colors": {
7
+ "primary": "#b0724c",
8
+ "secondary": "#667f62",
9
+ "background": "#1f1a17",
10
+ "backgroundLight": "#2b2420",
11
+ "text": "#f3ede0",
12
+ "textMuted": "#a89b85",
13
+ "highlight": "#c0875d",
14
+ "warning": "#e07a6b"
15
+ },
16
+ "typography": {
17
+ "bodyFont": { "stackId": "system-sans-emoji" },
18
+ "titleFont": { "stackId": "system-serif-emoji" },
19
+ "monoFont": { "stackId": "system-mono" },
20
+ "titleWeight": "bold",
21
+ "lineHeight": 1.55
22
+ },
23
+ "style": {
24
+ "textShadow": false,
25
+ "overlayOpacity": 0.4,
26
+ "animationSpeed": 1.0,
27
+ "borderRadius": 6
28
+ },
29
+ "renderStyle": {
30
+ "name": "gezellig",
31
+ "defaultTextAnimation": "fadeIn",
32
+ "defaultImageAnimation": "slowZoom",
33
+ "ambientMotion": false,
34
+ "defaultTransition": { "type": "fade", "duration": 0.6 }
35
+ },
36
+ "colorSchemes": {
37
+ "terracotta": { "bg": "#3d2620", "text": "#f3ede0", "accent": "#c0875d" },
38
+ "sage": { "bg": "#28332a", "text": "#e3ead9", "accent": "#8aa589" },
39
+ "amber": { "bg": "#3d2e17", "text": "#fbe3a8", "accent": "#d4a149" },
40
+ "plum": { "bg": "#2e1f2a", "text": "#e8d4e0", "accent": "#b088a5" },
41
+ "ink": { "bg": "#1a1f26", "text": "#d5dde8", "accent": "#7b8fa8" },
42
+ "cream": { "bg": "#f3ede0", "text": "#2b2420", "accent": "#b0724c" }
43
+ }
44
+ }
@@ -0,0 +1,53 @@
1
+ /**
2
+ * Built-in Theme Library
3
+ *
4
+ * Loads each built-in theme from its JSON sidecar, validates it, and
5
+ * exports the typed `Theme` constants. The JSON files in this directory
6
+ * are syntactically identical to customizer-authored themes — they just
7
+ * use more of the schema.
8
+ *
9
+ * Validation runs at module init: if a built-in JSON drifts from the
10
+ * schema, the import fails loudly during build / startup.
11
+ */
12
+
13
+ import type { Theme } from '../Theme.js';
14
+ import { assertTheme } from '../themeValidator.js';
15
+
16
+ import standardJson from './standard.json' with { type: 'json' };
17
+ import standardDarkJson from './standard-dark.json' with { type: 'json' };
18
+ import documentaryJson from './documentary.json' with { type: 'json' };
19
+ import minimalistJson from './minimalist.json' with { type: 'json' };
20
+ import boldJson from './bold.json' with { type: 'json' };
21
+ import morningLightJson from './morning-light.json' with { type: 'json' };
22
+ import techDarkJson from './tech-dark.json' with { type: 'json' };
23
+ import magazineJson from './magazine.json' with { type: 'json' };
24
+ import cinematicJson from './cinematic.json' with { type: 'json' };
25
+ import warmEarthJson from './warm-earth.json' with { type: 'json' };
26
+ import gezelligJson from './gezellig.json' with { type: 'json' };
27
+
28
+ export const standard: Theme = assertTheme(standardJson, 'standard.json');
29
+ export const standardDark: Theme = assertTheme(standardDarkJson, 'standard-dark.json');
30
+ export const documentary: Theme = assertTheme(documentaryJson, 'documentary.json');
31
+ export const minimalist: Theme = assertTheme(minimalistJson, 'minimalist.json');
32
+ export const bold: Theme = assertTheme(boldJson, 'bold.json');
33
+ export const morningLight: Theme = assertTheme(morningLightJson, 'morning-light.json');
34
+ export const techDark: Theme = assertTheme(techDarkJson, 'tech-dark.json');
35
+ export const magazine: Theme = assertTheme(magazineJson, 'magazine.json');
36
+ export const cinematic: Theme = assertTheme(cinematicJson, 'cinematic.json');
37
+ export const warmEarth: Theme = assertTheme(warmEarthJson, 'warm-earth.json');
38
+ export const gezellig: Theme = assertTheme(gezelligJson, 'gezellig.json');
39
+
40
+ /** All built-in themes, keyed by id. */
41
+ export const BUILTIN_THEMES: Record<string, Theme> = {
42
+ standard,
43
+ 'standard-dark': standardDark,
44
+ documentary,
45
+ minimalist,
46
+ bold,
47
+ 'morning-light': morningLight,
48
+ 'tech-dark': techDark,
49
+ magazine,
50
+ cinematic,
51
+ 'warm-earth': warmEarth,
52
+ gezellig,
53
+ };
@@ -0,0 +1,44 @@
1
+ {
2
+ "schemaVersion": "1",
3
+ "id": "magazine",
4
+ "name": "Magazine",
5
+ "description": "Rich editorial palette with mixed serif/sans typography and slide transitions.",
6
+ "colors": {
7
+ "primary": "#c53030",
8
+ "secondary": "#2b6cb0",
9
+ "background": "#1a202c",
10
+ "backgroundLight": "#2d3748",
11
+ "text": "#f7fafc",
12
+ "textMuted": "#cbd5e0",
13
+ "highlight": "#ed8936",
14
+ "warning": "#fc8181"
15
+ },
16
+ "typography": {
17
+ "bodyFont": { "stackId": "dm-sans" },
18
+ "titleFont": { "stackId": "dm-serif" },
19
+ "titleWeight": "bold",
20
+ "titleScale": 1.05,
21
+ "lineHeight": 1.5
22
+ },
23
+ "style": {
24
+ "textShadow": true,
25
+ "overlayOpacity": 0.45,
26
+ "animationSpeed": 1.0,
27
+ "borderRadius": 6
28
+ },
29
+ "renderStyle": {
30
+ "name": "magazine",
31
+ "defaultTextAnimation": "fadeIn",
32
+ "defaultImageAnimation": "slowZoom",
33
+ "ambientMotion": true,
34
+ "defaultTransition": { "type": "slideLeft", "duration": 0.7 }
35
+ },
36
+ "colorSchemes": {
37
+ "blue": { "bg": "#1a365d", "text": "#90cdf4", "accent": "#63b3ed" },
38
+ "green": { "bg": "#1c4532", "text": "#9ae6b4", "accent": "#68d391" },
39
+ "purple": { "bg": "#322659", "text": "#d6bcfa", "accent": "#b794f4" },
40
+ "red": { "bg": "#63171b", "text": "#feb2b2", "accent": "#fc8181" },
41
+ "orange": { "bg": "#652b19", "text": "#fbd38d", "accent": "#f6ad55" },
42
+ "teal": { "bg": "#1d4044", "text": "#81e6d9", "accent": "#4fd1c5" }
43
+ }
44
+ }