@drawnagency/primitives 0.1.112 → 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/auth/types.d.ts +1 -0
- package/dist/auth/types.d.ts.map +1 -1
- 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-5KNXTMUC.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-VLPELTPI.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-Z2LO4PSQ.js → chunk-N3G7DOU3.js} +609 -61
- package/dist/chunk-OAGJBCSH.js +67 -0
- package/dist/{chunk-VT3PYGVW.js → chunk-PLANHXS7.js} +191 -61
- package/dist/{chunk-OGGZ5AXT.js → chunk-PNSCDBU7.js} +38 -56
- package/dist/{chunk-HSXMOS5Q.js → chunk-PTY2RG2K.js} +5 -2
- package/dist/{chunk-EPWBPIV6.js → chunk-PZPGJZRG.js} +9 -8
- package/dist/{chunk-P3ZNCHW7.js → chunk-QHMKIODQ.js} +19 -5
- 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-3SZNUCXI.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 +1 -0
- 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/resolve.d.ts +2 -0
- package/dist/media/resolve.d.ts.map +1 -1
- package/dist/media/utils.d.ts +2 -0
- package/dist/media/utils.d.ts.map +1 -1
- package/dist/media/{videoPoster.d.ts → video-poster.d.ts} +1 -1
- package/dist/media/video-poster.d.ts.map +1 -0
- package/dist/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 +7 -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 +8 -0
- package/dist/types/database.d.ts.map +1 -1
- package/package.json +6 -1
- package/src/auth/cookies.ts +111 -0
- package/src/auth/types.ts +1 -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 +7 -7
- 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 +48 -35
- 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 +20 -21
- package/src/components/shell/SiteSettingsModal.tsx +24 -2
- package/src/components/shell/SiteSettingsTags.tsx +143 -0
- package/src/components/shell/SiteSettingsUsers.tsx +85 -28
- 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/resolve.ts +3 -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 +9 -1
- package/src/schemas/tags.ts +33 -0
- package/src/storage/types.ts +1 -1
- package/src/types/database.ts +6 -0
- package/dist/chunk-BR4MIPTM.js +0 -138
- package/dist/chunk-DNY72JZN.js +0 -86
- package/dist/chunk-F2LYQPXV.js +0 -77
- package/dist/chunk-TALRVOGO.js +0 -128
- 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,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
EditablePlainText
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-Y5QECJX7.js";
|
|
4
4
|
import {
|
|
5
5
|
usePages
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-5KSAS4VY.js";
|
|
7
7
|
import {
|
|
8
8
|
Button
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-GGYY3JQJ.js";
|
|
10
10
|
import {
|
|
11
11
|
toSectionId
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-VUYCRBJK.js";
|
|
13
13
|
import {
|
|
14
14
|
ensureSanitizer,
|
|
15
15
|
isSanitizerReady,
|
|
@@ -22,12 +22,12 @@ import {
|
|
|
22
22
|
defineSection
|
|
23
23
|
} from "./chunk-FTPETWXE.js";
|
|
24
24
|
|
|
25
|
-
// src/components/primitives/
|
|
25
|
+
// src/components/primitives/define-heading-section.tsx
|
|
26
26
|
import { z } from "zod";
|
|
27
27
|
|
|
28
28
|
// src/components/primitives/HeadingSection.tsx
|
|
29
29
|
import { jsx } from "react/jsx-runtime";
|
|
30
|
-
function HeadingSection({ heading, tag, placeholder, className, onChange }) {
|
|
30
|
+
function HeadingSection({ heading, tag, placeholder, className, anchor, onChange }) {
|
|
31
31
|
return /* @__PURE__ */ jsx(
|
|
32
32
|
EditablePlainText,
|
|
33
33
|
{
|
|
@@ -37,13 +37,13 @@ function HeadingSection({ heading, tag, placeholder, className, onChange }) {
|
|
|
37
37
|
}),
|
|
38
38
|
isEditMode: !!onChange,
|
|
39
39
|
placeholder,
|
|
40
|
-
id: toSectionId(heading),
|
|
40
|
+
id: anchor ?? toSectionId(heading),
|
|
41
41
|
className: cn("scroll-mt-20", className)
|
|
42
42
|
}
|
|
43
43
|
);
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
// src/components/primitives/
|
|
46
|
+
// src/components/primitives/define-heading-section.tsx
|
|
47
47
|
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
48
48
|
function defineHeadingSection(config) {
|
|
49
49
|
const heading = z.string().describe(
|
|
@@ -69,6 +69,7 @@ function defineHeadingSection(config) {
|
|
|
69
69
|
heading: content2.content.heading,
|
|
70
70
|
tag: config.tag,
|
|
71
71
|
placeholder: config.placeholder,
|
|
72
|
+
anchor: content2.navAnchor,
|
|
72
73
|
onChange: onChange ? (heading2) => onChange({ ...content2, content: { ...content2.content, heading: heading2 } }) : void 0
|
|
73
74
|
}
|
|
74
75
|
),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
slugifyPageSlug
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-IP2SEBAJ.js";
|
|
4
4
|
|
|
5
5
|
// src/media/utils.ts
|
|
6
6
|
async function hashFileBuffer(buffer) {
|
|
@@ -44,6 +44,17 @@ var EXT_TO_MIME = {
|
|
|
44
44
|
function mimeToExt(mime) {
|
|
45
45
|
return MIME_TO_EXT[mime] ?? "bin";
|
|
46
46
|
}
|
|
47
|
+
function mediaThumbnailUrl(item) {
|
|
48
|
+
if (item.mimeType === "image/svg+xml" || item.kind !== "image") {
|
|
49
|
+
return `/api/media/${item.id}/original.${mimeToExt(item.mimeType)}`;
|
|
50
|
+
}
|
|
51
|
+
if (item.variants.length === 0) return null;
|
|
52
|
+
const smallest = item.variants.reduce((a, b) => a.width < b.width ? a : b);
|
|
53
|
+
return `/api/media/${item.id}/${smallest.width}.webp`;
|
|
54
|
+
}
|
|
55
|
+
function imageThumbnailUrl(item) {
|
|
56
|
+
return item?.kind === "image" ? mediaThumbnailUrl(item) : null;
|
|
57
|
+
}
|
|
47
58
|
function displayFilenameExt(mime) {
|
|
48
59
|
const ext = MIME_TO_EXT[mime];
|
|
49
60
|
return ext ? `.${ext}` : "";
|
|
@@ -248,11 +259,12 @@ function resolveLogo(logo, manifest, provider) {
|
|
|
248
259
|
lightUrl: light.src,
|
|
249
260
|
darkUrl,
|
|
250
261
|
invertInDark: logo.invertInDark,
|
|
251
|
-
showInNav: logo.showInNav
|
|
262
|
+
showInNav: logo.showInNav,
|
|
263
|
+
hideTitle: logo.hideTitle
|
|
252
264
|
};
|
|
253
265
|
}
|
|
254
266
|
|
|
255
|
-
// src/media/
|
|
267
|
+
// src/media/video-poster.ts
|
|
256
268
|
function generateVideoPoster(blob, quality) {
|
|
257
269
|
return new Promise((resolve, reject) => {
|
|
258
270
|
const video = document.createElement("video");
|
|
@@ -274,7 +286,7 @@ function generateVideoPoster(blob, quality) {
|
|
|
274
286
|
safeReject(new Error("Video poster generation timed out"));
|
|
275
287
|
}, 1e4);
|
|
276
288
|
video.addEventListener("error", () => {
|
|
277
|
-
safeReject(new Error("
|
|
289
|
+
safeReject(new Error("Couldn't load video for poster generation"));
|
|
278
290
|
}, { once: true });
|
|
279
291
|
video.muted = true;
|
|
280
292
|
video.preload = "auto";
|
|
@@ -300,7 +312,7 @@ function generateVideoPoster(blob, quality) {
|
|
|
300
312
|
settled = true;
|
|
301
313
|
cleanup();
|
|
302
314
|
if (!posterBlob) {
|
|
303
|
-
reject(new Error("
|
|
315
|
+
reject(new Error("Couldn't create poster blob"));
|
|
304
316
|
return;
|
|
305
317
|
}
|
|
306
318
|
resolve({ posterBlob, width: w, height: h, duration: video.duration });
|
|
@@ -425,6 +437,8 @@ export {
|
|
|
425
437
|
MIME_TO_EXT,
|
|
426
438
|
EXT_TO_MIME,
|
|
427
439
|
mimeToExt,
|
|
440
|
+
mediaThumbnailUrl,
|
|
441
|
+
imageThumbnailUrl,
|
|
428
442
|
displayFilenameExt,
|
|
429
443
|
displayFilename,
|
|
430
444
|
formatFileSize,
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getContainerChildren
|
|
3
|
+
} from "./chunk-L45X7DKX.js";
|
|
4
|
+
import {
|
|
5
|
+
siteTags
|
|
6
|
+
} from "./chunk-OAGJBCSH.js";
|
|
7
|
+
import {
|
|
8
|
+
audiencePasses,
|
|
9
|
+
pagesInNavOrder
|
|
10
|
+
} from "./chunk-IP2SEBAJ.js";
|
|
11
|
+
import {
|
|
12
|
+
REFERENCE_TYPE
|
|
13
|
+
} from "./chunk-5GFACGSN.js";
|
|
14
|
+
import {
|
|
15
|
+
getSection
|
|
16
|
+
} from "./chunk-FTPETWXE.js";
|
|
17
|
+
|
|
18
|
+
// src/lib/references.ts
|
|
19
|
+
function referenceItems(opts) {
|
|
20
|
+
const { referenceId, content, index, allSections, audiences } = opts;
|
|
21
|
+
const wanted = new Set(content.sectionIds);
|
|
22
|
+
const tagIds = new Set(content.tagIds);
|
|
23
|
+
for (const tag of siteTags(index)) {
|
|
24
|
+
if (tagIds.has(tag.id)) for (const id of tag.sectionIds) wanted.add(id);
|
|
25
|
+
}
|
|
26
|
+
wanted.delete(referenceId);
|
|
27
|
+
if (wanted.size === 0) return [];
|
|
28
|
+
const byId = new Map(allSections.map((s) => [s.section.id, s]));
|
|
29
|
+
const item = (sectionId, page) => {
|
|
30
|
+
const source = byId.get(sectionId) ?? null;
|
|
31
|
+
const excluded = !source || !page ? "missing" : source.section.type === REFERENCE_TYPE ? "reference" : page.status !== "live" ? "archived-page" : source.meta.status !== "live" ? "not-live" : null;
|
|
32
|
+
const hiddenFrom = excluded || !source || !page ? [] : audiences.filter(
|
|
33
|
+
(a) => !audiencePasses(page.access, a) || !audiencePasses(source.meta.access, a)
|
|
34
|
+
);
|
|
35
|
+
return { sectionId, page, source, excluded, hiddenFrom };
|
|
36
|
+
};
|
|
37
|
+
const items = [];
|
|
38
|
+
const placed = /* @__PURE__ */ new Set();
|
|
39
|
+
for (const page of pagesInNavOrder(index)) {
|
|
40
|
+
for (const id of page.order) {
|
|
41
|
+
if (!wanted.has(id)) continue;
|
|
42
|
+
items.push(item(id, page));
|
|
43
|
+
placed.add(id);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
for (const id of wanted) if (!placed.has(id)) items.push(item(id, null));
|
|
47
|
+
return items;
|
|
48
|
+
}
|
|
49
|
+
function resolveReference(opts) {
|
|
50
|
+
const { audience, ...rest } = opts;
|
|
51
|
+
return referenceItems({ ...rest, audiences: audience === null ? [] : [audience] }).flatMap(
|
|
52
|
+
(i) => i.source && !i.excluded && i.hiddenFrom.length === 0 ? [{ ...i.source, referencedBy: opts.referenceId }] : []
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// src/lib/nav.ts
|
|
57
|
+
function toSectionId(text) {
|
|
58
|
+
const slug = text.normalize("NFKD").replace(/[̀-ͯ]/g, "").toLowerCase().replace(/[^\w\s-]/g, "").replace(/\s+/g, "-").replace(/^-+|-+$/g, "");
|
|
59
|
+
if (slug) return slug;
|
|
60
|
+
let hash = 0;
|
|
61
|
+
for (let i = 0; i < text.length; i++) {
|
|
62
|
+
hash = (hash << 5) - hash + text.charCodeAt(i) | 0;
|
|
63
|
+
}
|
|
64
|
+
return `section-${Math.abs(hash).toString(36)}`;
|
|
65
|
+
}
|
|
66
|
+
function flattenForNav(sections) {
|
|
67
|
+
const flat = [];
|
|
68
|
+
const walk = (loaded) => {
|
|
69
|
+
flat.push(loaded);
|
|
70
|
+
for (const child of getContainerChildren(loaded.section)) {
|
|
71
|
+
walk({ section: child, meta: loaded.meta, referencedBy: loaded.referencedBy });
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
sections.forEach(walk);
|
|
75
|
+
return flat;
|
|
76
|
+
}
|
|
77
|
+
var SUMMARY_TYPE = "section_summary";
|
|
78
|
+
function summaryNav(section) {
|
|
79
|
+
if (section.type !== SUMMARY_TYPE) return null;
|
|
80
|
+
const options = "options" in section ? section.options : void 0;
|
|
81
|
+
const label = options?.navLabel?.trim() ?? "";
|
|
82
|
+
if (!label || options?.nav !== "heading" && options?.nav !== "subheading") return null;
|
|
83
|
+
return { role: options.nav === "heading" ? "h1" : "h2", label };
|
|
84
|
+
}
|
|
85
|
+
function roleLookup(registry) {
|
|
86
|
+
return (type) => (registry ? registry.getSection(type) : getSection(type))?.navRole;
|
|
87
|
+
}
|
|
88
|
+
function assignAnchors(flat, lookupRole) {
|
|
89
|
+
const anchors = new Array(flat.length);
|
|
90
|
+
const taken = /* @__PURE__ */ new Set();
|
|
91
|
+
const claim = (i, base) => {
|
|
92
|
+
let anchor = base;
|
|
93
|
+
for (let n = 2; taken.has(anchor); n++) anchor = `${base}-${n}`;
|
|
94
|
+
taken.add(anchor);
|
|
95
|
+
anchors[i] = anchor;
|
|
96
|
+
};
|
|
97
|
+
const headingOf = (section) => {
|
|
98
|
+
const heading = section.content.heading;
|
|
99
|
+
return heading && lookupRole(section.type) ? heading : void 0;
|
|
100
|
+
};
|
|
101
|
+
flat.forEach(({ section, referencedBy }, i) => {
|
|
102
|
+
const heading = headingOf(section);
|
|
103
|
+
if (referencedBy || !heading) return;
|
|
104
|
+
anchors[i] = toSectionId(heading);
|
|
105
|
+
taken.add(anchors[i]);
|
|
106
|
+
});
|
|
107
|
+
flat.forEach(({ section, referencedBy }, i) => {
|
|
108
|
+
const entry = summaryNav(section);
|
|
109
|
+
if (!referencedBy && entry) claim(i, toSectionId(entry.label));
|
|
110
|
+
});
|
|
111
|
+
flat.forEach(({ section, referencedBy }, i) => {
|
|
112
|
+
const text = summaryNav(section)?.label ?? headingOf(section);
|
|
113
|
+
if (referencedBy && text) claim(i, `${toSectionId(text)}-${toSectionId(referencedBy)}`);
|
|
114
|
+
});
|
|
115
|
+
return anchors;
|
|
116
|
+
}
|
|
117
|
+
function buildNavLinks(flat, lookupRole, anchors) {
|
|
118
|
+
const nav = [];
|
|
119
|
+
let currentParent = null;
|
|
120
|
+
let currentChild = null;
|
|
121
|
+
for (const [i, { section, meta }] of flat.entries()) {
|
|
122
|
+
let role;
|
|
123
|
+
let label;
|
|
124
|
+
let excluded = false;
|
|
125
|
+
const summary = summaryNav(section);
|
|
126
|
+
if (summary) {
|
|
127
|
+
role = summary.role;
|
|
128
|
+
label = summary.label;
|
|
129
|
+
} else {
|
|
130
|
+
const content = section.content;
|
|
131
|
+
if (!content.heading) continue;
|
|
132
|
+
role = lookupRole(section.type);
|
|
133
|
+
label = content.heading;
|
|
134
|
+
excluded = !!content.excludeFromNav;
|
|
135
|
+
}
|
|
136
|
+
const anchor = anchors[i];
|
|
137
|
+
if (!role || !anchor) continue;
|
|
138
|
+
if (role === "h1") {
|
|
139
|
+
if (excluded) {
|
|
140
|
+
currentParent = null;
|
|
141
|
+
currentChild = null;
|
|
142
|
+
continue;
|
|
143
|
+
}
|
|
144
|
+
currentParent = { href: `#${anchor}`, label, status: meta.status, children: [] };
|
|
145
|
+
currentChild = null;
|
|
146
|
+
nav.push(currentParent);
|
|
147
|
+
} else if (role === "h2") {
|
|
148
|
+
if (excluded) {
|
|
149
|
+
currentChild = null;
|
|
150
|
+
continue;
|
|
151
|
+
}
|
|
152
|
+
if (!currentParent) continue;
|
|
153
|
+
currentChild = { href: `#${anchor}`, label, status: meta.status, children: [] };
|
|
154
|
+
currentParent.children.push(currentChild);
|
|
155
|
+
} else if (role === "h3") {
|
|
156
|
+
if (excluded) continue;
|
|
157
|
+
if (!currentChild) continue;
|
|
158
|
+
currentChild.children.push({ href: `#${anchor}`, label, status: meta.status, children: [] });
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
return nav;
|
|
162
|
+
}
|
|
163
|
+
function generateNavLinks(sections, registry) {
|
|
164
|
+
const flat = flattenForNav(sections);
|
|
165
|
+
const lookupRole = roleLookup(registry);
|
|
166
|
+
return buildNavLinks(flat, lookupRole, assignAnchors(flat, lookupRole));
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
export {
|
|
170
|
+
referenceItems,
|
|
171
|
+
resolveReference,
|
|
172
|
+
toSectionId,
|
|
173
|
+
generateNavLinks
|
|
174
|
+
};
|
|
@@ -12,7 +12,6 @@ function createEvent(name) {
|
|
|
12
12
|
};
|
|
13
13
|
}
|
|
14
14
|
var editModeEvent = createEvent("editmodechange");
|
|
15
|
-
var navChangeEvent = createEvent("sitenavchange");
|
|
16
15
|
var darkModeEvent = createEvent("sitedarkmode");
|
|
17
16
|
var siteNameChangeEvent = createEvent("sitenamechange");
|
|
18
17
|
var historySelectEvent = createEvent("history-select");
|
|
@@ -26,6 +25,5 @@ var audienceDetailsEvent = createEvent("audiencedetailsopen");
|
|
|
26
25
|
export {
|
|
27
26
|
createEvent,
|
|
28
27
|
editModeEvent,
|
|
29
|
-
navChangeEvent,
|
|
30
28
|
darkModeEvent
|
|
31
29
|
};
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
|
-
AddIcon,
|
|
3
|
-
DeleteIcon,
|
|
4
2
|
DragHandle,
|
|
5
|
-
|
|
3
|
+
DropEdgeIndicator,
|
|
6
4
|
useMediaLibrary,
|
|
7
5
|
useResolvedMedia
|
|
8
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-5KSAS4VY.js";
|
|
7
|
+
import {
|
|
8
|
+
computeReorderTarget
|
|
9
|
+
} from "./chunk-DIMDRBFK.js";
|
|
9
10
|
import {
|
|
10
11
|
IconButton
|
|
11
12
|
} from "./chunk-IIDKW7AV.js";
|
|
12
13
|
import {
|
|
13
14
|
rebindImageRef
|
|
14
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-QHMKIODQ.js";
|
|
15
16
|
import {
|
|
16
17
|
cn
|
|
17
18
|
} from "./chunk-7EOSDFS3.js";
|
|
@@ -152,7 +153,8 @@ function ResolvedMedia({
|
|
|
152
153
|
height: propHeight,
|
|
153
154
|
className,
|
|
154
155
|
imgClassName,
|
|
155
|
-
invertFrom
|
|
156
|
+
invertFrom,
|
|
157
|
+
backdrop
|
|
156
158
|
}) {
|
|
157
159
|
const resolved = useResolvedMedia(imageId);
|
|
158
160
|
const hasResolved = !!resolved.src;
|
|
@@ -178,6 +180,15 @@ function ResolvedMedia({
|
|
|
178
180
|
)
|
|
179
181
|
}
|
|
180
182
|
),
|
|
183
|
+
backdrop && /* @__PURE__ */ jsx(
|
|
184
|
+
"div",
|
|
185
|
+
{
|
|
186
|
+
"aria-hidden": "true",
|
|
187
|
+
"data-testid": "media-backdrop",
|
|
188
|
+
className: cn("pointer-events-none absolute inset-0", backdrop.className),
|
|
189
|
+
style: backdrop.style
|
|
190
|
+
}
|
|
191
|
+
),
|
|
181
192
|
kind === "video" ? /* @__PURE__ */ jsx(
|
|
182
193
|
"video",
|
|
183
194
|
{
|
|
@@ -268,6 +279,25 @@ function ImageDropZone({ onImageSelected, className, children }) {
|
|
|
268
279
|
);
|
|
269
280
|
}
|
|
270
281
|
|
|
282
|
+
// src/lib/image-background.ts
|
|
283
|
+
var LIGHT_MODE = {
|
|
284
|
+
none: void 0,
|
|
285
|
+
light: "bg-surface-light",
|
|
286
|
+
dark: "bg-surface-dark"
|
|
287
|
+
};
|
|
288
|
+
var DARK_MODE = {
|
|
289
|
+
none: "dark:bg-transparent",
|
|
290
|
+
light: "dark:bg-surface-light",
|
|
291
|
+
dark: "dark:bg-surface-dark"
|
|
292
|
+
};
|
|
293
|
+
function imageBackdrop(bg) {
|
|
294
|
+
if (!bg) return void 0;
|
|
295
|
+
if (bg.mode === "custom") return { style: { backgroundColor: bg.color } };
|
|
296
|
+
const light = LIGHT_MODE[bg.light];
|
|
297
|
+
if (!light && bg.dark === "none") return void 0;
|
|
298
|
+
return { className: [light, DARK_MODE[bg.dark]].filter(Boolean).join(" ") };
|
|
299
|
+
}
|
|
300
|
+
|
|
271
301
|
// src/components/sections/Media/MediaBlock.tsx
|
|
272
302
|
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
273
303
|
function MediaBlock({ refValue, options, link, isEditMode, onRefChange }) {
|
|
@@ -275,6 +305,7 @@ function MediaBlock({ refValue, options, link, isEditMode, onRefChange }) {
|
|
|
275
305
|
const fit = refValue.objectFit ?? options.objectFit;
|
|
276
306
|
const fitClass = fit === "cover" ? "object-cover" : "object-contain";
|
|
277
307
|
const showBorder = refValue.border ?? options.border;
|
|
308
|
+
const backdrop = refValue.type === "video" ? void 0 : imageBackdrop(options.background);
|
|
278
309
|
const captionStr = refValue.caption ? Array.isArray(refValue.caption) ? refValue.caption.join("\n") : refValue.caption : "";
|
|
279
310
|
const replace = onRefChange ? (imageId) => onRefChange(rebindImageRef(refValue, imageId)) : void 0;
|
|
280
311
|
const baked = refValue;
|
|
@@ -292,7 +323,8 @@ function MediaBlock({ refValue, options, link, isEditMode, onRefChange }) {
|
|
|
292
323
|
height: bakedHeight,
|
|
293
324
|
className: "h-full w-full",
|
|
294
325
|
imgClassName: fitClass,
|
|
295
|
-
invertFrom: refValue.invertFrom
|
|
326
|
+
invertFrom: refValue.invertFrom,
|
|
327
|
+
backdrop
|
|
296
328
|
}
|
|
297
329
|
);
|
|
298
330
|
let media = isEditMode && replace ? /* @__PURE__ */ jsx3(ImageDropZone, { onImageSelected: replace, className: "h-full w-full", children: resolved }) : resolved;
|
|
@@ -333,7 +365,7 @@ function MediaBlock({ refValue, options, link, isEditMode, onRefChange }) {
|
|
|
333
365
|
|
|
334
366
|
// src/components/primitives/EditableGrid.tsx
|
|
335
367
|
import { useRef as useRef4, useEffect as useEffect4, useState as useState5, useId } from "react";
|
|
336
|
-
import { ImageIcon as ImageIcon2 } from "lucide-react";
|
|
368
|
+
import { ImageIcon as ImageIcon2, Plus, Trash2, Settings } from "lucide-react";
|
|
337
369
|
|
|
338
370
|
// src/lib/container-grid.ts
|
|
339
371
|
var MAX_CONTAINER_COLUMNS = 6;
|
|
@@ -457,7 +489,7 @@ function useEditableCollection({
|
|
|
457
489
|
return { wrappedItems, onReorder, onAdd, onInsert, onInsertItem, onRemove };
|
|
458
490
|
}
|
|
459
491
|
|
|
460
|
-
// src/components/primitives/
|
|
492
|
+
// src/components/primitives/grid-drop.ts
|
|
461
493
|
function resolveDropIndex({
|
|
462
494
|
fromIndex,
|
|
463
495
|
targetIndex,
|
|
@@ -568,7 +600,7 @@ function EditableGrid({
|
|
|
568
600
|
/* @__PURE__ */ jsx4(
|
|
569
601
|
IconButton,
|
|
570
602
|
{
|
|
571
|
-
icon: /* @__PURE__ */ jsx4(
|
|
603
|
+
icon: /* @__PURE__ */ jsx4(Plus, { size: 16 }),
|
|
572
604
|
label: "Add item",
|
|
573
605
|
size: "lg",
|
|
574
606
|
intent: "primary",
|
|
@@ -660,12 +692,17 @@ function GridCell({
|
|
|
660
692
|
isCellDragging && "opacity-50"
|
|
661
693
|
),
|
|
662
694
|
children: [
|
|
663
|
-
|
|
664
|
-
|
|
695
|
+
/* @__PURE__ */ jsx4(
|
|
696
|
+
DropEdgeIndicator,
|
|
697
|
+
{
|
|
698
|
+
edge: showLeftEdge ? "left" : showRightEdge ? "right" : null,
|
|
699
|
+
style: { transform: showLeftEdge ? "translateX(-0.5rem)" : "translateX(0.5rem)" }
|
|
700
|
+
}
|
|
701
|
+
),
|
|
665
702
|
!isDragging && !isLast && /* @__PURE__ */ jsx4(
|
|
666
703
|
IconButton,
|
|
667
704
|
{
|
|
668
|
-
icon: /* @__PURE__ */ jsx4(
|
|
705
|
+
icon: /* @__PURE__ */ jsx4(Plus, { size: 12 }),
|
|
669
706
|
label: "Insert item",
|
|
670
707
|
size: "sm",
|
|
671
708
|
intent: "primary",
|
|
@@ -696,7 +733,7 @@ function GridCell({
|
|
|
696
733
|
onSettings && /* @__PURE__ */ jsx4(
|
|
697
734
|
IconButton,
|
|
698
735
|
{
|
|
699
|
-
icon: /* @__PURE__ */ jsx4(
|
|
736
|
+
icon: /* @__PURE__ */ jsx4(Settings, { size: 16 }),
|
|
700
737
|
label: "Item settings",
|
|
701
738
|
onClick: onSettings,
|
|
702
739
|
className: "bg-base/80 shadow-sm"
|
|
@@ -705,7 +742,7 @@ function GridCell({
|
|
|
705
742
|
/* @__PURE__ */ jsx4(
|
|
706
743
|
IconButton,
|
|
707
744
|
{
|
|
708
|
-
icon: /* @__PURE__ */ jsx4(
|
|
745
|
+
icon: /* @__PURE__ */ jsx4(Trash2, { size: 16 }),
|
|
709
746
|
label: "Delete item",
|
|
710
747
|
intent: "destructive",
|
|
711
748
|
onClick: () => onRemove(id),
|
|
@@ -719,6 +756,175 @@ function GridCell({
|
|
|
719
756
|
);
|
|
720
757
|
}
|
|
721
758
|
|
|
759
|
+
// src/components/primitives/EditableList.tsx
|
|
760
|
+
import { useId as useId2 } from "react";
|
|
761
|
+
import { Trash2 as Trash22 } from "lucide-react";
|
|
762
|
+
|
|
763
|
+
// src/hooks/useSortableRow.ts
|
|
764
|
+
import { useEffect as useEffect5, useRef as useRef5, useState as useState6 } from "react";
|
|
765
|
+
function useSortableRow({
|
|
766
|
+
index,
|
|
767
|
+
dragType,
|
|
768
|
+
onReorder,
|
|
769
|
+
enabled = true
|
|
770
|
+
}) {
|
|
771
|
+
const rowRef = useRef5(null);
|
|
772
|
+
const handleRef = useRef5(null);
|
|
773
|
+
const [isDragging, setIsDragging] = useState6(false);
|
|
774
|
+
const [closestEdge, setClosestEdge] = useState6(null);
|
|
775
|
+
const onReorderRef = useRef5(onReorder);
|
|
776
|
+
onReorderRef.current = onReorder;
|
|
777
|
+
useEffect5(() => {
|
|
778
|
+
if (!enabled) return;
|
|
779
|
+
const row = rowRef.current;
|
|
780
|
+
const handle = handleRef.current;
|
|
781
|
+
if (!row || !handle) return;
|
|
782
|
+
let cleanup;
|
|
783
|
+
let cancelled = false;
|
|
784
|
+
Promise.all([
|
|
785
|
+
import("./adapter-HH47ZPGM.js"),
|
|
786
|
+
import("./closest-edge-EBOXL3YW.js")
|
|
787
|
+
]).then(([{ draggable, dropTargetForElements }, { attachClosestEdge, extractClosestEdge }]) => {
|
|
788
|
+
if (cancelled) return;
|
|
789
|
+
const cleanupDraggable = draggable({
|
|
790
|
+
element: row,
|
|
791
|
+
dragHandle: handle,
|
|
792
|
+
getInitialData: () => ({ dragType, index }),
|
|
793
|
+
onGenerateDragPreview: () => {
|
|
794
|
+
row.style.opacity = "0.4";
|
|
795
|
+
requestAnimationFrame(() => {
|
|
796
|
+
row.style.opacity = "";
|
|
797
|
+
});
|
|
798
|
+
},
|
|
799
|
+
onDragStart: () => setIsDragging(true),
|
|
800
|
+
onDrop: () => setIsDragging(false)
|
|
801
|
+
});
|
|
802
|
+
const cleanupDropTarget = dropTargetForElements({
|
|
803
|
+
element: row,
|
|
804
|
+
canDrop: ({ source }) => source.data.dragType === dragType,
|
|
805
|
+
getData: ({ input, element }) => attachClosestEdge({ index }, { input, element, allowedEdges: ["top", "bottom"] }),
|
|
806
|
+
onDragEnter: ({ self }) => {
|
|
807
|
+
const edge = extractClosestEdge(self.data);
|
|
808
|
+
setClosestEdge(edge === "top" || edge === "bottom" ? edge : null);
|
|
809
|
+
},
|
|
810
|
+
onDrag: ({ self }) => {
|
|
811
|
+
const edge = extractClosestEdge(self.data);
|
|
812
|
+
setClosestEdge(edge === "top" || edge === "bottom" ? edge : null);
|
|
813
|
+
},
|
|
814
|
+
onDragLeave: () => setClosestEdge(null),
|
|
815
|
+
onDrop: ({ source, self }) => {
|
|
816
|
+
setClosestEdge(null);
|
|
817
|
+
const fromIndex = source.data.index;
|
|
818
|
+
const rawEdge = extractClosestEdge(self.data);
|
|
819
|
+
const edge = rawEdge === "top" || rawEdge === "bottom" ? rawEdge : null;
|
|
820
|
+
const toIndex = computeReorderTarget(fromIndex, index, edge);
|
|
821
|
+
if (toIndex !== null) onReorderRef.current(fromIndex, toIndex);
|
|
822
|
+
}
|
|
823
|
+
});
|
|
824
|
+
cleanup = () => {
|
|
825
|
+
cleanupDraggable();
|
|
826
|
+
cleanupDropTarget();
|
|
827
|
+
};
|
|
828
|
+
});
|
|
829
|
+
return () => {
|
|
830
|
+
cancelled = true;
|
|
831
|
+
cleanup?.();
|
|
832
|
+
};
|
|
833
|
+
}, [index, dragType, enabled]);
|
|
834
|
+
return { rowRef, handleRef, isDragging, closestEdge };
|
|
835
|
+
}
|
|
836
|
+
|
|
837
|
+
// src/components/primitives/EditableList.tsx
|
|
838
|
+
import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
839
|
+
function EditableList({
|
|
840
|
+
items,
|
|
841
|
+
onChange,
|
|
842
|
+
createItem,
|
|
843
|
+
isEditMode,
|
|
844
|
+
renderItem,
|
|
845
|
+
className
|
|
846
|
+
}) {
|
|
847
|
+
const { wrappedItems, onReorder, onAdd, onRemove } = useEditableCollection({
|
|
848
|
+
items,
|
|
849
|
+
onChange,
|
|
850
|
+
createItem
|
|
851
|
+
});
|
|
852
|
+
const listId = useId2();
|
|
853
|
+
const dragType = `list-row-${listId}`;
|
|
854
|
+
if (!isEditMode) {
|
|
855
|
+
return /* @__PURE__ */ jsx5("div", { className: cn("flex flex-col gap-2", className), children: wrappedItems.map((wrapped, index) => /* @__PURE__ */ jsx5("div", { children: renderItem(wrapped.data, { isEditMode: false, index }) }, wrapped.id)) });
|
|
856
|
+
}
|
|
857
|
+
return /* @__PURE__ */ jsxs5("div", { className: cn("flex flex-col gap-2", className), children: [
|
|
858
|
+
wrappedItems.map((wrapped, index) => /* @__PURE__ */ jsx5(
|
|
859
|
+
ListRow,
|
|
860
|
+
{
|
|
861
|
+
id: wrapped.id,
|
|
862
|
+
index,
|
|
863
|
+
dragType,
|
|
864
|
+
onReorder,
|
|
865
|
+
onRemove,
|
|
866
|
+
children: renderItem(wrapped.data, { isEditMode: true, index })
|
|
867
|
+
},
|
|
868
|
+
wrapped.id
|
|
869
|
+
)),
|
|
870
|
+
/* @__PURE__ */ jsx5(
|
|
871
|
+
"button",
|
|
872
|
+
{
|
|
873
|
+
onClick: onAdd,
|
|
874
|
+
className: "cursor-pointer rounded border-2 border-dashed border-base-200 px-3 py-2 text-sm text-base-contrast-light hover:border-primary hover:text-primary",
|
|
875
|
+
children: "Add row"
|
|
876
|
+
}
|
|
877
|
+
)
|
|
878
|
+
] });
|
|
879
|
+
}
|
|
880
|
+
function ListRow({
|
|
881
|
+
id,
|
|
882
|
+
index,
|
|
883
|
+
dragType,
|
|
884
|
+
onReorder,
|
|
885
|
+
onRemove,
|
|
886
|
+
children
|
|
887
|
+
}) {
|
|
888
|
+
const { rowRef, handleRef, isDragging, closestEdge } = useSortableRow({
|
|
889
|
+
index,
|
|
890
|
+
dragType,
|
|
891
|
+
onReorder
|
|
892
|
+
});
|
|
893
|
+
return /* @__PURE__ */ jsxs5(
|
|
894
|
+
"div",
|
|
895
|
+
{
|
|
896
|
+
ref: rowRef,
|
|
897
|
+
className: cn("group/row relative flex items-center gap-2", isDragging && "opacity-50"),
|
|
898
|
+
children: [
|
|
899
|
+
/* @__PURE__ */ jsx5(DropEdgeIndicator, { edge: closestEdge }),
|
|
900
|
+
/* @__PURE__ */ jsx5(
|
|
901
|
+
IconButton,
|
|
902
|
+
{
|
|
903
|
+
ref: handleRef,
|
|
904
|
+
icon: /* @__PURE__ */ jsx5(DragHandle, { size: 14 }),
|
|
905
|
+
label: "Drag to reorder",
|
|
906
|
+
size: "sm",
|
|
907
|
+
className: "shrink-0 cursor-grab opacity-0 group-hover/row:opacity-100 no-hover:opacity-100",
|
|
908
|
+
tabIndex: -1
|
|
909
|
+
}
|
|
910
|
+
),
|
|
911
|
+
/* @__PURE__ */ jsx5("div", { className: "min-w-0 flex-1", children }),
|
|
912
|
+
/* @__PURE__ */ jsx5(
|
|
913
|
+
IconButton,
|
|
914
|
+
{
|
|
915
|
+
icon: /* @__PURE__ */ jsx5(Trash22, { size: 14 }),
|
|
916
|
+
label: "Delete item",
|
|
917
|
+
size: "sm",
|
|
918
|
+
intent: "destructive",
|
|
919
|
+
onClick: () => onRemove(id),
|
|
920
|
+
className: "shrink-0 opacity-0 group-hover/row:opacity-100 no-hover:opacity-100"
|
|
921
|
+
}
|
|
922
|
+
)
|
|
923
|
+
]
|
|
924
|
+
}
|
|
925
|
+
);
|
|
926
|
+
}
|
|
927
|
+
|
|
722
928
|
export {
|
|
723
929
|
EditablePlainText,
|
|
724
930
|
ResolvedMedia,
|
|
@@ -730,5 +936,6 @@ export {
|
|
|
730
936
|
masonryColumnsClass,
|
|
731
937
|
spacerHiddenClass,
|
|
732
938
|
useEditableCollection,
|
|
733
|
-
EditableGrid
|
|
939
|
+
EditableGrid,
|
|
940
|
+
EditableList
|
|
734
941
|
};
|
package/dist/collab/rebase.d.ts
CHANGED
|
@@ -80,7 +80,8 @@ export declare function reconcileRemoteIndex(remoteIndex: SiteIndex, localIndex:
|
|
|
80
80
|
* never touches, so the peer's nav transfers whole; readers go through
|
|
81
81
|
* `navEntries()` → `reconcileNav`, which repairs any drift against the
|
|
82
82
|
* resulting page set. A peer that sends no nav (an older client) leaves ours
|
|
83
|
-
* intact rather than flattening it.
|
|
83
|
+
* intact rather than flattening it. The `tags` sidecar is lifted the same way,
|
|
84
|
+
* for the same reason. */
|
|
84
85
|
export declare function applyRemoteIndexUpdate(rawRemoteIndex: unknown, localIndex: SiteIndex): SiteIndex | null;
|
|
85
86
|
export declare function rebaseContent(args: RebaseArgs): RebaseResult;
|
|
86
87
|
//# sourceMappingURL=rebase.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rebase.d.ts","sourceRoot":"","sources":["../../src/collab/rebase.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"rebase.d.ts","sourceRoot":"","sources":["../../src/collab/rebase.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAMxD,MAAM,WAAW,UAAU;IACzB,aAAa,EAAE,aAAa,EAAE,CAAC;IAC/B,UAAU,EAAE,SAAS,CAAC;IACtB,eAAe,EAAE,OAAO,CAAC;IACzB,eAAe,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC7B;;;;;+EAK2E;IAC3E,eAAe,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC7B,iBAAiB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC/B;;;;gFAI4E;IAC5E,aAAa,CAAC,EAAE,SAAS,CAAC;IAC1B,cAAc,EAAE,aAAa,EAAE,CAAC;IAChC,WAAW,EAAE,SAAS,CAAC;IAKvB,gBAAgB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CAC/B;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,aAAa,EAAE,CAAC;IAC1B,KAAK,EAAE,SAAS,CAAC;IAIjB,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB;AAED;;;;;;;;;;qEAUqE;AACrE;;;;;;;;;;;;;;;;;;;;;oEAqBoE;AACpE,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,GAAG,SAAS,CAS7F;AAED;;;;;;;;;;;;;;;;;;;2BAmB2B;AAC3B,wBAAgB,sBAAsB,CAAC,cAAc,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,GAAG,SAAS,GAAG,IAAI,CAqBvG;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,UAAU,GAAG,YAAY,CAyI5D"}
|