@conloca/cms-spa 0.2.5 → 0.3.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/dist/spa/main.css +262 -21
- package/dist/ts/.build-inputs.json +99 -57
- package/dist/ts/CmsSpaApp.d.ts +4 -6
- package/dist/ts/CmsSpaApp.d.ts.map +1 -1
- package/dist/ts/CmsSpaApp.js +19 -8
- package/dist/ts/CmsSpaApp.js.map +1 -1
- package/dist/ts/components/conflicts/EditorNoticeStrip.d.ts +44 -0
- package/dist/ts/components/conflicts/EditorNoticeStrip.d.ts.map +1 -0
- package/dist/ts/components/conflicts/EditorNoticeStrip.js +55 -0
- package/dist/ts/components/conflicts/EditorNoticeStrip.js.map +1 -0
- package/dist/ts/components/conflicts/FieldConflictList.d.ts +20 -0
- package/dist/ts/components/conflicts/FieldConflictList.d.ts.map +1 -0
- package/dist/ts/components/conflicts/FieldConflictList.js +14 -0
- package/dist/ts/components/conflicts/FieldConflictList.js.map +1 -0
- package/dist/ts/components/conflicts/FieldConflictPicker.d.ts +28 -0
- package/dist/ts/components/conflicts/FieldConflictPicker.d.ts.map +1 -0
- package/dist/ts/components/conflicts/FieldConflictPicker.js +52 -0
- package/dist/ts/components/conflicts/FieldConflictPicker.js.map +1 -0
- package/dist/ts/components/conflicts/OverwriteNotice.d.ts +11 -0
- package/dist/ts/components/conflicts/OverwriteNotice.d.ts.map +1 -0
- package/dist/ts/components/conflicts/OverwriteNotice.js +8 -0
- package/dist/ts/components/conflicts/OverwriteNotice.js.map +1 -0
- package/dist/ts/components/conflicts/PageDraftMenu.d.ts +11 -0
- package/dist/ts/components/conflicts/PageDraftMenu.d.ts.map +1 -0
- package/dist/ts/components/conflicts/PageDraftMenu.js +20 -0
- package/dist/ts/components/conflicts/PageDraftMenu.js.map +1 -0
- package/dist/ts/components/conflicts/PeerAvatars.d.ts +9 -0
- package/dist/ts/components/conflicts/PeerAvatars.d.ts.map +1 -0
- package/dist/ts/components/conflicts/PeerAvatars.js +29 -0
- package/dist/ts/components/conflicts/PeerAvatars.js.map +1 -0
- package/dist/ts/components/conflicts/PuckConflicts.d.ts +13 -0
- package/dist/ts/components/conflicts/PuckConflicts.d.ts.map +1 -0
- package/dist/ts/components/conflicts/PuckConflicts.js +59 -0
- package/dist/ts/components/conflicts/PuckConflicts.js.map +1 -0
- package/dist/ts/components/conflicts/RecentVersionsDialog.d.ts +15 -0
- package/dist/ts/components/conflicts/RecentVersionsDialog.d.ts.map +1 -0
- package/dist/ts/components/conflicts/RecentVersionsDialog.js +94 -0
- package/dist/ts/components/conflicts/RecentVersionsDialog.js.map +1 -0
- package/dist/ts/components/conflicts/conflict-label.d.ts +12 -0
- package/dist/ts/components/conflicts/conflict-label.d.ts.map +1 -0
- package/dist/ts/components/conflicts/conflict-label.js +120 -0
- package/dist/ts/components/conflicts/conflict-label.js.map +1 -0
- package/dist/ts/components/conflicts/use-page-conflicts.d.ts +26 -0
- package/dist/ts/components/conflicts/use-page-conflicts.d.ts.map +1 -0
- package/dist/ts/components/conflicts/use-page-conflicts.js +93 -0
- package/dist/ts/components/conflicts/use-page-conflicts.js.map +1 -0
- package/dist/ts/components/conflicts/version-copy.d.ts +7 -0
- package/dist/ts/components/conflicts/version-copy.d.ts.map +1 -0
- package/dist/ts/components/conflicts/version-copy.js +31 -0
- package/dist/ts/components/conflicts/version-copy.js.map +1 -0
- package/dist/ts/components/dashboard/RecentActivity.d.ts.map +1 -1
- package/dist/ts/components/dashboard/RecentActivity.js +2 -1
- package/dist/ts/components/dashboard/RecentActivity.js.map +1 -1
- package/dist/ts/components/dialogs/CreatePageDialog.js +1 -1
- package/dist/ts/components/dialogs/CreatePageDialog.js.map +1 -1
- package/dist/ts/components/dialogs/DataPropertiesDialog.d.ts +2 -1
- package/dist/ts/components/dialogs/DataPropertiesDialog.d.ts.map +1 -1
- package/dist/ts/components/dialogs/DataPropertiesDialog.js +15 -3
- package/dist/ts/components/dialogs/DataPropertiesDialog.js.map +1 -1
- package/dist/ts/components/dialogs/FragmentPropertiesDialog.d.ts +2 -1
- package/dist/ts/components/dialogs/FragmentPropertiesDialog.d.ts.map +1 -1
- package/dist/ts/components/dialogs/FragmentPropertiesDialog.js +16 -3
- package/dist/ts/components/dialogs/FragmentPropertiesDialog.js.map +1 -1
- package/dist/ts/components/dialogs/PageMetadataDialog.d.ts +9 -2
- package/dist/ts/components/dialogs/PageMetadataDialog.d.ts.map +1 -1
- package/dist/ts/components/dialogs/PageMetadataDialog.js +63 -16
- package/dist/ts/components/dialogs/PageMetadataDialog.js.map +1 -1
- package/dist/ts/components/dialogs/UnsavedChangesDialog.d.ts +16 -1
- package/dist/ts/components/dialogs/UnsavedChangesDialog.d.ts.map +1 -1
- package/dist/ts/components/dialogs/UnsavedChangesDialog.js +90 -2
- package/dist/ts/components/dialogs/UnsavedChangesDialog.js.map +1 -1
- package/dist/ts/components/dialogs/unsaved-guard.d.ts +9 -0
- package/dist/ts/components/dialogs/unsaved-guard.d.ts.map +1 -0
- package/dist/ts/components/dialogs/unsaved-guard.js +14 -0
- package/dist/ts/components/dialogs/unsaved-guard.js.map +1 -0
- package/dist/ts/components/editor/CMSMDXEditor.d.ts +6 -1
- package/dist/ts/components/editor/CMSMDXEditor.d.ts.map +1 -1
- package/dist/ts/components/editor/CMSMDXEditor.js +32 -15
- package/dist/ts/components/editor/CMSMDXEditor.js.map +1 -1
- package/dist/ts/components/editor/EditorFrame.d.ts +22 -0
- package/dist/ts/components/editor/EditorFrame.d.ts.map +1 -0
- package/dist/ts/components/editor/EditorFrame.js +72 -0
- package/dist/ts/components/editor/EditorFrame.js.map +1 -0
- package/dist/ts/components/editor/FragmentBlockTypeSelect.d.ts +10 -0
- package/dist/ts/components/editor/FragmentBlockTypeSelect.d.ts.map +1 -0
- package/dist/ts/components/editor/FragmentBlockTypeSelect.js +187 -0
- package/dist/ts/components/editor/FragmentBlockTypeSelect.js.map +1 -0
- package/dist/ts/components/editor/FragmentComponentBlock.d.ts +7 -0
- package/dist/ts/components/editor/FragmentComponentBlock.d.ts.map +1 -0
- package/dist/ts/components/editor/FragmentComponentBlock.js +180 -0
- package/dist/ts/components/editor/FragmentComponentBlock.js.map +1 -0
- package/dist/ts/components/editor/FragmentEditor.d.ts +3 -1
- package/dist/ts/components/editor/FragmentEditor.d.ts.map +1 -1
- package/dist/ts/components/editor/FragmentEditor.js +545 -130
- package/dist/ts/components/editor/FragmentEditor.js.map +1 -1
- package/dist/ts/components/editor/FragmentEditorHeaderActions.d.ts +20 -0
- package/dist/ts/components/editor/FragmentEditorHeaderActions.d.ts.map +1 -0
- package/dist/ts/components/editor/FragmentEditorHeaderActions.js +49 -0
- package/dist/ts/components/editor/FragmentEditorHeaderActions.js.map +1 -0
- package/dist/ts/components/editor/GenericBlock.d.ts.map +1 -1
- package/dist/ts/components/editor/GenericBlock.js +109 -12
- package/dist/ts/components/editor/GenericBlock.js.map +1 -1
- package/dist/ts/components/editor/InlinePreviewFrame.d.ts +19 -0
- package/dist/ts/components/editor/InlinePreviewFrame.d.ts.map +1 -0
- package/dist/ts/components/editor/InlinePreviewFrame.js +65 -0
- package/dist/ts/components/editor/InlinePreviewFrame.js.map +1 -0
- package/dist/ts/components/editor/JsxPropsPanel.d.ts.map +1 -1
- package/dist/ts/components/editor/JsxPropsPanel.js +62 -2
- package/dist/ts/components/editor/JsxPropsPanel.js.map +1 -1
- package/dist/ts/components/editor/LocaleSelector.d.ts +2 -1
- package/dist/ts/components/editor/LocaleSelector.d.ts.map +1 -1
- package/dist/ts/components/editor/LocaleSelector.js +2 -2
- package/dist/ts/components/editor/LocaleSelector.js.map +1 -1
- package/dist/ts/components/editor/MDXLivePreview.d.ts +2 -0
- package/dist/ts/components/editor/MDXLivePreview.d.ts.map +1 -1
- package/dist/ts/components/editor/MDXLivePreview.js +30 -38
- package/dist/ts/components/editor/MDXLivePreview.js.map +1 -1
- package/dist/ts/components/editor/MdxPageEditor.d.ts +7 -2
- package/dist/ts/components/editor/MdxPageEditor.d.ts.map +1 -1
- package/dist/ts/components/editor/MdxPageEditor.js +136 -10
- package/dist/ts/components/editor/MdxPageEditor.js.map +1 -1
- package/dist/ts/components/editor/PageEditor.d.ts +4 -1
- package/dist/ts/components/editor/PageEditor.d.ts.map +1 -1
- package/dist/ts/components/editor/PageEditor.js +78 -100
- package/dist/ts/components/editor/PageEditor.js.map +1 -1
- package/dist/ts/components/editor/PageEditorHeaderActions.d.ts +15 -4
- package/dist/ts/components/editor/PageEditorHeaderActions.d.ts.map +1 -1
- package/dist/ts/components/editor/PageEditorHeaderActions.js +13 -7
- package/dist/ts/components/editor/PageEditorHeaderActions.js.map +1 -1
- package/dist/ts/components/editor/PageEditorWrapper.d.ts +8 -2
- package/dist/ts/components/editor/PageEditorWrapper.d.ts.map +1 -1
- package/dist/ts/components/editor/PageEditorWrapper.js +99 -41
- package/dist/ts/components/editor/PageEditorWrapper.js.map +1 -1
- package/dist/ts/components/editor/body-sync-plugin.d.ts +2 -0
- package/dist/ts/components/editor/body-sync-plugin.d.ts.map +1 -0
- package/dist/ts/components/editor/body-sync-plugin.js +32 -0
- package/dist/ts/components/editor/body-sync-plugin.js.map +1 -0
- package/dist/ts/components/editor/draft-media-config.d.ts +6 -0
- package/dist/ts/components/editor/draft-media-config.d.ts.map +1 -1
- package/dist/ts/components/editor/draft-media-config.js +21 -0
- package/dist/ts/components/editor/draft-media-config.js.map +1 -1
- package/dist/ts/components/editor/fragment-save-check.d.ts +7 -0
- package/dist/ts/components/editor/fragment-save-check.d.ts.map +1 -0
- package/dist/ts/components/editor/fragment-save-check.js +13 -0
- package/dist/ts/components/editor/fragment-save-check.js.map +1 -0
- package/dist/ts/components/editor/fragment-save-lifetime.d.ts +18 -0
- package/dist/ts/components/editor/fragment-save-lifetime.d.ts.map +1 -0
- package/dist/ts/components/editor/fragment-save-lifetime.js +115 -0
- package/dist/ts/components/editor/fragment-save-lifetime.js.map +1 -0
- package/dist/ts/components/editor/host-wrapper-plugin.d.ts.map +1 -1
- package/dist/ts/components/editor/host-wrapper-plugin.js +20 -7
- package/dist/ts/components/editor/host-wrapper-plugin.js.map +1 -1
- package/dist/ts/components/editor/index.d.ts +0 -1
- package/dist/ts/components/editor/index.d.ts.map +1 -1
- package/dist/ts/components/editor/index.js +0 -1
- package/dist/ts/components/editor/index.js.map +1 -1
- package/dist/ts/components/editor/insert-menu/InsertMdxComponentButton.d.ts.map +1 -1
- package/dist/ts/components/editor/insert-menu/InsertMdxComponentButton.js +6 -11
- package/dist/ts/components/editor/insert-menu/InsertMdxComponentButton.js.map +1 -1
- package/dist/ts/components/editor/insert-menu/SlashMenuPlugin.d.ts.map +1 -1
- package/dist/ts/components/editor/insert-menu/SlashMenuPlugin.js +66 -12
- package/dist/ts/components/editor/insert-menu/SlashMenuPlugin.js.map +1 -1
- package/dist/ts/components/editor/insert-menu/insert-payload.d.ts +16 -21
- package/dist/ts/components/editor/insert-menu/insert-payload.d.ts.map +1 -1
- package/dist/ts/components/editor/insert-menu/insert-payload.js +75 -22
- package/dist/ts/components/editor/insert-menu/insert-payload.js.map +1 -1
- package/dist/ts/components/editor/insert-menu/mdx-components-plugin.d.ts +3 -1
- package/dist/ts/components/editor/insert-menu/mdx-components-plugin.d.ts.map +1 -1
- package/dist/ts/components/editor/insert-menu/mdx-components-plugin.js +5 -3
- package/dist/ts/components/editor/insert-menu/mdx-components-plugin.js.map +1 -1
- package/dist/ts/components/editor/jsx-layout-plugin.d.ts +25 -0
- package/dist/ts/components/editor/jsx-layout-plugin.d.ts.map +1 -0
- package/dist/ts/components/editor/jsx-layout-plugin.js +77 -0
- package/dist/ts/components/editor/jsx-layout-plugin.js.map +1 -0
- package/dist/ts/components/editor/offered-mdx-components.d.ts +11 -0
- package/dist/ts/components/editor/offered-mdx-components.d.ts.map +1 -0
- package/dist/ts/components/editor/offered-mdx-components.js +27 -0
- package/dist/ts/components/editor/offered-mdx-components.js.map +1 -0
- package/dist/ts/components/editor/page-setting-targets.d.ts.map +1 -1
- package/dist/ts/components/editor/page-setting-targets.js +2 -1
- package/dist/ts/components/editor/page-setting-targets.js.map +1 -1
- package/dist/ts/components/editor/preview-availability.d.ts +16 -1
- package/dist/ts/components/editor/preview-availability.d.ts.map +1 -1
- package/dist/ts/components/editor/preview-availability.js +16 -1
- package/dist/ts/components/editor/preview-availability.js.map +1 -1
- package/dist/ts/components/editor/prop-field-hint.d.ts +13 -0
- package/dist/ts/components/editor/prop-field-hint.d.ts.map +1 -0
- package/dist/ts/components/editor/prop-field-hint.js +70 -0
- package/dist/ts/components/editor/prop-field-hint.js.map +1 -0
- package/dist/ts/components/editor/soft-break-plugin.d.ts +21 -0
- package/dist/ts/components/editor/soft-break-plugin.d.ts.map +1 -0
- package/dist/ts/components/editor/soft-break-plugin.js +52 -0
- package/dist/ts/components/editor/soft-break-plugin.js.map +1 -0
- package/dist/ts/components/editor/use-live-page-settings.d.ts +13 -0
- package/dist/ts/components/editor/use-live-page-settings.d.ts.map +1 -0
- package/dist/ts/components/editor/use-live-page-settings.js +76 -0
- package/dist/ts/components/editor/use-live-page-settings.js.map +1 -0
- package/dist/ts/components/editor/usePagePreview.d.ts +32 -0
- package/dist/ts/components/editor/usePagePreview.d.ts.map +1 -0
- package/dist/ts/components/editor/usePagePreview.js +252 -0
- package/dist/ts/components/editor/usePagePreview.js.map +1 -0
- package/dist/ts/components/editors/DataEditor.d.ts +6 -3
- package/dist/ts/components/editors/DataEditor.d.ts.map +1 -1
- package/dist/ts/components/editors/DataEditor.js +153 -19
- package/dist/ts/components/editors/DataEditor.js.map +1 -1
- package/dist/ts/components/fields/MDXEditField.d.ts +1 -1
- package/dist/ts/components/fields/MDXEditField.js +2 -2
- package/dist/ts/components/fields/MDXEditField.js.map +1 -1
- package/dist/ts/components/forms/SchemaForm.d.ts.map +1 -1
- package/dist/ts/components/forms/SchemaForm.js +1 -9
- package/dist/ts/components/forms/SchemaForm.js.map +1 -1
- package/dist/ts/components/media/AssetDetailSidebar.d.ts.map +1 -1
- package/dist/ts/components/media/AssetDetailSidebar.js +43 -5
- package/dist/ts/components/media/AssetDetailSidebar.js.map +1 -1
- package/dist/ts/components/pages/DataList.d.ts.map +1 -1
- package/dist/ts/components/pages/DataList.js +16 -4
- package/dist/ts/components/pages/DataList.js.map +1 -1
- package/dist/ts/components/pages/FragmentList.d.ts.map +1 -1
- package/dist/ts/components/pages/FragmentList.js +10 -0
- package/dist/ts/components/pages/FragmentList.js.map +1 -1
- package/dist/ts/components/pages/PageList.d.ts.map +1 -1
- package/dist/ts/components/pages/PageList.js +54 -118
- package/dist/ts/components/pages/PageList.js.map +1 -1
- package/dist/ts/components/pages/PageRow.d.ts +21 -0
- package/dist/ts/components/pages/PageRow.d.ts.map +1 -0
- package/dist/ts/components/pages/PageRow.js +70 -0
- package/dist/ts/components/pages/PageRow.js.map +1 -0
- package/dist/ts/components/pages/PageTable.d.ts +21 -0
- package/dist/ts/components/pages/PageTable.d.ts.map +1 -0
- package/dist/ts/components/pages/PageTable.js +12 -0
- package/dist/ts/components/pages/PageTable.js.map +1 -0
- package/dist/ts/components/pages/page-list-model.d.ts +20 -0
- package/dist/ts/components/pages/page-list-model.d.ts.map +1 -0
- package/dist/ts/components/pages/page-list-model.js +78 -0
- package/dist/ts/components/pages/page-list-model.js.map +1 -0
- package/dist/ts/components/puck/MDXContent.d.ts +3 -3
- package/dist/ts/components/puck/MDXContent.d.ts.map +1 -1
- package/dist/ts/components/puck/MDXContent.js +24 -72
- package/dist/ts/components/puck/MDXContent.js.map +1 -1
- package/dist/ts/components/puck/csp-frame-harness.d.ts +14 -0
- package/dist/ts/components/puck/csp-frame-harness.d.ts.map +1 -0
- package/dist/ts/components/puck/csp-frame-harness.js +85 -0
- package/dist/ts/components/puck/csp-frame-harness.js.map +1 -0
- package/dist/ts/components/puck/use-fragment-render.d.ts +9 -0
- package/dist/ts/components/puck/use-fragment-render.d.ts.map +1 -0
- package/dist/ts/components/puck/use-fragment-render.js +70 -0
- package/dist/ts/components/puck/use-fragment-render.js.map +1 -0
- package/dist/ts/components/sandbox/ContentSandbox.d.ts +3 -5
- package/dist/ts/components/sandbox/ContentSandbox.d.ts.map +1 -1
- package/dist/ts/components/sandbox/ContentSandbox.js +6 -8
- package/dist/ts/components/sandbox/ContentSandbox.js.map +1 -1
- package/dist/ts/components/sandbox/frame-runtime.d.ts +1 -1
- package/dist/ts/components/sandbox/frame-runtime.d.ts.map +1 -1
- package/dist/ts/components/sandbox/frame-runtime.js +1 -1
- package/dist/ts/components/sandbox/frame-runtime.js.map +1 -1
- package/dist/ts/components/toast.d.ts +8 -4
- package/dist/ts/components/toast.d.ts.map +1 -1
- package/dist/ts/components/toast.js +6 -1
- package/dist/ts/components/toast.js.map +1 -1
- package/dist/ts/components/ui/Card.d.ts +3 -5
- package/dist/ts/components/ui/Card.d.ts.map +1 -1
- package/dist/ts/components/ui/Card.js +3 -5
- package/dist/ts/components/ui/Card.js.map +1 -1
- package/dist/ts/components/ui/Select.d.ts.map +1 -1
- package/dist/ts/components/ui/Select.js +12 -3
- package/dist/ts/components/ui/Select.js.map +1 -1
- package/dist/ts/draft-tools.d.ts +76 -0
- package/dist/ts/draft-tools.d.ts.map +1 -0
- package/dist/ts/draft-tools.js +2 -0
- package/dist/ts/draft-tools.js.map +1 -0
- package/dist/ts/frame/channel.d.ts +1 -1
- package/dist/ts/frame/channel.d.ts.map +1 -1
- package/dist/ts/frame/channel.js +3 -0
- package/dist/ts/frame/channel.js.map +1 -1
- package/dist/ts/frame/editor-frame.d.ts.map +1 -1
- package/dist/ts/frame/editor-frame.js +188 -30
- package/dist/ts/frame/editor-frame.js.map +1 -1
- package/dist/ts/frame/protocol.d.ts +73 -4
- package/dist/ts/frame/protocol.d.ts.map +1 -1
- package/dist/ts/frame/protocol.js +54 -16
- package/dist/ts/frame/protocol.js.map +1 -1
- package/dist/ts/hooks/useUnsavedChangesGuard.d.ts +5 -3
- package/dist/ts/hooks/useUnsavedChangesGuard.d.ts.map +1 -1
- package/dist/ts/hooks/useUnsavedChangesGuard.js +17 -7
- package/dist/ts/hooks/useUnsavedChangesGuard.js.map +1 -1
- package/dist/ts/host-style-probe.d.ts.map +1 -1
- package/dist/ts/host-style-probe.js +160 -40
- package/dist/ts/host-style-probe.js.map +1 -1
- package/dist/ts/index.d.ts +13 -0
- package/dist/ts/index.d.ts.map +1 -1
- package/dist/ts/index.js +14 -0
- package/dist/ts/index.js.map +1 -1
- package/dist/ts/live/data-binding.d.ts +67 -0
- package/dist/ts/live/data-binding.d.ts.map +1 -0
- package/dist/ts/live/data-binding.js +215 -0
- package/dist/ts/live/data-binding.js.map +1 -0
- package/dist/ts/live/doc-channel.d.ts +74 -0
- package/dist/ts/live/doc-channel.d.ts.map +1 -0
- package/dist/ts/live/doc-channel.js +293 -0
- package/dist/ts/live/doc-channel.js.map +1 -0
- package/dist/ts/live/held-fragment-edits.d.ts +15 -0
- package/dist/ts/live/held-fragment-edits.d.ts.map +1 -0
- package/dist/ts/live/held-fragment-edits.js +47 -0
- package/dist/ts/live/held-fragment-edits.js.map +1 -0
- package/dist/ts/live/markdown-binding.d.ts +54 -0
- package/dist/ts/live/markdown-binding.d.ts.map +1 -0
- package/dist/ts/live/markdown-binding.js +618 -0
- package/dist/ts/live/markdown-binding.js.map +1 -0
- package/dist/ts/live/markdown-live-plugin.d.ts +42 -0
- package/dist/ts/live/markdown-live-plugin.d.ts.map +1 -0
- package/dist/ts/live/markdown-live-plugin.js +918 -0
- package/dist/ts/live/markdown-live-plugin.js.map +1 -0
- package/dist/ts/live/messages.d.ts +142 -0
- package/dist/ts/live/messages.d.ts.map +1 -0
- package/dist/ts/live/messages.js +266 -0
- package/dist/ts/live/messages.js.map +1 -0
- package/dist/ts/live/puck-binding.d.ts +88 -0
- package/dist/ts/live/puck-binding.d.ts.map +1 -0
- package/dist/ts/live/puck-binding.js +467 -0
- package/dist/ts/live/puck-binding.js.map +1 -0
- package/dist/ts/live/undo.d.ts +29 -0
- package/dist/ts/live/undo.d.ts.map +1 -0
- package/dist/ts/live/undo.js +104 -0
- package/dist/ts/live/undo.js.map +1 -0
- package/dist/ts/live/use-live.d.ts +77 -0
- package/dist/ts/live/use-live.d.ts.map +1 -0
- package/dist/ts/live/use-live.js +207 -0
- package/dist/ts/live/use-live.js.map +1 -0
- package/dist/ts/mdx-components-define.d.ts +52 -15
- package/dist/ts/mdx-components-define.d.ts.map +1 -1
- package/dist/ts/mdx-components-define.js +136 -0
- package/dist/ts/mdx-components-define.js.map +1 -1
- package/dist/ts/mdx-components.d.ts +11 -19
- package/dist/ts/mdx-components.d.ts.map +1 -1
- package/dist/ts/mdx-components.js +23 -32
- package/dist/ts/mdx-components.js.map +1 -1
- package/dist/ts/media/AssetScopePill.d.ts.map +1 -1
- package/dist/ts/media/AssetScopePill.js +2 -1
- package/dist/ts/media/AssetScopePill.js.map +1 -1
- package/dist/ts/merge-default-props.d.ts.map +1 -1
- package/dist/ts/merge-default-props.js +3 -0
- package/dist/ts/merge-default-props.js.map +1 -1
- package/dist/ts/selected-block.d.ts +27 -2
- package/dist/ts/selected-block.d.ts.map +1 -1
- package/dist/ts/selected-block.js +43 -1
- package/dist/ts/selected-block.js.map +1 -1
- package/dist/ts/site-render.d.ts +60 -0
- package/dist/ts/site-render.d.ts.map +1 -0
- package/dist/ts/site-render.js +87 -0
- package/dist/ts/site-render.js.map +1 -0
- package/dist/ts/types.d.ts +3 -0
- package/dist/ts/types.d.ts.map +1 -1
- package/dist/ts/ui-config.d.ts +29 -13
- package/dist/ts/ui-config.d.ts.map +1 -1
- package/dist/ts/ui-config.js +14 -3
- package/dist/ts/ui-config.js.map +1 -1
- package/dist/ts/utils/apply-clash.d.ts +44 -0
- package/dist/ts/utils/apply-clash.d.ts.map +1 -0
- package/dist/ts/utils/apply-clash.js +102 -0
- package/dist/ts/utils/apply-clash.js.map +1 -0
- package/dist/ts/utils/mdast-tree.d.ts +5 -7
- package/dist/ts/utils/mdast-tree.d.ts.map +1 -1
- package/dist/ts/utils/mdast-tree.js +8 -13
- package/dist/ts/utils/mdast-tree.js.map +1 -1
- package/dist/ts/utils/pageMetadata.d.ts +6 -2
- package/dist/ts/utils/pageMetadata.d.ts.map +1 -1
- package/dist/ts/utils/pageMetadata.js +25 -7
- package/dist/ts/utils/pageMetadata.js.map +1 -1
- package/dist/ts/utils/schema-fields.d.ts +2 -0
- package/dist/ts/utils/schema-fields.d.ts.map +1 -1
- package/dist/ts/utils/schema-fields.js +8 -0
- package/dist/ts/utils/schema-fields.js.map +1 -1
- package/dist/ts/write-access.d.ts +2 -0
- package/dist/ts/write-access.d.ts.map +1 -1
- package/dist/ts/write-access.js +9 -4
- package/dist/ts/write-access.js.map +1 -1
- package/package.json +18 -7
- package/src/CmsSpaApp.tsx +20 -11
- package/src/components/conflicts/EditorNoticeStrip.tsx +135 -0
- package/src/components/conflicts/FieldConflictList.tsx +59 -0
- package/src/components/conflicts/FieldConflictPicker.tsx +158 -0
- package/src/components/conflicts/OverwriteNotice.tsx +30 -0
- package/src/components/conflicts/PageDraftMenu.tsx +51 -0
- package/src/components/conflicts/PeerAvatars.tsx +51 -0
- package/src/components/conflicts/PuckConflicts.tsx +92 -0
- package/src/components/conflicts/RecentVersionsDialog.tsx +154 -0
- package/src/components/conflicts/conflict-label.ts +124 -0
- package/src/components/conflicts/use-page-conflicts.ts +112 -0
- package/src/components/conflicts/version-copy.ts +33 -0
- package/src/components/dashboard/RecentActivity.tsx +3 -2
- package/src/components/dialogs/CreatePageDialog.tsx +1 -1
- package/src/components/dialogs/DataPropertiesDialog.tsx +22 -4
- package/src/components/dialogs/FragmentPropertiesDialog.tsx +23 -4
- package/src/components/dialogs/PageMetadataDialog.tsx +157 -65
- package/src/components/dialogs/UnsavedChangesDialog.tsx +171 -21
- package/src/components/dialogs/unsaved-guard.ts +15 -0
- package/src/components/editor/CMSMDXEditor.tsx +238 -198
- package/src/components/editor/EditorFrame.tsx +116 -0
- package/src/components/editor/FragmentBlockTypeSelect.tsx +245 -0
- package/src/components/editor/FragmentComponentBlock.tsx +257 -0
- package/src/components/editor/FragmentEditor.tsx +899 -213
- package/src/components/editor/FragmentEditorHeaderActions.tsx +77 -0
- package/src/components/editor/GenericBlock.tsx +127 -16
- package/src/components/editor/InlinePreviewFrame.tsx +78 -0
- package/src/components/editor/JsxPropsPanel.tsx +90 -6
- package/src/components/editor/LocaleSelector.tsx +4 -2
- package/src/components/editor/MDXLivePreview.tsx +44 -46
- package/src/components/editor/MdxPageEditor.tsx +247 -7
- package/src/components/editor/PageEditor.tsx +154 -121
- package/src/components/editor/PageEditorHeaderActions.tsx +65 -27
- package/src/components/editor/PageEditorWrapper.tsx +122 -45
- package/src/components/editor/body-sync-plugin.ts +44 -0
- package/src/components/editor/draft-media-config.ts +22 -0
- package/src/components/editor/fragment-save-check.ts +26 -0
- package/src/components/editor/fragment-save-lifetime.ts +142 -0
- package/src/components/editor/host-wrapper-plugin.ts +28 -7
- package/src/components/editor/index.ts +0 -1
- package/src/components/editor/insert-menu/InsertMdxComponentButton.tsx +7 -11
- package/src/components/editor/insert-menu/SlashMenuPlugin.tsx +95 -18
- package/src/components/editor/insert-menu/insert-payload.ts +79 -30
- package/src/components/editor/insert-menu/mdx-components-plugin.ts +5 -3
- package/src/components/editor/jsx-layout-plugin.ts +103 -0
- package/src/components/editor/offered-mdx-components.ts +35 -0
- package/src/components/editor/page-setting-targets.tsx +2 -0
- package/src/components/editor/preview-availability.ts +21 -1
- package/src/components/editor/prop-field-hint.ts +75 -0
- package/src/components/editor/soft-break-plugin.ts +55 -0
- package/src/components/editor/use-live-page-settings.ts +80 -0
- package/src/components/editor/usePagePreview.ts +291 -0
- package/src/components/editors/DataEditor.tsx +257 -22
- package/src/components/fields/MDXEditField.tsx +2 -2
- package/src/components/forms/SchemaForm.tsx +1 -10
- package/src/components/media/AssetDetailSidebar.tsx +47 -6
- package/src/components/pages/DataList.tsx +14 -4
- package/src/components/pages/FragmentList.tsx +8 -0
- package/src/components/pages/PageList.tsx +90 -337
- package/src/components/pages/PageRow.tsx +290 -0
- package/src/components/pages/PageTable.tsx +71 -0
- package/src/components/pages/page-list-model.ts +98 -0
- package/src/components/puck/MDXContent.tsx +37 -113
- package/src/components/puck/csp-frame-harness.tsx +99 -0
- package/src/components/puck/use-fragment-render.ts +82 -0
- package/src/components/sandbox/ContentSandbox.tsx +6 -11
- package/src/components/sandbox/frame-runtime.ts +0 -2
- package/src/components/toast.tsx +23 -5
- package/src/components/ui/Card.tsx +3 -5
- package/src/components/ui/Select.tsx +14 -6
- package/src/draft-tools.ts +77 -0
- package/src/frame/channel.ts +3 -1
- package/src/frame/editor-frame.ts +210 -30
- package/src/frame/protocol.ts +98 -15
- package/src/hooks/useUnsavedChangesGuard.ts +17 -6
- package/src/host-style-probe.ts +157 -37
- package/src/index.ts +90 -0
- package/src/live/data-binding.ts +252 -0
- package/src/live/doc-channel.ts +343 -0
- package/src/live/held-fragment-edits.ts +47 -0
- package/src/live/markdown-binding.ts +630 -0
- package/src/live/markdown-live-plugin.tsx +1037 -0
- package/src/live/messages.ts +370 -0
- package/src/live/puck-binding.tsx +579 -0
- package/src/live/undo.ts +112 -0
- package/src/live/use-live.ts +264 -0
- package/src/main.css +184 -4
- package/src/mdx-components-define.ts +170 -24
- package/src/mdx-components.ts +29 -30
- package/src/media/AssetScopePill.tsx +2 -1
- package/src/merge-default-props.ts +4 -0
- package/src/selected-block.ts +55 -3
- package/src/site-render.ts +146 -0
- package/src/types.ts +3 -0
- package/src/ui-config.ts +51 -15
- package/src/utils/apply-clash.ts +113 -0
- package/src/utils/mdast-tree.ts +8 -12
- package/src/utils/pageMetadata.ts +25 -7
- package/src/utils/schema-fields.ts +9 -0
- package/src/write-access.ts +10 -4
- package/styles/tailwind-theme.css +11 -0
- package/dist/ts/components/editor/ContentDiff.d.ts +0 -10
- package/dist/ts/components/editor/ContentDiff.d.ts.map +0 -1
- package/dist/ts/components/editor/ContentDiff.js +0 -52
- package/dist/ts/components/editor/ContentDiff.js.map +0 -1
- package/src/components/editor/ContentDiff.tsx +0 -251
|
@@ -6,10 +6,18 @@ import {
|
|
|
6
6
|
} from '@conloca/content-api-client';
|
|
7
7
|
import { AlertCircle, Code2, Loader2, Save } from 'lucide-react';
|
|
8
8
|
import { useEffect, useRef, useState } from 'react';
|
|
9
|
+
import { notifyEditorDirtyChanged, registerEditorFlushHandler } from '../../editor-flush.js';
|
|
9
10
|
import { type HostSchema, isHostSchema } from '../../host-schema.js';
|
|
11
|
+
import { dropHeldDataValues, heldDataKeys, type LiveDataValues, useLiveDataValues } from '../../live/data-binding.js';
|
|
12
|
+
import { type FrameLiveDoc, useDocChannel } from '../../live/doc-channel.js';
|
|
13
|
+
import { useLiveDoc } from '../../live/use-live.js';
|
|
10
14
|
import { contentFailureMessage } from '../../utils/content-failure.js';
|
|
11
15
|
import { validateEntryData } from '../../utils/data-entry-validation.js';
|
|
12
|
-
import {
|
|
16
|
+
import { DraftNoticeStrip } from '../conflicts/EditorNoticeStrip.js';
|
|
17
|
+
import { PageDraftMenu } from '../conflicts/PageDraftMenu.js';
|
|
18
|
+
import { PeerAvatars } from '../conflicts/PeerAvatars.js';
|
|
19
|
+
import { draftToolsPage } from '../conflicts/use-page-conflicts.js';
|
|
20
|
+
import { LiveLeaveGuard, UnsavedChangesDialog } from '../dialogs/UnsavedChangesDialog.js';
|
|
13
21
|
import { LocaleSelector } from '../editor/LocaleSelector.js';
|
|
14
22
|
import { SchemaForm } from '../forms/SchemaForm.js';
|
|
15
23
|
|
|
@@ -20,8 +28,8 @@ interface DataEditorProps {
|
|
|
20
28
|
initialLocale: string;
|
|
21
29
|
existingLocales: string[];
|
|
22
30
|
schema: HostSchema | null;
|
|
23
|
-
/** Writes a new entry holding `data`; resolves
|
|
24
|
-
create?: (data: DataCollectionEntry['data']) => Promise<
|
|
31
|
+
/** Writes a new entry holding `data`; resolves its id and etag once created, null when refused. */
|
|
32
|
+
create?: (data: DataCollectionEntry['data']) => Promise<{ id?: string; etag?: string } | null>;
|
|
25
33
|
onSave?: () => void;
|
|
26
34
|
onCancel?: () => void;
|
|
27
35
|
}
|
|
@@ -31,7 +39,31 @@ interface DataEditorProps {
|
|
|
31
39
|
* Uses collection-specific schema for form generation if available.
|
|
32
40
|
* Supports locale switching similar to FragmentEditor.
|
|
33
41
|
*/
|
|
34
|
-
export function DataEditor({
|
|
42
|
+
export function DataEditor(props: DataEditorProps) {
|
|
43
|
+
// The entry's id: a new entry gets one once created, and from then on is bound like any other.
|
|
44
|
+
const [id, setId] = useState(props.id);
|
|
45
|
+
// Typed during the create of an entry made here and stored by nothing yet; see `EntryEditor`'s `takeCarried`.
|
|
46
|
+
const [carrying, setCarrying] = useState(false);
|
|
47
|
+
// Above the loading and error screens too: a locale switch reloads, and the old doc may still owe work.
|
|
48
|
+
const bound = useDocChannel() !== null && id !== '';
|
|
49
|
+
return (
|
|
50
|
+
<>
|
|
51
|
+
{bound && <LiveLeaveGuard unsaved={carrying} />}
|
|
52
|
+
<EntryEditor
|
|
53
|
+
{...props}
|
|
54
|
+
id={id}
|
|
55
|
+
carrying={carrying}
|
|
56
|
+
onCreated={(created) => {
|
|
57
|
+
setId(created);
|
|
58
|
+
setCarrying(true);
|
|
59
|
+
}}
|
|
60
|
+
onCarried={() => setCarrying(false)}
|
|
61
|
+
/>
|
|
62
|
+
</>
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function EntryEditor({
|
|
35
67
|
id,
|
|
36
68
|
collection,
|
|
37
69
|
initialLocale,
|
|
@@ -40,41 +72,66 @@ export function DataEditor({
|
|
|
40
72
|
create,
|
|
41
73
|
onSave,
|
|
42
74
|
onCancel,
|
|
43
|
-
|
|
75
|
+
carrying,
|
|
76
|
+
onCreated,
|
|
77
|
+
onCarried,
|
|
78
|
+
}: DataEditorProps & { carrying: boolean; onCreated: (id: string) => void; onCarried: () => void }) {
|
|
44
79
|
// Locale state
|
|
45
80
|
const [currentLocale, setCurrentLocale] = useState(initialLocale);
|
|
46
|
-
|
|
81
|
+
// null: the version is not known (nothing loaded, or a create that returned no tag); '' is a real, loaded tag.
|
|
82
|
+
const [currentEtag, setCurrentEtag] = useState<string | null>(null);
|
|
47
83
|
const [pendingLocaleSwitch, setPendingLocaleSwitch] = useState<string | null>(null);
|
|
48
84
|
const [showUnsavedDialog, setShowUnsavedDialog] = useState(false);
|
|
49
85
|
|
|
50
86
|
// Track saved values to detect changes
|
|
51
87
|
const savedValuesRef = useRef<Record<string, unknown>>({});
|
|
88
|
+
// The values as typed, current even inside a save's await (state is only current after the next render).
|
|
89
|
+
const latestValuesRef = useRef(savedValuesRef.current);
|
|
90
|
+
// Typed during the create of an entry made here, not stored yet: the form keeps it, with Save, until the entry's
|
|
91
|
+
// doc opens and takes it, once; a doc that fails to open leaves it to Save.
|
|
92
|
+
const carryingRef = useRef(false);
|
|
93
|
+
const takeCarried = () => {
|
|
94
|
+
if (!carryingRef.current) return null;
|
|
95
|
+
carryingRef.current = false;
|
|
96
|
+
onCarried();
|
|
97
|
+
return latestValuesRef.current === savedValuesRef.current ? null : latestValuesRef.current;
|
|
98
|
+
};
|
|
52
99
|
|
|
53
100
|
const { data: entry, isLoading, error } = useLocalizedContent(id, currentLocale);
|
|
54
101
|
const updateLocalized = useUpdateLocalized();
|
|
55
102
|
|
|
56
103
|
// Local state for form values
|
|
57
|
-
|
|
104
|
+
// The same object the refs hold, so a save of untouched values is not taken for typing during it.
|
|
105
|
+
const [values, setValues] = useState(savedValuesRef.current);
|
|
58
106
|
const [hasChanges, setHasChanges] = useState(false);
|
|
59
107
|
const [saveError, setSaveError] = useState<string | null>(null);
|
|
60
108
|
const [saving, setSaving] = useState(false);
|
|
61
109
|
const isNew = id === '';
|
|
110
|
+
// Bound to the entry's shared doc, each valid change is written as it is typed; a new entry has no doc until created.
|
|
111
|
+
const channel = useDocChannel();
|
|
112
|
+
const docWanted = channel !== null && id !== '';
|
|
113
|
+
const liveDoc = useLiveDoc(docWanted ? { kind: 'data', id, locale: currentLocale } : null);
|
|
114
|
+
const bound = docWanted && (!carrying || liveDoc.state === 'ready');
|
|
115
|
+
const [dropSwitch, setDropSwitch] = useState<{ locale: string; keys: string[] } | null>(null);
|
|
62
116
|
|
|
63
|
-
// Initialize form values and etag when entry loads
|
|
117
|
+
// Initialize form values and etag when entry loads. A save's cache update or a refetch also emits a
|
|
118
|
+
// new entry; an edit not yet stored is kept, and so is the etag it was based on, so its save conflicts
|
|
119
|
+
// with a newer server version instead of overwriting it.
|
|
64
120
|
useEffect(() => {
|
|
65
|
-
if (entry?.localized
|
|
66
|
-
|
|
121
|
+
if (entry?.localized && latestValuesRef.current === savedValuesRef.current) {
|
|
122
|
+
// An entry stored with no data still loads, so its etag is taken and its first save is checked.
|
|
123
|
+
const data = entry.localized.content?.data ?? {};
|
|
67
124
|
setValues(data);
|
|
68
125
|
savedValuesRef.current = data;
|
|
126
|
+
latestValuesRef.current = data;
|
|
69
127
|
setHasChanges(false);
|
|
70
|
-
|
|
71
|
-
if (entry?.localized?.etag) {
|
|
72
|
-
setCurrentEtag(entry.localized.etag);
|
|
128
|
+
setCurrentEtag(entry.localized.etag ?? null);
|
|
73
129
|
}
|
|
74
130
|
}, [entry]);
|
|
75
131
|
|
|
76
132
|
// Track changes
|
|
77
133
|
const handleChange = (newValues: Record<string, unknown>) => {
|
|
134
|
+
latestValuesRef.current = newValues;
|
|
78
135
|
setValues(newValues);
|
|
79
136
|
setHasChanges(true);
|
|
80
137
|
};
|
|
@@ -92,11 +149,26 @@ export function DataEditor({
|
|
|
92
149
|
setSaving(true);
|
|
93
150
|
try {
|
|
94
151
|
if (isNew) {
|
|
95
|
-
const created = (await create?.(values)) ??
|
|
96
|
-
if (created)
|
|
97
|
-
|
|
152
|
+
const created = (await create?.(values)) ?? null;
|
|
153
|
+
if (!created) return false;
|
|
154
|
+
savedValuesRef.current = values;
|
|
155
|
+
// Typing during the create is not stored yet: keep it open; bound, the doc takes it, else the next save does.
|
|
156
|
+
if (latestValuesRef.current !== values && created.id) {
|
|
157
|
+
setCurrentEtag(created.etag ?? null);
|
|
158
|
+
carryingRef.current = true;
|
|
159
|
+
onCreated(created.id);
|
|
160
|
+
} else {
|
|
161
|
+
setHasChanges(false);
|
|
162
|
+
onSave?.();
|
|
163
|
+
}
|
|
164
|
+
return true;
|
|
98
165
|
}
|
|
99
166
|
|
|
167
|
+
// Never write unchecked: a tag fetched now would match a teammate's later save and overwrite it.
|
|
168
|
+
if (currentEtag === null) {
|
|
169
|
+
setSaveError("Could not confirm this entry's version. Close it, reopen it and enter your changes again.");
|
|
170
|
+
return false;
|
|
171
|
+
}
|
|
100
172
|
const result = await updateLocalized.mutateAsync({
|
|
101
173
|
id,
|
|
102
174
|
locale: currentLocale,
|
|
@@ -110,18 +182,63 @@ export function DataEditor({
|
|
|
110
182
|
setSaveError(contentFailureMessage(result, 'Failed to save data'));
|
|
111
183
|
return false;
|
|
112
184
|
}
|
|
113
|
-
setHasChanges(false);
|
|
114
185
|
savedValuesRef.current = values;
|
|
115
186
|
if (result.etag) {
|
|
116
187
|
setCurrentEtag(result.etag);
|
|
117
188
|
}
|
|
118
|
-
|
|
189
|
+
// Typing during the write is not stored yet: the edit stays unsaved and the editor stays open.
|
|
190
|
+
if (latestValuesRef.current === values) {
|
|
191
|
+
setHasChanges(false);
|
|
192
|
+
// The carried typing is stored now: nothing is left for the doc to take or for leaving to lose.
|
|
193
|
+
if (carryingRef.current) {
|
|
194
|
+
carryingRef.current = false;
|
|
195
|
+
onCarried();
|
|
196
|
+
}
|
|
197
|
+
onSave?.();
|
|
198
|
+
}
|
|
119
199
|
return true;
|
|
120
200
|
} finally {
|
|
121
201
|
setSaving(false);
|
|
122
202
|
}
|
|
123
203
|
};
|
|
124
204
|
|
|
205
|
+
// The host's Save, Cmd+S and status pill read and flush this edit; bound, the shared doc is already synced.
|
|
206
|
+
const hasChangesRef = useRef(hasChanges);
|
|
207
|
+
hasChangesRef.current = hasChanges;
|
|
208
|
+
// One save at a time: the button, the locale dialog and the host's flush all join the save already running.
|
|
209
|
+
const activeSaveRef = useRef<Promise<boolean> | null>(null);
|
|
210
|
+
const save = (): Promise<boolean> => {
|
|
211
|
+
if (activeSaveRef.current) return activeSaveRef.current;
|
|
212
|
+
const running = handleSave().finally(() => {
|
|
213
|
+
activeSaveRef.current = null;
|
|
214
|
+
});
|
|
215
|
+
activeSaveRef.current = running;
|
|
216
|
+
return running;
|
|
217
|
+
};
|
|
218
|
+
// save is recreated each render; the flush runs the latest.
|
|
219
|
+
const saveRef = useRef(save);
|
|
220
|
+
saveRef.current = save;
|
|
221
|
+
useEffect(() => {
|
|
222
|
+
if (bound) return undefined;
|
|
223
|
+
return registerEditorFlushHandler(
|
|
224
|
+
async () => {
|
|
225
|
+
const active = activeSaveRef.current;
|
|
226
|
+
if (!active && !hasChangesRef.current) return { ok: true };
|
|
227
|
+
const saved = await (active ?? saveRef.current()).catch(() => false);
|
|
228
|
+
// A joined save wrote older values; the edit typed since is not stored, so this flush did not save it.
|
|
229
|
+
if (saved && latestValuesRef.current !== savedValuesRef.current) {
|
|
230
|
+
return { ok: false, message: 'The editor changed while saving; save again.' };
|
|
231
|
+
}
|
|
232
|
+
return saved ? { ok: true } : { ok: false, message: 'Could not save editor changes.' };
|
|
233
|
+
},
|
|
234
|
+
{ isDirty: () => hasChangesRef.current },
|
|
235
|
+
);
|
|
236
|
+
}, [bound]);
|
|
237
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: The dependency change is the event; handlers read current state through refs.
|
|
238
|
+
useEffect(() => {
|
|
239
|
+
notifyEditorDirtyChanged();
|
|
240
|
+
}, [hasChanges]);
|
|
241
|
+
|
|
125
242
|
// Locale switching handlers
|
|
126
243
|
const handleLocaleChange = async (newLocale: string) => {
|
|
127
244
|
if (newLocale === currentLocale) return;
|
|
@@ -147,6 +264,7 @@ export function DataEditor({
|
|
|
147
264
|
const newData = (newLocaleContent.localized.content?.data as Record<string, unknown>) || {};
|
|
148
265
|
setValues(newData);
|
|
149
266
|
savedValuesRef.current = newData;
|
|
267
|
+
latestValuesRef.current = newData;
|
|
150
268
|
setCurrentEtag(newLocaleContent.localized.etag);
|
|
151
269
|
setHasChanges(false);
|
|
152
270
|
setCurrentLocale(newLocale);
|
|
@@ -163,7 +281,7 @@ export function DataEditor({
|
|
|
163
281
|
|
|
164
282
|
// Save current content first; a refused save keeps the locale and the edits, with the reason shown.
|
|
165
283
|
try {
|
|
166
|
-
const saved = await
|
|
284
|
+
const saved = await save();
|
|
167
285
|
setShowUnsavedDialog(false);
|
|
168
286
|
if (saved) await switchLocale(pendingLocaleSwitch);
|
|
169
287
|
else setPendingLocaleSwitch(null);
|
|
@@ -186,8 +304,8 @@ export function DataEditor({
|
|
|
186
304
|
setPendingLocaleSwitch(null);
|
|
187
305
|
};
|
|
188
306
|
|
|
189
|
-
// Loading state
|
|
190
|
-
if (isLoading) {
|
|
307
|
+
// Loading state; an entry just created here keeps its unsaved form while it loads.
|
|
308
|
+
if (isLoading && !hasChanges) {
|
|
191
309
|
return (
|
|
192
310
|
<div className="flex items-center justify-center py-12">
|
|
193
311
|
<Loader2 className="h-6 w-6 animate-spin text-azure-04 dark:text-azure-08" />
|
|
@@ -223,10 +341,91 @@ export function DataEditor({
|
|
|
223
341
|
);
|
|
224
342
|
}
|
|
225
343
|
|
|
344
|
+
if (bound) {
|
|
345
|
+
// The doc is already synced, so a locale switch saves nothing first; it only asks before dropping held values.
|
|
346
|
+
const switchLiveLocale = (locale: string) => {
|
|
347
|
+
if (locale === currentLocale) return;
|
|
348
|
+
const keys = heldDataKeys(`${id}:${currentLocale}`);
|
|
349
|
+
if (keys.length > 0) setDropSwitch({ locale, keys });
|
|
350
|
+
else setCurrentLocale(locale);
|
|
351
|
+
};
|
|
352
|
+
const draftPage = draftToolsPage(id, currentLocale);
|
|
353
|
+
return (
|
|
354
|
+
<div className="space-y-6">
|
|
355
|
+
<DraftNoticeStrip
|
|
356
|
+
id={id}
|
|
357
|
+
locale={currentLocale}
|
|
358
|
+
docKey={liveDoc.state === 'ready' ? liveDoc.live.docKey : undefined}
|
|
359
|
+
/>
|
|
360
|
+
<div className="flex items-center gap-3 pb-4 border-b border-grey-09 dark:border-grey-03">
|
|
361
|
+
<span className="text-sm text-grey-04 dark:text-grey-07">Locale:</span>
|
|
362
|
+
<LocaleSelector
|
|
363
|
+
currentLocale={currentLocale}
|
|
364
|
+
availableLocales={existingLocales}
|
|
365
|
+
onChange={switchLiveLocale}
|
|
366
|
+
/>
|
|
367
|
+
<div className="ml-auto flex items-center gap-2">
|
|
368
|
+
{liveDoc.state === 'ready' && <PeerAvatars live={liveDoc.live} />}
|
|
369
|
+
{draftPage && <PageDraftMenu page={draftPage} label={entry?.localized?.meta?.title || id} />}
|
|
370
|
+
</div>
|
|
371
|
+
</div>
|
|
372
|
+
{liveDoc.state === 'ready' ? (
|
|
373
|
+
<LiveDataForm
|
|
374
|
+
key={liveDoc.live.docKey}
|
|
375
|
+
live={liveDoc.live}
|
|
376
|
+
schema={schema}
|
|
377
|
+
entry={`${id}:${currentLocale}`}
|
|
378
|
+
takeCarried={takeCarried}
|
|
379
|
+
/>
|
|
380
|
+
) : liveDoc.state === 'failed' ? (
|
|
381
|
+
<p className="text-red-04 dark:text-red-08">{liveDoc.message}</p>
|
|
382
|
+
) : (
|
|
383
|
+
<Loader2 className="h-6 w-6 animate-spin text-azure-04 dark:text-azure-08" />
|
|
384
|
+
)}
|
|
385
|
+
{onCancel && (
|
|
386
|
+
<div className="flex justify-end pt-4 border-t border-grey-09 dark:border-grey-03">
|
|
387
|
+
<button
|
|
388
|
+
type="button"
|
|
389
|
+
onClick={onCancel}
|
|
390
|
+
className="px-4 py-2 border border-grey-09 dark:border-grey-03 rounded-md hover:bg-grey-11 dark:hover:bg-grey-03 transition-colors"
|
|
391
|
+
>
|
|
392
|
+
Close
|
|
393
|
+
</button>
|
|
394
|
+
</div>
|
|
395
|
+
)}
|
|
396
|
+
{dropSwitch && (
|
|
397
|
+
<div role="alertdialog" aria-label="Values not saved" className="p-3 border border-yellow-08 rounded-md">
|
|
398
|
+
<p className="text-sm">
|
|
399
|
+
These values are not valid, so they were never saved, and switching locale drops them:{' '}
|
|
400
|
+
{dropSwitch.keys.join(', ')}
|
|
401
|
+
</p>
|
|
402
|
+
<div className="flex justify-end gap-2 pt-2">
|
|
403
|
+
<button type="button" onClick={() => setDropSwitch(null)} className="px-3 py-1 border rounded-md">
|
|
404
|
+
Cancel
|
|
405
|
+
</button>
|
|
406
|
+
<button
|
|
407
|
+
type="button"
|
|
408
|
+
onClick={() => {
|
|
409
|
+
dropHeldDataValues(`${id}:${currentLocale}`);
|
|
410
|
+
setDropSwitch(null);
|
|
411
|
+
setCurrentLocale(dropSwitch.locale);
|
|
412
|
+
}}
|
|
413
|
+
className="px-3 py-1 bg-red-04 text-white rounded-md"
|
|
414
|
+
>
|
|
415
|
+
Drop them and switch
|
|
416
|
+
</button>
|
|
417
|
+
</div>
|
|
418
|
+
</div>
|
|
419
|
+
)}
|
|
420
|
+
</div>
|
|
421
|
+
);
|
|
422
|
+
}
|
|
423
|
+
|
|
226
424
|
// Schema exists - render form
|
|
227
425
|
return (
|
|
228
426
|
<>
|
|
229
427
|
<div className="space-y-6">
|
|
428
|
+
{!isNew && <DraftNoticeStrip id={id} locale={currentLocale} />}
|
|
230
429
|
{/* Locale selector header - only show existing locales; a new entry has one, the one it is created in */}
|
|
231
430
|
{!isNew && (
|
|
232
431
|
<div className="flex items-center gap-3 pb-4 border-b border-grey-09 dark:border-grey-03">
|
|
@@ -270,7 +469,7 @@ export function DataEditor({
|
|
|
270
469
|
)}
|
|
271
470
|
<button
|
|
272
471
|
type="button"
|
|
273
|
-
onClick={
|
|
472
|
+
onClick={save}
|
|
274
473
|
disabled={(!hasChanges && !isNew) || saving || !isHostSchema(schema)}
|
|
275
474
|
className="px-4 py-2 bg-azure-04 text-white rounded-md hover:bg-azure-03 transition-colors disabled:opacity-50 disabled:cursor-not-allowed inline-flex items-center gap-2"
|
|
276
475
|
>
|
|
@@ -301,3 +500,39 @@ export function DataEditor({
|
|
|
301
500
|
</>
|
|
302
501
|
);
|
|
303
502
|
}
|
|
503
|
+
|
|
504
|
+
/** The form over the entry's replica: what it shows is the doc's data, with the values the schema rejected held. */
|
|
505
|
+
function LiveDataForm({
|
|
506
|
+
live,
|
|
507
|
+
schema,
|
|
508
|
+
entry,
|
|
509
|
+
takeCarried,
|
|
510
|
+
}: {
|
|
511
|
+
live: FrameLiveDoc;
|
|
512
|
+
schema: HostSchema;
|
|
513
|
+
entry: string;
|
|
514
|
+
takeCarried: () => LiveDataValues['values'] | null;
|
|
515
|
+
}) {
|
|
516
|
+
const { values, change, errors } = useLiveDataValues(
|
|
517
|
+
live,
|
|
518
|
+
(next) => (isHostSchema(schema) ? validateEntryData(schema, next) : null),
|
|
519
|
+
entry,
|
|
520
|
+
);
|
|
521
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: written once, into the doc of the entry just created.
|
|
522
|
+
useEffect(() => {
|
|
523
|
+
const carried = takeCarried();
|
|
524
|
+
if (carried) change(carried);
|
|
525
|
+
}, []);
|
|
526
|
+
const messages = [...new Set(Object.values(errors))];
|
|
527
|
+
return (
|
|
528
|
+
<>
|
|
529
|
+
<SchemaForm schema={schema} values={values} onChange={change} />
|
|
530
|
+
{messages.length > 0 && (
|
|
531
|
+
<div className="flex items-center gap-2 p-3 bg-red-11 dark:bg-red-02 border border-red-08 dark:border-red-03 rounded-md text-red-04 dark:text-red-08 text-sm">
|
|
532
|
+
<AlertCircle className="h-4 w-4 flex-shrink-0" />
|
|
533
|
+
<span>Not saved until fixed. {messages.join(' ')}</span>
|
|
534
|
+
</div>
|
|
535
|
+
)}
|
|
536
|
+
</>
|
|
537
|
+
);
|
|
538
|
+
}
|
|
@@ -14,14 +14,14 @@ interface MDXEditFieldProps {
|
|
|
14
14
|
* than opening a modal. The page-route editor brings unsaved-changes guarding,
|
|
15
15
|
* conflict recovery, locale switching, and Cmd+S — none of which the modal
|
|
16
16
|
* had. The `?from=page` flag asks FragmentEditor to surface a shared-content
|
|
17
|
-
* warning banner and offer a
|
|
17
|
+
* warning banner and offer a back arrow that returns to this page.
|
|
18
18
|
*/
|
|
19
19
|
export function MDXEditField({ entry }: MDXEditFieldProps) {
|
|
20
20
|
const navigate = useNavigate();
|
|
21
21
|
// `:id` exists because MDXEditField is only rendered inside the Puck page
|
|
22
22
|
// editor, which mounts at `/pages/:id`. If we ever surface this field
|
|
23
23
|
// elsewhere the navigation will silently lose the return path, so the
|
|
24
|
-
// button still works (lands on /fragments/:id with
|
|
24
|
+
// button still works (lands on /fragments/:id with Back returning to the fragments list).
|
|
25
25
|
const { id: pageId } = useParams<{ id: string }>();
|
|
26
26
|
|
|
27
27
|
const handleOpenEditor = () => {
|
|
@@ -2,7 +2,7 @@ import { Loader2 } from 'lucide-react';
|
|
|
2
2
|
import { useId } from 'react';
|
|
3
3
|
import { type HostSchema, isHostSchema } from '../../host-schema.js';
|
|
4
4
|
import { fromDatetimeLocalValue, toDatetimeLocalValue } from '../../utils/pageMetadata.js';
|
|
5
|
-
import { type FieldInfo, type FormFields, fieldsOfHostSchema } from '../../utils/schema-fields.js';
|
|
5
|
+
import { type FieldInfo, type FormFields, fieldsOfHostSchema, formatFieldLabel } from '../../utils/schema-fields.js';
|
|
6
6
|
import { ImageFieldRender } from '../fields/ImageField.js';
|
|
7
7
|
import { Input, Select, Textarea } from '../ui/index.js';
|
|
8
8
|
import { ChipArrayField } from './ChipArrayField.js';
|
|
@@ -302,15 +302,6 @@ function SchemaField({ name, fieldInfo, value, onChange }: SchemaFieldProps) {
|
|
|
302
302
|
}
|
|
303
303
|
}
|
|
304
304
|
|
|
305
|
-
function formatFieldLabel(name: string): string {
|
|
306
|
-
// Convert camelCase/snake_case to Title Case
|
|
307
|
-
return name
|
|
308
|
-
.replace(/([A-Z])/g, ' $1')
|
|
309
|
-
.replace(/_/g, ' ')
|
|
310
|
-
.replace(/^\w/, (c) => c.toUpperCase())
|
|
311
|
-
.trim();
|
|
312
|
-
}
|
|
313
|
-
|
|
314
305
|
function formatEnumLabel(value: string): string {
|
|
315
306
|
// Convert enum values like "PENDING", "in_progress", "camelCase" to readable labels
|
|
316
307
|
return value
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { formatFileSize } from '@conloca/content-api-client';
|
|
1
|
+
import { APIClientError, ErrorCodes, formatFileSize } from '@conloca/content-api-client';
|
|
2
2
|
import { FolderInput, Loader2, Trash2, X } from 'lucide-react';
|
|
3
3
|
import { useMemo, useState } from 'react';
|
|
4
4
|
import type { AssetEntry } from '../../hooks/index.js';
|
|
@@ -22,6 +22,19 @@ function formatDate(dateString: string): string {
|
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
+
/** The asset as it stands when a save was refused because someone else changed the field meanwhile, else null. */
|
|
26
|
+
function changedMeanwhile(error: Error): AssetEntry | null {
|
|
27
|
+
if (!(error instanceof APIClientError) || error.code !== ErrorCodes.WRITE_ERROR) return null;
|
|
28
|
+
// The refusal names the clashing `fields` and carries `current`, the asset entry it refused the save against; any
|
|
29
|
+
// other write error is a failed save.
|
|
30
|
+
const details: { fields?: string[]; current?: AssetEntry } | undefined = error.details;
|
|
31
|
+
const current = details?.current;
|
|
32
|
+
if (!Array.isArray(details?.fields) || typeof current !== 'object' || current === null) return null;
|
|
33
|
+
return current;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const CHANGED_MEANWHILE = 'Changed by someone else while you were editing. Check the new value and save again.';
|
|
37
|
+
|
|
25
38
|
interface AssetDetailSidebarProps {
|
|
26
39
|
/**
|
|
27
40
|
* The asset's record as the folder listing currently holds it. The caller
|
|
@@ -48,6 +61,8 @@ export function AssetDetailSidebar({
|
|
|
48
61
|
const [storedAlt, setStoredAlt] = useState(asset.alt || '');
|
|
49
62
|
const [storedTags, setStoredTags] = useState<string[]>(asset.tags ?? []);
|
|
50
63
|
const [confirmDelete, setConfirmDelete] = useState(false);
|
|
64
|
+
// Whether a save was refused because someone else changed the field meanwhile.
|
|
65
|
+
const [changedNotice, setChangedNotice] = useState(false);
|
|
51
66
|
const [showMoveDialog, setShowMoveDialog] = useState(false);
|
|
52
67
|
// Whether the pages using this image are known, so a move or delete cannot be confirmed before they are shown.
|
|
53
68
|
const [usageSettled, setUsageSettled] = useState(false);
|
|
@@ -105,16 +120,28 @@ export function AssetDetailSidebar({
|
|
|
105
120
|
// reloads `asset` a moment after each save, so an edit put back within that
|
|
106
121
|
// moment would look unchanged, and a reload can carry someone else's save, so
|
|
107
122
|
// an untouched field would look changed and be written over it. A save that
|
|
108
|
-
// fails changed nothing, so the next blur sends it again.
|
|
123
|
+
// fails changed nothing, so the next blur sends it again. Each save sends
|
|
124
|
+
// what the panel believes is stored, so a server can refuse it when someone
|
|
125
|
+
// else changed that field meanwhile; the panel then shows their value.
|
|
126
|
+
const base = { alt: storedAlt || null, tags: storedTags.length > 0 ? storedTags : null };
|
|
109
127
|
const handleAltBlur = () => {
|
|
110
128
|
if (altText === storedAlt) return;
|
|
111
129
|
const previous = storedAlt;
|
|
112
130
|
setStoredAlt(altText);
|
|
131
|
+
setChangedNotice(false);
|
|
113
132
|
saveAlt.mutate(
|
|
114
133
|
// null clears: undefined is dropped from the JSON body and the stored
|
|
115
134
|
// record would keep the old alt text.
|
|
116
|
-
{ path, updates: { alt: altText || null } },
|
|
117
|
-
{
|
|
135
|
+
{ path, updates: { alt: altText || null }, base },
|
|
136
|
+
{
|
|
137
|
+
onError: (error) => {
|
|
138
|
+
const current = changedMeanwhile(error);
|
|
139
|
+
if (current === null) return setStoredAlt(previous);
|
|
140
|
+
setStoredAlt(current.alt || '');
|
|
141
|
+
setAltText(current.alt || '');
|
|
142
|
+
setChangedNotice(true);
|
|
143
|
+
},
|
|
144
|
+
},
|
|
118
145
|
);
|
|
119
146
|
};
|
|
120
147
|
|
|
@@ -127,9 +154,18 @@ export function AssetDetailSidebar({
|
|
|
127
154
|
if (JSON.stringify(newTags) === JSON.stringify(storedTags)) return;
|
|
128
155
|
const previous = storedTags;
|
|
129
156
|
setStoredTags(newTags);
|
|
157
|
+
setChangedNotice(false);
|
|
130
158
|
saveTags.mutate(
|
|
131
|
-
{ path, updates: { tags: newTags.length > 0 ? newTags : null } },
|
|
132
|
-
{
|
|
159
|
+
{ path, updates: { tags: newTags.length > 0 ? newTags : null }, base },
|
|
160
|
+
{
|
|
161
|
+
onError: (error) => {
|
|
162
|
+
const current = changedMeanwhile(error);
|
|
163
|
+
if (current === null) return setStoredTags(previous);
|
|
164
|
+
setStoredTags(current.tags ?? []);
|
|
165
|
+
setTagsInput(current.tags?.join(', ') || '');
|
|
166
|
+
setChangedNotice(true);
|
|
167
|
+
},
|
|
168
|
+
},
|
|
133
169
|
);
|
|
134
170
|
};
|
|
135
171
|
|
|
@@ -260,6 +296,11 @@ export function AssetDetailSidebar({
|
|
|
260
296
|
/>
|
|
261
297
|
<p className="mt-1 text-xs text-grey-04 dark:text-grey-07">Separate tags with commas</p>
|
|
262
298
|
</div>
|
|
299
|
+
{changedNotice && (
|
|
300
|
+
<p role="alert" className="text-xs text-red-04 dark:text-red-08">
|
|
301
|
+
{CHANGED_MEANWHILE}
|
|
302
|
+
</p>
|
|
303
|
+
)}
|
|
263
304
|
</div>
|
|
264
305
|
|
|
265
306
|
{/* Usage section */}
|
|
@@ -17,6 +17,7 @@ import type { DataSchemas } from '../../data-schemas.js';
|
|
|
17
17
|
import { useDialogState, useErrorModal } from '../../hooks/index.js';
|
|
18
18
|
import type { DataEntry } from '../../types.js';
|
|
19
19
|
import { getUIConfig } from '../../ui-config.js';
|
|
20
|
+
import { ApplyClashError } from '../../utils/apply-clash.js';
|
|
20
21
|
import { contentFailureMessage, isStaleWrite } from '../../utils/content-failure.js';
|
|
21
22
|
import { editableEntryMeta, entryMetaPatch } from '../../utils/entry-meta.js';
|
|
22
23
|
import { untitledName, untitledNameNote } from '../../utils/entry-name.js';
|
|
@@ -208,7 +209,7 @@ export function DataList({ dataSchemas }: DataListProps) {
|
|
|
208
209
|
});
|
|
209
210
|
};
|
|
210
211
|
|
|
211
|
-
/** Writes the new entry the editor is open on, holding `entryData`; resolves
|
|
212
|
+
/** Writes the new entry the editor is open on, holding `entryData`; resolves its id and etag once created. */
|
|
212
213
|
const createEntry = async (entryData: DataCollectionEntry['data']) => {
|
|
213
214
|
const { collection, entryTitle: title, locale, name } = editDataDialog;
|
|
214
215
|
const description = editDataDialog.description || undefined;
|
|
@@ -251,14 +252,14 @@ export function DataList({ dataSchemas }: DataListProps) {
|
|
|
251
252
|
),
|
|
252
253
|
error,
|
|
253
254
|
);
|
|
254
|
-
return
|
|
255
|
+
return null;
|
|
255
256
|
}
|
|
256
257
|
|
|
257
258
|
if (!result.success) {
|
|
258
259
|
const nameTaken = result.reason === 'name_taken' || result.reason === 'already_exists';
|
|
259
260
|
showError(withNameNote(contentFailureMessage(result, 'Failed to create data entry'), nameTaken), result.error);
|
|
260
261
|
}
|
|
261
|
-
return result.success;
|
|
262
|
+
return result.success ? { id: result.id, etag: result.etag } : null;
|
|
262
263
|
};
|
|
263
264
|
|
|
264
265
|
const handleDeleteEntry = (entryId: string) => {
|
|
@@ -321,6 +322,12 @@ export function DataList({ dataSchemas }: DataListProps) {
|
|
|
321
322
|
etag: propertiesDialog.etag,
|
|
322
323
|
});
|
|
323
324
|
|
|
325
|
+
const clash = result.success ? undefined : result.conflictDetails?.conflicts;
|
|
326
|
+
if (clash && clash.length > 0) {
|
|
327
|
+
// The dialog stays open with the other values loaded; the next Save sends against the page as it is now.
|
|
328
|
+
if (result.currentEtag) openPropertiesDialog({ ...propertiesDialog, etag: result.currentEtag });
|
|
329
|
+
throw new ApplyClashError(clash, result.conflictDetails?.changedBy);
|
|
330
|
+
}
|
|
324
331
|
closePropertiesDialog();
|
|
325
332
|
|
|
326
333
|
if (!result.success) {
|
|
@@ -331,6 +338,7 @@ export function DataList({ dataSchemas }: DataListProps) {
|
|
|
331
338
|
}
|
|
332
339
|
}
|
|
333
340
|
} catch (err) {
|
|
341
|
+
if (err instanceof ApplyClashError) throw err;
|
|
334
342
|
closePropertiesDialog();
|
|
335
343
|
showError('Failed to save properties. Please try again.', err);
|
|
336
344
|
}
|
|
@@ -468,7 +476,9 @@ export function DataList({ dataSchemas }: DataListProps) {
|
|
|
468
476
|
className="fixed inset-0 bg-black/50 backdrop-blur-sm flex items-center justify-center z-50"
|
|
469
477
|
role="dialog"
|
|
470
478
|
onKeyDown={(e) => {
|
|
471
|
-
|
|
479
|
+
// A menu or dialog opened from the editor closes itself on Escape; React still bubbles the key here.
|
|
480
|
+
const layer = e.target instanceof Element ? e.target.closest('[role="dialog"], [role="menu"]') : null;
|
|
481
|
+
if (e.key === 'Escape' && layer === e.currentTarget) closeEditDataDialog();
|
|
472
482
|
}}
|
|
473
483
|
>
|
|
474
484
|
<div
|
|
@@ -13,6 +13,7 @@ import { useCallback, useMemo, useRef, useState } from 'react';
|
|
|
13
13
|
import { useNavigate } from 'react-router-dom';
|
|
14
14
|
import { useClickOutside, useDialogState, useErrorModal } from '../../hooks/index.js';
|
|
15
15
|
import type { Fragment } from '../../types.js';
|
|
16
|
+
import { ApplyClashError } from '../../utils/apply-clash.js';
|
|
16
17
|
import { cn } from '../../utils/cn.js';
|
|
17
18
|
import { contentFailureMessage, isStaleWrite } from '../../utils/content-failure.js';
|
|
18
19
|
import { editableEntryMeta, entryMetaPatch } from '../../utils/entry-meta.js';
|
|
@@ -303,6 +304,12 @@ export function FragmentList() {
|
|
|
303
304
|
etag: propertiesDialog.etag,
|
|
304
305
|
});
|
|
305
306
|
|
|
307
|
+
const clash = result.success ? undefined : result.conflictDetails?.conflicts;
|
|
308
|
+
if (clash && clash.length > 0) {
|
|
309
|
+
// The dialog stays open with the other values loaded; the next Save sends against the page as it is now.
|
|
310
|
+
if (result.currentEtag) openPropertiesDialog({ ...propertiesDialog, etag: result.currentEtag });
|
|
311
|
+
throw new ApplyClashError(clash, result.conflictDetails?.changedBy);
|
|
312
|
+
}
|
|
306
313
|
closePropertiesDialog();
|
|
307
314
|
|
|
308
315
|
if (!result.success) {
|
|
@@ -313,6 +320,7 @@ export function FragmentList() {
|
|
|
313
320
|
}
|
|
314
321
|
}
|
|
315
322
|
} catch (error) {
|
|
323
|
+
if (error instanceof ApplyClashError) throw error;
|
|
316
324
|
closePropertiesDialog();
|
|
317
325
|
showError('Failed to save properties. Please try again.', error);
|
|
318
326
|
}
|