@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
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,
|
|
@@ -15,7 +15,7 @@ var NothingToPublishError = class extends Error {
|
|
|
15
15
|
};
|
|
16
16
|
var IdempotencyLookupUnavailableError = class extends Error {
|
|
17
17
|
constructor(cause) {
|
|
18
|
-
super("
|
|
18
|
+
super("Couldn't search draft history for the idempotency key");
|
|
19
19
|
this.cause = cause;
|
|
20
20
|
this.name = "IdempotencyLookupUnavailableError";
|
|
21
21
|
}
|
|
@@ -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
|
};
|
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getMediaProvider
|
|
3
|
+
} from "./chunk-QHMKIODQ.js";
|
|
4
|
+
import {
|
|
5
|
+
cn
|
|
6
|
+
} from "./chunk-7EOSDFS3.js";
|
|
7
|
+
|
|
8
|
+
// src/components/shared/PagesContext.tsx
|
|
9
|
+
import { createContext, useContext } from "react";
|
|
10
|
+
var PagesContext = createContext({ pages: [], getPageHeadings: () => [] });
|
|
11
|
+
function usePages() {
|
|
12
|
+
return useContext(PagesContext);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// src/components/shared/FormLabel.tsx
|
|
16
|
+
import { jsx } from "react/jsx-runtime";
|
|
17
|
+
function FormLabel({ htmlFor, children, className }) {
|
|
18
|
+
return /* @__PURE__ */ jsx(
|
|
19
|
+
"label",
|
|
20
|
+
{
|
|
21
|
+
htmlFor,
|
|
22
|
+
className: cn("mb-1.5 block text-sm font-medium text-base-contrast", className),
|
|
23
|
+
children
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// src/components/shared/Input.tsx
|
|
29
|
+
import { forwardRef, useId } from "react";
|
|
30
|
+
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
31
|
+
var Input = forwardRef(function Input2({ label, value, onChange, type = "text", className, disabled, error, hint, hideLabel, inputClassName, ...rest }, ref) {
|
|
32
|
+
const id = useId();
|
|
33
|
+
const errorId = `${id}-error`;
|
|
34
|
+
const hintId = `${id}-hint`;
|
|
35
|
+
return /* @__PURE__ */ jsxs("div", { className, children: [
|
|
36
|
+
/* @__PURE__ */ jsx2(FormLabel, { htmlFor: id, className: hideLabel ? "sr-only" : void 0, children: label }),
|
|
37
|
+
/* @__PURE__ */ jsx2(
|
|
38
|
+
"input",
|
|
39
|
+
{
|
|
40
|
+
ref,
|
|
41
|
+
id,
|
|
42
|
+
type,
|
|
43
|
+
value,
|
|
44
|
+
onChange: (e) => onChange(e.target.value),
|
|
45
|
+
disabled,
|
|
46
|
+
"aria-invalid": error ? true : void 0,
|
|
47
|
+
"aria-describedby": error ? errorId : hint ? hintId : void 0,
|
|
48
|
+
className: cn(
|
|
49
|
+
"w-full rounded border bg-base px-3 py-2 text-sm text-base-contrast focus:outline-none focus:ring-1",
|
|
50
|
+
error ? "border-danger focus:border-danger focus:ring-danger" : "border-base-200 focus:border-base-contrast focus:ring-base-contrast",
|
|
51
|
+
disabled && "cursor-not-allowed opacity-50",
|
|
52
|
+
inputClassName
|
|
53
|
+
),
|
|
54
|
+
...rest
|
|
55
|
+
}
|
|
56
|
+
),
|
|
57
|
+
error ? /* @__PURE__ */ jsx2("p", { id: errorId, className: "mt-1 text-xs text-danger", children: error }) : hint ? /* @__PURE__ */ jsx2("p", { id: hintId, className: "mt-1 text-xs text-base-contrast-light", children: hint }) : null
|
|
58
|
+
] });
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
// src/components/shared/Select.tsx
|
|
62
|
+
import { useId as useId2 } from "react";
|
|
63
|
+
import { ChevronDown } from "lucide-react";
|
|
64
|
+
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
65
|
+
function Select({
|
|
66
|
+
label,
|
|
67
|
+
value,
|
|
68
|
+
onChange,
|
|
69
|
+
options,
|
|
70
|
+
disabled,
|
|
71
|
+
className,
|
|
72
|
+
selectClassName,
|
|
73
|
+
...rest
|
|
74
|
+
}) {
|
|
75
|
+
const id = useId2();
|
|
76
|
+
return /* @__PURE__ */ jsxs2("div", { className, children: [
|
|
77
|
+
label && /* @__PURE__ */ jsx3(FormLabel, { htmlFor: id, children: label }),
|
|
78
|
+
/* @__PURE__ */ jsxs2("div", { className: "relative", children: [
|
|
79
|
+
/* @__PURE__ */ jsx3(
|
|
80
|
+
"select",
|
|
81
|
+
{
|
|
82
|
+
id,
|
|
83
|
+
value,
|
|
84
|
+
onChange: (e) => onChange(e.target.value),
|
|
85
|
+
disabled,
|
|
86
|
+
...rest,
|
|
87
|
+
className: cn(
|
|
88
|
+
"w-full appearance-none rounded border border-base-200 bg-base py-2 pr-8 pl-3 text-sm text-base-contrast",
|
|
89
|
+
"focus:border-base-contrast focus:outline-none focus:ring-1 focus:ring-base-contrast",
|
|
90
|
+
disabled && "cursor-not-allowed opacity-50",
|
|
91
|
+
selectClassName
|
|
92
|
+
),
|
|
93
|
+
children: options.map((opt) => /* @__PURE__ */ jsx3("option", { value: opt.value, children: opt.label }, opt.value))
|
|
94
|
+
}
|
|
95
|
+
),
|
|
96
|
+
/* @__PURE__ */ jsx3(
|
|
97
|
+
ChevronDown,
|
|
98
|
+
{
|
|
99
|
+
size: 14,
|
|
100
|
+
className: "pointer-events-none absolute right-2.5 top-1/2 -translate-y-1/2 text-base-contrast-light"
|
|
101
|
+
}
|
|
102
|
+
)
|
|
103
|
+
] })
|
|
104
|
+
] });
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
// src/components/shared/LinkField.tsx
|
|
108
|
+
import { Fragment, jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
109
|
+
var TARGET_OPTIONS = [
|
|
110
|
+
{ label: "Same tab (_self)", value: "_self" },
|
|
111
|
+
{ label: "New tab (_blank)", value: "_blank" }
|
|
112
|
+
];
|
|
113
|
+
function LinkField({ label, value, onChange }) {
|
|
114
|
+
const { pages, getPageHeadings } = usePages();
|
|
115
|
+
const isInternal = value.kind === "internal";
|
|
116
|
+
function setMode(kind) {
|
|
117
|
+
if (kind === value.kind) return;
|
|
118
|
+
onChange(kind === "external" ? { kind: "external", href: "", target: value.target } : { kind: "internal", pageId: "", anchorSectionId: null, target: "_self" });
|
|
119
|
+
}
|
|
120
|
+
const pageId = isInternal ? value.pageId : "";
|
|
121
|
+
const headings = pageId ? getPageHeadings(pageId) : [];
|
|
122
|
+
return /* @__PURE__ */ jsxs3("div", { className: "flex flex-col gap-3", children: [
|
|
123
|
+
/* @__PURE__ */ jsx4(FormLabel, { children: label }),
|
|
124
|
+
/* @__PURE__ */ jsx4("div", { className: "flex gap-2", role: "tablist", children: ["internal", "external"].map((kind) => /* @__PURE__ */ jsx4(
|
|
125
|
+
"button",
|
|
126
|
+
{
|
|
127
|
+
type: "button",
|
|
128
|
+
role: "tab",
|
|
129
|
+
"aria-selected": value.kind === kind,
|
|
130
|
+
onClick: () => setMode(kind),
|
|
131
|
+
className: cn(
|
|
132
|
+
"cursor-pointer rounded border px-3 py-1 text-sm capitalize",
|
|
133
|
+
value.kind === kind ? "border-primary bg-primary text-primary-contrast" : "border-base-200 text-base-contrast"
|
|
134
|
+
),
|
|
135
|
+
children: kind === "external" ? "External URL" : "Internal page"
|
|
136
|
+
},
|
|
137
|
+
kind
|
|
138
|
+
)) }),
|
|
139
|
+
value.kind === "external" ? /* @__PURE__ */ jsx4(
|
|
140
|
+
Input,
|
|
141
|
+
{
|
|
142
|
+
label: "URL",
|
|
143
|
+
value: value.href,
|
|
144
|
+
placeholder: "https://...",
|
|
145
|
+
onChange: (href) => onChange({ kind: "external", href, target: value.target })
|
|
146
|
+
}
|
|
147
|
+
) : /* @__PURE__ */ jsxs3(Fragment, { children: [
|
|
148
|
+
/* @__PURE__ */ jsx4(
|
|
149
|
+
Select,
|
|
150
|
+
{
|
|
151
|
+
label: "Page",
|
|
152
|
+
value: value.pageId,
|
|
153
|
+
options: [{ label: "Select a page\u2026", value: "" }, ...pages.map((p) => ({ label: p.title, value: p.id }))],
|
|
154
|
+
onChange: (pid) => onChange({ kind: "internal", pageId: pid, anchorSectionId: null, target: value.target })
|
|
155
|
+
}
|
|
156
|
+
),
|
|
157
|
+
/* @__PURE__ */ jsx4(
|
|
158
|
+
Select,
|
|
159
|
+
{
|
|
160
|
+
label: "Section",
|
|
161
|
+
value: value.anchorSectionId ?? "",
|
|
162
|
+
disabled: !pageId,
|
|
163
|
+
options: [{ label: "None (top of page)", value: "" }, ...headings.map((h) => ({ label: h.label, value: h.id }))],
|
|
164
|
+
onChange: (anchor) => onChange({ kind: "internal", pageId, anchorSectionId: anchor || null, target: value.target })
|
|
165
|
+
}
|
|
166
|
+
)
|
|
167
|
+
] }),
|
|
168
|
+
value.kind === "external" && /* @__PURE__ */ jsx4(
|
|
169
|
+
Select,
|
|
170
|
+
{
|
|
171
|
+
label: "Opens in",
|
|
172
|
+
value: value.target,
|
|
173
|
+
options: TARGET_OPTIONS,
|
|
174
|
+
onChange: (t) => onChange({ ...value, target: t })
|
|
175
|
+
}
|
|
176
|
+
)
|
|
177
|
+
] });
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
// src/components/shell/MediaLibraryContext.tsx
|
|
181
|
+
import { createContext as createContext2, useContext as useContext2 } from "react";
|
|
182
|
+
var MediaLibraryContext = createContext2(null);
|
|
183
|
+
function useMediaLibrary() {
|
|
184
|
+
return useContext2(MediaLibraryContext);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
// src/hooks/useResolvedMedia.ts
|
|
188
|
+
import { useMemo } from "react";
|
|
189
|
+
function useResolvedMedia(imageId) {
|
|
190
|
+
const ctx = useMediaLibrary();
|
|
191
|
+
return useMemo(() => {
|
|
192
|
+
if (!imageId || !ctx) {
|
|
193
|
+
return { src: void 0, srcset: void 0, poster: void 0, alt: "", kind: "image" };
|
|
194
|
+
}
|
|
195
|
+
const { manifest, pendingItems, pendingLocalUrls, siteConfig } = ctx;
|
|
196
|
+
const sizes = siteConfig?.media?.sizes ?? [640, 1080, 1920];
|
|
197
|
+
const manifestItem = manifest.images[imageId];
|
|
198
|
+
const pendingItem = pendingItems.find((i) => i.id === imageId);
|
|
199
|
+
const item = manifestItem ?? pendingItem;
|
|
200
|
+
const alt = item?.alt ?? "";
|
|
201
|
+
const kind = item?.kind ?? "image";
|
|
202
|
+
const width = item?.width;
|
|
203
|
+
const height = item?.height;
|
|
204
|
+
const localUrl = pendingLocalUrls[imageId];
|
|
205
|
+
if (localUrl) {
|
|
206
|
+
return { src: localUrl, srcset: void 0, poster: void 0, alt, kind, width, height };
|
|
207
|
+
}
|
|
208
|
+
if (manifestItem) {
|
|
209
|
+
const provider = getMediaProvider();
|
|
210
|
+
const resolved = provider.resolve(manifestItem, sizes);
|
|
211
|
+
if (resolved && resolved.tag === "img") {
|
|
212
|
+
return {
|
|
213
|
+
src: resolved.src,
|
|
214
|
+
srcset: "srcSet" in resolved ? resolved.srcSet : void 0,
|
|
215
|
+
poster: void 0,
|
|
216
|
+
alt,
|
|
217
|
+
kind,
|
|
218
|
+
width: resolved.width,
|
|
219
|
+
height: resolved.height
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
if (resolved && resolved.tag === "video") {
|
|
223
|
+
return { src: resolved.src, srcset: void 0, poster: resolved.poster, alt, kind, width: resolved.width, height: resolved.height };
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
return { src: void 0, srcset: void 0, poster: void 0, alt, kind, width, height };
|
|
227
|
+
}, [imageId, ctx]);
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
// src/components/shared/icons.tsx
|
|
231
|
+
import { GripVertical } from "lucide-react";
|
|
232
|
+
import { GripVertical as GripVertical2, Plus, Trash2, X, Settings } from "lucide-react";
|
|
233
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
234
|
+
function DragHandle({ size = 16 }) {
|
|
235
|
+
return /* @__PURE__ */ jsx5(GripVertical, { size });
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
// src/components/editor/DropEdgeIndicator.tsx
|
|
239
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
240
|
+
function DropEdgeIndicator({
|
|
241
|
+
edge,
|
|
242
|
+
inset = false,
|
|
243
|
+
style
|
|
244
|
+
}) {
|
|
245
|
+
if (!edge) return null;
|
|
246
|
+
const horizontal = edge === "top" || edge === "bottom";
|
|
247
|
+
return /* @__PURE__ */ jsx6(
|
|
248
|
+
"div",
|
|
249
|
+
{
|
|
250
|
+
"data-drop-edge": edge,
|
|
251
|
+
className: cn(
|
|
252
|
+
"absolute z-10 bg-primary",
|
|
253
|
+
horizontal ? cn("right-0 h-0.5", inset ? "left-6" : "left-0") : "top-0 bottom-0 w-0.5",
|
|
254
|
+
edge === "top" && "top-0 -translate-y-1/2",
|
|
255
|
+
edge === "bottom" && "bottom-0 translate-y-1/2",
|
|
256
|
+
edge === "left" && "left-0 -translate-x-1",
|
|
257
|
+
edge === "right" && "right-0 translate-x-1"
|
|
258
|
+
),
|
|
259
|
+
style
|
|
260
|
+
}
|
|
261
|
+
);
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
export {
|
|
265
|
+
PagesContext,
|
|
266
|
+
usePages,
|
|
267
|
+
useMediaLibrary,
|
|
268
|
+
useResolvedMedia,
|
|
269
|
+
DragHandle,
|
|
270
|
+
DropEdgeIndicator,
|
|
271
|
+
FormLabel,
|
|
272
|
+
Input,
|
|
273
|
+
Select,
|
|
274
|
+
LinkField
|
|
275
|
+
};
|