@drawnagency/primitives 0.1.0
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 +28 -0
- package/dist/auth/cookies.d.ts +8 -0
- package/dist/auth/cookies.d.ts.map +1 -0
- package/dist/auth/cookies.js +44 -0
- package/dist/auth/errors.d.ts +8 -0
- package/dist/auth/errors.d.ts.map +1 -0
- package/dist/auth/errors.js +10 -0
- package/dist/auth/index.d.ts +5 -0
- package/dist/auth/index.d.ts.map +1 -0
- package/dist/auth/index.js +3 -0
- package/dist/auth/security.d.ts +13 -0
- package/dist/auth/security.d.ts.map +1 -0
- package/dist/auth/security.js +48 -0
- package/dist/auth/types.d.ts +64 -0
- package/dist/auth/types.d.ts.map +1 -0
- package/dist/auth/types.js +1 -0
- package/dist/components/brandguide/ColorSwatchSettings.d.ts +8 -0
- package/dist/components/brandguide/ColorSwatchSettings.d.ts.map +1 -0
- package/dist/components/brandguide/ColorSwatchSettings.js +10 -0
- package/dist/components/brandguide/Colors.d.ts +15 -0
- package/dist/components/brandguide/Colors.d.ts.map +1 -0
- package/dist/components/brandguide/Colors.js +79 -0
- package/dist/components/brandguide/DoDontList.d.ts +16 -0
- package/dist/components/brandguide/DoDontList.d.ts.map +1 -0
- package/dist/components/brandguide/DoDontList.js +22 -0
- package/dist/components/brandguide/DoDontMediaGrid.d.ts +16 -0
- package/dist/components/brandguide/DoDontMediaGrid.d.ts.map +1 -0
- package/dist/components/brandguide/DoDontMediaGrid.js +5 -0
- package/dist/components/editor/AudiencePicker.d.ts +9 -0
- package/dist/components/editor/AudiencePicker.d.ts.map +1 -0
- package/dist/components/editor/AudiencePicker.js +24 -0
- package/dist/components/editor/DeleteButton.d.ts +6 -0
- package/dist/components/editor/DeleteButton.d.ts.map +1 -0
- package/dist/components/editor/DeleteButton.js +6 -0
- package/dist/components/editor/DragHandle.d.ts +2 -0
- package/dist/components/editor/DragHandle.d.ts.map +1 -0
- package/dist/components/editor/DragHandle.js +8 -0
- package/dist/components/editor/InsertButton.d.ts +7 -0
- package/dist/components/editor/InsertButton.d.ts.map +1 -0
- package/dist/components/editor/InsertButton.js +7 -0
- package/dist/components/editor/SectionWrapper.d.ts +3 -0
- package/dist/components/editor/SectionWrapper.d.ts.map +1 -0
- package/dist/components/editor/SectionWrapper.js +135 -0
- package/dist/components/editor/SettingsButton.d.ts +6 -0
- package/dist/components/editor/SettingsButton.d.ts.map +1 -0
- package/dist/components/editor/SettingsButton.js +6 -0
- package/dist/components/editor/SettingsForm.d.ts +13 -0
- package/dist/components/editor/SettingsForm.d.ts.map +1 -0
- package/dist/components/editor/SettingsForm.js +64 -0
- package/dist/components/editor/StatusBadge.d.ts +7 -0
- package/dist/components/editor/StatusBadge.d.ts.map +1 -0
- package/dist/components/editor/StatusBadge.js +10 -0
- package/dist/components/editor/StatusPicker.d.ts +9 -0
- package/dist/components/editor/StatusPicker.d.ts.map +1 -0
- package/dist/components/editor/StatusPicker.js +30 -0
- package/dist/components/editor/index.d.ts +8 -0
- package/dist/components/editor/index.d.ts.map +1 -0
- package/dist/components/editor/index.js +7 -0
- package/dist/components/primitives/CustomParagraph.d.ts +2 -0
- package/dist/components/primitives/CustomParagraph.d.ts.map +1 -0
- package/dist/components/primitives/CustomParagraph.js +24 -0
- package/dist/components/primitives/EditableGrid.d.ts +19 -0
- package/dist/components/primitives/EditableGrid.d.ts.map +1 -0
- package/dist/components/primitives/EditableGrid.js +90 -0
- package/dist/components/primitives/EditableList.d.ts +15 -0
- package/dist/components/primitives/EditableList.d.ts.map +1 -0
- package/dist/components/primitives/EditableList.js +54 -0
- package/dist/components/primitives/EditablePlainText.d.ts +12 -0
- package/dist/components/primitives/EditablePlainText.d.ts.map +1 -0
- package/dist/components/primitives/EditablePlainText.js +52 -0
- package/dist/components/primitives/EditableRichText.d.ts +11 -0
- package/dist/components/primitives/EditableRichText.d.ts.map +1 -0
- package/dist/components/primitives/EditableRichText.js +86 -0
- package/dist/components/primitives/HeadingSection.d.ts +10 -0
- package/dist/components/primitives/HeadingSection.d.ts.map +1 -0
- package/dist/components/primitives/HeadingSection.js +7 -0
- package/dist/components/primitives/IconPicker.d.ts +9 -0
- package/dist/components/primitives/IconPicker.d.ts.map +1 -0
- package/dist/components/primitives/IconPicker.js +21 -0
- package/dist/components/primitives/LinkPopover.d.ts +8 -0
- package/dist/components/primitives/LinkPopover.d.ts.map +1 -0
- package/dist/components/primitives/LinkPopover.js +48 -0
- package/dist/components/primitives/MediaSettingsForms.d.ts +19 -0
- package/dist/components/primitives/MediaSettingsForms.d.ts.map +1 -0
- package/dist/components/primitives/MediaSettingsForms.js +42 -0
- package/dist/components/primitives/ResolvedMedia.d.ts +8 -0
- package/dist/components/primitives/ResolvedMedia.d.ts.map +1 -0
- package/dist/components/primitives/ResolvedMedia.js +9 -0
- package/dist/components/primitives/RichTextToolbar.d.ts +9 -0
- package/dist/components/primitives/RichTextToolbar.d.ts.map +1 -0
- package/dist/components/primitives/RichTextToolbar.js +26 -0
- package/dist/components/primitives/tiptap-presets.d.ts +4 -0
- package/dist/components/primitives/tiptap-presets.d.ts.map +1 -0
- package/dist/components/primitives/tiptap-presets.js +44 -0
- package/dist/components/primitives/useEditableCollection.d.ts +19 -0
- package/dist/components/primitives/useEditableCollection.d.ts.map +1 -0
- package/dist/components/primitives/useEditableCollection.js +61 -0
- package/dist/components/primitives/useEditablePlainText.d.ts +14 -0
- package/dist/components/primitives/useEditablePlainText.d.ts.map +1 -0
- package/dist/components/primitives/useEditablePlainText.js +27 -0
- package/dist/components/primitives/useEditableRichText.d.ts +16 -0
- package/dist/components/primitives/useEditableRichText.d.ts.map +1 -0
- package/dist/components/primitives/useEditableRichText.js +52 -0
- package/dist/components/sections/Button/CTAButton.d.ts +11 -0
- package/dist/components/sections/Button/CTAButton.d.ts.map +1 -0
- package/dist/components/sections/Button/CTAButton.js +18 -0
- package/dist/components/sections/Button/index.d.ts +11 -0
- package/dist/components/sections/Button/index.d.ts.map +1 -0
- package/dist/components/sections/Button/index.js +28 -0
- package/dist/components/sections/Colors/index.d.ts +22 -0
- package/dist/components/sections/Colors/index.d.ts.map +1 -0
- package/dist/components/sections/Colors/index.js +34 -0
- package/dist/components/sections/DoDontList/index.d.ts +21 -0
- package/dist/components/sections/DoDontList/index.d.ts.map +1 -0
- package/dist/components/sections/DoDontList/index.js +33 -0
- package/dist/components/sections/DoDontMediaGrid/index.d.ts +55 -0
- package/dist/components/sections/DoDontMediaGrid/index.d.ts.map +1 -0
- package/dist/components/sections/DoDontMediaGrid/index.js +41 -0
- package/dist/components/sections/IconList/IconList.d.ts +20 -0
- package/dist/components/sections/IconList/IconList.d.ts.map +1 -0
- package/dist/components/sections/IconList/IconList.js +131 -0
- package/dist/components/sections/IconList/IconListSettings.d.ts +11 -0
- package/dist/components/sections/IconList/IconListSettings.d.ts.map +1 -0
- package/dist/components/sections/IconList/IconListSettings.js +22 -0
- package/dist/components/sections/IconList/index.d.ts +17 -0
- package/dist/components/sections/IconList/index.d.ts.map +1 -0
- package/dist/components/sections/IconList/index.js +27 -0
- package/dist/components/sections/LinkHeading/index.d.ts +8 -0
- package/dist/components/sections/LinkHeading/index.d.ts.map +1 -0
- package/dist/components/sections/LinkHeading/index.js +15 -0
- package/dist/components/sections/MediaGrid/MediaGrid.d.ts +17 -0
- package/dist/components/sections/MediaGrid/MediaGrid.d.ts.map +1 -0
- package/dist/components/sections/MediaGrid/MediaGrid.js +62 -0
- package/dist/components/sections/MediaGrid/index.d.ts +55 -0
- package/dist/components/sections/MediaGrid/index.d.ts.map +1 -0
- package/dist/components/sections/MediaGrid/index.js +35 -0
- package/dist/components/sections/Prose/Prose.d.ts +8 -0
- package/dist/components/sections/Prose/Prose.d.ts.map +1 -0
- package/dist/components/sections/Prose/Prose.js +11 -0
- package/dist/components/sections/Prose/index.d.ts +8 -0
- package/dist/components/sections/Prose/index.d.ts.map +1 -0
- package/dist/components/sections/Prose/index.js +15 -0
- package/dist/components/sections/SectionLayout.d.ts +11 -0
- package/dist/components/sections/SectionLayout.d.ts.map +1 -0
- package/dist/components/sections/SectionLayout.js +15 -0
- package/dist/components/sections/SplitContent/SplitContent.d.ts +11 -0
- package/dist/components/sections/SplitContent/SplitContent.d.ts.map +1 -0
- package/dist/components/sections/SplitContent/SplitContent.js +31 -0
- package/dist/components/sections/SplitContent/SplitContentSettings.d.ts +9 -0
- package/dist/components/sections/SplitContent/SplitContentSettings.d.ts.map +1 -0
- package/dist/components/sections/SplitContent/SplitContentSettings.js +17 -0
- package/dist/components/sections/SplitContent/index.d.ts +13 -0
- package/dist/components/sections/SplitContent/index.d.ts.map +1 -0
- package/dist/components/sections/SplitContent/index.js +27 -0
- package/dist/components/sections/SubHeading/index.d.ts +9 -0
- package/dist/components/sections/SubHeading/index.d.ts.map +1 -0
- package/dist/components/sections/SubHeading/index.js +18 -0
- package/dist/components/sections/SubSubHeading/index.d.ts +9 -0
- package/dist/components/sections/SubSubHeading/index.d.ts.map +1 -0
- package/dist/components/sections/SubSubHeading/index.js +18 -0
- package/dist/components/sections/ViewRenderer.d.ts +8 -0
- package/dist/components/sections/ViewRenderer.d.ts.map +1 -0
- package/dist/components/sections/ViewRenderer.js +13 -0
- package/dist/components/sections/register-schemas.d.ts +2 -0
- package/dist/components/sections/register-schemas.d.ts.map +1 -0
- package/dist/components/sections/register-schemas.js +15 -0
- package/dist/components/sections/register.d.ts +2 -0
- package/dist/components/sections/register.d.ts.map +1 -0
- package/dist/components/sections/register.js +15 -0
- package/dist/components/shared/Button.d.ts +15 -0
- package/dist/components/shared/Button.d.ts.map +1 -0
- package/dist/components/shared/Button.js +27 -0
- package/dist/components/shared/Checkbox.d.ts +14 -0
- package/dist/components/shared/Checkbox.d.ts.map +1 -0
- package/dist/components/shared/Checkbox.js +10 -0
- package/dist/components/shared/ColorPicker.d.ts +9 -0
- package/dist/components/shared/ColorPicker.d.ts.map +1 -0
- package/dist/components/shared/ColorPicker.js +5 -0
- package/dist/components/shared/ErrorBoundary.d.ts +24 -0
- package/dist/components/shared/ErrorBoundary.d.ts.map +1 -0
- package/dist/components/shared/ErrorBoundary.js +30 -0
- package/dist/components/shared/FontPicker.d.ts +8 -0
- package/dist/components/shared/FontPicker.d.ts.map +1 -0
- package/dist/components/shared/FontPicker.js +190 -0
- package/dist/components/shared/FormLabel.d.ts +8 -0
- package/dist/components/shared/FormLabel.d.ts.map +1 -0
- package/dist/components/shared/FormLabel.js +5 -0
- package/dist/components/shared/IconButton.d.ts +12 -0
- package/dist/components/shared/IconButton.d.ts.map +1 -0
- package/dist/components/shared/IconButton.js +16 -0
- package/dist/components/shared/Input.d.ts +8 -0
- package/dist/components/shared/Input.d.ts.map +1 -0
- package/dist/components/shared/Input.js +8 -0
- package/dist/components/shared/Navigation.d.ts +9 -0
- package/dist/components/shared/Navigation.d.ts.map +1 -0
- package/dist/components/shared/Navigation.js +71 -0
- package/dist/components/shared/PasswordInput.d.ts +13 -0
- package/dist/components/shared/PasswordInput.d.ts.map +1 -0
- package/dist/components/shared/PasswordInput.js +11 -0
- package/dist/components/shared/Popover.d.ts +12 -0
- package/dist/components/shared/Popover.d.ts.map +1 -0
- package/dist/components/shared/Popover.js +33 -0
- package/dist/components/shared/PopoverItem.d.ts +7 -0
- package/dist/components/shared/PopoverItem.d.ts.map +1 -0
- package/dist/components/shared/PopoverItem.js +6 -0
- package/dist/components/shared/Select.d.ts +16 -0
- package/dist/components/shared/Select.d.ts.map +1 -0
- package/dist/components/shared/Select.js +9 -0
- package/dist/components/shared/Textarea.d.ts +8 -0
- package/dist/components/shared/Textarea.d.ts.map +1 -0
- package/dist/components/shared/Textarea.js +8 -0
- package/dist/components/shared/Toggle.d.ts +10 -0
- package/dist/components/shared/Toggle.d.ts.map +1 -0
- package/dist/components/shared/Toggle.js +5 -0
- package/dist/components/shared/Tooltip.d.ts +12 -0
- package/dist/components/shared/Tooltip.d.ts.map +1 -0
- package/dist/components/shared/Tooltip.js +8 -0
- package/dist/components/shared/icons.d.ts +17 -0
- package/dist/components/shared/icons.d.ts.map +1 -0
- package/dist/components/shared/icons.js +23 -0
- package/dist/components/shell/AudienceAddForm.d.ts +11 -0
- package/dist/components/shell/AudienceAddForm.d.ts.map +1 -0
- package/dist/components/shell/AudienceAddForm.js +43 -0
- package/dist/components/shell/AudienceRow.d.ts +15 -0
- package/dist/components/shell/AudienceRow.d.ts.map +1 -0
- package/dist/components/shell/AudienceRow.js +74 -0
- package/dist/components/shell/EditorContext.d.ts +14 -0
- package/dist/components/shell/EditorContext.d.ts.map +1 -0
- package/dist/components/shell/EditorContext.js +24 -0
- package/dist/components/shell/EditorLoginForm.d.ts +13 -0
- package/dist/components/shell/EditorLoginForm.d.ts.map +1 -0
- package/dist/components/shell/EditorLoginForm.js +46 -0
- package/dist/components/shell/EditorModal.d.ts +13 -0
- package/dist/components/shell/EditorModal.d.ts.map +1 -0
- package/dist/components/shell/EditorModal.js +43 -0
- package/dist/components/shell/EditorModalContext.d.ts +16 -0
- package/dist/components/shell/EditorModalContext.d.ts.map +1 -0
- package/dist/components/shell/EditorModalContext.js +20 -0
- package/dist/components/shell/EditorShell.d.ts +22 -0
- package/dist/components/shell/EditorShell.d.ts.map +1 -0
- package/dist/components/shell/EditorShell.js +483 -0
- package/dist/components/shell/MediaLibraryContext.d.ts +14 -0
- package/dist/components/shell/MediaLibraryContext.d.ts.map +1 -0
- package/dist/components/shell/MediaLibraryContext.js +5 -0
- package/dist/components/shell/MediaLibraryModal.d.ts +14 -0
- package/dist/components/shell/MediaLibraryModal.d.ts.map +1 -0
- package/dist/components/shell/MediaLibraryModal.js +145 -0
- package/dist/components/shell/ProcessingIndicator.d.ts +7 -0
- package/dist/components/shell/ProcessingIndicator.d.ts.map +1 -0
- package/dist/components/shell/ProcessingIndicator.js +15 -0
- package/dist/components/shell/SectionSkeleton.d.ts +9 -0
- package/dist/components/shell/SectionSkeleton.d.ts.map +1 -0
- package/dist/components/shell/SectionSkeleton.js +22 -0
- package/dist/components/shell/SectionTypePicker.d.ts +14 -0
- package/dist/components/shell/SectionTypePicker.d.ts.map +1 -0
- package/dist/components/shell/SectionTypePicker.js +15 -0
- package/dist/components/shell/SiteSettingsDisplay.d.ts +8 -0
- package/dist/components/shell/SiteSettingsDisplay.d.ts.map +1 -0
- package/dist/components/shell/SiteSettingsDisplay.js +28 -0
- package/dist/components/shell/SiteSettingsModal.d.ts +24 -0
- package/dist/components/shell/SiteSettingsModal.d.ts.map +1 -0
- package/dist/components/shell/SiteSettingsModal.js +40 -0
- package/dist/components/shell/SiteSettingsUsers.d.ts +9 -0
- package/dist/components/shell/SiteSettingsUsers.d.ts.map +1 -0
- package/dist/components/shell/SiteSettingsUsers.js +87 -0
- package/dist/components/shell/SiteSettingsViewerAccess.d.ts +9 -0
- package/dist/components/shell/SiteSettingsViewerAccess.d.ts.map +1 -0
- package/dist/components/shell/SiteSettingsViewerAccess.js +94 -0
- package/dist/components/shell/ViewerLoginForm.d.ts +10 -0
- package/dist/components/shell/ViewerLoginForm.d.ts.map +1 -0
- package/dist/components/shell/ViewerLoginForm.js +40 -0
- package/dist/data/google-fonts.json +7718 -0
- package/dist/hooks/index.d.ts +7 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +6 -0
- package/dist/hooks/useActiveHeadings.d.ts +7 -0
- package/dist/hooks/useActiveHeadings.d.ts.map +1 -0
- package/dist/hooks/useActiveHeadings.js +99 -0
- package/dist/hooks/useEditorPersistence.d.ts +13 -0
- package/dist/hooks/useEditorPersistence.d.ts.map +1 -0
- package/dist/hooks/useEditorPersistence.js +73 -0
- package/dist/hooks/useEditorPublish.d.ts +24 -0
- package/dist/hooks/useEditorPublish.d.ts.map +1 -0
- package/dist/hooks/useEditorPublish.js +145 -0
- package/dist/hooks/useFocusTrap.d.ts +3 -0
- package/dist/hooks/useFocusTrap.d.ts.map +1 -0
- package/dist/hooks/useFocusTrap.js +51 -0
- package/dist/hooks/useMediaPipeline.d.ts +65 -0
- package/dist/hooks/useMediaPipeline.d.ts.map +1 -0
- package/dist/hooks/useMediaPipeline.js +253 -0
- package/dist/hooks/useResolvedMedia.d.ts +9 -0
- package/dist/hooks/useResolvedMedia.d.ts.map +1 -0
- package/dist/hooks/useResolvedMedia.js +39 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4 -0
- package/dist/lib/cn.d.ts +3 -0
- package/dist/lib/cn.d.ts.map +1 -0
- package/dist/lib/cn.js +5 -0
- package/dist/lib/contrast.d.ts +2 -0
- package/dist/lib/contrast.d.ts.map +1 -0
- package/dist/lib/contrast.js +11 -0
- package/dist/lib/dexie.d.ts +41 -0
- package/dist/lib/dexie.d.ts.map +1 -0
- package/dist/lib/dexie.js +236 -0
- package/dist/lib/events.d.ts +12 -0
- package/dist/lib/events.d.ts.map +1 -0
- package/dist/lib/events.js +15 -0
- package/dist/lib/google-fonts.d.ts +2 -0
- package/dist/lib/google-fonts.d.ts.map +1 -0
- package/dist/lib/google-fonts.js +11 -0
- package/dist/lib/grid.d.ts +2 -0
- package/dist/lib/grid.d.ts.map +1 -0
- package/dist/lib/grid.js +7 -0
- package/dist/lib/icons.d.ts +9 -0
- package/dist/lib/icons.d.ts.map +1 -0
- package/dist/lib/icons.js +27 -0
- package/dist/lib/index.d.ts +13 -0
- package/dist/lib/index.d.ts.map +1 -0
- package/dist/lib/index.js +12 -0
- package/dist/lib/loader.d.ts +28 -0
- package/dist/lib/loader.d.ts.map +1 -0
- package/dist/lib/loader.js +57 -0
- package/dist/lib/nav.d.ts +15 -0
- package/dist/lib/nav.d.ts.map +1 -0
- package/dist/lib/nav.js +58 -0
- package/dist/lib/registry.d.ts +110 -0
- package/dist/lib/registry.d.ts.map +1 -0
- package/dist/lib/registry.js +64 -0
- package/dist/lib/safeRedirect.d.ts +7 -0
- package/dist/lib/safeRedirect.d.ts.map +1 -0
- package/dist/lib/safeRedirect.js +11 -0
- package/dist/lib/sanitize.d.ts +2 -0
- package/dist/lib/sanitize.d.ts.map +1 -0
- package/dist/lib/sanitize.js +6 -0
- package/dist/lib/timestamp.d.ts +2 -0
- package/dist/lib/timestamp.d.ts.map +1 -0
- package/dist/lib/timestamp.js +28 -0
- package/dist/media/github.d.ts +3 -0
- package/dist/media/github.d.ts.map +1 -0
- package/dist/media/github.js +60 -0
- package/dist/media/index.d.ts +8 -0
- package/dist/media/index.d.ts.map +1 -0
- package/dist/media/index.js +9 -0
- package/dist/media/queue.d.ts +74 -0
- package/dist/media/queue.d.ts.map +1 -0
- package/dist/media/queue.js +116 -0
- package/dist/media/resolve.d.ts +14 -0
- package/dist/media/resolve.d.ts.map +1 -0
- package/dist/media/resolve.js +50 -0
- package/dist/media/types.d.ts +42 -0
- package/dist/media/types.d.ts.map +1 -0
- package/dist/media/types.js +1 -0
- package/dist/media/utils.d.ts +7 -0
- package/dist/media/utils.d.ts.map +1 -0
- package/dist/media/utils.js +41 -0
- package/dist/media/videoPoster.d.ts +6 -0
- package/dist/media/videoPoster.d.ts.map +1 -0
- package/dist/media/videoPoster.js +44 -0
- package/dist/media/worker.d.ts +36 -0
- package/dist/media/worker.d.ts.map +1 -0
- package/dist/media/worker.js +73 -0
- package/dist/schemas/audience.d.ts +12 -0
- package/dist/schemas/audience.d.ts.map +1 -0
- package/dist/schemas/audience.js +19 -0
- package/dist/schemas/auth.d.ts +36 -0
- package/dist/schemas/auth.d.ts.map +1 -0
- package/dist/schemas/auth.js +22 -0
- package/dist/schemas/index.d.ts +8 -0
- package/dist/schemas/index.d.ts.map +1 -0
- package/dist/schemas/index.js +7 -0
- package/dist/schemas/media-grid-options.d.ts +8 -0
- package/dist/schemas/media-grid-options.d.ts.map +1 -0
- package/dist/schemas/media-grid-options.js +7 -0
- package/dist/schemas/media.d.ts +63 -0
- package/dist/schemas/media.d.ts.map +1 -0
- package/dist/schemas/media.js +28 -0
- package/dist/schemas/sections.d.ts +12 -0
- package/dist/schemas/sections.d.ts.map +1 -0
- package/dist/schemas/sections.js +12 -0
- package/dist/schemas/shared.d.ts +98 -0
- package/dist/schemas/shared.d.ts.map +1 -0
- package/dist/schemas/shared.js +71 -0
- package/dist/schemas/site-config.d.ts +48 -0
- package/dist/schemas/site-config.d.ts.map +1 -0
- package/dist/schemas/site-config.js +26 -0
- package/package.json +57 -0
- package/src/auth/cookies.ts +51 -0
- package/src/auth/errors.ts +10 -0
- package/src/auth/index.ts +15 -0
- package/src/auth/security.ts +44 -0
- package/src/auth/types.ts +61 -0
- package/src/components/brandguide/ColorSwatchSettings.tsx +34 -0
- package/src/components/brandguide/Colors.tsx +277 -0
- package/src/components/brandguide/DoDontList.tsx +67 -0
- package/src/components/brandguide/DoDontMediaGrid.tsx +19 -0
- package/src/components/editor/AudiencePicker.tsx +103 -0
- package/src/components/editor/DeleteButton.tsx +18 -0
- package/src/components/editor/DragHandle.tsx +18 -0
- package/src/components/editor/InsertButton.tsx +22 -0
- package/src/components/editor/SectionWrapper.tsx +279 -0
- package/src/components/editor/SettingsButton.tsx +17 -0
- package/src/components/editor/SettingsForm.tsx +159 -0
- package/src/components/editor/StatusBadge.tsx +30 -0
- package/src/components/editor/StatusPicker.tsx +86 -0
- package/src/components/editor/index.ts +7 -0
- package/src/components/primitives/CustomParagraph.ts +25 -0
- package/src/components/primitives/EditableGrid.tsx +260 -0
- package/src/components/primitives/EditableList.tsx +160 -0
- package/src/components/primitives/EditablePlainText.tsx +99 -0
- package/src/components/primitives/EditableRichText.tsx +132 -0
- package/src/components/primitives/HeadingSection.tsx +25 -0
- package/src/components/primitives/IconPicker.tsx +60 -0
- package/src/components/primitives/LinkPopover.tsx +109 -0
- package/src/components/primitives/MediaSettingsForms.tsx +109 -0
- package/src/components/primitives/ResolvedMedia.tsx +36 -0
- package/src/components/primitives/RichTextToolbar.tsx +149 -0
- package/src/components/primitives/tiptap-presets.ts +50 -0
- package/src/components/primitives/useEditableCollection.ts +104 -0
- package/src/components/primitives/useEditablePlainText.ts +49 -0
- package/src/components/primitives/useEditableRichText.ts +74 -0
- package/src/components/sections/Button/CTAButton.tsx +50 -0
- package/src/components/sections/Button/index.tsx +37 -0
- package/src/components/sections/Colors/index.tsx +45 -0
- package/src/components/sections/DoDontList/index.tsx +43 -0
- package/src/components/sections/DoDontMediaGrid/index.tsx +53 -0
- package/src/components/sections/IconList/IconList.tsx +462 -0
- package/src/components/sections/IconList/IconListSettings.tsx +81 -0
- package/src/components/sections/IconList/index.tsx +36 -0
- package/src/components/sections/LinkHeading/index.tsx +24 -0
- package/src/components/sections/MediaGrid/MediaGrid.tsx +219 -0
- package/src/components/sections/MediaGrid/index.tsx +47 -0
- package/src/components/sections/Prose/Prose.tsx +34 -0
- package/src/components/sections/Prose/index.tsx +18 -0
- package/src/components/sections/SectionLayout.tsx +31 -0
- package/src/components/sections/SplitContent/SplitContent.tsx +77 -0
- package/src/components/sections/SplitContent/SplitContentSettings.tsx +42 -0
- package/src/components/sections/SplitContent/index.tsx +36 -0
- package/src/components/sections/SubHeading/index.tsx +27 -0
- package/src/components/sections/SubSubHeading/index.tsx +27 -0
- package/src/components/sections/ViewRenderer.tsx +29 -0
- package/src/components/sections/register-schemas.ts +16 -0
- package/src/components/sections/register.ts +16 -0
- package/src/components/shared/Button.tsx +77 -0
- package/src/components/shared/Checkbox.tsx +73 -0
- package/src/components/shared/ColorPicker.tsx +28 -0
- package/src/components/shared/ErrorBoundary.tsx +92 -0
- package/src/components/shared/FontPicker.tsx +300 -0
- package/src/components/shared/FormLabel.tsx +18 -0
- package/src/components/shared/IconButton.tsx +45 -0
- package/src/components/shared/Input.tsx +34 -0
- package/src/components/shared/Navigation.tsx +196 -0
- package/src/components/shared/PasswordInput.tsx +64 -0
- package/src/components/shared/Popover.tsx +61 -0
- package/src/components/shared/PopoverItem.tsx +24 -0
- package/src/components/shared/Select.tsx +60 -0
- package/src/components/shared/Textarea.tsx +34 -0
- package/src/components/shared/Toggle.tsx +35 -0
- package/src/components/shared/Tooltip.tsx +28 -0
- package/src/components/shared/icons.tsx +28 -0
- package/src/components/shell/AudienceAddForm.tsx +94 -0
- package/src/components/shell/AudienceRow.tsx +171 -0
- package/src/components/shell/EditorContext.tsx +44 -0
- package/src/components/shell/EditorLoginForm.tsx +130 -0
- package/src/components/shell/EditorModal.tsx +93 -0
- package/src/components/shell/EditorModalContext.tsx +40 -0
- package/src/components/shell/EditorShell.tsx +910 -0
- package/src/components/shell/MediaLibraryContext.tsx +19 -0
- package/src/components/shell/MediaLibraryModal.tsx +371 -0
- package/src/components/shell/ProcessingIndicator.tsx +84 -0
- package/src/components/shell/SectionSkeleton.tsx +54 -0
- package/src/components/shell/SectionTypePicker.tsx +47 -0
- package/src/components/shell/SiteSettingsDisplay.tsx +78 -0
- package/src/components/shell/SiteSettingsModal.tsx +129 -0
- package/src/components/shell/SiteSettingsUsers.tsx +190 -0
- package/src/components/shell/SiteSettingsViewerAccess.tsx +171 -0
- package/src/components/shell/ViewerLoginForm.tsx +95 -0
- package/src/data/google-fonts.json +7718 -0
- package/src/env.d.ts +3 -0
- package/src/hooks/index.ts +6 -0
- package/src/hooks/useActiveHeadings.ts +120 -0
- package/src/hooks/useEditorPersistence.ts +103 -0
- package/src/hooks/useEditorPublish.ts +187 -0
- package/src/hooks/useFocusTrap.ts +57 -0
- package/src/hooks/useMediaPipeline.ts +309 -0
- package/src/hooks/useResolvedMedia.ts +54 -0
- package/src/index.ts +4 -0
- package/src/lib/cn.ts +6 -0
- package/src/lib/contrast.ts +11 -0
- package/src/lib/dexie.ts +347 -0
- package/src/lib/events.ts +23 -0
- package/src/lib/google-fonts.ts +10 -0
- package/src/lib/grid.ts +7 -0
- package/src/lib/icons.ts +58 -0
- package/src/lib/index.ts +35 -0
- package/src/lib/loader.ts +81 -0
- package/src/lib/nav.ts +64 -0
- package/src/lib/registry.ts +202 -0
- package/src/lib/safeRedirect.ts +11 -0
- package/src/lib/sanitize.ts +6 -0
- package/src/lib/timestamp.ts +31 -0
- package/src/media/github.ts +72 -0
- package/src/media/index.ts +12 -0
- package/src/media/queue.ts +166 -0
- package/src/media/resolve.ts +63 -0
- package/src/media/types.ts +58 -0
- package/src/media/utils.ts +48 -0
- package/src/media/videoPoster.ts +53 -0
- package/src/media/worker.ts +122 -0
- package/src/schemas/audience.ts +28 -0
- package/src/schemas/auth.ts +31 -0
- package/src/schemas/index.ts +7 -0
- package/src/schemas/media-grid-options.ts +8 -0
- package/src/schemas/media.ts +40 -0
- package/src/schemas/sections.ts +24 -0
- package/src/schemas/shared.ts +96 -0
- package/src/schemas/site-config.ts +38 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { SectionContent } from "../../../schemas/sections";
|
|
2
|
+
interface Props {
|
|
3
|
+
text: string;
|
|
4
|
+
href?: string;
|
|
5
|
+
target?: string;
|
|
6
|
+
download?: boolean;
|
|
7
|
+
onChange?: (content: SectionContent) => void;
|
|
8
|
+
}
|
|
9
|
+
export default function Button({ text, href, target, download, onChange }: Props): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=CTAButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CTAButton.d.ts","sourceRoot":"","sources":["../../../../src/components/sections/Button/CTAButton.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAEhE,UAAU,KAAK;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,IAAI,CAAC;CAC9C;AAED,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,KAAK,2CAoC/E"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../../../lib/cn";
|
|
3
|
+
import { Download } from "lucide-react";
|
|
4
|
+
import { EditablePlainText } from "../../primitives/EditablePlainText";
|
|
5
|
+
export default function Button({ text, href, target, download, onChange }) {
|
|
6
|
+
const base = "inline-block rounded-md px-6 py-3 font-bold transition-colors";
|
|
7
|
+
const variant = "border-2 border-primary text-primary hover:bg-primary hover:text-primary-contrast";
|
|
8
|
+
if (onChange) {
|
|
9
|
+
return (_jsxs("span", { className: cn(base, variant, "inline-flex items-center gap-2"), children: [download && _jsx(Download, { size: 16, className: "shrink-0" }), _jsx(EditablePlainText, { tag: "span", value: text, onChange: (newText) => onChange({
|
|
10
|
+
type: "button",
|
|
11
|
+
content: { text: newText, href, target, download },
|
|
12
|
+
}), isEditMode: true, placeholder: "Button text" })] }));
|
|
13
|
+
}
|
|
14
|
+
if (href) {
|
|
15
|
+
return (_jsxs("a", { href: href, target: target, download: download ? "" : undefined, className: cn(base, variant, download && "inline-flex items-center gap-2"), children: [download && _jsx(Download, { size: 16, className: "shrink-0" }), text] }));
|
|
16
|
+
}
|
|
17
|
+
return (_jsx("button", { className: cn("cursor-pointer", base, variant), children: text }));
|
|
18
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
declare const _default: import("../../..").SectionDefinition<{
|
|
2
|
+
type: "button";
|
|
3
|
+
content: {
|
|
4
|
+
text: string;
|
|
5
|
+
href?: string | undefined;
|
|
6
|
+
target?: string | undefined;
|
|
7
|
+
download?: boolean | undefined;
|
|
8
|
+
};
|
|
9
|
+
}>;
|
|
10
|
+
export default _default;
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/sections/Button/index.tsx"],"names":[],"mappings":";;;;;;;;;AAcA,wBAsBG"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { defineSection } from "../../../lib/registry";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
import CTAButton from "./CTAButton";
|
|
5
|
+
const schema = z.object({
|
|
6
|
+
type: z.literal("button"),
|
|
7
|
+
content: z.object({
|
|
8
|
+
text: z.string(),
|
|
9
|
+
href: z.string().optional(),
|
|
10
|
+
target: z.string().optional(),
|
|
11
|
+
download: z.boolean().optional(),
|
|
12
|
+
}),
|
|
13
|
+
});
|
|
14
|
+
export default defineSection({
|
|
15
|
+
type: "button",
|
|
16
|
+
label: "Button",
|
|
17
|
+
schema,
|
|
18
|
+
component: ({ content, onChange }) => (_jsx(CTAButton, { text: content.content.text, href: content.content.href, target: content.content.target, download: content.content.download, onChange: onChange ? (c) => onChange(c) : undefined })),
|
|
19
|
+
defaults: () => ({ type: "button", content: { text: "Button" } }),
|
|
20
|
+
settings: {
|
|
21
|
+
href: { type: "text", label: "URL", default: "", target: "content", placeholder: "https://..." },
|
|
22
|
+
target: {
|
|
23
|
+
type: "select", label: "Target", default: "_self", target: "content",
|
|
24
|
+
options: [{ label: "Same tab (_self)", value: "_self" }, { label: "New tab (_blank)", value: "_blank" }],
|
|
25
|
+
},
|
|
26
|
+
download: { type: "checkbox", label: "Download link", default: false, target: "content" },
|
|
27
|
+
},
|
|
28
|
+
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
declare const _default: import("../../..").SectionDefinition<{
|
|
2
|
+
type: "colors";
|
|
3
|
+
content: {
|
|
4
|
+
colors: {
|
|
5
|
+
spaces: {
|
|
6
|
+
hex?: string | undefined;
|
|
7
|
+
rgb?: string | undefined;
|
|
8
|
+
cmyk?: string | undefined;
|
|
9
|
+
pantone?: string | undefined;
|
|
10
|
+
}[];
|
|
11
|
+
name?: string | undefined;
|
|
12
|
+
}[];
|
|
13
|
+
};
|
|
14
|
+
options?: {
|
|
15
|
+
label?: string | undefined;
|
|
16
|
+
columns?: number | undefined;
|
|
17
|
+
collapsing?: boolean | undefined;
|
|
18
|
+
showLabel?: boolean | undefined;
|
|
19
|
+
} | undefined;
|
|
20
|
+
}>;
|
|
21
|
+
export default _default;
|
|
22
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/sections/Colors/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAgBA,wBA4BG"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { defineSection } from "../../../lib/registry";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
import { ColorItemSchema } from "../../../schemas/shared";
|
|
5
|
+
import Colors from "../../brandguide/Colors";
|
|
6
|
+
const schema = z.object({
|
|
7
|
+
type: z.literal("colors"),
|
|
8
|
+
content: z.object({ colors: z.array(ColorItemSchema) }),
|
|
9
|
+
options: z.object({
|
|
10
|
+
label: z.string().optional(),
|
|
11
|
+
columns: z.number().int().min(2).max(4).optional(),
|
|
12
|
+
collapsing: z.boolean().optional(),
|
|
13
|
+
showLabel: z.boolean().optional(),
|
|
14
|
+
}).optional(),
|
|
15
|
+
});
|
|
16
|
+
export default defineSection({
|
|
17
|
+
type: "colors",
|
|
18
|
+
label: "Colors",
|
|
19
|
+
schema,
|
|
20
|
+
component: ({ content, options, onChange, openModal }) => (_jsx(Colors, { colors: content.content.colors, columns: options?.columns, label: options?.label, collapsing: options?.collapsing, showLabel: options?.showLabel, onChange: onChange ? (c) => onChange(c) : undefined, openModal: openModal })),
|
|
21
|
+
defaults: () => ({
|
|
22
|
+
type: "colors",
|
|
23
|
+
content: { colors: [{ spaces: [{ hex: "#000000" }] }] },
|
|
24
|
+
}),
|
|
25
|
+
settings: {
|
|
26
|
+
columns: {
|
|
27
|
+
type: "select", label: "Columns", default: "3", coerce: "number",
|
|
28
|
+
options: [{ label: "2", value: "2" }, { label: "3", value: "3" }, { label: "4", value: "4" }],
|
|
29
|
+
},
|
|
30
|
+
label: { type: "text", label: "Label", default: "", placeholder: "Color Section Label" },
|
|
31
|
+
showLabel: { type: "checkbox", label: "Show label", default: true },
|
|
32
|
+
collapsing: { type: "checkbox", label: "Collapsing layout", default: false },
|
|
33
|
+
},
|
|
34
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
declare const _default: import("../../..").SectionDefinition<{
|
|
2
|
+
type: "do_dont";
|
|
3
|
+
content: {
|
|
4
|
+
doItems: {
|
|
5
|
+
label: string;
|
|
6
|
+
text: string;
|
|
7
|
+
icon?: string | undefined;
|
|
8
|
+
}[];
|
|
9
|
+
dontItems: {
|
|
10
|
+
label: string;
|
|
11
|
+
text: string;
|
|
12
|
+
icon?: string | undefined;
|
|
13
|
+
}[];
|
|
14
|
+
};
|
|
15
|
+
options?: {
|
|
16
|
+
showLabel?: boolean | undefined;
|
|
17
|
+
stackText?: boolean | undefined;
|
|
18
|
+
} | undefined;
|
|
19
|
+
}>;
|
|
20
|
+
export default _default;
|
|
21
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/sections/DoDontList/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAkBA,wBAwBG"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { defineSection } from "../../../lib/registry";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
import DoDontList from "../../brandguide/DoDontList";
|
|
5
|
+
const DoDontItemSchema = z.object({ label: z.string(), text: z.string(), icon: z.string().optional() });
|
|
6
|
+
const schema = z.object({
|
|
7
|
+
type: z.literal("do_dont"),
|
|
8
|
+
content: z.object({
|
|
9
|
+
doItems: z.array(DoDontItemSchema),
|
|
10
|
+
dontItems: z.array(DoDontItemSchema),
|
|
11
|
+
}),
|
|
12
|
+
options: z.object({
|
|
13
|
+
showLabel: z.boolean().optional(),
|
|
14
|
+
stackText: z.boolean().optional(),
|
|
15
|
+
}).optional(),
|
|
16
|
+
});
|
|
17
|
+
export default defineSection({
|
|
18
|
+
type: "do_dont",
|
|
19
|
+
label: "Do / Don't",
|
|
20
|
+
schema,
|
|
21
|
+
component: ({ content, options, onChange }) => (_jsx(DoDontList, { doItems: content.content.doItems, dontItems: content.content.dontItems, showLabel: options?.showLabel, stackText: options?.stackText, onChange: onChange ? (c) => onChange(c) : undefined })),
|
|
22
|
+
defaults: () => ({
|
|
23
|
+
type: "do_dont",
|
|
24
|
+
content: {
|
|
25
|
+
doItems: [{ label: "Do", text: "" }],
|
|
26
|
+
dontItems: [{ label: "Don't", text: "" }],
|
|
27
|
+
},
|
|
28
|
+
}),
|
|
29
|
+
settings: {
|
|
30
|
+
showLabel: { type: "checkbox", label: "Show labels", default: true },
|
|
31
|
+
stackText: { type: "checkbox", label: "Stack label above text", default: false },
|
|
32
|
+
},
|
|
33
|
+
});
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
declare const _default: import("../../..").SectionDefinition<{
|
|
2
|
+
type: "do_dont_grid";
|
|
3
|
+
content: {
|
|
4
|
+
columns: number;
|
|
5
|
+
media: ({
|
|
6
|
+
imageId: string;
|
|
7
|
+
type: "image";
|
|
8
|
+
caption?: string | string[] | undefined;
|
|
9
|
+
background?: string | undefined;
|
|
10
|
+
invertFrom?: string | undefined;
|
|
11
|
+
border?: boolean | undefined;
|
|
12
|
+
objectFit?: "cover" | "contain" | undefined;
|
|
13
|
+
} | {
|
|
14
|
+
imageId: string;
|
|
15
|
+
type: "video";
|
|
16
|
+
caption?: string | string[] | undefined;
|
|
17
|
+
background?: string | undefined;
|
|
18
|
+
invertFrom?: string | undefined;
|
|
19
|
+
border?: boolean | undefined;
|
|
20
|
+
objectFit?: "cover" | "contain" | undefined;
|
|
21
|
+
poster?: string | undefined;
|
|
22
|
+
autoplay?: boolean | undefined;
|
|
23
|
+
loop?: boolean | undefined;
|
|
24
|
+
muted?: boolean | undefined;
|
|
25
|
+
} | {
|
|
26
|
+
imageId: string;
|
|
27
|
+
type: "doDontImage";
|
|
28
|
+
doDont: "do" | "dont";
|
|
29
|
+
caption?: string | string[] | undefined;
|
|
30
|
+
background?: string | undefined;
|
|
31
|
+
invertFrom?: string | undefined;
|
|
32
|
+
border?: boolean | undefined;
|
|
33
|
+
objectFit?: "cover" | "contain" | undefined;
|
|
34
|
+
} | {
|
|
35
|
+
imageId: string;
|
|
36
|
+
type: "linkedImage";
|
|
37
|
+
href: string;
|
|
38
|
+
caption?: string | string[] | undefined;
|
|
39
|
+
background?: string | undefined;
|
|
40
|
+
invertFrom?: string | undefined;
|
|
41
|
+
border?: boolean | undefined;
|
|
42
|
+
objectFit?: "cover" | "contain" | undefined;
|
|
43
|
+
target?: string | undefined;
|
|
44
|
+
linkText?: string | undefined;
|
|
45
|
+
})[];
|
|
46
|
+
};
|
|
47
|
+
options: {
|
|
48
|
+
square?: boolean | undefined;
|
|
49
|
+
border?: boolean | undefined;
|
|
50
|
+
crop?: boolean | undefined;
|
|
51
|
+
showCaptions?: boolean | undefined;
|
|
52
|
+
};
|
|
53
|
+
}>;
|
|
54
|
+
export default _default;
|
|
55
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/sections/DoDontMediaGrid/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeA,wBAqCG"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { defineSection } from "../../../lib/registry";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
import { MediaReferenceSchema } from "../../../schemas/shared";
|
|
5
|
+
import { MediaGridOptionsSchema } from "../../../schemas/media-grid-options";
|
|
6
|
+
import DoDontMediaGrid from "../../brandguide/DoDontMediaGrid";
|
|
7
|
+
const schema = z.object({
|
|
8
|
+
type: z.literal("do_dont_grid"),
|
|
9
|
+
content: z.object({
|
|
10
|
+
columns: z.number().int().min(1).max(5),
|
|
11
|
+
media: z.array(MediaReferenceSchema),
|
|
12
|
+
}),
|
|
13
|
+
options: MediaGridOptionsSchema,
|
|
14
|
+
});
|
|
15
|
+
export default defineSection({
|
|
16
|
+
type: "do_dont_grid",
|
|
17
|
+
label: "Do / Don't Grid",
|
|
18
|
+
schema,
|
|
19
|
+
component: ({ content, options, onChange, openModal }) => (_jsx(DoDontMediaGrid, { media: content.content.media, columns: content.content.columns, square: options?.square, border: options?.border, crop: options?.crop, showCaptions: options?.showCaptions, onChange: onChange ? (c) => onChange(c) : undefined, openModal: openModal })),
|
|
20
|
+
defaults: () => ({
|
|
21
|
+
type: "do_dont_grid",
|
|
22
|
+
options: {},
|
|
23
|
+
content: {
|
|
24
|
+
columns: 2,
|
|
25
|
+
media: [
|
|
26
|
+
{ type: "doDontImage", imageId: "", doDont: "do" },
|
|
27
|
+
{ type: "doDontImage", imageId: "", doDont: "dont" },
|
|
28
|
+
],
|
|
29
|
+
},
|
|
30
|
+
}),
|
|
31
|
+
settings: {
|
|
32
|
+
columns: {
|
|
33
|
+
type: "select", label: "Columns", default: "2", target: "content", coerce: "number",
|
|
34
|
+
options: [{ label: "1", value: "1" }, { label: "2", value: "2" }, { label: "3", value: "3" }, { label: "4", value: "4" }],
|
|
35
|
+
},
|
|
36
|
+
border: { type: "checkbox", label: "Show border", default: false },
|
|
37
|
+
square: { type: "checkbox", label: "Square aspect ratio", default: false },
|
|
38
|
+
crop: { type: "checkbox", label: "Crop to fill", default: false },
|
|
39
|
+
showCaptions: { type: "checkbox", label: "Show captions", default: false },
|
|
40
|
+
},
|
|
41
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { SectionContent } from "../../../schemas/sections";
|
|
2
|
+
interface IconListItem {
|
|
3
|
+
label: string;
|
|
4
|
+
text: string;
|
|
5
|
+
icon?: string;
|
|
6
|
+
}
|
|
7
|
+
interface Props {
|
|
8
|
+
items: IconListItem[];
|
|
9
|
+
icon?: string | null;
|
|
10
|
+
showLabel?: boolean;
|
|
11
|
+
stackText?: boolean;
|
|
12
|
+
labelClassName?: string;
|
|
13
|
+
textClassName?: string;
|
|
14
|
+
iconClassName?: string;
|
|
15
|
+
onChange?: (content: SectionContent) => void;
|
|
16
|
+
onItemsChange?: (items: IconListItem[]) => void;
|
|
17
|
+
}
|
|
18
|
+
export default function IconList({ items, icon, showLabel, stackText, labelClassName, textClassName, iconClassName, onChange, onItemsChange, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=IconList.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IconList.d.ts","sourceRoot":"","sources":["../../../../src/components/sections/IconList/IconList.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAShE,UAAU,YAAY;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,UAAU,KAAK;IACb,KAAK,EAAE,YAAY,EAAE,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,IAAI,CAAC;IAC7C,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,YAAY,EAAE,KAAK,IAAI,CAAC;CACjD;AAED,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,EAC/B,KAAK,EACL,IAAW,EACX,SAAgB,EAChB,SAAiB,EACjB,cAA+C,EAC/C,aAA0C,EAC1C,aAA8B,EAC9B,QAAQ,EACR,aAAa,GACd,EAAE,KAAK,2CAyCP"}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useRef, useEffect, useState, useCallback } from "react";
|
|
3
|
+
import { draggable, dropTargetForElements } from "@atlaskit/pragmatic-drag-and-drop/element/adapter";
|
|
4
|
+
import { cn } from "../../../lib/cn";
|
|
5
|
+
import { getIcon } from "../../../lib/icons";
|
|
6
|
+
import { useEditableCollection } from "../../primitives/useEditableCollection";
|
|
7
|
+
import { EditablePlainText } from "../../primitives/EditablePlainText";
|
|
8
|
+
import { DragHandle, DeleteIcon, AddIcon } from "../../shared/icons";
|
|
9
|
+
import { IconButton } from "../../shared/IconButton";
|
|
10
|
+
import { IconPicker } from "../../primitives/IconPicker";
|
|
11
|
+
export default function IconList({ items, icon = null, showLabel = true, stackText = false, labelClassName = "font-bold text-base-contrast", textClassName = "text-base-contrast-light", iconClassName = "text-primary", onChange, onItemsChange, }) {
|
|
12
|
+
const isEditMode = !!onChange || !!onItemsChange;
|
|
13
|
+
const emitItems = useCallback((newItems) => {
|
|
14
|
+
onChange?.({
|
|
15
|
+
type: "icon_list",
|
|
16
|
+
content: { items: newItems },
|
|
17
|
+
options: { icon, showLabel, stackText },
|
|
18
|
+
});
|
|
19
|
+
onItemsChange?.(newItems);
|
|
20
|
+
}, [onChange, onItemsChange, icon, showLabel, stackText]);
|
|
21
|
+
if (!isEditMode) {
|
|
22
|
+
return (_jsx(ViewIconList, { items: items, defaultIcon: icon, showLabel: showLabel, stackText: stackText, labelClassName: labelClassName, textClassName: textClassName, iconClassName: iconClassName }));
|
|
23
|
+
}
|
|
24
|
+
return (_jsx(EditIconList, { items: items, defaultIcon: icon, showLabel: showLabel, stackText: stackText, labelClassName: labelClassName, textClassName: textClassName, iconClassName: iconClassName, onItemsChange: emitItems }));
|
|
25
|
+
}
|
|
26
|
+
// ---------------------------------------------------------------------------
|
|
27
|
+
// Resolve the effective icon for an item: per-item override > section default
|
|
28
|
+
// ---------------------------------------------------------------------------
|
|
29
|
+
function resolveIcon(item, defaultIcon) {
|
|
30
|
+
const id = item.icon ?? defaultIcon;
|
|
31
|
+
return id ? getIcon(id) : null;
|
|
32
|
+
}
|
|
33
|
+
// ---------------------------------------------------------------------------
|
|
34
|
+
// View mode
|
|
35
|
+
// ---------------------------------------------------------------------------
|
|
36
|
+
function ViewIconList({ items, defaultIcon, showLabel, stackText, labelClassName, textClassName, iconClassName, }) {
|
|
37
|
+
const hasAnyIcon = items.some((item) => resolveIcon(item, defaultIcon));
|
|
38
|
+
return (_jsx("div", { className: "grid gap-4 pb-4", children: items.map((item, i) => {
|
|
39
|
+
const iconEntry = resolveIcon(item, defaultIcon);
|
|
40
|
+
return (_jsxs("div", { className: cn("grid gap-x-3", hasAnyIcon ? "grid-cols-[24px_1fr]" : "grid-cols-1"), children: [hasAnyIcon && (_jsx("div", { "data-testid": "icon-list-icon", className: cn("flex items-start pt-0.5", iconClassName), children: iconEntry && _jsx(iconEntry.icon, { size: 18 }) })), _jsxs("div", { "data-testid": "icon-list-content", className: stackText ? "flex flex-col" : undefined, children: [showLabel && (_jsxs("span", { className: labelClassName, children: [item.label, !stackText && " "] })), _jsx("span", { className: textClassName, children: item.text })] })] }, i));
|
|
41
|
+
}) }));
|
|
42
|
+
}
|
|
43
|
+
// ---------------------------------------------------------------------------
|
|
44
|
+
// Edit mode
|
|
45
|
+
// ---------------------------------------------------------------------------
|
|
46
|
+
function EditIconList({ items, defaultIcon, showLabel, stackText, labelClassName, textClassName, iconClassName, onItemsChange, }) {
|
|
47
|
+
const { wrappedItems, onReorder, onAdd, onRemove } = useEditableCollection({
|
|
48
|
+
items,
|
|
49
|
+
onChange: onItemsChange,
|
|
50
|
+
createItem: () => ({ label: "", text: "" }),
|
|
51
|
+
});
|
|
52
|
+
const [dragState, setDragState] = useState({ sourceId: null, targetId: null });
|
|
53
|
+
const updateItem = useCallback((index, patch) => {
|
|
54
|
+
const updated = wrappedItems.map((w, i) => i === index ? { ...w.data, ...patch } : w.data);
|
|
55
|
+
onItemsChange(updated);
|
|
56
|
+
}, [wrappedItems, onItemsChange]);
|
|
57
|
+
const hasAnyIcon = items.some((item) => resolveIcon(item, defaultIcon));
|
|
58
|
+
return (_jsxs("div", { className: "group/list relative grid gap-4 pb-4", children: [wrappedItems.map((wrapped, index) => (_jsx(EditableRow, { id: wrapped.id, index: index, item: wrapped.data, defaultIcon: defaultIcon, hasAnyIcon: hasAnyIcon, showLabel: showLabel, stackText: stackText, labelClassName: labelClassName, textClassName: textClassName, iconClassName: iconClassName, dragState: dragState, setDragState: setDragState, onReorder: onReorder, onRemove: onRemove, onUpdateItem: (patch) => updateItem(index, patch) }, wrapped.id))), _jsx(TrailingDropZone, { index: wrappedItems.length, dragState: dragState, setDragState: setDragState, onReorder: onReorder }), _jsx(IconButton, { icon: _jsx(AddIcon, { size: 16 }), label: "Add item", size: "lg", intent: "primary", onClick: onAdd, className: "absolute -bottom-6 left-1/2 z-20 -translate-x-1/2 rounded-full border border-base-200 bg-base opacity-0 transition-opacity group-hover/list:opacity-100" })] }));
|
|
59
|
+
}
|
|
60
|
+
function EditableRow({ id, index, item, defaultIcon, hasAnyIcon, showLabel, stackText, labelClassName, textClassName, iconClassName, dragState, setDragState, onReorder, onRemove, onUpdateItem, }) {
|
|
61
|
+
const rowRef = useRef(null);
|
|
62
|
+
const handleRef = useRef(null);
|
|
63
|
+
const [iconHover, setIconHover] = useState(false);
|
|
64
|
+
const [pickerOpen, setPickerOpen] = useState(false);
|
|
65
|
+
const iconEntry = resolveIcon(item, defaultIcon);
|
|
66
|
+
const effectiveIconId = item.icon ?? defaultIcon ?? null;
|
|
67
|
+
useEffect(() => {
|
|
68
|
+
const row = rowRef.current;
|
|
69
|
+
const handle = handleRef.current;
|
|
70
|
+
if (!row || !handle)
|
|
71
|
+
return;
|
|
72
|
+
const cleanupDraggable = draggable({
|
|
73
|
+
element: handle,
|
|
74
|
+
getInitialData: () => ({ dragType: "icon-list-row", id, index }),
|
|
75
|
+
onDragStart: () => setDragState({ sourceId: id, targetId: null }),
|
|
76
|
+
onDrop: () => setDragState({ sourceId: null, targetId: null }),
|
|
77
|
+
});
|
|
78
|
+
const cleanupDropTarget = dropTargetForElements({
|
|
79
|
+
element: row,
|
|
80
|
+
canDrop: ({ source }) => source.data.dragType === "icon-list-row",
|
|
81
|
+
getData: () => ({ id, index }),
|
|
82
|
+
onDragEnter: () => setDragState((prev) => ({ ...prev, targetId: id })),
|
|
83
|
+
onDragLeave: () => setDragState((prev) => prev.targetId === id ? { ...prev, targetId: null } : prev),
|
|
84
|
+
onDrop: ({ source }) => {
|
|
85
|
+
const fromIndex = source.data.index;
|
|
86
|
+
if (fromIndex !== index)
|
|
87
|
+
onReorder(fromIndex, index);
|
|
88
|
+
},
|
|
89
|
+
});
|
|
90
|
+
return () => {
|
|
91
|
+
cleanupDraggable();
|
|
92
|
+
cleanupDropTarget();
|
|
93
|
+
};
|
|
94
|
+
}, [id, index, onReorder, setDragState]);
|
|
95
|
+
const isDropTarget = dragState.targetId === id && dragState.sourceId !== id;
|
|
96
|
+
return (_jsxs("div", { ref: rowRef, className: cn("group/row relative grid gap-x-3", hasAnyIcon ? "grid-cols-[24px_1fr]" : "grid-cols-1", isDropTarget && "border-t-2 border-primary"), children: [_jsx(IconButton, { ref: handleRef, icon: _jsx(DragHandle, { size: 16 }), label: "Drag to reorder", size: "sm", className: cn("absolute -left-7 top-0 shrink-0 cursor-grab rounded-md text-base-contrast-light/80 hover:bg-base-contrast-light/10 hover:text-base-contrast active:cursor-grabbing", iconHover
|
|
97
|
+
? "opacity-0 pointer-events-none"
|
|
98
|
+
: "opacity-0 group-hover/row:opacity-100 no-hover:opacity-100"), tabIndex: -1 }), hasAnyIcon && (_jsxs("div", { className: cn("relative flex items-start pt-0.5", iconClassName), onMouseEnter: () => setIconHover(true), onMouseLeave: () => setIconHover(false), children: [iconEntry ? (_jsx("button", { className: "cursor-pointer transition-opacity hover:opacity-70", "aria-label": "Change icon", onClick: () => setPickerOpen((prev) => !prev), children: _jsx(iconEntry.icon, { size: 18 }) })) : null, iconHover && !pickerOpen && iconEntry && (_jsx("span", { className: "pointer-events-none absolute right-full mr-3 top-0.5 whitespace-nowrap text-xs text-base-contrast-light/80", children: "Edit" })), pickerOpen && (_jsx("div", { className: "absolute top-full left-0 z-50 mt-1", children: _jsx(IconPicker, { selected: effectiveIconId, showRemove: false, onSelect: (newIcon) => {
|
|
99
|
+
if (newIcon !== null)
|
|
100
|
+
onUpdateItem({ icon: newIcon });
|
|
101
|
+
setPickerOpen(false);
|
|
102
|
+
setIconHover(false);
|
|
103
|
+
}, onClose: () => {
|
|
104
|
+
setPickerOpen(false);
|
|
105
|
+
setIconHover(false);
|
|
106
|
+
} }) }))] })), _jsxs("div", { className: stackText ? "flex flex-col" : undefined, children: [showLabel && (_jsx(EditablePlainText, { tag: "span", value: item.label, onChange: (label) => onUpdateItem({ label }), isEditMode: true, placeholder: "Label", className: cn(labelClassName, !stackText && "mr-1") })), _jsx(EditablePlainText, { tag: "span", value: item.text, onChange: (text) => onUpdateItem({ text }), isEditMode: true, placeholder: "Text", className: textClassName })] }), _jsx(IconButton, { icon: _jsx(DeleteIcon, { size: 14 }), label: "Delete item", size: "sm", intent: "destructive", onClick: () => onRemove(id), className: "absolute -right-7 top-0 opacity-0 group-hover/row:opacity-100 no-hover:opacity-100" })] }));
|
|
107
|
+
}
|
|
108
|
+
function TrailingDropZone({ index, dragState, setDragState, onReorder, }) {
|
|
109
|
+
const ref = useRef(null);
|
|
110
|
+
const trailingId = "__trailing__";
|
|
111
|
+
useEffect(() => {
|
|
112
|
+
const el = ref.current;
|
|
113
|
+
if (!el)
|
|
114
|
+
return;
|
|
115
|
+
const cleanup = dropTargetForElements({
|
|
116
|
+
element: el,
|
|
117
|
+
canDrop: ({ source }) => source.data.dragType === "icon-list-row",
|
|
118
|
+
getData: () => ({ id: trailingId, index }),
|
|
119
|
+
onDragEnter: () => setDragState((prev) => ({ ...prev, targetId: trailingId })),
|
|
120
|
+
onDragLeave: () => setDragState((prev) => prev.targetId === trailingId ? { ...prev, targetId: null } : prev),
|
|
121
|
+
onDrop: ({ source }) => {
|
|
122
|
+
const fromIndex = source.data.index;
|
|
123
|
+
if (fromIndex !== index - 1)
|
|
124
|
+
onReorder(fromIndex, index - 1);
|
|
125
|
+
},
|
|
126
|
+
});
|
|
127
|
+
return cleanup;
|
|
128
|
+
}, [index, onReorder, setDragState]);
|
|
129
|
+
const isDropTarget = dragState.targetId === trailingId && dragState.sourceId !== null;
|
|
130
|
+
return (_jsx("div", { ref: ref, className: cn("absolute bottom-0 left-0 right-0 h-4", isDropTarget && "border-t-2 border-primary") }));
|
|
131
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare function IconListSettings({ icon: initialIcon, showLabel: initialShowLabel, stackText: initialStackText, onChange, }: {
|
|
2
|
+
icon: string | null;
|
|
3
|
+
showLabel: boolean;
|
|
4
|
+
stackText: boolean;
|
|
5
|
+
onChange: (values: {
|
|
6
|
+
icon: string | null;
|
|
7
|
+
showLabel: boolean;
|
|
8
|
+
stackText: boolean;
|
|
9
|
+
}) => void;
|
|
10
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
//# sourceMappingURL=IconListSettings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IconListSettings.d.ts","sourceRoot":"","sources":["../../../../src/components/sections/IconList/IconListSettings.tsx"],"names":[],"mappings":"AAMA,wBAAgB,gBAAgB,CAAC,EAC/B,IAAI,EAAE,WAAW,EACjB,SAAS,EAAE,gBAAgB,EAC3B,SAAS,EAAE,gBAAgB,EAC3B,QAAQ,GACT,EAAE;IACD,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,SAAS,EAAE,OAAO,CAAC;QAAC,SAAS,EAAE,OAAO,CAAA;KAAE,KAAK,IAAI,CAAC;CAC7F,2CAgEA"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import { Checkbox } from "../../shared/Checkbox";
|
|
4
|
+
import { FormLabel } from "../../shared/FormLabel";
|
|
5
|
+
import { IconPicker } from "../../primitives/IconPicker";
|
|
6
|
+
import { getIcon } from "../../../lib/icons";
|
|
7
|
+
export function IconListSettings({ icon: initialIcon, showLabel: initialShowLabel, stackText: initialStackText, onChange, }) {
|
|
8
|
+
const [icon, setIcon] = useState(initialIcon);
|
|
9
|
+
const [showLabel, setShowLabel] = useState(initialShowLabel);
|
|
10
|
+
const [stackText, setStackText] = useState(initialStackText);
|
|
11
|
+
const [pickerOpen, setPickerOpen] = useState(false);
|
|
12
|
+
const emit = (overrides) => onChange({ icon, showLabel, stackText, ...overrides });
|
|
13
|
+
const showIcons = icon !== null;
|
|
14
|
+
const iconEntry = icon ? getIcon(icon) : null;
|
|
15
|
+
return (_jsxs("div", { className: "space-y-4", children: [_jsxs("div", { className: "relative", children: [_jsx(FormLabel, { htmlFor: "icon-picker-btn", children: "Default Icon" }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsxs("button", { id: "icon-picker-btn", className: "cursor-pointer flex items-center gap-2 rounded border border-base-200 px-3 py-1.5 text-sm text-base-contrast-light hover:border-primary hover:text-primary", onClick: () => setPickerOpen((prev) => !prev), children: [iconEntry && _jsx(iconEntry.icon, { size: 16 }), _jsx("span", { children: iconEntry?.label ?? "None" })] }), icon && (_jsx("button", { className: "cursor-pointer text-xs text-base-contrast-light hover:text-base-contrast", onClick: () => { setIcon(null); emit({ icon: null }); }, children: "Clear" }))] }), pickerOpen && (_jsx("div", { className: "absolute top-full left-0 z-50 mt-1", children: _jsx(IconPicker, { selected: icon, onSelect: (newIcon) => {
|
|
16
|
+
if (newIcon !== null) {
|
|
17
|
+
setIcon(newIcon);
|
|
18
|
+
emit({ icon: newIcon });
|
|
19
|
+
}
|
|
20
|
+
setPickerOpen(false);
|
|
21
|
+
}, onClose: () => setPickerOpen(false) }) }))] }), _jsx(Checkbox, { checked: showLabel, onChange: (v) => { setShowLabel(v); emit({ showLabel: v }); }, label: "Show labels" }), showLabel && (_jsx(Checkbox, { checked: stackText, onChange: (v) => { setStackText(v); emit({ stackText: v }); }, label: "Stack label above text" }))] }));
|
|
22
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
declare const _default: import("../../..").SectionDefinition<{
|
|
2
|
+
type: "icon_list";
|
|
3
|
+
content: {
|
|
4
|
+
items: {
|
|
5
|
+
label: string;
|
|
6
|
+
text: string;
|
|
7
|
+
icon?: string | undefined;
|
|
8
|
+
}[];
|
|
9
|
+
};
|
|
10
|
+
options?: {
|
|
11
|
+
icon?: string | null | undefined;
|
|
12
|
+
showLabel?: boolean | undefined;
|
|
13
|
+
stackText?: boolean | undefined;
|
|
14
|
+
} | undefined;
|
|
15
|
+
}>;
|
|
16
|
+
export default _default;
|
|
17
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/sections/IconList/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;AAiBA,wBAkBG"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { defineSection } from "../../../lib/registry";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
import IconList from "./IconList";
|
|
5
|
+
import { IconListSettings } from "./IconListSettings";
|
|
6
|
+
const schema = z.object({
|
|
7
|
+
type: z.literal("icon_list"),
|
|
8
|
+
content: z.object({
|
|
9
|
+
items: z.array(z.object({ label: z.string(), text: z.string(), icon: z.string().optional() })),
|
|
10
|
+
}),
|
|
11
|
+
options: z.object({
|
|
12
|
+
icon: z.string().nullable().optional(),
|
|
13
|
+
showLabel: z.boolean().optional(),
|
|
14
|
+
stackText: z.boolean().optional(),
|
|
15
|
+
}).optional(),
|
|
16
|
+
});
|
|
17
|
+
export default defineSection({
|
|
18
|
+
type: "icon_list",
|
|
19
|
+
label: "Icon List",
|
|
20
|
+
schema,
|
|
21
|
+
component: ({ content, options, onChange }) => (_jsx(IconList, { items: content.content.items, icon: options?.icon, showLabel: options?.showLabel, stackText: options?.stackText, onChange: onChange ? (c) => onChange(c) : undefined })),
|
|
22
|
+
defaults: () => ({
|
|
23
|
+
type: "icon_list",
|
|
24
|
+
content: { items: [{ label: "", text: "" }] },
|
|
25
|
+
}),
|
|
26
|
+
settingsForm: IconListSettings,
|
|
27
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/sections/LinkHeading/index.tsx"],"names":[],"mappings":";;;;;;AASA,wBAcG"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { defineSection } from "../../../lib/registry";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
import { HeadingSection } from "../../primitives/HeadingSection";
|
|
5
|
+
const schema = z.object({
|
|
6
|
+
type: z.literal("link_heading"),
|
|
7
|
+
content: z.object({ heading: z.string() }),
|
|
8
|
+
});
|
|
9
|
+
export default defineSection({
|
|
10
|
+
type: "link_heading",
|
|
11
|
+
label: "Link Heading",
|
|
12
|
+
schema,
|
|
13
|
+
component: ({ content, onChange }) => (_jsx(HeadingSection, { heading: content.content.heading, tag: "h2", placeholder: "Section heading", className: "text-primary", onChange: onChange ? (heading) => onChange({ type: "link_heading", content: { heading } }) : undefined })),
|
|
14
|
+
defaults: () => ({ type: "link_heading", content: { heading: "New Section" } }),
|
|
15
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { MediaReference } from "../../../schemas/shared";
|
|
2
|
+
import type { SectionContent } from "../../../schemas/sections";
|
|
3
|
+
import type { ReactNode } from "react";
|
|
4
|
+
interface Props {
|
|
5
|
+
media: MediaReference[];
|
|
6
|
+
columns: number;
|
|
7
|
+
square?: boolean;
|
|
8
|
+
border?: boolean;
|
|
9
|
+
crop?: boolean;
|
|
10
|
+
showCaptions?: boolean;
|
|
11
|
+
sectionType?: string;
|
|
12
|
+
onChange?: (content: SectionContent) => void;
|
|
13
|
+
openModal?: (title: string, content: ReactNode) => void;
|
|
14
|
+
}
|
|
15
|
+
export default function MediaGrid({ media, columns, square, border, crop, showCaptions, sectionType, onChange, openModal }: Props): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=MediaGrid.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MediaGrid.d.ts","sourceRoot":"","sources":["../../../../src/components/sections/MediaGrid/MediaGrid.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAOhE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC,UAAU,KAAK;IACb,KAAK,EAAE,cAAc,EAAE,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,IAAI,CAAC;IAC7C,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,KAAK,IAAI,CAAC;CACzD;AAED,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,KAAK,2CAgChI"}
|