@drawnagency/primitives 0.1.113 → 0.1.114
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-GPPVYLEI.js → chunk-45FA7Z55.js} +1 -1
- package/dist/{chunk-REDDTTGJ.js → chunk-4Y2JQQZL.js} +19 -1
- package/dist/chunk-5GFACGSN.js +6 -0
- package/dist/chunk-5KSAS4VY.js +275 -0
- package/dist/{chunk-Z7W3DQTR.js → chunk-7SAAJVDE.js} +408 -28
- package/dist/{chunk-S2L3BPLS.js → chunk-7SX42OP4.js} +1 -1
- package/dist/{chunk-GGXZZ77Z.js → chunk-AASEGXNT.js} +18 -1
- package/dist/{chunk-WKZ7OENC.js → chunk-BQ5TZZUE.js} +5 -1
- package/dist/chunk-DIMDRBFK.js +11 -0
- package/dist/{chunk-WUJ3XNFI.js → chunk-GGYY3JQJ.js} +19 -24
- package/dist/{chunk-NHN2LSIU.js → chunk-IP2SEBAJ.js} +5 -1
- package/dist/{chunk-IINIZBQB.js → chunk-JCDZAFX2.js} +30 -10
- package/dist/chunk-JR24U7FJ.js +120 -0
- package/dist/{chunk-SW6PCQQD.js → chunk-KQA772WQ.js} +2 -1
- package/dist/{chunk-KR2MHTNJ.js → chunk-N3G7DOU3.js} +609 -61
- package/dist/chunk-OAGJBCSH.js +67 -0
- package/dist/{chunk-6BZ2KNTP.js → chunk-PLANHXS7.js} +191 -61
- package/dist/{chunk-VWWY5TL5.js → chunk-PNSCDBU7.js} +38 -56
- package/dist/{chunk-AHALSCQH.js → chunk-PTY2RG2K.js} +1 -1
- package/dist/{chunk-BDFTMGCL.js → chunk-PZPGJZRG.js} +9 -8
- package/dist/{chunk-FRE2CCLV.js → chunk-QHMKIODQ.js} +17 -4
- package/dist/{chunk-HBULBDGP.js → chunk-S37DZPHW.js} +1 -1
- package/dist/{chunk-4I5OO5UB.js → chunk-TEOAKGZA.js} +0 -1
- package/dist/chunk-VUYCRBJK.js +174 -0
- package/dist/{chunk-4RNF2DRG.js → chunk-XDEPXTBY.js} +0 -2
- package/dist/{chunk-DS4GCYV2.js → chunk-Y5QECJX7.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 +20 -5
- 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 +148 -77
- 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 +17 -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 +12 -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 +19 -17
- package/dist/components/sections/register.js +19 -17
- 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 +11 -18
- 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 +2 -2
- package/dist/hooks/useEditorPublish.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 +67 -49
- 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.map +1 -1
- package/dist/lib/dexie.js +9 -1
- 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/index-ops.js +3 -3
- package/dist/lib/index.d.ts +6 -4
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +29 -21
- package/dist/lib/loader.d.ts +21 -7
- package/dist/lib/loader.d.ts.map +1 -1
- package/dist/lib/nav-tree.d.ts +1 -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/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/tags.d.ts +58 -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 +8 -4
- 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/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 +14 -8
- 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 +1 -1
- package/dist/types/database.d.ts.map +1 -1
- package/package.json +6 -1
- package/src/auth/cookies.ts +111 -0
- package/src/collab/rebase.ts +26 -2
- 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 +499 -339
- 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 +18 -27
- package/src/hooks/useMediaPipeline.ts +1 -1
- 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 +15 -1
- 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/index.ts +5 -4
- package/src/lib/loader.ts +54 -55
- package/src/lib/nav-tree.ts +71 -0
- package/src/lib/nav.ts +196 -36
- 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/tags.ts +148 -0
- package/src/lib/theme-vars.ts +23 -0
- package/src/media/index.ts +1 -1
- package/src/media/utils.ts +18 -0
- package/src/media/{videoPoster.ts → video-poster.ts} +2 -2
- package/src/schemas/index.ts +1 -0
- 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/types.ts +1 -1
- 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
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
// src/lib/tags.ts
|
|
2
|
+
function reconcileTags(entries, sections) {
|
|
3
|
+
const entryList = Array.isArray(entries) ? entries : [];
|
|
4
|
+
const validIds = new Set(sections && typeof sections === "object" ? Object.keys(sections) : []);
|
|
5
|
+
const seenTagIds = /* @__PURE__ */ new Set();
|
|
6
|
+
const result = [];
|
|
7
|
+
for (const entry of entryList) {
|
|
8
|
+
if (!entry || typeof entry !== "object") continue;
|
|
9
|
+
if (typeof entry.id !== "string" || entry.id === "" || seenTagIds.has(entry.id)) continue;
|
|
10
|
+
seenTagIds.add(entry.id);
|
|
11
|
+
const claimed = Array.isArray(entry.sectionIds) ? entry.sectionIds : [];
|
|
12
|
+
const sectionIds = [];
|
|
13
|
+
for (const id of claimed) {
|
|
14
|
+
if (typeof id === "string" && validIds.has(id) && !sectionIds.includes(id)) sectionIds.push(id);
|
|
15
|
+
}
|
|
16
|
+
result.push({ id: entry.id, label: typeof entry.label === "string" ? entry.label : "", sectionIds });
|
|
17
|
+
}
|
|
18
|
+
return result;
|
|
19
|
+
}
|
|
20
|
+
function siteTags(index) {
|
|
21
|
+
return reconcileTags(index.tags ?? [], index.sections);
|
|
22
|
+
}
|
|
23
|
+
function tagDisplayLabel(label) {
|
|
24
|
+
return label || "Untitled tag";
|
|
25
|
+
}
|
|
26
|
+
function mergeTags(args) {
|
|
27
|
+
const { base, local, remote } = args;
|
|
28
|
+
if (remote === void 0) return local?.map((t) => ({ ...t, sectionIds: [...t.sectionIds] }));
|
|
29
|
+
if (base === void 0 || local === void 0) return remote.map((t) => ({ ...t, sectionIds: [...t.sectionIds] }));
|
|
30
|
+
const firstById = (tags) => {
|
|
31
|
+
const byId = /* @__PURE__ */ new Map();
|
|
32
|
+
for (const t of tags) if (!byId.has(t.id)) byId.set(t.id, t);
|
|
33
|
+
return byId;
|
|
34
|
+
};
|
|
35
|
+
const baseById = firstById(base);
|
|
36
|
+
const localById = firstById(local);
|
|
37
|
+
const remoteIds = new Set(remote.map((t) => t.id));
|
|
38
|
+
const result = [];
|
|
39
|
+
for (const r of remote) {
|
|
40
|
+
const b = baseById.get(r.id);
|
|
41
|
+
const l = localById.get(r.id);
|
|
42
|
+
if (b && !l) continue;
|
|
43
|
+
const members = [...r.sectionIds];
|
|
44
|
+
let label = r.label;
|
|
45
|
+
if (b && l) {
|
|
46
|
+
if (l.label !== b.label) label = l.label;
|
|
47
|
+
for (const id of l.sectionIds) if (!b.sectionIds.includes(id) && !members.includes(id)) members.push(id);
|
|
48
|
+
for (const id of b.sectionIds) {
|
|
49
|
+
if (l.sectionIds.includes(id)) continue;
|
|
50
|
+
const at = members.indexOf(id);
|
|
51
|
+
if (at !== -1) members.splice(at, 1);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
result.push({ id: r.id, label, sectionIds: members });
|
|
55
|
+
}
|
|
56
|
+
for (const l of local) {
|
|
57
|
+
if (!remoteIds.has(l.id) && !baseById.has(l.id)) result.push({ ...l, sectionIds: [...l.sectionIds] });
|
|
58
|
+
}
|
|
59
|
+
return result;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export {
|
|
63
|
+
reconcileTags,
|
|
64
|
+
siteTags,
|
|
65
|
+
tagDisplayLabel,
|
|
66
|
+
mergeTags
|
|
67
|
+
};
|
|
@@ -1,32 +1,29 @@
|
|
|
1
1
|
import {
|
|
2
|
-
Checkbox
|
|
3
|
-
|
|
2
|
+
Checkbox,
|
|
3
|
+
Tabs
|
|
4
|
+
} from "./chunk-JR24U7FJ.js";
|
|
4
5
|
import {
|
|
5
|
-
LinkField,
|
|
6
|
-
Select
|
|
7
|
-
} from "./chunk-K7DYZXVU.js";
|
|
8
|
-
import {
|
|
9
|
-
DeleteIcon,
|
|
10
6
|
DragHandle,
|
|
11
7
|
FormLabel,
|
|
12
8
|
Input,
|
|
13
|
-
|
|
9
|
+
LinkField,
|
|
10
|
+
Select,
|
|
14
11
|
useMediaLibrary,
|
|
15
12
|
useResolvedMedia
|
|
16
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-5KSAS4VY.js";
|
|
17
14
|
import {
|
|
18
15
|
Kbd,
|
|
19
16
|
Tooltip
|
|
20
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-JCDZAFX2.js";
|
|
21
18
|
import {
|
|
22
19
|
Button
|
|
23
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-GGYY3JQJ.js";
|
|
24
21
|
import {
|
|
25
22
|
IconButton
|
|
26
23
|
} from "./chunk-IIDKW7AV.js";
|
|
27
24
|
import {
|
|
28
25
|
formatFileSize
|
|
29
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-QHMKIODQ.js";
|
|
30
27
|
import {
|
|
31
28
|
cn
|
|
32
29
|
} from "./chunk-7EOSDFS3.js";
|
|
@@ -34,7 +31,7 @@ import {
|
|
|
34
31
|
// src/components/editor/DragHandle.tsx
|
|
35
32
|
import { forwardRef } from "react";
|
|
36
33
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
37
|
-
var DragHandle2 = forwardRef(function DragHandle3({ tooltipSide }, ref) {
|
|
34
|
+
var DragHandle2 = forwardRef(function DragHandle3({ tooltipSide, tabIndex = -1, "aria-describedby": ariaDescribedBy }, ref) {
|
|
38
35
|
return /* @__PURE__ */ jsx(Tooltip, { side: tooltipSide, content: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
39
36
|
/* @__PURE__ */ jsx(Kbd, { children: "Drag" }),
|
|
40
37
|
" to move"
|
|
@@ -45,18 +42,20 @@ var DragHandle2 = forwardRef(function DragHandle3({ tooltipSide }, ref) {
|
|
|
45
42
|
icon: /* @__PURE__ */ jsx(DragHandle, { size: 18 }),
|
|
46
43
|
label: "Drag to reorder section",
|
|
47
44
|
className: "pointer-events-auto cursor-grab active:cursor-grabbing rounded-md text-base-contrast-light/80 hover:bg-base-contrast-light/10 hover:text-base-contrast",
|
|
48
|
-
tabIndex
|
|
45
|
+
tabIndex,
|
|
46
|
+
"aria-describedby": ariaDescribedBy
|
|
49
47
|
}
|
|
50
48
|
) });
|
|
51
49
|
});
|
|
52
50
|
|
|
53
51
|
// src/components/editor/DeleteButton.tsx
|
|
52
|
+
import { Trash2 } from "lucide-react";
|
|
54
53
|
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
55
54
|
function DeleteButton({ onDelete }) {
|
|
56
55
|
return /* @__PURE__ */ jsx2(
|
|
57
56
|
IconButton,
|
|
58
57
|
{
|
|
59
|
-
icon: /* @__PURE__ */ jsx2(
|
|
58
|
+
icon: /* @__PURE__ */ jsx2(Trash2, { size: 16 }),
|
|
60
59
|
label: "Delete section",
|
|
61
60
|
intent: "destructive",
|
|
62
61
|
onClick: onDelete,
|
|
@@ -66,12 +65,13 @@ function DeleteButton({ onDelete }) {
|
|
|
66
65
|
}
|
|
67
66
|
|
|
68
67
|
// src/components/editor/SettingsButton.tsx
|
|
68
|
+
import { Settings } from "lucide-react";
|
|
69
69
|
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
70
70
|
function SettingsButton({ onClick }) {
|
|
71
71
|
return /* @__PURE__ */ jsx3(
|
|
72
72
|
IconButton,
|
|
73
73
|
{
|
|
74
|
-
icon: /* @__PURE__ */ jsx3(
|
|
74
|
+
icon: /* @__PURE__ */ jsx3(Settings, { size: 16 }),
|
|
75
75
|
label: "Section settings",
|
|
76
76
|
onClick,
|
|
77
77
|
className: "pointer-events-auto"
|
|
@@ -80,7 +80,7 @@ function SettingsButton({ onClick }) {
|
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
// src/components/editor/SettingsForm.tsx
|
|
83
|
-
import { useId, useState as
|
|
83
|
+
import { useId, useState as useState2 } from "react";
|
|
84
84
|
|
|
85
85
|
// src/components/shared/VideoSourceField.tsx
|
|
86
86
|
import { useState } from "react";
|
|
@@ -196,7 +196,7 @@ function VideoSourceField({ value, onChange }) {
|
|
|
196
196
|
}
|
|
197
197
|
)
|
|
198
198
|
] }),
|
|
199
|
-
error ? /* @__PURE__ */ jsx4("p", { className: "text-xs text-
|
|
199
|
+
error ? /* @__PURE__ */ jsx4("p", { className: "text-xs text-danger", children: error }) : null,
|
|
200
200
|
!error && fallback ? /* @__PURE__ */ jsx4("p", { className: "text-xs text-base-contrast-light/70", children: "Added \u2014 couldn't fetch exact dimensions, using 16:9." }) : null,
|
|
201
201
|
value?.type === "external" && value.provider === "instagram" ? /* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-2", children: [
|
|
202
202
|
/* @__PURE__ */ jsx4("span", { className: "text-xs text-base-contrast-light", children: "Aspect" }),
|
|
@@ -265,40 +265,141 @@ function DocumentSourceField({ value, onChange }) {
|
|
|
265
265
|
] });
|
|
266
266
|
}
|
|
267
267
|
|
|
268
|
-
// src/components/shared/
|
|
269
|
-
import {
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
const activeId = isControlled ? activeTabId : uncontrolledId;
|
|
275
|
-
const activeTab = tabs.find((t) => t.id === activeId) ?? tabs[0];
|
|
276
|
-
function handleSelect(id) {
|
|
277
|
-
if (!isControlled) setUncontrolledId(id);
|
|
278
|
-
onTabChange?.(id);
|
|
279
|
-
}
|
|
280
|
-
return /* @__PURE__ */ jsxs4("div", { className: "flex flex-1 flex-col overflow-hidden", children: [
|
|
281
|
-
/* @__PURE__ */ jsx6("div", { className: cn("border-b border-base-200", fullBleedTabBar && "-mx-6 px-6"), children: /* @__PURE__ */ jsx6("div", { className: "flex", role: "tablist", children: tabs.map((tab) => /* @__PURE__ */ jsx6(
|
|
268
|
+
// src/components/shared/SegmentedControl.tsx
|
|
269
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
270
|
+
function SegmentedControl({ options, value, onChange, className }) {
|
|
271
|
+
return /* @__PURE__ */ jsx6("div", { role: "radiogroup", className: cn("inline-flex rounded border border-base-200 bg-base-accent", className), children: options.map((option) => {
|
|
272
|
+
const selected = option.value === value;
|
|
273
|
+
return /* @__PURE__ */ jsx6(
|
|
282
274
|
"button",
|
|
283
275
|
{
|
|
284
276
|
type: "button",
|
|
285
|
-
role: "
|
|
286
|
-
"aria-
|
|
287
|
-
|
|
277
|
+
role: "radio",
|
|
278
|
+
"aria-checked": selected,
|
|
279
|
+
"aria-label": option.label,
|
|
280
|
+
onClick: () => {
|
|
281
|
+
if (!selected) onChange(option.value);
|
|
282
|
+
},
|
|
288
283
|
className: cn(
|
|
289
|
-
"cursor-pointer px-
|
|
290
|
-
|
|
284
|
+
"cursor-pointer px-3 py-1 text-xs font-medium transition-colors first:rounded-l last:rounded-r",
|
|
285
|
+
selected ? "bg-base-contrast text-base-accent" : "text-base-contrast-light hover:text-base-contrast"
|
|
291
286
|
),
|
|
292
|
-
children:
|
|
287
|
+
children: option.label
|
|
293
288
|
},
|
|
294
|
-
|
|
295
|
-
)
|
|
296
|
-
|
|
289
|
+
option.value
|
|
290
|
+
);
|
|
291
|
+
}) });
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
// src/components/shared/ColorPicker.tsx
|
|
295
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
296
|
+
function ColorPicker({ value, onChange, label = "Color", className }) {
|
|
297
|
+
return /* @__PURE__ */ jsx7(
|
|
298
|
+
"label",
|
|
299
|
+
{
|
|
300
|
+
className: cn(
|
|
301
|
+
"inline-flex h-9 w-9 shrink-0 cursor-pointer items-center justify-center rounded-full border border-base-200 focus-within:outline focus-within:outline-2 focus-within:outline-base-contrast",
|
|
302
|
+
className
|
|
303
|
+
),
|
|
304
|
+
style: { backgroundColor: value },
|
|
305
|
+
children: /* @__PURE__ */ jsx7(
|
|
306
|
+
"input",
|
|
307
|
+
{
|
|
308
|
+
type: "color",
|
|
309
|
+
"aria-label": label,
|
|
310
|
+
value,
|
|
311
|
+
onChange: (e) => onChange(e.target.value),
|
|
312
|
+
className: "sr-only"
|
|
313
|
+
}
|
|
314
|
+
)
|
|
315
|
+
}
|
|
316
|
+
);
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
// src/components/shared/BrandSwatchesContext.ts
|
|
320
|
+
import { createContext, useContext } from "react";
|
|
321
|
+
var BrandSwatchesContext = createContext([]);
|
|
322
|
+
function useBrandSwatches() {
|
|
323
|
+
return useContext(BrandSwatchesContext);
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
// src/components/shared/ImageBackgroundField.tsx
|
|
327
|
+
import { jsx as jsx8, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
328
|
+
var MODES = [
|
|
329
|
+
{ value: "none", label: "None" },
|
|
330
|
+
{ value: "theme", label: "Light / Dark" },
|
|
331
|
+
{ value: "custom", label: "Custom" }
|
|
332
|
+
];
|
|
333
|
+
var SURFACES = [
|
|
334
|
+
{ value: "none", label: "None" },
|
|
335
|
+
{ value: "light", label: "Light" },
|
|
336
|
+
{ value: "dark", label: "Dark" }
|
|
337
|
+
];
|
|
338
|
+
function ImageBackgroundField({ label, value, onChange }) {
|
|
339
|
+
const swatches = useBrandSwatches();
|
|
340
|
+
const mode = value?.mode ?? "none";
|
|
341
|
+
function setMode(next) {
|
|
342
|
+
if (next === "theme") onChange({ mode: "theme", light: "none", dark: "none" });
|
|
343
|
+
else if (next === "custom") onChange({ mode: "custom", color: "#ffffff" });
|
|
344
|
+
else onChange(void 0);
|
|
345
|
+
}
|
|
346
|
+
return /* @__PURE__ */ jsxs4("div", { className: "flex flex-col gap-3", children: [
|
|
347
|
+
/* @__PURE__ */ jsx8(FormLabel, { children: label }),
|
|
348
|
+
/* @__PURE__ */ jsx8(SegmentedControl, { options: MODES, value: mode, onChange: setMode, className: "self-start" }),
|
|
349
|
+
value?.mode === "theme" && /* @__PURE__ */ jsxs4("div", { className: "grid grid-cols-2 gap-3", children: [
|
|
350
|
+
/* @__PURE__ */ jsx8(
|
|
351
|
+
Select,
|
|
352
|
+
{
|
|
353
|
+
label: "Light mode",
|
|
354
|
+
value: value.light,
|
|
355
|
+
options: SURFACES,
|
|
356
|
+
onChange: (light) => onChange({ ...value, light })
|
|
357
|
+
}
|
|
358
|
+
),
|
|
359
|
+
/* @__PURE__ */ jsx8(
|
|
360
|
+
Select,
|
|
361
|
+
{
|
|
362
|
+
label: "Dark mode",
|
|
363
|
+
value: value.dark,
|
|
364
|
+
options: SURFACES,
|
|
365
|
+
onChange: (dark) => onChange({ ...value, dark })
|
|
366
|
+
}
|
|
367
|
+
)
|
|
368
|
+
] }),
|
|
369
|
+
value?.mode === "custom" && /* @__PURE__ */ jsxs4("div", { className: "flex flex-col gap-2", children: [
|
|
370
|
+
/* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-2", children: [
|
|
371
|
+
/* @__PURE__ */ jsx8(
|
|
372
|
+
ColorPicker,
|
|
373
|
+
{
|
|
374
|
+
label: "Background color",
|
|
375
|
+
value: value.color,
|
|
376
|
+
onChange: (color) => onChange({ mode: "custom", color })
|
|
377
|
+
}
|
|
378
|
+
),
|
|
379
|
+
/* @__PURE__ */ jsx8("span", { className: "font-mono text-xs text-base-contrast-light", children: value.color })
|
|
380
|
+
] }),
|
|
381
|
+
swatches.length > 0 && /* @__PURE__ */ jsx8("div", { role: "group", "aria-label": "Brand colors", className: "flex flex-wrap gap-2", children: swatches.map((s) => /* @__PURE__ */ jsx8(
|
|
382
|
+
"button",
|
|
383
|
+
{
|
|
384
|
+
type: "button",
|
|
385
|
+
"aria-label": s.name ? `${s.name} (${s.hex})` : s.hex,
|
|
386
|
+
"aria-pressed": s.hex === value.color.toLowerCase(),
|
|
387
|
+
title: s.name ?? s.hex,
|
|
388
|
+
onClick: () => onChange({ mode: "custom", color: s.hex }),
|
|
389
|
+
className: cn(
|
|
390
|
+
"h-7 w-7 cursor-pointer rounded-full border border-base-200",
|
|
391
|
+
"aria-pressed:outline aria-pressed:outline-2 aria-pressed:outline-offset-2 aria-pressed:outline-base-contrast"
|
|
392
|
+
),
|
|
393
|
+
style: { backgroundColor: s.hex }
|
|
394
|
+
},
|
|
395
|
+
s.hex
|
|
396
|
+
)) })
|
|
397
|
+
] })
|
|
297
398
|
] });
|
|
298
399
|
}
|
|
299
400
|
|
|
300
401
|
// src/components/editor/SettingsForm.tsx
|
|
301
|
-
import { jsx as
|
|
402
|
+
import { jsx as jsx9, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
302
403
|
function resolveValues(schema, values) {
|
|
303
404
|
const resolved = {};
|
|
304
405
|
for (const [key, field] of Object.entries(schema)) {
|
|
@@ -339,8 +440,8 @@ function RangeField({
|
|
|
339
440
|
}) {
|
|
340
441
|
const id = useId();
|
|
341
442
|
return /* @__PURE__ */ jsxs5("div", { children: [
|
|
342
|
-
/* @__PURE__ */
|
|
343
|
-
/* @__PURE__ */
|
|
443
|
+
/* @__PURE__ */ jsx9(FormLabel, { htmlFor: id, children: field.label }),
|
|
444
|
+
/* @__PURE__ */ jsx9(
|
|
344
445
|
"input",
|
|
345
446
|
{
|
|
346
447
|
id,
|
|
@@ -357,10 +458,10 @@ function RangeField({
|
|
|
357
458
|
)
|
|
358
459
|
] });
|
|
359
460
|
}
|
|
360
|
-
function renderField(key, field, value, handleFieldChange) {
|
|
461
|
+
function renderField(key, field, value, handleFieldChange, values) {
|
|
361
462
|
switch (field.type) {
|
|
362
463
|
case "text":
|
|
363
|
-
return /* @__PURE__ */
|
|
464
|
+
return /* @__PURE__ */ jsx9(
|
|
364
465
|
Input,
|
|
365
466
|
{
|
|
366
467
|
label: field.label,
|
|
@@ -371,7 +472,7 @@ function renderField(key, field, value, handleFieldChange) {
|
|
|
371
472
|
key
|
|
372
473
|
);
|
|
373
474
|
case "number":
|
|
374
|
-
return /* @__PURE__ */
|
|
475
|
+
return /* @__PURE__ */ jsx9(
|
|
375
476
|
Input,
|
|
376
477
|
{
|
|
377
478
|
label: field.label,
|
|
@@ -382,7 +483,7 @@ function renderField(key, field, value, handleFieldChange) {
|
|
|
382
483
|
key
|
|
383
484
|
);
|
|
384
485
|
case "checkbox":
|
|
385
|
-
return /* @__PURE__ */
|
|
486
|
+
return /* @__PURE__ */ jsx9(
|
|
386
487
|
Checkbox,
|
|
387
488
|
{
|
|
388
489
|
label: field.label,
|
|
@@ -392,7 +493,7 @@ function renderField(key, field, value, handleFieldChange) {
|
|
|
392
493
|
key
|
|
393
494
|
);
|
|
394
495
|
case "select":
|
|
395
|
-
return /* @__PURE__ */
|
|
496
|
+
return /* @__PURE__ */ jsx9(
|
|
396
497
|
Select,
|
|
397
498
|
{
|
|
398
499
|
label: field.label,
|
|
@@ -403,7 +504,7 @@ function renderField(key, field, value, handleFieldChange) {
|
|
|
403
504
|
key
|
|
404
505
|
);
|
|
405
506
|
case "range":
|
|
406
|
-
return /* @__PURE__ */
|
|
507
|
+
return /* @__PURE__ */ jsx9(
|
|
407
508
|
RangeField,
|
|
408
509
|
{
|
|
409
510
|
field,
|
|
@@ -413,7 +514,7 @@ function renderField(key, field, value, handleFieldChange) {
|
|
|
413
514
|
key
|
|
414
515
|
);
|
|
415
516
|
case "link":
|
|
416
|
-
return /* @__PURE__ */
|
|
517
|
+
return /* @__PURE__ */ jsx9(
|
|
417
518
|
LinkField,
|
|
418
519
|
{
|
|
419
520
|
label: field.label,
|
|
@@ -423,7 +524,7 @@ function renderField(key, field, value, handleFieldChange) {
|
|
|
423
524
|
key
|
|
424
525
|
);
|
|
425
526
|
case "video-source":
|
|
426
|
-
return /* @__PURE__ */
|
|
527
|
+
return /* @__PURE__ */ jsx9(
|
|
427
528
|
VideoSourceField,
|
|
428
529
|
{
|
|
429
530
|
value,
|
|
@@ -432,7 +533,7 @@ function renderField(key, field, value, handleFieldChange) {
|
|
|
432
533
|
key
|
|
433
534
|
);
|
|
434
535
|
case "document-source":
|
|
435
|
-
return /* @__PURE__ */
|
|
536
|
+
return /* @__PURE__ */ jsx9(
|
|
436
537
|
DocumentSourceField,
|
|
437
538
|
{
|
|
438
539
|
value,
|
|
@@ -440,29 +541,41 @@ function renderField(key, field, value, handleFieldChange) {
|
|
|
440
541
|
},
|
|
441
542
|
key
|
|
442
543
|
);
|
|
544
|
+
case "image-background":
|
|
545
|
+
if (field.hidden?.(values)) return null;
|
|
546
|
+
return /* @__PURE__ */ jsx9(
|
|
547
|
+
ImageBackgroundField,
|
|
548
|
+
{
|
|
549
|
+
label: field.label,
|
|
550
|
+
value,
|
|
551
|
+
onChange: (v) => handleFieldChange(key, v)
|
|
552
|
+
},
|
|
553
|
+
key
|
|
554
|
+
);
|
|
443
555
|
default:
|
|
444
556
|
return null;
|
|
445
557
|
}
|
|
446
558
|
}
|
|
447
559
|
function SettingsForm({ schema, values, onChange, tabs }) {
|
|
448
|
-
const [local, setLocal] =
|
|
560
|
+
const [local, setLocal] = useState2(() => resolveValues(schema, values));
|
|
561
|
+
const allValues = { ...values, ...local };
|
|
449
562
|
function handleFieldChange(key, newValue) {
|
|
450
563
|
const next = { ...local, [key]: newValue };
|
|
451
564
|
setLocal(next);
|
|
452
565
|
onChange(splitByTarget(schema, next));
|
|
453
566
|
}
|
|
454
567
|
if (tabs) {
|
|
455
|
-
const fields = (keys) => keys.filter((key) => key in schema).map((key) => renderField(key, schema[key], local[key], handleFieldChange));
|
|
568
|
+
const fields = (keys) => keys.filter((key) => key in schema).map((key) => renderField(key, schema[key], local[key], handleFieldChange, allValues));
|
|
456
569
|
const listed = new Set(tabs.flatMap((t) => t.fields));
|
|
457
570
|
const otherKeys = Object.keys(schema).filter((key) => !listed.has(key));
|
|
458
571
|
const panel = "flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto px-px";
|
|
459
572
|
const tabItems = [
|
|
460
|
-
...tabs.map((t) => ({ id: t.label, label: t.label, content: /* @__PURE__ */
|
|
461
|
-
...otherKeys.length > 0 ? [{ id: "__other__", label: "Other", content: /* @__PURE__ */
|
|
573
|
+
...tabs.map((t) => ({ id: t.label, label: t.label, content: /* @__PURE__ */ jsx9("div", { className: panel, children: fields(t.fields) }) })),
|
|
574
|
+
...otherKeys.length > 0 ? [{ id: "__other__", label: "Other", content: /* @__PURE__ */ jsx9("div", { className: panel, children: fields(otherKeys) }) }] : []
|
|
462
575
|
];
|
|
463
|
-
return /* @__PURE__ */
|
|
576
|
+
return /* @__PURE__ */ jsx9(Tabs, { tabs: tabItems, fullBleedTabBar: true });
|
|
464
577
|
}
|
|
465
|
-
return /* @__PURE__ */
|
|
578
|
+
return /* @__PURE__ */ jsx9("div", { className: "flex flex-col gap-4", children: Object.entries(schema).map(([key, field]) => renderField(key, field, local[key], handleFieldChange, allValues)) });
|
|
466
579
|
}
|
|
467
580
|
|
|
468
581
|
// src/lib/block-dnd.ts
|
|
@@ -478,10 +591,25 @@ function isBlockDragData(data) {
|
|
|
478
591
|
}
|
|
479
592
|
function canDropBlock(source, dropContainerId) {
|
|
480
593
|
if (source.blockId === dropContainerId) return false;
|
|
481
|
-
if (source.isContainer && dropContainerId !== ROOT_CONTAINER_ID) return false;
|
|
594
|
+
if ((source.isContainer || source.isReference) && dropContainerId !== ROOT_CONTAINER_ID) return false;
|
|
482
595
|
return true;
|
|
483
596
|
}
|
|
484
597
|
|
|
598
|
+
// src/components/shell/EditorContext.tsx
|
|
599
|
+
import { createContext as createContext2, useContext as useContext2, useState as useState3, useCallback } from "react";
|
|
600
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
601
|
+
var EditorContext = createContext2(null);
|
|
602
|
+
function useEditorContext() {
|
|
603
|
+
const context = useContext2(EditorContext);
|
|
604
|
+
if (!context) {
|
|
605
|
+
throw new Error("useEditorContext must be used within an EditorProvider");
|
|
606
|
+
}
|
|
607
|
+
return context;
|
|
608
|
+
}
|
|
609
|
+
function useOptionalEditorContext() {
|
|
610
|
+
return useContext2(EditorContext);
|
|
611
|
+
}
|
|
612
|
+
|
|
485
613
|
export {
|
|
486
614
|
DragHandle2 as DragHandle,
|
|
487
615
|
DeleteButton,
|
|
@@ -490,5 +618,7 @@ export {
|
|
|
490
618
|
buildBlockDragData,
|
|
491
619
|
buildBlockDropData,
|
|
492
620
|
isBlockDragData,
|
|
493
|
-
canDropBlock
|
|
621
|
+
canDropBlock,
|
|
622
|
+
useEditorContext,
|
|
623
|
+
useOptionalEditorContext
|
|
494
624
|
};
|
|
@@ -3,16 +3,14 @@ import {
|
|
|
3
3
|
} from "./chunk-FRVO75DK.js";
|
|
4
4
|
import {
|
|
5
5
|
safeNextPath
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import {
|
|
8
|
-
NavEntrySchema
|
|
9
|
-
} from "./chunk-REDDTTGJ.js";
|
|
6
|
+
} from "./chunk-7SX42OP4.js";
|
|
10
7
|
import {
|
|
11
8
|
getSectionSchemaForType
|
|
12
9
|
} from "./chunk-DMCGN5AS.js";
|
|
13
10
|
import {
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
NavEntrySchema,
|
|
12
|
+
TagEntrySchema
|
|
13
|
+
} from "./chunk-4Y2JQQZL.js";
|
|
16
14
|
import {
|
|
17
15
|
getAllSchemas
|
|
18
16
|
} from "./chunk-FTPETWXE.js";
|
|
@@ -96,15 +94,6 @@ function onPrimaryVarValue(c) {
|
|
|
96
94
|
return lightDark(light, dark, c?.darkMode === "optional");
|
|
97
95
|
}
|
|
98
96
|
|
|
99
|
-
// src/lib/grid.ts
|
|
100
|
-
var gridColsClass = {
|
|
101
|
-
1: "grid-cols-1",
|
|
102
|
-
2: "grid-cols-1 min-sm:grid-cols-2",
|
|
103
|
-
3: "grid-cols-1 min-sm:grid-cols-2 lg:grid-cols-3",
|
|
104
|
-
4: "grid-cols-2 lg:grid-cols-4",
|
|
105
|
-
5: "grid-cols-2 min-sm:grid-cols-3 lg:grid-cols-5"
|
|
106
|
-
};
|
|
107
|
-
|
|
108
97
|
// src/lib/google-fonts.ts
|
|
109
98
|
function buildGoogleFontsUrl(headingFont, bodyFont) {
|
|
110
99
|
const fonts = /* @__PURE__ */ new Set();
|
|
@@ -115,7 +104,7 @@ function buildGoogleFontsUrl(headingFont, bodyFont) {
|
|
|
115
104
|
return `https://fonts.googleapis.com/css2?${params}&display=swap`;
|
|
116
105
|
}
|
|
117
106
|
|
|
118
|
-
// src/lib/
|
|
107
|
+
// src/lib/safe-redirect.ts
|
|
119
108
|
function safeRedirect(url, fallback) {
|
|
120
109
|
if (!url) return fallback;
|
|
121
110
|
return safeNextPath(url) ?? fallback;
|
|
@@ -126,7 +115,7 @@ function parseNavFile(navFile) {
|
|
|
126
115
|
if (!navFile) return { entries: [], degraded: false };
|
|
127
116
|
const rawEntries = navFile.entries;
|
|
128
117
|
if (!Array.isArray(rawEntries)) {
|
|
129
|
-
console.warn("Invalid nav.json, falling back to a flat navigation");
|
|
118
|
+
console.warn("[loader] Invalid nav.json, falling back to a flat navigation");
|
|
130
119
|
return { entries: [], degraded: true };
|
|
131
120
|
}
|
|
132
121
|
const entries = [];
|
|
@@ -137,11 +126,30 @@ function parseNavFile(navFile) {
|
|
|
137
126
|
else dropped++;
|
|
138
127
|
}
|
|
139
128
|
if (dropped > 0) {
|
|
140
|
-
console.warn(`nav.json: dropped ${dropped} entr${dropped === 1 ? "y" : "ies"} this package version cannot represent; navigation is degraded`);
|
|
129
|
+
console.warn(`[loader] nav.json: dropped ${dropped} entr${dropped === 1 ? "y" : "ies"} this package version cannot represent; navigation is degraded`);
|
|
141
130
|
}
|
|
142
131
|
return { entries, degraded: dropped > 0 };
|
|
143
132
|
}
|
|
144
|
-
function
|
|
133
|
+
function parseTagsFile(tagsFile) {
|
|
134
|
+
if (!tagsFile) return { tags: [], degraded: false };
|
|
135
|
+
const rawTags = tagsFile.tags;
|
|
136
|
+
if (!Array.isArray(rawTags)) {
|
|
137
|
+
console.warn("[loader] Invalid tags.json, falling back to no tags");
|
|
138
|
+
return { tags: [], degraded: true };
|
|
139
|
+
}
|
|
140
|
+
const tags = [];
|
|
141
|
+
let dropped = 0;
|
|
142
|
+
for (const raw of rawTags) {
|
|
143
|
+
const result = TagEntrySchema.safeParse(raw);
|
|
144
|
+
if (result.success) tags.push(result.data);
|
|
145
|
+
else dropped++;
|
|
146
|
+
}
|
|
147
|
+
if (dropped > 0) {
|
|
148
|
+
console.warn(`[loader] tags.json: dropped ${dropped} entr${dropped === 1 ? "y" : "ies"} this package version cannot represent; tags are degraded`);
|
|
149
|
+
}
|
|
150
|
+
return { tags, degraded: dropped > 0 };
|
|
151
|
+
}
|
|
152
|
+
function mergeSiteContent(index, sectionFiles, navFile, tagsSidecar = { loaded: false }) {
|
|
145
153
|
const sections = [];
|
|
146
154
|
const canValidate = getAllSchemas().length >= 2;
|
|
147
155
|
const orderedIds = index.pages.flatMap((p) => p.order);
|
|
@@ -173,46 +181,22 @@ function mergeSiteContent(index, sectionFiles, navFile) {
|
|
|
173
181
|
}
|
|
174
182
|
}
|
|
175
183
|
const nav = parseNavFile(navFile);
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
184
|
+
const tags = tagsSidecar.loaded ? parseTagsFile(tagsSidecar.file) : null;
|
|
185
|
+
return {
|
|
186
|
+
sections,
|
|
187
|
+
index: { ...index, nav: nav.entries, ...tags ? { tags: tags.tags } : {} },
|
|
188
|
+
navDegraded: nav.degraded,
|
|
189
|
+
tagsDegraded: tags?.degraded ?? false
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
function loadStaticSiteContent(index, sectionGlob, navFile, tagsSidecar = { loaded: false }) {
|
|
179
193
|
const sectionFiles = {};
|
|
180
194
|
for (const [path, data] of Object.entries(sectionGlob)) {
|
|
181
195
|
const filename = path.split("/").pop();
|
|
182
196
|
const id = filename.replace(".json", "");
|
|
183
197
|
sectionFiles[id] = data;
|
|
184
198
|
}
|
|
185
|
-
return mergeSiteContent(index, sectionFiles, navFile);
|
|
186
|
-
}
|
|
187
|
-
async function loadSiteContent(contentDir) {
|
|
188
|
-
const fs = await import("fs/promises");
|
|
189
|
-
const path = await import("path");
|
|
190
|
-
const indexPath = path.join(contentDir, "index.json");
|
|
191
|
-
const indexRaw = JSON.parse(await fs.readFile(indexPath, "utf-8"));
|
|
192
|
-
const index = IndexSchema.parse(indexRaw);
|
|
193
|
-
const sectionFiles = {};
|
|
194
|
-
for (const id of index.pages.flatMap((p) => p.order)) {
|
|
195
|
-
const sectionPath = path.join(contentDir, "sections", `${id}.json`);
|
|
196
|
-
sectionFiles[id] = JSON.parse(await fs.readFile(sectionPath, "utf-8"));
|
|
197
|
-
}
|
|
198
|
-
let navRaw;
|
|
199
|
-
let readFailed = false;
|
|
200
|
-
try {
|
|
201
|
-
navRaw = await fs.readFile(path.join(contentDir, "nav.json"), "utf-8");
|
|
202
|
-
} catch (err) {
|
|
203
|
-
readFailed = err?.code !== "ENOENT";
|
|
204
|
-
}
|
|
205
|
-
let navFile;
|
|
206
|
-
let parseFailed = false;
|
|
207
|
-
if (navRaw !== void 0) {
|
|
208
|
-
try {
|
|
209
|
-
navFile = JSON.parse(navRaw);
|
|
210
|
-
} catch {
|
|
211
|
-
parseFailed = true;
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
const content = mergeSiteContent(index, sectionFiles, navFile);
|
|
215
|
-
return readFailed || parseFailed ? { ...content, navDegraded: true } : content;
|
|
199
|
+
return mergeSiteContent(index, sectionFiles, navFile, tagsSidecar);
|
|
216
200
|
}
|
|
217
201
|
|
|
218
202
|
export {
|
|
@@ -228,10 +212,8 @@ export {
|
|
|
228
212
|
primaryVarValue,
|
|
229
213
|
accentVarValue,
|
|
230
214
|
onPrimaryVarValue,
|
|
231
|
-
gridColsClass,
|
|
232
215
|
buildGoogleFontsUrl,
|
|
233
216
|
safeRedirect,
|
|
234
217
|
mergeSiteContent,
|
|
235
|
-
loadStaticSiteContent
|
|
236
|
-
loadSiteContent
|
|
218
|
+
loadStaticSiteContent
|
|
237
219
|
};
|