@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,426 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
import { IMPORT_RE } from './site-css-layer.js';
|
|
3
|
+
const getSharedState = () => {
|
|
4
|
+
if (typeof window !== 'undefined') {
|
|
5
|
+
if (!window.__SITE_STYLES_STATE__) {
|
|
6
|
+
window.__SITE_STYLES_STATE__ = {
|
|
7
|
+
styles: [],
|
|
8
|
+
subscribers: new Set(),
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
return window.__SITE_STYLES_STATE__;
|
|
12
|
+
}
|
|
13
|
+
// SSR fallback
|
|
14
|
+
return { styles: [], subscribers: new Set() };
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Register the site CSS strings. Called by the virtual module on initial
|
|
18
|
+
* load and on HMR when any of the imported CSS files change. Notifies all
|
|
19
|
+
* subscribers so mounted iframe bridges re-inject fresh style tags.
|
|
20
|
+
*/
|
|
21
|
+
export function setSiteStyles(styles) {
|
|
22
|
+
const state = getSharedState();
|
|
23
|
+
state.styles = styles;
|
|
24
|
+
state.subscribers.forEach((fn) => {
|
|
25
|
+
fn(styles);
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Get the current site CSS strings synchronously.
|
|
30
|
+
*/
|
|
31
|
+
export function getSiteStyles() {
|
|
32
|
+
return getSharedState().styles;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* React hook that returns the current site CSS strings and re-renders the
|
|
36
|
+
* caller when they change (HMR support).
|
|
37
|
+
*/
|
|
38
|
+
export function useSiteStyles() {
|
|
39
|
+
const [styles, setStyles] = useState(() => getSharedState().styles);
|
|
40
|
+
useEffect(() => {
|
|
41
|
+
const state = getSharedState();
|
|
42
|
+
// Re-sync in case styles changed between render and effect
|
|
43
|
+
if (state.styles !== styles) {
|
|
44
|
+
setStyles(state.styles);
|
|
45
|
+
}
|
|
46
|
+
state.subscribers.add(setStyles);
|
|
47
|
+
return () => {
|
|
48
|
+
state.subscribers.delete(setStyles);
|
|
49
|
+
};
|
|
50
|
+
}, [styles]);
|
|
51
|
+
return styles;
|
|
52
|
+
}
|
|
53
|
+
// ---------------------------------------------------------------------------
|
|
54
|
+
// editorStyles registry — narrow CSS path for the MDX editor admin shell.
|
|
55
|
+
// Mirrors the siteStyles pattern; see the top-of-file comment for why the
|
|
56
|
+
// split exists.
|
|
57
|
+
// ---------------------------------------------------------------------------
|
|
58
|
+
const getEditorStylesState = () => {
|
|
59
|
+
if (typeof window !== 'undefined') {
|
|
60
|
+
if (!window.__EDITOR_STYLES_STATE__) {
|
|
61
|
+
window.__EDITOR_STYLES_STATE__ = { styles: [], subscribers: new Set() };
|
|
62
|
+
}
|
|
63
|
+
return window.__EDITOR_STYLES_STATE__;
|
|
64
|
+
}
|
|
65
|
+
return { styles: [], subscribers: new Set() };
|
|
66
|
+
};
|
|
67
|
+
export function setEditorStyles(styles) {
|
|
68
|
+
const state = getEditorStylesState();
|
|
69
|
+
state.styles = styles;
|
|
70
|
+
state.subscribers.forEach((fn) => {
|
|
71
|
+
fn(styles);
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
export function getEditorStyles() {
|
|
75
|
+
return getEditorStylesState().styles;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Interpret a styles-endpoint response body. Accepts only `text/css` — the
|
|
79
|
+
* real endpoint (astro-cms styles-endpoint) always declares it. Where no such
|
|
80
|
+
* endpoint exists, a catch-all route can answer the same path with
|
|
81
|
+
* `200 text/html`: treating that HTML as CSS would not only inject garbage,
|
|
82
|
+
* it would count as a NON-EMPTY styles result and suppress every fallback
|
|
83
|
+
* tier below the endpoint in the editor style chain.
|
|
84
|
+
*/
|
|
85
|
+
export function stylesFromResponse(contentType, body) {
|
|
86
|
+
if (!/^text\/css\b/i.test(contentType ?? ''))
|
|
87
|
+
return [];
|
|
88
|
+
return body ? [body] : [];
|
|
89
|
+
}
|
|
90
|
+
export function useEditorStyles() {
|
|
91
|
+
const [styles, setStyles] = useState(() => getEditorStylesState().styles);
|
|
92
|
+
useEffect(() => {
|
|
93
|
+
const state = getEditorStylesState();
|
|
94
|
+
if (state.styles !== styles)
|
|
95
|
+
setStyles(state.styles);
|
|
96
|
+
state.subscribers.add(setStyles);
|
|
97
|
+
return () => {
|
|
98
|
+
state.subscribers.delete(setStyles);
|
|
99
|
+
};
|
|
100
|
+
}, [styles]);
|
|
101
|
+
return styles;
|
|
102
|
+
}
|
|
103
|
+
// ---------------------------------------------------------------------------
|
|
104
|
+
// Fetched site styles — runtime CSS discovery from the integration endpoint.
|
|
105
|
+
//
|
|
106
|
+
// Replaces the manually-curated `editorStyles` list with the host's real CSS
|
|
107
|
+
// for the page being edited. The integration walks Vite's module graph from
|
|
108
|
+
// the page's URL and returns the concatenated stylesheets (Tailwind, theme
|
|
109
|
+
// CSS, framework-scoped styles) so the editor matches the published page.
|
|
110
|
+
// ---------------------------------------------------------------------------
|
|
111
|
+
/**
|
|
112
|
+
* Fetch the host's CSS for a route URL from the integration's
|
|
113
|
+
* `/api/styles` endpoint and return it as a single-element array suitable
|
|
114
|
+
* for `useInjectHostStyles`. Empty until the fetch resolves; empty if no
|
|
115
|
+
* URL is given.
|
|
116
|
+
*/
|
|
117
|
+
export function useFetchedSiteStyles(routeUrl, options = {}) {
|
|
118
|
+
const [styles, setStyles] = useState([]);
|
|
119
|
+
const cmsRoute = options.cmsRoute ?? '/__cms';
|
|
120
|
+
useEffect(() => {
|
|
121
|
+
if (!routeUrl) {
|
|
122
|
+
setStyles([]);
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
let cancelled = false;
|
|
126
|
+
const endpoint = `${cmsRoute}/api/styles?url=${encodeURIComponent(routeUrl)}`;
|
|
127
|
+
fetch(endpoint)
|
|
128
|
+
.then((res) => {
|
|
129
|
+
if (!res.ok)
|
|
130
|
+
throw new Error(`Styles endpoint returned ${res.status}`);
|
|
131
|
+
const contentType = res.headers.get('content-type');
|
|
132
|
+
return res.text().then((body) => {
|
|
133
|
+
const styles = stylesFromResponse(contentType, body);
|
|
134
|
+
// A non-CSS 200 means the endpoint doesn't exist on this origin
|
|
135
|
+
// (a catch-all route answered the path). Warn so the fallthrough
|
|
136
|
+
// is visible, and return empty so the fallback tiers stay reachable.
|
|
137
|
+
if (styles.length === 0 && body) {
|
|
138
|
+
console.warn(`[Conloca] Styles endpoint answered ${contentType ?? 'no content-type'} — ignoring.`);
|
|
139
|
+
}
|
|
140
|
+
return styles;
|
|
141
|
+
});
|
|
142
|
+
})
|
|
143
|
+
.then((styles) => {
|
|
144
|
+
if (cancelled)
|
|
145
|
+
return;
|
|
146
|
+
setStyles(styles);
|
|
147
|
+
})
|
|
148
|
+
.catch((err) => {
|
|
149
|
+
if (cancelled)
|
|
150
|
+
return;
|
|
151
|
+
console.warn('[Conloca] Failed to fetch site styles:', err);
|
|
152
|
+
setStyles([]);
|
|
153
|
+
});
|
|
154
|
+
return () => {
|
|
155
|
+
cancelled = true;
|
|
156
|
+
};
|
|
157
|
+
}, [routeUrl, cmsRoute]);
|
|
158
|
+
return styles;
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Fetches the host page's wrappers for the given route URL. The
|
|
162
|
+
* editor mirrors them: the contenteditable is wrapped in a clone of
|
|
163
|
+
* `content` (via the `hostWrapperPlugin`), and the code-block frame
|
|
164
|
+
* picks up the `codeBlock` classes so the host's code-block CSS
|
|
165
|
+
* reaches via the cascade — no shipped mirror needed.
|
|
166
|
+
*
|
|
167
|
+
* Returns `{ content: null, codeBlock: null }` while the fetch is in
|
|
168
|
+
* flight or when the host route has no discoverable wrappers.
|
|
169
|
+
*
|
|
170
|
+
* Re-fetches whenever `routeUrl` changes (eg locale switch / doc
|
|
171
|
+
* switch). Errors are logged and swallowed; the caller falls back to
|
|
172
|
+
* the no-wrapper render path.
|
|
173
|
+
*/
|
|
174
|
+
export function useFetchedHostWrappers(routeUrl, options = {}) {
|
|
175
|
+
const [wrappers, setWrappers] = useState({ content: null, codeBlock: null });
|
|
176
|
+
const cmsRoute = options.cmsRoute ?? '/__cms';
|
|
177
|
+
useEffect(() => {
|
|
178
|
+
if (!routeUrl) {
|
|
179
|
+
setWrappers({ content: null, codeBlock: null });
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
let cancelled = false;
|
|
183
|
+
const endpoint = `${cmsRoute}/api/content-wrapper?url=${encodeURIComponent(routeUrl)}`;
|
|
184
|
+
fetch(endpoint)
|
|
185
|
+
.then((res) => {
|
|
186
|
+
if (!res.ok)
|
|
187
|
+
throw new Error(`Content-wrapper endpoint returned ${res.status}`);
|
|
188
|
+
return res.json();
|
|
189
|
+
})
|
|
190
|
+
.then((data) => {
|
|
191
|
+
if (cancelled)
|
|
192
|
+
return;
|
|
193
|
+
setWrappers({ content: data?.content ?? null, codeBlock: data?.codeBlock ?? null });
|
|
194
|
+
})
|
|
195
|
+
.catch((err) => {
|
|
196
|
+
if (cancelled)
|
|
197
|
+
return;
|
|
198
|
+
console.warn('[Conloca] Failed to fetch host wrappers:', err);
|
|
199
|
+
setWrappers({ content: null, codeBlock: null });
|
|
200
|
+
});
|
|
201
|
+
return () => {
|
|
202
|
+
cancelled = true;
|
|
203
|
+
};
|
|
204
|
+
}, [routeUrl, cmsRoute]);
|
|
205
|
+
return wrappers;
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Put broad host CSS inside the editor surface instead of letting it style
|
|
209
|
+
* the surrounding admin app. Root selectors are moved onto the scope root so
|
|
210
|
+
* host variables and root theme selectors still work inside the editor.
|
|
211
|
+
*/
|
|
212
|
+
export function scopeHostCss(css, scopeSelector) {
|
|
213
|
+
const selectorBoundary = String.raw `(?=$|[\s.#:[>+~,{])`;
|
|
214
|
+
const selectorStart = String.raw `(^[ \t]*|[{};]\s*|,\s*|\/\*[\s\S]*?\*\/\s*)`;
|
|
215
|
+
const rebasedRoots = css
|
|
216
|
+
.replace(new RegExp(`${selectorStart}\\.dark${selectorBoundary}`, 'gm'), '$1:scope:is(.dark, .dark *)')
|
|
217
|
+
// Same rebase for the attribute form. A host that keys its theme off
|
|
218
|
+
// `[data-theme="dark"]` (Starlight, for one) writes it as
|
|
219
|
+
// a bare compound, which inside `@scope` matches only DESCENDANTS of the
|
|
220
|
+
// scope root — never the root itself. Its `:root` counterpart does get
|
|
221
|
+
// rebased below, so the light tokens land and the dark ones silently do
|
|
222
|
+
// not, leaving host rules that read those tokens resolving light inside a
|
|
223
|
+
// dark editor.
|
|
224
|
+
.replace(new RegExp(`${selectorStart}\\[data-theme=("|'|)([\\w-]+)\\2\\]${selectorBoundary}`, 'gm'), '$1:scope:is([data-theme="$3"], [data-theme="$3"] *)')
|
|
225
|
+
.replace(new RegExp(`${selectorStart}(?::root|:host|html|body)${selectorBoundary}`, 'gm'), '$1:scope')
|
|
226
|
+
.replace(/(:scope:is\(\.dark, \.dark \*\))(?:\s*>\s*|\s+)(?:html|body)\b/g, '$1')
|
|
227
|
+
.replace(/:scope([^,{}]*?)(?:\s*>\s*|\s+)(?:html|body)\b/g, ':scope$1');
|
|
228
|
+
return `@scope (${scopeSelector}) {\n${rebasedRoots}\n}`;
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* Typography bridged off the scope root once the host's own sheet has been
|
|
232
|
+
* injected and applied. `editor-styles.css` already consumes every one of
|
|
233
|
+
* these via `var(--conloca-host-*, …)` on the contenteditable, and the
|
|
234
|
+
* computed-style probe already emits the same names — this is the same
|
|
235
|
+
* contract, resolved from the scope root instead of a cross-origin iframe.
|
|
236
|
+
*
|
|
237
|
+
* Reading them here works because `scopeHostCss` rebases the host's `:root`
|
|
238
|
+
* and `body` rules onto `:scope`, ie the scope root itself. So the host's own
|
|
239
|
+
* page typography IS the computed style of that element, in the editor's
|
|
240
|
+
* current theme, in this document. No iframe, no headless browser.
|
|
241
|
+
*
|
|
242
|
+
* Without this the contenteditable falls back to the L0 platform baseline
|
|
243
|
+
* (`ui-sans-serif`, `#181818`) even when the host's face and ink are sitting
|
|
244
|
+
* right there on the surround — the host's `body { font-family }` is layered
|
|
245
|
+
* and inherited, and the editor's own unlayered rule overrides inheritance.
|
|
246
|
+
*
|
|
247
|
+
* All of these are INHERITED properties, which is what makes the
|
|
248
|
+
* "did the host actually declare this?" test below possible.
|
|
249
|
+
*/
|
|
250
|
+
const HOST_TYPOGRAPHY_BRIDGE = [
|
|
251
|
+
['font-family', '--conloca-host-font-family'],
|
|
252
|
+
['font-size', '--conloca-host-font-size'],
|
|
253
|
+
['font-weight', '--conloca-host-font-weight'],
|
|
254
|
+
['font-style', '--conloca-host-font-style'],
|
|
255
|
+
['line-height', '--conloca-host-line-height'],
|
|
256
|
+
['letter-spacing', '--conloca-host-letter-spacing'],
|
|
257
|
+
];
|
|
258
|
+
/**
|
|
259
|
+
* Every variable this bridge may write, for cleanup.
|
|
260
|
+
*
|
|
261
|
+
* `--conloca-host-body-bg` is the surround region's paint (main.css,
|
|
262
|
+
* FragmentEditor) and predates the rest, but the probe publishes it too, so it
|
|
263
|
+
* sits inside the `bridgeHostVars` gate with every other shared name.
|
|
264
|
+
*
|
|
265
|
+
* `--conloca-host-prose-bg` is the one name here the probe does NOT share, so
|
|
266
|
+
* be explicit about why that is not a fork for one setup: it belongs to the
|
|
267
|
+
* prose-surface tier's paper, and that tier only exists when live discovery
|
|
268
|
+
* did NOT deliver — a host app on another origin AND a production build alike.
|
|
269
|
+
* Where the probe runs, the tier is empty (`deriveProseSurfaceStyles` is
|
|
270
|
+
* gated in `CMSMDXEditor`), so there is no paper to colour and nothing for the
|
|
271
|
+
* probe to publish. It is scoped to the tier it serves, not to a setup. Merging
|
|
272
|
+
* it into `--conloca-host-body-bg` would be wrong in the other direction: that
|
|
273
|
+
* one is published whenever the host paints anything, while the paper is
|
|
274
|
+
* published only together with a host ink, so a light card can never end up
|
|
275
|
+
* carrying light text.
|
|
276
|
+
*/
|
|
277
|
+
const HOST_BRIDGE_VARS = [
|
|
278
|
+
'--conloca-host-body-bg',
|
|
279
|
+
'--conloca-host-prose-bg',
|
|
280
|
+
'--conloca-host-color',
|
|
281
|
+
...HOST_TYPOGRAPHY_BRIDGE.map(([, variable]) => variable),
|
|
282
|
+
];
|
|
283
|
+
/**
|
|
284
|
+
* Inject host CSS strings into the current document's `<head>` while the
|
|
285
|
+
* calling component is mounted. Each stylesheet can be wrapped in a named
|
|
286
|
+
* cascade layer and confined to one editor subtree.
|
|
287
|
+
*
|
|
288
|
+
* `@import` statements are hoisted to the top of the injected `<style>` tag
|
|
289
|
+
* because they must come before other rules to be valid. Hosts using
|
|
290
|
+
* Tailwind / Google Fonts depend on this.
|
|
291
|
+
*
|
|
292
|
+
* `bridgeHostVars` controls the `--conloca-host-*` bridge below, and defaults
|
|
293
|
+
* to on. Pass `false` when the computed-style probe has delivered: the probe
|
|
294
|
+
* reads the REAL rendered page, which is strictly better than anything this
|
|
295
|
+
* bridge can derive from a stylesheet, and the two write the same variable
|
|
296
|
+
* names. Without the gate the bridge wins by accident rather than by design —
|
|
297
|
+
* it writes inline properties on `<html>` while the probe emits a `:root`
|
|
298
|
+
* rule, and inline outranks any stylesheet. That would silently supersede the
|
|
299
|
+
* probe on a same-origin site, where it works.
|
|
300
|
+
*/
|
|
301
|
+
export function useInjectHostStyles(layerName, styles, options) {
|
|
302
|
+
const scopeSelector = options?.scopeSelector;
|
|
303
|
+
const layered = options?.layered !== false;
|
|
304
|
+
const bridgeHostVars = options?.bridgeHostVars !== false;
|
|
305
|
+
useEffect(() => {
|
|
306
|
+
if (typeof document === 'undefined' || styles.length === 0)
|
|
307
|
+
return;
|
|
308
|
+
const tags = [];
|
|
309
|
+
const marker = `data-conloca-host-styles-${layerName}`;
|
|
310
|
+
for (const css of styles) {
|
|
311
|
+
const imports = [];
|
|
312
|
+
// Both `@import` shapes, via the same regex the canvas layer uses. The
|
|
313
|
+
// `url(…)`-only pattern this used to carry missed the minified
|
|
314
|
+
// bare-string form (`@import"https://fonts.googleapis.com/…"`) that real
|
|
315
|
+
// Astro output opens with, leaving it stranded after the `@layer`
|
|
316
|
+
// prelude where the parser drops it.
|
|
317
|
+
const cleaned = css.replace(IMPORT_RE, (m) => {
|
|
318
|
+
imports.push(m.trim());
|
|
319
|
+
return '';
|
|
320
|
+
});
|
|
321
|
+
// Probe typography stays unlayered so it can beat the editor's prose
|
|
322
|
+
// defaults. Full host CSS is both layered and scoped to the editor
|
|
323
|
+
// surface; broad host resets and utility names never reach admin chrome.
|
|
324
|
+
const scoped = scopeSelector ? scopeHostCss(cleaned, scopeSelector) : cleaned;
|
|
325
|
+
const body = layered ? `@layer ${layerName} {\n${scoped}\n}` : scoped;
|
|
326
|
+
const wrapped = `${imports.join('\n')}\n${body}`;
|
|
327
|
+
const tag = document.createElement('style');
|
|
328
|
+
tag.setAttribute(marker, '');
|
|
329
|
+
tag.textContent = wrapped;
|
|
330
|
+
document.head.appendChild(tag);
|
|
331
|
+
tags.push(tag);
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* Bridge the host page's own resolved typography and background into CSS
|
|
335
|
+
* custom properties the editor's content surround and contenteditable
|
|
336
|
+
* read. Works together with the `hostWrapperPlugin` (which mirrors the
|
|
337
|
+
* host's `<main>`/marked element around the contenteditable):
|
|
338
|
+
*
|
|
339
|
+
* - Editor's chrome wrapper paints `bg-page` (the CMS grey).
|
|
340
|
+
* - Inside the chrome, the content column paints the host body
|
|
341
|
+
* bg via this bridged var (`--conloca-host-body-bg`).
|
|
342
|
+
* - Inside that surround, the host's content wrapper (eg
|
|
343
|
+
* `<main>`) is rendered around the contenteditable. Hosts who
|
|
344
|
+
* paint a card surface on that wrapper get the paint; hosts
|
|
345
|
+
* like Starlight whose `<main>` is transparent rely on the
|
|
346
|
+
* surround's body bg showing through.
|
|
347
|
+
*
|
|
348
|
+
* Written as inline custom properties on `<html>` so they outrank the
|
|
349
|
+
* prose-surface tier's platform fallbacks.
|
|
350
|
+
*
|
|
351
|
+
* Defers a frame so the freshly-appended `<style>` tags actually
|
|
352
|
+
* apply before we read the scoped replacement for the host body.
|
|
353
|
+
*/
|
|
354
|
+
const rafId = scopeSelector
|
|
355
|
+
? requestAnimationFrame(() => {
|
|
356
|
+
const scopeRoot = document.querySelector(scopeSelector);
|
|
357
|
+
if (!scopeRoot)
|
|
358
|
+
return;
|
|
359
|
+
const computed = getComputedStyle(scopeRoot);
|
|
360
|
+
// Everything below is the contract the PROBE also fills, so it is
|
|
361
|
+
// gated: when the probe delivered, it wins.
|
|
362
|
+
if (!bridgeHostVars)
|
|
363
|
+
return;
|
|
364
|
+
// The surround region's paint (main.css `.conloca-mdx-editor-surround`,
|
|
365
|
+
// also referenced by FragmentEditor). Inside the gate with the rest:
|
|
366
|
+
// the probe publishes this same variable as a `:root` rule, and the
|
|
367
|
+
// inline value written here outranks that rule permanently, latching
|
|
368
|
+
// whatever this read-back caught on its first frame — which would
|
|
369
|
+
// leave a light paper under the probe's dark ink. Gating costs a
|
|
370
|
+
// same-origin surround nothing: where the probe runs, its own rule
|
|
371
|
+
// paints the region. `background-color` is not inherited, so
|
|
372
|
+
// transparency is a real "host painted nothing" sentinel.
|
|
373
|
+
const background = computed.backgroundColor;
|
|
374
|
+
const painted = background && background !== 'rgba(0, 0, 0, 0)' && background !== 'transparent';
|
|
375
|
+
if (painted)
|
|
376
|
+
document.documentElement.style.setProperty('--conloca-host-body-bg', background);
|
|
377
|
+
// "Did the host actually declare this?" — the whole correctness of
|
|
378
|
+
// the bridge. For INHERITED properties every element computes a
|
|
379
|
+
// value, so a host that declares no `body { color }` still reports
|
|
380
|
+
// one here: the admin chrome's, inherited, which is near-white in
|
|
381
|
+
// the SPA's dark theme. Publishing that as the host's ink would put
|
|
382
|
+
// near-white text on a light paper — the very defect this fixes.
|
|
383
|
+
//
|
|
384
|
+
// `scopeHostCss` rebases the host's `:root`/`body` rules onto
|
|
385
|
+
// `:scope`, ie onto this element, so a host declaration is exactly
|
|
386
|
+
// what makes this element differ from its parent. No guessing.
|
|
387
|
+
const outer = scopeRoot.parentElement ? getComputedStyle(scopeRoot.parentElement) : null;
|
|
388
|
+
const hostDeclared = (property) => {
|
|
389
|
+
const value = computed.getPropertyValue(property);
|
|
390
|
+
if (!value || value === 'normal' || value === 'none')
|
|
391
|
+
return null;
|
|
392
|
+
if (outer && value === outer.getPropertyValue(property))
|
|
393
|
+
return null;
|
|
394
|
+
return value;
|
|
395
|
+
};
|
|
396
|
+
for (const [property, variable] of HOST_TYPOGRAPHY_BRIDGE) {
|
|
397
|
+
const value = hostDeclared(property);
|
|
398
|
+
if (value !== null)
|
|
399
|
+
document.documentElement.style.setProperty(variable, value);
|
|
400
|
+
}
|
|
401
|
+
// The prose surface's ink and paper, published as a PAIR or not at
|
|
402
|
+
// all. Mixing them is what makes text vanish: the host's dark page
|
|
403
|
+
// background under the platform's dark ink floor is as unreadable
|
|
404
|
+
// as the platform's light paper under a host's light ink. When
|
|
405
|
+
// either half is missing, both stay on the platform pairing, which
|
|
406
|
+
// is contrast-checked by construction (light paper, dark ink).
|
|
407
|
+
const ink = hostDeclared('color');
|
|
408
|
+
if (painted && ink !== null) {
|
|
409
|
+
document.documentElement.style.setProperty('--conloca-host-prose-bg', background);
|
|
410
|
+
document.documentElement.style.setProperty('--conloca-host-color', ink);
|
|
411
|
+
}
|
|
412
|
+
})
|
|
413
|
+
: null;
|
|
414
|
+
return () => {
|
|
415
|
+
if (rafId !== null) {
|
|
416
|
+
cancelAnimationFrame(rafId);
|
|
417
|
+
for (const variable of HOST_BRIDGE_VARS) {
|
|
418
|
+
document.documentElement.style.removeProperty(variable);
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
for (const tag of tags)
|
|
422
|
+
tag.remove();
|
|
423
|
+
};
|
|
424
|
+
}, [styles, layerName, layered, scopeSelector, bridgeHostVars]);
|
|
425
|
+
}
|
|
426
|
+
//# sourceMappingURL=site-styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"site-styles.js","sourceRoot":"","sources":["../../src/site-styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO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;oBAClF,QAAQ,CAAC,eAAe,CAAC,KAAK,CAAC,WAAW,CAAC,sBAAsB,EAAE,GAAG,CAAC,CAAC;gBAC1E,CAAC;YACH,CAAC,CAAC;YACJ,CAAC,CAAC,IAAI,CAAC;QAET,OAAO,GAAG,EAAE;YACV,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;gBACnB,oBAAoB,CAAC,KAAK,CAAC,CAAC;gBAC5B,KAAK,MAAM,QAAQ,IAAI,gBAAgB,EAAE,CAAC;oBACxC,QAAQ,CAAC,eAAe,CAAC,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;gBAC1D,CAAC;YACH,CAAC;YACD,KAAK,MAAM,GAAG,IAAI,IAAI;gBAAE,GAAG,CAAC,MAAM,EAAE,CAAC;QACvC,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,aAAa,EAAE,cAAc,CAAC,CAAC,CAAC;AAClE,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The admin theme preference: storage key, change-event name, resolution, the
|
|
3
|
+
* `<html>` write, and the pre-paint copy of that write html entries carry.
|
|
4
|
+
*
|
|
5
|
+
* Deliberately non-React. `ThemeProvider` (`hooks/useTheme.tsx`) drives this
|
|
6
|
+
* from inside the editor, but a host may render screens of its own BEFORE
|
|
7
|
+
* the editor mounts, and those need the same key, the same resolution and the
|
|
8
|
+
* same DOM write with no React tree available — so the shared unit has to be a
|
|
9
|
+
* plain module, not the hook.
|
|
10
|
+
*/
|
|
11
|
+
export type ThemePreference = 'light' | 'dark' | 'system';
|
|
12
|
+
export type ResolvedTheme = 'light' | 'dark';
|
|
13
|
+
/** `localStorage` key holding the user's admin theme preference. */
|
|
14
|
+
export declare const THEME_STORAGE_KEY = "conloca-theme";
|
|
15
|
+
/**
|
|
16
|
+
* Same-document theme-change signal. The `storage` event does not fire in the
|
|
17
|
+
* tab that writes, so any same-tab writer (a host's own theme toggle) dispatches
|
|
18
|
+
* this on `window` and every in-document listener reapplies.
|
|
19
|
+
*/
|
|
20
|
+
export declare const THEME_CHANGED_EVENT = "conloca-theme-changed";
|
|
21
|
+
/**
|
|
22
|
+
* Body of the attribute-less inline `<script>` every html entry has to carry.
|
|
23
|
+
*
|
|
24
|
+
* An entry paints the theme on the very first frame, before the module graph
|
|
25
|
+
* exists, so it cannot import `applyTheme` — it hand-carries this text instead.
|
|
26
|
+
* Published here so those copies have one source to be checked against, and so
|
|
27
|
+
* a host embedding the editor can paste the same snippet into its own shell.
|
|
28
|
+
* Behavior-equivalent to `applyTheme(resolveTheme(getStoredTheme()))` and
|
|
29
|
+
* reading the same key, so the theme core is a no-op once it hydrates.
|
|
30
|
+
*/
|
|
31
|
+
export declare const PRE_PAINT_THEME_SCRIPT = "\n(() => {\n try {\n const stored = localStorage.getItem('conloca-theme');\n const pref = stored === 'light' || stored === 'dark' || stored === 'system' ? stored : 'system';\n const resolved =\n pref === 'system' ? (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light') : pref;\n if (resolved === 'dark') document.documentElement.classList.add('dark');\n document.documentElement.setAttribute('data-theme', resolved);\n document.documentElement.style.colorScheme = resolved;\n } catch (_e) {\n // localStorage / matchMedia unavailable (private mode,\n // ancient browser) \u2014 fall back to the light default.\n }\n})();\n";
|
|
32
|
+
/**
|
|
33
|
+
* Reduce a pre-paint script body to its comparable form. Every entry indents
|
|
34
|
+
* the snippet to sit at its own nesting depth, so only each line's content is
|
|
35
|
+
* significant — never its leading whitespace or the blank lines around it.
|
|
36
|
+
*/
|
|
37
|
+
export declare function normalizePrePaintScript(source: string): string;
|
|
38
|
+
/** The OS-level color-scheme preference (`light` when there is no window). */
|
|
39
|
+
export declare function getSystemTheme(): ResolvedTheme;
|
|
40
|
+
/** The stored preference, or `system` when absent or unrecognized. */
|
|
41
|
+
export declare function getStoredTheme(): ThemePreference;
|
|
42
|
+
/** Resolve a preference to a concrete scheme, consulting the OS for `system`. */
|
|
43
|
+
export declare function resolveTheme(preference: ThemePreference): ResolvedTheme;
|
|
44
|
+
/** Write the resolved scheme to `<html>`: `dark` class, `data-theme`, `color-scheme`. */
|
|
45
|
+
export declare function applyTheme(resolved: ResolvedTheme): void;
|
|
46
|
+
//# sourceMappingURL=theme.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/theme.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,MAAM,GAAG,QAAQ,CAAC;AAC1D,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,MAAM,CAAC;AAE7C,oEAAoE;AACpE,eAAO,MAAM,iBAAiB,kBAAkB,CAAC;AAEjD;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,0BAA0B,CAAC;AAE3D;;;;;;;;;GASG;AACH,eAAO,MAAM,sBAAsB,4qBAelC,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAM9D;AAED,8EAA8E;AAC9E,wBAAgB,cAAc,IAAI,aAAa,CAG9C;AAED,sEAAsE;AACtE,wBAAgB,cAAc,IAAI,eAAe,CAKhD;AAED,iFAAiF;AACjF,wBAAgB,YAAY,CAAC,UAAU,EAAE,eAAe,GAAG,aAAa,CAEvE;AAED,yFAAyF;AACzF,wBAAgB,UAAU,CAAC,QAAQ,EAAE,aAAa,GAAG,IAAI,CAiBxD"}
|
package/dist/ts/theme.js
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The admin theme preference: storage key, change-event name, resolution, the
|
|
3
|
+
* `<html>` write, and the pre-paint copy of that write html entries carry.
|
|
4
|
+
*
|
|
5
|
+
* Deliberately non-React. `ThemeProvider` (`hooks/useTheme.tsx`) drives this
|
|
6
|
+
* from inside the editor, but a host may render screens of its own BEFORE
|
|
7
|
+
* the editor mounts, and those need the same key, the same resolution and the
|
|
8
|
+
* same DOM write with no React tree available — so the shared unit has to be a
|
|
9
|
+
* plain module, not the hook.
|
|
10
|
+
*/
|
|
11
|
+
/** `localStorage` key holding the user's admin theme preference. */
|
|
12
|
+
export const THEME_STORAGE_KEY = 'conloca-theme';
|
|
13
|
+
/**
|
|
14
|
+
* Same-document theme-change signal. The `storage` event does not fire in the
|
|
15
|
+
* tab that writes, so any same-tab writer (a host's own theme toggle) dispatches
|
|
16
|
+
* this on `window` and every in-document listener reapplies.
|
|
17
|
+
*/
|
|
18
|
+
export const THEME_CHANGED_EVENT = 'conloca-theme-changed';
|
|
19
|
+
/**
|
|
20
|
+
* Body of the attribute-less inline `<script>` every html entry has to carry.
|
|
21
|
+
*
|
|
22
|
+
* An entry paints the theme on the very first frame, before the module graph
|
|
23
|
+
* exists, so it cannot import `applyTheme` — it hand-carries this text instead.
|
|
24
|
+
* Published here so those copies have one source to be checked against, and so
|
|
25
|
+
* a host embedding the editor can paste the same snippet into its own shell.
|
|
26
|
+
* Behavior-equivalent to `applyTheme(resolveTheme(getStoredTheme()))` and
|
|
27
|
+
* reading the same key, so the theme core is a no-op once it hydrates.
|
|
28
|
+
*/
|
|
29
|
+
export const PRE_PAINT_THEME_SCRIPT = `
|
|
30
|
+
(() => {
|
|
31
|
+
try {
|
|
32
|
+
const stored = localStorage.getItem('${THEME_STORAGE_KEY}');
|
|
33
|
+
const pref = stored === 'light' || stored === 'dark' || stored === 'system' ? stored : 'system';
|
|
34
|
+
const resolved =
|
|
35
|
+
pref === 'system' ? (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light') : pref;
|
|
36
|
+
if (resolved === 'dark') document.documentElement.classList.add('dark');
|
|
37
|
+
document.documentElement.setAttribute('data-theme', resolved);
|
|
38
|
+
document.documentElement.style.colorScheme = resolved;
|
|
39
|
+
} catch (_e) {
|
|
40
|
+
// localStorage / matchMedia unavailable (private mode,
|
|
41
|
+
// ancient browser) — fall back to the light default.
|
|
42
|
+
}
|
|
43
|
+
})();
|
|
44
|
+
`;
|
|
45
|
+
/**
|
|
46
|
+
* Reduce a pre-paint script body to its comparable form. Every entry indents
|
|
47
|
+
* the snippet to sit at its own nesting depth, so only each line's content is
|
|
48
|
+
* significant — never its leading whitespace or the blank lines around it.
|
|
49
|
+
*/
|
|
50
|
+
export function normalizePrePaintScript(source) {
|
|
51
|
+
return source
|
|
52
|
+
.split('\n')
|
|
53
|
+
.map((line) => line.trim())
|
|
54
|
+
.filter((line) => line.length > 0)
|
|
55
|
+
.join('\n');
|
|
56
|
+
}
|
|
57
|
+
/** The OS-level color-scheme preference (`light` when there is no window). */
|
|
58
|
+
export function getSystemTheme() {
|
|
59
|
+
if (typeof window === 'undefined')
|
|
60
|
+
return 'light';
|
|
61
|
+
return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
|
|
62
|
+
}
|
|
63
|
+
/** The stored preference, or `system` when absent or unrecognized. */
|
|
64
|
+
export function getStoredTheme() {
|
|
65
|
+
if (typeof window === 'undefined')
|
|
66
|
+
return 'system';
|
|
67
|
+
const stored = localStorage.getItem(THEME_STORAGE_KEY);
|
|
68
|
+
if (stored === 'light' || stored === 'dark' || stored === 'system')
|
|
69
|
+
return stored;
|
|
70
|
+
return 'system';
|
|
71
|
+
}
|
|
72
|
+
/** Resolve a preference to a concrete scheme, consulting the OS for `system`. */
|
|
73
|
+
export function resolveTheme(preference) {
|
|
74
|
+
return preference === 'system' ? getSystemTheme() : preference;
|
|
75
|
+
}
|
|
76
|
+
/** Write the resolved scheme to `<html>`: `dark` class, `data-theme`, `color-scheme`. */
|
|
77
|
+
export function applyTheme(resolved) {
|
|
78
|
+
const root = document.documentElement;
|
|
79
|
+
if (resolved === 'dark') {
|
|
80
|
+
root.classList.add('dark');
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
root.classList.remove('dark');
|
|
84
|
+
}
|
|
85
|
+
// Many host frameworks key dark-mode tokens off `:root[data-theme="dark"]`
|
|
86
|
+
// (Starlight, shadcn-style themes, custom setups). Mirror the resolved
|
|
87
|
+
// scheme as `data-theme` on <html> so host CSS reaching the editor surface
|
|
88
|
+
// (via `useFetchedSiteStyles`) resolves dark tokens the same way it does on
|
|
89
|
+
// the published page. Without this, host `:root.dark` rules (Tailwind class
|
|
90
|
+
// convention) fire but `[data-theme="dark"]` rules don't — and any token
|
|
91
|
+
// defined only in the latter falls back to its light value, producing
|
|
92
|
+
// visibly different text colors in the editor vs the live page.
|
|
93
|
+
root.setAttribute('data-theme', resolved);
|
|
94
|
+
root.style.colorScheme = resolved;
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=theme.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.js","sourceRoot":"","sources":["../../src/theme.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAKH,oEAAoE;AACpE,MAAM,CAAC,MAAM,iBAAiB,GAAG,eAAe,CAAC;AAEjD;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,uBAAuB,CAAC;AAE3D;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG;;;2CAGK,iBAAiB;;;;;;;;;;;;CAY3D,CAAC;AAEF;;;;GAIG;AACH,MAAM,UAAU,uBAAuB,CAAC,MAAc;IACpD,OAAO,MAAM;SACV,KAAK,CAAC,IAAI,CAAC;SACX,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;SAC1B,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;SACjC,IAAI,CAAC,IAAI,CAAC,CAAC;AAChB,CAAC;AAED,8EAA8E;AAC9E,MAAM,UAAU,cAAc;IAC5B,IAAI,OAAO,MAAM,KAAK,WAAW;QAAE,OAAO,OAAO,CAAC;IAClD,OAAO,MAAM,CAAC,UAAU,CAAC,8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title: string;
|
|
5
|
+
path: string;
|
|
6
|
+
/** Underlying content format. 'puck' = Puck visual editor, 'mdx' = MDX source editor. */
|
|
7
|
+
type: 'puck' | 'mdx';
|
|
8
|
+
status: 'draft' | 'scheduled' | 'published';
|
|
9
|
+
modified: Date;
|
|
10
|
+
locales: string[];
|
|
11
|
+
}
|
|
12
|
+
export interface Fragment {
|
|
13
|
+
id: string;
|
|
14
|
+
title: string;
|
|
15
|
+
preview: string;
|
|
16
|
+
category: string;
|
|
17
|
+
locales: string[];
|
|
18
|
+
etag: string;
|
|
19
|
+
name?: string;
|
|
20
|
+
meta?: FragmentEditable;
|
|
21
|
+
}
|
|
22
|
+
export interface DataEntry {
|
|
23
|
+
id: string;
|
|
24
|
+
title: string;
|
|
25
|
+
description?: string;
|
|
26
|
+
collection: string;
|
|
27
|
+
locales: string[];
|
|
28
|
+
etag: string;
|
|
29
|
+
name?: string;
|
|
30
|
+
meta?: DataEditable;
|
|
31
|
+
}
|
|
32
|
+
export interface PageMetadata {
|
|
33
|
+
title: string;
|
|
34
|
+
description: string;
|
|
35
|
+
pathname: string;
|
|
36
|
+
publishDate: Date | null;
|
|
37
|
+
unpublishDate: Date | null;
|
|
38
|
+
robots?: string;
|
|
39
|
+
canonical?: string;
|
|
40
|
+
customMeta?: Record<string, unknown>;
|
|
41
|
+
/** Content collection the page belongs to — drives schema resolution. */
|
|
42
|
+
collection?: string;
|
|
43
|
+
/** Content format — drives schema resolution and editor selection. */
|
|
44
|
+
type?: 'puck' | 'mdx';
|
|
45
|
+
}
|
|
46
|
+
export type SaveState = 'idle' | 'saving' | 'saved' | 'error' | 'conflict';
|
|
47
|
+
export interface CreatePageData {
|
|
48
|
+
title: string;
|
|
49
|
+
/** The path the page is created at, as the dialog checked it: tidied and under the template's `pathPrefix`. */
|
|
50
|
+
path: string;
|
|
51
|
+
template: string;
|
|
52
|
+
locale: string;
|
|
53
|
+
/** Content format. Defaults to 'puck' (the visual editor). */
|
|
54
|
+
format: 'puck' | 'mdx';
|
|
55
|
+
/** Optional description, surfaced for MDX pages whose renderer uses one. */
|
|
56
|
+
description?: string;
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=types.d.ts.map
|