@conloca/cms-spa 0.2.6 → 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
|
@@ -0,0 +1,467 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* Binds a Puck editor to its page's replica: the user's changes go into the doc keyed by block id, and changes made
|
|
4
|
+
* elsewhere (a teammate, a restore, undo) come back into Puck without entering its history.
|
|
5
|
+
*/
|
|
6
|
+
import { mergeContent } from '@conloca/content-api/merge';
|
|
7
|
+
import { applyContentDiff, applyItemChanges, readItemIds, serializeDoc } from '@conloca/content-api/ydoc';
|
|
8
|
+
import { createUsePuck, useGetPuck, } from '@puckeditor/core';
|
|
9
|
+
import { createContext, useContext, useEffect, useMemo } from 'react';
|
|
10
|
+
import { HELD_WRITE_FAILED, LOCAL_ORIGIN, useDocChannel } from './doc-channel.js';
|
|
11
|
+
import { createListUndo, interceptUndoKeys } from './undo.js';
|
|
12
|
+
import { usePresencePeers } from './use-live.js';
|
|
13
|
+
export function readPuckData(doc) {
|
|
14
|
+
return serializeDoc(doc).puckData;
|
|
15
|
+
}
|
|
16
|
+
const asFile = (puckData) => ({ type: 'puck', content: { puckData } });
|
|
17
|
+
/**
|
|
18
|
+
* Writes what changed from `shadow` (what Puck was showing, with `shadowIds`, the ids of its list items) to `data` (what
|
|
19
|
+
* it shows now) into the doc, over whatever the doc holds that Puck has not been shown yet, so a remote change is never
|
|
20
|
+
* reverted. Lists change item by item, by the ids the view showed; the rest is merged against the doc. Unchanged data
|
|
21
|
+
* writes nothing. Returns the ids of `data`'s items, the next write's `shadowIds`. `beforeWrite` gets the `a:` arrays
|
|
22
|
+
* the write touches, before it writes (undo scope). A throw writes nothing: `applyItemChanges` parses all of `data`
|
|
23
|
+
* (a non-JSON value) and checks the doc's kind and shape before its first write, and what follows merges only JSON
|
|
24
|
+
* it read back into a doc of that kind.
|
|
25
|
+
*/
|
|
26
|
+
export function writePuckChange(doc, shadow, shadowIds, data, beforeWrite) {
|
|
27
|
+
try {
|
|
28
|
+
let ids = shadowIds;
|
|
29
|
+
doc.transact(() => {
|
|
30
|
+
const written = applyItemChanges(doc, { puckData: shadow }, shadowIds, { puckData: data }, LOCAL_ORIGIN, beforeWrite);
|
|
31
|
+
ids = written.ids;
|
|
32
|
+
const merged = mergeContent({
|
|
33
|
+
kind: 'vxjson',
|
|
34
|
+
base: asFile(shadow),
|
|
35
|
+
ours: { type: 'puck', content: written.rest },
|
|
36
|
+
theirs: asFile(readPuckData(doc)),
|
|
37
|
+
}).value;
|
|
38
|
+
const content = typeof merged === 'object' && merged !== null && !Array.isArray(merged) ? merged.content : null;
|
|
39
|
+
const puckData = typeof content === 'object' && content !== null && !Array.isArray(content) ? content.puckData : null;
|
|
40
|
+
// Never reached for an object merge; a null would throw after the item write, a partial write.
|
|
41
|
+
if (typeof puckData !== 'object' || puckData === null || Array.isArray(puckData))
|
|
42
|
+
throw new Error('merge lost the data');
|
|
43
|
+
applyContentDiff(doc, { puckData }, LOCAL_ORIGIN);
|
|
44
|
+
}, LOCAL_ORIGIN);
|
|
45
|
+
return { ok: true, ids };
|
|
46
|
+
}
|
|
47
|
+
catch (error) {
|
|
48
|
+
return { ok: false, error: error instanceof Error ? error.message : String(error) };
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
/** The view of each held replica: its unwritten changes, which a remount must show again (the doc lacks them). */
|
|
52
|
+
const heldViews = new WeakMap();
|
|
53
|
+
/** An empty transaction under this origin makes the bridge re-seed Puck without writing anything. */
|
|
54
|
+
const RESHOW_ORIGIN = Symbol('live-puck-reshow');
|
|
55
|
+
/** The root's id among block ids; Puck itself calls it `root`. */
|
|
56
|
+
const ROOT_ID = '';
|
|
57
|
+
/** A slot's value: a non-empty list of blocks. */
|
|
58
|
+
function isBlockList(value) {
|
|
59
|
+
return (Array.isArray(value) &&
|
|
60
|
+
value.length > 0 &&
|
|
61
|
+
value.every((item) => typeof item?.type === 'string' && typeof item?.props?.id === 'string'));
|
|
62
|
+
}
|
|
63
|
+
/** `props` after `map`, then each block in its slots the same way, at every depth. */
|
|
64
|
+
function mapSlots(props, map) {
|
|
65
|
+
let out = null;
|
|
66
|
+
for (const [key, value] of Object.entries(props)) {
|
|
67
|
+
if (!isBlockList(value))
|
|
68
|
+
continue;
|
|
69
|
+
const next = value.map((block) => mapBlock(block, map));
|
|
70
|
+
if (!next.some((block, i) => block !== value[i]))
|
|
71
|
+
continue;
|
|
72
|
+
out ??= { ...props };
|
|
73
|
+
out[key] = next;
|
|
74
|
+
}
|
|
75
|
+
return out ?? props;
|
|
76
|
+
}
|
|
77
|
+
function mapBlock(block, map) {
|
|
78
|
+
const props = mapSlots(map(String(block.props.id), block.props), map);
|
|
79
|
+
return props === block.props ? block : { ...block, props };
|
|
80
|
+
}
|
|
81
|
+
/** `data` with `map` applied to the root's props and every block's, slot blocks included (the parent first). */
|
|
82
|
+
function mapData(data, map) {
|
|
83
|
+
const rootProps = data.root?.props ?? {};
|
|
84
|
+
const root = mapSlots(map(ROOT_ID, rootProps), map);
|
|
85
|
+
const content = data.content.map((block) => mapBlock(block, map));
|
|
86
|
+
return { ...data, root: { ...data.root, props: root }, content };
|
|
87
|
+
}
|
|
88
|
+
/** Every block's props by id, the root's under `ROOT_ID`, slot blocks included. */
|
|
89
|
+
function propsById(data) {
|
|
90
|
+
const byId = new Map();
|
|
91
|
+
mapData(data, (id, props) => {
|
|
92
|
+
byId.set(id, props);
|
|
93
|
+
return props;
|
|
94
|
+
});
|
|
95
|
+
return byId;
|
|
96
|
+
}
|
|
97
|
+
const same = (a, b) => JSON.stringify(a) === JSON.stringify(b);
|
|
98
|
+
function sameProps(a, b) {
|
|
99
|
+
return [...new Set([...Object.keys(a), ...Object.keys(b)])].every((key) => same(a[key], b[key]));
|
|
100
|
+
}
|
|
101
|
+
/** The keys whose values differ between `a` and `b`. */
|
|
102
|
+
function differing(a, b) {
|
|
103
|
+
return [...new Set([...Object.keys(a), ...Object.keys(b)])].filter((key) => !same(a[key], b[key]));
|
|
104
|
+
}
|
|
105
|
+
/** Block `id` among the slot children of `props`, at any depth. */
|
|
106
|
+
function childProps(props, id) {
|
|
107
|
+
for (const value of Object.values(props)) {
|
|
108
|
+
if (!isBlockList(value))
|
|
109
|
+
continue;
|
|
110
|
+
for (const block of value) {
|
|
111
|
+
if (block.props.id === id)
|
|
112
|
+
return block.props;
|
|
113
|
+
const inner = childProps(block.props, id);
|
|
114
|
+
if (inner)
|
|
115
|
+
return inner;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
return undefined;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* The block a field change's `replace` hands over, as it is to be written: what Puck shows now (the doc, re-seeded)
|
|
122
|
+
* plus the props resolveData derived. Puck builds that `replace` from the block as it was at the keystroke, so every
|
|
123
|
+
* other prop it carries is a stale copy, and a change re-seeded meanwhile (a teammate's) must not be written back
|
|
124
|
+
* over. The props the user set are not written again: they went into the doc at the keystroke, and a teammate may have
|
|
125
|
+
* changed them since.
|
|
126
|
+
*/
|
|
127
|
+
function narrowed(shown, resolve) {
|
|
128
|
+
const props = { ...shown };
|
|
129
|
+
for (const key of resolve.settled.derived) {
|
|
130
|
+
if (key in resolve.settled.props)
|
|
131
|
+
props[key] = resolve.settled.props[key];
|
|
132
|
+
else
|
|
133
|
+
Reflect.deleteProperty(props, key);
|
|
134
|
+
}
|
|
135
|
+
return props;
|
|
136
|
+
}
|
|
137
|
+
/** `next` with each block's and root's props Puck was shown kept under the doc's: resolved props the doc never stored. */
|
|
138
|
+
function keepShownProps(next, shown) {
|
|
139
|
+
const before = propsById(shown);
|
|
140
|
+
return mapData(next, (id, props) => ({ ...before.get(id), ...props }));
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* `data` with root in the shape Puck 0.23 holds it from its first state (`root.props || root`, without the id `root`
|
|
144
|
+
* that it and resolveAllData give root), so that reshape writes nothing.
|
|
145
|
+
*/
|
|
146
|
+
function withPuckRoot(data) {
|
|
147
|
+
const props = { ...(data.root.props ?? data.root) };
|
|
148
|
+
Reflect.deleteProperty(props, 'id');
|
|
149
|
+
return { ...data, root: { ...data.root, props } };
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* `shown` is what Puck was handed on load; `prepare` gives a re-seed the load's shape (default props). Resolved props
|
|
153
|
+
* the doc never stored stay from what Puck showed, under the doc's values.
|
|
154
|
+
*
|
|
155
|
+
* A field change's entry lives until Puck hands its block over (that and every older settled entry of the block go),
|
|
156
|
+
* its block leaves the doc, or its resolveData throws: never on a timer, since Puck hands the block over only once
|
|
157
|
+
* every slot child it resolves again has answered, however long their fetches take.
|
|
158
|
+
*/
|
|
159
|
+
export function createPuckBinding(live, shown = readPuckData(live.doc), prepare = (data) => data) {
|
|
160
|
+
const shape = (data) => withPuckRoot(prepare(data));
|
|
161
|
+
let shadow = heldViews.get(live) ?? withPuckRoot(shown);
|
|
162
|
+
/** The ids of `shadow`'s list items; lists the doc does not hold (resolved defaults) have none. */
|
|
163
|
+
let shadowIds = readItemIds(live.doc);
|
|
164
|
+
/**
|
|
165
|
+
* What waiting field changes wrote, with its ids, while Puck has handed nothing over since: the next keystroke's write
|
|
166
|
+
* base (`shadow` stays what Puck shows). Without it a second keystroke re-inserts the item the first one inserted.
|
|
167
|
+
*/
|
|
168
|
+
let typed = null;
|
|
169
|
+
/** Field changes waiting on resolveData, or settled and waiting for Puck to hand their block over. */
|
|
170
|
+
let resolves = [];
|
|
171
|
+
const keep = (kept) => {
|
|
172
|
+
resolves = resolves.filter(kept);
|
|
173
|
+
};
|
|
174
|
+
/** `data` with each settled field change's `replace` narrowed (and consumed); null when none was handed over. */
|
|
175
|
+
const narrowFieldChanges = (data) => {
|
|
176
|
+
const showing = propsById(shadow);
|
|
177
|
+
let changed = false;
|
|
178
|
+
const seen = new Set();
|
|
179
|
+
const next = mapData(data, (id, props) => {
|
|
180
|
+
seen.add(id);
|
|
181
|
+
const resolve = resolves.find((candidate) => candidate.id === id && candidate.settled !== null && sameProps(candidate.settled.props, props));
|
|
182
|
+
const current = showing.get(id);
|
|
183
|
+
if (!resolve || !current)
|
|
184
|
+
return props;
|
|
185
|
+
const at = resolves.indexOf(resolve);
|
|
186
|
+
// Older settled entries of the block go with it. Older pending ones stay: an older resolve that answers after
|
|
187
|
+
// this handover still brings a late replace, built from its own keystroke, and only its entry narrows it (an
|
|
188
|
+
// unmatched one would revert the teammate's values and the user's newer edit). Correctness over a tighter bound:
|
|
189
|
+
// only a resolveData that never answers keeps its entry for good, and Puck's own pending promise holds that call
|
|
190
|
+
// in memory anyway.
|
|
191
|
+
keep((other) => resolves.indexOf(other) > at || other.id !== id || other.settled === null);
|
|
192
|
+
const out = narrowed(current, resolve);
|
|
193
|
+
// A re-seed is needed only when Puck shows something other than what is written.
|
|
194
|
+
if (!sameProps(out, props))
|
|
195
|
+
changed = true;
|
|
196
|
+
return out;
|
|
197
|
+
});
|
|
198
|
+
// A block that is gone never comes back as a replace: its waiting changes go with it.
|
|
199
|
+
keep((resolve) => seen.has(resolve.id));
|
|
200
|
+
return changed ? next : null;
|
|
201
|
+
};
|
|
202
|
+
// Block props live in the doc-level `blocks` map: scoping `puck` alone would not undo them.
|
|
203
|
+
const listUndo = createListUndo(live.doc, ['puck', 'blocks']);
|
|
204
|
+
/** Writes `data` over what Puck showed (`before`, with its ids); returns `data`'s ids, or null when it held. */
|
|
205
|
+
const write = (before, beforeIds, data) => {
|
|
206
|
+
if (live.held)
|
|
207
|
+
return null;
|
|
208
|
+
const written = writePuckChange(live.doc, before, beforeIds, data, (names) => listUndo.track(names));
|
|
209
|
+
if (written.ok)
|
|
210
|
+
return written.ids;
|
|
211
|
+
console.error('[live] could not write a Puck change', written.error);
|
|
212
|
+
live.hold(HELD_WRITE_FAILED);
|
|
213
|
+
return null;
|
|
214
|
+
};
|
|
215
|
+
return {
|
|
216
|
+
live,
|
|
217
|
+
get undo() {
|
|
218
|
+
return listUndo.undo;
|
|
219
|
+
},
|
|
220
|
+
retain: () => listUndo.retain(),
|
|
221
|
+
get shadow() {
|
|
222
|
+
return shadow;
|
|
223
|
+
},
|
|
224
|
+
change(handed) {
|
|
225
|
+
const fixed = narrowFieldChanges(handed);
|
|
226
|
+
const wasTyped = typed !== null;
|
|
227
|
+
typed = null;
|
|
228
|
+
const before = shadow;
|
|
229
|
+
// What Puck shows, stale copies of a late replace included: a change built on it before the re-seed lands
|
|
230
|
+
// differs from it only in what the user did.
|
|
231
|
+
shadow = handed;
|
|
232
|
+
const ids = write(before, shadowIds, fixed ?? handed);
|
|
233
|
+
if (ids) {
|
|
234
|
+
shadowIds = ids;
|
|
235
|
+
// Another block's change lacks the keystrokes a waiting resolve wrote; the doc holds them, so it is the next
|
|
236
|
+
// keystroke's base (as a re-seed's), or that keystroke inserts again what they inserted.
|
|
237
|
+
if (wasTyped && resolves.length > 0)
|
|
238
|
+
typed = { data: shape(keepShownProps(readPuckData(live.doc), handed)), ids: readItemIds(live.doc) };
|
|
239
|
+
// Puck still shows the stale copies: a re-seed shows it the doc again.
|
|
240
|
+
if (fixed)
|
|
241
|
+
live.doc.transact(() => { }, RESHOW_ORIGIN);
|
|
242
|
+
return;
|
|
243
|
+
}
|
|
244
|
+
heldViews.set(live, handed);
|
|
245
|
+
},
|
|
246
|
+
reseed() {
|
|
247
|
+
if (live.held)
|
|
248
|
+
return null;
|
|
249
|
+
const next = shape(keepShownProps(readPuckData(live.doc), shadow));
|
|
250
|
+
shadow = next;
|
|
251
|
+
typed = null;
|
|
252
|
+
shadowIds = readItemIds(live.doc);
|
|
253
|
+
return shadow;
|
|
254
|
+
},
|
|
255
|
+
fieldResolveStarted(id, props, parentId) {
|
|
256
|
+
// Puck resolves a slot child again during its parent's update, with the child as the parent held it at the
|
|
257
|
+
// keystroke: not the user's change, and the parent's late replace takes the children from what Puck shows.
|
|
258
|
+
const parent = parentId === undefined ? undefined : resolves.find((other) => other.id === parentId && other.settled);
|
|
259
|
+
const held = parent?.settled ? childProps(parent.settled.props, id) : undefined;
|
|
260
|
+
if (held && sameProps(held, props))
|
|
261
|
+
return () => { };
|
|
262
|
+
const before = propsById(shadow).get(id) ?? {};
|
|
263
|
+
const keys = differing(props, before);
|
|
264
|
+
// Written now, over what Puck showed at the keystroke (and the keystrokes before it Puck has not handed over):
|
|
265
|
+
// whatever its delayed replace carries, the edit is in.
|
|
266
|
+
const base = typed ?? { data: shadow, ids: shadowIds };
|
|
267
|
+
const data = mapData(base.data, (block, own) => (block === id ? props : own));
|
|
268
|
+
const ids = write(base.data, base.ids, data);
|
|
269
|
+
if (ids)
|
|
270
|
+
typed = { data, ids };
|
|
271
|
+
const resolve = { id, wrote: { before, props, keys }, settled: null };
|
|
272
|
+
// Kept until Puck hands its block over, its resolveData throws, or its block goes: a late replace that finds no
|
|
273
|
+
// entry would write its stale copies back.
|
|
274
|
+
resolves = [...resolves, resolve];
|
|
275
|
+
return (resolved) => {
|
|
276
|
+
if (resolved === null) {
|
|
277
|
+
keep((other) => other !== resolve);
|
|
278
|
+
takeBack(resolve);
|
|
279
|
+
return;
|
|
280
|
+
}
|
|
281
|
+
const settledProps = { ...props, ...resolved };
|
|
282
|
+
resolve.settled = { props: settledProps, derived: differing(settledProps, props) };
|
|
283
|
+
};
|
|
284
|
+
},
|
|
285
|
+
fieldResolvesWaiting: () => resolves.length,
|
|
286
|
+
};
|
|
287
|
+
/**
|
|
288
|
+
* Puck applies nothing when resolveData throws (the field shows the typing until it loses focus): take back what
|
|
289
|
+
* the keystroke wrote, where no one changed it since.
|
|
290
|
+
*/
|
|
291
|
+
function takeBack(resolve) {
|
|
292
|
+
const { before, props, keys } = resolve.wrote;
|
|
293
|
+
const doc = readPuckData(live.doc);
|
|
294
|
+
const now = propsById(doc).get(resolve.id);
|
|
295
|
+
if (!now)
|
|
296
|
+
return;
|
|
297
|
+
const restored = { ...now };
|
|
298
|
+
for (const key of keys) {
|
|
299
|
+
if (!same(now[key], props[key]))
|
|
300
|
+
continue;
|
|
301
|
+
if (key in before)
|
|
302
|
+
restored[key] = before[key];
|
|
303
|
+
else
|
|
304
|
+
Reflect.deleteProperty(restored, key);
|
|
305
|
+
}
|
|
306
|
+
write(doc, readItemIds(live.doc), mapData(doc, (block, own) => (block === resolve.id ? restored : own)));
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
/**
|
|
310
|
+
* `config` with every resolveData reporting the field changes that run it (trigger `replace`) to the binding, at the
|
|
311
|
+
* keystroke and once it answers; every other trigger (load, insert, move, force) is passed through untouched.
|
|
312
|
+
*/
|
|
313
|
+
export function trackFieldResolves(config, binding) {
|
|
314
|
+
// Synchronous with the keystroke: Puck calls resolveData before its first await (resolveComponentData).
|
|
315
|
+
const started = (props, trigger, parent) => {
|
|
316
|
+
if (trigger !== 'replace')
|
|
317
|
+
return undefined;
|
|
318
|
+
const parentId = typeof parent?.props?.id === 'string' ? parent.props.id : undefined;
|
|
319
|
+
const id = typeof props?.id === 'string' ? props.id : ROOT_ID;
|
|
320
|
+
return binding()?.fieldResolveStarted(id, props ?? {}, parentId);
|
|
321
|
+
};
|
|
322
|
+
const track = (resolveData) => resolveData &&
|
|
323
|
+
(async (data, params) => {
|
|
324
|
+
const settle = started(data.props, params.trigger, params.parent);
|
|
325
|
+
try {
|
|
326
|
+
const result = await resolveData(data, params);
|
|
327
|
+
settle?.(result.props ?? {});
|
|
328
|
+
return result;
|
|
329
|
+
}
|
|
330
|
+
catch (error) {
|
|
331
|
+
settle?.(null);
|
|
332
|
+
throw error;
|
|
333
|
+
}
|
|
334
|
+
});
|
|
335
|
+
const trackRoot = (resolveData) => resolveData &&
|
|
336
|
+
(async (data, params) => {
|
|
337
|
+
const settle = started(data.props, params.trigger, params.parent);
|
|
338
|
+
try {
|
|
339
|
+
const result = await resolveData(data, params);
|
|
340
|
+
settle?.(result.props ?? {});
|
|
341
|
+
return result;
|
|
342
|
+
}
|
|
343
|
+
catch (error) {
|
|
344
|
+
settle?.(null);
|
|
345
|
+
throw error;
|
|
346
|
+
}
|
|
347
|
+
});
|
|
348
|
+
const { root } = config;
|
|
349
|
+
return {
|
|
350
|
+
...config,
|
|
351
|
+
...(root ? { root: { ...root, resolveData: trackRoot(root.resolveData) } } : {}),
|
|
352
|
+
components: Object.fromEntries(Object.entries(config.components).map(([name, component]) => [
|
|
353
|
+
name,
|
|
354
|
+
{ ...component, resolveData: track(component.resolveData) },
|
|
355
|
+
])),
|
|
356
|
+
};
|
|
357
|
+
}
|
|
358
|
+
const PuckBindingContext = createContext(null);
|
|
359
|
+
/** Puck's overrides are module-stable, so the parts inside <Puck> read the binding from here. */
|
|
360
|
+
export function PuckBindingProvider({ binding, children }) {
|
|
361
|
+
return _jsx(PuckBindingContext.Provider, { value: binding, children: children });
|
|
362
|
+
}
|
|
363
|
+
const usePuck = createUsePuck();
|
|
364
|
+
/**
|
|
365
|
+
* Inside <Puck>: shows each change Puck did not make (a teammate's, a restore, undo) once per frame, outside Puck's
|
|
366
|
+
* history; reports the selected block to teammates; routes the undo keys of the editor window to this user's undo.
|
|
367
|
+
*/
|
|
368
|
+
export function PuckLiveBridge() {
|
|
369
|
+
const binding = useContext(PuckBindingContext);
|
|
370
|
+
const channel = useDocChannel();
|
|
371
|
+
const dispatch = usePuck((state) => state.dispatch);
|
|
372
|
+
const getPuck = useGetPuck();
|
|
373
|
+
const selected = usePuck((state) => state.selectedItem?.props.id ?? null);
|
|
374
|
+
useEffect(() => {
|
|
375
|
+
if (binding)
|
|
376
|
+
channel?.setSelection(binding.live.docKey, typeof selected === 'string' ? selected : null);
|
|
377
|
+
}, [binding, channel, selected]);
|
|
378
|
+
useEffect(() => {
|
|
379
|
+
if (!binding)
|
|
380
|
+
return undefined;
|
|
381
|
+
let frame = 0;
|
|
382
|
+
let refocus = 0;
|
|
383
|
+
const onTransaction = (transaction) => {
|
|
384
|
+
if (transaction.origin === LOCAL_ORIGIN || frame !== 0)
|
|
385
|
+
return;
|
|
386
|
+
frame = requestAnimationFrame(() => {
|
|
387
|
+
frame = 0;
|
|
388
|
+
const data = binding.reseed();
|
|
389
|
+
if (!data)
|
|
390
|
+
return;
|
|
391
|
+
const { field } = getPuck().appState.ui;
|
|
392
|
+
dispatch({ type: 'setData', data: () => data, recordHistory: false });
|
|
393
|
+
if (!field.focus)
|
|
394
|
+
return;
|
|
395
|
+
// Puck keeps a focused field's own value (it syncs only while its store says unfocused): unfocus it there for
|
|
396
|
+
// one render so it shows the change, then focus it again; the input keeps DOM focus and caret throughout.
|
|
397
|
+
dispatch({ type: 'setUi', ui: { field: { ...field, focus: null } } });
|
|
398
|
+
refocus = requestAnimationFrame(() => dispatch({ type: 'setUi', ui: { field } }));
|
|
399
|
+
});
|
|
400
|
+
};
|
|
401
|
+
binding.live.doc.on('afterTransaction', onTransaction);
|
|
402
|
+
const stopKeys = interceptUndoKeys([window], binding.undo);
|
|
403
|
+
return () => {
|
|
404
|
+
binding.live.doc.off('afterTransaction', onTransaction);
|
|
405
|
+
cancelAnimationFrame(frame);
|
|
406
|
+
cancelAnimationFrame(refocus);
|
|
407
|
+
stopKeys();
|
|
408
|
+
};
|
|
409
|
+
}, [binding, dispatch, getPuck]);
|
|
410
|
+
return null;
|
|
411
|
+
}
|
|
412
|
+
/** Routes the canvas iframe's undo keys to this user's undo; re-runs when Puck replaces the iframe. */
|
|
413
|
+
export function useCanvasUndoKeys(canvas) {
|
|
414
|
+
const binding = useContext(PuckBindingContext);
|
|
415
|
+
useEffect(() => {
|
|
416
|
+
const view = canvas?.defaultView;
|
|
417
|
+
if (!binding || !view)
|
|
418
|
+
return undefined;
|
|
419
|
+
return interceptUndoKeys([view], binding.undo);
|
|
420
|
+
}, [binding, canvas]);
|
|
421
|
+
}
|
|
422
|
+
/** The peers selecting each block of `docKey`, by block id. */
|
|
423
|
+
export function usePeerOutlines(docKey) {
|
|
424
|
+
const peers = usePresencePeers(docKey);
|
|
425
|
+
return useMemo(() => {
|
|
426
|
+
const byBlock = {};
|
|
427
|
+
for (const peer of peers) {
|
|
428
|
+
const { blockId } = peer.selection;
|
|
429
|
+
if (blockId !== null)
|
|
430
|
+
byBlock[blockId] = [...(byBlock[blockId] ?? []), peer];
|
|
431
|
+
}
|
|
432
|
+
return byBlock;
|
|
433
|
+
}, [peers]);
|
|
434
|
+
}
|
|
435
|
+
/** A stable colour per user, so each teammate's outline reads the same everywhere. */
|
|
436
|
+
function peerColour(userId) {
|
|
437
|
+
let hash = 0;
|
|
438
|
+
for (const char of userId)
|
|
439
|
+
hash = (hash * 31 + char.charCodeAt(0)) % 360;
|
|
440
|
+
return `hsl(${hash} 70% 45%)`;
|
|
441
|
+
}
|
|
442
|
+
const NO_DOC = '';
|
|
443
|
+
/** Puck's `componentOverlay`: outlines a block a teammate has selected, with their name. */
|
|
444
|
+
export function PeerOutline({ children, componentId }) {
|
|
445
|
+
const binding = useContext(PuckBindingContext);
|
|
446
|
+
const peer = usePeerOutlines(binding?.live.docKey ?? NO_DOC)[componentId]?.[0];
|
|
447
|
+
if (!peer)
|
|
448
|
+
return _jsx(_Fragment, { children: children });
|
|
449
|
+
const colour = peerColour(peer.user.id);
|
|
450
|
+
return (_jsxs(_Fragment, { children: [children, _jsx("div", { "aria-hidden": "true", "data-peer-outline": peer.user.id, style: { position: 'absolute', inset: 0, outline: `2px solid ${colour}`, pointerEvents: 'none' }, children: _jsx("span", { style: {
|
|
451
|
+
position: 'absolute',
|
|
452
|
+
top: 0,
|
|
453
|
+
right: 0,
|
|
454
|
+
background: colour,
|
|
455
|
+
color: 'white',
|
|
456
|
+
fontSize: '11px',
|
|
457
|
+
padding: '0 4px',
|
|
458
|
+
}, children: peer.user.name }) })] }));
|
|
459
|
+
}
|
|
460
|
+
/** Above the canvas while the replica is held: the editor is read-only, and the user's view can be copied out. */
|
|
461
|
+
export function PuckHeldNotice({ binding }) {
|
|
462
|
+
const channel = useDocChannel();
|
|
463
|
+
if (!binding.live.held)
|
|
464
|
+
return null;
|
|
465
|
+
return (_jsxs("div", { role: "alert", className: "flex items-center gap-3 px-4 py-2 bg-yellow-11 text-yellow-02 text-sm", children: [_jsx("span", { children: channel?.held() ?? HELD_WRITE_FAILED }), _jsx("button", { type: "button", className: "px-3 py-1 border border-line rounded", onClick: () => void navigator.clipboard.writeText(JSON.stringify({ puckData: binding.shadow }, null, 2)), children: "Copy changes" })] }));
|
|
466
|
+
}
|
|
467
|
+
//# sourceMappingURL=puck-binding.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"puck-binding.js","sourceRoot":"","sources":["../../../src/live/puck-binding.tsx"],"names":[],"mappings":";AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAgB,WAAW,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACxH,OAAO,EAGL,aAAa,EAGb,UAAU,GACX,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAkB,UAAU,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEtF,OAAO,EAAqB,iBAAiB,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAErG,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEjD,MAAM,UAAU,YAAY,CAAC,GAAU;IACrC,OAAO,YAAY,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC;AACpC,CAAC;AAED,MAAM,MAAM,GAAG,CAAC,QAAc,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAC;AAE7E;;;;;;;;GAQG;AACH,MAAM,UAAU,eAAe,CAC7B,GAAU,EACV,MAAY,EACZ,SAAkB,EAClB,IAAU,EACV,WAAuC;IAEvC,IAAI,CAAC;QACH,IAAI,GAAG,GAAG,SAAS,CAAC;QACpB,GAAG,CAAC,QAAQ,CAAC,GAAG,EAAE;YAChB,MAAM,OAAO,GAAG,gBAAgB,CAC9B,GAA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AACJ,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/** Per-user undo over a shared doc: only this user's edits and restores, never a teammate's. */
|
|
2
|
+
import * as Y from 'yjs';
|
|
3
|
+
/** The shared types an undo manager tracks, as Yjs types them. */
|
|
4
|
+
export type UndoScope = ConstructorParameters<typeof Y.UndoManager>[0];
|
|
5
|
+
export declare function createLocalUndo(scope: UndoScope): Y.UndoManager;
|
|
6
|
+
/** This user's undo over a page's maps (`roots`), its list items and the arrays of its lists of primitives. */
|
|
7
|
+
export interface ListUndo {
|
|
8
|
+
undo: Y.UndoManager;
|
|
9
|
+
/** Adds the `a:` arrays a local write is about to create, before it writes (`applyItemChanges`'s `beforeWrite`). */
|
|
10
|
+
track(names: string[]): void;
|
|
11
|
+
/**
|
|
12
|
+
* Marks one mounted user (an effect); call the returned release on unmount. Once the last user releases it and none
|
|
13
|
+
* comes back within the commit (StrictMode remounts at once), the undo lets go of the doc: its handlers and manager.
|
|
14
|
+
*/
|
|
15
|
+
retain(): () => void;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Local undo over the maps `roots`, `items` and the `a:` root array of every list of primitives: those present now,
|
|
19
|
+
* those a local write names through `track`, and those a remote transaction created (added once it ends). Without them,
|
|
20
|
+
* an item or primitive edit is not undoable, and Undo of a flip or a removal empties a list of primitives. `lists` is
|
|
21
|
+
* never in scope: only the server prunes it.
|
|
22
|
+
*/
|
|
23
|
+
export declare function createListUndo(doc: Y.Doc, roots: string[]): ListUndo;
|
|
24
|
+
/**
|
|
25
|
+
* Routes mod+Z, mod+Shift+Z and mod+Y on each window to `undo`, in the capture phase so the editor's own history never
|
|
26
|
+
* sees them; a key inside an element marked `data-native-undo` is left to it. Returns the function that stops it.
|
|
27
|
+
*/
|
|
28
|
+
export declare function interceptUndoKeys(targets: Window[], undo: Y.UndoManager): () => void;
|
|
29
|
+
//# sourceMappingURL=undo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"undo.d.ts","sourceRoot":"","sources":["../../../src/live/undo.ts"],"names":[],"mappings":"AAAA,gGAAgG;AAEhG,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAMzB,kEAAkE;AAClE,MAAM,MAAM,SAAS,GAAG,qBAAqB,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;AAEvE,wBAAgB,eAAe,CAAC,KAAK,EAAE,SAAS,GAAG,CAAC,CAAC,WAAW,CAE/D;AAED,+GAA+G;AAC/G,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,CAAC,CAAC,WAAW,CAAC;IACpB,oHAAoH;IACpH,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAC7B;;;OAGG;IACH,MAAM,IAAI,MAAM,IAAI,CAAC;CACtB;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,QAAQ,CAwDpE;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,WAAW,GAAG,MAAM,IAAI,CAgBpF"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/** Per-user undo over a shared doc: only this user's edits and restores, never a teammate's. */
|
|
2
|
+
import * as Y from 'yjs';
|
|
3
|
+
import { EDIT_ORIGIN, LOCAL_ORIGIN } from './doc-channel.js';
|
|
4
|
+
/** One typing burst within this window is one undo step. */
|
|
5
|
+
const CAPTURE_MS = 500;
|
|
6
|
+
export function createLocalUndo(scope) {
|
|
7
|
+
return new Y.UndoManager(scope, { trackedOrigins: new Set([LOCAL_ORIGIN, EDIT_ORIGIN]), captureTimeout: CAPTURE_MS });
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Local undo over the maps `roots`, `items` and the `a:` root array of every list of primitives: those present now,
|
|
11
|
+
* those a local write names through `track`, and those a remote transaction created (added once it ends). Without them,
|
|
12
|
+
* an item or primitive edit is not undoable, and Undo of a flip or a removal empties a list of primitives. `lists` is
|
|
13
|
+
* never in scope: only the server prunes it.
|
|
14
|
+
*/
|
|
15
|
+
export function createListUndo(doc, roots) {
|
|
16
|
+
const arrays = () => [...doc.share.keys()].filter((name) => name.startsWith('a:'));
|
|
17
|
+
/**
|
|
18
|
+
* Attached at first use, not at creation: StrictMode builds a memoized binding twice and drops one unused, which
|
|
19
|
+
* then holds nothing on the doc.
|
|
20
|
+
*/
|
|
21
|
+
let attached = null;
|
|
22
|
+
let released = false;
|
|
23
|
+
const attach = () => {
|
|
24
|
+
if (attached)
|
|
25
|
+
return attached;
|
|
26
|
+
const scoped = new Set(arrays());
|
|
27
|
+
const undo = createLocalUndo([
|
|
28
|
+
...roots.map((name) => doc.getMap(name)),
|
|
29
|
+
doc.getMap('items'),
|
|
30
|
+
...[...scoped].map((name) => doc.getArray(name)),
|
|
31
|
+
]);
|
|
32
|
+
let known = doc.share.size;
|
|
33
|
+
const onTransaction = () => {
|
|
34
|
+
// Only a transaction that added a root type can have created an array.
|
|
35
|
+
if (doc.share.size === known)
|
|
36
|
+
return;
|
|
37
|
+
known = doc.share.size;
|
|
38
|
+
track(arrays());
|
|
39
|
+
};
|
|
40
|
+
doc.on('afterTransaction', onTransaction);
|
|
41
|
+
attached = { undo, scoped, onTransaction };
|
|
42
|
+
return attached;
|
|
43
|
+
};
|
|
44
|
+
const track = (names) => {
|
|
45
|
+
const { undo, scoped } = attach();
|
|
46
|
+
for (const name of names) {
|
|
47
|
+
if (scoped.has(name))
|
|
48
|
+
continue;
|
|
49
|
+
scoped.add(name);
|
|
50
|
+
undo.addToScope(doc.getArray(name));
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
let users = 0;
|
|
54
|
+
const retain = () => {
|
|
55
|
+
attach();
|
|
56
|
+
users += 1;
|
|
57
|
+
return () => {
|
|
58
|
+
users -= 1;
|
|
59
|
+
queueMicrotask(() => {
|
|
60
|
+
if (users > 0 || released || !attached)
|
|
61
|
+
return;
|
|
62
|
+
released = true;
|
|
63
|
+
doc.off('afterTransaction', attached.onTransaction);
|
|
64
|
+
attached.undo.destroy();
|
|
65
|
+
});
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
return {
|
|
69
|
+
get undo() {
|
|
70
|
+
return attach().undo;
|
|
71
|
+
},
|
|
72
|
+
track,
|
|
73
|
+
retain,
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Routes mod+Z, mod+Shift+Z and mod+Y on each window to `undo`, in the capture phase so the editor's own history never
|
|
78
|
+
* sees them; a key inside an element marked `data-native-undo` is left to it. Returns the function that stops it.
|
|
79
|
+
*/
|
|
80
|
+
export function interceptUndoKeys(targets, undo) {
|
|
81
|
+
const onKey = (event) => {
|
|
82
|
+
if (!(event.metaKey || event.ctrlKey) || event.altKey)
|
|
83
|
+
return;
|
|
84
|
+
const key = event.key.toLowerCase();
|
|
85
|
+
const redo = key === 'y' || (key === 'z' && event.shiftKey);
|
|
86
|
+
if (key !== 'z' && key !== 'y')
|
|
87
|
+
return;
|
|
88
|
+
if (event.target instanceof Element && event.target.closest('[data-native-undo]'))
|
|
89
|
+
return;
|
|
90
|
+
event.preventDefault();
|
|
91
|
+
event.stopPropagation();
|
|
92
|
+
if (redo)
|
|
93
|
+
undo.redo();
|
|
94
|
+
else
|
|
95
|
+
undo.undo();
|
|
96
|
+
};
|
|
97
|
+
for (const target of targets)
|
|
98
|
+
target.addEventListener('keydown', onKey, true);
|
|
99
|
+
return () => {
|
|
100
|
+
for (const target of targets)
|
|
101
|
+
target.removeEventListener('keydown', onKey, true);
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
//# sourceMappingURL=undo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"undo.js","sourceRoot":"","sources":["../../../src/live/undo.ts"],"names":[],"mappings":"AA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