@kardalum/plugin-sdk 0.0.0-stage → 0.15.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 (312) hide show
  1. package/CHANGELOG.md +108 -0
  2. package/LICENSE +202 -0
  3. package/README.md +70 -2
  4. package/dist/admin-section-registry.d.ts +34 -0
  5. package/dist/admin-section-registry.js +49 -0
  6. package/dist/built-in-serializers.d.ts +3 -0
  7. package/dist/built-in-serializers.js +18 -0
  8. package/dist/built-in-settings-schemas.d.ts +14 -0
  9. package/dist/built-in-settings-schemas.js +225 -0
  10. package/dist/built-in-value-schemas.d.ts +4 -0
  11. package/dist/built-in-value-schemas.js +47 -0
  12. package/dist/built-ins.d.ts +1 -0
  13. package/dist/built-ins.js +257 -0
  14. package/dist/capabilities.d.ts +99 -0
  15. package/dist/capabilities.js +363 -0
  16. package/dist/data-type-plugin.d.ts +28 -0
  17. package/dist/data-type-plugin.js +1 -0
  18. package/dist/datatype-validation.d.ts +26 -0
  19. package/dist/datatype-validation.js +110 -0
  20. package/dist/datatypes-entry.d.ts +4 -0
  21. package/dist/datatypes-entry.js +18 -0
  22. package/dist/define-plugin.d.ts +25 -0
  23. package/dist/define-plugin.js +51 -0
  24. package/dist/entitlement-entry.d.ts +5 -0
  25. package/dist/entitlement-entry.js +24 -0
  26. package/dist/entitlement-gate.d.ts +36 -0
  27. package/dist/entitlement-gate.js +201 -0
  28. package/dist/entitlement-types.d.ts +39 -0
  29. package/dist/entitlement-types.js +1 -0
  30. package/dist/entitlement.d.ts +57 -0
  31. package/dist/entitlement.js +170 -0
  32. package/dist/host-entry.d.ts +1 -0
  33. package/dist/host-entry.js +11 -0
  34. package/dist/icon-name.d.ts +1 -0
  35. package/dist/icon-name.js +1 -0
  36. package/dist/icons.d.ts +2 -0
  37. package/dist/icons.js +10 -0
  38. package/dist/index.d.ts +28 -0
  39. package/dist/index.js +93 -0
  40. package/dist/license-verdict-keys.d.ts +18 -0
  41. package/dist/license-verdict-keys.js +22 -0
  42. package/dist/local-host.d.ts +3 -0
  43. package/dist/local-host.js +38 -0
  44. package/dist/manifest-entry.d.ts +8 -0
  45. package/dist/manifest-entry.js +13 -0
  46. package/dist/manifest-schema.d.ts +408 -0
  47. package/dist/manifest-schema.js +774 -0
  48. package/dist/manifest.d.ts +546 -0
  49. package/dist/manifest.js +86 -0
  50. package/dist/media/media-picker.d.ts +39 -0
  51. package/dist/media/media-picker.js +438 -0
  52. package/dist/media/upload-error.d.ts +12 -0
  53. package/dist/media/upload-error.js +30 -0
  54. package/dist/plugin-context.d.ts +75 -0
  55. package/dist/plugin-context.js +70 -0
  56. package/dist/plugin-screen-context.d.ts +40 -0
  57. package/dist/plugin-screen-context.js +16 -0
  58. package/dist/register-built-ins.d.ts +1 -0
  59. package/dist/register-built-ins.js +41 -0
  60. package/dist/registry.d.ts +4 -0
  61. package/dist/registry.js +17 -0
  62. package/dist/rendition-eligibility.d.ts +24 -0
  63. package/dist/rendition-eligibility.js +40 -0
  64. package/dist/richtext/block-panel.d.ts +27 -0
  65. package/dist/richtext/block-panel.js +232 -0
  66. package/dist/richtext/extensions.d.ts +19 -0
  67. package/dist/richtext/extensions.js +56 -0
  68. package/dist/richtext/insert-menu.d.ts +24 -0
  69. package/dist/richtext/insert-menu.js +142 -0
  70. package/dist/richtext/kardalum-block.d.ts +33 -0
  71. package/dist/richtext/kardalum-block.js +282 -0
  72. package/dist/richtext/style-listbox.d.ts +10 -0
  73. package/dist/richtext/style-listbox.js +69 -0
  74. package/dist/richtext/text-style-class.d.ts +18 -0
  75. package/dist/richtext/text-style-class.js +36 -0
  76. package/dist/simple-storage-value-provider.d.ts +9 -0
  77. package/dist/simple-storage-value-provider.js +96 -0
  78. package/dist/structured-storage-types.d.ts +61 -0
  79. package/dist/structured-storage-types.js +11 -0
  80. package/dist/tailwind.d.ts +1 -0
  81. package/dist/tailwind.js +5 -0
  82. package/dist/tokens/system-dark.css +75 -0
  83. package/dist/tokens/tokens.css +239 -0
  84. package/dist/tokens/tokens.json +212 -0
  85. package/dist/tokens.d.ts +1 -0
  86. package/dist/tokens.js +11 -0
  87. package/dist/ui-entry.d.ts +5 -0
  88. package/dist/ui-entry.js +42 -0
  89. package/dist/views/content-list-preview.d.ts +1 -0
  90. package/dist/views/content-list-preview.js +14 -0
  91. package/dist/views/content-list-settings-view.d.ts +1 -0
  92. package/dist/views/content-list-settings-view.js +97 -0
  93. package/dist/views/content-list-view.d.ts +19 -0
  94. package/dist/views/content-list-view.js +248 -0
  95. package/dist/views/crop-view.d.ts +55 -0
  96. package/dist/views/crop-view.js +161 -0
  97. package/dist/views/date-range-view.d.ts +6 -0
  98. package/dist/views/date-range-view.js +55 -0
  99. package/dist/views/file-upload-view.d.ts +43 -0
  100. package/dist/views/file-upload-view.js +104 -0
  101. package/dist/views/html-code-editor.d.ts +10 -0
  102. package/dist/views/html-code-editor.js +101 -0
  103. package/dist/views/html-view.d.ts +3 -0
  104. package/dist/views/html-view.js +53 -0
  105. package/dist/views/image-view.d.ts +3 -0
  106. package/dist/views/image-view.js +387 -0
  107. package/dist/views/rich-text-view.d.ts +2 -0
  108. package/dist/views/rich-text-view.js +429 -0
  109. package/node_modules/@kardalum/api-schemas/LICENSE +202 -0
  110. package/node_modules/@kardalum/api-schemas/README.md +56 -0
  111. package/node_modules/@kardalum/api-schemas/dist/action.schema.d.ts +30 -0
  112. package/node_modules/@kardalum/api-schemas/dist/action.schema.js +88 -0
  113. package/node_modules/@kardalum/api-schemas/dist/api-error.schema.d.ts +5 -0
  114. package/node_modules/@kardalum/api-schemas/dist/api-error.schema.js +6 -0
  115. package/node_modules/@kardalum/api-schemas/dist/api-key-api.schema.d.ts +75 -0
  116. package/node_modules/@kardalum/api-schemas/dist/api-key-api.schema.js +36 -0
  117. package/node_modules/@kardalum/api-schemas/dist/asset-api.schema.d.ts +89 -0
  118. package/node_modules/@kardalum/api-schemas/dist/asset-api.schema.js +60 -0
  119. package/node_modules/@kardalum/api-schemas/dist/asset.schema.d.ts +24 -0
  120. package/node_modules/@kardalum/api-schemas/dist/asset.schema.js +47 -0
  121. package/node_modules/@kardalum/api-schemas/dist/auth.schema.d.ts +38 -0
  122. package/node_modules/@kardalum/api-schemas/dist/auth.schema.js +38 -0
  123. package/node_modules/@kardalum/api-schemas/dist/content-api.schema.d.ts +537 -0
  124. package/node_modules/@kardalum/api-schemas/dist/content-api.schema.js +353 -0
  125. package/node_modules/@kardalum/api-schemas/dist/content-list.schema.d.ts +158 -0
  126. package/node_modules/@kardalum/api-schemas/dist/content-list.schema.js +139 -0
  127. package/node_modules/@kardalum/api-schemas/dist/content-path.d.ts +125 -0
  128. package/node_modules/@kardalum/api-schemas/dist/content-path.js +256 -0
  129. package/node_modules/@kardalum/api-schemas/dist/content-trash-api.schema.d.ts +20 -0
  130. package/node_modules/@kardalum/api-schemas/dist/content-trash-api.schema.js +23 -0
  131. package/node_modules/@kardalum/api-schemas/dist/content-trash.schema.d.ts +151 -0
  132. package/node_modules/@kardalum/api-schemas/dist/content-trash.schema.js +82 -0
  133. package/node_modules/@kardalum/api-schemas/dist/content-version.schema.d.ts +18 -0
  134. package/node_modules/@kardalum/api-schemas/dist/content-version.schema.js +22 -0
  135. package/node_modules/@kardalum/api-schemas/dist/content.schema.d.ts +17 -0
  136. package/node_modules/@kardalum/api-schemas/dist/content.schema.js +20 -0
  137. package/node_modules/@kardalum/api-schemas/dist/core-actions.d.ts +302 -0
  138. package/node_modules/@kardalum/api-schemas/dist/core-actions.js +97 -0
  139. package/node_modules/@kardalum/api-schemas/dist/culture-direction.d.ts +1 -0
  140. package/node_modules/@kardalum/api-schemas/dist/culture-direction.js +9 -0
  141. package/node_modules/@kardalum/api-schemas/dist/data-type-api.schema.d.ts +36 -0
  142. package/node_modules/@kardalum/api-schemas/dist/data-type-api.schema.js +32 -0
  143. package/node_modules/@kardalum/api-schemas/dist/data-type-config.schema.d.ts +9 -0
  144. package/node_modules/@kardalum/api-schemas/dist/data-type-config.schema.js +32 -0
  145. package/node_modules/@kardalum/api-schemas/dist/document-type-api.schema.d.ts +296 -0
  146. package/node_modules/@kardalum/api-schemas/dist/document-type-api.schema.js +138 -0
  147. package/node_modules/@kardalum/api-schemas/dist/document-type.schema.d.ts +121 -0
  148. package/node_modules/@kardalum/api-schemas/dist/document-type.schema.js +147 -0
  149. package/node_modules/@kardalum/api-schemas/dist/health.schema.d.ts +6 -0
  150. package/node_modules/@kardalum/api-schemas/dist/health.schema.js +5 -0
  151. package/node_modules/@kardalum/api-schemas/dist/html-entities.d.ts +4 -0
  152. package/node_modules/@kardalum/api-schemas/dist/html-entities.js +250 -0
  153. package/node_modules/@kardalum/api-schemas/dist/index.d.ts +102 -0
  154. package/node_modules/@kardalum/api-schemas/dist/index.js +58 -0
  155. package/node_modules/@kardalum/api-schemas/dist/licensing.schema.d.ts +15 -0
  156. package/node_modules/@kardalum/api-schemas/dist/licensing.schema.js +14 -0
  157. package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.d.ts +381 -0
  158. package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.js +197 -0
  159. package/node_modules/@kardalum/api-schemas/dist/media-api.schema.d.ts +167 -0
  160. package/node_modules/@kardalum/api-schemas/dist/media-api.schema.js +214 -0
  161. package/node_modules/@kardalum/api-schemas/dist/media-reference-api.schema.d.ts +77 -0
  162. package/node_modules/@kardalum/api-schemas/dist/media-reference-api.schema.js +53 -0
  163. package/node_modules/@kardalum/api-schemas/dist/media-reference-use.d.ts +75 -0
  164. package/node_modules/@kardalum/api-schemas/dist/media-reference-use.js +117 -0
  165. package/node_modules/@kardalum/api-schemas/dist/media-reference.d.ts +27 -0
  166. package/node_modules/@kardalum/api-schemas/dist/media-reference.js +279 -0
  167. package/node_modules/@kardalum/api-schemas/dist/media-rendition.schema.d.ts +74 -0
  168. package/node_modules/@kardalum/api-schemas/dist/media-rendition.schema.js +157 -0
  169. package/node_modules/@kardalum/api-schemas/dist/media.schema.d.ts +80 -0
  170. package/node_modules/@kardalum/api-schemas/dist/media.schema.js +156 -0
  171. package/node_modules/@kardalum/api-schemas/dist/nav.schema.d.ts +23 -0
  172. package/node_modules/@kardalum/api-schemas/dist/nav.schema.js +55 -0
  173. package/node_modules/@kardalum/api-schemas/dist/node-access.schema.d.ts +846 -0
  174. package/node_modules/@kardalum/api-schemas/dist/node-access.schema.js +356 -0
  175. package/node_modules/@kardalum/api-schemas/dist/plugin-actions.schema.d.ts +20 -0
  176. package/node_modules/@kardalum/api-schemas/dist/plugin-actions.schema.js +27 -0
  177. package/node_modules/@kardalum/api-schemas/dist/plugin-docs-api.schema.d.ts +169 -0
  178. package/node_modules/@kardalum/api-schemas/dist/plugin-docs-api.schema.js +80 -0
  179. package/node_modules/@kardalum/api-schemas/dist/plugin-docs-text.d.ts +65 -0
  180. package/node_modules/@kardalum/api-schemas/dist/plugin-docs-text.js +889 -0
  181. package/node_modules/@kardalum/api-schemas/dist/plugin-docs.d.ts +89 -0
  182. package/node_modules/@kardalum/api-schemas/dist/plugin-docs.js +134 -0
  183. package/node_modules/@kardalum/api-schemas/dist/plugin-id-rules.d.ts +31 -0
  184. package/node_modules/@kardalum/api-schemas/dist/plugin-id-rules.js +38 -0
  185. package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.d.ts +369 -0
  186. package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.js +393 -0
  187. package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-actions.d.ts +22 -0
  188. package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-actions.js +87 -0
  189. package/node_modules/@kardalum/api-schemas/dist/plugin-registry-api.schema.d.ts +31 -0
  190. package/node_modules/@kardalum/api-schemas/dist/plugin-registry-api.schema.js +25 -0
  191. package/node_modules/@kardalum/api-schemas/dist/plugin-storage-api.schema.d.ts +15 -0
  192. package/node_modules/@kardalum/api-schemas/dist/plugin-storage-api.schema.js +24 -0
  193. package/node_modules/@kardalum/api-schemas/dist/public-api.schema.d.ts +306 -0
  194. package/node_modules/@kardalum/api-schemas/dist/public-api.schema.js +328 -0
  195. package/node_modules/@kardalum/api-schemas/dist/render-editing.d.ts +79 -0
  196. package/node_modules/@kardalum/api-schemas/dist/render-editing.js +50 -0
  197. package/node_modules/@kardalum/api-schemas/dist/render-settings-api.schema.d.ts +9 -0
  198. package/node_modules/@kardalum/api-schemas/dist/render-settings-api.schema.js +13 -0
  199. package/node_modules/@kardalum/api-schemas/dist/reserved-slugs.d.ts +2 -0
  200. package/node_modules/@kardalum/api-schemas/dist/reserved-slugs.js +16 -0
  201. package/node_modules/@kardalum/api-schemas/dist/role.schema.d.ts +90 -0
  202. package/node_modules/@kardalum/api-schemas/dist/role.schema.js +69 -0
  203. package/node_modules/@kardalum/api-schemas/dist/sample-content-outcome.schema.d.ts +17 -0
  204. package/node_modules/@kardalum/api-schemas/dist/sample-content-outcome.schema.js +27 -0
  205. package/node_modules/@kardalum/api-schemas/dist/setup-api.schema.d.ts +108 -0
  206. package/node_modules/@kardalum/api-schemas/dist/setup-api.schema.js +93 -0
  207. package/node_modules/@kardalum/api-schemas/dist/sites.schema.d.ts +243 -0
  208. package/node_modules/@kardalum/api-schemas/dist/sites.schema.js +296 -0
  209. package/node_modules/@kardalum/api-schemas/dist/snapshot-api.schema.d.ts +43 -0
  210. package/node_modules/@kardalum/api-schemas/dist/snapshot-api.schema.js +25 -0
  211. package/node_modules/@kardalum/api-schemas/dist/snapshot.schema.d.ts +30 -0
  212. package/node_modules/@kardalum/api-schemas/dist/snapshot.schema.js +19 -0
  213. package/node_modules/@kardalum/api-schemas/dist/template-api.schema.d.ts +112 -0
  214. package/node_modules/@kardalum/api-schemas/dist/template-api.schema.js +74 -0
  215. package/node_modules/@kardalum/api-schemas/dist/template.schema.d.ts +41 -0
  216. package/node_modules/@kardalum/api-schemas/dist/template.schema.js +39 -0
  217. package/node_modules/@kardalum/api-schemas/dist/theme-api.schema.d.ts +21 -0
  218. package/node_modules/@kardalum/api-schemas/dist/theme-api.schema.js +14 -0
  219. package/node_modules/@kardalum/api-schemas/dist/user-api.schema.d.ts +89 -0
  220. package/node_modules/@kardalum/api-schemas/dist/user-api.schema.js +68 -0
  221. package/node_modules/@kardalum/api-schemas/package.json +35 -0
  222. package/node_modules/@kardalum/design-tokens/LICENSE +202 -0
  223. package/node_modules/@kardalum/design-tokens/README.md +29 -0
  224. package/node_modules/@kardalum/design-tokens/dist/build-css.d.ts +32 -0
  225. package/node_modules/@kardalum/design-tokens/dist/build-css.js +88 -0
  226. package/node_modules/@kardalum/design-tokens/dist/generate.d.ts +1 -0
  227. package/node_modules/@kardalum/design-tokens/dist/generate.js +18 -0
  228. package/node_modules/@kardalum/design-tokens/dist/index.d.ts +6 -0
  229. package/node_modules/@kardalum/design-tokens/dist/index.js +4 -0
  230. package/node_modules/@kardalum/design-tokens/dist/system-dark.css +75 -0
  231. package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.d.ts +33 -0
  232. package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.js +54 -0
  233. package/node_modules/@kardalum/design-tokens/dist/theme-css.d.ts +12 -0
  234. package/node_modules/@kardalum/design-tokens/dist/theme-css.js +42 -0
  235. package/node_modules/@kardalum/design-tokens/dist/theme-types.d.ts +43 -0
  236. package/node_modules/@kardalum/design-tokens/dist/theme-types.js +1 -0
  237. package/node_modules/@kardalum/design-tokens/dist/themes/dark.d.ts +13 -0
  238. package/node_modules/@kardalum/design-tokens/dist/themes/dark.js +120 -0
  239. package/node_modules/@kardalum/design-tokens/dist/themes/index.d.ts +5 -0
  240. package/node_modules/@kardalum/design-tokens/dist/themes/index.js +4 -0
  241. package/node_modules/@kardalum/design-tokens/dist/themes/light.d.ts +9 -0
  242. package/node_modules/@kardalum/design-tokens/dist/themes/light.js +13 -0
  243. package/node_modules/@kardalum/design-tokens/dist/tokens.css +239 -0
  244. package/node_modules/@kardalum/design-tokens/dist/tokens.d.ts +25 -0
  245. package/node_modules/@kardalum/design-tokens/dist/tokens.js +276 -0
  246. package/node_modules/@kardalum/design-tokens/dist/tokens.json +212 -0
  247. package/node_modules/@kardalum/design-tokens/dist/types.d.ts +91 -0
  248. package/node_modules/@kardalum/design-tokens/dist/types.js +5 -0
  249. package/node_modules/@kardalum/design-tokens/package.json +42 -0
  250. package/node_modules/@kardalum/plugin-package/LICENSE +202 -0
  251. package/node_modules/@kardalum/plugin-package/README.md +71 -0
  252. package/node_modules/@kardalum/plugin-package/dist/docs-contract.d.ts +50 -0
  253. package/node_modules/@kardalum/plugin-package/dist/docs-contract.js +659 -0
  254. package/node_modules/@kardalum/plugin-package/dist/envelope.d.ts +19 -0
  255. package/node_modules/@kardalum/plugin-package/dist/envelope.js +104 -0
  256. package/node_modules/@kardalum/plugin-package/dist/extract.d.ts +37 -0
  257. package/node_modules/@kardalum/plugin-package/dist/extract.js +199 -0
  258. package/node_modules/@kardalum/plugin-package/dist/hash.d.ts +17 -0
  259. package/node_modules/@kardalum/plugin-package/dist/hash.js +69 -0
  260. package/node_modules/@kardalum/plugin-package/dist/index.d.ts +11 -0
  261. package/node_modules/@kardalum/plugin-package/dist/index.js +7 -0
  262. package/node_modules/@kardalum/plugin-package/dist/license-verdict.d.ts +185 -0
  263. package/node_modules/@kardalum/plugin-package/dist/license-verdict.js +236 -0
  264. package/node_modules/@kardalum/plugin-package/dist/package-contract.d.ts +50 -0
  265. package/node_modules/@kardalum/plugin-package/dist/package-contract.js +115 -0
  266. package/node_modules/@kardalum/plugin-package/dist/sample-content.d.ts +1 -0
  267. package/node_modules/@kardalum/plugin-package/dist/sample-content.js +17 -0
  268. package/node_modules/@kardalum/plugin-package/dist/types.d.ts +45 -0
  269. package/node_modules/@kardalum/plugin-package/dist/types.js +1 -0
  270. package/node_modules/@kardalum/plugin-package/package.json +49 -0
  271. package/node_modules/@kardalum/ui/LICENSE +202 -0
  272. package/node_modules/@kardalum/ui/README.md +35 -0
  273. package/node_modules/@kardalum/ui/dist/components/alert-dialog.d.ts +14 -0
  274. package/node_modules/@kardalum/ui/dist/components/alert-dialog.js +38 -0
  275. package/node_modules/@kardalum/ui/dist/components/badge.d.ts +9 -0
  276. package/node_modules/@kardalum/ui/dist/components/badge.js +30 -0
  277. package/node_modules/@kardalum/ui/dist/components/button.d.ts +11 -0
  278. package/node_modules/@kardalum/ui/dist/components/button.js +37 -0
  279. package/node_modules/@kardalum/ui/dist/components/checkbox.d.ts +5 -0
  280. package/node_modules/@kardalum/ui/dist/components/checkbox.js +7 -0
  281. package/node_modules/@kardalum/ui/dist/components/dialog.d.ts +17 -0
  282. package/node_modules/@kardalum/ui/dist/components/dialog.js +48 -0
  283. package/node_modules/@kardalum/ui/dist/components/dropdown-menu.d.ts +18 -0
  284. package/node_modules/@kardalum/ui/dist/components/dropdown-menu.js +53 -0
  285. package/node_modules/@kardalum/ui/dist/components/empty-state.d.ts +30 -0
  286. package/node_modules/@kardalum/ui/dist/components/empty-state.js +9 -0
  287. package/node_modules/@kardalum/ui/dist/components/input.d.ts +4 -0
  288. package/node_modules/@kardalum/ui/dist/components/input.js +6 -0
  289. package/node_modules/@kardalum/ui/dist/components/panel.d.ts +5 -0
  290. package/node_modules/@kardalum/ui/dist/components/panel.js +6 -0
  291. package/node_modules/@kardalum/ui/dist/components/property-field.d.ts +19 -0
  292. package/node_modules/@kardalum/ui/dist/components/property-field.js +86 -0
  293. package/node_modules/@kardalum/ui/dist/components/sheet.d.ts +17 -0
  294. package/node_modules/@kardalum/ui/dist/components/sheet.js +55 -0
  295. package/node_modules/@kardalum/ui/dist/components/skeleton.d.ts +3 -0
  296. package/node_modules/@kardalum/ui/dist/components/skeleton.js +9 -0
  297. package/node_modules/@kardalum/ui/dist/components/switch.d.ts +5 -0
  298. package/node_modules/@kardalum/ui/dist/components/switch.js +7 -0
  299. package/node_modules/@kardalum/ui/dist/components/tab-strip.d.ts +34 -0
  300. package/node_modules/@kardalum/ui/dist/components/tab-strip.js +72 -0
  301. package/node_modules/@kardalum/ui/dist/components/toast.d.ts +18 -0
  302. package/node_modules/@kardalum/ui/dist/components/toast.js +42 -0
  303. package/node_modules/@kardalum/ui/dist/components/toaster.d.ts +12 -0
  304. package/node_modules/@kardalum/ui/dist/components/toaster.js +11 -0
  305. package/node_modules/@kardalum/ui/dist/components/use-toast.d.ts +17 -0
  306. package/node_modules/@kardalum/ui/dist/components/use-toast.js +62 -0
  307. package/node_modules/@kardalum/ui/dist/index.d.ts +18 -0
  308. package/node_modules/@kardalum/ui/dist/index.js +18 -0
  309. package/node_modules/@kardalum/ui/dist/lib/cn.d.ts +2 -0
  310. package/node_modules/@kardalum/ui/dist/lib/cn.js +5 -0
  311. package/node_modules/@kardalum/ui/package.json +63 -0
  312. package/package.json +146 -4
@@ -0,0 +1,53 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * S234g. What destroying a media item would break, split by whether it
4
+ * breaks now, only after a rollback, or only if a trashed page comes back.
5
+ *
6
+ * Counted by distinct PAGE, never by row: a picture used across seven
7
+ * versions of one page is one page.
8
+ */
9
+ export const MediaReferenceCountsSchema = z.object({
10
+ live: z.number().int().nonnegative(),
11
+ history: z.number().int().nonnegative(),
12
+ trashed: z.number().int().nonnegative(),
13
+ });
14
+ /**
15
+ * One page, field and culture that references the item, with the highest
16
+ * version mentioning it there.
17
+ *
18
+ * `path` rather than a name: the path is on the content node and needs no
19
+ * second read, and since S227 it is derived from the name, so it is
20
+ * recognisable. `culture` is "" for a field shared by every language.
21
+ */
22
+ export const MediaReferenceUseSchema = z.object({
23
+ contentId: z.string().uuid(),
24
+ path: z.string().min(1),
25
+ culture: z.string(),
26
+ fieldId: z.string().min(1),
27
+ version: z.number().int().positive(),
28
+ state: z.enum(["live", "history", "trashed"]),
29
+ });
30
+ export const MediaReferenceListQuerySchema = z.object({
31
+ // NOT a uuid. The list is ordered by (contentId, fieldId, culture) and
32
+ // a page can contribute several rows, so a cursor naming only the
33
+ // content id would skip the rest of that page's rows. It is an opaque
34
+ // string the adapter encodes and decodes, and no caller should parse it.
35
+ cursor: z.string().min(1).optional(),
36
+ limit: z.coerce.number().int().min(1).max(100).default(25),
37
+ });
38
+ export const MediaReferenceListResponseSchema = z.object({
39
+ counts: MediaReferenceCountsSchema,
40
+ items: z.array(MediaReferenceUseSchema),
41
+ nextCursor: z.string().min(1).nullable(),
42
+ });
43
+ /**
44
+ * The aggregate behind the Empty trash dialog: how many files are in the
45
+ * bin, and how many pages every one of them together would affect.
46
+ *
47
+ * One call rather than one per file, which is why the adapter's count
48
+ * takes an array.
49
+ */
50
+ export const MediaTrashReferenceSummarySchema = z.object({
51
+ files: z.number().int().nonnegative(),
52
+ counts: MediaReferenceCountsSchema,
53
+ });
@@ -0,0 +1,75 @@
1
+ /**
2
+ * S234g. How many distinct pages reference a media item, split by what
3
+ * destroying the item would actually break.
4
+ *
5
+ * "Page" is the unit, not "row": a version is immutable, so one page can
6
+ * carry many versions that each mention the same picture, and that is
7
+ * still one page. `live` is a page whose currently served version (for
8
+ * some culture) mentions the item, or whose latest version does; the
9
+ * second half is there because a culture pointer names the PUBLISHED
10
+ * version, so a picture added in an unpublished draft is on the newest
11
+ * version there is. `history` is a page that mentions it only in a version
12
+ * that is neither served nor latest, so only a rollback would surface it
13
+ * again; `trashed` is a page in the trash, which wins over the other two
14
+ * regardless of what its cultures point at.
15
+ */
16
+ export interface ReferenceCounts {
17
+ /**
18
+ * Distinct pages whose served version or latest version references this
19
+ * item, drafts included.
20
+ */
21
+ live: number;
22
+ /**
23
+ * Distinct pages referencing it only in a version that is neither served
24
+ * nor the latest.
25
+ */
26
+ history: number;
27
+ /** Distinct pages referencing it that are themselves in the trash. */
28
+ trashed: number;
29
+ }
30
+ /**
31
+ * S234g. One page's use of a media item, in one field and culture slot.
32
+ *
33
+ * A page can hold more than one of these for the same media item, one per
34
+ * field (and per culture, for a translated field), which is why this is a
35
+ * row rather than a rollup: `ReferenceCounts` answers "how many pages,"
36
+ * this answers "which pages, and where in each."
37
+ */
38
+ export interface MediaReferenceUse {
39
+ contentId: string;
40
+ path: string;
41
+ culture: string;
42
+ fieldId: string;
43
+ /** The highest version that references this item in this slot. */
44
+ version: number;
45
+ state: "live" | "history" | "trashed";
46
+ }
47
+ /**
48
+ * The cursor for a media reference listing.
49
+ *
50
+ * Opaque on purpose, and NOT a content id. The list is ordered by
51
+ * (contentId, fieldId, culture) and one page can contribute several rows,
52
+ * so a cursor naming only the page would skip that page's remaining rows
53
+ * entirely: with three referencing fields and a page size of two, the
54
+ * third became unreachable. It is encoded here and decoded by the
55
+ * adapter, and nothing else should parse it.
56
+ *
57
+ * base64url rather than a delimiter, because a field id is not always a
58
+ * declared field: the extraction also records raw keys from a version's
59
+ * data, which are constrained by nothing and could contain any separator
60
+ * character chosen.
61
+ */
62
+ export declare function mediaReferenceCursor(use: Pick<MediaReferenceUse, "contentId" | "fieldId" | "culture"> | undefined): string | null;
63
+ /**
64
+ * Decodes a cursor produced by `mediaReferenceCursor`.
65
+ *
66
+ * Returns null rather than throwing for anything malformed: this cursor
67
+ * round-trips through a query string, so a person can type nonsense into
68
+ * it, and that has to fall back to a first page (or a 400 from the route
69
+ * that calls this), never a 500 from an uncaught parse error here.
70
+ */
71
+ export declare function decodeMediaReferenceCursor(cursor: string): {
72
+ contentId: string;
73
+ fieldId: string;
74
+ culture: string;
75
+ } | null;
@@ -0,0 +1,117 @@
1
+ // No btoa/atob/TextEncoder here on purpose: this package has no "dom" lib
2
+ // and no @types/node dependency, because it is imported from both the
3
+ // server and the browser admin UI. The alphabet, the UTF-8 packing and the
4
+ // bit-buffer base64 below are all plain ES2022 so both runtimes get the
5
+ // same bytes.
6
+ const BASE64URL_ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
7
+ /**
8
+ * UTF-8 bytes of `str`, using encodeURIComponent to do the actual UTF-8
9
+ * packing (the JS engine's own, not a hand-rolled surrogate-pair walk) and
10
+ * unpacking its %XX escapes into byte values.
11
+ */
12
+ function utf8Bytes(str) {
13
+ const escaped = encodeURIComponent(str);
14
+ const bytes = [];
15
+ for (let i = 0; i < escaped.length; i += 1) {
16
+ const char = escaped[i];
17
+ if (char === "%") {
18
+ bytes.push(parseInt(escaped.slice(i + 1, i + 3), 16));
19
+ i += 2;
20
+ }
21
+ else {
22
+ bytes.push(char.charCodeAt(0));
23
+ }
24
+ }
25
+ return bytes;
26
+ }
27
+ function utf8String(bytes) {
28
+ let escaped = "";
29
+ for (const byte of bytes)
30
+ escaped += `%${byte.toString(16).padStart(2, "0")}`;
31
+ return decodeURIComponent(escaped);
32
+ }
33
+ function base64UrlEncode(bytes) {
34
+ let result = "";
35
+ let bitBuffer = 0;
36
+ let bitCount = 0;
37
+ for (const byte of bytes) {
38
+ bitBuffer = (bitBuffer << 8) | byte;
39
+ bitCount += 8;
40
+ while (bitCount >= 6) {
41
+ bitCount -= 6;
42
+ result += BASE64URL_ALPHABET[(bitBuffer >> bitCount) & 0x3f];
43
+ }
44
+ bitBuffer &= (1 << bitCount) - 1;
45
+ }
46
+ if (bitCount > 0)
47
+ result += BASE64URL_ALPHABET[(bitBuffer << (6 - bitCount)) & 0x3f];
48
+ return result;
49
+ }
50
+ /** Returns null on any character outside the base64url alphabet. */
51
+ function base64UrlDecode(value) {
52
+ const bytes = [];
53
+ let bitBuffer = 0;
54
+ let bitCount = 0;
55
+ for (const char of value) {
56
+ const index = BASE64URL_ALPHABET.indexOf(char);
57
+ if (index === -1)
58
+ return null;
59
+ bitBuffer = (bitBuffer << 6) | index;
60
+ bitCount += 6;
61
+ if (bitCount >= 8) {
62
+ bitCount -= 8;
63
+ bytes.push((bitBuffer >> bitCount) & 0xff);
64
+ }
65
+ bitBuffer &= (1 << bitCount) - 1;
66
+ }
67
+ return bytes;
68
+ }
69
+ /**
70
+ * The cursor for a media reference listing.
71
+ *
72
+ * Opaque on purpose, and NOT a content id. The list is ordered by
73
+ * (contentId, fieldId, culture) and one page can contribute several rows,
74
+ * so a cursor naming only the page would skip that page's remaining rows
75
+ * entirely: with three referencing fields and a page size of two, the
76
+ * third became unreachable. It is encoded here and decoded by the
77
+ * adapter, and nothing else should parse it.
78
+ *
79
+ * base64url rather than a delimiter, because a field id is not always a
80
+ * declared field: the extraction also records raw keys from a version's
81
+ * data, which are constrained by nothing and could contain any separator
82
+ * character chosen.
83
+ */
84
+ export function mediaReferenceCursor(use) {
85
+ if (!use)
86
+ return null;
87
+ const json = JSON.stringify([use.contentId, use.fieldId, use.culture]);
88
+ return base64UrlEncode(utf8Bytes(json));
89
+ }
90
+ /**
91
+ * Decodes a cursor produced by `mediaReferenceCursor`.
92
+ *
93
+ * Returns null rather than throwing for anything malformed: this cursor
94
+ * round-trips through a query string, so a person can type nonsense into
95
+ * it, and that has to fall back to a first page (or a 400 from the route
96
+ * that calls this), never a 500 from an uncaught parse error here.
97
+ */
98
+ export function decodeMediaReferenceCursor(cursor) {
99
+ try {
100
+ const bytes = base64UrlDecode(cursor);
101
+ if (!bytes)
102
+ return null;
103
+ const json = utf8String(bytes);
104
+ const parsed = JSON.parse(json);
105
+ if (!Array.isArray(parsed) ||
106
+ parsed.length !== 3 ||
107
+ typeof parsed[0] !== "string" ||
108
+ typeof parsed[1] !== "string" ||
109
+ typeof parsed[2] !== "string") {
110
+ return null;
111
+ }
112
+ return { contentId: parsed[0], fieldId: parsed[1], culture: parsed[2] };
113
+ }
114
+ catch {
115
+ return null;
116
+ }
117
+ }
@@ -0,0 +1,27 @@
1
+ /**
2
+ * S234f. Which media items a content version mentions.
3
+ *
4
+ * ONE function rather than three scattered rules, because the rules have
5
+ * to agree: a picture inserted through the picker AND pasted as a URL in
6
+ * the same field is one reference, not two, and only a single place that
7
+ * knows all three rules can say so.
8
+ *
9
+ * Content is immutable, so what this returns for a version is true of
10
+ * that version forever. That is what lets the answer be stored once at
11
+ * write time instead of searched for on every question.
12
+ */
13
+ export interface MediaReference {
14
+ mediaId: string;
15
+ /** The key in the version's data. Not always a declared field: a pasted
16
+ * URL in `_name` is still a reference, and names itself. */
17
+ fieldId: string;
18
+ /** "" means invariant, shared by every language. Never null: all three
19
+ * Tier 1 dialects treat NULLs as distinct in a unique index, so a
20
+ * nullable culture would let duplicate rows through on every one of
21
+ * them. */
22
+ culture: string;
23
+ }
24
+ export declare function mediaReferencesIn(fields: ReadonlyArray<{
25
+ id: string;
26
+ editorId: string;
27
+ }>, data: Record<string, unknown>, cultureData: Record<string, Record<string, unknown>> | null | undefined): MediaReference[];
@@ -0,0 +1,279 @@
1
+ /** The editor whose stored value IS a media id, on its own, with nothing
2
+ * around it. The only one today. A third-party data type holding a media
3
+ * id is not found, which is a known gap with its fix named in the spec:
4
+ * a data type should be able to declare that its value holds media. */
5
+ const IMAGE_EDITOR_ID = "com.kardalum.image";
6
+ /** A media id is a uuid. Matched case-insensitively because a pasted URL
7
+ * may carry either case, and lowercased on the way out so one picture has
8
+ * one spelling in the table. */
9
+ const UUID = "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}";
10
+ const BARE_UUID = new RegExp(`^${UUID}$`, "i");
11
+ /** `/media/<id>/` anywhere in a string. The trailing slash is required so
12
+ * this matches a real media path rather than the word "media" followed by
13
+ * something uuid-shaped. Global, because one string can carry several. */
14
+ const MEDIA_URL = new RegExp(`/media/(${UUID})/`, "gi");
15
+ /** How deep the walk goes before it gives up. A TipTap document nests a
16
+ * few levels; anything approaching this is malformed or hostile, and
17
+ * stopping is better than recursing forever. The `seen` set below already
18
+ * stops a cycle, so this is the second of two belts. */
19
+ const MAX_DEPTH = 64;
20
+ export function mediaReferencesIn(fields, data, cultureData) {
21
+ // Built key-by-index rather than via `fields.map`: `fields` is itself a
22
+ // caller-supplied array, and `.map` would read `.length`, each index and
23
+ // then `.id`/`.editorId` off whatever came back, any of which can be a
24
+ // throwing accessor on a hostile or malformed document type definition.
25
+ // One field that refuses to be read costs only that field's entry, not
26
+ // the whole lookup.
27
+ const editorById = new Map();
28
+ {
29
+ let fieldCount;
30
+ try {
31
+ fieldCount = fields.length;
32
+ }
33
+ catch {
34
+ fieldCount = 0;
35
+ }
36
+ for (let i = 0; i < fieldCount; i++) {
37
+ let field;
38
+ try {
39
+ field = fields[i];
40
+ }
41
+ catch {
42
+ continue;
43
+ }
44
+ if (!field || typeof field !== "object")
45
+ continue;
46
+ try {
47
+ const { id, editorId } = field;
48
+ if (typeof id === "string" && typeof editorId === "string")
49
+ editorById.set(id, editorId);
50
+ }
51
+ catch {
52
+ // A field descriptor whose id or editorId refuses to be read
53
+ // tells us nothing. Carry on to the next one.
54
+ }
55
+ }
56
+ }
57
+ // Keyed on the three columns that make a row unique, so the caller
58
+ // never has to deduplicate and the unique index never has to refuse.
59
+ const found = new Map();
60
+ const scanSlice = (slice, culture) => {
61
+ // Enumerate keys with `Object.keys`, not `Object.entries`: `entries`
62
+ // invokes every getter in one pass to build its `[key, value]` pairs,
63
+ // so a single hostile top-level field would throw before the loop
64
+ // ever starts and take every sibling field down with it. Keys alone
65
+ // do not invoke getters; each value is then read on its own below.
66
+ let fieldIds;
67
+ try {
68
+ fieldIds = Object.keys(slice);
69
+ }
70
+ catch {
71
+ return;
72
+ }
73
+ for (const fieldId of fieldIds) {
74
+ let value;
75
+ try {
76
+ value = slice[fieldId];
77
+ }
78
+ catch {
79
+ continue;
80
+ }
81
+ const add = (mediaId) => {
82
+ const id = mediaId.toLowerCase();
83
+ // Joined on NUL, which cannot appear in a culture, a field id or a
84
+ // uuid. A space could: fieldId is whatever key the data carries,
85
+ // including ones the document type never declared and never
86
+ // validated, so two different triples could otherwise collide and
87
+ // one reference would quietly overwrite the other.
88
+ found.set(`${culture}\u0000${fieldId}\u0000${id}`, { mediaId: id, fieldId, culture });
89
+ };
90
+ // Rule 1: an image field's value is a media id, bare.
91
+ if (editorById.get(fieldId) === IMAGE_EDITOR_ID && typeof value === "string" && BARE_UUID.test(value)) {
92
+ add(value);
93
+ }
94
+ // Rules 2 and 3 apply to every field, whatever its editor, because
95
+ // a URL can be pasted anywhere and a rich text tree can live under
96
+ // a data type this function has never heard of.
97
+ walk(value, 0, new Set(), add);
98
+ }
99
+ };
100
+ scanSlice(data ?? {}, "");
101
+ // Same reasoning as `scanSlice`'s own loop: `Object.keys`, not
102
+ // `Object.entries`, so a throwing getter on one culture key costs only
103
+ // that culture, not every culture after it.
104
+ const cultures = cultureData ?? {};
105
+ let cultureKeys;
106
+ try {
107
+ cultureKeys = Object.keys(cultures);
108
+ }
109
+ catch {
110
+ cultureKeys = [];
111
+ }
112
+ for (const culture of cultureKeys) {
113
+ let slice;
114
+ try {
115
+ slice = cultures[culture];
116
+ }
117
+ catch {
118
+ continue;
119
+ }
120
+ if (slice && typeof slice === "object")
121
+ scanSlice(slice, culture);
122
+ }
123
+ return [...found.values()];
124
+ }
125
+ /**
126
+ * Rules 2 and 3, over any value at all.
127
+ *
128
+ * Deliberately total: it inspects whatever it is handed and never throws.
129
+ * A malformed rich text document, a number where an object was expected,
130
+ * a structure that points at itself: all of them return what was found so
131
+ * far. A person's content save must never fail because an index could not
132
+ * be built, and this function is the only thing standing between a
133
+ * surprising value and that failure.
134
+ */
135
+ function walk(value, depth, seen, add) {
136
+ if (depth > MAX_DEPTH || value === null || value === undefined)
137
+ return;
138
+ if (typeof value === "string") {
139
+ // Rule 3: a media URL pasted anywhere in a string.
140
+ for (const match of value.matchAll(MEDIA_URL)) {
141
+ if (match[1])
142
+ add(match[1]);
143
+ }
144
+ return;
145
+ }
146
+ if (typeof value !== "object")
147
+ return;
148
+ // A structure that points at itself would otherwise recurse forever.
149
+ if (seen.has(value))
150
+ return;
151
+ seen.add(value);
152
+ // Array.isArray is the one cheap type check here that can throw: it
153
+ // unwraps a Proxy and refuses a revoked one before inspecting
154
+ // anything. typeof, the null checks and the seen set are all safe
155
+ // against the same value, which is why only this one is wrapped. A
156
+ // value that will not say whether it is an array is a value nothing
157
+ // can be read out of, so treating it as neither is right.
158
+ let isArray;
159
+ try {
160
+ isArray = Array.isArray(value);
161
+ }
162
+ catch {
163
+ return;
164
+ }
165
+ if (isArray) {
166
+ // Read by index rather than `for...of`: iteration protocol reads
167
+ // `.length` and then each index through an ordinary get, and a
168
+ // throwing accessor defined on one index (or a hostile `.length`)
169
+ // would otherwise abort the loop and lose every element after it, not
170
+ // just the one index that refuses to be read.
171
+ const arr = value;
172
+ let length;
173
+ try {
174
+ length = arr.length;
175
+ }
176
+ catch {
177
+ return;
178
+ }
179
+ for (let i = 0; i < length; i++) {
180
+ let item;
181
+ try {
182
+ item = arr[i];
183
+ }
184
+ catch {
185
+ continue;
186
+ }
187
+ walk(item, depth + 1, seen, add);
188
+ }
189
+ return;
190
+ }
191
+ const record = value;
192
+ // Rule 2: a rich text image node names its media item in `mediaId`.
193
+ // Read wherever it appears rather than only under `attrs`, because the
194
+ // block editor carries image params in its own shape and both are the
195
+ // same fact.
196
+ //
197
+ // Wrapped because this function's whole contract is that it cannot
198
+ // throw: it runs inside a person's content save. Reading a property is
199
+ // not ordinarily dangerous, but the value here is whatever a caller
200
+ // handed over, and a getter that throws would take the save down with
201
+ // it. What is lost by catching is one reference nobody could have read
202
+ // anyway.
203
+ try {
204
+ const mediaId = record.mediaId;
205
+ if (typeof mediaId === "string" && BARE_UUID.test(mediaId))
206
+ add(mediaId);
207
+ }
208
+ catch {
209
+ // A property that refuses to be read tells us nothing. Carry on.
210
+ }
211
+ // Rule 4 (whole-branch review, finding 2): a `kardalumBlock` node stores
212
+ // an image param's value as a bare media id in `attrs.params`, with no
213
+ // `mediaId` key anywhere near it (kardalum-block.ts's
214
+ // `params: Record<string, unknown>`; render-context.ts reads the same
215
+ // value back as "a raw media UUID"). Rule 2 above only ever looks at
216
+ // `record.mediaId`, so a block's own picture went unfound by every rule:
217
+ // the field rule sees a rich text object rather than a string, the
218
+ // rich text rule reads only `mediaId`, and the url rule needs a
219
+ // `/media/<id>/` path, which a bare param value never has. A picture
220
+ // used only as a block image would report that nothing uses it, on the
221
+ // dialog about to destroy it.
222
+ //
223
+ // Deliberately over-matches: the partial's declared param types are not
224
+ // available where extraction runs, so a param holding some other uuid
225
+ // (not a media id at all) writes a row that names no media item. That
226
+ // is harmless for the same reason `media_id` carries no foreign key: a
227
+ // reference to something that does not exist is resolved away at read
228
+ // time. A missed reference is not recoverable at read time, which is
229
+ // why the trade runs this way.
230
+ let blockParams;
231
+ try {
232
+ blockParams = record.type === "kardalumBlock" ? record.attrs?.params : undefined;
233
+ }
234
+ catch {
235
+ blockParams = undefined;
236
+ }
237
+ if (blockParams && typeof blockParams === "object") {
238
+ const paramRecord = blockParams;
239
+ let paramKeys;
240
+ try {
241
+ paramKeys = Object.keys(paramRecord);
242
+ }
243
+ catch {
244
+ paramKeys = [];
245
+ }
246
+ for (const paramKey of paramKeys) {
247
+ let paramValue;
248
+ try {
249
+ paramValue = paramRecord[paramKey];
250
+ }
251
+ catch {
252
+ continue;
253
+ }
254
+ if (typeof paramValue === "string" && BARE_UUID.test(paramValue))
255
+ add(paramValue);
256
+ }
257
+ }
258
+ // Read key-by-key, not via `Object.values`: that reads every enumerable
259
+ // property in one pass, so a single hostile getter anywhere in the
260
+ // object would abort the whole read and lose every sibling along with
261
+ // it, not just the one property that refuses to be read.
262
+ let keys;
263
+ try {
264
+ keys = Object.keys(record);
265
+ }
266
+ catch {
267
+ return;
268
+ }
269
+ for (const key of keys) {
270
+ let item;
271
+ try {
272
+ item = record[key];
273
+ }
274
+ catch {
275
+ continue;
276
+ }
277
+ walk(item, depth + 1, seen, add);
278
+ }
279
+ }
@@ -0,0 +1,74 @@
1
+ import { z } from "zod";
2
+ export declare const CROP_EDITOR_ID = "com.kardalum.crop";
3
+ export declare const THUMBNAIL_EDITOR_ID = "com.kardalum.thumbnail";
4
+ export declare const CROP_DATA_TYPE_ID = "b1e00000-0000-4000-8000-000000000012";
5
+ export declare const THUMBNAIL_DATA_TYPE_ID = "b1e00000-0000-4000-8000-000000000013";
6
+ export declare const CropRectSchema: z.ZodObject<{
7
+ x: z.ZodNumber;
8
+ y: z.ZodNumber;
9
+ w: z.ZodNumber;
10
+ h: z.ZodNumber;
11
+ }, z.core.$strip>;
12
+ export type CropRect = z.infer<typeof CropRectSchema>;
13
+ export declare const CropSettingsSchema: z.ZodObject<{
14
+ ratio: z.ZodString;
15
+ maxWidth: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
16
+ }, z.core.$strict>;
17
+ export type CropSettings = z.infer<typeof CropSettingsSchema>;
18
+ export declare const ThumbnailSettingsSchema: z.ZodObject<{
19
+ longestEdge: z.ZodNumber;
20
+ }, z.core.$strict>;
21
+ export type ThumbnailSettings = z.infer<typeof ThumbnailSettingsSchema>;
22
+ export declare const MediaRenditionSchema: z.ZodObject<{
23
+ id: z.ZodString;
24
+ mediaVersionId: z.ZodString;
25
+ name: z.ZodString;
26
+ filename: z.ZodString;
27
+ mimeType: z.ZodString;
28
+ size: z.ZodNumber;
29
+ width: z.ZodNumber;
30
+ height: z.ZodNumber;
31
+ rect: z.ZodObject<{
32
+ x: z.ZodNumber;
33
+ y: z.ZodNumber;
34
+ w: z.ZodNumber;
35
+ h: z.ZodNumber;
36
+ }, z.core.$strip>;
37
+ createdAt: z.ZodString;
38
+ }, z.core.$strip>;
39
+ export type MediaRendition = z.infer<typeof MediaRenditionSchema>;
40
+ export declare function renditionName(dataType: {
41
+ editorId: typeof CROP_EDITOR_ID;
42
+ settings: CropSettings;
43
+ } | {
44
+ editorId: typeof THUMBNAIL_EDITOR_ID;
45
+ settings: ThumbnailSettings;
46
+ }): string;
47
+ /**
48
+ * `renditionName` read backwards, `"3x4"` -> `"3:4"`, for every surface
49
+ * that shows a name to a PERSON.
50
+ *
51
+ * A crop's name is its ratio with the colon replaced, because a filename
52
+ * cannot carry a colon. That makes the name INVERTIBLE: the shape comes
53
+ * back out of it with no lookup, nothing to go stale and nothing to
54
+ * guess. Everything that talks to the server keeps sending the name.
55
+ *
56
+ * Everything else comes back unchanged, `"thumb"` included: a thumbnail's
57
+ * name encodes no ratio, and a name this rule does not recognise (a
58
+ * plugin's own, a hand-authored one) is a name nothing here is entitled
59
+ * to rewrite.
60
+ *
61
+ * WHAT IT DOES NOT RECOVER is the crop field's own caption, "Portrait".
62
+ * That caption lives on a field of a MEDIA document type, while an image
63
+ * field's settings store a name and only a name (ImageSettingsSchema
64
+ * below), so a surface holding just the name says the shape, which is
65
+ * true, rather than a caption it would have to invent.
66
+ */
67
+ export declare function renditionShape(name: string): string;
68
+ export declare function renditionFilename(sourceFilename: string, name: string): string;
69
+ export declare const ImageSettingsSchema: z.ZodObject<{
70
+ acceptedTypes: z.ZodOptional<z.ZodArray<z.ZodString>>;
71
+ maxSizeBytes: z.ZodOptional<z.ZodNumber>;
72
+ rendition: z.ZodDefault<z.ZodNullable<z.ZodString>>;
73
+ }, z.core.$strict>;
74
+ export type ImageSettings = z.infer<typeof ImageSettingsSchema>;