@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,372 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { useEffect, useId, useRef, useState } from "react";
3
+ import { CROP_EDITOR_ID, CropSettingsSchema, renditionName, renditionShape, THUMBNAIL_EDITOR_ID, ThumbnailSettingsSchema, } from "@kardalum/api-schemas";
4
+ import { Button, cn, Input, PropertyField, usePropertyFieldControl } from "@kardalum/ui";
5
+ import { MediaPicker } from "../media/media-picker.js";
6
+ import { uploadFailureMessage } from "../media/upload-error.js";
7
+ import { MANAGE_API, usePluginApi, usePluginSettings, usePluginSettingsValue, usePluginValue, } from "../plugin-context.js";
8
+ import { readAllPages } from "../read-all-pages.js";
9
+ // downloadUrl is the stable app path for a public item (S186c §1/§3) but
10
+ // carries a freshly minted, short-lived `?token=` for a private one —
11
+ // never persisted; refetch GET /api/manage/v1/media/:id whenever the field's value
12
+ // (media id) changes rather than caching one, so a private item's
13
+ // preview always has a live token.
14
+ //
15
+ // The crop is read from GET /api/manage/v1/media/:id/renditions, and only when the
16
+ // field asks for one. That listing is the renditions of the item's
17
+ // CURRENT version with the version beside them, which is the same
18
+ // question the renderer answers at read time, so what this view names is
19
+ // what the page will really serve. It is a second request, deliberately:
20
+ // the item response says nothing about crops, and naming a file the
21
+ // picture may not have is worse than one more read on a field that has
22
+ // just changed. The listing is paged (200 at a time), so every page is read before a miss means "none".
23
+ function useMediaPreview(mediaId, rendition) {
24
+ const fetchApi = usePluginApi();
25
+ const [preview, setPreview] = useState(null);
26
+ const [loading, setLoading] = useState(false);
27
+ const [error, setError] = useState(null);
28
+ useEffect(() => {
29
+ if (!mediaId) {
30
+ setPreview(null);
31
+ setError(null);
32
+ return;
33
+ }
34
+ let cancelled = false;
35
+ setLoading(true);
36
+ setError(null);
37
+ const item = fetchApi(`${MANAGE_API}/media/${mediaId}`).then(async (response) => {
38
+ if (!response.ok)
39
+ throw new Error(`Failed to load media (${response.status})`);
40
+ return (await response.json());
41
+ });
42
+ // A failed crop read resolves to "unknown" rather than rejecting: the
43
+ // picture is still the picture, and the facts below then name the
44
+ // file's own name, which is what the renderer falls back to anyway.
45
+ // Only the item read can empty this field's preview. What a failure
46
+ // must NOT do is answer the question it failed to ask, which is why
47
+ // "could not ask" and "asked, and there is none" are different states
48
+ // here (see ResolvedCut).
49
+ const cut = rendition === null
50
+ ? Promise.resolve({ state: "unknown" })
51
+ : readAllPages(fetchApi, `${MANAGE_API}/media/${mediaId}/renditions`, "renditions", {
52
+ limit: 200,
53
+ cap: 50,
54
+ })
55
+ .then(({ items, complete }) => {
56
+ const found = items.find((item) => item.name === rendition);
57
+ if (found)
58
+ return { state: "found", name: found.name, filename: found.filename };
59
+ // A miss on a listing that was not read to its end says nothing about the crop: "could not ask", not "none".
60
+ return complete ? { state: "absent" } : { state: "unknown" };
61
+ })
62
+ .catch(() => ({ state: "unknown" }));
63
+ Promise.all([item, cut])
64
+ .then(([body, found]) => {
65
+ if (!cancelled)
66
+ setPreview({ filename: body.filename, downloadUrl: body.downloadUrl, cut: found });
67
+ })
68
+ .catch((err) => {
69
+ if (!cancelled)
70
+ setError(err instanceof Error ? err.message : String(err));
71
+ })
72
+ .finally(() => {
73
+ if (!cancelled)
74
+ setLoading(false);
75
+ });
76
+ return () => {
77
+ cancelled = true;
78
+ };
79
+ }, [mediaId, rendition, fetchApi]);
80
+ return { preview, loading, error };
81
+ }
82
+ // Sized by the caller: the read-only view shows the picture on its own and
83
+ // keeps the size it has always had, while the input view's sits in a card
84
+ // beside the file's name and the controls (approved mockup, screen 4).
85
+ function PreviewImage({ preview, className }) {
86
+ return (_jsx("img", { src: preview.downloadUrl, alt: preview.filename, className: cn("shrink-0 rounded-md border border-border-default object-cover", className) }));
87
+ }
88
+ function ImageThumbnail({ mediaId }) {
89
+ const { preview, loading, error } = useMediaPreview(mediaId, null);
90
+ if (!mediaId)
91
+ return null;
92
+ if (loading)
93
+ return _jsx("p", { className: "text-xs text-text-secondary", children: "Loading\u2026" });
94
+ if (error)
95
+ return _jsx("p", { className: "text-xs text-danger-600", children: error });
96
+ if (!preview)
97
+ return null;
98
+ return _jsx(PreviewImage, { preview: preview, className: "h-24 w-24" });
99
+ }
100
+ /** The setting as a question: a name the field is asking for, or nothing.
101
+ * An empty string is nothing, the same normalisation `resolveMediaUrl`
102
+ * makes on the server, so the two sides cannot disagree about what was
103
+ * asked. */
104
+ function requestedRendition(settings) {
105
+ return typeof settings.rendition === "string" && settings.rendition.length > 0 ? settings.rendition : null;
106
+ }
107
+ // The picture the field holds, named by what the page will actually show
108
+ // (approved mockup, screen 4). With the crop present that is the crop's
109
+ // own filename plus the line saying where it came from; with the crop
110
+ // genuinely missing the file's own name and the drawer's own "full image"
111
+ // marker, so the same fallback reads the same way on both surfaces. With
112
+ // the question unanswered it is the file's own name and nothing else: a
113
+ // marker we cannot stand behind is worse than no marker.
114
+ //
115
+ // THE "3x4 of espresso-bar.jpg" LINE SAYS THE NAME, not the shape the
116
+ // hint below decodes it to. It is there to explain the `_3x4` in the
117
+ // filename on the line directly above it, and a line that explained it as
118
+ // something the filename does not say would not be an explanation.
119
+ //
120
+ // NEITHER LINE SAYS THE CROP FIELD'S OWN CAPTION ("Portrait"), which the
121
+ // mockup shows. That caption lives on a field of a MEDIA document type.
122
+ // Nothing on this surface can reach it: the field's settings store a name
123
+ // and only a name (ImageSettingsSchema), and two media types may each
124
+ // carry a 3:4 crop under different captions, which makes a derived label
125
+ // confidently wrong. The settings view below, which reads those types to
126
+ // fill its select, is the one place in this file where the caption is
127
+ // known at all.
128
+ function PictureFacts({ preview }) {
129
+ const cut = preview.cut;
130
+ return (_jsxs("div", { className: "min-w-0 flex-1", children: [_jsx("span", { className: "block truncate font-mono text-xs text-text-primary", dir: "auto", children: cut.state === "found" ? cut.filename : preview.filename }), cut.state === "found" && (_jsx("span", { className: "block truncate text-xs text-text-tertiary", dir: "auto", children: `${cut.name} of ${preview.filename}` })), cut.state === "absent" && (_jsx("span", { className: "mt-1 inline-block rounded-sm bg-warning-100 px-1 text-xs text-warning-800", children: "full image" }))] }));
131
+ }
132
+ export function ImageInputView() {
133
+ const { value, onChange } = usePluginValue();
134
+ const settings = usePluginSettings();
135
+ const field = usePropertyFieldControl();
136
+ const fetchApi = usePluginApi();
137
+ const [uploading, setUploading] = useState(false);
138
+ const [error, setError] = useState(null);
139
+ const [picking, setPicking] = useState(false);
140
+ const uploadInputRef = useRef(null);
141
+ const hintId = useId();
142
+ const rendition = requestedRendition(settings);
143
+ const { preview, loading, error: previewError } = useMediaPreview(value, rendition);
144
+ // The field's own hint joins whatever the host's PropertyField already
145
+ // pointed the control at, rather than replacing it: the host describes
146
+ // the field, this describes the shape it asks for.
147
+ const describedBy = [field["aria-describedby"], rendition !== null ? hintId : null].filter(Boolean).join(" ") || undefined;
148
+ async function handleFileChange(event) {
149
+ const file = event.target.files?.[0];
150
+ event.target.value = ""; // lets the same file be re-selected later
151
+ if (!file)
152
+ return;
153
+ setError(null);
154
+ // The field's own limit, honoured as a COURTESY and no longer as the
155
+ // rule (S234d Task 8). The rule is the file upload data type's
156
+ // `maxSizeBytes`, kept on the server, because that is where the bytes
157
+ // arrive: this check runs in one browser on one of the several ways
158
+ // into the library, so nothing can depend on it having run. What it
159
+ // buys is that a file this field would refuse anyway never leaves the
160
+ // machine. Both numbers, same as the server's refusal, so a person
161
+ // knows by how much they are over either way.
162
+ if (settings.maxSizeBytes != null && file.size > settings.maxSizeBytes) {
163
+ setError(`File is too large (${file.size} bytes): the configured limit is ${settings.maxSizeBytes} bytes.`);
164
+ return;
165
+ }
166
+ setUploading(true);
167
+ try {
168
+ const formData = new FormData();
169
+ formData.append("file", file);
170
+ const response = await fetchApi(`${MANAGE_API}/media`, { method: "POST", body: formData });
171
+ // The server's own sentence, not a status code: it may be refusing
172
+ // these bytes for the file upload type's limit, which this field
173
+ // knows nothing about, and that refusal names the limit and the
174
+ // size (S234d Task 8).
175
+ if (!response.ok)
176
+ throw new Error(await uploadFailureMessage(response));
177
+ const media = (await response.json());
178
+ onChange(media.id);
179
+ }
180
+ catch (err) {
181
+ setError(err instanceof Error ? err.message : String(err));
182
+ }
183
+ finally {
184
+ setUploading(false);
185
+ }
186
+ }
187
+ return (_jsxs("div", { className: "flex flex-col gap-2", children: [_jsxs("div", { className: cn("flex items-center gap-3", value && "rounded-md border border-border-default bg-background-subtle p-3"), children: [value &&
188
+ (loading ? (_jsx("p", { className: "text-xs text-text-secondary", children: "Loading\u2026" })) : previewError ? (_jsx("p", { className: "text-xs text-danger-600", children: previewError })) : preview ? (_jsxs(_Fragment, { children: [_jsx(PreviewImage, { preview: preview, className: "h-16 w-16" }), _jsx(PictureFacts, { preview: preview })] })) : null), _jsxs("div", { ...field, role: "group", "aria-describedby": describedBy, className: cn("flex shrink-0 items-center gap-2", value && "ms-auto"), children: [_jsx(Button, { type: "button", variant: "outline", size: "sm", onClick: () => setPicking(true), children: "Choose" }), _jsx(Button, { type: "button", variant: "outline", size: "sm", disabled: uploading, onClick: () => uploadInputRef.current?.click(), children: uploading ? "Uploading…" : "Upload" }), value && (_jsx(Button, { type: "button", variant: "ghost", size: "sm", disabled: uploading, onClick: () => onChange(null), children: "Remove" }))] })] }), _jsx("input", { ref: uploadInputRef, type: "file", className: "hidden", accept: settings.acceptedTypes && settings.acceptedTypes.length > 0 ? settings.acceptedTypes.join(",") : "image/*", "aria-label": "Upload an image", disabled: uploading, onChange: (e) => void handleFileChange(e) }), rendition !== null && (_jsx("p", { id: hintId, className: "text-xs text-text-tertiary", children: `This field asks for the ${renditionShape(rendition)} rendition. An image without one is shown at full size.` })), error && _jsx("p", { className: "text-xs text-danger-600", children: error }), picking && (_jsx(MediaPicker
189
+ // The field stores one media id and has nowhere to put alt text,
190
+ // so a pick commits and the drawer closes in one gesture. Rich
191
+ // text passes true, because there the alt lives on the node.
192
+ , {
193
+ // The field stores one media id and has nowhere to put alt text,
194
+ // so a pick commits and the drawer closes in one gesture. Rich
195
+ // text passes true, because there the alt lives on the node.
196
+ collectAlt: false, acceptedTypes: settings.acceptedTypes, rendition: rendition ?? undefined, onPick: (item) => onChange(item.id), onClose: () => setPicking(false) }))] }));
197
+ }
198
+ // --- The crops a webmaster can choose from (S234d Task 7b) ---------------
199
+ //
200
+ // A media document type declares its crops as FIELDS, and each field's
201
+ // data type holds the settings the crop's name is derived from. So the
202
+ // list of shapes an image field may ask for is those two listings read
203
+ // together: every media type's fields, resolved against the data types,
204
+ // named by `renditionName`, which is the one thing in the product that
205
+ // derives a rendition name.
206
+ //
207
+ // A VIEW FETCHING IS NOT NEW HERE: media-picker.tsx in this same package
208
+ // reads the media library through the host's fetch, and this follows it,
209
+ // including what it does when a read fails (say so verbatim, and go on
210
+ // showing whatever is still true).
211
+ // The listing endpoints' own maximum page size, so the common case is one
212
+ // request each.
213
+ const TYPE_PAGE_LIMIT = 100;
214
+ // How many pages either listing is followed for. Both are cursor
215
+ // paginated and neither offers a kind filter, so the media types have to
216
+ // be found among all of them. The cap is a guard against a cursor that
217
+ // never ends rather than a real ceiling: it is 2000 document types, and a
218
+ // site with more than that has a list this select could not usefully show
219
+ // anyway. Hitting it is REPORTED rather than swallowed (see
220
+ // ListingPages.complete): a list cut short is still a list of real
221
+ // crops, but it cannot be read as the whole set.
222
+ const TYPE_PAGE_CAP = 20;
223
+ const SELECT_CLASS = "h-10 w-full rounded-md border border-border-strong bg-background-elevated px-2 text-sm text-text-primary " +
224
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-600";
225
+ /** A listing read to its end, or as far as the cap allowed.
226
+ *
227
+ * `complete` is false when the cursor was still running when the cap was
228
+ * reached. The rows in hand are real either way; what a short list cannot
229
+ * support is a statement about what is NOT in it, which is the one thing
230
+ * this view says about a stored crop it did not find. */
231
+ /** The rendition name a data type produces, or null when it is not a
232
+ * rendition editor at all or its settings do not parse.
233
+ *
234
+ * The settings go through the same Zod schemas the server validates them
235
+ * with rather than being read member by member, exactly as the admin's
236
+ * Crops tab does it: `renditionName` takes a PARSED settings object, and
237
+ * settings that do not parse are a crop nothing can cut, which is not a
238
+ * shape to offer anyone. */
239
+ function renditionNameOf(dataType) {
240
+ if (dataType.editorId === THUMBNAIL_EDITOR_ID) {
241
+ const settings = ThumbnailSettingsSchema.safeParse(dataType.settings);
242
+ return settings.success ? renditionName({ editorId: THUMBNAIL_EDITOR_ID, settings: settings.data }) : null;
243
+ }
244
+ if (dataType.editorId === CROP_EDITOR_ID) {
245
+ const settings = CropSettingsSchema.safeParse(dataType.settings);
246
+ return settings.success ? renditionName({ editorId: CROP_EDITOR_ID, settings: settings.data }) : null;
247
+ }
248
+ return null;
249
+ }
250
+ /** The crops of every media document type, in the order the types and
251
+ * their fields are declared in. A type with no crop field contributes no
252
+ * group at all rather than an empty one. */
253
+ function collectRenditionChoices(documentTypes, dataTypes) {
254
+ const byId = new Map(dataTypes.map((dataType) => [dataType.id, dataType]));
255
+ const groups = [];
256
+ for (const documentType of documentTypes) {
257
+ if (documentType.kind !== "media")
258
+ continue;
259
+ const choices = [];
260
+ for (const field of documentType.fields) {
261
+ const dataType = byId.get(field.datatypeId);
262
+ if (!dataType)
263
+ continue;
264
+ const name = renditionNameOf(dataType);
265
+ if (name === null)
266
+ continue;
267
+ choices.push({ fieldId: field.id, caption: field.name, name });
268
+ }
269
+ if (choices.length > 0)
270
+ groups.push({ typeId: documentType.id, typeName: documentType.name, choices });
271
+ }
272
+ return groups;
273
+ }
274
+ function useRenditionChoices() {
275
+ const fetchApi = usePluginApi();
276
+ const [groups, setGroups] = useState([]);
277
+ const [loading, setLoading] = useState(true);
278
+ const [error, setError] = useState(null);
279
+ // Both listings have to have been read to the end before an absence
280
+ // from the result means anything. Either one stopping at the cap makes
281
+ // the crops found a SUBSET of the crops declared.
282
+ const [complete, setComplete] = useState(true);
283
+ useEffect(() => {
284
+ let cancelled = false;
285
+ setLoading(true);
286
+ setError(null);
287
+ setComplete(true);
288
+ Promise.all([
289
+ readAllPages(fetchApi, `${MANAGE_API}/document-types`, "document types", { limit: TYPE_PAGE_LIMIT, cap: TYPE_PAGE_CAP }),
290
+ readAllPages(fetchApi, `${MANAGE_API}/data-types`, "data types", { limit: TYPE_PAGE_LIMIT, cap: TYPE_PAGE_CAP }),
291
+ ])
292
+ .then(([documentTypes, dataTypes]) => {
293
+ if (cancelled)
294
+ return;
295
+ setGroups(collectRenditionChoices(documentTypes.items, dataTypes.items));
296
+ setComplete(documentTypes.complete && dataTypes.complete);
297
+ })
298
+ .catch((err) => {
299
+ if (!cancelled)
300
+ setError(err instanceof Error ? err.message : String(err));
301
+ })
302
+ .finally(() => {
303
+ if (!cancelled)
304
+ setLoading(false);
305
+ });
306
+ return () => {
307
+ cancelled = true;
308
+ };
309
+ }, [fetchApi]);
310
+ return { groups, loading, error, complete };
311
+ }
312
+ // Rendered by the Data Types editor only — a settings-EDITING view (see
313
+ // TextSettingsView in built-ins.tsx for the same pattern/rationale).
314
+ // acceptedTypes is edited as a comma-separated string (no multi-select
315
+ // widget precedent in this codebase) and parsed to string[] on change.
316
+ //
317
+ // `rendition` IS A SELECT AND NEVER A TEXT BOX. The value is a rendition
318
+ // name a webmaster has never seen: typing "3:4" where the name is "3x4"
319
+ // fails silently, because no rendition answers to that name and the field
320
+ // simply falls back to the full image with nothing to say why. A list of
321
+ // the crops the site actually declares cannot be misspelled.
322
+ export function ImageSettingsView() {
323
+ const { value: settings, onChange } = usePluginSettingsValue();
324
+ const { groups, loading, error, complete } = useRenditionChoices();
325
+ const noticeId = useId();
326
+ const rendition = requestedRendition(settings);
327
+ const listed = groups.some((group) => group.choices.some((choice) => choice.name === rendition));
328
+ // Whether the question has been answered at all. It decides what this
329
+ // view is entitled to say about a stored name it did not find: with
330
+ // both listings read to the end, nothing declares it; with a read
331
+ // failed, still in flight, or stopped at the page cap, we simply do not
332
+ // know yet, because the crop may be declared on a type this view never
333
+ // saw.
334
+ const settled = !loading && error === null && complete;
335
+ // At most one of these is ever showing, so one element carries them all
336
+ // and one id describes the select whichever is up. role="status" is
337
+ // polite and never interrupts; the other two are worth interrupting for
338
+ // (same split as content-list-view.tsx).
339
+ const notice = loading
340
+ ? {
341
+ role: "status",
342
+ className: "text-text-tertiary",
343
+ text: "Loading the crops your media types declare…",
344
+ }
345
+ : error !== null
346
+ ? // Verbatim, the same convention the media picker follows: a list
347
+ // that came back short for a reason should say the reason.
348
+ { role: "alert", className: "text-danger-600", text: error }
349
+ : complete
350
+ ? null
351
+ : {
352
+ role: "alert",
353
+ className: "text-danger-600",
354
+ text: `Only the first ${TYPE_PAGE_CAP * TYPE_PAGE_LIMIT} types could be read, ` +
355
+ "so a crop declared beyond them is missing from this list.",
356
+ };
357
+ return (_jsxs("div", { className: "flex flex-col gap-4", children: [_jsx(PropertyField, { label: "Accepted file types", htmlFor: "image-settings-accepted-types", helpText: "Comma-separated MIME types, e.g. image/png,image/jpeg. Leave blank to accept any image.", children: _jsx(Input, { id: "image-settings-accepted-types", value: settings.acceptedTypes?.join(",") ?? "", onChange: (e) => {
358
+ const types = e.target.value
359
+ .split(",")
360
+ .map((t) => t.trim())
361
+ .filter((t) => t.length > 0);
362
+ onChange({ ...settings, acceptedTypes: types.length > 0 ? types : undefined });
363
+ } }) }), _jsx(PropertyField, { label: "Max file size (bytes)", htmlFor: "image-settings-max-size", helpText: "e.g. 5000000 for ~5MB. Leave blank for no limit.", children: _jsx(Input, { id: "image-settings-max-size", type: "number", min: 1, value: settings.maxSizeBytes ?? "", onChange: (e) => onChange({ ...settings, maxSizeBytes: e.target.value === "" ? undefined : Number(e.target.value) }) }) }), _jsx(PropertyField, { label: "Crop", htmlFor: "image-settings-rendition", helpText: "The shape this field asks its picture for. A page gets that crop when the picture has one, and the full image when it does not.", children: _jsxs("select", { id: "image-settings-rendition", className: SELECT_CLASS, "aria-describedby": notice ? noticeId : undefined, value: rendition ?? "",
364
+ // The empty option is `rendition: null`, which is how
365
+ // ImageSettingsSchema spells "any picture will do", rather than
366
+ // a missing key or an empty string.
367
+ onChange: (event) => onChange({ ...settings, rendition: event.target.value === "" ? null : event.target.value }), children: [_jsx("option", { value: "", children: "No particular crop" }), rendition !== null && !listed && (_jsx("option", { value: rendition, children: settled ? `${renditionShape(rendition)} (no media type declares this crop)` : renditionShape(rendition) })), groups.map((group) => (_jsx("optgroup", { label: group.typeName, children: group.choices.map((choice) => (_jsx("option", { value: choice.name, children: `${choice.caption} ${renditionShape(choice.name)}` }, choice.fieldId))) }, group.typeId)))] }) }), notice && (_jsx("p", { id: noticeId, role: notice.role, className: cn("text-xs", notice.className), children: notice.text }))] }));
368
+ }
369
+ export function ImageReadOnlyView() {
370
+ const { value } = usePluginValue();
371
+ return _jsx(ImageThumbnail, { mediaId: value });
372
+ }
@@ -0,0 +1,2 @@
1
+ export declare function RichTextInputView(): import("react").JSX.Element;
2
+ export declare function RichTextReadOnlyView(): import("react").JSX.Element;