@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
package/dist/index.d.mts
CHANGED
|
@@ -1,15 +1,20 @@
|
|
|
1
1
|
import { DataSchemas, setDataSchemas } from "./data-schemas.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import React from "react";
|
|
4
|
-
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
5
|
-
import { AssetEntry, AssetUsage, FolderListing, FolderTreeNode, LocalizedEntry } from "@conloca/content-api-client";
|
|
2
|
+
import { AssetEntry, AssetUsage, ContentAPIClient, FolderListing, FolderTreeNode, LocalizedEntry } from "@conloca/content-api-client";
|
|
6
3
|
import { QueryClientConfig, QueryClientConfig as QueryClientConfig$1 } from "@tanstack/react-query";
|
|
7
|
-
|
|
8
|
-
//#region src/
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
4
|
+
import "react";
|
|
5
|
+
//#region src/CmsSpaApp.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* The full cms-spa editor as a React component.
|
|
8
|
+
*
|
|
9
|
+
* Reads the current `UIConfig` via `getUIConfig` — callers MUST call
|
|
10
|
+
* `configureUI` before rendering this component. The `QueryClient`
|
|
11
|
+
* and `ContentAPIClient` singletons are built via `useMemo`, so
|
|
12
|
+
* consumers that force a fresh mount via React `key` (e.g. on
|
|
13
|
+
* workspace switch) get clean cache state for the new workspace,
|
|
14
|
+
* while single-mount consumers (e.g. astro-cms's `/__cms` route)
|
|
15
|
+
* keep the same instances for the lifetime of the page.
|
|
16
|
+
*/
|
|
17
|
+
declare function CmsSpaApp(): import("react/jsx-runtime").JSX.Element;
|
|
13
18
|
//#endregion
|
|
14
19
|
//#region src/components/media/FolderTreeSidebar.d.ts
|
|
15
20
|
interface FolderTreeSidebarProps {
|
|
@@ -18,11 +23,7 @@ interface FolderTreeSidebarProps {
|
|
|
18
23
|
/** For drag-and-drop: highlight target when dragging */
|
|
19
24
|
dropTargetFolder?: string | null;
|
|
20
25
|
}
|
|
21
|
-
declare function FolderTreeSidebar({
|
|
22
|
-
currentFolder,
|
|
23
|
-
onFolderSelect,
|
|
24
|
-
dropTargetFolder
|
|
25
|
-
}: FolderTreeSidebarProps): react_jsx_runtime0.JSX.Element;
|
|
26
|
+
declare function FolderTreeSidebar({ currentFolder, onFolderSelect, dropTargetFolder }: FolderTreeSidebarProps): import("react/jsx-runtime").JSX.Element;
|
|
26
27
|
//#endregion
|
|
27
28
|
//#region src/components/media/MediaToolbar.d.ts
|
|
28
29
|
type FileTypeFilter = 'all' | 'images' | 'svg';
|
|
@@ -59,22 +60,7 @@ interface MediaLibraryProps {
|
|
|
59
60
|
/** External sort option (when toolbar is external) */
|
|
60
61
|
sort?: SortOption;
|
|
61
62
|
}
|
|
62
|
-
declare function MediaLibrary({
|
|
63
|
-
folder: initialFolder,
|
|
64
|
-
onFolderChange,
|
|
65
|
-
showToolbar,
|
|
66
|
-
mode,
|
|
67
|
-
assetsBasePath,
|
|
68
|
-
selectedAssets,
|
|
69
|
-
onToggleSelect,
|
|
70
|
-
onAssetClick,
|
|
71
|
-
onAssetDoubleClick,
|
|
72
|
-
onSelect,
|
|
73
|
-
selectedAsset,
|
|
74
|
-
search: externalSearch,
|
|
75
|
-
fileType: externalFileType,
|
|
76
|
-
sort: externalSort
|
|
77
|
-
}: MediaLibraryProps): react_jsx_runtime0.JSX.Element;
|
|
63
|
+
declare function MediaLibrary({ folder: initialFolder, onFolderChange, showToolbar, mode, assetsBasePath, selectedAssets, onToggleSelect, onAssetClick, onAssetDoubleClick, onSelect, selectedAsset, search: externalSearch, fileType: externalFileType, sort: externalSort }: MediaLibraryProps): import("react/jsx-runtime").JSX.Element;
|
|
78
64
|
//#endregion
|
|
79
65
|
//#region src/components/media/UploadModal.d.ts
|
|
80
66
|
interface UploadModalProps {
|
|
@@ -83,12 +69,7 @@ interface UploadModalProps {
|
|
|
83
69
|
folder: string;
|
|
84
70
|
onUploadComplete?: () => void;
|
|
85
71
|
}
|
|
86
|
-
declare function UploadModal({
|
|
87
|
-
isOpen,
|
|
88
|
-
onClose,
|
|
89
|
-
folder,
|
|
90
|
-
onUploadComplete
|
|
91
|
-
}: UploadModalProps): react_jsx_runtime0.JSX.Element | null;
|
|
72
|
+
declare function UploadModal({ isOpen, onClose, folder, onUploadComplete }: UploadModalProps): import("react/jsx-runtime").JSX.Element | null;
|
|
92
73
|
//#endregion
|
|
93
74
|
//#region src/components/puck/MDXContent.d.ts
|
|
94
75
|
interface MDXContentProps {
|
|
@@ -97,7 +78,109 @@ interface MDXContentProps {
|
|
|
97
78
|
/**
|
|
98
79
|
* MDXContent component wrapped with error boundary.
|
|
99
80
|
*/
|
|
100
|
-
declare function MDXContent(props: MDXContentProps):
|
|
81
|
+
declare function MDXContent(props: MDXContentProps): import("react/jsx-runtime").JSX.Element;
|
|
82
|
+
//#endregion
|
|
83
|
+
//#region src/media/types.d.ts
|
|
84
|
+
/**
|
|
85
|
+
* Lifecycle scope of a media asset in a hosted-mode (branch-aware)
|
|
86
|
+
* context. cms-spa's renderer-neutral `AssetEntry` (in
|
|
87
|
+
* `content-api/asset-types.ts`) doesn't model this — branch vs
|
|
88
|
+
* published is meaningful only when an asset lives in a working
|
|
89
|
+
* tree separate from the published default branch.
|
|
90
|
+
*
|
|
91
|
+
* The hosted shell surfaces the distinction through
|
|
92
|
+
* `UIConfig.mediaBridge.getAssetScope`. cms-spa's media surfaces
|
|
93
|
+
* (AssetCard, AssetDetailSidebar) paint a "Branch only" /
|
|
94
|
+
* "Published" pill based on the bridge's reply. When no bridge is
|
|
95
|
+
* installed (local Astro dev, astro-cms standalone), the pill is
|
|
96
|
+
* hidden — surfaces render exactly as they did before.
|
|
97
|
+
*
|
|
98
|
+
* - `branch` — exists only on this branch's working tree. Needs
|
|
99
|
+
* promotion before the published site can see it.
|
|
100
|
+
* - `published` — promoted into the org's default branch and
|
|
101
|
+
* visible from every branch.
|
|
102
|
+
*/
|
|
103
|
+
type AssetScope = 'branch' | 'published';
|
|
104
|
+
/**
|
|
105
|
+
* Standing media issue surfaced by the host shell alongside the
|
|
106
|
+
* `AssetScope` pill. Distinct from a per-call promote outcome:
|
|
107
|
+
* an issue here is a property OF the asset that persists until
|
|
108
|
+
* the customer resolves it.
|
|
109
|
+
*
|
|
110
|
+
* cms-spa's renderer-neutral asset model doesn't carry these
|
|
111
|
+
* fields because the local-Astro case has no notion of upload
|
|
112
|
+
* limits or media scanning — they're hosted-mode state the
|
|
113
|
+
* host exposes through `UIConfig.mediaBridge.getMediaIssue`.
|
|
114
|
+
*
|
|
115
|
+
* - `oversized` — file exceeds the inline-blob limit. The asset
|
|
116
|
+
* is still served, just slower than it should be. Surface
|
|
117
|
+
* paints an amber warning with "move to media storage"
|
|
118
|
+
* guidance.
|
|
119
|
+
* - `blocked` — content is held back by the passthrough scanner
|
|
120
|
+
* (malware, EXIF leak, policy violation). Preview falls back
|
|
121
|
+
* to a placeholder; publishing is hard-blocked until resolved.
|
|
122
|
+
* Surface paints a red error with the scanner's reason.
|
|
123
|
+
*
|
|
124
|
+
* Both variants carry `filename` so flat lists are self-joinable
|
|
125
|
+
* to the user's dirty page set without a second lookup.
|
|
126
|
+
*/
|
|
127
|
+
type MediaIssue = {
|
|
128
|
+
kind: 'oversized';
|
|
129
|
+
filename: string;
|
|
130
|
+
sizeBytes: number;
|
|
131
|
+
limitBytes: number;
|
|
132
|
+
} | {
|
|
133
|
+
kind: 'blocked';
|
|
134
|
+
filename: string;
|
|
135
|
+
reason: string;
|
|
136
|
+
};
|
|
137
|
+
/**
|
|
138
|
+
* Bridge cms-spa uses to read host-shell-supplied metadata about
|
|
139
|
+
* media assets that cms-spa's renderer-neutral model doesn't carry.
|
|
140
|
+
* Installed by the host shell via `UIConfig.mediaBridge` before
|
|
141
|
+
* rendering `<CmsSpaApp />`; cms-spa never reaches for the
|
|
142
|
+
* HostClient directly.
|
|
143
|
+
*
|
|
144
|
+
* The bridge is optional in `UIConfig` — absence means "no host
|
|
145
|
+
* wiring," in which case cms-spa surfaces degrade cleanly (no
|
|
146
|
+
* scope pill, no host-side hooks fire).
|
|
147
|
+
*/
|
|
148
|
+
interface MediaBridge {
|
|
149
|
+
/**
|
|
150
|
+
* Resolve the lifecycle scope of a single asset. Called by
|
|
151
|
+
* AssetCard / AssetDetailSidebar whenever they need to render
|
|
152
|
+
* the scope pill. Returns `null` when the host has no opinion
|
|
153
|
+
* (asset unknown to the host, pre-bootstrap state, or a
|
|
154
|
+
* non-hosted mount); the surface treats `null` the same as
|
|
155
|
+
* "no bridge" — pill hidden.
|
|
156
|
+
*
|
|
157
|
+
* The host is responsible for caching: cms-spa calls this
|
|
158
|
+
* synchronously-from-the-surface's-POV via TanStack so
|
|
159
|
+
* repeated renders don't refetch. The bridge implementation
|
|
160
|
+
* (in the host shell) wraps its client's `getAssetScope`
|
|
161
|
+
* call in a `useQuery` so the resolved scope is memoised.
|
|
162
|
+
*/
|
|
163
|
+
getAssetScope(input: {
|
|
164
|
+
filename: string;
|
|
165
|
+
}): Promise<AssetScope | null>;
|
|
166
|
+
/**
|
|
167
|
+
* Resolve the standing media issue for a single asset, or `null`
|
|
168
|
+
* when the asset is healthy. Called by AssetCard /
|
|
169
|
+
* AssetDetailSidebar whenever they paint the per-asset
|
|
170
|
+
* error/warning badge.
|
|
171
|
+
*
|
|
172
|
+
* Returns `null` for the same reasons as `getAssetScope`: host
|
|
173
|
+
* has no opinion (asset unknown, pre-bootstrap state, non-hosted
|
|
174
|
+
* mount). Surfaces treat `null` the same as "no bridge" — badge
|
|
175
|
+
* hidden, `AssetEntry` rendered unchanged.
|
|
176
|
+
*
|
|
177
|
+
* The host caches the lookup so cms-spa's `useMediaIssue` wrapper
|
|
178
|
+
* doesn't have to think about per-asset cache windows.
|
|
179
|
+
*/
|
|
180
|
+
getMediaIssue(input: {
|
|
181
|
+
filename: string;
|
|
182
|
+
}): Promise<MediaIssue | null>;
|
|
183
|
+
}
|
|
101
184
|
//#endregion
|
|
102
185
|
//#region src/ui-config.d.ts
|
|
103
186
|
interface TemplateConfig {
|
|
@@ -112,14 +195,59 @@ interface UIConfig {
|
|
|
112
195
|
siteBaseUrl?: string;
|
|
113
196
|
enableDevtools?: boolean;
|
|
114
197
|
queryClientOptions?: QueryClientConfig$1;
|
|
198
|
+
/**
|
|
199
|
+
* Optional content client supplied by an embedding host. When absent,
|
|
200
|
+
* CmsSpaApp creates the default ContentAPIClient from `apiBaseUrl`.
|
|
201
|
+
*/
|
|
202
|
+
contentClient?: ContentAPIClient;
|
|
115
203
|
/** Absolute path to project root (for "Open in Editor" links) */
|
|
116
204
|
projectRoot?: string;
|
|
117
205
|
/** Relative path to schemas file (e.g., './src/schemas.ts') */
|
|
118
206
|
schemasPath?: string;
|
|
119
207
|
/** Page creation templates */
|
|
120
208
|
templates?: Record<string, TemplateConfig>;
|
|
209
|
+
/**
|
|
210
|
+
* True when at least one site in `sites.json` declares an `mdxPages`
|
|
211
|
+
* path. Drives whether the create-page dialog exposes the "Document
|
|
212
|
+
* page" (MDX) option. When absent or false, the dialog only creates
|
|
213
|
+
* Puck pages — the historical behavior.
|
|
214
|
+
*/
|
|
215
|
+
mdxPagesEnabled?: boolean;
|
|
216
|
+
/**
|
|
217
|
+
* The site's supported locales. Comes from the top-level `locales`
|
|
218
|
+
* option on `conlocaCMS({...})` (which can be derived from
|
|
219
|
+
* `localesFromAstroI18n` / `localesFromStarlight`). When absent the
|
|
220
|
+
* dialog falls back to a single English locale and hides the locale
|
|
221
|
+
* field entirely.
|
|
222
|
+
*/
|
|
223
|
+
locales?: {
|
|
224
|
+
list: string[];
|
|
225
|
+
defaultLocale: string;
|
|
226
|
+
};
|
|
227
|
+
/**
|
|
228
|
+
* When true, cms-spa is rendering inside a hosted shell that already
|
|
229
|
+
* owns workspace identity, account, and workspace-state UI. The sidebar
|
|
230
|
+
* suppresses widgets that would compete with the host (UserAvatar,
|
|
231
|
+
* GitStatusPanel) and lets the host's chrome show through. Default
|
|
232
|
+
* false: cms-spa runs as the whole page (astro-cms, dev-entry).
|
|
233
|
+
*/
|
|
234
|
+
hosted?: boolean;
|
|
235
|
+
/**
|
|
236
|
+
* Bridge the host shell installs to surface hosted-mode media
|
|
237
|
+
* metadata (e.g. branch-vs-published scope) in cms-spa's media
|
|
238
|
+
* surfaces. cms-spa's renderer-neutral `AssetEntry` does NOT
|
|
239
|
+
* carry scope because the local-Astro case has no notion of
|
|
240
|
+
* branch-only assets. Surfaces consult the bridge through a
|
|
241
|
+
* TanStack-wrapped hook (`useAssetScope` in `media/use-asset-scope.ts`)
|
|
242
|
+
* so per-asset lookups cache cleanly.
|
|
243
|
+
*
|
|
244
|
+
* Optional in `UIConfig` — when absent, AssetCard /
|
|
245
|
+
* AssetDetailSidebar skip the scope pill entirely. This keeps
|
|
246
|
+
* astro-cms standalone working unchanged.
|
|
247
|
+
*/
|
|
248
|
+
mediaBridge?: MediaBridge;
|
|
121
249
|
}
|
|
122
250
|
declare function configureUI(options: Partial<UIConfig>): void;
|
|
123
251
|
//#endregion
|
|
124
|
-
export { type AssetEntry, type AssetUsage,
|
|
252
|
+
export { type AssetEntry, type AssetUsage, CmsSpaApp, type DataSchemas, type FolderListing, type FolderTreeNode, FolderTreeSidebar, MDXContent, MediaLibrary, type QueryClientConfig, type UIConfig, UploadModal, configureUI, setDataSchemas };
|
|
125
253
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/CmsSpaApp.tsx","../src/components/media/FolderTreeSidebar.tsx","../src/components/media/MediaToolbar.tsx","../src/components/media/MediaLibrary.tsx","../src/components/media/UploadModal.tsx","../src/components/puck/MDXContent.tsx","../src/media/types.ts","../src/ui-config.ts"],"mappings":";;;;;;;;;;;;;;;;iBAoBgB,yCAAS,IAAA;;;UCdf;EACR;EACA,iBAAiB;;EAEjB;;iBA8Cc,oBAAoB,eAAe,gBAAgB,oBAAoB,qDAAsB,IAAA;;;KCrDjG;KACA;;;UCGF;;EAER;;EAEA,kBAAkB;;EAElB;;EAEA;;EAEA;;EAEA,iBAAiB;;EAEjB,kBAAkB;;EAElB,gBAAgB,OAAO;;EAEvB,sBAAsB,OAAO;;EAE7B,YAAY,OAAO;;EAEnB,gBAAgB;;EAEhB;;EAEA,WAAW;;EAEX,OAAO;;iBAGO,eACd,QAAQ,eACR,gBACA,aACA,MACA,gBACA,gBACA,gBACA,cACA,oBACA,UACA,eACA,QAAQ,gBACR,UAAU,kBACV,MAAM,gBACL,gDAAiB,IAAA;;;UC/CV;EACR;EACA;EACA;EACA;;iBAGc,cAAc,QAAQ,SAAS,QAAQ,oBAAoB,+CAAgB,IAAA;;;UCTjF;EACR,OAAO;;;;;iBAwJO,WAAW,OAAO,8CAAe,IAAA;;;;;;;;;;;;;;;;;;;;;;KC1IrC;;;;;;;;;;;;;;;;;;;;;;;;KAyBA;EACN;EAAmB;EAAkB;EAAmB;;EACxD;EAAiB;EAAkB;;;;;;;;;;;;;UAaxB;;;;;;;;;;;;;;;EAef,cAAc;IAAS;MAAqB,QAAQ;;;;;;;;;;;;;;;EAepD,cAAc;IAAS;MAAqB,QAAQ;;;;UCrFrC;EACf;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA;EACA;EACA,qBAAqB;;;;;EAKrB,gBAAgB;;EAEhB;;EAEA;;EAEA,YAAY,eAAe;;;;;;;EAO3B;;;;;;;;EAQA;IAAY;IAAgB;;;;;;;;;EAQ5B;;;;;;;;;;;;;;EAcA,cAAc;;iBAoBA,YAAY,SAAS,QAAQ"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type { QueryClientConfig } from '@tanstack/react-query';
|
|
2
|
+
export { CmsSpaApp } from './CmsSpaApp';
|
|
3
|
+
export { FolderTreeSidebar } from './components/media/FolderTreeSidebar';
|
|
4
|
+
export { MediaLibrary } from './components/media/MediaLibrary';
|
|
5
|
+
export { UploadModal } from './components/media/UploadModal';
|
|
6
|
+
export { MDXContent } from './components/puck';
|
|
7
|
+
export { type DataSchemas, setDataSchemas } from './data-schemas';
|
|
8
|
+
export type { AssetEntry, AssetUsage, FolderListing, FolderTreeNode } from './hooks';
|
|
9
|
+
export { configureUI, type UIConfig } from './ui-config';
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,YAAY,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE/D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAEzE,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAE7D,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,OAAO,EAAE,KAAK,WAAW,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAElE,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAErF,OAAO,EAAE,WAAW,EAAE,KAAK,QAAQ,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// Export hosted-mode mount component (for embedding cms-spa inside another React shell)
|
|
2
|
+
export { CmsSpaApp } from './CmsSpaApp';
|
|
3
|
+
export { FolderTreeSidebar } from './components/media/FolderTreeSidebar';
|
|
4
|
+
// Export media components for MDX editor image picker
|
|
5
|
+
export { MediaLibrary } from './components/media/MediaLibrary';
|
|
6
|
+
export { UploadModal } from './components/media/UploadModal';
|
|
7
|
+
// Export components
|
|
8
|
+
export { MDXContent } from './components/puck';
|
|
9
|
+
// Export data schemas functions
|
|
10
|
+
export { setDataSchemas } from './data-schemas';
|
|
11
|
+
// Export configuration function
|
|
12
|
+
export { configureUI } from './ui-config';
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,38 @@
|
|
|
1
|
-
import { a as MediaLibrary, c as
|
|
1
|
+
import { a as MediaLibrary, c as getUIConfig, i as UploadModal, l as ThemeProvider, n as CanvasThemeProvider, o as FolderTreeSidebar, r as MDXContent, s as configureUI, t as App } from "./App-Bk1LNxbS.mjs";
|
|
2
2
|
import { setDataSchemas } from "./data-schemas.mjs";
|
|
3
|
+
import { ContentAPIClient, setContentAPIClient } from "@conloca/content-api-client";
|
|
4
|
+
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
|
5
|
+
import { ReactQueryDevtools } from "@tanstack/react-query-devtools";
|
|
6
|
+
import { useMemo } from "react";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
//#region src/CmsSpaApp.tsx
|
|
9
|
+
/**
|
|
10
|
+
* The full cms-spa editor as a React component.
|
|
11
|
+
*
|
|
12
|
+
* Reads the current `UIConfig` via `getUIConfig` — callers MUST call
|
|
13
|
+
* `configureUI` before rendering this component. The `QueryClient`
|
|
14
|
+
* and `ContentAPIClient` singletons are built via `useMemo`, so
|
|
15
|
+
* consumers that force a fresh mount via React `key` (e.g. on
|
|
16
|
+
* workspace switch) get clean cache state for the new workspace,
|
|
17
|
+
* while single-mount consumers (e.g. astro-cms's `/__cms` route)
|
|
18
|
+
* keep the same instances for the lifetime of the page.
|
|
19
|
+
*/
|
|
20
|
+
function CmsSpaApp() {
|
|
21
|
+
const config = getUIConfig();
|
|
22
|
+
const queryClient = useMemo(() => {
|
|
23
|
+
const client = new QueryClient(config.queryClientOptions);
|
|
24
|
+
window.__QUERY_CLIENT__ = client;
|
|
25
|
+
return client;
|
|
26
|
+
}, [config.queryClientOptions]);
|
|
27
|
+
useMemo(() => {
|
|
28
|
+
setContentAPIClient(config.contentClient ?? new ContentAPIClient({ baseUrl: config.apiBaseUrl }));
|
|
29
|
+
}, [config.apiBaseUrl, config.contentClient]);
|
|
30
|
+
return /* @__PURE__ */ jsxs(QueryClientProvider, {
|
|
31
|
+
client: queryClient,
|
|
32
|
+
children: [/* @__PURE__ */ jsx(ThemeProvider, { children: /* @__PURE__ */ jsx(CanvasThemeProvider, { children: /* @__PURE__ */ jsx(App, { basename: config.basename }) }) }), config.enableDevtools && /* @__PURE__ */ jsx(ReactQueryDevtools, { initialIsOpen: false })]
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
//#endregion
|
|
36
|
+
export { CmsSpaApp, FolderTreeSidebar, MDXContent, MediaLibrary, UploadModal, configureUI, setDataSchemas };
|
|
3
37
|
|
|
4
|
-
|
|
38
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../src/CmsSpaApp.tsx"],"sourcesContent":["import { ContentAPIClient, setContentAPIClient } from '@conloca/content-api-client';\nimport { QueryClient, QueryClientProvider } from '@tanstack/react-query';\nimport { ReactQueryDevtools } from '@tanstack/react-query-devtools';\nimport { useMemo } from 'react';\nimport App from './App';\nimport { CanvasThemeProvider } from './hooks/useCanvasTheme';\nimport { ThemeProvider } from './hooks/useTheme';\nimport { getUIConfig } from './ui-config';\n\n/**\n * The full cms-spa editor as a React component.\n *\n * Reads the current `UIConfig` via `getUIConfig` — callers MUST call\n * `configureUI` before rendering this component. The `QueryClient`\n * and `ContentAPIClient` singletons are built via `useMemo`, so\n * consumers that force a fresh mount via React `key` (e.g. on\n * workspace switch) get clean cache state for the new workspace,\n * while single-mount consumers (e.g. astro-cms's `/__cms` route)\n * keep the same instances for the lifetime of the page.\n */\nexport function CmsSpaApp() {\n const config = getUIConfig();\n\n const queryClient = useMemo(() => {\n const client = new QueryClient(config.queryClientOptions);\n // Exposed globally for the content change listener (see astro-cms).\n (window as Window & { __QUERY_CLIENT__?: QueryClient }).__QUERY_CLIENT__ = client;\n return client;\n }, [config.queryClientOptions]);\n\n useMemo(() => {\n setContentAPIClient(config.contentClient ?? new ContentAPIClient({ baseUrl: config.apiBaseUrl }));\n }, [config.apiBaseUrl, config.contentClient]);\n\n return (\n <QueryClientProvider client={queryClient}>\n <ThemeProvider>\n <CanvasThemeProvider>\n <App basename={config.basename} />\n </CanvasThemeProvider>\n </ThemeProvider>\n {config.enableDevtools && <ReactQueryDevtools initialIsOpen={false} />}\n </QueryClientProvider>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAoBA,SAAgB,YAAY;CAC1B,MAAM,SAAS,YAAY;CAE3B,MAAM,cAAc,cAAc;EAChC,MAAM,SAAS,IAAI,YAAY,OAAO,kBAAkB;EAExD,OAAwD,mBAAmB;EAC3E,OAAO;CACT,GAAG,CAAC,OAAO,kBAAkB,CAAC;CAE9B,cAAc;EACZ,oBAAoB,OAAO,iBAAiB,IAAI,iBAAiB,EAAE,SAAS,OAAO,WAAW,CAAC,CAAC;CAClG,GAAG,CAAC,OAAO,YAAY,OAAO,aAAa,CAAC;CAE5C,OACE,qBAAC,qBAAD;EAAqB,QAAQ;EAA7B,UAAA,CACE,oBAAC,eAAD,EAAA,UACE,oBAAC,qBAAD,EAAA,UACE,oBAAC,KAAD,EAAK,UAAU,OAAO,SAAW,CAAA,EACd,CAAA,EACR,CAAA,GACd,OAAO,kBAAkB,oBAAC,oBAAD,EAAoB,eAAe,MAAQ,CAAA,CAClD;;AAEzB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Build a full URL from the site base URL and a path
|
|
3
|
+
* @param path The path to append (e.g., '/about')
|
|
4
|
+
* @returns The full URL (e.g., 'https://example.com/docs/about' or '/docs/about')
|
|
5
|
+
*/
|
|
6
|
+
export declare function buildSiteUrl(path: string): string;
|
|
7
|
+
/**
|
|
8
|
+
* Extract the path from a full URL, removing the site base URL
|
|
9
|
+
* @param url The full URL (e.g., 'https://example.com/docs/about' or '/docs/about')
|
|
10
|
+
* @returns The path without base URL (e.g., '/about')
|
|
11
|
+
*/
|
|
12
|
+
export declare function extractPathFromUrl(url: string): string;
|
|
13
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/lib/utils.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAmBjD;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAsBtD"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { getUIConfig } from '../ui-config';
|
|
2
|
+
/**
|
|
3
|
+
* Build a full URL from the site base URL and a path
|
|
4
|
+
* @param path The path to append (e.g., '/about')
|
|
5
|
+
* @returns The full URL (e.g., 'https://example.com/docs/about' or '/docs/about')
|
|
6
|
+
*/
|
|
7
|
+
export function buildSiteUrl(path) {
|
|
8
|
+
const config = getUIConfig();
|
|
9
|
+
const siteBaseUrl = config.siteBaseUrl || '';
|
|
10
|
+
if (!siteBaseUrl)
|
|
11
|
+
return path;
|
|
12
|
+
// Handle absolute URLs (with protocol)
|
|
13
|
+
if (siteBaseUrl.includes('://')) {
|
|
14
|
+
const base = siteBaseUrl.endsWith('/') ? siteBaseUrl.slice(0, -1) : siteBaseUrl;
|
|
15
|
+
const cleanPath = path.startsWith('/') ? path : `/${path}`;
|
|
16
|
+
return `${base}${cleanPath}`;
|
|
17
|
+
}
|
|
18
|
+
// Handle relative paths
|
|
19
|
+
const prefix = siteBaseUrl.startsWith('/') ? siteBaseUrl : `/${siteBaseUrl}`;
|
|
20
|
+
const cleanPrefix = prefix.endsWith('/') ? prefix.slice(0, -1) : prefix;
|
|
21
|
+
const cleanPath = path.startsWith('/') ? path : `/${path}`;
|
|
22
|
+
return `${cleanPrefix}${cleanPath}`;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Extract the path from a full URL, removing the site base URL
|
|
26
|
+
* @param url The full URL (e.g., 'https://example.com/docs/about' or '/docs/about')
|
|
27
|
+
* @returns The path without base URL (e.g., '/about')
|
|
28
|
+
*/
|
|
29
|
+
export function extractPathFromUrl(url) {
|
|
30
|
+
const config = getUIConfig();
|
|
31
|
+
const siteBaseUrl = config.siteBaseUrl || '';
|
|
32
|
+
if (!siteBaseUrl)
|
|
33
|
+
return url;
|
|
34
|
+
// Handle absolute URLs
|
|
35
|
+
if (siteBaseUrl.includes('://') && url.startsWith(siteBaseUrl)) {
|
|
36
|
+
const withoutBase = url.slice(siteBaseUrl.length);
|
|
37
|
+
return withoutBase.startsWith('/') ? withoutBase : `/${withoutBase}`;
|
|
38
|
+
}
|
|
39
|
+
// Handle relative paths
|
|
40
|
+
const prefix = siteBaseUrl.startsWith('/') ? siteBaseUrl : `/${siteBaseUrl}`;
|
|
41
|
+
const cleanPrefix = prefix.endsWith('/') ? prefix.slice(0, -1) : prefix;
|
|
42
|
+
if (url.startsWith(cleanPrefix)) {
|
|
43
|
+
const withoutPrefix = url.slice(cleanPrefix.length);
|
|
44
|
+
return withoutPrefix.startsWith('/') ? withoutPrefix : `/${withoutPrefix}`;
|
|
45
|
+
}
|
|
46
|
+
return url;
|
|
47
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { c as getUIConfig, l as ThemeProvider, n as CanvasThemeProvider, t as App } from "./App-Bk1LNxbS.mjs";
|
|
2
|
+
import { getMdxComponents, setMdxComponents } from "./mdx-components.mjs";
|
|
3
|
+
import { ContentAPIClient, setContentAPIClient } from "@conloca/content-api-client";
|
|
4
|
+
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
|
5
|
+
import { ReactQueryDevtools } from "@tanstack/react-query-devtools";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { createRoot } from "react-dom/client";
|
|
8
|
+
//#region src/main-spa.tsx
|
|
9
|
+
/**
|
|
10
|
+
* Full SPA boot. Loaded by `main.tsx` when the document is the top
|
|
11
|
+
* window (not an iframe-embedded editor surface). Mirrors the
|
|
12
|
+
* pre-iframe entry behavior — initializing the content API client,
|
|
13
|
+
* the QueryClient, and the providers around `<App>`.
|
|
14
|
+
*/
|
|
15
|
+
function mountSpa() {
|
|
16
|
+
const config = getUIConfig();
|
|
17
|
+
const contentAPIClient = new ContentAPIClient({ baseUrl: config.apiBaseUrl });
|
|
18
|
+
setContentAPIClient(contentAPIClient);
|
|
19
|
+
const queryClient = new QueryClient(config.queryClientOptions);
|
|
20
|
+
window.__QUERY_CLIENT__ = queryClient;
|
|
21
|
+
window.__CONTENT_API_CLIENT__ = contentAPIClient;
|
|
22
|
+
const cmsBase = (config.basename ?? "/__cms").replace(/\/+$/, "");
|
|
23
|
+
fetch(`${cmsBase}/api/registry`).then((res) => {
|
|
24
|
+
if (!res.ok) throw new Error(`registry endpoint ${res.status}`);
|
|
25
|
+
return res.json();
|
|
26
|
+
}).then((data) => {
|
|
27
|
+
if (!Array.isArray(data?.components)) return;
|
|
28
|
+
const discoveredNames = new Set(data.components.map((c) => c.name));
|
|
29
|
+
setMdxComponents([...getMdxComponents().filter((c) => !discoveredNames.has(c.name)), ...data.components]);
|
|
30
|
+
}).catch((err) => {
|
|
31
|
+
console.warn("[Conloca] auto-discover registry unavailable; using host-provided descriptors:", err);
|
|
32
|
+
});
|
|
33
|
+
const rootEl = document.getElementById("root");
|
|
34
|
+
if (!rootEl) {
|
|
35
|
+
console.error("[Conloca] #root not found");
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
createRoot(rootEl).render(/* @__PURE__ */ jsxs(QueryClientProvider, {
|
|
39
|
+
client: queryClient,
|
|
40
|
+
children: [/* @__PURE__ */ jsx(ThemeProvider, { children: /* @__PURE__ */ jsx(CanvasThemeProvider, { children: /* @__PURE__ */ jsx(App, { basename: config.basename }) }) }), config.enableDevtools && /* @__PURE__ */ jsx(ReactQueryDevtools, { initialIsOpen: false })]
|
|
41
|
+
}));
|
|
42
|
+
}
|
|
43
|
+
//#endregion
|
|
44
|
+
export { mountSpa };
|
|
45
|
+
|
|
46
|
+
//# sourceMappingURL=main-spa-781YUplS.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main-spa-781YUplS.mjs","names":[],"sources":["../src/main-spa.tsx"],"sourcesContent":["import { ContentAPIClient, setContentAPIClient } from '@conloca/content-api-client';\nimport { QueryClient, QueryClientProvider } from '@tanstack/react-query';\nimport { ReactQueryDevtools } from '@tanstack/react-query-devtools';\nimport { createRoot } from 'react-dom/client';\nimport App from './App';\nimport { CanvasThemeProvider } from './hooks/useCanvasTheme';\nimport { ThemeProvider } from './hooks/useTheme';\nimport { getMdxComponents, type MdxComponents, setMdxComponents } from './mdx-components';\nimport { getUIConfig } from './ui-config';\n\n/**\n * Full SPA boot. Loaded by `main.tsx` when the document is the top\n * window (not an iframe-embedded editor surface). Mirrors the\n * pre-iframe entry behavior — initializing the content API client,\n * the QueryClient, and the providers around `<App>`.\n */\nexport function mountSpa(): void {\n const config = getUIConfig();\n\n const contentAPIClient = new ContentAPIClient({\n baseUrl: config.apiBaseUrl,\n });\n setContentAPIClient(contentAPIClient);\n\n const queryClient = new QueryClient(config.queryClientOptions);\n\n // The content-change listener (and the editor it drives) reach for\n // these on the window — exposing both keeps cross-window bridging\n // simple and lets the iframe-side editor reuse the parent's cache\n // and API client without duplicating connections.\n (window as Window & { __QUERY_CLIENT__?: QueryClient }).__QUERY_CLIENT__ = queryClient;\n (window as Window & { __CONTENT_API_CLIENT__?: ContentAPIClient }).__CONTENT_API_CLIENT__ = contentAPIClient;\n\n // Kick off the auto-discover registry fetch in the background.\n // The integration's `/api/registry` endpoint scans the host's MDX\n // content + configured component folders for JSX components.\n // Merge those with whatever the schemas-loader virtual module\n // already put in the registry (typically host-curated snippets\n // and any non-JSX descriptors), with auto-discovered JSX entries\n // winning on name collisions — they're derived from the source\n // of truth (the MDX files themselves).\n const cmsBase = (config.basename ?? '/__cms').replace(/\\/+$/, '');\n fetch(`${cmsBase}/api/registry`)\n .then((res) => {\n if (!res.ok) throw new Error(`registry endpoint ${res.status}`);\n return res.json();\n })\n .then((data: { components?: MdxComponents }) => {\n if (!Array.isArray(data?.components)) return;\n const discoveredNames = new Set(data.components.map((c) => c.name));\n const existing = getMdxComponents().filter((c) => !discoveredNames.has(c.name));\n setMdxComponents([...existing, ...data.components]);\n })\n .catch((err) => {\n console.warn('[Conloca] auto-discover registry unavailable; using host-provided descriptors:', err);\n });\n\n const rootEl = document.getElementById('root');\n if (!rootEl) {\n console.error('[Conloca] #root not found');\n return;\n }\n createRoot(rootEl).render(\n <QueryClientProvider client={queryClient}>\n <ThemeProvider>\n <CanvasThemeProvider>\n <App basename={config.basename} />\n </CanvasThemeProvider>\n </ThemeProvider>\n {config.enableDevtools && <ReactQueryDevtools initialIsOpen={false} />}\n </QueryClientProvider>,\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AAgBA,SAAgB,WAAiB;CAC/B,MAAM,SAAS,YAAY;CAE3B,MAAM,mBAAmB,IAAI,iBAAiB,EAC5C,SAAS,OAAO,WAClB,CAAC;CACD,oBAAoB,gBAAgB;CAEpC,MAAM,cAAc,IAAI,YAAY,OAAO,kBAAkB;CAM7D,OAAwD,mBAAmB;CAC3E,OAAmE,yBAAyB;CAU5F,MAAM,WAAW,OAAO,YAAY,SAAA,CAAU,QAAQ,QAAQ,EAAE;CAChE,MAAM,GAAG,QAAQ,cAAc,CAAC,CAC7B,MAAM,QAAQ;EACb,IAAI,CAAC,IAAI,IAAI,MAAM,IAAI,MAAM,qBAAqB,IAAI,QAAQ;EAC9D,OAAO,IAAI,KAAK;CAClB,CAAC,CAAC,CACD,MAAM,SAAyC;EAC9C,IAAI,CAAC,MAAM,QAAQ,MAAM,UAAU,GAAG;EACtC,MAAM,kBAAkB,IAAI,IAAI,KAAK,WAAW,KAAK,MAAM,EAAE,IAAI,CAAC;EAElE,iBAAiB,CAAC,GADD,iBAAiB,CAAC,CAAC,QAAQ,MAAM,CAAC,gBAAgB,IAAI,EAAE,IAAI,CACjD,GAAG,GAAG,KAAK,UAAU,CAAC;CACpD,CAAC,CAAC,CACD,OAAO,QAAQ;EACd,QAAQ,KAAK,kFAAkF,GAAG;CACpG,CAAC;CAEH,MAAM,SAAS,SAAS,eAAe,MAAM;CAC7C,IAAI,CAAC,QAAQ;EACX,QAAQ,MAAM,2BAA2B;EACzC;CACF;CACA,WAAW,MAAM,CAAC,CAAC,OACjB,qBAAC,qBAAD;EAAqB,QAAQ;EAA7B,UAAA,CACE,oBAAC,eAAD,EAAA,UACE,oBAAC,qBAAD,EAAA,UACE,oBAAC,KAAD,EAAK,UAAU,OAAO,SAAW,CAAA,EACd,CAAA,EACR,CAAA,GACd,OAAO,kBAAkB,oBAAC,oBAAD,EAAoB,eAAe,MAAQ,CAAA,CAClD;CACvB,CAAA,CAAA;AACF"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Full SPA boot. Loaded by `main.tsx` when the document is the top
|
|
3
|
+
* window (not an iframe-embedded editor surface). Mirrors the
|
|
4
|
+
* pre-iframe entry behavior — initializing the content API client,
|
|
5
|
+
* the QueryClient, and the providers around `<App>`.
|
|
6
|
+
*/
|
|
7
|
+
export declare function mountSpa(): void;
|
|
8
|
+
//# sourceMappingURL=main-spa.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main-spa.d.ts","sourceRoot":"","sources":["../src/main-spa.tsx"],"names":[],"mappings":"AAUA;;;;;GAKG;AACH,wBAAgB,QAAQ,IAAI,IAAI,CAwD/B"}
|
package/dist/main-spa.js
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ContentAPIClient, setContentAPIClient } from '@conloca/content-api-client';
|
|
3
|
+
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
|
4
|
+
import { ReactQueryDevtools } from '@tanstack/react-query-devtools';
|
|
5
|
+
import { createRoot } from 'react-dom/client';
|
|
6
|
+
import App from './App';
|
|
7
|
+
import { CanvasThemeProvider } from './hooks/useCanvasTheme';
|
|
8
|
+
import { ThemeProvider } from './hooks/useTheme';
|
|
9
|
+
import { getMdxComponents, setMdxComponents } from './mdx-components';
|
|
10
|
+
import { getUIConfig } from './ui-config';
|
|
11
|
+
/**
|
|
12
|
+
* Full SPA boot. Loaded by `main.tsx` when the document is the top
|
|
13
|
+
* window (not an iframe-embedded editor surface). Mirrors the
|
|
14
|
+
* pre-iframe entry behavior — initializing the content API client,
|
|
15
|
+
* the QueryClient, and the providers around `<App>`.
|
|
16
|
+
*/
|
|
17
|
+
export function mountSpa() {
|
|
18
|
+
const config = getUIConfig();
|
|
19
|
+
const contentAPIClient = new ContentAPIClient({
|
|
20
|
+
baseUrl: config.apiBaseUrl,
|
|
21
|
+
});
|
|
22
|
+
setContentAPIClient(contentAPIClient);
|
|
23
|
+
const queryClient = new QueryClient(config.queryClientOptions);
|
|
24
|
+
// The content-change listener (and the editor it drives) reach for
|
|
25
|
+
// these on the window — exposing both keeps cross-window bridging
|
|
26
|
+
// simple and lets the iframe-side editor reuse the parent's cache
|
|
27
|
+
// and API client without duplicating connections.
|
|
28
|
+
window.__QUERY_CLIENT__ = queryClient;
|
|
29
|
+
window.__CONTENT_API_CLIENT__ = contentAPIClient;
|
|
30
|
+
// Kick off the auto-discover registry fetch in the background.
|
|
31
|
+
// The integration's `/api/registry` endpoint scans the host's MDX
|
|
32
|
+
// content + configured component folders for JSX components.
|
|
33
|
+
// Merge those with whatever the schemas-loader virtual module
|
|
34
|
+
// already put in the registry (typically host-curated snippets
|
|
35
|
+
// and any non-JSX descriptors), with auto-discovered JSX entries
|
|
36
|
+
// winning on name collisions — they're derived from the source
|
|
37
|
+
// of truth (the MDX files themselves).
|
|
38
|
+
const cmsBase = (config.basename ?? '/__cms').replace(/\/+$/, '');
|
|
39
|
+
fetch(`${cmsBase}/api/registry`)
|
|
40
|
+
.then((res) => {
|
|
41
|
+
if (!res.ok)
|
|
42
|
+
throw new Error(`registry endpoint ${res.status}`);
|
|
43
|
+
return res.json();
|
|
44
|
+
})
|
|
45
|
+
.then((data) => {
|
|
46
|
+
if (!Array.isArray(data?.components))
|
|
47
|
+
return;
|
|
48
|
+
const discoveredNames = new Set(data.components.map((c) => c.name));
|
|
49
|
+
const existing = getMdxComponents().filter((c) => !discoveredNames.has(c.name));
|
|
50
|
+
setMdxComponents([...existing, ...data.components]);
|
|
51
|
+
})
|
|
52
|
+
.catch((err) => {
|
|
53
|
+
console.warn('[Conloca] auto-discover registry unavailable; using host-provided descriptors:', err);
|
|
54
|
+
});
|
|
55
|
+
const rootEl = document.getElementById('root');
|
|
56
|
+
if (!rootEl) {
|
|
57
|
+
console.error('[Conloca] #root not found');
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
createRoot(rootEl).render(_jsxs(QueryClientProvider, { client: queryClient, children: [_jsx(ThemeProvider, { children: _jsx(CanvasThemeProvider, { children: _jsx(App, { basename: config.basename }) }) }), config.enableDevtools && _jsx(ReactQueryDevtools, { initialIsOpen: false })] }));
|
|
61
|
+
}
|
package/dist/main.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {}
|
package/dist/main.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../src/main.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAE,CAAC"}
|
package/dist/main.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SPA boot entry.
|
|
3
|
+
*
|
|
4
|
+
* Single boot path: mounts the full CMS SPA (chrome + router + editor)
|
|
5
|
+
* in one React tree. The editor used to live inside a child iframe
|
|
6
|
+
* (`EditorFrame`) with its own React/Lexical realm — that has been
|
|
7
|
+
* removed. Lexical's cross-realm bugs (facebook/lexical#2108, #3534)
|
|
8
|
+
* were fixed in Lexical v0.7.3 (Dec 2022) and the bundled MDXEditor
|
|
9
|
+
* version is well past that; same-window mounting is the documented
|
|
10
|
+
* and supported configuration.
|
|
11
|
+
*/
|
|
12
|
+
import('./main-spa').then((m) => m.mountSpa());
|
|
13
|
+
export {};
|