@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,285 @@
|
|
|
1
|
+
import { type ContentMeta, type ContentMetaPatch, metaString, type UpdateResult } from '@conloca/content-api-client';
|
|
2
|
+
import { getPageSchemas, type PageSchemaDescriptor, resolvePageSchemaEntry } from '../page-schemas.js';
|
|
3
|
+
import type { PageMetadata } from '../types.js';
|
|
4
|
+
import { contentFailureMessage } from './content-failure.js';
|
|
5
|
+
|
|
6
|
+
interface LocaleVersionMetaSource {
|
|
7
|
+
meta: ContentMeta;
|
|
8
|
+
pathname?: string;
|
|
9
|
+
publishAt?: string;
|
|
10
|
+
unpublishAt?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
interface LocalizedEntryMetaSource {
|
|
14
|
+
collection?: string;
|
|
15
|
+
type?: 'puck' | 'mdx' | 'json';
|
|
16
|
+
localized: LocaleVersionMetaSource;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Fields the dialog's conloca-managed sections own when `coreFields.mode`
|
|
21
|
+
* is `'full'` (the legacy default). Kept here so `extractPageMetadata` and
|
|
22
|
+
* `buildMetadataUpdate` agree on what's "core" vs. "custom" without the
|
|
23
|
+
* dialog passing the descriptor through both directions.
|
|
24
|
+
*/
|
|
25
|
+
const FULL_MODE_CORE_KEYS = new Set([
|
|
26
|
+
'title',
|
|
27
|
+
'description',
|
|
28
|
+
'robots',
|
|
29
|
+
'canonical',
|
|
30
|
+
'keywords',
|
|
31
|
+
'ogTitle',
|
|
32
|
+
'ogDescription',
|
|
33
|
+
'ogImage',
|
|
34
|
+
]);
|
|
35
|
+
|
|
36
|
+
function coreKeysFor(descriptor: PageSchemaDescriptor | null): Set<string> {
|
|
37
|
+
const mode = descriptor?.coreFields?.mode ?? 'full';
|
|
38
|
+
// In 'minimal' and 'none' the host schema owns every meta key — nothing
|
|
39
|
+
// is reserved for conloca's hardcoded sections, so customMeta receives
|
|
40
|
+
// the whole `meta` object and the host renders title/description/etc.
|
|
41
|
+
if (mode === 'minimal' || mode === 'none') return new Set();
|
|
42
|
+
return FULL_MODE_CORE_KEYS;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const pad2 = (n: number) => String(n).padStart(2, '0');
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Format a Date for a `datetime-local` input (wall-clock, no zone).
|
|
49
|
+
* `toISOString().slice(0, 16)` is UTC hours and makes the picker lie.
|
|
50
|
+
*/
|
|
51
|
+
export function toDatetimeLocalValue(date: Date | null | undefined): string {
|
|
52
|
+
if (!date || Number.isNaN(date.getTime())) return '';
|
|
53
|
+
return `${date.getFullYear()}-${pad2(date.getMonth() + 1)}-${pad2(date.getDate())}T${pad2(date.getHours())}:${pad2(date.getMinutes())}`;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Parse a `datetime-local` value. Empty means the author cleared the field.
|
|
58
|
+
*/
|
|
59
|
+
export function fromDatetimeLocalValue(value: unknown): Date | null {
|
|
60
|
+
if (value == null || value === '') return null;
|
|
61
|
+
if (value instanceof Date) return Number.isNaN(value.getTime()) ? null : value;
|
|
62
|
+
if (typeof value !== 'string') return null;
|
|
63
|
+
const date = new Date(value);
|
|
64
|
+
return Number.isNaN(date.getTime()) ? null : date;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Extract metadata from a localized content entry into the shape the
|
|
69
|
+
* page-settings dialog renders.
|
|
70
|
+
*
|
|
71
|
+
* Accepts either:
|
|
72
|
+
* - the full `LocalizedEntry` (preferred — `collection`/`type` flow through
|
|
73
|
+
* so the dialog can resolve the right descriptor); or
|
|
74
|
+
* - a bare `LocaleVersion` (legacy — `collection`/`type` are undefined and
|
|
75
|
+
* schema resolution falls back to pathname-prefix matching).
|
|
76
|
+
*
|
|
77
|
+
* The active descriptor's `coreFields.mode` decides which keys are claimed
|
|
78
|
+
* by the conloca sections vs. handed off to the host schema as `customMeta`.
|
|
79
|
+
*/
|
|
80
|
+
export function extractPageMetadata(
|
|
81
|
+
source: LocalizedEntryMetaSource | LocaleVersionMetaSource,
|
|
82
|
+
descriptor?: PageSchemaDescriptor | null,
|
|
83
|
+
): PageMetadata {
|
|
84
|
+
const localized: LocaleVersionMetaSource = 'localized' in source ? source.localized : source;
|
|
85
|
+
const collection = 'localized' in source ? source.collection : undefined;
|
|
86
|
+
const rawType = 'localized' in source ? source.type : undefined;
|
|
87
|
+
const type = rawType === 'puck' || rawType === 'mdx' ? rawType : undefined;
|
|
88
|
+
|
|
89
|
+
// If the caller didn't pre-resolve a descriptor, look it up against the
|
|
90
|
+
// live registry using whatever identity info we have. Legacy callers
|
|
91
|
+
// (LocaleVersion-only) get pathname-prefix matching just like before.
|
|
92
|
+
const effectiveDescriptor =
|
|
93
|
+
descriptor === undefined
|
|
94
|
+
? (resolvePageSchemaEntry(getPageSchemas(), {
|
|
95
|
+
pathname: localized.pathname ?? '/',
|
|
96
|
+
collection,
|
|
97
|
+
type,
|
|
98
|
+
})?.descriptor ?? null)
|
|
99
|
+
: descriptor;
|
|
100
|
+
|
|
101
|
+
const coreKeys = coreKeysFor(effectiveDescriptor);
|
|
102
|
+
const customMeta: Record<string, unknown> = {};
|
|
103
|
+
for (const [key, value] of Object.entries(localized.meta)) {
|
|
104
|
+
if (!coreKeys.has(key)) {
|
|
105
|
+
customMeta[key] = value;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
return {
|
|
110
|
+
title: localized.meta.title || '',
|
|
111
|
+
description: localized.meta.description || '',
|
|
112
|
+
pathname: localized.pathname || '/',
|
|
113
|
+
publishDate: localized.publishAt ? new Date(localized.publishAt) : null,
|
|
114
|
+
unpublishDate: localized.unpublishAt ? new Date(localized.unpublishAt) : null,
|
|
115
|
+
robots: metaString(localized.meta.robots),
|
|
116
|
+
canonical: metaString(localized.meta.canonical),
|
|
117
|
+
customMeta,
|
|
118
|
+
collection,
|
|
119
|
+
type,
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export interface MetadataUpdatePayload {
|
|
124
|
+
meta: ContentMetaPatch;
|
|
125
|
+
pathname: string;
|
|
126
|
+
publishAt: string | null;
|
|
127
|
+
unpublishAt: string | null;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Build the update payload sent to `updateLocalized`.
|
|
132
|
+
*
|
|
133
|
+
* `customMeta` is spread directly into `meta` so nested host fields
|
|
134
|
+
* (e.g. `sidebar: { label, order }`) round-trip into YAML frontmatter
|
|
135
|
+
* untouched. Empty strings are dropped at the VxJSON serialization
|
|
136
|
+
* boundary (commit b640406).
|
|
137
|
+
*/
|
|
138
|
+
export function buildMetadataUpdate(metadata: PageMetadata): MetadataUpdatePayload {
|
|
139
|
+
// The dialog owns every field it renders, so a cleared one must reach the
|
|
140
|
+
// server as an explicit null — undefined is dropped by JSON.stringify and
|
|
141
|
+
// the merge would keep the old value while the dialog reported success.
|
|
142
|
+
// '' counts as cleared: the vxjson serializer never stores an empty string
|
|
143
|
+
// anyway (clearing removes the key).
|
|
144
|
+
const cleared = (value: unknown) => (value === undefined || value === '' ? null : value);
|
|
145
|
+
const custom: Record<string, unknown> = {};
|
|
146
|
+
for (const [key, value] of Object.entries(metadata.customMeta || {})) {
|
|
147
|
+
custom[key] = cleared(value);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
return {
|
|
151
|
+
// The one cast at the boundary: `customMeta` carries values straight out of
|
|
152
|
+
// the metadata form, which tracks them as `unknown` because a form control
|
|
153
|
+
// can yield anything. They are JSON by construction — each one came either
|
|
154
|
+
// from stored meta or from a form control — and the write path serialises
|
|
155
|
+
// them as JSON either way, so they are handed over as meta fields here.
|
|
156
|
+
meta: {
|
|
157
|
+
title: metadata.title,
|
|
158
|
+
description: cleared(metadata.description),
|
|
159
|
+
robots: cleared(metadata.robots),
|
|
160
|
+
canonical: cleared(metadata.canonical),
|
|
161
|
+
...custom,
|
|
162
|
+
} as ContentMetaPatch,
|
|
163
|
+
pathname: metadata.pathname,
|
|
164
|
+
publishAt: metadata.publishDate?.toISOString() || null,
|
|
165
|
+
unpublishAt: metadata.unpublishDate?.toISOString() || null,
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* What a page-settings save throws when the write failed, including one that resolved `{ success: false }`
|
|
171
|
+
* instead of rejecting: the dialog then stays open with the author's edits and shows this message.
|
|
172
|
+
*/
|
|
173
|
+
export function pageSettingsSaveError(result: UpdateResult): Error {
|
|
174
|
+
return new Error(
|
|
175
|
+
result.reason === 'stale_write'
|
|
176
|
+
? 'Someone else saved this page first. Close the dialog, reload to pick up their changes, then try again.'
|
|
177
|
+
: contentFailureMessage(result, 'Saving the page settings failed.'),
|
|
178
|
+
);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* Flatten a nested value tree to dotted keys, only following paths the
|
|
183
|
+
* provided hint map declares.
|
|
184
|
+
*
|
|
185
|
+
* E.g. given `{ sidebar: { label: 'Intro', order: 1 } }` and hints
|
|
186
|
+
* `{ 'sidebar.label': ..., 'sidebar.order': ... }`, returns
|
|
187
|
+
* `{ 'sidebar.label': 'Intro', 'sidebar.order': 1 }`.
|
|
188
|
+
*
|
|
189
|
+
* Keys not mentioned in `hints` are preserved as-is at their original
|
|
190
|
+
* (possibly nested) path so the form's "raw passthrough" branch can
|
|
191
|
+
* still render them.
|
|
192
|
+
*/
|
|
193
|
+
export function flattenForHints(
|
|
194
|
+
value: Record<string, unknown>,
|
|
195
|
+
hintKeys: ReadonlySet<string>,
|
|
196
|
+
): Record<string, unknown> {
|
|
197
|
+
const out: Record<string, unknown> = { ...value };
|
|
198
|
+
for (const dotted of hintKeys) {
|
|
199
|
+
if (!dotted.includes('.')) continue;
|
|
200
|
+
const segments = dotted.split('.');
|
|
201
|
+
let cursor: unknown = value;
|
|
202
|
+
for (const seg of segments) {
|
|
203
|
+
if (cursor && typeof cursor === 'object' && seg in (cursor as Record<string, unknown>)) {
|
|
204
|
+
cursor = (cursor as Record<string, unknown>)[seg];
|
|
205
|
+
} else {
|
|
206
|
+
cursor = undefined;
|
|
207
|
+
break;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
if (cursor !== undefined) {
|
|
211
|
+
out[dotted] = cursor;
|
|
212
|
+
// Take the hinted leaf out of the branch, but keep whatever else the
|
|
213
|
+
// branch holds. Deleting the whole branch here meant unflatten rebuilt
|
|
214
|
+
// only the hinted leaves, so saving page settings destroyed every
|
|
215
|
+
// sibling key the host had not declared a hint for.
|
|
216
|
+
const remainder = pruneLeaf(out[segments[0]], segments.slice(1));
|
|
217
|
+
if (remainder === undefined) {
|
|
218
|
+
delete out[segments[0]];
|
|
219
|
+
} else {
|
|
220
|
+
out[segments[0]] = remainder;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
return out;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* A copy of `branch` without the value at `path`, or undefined once nothing
|
|
229
|
+
* is left. Used to keep the un-hinted half of a nested frontmatter object
|
|
230
|
+
* alive while its hinted leaves are edited as flat form fields.
|
|
231
|
+
*/
|
|
232
|
+
function pruneLeaf(branch: unknown, path: string[]): unknown {
|
|
233
|
+
if (!branch || typeof branch !== 'object' || Array.isArray(branch)) return undefined;
|
|
234
|
+
|
|
235
|
+
const [head, ...rest] = path;
|
|
236
|
+
const copy: Record<string, unknown> = { ...(branch as Record<string, unknown>) };
|
|
237
|
+
|
|
238
|
+
if (rest.length === 0) {
|
|
239
|
+
delete copy[head];
|
|
240
|
+
} else {
|
|
241
|
+
const pruned = pruneLeaf(copy[head], rest);
|
|
242
|
+
if (pruned === undefined) {
|
|
243
|
+
delete copy[head];
|
|
244
|
+
} else {
|
|
245
|
+
copy[head] = pruned;
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
return Object.keys(copy).length > 0 ? copy : undefined;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* Inverse of `flattenForHints` — materialize dotted keys back into nested
|
|
254
|
+
* objects so YAML frontmatter renders as `sidebar: { label, order }`
|
|
255
|
+
* instead of `'sidebar.label': ..., 'sidebar.order': ...`.
|
|
256
|
+
*
|
|
257
|
+
* Non-dotted keys pass through unchanged.
|
|
258
|
+
*/
|
|
259
|
+
export function unflattenFromHints(value: Record<string, unknown>): Record<string, unknown> {
|
|
260
|
+
const out: Record<string, unknown> = {};
|
|
261
|
+
const entries = Object.entries(value);
|
|
262
|
+
|
|
263
|
+
// Plain keys first: a branch that survived flattening (its un-hinted
|
|
264
|
+
// remainder) has to be in place before dotted leaves merge into it,
|
|
265
|
+
// otherwise assigning it later would overwrite them.
|
|
266
|
+
for (const [key, val] of entries) {
|
|
267
|
+
if (!key.includes('.')) out[key] = val;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
for (const [key, val] of entries) {
|
|
271
|
+
if (!key.includes('.')) continue;
|
|
272
|
+
const segments = key.split('.');
|
|
273
|
+
let cursor = out;
|
|
274
|
+
for (let i = 0; i < segments.length - 1; i++) {
|
|
275
|
+
const seg = segments[i];
|
|
276
|
+
const existing = cursor[seg];
|
|
277
|
+
if (!existing || typeof existing !== 'object') {
|
|
278
|
+
cursor[seg] = {};
|
|
279
|
+
}
|
|
280
|
+
cursor = cursor[seg] as Record<string, unknown>;
|
|
281
|
+
}
|
|
282
|
+
cursor[segments[segments.length - 1]] = val;
|
|
283
|
+
}
|
|
284
|
+
return out;
|
|
285
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import createDOMPurify from 'dompurify';
|
|
2
|
+
|
|
3
|
+
/** CSS that fetches a URL or (legacy) executes script. `url()`/`image-set()`
|
|
4
|
+
* beacon an external host; `expression()` ran JS in old IE. DOMPurify allowlists
|
|
5
|
+
* the `style` attribute NAME but never inspects its VALUE, so these survive the
|
|
6
|
+
* sanitize pass and fire from whatever document renders the result — including
|
|
7
|
+
* the privileged editor document. */
|
|
8
|
+
const NETWORKING_CSS = /url\s*\(|image-set\s*\(|expression\s*\(/i;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Lazily bind DOMPurify to the ambient window. DOMPurify's default export is
|
|
12
|
+
* both an instance and a factory; binding at first call (rather than import)
|
|
13
|
+
* keeps it correct when the DOM isn't present at module-evaluation time (test
|
|
14
|
+
* runners register happy-dom after imports resolve).
|
|
15
|
+
*
|
|
16
|
+
* The instance carries a hook that strips network-triggering CSS from inline
|
|
17
|
+
* `style` values and clamps `iframe` sources to `https:` — both apply to every
|
|
18
|
+
* sanitize call this module makes.
|
|
19
|
+
*/
|
|
20
|
+
let purify: ReturnType<typeof createDOMPurify> | null = null;
|
|
21
|
+
function getPurify(): ReturnType<typeof createDOMPurify> {
|
|
22
|
+
if (!purify) {
|
|
23
|
+
purify = createDOMPurify(window);
|
|
24
|
+
purify.addHook('afterSanitizeAttributes', (node) => {
|
|
25
|
+
const el = node as Element;
|
|
26
|
+
const style = el.getAttribute?.('style');
|
|
27
|
+
if (style && NETWORKING_CSS.test(style)) {
|
|
28
|
+
const cleaned = style
|
|
29
|
+
.split(';')
|
|
30
|
+
.filter((decl) => !NETWORKING_CSS.test(decl))
|
|
31
|
+
.join(';');
|
|
32
|
+
if (cleaned.trim()) el.setAttribute('style', cleaned);
|
|
33
|
+
else el.removeAttribute('style');
|
|
34
|
+
}
|
|
35
|
+
// Embeds are always https:; anything else on an iframe src is dropped.
|
|
36
|
+
// (DOMPurify already blocks javascript:/data: schemes; this additionally
|
|
37
|
+
// drops http: and protocol-relative srcs, leaving only real https embeds.)
|
|
38
|
+
if (el.tagName === 'IFRAME') {
|
|
39
|
+
const src = el.getAttribute?.('src');
|
|
40
|
+
if (src && !/^https:\/\//i.test(src.trim())) el.removeAttribute('src');
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
return purify;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Allowlist-sanitize author-controlled HTML before it reaches any innerHTML /
|
|
49
|
+
* `dangerouslySetInnerHTML` sink in the editor.
|
|
50
|
+
*
|
|
51
|
+
* The editor serializes author-controlled mdast (raw `<div>`/`<details>`
|
|
52
|
+
* tag soup, JSX-written lowercase elements) to HTML and injects it into the
|
|
53
|
+
* privileged admin document. Without sanitization an `<img onerror>`, a
|
|
54
|
+
* `<script>`, a `javascript:` href, or a CSS `url()` beacon would run with the
|
|
55
|
+
* signed-in editor's ambient authority. DOMPurify strips
|
|
56
|
+
* scripts, event-handler attributes, and dangerous URL schemes; the module hook
|
|
57
|
+
* strips CSS `url()` beacons while keeping the benign structural markup authors
|
|
58
|
+
* legitimately write.
|
|
59
|
+
*
|
|
60
|
+
* `conloca-slot` is added to the tag allowlist because the inline-editing
|
|
61
|
+
* machinery portals Lexical editors into `<conloca-slot data-slot-id>`
|
|
62
|
+
* elements in the rendered preview; DOMPurify keeps `data-*` attributes by
|
|
63
|
+
* default, so the slot ids survive.
|
|
64
|
+
*/
|
|
65
|
+
export function sanitizeHtml(html: string): string {
|
|
66
|
+
return getPurify().sanitize(html, { ADD_TAGS: ['conloca-slot'] });
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Sanitize the render-endpoint RESPONSE before GenericBlock's privileged
|
|
71
|
+
* innerHTML sink. Unlike author input, the response is our OWN registered-
|
|
72
|
+
* component output (VideoEmbed's `<iframe>`, icon `<svg><use>`, …) reacting to
|
|
73
|
+
* already-sanitized author props — so it is structurally generous (keeps the
|
|
74
|
+
* `iframe`/`use` that the strict author allowlist drops) but stays strict on
|
|
75
|
+
* execution and egress: DOMPurify still strips `<script>`, `on*` handlers, and
|
|
76
|
+
* `javascript:`/`data:text/html` URLs, the module hook strips CSS `url()`
|
|
77
|
+
* beacons, and iframe sources are clamped to `https:`.
|
|
78
|
+
*/
|
|
79
|
+
export function sanitizeComponentHtml(html: string): string {
|
|
80
|
+
return getPurify().sanitize(html, {
|
|
81
|
+
ADD_TAGS: ['conloca-slot', 'iframe', 'use'],
|
|
82
|
+
ADD_ATTR: ['allow', 'allowfullscreen', 'frameborder', 'loading', 'referrerpolicy', 'href', 'xlink:href'],
|
|
83
|
+
});
|
|
84
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Convert text to a URL/filename-safe slug.
|
|
3
|
+
* - Keeps the base letter of an accented letter (Ü → u, é → e)
|
|
4
|
+
* - Converts to lowercase
|
|
5
|
+
* - Replaces spaces and special chars with hyphens
|
|
6
|
+
* - Removes consecutive hyphens
|
|
7
|
+
* - Trims hyphens from start/end
|
|
8
|
+
*
|
|
9
|
+
* @example slugify("My Fragment Name!") // "my-fragment-name"
|
|
10
|
+
* @example slugify(" Hello World ") // "hello-world"
|
|
11
|
+
* @example slugify("Über uns") // "uber-uns"
|
|
12
|
+
*/
|
|
13
|
+
export function slugify(text: string): string {
|
|
14
|
+
return text
|
|
15
|
+
.normalize('NFKD')
|
|
16
|
+
.replace(/\p{M}/gu, '')
|
|
17
|
+
.toLowerCase()
|
|
18
|
+
.trim()
|
|
19
|
+
.replace(/[^a-z0-9]+/g, '-')
|
|
20
|
+
.replace(/^-|-$/g, '');
|
|
21
|
+
}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import type { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
export interface FieldInfo {
|
|
4
|
+
type: 'string' | 'number' | 'boolean' | 'date' | 'array' | 'enum';
|
|
5
|
+
format?: 'url' | 'email' | 'date-time';
|
|
6
|
+
/** Help text the schema gives the field, from .describe() or .meta({ description }). */
|
|
7
|
+
description?: string;
|
|
8
|
+
isOptional: boolean;
|
|
9
|
+
isNullable: boolean;
|
|
10
|
+
enumValues?: string[];
|
|
11
|
+
maxLength?: number;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/* oxlint-disable no-underscore-dangle -- Zod 3/4 expose these compatibility internals with underscore-prefixed names. */
|
|
15
|
+
|
|
16
|
+
interface ZodCompat {
|
|
17
|
+
_def?: ZodDef;
|
|
18
|
+
_zod?: { def?: ZodDef };
|
|
19
|
+
description?: string;
|
|
20
|
+
options?: string[];
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
interface ZodDef {
|
|
24
|
+
typeName?: string;
|
|
25
|
+
type?: string;
|
|
26
|
+
check?: string;
|
|
27
|
+
format?: string;
|
|
28
|
+
kind?: string;
|
|
29
|
+
maximum?: number;
|
|
30
|
+
value?: number;
|
|
31
|
+
innerType?: ZodCompat;
|
|
32
|
+
values?: string[] | Record<string, string | number>;
|
|
33
|
+
checks?: ZodCheck[];
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
interface ZodCheck extends ZodDef {
|
|
37
|
+
_zod?: { def?: ZodDef };
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function definition(schema: ZodCompat): ZodDef | undefined {
|
|
41
|
+
return schema._def ?? schema._zod?.def;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function getZodTypeName(def: ZodDef): string {
|
|
45
|
+
if (typeof def.typeName === 'string') return def.typeName;
|
|
46
|
+
return typeof def.type === 'string' ? def.type : '';
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function readStringCheck(def: ZodDef): Pick<FieldInfo, 'format' | 'maxLength'> {
|
|
50
|
+
const format = def.check === 'string_format' ? def.format : def.kind;
|
|
51
|
+
if (format === 'url' || format === 'email') return { format };
|
|
52
|
+
if (def.check === 'max_length' && typeof def.maximum === 'number') return { maxLength: def.maximum };
|
|
53
|
+
if (def.kind === 'max' && typeof def.value === 'number') return { maxLength: def.value };
|
|
54
|
+
return {};
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Introspects the subset of Zod 3/4 internals required to render form hints.
|
|
59
|
+
* The single assertion is the compatibility boundary; every field read after
|
|
60
|
+
* it is represented explicitly by ZodCompat/ZodDef.
|
|
61
|
+
*/
|
|
62
|
+
export function getZodFieldInfo(field: z.ZodRawShape[string]): FieldInfo {
|
|
63
|
+
// SAFETY: both supported Zod generations expose either _def or _zod.def;
|
|
64
|
+
// ZodCompat contains only optional fields read by this compatibility adapter.
|
|
65
|
+
// oxlint-disable-next-line typescript/no-unsafe-type-assertion -- documented third-party compatibility boundary
|
|
66
|
+
let current = field as ZodCompat;
|
|
67
|
+
let isOptional = false;
|
|
68
|
+
let isNullable = false;
|
|
69
|
+
let helpText: string | undefined;
|
|
70
|
+
|
|
71
|
+
while (true) {
|
|
72
|
+
helpText ??= current.description;
|
|
73
|
+
const def = definition(current);
|
|
74
|
+
if (!def) break;
|
|
75
|
+
const typeName = getZodTypeName(def);
|
|
76
|
+
|
|
77
|
+
if (typeName === 'ZodOptional' || typeName === 'optional') {
|
|
78
|
+
isOptional = true;
|
|
79
|
+
} else if (typeName === 'ZodNullable' || typeName === 'nullable') {
|
|
80
|
+
isNullable = true;
|
|
81
|
+
} else if (typeName !== 'ZodDefault' && typeName !== 'default') {
|
|
82
|
+
break;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
if (!def.innerType) break;
|
|
86
|
+
current = def.innerType;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
const def = definition(current);
|
|
90
|
+
const typeName = def ? getZodTypeName(def) : '';
|
|
91
|
+
|
|
92
|
+
if (typeName === 'ZodEnum' || typeName === 'enum') {
|
|
93
|
+
const enumValues = Array.isArray(def?.values)
|
|
94
|
+
? def.values.filter((value): value is string => typeof value === 'string')
|
|
95
|
+
: (current.options ?? []);
|
|
96
|
+
return { type: 'enum', enumValues, description: helpText, isOptional, isNullable };
|
|
97
|
+
}
|
|
98
|
+
if (typeName === 'ZodNativeEnum' || typeName === 'nativeEnum') {
|
|
99
|
+
const values = def?.values;
|
|
100
|
+
const enumValues =
|
|
101
|
+
values && !Array.isArray(values)
|
|
102
|
+
? Object.values(values).filter((value): value is string => typeof value === 'string')
|
|
103
|
+
: [];
|
|
104
|
+
return { type: 'enum', enumValues, description: helpText, isOptional, isNullable };
|
|
105
|
+
}
|
|
106
|
+
if (typeName === 'ZodDate' || typeName === 'date') {
|
|
107
|
+
return { type: 'date', format: 'date-time', description: helpText, isOptional, isNullable };
|
|
108
|
+
}
|
|
109
|
+
if (typeName === 'ZodBoolean' || typeName === 'boolean') {
|
|
110
|
+
return { type: 'boolean', description: helpText, isOptional, isNullable };
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
if (typeName === 'ZodNumber' || typeName === 'number') {
|
|
114
|
+
return { type: 'number', description: helpText, isOptional, isNullable };
|
|
115
|
+
}
|
|
116
|
+
if (typeName === 'ZodArray' || typeName === 'array') {
|
|
117
|
+
return { type: 'array', description: helpText, isOptional, isNullable };
|
|
118
|
+
}
|
|
119
|
+
if (typeName === 'ZodString' || typeName === 'string') {
|
|
120
|
+
const checks = def?.checks ?? [];
|
|
121
|
+
const constraints = [def, ...checks.map((check) => check._zod?.def ?? check)]
|
|
122
|
+
.filter((check): check is ZodDef => check !== undefined)
|
|
123
|
+
.map(readStringCheck);
|
|
124
|
+
const format = constraints.find((constraint) => constraint.format)?.format;
|
|
125
|
+
const maxLength = constraints.find((constraint) => constraint.maxLength !== undefined)?.maxLength;
|
|
126
|
+
return { type: 'string', format, description: helpText, isOptional, isNullable, maxLength };
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
return { type: 'string', description: helpText, isOptional, isNullable };
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export function getZodShape(schema: z.ZodObject<z.ZodRawShape>): Record<string, FieldInfo> {
|
|
133
|
+
const result: Record<string, FieldInfo> = {};
|
|
134
|
+
for (const [key, field] of Object.entries(schema.shape)) result[key] = getZodFieldInfo(field);
|
|
135
|
+
return result;
|
|
136
|
+
}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import type { ContentAPIClient } from '@conloca/content-api-client';
|
|
2
|
+
import { type EditorWriteAccess, type EditorWriteRefusal, getUIConfig, type UIConfig } from './ui-config.js';
|
|
3
|
+
|
|
4
|
+
/** Does a content-API method observe the workspace, or change it? */
|
|
5
|
+
export type ContentMethodAccess = 'read' | 'write';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Every public method of `ContentAPIClient`, classified.
|
|
9
|
+
*
|
|
10
|
+
* The `satisfies` is the load-bearing part. `Record<keyof ContentAPIClient,
|
|
11
|
+
* ContentMethodAccess>` is TOTAL, so the day the content API grows a method,
|
|
12
|
+
* this object stops compiling until somebody says which kind it is. Without
|
|
13
|
+
* that, a new write would join the client and slip past the gate in silence
|
|
14
|
+
* — and a silently-ungated write against a refused account is precisely the
|
|
15
|
+
* bug this module exists to make impossible.
|
|
16
|
+
* Removed client methods must also be removed from this classification;
|
|
17
|
+
* browser-side helpers are not part of the content API's access boundary.
|
|
18
|
+
*
|
|
19
|
+
* `compileMDX` is a POST and still a read: it renders a preview of content
|
|
20
|
+
* the caller already holds and persists nothing.
|
|
21
|
+
*
|
|
22
|
+
* `pullChanges` is a write. It rewrites the workspace tree from the remote;
|
|
23
|
+
* that it destroys rather than creates does not make it an observation.
|
|
24
|
+
*/
|
|
25
|
+
const CONTENT_METHOD_ACCESS = {
|
|
26
|
+
getContent: 'read',
|
|
27
|
+
getLocalized: 'read',
|
|
28
|
+
createContent: 'write',
|
|
29
|
+
updateLocalized: 'write',
|
|
30
|
+
deleteContent: 'write',
|
|
31
|
+
deleteLocalized: 'write',
|
|
32
|
+
getSitePages: 'read',
|
|
33
|
+
getPageByPathname: 'read',
|
|
34
|
+
isPathnameAvailable: 'read',
|
|
35
|
+
movePage: 'write',
|
|
36
|
+
getFragments: 'read',
|
|
37
|
+
getFragmentByName: 'read',
|
|
38
|
+
compileMDX: 'read',
|
|
39
|
+
getData: 'read',
|
|
40
|
+
getDataByName: 'read',
|
|
41
|
+
isDataNameAvailable: 'read',
|
|
42
|
+
getDataCollections: 'read',
|
|
43
|
+
listAllContent: 'read',
|
|
44
|
+
findUntranslatedContent: 'read',
|
|
45
|
+
getSitesConfig: 'read',
|
|
46
|
+
batchUpdate: 'write',
|
|
47
|
+
getGitStatus: 'read',
|
|
48
|
+
commitChanges: 'write',
|
|
49
|
+
pushChanges: 'write',
|
|
50
|
+
pullChanges: 'write',
|
|
51
|
+
listAssets: 'read',
|
|
52
|
+
getAsset: 'read',
|
|
53
|
+
uploadAsset: 'write',
|
|
54
|
+
importAssetUrl: 'write',
|
|
55
|
+
deleteAsset: 'write',
|
|
56
|
+
listFolder: 'read',
|
|
57
|
+
createFolder: 'write',
|
|
58
|
+
updateAssetMetadata: 'write',
|
|
59
|
+
getAssetUsage: 'read',
|
|
60
|
+
moveAssets: 'write',
|
|
61
|
+
getFolderTree: 'read',
|
|
62
|
+
getCurrentUser: 'read',
|
|
63
|
+
} as const satisfies Record<keyof ContentAPIClient, ContentMethodAccess>;
|
|
64
|
+
|
|
65
|
+
/** The classification above, for anything that needs to enumerate it (the tests do). */
|
|
66
|
+
export const CONTENT_METHOD_CLASSIFICATION: Readonly<Record<string, ContentMethodAccess>> = CONTENT_METHOD_ACCESS;
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* A write the editor refused because the account may not write right now.
|
|
70
|
+
*
|
|
71
|
+
* Carries the refusal rather than a bare string so a surface that catches it
|
|
72
|
+
* can show the reader the same sentence the host wrote, instead of inventing
|
|
73
|
+
* its own guess at what went wrong.
|
|
74
|
+
*/
|
|
75
|
+
export class ContentWriteRefusedError extends Error {
|
|
76
|
+
/** The content-API method that was refused, for logs. */
|
|
77
|
+
readonly method: string;
|
|
78
|
+
readonly refusal: EditorWriteRefusal;
|
|
79
|
+
|
|
80
|
+
constructor(method: string, refusal: EditorWriteRefusal) {
|
|
81
|
+
super(refusal.reason);
|
|
82
|
+
this.name = 'ContentWriteRefusedError';
|
|
83
|
+
this.method = method;
|
|
84
|
+
this.refusal = refusal;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
const WRITABLE: EditorWriteAccess = Object.freeze({ writable: true });
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* What the editor may do to content right now.
|
|
92
|
+
*
|
|
93
|
+
* Absence of {@link UIConfig.readOnly} is the ONLY writable answer, so a host
|
|
94
|
+
* that never learned about this seam gets today's behaviour exactly, and a
|
|
95
|
+
* host that sets it cannot set it without a reason.
|
|
96
|
+
*/
|
|
97
|
+
export function editorWriteAccess(config: UIConfig = getUIConfig()): EditorWriteAccess {
|
|
98
|
+
const refusal = config.readOnly;
|
|
99
|
+
return refusal === undefined ? WRITABLE : { writable: false, refusal };
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Wrap the content client so every write consults {@link editorWriteAccess}
|
|
104
|
+
* and every read goes straight through.
|
|
105
|
+
*
|
|
106
|
+
* This is the whole enforcement, in one place. The alternative — teaching
|
|
107
|
+
* each of the dozen mutating surfaces to check first — leaves the next
|
|
108
|
+
* surface someone writes ungated by default, and a gate you have to remember
|
|
109
|
+
* is not a gate. Editing surfaces still MOUNT and still render their content:
|
|
110
|
+
* the person editing still sees everything they would get back by regaining
|
|
111
|
+
* write access, and the published site is unaffected by any of this.
|
|
112
|
+
*
|
|
113
|
+
* The access is read at CALL time, not at wrap time: the host app's answer
|
|
114
|
+
* can land over the network long after the editor mounts, and a write
|
|
115
|
+
* attempted one second after the account was restricted must be refused, not
|
|
116
|
+
* waved through by a stale snapshot.
|
|
117
|
+
*
|
|
118
|
+
* The wrapper delegates through the prototype chain, so it stays an
|
|
119
|
+
* `instanceof ContentAPIClient` and reads cost one extra property lookup.
|
|
120
|
+
*/
|
|
121
|
+
export function guardContentWrites(client: ContentAPIClient): ContentAPIClient {
|
|
122
|
+
const guarded: ContentAPIClient = Object.create(client);
|
|
123
|
+
for (const [method, classification] of Object.entries(CONTENT_METHOD_ACCESS)) {
|
|
124
|
+
if (classification !== 'write') continue;
|
|
125
|
+
const original: unknown = Reflect.get(client, method);
|
|
126
|
+
// A method the client does not have cannot be called, so there is nothing
|
|
127
|
+
// to refuse — this is a total answer, not a tolerated gap. Hosts hand in
|
|
128
|
+
// their own `contentClient` (`UIConfig.contentClient`), and a narrower one
|
|
129
|
+
// than the full surface is ordinary: crashing the editor mount over a
|
|
130
|
+
// method nobody can reach would take the whole editor away from the
|
|
131
|
+
// reader this gate exists to keep reading. The exhaustive
|
|
132
|
+
// classification above is what guarantees no REACHABLE write is
|
|
133
|
+
// unclassified.
|
|
134
|
+
if (typeof original !== 'function') continue;
|
|
135
|
+
Object.defineProperty(guarded, method, {
|
|
136
|
+
value: (...args: unknown[]): unknown => {
|
|
137
|
+
const access = editorWriteAccess();
|
|
138
|
+
if (access.writable) return original.apply(client, args);
|
|
139
|
+
return Promise.reject(new ContentWriteRefusedError(method, access.refusal));
|
|
140
|
+
},
|
|
141
|
+
writable: false,
|
|
142
|
+
enumerable: false,
|
|
143
|
+
configurable: false,
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
return guarded;
|
|
147
|
+
}
|