@openpresentation/opf 0.14.0 → 0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (360) hide show
  1. package/README.md +28 -38
  2. package/dist/catalog-refs-_anZs-Qz.d.ts +128 -0
  3. package/dist/catalog-schemas-BZCjgAxu.d.ts +12 -0
  4. package/dist/catalog.d.ts +91 -0
  5. package/dist/{chunk-XOZ4KMSR.js → catalog.js} +17018 -8816
  6. package/dist/{chart-data-B_3z9VTb.d.ts → chart-data-BnNqgnC-.d.ts} +1 -1
  7. package/dist/{chunk-BFLVSVA7.js → chunk-3XDRQYWZ.js} +1 -1
  8. package/dist/{chunk-6OXY2CP3.js → chunk-5PDN7BN6.js} +503 -239
  9. package/dist/{chunk-CSQHPVGL.js → chunk-5TO6I3GB.js} +1 -1
  10. package/dist/{chunk-4LDGKLUC.js → chunk-5UEUAW57.js} +4 -2
  11. package/dist/{chunk-5ZU6JAPP.js → chunk-6OR326EA.js} +1 -1
  12. package/dist/{chunk-XIZUK2XM.js → chunk-BSYQDWT4.js} +15 -3
  13. package/dist/{chunk-UPQQD7MA.js → chunk-FQSIIADJ.js} +15 -6
  14. package/dist/{chunk-D3TY4TT6.js → chunk-HXHOZ7AH.js} +1407 -154
  15. package/dist/chunk-K4DQQIT4.js +319 -0
  16. package/dist/chunk-KINQFU6X.js +51 -0
  17. package/dist/{chunk-4VJDTF55.js → chunk-NAWQR7MN.js} +1 -1
  18. package/dist/{chunk-JDJBDYSR.js → chunk-PX5AWL7Y.js} +333 -857
  19. package/dist/{chunk-Q2TCMN56.js → chunk-SMLMI6IZ.js} +5 -2
  20. package/dist/chunk-SPFV27O5.js +210 -0
  21. package/dist/chunk-TRDXRRQK.js +17 -0
  22. package/dist/{chunk-Z65B2B77.js → chunk-UM24JFUE.js} +2 -2
  23. package/dist/{chunk-LS2FMPI5.js → chunk-WEDGVC5W.js} +969 -886
  24. package/dist/{composition-_WEwBe2a.d.ts → composition-D4ADF5c-.d.ts} +319 -115
  25. package/dist/composition.d.ts +3 -2
  26. package/dist/composition.js +2 -2
  27. package/dist/convert.d.ts +14 -17
  28. package/dist/convert.js +36 -39
  29. package/dist/data.d.ts +28 -11
  30. package/dist/data.js +3 -3
  31. package/dist/deck.d.ts +77 -0
  32. package/dist/deck.js +12 -0
  33. package/dist/diff.d.ts +1 -1
  34. package/dist/diff.js +7 -7
  35. package/dist/docs.js +33 -33
  36. package/dist/examples.d.ts +1 -1
  37. package/dist/examples.js +51761 -4783
  38. package/dist/{finding-C_por275.d.ts → finding-CT_f_vbD.d.ts} +2 -2
  39. package/dist/format.js +2 -2
  40. package/dist/index.d.ts +227 -77
  41. package/dist/index.js +343 -258
  42. package/dist/json-BFSdESOE.d.ts +19 -0
  43. package/dist/markdown.d.ts +20 -9
  44. package/dist/markdown.js +9 -9
  45. package/dist/{pagination-BZpXLvFL.d.ts → pagination-DzZPFheM.d.ts} +31 -31
  46. package/dist/pagination.d.ts +4 -5
  47. package/dist/pagination.js +6 -6
  48. package/dist/patch.d.ts +1 -1
  49. package/dist/patch.js +6 -6
  50. package/dist/{presentation-C5eHkevA.d.ts → presentation-COrFuj2g.d.ts} +398 -558
  51. package/dist/repo-readme.js +1 -1
  52. package/dist/schemas.d.ts +298 -1
  53. package/dist/schemas.js +1 -1
  54. package/dist/spec/README.md +1 -1
  55. package/dist/spec/catalogs/font-schemes/angsana-new.json +1 -1
  56. package/dist/spec/catalogs/font-schemes/aparajita.json +2 -2
  57. package/dist/spec/catalogs/font-schemes/arabic-typesetting.json +1 -1
  58. package/dist/spec/catalogs/font-schemes/batang.json +1 -1
  59. package/dist/spec/catalogs/font-schemes/daunpenh.json +1 -1
  60. package/dist/spec/catalogs/font-schemes/david.json +1 -1
  61. package/dist/spec/catalogs/font-schemes/dilleniaupc.json +1 -1
  62. package/dist/spec/catalogs/font-schemes/fangsong.json +1 -1
  63. package/dist/spec/catalogs/font-schemes/gautami.json +1 -1
  64. package/dist/spec/catalogs/font-schemes/gisha.json +2 -2
  65. package/dist/spec/catalogs/font-schemes/gungsuh.json +1 -1
  66. package/dist/spec/catalogs/font-schemes/index.json +1 -1
  67. package/dist/spec/catalogs/font-schemes/kalinga.json +1 -1
  68. package/dist/spec/catalogs/font-schemes/kartika.json +1 -1
  69. package/dist/spec/catalogs/font-schemes/khmer-ui.json +1 -1
  70. package/dist/spec/catalogs/font-schemes/latha.json +1 -1
  71. package/dist/spec/catalogs/font-schemes/malgun-gothic.json +1 -1
  72. package/dist/spec/catalogs/font-schemes/mangal.json +3 -3
  73. package/dist/spec/catalogs/font-schemes/meiryo.json +1 -1
  74. package/dist/spec/catalogs/font-schemes/microsoft-jhenghei.json +1 -1
  75. package/dist/spec/catalogs/font-schemes/microsoft-yahei.json +4 -4
  76. package/dist/spec/catalogs/font-schemes/mingliu.json +1 -1
  77. package/dist/spec/catalogs/font-schemes/miriam.json +1 -1
  78. package/dist/spec/catalogs/font-schemes/ms-mincho.json +1 -1
  79. package/dist/spec/catalogs/font-schemes/nirmala-ui.json +1 -1
  80. package/dist/spec/catalogs/font-schemes/noto-naksh-arabic.json +1 -1
  81. package/dist/spec/catalogs/font-schemes/noto-nastaliq-urdu.json +2 -2
  82. package/dist/spec/catalogs/font-schemes/noto-sans-arabic.json +3 -3
  83. package/dist/spec/catalogs/font-schemes/noto-sans-armenian.json +1 -1
  84. package/dist/spec/catalogs/font-schemes/noto-sans-bengali.json +2 -2
  85. package/dist/spec/catalogs/font-schemes/noto-sans-devangari.json +2 -2
  86. package/dist/spec/catalogs/font-schemes/noto-sans-ethiopic.json +1 -1
  87. package/dist/spec/catalogs/font-schemes/noto-sans-georgian.json +1 -1
  88. package/dist/spec/catalogs/font-schemes/noto-sans-gujarati.json +1 -1
  89. package/dist/spec/catalogs/font-schemes/noto-sans-gurmukhi.json +1 -1
  90. package/dist/spec/catalogs/font-schemes/noto-sans-hebrew.json +1 -1
  91. package/dist/spec/catalogs/font-schemes/noto-sans-jp.json +1 -1
  92. package/dist/spec/catalogs/font-schemes/noto-sans-kannada.json +1 -1
  93. package/dist/spec/catalogs/font-schemes/noto-sans-khmer.json +1 -1
  94. package/dist/spec/catalogs/font-schemes/noto-sans-kr.json +1 -1
  95. package/dist/spec/catalogs/font-schemes/noto-sans-malayalam.json +1 -1
  96. package/dist/spec/catalogs/font-schemes/noto-sans-mongolian.json +1 -1
  97. package/dist/spec/catalogs/font-schemes/noto-sans-oriya.json +1 -1
  98. package/dist/spec/catalogs/font-schemes/noto-sans-sc.json +4 -4
  99. package/dist/spec/catalogs/font-schemes/noto-sans-tamil.json +1 -1
  100. package/dist/spec/catalogs/font-schemes/noto-sans-tc.json +1 -1
  101. package/dist/spec/catalogs/font-schemes/noto-sans-telugu.json +1 -1
  102. package/dist/spec/catalogs/font-schemes/noto-sans-thai.json +1 -1
  103. package/dist/spec/catalogs/font-schemes/noto-sans.json +4 -4
  104. package/dist/spec/catalogs/font-schemes/nyala.json +1 -1
  105. package/dist/spec/catalogs/font-schemes/pmingliu.json +1 -1
  106. package/dist/spec/catalogs/font-schemes/raavi.json +1 -1
  107. package/dist/spec/catalogs/font-schemes/sakkal-majalla.json +3 -3
  108. package/dist/spec/catalogs/font-schemes/shonar-bangla.json +2 -2
  109. package/dist/spec/catalogs/font-schemes/shruti.json +1 -1
  110. package/dist/spec/catalogs/font-schemes/simsun.json +1 -1
  111. package/dist/spec/catalogs/font-schemes/sylfaen.json +2 -2
  112. package/dist/spec/catalogs/font-schemes/traditional-arabic.json +3 -3
  113. package/dist/spec/catalogs/font-schemes/tunga.json +1 -1
  114. package/dist/spec/catalogs/font-schemes/vrinda.json +1 -1
  115. package/dist/spec/catalogs/font-schemes/yu-gothic.json +1 -1
  116. package/dist/spec/catalogs/layouts/business-model-canvas.json +66 -1
  117. package/dist/spec/catalogs/layouts/capability-map.json +53 -6
  118. package/dist/spec/catalogs/layouts/chart-1x-title-center.json +30 -0
  119. package/dist/spec/catalogs/layouts/chart-2x-title-center.json +36 -0
  120. package/dist/spec/catalogs/layouts/chart-2x-vertical-title-left.json +37 -0
  121. package/dist/spec/catalogs/layouts/chart-2x.json +32 -8
  122. package/dist/spec/catalogs/layouts/chart-3x-bottom-vertical-title-left.json +52 -0
  123. package/dist/spec/catalogs/layouts/chart-3x-left-title-center.json +51 -0
  124. package/dist/spec/catalogs/layouts/chart-3x-left.json +46 -0
  125. package/dist/spec/catalogs/layouts/chart-3x-right-title-center.json +51 -0
  126. package/dist/spec/catalogs/layouts/chart-3x-right.json +46 -0
  127. package/dist/spec/catalogs/layouts/chart-3x-title-center.json +39 -0
  128. package/dist/spec/catalogs/layouts/chart-3x-top-vertical-title-left.json +52 -0
  129. package/dist/spec/catalogs/layouts/chart-3x.json +48 -12
  130. package/dist/spec/catalogs/layouts/competitive-landscape.json +1 -4
  131. package/dist/spec/catalogs/layouts/customer-journey.json +1 -4
  132. package/dist/spec/catalogs/layouts/dashboard.json +37 -5
  133. package/dist/spec/catalogs/layouts/decision-tree.json +1 -4
  134. package/dist/spec/catalogs/layouts/ecosystem-map.json +1 -4
  135. package/dist/spec/catalogs/layouts/extract/canonical.json +0 -9
  136. package/dist/spec/catalogs/layouts/geographic-map.json +1 -4
  137. package/dist/spec/catalogs/layouts/icon-grid.json +1 -4
  138. package/dist/spec/catalogs/layouts/image-1x-crop-title-center.json +32 -0
  139. package/dist/spec/catalogs/layouts/image-1x-crop-title-left.json +32 -0
  140. package/dist/spec/catalogs/layouts/image-1x-crop.json +27 -0
  141. package/dist/spec/catalogs/layouts/image-1x-fit-title-center.json +32 -0
  142. package/dist/spec/catalogs/layouts/image-1x.json +3 -0
  143. package/dist/spec/catalogs/layouts/image-2x-crop-title-center.json +38 -0
  144. package/dist/spec/catalogs/layouts/image-2x-crop-vertical-title-left.json +39 -0
  145. package/dist/spec/catalogs/layouts/image-2x-crop-vertical.json +34 -0
  146. package/dist/spec/catalogs/layouts/image-2x-crop.json +33 -0
  147. package/dist/spec/catalogs/layouts/image-2x-fit-title-center.json +38 -0
  148. package/dist/spec/catalogs/layouts/image-2x-fit-vertical-title-left.json +39 -0
  149. package/dist/spec/catalogs/layouts/image-2x-fit-vertical.json +34 -0
  150. package/dist/spec/catalogs/layouts/image-2x.json +35 -8
  151. package/dist/spec/catalogs/layouts/image-3x-crop-title-center.json +41 -0
  152. package/dist/spec/catalogs/layouts/image-3x-crop-vertical-title-left.json +42 -0
  153. package/dist/spec/catalogs/layouts/image-3x-crop-vertical.json +37 -0
  154. package/dist/spec/catalogs/layouts/image-3x-crop.json +36 -0
  155. package/dist/spec/catalogs/layouts/image-3x-fit-title-center.json +41 -0
  156. package/dist/spec/catalogs/layouts/image-3x-fit-vertical-title-left.json +42 -0
  157. package/dist/spec/catalogs/layouts/image-3x-fit-vertical.json +37 -0
  158. package/dist/spec/catalogs/layouts/image-3x-fit.json +36 -0
  159. package/dist/spec/catalogs/layouts/image-3x.json +51 -12
  160. package/dist/spec/catalogs/layouts/image-focus.json +3 -6
  161. package/dist/spec/catalogs/layouts/image-only-1x-crop-title-center.json +31 -0
  162. package/dist/spec/catalogs/layouts/image-only-1x-fit-title-center.json +31 -0
  163. package/dist/spec/catalogs/layouts/image-only-2x-crop-title-center.json +37 -0
  164. package/dist/spec/catalogs/layouts/image-only-2x-crop-vertical-title-left.json +38 -0
  165. package/dist/spec/catalogs/layouts/image-only-2x-crop-vertical.json +33 -0
  166. package/dist/spec/catalogs/layouts/image-only-2x-fit-title-center.json +37 -0
  167. package/dist/spec/catalogs/layouts/image-only-2x-fit-vertical-title-left.json +38 -0
  168. package/dist/spec/catalogs/layouts/image-only-2x-fit-vertical.json +33 -0
  169. package/dist/spec/catalogs/layouts/image-only-3x-crop-title-center.json +40 -0
  170. package/dist/spec/catalogs/layouts/image-only-3x-crop-vertical-title-left.json +41 -0
  171. package/dist/spec/catalogs/layouts/image-only-3x-crop-vertical.json +36 -0
  172. package/dist/spec/catalogs/layouts/image-only-3x-crop.json +35 -0
  173. package/dist/spec/catalogs/layouts/image-only-3x-fit-title-center.json +40 -0
  174. package/dist/spec/catalogs/layouts/image-only-3x-fit-vertical-title-left.json +41 -0
  175. package/dist/spec/catalogs/layouts/image-only-3x-fit-vertical.json +36 -0
  176. package/dist/spec/catalogs/layouts/image-only-3x-fit.json +35 -0
  177. package/dist/spec/catalogs/layouts/index.json +1041 -151
  178. package/dist/spec/catalogs/layouts/kpi-scorecard.json +48 -3
  179. package/dist/spec/catalogs/layouts/list-1x-box-title-center.json +32 -0
  180. package/dist/spec/catalogs/layouts/list-1x-box-vertical-title-center.json +33 -0
  181. package/dist/spec/catalogs/layouts/list-1x-box-vertical-title-left.json +33 -0
  182. package/dist/spec/catalogs/layouts/list-1x-box-vertical.json +28 -0
  183. package/dist/spec/catalogs/layouts/list-1x-box.json +27 -0
  184. package/dist/spec/catalogs/layouts/list-1x-itemimage-title-center.json +32 -0
  185. package/dist/spec/catalogs/layouts/list-1x-itemimage-vertical-title-center.json +33 -0
  186. package/dist/spec/catalogs/layouts/list-1x-title-center.json +31 -0
  187. package/dist/spec/catalogs/layouts/list-1x-vertical-title-center.json +32 -0
  188. package/dist/spec/catalogs/layouts/list-2x-box-title-center.json +38 -0
  189. package/dist/spec/catalogs/layouts/list-2x-box-vertical-title-center.json +39 -0
  190. package/dist/spec/catalogs/layouts/list-2x-box-vertical-title-left.json +39 -0
  191. package/dist/spec/catalogs/layouts/list-2x-box-vertical.json +34 -0
  192. package/dist/spec/catalogs/layouts/list-2x-box.json +33 -0
  193. package/dist/spec/catalogs/layouts/list-2x-itemimage-title-center.json +38 -0
  194. package/dist/spec/catalogs/layouts/list-2x-itemimage-vertical-title-center.json +39 -0
  195. package/dist/spec/catalogs/layouts/list-2x-itemimage-vertical-title-left.json +39 -0
  196. package/dist/spec/catalogs/layouts/list-2x-itemimage-vertical.json +34 -0
  197. package/dist/spec/catalogs/layouts/list-2x-title-center.json +37 -0
  198. package/dist/spec/catalogs/layouts/list-2x-vertical-title-center.json +38 -0
  199. package/dist/spec/catalogs/layouts/list-2x-vertical-title-left.json +38 -0
  200. package/dist/spec/catalogs/layouts/list-2x-vertical.json +33 -0
  201. package/dist/spec/catalogs/layouts/list-3x-box-title-center.json +41 -0
  202. package/dist/spec/catalogs/layouts/list-3x-box-vertical-title-center.json +42 -0
  203. package/dist/spec/catalogs/layouts/list-3x-box-vertical-title-left.json +42 -0
  204. package/dist/spec/catalogs/layouts/list-3x-box-vertical.json +37 -0
  205. package/dist/spec/catalogs/layouts/list-3x-box.json +36 -0
  206. package/dist/spec/catalogs/layouts/list-3x-itemimage-title-center.json +41 -0
  207. package/dist/spec/catalogs/layouts/list-3x-itemimage-vertical-title-center.json +42 -0
  208. package/dist/spec/catalogs/layouts/list-3x-itemimage-vertical-title-left.json +42 -0
  209. package/dist/spec/catalogs/layouts/list-3x-itemimage-vertical.json +37 -0
  210. package/dist/spec/catalogs/layouts/list-3x-itemimage.json +36 -0
  211. package/dist/spec/catalogs/layouts/list-3x-title-center.json +40 -0
  212. package/dist/spec/catalogs/layouts/list-3x-vertical-title-center.json +41 -0
  213. package/dist/spec/catalogs/layouts/list-3x-vertical-title-left.json +41 -0
  214. package/dist/spec/catalogs/layouts/list-3x-vertical.json +36 -0
  215. package/dist/spec/catalogs/layouts/list-4x-box-title-center.json +45 -0
  216. package/dist/spec/catalogs/layouts/list-4x-box-vertical-title-center.json +45 -0
  217. package/dist/spec/catalogs/layouts/list-4x-box-vertical-title-left.json +45 -0
  218. package/dist/spec/catalogs/layouts/list-4x-box-vertical.json +40 -0
  219. package/dist/spec/catalogs/layouts/list-4x-box.json +40 -0
  220. package/dist/spec/catalogs/layouts/list-4x-itemimage-title-center.json +45 -0
  221. package/dist/spec/catalogs/layouts/list-4x-itemimage-vertical-title-center.json +45 -0
  222. package/dist/spec/catalogs/layouts/list-4x-itemimage-vertical-title-left.json +45 -0
  223. package/dist/spec/catalogs/layouts/list-4x-itemimage-vertical.json +40 -0
  224. package/dist/spec/catalogs/layouts/list-4x-title-center.json +44 -0
  225. package/dist/spec/catalogs/layouts/list-4x-vertical-title-center.json +44 -0
  226. package/dist/spec/catalogs/layouts/list-4x-vertical-title-left.json +44 -0
  227. package/dist/spec/catalogs/layouts/list-4x-vertical.json +39 -0
  228. package/dist/spec/catalogs/layouts/list-5x-box-title-center.json +48 -0
  229. package/dist/spec/catalogs/layouts/list-5x-box-vertical-title-center.json +50 -0
  230. package/dist/spec/catalogs/layouts/list-5x-box-vertical-title-left.json +50 -0
  231. package/dist/spec/catalogs/layouts/list-5x-box-vertical.json +45 -0
  232. package/dist/spec/catalogs/layouts/list-5x-box.json +43 -0
  233. package/dist/spec/catalogs/layouts/list-5x-itemimage-title-center.json +48 -0
  234. package/dist/spec/catalogs/layouts/list-5x-itemimage-vertical-title-center.json +48 -0
  235. package/dist/spec/catalogs/layouts/list-5x-itemimage-vertical-title-left.json +48 -0
  236. package/dist/spec/catalogs/layouts/list-5x-itemimage-vertical.json +43 -0
  237. package/dist/spec/catalogs/layouts/list-5x-title-center.json +47 -0
  238. package/dist/spec/catalogs/layouts/list-5x-vertical-title-center.json +47 -0
  239. package/dist/spec/catalogs/layouts/list-5x-vertical-title-left.json +47 -0
  240. package/dist/spec/catalogs/layouts/list-5x-vertical.json +42 -0
  241. package/dist/spec/catalogs/layouts/list-6x-box-title-center.json +51 -0
  242. package/dist/spec/catalogs/layouts/list-6x-box-vertical-title-center.json +53 -0
  243. package/dist/spec/catalogs/layouts/list-6x-box-vertical-title-left.json +53 -0
  244. package/dist/spec/catalogs/layouts/list-6x-box-vertical.json +48 -0
  245. package/dist/spec/catalogs/layouts/list-6x-box.json +46 -0
  246. package/dist/spec/catalogs/layouts/list-6x-itemimage-title-center.json +51 -0
  247. package/dist/spec/catalogs/layouts/list-6x-itemimage-vertical-title-center.json +51 -0
  248. package/dist/spec/catalogs/layouts/list-6x-itemimage-vertical-title-left.json +51 -0
  249. package/dist/spec/catalogs/layouts/list-6x-itemimage-vertical.json +46 -0
  250. package/dist/spec/catalogs/layouts/list-6x-title-center.json +50 -0
  251. package/dist/spec/catalogs/layouts/list-6x-vertical-title-center.json +50 -0
  252. package/dist/spec/catalogs/layouts/list-6x-vertical-title-left.json +50 -0
  253. package/dist/spec/catalogs/layouts/list-6x-vertical.json +45 -0
  254. package/dist/spec/catalogs/layouts/logic-tree.json +69 -0
  255. package/dist/spec/catalogs/layouts/market-size.json +26 -2
  256. package/dist/spec/catalogs/layouts/network-dependency-map.json +1 -4
  257. package/dist/spec/catalogs/layouts/number-1x-box-title-center.json +30 -0
  258. package/dist/spec/catalogs/layouts/number-1x-box.json +25 -0
  259. package/dist/spec/catalogs/layouts/number-1x-title-center.json +29 -0
  260. package/dist/spec/catalogs/layouts/number-2x-box-title-center.json +36 -0
  261. package/dist/spec/catalogs/layouts/number-2x-box.json +31 -0
  262. package/dist/spec/catalogs/layouts/number-2x-title-center.json +35 -0
  263. package/dist/spec/catalogs/layouts/number-3x-box-title-center.json +39 -0
  264. package/dist/spec/catalogs/layouts/number-3x-box.json +34 -0
  265. package/dist/spec/catalogs/layouts/number-3x-title-center.json +38 -0
  266. package/dist/spec/catalogs/layouts/number-4x-box-title-center.json +43 -0
  267. package/dist/spec/catalogs/layouts/number-4x-box.json +38 -0
  268. package/dist/spec/catalogs/layouts/number-4x-title-center.json +42 -0
  269. package/dist/spec/catalogs/layouts/number-5x-box-title-center.json +46 -0
  270. package/dist/spec/catalogs/layouts/number-5x-box.json +41 -0
  271. package/dist/spec/catalogs/layouts/number-5x-title-center.json +45 -0
  272. package/dist/spec/catalogs/layouts/number-6x-box-title-center.json +49 -0
  273. package/dist/spec/catalogs/layouts/number-6x-box.json +44 -0
  274. package/dist/spec/catalogs/layouts/number-6x-title-center.json +48 -0
  275. package/dist/spec/catalogs/layouts/org-chart.json +53 -6
  276. package/dist/spec/catalogs/layouts/persona-grid.json +1 -4
  277. package/dist/spec/catalogs/layouts/photo-grid.json +1 -4
  278. package/dist/spec/catalogs/layouts/product-feature.json +1 -4
  279. package/dist/spec/catalogs/layouts/screenshot-walkthrough.json +1 -4
  280. package/dist/spec/catalogs/layouts/swimlane-process.json +1 -4
  281. package/dist/spec/catalogs/layouts/team-bio.json +1 -4
  282. package/dist/spec/catalogs/layouts/text-1x-box-title-center.json +31 -0
  283. package/dist/spec/catalogs/layouts/text-1x-box-title-left.json +31 -0
  284. package/dist/spec/catalogs/layouts/text-1x-center-box-title-center.json +31 -0
  285. package/dist/spec/catalogs/layouts/text-1x-center-box-title-left.json +31 -0
  286. package/dist/spec/catalogs/layouts/text-1x-center-box.json +26 -0
  287. package/dist/spec/catalogs/layouts/text-1x-center-title-center.json +30 -0
  288. package/dist/spec/catalogs/layouts/text-1x-center-title-left.json +30 -0
  289. package/dist/spec/catalogs/layouts/text-1x-center.json +25 -0
  290. package/dist/spec/catalogs/layouts/text-1x-left-box.json +26 -0
  291. package/dist/spec/catalogs/layouts/text-1x-title-center.json +30 -0
  292. package/dist/spec/catalogs/layouts/text-2x-box-title-center.json +37 -0
  293. package/dist/spec/catalogs/layouts/text-2x-box-vertical-title-left.json +37 -0
  294. package/dist/spec/catalogs/layouts/text-2x-center-box-title-center.json +37 -0
  295. package/dist/spec/catalogs/layouts/text-2x-center-box-vertical-title-left.json +37 -0
  296. package/dist/spec/catalogs/layouts/text-2x-center-box.json +32 -0
  297. package/dist/spec/catalogs/layouts/text-2x-center-title-center.json +36 -0
  298. package/dist/spec/catalogs/layouts/text-2x-center-vertical-title-left.json +36 -0
  299. package/dist/spec/catalogs/layouts/text-2x-center.json +31 -0
  300. package/dist/spec/catalogs/layouts/text-2x-left-box.json +32 -0
  301. package/dist/spec/catalogs/layouts/text-2x-title-center.json +36 -0
  302. package/dist/spec/catalogs/layouts/text-2x-vertical-title-left.json +36 -0
  303. package/dist/spec/catalogs/layouts/text-3x-box-title-center.json +40 -0
  304. package/dist/spec/catalogs/layouts/text-3x-box-vertical-title-left.json +41 -0
  305. package/dist/spec/catalogs/layouts/text-3x-center-box-title-center.json +40 -0
  306. package/dist/spec/catalogs/layouts/text-3x-center-box-vertical-title-left.json +41 -0
  307. package/dist/spec/catalogs/layouts/text-3x-center-box.json +35 -0
  308. package/dist/spec/catalogs/layouts/text-3x-center-title-center.json +39 -0
  309. package/dist/spec/catalogs/layouts/text-3x-center-vertical-title-left.json +40 -0
  310. package/dist/spec/catalogs/layouts/text-3x-center.json +34 -0
  311. package/dist/spec/catalogs/layouts/text-3x-left-box.json +35 -0
  312. package/dist/spec/catalogs/layouts/text-3x-left.json +34 -0
  313. package/dist/spec/catalogs/layouts/text-3x-title-center.json +39 -0
  314. package/dist/spec/catalogs/layouts/text-3x-vertical-title-left.json +40 -0
  315. package/dist/spec/catalogs/layouts/title-center-box.json +27 -0
  316. package/dist/spec/catalogs/layouts/title-center-image-bottom.json +34 -0
  317. package/dist/spec/catalogs/layouts/title-center-image-top.json +34 -0
  318. package/dist/spec/catalogs/layouts/title-center.json +26 -0
  319. package/dist/spec/catalogs/layouts/title-left-image-bottom.json +34 -0
  320. package/dist/spec/catalogs/layouts/title-left-image-left.json +34 -0
  321. package/dist/spec/catalogs/layouts/title-left-image-right.json +34 -0
  322. package/dist/spec/catalogs/layouts/title-left-image-top.json +34 -0
  323. package/dist/spec/catalogs/manifest.json +18 -18
  324. package/dist/spec/catalogs/narratives/heros-journey.json +1 -1
  325. package/dist/spec/catalogs/narratives/index.json +1 -1
  326. package/dist/spec/openapi.yaml +3 -3
  327. package/dist/spec/reference/engine-defaults.json +22 -30
  328. package/dist/spec/reference/engine-vocabularies.json +1577 -0
  329. package/dist/spec/schemas/audience.schema.json +5 -26
  330. package/dist/spec/schemas/catalog-manifest.schema.json +3 -3
  331. package/dist/spec/schemas/chart-type.schema.json +2 -35
  332. package/dist/spec/schemas/color-scheme.schema.json +3 -24
  333. package/dist/spec/schemas/finding.schema.json +1 -1
  334. package/dist/spec/schemas/font-scheme.schema.json +6 -37
  335. package/dist/spec/schemas/language.schema.json +7 -28
  336. package/dist/spec/schemas/layout.schema.json +227 -55
  337. package/dist/spec/schemas/narrative.schema.json +4 -24
  338. package/dist/spec/schemas/opf.schema.json +410 -374
  339. package/dist/spec/schemas/purpose.schema.json +5 -26
  340. package/dist/spec/schemas/social-platform.schema.json +2 -23
  341. package/dist/spec/schemas/theme.schema.json +9 -37
  342. package/dist/spec/schemas/tone.schema.json +4 -25
  343. package/dist/spec-files.d.ts +1 -1
  344. package/dist/spec-files.js +1 -1
  345. package/dist/types.d.ts +1103 -4
  346. package/dist/{validation-types-zh03LeZy.d.ts → validation-types-HxIgJfKx.d.ts} +7 -7
  347. package/dist/validator.d.ts +15 -12
  348. package/dist/validator.js +5 -5
  349. package/dist/yaml.d.ts +22 -7
  350. package/dist/yaml.js +9 -321
  351. package/package.json +9 -9
  352. package/dist/catalogs-D-yyQWCQ.d.ts +0 -1343
  353. package/dist/catalogs.d.ts +0 -2
  354. package/dist/catalogs.js +0 -2
  355. package/dist/chunk-PIQXLBBJ.js +0 -445
  356. package/dist/chunk-S5W34SIJ.js +0 -1
  357. package/dist/previews.d.ts +0 -40
  358. package/dist/previews.js +0 -1
  359. package/dist/schemas-DDpqAgyS.d.ts +0 -284
  360. package/dist/spec/catalogs/layouts/image-bleed.json +0 -20
@@ -1,7 +1,7 @@
1
- import { C as CatalogKind } from './catalogs-D-yyQWCQ.js';
2
- import { T as TextMeasurement } from './composition-_WEwBe2a.js';
3
- import { f as FindingSeverity, e as FindingReport } from './finding-C_por275.js';
4
- import { J as JsonPrimitive } from './schemas-DDpqAgyS.js';
1
+ import { C as Catalog } from './catalog-refs-_anZs-Qz.js';
2
+ import { T as TextMeasurement } from './composition-D4ADF5c-.js';
3
+ import { c as FindingSeverity, F as FindingReport } from './finding-CT_f_vbD.js';
4
+ import { J as JsonPrimitive } from './json-BFSdESOE.js';
5
5
 
6
6
  /**
7
7
  * Template variables: typed, named values a deck declares once and uses in many
@@ -226,8 +226,8 @@ interface ValidateOptions {
226
226
  rule: string;
227
227
  path: string;
228
228
  }[];
229
- /** Catalog records already loaded by the host, consulted after the document's own `catalogs`. Nothing is fetched. */
230
- catalogs?: Partial<Record<CatalogKind, readonly unknown[]>>;
229
+ /** Catalogs the host registered, matched by source; the first is the host default for an omitted catalogs.default. Nothing is fetched. */
230
+ catalogs?: readonly Catalog[];
231
231
  /** Host policy (category `policy`). */
232
232
  contracts?: readonly Contract[];
233
233
  thresholds?: Partial<ValidationThresholds>;
@@ -244,7 +244,7 @@ interface ValidationChecks {
244
244
  /** `checked` for text input (JSON syntax and duplicate keys), `not-applicable` for a parsed document. */
245
245
  syntax: 'checked' | 'not-applicable';
246
246
  schema: 'checked' | 'not-run';
247
- /** Catalog ids, assets, datasets and references, resolved against the document, supplied catalogs and the bundled ones. Nothing is fetched. */
247
+ /** Content references, assets, datasets and citations, resolved against the document's catalogs groups and the registered catalogs. Nothing is fetched. */
248
248
  references: 'checked' | 'not-run';
249
249
  policy: 'checked' | 'not-run';
250
250
  accessibility: 'checked' | 'not-run';
@@ -1,11 +1,13 @@
1
- import { C as CatalogKind } from './catalogs-D-yyQWCQ.js';
2
- import { F as Finding } from './finding-C_por275.js';
3
- import { P as Presentation } from './presentation-C5eHkevA.js';
4
- import { i as ValidationThresholds, h as ValidationRuleInfo, a as ValidationReport, V as ValidateOptions } from './validation-types-zh03LeZy.js';
5
- export { C as Contract, d as ValidateFonts, e as ValidationCategory, f as ValidationChecks, g as ValidationRuleCost, z as validationCategories } from './validation-types-zh03LeZy.js';
6
- import './schemas-DDpqAgyS.js';
7
- import './composition-_WEwBe2a.js';
8
- import './chart-data-B_3z9VTb.js';
1
+ import { a as CatalogRecordKind } from './catalog-schemas-BZCjgAxu.js';
2
+ import { a as Finding } from './finding-CT_f_vbD.js';
3
+ import { P as Presentation } from './presentation-COrFuj2g.js';
4
+ import { i as ValidationThresholds, h as ValidationRuleInfo, a as ValidationReport, V as ValidateOptions } from './validation-types-HxIgJfKx.js';
5
+ export { C as Contract, d as ValidateFonts, e as ValidationCategory, f as ValidationChecks, g as ValidationRuleCost, z as validationCategories } from './validation-types-HxIgJfKx.js';
6
+ import './catalog-refs-_anZs-Qz.js';
7
+ import './schemas.js';
8
+ import './json-BFSdESOE.js';
9
+ import './composition-D4ADF5c-.js';
10
+ import './chart-data-BnNqgnC-.js';
9
11
 
10
12
  /**
11
13
  * The series palette opf-render and opf-pptx draw charts with (`CHART_COLORS`), in series order. A host with
@@ -51,10 +53,11 @@ declare function validate(input: unknown, options?: ValidateOptions): Validation
51
53
  */
52
54
  declare function assertValid(value: unknown, options?: ValidateOptions): asserts value is Presentation;
53
55
  /**
54
- * Check one catalog record (an audience, theme, layout, font scheme and so on) against its schema. The report has the same
55
- * shape as `validate`'s; every finding is `format` and a record that links to an unknown id warns.
56
+ * Check one published catalog record file (an audience, theme, layout, font scheme, chart type and so on) against its
57
+ * companion schema, `$schema` and `id` included. The report has the same shape as `validate`'s; every finding is `format`.
58
+ * A record a document embeds is checked by `validate`, keyed by its id and without `$schema`.
56
59
  */
57
- declare function validateCatalogRecord(kind: CatalogKind, value: unknown): ValidationReport;
58
- declare function assertValidCatalogRecord(kind: CatalogKind, value: unknown): void;
60
+ declare function validateCatalogRecord(kind: CatalogRecordKind, value: unknown): ValidationReport;
61
+ declare function assertValidCatalogRecord(kind: CatalogRecordKind, value: unknown): void;
59
62
 
60
63
  export { DEFAULT_CHART_PALETTE, DEFAULT_VALIDATION_THRESHOLDS, OPFValidationError, ValidateOptions, ValidationReport, ValidationRuleInfo, ValidationThresholds, assertValid, assertValidCatalogRecord, findValidationRule, promotedRegionKeys, validate, validateCatalogRecord, validationRules };
package/dist/validator.js CHANGED
@@ -1,5 +1,5 @@
1
- export { DEFAULT_CHART_PALETTE, DEFAULT_VALIDATION_THRESHOLDS, OPFValidationError, assertValid, assertValidCatalogRecord, findValidationRule, validate, validateCatalogRecord, validationCategories, validationRules } from './chunk-JDJBDYSR.js';
2
- export { promotedRegionKeys } from './chunk-6OXY2CP3.js';
3
- import './chunk-S5W34SIJ.js';
4
- import './chunk-XOZ4KMSR.js';
5
- import './chunk-LS2FMPI5.js';
1
+ export { DEFAULT_CHART_PALETTE, DEFAULT_VALIDATION_THRESHOLDS, OPFValidationError, assertValid, assertValidCatalogRecord, findValidationRule, validate, validateCatalogRecord, validationCategories, validationRules } from './chunk-PX5AWL7Y.js';
2
+ export { promotedRegionKeys } from './chunk-5PDN7BN6.js';
3
+ import './chunk-TRDXRRQK.js';
4
+ import './chunk-SPFV27O5.js';
5
+ import './chunk-WEDGVC5W.js';
package/dist/yaml.d.ts CHANGED
@@ -1,10 +1,10 @@
1
- import { P as Presentation } from './presentation-C5eHkevA.js';
2
- import { V as ValidateOptions, a as ValidationReport } from './validation-types-zh03LeZy.js';
3
- import { F as Finding, d as FindingLocation } from './finding-C_por275.js';
4
- import './catalogs-D-yyQWCQ.js';
5
- import './schemas-DDpqAgyS.js';
6
- import './composition-_WEwBe2a.js';
7
- import './chart-data-B_3z9VTb.js';
1
+ import { C as Catalog } from './catalog-refs-_anZs-Qz.js';
2
+ import { P as Presentation } from './presentation-COrFuj2g.js';
3
+ import { V as ValidateOptions, a as ValidationReport } from './validation-types-HxIgJfKx.js';
4
+ import { a as Finding, b as FindingLocation } from './finding-CT_f_vbD.js';
5
+ import './composition-D4ADF5c-.js';
6
+ import './chart-data-BnNqgnC-.js';
7
+ import './json-BFSdESOE.js';
8
8
 
9
9
  /** A finding located in the YAML source: `yaml/<rule>` syntax and dialect errors (category `format`) and the OPF findings of the parsed deck. */
10
10
  type YamlFinding = Finding & {
@@ -19,6 +19,19 @@ interface YamlComments {
19
19
  /** Find the comments of a YAML text (they are lost when a command rewrites the file) and its editor modeline. */
20
20
  declare function scanYamlComments(source: string): YamlComments;
21
21
 
22
+ /**
23
+ * OPF as YAML (RR-56): read a deck written as YAML and write any valid deck as YAML, with no renderer, fonts, network
24
+ * or model. JSON stays the canonical form; `.opf.yaml` is an authoring serialization of the same data.
25
+ *
26
+ * The reader accepts one dialect, strict by default: JSON-compatible YAML 1.2 (core schema) with exactly one document
27
+ * whose root is a mapping, no duplicate keys, no custom tags, no anchors, aliases or merge keys (opt in with
28
+ * `aliases: true`) and only finite numbers. Errors carry the offset, line and column of the YAML that caused them,
29
+ * including the OPF validation findings mapped back to the YAML of the field they name. The writer emits canonical schema key
30
+ * order, 2-space block style and quoted ambiguous strings, and reads its own output back before returning it.
31
+ *
32
+ * The same input always gives the same output.
33
+ */
34
+
22
35
  /** The canonical schema URL (`$id` of the presentation schema), used by `schemaComment`. */
23
36
  declare const YAML_SCHEMA_URL: string;
24
37
  interface FromYamlOptions {
@@ -27,6 +40,8 @@ interface FromYamlOptions {
27
40
  * and `references`; options pick other rules or categories (`{}` runs every rule); `false` skips the check.
28
41
  */
29
42
  validate?: boolean | ValidateOptions;
43
+ /** Catalogs the host registered, for the references check of `validate: true` (the default). Nothing is fetched. */
44
+ catalogs?: readonly Catalog[];
30
45
  /**
31
46
  * Expand anchors, aliases and `<<` merge keys (default false: they are an error). The expansion is capped at 100 aliases
32
47
  * and an alias inside its own anchor is rejected, so the result is always finite JSON-compatible data.
package/dist/yaml.js CHANGED
@@ -1,321 +1,9 @@
1
- import { Ctx } from './chunk-4LDGKLUC.js';
2
- import { sortPresentationKeys } from './chunk-5ZU6JAPP.js';
3
- import { same } from './chunk-CSQHPVGL.js';
4
- import { validate } from './chunk-JDJBDYSR.js';
5
- import './chunk-6OXY2CP3.js';
6
- import './chunk-S5W34SIJ.js';
7
- import './chunk-XOZ4KMSR.js';
8
- import { presentation } from './chunk-LS2FMPI5.js';
9
- import { Parser, parseDocument, isMap, Document, visit, isScalar, isAlias, isSeq } from 'yaml';
10
-
11
- var MAX_ALIAS_COUNT = 100;
12
- var CORE_TAGS = new Set(["map", "seq", "str", "int", "float", "bool", "null"].map((name) => `tag:yaml.org,2002:${name}`));
13
- var ALIAS_HELP = "Write each value out instead of using anchors (&name), aliases (*name) and merge keys (<<). Pass aliases: true (CLI: --aliases) to expand them.";
14
- var TAG_HELP = "Custom tags are not accepted. Remove the tag; quote a value to keep it as text.";
15
- var CYCLE_HELP = "An alias must not appear inside its own anchor. Write the nested value out.";
16
- var decode = (part) => part.replaceAll("~1", "/").replaceAll("~0", "~");
17
- var encode = (part) => part.replaceAll("~", "~0").replaceAll("/", "~1");
18
- var pointerOf = (parts) => parts.length ? `/${parts.map(encode).join("/")}` : "";
19
- function rangeOfPointer(doc, pointer) {
20
- const root = doc?.contents;
21
- if (!root?.range) return void 0;
22
- const parts = pointer === "" ? [] : pointer.slice(1).split("/").map(decode);
23
- let node = root;
24
- let key;
25
- for (const part of parts) {
26
- if (isAlias(node)) break;
27
- let child;
28
- let childKey;
29
- if (isMap(node)) {
30
- const pairs = node.items;
31
- const pair = pairs.find((item) => isScalar(item.key) && String(item.key.value) === part) ?? pairs.find((item) => isMergeKey(item.key) && item.value);
32
- if (pair) {
33
- childKey = pair.key;
34
- child = pair.value ?? childKey;
35
- }
36
- } else if (isSeq(node)) child = node.items[/^(?:0|[1-9]\d*)$/.test(part) ? Number(part) : -1];
37
- if (!child?.range) break;
38
- node = child;
39
- key = childKey;
40
- }
41
- const [start, end] = node.range;
42
- if (key?.range && (isMap(node) || isSeq(node) || isAlias(node))) return { start: key.range[0], end };
43
- return { start, end: Math.max(start, end) };
44
- }
45
- function isMergeKey(key) {
46
- return isScalar(key) && (typeof key.value === "symbol" || key.value === "<<" && key.type === "PLAIN");
47
- }
48
- function describeError(error) {
49
- const text = error.message.split("\n")[0] ?? error.message;
50
- switch (error.code) {
51
- case "DUPLICATE_KEY":
52
- return { rule: "duplicate-key", message: `YAML: ${text}`, help: "Remove or rename one of the repeated keys. JSON-compatible YAML needs every key once in each mapping." };
53
- case "MULTIPLE_DOCS":
54
- return { rule: "multiple-documents", message: "The input holds more than one YAML document.", help: "An OPF file is exactly one document: remove the extra --- separators, or put each deck in its own file." };
55
- case "TAG_RESOLVE_FAILED":
56
- return { rule: "tag", message: `YAML: ${text}`, help: TAG_HELP };
57
- case "BAD_ALIAS":
58
- return { rule: "alias", message: `YAML: ${text}`, help: ALIAS_HELP };
59
- default:
60
- return { rule: "syntax", message: `YAML: ${text}`, help: "Fix the YAML syntax at this position. An OPF file holds JSON-compatible YAML 1.2: mappings, sequences and scalars." };
61
- }
62
- }
63
- function keyRangeAt(doc, start) {
64
- let found;
65
- visit(doc, {
66
- Pair(_key, pair) {
67
- const key = pair.key;
68
- if (!found && key?.range && key.range[0] === start) found = { start, end: key.range[1] };
69
- }
70
- });
71
- return found;
72
- }
73
- function readYamlDocument(source, aliases, rootKind = "mapping") {
74
- const bom = source.startsWith("\uFEFF") ? 1 : 0;
75
- const text = source.slice(bom);
76
- const ctx = new Ctx(text);
77
- const findings = [];
78
- const locate = (range) => {
79
- const location = ctx.location(range);
80
- return { ...location, offset: location.offset + bom };
81
- };
82
- const add = (rule, message, help, range, path = "") => {
83
- findings.push({ ruleId: `yaml/${rule}`, severity: "error", category: "format", scope: "document", path, message, help, location: locate(range) });
84
- };
85
- const doc = parseDocument(text, { schema: "core", uniqueKeys: true, merge: aliases, prettyErrors: false });
86
- const finish = (value2) => ({
87
- value: value2,
88
- locatePointer: (pointer) => {
89
- const range = rangeOfPointer(doc, pointer);
90
- return range ? locate(range) : void 0;
91
- },
92
- findings,
93
- errors: findings.length
94
- });
95
- for (const error of [...doc.errors, ...doc.warnings.filter((warning) => warning.code === "TAG_RESOLVE_FAILED")]) {
96
- const described = describeError(error);
97
- const [start, end] = error.pos;
98
- add(described.rule, described.message, described.help, (error.code === "DUPLICATE_KEY" ? keyRangeAt(doc, start) : void 0) ?? { start, end: Math.max(start, end) });
99
- }
100
- if (findings.length) return finish({});
101
- const root = doc.contents;
102
- if (root === null || !root.range) {
103
- add("empty", "The input holds no YAML document.", "An OPF file is one YAML mapping: write the deck properties (name, slides, ...) as key: value lines.", { start: 0, end: Math.min(1, text.length) });
104
- return finish({});
105
- }
106
- const rootRange = { start: root.range[0], end: root.range[1] };
107
- if (rootKind === "mapping" && !isMap(root)) {
108
- add("not-mapping", "The document is not a mapping.", "An OPF deck is a YAML mapping of keys and values (name:, slides:, ...), not a list or a single value.", rootRange);
109
- return finish({});
110
- }
111
- checkTree({ doc, text, aliases, add }, root, [], []);
112
- if (findings.length) return finish({});
113
- let value;
114
- try {
115
- value = doc.toJS({ maxAliasCount: aliases ? MAX_ALIAS_COUNT : 0 });
116
- } catch (error) {
117
- const message = error instanceof Error ? error.message : String(error);
118
- if (/excessive alias/i.test(message)) add("alias-limit", `The anchors and aliases expand beyond the limit of ${MAX_ALIAS_COUNT} aliases.`, "Aliases that contain aliases grow exponentially. Write the repeated values out, or reduce the aliasing.", rootRange);
119
- else add("alias", `YAML: ${message}`, ALIAS_HELP, rootRange);
120
- return finish({});
121
- }
122
- if (isCircular(value)) {
123
- add("alias-cycle", "An alias refers to the value that contains it, so the document is infinitely deep.", CYCLE_HELP, rootRange);
124
- return finish({});
125
- }
126
- const bad = nonJson(value);
127
- if (bad) {
128
- add("number", `The YAML holds ${bad}, which JSON cannot carry.`, "Quote it to keep it as text, or write a finite number.", rootRange);
129
- return finish({});
130
- }
131
- return finish(value);
132
- }
133
- function propertyRange(text, nodeStart, token, fallback) {
134
- const found = text.lastIndexOf(token, nodeStart);
135
- return found >= 0 && found < nodeStart ? { start: found, end: found + token.length } : fallback;
136
- }
137
- function checkTree(env, node, trail, ancestors) {
138
- const { doc, text, aliases, add } = env;
139
- const path = pointerOf(trail);
140
- const range = (target) => ({ start: target.range?.[0] ?? 0, end: Math.max(target.range?.[0] ?? 0, target.range?.[1] ?? 0) });
141
- if (isAlias(node)) {
142
- const name = node.source;
143
- if (!aliases) add("alias", `The alias *${name} is not allowed.`, ALIAS_HELP, range(node), path);
144
- else {
145
- const target = node.resolve(doc);
146
- if (target && ancestors.includes(target)) add("alias-cycle", `The alias *${name} refers to a value that contains it.`, CYCLE_HELP, range(node), path);
147
- }
148
- return;
149
- }
150
- const anchor = node.anchor;
151
- if (anchor !== void 0 && !aliases) add("alias", `The anchor &${anchor} is not allowed.`, ALIAS_HELP, propertyRange(text, node.range?.[0] ?? 0, `&${anchor}`, range(node)), path);
152
- const tag = node.tag;
153
- if (tag !== void 0 && !CORE_TAGS.has(tag)) {
154
- let start = text.lastIndexOf("!", node.range?.[0] ?? 0);
155
- while (start > 0 && text[start - 1] === "!") start--;
156
- const written = start >= 0 ? /^!\S*/.exec(text.slice(start))?.[0] : void 0;
157
- add("tag", `The tag ${written ?? tag} is not allowed.`, TAG_HELP, written && start < (node.range?.[0] ?? 0) ? { start, end: start + written.length } : range(node), path);
158
- }
159
- if (isScalar(node)) {
160
- const value = node.value;
161
- if (typeof value === "number" && !Number.isFinite(value)) add("number", `${String(node.source ?? value)} is not a finite number, and JSON cannot carry it.`, 'Quote it (".inf", ".nan") to keep it as text, or write a finite number.', range(node), path);
162
- return;
163
- }
164
- const inside = [...ancestors, node];
165
- if (isMap(node)) {
166
- for (const pair of node.items) {
167
- const key = pair.key;
168
- if (key && isMergeKey(key)) {
169
- if (!aliases) add("alias", "The merge key << is not allowed.", ALIAS_HELP, range(key), path);
170
- else {
171
- const source = pair.value;
172
- if (source && isSeq(source)) for (const item of source.items) checkTree(env, item, [...trail, "<<"], inside);
173
- else if (source) checkTree(env, source, [...trail, "<<"], inside);
174
- }
175
- continue;
176
- }
177
- const resolved = key && isAlias(key) ? key.resolve(doc) : key;
178
- const name = resolved && isScalar(resolved) && typeof resolved.value === "string" ? resolved.value : void 0;
179
- if (key) checkTree(env, key, trail, inside);
180
- if (name === void 0) {
181
- add("key", "A mapping key is not a string.", 'JSON keys are always strings. Quote the key, for example "1": value.', key ? range(key) : range(node), path);
182
- continue;
183
- }
184
- if (pair.value) checkTree(env, pair.value, [...trail, name], inside);
185
- }
186
- return;
187
- }
188
- if (isSeq(node)) {
189
- const items = node.items;
190
- for (let index = 0; index < items.length; index++) checkTree(env, items[index], [...trail, String(index)], inside);
191
- }
192
- }
193
- function nonJson(value) {
194
- if (typeof value === "number") return Number.isFinite(value) ? void 0 : "a number that is not finite";
195
- if (value === null || typeof value === "string" || typeof value === "boolean") return void 0;
196
- if (Array.isArray(value)) return value.map(nonJson).find(Boolean);
197
- if (typeof value === "object") {
198
- const prototype = Object.getPrototypeOf(value);
199
- if (prototype !== Object.prototype && prototype !== null) return `a ${value.constructor?.name ?? "non-JSON"} value`;
200
- return Object.values(value).map(nonJson).find(Boolean);
201
- }
202
- return `a ${typeof value}`;
203
- }
204
- function isCircular(value, stack = /* @__PURE__ */ new Set()) {
205
- if (typeof value !== "object" || value === null) return false;
206
- if (stack.has(value)) return true;
207
- stack.add(value);
208
- const found = Object.values(value).some((child) => isCircular(child, stack));
209
- stack.delete(value);
210
- return found;
211
- }
212
- function scanYamlComments(source) {
213
- const text = source.startsWith("\uFEFF") ? source.slice(1) : source;
214
- let count = 0;
215
- let modeline;
216
- const visit3 = (value) => {
217
- if (Array.isArray(value)) value.forEach(visit3);
218
- else if (value && typeof value === "object") {
219
- const token = value;
220
- if (token.type === "comment" && typeof token.source === "string") {
221
- if (modeline === void 0 && token.offset === 0 && /^#\s*yaml-language-server:/.test(token.source)) modeline = token.source;
222
- else count++;
223
- } else for (const child of Object.values(value)) visit3(child);
224
- }
225
- };
226
- for (const token of new Parser().parse(text)) visit3(token);
227
- return { count, ...modeline === void 0 ? {} : { modeline } };
228
- }
229
- var AMBIGUOUS = [
230
- /^(?:y|n|yes|no|on|off|true|false|null|~|=|<<)$/i,
231
- /^[-+]?(?:0[0-7_]+|0b[01_]+|0x[0-9a-f_]+|[0-9][0-9_]*(?:\.[0-9_]*)?(?:e[-+]?[0-9]+)?|\.[0-9_]+(?:e[-+]?[0-9]+)?|\.inf)$/i,
232
- /^\.nan$/i,
233
- /^\d{4}-\d{1,2}-\d{1,2}(?:[Tt ].*)?$/,
234
- /^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+(?:\.[0-9_]*)?$/
235
- ];
236
- var isAmbiguous = (text) => AMBIGUOUS.some((pattern) => pattern.test(text));
237
- function writeCanonicalYaml(value, reads) {
238
- const expected = JSON.stringify(value);
239
- for (const blockQuote of [true, false]) {
240
- const doc = new Document(value, { schema: "core" });
241
- visit(doc, {
242
- Scalar(_key, node) {
243
- if (isScalar(node) && typeof node.value === "string" && isAmbiguous(node.value)) node.type = "QUOTE_DOUBLE";
244
- }
245
- });
246
- const text = doc.toString({ indent: 2, lineWidth: 0, minContentWidth: 0, blockQuote, defaultStringType: "PLAIN", defaultKeyType: "PLAIN" });
247
- const out = text.endsWith("\n") ? text : `${text}
248
- `;
249
- let back;
250
- try {
251
- back = reads(out);
252
- } catch {
253
- continue;
254
- }
255
- if (JSON.stringify(back) === expected) return out;
256
- }
257
- return void 0;
258
- }
259
-
260
- // src/yaml.ts
261
- var YAML_SCHEMA_URL = presentation.$id;
262
- var NOT_CHECKED = { syntax: "checked", schema: "not-run", references: "not-run", policy: "not-run", accessibility: "not-run", content: "not-run", layout: "not-run", backgroundPixels: "not-read", imageBytes: "embedded-only", nativeExport: "not-checked" };
263
- function fromYaml(yaml, options = {}) {
264
- if (typeof yaml !== "string") throw new TypeError("fromYaml expects a string.");
265
- const parsed = readYamlDocument(yaml, options.aliases === true);
266
- const findings = [...parsed.findings];
267
- let report = { schemaValid: null, checks: NOT_CHECKED };
268
- if (!parsed.errors && options.validate !== false) {
269
- const checked = validate(parsed.value, options.validate === true || options.validate === void 0 ? { only: ["format", "references"] } : options.validate);
270
- report = {
271
- schemaValid: checked.schemaValid,
272
- checks: { ...checked.checks, syntax: "checked" },
273
- ...checked.template === void 0 ? {} : { template: checked.template },
274
- ...checked.unfilledVariables === void 0 ? {} : { unfilledVariables: checked.unfilledVariables }
275
- };
276
- for (const found of checked.findings) {
277
- const location = parsed.locatePointer(found.path) ?? parsed.locatePointer("") ?? { offset: 0, length: 0, line: 1, column: 1 };
278
- findings.push({ ...found, location });
279
- }
280
- }
281
- findings.sort((a, b) => a.location.offset - b.location.offset);
282
- const counts = { error: 0, warning: 0, info: 0 };
283
- for (const found of findings) counts[found.severity]++;
284
- return { presentation: parsed.value, valid: counts.error === 0, findings, counts, ...report };
285
- }
286
- var OPFYamlError = class extends Error {
287
- code;
288
- details;
289
- constructor(code, message, details = {}) {
290
- super(message);
291
- this.name = "OPFYamlError";
292
- this.code = code;
293
- this.details = details;
294
- }
295
- };
296
- function toYaml(document, options = {}) {
297
- const checked = validate(document, { only: ["format"] });
298
- if (!checked.valid) {
299
- const errors = checked.findings.filter((found) => found.severity === "error");
300
- const first = errors[0];
301
- throw new OPFYamlError("invalid-document", `The document is not valid OPF: ${first?.message ?? "unknown error"}${first?.path ? ` (${first.path})` : ""}.`, { findings: errors });
302
- }
303
- const sorted = sortPresentationKeys(document);
304
- const text = writeCanonicalYaml(sorted, (out) => {
305
- const back = readYamlDocument(out, false);
306
- if (back.errors) throw new Error("The YAML does not read back.");
307
- return back.value;
308
- });
309
- if (text === void 0) throw new OPFYamlError("not-representable", "The document holds a value that YAML cannot carry exactly.");
310
- if (!same(JSON.parse(JSON.stringify(sorted)), readYamlDocument(text, false).value)) throw new OPFYamlError("not-representable", "The document does not read back from its YAML.");
311
- const schema = typeof sorted.$schema === "string" && !/[\r\n]/.test(sorted.$schema) ? sorted.$schema : YAML_SCHEMA_URL;
312
- return { yaml: options.schemaComment ? `# yaml-language-server: $schema=${schema}
313
- ${text}` : text };
314
- }
315
- function parseYamlData(yaml, options = {}) {
316
- if (typeof yaml !== "string") throw new TypeError("parseYamlData expects a string.");
317
- const parsed = readYamlDocument(yaml, options.aliases === true, "any");
318
- return { value: parsed.errors ? null : parsed.value, valid: parsed.errors === 0, findings: parsed.findings };
319
- }
320
-
321
- export { OPFYamlError, YAML_SCHEMA_URL, fromYaml, parseYamlData, scanYamlComments, toYaml };
1
+ export { OPFYamlError, YAML_SCHEMA_URL, fromYaml, parseYamlData, scanYamlComments, toYaml } from './chunk-K4DQQIT4.js';
2
+ import './chunk-5UEUAW57.js';
3
+ import './chunk-6OR326EA.js';
4
+ import './chunk-5TO6I3GB.js';
5
+ import './chunk-PX5AWL7Y.js';
6
+ import './chunk-5PDN7BN6.js';
7
+ import './chunk-TRDXRRQK.js';
8
+ import './chunk-SPFV27O5.js';
9
+ import './chunk-WEDGVC5W.js';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@openpresentation/opf",
3
- "version": "0.14.0",
4
- "description": "Canonical Open Presentation Format schemas, catalogs, TypeScript types, and local validation.",
3
+ "version": "0.16.0",
4
+ "description": "Canonical Open Presentation Format schemas, TypeScript types, local validation and composition; the pinned default catalog ships as the opt-in @openpresentation/opf/catalog.",
5
5
  "license": "MIT",
6
6
  "author": "Open Presentation",
7
7
  "homepage": "https://openpresentation.org",
@@ -38,9 +38,9 @@
38
38
  "types": "./dist/schemas.d.ts",
39
39
  "import": "./dist/schemas.js"
40
40
  },
41
- "./catalogs": {
42
- "types": "./dist/catalogs.d.ts",
43
- "import": "./dist/catalogs.js"
41
+ "./catalog": {
42
+ "types": "./dist/catalog.d.ts",
43
+ "import": "./dist/catalog.js"
44
44
  },
45
45
  "./validator": {
46
46
  "types": "./dist/validator.d.ts",
@@ -54,10 +54,6 @@
54
54
  "types": "./dist/spec-files.d.ts",
55
55
  "import": "./dist/spec-files.js"
56
56
  },
57
- "./previews": {
58
- "types": "./dist/previews.d.ts",
59
- "import": "./dist/previews.js"
60
- },
61
57
  "./examples": {
62
58
  "types": "./dist/examples.d.ts",
63
59
  "import": "./dist/examples.js"
@@ -92,6 +88,10 @@
92
88
  "types": "./dist/symbol-font-encodings.d.ts",
93
89
  "import": "./dist/symbol-font-encodings.js"
94
90
  },
91
+ "./deck": {
92
+ "types": "./dist/deck.d.ts",
93
+ "import": "./dist/deck.js"
94
+ },
95
95
  "./markdown": {
96
96
  "types": "./dist/markdown.d.ts",
97
97
  "import": "./dist/markdown.js"