@kardalum/plugin-sdk 0.0.0-stage → 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 (332) hide show
  1. package/CHANGELOG.md +118 -0
  2. package/LICENSE +202 -0
  3. package/README.md +80 -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 +29 -0
  15. package/dist/capabilities.js +67 -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 +94 -0
  40. package/dist/license-verdict-keys.d.ts +18 -0
  41. package/dist/license-verdict-keys.js +26 -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 +476 -0
  47. package/dist/manifest-schema.js +823 -0
  48. package/dist/manifest.d.ts +611 -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 +447 -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 +82 -0
  55. package/dist/plugin-context.js +77 -0
  56. package/dist/plugin-screen-context.d.ts +71 -0
  57. package/dist/plugin-screen-context.js +41 -0
  58. package/dist/read-all-pages.d.ts +23 -0
  59. package/dist/read-all-pages.js +30 -0
  60. package/dist/register-built-ins.d.ts +1 -0
  61. package/dist/register-built-ins.js +41 -0
  62. package/dist/registry.d.ts +4 -0
  63. package/dist/registry.js +17 -0
  64. package/dist/rendition-eligibility.d.ts +24 -0
  65. package/dist/rendition-eligibility.js +40 -0
  66. package/dist/richtext/block-panel.d.ts +27 -0
  67. package/dist/richtext/block-panel.js +232 -0
  68. package/dist/richtext/extensions.d.ts +19 -0
  69. package/dist/richtext/extensions.js +56 -0
  70. package/dist/richtext/insert-menu.d.ts +24 -0
  71. package/dist/richtext/insert-menu.js +142 -0
  72. package/dist/richtext/kardalum-block.d.ts +33 -0
  73. package/dist/richtext/kardalum-block.js +282 -0
  74. package/dist/richtext/style-listbox.d.ts +10 -0
  75. package/dist/richtext/style-listbox.js +69 -0
  76. package/dist/richtext/text-style-class.d.ts +18 -0
  77. package/dist/richtext/text-style-class.js +36 -0
  78. package/dist/simple-storage-value-provider.d.ts +9 -0
  79. package/dist/simple-storage-value-provider.js +96 -0
  80. package/dist/structured-storage-types.d.ts +61 -0
  81. package/dist/structured-storage-types.js +11 -0
  82. package/dist/tailwind.d.ts +1 -0
  83. package/dist/tailwind.js +5 -0
  84. package/dist/tokens/system-dark.css +75 -0
  85. package/dist/tokens/tokens.css +239 -0
  86. package/dist/tokens/tokens.json +212 -0
  87. package/dist/tokens.d.ts +1 -0
  88. package/dist/tokens.js +11 -0
  89. package/dist/ui-entry.d.ts +5 -0
  90. package/dist/ui-entry.js +42 -0
  91. package/dist/views/content-list-preview.d.ts +1 -0
  92. package/dist/views/content-list-preview.js +14 -0
  93. package/dist/views/content-list-settings-view.d.ts +1 -0
  94. package/dist/views/content-list-settings-view.js +97 -0
  95. package/dist/views/content-list-view.d.ts +19 -0
  96. package/dist/views/content-list-view.js +248 -0
  97. package/dist/views/crop-view.d.ts +55 -0
  98. package/dist/views/crop-view.js +161 -0
  99. package/dist/views/date-range-view.d.ts +6 -0
  100. package/dist/views/date-range-view.js +55 -0
  101. package/dist/views/file-upload-view.d.ts +43 -0
  102. package/dist/views/file-upload-view.js +104 -0
  103. package/dist/views/html-code-editor.d.ts +10 -0
  104. package/dist/views/html-code-editor.js +101 -0
  105. package/dist/views/html-view.d.ts +3 -0
  106. package/dist/views/html-view.js +53 -0
  107. package/dist/views/image-view.d.ts +3 -0
  108. package/dist/views/image-view.js +372 -0
  109. package/dist/views/rich-text-view.d.ts +2 -0
  110. package/dist/views/rich-text-view.js +429 -0
  111. package/node_modules/@kardalum/api-schemas/LICENSE +202 -0
  112. package/node_modules/@kardalum/api-schemas/README.md +56 -0
  113. package/node_modules/@kardalum/api-schemas/dist/action.schema.d.ts +30 -0
  114. package/node_modules/@kardalum/api-schemas/dist/action.schema.js +88 -0
  115. package/node_modules/@kardalum/api-schemas/dist/api-error.schema.d.ts +17 -0
  116. package/node_modules/@kardalum/api-schemas/dist/api-error.schema.js +25 -0
  117. package/node_modules/@kardalum/api-schemas/dist/api-key-api.schema.d.ts +93 -0
  118. package/node_modules/@kardalum/api-schemas/dist/api-key-api.schema.js +88 -0
  119. package/node_modules/@kardalum/api-schemas/dist/asset-api.schema.d.ts +89 -0
  120. package/node_modules/@kardalum/api-schemas/dist/asset-api.schema.js +60 -0
  121. package/node_modules/@kardalum/api-schemas/dist/asset.schema.d.ts +24 -0
  122. package/node_modules/@kardalum/api-schemas/dist/asset.schema.js +47 -0
  123. package/node_modules/@kardalum/api-schemas/dist/auth.schema.d.ts +38 -0
  124. package/node_modules/@kardalum/api-schemas/dist/auth.schema.js +38 -0
  125. package/node_modules/@kardalum/api-schemas/dist/content-api.schema.d.ts +542 -0
  126. package/node_modules/@kardalum/api-schemas/dist/content-api.schema.js +357 -0
  127. package/node_modules/@kardalum/api-schemas/dist/content-list.schema.d.ts +158 -0
  128. package/node_modules/@kardalum/api-schemas/dist/content-list.schema.js +139 -0
  129. package/node_modules/@kardalum/api-schemas/dist/content-path.d.ts +125 -0
  130. package/node_modules/@kardalum/api-schemas/dist/content-path.js +260 -0
  131. package/node_modules/@kardalum/api-schemas/dist/content-trash-api.schema.d.ts +20 -0
  132. package/node_modules/@kardalum/api-schemas/dist/content-trash-api.schema.js +23 -0
  133. package/node_modules/@kardalum/api-schemas/dist/content-trash.schema.d.ts +152 -0
  134. package/node_modules/@kardalum/api-schemas/dist/content-trash.schema.js +82 -0
  135. package/node_modules/@kardalum/api-schemas/dist/content-version.schema.d.ts +18 -0
  136. package/node_modules/@kardalum/api-schemas/dist/content-version.schema.js +22 -0
  137. package/node_modules/@kardalum/api-schemas/dist/content.schema.d.ts +17 -0
  138. package/node_modules/@kardalum/api-schemas/dist/content.schema.js +20 -0
  139. package/node_modules/@kardalum/api-schemas/dist/core-actions.d.ts +352 -0
  140. package/node_modules/@kardalum/api-schemas/dist/core-actions.js +133 -0
  141. package/node_modules/@kardalum/api-schemas/dist/culture-direction.d.ts +1 -0
  142. package/node_modules/@kardalum/api-schemas/dist/culture-direction.js +9 -0
  143. package/node_modules/@kardalum/api-schemas/dist/data-type-api.schema.d.ts +37 -0
  144. package/node_modules/@kardalum/api-schemas/dist/data-type-api.schema.js +32 -0
  145. package/node_modules/@kardalum/api-schemas/dist/data-type-config.schema.d.ts +9 -0
  146. package/node_modules/@kardalum/api-schemas/dist/data-type-config.schema.js +32 -0
  147. package/node_modules/@kardalum/api-schemas/dist/document-type-api.schema.d.ts +298 -0
  148. package/node_modules/@kardalum/api-schemas/dist/document-type-api.schema.js +138 -0
  149. package/node_modules/@kardalum/api-schemas/dist/document-type.schema.d.ts +121 -0
  150. package/node_modules/@kardalum/api-schemas/dist/document-type.schema.js +147 -0
  151. package/node_modules/@kardalum/api-schemas/dist/health.schema.d.ts +6 -0
  152. package/node_modules/@kardalum/api-schemas/dist/health.schema.js +5 -0
  153. package/node_modules/@kardalum/api-schemas/dist/html-entities.d.ts +4 -0
  154. package/node_modules/@kardalum/api-schemas/dist/html-entities.js +250 -0
  155. package/node_modules/@kardalum/api-schemas/dist/index.d.ts +113 -0
  156. package/node_modules/@kardalum/api-schemas/dist/index.js +64 -0
  157. package/node_modules/@kardalum/api-schemas/dist/licensing.schema.d.ts +15 -0
  158. package/node_modules/@kardalum/api-schemas/dist/licensing.schema.js +14 -0
  159. package/node_modules/@kardalum/api-schemas/dist/management-multipart.schema.d.ts +73 -0
  160. package/node_modules/@kardalum/api-schemas/dist/management-multipart.schema.js +104 -0
  161. package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.d.ts +682 -0
  162. package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.js +269 -0
  163. package/node_modules/@kardalum/api-schemas/dist/media-api.schema.d.ts +177 -0
  164. package/node_modules/@kardalum/api-schemas/dist/media-api.schema.js +222 -0
  165. package/node_modules/@kardalum/api-schemas/dist/media-reference-api.schema.d.ts +77 -0
  166. package/node_modules/@kardalum/api-schemas/dist/media-reference-api.schema.js +53 -0
  167. package/node_modules/@kardalum/api-schemas/dist/media-reference-use.d.ts +75 -0
  168. package/node_modules/@kardalum/api-schemas/dist/media-reference-use.js +117 -0
  169. package/node_modules/@kardalum/api-schemas/dist/media-reference.d.ts +27 -0
  170. package/node_modules/@kardalum/api-schemas/dist/media-reference.js +279 -0
  171. package/node_modules/@kardalum/api-schemas/dist/media-rendition.schema.d.ts +74 -0
  172. package/node_modules/@kardalum/api-schemas/dist/media-rendition.schema.js +157 -0
  173. package/node_modules/@kardalum/api-schemas/dist/media.schema.d.ts +80 -0
  174. package/node_modules/@kardalum/api-schemas/dist/media.schema.js +156 -0
  175. package/node_modules/@kardalum/api-schemas/dist/nav.schema.d.ts +23 -0
  176. package/node_modules/@kardalum/api-schemas/dist/nav.schema.js +55 -0
  177. package/node_modules/@kardalum/api-schemas/dist/node-access.schema.d.ts +846 -0
  178. package/node_modules/@kardalum/api-schemas/dist/node-access.schema.js +356 -0
  179. package/node_modules/@kardalum/api-schemas/dist/plugin-actions.schema.d.ts +20 -0
  180. package/node_modules/@kardalum/api-schemas/dist/plugin-actions.schema.js +27 -0
  181. package/node_modules/@kardalum/api-schemas/dist/plugin-docs-api.schema.d.ts +249 -0
  182. package/node_modules/@kardalum/api-schemas/dist/plugin-docs-api.schema.js +84 -0
  183. package/node_modules/@kardalum/api-schemas/dist/plugin-docs-text.d.ts +65 -0
  184. package/node_modules/@kardalum/api-schemas/dist/plugin-docs-text.js +889 -0
  185. package/node_modules/@kardalum/api-schemas/dist/plugin-docs.d.ts +172 -0
  186. package/node_modules/@kardalum/api-schemas/dist/plugin-docs.js +196 -0
  187. package/node_modules/@kardalum/api-schemas/dist/plugin-id-rules.d.ts +31 -0
  188. package/node_modules/@kardalum/api-schemas/dist/plugin-id-rules.js +38 -0
  189. package/node_modules/@kardalum/api-schemas/dist/plugin-install-record.schema.d.ts +69 -0
  190. package/node_modules/@kardalum/api-schemas/dist/plugin-install-record.schema.js +59 -0
  191. package/node_modules/@kardalum/api-schemas/dist/plugin-install.d.ts +585 -0
  192. package/node_modules/@kardalum/api-schemas/dist/plugin-install.js +536 -0
  193. package/node_modules/@kardalum/api-schemas/dist/plugin-locales.d.ts +75 -0
  194. package/node_modules/@kardalum/api-schemas/dist/plugin-locales.js +213 -0
  195. package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.d.ts +391 -0
  196. package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.js +413 -0
  197. package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-actions.d.ts +29 -0
  198. package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-actions.js +100 -0
  199. package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-api-routes.d.ts +44 -0
  200. package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-api-routes.js +162 -0
  201. package/node_modules/@kardalum/api-schemas/dist/plugin-registry-api.schema.d.ts +31 -0
  202. package/node_modules/@kardalum/api-schemas/dist/plugin-registry-api.schema.js +25 -0
  203. package/node_modules/@kardalum/api-schemas/dist/plugin-storage-api.schema.d.ts +15 -0
  204. package/node_modules/@kardalum/api-schemas/dist/plugin-storage-api.schema.js +24 -0
  205. package/node_modules/@kardalum/api-schemas/dist/public-api.schema.d.ts +314 -0
  206. package/node_modules/@kardalum/api-schemas/dist/public-api.schema.js +338 -0
  207. package/node_modules/@kardalum/api-schemas/dist/render-editing.d.ts +79 -0
  208. package/node_modules/@kardalum/api-schemas/dist/render-editing.js +50 -0
  209. package/node_modules/@kardalum/api-schemas/dist/render-settings-api.schema.d.ts +9 -0
  210. package/node_modules/@kardalum/api-schemas/dist/render-settings-api.schema.js +13 -0
  211. package/node_modules/@kardalum/api-schemas/dist/reserved-slugs.d.ts +2 -0
  212. package/node_modules/@kardalum/api-schemas/dist/reserved-slugs.js +16 -0
  213. package/node_modules/@kardalum/api-schemas/dist/role.schema.d.ts +96 -0
  214. package/node_modules/@kardalum/api-schemas/dist/role.schema.js +75 -0
  215. package/node_modules/@kardalum/api-schemas/dist/sample-content-outcome.schema.d.ts +17 -0
  216. package/node_modules/@kardalum/api-schemas/dist/sample-content-outcome.schema.js +27 -0
  217. package/node_modules/@kardalum/api-schemas/dist/sample-content.schema.d.ts +35 -0
  218. package/node_modules/@kardalum/api-schemas/dist/sample-content.schema.js +79 -0
  219. package/node_modules/@kardalum/api-schemas/dist/setup-api.schema.d.ts +138 -0
  220. package/node_modules/@kardalum/api-schemas/dist/setup-api.schema.js +105 -0
  221. package/node_modules/@kardalum/api-schemas/dist/sites.schema.d.ts +243 -0
  222. package/node_modules/@kardalum/api-schemas/dist/sites.schema.js +296 -0
  223. package/node_modules/@kardalum/api-schemas/dist/snapshot-api.schema.d.ts +47 -0
  224. package/node_modules/@kardalum/api-schemas/dist/snapshot-api.schema.js +27 -0
  225. package/node_modules/@kardalum/api-schemas/dist/snapshot.schema.d.ts +30 -0
  226. package/node_modules/@kardalum/api-schemas/dist/snapshot.schema.js +19 -0
  227. package/node_modules/@kardalum/api-schemas/dist/template-api.schema.d.ts +112 -0
  228. package/node_modules/@kardalum/api-schemas/dist/template-api.schema.js +74 -0
  229. package/node_modules/@kardalum/api-schemas/dist/template.schema.d.ts +41 -0
  230. package/node_modules/@kardalum/api-schemas/dist/template.schema.js +39 -0
  231. package/node_modules/@kardalum/api-schemas/dist/theme-api.schema.d.ts +21 -0
  232. package/node_modules/@kardalum/api-schemas/dist/theme-api.schema.js +14 -0
  233. package/node_modules/@kardalum/api-schemas/dist/user-api.schema.d.ts +97 -0
  234. package/node_modules/@kardalum/api-schemas/dist/user-api.schema.js +73 -0
  235. package/node_modules/@kardalum/api-schemas/package.json +35 -0
  236. package/node_modules/@kardalum/design-tokens/LICENSE +202 -0
  237. package/node_modules/@kardalum/design-tokens/README.md +29 -0
  238. package/node_modules/@kardalum/design-tokens/dist/build-css.d.ts +32 -0
  239. package/node_modules/@kardalum/design-tokens/dist/build-css.js +88 -0
  240. package/node_modules/@kardalum/design-tokens/dist/generate.d.ts +1 -0
  241. package/node_modules/@kardalum/design-tokens/dist/generate.js +18 -0
  242. package/node_modules/@kardalum/design-tokens/dist/index.d.ts +6 -0
  243. package/node_modules/@kardalum/design-tokens/dist/index.js +4 -0
  244. package/node_modules/@kardalum/design-tokens/dist/system-dark.css +75 -0
  245. package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.d.ts +33 -0
  246. package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.js +54 -0
  247. package/node_modules/@kardalum/design-tokens/dist/theme-css.d.ts +12 -0
  248. package/node_modules/@kardalum/design-tokens/dist/theme-css.js +42 -0
  249. package/node_modules/@kardalum/design-tokens/dist/theme-types.d.ts +43 -0
  250. package/node_modules/@kardalum/design-tokens/dist/theme-types.js +1 -0
  251. package/node_modules/@kardalum/design-tokens/dist/themes/dark.d.ts +13 -0
  252. package/node_modules/@kardalum/design-tokens/dist/themes/dark.js +120 -0
  253. package/node_modules/@kardalum/design-tokens/dist/themes/index.d.ts +5 -0
  254. package/node_modules/@kardalum/design-tokens/dist/themes/index.js +4 -0
  255. package/node_modules/@kardalum/design-tokens/dist/themes/light.d.ts +9 -0
  256. package/node_modules/@kardalum/design-tokens/dist/themes/light.js +13 -0
  257. package/node_modules/@kardalum/design-tokens/dist/tokens.css +239 -0
  258. package/node_modules/@kardalum/design-tokens/dist/tokens.d.ts +25 -0
  259. package/node_modules/@kardalum/design-tokens/dist/tokens.js +276 -0
  260. package/node_modules/@kardalum/design-tokens/dist/tokens.json +212 -0
  261. package/node_modules/@kardalum/design-tokens/dist/types.d.ts +91 -0
  262. package/node_modules/@kardalum/design-tokens/dist/types.js +5 -0
  263. package/node_modules/@kardalum/design-tokens/package.json +42 -0
  264. package/node_modules/@kardalum/plugin-package/LICENSE +202 -0
  265. package/node_modules/@kardalum/plugin-package/README.md +71 -0
  266. package/node_modules/@kardalum/plugin-package/dist/build-reference.d.ts +111 -0
  267. package/node_modules/@kardalum/plugin-package/dist/build-reference.js +61 -0
  268. package/node_modules/@kardalum/plugin-package/dist/capabilities.d.ts +103 -0
  269. package/node_modules/@kardalum/plugin-package/dist/capabilities.js +351 -0
  270. package/node_modules/@kardalum/plugin-package/dist/docs-contract.d.ts +50 -0
  271. package/node_modules/@kardalum/plugin-package/dist/docs-contract.js +659 -0
  272. package/node_modules/@kardalum/plugin-package/dist/envelope.d.ts +19 -0
  273. package/node_modules/@kardalum/plugin-package/dist/envelope.js +104 -0
  274. package/node_modules/@kardalum/plugin-package/dist/extract.d.ts +37 -0
  275. package/node_modules/@kardalum/plugin-package/dist/extract.js +199 -0
  276. package/node_modules/@kardalum/plugin-package/dist/hash.d.ts +17 -0
  277. package/node_modules/@kardalum/plugin-package/dist/hash.js +69 -0
  278. package/node_modules/@kardalum/plugin-package/dist/index.d.ts +13 -0
  279. package/node_modules/@kardalum/plugin-package/dist/index.js +8 -0
  280. package/node_modules/@kardalum/plugin-package/dist/license-verdict.d.ts +185 -0
  281. package/node_modules/@kardalum/plugin-package/dist/license-verdict.js +236 -0
  282. package/node_modules/@kardalum/plugin-package/dist/package-contract.d.ts +50 -0
  283. package/node_modules/@kardalum/plugin-package/dist/package-contract.js +115 -0
  284. package/node_modules/@kardalum/plugin-package/dist/reference-entry.d.ts +2 -0
  285. package/node_modules/@kardalum/plugin-package/dist/reference-entry.js +6 -0
  286. package/node_modules/@kardalum/plugin-package/dist/sample-content.d.ts +20 -0
  287. package/node_modules/@kardalum/plugin-package/dist/sample-content.js +57 -0
  288. package/node_modules/@kardalum/plugin-package/dist/types.d.ts +43 -0
  289. package/node_modules/@kardalum/plugin-package/dist/types.js +15 -0
  290. package/node_modules/@kardalum/plugin-package/package.json +54 -0
  291. package/node_modules/@kardalum/ui/LICENSE +202 -0
  292. package/node_modules/@kardalum/ui/README.md +35 -0
  293. package/node_modules/@kardalum/ui/dist/components/alert-dialog.d.ts +14 -0
  294. package/node_modules/@kardalum/ui/dist/components/alert-dialog.js +38 -0
  295. package/node_modules/@kardalum/ui/dist/components/badge.d.ts +9 -0
  296. package/node_modules/@kardalum/ui/dist/components/badge.js +30 -0
  297. package/node_modules/@kardalum/ui/dist/components/button.d.ts +11 -0
  298. package/node_modules/@kardalum/ui/dist/components/button.js +37 -0
  299. package/node_modules/@kardalum/ui/dist/components/checkbox.d.ts +5 -0
  300. package/node_modules/@kardalum/ui/dist/components/checkbox.js +7 -0
  301. package/node_modules/@kardalum/ui/dist/components/dialog.d.ts +17 -0
  302. package/node_modules/@kardalum/ui/dist/components/dialog.js +48 -0
  303. package/node_modules/@kardalum/ui/dist/components/dropdown-menu.d.ts +18 -0
  304. package/node_modules/@kardalum/ui/dist/components/dropdown-menu.js +53 -0
  305. package/node_modules/@kardalum/ui/dist/components/empty-state.d.ts +30 -0
  306. package/node_modules/@kardalum/ui/dist/components/empty-state.js +9 -0
  307. package/node_modules/@kardalum/ui/dist/components/input.d.ts +4 -0
  308. package/node_modules/@kardalum/ui/dist/components/input.js +6 -0
  309. package/node_modules/@kardalum/ui/dist/components/panel.d.ts +5 -0
  310. package/node_modules/@kardalum/ui/dist/components/panel.js +6 -0
  311. package/node_modules/@kardalum/ui/dist/components/property-field.d.ts +19 -0
  312. package/node_modules/@kardalum/ui/dist/components/property-field.js +89 -0
  313. package/node_modules/@kardalum/ui/dist/components/sheet.d.ts +17 -0
  314. package/node_modules/@kardalum/ui/dist/components/sheet.js +55 -0
  315. package/node_modules/@kardalum/ui/dist/components/skeleton.d.ts +3 -0
  316. package/node_modules/@kardalum/ui/dist/components/skeleton.js +9 -0
  317. package/node_modules/@kardalum/ui/dist/components/switch.d.ts +5 -0
  318. package/node_modules/@kardalum/ui/dist/components/switch.js +7 -0
  319. package/node_modules/@kardalum/ui/dist/components/tab-strip.d.ts +34 -0
  320. package/node_modules/@kardalum/ui/dist/components/tab-strip.js +72 -0
  321. package/node_modules/@kardalum/ui/dist/components/toast.d.ts +18 -0
  322. package/node_modules/@kardalum/ui/dist/components/toast.js +42 -0
  323. package/node_modules/@kardalum/ui/dist/components/toaster.d.ts +12 -0
  324. package/node_modules/@kardalum/ui/dist/components/toaster.js +11 -0
  325. package/node_modules/@kardalum/ui/dist/components/use-toast.d.ts +17 -0
  326. package/node_modules/@kardalum/ui/dist/components/use-toast.js +62 -0
  327. package/node_modules/@kardalum/ui/dist/index.d.ts +18 -0
  328. package/node_modules/@kardalum/ui/dist/index.js +18 -0
  329. package/node_modules/@kardalum/ui/dist/lib/cn.d.ts +2 -0
  330. package/node_modules/@kardalum/ui/dist/lib/cn.js +5 -0
  331. package/node_modules/@kardalum/ui/package.json +63 -0
  332. package/package.json +146 -4
@@ -0,0 +1,82 @@
1
+ import { type ReactNode } from "react";
2
+ interface PluginValueProviderProps {
3
+ value: unknown;
4
+ onChange: (value: unknown) => void;
5
+ children: ReactNode;
6
+ }
7
+ export declare function PluginValueProvider({ value, onChange, children }: PluginValueProviderProps): import("react").JSX.Element;
8
+ export declare function usePluginValue<T = unknown>(): {
9
+ value: T;
10
+ onChange: (value: T) => void;
11
+ };
12
+ interface PluginSettingsProviderProps {
13
+ settings: Record<string, unknown>;
14
+ onSettingsChange?: (settings: Record<string, unknown>) => void;
15
+ children: ReactNode;
16
+ }
17
+ export declare function PluginSettingsProvider({ settings, onSettingsChange, children }: PluginSettingsProviderProps): import("react").JSX.Element;
18
+ export declare function usePluginSettings<T extends Record<string, unknown> = Record<string, unknown>>(): T;
19
+ export declare function usePluginSettingsValue<T extends Record<string, unknown> = Record<string, unknown>>(): {
20
+ value: T;
21
+ onChange: (value: T) => void;
22
+ };
23
+ export type PluginFetch = (input: string, init?: RequestInit) => Promise<Response>;
24
+ /**
25
+ * The base of the management API (2026-10-17-s302-the-admin-moves-onto-the-management-api-design.md D1). The host's
26
+ * fetch is the admin's authFetch: it passes a path through unchanged and adds the session, so a view that calls one
27
+ * of the CMS's own families spells the path as `${MANAGE_API}/<family>/...`. A plugin's own routes stay under
28
+ * /api/plugins/:pluginId/.
29
+ */
30
+ export declare const MANAGE_API = "/api/manage/v1";
31
+ interface PluginApiProviderProps {
32
+ fetch: PluginFetch;
33
+ children: ReactNode;
34
+ }
35
+ export declare function PluginApiProvider({ fetch, children }: PluginApiProviderProps): import("react").JSX.Element;
36
+ export declare function usePluginApi(): PluginFetch;
37
+ /** A page document type, as far as a view needs to know it (S232). */
38
+ export interface ContentHostDocumentType {
39
+ id: string;
40
+ name: string;
41
+ fields: Array<{
42
+ id: string;
43
+ name: string;
44
+ }>;
45
+ }
46
+ /**
47
+ * The page a view is being rendered on, and the two navigations a view
48
+ * may ask the host to perform (S232). The Content List table is the first
49
+ * consumer: it lists the children of `nodeId` and hands the editor back to
50
+ * the host when a row is opened or a new child is wanted.
51
+ */
52
+ export interface ContentHostPage {
53
+ nodeId: string;
54
+ openContent(id: string): void;
55
+ createChild(parentId: string): void;
56
+ }
57
+ /**
58
+ * What a view learns about where it is being rendered (S232).
59
+ *
60
+ * `page` is the discriminant, and the two branches are the two real
61
+ * situations: there is a page open, in which case its id and both
62
+ * navigations are there together, or there is none at all and the host
63
+ * exists only to carry `documentTypes` (the Data Types editor hosts the
64
+ * Content List SETTINGS view that way, so its column picker can name real
65
+ * fields while no content is open). A view checks `page` once instead of
66
+ * an id and two callbacks separately, and no state can spell "a page with
67
+ * no way to open a row".
68
+ */
69
+ export type ContentHost = {
70
+ page: null;
71
+ documentTypes?: ContentHostDocumentType[];
72
+ } | {
73
+ page: ContentHostPage;
74
+ documentTypes?: ContentHostDocumentType[];
75
+ };
76
+ interface ContentHostProviderProps {
77
+ host: ContentHost;
78
+ children: ReactNode;
79
+ }
80
+ export declare function ContentHostProvider({ host, children }: ContentHostProviderProps): import("react").JSX.Element;
81
+ export declare function useContentHost(): ContentHost | null;
82
+ export {};
@@ -0,0 +1,77 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { createContext, useContext } from "react";
3
+ const PluginValueContext = createContext(null);
4
+ export function PluginValueProvider({ value, onChange, children }) {
5
+ return _jsx(PluginValueContext.Provider, { value: { value, onChange }, children: children });
6
+ }
7
+ // A view calling this outside a host-rendered PluginValueProvider is a
8
+ // real bug (the host forgot to wrap it) — throw loudly, don't hand back
9
+ // a silently-undefined value/no-op onChange.
10
+ export function usePluginValue() {
11
+ const ctx = useContext(PluginValueContext);
12
+ if (!ctx) {
13
+ throw new Error("usePluginValue must be called from a view rendered inside a PluginValueProvider");
14
+ }
15
+ return ctx;
16
+ }
17
+ const PluginSettingsContext = createContext(null);
18
+ export function PluginSettingsProvider({ settings, onSettingsChange, children }) {
19
+ return (_jsx(PluginSettingsContext.Provider, { value: { settings, onSettingsChange }, children: children }));
20
+ }
21
+ // Returns settings directly (not {settings, onChange}) — this is the
22
+ // READ-ONLY path used by input/readOnly/preview views (Session 69). For a
23
+ // settings-EDITING view (the "settings" DataTypePluginViews slot), use
24
+ // usePluginSettingsValue() below instead.
25
+ export function usePluginSettings() {
26
+ const ctx = useContext(PluginSettingsContext);
27
+ if (!ctx) {
28
+ throw new Error("usePluginSettings must be called from a view rendered inside a PluginSettingsProvider");
29
+ }
30
+ return ctx.settings;
31
+ }
32
+ // Mirrors usePluginValue()'s {value, onChange} shape, for settings-EDITING
33
+ // views only (Session 69) — the host (e.g. the Data Types editor) must
34
+ // supply onSettingsChange via PluginSettingsProvider, or this throws:
35
+ // a settings view rendered in a read-only context is a host bug, same
36
+ // "throw loudly" philosophy as usePluginValue().
37
+ export function usePluginSettingsValue() {
38
+ const ctx = useContext(PluginSettingsContext);
39
+ if (!ctx) {
40
+ throw new Error("usePluginSettingsValue must be called from a view rendered inside a PluginSettingsProvider");
41
+ }
42
+ if (!ctx.onSettingsChange) {
43
+ throw new Error("usePluginSettingsValue must be called from a settings view rendered inside a PluginSettingsProvider " +
44
+ "that supplies onSettingsChange (read-only contexts should use usePluginSettings() instead)");
45
+ }
46
+ return { value: ctx.settings, onChange: ctx.onSettingsChange };
47
+ }
48
+ /**
49
+ * The base of the management API (2026-10-17-s302-the-admin-moves-onto-the-management-api-design.md D1). The host's
50
+ * fetch is the admin's authFetch: it passes a path through unchanged and adds the session, so a view that calls one
51
+ * of the CMS's own families spells the path as `${MANAGE_API}/<family>/...`. A plugin's own routes stay under
52
+ * /api/plugins/:pluginId/.
53
+ */
54
+ export const MANAGE_API = "/api/manage/v1";
55
+ const PluginApiContext = createContext(null);
56
+ export function PluginApiProvider({ fetch, children }) {
57
+ return _jsx(PluginApiContext.Provider, { value: fetch, children: children });
58
+ }
59
+ export function usePluginApi() {
60
+ const ctx = useContext(PluginApiContext);
61
+ if (!ctx) {
62
+ throw new Error("usePluginApi must be called from a view rendered inside a PluginApiProvider");
63
+ }
64
+ return ctx;
65
+ }
66
+ const ContentHostContext = createContext(null);
67
+ export function ContentHostProvider({ host, children }) {
68
+ return _jsx(ContentHostContext.Provider, { value: host, children: children });
69
+ }
70
+ // Returns null instead of throwing, unlike usePluginValue/usePluginApi:
71
+ // a view legitimately renders where there is no page at all (the document
72
+ // type builder's field preview, the Data Types settings screen), and the
73
+ // view is expected to say so rather than crash. "No host" is a real state
74
+ // here, not a host wiring bug.
75
+ export function useContentHost() {
76
+ return useContext(ContentHostContext);
77
+ }
@@ -0,0 +1,71 @@
1
+ import { type ReactNode } from "react";
2
+ /**
3
+ * Translates one of the plugin's own strings (S290): a key from its
4
+ * locales/<language>.json, in the admin's language, falling back to the
5
+ * plugin's locales/en.json, then to the key itself. `{{name}}` in the text
6
+ * is replaced by `values.name`. The result is plain text: render it as a
7
+ * child. The host's own strings and other plugins' strings are never
8
+ * reachable through it.
9
+ */
10
+ export type PluginTranslate = (key: string, values?: Record<string, string | number>) => string;
11
+ /**
12
+ * Where a plugin screen is being rendered (S280, spec D7). Every slot kind
13
+ * hands its view this one context instead of props, so a view keeps taking
14
+ * no props (as the SDK's other views do) and a screen written for a
15
+ * top-level section reads it the same way a rail entry does.
16
+ *
17
+ * - `kind: "section"`: a plugin's own top-level section, its landing page.
18
+ * `sectionId` is the section's id, `entryId` is null.
19
+ * - `kind: "sectionRail"`: an entry in the rail of the plugin's own section.
20
+ * Both ids are set.
21
+ * - `kind: "rail"`: an entry the plugin adds to a built-in section's rail
22
+ * (content, media, settings, users). `sectionId` is null, because the
23
+ * section is not the plugin's; `entryId` is the entry's id.
24
+ */
25
+ export interface PluginScreenContext {
26
+ pluginId: string;
27
+ slot: {
28
+ kind: "section" | "sectionRail" | "rail";
29
+ sectionId: string | null;
30
+ entryId: string | null;
31
+ };
32
+ /** The admin's active language, for formatting dates and numbers. A
33
+ * screen's words come from `t`. */
34
+ locale: string;
35
+ /** The plugin's own strings in the admin's language (S290). */
36
+ t: PluginTranslate;
37
+ /**
38
+ * Navigates within the plugin's own section (kind section/sectionRail):
39
+ * pass the id of a rail entry that section declares, or null for the
40
+ * section's landing page. Anything else (a path such as `..`, another
41
+ * plugin's URL, an id the section's rail does not declare) does nothing,
42
+ * with a console warning in development. Always a no-op for a built-in
43
+ * rail entry, whose section is not the plugin's.
44
+ */
45
+ navigate: (entryId: string | null) => void;
46
+ }
47
+ /**
48
+ * Supplied by the host around any view that reads the plugin's own strings
49
+ * (S291): a plugin screen, where PluginScreenProvider renders it with the
50
+ * screen's `t`, and a data type's views, where the admin renders it with
51
+ * the owning plugin's translator. In a test, `(key) => key` prints the keys.
52
+ */
53
+ export declare function PluginTranslateProvider({ t, children }: {
54
+ t: PluginTranslate;
55
+ children: ReactNode;
56
+ }): import("react").JSX.Element;
57
+ /** Supplied by the host around a plugin screen's view. It also supplies
58
+ * usePluginTranslate() with the screen's own `t` (S291), so in a screen the
59
+ * two are one function. */
60
+ export declare function PluginScreenProvider({ value, children }: {
61
+ value: PluginScreenContext;
62
+ children: ReactNode;
63
+ }): import("react").JSX.Element;
64
+ export declare function usePluginScreen(): PluginScreenContext;
65
+ /**
66
+ * The plugin's own strings in the admin's language (S291), for a view with
67
+ * no usePluginScreen(): a data type's views (input, readOnly, settings,
68
+ * preview). Inside a plugin screen it returns the screen's own `t`. Outside
69
+ * a PluginTranslateProvider it is a host wiring bug, so it throws.
70
+ */
71
+ export declare function usePluginTranslate(): PluginTranslate;
@@ -0,0 +1,41 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { createContext, useContext } from "react";
3
+ const PluginScreenReactContext = createContext(null);
4
+ const PluginTranslateReactContext = createContext(null);
5
+ /**
6
+ * Supplied by the host around any view that reads the plugin's own strings
7
+ * (S291): a plugin screen, where PluginScreenProvider renders it with the
8
+ * screen's `t`, and a data type's views, where the admin renders it with
9
+ * the owning plugin's translator. In a test, `(key) => key` prints the keys.
10
+ */
11
+ export function PluginTranslateProvider({ t, children }) {
12
+ return _jsx(PluginTranslateReactContext.Provider, { value: t, children: children });
13
+ }
14
+ /** Supplied by the host around a plugin screen's view. It also supplies
15
+ * usePluginTranslate() with the screen's own `t` (S291), so in a screen the
16
+ * two are one function. */
17
+ export function PluginScreenProvider({ value, children }) {
18
+ return (_jsx(PluginScreenReactContext.Provider, { value: value, children: _jsx(PluginTranslateProvider, { t: value.t, children: children }) }));
19
+ }
20
+ // A screen calling this outside a host-rendered PluginScreenProvider is a
21
+ // host wiring bug, so it throws, the same as usePluginApi.
22
+ export function usePluginScreen() {
23
+ const ctx = useContext(PluginScreenReactContext);
24
+ if (!ctx) {
25
+ throw new Error("usePluginScreen must be called from a view rendered inside a PluginScreenProvider");
26
+ }
27
+ return ctx;
28
+ }
29
+ /**
30
+ * The plugin's own strings in the admin's language (S291), for a view with
31
+ * no usePluginScreen(): a data type's views (input, readOnly, settings,
32
+ * preview). Inside a plugin screen it returns the screen's own `t`. Outside
33
+ * a PluginTranslateProvider it is a host wiring bug, so it throws.
34
+ */
35
+ export function usePluginTranslate() {
36
+ const t = useContext(PluginTranslateReactContext);
37
+ if (!t) {
38
+ throw new Error("usePluginTranslate must be called from a view rendered inside a PluginTranslateProvider");
39
+ }
40
+ return t;
41
+ }
@@ -0,0 +1,23 @@
1
+ import type { PluginFetch } from "./plugin-context.js";
2
+ /** A paged listing read to its end, or as far as the cap let it. */
3
+ export interface ListingPages<T> {
4
+ items: T[];
5
+ /** false when the page cap stopped the read with a cursor still pending: `items` is then a subset of the listing. */
6
+ complete: boolean;
7
+ }
8
+ export interface ReadAllPagesOptions {
9
+ /** The key of the page's array: "items" for most listings, "folders" for the media folder list. */
10
+ itemKey?: string;
11
+ /** The page size asked of the server (default 100). */
12
+ limit?: number;
13
+ /** The most pages read before the read stops incomplete (default 20). */
14
+ cap?: number;
15
+ }
16
+ /**
17
+ * Every page of a cursor-paginated listing, up to the cap. The listings a view reads this way are small, admin-only
18
+ * and read once when it mounts. They answer `{ <itemKey>: [...], nextCursor }` over the same `{ cursor, limit }` query.
19
+ * This is the helper image-view.tsx held privately since S234d, generalised to the page's item key
20
+ * (2026-10-17-s302-the-admin-moves-onto-the-management-api-design.md 3.8) so the media picker's folder list and the
21
+ * image view's rendition list follow nextCursor too.
22
+ */
23
+ export declare function readAllPages<T>(fetchApi: PluginFetch, path: string, what: string, options?: ReadAllPagesOptions): Promise<ListingPages<T>>;
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Every page of a cursor-paginated listing, up to the cap. The listings a view reads this way are small, admin-only
3
+ * and read once when it mounts. They answer `{ <itemKey>: [...], nextCursor }` over the same `{ cursor, limit }` query.
4
+ * This is the helper image-view.tsx held privately since S234d, generalised to the page's item key
5
+ * (2026-10-17-s302-the-admin-moves-onto-the-management-api-design.md 3.8) so the media picker's folder list and the
6
+ * image view's rendition list follow nextCursor too.
7
+ */
8
+ export async function readAllPages(fetchApi, path, what, options = {}) {
9
+ const { itemKey = "items", limit = 100, cap = 20 } = options;
10
+ const all = [];
11
+ let cursor = null;
12
+ for (let page = 0; page < cap; page += 1) {
13
+ const params = new URLSearchParams();
14
+ params.set("limit", String(limit));
15
+ if (cursor)
16
+ params.set("cursor", cursor);
17
+ const response = await fetchApi(`${path}?${params.toString()}`);
18
+ if (!response.ok)
19
+ throw new Error(`Failed to load ${what} (${response.status})`);
20
+ const body = (await response.json());
21
+ const items = body[itemKey];
22
+ if (!Array.isArray(items))
23
+ throw new Error(`Failed to load ${what} (unexpected answer)`);
24
+ all.push(...items);
25
+ cursor = typeof body.nextCursor === "string" ? body.nextCursor : null;
26
+ if (cursor === null)
27
+ return { items: all, complete: true };
28
+ }
29
+ return { items: all, complete: false };
30
+ }
@@ -0,0 +1 @@
1
+ import "./built-ins.js";
@@ -0,0 +1,41 @@
1
+ // The `@kardalum/plugin-sdk/register-built-ins` subpath: runs the
2
+ // package's built-in datatype registration side effect (the six
3
+ // `registerDataType()` calls in `built-ins.tsx` — text/number/boolean/
4
+ // date/image/richtext/html) and nothing else.
5
+ //
6
+ // S197 final-review fix F5: this used to be the package INDEX's own
7
+ // trailing side effect (`import "./built-ins.js"`), which meant importing
8
+ // ANYTHING from the bare `@kardalum/plugin-sdk` specifier: a UI
9
+ // primitive, a provider, a type — incidentally triggered it too. That was
10
+ // harmless on its own, but it meant the package's main entry could never
11
+ // be lightweight: `built-ins.tsx` statically imports both
12
+ // rich-text-view.tsx (TipTap) and, since S197 Task 8's HTML datatype,
13
+ // html-view.tsx (whose CodeMirror/lezer code editor is `React.lazy()`-
14
+ // split in the ADMIN bundle, but still a real, non-optional dependency of
15
+ // the main entry either way).
16
+ //
17
+ // Every first-party plugin's Module Federation config shares
18
+ // `@kardalum/plugin-sdk` as a runtime singleton (see any
19
+ // `plugins/*/vite.config.ts`) — that `shared` entry resolves to the bare
20
+ // package specifier, i.e. the MAIN entry, regardless of which subpath a
21
+ // plugin's own view code actually imports from. Module Federation still
22
+ // bundles a fallback copy of that shared module into every remote's own
23
+ // artifact (for the case where a host doesn't already provide a
24
+ // compatible version), so as long as the main entry pulled in TipTap +
25
+ // CodeMirror, EVERY plugin's packaged artifact carried a multi-hundred-KB
26
+ // dead-weight fallback chunk that never actually loads at runtime (the
27
+ // admin host's own copy always satisfies the singleton first) — this is
28
+ // what pushed google-maps' packaged bundle size over the marketplace's
29
+ // 250KB budget the moment CodeMirror/lezer landed in plugin-sdk's
30
+ // dependency tree, not anything google-maps' own view code did.
31
+ //
32
+ // Splitting registration out here (main entry now side-effect-free) fixes
33
+ // that at the root for every plugin at once, not just the one that
34
+ // happened to trip a test. Exactly ONE real consumer needs this:
35
+ // apps/admin-ui's own bootstrap (main.tsx) and its vitest setup
36
+ // (vitest.setup.ts) — both import this once, for its side effect, the
37
+ // same "run once at startup" pattern initTheme()/the i18n import already
38
+ // use in main.tsx. A REMOTE plugin never needs this: its own views read
39
+ // datatypes through its OWN manifest object, never through this
40
+ // registry (that's an admin-app-only lookup, `resolve-data-type.ts`).
41
+ import "./built-ins.js";
@@ -0,0 +1,4 @@
1
+ import type { DataTypePlugin } from "./data-type-plugin.js";
2
+ export declare function registerDataType(plugin: DataTypePlugin): void;
3
+ export declare function getDataType(id: string): DataTypePlugin | undefined;
4
+ export declare function listDataTypes(): DataTypePlugin[];
@@ -0,0 +1,17 @@
1
+ // Static registry: built-ins register into this exact same map at module
2
+ // load (Core vs Plugin — built-ins are statically registered, dynamically
3
+ // loaded marketplace plugins are a second registration path into this same
4
+ // registry, not a different kind of plugin).
5
+ const dataTypes = new Map();
6
+ export function registerDataType(plugin) {
7
+ if (dataTypes.has(plugin.id)) {
8
+ throw new Error(`A datatype with id "${plugin.id}" is already registered`);
9
+ }
10
+ dataTypes.set(plugin.id, plugin);
11
+ }
12
+ export function getDataType(id) {
13
+ return dataTypes.get(id);
14
+ }
15
+ export function listDataTypes() {
16
+ return [...dataTypes.values()];
17
+ }
@@ -0,0 +1,24 @@
1
+ /** The source media types that never get a rendition (spec, decision 4).
2
+ *
3
+ * Both would be damaged by a canvas rather than cut by one: an SVG is
4
+ * vector artwork a raster cut throws away, and telling a static GIF from
5
+ * an animated one means parsing the file for extra frames, where a wrong
6
+ * guess silently flattens an animation with nothing to undo it. So no GIF
7
+ * is cut, not only an animated one.
8
+ *
9
+ * DECLARED ONCE, here. The tile that offers the Cut button, the browser
10
+ * cut behind it, and the server route that files the result all read this
11
+ * same set, so a format can never be refused by one and accepted by
12
+ * another.
13
+ */
14
+ export declare const RENDITION_INELIGIBLE_TYPES: ReadonlySet<string>;
15
+ /** Whether this source is one the set above refuses. An unknown source
16
+ * (null, before any file exists) is not ineligible: it is unknown, and the
17
+ * tile says nothing about a format it has not been told.
18
+ *
19
+ * The type is reduced to its base form first, because a stored media type
20
+ * is whatever the uploading client sent: `IMAGE/GIF` and
21
+ * `image/gif; charset=binary` are both `image/gif`. Every caller checks
22
+ * through this rather than against the set directly, so a spelling one of
23
+ * them accepts is a spelling all of them accept. */
24
+ export declare function isRenditionIneligible(mimeType: string | null): boolean;
@@ -0,0 +1,40 @@
1
+ // Which source formats never get a rendition, and the one question worth
2
+ // asking of a stored media type.
3
+ //
4
+ // Zero React import, and it must stay that way: this file is re-exported
5
+ // from the @kardalum/plugin-sdk/datatypes subpath so apps/server can
6
+ // refuse an ineligible source at the cut route without pulling the
7
+ // browser half of the SDK into the server process (same boundary as
8
+ // built-in-settings-schemas.ts, Session 60). It lives here rather than in
9
+ // views/crop-view.tsx for that reason alone; crop-view re-exports it so
10
+ // the tile and the browser cut still read the one set.
11
+ /** The source media types that never get a rendition (spec, decision 4).
12
+ *
13
+ * Both would be damaged by a canvas rather than cut by one: an SVG is
14
+ * vector artwork a raster cut throws away, and telling a static GIF from
15
+ * an animated one means parsing the file for extra frames, where a wrong
16
+ * guess silently flattens an animation with nothing to undo it. So no GIF
17
+ * is cut, not only an animated one.
18
+ *
19
+ * DECLARED ONCE, here. The tile that offers the Cut button, the browser
20
+ * cut behind it, and the server route that files the result all read this
21
+ * same set, so a format can never be refused by one and accepted by
22
+ * another.
23
+ */
24
+ export const RENDITION_INELIGIBLE_TYPES = new Set(["image/svg+xml", "image/gif"]);
25
+ /** Whether this source is one the set above refuses. An unknown source
26
+ * (null, before any file exists) is not ineligible: it is unknown, and the
27
+ * tile says nothing about a format it has not been told.
28
+ *
29
+ * The type is reduced to its base form first, because a stored media type
30
+ * is whatever the uploading client sent: `IMAGE/GIF` and
31
+ * `image/gif; charset=binary` are both `image/gif`. Every caller checks
32
+ * through this rather than against the set directly, so a spelling one of
33
+ * them accepts is a spelling all of them accept. */
34
+ export function isRenditionIneligible(mimeType) {
35
+ if (mimeType === null)
36
+ return false;
37
+ const semicolon = mimeType.indexOf(";");
38
+ const base = (semicolon === -1 ? mimeType : mimeType.slice(0, semicolon)).trim().toLowerCase();
39
+ return RENDITION_INELIGIBLE_TYPES.has(base);
40
+ }
@@ -0,0 +1,27 @@
1
+ import type { Editor } from "@tiptap/react";
2
+ import { type BlockListing } from "./insert-menu.js";
3
+ export interface BlockParamFieldsProps {
4
+ listing: BlockListing | null;
5
+ listingsError: string | null;
6
+ params: Record<string, unknown>;
7
+ onChange: (key: string, next: unknown) => void;
8
+ /** Per-param-key error text (S197 Task 12's inline 400 display); omitted elsewhere. */
9
+ fieldErrors?: Record<string, string>;
10
+ }
11
+ export declare function BlockParamFields({ listing, listingsError, params, onChange, fieldErrors }: BlockParamFieldsProps): import("react").JSX.Element;
12
+ export interface BlockPanelProps {
13
+ editor: Editor;
14
+ /** The kardalumBlock node's current document position. */
15
+ pos: number;
16
+ partial: string;
17
+ params: Record<string, unknown>;
18
+ }
19
+ export declare function BlockPanel({ editor, pos, partial, params }: BlockPanelProps): import("react").JSX.Element;
20
+ export interface BlockPreviewPopoverProps {
21
+ partial: string;
22
+ params: Record<string, unknown>;
23
+ /** Viewport rect of the "preview ⤢" button that opened this popover. */
24
+ anchorRect: DOMRect;
25
+ onClose: () => void;
26
+ }
27
+ export declare function BlockPreviewPopover({ partial, params, anchorRect, onClose }: BlockPreviewPopoverProps): import("react").JSX.Element;