@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,125 @@
1
+ export declare function joinContentPath(parentPath: string, slug: string): string;
2
+ /**
3
+ * The reserved `ContentVersion.data` key holding a node's display name.
4
+ *
5
+ * S227: the name lives in versioned data like any other field, so renaming
6
+ * inserts a version, history shows who renamed what, and a rollback
7
+ * restores the old name together with the old content
8
+ * (specs/2026-09-14-name-slug-copy-move-design.md §2).
9
+ *
10
+ * Safe by construction rather than by convention: a field id must match
11
+ * `/^[a-zA-Z][a-zA-Z0-9_]*$/` (document-type.schema.ts), so it must START
12
+ * with a letter. No user-defined field can ever be called `_name`, and
13
+ * nothing has to check for a collision.
14
+ */
15
+ export declare const CONTENT_NAME_KEY = "_name";
16
+ /**
17
+ * "About us" -> "about-us", "عن فريقنا" -> "عن-فريقنا".
18
+ *
19
+ * S227 REVERSED an earlier decision, so the history is worth stating
20
+ * plainly. This function used to strip everything outside `[a-z0-9]`,
21
+ * which meant a name written entirely in Arabic, Hebrew or CJK slugified
22
+ * to `""`, and its comment instructed callers to treat that as "no auto
23
+ * slug available" and make the user type a Latin one by hand.
24
+ *
25
+ * That is no longer true, and the reason is that RTL is foundational here
26
+ * rather than a later retrofit: under the old rule an Arabic-named page
27
+ * had no usable URL at all, and an Arabic-speaking editor had to invent a
28
+ * Latin name for every page they created. Unicode in a URL is a standard
29
+ * (RFC 3987), browsers display it natively and percent-encode it on the
30
+ * wire, and Umbraco has done this for years.
31
+ *
32
+ * So letters and digits of ANY script survive, and only what genuinely
33
+ * cannot sit in a path segment is replaced. `""` now comes back only for
34
+ * input with no letters or digits at all ("!!!", "---"), which callers
35
+ * must still treat as "no slug available" rather than inventing one.
36
+ *
37
+ * NFC rather than NFD: the composed form is what a browser address bar,
38
+ * a database index and a copied link all agree on, so the same visible
39
+ * name is always the same bytes. (The old code NFD-decomposed in order to
40
+ * strip diacritics off Latin letters, which only made sense while the
41
+ * output was ASCII-only.)
42
+ *
43
+ * Idempotent: slugify(slugify(x)) === slugify(x).
44
+ */
45
+ export declare function slugify(name: string): string;
46
+ /**
47
+ * S228: the first free name in a "Name", "Name (2)", "Name (3)" series.
48
+ *
49
+ * Built for copy, where landing beside the original is the common case and
50
+ * refusing would make the feature useless.
51
+ *
52
+ * This is the FIRST auto-naming generator in the codebase, and that is
53
+ * deliberate rather than accidental: every other collision path refuses
54
+ * instead (ContentPathConflictError, MediaFolderNameConflictError, the
55
+ * assets 409, the templates unique alias). It lives here beside slugify
56
+ * because the two must agree: the NAME is suffixed and the slug follows
57
+ * from it, so "About Us (2)" becomes "/about-us-2" and there is never a
58
+ * second rule deciding what a URL looks like.
59
+ *
60
+ * A base that already carries a suffix continues its own series rather
61
+ * than nesting: "About Us (2)" becomes "About Us (3)", never
62
+ * "About Us (2) (2)". Copying a copy is the exact case that produces it.
63
+ *
64
+ * `taken` is the set of names already in use among the target's siblings.
65
+ * The database's unique (path, locale) index remains the real guarantee;
66
+ * this only decides what to try first.
67
+ */
68
+ export declare function nextAvailableName(base: string, taken: Iterable<string>): string;
69
+ /** How many candidate slugs nextFreeSlug asks about before it gives up. */
70
+ export declare const NEXT_FREE_SLUG_ATTEMPTS = 200;
71
+ /**
72
+ * S277e: the first name in the "Name", "Name (2)", "Name (3)" series whose
73
+ * SLUG is free, with that slug.
74
+ *
75
+ * nextAvailableName picks by display name. A copy needs the other
76
+ * question answered, because the path is what collides: two pages may
77
+ * share a display name, and a page whose rename has not been published
78
+ * still shows its old name in a list while its path has already moved.
79
+ * `isFree` is the caller's whole test for a candidate (an occupied path, a
80
+ * reserved name, a language code, a name another node owns as the first
81
+ * part of an address), so every reason a slug cannot be used is skipped the
82
+ * same way. It is handed the candidate's display name as well, so a caller
83
+ * that will not have two siblings share a display name can refuse the
84
+ * candidate for that too.
85
+ *
86
+ * The series continues an existing one as nextAvailableName does. A name
87
+ * with no letters or digits has no slug, so it is never asked about and
88
+ * the series starts at its "(2)". `isFree` is asked about one candidate at
89
+ * a time and at most NEXT_FREE_SLUG_ATTEMPTS times; after that the name
90
+ * carries a timestamp, unchecked, as nextAvailableName's does, and the
91
+ * database's unique index on the path stays the real guarantee.
92
+ */
93
+ export declare function nextFreeSlug(baseName: string, isFree: (slug: string, name: string) => Promise<boolean>): Promise<{
94
+ name: string;
95
+ slug: string;
96
+ }>;
97
+ /**
98
+ * The one URL that represents this page, for a canonical link and for the
99
+ * admin's links to the live page.
100
+ *
101
+ * The prefixed URL when the site has more than one culture, the bare path
102
+ * when it does not. `path` is the page's public address (`publicPath`), so
103
+ * "/" is the default site and its prefixed form is the bare language root
104
+ * ("/de").
105
+ *
106
+ * S233: moved here from apps/server/src/cultures/resolve-culture.ts so the
107
+ * admin links to exactly the URL the renderer serves.
108
+ */
109
+ export declare function canonicalPath(path: string, culture: string, prefixed: boolean): string;
110
+ /**
111
+ * A node's public address: its stored path with the default site's own
112
+ * segment removed. A node of any other site keeps its stored path.
113
+ * `defaultSitePath` is the default site's stored path ("/home"), or null
114
+ * when the install has no default site.
115
+ */
116
+ export declare function publicPath(storedPath: string, defaultSitePath: string | null): string;
117
+ /**
118
+ * The first non-empty segment of a path: "/home" and "/home/about" give
119
+ * "home". "" for "/" or "".
120
+ *
121
+ * A path with no leading slash is read the same way ("home" gives "home"),
122
+ * because a direct caller of the service can pass one and the reserved-name
123
+ * check must judge the segment the server would route on.
124
+ */
125
+ export declare function firstSegment(path: string): string;
@@ -0,0 +1,260 @@
1
+ // Joins a slug onto a parent node's stored path.
2
+ //
3
+ // A parent path is never "/": no node is stored there (S277c). The home
4
+ // page is an ordinary top-level node ("/home") whose own segment the server
5
+ // hides from a visitor's address, so every parent path is "/" followed by
6
+ // at least one segment and the join is the plain one.
7
+ //
8
+ // This stays the ONE shared implementation for every place that turns a
9
+ // parent path and a slug into a child path (the seeder, the admin's create
10
+ // form, the content routes, ContentService), so they cannot come to
11
+ // disagree about it.
12
+ export function joinContentPath(parentPath, slug) {
13
+ return `${parentPath}/${slug}`;
14
+ }
15
+ /**
16
+ * The reserved `ContentVersion.data` key holding a node's display name.
17
+ *
18
+ * S227: the name lives in versioned data like any other field, so renaming
19
+ * inserts a version, history shows who renamed what, and a rollback
20
+ * restores the old name together with the old content
21
+ * (specs/2026-09-14-name-slug-copy-move-design.md §2).
22
+ *
23
+ * Safe by construction rather than by convention: a field id must match
24
+ * `/^[a-zA-Z][a-zA-Z0-9_]*$/` (document-type.schema.ts), so it must START
25
+ * with a letter. No user-defined field can ever be called `_name`, and
26
+ * nothing has to check for a collision.
27
+ */
28
+ export const CONTENT_NAME_KEY = "_name";
29
+ // No schema caps a content path segment's length (ContentNodeSchema and
30
+ // CreateContentRequestSchema only require `path: z.string().min(1)`), so
31
+ // this is a generous local ceiling rather than a validated contract: it
32
+ // exists so an unusually long name cannot silently produce an unusably
33
+ // long path segment. It counts code points, so a letter outside the BMP is
34
+ // never split.
35
+ const MAX_SLUG_LENGTH = 200;
36
+ /**
37
+ * "About us" -> "about-us", "عن فريقنا" -> "عن-فريقنا".
38
+ *
39
+ * S227 REVERSED an earlier decision, so the history is worth stating
40
+ * plainly. This function used to strip everything outside `[a-z0-9]`,
41
+ * which meant a name written entirely in Arabic, Hebrew or CJK slugified
42
+ * to `""`, and its comment instructed callers to treat that as "no auto
43
+ * slug available" and make the user type a Latin one by hand.
44
+ *
45
+ * That is no longer true, and the reason is that RTL is foundational here
46
+ * rather than a later retrofit: under the old rule an Arabic-named page
47
+ * had no usable URL at all, and an Arabic-speaking editor had to invent a
48
+ * Latin name for every page they created. Unicode in a URL is a standard
49
+ * (RFC 3987), browsers display it natively and percent-encode it on the
50
+ * wire, and Umbraco has done this for years.
51
+ *
52
+ * So letters and digits of ANY script survive, and only what genuinely
53
+ * cannot sit in a path segment is replaced. `""` now comes back only for
54
+ * input with no letters or digits at all ("!!!", "---"), which callers
55
+ * must still treat as "no slug available" rather than inventing one.
56
+ *
57
+ * NFC rather than NFD: the composed form is what a browser address bar,
58
+ * a database index and a copied link all agree on, so the same visible
59
+ * name is always the same bytes. (The old code NFD-decomposed in order to
60
+ * strip diacritics off Latin letters, which only made sense while the
61
+ * output was ASCII-only.)
62
+ *
63
+ * Idempotent: slugify(slugify(x)) === slugify(x).
64
+ */
65
+ export function slugify(name) {
66
+ const slug = name
67
+ .normalize("NFC")
68
+ .toLowerCase()
69
+ // Anything that is not a letter or a digit in any script becomes a
70
+ // separator. This covers whitespace, punctuation, emoji, and the
71
+ // characters that would otherwise change what the path MEANS: "/"
72
+ // (a segment boundary), "?" and "#" (URL delimiters), "%" (an escape
73
+ // introducer) and control characters.
74
+ .replace(/[^\p{L}\p{N}]+/gu, "-")
75
+ .replace(/^-+|-+$/g, "");
76
+ // Counted and cut in code points: a UTF-16 slice could end inside a
77
+ // surrogate pair and leave a lone surrogate in a path.
78
+ const points = Array.from(slug);
79
+ if (points.length <= MAX_SLUG_LENGTH)
80
+ return slug;
81
+ const truncated = points.slice(0, MAX_SLUG_LENGTH);
82
+ // The cut already lands between words when the very next character (just
83
+ // past the budget) is a dash or the slug ends there exactly.
84
+ const nextChar = points[MAX_SLUG_LENGTH] ?? "";
85
+ if (nextChar === "" || nextChar === "-")
86
+ return truncated.join("").replace(/-+$/g, "");
87
+ // Otherwise the cut fell mid-word: back up to the last dash boundary so
88
+ // no word is severed, unless that dash is so early it would throw away
89
+ // nearly all of the budget for one very long final word, in which case a
90
+ // mid-word cut is the lesser evil.
91
+ const lastDash = truncated.lastIndexOf("-");
92
+ const cut = lastDash > MAX_SLUG_LENGTH / 2 ? truncated.slice(0, lastDash) : truncated;
93
+ return cut.join("").replace(/-+$/g, "");
94
+ }
95
+ /**
96
+ * S228: the first free name in a "Name", "Name (2)", "Name (3)" series.
97
+ *
98
+ * Built for copy, where landing beside the original is the common case and
99
+ * refusing would make the feature useless.
100
+ *
101
+ * This is the FIRST auto-naming generator in the codebase, and that is
102
+ * deliberate rather than accidental: every other collision path refuses
103
+ * instead (ContentPathConflictError, MediaFolderNameConflictError, the
104
+ * assets 409, the templates unique alias). It lives here beside slugify
105
+ * because the two must agree: the NAME is suffixed and the slug follows
106
+ * from it, so "About Us (2)" becomes "/about-us-2" and there is never a
107
+ * second rule deciding what a URL looks like.
108
+ *
109
+ * A base that already carries a suffix continues its own series rather
110
+ * than nesting: "About Us (2)" becomes "About Us (3)", never
111
+ * "About Us (2) (2)". Copying a copy is the exact case that produces it.
112
+ *
113
+ * `taken` is the set of names already in use among the target's siblings.
114
+ * The database's unique (path, locale) index remains the real guarantee;
115
+ * this only decides what to try first.
116
+ */
117
+ export function nextAvailableName(base, taken) {
118
+ const used = new Set(taken);
119
+ if (!used.has(base))
120
+ return base;
121
+ // Continue an existing series instead of nesting suffixes.
122
+ const match = /^(.*?)\s*\((\d+)\)$/.exec(base);
123
+ const stem = match ? match[1] : base;
124
+ let counter = match ? Number(match[2]) + 1 : 2;
125
+ // Bounded rather than while(true): a caller passing a pathological
126
+ // `taken` set should get a wrong-ish name, not an infinite loop.
127
+ for (let attempt = 0; attempt < 10_000; attempt++) {
128
+ const candidate = `${stem} (${counter})`;
129
+ if (!used.has(candidate))
130
+ return candidate;
131
+ counter++;
132
+ }
133
+ return `${stem} (${Date.now()})`;
134
+ }
135
+ /** How many candidate slugs nextFreeSlug asks about before it gives up. */
136
+ export const NEXT_FREE_SLUG_ATTEMPTS = 200;
137
+ /**
138
+ * Splits "About Us (2)" into its stem and the number that follows it in
139
+ * the series, so a copy of a copy continues the series instead of nesting
140
+ * suffixes. A name with no whole trailing "(n)" is its own stem and the
141
+ * series starts at 2.
142
+ *
143
+ * A scan from the end, one character at a time: a name is whatever an
144
+ * editor typed, and this never looks at a character twice.
145
+ */
146
+ function seriesOf(name) {
147
+ const last = name.length - 1;
148
+ if (last < 2 || name.charAt(last) !== ")")
149
+ return { stem: name, next: 2 };
150
+ let at = last - 1;
151
+ while (at >= 0 && name.charAt(at) >= "0" && name.charAt(at) <= "9")
152
+ at -= 1;
153
+ const digits = name.slice(at + 1, last);
154
+ // More than 15 digits is no longer a number JavaScript counts exactly.
155
+ if (digits.length === 0 || digits.length > 15 || at < 0 || name.charAt(at) !== "(") {
156
+ return { stem: name, next: 2 };
157
+ }
158
+ return { stem: name.slice(0, at).trimEnd(), next: Number(digits) + 1 };
159
+ }
160
+ /** The slug of "<stem> (<number>)". slugify cuts a long slug at its
161
+ * ceiling, which would cut the number off and give every candidate of a
162
+ * long name the same slug, so the stem gives way to the number. */
163
+ function numberedSlug(stem, number) {
164
+ const suffix = `-${number}`;
165
+ const whole = slugify(`${stem} (${number})`);
166
+ if (whole === String(number) || whole.endsWith(suffix))
167
+ return whole;
168
+ let head = Array.from(slugify(stem)).slice(0, MAX_SLUG_LENGTH - suffix.length).join("");
169
+ while (head.endsWith("-"))
170
+ head = head.slice(0, -1);
171
+ return head === "" ? String(number) : `${head}${suffix}`;
172
+ }
173
+ /**
174
+ * S277e: the first name in the "Name", "Name (2)", "Name (3)" series whose
175
+ * SLUG is free, with that slug.
176
+ *
177
+ * nextAvailableName picks by display name. A copy needs the other
178
+ * question answered, because the path is what collides: two pages may
179
+ * share a display name, and a page whose rename has not been published
180
+ * still shows its old name in a list while its path has already moved.
181
+ * `isFree` is the caller's whole test for a candidate (an occupied path, a
182
+ * reserved name, a language code, a name another node owns as the first
183
+ * part of an address), so every reason a slug cannot be used is skipped the
184
+ * same way. It is handed the candidate's display name as well, so a caller
185
+ * that will not have two siblings share a display name can refuse the
186
+ * candidate for that too.
187
+ *
188
+ * The series continues an existing one as nextAvailableName does. A name
189
+ * with no letters or digits has no slug, so it is never asked about and
190
+ * the series starts at its "(2)". `isFree` is asked about one candidate at
191
+ * a time and at most NEXT_FREE_SLUG_ATTEMPTS times; after that the name
192
+ * carries a timestamp, unchecked, as nextAvailableName's does, and the
193
+ * database's unique index on the path stays the real guarantee.
194
+ */
195
+ export async function nextFreeSlug(baseName, isFree) {
196
+ let attempts = 0;
197
+ const baseSlug = slugify(baseName);
198
+ if (baseSlug !== "") {
199
+ attempts += 1;
200
+ if (await isFree(baseSlug, baseName))
201
+ return { name: baseName, slug: baseSlug };
202
+ }
203
+ const { stem, next } = seriesOf(baseName);
204
+ for (let number = next; attempts < NEXT_FREE_SLUG_ATTEMPTS; number += 1) {
205
+ const slug = numberedSlug(stem, number);
206
+ const name = `${stem} (${number})`;
207
+ attempts += 1;
208
+ if (await isFree(slug, name))
209
+ return { name, slug };
210
+ }
211
+ const stamp = Date.now();
212
+ return { name: `${stem} (${stamp})`, slug: numberedSlug(stem, stamp) };
213
+ }
214
+ /**
215
+ * The one URL that represents this page, for a canonical link and for the
216
+ * admin's links to the live page.
217
+ *
218
+ * The prefixed URL when the site has more than one culture, the bare path
219
+ * when it does not. `path` is the page's public address (`publicPath`), so
220
+ * "/" is the default site and its prefixed form is the bare language root
221
+ * ("/de").
222
+ *
223
+ * S233: moved here from apps/server/src/cultures/resolve-culture.ts so the
224
+ * admin links to exactly the URL the renderer serves.
225
+ */
226
+ export function canonicalPath(path, culture, prefixed) {
227
+ if (!prefixed)
228
+ return path;
229
+ return path === "/" ? `/${culture}` : `/${culture}${path}`;
230
+ }
231
+ /**
232
+ * A node's public address: its stored path with the default site's own
233
+ * segment removed. A node of any other site keeps its stored path.
234
+ * `defaultSitePath` is the default site's stored path ("/home"), or null
235
+ * when the install has no default site.
236
+ */
237
+ export function publicPath(storedPath, defaultSitePath) {
238
+ if (defaultSitePath === null)
239
+ return storedPath;
240
+ if (storedPath === defaultSitePath)
241
+ return "/";
242
+ if (storedPath.startsWith(`${defaultSitePath}/`))
243
+ return storedPath.slice(defaultSitePath.length);
244
+ return storedPath;
245
+ }
246
+ /**
247
+ * The first non-empty segment of a path: "/home" and "/home/about" give
248
+ * "home". "" for "/" or "".
249
+ *
250
+ * A path with no leading slash is read the same way ("home" gives "home"),
251
+ * because a direct caller of the service can pass one and the reserved-name
252
+ * check must judge the segment the server would route on.
253
+ */
254
+ export function firstSegment(path) {
255
+ let start = 0;
256
+ while (start < path.length && path.charAt(start) === "/")
257
+ start++;
258
+ const end = path.indexOf("/", start);
259
+ return path.slice(start, end === -1 ? undefined : end);
260
+ }
@@ -0,0 +1,20 @@
1
+ import { z } from "zod";
2
+ export declare const ContentTrashBodySchema: z.ZodOptional<z.ZodNullable<z.ZodObject<{
3
+ confirm: z.ZodOptional<z.ZodBoolean>;
4
+ }, z.core.$strip>>>;
5
+ export type ContentTrashBody = z.infer<typeof ContentTrashBodySchema>;
6
+ export declare const ContentTrashConfirmationSchema: z.ZodObject<{
7
+ requiresConfirmation: z.ZodLiteral<true>;
8
+ nodeName: z.ZodString;
9
+ descendantCount: z.ZodNumber;
10
+ message: z.ZodString;
11
+ }, z.core.$strip>;
12
+ export type ContentTrashConfirmation = z.infer<typeof ContentTrashConfirmationSchema>;
13
+ export declare const ContentTrashResultSchema: z.ZodObject<{
14
+ trashedCount: z.ZodNumber;
15
+ }, z.core.$strip>;
16
+ export type ContentTrashResult = z.infer<typeof ContentTrashResultSchema>;
17
+ export declare const ContentRestoreResultSchema: z.ZodObject<{
18
+ restoredCount: z.ZodNumber;
19
+ }, z.core.$strip>;
20
+ export type ContentRestoreResult = z.infer<typeof ContentRestoreResultSchema>;
@@ -0,0 +1,23 @@
1
+ import { z } from "zod";
2
+ // S154 content trash. The DELETE is two-step like the structured-data
3
+ // uninstall gate: unconfirmed → 409 naming the blast radius (the count
4
+ // the confirm dialog renders), confirmed → trash. Trash is SOFT —
5
+ // reversible via the restore route — so this is a plain confirmation,
6
+ // not the snapshot-gate treatment.
7
+ //
8
+ // Fastify substitutes `null` for a genuinely absent body before handing it
9
+ // to the validator — a DELETE sent with no payload at all lands here as
10
+ // `null`, not `undefined`. `.nullish()` (not `.optional()`) is required so
11
+ // an absent body validates; `request.body?.confirm` in the route handler
12
+ // already tolerates both null and undefined.
13
+ export const ContentTrashBodySchema = z
14
+ .object({ confirm: z.boolean().optional() })
15
+ .nullish();
16
+ export const ContentTrashConfirmationSchema = z.object({
17
+ requiresConfirmation: z.literal(true),
18
+ nodeName: z.string(),
19
+ descendantCount: z.number().int(),
20
+ message: z.string(),
21
+ });
22
+ export const ContentTrashResultSchema = z.object({ trashedCount: z.number().int() });
23
+ export const ContentRestoreResultSchema = z.object({ restoredCount: z.number().int() });
@@ -0,0 +1,152 @@
1
+ import { z } from "zod";
2
+ export declare const ContentTrashListQuerySchema: z.ZodObject<{
3
+ cursor: z.ZodOptional<z.ZodString>;
4
+ limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
5
+ }, z.core.$strip>;
6
+ export declare const TrashedSubtreeSchema: z.ZodObject<{
7
+ id: z.ZodString;
8
+ path: z.ZodString;
9
+ documentTypeId: z.ZodString;
10
+ deletedAt: z.ZodString;
11
+ nodeCount: z.ZodNumber;
12
+ orphaned: z.ZodBoolean;
13
+ name: z.ZodNullable<z.ZodString>;
14
+ access: z.ZodObject<{
15
+ read: z.ZodBoolean;
16
+ create: z.ZodBoolean;
17
+ update: z.ZodBoolean;
18
+ publish: z.ZodBoolean;
19
+ delete: z.ZodBoolean;
20
+ denied: z.ZodRecord<z.ZodEnum<{
21
+ "content.read": "content.read";
22
+ "content.create": "content.create";
23
+ "content.update": "content.update";
24
+ "content.publish": "content.publish";
25
+ "content.delete": "content.delete";
26
+ }> & z.core.$partial, z.ZodObject<{
27
+ reason: z.ZodEnum<{
28
+ "role-lacks-action": "role-lacks-action";
29
+ "not-granted": "not-granted";
30
+ }>;
31
+ decidedAt: z.ZodNullable<z.ZodObject<{
32
+ nodeId: z.ZodString;
33
+ path: z.ZodNullable<z.ZodString>;
34
+ name: z.ZodNullable<z.ZodString>;
35
+ mode: z.ZodEnum<{
36
+ restricted: "restricted";
37
+ open: "open";
38
+ }>;
39
+ grants: z.ZodArray<z.ZodObject<{
40
+ subjectKind: z.ZodEnum<{
41
+ role: "role";
42
+ user: "user";
43
+ }>;
44
+ subjectId: z.ZodString;
45
+ label: z.ZodNullable<z.ZodString>;
46
+ }, z.core.$strip>>;
47
+ }, z.core.$strip>>;
48
+ }, z.core.$strip>>;
49
+ }, z.core.$strip>;
50
+ }, z.core.$strip>;
51
+ export declare const ContentTrashListResponseSchema: z.ZodObject<{
52
+ items: z.ZodArray<z.ZodObject<{
53
+ id: z.ZodString;
54
+ path: z.ZodString;
55
+ documentTypeId: z.ZodString;
56
+ deletedAt: z.ZodString;
57
+ nodeCount: z.ZodNumber;
58
+ orphaned: z.ZodBoolean;
59
+ name: z.ZodNullable<z.ZodString>;
60
+ access: z.ZodObject<{
61
+ read: z.ZodBoolean;
62
+ create: z.ZodBoolean;
63
+ update: z.ZodBoolean;
64
+ publish: z.ZodBoolean;
65
+ delete: z.ZodBoolean;
66
+ denied: z.ZodRecord<z.ZodEnum<{
67
+ "content.read": "content.read";
68
+ "content.create": "content.create";
69
+ "content.update": "content.update";
70
+ "content.publish": "content.publish";
71
+ "content.delete": "content.delete";
72
+ }> & z.core.$partial, z.ZodObject<{
73
+ reason: z.ZodEnum<{
74
+ "role-lacks-action": "role-lacks-action";
75
+ "not-granted": "not-granted";
76
+ }>;
77
+ decidedAt: z.ZodNullable<z.ZodObject<{
78
+ nodeId: z.ZodString;
79
+ path: z.ZodNullable<z.ZodString>;
80
+ name: z.ZodNullable<z.ZodString>;
81
+ mode: z.ZodEnum<{
82
+ restricted: "restricted";
83
+ open: "open";
84
+ }>;
85
+ grants: z.ZodArray<z.ZodObject<{
86
+ subjectKind: z.ZodEnum<{
87
+ role: "role";
88
+ user: "user";
89
+ }>;
90
+ subjectId: z.ZodString;
91
+ label: z.ZodNullable<z.ZodString>;
92
+ }, z.core.$strip>>;
93
+ }, z.core.$strip>>;
94
+ }, z.core.$strip>>;
95
+ }, z.core.$strip>;
96
+ }, z.core.$strip>>;
97
+ nextCursor: z.ZodNullable<z.ZodString>;
98
+ }, z.core.$strip>;
99
+ export declare const ContentRestoreBlockedSchema: z.ZodObject<{
100
+ message: z.ZodString;
101
+ blockingAncestorPath: z.ZodString;
102
+ }, z.core.$strip>;
103
+ export declare const ContentRestorePathOccupiedSchema: z.ZodObject<{
104
+ message: z.ZodString;
105
+ path: z.ZodString;
106
+ }, z.core.$strip>;
107
+ export declare const ContentRestoreOrphanSchema: z.ZodObject<{
108
+ message: z.ZodString;
109
+ }, z.core.$strip>;
110
+ export declare const ContentRestoreNameTakenSchema: z.ZodObject<{
111
+ message: z.ZodString;
112
+ reason: z.ZodLiteral<"name-taken">;
113
+ cause: z.ZodEnum<{
114
+ taken: "taken";
115
+ reserved: "reserved";
116
+ language: "language";
117
+ }>;
118
+ slug: z.ZodString;
119
+ heldByPath: z.ZodNullable<z.ZodString>;
120
+ }, z.core.$strip>;
121
+ export declare const ContentRestoreLimitSchema: z.ZodObject<{
122
+ message: z.ZodString;
123
+ reason: z.ZodLiteral<"restriction-limit">;
124
+ }, z.core.$strip>;
125
+ export declare const ContentRestoreConflictSchema: z.ZodUnion<readonly [z.ZodObject<{
126
+ message: z.ZodString;
127
+ reason: z.ZodLiteral<"name-taken">;
128
+ cause: z.ZodEnum<{
129
+ taken: "taken";
130
+ reserved: "reserved";
131
+ language: "language";
132
+ }>;
133
+ slug: z.ZodString;
134
+ heldByPath: z.ZodNullable<z.ZodString>;
135
+ }, z.core.$strip>, z.ZodObject<{
136
+ message: z.ZodString;
137
+ reason: z.ZodLiteral<"restriction-limit">;
138
+ }, z.core.$strip>, z.ZodObject<{
139
+ message: z.ZodString;
140
+ blockingAncestorPath: z.ZodString;
141
+ }, z.core.$strip>, z.ZodObject<{
142
+ message: z.ZodString;
143
+ path: z.ZodString;
144
+ }, z.core.$strip>, z.ZodObject<{
145
+ message: z.ZodString;
146
+ }, z.core.$strip>]>;
147
+ export type ContentTrashListQuery = z.infer<typeof ContentTrashListQuerySchema>;
148
+ export type ContentTrashListResponse = z.infer<typeof ContentTrashListResponseSchema>;
149
+ export type TrashedSubtreeDto = z.infer<typeof TrashedSubtreeSchema>;
150
+ export type ContentRestoreBlocked = z.infer<typeof ContentRestoreBlockedSchema>;
151
+ export type ContentRestoreNameTaken = z.infer<typeof ContentRestoreNameTakenSchema>;
152
+ export type ContentRestoreLimit = z.infer<typeof ContentRestoreLimitSchema>;
@@ -0,0 +1,82 @@
1
+ import { z } from "zod";
2
+ import { NodeAccessFlagsSchema } from "./node-access.schema.js";
3
+ // S161: the trash browse surface. Separate from content-trash-api.schema.ts
4
+ // (S154's trash/restore confirmation bodies) — this file is the list route
5
+ // and the restore-blocked 409, added a session later.
6
+ export const ContentTrashListQuerySchema = z.object({
7
+ cursor: z.string().optional(),
8
+ limit: z.coerce.number().int().min(1).max(100).default(50),
9
+ });
10
+ export const TrashedSubtreeSchema = z.object({
11
+ id: z.string(),
12
+ path: z.string(),
13
+ documentTypeId: z.string(),
14
+ deletedAt: z.string(),
15
+ nodeCount: z.number().int().nonnegative(),
16
+ // True when the node's parent was permanently removed rather than
17
+ // trashed. Such a row cannot be restored (the restore route answers 409),
18
+ // and the UI says so in place of a Restore button.
19
+ orphaned: z.boolean(),
20
+ // S279 (D10): the row is decided for the signed-in person as the live tree
21
+ // decides a row, each action as a read of a trashed page is decided (the
22
+ // page's own entries, those under it and those of its trashed ancestors;
23
+ // an orphan is the admin role's alone). A row whose read is refused keeps
24
+ // its place (id, type, time, counts) and is sent with a null name and its
25
+ // path's last segment alone (`/<segment>`), so the pages above it are not
26
+ // named (A3).
27
+ // `name` is otherwise the page's name, or its last path segment when it
28
+ // has none recorded.
29
+ name: z.string().nullable(),
30
+ access: NodeAccessFlagsSchema,
31
+ });
32
+ export const ContentTrashListResponseSchema = z.object({
33
+ items: z.array(TrashedSubtreeSchema),
34
+ nextCursor: z.string().nullable(),
35
+ });
36
+ export const ContentRestoreBlockedSchema = z.object({
37
+ message: z.string(),
38
+ blockingAncestorPath: z.string(),
39
+ });
40
+ // S277b: the other two 409s of a restore. A live page now holds one of the
41
+ // addresses (`path` names it), or the page it was under is gone for good.
42
+ export const ContentRestorePathOccupiedSchema = z.object({
43
+ message: z.string(),
44
+ path: z.string(),
45
+ });
46
+ export const ContentRestoreOrphanSchema = z.object({
47
+ message: z.string(),
48
+ });
49
+ // S277e: the fourth 409 of a restore. A name the restore would bring back
50
+ // is now owned as the first part of an address: by a top-level page or a
51
+ // page directly under one (`heldByPath` names it), or by the server or a
52
+ // language (`heldByPath` is null, and the message says which). `slug` is
53
+ // the name at fault, which is the restored page's own or that of a page
54
+ // directly under it. `reason` is what tells this body from the others.
55
+ // `cause` says which of the three it is, so a client can say it in its own
56
+ // words: "taken" (a page holds the name, `heldByPath`), "reserved" (the
57
+ // server's own first segments) or "language" (a language of the site).
58
+ export const ContentRestoreNameTakenSchema = z.object({
59
+ message: z.string(),
60
+ reason: z.literal("name-taken"),
61
+ cause: z.enum(["taken", "reserved", "language"]),
62
+ slug: z.string(),
63
+ heldByPath: z.string().nullable(),
64
+ });
65
+ // S278: the fifth 409 of a restore. Restricted pages in the trash are not
66
+ // counted by the limit of pages that carry restrictions, and count again
67
+ // once they are back; this restore would bring back more of them than the
68
+ // limit leaves room for. Nothing was restored. `message` is the limit's own
69
+ // sentence, the one a refused save of the permissions tab carries.
70
+ export const ContentRestoreLimitSchema = z.object({
71
+ message: z.string(),
72
+ reason: z.literal("restriction-limit"),
73
+ });
74
+ // Most specific body first: a union answers with the first member that parses,
75
+ // and a plain z.object strips keys it does not know.
76
+ export const ContentRestoreConflictSchema = z.union([
77
+ ContentRestoreNameTakenSchema,
78
+ ContentRestoreLimitSchema,
79
+ ContentRestoreBlockedSchema,
80
+ ContentRestorePathOccupiedSchema,
81
+ ContentRestoreOrphanSchema,
82
+ ]);