@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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mdx-components-define.js","sourceRoot":"","sources":["../../src/mdx-components-define.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mdx-components-define.js","sourceRoot":"","sources":["../../src/mdx-components-define.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAA6C,YAAY,EAAE,MAAM,qBAAqB,CAAC;AA8I9F,iEAAiE;AACjE,MAAM,UAAU,eAAe,CAAC,CAAyB;IACvD,OAAO,CAAC,CAAC,IAAI,KAAK,MAAM,IAAI,CAAC,CAAC,IAAI,KAAK,MAAM,CAAC;AAChD,CAAC;AAED,qDAAqD;AACrD,MAAM,UAAU,mBAAmB,CAAC,CAAyB;IAC3D,OAAO,CAAC,CAAC,IAAI,KAAK,SAAS,CAAC;AAC9B,CAAC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,4BAA4B,CAC1C,YAA2B,EAC3B,UAAyB,EACzB,QAAQ,GAAwB,IAAI,GAAG,EAAE;IAEzC,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,YAAY,CAAC;IACjD,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,UAAU,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC;IACtF,MAAM,IAAI,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC9G,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC;IACrE,MAAM,MAAM,GAAG,YAAY,CAAC,M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';
|
|
|
14
14
|
*
|
|
15
15
|
* Snippet descriptors are not JSX — call sites filter them out before
|
|
16
16
|
* dispatching here. Passing one throws to surface the misuse loudly.
|
|
17
|
+
*
|
|
18
|
+
* `withImport: false` drops the import a save would emit: a fragment's
|
|
19
|
+
* components come from the site's vocabulary, never from an import.
|
|
17
20
|
*/
|
|
18
|
-
export declare function toJsxComponentDescriptor(d: MdxComponentDescriptor, fallbackEditor: ComponentType<JsxEditorProps
|
|
21
|
+
export declare function toJsxComponentDescriptor(d: MdxComponentDescriptor, fallbackEditor: ComponentType<JsxEditorProps>, { withImport }?: {
|
|
22
|
+
withImport: boolean;
|
|
23
|
+
}): JsxComponentDescriptor;
|
|
19
24
|
/**
|
|
20
25
|
* Replace the registered MDX components. Called by the virtual module that
|
|
21
26
|
* loads the host's `schemas.ts`. Notifies subscribers so the editor picks
|
|
@@ -33,28 +38,15 @@ export declare function getMdxComponents(): MdxComponents;
|
|
|
33
38
|
* settled last overwrote the other's entries — discovered components
|
|
34
39
|
* vanished whenever the fetch won the race. Each producer now writes its
|
|
35
40
|
* own remembered slot and the registry is recomputed as the merge of both,
|
|
36
|
-
* so settle order stops mattering.
|
|
37
|
-
*
|
|
38
|
-
*
|
|
41
|
+
* so settle order stops mattering. An editor embedding the CMS installs
|
|
42
|
+
* through the same two slots.
|
|
43
|
+
*
|
|
44
|
+
* The merge keeps host-authored entries for the current site render's
|
|
45
|
+
* fragment vocabulary names, and is redone whenever the site render changes.
|
|
39
46
|
*/
|
|
40
47
|
export declare function installHostAuthoredMdxComponents(components: MdxComponents): void;
|
|
41
48
|
/** Install the auto-discovered descriptor list — see `installHostAuthoredMdxComponents`. */
|
|
42
49
|
export declare function installDiscoveredMdxComponents(components: MdxComponents): void;
|
|
43
|
-
/**
|
|
44
|
-
* Merge auto-discovered descriptors over host-authored ones.
|
|
45
|
-
*
|
|
46
|
-
* Discovered entries win on a name collision: they are derived from the
|
|
47
|
-
* source of truth (the MDX files and component folders themselves), while a
|
|
48
|
-
* hand-written list can lag. ONE rule for every caller — the dev SPA merges
|
|
49
|
-
* the `/api/registry` response over the `schemasPath` exports, and a host app
|
|
50
|
-
* merges the same two lists from what it supplies.
|
|
51
|
-
*
|
|
52
|
-
* Host survivors keep their relative order and discovered entries append
|
|
53
|
-
* after them, so a colliding entry surfaces at its discovered position, not
|
|
54
|
-
* its host slot. Inputs are assumed unique-by-name — that validation lives
|
|
55
|
-
* in `defineMdxComponents` and the discovery merge, not here.
|
|
56
|
-
*/
|
|
57
|
-
export declare function mergeDiscoveredMdxComponents(hostAuthored: MdxComponents, discovered: MdxComponents): MdxComponents;
|
|
58
50
|
/**
|
|
59
51
|
* React hook subscribing to registry changes. Returns the current array and
|
|
60
52
|
* updates on HMR.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mdx-components.d.ts","sourceRoot":"","sources":["../../src/mdx-components.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAChF,OAAO,EAAE,KAAK,aAAa,EAAuB,MAAM,OAAO,CAAC;AAChE,OAAO,
|
|
1
|
+
{"version":3,"file":"mdx-components.d.ts","sourceRoot":"","sources":["../../src/mdx-components.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAChF,OAAO,EAAE,KAAK,aAAa,EAAuB,MAAM,OAAO,CAAC;AAChE,OAAO,EAEL,KAAK,sBAAsB,EAC3B,KAAK,aAAa,EAEnB,MAAM,4BAA4B,CAAC;AAOpC,cAAc,4BAA4B,CAAC;AAE3C;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,wBAAwB,CACtC,CAAC,EAAE,sBAAsB,EACzB,cAAc,EAAE,aAAa,CAAC,cAAc,CAAC,EAC7C,EAAE,UAAU,EAAE,GAAE;IAAE,UAAU,EAAE,OAAO,CAAA;CAAyB,GAC7D,sBAAsB,CAgBxB;AA4BD;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,aAAa,GAAG,IAAI,CAMhE;AAED,+CAA+C;AAC/C,wBAAgB,gBAAgB,IAAI,aAAa,CAEhD;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,gCAAgC,CAAC,UAAU,EAAE,aAAa,GAAG,IAAI,CAGhF;AAED,4FAA4F;AAC5F,wBAAgB,8BAA8B,CAAC,UAAU,EAAE,aAAa,GAAG,IAAI,CAG9E;AAWD;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,aAAa,CAehD"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { useEffect, useState } from 'react';
|
|
2
|
-
import { isJsxDescriptor } from './mdx-components-define.js';
|
|
2
|
+
import { isJsxDescriptor, mergeDiscoveredMdxComponents, } from './mdx-components-define.js';
|
|
3
|
+
import { getSiteRender, subscribeSiteRender } from './site-render.js';
|
|
3
4
|
// The declaration surface (types, defineMdxComponents, the attribute
|
|
4
5
|
// helpers) lives in mdx-components-define — editor-free so content configs
|
|
5
6
|
// and bare test runners can evaluate it. Re-exported here so existing
|
|
@@ -17,8 +18,11 @@ export * from './mdx-components-define.js';
|
|
|
17
18
|
*
|
|
18
19
|
* Snippet descriptors are not JSX — call sites filter them out before
|
|
19
20
|
* dispatching here. Passing one throws to surface the misuse loudly.
|
|
21
|
+
*
|
|
22
|
+
* `withImport: false` drops the import a save would emit: a fragment's
|
|
23
|
+
* components come from the site's vocabulary, never from an import.
|
|
20
24
|
*/
|
|
21
|
-
export function toJsxComponentDescriptor(d, fallbackEditor) {
|
|
25
|
+
export function toJsxComponentDescriptor(d, fallbackEditor, { withImport } = { withImport: true }) {
|
|
22
26
|
if (!isJsxDescriptor(d)) {
|
|
23
27
|
throw new Error(`toJsxComponentDescriptor: '${d.name}' is a snippet, not a JSX component.`);
|
|
24
28
|
}
|
|
@@ -27,12 +31,12 @@ export function toJsxComponentDescriptor(d, fallbackEditor) {
|
|
|
27
31
|
kind: d.kind,
|
|
28
32
|
props: (d.props ?? []).map((p) => ({
|
|
29
33
|
name: p.name,
|
|
30
|
-
type: p.type === '
|
|
34
|
+
type: p.type === 'string' || p.type === 'number' ? p.type : 'expression',
|
|
31
35
|
required: p.required,
|
|
32
36
|
})),
|
|
33
37
|
hasChildren: d.hasChildren,
|
|
34
38
|
Editor: d.Editor ?? fallbackEditor,
|
|
35
|
-
...(d.import ? { source: d.import.from, defaultExport: d.import.default ?? false } : {}),
|
|
39
|
+
...(withImport && d.import ? { source: d.import.from, defaultExport: d.import.default ?? false } : {}),
|
|
36
40
|
};
|
|
37
41
|
}
|
|
38
42
|
const getSharedState = () => {
|
|
@@ -73,40 +77,27 @@ export function getMdxComponents() {
|
|
|
73
77
|
* settled last overwrote the other's entries — discovered components
|
|
74
78
|
* vanished whenever the fetch won the race. Each producer now writes its
|
|
75
79
|
* own remembered slot and the registry is recomputed as the merge of both,
|
|
76
|
-
* so settle order stops mattering.
|
|
77
|
-
*
|
|
78
|
-
*
|
|
80
|
+
* so settle order stops mattering. An editor embedding the CMS installs
|
|
81
|
+
* through the same two slots.
|
|
82
|
+
*
|
|
83
|
+
* The merge keeps host-authored entries for the current site render's
|
|
84
|
+
* fragment vocabulary names, and is redone whenever the site render changes.
|
|
79
85
|
*/
|
|
80
86
|
export function installHostAuthoredMdxComponents(components) {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
setMdxComponents(mergeDiscoveredMdxComponents(components, state.discovered ?? []));
|
|
87
|
+
getSharedState().hostAuthored = components;
|
|
88
|
+
remerge();
|
|
84
89
|
}
|
|
85
90
|
/** Install the auto-discovered descriptor list — see `installHostAuthoredMdxComponents`. */
|
|
86
91
|
export function installDiscoveredMdxComponents(components) {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
setMdxComponents(mergeDiscoveredMdxComponents(state.hostAuthored ?? [], components));
|
|
92
|
+
getSharedState().discovered = components;
|
|
93
|
+
remerge();
|
|
90
94
|
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
* the `/api/registry` response over the `schemasPath` exports, and a host app
|
|
98
|
-
* merges the same two lists from what it supplies.
|
|
99
|
-
*
|
|
100
|
-
* Host survivors keep their relative order and discovered entries append
|
|
101
|
-
* after them, so a colliding entry surfaces at its discovered position, not
|
|
102
|
-
* its host slot. Inputs are assumed unique-by-name — that validation lives
|
|
103
|
-
* in `defineMdxComponents` and the discovery merge, not here.
|
|
104
|
-
*/
|
|
105
|
-
export function mergeDiscoveredMdxComponents(hostAuthored, discovered) {
|
|
106
|
-
if (discovered.length === 0)
|
|
107
|
-
return hostAuthored;
|
|
108
|
-
const discoveredNames = new Set(discovered.map((descriptor) => descriptor.name));
|
|
109
|
-
return [...hostAuthored.filter((descriptor) => !discoveredNames.has(descriptor.name)), ...discovered];
|
|
95
|
+
let unsubscribeSiteRender;
|
|
96
|
+
function remerge() {
|
|
97
|
+
unsubscribeSiteRender ??= subscribeSiteRender(remerge);
|
|
98
|
+
const state = getSharedState();
|
|
99
|
+
const hostWins = new Set(Object.keys(getSiteRender().vocabulary.components));
|
|
100
|
+
setMdxComponents(mergeDiscoveredMdxComponents(state.hostAuthored ?? [], state.discovered ?? [], hostWins));
|
|
110
101
|
}
|
|
111
102
|
/**
|
|
112
103
|
* React hook subscribing to registry changes. Returns the current array and
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mdx-components.js","sourceRoot":"","sources":["../../src/mdx-components.ts"],"names":[],"mappings":"AACA,OAAO,EAAsB,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAChE,OAAO,
|
|
1
|
+
{"version":3,"file":"mdx-components.js","sourceRoot":"","sources":["../../src/mdx-components.ts"],"names":[],"mappings":"AACA,OAAO,EAAsB,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAChE,OAAO,EACL,eAAe,EAGf,4BAA4B,GAC7B,MAAM,4BAA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QAAQ,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC;IAC7E,gBAAgB,CAAC,4BAA4B,CAAC,KAAK,CAAC,YAAY,IAAI,EAAE,EAAE,KAAK,CAAC,UAAU,IAAI,EAAE,EAAE,QAAQ,CAAC,CAAC,CAAC;AAC7G,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,gBAAgB;IAC9B,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAC,cAAc,EAAE,CAAC,UAAU,CAAC,CAAC;IAEhF,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,KAAK,GAAG,cAAc,EAAE,CAAC;QAC/B,IAAI,KAAK,CAAC,UAAU,KAAK,UAAU,EAAE,CAAC;YACpC,aAAa,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;QAClC,CAAC;QACD,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;QACrC,OAAO,GAAG,EAAE;YACV,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;QAC1C,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;IAEjB,OAAO,UAAU,CAAC;AACpB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssetScopePill.d.ts","sourceRoot":"","sources":["../../../src/media/AssetScopePill.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AssetScopePill.d.ts","sourceRoot":"","sources":["../../../src/media/AssetScopePill.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C,UAAU,mBAAmB;IAC3B,KAAK,EAAE,UAAU,GAAG,IAAI,CAAC;IACzB;;;OAGG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,cAAc,CAAC,EAAE,KAAK,EAAE,IAAW,EAAE,SAAS,EAAE,EAAE,mBAAmB,sCAyBpF"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { pageStatusLabel } from '../ui-config.js';
|
|
2
3
|
import { cn } from '../utils/cn.js';
|
|
3
4
|
/**
|
|
4
5
|
* Pill rendering a host-supplied `AssetScope` ("Branch only" /
|
|
@@ -21,7 +22,7 @@ export function AssetScopePill({ scope, size = 'sm', className }) {
|
|
|
21
22
|
if (!scope)
|
|
22
23
|
return null;
|
|
23
24
|
const isBranch = scope === 'branch';
|
|
24
|
-
const label = isBranch ? 'Branch only' : 'Published';
|
|
25
|
+
const label = isBranch ? 'Branch only' : pageStatusLabel('published', 'Published');
|
|
25
26
|
const sizeClasses = size === 'sm' ? 'text-[10px] px-1.5 py-0.5 leading-tight' : 'text-xs px-2 py-0.5';
|
|
26
27
|
const variantClasses = isBranch
|
|
27
28
|
? 'bg-yellow-11 dark:bg-yellow-02 text-yellow-04 dark:text-yellow-09 border-yellow-08 dark:border-yellow-03'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssetScopePill.js","sourceRoot":"","sources":["../../../src/media/AssetScopePill.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AAapC;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,cAAc,CAAC,EAAE,KAAK,EAAE,IAAI,GAAG,IAAI,EAAE,SAAS,EAAuB;IACnF,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAC;IAExB,MAAM,QAAQ,GAAG,KAAK,KAAK,QAAQ,CAAC;IACpC,MAAM,KAAK,GAAG,QAAQ,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"AssetScopePill.js","sourceRoot":"","sources":["../../../src/media/AssetScopePill.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AAapC;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,cAAc,CAAC,EAAE,KAAK,EAAE,IAAI,GAAG,IAAI,EAAE,SAAS,EAAuB;IACnF,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAC;IAExB,MAAM,QAAQ,GAAG,KAAK,KAAK,QAAQ,CAAC;IACpC,MAAM,KAAK,GAAG,QAAQ,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,eAAe,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;IACnF,MAAM,WAAW,GAAG,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,yCAAyC,CAAC,CAAC,CAAC,qBAAqB,CAAC;IAEtG,MAAM,cAAc,GAAG,QAAQ;QAC7B,CAAC,CAAC,0GAA0G;QAC5G,CAAC,CAAC,oGAAoG,CAAC;IAEzG,OAAO,CACL,eACE,IAAI,EAAC,QAAQ,gBACD,gBAAgB,KAAK,EAAE,EACnC,SAAS,EAAE,EAAE,CACX,6EAA6E,EAC7E,WAAW,EACX,cAAc,EACd,SAAS,CACV,YAEA,KAAK,GACD,CACR,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"merge-default-props.d.ts","sourceRoot":"","sources":["../../src/merge-default-props.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAA0C,MAAM,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAE7F;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"merge-default-props.d.ts","sourceRoot":"","sources":["../../src/merge-default-props.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAA0C,MAAM,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAE7F;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAuClE"}
|
|
@@ -42,8 +42,11 @@ export function mergeDefaultProps(data, config) {
|
|
|
42
42
|
mergedZones[zoneKey] = zoneContent.map(mergeComponentProps);
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
|
+
// Root's defaultProps go under its props as Puck fills them in on load (`root.props || root`).
|
|
46
|
+
const rootDefaults = config.root?.defaultProps;
|
|
45
47
|
return {
|
|
46
48
|
...data,
|
|
49
|
+
...(rootDefaults && { root: { ...data.root, props: { ...rootDefaults, ...(data.root?.props ?? data.root) } } }),
|
|
47
50
|
content: mergedContent,
|
|
48
51
|
...(mergedZones && { zones: mergedZones }),
|
|
49
52
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"merge-default-props.js","sourceRoot":"","sources":["../../src/merge-default-props.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,iBAAiB,CAAC,IAAU,EAAE,MAAc;IAC1D,IAAI,CAAC,IAAI,EAAE,OAAO,IAAI,CAAC,MAAM,EAAE,UAAU;QAAE,OAAO,IAAI,CAAC;IAEvD,MAAM,mBAAmB,GAAG,CAAC,IAAmB,EAAiB,EAAE;QACjE,MAAM,eAAe,GAAG,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACrD,IAAI,CAAC,eAAe;YAAE,OAAO,IAAI,CAAC;QAElC,MAAM,KAAK,GAAG,EAAE,GAAG,eAAe,CAAC,YAAY,EAAE,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC;QACjE,KAAK,M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AC,GAAG,CAAC,mBAAmB,CAAC,CAAC;IAE5D,IAAI,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC;IAC7B,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;QACf,WAAW,GAAG,EAAE,CAAC;QACjB,KAAK,MAAM,CAAC,OAAO,EAAE,WAAW,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;YAChE,WAAW,CAAC,OAAO,CAAC,GAAG,WAAW,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;QAC9D,CAAC;IACH,CAAC;IAED,+FAA+F;IAC/F,MAAM,YAAY,GAAG,MAAM,CAAC,IAAI,EAAE,YAAY,CAAC;IAE/C,OAAO;QACL,GAAG,IAAI;QACP,GAAG,CAAC,YAAY,IAAI,EAAE,IAAI,EAAE,EAAE,GAAG,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,GAAG,YAAY,EAAE,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,IAAI,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,CAAC;QAC/G,OAAO,EAAE,aAAa;QACtB,GAAG,CAAC,WAAW,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC;KAC3C,CAAC;AACJ,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { JsonValue } from '@conloca/mdx/render';
|
|
1
2
|
import type { MdxJsxComponentDescriptor } from './mdx-components.js';
|
|
2
3
|
/**
|
|
3
4
|
* Shared registry of the currently-selected MDX JSX block in the editor.
|
|
@@ -31,17 +32,22 @@ export interface SelectedBlock {
|
|
|
31
32
|
attrs: Record<string, unknown>;
|
|
32
33
|
/** Apply a prop change. Wrapped by the owning block over its updater.
|
|
33
34
|
* Accepts strings (text props), booleans (checkbox props), numbers
|
|
34
|
-
* (numeric inputs),
|
|
35
|
+
* (numeric inputs), lists and objects (JSON expressions), or
|
|
36
|
+
* `null`/`undefined` (remove the attribute).
|
|
35
37
|
* The block routes the value through `writeAttribute` which picks
|
|
36
38
|
* the right mdast shape — string literal, JSX shorthand, or
|
|
37
39
|
* expression. */
|
|
38
|
-
onPropChange: (name: string, value:
|
|
40
|
+
onPropChange: (name: string, value: JsonValue | null | undefined) => void;
|
|
39
41
|
/** Remove the block from the document. */
|
|
40
42
|
onRemove: () => void;
|
|
41
43
|
}
|
|
42
44
|
interface SharedState {
|
|
43
45
|
selected: SelectedBlock | null;
|
|
44
46
|
subscribers: Set<(next: SelectedBlock | null) => void>;
|
|
47
|
+
/** Optional: state made by an older copy of this module has none. */
|
|
48
|
+
drafts?: Set<() => void>;
|
|
49
|
+
/** Co-editing bindings open now (see `markLiveEditing`); optional as `drafts` is. */
|
|
50
|
+
live?: number;
|
|
45
51
|
}
|
|
46
52
|
declare global {
|
|
47
53
|
interface Window {
|
|
@@ -57,5 +63,24 @@ export declare function getSelectedBlock(): SelectedBlock | null;
|
|
|
57
63
|
* when nothing is selected.
|
|
58
64
|
*/
|
|
59
65
|
export declare function useSelectedBlock(): SelectedBlock | null;
|
|
66
|
+
/**
|
|
67
|
+
* Registers a field's commit while it may hold typed text that commits only when the field is left (the side panel's
|
|
68
|
+
* fields, a block's inline prop fields, and its list-item fields off co-editing). The co-editing binding commits them
|
|
69
|
+
* all before a teammate's change rebuilds the block they write to, and before the editor closes. `commit` must do
|
|
70
|
+
* nothing when nothing is typed.
|
|
71
|
+
* Returns the release.
|
|
72
|
+
*/
|
|
73
|
+
export declare function trackDraft(commit: () => void): () => void;
|
|
74
|
+
/** Commits every tracked draft; see `trackDraft`. */
|
|
75
|
+
export declare function commitDrafts(): void;
|
|
76
|
+
/** `trackDraft` for a React field: its latest `commit` stays tracked while it is mounted. */
|
|
77
|
+
export declare function useTrackedDraft(commit: () => void): void;
|
|
78
|
+
/**
|
|
79
|
+
* Marks the editor as co-edited while its binding is open: list items then write as they are typed, so teammates see
|
|
80
|
+
* it and no way out of the page drops it. Otherwise they write once the item is left, one undo step per visit.
|
|
81
|
+
* Returns the release.
|
|
82
|
+
*/
|
|
83
|
+
export declare function markLiveEditing(): () => void;
|
|
84
|
+
export declare function isLiveEditing(): boolean;
|
|
60
85
|
export {};
|
|
61
86
|
//# sourceMappingURL=selected-block.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selected-block.d.ts","sourceRoot":"","sources":["../../src/selected-block.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"selected-block.d.ts","sourceRoot":"","sources":["../../src/selected-block.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAErE;;;;;;;;;;;;;;;;;GAiBG;AAEH,MAAM,WAAW,aAAa;IAC5B;;;0EAGsE;IACtE,GAAG,EAAE,MAAM,CAAC;IACZ,wDAAwD;IACxD,IAAI,EAAE,MAAM,CAAC;IACb,4CAA4C;IAC5C,UAAU,EAAE,yBAAyB,CAAC;IACtC,oDAAoD;IACpD,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B;;;;;;qBAMiB;IACjB,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,GAAG,IAAI,GAAG,SAAS,KAAK,IAAI,CAAC;IAC1E,0CAA0C;IAC1C,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,UAAU,WAAW;IACnB,QAAQ,EAAE,aAAa,GAAG,IAAI,CAAC;IAC/B,WAAW,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,aAAa,GAAG,IAAI,KAAK,IAAI,CAAC,CAAC;IACvD,qEAAqE;IACrE,MAAM,CAAC,EAAE,GAAG,CAAC,MAAM,IAAI,CAAC,CAAC;IACzB,qFAAqF;IACrF,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,0BAA0B,CAAC,EAAE,WAAW,CAAC;KAC1C;CACF;AAmCD,kEAAkE;AAClE,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,aAAa,GAAG,IAAI,GAAG,IAAI,CAMjE;AAED,0BAA0B;AAC1B,wBAAgB,gBAAgB,IAAI,aAAa,GAAG,IAAI,CAEvD;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,aAAa,GAAG,IAAI,CAavD;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAQzD;AAED,qDAAqD;AACrD,wBAAgB,YAAY,IAAI,IAAI,CAEnC;AAED,6FAA6F;AAC7F,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,IAAI,GAAG,IAAI,CAIxD;AAED;;;;GAIG;AACH,wBAAgB,eAAe,IAAI,MAAM,IAAI,CAM5C;AAED,wBAAgB,aAAa,IAAI,OAAO,CAEvC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useEffect, useState } from 'react';
|
|
1
|
+
import { useEffect, useRef, useState } from 'react';
|
|
2
2
|
/**
|
|
3
3
|
* When the editor mounts in the parent SPA tree, the block lives
|
|
4
4
|
* in the iframe's window but the side panel reading the selection
|
|
@@ -62,4 +62,46 @@ export function useSelectedBlock() {
|
|
|
62
62
|
}, [selected]);
|
|
63
63
|
return selected;
|
|
64
64
|
}
|
|
65
|
+
/**
|
|
66
|
+
* Registers a field's commit while it may hold typed text that commits only when the field is left (the side panel's
|
|
67
|
+
* fields, a block's inline prop fields, and its list-item fields off co-editing). The co-editing binding commits them
|
|
68
|
+
* all before a teammate's change rebuilds the block they write to, and before the editor closes. `commit` must do
|
|
69
|
+
* nothing when nothing is typed.
|
|
70
|
+
* Returns the release.
|
|
71
|
+
*/
|
|
72
|
+
export function trackDraft(commit) {
|
|
73
|
+
const state = getState();
|
|
74
|
+
state.drafts ??= new Set();
|
|
75
|
+
const drafts = state.drafts;
|
|
76
|
+
drafts.add(commit);
|
|
77
|
+
return () => {
|
|
78
|
+
drafts.delete(commit);
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
/** Commits every tracked draft; see `trackDraft`. */
|
|
82
|
+
export function commitDrafts() {
|
|
83
|
+
for (const commit of getState().drafts ?? [])
|
|
84
|
+
commit();
|
|
85
|
+
}
|
|
86
|
+
/** `trackDraft` for a React field: its latest `commit` stays tracked while it is mounted. */
|
|
87
|
+
export function useTrackedDraft(commit) {
|
|
88
|
+
const latest = useRef(commit);
|
|
89
|
+
latest.current = commit;
|
|
90
|
+
useEffect(() => trackDraft(() => latest.current()), []);
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Marks the editor as co-edited while its binding is open: list items then write as they are typed, so teammates see
|
|
94
|
+
* it and no way out of the page drops it. Otherwise they write once the item is left, one undo step per visit.
|
|
95
|
+
* Returns the release.
|
|
96
|
+
*/
|
|
97
|
+
export function markLiveEditing() {
|
|
98
|
+
const state = getState();
|
|
99
|
+
state.live = (state.live ?? 0) + 1;
|
|
100
|
+
return () => {
|
|
101
|
+
state.live = (state.live ?? 1) - 1;
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
export function isLiveEditing() {
|
|
105
|
+
return (getState().live ?? 0) > 0;
|
|
106
|
+
}
|
|
65
107
|
//# sourceMappingURL=selected-block.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selected-block.js","sourceRoot":"","sources":["../../src/selected-block.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"selected-block.js","sourceRoot":"","sources":["../../src/selected-block.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AA6DpD;;;;;;;;GAQG;AACH,SAAS,eAAe;IACtB,IAAI,OAAO,MAAM,KAAK,WAAW;QAAE,OAAO,SAAS,CAAC;IACp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,UAAU,eAAe;IAC7B,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;IACzB,KAAK,CAAC,IAAI,GAAG,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;IACnC,OAAO,GAAG,EAAE;QACV,KAAK,CAAC,IAAI,GAAG,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;IACrC,CAAC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,aAAa;IAC3B,OAAO,CAAC,QAAQ,EAAE,CAAC,IAAI,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;AACpC,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { MDXHeading as FragmentHeading } from '@conloca/content-api';
|
|
2
|
+
import { type FragmentOutlineComponent, type FragmentVocabulary } from '@conloca/mdx/render';
|
|
3
|
+
import { type ComponentType, type ReactNode } from 'react';
|
|
4
|
+
/**
|
|
5
|
+
* The site's own fragment renderer, vocabulary and editor frames, so the
|
|
6
|
+
* inline canvas renders a fragment with the site's components and its copy of
|
|
7
|
+
* the renderer. The dev entry (`${cmsRoute}/site-render-entry.js`) sets it from
|
|
8
|
+
* the site's modules; until then the editor's own renderer and an empty
|
|
9
|
+
* vocabulary stand in.
|
|
10
|
+
*
|
|
11
|
+
* Uses window so virtual modules and bundled code share the same state.
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* What a fragment renderer returns. `componentOutline` is optional because a
|
|
15
|
+
* site's own renderer may be a copy of `@conloca/mdx` from before it existed.
|
|
16
|
+
*/
|
|
17
|
+
export interface EvaluatedFragment {
|
|
18
|
+
Component: ComponentType | null;
|
|
19
|
+
error?: Error;
|
|
20
|
+
outline: readonly FragmentHeading[];
|
|
21
|
+
componentOutline?: readonly FragmentOutlineComponent[];
|
|
22
|
+
}
|
|
23
|
+
export type FragmentEvaluate = (mdx: string, vocabulary?: FragmentVocabulary) => Promise<EvaluatedFragment>;
|
|
24
|
+
export type EditorFrame = ComponentType<{
|
|
25
|
+
pathname: string;
|
|
26
|
+
children: ReactNode;
|
|
27
|
+
}>;
|
|
28
|
+
export interface SiteRender {
|
|
29
|
+
evaluate: FragmentEvaluate;
|
|
30
|
+
vocabulary: FragmentVocabulary;
|
|
31
|
+
frames: Readonly<Record<string, EditorFrame>>;
|
|
32
|
+
source: 'site' | 'editor';
|
|
33
|
+
}
|
|
34
|
+
interface SharedSiteRenderState {
|
|
35
|
+
render: SiteRender;
|
|
36
|
+
subscribers: Set<(render: SiteRender) => void>;
|
|
37
|
+
}
|
|
38
|
+
declare global {
|
|
39
|
+
interface Window {
|
|
40
|
+
__SITE_RENDER_STATE__?: SharedSiteRenderState;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Register the site's render inputs. Each field is checked by shape, since it
|
|
45
|
+
* comes from site code: a malformed one is replaced by the fallback and named
|
|
46
|
+
* in one warning.
|
|
47
|
+
*/
|
|
48
|
+
export declare function setSiteRender(input: {
|
|
49
|
+
evaluate?: unknown;
|
|
50
|
+
vocabulary?: unknown;
|
|
51
|
+
frames?: unknown;
|
|
52
|
+
}): void;
|
|
53
|
+
/** The current site render, or the editor's fallback until one is set. */
|
|
54
|
+
export declare function getSiteRender(): SiteRender;
|
|
55
|
+
/** Call `listener` on every later `setSiteRender`; returns the unsubscribe. */
|
|
56
|
+
export declare function subscribeSiteRender(listener: (render: SiteRender) => void): () => void;
|
|
57
|
+
/** React hook for the current site render; re-renders the caller when it changes (HMR support). */
|
|
58
|
+
export declare function useSiteRender(): SiteRender;
|
|
59
|
+
export {};
|
|
60
|
+
//# sourceMappingURL=site-render.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"site-render.d.ts","sourceRoot":"","sources":["../../src/site-render.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,IAAI,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC1E,OAAO,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AC,EAAE,OAAO,CAAA;CAAE,GAAG,IAAI,CA4BzG;AAED,0EAA0E;AAC1E,wBAAgB,aAAa,IAAI,UAAU,CAE1C;AAED,+EAA+E;AAC/E,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,GAAG,MAAM,IAAI,CAMtF;AAED,mGAAmG;AACnG,wBAAgB,aAAa,IAAI,UAAU,CAgB1C"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { EMPTY_FRAGMENT_VOCABULARY, evaluateMDXToComponent, isFragmentVocabulary, } from '@conloca/mdx/render';
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
3
|
+
const FALLBACK = {
|
|
4
|
+
evaluate: evaluateMDXToComponent,
|
|
5
|
+
vocabulary: EMPTY_FRAGMENT_VOCABULARY,
|
|
6
|
+
frames: {},
|
|
7
|
+
source: 'editor',
|
|
8
|
+
};
|
|
9
|
+
const getSharedState = () => {
|
|
10
|
+
if (typeof window !== 'undefined') {
|
|
11
|
+
// oxlint-disable-next-line no-underscore-dangle -- the browser global declared above.
|
|
12
|
+
window.__SITE_RENDER_STATE__ ??= { render: FALLBACK, subscribers: new Set() };
|
|
13
|
+
// oxlint-disable-next-line no-underscore-dangle -- the browser global declared above.
|
|
14
|
+
return window.__SITE_RENDER_STATE__;
|
|
15
|
+
}
|
|
16
|
+
// SSR fallback
|
|
17
|
+
return { render: FALLBACK, subscribers: new Set() };
|
|
18
|
+
};
|
|
19
|
+
const isPlainObject = (value) => typeof value === 'object' && value !== null && Object.getPrototypeOf(value) === Object.prototype;
|
|
20
|
+
// Shape checks only: site code supplies these, and a wrong signature surfaces as a render error.
|
|
21
|
+
const isFragmentEvaluate = (value) => typeof value === 'function';
|
|
22
|
+
const isEditorFrame = (value) => typeof value === 'function' || (typeof value === 'object' && value !== null && '$$typeof' in value);
|
|
23
|
+
/**
|
|
24
|
+
* Register the site's render inputs. Each field is checked by shape, since it
|
|
25
|
+
* comes from site code: a malformed one is replaced by the fallback and named
|
|
26
|
+
* in one warning.
|
|
27
|
+
*/
|
|
28
|
+
export function setSiteRender(input) {
|
|
29
|
+
const siteEvaluate = isFragmentEvaluate(input.evaluate) ? input.evaluate : undefined;
|
|
30
|
+
if (input.evaluate !== undefined && siteEvaluate === undefined) {
|
|
31
|
+
console.warn('[conloca] evaluate is not a function; using the editor renderer');
|
|
32
|
+
}
|
|
33
|
+
const vocabulary = isFragmentVocabulary(input.vocabulary) ? input.vocabulary : EMPTY_FRAGMENT_VOCABULARY;
|
|
34
|
+
if (input.vocabulary !== undefined && vocabulary !== input.vocabulary) {
|
|
35
|
+
console.warn('[conloca] fragmentComponents is not defineFragmentComponents(...) output; using no components');
|
|
36
|
+
}
|
|
37
|
+
const frames = {};
|
|
38
|
+
if (isPlainObject(input.frames)) {
|
|
39
|
+
for (const [name, frame] of Object.entries(input.frames)) {
|
|
40
|
+
if (isEditorFrame(frame))
|
|
41
|
+
frames[name] = frame;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
else if (input.frames !== undefined) {
|
|
45
|
+
console.warn('[conloca] editorFrames is not an object; using no frames');
|
|
46
|
+
}
|
|
47
|
+
const render = {
|
|
48
|
+
evaluate: siteEvaluate ?? evaluateMDXToComponent,
|
|
49
|
+
vocabulary,
|
|
50
|
+
frames,
|
|
51
|
+
source: siteEvaluate ? 'site' : 'editor',
|
|
52
|
+
};
|
|
53
|
+
const state = getSharedState();
|
|
54
|
+
state.render = render;
|
|
55
|
+
state.subscribers.forEach((fn) => {
|
|
56
|
+
fn(render);
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
/** The current site render, or the editor's fallback until one is set. */
|
|
60
|
+
export function getSiteRender() {
|
|
61
|
+
return getSharedState().render;
|
|
62
|
+
}
|
|
63
|
+
/** Call `listener` on every later `setSiteRender`; returns the unsubscribe. */
|
|
64
|
+
export function subscribeSiteRender(listener) {
|
|
65
|
+
const state = getSharedState();
|
|
66
|
+
state.subscribers.add(listener);
|
|
67
|
+
return () => {
|
|
68
|
+
state.subscribers.delete(listener);
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
/** React hook for the current site render; re-renders the caller when it changes (HMR support). */
|
|
72
|
+
export function useSiteRender() {
|
|
73
|
+
const [render, setRender] = useState(() => getSharedState().render);
|
|
74
|
+
useEffect(() => {
|
|
75
|
+
const state = getSharedState();
|
|
76
|
+
// Re-sync in case it changed between render and effect
|
|
77
|
+
if (state.render !== render) {
|
|
78
|
+
setRender(state.render);
|
|
79
|
+
}
|
|
80
|
+
state.subscribers.add(setRender);
|
|
81
|
+
return () => {
|
|
82
|
+
state.subscribers.delete(setRender);
|
|
83
|
+
};
|
|
84
|
+
}, [render]);
|
|
85
|
+
return render;
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=site-render.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"site-render.js","sourceRoot":"","sources":["../../src/site-render.ts"],"names":[],"mappings":"AACA,OAAO,EACL,yBAAyB,EACzB,sBAAsB,EAGtB,oBAAoB,GACrB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAsC,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AA6ChF,MAAM,QAAQ,GAAe;IAC3B,QAAQ,EAAE,sBAAsB;IAChC,UAAU,EAAE,yBAAyB;IACrC,MAAM,EAAE,EAAE;IACV,MAAM,EAAE,QAAQ;CACjB,CAAC;AAEF,MAAM,cAAc,GAAG,GAA0B,EAAE;IACjD,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;QAClC,sFAAsF;QACtF,MAAM,CAAC,qBAAqB,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,IAAI,GAAG,EAAE,EAAE,CAAC;QAC9E,sFAAsF;QACtF,OAAO,MAAM,CAAC,qBAAqB,CAAC;IACtC,CAAC;IACD,eAAe;IACf,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,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M,CAAC,CAAC;IAEpE,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,KAAK,GAAG,cAAc,EAAE,CAAC;QAC/B,uDAAuD;QACvD,IAAI,KAAK,CAAC,MAAM,KAAK,MAAM,EAAE,CAAC;YAC5B,SAAS,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAC1B,CAAC;QACD,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QACjC,OAAO,GAAG,EAAE;YACV,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QACtC,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IAEb,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
package/dist/ts/types.d.ts
CHANGED
|
@@ -35,6 +35,9 @@ export interface PageMetadata {
|
|
|
35
35
|
pathname: string;
|
|
36
36
|
publishDate: Date | null;
|
|
37
37
|
unpublishDate: Date | null;
|
|
38
|
+
/** The `publishAt` / `unpublishAt` text the page was read with, sent back unchanged while its date is not changed. */
|
|
39
|
+
publishAtText?: string;
|
|
40
|
+
unpublishAtText?: string;
|
|
38
41
|
robots?: string;
|
|
39
42
|
canonical?: string;
|
|
40
43
|
customMeta?: Record<string, unknown>;
|
package/dist/ts/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAElF,MAAM,WAAW,IAAI;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,yFAAyF;IACzF,IAAI,EAAE,MAAM,GAAG,KAAK,CAAC;IACrB,MAAM,EAAE,OAAO,GAAG,WAAW,GAAG,WAAW,CAAC;IAC5C,QAAQ,EAAE,IAAI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