@conloca/cms-spa 0.1.15 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/spa/main.css +4078 -3571
- package/dist/ts/App.d.ts +35 -0
- package/dist/ts/App.d.ts.map +1 -0
- package/dist/ts/App.js +53 -0
- package/dist/ts/App.js.map +1 -0
- package/dist/ts/CmsSpaApp.d.ts +13 -0
- package/dist/ts/CmsSpaApp.d.ts.map +1 -0
- package/dist/ts/CmsSpaApp.js +50 -0
- package/dist/ts/CmsSpaApp.js.map +1 -0
- package/dist/ts/components/CMSDashboard.d.ts +2 -0
- package/dist/ts/components/CMSDashboard.d.ts.map +1 -0
- package/dist/ts/components/CMSDashboard.js +21 -0
- package/dist/ts/components/CMSDashboard.js.map +1 -0
- package/dist/ts/components/CMSLayout.d.ts +2 -0
- package/dist/ts/components/CMSLayout.d.ts.map +1 -0
- package/dist/ts/components/CMSLayout.js +15 -0
- package/dist/ts/components/CMSLayout.js.map +1 -0
- package/dist/ts/components/ConlocaLogo.d.ts +2 -0
- package/dist/ts/components/ConlocaLogo.d.ts.map +1 -0
- package/dist/ts/components/ConlocaLogo.js +5 -0
- package/dist/ts/components/ConlocaLogo.js.map +1 -0
- package/dist/ts/components/GitStatusPanel.d.ts +21 -0
- package/dist/ts/components/GitStatusPanel.d.ts.map +1 -0
- package/dist/ts/components/GitStatusPanel.js +74 -0
- package/dist/ts/components/GitStatusPanel.js.map +1 -0
- package/dist/ts/components/MobileTopBar.d.ts +6 -0
- package/dist/ts/components/MobileTopBar.d.ts.map +1 -0
- package/dist/ts/components/MobileTopBar.js +7 -0
- package/dist/ts/components/MobileTopBar.js.map +1 -0
- package/dist/ts/components/Sidebar.d.ts +8 -0
- package/dist/ts/components/Sidebar.d.ts.map +1 -0
- package/dist/ts/components/Sidebar.js +41 -0
- package/dist/ts/components/Sidebar.js.map +1 -0
- package/dist/ts/components/UserAvatar.d.ts +2 -0
- package/dist/ts/components/UserAvatar.d.ts.map +1 -0
- package/dist/ts/components/UserAvatar.js +15 -0
- package/dist/ts/components/UserAvatar.js.map +1 -0
- package/dist/ts/components/cards/DataEntryCard.d.ts +14 -0
- package/dist/ts/components/cards/DataEntryCard.d.ts.map +1 -0
- package/dist/ts/components/cards/DataEntryCard.js +39 -0
- package/dist/ts/components/cards/DataEntryCard.js.map +1 -0
- package/dist/ts/components/cards/SectionCard.d.ts +15 -0
- package/dist/ts/components/cards/SectionCard.d.ts.map +1 -0
- package/dist/ts/components/cards/SectionCard.js +11 -0
- package/dist/ts/components/cards/SectionCard.js.map +1 -0
- package/dist/ts/components/cards/index.d.ts +2 -0
- package/dist/ts/components/cards/index.d.ts.map +1 -0
- package/dist/ts/components/cards/index.js +2 -0
- package/dist/ts/components/cards/index.js.map +1 -0
- package/dist/ts/components/dashboard/RecentActivity.d.ts +2 -0
- package/dist/ts/components/dashboard/RecentActivity.d.ts.map +1 -0
- package/dist/ts/components/dashboard/RecentActivity.js +58 -0
- package/dist/ts/components/dashboard/RecentActivity.js.map +1 -0
- package/dist/ts/components/dialog.d.ts +53 -0
- package/dist/ts/components/dialog.d.ts.map +1 -0
- package/dist/ts/components/dialog.js +57 -0
- package/dist/ts/components/dialog.js.map +1 -0
- package/dist/ts/components/dialogs/ConflictDialog.d.ts +10 -0
- package/dist/ts/components/dialogs/ConflictDialog.d.ts.map +1 -0
- package/dist/ts/components/dialogs/ConflictDialog.js +28 -0
- package/dist/ts/components/dialogs/ConflictDialog.js.map +1 -0
- package/dist/ts/components/dialogs/CreateDataDialog.d.ts +9 -0
- package/dist/ts/components/dialogs/CreateDataDialog.d.ts.map +1 -0
- package/dist/ts/components/dialogs/CreateDataDialog.js +21 -0
- package/dist/ts/components/dialogs/CreateDataDialog.js.map +1 -0
- package/dist/ts/components/dialogs/CreateFolderDialog.d.ts +11 -0
- package/dist/ts/components/dialogs/CreateFolderDialog.d.ts.map +1 -0
- package/dist/ts/components/dialogs/CreateFolderDialog.js +39 -0
- package/dist/ts/components/dialogs/CreateFolderDialog.js.map +1 -0
- package/dist/ts/components/dialogs/CreatePageDialog.d.ts +11 -0
- package/dist/ts/components/dialogs/CreatePageDialog.d.ts.map +1 -0
- package/dist/ts/components/dialogs/CreatePageDialog.js +237 -0
- package/dist/ts/components/dialogs/CreatePageDialog.js.map +1 -0
- package/dist/ts/components/dialogs/DataPropertiesDialog.d.ts +10 -0
- package/dist/ts/components/dialogs/DataPropertiesDialog.d.ts.map +1 -0
- package/dist/ts/components/dialogs/DataPropertiesDialog.js +39 -0
- package/dist/ts/components/dialogs/DataPropertiesDialog.js.map +1 -0
- package/dist/ts/components/dialogs/DeleteConfirmDialog.d.ts +12 -0
- package/dist/ts/components/dialogs/DeleteConfirmDialog.d.ts.map +1 -0
- package/dist/ts/components/dialogs/DeleteConfirmDialog.js +8 -0
- package/dist/ts/components/dialogs/DeleteConfirmDialog.js.map +1 -0
- package/dist/ts/components/dialogs/ErrorModal.d.ts +14 -0
- package/dist/ts/components/dialogs/ErrorModal.d.ts.map +1 -0
- package/dist/ts/components/dialogs/ErrorModal.js +43 -0
- package/dist/ts/components/dialogs/ErrorModal.js.map +1 -0
- package/dist/ts/components/dialogs/FragmentPropertiesDialog.d.ts +12 -0
- package/dist/ts/components/dialogs/FragmentPropertiesDialog.d.ts.map +1 -0
- package/dist/ts/components/dialogs/FragmentPropertiesDialog.js +43 -0
- package/dist/ts/components/dialogs/FragmentPropertiesDialog.js.map +1 -0
- package/dist/ts/components/dialogs/MoveFolderDialog.d.ts +12 -0
- package/dist/ts/components/dialogs/MoveFolderDialog.d.ts.map +1 -0
- package/dist/ts/components/dialogs/MoveFolderDialog.js +69 -0
- package/dist/ts/components/dialogs/MoveFolderDialog.js.map +1 -0
- package/dist/ts/components/dialogs/PageMetadataDialog.d.ts +31 -0
- package/dist/ts/components/dialogs/PageMetadataDialog.d.ts.map +1 -0
- package/dist/ts/components/dialogs/PageMetadataDialog.js +154 -0
- package/dist/ts/components/dialogs/PageMetadataDialog.js.map +1 -0
- package/dist/ts/components/dialogs/UnsavedChangesDialog.d.ts +8 -0
- package/dist/ts/components/dialogs/UnsavedChangesDialog.d.ts.map +1 -0
- package/dist/ts/components/dialogs/UnsavedChangesDialog.js +7 -0
- package/dist/ts/components/dialogs/UnsavedChangesDialog.js.map +1 -0
- package/dist/ts/components/dialogs/index.d.ts +9 -0
- package/dist/ts/components/dialogs/index.d.ts.map +1 -0
- package/dist/ts/components/dialogs/index.js +9 -0
- package/dist/ts/components/dialogs/index.js.map +1 -0
- package/dist/ts/components/editor/CMSMDXEditor.d.ts +14 -0
- package/dist/ts/components/editor/CMSMDXEditor.d.ts.map +1 -0
- package/dist/ts/components/editor/CMSMDXEditor.js +209 -0
- package/dist/ts/components/editor/CMSMDXEditor.js.map +1 -0
- package/dist/ts/components/editor/ContentDiff.d.ts +10 -0
- package/dist/ts/components/editor/ContentDiff.d.ts.map +1 -0
- package/dist/ts/components/editor/ContentDiff.js +52 -0
- package/dist/ts/components/editor/ContentDiff.js.map +1 -0
- package/dist/ts/components/editor/CreateFragmentDialog.d.ts +26 -0
- package/dist/ts/components/editor/CreateFragmentDialog.d.ts.map +1 -0
- package/dist/ts/components/editor/CreateFragmentDialog.js +159 -0
- package/dist/ts/components/editor/CreateFragmentDialog.js.map +1 -0
- package/dist/ts/components/editor/DrawerItemOverride.d.ts +8 -0
- package/dist/ts/components/editor/DrawerItemOverride.d.ts.map +1 -0
- package/dist/ts/components/editor/DrawerItemOverride.js +37 -0
- package/dist/ts/components/editor/DrawerItemOverride.js.map +1 -0
- package/dist/ts/components/editor/EditorChromeToggles.d.ts +16 -0
- package/dist/ts/components/editor/EditorChromeToggles.d.ts.map +1 -0
- package/dist/ts/components/editor/EditorChromeToggles.js +17 -0
- package/dist/ts/components/editor/EditorChromeToggles.js.map +1 -0
- package/dist/ts/components/editor/FragmentEditor.d.ts +15 -0
- package/dist/ts/components/editor/FragmentEditor.d.ts.map +1 -0
- package/dist/ts/components/editor/FragmentEditor.js +322 -0
- package/dist/ts/components/editor/FragmentEditor.js.map +1 -0
- package/dist/ts/components/editor/FragmentWrappers.d.ts +20 -0
- package/dist/ts/components/editor/FragmentWrappers.d.ts.map +1 -0
- package/dist/ts/components/editor/FragmentWrappers.js +44 -0
- package/dist/ts/components/editor/FragmentWrappers.js.map +1 -0
- package/dist/ts/components/editor/GenericBlock.d.ts +3 -0
- package/dist/ts/components/editor/GenericBlock.d.ts.map +1 -0
- package/dist/ts/components/editor/GenericBlock.js +1124 -0
- package/dist/ts/components/editor/GenericBlock.js.map +1 -0
- package/dist/ts/components/editor/ImagePickerDialog.d.ts +6 -0
- package/dist/ts/components/editor/ImagePickerDialog.d.ts.map +1 -0
- package/dist/ts/components/editor/ImagePickerDialog.js +23 -0
- package/dist/ts/components/editor/ImagePickerDialog.js.map +1 -0
- package/dist/ts/components/editor/JsxPropsPanel.d.ts +16 -0
- package/dist/ts/components/editor/JsxPropsPanel.d.ts.map +1 -0
- package/dist/ts/components/editor/JsxPropsPanel.js +146 -0
- package/dist/ts/components/editor/JsxPropsPanel.js.map +1 -0
- package/dist/ts/components/editor/LocaleSelector.d.ts +9 -0
- package/dist/ts/components/editor/LocaleSelector.d.ts.map +1 -0
- package/dist/ts/components/editor/LocaleSelector.js +14 -0
- package/dist/ts/components/editor/LocaleSelector.js.map +1 -0
- package/dist/ts/components/editor/MDXLivePreview.d.ts +15 -0
- package/dist/ts/components/editor/MDXLivePreview.d.ts.map +1 -0
- package/dist/ts/components/editor/MDXLivePreview.js +111 -0
- package/dist/ts/components/editor/MDXLivePreview.js.map +1 -0
- package/dist/ts/components/editor/MdxPageEditor.d.ts +10 -0
- package/dist/ts/components/editor/MdxPageEditor.d.ts.map +1 -0
- package/dist/ts/components/editor/MdxPageEditor.js +353 -0
- package/dist/ts/components/editor/MdxPageEditor.js.map +1 -0
- package/dist/ts/components/editor/PageEditor.d.ts +54 -0
- package/dist/ts/components/editor/PageEditor.d.ts.map +1 -0
- package/dist/ts/components/editor/PageEditor.js +399 -0
- package/dist/ts/components/editor/PageEditor.js.map +1 -0
- package/dist/ts/components/editor/PageEditorHeaderActions.d.ts +22 -0
- package/dist/ts/components/editor/PageEditorHeaderActions.d.ts.map +1 -0
- package/dist/ts/components/editor/PageEditorHeaderActions.js +24 -0
- package/dist/ts/components/editor/PageEditorHeaderActions.js.map +1 -0
- package/dist/ts/components/editor/PageEditorWrapper.d.ts +38 -0
- package/dist/ts/components/editor/PageEditorWrapper.d.ts.map +1 -0
- package/dist/ts/components/editor/PageEditorWrapper.js +360 -0
- package/dist/ts/components/editor/PageEditorWrapper.js.map +1 -0
- package/dist/ts/components/editor/PuckWithUntouchedMetadata.d.ts +5 -0
- package/dist/ts/components/editor/PuckWithUntouchedMetadata.d.ts.map +1 -0
- package/dist/ts/components/editor/PuckWithUntouchedMetadata.js +53 -0
- package/dist/ts/components/editor/PuckWithUntouchedMetadata.js.map +1 -0
- package/dist/ts/components/editor/SearchableSelect.d.ts +34 -0
- package/dist/ts/components/editor/SearchableSelect.d.ts.map +1 -0
- package/dist/ts/components/editor/SearchableSelect.js +116 -0
- package/dist/ts/components/editor/SearchableSelect.js.map +1 -0
- package/dist/ts/components/editor/host-wrapper-plugin.d.ts +51 -0
- package/dist/ts/components/editor/host-wrapper-plugin.d.ts.map +1 -0
- package/dist/ts/components/editor/host-wrapper-plugin.js +38 -0
- package/dist/ts/components/editor/host-wrapper-plugin.js.map +1 -0
- package/dist/ts/components/editor/index.d.ts +9 -0
- package/dist/ts/components/editor/index.d.ts.map +1 -0
- package/dist/ts/components/editor/index.js +8 -0
- package/dist/ts/components/editor/index.js.map +1 -0
- package/dist/ts/components/editor/insert-menu/InsertMdxComponentButton.d.ts +15 -0
- package/dist/ts/components/editor/insert-menu/InsertMdxComponentButton.d.ts.map +1 -0
- package/dist/ts/components/editor/insert-menu/InsertMdxComponentButton.js +91 -0
- package/dist/ts/components/editor/insert-menu/InsertMdxComponentButton.js.map +1 -0
- package/dist/ts/components/editor/insert-menu/SlashMenuPlugin.d.ts +12 -0
- package/dist/ts/components/editor/insert-menu/SlashMenuPlugin.d.ts.map +1 -0
- package/dist/ts/components/editor/insert-menu/SlashMenuPlugin.js +107 -0
- package/dist/ts/components/editor/insert-menu/SlashMenuPlugin.js.map +1 -0
- package/dist/ts/components/editor/insert-menu/insert-payload.d.ts +76 -0
- package/dist/ts/components/editor/insert-menu/insert-payload.d.ts.map +1 -0
- package/dist/ts/components/editor/insert-menu/insert-payload.js +95 -0
- package/dist/ts/components/editor/insert-menu/insert-payload.js.map +1 -0
- package/dist/ts/components/editor/insert-menu/mdx-components-plugin.d.ts +8 -0
- package/dist/ts/components/editor/insert-menu/mdx-components-plugin.d.ts.map +1 -0
- package/dist/ts/components/editor/insert-menu/mdx-components-plugin.js +14 -0
- package/dist/ts/components/editor/insert-menu/mdx-components-plugin.js.map +1 -0
- package/dist/ts/components/editor/page-setting-targets.d.ts +24 -0
- package/dist/ts/components/editor/page-setting-targets.d.ts.map +1 -0
- package/dist/ts/components/editor/page-setting-targets.js +124 -0
- package/dist/ts/components/editor/page-setting-targets.js.map +1 -0
- package/dist/ts/components/editor/preview-availability.d.ts +18 -0
- package/dist/ts/components/editor/preview-availability.d.ts.map +1 -0
- package/dist/ts/components/editor/preview-availability.js +18 -0
- package/dist/ts/components/editor/preview-availability.js.map +1 -0
- package/dist/ts/components/editors/DataEditor.d.ts +18 -0
- package/dist/ts/components/editors/DataEditor.d.ts.map +1 -0
- package/dist/ts/components/editors/DataEditor.js +140 -0
- package/dist/ts/components/editors/DataEditor.js.map +1 -0
- package/dist/ts/components/fields/ContentFragmentSelectorField.d.ts +14 -0
- package/dist/ts/components/fields/ContentFragmentSelectorField.d.ts.map +1 -0
- package/dist/ts/components/fields/ContentFragmentSelectorField.js +108 -0
- package/dist/ts/components/fields/ContentFragmentSelectorField.js.map +1 -0
- package/dist/ts/components/fields/ImageField.d.ts +17 -0
- package/dist/ts/components/fields/ImageField.d.ts.map +1 -0
- package/dist/ts/components/fields/ImageField.js +39 -0
- package/dist/ts/components/fields/ImageField.js.map +1 -0
- package/dist/ts/components/fields/MDXEditField.d.ts +17 -0
- package/dist/ts/components/fields/MDXEditField.d.ts.map +1 -0
- package/dist/ts/components/fields/MDXEditField.js +29 -0
- package/dist/ts/components/fields/MDXEditField.js.map +1 -0
- package/dist/ts/components/forms/ChipArrayField.d.ts +12 -0
- package/dist/ts/components/forms/ChipArrayField.d.ts.map +1 -0
- package/dist/ts/components/forms/ChipArrayField.js +39 -0
- package/dist/ts/components/forms/ChipArrayField.js.map +1 -0
- package/dist/ts/components/forms/HintForm.d.ts +22 -0
- package/dist/ts/components/forms/HintForm.d.ts.map +1 -0
- package/dist/ts/components/forms/HintForm.js +195 -0
- package/dist/ts/components/forms/HintForm.js.map +1 -0
- package/dist/ts/components/forms/SchemaForm.d.ts +15 -0
- package/dist/ts/components/forms/SchemaForm.d.ts.map +1 -0
- package/dist/ts/components/forms/SchemaForm.js +103 -0
- package/dist/ts/components/forms/SchemaForm.js.map +1 -0
- package/dist/ts/components/index.d.ts +8 -0
- package/dist/ts/components/index.d.ts.map +1 -0
- package/dist/ts/components/index.js +14 -0
- package/dist/ts/components/index.js.map +1 -0
- package/dist/ts/components/media/AssetCard.d.ts +14 -0
- package/dist/ts/components/media/AssetCard.d.ts.map +1 -0
- package/dist/ts/components/media/AssetCard.js +26 -0
- package/dist/ts/components/media/AssetCard.js.map +1 -0
- package/dist/ts/components/media/AssetDetailSidebar.d.ts +15 -0
- package/dist/ts/components/media/AssetDetailSidebar.d.ts.map +1 -0
- package/dist/ts/components/media/AssetDetailSidebar.js +122 -0
- package/dist/ts/components/media/AssetDetailSidebar.js.map +1 -0
- package/dist/ts/components/media/BulkActionBar.d.ts +9 -0
- package/dist/ts/components/media/BulkActionBar.d.ts.map +1 -0
- package/dist/ts/components/media/BulkActionBar.js +9 -0
- package/dist/ts/components/media/BulkActionBar.js.map +1 -0
- package/dist/ts/components/media/FolderNav.d.ts +7 -0
- package/dist/ts/components/media/FolderNav.d.ts.map +1 -0
- package/dist/ts/components/media/FolderNav.js +13 -0
- package/dist/ts/components/media/FolderNav.js.map +1 -0
- package/dist/ts/components/media/FolderTreeSidebar.d.ts +9 -0
- package/dist/ts/components/media/FolderTreeSidebar.d.ts.map +1 -0
- package/dist/ts/components/media/FolderTreeSidebar.js +46 -0
- package/dist/ts/components/media/FolderTreeSidebar.js.map +1 -0
- package/dist/ts/components/media/ImagePicker.d.ts +14 -0
- package/dist/ts/components/media/ImagePicker.d.ts.map +1 -0
- package/dist/ts/components/media/ImagePicker.js +44 -0
- package/dist/ts/components/media/ImagePicker.js.map +1 -0
- package/dist/ts/components/media/MediaLibrary.d.ts +31 -0
- package/dist/ts/components/media/MediaLibrary.d.ts.map +1 -0
- package/dist/ts/components/media/MediaLibrary.js +87 -0
- package/dist/ts/components/media/MediaLibrary.js.map +1 -0
- package/dist/ts/components/media/MediaToolbar.d.ts +21 -0
- package/dist/ts/components/media/MediaToolbar.d.ts.map +1 -0
- package/dist/ts/components/media/MediaToolbar.js +7 -0
- package/dist/ts/components/media/MediaToolbar.js.map +1 -0
- package/dist/ts/components/media/UploadModal.d.ts +9 -0
- package/dist/ts/components/media/UploadModal.d.ts.map +1 -0
- package/dist/ts/components/media/UploadModal.js +36 -0
- package/dist/ts/components/media/UploadModal.js.map +1 -0
- package/dist/ts/components/media/index.d.ts +10 -0
- package/dist/ts/components/media/index.d.ts.map +1 -0
- package/dist/ts/components/media/index.js +10 -0
- package/dist/ts/components/media/index.js.map +1 -0
- package/dist/ts/components/pages/DataList.d.ts +7 -0
- package/dist/ts/components/pages/DataList.d.ts.map +1 -0
- package/dist/ts/components/pages/DataList.js +267 -0
- package/dist/ts/components/pages/DataList.js.map +1 -0
- package/dist/ts/components/pages/FragmentList.d.ts +2 -0
- package/dist/ts/components/pages/FragmentList.d.ts.map +1 -0
- package/dist/ts/components/pages/FragmentList.js +281 -0
- package/dist/ts/components/pages/FragmentList.js.map +1 -0
- package/dist/ts/components/pages/MediaPage.d.ts +8 -0
- package/dist/ts/components/pages/MediaPage.d.ts.map +1 -0
- package/dist/ts/components/pages/MediaPage.js +146 -0
- package/dist/ts/components/pages/MediaPage.js.map +1 -0
- package/dist/ts/components/pages/PageList.d.ts +7 -0
- package/dist/ts/components/pages/PageList.d.ts.map +1 -0
- package/dist/ts/components/pages/PageList.js +299 -0
- package/dist/ts/components/pages/PageList.js.map +1 -0
- package/dist/ts/components/pages/index.d.ts +3 -0
- package/dist/ts/components/pages/index.d.ts.map +1 -0
- package/dist/ts/components/pages/index.js +3 -0
- package/dist/ts/components/pages/index.js.map +1 -0
- package/dist/ts/components/puck/MDXContent.d.ts +19 -0
- package/dist/ts/components/puck/MDXContent.d.ts.map +1 -0
- package/dist/ts/components/puck/MDXContent.js +110 -0
- package/dist/ts/components/puck/MDXContent.js.map +1 -0
- package/dist/ts/components/puck/index.d.ts +2 -0
- package/dist/ts/components/puck/index.d.ts.map +1 -0
- package/dist/ts/components/puck/index.js +2 -0
- package/dist/ts/components/puck/index.js.map +1 -0
- package/dist/ts/components/sandbox/ContentSandbox.d.ts +31 -0
- package/dist/ts/components/sandbox/ContentSandbox.d.ts.map +1 -0
- package/dist/ts/components/sandbox/ContentSandbox.js +148 -0
- package/dist/ts/components/sandbox/ContentSandbox.js.map +1 -0
- package/dist/ts/components/sandbox/frame-runtime.d.ts +7 -0
- package/dist/ts/components/sandbox/frame-runtime.d.ts.map +1 -0
- package/dist/ts/components/sandbox/frame-runtime.js +7 -0
- package/dist/ts/components/sandbox/frame-runtime.js.map +1 -0
- package/dist/ts/components/toast.d.ts +44 -0
- package/dist/ts/components/toast.d.ts.map +1 -0
- package/dist/ts/components/toast.js +8 -0
- package/dist/ts/components/toast.js.map +1 -0
- package/dist/ts/components/ui/Banner.d.ts +76 -0
- package/dist/ts/components/ui/Banner.d.ts.map +1 -0
- package/dist/ts/components/ui/Banner.js +50 -0
- package/dist/ts/components/ui/Banner.js.map +1 -0
- package/dist/ts/components/ui/Button.d.ts +25 -0
- package/dist/ts/components/ui/Button.d.ts.map +1 -0
- package/dist/ts/components/ui/Button.js +34 -0
- package/dist/ts/components/ui/Button.js.map +1 -0
- package/dist/ts/components/ui/Card.d.ts +72 -0
- package/dist/ts/components/ui/Card.d.ts.map +1 -0
- package/dist/ts/components/ui/Card.js +50 -0
- package/dist/ts/components/ui/Card.js.map +1 -0
- package/dist/ts/components/ui/FieldError.d.ts +24 -0
- package/dist/ts/components/ui/FieldError.d.ts.map +1 -0
- package/dist/ts/components/ui/FieldError.js +18 -0
- package/dist/ts/components/ui/FieldError.js.map +1 -0
- package/dist/ts/components/ui/IconButton.d.ts +13 -0
- package/dist/ts/components/ui/IconButton.d.ts.map +1 -0
- package/dist/ts/components/ui/IconButton.js +11 -0
- package/dist/ts/components/ui/IconButton.js.map +1 -0
- package/dist/ts/components/ui/Input.d.ts +37 -0
- package/dist/ts/components/ui/Input.d.ts.map +1 -0
- package/dist/ts/components/ui/Input.js +10 -0
- package/dist/ts/components/ui/Input.js.map +1 -0
- package/dist/ts/components/ui/SaveIndicator.d.ts +8 -0
- package/dist/ts/components/ui/SaveIndicator.d.ts.map +1 -0
- package/dist/ts/components/ui/SaveIndicator.js +33 -0
- package/dist/ts/components/ui/SaveIndicator.js.map +1 -0
- package/dist/ts/components/ui/Select.d.ts +8 -0
- package/dist/ts/components/ui/Select.d.ts.map +1 -0
- package/dist/ts/components/ui/Select.js +10 -0
- package/dist/ts/components/ui/Select.js.map +1 -0
- package/dist/ts/components/ui/Separator.d.ts +7 -0
- package/dist/ts/components/ui/Separator.d.ts.map +1 -0
- package/dist/ts/components/ui/Separator.js +9 -0
- package/dist/ts/components/ui/Separator.js.map +1 -0
- package/dist/ts/components/ui/Textarea.d.ts +8 -0
- package/dist/ts/components/ui/Textarea.d.ts.map +1 -0
- package/dist/ts/components/ui/Textarea.js +6 -0
- package/dist/ts/components/ui/Textarea.js.map +1 -0
- package/dist/ts/components/ui/Tooltip.d.ts +9 -0
- package/dist/ts/components/ui/Tooltip.d.ts.map +1 -0
- package/dist/ts/components/ui/Tooltip.js +6 -0
- package/dist/ts/components/ui/Tooltip.js.map +1 -0
- package/dist/ts/components/ui/index.d.ts +14 -0
- package/dist/ts/components/ui/index.d.ts.map +1 -0
- package/dist/ts/components/ui/index.js +18 -0
- package/dist/ts/components/ui/index.js.map +1 -0
- package/dist/ts/data-schemas.d.ts +36 -0
- package/dist/ts/data-schemas.d.ts.map +1 -0
- package/dist/ts/data-schemas.js +52 -0
- package/dist/ts/data-schemas.js.map +1 -0
- package/dist/ts/dev-entry.d.ts +2 -0
- package/dist/ts/dev-entry.d.ts.map +1 -0
- package/dist/ts/dev-entry.js +23 -0
- package/dist/ts/dev-entry.js.map +1 -0
- package/dist/ts/editor-flush.d.ts +26 -0
- package/dist/ts/editor-flush.d.ts.map +1 -0
- package/dist/ts/editor-flush.js +40 -0
- package/dist/ts/editor-flush.js.map +1 -0
- package/dist/ts/hooks/index.d.ts +10 -0
- package/dist/ts/hooks/index.d.ts.map +1 -0
- package/dist/ts/hooks/index.js +8 -0
- package/dist/ts/hooks/index.js.map +1 -0
- package/dist/ts/hooks/useCanvasTheme.d.ts +12 -0
- package/dist/ts/hooks/useCanvasTheme.d.ts.map +1 -0
- package/dist/ts/hooks/useCanvasTheme.js +34 -0
- package/dist/ts/hooks/useCanvasTheme.js.map +1 -0
- package/dist/ts/hooks/useClickOutside.d.ts +7 -0
- package/dist/ts/hooks/useClickOutside.d.ts.map +1 -0
- package/dist/ts/hooks/useClickOutside.js +19 -0
- package/dist/ts/hooks/useClickOutside.js.map +1 -0
- package/dist/ts/hooks/useDialogState.d.ts +23 -0
- package/dist/ts/hooks/useDialogState.d.ts.map +1 -0
- package/dist/ts/hooks/useDialogState.js +32 -0
- package/dist/ts/hooks/useDialogState.js.map +1 -0
- package/dist/ts/hooks/useEditorPref.d.ts +2 -0
- package/dist/ts/hooks/useEditorPref.d.ts.map +1 -0
- package/dist/ts/hooks/useEditorPref.js +50 -0
- package/dist/ts/hooks/useEditorPref.js.map +1 -0
- package/dist/ts/hooks/useErrorModal.d.ts +15 -0
- package/dist/ts/hooks/useErrorModal.d.ts.map +1 -0
- package/dist/ts/hooks/useErrorModal.js +36 -0
- package/dist/ts/hooks/useErrorModal.js.map +1 -0
- package/dist/ts/hooks/useSiteBaseUrl.d.ts +10 -0
- package/dist/ts/hooks/useSiteBaseUrl.d.ts.map +1 -0
- package/dist/ts/hooks/useSiteBaseUrl.js +15 -0
- package/dist/ts/hooks/useSiteBaseUrl.js.map +1 -0
- package/dist/ts/hooks/useTheme.d.ts +12 -0
- package/dist/ts/hooks/useTheme.d.ts.map +1 -0
- package/dist/ts/hooks/useTheme.js +55 -0
- package/dist/ts/hooks/useTheme.js.map +1 -0
- package/dist/ts/hooks/useUnsavedChangesGuard.d.ts +16 -0
- package/dist/ts/hooks/useUnsavedChangesGuard.d.ts.map +1 -0
- package/dist/ts/hooks/useUnsavedChangesGuard.js +30 -0
- package/dist/ts/hooks/useUnsavedChangesGuard.js.map +1 -0
- package/dist/ts/hooks/useUpload.d.ts +5 -0
- package/dist/ts/hooks/useUpload.d.ts.map +1 -0
- package/dist/ts/hooks/useUpload.js +15 -0
- package/dist/ts/hooks/useUpload.js.map +1 -0
- package/dist/ts/hooks/useUploadFlow.d.ts +47 -0
- package/dist/ts/hooks/useUploadFlow.d.ts.map +1 -0
- package/dist/ts/hooks/useUploadFlow.js +154 -0
- package/dist/ts/hooks/useUploadFlow.js.map +1 -0
- package/dist/ts/host-discovery.d.ts +40 -0
- package/dist/ts/host-discovery.d.ts.map +1 -0
- package/dist/ts/host-discovery.js +39 -0
- package/dist/ts/host-discovery.js.map +1 -0
- package/dist/ts/host-style-probe.d.ts +81 -0
- package/dist/ts/host-style-probe.d.ts.map +1 -0
- package/dist/ts/host-style-probe.js +638 -0
- package/dist/ts/host-style-probe.js.map +1 -0
- package/dist/ts/index.d.ts +13 -0
- package/dist/ts/index.d.ts.map +1 -0
- package/dist/ts/index.js +17 -0
- package/dist/ts/index.js.map +1 -0
- package/dist/ts/lib/utils.d.ts +13 -0
- package/dist/ts/lib/utils.d.ts.map +1 -0
- package/dist/ts/lib/utils.js +48 -0
- package/dist/ts/lib/utils.js.map +1 -0
- package/dist/ts/main-spa.d.ts +8 -0
- package/dist/ts/main-spa.d.ts.map +1 -0
- package/dist/ts/main-spa.js +58 -0
- package/dist/ts/main-spa.js.map +1 -0
- package/dist/ts/main.d.ts +2 -0
- package/dist/ts/main.d.ts.map +1 -0
- package/dist/ts/main.js +16 -0
- package/dist/ts/main.js.map +1 -0
- package/dist/ts/mdx-components-define.d.ts +185 -0
- package/dist/ts/mdx-components-define.d.ts.map +1 -0
- package/dist/ts/mdx-components-define.js +140 -0
- package/dist/ts/mdx-components-define.js.map +1 -0
- package/dist/ts/mdx-components.d.ts +63 -0
- package/dist/ts/mdx-components.d.ts.map +1 -0
- package/dist/ts/mdx-components.js +129 -0
- package/dist/ts/mdx-components.js.map +1 -0
- package/dist/ts/media/AssetScopePill.d.ts +30 -0
- package/dist/ts/media/AssetScopePill.d.ts.map +1 -0
- package/dist/ts/media/AssetScopePill.js +31 -0
- package/dist/ts/media/AssetScopePill.js.map +1 -0
- package/dist/ts/media/MediaIssueBadge.d.ts +33 -0
- package/dist/ts/media/MediaIssueBadge.d.ts.map +1 -0
- package/dist/ts/media/MediaIssueBadge.js +55 -0
- package/dist/ts/media/MediaIssueBadge.js.map +1 -0
- package/dist/ts/media/types.d.ts +108 -0
- package/dist/ts/media/types.d.ts.map +1 -0
- package/dist/ts/media/types.js +2 -0
- package/dist/ts/media/types.js.map +1 -0
- package/dist/ts/media/use-asset-scope.d.ts +24 -0
- package/dist/ts/media/use-asset-scope.d.ts.map +1 -0
- package/dist/ts/media/use-asset-scope.js +57 -0
- package/dist/ts/media/use-asset-scope.js.map +1 -0
- package/dist/ts/media/use-media-issue.d.ts +24 -0
- package/dist/ts/media/use-media-issue.d.ts.map +1 -0
- package/dist/ts/media/use-media-issue.js +52 -0
- package/dist/ts/media/use-media-issue.js.map +1 -0
- package/dist/ts/merge-default-props.d.ts +23 -0
- package/dist/ts/merge-default-props.d.ts.map +1 -0
- package/dist/ts/merge-default-props.js +51 -0
- package/dist/ts/merge-default-props.js.map +1 -0
- package/dist/ts/mock-puck-config.d.ts +21 -0
- package/dist/ts/mock-puck-config.d.ts.map +1 -0
- package/dist/ts/mock-puck-config.js +74 -0
- package/dist/ts/mock-puck-config.js.map +1 -0
- package/dist/ts/page-schema-define.d.ts +134 -0
- package/dist/ts/page-schema-define.d.ts.map +1 -0
- package/dist/ts/page-schema-define.js +60 -0
- package/dist/ts/page-schema-define.js.map +1 -0
- package/dist/ts/page-schemas.d.ts +31 -0
- package/dist/ts/page-schemas.d.ts.map +1 -0
- package/dist/ts/page-schemas.js +56 -0
- package/dist/ts/page-schemas.js.map +1 -0
- package/dist/ts/page-setting-attributes.d.ts +27 -0
- package/dist/ts/page-setting-attributes.d.ts.map +1 -0
- package/dist/ts/page-setting-attributes.js +11 -0
- package/dist/ts/page-setting-attributes.js.map +1 -0
- package/dist/ts/prose-surface-css.d.ts +92 -0
- package/dist/ts/prose-surface-css.d.ts.map +1 -0
- package/dist/ts/prose-surface-css.js +349 -0
- package/dist/ts/prose-surface-css.js.map +1 -0
- package/dist/{puck-config.d.mts → ts/puck-config.d.ts} +11 -14
- package/dist/ts/puck-config.d.ts.map +1 -0
- package/dist/ts/puck-config.js +51 -0
- package/dist/ts/puck-config.js.map +1 -0
- package/dist/ts/sandbox-preview-styles.d.ts +63 -0
- package/dist/ts/sandbox-preview-styles.d.ts.map +1 -0
- package/dist/ts/sandbox-preview-styles.js +169 -0
- package/dist/ts/sandbox-preview-styles.js.map +1 -0
- package/dist/ts/selected-block.d.ts +61 -0
- package/dist/ts/selected-block.d.ts.map +1 -0
- package/dist/ts/selected-block.js +65 -0
- package/dist/ts/selected-block.js.map +1 -0
- package/dist/ts/site-css-layer.d.ts +40 -0
- package/dist/ts/site-css-layer.d.ts.map +1 -0
- package/dist/ts/site-css-layer.js +110 -0
- package/dist/ts/site-css-layer.js.map +1 -0
- package/dist/ts/site-styles.d.ts +141 -0
- package/dist/ts/site-styles.d.ts.map +1 -0
- package/dist/ts/site-styles.js +426 -0
- package/dist/ts/site-styles.js.map +1 -0
- package/dist/ts/theme.d.ts +46 -0
- package/dist/ts/theme.d.ts.map +1 -0
- package/dist/ts/theme.js +96 -0
- package/dist/ts/theme.js.map +1 -0
- package/dist/ts/types.d.ts +58 -0
- package/dist/ts/types.d.ts.map +1 -0
- package/dist/ts/types.js +2 -0
- package/dist/ts/types.js.map +1 -0
- package/dist/ts/ui-config.d.ts +249 -0
- package/dist/ts/ui-config.d.ts.map +1 -0
- package/dist/ts/ui-config.js +142 -0
- package/dist/ts/ui-config.js.map +1 -0
- package/dist/ts/utils/asset-url.d.ts +9 -0
- package/dist/ts/utils/asset-url.d.ts.map +1 -0
- package/dist/ts/utils/asset-url.js +19 -0
- package/dist/ts/utils/asset-url.js.map +1 -0
- package/dist/ts/utils/cn.d.ts +3 -0
- package/dist/ts/utils/cn.d.ts.map +1 -0
- package/dist/ts/utils/cn.js +6 -0
- package/dist/ts/utils/cn.js.map +1 -0
- package/dist/ts/utils/content-failure.d.ts +32 -0
- package/dist/ts/utils/content-failure.d.ts.map +1 -0
- package/dist/ts/utils/content-failure.js +67 -0
- package/dist/ts/utils/content-failure.js.map +1 -0
- package/dist/ts/utils/entry-meta.d.ts +29 -0
- package/dist/ts/utils/entry-meta.d.ts.map +1 -0
- package/dist/ts/utils/entry-meta.js +38 -0
- package/dist/ts/utils/entry-meta.js.map +1 -0
- package/dist/ts/utils/entry-name.d.ts +11 -0
- package/dist/ts/utils/entry-name.d.ts.map +1 -0
- package/dist/ts/utils/entry-name.js +19 -0
- package/dist/ts/utils/entry-name.js.map +1 -0
- package/dist/ts/utils/format-date.d.ts +15 -0
- package/dist/ts/utils/format-date.d.ts.map +1 -0
- package/dist/ts/utils/format-date.js +38 -0
- package/dist/ts/utils/format-date.js.map +1 -0
- package/dist/ts/utils/mdast-to-html.d.ts +55 -0
- package/dist/ts/utils/mdast-to-html.d.ts.map +1 -0
- package/dist/ts/utils/mdast-to-html.js +235 -0
- package/dist/ts/utils/mdast-to-html.js.map +1 -0
- package/dist/ts/utils/mdast-tree.d.ts +104 -0
- package/dist/ts/utils/mdast-tree.d.ts.map +1 -0
- package/dist/ts/utils/mdast-tree.js +286 -0
- package/dist/ts/utils/mdast-tree.js.map +1 -0
- package/dist/ts/utils/menu-placement.d.ts +8 -0
- package/dist/ts/utils/menu-placement.d.ts.map +1 -0
- package/dist/ts/utils/menu-placement.js +10 -0
- package/dist/ts/utils/menu-placement.js.map +1 -0
- package/dist/ts/utils/pageMetadata.d.ts +80 -0
- package/dist/ts/utils/pageMetadata.d.ts.map +1 -0
- package/dist/ts/utils/pageMetadata.js +249 -0
- package/dist/ts/utils/pageMetadata.js.map +1 -0
- package/dist/ts/utils/sanitize-html.d.ts +31 -0
- package/dist/ts/utils/sanitize-html.d.ts.map +1 -0
- package/dist/ts/utils/sanitize-html.js +84 -0
- package/dist/ts/utils/sanitize-html.js.map +1 -0
- package/dist/ts/utils/slugify.d.ts +14 -0
- package/dist/ts/utils/slugify.d.ts.map +1 -0
- package/dist/ts/utils/slugify.js +22 -0
- package/dist/ts/utils/slugify.js.map +1 -0
- package/dist/ts/utils/zodIntrospect.d.ts +19 -0
- package/dist/ts/utils/zodIntrospect.d.ts.map +1 -0
- package/dist/ts/utils/zodIntrospect.js +95 -0
- package/dist/ts/utils/zodIntrospect.js.map +1 -0
- package/dist/ts/write-access.d.ts +48 -0
- package/dist/ts/write-access.d.ts.map +1 -0
- package/dist/ts/write-access.js +140 -0
- package/dist/ts/write-access.js.map +1 -0
- package/package.json +217 -57
- package/src/App.tsx +78 -0
- package/src/CmsSpaApp.tsx +63 -0
- package/src/components/CMSDashboard.tsx +118 -0
- package/src/components/CMSLayout.tsx +25 -0
- package/src/components/ConlocaLogo.tsx +10 -0
- package/src/components/GitStatusPanel.tsx +188 -0
- package/src/components/MobileTopBar.tsx +22 -0
- package/src/components/Sidebar.tsx +146 -0
- package/src/components/UserAvatar.tsx +28 -0
- package/src/components/cards/DataEntryCard.tsx +163 -0
- package/src/components/cards/SectionCard.tsx +103 -0
- package/src/components/cards/index.ts +1 -0
- package/src/components/dashboard/RecentActivity.tsx +114 -0
- package/src/components/dialog.tsx +78 -0
- package/src/components/dialogs/ConflictDialog.tsx +139 -0
- package/src/components/dialogs/CreateDataDialog.tsx +70 -0
- package/src/components/dialogs/CreateFolderDialog.tsx +94 -0
- package/src/components/dialogs/CreatePageDialog.tsx +465 -0
- package/src/components/dialogs/DataPropertiesDialog.tsx +84 -0
- package/src/components/dialogs/DeleteConfirmDialog.tsx +61 -0
- package/src/components/dialogs/ErrorModal.tsx +109 -0
- package/src/components/dialogs/FragmentPropertiesDialog.tsx +97 -0
- package/src/components/dialogs/MoveFolderDialog.tsx +205 -0
- package/src/components/dialogs/PageMetadataDialog.tsx +311 -0
- package/src/components/dialogs/UnsavedChangesDialog.tsx +43 -0
- package/src/components/dialogs/index.ts +8 -0
- package/src/components/editor/CMSMDXEditor.tsx +281 -0
- package/src/components/editor/ContentDiff.tsx +251 -0
- package/src/components/editor/CreateFragmentDialog.tsx +227 -0
- package/src/components/editor/DrawerItemOverride.tsx +62 -0
- package/src/components/editor/EditorChromeToggles.tsx +35 -0
- package/src/components/editor/FragmentEditor.tsx +506 -0
- package/src/components/editor/FragmentWrappers.tsx +72 -0
- package/src/components/editor/GenericBlock.tsx +1361 -0
- package/src/components/editor/ImagePickerDialog.tsx +25 -0
- package/src/components/editor/JsxPropsPanel.tsx +293 -0
- package/src/components/editor/LocaleSelector.tsx +60 -0
- package/src/components/editor/MDXLivePreview.tsx +179 -0
- package/src/components/editor/MdxPageEditor.tsx +546 -0
- package/src/components/editor/PageEditor.tsx +529 -0
- package/src/components/editor/PageEditorHeaderActions.tsx +160 -0
- package/src/components/editor/PageEditorWrapper.tsx +502 -0
- package/src/components/editor/PuckWithUntouchedMetadata.tsx +65 -0
- package/src/components/editor/SearchableSelect.tsx +186 -0
- package/src/components/editor/host-wrapper-plugin.ts +91 -0
- package/src/components/editor/index.ts +8 -0
- package/src/components/editor/insert-menu/InsertMdxComponentButton.tsx +149 -0
- package/src/components/editor/insert-menu/SlashMenuPlugin.tsx +152 -0
- package/src/components/editor/insert-menu/insert-payload.ts +150 -0
- package/src/components/editor/insert-menu/mdx-components-plugin.ts +14 -0
- package/src/components/editor/page-setting-targets.tsx +154 -0
- package/src/components/editor/preview-availability.ts +20 -0
- package/src/components/editors/DataEditor.tsx +270 -0
- package/src/components/fields/ContentFragmentSelectorField.tsx +290 -0
- package/src/components/fields/ImageField.tsx +75 -0
- package/src/components/fields/MDXEditField.tsx +54 -0
- package/src/components/forms/ChipArrayField.tsx +81 -0
- package/src/components/forms/HintForm.tsx +437 -0
- package/src/components/forms/SchemaForm.tsx +307 -0
- package/src/components/index.ts +14 -0
- package/src/components/media/AssetCard.tsx +84 -0
- package/src/components/media/AssetDetailSidebar.tsx +335 -0
- package/src/components/media/BulkActionBar.tsx +33 -0
- package/src/components/media/FolderNav.tsx +44 -0
- package/src/components/media/FolderTreeSidebar.tsx +171 -0
- package/src/components/media/ImagePicker.tsx +102 -0
- package/src/components/media/MediaLibrary.tsx +183 -0
- package/src/components/media/MediaToolbar.tsx +100 -0
- package/src/components/media/UploadModal.tsx +266 -0
- package/src/components/media/index.ts +9 -0
- package/src/components/pages/DataList.tsx +496 -0
- package/src/components/pages/FragmentList.tsx +592 -0
- package/src/components/pages/MediaPage.tsx +284 -0
- package/src/components/pages/PageList.tsx +683 -0
- package/src/components/pages/index.ts +2 -0
- package/src/components/puck/MDXContent.tsx +199 -0
- package/src/components/puck/index.ts +1 -0
- package/src/components/sandbox/ContentSandbox.tsx +191 -0
- package/src/components/sandbox/frame-runtime.ts +15 -0
- package/src/components/toast.tsx +48 -0
- package/src/components/ui/Banner.tsx +108 -0
- package/src/components/ui/Button.tsx +51 -0
- package/src/components/ui/Card.tsx +124 -0
- package/src/components/ui/FieldError.tsx +37 -0
- package/src/components/ui/IconButton.tsx +40 -0
- package/src/components/ui/Input.tsx +66 -0
- package/src/components/ui/SaveIndicator.tsx +44 -0
- package/src/components/ui/Select.tsx +29 -0
- package/src/components/ui/Separator.tsx +14 -0
- package/src/components/ui/Textarea.tsx +22 -0
- package/src/components/ui/Tooltip.tsx +25 -0
- package/src/components/ui/index.ts +18 -0
- package/src/data-schemas.ts +82 -0
- package/src/dev-entry.tsx +25 -0
- package/src/dev.html +36 -0
- package/src/editor-flush.ts +47 -0
- package/src/hooks/index.ts +22 -0
- package/src/hooks/useCanvasTheme.tsx +52 -0
- package/src/hooks/useClickOutside.ts +24 -0
- package/src/hooks/useDialogState.ts +40 -0
- package/src/hooks/useEditorPref.ts +58 -0
- package/src/hooks/useErrorModal.tsx +63 -0
- package/src/hooks/useSiteBaseUrl.ts +16 -0
- package/src/hooks/useTheme.tsx +76 -0
- package/src/hooks/useUnsavedChangesGuard.ts +32 -0
- package/src/hooks/useUpload.ts +19 -0
- package/src/hooks/useUploadFlow.ts +227 -0
- package/src/host-discovery.ts +77 -0
- package/src/host-style-probe.ts +684 -0
- package/src/index.ts +42 -0
- package/src/lib/utils.ts +56 -0
- package/src/main-spa.tsx +69 -0
- package/src/main.css +1095 -0
- package/src/main.html +43 -0
- package/src/main.tsx +16 -0
- package/src/mdx-components-define.ts +296 -0
- package/src/mdx-components.ts +154 -0
- package/src/media/AssetScopePill.tsx +56 -0
- package/src/media/MediaIssueBadge.tsx +86 -0
- package/src/media/types.ts +96 -0
- package/src/media/use-asset-scope.ts +58 -0
- package/src/media/use-media-issue.ts +53 -0
- package/src/merge-default-props.ts +58 -0
- package/src/mock-puck-config.tsx +115 -0
- package/src/page-schema-define.ts +176 -0
- package/src/page-schemas.ts +80 -0
- package/src/page-setting-attributes.ts +40 -0
- package/src/prose-surface-css.ts +359 -0
- package/src/puck-config.ts +77 -0
- package/src/sandbox-preview-styles.ts +166 -0
- package/src/selected-block.ts +121 -0
- package/src/site-css-layer.ts +109 -0
- package/src/site-styles.ts +524 -0
- package/src/theme.ts +102 -0
- package/src/types.ts +63 -0
- package/src/ui-config.ts +334 -0
- package/src/utils/asset-url.ts +22 -0
- package/src/utils/cn.ts +6 -0
- package/src/utils/content-failure.ts +74 -0
- package/src/utils/entry-meta.ts +47 -0
- package/src/utils/entry-name.ts +21 -0
- package/src/utils/format-date.ts +34 -0
- package/src/utils/mdast-to-html.ts +247 -0
- package/src/utils/mdast-tree.ts +292 -0
- package/src/utils/menu-placement.ts +13 -0
- package/src/utils/pageMetadata.ts +285 -0
- package/src/utils/sanitize-html.ts +84 -0
- package/src/utils/slugify.ts +21 -0
- package/src/utils/zodIntrospect.ts +136 -0
- package/src/vite-env.d.ts +10 -0
- package/src/write-access.ts +147 -0
- package/styles/stylesheet.d.ts +6 -0
- package/styles/tailwind-theme.css +128 -0
- package/dist/data-schemas.d.mts +0 -26
- package/dist/data-schemas.d.mts.map +0 -1
- package/dist/data-schemas.mjs +0 -52
- package/dist/data-schemas.mjs.map +0 -1
- package/dist/index.d.mts +0 -125
- package/dist/index.d.mts.map +0 -1
- package/dist/index.mjs +0 -4
- package/dist/main.d.mts +0 -1
- package/dist/main.mjs +0 -5687
- package/dist/main.mjs.map +0 -1
- package/dist/page-schemas.d.mts +0 -26
- package/dist/page-schemas.d.mts.map +0 -1
- package/dist/page-schemas.mjs +0 -52
- package/dist/page-schemas.mjs.map +0 -1
- package/dist/puck-C9_F3_cJ.mjs +0 -1589
- package/dist/puck-C9_F3_cJ.mjs.map +0 -1
- package/dist/puck-config.d.mts.map +0 -1
- package/dist/puck-config.mjs +0 -51
- package/dist/puck-config.mjs.map +0 -1
- package/dist/site-styles.d.mts +0 -41
- package/dist/site-styles.d.mts.map +0 -1
- package/dist/site-styles.mjs +0 -52
- package/dist/site-styles.mjs.map +0 -1
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Convert (small) mdast subtrees to HTML strings.
|
|
3
|
+
*
|
|
4
|
+
* Two motivating cases for these helpers:
|
|
5
|
+
*
|
|
6
|
+
* 1. Components like Starlight's `<Steps>`/`<FileTree>` whose Astro
|
|
7
|
+
* implementation validates the slot tag name and rejects
|
|
8
|
+
* `<conloca-slot>` — the GenericBlock editor renders the list body
|
|
9
|
+
* as raw HTML and passes that as the slot content instead.
|
|
10
|
+
*
|
|
11
|
+
* 2. Raw HTML the author writes directly in MDX (`<div class="x">`,
|
|
12
|
+
* `<details><summary>`, etc.) lands in the mdast as
|
|
13
|
+
* `mdxJsxFlowElement`/`mdxJsxTextElement` with a lowercase tag
|
|
14
|
+
* name. The editor renders those in place rather than routing
|
|
15
|
+
* through the Container API (which expects a component import).
|
|
16
|
+
*
|
|
17
|
+
* Anything unrecognized collapses to its concatenated children
|
|
18
|
+
* (transparent wrapper). Safer than dropping content — text still
|
|
19
|
+
* shows even if formatting doesn't.
|
|
20
|
+
*
|
|
21
|
+
* These functions live outside `GenericBlock.tsx` because they're pure
|
|
22
|
+
* — no React, no DOM, no editor state. Importing from a single place
|
|
23
|
+
* also keeps the call sites honest about what's serialization vs
|
|
24
|
+
* editor wiring.
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
export function escapeHtml(s: string): string {
|
|
28
|
+
return s.replace(/&/g, '&').replace(/"/g, '"').replace(/</g, '<').replace(/>/g, '>');
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** Script-bearing URL schemes browsers execute. `data:text/html` is included
|
|
32
|
+
* because it renders as an active document; `data:image/*` stays allowed. */
|
|
33
|
+
const DANGEROUS_URL_SCHEME = /^(?:javascript|vbscript):|^data:text\/html/i;
|
|
34
|
+
|
|
35
|
+
/** Empty out a URL whose scheme would execute script, else pass it through.
|
|
36
|
+
* Strips ASCII whitespace/control characters first so `java\tscript:` and
|
|
37
|
+
* leading-newline tricks can't smuggle a live scheme past the check. */
|
|
38
|
+
function neutralizeUrl(url: string): string {
|
|
39
|
+
const normalized = url.replace(/[\p{Cc} ]+/gu, '');
|
|
40
|
+
return DANGEROUS_URL_SCHEME.test(normalized) ? '' : url;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** Inline event-handler attribute names (`on*`) — dropped defensively so a
|
|
44
|
+
* serialized `<img onerror=…>` can't wire script into an innerHTML sink.
|
|
45
|
+
* URL-bearing attributes keep their name but get scheme-filtered; `style` is
|
|
46
|
+
* passed through (it carries no script in a modern browser, and the DOMPurify
|
|
47
|
+
* pass over this serializer's output at every call site keeps it either way). */
|
|
48
|
+
function isEventHandlerAttr(name: string): boolean {
|
|
49
|
+
return /^on/i.test(name);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/** Attribute names whose value is a URL and must be scheme-filtered. */
|
|
53
|
+
function isUrlAttr(name: string): boolean {
|
|
54
|
+
return /^(?:href|src|xlink:href|formaction|action|poster|background)$/i.test(name);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/** True when a JSX tag name is a standard HTML element (lowercase-
|
|
58
|
+
* first per the React/Astro convention). Used to render raw HTML
|
|
59
|
+
* inline rather than routing it through the Astro Container API. */
|
|
60
|
+
export function isHtmlTag(name: string): boolean {
|
|
61
|
+
return /^[a-z][a-z0-9-]*$/.test(name);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/** Self-closing HTML elements that must NOT have a closing tag. */
|
|
65
|
+
const VOID_HTML_TAGS = new Set([
|
|
66
|
+
'area',
|
|
67
|
+
'base',
|
|
68
|
+
'br',
|
|
69
|
+
'col',
|
|
70
|
+
'embed',
|
|
71
|
+
'hr',
|
|
72
|
+
'img',
|
|
73
|
+
'input',
|
|
74
|
+
'link',
|
|
75
|
+
'meta',
|
|
76
|
+
'param',
|
|
77
|
+
'source',
|
|
78
|
+
'track',
|
|
79
|
+
'wbr',
|
|
80
|
+
]);
|
|
81
|
+
|
|
82
|
+
export function attrsToHtml(attrs: unknown): string {
|
|
83
|
+
if (!Array.isArray(attrs)) return '';
|
|
84
|
+
const parts: string[] = [];
|
|
85
|
+
for (const a of attrs as Array<{ type?: string; name?: string; value?: unknown }>) {
|
|
86
|
+
if (a?.type !== 'mdxJsxAttribute' || typeof a.name !== 'string') continue;
|
|
87
|
+
// Never serialize an inline event handler into an innerHTML sink.
|
|
88
|
+
if (isEventHandlerAttr(a.name)) continue;
|
|
89
|
+
const urlAttr = isUrlAttr(a.name);
|
|
90
|
+
const v = a.value;
|
|
91
|
+
if (v == null) {
|
|
92
|
+
parts.push(a.name); // shorthand boolean
|
|
93
|
+
} else if (typeof v === 'string') {
|
|
94
|
+
const value = urlAttr ? neutralizeUrl(v) : v;
|
|
95
|
+
parts.push(`${a.name}="${escapeHtml(value)}"`);
|
|
96
|
+
} else if (typeof v === 'object' && v && 'value' in v && typeof (v as { value: unknown }).value === 'string') {
|
|
97
|
+
// Expression — serialize the source. JSON-literal expressions
|
|
98
|
+
// (`{42}`, `{true}`) round-trip; non-literal ones fall through
|
|
99
|
+
// as-is, which mirrors what attrsToProps does for the SSR
|
|
100
|
+
// payload.
|
|
101
|
+
const src = ((v as { value: string }).value || '').trim();
|
|
102
|
+
let parsed: unknown;
|
|
103
|
+
try {
|
|
104
|
+
parsed = JSON.parse(src);
|
|
105
|
+
} catch {
|
|
106
|
+
parsed = src;
|
|
107
|
+
}
|
|
108
|
+
if (typeof parsed === 'boolean') {
|
|
109
|
+
if (parsed) parts.push(a.name);
|
|
110
|
+
} else if (parsed != null) {
|
|
111
|
+
const value = urlAttr ? neutralizeUrl(String(parsed)) : String(parsed);
|
|
112
|
+
parts.push(`${a.name}="${escapeHtml(value)}"`);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
return parts.length ? ` ${parts.join(' ')}` : '';
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export function mdastToHtml(node: unknown): string {
|
|
120
|
+
if (!node || typeof node !== 'object') return '';
|
|
121
|
+
const n = node as {
|
|
122
|
+
type?: string;
|
|
123
|
+
value?: unknown;
|
|
124
|
+
children?: unknown[];
|
|
125
|
+
ordered?: boolean;
|
|
126
|
+
url?: string;
|
|
127
|
+
name?: string;
|
|
128
|
+
attributes?: unknown;
|
|
129
|
+
depth?: number;
|
|
130
|
+
lang?: string;
|
|
131
|
+
};
|
|
132
|
+
switch (n.type) {
|
|
133
|
+
case 'text':
|
|
134
|
+
return typeof n.value === 'string' ? escapeHtml(n.value) : '';
|
|
135
|
+
case 'inlineCode':
|
|
136
|
+
return `<code>${typeof n.value === 'string' ? escapeHtml(n.value) : ''}</code>`;
|
|
137
|
+
case 'emphasis':
|
|
138
|
+
return `<em>${(n.children ?? []).map(mdastToHtml).join('')}</em>`;
|
|
139
|
+
case 'strong':
|
|
140
|
+
return `<strong>${(n.children ?? []).map(mdastToHtml).join('')}</strong>`;
|
|
141
|
+
case 'delete':
|
|
142
|
+
return `<del>${(n.children ?? []).map(mdastToHtml).join('')}</del>`;
|
|
143
|
+
case 'link':
|
|
144
|
+
return `<a href="${escapeHtml(neutralizeUrl(typeof n.url === 'string' ? n.url : ''))}">${(n.children ?? []).map(mdastToHtml).join('')}</a>`;
|
|
145
|
+
case 'image':
|
|
146
|
+
return `<img src="${escapeHtml(neutralizeUrl(typeof n.url === 'string' ? n.url : ''))}" alt="${escapeHtml(typeof (n as { alt?: unknown }).alt === 'string' ? (n as { alt: string }).alt : '')}" />`;
|
|
147
|
+
case 'paragraph':
|
|
148
|
+
return `<p>${(n.children ?? []).map(mdastToHtml).join('')}</p>`;
|
|
149
|
+
case 'heading': {
|
|
150
|
+
const lvl = Math.max(1, Math.min(6, Number(n.depth) || 1));
|
|
151
|
+
return `<h${lvl}>${(n.children ?? []).map(mdastToHtml).join('')}</h${lvl}>`;
|
|
152
|
+
}
|
|
153
|
+
case 'blockquote':
|
|
154
|
+
return `<blockquote>${(n.children ?? []).map(mdastToHtml).join('')}</blockquote>`;
|
|
155
|
+
case 'list': {
|
|
156
|
+
const tag = n.ordered ? 'ol' : 'ul';
|
|
157
|
+
return `<${tag}>${(n.children ?? []).map(mdastToHtml).join('')}</${tag}>`;
|
|
158
|
+
}
|
|
159
|
+
case 'listItem': {
|
|
160
|
+
// Unwrap `paragraph` children of list items so their contents
|
|
161
|
+
// render inline-of-the-`<li>` rather than wrapped in a block
|
|
162
|
+
// `<p>`. Matches Astro's MDX pipeline for both tight lists (a
|
|
163
|
+
// single-paragraph listItem) AND loose lists like `<FileTree>`'s
|
|
164
|
+
// directory items (`paragraph` for the name + nested `list` for
|
|
165
|
+
// children).
|
|
166
|
+
//
|
|
167
|
+
// Without this, Starlight's <FileTree> renders directory names
|
|
168
|
+
// in a block <p>, which inside .tree-entry (inline-flex) wraps
|
|
169
|
+
// onto its own line — folder icons end up stacked above their
|
|
170
|
+
// names instead of inline with them, the way the live page
|
|
171
|
+
// renders. Same fix protects any list-bearing strict-slot
|
|
172
|
+
// component shipped via bodyHtml.
|
|
173
|
+
const kids = n.children ?? [];
|
|
174
|
+
const inner = kids
|
|
175
|
+
.map((c) =>
|
|
176
|
+
(c as { type?: string } | undefined)?.type === 'paragraph'
|
|
177
|
+
? ((c as { children?: unknown[] }).children ?? []).map(mdastToHtml).join('')
|
|
178
|
+
: mdastToHtml(c),
|
|
179
|
+
)
|
|
180
|
+
.join('');
|
|
181
|
+
return `<li>${inner}</li>`;
|
|
182
|
+
}
|
|
183
|
+
case 'thematicBreak':
|
|
184
|
+
return '<hr />';
|
|
185
|
+
case 'code': {
|
|
186
|
+
const lang = typeof n.lang === 'string' && n.lang ? ` class="language-${escapeHtml(n.lang)}"` : '';
|
|
187
|
+
return `<pre><code${lang}>${typeof n.value === 'string' ? escapeHtml(n.value) : ''}</code></pre>`;
|
|
188
|
+
}
|
|
189
|
+
case 'html':
|
|
190
|
+
// Raw HTML mdast — pass through unescaped.
|
|
191
|
+
return typeof n.value === 'string' ? n.value : '';
|
|
192
|
+
case 'break':
|
|
193
|
+
return '<br />';
|
|
194
|
+
case 'mdxJsxFlowElement':
|
|
195
|
+
case 'mdxJsxTextElement': {
|
|
196
|
+
const tag = typeof n.name === 'string' ? n.name : '';
|
|
197
|
+
if (!tag) return Array.isArray(n.children) ? n.children.map(mdastToHtml).join('') : '';
|
|
198
|
+
if (!isHtmlTag(tag)) {
|
|
199
|
+
// Capital-cased JSX — a component we don't know how to render
|
|
200
|
+
// statically here. Fall back to children (their text/HTML).
|
|
201
|
+
return Array.isArray(n.children) ? n.children.map(mdastToHtml).join('') : '';
|
|
202
|
+
}
|
|
203
|
+
const attrs = attrsToHtml(n.attributes);
|
|
204
|
+
if (VOID_HTML_TAGS.has(tag)) return `<${tag}${attrs} />`;
|
|
205
|
+
const inner = Array.isArray(n.children) ? n.children.map(mdastToHtml).join('') : '';
|
|
206
|
+
return `<${tag}${attrs}>${inner}</${tag}>`;
|
|
207
|
+
}
|
|
208
|
+
default:
|
|
209
|
+
return Array.isArray(n.children) ? n.children.map(mdastToHtml).join('') : '';
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* True when the mdast subtree's body contains any block-level non-JSX
|
|
215
|
+
* mdast node that we'd want to render as HTML rather than route
|
|
216
|
+
* through the editor's slot+portal flow. Two reasons we go this route:
|
|
217
|
+
*
|
|
218
|
+
* 1. Some Astro components validate the slot element type and
|
|
219
|
+
* reject `<conloca-slot>` (Starlight's `<Steps>` wants `<ol>`,
|
|
220
|
+
* `<FileTree>` wants `<ul>`, hypothetical Carousels/Tables/etc
|
|
221
|
+
* could want their own tag). Rendering the body as HTML and
|
|
222
|
+
* emitting it raw makes the validator see the real element.
|
|
223
|
+
*
|
|
224
|
+
* 2. The portal-based editor surface is built for prose text (with
|
|
225
|
+
* inline marks) plus block JSX. Heading/blockquote/table/code
|
|
226
|
+
* blocks as a component's direct body are less common and not
|
|
227
|
+
* cleanly editable inline anyway — rendering them statically
|
|
228
|
+
* until we add per-position slot markers (Phase 3) keeps the
|
|
229
|
+
* visual right.
|
|
230
|
+
*
|
|
231
|
+
* Plain text + inline JSX bodies stay on the slot+portal path so
|
|
232
|
+
* Cards, Asides, etc. remain inline-editable.
|
|
233
|
+
*/
|
|
234
|
+
export function bodyNeedsStaticHtml(kids: unknown[]): boolean {
|
|
235
|
+
return kids.some((c) => {
|
|
236
|
+
const t = (c as { type?: string })?.type;
|
|
237
|
+
return (
|
|
238
|
+
t === 'list' ||
|
|
239
|
+
t === 'heading' ||
|
|
240
|
+
t === 'blockquote' ||
|
|
241
|
+
t === 'table' ||
|
|
242
|
+
t === 'code' ||
|
|
243
|
+
t === 'thematicBreak' ||
|
|
244
|
+
t === 'html'
|
|
245
|
+
);
|
|
246
|
+
});
|
|
247
|
+
}
|
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
import type { MdxJsxFlowElement } from 'mdast-util-mdx-jsx';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Pure mdast-walking helpers used by `GenericBlock` to read and rewrite
|
|
5
|
+
* the JSX subtree it owns.
|
|
6
|
+
*
|
|
7
|
+
* Lives outside the component file because none of these touch React,
|
|
8
|
+
* the DOM, or editor state — they're plain tree operations on the
|
|
9
|
+
* mdast shape produced by `mdast-util-mdx-jsx`. Same input, same
|
|
10
|
+
* output, every time.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Strip the `body` (escaped-text fallback) field from every node in the
|
|
15
|
+
* render tree before hashing for the SSR cache key. Cache keys should
|
|
16
|
+
* hash structural shape — NOT prose body text from the portaled
|
|
17
|
+
* `<NestedLexicalEditor>`s. Without this, every keystroke inside a
|
|
18
|
+
* leaf body would mint a different cache key and force a server
|
|
19
|
+
* roundtrip even though the SSR HTML itself doesn't change (the body
|
|
20
|
+
* lives in the portaled slot, not in the SSR markup).
|
|
21
|
+
*
|
|
22
|
+
* `bodyHtml` is NOT stripped — unlike `body` (a static text fallback
|
|
23
|
+
* the editor portal hides), `bodyHtml` IS the actual rendered slot
|
|
24
|
+
* content for strict-slot components (Steps, FileTree) where the
|
|
25
|
+
* editor doesn't portal an inline editor. Its value must participate
|
|
26
|
+
* in the cache key, otherwise changes to the list structure won't
|
|
27
|
+
* bust the stale cached HTML and the SSR returns out-of-date markup.
|
|
28
|
+
*/
|
|
29
|
+
export function stripBodyFields(node: unknown): unknown {
|
|
30
|
+
if (Array.isArray(node)) return node.map(stripBodyFields);
|
|
31
|
+
if (node && typeof node === 'object') {
|
|
32
|
+
const out: Record<string, unknown> = {};
|
|
33
|
+
for (const [k, v] of Object.entries(node as Record<string, unknown>)) {
|
|
34
|
+
if (k === 'body') continue;
|
|
35
|
+
out[k] = stripBodyFields(v);
|
|
36
|
+
}
|
|
37
|
+
return out;
|
|
38
|
+
}
|
|
39
|
+
return node;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Read mdast JSX attributes as a plain props object. Three attribute
|
|
44
|
+
* shapes from mdast-util-mdx-jsx:
|
|
45
|
+
* - `prop="value"` → `value: string`
|
|
46
|
+
* - `prop={expression}` → object `{ type: 'mdxJsxAttributeValueExpression', value: '<src>' }`
|
|
47
|
+
* - `prop` → `value: null` (shorthand boolean true)
|
|
48
|
+
*
|
|
49
|
+
* Expression values are parsed as JSON so numeric / boolean / array /
|
|
50
|
+
* object literals (`<Box columns={3}>`, `<Card featured={true}>`,
|
|
51
|
+
* `<Grid sizes={[1,2,3]}>`) reach the Astro component as real values
|
|
52
|
+
* instead of being dropped. Non-JSON expressions (variable refs,
|
|
53
|
+
* function calls) fall through as their literal source string — not
|
|
54
|
+
* ideal but no worse than the previous "drop entirely" behavior, and
|
|
55
|
+
* supporting JS evaluation properly needs a real parser.
|
|
56
|
+
*/
|
|
57
|
+
export function readAttrs(node: MdxJsxFlowElement): Record<string, unknown> {
|
|
58
|
+
const out: Record<string, unknown> = {};
|
|
59
|
+
for (const a of node.attributes) {
|
|
60
|
+
if (a.type !== 'mdxJsxAttribute') continue;
|
|
61
|
+
const v = a.value;
|
|
62
|
+
if (typeof v === 'string') {
|
|
63
|
+
out[a.name] = v;
|
|
64
|
+
} else if (v == null) {
|
|
65
|
+
// `<Card featured />` — shorthand boolean true.
|
|
66
|
+
out[a.name] = true;
|
|
67
|
+
} else if (typeof v === 'object' && 'value' in v && typeof v.value === 'string') {
|
|
68
|
+
const src = v.value.trim();
|
|
69
|
+
try {
|
|
70
|
+
out[a.name] = JSON.parse(src);
|
|
71
|
+
} catch {
|
|
72
|
+
out[a.name] = src;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return out;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Many MDX parsers wrap inline JSX (Cards inside CardGrid written on
|
|
81
|
+
* adjacent lines without blank-line separators) in a single
|
|
82
|
+
* `paragraph` node. Authors don't think about that — they just write
|
|
83
|
+
* `<CardGrid><Card/><Card/></CardGrid>`. Unwrap one level of paragraph
|
|
84
|
+
* so the effective children we consider are the JSX nodes themselves.
|
|
85
|
+
*/
|
|
86
|
+
export function effectiveChildren(node: { children?: unknown[] }): unknown[] {
|
|
87
|
+
const kids = node.children ?? [];
|
|
88
|
+
if (kids.length === 1) {
|
|
89
|
+
const only = kids[0] as { type?: string; children?: unknown[] };
|
|
90
|
+
if (only?.type === 'paragraph') return only.children ?? [];
|
|
91
|
+
}
|
|
92
|
+
return kids;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/** Read the `slot` attribute off a `<Fragment slot="...">` mdast
|
|
96
|
+
* node. Returns null when the node isn't a Fragment, isn't named, or
|
|
97
|
+
* the slot attribute isn't a plain string. */
|
|
98
|
+
export function getNamedSlotName(child: unknown): string | null {
|
|
99
|
+
const c = child as { type?: string; name?: string; attributes?: unknown };
|
|
100
|
+
if (!c || (c.type !== 'mdxJsxFlowElement' && c.type !== 'mdxJsxTextElement')) return null;
|
|
101
|
+
if (c.name !== 'Fragment') return null;
|
|
102
|
+
if (!Array.isArray(c.attributes)) return null;
|
|
103
|
+
for (const a of c.attributes as Array<{ type?: string; name?: string; value?: unknown }>) {
|
|
104
|
+
if (a?.type === 'mdxJsxAttribute' && a.name === 'slot' && typeof a.value === 'string') {
|
|
105
|
+
return a.value;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
return null;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Parse a slot id like `"root.0.1"` into a numeric path `[0, 1]`. The
|
|
113
|
+
* leading `"root"` is the buildRenderTree prefix and isn't a real
|
|
114
|
+
* step; an empty path (`"root"` alone) means the top-level node
|
|
115
|
+
* itself, which is never an inline-editable slot (it's the parent we
|
|
116
|
+
* SSR'd) — included only for completeness.
|
|
117
|
+
*/
|
|
118
|
+
export function slotIdToPath(slotId: string): number[] {
|
|
119
|
+
return slotId
|
|
120
|
+
.split('.')
|
|
121
|
+
.slice(1)
|
|
122
|
+
.map((s) => Number.parseInt(s, 10));
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Walk the mdast tree following the same logic `buildRenderTree` uses
|
|
127
|
+
* (effectiveChildren unwrap → named-slot filter → kid at index) and
|
|
128
|
+
* return the subtree at `path`. Returns `null` when the path doesn't
|
|
129
|
+
* resolve (eg the structure changed between SSR and this walk).
|
|
130
|
+
*/
|
|
131
|
+
export function getMdastAtPath(root: unknown, path: number[]): MdxJsxFlowElement | null {
|
|
132
|
+
let node: unknown = root;
|
|
133
|
+
for (const step of path) {
|
|
134
|
+
if (!node || typeof node !== 'object') return null;
|
|
135
|
+
const allKids = effectiveChildren(node as { children?: unknown[] });
|
|
136
|
+
const kids = allKids.filter((k) => getNamedSlotName(k) == null);
|
|
137
|
+
node = kids[step];
|
|
138
|
+
if (!node) return null;
|
|
139
|
+
}
|
|
140
|
+
return (node as MdxJsxFlowElement) ?? null;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Return a NEW root with the subtree at `path` having its `children`
|
|
145
|
+
* replaced by `newChildren`. The walk mirrors `getMdastAtPath` —
|
|
146
|
+
* effectiveChildren unwrap + named-slot filter — and the write
|
|
147
|
+
* reverses the unwrap when it happened, so the original mdast shape
|
|
148
|
+
* (paragraph wrapper or not) round-trips on save.
|
|
149
|
+
*
|
|
150
|
+
* Empty `path` means "replace the root's children" — the only caller
|
|
151
|
+
* for that case would be the top-level editor, which doesn't go
|
|
152
|
+
* through this path.
|
|
153
|
+
*/
|
|
154
|
+
export function replaceMdastAtPath(
|
|
155
|
+
root: MdxJsxFlowElement,
|
|
156
|
+
path: number[],
|
|
157
|
+
newChildren: MdxJsxFlowElement['children'],
|
|
158
|
+
): MdxJsxFlowElement {
|
|
159
|
+
if (path.length === 0) {
|
|
160
|
+
return { ...root, children: newChildren };
|
|
161
|
+
}
|
|
162
|
+
const [head, ...rest] = path;
|
|
163
|
+
const originalKids = (root.children ?? []) as unknown[];
|
|
164
|
+
|
|
165
|
+
// Detect the same paragraph-unwrap effectiveChildren did on read.
|
|
166
|
+
const isUnwrapped =
|
|
167
|
+
originalKids.length === 1 && (originalKids[0] as { type?: string } | undefined)?.type === 'paragraph';
|
|
168
|
+
const workingKids = isUnwrapped ? ((originalKids[0] as { children?: unknown[] }).children ?? []) : originalKids;
|
|
169
|
+
|
|
170
|
+
// Walk `workingKids` skipping named-slot children, find the original
|
|
171
|
+
// index in `workingKids` that corresponds to filtered-index `head`.
|
|
172
|
+
let filteredIdx = 0;
|
|
173
|
+
let originalIdx = -1;
|
|
174
|
+
for (let i = 0; i < workingKids.length; i++) {
|
|
175
|
+
if (getNamedSlotName(workingKids[i]) != null) continue;
|
|
176
|
+
if (filteredIdx === head) {
|
|
177
|
+
originalIdx = i;
|
|
178
|
+
break;
|
|
179
|
+
}
|
|
180
|
+
filteredIdx++;
|
|
181
|
+
}
|
|
182
|
+
if (originalIdx === -1) return root;
|
|
183
|
+
|
|
184
|
+
const targetKid = workingKids[originalIdx] as MdxJsxFlowElement;
|
|
185
|
+
const updatedKid =
|
|
186
|
+
rest.length === 0
|
|
187
|
+
? ({ ...targetKid, children: newChildren } as MdxJsxFlowElement)
|
|
188
|
+
: replaceMdastAtPath(targetKid, rest, newChildren);
|
|
189
|
+
|
|
190
|
+
const newWorkingKids = [...workingKids];
|
|
191
|
+
newWorkingKids[originalIdx] = updatedKid;
|
|
192
|
+
|
|
193
|
+
if (isUnwrapped) {
|
|
194
|
+
const paragraphWrap = originalKids[0] as { children?: unknown[] };
|
|
195
|
+
return {
|
|
196
|
+
...root,
|
|
197
|
+
children: [{ ...paragraphWrap, children: newWorkingKids }] as MdxJsxFlowElement['children'],
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
return { ...root, children: newWorkingKids as MdxJsxFlowElement['children'] };
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* Like `replaceMdastAtPath` but swaps the WHOLE node at `path`, not
|
|
205
|
+
* just its children. Used when the side panel edits a CHILD
|
|
206
|
+
* component's attributes (eg a Card inside a CardGrid): we replace
|
|
207
|
+
* the child JSX node with a new one carrying updated attributes.
|
|
208
|
+
*
|
|
209
|
+
* `replaceMdastAtPath` only rewrites `children` because that's all
|
|
210
|
+
* the inline body editors ever change. For attribute edits the whole
|
|
211
|
+
* node needs replacement, hence this twin.
|
|
212
|
+
*/
|
|
213
|
+
export function replaceMdastNodeAtPath(
|
|
214
|
+
root: MdxJsxFlowElement,
|
|
215
|
+
path: number[],
|
|
216
|
+
newNode: MdxJsxFlowElement,
|
|
217
|
+
): MdxJsxFlowElement {
|
|
218
|
+
if (path.length === 0) return newNode;
|
|
219
|
+
const [head, ...rest] = path;
|
|
220
|
+
const originalKids = (root.children ?? []) as unknown[];
|
|
221
|
+
const isUnwrapped =
|
|
222
|
+
originalKids.length === 1 && (originalKids[0] as { type?: string } | undefined)?.type === 'paragraph';
|
|
223
|
+
const workingKids = isUnwrapped ? ((originalKids[0] as { children?: unknown[] }).children ?? []) : originalKids;
|
|
224
|
+
let filteredIdx = 0;
|
|
225
|
+
let originalIdx = -1;
|
|
226
|
+
for (let i = 0; i < workingKids.length; i++) {
|
|
227
|
+
if (getNamedSlotName(workingKids[i]) != null) continue;
|
|
228
|
+
if (filteredIdx === head) {
|
|
229
|
+
originalIdx = i;
|
|
230
|
+
break;
|
|
231
|
+
}
|
|
232
|
+
filteredIdx++;
|
|
233
|
+
}
|
|
234
|
+
if (originalIdx === -1) return root;
|
|
235
|
+
const targetKid = workingKids[originalIdx] as MdxJsxFlowElement;
|
|
236
|
+
const updatedKid = rest.length === 0 ? newNode : replaceMdastNodeAtPath(targetKid, rest, newNode);
|
|
237
|
+
const newWorkingKids = [...workingKids];
|
|
238
|
+
newWorkingKids[originalIdx] = updatedKid;
|
|
239
|
+
if (isUnwrapped) {
|
|
240
|
+
const paragraphWrap = originalKids[0] as { children?: unknown[] };
|
|
241
|
+
return {
|
|
242
|
+
...root,
|
|
243
|
+
children: [{ ...paragraphWrap, children: newWorkingKids }] as MdxJsxFlowElement['children'],
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
return { ...root, children: newWorkingKids as MdxJsxFlowElement['children'] };
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* Drop the JSX node at `path` from its parent's children. Same walk
|
|
251
|
+
* as `replaceMdastNodeAtPath` — at the leaf we splice instead of
|
|
252
|
+
* replace. Used when the side panel's Remove button fires on a
|
|
253
|
+
* selected CHILD inside a container (eg removing one Card from a
|
|
254
|
+
* CardGrid without touching the grid itself).
|
|
255
|
+
*/
|
|
256
|
+
export function removeMdastNodeAtPath(root: MdxJsxFlowElement, path: number[]): MdxJsxFlowElement {
|
|
257
|
+
if (path.length === 0) return root;
|
|
258
|
+
const [head, ...rest] = path;
|
|
259
|
+
const originalKids = (root.children ?? []) as unknown[];
|
|
260
|
+
const isUnwrapped =
|
|
261
|
+
originalKids.length === 1 && (originalKids[0] as { type?: string } | undefined)?.type === 'paragraph';
|
|
262
|
+
const workingKids = isUnwrapped ? ((originalKids[0] as { children?: unknown[] }).children ?? []) : originalKids;
|
|
263
|
+
let filteredIdx = 0;
|
|
264
|
+
let originalIdx = -1;
|
|
265
|
+
for (let i = 0; i < workingKids.length; i++) {
|
|
266
|
+
if (getNamedSlotName(workingKids[i]) != null) continue;
|
|
267
|
+
if (filteredIdx === head) {
|
|
268
|
+
originalIdx = i;
|
|
269
|
+
break;
|
|
270
|
+
}
|
|
271
|
+
filteredIdx++;
|
|
272
|
+
}
|
|
273
|
+
if (originalIdx === -1) return root;
|
|
274
|
+
let newWorkingKids: unknown[];
|
|
275
|
+
if (rest.length === 0) {
|
|
276
|
+
// Leaf — splice the child out.
|
|
277
|
+
newWorkingKids = workingKids.filter((_, i) => i !== originalIdx);
|
|
278
|
+
} else {
|
|
279
|
+
const targetKid = workingKids[originalIdx] as MdxJsxFlowElement;
|
|
280
|
+
const updatedKid = removeMdastNodeAtPath(targetKid, rest);
|
|
281
|
+
newWorkingKids = [...workingKids];
|
|
282
|
+
newWorkingKids[originalIdx] = updatedKid;
|
|
283
|
+
}
|
|
284
|
+
if (isUnwrapped) {
|
|
285
|
+
const paragraphWrap = originalKids[0] as { children?: unknown[] };
|
|
286
|
+
return {
|
|
287
|
+
...root,
|
|
288
|
+
children: [{ ...paragraphWrap, children: newWorkingKids }] as MdxJsxFlowElement['children'],
|
|
289
|
+
};
|
|
290
|
+
}
|
|
291
|
+
return { ...root, children: newWorkingKids as MdxJsxFlowElement['children'] };
|
|
292
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether a card's action menu should open above its trigger instead of below —
|
|
3
|
+
* true when the menu would run past the viewport bottom but still fits above it.
|
|
4
|
+
* Card menus are plain absolutely-positioned divs, so anything hanging below the
|
|
5
|
+
* fold is unreachable: the scroll container will not extend for it.
|
|
6
|
+
*/
|
|
7
|
+
export function menuOpensUp(
|
|
8
|
+
trigger: Pick<DOMRect, 'top' | 'bottom'>,
|
|
9
|
+
viewportHeight: number,
|
|
10
|
+
menuHeight = 160,
|
|
11
|
+
): boolean {
|
|
12
|
+
return trigger.bottom + menuHeight > viewportHeight && trigger.top > menuHeight;
|
|
13
|
+
}
|