@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
|
@@ -79,4 +79,12 @@ export function fieldsOfMetadata(metadata) {
|
|
|
79
79
|
export function fieldsOfHostSchema(schema) {
|
|
80
80
|
return fieldsOfMetadata(schema.metadata);
|
|
81
81
|
}
|
|
82
|
+
/** The label a form shows for field `name`: camelCase and snake_case in Title Case. */
|
|
83
|
+
export function formatFieldLabel(name) {
|
|
84
|
+
return name
|
|
85
|
+
.replace(/([A-Z])/g, ' $1')
|
|
86
|
+
.replace(/_/g, ' ')
|
|
87
|
+
.replace(/^\w/, (c) => c.toUpperCase())
|
|
88
|
+
.trim();
|
|
89
|
+
}
|
|
82
90
|
//# sourceMappingURL=schema-fields.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-fields.js","sourceRoot":"","sources":["../../../src/utils/schema-fields.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4C,qBAAqB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAmBlH,6FAA6F;AAC7F,SAAS,aAAa,CACpB,QAA4B,EAC5B,IAAgB;IAIhB,MAAM,QAAQ,GAAG,qBAAqB,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;IACvD,MAAM,WAAW,GAAG,IAAI,CAAC,WAAW,IAAI,QAAQ,EAAE,WAAW,CAAC;IAC9D,MAAM,IAAI,GAAG,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC;IAC9D,IAAI,CAAC,QAAQ;QAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC;IAErE,IAAI,OAAO,IAAI,QAAQ,EAAE,CAAC;QACxB,MAAM,OAAO,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,qBAAqB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC;QACxF,MAAM,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,MA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Q,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;IACvF,CAAC;IACD,gBAAgB,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IACvC,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,0FAA0F;AAC1F,MAAM,UAAU,kBAAkB,CAAC,MAAkB;IACnD,OAAO,gBAAgB,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;AAC3C,CAAC;AAED,uFAAuF;AACvF,MAAM,UAAU,gBAAgB,CAAC,IAAY;IAC3C,OAAO,IAAI;SACR,OAAO,CAAC,UAAU,EAAE,KAAK,CAAC;SAC1B,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC;SAClB,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;SACtC,IAAI,EAAE,CAAC;AACZ,CAAC"}
|
|
@@ -17,6 +17,8 @@ export declare class ContentWriteRefusedError extends Error {
|
|
|
17
17
|
readonly refusal: EditorWriteRefusal;
|
|
18
18
|
constructor(method: string, refusal: EditorWriteRefusal);
|
|
19
19
|
}
|
|
20
|
+
/** Access wrappers preserve the backend client's request lifetime without merging unrelated clients. */
|
|
21
|
+
export declare function contentWriteOwner(client: ContentAPIClient): ContentAPIClient;
|
|
20
22
|
/**
|
|
21
23
|
* What the editor may do to content right now.
|
|
22
24
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"write-access.d.ts","sourceRoot":"","sources":["../../src/write-access.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAE,KAAK,iBAAiB,EAAE,KAAK,kBAAkB,EAAe,KAAK,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE7G,qEAAqE;AACrE,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"write-access.d.ts","sourceRoot":"","sources":["../../src/write-access.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAE,KAAK,iBAAiB,EAAE,KAAK,kBAAkB,EAAe,KAAK,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE7G,qEAAqE;AACrE,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,OAAO,CAAC;AA2DnD,wFAAwF;AACxF,eAAO,MAAM,6BAA6B,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAyB,CAAC;AAElH;;;;;;GAMG;AACH,qBAAa,wBAAyB,SAAQ,KAAK;IACjD,yDAAyD;IACzD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,kBAAkB,CAAC;IAErC,YAAY,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,kBAAkB,EAKtD;CACF;AAKD,wGAAwG;AACxG,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,gBAAgB,GAAG,gBAAgB,CAE5E;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,GAAE,QAAwB,GAAG,iBAAiB,CAGrF;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,gBAAgB,GAAG,gBAAgB,CA2B7E"}
|
package/dist/ts/write-access.js
CHANGED
|
@@ -11,15 +11,15 @@ import { getUIConfig } from './ui-config.js';
|
|
|
11
11
|
* Removed client methods must also be removed from this classification;
|
|
12
12
|
* browser-side helpers are not part of the content API's access boundary.
|
|
13
13
|
*
|
|
14
|
-
* `compileMDX` is a POST and still a read: it renders a preview of content
|
|
15
|
-
* the caller already holds and persists nothing.
|
|
16
|
-
*
|
|
17
14
|
* `pullChanges` is a write. It rewrites the workspace tree from the remote;
|
|
18
15
|
* that it destroys rather than creates does not make it an observation.
|
|
19
16
|
*/
|
|
20
17
|
const CONTENT_METHOD_ACCESS = {
|
|
21
18
|
getContent: 'read',
|
|
22
19
|
getLocalized: 'read',
|
|
20
|
+
getClobbered: 'read',
|
|
21
|
+
// Dismissing deletes the record of a clobbered save.
|
|
22
|
+
dismissClobbered: 'write',
|
|
23
23
|
createContent: 'write',
|
|
24
24
|
updateLocalized: 'write',
|
|
25
25
|
deleteContent: 'write',
|
|
@@ -30,7 +30,6 @@ const CONTENT_METHOD_ACCESS = {
|
|
|
30
30
|
movePage: 'write',
|
|
31
31
|
getFragments: 'read',
|
|
32
32
|
getFragmentByName: 'read',
|
|
33
|
-
compileMDX: 'read',
|
|
34
33
|
getData: 'read',
|
|
35
34
|
getDataByName: 'read',
|
|
36
35
|
isDataNameAvailable: 'read',
|
|
@@ -77,6 +76,11 @@ export class ContentWriteRefusedError extends Error {
|
|
|
77
76
|
}
|
|
78
77
|
}
|
|
79
78
|
const WRITABLE = Object.freeze({ writable: true });
|
|
79
|
+
const writeOwners = new WeakMap();
|
|
80
|
+
/** Access wrappers preserve the backend client's request lifetime without merging unrelated clients. */
|
|
81
|
+
export function contentWriteOwner(client) {
|
|
82
|
+
return writeOwners.get(client) ?? client;
|
|
83
|
+
}
|
|
80
84
|
/**
|
|
81
85
|
* What the editor may do to content right now.
|
|
82
86
|
*
|
|
@@ -135,6 +139,7 @@ export function guardContentWrites(client) {
|
|
|
135
139
|
configurable: false,
|
|
136
140
|
});
|
|
137
141
|
}
|
|
142
|
+
writeOwners.set(guarded, contentWriteOwner(client));
|
|
138
143
|
return guarded;
|
|
139
144
|
}
|
|
140
145
|
//# sourceMappingURL=write-access.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"write-access.js","sourceRoot":"","sources":["../../src/write-access.ts"],"names":[],"mappings":"AACA,OAAO,EAAmD,WAAW,EAAiB,MAAM,gBAAgB,CAAC;AAK7G
|
|
1
|
+
{"version":3,"file":"write-access.js","sourceRoot":"","sources":["../../src/write-access.ts"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QACpE,0DAA0D;QAC1D,gEAAgE;QAChE,gBAAgB;QAChB,IAAI,OAAO,QAAQ,KAAK,UAAU;YAAE,SAAS;QAC7C,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE;YACrC,KAAK,EAAE,CAAC,GAAG,IAAe,EAAW,EAAE;gBACrC,MAAM,MAAM,GAAG,iBAAiB,EAAE,CAAC;gBACnC,IAAI,MAAM,CAAC,QAAQ;oBAAE,OAAO,QAAQ,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;gBACzD,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,wBAAwB,CAAC,MAAM,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;YAC9E,CAAC;YACD,QAAQ,EAAE,KAAK;YACf,UAAU,EAAE,KAAK;YACjB,YAAY,EAAE,KAAK;SACpB,CAAC,CAAC;IACL,CAAC;IACD,WAAW,CAAC,GAAG,CAAC,OAAO,EAAE,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAAC;IACpD,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@conloca/cms-spa",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -65,6 +65,11 @@
|
|
|
65
65
|
"import": "./dist/ts/puck-config.js",
|
|
66
66
|
"default": "./dist/ts/puck-config.js"
|
|
67
67
|
},
|
|
68
|
+
"./site-render": {
|
|
69
|
+
"types": "./dist/ts/site-render.d.ts",
|
|
70
|
+
"import": "./dist/ts/site-render.js",
|
|
71
|
+
"default": "./dist/ts/site-render.js"
|
|
72
|
+
},
|
|
68
73
|
"./site-styles": {
|
|
69
74
|
"types": "./dist/ts/site-styles.d.ts",
|
|
70
75
|
"import": "./dist/ts/site-styles.js",
|
|
@@ -125,6 +130,7 @@
|
|
|
125
130
|
"src",
|
|
126
131
|
"!src/**/*.test.*",
|
|
127
132
|
"!src/**/*.stories.*",
|
|
133
|
+
"!src/**/__fixtures__/**",
|
|
128
134
|
"styles",
|
|
129
135
|
"!**/*.tsbuildinfo"
|
|
130
136
|
],
|
|
@@ -134,9 +140,11 @@
|
|
|
134
140
|
"test": "nx run cms-spa:test --outputStyle=stream"
|
|
135
141
|
},
|
|
136
142
|
"dependencies": {
|
|
137
|
-
"@conloca/content-api
|
|
138
|
-
"@conloca/
|
|
143
|
+
"@conloca/content-api": "0.3.0",
|
|
144
|
+
"@conloca/content-api-client": "0.3.0",
|
|
145
|
+
"@conloca/mdx": "0.3.0",
|
|
139
146
|
"@lexical/react": "^0.48.0",
|
|
147
|
+
"@lexical/rich-text": "^0.48.0",
|
|
140
148
|
"@mdxeditor/editor": "^4.2.3",
|
|
141
149
|
"@puckeditor/core": "^0.23.0",
|
|
142
150
|
"@radix-ui/react-dialog": "^1.1.23",
|
|
@@ -147,15 +155,16 @@
|
|
|
147
155
|
"@types/mdast": "^4.0.4",
|
|
148
156
|
"@typia/interface": "^14.0.5",
|
|
149
157
|
"clsx": "^2.1.1",
|
|
158
|
+
"diff": "^9.0.0",
|
|
150
159
|
"dompurify": "^3.4.17",
|
|
151
160
|
"lexical": "^0.48.0",
|
|
152
161
|
"lucide-react": "^0.564.0",
|
|
153
|
-
"mdast-util-from-markdown": "^2.0.3",
|
|
154
162
|
"mdast-util-mdx-jsx": "^3.2.0",
|
|
155
163
|
"react-router-dom": "^7.18.3",
|
|
156
164
|
"sonner": "^2.0.8",
|
|
157
165
|
"tailwind-merge": "^3.6.0",
|
|
158
|
-
"tslib": "^2.8.1"
|
|
166
|
+
"tslib": "^2.8.1",
|
|
167
|
+
"yjs": "^13.6.32"
|
|
159
168
|
},
|
|
160
169
|
"peerDependencies": {
|
|
161
170
|
"react": "^19.0.0",
|
|
@@ -248,7 +257,8 @@
|
|
|
248
257
|
"default",
|
|
249
258
|
"^production",
|
|
250
259
|
"{workspaceRoot}/package.json",
|
|
251
|
-
"{workspaceRoot}/bun.lock"
|
|
260
|
+
"{workspaceRoot}/bun.lock",
|
|
261
|
+
"{workspaceRoot}/packages/mdx/src/__tests__/fixtures/**"
|
|
252
262
|
],
|
|
253
263
|
"outputs": [
|
|
254
264
|
"{workspaceRoot}/dist/storybook/cms-spa"
|
|
@@ -266,7 +276,8 @@
|
|
|
266
276
|
"parallelism": false,
|
|
267
277
|
"inputs": [
|
|
268
278
|
"default",
|
|
269
|
-
"^production"
|
|
279
|
+
"^production",
|
|
280
|
+
"{workspaceRoot}/packages/mdx/src/__tests__/fixtures/**"
|
|
270
281
|
],
|
|
271
282
|
"dependsOn": [
|
|
272
283
|
"^build",
|
package/src/CmsSpaApp.tsx
CHANGED
|
@@ -6,22 +6,33 @@ import App from './App.js';
|
|
|
6
6
|
import { clearMediaCache } from './frame/media-cache.js';
|
|
7
7
|
import { CanvasThemeProvider } from './hooks/useCanvasTheme.js';
|
|
8
8
|
import { ThemeProvider } from './hooks/useTheme.js';
|
|
9
|
-
import { getUIConfig } from './ui-config.js';
|
|
9
|
+
import { getUIConfig, type UIConfig } from './ui-config.js';
|
|
10
10
|
import { guardContentWrites } from './write-access.js';
|
|
11
11
|
|
|
12
|
+
const defaultClients = new WeakMap<UIConfig, { baseUrl: string | undefined; client: ContentAPIClient }>();
|
|
13
|
+
|
|
14
|
+
/** A same-workspace host remount replaces the query cache, but must retain the owner of outstanding writes. */
|
|
15
|
+
function contentClientFor(config: UIConfig): ContentAPIClient {
|
|
16
|
+
if (config.contentClient) return config.contentClient;
|
|
17
|
+
const existing = defaultClients.get(config);
|
|
18
|
+
if (existing && existing.baseUrl === config.apiBaseUrl) return existing.client;
|
|
19
|
+
const client = new ContentAPIClient({ baseUrl: config.apiBaseUrl });
|
|
20
|
+
defaultClients.set(config, { baseUrl: config.apiBaseUrl, client });
|
|
21
|
+
return client;
|
|
22
|
+
}
|
|
23
|
+
|
|
12
24
|
/**
|
|
13
25
|
* The full cms-spa editor as a React component.
|
|
14
26
|
*
|
|
15
27
|
* Reads the current `UIConfig` via `getUIConfig` — callers MUST call
|
|
16
|
-
* `configureUI` before rendering this component.
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
* while single-mount consumers (e.g. astro-cms's `/__cms` route)
|
|
21
|
-
* keep the same instances for the lifetime of the page.
|
|
28
|
+
* `configureUI` before rendering this component. Each mount owns its query
|
|
29
|
+
* cache. Default content clients belong to the exact installed config, so a
|
|
30
|
+
* same-workspace remount can await earlier writes while a new configuration
|
|
31
|
+
* gets a separate client. A supplied content client keeps its own identity.
|
|
22
32
|
*/
|
|
23
33
|
export function CmsSpaApp() {
|
|
24
34
|
const config = getUIConfig();
|
|
35
|
+
const contentClient = contentClientFor(config);
|
|
25
36
|
|
|
26
37
|
const queryClient = useMemo(() => new QueryClient(config.queryClientOptions), [config.queryClientOptions]);
|
|
27
38
|
|
|
@@ -49,10 +60,8 @@ export function CmsSpaApp() {
|
|
|
49
60
|
// is gated whether or not its author knew the seam existed. Reads are
|
|
50
61
|
// untouched — a read-only editor still renders all of its content.
|
|
51
62
|
useMemo(() => {
|
|
52
|
-
setContentAPIClient(
|
|
53
|
-
|
|
54
|
-
);
|
|
55
|
-
}, [config.apiBaseUrl, config.contentClient]);
|
|
63
|
+
setContentAPIClient(guardContentWrites(contentClient));
|
|
64
|
+
}, [contentClient]);
|
|
56
65
|
|
|
57
66
|
return (
|
|
58
67
|
<QueryClientProvider client={queryClient}>
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { isRecord } from '@conloca/content-api/component-vocabulary';
|
|
2
|
+
import type { Config } from '@puckeditor/core';
|
|
3
|
+
import { useState } from 'react';
|
|
4
|
+
import type { PageRef } from '../../draft-tools.js';
|
|
5
|
+
import type { LiveMessage } from '../../live/messages.js';
|
|
6
|
+
import { type DocEditValue, useDocEdit, useDocRead, useLiveMessage } from '../../live/use-live.js';
|
|
7
|
+
import { cn } from '../../utils/cn.js';
|
|
8
|
+
import { type ConflictLabel, resolveConflictLabel } from './conflict-label.js';
|
|
9
|
+
import { FieldConflictList } from './FieldConflictList.js';
|
|
10
|
+
import { OverwriteNotice } from './OverwriteNotice.js';
|
|
11
|
+
import { conflictAge, conflictSource, draftToolsPage, samePage, usePageConflicts } from './use-page-conflicts.js';
|
|
12
|
+
|
|
13
|
+
type Overwritten = Extract<LiveMessage, { type: 'conloca:overwritten' }>;
|
|
14
|
+
|
|
15
|
+
export interface EditorNoticeStripProps {
|
|
16
|
+
page: PageRef;
|
|
17
|
+
/** The page's data as the editor holds it; labels resolve against it and `config` (Puck), else name the key. */
|
|
18
|
+
data?: unknown;
|
|
19
|
+
config?: Config;
|
|
20
|
+
/** The page's shared doc key, where `Restore yours` writes; without it there is nothing to restore into. */
|
|
21
|
+
docKey?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Set where the fields panel shows each block's pickers (Puck): the strip only counts them and links each field to its
|
|
24
|
+
* block. Without it the strip shows the full pickers itself.
|
|
25
|
+
*/
|
|
26
|
+
onSelect?: (anchor: string) => void;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const NO_COMPONENTS: Config = { components: {} };
|
|
30
|
+
|
|
31
|
+
const fieldName = (label: ConflictLabel) => `${label.field}${label.component === null ? '' : ` on ${label.component}`}`;
|
|
32
|
+
|
|
33
|
+
/** A rich-text value is overwritten whole (`…props.body`), but its field is `…props.body.value`. */
|
|
34
|
+
export function overwriteFieldAnchor(message: Overwritten): string {
|
|
35
|
+
return isRecord(message.value) && 'value' in message.value ? `${message.anchor}.value` : message.anchor;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/** An overwrite notice, with the teammate's value the field held when it arrived. */
|
|
39
|
+
type OpenOverwrite = Overwritten & { seen: DocEditValue };
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* The page's open overwrite notices, one per anchor, newest kept; prose (`body#…`) merges and is never one. `read`
|
|
43
|
+
* records the field's value at notice time, so Restore can tell a newer change from the one announced.
|
|
44
|
+
*/
|
|
45
|
+
export function useOverwrites(page: PageRef, read: (anchor: string) => DocEditValue = () => undefined) {
|
|
46
|
+
const [notices, setNotices] = useState<OpenOverwrite[]>([]);
|
|
47
|
+
useLiveMessage('conloca:overwritten', (message) => {
|
|
48
|
+
if (!samePage(message, page) || message.anchor.startsWith('body#')) return;
|
|
49
|
+
const notice = { ...message, seen: read(message.anchor) };
|
|
50
|
+
setNotices((open) => [...open.filter((other) => other.anchor !== message.anchor), notice]);
|
|
51
|
+
});
|
|
52
|
+
const dismiss = (anchor: string) => setNotices((open) => open.filter((notice) => notice.anchor !== anchor));
|
|
53
|
+
return { notices, dismiss };
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/** Above the editor body: the page's field clashes still to decide and the values teammates replaced. */
|
|
57
|
+
export function EditorNoticeStrip({ page, data, config = NO_COMPONENTS, docKey, onSelect }: EditorNoticeStripProps) {
|
|
58
|
+
const { conflicts, pendingAnchor, goneAnchors, pick, error } = usePageConflicts(page);
|
|
59
|
+
const { notices, dismiss } = useOverwrites(page, useDocRead(docKey ?? ''));
|
|
60
|
+
const write = useDocEdit(docKey ?? '');
|
|
61
|
+
const [restoreError, setRestoreError] = useState<string | null>(null);
|
|
62
|
+
|
|
63
|
+
// Only over the value announced: a newer one (theirs or a third person's) is never replaced unseen.
|
|
64
|
+
const restore = (notice: OpenOverwrite) => {
|
|
65
|
+
const result = write(notice.anchor, notice.value, { value: notice.seen });
|
|
66
|
+
setRestoreError(result.ok ? null : result.message);
|
|
67
|
+
if (result.ok || result.reason === 'changed') dismiss(notice.anchor);
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
return (
|
|
71
|
+
<div className={cn('flex flex-col gap-2 px-4 empty:hidden', conflicts.length + notices.length > 0 && 'py-2')}>
|
|
72
|
+
{notices.map((notice) => (
|
|
73
|
+
<div key={notice.anchor} data-field-anchor={overwriteFieldAnchor(notice)}>
|
|
74
|
+
<OverwriteNotice
|
|
75
|
+
label={resolveConflictLabel(overwriteFieldAnchor(notice), data, config).field}
|
|
76
|
+
byName={notice.byName}
|
|
77
|
+
{...(docKey ? { onRestore: () => restore(notice) } : {})}
|
|
78
|
+
onDismiss={() => dismiss(notice.anchor)}
|
|
79
|
+
/>
|
|
80
|
+
</div>
|
|
81
|
+
))}
|
|
82
|
+
{restoreError ? (
|
|
83
|
+
<p role="alert" className={cn('text-sm text-red-04 dark:text-red-08')}>
|
|
84
|
+
{restoreError}
|
|
85
|
+
</p>
|
|
86
|
+
) : null}
|
|
87
|
+
{conflicts.length === 0 ? (
|
|
88
|
+
<p role="status" className="sr-only">
|
|
89
|
+
No fields need a decision
|
|
90
|
+
</p>
|
|
91
|
+
) : onSelect ? (
|
|
92
|
+
<nav aria-label="Fields that need a decision" className={cn('flex flex-wrap items-center gap-2 text-sm')}>
|
|
93
|
+
<p role="status" className={cn('font-medium')}>
|
|
94
|
+
{conflicts.length === 1 ? '1 field needs a decision' : `${conflicts.length} fields need a decision`}
|
|
95
|
+
</p>
|
|
96
|
+
{conflicts.map((conflict) => (
|
|
97
|
+
<button
|
|
98
|
+
key={conflict.anchor}
|
|
99
|
+
type="button"
|
|
100
|
+
className={cn('underline text-azure-04 dark:text-azure-08')}
|
|
101
|
+
onClick={() => onSelect(conflict.anchor)}
|
|
102
|
+
>
|
|
103
|
+
{fieldName(resolveConflictLabel(conflict.anchor, data, config))}
|
|
104
|
+
</button>
|
|
105
|
+
))}
|
|
106
|
+
</nav>
|
|
107
|
+
) : (
|
|
108
|
+
<FieldConflictList
|
|
109
|
+
conflicts={conflicts}
|
|
110
|
+
data={data}
|
|
111
|
+
config={config}
|
|
112
|
+
sourceLabel={conflictSource}
|
|
113
|
+
age={(conflict) => conflictAge(conflict)}
|
|
114
|
+
{...(pendingAnchor === undefined ? {} : { pendingAnchor })}
|
|
115
|
+
goneAnchors={goneAnchors}
|
|
116
|
+
onPick={(anchor, choice) => {
|
|
117
|
+
const conflict = conflicts.find((candidate) => candidate.anchor === anchor);
|
|
118
|
+
if (conflict) void pick(conflict, choice);
|
|
119
|
+
}}
|
|
120
|
+
/>
|
|
121
|
+
)}
|
|
122
|
+
{error && !onSelect ? (
|
|
123
|
+
<p role="alert" className={cn('text-sm text-red-04 dark:text-red-08')}>
|
|
124
|
+
{error.text}
|
|
125
|
+
</p>
|
|
126
|
+
) : null}
|
|
127
|
+
</div>
|
|
128
|
+
);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/** The strip for an editor without Puck's fields panel (MDX, fragments, data): the full pickers inline; nothing without draft tools. */
|
|
132
|
+
export function DraftNoticeStrip({ id, locale, docKey }: { id: string | undefined; locale: string; docKey?: string }) {
|
|
133
|
+
const page = draftToolsPage(id, locale);
|
|
134
|
+
return page ? <EditorNoticeStrip page={page} {...(docKey === undefined ? {} : { docKey })} /> : null;
|
|
135
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { FieldConflict } from '@conloca/content-api';
|
|
2
|
+
import type { Config } from '@puckeditor/core';
|
|
3
|
+
import { cn } from '../../utils/cn.js';
|
|
4
|
+
import { resolveConflictLabel } from './conflict-label.js';
|
|
5
|
+
import { type ConflictChoice, FieldConflictPicker } from './FieldConflictPicker.js';
|
|
6
|
+
|
|
7
|
+
export interface FieldConflictListProps<C extends FieldConflict = FieldConflict> {
|
|
8
|
+
conflicts: C[];
|
|
9
|
+
/** The page's data as the editor holds it; the labels resolve against it and `config`. */
|
|
10
|
+
data: unknown;
|
|
11
|
+
config: Config;
|
|
12
|
+
sourceLabel: (conflict: C) => string;
|
|
13
|
+
theirsBy?: (conflict: C) => string | undefined;
|
|
14
|
+
age?: (conflict: C) => string | undefined;
|
|
15
|
+
/** The anchor whose choice is being sent; only that picker waits. */
|
|
16
|
+
pendingAnchor?: string;
|
|
17
|
+
/** Anchors whose block was removed: their pickers offer only `Keep mine`. */
|
|
18
|
+
goneAnchors?: ReadonlySet<string>;
|
|
19
|
+
onPick: (anchor: string, choice: ConflictChoice) => void;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/** Every field on a page waiting for a decision, with a count screen readers announce as it changes. */
|
|
23
|
+
export function FieldConflictList<C extends FieldConflict>({
|
|
24
|
+
conflicts,
|
|
25
|
+
data,
|
|
26
|
+
config,
|
|
27
|
+
sourceLabel,
|
|
28
|
+
theirsBy,
|
|
29
|
+
age,
|
|
30
|
+
pendingAnchor,
|
|
31
|
+
goneAnchors,
|
|
32
|
+
onPick,
|
|
33
|
+
}: FieldConflictListProps<C>) {
|
|
34
|
+
const count = conflicts.length;
|
|
35
|
+
return (
|
|
36
|
+
<section className={cn('flex flex-col gap-3')}>
|
|
37
|
+
<p role="status" className={cn('text-sm font-medium')}>
|
|
38
|
+
{count === 1 ? '1 field needs a decision' : `${count} fields need a decision`}
|
|
39
|
+
</p>
|
|
40
|
+
{conflicts.map((conflict) => {
|
|
41
|
+
const by = theirsBy?.(conflict);
|
|
42
|
+
const ago = age?.(conflict);
|
|
43
|
+
return (
|
|
44
|
+
<FieldConflictPicker
|
|
45
|
+
key={conflict.anchor}
|
|
46
|
+
conflict={conflict}
|
|
47
|
+
label={resolveConflictLabel(conflict.anchor, data, config)}
|
|
48
|
+
sourceLabel={sourceLabel(conflict)}
|
|
49
|
+
{...(by === undefined ? {} : { theirsBy: by })}
|
|
50
|
+
{...(ago === undefined ? {} : { age: ago })}
|
|
51
|
+
pending={pendingAnchor === conflict.anchor}
|
|
52
|
+
mineOnly={goneAnchors?.has(conflict.anchor) ?? false}
|
|
53
|
+
onPick={(choice) => onPick(conflict.anchor, choice)}
|
|
54
|
+
/>
|
|
55
|
+
);
|
|
56
|
+
})}
|
|
57
|
+
</section>
|
|
58
|
+
);
|
|
59
|
+
}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import type { FieldConflict, JsonValue } from '@conloca/content-api';
|
|
2
|
+
import { type KeyboardEvent, useId, useRef, useState } from 'react';
|
|
3
|
+
import { cn } from '../../utils/cn.js';
|
|
4
|
+
import { Button } from '../ui/Button.js';
|
|
5
|
+
import { Input } from '../ui/Input.js';
|
|
6
|
+
import type { ConflictLabel } from './conflict-label.js';
|
|
7
|
+
|
|
8
|
+
/** What a person decided: keep their value, take the other one, or settle on a value they typed. */
|
|
9
|
+
export type ConflictChoice = 'mine' | 'theirs' | { kind: 'value'; value: JsonValue };
|
|
10
|
+
|
|
11
|
+
export interface FieldConflictPickerProps {
|
|
12
|
+
conflict: FieldConflict;
|
|
13
|
+
label: ConflictLabel;
|
|
14
|
+
/** Where the other value came from, for example `from GitHub`. */
|
|
15
|
+
sourceLabel: string;
|
|
16
|
+
/** Who wrote the other value; without it the other value is "theirs". */
|
|
17
|
+
theirsBy?: string;
|
|
18
|
+
/** How long ago the other value arrived, for example `2 hours ago`. */
|
|
19
|
+
age?: string;
|
|
20
|
+
/** A choice is being sent: every button is disabled until it settles. */
|
|
21
|
+
pending?: boolean;
|
|
22
|
+
/** The field's block was removed: only `Keep mine` can settle it. */
|
|
23
|
+
mineOnly?: boolean;
|
|
24
|
+
onPick: (choice: ConflictChoice) => void;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/** The string leaves of a value, in order. */
|
|
28
|
+
function leaves(value: JsonValue): string[] {
|
|
29
|
+
if (value === null) return [];
|
|
30
|
+
if (Array.isArray(value)) return value.flatMap(leaves);
|
|
31
|
+
if (typeof value === 'object') return Object.values(value).flatMap(leaves);
|
|
32
|
+
return [String(value)];
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** One value as a person reads it: text, a list of its items, or an object's text joined with `·`; never JSON. */
|
|
36
|
+
function ConflictValue({ value }: { value: JsonValue | undefined }) {
|
|
37
|
+
if (value === undefined) return <span className="italic">(deleted)</span>;
|
|
38
|
+
if (leaves(value).join('') === '') return <span className="italic">(empty)</span>;
|
|
39
|
+
if (Array.isArray(value)) {
|
|
40
|
+
return (
|
|
41
|
+
<ul className={cn('list-disc pl-5')}>
|
|
42
|
+
{value.map((item, index) => (
|
|
43
|
+
// Items of an id-less list have nothing steadier than their place.
|
|
44
|
+
// biome-ignore lint/suspicious/noArrayIndexKey: the list is read-only and never reordered here.
|
|
45
|
+
<li key={index} className={cn('line-clamp-3')}>
|
|
46
|
+
{leaves(item).join(' · ')}
|
|
47
|
+
</li>
|
|
48
|
+
))}
|
|
49
|
+
</ul>
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
return <span className={cn('line-clamp-3')}>{leaves(value).join(' · ')}</span>;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* One field two people changed differently. The person keeps theirs, takes the other value or types a new one; nothing
|
|
57
|
+
* settles before they choose. A file a git rule keeps back has no choice here: a developer has to change the setting.
|
|
58
|
+
*/
|
|
59
|
+
export function FieldConflictPicker({
|
|
60
|
+
conflict,
|
|
61
|
+
label,
|
|
62
|
+
sourceLabel,
|
|
63
|
+
theirsBy,
|
|
64
|
+
age,
|
|
65
|
+
pending = false,
|
|
66
|
+
mineOnly = false,
|
|
67
|
+
onPick,
|
|
68
|
+
}: FieldConflictPickerProps) {
|
|
69
|
+
const [draft, setDraft] = useState<string | null>(null);
|
|
70
|
+
const editButton = useRef<HTMLButtonElement>(null);
|
|
71
|
+
const inputId = useId();
|
|
72
|
+
const name = `${label.field}${label.component === null ? '' : ` on ${label.component}`}, ${sourceLabel}`;
|
|
73
|
+
const theirs = conflict.theirs;
|
|
74
|
+
const theirsName = theirsBy === undefined ? 'Their value:' : `${theirsBy}'s value:`;
|
|
75
|
+
|
|
76
|
+
const closeEdit = () => {
|
|
77
|
+
setDraft(null);
|
|
78
|
+
// The box takes focus with it when it closes; hand it back to the button that opened it.
|
|
79
|
+
requestAnimationFrame(() => editButton.current?.focus());
|
|
80
|
+
};
|
|
81
|
+
const onEditKey = (event: KeyboardEvent<HTMLInputElement>) => {
|
|
82
|
+
if (event.key !== 'Escape') return;
|
|
83
|
+
event.preventDefault();
|
|
84
|
+
event.stopPropagation();
|
|
85
|
+
closeEdit();
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
return (
|
|
89
|
+
<fieldset
|
|
90
|
+
aria-label={name}
|
|
91
|
+
aria-busy={pending ? 'true' : undefined}
|
|
92
|
+
className={cn('flex flex-col gap-2 rounded-md border border-line bg-panel p-3 text-sm')}
|
|
93
|
+
>
|
|
94
|
+
<p className={cn('font-medium text-grey-01 dark:text-grey-12')}>
|
|
95
|
+
{name}
|
|
96
|
+
{age === undefined ? null : (
|
|
97
|
+
<span className={cn('ml-1 font-normal text-grey-04 dark:text-grey-07')}>{age}</span>
|
|
98
|
+
)}
|
|
99
|
+
</p>
|
|
100
|
+
{conflict.anchor.startsWith('lfs:') ? (
|
|
101
|
+
<p>Ask your developer: this file needs a git setting before it can ship.</p>
|
|
102
|
+
) : (
|
|
103
|
+
<>
|
|
104
|
+
<div>
|
|
105
|
+
<span className={cn('font-medium')}>Your value:</span> <ConflictValue value={conflict.ours} />
|
|
106
|
+
</div>
|
|
107
|
+
<div>
|
|
108
|
+
<span className={cn('font-medium')}>{theirsName}</span> <ConflictValue value={theirs} />
|
|
109
|
+
</div>
|
|
110
|
+
{draft === null ? (
|
|
111
|
+
<div className={cn('flex flex-wrap gap-2')}>
|
|
112
|
+
<Button size="sm" variant="outline" disabled={pending} onClick={() => onPick('mine')}>
|
|
113
|
+
Keep mine
|
|
114
|
+
</Button>
|
|
115
|
+
<Button size="sm" variant="outline" disabled={pending || mineOnly} onClick={() => onPick('theirs')}>
|
|
116
|
+
{theirsBy === undefined ? 'Use theirs' : `Use ${theirsBy}'s`}
|
|
117
|
+
</Button>
|
|
118
|
+
{typeof theirs === 'string' ? (
|
|
119
|
+
<Button
|
|
120
|
+
ref={editButton}
|
|
121
|
+
size="sm"
|
|
122
|
+
variant="ghost"
|
|
123
|
+
disabled={pending || mineOnly}
|
|
124
|
+
onClick={() => setDraft(theirs)}
|
|
125
|
+
>
|
|
126
|
+
Edit
|
|
127
|
+
</Button>
|
|
128
|
+
) : null}
|
|
129
|
+
</div>
|
|
130
|
+
) : (
|
|
131
|
+
<div className={cn('flex flex-col gap-2')}>
|
|
132
|
+
<label htmlFor={inputId} className={cn('font-medium')}>
|
|
133
|
+
New value for {label.field}
|
|
134
|
+
</label>
|
|
135
|
+
<Input
|
|
136
|
+
id={inputId}
|
|
137
|
+
size="sm"
|
|
138
|
+
value={draft}
|
|
139
|
+
autoFocus
|
|
140
|
+
disabled={pending}
|
|
141
|
+
onChange={(event) => setDraft(event.target.value)}
|
|
142
|
+
onKeyDown={onEditKey}
|
|
143
|
+
/>
|
|
144
|
+
<div className={cn('flex gap-2')}>
|
|
145
|
+
<Button size="sm" disabled={pending} onClick={() => onPick({ kind: 'value', value: draft })}>
|
|
146
|
+
Save value
|
|
147
|
+
</Button>
|
|
148
|
+
<Button size="sm" variant="ghost" disabled={pending} onClick={closeEdit}>
|
|
149
|
+
Cancel
|
|
150
|
+
</Button>
|
|
151
|
+
</div>
|
|
152
|
+
</div>
|
|
153
|
+
)}
|
|
154
|
+
</>
|
|
155
|
+
)}
|
|
156
|
+
</fieldset>
|
|
157
|
+
);
|
|
158
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { cn } from '../../utils/cn.js';
|
|
2
|
+
import { Button } from '../ui/Button.js';
|
|
3
|
+
|
|
4
|
+
export interface OverwriteNoticeProps {
|
|
5
|
+
/** The field as a person reads it, for example `Hero title`. */
|
|
6
|
+
label: string;
|
|
7
|
+
byName: string;
|
|
8
|
+
/** Absent: there is no open shared doc to write the value back into. */
|
|
9
|
+
onRestore?: () => void;
|
|
10
|
+
onDismiss: () => void;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/** A teammate replaced a value this person had written; it stays until they restore theirs or dismiss it. */
|
|
14
|
+
export function OverwriteNotice({ label, byName, onRestore, onDismiss }: OverwriteNoticeProps) {
|
|
15
|
+
return (
|
|
16
|
+
<div className={cn('flex flex-wrap items-center gap-2 rounded-md border border-line bg-panel p-3 text-sm')}>
|
|
17
|
+
<p role="status" className={cn('flex-1')}>
|
|
18
|
+
{byName} changed {label}.
|
|
19
|
+
</p>
|
|
20
|
+
{onRestore ? (
|
|
21
|
+
<Button size="sm" variant="outline" onClick={onRestore}>
|
|
22
|
+
Restore yours
|
|
23
|
+
</Button>
|
|
24
|
+
) : null}
|
|
25
|
+
<Button size="sm" variant="ghost" onClick={onDismiss}>
|
|
26
|
+
Dismiss
|
|
27
|
+
</Button>
|
|
28
|
+
</div>
|
|
29
|
+
);
|
|
30
|
+
}
|