@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
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
|
+
SummaryAnchorsContext,
|
|
2
3
|
brandGuideSectionDefs,
|
|
3
4
|
pluralize,
|
|
4
5
|
stripHtmlToPlainText,
|
|
5
6
|
truncate
|
|
6
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-N3G7DOU3.js";
|
|
7
8
|
import {
|
|
8
9
|
DeleteButton,
|
|
9
10
|
DragHandle,
|
|
@@ -12,13 +13,19 @@ import {
|
|
|
12
13
|
buildBlockDragData,
|
|
13
14
|
buildBlockDropData,
|
|
14
15
|
canDropBlock,
|
|
15
|
-
isBlockDragData
|
|
16
|
-
|
|
16
|
+
isBlockDragData,
|
|
17
|
+
useOptionalEditorContext
|
|
18
|
+
} from "./chunk-PLANHXS7.js";
|
|
19
|
+
import {
|
|
20
|
+
Checkbox,
|
|
21
|
+
CheckboxBox,
|
|
22
|
+
Tabs
|
|
23
|
+
} from "./chunk-JR24U7FJ.js";
|
|
17
24
|
import {
|
|
18
25
|
EditableRichText,
|
|
19
26
|
defineHeadingSection,
|
|
20
27
|
useSanitizedHtml
|
|
21
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-PZPGJZRG.js";
|
|
22
29
|
import {
|
|
23
30
|
EditablePlainText,
|
|
24
31
|
ImageDropZone,
|
|
@@ -28,20 +35,30 @@ import {
|
|
|
28
35
|
containerGridClass,
|
|
29
36
|
masonryColumnsClass,
|
|
30
37
|
spacerHiddenClass
|
|
31
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-Y5QECJX7.js";
|
|
32
39
|
import {
|
|
40
|
+
DropEdgeIndicator,
|
|
33
41
|
useMediaLibrary,
|
|
34
42
|
useResolvedMedia
|
|
35
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-5KSAS4VY.js";
|
|
36
44
|
import {
|
|
37
45
|
Kbd,
|
|
38
46
|
Popover,
|
|
39
47
|
PopoverItem,
|
|
40
48
|
Tooltip
|
|
41
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-JCDZAFX2.js";
|
|
50
|
+
import {
|
|
51
|
+
Button
|
|
52
|
+
} from "./chunk-GGYY3JQJ.js";
|
|
42
53
|
import {
|
|
43
54
|
embedUrl
|
|
44
55
|
} from "./chunk-Y4JQGO6G.js";
|
|
56
|
+
import {
|
|
57
|
+
getMediaProvider
|
|
58
|
+
} from "./chunk-QHMKIODQ.js";
|
|
59
|
+
import {
|
|
60
|
+
referenceItems
|
|
61
|
+
} from "./chunk-VUYCRBJK.js";
|
|
45
62
|
import {
|
|
46
63
|
duplicateChildAt,
|
|
47
64
|
isSpacer,
|
|
@@ -49,10 +66,22 @@ import {
|
|
|
49
66
|
removeChildAt,
|
|
50
67
|
setChildColSpan,
|
|
51
68
|
trimTrailingSpacers
|
|
52
|
-
} from "./chunk-
|
|
69
|
+
} from "./chunk-L45X7DKX.js";
|
|
53
70
|
import {
|
|
54
71
|
cn
|
|
55
72
|
} from "./chunk-7EOSDFS3.js";
|
|
73
|
+
import {
|
|
74
|
+
siteTags,
|
|
75
|
+
tagDisplayLabel
|
|
76
|
+
} from "./chunk-OAGJBCSH.js";
|
|
77
|
+
import {
|
|
78
|
+
audiencePasses,
|
|
79
|
+
pageDisplayTitle,
|
|
80
|
+
pagesInNavOrder
|
|
81
|
+
} from "./chunk-IP2SEBAJ.js";
|
|
82
|
+
import {
|
|
83
|
+
REFERENCE_TYPE
|
|
84
|
+
} from "./chunk-5GFACGSN.js";
|
|
56
85
|
import {
|
|
57
86
|
getSectionSchema
|
|
58
87
|
} from "./chunk-DMCGN5AS.js";
|
|
@@ -61,8 +90,9 @@ import {
|
|
|
61
90
|
getSection
|
|
62
91
|
} from "./chunk-FTPETWXE.js";
|
|
63
92
|
import {
|
|
93
|
+
ImageBackgroundSchema,
|
|
64
94
|
SingleMediaReferenceSchema
|
|
65
|
-
} from "./chunk-
|
|
95
|
+
} from "./chunk-AASEGXNT.js";
|
|
66
96
|
import {
|
|
67
97
|
DEFAULT_LINK,
|
|
68
98
|
LinkValueSchema
|
|
@@ -181,7 +211,10 @@ var schema2 = z2.object({
|
|
|
181
211
|
square: z2.boolean().describe("When true, crop the media to a 1:1 square aspect ratio.").optional(),
|
|
182
212
|
showCaption: z2.boolean().describe("When true, render the asset's caption beneath it.").optional(),
|
|
183
213
|
border: z2.boolean().describe("When true, draw a border around the media.").optional(),
|
|
184
|
-
objectFit: z2.enum(["cover", "contain"]).describe("How the image fills its box: 'contain' (fit whole image) or 'cover' (fill and crop).").optional()
|
|
214
|
+
objectFit: z2.enum(["cover", "contain"]).describe("How the image fills its box: 'contain' (fit whole image) or 'cover' (fill and crop).").optional(),
|
|
215
|
+
background: ImageBackgroundSchema.describe(
|
|
216
|
+
"Optional backdrop filling the image box, for images that need contrast (e.g. a white transparent logo). 'theme' picks the site's light or dark surface separately for light and dark mode; 'custom' uses one hex for both. Images only \u2014 ignored for video. Omit for none."
|
|
217
|
+
).optional()
|
|
185
218
|
}).default({})
|
|
186
219
|
});
|
|
187
220
|
var Media_default = defineSection({
|
|
@@ -220,11 +253,16 @@ var Media_default = defineSection({
|
|
|
220
253
|
{ label: "Cover", value: "cover" }
|
|
221
254
|
]
|
|
222
255
|
},
|
|
256
|
+
background: {
|
|
257
|
+
type: "image-background",
|
|
258
|
+
label: "Image background",
|
|
259
|
+
hidden: (values) => values.ref?.type === "video"
|
|
260
|
+
},
|
|
223
261
|
link: { type: "link", label: "Link", default: DEFAULT_LINK, target: "content" }
|
|
224
262
|
},
|
|
225
263
|
inheritableSettings: ["square", "showCaption", "border", "objectFit"],
|
|
226
264
|
settingsTabs: [
|
|
227
|
-
{ label: "Display", fields: ["square", "showCaption", "border", "objectFit"] },
|
|
265
|
+
{ label: "Display", fields: ["square", "showCaption", "border", "objectFit", "background"] },
|
|
228
266
|
{ label: "Link", fields: ["link"] }
|
|
229
267
|
]
|
|
230
268
|
});
|
|
@@ -408,7 +446,7 @@ import { RectangleHorizontal } from "lucide-react";
|
|
|
408
446
|
// src/components/sections/Button/CTAButton.tsx
|
|
409
447
|
import { Download } from "lucide-react";
|
|
410
448
|
import { jsx as jsx9, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
411
|
-
function
|
|
449
|
+
function Button2({ text, link, download, onChange }) {
|
|
412
450
|
const base = "inline-block rounded-outer px-6 py-3 font-bold transition-colors";
|
|
413
451
|
const variant = "border-2 border-primary text-primary hover:bg-primary hover:text-primary-contrast";
|
|
414
452
|
if (onChange) {
|
|
@@ -443,7 +481,7 @@ function Button({ text, link, download, onChange }) {
|
|
|
443
481
|
}
|
|
444
482
|
);
|
|
445
483
|
}
|
|
446
|
-
return /* @__PURE__ */ jsx9("
|
|
484
|
+
return /* @__PURE__ */ jsx9("span", { className: cn(base, variant), children: text });
|
|
447
485
|
}
|
|
448
486
|
|
|
449
487
|
// src/components/sections/Button/index.tsx
|
|
@@ -465,7 +503,7 @@ var Button_default = defineSection({
|
|
|
465
503
|
schema: schema4,
|
|
466
504
|
authoringNote: "A call-to-action button linking to an internal page or external URL, optionally as a file download. Use for a single prominent action.",
|
|
467
505
|
component: ({ content, onChange }) => /* @__PURE__ */ jsx10(
|
|
468
|
-
|
|
506
|
+
Button2,
|
|
469
507
|
{
|
|
470
508
|
text: content.content.text,
|
|
471
509
|
link: content.content.link,
|
|
@@ -600,22 +638,13 @@ var ChildBlockWrapper = forwardRef(
|
|
|
600
638
|
]
|
|
601
639
|
}
|
|
602
640
|
),
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
{
|
|
606
|
-
"data-drop-edge": "left",
|
|
607
|
-
className: "absolute bottom-0 left-0 top-0 z-10 w-0.5 -translate-x-1 bg-primary"
|
|
608
|
-
}
|
|
609
|
-
),
|
|
610
|
-
closestEdge === "right" && /* @__PURE__ */ jsx12(
|
|
611
|
-
"div",
|
|
641
|
+
/* @__PURE__ */ jsx12(
|
|
642
|
+
DropEdgeIndicator,
|
|
612
643
|
{
|
|
613
|
-
|
|
614
|
-
|
|
644
|
+
edge: closestEdge,
|
|
645
|
+
style: closestEdge === "top" ? { transform: "translateY(-0.25rem)" } : closestEdge === "bottom" ? { transform: "translateY(0.25rem)" } : void 0
|
|
615
646
|
}
|
|
616
647
|
),
|
|
617
|
-
closestEdge === "top" && /* @__PURE__ */ jsx12("div", { "data-drop-edge": "top", className: "absolute left-0 right-0 top-0 z-10 h-0.5 -translate-y-1 bg-primary" }),
|
|
618
|
-
closestEdge === "bottom" && /* @__PURE__ */ jsx12("div", { "data-drop-edge": "bottom", className: "absolute left-0 right-0 bottom-0 z-10 h-0.5 translate-y-1 bg-primary" }),
|
|
619
648
|
children
|
|
620
649
|
]
|
|
621
650
|
}
|
|
@@ -1261,6 +1290,356 @@ var Spacer_default = defineSection({
|
|
|
1261
1290
|
defaults: () => ({ type: "spacer", content: {} })
|
|
1262
1291
|
});
|
|
1263
1292
|
|
|
1293
|
+
// src/components/sections/Reference/index.tsx
|
|
1294
|
+
import { z as z7 } from "zod";
|
|
1295
|
+
import { Copy } from "lucide-react";
|
|
1296
|
+
|
|
1297
|
+
// src/components/sections/Reference/ReferenceList.tsx
|
|
1298
|
+
import { useContext, useMemo } from "react";
|
|
1299
|
+
import { ArrowUpRight } from "lucide-react";
|
|
1300
|
+
|
|
1301
|
+
// src/components/shared/ReferenceSourcesContext.ts
|
|
1302
|
+
import { createContext } from "react";
|
|
1303
|
+
var ReferenceSourcesContext = createContext(null);
|
|
1304
|
+
|
|
1305
|
+
// src/components/sections/Reference/ReferenceList.tsx
|
|
1306
|
+
import { jsx as jsx18, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1307
|
+
var EXCLUSIONS = {
|
|
1308
|
+
missing: {
|
|
1309
|
+
reason: (i) => `Not found \u2014 deleted, unreadable, or not a top-level section (${i.sectionId})`,
|
|
1310
|
+
renders: false,
|
|
1311
|
+
inPreview: () => false
|
|
1312
|
+
},
|
|
1313
|
+
reference: { reason: () => "Another Reference \u2014 never shown", renders: false, inPreview: () => false },
|
|
1314
|
+
"archived-page": { reason: () => "On an archived page", renders: true, inPreview: () => false },
|
|
1315
|
+
"not-live": {
|
|
1316
|
+
reason: (i) => i.source?.meta.status === "archived" ? "Archived section" : "Draft \u2014 publish it to show it here",
|
|
1317
|
+
renders: true,
|
|
1318
|
+
// The Unpublished preview dims drafts and hides archived sections.
|
|
1319
|
+
inPreview: (i, viewBranch) => viewBranch === "saved" && i.source?.meta.status === "draft"
|
|
1320
|
+
}
|
|
1321
|
+
};
|
|
1322
|
+
var shownInPreview = (item, viewBranch) => item.excluded === null || EXCLUSIONS[item.excluded].inPreview(item, viewBranch);
|
|
1323
|
+
var NO_SUMMARY_ANCHORS = {};
|
|
1324
|
+
function ReferenceList({ referenceId, content, isEditMode }) {
|
|
1325
|
+
const sources = useContext(ReferenceSourcesContext);
|
|
1326
|
+
const editor = useOptionalEditorContext();
|
|
1327
|
+
const viewBranch = editor?.viewBranch ?? "saved";
|
|
1328
|
+
const previewAudience = editor?.previewAudience ?? null;
|
|
1329
|
+
const model = useMemo(() => {
|
|
1330
|
+
if (!sources) return null;
|
|
1331
|
+
const { index, sections, audiences } = sources;
|
|
1332
|
+
const page = index.pages.find((p) => p.order.includes(referenceId));
|
|
1333
|
+
const access = index.sections[referenceId]?.access ?? [];
|
|
1334
|
+
const viewers = audiences.filter((a) => audiencePasses(page?.access ?? [], a.name) && audiencePasses(access, a.name));
|
|
1335
|
+
const items = referenceItems({
|
|
1336
|
+
referenceId,
|
|
1337
|
+
content,
|
|
1338
|
+
index,
|
|
1339
|
+
allSections: sections,
|
|
1340
|
+
audiences: viewers.map((a) => a.name)
|
|
1341
|
+
});
|
|
1342
|
+
return {
|
|
1343
|
+
items,
|
|
1344
|
+
// Copies carry the page-wide anchors the editor nav links to, so no
|
|
1345
|
+
// heading here duplicates its source's DOM id or another Reference's.
|
|
1346
|
+
copyById: sources.copies[referenceId] ?? {},
|
|
1347
|
+
displayName: new Map(viewers.map((a) => [a.name, a.displayName])),
|
|
1348
|
+
viewerCount: viewers.length,
|
|
1349
|
+
// The site has audiences, yet none passes both the page's access and the
|
|
1350
|
+
// Reference's own: no one can ever see a copy here. (Empty access is
|
|
1351
|
+
// "everyone", so an unrestricted page or Reference never lands here.)
|
|
1352
|
+
noViewers: audiences.length > 0 && viewers.length === 0,
|
|
1353
|
+
// Absent `tags` is "not loaded": tagged sections can't be listed yet.
|
|
1354
|
+
tagsUnloaded: index.tags === void 0 && content.tagIds.length > 0
|
|
1355
|
+
};
|
|
1356
|
+
}, [sources, referenceId, content]);
|
|
1357
|
+
if (!sources || !model) {
|
|
1358
|
+
return isEditMode ? /* @__PURE__ */ jsx18(Placeholder, { children: "Reference: shown as live copies on the published site." }) : null;
|
|
1359
|
+
}
|
|
1360
|
+
const shown = isEditMode ? model.items : model.items.filter((item) => shownInPreview(item, viewBranch));
|
|
1361
|
+
const notes = [
|
|
1362
|
+
model.tagsUnloaded && "Tags haven't loaded, so tagged sections aren't listed yet.",
|
|
1363
|
+
model.noViewers && "No audience can see this Reference on this page"
|
|
1364
|
+
].filter((n) => !!n);
|
|
1365
|
+
if (shown.length === 0) {
|
|
1366
|
+
if (!isEditMode) return null;
|
|
1367
|
+
if (notes.length === 0) return /* @__PURE__ */ jsx18(Placeholder, { children: "Reference: no tags or sections chosen yet." });
|
|
1368
|
+
return /* @__PURE__ */ jsx18(Placeholder, { children: ["Reference: nothing to show.", ...notes].join(" ") });
|
|
1369
|
+
}
|
|
1370
|
+
return (
|
|
1371
|
+
// The page's summary anchors are keyed by section id, so a copy of a
|
|
1372
|
+
// summary also on this page would take its native anchor; emptying the
|
|
1373
|
+
// context leaves every copy on the anchor stamped for it.
|
|
1374
|
+
/* @__PURE__ */ jsx18(SummaryAnchorsContext.Provider, { value: NO_SUMMARY_ANCHORS, children: shown.map((item, n) => {
|
|
1375
|
+
const { source } = item;
|
|
1376
|
+
const exclusion = item.excluded ? EXCLUSIONS[item.excluded] : null;
|
|
1377
|
+
const drawn = source && (!exclusion || exclusion.renders) ? source : null;
|
|
1378
|
+
const definition = source ? getSection(source.section.type) : void 0;
|
|
1379
|
+
const copy = drawn ? model.copyById[item.sectionId] ?? drawn.section : null;
|
|
1380
|
+
const Component = definition?.component;
|
|
1381
|
+
const reason = exclusion?.reason(item) ?? null;
|
|
1382
|
+
const hiddenForAll = model.noViewers || model.viewerCount > 0 && item.hiddenFrom.length === model.viewerCount;
|
|
1383
|
+
const previewHidden = previewAudience !== null && !!source && (!audiencePasses(item.page?.access ?? [], previewAudience) || !audiencePasses(source.meta.access, previewAudience));
|
|
1384
|
+
const typeLabel = definition?.label ?? source?.section.type ?? "Section";
|
|
1385
|
+
const label = source && definition?.getLabel?.(source.section) || typeLabel;
|
|
1386
|
+
return /* @__PURE__ */ jsx18("div", { className: cn(n > 0 && "pt-9"), children: /* @__PURE__ */ jsxs7(
|
|
1387
|
+
"div",
|
|
1388
|
+
{
|
|
1389
|
+
"data-reference-item": item.sectionId,
|
|
1390
|
+
className: cn(
|
|
1391
|
+
// `group` mirrors the viewer's per-section wrapper for the copy's
|
|
1392
|
+
// own hover styles; `group/copy` scopes Edit source to this copy,
|
|
1393
|
+
// since the Reference's wrapper is a `group` too.
|
|
1394
|
+
"group group/copy relative",
|
|
1395
|
+
isEditMode && "rounded-outer hover:outline hover:outline-1 hover:outline-dashed hover:outline-primary/40",
|
|
1396
|
+
previewHidden ? "opacity-15 transition-opacity duration-200 hover:opacity-100" : (isEditMode ? reason || hiddenForAll : item.excluded) && "opacity-50"
|
|
1397
|
+
),
|
|
1398
|
+
children: [
|
|
1399
|
+
/* @__PURE__ */ jsxs7("div", { inert: isEditMode, children: [
|
|
1400
|
+
!copy && /* @__PURE__ */ jsx18("div", { className: "min-h-20 rounded-md border-2 border-dashed" }),
|
|
1401
|
+
copy && Component && /* @__PURE__ */ jsx18(
|
|
1402
|
+
Component,
|
|
1403
|
+
{
|
|
1404
|
+
content: copy,
|
|
1405
|
+
options: "options" in copy ? copy.options : void 0,
|
|
1406
|
+
isEditMode: false
|
|
1407
|
+
}
|
|
1408
|
+
)
|
|
1409
|
+
] }),
|
|
1410
|
+
isEditMode && /* @__PURE__ */ jsxs7("div", { className: "absolute right-2 top-2 z-20 flex max-w-[calc(100%-1rem)] flex-wrap items-center justify-end gap-1", children: [
|
|
1411
|
+
n === 0 && notes.map((note) => /* @__PURE__ */ jsx18(Badge, { children: note }, note)),
|
|
1412
|
+
reason && /* @__PURE__ */ jsx18(Badge, { children: reason }),
|
|
1413
|
+
!reason && hiddenForAll && !model.noViewers && /* @__PURE__ */ jsx18(Badge, { children: "Hidden for all of this page's audiences" }),
|
|
1414
|
+
!reason && !hiddenForAll && item.hiddenFrom.length > 0 && /* @__PURE__ */ jsx18(Badge, { children: `Hidden from ${item.hiddenFrom.map((a) => model.displayName.get(a) ?? a).join(", ")}` }),
|
|
1415
|
+
source && /* @__PURE__ */ jsxs7("span", { className: "flex items-center gap-2 rounded-full border border-base-200 bg-base px-2 py-0.5 text-xs opacity-0 shadow-sm transition-opacity focus-within:opacity-100 group-hover/copy:opacity-100", children: [
|
|
1416
|
+
/* @__PURE__ */ jsxs7("span", { className: "max-w-56 truncate text-base-contrast-light", children: [
|
|
1417
|
+
item.page ? `${pageDisplayTitle(item.page.title)} \xB7 ` : "",
|
|
1418
|
+
label
|
|
1419
|
+
] }),
|
|
1420
|
+
/* @__PURE__ */ jsxs7(Button, { variant: "ghost", className: "inline-flex items-center gap-0.5", onClick: () => sources.jumpToSection(item.sectionId), children: [
|
|
1421
|
+
"Edit source ",
|
|
1422
|
+
/* @__PURE__ */ jsx18(ArrowUpRight, { size: 12, "aria-hidden": "true" })
|
|
1423
|
+
] })
|
|
1424
|
+
] })
|
|
1425
|
+
] })
|
|
1426
|
+
]
|
|
1427
|
+
}
|
|
1428
|
+
) }, item.sectionId);
|
|
1429
|
+
}) })
|
|
1430
|
+
);
|
|
1431
|
+
}
|
|
1432
|
+
function Badge({ children }) {
|
|
1433
|
+
return /* @__PURE__ */ jsx18("span", { className: "rounded-full border border-warning bg-warning-bg px-2 py-0.5 text-xs text-warning shadow-sm", children });
|
|
1434
|
+
}
|
|
1435
|
+
function Placeholder({ children }) {
|
|
1436
|
+
return /* @__PURE__ */ jsx18("div", { className: "flex min-h-20 items-center justify-center rounded-md border-2 border-dashed px-4 text-center text-xs text-base-contrast-light/50", children });
|
|
1437
|
+
}
|
|
1438
|
+
|
|
1439
|
+
// src/components/sections/Reference/ReferenceSettings.tsx
|
|
1440
|
+
import { useContext as useContext2, useState as useState4 } from "react";
|
|
1441
|
+
|
|
1442
|
+
// src/lib/thumb-views.ts
|
|
1443
|
+
function resolveThumbnailSrc(thumb, manifest) {
|
|
1444
|
+
const item = manifest.images[thumb.src];
|
|
1445
|
+
if (!item) return null;
|
|
1446
|
+
const resolved = getMediaProvider().resolve(item, [200]);
|
|
1447
|
+
if (!resolved) return null;
|
|
1448
|
+
return resolved.tag === "img" || resolved.tag === "video" ? resolved.src : null;
|
|
1449
|
+
}
|
|
1450
|
+
function toThumbViews(thumbnails, manifest) {
|
|
1451
|
+
return thumbnails.map(
|
|
1452
|
+
(thumb) => thumb.type === "color" ? { kind: "color", value: thumb.value } : { kind: "image", src: resolveThumbnailSrc(thumb, manifest), alt: thumb.alt ?? "" }
|
|
1453
|
+
);
|
|
1454
|
+
}
|
|
1455
|
+
|
|
1456
|
+
// src/components/shared/SectionSummaryRow.tsx
|
|
1457
|
+
import { jsx as jsx19, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1458
|
+
var MAX_THUMBS = 3;
|
|
1459
|
+
function SectionSummaryRow({ label, typeLabel, thumbnails, muted, trailing, className }) {
|
|
1460
|
+
const shown = thumbnails.slice(0, MAX_THUMBS);
|
|
1461
|
+
const remaining = Math.max(0, thumbnails.length - MAX_THUMBS);
|
|
1462
|
+
return /* @__PURE__ */ jsxs8("div", { className: cn(
|
|
1463
|
+
"flex min-w-0 flex-1 items-center gap-3 rounded-md border border-base-200 bg-base px-3 py-2",
|
|
1464
|
+
muted && "opacity-50",
|
|
1465
|
+
className
|
|
1466
|
+
), children: [
|
|
1467
|
+
/* @__PURE__ */ jsxs8("div", { className: "min-w-0 flex-1", children: [
|
|
1468
|
+
/* @__PURE__ */ jsx19("div", { className: "text-xs text-base-contrast-light", children: typeLabel }),
|
|
1469
|
+
/* @__PURE__ */ jsx19("div", { className: "truncate text-sm font-medium text-base-contrast", children: label })
|
|
1470
|
+
] }),
|
|
1471
|
+
trailing,
|
|
1472
|
+
shown.length > 0 && /* @__PURE__ */ jsxs8("div", { className: "flex items-center -space-x-2", children: [
|
|
1473
|
+
shown.map(
|
|
1474
|
+
(thumb, i) => thumb.kind === "color" ? /* @__PURE__ */ jsx19(
|
|
1475
|
+
"div",
|
|
1476
|
+
{
|
|
1477
|
+
className: "h-8 w-8 rounded border-2 border-base",
|
|
1478
|
+
style: { backgroundColor: thumb.value }
|
|
1479
|
+
},
|
|
1480
|
+
i
|
|
1481
|
+
) : thumb.src ? /* @__PURE__ */ jsx19(
|
|
1482
|
+
"img",
|
|
1483
|
+
{
|
|
1484
|
+
src: thumb.src,
|
|
1485
|
+
alt: thumb.alt,
|
|
1486
|
+
className: "h-8 w-8 rounded border-2 border-base object-cover"
|
|
1487
|
+
},
|
|
1488
|
+
i
|
|
1489
|
+
) : /* @__PURE__ */ jsx19("div", { className: "h-8 w-8 rounded border-2 border-base bg-base-accent" }, i)
|
|
1490
|
+
),
|
|
1491
|
+
remaining > 0 && /* @__PURE__ */ jsxs8("div", { className: "ml-1 flex h-8 w-8 items-center justify-center rounded border-2 border-base bg-base-accent text-xs text-base-contrast-light", children: [
|
|
1492
|
+
"+",
|
|
1493
|
+
remaining
|
|
1494
|
+
] })
|
|
1495
|
+
] })
|
|
1496
|
+
] });
|
|
1497
|
+
}
|
|
1498
|
+
|
|
1499
|
+
// src/components/sections/Reference/ReferenceSettings.tsx
|
|
1500
|
+
import { Fragment as Fragment3, jsx as jsx20, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1501
|
+
var panel = "flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto px-px";
|
|
1502
|
+
function ReferenceSettings({
|
|
1503
|
+
tagIds = [],
|
|
1504
|
+
sectionIds = [],
|
|
1505
|
+
onChange
|
|
1506
|
+
}) {
|
|
1507
|
+
const sources = useContext2(ReferenceSourcesContext);
|
|
1508
|
+
const [v, setV] = useState4({ tagIds, sectionIds });
|
|
1509
|
+
const update = (next) => {
|
|
1510
|
+
setV(next);
|
|
1511
|
+
onChange({ content: next });
|
|
1512
|
+
};
|
|
1513
|
+
const toggle = (list, id, on) => on ? [...list, id] : list.filter((x) => x !== id);
|
|
1514
|
+
if (!sources) return null;
|
|
1515
|
+
const { index, sections, mediaManifest } = sources;
|
|
1516
|
+
const tagsLoaded = index.tags !== void 0;
|
|
1517
|
+
const tags = siteTags(index);
|
|
1518
|
+
const deletedTagIds = tagsLoaded ? v.tagIds.filter((id) => !tags.some((t) => t.id === id)) : [];
|
|
1519
|
+
const byId = new Map(sections.map((s) => [s.section.id, s]));
|
|
1520
|
+
const pageGroups = pagesInNavOrder(index).map((page) => ({
|
|
1521
|
+
page,
|
|
1522
|
+
rows: page.order.flatMap((id) => {
|
|
1523
|
+
const s = byId.get(id);
|
|
1524
|
+
return s && (s.section.type !== REFERENCE_TYPE || v.sectionIds.includes(id)) ? [s] : [];
|
|
1525
|
+
})
|
|
1526
|
+
})).filter((g) => g.rows.length > 0);
|
|
1527
|
+
const onAPage = new Set(pageGroups.flatMap((g) => g.rows.map((s) => s.section.id)));
|
|
1528
|
+
const deletedSectionIds = v.sectionIds.filter((id) => !onAPage.has(id));
|
|
1529
|
+
const tagsTab = /* @__PURE__ */ jsxs9("div", { className: panel, children: [
|
|
1530
|
+
!tagsLoaded && /* @__PURE__ */ jsx20("p", { className: "text-sm text-base-contrast-light", children: "Tags haven't loaded, so they can't be changed right now." }),
|
|
1531
|
+
tagsLoaded && tags.length === 0 && deletedTagIds.length === 0 && /* @__PURE__ */ jsx20("p", { className: "text-sm text-base-contrast-light", children: "No tags yet. Add them from a section's Tags pill or under Site settings \u2192 Tags." }),
|
|
1532
|
+
tags.map((t) => /* @__PURE__ */ jsx20(
|
|
1533
|
+
Checkbox,
|
|
1534
|
+
{
|
|
1535
|
+
label: tagDisplayLabel(t.label),
|
|
1536
|
+
description: pluralize(t.sectionIds.length, "section"),
|
|
1537
|
+
checked: v.tagIds.includes(t.id),
|
|
1538
|
+
onChange: (on) => update({ ...v, tagIds: toggle(v.tagIds, t.id, on) })
|
|
1539
|
+
},
|
|
1540
|
+
t.id
|
|
1541
|
+
)),
|
|
1542
|
+
deletedTagIds.map((id) => /* @__PURE__ */ jsx20(
|
|
1543
|
+
Checkbox,
|
|
1544
|
+
{
|
|
1545
|
+
label: "Deleted tag",
|
|
1546
|
+
description: "Shows nothing. Untick to remove it.",
|
|
1547
|
+
checked: true,
|
|
1548
|
+
onChange: () => update({ ...v, tagIds: toggle(v.tagIds, id, false) })
|
|
1549
|
+
},
|
|
1550
|
+
id
|
|
1551
|
+
))
|
|
1552
|
+
] });
|
|
1553
|
+
const sectionRow = (id, label, typeLabel, thumbs, status) => {
|
|
1554
|
+
const checked = v.sectionIds.includes(id);
|
|
1555
|
+
return /* @__PURE__ */ jsx20(
|
|
1556
|
+
"button",
|
|
1557
|
+
{
|
|
1558
|
+
type: "button",
|
|
1559
|
+
role: "checkbox",
|
|
1560
|
+
"aria-checked": checked,
|
|
1561
|
+
"aria-label": `${typeLabel}: ${label}`,
|
|
1562
|
+
onClick: () => update({ ...v, sectionIds: toggle(v.sectionIds, id, !checked) }),
|
|
1563
|
+
className: "flex w-full cursor-pointer text-left",
|
|
1564
|
+
children: /* @__PURE__ */ jsx20(
|
|
1565
|
+
SectionSummaryRow,
|
|
1566
|
+
{
|
|
1567
|
+
label,
|
|
1568
|
+
typeLabel,
|
|
1569
|
+
thumbnails: thumbs,
|
|
1570
|
+
className: cn(checked && "border-primary"),
|
|
1571
|
+
trailing: /* @__PURE__ */ jsxs9(Fragment3, { children: [
|
|
1572
|
+
status && status !== "live" && /* @__PURE__ */ jsx20("span", { className: "text-xs capitalize text-base-contrast-light", children: status }),
|
|
1573
|
+
/* @__PURE__ */ jsx20(CheckboxBox, { checked })
|
|
1574
|
+
] })
|
|
1575
|
+
}
|
|
1576
|
+
)
|
|
1577
|
+
},
|
|
1578
|
+
id
|
|
1579
|
+
);
|
|
1580
|
+
};
|
|
1581
|
+
const sectionsTab = /* @__PURE__ */ jsxs9("div", { className: panel, children: [
|
|
1582
|
+
pageGroups.map(({ page, rows }) => /* @__PURE__ */ jsxs9("section", { className: "flex flex-col gap-2", children: [
|
|
1583
|
+
/* @__PURE__ */ jsxs9("h3", { className: "text-xs font-medium uppercase tracking-wide text-base-contrast-light", children: [
|
|
1584
|
+
pageDisplayTitle(page.title),
|
|
1585
|
+
page.status === "archived" && " (archived)"
|
|
1586
|
+
] }),
|
|
1587
|
+
rows.map((s) => {
|
|
1588
|
+
const def = getSection(s.section.type);
|
|
1589
|
+
const typeLabel = def?.label ?? s.section.type;
|
|
1590
|
+
return sectionRow(
|
|
1591
|
+
s.section.id,
|
|
1592
|
+
def?.getLabel?.(s.section) ?? typeLabel,
|
|
1593
|
+
typeLabel,
|
|
1594
|
+
toThumbViews(def?.getThumbnails?.(s.section) ?? [], mediaManifest),
|
|
1595
|
+
s.meta.status
|
|
1596
|
+
);
|
|
1597
|
+
})
|
|
1598
|
+
] }, page.id)),
|
|
1599
|
+
deletedSectionIds.length > 0 && /* @__PURE__ */ jsxs9("section", { className: "flex flex-col gap-2", children: [
|
|
1600
|
+
/* @__PURE__ */ jsx20("h3", { className: "text-xs font-medium uppercase tracking-wide text-base-contrast-light", children: "Not found" }),
|
|
1601
|
+
deletedSectionIds.map((id) => sectionRow(id, "Section not found", "Deleted or can't be read", []))
|
|
1602
|
+
] })
|
|
1603
|
+
] });
|
|
1604
|
+
return /* @__PURE__ */ jsx20(
|
|
1605
|
+
Tabs,
|
|
1606
|
+
{
|
|
1607
|
+
fullBleedTabBar: true,
|
|
1608
|
+
tabs: [
|
|
1609
|
+
{ id: "tags", label: `Tags${v.tagIds.length ? ` (${v.tagIds.length})` : ""}`, content: tagsTab },
|
|
1610
|
+
{ id: "sections", label: `Sections${v.sectionIds.length ? ` (${v.sectionIds.length})` : ""}`, content: sectionsTab }
|
|
1611
|
+
]
|
|
1612
|
+
}
|
|
1613
|
+
);
|
|
1614
|
+
}
|
|
1615
|
+
|
|
1616
|
+
// src/components/sections/Reference/index.tsx
|
|
1617
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
1618
|
+
var schema7 = z7.object({
|
|
1619
|
+
type: z7.literal(REFERENCE_TYPE),
|
|
1620
|
+
content: z7.object({
|
|
1621
|
+
tagIds: z7.array(z7.string()).default([]).describe("Ids of tags from the site's tag registry (tags.json); every section carrying one of them is shown."),
|
|
1622
|
+
sectionIds: z7.array(z7.string()).default([]).describe("Ids of individually picked sections to show, from any page. Combined with the tagged sections as a union.")
|
|
1623
|
+
})
|
|
1624
|
+
});
|
|
1625
|
+
var Reference_default = defineSection({
|
|
1626
|
+
type: REFERENCE_TYPE,
|
|
1627
|
+
label: "Reference",
|
|
1628
|
+
icon: /* @__PURE__ */ jsx21(Copy, { size: 18 }),
|
|
1629
|
+
schema: schema7,
|
|
1630
|
+
authoringNote: "Shows read-only, live copies of other sections: every section carrying one of tagIds, plus every id in sectionIds (overlaps listed once). Resolved at render time from the published site, so edits to a source show up wherever it is referenced \u2014 never copy content to reuse it. Items are listed in site order (pages in nav order, then position on the page), whatever order the ids are stored in. Only live sections on live pages appear (hidden pages count, archived pages do not); a viewer sees an item only if they could see it on its own page, so a Reference never widens who sees what. References in the source set are skipped, itself included; containers come whole. Headings inside the copies join this page's nav, anchored <heading>-<this Reference's id>. Unknown ids and deleted tags drop silently on the viewer, but the MCP connector rejects them on save \u2014 create a tag (save_sections `tags`) before naming it. Top level only \u2014 not inside a container.",
|
|
1631
|
+
// Viewer paths never render this component: buildViewerPage replaces a
|
|
1632
|
+
// Reference with the sections it resolves to. The editor canvas renders the
|
|
1633
|
+
// same copies here, in edit mode and preview alike.
|
|
1634
|
+
component: ({ content, isEditMode }) => {
|
|
1635
|
+
const id = content.id ?? "";
|
|
1636
|
+
return /* @__PURE__ */ jsx21(ReferenceList, { referenceId: id, content: content.content, isEditMode });
|
|
1637
|
+
},
|
|
1638
|
+
settingsForm: ReferenceSettings,
|
|
1639
|
+
defaults: () => ({ type: REFERENCE_TYPE, content: { tagIds: [], sectionIds: [] } }),
|
|
1640
|
+
getLabel: () => "Reference"
|
|
1641
|
+
});
|
|
1642
|
+
|
|
1264
1643
|
// src/components/sections/core-sections.ts
|
|
1265
1644
|
var coreSectionDefs = [
|
|
1266
1645
|
LinkHeading_default,
|
|
@@ -1271,7 +1650,8 @@ var coreSectionDefs = [
|
|
|
1271
1650
|
Video_default,
|
|
1272
1651
|
Button_default,
|
|
1273
1652
|
Container_default,
|
|
1274
|
-
Spacer_default
|
|
1653
|
+
Spacer_default,
|
|
1654
|
+
Reference_default
|
|
1275
1655
|
];
|
|
1276
1656
|
|
|
1277
1657
|
// src/components/sections/all-sections.ts
|
|
@@ -26,7 +26,7 @@ var TextLineSchema = z.discriminatedUnion("type", [
|
|
|
26
26
|
var BaseMediaRef = z.object({
|
|
27
27
|
imageId: z.string().default("").describe("Media-library id of the image/video asset."),
|
|
28
28
|
caption: z.union([z.string(), z.array(z.string())]).optional().describe("Optional caption: a single string, or multiple lines as an array of strings."),
|
|
29
|
-
background: z.string().optional().describe("
|
|
29
|
+
background: z.string().optional().describe("Legacy; not rendered. For a backdrop behind a media section's image, use the section's options.background."),
|
|
30
30
|
invertFrom: z.string().optional().describe("Optional CSS color; the image inverts when the page background matches it (e.g. for dark-mode logo swaps)."),
|
|
31
31
|
border: z.boolean().optional().describe("When true, draw a border around the media."),
|
|
32
32
|
objectFit: z.enum(["cover", "contain"]).optional().describe("How the image fills its box: 'contain' (fit whole image) or 'cover' (fill and crop).")
|
|
@@ -59,6 +59,22 @@ var MediaReferenceSchema = z.discriminatedUnion("type", [
|
|
|
59
59
|
]);
|
|
60
60
|
var SingleMediaReferenceSchema = z.discriminatedUnion("type", [ImageRef, VideoRef]);
|
|
61
61
|
var HexColorSchema = z.string().regex(/^#[0-9a-fA-F]{6}$/, "must be a 6-digit hex color");
|
|
62
|
+
var ImageBackgroundSurfaceSchema = z.enum(["none", "light", "dark"]);
|
|
63
|
+
var ImageBackgroundSchema = z.discriminatedUnion("mode", [
|
|
64
|
+
z.object({
|
|
65
|
+
mode: z.literal("theme").describe("Pick a site surface separately for light and dark mode."),
|
|
66
|
+
light: ImageBackgroundSurfaceSchema.describe(
|
|
67
|
+
"Backdrop in light mode: 'none', the site's light surface, or its dark surface."
|
|
68
|
+
),
|
|
69
|
+
dark: ImageBackgroundSurfaceSchema.describe(
|
|
70
|
+
"Backdrop in dark mode: 'none', the site's light surface, or its dark surface."
|
|
71
|
+
)
|
|
72
|
+
}),
|
|
73
|
+
z.object({
|
|
74
|
+
mode: z.literal("custom").describe("Use one custom color in both modes."),
|
|
75
|
+
color: HexColorSchema.describe("One backdrop color for both light and dark mode, as a 6-digit hex.")
|
|
76
|
+
})
|
|
77
|
+
]);
|
|
62
78
|
var FontNameSchema = z.string().max(120).regex(/^[a-zA-Z0-9 ,'"-]+$/, "contains invalid font-name characters");
|
|
63
79
|
|
|
64
80
|
export {
|
|
@@ -66,5 +82,6 @@ export {
|
|
|
66
82
|
MediaReferenceSchema,
|
|
67
83
|
SingleMediaReferenceSchema,
|
|
68
84
|
HexColorSchema,
|
|
85
|
+
ImageBackgroundSchema,
|
|
69
86
|
FontNameSchema
|
|
70
87
|
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// src/lib/reorder.ts
|
|
2
|
+
function computeReorderTarget(fromIndex, overIndex, edge) {
|
|
3
|
+
let toIndex = overIndex;
|
|
4
|
+
if (edge === "bottom") toIndex = overIndex + 1;
|
|
5
|
+
if (fromIndex < toIndex) toIndex--;
|
|
6
|
+
return fromIndex === toIndex ? null : toIndex;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export {
|
|
10
|
+
computeReorderTarget
|
|
11
|
+
};
|