@cosmicdrift/kumiko-samples 0.413.1 → 0.414.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 +16 -1
- package/packages/bundled-features/src/admin-shell/changes.json +6 -0
- package/packages/bundled-features/src/admin-shell/feature.ts +8 -7
- package/packages/bundled-features/src/agent-tools/agent-doc-lint.ts +5 -1
- package/packages/bundled-features/src/agent-tools/agent-manifest.ts +36 -27
- package/packages/bundled-features/src/agent-tools/api-docs/collect-events.ts +8 -1
- package/packages/bundled-features/src/agent-tools/api-docs/collect.ts +3 -2
- package/packages/bundled-features/src/agent-tools/api-docs/generate.ts +6 -0
- package/packages/bundled-features/src/agent-tools/api-docs/index.ts +1 -0
- package/packages/bundled-features/src/agent-tools/api-docs/problems.ts +38 -1
- package/packages/bundled-features/src/agent-tools/api-docs/render-openapi.ts +1 -0
- package/packages/bundled-features/src/agent-tools/api-docs/resolve-config.ts +17 -0
- package/packages/bundled-features/src/agent-tools/api-docs/scope-slug-collisions.ts +17 -0
- package/packages/bundled-features/src/agent-tools/api-docs/translation-gaps.ts +42 -0
- package/packages/bundled-features/src/agent-tools/api-docs/webhook-example-problems.ts +30 -0
- package/packages/bundled-features/src/agent-tools/changes.json +12 -0
- package/packages/bundled-features/src/agent-tools/index.ts +1 -0
- package/packages/bundled-features/src/agent-tools/labels.ts +19 -6
- package/packages/bundled-features/src/agent-tools/tool-catalog.ts +18 -7
- package/packages/bundled-features/src/agent-tools/tool-dispatch.ts +14 -1
- package/packages/bundled-features/src/agent-tools/types.ts +4 -0
- package/packages/bundled-features/src/audit/event-classification.ts +6 -0
- package/packages/bundled-features/src/audit/web/i18n.ts +1 -0
- package/packages/bundled-features/src/auth-email-password/changes.json +18 -0
- package/packages/bundled-features/src/auth-email-password/errors.ts +0 -13
- package/packages/bundled-features/src/auth-email-password/handlers/invite-signup-complete.write.ts +147 -121
- package/packages/bundled-features/src/auth-email-password/handlers/login-options.query.ts +1 -1
- 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 +0 -1
- package/packages/bundled-features/src/auth-email-password/handlers/request-password-reset.write.ts +0 -1
- package/packages/bundled-features/src/auth-email-password/handlers/self-registration-status.query.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/reset-token.ts +0 -2
- package/packages/bundled-features/src/auth-email-password/seeding.ts +39 -7
- package/packages/bundled-features/src/auth-email-password/unlock-token.ts +0 -2
- package/packages/bundled-features/src/auth-email-password/verification-token.ts +0 -2
- package/packages/bundled-features/src/auth-email-password/web/auth-form-primitives.tsx +2 -2
- package/packages/bundled-features/src/auth-email-password/web/auth-gate.tsx +2 -2
- package/packages/bundled-features/src/auth-email-password/web/auth-redirect.ts +5 -0
- package/packages/bundled-features/src/auth-email-password/web/forgot-password-screen.tsx +1 -6
- package/packages/bundled-features/src/auth-email-password/web/invite-accept-screen.tsx +1 -1
- package/packages/bundled-features/src/auth-email-password/web/return-path.ts +2 -1
- package/packages/bundled-features/src/auth-email-password/web/session.tsx +10 -12
- package/packages/bundled-features/src/auth-email-password/web/signup-screen.tsx +1 -6
- package/packages/bundled-features/src/auth-email-password/web/static-account.ts +6 -1
- package/packages/bundled-features/src/auth-email-password/web/tenant-switcher.tsx +1 -1
- package/packages/bundled-features/src/auth-email-password/web/token-confirm-screen.tsx +4 -5
- package/packages/bundled-features/src/auth-email-password/web/user-menu.tsx +1 -1
- package/packages/bundled-features/src/auth-mfa/web/mfa-code-or-recovery-field.tsx +17 -1
- package/packages/bundled-features/src/auth-mfa/web/mfa-disable-dialog.tsx +1 -1
- package/packages/bundled-features/src/auth-mfa/web/mfa-regenerate-recovery-dialog.tsx +1 -1
- package/packages/bundled-features/src/auth-mfa/web/mfa-setup-preauth-screen.tsx +1 -1
- package/packages/bundled-features/src/auth-mfa/web/mfa-verify-screen.tsx +16 -47
- package/packages/bundled-features/src/auth-mfa-user-data/index.ts +5 -6
- package/packages/bundled-features/src/billing-foundation/aggregate-id.ts +0 -4
- package/packages/bundled-features/src/billing-foundation/changes.json +37 -0
- package/packages/bundled-features/src/billing-foundation/checkout-core.ts +8 -1
- package/packages/bundled-features/src/billing-foundation/checkout-ledger.ts +59 -0
- package/packages/bundled-features/src/billing-foundation/consumer-protection/consent-gate.ts +2 -1
- package/packages/bundled-features/src/billing-foundation/consumer-protection/consent-text.ts +49 -2
- package/packages/bundled-features/src/billing-foundation/consumer-protection/termination-open-cancels.ts +5 -0
- package/packages/bundled-features/src/billing-foundation/consumer-protection/termination-provider-timeout.ts +23 -0
- package/packages/bundled-features/src/billing-foundation/consumer-protection/termination-record.ts +12 -7
- package/packages/bundled-features/src/billing-foundation/consumer-protection/termination-revoke.ts +1 -1
- package/packages/bundled-features/src/billing-foundation/events.ts +49 -10
- package/packages/bundled-features/src/billing-foundation/feature.ts +15 -1
- package/packages/bundled-features/src/billing-foundation/handlers/billing-plans.query.ts +47 -14
- package/packages/bundled-features/src/billing-foundation/handlers/create-checkout-session.write.ts +7 -1
- package/packages/bundled-features/src/billing-foundation/handlers/process-event.write.ts +124 -10
- package/packages/bundled-features/src/billing-foundation/handlers/process-payment-event.write.ts +33 -9
- package/packages/bundled-features/src/billing-foundation/handlers/record-checkout-opened.write.ts +25 -0
- package/packages/bundled-features/src/billing-foundation/handlers/start-plan-checkout.write.ts +7 -1
- package/packages/bundled-features/src/billing-foundation/handlers/switch-plan.write.ts +16 -4
- package/packages/bundled-features/src/billing-foundation/i18n.ts +3 -0
- package/packages/bundled-features/src/billing-foundation/pending-plan-switch.ts +80 -0
- package/packages/bundled-features/src/billing-foundation/scrub-raw-payload-headers.ts +50 -0
- package/packages/bundled-features/src/billing-foundation/types.ts +47 -30
- package/packages/bundled-features/src/billing-foundation/validate-options.ts +18 -0
- package/packages/bundled-features/src/billing-foundation/web/billing-plans-panel.tsx +10 -5
- package/packages/bundled-features/src/billing-foundation/web/cancel-contract-dialog.tsx +1 -1
- package/packages/bundled-features/src/billing-foundation/web/checkout-consent-dialog.tsx +1 -1
- package/packages/bundled-features/src/billing-foundation/web/constants.ts +5 -2
- package/packages/bundled-features/src/billing-foundation/web/plan-switch-confirm-dialog.tsx +1 -1
- package/packages/bundled-features/src/billing-foundation/webhook-handler.ts +65 -17
- package/packages/bundled-features/src/cap-counter/aggregate-id.ts +0 -2
- package/packages/bundled-features/src/cap-counter/changes.json +6 -0
- package/packages/bundled-features/src/cap-counter/stock-cap-guard.ts +19 -4
- package/packages/bundled-features/src/cap-overview/changes.json +6 -0
- package/packages/bundled-features/src/cap-overview/handlers/tenant-caps-list.query.ts +22 -6
- package/packages/bundled-features/src/cap-overview/i18n.ts +1 -0
- package/packages/bundled-features/src/cap-overview/index.ts +1 -0
- package/packages/bundled-features/src/cap-overview/types.ts +11 -1
- package/packages/bundled-features/src/cap-overview/web/cap-cards-panel.tsx +6 -2
- package/packages/bundled-features/src/cap-overview/web/cap-usage-bar.tsx +10 -1
- package/packages/bundled-features/src/cap-overview/web/usage-math.ts +5 -0
- package/packages/bundled-features/src/channel-in-app/changes.json +6 -0
- package/packages/bundled-features/src/channel-in-app/handlers/read-state-by-keys.query.ts +2 -2
- package/packages/bundled-features/src/channel-whatsapp/aggregate-id.ts +29 -0
- package/packages/bundled-features/src/channel-whatsapp/changes.json +8 -0
- package/packages/bundled-features/src/channel-whatsapp/constants.ts +46 -0
- package/packages/bundled-features/src/channel-whatsapp/events.ts +93 -0
- package/packages/bundled-features/src/channel-whatsapp/feature.ts +72 -0
- package/packages/bundled-features/src/channel-whatsapp/graph-client.ts +398 -0
- package/packages/bundled-features/src/channel-whatsapp/in-memory-meta.ts +300 -0
- package/packages/bundled-features/src/channel-whatsapp/inbound-handlers.ts +189 -0
- package/packages/bundled-features/src/channel-whatsapp/index.ts +66 -0
- package/packages/bundled-features/src/channel-whatsapp/meta-signature.ts +26 -0
- package/packages/bundled-features/src/channel-whatsapp/options.ts +149 -0
- package/packages/bundled-features/src/channel-whatsapp/pii.ts +109 -0
- package/packages/bundled-features/src/channel-whatsapp/webhook-normalize.ts +226 -0
- package/packages/bundled-features/src/channel-whatsapp/webhook-routes.ts +185 -0
- package/packages/bundled-features/src/compliance-profiles/handlers/sub-processors.query.ts +1 -1
- package/packages/bundled-features/src/config/changes.json +12 -0
- package/packages/bundled-features/src/config/handlers/set.write.ts +7 -0
- package/packages/bundled-features/src/config/handlers/values.query.ts +8 -1
- package/packages/bundled-features/src/config/index.ts +1 -0
- package/packages/bundled-features/src/config/read-redaction.ts +6 -3
- package/packages/bundled-features/src/config/table.ts +1 -0
- package/packages/bundled-features/src/config/write-helpers.ts +3 -2
- package/packages/bundled-features/src/crypto-shredding/changes.json +18 -0
- package/packages/bundled-features/src/crypto-shredding/constants.ts +2 -0
- package/packages/bundled-features/src/crypto-shredding/handlers/forget-subject.write.ts +38 -18
- package/packages/bundled-features/src/crypto-shredding/index.ts +4 -0
- package/packages/bundled-features/src/crypto-shredding/subject-forget-after-delete-hook.ts +49 -0
- package/packages/bundled-features/src/custom-fields/aggregate-id.ts +0 -1
- package/packages/bundled-features/src/custom-fields/entity.ts +1 -0
- package/packages/bundled-features/src/custom-fields/wire-for-entity.ts +0 -1
- package/packages/bundled-features/src/data-retention/changes.json +12 -0
- package/packages/bundled-features/src/data-retention/erase-notes-of-deleted-row.ts +23 -0
- package/packages/bundled-features/src/data-retention/feature.ts +1 -5
- package/packages/bundled-features/src/data-retention/run-retention-cleanup.ts +38 -18
- package/packages/bundled-features/src/data-retention/tenant-destruction-hold.ts +9 -0
- package/packages/bundled-features/src/delivery/attempt-log-factory.ts +11 -0
- package/packages/bundled-features/src/delivery/attempt-log.ts +3 -3
- package/packages/bundled-features/src/delivery/changes.json +6 -0
- package/packages/bundled-features/src/delivery/channel-context.ts +6 -3
- package/packages/bundled-features/src/delivery/db/queries/preferences.ts +0 -1
- package/packages/bundled-features/src/delivery/delivery-service.ts +3 -0
- package/packages/bundled-features/src/delivery/feature.ts +4 -13
- package/packages/bundled-features/src/delivery/handlers/opted-in-user-ids.query.ts +45 -0
- package/packages/bundled-features/src/delivery/handlers/preferences.query.ts +2 -20
- package/packages/bundled-features/src/delivery/handlers/resubscribe-user.write.ts +2 -25
- package/packages/bundled-features/src/delivery/handlers/unsubscribe-page-chrome.query.ts +2 -0
- package/packages/bundled-features/src/delivery/handlers/unsubscribe-user.write.ts +2 -27
- package/packages/bundled-features/src/delivery/index.ts +3 -1
- package/packages/bundled-features/src/delivery/options.ts +11 -0
- package/packages/bundled-features/src/delivery/preference-rows.ts +33 -0
- package/packages/bundled-features/src/delivery/set-preference-enabled.ts +40 -0
- package/packages/bundled-features/src/delivery/testing.ts +3 -1
- package/packages/bundled-features/src/delivery/types.ts +1 -0
- package/packages/bundled-features/src/delivery/unsubscribe-page.ts +7 -1
- package/packages/bundled-features/src/delivery/upsert-preference.ts +0 -1
- package/packages/bundled-features/src/delivery/web/public-names.ts +1 -0
- package/packages/bundled-features/src/derivatives-sharp/render.ts +9 -9
- package/packages/bundled-features/src/document-ingest-foundation/aggregate-id.ts +0 -1
- package/packages/bundled-features/src/document-ingest-foundation/append-missing-extract-event.ts +37 -25
- package/packages/bundled-features/src/document-ingest-foundation/report-ingest-progress.ts +32 -14
- package/packages/bundled-features/src/documents/aggregate-id.ts +0 -2
- package/packages/bundled-features/src/documents/changes.json +18 -0
- package/packages/bundled-features/src/documents/constants.ts +10 -2
- package/packages/bundled-features/src/documents/ensure-link.ts +3 -4
- package/packages/bundled-features/src/documents/feature.ts +28 -6
- package/packages/bundled-features/src/documents/handlers/import.write.ts +2 -2
- package/packages/bundled-features/src/documents/queries/expiry-overview.query.ts +2 -1
- package/packages/bundled-features/src/documents/queries/for-record.query.ts +3 -4
- package/packages/bundled-features/src/documents/queries/list-page.ts +11 -3
- package/packages/bundled-features/src/documents/queries/overview.query.ts +2 -2
- package/packages/bundled-features/src/documents/screens.ts +8 -3
- package/packages/bundled-features/src/documents/tab.ts +1 -1
- package/packages/bundled-features/src/feature-toggles/toggle-sync-signal.ts +6 -3
- package/packages/bundled-features/src/file-derivatives/handlers/public-variant-by-file-ref.query.ts +1 -1
- package/packages/bundled-features/src/file-derivatives/handlers/public-variant.query.ts +1 -1
- package/packages/bundled-features/src/file-foundation/probe.ts +9 -3
- package/packages/bundled-features/src/file-foundation/read-file-ref-content.ts +24 -11
- package/packages/bundled-features/src/file-provider-inmemory/feature.ts +1 -1
- package/packages/bundled-features/src/file-provider-s3/changes.json +14 -0
- package/packages/bundled-features/src/file-provider-s3/env-feature.ts +1 -1
- package/packages/bundled-features/src/file-provider-s3/env-named-feature.ts +1 -1
- package/packages/bundled-features/src/file-provider-s3/env-schema.ts +24 -7
- package/packages/bundled-features/src/file-provider-s3/feature.ts +1 -1
- package/packages/bundled-features/src/file-provider-s3/index.ts +7 -1
- package/packages/bundled-features/src/file-provider-s3/lib/env-helper.ts +21 -13
- package/packages/bundled-features/src/file-provider-s3/lib/s3-provider.ts +8 -1
- package/packages/bundled-features/src/files/changes.json +7 -0
- package/packages/bundled-features/src/folders/aggregate-id.ts +0 -1
- package/packages/bundled-features/src/folders/web/folder-manager.tsx +6 -6
- package/packages/bundled-features/src/folders-user-data/index.ts +12 -14
- package/packages/bundled-features/src/helpdesk/changes.json +50 -0
- package/packages/bundled-features/src/helpdesk/entity.ts +4 -1
- package/packages/bundled-features/src/helpdesk/feature.ts +41 -0
- package/packages/bundled-features/src/helpdesk/handlers/access.ts +0 -10
- package/packages/bundled-features/src/helpdesk/handlers/attempts.ts +7 -14
- package/packages/bundled-features/src/helpdesk/handlers/challenge.query.ts +1 -2
- package/packages/bundled-features/src/helpdesk/handlers/reply.write.ts +2 -9
- package/packages/bundled-features/src/helpdesk/handlers/report.write.ts +2 -9
- package/packages/bundled-features/src/helpdesk/handlers/submit.write.ts +3 -11
- package/packages/bundled-features/src/helpdesk/index.ts +1 -0
- package/packages/bundled-features/src/helpdesk/legacy-contact-config.ts +61 -0
- package/packages/bundled-features/src/helpdesk/legacy-contact-erasure.ts +45 -0
- package/packages/bundled-features/src/helpdesk/legacy-contact-retention.ts +65 -0
- package/packages/bundled-features/src/helpdesk/legacy-contact-streams.ts +185 -0
- package/packages/bundled-features/src/helpdesk/legacy-contact-user-data.ts +84 -0
- package/packages/bundled-features/src/helpdesk/lib.ts +47 -34
- package/packages/bundled-features/src/helpdesk/user-data-hooks.ts +89 -48
- package/packages/bundled-features/src/helpdesk/web/constants.ts +0 -1
- package/packages/bundled-features/src/inbound-mail-foundation/account-health.ts +1 -1
- package/packages/bundled-features/src/inbound-mail-foundation/account-poll.ts +5 -1
- package/packages/bundled-features/src/inbound-mail-foundation/aggregate-id.ts +0 -2
- package/packages/bundled-features/src/inbound-mail-foundation/changes.json +48 -0
- package/packages/bundled-features/src/inbound-mail-foundation/constants.ts +6 -0
- package/packages/bundled-features/src/inbound-mail-foundation/content-refetch.ts +15 -1
- package/packages/bundled-features/src/inbound-mail-foundation/entities.ts +64 -15
- package/packages/bundled-features/src/inbound-mail-foundation/events.ts +15 -16
- package/packages/bundled-features/src/inbound-mail-foundation/feature.ts +3 -1
- package/packages/bundled-features/src/inbound-mail-foundation/handlers/account-address.ts +16 -2
- package/packages/bundled-features/src/inbound-mail-foundation/handlers/attach-message-content.write.ts +10 -3
- package/packages/bundled-features/src/inbound-mail-foundation/handlers/connect-account.write.ts +21 -8
- package/packages/bundled-features/src/inbound-mail-foundation/handlers/forget-message.write.ts +73 -0
- package/packages/bundled-features/src/inbound-mail-foundation/i18n.ts +3 -0
- package/packages/bundled-features/src/inbound-mail-foundation/index.ts +1 -0
- package/packages/bundled-features/src/inbound-mail-foundation/oauth-access-token.ts +1 -1
- package/packages/bundled-features/src/inbound-mail-foundation/outbound-mail.ts +2 -0
- package/packages/bundled-features/src/inbound-mail-foundation/personal-address.ts +20 -0
- package/packages/bundled-features/src/inbound-mail-foundation/purge-messages.ts +54 -0
- package/packages/bundled-features/src/inbound-mail-foundation/quarantine.ts +15 -5
- package/packages/bundled-features/src/inbound-mail-foundation/retention-job.ts +1 -5
- package/packages/bundled-features/src/inbound-mail-foundation/retention-sweep.ts +21 -34
- package/packages/bundled-features/src/inbound-mail-foundation/send-from-account.ts +9 -1
- package/packages/bundled-features/src/inbound-mail-foundation/supervisor-ingest.ts +7 -1
- package/packages/bundled-features/src/inbound-mail-foundation/sync-account-now.ts +1 -1
- package/packages/bundled-features/src/inbound-mail-foundation/tenant-destroy-hook.ts +14 -17
- package/packages/bundled-features/src/inbound-mail-foundation/watch-supervisor.ts +1 -1
- package/packages/bundled-features/src/inbound-provider-imap/byte-budget.ts +80 -0
- package/packages/bundled-features/src/inbound-provider-imap/changes.json +13 -0
- package/packages/bundled-features/src/inbound-provider-imap/connect-mailbox.ts +8 -4
- package/packages/bundled-features/src/inbound-provider-imap/connect-my-mailbox.ts +23 -6
- package/packages/bundled-features/src/inbound-provider-imap/connect-target-rate-limit.ts +46 -0
- package/packages/bundled-features/src/inbound-provider-imap/download-batch.ts +47 -10
- package/packages/bundled-features/src/inbound-provider-imap/feature.ts +7 -4
- package/packages/bundled-features/src/inbound-provider-imap/fetch-content.ts +43 -29
- package/packages/bundled-features/src/inbound-provider-imap/i18n.ts +2 -2
- package/packages/bundled-features/src/inbound-provider-imap/parse-message.ts +14 -0
- package/packages/bundled-features/src/inbound-provider-imap/reconnect-mailbox.ts +5 -4
- package/packages/bundled-features/src/inbound-provider-imap/send-mail.ts +39 -7
- package/packages/bundled-features/src/inbound-provider-imap/smtp-client.ts +19 -4
- package/packages/bundled-features/src/inbound-provider-imap/watch-mailbox.ts +8 -23
- package/packages/bundled-features/src/inbound-provider-inmemory/feature.ts +1 -1
- package/packages/bundled-features/src/jobs/events.ts +10 -0
- package/packages/bundled-features/src/jobs/feature.ts +2 -0
- package/packages/bundled-features/src/jobs/handlers/consumer.write.ts +41 -16
- package/packages/bundled-features/src/jobs/web/constants.ts +4 -0
- package/packages/bundled-features/src/mail-foundation/changes.json +6 -0
- package/packages/bundled-features/src/mail-transport-inmemory/feature.ts +1 -1
- package/packages/bundled-features/src/mail-transport-smtp/feature.ts +3 -2
- package/packages/bundled-features/src/managed-pages/changes.json +12 -0
- package/packages/bundled-features/src/managed-pages/handlers/branding.query.ts +1 -1
- package/packages/bundled-features/src/managed-pages/handlers/by-slug.query.ts +1 -1
- package/packages/bundled-features/src/managed-pages/handlers/by-tenant-published.query.ts +1 -1
- package/packages/bundled-features/src/managed-pages/render-page-body.ts +18 -10
- package/packages/bundled-features/src/managed-pages/screens/page-screens.ts +18 -38
- package/packages/bundled-features/src/managed-pages/table.ts +1 -0
- package/packages/bundled-features/src/managed-pages/web/client-plugin.tsx +8 -6
- package/packages/bundled-features/src/managed-pages/web/constants.ts +8 -1
- package/packages/bundled-features/src/managed-pages/web/i18n.ts +11 -3
- package/packages/bundled-features/src/managed-pages/web/markdown-to-document.ts +1 -1
- package/packages/bundled-features/src/managed-pages/web/page-edit-draft.ts +108 -0
- package/packages/bundled-features/src/managed-pages/web/page-edit-screen.tsx +198 -0
- package/packages/bundled-features/src/managed-pages/web/page-settings-rail.tsx +117 -0
- package/packages/bundled-features/src/notes-history-user-data/index.ts +8 -14
- package/packages/bundled-features/src/personal-access-tokens/boot-rules.ts +5 -0
- package/packages/bundled-features/src/personal-access-tokens/handlers/create.write.ts +0 -1
- package/packages/bundled-features/src/personal-access-tokens/scope-events-check.ts +31 -5
- package/packages/bundled-features/src/presence/changes.json +6 -0
- package/packages/bundled-features/src/presence/handlers/list.query.ts +28 -11
- package/packages/bundled-features/src/presence/room.ts +21 -7
- package/packages/bundled-features/src/presence/store.ts +79 -21
- package/packages/bundled-features/src/readiness/changes.json +25 -0
- package/packages/bundled-features/src/readiness/handlers/latest-summary.query.ts +11 -6
- package/packages/bundled-features/src/readiness/handlers/run-probes.write.ts +35 -5
- package/packages/bundled-features/src/readiness/handlers/run-tone.ts +3 -2
- package/packages/bundled-features/src/readiness/handlers/status.query.ts +15 -1
- package/packages/bundled-features/src/readiness/probe-context.ts +11 -10
- package/packages/bundled-features/src/readiness/screens.ts +4 -4
- package/packages/bundled-features/src/readiness/visible-results.ts +5 -3
- package/packages/bundled-features/src/renderer-foundation/api.ts +6 -13
- package/packages/bundled-features/src/renderer-foundation/types.ts +2 -2
- package/packages/bundled-features/src/secrets/changes.json +7 -0
- package/packages/bundled-features/src/secrets/db/queries/read.ts +18 -4
- package/packages/bundled-features/src/secrets/handlers/list.query.ts +8 -2
- package/packages/bundled-features/src/secrets/secret-scope.ts +2 -3
- package/packages/bundled-features/src/secrets/secrets-context.ts +6 -4
- package/packages/bundled-features/src/secrets/write-gate.ts +4 -2
- package/packages/bundled-features/src/seo/handlers/seo-config.query.ts +1 -1
- package/packages/bundled-features/src/shared/acknowledged-system-db.ts +20 -0
- package/packages/bundled-features/src/shared/assert-billing-live.ts +9 -2
- package/packages/bundled-features/src/shared/changes.json +6 -0
- package/packages/bundled-features/src/shared/index.ts +6 -1
- package/packages/bundled-features/src/shared/parent-visibility.ts +25 -1
- package/packages/bundled-features/src/shared/password-hashing.ts +0 -1
- package/packages/bundled-features/src/shared/price-env-shape.ts +1 -4
- package/packages/bundled-features/src/shared/register-user-data-hooks.ts +29 -0
- package/packages/bundled-features/src/shared/require-bootstrap-extension.ts +26 -0
- package/packages/bundled-features/src/shared/send-best-effort.ts +19 -0
- package/packages/bundled-features/src/shared/stream-tenant-backfill.ts +22 -1
- package/packages/bundled-features/src/shared/stream-tenant-derived-state.ts +31 -1
- package/packages/bundled-features/src/step-dispatcher/changes.json +12 -0
- package/packages/bundled-features/src/step-dispatcher/constants.ts +13 -0
- package/packages/bundled-features/src/step-dispatcher/deliver-dispatch-request.ts +47 -2
- package/packages/bundled-features/src/step-dispatcher/feature.ts +28 -1
- package/packages/bundled-features/src/step-dispatcher/mail-runner.ts +0 -1
- package/packages/bundled-features/src/step-dispatcher/sweep-abandoned.ts +57 -0
- package/packages/bundled-features/src/subscription-mollie/changes.json +7 -0
- package/packages/bundled-features/src/subscription-mollie/plugin-methods.ts +5 -3
- package/packages/bundled-features/src/subscription-mollie/verify-webhook.ts +5 -5
- package/packages/bundled-features/src/subscription-paddle/backfill-checkout-ledger.ts +159 -0
- package/packages/bundled-features/src/subscription-paddle/changes.json +13 -0
- package/packages/bundled-features/src/subscription-paddle/checkout-config.query.ts +1 -1
- package/packages/bundled-features/src/subscription-paddle/checkout-methods.ts +2 -8
- package/packages/bundled-features/src/subscription-paddle/constants.ts +1 -2
- package/packages/bundled-features/src/subscription-paddle/feature.ts +26 -24
- package/packages/bundled-features/src/subscription-paddle/ledger-backfill-marker.ts +70 -0
- package/packages/bundled-features/src/subscription-paddle/plan-switch-methods.ts +2 -8
- package/packages/bundled-features/src/subscription-paddle/redeliver-legacy-checkout.ts +36 -0
- package/packages/bundled-features/src/subscription-paddle/runtime.ts +13 -24
- package/packages/bundled-features/src/subscription-paddle/subscription-state.ts +1 -0
- package/packages/bundled-features/src/subscription-paddle/webhook-events.ts +68 -21
- package/packages/bundled-features/src/subscription-stripe/changes.json +7 -0
- package/packages/bundled-features/src/subscription-stripe/feature.ts +5 -0
- package/packages/bundled-features/src/subscription-stripe/plugin-methods.ts +6 -6
- package/packages/bundled-features/src/subscription-stripe/runtime.ts +8 -7
- package/packages/bundled-features/src/subscription-stripe/verify-webhook.ts +24 -6
- package/packages/bundled-features/src/tags/aggregate-id.ts +0 -1
- package/packages/bundled-features/src/tags/web/tag-chip.tsx +4 -5
- package/packages/bundled-features/src/tags/web/tag-manager.tsx +2 -1
- package/packages/bundled-features/src/template-resolver/api.ts +6 -13
- package/packages/bundled-features/src/template-resolver/changes.json +36 -0
- package/packages/bundled-features/src/template-resolver/document-sanitizer.ts +25 -0
- package/packages/bundled-features/src/template-resolver/feature.ts +2 -0
- package/packages/bundled-features/src/template-resolver/handlers/body-preview.query.ts +41 -0
- package/packages/bundled-features/src/template-resolver/handlers/by-slug.query.ts +1 -1
- package/packages/bundled-features/src/template-resolver/handlers/by-tenant.query.ts +1 -1
- package/packages/bundled-features/src/template-resolver/handlers/collection-shared.ts +5 -11
- package/packages/bundled-features/src/template-resolver/handlers/overview.query.ts +3 -2
- package/packages/bundled-features/src/template-resolver/handlers/send-test.write.ts +37 -8
- package/packages/bundled-features/src/template-resolver/linked-resources.ts +2 -5
- package/packages/bundled-features/src/template-resolver/seeding.ts +77 -0
- package/packages/bundled-features/src/template-resolver/table.ts +1 -0
- package/packages/bundled-features/src/template-resolver/template-draft.ts +2 -1
- package/packages/bundled-features/src/template-resolver/template-preview.ts +14 -3
- package/packages/bundled-features/src/template-resolver/testing.ts +0 -2
- package/packages/bundled-features/src/template-resolver/web/client-plugin.tsx +3 -0
- package/packages/bundled-features/src/template-resolver/web/collection-entry-create-form.tsx +33 -33
- package/packages/bundled-features/src/template-resolver/web/constants.ts +7 -0
- package/packages/bundled-features/src/template-resolver/web/content-tree-provider.ts +0 -1
- package/packages/bundled-features/src/template-resolver/web/content-workbench.tsx +142 -0
- package/packages/bundled-features/src/template-resolver/web/document-insert-model.ts +3 -8
- package/packages/bundled-features/src/template-resolver/web/document-link-policy.ts +58 -0
- package/packages/bundled-features/src/template-resolver/web/document-schema.ts +11 -57
- package/packages/bundled-features/src/template-resolver/web/document-tiptap-bubble.tsx +2 -4
- package/packages/bundled-features/src/template-resolver/web/document-tiptap-context.ts +4 -5
- package/packages/bundled-features/src/template-resolver/web/document-tiptap-editor.tsx +2 -2
- package/packages/bundled-features/src/template-resolver/web/document-tiptap-helpers.ts +6 -3
- package/packages/bundled-features/src/template-resolver/web/document-tiptap-toolbar-groups.tsx +2 -3
- package/packages/bundled-features/src/template-resolver/web/editor-handle.ts +1 -0
- package/packages/bundled-features/src/template-resolver/web/fill-document-variables.ts +24 -0
- package/packages/bundled-features/src/template-resolver/web/i18n.ts +14 -0
- package/packages/bundled-features/src/template-resolver/web/index.ts +3 -0
- package/packages/bundled-features/src/template-resolver/web/preview-targets.ts +25 -0
- package/packages/bundled-features/src/template-resolver/web/qualified-names.ts +1 -0
- package/packages/bundled-features/src/template-resolver/web/snippet-preview-renderer.tsx +24 -0
- package/packages/bundled-features/src/template-resolver/web/string-values.ts +7 -0
- package/packages/bundled-features/src/template-resolver/web/text-block-editor.tsx +38 -50
- package/packages/bundled-features/src/template-resolver/web/use-collection-entry-create.ts +7 -0
- package/packages/bundled-features/src/template-resolver/web/use-content-write.ts +1 -3
- package/packages/bundled-features/src/template-resolver/web/use-document-tiptap-model.ts +1 -2
- package/packages/bundled-features/src/template-resolver/web/use-text-block-editor.ts +28 -7
- package/packages/bundled-features/src/template-resolver/web/web-preview-renderer.tsx +126 -0
- package/packages/bundled-features/src/template-resolver-user-data/index.ts +11 -10
- package/packages/bundled-features/src/tenant/changes.json +6 -0
- package/packages/bundled-features/src/tenant/handlers/create.write.ts +7 -8
- package/packages/bundled-features/src/tenant/handlers/list.query.ts +7 -9
- package/packages/bundled-features/src/tenant/handlers/member-directory.query.ts +10 -4
- package/packages/bundled-features/src/tenant/handlers/toggle-enabled.write.ts +1 -1
- package/packages/bundled-features/src/tenant/invited-membership.ts +10 -1
- package/packages/bundled-features/src/tenant/seeding.ts +4 -2
- package/packages/bundled-features/src/tenant/stream-tenant-backfill.ts +5 -1
- package/packages/bundled-features/src/tenant/testing.ts +1 -1
- package/packages/bundled-features/src/tenant-inactivity/check-inactive-tenants.ts +4 -3
- package/packages/bundled-features/src/tenant-inactivity/constants.ts +1 -2
- package/packages/bundled-features/src/tenant-inactivity/handlers/keep-account.write.ts +1 -2
- package/packages/bundled-features/src/tenant-inactivity/state-store.ts +10 -1
- package/packages/bundled-features/src/tenant-lifecycle/changes.json +18 -0
- package/packages/bundled-features/src/tenant-lifecycle/constants.ts +4 -0
- package/packages/bundled-features/src/tenant-lifecycle/run-tenant-destroy.ts +43 -6
- package/packages/bundled-features/src/tenant-lifecycle/stages.ts +15 -2
- package/packages/bundled-features/src/tier-engine/aggregate-id.ts +0 -1
- package/packages/bundled-features/src/tier-engine/changes.json +6 -0
- package/packages/bundled-features/src/tier-engine/feature.ts +8 -2
- package/packages/bundled-features/src/user/changes.json +6 -0
- package/packages/bundled-features/src/user/db/queries/stream-tenant-backfill.ts +2 -1
- package/packages/bundled-features/src/user/handlers/me.query.ts +3 -1
- package/packages/bundled-features/src/user/index.ts +1 -0
- package/packages/bundled-features/src/user/resolve-verified-user-email.ts +17 -0
- package/packages/bundled-features/src/user-data-rights/db/queries/export-jobs.ts +0 -1
- package/packages/bundled-features/src/user-data-rights/handlers/confirm-deletion-by-token.write.ts +1 -1
- package/packages/bundled-features/src/user-data-rights/handlers/download-by-token.query.ts +1 -1
- package/packages/bundled-features/src/user-data-rights/handlers/request-deletion-by-email.write.ts +1 -1
- package/packages/bundled-features/src/user-data-rights/run-export-jobs.ts +0 -2
- package/packages/bundled-features/src/user-data-rights/run-forget-cleanup.ts +3 -3
- package/packages/bundled-features/src/user-data-rights/schema/download-attempt.ts +3 -2
- package/packages/bundled-features/src/user-data-rights/web/confirm-deletion-screen.tsx +1 -1
- package/packages/bundled-features/src/user-data-rights/web/privacy-center-screen.tsx +1 -1
- package/packages/bundled-features/src/user-data-rights/web/request-deletion-screen.tsx +1 -1
- package/packages/bundled-features/src/user-data-rights-defaults/hooks/api-token.userdata-hook.ts +5 -5
- package/packages/bundled-features/src/user-data-rights-defaults/hooks/hard-delete-own-rows-hook.ts +17 -0
- package/packages/bundled-features/src/user-data-rights-defaults/hooks/in-app-message.userdata-hook.ts +5 -5
- package/packages/bundled-features/src/user-data-rights-defaults/hooks/job-run.userdata-hook.ts +2 -1
- package/packages/bundled-features/src/user-data-rights-defaults/hooks/user-session.userdata-hook.ts +5 -5
- package/packages/bundled-features/src/user-profile/handlers/change-email.write.ts +0 -1
- package/packages/bundled-features/src/waitlist/changes.json +6 -0
- package/packages/bundled-features/src/waitlist/handlers/submit.write.ts +4 -28
- package/packages/bundled-features/src/waitlist/lib.ts +2 -7
- package/packages/bundled-features/src/waitlist/user-data-hooks.ts +6 -19
- package/packages/bundled-features/src/workflow-runner/aggregate-id.ts +0 -1
- package/packages/bundled-features/src/workflow-runner/event-trigger.ts +6 -2
- package/packages/bundled-features/src/workflow-runner/feature.ts +1 -5
- package/packages/bundled-features/src/workflow-runner/handlers/resume-run.write.ts +5 -4
- package/packages/bundled-features/src/workflow-runner/runner.ts +2 -0
- package/samples/apps/showcase/src/features/demos/web/pages/dialog.tsx +0 -1
- package/samples/apps/showcase/src/features/demos/web/pages/layout.tsx +1 -1
- package/samples/apps/showcase/src/features/demos/web/pages/sidebar-panel.tsx +0 -1
- package/samples/apps/styleguide/src/features/gallery/web/Gallery.tsx +1 -4
- package/samples/apps/ui-walkthrough/src/features/subscription-plans/feature.ts +6 -2
- package/samples/apps/use-all-bundled/e2e-billing-gallery/gallery-features.ts +12 -14
- package/samples/apps/use-all-bundled/feature-manifest.json +60 -29
- package/samples/apps/use-all-bundled/playwright.billing-docs.config.ts +1 -1
- package/samples/apps/use-all-bundled/playwright.config.ts +1 -0
- package/samples/apps/use-all-bundled/src/app/seed.ts +1 -1
- package/samples/apps/use-all-bundled/src/run-config.ts +2 -1
- package/samples/recipes/auth-mfa/src/web/confirmation-code-step.tsx +32 -10
- package/samples/recipes/chat-channels/README.md +2 -0
- package/samples/recipes/currencies-global/src/entities/currency.ts +1 -0
- package/samples/recipes/managed-pages/README.md +5 -1
- package/samples/recipes/managed-pages/package.json +3 -2
- package/samples/recipes/managed-pages/src/web/branded-preview.tsx +21 -0
- package/samples/recipes/managed-pages/tsconfig.json +8 -0
- package/samples/recipes/pwa-shell/README.md +52 -0
- package/samples/recipes/pwa-shell/bin/server.ts +12 -0
- package/samples/recipes/pwa-shell/package.json +13 -0
- package/samples/recipes/pwa-shell/src/app.ts +34 -0
- package/samples/recipes/rate-limiting/README.md +3 -3
- package/samples/recipes/record-detail-layout/README.md +33 -0
- package/samples/recipes/record-detail-layout/src/feature.ts +525 -44
- package/samples/recipes/record-detail-layout/src/order-board.ts +521 -0
- package/packages/bundled-features/src/managed-pages/web/page-body-section.tsx +0 -72
- package/packages/bundled-features/src/subscription-paddle/tenant-binding.ts +0 -34
- package/packages/bundled-features/src/template-resolver/web/content-field.tsx +0 -61
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Translate } from "@cosmicdrift/kumiko-renderer/headless";
|
|
2
2
|
import type { Editor } from "@tiptap/core";
|
|
3
3
|
import type { Dispatch, SetStateAction } from "react";
|
|
4
4
|
import {
|
|
@@ -7,13 +7,12 @@ import {
|
|
|
7
7
|
HEADING_LEVELS,
|
|
8
8
|
isParagraphStyle,
|
|
9
9
|
type PanelKind,
|
|
10
|
+
type Primitives,
|
|
11
|
+
variableLabelOf,
|
|
10
12
|
} from "./document-tiptap-helpers.ts";
|
|
11
13
|
import type { DocumentToolbarBlock } from "./document-toolbar-blocks.ts";
|
|
12
14
|
import type { DocumentEditorLabels } from "./use-document-tiptap-model.ts";
|
|
13
15
|
|
|
14
|
-
type Translate = (key: string, params?: Readonly<Record<string, unknown>>) => string;
|
|
15
|
-
type Primitives = ReturnType<typeof usePrimitives>;
|
|
16
|
-
|
|
17
16
|
export type TiptapContext = {
|
|
18
17
|
readonly id: string;
|
|
19
18
|
readonly t: Translate;
|
|
@@ -79,7 +78,7 @@ function repeatListLabelOf(
|
|
|
79
78
|
): string | undefined {
|
|
80
79
|
const repeatTable = activeState?.repeatTable ?? null;
|
|
81
80
|
return repeatTable !== null && repeatTable.lists.length === 1
|
|
82
|
-
? (
|
|
81
|
+
? variableLabelOf(repeatTable.lists[0] ?? "", variableLabels)
|
|
83
82
|
: undefined;
|
|
84
83
|
}
|
|
85
84
|
|
|
@@ -63,14 +63,14 @@ export default function DocumentTiptapEditor({
|
|
|
63
63
|
// editor earlier in the same commit (a late validate result in the layout
|
|
64
64
|
// editor does that); reading it then throws and unmounts the whole app. The
|
|
65
65
|
// replacement editor re-renders and syncs `value` itself.
|
|
66
|
-
//
|
|
66
|
+
// biome-ignore lint/plugin: DOM integration: syncs the controlled value into the imperative tiptap editor
|
|
67
67
|
useEffect(() => {
|
|
68
68
|
if (editor && !editor.isDestroyed && value !== editor.getHTML()) {
|
|
69
69
|
editor.commands.setContent(value, { emitUpdate: false });
|
|
70
70
|
}
|
|
71
71
|
}, [value, editor]);
|
|
72
72
|
|
|
73
|
-
//
|
|
73
|
+
// biome-ignore lint/plugin: DOM integration: tiptap exposes editability only imperatively via setEditable
|
|
74
74
|
useEffect(() => {
|
|
75
75
|
// setEditable emits "update" by default, which would report the mount as an edit.
|
|
76
76
|
if (editor && !editor.isDestroyed) editor.setEditable(!readOnly, false);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { usePrimitives } from "@cosmicdrift/kumiko-renderer";
|
|
1
2
|
import { isOneOf } from "@cosmicdrift/kumiko-types/type-guards";
|
|
2
3
|
import type { Editor, JSONContent } from "@tiptap/core";
|
|
3
4
|
import type { DocumentResourcePreview, DocumentToolbarBlock } from "./document-toolbar-blocks.ts";
|
|
@@ -131,9 +132,7 @@ function blockStyleOf(e: Editor): "1" | "2" | "3" | "paragraph" {
|
|
|
131
132
|
return "paragraph";
|
|
132
133
|
}
|
|
133
134
|
|
|
134
|
-
function selectedBlockOf(
|
|
135
|
-
e: Editor,
|
|
136
|
-
): { readonly type: "resource" | "button"; readonly detail: string } | null {
|
|
135
|
+
function selectedBlockOf(e: Editor): SelectedBlock | null {
|
|
137
136
|
if (e.isActive("resource")) {
|
|
138
137
|
return { type: "resource", detail: String(e.getAttributes("resource")["resource"]) };
|
|
139
138
|
}
|
|
@@ -158,4 +157,8 @@ export function activeStateOf(e: Editor, showHtml: boolean) {
|
|
|
158
157
|
};
|
|
159
158
|
}
|
|
160
159
|
|
|
160
|
+
export type Primitives = ReturnType<typeof usePrimitives>;
|
|
161
|
+
|
|
162
|
+
export type SelectedBlock = { readonly type: "resource" | "button"; readonly detail: string };
|
|
163
|
+
|
|
161
164
|
export type ActiveState = ReturnType<typeof activeStateOf>;
|
package/packages/bundled-features/src/template-resolver/web/document-tiptap-toolbar-groups.tsx
CHANGED
|
@@ -70,7 +70,7 @@ export function renderParagraphStyleSelect(c: TiptapContext): ReactNode {
|
|
|
70
70
|
];
|
|
71
71
|
return (
|
|
72
72
|
<div
|
|
73
|
-
//
|
|
73
|
+
// biome-ignore lint/plugin: the toolbar paragraph select sits flush in the editor toolbar; ComboboxInput has no flat trigger variant
|
|
74
74
|
className={cn(
|
|
75
75
|
!canvas && (compact ? "w-24" : "w-40"),
|
|
76
76
|
canvas &&
|
|
@@ -123,7 +123,7 @@ export function renderMarkButtons(c: TiptapContext): ReactNode {
|
|
|
123
123
|
}
|
|
124
124
|
|
|
125
125
|
export function renderListButtons(c: TiptapContext): ReactNode {
|
|
126
|
-
const { t, editor,
|
|
126
|
+
const { t, editor, activeState } = c;
|
|
127
127
|
return (
|
|
128
128
|
<>
|
|
129
129
|
{iconButton(
|
|
@@ -132,7 +132,6 @@ export function renderListButtons(c: TiptapContext): ReactNode {
|
|
|
132
132
|
<List size={16} />,
|
|
133
133
|
activeState?.bulletList ?? false,
|
|
134
134
|
() => editor.chain().focus().toggleBulletList().run(),
|
|
135
|
-
canvas ? undefined : t("template-resolver.documentEditor.list"),
|
|
136
135
|
)}
|
|
137
136
|
{iconButton(
|
|
138
137
|
c,
|
|
@@ -32,6 +32,7 @@ export function useEditorHandleReport(
|
|
|
32
32
|
editor: Editor | null,
|
|
33
33
|
onEditorReady: ((handle: DocumentEditorHandle | null) => void) | undefined,
|
|
34
34
|
): void {
|
|
35
|
+
// Callers pass a fresh function per render; keying the effect on it would re-report each render.
|
|
35
36
|
const reportRef = useRef(onEditorReady);
|
|
36
37
|
reportRef.current = onEditorReady;
|
|
37
38
|
useEffect(() => {
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { substituteVariables } from "@cosmicdrift/kumiko-renderer";
|
|
2
|
+
|
|
3
|
+
// Replaces the variable chips of an editor document with their example values, so a preview shows
|
|
4
|
+
// the finished text. Works on a parsed DOM and inserts values as text nodes: markup characters in a
|
|
5
|
+
// value end up escaped in the serialized HTML. A placeholder without an example value stays
|
|
6
|
+
// visible by its name.
|
|
7
|
+
export function fillDocumentVariables(
|
|
8
|
+
html: string,
|
|
9
|
+
examples: Readonly<Record<string, string>>,
|
|
10
|
+
): string {
|
|
11
|
+
const doc = new DOMParser().parseFromString(html, "text/html");
|
|
12
|
+
for (const chip of Array.from(doc.body.querySelectorAll("[data-variable]"))) {
|
|
13
|
+
const name = chip.getAttribute("data-variable") ?? "";
|
|
14
|
+
chip.replaceWith(doc.createTextNode(examples[name] ?? `{{${name}}}`));
|
|
15
|
+
}
|
|
16
|
+
// Placeholders typed as literal `{{name}}` text (older entries) fill the same way.
|
|
17
|
+
const walker = doc.createTreeWalker(doc.body, NodeFilter.SHOW_TEXT);
|
|
18
|
+
const textNodes: Text[] = [];
|
|
19
|
+
for (let node = walker.nextNode(); node !== null; node = walker.nextNode()) {
|
|
20
|
+
if (node instanceof Text) textNodes.push(node);
|
|
21
|
+
}
|
|
22
|
+
for (const node of textNodes) node.data = substituteVariables(node.data, examples);
|
|
23
|
+
return doc.body.innerHTML;
|
|
24
|
+
}
|
|
@@ -65,6 +65,8 @@ export const defaultTranslations: TranslationsByLocale = {
|
|
|
65
65
|
"The button target “{detail}” must be a placeholder.",
|
|
66
66
|
"templateResolver.errors.document.disallowedLinkHref":
|
|
67
67
|
"Link target “{detail}” is not allowed; use https, http, mailto, tel, a relative path or a placeholder.",
|
|
68
|
+
"templateResolver.errors.document.relativeLinkWithoutBase":
|
|
69
|
+
"Link target “{detail}” is relative, but mails and PDF documents have no base address; use an absolute https link.",
|
|
68
70
|
"templateResolver.errors.document.documentRequiresHtmlFormat":
|
|
69
71
|
"This template kind requires the html format, got “{detail}”.",
|
|
70
72
|
"templateResolver.errors.document.layoutRequiresMjmlFormat":
|
|
@@ -195,5 +197,17 @@ export const defaultTranslations: TranslationsByLocale = {
|
|
|
195
197
|
"templateResolver.errors.collection.slugExists":
|
|
196
198
|
"An entry with the slug “{detail}” already exists. Pick another one.",
|
|
197
199
|
"template-resolver.editor.readOnly": "Read-only. Your role does not allow changes here.",
|
|
200
|
+
"template-resolver.editor.infoEdit":
|
|
201
|
+
"Edit the title and the content. The preview shows it with example values for the placeholders.",
|
|
202
|
+
"template-resolver.editor.infoPreview":
|
|
203
|
+
"This is how the text looks with the example values, including changes you have not saved yet.",
|
|
204
|
+
"template-resolver.editor.localeLabel": "Language",
|
|
205
|
+
"template-resolver.editor.railDetails": "Entry",
|
|
206
|
+
"template-resolver.editor.railExamples": "Example values",
|
|
207
|
+
"template-resolver.editor.infoPreviewPlain":
|
|
208
|
+
"Preview of the unsaved state, as the page shows it. The site's header and footer are not included.",
|
|
209
|
+
"template-resolver.preview.frameTitle": "Text preview",
|
|
210
|
+
"template-resolver.editor.railPlaceholders": "Placeholders",
|
|
211
|
+
"template-resolver.editor.railPlaceholdersHint": "These names can be used in the text.",
|
|
198
212
|
},
|
|
199
213
|
};
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
// DOM deps.
|
|
6
6
|
|
|
7
7
|
export { textBlocksClient } from "./client-plugin.tsx";
|
|
8
|
+
export type { EditableTemplateKind } from "./constants.ts";
|
|
8
9
|
export { DocumentContentEditor } from "./document-editor.tsx";
|
|
9
10
|
export {
|
|
10
11
|
type DocumentEditorChrome,
|
|
@@ -34,8 +35,10 @@ export {
|
|
|
34
35
|
PlaceholderLineEditor,
|
|
35
36
|
type PlaceholderLineEditorProps,
|
|
36
37
|
} from "./placeholder-line-editor-lazy.tsx";
|
|
38
|
+
export { previewTargetOfKind } from "./preview-targets.ts";
|
|
37
39
|
export {
|
|
38
40
|
TemplateResolverErrors,
|
|
39
41
|
TemplateResolverHandlers,
|
|
40
42
|
TemplateResolverQueries,
|
|
41
43
|
} from "./qualified-names.ts";
|
|
44
|
+
export { WebPreviewRenderer } from "./web-preview-renderer.tsx";
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { PreviewTarget } from "@cosmicdrift/kumiko-renderer";
|
|
2
|
+
import type { EditableTemplateKind } from "./constants.ts";
|
|
3
|
+
|
|
4
|
+
// Complete on purpose: a new kind breaks the typecheck until it gets a target or is excluded
|
|
5
|
+
// from `EditableTemplateKind`. `snippet` covers every entry of an app's content collections; `text-block` has one
|
|
6
|
+
// consumer (legal-pages), so only "web" until a consumer puts snippets into mails.
|
|
7
|
+
export const previewTargetOfKind: Readonly<Record<EditableTemplateKind, PreviewTarget>> = {
|
|
8
|
+
mail: "mail",
|
|
9
|
+
"document-pdf": "pdf",
|
|
10
|
+
"mail-layout": "mail",
|
|
11
|
+
"pdf-layout": "pdf",
|
|
12
|
+
"text-block": "web",
|
|
13
|
+
snippet: "text",
|
|
14
|
+
"ai-prompt": "text",
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
function isEditableKind(kind: string): kind is EditableTemplateKind {
|
|
18
|
+
return Object.hasOwn(previewTargetOfKind, kind);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/** A collection declares its kind as an opaque string; one this map does not know previews as plain text. */
|
|
22
|
+
export function previewTargetOfCollectionKind(kind: string | undefined): PreviewTarget {
|
|
23
|
+
if (kind === undefined || !isEditableKind(kind)) return "text";
|
|
24
|
+
return previewTargetOfKind[kind];
|
|
25
|
+
}
|
|
@@ -27,6 +27,7 @@ export const TemplateResolverQueries = {
|
|
|
27
27
|
list: "template-resolver:query:list",
|
|
28
28
|
usage: "template-resolver:query:usage",
|
|
29
29
|
overview: "template-resolver:query:overview",
|
|
30
|
+
bodyPreview: "template-resolver:query:body-preview",
|
|
30
31
|
layoutSource: "template-resolver:query:layout-source",
|
|
31
32
|
tenantOverrides: "template-resolver:query:tenant-overrides",
|
|
32
33
|
tenantOverrideCounts: "template-resolver:query:tenant-override-counts",
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type PreviewRenderer,
|
|
3
|
+
type PreviewRendererProps,
|
|
4
|
+
TextPreviewRenderer,
|
|
5
|
+
} from "@cosmicdrift/kumiko-renderer";
|
|
6
|
+
import type { ReactNode } from "react";
|
|
7
|
+
import { fillDocumentVariables } from "./fill-document-variables.ts";
|
|
8
|
+
import { stringValuesOf } from "./string-values.ts";
|
|
9
|
+
import { HtmlPaperFrame } from "./web-preview-renderer.tsx";
|
|
10
|
+
|
|
11
|
+
// The "text" target of collection entries: a document entry shows as the finished text with its
|
|
12
|
+
// example values. Collections are open to members who may not call the admin-only body preview, so
|
|
13
|
+
// nothing goes to the server: the filled HTML is shown in HtmlMailFrame, whose sandboxed,
|
|
14
|
+
// script-free iframe (CSP default-src 'none') is the protection. Other formats keep the renderer
|
|
15
|
+
// package's read-only text view.
|
|
16
|
+
export const SnippetPreviewRenderer: PreviewRenderer = (props: PreviewRendererProps): ReactNode => {
|
|
17
|
+
if (props.editFormat !== "document") return <TextPreviewRenderer {...props} />;
|
|
18
|
+
return (
|
|
19
|
+
<HtmlPaperFrame
|
|
20
|
+
html={fillDocumentVariables(props.content, stringValuesOf(props.variables))}
|
|
21
|
+
devices={false}
|
|
22
|
+
/>
|
|
23
|
+
);
|
|
24
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export function stringValuesOf(record: Readonly<Record<string, unknown>>): Record<string, string> {
|
|
2
|
+
const strings: Record<string, string> = {};
|
|
3
|
+
for (const [key, value] of Object.entries(record)) {
|
|
4
|
+
if (typeof value === "string") strings[key] = value;
|
|
5
|
+
}
|
|
6
|
+
return strings;
|
|
7
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { TargetRef } from "@cosmicdrift/kumiko-framework/engine";
|
|
2
|
-
import {
|
|
2
|
+
import { usePrimitives, useTranslation } from "@cosmicdrift/kumiko-renderer";
|
|
3
3
|
import type { ReactNode } from "react";
|
|
4
|
-
import {
|
|
4
|
+
import { ContentWorkbench } from "./content-workbench.tsx";
|
|
5
5
|
import { useTextBlockEditor } from "./use-text-block-editor.ts";
|
|
6
6
|
|
|
7
7
|
type EditorState = ReturnType<typeof useTextBlockEditor>;
|
|
@@ -20,15 +20,6 @@ function LoadBanners({ state }: { readonly state: EditorState }): ReactNode {
|
|
|
20
20
|
{!state.canWrite && !state.loading && (
|
|
21
21
|
<Banner variant="info">{t("template-resolver.editor.readOnly")}</Banner>
|
|
22
22
|
)}
|
|
23
|
-
</>
|
|
24
|
-
);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
function SaveBanners({ state }: { readonly state: EditorState }): ReactNode {
|
|
28
|
-
const { Banner } = usePrimitives();
|
|
29
|
-
return (
|
|
30
|
-
<>
|
|
31
|
-
{state.saveError !== null && <Banner variant="error">{state.saveError}</Banner>}
|
|
32
23
|
{state.savedMsg !== null && <Banner variant="info">{state.savedMsg}</Banner>}
|
|
33
24
|
</>
|
|
34
25
|
);
|
|
@@ -42,51 +33,48 @@ export function TextBlockEditor({
|
|
|
42
33
|
// but is unused: tree selection navigates, there is no close button.
|
|
43
34
|
readonly onClose: () => void;
|
|
44
35
|
}): ReactNode {
|
|
45
|
-
const {
|
|
36
|
+
const { Field, Input } = usePrimitives();
|
|
46
37
|
const t = useTranslation();
|
|
47
38
|
const state = useTextBlockEditor(target);
|
|
48
39
|
const headerTitle = state.title || state.slug || undefined;
|
|
49
40
|
|
|
50
41
|
return (
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
id="text-block-title"
|
|
74
|
-
name="text-block-title"
|
|
75
|
-
value={state.title}
|
|
76
|
-
onChange={state.setTitle}
|
|
77
|
-
disabled={state.disabled}
|
|
78
|
-
required
|
|
79
|
-
/>
|
|
80
|
-
</Field>
|
|
81
|
-
<ContentField
|
|
82
|
-
editorContext={state.editorContext}
|
|
83
|
-
value={state.content}
|
|
84
|
-
onChange={state.setContent}
|
|
42
|
+
<ContentWorkbench
|
|
43
|
+
testId="text-block-editor"
|
|
44
|
+
title={headerTitle ?? t("template-resolver.editor.titleLabel")}
|
|
45
|
+
editorContext={state.editorContext}
|
|
46
|
+
content={state.content}
|
|
47
|
+
onContentChange={state.setContent}
|
|
48
|
+
disabled={state.disabled}
|
|
49
|
+
banners={<LoadBanners state={state} />}
|
|
50
|
+
details={[
|
|
51
|
+
{ label: t("template-resolver.editor.slugLabel"), value: state.slug },
|
|
52
|
+
...(state.locale !== ""
|
|
53
|
+
? [{ label: t("template-resolver.editor.localeLabel"), value: state.locale }]
|
|
54
|
+
: []),
|
|
55
|
+
]}
|
|
56
|
+
fields={
|
|
57
|
+
<Field id="text-block-title" label={t("template-resolver.editor.titleLabel")} required>
|
|
58
|
+
<Input
|
|
59
|
+
kind="text"
|
|
60
|
+
id="text-block-title"
|
|
61
|
+
name="text-block-title"
|
|
62
|
+
value={state.title}
|
|
63
|
+
onChange={state.setTitle}
|
|
85
64
|
disabled={state.disabled}
|
|
65
|
+
required
|
|
86
66
|
/>
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
67
|
+
</Field>
|
|
68
|
+
}
|
|
69
|
+
save={{
|
|
70
|
+
busy: state.submitting,
|
|
71
|
+
canSave: state.dirty && !state.disabled,
|
|
72
|
+
dirty: state.dirty,
|
|
73
|
+
onSave: () => void state.save(),
|
|
74
|
+
onDiscard: state.discard,
|
|
75
|
+
saveError: state.saveError,
|
|
76
|
+
modifiedAt: state.modifiedAt,
|
|
77
|
+
}}
|
|
78
|
+
/>
|
|
91
79
|
);
|
|
92
80
|
}
|
|
@@ -74,8 +74,15 @@ export function useCollectionEntryCreate(target: TargetRef, tenantId: string | u
|
|
|
74
74
|
});
|
|
75
75
|
};
|
|
76
76
|
|
|
77
|
+
const reset = (): void => {
|
|
78
|
+
setSlug("");
|
|
79
|
+
setTitle("");
|
|
80
|
+
setContent("");
|
|
81
|
+
};
|
|
82
|
+
|
|
77
83
|
return {
|
|
78
84
|
editorContext,
|
|
85
|
+
reset,
|
|
79
86
|
headerTitle,
|
|
80
87
|
slug,
|
|
81
88
|
setSlug,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { dispatcherErrorText, useDispatcher, useTranslation } from "@cosmicdrift/kumiko-renderer";
|
|
2
|
-
import type { DispatcherError } from "@cosmicdrift/kumiko-renderer/headless";
|
|
2
|
+
import type { DispatcherError, Translate } from "@cosmicdrift/kumiko-renderer/headless";
|
|
3
3
|
import { useCallback, useState } from "react";
|
|
4
4
|
import { isTenantOverrideDeniedError } from "./tenant-override.ts";
|
|
5
5
|
|
|
@@ -15,8 +15,6 @@ export type ContentWriteResponse = {
|
|
|
15
15
|
readonly isNew: boolean;
|
|
16
16
|
};
|
|
17
17
|
|
|
18
|
-
type Translate = (key: string, params?: Readonly<Record<string, unknown>>) => string;
|
|
19
|
-
|
|
20
18
|
// A validation failure names the offending field with its own message; prefer that over the generic one.
|
|
21
19
|
function writeErrorText(error: DispatcherError, t: Translate): string {
|
|
22
20
|
const issue = error.details?.fields?.[0];
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Translate } from "@cosmicdrift/kumiko-renderer/headless";
|
|
1
2
|
import { useEditor, useEditorState } from "@tiptap/react";
|
|
2
3
|
import { useMemo, useState } from "react";
|
|
3
4
|
import { createDocumentEditorExtensions } from "./document-editor-extensions.ts";
|
|
@@ -6,8 +7,6 @@ import type { DocumentEditorProps, DocumentResourcePreview } from "./document-to
|
|
|
6
7
|
import { useEditorHandleReport } from "./editor-handle.ts";
|
|
7
8
|
import { useStableByKey } from "./use-stable-by-key.ts";
|
|
8
9
|
|
|
9
|
-
type Translate = (key: string, params?: Readonly<Record<string, unknown>>) => string;
|
|
10
|
-
|
|
11
10
|
export function documentEditorLabels(t: Translate) {
|
|
12
11
|
return {
|
|
13
12
|
placeholderLabel: t("template-resolver.documentEditor.placeholder"),
|
|
@@ -69,21 +69,29 @@ export function useTextBlockEditor(target: TargetRef) {
|
|
|
69
69
|
const [title, setTitle] = useState("");
|
|
70
70
|
const [content, setContent] = useState("");
|
|
71
71
|
const [savedMsg, setSavedMsg] = useState<string | null>(null);
|
|
72
|
+
// What is stored, to tell unsaved edits from the loaded state and to discard back to it.
|
|
73
|
+
// Separate strings: the sync effect re-runs for a fresh `loaded` object and equal strings bail out of the update.
|
|
74
|
+
const [baselineTitle, setBaselineTitle] = useState("");
|
|
75
|
+
const [baselineContent, setBaselineContent] = useState("");
|
|
72
76
|
|
|
73
77
|
// Sync loaded data into the form state. loaded === null means the block does
|
|
74
78
|
// not exist yet — empty form for the create flow.
|
|
75
|
-
//
|
|
79
|
+
// Keyed on the loaded primitives, not the result object: a refetch that returns identical
|
|
80
|
+
// values must not wipe what the user is typing.
|
|
81
|
+
const loadedTitle = loaded?.title ?? "";
|
|
82
|
+
const loadedContent = loaded?.content ?? "";
|
|
76
83
|
useEffect(() => {
|
|
77
84
|
// skip: keep the form untouched until the query settles
|
|
78
85
|
if (loading) return;
|
|
79
|
-
const
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
);
|
|
86
|
+
const shownContent =
|
|
87
|
+
contentFormat === "document" ? convertLegacyVariableText(loadedContent) : loadedContent;
|
|
88
|
+
setTitle(loadedTitle);
|
|
89
|
+
setContent(shownContent);
|
|
90
|
+
setBaselineTitle(loadedTitle);
|
|
91
|
+
setBaselineContent(shownContent);
|
|
84
92
|
clearError();
|
|
85
93
|
setSavedMsg(null);
|
|
86
|
-
}, [loading,
|
|
94
|
+
}, [loading, loadedTitle, loadedContent, contentFormat, clearError]);
|
|
87
95
|
|
|
88
96
|
const save = async (): Promise<void> => {
|
|
89
97
|
setSavedMsg(null);
|
|
@@ -101,14 +109,27 @@ export function useTextBlockEditor(target: TargetRef) {
|
|
|
101
109
|
// skip: useContentWrite already set the failure text
|
|
102
110
|
if (response === null) return;
|
|
103
111
|
refreshTree(collectionId ?? TEXT_BLOCK_TREE_KEY);
|
|
112
|
+
setBaselineTitle(title);
|
|
113
|
+
setBaselineContent(content);
|
|
104
114
|
setSavedMsg(
|
|
105
115
|
response.isNew ? t("template-resolver.editor.created") : t("template-resolver.editor.saved"),
|
|
106
116
|
);
|
|
107
117
|
};
|
|
108
118
|
|
|
119
|
+
const dirty = title !== baselineTitle || content !== baselineContent;
|
|
120
|
+
const discard = (): void => {
|
|
121
|
+
setTitle(baselineTitle);
|
|
122
|
+
setContent(baselineContent);
|
|
123
|
+
clearError();
|
|
124
|
+
setSavedMsg(null);
|
|
125
|
+
};
|
|
126
|
+
|
|
109
127
|
return {
|
|
110
128
|
slug,
|
|
111
129
|
locale,
|
|
130
|
+
dirty,
|
|
131
|
+
discard,
|
|
132
|
+
modifiedAt: loaded?.modifiedAt ?? null,
|
|
112
133
|
editorContext,
|
|
113
134
|
canWrite,
|
|
114
135
|
loading,
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import {
|
|
2
|
+
dispatcherErrorText,
|
|
3
|
+
type PreviewRenderer,
|
|
4
|
+
type PreviewRendererProps,
|
|
5
|
+
substituteVariables,
|
|
6
|
+
useDebouncedValue,
|
|
7
|
+
usePrimitives,
|
|
8
|
+
useQuery,
|
|
9
|
+
useTranslation,
|
|
10
|
+
} from "@cosmicdrift/kumiko-renderer";
|
|
11
|
+
import {
|
|
12
|
+
HtmlMailFrame,
|
|
13
|
+
LoadingState,
|
|
14
|
+
ModeSwitch,
|
|
15
|
+
type PreviewDevice,
|
|
16
|
+
PreviewWidthFrame,
|
|
17
|
+
} from "@cosmicdrift/kumiko-renderer/web";
|
|
18
|
+
import { isPlainObject } from "@cosmicdrift/kumiko-types/type-guards";
|
|
19
|
+
import { type ReactNode, useState } from "react";
|
|
20
|
+
import { TemplateResolverQueries } from "./qualified-names.ts";
|
|
21
|
+
import { stringValuesOf } from "./string-values.ts";
|
|
22
|
+
|
|
23
|
+
const PREVIEW_DEBOUNCE_MS = 300;
|
|
24
|
+
|
|
25
|
+
function htmlOf(value: unknown): string | null {
|
|
26
|
+
return isPlainObject(value) && typeof value["html"] === "string" ? value["html"] : null;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// The paper frame around a rendered body, with the optional Desktop/Mobil width switch of the web
|
|
30
|
+
// target. A null `html` is still loading unless `notice` (an error banner) explains the gap.
|
|
31
|
+
export function HtmlPaperFrame({
|
|
32
|
+
html,
|
|
33
|
+
devices,
|
|
34
|
+
notice,
|
|
35
|
+
}: {
|
|
36
|
+
readonly html: string | null;
|
|
37
|
+
readonly devices: boolean;
|
|
38
|
+
readonly notice?: ReactNode;
|
|
39
|
+
}): ReactNode {
|
|
40
|
+
const t = useTranslation();
|
|
41
|
+
const { Card } = usePrimitives();
|
|
42
|
+
const [device, setDevice] = useState<PreviewDevice>("desktop");
|
|
43
|
+
return (
|
|
44
|
+
<div className="flex min-h-0 flex-1 flex-col gap-3 overflow-auto px-8 py-6">
|
|
45
|
+
{devices && (
|
|
46
|
+
<div className="flex justify-end">
|
|
47
|
+
<ModeSwitch<PreviewDevice>
|
|
48
|
+
value={device}
|
|
49
|
+
onChange={setDevice}
|
|
50
|
+
ariaLabel={t("kumiko.editor.deviceSwitch")}
|
|
51
|
+
testId="web-preview-device-switch"
|
|
52
|
+
options={[
|
|
53
|
+
{ value: "desktop", label: t("kumiko.editor.device.desktop") },
|
|
54
|
+
{ value: "mobile", label: t("kumiko.editor.device.mobile") },
|
|
55
|
+
]}
|
|
56
|
+
/>
|
|
57
|
+
</div>
|
|
58
|
+
)}
|
|
59
|
+
{notice}
|
|
60
|
+
{html === null ? (
|
|
61
|
+
notice === undefined && <LoadingState />
|
|
62
|
+
) : (
|
|
63
|
+
<PreviewWidthFrame device={device} testId="web-preview-frame">
|
|
64
|
+
<Card>
|
|
65
|
+
{/* HtmlMailFrame sizes itself on load; remounting per device re-measures at the new width. */}
|
|
66
|
+
<HtmlMailFrame
|
|
67
|
+
key={device}
|
|
68
|
+
html={html}
|
|
69
|
+
title={t("template-resolver.preview.frameTitle")}
|
|
70
|
+
allowRemoteImages
|
|
71
|
+
testId="web-preview-iframe"
|
|
72
|
+
/>
|
|
73
|
+
</Card>
|
|
74
|
+
</PreviewWidthFrame>
|
|
75
|
+
)}
|
|
76
|
+
</div>
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// Shows server-sanitized body HTML (`template-resolver:query:body-preview`) in the paper frame; the
|
|
81
|
+
// same sanitizer and markdown core as the visitor paths of managed-pages and legal-pages, without
|
|
82
|
+
// saving.
|
|
83
|
+
export function BodyPreviewFrame({
|
|
84
|
+
body,
|
|
85
|
+
bodyFormat,
|
|
86
|
+
}: {
|
|
87
|
+
readonly body: string;
|
|
88
|
+
readonly bodyFormat: "markdown" | "document";
|
|
89
|
+
}): ReactNode {
|
|
90
|
+
const t = useTranslation();
|
|
91
|
+
const { Banner } = usePrimitives();
|
|
92
|
+
const settled = useDebouncedValue(body, PREVIEW_DEBOUNCE_MS);
|
|
93
|
+
const query = useQuery<unknown>(TemplateResolverQueries.bodyPreview, {
|
|
94
|
+
body: settled,
|
|
95
|
+
bodyFormat,
|
|
96
|
+
});
|
|
97
|
+
return (
|
|
98
|
+
<HtmlPaperFrame
|
|
99
|
+
html={htmlOf(query.data)}
|
|
100
|
+
devices
|
|
101
|
+
notice={
|
|
102
|
+
query.error !== null ? (
|
|
103
|
+
<Banner variant="error" testId="web-preview-error">
|
|
104
|
+
{dispatcherErrorText(query.error, t)}
|
|
105
|
+
</Banner>
|
|
106
|
+
) : undefined
|
|
107
|
+
}
|
|
108
|
+
/>
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// The "web" target. A plain-text body (legal text with `{{placeholders}}`) is previewed as
|
|
113
|
+
// Markdown with the example values filled in.
|
|
114
|
+
export const WebPreviewRenderer: PreviewRenderer = ({
|
|
115
|
+
content,
|
|
116
|
+
editFormat,
|
|
117
|
+
variables,
|
|
118
|
+
}: PreviewRendererProps): ReactNode => {
|
|
119
|
+
const isDocument = editFormat === "document";
|
|
120
|
+
return (
|
|
121
|
+
<BodyPreviewFrame
|
|
122
|
+
body={isDocument ? content : substituteVariables(content, stringValuesOf(variables))}
|
|
123
|
+
bodyFormat={isDocument ? "document" : "markdown"}
|
|
124
|
+
/>
|
|
125
|
+
);
|
|
126
|
+
};
|
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
// collections stay usable without the user-data-rights stack. Mirrors
|
|
6
6
|
// notes-history-user-data.
|
|
7
7
|
|
|
8
|
-
import { defineFeature
|
|
8
|
+
import { defineFeature } from "@cosmicdrift/kumiko-framework/engine";
|
|
9
|
+
import { registerUserDataHooks } from "../shared/index.ts";
|
|
9
10
|
import { userContentDeleteHook, userContentExportHook } from "./hooks.ts";
|
|
10
11
|
|
|
11
12
|
export function createTemplateResolverUserDataFeature() {
|
|
@@ -15,15 +16,15 @@ export function createTemplateResolverUserDataFeature() {
|
|
|
15
16
|
r.describe(
|
|
16
17
|
"GDPR (Art. 20 export / Art. 17 erasure) coverage for the `template-resolver` feature's `user-content-entry` entity — the per-user half of the content store (mail signatures, personal reply snippets). Mounts the EXT_USER_DATA export hook so a user's own entries land in the export bundle; the delete hook is a deliberate no-op because `content` is annotated `userOwned`, so erasure runs via crypto-shredding (destroying the owner's subject key) rather than a physical delete, which would not survive an event replay. Mount this whenever `createTemplateResolverFeature` declares a collection with `ownership: \"user\"` — the boot guard otherwise refuses the entity. Requires `user-data-rights`, optionalRequires `template-resolver`.",
|
|
17
18
|
);
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
19
|
+
registerUserDataHooks(r, {
|
|
20
|
+
sourceFeature: "template-resolver",
|
|
21
|
+
entities: [
|
|
22
|
+
{
|
|
23
|
+
entity: "user-content-entry",
|
|
24
|
+
export: userContentExportHook,
|
|
25
|
+
delete: userContentDeleteHook,
|
|
26
|
+
},
|
|
27
|
+
],
|
|
27
28
|
});
|
|
28
29
|
},
|
|
29
30
|
{ dedupeOptions: {} },
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"version": "0.414.0",
|
|
4
|
+
"type": "fix",
|
|
5
|
+
"title": "seedTenantMembership reports rowMissing",
|
|
6
|
+
"detail": "seedTenantMembership reports rowMissing when the membership projection row did not materialize and callers log it."
|
|
7
|
+
},
|
|
2
8
|
{
|
|
3
9
|
"version": "0.391.0",
|
|
4
10
|
"type": "fix",
|