@drawnagency/primitives 0.1.113 → 0.1.115
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/README.md +1 -1
- package/dist/auth/cookies.d.ts +39 -0
- package/dist/auth/cookies.d.ts.map +1 -1
- package/dist/auth/index.js +3 -3
- package/dist/chunk-4WQ36ZP7.js +83 -0
- package/dist/{chunk-REDDTTGJ.js → chunk-4Y2JQQZL.js} +19 -1
- package/dist/chunk-5GFACGSN.js +6 -0
- package/dist/{chunk-AHALSCQH.js → chunk-67P34WNW.js} +76 -131
- package/dist/{chunk-S2L3BPLS.js → chunk-7SX42OP4.js} +1 -1
- package/dist/{chunk-GGXZZ77Z.js → chunk-AASEGXNT.js} +18 -1
- package/dist/chunk-APIJPTFG.js +64 -0
- package/dist/{chunk-WKZ7OENC.js → chunk-BQ5TZZUE.js} +5 -1
- package/dist/chunk-CDBURDPX.js +90 -0
- package/dist/chunk-DFKTF3CH.js +0 -0
- package/dist/chunk-DIMDRBFK.js +11 -0
- package/dist/chunk-DJABADOO.js +131 -0
- package/dist/{chunk-NHN2LSIU.js → chunk-DJOGPSRU.js} +31 -68
- package/dist/{chunk-KR2MHTNJ.js → chunk-FHTKSELX.js} +610 -62
- package/dist/{chunk-WUJ3XNFI.js → chunk-GGYY3JQJ.js} +19 -24
- package/dist/chunk-GNF6KFQ7.js +18 -0
- package/dist/{chunk-FRE2CCLV.js → chunk-HHNPSKPT.js} +5 -79
- package/dist/{chunk-IINIZBQB.js → chunk-JCDZAFX2.js} +30 -10
- package/dist/chunk-JR24U7FJ.js +120 -0
- package/dist/{chunk-BDFTMGCL.js → chunk-JXATNKLV.js} +11 -10
- package/dist/{chunk-SW6PCQQD.js → chunk-KQA772WQ.js} +2 -1
- package/dist/{chunk-6BZ2KNTP.js → chunk-NX7TFHA4.js} +195 -65
- package/dist/{chunk-VWWY5TL5.js → chunk-O37AV27P.js} +14 -75
- package/dist/chunk-RIITGTV3.js +275 -0
- package/dist/{chunk-HBULBDGP.js → chunk-S37DZPHW.js} +1 -1
- package/dist/chunk-S7QRHUWO.js +8 -0
- package/dist/{chunk-Z7W3DQTR.js → chunk-T26HAKW3.js} +424 -42
- package/dist/{chunk-4I5OO5UB.js → chunk-TEOAKGZA.js} +0 -1
- package/dist/{chunk-GPPVYLEI.js → chunk-UUUSJDIG.js} +1 -1
- package/dist/chunk-VY3IFGE3.js +70 -0
- package/dist/chunk-WYOFQHKI.js +176 -0
- package/dist/{chunk-4RNF2DRG.js → chunk-XDEPXTBY.js} +0 -2
- package/dist/{chunk-DS4GCYV2.js → chunk-YV3YSZEB.js} +223 -16
- package/dist/collab/rebase.d.ts +2 -1
- package/dist/collab/rebase.d.ts.map +1 -1
- package/dist/collab/rebase.js +24 -9
- package/dist/components/brandguide/ColorsEditable.d.ts.map +1 -1
- package/dist/components/chat/ChatPanel.d.ts.map +1 -1
- package/dist/components/chat/ChatWidget.d.ts.map +1 -1
- package/dist/components/docfile/DocFilePane.d.ts.map +1 -1
- package/dist/components/editor/ChildBlockWrapper.d.ts.map +1 -1
- package/dist/components/editor/ConflictDialog.d.ts.map +1 -1
- package/dist/components/editor/DragHandle.d.ts +12 -2
- package/dist/components/editor/DragHandle.d.ts.map +1 -1
- package/dist/components/editor/DropEdgeIndicator.d.ts +15 -6
- package/dist/components/editor/DropEdgeIndicator.d.ts.map +1 -1
- package/dist/components/editor/NavGroupRow.d.ts +4 -1
- package/dist/components/editor/NavGroupRow.d.ts.map +1 -1
- package/dist/components/editor/PagesModal.d.ts.map +1 -1
- package/dist/components/editor/SectionWrapper.d.ts +1 -1
- package/dist/components/editor/SectionWrapper.d.ts.map +1 -1
- package/dist/components/editor/SettingsForm.d.ts.map +1 -1
- package/dist/components/editor/TagIndicator.d.ts +15 -0
- package/dist/components/editor/TagIndicator.d.ts.map +1 -0
- package/dist/components/editor/index.js +150 -79
- package/dist/components/primitives/DocumentDropZone.d.ts +1 -1
- package/dist/components/primitives/EditableGrid.d.ts.map +1 -1
- package/dist/components/primitives/EditableList.d.ts.map +1 -1
- package/dist/components/primitives/HeadingSection.d.ts +4 -1
- package/dist/components/primitives/HeadingSection.d.ts.map +1 -1
- package/dist/components/primitives/ResolvedMedia.d.ts +5 -1
- package/dist/components/primitives/ResolvedMedia.d.ts.map +1 -1
- package/dist/components/primitives/{defineHeadingSection.d.ts → define-heading-section.d.ts} +1 -1
- package/dist/components/primitives/define-heading-section.d.ts.map +1 -0
- package/dist/components/primitives/{gridDrop.d.ts → grid-drop.d.ts} +1 -1
- package/dist/components/primitives/grid-drop.d.ts.map +1 -0
- package/dist/components/primitives/index.d.ts +1 -1
- package/dist/components/primitives/index.d.ts.map +1 -1
- package/dist/components/primitives/index.js +22 -154
- package/dist/components/sections/Button/CTAButton.d.ts.map +1 -1
- package/dist/components/sections/DoDontMedia/DoDontMediaBlock.d.ts +2 -6
- package/dist/components/sections/DoDontMedia/DoDontMediaBlock.d.ts.map +1 -1
- package/dist/components/sections/DoDontMedia/index.d.ts +8 -0
- package/dist/components/sections/DoDontMedia/index.d.ts.map +1 -1
- package/dist/components/sections/IconList/IconList.d.ts +2 -1
- package/dist/components/sections/IconList/IconList.d.ts.map +1 -1
- package/dist/components/sections/IconList/IconListSettings.d.ts +2 -1
- package/dist/components/sections/IconList/IconListSettings.d.ts.map +1 -1
- package/dist/components/sections/IconList/index.d.ts +1 -0
- package/dist/components/sections/IconList/index.d.ts.map +1 -1
- package/dist/components/sections/Media/MediaBlock.d.ts +2 -1
- package/dist/components/sections/Media/MediaBlock.d.ts.map +1 -1
- package/dist/components/sections/Media/index.d.ts +8 -0
- package/dist/components/sections/Media/index.d.ts.map +1 -1
- package/dist/components/sections/Reference/ReferenceList.d.ts +35 -0
- package/dist/components/sections/Reference/ReferenceList.d.ts.map +1 -0
- package/dist/components/sections/Reference/ReferenceSettings.d.ts +12 -0
- package/dist/components/sections/Reference/ReferenceSettings.d.ts.map +1 -0
- package/dist/components/sections/Reference/index.d.ts +9 -0
- package/dist/components/sections/Reference/index.d.ts.map +1 -0
- package/dist/components/sections/SectionSummary/SectionSummaryBlock.d.ts +38 -0
- package/dist/components/sections/SectionSummary/SectionSummaryBlock.d.ts.map +1 -0
- package/dist/components/sections/SectionSummary/SectionSummarySettings.d.ts +20 -0
- package/dist/components/sections/SectionSummary/SectionSummarySettings.d.ts.map +1 -0
- package/dist/components/sections/SectionSummary/index.d.ts +33 -0
- package/dist/components/sections/SectionSummary/index.d.ts.map +1 -0
- package/dist/components/sections/all-sections.d.ts +53 -0
- package/dist/components/sections/all-sections.d.ts.map +1 -1
- package/dist/components/sections/brand-guide.d.ts +41 -2
- package/dist/components/sections/brand-guide.d.ts.map +1 -1
- package/dist/components/sections/brand-guide.js +17 -10
- package/dist/components/sections/core-sections.d.ts +14 -0
- package/dist/components/sections/core-sections.d.ts.map +1 -1
- package/dist/components/sections/register-schemas.js +25 -18
- package/dist/components/sections/register.js +25 -18
- package/dist/components/shared/BrandSwatchesContext.d.ts +9 -0
- package/dist/components/shared/BrandSwatchesContext.d.ts.map +1 -0
- package/dist/components/shared/Button.d.ts +11 -3
- package/dist/components/shared/Button.d.ts.map +1 -1
- package/dist/components/shared/Checkbox.d.ts +6 -0
- package/dist/components/shared/Checkbox.d.ts.map +1 -1
- package/dist/components/shared/ConfirmDialog.d.ts +25 -0
- package/dist/components/shared/ConfirmDialog.d.ts.map +1 -0
- package/dist/components/shared/ConfirmInline.d.ts +25 -0
- package/dist/components/shared/ConfirmInline.d.ts.map +1 -0
- package/dist/components/shared/ErrorBoundary.d.ts.map +1 -1
- package/dist/components/shared/Fab.d.ts +11 -2
- package/dist/components/shared/Fab.d.ts.map +1 -1
- package/dist/components/shared/FabStack.d.ts +22 -0
- package/dist/components/shared/FabStack.d.ts.map +1 -0
- package/dist/components/shared/HistoryChangesModal.d.ts.map +1 -1
- package/dist/components/shared/HistoryPopover.d.ts.map +1 -1
- package/dist/components/shared/ImageBackgroundField.d.ts +9 -0
- package/dist/components/shared/ImageBackgroundField.d.ts.map +1 -0
- package/dist/components/shared/{UploadRejectionAlert.d.ts → InlineAlert.d.ts} +4 -2
- package/dist/components/shared/InlineAlert.d.ts.map +1 -0
- package/dist/components/shared/Input.d.ts +10 -0
- package/dist/components/shared/Input.d.ts.map +1 -1
- package/dist/components/shared/Navigation.d.ts.map +1 -1
- package/dist/components/shared/Notice.d.ts +10 -0
- package/dist/components/shared/Notice.d.ts.map +1 -0
- package/dist/components/shared/Popover.d.ts.map +1 -1
- package/dist/components/shared/ReferenceSourcesContext.d.ts +25 -0
- package/dist/components/shared/ReferenceSourcesContext.d.ts.map +1 -0
- package/dist/components/shared/Select.d.ts +3 -2
- package/dist/components/shared/Select.d.ts.map +1 -1
- package/dist/components/shared/SplitButton.d.ts.map +1 -1
- package/dist/components/shared/SummaryAnchorsContext.d.ts +10 -0
- package/dist/components/shared/SummaryAnchorsContext.d.ts.map +1 -0
- package/dist/components/shared/Textarea.d.ts +7 -0
- package/dist/components/shared/Textarea.d.ts.map +1 -1
- package/dist/components/shared/ToolbarFrame.d.ts +17 -0
- package/dist/components/shared/ToolbarFrame.d.ts.map +1 -0
- package/dist/components/shared/copy.d.ts +13 -0
- package/dist/components/shared/copy.d.ts.map +1 -0
- package/dist/components/shared/icons.d.ts +0 -12
- package/dist/components/shared/icons.d.ts.map +1 -1
- package/dist/components/shell/AudienceDetailsPanel.d.ts +7 -1
- package/dist/components/shell/AudienceDetailsPanel.d.ts.map +1 -1
- package/dist/components/shell/AudienceRow.d.ts.map +1 -1
- package/dist/components/shell/BugReportFAB.d.ts +7 -1
- package/dist/components/shell/BugReportFAB.d.ts.map +1 -1
- package/dist/components/shell/CredentialList.d.ts.map +1 -1
- package/dist/components/shell/DocInspector.d.ts.map +1 -1
- package/dist/components/shell/DocumentEditorOverlay.d.ts.map +1 -1
- package/dist/components/shell/EditorContext.d.ts +4 -0
- package/dist/components/shell/EditorContext.d.ts.map +1 -1
- package/dist/components/shell/EditorLoginForm.d.ts.map +1 -1
- package/dist/components/shell/EditorModal.d.ts.map +1 -1
- package/dist/components/shell/EditorShell.d.ts.map +1 -1
- package/dist/components/shell/HistoryToolbar.d.ts.map +1 -1
- package/dist/components/shell/MediaFolderTile.d.ts +4 -1
- package/dist/components/shell/MediaFolderTile.d.ts.map +1 -1
- package/dist/components/shell/MediaLibraryModal.d.ts.map +1 -1
- package/dist/components/shell/RestoreModal.d.ts.map +1 -1
- package/dist/components/shell/SiteSettingsChatbot.d.ts.map +1 -1
- package/dist/components/shell/SiteSettingsDisplay.d.ts.map +1 -1
- package/dist/components/shell/SiteSettingsModal.d.ts +3 -1
- package/dist/components/shell/SiteSettingsModal.d.ts.map +1 -1
- package/dist/components/shell/SiteSettingsTags.d.ts +13 -0
- package/dist/components/shell/SiteSettingsTags.d.ts.map +1 -0
- package/dist/components/shell/SiteSettingsUsers.d.ts.map +1 -1
- package/dist/components/shell/ViewerLoginForm.d.ts.map +1 -1
- package/dist/components/shell/{blockMoveDispatch.d.ts → block-move-dispatch.d.ts} +1 -1
- package/dist/components/shell/block-move-dispatch.d.ts.map +1 -0
- package/dist/components/shell/reference-sources.d.ts +22 -0
- package/dist/components/shell/reference-sources.d.ts.map +1 -0
- package/dist/deck/index.d.ts +2 -2
- package/dist/deck/index.d.ts.map +1 -1
- package/dist/deck/index.js +1 -3
- package/dist/deck-builder/index.js +10 -17
- package/dist/document/index.d.ts +2 -2
- package/dist/document/index.d.ts.map +1 -1
- package/dist/hooks/useBlockDnd.d.ts +11 -0
- package/dist/hooks/useBlockDnd.d.ts.map +1 -1
- package/dist/hooks/useBuildStatus.d.ts +1 -1
- package/dist/hooks/useBuildStatus.d.ts.map +1 -1
- package/dist/hooks/useDocumentUploads.d.ts +1 -1
- package/dist/hooks/useDocumentUploads.d.ts.map +1 -1
- package/dist/hooks/useEditorPersistence.d.ts +5 -1
- package/dist/hooks/useEditorPersistence.d.ts.map +1 -1
- package/dist/hooks/useEditorPublish.d.ts +6 -3
- package/dist/hooks/useEditorPublish.d.ts.map +1 -1
- package/dist/hooks/useMediaPipeline.d.ts.map +1 -1
- package/dist/hooks/useNotice.d.ts +19 -0
- package/dist/hooks/useNotice.d.ts.map +1 -0
- package/dist/hooks/useSortableNavRow.d.ts +11 -0
- package/dist/hooks/useSortableNavRow.d.ts.map +1 -1
- package/dist/hooks/useSortableRow.d.ts +11 -0
- package/dist/hooks/useSortableRow.d.ts.map +1 -1
- package/dist/hooks/useStackedEscape.d.ts +32 -0
- package/dist/hooks/useStackedEscape.d.ts.map +1 -0
- package/dist/index.js +95 -48
- package/dist/lib/audience-secret.js +2 -2
- package/dist/lib/block-dnd.d.ts +5 -0
- package/dist/lib/block-dnd.d.ts.map +1 -1
- package/dist/lib/block-move.d.ts.map +1 -1
- package/dist/lib/brand-swatches.d.ts +12 -0
- package/dist/lib/brand-swatches.d.ts.map +1 -0
- package/dist/lib/container-ops.d.ts +3 -2
- package/dist/lib/container-ops.d.ts.map +1 -1
- package/dist/lib/dexie.d.ts +7 -1
- package/dist/lib/dexie.d.ts.map +1 -1
- package/dist/lib/dexie.js +12 -3
- package/dist/lib/env.d.ts +4 -0
- package/dist/lib/env.d.ts.map +1 -1
- package/dist/lib/env.js +5 -3
- package/dist/lib/events.d.ts +1 -2
- package/dist/lib/events.d.ts.map +1 -1
- package/dist/lib/image-background.d.ts +8 -0
- package/dist/lib/image-background.d.ts.map +1 -0
- package/dist/lib/image-variant-plan.d.ts +42 -0
- package/dist/lib/image-variant-plan.d.ts.map +1 -0
- package/dist/lib/image-variant-plan.js +53 -0
- package/dist/lib/index-ops.d.ts.map +1 -1
- package/dist/lib/index-ops.js +21 -17
- package/dist/lib/index.d.ts +7 -4
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +55 -26
- package/dist/lib/loader.d.ts +25 -12
- package/dist/lib/loader.d.ts.map +1 -1
- package/dist/lib/media-ops.d.ts +73 -0
- package/dist/lib/media-ops.d.ts.map +1 -0
- package/dist/lib/media-ops.js +60 -0
- package/dist/lib/nav-tree.d.ts +7 -0
- package/dist/lib/nav-tree.d.ts.map +1 -1
- package/dist/lib/nav.d.ts +38 -0
- package/dist/lib/nav.d.ts.map +1 -1
- package/dist/lib/pages.d.ts +2 -1
- package/dist/lib/pages.d.ts.map +1 -1
- package/dist/lib/platform-broker.d.ts +4 -2
- package/dist/lib/platform-broker.d.ts.map +1 -1
- package/dist/lib/platform-broker.js +21 -13
- package/dist/lib/reference-type.d.ts +2 -0
- package/dist/lib/reference-type.d.ts.map +1 -0
- package/dist/lib/reference-validation.d.ts +31 -0
- package/dist/lib/reference-validation.d.ts.map +1 -0
- package/dist/lib/reference-validation.js +39 -0
- package/dist/lib/references.d.ts +74 -0
- package/dist/lib/references.d.ts.map +1 -0
- package/dist/lib/registry.d.ts +35 -0
- package/dist/lib/registry.d.ts.map +1 -1
- package/dist/lib/{safeRedirect.d.ts → safe-redirect.d.ts} +1 -1
- package/dist/lib/safe-redirect.d.ts.map +1 -0
- package/dist/lib/sidecar-diagnostics.d.ts +20 -0
- package/dist/lib/sidecar-diagnostics.d.ts.map +1 -0
- package/dist/lib/sidecars.d.ts +118 -0
- package/dist/lib/sidecars.d.ts.map +1 -0
- package/dist/lib/sidecars.js +23 -0
- package/dist/lib/slug.d.ts +2 -0
- package/dist/lib/slug.d.ts.map +1 -0
- package/dist/lib/storage-tier.d.ts +17 -0
- package/dist/lib/storage-tier.d.ts.map +1 -0
- package/dist/lib/storage-tier.js +29 -0
- package/dist/lib/tags.d.ts +64 -0
- package/dist/lib/tags.d.ts.map +1 -0
- package/dist/lib/theme-vars.d.ts +9 -0
- package/dist/lib/theme-vars.d.ts.map +1 -1
- package/dist/media/index.d.ts +1 -1
- package/dist/media/index.d.ts.map +1 -1
- package/dist/media/index.js +18 -14
- package/dist/media/queue.d.ts +2 -0
- package/dist/media/queue.d.ts.map +1 -1
- package/dist/media/utils.d.ts +2 -0
- package/dist/media/utils.d.ts.map +1 -1
- package/dist/media/{videoPoster.d.ts → video-poster.d.ts} +1 -1
- package/dist/media/video-poster.d.ts.map +1 -0
- package/dist/media/worker.d.ts +1 -35
- package/dist/media/worker.d.ts.map +1 -1
- package/dist/schemas/audience.js +2 -2
- package/dist/schemas/index.d.ts +1 -0
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/schemas/index.js +25 -13
- package/dist/schemas/media.d.ts +4 -0
- package/dist/schemas/media.d.ts.map +1 -1
- package/dist/schemas/shared.d.ts +26 -0
- package/dist/schemas/shared.d.ts.map +1 -1
- package/dist/schemas/site-config.d.ts +6 -0
- package/dist/schemas/site-config.d.ts.map +1 -1
- package/dist/schemas/tags.d.ts +27 -0
- package/dist/schemas/tags.d.ts.map +1 -0
- package/dist/storage/index.js +2 -1
- package/dist/storage/memory.d.ts +21 -0
- package/dist/storage/memory.d.ts.map +1 -0
- package/dist/storage/memory.js +129 -0
- package/dist/storage/types.d.ts +9 -0
- package/dist/storage/types.d.ts.map +1 -1
- package/dist/types/database.d.ts.map +1 -1
- package/package.json +26 -1
- package/src/auth/cookies.ts +111 -0
- package/src/collab/rebase.ts +29 -9
- package/src/components/brandguide/ColorSwatchSettings.tsx +1 -1
- package/src/components/brandguide/ColorsEditable.tsx +1 -0
- package/src/components/chat/ChatPanel.tsx +2 -3
- package/src/components/chat/ChatWidget.tsx +2 -3
- package/src/components/docfile/DocFilePane.tsx +4 -12
- package/src/components/editor/ChildBlockWrapper.tsx +13 -19
- package/src/components/editor/ConflictDialog.tsx +27 -35
- package/src/components/editor/DeleteButton.tsx +2 -2
- package/src/components/editor/DragHandle.tsx +16 -3
- package/src/components/editor/DropEdgeIndicator.tsx +36 -10
- package/src/components/editor/InsertButton.tsx +2 -2
- package/src/components/editor/NavGroupRow.tsx +43 -14
- package/src/components/editor/PagesModal.tsx +99 -26
- package/src/components/editor/SectionWrapper.tsx +64 -23
- package/src/components/editor/SettingsButton.tsx +2 -2
- package/src/components/editor/SettingsForm.tsx +19 -2
- package/src/components/editor/StatusIndicator.tsx +4 -4
- package/src/components/editor/TagIndicator.tsx +80 -0
- package/src/components/primitives/DocumentDropZone.tsx +1 -1
- package/src/components/primitives/EditableGrid.tsx +15 -14
- package/src/components/primitives/EditableList.tsx +27 -74
- package/src/components/primitives/HeadingSection.tsx +5 -2
- package/src/components/primitives/ResolvedMedia.tsx +13 -0
- package/src/components/primitives/{defineHeadingSection.tsx → define-heading-section.tsx} +1 -0
- package/src/components/primitives/index.ts +1 -1
- package/src/components/primitives/useEditablePlainText.ts +5 -5
- package/src/components/sections/Button/CTAButton.tsx +3 -1
- package/src/components/sections/DoDontMedia/DoDontMediaBlock.tsx +4 -4
- package/src/components/sections/DoDontMedia/index.tsx +12 -3
- package/src/components/sections/IconList/DoDontToggle.tsx +2 -2
- package/src/components/sections/IconList/IconList.tsx +70 -37
- package/src/components/sections/IconList/IconListSettings.tsx +55 -17
- package/src/components/sections/IconList/index.tsx +10 -3
- package/src/components/sections/LinkHeading/index.tsx +1 -1
- package/src/components/sections/Media/MediaBlock.tsx +13 -2
- package/src/components/sections/Media/index.tsx +12 -4
- package/src/components/sections/Reference/ReferenceList.tsx +214 -0
- package/src/components/sections/Reference/ReferenceSettings.tsx +159 -0
- package/src/components/sections/Reference/index.tsx +47 -0
- package/src/components/sections/SectionSummary/SectionSummaryBlock.tsx +476 -0
- package/src/components/sections/SectionSummary/SectionSummarySettings.tsx +126 -0
- package/src/components/sections/SectionSummary/index.tsx +149 -0
- package/src/components/sections/SubHeading/index.tsx +1 -1
- package/src/components/sections/SubSubHeading/index.tsx +1 -1
- package/src/components/sections/brand-guide.ts +4 -3
- package/src/components/sections/core-sections.ts +2 -0
- package/src/components/shared/BrandSwatchesContext.ts +13 -0
- package/src/components/shared/Button.tsx +47 -34
- package/src/components/shared/Checkbox.tsx +21 -12
- package/src/components/shared/ConfirmDialog.tsx +87 -0
- package/src/components/shared/ConfirmInline.tsx +90 -0
- package/src/components/shared/ErrorBoundary.tsx +6 -18
- package/src/components/shared/Fab.tsx +15 -5
- package/src/components/shared/FabStack.tsx +28 -0
- package/src/components/shared/HistoryChangesModal.tsx +43 -41
- package/src/components/shared/HistoryPopover.tsx +7 -20
- package/src/components/shared/ImageBackgroundField.tsx +92 -0
- package/src/components/shared/{UploadRejectionAlert.tsx → InlineAlert.tsx} +21 -5
- package/src/components/shared/Input.tsx +23 -7
- package/src/components/shared/Navigation.tsx +22 -17
- package/src/components/shared/Notice.tsx +59 -0
- package/src/components/shared/Popover.tsx +7 -11
- package/src/components/shared/ReferenceSourcesContext.ts +27 -0
- package/src/components/shared/Select.tsx +5 -2
- package/src/components/shared/SplitButton.tsx +11 -17
- package/src/components/shared/SummaryAnchorsContext.ts +11 -0
- package/src/components/shared/Textarea.tsx +17 -2
- package/src/components/shared/ToolbarFrame.tsx +28 -0
- package/src/components/shared/VideoSourceField.tsx +1 -1
- package/src/components/shared/copy.ts +18 -0
- package/src/components/shared/icons.tsx +1 -17
- package/src/components/shell/AudienceAddForm.tsx +2 -2
- package/src/components/shell/AudienceDetailsPanel.tsx +23 -5
- package/src/components/shell/AudienceRow.tsx +22 -15
- package/src/components/shell/BugReportFAB.tsx +50 -40
- package/src/components/shell/CredentialList.tsx +33 -13
- package/src/components/shell/DocInspector.tsx +3 -12
- package/src/components/shell/DocumentEditorOverlay.tsx +33 -23
- package/src/components/shell/EditorContext.tsx +7 -0
- package/src/components/shell/EditorLoginForm.tsx +26 -36
- package/src/components/shell/EditorModal.tsx +8 -10
- package/src/components/shell/EditorShell.tsx +501 -338
- package/src/components/shell/HistoryToolbar.tsx +24 -26
- package/src/components/shell/MediaFolderTile.tsx +8 -3
- package/src/components/shell/MediaLibraryModal.tsx +59 -60
- package/src/components/shell/ProcessingIndicator.tsx +2 -2
- package/src/components/shell/RestoreModal.tsx +17 -16
- package/src/components/shell/SetPasswordForm.tsx +3 -3
- package/src/components/shell/SiteSettingsChatbot.tsx +61 -42
- package/src/components/shell/SiteSettingsDisplay.tsx +10 -20
- package/src/components/shell/SiteSettingsModal.tsx +24 -2
- package/src/components/shell/SiteSettingsTags.tsx +143 -0
- package/src/components/shell/SiteSettingsUsers.tsx +36 -26
- package/src/components/shell/SiteSettingsViewerAccess.tsx +2 -2
- package/src/components/shell/ViewerLoginForm.tsx +5 -4
- package/src/components/shell/reference-sources.ts +36 -0
- package/src/deck/index.ts +2 -2
- package/src/document/index.ts +2 -2
- package/src/hooks/useBlockDnd.ts +11 -0
- package/src/hooks/useBuildStatus.ts +53 -6
- package/src/hooks/useDocumentUploads.ts +1 -1
- package/src/hooks/useEditorPersistence.ts +141 -35
- package/src/hooks/useEditorPublish.ts +27 -31
- package/src/hooks/useMediaPipeline.ts +30 -24
- package/src/hooks/useNotice.ts +45 -0
- package/src/hooks/useSortableNavRow.ts +11 -0
- package/src/hooks/useSortableRow.ts +22 -2
- package/src/hooks/useStackedEscape.ts +62 -0
- package/src/lib/block-dnd.ts +6 -1
- package/src/lib/block-move.ts +3 -0
- package/src/lib/brand-swatches.ts +32 -0
- package/src/lib/container-ops.ts +5 -3
- package/src/lib/dexie.ts +24 -2
- package/src/lib/env.ts +9 -0
- package/src/lib/events.ts +1 -2
- package/src/lib/image-background.ts +31 -0
- package/src/lib/image-variant-plan.ts +92 -0
- package/src/lib/index-ops.ts +9 -18
- package/src/lib/index.ts +20 -4
- package/src/lib/loader.ts +28 -88
- package/src/lib/media-ops.ts +112 -0
- package/src/lib/nav-tree.ts +104 -4
- package/src/lib/nav.ts +196 -36
- package/src/lib/pages.ts +2 -3
- package/src/lib/platform-broker.ts +32 -14
- package/src/lib/reference-type.ts +3 -0
- package/src/lib/reference-validation.ts +69 -0
- package/src/lib/references.ts +130 -0
- package/src/lib/registry.ts +37 -0
- package/src/lib/sidecar-diagnostics.ts +29 -0
- package/src/lib/sidecars.ts +221 -0
- package/src/lib/slug.ts +6 -0
- package/src/lib/storage-tier.ts +38 -0
- package/src/lib/tags.ts +165 -0
- package/src/lib/theme-vars.ts +23 -0
- package/src/media/index.ts +1 -1
- package/src/media/queue.ts +3 -0
- package/src/media/utils.ts +19 -1
- package/src/media/{videoPoster.ts → video-poster.ts} +2 -2
- package/src/media/worker.ts +17 -8
- package/src/schemas/index.ts +1 -0
- package/src/schemas/media.ts +7 -2
- package/src/schemas/shared.ts +24 -1
- package/src/schemas/site-config.ts +6 -1
- package/src/schemas/tags.ts +33 -0
- package/src/storage/memory.ts +178 -0
- package/src/storage/types.ts +16 -3
- package/src/types/database.ts +2 -0
- package/dist/chunk-DNY72JZN.js +0 -86
- package/dist/chunk-F2LYQPXV.js +0 -77
- package/dist/chunk-JH762VUH.js +0 -128
- package/dist/chunk-K7DYZXVU.js +0 -138
- package/dist/components/primitives/defineHeadingSection.d.ts.map +0 -1
- package/dist/components/primitives/gridDrop.d.ts.map +0 -1
- package/dist/components/shared/UploadRejectionAlert.d.ts.map +0 -1
- package/dist/components/shell/BuildStatusIndicator.d.ts +0 -7
- package/dist/components/shell/BuildStatusIndicator.d.ts.map +0 -1
- package/dist/components/shell/blockMoveDispatch.d.ts.map +0 -1
- package/dist/hooks/index.d.ts +0 -9
- package/dist/hooks/index.d.ts.map +0 -1
- package/dist/lib/grid.d.ts +0 -2
- package/dist/lib/grid.d.ts.map +0 -1
- package/dist/lib/safeRedirect.d.ts.map +0 -1
- package/dist/media/videoPoster.d.ts.map +0 -1
- package/src/components/brandguide/ColorSwatchSettings.d.ts.map +0 -1
- package/src/components/brandguide/Colors.d.ts.map +0 -1
- package/src/components/primitives/CustomParagraph.d.ts.map +0 -1
- package/src/components/primitives/EditableGrid.d.ts.map +0 -1
- package/src/components/primitives/EditablePlainText.d.ts.map +0 -1
- package/src/components/primitives/EditableRichText.d.ts.map +0 -1
- package/src/components/primitives/HeadingSection.d.ts.map +0 -1
- package/src/components/primitives/IconPicker.d.ts.map +0 -1
- package/src/components/primitives/LinkPopover.d.ts.map +0 -1
- package/src/components/primitives/MediaSettingsForms.d.ts.map +0 -1
- package/src/components/primitives/ResolvedMedia.d.ts.map +0 -1
- package/src/components/primitives/RichTextToolbar.d.ts.map +0 -1
- package/src/components/primitives/tiptap-presets.d.ts.map +0 -1
- package/src/components/primitives/useEditableCollection.d.ts.map +0 -1
- package/src/components/primitives/useEditablePlainText.d.ts.map +0 -1
- package/src/components/primitives/useEditableRichText.d.ts.map +0 -1
- package/src/components/sections/Button/CTAButton.d.ts.map +0 -1
- package/src/components/sections/Button/index.d.ts.map +0 -1
- package/src/components/sections/Colors/index.d.ts.map +0 -1
- package/src/components/sections/IconList/IconList.d.ts.map +0 -1
- package/src/components/sections/IconList/IconListSettings.d.ts.map +0 -1
- package/src/components/sections/IconList/index.d.ts.map +0 -1
- package/src/components/sections/LinkHeading/index.d.ts.map +0 -1
- package/src/components/sections/Prose/Prose.d.ts.map +0 -1
- package/src/components/sections/Prose/index.d.ts.map +0 -1
- package/src/components/sections/SubHeading/index.d.ts.map +0 -1
- package/src/components/sections/SubSubHeading/index.d.ts.map +0 -1
- package/src/components/sections/register-schemas.d.ts.map +0 -1
- package/src/components/shared/Button.d.ts.map +0 -1
- package/src/components/shared/Checkbox.d.ts.map +0 -1
- package/src/components/shared/FormLabel.d.ts.map +0 -1
- package/src/components/shared/IconButton.d.ts.map +0 -1
- package/src/components/shared/Input.d.ts.map +0 -1
- package/src/components/shared/Select.d.ts.map +0 -1
- package/src/components/shared/icons.d.ts.map +0 -1
- package/src/components/shell/BuildStatusIndicator.tsx +0 -59
- package/src/components/shell/MediaLibraryContext.d.ts.map +0 -1
- package/src/hooks/index.ts +0 -8
- package/src/hooks/useResolvedMedia.d.ts.map +0 -1
- package/src/lib/cn.d.ts.map +0 -1
- package/src/lib/grid.d.ts.map +0 -1
- package/src/lib/grid.ts +0 -7
- package/src/lib/icons.d.ts.map +0 -1
- package/src/lib/loader.d.ts.map +0 -1
- package/src/lib/nav.d.ts.map +0 -1
- package/src/lib/registry.d.ts.map +0 -1
- package/src/lib/sanitize.d.ts.map +0 -1
- package/src/media/github.d.ts.map +0 -1
- package/src/media/index.d.ts.map +0 -1
- package/src/media/queue.d.ts.map +0 -1
- package/src/media/resolve.d.ts.map +0 -1
- package/src/media/types.d.ts.map +0 -1
- package/src/media/utils.d.ts.map +0 -1
- package/src/media/videoPoster.d.ts.map +0 -1
- package/src/schemas/auth.d.ts.map +0 -1
- package/src/schemas/media-grid-options.d.ts.map +0 -1
- package/src/schemas/media.d.ts.map +0 -1
- package/src/schemas/sections.d.ts.map +0 -1
- package/src/schemas/shared.d.ts.map +0 -1
- package/src/schemas/site-config.d.ts.map +0 -1
- /package/dist/{chunk-B7VBSE5X.js → chunk-3JDTXOIG.js} +0 -0
- /package/dist/{chunk-CXZ5YJG4.js → chunk-L45X7DKX.js} +0 -0
- /package/src/components/primitives/{gridDrop.ts → grid-drop.ts} +0 -0
- /package/src/components/shell/{blockMoveDispatch.ts → block-move-dispatch.ts} +0 -0
- /package/src/lib/{safeRedirect.ts → safe-redirect.ts} +0 -0
package/README.md
CHANGED
|
@@ -25,4 +25,4 @@ import type { AuthProvider } from "@drawnagency/primitives/auth";
|
|
|
25
25
|
|
|
26
26
|
## Part of the Drawn Portal Framework
|
|
27
27
|
|
|
28
|
-
Built by [Drawn Agency](https://
|
|
28
|
+
Built by [Drawn Agency](https://drawn.agency). See [@drawnagency/core](https://www.npmjs.com/package/@drawnagency/core) for the full framework.
|
package/dist/auth/cookies.d.ts
CHANGED
|
@@ -27,6 +27,45 @@ export interface AudienceClaims {
|
|
|
27
27
|
*/
|
|
28
28
|
export declare function verifyAudienceClaims(token: string): Promise<AudienceClaims | null>;
|
|
29
29
|
export declare function verifyAudienceToken(token: string): Promise<string | null>;
|
|
30
|
+
export declare const IMPERSONATION_COOKIE = "bp-impersonate";
|
|
31
|
+
export declare const IMPERSONATION_MAX_AGE_SECONDS: number;
|
|
32
|
+
/** The audience someone is viewing the site as (#61). */
|
|
33
|
+
export interface ImpersonationClaims {
|
|
34
|
+
audience: string;
|
|
35
|
+
displayName: string;
|
|
36
|
+
isDefault: boolean;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* The login an impersonation rides on: an editor session, or a sign-in under
|
|
40
|
+
* the site's DEFAULT audience (the client, who can also see Audience Details).
|
|
41
|
+
* No other viewer can impersonate.
|
|
42
|
+
*/
|
|
43
|
+
export type Impersonator = {
|
|
44
|
+
kind: "editor";
|
|
45
|
+
userId: string | null;
|
|
46
|
+
} | {
|
|
47
|
+
kind: "audience";
|
|
48
|
+
audience: string;
|
|
49
|
+
username: string | null;
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Who may impersonate on this request. An editor session wins over an audience
|
|
53
|
+
* cookie when a browser carries both, matching how every route resolves them.
|
|
54
|
+
*/
|
|
55
|
+
export declare function impersonatorFor(session: Session | null, audience: AudienceClaims | null): Impersonator | null;
|
|
56
|
+
export declare function signImpersonationToken(target: ImpersonationClaims, by: Impersonator): Promise<string>;
|
|
57
|
+
/**
|
|
58
|
+
* Claims of an impersonation token, or null unless it is validly signed,
|
|
59
|
+
* unexpired, and minted by this exact login: the same editor (by userId), or
|
|
60
|
+
* the same default-audience sign-in (audience + username). That binding is what
|
|
61
|
+
* stops an impersonation outliving its login on a shared browser. Password-mode
|
|
62
|
+
* editors have no per-user id, so there the binding is "any password-mode
|
|
63
|
+
* editor session".
|
|
64
|
+
*/
|
|
65
|
+
export declare function verifyImpersonationClaims(token: string, impersonator: Impersonator): Promise<ImpersonationClaims | null>;
|
|
66
|
+
export declare function setImpersonationCookie(cookies: CookieLike, token: string, isProduction: boolean): void;
|
|
67
|
+
/** Paired with `setImpersonationCookie` so the path cannot drift — see `clearSessionCookie`. */
|
|
68
|
+
export declare function clearImpersonationCookie(cookies: CookieLike): void;
|
|
30
69
|
export declare function setSessionCookie(cookies: CookieLike, token: string, isProduction: boolean): void;
|
|
31
70
|
/**
|
|
32
71
|
* Clear the editor session cookie. Paired with `setSessionCookie` so the `path`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cookies.d.ts","sourceRoot":"","sources":["../../src/auth/cookies.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAGnD,eAAO,MAAM,cAAc,eAAe,CAAC;AAC3C,eAAO,MAAM,eAAe,gBAAgB,CAAC;AAC7C,eAAO,MAAM,uBAAuB,QAAe,CAAC;AAMpD,eAAO,MAAM,wBAAwB,QAAe,CAAC;AAErD,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAWxE;AAED,wBAAsB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,CAe/E;AAMD,wBAAsB,iBAAiB,CACrC,QAAQ,EAAE,MAAM,EAChB,SAAS,UAAQ,EACjB,QAAQ,GAAE,MAAM,GAAG,IAAW,GAC7B,OAAO,CAAC,MAAM,CAAC,CAMjB;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,4EAA4E;IAC5E,SAAS,EAAE,OAAO,CAAC;IACnB;;;;;OAKG;IACH,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB;AAED;;;;;;GAMG;AACH,wBAAsB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,CAcxF;AAED,wBAAsB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAE/E;AAED,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,UAAU,EACnB,KAAK,EAAE,MAAM,EACb,YAAY,EAAE,OAAO,GACpB,IAAI,CAQN;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,UAAU,GAAG,IAAI,CAE5D"}
|
|
1
|
+
{"version":3,"file":"cookies.d.ts","sourceRoot":"","sources":["../../src/auth/cookies.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAGnD,eAAO,MAAM,cAAc,eAAe,CAAC;AAC3C,eAAO,MAAM,eAAe,gBAAgB,CAAC;AAC7C,eAAO,MAAM,uBAAuB,QAAe,CAAC;AAMpD,eAAO,MAAM,wBAAwB,QAAe,CAAC;AAErD,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAWxE;AAED,wBAAsB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,CAe/E;AAMD,wBAAsB,iBAAiB,CACrC,QAAQ,EAAE,MAAM,EAChB,SAAS,UAAQ,EACjB,QAAQ,GAAE,MAAM,GAAG,IAAW,GAC7B,OAAO,CAAC,MAAM,CAAC,CAMjB;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,4EAA4E;IAC5E,SAAS,EAAE,OAAO,CAAC;IACnB;;;;;OAKG;IACH,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB;AAED;;;;;;GAMG;AACH,wBAAsB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,CAcxF;AAED,wBAAsB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAE/E;AAED,eAAO,MAAM,oBAAoB,mBAAmB,CAAC;AACrD,eAAO,MAAM,6BAA6B,QAAU,CAAC;AAErD,yDAAyD;AACzD,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;CACpB;AAED;;;;GAIG;AACH,MAAM,MAAM,YAAY,GACpB;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,GACzC;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAAC;AAEpE;;;GAGG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,EAAE,QAAQ,EAAE,cAAc,GAAG,IAAI,GAAG,YAAY,GAAG,IAAI,CAI7G;AAyBD,wBAAsB,sBAAsB,CAAC,MAAM,EAAE,mBAAmB,EAAE,EAAE,EAAE,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC,CAY3G;AAED;;;;;;;GAOG;AACH,wBAAsB,yBAAyB,CAC7C,KAAK,EAAE,MAAM,EACb,YAAY,EAAE,YAAY,GACzB,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC,CAiBrC;AAED,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,GAAG,IAAI,CAQtG;AAED,gGAAgG;AAChG,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,UAAU,GAAG,IAAI,CAElE;AAED,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,UAAU,EACnB,KAAK,EAAE,MAAM,EACb,YAAY,EAAE,OAAO,GACpB,IAAI,CAQN;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,UAAU,GAAG,IAAI,CAE5D"}
|
package/dist/auth/index.js
CHANGED
|
@@ -13,13 +13,13 @@ import {
|
|
|
13
13
|
verifyAudienceClaims,
|
|
14
14
|
verifyAudienceToken,
|
|
15
15
|
verifySessionToken
|
|
16
|
-
} from "../chunk-
|
|
16
|
+
} from "../chunk-KQA772WQ.js";
|
|
17
17
|
import {
|
|
18
18
|
isSameOriginRequest,
|
|
19
19
|
requireSessionSecret,
|
|
20
20
|
safeNextPath
|
|
21
|
-
} from "../chunk-
|
|
22
|
-
import "../chunk-
|
|
21
|
+
} from "../chunk-7SX42OP4.js";
|
|
22
|
+
import "../chunk-BQ5TZZUE.js";
|
|
23
23
|
import "../chunk-JSBRDJBE.js";
|
|
24
24
|
export {
|
|
25
25
|
AUDIENCE_COOKIE,
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import {
|
|
2
|
+
diagnosticsCollector
|
|
3
|
+
} from "./chunk-GNF6KFQ7.js";
|
|
4
|
+
|
|
5
|
+
// src/lib/tags.ts
|
|
6
|
+
function reconcileTags(entries, sections) {
|
|
7
|
+
return reconcileTagsReport(entries, sections).entries;
|
|
8
|
+
}
|
|
9
|
+
function reconcileTagsReport(entries, sections) {
|
|
10
|
+
const report = diagnosticsCollector();
|
|
11
|
+
const entryList = Array.isArray(entries) ? entries : [];
|
|
12
|
+
const validIds = new Set(sections && typeof sections === "object" ? Object.keys(sections) : []);
|
|
13
|
+
const seenTagIds = /* @__PURE__ */ new Set();
|
|
14
|
+
const result = [];
|
|
15
|
+
for (const entry of entryList) {
|
|
16
|
+
if (!entry || typeof entry !== "object") continue;
|
|
17
|
+
if (typeof entry.id !== "string" || entry.id === "") continue;
|
|
18
|
+
if (seenTagIds.has(entry.id)) {
|
|
19
|
+
report.add("duplicate-id", entry.id);
|
|
20
|
+
continue;
|
|
21
|
+
}
|
|
22
|
+
seenTagIds.add(entry.id);
|
|
23
|
+
const claimed = Array.isArray(entry.sectionIds) ? entry.sectionIds : [];
|
|
24
|
+
const sectionIds = [];
|
|
25
|
+
for (const id of claimed) {
|
|
26
|
+
if (typeof id !== "string") continue;
|
|
27
|
+
if (!validIds.has(id)) report.add("dangling", id);
|
|
28
|
+
else if (sectionIds.includes(id)) report.add("duplicate-member", id);
|
|
29
|
+
else sectionIds.push(id);
|
|
30
|
+
}
|
|
31
|
+
result.push({ id: entry.id, label: typeof entry.label === "string" ? entry.label : "", sectionIds });
|
|
32
|
+
}
|
|
33
|
+
return { entries: result, diagnostics: report.list() };
|
|
34
|
+
}
|
|
35
|
+
function siteTags(index) {
|
|
36
|
+
return reconcileTags(index.tags ?? [], index.sections);
|
|
37
|
+
}
|
|
38
|
+
function tagDisplayLabel(label) {
|
|
39
|
+
return label || "Untitled tag";
|
|
40
|
+
}
|
|
41
|
+
function mergeTags(args) {
|
|
42
|
+
const { base, local, remote } = args;
|
|
43
|
+
if (remote === void 0) return local?.map((t) => ({ ...t, sectionIds: [...t.sectionIds] }));
|
|
44
|
+
if (base === void 0 || local === void 0) return remote.map((t) => ({ ...t, sectionIds: [...t.sectionIds] }));
|
|
45
|
+
const firstById = (tags) => {
|
|
46
|
+
const byId = /* @__PURE__ */ new Map();
|
|
47
|
+
for (const t of tags) if (!byId.has(t.id)) byId.set(t.id, t);
|
|
48
|
+
return byId;
|
|
49
|
+
};
|
|
50
|
+
const baseById = firstById(base);
|
|
51
|
+
const localById = firstById(local);
|
|
52
|
+
const remoteIds = new Set(remote.map((t) => t.id));
|
|
53
|
+
const result = [];
|
|
54
|
+
for (const r of remote) {
|
|
55
|
+
const b = baseById.get(r.id);
|
|
56
|
+
const l = localById.get(r.id);
|
|
57
|
+
if (b && !l) continue;
|
|
58
|
+
const members = [...r.sectionIds];
|
|
59
|
+
let label = r.label;
|
|
60
|
+
if (b && l) {
|
|
61
|
+
if (l.label !== b.label) label = l.label;
|
|
62
|
+
for (const id of l.sectionIds) if (!b.sectionIds.includes(id) && !members.includes(id)) members.push(id);
|
|
63
|
+
for (const id of b.sectionIds) {
|
|
64
|
+
if (l.sectionIds.includes(id)) continue;
|
|
65
|
+
const at = members.indexOf(id);
|
|
66
|
+
if (at !== -1) members.splice(at, 1);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
result.push({ id: r.id, label, sectionIds: members });
|
|
70
|
+
}
|
|
71
|
+
for (const l of local) {
|
|
72
|
+
if (!remoteIds.has(l.id) && !baseById.has(l.id)) result.push({ ...l, sectionIds: [...l.sectionIds] });
|
|
73
|
+
}
|
|
74
|
+
return result;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export {
|
|
78
|
+
reconcileTags,
|
|
79
|
+
reconcileTagsReport,
|
|
80
|
+
siteTags,
|
|
81
|
+
tagDisplayLabel,
|
|
82
|
+
mergeTags
|
|
83
|
+
};
|
|
@@ -21,7 +21,25 @@ var NavFileSchema = z.object({
|
|
|
21
21
|
entries: z.array(NavEntrySchema)
|
|
22
22
|
});
|
|
23
23
|
|
|
24
|
+
// src/schemas/tags.ts
|
|
25
|
+
import { z as z2 } from "zod";
|
|
26
|
+
var TagEntrySchema = z2.object({
|
|
27
|
+
id: z2.string().min(1),
|
|
28
|
+
/** May be blank — agent-authored files can omit it; UI falls back to "Untitled tag". */
|
|
29
|
+
label: z2.string().catch(""),
|
|
30
|
+
// Everything but `id` repairs rather than rejects. A rejected entry marks the
|
|
31
|
+
// read degraded, and a degraded tags.json refuses EVERY tags write until
|
|
32
|
+
// someone fixes the file by hand — far too heavy a price for one blank id in
|
|
33
|
+
// one tag's list, which reconcileTags would drop anyway.
|
|
34
|
+
sectionIds: z2.array(z2.unknown()).catch([]).transform((ids) => ids.filter((id) => typeof id === "string" && id !== ""))
|
|
35
|
+
});
|
|
36
|
+
var TagsFileSchema = z2.object({
|
|
37
|
+
tags: z2.array(TagEntrySchema)
|
|
38
|
+
});
|
|
39
|
+
|
|
24
40
|
export {
|
|
25
41
|
NavEntrySchema,
|
|
26
|
-
NavFileSchema
|
|
42
|
+
NavFileSchema,
|
|
43
|
+
TagEntrySchema,
|
|
44
|
+
TagsFileSchema
|
|
27
45
|
};
|
|
@@ -1,100 +1,50 @@
|
|
|
1
1
|
import {
|
|
2
2
|
documentOptionsSchema
|
|
3
3
|
} from "./chunk-4TZJZU2T.js";
|
|
4
|
+
import {
|
|
5
|
+
MediaConfigSchema
|
|
6
|
+
} from "./chunk-APIJPTFG.js";
|
|
4
7
|
import {
|
|
5
8
|
FontNameSchema,
|
|
6
9
|
HexColorSchema
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
|
|
9
|
-
// src/schemas/media.ts
|
|
10
|
-
import { z } from "zod";
|
|
11
|
-
var VariantSchema = z.object({
|
|
12
|
-
width: z.number().int().positive(),
|
|
13
|
-
height: z.number().int().positive(),
|
|
14
|
-
size: z.number().int().nonnegative()
|
|
15
|
-
});
|
|
16
|
-
var MediaFolderSchema = z.object({
|
|
17
|
-
name: z.string().min(1),
|
|
18
|
-
parentId: z.string().nullable()
|
|
19
|
-
// null = root
|
|
20
|
-
});
|
|
21
|
-
var MediaItemSchema = z.object({
|
|
22
|
-
id: z.string(),
|
|
23
|
-
hash: z.string(),
|
|
24
|
-
kind: z.enum(["image", "animated", "video"]),
|
|
25
|
-
originalName: z.string(),
|
|
26
|
-
width: z.number().int().positive(),
|
|
27
|
-
height: z.number().int().positive(),
|
|
28
|
-
mimeType: z.string(),
|
|
29
|
-
size: z.number().int().nonnegative(),
|
|
30
|
-
folder: z.string(),
|
|
31
|
-
variants: z.array(VariantSchema),
|
|
32
|
-
alt: z.string().default(""),
|
|
33
|
-
// Where the original bytes live. "github" = committed to the repo (images,
|
|
34
|
-
// small loops); "assets" = large original in the AssetStore bucket. Legacy
|
|
35
|
-
// manifests have no field — default keeps them on the git path.
|
|
36
|
-
storage: z.enum(["github", "assets"]).default("github"),
|
|
37
|
-
// Public CDN URL for assets-backed originals, baked at upload time so
|
|
38
|
-
// resolution needs no env access in the browser or at SSR.
|
|
39
|
-
url: z.string().optional(),
|
|
40
|
-
// Seconds; videos only. Informational (library UI).
|
|
41
|
-
duration: z.number().positive().optional(),
|
|
42
|
-
// Display folder (MediaFolderSchema key). Absent = root/unfiled. NOT the
|
|
43
|
-
// git storage dir — that's `folder` above, which never changes.
|
|
44
|
-
folderId: z.string().optional(),
|
|
45
|
-
// System-generated assets (e.g. the Phase 3 social-preview raster) set this
|
|
46
|
-
// so the media-library UI can exclude them. Absent on all user uploads.
|
|
47
|
-
hidden: z.boolean().optional()
|
|
48
|
-
});
|
|
49
|
-
var ImageManifestSchema = z.object({
|
|
50
|
-
images: z.record(z.string(), MediaItemSchema),
|
|
51
|
-
folders: z.record(z.string(), MediaFolderSchema).default({})
|
|
52
|
-
});
|
|
53
|
-
var MediaConfigSchema = z.object({
|
|
54
|
-
sizes: z.array(z.number()).default([640, 1080, 1920]),
|
|
55
|
-
maxFileSize: z.number().default(5242880),
|
|
56
|
-
quality: z.number().min(1).max(100).default(85),
|
|
57
|
-
// Per-file cap for bucket-backed video uploads (bytes). The git-path cap is
|
|
58
|
-
// maxFileSize; anything between the two routes to the AssetStore.
|
|
59
|
-
maxAssetSize: z.number().default(209715200)
|
|
60
|
-
});
|
|
10
|
+
} from "./chunk-AASEGXNT.js";
|
|
61
11
|
|
|
62
12
|
// src/schemas/site-config.ts
|
|
63
|
-
import { z
|
|
13
|
+
import { z } from "zod";
|
|
64
14
|
|
|
65
15
|
// src/lib/corner-radius.ts
|
|
66
16
|
var CORNER_RADIUS_OPTIONS = ["none", "small", "medium", "large"];
|
|
67
17
|
|
|
68
18
|
// src/schemas/site-config.ts
|
|
69
|
-
var StatusSchema =
|
|
19
|
+
var StatusSchema = z.enum(["draft", "live", "archived", "published"]).transform(
|
|
70
20
|
(val) => val === "published" ? "live" : val
|
|
71
21
|
);
|
|
72
|
-
var SectionMetaSchema =
|
|
73
|
-
type:
|
|
22
|
+
var SectionMetaSchema = z.object({
|
|
23
|
+
type: z.string(),
|
|
74
24
|
status: StatusSchema,
|
|
75
|
-
access:
|
|
25
|
+
access: z.array(z.string())
|
|
76
26
|
});
|
|
77
27
|
var RESERVED_SLUGS = ["edit", "api", "login", "set-password", "404", "present", "print", "audiences", "decks"];
|
|
78
28
|
var PARSE_REJECTED_SLUGS = ["edit", "api", "login", "set-password", "404"];
|
|
79
|
-
var PageStatusSchema =
|
|
80
|
-
var PageSchema =
|
|
81
|
-
id:
|
|
82
|
-
title:
|
|
83
|
-
slug:
|
|
84
|
-
isHome:
|
|
85
|
-
showInNav:
|
|
29
|
+
var PageStatusSchema = z.enum(["live", "archived"]);
|
|
30
|
+
var PageSchema = z.object({
|
|
31
|
+
id: z.string().min(1),
|
|
32
|
+
title: z.string(),
|
|
33
|
+
slug: z.string(),
|
|
34
|
+
isHome: z.boolean(),
|
|
35
|
+
showInNav: z.boolean(),
|
|
86
36
|
status: PageStatusSchema,
|
|
87
|
-
access:
|
|
88
|
-
order:
|
|
37
|
+
access: z.array(z.string()),
|
|
38
|
+
order: z.array(z.string()),
|
|
89
39
|
document: documentOptionsSchema.optional()
|
|
90
40
|
});
|
|
91
41
|
var SLUG_RE = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
|
|
92
|
-
var RawIndexSchema =
|
|
93
|
-
siteId:
|
|
94
|
-
order:
|
|
95
|
-
pages:
|
|
96
|
-
sections:
|
|
97
|
-
lastModified:
|
|
42
|
+
var RawIndexSchema = z.object({
|
|
43
|
+
siteId: z.string(),
|
|
44
|
+
order: z.array(z.string()).optional(),
|
|
45
|
+
pages: z.array(PageSchema).optional(),
|
|
46
|
+
sections: z.record(z.string(), SectionMetaSchema),
|
|
47
|
+
lastModified: z.string().nullable().optional()
|
|
98
48
|
});
|
|
99
49
|
function normalizeRawIndex(data) {
|
|
100
50
|
if (data.pages && data.pages.length > 0) {
|
|
@@ -124,34 +74,34 @@ function normalizeRawIndex(data) {
|
|
|
124
74
|
lastModified: data.lastModified ?? null
|
|
125
75
|
};
|
|
126
76
|
}
|
|
127
|
-
var CanonicalIndexSchema =
|
|
128
|
-
siteId:
|
|
129
|
-
pages:
|
|
130
|
-
sections:
|
|
131
|
-
lastModified:
|
|
77
|
+
var CanonicalIndexSchema = z.object({
|
|
78
|
+
siteId: z.string(),
|
|
79
|
+
pages: z.array(PageSchema),
|
|
80
|
+
sections: z.record(z.string(), SectionMetaSchema),
|
|
81
|
+
lastModified: z.string().nullable().optional()
|
|
132
82
|
}).superRefine((data, ctx) => {
|
|
133
83
|
const homes = data.pages.filter((p) => p.isHome);
|
|
134
84
|
if (homes.length !== 1) {
|
|
135
|
-
ctx.addIssue({ code:
|
|
85
|
+
ctx.addIssue({ code: z.ZodIssueCode.custom, message: "Exactly one page must be the home page" });
|
|
136
86
|
}
|
|
137
87
|
if (homes[0]?.status === "archived") {
|
|
138
|
-
ctx.addIssue({ code:
|
|
88
|
+
ctx.addIssue({ code: z.ZodIssueCode.custom, message: "The home page cannot be archived" });
|
|
139
89
|
}
|
|
140
90
|
if (homes[0] && homes[0].slug !== "") {
|
|
141
|
-
ctx.addIssue({ code:
|
|
91
|
+
ctx.addIssue({ code: z.ZodIssueCode.custom, message: "The home page slug must be empty" });
|
|
142
92
|
}
|
|
143
93
|
const seenSlugs = /* @__PURE__ */ new Set();
|
|
144
94
|
for (const p of data.pages) {
|
|
145
95
|
if (!p.isHome) {
|
|
146
96
|
if (!SLUG_RE.test(p.slug)) {
|
|
147
|
-
ctx.addIssue({ code:
|
|
97
|
+
ctx.addIssue({ code: z.ZodIssueCode.custom, message: `Invalid slug "${p.slug}"` });
|
|
148
98
|
}
|
|
149
99
|
if (PARSE_REJECTED_SLUGS.includes(p.slug)) {
|
|
150
|
-
ctx.addIssue({ code:
|
|
100
|
+
ctx.addIssue({ code: z.ZodIssueCode.custom, message: `Slug "${p.slug}" is reserved` });
|
|
151
101
|
}
|
|
152
102
|
}
|
|
153
103
|
if (seenSlugs.has(p.slug)) {
|
|
154
|
-
ctx.addIssue({ code:
|
|
104
|
+
ctx.addIssue({ code: z.ZodIssueCode.custom, message: `Duplicate slug "${p.slug}"` });
|
|
155
105
|
}
|
|
156
106
|
seenSlugs.add(p.slug);
|
|
157
107
|
}
|
|
@@ -166,21 +116,21 @@ var CanonicalIndexSchema = z2.object({
|
|
|
166
116
|
const duplicated = [...counts].filter(([, n]) => n > 1).map(([id]) => id);
|
|
167
117
|
if (duplicated.length > 0) {
|
|
168
118
|
ctx.addIssue({
|
|
169
|
-
code:
|
|
119
|
+
code: z.ZodIssueCode.custom,
|
|
170
120
|
message: `Section id(s) appear in more than one page order: ${fmtIds(duplicated)}`
|
|
171
121
|
});
|
|
172
122
|
}
|
|
173
123
|
const orderedNotInSections = [...fromPagesSet].filter((id) => !sectionSet.has(id));
|
|
174
124
|
if (orderedNotInSections.length > 0) {
|
|
175
125
|
ctx.addIssue({
|
|
176
|
-
code:
|
|
126
|
+
code: z.ZodIssueCode.custom,
|
|
177
127
|
message: `Section id(s) in a page order but missing from sections{}: ${fmtIds(orderedNotInSections)}`
|
|
178
128
|
});
|
|
179
129
|
}
|
|
180
130
|
const sectionsNotOrdered = sectionKeys.filter((id) => !fromPagesSet.has(id));
|
|
181
131
|
if (sectionsNotOrdered.length > 0) {
|
|
182
132
|
ctx.addIssue({
|
|
183
|
-
code:
|
|
133
|
+
code: z.ZodIssueCode.custom,
|
|
184
134
|
message: `Section id(s) in sections{} but not in any page order: ${fmtIds(sectionsNotOrdered)}`
|
|
185
135
|
});
|
|
186
136
|
}
|
|
@@ -189,60 +139,60 @@ var IndexSchema = RawIndexSchema.transform(normalizeRawIndex).pipe(CanonicalInde
|
|
|
189
139
|
function normalizeSiteIndex(raw) {
|
|
190
140
|
return IndexSchema.parse(raw);
|
|
191
141
|
}
|
|
192
|
-
var ChatbotTaskIdSchema =
|
|
142
|
+
var ChatbotTaskIdSchema = z.string().min(1).max(32).regex(
|
|
193
143
|
/^[a-z0-9](?:[a-z0-9_-]*[a-z0-9])?$/,
|
|
194
144
|
"Task id must be lowercase letters, numbers, dashes, or underscores"
|
|
195
145
|
);
|
|
196
|
-
var ChatbotTaskSchema =
|
|
146
|
+
var ChatbotTaskSchema = z.object({
|
|
197
147
|
id: ChatbotTaskIdSchema,
|
|
198
|
-
label:
|
|
199
|
-
prompt:
|
|
148
|
+
label: z.string().min(1).max(60),
|
|
149
|
+
prompt: z.string().max(4e3),
|
|
200
150
|
// Audience names allowed to see this task; [] = all — same semantics as SectionMeta.access.
|
|
201
|
-
access:
|
|
151
|
+
access: z.array(z.string()).default([])
|
|
202
152
|
});
|
|
203
|
-
var ChatbotConfigSchema =
|
|
204
|
-
enabled:
|
|
153
|
+
var ChatbotConfigSchema = z.object({
|
|
154
|
+
enabled: z.boolean().default(false),
|
|
205
155
|
// Assistant display name shown in the widget header and used in the system
|
|
206
156
|
// prompt. Blank falls back to "Portal Assistant" (resolveChatbotName).
|
|
207
|
-
name:
|
|
157
|
+
name: z.string().max(60).default("Portal Assistant"),
|
|
208
158
|
// Per-audience name overrides, keyed by audience name — same inert-when-
|
|
209
159
|
// deselected semantics as audiencePrompts.
|
|
210
|
-
audienceNames:
|
|
160
|
+
audienceNames: z.record(z.string(), z.string().max(60)).default({}),
|
|
211
161
|
// Brand-flavored waiting phrases, shown (with "…" appended) while the
|
|
212
162
|
// assistant streams no text yet. Empty = the widget's "Thinking…" default.
|
|
213
|
-
thinkingPhrases:
|
|
214
|
-
systemPrompt:
|
|
163
|
+
thinkingPhrases: z.array(z.string().max(80)).max(30).default([]),
|
|
164
|
+
systemPrompt: z.string().max(8e3).default(""),
|
|
215
165
|
// Audience names the widget is shown to — strict opt-in: [] = no viewer
|
|
216
166
|
// sees it (editors always can via /edit). Gates: [...slug].astro + /api/chat.
|
|
217
|
-
audiences:
|
|
167
|
+
audiences: z.array(z.string()).default([]),
|
|
218
168
|
// Per-audience prompt overlays, keyed by audience name. Appended AFTER the
|
|
219
169
|
// base systemPrompt, and ONLY for requests whose session audience matches
|
|
220
170
|
// (or an editor's explicit test-panel simulation) — enforced in
|
|
221
171
|
// assembleBrandChat. Keys are not validated against the audience list:
|
|
222
172
|
// entries for deselected/renamed audiences are inert (strict opt-in means
|
|
223
173
|
// those audiences cannot chat at all).
|
|
224
|
-
audiencePrompts:
|
|
225
|
-
tasks:
|
|
174
|
+
audiencePrompts: z.record(z.string(), z.string().max(8e3)).default({}),
|
|
175
|
+
tasks: z.array(ChatbotTaskSchema).max(20).default([])
|
|
226
176
|
}).superRefine((cfg, ctx) => {
|
|
227
177
|
const seen = /* @__PURE__ */ new Set();
|
|
228
178
|
for (const t of cfg.tasks) {
|
|
229
179
|
if (seen.has(t.id)) {
|
|
230
|
-
ctx.addIssue({ code:
|
|
180
|
+
ctx.addIssue({ code: z.ZodIssueCode.custom, message: `Duplicate task id "${t.id}"` });
|
|
231
181
|
}
|
|
232
182
|
seen.add(t.id);
|
|
233
183
|
}
|
|
234
184
|
});
|
|
235
|
-
var DeckBuilderConfigSchema =
|
|
185
|
+
var DeckBuilderConfigSchema = z.object({
|
|
236
186
|
// Audience names whose members may CREATE decks — a Deck Creator. Strict
|
|
237
187
|
// opt-in exactly like chatbot.audiences: [] = no viewer may build a deck.
|
|
238
188
|
// Editors are super-admins over decks and are never gated by this list.
|
|
239
189
|
// Gates: [...slug].astro's FAB, /decks, and POST /api/decks (canCreateDeck).
|
|
240
|
-
audiences:
|
|
190
|
+
audiences: z.array(z.string()).default([]).describe(
|
|
241
191
|
"Audience names allowed to create decks in the Deck Builder. Strict opt-in \u2014 an empty list means no viewer can. Editors always can."
|
|
242
192
|
)
|
|
243
193
|
});
|
|
244
|
-
var SiteConfigSchema =
|
|
245
|
-
siteName:
|
|
194
|
+
var SiteConfigSchema = z.object({
|
|
195
|
+
siteName: z.string().default("Brand Portal"),
|
|
246
196
|
primaryColor: HexColorSchema.default("#009ca6"),
|
|
247
197
|
primaryContrast: HexColorSchema.default("#f0f0f0"),
|
|
248
198
|
// Dark-mode overrides for the brand primary / accent. Only applied when
|
|
@@ -251,31 +201,31 @@ var SiteConfigSchema = z2.object({
|
|
|
251
201
|
// CSS light-dark() function (see lib/theme-vars.ts).
|
|
252
202
|
primaryColorDark: HexColorSchema.nullable().default(null),
|
|
253
203
|
primaryContrastDark: HexColorSchema.nullable().default(null),
|
|
254
|
-
darkMode:
|
|
204
|
+
darkMode: z.enum(["light", "dark", "optional"]).default("light"),
|
|
255
205
|
// Maps to the --radius-outer design token (see lib/corner-radius.ts);
|
|
256
206
|
// defaults so pre-existing site-config.json files keep parsing.
|
|
257
|
-
cornerRadius:
|
|
207
|
+
cornerRadius: z.enum(CORNER_RADIUS_OPTIONS).default("medium"),
|
|
258
208
|
headingFont: FontNameSchema.default("system-ui"),
|
|
259
209
|
bodyFont: FontNameSchema.default("system-ui"),
|
|
260
|
-
uppercaseHeadings:
|
|
261
|
-
uppercaseSubheadings:
|
|
262
|
-
uppercaseNavHeadings:
|
|
263
|
-
googleFontsUrl:
|
|
210
|
+
uppercaseHeadings: z.boolean().default(true),
|
|
211
|
+
uppercaseSubheadings: z.boolean().default(true),
|
|
212
|
+
uppercaseNavHeadings: z.boolean().default(true),
|
|
213
|
+
googleFontsUrl: z.string().refine((url) => url.startsWith("https://fonts.googleapis.com/"), "Must be a Google Fonts URL").nullable().default(null),
|
|
264
214
|
// Favicon stored as a data URL (SVG/PNG, small) so it travels with
|
|
265
215
|
// site-config.json — no media manifest or CDN round-trip needed.
|
|
266
|
-
favicon:
|
|
216
|
+
favicon: z.string().refine((v) => v.startsWith("data:image/"), "Favicon must be an image data URL").nullable().default(null),
|
|
267
217
|
// Optional site logo, stored as media-library references (so it participates
|
|
268
218
|
// in usage tracking + GC protection, and its resolved URL is reusable for the
|
|
269
219
|
// Phase 3 social-preview image). Every field defaults so pre-existing
|
|
270
220
|
// site-config.json files keep parsing.
|
|
271
|
-
logo:
|
|
272
|
-
light:
|
|
273
|
-
dark:
|
|
274
|
-
invertInDark:
|
|
275
|
-
showInNav:
|
|
221
|
+
logo: z.object({
|
|
222
|
+
light: z.object({ imageId: z.string() }),
|
|
223
|
+
dark: z.object({ imageId: z.string() }).nullable().default(null),
|
|
224
|
+
invertInDark: z.boolean().default(false),
|
|
225
|
+
showInNav: z.boolean().default(true),
|
|
276
226
|
// A nav logo stands in for the site name by default; the toggle is for
|
|
277
227
|
// wordmark-less logos that still need the name spelled out.
|
|
278
|
-
hideTitle:
|
|
228
|
+
hideTitle: z.boolean().default(true)
|
|
279
229
|
}).nullable().default(null),
|
|
280
230
|
media: MediaConfigSchema.default(MediaConfigSchema.parse({})),
|
|
281
231
|
// Composed social-preview raster, stored as a media-library reference so it
|
|
@@ -284,17 +234,17 @@ var SiteConfigSchema = z2.object({
|
|
|
284
234
|
// (the /api/media route only serves exact generated-variant widths), so the
|
|
285
235
|
// og:image URL + dimensions are correct. Defaults null so pre-existing
|
|
286
236
|
// configs keep parsing and sites without a preview emit no og:image tags.
|
|
287
|
-
previewImage:
|
|
288
|
-
imageId:
|
|
289
|
-
width:
|
|
290
|
-
height:
|
|
237
|
+
previewImage: z.object({
|
|
238
|
+
imageId: z.string(),
|
|
239
|
+
width: z.number().int().positive(),
|
|
240
|
+
height: z.number().int().positive(),
|
|
291
241
|
// Compose-logic version that produced this raster. Pre-existing rasters
|
|
292
242
|
// (and manifests written before this field) default to 0, which is below
|
|
293
243
|
// any current PREVIEW_COMPOSE_VERSION, so the editor regenerates them.
|
|
294
|
-
version:
|
|
244
|
+
version: z.number().int().nonnegative().default(0)
|
|
295
245
|
}).nullable().default(null),
|
|
296
246
|
// Optional site description → og:description + <meta name="description">.
|
|
297
|
-
description:
|
|
247
|
+
description: z.string().max(300).nullable().default(null),
|
|
298
248
|
// Brand chatbot config (editor-owned; the platform kill switch lives in the
|
|
299
249
|
// sites table, not here). Every field defaults so pre-existing
|
|
300
250
|
// site-config.json files keep parsing.
|
|
@@ -305,11 +255,6 @@ var SiteConfigSchema = z2.object({
|
|
|
305
255
|
});
|
|
306
256
|
|
|
307
257
|
export {
|
|
308
|
-
VariantSchema,
|
|
309
|
-
MediaFolderSchema,
|
|
310
|
-
MediaItemSchema,
|
|
311
|
-
ImageManifestSchema,
|
|
312
|
-
MediaConfigSchema,
|
|
313
258
|
StatusSchema,
|
|
314
259
|
SectionMetaSchema,
|
|
315
260
|
RESERVED_SLUGS,
|
|
@@ -26,7 +26,7 @@ var TextLineSchema = z.discriminatedUnion("type", [
|
|
|
26
26
|
var BaseMediaRef = z.object({
|
|
27
27
|
imageId: z.string().default("").describe("Media-library id of the image/video asset."),
|
|
28
28
|
caption: z.union([z.string(), z.array(z.string())]).optional().describe("Optional caption: a single string, or multiple lines as an array of strings."),
|
|
29
|
-
background: z.string().optional().describe("
|
|
29
|
+
background: z.string().optional().describe("Legacy; not rendered. For a backdrop behind a media section's image, use the section's options.background."),
|
|
30
30
|
invertFrom: z.string().optional().describe("Optional CSS color; the image inverts when the page background matches it (e.g. for dark-mode logo swaps)."),
|
|
31
31
|
border: z.boolean().optional().describe("When true, draw a border around the media."),
|
|
32
32
|
objectFit: z.enum(["cover", "contain"]).optional().describe("How the image fills its box: 'contain' (fit whole image) or 'cover' (fill and crop).")
|
|
@@ -59,6 +59,22 @@ var MediaReferenceSchema = z.discriminatedUnion("type", [
|
|
|
59
59
|
]);
|
|
60
60
|
var SingleMediaReferenceSchema = z.discriminatedUnion("type", [ImageRef, VideoRef]);
|
|
61
61
|
var HexColorSchema = z.string().regex(/^#[0-9a-fA-F]{6}$/, "must be a 6-digit hex color");
|
|
62
|
+
var ImageBackgroundSurfaceSchema = z.enum(["none", "light", "dark"]);
|
|
63
|
+
var ImageBackgroundSchema = z.discriminatedUnion("mode", [
|
|
64
|
+
z.object({
|
|
65
|
+
mode: z.literal("theme").describe("Pick a site surface separately for light and dark mode."),
|
|
66
|
+
light: ImageBackgroundSurfaceSchema.describe(
|
|
67
|
+
"Backdrop in light mode: 'none', the site's light surface, or its dark surface."
|
|
68
|
+
),
|
|
69
|
+
dark: ImageBackgroundSurfaceSchema.describe(
|
|
70
|
+
"Backdrop in dark mode: 'none', the site's light surface, or its dark surface."
|
|
71
|
+
)
|
|
72
|
+
}),
|
|
73
|
+
z.object({
|
|
74
|
+
mode: z.literal("custom").describe("Use one custom color in both modes."),
|
|
75
|
+
color: HexColorSchema.describe("One backdrop color for both light and dark mode, as a 6-digit hex.")
|
|
76
|
+
})
|
|
77
|
+
]);
|
|
62
78
|
var FontNameSchema = z.string().max(120).regex(/^[a-zA-Z0-9 ,'"-]+$/, "contains invalid font-name characters");
|
|
63
79
|
|
|
64
80
|
export {
|
|
@@ -66,5 +82,6 @@ export {
|
|
|
66
82
|
MediaReferenceSchema,
|
|
67
83
|
SingleMediaReferenceSchema,
|
|
68
84
|
HexColorSchema,
|
|
85
|
+
ImageBackgroundSchema,
|
|
69
86
|
FontNameSchema
|
|
70
87
|
};
|