@wordpress/editor 14.1.0 → 14.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/CHANGELOG.md +16 -12
- package/README.md +28 -7
- package/build/bindings/pattern-overrides.js +8 -5
- package/build/bindings/pattern-overrides.js.map +1 -1
- package/build/bindings/post-meta.js +4 -0
- package/build/bindings/post-meta.js.map +1 -1
- package/build/components/create-template-part-modal/index.js +2 -0
- package/build/components/create-template-part-modal/index.js.map +1 -1
- package/build/components/document-bar/index.js +11 -4
- package/build/components/document-bar/index.js.map +1 -1
- package/build/components/editor-interface/index.js +6 -3
- package/build/components/editor-interface/index.js.map +1 -1
- package/build/components/entities-saved-states/entity-record-item.js +4 -12
- package/build/components/entities-saved-states/entity-record-item.js.map +1 -1
- package/build/components/entities-saved-states/index.js +1 -1
- package/build/components/entities-saved-states/index.js.map +1 -1
- package/build/components/global-keyboard-shortcuts/index.js +1 -1
- package/build/components/global-keyboard-shortcuts/index.js.map +1 -1
- package/build/components/global-styles-provider/index.js +6 -65
- package/build/components/global-styles-provider/index.js.map +1 -1
- package/build/components/header/index.js +6 -2
- package/build/components/header/index.js.map +1 -1
- package/build/components/index.js +10 -2
- package/build/components/index.js.map +1 -1
- package/build/components/inserter-sidebar/index.js +10 -21
- package/build/components/inserter-sidebar/index.js.map +1 -1
- package/build/components/list-view-sidebar/index.js +19 -47
- package/build/components/list-view-sidebar/index.js.map +1 -1
- package/build/components/page-attributes/parent.js +2 -1
- package/build/components/page-attributes/parent.js.map +1 -1
- package/build/components/post-actions/actions.js +371 -452
- package/build/components/post-actions/actions.js.map +1 -1
- package/build/components/post-actions/index.js +7 -2
- package/build/components/post-actions/index.js.map +1 -1
- package/build/components/post-excerpt/index.js +2 -1
- package/build/components/post-excerpt/index.js.map +1 -1
- package/build/components/post-excerpt/panel.js +3 -2
- package/build/components/post-excerpt/panel.js.map +1 -1
- package/build/components/post-preview-button/index.js +1 -1
- package/build/components/post-preview-button/index.js.map +1 -1
- package/build/components/post-publish-panel/index.js +1 -1
- package/build/components/post-publish-panel/index.js.map +1 -1
- package/build/components/post-saved-state/index.js +11 -1
- package/build/components/post-saved-state/index.js.map +1 -1
- package/build/components/post-schedule/index.js +3 -0
- package/build/components/post-schedule/index.js.map +1 -1
- package/build/components/post-slug/check.js +8 -1
- package/build/components/post-slug/check.js.map +1 -1
- package/build/components/post-slug/index.js +6 -0
- package/build/components/post-slug/index.js.map +1 -1
- package/build/components/post-status/index.js +4 -2
- package/build/components/post-status/index.js.map +1 -1
- package/build/components/post-sticky/index.js +9 -13
- package/build/components/post-sticky/index.js.map +1 -1
- package/build/components/post-template/create-new-template-modal.js +2 -0
- package/build/components/post-template/create-new-template-modal.js.map +1 -1
- package/build/components/post-title/index.js +5 -13
- package/build/components/post-title/index.js.map +1 -1
- package/build/components/preview-dropdown/index.js +1 -1
- package/build/components/preview-dropdown/index.js.map +1 -1
- package/build/components/provider/index.native.js +0 -4
- package/build/components/provider/index.native.js.map +1 -1
- package/build/components/provider/use-block-editor-settings.js +7 -4
- package/build/components/provider/use-block-editor-settings.js.map +1 -1
- package/build/components/save-publish-panels/index.js +30 -16
- package/build/components/save-publish-panels/index.js.map +1 -1
- package/build/components/sidebar/index.js +4 -1
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/sidebar/post-summary.js +2 -4
- package/build/components/sidebar/post-summary.js.map +1 -1
- package/build/components/template-content-panel/index.js +29 -4
- package/build/components/template-content-panel/index.js.map +1 -1
- package/build/components/template-part-content-panel/index.js +70 -0
- package/build/components/template-part-content-panel/index.js.map +1 -0
- package/build/components/visual-editor/index.js +1 -1
- package/build/components/visual-editor/index.js.map +1 -1
- package/build/dataviews/actions/delete-post.js +96 -0
- package/build/dataviews/actions/delete-post.js.map +1 -0
- package/build/{components/post-actions/export-pattern-action.js → dataviews/actions/export-pattern.js} +11 -20
- package/build/dataviews/actions/export-pattern.js.map +1 -0
- package/build/dataviews/actions/index.js +32 -0
- package/build/dataviews/actions/index.js.map +1 -0
- package/build/dataviews/actions/reset-post.js +111 -0
- package/build/dataviews/actions/reset-post.js.map +1 -0
- package/build/dataviews/actions/utils.js +50 -0
- package/build/dataviews/actions/utils.js.map +1 -0
- package/build/dataviews/store/private-actions.js.map +1 -1
- package/build/dataviews/store/private-selectors.js +6 -6
- package/build/dataviews/store/private-selectors.js.map +1 -1
- package/build/dataviews/store/reducer.js +6 -2
- package/build/dataviews/store/reducer.js.map +1 -1
- package/build/dataviews/types.js +6 -0
- package/build/dataviews/types.js.map +1 -0
- package/build/hooks/pattern-overrides.js +3 -3
- package/build/hooks/pattern-overrides.js.map +1 -1
- package/build/lock-unlock.js +1 -1
- package/build/lock-unlock.js.map +1 -1
- package/build/private-apis.js +2 -0
- package/build/private-apis.js.map +1 -1
- package/build/private-apis.native.js +0 -2
- package/build/private-apis.native.js.map +1 -1
- package/build/store/constants.js.map +1 -1
- package/build/store/private-actions.js +9 -5
- package/build/store/private-actions.js.map +1 -1
- package/build/store/private-selectors.js +0 -18
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/utils/is-template-revertable.js +6 -8
- package/build/store/utils/is-template-revertable.js.map +1 -1
- package/build-module/bindings/pattern-overrides.js +8 -5
- package/build-module/bindings/pattern-overrides.js.map +1 -1
- package/build-module/bindings/post-meta.js +4 -0
- package/build-module/bindings/post-meta.js.map +1 -1
- package/build-module/components/create-template-part-modal/index.js +2 -0
- package/build-module/components/create-template-part-modal/index.js.map +1 -1
- package/build-module/components/document-bar/index.js +11 -4
- package/build-module/components/document-bar/index.js.map +1 -1
- package/build-module/components/editor-interface/index.js +6 -3
- package/build-module/components/editor-interface/index.js.map +1 -1
- package/build-module/components/entities-saved-states/entity-record-item.js +6 -14
- package/build-module/components/entities-saved-states/entity-record-item.js.map +1 -1
- package/build-module/components/entities-saved-states/index.js +1 -1
- package/build-module/components/entities-saved-states/index.js.map +1 -1
- package/build-module/components/global-keyboard-shortcuts/index.js +1 -1
- package/build-module/components/global-keyboard-shortcuts/index.js.map +1 -1
- package/build-module/components/global-styles-provider/index.js +7 -66
- package/build-module/components/global-styles-provider/index.js.map +1 -1
- package/build-module/components/header/index.js +6 -2
- package/build-module/components/header/index.js.map +1 -1
- package/build-module/components/index.js +11 -2
- package/build-module/components/index.js.map +1 -1
- package/build-module/components/inserter-sidebar/index.js +11 -22
- package/build-module/components/inserter-sidebar/index.js.map +1 -1
- package/build-module/components/list-view-sidebar/index.js +20 -49
- package/build-module/components/list-view-sidebar/index.js.map +1 -1
- package/build-module/components/page-attributes/parent.js +2 -1
- package/build-module/components/page-attributes/parent.js.map +1 -1
- package/build-module/components/post-actions/actions.js +370 -450
- package/build-module/components/post-actions/actions.js.map +1 -1
- package/build-module/components/post-actions/index.js +7 -2
- package/build-module/components/post-actions/index.js.map +1 -1
- package/build-module/components/post-excerpt/index.js +2 -1
- package/build-module/components/post-excerpt/index.js.map +1 -1
- package/build-module/components/post-excerpt/panel.js +3 -2
- package/build-module/components/post-excerpt/panel.js.map +1 -1
- package/build-module/components/post-preview-button/index.js +1 -1
- package/build-module/components/post-preview-button/index.js.map +1 -1
- package/build-module/components/post-publish-panel/index.js +1 -1
- package/build-module/components/post-publish-panel/index.js.map +1 -1
- package/build-module/components/post-saved-state/index.js +11 -1
- package/build-module/components/post-saved-state/index.js.map +1 -1
- package/build-module/components/post-schedule/index.js +3 -0
- package/build-module/components/post-schedule/index.js.map +1 -1
- package/build-module/components/post-slug/check.js +9 -0
- package/build-module/components/post-slug/check.js.map +1 -1
- package/build-module/components/post-slug/index.js +6 -0
- package/build-module/components/post-slug/index.js.map +1 -1
- package/build-module/components/post-status/index.js +3 -2
- package/build-module/components/post-status/index.js.map +1 -1
- package/build-module/components/post-sticky/index.js +10 -14
- package/build-module/components/post-sticky/index.js.map +1 -1
- package/build-module/components/post-template/create-new-template-modal.js +2 -0
- package/build-module/components/post-template/create-new-template-modal.js.map +1 -1
- package/build-module/components/post-title/index.js +5 -13
- package/build-module/components/post-title/index.js.map +1 -1
- package/build-module/components/preview-dropdown/index.js +1 -1
- package/build-module/components/preview-dropdown/index.js.map +1 -1
- package/build-module/components/provider/index.native.js +0 -4
- package/build-module/components/provider/index.native.js.map +1 -1
- package/build-module/components/provider/use-block-editor-settings.js +7 -4
- package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
- package/build-module/components/save-publish-panels/index.js +30 -16
- package/build-module/components/save-publish-panels/index.js.map +1 -1
- package/build-module/components/sidebar/index.js +4 -1
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar/post-summary.js +2 -4
- package/build-module/components/sidebar/post-summary.js.map +1 -1
- package/build-module/components/template-content-panel/index.js +30 -5
- package/build-module/components/template-content-panel/index.js.map +1 -1
- package/build-module/components/template-part-content-panel/index.js +63 -0
- package/build-module/components/template-part-content-panel/index.js.map +1 -0
- package/build-module/components/visual-editor/index.js +1 -1
- package/build-module/components/visual-editor/index.js.map +1 -1
- package/build-module/dataviews/actions/delete-post.js +87 -0
- package/build-module/dataviews/actions/delete-post.js.map +1 -0
- package/build-module/{components/post-actions/export-pattern-action.js → dataviews/actions/export-pattern.js} +10 -19
- package/build-module/dataviews/actions/export-pattern.js.map +1 -0
- package/build-module/dataviews/actions/index.js +24 -0
- package/build-module/dataviews/actions/index.js.map +1 -0
- package/build-module/dataviews/actions/reset-post.js +104 -0
- package/build-module/dataviews/actions/reset-post.js.map +1 -0
- package/build-module/dataviews/actions/utils.js +41 -0
- package/build-module/dataviews/actions/utils.js.map +1 -0
- package/build-module/dataviews/store/private-actions.js.map +1 -1
- package/build-module/dataviews/store/private-selectors.js +5 -5
- package/build-module/dataviews/store/private-selectors.js.map +1 -1
- package/build-module/dataviews/store/reducer.js +6 -2
- package/build-module/dataviews/store/reducer.js.map +1 -1
- package/build-module/dataviews/types.js +2 -0
- package/build-module/dataviews/types.js.map +1 -0
- package/build-module/hooks/pattern-overrides.js +4 -2
- package/build-module/hooks/pattern-overrides.js.map +1 -1
- package/build-module/lock-unlock.js +1 -1
- package/build-module/lock-unlock.js.map +1 -1
- package/build-module/private-apis.js +2 -0
- package/build-module/private-apis.js.map +1 -1
- package/build-module/private-apis.native.js +0 -2
- package/build-module/private-apis.native.js.map +1 -1
- package/build-module/store/constants.js.map +1 -1
- package/build-module/store/private-actions.js +9 -5
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/private-selectors.js +0 -17
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/utils/is-template-revertable.js +6 -8
- package/build-module/store/utils/is-template-revertable.js.map +1 -1
- package/build-style/style-rtl.css +26 -76
- package/build-style/style.css +26 -76
- package/build-types/bindings/index.d.ts +2 -0
- package/build-types/bindings/index.d.ts.map +1 -0
- package/build-types/bindings/pattern-overrides.d.ts +18 -0
- package/build-types/bindings/pattern-overrides.d.ts.map +1 -0
- package/build-types/bindings/post-meta.d.ts +25 -0
- package/build-types/bindings/post-meta.d.ts.map +1 -0
- package/build-types/components/autocompleters/index.d.ts +2 -0
- package/build-types/components/autocompleters/index.d.ts.map +1 -0
- package/build-types/components/autocompleters/user.d.ts +6 -0
- package/build-types/components/autocompleters/user.d.ts.map +1 -0
- package/build-types/components/autosave-monitor/index.d.ts +15 -0
- package/build-types/components/autosave-monitor/index.d.ts.map +1 -0
- package/build-types/components/block-manager/category.d.ts +6 -0
- package/build-types/components/block-manager/category.d.ts.map +1 -0
- package/build-types/components/block-manager/checklist.d.ts +7 -0
- package/build-types/components/block-manager/checklist.d.ts.map +1 -0
- package/build-types/components/block-manager/index.d.ts +3 -0
- package/build-types/components/block-manager/index.d.ts.map +1 -0
- package/build-types/components/block-removal-warnings/index.d.ts +2 -0
- package/build-types/components/block-removal-warnings/index.d.ts.map +1 -0
- package/build-types/components/block-settings-menu/content-only-settings-menu.d.ts +2 -0
- package/build-types/components/block-settings-menu/content-only-settings-menu.d.ts.map +1 -0
- package/build-types/components/block-settings-menu/plugin-block-settings-menu-item.d.ts +65 -0
- package/build-types/components/block-settings-menu/plugin-block-settings-menu-item.d.ts.map +1 -0
- package/build-types/components/blog-title/index.d.ts +2 -0
- package/build-types/components/blog-title/index.d.ts.map +1 -0
- package/build-types/components/character-count/index.d.ts +7 -0
- package/build-types/components/character-count/index.d.ts.map +1 -0
- package/build-types/components/collapsible-block-toolbar/index.d.ts +6 -0
- package/build-types/components/collapsible-block-toolbar/index.d.ts.map +1 -0
- package/build-types/components/commands/index.d.ts +2 -0
- package/build-types/components/commands/index.d.ts.map +1 -0
- package/build-types/components/create-template-part-modal/index.d.ts +14 -0
- package/build-types/components/create-template-part-modal/index.d.ts.map +1 -0
- package/build-types/components/create-template-part-modal/utils.d.ts +4 -0
- package/build-types/components/create-template-part-modal/utils.d.ts.map +1 -0
- package/build-types/components/deprecated.d.ts +182 -0
- package/build-types/components/deprecated.d.ts.map +1 -0
- package/build-types/components/document-bar/index.d.ts +22 -0
- package/build-types/components/document-bar/index.d.ts.map +1 -0
- package/build-types/components/document-outline/check.d.ts +12 -0
- package/build-types/components/document-outline/check.d.ts.map +1 -0
- package/build-types/components/document-outline/index.d.ts +16 -0
- package/build-types/components/document-outline/index.d.ts.map +1 -0
- package/build-types/components/document-outline/item.d.ts +9 -0
- package/build-types/components/document-outline/item.d.ts.map +1 -0
- package/build-types/components/document-tools/index.d.ts +6 -0
- package/build-types/components/document-tools/index.d.ts.map +1 -0
- package/build-types/components/editor/index.d.ts +14 -0
- package/build-types/components/editor/index.d.ts.map +1 -0
- package/build-types/components/editor-history/redo.d.ts +4 -0
- package/build-types/components/editor-history/redo.d.ts.map +1 -0
- package/build-types/components/editor-history/undo.d.ts +4 -0
- package/build-types/components/editor-history/undo.d.ts.map +1 -0
- package/build-types/components/editor-interface/content-slot-fill.d.ts +3 -0
- package/build-types/components/editor-interface/content-slot-fill.d.ts.map +1 -0
- package/build-types/components/editor-interface/index.d.ts +17 -0
- package/build-types/components/editor-interface/index.d.ts.map +1 -0
- package/build-types/components/editor-notices/index.d.ts +13 -0
- package/build-types/components/editor-notices/index.d.ts.map +1 -0
- package/build-types/components/editor-snackbars/index.d.ts +7 -0
- package/build-types/components/editor-snackbars/index.d.ts.map +1 -0
- package/build-types/components/entities-saved-states/entity-record-item.d.ts +6 -0
- package/build-types/components/entities-saved-states/entity-record-item.d.ts.map +1 -0
- package/build-types/components/entities-saved-states/entity-type-list.d.ts +6 -0
- package/build-types/components/entities-saved-states/entity-type-list.d.ts.map +1 -0
- package/build-types/components/entities-saved-states/hooks/use-is-dirty.d.ts +2 -0
- package/build-types/components/entities-saved-states/hooks/use-is-dirty.d.ts.map +1 -0
- package/build-types/components/entities-saved-states/index.d.ts +43 -0
- package/build-types/components/entities-saved-states/index.d.ts.map +1 -0
- package/build-types/components/error-boundary/index.d.ts +14 -0
- package/build-types/components/error-boundary/index.d.ts.map +1 -0
- package/build-types/components/global-keyboard-shortcuts/index.d.ts +9 -0
- package/build-types/components/global-keyboard-shortcuts/index.d.ts.map +1 -0
- package/build-types/components/global-keyboard-shortcuts/register-shortcuts.d.ts +8 -0
- package/build-types/components/global-keyboard-shortcuts/register-shortcuts.d.ts.map +1 -0
- package/build-types/components/global-styles-provider/index.d.ts +20 -0
- package/build-types/components/global-styles-provider/index.d.ts.map +1 -0
- package/build-types/components/header/back-button.d.ts +6 -0
- package/build-types/components/header/back-button.d.ts.map +1 -0
- package/build-types/components/header/index.d.ts +10 -0
- package/build-types/components/header/index.d.ts.map +1 -0
- package/build-types/components/index.d.ts +108 -0
- package/build-types/components/index.d.ts.map +1 -0
- package/build-types/components/inserter-sidebar/index.d.ts +2 -0
- package/build-types/components/inserter-sidebar/index.d.ts.map +1 -0
- package/build-types/components/keyboard-shortcut-help-modal/config.d.ts +26 -0
- package/build-types/components/keyboard-shortcut-help-modal/config.d.ts.map +1 -0
- package/build-types/components/keyboard-shortcut-help-modal/dynamic-shortcut.d.ts +5 -0
- package/build-types/components/keyboard-shortcut-help-modal/dynamic-shortcut.d.ts.map +1 -0
- package/build-types/components/keyboard-shortcut-help-modal/index.d.ts +3 -0
- package/build-types/components/keyboard-shortcut-help-modal/index.d.ts.map +1 -0
- package/build-types/components/keyboard-shortcut-help-modal/shortcut.d.ts +8 -0
- package/build-types/components/keyboard-shortcut-help-modal/shortcut.d.ts.map +1 -0
- package/build-types/components/list-view-sidebar/index.d.ts +2 -0
- package/build-types/components/list-view-sidebar/index.d.ts.map +1 -0
- package/build-types/components/list-view-sidebar/list-view-outline.d.ts +2 -0
- package/build-types/components/list-view-sidebar/list-view-outline.d.ts.map +1 -0
- package/build-types/components/local-autosave-monitor/index.d.ts +3 -0
- package/build-types/components/local-autosave-monitor/index.d.ts.map +1 -0
- package/build-types/components/media-categories/index.d.ts +7 -0
- package/build-types/components/media-categories/index.d.ts.map +1 -0
- package/build-types/components/mode-switcher/index.d.ts +3 -0
- package/build-types/components/mode-switcher/index.d.ts.map +1 -0
- package/build-types/components/more-menu/copy-content-menu-item.d.ts +2 -0
- package/build-types/components/more-menu/copy-content-menu-item.d.ts.map +1 -0
- package/build-types/components/more-menu/index.d.ts +2 -0
- package/build-types/components/more-menu/index.d.ts.map +1 -0
- package/build-types/components/more-menu/tools-more-menu-group.d.ts +6 -0
- package/build-types/components/more-menu/tools-more-menu-group.d.ts.map +1 -0
- package/build-types/components/more-menu/view-more-menu-group.d.ts +6 -0
- package/build-types/components/more-menu/view-more-menu-group.d.ts.map +1 -0
- package/build-types/components/page-attributes/check.d.ts +13 -0
- package/build-types/components/page-attributes/check.d.ts.map +1 -0
- package/build-types/components/page-attributes/order.d.ts +9 -0
- package/build-types/components/page-attributes/order.d.ts.map +1 -0
- package/build-types/components/page-attributes/panel.d.ts +7 -0
- package/build-types/components/page-attributes/panel.d.ts.map +1 -0
- package/build-types/components/page-attributes/parent.d.ts +11 -0
- package/build-types/components/page-attributes/parent.d.ts.map +1 -0
- package/build-types/components/pattern-duplicate-modal/index.d.ts +3 -0
- package/build-types/components/pattern-duplicate-modal/index.d.ts.map +1 -0
- package/build-types/components/pattern-overrides-panel/index.d.ts +2 -0
- package/build-types/components/pattern-overrides-panel/index.d.ts.map +1 -0
- package/build-types/components/pattern-rename-modal/index.d.ts +3 -0
- package/build-types/components/pattern-rename-modal/index.d.ts.map +1 -0
- package/build-types/components/plugin-document-setting-panel/index.d.ts +69 -0
- package/build-types/components/plugin-document-setting-panel/index.d.ts.map +1 -0
- package/build-types/components/plugin-more-menu-item/index.d.ts +3 -0
- package/build-types/components/plugin-more-menu-item/index.d.ts.map +1 -0
- package/build-types/components/plugin-post-publish-panel/index.d.ts +47 -0
- package/build-types/components/plugin-post-publish-panel/index.d.ts.map +1 -0
- package/build-types/components/plugin-post-status-info/index.d.ts +57 -0
- package/build-types/components/plugin-post-status-info/index.d.ts.map +1 -0
- package/build-types/components/plugin-pre-publish-panel/index.d.ts +50 -0
- package/build-types/components/plugin-pre-publish-panel/index.d.ts.map +1 -0
- package/build-types/components/plugin-sidebar/index.d.ts +73 -0
- package/build-types/components/plugin-sidebar/index.d.ts.map +1 -0
- package/build-types/components/plugin-sidebar-more-menu-item/index.d.ts +52 -0
- package/build-types/components/plugin-sidebar-more-menu-item/index.d.ts.map +1 -0
- package/build-types/components/post-actions/actions.d.ts +31 -0
- package/build-types/components/post-actions/actions.d.ts.map +1 -0
- package/build-types/components/post-actions/index.d.ts +5 -0
- package/build-types/components/post-actions/index.d.ts.map +1 -0
- package/build-types/components/post-author/check.d.ts +13 -0
- package/build-types/components/post-author/check.d.ts.map +1 -0
- package/build-types/components/post-author/combobox.d.ts +2 -0
- package/build-types/components/post-author/combobox.d.ts.map +1 -0
- package/build-types/components/post-author/constants.d.ts +9 -0
- package/build-types/components/post-author/constants.d.ts.map +1 -0
- package/build-types/components/post-author/hook.d.ts +6 -0
- package/build-types/components/post-author/hook.d.ts.map +1 -0
- package/build-types/components/post-author/index.d.ts +8 -0
- package/build-types/components/post-author/index.d.ts.map +1 -0
- package/build-types/components/post-author/panel.d.ts +8 -0
- package/build-types/components/post-author/panel.d.ts.map +1 -0
- package/build-types/components/post-author/select.d.ts +2 -0
- package/build-types/components/post-author/select.d.ts.map +1 -0
- package/build-types/components/post-card-panel/index.d.ts +4 -0
- package/build-types/components/post-card-panel/index.d.ts.map +1 -0
- package/build-types/components/post-comments/index.d.ts +3 -0
- package/build-types/components/post-comments/index.d.ts.map +1 -0
- package/build-types/components/post-content-information/index.d.ts +2 -0
- package/build-types/components/post-content-information/index.d.ts.map +1 -0
- package/build-types/components/post-discussion/panel.d.ts +10 -0
- package/build-types/components/post-discussion/panel.d.ts.map +1 -0
- package/build-types/components/post-excerpt/check.d.ts +13 -0
- package/build-types/components/post-excerpt/check.d.ts.map +1 -0
- package/build-types/components/post-excerpt/index.d.ts +15 -0
- package/build-types/components/post-excerpt/index.d.ts.map +1 -0
- package/build-types/components/post-excerpt/panel.d.ts +8 -0
- package/build-types/components/post-excerpt/panel.d.ts.map +1 -0
- package/build-types/components/post-excerpt/plugin.d.ts +53 -0
- package/build-types/components/post-excerpt/plugin.d.ts.map +1 -0
- package/build-types/components/post-featured-image/check.d.ts +14 -0
- package/build-types/components/post-featured-image/check.d.ts.map +1 -0
- package/build-types/components/post-featured-image/index.d.ts +3 -0
- package/build-types/components/post-featured-image/index.d.ts.map +1 -0
- package/build-types/components/post-featured-image/panel.d.ts +13 -0
- package/build-types/components/post-featured-image/panel.d.ts.map +1 -0
- package/build-types/components/post-format/check.d.ts +5 -0
- package/build-types/components/post-format/check.d.ts.map +1 -0
- package/build-types/components/post-format/index.d.ts +16 -0
- package/build-types/components/post-format/index.d.ts.map +1 -0
- package/build-types/components/post-format/panel.d.ts +8 -0
- package/build-types/components/post-format/panel.d.ts.map +1 -0
- package/build-types/components/post-last-edited-panel/index.d.ts +2 -0
- package/build-types/components/post-last-edited-panel/index.d.ts.map +1 -0
- package/build-types/components/post-last-revision/check.d.ts +13 -0
- package/build-types/components/post-last-revision/check.d.ts.map +1 -0
- package/build-types/components/post-last-revision/index.d.ts +9 -0
- package/build-types/components/post-last-revision/index.d.ts.map +1 -0
- package/build-types/components/post-last-revision/panel.d.ts +8 -0
- package/build-types/components/post-last-revision/panel.d.ts.map +1 -0
- package/build-types/components/post-locked-modal/index.d.ts +8 -0
- package/build-types/components/post-locked-modal/index.d.ts.map +1 -0
- package/build-types/components/post-panel-row/index.d.ts +3 -0
- package/build-types/components/post-panel-row/index.d.ts.map +1 -0
- package/build-types/components/post-panel-section/index.d.ts +6 -0
- package/build-types/components/post-panel-section/index.d.ts.map +1 -0
- package/build-types/components/post-pending-status/check.d.ts +15 -0
- package/build-types/components/post-pending-status/check.d.ts.map +1 -0
- package/build-types/components/post-pending-status/index.d.ts +8 -0
- package/build-types/components/post-pending-status/index.d.ts.map +1 -0
- package/build-types/components/post-pingbacks/index.d.ts +3 -0
- package/build-types/components/post-pingbacks/index.d.ts.map +1 -0
- package/build-types/components/post-preview-button/index.d.ts +23 -0
- package/build-types/components/post-preview-button/index.d.ts.map +1 -0
- package/build-types/components/post-publish-button/index.d.ts +17 -0
- package/build-types/components/post-publish-button/index.d.ts.map +1 -0
- package/build-types/components/post-publish-button/label.d.ts +7 -0
- package/build-types/components/post-publish-button/label.d.ts.map +1 -0
- package/build-types/components/post-publish-button/post-publish-button-or-toggle.d.ts +17 -0
- package/build-types/components/post-publish-button/post-publish-button-or-toggle.d.ts.map +1 -0
- package/build-types/components/post-publish-panel/index.d.ts +10 -0
- package/build-types/components/post-publish-panel/index.d.ts.map +1 -0
- package/build-types/components/post-publish-panel/maybe-category-panel.d.ts +3 -0
- package/build-types/components/post-publish-panel/maybe-category-panel.d.ts.map +1 -0
- package/build-types/components/post-publish-panel/maybe-post-format-panel.d.ts +2 -0
- package/build-types/components/post-publish-panel/maybe-post-format-panel.d.ts.map +1 -0
- package/build-types/components/post-publish-panel/maybe-tags-panel.d.ts +3 -0
- package/build-types/components/post-publish-panel/maybe-tags-panel.d.ts.map +1 -0
- package/build-types/components/post-publish-panel/maybe-upload-media.d.ts +2 -0
- package/build-types/components/post-publish-panel/maybe-upload-media.d.ts.map +1 -0
- package/build-types/components/post-publish-panel/postpublish.d.ts +3 -0
- package/build-types/components/post-publish-panel/postpublish.d.ts.map +1 -0
- package/build-types/components/post-publish-panel/prepublish.d.ts +5 -0
- package/build-types/components/post-publish-panel/prepublish.d.ts.map +1 -0
- package/build-types/components/post-saved-state/index.d.ts +13 -0
- package/build-types/components/post-saved-state/index.d.ts.map +1 -0
- package/build-types/components/post-schedule/check.d.ts +12 -0
- package/build-types/components/post-schedule/check.d.ts.map +1 -0
- package/build-types/components/post-schedule/index.d.ts +17 -0
- package/build-types/components/post-schedule/index.d.ts.map +1 -0
- package/build-types/components/post-schedule/label.d.ts +25 -0
- package/build-types/components/post-schedule/label.d.ts.map +1 -0
- package/build-types/components/post-schedule/panel.d.ts +7 -0
- package/build-types/components/post-schedule/panel.d.ts.map +1 -0
- package/build-types/components/post-slug/check.d.ts +12 -0
- package/build-types/components/post-slug/check.d.ts.map +1 -0
- package/build-types/components/post-slug/index.d.ts +7 -0
- package/build-types/components/post-slug/index.d.ts.map +1 -0
- package/build-types/components/post-slug/panel.d.ts +3 -0
- package/build-types/components/post-slug/panel.d.ts.map +1 -0
- package/build-types/components/post-status/index.d.ts +6 -0
- package/build-types/components/post-status/index.d.ts.map +1 -0
- package/build-types/components/post-sticky/check.d.ts +12 -0
- package/build-types/components/post-sticky/check.d.ts.map +1 -0
- package/build-types/components/post-sticky/index.d.ts +7 -0
- package/build-types/components/post-sticky/index.d.ts.map +1 -0
- package/build-types/components/post-sticky/panel.d.ts +3 -0
- package/build-types/components/post-sticky/panel.d.ts.map +1 -0
- package/build-types/components/post-switch-to-draft-button/index.d.ts +7 -0
- package/build-types/components/post-switch-to-draft-button/index.d.ts.map +1 -0
- package/build-types/components/post-sync-status/index.d.ts +7 -0
- package/build-types/components/post-sync-status/index.d.ts.map +1 -0
- package/build-types/components/post-taxonomies/check.d.ts +12 -0
- package/build-types/components/post-taxonomies/check.d.ts.map +1 -0
- package/build-types/components/post-taxonomies/flat-term-selector.d.ts +64 -0
- package/build-types/components/post-taxonomies/flat-term-selector.d.ts.map +1 -0
- package/build-types/components/post-taxonomies/hierarchical-term-selector.d.ts +102 -0
- package/build-types/components/post-taxonomies/hierarchical-term-selector.d.ts.map +1 -0
- package/build-types/components/post-taxonomies/index.d.ts +5 -0
- package/build-types/components/post-taxonomies/index.d.ts.map +1 -0
- package/build-types/components/post-taxonomies/most-used-terms.d.ts +5 -0
- package/build-types/components/post-taxonomies/most-used-terms.d.ts.map +1 -0
- package/build-types/components/post-taxonomies/panel.d.ts +3 -0
- package/build-types/components/post-taxonomies/panel.d.ts.map +1 -0
- package/build-types/components/post-template/block-theme.d.ts +4 -0
- package/build-types/components/post-template/block-theme.d.ts.map +1 -0
- package/build-types/components/post-template/classic-theme.d.ts +3 -0
- package/build-types/components/post-template/classic-theme.d.ts.map +1 -0
- package/build-types/components/post-template/create-new-template-modal.d.ts +4 -0
- package/build-types/components/post-template/create-new-template-modal.d.ts.map +1 -0
- package/build-types/components/post-template/create-new-template.d.ts +4 -0
- package/build-types/components/post-template/create-new-template.d.ts.map +1 -0
- package/build-types/components/post-template/hooks.d.ts +8 -0
- package/build-types/components/post-template/hooks.d.ts.map +1 -0
- package/build-types/components/post-template/panel.d.ts +7 -0
- package/build-types/components/post-template/panel.d.ts.map +1 -0
- package/build-types/components/post-template/reset-default-template.d.ts +4 -0
- package/build-types/components/post-template/reset-default-template.d.ts.map +1 -0
- package/build-types/components/post-template/swap-template-button.d.ts +4 -0
- package/build-types/components/post-template/swap-template-button.d.ts.map +1 -0
- package/build-types/components/post-text-editor/index.d.ts +7 -0
- package/build-types/components/post-text-editor/index.d.ts.map +1 -0
- package/build-types/components/post-title/constants.d.ts +3 -0
- package/build-types/components/post-title/constants.d.ts.map +1 -0
- package/build-types/components/post-title/index.d.ts +3 -0
- package/build-types/components/post-title/index.d.ts.map +1 -0
- package/build-types/components/post-title/post-title-raw.d.ts +3 -0
- package/build-types/components/post-title/post-title-raw.d.ts.map +1 -0
- package/build-types/components/post-title/use-post-title-focus.d.ts +9 -0
- package/build-types/components/post-title/use-post-title-focus.d.ts.map +1 -0
- package/build-types/components/post-title/use-post-title.d.ts +7 -0
- package/build-types/components/post-title/use-post-title.d.ts.map +1 -0
- package/build-types/components/post-transform-panel/hooks.d.ts +2 -0
- package/build-types/components/post-transform-panel/hooks.d.ts.map +1 -0
- package/build-types/components/post-transform-panel/index.d.ts +2 -0
- package/build-types/components/post-transform-panel/index.d.ts.map +1 -0
- package/build-types/components/post-trash/check.d.ts +12 -0
- package/build-types/components/post-trash/check.d.ts.map +1 -0
- package/build-types/components/post-trash/index.d.ts +7 -0
- package/build-types/components/post-trash/index.d.ts.map +1 -0
- package/build-types/components/post-type-support-check/index.d.ts +18 -0
- package/build-types/components/post-type-support-check/index.d.ts.map +1 -0
- package/build-types/components/post-url/check.d.ts +12 -0
- package/build-types/components/post-url/check.d.ts.map +1 -0
- package/build-types/components/post-url/index.d.ts +14 -0
- package/build-types/components/post-url/index.d.ts.map +1 -0
- package/build-types/components/post-url/label.d.ts +13 -0
- package/build-types/components/post-url/label.d.ts.map +1 -0
- package/build-types/components/post-url/panel.d.ts +7 -0
- package/build-types/components/post-url/panel.d.ts.map +1 -0
- package/build-types/components/post-view-link/index.d.ts +2 -0
- package/build-types/components/post-view-link/index.d.ts.map +1 -0
- package/build-types/components/post-visibility/check.d.ts +13 -0
- package/build-types/components/post-visibility/check.d.ts.map +1 -0
- package/build-types/components/post-visibility/index.d.ts +11 -0
- package/build-types/components/post-visibility/index.d.ts.map +1 -0
- package/build-types/components/post-visibility/label.d.ts +13 -0
- package/build-types/components/post-visibility/label.d.ts.map +1 -0
- package/build-types/components/post-visibility/utils.d.ts +21 -0
- package/build-types/components/post-visibility/utils.d.ts.map +1 -0
- package/build-types/components/posts-per-page/index.d.ts +2 -0
- package/build-types/components/posts-per-page/index.d.ts.map +1 -0
- package/build-types/components/preferences-modal/enable-panel.d.ts +3 -0
- package/build-types/components/preferences-modal/enable-panel.d.ts.map +1 -0
- package/build-types/components/preferences-modal/enable-plugin-document-setting-panel.d.ts +14 -0
- package/build-types/components/preferences-modal/enable-plugin-document-setting-panel.d.ts.map +1 -0
- package/build-types/components/preferences-modal/enable-publish-sidebar.d.ts +3 -0
- package/build-types/components/preferences-modal/enable-publish-sidebar.d.ts.map +1 -0
- package/build-types/components/preferences-modal/index.d.ts +4 -0
- package/build-types/components/preferences-modal/index.d.ts.map +1 -0
- package/build-types/components/preview-dropdown/index.d.ts +5 -0
- package/build-types/components/preview-dropdown/index.d.ts.map +1 -0
- package/build-types/components/provider/disable-non-page-content-blocks.d.ts +6 -0
- package/build-types/components/provider/disable-non-page-content-blocks.d.ts.map +1 -0
- package/build-types/components/provider/index.d.ts +65 -0
- package/build-types/components/provider/index.d.ts.map +1 -0
- package/build-types/components/provider/navigation-block-editing-mode.d.ts +9 -0
- package/build-types/components/provider/navigation-block-editing-mode.d.ts.map +1 -0
- package/build-types/components/provider/use-auto-switch-editor-sidebars.d.ts +7 -0
- package/build-types/components/provider/use-auto-switch-editor-sidebars.d.ts.map +1 -0
- package/build-types/components/provider/use-block-editor-settings.d.ts +13 -0
- package/build-types/components/provider/use-block-editor-settings.d.ts.map +1 -0
- package/build-types/components/provider/use-hide-blocks-from-inserter.d.ts +9 -0
- package/build-types/components/provider/use-hide-blocks-from-inserter.d.ts.map +1 -0
- package/build-types/components/provider/with-registry-provider.d.ts +3 -0
- package/build-types/components/provider/with-registry-provider.d.ts.map +1 -0
- package/build-types/components/resizable-editor/index.d.ts +8 -0
- package/build-types/components/resizable-editor/index.d.ts.map +1 -0
- package/build-types/components/resizable-editor/resize-handle.d.ts +5 -0
- package/build-types/components/resizable-editor/resize-handle.d.ts.map +1 -0
- package/build-types/components/save-publish-panels/index.d.ts +11 -0
- package/build-types/components/save-publish-panels/index.d.ts.map +1 -0
- package/build-types/components/sidebar/constants.d.ts +5 -0
- package/build-types/components/sidebar/constants.d.ts.map +1 -0
- package/build-types/components/sidebar/header.d.ts +3 -0
- package/build-types/components/sidebar/header.d.ts.map +1 -0
- package/build-types/components/sidebar/index.d.ts +6 -0
- package/build-types/components/sidebar/index.d.ts.map +1 -0
- package/build-types/components/sidebar/post-summary.d.ts +4 -0
- package/build-types/components/sidebar/post-summary.d.ts.map +1 -0
- package/build-types/components/site-discussion/index.d.ts +2 -0
- package/build-types/components/site-discussion/index.d.ts.map +1 -0
- package/build-types/components/start-page-options/index.d.ts +2 -0
- package/build-types/components/start-page-options/index.d.ts.map +1 -0
- package/build-types/components/start-template-options/index.d.ts +2 -0
- package/build-types/components/start-template-options/index.d.ts.map +1 -0
- package/build-types/components/table-of-contents/index.d.ts +7 -0
- package/build-types/components/table-of-contents/index.d.ts.map +1 -0
- package/build-types/components/table-of-contents/panel.d.ts +6 -0
- package/build-types/components/table-of-contents/panel.d.ts.map +1 -0
- package/build-types/components/template-content-panel/index.d.ts +4 -0
- package/build-types/components/template-content-panel/index.d.ts.map +1 -0
- package/build-types/components/template-part-content-panel/index.d.ts +2 -0
- package/build-types/components/template-part-content-panel/index.d.ts.map +1 -0
- package/build-types/components/template-part-menu-items/convert-to-regular.d.ts +5 -0
- package/build-types/components/template-part-menu-items/convert-to-regular.d.ts.map +1 -0
- package/build-types/components/template-part-menu-items/convert-to-template-part.d.ts +5 -0
- package/build-types/components/template-part-menu-items/convert-to-template-part.d.ts.map +1 -0
- package/build-types/components/template-part-menu-items/index.d.ts +2 -0
- package/build-types/components/template-part-menu-items/index.d.ts.map +1 -0
- package/build-types/components/template-validation-notice/index.d.ts +2 -0
- package/build-types/components/template-validation-notice/index.d.ts.map +1 -0
- package/build-types/components/text-editor/index.d.ts +4 -0
- package/build-types/components/text-editor/index.d.ts.map +1 -0
- package/build-types/components/theme-support-check/index.d.ts +14 -0
- package/build-types/components/theme-support-check/index.d.ts.map +1 -0
- package/build-types/components/time-to-read/index.d.ts +7 -0
- package/build-types/components/time-to-read/index.d.ts.map +1 -0
- package/build-types/components/unsaved-changes-warning/index.d.ts +8 -0
- package/build-types/components/unsaved-changes-warning/index.d.ts.map +1 -0
- package/build-types/components/visual-editor/edit-template-blocks-notification.d.ts +18 -0
- package/build-types/components/visual-editor/edit-template-blocks-notification.d.ts.map +1 -0
- package/build-types/components/visual-editor/index.d.ts +10 -0
- package/build-types/components/visual-editor/index.d.ts.map +1 -0
- package/build-types/components/word-count/index.d.ts +7 -0
- package/build-types/components/word-count/index.d.ts.map +1 -0
- package/build-types/dataviews/actions/delete-post.d.ts +5 -0
- package/build-types/dataviews/actions/delete-post.d.ts.map +1 -0
- package/build-types/dataviews/actions/export-pattern.d.ts +8 -0
- package/build-types/dataviews/actions/export-pattern.d.ts.map +1 -0
- package/build-types/dataviews/actions/index.d.ts +2 -0
- package/build-types/dataviews/actions/index.d.ts.map +1 -0
- package/build-types/dataviews/actions/reset-post.d.ts +5 -0
- package/build-types/dataviews/actions/reset-post.d.ts.map +1 -0
- package/build-types/dataviews/actions/utils.d.ts +11 -0
- package/build-types/dataviews/actions/utils.d.ts.map +1 -0
- package/build-types/dataviews/api.d.ts +27 -0
- package/build-types/dataviews/api.d.ts.map +1 -0
- package/build-types/dataviews/store/private-actions.d.ts +2 -2
- package/build-types/dataviews/store/private-actions.d.ts.map +1 -1
- package/build-types/dataviews/store/private-selectors.d.ts +2 -5
- package/build-types/dataviews/store/private-selectors.d.ts.map +1 -1
- package/build-types/dataviews/store/reducer.d.ts +5 -1
- package/build-types/dataviews/store/reducer.d.ts.map +1 -1
- package/build-types/dataviews/types.d.ts +34 -0
- package/build-types/dataviews/types.d.ts.map +1 -0
- package/build-types/hooks/custom-sources-backwards-compatibility.d.ts +10 -0
- package/build-types/hooks/custom-sources-backwards-compatibility.d.ts.map +1 -0
- package/build-types/hooks/default-autocompleters.d.ts +2 -0
- package/build-types/hooks/default-autocompleters.d.ts.map +1 -0
- package/build-types/hooks/index.d.ts +2 -0
- package/build-types/hooks/index.d.ts.map +1 -0
- package/build-types/hooks/media-upload.d.ts +2 -0
- package/build-types/hooks/media-upload.d.ts.map +1 -0
- package/build-types/hooks/pattern-overrides.d.ts +2 -0
- package/build-types/hooks/pattern-overrides.d.ts.map +1 -0
- package/build-types/hooks/use-select-nearest-editable-block.d.ts +4 -0
- package/build-types/hooks/use-select-nearest-editable-block.d.ts.map +1 -0
- package/build-types/index.d.ts +6 -0
- package/build-types/index.d.ts.map +1 -0
- package/build-types/lock-unlock.d.ts +3 -0
- package/build-types/lock-unlock.d.ts.map +1 -0
- package/build-types/private-apis.d.ts +2 -0
- package/build-types/private-apis.d.ts.map +1 -0
- package/build-types/store/actions.d.ts +367 -0
- package/build-types/store/actions.d.ts.map +1 -0
- package/build-types/store/constants.d.ts +31 -0
- package/build-types/store/constants.d.ts.map +1 -0
- package/build-types/store/defaults.d.ts +21 -0
- package/build-types/store/defaults.d.ts.map +1 -0
- package/build-types/store/index.d.ts +17 -0
- package/build-types/store/index.d.ts.map +1 -0
- package/build-types/store/local-autosave.d.ts +4 -0
- package/build-types/store/local-autosave.d.ts.map +1 -0
- package/build-types/store/private-actions.d.ts +37 -0
- package/build-types/store/private-actions.d.ts.map +1 -0
- package/build-types/store/private-selectors.d.ts +24 -0
- package/build-types/store/private-selectors.d.ts.map +1 -0
- package/build-types/store/reducer.d.ts +228 -0
- package/build-types/store/reducer.d.ts.map +1 -0
- package/build-types/store/selectors.d.ts +854 -0
- package/build-types/store/selectors.d.ts.map +1 -0
- package/build-types/store/utils/get-filtered-template-parts.d.ts +3 -0
- package/build-types/store/utils/get-filtered-template-parts.d.ts.map +1 -0
- package/build-types/store/utils/is-template-revertable.d.ts +8 -0
- package/build-types/store/utils/is-template-revertable.d.ts.map +1 -0
- package/build-types/store/utils/notice-builder.d.ts +27 -0
- package/build-types/store/utils/notice-builder.d.ts.map +1 -0
- package/build-types/utils/get-template-part-icon.d.ts +9 -0
- package/build-types/utils/get-template-part-icon.d.ts.map +1 -0
- package/build-types/utils/index.d.ts +5 -0
- package/build-types/utils/index.d.ts.map +1 -0
- package/build-types/utils/media-upload/index.d.ts +21 -0
- package/build-types/utils/media-upload/index.d.ts.map +1 -0
- package/build-types/utils/set-nested-value.d.ts +20 -0
- package/build-types/utils/set-nested-value.d.ts.map +1 -0
- package/build-types/utils/terms.d.ts +12 -0
- package/build-types/utils/terms.d.ts.map +1 -0
- package/build-types/utils/url.d.ts +18 -0
- package/build-types/utils/url.d.ts.map +1 -0
- package/package.json +36 -35
- package/src/bindings/pattern-overrides.js +9 -10
- package/src/bindings/post-meta.js +5 -0
- package/src/components/create-template-part-modal/index.js +2 -0
- package/src/components/create-template-part-modal/style.scss +0 -6
- package/src/components/document-bar/index.js +11 -4
- package/src/components/editor-interface/index.js +19 -8
- package/src/components/entities-saved-states/entity-record-item.js +4 -14
- package/src/components/entities-saved-states/index.js +1 -1
- package/src/components/entities-saved-states/style.scss +0 -13
- package/src/components/global-keyboard-shortcuts/index.js +1 -1
- package/src/components/global-styles-provider/index.js +7 -90
- package/src/components/header/index.js +2 -1
- package/src/components/index.js +11 -2
- package/src/components/inserter-sidebar/index.js +4 -24
- package/src/components/list-view-sidebar/index.js +34 -62
- package/src/components/list-view-sidebar/style.scss +0 -34
- package/src/components/page-attributes/parent.js +6 -3
- package/src/components/post-actions/actions.js +495 -621
- package/src/components/post-actions/index.js +4 -2
- package/src/components/post-card-panel/style.scss +1 -0
- package/src/components/post-excerpt/index.js +4 -1
- package/src/components/post-excerpt/panel.js +3 -2
- package/src/components/post-featured-image/style.scss +15 -0
- package/src/components/post-panel-row/style.scss +1 -0
- package/src/components/post-preview-button/index.js +1 -1
- package/src/components/post-publish-panel/index.js +1 -1
- package/src/components/post-publish-panel/style.scss +1 -1
- package/src/components/post-saved-state/index.js +11 -1
- package/src/components/post-schedule/index.js +5 -0
- package/src/components/post-slug/check.js +8 -0
- package/src/components/post-slug/index.js +5 -0
- package/src/components/post-status/index.js +3 -1
- package/src/components/post-sticky/index.js +10 -13
- package/src/components/post-sticky/style.scss +3 -2
- package/src/components/post-taxonomies/README.md +1 -1
- package/src/components/post-template/create-new-template-modal.js +2 -0
- package/src/components/post-title/index.js +5 -12
- package/src/components/post-url/style.scss +4 -0
- package/src/components/preview-dropdown/index.js +1 -1
- package/src/components/provider/index.native.js +3 -11
- package/src/components/provider/use-block-editor-settings.js +10 -5
- package/src/components/save-publish-panels/index.js +33 -23
- package/src/components/sidebar/index.js +3 -3
- package/src/components/sidebar/post-summary.js +0 -4
- package/src/components/template-content-panel/index.js +29 -5
- package/src/components/template-part-content-panel/index.js +62 -0
- package/src/components/visual-editor/index.js +1 -1
- package/src/components/visual-editor/style.scss +3 -1
- package/src/dataviews/actions/delete-post.tsx +107 -0
- package/src/{components/post-actions/export-pattern-action.js → dataviews/actions/export-pattern.tsx} +19 -19
- package/src/dataviews/actions/index.ts +25 -0
- package/src/dataviews/actions/reset-post.tsx +144 -0
- package/src/dataviews/actions/utils.ts +54 -0
- package/src/dataviews/store/private-actions.ts +2 -2
- package/src/dataviews/store/private-selectors.ts +13 -6
- package/src/dataviews/store/reducer.ts +12 -5
- package/src/dataviews/types.ts +33 -0
- package/src/hooks/pattern-overrides.js +6 -4
- package/src/lock-unlock.js +1 -1
- package/src/private-apis.js +2 -0
- package/src/private-apis.native.js +0 -2
- package/src/store/private-actions.js +49 -21
- package/src/store/private-selectors.js +0 -25
- package/src/store/utils/is-template-revertable.js +8 -8
- package/src/style.scss +0 -1
- package/tsconfig.json +3 -2
- package/tsconfig.tsbuildinfo +1 -1
- package/build/components/post-actions/export-pattern-action.js.map +0 -1
- package/build/components/post-actions/export-pattern-action.native.js +0 -11
- package/build/components/post-actions/export-pattern-action.native.js.map +0 -1
- package/build/components/template-areas/index.js +0 -84
- package/build/components/template-areas/index.js.map +0 -1
- package/build-module/components/post-actions/export-pattern-action.js.map +0 -1
- package/build-module/components/post-actions/export-pattern-action.native.js +0 -5
- package/build-module/components/post-actions/export-pattern-action.native.js.map +0 -1
- package/build-module/components/template-areas/index.js +0 -78
- package/build-module/components/template-areas/index.js.map +0 -1
- package/src/components/post-actions/export-pattern-action.native.js +0 -4
- package/src/components/template-areas/index.js +0 -94
- package/src/components/template-areas/style.scss +0 -22
- /package/src/store/{constants.js → constants.ts} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 14.3.0 (2024-07-10)
|
|
6
|
+
|
|
7
|
+
## 14.2.0 (2024-06-26)
|
|
8
|
+
|
|
5
9
|
## 14.1.0 (2024-06-15)
|
|
6
10
|
|
|
7
11
|
## 14.0.0 (2024-05-31)
|
|
@@ -143,11 +147,11 @@
|
|
|
143
147
|
|
|
144
148
|
## 12.2.0 (2022-02-10)
|
|
145
149
|
|
|
146
|
-
###
|
|
150
|
+
### Enhancements
|
|
147
151
|
|
|
148
152
|
- Export `PostTaxonomiesFlatTermSelector` and `PostTaxonomiesHierarchicalTermSelector` components to allow using them to customize the default term selector for a taxonomy.
|
|
149
153
|
|
|
150
|
-
### Bug
|
|
154
|
+
### Bug Fixes
|
|
151
155
|
|
|
152
156
|
- Removed unused `@wordpress/autop`, `@wordpress/blob` and `@wordpress/is-shallow-equal` dependencies ([#38388](https://github.com/WordPress/gutenberg/pull/38388)).
|
|
153
157
|
|
|
@@ -159,14 +163,14 @@
|
|
|
159
163
|
|
|
160
164
|
## 12.0.0 (2021-10-12)
|
|
161
165
|
|
|
162
|
-
### Breaking
|
|
166
|
+
### Breaking Changes
|
|
163
167
|
|
|
164
168
|
- Removed the deprecated `resetAutosave` action ([#34537](https://github.com/WordPress/gutenberg/pull/34537)).
|
|
165
169
|
- Removed the deprecated `getAutosave`, `hasAutosave` and `getBlockForSerialization` selectors ([#34537](https://github.com/WordPress/gutenberg/pull/34537)).
|
|
166
170
|
|
|
167
171
|
## 11.0.0 (2021-07-29)
|
|
168
172
|
|
|
169
|
-
### Breaking
|
|
173
|
+
### Breaking Changes
|
|
170
174
|
|
|
171
175
|
- Upgraded React components to work with v17.0 ([#29118](https://github.com/WordPress/gutenberg/pull/29118)). There are no new features in React v17.0 as explained in the [blog post](https://reactjs.org/blog/2020/10/20/react-v17.html).
|
|
172
176
|
|
|
@@ -185,13 +189,13 @@
|
|
|
185
189
|
|
|
186
190
|
## 9.25.0 (2020-12-17)
|
|
187
191
|
|
|
188
|
-
### New
|
|
192
|
+
### New Features
|
|
189
193
|
|
|
190
194
|
- Added a store definition `store` for the editor namespace to use with `@wordpress/data` API ([#26655](https://github.com/WordPress/gutenberg/pull/26655)).
|
|
191
195
|
|
|
192
196
|
## 9.21.0 (2020-09-03)
|
|
193
197
|
|
|
194
|
-
###
|
|
198
|
+
### Enhancements
|
|
195
199
|
|
|
196
200
|
- The `UnsavedChangesWarning` component is now using `__experimentalGetDirtyEntityRecords` to determine if there were changes.
|
|
197
201
|
|
|
@@ -417,7 +421,7 @@
|
|
|
417
421
|
|
|
418
422
|
## 7.0.1 (2018-11-12)
|
|
419
423
|
|
|
420
|
-
###
|
|
424
|
+
### Internal
|
|
421
425
|
|
|
422
426
|
- Remove unnecessary `locale` prop usage [#11649](https://github.com/WordPress/gutenberg/pull/11649)
|
|
423
427
|
|
|
@@ -427,11 +431,11 @@
|
|
|
427
431
|
|
|
428
432
|
## 7.0.0 (2018-11-12)
|
|
429
433
|
|
|
430
|
-
### Breaking
|
|
434
|
+
### Breaking Changes
|
|
431
435
|
|
|
432
436
|
- The `PanelColor` component has been removed.
|
|
433
437
|
|
|
434
|
-
### New
|
|
438
|
+
### New Features
|
|
435
439
|
|
|
436
440
|
- In `NavigableToolbar`, a property focusOnMount was added, if true, the toolbar will get focus as soon as it mounted. Defaults to false.
|
|
437
441
|
|
|
@@ -449,7 +453,7 @@
|
|
|
449
453
|
|
|
450
454
|
- `PostPublishPanelToggle` has been deprecated in favor of `PostPublishButton`.
|
|
451
455
|
|
|
452
|
-
###
|
|
456
|
+
### Internal
|
|
453
457
|
|
|
454
458
|
- Reactive block styles.
|
|
455
459
|
|
|
@@ -461,7 +465,7 @@
|
|
|
461
465
|
|
|
462
466
|
## 6.1.1 (2018-11-03)
|
|
463
467
|
|
|
464
|
-
###
|
|
468
|
+
### Internal
|
|
465
469
|
|
|
466
470
|
- Remove `findDOMNode` usage from the `Inserter` component.
|
|
467
471
|
- Remove `findDOMNode` usage from the `Block` component.
|
|
@@ -494,7 +498,7 @@
|
|
|
494
498
|
- New actions `lockPostSaving` and `unlockPostSaving` were introduced ([#10649](https://github.com/WordPress/gutenberg/pull/10649)).
|
|
495
499
|
- New selector `isPostSavingLocked` was introduced ([#10649](https://github.com/WordPress/gutenberg/pull/10649)).
|
|
496
500
|
|
|
497
|
-
###
|
|
501
|
+
### Internal
|
|
498
502
|
|
|
499
503
|
- Add animated logo to preview interstitial screen.
|
|
500
504
|
- Tweak the editor styles support.
|
package/README.md
CHANGED
|
@@ -262,6 +262,12 @@ _Usage_
|
|
|
262
262
|
<DocumentBar />
|
|
263
263
|
```
|
|
264
264
|
|
|
265
|
+
_Parameters_
|
|
266
|
+
|
|
267
|
+
- _props_ `Object`: The component props.
|
|
268
|
+
- _props.title_ `string`: A title for the document, defaulting to the document or template title currently being edited.
|
|
269
|
+
- _props.icon_ `import("@wordpress/components").IconType`: An icon for the document, defaulting to an icon for document or template currently being edited.
|
|
270
|
+
|
|
265
271
|
_Returns_
|
|
266
272
|
|
|
267
273
|
- `JSX.Element`: The rendered DocumentBar component.
|
|
@@ -322,7 +328,7 @@ _Returns_
|
|
|
322
328
|
|
|
323
329
|
### EditorKeyboardShortcuts
|
|
324
330
|
|
|
325
|
-
|
|
331
|
+
Handles the keyboard shortcuts for the editor.
|
|
326
332
|
|
|
327
333
|
It provides functionality for various keyboard shortcuts such as toggling editor mode, toggling distraction-free mode, undo/redo, saving the post, toggling list view, and toggling the sidebar.
|
|
328
334
|
|
|
@@ -1268,15 +1274,28 @@ _Returns_
|
|
|
1268
1274
|
|
|
1269
1275
|
### PostSlug
|
|
1270
1276
|
|
|
1271
|
-
|
|
1277
|
+
Renders the PostSlug component. It provide a control for editing the post slug.
|
|
1278
|
+
|
|
1279
|
+
_Returns_
|
|
1280
|
+
|
|
1281
|
+
- `Component`: The component to be rendered.
|
|
1272
1282
|
|
|
1273
1283
|
### PostSlugCheck
|
|
1274
1284
|
|
|
1275
|
-
|
|
1285
|
+
Wrapper component that renders its children only if the post type supports the slug.
|
|
1286
|
+
|
|
1287
|
+
_Parameters_
|
|
1288
|
+
|
|
1289
|
+
- _props_ `Object`: Props.
|
|
1290
|
+
- _props.children_ `Element`: Children to be rendered.
|
|
1291
|
+
|
|
1292
|
+
_Returns_
|
|
1293
|
+
|
|
1294
|
+
- `Component`: The component to be rendered.
|
|
1276
1295
|
|
|
1277
1296
|
### PostSticky
|
|
1278
1297
|
|
|
1279
|
-
Renders the PostSticky component. It
|
|
1298
|
+
Renders the PostSticky component. It provides a checkbox control for the sticky post feature.
|
|
1280
1299
|
|
|
1281
1300
|
_Returns_
|
|
1282
1301
|
|
|
@@ -1603,9 +1622,9 @@ _Returns_
|
|
|
1603
1622
|
|
|
1604
1623
|
### TextEditorGlobalKeyboardShortcuts
|
|
1605
1624
|
|
|
1606
|
-
|
|
1625
|
+
Handles the keyboard shortcuts for the editor.
|
|
1607
1626
|
|
|
1608
|
-
It provides functionality for various keyboard shortcuts such as toggling editor mode, toggling distraction-free mode, undo/redo.
|
|
1627
|
+
It provides functionality for various keyboard shortcuts such as toggling editor mode, toggling distraction-free mode, undo/redo, saving the post, toggling list view, and toggling the sidebar.
|
|
1609
1628
|
|
|
1610
1629
|
### ThemeSupportCheck
|
|
1611
1630
|
|
|
@@ -1712,7 +1731,9 @@ _Type_
|
|
|
1712
1731
|
|
|
1713
1732
|
### VisualEditorGlobalKeyboardShortcuts
|
|
1714
1733
|
|
|
1715
|
-
|
|
1734
|
+
Handles the keyboard shortcuts for the editor.
|
|
1735
|
+
|
|
1736
|
+
It provides functionality for various keyboard shortcuts such as toggling editor mode, toggling distraction-free mode, undo/redo, saving the post, toggling list view, and toggling the sidebar.
|
|
1716
1737
|
|
|
1717
1738
|
### Warning
|
|
1718
1739
|
|
|
@@ -17,18 +17,21 @@ var _default = exports.default = {
|
|
|
17
17
|
getValue({
|
|
18
18
|
registry,
|
|
19
19
|
clientId,
|
|
20
|
+
context,
|
|
20
21
|
attributeName
|
|
21
22
|
}) {
|
|
23
|
+
const patternOverridesContent = context['pattern/overrides'];
|
|
22
24
|
const {
|
|
23
|
-
getBlockAttributes
|
|
24
|
-
getBlockParentsByBlockName
|
|
25
|
+
getBlockAttributes
|
|
25
26
|
} = registry.select(_blockEditor.store);
|
|
26
27
|
const currentBlockAttributes = getBlockAttributes(clientId);
|
|
27
|
-
|
|
28
|
-
|
|
28
|
+
if (!patternOverridesContent) {
|
|
29
|
+
return currentBlockAttributes[attributeName];
|
|
30
|
+
}
|
|
31
|
+
const overridableValue = patternOverridesContent?.[currentBlockAttributes?.metadata?.name]?.[attributeName];
|
|
29
32
|
|
|
30
33
|
// If there is no pattern client ID, or it is not overwritten, return the default value.
|
|
31
|
-
if (
|
|
34
|
+
if (overridableValue === undefined) {
|
|
32
35
|
return currentBlockAttributes[attributeName];
|
|
33
36
|
}
|
|
34
37
|
return overridableValue === '' ? undefined : overridableValue;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_blockEditor","CONTENT","_default","exports","default","name","label","_x","getValue","registry","clientId","attributeName","
|
|
1
|
+
{"version":3,"names":["_i18n","require","_blockEditor","CONTENT","_default","exports","default","name","label","_x","getValue","registry","clientId","context","attributeName","patternOverridesContent","getBlockAttributes","select","blockEditorStore","currentBlockAttributes","overridableValue","metadata","undefined","setValues","attributes","getBlockParentsByBlockName","getBlocks","blockName","patternClientId","syncBlocksWithSameName","blocks","block","dispatch","updateBlockAttributes","innerBlocks","currentBindingValue","Object","entries","reduce","acc","key","value","canUserEditValue"],"sources":["@wordpress/editor/src/bindings/pattern-overrides.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { _x } from '@wordpress/i18n';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\nconst CONTENT = 'content';\n\nexport default {\n\tname: 'core/pattern-overrides',\n\tlabel: _x( 'Pattern Overrides', 'block bindings source' ),\n\tgetValue( { registry, clientId, context, attributeName } ) {\n\t\tconst patternOverridesContent = context[ 'pattern/overrides' ];\n\t\tconst { getBlockAttributes } = registry.select( blockEditorStore );\n\t\tconst currentBlockAttributes = getBlockAttributes( clientId );\n\n\t\tif ( ! patternOverridesContent ) {\n\t\t\treturn currentBlockAttributes[ attributeName ];\n\t\t}\n\n\t\tconst overridableValue =\n\t\t\tpatternOverridesContent?.[\n\t\t\t\tcurrentBlockAttributes?.metadata?.name\n\t\t\t]?.[ attributeName ];\n\n\t\t// If there is no pattern client ID, or it is not overwritten, return the default value.\n\t\tif ( overridableValue === undefined ) {\n\t\t\treturn currentBlockAttributes[ attributeName ];\n\t\t}\n\n\t\treturn overridableValue === '' ? undefined : overridableValue;\n\t},\n\tsetValues( { registry, clientId, attributes } ) {\n\t\tconst { getBlockAttributes, getBlockParentsByBlockName, getBlocks } =\n\t\t\tregistry.select( blockEditorStore );\n\t\tconst currentBlockAttributes = getBlockAttributes( clientId );\n\t\tconst blockName = currentBlockAttributes?.metadata?.name;\n\t\tif ( ! blockName ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst [ patternClientId ] = getBlockParentsByBlockName(\n\t\t\tclientId,\n\t\t\t'core/block',\n\t\t\ttrue\n\t\t);\n\n\t\t// If there is no pattern client ID, sync blocks with the same name and same attributes.\n\t\tif ( ! patternClientId ) {\n\t\t\tconst syncBlocksWithSameName = ( blocks ) => {\n\t\t\t\tfor ( const block of blocks ) {\n\t\t\t\t\tif ( block.attributes?.metadata?.name === blockName ) {\n\t\t\t\t\t\tregistry\n\t\t\t\t\t\t\t.dispatch( blockEditorStore )\n\t\t\t\t\t\t\t.updateBlockAttributes(\n\t\t\t\t\t\t\t\tblock.clientId,\n\t\t\t\t\t\t\t\tattributes\n\t\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tsyncBlocksWithSameName( block.innerBlocks );\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tsyncBlocksWithSameName( getBlocks() );\n\t\t\treturn;\n\t\t}\n\t\tconst currentBindingValue =\n\t\t\tgetBlockAttributes( patternClientId )?.[ CONTENT ];\n\t\tregistry\n\t\t\t.dispatch( blockEditorStore )\n\t\t\t.updateBlockAttributes( patternClientId, {\n\t\t\t\t[ CONTENT ]: {\n\t\t\t\t\t...currentBindingValue,\n\t\t\t\t\t[ blockName ]: {\n\t\t\t\t\t\t...currentBindingValue?.[ blockName ],\n\t\t\t\t\t\t...Object.entries( attributes ).reduce(\n\t\t\t\t\t\t\t( acc, [ key, value ] ) => {\n\t\t\t\t\t\t\t\t// TODO: We need a way to represent `undefined` in the serialized overrides.\n\t\t\t\t\t\t\t\t// Also see: https://github.com/WordPress/gutenberg/pull/57249#discussion_r1452987871\n\t\t\t\t\t\t\t\t// We use an empty string to represent undefined for now until\n\t\t\t\t\t\t\t\t// we support a richer format for overrides and the block bindings API.\n\t\t\t\t\t\t\t\tacc[ key ] = value === undefined ? '' : value;\n\t\t\t\t\t\t\t\treturn acc;\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{}\n\t\t\t\t\t\t),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t} );\n\t},\n\tcanUserEditValue: () => true,\n};\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAJA;AACA;AACA;;AAIA,MAAME,OAAO,GAAG,SAAS;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEX;EACdC,IAAI,EAAE,wBAAwB;EAC9BC,KAAK,EAAE,IAAAC,QAAE,EAAE,mBAAmB,EAAE,uBAAwB,CAAC;EACzDC,QAAQA,CAAE;IAAEC,QAAQ;IAAEC,QAAQ;IAAEC,OAAO;IAAEC;EAAc,CAAC,EAAG;IAC1D,MAAMC,uBAAuB,GAAGF,OAAO,CAAE,mBAAmB,CAAE;IAC9D,MAAM;MAAEG;IAAm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UACAK,sBAAsB,CAAEE,KAAK,CAACG,WAAY,CAAC;QAC5C;MACD,CAAC;MAEDL,sBAAsB,CAAEH,SAAS,CAAC,CAAE,CAAC;MACrC;IACD;IACA,MAAMS,mBAAmB,GACxBnB,kBAAkB,CAAEY,eAAgB,CAAC,GAAIzB,OAAO,CAAE;IACnDQ,QAAQ,CACNqB,QAAQ,CAAEd,kBAAiB,CAAC,CAC5Be,qBAAqB,CAAEL,eAAe,EAAE;MACxC,CAAEzB,OAAO,GAAI;QACZ,GAAGgC,mBAAmB;QACtB,CAAER,SAAS,GAAI;UACd,GAAGQ,mBAAmB,GAAIR,SAAS,CAAE;UACrC,GAAGS,MAAM,CAACC,OAAO,CAAEb,UAAW,CAAC,CAACc,MAAM,CACrC,CAAEC,GAAG,EAAE,CAAEC,GAAG,EAAEC,KAAK,CAAE,KAAM;YAC1B;YACA;YACA;YACA;YACAF,GAAG,CAAEC,GAAG,CAAE,GAAGC,KAAK,KAAKnB,SAAS,GAAG,EAAE,GAAGmB,KAAK;YAC7C,OAAOF,GAAG;UACX,CAAC,EACD,CAAC,CACF;QACD;MACD;IACD,CAAE,CAAC;EACL,CAAC;EACDG,gBAAgB,EAAEA,CAAA,KAAM;AACzB,CAAC","ignoreList":[]}
|
|
@@ -45,6 +45,10 @@ var _default = exports.default = {
|
|
|
45
45
|
context,
|
|
46
46
|
args
|
|
47
47
|
}) {
|
|
48
|
+
// Lock editing in query loop.
|
|
49
|
+
if (context?.query || context?.queryId) {
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
48
52
|
const postType = context?.postType || select(_store.store).getCurrentPostType();
|
|
49
53
|
|
|
50
54
|
// Check that editing is happening in the post editor and not a template.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_coreData","require","_i18n","_store","_default","exports","default","name","label","_x","getPlaceholder","args","key","getValue","registry","context","select","coreDataStore","getEditedEntityRecord","postType","postId","meta","setValue","value","dispatch","editEntityRecord","canUserEditValue","editorStore","getCurrentPostType","isFieldExposed","getEntityRecord","canUserEdit","canUserEditEntityRecord"],"sources":["@wordpress/editor/src/bindings/post-meta.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as coreDataStore } from '@wordpress/core-data';\nimport { _x } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../store';\n\nexport default {\n\tname: 'core/post-meta',\n\tlabel: _x( 'Post Meta', 'block bindings source' ),\n\tgetPlaceholder( { args } ) {\n\t\treturn args.key;\n\t},\n\tgetValue( { registry, context, args } ) {\n\t\treturn registry\n\t\t\t.select( coreDataStore )\n\t\t\t.getEditedEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tcontext?.postType,\n\t\t\t\tcontext?.postId\n\t\t\t).meta?.[ args.key ];\n\t},\n\tsetValue( { registry, context, args, value } ) {\n\t\tregistry\n\t\t\t.dispatch( coreDataStore )\n\t\t\t.editEntityRecord( 'postType', context?.postType, context?.postId, {\n\t\t\t\tmeta: {\n\t\t\t\t\t[ args.key ]: value,\n\t\t\t\t},\n\t\t\t} );\n\t},\n\tcanUserEditValue( { select, context, args } ) {\n\t\tconst postType =\n\t\t\tcontext?.postType || select( editorStore ).getCurrentPostType();\n\n\t\t// Check that editing is happening in the post editor and not a template.\n\t\tif ( postType === 'wp_template' ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Check that the custom field is not protected and available in the REST API.\n\t\tconst isFieldExposed = !! select( coreDataStore ).getEntityRecord(\n\t\t\t'postType',\n\t\t\tpostType,\n\t\t\tcontext?.postId\n\t\t)?.meta?.[ args.key ];\n\n\t\tif ( ! isFieldExposed ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Check that the user has the capability to edit post meta.\n\t\tconst canUserEdit = select( coreDataStore ).canUserEditEntityRecord(\n\t\t\t'postType',\n\t\t\tcontext?.postType,\n\t\t\tcontext?.postId\n\t\t);\n\t\tif ( ! canUserEdit ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t},\n};\n"],"mappings":";;;;;;AAGA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAKA,IAAAE,MAAA,GAAAF,OAAA;AATA;AACA;AACA;AAIA;AACA;AACA;AAFA,IAAAG,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAKe;EACdC,IAAI,EAAE,gBAAgB;EACtBC,KAAK,EAAE,IAAAC,QAAE,EAAE,WAAW,EAAE,uBAAwB,CAAC;EACjDC,cAAcA,CAAE;IAAEC;EAAK,CAAC,EAAG;IAC1B,OAAOA,IAAI,CAACC,GAAG;EAChB,CAAC;EACDC,QAAQA,CAAE;IAAEC,QAAQ;IAAEC,OAAO;IAAEJ;EAAK,CAAC,EAAG;IACvC,OAAOG,QAAQ,CACbE,MAAM,CAAEC,eAAc,CAAC,CACvBC,qBAAqB,CACrB,UAAU,EACVH,OAAO,EAAEI,QAAQ,EACjBJ,OAAO,EAAEK,MACV,CAAC,CAACC,IAAI,GAAIV,IAAI,CAACC,GAAG,CAAE;EACtB,CAAC;EACDU,QAAQA,CAAE;IAAER,QAAQ;IAAEC,OAAO;IAAEJ,IAAI;IAAEY;EAAM,CAAC,EAAG;IAC9CT,QAAQ,CACNU,QAAQ,CAAEP,eAAc,CAAC,CACzBQ,gBAAgB,CAAE,UAAU,EAAEV,OAAO,EAAEI,QAAQ,EAAEJ,OAAO,EAAEK,MAAM,EAAE;MAClEC,IAAI,EAAE;QACL,CAAEV,IAAI,CAACC,GAAG,GAAIW;MACf;IACD,CAAE,CAAC;EACL,CAAC;EACDG,gBAAgBA,CAAE;IAAEV,MAAM;IAAED,OAAO;IAAEJ;EAAK,CAAC,EAAG;IAC7C,
|
|
1
|
+
{"version":3,"names":["_coreData","require","_i18n","_store","_default","exports","default","name","label","_x","getPlaceholder","args","key","getValue","registry","context","select","coreDataStore","getEditedEntityRecord","postType","postId","meta","setValue","value","dispatch","editEntityRecord","canUserEditValue","query","queryId","editorStore","getCurrentPostType","isFieldExposed","getEntityRecord","canUserEdit","canUserEditEntityRecord"],"sources":["@wordpress/editor/src/bindings/post-meta.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as coreDataStore } from '@wordpress/core-data';\nimport { _x } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../store';\n\nexport default {\n\tname: 'core/post-meta',\n\tlabel: _x( 'Post Meta', 'block bindings source' ),\n\tgetPlaceholder( { args } ) {\n\t\treturn args.key;\n\t},\n\tgetValue( { registry, context, args } ) {\n\t\treturn registry\n\t\t\t.select( coreDataStore )\n\t\t\t.getEditedEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tcontext?.postType,\n\t\t\t\tcontext?.postId\n\t\t\t).meta?.[ args.key ];\n\t},\n\tsetValue( { registry, context, args, value } ) {\n\t\tregistry\n\t\t\t.dispatch( coreDataStore )\n\t\t\t.editEntityRecord( 'postType', context?.postType, context?.postId, {\n\t\t\t\tmeta: {\n\t\t\t\t\t[ args.key ]: value,\n\t\t\t\t},\n\t\t\t} );\n\t},\n\tcanUserEditValue( { select, context, args } ) {\n\t\t// Lock editing in query loop.\n\t\tif ( context?.query || context?.queryId ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst postType =\n\t\t\tcontext?.postType || select( editorStore ).getCurrentPostType();\n\n\t\t// Check that editing is happening in the post editor and not a template.\n\t\tif ( postType === 'wp_template' ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Check that the custom field is not protected and available in the REST API.\n\t\tconst isFieldExposed = !! select( coreDataStore ).getEntityRecord(\n\t\t\t'postType',\n\t\t\tpostType,\n\t\t\tcontext?.postId\n\t\t)?.meta?.[ args.key ];\n\n\t\tif ( ! isFieldExposed ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Check that the user has the capability to edit post meta.\n\t\tconst canUserEdit = select( coreDataStore ).canUserEditEntityRecord(\n\t\t\t'postType',\n\t\t\tcontext?.postType,\n\t\t\tcontext?.postId\n\t\t);\n\t\tif ( !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IAAIH,MAAM,CAAEa,YAAY,CAAC,CAACC,kBAAkB,CAAC,CAAC;;IAEhE;IACA,IAAKX,QAAQ,KAAK,aAAa,EAAG;MACjC,OAAO,KAAK;IACb;;IAEA;IACA,MAAMY,cAAc,GAAG,CAAC,CAAEf,MAAM,CAAEC,eAAc,CAAC,CAACe,eAAe,CAChE,UAAU,EACVb,QAAQ,EACRJ,OAAO,EAAEK,MACV,CAAC,EAAEC,IAAI,GAAIV,IAAI,CAACC,GAAG,CAAE;IAErB,IAAK,CAAEmB,cAAc,EAAG;MACvB,OAAO,KAAK;IACb;;IAEA;IACA,MAAME,WAAW,GAAGjB,MAAM,CAAEC,eAAc,CAAC,CAACiB,uBAAuB,CAClE,UAAU,EACVnB,OAAO,EAAEI,QAAQ,EACjBJ,OAAO,EAAEK,MACV,CAAC;IACD,IAAK,CAAEa,WAAW,EAAG;MACpB,OAAO,KAAK;IACb;IAEA,OAAO,IAAI;EACZ;AACD,CAAC","ignoreList":[]}
|
|
@@ -35,6 +35,8 @@ function CreateTemplatePartModal({
|
|
|
35
35
|
title: modalTitle || defaultModalTitle,
|
|
36
36
|
onRequestClose: restProps.closeModal,
|
|
37
37
|
overlayClassName: "editor-create-template-part-modal",
|
|
38
|
+
focusOnMount: "firstContentElement",
|
|
39
|
+
size: "medium",
|
|
38
40
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(CreateTemplatePartModalContents, {
|
|
39
41
|
...restProps
|
|
40
42
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_data","require","_components","_i18n","_element","_compose","_notices","_coreData","_icons","_blocks","_store","_constants","_utils","_jsxRuntime","CreateTemplatePartModal","modalTitle","restProps","defaultModalTitle","useSelect","select","coreStore","getPostType","TEMPLATE_PART_POST_TYPE","labels","add_new_item","jsx","Modal","title","onRequestClose","closeModal","overlayClassName","children","CreateTemplatePartModalContents","defaultArea","TEMPLATE_PART_AREA_DEFAULT_CATEGORY","blocks","confirmLabel","__","onCreate","onError","defaultTitle","createErrorNotice","useDispatch","noticesStore","saveEntityRecord","existingTemplateParts","useExistingTemplateParts","setTitle","useState","area","setArea","isSubmitting","setIsSubmitting","instanceId","useInstanceId","templatePartAreas","editorStore","__experimentalGetDefaultTemplatePartAreas","createTemplatePart","uniqueTitle","getUniqueTemplatePartTitle","cleanSlug","getCleanTemplatePartSlug","templatePart","slug","content","serialize","throwOnError","error","errorMessage","message","code","type","onSubmit","event","preventDefault","jsxs","__experimentalVStack","spacing","TextControl","__next40pxDefaultSize","__nextHasNoMarginBottom","label","value","onChange","required","BaseControl","id","className","__experimentalRadioGroup","checked","map","icon","description","__experimentalRadio","Flex","align","justify","FlexItem","Icon","FlexBlock","check","__experimentalHStack","Button","variant","onClick","isBusy"],"sources":["@wordpress/editor/src/components/create-template-part-modal/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tIcon,\n\tBaseControl,\n\tTextControl,\n\tFlex,\n\tFlexItem,\n\tFlexBlock,\n\tButton,\n\tModal,\n\t__experimentalRadioGroup as RadioGroup,\n\t__experimentalRadio as Radio,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useState } from '@wordpress/element';\nimport { useInstanceId } from '@wordpress/compose';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { check } from '@wordpress/icons';\nimport { serialize } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport {\n\tTEMPLATE_PART_POST_TYPE,\n\tTEMPLATE_PART_AREA_DEFAULT_CATEGORY,\n} from '../../store/constants';\nimport {\n\tuseExistingTemplateParts,\n\tgetUniqueTemplatePartTitle,\n\tgetCleanTemplatePartSlug,\n} from './utils';\n\nexport default function CreateTemplatePartModal( {\n\tmodalTitle,\n\t...restProps\n} ) {\n\tconst defaultModalTitle = useSelect(\n\t\t( select ) =>\n\t\t\tselect( coreStore ).getPostType( TEMPLATE_PART_POST_TYPE )?.labels\n\t\t\t\t?.add_new_item,\n\t\t[]\n\t);\n\treturn (\n\t\t<Modal\n\t\t\ttitle={ modalTitle || defaultModalTitle }\n\t\t\tonRequestClose={ restProps.closeModal }\n\t\t\toverlayClassName=\"editor-create-template-part-modal\"\n\t\t>\n\t\t\t<CreateTemplatePartModalContents { ...restProps } />\n\t\t</Modal>\n\t);\n}\n\nexport function CreateTemplatePartModalContents( {\n\tdefaultArea = TEMPLATE_PART_AREA_DEFAULT_CATEGORY,\n\tblocks = [],\n\tconfirmLabel = __( 'Add' ),\n\tcloseModal,\n\tonCreate,\n\tonError,\n\tdefaultTitle = '',\n} ) {\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\tconst { saveEntityRecord } = useDispatch( coreStore );\n\tconst existingTemplateParts = useExistingTemplateParts();\n\n\tconst [ title, setTitle ] = useState( defaultTitle );\n\tconst [ area, setArea ] = useState( defaultArea );\n\tconst [ isSubmitting, setIsSubmitting ] = useState( false );\n\tconst instanceId = useInstanceId( CreateTemplatePartModal );\n\n\tconst templatePartAreas = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editorStore ).__experimentalGetDefaultTemplatePartAreas(),\n\t\t[]\n\t);\n\tasync function createTemplatePart() {\n\t\tif ( ! title || isSubmitting ) {\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tsetIsSubmitting( true );\n\t\t\tconst uniqueTitle = getUniqueTemplatePartTitle(\n\t\t\t\ttitle,\n\t\t\t\texistingTemplateParts\n\t\t\t);\n\t\t\tconst cleanSlug = getCleanTemplatePartSlug( uniqueTitle );\n\n\t\t\tconst templatePart = await saveEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tTEMPLATE_PART_POST_TYPE,\n\t\t\t\t{\n\t\t\t\t\tslug: cleanSlug,\n\t\t\t\t\ttitle: uniqueTitle,\n\t\t\t\t\tcontent: serialize( blocks ),\n\t\t\t\t\tarea,\n\t\t\t\t},\n\t\t\t\t{ throwOnError: true }\n\t\t\t);\n\t\t\tawait onCreate( templatePart );\n\n\t\t\t// TODO: Add a success notice?\n\t\t} catch ( error ) {\n\t\t\tconst errorMessage =\n\t\t\t\terror.message && error.code !== 'unknown_error'\n\t\t\t\t\t? error.message\n\t\t\t\t\t: __(\n\t\t\t\t\t\t\t'An error occurred while creating the template part.'\n\t\t\t\t\t );\n\n\t\t\tcreateErrorNotice( errorMessage, { type: 'snackbar' } );\n\n\t\t\tonError?.();\n\t\t} finally {\n\t\t\tsetIsSubmitting( false );\n\t\t}\n\t}\n\treturn (\n\t\t<form\n\t\t\tonSubmit={ async ( event ) => {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tawait createTemplatePart();\n\t\t\t} }\n\t\t>\n\t\t\t<VStack spacing=\"4\">\n\t\t\t\t<TextControl\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Name' ) }\n\t\t\t\t\tvalue={ title }\n\t\t\t\t\tonChange={ setTitle }\n\t\t\t\t\trequired\n\t\t\t\t/>\n\t\t\t\t<BaseControl\n\t\t\t\t\tlabel={ __( 'Area' ) }\n\t\t\t\t\tid={ `editor-create-template-part-modal__area-selection-${ instanceId }` }\n\t\t\t\t\tclassName=\"editor-create-template-part-modal__area-base-control\"\n\t\t\t\t>\n\t\t\t\t\t<RadioGroup\n\t\t\t\t\t\tlabel={ __( 'Area' ) }\n\t\t\t\t\t\tclassName=\"editor-create-template-part-modal__area-radio-group\"\n\t\t\t\t\t\tid={ `editor-create-template-part-modal__area-selection-${ instanceId }` }\n\t\t\t\t\t\tonChange={ setArea }\n\t\t\t\t\t\tchecked={ area }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ templatePartAreas.map(\n\t\t\t\t\t\t\t( { icon, label, area: value, description } ) => (\n\t\t\t\t\t\t\t\t<Radio\n\t\t\t\t\t\t\t\t\tkey={ label }\n\t\t\t\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\t\t\t\tclassName=\"editor-create-template-part-modal__area-radio\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<Flex align=\"start\" justify=\"start\">\n\t\t\t\t\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t\t\t\t\t<Icon icon={ icon } />\n\t\t\t\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t\t\t\t\t<FlexBlock className=\"editor-create-template-part-modal__option-label\">\n\t\t\t\t\t\t\t\t\t\t\t{ label }\n\t\t\t\t\t\t\t\t\t\t\t<div>{ description }</div>\n\t\t\t\t\t\t\t\t\t\t</FlexBlock>\n\n\t\t\t\t\t\t\t\t\t\t<FlexItem className=\"editor-create-template-part-modal__checkbox\">\n\t\t\t\t\t\t\t\t\t\t\t{ area === value && (\n\t\t\t\t\t\t\t\t\t\t\t\t<Icon icon={ check } />\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t\t\t\t</Flex>\n\t\t\t\t\t\t\t\t</Radio>\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t) }\n\t\t\t\t\t</RadioGroup>\n\t\t\t\t</BaseControl>\n\t\t\t\t<HStack justify=\"right\">\n\t\t\t\t\t<Button\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\tcloseModal();\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t\t<Button\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\taria-disabled={ ! title || isSubmitting }\n\t\t\t\t\t\tisBusy={ isSubmitting }\n\t\t\t\t\t>\n\t\t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D,CAAC,eACd,IAAArE,WAAA,CAAA+D,IAAA,EAAC1E,WAAA,CAAAoG,oBAAM;QAACL,OAAO,EAAC,OAAO;QAAAlE,QAAA,gBACtB,IAAAlB,WAAA,CAAAY,GAAA,EAACvB,WAAA,CAAAqG,MAAM;UACNvB,qBAAqB;UACrBwB,OAAO,EAAC,UAAU;UAClBC,OAAO,EAAGA,CAAA,KAAM;YACf5E,UAAU,CAAC,CAAC;UACb,CAAG;UAAAE,QAAA,EAED,IAAAM,QAAE,EAAE,QAAS;QAAC,CACT,CAAC,eACT,IAAAxB,WAAA,CAAAY,GAAA,EAACvB,WAAA,CAAAqG,MAAM;UACNvB,qBAAqB;UACrBwB,OAAO,EAAC,SAAS;UACjBhC,IAAI,EAAC,QAAQ;UACb,iBAAgB,CAAE7C,KAAK,IAAIwB,YAAc;UACzCuD,MAAM,EAAGvD,YAAc;UAAApB,QAAA,EAErBK;QAAY,CACP,CAAC;MAAA,CACF,CAAC;IAAA,CACF;EAAC,CACJ,CAAC;AAET","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_data","require","_components","_i18n","_element","_compose","_notices","_coreData","_icons","_blocks","_store","_constants","_utils","_jsxRuntime","CreateTemplatePartModal","modalTitle","restProps","defaultModalTitle","useSelect","select","coreStore","getPostType","TEMPLATE_PART_POST_TYPE","labels","add_new_item","jsx","Modal","title","onRequestClose","closeModal","overlayClassName","focusOnMount","size","children","CreateTemplatePartModalContents","defaultArea","TEMPLATE_PART_AREA_DEFAULT_CATEGORY","blocks","confirmLabel","__","onCreate","onError","defaultTitle","createErrorNotice","useDispatch","noticesStore","saveEntityRecord","existingTemplateParts","useExistingTemplateParts","setTitle","useState","area","setArea","isSubmitting","setIsSubmitting","instanceId","useInstanceId","templatePartAreas","editorStore","__experimentalGetDefaultTemplatePartAreas","createTemplatePart","uniqueTitle","getUniqueTemplatePartTitle","cleanSlug","getCleanTemplatePartSlug","templatePart","slug","content","serialize","throwOnError","error","errorMessage","message","code","type","onSubmit","event","preventDefault","jsxs","__experimentalVStack","spacing","TextControl","__next40pxDefaultSize","__nextHasNoMarginBottom","label","value","onChange","required","BaseControl","id","className","__experimentalRadioGroup","checked","map","icon","description","__experimentalRadio","Flex","align","justify","FlexItem","Icon","FlexBlock","check","__experimentalHStack","Button","variant","onClick","isBusy"],"sources":["@wordpress/editor/src/components/create-template-part-modal/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tIcon,\n\tBaseControl,\n\tTextControl,\n\tFlex,\n\tFlexItem,\n\tFlexBlock,\n\tButton,\n\tModal,\n\t__experimentalRadioGroup as RadioGroup,\n\t__experimentalRadio as Radio,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useState } from '@wordpress/element';\nimport { useInstanceId } from '@wordpress/compose';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { check } from '@wordpress/icons';\nimport { serialize } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport {\n\tTEMPLATE_PART_POST_TYPE,\n\tTEMPLATE_PART_AREA_DEFAULT_CATEGORY,\n} from '../../store/constants';\nimport {\n\tuseExistingTemplateParts,\n\tgetUniqueTemplatePartTitle,\n\tgetCleanTemplatePartSlug,\n} from './utils';\n\nexport default function CreateTemplatePartModal( {\n\tmodalTitle,\n\t...restProps\n} ) {\n\tconst defaultModalTitle = useSelect(\n\t\t( select ) =>\n\t\t\tselect( coreStore ).getPostType( TEMPLATE_PART_POST_TYPE )?.labels\n\t\t\t\t?.add_new_item,\n\t\t[]\n\t);\n\treturn (\n\t\t<Modal\n\t\t\ttitle={ modalTitle || defaultModalTitle }\n\t\t\tonRequestClose={ restProps.closeModal }\n\t\t\toverlayClassName=\"editor-create-template-part-modal\"\n\t\t\tfocusOnMount=\"firstContentElement\"\n\t\t\tsize=\"medium\"\n\t\t>\n\t\t\t<CreateTemplatePartModalContents { ...restProps } />\n\t\t</Modal>\n\t);\n}\n\nexport function CreateTemplatePartModalContents( {\n\tdefaultArea = TEMPLATE_PART_AREA_DEFAULT_CATEGORY,\n\tblocks = [],\n\tconfirmLabel = __( 'Add' ),\n\tcloseModal,\n\tonCreate,\n\tonError,\n\tdefaultTitle = '',\n} ) {\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\tconst { saveEntityRecord } = useDispatch( coreStore );\n\tconst existingTemplateParts = useExistingTemplateParts();\n\n\tconst [ title, setTitle ] = useState( defaultTitle );\n\tconst [ area, setArea ] = useState( defaultArea );\n\tconst [ isSubmitting, setIsSubmitting ] = useState( false );\n\tconst instanceId = useInstanceId( CreateTemplatePartModal );\n\n\tconst templatePartAreas = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editorStore ).__experimentalGetDefaultTemplatePartAreas(),\n\t\t[]\n\t);\n\tasync function createTemplatePart() {\n\t\tif ( ! title || isSubmitting ) {\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tsetIsSubmitting( true );\n\t\t\tconst uniqueTitle = getUniqueTemplatePartTitle(\n\t\t\t\ttitle,\n\t\t\t\texistingTemplateParts\n\t\t\t);\n\t\t\tconst cleanSlug = getCleanTemplatePartSlug( uniqueTitle );\n\n\t\t\tconst templatePart = await saveEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tTEMPLATE_PART_POST_TYPE,\n\t\t\t\t{\n\t\t\t\t\tslug: cleanSlug,\n\t\t\t\t\ttitle: uniqueTitle,\n\t\t\t\t\tcontent: serialize( blocks ),\n\t\t\t\t\tarea,\n\t\t\t\t},\n\t\t\t\t{ throwOnError: true }\n\t\t\t);\n\t\t\tawait onCreate( templatePart );\n\n\t\t\t// TODO: Add a success notice?\n\t\t} catch ( error ) {\n\t\t\tconst errorMessage =\n\t\t\t\terror.message && error.code !== 'unknown_error'\n\t\t\t\t\t? error.message\n\t\t\t\t\t: __(\n\t\t\t\t\t\t\t'An error occurred while creating the template part.'\n\t\t\t\t\t );\n\n\t\t\tcreateErrorNotice( errorMessage, { type: 'snackbar' } );\n\n\t\t\tonError?.();\n\t\t} finally {\n\t\t\tsetIsSubmitting( false );\n\t\t}\n\t}\n\treturn (\n\t\t<form\n\t\t\tonSubmit={ async ( event ) => {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tawait createTemplatePart();\n\t\t\t} }\n\t\t>\n\t\t\t<VStack spacing=\"4\">\n\t\t\t\t<TextControl\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Name' ) }\n\t\t\t\t\tvalue={ title }\n\t\t\t\t\tonChange={ setTitle }\n\t\t\t\t\trequired\n\t\t\t\t/>\n\t\t\t\t<BaseControl\n\t\t\t\t\tlabel={ __( 'Area' ) }\n\t\t\t\t\tid={ `editor-create-template-part-modal__area-selection-${ instanceId }` }\n\t\t\t\t\tclassName=\"editor-create-template-part-modal__area-base-control\"\n\t\t\t\t>\n\t\t\t\t\t<RadioGroup\n\t\t\t\t\t\tlabel={ __( 'Area' ) }\n\t\t\t\t\t\tclassName=\"editor-create-template-part-modal__area-radio-group\"\n\t\t\t\t\t\tid={ `editor-create-template-part-modal__area-selection-${ instanceId }` }\n\t\t\t\t\t\tonChange={ setArea }\n\t\t\t\t\t\tchecked={ area }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ templatePartAreas.map(\n\t\t\t\t\t\t\t( { icon, label, area: value, description } ) => (\n\t\t\t\t\t\t\t\t<Radio\n\t\t\t\t\t\t\t\t\tkey={ label }\n\t\t\t\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\t\t\t\tclassName=\"editor-create-template-part-modal__area-radio\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<Flex align=\"start\" justify=\"start\">\n\t\t\t\t\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t\t\t\t\t<Icon icon={ icon } />\n\t\t\t\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t\t\t\t\t<FlexBlock className=\"editor-create-template-part-modal__option-label\">\n\t\t\t\t\t\t\t\t\t\t\t{ label }\n\t\t\t\t\t\t\t\t\t\t\t<div>{ description }</div>\n\t\t\t\t\t\t\t\t\t\t</FlexBlock>\n\n\t\t\t\t\t\t\t\t\t\t<FlexItem className=\"editor-create-template-part-modal__checkbox\">\n\t\t\t\t\t\t\t\t\t\t\t{ area === value && (\n\t\t\t\t\t\t\t\t\t\t\t\t<Icon icon={ check } />\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t\t\t\t</Flex>\n\t\t\t\t\t\t\t\t</Radio>\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t) }\n\t\t\t\t\t</RadioGroup>\n\t\t\t\t</BaseControl>\n\t\t\t\t<HStack justify=\"right\">\n\t\t\t\t\t<Button\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\tcloseModal();\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t\t<Button\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\taria-disabled={ ! title || isSubmitting }\n\t\t\t\t\t\tisBusy={ isSubmitting }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ confirmLabel }\n\t\t\t\t\t</Button>\n\t\t\t\t</HStack>\n\t\t\t</VStack>\n\t\t</form>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAcA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QA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vB,qBAAqB;UACrBwB,OAAO,EAAC,UAAU;UAClBC,OAAO,EAAGA,CAAA,KAAM;YACf9E,UAAU,CAAC,CAAC;UACb,CAAG;UAAAI,QAAA,EAED,IAAAM,QAAE,EAAE,QAAS;QAAC,CACT,CAAC,eACT,IAAA1B,WAAA,CAAAY,GAAA,EAACvB,WAAA,CAAAuG,MAAM;UACNvB,qBAAqB;UACrBwB,OAAO,EAAC,SAAS;UACjBhC,IAAI,EAAC,QAAQ;UACb,iBAAgB,CAAE/C,KAAK,IAAI0B,YAAc;UACzCuD,MAAM,EAAGvD,YAAc;UAAApB,QAAA,EAErBK;QAAY,CACP,CAAC;MAAA,CACF,CAAC;IAAA,CACF;EAAC,CACJ,CAAC;AAET","ignoreList":[]}
|
|
@@ -54,10 +54,15 @@ const MotionButton = (0, _components.__unstableMotion)(_components.Button);
|
|
|
54
54
|
* ```jsx
|
|
55
55
|
* <DocumentBar />
|
|
56
56
|
* ```
|
|
57
|
+
* @param {Object} props The component props.
|
|
58
|
+
* @param {string} props.title A title for the document, defaulting to the document or
|
|
59
|
+
* template title currently being edited.
|
|
60
|
+
* @param {import("@wordpress/components").IconType} props.icon An icon for the document, defaulting to an icon for document
|
|
61
|
+
* or template currently being edited.
|
|
57
62
|
*
|
|
58
63
|
* @return {JSX.Element} The rendered DocumentBar component.
|
|
59
64
|
*/
|
|
60
|
-
function DocumentBar() {
|
|
65
|
+
function DocumentBar(props) {
|
|
61
66
|
const {
|
|
62
67
|
postType,
|
|
63
68
|
documentTitle,
|
|
@@ -100,7 +105,9 @@ function DocumentBar() {
|
|
|
100
105
|
const isTemplate = _constants.TEMPLATE_POST_TYPES.includes(postType);
|
|
101
106
|
const isGlobalEntity = _constants.GLOBAL_POST_TYPES.includes(postType);
|
|
102
107
|
const hasBackButton = !!onNavigateToPreviousEntityRecord;
|
|
103
|
-
const
|
|
108
|
+
const entityTitle = isTemplate ? templateTitle : documentTitle;
|
|
109
|
+
const title = props.title || entityTitle;
|
|
110
|
+
const icon = props.icon || templateIcon;
|
|
104
111
|
const mounted = (0, _element.useRef)(false);
|
|
105
112
|
(0, _element.useEffect)(() => {
|
|
106
113
|
mounted.current = true;
|
|
@@ -161,11 +168,11 @@ function DocumentBar() {
|
|
|
161
168
|
duration: 0
|
|
162
169
|
} : undefined,
|
|
163
170
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.BlockIcon, {
|
|
164
|
-
icon:
|
|
171
|
+
icon: icon
|
|
165
172
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalText, {
|
|
166
173
|
size: "body",
|
|
167
174
|
as: "h1",
|
|
168
|
-
"aria-label": TYPE_LABELS[postType] ?
|
|
175
|
+
"aria-label": !props.title && TYPE_LABELS[postType] ?
|
|
169
176
|
// eslint-disable-next-line @wordpress/valid-sprintf
|
|
170
177
|
(0, _i18n.sprintf)(TYPE_LABELS[postType], title) : undefined,
|
|
171
178
|
children: title ? (0, _htmlEntities.decodeEntities)(title) : (0, _i18n.__)('No Title')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_clsx","_interopRequireDefault","require","_i18n","_data","_components","_blockEditor","_icons","_keycodes","_coreData","_commands","_element","_compose","_htmlEntities","_constants","_store","_lockUnlock","_jsxRuntime","TYPE_LABELS","wp_pattern","__","wp_navigation","wp_template","wp_template_part","MotionButton","motion","Button","DocumentBar","postType","documentTitle","isNotFound","isUnsyncedPattern","templateIcon","templateTitle","onNavigateToPreviousEntityRecord","useSelect","select","getCurrentPostType","getCurrentPostId","getEditorSettings","__experimentalGetTemplateInfo","getTemplateInfo","editorStore","getEditedEntityRecord","isResolving","isResolvingSelector","coreStore","_postType","_postId","_document","_templateInfo","title","wp_pattern_sync_status","unlock","getPostIcon","area","open","openCommandCenter","useDispatch","commandsStore","isReducedMotion","useReducedMotion","isTemplate","TEMPLATE_POST_TYPES","includes","isGlobalEntity","GLOBAL_POST_TYPES","hasBackButton","mounted","useRef","useEffect","current","jsxs","className","clsx","children","jsx","__unstableAnimatePresence","icon","isRTL","chevronRightSmall","chevronLeftSmall","onClick","event","stopPropagation","size","initial","opacity","transform","animate","exit","transition","duration","undefined","__experimentalText","__unstableMotion","div","BlockIcon","as","sprintf","decodeEntities","displayShortcut","primary"],"sources":["@wordpress/editor/src/components/document-bar/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __, isRTL, sprintf } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tButton,\n\t__experimentalText as Text,\n\t__unstableMotion as motion,\n\t__unstableAnimatePresence as AnimatePresence,\n} from '@wordpress/components';\nimport { BlockIcon } from '@wordpress/block-editor';\nimport { chevronLeftSmall, chevronRightSmall } from '@wordpress/icons';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as commandsStore } from '@wordpress/commands';\nimport { useRef, useEffect } from '@wordpress/element';\nimport { useReducedMotion } from '@wordpress/compose';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport { TEMPLATE_POST_TYPES, GLOBAL_POST_TYPES } from '../../store/constants';\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nconst TYPE_LABELS = {\n\t// translators: 1: Pattern title.\n\twp_pattern: __( 'Editing pattern: %s' ),\n\t// translators: 1: Navigation menu title.\n\twp_navigation: __( 'Editing navigation menu: %s' ),\n\t// translators: 1: Template title.\n\twp_template: __( 'Editing template: %s' ),\n\t// translators: 1: Template part title.\n\twp_template_part: __( 'Editing template part: %s' ),\n};\n\nconst MotionButton = motion( Button );\n\n/**\n * This component renders a navigation bar at the top of the editor. It displays the title of the current document,\n * a back button (if applicable), and a command center button. It also handles different states of the document,\n * such as \"not found\" or \"unsynced\".\n *\n * @example\n * ```jsx\n * <DocumentBar />\n * ```\n *\n * @return {JSX.Element} The rendered DocumentBar component.\n */\nexport default function DocumentBar() {\n\tconst {\n\t\tpostType,\n\t\tdocumentTitle,\n\t\tisNotFound,\n\t\tisUnsyncedPattern,\n\t\ttemplateIcon,\n\t\ttemplateTitle,\n\t\tonNavigateToPreviousEntityRecord,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetCurrentPostType,\n\t\t\tgetCurrentPostId,\n\t\t\tgetEditorSettings,\n\t\t\t__experimentalGetTemplateInfo: getTemplateInfo,\n\t\t} = select( editorStore );\n\t\tconst { getEditedEntityRecord, isResolving: isResolvingSelector } =\n\t\t\tselect( coreStore );\n\t\tconst _postType = getCurrentPostType();\n\t\tconst _postId = getCurrentPostId();\n\t\tconst _document = getEditedEntityRecord(\n\t\t\t'postType',\n\t\t\t_postType,\n\t\t\t_postId\n\t\t);\n\t\tconst _templateInfo = getTemplateInfo( _document );\n\t\treturn {\n\t\t\tpostType: _postType,\n\t\t\tdocumentTitle: _document.title,\n\t\t\tisNotFound:\n\t\t\t\t! _document &&\n\t\t\t\t! isResolvingSelector(\n\t\t\t\t\t'getEditedEntityRecord',\n\t\t\t\t\t'postType',\n\t\t\t\t\t_postType,\n\t\t\t\t\t_postId\n\t\t\t\t),\n\t\t\tisUnsyncedPattern: _document?.wp_pattern_sync_status === 'unsynced',\n\t\t\ttemplateIcon: unlock( select( editorStore ) ).getPostIcon(\n\t\t\t\t_postType,\n\t\t\t\t{\n\t\t\t\t\tarea: _document?.area,\n\t\t\t\t}\n\t\t\t),\n\t\t\ttemplateTitle: _templateInfo.title,\n\t\t\tonNavigateToPreviousEntityRecord:\n\t\t\t\tgetEditorSettings().onNavigateToPreviousEntityRecord,\n\t\t};\n\t}, [] );\n\n\tconst { open: openCommandCenter } = useDispatch( commandsStore );\n\tconst isReducedMotion = useReducedMotion();\n\n\tconst isTemplate = TEMPLATE_POST_TYPES.includes( postType );\n\tconst isGlobalEntity = GLOBAL_POST_TYPES.includes( postType );\n\tconst hasBackButton = !! onNavigateToPreviousEntityRecord;\n\tconst title = isTemplate ? templateTitle : documentTitle;\n\n\tconst mounted = useRef( false );\n\tuseEffect( () => {\n\t\tmounted.current = true;\n\t}, [] );\n\n\treturn (\n\t\t<div\n\t\t\tclassName={ clsx( 'editor-document-bar', {\n\t\t\t\t'has-back-button': hasBackButton,\n\t\t\t\t'is-global': isGlobalEntity && ! isUnsyncedPattern,\n\t\t\t} ) }\n\t\t>\n\t\t\t<AnimatePresence>\n\t\t\t\t{ hasBackButton && (\n\t\t\t\t\t<MotionButton\n\t\t\t\t\t\tclassName=\"editor-document-bar__back\"\n\t\t\t\t\t\ticon={ isRTL() ? chevronRightSmall : chevronLeftSmall }\n\t\t\t\t\t\tonClick={ ( event ) => {\n\t\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\t\tonNavigateToPreviousEntityRecord();\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\tinitial={\n\t\t\t\t\t\t\tmounted.current\n\t\t\t\t\t\t\t\t? { opacity: 0, transform: 'translateX(15%)' }\n\t\t\t\t\t\t\t\t: false // Don't show entry animation when DocumentBar mounts.\n\t\t\t\t\t\t}\n\t\t\t\t\t\tanimate={ { opacity: 1, transform: 'translateX(0%)' } }\n\t\t\t\t\t\texit={ { opacity: 0, transform: 'translateX(15%)' } }\n\t\t\t\t\t\ttransition={\n\t\t\t\t\t\t\tisReducedMotion ? { duration: 0 } : undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Back' ) }\n\t\t\t\t\t</MotionButton>\n\t\t\t\t) }\n\t\t\t</AnimatePresence>\n\t\t\t{ isNotFound ? (\n\t\t\t\t<Text>{ __( 'Document not found' ) }</Text>\n\t\t\t) : (\n\t\t\t\t<Button\n\t\t\t\t\tclassName=\"editor-document-bar__command\"\n\t\t\t\t\tonClick={ () => openCommandCenter() }\n\t\t\t\t\tsize=\"compact\"\n\t\t\t\t>\n\t\t\t\t\t<motion.div\n\t\t\t\t\t\tclassName=\"editor-document-bar__title\"\n\t\t\t\t\t\t// Force entry animation when the back button is added or removed.\n\t\t\t\t\t\tkey={ hasBackButton }\n\t\t\t\t\t\tinitial={\n\t\t\t\t\t\t\tmounted.current\n\t\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\t\topacity: 0,\n\t\t\t\t\t\t\t\t\t\ttransform: hasBackButton\n\t\t\t\t\t\t\t\t\t\t\t? 'translateX(15%)'\n\t\t\t\t\t\t\t\t\t\t\t: 'translateX(-15%)',\n\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t: false // Don't show entry animation when DocumentBar mounts.\n\t\t\t\t\t\t}\n\t\t\t\t\t\tanimate={ {\n\t\t\t\t\t\t\topacity: 1,\n\t\t\t\t\t\t\ttransform: 'translateX(0%)',\n\t\t\t\t\t\t} }\n\t\t\t\t\t\ttransition={\n\t\t\t\t\t\t\tisReducedMotion ? { duration: 0 } : undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t<BlockIcon icon={ templateIcon } />\n\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\tsize=\"body\"\n\t\t\t\t\t\t\tas=\"h1\"\n\t\t\t\t\t\t\taria-label={\n\t\t\t\t\t\t\t\tTYPE_LABELS[ postType ]\n\t\t\t\t\t\t\t\t\t? // eslint-disable-next-line @wordpress/valid-sprintf\n\t\t\t\t\t\t\t\t\t sprintf( TYPE_LABELS[ postType ], title )\n\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ title\n\t\t\t\t\t\t\t\t? decodeEntities( title )\n\t\t\t\t\t\t\t\t: __( 'No Title' ) }\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t</motion.div>\n\t\t\t\t\t<span className=\"editor-document-bar__shortcut\">\n\t\t\t\t\t\t{ displayShortcut.primary( 'k' ) }\n\t\t\t\t\t</span>\n\t\t\t\t</Button>\n\t\t\t) }\n\t\t</div>\n\t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aAkCK,CAAC,eACb,IAAAlD,WAAA,CAAA2D,GAAA;QAAMH,SAAS,EAAC,+BAA+B;QAAAE,QAAA,EAC5C0B,yBAAe,CAACC,OAAO,CAAE,GAAI;MAAC,CAC3B,CAAC;IAAA,CACA,CACR;EAAA,CACG,CAAC;AAER","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_i18n","_data","_components","_blockEditor","_icons","_keycodes","_coreData","_commands","_element","_compose","_htmlEntities","_constants","_store","_lockUnlock","_jsxRuntime","TYPE_LABELS","wp_pattern","__","wp_navigation","wp_template","wp_template_part","MotionButton","motion","Button","DocumentBar","props","postType","documentTitle","isNotFound","isUnsyncedPattern","templateIcon","templateTitle","onNavigateToPreviousEntityRecord","useSelect","select","getCurrentPostType","getCurrentPostId","getEditorSettings","__experimentalGetTemplateInfo","getTemplateInfo","editorStore","getEditedEntityRecord","isResolving","isResolvingSelector","coreStore","_postType","_postId","_document","_templateInfo","title","wp_pattern_sync_status","unlock","getPostIcon","area","open","openCommandCenter","useDispatch","commandsStore","isReducedMotion","useReducedMotion","isTemplate","TEMPLATE_POST_TYPES","includes","isGlobalEntity","GLOBAL_POST_TYPES","hasBackButton","entityTitle","icon","mounted","useRef","useEffect","current","jsxs","className","clsx","children","jsx","__unstableAnimatePresence","isRTL","chevronRightSmall","chevronLeftSmall","onClick","event","stopPropagation","size","initial","opacity","transform","animate","exit","transition","duration","undefined","__experimentalText","__unstableMotion","div","BlockIcon","as","sprintf","decodeEntities","displayShortcut","primary"],"sources":["@wordpress/editor/src/components/document-bar/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __, isRTL, sprintf } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tButton,\n\t__experimentalText as Text,\n\t__unstableMotion as motion,\n\t__unstableAnimatePresence as AnimatePresence,\n} from '@wordpress/components';\nimport { BlockIcon } from '@wordpress/block-editor';\nimport { chevronLeftSmall, chevronRightSmall } from '@wordpress/icons';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as commandsStore } from '@wordpress/commands';\nimport { useRef, useEffect } from '@wordpress/element';\nimport { useReducedMotion } from '@wordpress/compose';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport { TEMPLATE_POST_TYPES, GLOBAL_POST_TYPES } from '../../store/constants';\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nconst TYPE_LABELS = {\n\t// translators: 1: Pattern title.\n\twp_pattern: __( 'Editing pattern: %s' ),\n\t// translators: 1: Navigation menu title.\n\twp_navigation: __( 'Editing navigation menu: %s' ),\n\t// translators: 1: Template title.\n\twp_template: __( 'Editing template: %s' ),\n\t// translators: 1: Template part title.\n\twp_template_part: __( 'Editing template part: %s' ),\n};\n\nconst MotionButton = motion( Button );\n\n/**\n * This component renders a navigation bar at the top of the editor. It displays the title of the current document,\n * a back button (if applicable), and a command center button. It also handles different states of the document,\n * such as \"not found\" or \"unsynced\".\n *\n * @example\n * ```jsx\n * <DocumentBar />\n * ```\n * @param {Object} props The component props.\n * @param {string} props.title A title for the document, defaulting to the document or\n * template title currently being edited.\n * @param {import(\"@wordpress/components\").IconType} props.icon An icon for the document, defaulting to an icon for document\n * or template currently being edited.\n *\n * @return {JSX.Element} The rendered DocumentBar component.\n */\nexport default function DocumentBar( props ) {\n\tconst {\n\t\tpostType,\n\t\tdocumentTitle,\n\t\tisNotFound,\n\t\tisUnsyncedPattern,\n\t\ttemplateIcon,\n\t\ttemplateTitle,\n\t\tonNavigateToPreviousEntityRecord,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetCurrentPostType,\n\t\t\tgetCurrentPostId,\n\t\t\tgetEditorSettings,\n\t\t\t__experimentalGetTemplateInfo: getTemplateInfo,\n\t\t} = select( editorStore );\n\t\tconst { getEditedEntityRecord, isResolving: isResolvingSelector } =\n\t\t\tselect( coreStore );\n\t\tconst _postType = getCurrentPostType();\n\t\tconst _postId = getCurrentPostId();\n\t\tconst _document = getEditedEntityRecord(\n\t\t\t'postType',\n\t\t\t_postType,\n\t\t\t_postId\n\t\t);\n\t\tconst _templateInfo = getTemplateInfo( _document );\n\t\treturn {\n\t\t\tpostType: _postType,\n\t\t\tdocumentTitle: _document.title,\n\t\t\tisNotFound:\n\t\t\t\t! _document &&\n\t\t\t\t! isResolvingSelector(\n\t\t\t\t\t'getEditedEntityRecord',\n\t\t\t\t\t'postType',\n\t\t\t\t\t_postType,\n\t\t\t\t\t_postId\n\t\t\t\t),\n\t\t\tisUnsyncedPattern: _document?.wp_pattern_sync_status === 'unsynced',\n\t\t\ttemplateIcon: unlock( select( editorStore ) ).getPostIcon(\n\t\t\t\t_postType,\n\t\t\t\t{\n\t\t\t\t\tarea: _document?.area,\n\t\t\t\t}\n\t\t\t),\n\t\t\ttemplateTitle: _templateInfo.title,\n\t\t\tonNavigateToPreviousEntityRecord:\n\t\t\t\tgetEditorSettings().onNavigateToPreviousEntityRecord,\n\t\t};\n\t}, [] );\n\n\tconst { open: openCommandCenter } = useDispatch( commandsStore );\n\tconst isReducedMotion = useReducedMotion();\n\n\tconst isTemplate = TEMPLATE_POST_TYPES.includes( postType );\n\tconst isGlobalEntity = GLOBAL_POST_TYPES.includes( postType );\n\tconst hasBackButton = !! onNavigateToPreviousEntityRecord;\n\tconst entityTitle = isTemplate ? templateTitle : documentTitle;\n\tconst title = props.title || entityTitle;\n\tconst icon = props.icon || templateIcon;\n\n\tconst mounted = useRef( false );\n\tuseEffect( () => {\n\t\tmounted.current = true;\n\t}, [] );\n\n\treturn (\n\t\t<div\n\t\t\tclassName={ clsx( 'editor-document-bar', {\n\t\t\t\t'has-back-button': hasBackButton,\n\t\t\t\t'is-global': isGlobalEntity && ! isUnsyncedPattern,\n\t\t\t} ) }\n\t\t>\n\t\t\t<AnimatePresence>\n\t\t\t\t{ hasBackButton && (\n\t\t\t\t\t<MotionButton\n\t\t\t\t\t\tclassName=\"editor-document-bar__back\"\n\t\t\t\t\t\ticon={ isRTL() ? chevronRightSmall : chevronLeftSmall }\n\t\t\t\t\t\tonClick={ ( event ) => {\n\t\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\t\tonNavigateToPreviousEntityRecord();\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\tinitial={\n\t\t\t\t\t\t\tmounted.current\n\t\t\t\t\t\t\t\t? { opacity: 0, transform: 'translateX(15%)' }\n\t\t\t\t\t\t\t\t: false // Don't show entry animation when DocumentBar mounts.\n\t\t\t\t\t\t}\n\t\t\t\t\t\tanimate={ { opacity: 1, transform: 'translateX(0%)' } }\n\t\t\t\t\t\texit={ { opacity: 0, transform: 'translateX(15%)' } }\n\t\t\t\t\t\ttransition={\n\t\t\t\t\t\t\tisReducedMotion ? { duration: 0 } : undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Back' ) }\n\t\t\t\t\t</MotionButton>\n\t\t\t\t) }\n\t\t\t</AnimatePresence>\n\t\t\t{ isNotFound ? (\n\t\t\t\t<Text>{ __( 'Document not found' ) }</Text>\n\t\t\t) : (\n\t\t\t\t<Button\n\t\t\t\t\tclassName=\"editor-document-bar__command\"\n\t\t\t\t\tonClick={ () => openCommandCenter() }\n\t\t\t\t\tsize=\"compact\"\n\t\t\t\t>\n\t\t\t\t\t<motion.div\n\t\t\t\t\t\tclassName=\"editor-document-bar__title\"\n\t\t\t\t\t\t// Force entry animation when the back button is added or removed.\n\t\t\t\t\t\tkey={ hasBackButton }\n\t\t\t\t\t\tinitial={\n\t\t\t\t\t\t\tmounted.current\n\t\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\t\topacity: 0,\n\t\t\t\t\t\t\t\t\t\ttransform: hasBackButton\n\t\t\t\t\t\t\t\t\t\t\t? 'translateX(15%)'\n\t\t\t\t\t\t\t\t\t\t\t: 'translateX(-15%)',\n\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t: false // Don't show entry animation when DocumentBar mounts.\n\t\t\t\t\t\t}\n\t\t\t\t\t\tanimate={ {\n\t\t\t\t\t\t\topacity: 1,\n\t\t\t\t\t\t\ttransform: 'translateX(0%)',\n\t\t\t\t\t\t} }\n\t\t\t\t\t\ttransition={\n\t\t\t\t\t\t\tisReducedMotion ? { duration: 0 } : undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t<BlockIcon icon={ icon } />\n\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\tsize=\"body\"\n\t\t\t\t\t\t\tas=\"h1\"\n\t\t\t\t\t\t\taria-label={\n\t\t\t\t\t\t\t\t! props.title && TYPE_LABELS[ postType ]\n\t\t\t\t\t\t\t\t\t? // eslint-disable-next-line @wordpress/valid-sprintf\n\t\t\t\t\t\t\t\t\t sprintf( TYPE_LABELS[ postType ], title )\n\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ title\n\t\t\t\t\t\t\t\t? decodeEntities( title )\n\t\t\t\t\t\t\t\t: __( 'No Title' ) }\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t</motion.div>\n\t\t\t\t\t<span className=\"editor-document-bar__shortcut\">\n\t\t\t\t\t\t{ displayShortcut.primary( 'k' ) }\n\t\t\t\t\t</span>\n\t\t\t\t</Button>\n\t\t\t) }\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AAMA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AACA,I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;QAAAE,QAAA,EAC5CyB,yBAAe,CAACC,OAAO,CAAE,GAAI;MAAC,CAC3B,CAAC;IAAA,CACA,CACR;EAAA,CACG,CAAC;AAER","ignoreList":[]}
|
|
@@ -58,8 +58,10 @@ function EditorInterface({
|
|
|
58
58
|
disableIframe,
|
|
59
59
|
autoFocus,
|
|
60
60
|
customSaveButton,
|
|
61
|
+
customSavePanel,
|
|
61
62
|
forceDisableBlockTools,
|
|
62
63
|
title,
|
|
64
|
+
icon,
|
|
63
65
|
iframeProps
|
|
64
66
|
}) {
|
|
65
67
|
const {
|
|
@@ -128,7 +130,8 @@ function EditorInterface({
|
|
|
128
130
|
setEntitiesSavedStatesCallback: setEntitiesSavedStatesCallback,
|
|
129
131
|
customSaveButton: customSaveButton,
|
|
130
132
|
forceDisableBlockTools: forceDisableBlockTools,
|
|
131
|
-
title: title
|
|
133
|
+
title: title,
|
|
134
|
+
icon: icon
|
|
132
135
|
}),
|
|
133
136
|
editorNotices: /*#__PURE__*/(0, _jsxRuntime.jsx)(_editorNotices.default, {}),
|
|
134
137
|
secondarySidebar: !isPreviewMode && mode === 'visual' && (isInserterOpened && /*#__PURE__*/(0, _jsxRuntime.jsx)(_inserterSidebar.default, {}) || isListViewOpened && /*#__PURE__*/(0, _jsxRuntime.jsx)(_listViewSidebar.default, {})),
|
|
@@ -161,12 +164,12 @@ function EditorInterface({
|
|
|
161
164
|
footer: !isPreviewMode && !isDistractionFree && isLargeViewport && showBlockBreadcrumbs && isRichEditingEnabled && blockEditorMode !== 'zoom-out' && mode === 'visual' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.BlockBreadcrumb, {
|
|
162
165
|
rootLabelText: documentLabel
|
|
163
166
|
}),
|
|
164
|
-
actions: /*#__PURE__*/(0, _jsxRuntime.jsx)(_savePublishPanels.default, {
|
|
167
|
+
actions: !isPreviewMode ? customSavePanel || /*#__PURE__*/(0, _jsxRuntime.jsx)(_savePublishPanels.default, {
|
|
165
168
|
closeEntitiesSavedStates: closeEntitiesSavedStates,
|
|
166
169
|
isEntitiesSavedStatesOpen: entitiesSavedStatesCallback,
|
|
167
170
|
setEntitiesSavedStatesCallback: setEntitiesSavedStatesCallback,
|
|
168
171
|
forceIsDirtyPublishPanel: forceIsDirty
|
|
169
|
-
}),
|
|
172
|
+
}) : undefined,
|
|
170
173
|
shortcuts: {
|
|
171
174
|
previous: previousShortcut,
|
|
172
175
|
next: nextShortcut
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_clsx","_interopRequireDefault","require","_interface","_data","_i18n","_preferences","_blockEditor","_keyboardShortcuts","_compose","_element","_store","_editorNotices","_header","_inserterSidebar","_listViewSidebar","_savePublishPanels","_textEditor","_visualEditor","_contentSlotFill","_jsxRuntime","interfaceLabels","header","__","body","sidebar","actions","footer","EditorInterface","className","enableRegionNavigation","styles","children","forceIsDirty","contentRef","disableIframe","autoFocus","customSaveButton","forceDisableBlockTools","title","iframeProps","mode","isRichEditingEnabled","isInserterOpened","isListViewOpened","isDistractionFree","isPreviewMode","previousShortcut","nextShortcut","showBlockBreadcrumbs","documentLabel","blockEditorMode","useSelect","select","get","preferencesStore","getEditorSettings","getPostTypeLabel","editorStore","editorSettings","postTypeLabel","getEditorMode","richEditingEnabled","__unstableIsPreviewMode","keyboardShortcutsStore","getAllShortcutKeyCombinations","_x","blockEditorStore","__unstableGetEditorMode","isWideViewport","useViewportMatch","isLargeViewport","secondarySidebarLabel","entitiesSavedStatesCallback","setEntitiesSavedStatesCallback","useState","closeEntitiesSavedStates","useCallback","arg","jsx","InterfaceSkeleton","clsx","labels","secondarySidebar","default","editorNotices","ComplementaryArea","Slot","scope","content","jsxs","Fragment","editorCanvasView","BlockToolbar","hideDragHandle","BlockBreadcrumb","rootLabelText","isEntitiesSavedStatesOpen","forceIsDirtyPublishPanel","shortcuts","previous","next"],"sources":["@wordpress/editor/src/components/editor-interface/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { InterfaceSkeleton, ComplementaryArea } from '@wordpress/interface';\nimport { useSelect } from '@wordpress/data';\nimport { __, _x } from '@wordpress/i18n';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tstore as blockEditorStore,\n\tBlockBreadcrumb,\n\tBlockToolbar,\n} from '@wordpress/block-editor';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useState, useCallback } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport EditorNotices from '../editor-notices';\nimport Header from '../header';\nimport InserterSidebar from '../inserter-sidebar';\nimport ListViewSidebar from '../list-view-sidebar';\nimport SavePublishPanels from '../save-publish-panels';\nimport TextEditor from '../text-editor';\nimport VisualEditor from '../visual-editor';\nimport EditorContentSlotFill from './content-slot-fill';\n\nconst interfaceLabels = {\n\t/* translators: accessibility text for the editor top bar landmark region. */\n\theader: __( 'Editor top bar' ),\n\t/* translators: accessibility text for the editor content landmark region. */\n\tbody: __( 'Editor content' ),\n\t/* translators: accessibility text for the editor settings landmark region. */\n\tsidebar: __( 'Editor settings' ),\n\t/* translators: accessibility text for the editor publish landmark region. */\n\tactions: __( 'Editor publish' ),\n\t/* translators: accessibility text for the editor footer landmark region. */\n\tfooter: __( 'Editor footer' ),\n};\n\nexport default function EditorInterface( {\n\tclassName,\n\tenableRegionNavigation,\n\tstyles,\n\tchildren,\n\tforceIsDirty,\n\tcontentRef,\n\tdisableIframe,\n\tautoFocus,\n\tcustomSaveButton,\n\tforceDisableBlockTools,\n\ttitle,\n\tiframeProps,\n} ) {\n\tconst {\n\t\tmode,\n\t\tisRichEditingEnabled,\n\t\tisInserterOpened,\n\t\tisListViewOpened,\n\t\tisDistractionFree,\n\t\tisPreviewMode,\n\t\tpreviousShortcut,\n\t\tnextShortcut,\n\t\tshowBlockBreadcrumbs,\n\t\tdocumentLabel,\n\t\tblockEditorMode,\n\t} = useSelect( ( select ) => {\n\t\tconst { get } = select( preferencesStore );\n\t\tconst { getEditorSettings, getPostTypeLabel } = select( editorStore );\n\t\tconst editorSettings = getEditorSettings();\n\t\tconst postTypeLabel = getPostTypeLabel();\n\n\t\treturn {\n\t\t\tmode: select( editorStore ).getEditorMode(),\n\t\t\tisRichEditingEnabled: editorSettings.richEditingEnabled,\n\t\t\tisInserterOpened: select( editorStore ).isInserterOpened(),\n\t\t\tisListViewOpened: select( editorStore ).isListViewOpened(),\n\t\t\tisDistractionFree: get( 'core', 'distractionFree' ),\n\t\t\tisPreviewMode: editorSettings.__unstableIsPreviewMode,\n\t\t\tpreviousShortcut: select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getAllShortcutKeyCombinations( 'core/editor/previous-region' ),\n\t\t\tnextShortcut: select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getAllShortcutKeyCombinations( 'core/editor/next-region' ),\n\t\t\tshowBlockBreadcrumbs: get( 'core', 'showBlockBreadcrumbs' ),\n\t\t\t// translators: Default label for the Document in the Block Breadcrumb.\n\t\t\tdocumentLabel: postTypeLabel || _x( 'Document', 'noun' ),\n\t\t\tblockEditorMode:\n\t\t\t\tselect( blockEditorStore ).__unstableGetEditorMode(),\n\t\t};\n\t}, [] );\n\tconst isWideViewport = useViewportMatch( 'large' );\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst secondarySidebarLabel = isListViewOpened\n\t\t? __( 'Document Overview' )\n\t\t: __( 'Block Library' );\n\n\t// Local state for save panel.\n\t// Note 'truthy' callback implies an open panel.\n\tconst [ entitiesSavedStatesCallback, setEntitiesSavedStatesCallback ] =\n\t\tuseState( false );\n\tconst closeEntitiesSavedStates = useCallback(\n\t\t( arg ) => {\n\t\t\tif ( typeof entitiesSavedStatesCallback === 'function' ) {\n\t\t\t\tentitiesSavedStatesCallback( arg );\n\t\t\t}\n\t\t\tsetEntitiesSavedStatesCallback( false );\n\t\t},\n\t\t[ entitiesSavedStatesCallback ]\n\t);\n\n\treturn (\n\t\t<InterfaceSkeleton\n\t\t\tenableRegionNavigation={ enableRegionNavigation }\n\t\t\tisDistractionFree={ isDistractionFree && isWideViewport }\n\t\t\tclassName={ clsx( 'editor-editor-interface', className, {\n\t\t\t\t'is-entity-save-view-open': !! entitiesSavedStatesCallback,\n\t\t\t\t'is-distraction-free':\n\t\t\t\t\tisDistractionFree && isWideViewport && ! isPreviewMode,\n\t\t\t} ) }\n\t\t\tlabels={ {\n\t\t\t\t...interfaceLabels,\n\t\t\t\tsecondarySidebar: secondarySidebarLabel,\n\t\t\t} }\n\t\t\theader={\n\t\t\t\t! isPreviewMode && (\n\t\t\t\t\t<Header\n\t\t\t\t\t\tforceIsDirty={ forceIsDirty }\n\t\t\t\t\t\tsetEntitiesSavedStatesCallback={\n\t\t\t\t\t\t\tsetEntitiesSavedStatesCallback\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcustomSaveButton={ customSaveButton }\n\t\t\t\t\t\tforceDisableBlockTools={ forceDisableBlockTools }\n\t\t\t\t\t\ttitle={ title }\n\t\t\t\t\t/>\n\t\t\t\t)\n\t\t\t}\n\t\t\teditorNotices={ <EditorNotices /> }\n\t\t\tsecondarySidebar={\n\t\t\t\t! isPreviewMode &&\n\t\t\t\tmode === 'visual' &&\n\t\t\t\t( ( isInserterOpened && <InserterSidebar /> ) ||\n\t\t\t\t\t( isListViewOpened && <ListViewSidebar /> ) )\n\t\t\t}\n\t\t\tsidebar={\n\t\t\t\t! isPreviewMode &&\n\t\t\t\t! isDistractionFree && <ComplementaryArea.Slot scope=\"core\" />\n\t\t\t}\n\t\t\tcontent={\n\t\t\t\t<>\n\t\t\t\t\t{ ! isDistractionFree && ! isPreviewMode && (\n\t\t\t\t\t\t<EditorNotices />\n\t\t\t\t\t) }\n\n\t\t\t\t\t<EditorContentSlotFill.Slot>\n\t\t\t\t\t\t{ ( [ editorCanvasView ] ) =>\n\t\t\t\t\t\t\teditorCanvasView ? (\n\t\t\t\t\t\t\t\teditorCanvasView\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t{ ! isPreviewMode &&\n\t\t\t\t\t\t\t\t\t\t( mode === 'text' ||\n\t\t\t\t\t\t\t\t\t\t\t! isRichEditingEnabled ) && (\n\t\t\t\t\t\t\t\t\t\t\t<TextEditor\n\t\t\t\t\t\t\t\t\t\t\t\t// We should auto-focus the canvas (title) on load.\n\t\t\t\t\t\t\t\t\t\t\t\t// eslint-disable-next-line jsx-a11y/no-autofocus\n\t\t\t\t\t\t\t\t\t\t\t\tautoFocus={ autoFocus }\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t{ ! isPreviewMode &&\n\t\t\t\t\t\t\t\t\t\t! isLargeViewport &&\n\t\t\t\t\t\t\t\t\t\tmode === 'visual' && (\n\t\t\t\t\t\t\t\t\t\t\t<BlockToolbar hideDragHandle />\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t{ ( isPreviewMode ||\n\t\t\t\t\t\t\t\t\t\t( isRichEditingEnabled &&\n\t\t\t\t\t\t\t\t\t\t\tmode === 'visual' ) ) && (\n\t\t\t\t\t\t\t\t\t\t<VisualEditor\n\t\t\t\t\t\t\t\t\t\t\tstyles={ styles }\n\t\t\t\t\t\t\t\t\t\t\tcontentRef={ contentRef }\n\t\t\t\t\t\t\t\t\t\t\tdisableIframe={ disableIframe }\n\t\t\t\t\t\t\t\t\t\t\t// We should auto-focus the canvas (title) on load.\n\t\t\t\t\t\t\t\t\t\t\t// eslint-disable-next-line jsx-a11y/no-autofocus\n\t\t\t\t\t\t\t\t\t\t\tautoFocus={ autoFocus }\n\t\t\t\t\t\t\t\t\t\t\tiframeProps={ iframeProps }\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t{ children }\n\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\t\t\t\t\t</EditorContentSlotFill.Slot>\n\t\t\t\t</>\n\t\t\t}\n\t\t\tfooter={\n\t\t\t\t! isPreviewMode &&\n\t\t\t\t! isDistractionFree &&\n\t\t\t\tisLargeViewport &&\n\t\t\t\tshowBlockBreadcrumbs &&\n\t\t\t\tisRichEditingEnabled &&\n\t\t\t\tblockEditorMode !== 'zoom-out' &&\n\t\t\t\tmode === 'visual' && (\n\t\t\t\t\t<BlockBreadcrumb rootLabelText={ documentLabel } />\n\t\t\t\t)\n\t\t\t}\n\t\t\tactions={\n\t\t\t\t<SavePublishPanels\n\t\t\t\t\tcloseEntitiesSavedStates={ closeEntitiesSavedStates }\n\t\t\t\t\tisEntitiesSavedStatesOpen={ entitiesSavedStatesCallback }\n\t\t\t\t\tsetEntitiesSavedStatesCallback={\n\t\t\t\t\t\tsetEntitiesSavedStatesCallback\n\t\t\t\t\t}\n\t\t\t\t\tforceIsDirtyPublishPanel={ forceIsDirty }\n\t\t\t\t/>\n\t\t\t}\n\t\t\tshortcuts={ {\n\t\t\t\tprevious: previousShortcut,\n\t\t\t\tnext: nextShortcut,\n\t\t\t} }\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,UAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AAKA,IAAAM,kBAAA,GAAAN,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AACA,IAAAQ,QAAA,GAAAR,OAAA;AAKA,IAAAS,MAAA,GAAAT,OAAA;AACA,IAAAU,cAAA,GAAAX,sBAAA,CAAAC,OAAA;AACA,IAAAW,OAAA,GAAAZ,sBAAA,CAAAC,OAAA;AACA,IAAAY,gBAAA,GAAA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EACCR,QAAQ;QAAA,CACT;MACF,CAEyB,CAAC;IAAA,CAC5B,CACF;IACDL,MAAM,EACL,CAAEmB,aAAa,IACf,CAAED,iBAAiB,IACnB0B,eAAe,IACftB,oBAAoB,IACpBP,oBAAoB,IACpBS,eAAe,KAAK,UAAU,IAC9BV,IAAI,KAAK,QAAQ,iBAChB,IAAArB,WAAA,CAAA2D,GAAA,EAACxE,YAAA,CAAAwF,eAAe;MAACC,aAAa,EAAG9C;IAAe,CAAE,CAEnD;IACDxB,OAAO,eACN,IAAAN,WAAA,CAAA2D,GAAA,EAAC/D,kBAAA,CAAAoE,OAAiB;MACjBR,wBAAwB,EAAGA,wBAA0B;MACrDqB,yBAAyB,EAAGxB,2BAA6B;MACzDC,8BAA8B,EAC7BA,8BACA;MACDwB,wBAAwB,EAAGjE;IAAc,CACzC,CACD;IACDkE,SAAS,EAAG;MACXC,QAAQ,EAAErD,gBAAgB;MAC1BsD,IAAI,EAAErD;IACP;EAAG,CACH,CAAC;AAEJ","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_interface","_data","_i18n","_preferences","_blockEditor","_keyboardShortcuts","_compose","_element","_store","_editorNotices","_header","_inserterSidebar","_listViewSidebar","_savePublishPanels","_textEditor","_visualEditor","_contentSlotFill","_jsxRuntime","interfaceLabels","header","__","body","sidebar","actions","footer","EditorInterface","className","enableRegionNavigation","styles","children","forceIsDirty","contentRef","disableIframe","autoFocus","customSaveButton","customSavePanel","forceDisableBlockTools","title","icon","iframeProps","mode","isRichEditingEnabled","isInserterOpened","isListViewOpened","isDistractionFree","isPreviewMode","previousShortcut","nextShortcut","showBlockBreadcrumbs","documentLabel","blockEditorMode","useSelect","select","get","preferencesStore","getEditorSettings","getPostTypeLabel","editorStore","editorSettings","postTypeLabel","getEditorMode","richEditingEnabled","__unstableIsPreviewMode","keyboardShortcutsStore","getAllShortcutKeyCombinations","_x","blockEditorStore","__unstableGetEditorMode","isWideViewport","useViewportMatch","isLargeViewport","secondarySidebarLabel","entitiesSavedStatesCallback","setEntitiesSavedStatesCallback","useState","closeEntitiesSavedStates","useCallback","arg","jsx","InterfaceSkeleton","clsx","labels","secondarySidebar","default","editorNotices","ComplementaryArea","Slot","scope","content","jsxs","Fragment","editorCanvasView","BlockToolbar","hideDragHandle","BlockBreadcrumb","rootLabelText","isEntitiesSavedStatesOpen","forceIsDirtyPublishPanel","undefined","shortcuts","previous","next"],"sources":["@wordpress/editor/src/components/editor-interface/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { InterfaceSkeleton, ComplementaryArea } from '@wordpress/interface';\nimport { useSelect } from '@wordpress/data';\nimport { __, _x } from '@wordpress/i18n';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tstore as blockEditorStore,\n\tBlockBreadcrumb,\n\tBlockToolbar,\n} from '@wordpress/block-editor';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useState, useCallback } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport EditorNotices from '../editor-notices';\nimport Header from '../header';\nimport InserterSidebar from '../inserter-sidebar';\nimport ListViewSidebar from '../list-view-sidebar';\nimport SavePublishPanels from '../save-publish-panels';\nimport TextEditor from '../text-editor';\nimport VisualEditor from '../visual-editor';\nimport EditorContentSlotFill from './content-slot-fill';\n\nconst interfaceLabels = {\n\t/* translators: accessibility text for the editor top bar landmark region. */\n\theader: __( 'Editor top bar' ),\n\t/* translators: accessibility text for the editor content landmark region. */\n\tbody: __( 'Editor content' ),\n\t/* translators: accessibility text for the editor settings landmark region. */\n\tsidebar: __( 'Editor settings' ),\n\t/* translators: accessibility text for the editor publish landmark region. */\n\tactions: __( 'Editor publish' ),\n\t/* translators: accessibility text for the editor footer landmark region. */\n\tfooter: __( 'Editor footer' ),\n};\n\nexport default function EditorInterface( {\n\tclassName,\n\tenableRegionNavigation,\n\tstyles,\n\tchildren,\n\tforceIsDirty,\n\tcontentRef,\n\tdisableIframe,\n\tautoFocus,\n\tcustomSaveButton,\n\tcustomSavePanel,\n\tforceDisableBlockTools,\n\ttitle,\n\ticon,\n\tiframeProps,\n} ) {\n\tconst {\n\t\tmode,\n\t\tisRichEditingEnabled,\n\t\tisInserterOpened,\n\t\tisListViewOpened,\n\t\tisDistractionFree,\n\t\tisPreviewMode,\n\t\tpreviousShortcut,\n\t\tnextShortcut,\n\t\tshowBlockBreadcrumbs,\n\t\tdocumentLabel,\n\t\tblockEditorMode,\n\t} = useSelect( ( select ) => {\n\t\tconst { get } = select( preferencesStore );\n\t\tconst { getEditorSettings, getPostTypeLabel } = select( editorStore );\n\t\tconst editorSettings = getEditorSettings();\n\t\tconst postTypeLabel = getPostTypeLabel();\n\n\t\treturn {\n\t\t\tmode: select( editorStore ).getEditorMode(),\n\t\t\tisRichEditingEnabled: editorSettings.richEditingEnabled,\n\t\t\tisInserterOpened: select( editorStore ).isInserterOpened(),\n\t\t\tisListViewOpened: select( editorStore ).isListViewOpened(),\n\t\t\tisDistractionFree: get( 'core', 'distractionFree' ),\n\t\t\tisPreviewMode: editorSettings.__unstableIsPreviewMode,\n\t\t\tpreviousShortcut: select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getAllShortcutKeyCombinations( 'core/editor/previous-region' ),\n\t\t\tnextShortcut: select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getAllShortcutKeyCombinations( 'core/editor/next-region' ),\n\t\t\tshowBlockBreadcrumbs: get( 'core', 'showBlockBreadcrumbs' ),\n\t\t\t// translators: Default label for the Document in the Block Breadcrumb.\n\t\t\tdocumentLabel: postTypeLabel || _x( 'Document', 'noun' ),\n\t\t\tblockEditorMode:\n\t\t\t\tselect( blockEditorStore ).__unstableGetEditorMode(),\n\t\t};\n\t}, [] );\n\tconst isWideViewport = useViewportMatch( 'large' );\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst secondarySidebarLabel = isListViewOpened\n\t\t? __( 'Document Overview' )\n\t\t: __( 'Block Library' );\n\n\t// Local state for save panel.\n\t// Note 'truthy' callback implies an open panel.\n\tconst [ entitiesSavedStatesCallback, setEntitiesSavedStatesCallback ] =\n\t\tuseState( false );\n\tconst closeEntitiesSavedStates = useCallback(\n\t\t( arg ) => {\n\t\t\tif ( typeof entitiesSavedStatesCallback === 'function' ) {\n\t\t\t\tentitiesSavedStatesCallback( arg );\n\t\t\t}\n\t\t\tsetEntitiesSavedStatesCallback( false );\n\t\t},\n\t\t[ entitiesSavedStatesCallback ]\n\t);\n\n\treturn (\n\t\t<InterfaceSkeleton\n\t\t\tenableRegionNavigation={ enableRegionNavigation }\n\t\t\tisDistractionFree={ isDistractionFree && isWideViewport }\n\t\t\tclassName={ clsx( 'editor-editor-interface', className, {\n\t\t\t\t'is-entity-save-view-open': !! entitiesSavedStatesCallback,\n\t\t\t\t'is-distraction-free':\n\t\t\t\t\tisDistractionFree && isWideViewport && ! isPreviewMode,\n\t\t\t} ) }\n\t\t\tlabels={ {\n\t\t\t\t...interfaceLabels,\n\t\t\t\tsecondarySidebar: secondarySidebarLabel,\n\t\t\t} }\n\t\t\theader={\n\t\t\t\t! isPreviewMode && (\n\t\t\t\t\t<Header\n\t\t\t\t\t\tforceIsDirty={ forceIsDirty }\n\t\t\t\t\t\tsetEntitiesSavedStatesCallback={\n\t\t\t\t\t\t\tsetEntitiesSavedStatesCallback\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcustomSaveButton={ customSaveButton }\n\t\t\t\t\t\tforceDisableBlockTools={ forceDisableBlockTools }\n\t\t\t\t\t\ttitle={ title }\n\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t/>\n\t\t\t\t)\n\t\t\t}\n\t\t\teditorNotices={ <EditorNotices /> }\n\t\t\tsecondarySidebar={\n\t\t\t\t! isPreviewMode &&\n\t\t\t\tmode === 'visual' &&\n\t\t\t\t( ( isInserterOpened && <InserterSidebar /> ) ||\n\t\t\t\t\t( isListViewOpened && <ListViewSidebar /> ) )\n\t\t\t}\n\t\t\tsidebar={\n\t\t\t\t! isPreviewMode &&\n\t\t\t\t! isDistractionFree && <ComplementaryArea.Slot scope=\"core\" />\n\t\t\t}\n\t\t\tcontent={\n\t\t\t\t<>\n\t\t\t\t\t{ ! isDistractionFree && ! isPreviewMode && (\n\t\t\t\t\t\t<EditorNotices />\n\t\t\t\t\t) }\n\n\t\t\t\t\t<EditorContentSlotFill.Slot>\n\t\t\t\t\t\t{ ( [ editorCanvasView ] ) =>\n\t\t\t\t\t\t\teditorCanvasView ? (\n\t\t\t\t\t\t\t\teditorCanvasView\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t{ ! isPreviewMode &&\n\t\t\t\t\t\t\t\t\t\t( mode === 'text' ||\n\t\t\t\t\t\t\t\t\t\t\t! isRichEditingEnabled ) && (\n\t\t\t\t\t\t\t\t\t\t\t<TextEditor\n\t\t\t\t\t\t\t\t\t\t\t\t// We should auto-focus the canvas (title) on load.\n\t\t\t\t\t\t\t\t\t\t\t\t// eslint-disable-next-line jsx-a11y/no-autofocus\n\t\t\t\t\t\t\t\t\t\t\t\tautoFocus={ autoFocus }\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t{ ! isPreviewMode &&\n\t\t\t\t\t\t\t\t\t\t! isLargeViewport &&\n\t\t\t\t\t\t\t\t\t\tmode === 'visual' && (\n\t\t\t\t\t\t\t\t\t\t\t<BlockToolbar hideDragHandle />\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t{ ( isPreviewMode ||\n\t\t\t\t\t\t\t\t\t\t( isRichEditingEnabled &&\n\t\t\t\t\t\t\t\t\t\t\tmode === 'visual' ) ) && (\n\t\t\t\t\t\t\t\t\t\t<VisualEditor\n\t\t\t\t\t\t\t\t\t\t\tstyles={ styles }\n\t\t\t\t\t\t\t\t\t\t\tcontentRef={ contentRef }\n\t\t\t\t\t\t\t\t\t\t\tdisableIframe={ disableIframe }\n\t\t\t\t\t\t\t\t\t\t\t// We should auto-focus the canvas (title) on load.\n\t\t\t\t\t\t\t\t\t\t\t// eslint-disable-next-line jsx-a11y/no-autofocus\n\t\t\t\t\t\t\t\t\t\t\tautoFocus={ autoFocus }\n\t\t\t\t\t\t\t\t\t\t\tiframeProps={ iframeProps }\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t{ children }\n\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\t\t\t\t\t</EditorContentSlotFill.Slot>\n\t\t\t\t</>\n\t\t\t}\n\t\t\tfooter={\n\t\t\t\t! isPreviewMode &&\n\t\t\t\t! isDistractionFree &&\n\t\t\t\tisLargeViewport &&\n\t\t\t\tshowBlockBreadcrumbs &&\n\t\t\t\tisRichEditingEnabled &&\n\t\t\t\tblockEditorMode !== 'zoom-out' &&\n\t\t\t\tmode === 'visual' && (\n\t\t\t\t\t<BlockBreadcrumb rootLabelText={ documentLabel } />\n\t\t\t\t)\n\t\t\t}\n\t\t\tactions={\n\t\t\t\t! isPreviewMode\n\t\t\t\t\t? customSavePanel || (\n\t\t\t\t\t\t\t<SavePublishPanels\n\t\t\t\t\t\t\t\tcloseEntitiesSavedStates={\n\t\t\t\t\t\t\t\t\tcloseEntitiesSavedStates\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tisEntitiesSavedStatesOpen={\n\t\t\t\t\t\t\t\t\tentitiesSavedStatesCallback\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tsetEntitiesSavedStatesCallback={\n\t\t\t\t\t\t\t\t\tsetEntitiesSavedStatesCallback\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tforceIsDirtyPublishPanel={ forceIsDirty }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AAc,CACzC,CACA,GACDoE,SACH;IACDC,SAAS,EAAG;MACXC,QAAQ,EAAEtD,gBAAgB;MAC1BuD,IAAI,EAAEtD;IACP;EAAG,CACH,CAAC;AAEJ","ignoreList":[]}
|
|
@@ -9,7 +9,6 @@ var _i18n = require("@wordpress/i18n");
|
|
|
9
9
|
var _data = require("@wordpress/data");
|
|
10
10
|
var _coreData = require("@wordpress/core-data");
|
|
11
11
|
var _htmlEntities = require("@wordpress/html-entities");
|
|
12
|
-
var _icons = require("@wordpress/icons");
|
|
13
12
|
var _store = require("../../store");
|
|
14
13
|
var _lockUnlock = require("../../lock-unlock");
|
|
15
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
@@ -58,17 +57,10 @@ function EntityRecordItem({
|
|
|
58
57
|
checked: checked,
|
|
59
58
|
onChange: onChange
|
|
60
59
|
})
|
|
61
|
-
}), hasPostMetaChanges && /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
children:
|
|
65
|
-
className: "entities-saved-states__connections-icon",
|
|
66
|
-
icon: _icons.connection,
|
|
67
|
-
size: 24
|
|
68
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
69
|
-
className: "entities-saved-states__bindings-text",
|
|
70
|
-
children: (0, _i18n.__)('Post Meta.')
|
|
71
|
-
})]
|
|
60
|
+
}), hasPostMetaChanges && /*#__PURE__*/(0, _jsxRuntime.jsx)("ul", {
|
|
61
|
+
className: "entities-saved-states__changes",
|
|
62
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("li", {
|
|
63
|
+
children: (0, _i18n.__)('Post Meta.')
|
|
72
64
|
})
|
|
73
65
|
})]
|
|
74
66
|
});
|