@conloca/cms-spa 0.1.14 → 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 +165 -48
- 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 -4998
- 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 +9 -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 +123 -0
- package/dist/site-styles.d.mts.map +1 -0
- 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 +234 -0
- package/dist/site-styles.mjs.map +1 -0
- package/dist/spa/main.css +5497 -4371
- 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 +153 -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-CvjeYQRH.mjs +0 -1533
- package/dist/puck-CvjeYQRH.mjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ImagePickerDialog.d.ts","sourceRoot":"","sources":["../../../src/components/editor/ImagePickerDialog.tsx"],"names":[],"mappings":"AAOA;;;GAGG;AACH,wBAAgB,iBAAiB,4CAgBhC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// IMPORTANT: Import gurx hooks from @mdxeditor/editor, NOT from @mdxeditor/gurx directly.
|
|
3
|
+
// @mdxeditor/editor re-exports gurx, and using that ensures we get the same module instance
|
|
4
|
+
// as the editor internals, avoiding React context isolation issues.
|
|
5
|
+
import { closeImageDialog$, imageDialogState$, insertImage$, useCellValue, usePublisher } from '@mdxeditor/editor';
|
|
6
|
+
import { ImagePicker } from '../media/ImagePicker';
|
|
7
|
+
/**
|
|
8
|
+
* MDX-specific thin wrapper around ImagePicker.
|
|
9
|
+
* Bridges MDXEditor gurx signals to the generic ImagePicker component.
|
|
10
|
+
*/
|
|
11
|
+
export function ImagePickerDialog() {
|
|
12
|
+
const state = useCellValue(imageDialogState$);
|
|
13
|
+
const insertImage = usePublisher(insertImage$);
|
|
14
|
+
const closeDialog = usePublisher(closeImageDialog$);
|
|
15
|
+
const handleSelect = (asset) => {
|
|
16
|
+
// Build path per CONTEXT.md decision
|
|
17
|
+
const folder = asset.folder && asset.folder !== '/' ? asset.folder : '';
|
|
18
|
+
const path = `/assets${folder}/${asset.filename}`;
|
|
19
|
+
// Insert image at cursor - no alt text per CONTEXT.md
|
|
20
|
+
insertImage({ src: path });
|
|
21
|
+
closeDialog();
|
|
22
|
+
};
|
|
23
|
+
return _jsx(ImagePicker, { isOpen: state.type !== 'inactive', onSelect: handleSelect, onClose: () => closeDialog() });
|
|
24
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fixed-position right-side panel showing prop fields for the
|
|
3
|
+
* currently-selected MDX JSX block (Aside, Card, etc).
|
|
4
|
+
*
|
|
5
|
+
* Reads the selected block from the shared registry — `GenericBlock`
|
|
6
|
+
* publishes itself there on selection. The block's descriptor drives
|
|
7
|
+
* which form fields render; changes go back through the descriptor's
|
|
8
|
+
* bound `onPropChange` closure, which routes through the block's own
|
|
9
|
+
* `useMdastNodeUpdater` so the edit lands on the right mdast node.
|
|
10
|
+
*
|
|
11
|
+
* Renders nothing when no block is selected. The author still sees a
|
|
12
|
+
* clean content surface and can type freely; the panel only shows up
|
|
13
|
+
* when there's something to edit.
|
|
14
|
+
*/
|
|
15
|
+
export declare function JsxPropsPanel(): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
//# sourceMappingURL=JsxPropsPanel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"JsxPropsPanel.d.ts","sourceRoot":"","sources":["../../../src/components/editor/JsxPropsPanel.tsx"],"names":[],"mappings":"AAeA;;;;;;;;;;;;;GAaG;AACH,wBAAgB,aAAa,4CA0C5B"}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Trash2 } from 'lucide-react';
|
|
3
|
+
import { useEffect, useRef, useState } from 'react';
|
|
4
|
+
import { containsMarkdownMarkers } from '../../mdx-components';
|
|
5
|
+
import { useSelectedBlock } from '../../selected-block';
|
|
6
|
+
import { SearchableSelect } from './SearchableSelect';
|
|
7
|
+
/**
|
|
8
|
+
* Above this many options, swap the native `<select>` for the
|
|
9
|
+
* searchable combobox. Native selects are great up to ~20 entries
|
|
10
|
+
* (scroll + arrow keys are enough); beyond that, finding a value
|
|
11
|
+
* means scrolling through a wall of text. Starlight's `<Icon>` ships
|
|
12
|
+
* ~270 options — comfortably past this threshold.
|
|
13
|
+
*/
|
|
14
|
+
const SEARCHABLE_THRESHOLD = 20;
|
|
15
|
+
/**
|
|
16
|
+
* Fixed-position right-side panel showing prop fields for the
|
|
17
|
+
* currently-selected MDX JSX block (Aside, Card, etc).
|
|
18
|
+
*
|
|
19
|
+
* Reads the selected block from the shared registry — `GenericBlock`
|
|
20
|
+
* publishes itself there on selection. The block's descriptor drives
|
|
21
|
+
* which form fields render; changes go back through the descriptor's
|
|
22
|
+
* bound `onPropChange` closure, which routes through the block's own
|
|
23
|
+
* `useMdastNodeUpdater` so the edit lands on the right mdast node.
|
|
24
|
+
*
|
|
25
|
+
* Renders nothing when no block is selected. The author still sees a
|
|
26
|
+
* clean content surface and can type freely; the panel only shows up
|
|
27
|
+
* when there's something to edit.
|
|
28
|
+
*/
|
|
29
|
+
export function JsxPropsPanel() {
|
|
30
|
+
const selected = useSelectedBlock();
|
|
31
|
+
if (!selected) {
|
|
32
|
+
return (_jsx("aside", { className: "conloca-jsx-props-panel conloca-jsx-props-panel--empty", children: _jsx("p", { className: "conloca-jsx-props-panel__hint", children: "Select a component to edit its props." }) }));
|
|
33
|
+
}
|
|
34
|
+
const { descriptor, attrs, onPropChange, onRemove } = selected;
|
|
35
|
+
return (_jsxs("aside", { className: "conloca-jsx-props-panel", children: [_jsxs("header", { className: "conloca-jsx-props-panel__header", children: [_jsx("h3", { className: "conloca-jsx-props-panel__title", children: descriptor.name }), _jsxs("button", { type: "button", onClick: onRemove, "aria-label": `Remove ${descriptor.name}`, className: "conloca-jsx-props-panel__remove", children: [_jsx(Trash2, { size: 14, "aria-hidden": true }), " Remove"] })] }), descriptor.props && descriptor.props.length > 0 ? (_jsx("div", { className: "conloca-jsx-props-panel__fields", children: descriptor.props.map((prop) => (_jsx(PropField, { prop: prop, rawValue: attrs[prop.name], onChange: (next) => onPropChange(prop.name, next) }, prop.name))) })) : (_jsx("p", { className: "conloca-jsx-props-panel__hint", children: "No editable props." }))] }));
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* One field in the side panel, type-discriminated by `prop.type`:
|
|
39
|
+
*
|
|
40
|
+
* - `string` with options → `<select>` (immediate commit)
|
|
41
|
+
* - `string` without options → `<input type="text">` (commit on blur)
|
|
42
|
+
* - `boolean` → `<input type="checkbox">`
|
|
43
|
+
* - `number` → `<input type="number">` (commit on blur)
|
|
44
|
+
*
|
|
45
|
+
* Text and number inputs commit on blur (not per-keystroke) because
|
|
46
|
+
* each commit refocuses the editor's contenteditable — keystroke-
|
|
47
|
+
* committing would steal focus after every character. Checkboxes and
|
|
48
|
+
* selects commit immediately; their interactions are discrete.
|
|
49
|
+
*/
|
|
50
|
+
function PropField({ prop, rawValue, onChange }) {
|
|
51
|
+
const display = prop.label ?? prop.name;
|
|
52
|
+
const help = prop.help;
|
|
53
|
+
if (prop.type === 'boolean') {
|
|
54
|
+
// Truthy attrs.value (boolean shorthand, the string "true", an
|
|
55
|
+
// expression that evaluated to true) all → checked. Anything
|
|
56
|
+
// else → unchecked. Commit sends `true` for checked, `null` for
|
|
57
|
+
// unchecked — `writeAttribute` then encodes shorthand or removes
|
|
58
|
+
// the attribute entirely.
|
|
59
|
+
const checked = rawValue === true || rawValue === 'true';
|
|
60
|
+
return (_jsxs("label", { className: "conloca-jsx-props-panel__field conloca-jsx-props-panel__field--inline", children: [_jsx("input", { type: "checkbox", checked: checked, onChange: (e) => onChange(e.target.checked ? true : null), "aria-label": display }), _jsxs("span", { className: "conloca-jsx-props-panel__label", children: [display, prop.required && _jsx("em", { "aria-hidden": true, children: " *" })] }), help && _jsx("small", { className: "conloca-jsx-props-panel__help", children: help })] }));
|
|
61
|
+
}
|
|
62
|
+
if (prop.type === 'number') {
|
|
63
|
+
return (_jsxs("label", { className: "conloca-jsx-props-panel__field", children: [_jsxs("span", { className: "conloca-jsx-props-panel__label", children: [display, prop.required && _jsx("em", { "aria-hidden": true, children: " *" })] }), _jsx(NumberInput, { value: typeof rawValue === 'number' ? rawValue : typeof rawValue === 'string' ? Number(rawValue) : undefined, onCommit: (next) => onChange(next), ariaLabel: display }), help && _jsx("small", { className: "conloca-jsx-props-panel__help", children: help })] }));
|
|
64
|
+
}
|
|
65
|
+
// String (default). With options → select; without → text input.
|
|
66
|
+
const stringValue = typeof rawValue === 'string' ? rawValue : rawValue == null ? '' : String(rawValue);
|
|
67
|
+
// Mirror the inline-prop wiring's bail rule (see `containsMarkdownMarkers`
|
|
68
|
+
// in mdx-components). When the current value carries markdown, the
|
|
69
|
+
// SSR'd preview can't be edited in place — plaintext-only would strip
|
|
70
|
+
// the formatting — so the author edits here instead. The hint tells
|
|
71
|
+
// them why the inline affordance isn't lighting up for this prop.
|
|
72
|
+
const isMarkdown = containsMarkdownMarkers(stringValue);
|
|
73
|
+
return (_jsxs("label", { className: "conloca-jsx-props-panel__field", children: [_jsxs("span", { className: "conloca-jsx-props-panel__label", children: [display, prop.required && _jsx("em", { "aria-hidden": true, children: " *" })] }), prop.options && prop.options.length > 0 ? (prop.options.length > SEARCHABLE_THRESHOLD ? (_jsx(SearchableSelect, { options: prop.options, value: stringValue, onChange: (next) => onChange(next), placeholder: display, ariaLabel: display })) : (_jsxs("select", { value: stringValue, onChange: (e) => onChange(e.target.value), "aria-label": display, children: [_jsx("option", { value: "", children: "\u2014" }), prop.options.map((opt) => (_jsx("option", { value: opt.value, children: opt.label }, opt.value)))] }))) : (_jsx(TextInput, { value: stringValue, onCommit: (next) => onChange(next), placeholder: display, ariaLabel: display })), isMarkdown && (_jsx("small", { className: "conloca-jsx-props-panel__help conloca-jsx-props-panel__help--md", children: "Contains markdown \u2014 edit here, not inline." })), help && _jsx("small", { className: "conloca-jsx-props-panel__help", children: help })] }));
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Controlled text input with on-blur commit. Keeps a local draft so
|
|
77
|
+
* typing doesn't trigger the mdast-update → Lexical-refocus path
|
|
78
|
+
* mid-keystroke. Enter commits, Escape reverts. Resyncs when the
|
|
79
|
+
* external `value` changes (eg the inline editor committed for the
|
|
80
|
+
* same prop).
|
|
81
|
+
*/
|
|
82
|
+
function TextInput({ value, onCommit, placeholder, ariaLabel, }) {
|
|
83
|
+
const [draft, setDraft] = useState(value);
|
|
84
|
+
const committedRef = useRef(value);
|
|
85
|
+
useEffect(() => {
|
|
86
|
+
if (value !== committedRef.current) {
|
|
87
|
+
setDraft(value);
|
|
88
|
+
committedRef.current = value;
|
|
89
|
+
}
|
|
90
|
+
}, [value]);
|
|
91
|
+
const commit = () => {
|
|
92
|
+
if (draft !== committedRef.current) {
|
|
93
|
+
committedRef.current = draft;
|
|
94
|
+
onCommit(draft);
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
return (_jsx("input", { type: "text", value: draft, onChange: (e) => setDraft(e.target.value), onBlur: commit, onKeyDown: (e) => {
|
|
98
|
+
if (e.key === 'Enter') {
|
|
99
|
+
e.preventDefault();
|
|
100
|
+
commit();
|
|
101
|
+
}
|
|
102
|
+
else if (e.key === 'Escape') {
|
|
103
|
+
e.preventDefault();
|
|
104
|
+
setDraft(committedRef.current);
|
|
105
|
+
}
|
|
106
|
+
}, placeholder: placeholder, "aria-label": ariaLabel }));
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Number input with on-blur commit. Empty string → `null` (remove
|
|
110
|
+
* attribute). Same focus-preservation rationale as `TextInput`.
|
|
111
|
+
*/
|
|
112
|
+
function NumberInput({ value, onCommit, ariaLabel, }) {
|
|
113
|
+
const initial = value == null || Number.isNaN(value) ? '' : String(value);
|
|
114
|
+
const [draft, setDraft] = useState(initial);
|
|
115
|
+
const committedRef = useRef(initial);
|
|
116
|
+
useEffect(() => {
|
|
117
|
+
if (initial !== committedRef.current) {
|
|
118
|
+
setDraft(initial);
|
|
119
|
+
committedRef.current = initial;
|
|
120
|
+
}
|
|
121
|
+
}, [initial]);
|
|
122
|
+
const commit = () => {
|
|
123
|
+
if (draft === committedRef.current)
|
|
124
|
+
return;
|
|
125
|
+
committedRef.current = draft;
|
|
126
|
+
if (draft === '') {
|
|
127
|
+
onCommit(null);
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
const n = Number(draft);
|
|
131
|
+
if (!Number.isFinite(n))
|
|
132
|
+
return;
|
|
133
|
+
onCommit(n);
|
|
134
|
+
};
|
|
135
|
+
return (_jsx("input", { type: "number", value: draft, onChange: (e) => setDraft(e.target.value), onBlur: commit, onKeyDown: (e) => {
|
|
136
|
+
if (e.key === 'Enter') {
|
|
137
|
+
e.preventDefault();
|
|
138
|
+
commit();
|
|
139
|
+
}
|
|
140
|
+
else if (e.key === 'Escape') {
|
|
141
|
+
e.preventDefault();
|
|
142
|
+
setDraft(committedRef.current);
|
|
143
|
+
}
|
|
144
|
+
}, "aria-label": ariaLabel }));
|
|
145
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
interface LocaleSelectorProps {
|
|
2
|
+
currentLocale: string;
|
|
3
|
+
availableLocales: string[];
|
|
4
|
+
missingLocales?: string[];
|
|
5
|
+
onChange: (locale: string) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare function LocaleSelector({ currentLocale, availableLocales, missingLocales, onChange, }: LocaleSelectorProps): import("react/jsx-runtime").JSX.Element | null;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=LocaleSelector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LocaleSelector.d.ts","sourceRoot":"","sources":["../../../src/components/editor/LocaleSelector.tsx"],"names":[],"mappings":"AAIA,UAAU,mBAAmB;IAC3B,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CACpC;AAED,wBAAgB,cAAc,CAAC,EAC7B,aAAa,EACb,gBAAgB,EAChB,cAAmB,EACnB,QAAQ,GACT,EAAE,mBAAmB,kDAwCrB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as Select from '@radix-ui/react-select';
|
|
3
|
+
import { ChevronDown } from 'lucide-react';
|
|
4
|
+
import { cn } from '../../utils/cn';
|
|
5
|
+
export function LocaleSelector({ currentLocale, availableLocales, missingLocales = [], onChange, }) {
|
|
6
|
+
if (availableLocales.length <= 1)
|
|
7
|
+
return null;
|
|
8
|
+
return (_jsxs(Select.Root, { value: currentLocale, onValueChange: onChange, children: [_jsxs(Select.Trigger, { className: "flex items-center gap-1.5 px-3 py-1.5 rounded text-sm border border-line text-foreground hover:bg-hover transition-colors cursor-pointer", children: [_jsx(Select.Value, {}), _jsx(Select.Icon, { children: _jsx(ChevronDown, { className: "h-4 w-4 opacity-60" }) })] }), _jsx(Select.Portal, { children: _jsx(Select.Content, { className: "bg-overlay border border-line rounded-md shadow-md", style: { zIndex: 100 }, children: _jsx(Select.Viewport, { className: "p-1", children: availableLocales.map((locale) => {
|
|
9
|
+
const isCurrent = locale === currentLocale;
|
|
10
|
+
const isMissing = missingLocales.includes(locale);
|
|
11
|
+
return (_jsx(Select.Item, { value: locale, className: cn('px-3 py-2 rounded-md cursor-pointer outline-none transition-colors', isCurrent && 'bg-azure-04 text-white', !isCurrent && !isMissing && 'hover:bg-hover', isMissing && 'text-muted'), "data-testid": `locale-option-${locale}`, children: _jsx(Select.ItemText, { children: locale }) }, locale));
|
|
12
|
+
}) }) }) })] }));
|
|
13
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
interface MDXLivePreviewProps {
|
|
2
|
+
/** The raw MDX source the editor is currently holding. */
|
|
3
|
+
markdown: string;
|
|
4
|
+
/**
|
|
5
|
+
* Debounce window in ms before re-compiling the editor content into a
|
|
6
|
+
* preview component. ~300ms is the sweet spot — fast enough that the
|
|
7
|
+
* preview feels live, slow enough that compile traffic doesn't pile up
|
|
8
|
+
* mid-keystroke.
|
|
9
|
+
*/
|
|
10
|
+
debounceMs?: number;
|
|
11
|
+
}
|
|
12
|
+
export declare function MDXLivePreview({ markdown, debounceMs }: MDXLivePreviewProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=MDXLivePreview.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MDXLivePreview.d.ts","sourceRoot":"","sources":["../../../src/components/editor/MDXLivePreview.tsx"],"names":[],"mappings":"AAIA,UAAU,mBAAmB;IAC3B,0DAA0D;IAC1D,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AA2JD,wBAAgB,cAAc,CAAC,EAAE,QAAQ,EAAE,UAAgB,EAAE,EAAE,mBAAmB,2CAMjF"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useCompileMDX } from '@conloca/content-api-client';
|
|
3
|
+
import { useMDXEvaluation } from '@conloca/mdx';
|
|
4
|
+
import React, { useEffect, useState } from 'react';
|
|
5
|
+
/**
|
|
6
|
+
* Render an MDX string side-by-side with the editor.
|
|
7
|
+
*
|
|
8
|
+
* Reuses the same compile + evaluate chain that powers `MDXContent.tsx`
|
|
9
|
+
* (which renders saved blocks inside the Puck preview). Three differences:
|
|
10
|
+
*
|
|
11
|
+
* 1. Source is the editor's live `markdown` value rather than a saved
|
|
12
|
+
* `LocalizedEntry`, so we debounce updates to keep the compile
|
|
13
|
+
* pipeline calm while the user is typing.
|
|
14
|
+
* 2. The cache key follows the markdown content rather than the entry's
|
|
15
|
+
* etag — every distinct snapshot gets its own cache slot, so toggling
|
|
16
|
+
* the preview off/on doesn't re-compile identical source.
|
|
17
|
+
* 3. Parse/eval errors render inline as a small banner (instead of the
|
|
18
|
+
* full-block error card MDXContent.tsx uses) so the preview pane stays
|
|
19
|
+
* readable while the author fixes their syntax.
|
|
20
|
+
*/
|
|
21
|
+
class PreviewErrorBoundary extends React.Component {
|
|
22
|
+
constructor(props) {
|
|
23
|
+
super(props);
|
|
24
|
+
this.state = { hasError: false };
|
|
25
|
+
}
|
|
26
|
+
static getDerivedStateFromError(error) {
|
|
27
|
+
return { hasError: true, error };
|
|
28
|
+
}
|
|
29
|
+
componentDidCatch(error, errorInfo) {
|
|
30
|
+
console.error('[MDXLivePreview] render error:', error, errorInfo);
|
|
31
|
+
}
|
|
32
|
+
componentDidUpdate(prevProps) {
|
|
33
|
+
// Reset the boundary whenever the source changes — the next render is
|
|
34
|
+
// a fresh compile result, so a previously-thrown error shouldn't stick.
|
|
35
|
+
if (prevProps.children !== this.props.children && this.state.hasError) {
|
|
36
|
+
this.setState({ hasError: false, error: undefined });
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
render() {
|
|
40
|
+
if (this.state.hasError) {
|
|
41
|
+
return (_jsxs("div", { className: "m-4 p-3 rounded-md border border-red-08 bg-red-11 dark:bg-red-02 dark:border-red-03 text-sm text-red-04 dark:text-red-08", children: [_jsx("p", { className: "font-semibold mb-1", children: "Preview failed to render" }), _jsx("p", { className: "text-xs", children: this.state.error?.message ?? 'Unknown error' })] }));
|
|
42
|
+
}
|
|
43
|
+
return this.props.children;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
function useDebouncedValue(value, delayMs) {
|
|
47
|
+
const [debounced, setDebounced] = useState(value);
|
|
48
|
+
useEffect(() => {
|
|
49
|
+
const handle = setTimeout(() => setDebounced(value), delayMs);
|
|
50
|
+
return () => clearTimeout(handle);
|
|
51
|
+
}, [value, delayMs]);
|
|
52
|
+
return debounced;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Detect ESM `import` / `export` statements at the top level. The server-side
|
|
56
|
+
* `compileMDX` runs with `outputFormat: 'function-body'`, which can't resolve
|
|
57
|
+
* those without a `baseUrl`. Rather than letting MDX bubble up a cryptic
|
|
58
|
+
* "missing options.baseUrl" error, we short-circuit with a friendly message
|
|
59
|
+
* — the editor itself still works fine.
|
|
60
|
+
*
|
|
61
|
+
* Page-level content (which may `import` JSX components scoped by the host
|
|
62
|
+
* site's MDX provider) no longer reaches this component — the page editor
|
|
63
|
+
* renders without a preview pane. The guard remains for blocks, where a
|
|
64
|
+
* user might paste in a stray import while drafting; the message below is
|
|
65
|
+
* block-appropriate.
|
|
66
|
+
*/
|
|
67
|
+
function hasTopLevelImportsOrExports(source) {
|
|
68
|
+
return /^[ \t]*(?:import|export)\s/m.test(source);
|
|
69
|
+
}
|
|
70
|
+
function MDXLivePreviewInner({ markdown, debounceMs }) {
|
|
71
|
+
const debouncedMarkdown = useDebouncedValue(markdown, debounceMs);
|
|
72
|
+
const mdxContent = debouncedMarkdown.length > 0 ? debouncedMarkdown : null;
|
|
73
|
+
const hasImports = mdxContent ? hasTopLevelImportsOrExports(mdxContent) : false;
|
|
74
|
+
// Hash-free cache key. The compile hook treats this purely as an identity
|
|
75
|
+
// marker, so a substring suffix is enough to avoid collisions in practice
|
|
76
|
+
// while keeping the key cheap to compute.
|
|
77
|
+
const cacheKey = `live:${debouncedMarkdown.length}:${debouncedMarkdown.slice(0, 64)}`;
|
|
78
|
+
// Skip the server compile call when we know it'll fail (top-level imports
|
|
79
|
+
// need a baseUrl that `function-body` output doesn't get) — keeps the
|
|
80
|
+
// network panel clean and shows the friendly message immediately below.
|
|
81
|
+
const { data: compiledResult, error: compileError, isLoading: isCompiling, } = useCompileMDX({ mdxContent: hasImports ? null : mdxContent, cacheKey });
|
|
82
|
+
const { Component, error: evaluationError, isLoading: isEvaluating, } = useMDXEvaluation({
|
|
83
|
+
compiledCode: compiledResult?.code ?? null,
|
|
84
|
+
cacheKey,
|
|
85
|
+
});
|
|
86
|
+
if (!mdxContent) {
|
|
87
|
+
return (_jsx("div", { className: "p-6 text-sm text-grey-05 dark:text-grey-07", children: _jsx("p", { children: "Start writing to see a live preview." }) }));
|
|
88
|
+
}
|
|
89
|
+
if (hasImports) {
|
|
90
|
+
return (_jsxs("div", { className: "m-4 p-3 rounded-md border border-yellow-08 bg-yellow-11 dark:bg-yellow-02 dark:border-yellow-03 text-sm text-yellow-02 dark:text-yellow-09", children: [_jsx("p", { className: "font-semibold mb-1", children: "Preview unavailable" }), _jsxs("p", { className: "text-xs", children: ["The preview can't compile ", _jsx("code", { children: "import" }), " / ", _jsx("code", { children: "export" }), " statements. Remove them so this block stays previewable."] })] }));
|
|
91
|
+
}
|
|
92
|
+
if (compileError || evaluationError) {
|
|
93
|
+
const error = compileError ?? evaluationError;
|
|
94
|
+
return (_jsxs("div", { className: "m-4 p-3 rounded-md border border-red-08 bg-red-11 dark:bg-red-02 dark:border-red-03 text-sm text-red-04 dark:text-red-08", children: [_jsx("p", { className: "font-semibold mb-1", children: "MDX error" }), _jsx("p", { className: "text-xs whitespace-pre-wrap", children: error?.message })] }));
|
|
95
|
+
}
|
|
96
|
+
if (isCompiling || isEvaluating || !Component) {
|
|
97
|
+
return (_jsxs("div", { className: "p-6 text-sm text-grey-05 dark:text-grey-07 flex items-center gap-2", children: [_jsx("div", { className: "animate-spin rounded-full h-4 w-4 border-b-2 border-azure-04" }), _jsx("span", { children: "Compiling preview\u2026" })] }));
|
|
98
|
+
}
|
|
99
|
+
return (_jsx("div", { className: "mdx-content conloca-prose max-w-none p-6", children: _jsx(Component, {}) }));
|
|
100
|
+
}
|
|
101
|
+
export function MDXLivePreview({ markdown, debounceMs = 300 }) {
|
|
102
|
+
return (_jsx(PreviewErrorBoundary, { children: _jsx(MDXLivePreviewInner, { markdown: markdown, debounceMs: debounceMs }) }));
|
|
103
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Page editor for kind:'page' + type:'mdx' entries.
|
|
3
|
+
*
|
|
4
|
+
* Inline page layout. Routed via /pages/:id which lives outside CMSLayout,
|
|
5
|
+
* so the editor occupies the full viewport. The sister flow for blocks
|
|
6
|
+
* lives in BlockEditor.tsx — same shape, different back target and
|
|
7
|
+
* filePath label.
|
|
8
|
+
*/
|
|
9
|
+
export declare function MdxPageEditor(): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
//# sourceMappingURL=MdxPageEditor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MdxPageEditor.d.ts","sourceRoot":"","sources":["../../../src/components/editor/MdxPageEditor.tsx"],"names":[],"mappings":"AA0BA;;;;;;;GAOG;AACH,wBAAgB,aAAa,4CA+b5B"}
|