@drawnagency/primitives 0.1.113 → 0.1.114
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/auth/cookies.d.ts +39 -0
- package/dist/auth/cookies.d.ts.map +1 -1
- package/dist/auth/index.js +3 -3
- package/dist/{chunk-GPPVYLEI.js → chunk-45FA7Z55.js} +1 -1
- package/dist/{chunk-REDDTTGJ.js → chunk-4Y2JQQZL.js} +19 -1
- package/dist/chunk-5GFACGSN.js +6 -0
- package/dist/chunk-5KSAS4VY.js +275 -0
- package/dist/{chunk-Z7W3DQTR.js → chunk-7SAAJVDE.js} +408 -28
- package/dist/{chunk-S2L3BPLS.js → chunk-7SX42OP4.js} +1 -1
- package/dist/{chunk-GGXZZ77Z.js → chunk-AASEGXNT.js} +18 -1
- package/dist/{chunk-WKZ7OENC.js → chunk-BQ5TZZUE.js} +5 -1
- package/dist/chunk-DIMDRBFK.js +11 -0
- package/dist/{chunk-WUJ3XNFI.js → chunk-GGYY3JQJ.js} +19 -24
- package/dist/{chunk-NHN2LSIU.js → chunk-IP2SEBAJ.js} +5 -1
- package/dist/{chunk-IINIZBQB.js → chunk-JCDZAFX2.js} +30 -10
- package/dist/chunk-JR24U7FJ.js +120 -0
- package/dist/{chunk-SW6PCQQD.js → chunk-KQA772WQ.js} +2 -1
- package/dist/{chunk-KR2MHTNJ.js → chunk-N3G7DOU3.js} +609 -61
- package/dist/chunk-OAGJBCSH.js +67 -0
- package/dist/{chunk-6BZ2KNTP.js → chunk-PLANHXS7.js} +191 -61
- package/dist/{chunk-VWWY5TL5.js → chunk-PNSCDBU7.js} +38 -56
- package/dist/{chunk-AHALSCQH.js → chunk-PTY2RG2K.js} +1 -1
- package/dist/{chunk-BDFTMGCL.js → chunk-PZPGJZRG.js} +9 -8
- package/dist/{chunk-FRE2CCLV.js → chunk-QHMKIODQ.js} +17 -4
- package/dist/{chunk-HBULBDGP.js → chunk-S37DZPHW.js} +1 -1
- package/dist/{chunk-4I5OO5UB.js → chunk-TEOAKGZA.js} +0 -1
- package/dist/chunk-VUYCRBJK.js +174 -0
- package/dist/{chunk-4RNF2DRG.js → chunk-XDEPXTBY.js} +0 -2
- package/dist/{chunk-DS4GCYV2.js → chunk-Y5QECJX7.js} +223 -16
- package/dist/collab/rebase.d.ts +2 -1
- package/dist/collab/rebase.d.ts.map +1 -1
- package/dist/collab/rebase.js +20 -5
- package/dist/components/brandguide/ColorsEditable.d.ts.map +1 -1
- package/dist/components/chat/ChatPanel.d.ts.map +1 -1
- package/dist/components/chat/ChatWidget.d.ts.map +1 -1
- package/dist/components/docfile/DocFilePane.d.ts.map +1 -1
- package/dist/components/editor/ChildBlockWrapper.d.ts.map +1 -1
- package/dist/components/editor/ConflictDialog.d.ts.map +1 -1
- package/dist/components/editor/DragHandle.d.ts +12 -2
- package/dist/components/editor/DragHandle.d.ts.map +1 -1
- package/dist/components/editor/DropEdgeIndicator.d.ts +15 -6
- package/dist/components/editor/DropEdgeIndicator.d.ts.map +1 -1
- package/dist/components/editor/NavGroupRow.d.ts +4 -1
- package/dist/components/editor/NavGroupRow.d.ts.map +1 -1
- package/dist/components/editor/PagesModal.d.ts.map +1 -1
- package/dist/components/editor/SectionWrapper.d.ts +1 -1
- package/dist/components/editor/SectionWrapper.d.ts.map +1 -1
- package/dist/components/editor/SettingsForm.d.ts.map +1 -1
- package/dist/components/editor/TagIndicator.d.ts +15 -0
- package/dist/components/editor/TagIndicator.d.ts.map +1 -0
- package/dist/components/editor/index.js +148 -77
- package/dist/components/primitives/DocumentDropZone.d.ts +1 -1
- package/dist/components/primitives/EditableGrid.d.ts.map +1 -1
- package/dist/components/primitives/EditableList.d.ts.map +1 -1
- package/dist/components/primitives/HeadingSection.d.ts +4 -1
- package/dist/components/primitives/HeadingSection.d.ts.map +1 -1
- package/dist/components/primitives/ResolvedMedia.d.ts +5 -1
- package/dist/components/primitives/ResolvedMedia.d.ts.map +1 -1
- package/dist/components/primitives/{defineHeadingSection.d.ts → define-heading-section.d.ts} +1 -1
- package/dist/components/primitives/define-heading-section.d.ts.map +1 -0
- package/dist/components/primitives/{gridDrop.d.ts → grid-drop.d.ts} +1 -1
- package/dist/components/primitives/grid-drop.d.ts.map +1 -0
- package/dist/components/primitives/index.d.ts +1 -1
- package/dist/components/primitives/index.d.ts.map +1 -1
- package/dist/components/primitives/index.js +17 -154
- package/dist/components/sections/Button/CTAButton.d.ts.map +1 -1
- package/dist/components/sections/DoDontMedia/DoDontMediaBlock.d.ts +2 -6
- package/dist/components/sections/DoDontMedia/DoDontMediaBlock.d.ts.map +1 -1
- package/dist/components/sections/DoDontMedia/index.d.ts +8 -0
- package/dist/components/sections/DoDontMedia/index.d.ts.map +1 -1
- package/dist/components/sections/IconList/IconList.d.ts +2 -1
- package/dist/components/sections/IconList/IconList.d.ts.map +1 -1
- package/dist/components/sections/IconList/IconListSettings.d.ts +2 -1
- package/dist/components/sections/IconList/IconListSettings.d.ts.map +1 -1
- package/dist/components/sections/IconList/index.d.ts +1 -0
- package/dist/components/sections/IconList/index.d.ts.map +1 -1
- package/dist/components/sections/Media/MediaBlock.d.ts +2 -1
- package/dist/components/sections/Media/MediaBlock.d.ts.map +1 -1
- package/dist/components/sections/Media/index.d.ts +8 -0
- package/dist/components/sections/Media/index.d.ts.map +1 -1
- package/dist/components/sections/Reference/ReferenceList.d.ts +35 -0
- package/dist/components/sections/Reference/ReferenceList.d.ts.map +1 -0
- package/dist/components/sections/Reference/ReferenceSettings.d.ts +12 -0
- package/dist/components/sections/Reference/ReferenceSettings.d.ts.map +1 -0
- package/dist/components/sections/Reference/index.d.ts +9 -0
- package/dist/components/sections/Reference/index.d.ts.map +1 -0
- package/dist/components/sections/SectionSummary/SectionSummaryBlock.d.ts +38 -0
- package/dist/components/sections/SectionSummary/SectionSummaryBlock.d.ts.map +1 -0
- package/dist/components/sections/SectionSummary/SectionSummarySettings.d.ts +20 -0
- package/dist/components/sections/SectionSummary/SectionSummarySettings.d.ts.map +1 -0
- package/dist/components/sections/SectionSummary/index.d.ts +33 -0
- package/dist/components/sections/SectionSummary/index.d.ts.map +1 -0
- package/dist/components/sections/all-sections.d.ts +53 -0
- package/dist/components/sections/all-sections.d.ts.map +1 -1
- package/dist/components/sections/brand-guide.d.ts +41 -2
- package/dist/components/sections/brand-guide.d.ts.map +1 -1
- package/dist/components/sections/brand-guide.js +12 -10
- package/dist/components/sections/core-sections.d.ts +14 -0
- package/dist/components/sections/core-sections.d.ts.map +1 -1
- package/dist/components/sections/register-schemas.js +19 -17
- package/dist/components/sections/register.js +19 -17
- package/dist/components/shared/BrandSwatchesContext.d.ts +9 -0
- package/dist/components/shared/BrandSwatchesContext.d.ts.map +1 -0
- package/dist/components/shared/Button.d.ts +11 -3
- package/dist/components/shared/Button.d.ts.map +1 -1
- package/dist/components/shared/Checkbox.d.ts +6 -0
- package/dist/components/shared/Checkbox.d.ts.map +1 -1
- package/dist/components/shared/ConfirmDialog.d.ts +25 -0
- package/dist/components/shared/ConfirmDialog.d.ts.map +1 -0
- package/dist/components/shared/ConfirmInline.d.ts +25 -0
- package/dist/components/shared/ConfirmInline.d.ts.map +1 -0
- package/dist/components/shared/ErrorBoundary.d.ts.map +1 -1
- package/dist/components/shared/Fab.d.ts +11 -2
- package/dist/components/shared/Fab.d.ts.map +1 -1
- package/dist/components/shared/FabStack.d.ts +22 -0
- package/dist/components/shared/FabStack.d.ts.map +1 -0
- package/dist/components/shared/HistoryChangesModal.d.ts.map +1 -1
- package/dist/components/shared/HistoryPopover.d.ts.map +1 -1
- package/dist/components/shared/ImageBackgroundField.d.ts +9 -0
- package/dist/components/shared/ImageBackgroundField.d.ts.map +1 -0
- package/dist/components/shared/{UploadRejectionAlert.d.ts → InlineAlert.d.ts} +4 -2
- package/dist/components/shared/InlineAlert.d.ts.map +1 -0
- package/dist/components/shared/Input.d.ts +10 -0
- package/dist/components/shared/Input.d.ts.map +1 -1
- package/dist/components/shared/Navigation.d.ts.map +1 -1
- package/dist/components/shared/Notice.d.ts +10 -0
- package/dist/components/shared/Notice.d.ts.map +1 -0
- package/dist/components/shared/Popover.d.ts.map +1 -1
- package/dist/components/shared/ReferenceSourcesContext.d.ts +25 -0
- package/dist/components/shared/ReferenceSourcesContext.d.ts.map +1 -0
- package/dist/components/shared/Select.d.ts +3 -2
- package/dist/components/shared/Select.d.ts.map +1 -1
- package/dist/components/shared/SplitButton.d.ts.map +1 -1
- package/dist/components/shared/SummaryAnchorsContext.d.ts +10 -0
- package/dist/components/shared/SummaryAnchorsContext.d.ts.map +1 -0
- package/dist/components/shared/Textarea.d.ts +7 -0
- package/dist/components/shared/Textarea.d.ts.map +1 -1
- package/dist/components/shared/ToolbarFrame.d.ts +17 -0
- package/dist/components/shared/ToolbarFrame.d.ts.map +1 -0
- package/dist/components/shared/copy.d.ts +13 -0
- package/dist/components/shared/copy.d.ts.map +1 -0
- package/dist/components/shared/icons.d.ts +0 -12
- package/dist/components/shared/icons.d.ts.map +1 -1
- package/dist/components/shell/AudienceDetailsPanel.d.ts +7 -1
- package/dist/components/shell/AudienceDetailsPanel.d.ts.map +1 -1
- package/dist/components/shell/AudienceRow.d.ts.map +1 -1
- package/dist/components/shell/BugReportFAB.d.ts +7 -1
- package/dist/components/shell/BugReportFAB.d.ts.map +1 -1
- package/dist/components/shell/CredentialList.d.ts.map +1 -1
- package/dist/components/shell/DocInspector.d.ts.map +1 -1
- package/dist/components/shell/DocumentEditorOverlay.d.ts.map +1 -1
- package/dist/components/shell/EditorContext.d.ts +4 -0
- package/dist/components/shell/EditorContext.d.ts.map +1 -1
- package/dist/components/shell/EditorLoginForm.d.ts.map +1 -1
- package/dist/components/shell/EditorModal.d.ts.map +1 -1
- package/dist/components/shell/EditorShell.d.ts.map +1 -1
- package/dist/components/shell/HistoryToolbar.d.ts.map +1 -1
- package/dist/components/shell/MediaFolderTile.d.ts +4 -1
- package/dist/components/shell/MediaFolderTile.d.ts.map +1 -1
- package/dist/components/shell/MediaLibraryModal.d.ts.map +1 -1
- package/dist/components/shell/RestoreModal.d.ts.map +1 -1
- package/dist/components/shell/SiteSettingsChatbot.d.ts.map +1 -1
- package/dist/components/shell/SiteSettingsDisplay.d.ts.map +1 -1
- package/dist/components/shell/SiteSettingsModal.d.ts +3 -1
- package/dist/components/shell/SiteSettingsModal.d.ts.map +1 -1
- package/dist/components/shell/SiteSettingsTags.d.ts +13 -0
- package/dist/components/shell/SiteSettingsTags.d.ts.map +1 -0
- package/dist/components/shell/SiteSettingsUsers.d.ts.map +1 -1
- package/dist/components/shell/ViewerLoginForm.d.ts.map +1 -1
- package/dist/components/shell/{blockMoveDispatch.d.ts → block-move-dispatch.d.ts} +1 -1
- package/dist/components/shell/block-move-dispatch.d.ts.map +1 -0
- package/dist/components/shell/reference-sources.d.ts +22 -0
- package/dist/components/shell/reference-sources.d.ts.map +1 -0
- package/dist/deck/index.d.ts +2 -2
- package/dist/deck/index.d.ts.map +1 -1
- package/dist/deck/index.js +1 -3
- package/dist/deck-builder/index.js +11 -18
- package/dist/document/index.d.ts +2 -2
- package/dist/document/index.d.ts.map +1 -1
- package/dist/hooks/useBlockDnd.d.ts +11 -0
- package/dist/hooks/useBlockDnd.d.ts.map +1 -1
- package/dist/hooks/useBuildStatus.d.ts +1 -1
- package/dist/hooks/useBuildStatus.d.ts.map +1 -1
- package/dist/hooks/useDocumentUploads.d.ts +1 -1
- package/dist/hooks/useDocumentUploads.d.ts.map +1 -1
- package/dist/hooks/useEditorPersistence.d.ts +5 -1
- package/dist/hooks/useEditorPersistence.d.ts.map +1 -1
- package/dist/hooks/useEditorPublish.d.ts +2 -2
- package/dist/hooks/useEditorPublish.d.ts.map +1 -1
- package/dist/hooks/useNotice.d.ts +19 -0
- package/dist/hooks/useNotice.d.ts.map +1 -0
- package/dist/hooks/useSortableNavRow.d.ts +11 -0
- package/dist/hooks/useSortableNavRow.d.ts.map +1 -1
- package/dist/hooks/useSortableRow.d.ts +11 -0
- package/dist/hooks/useSortableRow.d.ts.map +1 -1
- package/dist/hooks/useStackedEscape.d.ts +32 -0
- package/dist/hooks/useStackedEscape.d.ts.map +1 -0
- package/dist/index.js +67 -49
- package/dist/lib/audience-secret.js +2 -2
- package/dist/lib/block-dnd.d.ts +5 -0
- package/dist/lib/block-dnd.d.ts.map +1 -1
- package/dist/lib/block-move.d.ts.map +1 -1
- package/dist/lib/brand-swatches.d.ts +12 -0
- package/dist/lib/brand-swatches.d.ts.map +1 -0
- package/dist/lib/container-ops.d.ts +3 -2
- package/dist/lib/container-ops.d.ts.map +1 -1
- package/dist/lib/dexie.d.ts.map +1 -1
- package/dist/lib/dexie.js +9 -1
- package/dist/lib/env.d.ts +4 -0
- package/dist/lib/env.d.ts.map +1 -1
- package/dist/lib/env.js +5 -3
- package/dist/lib/events.d.ts +1 -2
- package/dist/lib/events.d.ts.map +1 -1
- package/dist/lib/image-background.d.ts +8 -0
- package/dist/lib/image-background.d.ts.map +1 -0
- package/dist/lib/index-ops.js +3 -3
- package/dist/lib/index.d.ts +6 -4
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +29 -21
- package/dist/lib/loader.d.ts +21 -7
- package/dist/lib/loader.d.ts.map +1 -1
- package/dist/lib/nav-tree.d.ts +1 -0
- package/dist/lib/nav-tree.d.ts.map +1 -1
- package/dist/lib/nav.d.ts +38 -0
- package/dist/lib/nav.d.ts.map +1 -1
- package/dist/lib/platform-broker.d.ts +4 -2
- package/dist/lib/platform-broker.d.ts.map +1 -1
- package/dist/lib/platform-broker.js +21 -13
- package/dist/lib/reference-type.d.ts +2 -0
- package/dist/lib/reference-type.d.ts.map +1 -0
- package/dist/lib/reference-validation.d.ts +31 -0
- package/dist/lib/reference-validation.d.ts.map +1 -0
- package/dist/lib/reference-validation.js +39 -0
- package/dist/lib/references.d.ts +74 -0
- package/dist/lib/references.d.ts.map +1 -0
- package/dist/lib/registry.d.ts +35 -0
- package/dist/lib/registry.d.ts.map +1 -1
- package/dist/lib/{safeRedirect.d.ts → safe-redirect.d.ts} +1 -1
- package/dist/lib/safe-redirect.d.ts.map +1 -0
- package/dist/lib/tags.d.ts +58 -0
- package/dist/lib/tags.d.ts.map +1 -0
- package/dist/lib/theme-vars.d.ts +9 -0
- package/dist/lib/theme-vars.d.ts.map +1 -1
- package/dist/media/index.d.ts +1 -1
- package/dist/media/index.d.ts.map +1 -1
- package/dist/media/index.js +8 -4
- package/dist/media/utils.d.ts +2 -0
- package/dist/media/utils.d.ts.map +1 -1
- package/dist/media/{videoPoster.d.ts → video-poster.d.ts} +1 -1
- package/dist/media/video-poster.d.ts.map +1 -0
- package/dist/schemas/audience.js +2 -2
- package/dist/schemas/index.d.ts +1 -0
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/schemas/index.js +14 -8
- package/dist/schemas/shared.d.ts +26 -0
- package/dist/schemas/shared.d.ts.map +1 -1
- package/dist/schemas/site-config.d.ts +6 -0
- package/dist/schemas/site-config.d.ts.map +1 -1
- package/dist/schemas/tags.d.ts +27 -0
- package/dist/schemas/tags.d.ts.map +1 -0
- package/dist/storage/index.js +1 -1
- package/dist/types/database.d.ts.map +1 -1
- package/package.json +6 -1
- package/src/auth/cookies.ts +111 -0
- package/src/collab/rebase.ts +26 -2
- package/src/components/brandguide/ColorSwatchSettings.tsx +1 -1
- package/src/components/brandguide/ColorsEditable.tsx +1 -0
- package/src/components/chat/ChatPanel.tsx +2 -3
- package/src/components/chat/ChatWidget.tsx +2 -3
- package/src/components/docfile/DocFilePane.tsx +4 -12
- package/src/components/editor/ChildBlockWrapper.tsx +13 -19
- package/src/components/editor/ConflictDialog.tsx +27 -35
- package/src/components/editor/DeleteButton.tsx +2 -2
- package/src/components/editor/DragHandle.tsx +16 -3
- package/src/components/editor/DropEdgeIndicator.tsx +36 -10
- package/src/components/editor/InsertButton.tsx +2 -2
- package/src/components/editor/NavGroupRow.tsx +43 -14
- package/src/components/editor/PagesModal.tsx +99 -26
- package/src/components/editor/SectionWrapper.tsx +64 -23
- package/src/components/editor/SettingsButton.tsx +2 -2
- package/src/components/editor/SettingsForm.tsx +19 -2
- package/src/components/editor/StatusIndicator.tsx +4 -4
- package/src/components/editor/TagIndicator.tsx +80 -0
- package/src/components/primitives/DocumentDropZone.tsx +1 -1
- package/src/components/primitives/EditableGrid.tsx +15 -14
- package/src/components/primitives/EditableList.tsx +27 -74
- package/src/components/primitives/HeadingSection.tsx +5 -2
- package/src/components/primitives/ResolvedMedia.tsx +13 -0
- package/src/components/primitives/{defineHeadingSection.tsx → define-heading-section.tsx} +1 -0
- package/src/components/primitives/index.ts +1 -1
- package/src/components/primitives/useEditablePlainText.ts +5 -5
- package/src/components/sections/Button/CTAButton.tsx +3 -1
- package/src/components/sections/DoDontMedia/DoDontMediaBlock.tsx +4 -4
- package/src/components/sections/DoDontMedia/index.tsx +12 -3
- package/src/components/sections/IconList/DoDontToggle.tsx +2 -2
- package/src/components/sections/IconList/IconList.tsx +70 -37
- package/src/components/sections/IconList/IconListSettings.tsx +55 -17
- package/src/components/sections/IconList/index.tsx +10 -3
- package/src/components/sections/LinkHeading/index.tsx +1 -1
- package/src/components/sections/Media/MediaBlock.tsx +13 -2
- package/src/components/sections/Media/index.tsx +12 -4
- package/src/components/sections/Reference/ReferenceList.tsx +214 -0
- package/src/components/sections/Reference/ReferenceSettings.tsx +159 -0
- package/src/components/sections/Reference/index.tsx +47 -0
- package/src/components/sections/SectionSummary/SectionSummaryBlock.tsx +476 -0
- package/src/components/sections/SectionSummary/SectionSummarySettings.tsx +126 -0
- package/src/components/sections/SectionSummary/index.tsx +149 -0
- package/src/components/sections/SubHeading/index.tsx +1 -1
- package/src/components/sections/SubSubHeading/index.tsx +1 -1
- package/src/components/sections/brand-guide.ts +4 -3
- package/src/components/sections/core-sections.ts +2 -0
- package/src/components/shared/BrandSwatchesContext.ts +13 -0
- package/src/components/shared/Button.tsx +47 -34
- package/src/components/shared/Checkbox.tsx +21 -12
- package/src/components/shared/ConfirmDialog.tsx +87 -0
- package/src/components/shared/ConfirmInline.tsx +90 -0
- package/src/components/shared/ErrorBoundary.tsx +6 -18
- package/src/components/shared/Fab.tsx +15 -5
- package/src/components/shared/FabStack.tsx +28 -0
- package/src/components/shared/HistoryChangesModal.tsx +43 -41
- package/src/components/shared/HistoryPopover.tsx +7 -20
- package/src/components/shared/ImageBackgroundField.tsx +92 -0
- package/src/components/shared/{UploadRejectionAlert.tsx → InlineAlert.tsx} +21 -5
- package/src/components/shared/Input.tsx +23 -7
- package/src/components/shared/Navigation.tsx +22 -17
- package/src/components/shared/Notice.tsx +59 -0
- package/src/components/shared/Popover.tsx +7 -11
- package/src/components/shared/ReferenceSourcesContext.ts +27 -0
- package/src/components/shared/Select.tsx +5 -2
- package/src/components/shared/SplitButton.tsx +11 -17
- package/src/components/shared/SummaryAnchorsContext.ts +11 -0
- package/src/components/shared/Textarea.tsx +17 -2
- package/src/components/shared/ToolbarFrame.tsx +28 -0
- package/src/components/shared/VideoSourceField.tsx +1 -1
- package/src/components/shared/copy.ts +18 -0
- package/src/components/shared/icons.tsx +1 -17
- package/src/components/shell/AudienceAddForm.tsx +2 -2
- package/src/components/shell/AudienceDetailsPanel.tsx +23 -5
- package/src/components/shell/AudienceRow.tsx +22 -15
- package/src/components/shell/BugReportFAB.tsx +50 -40
- package/src/components/shell/CredentialList.tsx +33 -13
- package/src/components/shell/DocInspector.tsx +3 -12
- package/src/components/shell/DocumentEditorOverlay.tsx +33 -23
- package/src/components/shell/EditorContext.tsx +7 -0
- package/src/components/shell/EditorLoginForm.tsx +26 -36
- package/src/components/shell/EditorModal.tsx +8 -10
- package/src/components/shell/EditorShell.tsx +499 -339
- package/src/components/shell/HistoryToolbar.tsx +24 -26
- package/src/components/shell/MediaFolderTile.tsx +8 -3
- package/src/components/shell/MediaLibraryModal.tsx +59 -60
- package/src/components/shell/ProcessingIndicator.tsx +2 -2
- package/src/components/shell/RestoreModal.tsx +17 -16
- package/src/components/shell/SetPasswordForm.tsx +3 -3
- package/src/components/shell/SiteSettingsChatbot.tsx +61 -42
- package/src/components/shell/SiteSettingsDisplay.tsx +10 -20
- package/src/components/shell/SiteSettingsModal.tsx +24 -2
- package/src/components/shell/SiteSettingsTags.tsx +143 -0
- package/src/components/shell/SiteSettingsUsers.tsx +36 -26
- package/src/components/shell/SiteSettingsViewerAccess.tsx +2 -2
- package/src/components/shell/ViewerLoginForm.tsx +5 -4
- package/src/components/shell/reference-sources.ts +36 -0
- package/src/deck/index.ts +2 -2
- package/src/document/index.ts +2 -2
- package/src/hooks/useBlockDnd.ts +11 -0
- package/src/hooks/useBuildStatus.ts +53 -6
- package/src/hooks/useDocumentUploads.ts +1 -1
- package/src/hooks/useEditorPersistence.ts +141 -35
- package/src/hooks/useEditorPublish.ts +18 -27
- package/src/hooks/useMediaPipeline.ts +1 -1
- package/src/hooks/useNotice.ts +45 -0
- package/src/hooks/useSortableNavRow.ts +11 -0
- package/src/hooks/useSortableRow.ts +22 -2
- package/src/hooks/useStackedEscape.ts +62 -0
- package/src/lib/block-dnd.ts +6 -1
- package/src/lib/block-move.ts +3 -0
- package/src/lib/brand-swatches.ts +32 -0
- package/src/lib/container-ops.ts +5 -3
- package/src/lib/dexie.ts +15 -1
- package/src/lib/env.ts +9 -0
- package/src/lib/events.ts +1 -2
- package/src/lib/image-background.ts +31 -0
- package/src/lib/index.ts +5 -4
- package/src/lib/loader.ts +54 -55
- package/src/lib/nav-tree.ts +71 -0
- package/src/lib/nav.ts +196 -36
- package/src/lib/platform-broker.ts +32 -14
- package/src/lib/reference-type.ts +3 -0
- package/src/lib/reference-validation.ts +69 -0
- package/src/lib/references.ts +130 -0
- package/src/lib/registry.ts +37 -0
- package/src/lib/tags.ts +148 -0
- package/src/lib/theme-vars.ts +23 -0
- package/src/media/index.ts +1 -1
- package/src/media/utils.ts +18 -0
- package/src/media/{videoPoster.ts → video-poster.ts} +2 -2
- package/src/schemas/index.ts +1 -0
- package/src/schemas/shared.ts +24 -1
- package/src/schemas/site-config.ts +6 -1
- package/src/schemas/tags.ts +33 -0
- package/src/storage/types.ts +1 -1
- package/src/types/database.ts +2 -0
- package/dist/chunk-DNY72JZN.js +0 -86
- package/dist/chunk-F2LYQPXV.js +0 -77
- package/dist/chunk-JH762VUH.js +0 -128
- package/dist/chunk-K7DYZXVU.js +0 -138
- package/dist/components/primitives/defineHeadingSection.d.ts.map +0 -1
- package/dist/components/primitives/gridDrop.d.ts.map +0 -1
- package/dist/components/shared/UploadRejectionAlert.d.ts.map +0 -1
- package/dist/components/shell/BuildStatusIndicator.d.ts +0 -7
- package/dist/components/shell/BuildStatusIndicator.d.ts.map +0 -1
- package/dist/components/shell/blockMoveDispatch.d.ts.map +0 -1
- package/dist/hooks/index.d.ts +0 -9
- package/dist/hooks/index.d.ts.map +0 -1
- package/dist/lib/grid.d.ts +0 -2
- package/dist/lib/grid.d.ts.map +0 -1
- package/dist/lib/safeRedirect.d.ts.map +0 -1
- package/dist/media/videoPoster.d.ts.map +0 -1
- package/src/components/brandguide/ColorSwatchSettings.d.ts.map +0 -1
- package/src/components/brandguide/Colors.d.ts.map +0 -1
- package/src/components/primitives/CustomParagraph.d.ts.map +0 -1
- package/src/components/primitives/EditableGrid.d.ts.map +0 -1
- package/src/components/primitives/EditablePlainText.d.ts.map +0 -1
- package/src/components/primitives/EditableRichText.d.ts.map +0 -1
- package/src/components/primitives/HeadingSection.d.ts.map +0 -1
- package/src/components/primitives/IconPicker.d.ts.map +0 -1
- package/src/components/primitives/LinkPopover.d.ts.map +0 -1
- package/src/components/primitives/MediaSettingsForms.d.ts.map +0 -1
- package/src/components/primitives/ResolvedMedia.d.ts.map +0 -1
- package/src/components/primitives/RichTextToolbar.d.ts.map +0 -1
- package/src/components/primitives/tiptap-presets.d.ts.map +0 -1
- package/src/components/primitives/useEditableCollection.d.ts.map +0 -1
- package/src/components/primitives/useEditablePlainText.d.ts.map +0 -1
- package/src/components/primitives/useEditableRichText.d.ts.map +0 -1
- package/src/components/sections/Button/CTAButton.d.ts.map +0 -1
- package/src/components/sections/Button/index.d.ts.map +0 -1
- package/src/components/sections/Colors/index.d.ts.map +0 -1
- package/src/components/sections/IconList/IconList.d.ts.map +0 -1
- package/src/components/sections/IconList/IconListSettings.d.ts.map +0 -1
- package/src/components/sections/IconList/index.d.ts.map +0 -1
- package/src/components/sections/LinkHeading/index.d.ts.map +0 -1
- package/src/components/sections/Prose/Prose.d.ts.map +0 -1
- package/src/components/sections/Prose/index.d.ts.map +0 -1
- package/src/components/sections/SubHeading/index.d.ts.map +0 -1
- package/src/components/sections/SubSubHeading/index.d.ts.map +0 -1
- package/src/components/sections/register-schemas.d.ts.map +0 -1
- package/src/components/shared/Button.d.ts.map +0 -1
- package/src/components/shared/Checkbox.d.ts.map +0 -1
- package/src/components/shared/FormLabel.d.ts.map +0 -1
- package/src/components/shared/IconButton.d.ts.map +0 -1
- package/src/components/shared/Input.d.ts.map +0 -1
- package/src/components/shared/Select.d.ts.map +0 -1
- package/src/components/shared/icons.d.ts.map +0 -1
- package/src/components/shell/BuildStatusIndicator.tsx +0 -59
- package/src/components/shell/MediaLibraryContext.d.ts.map +0 -1
- package/src/hooks/index.ts +0 -8
- package/src/hooks/useResolvedMedia.d.ts.map +0 -1
- package/src/lib/cn.d.ts.map +0 -1
- package/src/lib/grid.d.ts.map +0 -1
- package/src/lib/grid.ts +0 -7
- package/src/lib/icons.d.ts.map +0 -1
- package/src/lib/loader.d.ts.map +0 -1
- package/src/lib/nav.d.ts.map +0 -1
- package/src/lib/registry.d.ts.map +0 -1
- package/src/lib/sanitize.d.ts.map +0 -1
- package/src/media/github.d.ts.map +0 -1
- package/src/media/index.d.ts.map +0 -1
- package/src/media/queue.d.ts.map +0 -1
- package/src/media/resolve.d.ts.map +0 -1
- package/src/media/types.d.ts.map +0 -1
- package/src/media/utils.d.ts.map +0 -1
- package/src/media/videoPoster.d.ts.map +0 -1
- package/src/schemas/auth.d.ts.map +0 -1
- package/src/schemas/media-grid-options.d.ts.map +0 -1
- package/src/schemas/media.d.ts.map +0 -1
- package/src/schemas/sections.d.ts.map +0 -1
- package/src/schemas/shared.d.ts.map +0 -1
- package/src/schemas/site-config.d.ts.map +0 -1
- /package/dist/{chunk-B7VBSE5X.js → chunk-3JDTXOIG.js} +0 -0
- /package/dist/{chunk-CXZ5YJG4.js → chunk-L45X7DKX.js} +0 -0
- /package/src/components/primitives/{gridDrop.ts → grid-drop.ts} +0 -0
- /package/src/components/shell/{blockMoveDispatch.ts → block-move-dispatch.ts} +0 -0
- /package/src/lib/{safeRedirect.ts → safe-redirect.ts} +0 -0
package/dist/lib/dexie.js
CHANGED
|
@@ -169,7 +169,13 @@ async function restoreLocalChanges() {
|
|
|
169
169
|
const siteId = metaRow?.siteId || getDb().siteId;
|
|
170
170
|
return {
|
|
171
171
|
sections,
|
|
172
|
-
siteIndex: {
|
|
172
|
+
siteIndex: {
|
|
173
|
+
siteId,
|
|
174
|
+
pages: indexRow.pages,
|
|
175
|
+
sections: indexRow.sections,
|
|
176
|
+
nav: indexRow.nav,
|
|
177
|
+
...indexRow.tags !== void 0 ? { tags: indexRow.tags } : {}
|
|
178
|
+
},
|
|
173
179
|
siteConfig: configRow?.config,
|
|
174
180
|
deletedSections: indexRow.deletedSections ?? []
|
|
175
181
|
};
|
|
@@ -197,6 +203,7 @@ async function persistSiteIndex(index, deletedSections = []) {
|
|
|
197
203
|
pages: index.pages,
|
|
198
204
|
sections: index.sections,
|
|
199
205
|
nav: index.nav,
|
|
206
|
+
tags: index.tags,
|
|
200
207
|
deletedSections,
|
|
201
208
|
updatedAt: now
|
|
202
209
|
});
|
|
@@ -275,6 +282,7 @@ async function persistAll(sections, siteIndex, deletedSectionIds, siteConfig) {
|
|
|
275
282
|
pages: siteIndex.pages,
|
|
276
283
|
sections: siteIndex.sections,
|
|
277
284
|
nav: siteIndex.nav,
|
|
285
|
+
tags: siteIndex.tags,
|
|
278
286
|
// Record the deletion INTENT, not just its effect on the order. The
|
|
279
287
|
// restore path reads this back; when it was hardcoded `[]` that path
|
|
280
288
|
// had to re-derive deletions by diffing this snapshot against a fresh
|
package/dist/lib/env.d.ts
CHANGED
|
@@ -4,4 +4,8 @@ declare global {
|
|
|
4
4
|
}
|
|
5
5
|
}
|
|
6
6
|
export declare function env(key: string): string;
|
|
7
|
+
/** Vite replaces `import.meta.env.PROD` with a boolean literal at build time
|
|
8
|
+
* (packages are `noExternal`, so that covers this file too), which is why the
|
|
9
|
+
* declared string type above is bypassed here. False under Node and vitest. */
|
|
10
|
+
export declare function isProd(): boolean;
|
|
7
11
|
//# sourceMappingURL=env.d.ts.map
|
package/dist/lib/env.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../src/lib/env.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../src/lib/env.ts"],"names":[],"mappings":"AAEA,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,UAAU;QAClB,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;KACnD;CACF;AAED,wBAAgB,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAMvC;AAED;;gFAEgF;AAChF,wBAAgB,MAAM,IAAI,OAAO,CAEhC"}
|
package/dist/lib/env.js
CHANGED
package/dist/lib/events.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { SiteNav } from "./nav";
|
|
2
2
|
export interface TypedEvent<T> {
|
|
3
3
|
dispatch(detail: T): void;
|
|
4
4
|
listen(callback: (detail: T) => void): () => void;
|
|
@@ -7,7 +7,6 @@ export declare function createEvent<T>(name: string): TypedEvent<T>;
|
|
|
7
7
|
export declare const editModeEvent: TypedEvent<{
|
|
8
8
|
isEditMode: boolean;
|
|
9
9
|
}>;
|
|
10
|
-
export declare const navChangeEvent: TypedEvent<NavItem[]>;
|
|
11
10
|
export declare const darkModeEvent: TypedEvent<string>;
|
|
12
11
|
export declare const siteNameChangeEvent: TypedEvent<string>;
|
|
13
12
|
export declare const historySelectEvent: TypedEvent<{
|
package/dist/lib/events.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/lib/events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/lib/events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAErC,MAAM,WAAW,UAAU,CAAC,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,CAAC,GAAG,IAAI,CAAC;IAC1B,MAAM,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,IAAI,GAAG,MAAM,IAAI,CAAC;CACnD;AAED,wBAAgB,WAAW,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,UAAU,CAAC,CAAC,CAAC,CAW1D;AAED,eAAO,MAAM,aAAa;gBAA6B,OAAO;EAAqB,CAAC;AACpF,eAAO,MAAM,aAAa,oBAAsC,CAAC;AACjE,eAAO,MAAM,mBAAmB,oBAAwC,CAAC;AACzE,eAAO,MAAM,kBAAkB;SAAsB,MAAM;UAAQ,MAAM;EAAqB,CAAC;AAC/F;;2EAE2E;AAC3E,eAAO,MAAM,mBAAmB;SAAsB,MAAM;UAAQ,MAAM;EAAsB,CAAC;AACjG;;4BAE4B;AAC5B,eAAO,MAAM,yBAAyB;aAA0B,MAAM;EAA6B,CAAC;AACpG;8EAC8E;AAC9E,eAAO,MAAM,gBAAgB;uBAAoC,OAAO;EAAmB,CAAC;AAC5F,eAAO,MAAM,kBAAkB,qBAA2C,CAAC;AAC3E,eAAO,MAAM,eAAe,oBAAoC,CAAC;AACjE;kFACkF;AAClF,eAAO,MAAM,oBAAoB,kBAA2C,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { CSSProperties } from "react";
|
|
2
|
+
import type { ImageBackground } from "../schemas/shared";
|
|
3
|
+
export interface ImageBackdrop {
|
|
4
|
+
className?: string;
|
|
5
|
+
style?: CSSProperties;
|
|
6
|
+
}
|
|
7
|
+
export declare function imageBackdrop(bg: ImageBackground | undefined): ImageBackdrop | undefined;
|
|
8
|
+
//# sourceMappingURL=image-background.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image-background.d.ts","sourceRoot":"","sources":["../../src/lib/image-background.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,eAAe,EAA0B,MAAM,mBAAmB,CAAC;AAkBjF,MAAM,WAAW,aAAa;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB;AAED,wBAAgB,aAAa,CAAC,EAAE,EAAE,eAAe,GAAG,SAAS,GAAG,aAAa,GAAG,SAAS,CAMxF"}
|
package/dist/lib/index-ops.js
CHANGED
|
@@ -11,15 +11,15 @@ import {
|
|
|
11
11
|
setGroupStartCollapsed,
|
|
12
12
|
slugifyPageSlug,
|
|
13
13
|
uniquePageSlug
|
|
14
|
-
} from "../chunk-
|
|
14
|
+
} from "../chunk-IP2SEBAJ.js";
|
|
15
15
|
import {
|
|
16
16
|
IndexSchema,
|
|
17
17
|
PageStatusSchema,
|
|
18
18
|
RESERVED_SLUGS,
|
|
19
19
|
SLUG_RE
|
|
20
|
-
} from "../chunk-
|
|
20
|
+
} from "../chunk-PTY2RG2K.js";
|
|
21
21
|
import "../chunk-4TZJZU2T.js";
|
|
22
|
-
import "../chunk-
|
|
22
|
+
import "../chunk-AASEGXNT.js";
|
|
23
23
|
import "../chunk-JSBRDJBE.js";
|
|
24
24
|
|
|
25
25
|
// src/lib/index-ops.ts
|
package/dist/lib/index.d.ts
CHANGED
|
@@ -4,15 +4,17 @@ export { audiencePasses } from "./pages";
|
|
|
4
4
|
export { resolveChatbotName, resolveThinkingPhrases, DEFAULT_CHATBOT_NAME } from "./chatbot";
|
|
5
5
|
export { generateNavLinks, toSectionId, type NavItem } from "./nav";
|
|
6
6
|
export { navEntries, pagesInNavOrder, groupOfPage, groupDisplayLabel, reconcileNav } from "./nav-tree";
|
|
7
|
+
export { siteTags, tagDisplayLabel, reconcileTags } from "./tags";
|
|
8
|
+
export { resolveReference, type ReferenceContent } from "./references";
|
|
9
|
+
export { REFERENCE_TYPE } from "./reference-type";
|
|
7
10
|
export { deriveContrast, contrastColor, relativeLuminance, contrastRatio, wcagLevel, suggestAccessibleOn, type WcagLevel, } from "./contrast";
|
|
8
11
|
export { primaryVarValue, accentVarValue, onPrimaryVarValue } from "./theme-vars";
|
|
9
12
|
export { sanitizeHtml, ensureSanitizer } from "./sanitize";
|
|
10
|
-
export { gridColsClass } from "./grid";
|
|
11
13
|
export { getIcon, curatedIcons, type IconEntry } from "./icons";
|
|
12
14
|
export { buildGoogleFontsUrl } from "./google-fonts";
|
|
13
15
|
export { formatTimestamp } from "./timestamp";
|
|
14
|
-
export { safeRedirect } from "./
|
|
15
|
-
export { createEvent, editModeEvent,
|
|
16
|
+
export { safeRedirect } from "./safe-redirect";
|
|
17
|
+
export { createEvent, editModeEvent, darkModeEvent, type TypedEvent } from "./events";
|
|
16
18
|
export { createRegistry, defineSection, registerSection, registerSchema, getSection, getSchema, getAllSections, getAllSchemas, clearRegistry, type SectionRegistry, type SectionDefinition, type SectionProps, type WrapperProps, type SettingsFieldDef, type SettingsSchema, type CustomSettingsFormProps, } from "./registry";
|
|
17
|
-
export { mergeSiteContent, loadStaticSiteContent,
|
|
19
|
+
export { mergeSiteContent, loadStaticSiteContent, type LoadedSection, type SiteContent, } from "./loader";
|
|
18
20
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC5B,OAAO,EAAE,EAAE,EAAE,MAAM,MAAM,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AAC7F,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,KAAK,OAAO,EAAE,MAAM,OAAO,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,WAAW,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AACvG,OAAO,EACL,cAAc,EACd,aAAa,EACb,iBAAiB,EACjB,aAAa,EACb,SAAS,EACT,mBAAmB,EACnB,KAAK,SAAS,GACf,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAClF,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC3D,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC5B,OAAO,EAAE,EAAE,EAAE,MAAM,MAAM,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AAC7F,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,KAAK,OAAO,EAAE,MAAM,OAAO,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,WAAW,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AACvG,OAAO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
|
7
7
|
deriveContrast,
|
|
8
|
-
gridColsClass,
|
|
9
|
-
loadSiteContent,
|
|
10
8
|
loadStaticSiteContent,
|
|
11
9
|
mergeSiteContent,
|
|
12
10
|
onPrimaryVarValue,
|
|
@@ -17,11 +15,7 @@ import {
|
|
|
17
15
|
safeRedirect,
|
|
18
16
|
suggestAccessibleOn,
|
|
19
17
|
wcagLevel
|
|
20
|
-
} from "../chunk-
|
|
21
|
-
import "../chunk-FRVO75DK.js";
|
|
22
|
-
import {
|
|
23
|
-
formatTimestamp
|
|
24
|
-
} from "../chunk-MM7KZS5C.js";
|
|
18
|
+
} from "../chunk-PNSCDBU7.js";
|
|
25
19
|
import {
|
|
26
20
|
curatedIcons,
|
|
27
21
|
getIcon
|
|
@@ -29,14 +23,18 @@ import {
|
|
|
29
23
|
import {
|
|
30
24
|
createEvent,
|
|
31
25
|
darkModeEvent,
|
|
32
|
-
editModeEvent
|
|
33
|
-
|
|
34
|
-
} from "../chunk-4RNF2DRG.js";
|
|
26
|
+
editModeEvent
|
|
27
|
+
} from "../chunk-XDEPXTBY.js";
|
|
35
28
|
import {
|
|
36
29
|
generateNavLinks,
|
|
30
|
+
resolveReference,
|
|
37
31
|
toSectionId
|
|
38
|
-
} from "../chunk-
|
|
39
|
-
import "../chunk-
|
|
32
|
+
} from "../chunk-VUYCRBJK.js";
|
|
33
|
+
import "../chunk-L45X7DKX.js";
|
|
34
|
+
import "../chunk-FRVO75DK.js";
|
|
35
|
+
import {
|
|
36
|
+
formatTimestamp
|
|
37
|
+
} from "../chunk-MM7KZS5C.js";
|
|
40
38
|
import {
|
|
41
39
|
ensureSanitizer,
|
|
42
40
|
sanitizeHtml
|
|
@@ -44,6 +42,11 @@ import {
|
|
|
44
42
|
import {
|
|
45
43
|
cn
|
|
46
44
|
} from "../chunk-7EOSDFS3.js";
|
|
45
|
+
import {
|
|
46
|
+
reconcileTags,
|
|
47
|
+
siteTags,
|
|
48
|
+
tagDisplayLabel
|
|
49
|
+
} from "../chunk-OAGJBCSH.js";
|
|
47
50
|
import {
|
|
48
51
|
audiencePasses,
|
|
49
52
|
groupDisplayLabel,
|
|
@@ -51,14 +54,17 @@ import {
|
|
|
51
54
|
navEntries,
|
|
52
55
|
pagesInNavOrder,
|
|
53
56
|
reconcileNav
|
|
54
|
-
} from "../chunk-
|
|
55
|
-
import
|
|
57
|
+
} from "../chunk-IP2SEBAJ.js";
|
|
58
|
+
import {
|
|
59
|
+
REFERENCE_TYPE
|
|
60
|
+
} from "../chunk-5GFACGSN.js";
|
|
61
|
+
import "../chunk-7SX42OP4.js";
|
|
56
62
|
import {
|
|
57
63
|
env
|
|
58
|
-
} from "../chunk-
|
|
59
|
-
import "../chunk-REDDTTGJ.js";
|
|
64
|
+
} from "../chunk-BQ5TZZUE.js";
|
|
60
65
|
import "../chunk-DMCGN5AS.js";
|
|
61
|
-
import "../chunk-
|
|
66
|
+
import "../chunk-4Y2JQQZL.js";
|
|
67
|
+
import "../chunk-PTY2RG2K.js";
|
|
62
68
|
import "../chunk-4TZJZU2T.js";
|
|
63
69
|
import {
|
|
64
70
|
clearRegistry,
|
|
@@ -71,11 +77,12 @@ import {
|
|
|
71
77
|
registerSchema,
|
|
72
78
|
registerSection
|
|
73
79
|
} from "../chunk-FTPETWXE.js";
|
|
74
|
-
import "../chunk-
|
|
80
|
+
import "../chunk-AASEGXNT.js";
|
|
75
81
|
import "../chunk-NSCT3AMV.js";
|
|
76
82
|
import "../chunk-JSBRDJBE.js";
|
|
77
83
|
export {
|
|
78
84
|
DEFAULT_CHATBOT_NAME,
|
|
85
|
+
REFERENCE_TYPE,
|
|
79
86
|
accentVarValue,
|
|
80
87
|
audiencePasses,
|
|
81
88
|
buildGoogleFontsUrl,
|
|
@@ -99,26 +106,27 @@ export {
|
|
|
99
106
|
getIcon,
|
|
100
107
|
getSchema,
|
|
101
108
|
getSection,
|
|
102
|
-
gridColsClass,
|
|
103
109
|
groupDisplayLabel,
|
|
104
110
|
groupOfPage,
|
|
105
|
-
loadSiteContent,
|
|
106
111
|
loadStaticSiteContent,
|
|
107
112
|
mergeSiteContent,
|
|
108
|
-
navChangeEvent,
|
|
109
113
|
navEntries,
|
|
110
114
|
onPrimaryVarValue,
|
|
111
115
|
pagesInNavOrder,
|
|
112
116
|
primaryVarValue,
|
|
113
117
|
reconcileNav,
|
|
118
|
+
reconcileTags,
|
|
114
119
|
registerSchema,
|
|
115
120
|
registerSection,
|
|
116
121
|
relativeLuminance,
|
|
117
122
|
resolveChatbotName,
|
|
123
|
+
resolveReference,
|
|
118
124
|
resolveThinkingPhrases,
|
|
119
125
|
safeRedirect,
|
|
120
126
|
sanitizeHtml,
|
|
127
|
+
siteTags,
|
|
121
128
|
suggestAccessibleOn,
|
|
129
|
+
tagDisplayLabel,
|
|
122
130
|
toSectionId,
|
|
123
131
|
wcagLevel
|
|
124
132
|
};
|
package/dist/lib/loader.d.ts
CHANGED
|
@@ -3,6 +3,9 @@ import { type SiteIndex, type SectionMeta } from "../schemas/site-config";
|
|
|
3
3
|
export interface LoadedSection {
|
|
4
4
|
section: Section;
|
|
5
5
|
meta: SectionMeta;
|
|
6
|
+
/** Set only on render-time copies a Reference pulled in (resolveReference):
|
|
7
|
+
* the id of that Reference. Never loaded or persisted. */
|
|
8
|
+
referencedBy?: string;
|
|
6
9
|
}
|
|
7
10
|
export interface SiteContent {
|
|
8
11
|
sections: LoadedSection[];
|
|
@@ -13,22 +16,33 @@ export interface SiteContent {
|
|
|
13
16
|
* nav.json from a degraded read permanently destroys the entries this
|
|
14
17
|
* version dropped. */
|
|
15
18
|
navDegraded: boolean;
|
|
19
|
+
/** Same contract as navDegraded, for tags.json: a degraded read is
|
|
20
|
+
* read-only for tags. */
|
|
21
|
+
tagsDegraded: boolean;
|
|
16
22
|
}
|
|
23
|
+
/**
|
|
24
|
+
* Whether a load looked for tags.json. Not loaded ⇒ no `index.tags` is attached
|
|
25
|
+
* and writers leave the file alone; loaded ⇒ `file` is its parsed contents,
|
|
26
|
+
* with null/undefined meaning absent (an empty registry). Unlike nav, the
|
|
27
|
+
* difference is load-bearing — an attached `[]` that a writer saves back
|
|
28
|
+
* deletes every tag — hence an explicit flag rather than undefined-vs-null.
|
|
29
|
+
*/
|
|
30
|
+
export type TagsSidecar = {
|
|
31
|
+
loaded: false;
|
|
32
|
+
} | {
|
|
33
|
+
loaded: true;
|
|
34
|
+
file: unknown;
|
|
35
|
+
};
|
|
17
36
|
/**
|
|
18
37
|
* Merge a validated index with raw section file contents.
|
|
19
38
|
* Validates each section file against its Zod schema.
|
|
20
39
|
* Returns sections in the concatenated order of every page's order.
|
|
21
40
|
*/
|
|
22
|
-
export declare function mergeSiteContent(index: SiteIndex, sectionFiles: Record<string, unknown>, navFile?: unknown): SiteContent;
|
|
41
|
+
export declare function mergeSiteContent(index: SiteIndex, sectionFiles: Record<string, unknown>, navFile?: unknown, tagsSidecar?: TagsSidecar): SiteContent;
|
|
23
42
|
/**
|
|
24
43
|
* Build a SiteContent from a Vite `import.meta.glob` result.
|
|
25
44
|
* Callers glob the section JSON files at build time, pass the parsed index, and
|
|
26
45
|
* receive sections merged across every page's order.
|
|
27
46
|
*/
|
|
28
|
-
export declare function loadStaticSiteContent(index: SiteIndex, sectionGlob: Record<string, unknown>, navFile?: unknown): SiteContent;
|
|
29
|
-
/**
|
|
30
|
-
* Load site content from the filesystem.
|
|
31
|
-
* For use in scripts and tests — Astro pages should use import.meta.glob instead.
|
|
32
|
-
*/
|
|
33
|
-
export declare function loadSiteContent(contentDir: string): Promise<SiteContent>;
|
|
47
|
+
export declare function loadStaticSiteContent(index: SiteIndex, sectionGlob: Record<string, unknown>, navFile?: unknown, tagsSidecar?: TagsSidecar): SiteContent;
|
|
34
48
|
//# sourceMappingURL=loader.d.ts.map
|
package/dist/lib/loader.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../src/lib/loader.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2B,KAAK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
CHANGED
|
@@ -60,4 +60,5 @@ export declare function deleteGroup(index: SiteIndex, groupId: string): SiteInde
|
|
|
60
60
|
* page are all the same operation.
|
|
61
61
|
*/
|
|
62
62
|
export declare function moveNavEntry(index: SiteIndex, from: NavLocation, to: NavLocation): SiteIndex;
|
|
63
|
+
export declare function describeNavMove(prevIndex: SiteIndex, nextIndex: SiteIndex, from: NavLocation): string | null;
|
|
63
64
|
//# sourceMappingURL=nav-tree.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nav-tree.d.ts","sourceRoot":"","sources":["../../src/lib/nav-tree.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC9D,OAAO,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAE9D;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,QAAQ,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,QAAQ,EAAE,CAwD3E;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,SAAS,GAAG,QAAQ,EAAE,CAEvD;AAED,oFAAoF;AACpF,wBAAgB,eAAe,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI,EAAE,CAexD;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI,CAKlF;AAED,0FAA0F;AAC1F,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEvD;AAED,uFAAuF;AACvF,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,MAAM,MAAM,GACd;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC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S,CAUxE;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE,EAAE,WAAW,GAAG,SAAS,CAgC5F;AAqBD,wBAAgB,eAAe,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,WAAW,GAAG,MAAM,GAAG,IAAI,CAkD5G"}
|
package/dist/lib/nav.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { LoadedSection } from "./loader";
|
|
2
2
|
import { type SectionRegistry } from "./registry";
|
|
3
3
|
import type { SiteIndex } from "../schemas/site-config";
|
|
4
|
+
import type { Section } from "../schemas/sections";
|
|
4
5
|
import type { SiteDocument } from "./documents";
|
|
6
|
+
import { type ReferenceQuery } from "./references";
|
|
5
7
|
export interface NavItem {
|
|
6
8
|
href: string;
|
|
7
9
|
label: string;
|
|
@@ -9,7 +11,43 @@ export interface NavItem {
|
|
|
9
11
|
children: NavItem[];
|
|
10
12
|
}
|
|
11
13
|
export declare function toSectionId(text: string): string;
|
|
14
|
+
export type SummaryNavLevel = "off" | "heading" | "subheading";
|
|
12
15
|
export declare function generateNavLinks(sections: LoadedSection[], registry?: SectionRegistry): NavItem[];
|
|
16
|
+
export interface SummaryNavAnchor {
|
|
17
|
+
anchor: string;
|
|
18
|
+
/** False for a Subheading with no Link Heading above it: it renders its
|
|
19
|
+
* anchor but is dropped from the nav, so the editor hints about it. */
|
|
20
|
+
inNav: boolean;
|
|
21
|
+
}
|
|
22
|
+
/** Per summary section id (nav on, label set): the anchor it renders and
|
|
23
|
+
* whether it made it into the nav. Same derivation generateNavLinks uses. */
|
|
24
|
+
export declare function summaryNavAnchors(sections: LoadedSection[], registry?: SectionRegistry): Record<string, SummaryNavAnchor>;
|
|
25
|
+
/**
|
|
26
|
+
* Render-only copy of the page's sections with `navAnchor` stamped on every
|
|
27
|
+
* section whose rendered anchor it cannot derive alone — nav-bearing summaries
|
|
28
|
+
* and everything a Reference pulled in (container children included) — for
|
|
29
|
+
* renderers that can't share React context with the page: the SSR viewer
|
|
30
|
+
* renders each section as its own React tree. Never written back: the editor
|
|
31
|
+
* reads summary anchors from SummaryAnchorsContext instead, so stored content
|
|
32
|
+
* stays clean.
|
|
33
|
+
*
|
|
34
|
+
* `navAnchor` is not part of any section schema: it survives only because the
|
|
35
|
+
* viewer's later passes (media resolve, sanitizeLoadedSections) spread sections.
|
|
36
|
+
* A Zod re-parse after this point would strip it and leave the section without
|
|
37
|
+
* the id its nav entry links to — stamp after any parse, never before.
|
|
38
|
+
*/
|
|
39
|
+
export declare function withNavAnchors(sections: LoadedSection[], registry?: SectionRegistry): LoadedSection[];
|
|
40
|
+
/**
|
|
41
|
+
* Every copy the editor renders for each Reference on the page, keyed by
|
|
42
|
+
* Reference id then source id, with anchors stamped over the WHOLE page — so
|
|
43
|
+
* the editor nav (built from expandReferences) links to exactly these ids, and
|
|
44
|
+
* two References showing one section never share a DOM id. Copies the
|
|
45
|
+
* published site drops (drafts, archived pages) claim after the rest, so a
|
|
46
|
+
* greyed copy can't take an anchor a published one would have.
|
|
47
|
+
* Lives here rather than in references.ts because it needs withNavAnchors, and
|
|
48
|
+
* references.ts importing nav.ts would cycle.
|
|
49
|
+
*/
|
|
50
|
+
export declare function pageReferenceCopies(pageSections: LoadedSection[], opts: Omit<ReferenceQuery, "referenceId" | "content">): Record<string, Record<string, Section>>;
|
|
13
51
|
export interface PageNavItem {
|
|
14
52
|
id: string;
|
|
15
53
|
title: string;
|
package/dist/lib/nav.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nav.d.ts","sourceRoot":"","sources":["../../src/lib/nav.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,YAAY,CAAC;AAI9D,OAAO,KAAK,EAAE,SAAS,E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YAAY,EAAE,CAAC;IACxB,iFAAiF;IACjF,MAAM,EAAE,WAAW,EAAE,CAAC;IACtB,OAAO,EAAE,WAAW,EAAE,CAAC;CACxB;AAMD,wBAAgB,eAAe,CAAC,IAAI,EAAE;IACpC,KAAK,EAAE,SAAS,CAAC;IACjB,cAAc,EAAE,aAAa,EAAE,CAAC;IAChC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,IAAI,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAC1B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,QAAQ,CAAC,EAAE,eAAe,CAAC;IAC3B;;;;;2BAKuB;IACvB,SAAS,CAAC,EAAE,YAAY,EAAE,CAAC;CAC5B,GAAG,OAAO,CAkEV"}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
export declare class PlatformBrokerError extends Error {
|
|
10
10
|
readonly status: number | null;
|
|
11
|
-
constructor(status: number | null, message: string);
|
|
11
|
+
constructor(status: number | null, message: string, options?: ErrorOptions);
|
|
12
12
|
}
|
|
13
13
|
/** True when this runtime should broker privileged ops through the platform. */
|
|
14
14
|
export declare function isPlatformMode(): boolean;
|
|
@@ -16,7 +16,9 @@ export declare function isPlatformMode(): boolean;
|
|
|
16
16
|
* Call a platform broker endpoint scoped to this site. The platform authorizes
|
|
17
17
|
* the op against the site that owns PLATFORM_API_KEY — the client never names
|
|
18
18
|
* another tenant. Retries network/5xx (transient); 4xx is a real auth/config
|
|
19
|
-
* error and is surfaced immediately.
|
|
19
|
+
* error and is surfaced immediately. Writes are retried only on a gateway
|
|
20
|
+
* status: an unconfirmed write (timeout, dropped connection, 500) may already
|
|
21
|
+
* have landed. Mirrors fetchInstallationToken().
|
|
20
22
|
*/
|
|
21
23
|
export declare function platformBroker<T = unknown>(path: string, opts?: {
|
|
22
24
|
method?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform-broker.d.ts","sourceRoot":"","sources":["../../src/lib/platform-broker.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"platform-broker.d.ts","sourceRoot":"","sources":["../../src/lib/platform-broker.ts"],"names":[],"mappings":"AAaA;;;;;;;GAOG;AACH,qBAAa,mBAAoB,SAAQ,KAAK;aAChB,MAAM,EAAE,MAAM,GAAG,IAAI;gBAArB,MAAM,EAAE,MAAM,GAAG,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY;CAI3F;AAED,gFAAgF;AAChF,wBAAgB,cAAc,IAAI,OAAO,CAExC;AAED;;;;;;;GAOG;AACH,wBAAsB,cAAc,CAAC,CAAC,GAAG,OAAO,EAC9C,IAAI,EAAE,MAAM,EACZ,IAAI,GAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAO,GAC7E,OAAO,CAAC,CAAC,CAAC,CAuDZ;AAED;;;;;GAKG;AACH,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,OAAO,GACZ,OAAO,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,CA8BrC"}
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
env
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-BQ5TZZUE.js";
|
|
4
4
|
import "../chunk-JSBRDJBE.js";
|
|
5
5
|
|
|
6
6
|
// src/lib/platform-broker.ts
|
|
7
7
|
var ATTEMPTS = 3;
|
|
8
8
|
var RETRY_BASE_MS = 150;
|
|
9
|
+
var REQUEST_TIMEOUT_MS = 1e4;
|
|
10
|
+
var GATEWAY_STATUSES = /* @__PURE__ */ new Set([502, 503, 504]);
|
|
9
11
|
function sleep(ms) {
|
|
10
12
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
11
13
|
}
|
|
12
14
|
var PlatformBrokerError = class extends Error {
|
|
13
|
-
constructor(status, message) {
|
|
14
|
-
super(message);
|
|
15
|
+
constructor(status, message, options) {
|
|
16
|
+
super(message, options);
|
|
15
17
|
this.status = status;
|
|
16
18
|
this.name = "PlatformBrokerError";
|
|
17
19
|
}
|
|
@@ -33,34 +35,34 @@ async function platformBroker(path, opts = {}) {
|
|
|
33
35
|
headers["Content-Type"] = "application/json";
|
|
34
36
|
serializedBody = JSON.stringify(opts.body);
|
|
35
37
|
}
|
|
36
|
-
let lastError;
|
|
37
38
|
for (let attempt = 0; attempt < ATTEMPTS; attempt++) {
|
|
38
39
|
const isLast = attempt === ATTEMPTS - 1;
|
|
39
40
|
let res;
|
|
40
41
|
try {
|
|
41
|
-
res = await fetch(url, { method, headers, body: serializedBody });
|
|
42
|
+
res = await fetch(url, { method, headers, body: serializedBody, signal: AbortSignal.timeout(REQUEST_TIMEOUT_MS) });
|
|
42
43
|
} catch (err) {
|
|
43
|
-
|
|
44
|
-
|
|
44
|
+
if (method !== "GET" || isLast) {
|
|
45
|
+
throw new PlatformBrokerError(null, method === "GET" ? "Platform request failed \u2014 check your connection and try again." : "Platform request wasn't confirmed \u2014 check its status before trying again.", { cause: err });
|
|
46
|
+
}
|
|
45
47
|
await sleep(RETRY_BASE_MS * 2 ** attempt);
|
|
46
48
|
continue;
|
|
47
49
|
}
|
|
48
50
|
if (res.ok) {
|
|
49
51
|
if (res.status === 204) return void 0;
|
|
50
52
|
try {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
53
|
+
const text = await res.text();
|
|
54
|
+
return text ? JSON.parse(text) : void 0;
|
|
55
|
+
} catch (err) {
|
|
56
|
+
throw new PlatformBrokerError(null, method === "GET" ? "Platform response couldn't be read \u2014 try again." : "Platform response couldn't be read \u2014 check the operation's status before trying again.", { cause: err });
|
|
54
57
|
}
|
|
55
58
|
}
|
|
56
|
-
if (res.status >= 500
|
|
57
|
-
lastError = new PlatformBrokerError(res.status, `Platform broker error (${res.status})`);
|
|
59
|
+
if (!isLast && (method === "GET" ? res.status >= 500 : GATEWAY_STATUSES.has(res.status))) {
|
|
58
60
|
await sleep(RETRY_BASE_MS * 2 ** attempt);
|
|
59
61
|
continue;
|
|
60
62
|
}
|
|
61
63
|
throw new PlatformBrokerError(res.status, `Platform broker error (${res.status}): ${await res.text()}`);
|
|
62
64
|
}
|
|
63
|
-
throw
|
|
65
|
+
throw new PlatformBrokerError(null, "Platform broker unreachable");
|
|
64
66
|
}
|
|
65
67
|
async function platformBrokerStream(path, body) {
|
|
66
68
|
const apiUrl = env("PLATFORM_API_URL");
|
|
@@ -70,17 +72,23 @@ async function platformBrokerStream(path, body) {
|
|
|
70
72
|
let lastError;
|
|
71
73
|
for (let attempt = 0; attempt < ATTEMPTS; attempt++) {
|
|
72
74
|
let res;
|
|
75
|
+
const controller = new AbortController();
|
|
76
|
+
const timer = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS);
|
|
73
77
|
try {
|
|
74
78
|
res = await fetch(url, {
|
|
79
|
+
signal: controller.signal,
|
|
75
80
|
method: "POST",
|
|
76
81
|
headers: { "x-api-key": apiKey, "x-site-id": siteId, "Content-Type": "application/json" },
|
|
77
82
|
body: JSON.stringify(body)
|
|
78
83
|
});
|
|
79
84
|
} catch (err) {
|
|
80
85
|
lastError = err;
|
|
86
|
+
if (controller.signal.aborted) throw new PlatformBrokerError(null, "Chat connection timed out \u2014 try again.");
|
|
81
87
|
if (attempt === ATTEMPTS - 1) throw err;
|
|
82
88
|
await sleep(RETRY_BASE_MS * 2 ** attempt);
|
|
83
89
|
continue;
|
|
90
|
+
} finally {
|
|
91
|
+
clearTimeout(timer);
|
|
84
92
|
}
|
|
85
93
|
if (!res.ok || !res.body) throw new Error(`Platform broker error (${res.status})`);
|
|
86
94
|
return res.body;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reference-type.d.ts","sourceRoot":"","sources":["../../src/lib/reference-type.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc,EAAG,WAAoB,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { SiteIndex } from "../schemas/site-config";
|
|
2
|
+
/** What one Reference names that it can never show. */
|
|
3
|
+
export interface ReferenceProblem {
|
|
4
|
+
referenceId: string;
|
|
5
|
+
unknownTagIds: string[];
|
|
6
|
+
/** Not a top-level section on any page: deleted, or a container's child. */
|
|
7
|
+
unplacedSectionIds: string[];
|
|
8
|
+
/** Picks that are themselves References, which are never shown. */
|
|
9
|
+
referencePickIds: string[];
|
|
10
|
+
picksItself: boolean;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* The dangling-id check for Reference sections — what save_sections rejects on,
|
|
14
|
+
* and what validate_site and `authoring validate` warn about.
|
|
15
|
+
*
|
|
16
|
+
* Deliberately NOT part of applyContentWrite or the schema: on the viewer and in
|
|
17
|
+
* the editor a dangling pick or a deleted tag is ordinary (someone deleted the
|
|
18
|
+
* source), so it drops silently and an editor save must keep succeeding. This
|
|
19
|
+
* is for whoever just chose the ids, where a bad one is a mistake.
|
|
20
|
+
*
|
|
21
|
+
* `sections` are full section bodies; anything that is not a Reference (by body
|
|
22
|
+
* type or index type) is ignored. `tagIds` null means the registry could not
|
|
23
|
+
* be read whole, so tag ids go unchecked rather than being misreported.
|
|
24
|
+
*/
|
|
25
|
+
export declare function referenceProblems(sections: readonly {
|
|
26
|
+
id: string;
|
|
27
|
+
content: unknown;
|
|
28
|
+
}[], index: Pick<SiteIndex, "pages" | "sections">, tagIds: ReadonlySet<string> | null): ReferenceProblem[];
|
|
29
|
+
/** One line per Reference, naming every bad id. */
|
|
30
|
+
export declare function describeReferenceProblem(problem: ReferenceProblem): string;
|
|
31
|
+
//# sourceMappingURL=reference-validation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reference-validation.d.ts","sourceRoot":"","sources":["../../src/lib/reference-validation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAGxD,uDAAuD;AACvD,MAAM,WAAW,gBAAgB;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,4EAA4E;IAC5E,kBAAkB,EAAE,MAAM,EAAE,CAAC;IAC7B,mEAAmE;IACnE,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,WAAW,EAAE,OAAO,CAAC;CACtB;AAKD;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,SAAS;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,EAAE,EACrD,KAAK,EAAE,IAAI,CAAC,SAAS,EAAE,OAAO,GAAG,UAAU,CAAC,EAC5C,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,IAAI,GACjC,gBAAgB,EAAE,CAoBpB;AAED,mDAAmD;AACnD,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,gBAAgB,GAAG,MAAM,CAW1E"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import {
|
|
2
|
+
REFERENCE_TYPE
|
|
3
|
+
} from "../chunk-5GFACGSN.js";
|
|
4
|
+
import "../chunk-JSBRDJBE.js";
|
|
5
|
+
|
|
6
|
+
// src/lib/reference-validation.ts
|
|
7
|
+
var strings = (v) => Array.isArray(v) ? v.filter((x) => typeof x === "string") : [];
|
|
8
|
+
function referenceProblems(sections, index, tagIds) {
|
|
9
|
+
const onPage = new Set(index.pages.flatMap((p) => p.order));
|
|
10
|
+
const problems = [];
|
|
11
|
+
for (const { id, content } of sections) {
|
|
12
|
+
const body = content;
|
|
13
|
+
if (body?.type !== REFERENCE_TYPE && index.sections[id]?.type !== REFERENCE_TYPE) continue;
|
|
14
|
+
const picks = strings(body?.content?.sectionIds).filter((pick) => pick !== id);
|
|
15
|
+
const problem = {
|
|
16
|
+
referenceId: id,
|
|
17
|
+
unknownTagIds: tagIds ? strings(body?.content?.tagIds).filter((tag) => !tagIds.has(tag)) : [],
|
|
18
|
+
unplacedSectionIds: picks.filter((pick) => !onPage.has(pick)),
|
|
19
|
+
referencePickIds: picks.filter((pick) => onPage.has(pick) && index.sections[pick]?.type === REFERENCE_TYPE),
|
|
20
|
+
picksItself: strings(body?.content?.sectionIds).includes(id)
|
|
21
|
+
};
|
|
22
|
+
if (problem.unknownTagIds.length || problem.unplacedSectionIds.length || problem.referencePickIds.length || problem.picksItself) problems.push(problem);
|
|
23
|
+
}
|
|
24
|
+
return problems;
|
|
25
|
+
}
|
|
26
|
+
function describeReferenceProblem(problem) {
|
|
27
|
+
const list = (ids) => ids.map((id) => `"${id}"`).join(", ");
|
|
28
|
+
const issues = [
|
|
29
|
+
...problem.unknownTagIds.length ? [`tagIds ${list(problem.unknownTagIds)} are not tags on this site`] : [],
|
|
30
|
+
...problem.unplacedSectionIds.length ? [`sectionIds ${list(problem.unplacedSectionIds)} are not top-level sections on any page (a container's child cannot be picked \u2014 pick the container)`] : [],
|
|
31
|
+
...problem.referencePickIds.length ? [`sectionIds ${list(problem.referencePickIds)} are References, which a Reference never shows`] : [],
|
|
32
|
+
...problem.picksItself ? ["sectionIds includes the Reference itself"] : []
|
|
33
|
+
];
|
|
34
|
+
return `Reference "${problem.referenceId}": ${issues.join("; ")}.`;
|
|
35
|
+
}
|
|
36
|
+
export {
|
|
37
|
+
describeReferenceProblem,
|
|
38
|
+
referenceProblems
|
|
39
|
+
};
|