@wordpress/edit-post 7.16.0 → 7.17.1
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 +2 -0
- package/README.md +6 -1
- package/build/components/block-manager/category.js +1 -14
- package/build/components/block-manager/category.js.map +1 -1
- package/build/components/block-manager/checklist.js +1 -5
- package/build/components/block-manager/checklist.js.map +1 -1
- package/build/components/block-manager/index.js +11 -23
- package/build/components/block-manager/index.js.map +1 -1
- package/build/components/block-settings-menu/plugin-block-settings-menu-item.js +3 -11
- package/build/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
- package/build/components/browser-url/index.js +6 -23
- package/build/components/browser-url/index.js.map +1 -1
- package/build/components/device-preview/index.js +1 -11
- package/build/components/device-preview/index.js.map +1 -1
- package/build/components/editor-initialization/index.js +0 -2
- package/build/components/editor-initialization/index.js.map +1 -1
- package/build/components/editor-initialization/listener-hooks.js +1 -12
- package/build/components/editor-initialization/listener-hooks.js.map +1 -1
- package/build/components/header/document-actions/index.js +1 -17
- package/build/components/header/document-actions/index.js.map +1 -1
- package/build/components/header/fullscreen-mode-close/index.js +3 -22
- package/build/components/header/fullscreen-mode-close/index.js.map +1 -1
- package/build/components/header/header-toolbar/index.js +5 -22
- package/build/components/header/header-toolbar/index.js.map +1 -1
- package/build/components/header/header-toolbar/index.native.js +2 -24
- package/build/components/header/header-toolbar/index.native.js.map +1 -1
- package/build/components/header/index.js +3 -20
- package/build/components/header/index.js.map +1 -1
- package/build/components/header/index.native.js +1 -13
- package/build/components/header/index.native.js.map +1 -1
- package/build/components/header/main-dashboard-button/index.js +1 -7
- package/build/components/header/main-dashboard-button/index.js.map +1 -1
- package/build/components/header/mode-switcher/index.js +6 -21
- package/build/components/header/mode-switcher/index.js.map +1 -1
- package/build/components/header/more-menu/index.js +1 -12
- package/build/components/header/more-menu/index.js.map +1 -1
- package/build/components/header/plugin-more-menu-item/index.js +0 -8
- package/build/components/header/plugin-more-menu-item/index.js.map +1 -1
- package/build/components/header/plugin-sidebar-more-menu-item/index.js +3 -4
- package/build/components/header/plugin-sidebar-more-menu-item/index.js.map +1 -1
- package/build/components/header/post-publish-button-or-toggle.js +2 -11
- package/build/components/header/post-publish-button-or-toggle.js.map +1 -1
- package/build/components/header/preferences-menu-item/index.js +1 -7
- package/build/components/header/preferences-menu-item/index.js.map +1 -1
- package/build/components/header/tools-more-menu-group/index.js +1 -6
- package/build/components/header/tools-more-menu-group/index.js.map +1 -1
- package/build/components/header/writing-menu/index.js +1 -15
- package/build/components/header/writing-menu/index.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/config.js +1 -2
- package/build/components/keyboard-shortcut-help-modal/config.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +1 -9
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/index.js +4 -25
- package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/shortcut.js +1 -6
- package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
- package/build/components/keyboard-shortcuts/index.js +4 -23
- package/build/components/keyboard-shortcuts/index.js.map +1 -1
- package/build/components/layout/actions-panel.js +7 -17
- package/build/components/layout/actions-panel.js.map +1 -1
- package/build/components/layout/index.js +47 -82
- package/build/components/layout/index.js.map +1 -1
- package/build/components/layout/index.native.js +5 -34
- package/build/components/layout/index.native.js.map +1 -1
- package/build/components/meta-boxes/index.js +4 -12
- package/build/components/meta-boxes/index.js.map +1 -1
- package/build/components/meta-boxes/meta-box-visibility.js +1 -12
- package/build/components/meta-boxes/meta-box-visibility.js.map +1 -1
- package/build/components/meta-boxes/meta-boxes-area/index.js +0 -10
- package/build/components/meta-boxes/meta-boxes-area/index.js.map +1 -1
- package/build/components/preferences-modal/index.js +1 -18
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/preferences-modal/meta-boxes-section.js +3 -13
- package/build/components/preferences-modal/meta-boxes-section.js.map +1 -1
- package/build/components/preferences-modal/options/enable-custom-fields.js +10 -11
- package/build/components/preferences-modal/options/enable-custom-fields.js.map +1 -1
- package/build/components/preferences-modal/options/enable-feature.js +0 -7
- package/build/components/preferences-modal/options/enable-feature.js.map +1 -1
- package/build/components/preferences-modal/options/enable-panel.js +0 -7
- package/build/components/preferences-modal/options/enable-panel.js.map +1 -1
- package/build/components/preferences-modal/options/enable-plugin-document-setting-panel.js +1 -6
- package/build/components/preferences-modal/options/enable-plugin-document-setting-panel.js.map +1 -1
- package/build/components/preferences-modal/options/enable-publish-sidebar.js +2 -8
- package/build/components/preferences-modal/options/enable-publish-sidebar.js.map +1 -1
- package/build/components/preferences-modal/options/index.js +0 -6
- package/build/components/preferences-modal/options/index.js.map +1 -1
- package/build/components/secondary-sidebar/inserter-sidebar.js +1 -9
- package/build/components/secondary-sidebar/inserter-sidebar.js.map +1 -1
- package/build/components/secondary-sidebar/list-view-outline.js +1 -8
- package/build/components/secondary-sidebar/list-view-outline.js.map +1 -1
- package/build/components/secondary-sidebar/list-view-sidebar.js +32 -44
- package/build/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
- package/build/components/sidebar/discussion-panel/index.js +0 -11
- package/build/components/sidebar/discussion-panel/index.js.map +1 -1
- package/build/components/sidebar/featured-image/index.js +0 -15
- package/build/components/sidebar/featured-image/index.js.map +1 -1
- package/build/components/sidebar/last-revision/index.js +1 -5
- package/build/components/sidebar/last-revision/index.js.map +1 -1
- package/build/components/sidebar/page-attributes/index.js +0 -14
- package/build/components/sidebar/page-attributes/index.js.map +1 -1
- package/build/components/sidebar/plugin-document-setting-panel/index.js +44 -61
- package/build/components/sidebar/plugin-document-setting-panel/index.js.map +1 -1
- package/build/components/sidebar/plugin-post-publish-panel/index.js +19 -25
- package/build/components/sidebar/plugin-post-publish-panel/index.js.map +1 -1
- package/build/components/sidebar/plugin-post-status-info/index.js +2 -5
- package/build/components/sidebar/plugin-post-status-info/index.js.map +1 -1
- package/build/components/sidebar/plugin-pre-publish-panel/index.js +19 -25
- package/build/components/sidebar/plugin-pre-publish-panel/index.js.map +1 -1
- package/build/components/sidebar/plugin-sidebar/index.js +0 -8
- package/build/components/sidebar/plugin-sidebar/index.js.map +1 -1
- package/build/components/sidebar/post-author/index.js +1 -5
- package/build/components/sidebar/post-author/index.js.map +1 -1
- package/build/components/sidebar/post-excerpt/index.js +0 -13
- package/build/components/sidebar/post-excerpt/index.js.map +1 -1
- package/build/components/sidebar/post-format/index.js +1 -5
- package/build/components/sidebar/post-format/index.js.map +1 -1
- package/build/components/sidebar/post-pending-status/index.js +1 -5
- package/build/components/sidebar/post-pending-status/index.js.map +1 -1
- package/build/components/sidebar/post-schedule/index.js +5 -9
- package/build/components/sidebar/post-schedule/index.js.map +1 -1
- package/build/components/sidebar/post-slug/index.js +1 -5
- package/build/components/sidebar/post-slug/index.js.map +1 -1
- package/build/components/sidebar/post-status/index.js +0 -24
- package/build/components/sidebar/post-status/index.js.map +1 -1
- package/build/components/sidebar/post-sticky/index.js +1 -5
- package/build/components/sidebar/post-sticky/index.js.map +1 -1
- package/build/components/sidebar/post-taxonomies/index.js +1 -6
- package/build/components/sidebar/post-taxonomies/index.js.map +1 -1
- package/build/components/sidebar/post-taxonomies/taxonomy-panel.js +21 -29
- package/build/components/sidebar/post-taxonomies/taxonomy-panel.js.map +1 -1
- package/build/components/sidebar/post-template/create-modal.js +1 -16
- package/build/components/sidebar/post-template/create-modal.js.map +1 -1
- package/build/components/sidebar/post-template/form.js +3 -16
- package/build/components/sidebar/post-template/form.js.map +1 -1
- package/build/components/sidebar/post-template/index.js +5 -24
- package/build/components/sidebar/post-template/index.js.map +1 -1
- package/build/components/sidebar/post-trash/index.js +1 -3
- package/build/components/sidebar/post-trash/index.js.map +1 -1
- package/build/components/sidebar/post-url/index.js +5 -9
- package/build/components/sidebar/post-url/index.js.map +1 -1
- package/build/components/sidebar/post-visibility/index.js +5 -10
- package/build/components/sidebar/post-visibility/index.js.map +1 -1
- package/build/components/sidebar/settings-header/index.js +12 -17
- package/build/components/sidebar/settings-header/index.js.map +1 -1
- package/build/components/sidebar/settings-sidebar/index.js +2 -29
- package/build/components/sidebar/settings-sidebar/index.js.map +1 -1
- package/build/components/sidebar/template-summary/index.js +1 -9
- package/build/components/sidebar/template-summary/index.js.map +1 -1
- package/build/components/start-page-options/index.js +1 -15
- package/build/components/start-page-options/index.js.map +1 -1
- package/build/components/text-editor/index.js +1 -8
- package/build/components/text-editor/index.js.map +1 -1
- package/build/components/view-link/index.js +3 -10
- package/build/components/view-link/index.js.map +1 -1
- package/build/components/visual-editor/block-inspector-button.js +1 -11
- package/build/components/visual-editor/block-inspector-button.js.map +1 -1
- package/build/components/visual-editor/header.native.js +1 -12
- package/build/components/visual-editor/header.native.js.map +1 -1
- package/build/components/visual-editor/index.js +33 -53
- package/build/components/visual-editor/index.js.map +1 -1
- package/build/components/visual-editor/index.native.js +1 -9
- package/build/components/visual-editor/index.native.js.map +1 -1
- package/build/components/welcome-guide/default.js +1 -8
- package/build/components/welcome-guide/default.js.map +1 -1
- package/build/components/welcome-guide/image.js +0 -2
- package/build/components/welcome-guide/image.js.map +1 -1
- package/build/components/welcome-guide/index.js +1 -11
- package/build/components/welcome-guide/index.js.map +1 -1
- package/build/components/welcome-guide/template.js +1 -8
- package/build/components/welcome-guide/template.js.map +1 -1
- package/build/editor.js +7 -29
- package/build/editor.js.map +1 -1
- package/build/editor.native.js +10 -35
- package/build/editor.native.js.map +1 -1
- package/build/hooks/commands/use-common-commands.js +10 -24
- package/build/hooks/commands/use-common-commands.js.map +1 -1
- package/build/hooks/components/index.js +1 -3
- package/build/hooks/components/index.js.map +1 -1
- package/build/hooks/index.js +0 -1
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/validate-multiple-use/index.js +10 -18
- package/build/hooks/validate-multiple-use/index.js.map +1 -1
- package/build/index.js +14 -47
- package/build/index.js.map +1 -1
- package/build/index.native.js +0 -9
- package/build/index.native.js.map +1 -1
- package/build/lock-unlock.js +1 -2
- package/build/lock-unlock.js.map +1 -1
- package/build/plugins/copy-content-menu-item/index.js +1 -10
- package/build/plugins/copy-content-menu-item/index.js.map +1 -1
- package/build/plugins/index.js +5 -22
- package/build/plugins/index.js.map +1 -1
- package/build/plugins/keyboard-shortcuts-help-menu-item/index.js +1 -10
- package/build/plugins/keyboard-shortcuts-help-menu-item/index.js.map +1 -1
- package/build/plugins/welcome-guide-menu-item/index.js +1 -6
- package/build/plugins/welcome-guide-menu-item/index.js.map +1 -1
- package/build/store/actions.js +53 -120
- package/build/store/actions.js.map +1 -1
- package/build/store/constants.js +2 -3
- package/build/store/constants.js.map +1 -1
- package/build/store/index.js +0 -9
- package/build/store/index.js.map +1 -1
- package/build/store/reducer.js +9 -42
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +63 -91
- package/build/store/selectors.js.map +1 -1
- package/build/utils/meta-boxes.js +0 -4
- package/build/utils/meta-boxes.js.map +1 -1
- package/build-module/components/block-manager/category.js +1 -8
- package/build-module/components/block-manager/category.js.map +1 -1
- package/build-module/components/block-manager/checklist.js +0 -3
- package/build-module/components/block-manager/checklist.js.map +1 -1
- package/build-module/components/block-manager/index.js +11 -14
- package/build-module/components/block-manager/index.js.map +1 -1
- package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js +2 -8
- package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
- package/build-module/components/browser-url/index.js +7 -14
- package/build-module/components/browser-url/index.js.map +1 -1
- package/build-module/components/device-preview/index.js +1 -3
- package/build-module/components/device-preview/index.js.map +1 -1
- package/build-module/components/editor-initialization/index.js +1 -1
- package/build-module/components/editor-initialization/index.js.map +1 -1
- package/build-module/components/editor-initialization/listener-hooks.js +3 -5
- package/build-module/components/editor-initialization/listener-hooks.js.map +1 -1
- package/build-module/components/header/document-actions/index.js +1 -10
- package/build-module/components/header/document-actions/index.js.map +1 -1
- package/build-module/components/header/fullscreen-mode-close/index.js +4 -13
- package/build-module/components/header/fullscreen-mode-close/index.js.map +1 -1
- package/build-module/components/header/header-toolbar/index.js +5 -13
- package/build-module/components/header/header-toolbar/index.js.map +1 -1
- package/build-module/components/header/header-toolbar/index.native.js +3 -11
- package/build-module/components/header/header-toolbar/index.native.js.map +1 -1
- package/build-module/components/header/index.js +3 -5
- package/build-module/components/header/index.js.map +1 -1
- package/build-module/components/header/index.native.js +2 -9
- package/build-module/components/header/index.native.js.map +1 -1
- package/build-module/components/header/main-dashboard-button/index.js +0 -5
- package/build-module/components/header/main-dashboard-button/index.js.map +1 -1
- package/build-module/components/header/mode-switcher/index.js +8 -16
- package/build-module/components/header/mode-switcher/index.js.map +1 -1
- package/build-module/components/header/more-menu/index.js +1 -4
- package/build-module/components/header/more-menu/index.js.map +1 -1
- package/build-module/components/header/plugin-more-menu-item/index.js +1 -2
- package/build-module/components/header/plugin-more-menu-item/index.js.map +1 -1
- package/build-module/components/header/plugin-sidebar-more-menu-item/index.js +3 -2
- package/build-module/components/header/plugin-sidebar-more-menu-item/index.js.map +1 -1
- package/build-module/components/header/post-publish-button-or-toggle.js +2 -5
- package/build-module/components/header/post-publish-button-or-toggle.js.map +1 -1
- package/build-module/components/header/preferences-menu-item/index.js +1 -2
- package/build-module/components/header/preferences-menu-item/index.js.map +1 -1
- package/build-module/components/header/tools-more-menu-group/index.js +0 -3
- package/build-module/components/header/tools-more-menu-group/index.js.map +1 -1
- package/build-module/components/header/writing-menu/index.js +1 -8
- package/build-module/components/header/writing-menu/index.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/config.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +1 -6
- package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/index.js +5 -13
- package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +0 -5
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/index.js +4 -14
- package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
- package/build-module/components/layout/actions-panel.js +6 -8
- package/build-module/components/layout/actions-panel.js.map +1 -1
- package/build-module/components/layout/index.js +50 -57
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/layout/index.native.js +6 -20
- package/build-module/components/layout/index.native.js.map +1 -1
- package/build-module/components/meta-boxes/index.js +4 -6
- package/build-module/components/meta-boxes/index.js.map +1 -1
- package/build-module/components/meta-boxes/meta-box-visibility.js +1 -9
- package/build-module/components/meta-boxes/meta-box-visibility.js.map +1 -1
- package/build-module/components/meta-boxes/meta-boxes-area/index.js +3 -7
- package/build-module/components/meta-boxes/meta-boxes-area/index.js.map +1 -1
- package/build-module/components/preferences-modal/index.js +2 -5
- package/build-module/components/preferences-modal/index.js.map +1 -1
- package/build-module/components/preferences-modal/meta-boxes-section.js +3 -5
- package/build-module/components/preferences-modal/meta-boxes-section.js.map +1 -1
- package/build-module/components/preferences-modal/options/enable-custom-fields.js +9 -2
- package/build-module/components/preferences-modal/options/enable-custom-fields.js.map +1 -1
- package/build-module/components/preferences-modal/options/enable-feature.js +1 -1
- package/build-module/components/preferences-modal/options/enable-feature.js.map +1 -1
- package/build-module/components/preferences-modal/options/enable-panel.js +1 -1
- package/build-module/components/preferences-modal/options/enable-panel.js.map +1 -1
- package/build-module/components/preferences-modal/options/enable-plugin-document-setting-panel.js +1 -4
- package/build-module/components/preferences-modal/options/enable-plugin-document-setting-panel.js.map +1 -1
- package/build-module/components/preferences-modal/options/enable-publish-sidebar.js +2 -1
- package/build-module/components/preferences-modal/options/enable-publish-sidebar.js.map +1 -1
- package/build-module/components/preferences-modal/options/index.js.map +1 -1
- package/build-module/components/secondary-sidebar/inserter-sidebar.js +1 -2
- package/build-module/components/secondary-sidebar/inserter-sidebar.js.map +1 -1
- package/build-module/components/secondary-sidebar/list-view-outline.js +0 -3
- package/build-module/components/secondary-sidebar/list-view-outline.js.map +1 -1
- package/build-module/components/secondary-sidebar/list-view-sidebar.js +32 -30
- package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
- package/build-module/components/sidebar/discussion-panel/index.js +2 -7
- package/build-module/components/sidebar/discussion-panel/index.js.map +1 -1
- package/build-module/components/sidebar/featured-image/index.js +2 -7
- package/build-module/components/sidebar/featured-image/index.js.map +1 -1
- package/build-module/components/sidebar/last-revision/index.js +0 -3
- package/build-module/components/sidebar/last-revision/index.js.map +1 -1
- package/build-module/components/sidebar/page-attributes/index.js +2 -7
- package/build-module/components/sidebar/page-attributes/index.js.map +1 -1
- package/build-module/components/sidebar/plugin-document-setting-panel/index.js +46 -55
- package/build-module/components/sidebar/plugin-document-setting-panel/index.js.map +1 -1
- package/build-module/components/sidebar/plugin-post-publish-panel/index.js +19 -22
- package/build-module/components/sidebar/plugin-post-publish-panel/index.js.map +1 -1
- package/build-module/components/sidebar/plugin-post-status-info/index.js +1 -3
- package/build-module/components/sidebar/plugin-post-status-info/index.js.map +1 -1
- package/build-module/components/sidebar/plugin-pre-publish-panel/index.js +19 -22
- package/build-module/components/sidebar/plugin-pre-publish-panel/index.js.map +1 -1
- package/build-module/components/sidebar/plugin-sidebar/index.js +2 -3
- package/build-module/components/sidebar/plugin-sidebar/index.js.map +1 -1
- package/build-module/components/sidebar/post-author/index.js +0 -1
- package/build-module/components/sidebar/post-author/index.js.map +1 -1
- package/build-module/components/sidebar/post-excerpt/index.js +2 -7
- package/build-module/components/sidebar/post-excerpt/index.js.map +1 -1
- package/build-module/components/sidebar/post-format/index.js +0 -1
- package/build-module/components/sidebar/post-format/index.js.map +1 -1
- package/build-module/components/sidebar/post-pending-status/index.js +0 -1
- package/build-module/components/sidebar/post-pending-status/index.js.map +1 -1
- package/build-module/components/sidebar/post-schedule/index.js +4 -5
- package/build-module/components/sidebar/post-schedule/index.js.map +1 -1
- package/build-module/components/sidebar/post-slug/index.js +0 -1
- package/build-module/components/sidebar/post-slug/index.js.map +1 -1
- package/build-module/components/sidebar/post-status/index.js +2 -6
- package/build-module/components/sidebar/post-status/index.js.map +1 -1
- package/build-module/components/sidebar/post-sticky/index.js +0 -1
- package/build-module/components/sidebar/post-sticky/index.js.map +1 -1
- package/build-module/components/sidebar/post-taxonomies/index.js +1 -4
- package/build-module/components/sidebar/post-taxonomies/index.js.map +1 -1
- package/build-module/components/sidebar/post-taxonomies/taxonomy-panel.js +22 -26
- package/build-module/components/sidebar/post-taxonomies/taxonomy-panel.js.map +1 -1
- package/build-module/components/sidebar/post-template/create-modal.js +1 -10
- package/build-module/components/sidebar/post-template/create-modal.js.map +1 -1
- package/build-module/components/sidebar/post-template/form.js +3 -6
- package/build-module/components/sidebar/post-template/form.js.map +1 -1
- package/build-module/components/sidebar/post-template/index.js +5 -16
- package/build-module/components/sidebar/post-template/index.js.map +1 -1
- package/build-module/components/sidebar/post-trash/index.js +0 -1
- package/build-module/components/sidebar/post-trash/index.js.map +1 -1
- package/build-module/components/sidebar/post-url/index.js +4 -5
- package/build-module/components/sidebar/post-url/index.js.map +1 -1
- package/build-module/components/sidebar/post-visibility/index.js +4 -6
- package/build-module/components/sidebar/post-visibility/index.js.map +1 -1
- package/build-module/components/sidebar/settings-header/index.js +12 -13
- package/build-module/components/sidebar/settings-header/index.js.map +1 -1
- package/build-module/components/sidebar/settings-sidebar/index.js +2 -9
- package/build-module/components/sidebar/settings-sidebar/index.js.map +1 -1
- package/build-module/components/sidebar/template-summary/index.js +1 -6
- package/build-module/components/sidebar/template-summary/index.js.map +1 -1
- package/build-module/components/start-page-options/index.js +1 -8
- package/build-module/components/start-page-options/index.js.map +1 -1
- package/build-module/components/text-editor/index.js +1 -2
- package/build-module/components/text-editor/index.js.map +1 -1
- package/build-module/components/view-link/index.js +2 -3
- package/build-module/components/view-link/index.js.map +1 -1
- package/build-module/components/visual-editor/block-inspector-button.js +1 -5
- package/build-module/components/visual-editor/block-inspector-button.js.map +1 -1
- package/build-module/components/visual-editor/header.native.js +1 -4
- package/build-module/components/visual-editor/header.native.js.map +1 -1
- package/build-module/components/visual-editor/index.js +34 -43
- package/build-module/components/visual-editor/index.js.map +1 -1
- package/build-module/components/visual-editor/index.native.js +1 -5
- package/build-module/components/visual-editor/index.native.js.map +1 -1
- package/build-module/components/welcome-guide/default.js +1 -2
- package/build-module/components/welcome-guide/default.js.map +1 -1
- package/build-module/components/welcome-guide/image.js.map +1 -1
- package/build-module/components/welcome-guide/index.js +1 -6
- package/build-module/components/welcome-guide/index.js.map +1 -1
- package/build-module/components/welcome-guide/template.js +1 -2
- package/build-module/components/welcome-guide/template.js.map +1 -1
- package/build-module/editor.js +7 -14
- package/build-module/editor.js.map +1 -1
- package/build-module/editor.native.js +11 -23
- package/build-module/editor.native.js.map +1 -1
- package/build-module/hooks/commands/use-common-commands.js +11 -14
- package/build-module/hooks/commands/use-common-commands.js.map +1 -1
- package/build-module/hooks/components/index.js +0 -2
- package/build-module/hooks/components/index.js.map +1 -1
- package/build-module/hooks/index.js.map +1 -1
- package/build-module/hooks/validate-multiple-use/index.js +9 -11
- package/build-module/hooks/validate-multiple-use/index.js.map +1 -1
- package/build-module/index.js +16 -25
- package/build-module/index.js.map +1 -1
- package/build-module/index.native.js +2 -3
- package/build-module/index.native.js.map +1 -1
- package/build-module/lock-unlock.js.map +1 -1
- package/build-module/plugins/copy-content-menu-item/index.js +0 -3
- package/build-module/plugins/copy-content-menu-item/index.js.map +1 -1
- package/build-module/plugins/index.js +5 -11
- package/build-module/plugins/index.js.map +1 -1
- package/build-module/plugins/keyboard-shortcuts-help-menu-item/index.js +1 -2
- package/build-module/plugins/keyboard-shortcuts-help-menu-item/index.js.map +1 -1
- package/build-module/plugins/welcome-guide-menu-item/index.js +1 -2
- package/build-module/plugins/welcome-guide-menu-item/index.js.map +1 -1
- package/build-module/store/actions.js +55 -66
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/constants.js +2 -2
- package/build-module/store/constants.js.map +1 -1
- package/build-module/store/index.js +2 -2
- package/build-module/store/index.js.map +1 -1
- package/build-module/store/reducer.js +10 -33
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +63 -64
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/meta-boxes.js +0 -2
- package/build-module/utils/meta-boxes.js.map +1 -1
- package/build-style/style-rtl.css +21 -10
- package/build-style/style.css +21 -10
- package/package.json +32 -32
- package/src/components/keyboard-shortcut-help-modal/test/__snapshots__/index.js.snap +29 -0
- package/src/components/keyboard-shortcuts/index.js +2 -2
- package/src/components/layout/index.js +56 -40
- package/src/components/preferences-modal/options/enable-custom-fields.js +15 -4
- package/src/components/preferences-modal/options/test/enable-custom-fields.js +6 -1
- package/src/components/preferences-modal/test/index.js +7 -3
- package/src/components/secondary-sidebar/style.scss +2 -1
- package/src/components/sidebar/plugin-document-setting-panel/index.js +54 -65
- package/src/components/sidebar/plugin-post-publish-panel/index.js +23 -27
- package/src/components/sidebar/plugin-pre-publish-panel/index.js +25 -28
- package/src/components/sidebar/post-schedule/style.scss +2 -0
- package/src/components/sidebar/post-taxonomies/taxonomy-panel.js +19 -32
- package/src/components/visual-editor/index.js +9 -8
- package/src/components/visual-editor/style.scss +5 -1
- package/src/hooks/commands/use-common-commands.js +8 -12
- package/src/store/selectors.js +10 -3
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -116,6 +116,7 @@ function MyDocumentSettingPlugin() {
|
|
|
116
116
|
{
|
|
117
117
|
className: 'my-document-setting-plugin',
|
|
118
118
|
title: 'My Panel',
|
|
119
|
+
name: 'my-panel',
|
|
119
120
|
},
|
|
120
121
|
__( 'My Document Setting Panel' )
|
|
121
122
|
);
|
|
@@ -135,6 +136,7 @@ const MyDocumentSettingTest = () => (
|
|
|
135
136
|
<PluginDocumentSettingPanel
|
|
136
137
|
className="my-document-setting-plugin"
|
|
137
138
|
title="My Panel"
|
|
139
|
+
name="my-panel"
|
|
138
140
|
>
|
|
139
141
|
<p>My Document Setting Panel</p>
|
|
140
142
|
</PluginDocumentSettingPanel>
|
|
@@ -146,10 +148,11 @@ registerPlugin( 'document-setting-test', { render: MyDocumentSettingTest } );
|
|
|
146
148
|
_Parameters_
|
|
147
149
|
|
|
148
150
|
- _props_ `Object`: Component properties.
|
|
149
|
-
- _props.name_ `
|
|
151
|
+
- _props.name_ `string`: Required. A machine-friendly name for the panel.
|
|
150
152
|
- _props.className_ `[string]`: An optional class name added to the row.
|
|
151
153
|
- _props.title_ `[string]`: The title of the panel
|
|
152
154
|
- _props.icon_ `[WPBlockTypeIconRender]`: The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered when the sidebar is pinned to toolbar.
|
|
155
|
+
- _props.children_ `WPElement`: Children to be rendered
|
|
153
156
|
|
|
154
157
|
_Returns_
|
|
155
158
|
|
|
@@ -259,6 +262,7 @@ _Parameters_
|
|
|
259
262
|
- _props.title_ `[string]`: Title displayed at the top of the panel.
|
|
260
263
|
- _props.initialOpen_ `[boolean]`: Whether to have the panel initially opened. When no title is provided it is always opened.
|
|
261
264
|
- _props.icon_ `[WPBlockTypeIconRender]`: The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered when the sidebar is pinned to toolbar.
|
|
265
|
+
- _props.children_ `WPElement`: Children to be rendered
|
|
262
266
|
|
|
263
267
|
_Returns_
|
|
264
268
|
|
|
@@ -355,6 +359,7 @@ _Parameters_
|
|
|
355
359
|
- _props.title_ `[string]`: Title displayed at the top of the panel.
|
|
356
360
|
- _props.initialOpen_ `[boolean]`: Whether to have the panel initially opened. When no title is provided it is always opened.
|
|
357
361
|
- _props.icon_ `[WPBlockTypeIconRender]`: The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered when the sidebar is pinned to toolbar.
|
|
362
|
+
- _props.children_ `WPElement`: Children to be rendered
|
|
358
363
|
|
|
359
364
|
_Returns_
|
|
360
365
|
|
|
@@ -1,26 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = void 0;
|
|
9
|
-
|
|
10
8
|
var _element = require("@wordpress/element");
|
|
11
|
-
|
|
12
9
|
var _data = require("@wordpress/data");
|
|
13
|
-
|
|
14
10
|
var _compose = require("@wordpress/compose");
|
|
15
|
-
|
|
16
11
|
var _components = require("@wordpress/components");
|
|
17
|
-
|
|
18
12
|
var _editor = require("@wordpress/editor");
|
|
19
|
-
|
|
20
13
|
var _checklist = _interopRequireDefault(require("./checklist"));
|
|
21
|
-
|
|
22
14
|
var _store = require("../../store");
|
|
23
|
-
|
|
24
15
|
/**
|
|
25
16
|
* WordPress dependencies
|
|
26
17
|
*/
|
|
@@ -28,6 +19,7 @@ var _store = require("../../store");
|
|
|
28
19
|
/**
|
|
29
20
|
* Internal dependencies
|
|
30
21
|
*/
|
|
22
|
+
|
|
31
23
|
function BlockManagerCategory({
|
|
32
24
|
title,
|
|
33
25
|
blockTypes
|
|
@@ -52,7 +44,6 @@ function BlockManagerCategory({
|
|
|
52
44
|
if (defaultAllowedBlockTypes === true) {
|
|
53
45
|
return blockTypes;
|
|
54
46
|
}
|
|
55
|
-
|
|
56
47
|
return blockTypes.filter(({
|
|
57
48
|
name
|
|
58
49
|
}) => {
|
|
@@ -74,18 +65,15 @@ function BlockManagerCategory({
|
|
|
74
65
|
const blockNames = blockTypes.map(({
|
|
75
66
|
name
|
|
76
67
|
}) => name);
|
|
77
|
-
|
|
78
68
|
if (nextIsChecked) {
|
|
79
69
|
showBlockTypes(blockNames);
|
|
80
70
|
} else {
|
|
81
71
|
hideBlockTypes(blockNames);
|
|
82
72
|
}
|
|
83
73
|
}, [blockTypes]);
|
|
84
|
-
|
|
85
74
|
if (!filteredBlockTypes.length) {
|
|
86
75
|
return null;
|
|
87
76
|
}
|
|
88
|
-
|
|
89
77
|
const checkedBlockNames = filteredBlockTypes.map(({
|
|
90
78
|
name
|
|
91
79
|
}) => name).filter(type => !hiddenBlockTypes.includes(type));
|
|
@@ -111,7 +99,6 @@ function BlockManagerCategory({
|
|
|
111
99
|
onItemChange: toggleVisible
|
|
112
100
|
}));
|
|
113
101
|
}
|
|
114
|
-
|
|
115
102
|
var _default = BlockManagerCategory;
|
|
116
103
|
exports.default = _default;
|
|
117
104
|
//# sourceMappingURL=category.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["_element","require","_data","_compose","_components","_editor","_checklist","_interopRequireDefault","_store","BlockManagerCategory","title","blockTypes","instanceId","useInstanceId","defaultAllowedBlockTypes","hiddenBlockTypes","useSelect","select","getEditorSettings","editorStore","getHiddenBlockTypes","editPostStore","filteredBlockTypes","useMemo","filter","name","includes","showBlockTypes","hideBlockTypes","useDispatch","toggleVisible","useCallback","blockName","nextIsChecked","toggleAllVisible","blockNames","map","length","checkedBlockNames","type","titleId","isAllChecked","isIndeterminate","createElement","role","className","CheckboxControl","__nextHasNoMarginBottom","checked","onChange","indeterminate","label","id","default","value","onItemChange","_default","exports"],"sources":["@wordpress/edit-post/src/components/block-manager/category.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo, useCallback } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useInstanceId } from '@wordpress/compose';\nimport { CheckboxControl } from '@wordpress/components';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport BlockTypesChecklist from './checklist';\nimport { store as editPostStore } from '../../store';\n\nfunction BlockManagerCategory( { title, blockTypes } ) {\n\tconst instanceId = useInstanceId( BlockManagerCategory );\n\tconst { defaultAllowedBlockTypes, hiddenBlockTypes } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditorSettings } = select( editorStore );\n\t\t\tconst { getHiddenBlockTypes } = select( editPostStore );\n\t\t\treturn {\n\t\t\t\tdefaultAllowedBlockTypes:\n\t\t\t\t\tgetEditorSettings().defaultAllowedBlockTypes,\n\t\t\t\thiddenBlockTypes: getHiddenBlockTypes(),\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst filteredBlockTypes = useMemo( () => {\n\t\tif ( defaultAllowedBlockTypes === true ) {\n\t\t\treturn blockTypes;\n\t\t}\n\t\treturn blockTypes.filter( ( { name } ) => {\n\t\t\treturn defaultAllowedBlockTypes?.includes( name );\n\t\t} );\n\t}, [ defaultAllowedBlockTypes, blockTypes ] );\n\tconst { showBlockTypes, hideBlockTypes } = useDispatch( editPostStore );\n\tconst toggleVisible = useCallback( ( blockName, nextIsChecked ) => {\n\t\tif ( nextIsChecked ) {\n\t\t\tshowBlockTypes( blockName );\n\t\t} else {\n\t\t\thideBlockTypes( blockName );\n\t\t}\n\t}, [] );\n\tconst toggleAllVisible = useCallback(\n\t\t( nextIsChecked ) => {\n\t\t\tconst blockNames = blockTypes.map( ( { name } ) => name );\n\t\t\tif ( nextIsChecked ) {\n\t\t\t\tshowBlockTypes( blockNames );\n\t\t\t} else {\n\t\t\t\thideBlockTypes( blockNames );\n\t\t\t}\n\t\t},\n\t\t[ blockTypes ]\n\t);\n\n\tif ( ! filteredBlockTypes.length ) {\n\t\treturn null;\n\t}\n\n\tconst checkedBlockNames = filteredBlockTypes\n\t\t.map( ( { name } ) => name )\n\t\t.filter( ( type ) => ! hiddenBlockTypes.includes( type ) );\n\n\tconst titleId = 'edit-post-block-manager__category-title-' + instanceId;\n\n\tconst isAllChecked = checkedBlockNames.length === filteredBlockTypes.length;\n\tconst isIndeterminate = ! isAllChecked && checkedBlockNames.length > 0;\n\n\treturn (\n\t\t<div\n\t\t\trole=\"group\"\n\t\t\taria-labelledby={ titleId }\n\t\t\tclassName=\"edit-post-block-manager__category\"\n\t\t>\n\t\t\t<CheckboxControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\tchecked={ isAllChecked }\n\t\t\t\tonChange={ toggleAllVisible }\n\t\t\t\tclassName=\"edit-post-block-manager__category-title\"\n\t\t\t\tindeterminate={ isIndeterminate }\n\t\t\t\tlabel={ <span id={ titleId }>{ title }</span> }\n\t\t\t/>\n\t\t\t<BlockTypesChecklist\n\t\t\t\tblockTypes={ filteredBlockTypes }\n\t\t\t\tvalue={ checkedBlockNames }\n\t\t\t\tonItemChange={ toggleVisible }\n\t\t\t/>\n\t\t</div>\n\t);\n}\n\nexport default BlockManagerCategory;\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AAKA,IAAAK,UAAA,GAAAC,sBAAA,CAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AAbA;AACA;AACA;;AAOA;AACA;AACA;;AAIA,SAASQ,oBAAoBA,CAAE;EAAEC,KAAK;EAAEC;AAAW,CAAC,EAAG;EACtD,MAAMC,UAAU,GAAG,IAAAC,sBAAa,EAAEJ,oBAAqB,CAAC;EACxD,MAAM;IAAEK,wBAAwB;IAAEC;EAAiB,CAAC,GAAG,IAAAC,eAAS,EAC7DC,MAAM,IAAM;IACb,MAAM;MAAEC;IAAkB,CAAC,GAAGD,MAAM,CAAEE,aAAY,CAAC;IACnD,MAAM;MAAEC;IAAoB,CAAC,GAAGH,MAAM,CAAEI,YAAc,CAAC;IACvD,OAAO;MACNP,wBAAwB,EACvBI,iBAAiB,CAAC,CAAC,CAACJ,wBAAwB;MAC7CC,gBAAgB,EAAEK,mBAAmB,CAAC;IACvC,CAAC;EACF,CAAC,EACD,EACD,CAAC;EACD,MAAME,kBAAkB,GAAG,IAAAC,gBAAO,EAAE,MAAM;IACzC,IAAKT,wBAAwB,KAAK,IAAI,EAAG;MACxC,OAAOH,UAAU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Ae,GAAG,CAAED,YAAY,IAAIH,iBAAiB,CAACD,MAAM,GAAG,CAAC;EAEtE,OACC,IAAArC,QAAA,CAAA2C,aAAA;IACCC,IAAI,EAAC,OAAO;IACZ,mBAAkBJ,OAAS;IAC3BK,SAAS,EAAC;EAAmC,GAE7C,IAAA7C,QAAA,CAAA2C,aAAA,EAACvC,WAAA,CAAA0C,eAAe;IACfC,uBAAuB;IACvBC,OAAO,EAAGP,YAAc;IACxBQ,QAAQ,EAAGf,gBAAkB;IAC7BW,SAAS,EAAC,yCAAyC;IACnDK,aAAa,EAAGR,eAAiB;IACjCS,KAAK,EAAG,IAAAnD,QAAA,CAAA2C,aAAA;MAAMS,EAAE,EAAGZ;IAAS,GAAG9B,KAAa;EAAG,CAC/C,CAAC,EACF,IAAAV,QAAA,CAAA2C,aAAA,EAACrC,UAAA,CAAA+C,OAAmB;IACnB1C,UAAU,EAAGW,kBAAoB;IACjCgC,KAAK,EAAGhB,iBAAmB;IAC3BiB,YAAY,EAAGzB;EAAe,CAC9B,CACG,CAAC;AAER;AAAC,IAAA0B,QAAA,GAEc/C,oBAAoB;AAAAgD,OAAA,CAAAJ,OAAA,GAAAG,QAAA"}
|
|
@@ -4,16 +4,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _element = require("@wordpress/element");
|
|
9
|
-
|
|
10
8
|
var _blockEditor = require("@wordpress/block-editor");
|
|
11
|
-
|
|
12
9
|
var _components = require("@wordpress/components");
|
|
13
|
-
|
|
14
10
|
/**
|
|
15
11
|
* WordPress dependencies
|
|
16
12
|
*/
|
|
13
|
+
|
|
17
14
|
function BlockTypesChecklist({
|
|
18
15
|
blockTypes,
|
|
19
16
|
value,
|
|
@@ -33,7 +30,6 @@ function BlockTypesChecklist({
|
|
|
33
30
|
icon: blockType.icon
|
|
34
31
|
}))));
|
|
35
32
|
}
|
|
36
|
-
|
|
37
33
|
var _default = BlockTypesChecklist;
|
|
38
34
|
exports.default = _default;
|
|
39
35
|
//# sourceMappingURL=checklist.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["_blockEditor","require","_components","BlockTypesChecklist","blockTypes","value","onItemChange","_element","createElement","className","map","blockType","key","name","CheckboxControl","__nextHasNoMarginBottom","label","title","checked","includes","onChange","args","BlockIcon","icon","_default","exports","default"],"sources":["@wordpress/edit-post/src/components/block-manager/checklist.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { BlockIcon } from '@wordpress/block-editor';\nimport { CheckboxControl } from '@wordpress/components';\n\nfunction BlockTypesChecklist( { blockTypes, value, onItemChange } ) {\n\treturn (\n\t\t<ul className=\"edit-post-block-manager__checklist\">\n\t\t\t{ blockTypes.map( ( blockType ) => (\n\t\t\t\t<li\n\t\t\t\t\tkey={ blockType.name }\n\t\t\t\t\tclassName=\"edit-post-block-manager__checklist-item\"\n\t\t\t\t>\n\t\t\t\t\t<CheckboxControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ blockType.title }\n\t\t\t\t\t\tchecked={ value.includes( blockType.name ) }\n\t\t\t\t\t\tonChange={ ( ...args ) =>\n\t\t\t\t\t\t\tonItemChange( blockType.name, ...args )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t\t<BlockIcon icon={ blockType.icon } />\n\t\t\t\t</li>\n\t\t\t) ) }\n\t\t</ul>\n\t);\n}\n\nexport default BlockTypesChecklist;\n"],"mappings":";;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAJA;AACA;AACA;;AAIA,SAASE,mBAAmBA,CAAE;EAAEC,UAAU;EAAEC,KAAK;EAAEC;AAAa,CAAC,EAAG;EACnE,OACC,IAAAC,QAAA,CAAAC,aAAA;IAAIC,SAAS,EAAC;EAAoC,GAC/CL,UAAU,CAACM,GAAG,CAAIC,SAAS,IAC5B,IAAAJ,QAAA,CAAAC,aAAA;IACCI,GAAG,EAAGD,SAAS,CAACE,IAAM;IACtBJ,SAAS,EAAC;EAAyC,GAEnD,IAAAF,QAAA,CAAAC,aAAA,EAACN,WAAA,CAAAY,eAAe;IACfC,uBAAuB;IACvBC,KAAK,EAAGL,SAAS,CAACM,KAAO;IACzBC,OAAO,EAAGb,KAAK,CAACc,QAAQ,CAAER,SAAS,CAACE,IAAK,CAAG;IAC5CO,QAAQ,EAAGA,CAAE,GAAGC,IAAI,KACnBf,YAAY,CAAEK,SAAS,CAACE,IAAI,EAAE,GAAGQ,IAAK;EACtC,CACD,CAAC,EACF,IAAAd,QAAA,CAAAC,aAAA,EAACR,YAAA,CAAAsB,SAAS;IAACC,IAAI,EAAGZ,SAAS,CAACY;EAAM,CAAE,CACjC,CACH,CACC,CAAC;AAEP;AAAC,IAAAC,QAAA,GAEcrB,mBAAmB;AAAAsB,OAAA,CAAAC,OAAA,GAAAF,QAAA"}
|
|
@@ -1,30 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = void 0;
|
|
9
|
-
|
|
10
8
|
var _element = require("@wordpress/element");
|
|
11
|
-
|
|
12
9
|
var _blocks = require("@wordpress/blocks");
|
|
13
|
-
|
|
14
10
|
var _data = require("@wordpress/data");
|
|
15
|
-
|
|
16
11
|
var _components = require("@wordpress/components");
|
|
17
|
-
|
|
18
12
|
var _i18n = require("@wordpress/i18n");
|
|
19
|
-
|
|
20
13
|
var _compose = require("@wordpress/compose");
|
|
21
|
-
|
|
22
14
|
var _a11y = require("@wordpress/a11y");
|
|
23
|
-
|
|
24
15
|
var _category = _interopRequireDefault(require("./category"));
|
|
25
|
-
|
|
26
16
|
var _store = require("../../store");
|
|
27
|
-
|
|
28
17
|
/**
|
|
29
18
|
* WordPress dependencies
|
|
30
19
|
*/
|
|
@@ -32,6 +21,7 @@ var _store = require("../../store");
|
|
|
32
21
|
/**
|
|
33
22
|
* Internal dependencies
|
|
34
23
|
*/
|
|
24
|
+
|
|
35
25
|
function BlockManager({
|
|
36
26
|
blockTypes,
|
|
37
27
|
categories,
|
|
@@ -41,20 +31,20 @@ function BlockManager({
|
|
|
41
31
|
enableAllBlockTypes
|
|
42
32
|
}) {
|
|
43
33
|
const debouncedSpeak = (0, _compose.useDebounce)(_a11y.speak, 500);
|
|
44
|
-
const [search, setSearch] = (0, _element.useState)('');
|
|
34
|
+
const [search, setSearch] = (0, _element.useState)('');
|
|
35
|
+
|
|
36
|
+
// Filtering occurs here (as opposed to `withSelect`) to avoid
|
|
45
37
|
// wasted renders by consequence of `Array#filter` producing
|
|
46
38
|
// a new value reference on each call.
|
|
39
|
+
blockTypes = blockTypes.filter(blockType => hasBlockSupport(blockType, 'inserter', true) && (!search || isMatchingSearchTerm(blockType, search)) && (!blockType.parent || blockType.parent.includes('core/post-content')));
|
|
47
40
|
|
|
48
|
-
|
|
49
|
-
|
|
41
|
+
// Announce search results on change
|
|
50
42
|
(0, _element.useEffect)(() => {
|
|
51
43
|
if (!search) {
|
|
52
44
|
return;
|
|
53
45
|
}
|
|
54
|
-
|
|
55
46
|
const count = blockTypes.length;
|
|
56
|
-
const resultsFoundMessage = (0, _i18n.sprintf)(
|
|
57
|
-
/* translators: %d: number of results. */
|
|
47
|
+
const resultsFoundMessage = (0, _i18n.sprintf)( /* translators: %d: number of results. */
|
|
58
48
|
(0, _i18n._n)('%d result found.', '%d results found.', count), count);
|
|
59
49
|
debouncedSpeak(resultsFoundMessage);
|
|
60
50
|
}, [blockTypes.length, search, debouncedSpeak]);
|
|
@@ -62,8 +52,7 @@ function BlockManager({
|
|
|
62
52
|
className: "edit-post-block-manager__content"
|
|
63
53
|
}, !!numberOfHiddenBlocks && (0, _element.createElement)("div", {
|
|
64
54
|
className: "edit-post-block-manager__disabled-blocks-count"
|
|
65
|
-
}, (0, _i18n.sprintf)(
|
|
66
|
-
/* translators: %d: number of blocks. */
|
|
55
|
+
}, (0, _i18n.sprintf)( /* translators: %d: number of blocks. */
|
|
67
56
|
(0, _i18n._n)('%d block is hidden.', '%d blocks are hidden.', numberOfHiddenBlocks), numberOfHiddenBlocks), (0, _element.createElement)(_components.Button, {
|
|
68
57
|
variant: "link",
|
|
69
58
|
onClick: () => enableAllBlockTypes(blockTypes)
|
|
@@ -92,7 +81,6 @@ function BlockManager({
|
|
|
92
81
|
}) => !category)
|
|
93
82
|
})));
|
|
94
83
|
}
|
|
95
|
-
|
|
96
84
|
var _default = (0, _compose.compose)([(0, _data.withSelect)(select => {
|
|
97
85
|
const {
|
|
98
86
|
getBlockTypes,
|
|
@@ -102,12 +90,13 @@ var _default = (0, _compose.compose)([(0, _data.withSelect)(select => {
|
|
|
102
90
|
} = select(_blocks.store);
|
|
103
91
|
const {
|
|
104
92
|
getHiddenBlockTypes
|
|
105
|
-
} = select(_store.store);
|
|
93
|
+
} = select(_store.store);
|
|
94
|
+
|
|
95
|
+
// Some hidden blocks become unregistered
|
|
106
96
|
// by removing for instance the plugin that registered them, yet
|
|
107
97
|
// they're still remain as hidden by the user's action.
|
|
108
98
|
// We consider "hidden", blocks which were hidden and
|
|
109
99
|
// are still registered.
|
|
110
|
-
|
|
111
100
|
const blockTypes = getBlockTypes();
|
|
112
101
|
const hiddenBlockTypes = getHiddenBlockTypes().filter(hiddenBlock => {
|
|
113
102
|
return blockTypes.some(registeredBlock => registeredBlock.name === hiddenBlock);
|
|
@@ -133,6 +122,5 @@ var _default = (0, _compose.compose)([(0, _data.withSelect)(select => {
|
|
|
133
122
|
}
|
|
134
123
|
};
|
|
135
124
|
})])(BlockManager);
|
|
136
|
-
|
|
137
125
|
exports.default = _default;
|
|
138
126
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["_element","require","_blocks","_data","_components","_i18n","_compose","_a11y","_category","_interopRequireDefault","_store","BlockManager","blockTypes","categories","hasBlockSupport","isMatchingSearchTerm","numberOfHiddenBlocks","enableAllBlockTypes","debouncedSpeak","useDebounce","speak","search","setSearch","useState","filter","blockType","parent","includes","useEffect","count","length","resultsFoundMessage","sprintf","_n","createElement","className","Button","variant","onClick","__","SearchControl","__nextHasNoMarginBottom","label","placeholder","value","onChange","nextSearch","tabIndex","role","map","category","default","key","slug","title","_default","compose","withSelect","select","getBlockTypes","getCategories","blocksStore","getHiddenBlockTypes","editPostStore","hiddenBlockTypes","hiddenBlock","some","registeredBlock","name","Array","isArray","withDispatch","dispatch","showBlockTypes","blockNames","exports"],"sources":["@wordpress/edit-post/src/components/block-manager/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { SearchControl, Button } from '@wordpress/components';\nimport { __, _n, sprintf } from '@wordpress/i18n';\nimport { useEffect, useState } from '@wordpress/element';\nimport { useDebounce, compose } from '@wordpress/compose';\nimport { speak } from '@wordpress/a11y';\n\n/**\n * Internal dependencies\n */\nimport BlockManagerCategory from './category';\nimport { store as editPostStore } from '../../store';\n\nfunction BlockManager( {\n\tblockTypes,\n\tcategories,\n\thasBlockSupport,\n\tisMatchingSearchTerm,\n\tnumberOfHiddenBlocks,\n\tenableAllBlockTypes,\n} ) {\n\tconst debouncedSpeak = useDebounce( speak, 500 );\n\tconst [ search, setSearch ] = useState( '' );\n\n\t// Filtering occurs here (as opposed to `withSelect`) to avoid\n\t// wasted renders by consequence of `Array#filter` producing\n\t// a new value reference on each call.\n\tblockTypes = blockTypes.filter(\n\t\t( blockType ) =>\n\t\t\thasBlockSupport( blockType, 'inserter', true ) &&\n\t\t\t( ! search || isMatchingSearchTerm( blockType, search ) ) &&\n\t\t\t( ! blockType.parent ||\n\t\t\t\tblockType.parent.includes( 'core/post-content' ) )\n\t);\n\n\t// Announce search results on change\n\tuseEffect( () => {\n\t\tif ( ! search ) {\n\t\t\treturn;\n\t\t}\n\t\tconst count = blockTypes.length;\n\t\tconst resultsFoundMessage = sprintf(\n\t\t\t/* translators: %d: number of results. */\n\t\t\t_n( '%d result found.', '%d results found.', count ),\n\t\t\tcount\n\t\t);\n\t\tdebouncedSpeak( resultsFoundMessage );\n\t}, [ blockTypes.length, search, debouncedSpeak ] );\n\n\treturn (\n\t\t<div className=\"edit-post-block-manager__content\">\n\t\t\t{ !! numberOfHiddenBlocks && (\n\t\t\t\t<div className=\"edit-post-block-manager__disabled-blocks-count\">\n\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t/* translators: %d: number of blocks. */\n\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t'%d block is hidden.',\n\t\t\t\t\t\t\t'%d blocks are hidden.',\n\t\t\t\t\t\t\tnumberOfHiddenBlocks\n\t\t\t\t\t\t),\n\t\t\t\t\t\tnumberOfHiddenBlocks\n\t\t\t\t\t) }\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"link\"\n\t\t\t\t\t\tonClick={ () => enableAllBlockTypes( blockTypes ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Reset' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t\t<SearchControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\tlabel={ __( 'Search for a block' ) }\n\t\t\t\tplaceholder={ __( 'Search for a block' ) }\n\t\t\t\tvalue={ search }\n\t\t\t\tonChange={ ( nextSearch ) => setSearch( nextSearch ) }\n\t\t\t\tclassName=\"edit-post-block-manager__search\"\n\t\t\t/>\n\t\t\t<div\n\t\t\t\ttabIndex=\"0\"\n\t\t\t\trole=\"region\"\n\t\t\t\taria-label={ __( 'Available block types' ) }\n\t\t\t\tclassName=\"edit-post-block-manager__results\"\n\t\t\t>\n\t\t\t\t{ blockTypes.length === 0 && (\n\t\t\t\t\t<p className=\"edit-post-block-manager__no-results\">\n\t\t\t\t\t\t{ __( 'No blocks found.' ) }\n\t\t\t\t\t</p>\n\t\t\t\t) }\n\t\t\t\t{ categories.map( ( category ) => (\n\t\t\t\t\t<BlockManagerCategory\n\t\t\t\t\t\tkey={ category.slug }\n\t\t\t\t\t\ttitle={ category.title }\n\t\t\t\t\t\tblockTypes={ blockTypes.filter(\n\t\t\t\t\t\t\t( blockType ) =>\n\t\t\t\t\t\t\t\tblockType.category === category.slug\n\t\t\t\t\t\t) }\n\t\t\t\t\t/>\n\t\t\t\t) ) }\n\t\t\t\t<BlockManagerCategory\n\t\t\t\t\ttitle={ __( 'Uncategorized' ) }\n\t\t\t\t\tblockTypes={ blockTypes.filter(\n\t\t\t\t\t\t( { category } ) => ! category\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetBlockTypes,\n\t\t\tgetCategories,\n\t\t\thasBlockSupport,\n\t\t\tisMatchingSearchTerm,\n\t\t} = select( blocksStore );\n\t\tconst { getHiddenBlockTypes } = select( editPostStore );\n\n\t\t// Some hidden blocks become unregistered\n\t\t// by removing for instance the plugin that registered them, yet\n\t\t// they're still remain as hidden by the user's action.\n\t\t// We consider \"hidden\", blocks which were hidden and\n\t\t// are still registered.\n\t\tconst blockTypes = getBlockTypes();\n\t\tconst hiddenBlockTypes = getHiddenBlockTypes().filter(\n\t\t\t( hiddenBlock ) => {\n\t\t\t\treturn blockTypes.some(\n\t\t\t\t\t( registeredBlock ) => registeredBlock.name === hiddenBlock\n\t\t\t\t);\n\t\t\t}\n\t\t);\n\t\tconst numberOfHiddenBlocks =\n\t\t\tArray.isArray( hiddenBlockTypes ) && hiddenBlockTypes.length;\n\n\t\treturn {\n\t\t\tblockTypes,\n\t\t\tcategories: getCategories(),\n\t\t\thasBlockSupport,\n\t\t\tisMatchingSearchTerm,\n\t\t\tnumberOfHiddenBlocks,\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { showBlockTypes } = dispatch( editPostStore );\n\t\treturn {\n\t\t\tenableAllBlockTypes: ( blockTypes ) => {\n\t\t\t\tconst blockNames = blockTypes.map( ( { name } ) => name );\n\t\t\t\tshowBlockTypes( blockNames );\n\t\t\t},\n\t\t};\n\t} ),\n] )( BlockManager );\n"],"mappings":";;;;;;;AAOA,IAAAA,QAAA,GAAAC,OAAA;AAJA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AAEA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAAAN,OAAA;AAKA,IAAAO,SAAA,GAAAC,sBAAA,CAAAR,OAAA;AACA,IAAAS,MAAA,GAAAT,OAAA;AAfA;AACA;AACA;;AASA;AACA;AACA;;AAIA,SAASU,YAAYA,CAAE;EACtBC,UAAU;EACVC,UAAU;EACVC,eAAe;EACfC,oBAAoB;EACpBC,oBAAoB;EACpBC;AACD,CAAC,EAAG;EACH,MAAMC,cAAc,GAAG,IAAAC,oBAAW,EAAEC,WAAK,EAAE,GAAI,CAAC;EAChD,MAAM,CAAEC,MAAM,EAAEC,SAAS,CAAE,GAAG,IAAAC,iBAAQ,EAAE,EAAG,CAAC;;EAE5C;EACA;EACA;EACAX,UAAU,GAAGA,UAAU,CAACY,MAAM,CAC3BC,SAAS,IACVX,eAAe,CAAEW,SAAS,EAAE,UAAU,EAAE,IAAK,CAAC,KAC5C,CAAEJ,MAAM,IAAIN,oBAAoB,CAAEU,SAAS,EAAEJ,MAAO,CAAC,CAAE,KACvD,CAAEI,SAAS,CAACC,MAAM,IACnBD,SAAS,CAACC,MAAM,CAACC,QAAQ,CAAE,mBAAoB,CAAC,CACnD,CAAC;;EAED;EACA,IAAAC,kBAAS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CAACC,IAAI,KAAKH,WACjD,CAAC;EACF,CACD,CAAC;EACD,MAAMjD,oBAAoB,GACzBqD,KAAK,CAACC,OAAO,CAAEN,gBAAiB,CAAC,IAAIA,gBAAgB,CAAClC,MAAM;EAE7D,OAAO;IACNlB,UAAU;IACVC,UAAU,EAAE+C,aAAa,CAAC,CAAC;IAC3B9C,eAAe;IACfC,oBAAoB;IACpBC;EACD,CAAC;AACF,CAAE,CAAC,EACH,IAAAuD,kBAAY,EAAIC,QAAQ,IAAM;EAC7B,MAAM;IAAEC;EAAe,CAAC,GAAGD,QAAQ,CAAET,YAAc,CAAC;EACpD,OAAO;IACN9C,mBAAmB,EAAIL,UAAU,IAAM;MACtC,MAAM8D,UAAU,GAAG9D,UAAU,CAACqC,GAAG,CAAE,CAAE;QAAEmB;MAAK,CAAC,KAAMA,IAAK,CAAC;MACzDK,cAAc,CAAEC,UAAW,CAAC;IAC7B;EACD,CAAC;AACF,CAAE,CAAC,CACF,CAAC,CAAE/D,YAAa,CAAC;AAAAgE,OAAA,CAAAxB,OAAA,GAAAI,QAAA"}
|
|
@@ -4,19 +4,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _element = require("@wordpress/element");
|
|
9
|
-
|
|
10
8
|
var _blockEditor = require("@wordpress/block-editor");
|
|
11
|
-
|
|
12
9
|
var _components = require("@wordpress/components");
|
|
13
|
-
|
|
14
10
|
var _compose = require("@wordpress/compose");
|
|
15
|
-
|
|
16
11
|
/**
|
|
17
12
|
* WordPress dependencies
|
|
18
13
|
*/
|
|
14
|
+
|
|
19
15
|
const isEverySelectedBlockAllowed = (selected, allowed) => selected.filter(id => !allowed.includes(id)).length === 0;
|
|
16
|
+
|
|
20
17
|
/**
|
|
21
18
|
* Plugins may want to add an item to the menu either for every block
|
|
22
19
|
* or only for the specific ones provided in the `allowedBlocks` component property.
|
|
@@ -28,9 +25,8 @@ const isEverySelectedBlockAllowed = (selected, allowed) => selected.filter(id =>
|
|
|
28
25
|
* @param {string[]} allowedBlocks Array containing the names of the blocks allowed
|
|
29
26
|
* @return {boolean} Whether the item will be rendered or not.
|
|
30
27
|
*/
|
|
31
|
-
|
|
32
|
-
|
|
33
28
|
const shouldRenderItem = (selectedBlocks, allowedBlocks) => !Array.isArray(allowedBlocks) || isEverySelectedBlockAllowed(selectedBlocks, allowedBlocks);
|
|
29
|
+
|
|
34
30
|
/**
|
|
35
31
|
* Renders a new item in the block settings menu.
|
|
36
32
|
*
|
|
@@ -86,8 +82,6 @@ const shouldRenderItem = (selectedBlocks, allowedBlocks) => !Array.isArray(allow
|
|
|
86
82
|
*
|
|
87
83
|
* @return {WPComponent} The component to be rendered.
|
|
88
84
|
*/
|
|
89
|
-
|
|
90
|
-
|
|
91
85
|
const PluginBlockSettingsMenuItem = ({
|
|
92
86
|
allowedBlocks,
|
|
93
87
|
icon,
|
|
@@ -102,7 +96,6 @@ const PluginBlockSettingsMenuItem = ({
|
|
|
102
96
|
if (!shouldRenderItem(selectedBlocks, allowedBlocks)) {
|
|
103
97
|
return null;
|
|
104
98
|
}
|
|
105
|
-
|
|
106
99
|
return (0, _element.createElement)(_components.MenuItem, {
|
|
107
100
|
onClick: (0, _compose.compose)(onClick, onClose),
|
|
108
101
|
icon: icon,
|
|
@@ -110,7 +103,6 @@ const PluginBlockSettingsMenuItem = ({
|
|
|
110
103
|
role: role
|
|
111
104
|
}, !small && label);
|
|
112
105
|
});
|
|
113
|
-
|
|
114
106
|
var _default = PluginBlockSettingsMenuItem;
|
|
115
107
|
exports.default = _default;
|
|
116
108
|
//# sourceMappingURL=plugin-block-settings-menu-item.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["_blockEditor","require","_components","_compose","isEverySelectedBlockAllowed","selected","allowed","filter","id","includes","length","shouldRenderItem","selectedBlocks","allowedBlocks","Array","isArray","PluginBlockSettingsMenuItem","icon","label","onClick","small","role","_element","createElement","BlockSettingsMenuControls","onClose","MenuItem","compose","undefined","_default","exports","default"],"sources":["@wordpress/edit-post/src/components/block-settings-menu/plugin-block-settings-menu-item.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { BlockSettingsMenuControls } from '@wordpress/block-editor';\nimport { MenuItem } from '@wordpress/components';\nimport { compose } from '@wordpress/compose';\n\nconst isEverySelectedBlockAllowed = ( selected, allowed ) =>\n\tselected.filter( ( id ) => ! allowed.includes( id ) ).length === 0;\n\n/**\n * Plugins may want to add an item to the menu either for every block\n * or only for the specific ones provided in the `allowedBlocks` component property.\n *\n * If there are multiple blocks selected the item will be rendered if every block\n * is of one allowed type (not necessarily the same).\n *\n * @param {string[]} selectedBlocks Array containing the names of the blocks selected\n * @param {string[]} allowedBlocks Array containing the names of the blocks allowed\n * @return {boolean} Whether the item will be rendered or not.\n */\nconst shouldRenderItem = ( selectedBlocks, allowedBlocks ) =>\n\t! Array.isArray( allowedBlocks ) ||\n\tisEverySelectedBlockAllowed( selectedBlocks, allowedBlocks );\n\n/**\n * Renders a new item in the block settings menu.\n *\n * @param {Object} props Component props.\n * @param {Array} [props.allowedBlocks] An array containing a list of block names for which the item should be shown. If not present, it'll be rendered for any block. If multiple blocks are selected, it'll be shown if and only if all of them are in the allowed list.\n * @param {WPBlockTypeIconRender} [props.icon] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element.\n * @param {string} props.label The menu item text.\n * @param {Function} props.onClick Callback function to be executed when the user click the menu item.\n * @param {boolean} [props.small] Whether to render the label or not.\n * @param {string} [props.role] The ARIA role for the menu item.\n *\n * @example\n * ```js\n * // Using ES5 syntax\n * var __ = wp.i18n.__;\n * var PluginBlockSettingsMenuItem = wp.editPost.PluginBlockSettingsMenuItem;\n *\n * function doOnClick(){\n * \t// To be called when the user clicks the menu item.\n * }\n *\n * function MyPluginBlockSettingsMenuItem() {\n * \treturn wp.element.createElement(\n * \t\tPluginBlockSettingsMenuItem,\n * \t\t{\n * \t\t\tallowedBlocks: [ 'core/paragraph' ],\n * \t\t\ticon: 'dashicon-name',\n * \t\t\tlabel: __( 'Menu item text' ),\n * \t\t\tonClick: doOnClick,\n * \t\t}\n * \t);\n * }\n * ```\n *\n * @example\n * ```jsx\n * // Using ESNext syntax\n * import { __ } from '@wordpress/i18n';\n * import { PluginBlockSettingsMenuItem } from '@wordpress/edit-post';\n *\n * const doOnClick = ( ) => {\n * // To be called when the user clicks the menu item.\n * };\n *\n * const MyPluginBlockSettingsMenuItem = () => (\n * <PluginBlockSettingsMenuItem\n * \t\tallowedBlocks={ [ 'core/paragraph' ] }\n * \t\ticon='dashicon-name'\n * \t\tlabel={ __( 'Menu item text' ) }\n * \t\tonClick={ doOnClick } />\n * );\n * ```\n *\n * @return {WPComponent} The component to be rendered.\n */\nconst PluginBlockSettingsMenuItem = ( {\n\tallowedBlocks,\n\ticon,\n\tlabel,\n\tonClick,\n\tsmall,\n\trole,\n} ) => (\n\t<BlockSettingsMenuControls>\n\t\t{ ( { selectedBlocks, onClose } ) => {\n\t\t\tif ( ! shouldRenderItem( selectedBlocks, allowedBlocks ) ) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn (\n\t\t\t\t<MenuItem\n\t\t\t\t\tonClick={ compose( onClick, onClose ) }\n\t\t\t\t\ticon={ icon }\n\t\t\t\t\tlabel={ small ? label : undefined }\n\t\t\t\t\trole={ role }\n\t\t\t\t>\n\t\t\t\t\t{ ! small && label }\n\t\t\t\t</MenuItem>\n\t\t\t);\n\t\t} }\n\t</BlockSettingsMenuControls>\n);\n\nexport default PluginBlockSettingsMenuItem;\n"],"mappings":";;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AALA;AACA;AACA;;AAKA,MAAMG,2BAA2B,GAAGA,CAAEC,QAAQ,EAAEC,OAAO,KACtDD,QAAQ,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AAc,OAAA,CAAAC,OAAA,GAAAF,QAAA"}
|
|
@@ -6,15 +6,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = exports.BrowserURL = void 0;
|
|
7
7
|
exports.getPostEditURL = getPostEditURL;
|
|
8
8
|
exports.getPostTrashedURL = getPostTrashedURL;
|
|
9
|
-
|
|
10
9
|
var _element = require("@wordpress/element");
|
|
11
|
-
|
|
12
10
|
var _data = require("@wordpress/data");
|
|
13
|
-
|
|
14
11
|
var _url = require("@wordpress/url");
|
|
15
|
-
|
|
16
12
|
var _editor = require("@wordpress/editor");
|
|
17
|
-
|
|
18
13
|
/**
|
|
19
14
|
* WordPress dependencies
|
|
20
15
|
*/
|
|
@@ -32,6 +27,7 @@ function getPostEditURL(postId) {
|
|
|
32
27
|
action: 'edit'
|
|
33
28
|
});
|
|
34
29
|
}
|
|
30
|
+
|
|
35
31
|
/**
|
|
36
32
|
* Returns the Post's Trashed URL.
|
|
37
33
|
*
|
|
@@ -40,8 +36,6 @@ function getPostEditURL(postId) {
|
|
|
40
36
|
*
|
|
41
37
|
* @return {string} Post trashed URL.
|
|
42
38
|
*/
|
|
43
|
-
|
|
44
|
-
|
|
45
39
|
function getPostTrashedURL(postId, postType) {
|
|
46
40
|
return (0, _url.addQueryArgs)('edit.php', {
|
|
47
41
|
trashed: 1,
|
|
@@ -49,7 +43,6 @@ function getPostTrashedURL(postId, postType) {
|
|
|
49
43
|
ids: postId
|
|
50
44
|
});
|
|
51
45
|
}
|
|
52
|
-
|
|
53
46
|
class BrowserURL extends _element.Component {
|
|
54
47
|
constructor() {
|
|
55
48
|
super(...arguments);
|
|
@@ -57,7 +50,6 @@ class BrowserURL extends _element.Component {
|
|
|
57
50
|
historyId: null
|
|
58
51
|
};
|
|
59
52
|
}
|
|
60
|
-
|
|
61
53
|
componentDidUpdate(prevProps) {
|
|
62
54
|
const {
|
|
63
55
|
postId,
|
|
@@ -67,29 +59,29 @@ class BrowserURL extends _element.Component {
|
|
|
67
59
|
} = this.props;
|
|
68
60
|
const {
|
|
69
61
|
historyId
|
|
70
|
-
} = this.state;
|
|
71
|
-
// to avoid the unsaved changes warning when trashing posts.
|
|
62
|
+
} = this.state;
|
|
72
63
|
|
|
64
|
+
// Posts are still dirty while saving so wait for saving to finish
|
|
65
|
+
// to avoid the unsaved changes warning when trashing posts.
|
|
73
66
|
if (postStatus === 'trash' && !isSavingPost) {
|
|
74
67
|
this.setTrashURL(postId, postType);
|
|
75
68
|
return;
|
|
76
69
|
}
|
|
77
|
-
|
|
78
70
|
if ((postId !== prevProps.postId || postId !== historyId) && postStatus !== 'auto-draft' && postId) {
|
|
79
71
|
this.setBrowserURL(postId);
|
|
80
72
|
}
|
|
81
73
|
}
|
|
74
|
+
|
|
82
75
|
/**
|
|
83
76
|
* Navigates the browser to the post trashed URL to show a notice about the trashed post.
|
|
84
77
|
*
|
|
85
78
|
* @param {number} postId Post ID.
|
|
86
79
|
* @param {string} postType Post Type.
|
|
87
80
|
*/
|
|
88
|
-
|
|
89
|
-
|
|
90
81
|
setTrashURL(postId, postType) {
|
|
91
82
|
window.location.href = getPostTrashedURL(postId, postType);
|
|
92
83
|
}
|
|
84
|
+
|
|
93
85
|
/**
|
|
94
86
|
* Replaces the browser URL with a post editor link for the given post ID.
|
|
95
87
|
*
|
|
@@ -99,8 +91,6 @@ class BrowserURL extends _element.Component {
|
|
|
99
91
|
*
|
|
100
92
|
* @param {number} postId Post ID for which to generate post editor URL.
|
|
101
93
|
*/
|
|
102
|
-
|
|
103
|
-
|
|
104
94
|
setBrowserURL(postId) {
|
|
105
95
|
window.history.replaceState({
|
|
106
96
|
id: postId
|
|
@@ -109,15 +99,11 @@ class BrowserURL extends _element.Component {
|
|
|
109
99
|
historyId: postId
|
|
110
100
|
}));
|
|
111
101
|
}
|
|
112
|
-
|
|
113
102
|
render() {
|
|
114
103
|
return null;
|
|
115
104
|
}
|
|
116
|
-
|
|
117
105
|
}
|
|
118
|
-
|
|
119
106
|
exports.BrowserURL = BrowserURL;
|
|
120
|
-
|
|
121
107
|
var _default = (0, _data.withSelect)(select => {
|
|
122
108
|
const {
|
|
123
109
|
getCurrentPost,
|
|
@@ -130,11 +116,9 @@ var _default = (0, _data.withSelect)(select => {
|
|
|
130
116
|
type
|
|
131
117
|
} = post;
|
|
132
118
|
const isTemplate = ['wp_template', 'wp_template_part'].includes(type);
|
|
133
|
-
|
|
134
119
|
if (isTemplate) {
|
|
135
120
|
id = post.wp_id;
|
|
136
121
|
}
|
|
137
|
-
|
|
138
122
|
return {
|
|
139
123
|
postId: id,
|
|
140
124
|
postStatus: status,
|
|
@@ -142,6 +126,5 @@ var _default = (0, _data.withSelect)(select => {
|
|
|
142
126
|
isSavingPost: isSavingPost()
|
|
143
127
|
};
|
|
144
128
|
})(BrowserURL);
|
|
145
|
-
|
|
146
129
|
exports.default = _default;
|
|
147
130
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["_element","require","_data","_url","_editor","getPostEditURL","postId","addQueryArgs","post","action","getPostTrashedURL","postType","trashed","post_type","ids","BrowserURL","Component","constructor","arguments","state","historyId","componentDidUpdate","prevProps","postStatus","isSavingPost","props","setTrashURL","setBrowserURL","window","location","href","history","replaceState","id","setState","render","exports","_default","withSelect","select","getCurrentPost","editorStore","status","type","isTemplate","includes","wp_id","default"],"sources":["@wordpress/edit-post/src/components/browser-url/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport { withSelect } from '@wordpress/data';\nimport { addQueryArgs } from '@wordpress/url';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Returns the Post's Edit URL.\n *\n * @param {number} postId Post ID.\n *\n * @return {string} Post edit URL.\n */\nexport function getPostEditURL( postId ) {\n\treturn addQueryArgs( 'post.php', { post: postId, action: 'edit' } );\n}\n\n/**\n * Returns the Post's Trashed URL.\n *\n * @param {number} postId Post ID.\n * @param {string} postType Post Type.\n *\n * @return {string} Post trashed URL.\n */\nexport function getPostTrashedURL( postId, postType ) {\n\treturn addQueryArgs( 'edit.php', {\n\t\ttrashed: 1,\n\t\tpost_type: postType,\n\t\tids: postId,\n\t} );\n}\n\nexport class BrowserURL extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\n\t\tthis.state = {\n\t\t\thistoryId: null,\n\t\t};\n\t}\n\n\tcomponentDidUpdate( prevProps ) {\n\t\tconst { postId, postStatus, postType, isSavingPost } = this.props;\n\t\tconst { historyId } = this.state;\n\n\t\t// Posts are still dirty while saving so wait for saving to finish\n\t\t// to avoid the unsaved changes warning when trashing posts.\n\t\tif ( postStatus === 'trash' && ! isSavingPost ) {\n\t\t\tthis.setTrashURL( postId, postType );\n\t\t\treturn;\n\t\t}\n\n\t\tif (\n\t\t\t( postId !== prevProps.postId || postId !== historyId ) &&\n\t\t\tpostStatus !== 'auto-draft' &&\n\t\t\tpostId\n\t\t) {\n\t\t\tthis.setBrowserURL( postId );\n\t\t}\n\t}\n\n\t/**\n\t * Navigates the browser to the post trashed URL to show a notice about the trashed post.\n\t *\n\t * @param {number} postId Post ID.\n\t * @param {string} postType Post Type.\n\t */\n\tsetTrashURL( postId, postType ) {\n\t\twindow.location.href = getPostTrashedURL( postId, postType );\n\t}\n\n\t/**\n\t * Replaces the browser URL with a post editor link for the given post ID.\n\t *\n\t * Note it is important that, since this function may be called when the\n\t * editor first loads, the result generated `getPostEditURL` matches that\n\t * produced by the server. Otherwise, the URL will change unexpectedly.\n\t *\n\t * @param {number} postId Post ID for which to generate post editor URL.\n\t */\n\tsetBrowserURL( postId ) {\n\t\twindow.history.replaceState(\n\t\t\t{ id: postId },\n\t\t\t'Post ' + postId,\n\t\t\tgetPostEditURL( postId )\n\t\t);\n\n\t\tthis.setState( () => ( {\n\t\t\thistoryId: postId,\n\t\t} ) );\n\t}\n\n\trender() {\n\t\treturn null;\n\t}\n}\n\nexport default withSelect( ( select ) => {\n\tconst { getCurrentPost, isSavingPost } = select( editorStore );\n\tconst post = getCurrentPost();\n\tlet { id, status, type } = post;\n\tconst isTemplate = [ 'wp_template', 'wp_template_part' ].includes( type );\n\tif ( isTemplate ) {\n\t\tid = post.wp_id;\n\t}\n\n\treturn {\n\t\tpostId: id,\n\t\tpostStatus: status,\n\t\tpostType: type,\n\t\tisSavingPost: isSavingPost(),\n\t};\n} )( BrowserURL );\n"],"mappings":";;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,IAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AANA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASI,cAAcA,CAAEC,MAAM,EAAG;EACxC,OAAO,IAAAC,iBAAY,EAAE,UAAU,EAAE;IAAEC,IAAI,EAAEF,MAAM;IAAEG,MAAM,EAAE;EAAO,CAAE,CAAC;AACpE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,iBAAiBA,CAAEJ,MAAM,EAAEK,QAAQ,EAAG;EACrD,OAAO,IAAAJ,iBAAY,EAAE,UAAU,EAAE;IAChCK,OAAO,EAAE,CAAC;IACVC,SAAS,EAAEF,QAAQ;IACnBG,GAAG,EAAER;EACN,CAAE,CAAC;AACJ;AAEO,MAAMS,UAAU,SAASC,kBAAS,CAAC;EACzCC,WAAWA,CAAA,EAAG;IACb,KAAK,CAAE,GAAGC,SAAU,CAAC;IAErB,IAAI,CAACC,KAAK,GAAG;MACZC,SAAS,EAAE;IACZ,CAAC;EACF;EAEAC,kBAAkBA,CAAEC,SAAS,EAAG;IAC/B,MAAM;MAAEhB,MAAM;MAAEiB,UAAU;MAAEZ,QAAQ;MAAEa;IAAa,CAAC,GAAG,IAAI,CAACC,KAAK;IACjE,MAAM;MAAEL;IAAU,CAAC,GAAG,IAAI,CAACD,KAAK;;IAEhC;IACA;IACA,IAAKI,UAAU,KAAK,OAA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AAG;IACjBX,EAAE,GAAGzB,IAAI,CAACsC,KAAK;EAChB;EAEA,OAAO;IACNxC,MAAM,EAAE2B,EAAE;IACVV,UAAU,EAAEmB,MAAM;IAClB/B,QAAQ,EAAEgC,IAAI;IACdnB,YAAY,EAAEA,YAAY,CAAC;EAC5B,CAAC;AACF,CAAE,CAAC,CAAET,UAAW,CAAC;AAAAqB,OAAA,CAAAW,OAAA,GAAAV,QAAA"}
|
|
@@ -4,25 +4,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = DevicePreview;
|
|
7
|
-
|
|
8
7
|
var _element = require("@wordpress/element");
|
|
9
|
-
|
|
10
8
|
var _components = require("@wordpress/components");
|
|
11
|
-
|
|
12
9
|
var _editor = require("@wordpress/editor");
|
|
13
|
-
|
|
14
10
|
var _icons = require("@wordpress/icons");
|
|
15
|
-
|
|
16
11
|
var _i18n = require("@wordpress/i18n");
|
|
17
|
-
|
|
18
12
|
var _blockEditor = require("@wordpress/block-editor");
|
|
19
|
-
|
|
20
13
|
var _data = require("@wordpress/data");
|
|
21
|
-
|
|
22
14
|
var _coreData = require("@wordpress/core-data");
|
|
23
|
-
|
|
24
15
|
var _store = require("../../store");
|
|
25
|
-
|
|
26
16
|
/**
|
|
27
17
|
* WordPress dependencies
|
|
28
18
|
*/
|
|
@@ -30,6 +20,7 @@ var _store = require("../../store");
|
|
|
30
20
|
/**
|
|
31
21
|
* Internal dependencies
|
|
32
22
|
*/
|
|
23
|
+
|
|
33
24
|
function DevicePreview() {
|
|
34
25
|
const {
|
|
35
26
|
hasActiveMetaboxes,
|
|
@@ -38,7 +29,6 @@ function DevicePreview() {
|
|
|
38
29
|
deviceType
|
|
39
30
|
} = (0, _data.useSelect)(select => {
|
|
40
31
|
var _postType$viewable;
|
|
41
|
-
|
|
42
32
|
const {
|
|
43
33
|
getEditedPostAttribute
|
|
44
34
|
} = select(_editor.store);
|