@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
|
@@ -1,25 +1,46 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { parseFragmentMdx } from '@conloca/mdx/render';
|
|
2
|
+
// Import gurx hooks from @mdxeditor/editor, not @mdxeditor/gurx: its re-export is the module instance the editor's
|
|
3
|
+
// realm context comes from.
|
|
4
|
+
import { activeEditor$, insertJsx$, insertMarkdown$, usePublisher, useRealm } from '@mdxeditor/editor';
|
|
5
|
+
import { $getSelection, $isNodeSelection } from 'lexical';
|
|
6
|
+
import { useMemo } from 'react';
|
|
3
7
|
import { isJsxDescriptor, isSnippetDescriptor, } from '../../../mdx-components.js';
|
|
8
|
+
/** A default body as a loaded fragment parses it; one the parser refuses inserts the component with an empty body. */
|
|
9
|
+
function parseDefaultBody(name, body) {
|
|
10
|
+
try {
|
|
11
|
+
return parseFragmentMdx(body);
|
|
12
|
+
}
|
|
13
|
+
catch (error) {
|
|
14
|
+
console.warn(`[insert] ${name}: its default body could not be parsed, inserting it empty.`, error);
|
|
15
|
+
return { type: 'root', children: [] };
|
|
16
|
+
}
|
|
17
|
+
}
|
|
4
18
|
/**
|
|
5
19
|
* Build the payload accepted by @mdxeditor/editor's `insertJsx$` signal.
|
|
6
20
|
*
|
|
7
21
|
* Strings round-trip as plain attributes; numbers/booleans become
|
|
8
|
-
* expression attributes (`{2}`, `{true}`)
|
|
9
|
-
* `mdxJsxAttribute.value` shape is
|
|
10
|
-
* `{ type: 'expression', value: string }` object.
|
|
22
|
+
* expression attributes (`{2}`, `{true}`) and lists/objects JSON
|
|
23
|
+
* expressions, because the upstream `mdxJsxAttribute.value` shape is
|
|
24
|
+
* either a string or an `{ type: 'expression', value: string }` object.
|
|
11
25
|
*
|
|
12
|
-
* `descriptor.defaults.children` is parsed
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* author build the body via in-place editing.
|
|
26
|
+
* `descriptor.defaults.children` is parsed by `parseFragmentMdx`, the parse
|
|
27
|
+
* the save check reads a fragment with, so component tags in a default
|
|
28
|
+
* become JSX nodes exactly as they would in a loaded fragment.
|
|
16
29
|
*/
|
|
17
30
|
export function buildInsertPayload(descriptor, overrides = {}) {
|
|
18
31
|
const merged = { ...(descriptor.defaults?.attributes ?? {}), ...overrides };
|
|
19
32
|
const props = {};
|
|
20
33
|
for (const [name, value] of Object.entries(merged)) {
|
|
34
|
+
if (value === null)
|
|
35
|
+
continue;
|
|
21
36
|
const propType = descriptor.props?.find((p) => p.name === name)?.type;
|
|
22
|
-
if (
|
|
37
|
+
if (typeof value === 'object' && value !== null) {
|
|
38
|
+
props[name] = { type: 'expression', value: JSON.stringify(value) };
|
|
39
|
+
}
|
|
40
|
+
else if (propType === 'number' ||
|
|
41
|
+
propType === 'boolean' ||
|
|
42
|
+
typeof value === 'number' ||
|
|
43
|
+
typeof value === 'boolean') {
|
|
23
44
|
props[name] = { type: 'expression', value: String(value) };
|
|
24
45
|
}
|
|
25
46
|
else {
|
|
@@ -28,14 +49,14 @@ export function buildInsertPayload(descriptor, overrides = {}) {
|
|
|
28
49
|
}
|
|
29
50
|
// Parse the optional starter body. The cast on the result narrows the
|
|
30
51
|
// upstream mdast root's `children` to the flow/text element children types
|
|
31
|
-
// the library expects —
|
|
32
|
-
//
|
|
33
|
-
//
|
|
34
|
-
//
|
|
35
|
-
//
|
|
52
|
+
// the library expects — the parsed Root's children are block-level, which
|
|
53
|
+
// is the same set as `MdxJsxFlowElement` accepts. For text-kind
|
|
54
|
+
// descriptors, callers are responsible for providing markdown that is
|
|
55
|
+
// phrasing-only (the wildcard cast is explicit so the contract is visible
|
|
56
|
+
// at the call site).
|
|
36
57
|
let children;
|
|
37
58
|
if (descriptor.hasChildren && descriptor.defaults?.children) {
|
|
38
|
-
const root =
|
|
59
|
+
const root = parseDefaultBody(descriptor.name, descriptor.defaults.children);
|
|
39
60
|
children = root.children;
|
|
40
61
|
}
|
|
41
62
|
// Build via the discriminator-narrowed branches so the returned value
|
|
@@ -61,6 +82,44 @@ export function buildInsertPayload(descriptor, overrides = {}) {
|
|
|
61
82
|
export function hasRequiredProps(descriptor) {
|
|
62
83
|
return !!descriptor.props?.some((p) => p.required === true);
|
|
63
84
|
}
|
|
85
|
+
/**
|
|
86
|
+
* A caret right after the selected component. An arrow key onto a block component selects the component itself, and
|
|
87
|
+
* MDXEditor inserts only at a caret: `insertJsx$` silently inserts nothing, and `insertMarkdown$` replaces the
|
|
88
|
+
* selected component with the snippet.
|
|
89
|
+
*/
|
|
90
|
+
function $caretAfterSelectedComponent() {
|
|
91
|
+
const selection = $getSelection();
|
|
92
|
+
if (!$isNodeSelection(selection))
|
|
93
|
+
return;
|
|
94
|
+
const nodes = selection.getNodes();
|
|
95
|
+
const last = nodes[nodes.length - 1];
|
|
96
|
+
if (!last)
|
|
97
|
+
return;
|
|
98
|
+
const after = last.getIndexWithinParent() + 1;
|
|
99
|
+
last.getParentOrThrow().select(after, after);
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* The slash menu's and toolbar's publishers. Each insert lands in the editor the author was last in (a component's
|
|
103
|
+
* body is its own editor), at its caret, or right after the component selected there.
|
|
104
|
+
*/
|
|
105
|
+
export function useInsertPublishers() {
|
|
106
|
+
const realm = useRealm();
|
|
107
|
+
const publishJsx = usePublisher(insertJsx$);
|
|
108
|
+
const publishMarkdown = usePublisher(insertMarkdown$);
|
|
109
|
+
return useMemo(() => {
|
|
110
|
+
const toCaret = () => realm.getValue(activeEditor$)?.update($caretAfterSelectedComponent, { discrete: true });
|
|
111
|
+
return {
|
|
112
|
+
jsx: (payload) => {
|
|
113
|
+
toCaret();
|
|
114
|
+
publishJsx(payload);
|
|
115
|
+
},
|
|
116
|
+
markdown: (value) => {
|
|
117
|
+
toCaret();
|
|
118
|
+
publishMarkdown(value);
|
|
119
|
+
},
|
|
120
|
+
};
|
|
121
|
+
}, [realm, publishJsx, publishMarkdown]);
|
|
122
|
+
}
|
|
64
123
|
/**
|
|
65
124
|
* Insert a descriptor's content into the editor. JSX descriptors go
|
|
66
125
|
* through `insertJsx$` so they land as a proper Lexical decorator node
|
|
@@ -86,10 +145,4 @@ export function dispatchInsert(descriptor, publishers) {
|
|
|
86
145
|
const _exhaustive = descriptor;
|
|
87
146
|
void _exhaustive;
|
|
88
147
|
}
|
|
89
|
-
/**
|
|
90
|
-
* Convenience re-export of the upstream signals so call sites don't need
|
|
91
|
-
* to import them separately. Keeping both signal references in one module
|
|
92
|
-
* also documents which library symbols the insert pipeline depends on.
|
|
93
|
-
*/
|
|
94
|
-
export { insertJsx$, insertMarkdown$ };
|
|
95
148
|
//# sourceMappingURL=insert-payload.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"insert-payload.js","sourceRoot":"","sources":["../../../../../src/components/editor/insert-menu/insert-payload.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"insert-payload.js","sourceRoot":"","sources":["../../../../../src/components/editor/insert-menu/insert-payload.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvE,mHAAmH;AACnH,4BAA4B;AAC5B,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,eAAe,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACvG,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAG1D,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EACL,eAAe,EACf,mBAAmB,GAIpB,MAAM,4BAA4B,CAAC;AA8BpC,sHAAsH;AACtH,SAAS,gBAAgB,CAAC,IAAY,EAAE,IAAY;IAClD,IAAI,CAAC;QACH,OAAO,gBAAgB,CAAC,IAAI,CAAC,CAAC;IAChC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,IAAI,CAAC,YAAY,IAAI,6DAA6D,EAAE,KAAK,CAAC,CAAC;QACnG,OAAO,EAAE,I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CAA2C;IAC3C,MAAM,WAAW,GAAU,UAAU,CAAC;IACtC,KAAK,WAAW,CAAC;AACnB,CAAC"}
|
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
* Realm plugin that wires the slash menu into @mdxeditor/editor's Lexical
|
|
3
3
|
* composer tree. The plugin's only job is to publish `SlashMenuPlugin`
|
|
4
4
|
* (which itself calls `useLexicalComposerContext`) through
|
|
5
|
-
* `addComposerChild$` so it mounts inside the editor's composer
|
|
5
|
+
* `addComposerChild$` so it mounts inside the editor's composer, and through
|
|
6
|
+
* `addNestedEditorChild$` so a component's body (a nested editor) gets its
|
|
7
|
+
* own menu at its own caret.
|
|
6
8
|
*/
|
|
7
9
|
export declare const mdxComponentsPlugin: (params?: unknown) => import("@mdxeditor/editor").RealmPlugin;
|
|
8
10
|
//# sourceMappingURL=mdx-components-plugin.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mdx-components-plugin.d.ts","sourceRoot":"","sources":["../../../../../src/components/editor/insert-menu/mdx-components-plugin.ts"],"names":[],"mappings":"AAGA
|
|
1
|
+
{"version":3,"file":"mdx-components-plugin.d.ts","sourceRoot":"","sources":["../../../../../src/components/editor/insert-menu/mdx-components-plugin.ts"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,+DAI9B,CAAC"}
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import { addComposerChild$, realmPlugin } from '@mdxeditor/editor';
|
|
1
|
+
import { addComposerChild$, addNestedEditorChild$, realmPlugin } from '@mdxeditor/editor';
|
|
2
2
|
import { SlashMenuPlugin } from './SlashMenuPlugin.js';
|
|
3
3
|
/**
|
|
4
4
|
* Realm plugin that wires the slash menu into @mdxeditor/editor's Lexical
|
|
5
5
|
* composer tree. The plugin's only job is to publish `SlashMenuPlugin`
|
|
6
6
|
* (which itself calls `useLexicalComposerContext`) through
|
|
7
|
-
* `addComposerChild$` so it mounts inside the editor's composer
|
|
7
|
+
* `addComposerChild$` so it mounts inside the editor's composer, and through
|
|
8
|
+
* `addNestedEditorChild$` so a component's body (a nested editor) gets its
|
|
9
|
+
* own menu at its own caret.
|
|
8
10
|
*/
|
|
9
11
|
export const mdxComponentsPlugin = realmPlugin({
|
|
10
12
|
init(realm) {
|
|
11
|
-
realm.
|
|
13
|
+
realm.pubIn({ [addComposerChild$]: SlashMenuPlugin, [addNestedEditorChild$]: SlashMenuPlugin });
|
|
12
14
|
},
|
|
13
15
|
});
|
|
14
16
|
//# sourceMappingURL=mdx-components-plugin.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mdx-components-plugin.js","sourceRoot":"","sources":["../../../../../src/components/editor/insert-menu/mdx-components-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"mdx-components-plugin.js","sourceRoot":"","sources":["../../../../../src/components/editor/insert-menu/mdx-components-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAC1F,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,WAAW,CAAC;IAC7C,IAAI,CAAC,KAAK;QACR,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAAC,EAAE,eAAe,EAAE,CAAC,qBAAqB,CAAC,EAAE,eAAe,EAAE,CAAC,CAAC;IAClG,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/** How a component block was written in the source. Columns and indents count from the block's opening `<`. */
|
|
2
|
+
interface SourceLayout {
|
|
3
|
+
/** The opening tag as written (the whole block when it closes itself), later lines relative to its `<`. */
|
|
4
|
+
open: string;
|
|
5
|
+
/** The attributes `open` spells, to tell whether it still does. */
|
|
6
|
+
attributes: string;
|
|
7
|
+
openEndLine: number;
|
|
8
|
+
/** Line breaks after the opening tag and before the closing tag, and the children's and closing tag's indents. */
|
|
9
|
+
body?: {
|
|
10
|
+
openBreaks: number;
|
|
11
|
+
indent: number;
|
|
12
|
+
closeBreaks: number;
|
|
13
|
+
closeIndent: number;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
declare module 'mdast-util-mdx-jsx' {
|
|
17
|
+
interface MdxJsxFlowElementData {
|
|
18
|
+
/** Absent for blocks made in the editor. */
|
|
19
|
+
sourceLayout?: SourceLayout;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
/** Saves component blocks in their source layout, so opening and saving a file rewrites none of them. */
|
|
23
|
+
export declare const jsxLayoutPlugin: (params?: unknown) => import("@mdxeditor/editor").RealmPlugin;
|
|
24
|
+
export {};
|
|
25
|
+
//# sourceMappingURL=jsx-layout-plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsx-layout-plugin.d.ts","sourceRoot":"","sources":["../../../../src/components/editor/jsx-layout-plugin.ts"],"names":[],"mappings":"AAGA,+GAA+G;AAC/G,UAAU,YAAY;IACpB,2GAA2G;IAC3G,IAAI,EAAE,MAAM,CAAC;IACb,mEAAmE;IACnE,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,kHAAkH;IAClH,IAAI,CAAC,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC;CACzF;AAED,OAAO,QAAQ,oBAAoB,CAAC;IAClC,UAAU,qBAAqB;QAC7B,4CAA4C;QAC5C,YAAY,CAAC,EAAE,YAAY,CAAC;KAC7B;CACF;AA2ED,yGAAyG;AACzG,eAAO,MAAM,eAAe,+DAO1B,CAAC"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { addMdastExtension$, addToMarkdownExtension$, realmPlugin } from '@mdxeditor/editor';
|
|
2
|
+
import { mdxJsxFromMarkdown, mdxJsxToMarkdown } from 'mdast-util-mdx-jsx';
|
|
3
|
+
const stockExitFlowTag = mdxJsxFromMarkdown().exit?.mdxJsxFlowTag;
|
|
4
|
+
const stockFlowElement = mdxJsxToMarkdown().handlers?.mdxJsxFlowElement;
|
|
5
|
+
if (!stockExitFlowTag || !stockFlowElement)
|
|
6
|
+
throw new Error('mdast-util-mdx-jsx no longer handles flow elements');
|
|
7
|
+
// The name too: a renamed block's recorded opening tag would no longer match its closing tag.
|
|
8
|
+
const attributesOf = (element) => JSON.stringify([element.name, element.attributes], (key, value) => key === 'position' || key === 'data' ? undefined : value);
|
|
9
|
+
/** The stock tag exit, plus the source layout of the block the tag opens or closes. */
|
|
10
|
+
const exitFlowTag = function (token) {
|
|
11
|
+
const tag = this.data.mdxJsxTag;
|
|
12
|
+
// The tag's text buffer sits on top until the stock exit resumes it.
|
|
13
|
+
const closed = this.stack[this.stack.length - 2];
|
|
14
|
+
stockExitFlowTag.call(this, token);
|
|
15
|
+
if (tag?.close) {
|
|
16
|
+
if (closed?.type !== 'mdxJsxFlowElement')
|
|
17
|
+
return;
|
|
18
|
+
const layout = closed.data?.sourceLayout;
|
|
19
|
+
const start = closed.position?.start;
|
|
20
|
+
const first = closed.children[0]?.position;
|
|
21
|
+
const last = closed.children[closed.children.length - 1]?.position;
|
|
22
|
+
if (layout && start && first && last) {
|
|
23
|
+
layout.body = {
|
|
24
|
+
openBreaks: first.start.line - layout.openEndLine,
|
|
25
|
+
indent: Math.max(0, first.start.column - start.column),
|
|
26
|
+
closeBreaks: token.start.line - last.end.line,
|
|
27
|
+
closeIndent: Math.max(0, token.start.column - start.column),
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
const top = this.stack[this.stack.length - 1];
|
|
33
|
+
const element = tag?.selfClosing && top && 'children' in top ? top.children[top.children.length - 1] : top;
|
|
34
|
+
if (element?.type !== 'mdxJsxFlowElement')
|
|
35
|
+
return;
|
|
36
|
+
// Later lines lose the block's own indent, which the parent writes back; each keeps its source line ending.
|
|
37
|
+
const open = this.sliceSerialize(token).replace(new RegExp(`(\\r\\n|\\r|\\n) {0,${token.start.column - 1}}`, 'g'), '$1');
|
|
38
|
+
element.data = {
|
|
39
|
+
...element.data,
|
|
40
|
+
sourceLayout: { open, attributes: attributesOf(element), openEndLine: token.end.line },
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Writes a component block the way its source laid it out, where the stock handler indents its children by two spaces
|
|
45
|
+
* per level and drops the blank line before its closing tag. Its children are written as usual, so an edit inside
|
|
46
|
+
* changes only what was edited.
|
|
47
|
+
*/
|
|
48
|
+
const flowElement = (node, parent, state, info) => {
|
|
49
|
+
const layout = node.data?.sourceLayout;
|
|
50
|
+
// Inside a quote or list item the container indents the block; leave that to the stock handler.
|
|
51
|
+
const contained = state.stack.some((name) => name === 'blockquote' || name === 'listItem');
|
|
52
|
+
const body = layout?.body;
|
|
53
|
+
if (!layout || contained || node.children.length > 0 !== (body !== undefined)) {
|
|
54
|
+
return stockFlowElement(node, parent, state, info);
|
|
55
|
+
}
|
|
56
|
+
const sameAttributes = layout.attributes === attributesOf(node);
|
|
57
|
+
if (!body)
|
|
58
|
+
return sameAttributes ? layout.open : stockFlowElement(node, parent, state, info);
|
|
59
|
+
// The stock opening tag is the self-closing tag of the block without its children.
|
|
60
|
+
const open = sameAttributes
|
|
61
|
+
? layout.open
|
|
62
|
+
: stockFlowElement({ ...node, children: [] }, parent, state, info)
|
|
63
|
+
.trimStart()
|
|
64
|
+
.replace(/ ?\/>$/, '>');
|
|
65
|
+
const children = state.indentLines(state.containerFlow(node, info), (line, _, blank) => blank ? '' : ' '.repeat(body.indent) + line);
|
|
66
|
+
return `${open}${'\n'.repeat(body.openBreaks)}${children}${'\n'.repeat(body.closeBreaks)}${' '.repeat(body.closeIndent)}</${node.name ?? ''}>`;
|
|
67
|
+
};
|
|
68
|
+
/** Saves component blocks in their source layout, so opening and saving a file rewrites none of them. */
|
|
69
|
+
export const jsxLayoutPlugin = realmPlugin({
|
|
70
|
+
init(realm) {
|
|
71
|
+
realm.pubIn({
|
|
72
|
+
[addMdastExtension$]: [{ exit: { mdxJsxFlowTag: exitFlowTag } }],
|
|
73
|
+
[addToMarkdownExtension$]: [{ handlers: { mdxJsxFlowElement: flowElement } }],
|
|
74
|
+
});
|
|
75
|
+
},
|
|
76
|
+
});
|
|
77
|
+
//# sourceMappingURL=jsx-layout-plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsx-layout-plugin.js","sourceRoot":"","sources":["../../../../src/components/editor/jsx-layout-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAC7F,OAAO,EAA0B,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAoBlG,MAAM,gBAAgB,GAAG,kBAAkB,EAAE,CAAC,IAAI,EAAE,aAAa,CAAC;AAClE,MAAM,gBAAgB,GAAG,gBAAgB,EAAE,CAAC,QAAQ,EAAE,iBAAiB,CAAC;AACxE,IAAI,CAAC,gBAAgB,IAAI,CAAC,gBAAgB;IAAE,MAAM,IAAI,KAAK,CAAC,oDAAoD,CAAC,CAAC;AAElH,8FAA8F;AAC9F,MAAM,YAAY,GAAG,CAAC,OAA0B,EAAE,EAAE,CAClD,IAAI,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,CAChE,GAAG,KAAK,UAAU,IAAI,GAAG,KAAK,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CACzD,CAAC;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yGAAyG;AACzG,MAAM,CAAC,MAAM,eAAe,GAAG,WAAW,CAAC;IACzC,IAAI,CAAC,KAAK;QACR,KAAK,CAAC,KAAK,CAAC;YACV,CAAC,kBAAkB,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,aAAa,EAAE,WAAW,EAAE,EAAE,CAAC;YAChE,CAAC,uBAAuB,CAAC,EAAE,CAAC,EAAE,QAAQ,EAAE,EAAE,iBAAiB,EAAE,WAAW,EAAE,EAAE,CAAC;SAC9E,CAAC,CAAC;IACL,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { FragmentVocabulary } from '@conloca/mdx/render';
|
|
2
|
+
import { type MdxComponents } from '../../mdx-components.js';
|
|
3
|
+
/** True inside a fragment editor: only the site's fragment vocabulary is offered, rendered by the site's own components. */
|
|
4
|
+
export declare const FragmentModeContext: import("react").Context<boolean>;
|
|
5
|
+
/**
|
|
6
|
+
* The components an editor offers. A page gets every descriptor; a fragment gets the snippets and the vocabulary's
|
|
7
|
+
* components, with a plain flow descriptor for each vocabulary component the registry does not describe.
|
|
8
|
+
*/
|
|
9
|
+
export declare function offeredMdxComponents(descriptors: MdxComponents, vocabulary: FragmentVocabulary | undefined): MdxComponents;
|
|
10
|
+
export declare function useOfferedMdxComponents(): MdxComponents;
|
|
11
|
+
//# sourceMappingURL=offered-mdx-components.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"offered-mdx-components.d.ts","sourceRoot":"","sources":["../../../../src/components/editor/offered-mdx-components.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAE9D,OAAO,EAAmB,KAAK,aAAa,EAAoB,MAAM,yBAAyB,CAAC;AAGhG,4HAA4H;AAC5H,eAAO,MAAM,mBAAmB,kCAAuB,CAAC;AAExD;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,WAAW,EAAE,aAAa,EAC1B,UAAU,EAAE,kBAAkB,GAAG,SAAS,GACzC,aAAa,CASf;AAED,wBAAgB,uBAAuB,IAAI,aAAa,CAQvD"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { createContext, useContext, useMemo } from 'react';
|
|
2
|
+
import { isJsxDescriptor, useMdxComponents } from '../../mdx-components.js';
|
|
3
|
+
import { useSiteRender } from '../../site-render.js';
|
|
4
|
+
/** True inside a fragment editor: only the site's fragment vocabulary is offered, rendered by the site's own components. */
|
|
5
|
+
export const FragmentModeContext = createContext(false);
|
|
6
|
+
/**
|
|
7
|
+
* The components an editor offers. A page gets every descriptor; a fragment gets the snippets and the vocabulary's
|
|
8
|
+
* components, with a plain flow descriptor for each vocabulary component the registry does not describe.
|
|
9
|
+
*/
|
|
10
|
+
export function offeredMdxComponents(descriptors, vocabulary) {
|
|
11
|
+
if (!vocabulary)
|
|
12
|
+
return descriptors;
|
|
13
|
+
const names = Object.keys(vocabulary.components);
|
|
14
|
+
const kept = descriptors.filter((d) => !isJsxDescriptor(d) || names.includes(d.name));
|
|
15
|
+
const described = new Set(descriptors.filter(isJsxDescriptor).map((d) => d.name));
|
|
16
|
+
const synthesized = names
|
|
17
|
+
.filter((name) => !described.has(name))
|
|
18
|
+
.map((name) => ({ name, kind: 'flow', hasChildren: true }));
|
|
19
|
+
return [...kept, ...synthesized];
|
|
20
|
+
}
|
|
21
|
+
export function useOfferedMdxComponents() {
|
|
22
|
+
const fragment = useContext(FragmentModeContext);
|
|
23
|
+
const descriptors = useMdxComponents();
|
|
24
|
+
const { vocabulary } = useSiteRender();
|
|
25
|
+
return useMemo(() => offeredMdxComponents(descriptors, fragment ? vocabulary : undefined), [descriptors, fragment, vocabulary]);
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=offered-mdx-components.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"offered-mdx-components.js","sourceRoot":"","sources":["../../../../src/components/editor/offered-mdx-components.ts"],"names":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AC;IACjD,MAAM,WAAW,GAAG,gBAAgB,EAAE,CAAC;IACvC,MAAM,EAAE,UAAU,EAAE,GAAG,aAAa,EAAE,CAAC;IACvC,OAAO,OAAO,CACZ,GAAG,EAAE,CAAC,oBAAoB,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,EAC1E,CAAC,WAAW,EAAE,QAAQ,EAAE,UAAU,CAAC,CACpC,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page-setting-targets.d.ts","sourceRoot":"","sources":["../../../../src/components/editor/page-setting-targets.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAqC,MAAM,kBAAkB,CAAC;AACrF,OAAO,EAAiB,KAAK,SAAS,EAA2C,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"page-setting-targets.d.ts","sourceRoot":"","sources":["../../../../src/components/editor/page-setting-targets.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAqC,MAAM,kBAAkB,CAAC;AACrF,OAAO,EAAiB,KAAK,SAAS,EAA2C,MAAM,OAAO,CAAC;AA4B/F;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,EACzC,MAAM,EACN,QAAQ,GACT,EAAE;IACD,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,QAAQ,EAAE,SAAS,CAAC;CACrB,+BAQA;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,QAAQ,GAAG,SAAS,GAAG,IAAI,CA+DxE;AAUD;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,EAAE,SAAS,CAAC,QAAQ,CAsB1D,CAAC"}
|
|
@@ -2,6 +2,7 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
|
|
|
2
2
|
import { registerOverlayPortal, useGetPuck } from '@puckeditor/core';
|
|
3
3
|
import { createContext, useContext, useEffect, useRef, useState } from 'react';
|
|
4
4
|
import { PAGE_SETTING_ATTRIBUTE } from '../../page-setting-attributes.js';
|
|
5
|
+
import { PageConflictFields } from '../conflicts/PuckConflicts.js';
|
|
5
6
|
/**
|
|
6
7
|
* The parts of blocks that show one of the page's settings (marked with
|
|
7
8
|
* `pageSettingAttributes`), made clickable on the page editor's canvas.
|
|
@@ -119,6 +120,6 @@ export const FieldsWithPageSettingsHint = ({ children, itemSelector }) => {
|
|
|
119
120
|
useEffect(() => {
|
|
120
121
|
setShows(blockShowsPageSettings(targets?.canvas.current, blockId));
|
|
121
122
|
}, [blockId, targets]);
|
|
122
|
-
return (_jsxs(_Fragment, { children: [shows && (_jsx("p", { className: "px-4 pt-4 text-xs text-grey-04 dark:text-grey-07", children: "Parts of this block come from Page settings. Click one on the page to edit it." })), children] }));
|
|
123
|
+
return (_jsxs(_Fragment, { children: [_jsx(PageConflictFields, { blockId: blockId }), shows && (_jsx("p", { className: "px-4 pt-4 text-xs text-grey-04 dark:text-grey-07", children: "Parts of this block come from Page settings. Click one on the page to edit it." })), children] }));
|
|
123
124
|
};
|
|
124
125
|
//# sourceMappingURL=page-setting-targets.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page-setting-targets.js","sourceRoot":"","sources":["../../../../src/components/editor/page-setting-targets.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAkB,qBAAqB,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACrF,OAAO,EAAE,aAAa,EAAkB,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC/F,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"page-setting-targets.js","sourceRoot":"","sources":["../../../../src/components/editor/page-setting-targets.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAkB,qBAAqB,EAAE,UAA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IAAI,CAAC,OAAO;QAAE,OAAO,KAAK,CAAC;IACtC,OAAO,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CACrD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,uBAAuB,CAAC,EAAE,YAAY,CAAC,qBAAqB,CAAC,KAAK,OAAO,CACjG,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAwB,CAAC,EAAE,QAAQ,EAAE,YAAY,EAAE,EAAE,EAAE;IAC5F,MAAM,OAAO,GAAG,UAAU,CAAC,yBAAyB,CAAC,CAAC;IACtD,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAC7B,MAAM,OAAO,GAAuB,YAAY,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,iBAAiB,CAAC,YAAY,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;IACnH,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAE1C,8DAA8D;IAC9D,SAAS,CAAC,GAAG,EAAE;QACb,QAAQ,CAAC,sBAAsB,CAAC,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;IACrE,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;IAEvB,OAAO,CACL,8BACE,KAAC,kBAAkB,IAAC,OAAO,EAAE,OAAO,GAAI,EACvC,KAAK,IAAI,CACR,YAAG,SAAS,EAAC,kDAAkD,+FAE3D,CACL,EACA,QAAQ,IACR,CACJ,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -15,7 +15,22 @@ export declare const PREVIEW_UNAVAILABLE_TITLE = "Preview is not available for t
|
|
|
15
15
|
* branch's drafts and not another's), so it names the branch, never the whole
|
|
16
16
|
* site; it reassures that nothing they did is broken.
|
|
17
17
|
*/
|
|
18
|
-
export declare const PREVIEW_UNAVAILABLE_DETAIL = "
|
|
18
|
+
export declare const PREVIEW_UNAVAILABLE_DETAIL = "Preview is currently unavailable for this branch. Your draft is still saved, and publishing and the live site are unaffected.";
|
|
19
19
|
/** What the Preview control on a docs (MDX) page says until docs pages render drafts. */
|
|
20
20
|
export declare const DOCS_PREVIEW_UNAVAILABLE = "Full-page preview isn't available for docs pages yet";
|
|
21
|
+
/**
|
|
22
|
+
* The neutral next step when only an unavailable capability is known. A host's refusal carries its own next step,
|
|
23
|
+
* since confirmation or an upgrade may be needed instead. Names no host button: this editor also runs without one.
|
|
24
|
+
*/
|
|
25
|
+
export declare const PREVIEW_UNAVAILABLE_NEXT_STEP = "Choose Check again to ask the site for the current preview status.";
|
|
26
|
+
/** The toast action that asks the site again, instead of making the person reload the editor to find out. */
|
|
27
|
+
export declare const PREVIEW_CHECK_AGAIN = "Check again";
|
|
28
|
+
/** The toast action for a failure that is not about the site's setup. */
|
|
29
|
+
export declare const PREVIEW_TRY_AGAIN = "Try again";
|
|
30
|
+
/** The browser refused the preview tab: the site is fine, the browser needs to be told it may open one. */
|
|
31
|
+
export declare const PREVIEW_BLOCKED_TITLE = "Your browser blocked the preview tab";
|
|
32
|
+
export declare const PREVIEW_BLOCKED_DETAIL = "Allow pop-ups for this site, then try again.";
|
|
33
|
+
/** A genuine fault, which must not read as though the site is misconfigured. */
|
|
34
|
+
export declare const PREVIEW_FAILED_TITLE = "Could not open preview";
|
|
35
|
+
export declare const PREVIEW_FAILED_DETAIL = "Something went wrong creating the preview link. Please try again.";
|
|
21
36
|
//# sourceMappingURL=preview-availability.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preview-availability.d.ts","sourceRoot":"","sources":["../../../../src/components/editor/preview-availability.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,2DAA2D;AAC3D,eAAO,MAAM,yBAAyB,6CAA6C,CAAC;AAEpF;;;;;GAKG;AACH,eAAO,MAAM,0BAA0B,
|
|
1
|
+
{"version":3,"file":"preview-availability.d.ts","sourceRoot":"","sources":["../../../../src/components/editor/preview-availability.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,2DAA2D;AAC3D,eAAO,MAAM,yBAAyB,6CAA6C,CAAC;AAEpF;;;;;GAKG;AACH,eAAO,MAAM,0BAA0B,kIAC0F,CAAC;AAElI,yFAAyF;AACzF,eAAO,MAAM,wBAAwB,yDAAyD,CAAC;AAE/F;;;GAGG;AACH,eAAO,MAAM,6BAA6B,uEAAuE,CAAC;AAElH,6GAA6G;AAC7G,eAAO,MAAM,mBAAmB,gBAAgB,CAAC;AAEjD,yEAAyE;AACzE,eAAO,MAAM,iBAAiB,cAAc,CAAC;AAE7C,2GAA2G;AAC3G,eAAO,MAAM,qBAAqB,yCAAyC,CAAC;AAC5E,eAAO,MAAM,sBAAsB,iDAAiD,CAAC;AAErF,gFAAgF;AAChF,eAAO,MAAM,oBAAoB,2BAA2B,CAAC;AAC7D,eAAO,MAAM,qBAAqB,sEAAsE,CAAC"}
|
|
@@ -15,7 +15,22 @@ export const PREVIEW_UNAVAILABLE_TITLE = 'Preview is not available for this bran
|
|
|
15
15
|
* branch's drafts and not another's), so it names the branch, never the whole
|
|
16
16
|
* site; it reassures that nothing they did is broken.
|
|
17
17
|
*/
|
|
18
|
-
export const PREVIEW_UNAVAILABLE_DETAIL = '
|
|
18
|
+
export const PREVIEW_UNAVAILABLE_DETAIL = 'Preview is currently unavailable for this branch. Your draft is still saved, and publishing and the live site are unaffected.';
|
|
19
19
|
/** What the Preview control on a docs (MDX) page says until docs pages render drafts. */
|
|
20
20
|
export const DOCS_PREVIEW_UNAVAILABLE = "Full-page preview isn't available for docs pages yet";
|
|
21
|
+
/**
|
|
22
|
+
* The neutral next step when only an unavailable capability is known. A host's refusal carries its own next step,
|
|
23
|
+
* since confirmation or an upgrade may be needed instead. Names no host button: this editor also runs without one.
|
|
24
|
+
*/
|
|
25
|
+
export const PREVIEW_UNAVAILABLE_NEXT_STEP = 'Choose Check again to ask the site for the current preview status.';
|
|
26
|
+
/** The toast action that asks the site again, instead of making the person reload the editor to find out. */
|
|
27
|
+
export const PREVIEW_CHECK_AGAIN = 'Check again';
|
|
28
|
+
/** The toast action for a failure that is not about the site's setup. */
|
|
29
|
+
export const PREVIEW_TRY_AGAIN = 'Try again';
|
|
30
|
+
/** The browser refused the preview tab: the site is fine, the browser needs to be told it may open one. */
|
|
31
|
+
export const PREVIEW_BLOCKED_TITLE = 'Your browser blocked the preview tab';
|
|
32
|
+
export const PREVIEW_BLOCKED_DETAIL = 'Allow pop-ups for this site, then try again.';
|
|
33
|
+
/** A genuine fault, which must not read as though the site is misconfigured. */
|
|
34
|
+
export const PREVIEW_FAILED_TITLE = 'Could not open preview';
|
|
35
|
+
export const PREVIEW_FAILED_DETAIL = 'Something went wrong creating the preview link. Please try again.';
|
|
21
36
|
//# sourceMappingURL=preview-availability.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preview-availability.js","sourceRoot":"","sources":["../../../../src/components/editor/preview-availability.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,2DAA2D;AAC3D,MAAM,CAAC,MAAM,yBAAyB,GAAG,0CAA0C,CAAC;AAEpF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,0BAA0B,GACrC,
|
|
1
|
+
{"version":3,"file":"preview-availability.js","sourceRoot":"","sources":["../../../../src/components/editor/preview-availability.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,2DAA2D;AAC3D,MAAM,CAAC,MAAM,yBAAyB,GAAG,0CAA0C,CAAC;AAEpF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,0BAA0B,GACrC,+HAA+H,CAAC;AAElI,yFAAyF;AACzF,MAAM,CAAC,MAAM,wBAAwB,GAAG,sDAAsD,CAAC;AAE/F;;;GAGG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,oEAAoE,CAAC;AAElH,6GAA6G;AAC7G,MAAM,CAAC,MAAM,mBAAmB,GAAG,aAAa,CAAC;AAEjD,yEAAyE;AACzE,MAAM,CAAC,MAAM,iBAAiB,GAAG,WAAW,CAAC;AAE7C,2GAA2G;AAC3G,MAAM,CAAC,MAAM,qBAAqB,GAAG,sCAAsC,CAAC;AAC5E,MAAM,CAAC,MAAM,sBAAsB,GAAG,8CAA8C,CAAC;AAErF,gFAAgF;AAChF,MAAM,CAAC,MAAM,oBAAoB,GAAG,wBAAwB,CAAC;AAC7D,MAAM,CAAC,MAAM,qBAAqB,GAAG,mEAAmE,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { JsonValue } from '@conloca/mdx/render';
|
|
2
|
+
import type { MdxComponentField } from '../../mdx-components.js';
|
|
3
|
+
import type { FieldHint } from '../../page-schemas.js';
|
|
4
|
+
/** The `HintForm` control for a descriptor prop, so list and object props get structured fields. */
|
|
5
|
+
export declare function propFieldHint(prop: MdxComponentField): FieldHint;
|
|
6
|
+
export declare function emptyFieldValue(field: MdxComponentField): JsonValue;
|
|
7
|
+
/**
|
|
8
|
+
* The JSON a `HintForm` draft stands for: list items `HintForm`'s Add item leaves `undefined` become
|
|
9
|
+
* the field's empty value, keys a cleared input left `undefined` are dropped, and keys the descriptor
|
|
10
|
+
* does not declare are kept in place, so a no-op edit serializes to the same JSON.
|
|
11
|
+
*/
|
|
12
|
+
export declare function normalizeFieldValue(field: MdxComponentField, value: unknown): JsonValue;
|
|
13
|
+
//# sourceMappingURL=prop-field-hint.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prop-field-hint.d.ts","sourceRoot":"","sources":["../../../../src/components/editor/prop-field-hint.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAMvD,oGAAoG;AACpG,wBAAgB,aAAa,CAAC,IAAI,EAAE,iBAAiB,GAAG,SAAS,CAsBhE;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,iBAAiB,GAAG,SAAS,CAenE;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,iBAAiB,EAAE,KAAK,EAAE,OAAO,GAAG,SAAS,CAkBvF"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { isJsonValue } from '../../live/messages.js';
|
|
2
|
+
function unknownField(field) {
|
|
3
|
+
throw new Error(`Unknown prop type ${JSON.stringify(field)}`);
|
|
4
|
+
}
|
|
5
|
+
/** The `HintForm` control for a descriptor prop, so list and object props get structured fields. */
|
|
6
|
+
export function propFieldHint(prop) {
|
|
7
|
+
const common = { label: prop.label, help: prop.help };
|
|
8
|
+
switch (prop.type) {
|
|
9
|
+
case 'list':
|
|
10
|
+
return { ...common, control: 'array', of: propFieldHint(prop.of) };
|
|
11
|
+
case 'object':
|
|
12
|
+
return {
|
|
13
|
+
...common,
|
|
14
|
+
control: 'object',
|
|
15
|
+
fields: Object.fromEntries(Object.entries(prop.fields).map(([key, field]) => [key, propFieldHint(field)])),
|
|
16
|
+
};
|
|
17
|
+
case 'string':
|
|
18
|
+
return prop.options?.length
|
|
19
|
+
? { ...common, control: 'select', options: prop.options }
|
|
20
|
+
: { ...common, control: 'text' };
|
|
21
|
+
case 'number':
|
|
22
|
+
return { ...common, control: 'number' };
|
|
23
|
+
case 'boolean':
|
|
24
|
+
return { ...common, control: 'switch' };
|
|
25
|
+
default:
|
|
26
|
+
return unknownField(prop);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
export function emptyFieldValue(field) {
|
|
30
|
+
switch (field.type) {
|
|
31
|
+
case 'object':
|
|
32
|
+
return {};
|
|
33
|
+
case 'list':
|
|
34
|
+
return [];
|
|
35
|
+
case 'string':
|
|
36
|
+
return '';
|
|
37
|
+
case 'number':
|
|
38
|
+
return 0;
|
|
39
|
+
case 'boolean':
|
|
40
|
+
return false;
|
|
41
|
+
default:
|
|
42
|
+
return unknownField(field);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* The JSON a `HintForm` draft stands for: list items `HintForm`'s Add item leaves `undefined` become
|
|
47
|
+
* the field's empty value, keys a cleared input left `undefined` are dropped, and keys the descriptor
|
|
48
|
+
* does not declare are kept in place, so a no-op edit serializes to the same JSON.
|
|
49
|
+
*/
|
|
50
|
+
export function normalizeFieldValue(field, value) {
|
|
51
|
+
if (field.type === 'list') {
|
|
52
|
+
return Array.isArray(value)
|
|
53
|
+
? value.map((item) => (item === undefined ? emptyFieldValue(field.of) : normalizeFieldValue(field.of, item)))
|
|
54
|
+
: [];
|
|
55
|
+
}
|
|
56
|
+
if (field.type === 'object') {
|
|
57
|
+
if (value === null || typeof value !== 'object' || Array.isArray(value))
|
|
58
|
+
return {};
|
|
59
|
+
return Object.fromEntries(Object.entries(value).flatMap(([key, v]) => {
|
|
60
|
+
if (v === undefined)
|
|
61
|
+
return [];
|
|
62
|
+
const sub = Object.keys(field.fields).includes(key) ? field.fields[key] : undefined;
|
|
63
|
+
if (sub)
|
|
64
|
+
return [[key, normalizeFieldValue(sub, v)]];
|
|
65
|
+
return isJsonValue(v) ? [[key, v]] : [];
|
|
66
|
+
}));
|
|
67
|
+
}
|
|
68
|
+
return isJsonValue(value) ? value : emptyFieldValue(field);
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=prop-field-hint.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prop-field-hint.js","sourceRoot":"","sources":["../../../../src/components/editor/prop-field-hint.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAIrD,SAAS,YAAY,CAAC,KAAY;IAChC,MAAM,IAAI,KAAK,CAAC,qBAAqB,IAA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C,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;YACpF,IAAI,GAAG;gBAAE,OAAO,CAAC,CAAC,GAAG,EAAE,mBAAmB,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;YACrD,OAAO,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAC1C,CAAC,CAAC,CACH,CAAC;IACJ,CAAC;IACD,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;AAC7D,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type EditorConfig, TextNode } from 'lexical';
|
|
2
|
+
/**
|
|
3
|
+
* A source line ending inside a paragraph (a soft break). Its text stays the line ending, so the stock text export
|
|
4
|
+
* writes the paragraph back byte for byte; only its span collapses that ending to a space, the way the published page
|
|
5
|
+
* shows it, where the editable's `pre-wrap` would draw it as a line break.
|
|
6
|
+
*/
|
|
7
|
+
export declare class SoftBreakNode extends TextNode {
|
|
8
|
+
$config(): import("lexical").BaseStaticNodeConfig & {
|
|
9
|
+
readonly "conloca-soft-break"?: {
|
|
10
|
+
readonly extends: typeof TextNode;
|
|
11
|
+
} | undefined;
|
|
12
|
+
} & import("lexical").StaticNodeTypeAccessor<"conloca-soft-break"> & import("lexical").StaticNodeConfigAccessor<{
|
|
13
|
+
readonly extends: typeof TextNode;
|
|
14
|
+
}>;
|
|
15
|
+
createDOM(config: EditorConfig): HTMLElement;
|
|
16
|
+
canInsertTextBefore(): boolean;
|
|
17
|
+
canInsertTextAfter(): boolean;
|
|
18
|
+
}
|
|
19
|
+
/** Shows a paragraph's source line endings as the spaces the published page shows. */
|
|
20
|
+
export declare const softBreakPlugin: (params?: unknown) => import("@mdxeditor/editor").RealmPlugin;
|
|
21
|
+
//# sourceMappingURL=soft-break-plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"soft-break-plugin.d.ts","sourceRoot":"","sources":["../../../../src/components/editor/soft-break-plugin.ts"],"names":[],"mappings":"AACA,OAAO,EAA4C,KAAK,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAGhG;;;;GAIG;AACH,qBAAa,aAAc,SAAQ,QAAQ;IAChC,OAAO;;;;;;OAEf;IAEQ,SAAS,CAAC,MAAM,EAAE,YAAY,GAAG,WAAW,CAIpD;IAGQ,mBAAmB,IAAI,OAAO,CAEtC;IAEQ,kBAAkB,IAAI,OAAO,CAErC;CACF;AAqBD,sFAAsF;AACtF,eAAO,MAAM,eAAe,+DAI1B,CAAC"}
|