@drawnagency/primitives 0.1.113 → 0.1.115
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/auth/cookies.d.ts +39 -0
- package/dist/auth/cookies.d.ts.map +1 -1
- package/dist/auth/index.js +3 -3
- package/dist/chunk-4WQ36ZP7.js +83 -0
- package/dist/{chunk-REDDTTGJ.js → chunk-4Y2JQQZL.js} +19 -1
- package/dist/chunk-5GFACGSN.js +6 -0
- package/dist/{chunk-AHALSCQH.js → chunk-67P34WNW.js} +76 -131
- package/dist/{chunk-S2L3BPLS.js → chunk-7SX42OP4.js} +1 -1
- package/dist/{chunk-GGXZZ77Z.js → chunk-AASEGXNT.js} +18 -1
- package/dist/chunk-APIJPTFG.js +64 -0
- package/dist/{chunk-WKZ7OENC.js → chunk-BQ5TZZUE.js} +5 -1
- package/dist/chunk-CDBURDPX.js +90 -0
- package/dist/chunk-DFKTF3CH.js +0 -0
- package/dist/chunk-DIMDRBFK.js +11 -0
- package/dist/chunk-DJABADOO.js +131 -0
- package/dist/{chunk-NHN2LSIU.js → chunk-DJOGPSRU.js} +31 -68
- package/dist/{chunk-KR2MHTNJ.js → chunk-FHTKSELX.js} +610 -62
- package/dist/{chunk-WUJ3XNFI.js → chunk-GGYY3JQJ.js} +19 -24
- package/dist/chunk-GNF6KFQ7.js +18 -0
- package/dist/{chunk-FRE2CCLV.js → chunk-HHNPSKPT.js} +5 -79
- package/dist/{chunk-IINIZBQB.js → chunk-JCDZAFX2.js} +30 -10
- package/dist/chunk-JR24U7FJ.js +120 -0
- package/dist/{chunk-BDFTMGCL.js → chunk-JXATNKLV.js} +11 -10
- package/dist/{chunk-SW6PCQQD.js → chunk-KQA772WQ.js} +2 -1
- package/dist/{chunk-6BZ2KNTP.js → chunk-NX7TFHA4.js} +195 -65
- package/dist/{chunk-VWWY5TL5.js → chunk-O37AV27P.js} +14 -75
- package/dist/chunk-RIITGTV3.js +275 -0
- package/dist/{chunk-HBULBDGP.js → chunk-S37DZPHW.js} +1 -1
- package/dist/chunk-S7QRHUWO.js +8 -0
- package/dist/{chunk-Z7W3DQTR.js → chunk-T26HAKW3.js} +424 -42
- package/dist/{chunk-4I5OO5UB.js → chunk-TEOAKGZA.js} +0 -1
- package/dist/{chunk-GPPVYLEI.js → chunk-UUUSJDIG.js} +1 -1
- package/dist/chunk-VY3IFGE3.js +70 -0
- package/dist/chunk-WYOFQHKI.js +176 -0
- package/dist/{chunk-4RNF2DRG.js → chunk-XDEPXTBY.js} +0 -2
- package/dist/{chunk-DS4GCYV2.js → chunk-YV3YSZEB.js} +223 -16
- package/dist/collab/rebase.d.ts +2 -1
- package/dist/collab/rebase.d.ts.map +1 -1
- package/dist/collab/rebase.js +24 -9
- package/dist/components/brandguide/ColorsEditable.d.ts.map +1 -1
- package/dist/components/chat/ChatPanel.d.ts.map +1 -1
- package/dist/components/chat/ChatWidget.d.ts.map +1 -1
- package/dist/components/docfile/DocFilePane.d.ts.map +1 -1
- package/dist/components/editor/ChildBlockWrapper.d.ts.map +1 -1
- package/dist/components/editor/ConflictDialog.d.ts.map +1 -1
- package/dist/components/editor/DragHandle.d.ts +12 -2
- package/dist/components/editor/DragHandle.d.ts.map +1 -1
- package/dist/components/editor/DropEdgeIndicator.d.ts +15 -6
- package/dist/components/editor/DropEdgeIndicator.d.ts.map +1 -1
- package/dist/components/editor/NavGroupRow.d.ts +4 -1
- package/dist/components/editor/NavGroupRow.d.ts.map +1 -1
- package/dist/components/editor/PagesModal.d.ts.map +1 -1
- package/dist/components/editor/SectionWrapper.d.ts +1 -1
- package/dist/components/editor/SectionWrapper.d.ts.map +1 -1
- package/dist/components/editor/SettingsForm.d.ts.map +1 -1
- package/dist/components/editor/TagIndicator.d.ts +15 -0
- package/dist/components/editor/TagIndicator.d.ts.map +1 -0
- package/dist/components/editor/index.js +150 -79
- package/dist/components/primitives/DocumentDropZone.d.ts +1 -1
- package/dist/components/primitives/EditableGrid.d.ts.map +1 -1
- package/dist/components/primitives/EditableList.d.ts.map +1 -1
- package/dist/components/primitives/HeadingSection.d.ts +4 -1
- package/dist/components/primitives/HeadingSection.d.ts.map +1 -1
- package/dist/components/primitives/ResolvedMedia.d.ts +5 -1
- package/dist/components/primitives/ResolvedMedia.d.ts.map +1 -1
- package/dist/components/primitives/{defineHeadingSection.d.ts → define-heading-section.d.ts} +1 -1
- package/dist/components/primitives/define-heading-section.d.ts.map +1 -0
- package/dist/components/primitives/{gridDrop.d.ts → grid-drop.d.ts} +1 -1
- package/dist/components/primitives/grid-drop.d.ts.map +1 -0
- package/dist/components/primitives/index.d.ts +1 -1
- package/dist/components/primitives/index.d.ts.map +1 -1
- package/dist/components/primitives/index.js +22 -154
- package/dist/components/sections/Button/CTAButton.d.ts.map +1 -1
- package/dist/components/sections/DoDontMedia/DoDontMediaBlock.d.ts +2 -6
- package/dist/components/sections/DoDontMedia/DoDontMediaBlock.d.ts.map +1 -1
- package/dist/components/sections/DoDontMedia/index.d.ts +8 -0
- package/dist/components/sections/DoDontMedia/index.d.ts.map +1 -1
- package/dist/components/sections/IconList/IconList.d.ts +2 -1
- package/dist/components/sections/IconList/IconList.d.ts.map +1 -1
- package/dist/components/sections/IconList/IconListSettings.d.ts +2 -1
- package/dist/components/sections/IconList/IconListSettings.d.ts.map +1 -1
- package/dist/components/sections/IconList/index.d.ts +1 -0
- package/dist/components/sections/IconList/index.d.ts.map +1 -1
- package/dist/components/sections/Media/MediaBlock.d.ts +2 -1
- package/dist/components/sections/Media/MediaBlock.d.ts.map +1 -1
- package/dist/components/sections/Media/index.d.ts +8 -0
- package/dist/components/sections/Media/index.d.ts.map +1 -1
- package/dist/components/sections/Reference/ReferenceList.d.ts +35 -0
- package/dist/components/sections/Reference/ReferenceList.d.ts.map +1 -0
- package/dist/components/sections/Reference/ReferenceSettings.d.ts +12 -0
- package/dist/components/sections/Reference/ReferenceSettings.d.ts.map +1 -0
- package/dist/components/sections/Reference/index.d.ts +9 -0
- package/dist/components/sections/Reference/index.d.ts.map +1 -0
- package/dist/components/sections/SectionSummary/SectionSummaryBlock.d.ts +38 -0
- package/dist/components/sections/SectionSummary/SectionSummaryBlock.d.ts.map +1 -0
- package/dist/components/sections/SectionSummary/SectionSummarySettings.d.ts +20 -0
- package/dist/components/sections/SectionSummary/SectionSummarySettings.d.ts.map +1 -0
- package/dist/components/sections/SectionSummary/index.d.ts +33 -0
- package/dist/components/sections/SectionSummary/index.d.ts.map +1 -0
- package/dist/components/sections/all-sections.d.ts +53 -0
- package/dist/components/sections/all-sections.d.ts.map +1 -1
- package/dist/components/sections/brand-guide.d.ts +41 -2
- package/dist/components/sections/brand-guide.d.ts.map +1 -1
- package/dist/components/sections/brand-guide.js +17 -10
- package/dist/components/sections/core-sections.d.ts +14 -0
- package/dist/components/sections/core-sections.d.ts.map +1 -1
- package/dist/components/sections/register-schemas.js +25 -18
- package/dist/components/sections/register.js +25 -18
- package/dist/components/shared/BrandSwatchesContext.d.ts +9 -0
- package/dist/components/shared/BrandSwatchesContext.d.ts.map +1 -0
- package/dist/components/shared/Button.d.ts +11 -3
- package/dist/components/shared/Button.d.ts.map +1 -1
- package/dist/components/shared/Checkbox.d.ts +6 -0
- package/dist/components/shared/Checkbox.d.ts.map +1 -1
- package/dist/components/shared/ConfirmDialog.d.ts +25 -0
- package/dist/components/shared/ConfirmDialog.d.ts.map +1 -0
- package/dist/components/shared/ConfirmInline.d.ts +25 -0
- package/dist/components/shared/ConfirmInline.d.ts.map +1 -0
- package/dist/components/shared/ErrorBoundary.d.ts.map +1 -1
- package/dist/components/shared/Fab.d.ts +11 -2
- package/dist/components/shared/Fab.d.ts.map +1 -1
- package/dist/components/shared/FabStack.d.ts +22 -0
- package/dist/components/shared/FabStack.d.ts.map +1 -0
- package/dist/components/shared/HistoryChangesModal.d.ts.map +1 -1
- package/dist/components/shared/HistoryPopover.d.ts.map +1 -1
- package/dist/components/shared/ImageBackgroundField.d.ts +9 -0
- package/dist/components/shared/ImageBackgroundField.d.ts.map +1 -0
- package/dist/components/shared/{UploadRejectionAlert.d.ts → InlineAlert.d.ts} +4 -2
- package/dist/components/shared/InlineAlert.d.ts.map +1 -0
- package/dist/components/shared/Input.d.ts +10 -0
- package/dist/components/shared/Input.d.ts.map +1 -1
- package/dist/components/shared/Navigation.d.ts.map +1 -1
- package/dist/components/shared/Notice.d.ts +10 -0
- package/dist/components/shared/Notice.d.ts.map +1 -0
- package/dist/components/shared/Popover.d.ts.map +1 -1
- package/dist/components/shared/ReferenceSourcesContext.d.ts +25 -0
- package/dist/components/shared/ReferenceSourcesContext.d.ts.map +1 -0
- package/dist/components/shared/Select.d.ts +3 -2
- package/dist/components/shared/Select.d.ts.map +1 -1
- package/dist/components/shared/SplitButton.d.ts.map +1 -1
- package/dist/components/shared/SummaryAnchorsContext.d.ts +10 -0
- package/dist/components/shared/SummaryAnchorsContext.d.ts.map +1 -0
- package/dist/components/shared/Textarea.d.ts +7 -0
- package/dist/components/shared/Textarea.d.ts.map +1 -1
- package/dist/components/shared/ToolbarFrame.d.ts +17 -0
- package/dist/components/shared/ToolbarFrame.d.ts.map +1 -0
- package/dist/components/shared/copy.d.ts +13 -0
- package/dist/components/shared/copy.d.ts.map +1 -0
- package/dist/components/shared/icons.d.ts +0 -12
- package/dist/components/shared/icons.d.ts.map +1 -1
- package/dist/components/shell/AudienceDetailsPanel.d.ts +7 -1
- package/dist/components/shell/AudienceDetailsPanel.d.ts.map +1 -1
- package/dist/components/shell/AudienceRow.d.ts.map +1 -1
- package/dist/components/shell/BugReportFAB.d.ts +7 -1
- package/dist/components/shell/BugReportFAB.d.ts.map +1 -1
- package/dist/components/shell/CredentialList.d.ts.map +1 -1
- package/dist/components/shell/DocInspector.d.ts.map +1 -1
- package/dist/components/shell/DocumentEditorOverlay.d.ts.map +1 -1
- package/dist/components/shell/EditorContext.d.ts +4 -0
- package/dist/components/shell/EditorContext.d.ts.map +1 -1
- package/dist/components/shell/EditorLoginForm.d.ts.map +1 -1
- package/dist/components/shell/EditorModal.d.ts.map +1 -1
- package/dist/components/shell/EditorShell.d.ts.map +1 -1
- package/dist/components/shell/HistoryToolbar.d.ts.map +1 -1
- package/dist/components/shell/MediaFolderTile.d.ts +4 -1
- package/dist/components/shell/MediaFolderTile.d.ts.map +1 -1
- package/dist/components/shell/MediaLibraryModal.d.ts.map +1 -1
- package/dist/components/shell/RestoreModal.d.ts.map +1 -1
- package/dist/components/shell/SiteSettingsChatbot.d.ts.map +1 -1
- package/dist/components/shell/SiteSettingsDisplay.d.ts.map +1 -1
- package/dist/components/shell/SiteSettingsModal.d.ts +3 -1
- package/dist/components/shell/SiteSettingsModal.d.ts.map +1 -1
- package/dist/components/shell/SiteSettingsTags.d.ts +13 -0
- package/dist/components/shell/SiteSettingsTags.d.ts.map +1 -0
- package/dist/components/shell/SiteSettingsUsers.d.ts.map +1 -1
- package/dist/components/shell/ViewerLoginForm.d.ts.map +1 -1
- package/dist/components/shell/{blockMoveDispatch.d.ts → block-move-dispatch.d.ts} +1 -1
- package/dist/components/shell/block-move-dispatch.d.ts.map +1 -0
- package/dist/components/shell/reference-sources.d.ts +22 -0
- package/dist/components/shell/reference-sources.d.ts.map +1 -0
- package/dist/deck/index.d.ts +2 -2
- package/dist/deck/index.d.ts.map +1 -1
- package/dist/deck/index.js +1 -3
- package/dist/deck-builder/index.js +10 -17
- package/dist/document/index.d.ts +2 -2
- package/dist/document/index.d.ts.map +1 -1
- package/dist/hooks/useBlockDnd.d.ts +11 -0
- package/dist/hooks/useBlockDnd.d.ts.map +1 -1
- package/dist/hooks/useBuildStatus.d.ts +1 -1
- package/dist/hooks/useBuildStatus.d.ts.map +1 -1
- package/dist/hooks/useDocumentUploads.d.ts +1 -1
- package/dist/hooks/useDocumentUploads.d.ts.map +1 -1
- package/dist/hooks/useEditorPersistence.d.ts +5 -1
- package/dist/hooks/useEditorPersistence.d.ts.map +1 -1
- package/dist/hooks/useEditorPublish.d.ts +6 -3
- package/dist/hooks/useEditorPublish.d.ts.map +1 -1
- package/dist/hooks/useMediaPipeline.d.ts.map +1 -1
- package/dist/hooks/useNotice.d.ts +19 -0
- package/dist/hooks/useNotice.d.ts.map +1 -0
- package/dist/hooks/useSortableNavRow.d.ts +11 -0
- package/dist/hooks/useSortableNavRow.d.ts.map +1 -1
- package/dist/hooks/useSortableRow.d.ts +11 -0
- package/dist/hooks/useSortableRow.d.ts.map +1 -1
- package/dist/hooks/useStackedEscape.d.ts +32 -0
- package/dist/hooks/useStackedEscape.d.ts.map +1 -0
- package/dist/index.js +95 -48
- package/dist/lib/audience-secret.js +2 -2
- package/dist/lib/block-dnd.d.ts +5 -0
- package/dist/lib/block-dnd.d.ts.map +1 -1
- package/dist/lib/block-move.d.ts.map +1 -1
- package/dist/lib/brand-swatches.d.ts +12 -0
- package/dist/lib/brand-swatches.d.ts.map +1 -0
- package/dist/lib/container-ops.d.ts +3 -2
- package/dist/lib/container-ops.d.ts.map +1 -1
- package/dist/lib/dexie.d.ts +7 -1
- package/dist/lib/dexie.d.ts.map +1 -1
- package/dist/lib/dexie.js +12 -3
- package/dist/lib/env.d.ts +4 -0
- package/dist/lib/env.d.ts.map +1 -1
- package/dist/lib/env.js +5 -3
- package/dist/lib/events.d.ts +1 -2
- package/dist/lib/events.d.ts.map +1 -1
- package/dist/lib/image-background.d.ts +8 -0
- package/dist/lib/image-background.d.ts.map +1 -0
- package/dist/lib/image-variant-plan.d.ts +42 -0
- package/dist/lib/image-variant-plan.d.ts.map +1 -0
- package/dist/lib/image-variant-plan.js +53 -0
- package/dist/lib/index-ops.d.ts.map +1 -1
- package/dist/lib/index-ops.js +21 -17
- package/dist/lib/index.d.ts +7 -4
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +55 -26
- package/dist/lib/loader.d.ts +25 -12
- package/dist/lib/loader.d.ts.map +1 -1
- package/dist/lib/media-ops.d.ts +73 -0
- package/dist/lib/media-ops.d.ts.map +1 -0
- package/dist/lib/media-ops.js +60 -0
- package/dist/lib/nav-tree.d.ts +7 -0
- package/dist/lib/nav-tree.d.ts.map +1 -1
- package/dist/lib/nav.d.ts +38 -0
- package/dist/lib/nav.d.ts.map +1 -1
- package/dist/lib/pages.d.ts +2 -1
- package/dist/lib/pages.d.ts.map +1 -1
- package/dist/lib/platform-broker.d.ts +4 -2
- package/dist/lib/platform-broker.d.ts.map +1 -1
- package/dist/lib/platform-broker.js +21 -13
- package/dist/lib/reference-type.d.ts +2 -0
- package/dist/lib/reference-type.d.ts.map +1 -0
- package/dist/lib/reference-validation.d.ts +31 -0
- package/dist/lib/reference-validation.d.ts.map +1 -0
- package/dist/lib/reference-validation.js +39 -0
- package/dist/lib/references.d.ts +74 -0
- package/dist/lib/references.d.ts.map +1 -0
- package/dist/lib/registry.d.ts +35 -0
- package/dist/lib/registry.d.ts.map +1 -1
- package/dist/lib/{safeRedirect.d.ts → safe-redirect.d.ts} +1 -1
- package/dist/lib/safe-redirect.d.ts.map +1 -0
- package/dist/lib/sidecar-diagnostics.d.ts +20 -0
- package/dist/lib/sidecar-diagnostics.d.ts.map +1 -0
- package/dist/lib/sidecars.d.ts +118 -0
- package/dist/lib/sidecars.d.ts.map +1 -0
- package/dist/lib/sidecars.js +23 -0
- package/dist/lib/slug.d.ts +2 -0
- package/dist/lib/slug.d.ts.map +1 -0
- package/dist/lib/storage-tier.d.ts +17 -0
- package/dist/lib/storage-tier.d.ts.map +1 -0
- package/dist/lib/storage-tier.js +29 -0
- package/dist/lib/tags.d.ts +64 -0
- package/dist/lib/tags.d.ts.map +1 -0
- package/dist/lib/theme-vars.d.ts +9 -0
- package/dist/lib/theme-vars.d.ts.map +1 -1
- package/dist/media/index.d.ts +1 -1
- package/dist/media/index.d.ts.map +1 -1
- package/dist/media/index.js +18 -14
- package/dist/media/queue.d.ts +2 -0
- package/dist/media/queue.d.ts.map +1 -1
- package/dist/media/utils.d.ts +2 -0
- package/dist/media/utils.d.ts.map +1 -1
- package/dist/media/{videoPoster.d.ts → video-poster.d.ts} +1 -1
- package/dist/media/video-poster.d.ts.map +1 -0
- package/dist/media/worker.d.ts +1 -35
- package/dist/media/worker.d.ts.map +1 -1
- package/dist/schemas/audience.js +2 -2
- package/dist/schemas/index.d.ts +1 -0
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/schemas/index.js +25 -13
- package/dist/schemas/media.d.ts +4 -0
- package/dist/schemas/media.d.ts.map +1 -1
- package/dist/schemas/shared.d.ts +26 -0
- package/dist/schemas/shared.d.ts.map +1 -1
- package/dist/schemas/site-config.d.ts +6 -0
- package/dist/schemas/site-config.d.ts.map +1 -1
- package/dist/schemas/tags.d.ts +27 -0
- package/dist/schemas/tags.d.ts.map +1 -0
- package/dist/storage/index.js +2 -1
- package/dist/storage/memory.d.ts +21 -0
- package/dist/storage/memory.d.ts.map +1 -0
- package/dist/storage/memory.js +129 -0
- package/dist/storage/types.d.ts +9 -0
- package/dist/storage/types.d.ts.map +1 -1
- package/dist/types/database.d.ts.map +1 -1
- package/package.json +26 -1
- package/src/auth/cookies.ts +111 -0
- package/src/collab/rebase.ts +29 -9
- package/src/components/brandguide/ColorSwatchSettings.tsx +1 -1
- package/src/components/brandguide/ColorsEditable.tsx +1 -0
- package/src/components/chat/ChatPanel.tsx +2 -3
- package/src/components/chat/ChatWidget.tsx +2 -3
- package/src/components/docfile/DocFilePane.tsx +4 -12
- package/src/components/editor/ChildBlockWrapper.tsx +13 -19
- package/src/components/editor/ConflictDialog.tsx +27 -35
- package/src/components/editor/DeleteButton.tsx +2 -2
- package/src/components/editor/DragHandle.tsx +16 -3
- package/src/components/editor/DropEdgeIndicator.tsx +36 -10
- package/src/components/editor/InsertButton.tsx +2 -2
- package/src/components/editor/NavGroupRow.tsx +43 -14
- package/src/components/editor/PagesModal.tsx +99 -26
- package/src/components/editor/SectionWrapper.tsx +64 -23
- package/src/components/editor/SettingsButton.tsx +2 -2
- package/src/components/editor/SettingsForm.tsx +19 -2
- package/src/components/editor/StatusIndicator.tsx +4 -4
- package/src/components/editor/TagIndicator.tsx +80 -0
- package/src/components/primitives/DocumentDropZone.tsx +1 -1
- package/src/components/primitives/EditableGrid.tsx +15 -14
- package/src/components/primitives/EditableList.tsx +27 -74
- package/src/components/primitives/HeadingSection.tsx +5 -2
- package/src/components/primitives/ResolvedMedia.tsx +13 -0
- package/src/components/primitives/{defineHeadingSection.tsx → define-heading-section.tsx} +1 -0
- package/src/components/primitives/index.ts +1 -1
- package/src/components/primitives/useEditablePlainText.ts +5 -5
- package/src/components/sections/Button/CTAButton.tsx +3 -1
- package/src/components/sections/DoDontMedia/DoDontMediaBlock.tsx +4 -4
- package/src/components/sections/DoDontMedia/index.tsx +12 -3
- package/src/components/sections/IconList/DoDontToggle.tsx +2 -2
- package/src/components/sections/IconList/IconList.tsx +70 -37
- package/src/components/sections/IconList/IconListSettings.tsx +55 -17
- package/src/components/sections/IconList/index.tsx +10 -3
- package/src/components/sections/LinkHeading/index.tsx +1 -1
- package/src/components/sections/Media/MediaBlock.tsx +13 -2
- package/src/components/sections/Media/index.tsx +12 -4
- package/src/components/sections/Reference/ReferenceList.tsx +214 -0
- package/src/components/sections/Reference/ReferenceSettings.tsx +159 -0
- package/src/components/sections/Reference/index.tsx +47 -0
- package/src/components/sections/SectionSummary/SectionSummaryBlock.tsx +476 -0
- package/src/components/sections/SectionSummary/SectionSummarySettings.tsx +126 -0
- package/src/components/sections/SectionSummary/index.tsx +149 -0
- package/src/components/sections/SubHeading/index.tsx +1 -1
- package/src/components/sections/SubSubHeading/index.tsx +1 -1
- package/src/components/sections/brand-guide.ts +4 -3
- package/src/components/sections/core-sections.ts +2 -0
- package/src/components/shared/BrandSwatchesContext.ts +13 -0
- package/src/components/shared/Button.tsx +47 -34
- package/src/components/shared/Checkbox.tsx +21 -12
- package/src/components/shared/ConfirmDialog.tsx +87 -0
- package/src/components/shared/ConfirmInline.tsx +90 -0
- package/src/components/shared/ErrorBoundary.tsx +6 -18
- package/src/components/shared/Fab.tsx +15 -5
- package/src/components/shared/FabStack.tsx +28 -0
- package/src/components/shared/HistoryChangesModal.tsx +43 -41
- package/src/components/shared/HistoryPopover.tsx +7 -20
- package/src/components/shared/ImageBackgroundField.tsx +92 -0
- package/src/components/shared/{UploadRejectionAlert.tsx → InlineAlert.tsx} +21 -5
- package/src/components/shared/Input.tsx +23 -7
- package/src/components/shared/Navigation.tsx +22 -17
- package/src/components/shared/Notice.tsx +59 -0
- package/src/components/shared/Popover.tsx +7 -11
- package/src/components/shared/ReferenceSourcesContext.ts +27 -0
- package/src/components/shared/Select.tsx +5 -2
- package/src/components/shared/SplitButton.tsx +11 -17
- package/src/components/shared/SummaryAnchorsContext.ts +11 -0
- package/src/components/shared/Textarea.tsx +17 -2
- package/src/components/shared/ToolbarFrame.tsx +28 -0
- package/src/components/shared/VideoSourceField.tsx +1 -1
- package/src/components/shared/copy.ts +18 -0
- package/src/components/shared/icons.tsx +1 -17
- package/src/components/shell/AudienceAddForm.tsx +2 -2
- package/src/components/shell/AudienceDetailsPanel.tsx +23 -5
- package/src/components/shell/AudienceRow.tsx +22 -15
- package/src/components/shell/BugReportFAB.tsx +50 -40
- package/src/components/shell/CredentialList.tsx +33 -13
- package/src/components/shell/DocInspector.tsx +3 -12
- package/src/components/shell/DocumentEditorOverlay.tsx +33 -23
- package/src/components/shell/EditorContext.tsx +7 -0
- package/src/components/shell/EditorLoginForm.tsx +26 -36
- package/src/components/shell/EditorModal.tsx +8 -10
- package/src/components/shell/EditorShell.tsx +501 -338
- package/src/components/shell/HistoryToolbar.tsx +24 -26
- package/src/components/shell/MediaFolderTile.tsx +8 -3
- package/src/components/shell/MediaLibraryModal.tsx +59 -60
- package/src/components/shell/ProcessingIndicator.tsx +2 -2
- package/src/components/shell/RestoreModal.tsx +17 -16
- package/src/components/shell/SetPasswordForm.tsx +3 -3
- package/src/components/shell/SiteSettingsChatbot.tsx +61 -42
- package/src/components/shell/SiteSettingsDisplay.tsx +10 -20
- package/src/components/shell/SiteSettingsModal.tsx +24 -2
- package/src/components/shell/SiteSettingsTags.tsx +143 -0
- package/src/components/shell/SiteSettingsUsers.tsx +36 -26
- package/src/components/shell/SiteSettingsViewerAccess.tsx +2 -2
- package/src/components/shell/ViewerLoginForm.tsx +5 -4
- package/src/components/shell/reference-sources.ts +36 -0
- package/src/deck/index.ts +2 -2
- package/src/document/index.ts +2 -2
- package/src/hooks/useBlockDnd.ts +11 -0
- package/src/hooks/useBuildStatus.ts +53 -6
- package/src/hooks/useDocumentUploads.ts +1 -1
- package/src/hooks/useEditorPersistence.ts +141 -35
- package/src/hooks/useEditorPublish.ts +27 -31
- package/src/hooks/useMediaPipeline.ts +30 -24
- package/src/hooks/useNotice.ts +45 -0
- package/src/hooks/useSortableNavRow.ts +11 -0
- package/src/hooks/useSortableRow.ts +22 -2
- package/src/hooks/useStackedEscape.ts +62 -0
- package/src/lib/block-dnd.ts +6 -1
- package/src/lib/block-move.ts +3 -0
- package/src/lib/brand-swatches.ts +32 -0
- package/src/lib/container-ops.ts +5 -3
- package/src/lib/dexie.ts +24 -2
- package/src/lib/env.ts +9 -0
- package/src/lib/events.ts +1 -2
- package/src/lib/image-background.ts +31 -0
- package/src/lib/image-variant-plan.ts +92 -0
- package/src/lib/index-ops.ts +9 -18
- package/src/lib/index.ts +20 -4
- package/src/lib/loader.ts +28 -88
- package/src/lib/media-ops.ts +112 -0
- package/src/lib/nav-tree.ts +104 -4
- package/src/lib/nav.ts +196 -36
- package/src/lib/pages.ts +2 -3
- package/src/lib/platform-broker.ts +32 -14
- package/src/lib/reference-type.ts +3 -0
- package/src/lib/reference-validation.ts +69 -0
- package/src/lib/references.ts +130 -0
- package/src/lib/registry.ts +37 -0
- package/src/lib/sidecar-diagnostics.ts +29 -0
- package/src/lib/sidecars.ts +221 -0
- package/src/lib/slug.ts +6 -0
- package/src/lib/storage-tier.ts +38 -0
- package/src/lib/tags.ts +165 -0
- package/src/lib/theme-vars.ts +23 -0
- package/src/media/index.ts +1 -1
- package/src/media/queue.ts +3 -0
- package/src/media/utils.ts +19 -1
- package/src/media/{videoPoster.ts → video-poster.ts} +2 -2
- package/src/media/worker.ts +17 -8
- package/src/schemas/index.ts +1 -0
- package/src/schemas/media.ts +7 -2
- package/src/schemas/shared.ts +24 -1
- package/src/schemas/site-config.ts +6 -1
- package/src/schemas/tags.ts +33 -0
- package/src/storage/memory.ts +178 -0
- package/src/storage/types.ts +16 -3
- package/src/types/database.ts +2 -0
- package/dist/chunk-DNY72JZN.js +0 -86
- package/dist/chunk-F2LYQPXV.js +0 -77
- package/dist/chunk-JH762VUH.js +0 -128
- package/dist/chunk-K7DYZXVU.js +0 -138
- package/dist/components/primitives/defineHeadingSection.d.ts.map +0 -1
- package/dist/components/primitives/gridDrop.d.ts.map +0 -1
- package/dist/components/shared/UploadRejectionAlert.d.ts.map +0 -1
- package/dist/components/shell/BuildStatusIndicator.d.ts +0 -7
- package/dist/components/shell/BuildStatusIndicator.d.ts.map +0 -1
- package/dist/components/shell/blockMoveDispatch.d.ts.map +0 -1
- package/dist/hooks/index.d.ts +0 -9
- package/dist/hooks/index.d.ts.map +0 -1
- package/dist/lib/grid.d.ts +0 -2
- package/dist/lib/grid.d.ts.map +0 -1
- package/dist/lib/safeRedirect.d.ts.map +0 -1
- package/dist/media/videoPoster.d.ts.map +0 -1
- package/src/components/brandguide/ColorSwatchSettings.d.ts.map +0 -1
- package/src/components/brandguide/Colors.d.ts.map +0 -1
- package/src/components/primitives/CustomParagraph.d.ts.map +0 -1
- package/src/components/primitives/EditableGrid.d.ts.map +0 -1
- package/src/components/primitives/EditablePlainText.d.ts.map +0 -1
- package/src/components/primitives/EditableRichText.d.ts.map +0 -1
- package/src/components/primitives/HeadingSection.d.ts.map +0 -1
- package/src/components/primitives/IconPicker.d.ts.map +0 -1
- package/src/components/primitives/LinkPopover.d.ts.map +0 -1
- package/src/components/primitives/MediaSettingsForms.d.ts.map +0 -1
- package/src/components/primitives/ResolvedMedia.d.ts.map +0 -1
- package/src/components/primitives/RichTextToolbar.d.ts.map +0 -1
- package/src/components/primitives/tiptap-presets.d.ts.map +0 -1
- package/src/components/primitives/useEditableCollection.d.ts.map +0 -1
- package/src/components/primitives/useEditablePlainText.d.ts.map +0 -1
- package/src/components/primitives/useEditableRichText.d.ts.map +0 -1
- package/src/components/sections/Button/CTAButton.d.ts.map +0 -1
- package/src/components/sections/Button/index.d.ts.map +0 -1
- package/src/components/sections/Colors/index.d.ts.map +0 -1
- package/src/components/sections/IconList/IconList.d.ts.map +0 -1
- package/src/components/sections/IconList/IconListSettings.d.ts.map +0 -1
- package/src/components/sections/IconList/index.d.ts.map +0 -1
- package/src/components/sections/LinkHeading/index.d.ts.map +0 -1
- package/src/components/sections/Prose/Prose.d.ts.map +0 -1
- package/src/components/sections/Prose/index.d.ts.map +0 -1
- package/src/components/sections/SubHeading/index.d.ts.map +0 -1
- package/src/components/sections/SubSubHeading/index.d.ts.map +0 -1
- package/src/components/sections/register-schemas.d.ts.map +0 -1
- package/src/components/shared/Button.d.ts.map +0 -1
- package/src/components/shared/Checkbox.d.ts.map +0 -1
- package/src/components/shared/FormLabel.d.ts.map +0 -1
- package/src/components/shared/IconButton.d.ts.map +0 -1
- package/src/components/shared/Input.d.ts.map +0 -1
- package/src/components/shared/Select.d.ts.map +0 -1
- package/src/components/shared/icons.d.ts.map +0 -1
- package/src/components/shell/BuildStatusIndicator.tsx +0 -59
- package/src/components/shell/MediaLibraryContext.d.ts.map +0 -1
- package/src/hooks/index.ts +0 -8
- package/src/hooks/useResolvedMedia.d.ts.map +0 -1
- package/src/lib/cn.d.ts.map +0 -1
- package/src/lib/grid.d.ts.map +0 -1
- package/src/lib/grid.ts +0 -7
- package/src/lib/icons.d.ts.map +0 -1
- package/src/lib/loader.d.ts.map +0 -1
- package/src/lib/nav.d.ts.map +0 -1
- package/src/lib/registry.d.ts.map +0 -1
- package/src/lib/sanitize.d.ts.map +0 -1
- package/src/media/github.d.ts.map +0 -1
- package/src/media/index.d.ts.map +0 -1
- package/src/media/queue.d.ts.map +0 -1
- package/src/media/resolve.d.ts.map +0 -1
- package/src/media/types.d.ts.map +0 -1
- package/src/media/utils.d.ts.map +0 -1
- package/src/media/videoPoster.d.ts.map +0 -1
- package/src/schemas/auth.d.ts.map +0 -1
- package/src/schemas/media-grid-options.d.ts.map +0 -1
- package/src/schemas/media.d.ts.map +0 -1
- package/src/schemas/sections.d.ts.map +0 -1
- package/src/schemas/shared.d.ts.map +0 -1
- package/src/schemas/site-config.d.ts.map +0 -1
- /package/dist/{chunk-B7VBSE5X.js → chunk-3JDTXOIG.js} +0 -0
- /package/dist/{chunk-CXZ5YJG4.js → chunk-L45X7DKX.js} +0 -0
- /package/src/components/primitives/{gridDrop.ts → grid-drop.ts} +0 -0
- /package/src/components/shell/{blockMoveDispatch.ts → block-move-dispatch.ts} +0 -0
- /package/src/lib/{safeRedirect.ts → safe-redirect.ts} +0 -0
|
@@ -3,7 +3,6 @@ import {
|
|
|
3
3
|
} from "./chunk-7EOSDFS3.js";
|
|
4
4
|
|
|
5
5
|
// src/components/shared/Button.tsx
|
|
6
|
-
import { forwardRef } from "react";
|
|
7
6
|
import { jsx } from "react/jsx-runtime";
|
|
8
7
|
var boxSize = {
|
|
9
8
|
sm: "rounded px-3 py-1.5 text-xs font-medium",
|
|
@@ -17,45 +16,41 @@ var variantClasses = {
|
|
|
17
16
|
primary: "bg-base-contrast text-base-accent hover:bg-base-contrast/90",
|
|
18
17
|
brand: "bg-primary text-primary-contrast hover:opacity-90",
|
|
19
18
|
secondary: "border border-base-200 text-base-contrast hover:bg-base-accent",
|
|
20
|
-
destructive: "border border-
|
|
19
|
+
destructive: "border border-danger text-danger hover:bg-danger hover:text-white"
|
|
21
20
|
};
|
|
22
21
|
var ghostToneClasses = {
|
|
23
22
|
neutral: "text-base-contrast-light hover:text-base-contrast",
|
|
24
|
-
destructive: "text-
|
|
23
|
+
destructive: "text-danger hover:text-danger-hover"
|
|
25
24
|
};
|
|
26
|
-
|
|
25
|
+
function Button({
|
|
27
26
|
variant = "primary",
|
|
28
27
|
size = "sm",
|
|
29
28
|
tone = "neutral",
|
|
30
29
|
fullWidth = false,
|
|
31
30
|
isLoading = false,
|
|
32
31
|
loadingLabel,
|
|
33
|
-
disabled,
|
|
34
32
|
className,
|
|
35
33
|
children,
|
|
36
34
|
...rest
|
|
37
|
-
}
|
|
35
|
+
}) {
|
|
38
36
|
const isGhost = variant === "ghost";
|
|
39
|
-
const
|
|
37
|
+
const disabled = rest.href === void 0 ? rest.disabled || isLoading : false;
|
|
40
38
|
const label = isLoading && loadingLabel ? loadingLabel : children;
|
|
41
|
-
|
|
42
|
-
"
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
isGhost ? ghostToneClasses[tone] : variantClasses[variant],
|
|
50
|
-
fullWidth && "w-full",
|
|
51
|
-
resolvedDisabled ? "cursor-not-allowed opacity-50" : "cursor-pointer",
|
|
52
|
-
className
|
|
53
|
-
),
|
|
54
|
-
...rest,
|
|
55
|
-
children: label
|
|
56
|
-
}
|
|
39
|
+
const classes = cn(
|
|
40
|
+
"inline-flex items-center justify-center transition-colors",
|
|
41
|
+
"focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary",
|
|
42
|
+
isGhost ? ghostSize[size] : boxSize[size],
|
|
43
|
+
isGhost ? ghostToneClasses[tone] : variantClasses[variant],
|
|
44
|
+
fullWidth && "w-full",
|
|
45
|
+
disabled ? "cursor-not-allowed opacity-50" : "cursor-pointer",
|
|
46
|
+
className
|
|
57
47
|
);
|
|
58
|
-
|
|
48
|
+
if (rest.href !== void 0) {
|
|
49
|
+
return /* @__PURE__ */ jsx("a", { className: classes, ...rest, children: label });
|
|
50
|
+
}
|
|
51
|
+
const { ref, disabled: _disabled, ...buttonRest } = rest;
|
|
52
|
+
return /* @__PURE__ */ jsx("button", { ref, disabled, className: classes, ...buttonRest, children: label });
|
|
53
|
+
}
|
|
59
54
|
|
|
60
55
|
export {
|
|
61
56
|
Button
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// src/lib/sidecar-diagnostics.ts
|
|
2
|
+
function diagnosticsCollector() {
|
|
3
|
+
const byCode = /* @__PURE__ */ new Map();
|
|
4
|
+
return {
|
|
5
|
+
add(code, id) {
|
|
6
|
+
const ids = byCode.get(code) ?? /* @__PURE__ */ new Set();
|
|
7
|
+
ids.add(id);
|
|
8
|
+
byCode.set(code, ids);
|
|
9
|
+
},
|
|
10
|
+
list() {
|
|
11
|
+
return [...byCode].map(([code, ids]) => ({ code, ids: [...ids] }));
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export {
|
|
17
|
+
diagnosticsCollector
|
|
18
|
+
};
|
|
@@ -1,69 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
slugifyPageSlug
|
|
3
|
-
} from "./chunk-NHN2LSIU.js";
|
|
4
|
-
|
|
5
|
-
// src/media/utils.ts
|
|
6
|
-
async function hashFileBuffer(buffer) {
|
|
7
|
-
if (typeof crypto !== "undefined" && crypto.subtle) {
|
|
8
|
-
const hashBuffer = await crypto.subtle.digest("SHA-256", buffer);
|
|
9
|
-
const hashArray = new Uint8Array(hashBuffer);
|
|
10
|
-
return Array.from(hashArray.slice(0, 8)).map((b) => b.toString(16).padStart(2, "0")).join("");
|
|
11
|
-
}
|
|
12
|
-
const bytes = new Uint8Array(buffer);
|
|
13
|
-
const seeds = [2166136261, 84696351];
|
|
14
|
-
let result = "";
|
|
15
|
-
for (const seed of seeds) {
|
|
16
|
-
let h = seed;
|
|
17
|
-
for (let i = 0; i < bytes.length; i++) {
|
|
18
|
-
h ^= bytes[i];
|
|
19
|
-
h = Math.imul(h, 16777619);
|
|
20
|
-
}
|
|
21
|
-
result += (h >>> 0).toString(16).padStart(8, "0");
|
|
22
|
-
}
|
|
23
|
-
return result;
|
|
24
|
-
}
|
|
25
|
-
function sanitizeMediaName(name) {
|
|
26
|
-
return slugifyPageSlug(name.replace(/\.[^.]+$/, ""));
|
|
27
|
-
}
|
|
28
|
-
var MIME_TO_EXT = {
|
|
29
|
-
"image/gif": "gif",
|
|
30
|
-
"image/apng": "apng",
|
|
31
|
-
"image/png": "png",
|
|
32
|
-
"image/jpeg": "jpg",
|
|
33
|
-
"image/webp": "webp",
|
|
34
|
-
"image/svg+xml": "svg",
|
|
35
|
-
"video/mp4": "mp4",
|
|
36
|
-
"video/webm": "webm"
|
|
37
|
-
};
|
|
38
|
-
var EXT_TO_MIME = {
|
|
39
|
-
...Object.fromEntries(
|
|
40
|
-
Object.entries(MIME_TO_EXT).map(([mime, ext]) => [`.${ext}`, mime])
|
|
41
|
-
),
|
|
42
|
-
".jpeg": "image/jpeg"
|
|
43
|
-
};
|
|
44
|
-
function mimeToExt(mime) {
|
|
45
|
-
return MIME_TO_EXT[mime] ?? "bin";
|
|
46
|
-
}
|
|
47
|
-
function displayFilenameExt(mime) {
|
|
48
|
-
const ext = MIME_TO_EXT[mime];
|
|
49
|
-
return ext ? `.${ext}` : "";
|
|
50
|
-
}
|
|
51
|
-
function displayFilename(originalName, mimeType) {
|
|
52
|
-
const ext = MIME_TO_EXT[mimeType];
|
|
53
|
-
if (!ext) return originalName;
|
|
54
|
-
const suffix = `.${ext}`;
|
|
55
|
-
if (originalName.toLowerCase().endsWith(suffix)) return originalName;
|
|
56
|
-
return `${originalName}${suffix}`;
|
|
57
|
-
}
|
|
58
|
-
function formatFileSize(bytes) {
|
|
59
|
-
if (bytes >= 1048576) return `${Math.round(bytes / 1048576)}MB`;
|
|
60
|
-
if (bytes >= 1024) return `${Math.round(bytes / 1024)}KB`;
|
|
61
|
-
return `${bytes}B`;
|
|
62
|
-
}
|
|
63
|
-
function displayName(item) {
|
|
64
|
-
return item.originalName;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
1
|
// src/media/queue.ts
|
|
68
2
|
var ProcessingQueue = class {
|
|
69
3
|
items = /* @__PURE__ */ new Map();
|
|
@@ -131,7 +65,8 @@ var ProcessingQueue = class {
|
|
|
131
65
|
primaryBlob: msg.primaryBlob,
|
|
132
66
|
posterBlob: msg.posterBlob,
|
|
133
67
|
width: msg.width,
|
|
134
|
-
height: msg.height
|
|
68
|
+
height: msg.height,
|
|
69
|
+
plan: msg.plan
|
|
135
70
|
};
|
|
136
71
|
this.options.onEvent({ type: "complete", item: { ...item } });
|
|
137
72
|
delete item.result;
|
|
@@ -253,7 +188,7 @@ function resolveLogo(logo, manifest, provider) {
|
|
|
253
188
|
};
|
|
254
189
|
}
|
|
255
190
|
|
|
256
|
-
// src/media/
|
|
191
|
+
// src/media/video-poster.ts
|
|
257
192
|
function generateVideoPoster(blob, quality) {
|
|
258
193
|
return new Promise((resolve, reject) => {
|
|
259
194
|
const video = document.createElement("video");
|
|
@@ -275,7 +210,7 @@ function generateVideoPoster(blob, quality) {
|
|
|
275
210
|
safeReject(new Error("Video poster generation timed out"));
|
|
276
211
|
}, 1e4);
|
|
277
212
|
video.addEventListener("error", () => {
|
|
278
|
-
safeReject(new Error("
|
|
213
|
+
safeReject(new Error("Couldn't load video for poster generation"));
|
|
279
214
|
}, { once: true });
|
|
280
215
|
video.muted = true;
|
|
281
216
|
video.preload = "auto";
|
|
@@ -301,7 +236,7 @@ function generateVideoPoster(blob, quality) {
|
|
|
301
236
|
settled = true;
|
|
302
237
|
cleanup();
|
|
303
238
|
if (!posterBlob) {
|
|
304
|
-
reject(new Error("
|
|
239
|
+
reject(new Error("Couldn't create poster blob"));
|
|
305
240
|
return;
|
|
306
241
|
}
|
|
307
242
|
resolve({ posterBlob, width: w, height: h, duration: video.duration });
|
|
@@ -421,15 +356,6 @@ function getMediaProvider() {
|
|
|
421
356
|
}
|
|
422
357
|
|
|
423
358
|
export {
|
|
424
|
-
hashFileBuffer,
|
|
425
|
-
sanitizeMediaName,
|
|
426
|
-
MIME_TO_EXT,
|
|
427
|
-
EXT_TO_MIME,
|
|
428
|
-
mimeToExt,
|
|
429
|
-
displayFilenameExt,
|
|
430
|
-
displayFilename,
|
|
431
|
-
formatFileSize,
|
|
432
|
-
displayName,
|
|
433
359
|
ProcessingQueue,
|
|
434
360
|
resolveMedia,
|
|
435
361
|
resolveManifestReferences,
|
|
@@ -30,7 +30,7 @@ function Kbd({ children }) {
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
// src/components/shared/Popover.tsx
|
|
33
|
-
import { useEffect as
|
|
33
|
+
import { useEffect as useEffect3, useLayoutEffect, useRef as useRef2, useState } from "react";
|
|
34
34
|
import { createPortal } from "react-dom";
|
|
35
35
|
|
|
36
36
|
// src/hooks/useFocusTrap.ts
|
|
@@ -56,6 +56,32 @@ function useInitialFocus(ref, active) {
|
|
|
56
56
|
}, [active, ref]);
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
+
// src/hooks/useStackedEscape.ts
|
|
60
|
+
import { useEffect as useEffect2, useRef } from "react";
|
|
61
|
+
function useStackedEscape(onEscape, { enabled, before }) {
|
|
62
|
+
const layerRef = useRef(null);
|
|
63
|
+
useEffect2(() => {
|
|
64
|
+
if (!enabled) return;
|
|
65
|
+
const onKeyDown = (e) => {
|
|
66
|
+
if (e.key !== "Escape") return;
|
|
67
|
+
const own = layerRef.current;
|
|
68
|
+
const layers = document.querySelectorAll("[data-modal-layer]");
|
|
69
|
+
const above = Array.from(layers).some((el) => {
|
|
70
|
+
if (el === own) return false;
|
|
71
|
+
if (!own) return true;
|
|
72
|
+
return Boolean(own.compareDocumentPosition(el) & Node.DOCUMENT_POSITION_FOLLOWING);
|
|
73
|
+
});
|
|
74
|
+
if (above) return;
|
|
75
|
+
if (before?.(e)) return;
|
|
76
|
+
e.preventDefault();
|
|
77
|
+
onEscape();
|
|
78
|
+
};
|
|
79
|
+
document.addEventListener("keydown", onKeyDown);
|
|
80
|
+
return () => document.removeEventListener("keydown", onKeyDown);
|
|
81
|
+
}, [enabled, onEscape, before]);
|
|
82
|
+
return layerRef;
|
|
83
|
+
}
|
|
84
|
+
|
|
59
85
|
// src/components/shared/Popover.tsx
|
|
60
86
|
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
61
87
|
function Popover({
|
|
@@ -68,7 +94,7 @@ function Popover({
|
|
|
68
94
|
portal = false,
|
|
69
95
|
placement = "bottom"
|
|
70
96
|
}) {
|
|
71
|
-
const panelRef =
|
|
97
|
+
const panelRef = useRef2(null);
|
|
72
98
|
const [resolvedAlign, setResolvedAlign] = useState("start");
|
|
73
99
|
const [fixedPos, setFixedPos] = useState(null);
|
|
74
100
|
useInitialFocus(panelRef, isOpen && (!portal || fixedPos !== null));
|
|
@@ -114,13 +140,9 @@ function Popover({
|
|
|
114
140
|
panel.style.left = "";
|
|
115
141
|
panel.style.right = "";
|
|
116
142
|
}, [isOpen, align]);
|
|
117
|
-
|
|
143
|
+
useStackedEscape(onClose, { enabled: isOpen });
|
|
144
|
+
useEffect3(() => {
|
|
118
145
|
if (!isOpen) return;
|
|
119
|
-
function onKeyDown(e) {
|
|
120
|
-
if (e.key !== "Escape") return;
|
|
121
|
-
if (document.querySelector("[data-modal-layer]")) return;
|
|
122
|
-
onClose();
|
|
123
|
-
}
|
|
124
146
|
function onMouseDown(e) {
|
|
125
147
|
const target = e.target;
|
|
126
148
|
if (panelRef.current?.contains(target)) return;
|
|
@@ -128,10 +150,8 @@ function Popover({
|
|
|
128
150
|
if (target instanceof Element && target.closest("[data-modal-layer]")) return;
|
|
129
151
|
onClose();
|
|
130
152
|
}
|
|
131
|
-
document.addEventListener("keydown", onKeyDown);
|
|
132
153
|
document.addEventListener("mousedown", onMouseDown);
|
|
133
154
|
return () => {
|
|
134
|
-
document.removeEventListener("keydown", onKeyDown);
|
|
135
155
|
document.removeEventListener("mousedown", onMouseDown);
|
|
136
156
|
};
|
|
137
157
|
}, [isOpen, onClose, anchorRef]);
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import {
|
|
2
|
+
cn
|
|
3
|
+
} from "./chunk-7EOSDFS3.js";
|
|
4
|
+
|
|
5
|
+
// src/components/shared/Checkbox.tsx
|
|
6
|
+
import { useId } from "react";
|
|
7
|
+
import { Check } from "lucide-react";
|
|
8
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
function Checkbox({
|
|
10
|
+
checked,
|
|
11
|
+
onChange,
|
|
12
|
+
label,
|
|
13
|
+
description,
|
|
14
|
+
disabled,
|
|
15
|
+
className,
|
|
16
|
+
startAdornment,
|
|
17
|
+
align = "start"
|
|
18
|
+
}) {
|
|
19
|
+
const id = useId();
|
|
20
|
+
return /* @__PURE__ */ jsxs(
|
|
21
|
+
"label",
|
|
22
|
+
{
|
|
23
|
+
htmlFor: id,
|
|
24
|
+
className: cn(
|
|
25
|
+
"flex cursor-pointer gap-3 select-none hover:opacity-80",
|
|
26
|
+
align === "start" ? "items-start" : "items-center",
|
|
27
|
+
disabled && "cursor-not-allowed opacity-50",
|
|
28
|
+
className
|
|
29
|
+
),
|
|
30
|
+
children: [
|
|
31
|
+
/* @__PURE__ */ jsxs(
|
|
32
|
+
"span",
|
|
33
|
+
{
|
|
34
|
+
className: cn(
|
|
35
|
+
"relative flex h-5 w-5 shrink-0 items-center justify-center",
|
|
36
|
+
align === "start" && "mt-0.5"
|
|
37
|
+
),
|
|
38
|
+
children: [
|
|
39
|
+
/* @__PURE__ */ jsx(
|
|
40
|
+
"input",
|
|
41
|
+
{
|
|
42
|
+
id,
|
|
43
|
+
type: "checkbox",
|
|
44
|
+
checked,
|
|
45
|
+
disabled,
|
|
46
|
+
onChange: (e) => onChange(e.target.checked),
|
|
47
|
+
className: "sr-only"
|
|
48
|
+
}
|
|
49
|
+
),
|
|
50
|
+
/* @__PURE__ */ jsx(
|
|
51
|
+
CheckboxBox,
|
|
52
|
+
{
|
|
53
|
+
checked,
|
|
54
|
+
className: cn(!checked && "hover:border-primary", disabled && "pointer-events-none")
|
|
55
|
+
}
|
|
56
|
+
)
|
|
57
|
+
]
|
|
58
|
+
}
|
|
59
|
+
),
|
|
60
|
+
startAdornment,
|
|
61
|
+
/* @__PURE__ */ jsxs("div", { className: "text-sm", children: [
|
|
62
|
+
/* @__PURE__ */ jsx("span", { className: "font-medium text-base-contrast", children: label }),
|
|
63
|
+
description && /* @__PURE__ */ jsx("span", { className: "block text-base-contrast-light", children: description })
|
|
64
|
+
] })
|
|
65
|
+
]
|
|
66
|
+
}
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
function CheckboxBox({ checked, className }) {
|
|
70
|
+
return /* @__PURE__ */ jsx(
|
|
71
|
+
"span",
|
|
72
|
+
{
|
|
73
|
+
"aria-hidden": "true",
|
|
74
|
+
className: cn(
|
|
75
|
+
"flex h-5 w-5 shrink-0 items-center justify-center rounded border transition-colors",
|
|
76
|
+
checked ? "border-primary bg-primary text-primary-contrast" : "border-base-300 bg-base",
|
|
77
|
+
className
|
|
78
|
+
),
|
|
79
|
+
children: checked && /* @__PURE__ */ jsx(Check, { size: 14, strokeWidth: 3 })
|
|
80
|
+
}
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// src/components/shared/Tabs.tsx
|
|
85
|
+
import { useState } from "react";
|
|
86
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
87
|
+
function Tabs({ tabs, defaultTabId, activeTabId, onTabChange, fullBleedTabBar }) {
|
|
88
|
+
const [uncontrolledId, setUncontrolledId] = useState(defaultTabId ?? tabs[0]?.id);
|
|
89
|
+
const isControlled = activeTabId !== void 0;
|
|
90
|
+
const activeId = isControlled ? activeTabId : uncontrolledId;
|
|
91
|
+
const activeTab = tabs.find((t) => t.id === activeId) ?? tabs[0];
|
|
92
|
+
function handleSelect(id) {
|
|
93
|
+
if (!isControlled) setUncontrolledId(id);
|
|
94
|
+
onTabChange?.(id);
|
|
95
|
+
}
|
|
96
|
+
return /* @__PURE__ */ jsxs2("div", { className: "flex flex-1 flex-col overflow-hidden", children: [
|
|
97
|
+
/* @__PURE__ */ jsx2("div", { className: cn("border-b border-base-200", fullBleedTabBar && "-mx-6 px-6"), children: /* @__PURE__ */ jsx2("div", { className: "flex", role: "tablist", children: tabs.map((tab) => /* @__PURE__ */ jsx2(
|
|
98
|
+
"button",
|
|
99
|
+
{
|
|
100
|
+
type: "button",
|
|
101
|
+
role: "tab",
|
|
102
|
+
"aria-selected": activeTab?.id === tab.id,
|
|
103
|
+
onClick: () => handleSelect(tab.id),
|
|
104
|
+
className: cn(
|
|
105
|
+
"cursor-pointer px-4 py-2 text-sm font-medium border-b-2 -mb-px",
|
|
106
|
+
activeTab?.id === tab.id ? "border-primary text-primary" : "border-transparent text-base-contrast-light hover:text-base-contrast"
|
|
107
|
+
),
|
|
108
|
+
children: tab.label
|
|
109
|
+
},
|
|
110
|
+
tab.id
|
|
111
|
+
)) }) }),
|
|
112
|
+
/* @__PURE__ */ jsx2("div", { role: "tabpanel", className: cn("flex min-h-0 flex-1 flex-col px-px", fullBleedTabBar && "pt-4"), children: activeTab?.content })
|
|
113
|
+
] });
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export {
|
|
117
|
+
Checkbox,
|
|
118
|
+
CheckboxBox,
|
|
119
|
+
Tabs
|
|
120
|
+
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
EditablePlainText
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import {
|
|
5
|
-
usePages
|
|
6
|
-
} from "./chunk-K7DYZXVU.js";
|
|
3
|
+
} from "./chunk-YV3YSZEB.js";
|
|
7
4
|
import {
|
|
8
5
|
Button
|
|
9
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-GGYY3JQJ.js";
|
|
7
|
+
import {
|
|
8
|
+
usePages
|
|
9
|
+
} from "./chunk-RIITGTV3.js";
|
|
10
10
|
import {
|
|
11
11
|
toSectionId
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-WYOFQHKI.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
|
requireSessionSecret
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-7SX42OP4.js";
|
|
4
4
|
|
|
5
5
|
// src/auth/capabilities.ts
|
|
6
6
|
function deriveUiCapabilities(auth) {
|
|
@@ -65,6 +65,7 @@ async function verifyAudienceClaims(token) {
|
|
|
65
65
|
async function verifyAudienceToken(token) {
|
|
66
66
|
return (await verifyAudienceClaims(token))?.audience ?? null;
|
|
67
67
|
}
|
|
68
|
+
var IMPERSONATION_MAX_AGE_SECONDS = 60 * 60;
|
|
68
69
|
function setSessionCookie(cookies, token, isProduction) {
|
|
69
70
|
cookies.set(SESSION_COOKIE, token, {
|
|
70
71
|
httpOnly: true,
|