@cosmicdrift/kumiko-samples 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.
- package/package.json +1 -1
- package/packages/bundled-features/package.json +18 -17
- package/packages/bundled-features/src/account-security/feature.ts +2 -2
- package/packages/bundled-features/src/account-security/index.ts +8 -8
- package/packages/bundled-features/src/account-security/{constants.ts → web/constants.ts} +0 -2
- package/packages/bundled-features/src/account-security/{i18n.ts → web/i18n.ts} +0 -1
- package/packages/bundled-features/src/admin-shell/feature.ts +10 -9
- package/packages/bundled-features/src/admin-shell/index.ts +8 -8
- package/packages/bundled-features/src/admin-shell/web/client-plugin.tsx +2 -3
- package/packages/bundled-features/src/admin-shell/{constants.ts → web/constants.ts} +0 -1
- package/packages/bundled-features/src/admin-shell/web/default-translations.ts +10 -0
- package/packages/bundled-features/src/admin-shell/web/i18n.ts +51 -9
- package/packages/bundled-features/src/admin-shell/web/index.ts +0 -1
- package/packages/bundled-features/src/audit/changes.json +7 -0
- package/packages/bundled-features/src/audit/feature.ts +72 -64
- package/packages/bundled-features/src/audit/handlers/audit-events.ts +153 -0
- package/packages/bundled-features/src/audit/handlers/audit-system-db.ts +13 -0
- package/packages/bundled-features/src/audit/handlers/details-all-tenants.query.ts +26 -0
- package/packages/bundled-features/src/audit/handlers/details.query.ts +11 -39
- package/packages/bundled-features/src/audit/handlers/list-all-tenants.query.ts +47 -0
- package/packages/bundled-features/src/audit/handlers/list.query.ts +16 -123
- package/packages/bundled-features/src/audit/handlers/resolve-audit-tenant.ts +21 -7
- package/packages/bundled-features/src/audit/index.ts +1 -1
- package/packages/bundled-features/src/audit/run-escape-hatch-retention.ts +4 -4
- package/packages/bundled-features/src/audit/screens.ts +82 -0
- package/packages/bundled-features/src/audit/web/client-plugin.tsx +2 -3
- package/packages/bundled-features/src/audit/{constants.ts → web/constants.ts} +11 -1
- package/packages/bundled-features/src/audit/web/default-translations.ts +7 -0
- package/packages/bundled-features/src/audit/web/i18n.ts +33 -7
- package/packages/bundled-features/src/audit/web/index.ts +0 -2
- package/packages/bundled-features/src/auth-email-password/bootstrap.ts +6 -6
- package/packages/bundled-features/src/auth-email-password/changes.json +6 -0
- package/packages/bundled-features/src/auth-email-password/errors.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/feature.ts +2 -2
- package/packages/bundled-features/src/auth-email-password/handlers/confirm-account-unlock.write.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/handlers/invite-accept-with-login.write.ts +4 -4
- package/packages/bundled-features/src/auth-email-password/handlers/invite-create.write.ts +3 -3
- package/packages/bundled-features/src/auth-email-password/handlers/invite-info.query.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/handlers/login.write.ts +38 -4
- package/packages/bundled-features/src/auth-email-password/handlers/request-account-unlock.write.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/handlers/request-email-verification.write.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/handlers/request-password-reset.write.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/handlers/reset-password.write.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/handlers/verify-email.write.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/index.ts +6 -1
- package/packages/bundled-features/src/auth-email-password/mail-notifications.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/signup-activation.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/web/auth-client.ts +0 -1
- package/packages/bundled-features/src/auth-email-password/web/auth-form-logic.ts +0 -1
- package/packages/bundled-features/src/auth-email-password/web/auth-form-primitives.tsx +0 -1
- package/packages/bundled-features/src/auth-email-password/web/auth-gate.tsx +0 -1
- package/packages/bundled-features/src/auth-email-password/web/auth-redirect.ts +0 -1
- package/packages/bundled-features/src/auth-email-password/web/client-actions.ts +0 -1
- package/packages/bundled-features/src/auth-email-password/web/client-plugin.ts +1 -2
- package/packages/bundled-features/src/auth-email-password/web/confirm-account-unlock-screen.tsx +0 -1
- package/packages/bundled-features/src/auth-email-password/{constants.ts → web/constants.ts} +3 -6
- package/packages/bundled-features/src/auth-email-password/web/default-topbar-actions.tsx +0 -1
- package/packages/bundled-features/src/auth-email-password/web/forgot-password-screen.tsx +0 -1
- package/packages/bundled-features/src/auth-email-password/{i18n.ts → web/i18n.ts} +3 -4
- package/packages/bundled-features/src/auth-email-password/web/index.ts +1 -2
- package/packages/bundled-features/src/auth-email-password/web/invite-accept-screen.tsx +2 -3
- package/packages/bundled-features/src/auth-email-password/web/login-screen.tsx +0 -1
- package/packages/bundled-features/src/auth-email-password/{mail-i18n.ts → web/mail-i18n.ts} +0 -1
- package/packages/bundled-features/src/auth-email-password/web/request-account-unlock-screen.tsx +0 -1
- package/packages/bundled-features/src/auth-email-password/web/reset-password-screen.tsx +0 -1
- package/packages/bundled-features/src/auth-email-password/web/session-bootstrap-error.tsx +0 -1
- package/packages/bundled-features/src/auth-email-password/web/session.tsx +0 -1
- package/packages/bundled-features/src/auth-email-password/web/signup-complete-screen.tsx +2 -3
- package/packages/bundled-features/src/auth-email-password/web/signup-screen.tsx +0 -1
- package/packages/bundled-features/src/auth-email-password/web/tenant-menu-items.tsx +0 -1
- package/packages/bundled-features/src/auth-email-password/web/tenant-switcher.tsx +0 -1
- package/packages/bundled-features/src/auth-email-password/web/use-shell-user.ts +0 -1
- package/packages/bundled-features/src/auth-email-password/web/user-menu.tsx +0 -1
- package/packages/bundled-features/src/auth-email-password/web/verify-email-screen.tsx +0 -1
- package/packages/bundled-features/src/auth-mfa/changes.json +6 -0
- package/packages/bundled-features/src/auth-mfa/errors.ts +2 -2
- package/packages/bundled-features/src/auth-mfa/handlers/enable-confirm-preauth.write.ts +1 -1
- package/packages/bundled-features/src/auth-mfa/handlers/enable-start-preauth.write.ts +1 -1
- package/packages/bundled-features/src/auth-mfa/handlers/enable-start.write.ts +1 -1
- package/packages/bundled-features/src/auth-mfa/handlers/verify.write.ts +1 -1
- package/packages/bundled-features/src/auth-mfa/index.ts +8 -8
- package/packages/bundled-features/src/auth-mfa/mfa-status-checker.ts +4 -4
- package/packages/bundled-features/src/auth-mfa/screens.ts +1 -1
- package/packages/bundled-features/src/auth-mfa/web/client-plugin.ts +0 -1
- package/packages/bundled-features/src/auth-mfa/{constants.ts → web/constants.ts} +0 -1
- package/packages/bundled-features/src/auth-mfa/web/i18n.ts +0 -1
- package/packages/bundled-features/src/auth-mfa/web/index.ts +0 -1
- package/packages/bundled-features/src/auth-mfa/web/mfa-client.ts +0 -1
- package/packages/bundled-features/src/auth-mfa/web/mfa-disable-dialog.tsx +1 -2
- package/packages/bundled-features/src/auth-mfa/web/mfa-recovery-codes-reveal.tsx +0 -1
- package/packages/bundled-features/src/auth-mfa/web/mfa-regenerate-recovery-dialog.tsx +1 -2
- package/packages/bundled-features/src/auth-mfa/web/mfa-setup-preauth-screen.tsx +21 -23
- package/packages/bundled-features/src/auth-mfa/web/mfa-verify-screen.tsx +0 -1
- package/packages/bundled-features/src/billing-foundation/changes.json +18 -0
- package/packages/bundled-features/src/billing-foundation/checkout-core.ts +3 -3
- package/packages/bundled-features/src/billing-foundation/consumer-protection/consent-text.ts +2 -2
- package/packages/bundled-features/src/billing-foundation/consumer-protection/issue-confirmation.ts +11 -3
- package/packages/bundled-features/src/billing-foundation/consumer-protection/mail-notifications.ts +11 -1
- package/packages/bundled-features/src/billing-foundation/consumer-protection/register-consent.ts +1 -1
- package/packages/bundled-features/src/billing-foundation/consumer-protection/register-termination.ts +12 -1
- package/packages/bundled-features/src/billing-foundation/consumer-protection/stored-user-email.ts +12 -0
- package/packages/bundled-features/src/billing-foundation/consumer-protection/termination-mail.ts +6 -1
- package/packages/bundled-features/src/billing-foundation/consumer-protection/termination-notify.ts +1 -1
- package/packages/bundled-features/src/billing-foundation/consumer-protection/termination-pages.ts +167 -28
- package/packages/bundled-features/src/billing-foundation/consumer-protection/termination-record.ts +102 -3
- package/packages/bundled-features/src/billing-foundation/consumer-protection/termination-request.ts +43 -12
- package/packages/bundled-features/src/billing-foundation/consumer-protection/termination-revoke.ts +202 -0
- package/packages/bundled-features/src/billing-foundation/consumer-protection/termination-texts.ts +70 -0
- package/packages/bundled-features/src/billing-foundation/events.ts +20 -2
- package/packages/bundled-features/src/billing-foundation/feature.ts +5 -5
- package/packages/bundled-features/src/billing-foundation/handlers/process-event.write.ts +82 -9
- package/packages/bundled-features/src/billing-foundation/handlers/switch-plan.write.ts +1 -1
- package/packages/bundled-features/src/billing-foundation/handlers/sync-subscription.write.ts +1 -1
- package/packages/bundled-features/src/billing-foundation/index.ts +27 -27
- package/packages/bundled-features/src/billing-foundation/plan-catalog.ts +7 -7
- package/packages/bundled-features/src/billing-foundation/screens.ts +1 -1
- package/packages/bundled-features/src/billing-foundation/subscription-tier-sync.ts +1 -1
- package/packages/bundled-features/src/billing-foundation/types.ts +17 -3
- package/packages/bundled-features/src/billing-foundation/validate-options.ts +3 -3
- package/packages/bundled-features/src/billing-foundation/web/billing-contact-plan.tsx +1 -3
- package/packages/bundled-features/src/billing-foundation/web/billing-plans-panel.tsx +5 -7
- package/packages/bundled-features/src/billing-foundation/web/cancel-contract-dialog.tsx +1 -3
- package/packages/bundled-features/src/billing-foundation/web/checkout-consent-dialog.tsx +1 -3
- package/packages/bundled-features/src/billing-foundation/web/client-plugin.tsx +1 -2
- package/packages/bundled-features/src/billing-foundation/{constants.ts → web/constants.ts} +37 -31
- package/packages/bundled-features/src/billing-foundation/{consumer-protection → web/consumer-protection}/consent-locale.ts +0 -1
- package/packages/bundled-features/src/billing-foundation/{contact-card.ts → web/contact-card.ts} +0 -2
- package/packages/bundled-features/src/billing-foundation/web/index.ts +14 -15
- package/packages/bundled-features/src/billing-foundation/web/localized-params.ts +0 -2
- package/packages/bundled-features/src/billing-foundation/webhook-handler.ts +5 -2
- package/packages/bundled-features/src/cap-counter/changes.json +12 -0
- package/packages/bundled-features/src/cap-counter/stock-cap-guard.ts +9 -0
- package/packages/bundled-features/src/cap-overview/feature.ts +1 -1
- package/packages/bundled-features/src/cap-overview/handlers/caps-usage.query.ts +1 -1
- package/packages/bundled-features/src/cap-overview/handlers/tenant-caps-list.query.ts +2 -2
- package/packages/bundled-features/src/cap-overview/index.ts +9 -9
- package/packages/bundled-features/src/cap-overview/screens.ts +2 -2
- package/packages/bundled-features/src/cap-overview/web/cap-cards-panel.tsx +1 -2
- package/packages/bundled-features/src/cap-overview/web/cap-usage-bar.tsx +1 -2
- package/packages/bundled-features/src/cap-overview/web/cap-usage-cell.tsx +0 -2
- package/packages/bundled-features/src/cap-overview/web/client-plugin.tsx +3 -4
- package/packages/bundled-features/src/cap-overview/{constants.ts → web/constants.ts} +0 -1
- package/packages/bundled-features/src/cap-overview/web/index.ts +0 -1
- package/packages/bundled-features/src/cap-overview/{usage-math.ts → web/usage-math.ts} +1 -2
- package/packages/bundled-features/src/compliance-profiles/feature.ts +5 -5
- package/packages/bundled-features/src/compliance-profiles/index.ts +6 -6
- package/packages/bundled-features/src/compliance-profiles/web/client-plugin.tsx +2 -3
- package/packages/bundled-features/src/compliance-profiles/web/compliance-profile-catalog.tsx +1 -2
- package/packages/bundled-features/src/compliance-profiles/{constants.ts → web/constants.ts} +0 -1
- package/packages/bundled-features/src/compliance-profiles/web/i18n.ts +0 -1
- package/packages/bundled-features/src/compliance-profiles/web/index.ts +0 -1
- package/packages/bundled-features/src/config/index.ts +6 -6
- package/packages/bundled-features/src/config/web/client-plugin.ts +1 -2
- package/packages/bundled-features/src/config/{constants.ts → web/constants.ts} +0 -1
- package/packages/bundled-features/src/config/web/i18n.ts +1 -1
- package/packages/bundled-features/src/config/web/index.ts +1 -3
- package/packages/bundled-features/src/config/write-helpers.ts +1 -1
- package/packages/bundled-features/src/custom-fields/feature.ts +8 -8
- package/packages/bundled-features/src/custom-fields/handlers/clear-custom-field.write.ts +1 -1
- package/packages/bundled-features/src/custom-fields/handlers/define-tenant-field.write.ts +1 -1
- package/packages/bundled-features/src/custom-fields/handlers/delete-system-field.write.ts +1 -1
- package/packages/bundled-features/src/custom-fields/handlers/delete-tenant-field.write.ts +4 -4
- package/packages/bundled-features/src/custom-fields/handlers/set-custom-field.write.ts +1 -1
- package/packages/bundled-features/src/custom-fields/handlers/update-tenant-field.write.ts +1 -1
- package/packages/bundled-features/src/custom-fields/index.ts +8 -8
- package/packages/bundled-features/src/custom-fields/lib/value-schema.ts +1 -1
- package/packages/bundled-features/src/custom-fields/schemas.ts +1 -1
- package/packages/bundled-features/src/custom-fields/web/client-plugin.tsx +1 -2
- package/packages/bundled-features/src/custom-fields/{constants.ts → web/constants.ts} +18 -19
- package/packages/bundled-features/src/custom-fields/web/custom-fields-form-section.tsx +1 -2
- package/packages/bundled-features/src/custom-fields/web/i18n.ts +0 -1
- package/packages/bundled-features/src/custom-fields/web/index.ts +2 -3
- package/packages/bundled-features/src/custom-fields/wire-for-entity.ts +1 -2
- package/packages/bundled-features/src/delivery/address-opt-out.ts +1 -1
- package/packages/bundled-features/src/delivery/attempt-log-retention.ts +24 -8
- package/packages/bundled-features/src/delivery/changes.json +6 -0
- package/packages/bundled-features/src/delivery/constants.ts +2 -2
- package/packages/bundled-features/src/delivery/i18n.ts +1 -1
- package/packages/bundled-features/src/delivery/unsubscribe-page.ts +1 -1
- package/packages/bundled-features/src/delivery/web/client-plugin.tsx +6 -7
- package/packages/bundled-features/src/delivery/web/delivery-channel-cell.tsx +0 -1
- package/packages/bundled-features/src/delivery/web/delivery-error-cell.tsx +0 -1
- package/packages/bundled-features/src/delivery/web/delivery-status-cell.tsx +1 -2
- package/packages/bundled-features/src/delivery/web/delivery-time-cell.tsx +0 -1
- package/packages/bundled-features/src/delivery/web/delivery-type-cell.tsx +0 -1
- package/packages/bundled-features/src/delivery/web/index.ts +0 -1
- package/packages/bundled-features/src/delivery/{public-names.ts → web/public-names.ts} +0 -1
- package/packages/bundled-features/src/document-ingest-foundation/changes.json +6 -0
- package/packages/bundled-features/src/document-ingest-foundation/events.ts +4 -0
- package/packages/bundled-features/src/document-ingest-foundation/executor.ts +2 -1
- package/packages/bundled-features/src/document-ingest-foundation/feature.ts +18 -4
- package/packages/bundled-features/src/document-ingest-foundation/index.ts +1 -0
- package/packages/bundled-features/src/feature-toggles/feature.ts +7 -7
- package/packages/bundled-features/src/feature-toggles/handlers/list.query.ts +1 -1
- package/packages/bundled-features/src/feature-toggles/handlers/registered.query.ts +1 -1
- package/packages/bundled-features/src/feature-toggles/handlers/set.write.ts +3 -3
- package/packages/bundled-features/src/feature-toggles/index.ts +6 -6
- package/packages/bundled-features/src/feature-toggles/web/client-plugin.tsx +1 -2
- package/packages/bundled-features/src/feature-toggles/{constants.ts → web/constants.ts} +0 -1
- package/packages/bundled-features/src/feature-toggles/web/i18n.ts +0 -1
- package/packages/bundled-features/src/feature-toggles/web/index.ts +0 -1
- package/packages/bundled-features/src/files/changes.json +7 -0
- package/packages/bundled-features/src/folders/feature.ts +1 -1
- package/packages/bundled-features/src/folders/handlers/clear-folder.write.ts +1 -1
- package/packages/bundled-features/src/folders/handlers/delete-folder.write.ts +1 -1
- package/packages/bundled-features/src/folders/handlers/set-folder.write.ts +1 -1
- package/packages/bundled-features/src/folders/index.ts +8 -8
- package/packages/bundled-features/src/folders/web/client-plugin.tsx +1 -3
- package/packages/bundled-features/src/folders/{constants.ts → web/constants.ts} +0 -1
- package/packages/bundled-features/src/folders/web/folder-manager.tsx +1 -2
- package/packages/bundled-features/src/folders/web/folder-section.tsx +1 -2
- package/packages/bundled-features/src/folders/web/i18n.ts +0 -1
- package/packages/bundled-features/src/folders/web/index.ts +1 -2
- package/packages/bundled-features/src/folders/web/tree.ts +0 -1
- package/packages/bundled-features/src/form-draft/changes.json +7 -0
- package/packages/bundled-features/src/form-draft/db/queries/cleanup.ts +25 -11
- package/packages/bundled-features/src/form-draft/decrypt-draft.ts +24 -0
- package/packages/bundled-features/src/form-draft/entity.ts +6 -9
- package/packages/bundled-features/src/form-draft/feature.ts +1 -1
- package/packages/bundled-features/src/form-draft/handlers/cleanup.job.ts +26 -5
- package/packages/bundled-features/src/form-draft/handlers/discard.write.ts +1 -1
- package/packages/bundled-features/src/form-draft/handlers/get.query.ts +6 -7
- package/packages/bundled-features/src/form-draft/handlers/list.query.ts +13 -7
- package/packages/bundled-features/src/form-draft/handlers/save.write.ts +5 -5
- package/packages/bundled-features/src/form-draft/index.ts +8 -8
- package/packages/bundled-features/src/form-draft/lookup.ts +10 -4
- package/packages/bundled-features/src/form-draft/schemas.ts +1 -1
- package/packages/bundled-features/src/form-draft/{constants.ts → web/constants.ts} +0 -1
- package/packages/bundled-features/src/form-draft-user-data/hooks.ts +2 -2
- package/packages/bundled-features/src/inbound-mail-foundation/changes.json +6 -0
- package/packages/bundled-features/src/inbound-mail-foundation/handlers/list-accounts.query.ts +11 -4
- package/packages/bundled-features/src/inbound-mail-foundation/retention-sweep.ts +10 -10
- package/packages/bundled-features/src/jobs/feature.ts +7 -7
- package/packages/bundled-features/src/jobs/handlers/retry.write.ts +1 -1
- package/packages/bundled-features/src/jobs/handlers/trigger.write.ts +1 -1
- package/packages/bundled-features/src/jobs/index.ts +1 -1
- package/packages/bundled-features/src/jobs/web/client-plugin.tsx +2 -3
- package/packages/bundled-features/src/jobs/{constants.ts → web/constants.ts} +0 -1
- package/packages/bundled-features/src/jobs/web/default-translations.ts +7 -0
- package/packages/bundled-features/src/jobs/web/i18n.ts +53 -7
- package/packages/bundled-features/src/jobs/web/index.ts +0 -1
- package/packages/bundled-features/src/ledger/changes.json +7 -0
- package/packages/bundled-features/src/ledger/entity.ts +1 -1
- package/packages/bundled-features/src/ledger/feature.ts +1 -1
- package/packages/bundled-features/src/ledger/handlers/confirm-schedule-period.write.ts +2 -10
- package/packages/bundled-features/src/ledger/handlers/create-transaction.write.ts +1 -1
- package/packages/bundled-features/src/ledger/handlers/reports.query.ts +1 -1
- package/packages/bundled-features/src/ledger/handlers/reverse-transaction.write.ts +1 -1
- package/packages/bundled-features/src/ledger/index.ts +13 -13
- package/packages/bundled-features/src/ledger/recurring.ts +1 -1
- package/packages/bundled-features/src/ledger/reports.ts +1 -1
- package/packages/bundled-features/src/ledger/schemas.ts +1 -1
- package/packages/bundled-features/src/ledger/{constants.ts → web/constants.ts} +0 -1
- package/packages/bundled-features/src/ledger/web/index.ts +11 -12
- package/packages/bundled-features/src/legal-pages/README.md +1 -1
- package/packages/bundled-features/src/legal-pages/feature.ts +5 -5
- package/packages/bundled-features/src/legal-pages/index.ts +11 -11
- package/packages/bundled-features/src/legal-pages/lib/boot-check.ts +1 -1
- package/packages/bundled-features/src/legal-pages/lib/validate-routes.ts +1 -1
- package/packages/bundled-features/src/legal-pages/web/client-plugin.ts +1 -2
- package/packages/bundled-features/src/legal-pages/{constants.ts → web/constants.ts} +6 -8
- package/packages/bundled-features/src/legal-pages/web/index.ts +0 -1
- package/packages/bundled-features/src/mail-foundation/changes.json +6 -0
- package/packages/bundled-features/src/mail-foundation/i18n.ts +3 -2
- package/packages/bundled-features/src/mail-transport-smtp/i18n.ts +1 -1
- package/packages/bundled-features/src/managed-pages/feature.ts +1 -1
- package/packages/bundled-features/src/managed-pages/web/client-plugin.tsx +1 -2
- package/packages/bundled-features/src/managed-pages/web/default-translations.ts +17 -0
- package/packages/bundled-features/src/managed-pages/web/i18n.ts +59 -16
- package/packages/bundled-features/src/managed-pages/web/index.ts +1 -2
- package/packages/bundled-features/src/metrics/compute.ts +1 -1
- package/packages/bundled-features/src/metrics/feature.ts +6 -6
- package/packages/bundled-features/src/metrics/index.ts +8 -8
- package/packages/bundled-features/src/metrics/types.ts +1 -1
- package/packages/bundled-features/src/metrics/validate.ts +1 -1
- package/packages/bundled-features/src/metrics/{constants.ts → web/constants.ts} +0 -1
- package/packages/bundled-features/src/metrics/window.ts +1 -1
- package/packages/bundled-features/src/notes-history/feature.ts +1 -1
- package/packages/bundled-features/src/notes-history/handlers/add-note.write.ts +1 -1
- package/packages/bundled-features/src/notes-history/index.ts +8 -8
- package/packages/bundled-features/src/notes-history/web/client-plugin.tsx +1 -3
- package/packages/bundled-features/src/notes-history/{constants.ts → web/constants.ts} +0 -1
- package/packages/bundled-features/src/notes-history/web/i18n.ts +0 -1
- package/packages/bundled-features/src/notes-history/web/index.ts +2 -3
- package/packages/bundled-features/src/notes-history/web/notes-section.tsx +2 -3
- package/packages/bundled-features/src/personal-access-tokens/feature.ts +12 -10
- package/packages/bundled-features/src/personal-access-tokens/handlers/available-scopes.query.ts +1 -1
- package/packages/bundled-features/src/personal-access-tokens/handlers/create.write.ts +1 -1
- package/packages/bundled-features/src/personal-access-tokens/handlers/revoke.write.ts +1 -1
- package/packages/bundled-features/src/personal-access-tokens/hash.ts +1 -1
- package/packages/bundled-features/src/personal-access-tokens/i18n.ts +2 -2
- package/packages/bundled-features/src/personal-access-tokens/index.ts +5 -5
- package/packages/bundled-features/src/personal-access-tokens/resolver.ts +1 -1
- package/packages/bundled-features/src/personal-access-tokens/schema/api-token.ts +1 -1
- package/packages/bundled-features/src/personal-access-tokens/screens.ts +2 -2
- package/packages/bundled-features/src/personal-access-tokens/{constants.ts → web/constants.ts} +0 -1
- package/packages/bundled-features/src/personal-access-tokens/{scopes.ts → web/scopes.ts} +0 -1
- package/packages/bundled-features/src/presets/changes.json +7 -0
- package/packages/bundled-features/src/presets/index.ts +0 -1
- package/packages/bundled-features/src/presets/security-baseline.ts +1 -1
- package/packages/bundled-features/src/renderer-foundation/types.ts +1 -1
- package/packages/bundled-features/src/secrets/feature.ts +1 -1
- package/packages/bundled-features/src/secrets/handlers/delete.write.ts +1 -1
- package/packages/bundled-features/src/secrets/handlers/list.query.ts +1 -1
- package/packages/bundled-features/src/secrets/handlers/set.write.ts +1 -1
- package/packages/bundled-features/src/secrets/i18n.ts +1 -1
- package/packages/bundled-features/src/secrets/index.ts +8 -8
- package/packages/bundled-features/src/secrets/{constants.ts → web/constants.ts} +0 -1
- package/packages/bundled-features/src/secrets/write-gate.ts +1 -1
- package/packages/bundled-features/src/sessions/feature.ts +7 -4
- package/packages/bundled-features/src/sessions/{i18n.ts → web/i18n.ts} +0 -1
- package/packages/bundled-features/src/shared/index.ts +6 -1
- package/packages/bundled-features/src/shared/purge-files-reaching-subject.ts +10 -2
- package/packages/bundled-features/src/shared/web/translate-or-raw.ts +0 -1
- package/packages/bundled-features/src/subscription-stripe/feature.ts +2 -0
- package/packages/bundled-features/src/subscription-stripe/plugin-methods.ts +19 -0
- package/packages/bundled-features/src/subscription-stripe/verify-webhook.ts +1 -0
- package/packages/bundled-features/src/tags/changes.json +6 -0
- package/packages/bundled-features/src/tags/feature.ts +1 -1
- package/packages/bundled-features/src/tags/handlers/assign-tag.write.ts +11 -7
- package/packages/bundled-features/src/tags/handlers/create-tag.write.ts +1 -1
- package/packages/bundled-features/src/tags/handlers/delete-tag.write.ts +4 -1
- package/packages/bundled-features/src/tags/handlers/remove-tag.write.ts +1 -1
- package/packages/bundled-features/src/tags/handlers/update-tag.write.ts +1 -1
- package/packages/bundled-features/src/tags/index.ts +12 -12
- package/packages/bundled-features/src/tags/screens.ts +1 -1
- package/packages/bundled-features/src/tags/web/client-plugin.tsx +1 -3
- package/packages/bundled-features/src/tags/{constants.ts → web/constants.ts} +4 -1
- package/packages/bundled-features/src/tags/web/entity-tags.tsx +1 -2
- package/packages/bundled-features/src/tags/web/i18n.ts +2 -2
- package/packages/bundled-features/src/tags/web/index.ts +2 -3
- package/packages/bundled-features/src/tags/web/tag-chip.tsx +0 -1
- package/packages/bundled-features/src/tags/web/tag-filter.tsx +1 -2
- package/packages/bundled-features/src/tags/web/tag-manager.tsx +5 -4
- package/packages/bundled-features/src/tags/web/tag-picker.tsx +0 -1
- package/packages/bundled-features/src/tags/web/tag-section.tsx +1 -2
- package/packages/bundled-features/src/tags/web/tags-cell.tsx +1 -2
- package/packages/bundled-features/src/template-resolver/README.md +1 -1
- package/packages/bundled-features/src/template-resolver/api.ts +75 -28
- package/packages/bundled-features/src/template-resolver/changes.json +63 -0
- package/packages/bundled-features/src/template-resolver/compile-document-body.ts +62 -4
- package/packages/bundled-features/src/template-resolver/compile-steps-block.ts +2 -2
- package/packages/bundled-features/src/template-resolver/document-ops.ts +5 -5
- package/packages/bundled-features/src/template-resolver/document-sanitizer.ts +39 -4
- package/packages/bundled-features/src/template-resolver/feature.ts +88 -38
- package/packages/bundled-features/src/template-resolver/handlers/by-slug.query.ts +6 -1
- package/packages/bundled-features/src/template-resolver/handlers/by-tenant.query.ts +6 -2
- package/packages/bundled-features/src/template-resolver/handlers/collection-item.query.ts +1 -1
- package/packages/bundled-features/src/template-resolver/handlers/collection-list.query.ts +1 -1
- package/packages/bundled-features/src/template-resolver/handlers/collection-set.write.ts +20 -7
- package/packages/bundled-features/src/template-resolver/handlers/collection-shared.ts +0 -6
- package/packages/bundled-features/src/template-resolver/handlers/copy-locale.write.ts +69 -60
- package/packages/bundled-features/src/template-resolver/handlers/diff-to-system.query.ts +7 -1
- package/packages/bundled-features/src/template-resolver/handlers/discard-draft.write.ts +37 -14
- package/packages/bundled-features/src/template-resolver/handlers/document-base.ts +8 -2
- package/packages/bundled-features/src/template-resolver/handlers/document-blocks.query.ts +2 -2
- package/packages/bundled-features/src/template-resolver/handlers/export-bundle.query.ts +5 -2
- package/packages/bundled-features/src/template-resolver/handlers/find-by-id.query.ts +4 -2
- package/packages/bundled-features/src/template-resolver/handlers/import-bundle.write.ts +37 -28
- package/packages/bundled-features/src/template-resolver/handlers/layout-source.query.ts +10 -5
- package/packages/bundled-features/src/template-resolver/handlers/list.query.ts +5 -2
- package/packages/bundled-features/src/template-resolver/handlers/overview.query.ts +132 -70
- package/packages/bundled-features/src/template-resolver/handlers/patch-draft.write.ts +106 -97
- package/packages/bundled-features/src/template-resolver/handlers/reset-to-system.write.ts +62 -49
- package/packages/bundled-features/src/template-resolver/handlers/resource-link-pdf.write.ts +44 -29
- package/packages/bundled-features/src/template-resolver/handlers/resource-remove.write.ts +52 -36
- package/packages/bundled-features/src/template-resolver/handlers/resource-shared.ts +1 -1
- package/packages/bundled-features/src/template-resolver/handlers/resource-upload.write.ts +127 -107
- package/packages/bundled-features/src/template-resolver/handlers/send-test-shared.ts +38 -0
- package/packages/bundled-features/src/template-resolver/handlers/send-test-status.query.ts +31 -0
- package/packages/bundled-features/src/template-resolver/handlers/send-test.write.ts +106 -112
- package/packages/bundled-features/src/template-resolver/handlers/set.write.ts +111 -104
- package/packages/bundled-features/src/template-resolver/handlers/shared.ts +1 -1
- package/packages/bundled-features/src/template-resolver/handlers/template-gates.ts +6 -6
- package/packages/bundled-features/src/template-resolver/handlers/template-write.ts +2 -2
- package/packages/bundled-features/src/template-resolver/handlers/toggle-status.write.ts +56 -28
- package/packages/bundled-features/src/template-resolver/handlers/upsert-tenant.write.ts +38 -29
- package/packages/bundled-features/src/template-resolver/handlers/usage.query.ts +8 -2
- package/packages/bundled-features/src/template-resolver/handlers/validate.query.ts +4 -2
- package/packages/bundled-features/src/template-resolver/i18n.ts +25 -0
- package/packages/bundled-features/src/template-resolver/index.ts +68 -60
- package/packages/bundled-features/src/template-resolver/layout-appearance.ts +1 -1
- package/packages/bundled-features/src/template-resolver/layout-regions.ts +1 -1
- package/packages/bundled-features/src/template-resolver/seeding.ts +16 -7
- package/packages/bundled-features/src/template-resolver/store-template-resource.ts +2 -2
- package/packages/bundled-features/src/template-resolver/table.ts +1 -1
- package/packages/bundled-features/src/template-resolver/template-bundle.ts +2 -2
- package/packages/bundled-features/src/template-resolver/template-delivery-policy.ts +82 -0
- package/packages/bundled-features/src/template-resolver/template-draft.ts +1 -1
- package/packages/bundled-features/src/template-resolver/template-edit-policy.ts +91 -0
- package/packages/bundled-features/src/template-resolver/template-meta.ts +2 -2
- package/packages/bundled-features/src/template-resolver/template-preview.ts +22 -12
- package/packages/bundled-features/src/template-resolver/template-usage.ts +1 -1
- package/packages/bundled-features/src/template-resolver/template-validation.ts +33 -12
- package/packages/bundled-features/src/template-resolver/testing.ts +2 -2
- package/packages/bundled-features/src/template-resolver/user-content-table.ts +1 -1
- package/packages/bundled-features/src/template-resolver/web/client-plugin.tsx +4 -5
- package/packages/bundled-features/src/template-resolver/{constants.ts → web/constants.ts} +10 -10
- package/packages/bundled-features/src/template-resolver/{document-blocks.ts → web/document-blocks.ts} +3 -2
- package/packages/bundled-features/src/template-resolver/web/document-editor-extensions.ts +31 -3
- package/packages/bundled-features/src/template-resolver/web/document-editor.tsx +0 -1
- package/packages/bundled-features/src/template-resolver/web/document-images.ts +28 -0
- package/packages/bundled-features/src/template-resolver/{document-schema.ts → web/document-schema.ts} +5 -1
- package/packages/bundled-features/src/template-resolver/{document-steps.ts → web/document-steps.ts} +0 -1
- package/packages/bundled-features/src/template-resolver/web/document-tiptap-editor.tsx +48 -11
- package/packages/bundled-features/src/template-resolver/web/document-toolbar-blocks.ts +4 -3
- package/packages/bundled-features/src/template-resolver/web/editor-handle.ts +1 -2
- package/packages/bundled-features/src/template-resolver/web/i18n.ts +8 -1
- package/packages/bundled-features/src/template-resolver/web/index.ts +13 -14
- package/packages/bundled-features/src/template-resolver/{mail-constants.ts → web/mail-constants.ts} +0 -1
- package/packages/bundled-features/src/template-resolver/{pdf-constants.ts → web/pdf-constants.ts} +0 -1
- package/packages/bundled-features/src/template-resolver/web/placeholder-line-editor-lazy.tsx +0 -1
- package/packages/bundled-features/src/template-resolver/web/placeholder-line-editor.tsx +5 -4
- package/packages/bundled-features/src/template-resolver/{placeholder-text.ts → web/placeholder-text.ts} +0 -1
- package/packages/bundled-features/src/template-resolver/{qualified-names.ts → web/qualified-names.ts} +2 -1
- package/packages/bundled-features/src/template-resolver/web/use-stable-by-key.ts +0 -1
- package/packages/bundled-features/src/tenant/handlers/add-member.write.ts +1 -1
- package/packages/bundled-features/src/tenant/index.ts +7 -7
- package/packages/bundled-features/src/tenant/invitation-table.ts +1 -1
- package/packages/bundled-features/src/tenant/invited-membership.ts +1 -1
- package/packages/bundled-features/src/tenant/last-tenant-admin.ts +1 -1
- package/packages/bundled-features/src/tenant/member-role-options.ts +1 -1
- package/packages/bundled-features/src/tenant/screens.ts +2 -2
- package/packages/bundled-features/src/tenant/web/client-plugin.tsx +1 -2
- package/packages/bundled-features/src/tenant/{constants.ts → web/constants.ts} +3 -6
- package/packages/bundled-features/src/tenant/web/index.ts +0 -1
- package/packages/bundled-features/src/tenant/web/member-roles-cell.tsx +0 -1
- package/packages/bundled-features/src/tenant/web/member-status-cell.tsx +0 -1
- package/packages/bundled-features/src/tenant-lifecycle/stages.ts +2 -2
- package/packages/bundled-features/src/tier-engine/entity.ts +1 -1
- package/packages/bundled-features/src/tier-engine/feature.ts +7 -7
- package/packages/bundled-features/src/tier-engine/handlers/set-tenant-tier.write.ts +1 -1
- package/packages/bundled-features/src/tier-engine/index.ts +8 -8
- package/packages/bundled-features/src/tier-engine/web/client-plugin.tsx +2 -3
- package/packages/bundled-features/src/tier-engine/{constants.ts → web/constants.ts} +2 -3
- package/packages/bundled-features/src/tier-engine/{i18n.ts → web/i18n.ts} +0 -1
- package/packages/bundled-features/src/tier-engine/web/index.ts +0 -1
- package/packages/bundled-features/src/user/handlers/create.write.ts +1 -1
- package/packages/bundled-features/src/user/handlers/update-roles.ts +1 -1
- package/packages/bundled-features/src/user/handlers/update.write.ts +1 -1
- package/packages/bundled-features/src/user/index.ts +1 -1
- package/packages/bundled-features/src/user/invited-global-roles.ts +1 -1
- package/packages/bundled-features/src/user/schema/user.ts +1 -1
- package/packages/bundled-features/src/user/{constants.ts → web/constants.ts} +0 -1
- package/packages/bundled-features/src/user-data-rights/changes.json +14 -0
- package/packages/bundled-features/src/user-data-rights/env.ts +1 -1
- package/packages/bundled-features/src/user-data-rights/feature.ts +9 -9
- package/packages/bundled-features/src/user-data-rights/index.ts +1 -1
- package/packages/bundled-features/src/user-data-rights/lib/resolve-tenant-model.ts +1 -1
- package/packages/bundled-features/src/user-data-rights/mail-notifications.ts +1 -1
- package/packages/bundled-features/src/user-data-rights/web/client-plugin.tsx +2 -3
- package/packages/bundled-features/src/user-data-rights/web/confirm-deletion-screen.tsx +0 -1
- package/packages/bundled-features/src/user-data-rights/{constants.ts → web/constants.ts} +11 -12
- package/packages/bundled-features/src/user-data-rights/web/default-translations.ts +91 -0
- package/packages/bundled-features/src/user-data-rights/web/i18n.ts +41 -91
- package/packages/bundled-features/src/user-data-rights/web/index.ts +1 -2
- package/packages/bundled-features/src/user-data-rights/web/privacy-center-screen.tsx +1 -2
- package/packages/bundled-features/src/user-data-rights/web/public-deletion-gate.tsx +0 -1
- package/packages/bundled-features/src/user-data-rights/web/request-deletion-screen.tsx +0 -1
- package/packages/bundled-features/src/user-data-rights-defaults/hooks/file-ref.userdata-hook.ts +10 -1
- package/packages/bundled-features/src/user-profile/feature.ts +2 -2
- package/packages/bundled-features/src/user-profile/handlers/change-email.write.ts +1 -1
- package/packages/bundled-features/src/user-profile/index.ts +3 -2
- package/packages/bundled-features/src/user-profile/web/client-plugin.ts +2 -3
- package/packages/bundled-features/src/user-profile/{constants.ts → web/constants.ts} +0 -1
- package/packages/bundled-features/src/user-profile/{i18n.ts → web/i18n.ts} +0 -1
- package/packages/bundled-features/src/user-profile/web/profile-screen.tsx +2 -3
- package/packages/bundled-features/src/waitlist/changes.json +6 -0
- package/packages/bundled-features/src/waitlist/entity.ts +1 -1
- package/packages/bundled-features/src/waitlist/feature.ts +5 -5
- package/packages/bundled-features/src/waitlist/handlers/export-purge.write.ts +3 -3
- package/packages/bundled-features/src/waitlist/handlers/invite.write.ts +5 -1
- package/packages/bundled-features/src/waitlist/handlers/reject.write.ts +1 -1
- package/packages/bundled-features/src/waitlist/handlers/submit.write.ts +3 -3
- package/packages/bundled-features/src/waitlist/import.ts +1 -1
- package/packages/bundled-features/src/waitlist/index.ts +11 -11
- package/packages/bundled-features/src/waitlist/legacy-migrate.ts +1 -1
- package/packages/bundled-features/src/waitlist/link-on-signup.ts +1 -1
- package/packages/bundled-features/src/waitlist/mail.ts +7 -6
- package/packages/bundled-features/src/waitlist/payloads.ts +1 -1
- package/packages/bundled-features/src/waitlist/screens.ts +1 -1
- package/packages/bundled-features/src/waitlist/{constants.ts → web/constants.ts} +0 -1
- package/samples/apps/styleguide/src/features/content/web.tsx +0 -1
- package/samples/apps/ui-walkthrough/src/app/client.tsx +2 -0
- package/samples/apps/ui-walkthrough/src/app/help-action.tsx +37 -0
- package/samples/apps/ui-walkthrough/src/app/seed-rental.ts +17 -1
- package/samples/apps/ui-walkthrough/src/app/seed-templates.ts +13 -0
- package/samples/apps/ui-walkthrough/src/app/server.ts +2 -1
- package/samples/apps/ui-walkthrough/src/app/shell.tsx +6 -0
- package/samples/apps/ui-walkthrough/src/app/template-seed-data.ts +20 -0
- package/samples/apps/ui-walkthrough/src/features/billing/feature.ts +35 -7
- package/samples/apps/ui-walkthrough/src/features/billing/i18n.ts +6 -0
- package/samples/apps/ui-walkthrough/src/features/rental/entities.ts +27 -0
- package/samples/apps/ui-walkthrough/src/features/rental/feature.ts +120 -2
- package/samples/apps/ui-walkthrough/src/features/rental/i18n.ts +94 -0
- package/samples/apps/ui-walkthrough/src/features/rental/invoice-receive.ts +19 -0
- package/samples/apps/ui-walkthrough/src/features/rental/lease-support.ts +32 -1
- package/samples/apps/ui-walkthrough/src/features/rental/qualified-names.ts +5 -0
- package/samples/apps/ui-walkthrough/src/features/rental/receipts-upload.ts +70 -0
- package/samples/apps/ui-walkthrough/src/features/rental/screens.ts +156 -0
- package/samples/apps/ui-walkthrough/src/features/subscription-plans/feature.ts +103 -0
- package/samples/apps/ui-walkthrough/src/features/subscription-plans/i18n.ts +36 -0
- package/samples/apps/ui-walkthrough/src/features/subscription-plans/index.ts +2 -0
- package/samples/apps/ui-walkthrough/src/features/subscription-plans/seed.ts +21 -0
- package/samples/apps/ui-walkthrough/src/features/tasks/i18n.ts +8 -0
- package/samples/apps/ui-walkthrough/src/run-config.ts +43 -3
- package/samples/apps/use-all-bundled/e2e-billing-gallery/server.ts +1 -1
- package/samples/apps/use-all-bundled/feature-manifest.json +5 -5
- package/samples/apps/use-all-bundled/scripts/check-coverage.ts +1 -1
- package/samples/apps/use-all-bundled/src/app/dev-app-options.ts +3 -1
- package/samples/recipes/compose-stacks/README.md +1 -2
- package/samples/recipes/delivery-notifications/README.md +1 -1
- package/samples/recipes/embedded/README.md +8 -0
- package/samples/recipes/embedded/src/feature.ts +8 -0
- package/samples/recipes/embedded/src/handlers/invoice-receive.write.ts +37 -0
- package/samples/recipes/embedded/src/screens/invoice-receive.screen.ts +56 -0
- package/samples/recipes/legal-pages/README.md +2 -2
- package/samples/recipes/legal-pages/src/feature.ts +1 -1
- package/samples/recipes/reference-data/src/feature.ts +3 -7
- package/packages/bundled-features/src/admin-shell/i18n.ts +0 -54
- package/packages/bundled-features/src/audit/i18n.ts +0 -25
- package/packages/bundled-features/src/auth-mfa/web/qrcode-browser.d.ts +0 -11
- package/packages/bundled-features/src/jobs/i18n.ts +0 -55
- package/packages/bundled-features/src/managed-pages/i18n.ts +0 -63
- package/packages/bundled-features/src/presets/dsgvo-self-service.ts +0 -35
- package/packages/bundled-features/src/user-data-rights/i18n.ts +0 -44
|
@@ -7,12 +7,12 @@ import type {
|
|
|
7
7
|
import type { Element as ScanElement } from "happy-dom";
|
|
8
8
|
import * as z from "zod";
|
|
9
9
|
import { conditionScopeElement, withParsedDocument } from "./document-sanitizer.ts";
|
|
10
|
+
import type { TemplateMeta } from "./template-meta.ts";
|
|
10
11
|
import {
|
|
11
12
|
DOCUMENT_CONDITION_ATTRIBUTE,
|
|
12
13
|
isDocumentPlaceholderHref,
|
|
13
14
|
isDocumentReferenceName,
|
|
14
|
-
} from "./document-schema.ts";
|
|
15
|
-
import type { TemplateMeta } from "./template-meta.ts";
|
|
15
|
+
} from "./web/document-schema.ts";
|
|
16
16
|
|
|
17
17
|
export const SYSTEM_PLACEHOLDERS: ReadonlySet<string> = new Set([
|
|
18
18
|
"tenantName",
|
|
@@ -65,6 +65,7 @@ const scalarVariableSchema = z.discriminatedUnion("type", [
|
|
|
65
65
|
|
|
66
66
|
const variableDefSchema = z.union([
|
|
67
67
|
scalarVariableSchema,
|
|
68
|
+
z.object({ ...variableCommon, type: z.literal("images") }),
|
|
68
69
|
z.object({
|
|
69
70
|
...variableCommon,
|
|
70
71
|
type: z.literal("list"),
|
|
@@ -126,17 +127,24 @@ function listItemFields(
|
|
|
126
127
|
return def?.type === "list" ? def.item : {};
|
|
127
128
|
}
|
|
128
129
|
|
|
130
|
+
// An images variable holds file ids: as text it would leak them, so only an images block
|
|
131
|
+
// (and a condition on its presence) may name it.
|
|
129
132
|
function isKnownName(
|
|
130
133
|
name: string,
|
|
131
134
|
scope: PlaceholderScope,
|
|
132
135
|
itemFields: Readonly<Record<string, unknown>>,
|
|
136
|
+
allowImages = false,
|
|
133
137
|
): Resolution {
|
|
134
138
|
const { variables } = scope;
|
|
135
139
|
const root = rootName(name);
|
|
136
140
|
// Declared variables and item fields are scalars: a dotted path under one never renders a value.
|
|
137
141
|
if (Object.hasOwn(itemFields, name)) return { known: true, used: "" };
|
|
138
142
|
if (scope.systemPlaceholders.has(root)) return { known: true, used: "" };
|
|
139
|
-
if (Object.hasOwn(variables, name))
|
|
143
|
+
if (Object.hasOwn(variables, name)) {
|
|
144
|
+
return variables[name]?.type === "images" && !allowImages
|
|
145
|
+
? { known: false, used: "" }
|
|
146
|
+
: { known: true, used: name };
|
|
147
|
+
}
|
|
140
148
|
return { known: false, used: "" };
|
|
141
149
|
}
|
|
142
150
|
|
|
@@ -144,8 +152,9 @@ function recordName(
|
|
|
144
152
|
name: string,
|
|
145
153
|
itemFields: Readonly<Record<string, unknown>>,
|
|
146
154
|
scope: PlaceholderScope,
|
|
155
|
+
allowImages = false,
|
|
147
156
|
) {
|
|
148
|
-
const resolution = isKnownName(name, scope, itemFields);
|
|
157
|
+
const resolution = isKnownName(name, scope, itemFields, allowImages);
|
|
149
158
|
if (!resolution.known) scope.unknown.add(name);
|
|
150
159
|
else if (resolution.used !== "") scope.used.add(resolution.used);
|
|
151
160
|
}
|
|
@@ -154,10 +163,18 @@ function enclosingEachName(element: ScanElement): string | null {
|
|
|
154
163
|
return element.closest("tr[data-each]")?.getAttribute("data-each") ?? null;
|
|
155
164
|
}
|
|
156
165
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
166
|
+
function nameAttributeOf(element: ScanElement): string | undefined {
|
|
167
|
+
const tag = element.tagName.toLowerCase();
|
|
168
|
+
if (tag === "span") return "data-variable";
|
|
169
|
+
if (tag !== "div") return undefined;
|
|
170
|
+
return element.hasAttribute("data-images") ? "data-images" : "data-steps";
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
function recordImagesName(name: string, scope: PlaceholderScope): void {
|
|
174
|
+
const def = Object.hasOwn(scope.variables, name) ? scope.variables[name] : undefined;
|
|
175
|
+
if (def?.type === "images") scope.used.add(name);
|
|
176
|
+
else scope.unknown.add(name);
|
|
177
|
+
}
|
|
161
178
|
|
|
162
179
|
function scanRepeatRows(root: ScanElement, scope: PlaceholderScope): void {
|
|
163
180
|
for (const element of Array.from(root.querySelectorAll("tr[data-each]"))) {
|
|
@@ -174,18 +191,22 @@ function scanConditions(root: ScanElement, scope: PlaceholderScope): void {
|
|
|
174
191
|
scope.variables,
|
|
175
192
|
enclosingEachName(conditionScopeElement(element)),
|
|
176
193
|
);
|
|
177
|
-
recordName(element.getAttribute(DOCUMENT_CONDITION_ATTRIBUTE) ?? "", itemFields, scope);
|
|
194
|
+
recordName(element.getAttribute(DOCUMENT_CONDITION_ATTRIBUTE) ?? "", itemFields, scope, true);
|
|
178
195
|
}
|
|
179
196
|
}
|
|
180
197
|
|
|
181
198
|
function scanReferences(root: ScanElement, scope: PlaceholderScope): void {
|
|
182
199
|
for (const element of Array.from(
|
|
183
|
-
root.querySelectorAll(
|
|
200
|
+
root.querySelectorAll(
|
|
201
|
+
"span[data-variable], div[data-steps], div[data-images], a[href], img[data-resource]",
|
|
202
|
+
),
|
|
184
203
|
)) {
|
|
185
204
|
const itemFields = listItemFields(scope.variables, enclosingEachName(element));
|
|
186
205
|
const tag = element.tagName.toLowerCase();
|
|
187
|
-
const nameAttribute =
|
|
188
|
-
if (nameAttribute
|
|
206
|
+
const nameAttribute = nameAttributeOf(element);
|
|
207
|
+
if (nameAttribute === "data-images") {
|
|
208
|
+
recordImagesName(element.getAttribute(nameAttribute) ?? "", scope);
|
|
209
|
+
} else if (nameAttribute !== undefined) {
|
|
189
210
|
recordName(element.getAttribute(nameAttribute) ?? "", itemFields, scope);
|
|
190
211
|
} else if (tag === "a") {
|
|
191
212
|
const href = element.getAttribute("href") ?? "";
|
|
@@ -6,6 +6,7 @@ import type { DbConnection } from "@cosmicdrift/kumiko-framework/db";
|
|
|
6
6
|
import { seedRow } from "@cosmicdrift/kumiko-testing/helpers";
|
|
7
7
|
import type { ResolveRequest, TemplateResource } from "./api.ts";
|
|
8
8
|
import { TemplateNotFoundError } from "./api.ts";
|
|
9
|
+
import { templateResourcesTable } from "./table.ts";
|
|
9
10
|
import {
|
|
10
11
|
type ContentFormat,
|
|
11
12
|
FALLBACK_LOCALE,
|
|
@@ -13,8 +14,7 @@ import {
|
|
|
13
14
|
SYSTEM_TENANT_ID,
|
|
14
15
|
type TemplateScope,
|
|
15
16
|
type TemplateStatus,
|
|
16
|
-
} from "./constants.ts";
|
|
17
|
-
import { templateResourcesTable } from "./table.ts";
|
|
17
|
+
} from "./web/constants.ts";
|
|
18
18
|
|
|
19
19
|
export type TemplateConsumer = {
|
|
20
20
|
readonly resolve: (args: ResolveRequest) => Promise<TemplateResource>;
|
|
@@ -5,8 +5,8 @@ import {
|
|
|
5
5
|
createSelectField,
|
|
6
6
|
createTextField,
|
|
7
7
|
} from "@cosmicdrift/kumiko-framework/engine";
|
|
8
|
-
import { CONTENT_FORMATS, TEMPLATE_KINDS } from "./constants.ts";
|
|
9
8
|
import type { EntityAuditColumns } from "./table.ts";
|
|
9
|
+
import { CONTENT_FORMATS, TEMPLATE_KINDS } from "./web/constants.ts";
|
|
10
10
|
|
|
11
11
|
// UserContentEntry — the per-user half of the content store: mail signatures
|
|
12
12
|
// and personal reply snippets, one row per (tenantId, ownerId, slug, kind,
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { EMPTY_VALUE_PLACEHOLDER } from "@cosmicdrift/kumiko-renderer/headless";
|
|
2
|
-
// @runtime client
|
|
3
2
|
// Client feature factory for the text-block content tree. Apps mount it via
|
|
4
3
|
// createKumikoApp({ clientFeatures: [textBlocksClient()] }); it loads the
|
|
5
4
|
// blocks from the by-tenant query, groups them by their `folder` field and
|
|
@@ -35,15 +34,15 @@ import {
|
|
|
35
34
|
} from "@cosmicdrift/kumiko-renderer/web";
|
|
36
35
|
import type { ContentEditorFormat } from "@cosmicdrift/kumiko-types/nav";
|
|
37
36
|
import { type FormEvent, type ReactNode, useEffect, useId, useState } from "react";
|
|
37
|
+
import { DocumentBlocksContext, DocumentContentEditor } from "./document-editor.tsx";
|
|
38
|
+
import { documentBlocksForKind } from "./document-toolbar-blocks.ts";
|
|
39
|
+
import { defaultTranslations } from "./i18n.ts";
|
|
38
40
|
import {
|
|
39
41
|
collectionHandlerName,
|
|
40
42
|
collectionQueryName,
|
|
41
43
|
TemplateResolverHandlers,
|
|
42
44
|
TemplateResolverQueries,
|
|
43
|
-
} from "
|
|
44
|
-
import { DocumentBlocksContext, DocumentContentEditor } from "./document-editor.tsx";
|
|
45
|
-
import { documentBlocksForKind } from "./document-toolbar-blocks.ts";
|
|
46
|
-
import { defaultTranslations } from "./i18n.ts";
|
|
45
|
+
} from "./qualified-names.ts";
|
|
47
46
|
|
|
48
47
|
// Exported for the unit test — groupBlocksByFolder is a pure function.
|
|
49
48
|
export type BlockSummary = {
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
// @runtime client
|
|
2
1
|
// Plain data, no imports — the content tree in web/ needs TEXT_BLOCK_KIND to
|
|
3
2
|
// pick between the public and the admin query.
|
|
4
3
|
//
|
|
5
|
-
// RenderKind
|
|
6
|
-
//
|
|
7
|
-
//
|
|
8
|
-
// (markdown/mjml/html) entscheidet wer's rendert.
|
|
4
|
+
// RenderKind identifies the consumer class of a template. Plugin renderers in
|
|
5
|
+
// `renderer-foundation` match on kind; the resolver here is kind-agnostic: it
|
|
6
|
+
// only loads, and the content format (markdown/mjml/html) decides who renders it.
|
|
9
7
|
export const RENDER_KINDS = ["mail", "document-pdf", "image-snapshot"] as const;
|
|
10
8
|
export type RenderKind = (typeof RENDER_KINDS)[number];
|
|
11
9
|
|
|
@@ -92,10 +90,12 @@ export const MAIL_PREVIEW_MAX_BYTES = 10 * 1024 * 1024;
|
|
|
92
90
|
|
|
93
91
|
export const TEST_MAIL_SUBJECT_PREFIX = "[TEST] ";
|
|
94
92
|
|
|
95
|
-
// System
|
|
96
|
-
|
|
97
|
-
export { SYSTEM_TENANT_ID } from "@cosmicdrift/kumiko-framework/engine";
|
|
93
|
+
// System templates live under the SYSTEM_TENANT_ID sentinel; the client-safe types package is its single source.
|
|
94
|
+
export { SYSTEM_TENANT_ID } from "@cosmicdrift/kumiko-types/identifiers";
|
|
98
95
|
|
|
99
|
-
// Default
|
|
100
|
-
//
|
|
96
|
+
// Default locale when the tenant configures none. The resolver falls back to
|
|
97
|
+
// it when the requested locale and the tenant default are missing.
|
|
101
98
|
export const FALLBACK_LOCALE = "de";
|
|
99
|
+
|
|
100
|
+
// A collection mounted without `access` is maintained by the platform only; TenantAdmin access is an explicit mount decision.
|
|
101
|
+
export const DEFAULT_COLLECTION_ACCESS = { roles: ["SystemAdmin"] } as const;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
// @runtime client
|
|
2
1
|
export type DocumentToolbarBlock =
|
|
3
2
|
| "image"
|
|
4
3
|
| "table"
|
|
@@ -7,7 +6,8 @@ export type DocumentToolbarBlock =
|
|
|
7
6
|
| "repeat"
|
|
8
7
|
| "pageBreak"
|
|
9
8
|
| "align"
|
|
10
|
-
| "steps"
|
|
9
|
+
| "steps"
|
|
10
|
+
| "images";
|
|
11
11
|
|
|
12
12
|
export const MAIL_DOCUMENT_BLOCKS = [
|
|
13
13
|
"image",
|
|
@@ -25,6 +25,7 @@ export const PDF_DOCUMENT_BLOCKS = [
|
|
|
25
25
|
"divider",
|
|
26
26
|
"repeat",
|
|
27
27
|
"steps",
|
|
28
|
+
"images",
|
|
28
29
|
"pageBreak",
|
|
29
30
|
] as const satisfies readonly DocumentToolbarBlock[];
|
|
30
31
|
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
// @runtime client
|
|
2
1
|
import type { Extensions, NodeViewRenderer } from "@tiptap/core";
|
|
3
2
|
import { ListKeymap } from "@tiptap/extension-list";
|
|
4
3
|
import { Dropcursor, Gapcursor, Placeholder, UndoRedo } from "@tiptap/extensions";
|
|
5
4
|
import type { Node as ProseMirrorNode } from "@tiptap/pm/model";
|
|
6
5
|
import {
|
|
7
6
|
DocumentButton,
|
|
7
|
+
DocumentImages,
|
|
8
8
|
DocumentPageBreak,
|
|
9
9
|
DocumentResource,
|
|
10
10
|
DocumentSteps,
|
|
11
11
|
DocumentVariable,
|
|
12
12
|
documentExtensions,
|
|
13
|
-
} from "
|
|
14
|
-
import { readDocumentStepsAttribute } from "
|
|
13
|
+
} from "./document-schema.ts";
|
|
14
|
+
import { readDocumentStepsAttribute } from "./document-steps.ts";
|
|
15
15
|
import type { DocumentResourcePreview } from "./document-toolbar-blocks.ts";
|
|
16
16
|
|
|
17
17
|
const DOCUMENT_RESOURCE_SIZE_TOKEN = "{size}";
|
|
@@ -23,6 +23,7 @@ export type DocumentEditorLabels = {
|
|
|
23
23
|
readonly pageBreak: string;
|
|
24
24
|
readonly button?: string;
|
|
25
25
|
readonly steps?: string;
|
|
26
|
+
readonly images?: string;
|
|
26
27
|
/** Canvas block label of an image, e.g. "Image · inline". */
|
|
27
28
|
readonly imageBlock?: string;
|
|
28
29
|
readonly variableLabels?: Readonly<Record<string, string>>;
|
|
@@ -206,6 +207,31 @@ function createStepsView(labels: DocumentEditorLabels): NodeViewRenderer {
|
|
|
206
207
|
};
|
|
207
208
|
}
|
|
208
209
|
|
|
210
|
+
// A sketch only: the photos are record data, known at render time.
|
|
211
|
+
function createImagesView(labels: DocumentEditorLabels): NodeViewRenderer {
|
|
212
|
+
return ({ node }) => {
|
|
213
|
+
const dom = createElementWithClass(
|
|
214
|
+
"div",
|
|
215
|
+
"relative my-3 rounded border border-dashed border-input px-3 pb-3 pt-4",
|
|
216
|
+
);
|
|
217
|
+
dom.setAttribute(DOCUMENT_BLOCK_ATTRIBUTE, "");
|
|
218
|
+
dom.contentEditable = "false";
|
|
219
|
+
const variable = String(node.attrs["variable"]);
|
|
220
|
+
const variableLabels = labels.variableLabels ?? {};
|
|
221
|
+
const variableLabel = Object.hasOwn(variableLabels, variable)
|
|
222
|
+
? variableLabels[variable]
|
|
223
|
+
: undefined;
|
|
224
|
+
dom.append(createBlockLabel(`${labels.images ?? "Photos"} · ${variableLabel ?? variable}`));
|
|
225
|
+
const grid = createElementWithClass("div", "grid grid-cols-2 gap-1.5");
|
|
226
|
+
grid.append(
|
|
227
|
+
createElementWithClass("div", "h-12 rounded bg-muted"),
|
|
228
|
+
createElementWithClass("div", "h-12 rounded bg-muted"),
|
|
229
|
+
);
|
|
230
|
+
dom.append(grid);
|
|
231
|
+
return { dom };
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
|
|
209
235
|
// Replaced by name, not appended: the schema must keep exactly one node per
|
|
210
236
|
// name, and only the editor view differs from the shared document schema.
|
|
211
237
|
export function createDocumentEditorExtensions(labels: DocumentEditorLabels): Extensions {
|
|
@@ -224,6 +250,8 @@ export function createDocumentEditorExtensions(labels: DocumentEditorLabels): Ex
|
|
|
224
250
|
: extension;
|
|
225
251
|
case DocumentSteps.name:
|
|
226
252
|
return DocumentSteps.extend({ addNodeView: () => createStepsView(labels) });
|
|
253
|
+
case DocumentImages.name:
|
|
254
|
+
return DocumentImages.extend({ addNodeView: () => createImagesView(labels) });
|
|
227
255
|
case DocumentPageBreak.name:
|
|
228
256
|
return DocumentPageBreak.extend({
|
|
229
257
|
addNodeView: () => createPageBreakView(labels.pageBreak),
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// The record's photos: a block bound to an `images` variable whose FileRef ids the
|
|
2
|
+
// app passes at render time. Universal like document-schema.ts.
|
|
3
|
+
import { Node } from "@tiptap/core";
|
|
4
|
+
|
|
5
|
+
export function createDocumentImagesNode(isReferenceName: (value: string) => boolean) {
|
|
6
|
+
return Node.create({
|
|
7
|
+
name: "images",
|
|
8
|
+
group: "block",
|
|
9
|
+
atom: true,
|
|
10
|
+
addAttributes() {
|
|
11
|
+
return { variable: { default: null } };
|
|
12
|
+
},
|
|
13
|
+
parseHTML() {
|
|
14
|
+
return [
|
|
15
|
+
{
|
|
16
|
+
tag: "div[data-images]",
|
|
17
|
+
getAttrs: (element) => {
|
|
18
|
+
const variable = element.getAttribute("data-images");
|
|
19
|
+
return variable !== null && isReferenceName(variable) ? { variable } : false;
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
];
|
|
23
|
+
},
|
|
24
|
+
renderHTML({ node }) {
|
|
25
|
+
return ["div", { "data-images": node.attrs["variable"] }];
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
// @runtime client
|
|
2
1
|
// Canonical document model for template bodies (kinds mail, document-pdf).
|
|
3
2
|
// Universal on purpose: the web editor and the server sanitizer load the same
|
|
4
3
|
// extension list, so what the editor can produce is exactly what the server
|
|
@@ -8,6 +7,7 @@ import { Extension, type Extensions, Node } from "@tiptap/core";
|
|
|
8
7
|
import { Link } from "@tiptap/extension-link";
|
|
9
8
|
import { Table, TableCell, TableHeader, TableRow } from "@tiptap/extension-table";
|
|
10
9
|
import StarterKit from "@tiptap/starter-kit";
|
|
10
|
+
import { createDocumentImagesNode } from "./document-images.ts";
|
|
11
11
|
import { createDocumentStepsNode } from "./document-steps.ts";
|
|
12
12
|
|
|
13
13
|
const PLACEHOLDER_HREF = /^\{\{(.+)\}\}$/;
|
|
@@ -73,6 +73,7 @@ export const DOCUMENT_NODE_NAMES = [
|
|
|
73
73
|
"divider",
|
|
74
74
|
"pageBreak",
|
|
75
75
|
"steps",
|
|
76
|
+
"images",
|
|
76
77
|
] as const;
|
|
77
78
|
|
|
78
79
|
export const DocumentVariable = Node.create({
|
|
@@ -184,6 +185,8 @@ export const DocumentPageBreak = Node.create({
|
|
|
184
185
|
|
|
185
186
|
export const DocumentSteps = createDocumentStepsNode(isDocumentReferenceName);
|
|
186
187
|
|
|
188
|
+
export const DocumentImages = createDocumentImagesNode(isDocumentReferenceName);
|
|
189
|
+
|
|
187
190
|
// A repeat row is a table row carrying `each`: prosemirror-tables requires
|
|
188
191
|
// the tableRow node type, so a separate node type is not an option.
|
|
189
192
|
export const DocumentTableRow = TableRow.extend({
|
|
@@ -378,6 +381,7 @@ export const documentExtensions: Extensions = [
|
|
|
378
381
|
DocumentDivider,
|
|
379
382
|
DocumentPageBreak,
|
|
380
383
|
DocumentSteps,
|
|
384
|
+
DocumentImages,
|
|
381
385
|
DocumentTextAlign,
|
|
382
386
|
DocumentTextSize,
|
|
383
387
|
DocumentCondition,
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
// @runtime client
|
|
2
1
|
//
|
|
3
2
|
// tiptap-backed implementation behind DocumentContentEditor's lazy() boundary —
|
|
4
3
|
// never import this file statically, tiptap must only load when a "document"
|
|
@@ -25,6 +24,7 @@ import {
|
|
|
25
24
|
Bold as BoldIcon,
|
|
26
25
|
Braces,
|
|
27
26
|
ChevronDown,
|
|
27
|
+
GalleryThumbnails,
|
|
28
28
|
Image as ImageIcon,
|
|
29
29
|
Italic as ItalicIcon,
|
|
30
30
|
Link as LinkIcon,
|
|
@@ -40,6 +40,10 @@ import {
|
|
|
40
40
|
} from "lucide-react";
|
|
41
41
|
import { Fragment, type ReactNode, useEffect, useMemo, useState } from "react";
|
|
42
42
|
import { createPortal } from "react-dom";
|
|
43
|
+
import {
|
|
44
|
+
createDocumentEditorExtensions,
|
|
45
|
+
DOCUMENT_BLOCK_ATTRIBUTE,
|
|
46
|
+
} from "./document-editor-extensions.ts";
|
|
43
47
|
import {
|
|
44
48
|
DOCUMENT_TEXT_ALIGNMENTS,
|
|
45
49
|
type DocumentTextAlignment,
|
|
@@ -47,12 +51,8 @@ import {
|
|
|
47
51
|
isDocumentPlaceholderHref,
|
|
48
52
|
isDocumentReferenceName,
|
|
49
53
|
isDocumentResourceKey,
|
|
50
|
-
} from "
|
|
51
|
-
import { parseDocumentStepsInput } from "
|
|
52
|
-
import {
|
|
53
|
-
createDocumentEditorExtensions,
|
|
54
|
-
DOCUMENT_BLOCK_ATTRIBUTE,
|
|
55
|
-
} from "./document-editor-extensions.ts";
|
|
54
|
+
} from "./document-schema.ts";
|
|
55
|
+
import { parseDocumentStepsInput } from "./document-steps.ts";
|
|
56
56
|
import {
|
|
57
57
|
type DocumentEditorProps,
|
|
58
58
|
type DocumentResourcePreview,
|
|
@@ -72,7 +72,15 @@ function previewsKey(previews: Readonly<Record<string, DocumentResourcePreview>>
|
|
|
72
72
|
.join("\n");
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
-
type PanelKind =
|
|
75
|
+
type PanelKind =
|
|
76
|
+
| "link"
|
|
77
|
+
| "placeholder"
|
|
78
|
+
| "image"
|
|
79
|
+
| "button"
|
|
80
|
+
| "repeat"
|
|
81
|
+
| "align"
|
|
82
|
+
| "steps"
|
|
83
|
+
| "images";
|
|
76
84
|
|
|
77
85
|
// Blocks that stay in the canvas toolbar; the rest moves into the overflow menu.
|
|
78
86
|
const CANVAS_INLINE_BLOCKS: readonly DocumentToolbarBlock[] = ["image", "table"];
|
|
@@ -83,6 +91,7 @@ const BLOCK_PANEL: Partial<Record<DocumentToolbarBlock, PanelKind>> = {
|
|
|
83
91
|
repeat: "repeat",
|
|
84
92
|
align: "align",
|
|
85
93
|
steps: "steps",
|
|
94
|
+
images: "images",
|
|
86
95
|
};
|
|
87
96
|
|
|
88
97
|
const ALIGNMENT_ICONS: Record<DocumentTextAlignment, ReactNode> = {
|
|
@@ -392,7 +401,11 @@ function InsertPanel({
|
|
|
392
401
|
};
|
|
393
402
|
|
|
394
403
|
const needsVariables =
|
|
395
|
-
kind === "button" ||
|
|
404
|
+
kind === "button" ||
|
|
405
|
+
kind === "repeat" ||
|
|
406
|
+
kind === "placeholder" ||
|
|
407
|
+
kind === "steps" ||
|
|
408
|
+
kind === "images";
|
|
396
409
|
const noVariables = needsVariables && selectable.length === 0;
|
|
397
410
|
const idPrefix = `${editorId}-panel`;
|
|
398
411
|
|
|
@@ -498,6 +511,16 @@ function InsertPanel({
|
|
|
498
511
|
onChange={setChosenName}
|
|
499
512
|
/>
|
|
500
513
|
)}
|
|
514
|
+
{kind === "images" && !noVariables && (
|
|
515
|
+
<NameSelect
|
|
516
|
+
id={`${idPrefix}-images-variable`}
|
|
517
|
+
label={t("template-resolver.documentEditor.imagesVariable")}
|
|
518
|
+
names={selectable}
|
|
519
|
+
labels={variableLabels}
|
|
520
|
+
value={selectedName}
|
|
521
|
+
onChange={setChosenName}
|
|
522
|
+
/>
|
|
523
|
+
)}
|
|
501
524
|
{kind === "steps" && !noVariables && (
|
|
502
525
|
<>
|
|
503
526
|
<NameSelect
|
|
@@ -551,6 +574,10 @@ function InsertPanel({
|
|
|
551
574
|
{...(kind === "repeat" &&
|
|
552
575
|
!noVariables && { onInsert: () => insertAndClose(repeatTableContent(selectedName)) })}
|
|
553
576
|
{...(kind === "steps" && !noVariables && { onInsert: submitSteps })}
|
|
577
|
+
{...(kind === "images" &&
|
|
578
|
+
!noVariables && {
|
|
579
|
+
onInsert: () => insertAndClose({ type: "images", attrs: { variable: selectedName } }),
|
|
580
|
+
})}
|
|
554
581
|
/>
|
|
555
582
|
</div>
|
|
556
583
|
</div>
|
|
@@ -563,7 +590,8 @@ export default function DocumentTiptapEditor({
|
|
|
563
590
|
onChange,
|
|
564
591
|
variables,
|
|
565
592
|
readOnly,
|
|
566
|
-
blocks = MAIL_DOCUMENT_BLOCKS,
|
|
593
|
+
blocks: configuredBlocks = MAIL_DOCUMENT_BLOCKS,
|
|
594
|
+
imageVariables = NO_NAMES,
|
|
567
595
|
variableLabels = NO_LABELS,
|
|
568
596
|
systemVariables = NO_NAMES,
|
|
569
597
|
resourcePreviews = NO_PREVIEWS,
|
|
@@ -581,6 +609,11 @@ export default function DocumentTiptapEditor({
|
|
|
581
609
|
const canvas = chrome === "canvas";
|
|
582
610
|
const compact = toolbar === "compact" && !canvas;
|
|
583
611
|
const hosted = toolbarHost !== undefined;
|
|
612
|
+
// A photo block needs an images variable to bind to; without one the button would open an empty panel.
|
|
613
|
+
const blocks =
|
|
614
|
+
imageVariables.length === 0
|
|
615
|
+
? configuredBlocks.filter((block) => block !== "images")
|
|
616
|
+
: configuredBlocks;
|
|
584
617
|
|
|
585
618
|
const placeholderLabel = t("template-resolver.documentEditor.placeholder");
|
|
586
619
|
const imageLabel = t("template-resolver.documentEditor.image");
|
|
@@ -588,6 +621,7 @@ export default function DocumentTiptapEditor({
|
|
|
588
621
|
const pageBreakLabel = t("template-resolver.documentEditor.pageBreak");
|
|
589
622
|
const buttonLabel = t("template-resolver.documentEditor.button");
|
|
590
623
|
const stepsLabel = t("template-resolver.documentEditor.steps");
|
|
624
|
+
const imagesLabel = t("template-resolver.documentEditor.images");
|
|
591
625
|
const stableLabels = useStableByKey(variableLabels, JSON.stringify(variableLabels));
|
|
592
626
|
const stableSystem = useStableByKey(systemVariables, systemVariables.join("\n"));
|
|
593
627
|
const stablePreviews = useStableByKey(resourcePreviews, previewsKey(resourcePreviews));
|
|
@@ -599,6 +633,7 @@ export default function DocumentTiptapEditor({
|
|
|
599
633
|
pageBreak: pageBreakLabel,
|
|
600
634
|
button: buttonLabel,
|
|
601
635
|
steps: stepsLabel,
|
|
636
|
+
images: imagesLabel,
|
|
602
637
|
imageBlock: imageBlockLabel,
|
|
603
638
|
variableLabels: stableLabels,
|
|
604
639
|
systemVariables: stableSystem,
|
|
@@ -612,6 +647,7 @@ export default function DocumentTiptapEditor({
|
|
|
612
647
|
pageBreakLabel,
|
|
613
648
|
buttonLabel,
|
|
614
649
|
stepsLabel,
|
|
650
|
+
imagesLabel,
|
|
615
651
|
stableLabels,
|
|
616
652
|
stableSystem,
|
|
617
653
|
stablePreviews,
|
|
@@ -731,6 +767,7 @@ export default function DocumentTiptapEditor({
|
|
|
731
767
|
pageBreak: { label: pageBreakLabel, icon: <Scissors size={16} /> },
|
|
732
768
|
align: { label: t("template-resolver.documentEditor.align"), icon: <AlignLeft size={16} /> },
|
|
733
769
|
steps: { label: stepsLabel, icon: <ListChecks size={16} /> },
|
|
770
|
+
images: { label: imagesLabel, icon: <GalleryThumbnails size={16} /> },
|
|
734
771
|
};
|
|
735
772
|
|
|
736
773
|
const repeatTable = activeState?.repeatTable ?? null;
|
|
@@ -1058,7 +1095,7 @@ export default function DocumentTiptapEditor({
|
|
|
1058
1095
|
editor={editor}
|
|
1059
1096
|
editorId={id}
|
|
1060
1097
|
kind={openPanel}
|
|
1061
|
-
variables={variables}
|
|
1098
|
+
variables={openPanel === "images" ? imageVariables : variables}
|
|
1062
1099
|
variableLabels={stableLabels}
|
|
1063
1100
|
onClose={() => setOpenPanel(null)}
|
|
1064
1101
|
/>
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
// @runtime client
|
|
2
1
|
import type { ContentEditorProps } from "@cosmicdrift/kumiko-renderer";
|
|
3
2
|
import type { ReactNode } from "react";
|
|
4
|
-
import type { DocumentToolbarBlock } from "
|
|
3
|
+
import type { DocumentToolbarBlock } from "./document-blocks.ts";
|
|
5
4
|
|
|
6
5
|
/** Imperative access for an outside panel (placeholder list, resource list). */
|
|
7
6
|
export type DocumentEditorHandle = {
|
|
@@ -22,6 +21,8 @@ export type DocumentEditorChrome = "default" | "canvas";
|
|
|
22
21
|
|
|
23
22
|
export type DocumentEditorProps = ContentEditorProps & {
|
|
24
23
|
readonly blocks?: readonly DocumentToolbarBlock[];
|
|
24
|
+
/** Names of the template's images variables; the photo block offers exactly these and is hidden without any. */
|
|
25
|
+
readonly imageVariables?: readonly string[];
|
|
25
26
|
/** Display label per variable name, as inserted (list item fields use the
|
|
26
27
|
* dotted form, e.g. "lines.description"). A chip shows label and name. */
|
|
27
28
|
readonly variableLabels?: Readonly<Record<string, string>>;
|
|
@@ -46,4 +47,4 @@ export {
|
|
|
46
47
|
documentBlocksForKind,
|
|
47
48
|
MAIL_DOCUMENT_BLOCKS,
|
|
48
49
|
PDF_DOCUMENT_BLOCKS,
|
|
49
|
-
} from "
|
|
50
|
+
} from "./document-blocks.ts";
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
// @runtime client
|
|
2
1
|
import type { Editor } from "@tiptap/core";
|
|
3
|
-
import { isDocumentReferenceName, isDocumentResourceKey } from "
|
|
2
|
+
import { isDocumentReferenceName, isDocumentResourceKey } from "./document-schema.ts";
|
|
4
3
|
import type { DocumentEditorHandle } from "./document-toolbar-blocks.ts";
|
|
5
4
|
|
|
6
5
|
export function createEditorHandle(editor: Editor): DocumentEditorHandle {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
// @runtime client
|
|
2
1
|
// Default translation bundle for the text-block editor. textBlocksClient()
|
|
3
2
|
// hangs it into the LocaleProvider as a fallback bundle — apps override
|
|
4
3
|
// individual keys via mergeTranslations at the createKumikoApp level.
|
|
@@ -43,6 +42,8 @@ export const defaultTranslations: TranslationsByLocale = {
|
|
|
43
42
|
"template-resolver.documentEditor.removeLink": "Remove link",
|
|
44
43
|
"template-resolver.documentEditor.repeat": "Repeat",
|
|
45
44
|
"template-resolver.documentEditor.repeatList": "List to repeat",
|
|
45
|
+
"template-resolver.documentEditor.images": "Photos",
|
|
46
|
+
"template-resolver.documentEditor.imagesVariable": "Photos from",
|
|
46
47
|
"template-resolver.documentEditor.steps": "Steps",
|
|
47
48
|
"template-resolver.documentEditor.stepsVariable": "Current step from",
|
|
48
49
|
"template-resolver.documentEditor.stepsList": "Steps, separated by commas (value=label)",
|
|
@@ -58,6 +59,8 @@ export const defaultTranslations: TranslationsByLocale = {
|
|
|
58
59
|
"template-resolver.editor.saving": "Saving…",
|
|
59
60
|
"template-resolver.editor.created": "Created.",
|
|
60
61
|
"template-resolver.editor.saved": "Saved.",
|
|
62
|
+
"templateResolver.errors.document.imagesBlockPdfOnly":
|
|
63
|
+
"Photo blocks are only allowed in PDF documents.",
|
|
61
64
|
"templateResolver.errors.document.buttonHrefNotPlaceholder":
|
|
62
65
|
"The button target “{detail}” must be a placeholder.",
|
|
63
66
|
"templateResolver.errors.document.disallowedLinkHref":
|
|
@@ -122,6 +125,10 @@ export const defaultTranslations: TranslationsByLocale = {
|
|
|
122
125
|
"templateResolver.errors.noDraft": "There is no draft to discard.",
|
|
123
126
|
"templateResolver.errors.systemOnlyTemplate":
|
|
124
127
|
"Only the platform maintains this template; it cannot be overridden per tenant.",
|
|
128
|
+
"templateResolver.errors.templateNotTenantEditable":
|
|
129
|
+
"Only the platform may edit this template.",
|
|
130
|
+
"templateResolver.overview.lockedOverride":
|
|
131
|
+
"Own version stored but not delivered: the template is not unlocked for tenants.",
|
|
125
132
|
"templateResolver.errors.template.invalidMeta": "The template settings are invalid.",
|
|
126
133
|
"templateResolver.errors.template.meta.subject.required": "The subject is missing.",
|
|
127
134
|
"templateResolver.errors.template.meta.subject.invalid":
|
|
@@ -1,23 +1,9 @@
|
|
|
1
|
-
// @runtime client
|
|
2
1
|
// Public exports for the browser side of template-resolver. Consumed through
|
|
3
2
|
// the sub-path export `@cosmicdrift/kumiko-bundled-features/template-resolver/web`
|
|
4
3
|
// — the server side (defineFeature) lives in
|
|
5
4
|
// `@cosmicdrift/kumiko-bundled-features/template-resolver` and has no React or
|
|
6
5
|
// DOM deps.
|
|
7
6
|
|
|
8
|
-
export { MAIL_TONES, type MailTone } from "../mail-constants.ts";
|
|
9
|
-
export {
|
|
10
|
-
PDF_DEFAULT_MARGIN_MM,
|
|
11
|
-
PDF_FOOTER_MARGIN_MM,
|
|
12
|
-
PDF_HEADER_MARGIN_MM,
|
|
13
|
-
PDF_ORIENTATIONS,
|
|
14
|
-
PDF_PAGE_FORMATS,
|
|
15
|
-
} from "../pdf-constants.ts";
|
|
16
|
-
export {
|
|
17
|
-
TemplateResolverErrors,
|
|
18
|
-
TemplateResolverHandlers,
|
|
19
|
-
TemplateResolverQueries,
|
|
20
|
-
} from "../qualified-names.ts";
|
|
21
7
|
export { textBlocksClient } from "./client-plugin.tsx";
|
|
22
8
|
export { DocumentContentEditor } from "./document-editor.tsx";
|
|
23
9
|
export {
|
|
@@ -29,7 +15,20 @@ export {
|
|
|
29
15
|
MAIL_DOCUMENT_BLOCKS,
|
|
30
16
|
PDF_DOCUMENT_BLOCKS,
|
|
31
17
|
} from "./document-toolbar-blocks.ts";
|
|
18
|
+
export { MAIL_TONES, type MailTone } from "./mail-constants.ts";
|
|
19
|
+
export {
|
|
20
|
+
PDF_DEFAULT_MARGIN_MM,
|
|
21
|
+
PDF_FOOTER_MARGIN_MM,
|
|
22
|
+
PDF_HEADER_MARGIN_MM,
|
|
23
|
+
PDF_ORIENTATIONS,
|
|
24
|
+
PDF_PAGE_FORMATS,
|
|
25
|
+
} from "./pdf-constants.ts";
|
|
32
26
|
export {
|
|
33
27
|
PlaceholderLineEditor,
|
|
34
28
|
type PlaceholderLineEditorProps,
|
|
35
29
|
} from "./placeholder-line-editor-lazy.tsx";
|
|
30
|
+
export {
|
|
31
|
+
TemplateResolverErrors,
|
|
32
|
+
TemplateResolverHandlers,
|
|
33
|
+
TemplateResolverQueries,
|
|
34
|
+
} from "./qualified-names.ts";
|