@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
|
@@ -1,21 +1,25 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Checkbox
|
|
3
|
-
} from "./chunk-F2LYQPXV.js";
|
|
4
1
|
import {
|
|
5
2
|
EditableGrid,
|
|
3
|
+
EditableList,
|
|
6
4
|
EditablePlainText,
|
|
7
5
|
MediaBlock,
|
|
8
6
|
containerGridClass,
|
|
9
7
|
useEditableCollection
|
|
10
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-YV3YSZEB.js";
|
|
9
|
+
import {
|
|
10
|
+
Checkbox,
|
|
11
|
+
Tabs
|
|
12
|
+
} from "./chunk-JR24U7FJ.js";
|
|
11
13
|
import {
|
|
12
|
-
AddIcon,
|
|
13
|
-
DeleteIcon,
|
|
14
14
|
DragHandle,
|
|
15
|
+
DropEdgeIndicator,
|
|
15
16
|
FormLabel,
|
|
16
17
|
Input,
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
LinkField,
|
|
19
|
+
Select,
|
|
20
|
+
useMediaLibrary,
|
|
21
|
+
usePages
|
|
22
|
+
} from "./chunk-RIITGTV3.js";
|
|
19
23
|
import {
|
|
20
24
|
IconButton
|
|
21
25
|
} from "./chunk-IIDKW7AV.js";
|
|
@@ -25,7 +29,7 @@ import {
|
|
|
25
29
|
} from "./chunk-WDSVHKAH.js";
|
|
26
30
|
import {
|
|
27
31
|
createEvent
|
|
28
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-XDEPXTBY.js";
|
|
29
33
|
import {
|
|
30
34
|
cn
|
|
31
35
|
} from "./chunk-7EOSDFS3.js";
|
|
@@ -34,8 +38,9 @@ import {
|
|
|
34
38
|
} from "./chunk-FTPETWXE.js";
|
|
35
39
|
import {
|
|
36
40
|
HexColorSchema,
|
|
41
|
+
ImageBackgroundSchema,
|
|
37
42
|
SingleMediaReferenceSchema
|
|
38
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-AASEGXNT.js";
|
|
39
44
|
import {
|
|
40
45
|
DEFAULT_LINK,
|
|
41
46
|
LinkValueSchema
|
|
@@ -211,7 +216,7 @@ function ColorSwatchSettings({ color, onChange }) {
|
|
|
211
216
|
},
|
|
212
217
|
key
|
|
213
218
|
)),
|
|
214
|
-
!hasAnyValue(localColor) && /* @__PURE__ */ jsx2("p", { role: "alert", className: "mt-1 text-xs text-
|
|
219
|
+
!hasAnyValue(localColor) && /* @__PURE__ */ jsx2("p", { role: "alert", className: "mt-1 text-xs text-danger", children: "Enter at least one value \u2014 this color won\u2019t be saved until you do." })
|
|
215
220
|
] });
|
|
216
221
|
}
|
|
217
222
|
|
|
@@ -266,6 +271,7 @@ function ColorsEditable({
|
|
|
266
271
|
"button",
|
|
267
272
|
{
|
|
268
273
|
onClick: () => setExpanded(!expanded),
|
|
274
|
+
"aria-expanded": expanded,
|
|
269
275
|
className: "cursor-pointer ml-auto flex items-center gap-1.5 text-sm text-base-contrast-light hover:text-base-contrast",
|
|
270
276
|
children: [
|
|
271
277
|
/* @__PURE__ */ jsx3("span", { children: expanded ? "Hide Details" : "Show Details" }),
|
|
@@ -430,7 +436,7 @@ import { List, Columns2 } from "lucide-react";
|
|
|
430
436
|
|
|
431
437
|
// src/components/sections/IconList/IconList.tsx
|
|
432
438
|
import { useRef as useRef4, useEffect as useEffect5, useState as useState4, useCallback, useId } from "react";
|
|
433
|
-
import { Check as Check2, CopyPlus, Pencil, X as X2 } from "lucide-react";
|
|
439
|
+
import { Check as Check2, CopyPlus, Pencil, Plus, Trash2, X as X2 } from "lucide-react";
|
|
434
440
|
|
|
435
441
|
// src/components/primitives/IconPicker.tsx
|
|
436
442
|
import { useEffect as useEffect3, useRef as useRef2 } from "react";
|
|
@@ -524,7 +530,7 @@ function DoDontToggle({ value, onSelect, onClose }) {
|
|
|
524
530
|
"aria-label": "Do",
|
|
525
531
|
className: cn(
|
|
526
532
|
"cursor-pointer flex flex-col items-center justify-center gap-1 rounded py-2 transition-colors",
|
|
527
|
-
"text-
|
|
533
|
+
"text-success hover:bg-base-accent",
|
|
528
534
|
value === "do" && "ring-2 ring-primary bg-base-accent"
|
|
529
535
|
),
|
|
530
536
|
onClick: () => onSelect("do"),
|
|
@@ -541,7 +547,7 @@ function DoDontToggle({ value, onSelect, onClose }) {
|
|
|
541
547
|
"aria-label": "Don't",
|
|
542
548
|
className: cn(
|
|
543
549
|
"cursor-pointer flex flex-col items-center justify-center gap-1 rounded py-2 transition-colors",
|
|
544
|
-
"text-
|
|
550
|
+
"text-danger hover:bg-base-accent",
|
|
545
551
|
value === "dont" && "ring-2 ring-primary bg-base-accent"
|
|
546
552
|
),
|
|
547
553
|
onClick: () => onSelect("dont"),
|
|
@@ -564,6 +570,7 @@ function IconList({
|
|
|
564
570
|
showLabel = true,
|
|
565
571
|
stackText = false,
|
|
566
572
|
dodont,
|
|
573
|
+
marker,
|
|
567
574
|
labelClassName = "font-bold text-base-contrast",
|
|
568
575
|
textClassName = "text-base-contrast-light",
|
|
569
576
|
iconClassName = "text-primary",
|
|
@@ -571,16 +578,17 @@ function IconList({
|
|
|
571
578
|
onItemsChange
|
|
572
579
|
}) {
|
|
573
580
|
const isEditMode = !!onChange || !!onItemsChange;
|
|
581
|
+
const numbered = marker === "number" && !dodont;
|
|
574
582
|
const emitItems = useCallback(
|
|
575
583
|
(newItems) => {
|
|
576
584
|
onChange?.({
|
|
577
585
|
type: "icon_list",
|
|
578
586
|
content: { items: newItems },
|
|
579
|
-
options: { icon, showLabel, stackText, dodont }
|
|
587
|
+
options: { icon, showLabel, stackText, dodont, marker }
|
|
580
588
|
});
|
|
581
589
|
onItemsChange?.(newItems);
|
|
582
590
|
},
|
|
583
|
-
[onChange, onItemsChange, icon, showLabel, stackText, dodont]
|
|
591
|
+
[onChange, onItemsChange, icon, showLabel, stackText, dodont, marker]
|
|
584
592
|
);
|
|
585
593
|
if (!isEditMode) {
|
|
586
594
|
return /* @__PURE__ */ jsx8(
|
|
@@ -591,6 +599,7 @@ function IconList({
|
|
|
591
599
|
showLabel,
|
|
592
600
|
stackText,
|
|
593
601
|
dodont,
|
|
602
|
+
numbered,
|
|
594
603
|
labelClassName,
|
|
595
604
|
textClassName,
|
|
596
605
|
iconClassName
|
|
@@ -605,6 +614,7 @@ function IconList({
|
|
|
605
614
|
showLabel,
|
|
606
615
|
stackText,
|
|
607
616
|
dodont,
|
|
617
|
+
numbered,
|
|
608
618
|
labelClassName,
|
|
609
619
|
textClassName,
|
|
610
620
|
iconClassName,
|
|
@@ -621,24 +631,28 @@ function resolveIcon(item, defaultIcon, sectionDodont) {
|
|
|
621
631
|
return defaultIcon ? getIcon(defaultIcon) : null;
|
|
622
632
|
}
|
|
623
633
|
function resolveIconColor(item, iconClassName, sectionDodont) {
|
|
624
|
-
if (item.dodont === "do") return "text-
|
|
625
|
-
if (item.dodont === "dont") return "text-
|
|
634
|
+
if (item.dodont === "do") return "text-success";
|
|
635
|
+
if (item.dodont === "dont") return "text-danger";
|
|
626
636
|
if (item.icon) return iconClassName;
|
|
627
|
-
if (sectionDodont === "do") return "text-
|
|
628
|
-
if (sectionDodont === "dont") return "text-
|
|
637
|
+
if (sectionDodont === "do") return "text-success";
|
|
638
|
+
if (sectionDodont === "dont") return "text-danger";
|
|
629
639
|
return iconClassName;
|
|
630
640
|
}
|
|
641
|
+
function NumberMarker({ n }) {
|
|
642
|
+
return /* @__PURE__ */ jsx8("span", { className: "flex h-[18px] min-w-[18px] items-center justify-center text-[1rem] leading-none font-bold tabular-nums", children: n });
|
|
643
|
+
}
|
|
631
644
|
function ViewIconList({
|
|
632
645
|
items,
|
|
633
646
|
defaultIcon,
|
|
634
647
|
showLabel,
|
|
635
648
|
stackText,
|
|
636
649
|
dodont,
|
|
650
|
+
numbered,
|
|
637
651
|
labelClassName,
|
|
638
652
|
textClassName,
|
|
639
653
|
iconClassName
|
|
640
654
|
}) {
|
|
641
|
-
const hasAnyIcon = items.some((item) => resolveIcon(item, defaultIcon, dodont));
|
|
655
|
+
const hasAnyIcon = numbered || items.some((item) => resolveIcon(item, defaultIcon, dodont));
|
|
642
656
|
return /* @__PURE__ */ jsx8("div", { className: "grid gap-4 pb-4", children: items.map((item, i) => {
|
|
643
657
|
const iconEntry = resolveIcon(item, defaultIcon, dodont);
|
|
644
658
|
const iconColor = resolveIconColor(item, iconClassName, dodont);
|
|
@@ -655,7 +669,7 @@ function ViewIconList({
|
|
|
655
669
|
{
|
|
656
670
|
"data-testid": "icon-list-icon",
|
|
657
671
|
className: cn("flex items-start pt-0.5", iconColor),
|
|
658
|
-
children: iconEntry
|
|
672
|
+
children: numbered ? /* @__PURE__ */ jsx8(NumberMarker, { n: i + 1 }) : iconEntry ? /* @__PURE__ */ jsx8(iconEntry.icon, { size: 18 }) : null
|
|
659
673
|
}
|
|
660
674
|
),
|
|
661
675
|
/* @__PURE__ */ jsxs6(
|
|
@@ -684,6 +698,7 @@ function EditIconList({
|
|
|
684
698
|
showLabel,
|
|
685
699
|
stackText,
|
|
686
700
|
dodont,
|
|
701
|
+
numbered,
|
|
687
702
|
labelClassName,
|
|
688
703
|
textClassName,
|
|
689
704
|
iconClassName,
|
|
@@ -765,6 +780,7 @@ function EditIconList({
|
|
|
765
780
|
showLabel,
|
|
766
781
|
stackText,
|
|
767
782
|
dodont,
|
|
783
|
+
numbered,
|
|
768
784
|
labelClassName,
|
|
769
785
|
textClassName,
|
|
770
786
|
iconClassName,
|
|
@@ -788,7 +804,7 @@ function EditIconList({
|
|
|
788
804
|
/* @__PURE__ */ jsx8(
|
|
789
805
|
IconButton,
|
|
790
806
|
{
|
|
791
|
-
icon: /* @__PURE__ */ jsx8(
|
|
807
|
+
icon: /* @__PURE__ */ jsx8(Plus, { size: 16 }),
|
|
792
808
|
label: "Add item",
|
|
793
809
|
size: "lg",
|
|
794
810
|
intent: "primary",
|
|
@@ -808,6 +824,7 @@ function EditableRow({
|
|
|
808
824
|
showLabel,
|
|
809
825
|
stackText,
|
|
810
826
|
dodont,
|
|
827
|
+
numbered,
|
|
811
828
|
labelClassName,
|
|
812
829
|
textClassName,
|
|
813
830
|
iconClassName,
|
|
@@ -877,22 +894,22 @@ function EditableRow({
|
|
|
877
894
|
ref: rowRef,
|
|
878
895
|
className: cn(
|
|
879
896
|
"group/row relative grid gap-x-3",
|
|
880
|
-
hasAnyIcon ? "grid-cols-[24px_1fr]" : "grid-cols-1"
|
|
881
|
-
isDropTarget && "border-t-2 border-primary"
|
|
897
|
+
hasAnyIcon ? "grid-cols-[24px_1fr]" : "grid-cols-1"
|
|
882
898
|
),
|
|
883
899
|
onFocusCapture: onEditableActivity,
|
|
884
900
|
onInput: onEditableActivity,
|
|
885
901
|
onMouseMove: () => setEditingSuppressed(false),
|
|
886
902
|
children: [
|
|
903
|
+
/* @__PURE__ */ jsx8(DropEdgeIndicator, { edge: isDropTarget ? "top" : null }),
|
|
887
904
|
hasAnyIcon && /* @__PURE__ */ jsxs6(
|
|
888
905
|
"div",
|
|
889
906
|
{
|
|
890
907
|
"data-testid": "icon-list-icon",
|
|
891
908
|
className: cn("relative flex items-start pt-0.5", iconColor),
|
|
892
|
-
onMouseEnter: () => setIconHover(true),
|
|
893
|
-
onMouseLeave: () => setIconHover(false),
|
|
909
|
+
onMouseEnter: numbered ? void 0 : () => setIconHover(true),
|
|
910
|
+
onMouseLeave: numbered ? void 0 : () => setIconHover(false),
|
|
894
911
|
children: [
|
|
895
|
-
/* @__PURE__ */ jsx8(
|
|
912
|
+
numbered ? /* @__PURE__ */ jsx8(NumberMarker, { n: index + 1 }) : /* @__PURE__ */ jsx8(
|
|
896
913
|
"button",
|
|
897
914
|
{
|
|
898
915
|
className: "cursor-pointer transition-opacity hover:opacity-70",
|
|
@@ -904,7 +921,7 @@ function EditableRow({
|
|
|
904
921
|
children: iconHover && !pickerOpen ? /* @__PURE__ */ jsx8(Pencil, { size: 18, className: "text-base-contrast-light" }) : iconEntry ? /* @__PURE__ */ jsx8(iconEntry.icon, { size: 18 }) : /* @__PURE__ */ jsx8("span", { className: "flex h-[18px] w-[18px] items-center justify-center rounded-sm border border-dashed border-base-contrast-light/40" })
|
|
905
922
|
}
|
|
906
923
|
),
|
|
907
|
-
pickerOpen && /* @__PURE__ */ jsx8("div", { className: "absolute top-full left-0 z-50 mt-1", children: /* @__PURE__ */ jsx8(
|
|
924
|
+
pickerOpen && !numbered && /* @__PURE__ */ jsx8("div", { className: "absolute top-full left-0 z-50 mt-1", children: /* @__PURE__ */ jsx8(
|
|
908
925
|
IconPicker,
|
|
909
926
|
{
|
|
910
927
|
selected: effectiveIconId,
|
|
@@ -965,7 +982,7 @@ function EditableRow({
|
|
|
965
982
|
setPickerOpen(false);
|
|
966
983
|
},
|
|
967
984
|
className: "cursor-pointer rounded bg-base/80 p-1 shadow-sm text-base-contrast-light hover:text-primary",
|
|
968
|
-
children: item.dodont === "do" ? /* @__PURE__ */ jsx8(Check2, { size: 14, className: "text-
|
|
985
|
+
children: item.dodont === "do" ? /* @__PURE__ */ jsx8(Check2, { size: 14, className: "text-success" }) : item.dodont === "dont" ? /* @__PURE__ */ jsx8(X2, { size: 14, className: "text-danger" }) : /* @__PURE__ */ jsx8(Pencil, { size: 14 })
|
|
969
986
|
}
|
|
970
987
|
),
|
|
971
988
|
dodontOpen && /* @__PURE__ */ jsx8("div", { className: "absolute top-full right-0 z-50 mt-1", children: /* @__PURE__ */ jsx8(
|
|
@@ -1003,7 +1020,7 @@ function EditableRow({
|
|
|
1003
1020
|
/* @__PURE__ */ jsx8(
|
|
1004
1021
|
IconButton,
|
|
1005
1022
|
{
|
|
1006
|
-
icon: /* @__PURE__ */ jsx8(
|
|
1023
|
+
icon: /* @__PURE__ */ jsx8(Trash2, { size: 14 }),
|
|
1007
1024
|
label: "Delete item",
|
|
1008
1025
|
size: "sm",
|
|
1009
1026
|
intent: "destructive",
|
|
@@ -1049,68 +1066,84 @@ function TrailingDropZone({
|
|
|
1049
1066
|
};
|
|
1050
1067
|
}, [index, listId, setDragState]);
|
|
1051
1068
|
const isDropTarget = dragState.targetId === trailingId;
|
|
1052
|
-
return /* @__PURE__ */ jsx8(
|
|
1053
|
-
"div",
|
|
1054
|
-
{
|
|
1055
|
-
ref,
|
|
1056
|
-
className: cn("absolute bottom-0 left-0 right-0 h-4", isDropTarget && "border-t-2 border-primary")
|
|
1057
|
-
}
|
|
1058
|
-
);
|
|
1069
|
+
return /* @__PURE__ */ jsx8("div", { ref, className: "absolute bottom-0 left-0 right-0 h-4", children: /* @__PURE__ */ jsx8("div", { className: "relative h-full", children: /* @__PURE__ */ jsx8(DropEdgeIndicator, { edge: isDropTarget ? "top" : null }) }) });
|
|
1059
1070
|
}
|
|
1060
1071
|
|
|
1061
1072
|
// src/components/sections/IconList/IconListSettings.tsx
|
|
1062
1073
|
import { useState as useState5 } from "react";
|
|
1063
|
-
import { Check as Check3, X as X3 } from "lucide-react";
|
|
1074
|
+
import { Check as Check3, Hash, Shapes, X as X3 } from "lucide-react";
|
|
1064
1075
|
import { jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1065
1076
|
function IconListSettings({
|
|
1066
1077
|
icon: initialIcon,
|
|
1067
1078
|
showLabel: initialShowLabel,
|
|
1068
1079
|
stackText: initialStackText,
|
|
1069
1080
|
dodont: initialDodont,
|
|
1081
|
+
marker: initialMarker,
|
|
1070
1082
|
onChange
|
|
1071
1083
|
}) {
|
|
1072
1084
|
const [icon, setIcon] = useState5(initialIcon);
|
|
1073
1085
|
const [showLabel, setShowLabel] = useState5(initialShowLabel);
|
|
1074
1086
|
const [stackText, setStackText] = useState5(initialStackText);
|
|
1075
1087
|
const [dodont, setDodont] = useState5(initialDodont);
|
|
1088
|
+
const [marker, setMarker] = useState5(initialMarker === "number" ? "number" : void 0);
|
|
1076
1089
|
const [pickerOpen, setPickerOpen] = useState5(false);
|
|
1077
|
-
const emit = (overrides) => onChange({ content: {}, options: { icon, showLabel, stackText, dodont, ...overrides } });
|
|
1090
|
+
const emit = (overrides) => onChange({ content: {}, options: { icon, showLabel, stackText, dodont, marker, ...overrides } });
|
|
1078
1091
|
const iconEntry = icon ? getIcon(icon) : null;
|
|
1079
1092
|
const dodontActive = dodont === "do" || dodont === "dont";
|
|
1080
|
-
const
|
|
1093
|
+
const numbered = marker === "number" && !dodontActive;
|
|
1094
|
+
const iconDisabled = dodontActive || numbered;
|
|
1095
|
+
const pickDodont = (value) => {
|
|
1096
|
+
setDodont(value);
|
|
1097
|
+
if (value) {
|
|
1098
|
+
setMarker(void 0);
|
|
1099
|
+
emit({ dodont: value, marker: void 0 });
|
|
1100
|
+
} else {
|
|
1101
|
+
emit({ dodont: value });
|
|
1102
|
+
}
|
|
1103
|
+
};
|
|
1104
|
+
const tile = (pressed, onPick, label, aria, glyph, tint) => /* @__PURE__ */ jsxs7(
|
|
1081
1105
|
"button",
|
|
1082
1106
|
{
|
|
1083
1107
|
type: "button",
|
|
1084
1108
|
"aria-label": aria,
|
|
1085
|
-
"aria-pressed":
|
|
1109
|
+
"aria-pressed": pressed,
|
|
1086
1110
|
className: cn(
|
|
1087
1111
|
"cursor-pointer flex flex-col items-center gap-1 rounded border py-2 transition-colors",
|
|
1088
1112
|
tint,
|
|
1089
|
-
|
|
1113
|
+
pressed ? "border-primary bg-base-accent" : "border-base-200"
|
|
1090
1114
|
),
|
|
1091
|
-
onClick:
|
|
1092
|
-
setDodont(value);
|
|
1093
|
-
emit({ dodont: value });
|
|
1094
|
-
},
|
|
1115
|
+
onClick: onPick,
|
|
1095
1116
|
children: [
|
|
1096
1117
|
glyph,
|
|
1097
1118
|
/* @__PURE__ */ jsx9("span", { className: "text-xs font-medium", children: label })
|
|
1098
1119
|
]
|
|
1099
1120
|
}
|
|
1100
1121
|
);
|
|
1122
|
+
const dodontTile = (value, label, aria, glyph, tint) => tile(dodont === value, () => pickDodont(value), label, aria, glyph, tint);
|
|
1123
|
+
const markerTile = (value, label, aria, glyph) => tile(marker === value, () => {
|
|
1124
|
+
setMarker(value);
|
|
1125
|
+
emit({ marker: value });
|
|
1126
|
+
}, label, aria, glyph, "text-base-contrast-light");
|
|
1101
1127
|
return /* @__PURE__ */ jsxs7("div", { className: "space-y-4", children: [
|
|
1102
1128
|
/* @__PURE__ */ jsxs7("div", { children: [
|
|
1103
1129
|
/* @__PURE__ */ jsx9(FormLabel, { children: "Do / Don't list" }),
|
|
1104
1130
|
/* @__PURE__ */ jsxs7("div", { className: "grid grid-cols-3 gap-2", children: [
|
|
1105
|
-
|
|
1131
|
+
dodontTile(
|
|
1106
1132
|
void 0,
|
|
1107
1133
|
"None",
|
|
1108
1134
|
"No do/don't",
|
|
1109
1135
|
/* @__PURE__ */ jsx9("span", { className: "flex h-5 w-5 items-center justify-center rounded-sm border border-dashed border-base-contrast-light/40" }),
|
|
1110
1136
|
"text-base-contrast-light"
|
|
1111
1137
|
),
|
|
1112
|
-
|
|
1113
|
-
|
|
1138
|
+
dodontTile("do", "Do", "Do list", /* @__PURE__ */ jsx9(Check3, { size: 20 }), "text-success"),
|
|
1139
|
+
dodontTile("dont", "Don't", "Don't list", /* @__PURE__ */ jsx9(X3, { size: 20 }), "text-danger")
|
|
1140
|
+
] })
|
|
1141
|
+
] }),
|
|
1142
|
+
!dodontActive && /* @__PURE__ */ jsxs7("div", { children: [
|
|
1143
|
+
/* @__PURE__ */ jsx9(FormLabel, { children: "Marker" }),
|
|
1144
|
+
/* @__PURE__ */ jsxs7("div", { className: "grid grid-cols-2 gap-2", children: [
|
|
1145
|
+
markerTile(void 0, "Icon", "Icon markers", /* @__PURE__ */ jsx9(Shapes, { size: 20 })),
|
|
1146
|
+
markerTile("number", "Number", "Number markers", /* @__PURE__ */ jsx9(Hash, { size: 20 }))
|
|
1114
1147
|
] })
|
|
1115
1148
|
] }),
|
|
1116
1149
|
/* @__PURE__ */ jsxs7("div", { className: "relative", children: [
|
|
@@ -1120,13 +1153,13 @@ function IconListSettings({
|
|
|
1120
1153
|
"button",
|
|
1121
1154
|
{
|
|
1122
1155
|
id: "icon-picker-btn",
|
|
1123
|
-
disabled:
|
|
1156
|
+
disabled: iconDisabled,
|
|
1124
1157
|
className: cn(
|
|
1125
1158
|
"flex items-center gap-2 rounded border border-base-200 px-3 py-1.5 text-sm text-base-contrast-light",
|
|
1126
|
-
|
|
1159
|
+
iconDisabled ? "cursor-not-allowed opacity-50" : "cursor-pointer hover:border-primary hover:text-primary"
|
|
1127
1160
|
),
|
|
1128
1161
|
onClick: () => {
|
|
1129
|
-
if (!
|
|
1162
|
+
if (!iconDisabled) setPickerOpen((prev) => !prev);
|
|
1130
1163
|
},
|
|
1131
1164
|
children: [
|
|
1132
1165
|
iconEntry && /* @__PURE__ */ jsx9(iconEntry.icon, { size: 16 }),
|
|
@@ -1134,7 +1167,7 @@ function IconListSettings({
|
|
|
1134
1167
|
]
|
|
1135
1168
|
}
|
|
1136
1169
|
),
|
|
1137
|
-
icon && !
|
|
1170
|
+
icon && !iconDisabled && /* @__PURE__ */ jsx9(
|
|
1138
1171
|
"button",
|
|
1139
1172
|
{
|
|
1140
1173
|
className: "cursor-pointer text-xs text-base-contrast-light hover:text-base-contrast",
|
|
@@ -1146,8 +1179,8 @@ function IconListSettings({
|
|
|
1146
1179
|
}
|
|
1147
1180
|
)
|
|
1148
1181
|
] }),
|
|
1149
|
-
|
|
1150
|
-
pickerOpen && !
|
|
1182
|
+
iconDisabled && /* @__PURE__ */ jsx9("p", { className: "mt-1 text-xs text-base-contrast-light/70", children: numbered ? "Numbered lists don't show icons." : "Whole-list Do/Don't overrides the default icon." }),
|
|
1183
|
+
pickerOpen && !iconDisabled && /* @__PURE__ */ jsx9("div", { className: "absolute top-full left-0 z-50 mt-1", children: /* @__PURE__ */ jsx9(
|
|
1151
1184
|
IconPicker,
|
|
1152
1185
|
{
|
|
1153
1186
|
selected: icon,
|
|
@@ -1206,7 +1239,10 @@ var schema2 = z3.object({
|
|
|
1206
1239
|
icon: z3.string().nullable().describe("Default icon name applied to items that don't specify their own; null for no icon.").optional(),
|
|
1207
1240
|
showLabel: z3.boolean().describe("When true, render each item's label.").optional(),
|
|
1208
1241
|
stackText: z3.boolean().describe("When true, stack the label and text vertically instead of inline.").optional(),
|
|
1209
|
-
dodont: z3.enum(["do", "dont"]).describe("Whole-list do/don't mode: render every item with a green check (do) or red x (don't).").optional()
|
|
1242
|
+
dodont: z3.enum(["do", "dont"]).describe("Whole-list do/don't mode: render every item with a green check (do) or red x (don't).").optional(),
|
|
1243
|
+
marker: z3.enum(["icon", "number"]).describe(
|
|
1244
|
+
'What marks each item: "icon" (default when absent) or "number" \u2014 bold numerals 1, 2, 3\u2026 in place of icons, ignoring item and default icons. Standard lists only: ignored when options.dodont is set.'
|
|
1245
|
+
).optional()
|
|
1210
1246
|
}).optional()
|
|
1211
1247
|
});
|
|
1212
1248
|
var doDontListPreset = {
|
|
@@ -1231,7 +1267,7 @@ var IconList_default = defineSection({
|
|
|
1231
1267
|
label: "Icon List",
|
|
1232
1268
|
icon: /* @__PURE__ */ jsx10(List, { size: 18 }),
|
|
1233
1269
|
schema: schema2,
|
|
1234
|
-
authoringNote:
|
|
1270
|
+
authoringNote: `A list of labeled items, optionally with per-item icons and do/don't markers, or numbered instead (options.marker: "number"). Use for feature lists, guidelines, steps, or do/don't guidance.`,
|
|
1235
1271
|
component: ({ content, options, onChange }) => /* @__PURE__ */ jsx10(
|
|
1236
1272
|
IconList,
|
|
1237
1273
|
{
|
|
@@ -1240,6 +1276,7 @@ var IconList_default = defineSection({
|
|
|
1240
1276
|
showLabel: options?.showLabel,
|
|
1241
1277
|
stackText: options?.stackText,
|
|
1242
1278
|
dodont: options?.dodont,
|
|
1279
|
+
marker: options?.marker,
|
|
1243
1280
|
onChange: onChange ? (c) => onChange({ ...c, options: content.options }) : void 0
|
|
1244
1281
|
}
|
|
1245
1282
|
),
|
|
@@ -1261,7 +1298,7 @@ import { Check as Check4, X as X4 } from "lucide-react";
|
|
|
1261
1298
|
import { jsx as jsx11, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1262
1299
|
function DoDontMediaBlock({ refValue, options, link, dodont, isEditMode, onRefChange }) {
|
|
1263
1300
|
return /* @__PURE__ */ jsxs8("div", { children: [
|
|
1264
|
-
/* @__PURE__ */ jsx11("div", { className: "flex h-10 items-center justify-center pb-1", children: dodont === "do" ? /* @__PURE__ */ jsx11(Check4, { size: 28, className: "text-
|
|
1301
|
+
/* @__PURE__ */ jsx11("div", { className: "flex h-10 items-center justify-center pb-1", children: dodont === "do" ? /* @__PURE__ */ jsx11(Check4, { size: 28, className: "text-success" }) : /* @__PURE__ */ jsx11(X4, { size: 28, className: "text-danger" }) }),
|
|
1265
1302
|
/* @__PURE__ */ jsx11(
|
|
1266
1303
|
MediaBlock,
|
|
1267
1304
|
{
|
|
@@ -1292,7 +1329,10 @@ var schema3 = z4.object({
|
|
|
1292
1329
|
square: z4.boolean().describe("When true, crop the media to a 1:1 square aspect ratio.").optional(),
|
|
1293
1330
|
showCaption: z4.boolean().describe("When true, render the asset's caption beneath it.").optional(),
|
|
1294
1331
|
border: z4.boolean().describe("When true, draw a border around the media.").optional(),
|
|
1295
|
-
objectFit: z4.enum(["cover", "contain"]).describe("How the image fills its box: 'contain' (fit whole image) or 'cover' (fill and crop).").optional()
|
|
1332
|
+
objectFit: z4.enum(["cover", "contain"]).describe("How the image fills its box: 'contain' (fit whole image) or 'cover' (fill and crop).").optional(),
|
|
1333
|
+
background: ImageBackgroundSchema.describe(
|
|
1334
|
+
"Optional backdrop filling the image box, for images that need contrast (e.g. a white transparent logo). 'theme' picks the site's light or dark surface separately for light and dark mode; 'custom' uses one hex for both. Images only \u2014 ignored for video. Omit for none."
|
|
1335
|
+
).optional()
|
|
1296
1336
|
}).default({})
|
|
1297
1337
|
});
|
|
1298
1338
|
var DoDontMedia_default = defineSection({
|
|
@@ -1333,6 +1373,11 @@ var DoDontMedia_default = defineSection({
|
|
|
1333
1373
|
{ label: "Cover", value: "cover" }
|
|
1334
1374
|
]
|
|
1335
1375
|
},
|
|
1376
|
+
background: {
|
|
1377
|
+
type: "image-background",
|
|
1378
|
+
label: "Image background",
|
|
1379
|
+
hidden: (values) => values.ref?.type === "video"
|
|
1380
|
+
},
|
|
1336
1381
|
link: { type: "link", label: "Link", default: DEFAULT_LINK, target: "content" },
|
|
1337
1382
|
dodont: {
|
|
1338
1383
|
type: "select",
|
|
@@ -1347,7 +1392,7 @@ var DoDontMedia_default = defineSection({
|
|
|
1347
1392
|
},
|
|
1348
1393
|
inheritableSettings: ["square", "showCaption", "border", "objectFit"],
|
|
1349
1394
|
settingsTabs: [
|
|
1350
|
-
{ label: "Display", fields: ["square", "showCaption", "border", "objectFit"] },
|
|
1395
|
+
{ label: "Display", fields: ["square", "showCaption", "border", "objectFit", "background"] },
|
|
1351
1396
|
{ label: "Link", fields: ["link"] },
|
|
1352
1397
|
{ label: "Do / Don't", fields: ["dodont"] }
|
|
1353
1398
|
]
|
|
@@ -1606,13 +1651,516 @@ var Document_default = defineSection({
|
|
|
1606
1651
|
]
|
|
1607
1652
|
});
|
|
1608
1653
|
|
|
1654
|
+
// src/components/sections/SectionSummary/index.tsx
|
|
1655
|
+
import { useContext } from "react";
|
|
1656
|
+
import { z as z6 } from "zod";
|
|
1657
|
+
import { ListChecks } from "lucide-react";
|
|
1658
|
+
|
|
1659
|
+
// src/components/shared/SummaryAnchorsContext.ts
|
|
1660
|
+
import { createContext } from "react";
|
|
1661
|
+
var SummaryAnchorsContext = createContext({});
|
|
1662
|
+
|
|
1663
|
+
// src/components/sections/SectionSummary/SectionSummaryBlock.tsx
|
|
1664
|
+
import { useId as useId2, useState as useState8 } from "react";
|
|
1665
|
+
import { Fragment, jsx as jsx15, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1666
|
+
var LABEL_FONT = "var(--font-label, var(--font-heading, system-ui))";
|
|
1667
|
+
var ACCENT_FONT = "var(--font-accent, var(--font-heading, cursive))";
|
|
1668
|
+
var INK_SOFT = "color-mix(in srgb, var(--color-on-primary, #fff) 70%, var(--color-primary))";
|
|
1669
|
+
var PLATE_LINE = "color-mix(in srgb, var(--color-on-primary, #fff) 25%, var(--color-primary))";
|
|
1670
|
+
var sanitizeIdPart = (s) => s.toLowerCase().replace(/[^a-z0-9-]/g, "");
|
|
1671
|
+
function linkIsSet(link) {
|
|
1672
|
+
return link.kind === "external" ? link.href.trim() !== "" : link.pageId !== "";
|
|
1673
|
+
}
|
|
1674
|
+
function linkHref(link) {
|
|
1675
|
+
if (link.kind === "external") return { href: link.href.trim(), target: link.target };
|
|
1676
|
+
return { href: "" };
|
|
1677
|
+
}
|
|
1678
|
+
function displayLabel(item) {
|
|
1679
|
+
if (item.linkLabel.trim() !== "") return item.linkLabel.trim();
|
|
1680
|
+
if (item.link.kind === "external") return item.link.href.trim();
|
|
1681
|
+
return "";
|
|
1682
|
+
}
|
|
1683
|
+
function JumpLinkModalBody({
|
|
1684
|
+
initialLink,
|
|
1685
|
+
onApply,
|
|
1686
|
+
onRemove
|
|
1687
|
+
}) {
|
|
1688
|
+
const { pages, getPageHeadings } = usePages();
|
|
1689
|
+
const [link, setLink] = useState8(initialLink);
|
|
1690
|
+
const deriveLabel = (l) => {
|
|
1691
|
+
if (l.kind !== "internal" || !l.pageId) return "";
|
|
1692
|
+
if (l.anchorSectionId) {
|
|
1693
|
+
const h = getPageHeadings(l.pageId).find((x) => x.id === l.anchorSectionId);
|
|
1694
|
+
if (h) return h.label;
|
|
1695
|
+
}
|
|
1696
|
+
return pages.find((pg) => pg.id === l.pageId)?.title ?? "";
|
|
1697
|
+
};
|
|
1698
|
+
const handle = (l) => {
|
|
1699
|
+
setLink(l);
|
|
1700
|
+
onApply(l, l.kind === "internal" ? deriveLabel(l) : "");
|
|
1701
|
+
};
|
|
1702
|
+
return /* @__PURE__ */ jsxs11("div", { className: "flex flex-col gap-4", children: [
|
|
1703
|
+
/* @__PURE__ */ jsx15(LinkField, { label: "Jump-link target", value: link, onChange: handle }),
|
|
1704
|
+
linkIsSet(link) && /* @__PURE__ */ jsx15(
|
|
1705
|
+
"button",
|
|
1706
|
+
{
|
|
1707
|
+
type: "button",
|
|
1708
|
+
className: "cursor-pointer self-start text-sm text-base-contrast-light underline hover:text-base-contrast",
|
|
1709
|
+
onClick: () => {
|
|
1710
|
+
setLink(DEFAULT_LINK);
|
|
1711
|
+
onRemove();
|
|
1712
|
+
},
|
|
1713
|
+
children: "Remove jump link"
|
|
1714
|
+
}
|
|
1715
|
+
)
|
|
1716
|
+
] });
|
|
1717
|
+
}
|
|
1718
|
+
function buildCss(p, numbered) {
|
|
1719
|
+
return [
|
|
1720
|
+
`#${p}{background:var(--color-primary);border-radius:var(--radius-outer, 18px);padding:1.4rem 1.4rem 1.1rem;color:var(--color-on-primary, #fff);}`,
|
|
1721
|
+
`#${p} .ss-head{display:flex;justify-content:space-between;align-items:baseline;gap:1rem;flex-wrap:wrap;}`,
|
|
1722
|
+
`#${p} .ss-kicker{font-family:${LABEL_FONT};font-weight:700;letter-spacing:.18em;font-size:.78rem;color:var(--color-primary-contrast);text-transform:uppercase;}`,
|
|
1723
|
+
`#${p} .ss-accent{font-family:${ACCENT_FONT};font-size:1.45rem;color:var(--color-on-primary, #fff);opacity:.92;text-align:right;}`,
|
|
1724
|
+
// The list: neutralize EditableList's utility gap so rhythm comes from item
|
|
1725
|
+
// padding + rules (id-scoped, so it wins in both view and edit mode).
|
|
1726
|
+
`#${p} .ss-list{margin-top:.5rem;gap:0;}`,
|
|
1727
|
+
`#${p} .ss-item{display:grid;grid-template-columns:${numbered ? "max-content 1fr" : "1fr"};column-gap:.9rem;align-items:baseline;padding:.95rem 0;border-top:1px solid ${PLATE_LINE};}`,
|
|
1728
|
+
`#${p} .ss-list > div:first-child .ss-item{border-top:0;padding-top:.6rem;}`,
|
|
1729
|
+
`#${p} .ss-num{font-family:${LABEL_FONT};font-weight:700;font-size:.78rem;letter-spacing:.1em;color:var(--color-primary-contrast);}`,
|
|
1730
|
+
`#${p} .ss-h{font-weight:700;font-size:1.22rem;line-height:1.3;}`,
|
|
1731
|
+
`#${p} .ss-x{color:${INK_SOFT};font-size:.98rem;line-height:1.45;margin-top:.25rem;}`,
|
|
1732
|
+
// Jump-link trails each item on its own line. When no link is set the element
|
|
1733
|
+
// is kept (visibility:hidden) so toggling a link never shifts the layout.
|
|
1734
|
+
`#${p} .ss-jumprow{margin-top:.4rem;}`,
|
|
1735
|
+
`#${p} .ss-arrow{margin-right:.4em;}`,
|
|
1736
|
+
`#${p} .ss-jump{display:inline-block;font-family:${LABEL_FONT};font-size:.7rem;font-weight:700;letter-spacing:.12em;text-transform:uppercase;color:${INK_SOFT};text-decoration:none;white-space:nowrap;border-bottom:1px solid ${PLATE_LINE};transition:color .15s,border-color .15s;}`,
|
|
1737
|
+
`#${p} a.ss-jump:hover{color:var(--color-primary-contrast);border-color:var(--color-primary-contrast);}`,
|
|
1738
|
+
`#${p} .ss-foot{margin-top:.4rem;padding-top:.9rem;border-top:1px solid ${PLATE_LINE};display:flex;justify-content:space-between;align-items:baseline;gap:1rem;font-family:${LABEL_FONT};font-size:.72rem;font-weight:700;letter-spacing:.12em;text-transform:uppercase;color:${INK_SOFT};}`,
|
|
1739
|
+
`#${p} .ss-copy{background:none;border:0;padding:0;cursor:pointer;font:inherit;letter-spacing:inherit;text-transform:inherit;color:${INK_SOFT};border-bottom:1px solid ${PLATE_LINE};transition:color .15s,border-color .15s;}`,
|
|
1740
|
+
`#${p} .ss-copy:hover,#${p} .ss-copy.ss-copied{color:var(--color-primary-contrast);border-color:var(--color-primary-contrast);}`,
|
|
1741
|
+
// Editor-only: the jump-link trigger (opens the picker modal) and the
|
|
1742
|
+
// EditableList "Add row" button, both branded with --color-primary-contrast.
|
|
1743
|
+
`#${p} .ss-jumpedit{display:inline-flex;align-items:center;background:none;border:0;padding:0;cursor:pointer;font-family:${LABEL_FONT};font-size:.7rem;font-weight:700;letter-spacing:.12em;text-transform:uppercase;color:${INK_SOFT};transition:color .15s;}`,
|
|
1744
|
+
`#${p} .ss-jumpedit:hover{color:var(--color-primary-contrast);}`,
|
|
1745
|
+
`#${p} .ss-jumpedit.is-set{border-bottom:1px solid ${PLATE_LINE};}`,
|
|
1746
|
+
`#${p} .ss-jumpedit-ic{margin-left:.4em;opacity:.7;}`,
|
|
1747
|
+
`#${p} .ss-list > button{border-color:var(--color-primary-contrast);color:var(--color-primary-contrast);}`,
|
|
1748
|
+
`#${p} .ss-list > button:hover{background:color-mix(in srgb, var(--color-primary-contrast) 12%, transparent);}`,
|
|
1749
|
+
// EditableList's drag/drop chrome renders inside the primary-filled plate, so
|
|
1750
|
+
// tint the drag handle and the drop-target indicator (a border-primary top
|
|
1751
|
+
// rule that would otherwise vanish into the plate) to the same soft on-primary
|
|
1752
|
+
// ink as the jump-link trigger.
|
|
1753
|
+
`#${p} .ss-list button.cursor-grab{color:${INK_SOFT};}`,
|
|
1754
|
+
`#${p} .ss-list .border-primary{border-color:${INK_SOFT};}`,
|
|
1755
|
+
`#${p} [contenteditable]{outline:none;caret-color:var(--color-primary-contrast);}`,
|
|
1756
|
+
`#${p} [contenteditable]:focus{box-shadow:0 0 0 2px color-mix(in srgb, var(--color-primary-contrast) 55%, transparent);border-radius:var(--radius-inner, 6px);}`
|
|
1757
|
+
].join("\n");
|
|
1758
|
+
}
|
|
1759
|
+
function copyScript(p) {
|
|
1760
|
+
return `(function(){var bind=function(){var c=document.getElementById("${p}");if(!c||c.dataset.ssBound)return;c.dataset.ssBound="1";c.addEventListener("click",function(e){var t=e.target&&e.target.closest?e.target.closest(".ss-copy"):null;if(!t||!c.contains(t)||t.classList.contains("ss-copied")||!(navigator.clipboard&&navigator.clipboard.writeText))return;var lines=[];var k=c.querySelector(".ss-kicker");if(k&&k.textContent&&k.textContent.trim())lines.push(k.textContent.trim().toUpperCase());var items=c.querySelectorAll(".ss-item");for(var i=0;i<items.length;i++){var h=items[i].querySelector(".ss-h");var x=items[i].querySelector(".ss-x");var xt="";if(x){var cl=x.cloneNode(true);var j=cl.querySelector(".ss-jump");if(j)j.remove();xt=(cl.textContent||"").trim();}var ht=((h&&h.textContent)||"").trim();if(ht||xt)lines.push("\\u2022 "+ht+(xt?" \\u2014 "+xt:""));}navigator.clipboard.writeText(lines.join("\\n")).then(function(){var o=t.textContent;t.classList.add("ss-copied");t.textContent="\\u2713 Copied";setTimeout(function(){t.classList.remove("ss-copied");t.textContent=o;},1400);},function(){});});};bind();if(document.readyState==="loading"){document.addEventListener("DOMContentLoaded",bind);}})();`;
|
|
1761
|
+
}
|
|
1762
|
+
var pad2 = (n) => String(n).padStart(2, "0");
|
|
1763
|
+
function SectionSummaryBlock({
|
|
1764
|
+
sectionId,
|
|
1765
|
+
kicker,
|
|
1766
|
+
accent,
|
|
1767
|
+
footNote,
|
|
1768
|
+
items,
|
|
1769
|
+
options,
|
|
1770
|
+
isEditMode,
|
|
1771
|
+
openModal,
|
|
1772
|
+
onKickerChange,
|
|
1773
|
+
onAccentChange,
|
|
1774
|
+
onFootNoteChange,
|
|
1775
|
+
onItemsChange,
|
|
1776
|
+
navAnchor,
|
|
1777
|
+
navHint
|
|
1778
|
+
}) {
|
|
1779
|
+
const reactId = useId2();
|
|
1780
|
+
const p = `ss-${sanitizeIdPart(sectionId ?? "") || sanitizeIdPart(reactId) || "x"}`;
|
|
1781
|
+
const edit = !!isEditMode;
|
|
1782
|
+
const numbered = options.numbered ?? true;
|
|
1783
|
+
const visibleItems = items.filter(
|
|
1784
|
+
(item) => item.headline.trim() !== "" || item.explainer.trim() !== "" || linkIsSet(item.link)
|
|
1785
|
+
);
|
|
1786
|
+
const rowCount = edit ? items.length : visibleItems.length;
|
|
1787
|
+
const showFooter = (options.showFooter ?? true) && (edit || footNote.trim() !== "" || rowCount > 0);
|
|
1788
|
+
const showCopyButton = showFooter && (options.showCopy ?? true) && rowCount > 0;
|
|
1789
|
+
const showAccent = (options.showAccent ?? true) && (edit ? !!onAccentChange : accent.trim() !== "");
|
|
1790
|
+
const showKicker = edit ? !!onKickerChange : kicker.trim() !== "";
|
|
1791
|
+
const css = buildCss(p, numbered);
|
|
1792
|
+
const [copied, setCopied] = useState8(false);
|
|
1793
|
+
const onCopyClick = () => {
|
|
1794
|
+
if (copied || !navigator.clipboard?.writeText) return;
|
|
1795
|
+
const lines = [];
|
|
1796
|
+
if (kicker.trim()) lines.push(kicker.trim().toUpperCase());
|
|
1797
|
+
for (const item of items) {
|
|
1798
|
+
const h = item.headline.trim();
|
|
1799
|
+
const x = item.explainer.trim();
|
|
1800
|
+
if (h || x) lines.push(`\u2022 ${h}${x ? ` \u2014 ${x}` : ""}`);
|
|
1801
|
+
}
|
|
1802
|
+
navigator.clipboard.writeText(lines.join("\n")).then(
|
|
1803
|
+
() => {
|
|
1804
|
+
setCopied(true);
|
|
1805
|
+
setTimeout(() => setCopied(false), 1400);
|
|
1806
|
+
},
|
|
1807
|
+
() => {
|
|
1808
|
+
}
|
|
1809
|
+
);
|
|
1810
|
+
};
|
|
1811
|
+
const renderViewItem = (item, index) => {
|
|
1812
|
+
const { href, target } = linkHref(item.link);
|
|
1813
|
+
const hasLink = href !== "";
|
|
1814
|
+
const label = displayLabel(item);
|
|
1815
|
+
return /* @__PURE__ */ jsxs11("div", { className: "ss-item", children: [
|
|
1816
|
+
numbered && /* @__PURE__ */ jsx15("span", { className: "ss-num", "aria-hidden": "true", children: pad2(index + 1) }),
|
|
1817
|
+
/* @__PURE__ */ jsxs11("div", { className: "ss-body", children: [
|
|
1818
|
+
/* @__PURE__ */ jsx15("div", { className: "ss-h", children: item.headline }),
|
|
1819
|
+
item.explainer.trim() !== "" && /* @__PURE__ */ jsx15("div", { className: "ss-x", children: item.explainer }),
|
|
1820
|
+
/* @__PURE__ */ jsx15("div", { className: "ss-jumprow", children: hasLink ? /* @__PURE__ */ jsxs11("a", { className: "ss-jump", href, target, children: [
|
|
1821
|
+
/* @__PURE__ */ jsx15("span", { className: "ss-arrow", "aria-hidden": "true", children: "\u21A9" }),
|
|
1822
|
+
label
|
|
1823
|
+
] }) : (
|
|
1824
|
+
// Reserve the line so a row with/without a link keeps the same height.
|
|
1825
|
+
/* @__PURE__ */ jsx15("span", { className: "ss-jump", style: { visibility: "hidden" }, "aria-hidden": "true", children: "\u21A9 Link" })
|
|
1826
|
+
) })
|
|
1827
|
+
] })
|
|
1828
|
+
] });
|
|
1829
|
+
};
|
|
1830
|
+
const renderEditItem = (item, index) => {
|
|
1831
|
+
const set = (patch) => {
|
|
1832
|
+
const next = items.slice();
|
|
1833
|
+
next[index] = { ...next[index], ...patch };
|
|
1834
|
+
onItemsChange?.(next);
|
|
1835
|
+
};
|
|
1836
|
+
const label = displayLabel(item);
|
|
1837
|
+
const isSet = linkIsSet(item.link);
|
|
1838
|
+
const openLinkModal = () => openModal?.(
|
|
1839
|
+
"Jump link",
|
|
1840
|
+
/* @__PURE__ */ jsx15(
|
|
1841
|
+
JumpLinkModalBody,
|
|
1842
|
+
{
|
|
1843
|
+
initialLink: item.link,
|
|
1844
|
+
onApply: (link, linkLabel) => set({ link, linkLabel }),
|
|
1845
|
+
onRemove: () => set({ link: DEFAULT_LINK, linkLabel: "" })
|
|
1846
|
+
}
|
|
1847
|
+
)
|
|
1848
|
+
);
|
|
1849
|
+
return /* @__PURE__ */ jsxs11("div", { className: "ss-item", children: [
|
|
1850
|
+
numbered && /* @__PURE__ */ jsx15("span", { className: "ss-num", children: pad2(index + 1) }),
|
|
1851
|
+
/* @__PURE__ */ jsxs11("div", { className: "ss-body", children: [
|
|
1852
|
+
/* @__PURE__ */ jsx15(
|
|
1853
|
+
EditablePlainText,
|
|
1854
|
+
{
|
|
1855
|
+
tag: "div",
|
|
1856
|
+
className: "ss-h",
|
|
1857
|
+
value: item.headline,
|
|
1858
|
+
onChange: (headline) => set({ headline }),
|
|
1859
|
+
isEditMode: true,
|
|
1860
|
+
placeholder: "Headline"
|
|
1861
|
+
}
|
|
1862
|
+
),
|
|
1863
|
+
/* @__PURE__ */ jsx15(
|
|
1864
|
+
EditablePlainText,
|
|
1865
|
+
{
|
|
1866
|
+
tag: "div",
|
|
1867
|
+
className: "ss-x",
|
|
1868
|
+
value: item.explainer,
|
|
1869
|
+
onChange: (explainer) => set({ explainer }),
|
|
1870
|
+
isEditMode: true,
|
|
1871
|
+
placeholder: "One-sentence explainer (optional)"
|
|
1872
|
+
}
|
|
1873
|
+
),
|
|
1874
|
+
/* @__PURE__ */ jsx15("div", { className: "ss-jumprow", children: /* @__PURE__ */ jsx15(
|
|
1875
|
+
"button",
|
|
1876
|
+
{
|
|
1877
|
+
type: "button",
|
|
1878
|
+
className: isSet ? "ss-jumpedit is-set" : "ss-jumpedit",
|
|
1879
|
+
onClick: openLinkModal,
|
|
1880
|
+
children: isSet ? /* @__PURE__ */ jsxs11(Fragment, { children: [
|
|
1881
|
+
/* @__PURE__ */ jsx15("span", { className: "ss-arrow", "aria-hidden": "true", children: "\u21A9" }),
|
|
1882
|
+
label || "Edit jump link",
|
|
1883
|
+
/* @__PURE__ */ jsx15("span", { className: "ss-jumpedit-ic", "aria-hidden": "true", children: " \u270E" })
|
|
1884
|
+
] }) : "+ Add jump link"
|
|
1885
|
+
}
|
|
1886
|
+
) })
|
|
1887
|
+
] })
|
|
1888
|
+
] });
|
|
1889
|
+
};
|
|
1890
|
+
const autoNote = rowCount > 0 ? `${pad2(rowCount)} ${rowCount === 1 ? "principle" : "principles"}` : "";
|
|
1891
|
+
const plate = /* @__PURE__ */ jsxs11("div", { id: p, children: [
|
|
1892
|
+
/* @__PURE__ */ jsx15("style", { dangerouslySetInnerHTML: { __html: css } }),
|
|
1893
|
+
(showKicker || showAccent) && /* @__PURE__ */ jsxs11("div", { className: "ss-head", children: [
|
|
1894
|
+
showKicker && (edit && onKickerChange ? /* @__PURE__ */ jsx15(
|
|
1895
|
+
EditablePlainText,
|
|
1896
|
+
{
|
|
1897
|
+
tag: "span",
|
|
1898
|
+
className: "ss-kicker",
|
|
1899
|
+
value: kicker,
|
|
1900
|
+
onChange: onKickerChange,
|
|
1901
|
+
isEditMode: true,
|
|
1902
|
+
placeholder: "Section \u2014 Summary"
|
|
1903
|
+
}
|
|
1904
|
+
) : /* @__PURE__ */ jsx15("span", { className: "ss-kicker", children: kicker })),
|
|
1905
|
+
showAccent && (edit && onAccentChange ? /* @__PURE__ */ jsx15(
|
|
1906
|
+
EditablePlainText,
|
|
1907
|
+
{
|
|
1908
|
+
tag: "span",
|
|
1909
|
+
className: "ss-accent",
|
|
1910
|
+
value: accent,
|
|
1911
|
+
onChange: onAccentChange,
|
|
1912
|
+
isEditMode: true,
|
|
1913
|
+
placeholder: "tl;dr",
|
|
1914
|
+
style: { marginLeft: "auto" }
|
|
1915
|
+
}
|
|
1916
|
+
) : /* @__PURE__ */ jsx15("span", { className: "ss-accent", style: { marginLeft: "auto" }, children: accent }))
|
|
1917
|
+
] }),
|
|
1918
|
+
edit && onItemsChange ? /* @__PURE__ */ jsx15(
|
|
1919
|
+
EditableList,
|
|
1920
|
+
{
|
|
1921
|
+
className: "ss-list",
|
|
1922
|
+
items,
|
|
1923
|
+
onChange: onItemsChange,
|
|
1924
|
+
createItem: () => ({ headline: "", explainer: "", link: DEFAULT_LINK, linkLabel: "" }),
|
|
1925
|
+
isEditMode: true,
|
|
1926
|
+
renderItem: (item, { index }) => renderEditItem(item, index)
|
|
1927
|
+
}
|
|
1928
|
+
) : visibleItems.length > 0 && /* @__PURE__ */ jsx15("div", { className: "ss-list", style: { display: "flex", flexDirection: "column" }, children: visibleItems.map((item, index) => /* @__PURE__ */ jsx15("div", { children: renderViewItem(item, index) }, index)) }),
|
|
1929
|
+
showFooter && /* @__PURE__ */ jsxs11("div", { className: "ss-foot", children: [
|
|
1930
|
+
edit && onFootNoteChange ? /* @__PURE__ */ jsx15(
|
|
1931
|
+
EditablePlainText,
|
|
1932
|
+
{
|
|
1933
|
+
tag: "span",
|
|
1934
|
+
value: footNote,
|
|
1935
|
+
onChange: onFootNoteChange,
|
|
1936
|
+
isEditMode: true,
|
|
1937
|
+
placeholder: autoNote || "Footer note"
|
|
1938
|
+
}
|
|
1939
|
+
) : /* @__PURE__ */ jsx15("span", { children: footNote.trim() || autoNote }),
|
|
1940
|
+
showCopyButton && /* @__PURE__ */ jsx15(
|
|
1941
|
+
"button",
|
|
1942
|
+
{
|
|
1943
|
+
type: "button",
|
|
1944
|
+
className: copied ? "ss-copy ss-copied" : "ss-copy",
|
|
1945
|
+
"aria-live": "polite",
|
|
1946
|
+
onClick: edit ? onCopyClick : void 0,
|
|
1947
|
+
children: copied ? "\u2713 Copied" : "\u29C9 Copy summary"
|
|
1948
|
+
}
|
|
1949
|
+
)
|
|
1950
|
+
] }),
|
|
1951
|
+
!edit && showCopyButton && /* @__PURE__ */ jsx15("script", { dangerouslySetInnerHTML: { __html: copyScript(p) } })
|
|
1952
|
+
] });
|
|
1953
|
+
const hint = edit && navHint ? /* @__PURE__ */ jsx15("p", { className: "mt-2 text-xs text-warning", children: navHint }) : null;
|
|
1954
|
+
if (!navAnchor && !hint) return plate;
|
|
1955
|
+
return (
|
|
1956
|
+
// The nav anchor sits on a wrapper: the plate's own id is the CSS/script scope.
|
|
1957
|
+
/* @__PURE__ */ jsxs11("div", { id: navAnchor, className: navAnchor ? "scroll-mt-20" : void 0, children: [
|
|
1958
|
+
plate,
|
|
1959
|
+
hint
|
|
1960
|
+
] })
|
|
1961
|
+
);
|
|
1962
|
+
}
|
|
1963
|
+
|
|
1964
|
+
// src/components/sections/SectionSummary/SectionSummarySettings.tsx
|
|
1965
|
+
import { useState as useState9 } from "react";
|
|
1966
|
+
import { jsx as jsx16, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1967
|
+
var navOptions = [
|
|
1968
|
+
{ label: "Off", value: "off" },
|
|
1969
|
+
{ label: "Heading", value: "heading" },
|
|
1970
|
+
{ label: "Subheading", value: "subheading" }
|
|
1971
|
+
];
|
|
1972
|
+
function SectionSummarySettings({
|
|
1973
|
+
kicker = "",
|
|
1974
|
+
accent = "",
|
|
1975
|
+
footNote = "",
|
|
1976
|
+
showAccent = true,
|
|
1977
|
+
showFooter = true,
|
|
1978
|
+
showCopy = true,
|
|
1979
|
+
numbered = true,
|
|
1980
|
+
nav = "off",
|
|
1981
|
+
navLabel = "",
|
|
1982
|
+
onChange
|
|
1983
|
+
}) {
|
|
1984
|
+
const [v, setV] = useState9({ kicker, accent, footNote, showAccent, showFooter, showCopy, numbered, nav, navLabel });
|
|
1985
|
+
const update = (patch) => {
|
|
1986
|
+
const next = { ...v, ...patch };
|
|
1987
|
+
setV(next);
|
|
1988
|
+
onChange({
|
|
1989
|
+
content: { kicker: next.kicker, accent: next.accent, footNote: next.footNote },
|
|
1990
|
+
options: {
|
|
1991
|
+
showAccent: next.showAccent,
|
|
1992
|
+
showFooter: next.showFooter,
|
|
1993
|
+
showCopy: next.showCopy,
|
|
1994
|
+
numbered: next.numbered,
|
|
1995
|
+
// Off is stored as an absent key; the label is kept so turning nav back
|
|
1996
|
+
// on restores it.
|
|
1997
|
+
nav: next.nav === "off" ? void 0 : next.nav,
|
|
1998
|
+
navLabel: next.navLabel
|
|
1999
|
+
}
|
|
2000
|
+
});
|
|
2001
|
+
};
|
|
2002
|
+
const navOn = v.nav !== "off";
|
|
2003
|
+
const panel = "flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto px-px";
|
|
2004
|
+
return /* @__PURE__ */ jsx16(
|
|
2005
|
+
Tabs,
|
|
2006
|
+
{
|
|
2007
|
+
fullBleedTabBar: true,
|
|
2008
|
+
tabs: [
|
|
2009
|
+
{
|
|
2010
|
+
id: "text",
|
|
2011
|
+
label: "Text",
|
|
2012
|
+
content: /* @__PURE__ */ jsxs12("div", { className: panel, children: [
|
|
2013
|
+
/* @__PURE__ */ jsx16(Input, { label: "Kicker", value: v.kicker, placeholder: "Brand Color \u2014 Summary", onChange: (kicker2) => update({ kicker: kicker2 }) }),
|
|
2014
|
+
/* @__PURE__ */ jsx16(Input, { label: "Accent flourish", value: v.accent, placeholder: "tl;dr", onChange: (accent2) => update({ accent: accent2 }) }),
|
|
2015
|
+
/* @__PURE__ */ jsx16(Input, { label: "Footer note", value: v.footNote, placeholder: "Brand Color \xB7 06 principles", onChange: (footNote2) => update({ footNote: footNote2 }) })
|
|
2016
|
+
] })
|
|
2017
|
+
},
|
|
2018
|
+
{
|
|
2019
|
+
id: "display",
|
|
2020
|
+
label: "Display",
|
|
2021
|
+
content: /* @__PURE__ */ jsxs12("div", { className: panel, children: [
|
|
2022
|
+
/* @__PURE__ */ jsx16(Checkbox, { label: "Show accent", checked: v.showAccent, onChange: (showAccent2) => update({ showAccent: showAccent2 }) }),
|
|
2023
|
+
/* @__PURE__ */ jsx16(Checkbox, { label: "Show footer", checked: v.showFooter, onChange: (showFooter2) => update({ showFooter: showFooter2 }) }),
|
|
2024
|
+
/* @__PURE__ */ jsx16(Checkbox, { label: "Show copy action", checked: v.showCopy, onChange: (showCopy2) => update({ showCopy: showCopy2 }) }),
|
|
2025
|
+
/* @__PURE__ */ jsx16(Checkbox, { label: "Number the items", checked: v.numbered, onChange: (numbered2) => update({ numbered: numbered2 }) })
|
|
2026
|
+
] })
|
|
2027
|
+
},
|
|
2028
|
+
{
|
|
2029
|
+
id: "nav",
|
|
2030
|
+
label: "Navigation",
|
|
2031
|
+
content: /* @__PURE__ */ jsxs12("div", { className: panel, children: [
|
|
2032
|
+
/* @__PURE__ */ jsx16(
|
|
2033
|
+
Select,
|
|
2034
|
+
{
|
|
2035
|
+
label: "Nav",
|
|
2036
|
+
value: v.nav,
|
|
2037
|
+
options: navOptions,
|
|
2038
|
+
onChange: (value) => {
|
|
2039
|
+
const level = value;
|
|
2040
|
+
const prefill = level !== "off" && !v.navLabel.trim();
|
|
2041
|
+
update(prefill ? { nav: level, navLabel: v.kicker } : { nav: level });
|
|
2042
|
+
}
|
|
2043
|
+
}
|
|
2044
|
+
),
|
|
2045
|
+
v.nav === "subheading" && /* @__PURE__ */ jsx16("p", { className: "-mt-2 text-xs text-base-contrast-light", children: "Nests under the nearest Link Heading above this plate; with none above it, it is left out of the nav." }),
|
|
2046
|
+
navOn && /* @__PURE__ */ jsx16(
|
|
2047
|
+
Input,
|
|
2048
|
+
{
|
|
2049
|
+
label: "Nav label",
|
|
2050
|
+
value: v.navLabel,
|
|
2051
|
+
onChange: (label) => update({ navLabel: label }),
|
|
2052
|
+
error: v.navLabel.trim() ? void 0 : "Required while this plate is in the nav."
|
|
2053
|
+
}
|
|
2054
|
+
)
|
|
2055
|
+
] })
|
|
2056
|
+
}
|
|
2057
|
+
]
|
|
2058
|
+
}
|
|
2059
|
+
);
|
|
2060
|
+
}
|
|
2061
|
+
|
|
2062
|
+
// src/components/sections/SectionSummary/index.tsx
|
|
2063
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
2064
|
+
var itemSchema = z6.object({
|
|
2065
|
+
headline: z6.string().default("").describe('The principle, short and bold, e.g. "Saturation > Subtlety".'),
|
|
2066
|
+
explainer: z6.string().default("").describe("Optional one-sentence explainer rendered softly beneath the headline."),
|
|
2067
|
+
link: LinkValueSchema.default(DEFAULT_LINK).describe(
|
|
2068
|
+
"Optional jump-link trailing the principle, back to the sub-section it distills. Set with the link picker: an internal page/section (label auto-derived from the page or section name) or an external URL. An empty link renders nothing, but its space is reserved so the layout stays stable."
|
|
2069
|
+
),
|
|
2070
|
+
linkLabel: z6.string().default("").describe(
|
|
2071
|
+
"The jump-link label. Auto-derived from the linked page or section name for internal links (kept in sync as you edit); for external links it falls back to the URL."
|
|
2072
|
+
)
|
|
2073
|
+
});
|
|
2074
|
+
var schema5 = z6.object({
|
|
2075
|
+
type: z6.literal("section_summary"),
|
|
2076
|
+
content: z6.object({
|
|
2077
|
+
kicker: z6.string().default("").describe(`Uppercase label in the plate's top-left, e.g. "Brand Color \u2014 Summary".`),
|
|
2078
|
+
accent: z6.string().default("").describe(`Script flourish in the plate's top-right, e.g. "tl;dr".`),
|
|
2079
|
+
items: z6.array(itemSchema).default([]).describe("The summary principles, in display order (numbered automatically)."),
|
|
2080
|
+
footNote: z6.string().default("").describe(
|
|
2081
|
+
`Contextual note in the footer's bottom-left, e.g. "Brand Color \xB7 06 principles". Empty = auto "<count> principles".`
|
|
2082
|
+
)
|
|
2083
|
+
}),
|
|
2084
|
+
options: z6.object({
|
|
2085
|
+
showAccent: z6.boolean().describe("Show the script accent (default true).").optional(),
|
|
2086
|
+
showFooter: z6.boolean().describe("Show the footer row (default true).").optional(),
|
|
2087
|
+
showCopy: z6.boolean().describe("Show the copy-summary action in the footer (default true).").optional(),
|
|
2088
|
+
numbered: z6.boolean().describe("Show the accent-colored item numerals (default true).").optional(),
|
|
2089
|
+
nav: z6.enum(["off", "heading", "subheading"]).describe(
|
|
2090
|
+
'Put this plate in the page nav: "heading" = top level (like a Link Heading), "subheading" = nested under the preceding Link Heading (dropped from the nav if there is none, like a Sub Heading). Absent or "off" = not in the nav.'
|
|
2091
|
+
).optional(),
|
|
2092
|
+
navLabel: z6.string().describe(
|
|
2093
|
+
"The plate's nav entry text; REQUIRED while nav is on (no label = no entry). Its anchor is derived from it, suffixed -2, -3\u2026 if another anchor on the page already has it."
|
|
2094
|
+
).optional()
|
|
2095
|
+
}).default({})
|
|
2096
|
+
});
|
|
2097
|
+
var SectionSummary_default = defineSection({
|
|
2098
|
+
type: "section_summary",
|
|
2099
|
+
category: "brand-guide",
|
|
2100
|
+
label: "TL;DR / Summary",
|
|
2101
|
+
icon: /* @__PURE__ */ jsx17(ListChecks, { size: 18 }),
|
|
2102
|
+
schema: schema5,
|
|
2103
|
+
authoringNote: `An end-of-section TL;DR plate: numbered principles (bold headline + optional one-sentence explainer) with an optional jump-link trailing each explainer back to the sub-section it distills. Place it as the LAST block of a major section. Each principle's jump-link is set with the link picker \u2014 an internal page/section (its label auto-derived from the page or section name) or an external URL; an empty link renders nothing. The footer shows footNote (or an auto "<count> principles" note) plus a copy action that puts the whole summary on the clipboard as plain text (kicker + "\u2022 headline \u2014 explainer" lines). Fully functional on the logged-out viewer \u2014 no hydration. Optionally appears in the page nav (options.nav heading/subheading with a required options.navLabel). Headlines/explainers are composed from truths in the section above; never introduce facts here that the section itself does not state.`,
|
|
2104
|
+
component: function SectionSummarySection({ content, options, onChange, openModal }) {
|
|
2105
|
+
const c = content.content;
|
|
2106
|
+
const set = (patch) => onChange?.({ ...content, content: { ...c, ...patch } });
|
|
2107
|
+
const id = content.id;
|
|
2108
|
+
const opts = options ?? {};
|
|
2109
|
+
const editorAnchor = useContext(SummaryAnchorsContext)[id ?? ""];
|
|
2110
|
+
const navAnchor = editorAnchor?.anchor ?? content.navAnchor;
|
|
2111
|
+
const navOn = opts.nav === "heading" || opts.nav === "subheading";
|
|
2112
|
+
const navHint = !navOn ? void 0 : !opts.navLabel?.trim() ? "Not in the nav: add a nav label in Settings." : editorAnchor && !editorAnchor.inNav ? "Not in the nav: a Subheading needs a Link Heading above it." : void 0;
|
|
2113
|
+
return /* @__PURE__ */ jsx17(
|
|
2114
|
+
SectionSummaryBlock,
|
|
2115
|
+
{
|
|
2116
|
+
sectionId: id,
|
|
2117
|
+
kicker: c.kicker,
|
|
2118
|
+
accent: c.accent,
|
|
2119
|
+
footNote: c.footNote,
|
|
2120
|
+
items: c.items,
|
|
2121
|
+
options: opts,
|
|
2122
|
+
isEditMode: !!onChange,
|
|
2123
|
+
openModal,
|
|
2124
|
+
onKickerChange: onChange ? (kicker) => set({ kicker }) : void 0,
|
|
2125
|
+
onAccentChange: onChange ? (accent) => set({ accent }) : void 0,
|
|
2126
|
+
onFootNoteChange: onChange ? (footNote) => set({ footNote }) : void 0,
|
|
2127
|
+
onItemsChange: onChange ? (items) => set({ items }) : void 0,
|
|
2128
|
+
navAnchor,
|
|
2129
|
+
navHint
|
|
2130
|
+
}
|
|
2131
|
+
);
|
|
2132
|
+
},
|
|
2133
|
+
// Inserts ready-to-use with one starter row to overwrite — no empty state to
|
|
2134
|
+
// climb out of.
|
|
2135
|
+
defaults: () => ({
|
|
2136
|
+
type: "section_summary",
|
|
2137
|
+
content: {
|
|
2138
|
+
kicker: "Summary",
|
|
2139
|
+
accent: "tl;dr",
|
|
2140
|
+
items: [
|
|
2141
|
+
{
|
|
2142
|
+
headline: "First principle",
|
|
2143
|
+
explainer: "One sentence on why it matters.",
|
|
2144
|
+
link: DEFAULT_LINK,
|
|
2145
|
+
linkLabel: ""
|
|
2146
|
+
}
|
|
2147
|
+
],
|
|
2148
|
+
footNote: ""
|
|
2149
|
+
},
|
|
2150
|
+
options: {}
|
|
2151
|
+
}),
|
|
2152
|
+
getLabel: (content) => content.content.kicker || "TL;DR / Summary",
|
|
2153
|
+
settingsForm: SectionSummarySettings
|
|
2154
|
+
});
|
|
2155
|
+
|
|
1609
2156
|
// src/components/sections/brand-guide.ts
|
|
1610
|
-
var brandGuideSectionDefs = [Colors_default, IconList_default, DoDontMedia_default, Document_default];
|
|
2157
|
+
var brandGuideSectionDefs = [Colors_default, IconList_default, DoDontMedia_default, Document_default, SectionSummary_default];
|
|
1611
2158
|
|
|
1612
2159
|
export {
|
|
1613
2160
|
stripHtmlToPlainText,
|
|
1614
2161
|
truncate,
|
|
1615
2162
|
pluralize,
|
|
2163
|
+
SummaryAnchorsContext,
|
|
1616
2164
|
ColorSpaceSchema,
|
|
1617
2165
|
ColorItemSchema,
|
|
1618
2166
|
brandGuideSectionDefs
|