@cosmicdrift/kumiko-bundled-features 0.377.0 → 0.379.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 (669) hide show
  1. package/dist/account-security/feature.js +2 -2
  2. package/dist/account-security/index.d.ts +2 -2
  3. package/dist/account-security/index.js +2 -2
  4. package/dist/account-security/{constants.js → web/constants.js} +0 -1
  5. package/dist/account-security/{i18n.js → web/i18n.js} +0 -1
  6. package/dist/admin-shell/feature.js +4 -3
  7. package/dist/admin-shell/index.d.ts +2 -2
  8. package/dist/admin-shell/index.js +2 -2
  9. package/dist/admin-shell/web/client-plugin.js +2 -3
  10. package/dist/admin-shell/{constants.js → web/constants.js} +0 -1
  11. package/dist/admin-shell/web/default-translations.d.ts +2 -0
  12. package/dist/admin-shell/web/default-translations.js +4 -0
  13. package/dist/admin-shell/web/i18n.d.ts +5 -2
  14. package/dist/admin-shell/web/i18n.js +50 -5
  15. package/dist/admin-shell/web/index.js +0 -1
  16. package/dist/audit/feature.js +58 -59
  17. package/dist/audit/handlers/audit-events.d.ts +102 -0
  18. package/dist/audit/handlers/audit-events.js +112 -0
  19. package/dist/audit/handlers/audit-system-db.d.ts +1 -0
  20. package/dist/audit/handlers/audit-system-db.js +9 -0
  21. package/dist/audit/handlers/details-all-tenants.query.d.ts +15 -0
  22. package/dist/audit/handlers/details-all-tenants.query.js +20 -0
  23. package/dist/audit/handlers/details.query.d.ts +2 -1
  24. package/dist/audit/handlers/details.query.js +8 -24
  25. package/dist/audit/handlers/list-all-tenants.query.d.ts +41 -0
  26. package/dist/audit/handlers/list-all-tenants.query.js +32 -0
  27. package/dist/audit/handlers/list.query.d.ts +2 -1
  28. package/dist/audit/handlers/list.query.js +9 -99
  29. package/dist/audit/handlers/resolve-audit-tenant.d.ts +3 -1
  30. package/dist/audit/handlers/resolve-audit-tenant.js +21 -7
  31. package/dist/audit/index.d.ts +1 -1
  32. package/dist/audit/index.js +1 -1
  33. package/dist/audit/run-escape-hatch-retention.js +1 -1
  34. package/dist/audit/screens.d.ts +65 -0
  35. package/dist/audit/screens.js +73 -0
  36. package/dist/audit/web/client-plugin.js +2 -3
  37. package/dist/audit/{constants.d.ts → web/constants.d.ts} +8 -0
  38. package/dist/audit/{constants.js → web/constants.js} +8 -1
  39. package/dist/audit/web/default-translations.d.ts +2 -0
  40. package/dist/audit/web/default-translations.js +3 -0
  41. package/dist/audit/web/i18n.d.ts +5 -2
  42. package/dist/audit/web/i18n.js +31 -4
  43. package/dist/audit/web/index.js +0 -1
  44. package/dist/auth-email-password/bootstrap.d.ts +1 -1
  45. package/dist/auth-email-password/bootstrap.js +4 -4
  46. package/dist/auth-email-password/errors.js +1 -1
  47. package/dist/auth-email-password/feature.js +2 -2
  48. package/dist/auth-email-password/handlers/confirm-account-unlock.write.js +1 -1
  49. package/dist/auth-email-password/handlers/invite-accept-with-login.write.js +1 -1
  50. package/dist/auth-email-password/handlers/invite-create.write.d.ts +1 -1
  51. package/dist/auth-email-password/handlers/invite-create.write.js +3 -3
  52. package/dist/auth-email-password/handlers/invite-info.query.js +1 -1
  53. package/dist/auth-email-password/handlers/login.write.d.ts +1 -0
  54. package/dist/auth-email-password/handlers/login.write.js +26 -1
  55. package/dist/auth-email-password/handlers/request-account-unlock.write.js +1 -1
  56. package/dist/auth-email-password/handlers/request-email-verification.write.js +1 -1
  57. package/dist/auth-email-password/handlers/request-password-reset.write.js +1 -1
  58. package/dist/auth-email-password/handlers/reset-password.write.js +1 -1
  59. package/dist/auth-email-password/handlers/verify-email.write.js +1 -1
  60. package/dist/auth-email-password/index.d.ts +1 -1
  61. package/dist/auth-email-password/index.js +1 -1
  62. package/dist/auth-email-password/mail-notifications.js +1 -1
  63. package/dist/auth-email-password/signup-activation.js +1 -1
  64. package/dist/auth-email-password/web/auth-client.js +0 -1
  65. package/dist/auth-email-password/web/auth-form-logic.js +0 -1
  66. package/dist/auth-email-password/web/auth-form-primitives.js +0 -1
  67. package/dist/auth-email-password/web/auth-gate.js +0 -1
  68. package/dist/auth-email-password/web/auth-redirect.js +0 -1
  69. package/dist/auth-email-password/web/client-actions.js +0 -1
  70. package/dist/auth-email-password/web/client-plugin.js +1 -2
  71. package/dist/auth-email-password/web/confirm-account-unlock-screen.js +0 -1
  72. package/dist/auth-email-password/{constants.js → web/constants.js} +3 -6
  73. package/dist/auth-email-password/web/default-topbar-actions.js +0 -1
  74. package/dist/auth-email-password/web/forgot-password-screen.js +0 -1
  75. package/dist/auth-email-password/{i18n.js → web/i18n.js} +3 -4
  76. package/dist/auth-email-password/web/index.d.ts +1 -1
  77. package/dist/auth-email-password/web/index.js +1 -2
  78. package/dist/auth-email-password/web/invite-accept-screen.d.ts +2 -2
  79. package/dist/auth-email-password/web/invite-accept-screen.js +0 -1
  80. package/dist/auth-email-password/web/login-screen.js +0 -1
  81. package/dist/auth-email-password/{mail-i18n.js → web/mail-i18n.js} +0 -1
  82. package/dist/auth-email-password/web/request-account-unlock-screen.js +0 -1
  83. package/dist/auth-email-password/web/reset-password-screen.js +0 -1
  84. package/dist/auth-email-password/web/session-bootstrap-error.js +0 -1
  85. package/dist/auth-email-password/web/session.js +0 -1
  86. package/dist/auth-email-password/web/signup-complete-screen.d.ts +2 -2
  87. package/dist/auth-email-password/web/signup-complete-screen.js +0 -1
  88. package/dist/auth-email-password/web/signup-screen.js +0 -1
  89. package/dist/auth-email-password/web/tenant-menu-items.js +0 -1
  90. package/dist/auth-email-password/web/tenant-switcher.js +0 -1
  91. package/dist/auth-email-password/web/use-shell-user.js +0 -1
  92. package/dist/auth-email-password/web/user-menu.js +0 -1
  93. package/dist/auth-email-password/web/verify-email-screen.js +0 -1
  94. package/dist/auth-mfa/errors.d.ts +1 -1
  95. package/dist/auth-mfa/errors.js +2 -2
  96. package/dist/auth-mfa/handlers/enable-confirm-preauth.write.js +1 -1
  97. package/dist/auth-mfa/handlers/enable-start-preauth.write.js +1 -1
  98. package/dist/auth-mfa/handlers/enable-start.write.js +1 -1
  99. package/dist/auth-mfa/handlers/verify.write.js +1 -1
  100. package/dist/auth-mfa/index.d.ts +1 -1
  101. package/dist/auth-mfa/index.js +1 -1
  102. package/dist/auth-mfa/mfa-status-checker.js +1 -1
  103. package/dist/auth-mfa/screens.js +1 -1
  104. package/dist/auth-mfa/web/client-plugin.js +0 -1
  105. package/dist/auth-mfa/{constants.js → web/constants.js} +0 -1
  106. package/dist/auth-mfa/web/i18n.js +0 -1
  107. package/dist/auth-mfa/web/index.js +0 -1
  108. package/dist/auth-mfa/web/mfa-client.js +0 -1
  109. package/dist/auth-mfa/web/mfa-disable-dialog.js +1 -2
  110. package/dist/auth-mfa/web/mfa-recovery-codes-reveal.js +0 -1
  111. package/dist/auth-mfa/web/mfa-regenerate-recovery-dialog.js +1 -2
  112. package/dist/auth-mfa/web/mfa-setup-preauth-screen.js +11 -18
  113. package/dist/auth-mfa/web/mfa-verify-screen.js +0 -1
  114. package/dist/billing-foundation/checkout-core.js +1 -1
  115. package/dist/billing-foundation/consumer-protection/consent-text.d.ts +2 -2
  116. package/dist/billing-foundation/consumer-protection/consent-text.js +1 -1
  117. package/dist/billing-foundation/consumer-protection/issue-confirmation.js +7 -3
  118. package/dist/billing-foundation/consumer-protection/mail-notifications.js +3 -1
  119. package/dist/billing-foundation/consumer-protection/register-consent.js +1 -1
  120. package/dist/billing-foundation/consumer-protection/register-termination.js +8 -2
  121. package/dist/billing-foundation/consumer-protection/stored-user-email.d.ts +1 -0
  122. package/dist/billing-foundation/consumer-protection/stored-user-email.js +8 -0
  123. package/dist/billing-foundation/consumer-protection/termination-mail.d.ts +5 -1
  124. package/dist/billing-foundation/consumer-protection/termination-mail.js +3 -1
  125. package/dist/billing-foundation/consumer-protection/termination-notify.js +1 -1
  126. package/dist/billing-foundation/consumer-protection/termination-pages.js +109 -15
  127. package/dist/billing-foundation/consumer-protection/termination-record.d.ts +8 -1
  128. package/dist/billing-foundation/consumer-protection/termination-record.js +76 -3
  129. package/dist/billing-foundation/consumer-protection/termination-request.js +33 -6
  130. package/dist/billing-foundation/consumer-protection/termination-revoke.d.ts +28 -0
  131. package/dist/billing-foundation/consumer-protection/termination-revoke.js +149 -0
  132. package/dist/billing-foundation/consumer-protection/termination-texts.d.ts +17 -1
  133. package/dist/billing-foundation/consumer-protection/termination-texts.js +39 -0
  134. package/dist/billing-foundation/events.d.ts +9 -0
  135. package/dist/billing-foundation/events.js +14 -2
  136. package/dist/billing-foundation/feature.js +1 -1
  137. package/dist/billing-foundation/handlers/process-event.write.d.ts +5 -1
  138. package/dist/billing-foundation/handlers/process-event.write.js +57 -3
  139. package/dist/billing-foundation/handlers/switch-plan.write.js +1 -1
  140. package/dist/billing-foundation/handlers/sync-subscription.write.js +1 -1
  141. package/dist/billing-foundation/index.d.ts +2 -2
  142. package/dist/billing-foundation/index.js +2 -2
  143. package/dist/billing-foundation/plan-catalog.js +1 -1
  144. package/dist/billing-foundation/screens.js +1 -1
  145. package/dist/billing-foundation/subscription-tier-sync.js +1 -1
  146. package/dist/billing-foundation/types.d.ts +14 -2
  147. package/dist/billing-foundation/types.js +1 -1
  148. package/dist/billing-foundation/validate-options.js +3 -3
  149. package/dist/billing-foundation/web/billing-contact-plan.js +1 -2
  150. package/dist/billing-foundation/web/billing-plans-panel.js +1 -2
  151. package/dist/billing-foundation/web/cancel-contract-dialog.js +1 -2
  152. package/dist/billing-foundation/web/checkout-consent-dialog.js +1 -2
  153. package/dist/billing-foundation/web/client-plugin.js +1 -1
  154. package/dist/billing-foundation/{constants.d.ts → web/constants.d.ts} +21 -14
  155. package/dist/billing-foundation/{constants.js → web/constants.js} +35 -31
  156. package/dist/billing-foundation/{consumer-protection → web/consumer-protection}/consent-locale.js +0 -1
  157. package/dist/billing-foundation/{contact-card.js → web/contact-card.js} +0 -1
  158. package/dist/billing-foundation/web/index.d.ts +2 -2
  159. package/dist/billing-foundation/web/index.js +2 -3
  160. package/dist/billing-foundation/web/localized-params.js +0 -1
  161. package/dist/billing-foundation/webhook-handler.js +4 -1
  162. package/dist/cap-counter/stock-cap-guard.js +8 -0
  163. package/dist/cap-overview/feature.js +1 -1
  164. package/dist/cap-overview/handlers/caps-usage.query.js +1 -1
  165. package/dist/cap-overview/handlers/tenant-caps-list.query.js +2 -2
  166. package/dist/cap-overview/index.d.ts +2 -2
  167. package/dist/cap-overview/index.js +2 -2
  168. package/dist/cap-overview/screens.js +1 -1
  169. package/dist/cap-overview/web/cap-cards-panel.js +1 -1
  170. package/dist/cap-overview/web/cap-usage-bar.js +1 -2
  171. package/dist/cap-overview/web/client-plugin.js +1 -1
  172. package/dist/cap-overview/{constants.js → web/constants.js} +0 -1
  173. package/dist/cap-overview/web/index.js +0 -1
  174. package/dist/cap-overview/{usage-math.d.ts → web/usage-math.d.ts} +1 -1
  175. package/dist/compliance-profiles/feature.js +1 -1
  176. package/dist/compliance-profiles/index.d.ts +1 -1
  177. package/dist/compliance-profiles/index.js +1 -1
  178. package/dist/compliance-profiles/web/client-plugin.js +1 -2
  179. package/dist/compliance-profiles/web/compliance-profile-catalog.js +1 -2
  180. package/dist/compliance-profiles/{constants.js → web/constants.js} +0 -1
  181. package/dist/compliance-profiles/web/index.js +0 -1
  182. package/dist/config/index.d.ts +1 -1
  183. package/dist/config/index.js +1 -1
  184. package/dist/config/web/client-plugin.d.ts +1 -1
  185. package/dist/config/web/client-plugin.js +1 -2
  186. package/dist/config/{constants.js → web/constants.js} +0 -1
  187. package/dist/config/web/i18n.js +1 -1
  188. package/dist/config/web/index.d.ts +1 -1
  189. package/dist/config/web/index.js +1 -2
  190. package/dist/config/write-helpers.js +1 -1
  191. package/dist/custom-fields/feature.js +1 -1
  192. package/dist/custom-fields/handlers/clear-custom-field.write.js +1 -1
  193. package/dist/custom-fields/handlers/define-tenant-field.write.js +1 -1
  194. package/dist/custom-fields/handlers/delete-system-field.write.js +1 -1
  195. package/dist/custom-fields/handlers/delete-tenant-field.write.js +1 -1
  196. package/dist/custom-fields/handlers/set-custom-field.write.js +1 -1
  197. package/dist/custom-fields/handlers/update-tenant-field.write.js +1 -1
  198. package/dist/custom-fields/index.d.ts +1 -1
  199. package/dist/custom-fields/index.js +1 -1
  200. package/dist/custom-fields/lib/value-schema.js +1 -1
  201. package/dist/custom-fields/schemas.js +1 -1
  202. package/dist/custom-fields/web/client-plugin.js +1 -2
  203. package/dist/custom-fields/{constants.js → web/constants.js} +18 -19
  204. package/dist/custom-fields/web/custom-fields-form-section.js +1 -2
  205. package/dist/custom-fields/web/i18n.js +0 -1
  206. package/dist/custom-fields/web/index.d.ts +1 -1
  207. package/dist/custom-fields/web/index.js +1 -2
  208. package/dist/custom-fields/wire-for-entity.js +1 -1
  209. package/dist/delivery/address-opt-out.js +1 -1
  210. package/dist/delivery/attempt-log-retention.js +21 -3
  211. package/dist/delivery/constants.d.ts +1 -1
  212. package/dist/delivery/constants.js +2 -2
  213. package/dist/delivery/i18n.js +1 -1
  214. package/dist/delivery/unsubscribe-page.js +1 -1
  215. package/dist/delivery/web/client-plugin.js +1 -1
  216. package/dist/delivery/web/delivery-channel-cell.js +0 -1
  217. package/dist/delivery/web/delivery-error-cell.js +0 -1
  218. package/dist/delivery/web/delivery-status-cell.js +1 -2
  219. package/dist/delivery/web/delivery-time-cell.js +0 -1
  220. package/dist/delivery/web/delivery-type-cell.js +0 -1
  221. package/dist/delivery/web/index.js +0 -1
  222. package/dist/delivery/{public-names.js → web/public-names.js} +0 -1
  223. package/dist/document-ingest-foundation/events.d.ts +1 -0
  224. package/dist/document-ingest-foundation/events.js +3 -0
  225. package/dist/document-ingest-foundation/executor.js +2 -1
  226. package/dist/document-ingest-foundation/feature.js +16 -5
  227. package/dist/document-ingest-foundation/index.d.ts +1 -1
  228. package/dist/document-ingest-foundation/index.js +1 -1
  229. package/dist/feature-toggles/feature.d.ts +1 -1
  230. package/dist/feature-toggles/feature.js +2 -2
  231. package/dist/feature-toggles/handlers/list.query.js +1 -1
  232. package/dist/feature-toggles/handlers/registered.query.js +1 -1
  233. package/dist/feature-toggles/handlers/set.write.js +1 -1
  234. package/dist/feature-toggles/index.d.ts +1 -1
  235. package/dist/feature-toggles/index.js +1 -1
  236. package/dist/feature-toggles/web/client-plugin.js +1 -2
  237. package/dist/feature-toggles/{constants.js → web/constants.js} +0 -1
  238. package/dist/feature-toggles/web/index.js +0 -1
  239. package/dist/folders/feature.js +1 -1
  240. package/dist/folders/handlers/clear-folder.write.js +1 -1
  241. package/dist/folders/handlers/delete-folder.write.js +1 -1
  242. package/dist/folders/handlers/set-folder.write.js +1 -1
  243. package/dist/folders/index.d.ts +1 -1
  244. package/dist/folders/index.js +1 -1
  245. package/dist/folders/web/client-plugin.js +1 -2
  246. package/dist/folders/{constants.js → web/constants.js} +0 -1
  247. package/dist/folders/web/folder-manager.js +1 -2
  248. package/dist/folders/web/folder-section.js +1 -2
  249. package/dist/folders/web/i18n.js +0 -1
  250. package/dist/folders/web/index.d.ts +1 -1
  251. package/dist/folders/web/index.js +1 -2
  252. package/dist/folders/web/tree.js +0 -1
  253. package/dist/form-draft/db/queries/cleanup.d.ts +3 -2
  254. package/dist/form-draft/db/queries/cleanup.js +18 -9
  255. package/dist/form-draft/decrypt-draft.d.ts +2 -0
  256. package/dist/form-draft/decrypt-draft.js +19 -0
  257. package/dist/form-draft/entity.js +6 -9
  258. package/dist/form-draft/feature.js +1 -1
  259. package/dist/form-draft/handlers/cleanup.job.d.ts +1 -0
  260. package/dist/form-draft/handlers/cleanup.job.js +17 -4
  261. package/dist/form-draft/handlers/discard.write.js +1 -1
  262. package/dist/form-draft/handlers/get.query.js +6 -7
  263. package/dist/form-draft/handlers/list.query.js +11 -7
  264. package/dist/form-draft/handlers/save.write.js +1 -1
  265. package/dist/form-draft/index.d.ts +1 -1
  266. package/dist/form-draft/index.js +1 -1
  267. package/dist/form-draft/lookup.d.ts +2 -2
  268. package/dist/form-draft/lookup.js +7 -2
  269. package/dist/form-draft/schemas.js +1 -1
  270. package/dist/form-draft/{constants.js → web/constants.js} +0 -1
  271. package/dist/form-draft-user-data/hooks.js +2 -2
  272. package/dist/inbound-mail-foundation/handlers/list-accounts.query.d.ts +1 -1
  273. package/dist/inbound-mail-foundation/handlers/list-accounts.query.js +11 -3
  274. package/dist/inbound-mail-foundation/retention-sweep.js +7 -5
  275. package/dist/jobs/feature.js +2 -2
  276. package/dist/jobs/handlers/retry.write.js +1 -1
  277. package/dist/jobs/handlers/trigger.write.js +1 -1
  278. package/dist/jobs/index.d.ts +1 -1
  279. package/dist/jobs/index.js +1 -1
  280. package/dist/jobs/web/client-plugin.js +2 -3
  281. package/dist/jobs/{constants.js → web/constants.js} +0 -1
  282. package/dist/jobs/web/default-translations.d.ts +2 -0
  283. package/dist/jobs/web/default-translations.js +3 -0
  284. package/dist/jobs/web/i18n.d.ts +5 -2
  285. package/dist/jobs/web/i18n.js +51 -4
  286. package/dist/jobs/web/index.js +0 -1
  287. package/dist/ledger/entity.d.ts +1 -1
  288. package/dist/ledger/entity.js +1 -1
  289. package/dist/ledger/feature.js +1 -1
  290. package/dist/ledger/handlers/confirm-schedule-period.write.js +2 -5
  291. package/dist/ledger/handlers/create-transaction.write.js +1 -1
  292. package/dist/ledger/handlers/reports.query.js +1 -1
  293. package/dist/ledger/handlers/reverse-transaction.write.js +1 -1
  294. package/dist/ledger/index.d.ts +1 -1
  295. package/dist/ledger/index.js +1 -1
  296. package/dist/ledger/recurring.d.ts +1 -1
  297. package/dist/ledger/reports.d.ts +1 -1
  298. package/dist/ledger/schemas.js +1 -1
  299. package/dist/ledger/{constants.js → web/constants.js} +0 -1
  300. package/dist/ledger/web/index.d.ts +1 -1
  301. package/dist/ledger/web/index.js +1 -2
  302. package/dist/legal-pages/feature.d.ts +1 -1
  303. package/dist/legal-pages/feature.js +1 -1
  304. package/dist/legal-pages/index.d.ts +1 -1
  305. package/dist/legal-pages/index.js +1 -1
  306. package/dist/legal-pages/lib/boot-check.d.ts +1 -1
  307. package/dist/legal-pages/lib/boot-check.js +1 -1
  308. package/dist/legal-pages/lib/validate-routes.d.ts +1 -1
  309. package/dist/legal-pages/web/client-plugin.js +1 -2
  310. package/dist/legal-pages/{constants.js → web/constants.js} +6 -8
  311. package/dist/legal-pages/web/index.js +0 -1
  312. package/dist/mail-foundation/i18n.d.ts +5 -2
  313. package/dist/mail-foundation/i18n.js +3 -2
  314. package/dist/mail-transport-smtp/i18n.d.ts +1 -1
  315. package/dist/mail-transport-smtp/i18n.js +1 -1
  316. package/dist/managed-pages/feature.js +1 -1
  317. package/dist/managed-pages/web/client-plugin.js +1 -2
  318. package/dist/managed-pages/web/default-translations.d.ts +2 -0
  319. package/dist/managed-pages/web/default-translations.js +11 -0
  320. package/dist/managed-pages/web/i18n.d.ts +5 -2
  321. package/dist/managed-pages/web/i18n.js +53 -12
  322. package/dist/managed-pages/web/index.d.ts +1 -1
  323. package/dist/managed-pages/web/index.js +1 -2
  324. package/dist/metrics/compute.d.ts +1 -1
  325. package/dist/metrics/compute.js +1 -1
  326. package/dist/metrics/feature.js +1 -1
  327. package/dist/metrics/index.d.ts +1 -1
  328. package/dist/metrics/index.js +1 -1
  329. package/dist/metrics/types.d.ts +1 -1
  330. package/dist/metrics/validate.js +1 -1
  331. package/dist/metrics/{constants.js → web/constants.js} +0 -1
  332. package/dist/metrics/window.d.ts +1 -1
  333. package/dist/notes-history/feature.js +1 -1
  334. package/dist/notes-history/handlers/add-note.write.js +1 -1
  335. package/dist/notes-history/index.d.ts +1 -1
  336. package/dist/notes-history/index.js +1 -1
  337. package/dist/notes-history/web/client-plugin.js +1 -2
  338. package/dist/notes-history/{constants.js → web/constants.js} +0 -1
  339. package/dist/notes-history/web/i18n.js +0 -1
  340. package/dist/notes-history/web/index.d.ts +1 -1
  341. package/dist/notes-history/web/index.js +1 -2
  342. package/dist/notes-history/web/notes-section.js +2 -3
  343. package/dist/personal-access-tokens/feature.d.ts +2 -2
  344. package/dist/personal-access-tokens/feature.js +6 -4
  345. package/dist/personal-access-tokens/handlers/available-scopes.query.d.ts +1 -1
  346. package/dist/personal-access-tokens/handlers/create.write.js +1 -1
  347. package/dist/personal-access-tokens/handlers/revoke.write.js +1 -1
  348. package/dist/personal-access-tokens/hash.js +1 -1
  349. package/dist/personal-access-tokens/i18n.d.ts +1 -1
  350. package/dist/personal-access-tokens/i18n.js +1 -1
  351. package/dist/personal-access-tokens/index.d.ts +5 -5
  352. package/dist/personal-access-tokens/index.js +3 -3
  353. package/dist/personal-access-tokens/resolver.d.ts +1 -1
  354. package/dist/personal-access-tokens/resolver.js +1 -1
  355. package/dist/personal-access-tokens/schema/api-token.js +1 -1
  356. package/dist/personal-access-tokens/screens.d.ts +1 -1
  357. package/dist/personal-access-tokens/screens.js +1 -1
  358. package/dist/personal-access-tokens/{constants.js → web/constants.js} +0 -1
  359. package/dist/presets/index.d.ts +0 -1
  360. package/dist/presets/index.js +0 -1
  361. package/dist/presets/security-baseline.d.ts +1 -1
  362. package/dist/presets/security-baseline.js +1 -1
  363. package/dist/secrets/feature.js +1 -1
  364. package/dist/secrets/handlers/delete.write.js +1 -1
  365. package/dist/secrets/handlers/list.query.js +1 -1
  366. package/dist/secrets/handlers/set.write.js +1 -1
  367. package/dist/secrets/i18n.js +1 -1
  368. package/dist/secrets/index.d.ts +1 -1
  369. package/dist/secrets/index.js +1 -1
  370. package/dist/secrets/{constants.js → web/constants.js} +0 -1
  371. package/dist/secrets/write-gate.js +1 -1
  372. package/dist/sessions/feature.js +7 -4
  373. package/dist/sessions/{i18n.js → web/i18n.js} +0 -1
  374. package/dist/shared/index.d.ts +1 -1
  375. package/dist/shared/index.js +1 -1
  376. package/dist/shared/purge-files-reaching-subject.js +7 -3
  377. package/dist/subscription-stripe/feature.js +2 -1
  378. package/dist/subscription-stripe/plugin-methods.d.ts +3 -0
  379. package/dist/subscription-stripe/plugin-methods.js +14 -0
  380. package/dist/subscription-stripe/verify-webhook.js +1 -0
  381. package/dist/tags/feature.js +1 -1
  382. package/dist/tags/handlers/assign-tag.write.js +11 -7
  383. package/dist/tags/handlers/create-tag.write.js +1 -1
  384. package/dist/tags/handlers/delete-tag.write.js +4 -1
  385. package/dist/tags/handlers/remove-tag.write.js +1 -1
  386. package/dist/tags/handlers/update-tag.write.js +1 -1
  387. package/dist/tags/index.d.ts +1 -1
  388. package/dist/tags/index.js +1 -1
  389. package/dist/tags/screens.js +1 -1
  390. package/dist/tags/web/client-plugin.js +1 -2
  391. package/dist/tags/{constants.d.ts → web/constants.d.ts} +1 -0
  392. package/dist/tags/{constants.js → web/constants.js} +3 -1
  393. package/dist/tags/web/entity-tags.js +1 -2
  394. package/dist/tags/web/i18n.js +2 -2
  395. package/dist/tags/web/index.d.ts +1 -1
  396. package/dist/tags/web/index.js +1 -2
  397. package/dist/tags/web/tag-filter.js +1 -2
  398. package/dist/tags/web/tag-manager.js +5 -4
  399. package/dist/tags/web/tag-picker.js +0 -1
  400. package/dist/tags/web/tag-section.js +1 -2
  401. package/dist/tags/web/tags-cell.js +1 -2
  402. package/dist/template-resolver/api.d.ts +21 -23
  403. package/dist/template-resolver/api.js +34 -6
  404. package/dist/template-resolver/compile-document-body.d.ts +3 -0
  405. package/dist/template-resolver/compile-document-body.js +51 -4
  406. package/dist/template-resolver/compile-steps-block.js +2 -2
  407. package/dist/template-resolver/document-ops.d.ts +1 -1
  408. package/dist/template-resolver/document-ops.js +3 -3
  409. package/dist/template-resolver/document-sanitizer.d.ts +2 -2
  410. package/dist/template-resolver/document-sanitizer.js +23 -3
  411. package/dist/template-resolver/feature.d.ts +11 -0
  412. package/dist/template-resolver/feature.js +68 -35
  413. package/dist/template-resolver/handlers/by-slug.query.js +6 -1
  414. package/dist/template-resolver/handlers/by-tenant.query.js +6 -2
  415. package/dist/template-resolver/handlers/collection-item.query.js +2 -1
  416. package/dist/template-resolver/handlers/collection-list.query.js +2 -1
  417. package/dist/template-resolver/handlers/collection-set.write.d.ts +2 -1
  418. package/dist/template-resolver/handlers/collection-set.write.js +15 -3
  419. package/dist/template-resolver/handlers/collection-shared.d.ts +1 -2
  420. package/dist/template-resolver/handlers/collection-shared.js +0 -4
  421. package/dist/template-resolver/handlers/copy-locale.write.d.ts +2 -1
  422. package/dist/template-resolver/handlers/copy-locale.write.js +69 -65
  423. package/dist/template-resolver/handlers/diff-to-system.query.js +5 -1
  424. package/dist/template-resolver/handlers/discard-draft.write.d.ts +3 -2
  425. package/dist/template-resolver/handlers/discard-draft.write.js +19 -7
  426. package/dist/template-resolver/handlers/document-base.d.ts +1 -1
  427. package/dist/template-resolver/handlers/document-base.js +6 -1
  428. package/dist/template-resolver/handlers/document-blocks.query.d.ts +1 -1
  429. package/dist/template-resolver/handlers/document-blocks.query.js +2 -2
  430. package/dist/template-resolver/handlers/export-bundle.query.js +5 -2
  431. package/dist/template-resolver/handlers/find-by-id.query.js +4 -2
  432. package/dist/template-resolver/handlers/import-bundle.write.d.ts +2 -1
  433. package/dist/template-resolver/handlers/import-bundle.write.js +30 -25
  434. package/dist/template-resolver/handlers/layout-source.query.js +5 -5
  435. package/dist/template-resolver/handlers/list.query.js +5 -2
  436. package/dist/template-resolver/handlers/overview.query.d.ts +12 -3
  437. package/dist/template-resolver/handlers/overview.query.js +87 -51
  438. package/dist/template-resolver/handlers/patch-draft.write.d.ts +2 -1
  439. package/dist/template-resolver/handlers/patch-draft.write.js +93 -87
  440. package/dist/template-resolver/handlers/reset-to-system.write.d.ts +2 -1
  441. package/dist/template-resolver/handlers/reset-to-system.write.js +51 -44
  442. package/dist/template-resolver/handlers/resource-link-pdf.write.d.ts +2 -1
  443. package/dist/template-resolver/handlers/resource-link-pdf.write.js +34 -28
  444. package/dist/template-resolver/handlers/resource-remove.write.d.ts +2 -1
  445. package/dist/template-resolver/handlers/resource-remove.write.js +39 -33
  446. package/dist/template-resolver/handlers/resource-shared.js +1 -1
  447. package/dist/template-resolver/handlers/resource-upload.write.d.ts +2 -1
  448. package/dist/template-resolver/handlers/resource-upload.write.js +105 -97
  449. package/dist/template-resolver/handlers/send-test-shared.d.ts +5 -0
  450. package/dist/template-resolver/handlers/send-test-shared.js +19 -0
  451. package/dist/template-resolver/handlers/send-test-status.query.d.ts +9 -0
  452. package/dist/template-resolver/handlers/send-test-status.query.js +18 -0
  453. package/dist/template-resolver/handlers/send-test.write.d.ts +2 -1
  454. package/dist/template-resolver/handlers/send-test.write.js +89 -91
  455. package/dist/template-resolver/handlers/set.write.d.ts +2 -1
  456. package/dist/template-resolver/handlers/set.write.js +95 -91
  457. package/dist/template-resolver/handlers/shared.js +1 -1
  458. package/dist/template-resolver/handlers/template-gates.d.ts +1 -1
  459. package/dist/template-resolver/handlers/template-gates.js +1 -1
  460. package/dist/template-resolver/handlers/template-write.d.ts +1 -1
  461. package/dist/template-resolver/handlers/template-write.js +1 -1
  462. package/dist/template-resolver/handlers/toggle-status.write.d.ts +6 -7
  463. package/dist/template-resolver/handlers/toggle-status.write.js +28 -10
  464. package/dist/template-resolver/handlers/upsert-tenant.write.d.ts +2 -1
  465. package/dist/template-resolver/handlers/upsert-tenant.write.js +30 -24
  466. package/dist/template-resolver/handlers/usage.query.js +3 -2
  467. package/dist/template-resolver/handlers/validate.query.d.ts +1 -1
  468. package/dist/template-resolver/handlers/validate.query.js +3 -1
  469. package/dist/template-resolver/i18n.d.ts +3 -0
  470. package/dist/template-resolver/i18n.js +24 -0
  471. package/dist/template-resolver/index.d.ts +8 -5
  472. package/dist/template-resolver/index.js +6 -4
  473. package/dist/template-resolver/layout-appearance.js +1 -1
  474. package/dist/template-resolver/layout-regions.d.ts +1 -1
  475. package/dist/template-resolver/seeding.d.ts +4 -1
  476. package/dist/template-resolver/seeding.js +13 -7
  477. package/dist/template-resolver/store-template-resource.js +2 -2
  478. package/dist/template-resolver/table.js +1 -1
  479. package/dist/template-resolver/template-bundle.js +2 -2
  480. package/dist/template-resolver/template-delivery-policy.d.ts +22 -0
  481. package/dist/template-resolver/template-delivery-policy.js +40 -0
  482. package/dist/template-resolver/template-draft.d.ts +1 -1
  483. package/dist/template-resolver/template-draft.js +1 -1
  484. package/dist/template-resolver/template-edit-policy.d.ts +22 -0
  485. package/dist/template-resolver/template-edit-policy.js +45 -0
  486. package/dist/template-resolver/template-meta.d.ts +2 -2
  487. package/dist/template-resolver/template-meta.js +2 -2
  488. package/dist/template-resolver/template-preview.d.ts +1 -1
  489. package/dist/template-resolver/template-preview.js +15 -6
  490. package/dist/template-resolver/template-usage.d.ts +1 -1
  491. package/dist/template-resolver/template-usage.js +1 -1
  492. package/dist/template-resolver/template-validation.js +34 -14
  493. package/dist/template-resolver/testing.js +1 -1
  494. package/dist/template-resolver/user-content-table.js +1 -1
  495. package/dist/template-resolver/web/client-plugin.js +1 -2
  496. package/dist/template-resolver/{constants.d.ts → web/constants.d.ts} +4 -1
  497. package/dist/template-resolver/{constants.js → web/constants.js} +9 -10
  498. package/dist/template-resolver/{document-blocks.d.ts → web/document-blocks.d.ts} +2 -2
  499. package/dist/template-resolver/{document-blocks.js → web/document-blocks.js} +1 -0
  500. package/dist/template-resolver/web/document-editor-extensions.d.ts +1 -0
  501. package/dist/template-resolver/web/document-editor-extensions.js +22 -2
  502. package/dist/template-resolver/web/document-editor.js +0 -1
  503. package/dist/template-resolver/web/document-images.d.ts +2 -0
  504. package/dist/template-resolver/web/document-images.js +27 -0
  505. package/dist/template-resolver/{document-schema.d.ts → web/document-schema.d.ts} +2 -1
  506. package/dist/template-resolver/{document-schema.js → web/document-schema.js} +4 -1
  507. package/dist/template-resolver/{document-steps.js → web/document-steps.js} +0 -1
  508. package/dist/template-resolver/web/document-tiptap-editor.d.ts +1 -1
  509. package/dist/template-resolver/web/document-tiptap-editor.js +24 -9
  510. package/dist/template-resolver/web/document-toolbar-blocks.d.ts +4 -2
  511. package/dist/template-resolver/web/document-toolbar-blocks.js +1 -1
  512. package/dist/template-resolver/web/editor-handle.js +1 -1
  513. package/dist/template-resolver/web/i18n.js +5 -1
  514. package/dist/template-resolver/web/index.d.ts +3 -3
  515. package/dist/template-resolver/web/index.js +3 -4
  516. package/dist/template-resolver/{mail-constants.js → web/mail-constants.js} +0 -1
  517. package/dist/template-resolver/{pdf-constants.js → web/pdf-constants.js} +0 -1
  518. package/dist/template-resolver/web/placeholder-line-editor-lazy.js +0 -1
  519. package/dist/template-resolver/web/placeholder-line-editor.js +6 -4
  520. package/dist/template-resolver/{qualified-names.d.ts → web/qualified-names.d.ts} +2 -0
  521. package/dist/template-resolver/{qualified-names.js → web/qualified-names.js} +2 -1
  522. package/dist/template-resolver/web/use-stable-by-key.js +0 -1
  523. package/dist/tenant/handlers/add-member.write.js +1 -1
  524. package/dist/tenant/index.d.ts +1 -1
  525. package/dist/tenant/index.js +1 -1
  526. package/dist/tenant/invitation-table.js +1 -1
  527. package/dist/tenant/invited-membership.js +1 -1
  528. package/dist/tenant/last-tenant-admin.js +1 -1
  529. package/dist/tenant/member-role-options.js +1 -1
  530. package/dist/tenant/screens.js +1 -1
  531. package/dist/tenant/web/client-plugin.js +1 -2
  532. package/dist/tenant/{constants.js → web/constants.js} +3 -6
  533. package/dist/tenant/web/index.js +0 -1
  534. package/dist/tenant/web/member-roles-cell.js +0 -1
  535. package/dist/tenant/web/member-status-cell.js +0 -1
  536. package/dist/tenant-lifecycle/stages.js +2 -3
  537. package/dist/tier-engine/entity.d.ts +1 -1
  538. package/dist/tier-engine/entity.js +1 -1
  539. package/dist/tier-engine/feature.js +2 -2
  540. package/dist/tier-engine/handlers/set-tenant-tier.write.js +1 -1
  541. package/dist/tier-engine/index.d.ts +1 -1
  542. package/dist/tier-engine/index.js +1 -1
  543. package/dist/tier-engine/web/client-plugin.js +2 -3
  544. package/dist/tier-engine/{constants.js → web/constants.js} +2 -3
  545. package/dist/tier-engine/{i18n.js → web/i18n.js} +0 -1
  546. package/dist/tier-engine/web/index.js +0 -1
  547. package/dist/user/handlers/create.write.js +1 -1
  548. package/dist/user/handlers/update-roles.js +1 -1
  549. package/dist/user/handlers/update.write.js +1 -1
  550. package/dist/user/index.d.ts +1 -1
  551. package/dist/user/index.js +1 -1
  552. package/dist/user/invited-global-roles.d.ts +1 -1
  553. package/dist/user/invited-global-roles.js +1 -1
  554. package/dist/user/schema/user.js +1 -1
  555. package/dist/user/{constants.js → web/constants.js} +0 -1
  556. package/dist/user-data-rights/env.js +1 -1
  557. package/dist/user-data-rights/feature.js +3 -3
  558. package/dist/user-data-rights/index.d.ts +1 -1
  559. package/dist/user-data-rights/index.js +1 -1
  560. package/dist/user-data-rights/lib/resolve-tenant-model.js +1 -1
  561. package/dist/user-data-rights/mail-notifications.js +1 -1
  562. package/dist/user-data-rights/web/client-plugin.js +2 -3
  563. package/dist/user-data-rights/web/confirm-deletion-screen.js +0 -1
  564. package/dist/user-data-rights/{constants.js → web/constants.js} +11 -12
  565. package/dist/user-data-rights/web/default-translations.d.ts +2 -0
  566. package/dist/user-data-rights/web/default-translations.js +59 -0
  567. package/dist/user-data-rights/web/i18n.d.ts +5 -2
  568. package/dist/user-data-rights/web/i18n.js +37 -59
  569. package/dist/user-data-rights/web/index.d.ts +1 -1
  570. package/dist/user-data-rights/web/index.js +1 -2
  571. package/dist/user-data-rights/web/privacy-center-screen.js +1 -2
  572. package/dist/user-data-rights/web/request-deletion-screen.js +0 -1
  573. package/dist/user-data-rights-defaults/hooks/file-ref.userdata-hook.js +6 -1
  574. package/dist/user-profile/feature.js +1 -1
  575. package/dist/user-profile/handlers/change-email.write.js +1 -1
  576. package/dist/user-profile/index.d.ts +1 -1
  577. package/dist/user-profile/index.js +1 -1
  578. package/dist/user-profile/web/client-plugin.js +2 -3
  579. package/dist/user-profile/{constants.js → web/constants.js} +0 -1
  580. package/dist/user-profile/{i18n.js → web/i18n.js} +0 -1
  581. package/dist/user-profile/web/profile-screen.js +2 -3
  582. package/dist/waitlist/entity.js +1 -1
  583. package/dist/waitlist/feature.js +1 -1
  584. package/dist/waitlist/handlers/export-purge.write.js +1 -1
  585. package/dist/waitlist/handlers/invite.write.js +1 -1
  586. package/dist/waitlist/handlers/reject.write.js +1 -1
  587. package/dist/waitlist/handlers/submit.write.js +4 -3
  588. package/dist/waitlist/import.d.ts +1 -1
  589. package/dist/waitlist/index.d.ts +1 -1
  590. package/dist/waitlist/index.js +1 -1
  591. package/dist/waitlist/legacy-migrate.js +1 -1
  592. package/dist/waitlist/link-on-signup.js +1 -1
  593. package/dist/waitlist/mail.d.ts +0 -1
  594. package/dist/waitlist/mail.js +6 -4
  595. package/dist/waitlist/payloads.js +1 -1
  596. package/dist/waitlist/screens.js +1 -1
  597. package/dist/waitlist/{constants.js → web/constants.js} +0 -1
  598. package/kumiko-es-tables.json +102 -0
  599. package/package.json +30 -29
  600. package/src/audit/changes.json +7 -0
  601. package/src/auth-email-password/changes.json +6 -0
  602. package/src/auth-mfa/changes.json +6 -0
  603. package/src/billing-foundation/changes.json +18 -0
  604. package/src/cap-counter/changes.json +12 -0
  605. package/src/delivery/changes.json +6 -0
  606. package/src/document-ingest-foundation/changes.json +6 -0
  607. package/src/files/changes.json +7 -0
  608. package/src/form-draft/changes.json +7 -0
  609. package/src/inbound-mail-foundation/changes.json +6 -0
  610. package/src/ledger/changes.json +7 -0
  611. package/src/mail-foundation/changes.json +6 -0
  612. package/src/presets/changes.json +7 -0
  613. package/src/tags/changes.json +6 -0
  614. package/src/template-resolver/changes.json +63 -0
  615. package/src/user-data-rights/changes.json +14 -0
  616. package/src/waitlist/changes.json +6 -0
  617. package/dist/admin-shell/i18n.d.ts +0 -5
  618. package/dist/admin-shell/i18n.js +0 -51
  619. package/dist/audit/i18n.d.ts +0 -5
  620. package/dist/audit/i18n.js +0 -22
  621. package/dist/jobs/i18n.d.ts +0 -5
  622. package/dist/jobs/i18n.js +0 -52
  623. package/dist/managed-pages/i18n.d.ts +0 -5
  624. package/dist/managed-pages/i18n.js +0 -55
  625. package/dist/presets/dsgvo-self-service.d.ts +0 -10
  626. package/dist/presets/dsgvo-self-service.js +0 -24
  627. package/dist/user-data-rights/i18n.d.ts +0 -5
  628. package/dist/user-data-rights/i18n.js +0 -39
  629. /package/dist/account-security/{constants.d.ts → web/constants.d.ts} +0 -0
  630. /package/dist/account-security/{i18n.d.ts → web/i18n.d.ts} +0 -0
  631. /package/dist/admin-shell/{constants.d.ts → web/constants.d.ts} +0 -0
  632. /package/dist/auth-email-password/{constants.d.ts → web/constants.d.ts} +0 -0
  633. /package/dist/auth-email-password/{i18n.d.ts → web/i18n.d.ts} +0 -0
  634. /package/dist/auth-email-password/{mail-i18n.d.ts → web/mail-i18n.d.ts} +0 -0
  635. /package/dist/auth-mfa/{constants.d.ts → web/constants.d.ts} +0 -0
  636. /package/dist/billing-foundation/{consumer-protection → web/consumer-protection}/consent-locale.d.ts +0 -0
  637. /package/dist/billing-foundation/{contact-card.d.ts → web/contact-card.d.ts} +0 -0
  638. /package/dist/cap-overview/{constants.d.ts → web/constants.d.ts} +0 -0
  639. /package/dist/cap-overview/{usage-math.js → web/usage-math.js} +0 -0
  640. /package/dist/compliance-profiles/{constants.d.ts → web/constants.d.ts} +0 -0
  641. /package/dist/config/{constants.d.ts → web/constants.d.ts} +0 -0
  642. /package/dist/custom-fields/{constants.d.ts → web/constants.d.ts} +0 -0
  643. /package/dist/delivery/{public-names.d.ts → web/public-names.d.ts} +0 -0
  644. /package/dist/feature-toggles/{constants.d.ts → web/constants.d.ts} +0 -0
  645. /package/dist/folders/{constants.d.ts → web/constants.d.ts} +0 -0
  646. /package/dist/form-draft/{constants.d.ts → web/constants.d.ts} +0 -0
  647. /package/dist/jobs/{constants.d.ts → web/constants.d.ts} +0 -0
  648. /package/dist/ledger/{constants.d.ts → web/constants.d.ts} +0 -0
  649. /package/dist/legal-pages/{constants.d.ts → web/constants.d.ts} +0 -0
  650. /package/dist/metrics/{constants.d.ts → web/constants.d.ts} +0 -0
  651. /package/dist/notes-history/{constants.d.ts → web/constants.d.ts} +0 -0
  652. /package/dist/personal-access-tokens/{constants.d.ts → web/constants.d.ts} +0 -0
  653. /package/dist/personal-access-tokens/{scopes.d.ts → web/scopes.d.ts} +0 -0
  654. /package/dist/personal-access-tokens/{scopes.js → web/scopes.js} +0 -0
  655. /package/dist/secrets/{constants.d.ts → web/constants.d.ts} +0 -0
  656. /package/dist/sessions/{i18n.d.ts → web/i18n.d.ts} +0 -0
  657. /package/dist/template-resolver/{document-steps.d.ts → web/document-steps.d.ts} +0 -0
  658. /package/dist/template-resolver/{mail-constants.d.ts → web/mail-constants.d.ts} +0 -0
  659. /package/dist/template-resolver/{pdf-constants.d.ts → web/pdf-constants.d.ts} +0 -0
  660. /package/dist/template-resolver/{placeholder-text.d.ts → web/placeholder-text.d.ts} +0 -0
  661. /package/dist/template-resolver/{placeholder-text.js → web/placeholder-text.js} +0 -0
  662. /package/dist/tenant/{constants.d.ts → web/constants.d.ts} +0 -0
  663. /package/dist/tier-engine/{constants.d.ts → web/constants.d.ts} +0 -0
  664. /package/dist/tier-engine/{i18n.d.ts → web/i18n.d.ts} +0 -0
  665. /package/dist/user/{constants.d.ts → web/constants.d.ts} +0 -0
  666. /package/dist/user-data-rights/{constants.d.ts → web/constants.d.ts} +0 -0
  667. /package/dist/user-profile/{constants.d.ts → web/constants.d.ts} +0 -0
  668. /package/dist/user-profile/{i18n.d.ts → web/i18n.d.ts} +0 -0
  669. /package/dist/waitlist/{constants.d.ts → web/constants.d.ts} +0 -0
@@ -1,4 +1,3 @@
1
- // @runtime client
2
1
  // Default translation bundle for the tags UI. tagsClient() hangs it into the
3
2
  // LocaleProvider as a fallback bundle — apps override individual keys via
4
3
  // tagsClient({ translations }). Keys follow `tags.<area>.<slug>`.
@@ -22,7 +21,8 @@ export const defaultTranslations = {
22
21
  "tags.manage.toggle": "Toggle label",
23
22
  "tags.manage.usage": "{count}×",
24
23
  "tags.manage.deleteConfirmTitle": "Delete label “{name}”?",
25
- "tags.manage.deleteConfirmDesc": "Removes it from {count} objects. This can't be undone.",
24
+ "tags.manage.deleteConfirmDesc.one": "Removes it from 1 object. This can't be undone.",
25
+ "tags.manage.deleteConfirmDesc.other": "Removes it from {count} objects. This can't be undone.",
26
26
  "tags.picker.title": "Tags",
27
27
  "tags.picker.done": "Done",
28
28
  "tags.filter.label": "Filter by tag",
@@ -1,5 +1,5 @@
1
- export { TAGS_COLUMN_RENDERER_NAME, TAGS_EDIT_SCREEN_ID, TAGS_FILTER_EXTENSION_NAME, TAGS_SCREEN_ID, TAGS_SECTION_EXTENSION_NAME, TagsHandlers, TagsQueries, } from "../constants.ts";
2
1
  export { tagsClient } from "./client-plugin.tsx";
2
+ export { TAGS_COLUMN_RENDERER_NAME, TAGS_EDIT_SCREEN_ID, TAGS_FILTER_EXTENSION_NAME, TAGS_SCREEN_ID, TAGS_SECTION_EXTENSION_NAME, TagsHandlers, TagsQueries, } from "./constants.ts";
3
3
  export { EntityTags } from "./entity-tags.tsx";
4
4
  export { contrastText, TagChip } from "./tag-chip.tsx";
5
5
  export { TagFilter } from "./tag-filter.tsx";
@@ -1,6 +1,5 @@
1
- // @runtime client
2
- export { TAGS_COLUMN_RENDERER_NAME, TAGS_EDIT_SCREEN_ID, TAGS_FILTER_EXTENSION_NAME, TAGS_SCREEN_ID, TAGS_SECTION_EXTENSION_NAME, TagsHandlers, TagsQueries, } from "../constants.js";
3
1
  export { tagsClient } from "./client-plugin.js";
2
+ export { TAGS_COLUMN_RENDERER_NAME, TAGS_EDIT_SCREEN_ID, TAGS_FILTER_EXTENSION_NAME, TAGS_SCREEN_ID, TAGS_SECTION_EXTENSION_NAME, TagsHandlers, TagsQueries, } from "./constants.js";
4
3
  export { EntityTags } from "./entity-tags.js";
5
4
  export { contrastText, TagChip } from "./tag-chip.js";
6
5
  export { TagFilter } from "./tag-filter.js";
@@ -1,5 +1,4 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- // @runtime client
3
2
  // TagFilter — a drop-in tag filter for ANY entityList toolbar. Register it as
4
3
  // the list's header slot (`screen.slots.header`); the renderer passes it the
5
4
  // list's screenId, and picking tags resolves the matching row ids and narrows
@@ -15,7 +14,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
15
14
  // server-side `entitiesByTag` query + a server-side join filter instead.
16
15
  import { useListUrlState, usePrimitives, useQuery, useTranslation, } from "@cosmicdrift/kumiko-renderer";
17
16
  import { useState } from "react";
18
- import { TagsQueries } from "../constants.js";
17
+ import { TagsQueries } from "./constants.js";
19
18
  import { TagChip } from "./tag-chip.js";
20
19
  import { TagPicker } from "./tag-picker.js";
21
20
  // Tags chosen but zero matching entities → filter to a value that matches no row
@@ -1,5 +1,4 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- // @runtime client
3
2
  // TagManager — the shared tag-catalog UI, GitLab-labels style. Built ONCE,
4
3
  // mounted twice:
5
4
  // - standalone: <TagManager /> → the Tags admin screen
@@ -11,8 +10,9 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
11
10
  // per-tenant catalog. Selection is buffered by the caller (TagPicker) and only
12
11
  // applied on confirm — managing labels and picking them are separate concerns.
13
12
  import { useDispatcher, usePrimitives, useQuery, useTranslation, } from "@cosmicdrift/kumiko-renderer";
13
+ import { pluralKey } from "@cosmicdrift/kumiko-renderer/headless";
14
14
  import { useState } from "react";
15
- import { TagsHandlers, TagsQueries } from "../constants.js";
15
+ import { TagsHandlers, TagsQueries } from "./constants.js";
16
16
  import { TagChip } from "./tag-chip.js";
17
17
  // A small fixed palette so labels stay visually distinct without a color-wheel
18
18
  // dependency; the hex field below still accepts any custom value.
@@ -66,6 +66,7 @@ export function TagManager({ entityType, selection, }) {
66
66
  const usage = new Map();
67
67
  for (const a of assignments.data?.rows ?? [])
68
68
  usage.set(a.tagId, (usage.get(a.tagId) ?? 0) + 1);
69
+ const deletingUsage = usage.get(deleting?.id ?? "") ?? 0;
69
70
  const selecting = selection !== undefined;
70
71
  const allTags = catalog.data?.rows ?? [];
71
72
  const tags = selecting
@@ -162,7 +163,7 @@ export function TagManager({ entityType, selection, }) {
162
163
  return (_jsxs("div", { "data-testid": "tag-manager", className: "flex flex-col gap-4", children: [_jsxs("div", { className: "flex flex-col gap-2 rounded-md border p-3", children: [_jsx(Field, { id: "tag-manager-new-name", label: t("tags.manage.newLabel"), children: _jsx(Input, { kind: "text", id: "tag-manager-new-name", name: "newTagName", value: newName, onChange: setNewName, placeholder: t("tags.manage.namePlaceholder") }) }), _jsx(ColorPicker, { value: newColor, onChange: setNewColor, idPrefix: "tag-manager-new-color" }), !selecting && (_jsx(Field, { id: "tag-manager-new-scope", label: t("tags.manage.scopeLabel"), children: _jsx(Input, { kind: "text", id: "tag-manager-new-scope", name: "newTagScope", value: newScope, onChange: setNewScope, placeholder: t("tags.manage.scopePlaceholder") }) })), _jsx("div", { children: _jsx(Button, { variant: "primary", disabled: busy || newName.trim() === "", onClick: () => createTag(), testId: "tag-manager-create", children: busy ? t("tags.section.working") : t("tags.manage.create") }) })] }), tags.length === 0 ? (_jsx(Banner, { variant: "info", testId: "tag-manager-empty", children: _jsx(Text, { children: t("tags.section.empty") }) })) : (_jsx("div", { className: "flex flex-col gap-1", children: tags.map((tag) => editingId === tag.id ? (_jsxs("div", { "data-testid": `tag-manager-edit-${tag.id}`, className: "flex flex-col gap-2 rounded-md border p-3", children: [_jsx(Input, { kind: "text", id: `tag-edit-name-${tag.id}`, name: "editName", value: editName, onChange: setEditName }), _jsx(ColorPicker, { value: editColor, onChange: setEditColor, idPrefix: `tag-edit-color-${tag.id}` }), _jsx(Input, { kind: "text", id: `tag-edit-scope-${tag.id}`, name: "editScope", value: editScope, onChange: setEditScope, placeholder: t("tags.manage.scopePlaceholder") }), _jsxs("div", { className: "flex gap-2", children: [_jsx(Button, { variant: "primary", disabled: busy || editName.trim() === "", onClick: () => saveEdit(tag), testId: `tag-manager-save-${tag.id}`, children: t("tags.manage.save") }), _jsx(Button, { variant: "secondary", disabled: busy, onClick: () => setEditingId(null), children: t("tags.manage.cancel") })] })] }, tag.id)) : (_jsxs("div", { "data-testid": `tag-manager-row-${tag.id}`, className: "flex items-center gap-2 rounded-md px-2 py-1 hover:bg-muted", children: [selecting && (_jsx(Button, { variant: selection?.value.includes(tag.id) ? "primary" : "secondary", onClick: () => toggle(tag.id), testId: `tag-manager-toggle-${tag.id}`, children: selection?.value.includes(tag.id) ? "✓" : "+" })), _jsx(TagChip, { name: tag.name, color: tag.color }), !selecting && (tag.scope ?? "") !== "" && (_jsx(Text, { variant: "small", children: `@${tag.scope}` })), _jsx(Text, { variant: "small", children: t("tags.manage.usage", { count: usage.get(tag.id) ?? 0 }) }), _jsxs("div", { className: "ml-auto flex gap-1", children: [_jsx(Button, { variant: "secondary", disabled: busy, onClick: () => startEdit(tag), testId: `tag-manager-edit-btn-${tag.id}`, children: t("tags.manage.edit") }), _jsx(Button, { variant: "danger", disabled: busy, onClick: () => setDeleting(tag), testId: `tag-manager-delete-btn-${tag.id}`, children: t("tags.manage.delete") })] })] }, tag.id))) })), errorKey !== null && (_jsx(Banner, { variant: "error", testId: "tag-manager-action-error", children: _jsx(Text, { children: t(errorKey) }) })), _jsx(Dialog, { open: deleting !== null, onOpenChange: (open) => {
163
164
  if (!open)
164
165
  setDeleting(null);
165
- }, title: t("tags.manage.deleteConfirmTitle", { name: deleting?.name ?? "" }), description: t("tags.manage.deleteConfirmDesc", {
166
- count: usage.get(deleting?.id ?? "") ?? 0,
166
+ }, title: t("tags.manage.deleteConfirmTitle", { name: deleting?.name ?? "" }), description: t(pluralKey("tags.manage.deleteConfirmDesc", deletingUsage), {
167
+ count: deletingUsage,
167
168
  }), confirmLabel: t("tags.manage.delete"), variant: "danger", onConfirm: confirmDelete, testId: "tag-manager-delete-dialog" })] }));
168
169
  }
@@ -1,5 +1,4 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- // @runtime client
3
2
  // TagPicker — the shared "manage + pick labels" modal. Wraps TagManager in
4
3
  // select-mode inside a Dialog: the user can create/recolor/delete labels (those
5
4
  // hit the catalog immediately) and toggle which ones apply (buffered). On
@@ -1,5 +1,4 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- // @runtime client
3
2
  // TagSection — drop-in tag editor for ANY entity, GitLab-labels style. Shows the
4
3
  // entity's tags as colored chips plus an "Edit tags" button that opens the
5
4
  // shared TagPicker modal (pick + manage). Applying the picker diffs the
@@ -14,7 +13,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
14
13
  // (RenderEdit passes { entityName, entityId }).
15
14
  import { useDispatcher, usePrimitives, useQuery, useTranslation, } from "@cosmicdrift/kumiko-renderer";
16
15
  import { useState } from "react";
17
- import { TagsHandlers, TagsQueries } from "../constants.js";
16
+ import { TagsHandlers, TagsQueries } from "./constants.js";
18
17
  import { TagChip } from "./tag-chip.js";
19
18
  import { TagPicker } from "./tag-picker.js";
20
19
  // What changed between the entity's current tags and the picker's new selection.
@@ -1,5 +1,4 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- // @runtime client
3
2
  // TagsCell — a reusable columnRenderer that shows an entity's tags as colored
4
3
  // chips inline in a list row. Drop it into ANY entityList by declaring a labeled
5
4
  // virtual column (no host-schema change), after mounting tagsClient():
@@ -16,7 +15,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
16
15
  // calls, so the whole column shares two queries, not two-per-row. For huge
17
16
  // assignment sets add a server-side entitiesByTag query + join filter.
18
17
  import { useQuery } from "@cosmicdrift/kumiko-renderer";
19
- import { TagsQueries } from "../constants.js";
18
+ import { TagsQueries } from "./constants.js";
20
19
  import { TagChip } from "./tag-chip.js";
21
20
  export function TagsCell({ row }) {
22
21
  const entityId = String(row["id"] ?? "");
@@ -1,10 +1,12 @@
1
1
  import type { DbRunner, TenantDb } from "@cosmicdrift/kumiko-framework/db";
2
- import type { SessionUser, TenantId } from "@cosmicdrift/kumiko-framework/engine";
2
+ import type { Registry, SessionUser, TenantId } from "@cosmicdrift/kumiko-framework/engine";
3
3
  import type { Temporal } from "@cosmicdrift/kumiko-types/temporal";
4
4
  import type { FileAttachmentRef } from "../renderer-foundation/index.ts";
5
- import type { ContentFormat, TemplateKind } from "./constants.ts";
6
5
  import { type TemplatePdfAttachmentLink } from "./linked-resources.ts";
6
+ import { type TemplateResourceRow } from "./table.ts";
7
+ import { type TemplateDeliveryPolicy } from "./template-delivery-policy.ts";
7
8
  import { type TemplateMeta } from "./template-meta.ts";
9
+ import type { ContentFormat, TemplateKind } from "./web/constants.ts";
8
10
  export type TemplateResource = {
9
11
  readonly id: string;
10
12
  readonly version: number;
@@ -46,15 +48,11 @@ export type ResolveLayoutRequest = {
46
48
  };
47
49
  export type TemplateResolverApi = {
48
50
  /**
49
- * Findet ein konkretes Template by (tenantId, slug, kind, locale).
50
- * Kein Locale-Fallback, keine Override-Hierarchie — Raw-Lookup für
51
- * Admin-UI-Edits und Konformitäts-Tests. Für Render-Aufrufe immer
52
- * `resolveTemplate` nutzen.
51
+ * Raw lookup by (tenantId, slug, kind, locale): no locale fallback, no override
52
+ * hierarchy. Render paths must use `resolveTemplate`. `scope: "system"` forces
53
+ * SYSTEM_TENANT_ID and ignores the passed tenantId.
53
54
  *
54
- * `scope: "system"` zwingt Lookup gegen SYSTEM_TENANT_ID (ignoriert
55
- * den übergebenen tenantId). Default = Lookup gegen den übergebenen
56
- * tenantId direkt (Caller wählt entweder Tenant oder System per
57
- * tenantId).
55
+ * Tenant rows of a template that is not tenantEditable are not returned.
58
56
  */
59
57
  readonly findExact: (args: {
60
58
  readonly tenantId: TenantId;
@@ -64,18 +62,10 @@ export type TemplateResolverApi = {
64
62
  readonly scope?: "system";
65
63
  }) => Promise<TemplateResource | null>;
66
64
  /**
67
- * Resolver mit 4-Stufen-Fallback (siehe template-resolver.md):
68
- * 1. tenant + requested-locale
69
- * 2. system + requested-locale
70
- * 3. tenant + FALLBACK_LOCALE
71
- * 4. system + FALLBACK_LOCALE
72
- * Resource-Substitution wird hier NICHT ausgeführt — das macht der
73
- * Caller (renderer-foundation-Plugin) je nach kind-passendem Modus
74
- * (inline-base64 vs. signed-url). API liefert TemplateResource pur.
75
- *
76
- * **Caller-Invariante:** `tenantId` MUSS vom Server kommen (typisch
77
- * `ctx.user.tenantId`). Niemals direkt aus User-Input — sonst kann
78
- * User cross-tenant Templates abfragen (Tenant-Isolation gebrochen).
65
+ * Four-step fallback: tenant+locale, system+locale, tenant+FALLBACK_LOCALE,
66
+ * system+FALLBACK_LOCALE (see template-resolver.md).
67
+ * Tenant rows count only for templates unlocked for tenants (tenantEditable,
68
+ * or a collection with access); locked overrides are skipped but stay stored.
79
69
  */
80
70
  readonly resolveTemplate: (args: ResolveRequest) => Promise<TemplateResource>;
81
71
  /**
@@ -89,7 +79,15 @@ export type TemplateResolverApi = {
89
79
  */
90
80
  readonly resolveLayout: (args: ResolveLayoutRequest) => Promise<TemplateResource>;
91
81
  };
92
- export declare function createTemplateResolverApi(db: DbRunner | TenantDb): TemplateResolverApi;
82
+ export declare function createTemplateResolverApi(db: DbRunner | TenantDb, registry: Registry): TemplateResolverApi;
83
+ export declare function isRowDelivered(db: DbRunner | TenantDb, policy: TemplateDeliveryPolicy, row: TemplateResourceRow): Promise<boolean>;
84
+ export declare function isRowDeliveredTo(db: DbRunner | TenantDb, policy: TemplateDeliveryPolicy, user: {
85
+ readonly roles: readonly string[];
86
+ }, row: TemplateResourceRow): Promise<boolean>;
87
+ export declare function filterDeliveredTo(db: DbRunner | TenantDb, policy: TemplateDeliveryPolicy, user: {
88
+ readonly roles: readonly string[];
89
+ }, rows: readonly TemplateResourceRow[]): Promise<TemplateResourceRow[]>;
90
+ export declare function systemTemplateExists(db: DbRunner | TenantDb, kind: string, slug: string): Promise<boolean>;
93
91
  export declare class TemplateNotFoundError extends Error {
94
92
  readonly query: {
95
93
  slug: string;
@@ -3,17 +3,21 @@
3
3
  // ctx.templateResolver at runtime.
4
4
  import { selectMany } from "@cosmicdrift/kumiko-framework/db";
5
5
  import { InternalError } from "@cosmicdrift/kumiko-framework/errors";
6
- import { FALLBACK_LOCALE, SYSTEM_TENANT_ID } from "./constants.js";
7
6
  import { fileAttachmentsOf, imageLinksOf, parseLinkedResourceEntries, pdfAttachmentLinksOf, } from "./linked-resources.js";
8
7
  import { templateResourcesTable } from "./table.js";
9
- import { activeVersionOf, servedVersionOf } from "./template-draft.js";
8
+ import { deliveryPolicyOf, isRowServed, isServedByCollectionOnly, } from "./template-delivery-policy.js";
9
+ import { activeVersionOf, isSystemAdmin, servedVersionOf } from "./template-draft.js";
10
10
  import { parseTemplateMeta } from "./template-meta.js";
11
- export function createTemplateResolverApi(db) {
11
+ import { FALLBACK_LOCALE, SYSTEM_TENANT_ID } from "./web/constants.js";
12
+ export function createTemplateResolverApi(db, registry) {
13
+ const deliveryPolicy = deliveryPolicyOf(registry);
14
+ // A collection entry must not shadow a system template of the same slug that the app did not unlock.
15
+ const isServed = (row) => isRowDelivered(db, deliveryPolicy, row);
12
16
  return {
13
17
  findExact: async ({ tenantId, slug, kind, locale, scope }) => {
14
18
  const effectiveTenantId = scope === "system" ? SYSTEM_TENANT_ID : tenantId;
15
19
  const row = await fetchTemplate(db, effectiveTenantId, slug, kind, locale);
16
- return row ? toPublic(row) : null;
20
+ return row && (await isServed(row)) ? toPublic(row) : null;
17
21
  },
18
22
  resolveTemplate: async ({ tenantId, slug, kind, locale }) => {
19
23
  // Fallback-Chain — finde erste passende Variante
@@ -28,14 +32,18 @@ export function createTemplateResolverApi(db) {
28
32
  : []),
29
33
  ];
30
34
  for (const c of candidates) {
35
+ if (!isRowServed(deliveryPolicy, { tenantId: c.tid, kind, slug }))
36
+ continue;
31
37
  const row = await fetchTemplate(db, c.tid, slug, kind, c.loc);
32
- if (row && row.status === "active")
38
+ if (row && row.status === "active" && (await isServed(row)))
33
39
  return toPublic(row);
34
40
  }
35
41
  throw new TemplateNotFoundError({ slug, kind, locale });
36
42
  },
37
43
  resolveLayout: async ({ tenantId, slug, kind, locale }) => {
38
44
  for (const tid of [tenantId, SYSTEM_TENANT_ID]) {
45
+ if (!isRowServed(deliveryPolicy, { tenantId: tid, kind, slug }))
46
+ continue;
39
47
  const rows = await selectMany(db, templateResourcesTable, {
40
48
  tenantId: tid,
41
49
  slug,
@@ -49,6 +57,26 @@ export function createTemplateResolverApi(db) {
49
57
  },
50
58
  };
51
59
  }
60
+ // The one delivery rule for a stored row: unlocked, and a collection entry never shadows a system
61
+ // template of the same slug that the app did not unlock.
62
+ export async function isRowDelivered(db, policy, row) {
63
+ if (!isRowServed(policy, row))
64
+ return false;
65
+ if (row.tenantId === SYSTEM_TENANT_ID || !isServedByCollectionOnly(policy, row))
66
+ return true;
67
+ return !(await systemTemplateExists(db, row.kind, row.slug));
68
+ }
69
+ export async function isRowDeliveredTo(db, policy, user, row) {
70
+ return isSystemAdmin(user) || (await isRowDelivered(db, policy, row));
71
+ }
72
+ export async function filterDeliveredTo(db, policy, user, rows) {
73
+ const flags = await Promise.all(rows.map((row) => isRowDeliveredTo(db, policy, user, row)));
74
+ return rows.filter((_, index) => flags[index]);
75
+ }
76
+ export async function systemTemplateExists(db, kind, slug) {
77
+ const rows = await selectMany(db, templateResourcesTable, { tenantId: SYSTEM_TENANT_ID, slug, kind }, { limit: 1 });
78
+ return rows.length > 0;
79
+ }
52
80
  function pickActiveLayoutRow(rows, locale) {
53
81
  const active = rows
54
82
  .filter((row) => row.status === "active")
@@ -139,7 +167,7 @@ export function requireTemplateResolver(ctx, callerName) {
139
167
  if (!api) {
140
168
  throw new InternalError({
141
169
  message: `[${callerName}] ctx.templateResolver missing — App-Bootstrap muss ` +
142
- `extraContext: { templateResolver: createTemplateResolverApi(db) } setzen ` +
170
+ `extraContext: { templateResolver: createTemplateResolverApi(db, registry) } setzen ` +
143
171
  `(siehe template-resolver/README.md).`,
144
172
  });
145
173
  }
@@ -9,7 +9,10 @@ export type CompileDocumentBodyOptions = {
9
9
  readonly buttonInlineStyle?: string;
10
10
  readonly headingAsInlineStyle?: boolean;
11
11
  readonly stepsColor?: string;
12
+ readonly recordImagesSrc?: (variable: string) => readonly string[];
13
+ readonly recordImagesPlaceholder?: boolean;
12
14
  };
13
15
  export declare function collectDocumentResourceKeys(html: string): readonly string[];
16
+ export declare function collectDocumentImageVariables(html: string): readonly string[];
14
17
  export declare function toResourceDataUri(contentType: string, bytes: Uint8Array): string;
15
18
  export declare function compileDocumentBodyToHandlebars(html: string, variables: TemplateVariables, options?: CompileDocumentBodyOptions): string;
@@ -2,7 +2,7 @@ import { isOneOf } from "@cosmicdrift/kumiko-types/type-guards";
2
2
  import { isResourceImageContentType } from "../shared/index.js";
3
3
  import { rewriteStepsBlock } from "./compile-steps-block.js";
4
4
  import { conditionScopeElement, withParsedDocument } from "./document-sanitizer.js";
5
- import { DOCUMENT_CONDITION_ATTRIBUTE, DOCUMENT_TEXT_ALIGNMENTS, isAllowedDocumentLinkHref, isDocumentPlaceholderHref, isDocumentReferenceName, isDocumentResourceKey, } from "./document-schema.js";
5
+ import { DOCUMENT_CONDITION_ATTRIBUTE, DOCUMENT_TEXT_ALIGNMENTS, isAllowedDocumentLinkHref, isDocumentPlaceholderHref, isDocumentReferenceName, isDocumentResourceKey, } from "./web/document-schema.js";
6
6
  // Private-use characters mark where a Handlebars expression goes. Author text
7
7
  // is scrubbed of them first and every `{`/`}` is entity-encoded before the
8
8
  // markers are swapped for real expressions, so the only Handlebars syntax in
@@ -48,9 +48,13 @@ function valueExpression(path, def, isWholeBlock) {
48
48
  }
49
49
  return `{{${path}}}`;
50
50
  }
51
+ // Never interpolated as text: its value is a list of file ids.
52
+ function isImagesVariable(def) {
53
+ return def?.type === "images";
54
+ }
51
55
  function rewriteVariable(element, state) {
52
56
  const name = element.getAttribute("data-variable") ?? "";
53
- const replacement = element.ownerDocument.createTextNode(isDocumentReferenceName(name)
57
+ const replacement = element.ownerDocument.createTextNode(isDocumentReferenceName(name) && !isImagesVariable(pathAndDef(name, element, state)[1])
54
58
  ? marker(state, valueExpression(...pathAndDef(name, element, state), state.blockRichTextSpans.has(element)))
55
59
  : "");
56
60
  element.replaceWith(replacement);
@@ -82,6 +86,9 @@ function wrapVariableOnlyBlock(block, state) {
82
86
  if (name === null)
83
87
  return;
84
88
  const [path, def] = pathAndDef(name, block, state);
89
+ // skip: images blocks are rewritten by rewriteImagesBlock
90
+ if (isImagesVariable(def))
91
+ return;
85
92
  const host = def?.type === "richText" && block.tagName === "P" ? richTextBlockHost(block, state) : block;
86
93
  const document = host.ownerDocument;
87
94
  host.before(document.createTextNode(marker(state, `{{#if ${path} includeZero=true}}`)));
@@ -106,8 +113,8 @@ function rewriteLink(element, state) {
106
113
  if (isDocumentPlaceholderHref(href)) {
107
114
  const name = href.slice(2, -2);
108
115
  if (isDocumentReferenceName(name)) {
109
- const [path] = pathAndDef(name, element, state);
110
- element.setAttribute("href", marker(state, `{{link ${path}}}`));
116
+ const [path, def] = pathAndDef(name, element, state);
117
+ element.setAttribute("href", isImagesVariable(def) ? "#" : marker(state, `{{link ${path}}}`));
111
118
  }
112
119
  else {
113
120
  element.setAttribute("href", "#");
@@ -152,6 +159,7 @@ function stripActiveContent(element) {
152
159
  function neutralizeBraces(html) {
153
160
  return html.replace(/[{}]/g, (brace) => (brace === "{" ? "&#123;" : "&#125;"));
154
161
  }
162
+ const IMAGES_PLACEHOLDER_STYLE = "height:96px;margin:8px 0;border-radius:4px;background:#e5e7eb";
155
163
  const MAIL_BUTTON_STYLE = "display:inline-block;padding:10px 20px;border-radius:6px;background-color:#1f5468;color:#ffffff;font-weight:600;text-decoration:none";
156
164
  const MAIL_TABLE_STYLE = "width:100%;border-collapse:collapse";
157
165
  const MAIL_TABLE_CELL_STYLE = "padding:6px 12px;vertical-align:top;border-bottom:1px solid #e5e5e5";
@@ -179,6 +187,42 @@ export function collectDocumentResourceKeys(html) {
179
187
  return [...keys];
180
188
  });
181
189
  }
190
+ // Unique valid names of the images blocks in document order.
191
+ export function collectDocumentImageVariables(html) {
192
+ return withParsedDocument(html, (root) => {
193
+ const names = new Set();
194
+ for (const element of Array.from(root.querySelectorAll("div[data-images]"))) {
195
+ const name = element.getAttribute("data-images") ?? "";
196
+ if (isDocumentReferenceName(name))
197
+ names.add(name);
198
+ }
199
+ return [...names];
200
+ });
201
+ }
202
+ function rewriteImagesBlock(element, state, options) {
203
+ const name = element.getAttribute("data-images") ?? "";
204
+ const declared = isDocumentReferenceName(name) && isImagesVariable(ownVariable(state.variables, name));
205
+ if (!declared) {
206
+ element.remove();
207
+ // skip: an images block bound to anything but a declared images variable renders nothing
208
+ return;
209
+ }
210
+ const document = element.ownerDocument;
211
+ element.removeAttribute("data-images");
212
+ if (options.recordImagesPlaceholder === true) {
213
+ element.setAttribute("class", "kumiko-doc-image-placeholder");
214
+ element.setAttribute("style", IMAGES_PLACEHOLDER_STYLE);
215
+ // skip: preview and drafts never resolve record images
216
+ return;
217
+ }
218
+ element.setAttribute("class", "kumiko-doc-images");
219
+ for (const src of options.recordImagesSrc?.(name) ?? []) {
220
+ const image = document.createElement("img");
221
+ image.setAttribute("src", src);
222
+ image.setAttribute("alt", "");
223
+ element.append(image);
224
+ }
225
+ }
182
226
  export function toResourceDataUri(contentType, bytes) {
183
227
  if (!isResourceImageContentType(contentType)) {
184
228
  throw new Error(`resource content type "${contentType}" cannot be embedded as an image`);
@@ -273,6 +317,9 @@ export function compileDocumentBodyToHandlebars(html, variables, options = {}) {
273
317
  color: options.stepsColor,
274
318
  });
275
319
  }
320
+ for (const element of Array.from(root.querySelectorAll("div[data-images]"))) {
321
+ rewriteImagesBlock(element, state, options);
322
+ }
276
323
  for (const block of Array.from(root.querySelectorAll(`[${DOCUMENT_CONDITION_ATTRIBUTE}]`))) {
277
324
  rewriteConditionalBlock(block, state);
278
325
  }
@@ -1,6 +1,6 @@
1
- import { isDocumentReferenceName } from "./document-schema.js";
2
- import { readDocumentSteps } from "./document-steps.js";
3
1
  import { isHexColor } from "./layout-appearance.js";
2
+ import { isDocumentReferenceName } from "./web/document-schema.js";
3
+ import { readDocumentSteps } from "./web/document-steps.js";
4
4
  export const DEFAULT_STEPS_COLOR = "#1f5468";
5
5
  const TODO_BAR_COLOR = "#ECEDEA";
6
6
  const REACHED_LABEL_COLOR = "#0B0D12";
@@ -1,7 +1,7 @@
1
1
  import type { FieldIssue } from "@cosmicdrift/kumiko-framework/errors";
2
2
  import { type JSONContent } from "@tiptap/core";
3
3
  import * as z from "zod";
4
- import type { DocumentHtmlKind } from "./constants.ts";
4
+ import type { DocumentHtmlKind } from "./web/constants.ts";
5
5
  export declare const MAX_DOCUMENT_OPS = 50;
6
6
  export type DocumentBlockType = "paragraph" | "heading" | "list" | "table" | "repeat" | "image" | "button" | "divider" | "pageBreak" | "steps";
7
7
  export type DocumentBlock = {
@@ -1,9 +1,9 @@
1
1
  import { getSchema } from "@tiptap/core";
2
2
  import * as z from "zod";
3
- import { documentBlocksForKind } from "./document-blocks.js";
4
- import { DOCUMENT_TEXT_ALIGNMENTS, documentExtensions, isDocumentPlaceholderHref, isDocumentReferenceName, isDocumentResourceKey, } from "./document-schema.js";
5
- import { contentToLine, lineToContent, singleLine } from "./placeholder-text.js";
6
3
  import { toVariableDef } from "./template-validation.js";
4
+ import { documentBlocksForKind } from "./web/document-blocks.js";
5
+ import { DOCUMENT_TEXT_ALIGNMENTS, documentExtensions, isDocumentPlaceholderHref, isDocumentReferenceName, isDocumentResourceKey, } from "./web/document-schema.js";
6
+ import { contentToLine, lineToContent, singleLine } from "./web/placeholder-text.js";
7
7
  export const MAX_DOCUMENT_OPS = 50;
8
8
  // Assigning these keys would reach the prototype of the meta object.
9
9
  const FORBIDDEN_META_KEYS = new Set(["__proto__", "prototype", "constructor"]);
@@ -1,8 +1,8 @@
1
1
  import type { FieldIssue } from "@cosmicdrift/kumiko-framework/errors";
2
2
  import type { JSONContent } from "@tiptap/core";
3
3
  import { type Element as ScanElement } from "happy-dom";
4
- import type { ContentFormat } from "./constants.ts";
5
- export type DocumentViolationCode = "script_element" | "event_handler_attribute" | "disallowed_link_href" | "external_image_source" | "image_without_resource" | "invalid_reference_name" | "embedded_content" | "unsafe_attribute_value" | "button_href_not_placeholder" | "document_requires_html_format" | "layout_requires_mjml_format" | "layout_invalid_structure" | "layout_missing_content_slot" | "layout_source_system_only";
4
+ import type { ContentFormat } from "./web/constants.ts";
5
+ export type DocumentViolationCode = "script_element" | "event_handler_attribute" | "disallowed_link_href" | "external_image_source" | "image_without_resource" | "invalid_reference_name" | "embedded_content" | "unsafe_attribute_value" | "images_block_pdf_only" | "button_href_not_placeholder" | "document_requires_html_format" | "layout_requires_mjml_format" | "layout_invalid_structure" | "layout_missing_content_slot" | "layout_source_system_only";
6
6
  export type DocumentViolation = {
7
7
  readonly code: DocumentViolationCode;
8
8
  readonly detail: string;
@@ -1,9 +1,9 @@
1
1
  import { isOneOf } from "@cosmicdrift/kumiko-types/type-guards";
2
2
  import { generateHTML, generateJSON } from "@tiptap/html/server";
3
3
  import { Window } from "happy-dom";
4
- import { DOCUMENT_HTML_KINDS } from "./constants.js";
5
- import { DOCUMENT_CONDITION_ATTRIBUTE, documentExtensions, isAllowedDocumentLinkHref, isDocumentPlaceholderHref, isDocumentReferenceName, isDocumentResourceKey, } from "./document-schema.js";
6
- import { isDocumentStepKey } from "./document-steps.js";
4
+ import { DOCUMENT_HTML_KINDS } from "./web/constants.js";
5
+ import { DOCUMENT_CONDITION_ATTRIBUTE, documentExtensions, isAllowedDocumentLinkHref, isDocumentPlaceholderHref, isDocumentReferenceName, isDocumentResourceKey, } from "./web/document-schema.js";
6
+ import { isDocumentStepKey } from "./web/document-steps.js";
7
7
  export function violation(code, detail, message) {
8
8
  return { code, detail, message };
9
9
  }
@@ -59,6 +59,7 @@ const REFERENCE_ATTRIBUTES = [
59
59
  [DOCUMENT_CONDITION_ATTRIBUTE, isDocumentReferenceName],
60
60
  ["data-resource", isDocumentResourceKey],
61
61
  ["data-steps", isDocumentReferenceName],
62
+ ["data-images", isDocumentReferenceName],
62
63
  ["data-step", isDocumentStepKey],
63
64
  ];
64
65
  function scanReferences(tag, element, out) {
@@ -182,10 +183,28 @@ function requiredFormatViolation(kind, contentFormat) {
182
183
  }
183
184
  return null;
184
185
  }
186
+ const IMAGES_BLOCK_KIND = "document-pdf";
187
+ // The node is part of the shared document model, so a mail body would keep it after the
188
+ // rebuild; only a PDF resolves the record's images.
189
+ function imagesBlockViolation(input) {
190
+ if (input.kind === IMAGES_BLOCK_KIND ||
191
+ !isSanitizedHtmlKind(input.kind) ||
192
+ input.contentFormat !== "html" ||
193
+ input.content === null) {
194
+ return null;
195
+ }
196
+ const hasImagesBlock = withParsedDocument(input.content, (body) => body.querySelector("div[data-images]") !== null);
197
+ return hasImagesBlock
198
+ ? violation("images_block_pdf_only", input.kind, `Record images blocks are only allowed in templates of kind ${IMAGES_BLOCK_KIND}`)
199
+ : null;
200
+ }
185
201
  export function sanitizeTemplateBody(input) {
186
202
  const formatViolation = requiredFormatViolation(input.kind, input.contentFormat);
187
203
  if (formatViolation !== null)
188
204
  return { ok: false, violations: [formatViolation] };
205
+ const imagesViolation = imagesBlockViolation(input);
206
+ if (imagesViolation !== null)
207
+ return { ok: false, violations: [imagesViolation] };
189
208
  if (!isSanitizedHtmlKind(input.kind) ||
190
209
  input.contentFormat !== "html" ||
191
210
  input.content === null) {
@@ -203,6 +222,7 @@ const VIOLATION_I18N_KEYS = {
203
222
  invalid_reference_name: "templateResolver.errors.document.invalidReferenceName",
204
223
  embedded_content: "templateResolver.errors.document.embeddedContent",
205
224
  unsafe_attribute_value: "templateResolver.errors.document.unsafeAttributeValue",
225
+ images_block_pdf_only: "templateResolver.errors.document.imagesBlockPdfOnly",
206
226
  button_href_not_placeholder: "templateResolver.errors.document.buttonHrefNotPlaceholder",
207
227
  document_requires_html_format: "templateResolver.errors.document.documentRequiresHtmlFormat",
208
228
  layout_requires_mjml_format: "templateResolver.errors.document.layoutRequiresMjmlFormat",
@@ -1,4 +1,6 @@
1
1
  import { type ContentCollectionDefinition } from "@cosmicdrift/kumiko-framework/engine";
2
+ import type { TemplateDeliveryPolicy } from "./template-delivery-policy.ts";
3
+ import type { TenantEditableTemplate } from "./template-edit-policy.ts";
2
4
  export type TemplateResolverOptions = {
3
5
  /** Content collections this app mounts. Declared here rather than inside the
4
6
  * feature because `access` needs the host's role vocabulary — a bundled
@@ -10,6 +12,13 @@ export type TemplateResolverOptions = {
10
12
  * access rule, so the dispatcher enforces the separation instead of a
11
13
  * branch in a shared handler. */
12
14
  readonly collections?: readonly ContentCollectionDefinition[];
15
+ /** Templates a TenantAdmin may edit for the own tenant (override, draft, publish, archive,
16
+ * reset, copy-locale, import, resources). Without an entry only a SystemAdmin edits.
17
+ * A tenant-edited mail goes out under the platform's name, so the app opts in per
18
+ * template instead of the framework guessing which ones a tenant may reword.
19
+ * `access` is required: the host decides its role vocabulary here, like for
20
+ * `collections`. SystemAdmin always passes. */
21
+ readonly tenantEditable?: readonly TenantEditableTemplate[];
13
22
  };
14
23
  export declare function createTemplateResolverFeature(opts?: TemplateResolverOptions): import("@cosmicdrift/kumiko-types/feature").FeatureDefinition & {
15
24
  readonly exports: {
@@ -47,6 +56,7 @@ export declare function createTemplateResolverFeature(opts?: TemplateResolverOpt
47
56
  preview: import("@cosmicdrift/kumiko-types/handlers").HandlerRef;
48
57
  documentBlocks: import("@cosmicdrift/kumiko-types/handlers").HandlerRef;
49
58
  exportBundle: import("@cosmicdrift/kumiko-types/handlers").HandlerRef;
59
+ sendTestStatus: import("@cosmicdrift/kumiko-types/handlers").HandlerRef;
50
60
  };
51
61
  treeHandle: import("@cosmicdrift/kumiko-types/tree-node").TreeActionsHandle<"template-resolver", {
52
62
  readonly edit: {
@@ -62,5 +72,6 @@ export declare function createTemplateResolverFeature(opts?: TemplateResolverOpt
62
72
  };
63
73
  };
64
74
  }>;
75
+ deliveryPolicy: TemplateDeliveryPolicy;
65
76
  };
66
77
  };