@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,170 @@
1
+ // The plugin's own licence check (S284b, design 3.2 with corrections C2 and
2
+ // C3). Server only: it verifies the Ed25519 signature through
3
+ // @kardalum/plugin-package, which imports node:crypto, so it is reachable
4
+ // only through the `@kardalum/plugin-sdk/entitlement` subpath and never
5
+ // from the browser entry a federated view loads.
6
+ //
7
+ // The host hands a plugin its latest verdict unchanged
8
+ // (`context.entitlement`, tagged `verdict`), or tells it no check applies
9
+ // (`exempt`, a non-production install) or that it holds no verdict
10
+ // (`none`). This file is the second trust point: a paid
11
+ // plugin calls `requireEntitlement` at the top of the work that is its paid
12
+ // value, so an operator who flips the host's database still has to patch
13
+ // signed, watermarked plugin code to get that work for free.
14
+ import { ENTITLEMENT_MAX_AGE_MS, MAX_VERDICT_AGE_MS, verifyLicenseVerdictSignature, } from "@kardalum/plugin-package";
15
+ import { LICENSE_VERDICT_PUBLIC_KEYS } from "./license-verdict-keys.js";
16
+ import { isLocalHost } from "./local-host.js";
17
+ const ERROR_CODES = ["missing", "invalid-signature", "wrong-plugin", "not-valid", "expired"];
18
+ export class EntitlementError extends Error {
19
+ code;
20
+ pluginId;
21
+ constructor(code, pluginId) {
22
+ super(`Plugin "${pluginId}" is not entitled: ${code}`);
23
+ this.name = "EntitlementError";
24
+ this.code = code;
25
+ this.pluginId = pluginId;
26
+ }
27
+ }
28
+ /** True for an `EntitlementError` from ANY copy of this SDK. The host cannot
29
+ * use `instanceof`: a plugin bundles its own copy of the SDK into its server
30
+ * code, so the class it throws is never the host's class. The name and a
31
+ * known code are the contract instead. */
32
+ export function isEntitlementError(value) {
33
+ if (typeof value !== "object" || value === null)
34
+ return false;
35
+ const candidate = value;
36
+ return (candidate.name === "EntitlementError" &&
37
+ typeof candidate.code === "string" &&
38
+ ERROR_CODES.includes(candidate.code));
39
+ }
40
+ export const ENTITLEMENT_FLOOR_TABLE = "kardalum_entitlement_floor";
41
+ const FLOOR_ROW_ID = "floor";
42
+ /** The floor in the plugin's own structured storage: one table
43
+ * `kardalum_entitlement_floor` with one row `{ id: "floor", issued_at }`.
44
+ * The table is defined on first use; a table already defined (by an
45
+ * earlier process, or an earlier floor object) is fine. */
46
+ export function structuredStorageFloor(storage) {
47
+ let ready = null;
48
+ function ensureTable() {
49
+ if (!ready) {
50
+ ready = storage
51
+ .defineTable({
52
+ tableName: ENTITLEMENT_FLOOR_TABLE,
53
+ columns: [
54
+ { name: "id", type: "text", primaryKey: true },
55
+ { name: "issued_at", type: "text", notNull: true },
56
+ ],
57
+ })
58
+ .catch((err) => {
59
+ // The host's error for a table that exists; matched by name for
60
+ // the same reason as isEntitlementError: no shared class.
61
+ if (err instanceof Error && err.name === "PluginTableAlreadyDefinedError")
62
+ return;
63
+ ready = null;
64
+ throw err;
65
+ });
66
+ }
67
+ return ready;
68
+ }
69
+ async function readRow() {
70
+ const rows = await storage.query(ENTITLEMENT_FLOOR_TABLE).where({ id: FLOOR_ROW_ID });
71
+ const row = rows[0];
72
+ return row && typeof row.issued_at === "string" ? row.issued_at : null;
73
+ }
74
+ return {
75
+ async read() {
76
+ await ensureTable();
77
+ return readRow();
78
+ },
79
+ async write(issuedAt) {
80
+ await ensureTable();
81
+ let current = await readRow();
82
+ if (current === null) {
83
+ try {
84
+ await storage.insert(ENTITLEMENT_FLOOR_TABLE, { id: FLOOR_ROW_ID, issued_at: issuedAt });
85
+ return;
86
+ }
87
+ catch (err) {
88
+ // Two first requests racing each other both read no row and both
89
+ // insert; the loser's primary-key error must not turn a valid
90
+ // entitlement into a 500 (S284b fix wave, M3). Read what the
91
+ // winner wrote and fall through to the forward-only update; an
92
+ // error with no row behind it is a real failure and is thrown.
93
+ current = await readRow();
94
+ if (current === null)
95
+ throw err;
96
+ }
97
+ }
98
+ // Forward only, even if a caller hands an older value.
99
+ const currentMs = Date.parse(current);
100
+ if (Number.isFinite(currentMs) && currentMs >= Date.parse(issuedAt))
101
+ return;
102
+ await storage.update(ENTITLEMENT_FLOOR_TABLE, { id: FLOOR_ROW_ID }, { issued_at: issuedAt });
103
+ },
104
+ };
105
+ }
106
+ // The latest instant a Date can hold. Handed to the signature check as its
107
+ // `now` with an unlimited age so that it decides authenticity alone: the
108
+ // freshness checks run last, after the plugin id and status, in the order
109
+ // the error codes are documented.
110
+ const END_OF_TIME = new Date(8.64e15);
111
+ /**
112
+ * Throws EntitlementError; resolves to the verified envelope, or to null for
113
+ * an `exempt` entitlement (a non-production install, where no licence rule
114
+ * applies, so nothing is checked and the floor is not touched).
115
+ *
116
+ * `exempt` with a `requestHost` that is not local is `missing` (S284b, C9):
117
+ * the host hands `exempt` whenever its own site domain is unset or local,
118
+ * which is one environment variable, so a route serving a public host does
119
+ * not take the host's word for it and refuses as if there were no verdict.
120
+ *
121
+ * `none`, null, undefined or an unknown shape are `missing`. A `verdict` is
122
+ * checked in order: invalid-signature (incl. unknown key, malformed),
123
+ * wrong-plugin, not-valid, expired (issuedAt older than 14 days from
124
+ * max(now, floor), or older than the floor). Writes the floor forward on
125
+ * success when given.
126
+ *
127
+ * A verdict dated more than a day after the effective now is `expired` too:
128
+ * it is a freshness failure, the same answer the host's own verifier gives
129
+ * a future-dated verdict.
130
+ */
131
+ export async function requireEntitlement(entitlement, opts) {
132
+ const { pluginId } = opts;
133
+ if (entitlement === null || entitlement === undefined || typeof entitlement !== "object") {
134
+ throw new EntitlementError("missing", pluginId);
135
+ }
136
+ if (entitlement.kind === "exempt") {
137
+ if (opts.requestHost !== undefined && !isLocalHost(opts.requestHost)) {
138
+ throw new EntitlementError("missing", pluginId);
139
+ }
140
+ return null;
141
+ }
142
+ if (entitlement.kind !== "verdict")
143
+ throw new EntitlementError("missing", pluginId);
144
+ const checked = verifyLicenseVerdictSignature(entitlement, opts.trustedKeys ?? LICENSE_VERDICT_PUBLIC_KEYS, {
145
+ now: END_OF_TIME,
146
+ maxAgeMs: Number.POSITIVE_INFINITY,
147
+ });
148
+ if (!checked.ok)
149
+ throw new EntitlementError("invalid-signature", pluginId);
150
+ const envelope = checked.envelope;
151
+ if (envelope.pluginId !== pluginId)
152
+ throw new EntitlementError("wrong-plugin", pluginId);
153
+ if (envelope.status !== "valid")
154
+ throw new EntitlementError("not-valid", pluginId);
155
+ const issuedMs = Date.parse(envelope.issuedAt);
156
+ const floorValue = opts.floor ? await opts.floor.read() : null;
157
+ const floorMs = floorValue === null ? Number.NaN : Date.parse(floorValue);
158
+ const clockMs = (opts.now ?? new Date()).getTime();
159
+ const effectiveNowMs = Number.isFinite(floorMs) ? Math.max(clockMs, floorMs) : clockMs;
160
+ if (Number.isFinite(floorMs) && issuedMs < floorMs)
161
+ throw new EntitlementError("expired", pluginId);
162
+ if (effectiveNowMs - issuedMs > ENTITLEMENT_MAX_AGE_MS)
163
+ throw new EntitlementError("expired", pluginId);
164
+ if (issuedMs > effectiveNowMs + MAX_VERDICT_AGE_MS)
165
+ throw new EntitlementError("expired", pluginId);
166
+ if (opts.floor && (!Number.isFinite(floorMs) || issuedMs > floorMs)) {
167
+ await opts.floor.write(envelope.issuedAt);
168
+ }
169
+ return envelope;
170
+ }
@@ -0,0 +1 @@
1
+ export { registerPluginSlots, getPluginSection, listPluginSections, listRailEntries, getRailEntry, resetPluginSlotsForTests, type RegisteredSection, type RegisteredRailEntry, } from "./admin-section-registry.js";
@@ -0,0 +1,11 @@
1
+ // The `@kardalum/plugin-sdk/host` subpath: what the admin (the host) uses
2
+ // to register and look up plugin slots. Host-only, and deliberately not on
3
+ // the package index a plugin imports from: a plugin declares its slots in
4
+ // its manifest and the host registers them under the id the plugin was
5
+ // installed as. A plugin that could call these could register slots under
6
+ // another plugin's id before that plugin boots, and nothing about
7
+ // registering belongs in the contract a plugin is written against.
8
+ //
9
+ // Not a stable public API: everything here is @internal and may change in
10
+ // any release without notice.
11
+ export { registerPluginSlots, getPluginSection, listPluginSections, listRailEntries, getRailEntry, resetPluginSlotsForTests, } from "./admin-section-registry.js";
@@ -0,0 +1 @@
1
+ export type { IconName } from "./icons.js";
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export * from "lucide-react";
2
+ export type { IconName } from "lucide-react/dynamic.js";
package/dist/icons.js ADDED
@@ -0,0 +1,10 @@
1
+ // The `@kardalum/plugin-sdk/icons` subpath: the Lucide icon components the
2
+ // admin draws with, plus `IconName`, the valid values for a manifest's
3
+ // `icon` field. A plugin's UI imports its icons from here so it draws from
4
+ // the same set at the same version as the host.
5
+ //
6
+ // Not a federation share key (only the SDK root is shared), and not on the
7
+ // package index: the index stays free of the icon set's weight, because the
8
+ // CLI enforces a bundle-size budget on plugins and a bundler only drops the
9
+ // icons a plugin does not use when it imports them from here by name.
10
+ export * from "lucide-react";
@@ -0,0 +1,28 @@
1
+ export type { DataTypePlugin, DataTypePluginViews } from "./data-type-plugin.js";
2
+ export type { IconName } from "./icon-name.js";
3
+ export type { DataTypeIssue, DataTypeValidateContext, DataTypeValidateHook, DataTypeValidatorEntry, DataTypeValidatorLookup, } from "./datatype-validation.js";
4
+ export type { PluginType, DatabaseDialect, DatabaseCompatibility, PluginAssertion, PluginAssertions, PluginMigrationContext, PluginMigration, PluginMigrationValidation, PluginMigrationHooks, PluginInstallContext, PluginUpdateContext, PluginInstallDeclaration, InstallStep, InstallOption, InstallChoice, ResolvedInstallAnswers, HookEvent, HookHandler, PluginHooks, ContentLifecycleHookPayload, PluginHookContext, AdminSectionContribution, BuiltInRailEntryContribution, BuiltInRailSection, RailEntryContribution, SlotLabel, DashboardWidgetContribution, ApiRouteContribution, ScheduledTaskContribution, MediaProcessorContribution, SettingsPageContribution, ContentTreeActionContribution, EditorToolbarContribution, ExposedServiceContribution, BundledTemplateContribution, SerializerContext, CustomFormatContribution, SerializerContribution, PluginContributions, PluginManifestBase, PluginManifest, } from "./manifest.js";
5
+ export { slotLabel } from "./manifest.js";
6
+ export { CAPABILITY_IDS, CAPABILITY_LABELS, capabilityLabel, PROMISED_CAPABILITY_SENTENCE, deriveCapabilities, isActionGated, type Capability, type CapabilityAudience, type CapabilityLabels, type CapabilityMediation, type CapabilityPayload, } from "./capabilities.js";
7
+ export { BUILT_IN_RAIL_SECTIONS, CMSPluginSchema, DataTypePluginSchema, validatePluginManifest, type ValidatePluginManifestResult, } from "./manifest-schema.js";
8
+ export { definePlugin, PluginDefinitionError } from "./define-plugin.js";
9
+ export { registerDataType, getDataType, listDataTypes } from "./registry.js";
10
+ export { PluginValueProvider, PluginSettingsProvider, PluginApiProvider, ContentHostProvider, usePluginValue, usePluginSettings, usePluginSettingsValue, usePluginApi, useContentHost, MANAGE_API, type PluginFetch, type ContentHost, type ContentHostPage, type ContentHostDocumentType, } from "./plugin-context.js";
11
+ export { PluginScreenProvider, PluginTranslateProvider, usePluginScreen, usePluginTranslate, type PluginScreenContext, type PluginTranslate, } from "./plugin-screen-context.js";
12
+ export { SimpleStorageValueProvider } from "./simple-storage-value-provider.js";
13
+ export { EntitlementGate, useEntitlement, type EntitlementStatus, type UseEntitlementResult, } from "./entitlement-gate.js";
14
+ export type { Entitlement, EntitlementErrorCode, EntitlementVerdict, PluginTaskContext } from "./entitlement-types.js";
15
+ export { buildRichtextExtensions, TextStyleClass, KardalumBlock, KardalumBlockOnPage, selectedKardalumBlock, findKardalumBlocks, setBlockHtml, unavailableBlockHtml, moveSelectionPastBlock, type BuildRichtextExtensionsOptions, type RichtextTextStyle, type TextStyleClassAttributes, type KardalumBlockAttributes, type KardalumBlockLocation, type SelectedKardalumBlock, } from "./richtext/extensions.js";
16
+ export { MediaPicker, type MediaPickerItem, type MediaPickerProps } from "./media/media-picker.js";
17
+ export { MediaFileProvider, useMediaFile, useMediaFileReplace, type CurrentMediaFile, type MediaFileProviderProps, type MediaFileReplace, } from "./views/file-upload-view.js";
18
+ export { MediaRenditionProvider, useMediaRendition, isRenditionIneligible, RENDITION_INELIGIBLE_TYPES, type MediaRenditionCut, type MediaRenditionHost, type MediaRenditionProviderProps, } from "./views/crop-view.js";
19
+ export { StyleListbox, type StyleListboxProps } from "./richtext/style-listbox.js";
20
+ export { BlockInsertMenu, defaultBlockParams, useBlockListings, type BlockInsertMenuProps, type BlockListing, type BlockParamSpec, type BlockParamType, type UseBlockListingsResult, } from "./richtext/insert-menu.js";
21
+ export { BlockPanel, BlockPreviewPopover, BlockParamFields, type BlockPanelProps, type BlockPreviewPopoverProps, type BlockParamFieldsProps, } from "./richtext/block-panel.js";
22
+ export { Panel, type PanelProps } from "@kardalum/ui";
23
+ export { PropertyField, usePropertyFieldControl, type PropertyFieldProps, type PropertyFieldControlProps, } from "@kardalum/ui";
24
+ export { Input, type InputProps } from "@kardalum/ui";
25
+ export { Button, type ButtonProps } from "@kardalum/ui";
26
+ export { Switch, type SwitchProps } from "@kardalum/ui";
27
+ export { Badge, type BadgeProps } from "@kardalum/ui";
28
+ export { cn } from "@kardalum/ui";
package/dist/index.js ADDED
@@ -0,0 +1,94 @@
1
+ // S280: the one rule for which language of a slot's label to show.
2
+ export { slotLabel } from "./manifest.js";
3
+ // S268 Task 5: the derived capability list. A capability is computed
4
+ // from what the manifest declares, never declared beside it, so the
5
+ // install screen, marketplace review and the generated reference page
6
+ // all read one source. Exported from the package index as well as the
7
+ // ./manifest subpath because the admin UI renders it.
8
+ export { CAPABILITY_IDS, CAPABILITY_LABELS, capabilityLabel, PROMISED_CAPABILITY_SENTENCE, deriveCapabilities, isActionGated, } from "./capabilities.js";
9
+ export { BUILT_IN_RAIL_SECTIONS, CMSPluginSchema, DataTypePluginSchema, validatePluginManifest, } from "./manifest-schema.js";
10
+ export { definePlugin, PluginDefinitionError } from "./define-plugin.js";
11
+ export { registerDataType, getDataType, listDataTypes } from "./registry.js";
12
+ // The slot registry (spec D8) is not exported here: the host registers a
13
+ // plugin's slots from its manifest, through the host-only
14
+ // `@kardalum/plugin-sdk/host` subpath (host-entry.ts). Federation shares
15
+ // the bare package name only, not that subpath, so a plugin that imports it
16
+ // anyway registers into its own bundled copy, never the host's registry.
17
+ export { PluginValueProvider, PluginSettingsProvider, PluginApiProvider, ContentHostProvider, usePluginValue, usePluginSettings, usePluginSettingsValue, usePluginApi, useContentHost, MANAGE_API, } from "./plugin-context.js";
18
+ // S280 (spec D7): what a plugin screen (a section, its rail entries, a rail
19
+ // entry in a built-in section) learns about where it is rendered. S291: the
20
+ // plugin's t for views outside a screen (a data type's views).
21
+ export { PluginScreenProvider, PluginTranslateProvider, usePluginScreen, usePluginTranslate, } from "./plugin-screen-context.js";
22
+ export { SimpleStorageValueProvider } from "./simple-storage-value-provider.js";
23
+ // S284b: the entitlement in a view. The verifier for plugin SERVER code is
24
+ // the separate `@kardalum/plugin-sdk/entitlement` subpath (it needs
25
+ // node:crypto); these two verify in the browser and import nothing Node.
26
+ export { EntitlementGate, useEntitlement, } from "./entitlement-gate.js";
27
+ export { buildRichtextExtensions, TextStyleClass, KardalumBlock, KardalumBlockOnPage, selectedKardalumBlock, findKardalumBlocks, setBlockHtml, unavailableBlockHtml, moveSelectionPastBlock, } from "./richtext/extensions.js";
28
+ // Exported so a later on-page task can reuse the same modal from admin-ui
29
+ // (S197 Task 2) rather than forking it.
30
+ export { MediaPicker } from "./media/media-picker.js";
31
+ // S234a: the file upload editor's field stores no value of its own (see
32
+ // file-upload-view.tsx's doc comment), so the host has no `data` key to
33
+ // hand it a current file through. Exported here so the media item screen
34
+ // (S234a Task 7) can wrap a media item's DocumentTypeForm in this
35
+ // provider with the real row's filename/size/mimeType, the same reason
36
+ // MediaPicker is exported above.
37
+ // S234b Task 6 adds the other direction through the same provider: the
38
+ // host hands down a replace handler and its label, and the view renders a
39
+ // Replace control only when it gets one, so the Data Types editor's
40
+ // preview (which has no media item) keeps rendering a plain display.
41
+ export { MediaFileProvider, useMediaFile, useMediaFileReplace, } from "./views/file-upload-view.js";
42
+ // S234c: the same arrangement for the rendition fields. The crop tile
43
+ // shows what the field holds, and the host (the media item screen's Crops
44
+ // tab) hands down which file is on screen and the one action, so the
45
+ // cropper dialog can stay in the admin where the item's versions and API
46
+ // are. RENDITION_INELIGIBLE_TYPES is exported beside them because the
47
+ // browser cut and the Crops tab must refuse exactly what the tile refuses:
48
+ // one set, not a copy per caller. It is declared in
49
+ // rendition-eligibility.ts, which crop-view re-exports, so the server can
50
+ // read the same set through ./datatypes without importing React.
51
+ export { MediaRenditionProvider, useMediaRendition, isRenditionIneligible, RENDITION_INELIGIBLE_TYPES, } from "./views/crop-view.js";
52
+ // The "Aa Style ▾" listbox body, extracted out of rich-text-view.tsx (S197
53
+ // Task 11) so the on-page bubble toolbar (apps/admin-ui) can reuse the
54
+ // exact same widget instead of forking it — same reasoning as MediaPicker.
55
+ export { StyleListbox } from "./richtext/style-listbox.js";
56
+ // Block insert menu + param panel (S197 Task 3) — exported for the same
57
+ // reason MediaPicker is: the later on-page mount reuses these rather than
58
+ // forking its own.
59
+ export { BlockInsertMenu, defaultBlockParams, useBlockListings, } from "./richtext/insert-menu.js";
60
+ export { BlockPanel, BlockPreviewPopover, BlockParamFields, } from "./richtext/block-panel.js";
61
+ // The SDK's curated re-export of @kardalum/ui. @kardalum/ui is published
62
+ // (not private) because @kardalum/plugin-sdk has a runtime dependency on
63
+ // it — a registry install of the SDK would be unresolvable otherwise. This
64
+ // is the first consumer to actually need it — built-ins.tsx
65
+ // still imports @kardalum/ui directly, a documented TEMPORARY shortcut valid
66
+ // only because built-ins are compiled into the same admin bundle. Google
67
+ // Maps (Session 74) is a separate package on the real public SDK surface, so
68
+ // it goes through here instead, proving the boundary external plugin authors
69
+ // will actually use. Grow this list as plugins need more of @kardalum/ui, not
70
+ // preemptively.
71
+ export { Panel } from "@kardalum/ui";
72
+ export { PropertyField,
73
+ // An input view is handed to PropertyField as a COMPONENT, so the
74
+ // field's <label> has no child element to point at. Spreading this hook
75
+ // onto the view's own control is how a third-party data type gets an
76
+ // accessible name (WCAG 4.1.2) — see the datatype plugin contract docs.
77
+ usePropertyFieldControl, } from "@kardalum/ui";
78
+ export { Input } from "@kardalum/ui";
79
+ export { Button } from "@kardalum/ui";
80
+ export { Switch } from "@kardalum/ui";
81
+ export { Badge } from "@kardalum/ui";
82
+ export { cn } from "@kardalum/ui";
83
+ // S197 final-review fix F5: this used to end with a bare
84
+ // `import "./built-ins.js"` side effect — importing ANYTHING from this
85
+ // package incidentally registered the six built-in datatypes, whether the
86
+ // consumer wanted that or not. That made this entry point permanently
87
+ // heavy (TipTap always, CodeMirror/lezer since S197 Task 8's HTML
88
+ // datatype), which every first-party plugin's Module Federation `shared`
89
+ // config (pointing at this exact bare specifier) then packaged a dead-
90
+ // weight fallback copy of into its own artifact — see
91
+ // `register-built-ins.ts`'s own doc comment for the full story. Built-in
92
+ // registration is now that separate, explicitly-imported subpath
93
+ // (`@kardalum/plugin-sdk/register-built-ins`): apps/admin-ui's
94
+ // bootstrap (main.tsx) and vitest setup are its only two real consumers.
@@ -0,0 +1,18 @@
1
+ import type { TrustedKey } from "@kardalum/plugin-package";
2
+ /**
3
+ * The public keys a plugin trusts to sign a licence verdict (S284b, design
4
+ * 3.2). Public halves only, by key id. `requireEntitlement` (server) and
5
+ * `useEntitlement` (browser) both verify against this list unless a caller
6
+ * passes its own `trustedKeys`, which is how the tests inject a test key.
7
+ *
8
+ * It holds the separated licence verdict key `license-2026-10` (S284b Task
9
+ * 6), the same list as the host's SHIPPED_LICENSE_VERDICT_KEYS in
10
+ * apps/server/src/plugins/trusted-signing-keys.ts. The two must name the
11
+ * same keys, because the plugin checks the verdict the host stored; the
12
+ * server's trusted-keys.test.ts imports this list and fails if they differ.
13
+ * The package signing key is deliberately not here.
14
+ *
15
+ * Type-only import above, so the browser entry can read this list without
16
+ * loading @kardalum/plugin-package.
17
+ */
18
+ export declare const LICENSE_VERDICT_PUBLIC_KEYS: TrustedKey[];
@@ -0,0 +1,26 @@
1
+ /**
2
+ * The public keys a plugin trusts to sign a licence verdict (S284b, design
3
+ * 3.2). Public halves only, by key id. `requireEntitlement` (server) and
4
+ * `useEntitlement` (browser) both verify against this list unless a caller
5
+ * passes its own `trustedKeys`, which is how the tests inject a test key.
6
+ *
7
+ * It holds the separated licence verdict key `license-2026-10` (S284b Task
8
+ * 6), the same list as the host's SHIPPED_LICENSE_VERDICT_KEYS in
9
+ * apps/server/src/plugins/trusted-signing-keys.ts. The two must name the
10
+ * same keys, because the plugin checks the verdict the host stored; the
11
+ * server's trusted-keys.test.ts imports this list and fails if they differ.
12
+ * The package signing key is deliberately not here.
13
+ *
14
+ * Type-only import above, so the browser entry can read this list without
15
+ * loading @kardalum/plugin-package.
16
+ */
17
+ export const LICENSE_VERDICT_PUBLIC_KEYS = [
18
+ {
19
+ keyId: "a4c4a883bf1392a6",
20
+ publicKey: "MCowBQYDK2VwAyEA5GCT1TohzY/oOnB0xZ+7pnvCddka2IBFoJNmmYGu9PI=",
21
+ },
22
+ {
23
+ keyId: "e72c11dbcdf71e68",
24
+ publicKey: "MCowBQYDK2VwAyEA5k/u12E1qUYgQRR4+sjtdmBoYieQdXyunB//groWtCo=",
25
+ },
26
+ ];
@@ -0,0 +1,3 @@
1
+ /** True for `localhost`, `127.0.0.1`, `::1` and any `*.localhost` host, with
2
+ * or without a port; false for anything else. */
3
+ export declare function isLocalHost(host: string): boolean;
@@ -0,0 +1,38 @@
1
+ // Whether a host is a local one (S284b, correction C9). Browser-safe: it is
2
+ // used by the server-only verifier (`requireEntitlement`, which honours an
3
+ // `exempt` entitlement only for a request that arrived on a local host) and
4
+ // by the browser's `<EntitlementGate>` (which honours it only when the page
5
+ // itself is served from a local host).
6
+ //
7
+ // The rule is a copy of the host's own (apps/server/src/licensing/
8
+ // production-domain.ts): `localhost`, `127.0.0.1`, `::1` and any
9
+ // `*.localhost` host, on any port, are local; everything else, an empty
10
+ // host included, is not. A copy because the SDK cannot import server code;
11
+ // local-host.test.ts pins the cases. One difference, in the direction the
12
+ // rule's own wording takes: a bare `::1` (no brackets) is local here, where
13
+ // the host's port split reads it as `:` on port 1. A Host header always
14
+ // brackets an IPv6 address, so the two agree on every request.
15
+ /** Strips a port (bare `host:port`, or bracketed `[ipv6]:port`) and
16
+ * lower-cases what is left. */
17
+ function hostnameOf(host) {
18
+ const trimmed = host.trim();
19
+ if (trimmed.startsWith("[")) {
20
+ const closeBracket = trimmed.indexOf("]");
21
+ return (closeBracket === -1 ? trimmed : trimmed.slice(1, closeBracket)).toLowerCase();
22
+ }
23
+ const lastColon = trimmed.lastIndexOf(":");
24
+ // A bare IPv6 address (more than one colon, no brackets) carries no port:
25
+ // a Host header always brackets one, but a caller may hand the address
26
+ // itself, and `::1` must not be read as `:` on port 1.
27
+ const bareIpv6 = trimmed.indexOf(":") !== lastColon;
28
+ if (lastColon !== -1 && !bareIpv6 && /^\d+$/.test(trimmed.slice(lastColon + 1))) {
29
+ return trimmed.slice(0, lastColon).toLowerCase();
30
+ }
31
+ return trimmed.toLowerCase();
32
+ }
33
+ /** True for `localhost`, `127.0.0.1`, `::1` and any `*.localhost` host, with
34
+ * or without a port; false for anything else. */
35
+ export function isLocalHost(host) {
36
+ const hostname = hostnameOf(host);
37
+ return hostname === "localhost" || hostname === "127.0.0.1" || hostname === "::1" || hostname.endsWith(".localhost");
38
+ }
@@ -0,0 +1,8 @@
1
+ export type { DataTypePlugin, DataTypePluginViews } from "./data-type-plugin.js";
2
+ export type { PluginType, DatabaseDialect, DatabaseCompatibility, PluginAssertion, PluginAssertions, PluginMigrationContext, PluginMigration, PluginMigrationValidation, PluginMigrationHooks, PluginInstallContext, PluginUpdateContext, PluginInstallDeclaration, InstallStep, InstallOption, InstallChoice, ResolvedInstallAnswers, HookEvent, HookHandler, PluginHooks, ContentLifecycleHookPayload, PluginHookContext, AdminSectionContribution, BuiltInRailEntryContribution, BuiltInRailSection, RailEntryContribution, SlotLabel, DashboardWidgetContribution, ApiRouteContribution, ScheduledTaskContribution, MediaProcessorContribution, SettingsPageContribution, ContentTreeActionContribution, EditorToolbarContribution, ExposedServiceContribution, BundledTemplateContribution, SerializerContext, CustomFormatContribution, SerializerContribution, PluginContributions, ViewBearingContribution, PluginManifestBase, PluginManifest, } from "./manifest.js";
3
+ export { VIEW_BEARING_CONTRIBUTIONS, declaresClientBundle, slotLabel } from "./manifest.js";
4
+ export { CAPABILITY_IDS, CAPABILITY_LABELS, capabilityLabel, PROMISED_CAPABILITY_SENTENCE, deriveCapabilities, isActionGated, type Capability, type CapabilityAudience, type CapabilityLabels, type CapabilityMediation, type CapabilityPayload, } from "./capabilities.js";
5
+ export { ASSERTION_KINDS, AssertionsSchema, BUILT_IN_RAIL_SECTIONS, CMSPluginSchema, CONTRIBUTION_KEYS, DataTypePluginSchema, formatIssues, validatePluginManifest, type ValidatePluginManifestResult, } from "./manifest-schema.js";
6
+ export type { PluginColumnType, PluginColumnSchema, PluginIndexSchema, PluginTableSchema, StructuredQueryBuilder, StructuredStorageTransaction, ScopedStructuredStorage, PublishedContent, PluginApiRouteContext, } from "./structured-storage-types.js";
7
+ export type { Entitlement, EntitlementErrorCode, EntitlementVerdict, PluginTaskContext } from "./entitlement-types.js";
8
+ export { definePlugin, PluginDefinitionError } from "./define-plugin.js";
@@ -0,0 +1,13 @@
1
+ // The `@kardalum/plugin-sdk/manifest` subpath: manifest contract + runtime
2
+ // validation ONLY. Exists for non-browser consumers (apps/server's plugin
3
+ // registry, the future `kardalum plugin validate` CLI), unlike the package
4
+ // index, importing this pulls in no React components, no TipTap, no
5
+ // @kardalum/ui, and does NOT side-effect-register the built-in datatypes.
6
+ // Runtime deps: zod + @kardalum/api-schemas, both server-safe.
7
+ export { VIEW_BEARING_CONTRIBUTIONS, declaresClientBundle, slotLabel } from "./manifest.js";
8
+ // The derived capability list (S268 Task 5). Pure data in, pure data
9
+ // out: no React, no zod, so every non-browser reader of the manifest
10
+ // contract can compute it.
11
+ export { CAPABILITY_IDS, CAPABILITY_LABELS, capabilityLabel, PROMISED_CAPABILITY_SENTENCE, deriveCapabilities, isActionGated, } from "./capabilities.js";
12
+ export { ASSERTION_KINDS, AssertionsSchema, BUILT_IN_RAIL_SECTIONS, CMSPluginSchema, CONTRIBUTION_KEYS, DataTypePluginSchema, formatIssues, validatePluginManifest, } from "./manifest-schema.js";
13
+ export { definePlugin, PluginDefinitionError } from "./define-plugin.js";