@conloca/cms-spa 0.1.15 → 0.1.16
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/dist/App-Bk1LNxbS.mjs +10851 -0
- package/dist/App-Bk1LNxbS.mjs.map +1 -0
- package/dist/App.d.ts +35 -0
- package/dist/App.d.ts.map +1 -0
- package/dist/App.js +52 -0
- package/dist/CmsSpaApp.d.ts +13 -0
- package/dist/CmsSpaApp.d.ts.map +1 -0
- package/dist/CmsSpaApp.js +33 -0
- package/dist/cn-dlASUkDY.mjs +10 -0
- package/dist/cn-dlASUkDY.mjs.map +1 -0
- package/dist/components/CMSDashboard.d.ts +2 -0
- package/dist/components/CMSDashboard.d.ts.map +1 -0
- package/dist/components/CMSDashboard.js +20 -0
- package/dist/components/CMSLayout.d.ts +2 -0
- package/dist/components/CMSLayout.d.ts.map +1 -0
- package/dist/components/CMSLayout.js +15 -0
- package/dist/components/ConlocaLogo.d.ts +2 -0
- package/dist/components/ConlocaLogo.d.ts.map +1 -0
- package/dist/components/ConlocaLogo.js +4 -0
- package/dist/components/GitStatusPanel.d.ts +25 -0
- package/dist/components/GitStatusPanel.d.ts.map +1 -0
- package/dist/components/GitStatusPanel.js +77 -0
- package/dist/components/MobileTopBar.d.ts +6 -0
- package/dist/components/MobileTopBar.d.ts.map +1 -0
- package/dist/components/MobileTopBar.js +6 -0
- package/dist/components/Sidebar.d.ts +8 -0
- package/dist/components/Sidebar.d.ts.map +1 -0
- package/dist/components/Sidebar.js +40 -0
- package/dist/components/UserAvatar.d.ts +2 -0
- package/dist/components/UserAvatar.d.ts.map +1 -0
- package/dist/components/UserAvatar.js +14 -0
- package/dist/components/cards/DataEntryCard.d.ts +14 -0
- package/dist/components/cards/DataEntryCard.d.ts.map +1 -0
- package/dist/components/cards/DataEntryCard.js +32 -0
- package/dist/components/cards/SectionCard.d.ts +15 -0
- package/dist/components/cards/SectionCard.d.ts.map +1 -0
- package/dist/components/cards/SectionCard.js +10 -0
- package/dist/components/cards/index.d.ts +2 -0
- package/dist/components/cards/index.d.ts.map +1 -0
- package/dist/components/cards/index.js +1 -0
- package/dist/components/dashboard/RecentActivity.d.ts +2 -0
- package/dist/components/dashboard/RecentActivity.d.ts.map +1 -0
- package/dist/components/dashboard/RecentActivity.js +58 -0
- package/dist/components/dialog.d.ts +53 -0
- package/dist/components/dialog.d.ts.map +1 -0
- package/dist/components/dialog.js +56 -0
- package/dist/components/dialogs/BlockPropertiesDialog.d.ts +12 -0
- package/dist/components/dialogs/BlockPropertiesDialog.d.ts.map +1 -0
- package/dist/components/dialogs/BlockPropertiesDialog.js +42 -0
- package/dist/components/dialogs/ConflictDialog.d.ts +10 -0
- package/dist/components/dialogs/ConflictDialog.d.ts.map +1 -0
- package/dist/components/dialogs/ConflictDialog.js +29 -0
- package/dist/components/dialogs/CreateDataDialog.d.ts +9 -0
- package/dist/components/dialogs/CreateDataDialog.d.ts.map +1 -0
- package/dist/components/dialogs/CreateDataDialog.js +20 -0
- package/dist/components/dialogs/CreateFolderDialog.d.ts +9 -0
- package/dist/components/dialogs/CreateFolderDialog.d.ts.map +1 -0
- package/dist/components/dialogs/CreateFolderDialog.js +33 -0
- package/dist/components/dialogs/CreatePageDialog.d.ts +10 -0
- package/dist/components/dialogs/CreatePageDialog.d.ts.map +1 -0
- package/dist/components/dialogs/CreatePageDialog.js +155 -0
- package/dist/components/dialogs/DataPropertiesDialog.d.ts +10 -0
- package/dist/components/dialogs/DataPropertiesDialog.d.ts.map +1 -0
- package/dist/components/dialogs/DataPropertiesDialog.js +38 -0
- package/dist/components/dialogs/DeleteConfirmDialog.d.ts +12 -0
- package/dist/components/dialogs/DeleteConfirmDialog.d.ts.map +1 -0
- package/dist/components/dialogs/DeleteConfirmDialog.js +7 -0
- package/dist/components/dialogs/ErrorModal.d.ts +14 -0
- package/dist/components/dialogs/ErrorModal.d.ts.map +1 -0
- package/dist/components/dialogs/ErrorModal.js +38 -0
- package/dist/components/dialogs/MoveFolderDialog.d.ts +11 -0
- package/dist/components/dialogs/MoveFolderDialog.d.ts.map +1 -0
- package/dist/components/dialogs/MoveFolderDialog.js +45 -0
- package/dist/components/dialogs/PageMetadataDialog.d.ts +10 -0
- package/dist/components/dialogs/PageMetadataDialog.d.ts.map +1 -0
- package/dist/components/dialogs/PageMetadataDialog.js +85 -0
- package/dist/components/dialogs/UnsavedChangesDialog.d.ts +8 -0
- package/dist/components/dialogs/UnsavedChangesDialog.d.ts.map +1 -0
- package/dist/components/dialogs/UnsavedChangesDialog.js +6 -0
- package/dist/components/dialogs/index.d.ts +9 -0
- package/dist/components/dialogs/index.d.ts.map +1 -0
- package/dist/components/dialogs/index.js +8 -0
- package/dist/components/editor/BlockEditor.d.ts +8 -0
- package/dist/components/editor/BlockEditor.d.ts.map +1 -0
- package/dist/components/editor/BlockEditor.js +262 -0
- package/dist/components/editor/BlockWrappers.d.ts +15 -0
- package/dist/components/editor/BlockWrappers.d.ts.map +1 -0
- package/dist/components/editor/BlockWrappers.js +29 -0
- package/dist/components/editor/CMSMDXEditor.d.ts +13 -0
- package/dist/components/editor/CMSMDXEditor.d.ts.map +1 -0
- package/dist/components/editor/CMSMDXEditor.js +123 -0
- package/dist/components/editor/ContentDiff.d.ts +10 -0
- package/dist/components/editor/ContentDiff.d.ts.map +1 -0
- package/dist/components/editor/ContentDiff.js +51 -0
- package/dist/components/editor/CreateBlockDialog.d.ts +26 -0
- package/dist/components/editor/CreateBlockDialog.d.ts.map +1 -0
- package/dist/components/editor/CreateBlockDialog.js +131 -0
- package/dist/components/editor/DrawerItemOverride.d.ts +8 -0
- package/dist/components/editor/DrawerItemOverride.d.ts.map +1 -0
- package/dist/components/editor/DrawerItemOverride.js +41 -0
- package/dist/components/editor/EditorChromeToggles.d.ts +16 -0
- package/dist/components/editor/EditorChromeToggles.d.ts.map +1 -0
- package/dist/components/editor/EditorChromeToggles.js +16 -0
- package/dist/components/editor/GenericBlock.d.ts +3 -0
- package/dist/components/editor/GenericBlock.d.ts.map +1 -0
- package/dist/components/editor/GenericBlock.js +1067 -0
- package/dist/components/editor/ImagePickerDialog.d.ts +6 -0
- package/dist/components/editor/ImagePickerDialog.d.ts.map +1 -0
- package/dist/components/editor/ImagePickerDialog.js +24 -0
- package/dist/components/editor/JsxPropsPanel.d.ts +16 -0
- package/dist/components/editor/JsxPropsPanel.d.ts.map +1 -0
- package/dist/components/editor/JsxPropsPanel.js +145 -0
- package/dist/components/editor/LocaleSelector.d.ts +9 -0
- package/dist/components/editor/LocaleSelector.d.ts.map +1 -0
- package/dist/components/editor/LocaleSelector.js +13 -0
- package/dist/components/editor/MDXLivePreview.d.ts +14 -0
- package/dist/components/editor/MDXLivePreview.d.ts.map +1 -0
- package/dist/components/editor/MDXLivePreview.js +103 -0
- package/dist/components/editor/MdxPageEditor.d.ts +10 -0
- package/dist/components/editor/MdxPageEditor.d.ts.map +1 -0
- package/dist/components/editor/MdxPageEditor.js +297 -0
- package/dist/components/editor/PageEditor.d.ts +18 -0
- package/dist/components/editor/PageEditor.d.ts.map +1 -0
- package/dist/components/editor/PageEditor.js +288 -0
- package/dist/components/editor/PageEditorHeaderActions.d.ts +16 -0
- package/dist/components/editor/PageEditorHeaderActions.d.ts.map +1 -0
- package/dist/components/editor/PageEditorHeaderActions.js +19 -0
- package/dist/components/editor/PageEditorWrapper.d.ts +7 -0
- package/dist/components/editor/PageEditorWrapper.d.ts.map +1 -0
- package/dist/components/editor/PageEditorWrapper.js +319 -0
- package/dist/components/editor/SearchableSelect.d.ts +34 -0
- package/dist/components/editor/SearchableSelect.d.ts.map +1 -0
- package/dist/components/editor/SearchableSelect.js +116 -0
- package/dist/components/editor/host-wrapper-plugin.d.ts +51 -0
- package/dist/components/editor/host-wrapper-plugin.d.ts.map +1 -0
- package/dist/components/editor/host-wrapper-plugin.js +37 -0
- package/dist/components/editor/index.d.ts +9 -0
- package/dist/components/editor/index.d.ts.map +1 -0
- package/dist/components/editor/index.js +7 -0
- package/dist/components/editor/insert-menu/InsertMdxComponentButton.d.ts +15 -0
- package/dist/components/editor/insert-menu/InsertMdxComponentButton.d.ts.map +1 -0
- package/dist/components/editor/insert-menu/InsertMdxComponentButton.js +90 -0
- package/dist/components/editor/insert-menu/SlashMenuPlugin.d.ts +12 -0
- package/dist/components/editor/insert-menu/SlashMenuPlugin.d.ts.map +1 -0
- package/dist/components/editor/insert-menu/SlashMenuPlugin.js +106 -0
- package/dist/components/editor/insert-menu/insert-payload.d.ts +76 -0
- package/dist/components/editor/insert-menu/insert-payload.d.ts.map +1 -0
- package/dist/components/editor/insert-menu/insert-payload.js +94 -0
- package/dist/components/editor/insert-menu/mdx-components-plugin.d.ts +8 -0
- package/dist/components/editor/insert-menu/mdx-components-plugin.d.ts.map +1 -0
- package/dist/components/editor/insert-menu/mdx-components-plugin.js +13 -0
- package/dist/components/editors/DataEditor.d.ts +19 -0
- package/dist/components/editors/DataEditor.d.ts.map +1 -0
- package/dist/components/editors/DataEditor.js +139 -0
- package/dist/components/fields/ContentBlockSelectorField.d.ts +14 -0
- package/dist/components/fields/ContentBlockSelectorField.d.ts.map +1 -0
- package/dist/components/fields/ContentBlockSelectorField.js +105 -0
- package/dist/components/fields/ImageField.d.ts +16 -0
- package/dist/components/fields/ImageField.d.ts.map +1 -0
- package/dist/components/fields/ImageField.js +39 -0
- package/dist/components/fields/MDXEditField.d.ts +17 -0
- package/dist/components/fields/MDXEditField.d.ts.map +1 -0
- package/dist/components/fields/MDXEditField.js +28 -0
- package/dist/components/forms/ChipArrayField.d.ts +12 -0
- package/dist/components/forms/ChipArrayField.d.ts.map +1 -0
- package/dist/components/forms/ChipArrayField.js +40 -0
- package/dist/components/forms/HintForm.d.ts +22 -0
- package/dist/components/forms/HintForm.d.ts.map +1 -0
- package/dist/components/forms/HintForm.js +162 -0
- package/dist/components/forms/SchemaForm.d.ts +15 -0
- package/dist/components/forms/SchemaForm.d.ts.map +1 -0
- package/dist/components/forms/SchemaForm.js +106 -0
- package/dist/components/index.d.ts +8 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +13 -0
- package/dist/components/media/AssetCard.d.ts +14 -0
- package/dist/components/media/AssetCard.d.ts.map +1 -0
- package/dist/components/media/AssetCard.js +31 -0
- package/dist/components/media/AssetDetailSidebar.d.ts +11 -0
- package/dist/components/media/AssetDetailSidebar.d.ts.map +1 -0
- package/dist/components/media/AssetDetailSidebar.js +101 -0
- package/dist/components/media/BulkActionBar.d.ts +9 -0
- package/dist/components/media/BulkActionBar.d.ts.map +1 -0
- package/dist/components/media/BulkActionBar.js +8 -0
- package/dist/components/media/FolderNav.d.ts +7 -0
- package/dist/components/media/FolderNav.d.ts.map +1 -0
- package/dist/components/media/FolderNav.js +12 -0
- package/dist/components/media/FolderTreeSidebar.d.ts +9 -0
- package/dist/components/media/FolderTreeSidebar.d.ts.map +1 -0
- package/dist/components/media/FolderTreeSidebar.js +41 -0
- package/dist/components/media/ImagePicker.d.ts +14 -0
- package/dist/components/media/ImagePicker.d.ts.map +1 -0
- package/dist/components/media/ImagePicker.js +45 -0
- package/dist/components/media/MediaLibrary.d.ts +35 -0
- package/dist/components/media/MediaLibrary.d.ts.map +1 -0
- package/dist/components/media/MediaLibrary.js +100 -0
- package/dist/components/media/MediaToolbar.d.ts +21 -0
- package/dist/components/media/MediaToolbar.d.ts.map +1 -0
- package/dist/components/media/MediaToolbar.js +6 -0
- package/dist/components/media/UploadModal.d.ts +9 -0
- package/dist/components/media/UploadModal.d.ts.map +1 -0
- package/dist/components/media/UploadModal.js +42 -0
- package/dist/components/media/UploadZone.d.ts +8 -0
- package/dist/components/media/UploadZone.d.ts.map +1 -0
- package/dist/components/media/UploadZone.js +22 -0
- package/dist/components/media/index.d.ts +11 -0
- package/dist/components/media/index.d.ts.map +1 -0
- package/dist/components/media/index.js +10 -0
- package/dist/components/pages/BlockList.d.ts +2 -0
- package/dist/components/pages/BlockList.d.ts.map +1 -0
- package/dist/components/pages/BlockList.js +280 -0
- package/dist/components/pages/DataList.d.ts +7 -0
- package/dist/components/pages/DataList.d.ts.map +1 -0
- package/dist/components/pages/DataList.js +244 -0
- package/dist/components/pages/MediaPage.d.ts +8 -0
- package/dist/components/pages/MediaPage.d.ts.map +1 -0
- package/dist/components/pages/MediaPage.js +107 -0
- package/dist/components/pages/PageList.d.ts +7 -0
- package/dist/components/pages/PageList.d.ts.map +1 -0
- package/dist/components/pages/PageList.js +308 -0
- package/dist/components/pages/index.d.ts +3 -0
- package/dist/components/pages/index.d.ts.map +1 -0
- package/dist/components/pages/index.js +2 -0
- package/dist/components/puck/MDXContent.d.ts +10 -0
- package/dist/components/puck/MDXContent.d.ts.map +1 -0
- package/dist/components/puck/MDXContent.js +80 -0
- package/dist/components/puck/index.d.ts +2 -0
- package/dist/components/puck/index.d.ts.map +1 -0
- package/dist/components/puck/index.js +1 -0
- package/dist/components/toast.d.ts +44 -0
- package/dist/components/toast.d.ts.map +1 -0
- package/dist/components/toast.js +7 -0
- package/dist/components/ui/Banner.d.ts +76 -0
- package/dist/components/ui/Banner.d.ts.map +1 -0
- package/dist/components/ui/Banner.js +49 -0
- package/dist/components/ui/Button.d.ts +25 -0
- package/dist/components/ui/Button.d.ts.map +1 -0
- package/dist/components/ui/Button.js +33 -0
- package/dist/components/ui/Card.d.ts +72 -0
- package/dist/components/ui/Card.d.ts.map +1 -0
- package/dist/components/ui/Card.js +49 -0
- package/dist/components/ui/FieldError.d.ts +24 -0
- package/dist/components/ui/FieldError.d.ts.map +1 -0
- package/dist/components/ui/FieldError.js +17 -0
- package/dist/components/ui/IconButton.d.ts +13 -0
- package/dist/components/ui/IconButton.d.ts.map +1 -0
- package/dist/components/ui/IconButton.js +10 -0
- package/dist/components/ui/Input.d.ts +37 -0
- package/dist/components/ui/Input.d.ts.map +1 -0
- package/dist/components/ui/Input.js +9 -0
- package/dist/components/ui/SaveIndicator.d.ts +8 -0
- package/dist/components/ui/SaveIndicator.d.ts.map +1 -0
- package/dist/components/ui/SaveIndicator.js +32 -0
- package/dist/components/ui/Select.d.ts +8 -0
- package/dist/components/ui/Select.d.ts.map +1 -0
- package/dist/components/ui/Select.js +9 -0
- package/dist/components/ui/Separator.d.ts +7 -0
- package/dist/components/ui/Separator.d.ts.map +1 -0
- package/dist/components/ui/Separator.js +8 -0
- package/dist/components/ui/Textarea.d.ts +8 -0
- package/dist/components/ui/Textarea.d.ts.map +1 -0
- package/dist/components/ui/Textarea.js +5 -0
- package/dist/components/ui/Tooltip.d.ts +9 -0
- package/dist/components/ui/Tooltip.d.ts.map +1 -0
- package/dist/components/ui/Tooltip.js +7 -0
- package/dist/components/ui/index.d.ts +14 -0
- package/dist/components/ui/index.d.ts.map +1 -0
- package/dist/components/ui/index.js +17 -0
- package/dist/data-schemas.d.mts +0 -1
- package/dist/data-schemas.d.mts.map +1 -1
- package/dist/data-schemas.d.ts +22 -0
- package/dist/data-schemas.d.ts.map +1 -0
- package/dist/data-schemas.js +51 -0
- package/dist/data-schemas.mjs +3 -4
- package/dist/data-schemas.mjs.map +1 -1
- package/dist/dev-entry.d.ts +2 -0
- package/dist/dev-entry.d.ts.map +1 -0
- package/dist/dev-entry.js +19 -0
- package/dist/dialog.d.mts +56 -0
- package/dist/dialog.d.mts.map +1 -0
- package/dist/dialog.mjs +67 -0
- package/dist/dialog.mjs.map +1 -0
- package/dist/hooks/index.d.ts +10 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +7 -0
- package/dist/hooks/useCanvasTheme.d.ts +12 -0
- package/dist/hooks/useCanvasTheme.d.ts.map +1 -0
- package/dist/hooks/useCanvasTheme.js +33 -0
- package/dist/hooks/useClickOutside.d.ts +7 -0
- package/dist/hooks/useClickOutside.d.ts.map +1 -0
- package/dist/hooks/useClickOutside.js +18 -0
- package/dist/hooks/useDialogState.d.ts +23 -0
- package/dist/hooks/useDialogState.d.ts.map +1 -0
- package/dist/hooks/useDialogState.js +31 -0
- package/dist/hooks/useEditorPref.d.ts +2 -0
- package/dist/hooks/useEditorPref.d.ts.map +1 -0
- package/dist/hooks/useEditorPref.js +49 -0
- package/dist/hooks/useErrorModal.d.ts +15 -0
- package/dist/hooks/useErrorModal.d.ts.map +1 -0
- package/dist/hooks/useErrorModal.js +35 -0
- package/dist/hooks/useSiteBaseUrl.d.ts +10 -0
- package/dist/hooks/useSiteBaseUrl.d.ts.map +1 -0
- package/dist/hooks/useSiteBaseUrl.js +14 -0
- package/dist/hooks/useTheme.d.ts +13 -0
- package/dist/hooks/useTheme.d.ts.map +1 -0
- package/dist/hooks/useTheme.js +69 -0
- package/dist/hooks/useUnsavedChangesGuard.d.ts +16 -0
- package/dist/hooks/useUnsavedChangesGuard.d.ts.map +1 -0
- package/dist/hooks/useUnsavedChangesGuard.js +29 -0
- package/dist/hooks/useUpload.d.ts +10 -0
- package/dist/hooks/useUpload.d.ts.map +1 -0
- package/dist/hooks/useUpload.js +42 -0
- package/dist/hooks/useUploadFlow.d.ts +42 -0
- package/dist/hooks/useUploadFlow.d.ts.map +1 -0
- package/dist/hooks/useUploadFlow.js +148 -0
- package/dist/host-style-probe.d.ts +22 -0
- package/dist/host-style-probe.d.ts.map +1 -0
- package/dist/host-style-probe.js +508 -0
- package/dist/index.d.mts +167 -39
- package/dist/index.d.mts.map +1 -1
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +12 -0
- package/dist/index.mjs +36 -2
- package/dist/index.mjs.map +1 -0
- package/dist/lib/utils.d.ts +13 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.js +47 -0
- package/dist/main-spa-781YUplS.mjs +46 -0
- package/dist/main-spa-781YUplS.mjs.map +1 -0
- package/dist/main-spa.d.ts +8 -0
- package/dist/main-spa.d.ts.map +1 -0
- package/dist/main-spa.js +61 -0
- package/dist/main.d.mts +1 -1
- package/dist/main.d.ts +2 -0
- package/dist/main.d.ts.map +1 -0
- package/dist/main.js +13 -0
- package/dist/main.mjs +11 -5681
- package/dist/main.mjs.map +1 -1
- package/dist/mdx-components.d.mts +207 -0
- package/dist/mdx-components.d.mts.map +1 -0
- package/dist/mdx-components.d.ts +204 -0
- package/dist/mdx-components.d.ts.map +1 -0
- package/dist/mdx-components.js +217 -0
- package/dist/mdx-components.mjs +208 -0
- package/dist/mdx-components.mjs.map +1 -0
- package/dist/media/AssetScopePill.d.ts +30 -0
- package/dist/media/AssetScopePill.d.ts.map +1 -0
- package/dist/media/AssetScopePill.js +30 -0
- package/dist/media/MediaIssueBadge.d.ts +33 -0
- package/dist/media/MediaIssueBadge.d.ts.map +1 -0
- package/dist/media/MediaIssueBadge.js +54 -0
- package/dist/media/types.d.ts +101 -0
- package/dist/media/types.d.ts.map +1 -0
- package/dist/media/types.js +1 -0
- package/dist/media/use-asset-scope.d.ts +25 -0
- package/dist/media/use-asset-scope.d.ts.map +1 -0
- package/dist/media/use-asset-scope.js +54 -0
- package/dist/media/use-media-issue.d.ts +24 -0
- package/dist/media/use-media-issue.d.ts.map +1 -0
- package/dist/media/use-media-issue.js +49 -0
- package/dist/mock-puck-config.d.mts +23 -0
- package/dist/mock-puck-config.d.mts.map +1 -0
- package/dist/mock-puck-config.d.ts +21 -0
- package/dist/mock-puck-config.d.ts.map +1 -0
- package/dist/mock-puck-config.js +73 -0
- package/dist/mock-puck-config.mjs +125 -0
- package/dist/mock-puck-config.mjs.map +1 -0
- package/dist/page-schemas.d.mts +139 -6
- package/dist/page-schemas.d.mts.map +1 -1
- package/dist/page-schemas.d.ts +156 -0
- package/dist/page-schemas.d.ts.map +1 -0
- package/dist/page-schemas.js +118 -0
- package/dist/page-schemas.mjs +74 -6
- package/dist/page-schemas.mjs.map +1 -1
- package/dist/puck-config.d.mts +0 -1
- package/dist/puck-config.d.mts.map +1 -1
- package/dist/puck-config.d.ts +31 -0
- package/dist/puck-config.d.ts.map +1 -0
- package/dist/puck-config.js +50 -0
- package/dist/puck-config.mjs +3 -4
- package/dist/puck-config.mjs.map +1 -1
- package/dist/selected-block.d.ts +61 -0
- package/dist/selected-block.d.ts.map +1 -0
- package/dist/selected-block.js +64 -0
- package/dist/site-styles.d.mts +90 -8
- package/dist/site-styles.d.mts.map +1 -1
- package/dist/site-styles.d.ts +121 -0
- package/dist/site-styles.d.ts.map +1 -0
- package/dist/site-styles.js +253 -0
- package/dist/site-styles.mjs +187 -5
- package/dist/site-styles.mjs.map +1 -1
- package/dist/spa/main.css +690 -127
- package/dist/toast.d.mts +7 -0
- package/dist/toast.d.mts.map +1 -0
- package/dist/toast.mjs +16 -0
- package/dist/toast.mjs.map +1 -0
- package/dist/types.d.ts +57 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +1 -0
- package/dist/ui-CIacC6Mv.mjs +318 -0
- package/dist/ui-CIacC6Mv.mjs.map +1 -0
- package/dist/ui-config.d.ts +70 -0
- package/dist/ui-config.d.ts.map +1 -0
- package/dist/ui-config.js +44 -0
- package/dist/ui.d.mts +290 -0
- package/dist/ui.d.mts.map +1 -0
- package/dist/ui.mjs +2 -0
- package/dist/utils/asset-url.d.ts +3 -0
- package/dist/utils/asset-url.d.ts.map +1 -0
- package/dist/utils/asset-url.js +7 -0
- package/dist/utils/cn.d.ts +3 -0
- package/dist/utils/cn.d.ts.map +1 -0
- package/dist/utils/cn.js +5 -0
- package/dist/utils/format-date.d.ts +15 -0
- package/dist/utils/format-date.d.ts.map +1 -0
- package/dist/utils/format-date.js +37 -0
- package/dist/utils/mdast-to-html.d.ts +55 -0
- package/dist/utils/mdast-to-html.d.ts.map +1 -0
- package/dist/utils/mdast-to-html.js +206 -0
- package/dist/utils/mdast-tree.d.ts +104 -0
- package/dist/utils/mdast-tree.d.ts.map +1 -0
- package/dist/utils/mdast-tree.js +285 -0
- package/dist/utils/pageMetadata.d.ts +67 -0
- package/dist/utils/pageMetadata.d.ts.map +1 -0
- package/dist/utils/pageMetadata.js +161 -0
- package/dist/utils/slugify.d.ts +12 -0
- package/dist/utils/slugify.d.ts.map +1 -0
- package/dist/utils/slugify.js +17 -0
- package/dist/utils/zodIntrospect.d.ts +24 -0
- package/dist/utils/zodIntrospect.d.ts.map +1 -0
- package/dist/utils/zodIntrospect.js +88 -0
- package/package.json +148 -35
- package/styles/styles.css.d.ts +2 -0
- package/styles/tailwind-theme.css +126 -0
- package/styles/tailwind-theme.css.d.ts +2 -0
- package/dist/puck-C9_F3_cJ.mjs +0 -1589
- package/dist/puck-C9_F3_cJ.mjs.map +0 -1
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// Conloca brand mark — used by hosted shells that own their own
|
|
2
|
+
// pre-auth surfaces (e.g. a host login screen). Lives in the `/ui`
|
|
3
|
+
// subpath so consumers can import it without pulling the heavy main
|
|
4
|
+
// barrel (which imports the MDX editor + sandpack-react), mirroring
|
|
5
|
+
// the existing precedent for thin per-piece imports.
|
|
6
|
+
export { ConlocaLogo } from '../ConlocaLogo';
|
|
7
|
+
export { Banner } from './Banner';
|
|
8
|
+
export { Button } from './Button';
|
|
9
|
+
export { Card } from './Card';
|
|
10
|
+
export { FieldError } from './FieldError';
|
|
11
|
+
export { IconButton } from './IconButton';
|
|
12
|
+
export { Input } from './Input';
|
|
13
|
+
export { SaveIndicator } from './SaveIndicator';
|
|
14
|
+
export { Select } from './Select';
|
|
15
|
+
export { Separator } from './Separator';
|
|
16
|
+
export { Textarea } from './Textarea';
|
|
17
|
+
export { Tooltip } from './Tooltip';
|
package/dist/data-schemas.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-schemas.d.mts","names":[],"sources":["../src/data-schemas.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"data-schemas.d.mts","names":[],"sources":["../src/data-schemas.ts"],"mappings":";;;;;;KAOY,cAAc,eAAe,EAAE,UAAU,EAAE;;;;;;iBA+BvC,eAAe,SAAS;;;;iBAWxB,kBAAkB;;;;;iBAQlB,kBAAkB"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Type for a collection of data schemas.
|
|
4
|
+
* Each key is a collection name, value is the Zod schema for that collection's data.
|
|
5
|
+
*/
|
|
6
|
+
export type DataSchemas = Record<string, z.ZodObject<z.ZodRawShape>>;
|
|
7
|
+
/**
|
|
8
|
+
* Set the data schemas for all collections.
|
|
9
|
+
* Called by the virtual module that loads user's schema definitions.
|
|
10
|
+
* Notifies all subscribers of the change (enables HMR).
|
|
11
|
+
*/
|
|
12
|
+
export declare function setDataSchemas(schemas: DataSchemas): void;
|
|
13
|
+
/**
|
|
14
|
+
* Get the current data schemas synchronously.
|
|
15
|
+
*/
|
|
16
|
+
export declare function getDataSchemas(): DataSchemas;
|
|
17
|
+
/**
|
|
18
|
+
* React hook to subscribe to data schema changes.
|
|
19
|
+
* Returns the current schemas and updates when they change (HMR support).
|
|
20
|
+
*/
|
|
21
|
+
export declare function useDataSchemas(): DataSchemas;
|
|
22
|
+
//# sourceMappingURL=data-schemas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-schemas.d.ts","sourceRoot":"","sources":["../src/data-schemas.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAE7B;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC;AA0BrE;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,CAMzD;AAED;;GAEG;AACH,wBAAgB,cAAc,IAAI,WAAW,CAE5C;AAED;;;GAGG;AACH,wBAAgB,cAAc,IAAI,WAAW,CAkB5C"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
const getSharedState = () => {
|
|
3
|
+
if (typeof window !== 'undefined') {
|
|
4
|
+
if (!window.__DATA_SCHEMAS_STATE__) {
|
|
5
|
+
window.__DATA_SCHEMAS_STATE__ = {
|
|
6
|
+
schemas: {},
|
|
7
|
+
subscribers: new Set(),
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
return window.__DATA_SCHEMAS_STATE__;
|
|
11
|
+
}
|
|
12
|
+
// SSR fallback
|
|
13
|
+
return { schemas: {}, subscribers: new Set() };
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Set the data schemas for all collections.
|
|
17
|
+
* Called by the virtual module that loads user's schema definitions.
|
|
18
|
+
* Notifies all subscribers of the change (enables HMR).
|
|
19
|
+
*/
|
|
20
|
+
export function setDataSchemas(schemas) {
|
|
21
|
+
const state = getSharedState();
|
|
22
|
+
state.schemas = schemas;
|
|
23
|
+
for (const fn of state.subscribers) {
|
|
24
|
+
fn(schemas);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Get the current data schemas synchronously.
|
|
29
|
+
*/
|
|
30
|
+
export function getDataSchemas() {
|
|
31
|
+
return getSharedState().schemas;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* React hook to subscribe to data schema changes.
|
|
35
|
+
* Returns the current schemas and updates when they change (HMR support).
|
|
36
|
+
*/
|
|
37
|
+
export function useDataSchemas() {
|
|
38
|
+
const [schemas, setSchemas] = useState(() => getSharedState().schemas);
|
|
39
|
+
useEffect(() => {
|
|
40
|
+
const state = getSharedState();
|
|
41
|
+
// Update immediately in case schemas changed between render and effect
|
|
42
|
+
if (state.schemas !== schemas) {
|
|
43
|
+
setSchemas(state.schemas);
|
|
44
|
+
}
|
|
45
|
+
state.subscribers.add(setSchemas);
|
|
46
|
+
return () => {
|
|
47
|
+
state.subscribers.delete(setSchemas);
|
|
48
|
+
};
|
|
49
|
+
}, [schemas]);
|
|
50
|
+
return schemas;
|
|
51
|
+
}
|
package/dist/data-schemas.mjs
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { useEffect, useState } from "react";
|
|
2
|
-
|
|
3
2
|
//#region src/data-schemas.ts
|
|
4
3
|
const getSharedState = () => {
|
|
5
4
|
if (typeof window !== "undefined") {
|
|
@@ -22,7 +21,7 @@ const getSharedState = () => {
|
|
|
22
21
|
function setDataSchemas(schemas) {
|
|
23
22
|
const state = getSharedState();
|
|
24
23
|
state.schemas = schemas;
|
|
25
|
-
state.subscribers
|
|
24
|
+
for (const fn of state.subscribers) fn(schemas);
|
|
26
25
|
}
|
|
27
26
|
/**
|
|
28
27
|
* Get the current data schemas synchronously.
|
|
@@ -43,10 +42,10 @@ function useDataSchemas() {
|
|
|
43
42
|
return () => {
|
|
44
43
|
state.subscribers.delete(setSchemas);
|
|
45
44
|
};
|
|
46
|
-
}, []);
|
|
45
|
+
}, [schemas]);
|
|
47
46
|
return schemas;
|
|
48
47
|
}
|
|
49
|
-
|
|
50
48
|
//#endregion
|
|
51
49
|
export { getDataSchemas, setDataSchemas, useDataSchemas };
|
|
50
|
+
|
|
52
51
|
//# sourceMappingURL=data-schemas.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-schemas.mjs","names":[],"sources":["../src/data-schemas.ts"],"sourcesContent":["import { useEffect, useState } from 'react';\nimport type { z } from 'zod';\n\n/**\n * Type for a collection of data schemas.\n * Each key is a collection name, value is the Zod schema for that collection's data.\n */\nexport type DataSchemas = Record<string, z.ZodObject<z.ZodRawShape>>;\n\n/**\n * Shared state for data schemas across module instances.\n * Uses window to ensure virtual modules and bundled code share the same state.\n */\n\ninterface SharedDataState {\n schemas: DataSchemas;\n subscribers: Set<(schemas: DataSchemas) => void>;\n}\n\nconst getSharedState = (): SharedDataState => {\n if (typeof window !== 'undefined') {\n if (!(window as any).__DATA_SCHEMAS_STATE__) {\n (window as any).__DATA_SCHEMAS_STATE__ = {\n schemas: {},\n subscribers: new Set(),\n };\n }\n return (window as any).__DATA_SCHEMAS_STATE__;\n }\n // SSR fallback\n return { schemas: {}, subscribers: new Set() };\n};\n\n/**\n * Set the data schemas for all collections.\n * Called by the virtual module that loads user's schema definitions.\n * Notifies all subscribers of the change (enables HMR).\n */\nexport function setDataSchemas(schemas: DataSchemas): void {\n const state = getSharedState();\n state.schemas = schemas;\n state.subscribers
|
|
1
|
+
{"version":3,"file":"data-schemas.mjs","names":[],"sources":["../src/data-schemas.ts"],"sourcesContent":["import { useEffect, useState } from 'react';\nimport type { z } from 'zod';\n\n/**\n * Type for a collection of data schemas.\n * Each key is a collection name, value is the Zod schema for that collection's data.\n */\nexport type DataSchemas = Record<string, z.ZodObject<z.ZodRawShape>>;\n\n/**\n * Shared state for data schemas across module instances.\n * Uses window to ensure virtual modules and bundled code share the same state.\n */\n\ninterface SharedDataState {\n schemas: DataSchemas;\n subscribers: Set<(schemas: DataSchemas) => void>;\n}\n\nconst getSharedState = (): SharedDataState => {\n if (typeof window !== 'undefined') {\n if (!(window as any).__DATA_SCHEMAS_STATE__) {\n (window as any).__DATA_SCHEMAS_STATE__ = {\n schemas: {},\n subscribers: new Set(),\n };\n }\n return (window as any).__DATA_SCHEMAS_STATE__;\n }\n // SSR fallback\n return { schemas: {}, subscribers: new Set() };\n};\n\n/**\n * Set the data schemas for all collections.\n * Called by the virtual module that loads user's schema definitions.\n * Notifies all subscribers of the change (enables HMR).\n */\nexport function setDataSchemas(schemas: DataSchemas): void {\n const state = getSharedState();\n state.schemas = schemas;\n for (const fn of state.subscribers) {\n fn(schemas);\n }\n}\n\n/**\n * Get the current data schemas synchronously.\n */\nexport function getDataSchemas(): DataSchemas {\n return getSharedState().schemas;\n}\n\n/**\n * React hook to subscribe to data schema changes.\n * Returns the current schemas and updates when they change (HMR support).\n */\nexport function useDataSchemas(): DataSchemas {\n const [schemas, setSchemas] = useState(() => getSharedState().schemas);\n\n useEffect(() => {\n const state = getSharedState();\n\n // Update immediately in case schemas changed between render and effect\n if (state.schemas !== schemas) {\n setSchemas(state.schemas);\n }\n\n state.subscribers.add(setSchemas);\n return () => {\n state.subscribers.delete(setSchemas);\n };\n }, [schemas]);\n\n return schemas;\n}\n"],"mappings":";;AAmBA,MAAM,uBAAwC;CAC5C,IAAI,OAAO,WAAW,aAAa;EACjC,IAAI,CAAE,OAAe,wBACnB,OAAgB,yBAAyB;GACvC,SAAS,CAAC;GACV,6BAAa,IAAI,IAAI;EACvB;EAEF,OAAQ,OAAe;CACzB;CAEA,OAAO;EAAE,SAAS,CAAC;EAAG,6BAAa,IAAI,IAAI;CAAE;AAC/C;;;;;;AAOA,SAAgB,eAAe,SAA4B;CACzD,MAAM,QAAQ,eAAe;CAC7B,MAAM,UAAU;CAChB,KAAK,MAAM,MAAM,MAAM,aACrB,GAAG,OAAO;AAEd;;;;AAKA,SAAgB,iBAA8B;CAC5C,OAAO,eAAe,CAAC,CAAC;AAC1B;;;;;AAMA,SAAgB,iBAA8B;CAC5C,MAAM,CAAC,SAAS,cAAc,eAAe,eAAe,CAAC,CAAC,OAAO;CAErE,gBAAgB;EACd,MAAM,QAAQ,eAAe;EAG7B,IAAI,MAAM,YAAY,SACpB,WAAW,MAAM,OAAO;EAG1B,MAAM,YAAY,IAAI,UAAU;EAChC,aAAa;GACX,MAAM,YAAY,OAAO,UAAU;EACrC;CACF,GAAG,CAAC,OAAO,CAAC;CAEZ,OAAO;AACT"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev-entry.d.ts","sourceRoot":"","sources":["../src/dev-entry.tsx"],"names":[],"mappings":"AAqBA,OAAO,QAAQ,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { mockPuckConfig } from './mock-puck-config';
|
|
2
|
+
import { configureUI } from './ui-config';
|
|
3
|
+
// Configure UI for development - this must happen before main.tsx runs
|
|
4
|
+
configureUI({
|
|
5
|
+
basename: '/',
|
|
6
|
+
enableDevtools: true,
|
|
7
|
+
queryClientOptions: {
|
|
8
|
+
defaultOptions: {
|
|
9
|
+
queries: {
|
|
10
|
+
staleTime: 1000 * 60 * 5, // 5 minutes
|
|
11
|
+
retry: 1,
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
|
+
// Set Puck config
|
|
17
|
+
window.__PUCK_CONFIG__ = mockPuckConfig;
|
|
18
|
+
// Import main synchronously
|
|
19
|
+
import './main';
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { ComponentProps } from "react";
|
|
2
|
+
import * as RadixDialog from "@radix-ui/react-dialog";
|
|
3
|
+
//#region src/components/dialog.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Dialog primitive surface for `@conloca/cms-spa/dialog`.
|
|
6
|
+
*
|
|
7
|
+
* Thin wrappers around `@radix-ui/react-dialog` so consumers share the
|
|
8
|
+
* same overlay/content vocabulary without each one re-mirroring the
|
|
9
|
+
* Radix layout by hand.
|
|
10
|
+
*
|
|
11
|
+
* Shape:
|
|
12
|
+
*
|
|
13
|
+
* - `Root`, `Portal`, `Trigger`, `Close`, `Title`, `Description` are
|
|
14
|
+
* re-exported verbatim from Radix. Consumers pass props directly; no
|
|
15
|
+
* runtime cost over importing Radix.
|
|
16
|
+
* - `Overlay` is a thin wrapper that bakes in the cms-spa overlay
|
|
17
|
+
* recipe (`fixed inset-0 bg-black/50 backdrop-blur-sm`). Consumers
|
|
18
|
+
* supply z-index (and any other layout) via `className`. We
|
|
19
|
+
* deliberately do NOT bake `z-40` so cms-spa's existing dialogs
|
|
20
|
+
* (which never set z) keep their byte-for-byte behavior.
|
|
21
|
+
* - `Content` is a wrapper that takes a `surface` prop:
|
|
22
|
+
* - `surface="overlay"` (default) — cms-spa's existing dialog look
|
|
23
|
+
* (`bg-overlay rounded-lg shadow-lg`). Used by every existing
|
|
24
|
+
* cms-spa dialog (CreatePageDialog, PageMetadataDialog, ...).
|
|
25
|
+
* - `surface="panel"` — for hosts that have their own surface
|
|
26
|
+
* tone and want the dialog to feel "from" that surface rather
|
|
27
|
+
* than competing with it
|
|
28
|
+
* (`bg-white dark:bg-grey-02 border border-grey-09 dark:border-grey-03 rounded-md shadow-lg`).
|
|
29
|
+
*
|
|
30
|
+
* Width and per-dialog padding are caller-provided via `className`
|
|
31
|
+
* (e.g. `w-full max-w-md` for cms-spa; `w-[calc(100vw-2rem)] max-w-md`
|
|
32
|
+
* for the host shell). Common chrome (`p-6 max-h-[90vh]
|
|
33
|
+
* overflow-y-auto`) is baked in.
|
|
34
|
+
*
|
|
35
|
+
* Style provenance: the utility classes baked into the wrappers (e.g.
|
|
36
|
+
* `bg-overlay`, `dark:bg-grey-02`) are scanned out of this file via
|
|
37
|
+
* the `@source "../src/components/dialog.tsx"` directive in
|
|
38
|
+
* `styles/tailwind-theme.css`, so any consumer importing the cms-spa
|
|
39
|
+
* theme contract gets the matching classes generated.
|
|
40
|
+
*/
|
|
41
|
+
declare const Root: import("react").FC<RadixDialog.DialogProps>;
|
|
42
|
+
declare const Portal: import("react").FC<RadixDialog.DialogPortalProps>;
|
|
43
|
+
declare const Trigger: import("react").ForwardRefExoticComponent<RadixDialog.DialogTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
44
|
+
declare const Close: import("react").ForwardRefExoticComponent<RadixDialog.DialogCloseProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
45
|
+
declare const Title: import("react").ForwardRefExoticComponent<RadixDialog.DialogTitleProps & import("react").RefAttributes<HTMLHeadingElement>>;
|
|
46
|
+
declare const Description: import("react").ForwardRefExoticComponent<RadixDialog.DialogDescriptionProps & import("react").RefAttributes<HTMLParagraphElement>>;
|
|
47
|
+
type OverlayProps = ComponentProps<typeof RadixDialog.Overlay>;
|
|
48
|
+
declare function Overlay({ className, ...props }: OverlayProps): import("react/jsx-runtime").JSX.Element;
|
|
49
|
+
type DialogSurface = 'overlay' | 'panel';
|
|
50
|
+
interface ContentProps extends ComponentProps<typeof RadixDialog.Content> {
|
|
51
|
+
surface?: DialogSurface;
|
|
52
|
+
}
|
|
53
|
+
declare function Content({ className, surface, ...props }: ContentProps): import("react/jsx-runtime").JSX.Element;
|
|
54
|
+
//#endregion
|
|
55
|
+
export { Close, Content, ContentProps, Description, DialogSurface, Overlay, OverlayProps, Portal, Root, Title, Trigger };
|
|
56
|
+
//# sourceMappingURL=dialog.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dialog.d.mts","names":[],"sources":["../src/components/dialog.tsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA0Ca,sBAAI,GAAA,YAAA;cACJ,wBAAM,GAAA,YAAA;cACN,yBAAO,0BAAA,YAAA,qCAAA,cAAA;cACP,uBAAK,0BAAA,YAAA,mCAAA,cAAA;cACL,uBAAK,0BAAA,YAAA,mCAAA,cAAA;cACL,6BAAW,0BAAA,YAAA,yCAAA,cAAA;KAEZ,eAAe,sBAAsB,YAAY;iBAE7C,UAAU,cAAc,SAAS,2CAAY,IAAA;KAIjD;UAOK,qBAAqB,sBAAsB,YAAY;EACtE,UAAU;;iBAGI,UAAU,WAAW,YAAwB,SAAS,2CAAY,IAAA"}
|
package/dist/dialog.mjs
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { t as cn } from "./cn-dlASUkDY.mjs";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import * as RadixDialog from "@radix-ui/react-dialog";
|
|
4
|
+
//#region src/components/dialog.tsx
|
|
5
|
+
/**
|
|
6
|
+
* Dialog primitive surface for `@conloca/cms-spa/dialog`.
|
|
7
|
+
*
|
|
8
|
+
* Thin wrappers around `@radix-ui/react-dialog` so consumers share the
|
|
9
|
+
* same overlay/content vocabulary without each one re-mirroring the
|
|
10
|
+
* Radix layout by hand.
|
|
11
|
+
*
|
|
12
|
+
* Shape:
|
|
13
|
+
*
|
|
14
|
+
* - `Root`, `Portal`, `Trigger`, `Close`, `Title`, `Description` are
|
|
15
|
+
* re-exported verbatim from Radix. Consumers pass props directly; no
|
|
16
|
+
* runtime cost over importing Radix.
|
|
17
|
+
* - `Overlay` is a thin wrapper that bakes in the cms-spa overlay
|
|
18
|
+
* recipe (`fixed inset-0 bg-black/50 backdrop-blur-sm`). Consumers
|
|
19
|
+
* supply z-index (and any other layout) via `className`. We
|
|
20
|
+
* deliberately do NOT bake `z-40` so cms-spa's existing dialogs
|
|
21
|
+
* (which never set z) keep their byte-for-byte behavior.
|
|
22
|
+
* - `Content` is a wrapper that takes a `surface` prop:
|
|
23
|
+
* - `surface="overlay"` (default) — cms-spa's existing dialog look
|
|
24
|
+
* (`bg-overlay rounded-lg shadow-lg`). Used by every existing
|
|
25
|
+
* cms-spa dialog (CreatePageDialog, PageMetadataDialog, ...).
|
|
26
|
+
* - `surface="panel"` — for hosts that have their own surface
|
|
27
|
+
* tone and want the dialog to feel "from" that surface rather
|
|
28
|
+
* than competing with it
|
|
29
|
+
* (`bg-white dark:bg-grey-02 border border-grey-09 dark:border-grey-03 rounded-md shadow-lg`).
|
|
30
|
+
*
|
|
31
|
+
* Width and per-dialog padding are caller-provided via `className`
|
|
32
|
+
* (e.g. `w-full max-w-md` for cms-spa; `w-[calc(100vw-2rem)] max-w-md`
|
|
33
|
+
* for the host shell). Common chrome (`p-6 max-h-[90vh]
|
|
34
|
+
* overflow-y-auto`) is baked in.
|
|
35
|
+
*
|
|
36
|
+
* Style provenance: the utility classes baked into the wrappers (e.g.
|
|
37
|
+
* `bg-overlay`, `dark:bg-grey-02`) are scanned out of this file via
|
|
38
|
+
* the `@source "../src/components/dialog.tsx"` directive in
|
|
39
|
+
* `styles/tailwind-theme.css`, so any consumer importing the cms-spa
|
|
40
|
+
* theme contract gets the matching classes generated.
|
|
41
|
+
*/
|
|
42
|
+
const Root = RadixDialog.Root;
|
|
43
|
+
const Portal = RadixDialog.Portal;
|
|
44
|
+
const Trigger = RadixDialog.Trigger;
|
|
45
|
+
const Close = RadixDialog.Close;
|
|
46
|
+
const Title = RadixDialog.Title;
|
|
47
|
+
const Description = RadixDialog.Description;
|
|
48
|
+
function Overlay({ className, ...props }) {
|
|
49
|
+
return /* @__PURE__ */ jsx(RadixDialog.Overlay, {
|
|
50
|
+
className: cn("fixed inset-0 bg-black/50 backdrop-blur-sm", className),
|
|
51
|
+
...props
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
const SURFACE_CLASS = {
|
|
55
|
+
overlay: "bg-overlay rounded-lg shadow-lg",
|
|
56
|
+
panel: "bg-white dark:bg-grey-02 border border-grey-09 dark:border-grey-03 rounded-md shadow-lg"
|
|
57
|
+
};
|
|
58
|
+
function Content({ className, surface = "overlay", ...props }) {
|
|
59
|
+
return /* @__PURE__ */ jsx(RadixDialog.Content, {
|
|
60
|
+
className: cn("fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 p-6 max-h-[90vh] overflow-y-auto", SURFACE_CLASS[surface], className),
|
|
61
|
+
...props
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
//#endregion
|
|
65
|
+
export { Close, Content, Description, Overlay, Portal, Root, Title, Trigger };
|
|
66
|
+
|
|
67
|
+
//# sourceMappingURL=dialog.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dialog.mjs","names":[],"sources":["../src/components/dialog.tsx"],"sourcesContent":["import * as RadixDialog from '@radix-ui/react-dialog';\nimport type { ComponentProps } from 'react';\nimport { cn } from '../utils/cn';\n\n/**\n * Dialog primitive surface for `@conloca/cms-spa/dialog`.\n *\n * Thin wrappers around `@radix-ui/react-dialog` so consumers share the\n * same overlay/content vocabulary without each one re-mirroring the\n * Radix layout by hand.\n *\n * Shape:\n *\n * - `Root`, `Portal`, `Trigger`, `Close`, `Title`, `Description` are\n * re-exported verbatim from Radix. Consumers pass props directly; no\n * runtime cost over importing Radix.\n * - `Overlay` is a thin wrapper that bakes in the cms-spa overlay\n * recipe (`fixed inset-0 bg-black/50 backdrop-blur-sm`). Consumers\n * supply z-index (and any other layout) via `className`. We\n * deliberately do NOT bake `z-40` so cms-spa's existing dialogs\n * (which never set z) keep their byte-for-byte behavior.\n * - `Content` is a wrapper that takes a `surface` prop:\n * - `surface=\"overlay\"` (default) — cms-spa's existing dialog look\n * (`bg-overlay rounded-lg shadow-lg`). Used by every existing\n * cms-spa dialog (CreatePageDialog, PageMetadataDialog, ...).\n * - `surface=\"panel\"` — for hosts that have their own surface\n * tone and want the dialog to feel \"from\" that surface rather\n * than competing with it\n * (`bg-white dark:bg-grey-02 border border-grey-09 dark:border-grey-03 rounded-md shadow-lg`).\n *\n * Width and per-dialog padding are caller-provided via `className`\n * (e.g. `w-full max-w-md` for cms-spa; `w-[calc(100vw-2rem)] max-w-md`\n * for the host shell). Common chrome (`p-6 max-h-[90vh]\n * overflow-y-auto`) is baked in.\n *\n * Style provenance: the utility classes baked into the wrappers (e.g.\n * `bg-overlay`, `dark:bg-grey-02`) are scanned out of this file via\n * the `@source \"../src/components/dialog.tsx\"` directive in\n * `styles/tailwind-theme.css`, so any consumer importing the cms-spa\n * theme contract gets the matching classes generated.\n */\n\nexport const Root = RadixDialog.Root;\nexport const Portal = RadixDialog.Portal;\nexport const Trigger = RadixDialog.Trigger;\nexport const Close = RadixDialog.Close;\nexport const Title = RadixDialog.Title;\nexport const Description = RadixDialog.Description;\n\nexport type OverlayProps = ComponentProps<typeof RadixDialog.Overlay>;\n\nexport function Overlay({ className, ...props }: OverlayProps) {\n return <RadixDialog.Overlay className={cn('fixed inset-0 bg-black/50 backdrop-blur-sm', className)} {...props} />;\n}\n\nexport type DialogSurface = 'overlay' | 'panel';\n\nconst SURFACE_CLASS: Record<DialogSurface, string> = {\n overlay: 'bg-overlay rounded-lg shadow-lg',\n panel: 'bg-white dark:bg-grey-02 border border-grey-09 dark:border-grey-03 rounded-md shadow-lg',\n};\n\nexport interface ContentProps extends ComponentProps<typeof RadixDialog.Content> {\n surface?: DialogSurface;\n}\n\nexport function Content({ className, surface = 'overlay', ...props }: ContentProps) {\n return (\n <RadixDialog.Content\n className={cn(\n 'fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 p-6 max-h-[90vh] overflow-y-auto',\n SURFACE_CLASS[surface],\n className,\n )}\n {...props}\n />\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0CA,MAAa,OAAO,YAAY;AAChC,MAAa,SAAS,YAAY;AAClC,MAAa,UAAU,YAAY;AACnC,MAAa,QAAQ,YAAY;AACjC,MAAa,QAAQ,YAAY;AACjC,MAAa,cAAc,YAAY;AAIvC,SAAgB,QAAQ,EAAE,WAAW,GAAG,SAAuB;CAC7D,OAAO,oBAAC,YAAY,SAAb;EAAqB,WAAW,GAAG,8CAA8C,SAAS;EAAG,GAAI;CAAQ,CAAA;AAClH;AAIA,MAAM,gBAA+C;CACnD,SAAS;CACT,OAAO;AACT;AAMA,SAAgB,QAAQ,EAAE,WAAW,UAAU,WAAW,GAAG,SAAuB;CAClF,OACE,oBAAC,YAAY,SAAb;EACE,WAAW,GACT,6FACA,cAAc,UACd,SACF;EACA,GAAI;CACL,CAAA;AAEL"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type { AssetEntry, AssetUsage, FolderListing, FolderTreeNode } from '@conloca/content-api-client';
|
|
2
|
+
export { useAsset, useAssetFolders, useAssets, useAssetUsage, useBulkDeleteAssets, useCreateFolder, useDeleteAsset, useFolderTree, useImportAssetUrl, useMoveAssets, useUpdateAssetMetadata, useUploadAsset, } from '@conloca/content-api-client';
|
|
3
|
+
export { useClickOutside } from './useClickOutside';
|
|
4
|
+
export { useDialogState } from './useDialogState';
|
|
5
|
+
export { useErrorModal } from './useErrorModal';
|
|
6
|
+
export { useSiteBaseUrl } from './useSiteBaseUrl';
|
|
7
|
+
export { buildUploadFormData, getImageDimensions, useImportUrl, useUpload } from './useUpload';
|
|
8
|
+
export type { UploadProgress, UseUploadFlowReturn } from './useUploadFlow';
|
|
9
|
+
export { ACCEPTED_TYPES, useUploadFlow } from './useUploadFlow';
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AACzG,OAAO,EACL,QAAQ,EACR,eAAe,EACf,SAAS,EACT,aAAa,EACb,mBAAmB,EACnB,eAAe,EACf,cAAc,EACd,aAAa,EACb,iBAAiB,EACjB,aAAa,EACb,sBAAsB,EACtB,cAAc,GACf,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC/F,YAAY,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAC3E,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { useAsset, useAssetFolders, useAssets, useAssetUsage, useBulkDeleteAssets, useCreateFolder, useDeleteAsset, useFolderTree, useImportAssetUrl, useMoveAssets, useUpdateAssetMetadata, useUploadAsset, } from '@conloca/content-api-client';
|
|
2
|
+
export { useClickOutside } from './useClickOutside';
|
|
3
|
+
export { useDialogState } from './useDialogState';
|
|
4
|
+
export { useErrorModal } from './useErrorModal';
|
|
5
|
+
export { useSiteBaseUrl } from './useSiteBaseUrl';
|
|
6
|
+
export { buildUploadFormData, getImageDimensions, useImportUrl, useUpload } from './useUpload';
|
|
7
|
+
export { ACCEPTED_TYPES, useUploadFlow } from './useUploadFlow';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
type CanvasTheme = 'light' | 'dark';
|
|
2
|
+
interface CanvasThemeContextValue {
|
|
3
|
+
canvasTheme: CanvasTheme;
|
|
4
|
+
setCanvasTheme: (theme: CanvasTheme) => void;
|
|
5
|
+
toggleCanvasTheme: () => void;
|
|
6
|
+
}
|
|
7
|
+
export declare function CanvasThemeProvider({ children }: {
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare function useCanvasTheme(): CanvasThemeContextValue;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=useCanvasTheme.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCanvasTheme.d.ts","sourceRoot":"","sources":["../../src/hooks/useCanvasTheme.tsx"],"names":[],"mappings":"AAEA,KAAK,WAAW,GAAG,OAAO,GAAG,MAAM,CAAC;AAEpC,UAAU,uBAAuB;IAC/B,WAAW,EAAE,WAAW,CAAC;IACzB,cAAc,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,CAAC;IAC7C,iBAAiB,EAAE,MAAM,IAAI,CAAC;CAC/B;AAYD,wBAAgB,mBAAmB,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,2CAqB9E;AAQD,wBAAgB,cAAc,IAAI,uBAAuB,CAExD"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createContext, useCallback, useContext, useState } from 'react';
|
|
3
|
+
const STORAGE_KEY = 'conloca-canvas-theme';
|
|
4
|
+
const CanvasThemeContext = createContext(null);
|
|
5
|
+
function getStoredTheme() {
|
|
6
|
+
if (typeof window === 'undefined')
|
|
7
|
+
return 'light';
|
|
8
|
+
const stored = localStorage.getItem(STORAGE_KEY);
|
|
9
|
+
return stored === 'dark' ? 'dark' : 'light';
|
|
10
|
+
}
|
|
11
|
+
export function CanvasThemeProvider({ children }) {
|
|
12
|
+
const [canvasTheme, setCanvasThemeState] = useState(getStoredTheme);
|
|
13
|
+
const setCanvasTheme = useCallback((next) => {
|
|
14
|
+
setCanvasThemeState(next);
|
|
15
|
+
localStorage.setItem(STORAGE_KEY, next);
|
|
16
|
+
}, []);
|
|
17
|
+
const toggleCanvasTheme = useCallback(() => {
|
|
18
|
+
setCanvasThemeState((current) => {
|
|
19
|
+
const next = current === 'light' ? 'dark' : 'light';
|
|
20
|
+
localStorage.setItem(STORAGE_KEY, next);
|
|
21
|
+
return next;
|
|
22
|
+
});
|
|
23
|
+
}, []);
|
|
24
|
+
return (_jsx(CanvasThemeContext.Provider, { value: { canvasTheme, setCanvasTheme, toggleCanvasTheme }, children: children }));
|
|
25
|
+
}
|
|
26
|
+
const NOOP_CANVAS_THEME = {
|
|
27
|
+
canvasTheme: 'light',
|
|
28
|
+
setCanvasTheme: () => { },
|
|
29
|
+
toggleCanvasTheme: () => { },
|
|
30
|
+
};
|
|
31
|
+
export function useCanvasTheme() {
|
|
32
|
+
return useContext(CanvasThemeContext) ?? NOOP_CANVAS_THEME;
|
|
33
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type RefObject } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Hook that triggers a callback when clicking outside the referenced element.
|
|
4
|
+
* Useful for closing dropdowns, modals, etc.
|
|
5
|
+
*/
|
|
6
|
+
export declare function useClickOutside<T extends HTMLElement>(ref: RefObject<T | null>, callback: () => void, enabled?: boolean): void;
|
|
7
|
+
//# sourceMappingURL=useClickOutside.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useClickOutside.d.ts","sourceRoot":"","sources":["../../src/hooks/useClickOutside.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAa,MAAM,OAAO,CAAC;AAElD;;;GAGG;AACH,wBAAgB,eAAe,CAAC,CAAC,SAAS,WAAW,EACnD,GAAG,EAAE,SAAS,CAAC,CAAC,GAAG,IAAI,CAAC,EACxB,QAAQ,EAAE,MAAM,IAAI,EACpB,OAAO,UAAO,GACb,IAAI,CAaN"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Hook that triggers a callback when clicking outside the referenced element.
|
|
4
|
+
* Useful for closing dropdowns, modals, etc.
|
|
5
|
+
*/
|
|
6
|
+
export function useClickOutside(ref, callback, enabled = true) {
|
|
7
|
+
useEffect(() => {
|
|
8
|
+
if (!enabled)
|
|
9
|
+
return;
|
|
10
|
+
const handleClickOutside = (event) => {
|
|
11
|
+
if (ref.current && !ref.current.contains(event.target)) {
|
|
12
|
+
callback();
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
document.addEventListener('mousedown', handleClickOutside);
|
|
16
|
+
return () => document.removeEventListener('mousedown', handleClickOutside);
|
|
17
|
+
}, [ref, callback, enabled]);
|
|
18
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generic hook for managing dialog state with open/close functionality.
|
|
3
|
+
* Reduces boilerplate for dialogs that need to track additional data alongside isOpen.
|
|
4
|
+
*
|
|
5
|
+
* @param initialData - The initial state for dialog data (excluding isOpen)
|
|
6
|
+
* @returns Tuple of [state, open, close] where state includes isOpen
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* const [deleteDialog, openDeleteDialog, closeDeleteDialog] = useDialogState({
|
|
10
|
+
* entryId: '',
|
|
11
|
+
* entryTitle: '',
|
|
12
|
+
* });
|
|
13
|
+
*
|
|
14
|
+
* // Open with data
|
|
15
|
+
* openDeleteDialog({ entryId: '123', entryTitle: 'My Entry' });
|
|
16
|
+
*
|
|
17
|
+
* // Close (resets to initial state)
|
|
18
|
+
* closeDeleteDialog();
|
|
19
|
+
*/
|
|
20
|
+
export declare function useDialogState<T extends Record<string, unknown>>(initialData: T): [T & {
|
|
21
|
+
isOpen: boolean;
|
|
22
|
+
}, (data: Partial<T>) => void, () => void];
|
|
23
|
+
//# sourceMappingURL=useDialogState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDialogState.d.ts","sourceRoot":"","sources":["../../src/hooks/useDialogState.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,cAAc,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC9D,WAAW,EAAE,CAAC,GACb,CAAC,CAAC,GAAG;IAAE,MAAM,EAAE,OAAO,CAAA;CAAE,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE,MAAM,IAAI,CAAC,CAgBnE"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { useCallback, useState } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Generic hook for managing dialog state with open/close functionality.
|
|
4
|
+
* Reduces boilerplate for dialogs that need to track additional data alongside isOpen.
|
|
5
|
+
*
|
|
6
|
+
* @param initialData - The initial state for dialog data (excluding isOpen)
|
|
7
|
+
* @returns Tuple of [state, open, close] where state includes isOpen
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* const [deleteDialog, openDeleteDialog, closeDeleteDialog] = useDialogState({
|
|
11
|
+
* entryId: '',
|
|
12
|
+
* entryTitle: '',
|
|
13
|
+
* });
|
|
14
|
+
*
|
|
15
|
+
* // Open with data
|
|
16
|
+
* openDeleteDialog({ entryId: '123', entryTitle: 'My Entry' });
|
|
17
|
+
*
|
|
18
|
+
* // Close (resets to initial state)
|
|
19
|
+
* closeDeleteDialog();
|
|
20
|
+
*/
|
|
21
|
+
export function useDialogState(initialData) {
|
|
22
|
+
const initialState = { ...initialData, isOpen: false };
|
|
23
|
+
const [state, setState] = useState(initialState);
|
|
24
|
+
const open = useCallback((data) => {
|
|
25
|
+
setState({ ...initialData, ...data, isOpen: true });
|
|
26
|
+
}, [initialData]);
|
|
27
|
+
const close = useCallback(() => {
|
|
28
|
+
setState({ ...initialData, isOpen: false });
|
|
29
|
+
}, [initialData]);
|
|
30
|
+
return [state, open, close];
|
|
31
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useEditorPref.d.ts","sourceRoot":"","sources":["../../src/hooks/useEditorPref.ts"],"names":[],"mappings":"AAiCA,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC,CAwB9E"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { useCallback, useSyncExternalStore } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Cross-tab-aware boolean preference backed by `localStorage`.
|
|
4
|
+
*
|
|
5
|
+
* Used for editor chrome toggles (preview pane open, auto-save on, etc.)
|
|
6
|
+
* where the preference should persist across reloads and feel sticky from
|
|
7
|
+
* the author's perspective. `useSyncExternalStore` keeps the value in sync
|
|
8
|
+
* with both React renders and external mutations (`storage` events from
|
|
9
|
+
* other tabs, programmatic writes from elsewhere in the app).
|
|
10
|
+
*/
|
|
11
|
+
const EVENT_NAME = 'conloca:editorPrefChange';
|
|
12
|
+
function readPref(key) {
|
|
13
|
+
try {
|
|
14
|
+
return window.localStorage.getItem(key) === '1';
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
function subscribePref(callback) {
|
|
21
|
+
const onStorage = (event) => {
|
|
22
|
+
if (event.storageArea === window.localStorage)
|
|
23
|
+
callback();
|
|
24
|
+
};
|
|
25
|
+
window.addEventListener('storage', onStorage);
|
|
26
|
+
window.addEventListener(EVENT_NAME, callback);
|
|
27
|
+
return () => {
|
|
28
|
+
window.removeEventListener('storage', onStorage);
|
|
29
|
+
window.removeEventListener(EVENT_NAME, callback);
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
export function useEditorPref(key) {
|
|
33
|
+
const value = useSyncExternalStore(subscribePref, () => readPref(key), () => false);
|
|
34
|
+
const setValue = useCallback((next) => {
|
|
35
|
+
try {
|
|
36
|
+
if (next) {
|
|
37
|
+
window.localStorage.setItem(key, '1');
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
window.localStorage.removeItem(key);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
catch {
|
|
44
|
+
// localStorage may be unavailable — ignore.
|
|
45
|
+
}
|
|
46
|
+
window.dispatchEvent(new Event(EVENT_NAME));
|
|
47
|
+
}, [key]);
|
|
48
|
+
return [value, setValue];
|
|
49
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ErrorModalProps } from '../components/dialogs/ErrorModal';
|
|
2
|
+
export interface UseErrorModalReturn {
|
|
3
|
+
errorModal: {
|
|
4
|
+
isOpen: boolean;
|
|
5
|
+
message: string;
|
|
6
|
+
error?: unknown;
|
|
7
|
+
actions?: ErrorModalProps['actions'];
|
|
8
|
+
};
|
|
9
|
+
showError: (message: string, error?: unknown, actions?: ErrorModalProps['actions']) => void;
|
|
10
|
+
showStaleWriteError: (error?: unknown) => void;
|
|
11
|
+
hideError: () => void;
|
|
12
|
+
errorModalProps: Omit<ErrorModalProps, 'title'>;
|
|
13
|
+
}
|
|
14
|
+
export declare function useErrorModal(): UseErrorModalReturn;
|
|
15
|
+
//# sourceMappingURL=useErrorModal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useErrorModal.d.ts","sourceRoot":"","sources":["../../src/hooks/useErrorModal.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAExE,MAAM,WAAW,mBAAmB;IAClC,UAAU,EAAE;QACV,MAAM,EAAE,OAAO,CAAC;QAChB,OAAO,EAAE,MAAM,CAAC;QAChB,KAAK,CAAC,EAAE,OAAO,CAAC;QAChB,OAAO,CAAC,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC;KACtC,CAAC;IACF,SAAS,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,eAAe,CAAC,SAAS,CAAC,KAAK,IAAI,CAAC;IAC5F,mBAAmB,EAAE,CAAC,KAAK,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IAC/C,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,eAAe,EAAE,IAAI,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC;CACjD;AAED,wBAAgB,aAAa,IAAI,mBAAmB,CA8CnD"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { useCallback, useState } from 'react';
|
|
2
|
+
export function useErrorModal() {
|
|
3
|
+
const [errorModal, setErrorModal] = useState({ isOpen: false, message: '' });
|
|
4
|
+
const showError = useCallback((message, error, actions) => {
|
|
5
|
+
setErrorModal({
|
|
6
|
+
isOpen: true,
|
|
7
|
+
message,
|
|
8
|
+
error,
|
|
9
|
+
actions,
|
|
10
|
+
});
|
|
11
|
+
}, []);
|
|
12
|
+
const hideError = useCallback(() => {
|
|
13
|
+
setErrorModal({ isOpen: false, message: '', error: undefined, actions: undefined });
|
|
14
|
+
}, []);
|
|
15
|
+
const showStaleWriteError = useCallback((error) => {
|
|
16
|
+
showError('This entry has been modified by someone else. Would you like to reload and try again?', error, [
|
|
17
|
+
{ label: 'Reload', onClick: () => window.location.reload(), variant: 'primary' },
|
|
18
|
+
{ label: 'Cancel', onClick: hideError, variant: 'secondary' },
|
|
19
|
+
]);
|
|
20
|
+
}, [hideError, showError]);
|
|
21
|
+
const errorModalProps = {
|
|
22
|
+
isOpen: errorModal.isOpen,
|
|
23
|
+
onClose: hideError,
|
|
24
|
+
message: errorModal.message,
|
|
25
|
+
error: errorModal.error,
|
|
26
|
+
actions: errorModal.actions,
|
|
27
|
+
};
|
|
28
|
+
return {
|
|
29
|
+
errorModal,
|
|
30
|
+
showError,
|
|
31
|
+
showStaleWriteError,
|
|
32
|
+
hideError,
|
|
33
|
+
errorModalProps,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { buildSiteUrl, extractPathFromUrl } from '../lib/utils';
|
|
2
|
+
/**
|
|
3
|
+
* Hook to access and use the site base URL configuration
|
|
4
|
+
*/
|
|
5
|
+
export declare function useSiteBaseUrl(): {
|
|
6
|
+
siteBaseUrl: string;
|
|
7
|
+
buildUrl: typeof buildSiteUrl;
|
|
8
|
+
extractPath: typeof extractPathFromUrl;
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=useSiteBaseUrl.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSiteBaseUrl.d.ts","sourceRoot":"","sources":["../../src/hooks/useSiteBaseUrl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAGhE;;GAEG;AACH,wBAAgB,cAAc;;;;EAS7B"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { buildSiteUrl, extractPathFromUrl } from '../lib/utils';
|
|
2
|
+
import { getUIConfig } from '../ui-config';
|
|
3
|
+
/**
|
|
4
|
+
* Hook to access and use the site base URL configuration
|
|
5
|
+
*/
|
|
6
|
+
export function useSiteBaseUrl() {
|
|
7
|
+
const config = getUIConfig();
|
|
8
|
+
const siteBaseUrl = config.siteBaseUrl || '';
|
|
9
|
+
return {
|
|
10
|
+
siteBaseUrl,
|
|
11
|
+
buildUrl: buildSiteUrl,
|
|
12
|
+
extractPath: extractPathFromUrl,
|
|
13
|
+
};
|
|
14
|
+
}
|