@wordpress/edit-post 7.16.0 → 7.17.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 +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 +1 -11
- 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 +1 -7
- 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 +19 -9
- package/build-style/style.css +19 -9
- 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/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/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
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { createElement } from "@wordpress/element";
|
|
2
|
-
|
|
3
2
|
/**
|
|
4
3
|
* WordPress dependencies
|
|
5
4
|
*/
|
|
@@ -13,42 +12,45 @@ import { __, _x } from '@wordpress/i18n';
|
|
|
13
12
|
import { closeSmall } from '@wordpress/icons';
|
|
14
13
|
import { useShortcut } from '@wordpress/keyboard-shortcuts';
|
|
15
14
|
import { ESCAPE } from '@wordpress/keycodes';
|
|
15
|
+
|
|
16
16
|
/**
|
|
17
17
|
* Internal dependencies
|
|
18
18
|
*/
|
|
19
|
-
|
|
20
19
|
import { store as editPostStore } from '../../store';
|
|
21
20
|
import ListViewOutline from './list-view-outline';
|
|
22
21
|
export default function ListViewSidebar() {
|
|
23
22
|
const {
|
|
24
23
|
setIsListViewOpened
|
|
25
|
-
} = useDispatch(editPostStore);
|
|
26
|
-
|
|
27
|
-
const focusOnMountRef = useFocusOnMount('firstElement'); // The next 2 hooks handle focus for when the sidebar closes and returning focus to the element that had focus before sidebar opened.
|
|
24
|
+
} = useDispatch(editPostStore);
|
|
28
25
|
|
|
26
|
+
// This hook handles focus when the sidebar first renders.
|
|
27
|
+
const focusOnMountRef = useFocusOnMount('firstElement');
|
|
28
|
+
// The next 2 hooks handle focus for when the sidebar closes and returning focus to the element that had focus before sidebar opened.
|
|
29
29
|
const headerFocusReturnRef = useFocusReturn();
|
|
30
30
|
const contentFocusReturnRef = useFocusReturn();
|
|
31
|
-
|
|
32
31
|
function closeOnEscape(event) {
|
|
33
32
|
if (event.keyCode === ESCAPE && !event.defaultPrevented) {
|
|
34
33
|
event.preventDefault();
|
|
35
34
|
setIsListViewOpened(false);
|
|
36
35
|
}
|
|
37
|
-
}
|
|
38
|
-
// re-renders when the dropZoneElement updates.
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
const [dropZoneElement, setDropZoneElement] = useState(null); // Tracks our current tab.
|
|
42
|
-
|
|
43
|
-
const [tab, setTab] = useState('list-view'); // This ref refers to the sidebar as a whole.
|
|
44
|
-
|
|
45
|
-
const sidebarRef = useRef(); // This ref refers to the tab panel.
|
|
46
|
-
|
|
47
|
-
const tabPanelRef = useRef(); // This ref refers to the list view application area.
|
|
48
|
-
|
|
49
|
-
const listViewRef = useRef(); // Must merge the refs together so focus can be handled properly in the next function.
|
|
36
|
+
}
|
|
50
37
|
|
|
38
|
+
// Use internal state instead of a ref to make sure that the component
|
|
39
|
+
// re-renders when the dropZoneElement updates.
|
|
40
|
+
const [dropZoneElement, setDropZoneElement] = useState(null);
|
|
41
|
+
// Tracks our current tab.
|
|
42
|
+
const [tab, setTab] = useState('list-view');
|
|
43
|
+
|
|
44
|
+
// This ref refers to the sidebar as a whole.
|
|
45
|
+
const sidebarRef = useRef();
|
|
46
|
+
// This ref refers to the tab panel.
|
|
47
|
+
const tabPanelRef = useRef();
|
|
48
|
+
// This ref refers to the list view application area.
|
|
49
|
+
const listViewRef = useRef();
|
|
50
|
+
|
|
51
|
+
// Must merge the refs together so focus can be handled properly in the next function.
|
|
51
52
|
const listViewContainerRef = useMergeRefs([contentFocusReturnRef, focusOnMountRef, listViewRef, setDropZoneElement]);
|
|
53
|
+
|
|
52
54
|
/*
|
|
53
55
|
* Callback function to handle list view or outline focus.
|
|
54
56
|
*
|
|
@@ -56,36 +58,37 @@ export default function ListViewSidebar() {
|
|
|
56
58
|
*
|
|
57
59
|
* @return void
|
|
58
60
|
*/
|
|
59
|
-
|
|
60
61
|
function handleSidebarFocus(currentTab) {
|
|
61
62
|
// Tab panel focus.
|
|
62
|
-
const tabPanelFocus = focus.tabbable.find(tabPanelRef.current)[0];
|
|
63
|
-
|
|
63
|
+
const tabPanelFocus = focus.tabbable.find(tabPanelRef.current)[0];
|
|
64
|
+
// List view tab is selected.
|
|
64
65
|
if (currentTab === 'list-view') {
|
|
65
66
|
// Either focus the list view or the tab panel. Must have a fallback because the list view does not render when there are no blocks.
|
|
66
67
|
const listViewApplicationFocus = focus.tabbable.find(listViewRef.current)[0];
|
|
67
68
|
const listViewFocusArea = sidebarRef.current.contains(listViewApplicationFocus) ? listViewApplicationFocus : tabPanelFocus;
|
|
68
|
-
listViewFocusArea.focus();
|
|
69
|
+
listViewFocusArea.focus();
|
|
70
|
+
// Outline tab is selected.
|
|
69
71
|
} else {
|
|
70
72
|
tabPanelFocus.focus();
|
|
71
73
|
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
+
}
|
|
74
75
|
|
|
76
|
+
// This only fires when the sidebar is open because of the conditional rendering. It is the same shortcut to open but that is defined as a global shortcut and only fires when the sidebar is closed.
|
|
75
77
|
useShortcut('core/edit-post/toggle-list-view', () => {
|
|
76
78
|
// If the sidebar has focus, it is safe to close.
|
|
77
79
|
if (sidebarRef.current.contains(sidebarRef.current.ownerDocument.activeElement)) {
|
|
78
|
-
setIsListViewOpened(false);
|
|
80
|
+
setIsListViewOpened(false);
|
|
81
|
+
// If the list view or outline does not have focus, focus should be moved to it.
|
|
79
82
|
} else {
|
|
80
83
|
handleSidebarFocus(tab);
|
|
81
84
|
}
|
|
82
85
|
});
|
|
86
|
+
|
|
83
87
|
/**
|
|
84
88
|
* Render tab content for a given tab name.
|
|
85
89
|
*
|
|
86
90
|
* @param {string} tabName The name of the tab to render.
|
|
87
91
|
*/
|
|
88
|
-
|
|
89
92
|
function renderTabContent(tabName) {
|
|
90
93
|
if (tabName === 'list-view') {
|
|
91
94
|
return createElement("div", {
|
|
@@ -94,11 +97,10 @@ export default function ListViewSidebar() {
|
|
|
94
97
|
dropZoneElement: dropZoneElement
|
|
95
98
|
}));
|
|
96
99
|
}
|
|
97
|
-
|
|
98
100
|
return createElement(ListViewOutline, null);
|
|
99
101
|
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
+
return (
|
|
103
|
+
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
102
104
|
createElement("div", {
|
|
103
105
|
className: "edit-post-editor__document-overview-panel",
|
|
104
106
|
onKeyDown: closeOnEscape,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["__experimentalListView","ListView","Button","TabPanel","useFocusOnMount","useFocusReturn","useMergeRefs","useDispatch","focus","useRef","useState","__","_x","closeSmall","useShortcut","ESCAPE","store","editPostStore","ListViewOutline","ListViewSidebar","setIsListViewOpened","focusOnMountRef","headerFocusReturnRef","contentFocusReturnRef","closeOnEscape","event","keyCode","defaultPrevented","preventDefault","dropZoneElement","setDropZoneElement","tab","setTab","sidebarRef","tabPanelRef","listViewRef","listViewContainerRef","handleSidebarFocus","currentTab","tabPanelFocus","tabbable","find","current","listViewApplicationFocus","listViewFocusArea","contains","ownerDocument","activeElement","renderTabContent","tabName","createElement","className","onKeyDown","ref","icon","label","onClick","onSelect","selectOnMove","tabs","name","title"],"sources":["@wordpress/edit-post/src/components/secondary-sidebar/list-view-sidebar.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalListView as ListView } from '@wordpress/block-editor';\nimport { Button, TabPanel } from '@wordpress/components';\nimport {\n\tuseFocusOnMount,\n\tuseFocusReturn,\n\tuseMergeRefs,\n} from '@wordpress/compose';\nimport { useDispatch } from '@wordpress/data';\nimport { focus } from '@wordpress/dom';\nimport { useRef, useState } from '@wordpress/element';\nimport { __, _x } from '@wordpress/i18n';\nimport { closeSmall } from '@wordpress/icons';\nimport { useShortcut } from '@wordpress/keyboard-shortcuts';\nimport { ESCAPE } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../store';\nimport ListViewOutline from './list-view-outline';\n\nexport default function ListViewSidebar() {\n\tconst { setIsListViewOpened } = useDispatch( editPostStore );\n\n\t// This hook handles focus when the sidebar first renders.\n\tconst focusOnMountRef = useFocusOnMount( 'firstElement' );\n\t// The next 2 hooks handle focus for when the sidebar closes and returning focus to the element that had focus before sidebar opened.\n\tconst headerFocusReturnRef = useFocusReturn();\n\tconst contentFocusReturnRef = useFocusReturn();\n\n\tfunction closeOnEscape( event ) {\n\t\tif ( event.keyCode === ESCAPE && ! event.defaultPrevented ) {\n\t\t\tevent.preventDefault();\n\t\t\tsetIsListViewOpened( false );\n\t\t}\n\t}\n\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the dropZoneElement updates.\n\tconst [ dropZoneElement, setDropZoneElement ] = useState( null );\n\t// Tracks our current tab.\n\tconst [ tab, setTab ] = useState( 'list-view' );\n\n\t// This ref refers to the sidebar as a whole.\n\tconst sidebarRef = useRef();\n\t// This ref refers to the tab panel.\n\tconst tabPanelRef = useRef();\n\t// This ref refers to the list view application area.\n\tconst listViewRef = useRef();\n\n\t// Must merge the refs together so focus can be handled properly in the next function.\n\tconst listViewContainerRef = useMergeRefs( [\n\t\tcontentFocusReturnRef,\n\t\tfocusOnMountRef,\n\t\tlistViewRef,\n\t\tsetDropZoneElement,\n\t] );\n\n\t/*\n\t * Callback function to handle list view or outline focus.\n\t *\n\t * @param {string} currentTab The current tab. Either list view or outline.\n\t *\n\t * @return void\n\t */\n\tfunction handleSidebarFocus( currentTab ) {\n\t\t// Tab panel focus.\n\t\tconst tabPanelFocus = focus.tabbable.find( tabPanelRef.current )[ 0 ];\n\t\t// List view tab is selected.\n\t\tif ( currentTab === 'list-view' ) {\n\t\t\t// Either focus the list view or the tab panel. Must have a fallback because the list view does not render when there are no blocks.\n\t\t\tconst listViewApplicationFocus = focus.tabbable.find(\n\t\t\t\tlistViewRef.current\n\t\t\t)[ 0 ];\n\t\t\tconst listViewFocusArea = sidebarRef.current.contains(\n\t\t\t\tlistViewApplicationFocus\n\t\t\t)\n\t\t\t\t? listViewApplicationFocus\n\t\t\t\t: tabPanelFocus;\n\t\t\tlistViewFocusArea.focus();\n\t\t\t// Outline tab is selected.\n\t\t} else {\n\t\t\ttabPanelFocus.focus();\n\t\t}\n\t}\n\n\t// This only fires when the sidebar is open because of the conditional rendering. It is the same shortcut to open but that is defined as a global shortcut and only fires when the sidebar is closed.\n\tuseShortcut( 'core/edit-post/toggle-list-view', () => {\n\t\t// If the sidebar has focus, it is safe to close.\n\t\tif (\n\t\t\tsidebarRef.current.contains(\n\t\t\t\tsidebarRef.current.ownerDocument.activeElement\n\t\t\t)\n\t\t) {\n\t\t\tsetIsListViewOpened( false );\n\t\t\t// If the list view or outline does not have focus, focus should be moved to it.\n\t\t} else {\n\t\t\thandleSidebarFocus( tab );\n\t\t}\n\t} );\n\n\t/**\n\t * Render tab content for a given tab name.\n\t *\n\t * @param {string} tabName The name of the tab to render.\n\t */\n\tfunction renderTabContent( tabName ) {\n\t\tif ( tabName === 'list-view' ) {\n\t\t\treturn (\n\t\t\t\t<div className=\"edit-post-editor__list-view-panel-content\">\n\t\t\t\t\t<ListView dropZoneElement={ dropZoneElement } />\n\t\t\t\t</div>\n\t\t\t);\n\t\t}\n\t\treturn <ListViewOutline />;\n\t}\n\n\treturn (\n\t\t// eslint-disable-next-line jsx-a11y/no-static-element-interactions\n\t\t<div\n\t\t\tclassName=\"edit-post-editor__document-overview-panel\"\n\t\t\tonKeyDown={ closeOnEscape }\n\t\t\tref={ sidebarRef }\n\t\t>\n\t\t\t<Button\n\t\t\t\tclassName=\"edit-post-editor__document-overview-panel__close-button\"\n\t\t\t\tref={ headerFocusReturnRef }\n\t\t\t\ticon={ closeSmall }\n\t\t\t\tlabel={ __( 'Close' ) }\n\t\t\t\tonClick={ () => setIsListViewOpened( false ) }\n\t\t\t/>\n\t\t\t<TabPanel\n\t\t\t\tclassName=\"edit-post-editor__document-overview-panel__tab-panel\"\n\t\t\t\tref={ tabPanelRef }\n\t\t\t\tonSelect={ ( tabName ) => setTab( tabName ) }\n\t\t\t\tselectOnMove={ false }\n\t\t\t\ttabs={ [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'list-view',\n\t\t\t\t\t\ttitle: _x( 'List View', 'Post overview' ),\n\t\t\t\t\t\tclassName: 'edit-post-sidebar__panel-tab',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'outline',\n\t\t\t\t\t\ttitle: _x( 'Outline', 'Post overview' ),\n\t\t\t\t\t\tclassName: 'edit-post-sidebar__panel-tab',\n\t\t\t\t\t},\n\t\t\t\t] }\n\t\t\t>\n\t\t\t\t{ ( currentTab ) => (\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName=\"edit-post-editor__list-view-container\"\n\t\t\t\t\t\tref={ listViewContainerRef }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ renderTabContent( currentTab.name ) }\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t</TabPanel>\n\t\t</div>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,sBAAsB,IAAIC,QAAQ,QAAQ,yBAAyB;AAC5E,SAASC,MAAM,EAAEC,QAAQ,QAAQ,uBAAuB;AACxD,SACCC,eAAe,EACfC,cAAc,EACdC,YAAY,QACN,oBAAo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AAC,2CAA2C;MACrDC,SAAS,EAAG5B,aAAe;MAC3B6B,GAAG,EAAGpB;IAAY,GAElBiB,aAAA,CAAChD,MAAM;MACNiD,SAAS,EAAC,yDAAyD;MACnEE,GAAG,EAAG/B,oBAAsB;MAC5BgC,IAAI,EAAGzC,UAAY;MACnB0C,KAAK,EAAG5C,EAAE,CAAE,OAAQ,CAAG;MACvB6C,OAAO,EAAGA,CAAA,KAAMpC,mBAAmB,CAAE,KAAM;IAAG,CAC9C,CAAC,EACF8B,aAAA,CAAC/C,QAAQ;MACRgD,SAAS,EAAC,sDAAsD;MAChEE,GAAG,EAAGnB,WAAa;MACnBuB,QAAQ,EAAKR,OAAO,IAAMjB,MAAM,CAAEiB,OAAQ,CAAG;MAC7CS,YAAY,EAAG,KAAO;MACtBC,IAAI,EAAG,CACN;QACCC,IAAI,EAAE,WAAW;QACjBC,KAAK,EAAEjD,EAAE,CAAE,WAAW,EAAE,eAAgB,CAAC;QACzCuC,SAAS,EAAE;MACZ,CAAC,EACD;QACCS,IAAI,EAAE,SAAS;QACfC,KAAK,EAAEjD,EAAE,CAAE,SAAS,EAAE,eAAgB,CAAC;QACvCuC,SAAS,EAAE;MACZ,CAAC;IACC,GAECb,UAAU,IACbY,aAAA;MACCC,SAAS,EAAC,uCAAuC;MACjDE,GAAG,EAAGjB;IAAsB,GAE1BY,gBAAgB,CAAEV,UAAU,CAACsB,IAAK,CAChC,CAEG,CACN;EAAC;AAER"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { createElement } from "@wordpress/element";
|
|
2
|
-
|
|
3
2
|
/**
|
|
4
3
|
* WordPress dependencies
|
|
5
4
|
*/
|
|
@@ -7,17 +6,16 @@ import { __ } from '@wordpress/i18n';
|
|
|
7
6
|
import { PanelBody, PanelRow } from '@wordpress/components';
|
|
8
7
|
import { PostComments, PostPingbacks, PostTypeSupportCheck } from '@wordpress/editor';
|
|
9
8
|
import { useDispatch, useSelect } from '@wordpress/data';
|
|
9
|
+
|
|
10
10
|
/**
|
|
11
11
|
* Internal dependencies
|
|
12
12
|
*/
|
|
13
|
-
|
|
14
13
|
import { store as editPostStore } from '../../../store';
|
|
14
|
+
|
|
15
15
|
/**
|
|
16
16
|
* Module Constants
|
|
17
17
|
*/
|
|
18
|
-
|
|
19
18
|
const PANEL_NAME = 'discussion-panel';
|
|
20
|
-
|
|
21
19
|
function DiscussionPanel() {
|
|
22
20
|
const {
|
|
23
21
|
isEnabled,
|
|
@@ -35,11 +33,9 @@ function DiscussionPanel() {
|
|
|
35
33
|
const {
|
|
36
34
|
toggleEditorPanelOpened
|
|
37
35
|
} = useDispatch(editPostStore);
|
|
38
|
-
|
|
39
36
|
if (!isEnabled) {
|
|
40
37
|
return null;
|
|
41
38
|
}
|
|
42
|
-
|
|
43
39
|
return createElement(PostTypeSupportCheck, {
|
|
44
40
|
supportKeys: ['comments', 'trackbacks']
|
|
45
41
|
}, createElement(PanelBody, {
|
|
@@ -52,6 +48,5 @@ function DiscussionPanel() {
|
|
|
52
48
|
supportKeys: "trackbacks"
|
|
53
49
|
}, createElement(PanelRow, null, createElement(PostPingbacks, null)))));
|
|
54
50
|
}
|
|
55
|
-
|
|
56
51
|
export default DiscussionPanel;
|
|
57
52
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["__","PanelBody","PanelRow","PostComments","PostPingbacks","PostTypeSupportCheck","useDispatch","useSelect","store","editPostStore","PANEL_NAME","DiscussionPanel","isEnabled","isOpened","select","isEditorPanelEnabled","isEditorPanelOpened","toggleEditorPanelOpened","createElement","supportKeys","title","opened","onToggle"],"sources":["@wordpress/edit-post/src/components/sidebar/discussion-panel/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { PanelBody, PanelRow } from '@wordpress/components';\nimport {\n\tPostComments,\n\tPostPingbacks,\n\tPostTypeSupportCheck,\n} from '@wordpress/editor';\nimport { useDispatch, useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../../store';\n\n/**\n * Module Constants\n */\nconst PANEL_NAME = 'discussion-panel';\n\nfunction DiscussionPanel() {\n\tconst { isEnabled, isOpened } = useSelect( ( select ) => {\n\t\tconst { isEditorPanelEnabled, isEditorPanelOpened } =\n\t\t\tselect( editPostStore );\n\t\treturn {\n\t\t\tisEnabled: isEditorPanelEnabled( PANEL_NAME ),\n\t\t\tisOpened: isEditorPanelOpened( PANEL_NAME ),\n\t\t};\n\t}, [] );\n\n\tconst { toggleEditorPanelOpened } = useDispatch( editPostStore );\n\n\tif ( ! isEnabled ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PostTypeSupportCheck supportKeys={ [ 'comments', 'trackbacks' ] }>\n\t\t\t<PanelBody\n\t\t\t\ttitle={ __( 'Discussion' ) }\n\t\t\t\topened={ isOpened }\n\t\t\t\tonToggle={ () => toggleEditorPanelOpened( PANEL_NAME ) }\n\t\t\t>\n\t\t\t\t<PostTypeSupportCheck supportKeys=\"comments\">\n\t\t\t\t\t<PanelRow>\n\t\t\t\t\t\t<PostComments />\n\t\t\t\t\t</PanelRow>\n\t\t\t\t</PostTypeSupportCheck>\n\n\t\t\t\t<PostTypeSupportCheck supportKeys=\"trackbacks\">\n\t\t\t\t\t<PanelRow>\n\t\t\t\t\t\t<PostPingbacks />\n\t\t\t\t\t</PanelRow>\n\t\t\t\t</PostTypeSupportCheck>\n\t\t\t</PanelBody>\n\t\t</PostTypeSupportCheck>\n\t);\n}\n\nexport default DiscussionPanel;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,SAAS,EAAEC,QAAQ,QAAQ,uBAAuB;AAC3D,SACCC,YAAY,EACZC,aAAa,EACbC,oBAAoB,QACd,mBAAmB;AAC1B,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;;AAExD;AACA;AACA;AACA,SAASC,KA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PostFeaturedImage, PostFeaturedImageCheck, store as editorStore } from
|
|
|
9
8
|
import { compose } from '@wordpress/compose';
|
|
10
9
|
import { withSelect, withDispatch } from '@wordpress/data';
|
|
11
10
|
import { store as coreStore } from '@wordpress/core-data';
|
|
11
|
+
|
|
12
12
|
/**
|
|
13
13
|
* Internal dependencies
|
|
14
14
|
*/
|
|
15
|
-
|
|
16
15
|
import { store as editPostStore } from '../../../store';
|
|
16
|
+
|
|
17
17
|
/**
|
|
18
18
|
* Module Constants
|
|
19
19
|
*/
|
|
20
|
-
|
|
21
20
|
const PANEL_NAME = 'featured-image';
|
|
22
|
-
|
|
23
21
|
function FeaturedImage({
|
|
24
22
|
isEnabled,
|
|
25
23
|
isOpened,
|
|
@@ -27,18 +25,15 @@ function FeaturedImage({
|
|
|
27
25
|
onTogglePanel
|
|
28
26
|
}) {
|
|
29
27
|
var _postType$labels$feat;
|
|
30
|
-
|
|
31
28
|
if (!isEnabled) {
|
|
32
29
|
return null;
|
|
33
30
|
}
|
|
34
|
-
|
|
35
31
|
return createElement(PostFeaturedImageCheck, null, createElement(PanelBody, {
|
|
36
32
|
title: (_postType$labels$feat = postType?.labels?.featured_image) !== null && _postType$labels$feat !== void 0 ? _postType$labels$feat : __('Featured image'),
|
|
37
33
|
opened: isOpened,
|
|
38
34
|
onToggle: onTogglePanel
|
|
39
35
|
}, createElement(PostFeaturedImage, null)));
|
|
40
36
|
}
|
|
41
|
-
|
|
42
37
|
const applyWithSelect = withSelect(select => {
|
|
43
38
|
const {
|
|
44
39
|
getEditedPostAttribute
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["__","PanelBody","PostFeaturedImage","PostFeaturedImageCheck","store","editorStore","compose","withSelect","withDispatch","coreStore","editPostStore","PANEL_NAME","FeaturedImage","isEnabled","isOpened","postType","onTogglePanel","_postType$labels$feat","createElement","title","labels","featured_image","opened","onToggle","applyWithSelect","select","getEditedPostAttribute","getPostType","isEditorPanelEnabled","isEditorPanelOpened","applyWithDispatch","dispatch","toggleEditorPanelOpened","args"],"sources":["@wordpress/edit-post/src/components/sidebar/featured-image/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { PanelBody } from '@wordpress/components';\nimport {\n\tPostFeaturedImage,\n\tPostFeaturedImageCheck,\n\tstore as editorStore,\n} from '@wordpress/editor';\nimport { compose } from '@wordpress/compose';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../../store';\n\n/**\n * Module Constants\n */\nconst PANEL_NAME = 'featured-image';\n\nfunction FeaturedImage( { isEnabled, isOpened, postType, onTogglePanel } ) {\n\tif ( ! isEnabled ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PostFeaturedImageCheck>\n\t\t\t<PanelBody\n\t\t\t\ttitle={\n\t\t\t\t\tpostType?.labels?.featured_image ?? __( 'Featured image' )\n\t\t\t\t}\n\t\t\t\topened={ isOpened }\n\t\t\t\tonToggle={ onTogglePanel }\n\t\t\t>\n\t\t\t\t<PostFeaturedImage />\n\t\t\t</PanelBody>\n\t\t</PostFeaturedImageCheck>\n\t);\n}\n\nconst applyWithSelect = withSelect( ( select ) => {\n\tconst { getEditedPostAttribute } = select( editorStore );\n\tconst { getPostType } = select( coreStore );\n\tconst { isEditorPanelEnabled, isEditorPanelOpened } =\n\t\tselect( editPostStore );\n\n\treturn {\n\t\tpostType: getPostType( getEditedPostAttribute( 'type' ) ),\n\t\tisEnabled: isEditorPanelEnabled( PANEL_NAME ),\n\t\tisOpened: isEditorPanelOpened( PANEL_NAME ),\n\t};\n} );\n\nconst applyWithDispatch = withDispatch( ( dispatch ) => {\n\tconst { toggleEditorPanelOpened } = dispatch( editPostStore );\n\n\treturn {\n\t\tonTogglePanel: ( ...args ) =>\n\t\t\ttoggleEditorPanelOpened( PANEL_NAME, ...args ),\n\t};\n} );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,EAAEY,WAAW,CAAED,sBAAsB,CAAE,MAAO,CAAE,CAAC;IACzDb,SAAS,EAAEe,oBAAoB,CAAEjB,UAAW,CAAC;IAC7CG,QAAQ,EAAEe,mBAAmB,CAAElB,UAAW;EAC3C,CAAC;AACF,CAAE,CAAC;AAEH,MAAMmB,iBAAiB,GAAGtB,YAAY,CAAIuB,QAAQ,IAAM;EACvD,MAAM;IAAEC;EAAwB,CAAC,GAAGD,QAAQ,CAAErB,aAAc,CAAC;EAE7D,OAAO;IACNM,aAAa,EAAEA,CAAE,GAAGiB,IAAI,KACvBD,uBAAuB,CAAErB,UAAU,EAAE,GAAGsB,IAAK;EAC/C,CAAC;AACF,CAAE,CAAC;AAEH,eAAe3B,OAAO,CAAEkB,eAAe,EAAEM,iBAAkB,CAAC,CAAElB,aAAc,CAAC"}
|
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
import { createElement } from "@wordpress/element";
|
|
2
|
-
|
|
3
2
|
/**
|
|
4
3
|
* WordPress dependencies
|
|
5
4
|
*/
|
|
6
5
|
import { PanelBody } from '@wordpress/components';
|
|
7
6
|
import { PostLastRevision, PostLastRevisionCheck } from '@wordpress/editor';
|
|
8
|
-
|
|
9
7
|
function LastRevision() {
|
|
10
8
|
return createElement(PostLastRevisionCheck, null, createElement(PanelBody, {
|
|
11
9
|
className: "edit-post-last-revision__panel"
|
|
12
10
|
}, createElement(PostLastRevision, null)));
|
|
13
11
|
}
|
|
14
|
-
|
|
15
12
|
export default LastRevision;
|
|
16
13
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-post/src/components/sidebar/last-revision/index.js"],"
|
|
1
|
+
{"version":3,"names":["PanelBody","PostLastRevision","PostLastRevisionCheck","LastRevision","createElement","className"],"sources":["@wordpress/edit-post/src/components/sidebar/last-revision/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { PanelBody } from '@wordpress/components';\nimport { PostLastRevision, PostLastRevisionCheck } from '@wordpress/editor';\n\nfunction LastRevision() {\n\treturn (\n\t\t<PostLastRevisionCheck>\n\t\t\t<PanelBody className=\"edit-post-last-revision__panel\">\n\t\t\t\t<PostLastRevision />\n\t\t\t</PanelBody>\n\t\t</PostLastRevisionCheck>\n\t);\n}\n\nexport default LastRevision;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,uBAAuB;AACjD,SAASC,gBAAgB,EAAEC,qBAAqB,QAAQ,mBAAmB;AAE3E,SAASC,YAAYA,CAAA,EAAG;EACvB,OACCC,aAAA,CAACF,qBAAqB,QACrBE,aAAA,CAACJ,SAAS;IAACK,SAAS,EAAC;EAAgC,GACpDD,aAAA,CAACH,gBAAgB,MAAE,CACT,CACW,CAAC;AAE1B;AAEA,eAAeE,YAAY"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { createElement } from "@wordpress/element";
|
|
2
|
-
|
|
3
2
|
/**
|
|
4
3
|
* WordPress dependencies
|
|
5
4
|
*/
|
|
@@ -8,19 +7,18 @@ import { PanelBody, PanelRow } from '@wordpress/components';
|
|
|
8
7
|
import { store as editorStore, PageAttributesCheck, PageAttributesOrder, PageAttributesParent } from '@wordpress/editor';
|
|
9
8
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
10
9
|
import { store as coreStore } from '@wordpress/core-data';
|
|
10
|
+
|
|
11
11
|
/**
|
|
12
12
|
* Internal dependencies
|
|
13
13
|
*/
|
|
14
|
-
|
|
15
14
|
import { store as editPostStore } from '../../../store';
|
|
15
|
+
|
|
16
16
|
/**
|
|
17
17
|
* Module Constants
|
|
18
18
|
*/
|
|
19
|
-
|
|
20
19
|
const PANEL_NAME = 'page-attributes';
|
|
21
20
|
export function PageAttributes() {
|
|
22
21
|
var _postType$labels$attr;
|
|
23
|
-
|
|
24
22
|
const {
|
|
25
23
|
isEnabled,
|
|
26
24
|
isOpened,
|
|
@@ -45,13 +43,10 @@ export function PageAttributes() {
|
|
|
45
43
|
const {
|
|
46
44
|
toggleEditorPanelOpened
|
|
47
45
|
} = useDispatch(editPostStore);
|
|
48
|
-
|
|
49
46
|
if (!isEnabled || !postType) {
|
|
50
47
|
return null;
|
|
51
48
|
}
|
|
52
|
-
|
|
53
49
|
const onTogglePanel = (...args) => toggleEditorPanelOpened(PANEL_NAME, ...args);
|
|
54
|
-
|
|
55
50
|
return createElement(PageAttributesCheck, null, createElement(PanelBody, {
|
|
56
51
|
title: (_postType$labels$attr = postType?.labels?.attributes) !== null && _postType$labels$attr !== void 0 ? _postType$labels$attr : __('Page attributes'),
|
|
57
52
|
opened: isOpened,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["__","PanelBody","PanelRow","store","editorStore","PageAttributesCheck","PageAttributesOrder","PageAttributesParent","useSelect","useDispatch","coreStore","editPostStore","PANEL_NAME","PageAttributes","_postType$labels$attr","isEnabled","isOpened","postType","select","getEditedPostAttribute","isEditorPanelEnabled","isEditorPanelOpened","getPostType","toggleEditorPanelOpened","onTogglePanel","args","createElement","title","labels","attributes","opened","onToggle"],"sources":["@wordpress/edit-post/src/components/sidebar/page-attributes/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { PanelBody, PanelRow } from '@wordpress/components';\nimport {\n\tstore as editorStore,\n\tPageAttributesCheck,\n\tPageAttributesOrder,\n\tPageAttributesParent,\n} from '@wordpress/editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../../store';\n\n/**\n * Module Constants\n */\nconst PANEL_NAME = 'page-attributes';\n\nexport function PageAttributes() {\n\tconst { isEnabled, isOpened, postType } = useSelect( ( select ) => {\n\t\tconst { getEditedPostAttribute } = select( editorStore );\n\t\tconst { isEditorPanelEnabled, isEditorPanelOpened } =\n\t\t\tselect( editPostStore );\n\t\tconst { getPostType } = select( coreStore );\n\t\treturn {\n\t\t\tisEnabled: isEditorPanelEnabled( PANEL_NAME ),\n\t\t\tisOpened: isEditorPanelOpened( PANEL_NAME ),\n\t\t\tpostType: getPostType( getEditedPostAttribute( 'type' ) ),\n\t\t};\n\t}, [] );\n\n\tconst { toggleEditorPanelOpened } = useDispatch( editPostStore );\n\n\tif ( ! isEnabled || ! postType ) {\n\t\treturn null;\n\t}\n\n\tconst onTogglePanel = ( ...args ) =>\n\t\ttoggleEditorPanelOpened( PANEL_NAME, ...args );\n\n\treturn (\n\t\t<PageAttributesCheck>\n\t\t\t<PanelBody\n\t\t\t\ttitle={\n\t\t\t\t\tpostType?.labels?.attributes ?? __( 'Page attributes' )\n\t\t\t\t}\n\t\t\t\topened={ isOpened }\n\t\t\t\tonToggle={ onTogglePanel }\n\t\t\t>\n\t\t\t\t<PageAttributesParent />\n\t\t\t\t<PanelRow>\n\t\t\t\t\t<PageAttributesOrder />\n\t\t\t\t</PanelRow>\n\t\t\t</PanelBody>\n\t\t</PageAttributesCheck>\n\t);\n}\n\nexport default PageAttributes;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,SAAS,EAAEC,QAAQ,QAAQ,uBAAuB;AAC3D,SACCC,KAAK,IAAIC,WAAW,EACpBC,mBAAmB,EACnBC,mBAAmB,EACnBC,oBAAoB,QACd,mBAAmB;AAC1B,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASN,KAAK,IAAIO,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,SAASP,KAAK,IAAIQ,aAAa,QAAQ,gBAAgB;;AAEvD;AACA;AACA;AACA,MAAMC,UAAU,GAAG,iBAAiB;AAEpC,OAAO,SAASC,cAAcA,CAAA,EAAG;EAAA,IAAAC,qBAAA;EAChC,MAAM;IAAEC,SAAS;IAAEC,QAAQ;IAAEC;EAAS,CAAC,GAAGT,SAAS,CAAIU,MAAM,IAAM;IAClE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
|
|
8
3
|
* WordPress dependencies
|
|
9
4
|
*/
|
|
10
5
|
import { createSlotFill, PanelBody } from '@wordpress/components';
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import { withDispatch, withSelect } from '@wordpress/data';
|
|
6
|
+
import { usePluginContext } from '@wordpress/plugins';
|
|
7
|
+
import { useDispatch, useSelect } from '@wordpress/data';
|
|
14
8
|
import warning from '@wordpress/warning';
|
|
9
|
+
|
|
15
10
|
/**
|
|
16
11
|
* Internal dependencies
|
|
17
12
|
*/
|
|
18
|
-
|
|
19
13
|
import { EnablePluginDocumentSettingPanelOption } from '../../preferences-modal/options';
|
|
20
14
|
import { store as editPostStore } from '../../../store';
|
|
21
15
|
const {
|
|
@@ -23,35 +17,15 @@ const {
|
|
|
23
17
|
Slot
|
|
24
18
|
} = createSlotFill('PluginDocumentSettingPanel');
|
|
25
19
|
|
|
26
|
-
const PluginDocumentSettingFill = ({
|
|
27
|
-
isEnabled,
|
|
28
|
-
panelName,
|
|
29
|
-
opened,
|
|
30
|
-
onToggle,
|
|
31
|
-
className,
|
|
32
|
-
title,
|
|
33
|
-
icon,
|
|
34
|
-
children
|
|
35
|
-
}) => {
|
|
36
|
-
return createElement(Fragment, null, createElement(EnablePluginDocumentSettingPanelOption, {
|
|
37
|
-
label: title,
|
|
38
|
-
panelName: panelName
|
|
39
|
-
}), createElement(Fill, null, isEnabled && createElement(PanelBody, {
|
|
40
|
-
className: className,
|
|
41
|
-
title: title,
|
|
42
|
-
icon: icon,
|
|
43
|
-
opened: opened,
|
|
44
|
-
onToggle: onToggle
|
|
45
|
-
}, children)));
|
|
46
|
-
};
|
|
47
20
|
/**
|
|
48
21
|
* Renders items below the Status & Availability panel in the Document Sidebar.
|
|
49
22
|
*
|
|
50
23
|
* @param {Object} props Component properties.
|
|
51
|
-
* @param {string}
|
|
24
|
+
* @param {string} props.name Required. A machine-friendly name for the panel.
|
|
52
25
|
* @param {string} [props.className] An optional class name added to the row.
|
|
53
26
|
* @param {string} [props.title] The title of the panel
|
|
54
27
|
* @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] 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.
|
|
28
|
+
* @param {WPElement} props.children Children to be rendered
|
|
55
29
|
*
|
|
56
30
|
* @example
|
|
57
31
|
* ```js
|
|
@@ -67,6 +41,7 @@ const PluginDocumentSettingFill = ({
|
|
|
67
41
|
* {
|
|
68
42
|
* className: 'my-document-setting-plugin',
|
|
69
43
|
* title: 'My Panel',
|
|
44
|
+
* name: 'my-panel',
|
|
70
45
|
* },
|
|
71
46
|
* __( 'My Document Setting Panel' )
|
|
72
47
|
* );
|
|
@@ -84,7 +59,7 @@ const PluginDocumentSettingFill = ({
|
|
|
84
59
|
* import { PluginDocumentSettingPanel } from '@wordpress/edit-post';
|
|
85
60
|
*
|
|
86
61
|
* const MyDocumentSettingTest = () => (
|
|
87
|
-
* <PluginDocumentSettingPanel className="my-document-setting-plugin" title="My Panel">
|
|
62
|
+
* <PluginDocumentSettingPanel className="my-document-setting-plugin" title="My Panel" name="my-panel">
|
|
88
63
|
* <p>My Document Setting Panel</p>
|
|
89
64
|
* </PluginDocumentSettingPanel>
|
|
90
65
|
* );
|
|
@@ -94,31 +69,47 @@ const PluginDocumentSettingFill = ({
|
|
|
94
69
|
*
|
|
95
70
|
* @return {WPComponent} The component to be rendered.
|
|
96
71
|
*/
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
return {
|
|
105
|
-
panelName: `${context.name}/${ownProps.name}`
|
|
106
|
-
};
|
|
107
|
-
}), withSelect((select, {
|
|
108
|
-
panelName
|
|
72
|
+
const PluginDocumentSettingPanel = ({
|
|
73
|
+
name,
|
|
74
|
+
className,
|
|
75
|
+
title,
|
|
76
|
+
icon,
|
|
77
|
+
children
|
|
109
78
|
}) => {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
79
|
+
const {
|
|
80
|
+
name: pluginName
|
|
81
|
+
} = usePluginContext();
|
|
82
|
+
const panelName = `${pluginName}/${name}`;
|
|
83
|
+
const {
|
|
84
|
+
opened,
|
|
85
|
+
isEnabled
|
|
86
|
+
} = useSelect(select => {
|
|
87
|
+
const {
|
|
88
|
+
isEditorPanelOpened,
|
|
89
|
+
isEditorPanelEnabled
|
|
90
|
+
} = select(editPostStore);
|
|
91
|
+
return {
|
|
92
|
+
opened: isEditorPanelOpened(panelName),
|
|
93
|
+
isEnabled: isEditorPanelEnabled(panelName)
|
|
94
|
+
};
|
|
95
|
+
}, [panelName]);
|
|
96
|
+
const {
|
|
97
|
+
toggleEditorPanelOpened
|
|
98
|
+
} = useDispatch(editPostStore);
|
|
99
|
+
if (undefined === name) {
|
|
100
|
+
typeof process !== "undefined" && process.env && process.env.NODE_ENV !== "production" ? warning('PluginDocumentSettingPanel requires a name property.') : void 0;
|
|
119
101
|
}
|
|
120
|
-
|
|
121
|
-
|
|
102
|
+
return createElement(Fragment, null, createElement(EnablePluginDocumentSettingPanelOption, {
|
|
103
|
+
label: title,
|
|
104
|
+
panelName: panelName
|
|
105
|
+
}), createElement(Fill, null, isEnabled && createElement(PanelBody, {
|
|
106
|
+
className: className,
|
|
107
|
+
title: title,
|
|
108
|
+
icon: icon,
|
|
109
|
+
opened: opened,
|
|
110
|
+
onToggle: () => toggleEditorPanelOpened(panelName)
|
|
111
|
+
}, children)));
|
|
112
|
+
};
|
|
122
113
|
PluginDocumentSettingPanel.Slot = Slot;
|
|
123
114
|
export default PluginDocumentSettingPanel;
|
|
124
115
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["createSlotFill","PanelBody","usePluginContext","useDispatch","useSelect","warning","EnablePluginDocumentSettingPanelOption","store","editPostStore","Fill","Slot","PluginDocumentSettingPanel","name","className","title","icon","children","pluginName","panelName","opened","isEnabled","select","isEditorPanelOpened","isEditorPanelEnabled","toggleEditorPanelOpened","undefined","process","env","NODE_ENV","createElement","Fragment","label","onToggle"],"sources":["@wordpress/edit-post/src/components/sidebar/plugin-document-setting-panel/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createSlotFill, PanelBody } from '@wordpress/components';\nimport { usePluginContext } from '@wordpress/plugins';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport warning from '@wordpress/warning';\n\n/**\n * Internal dependencies\n */\nimport { EnablePluginDocumentSettingPanelOption } from '../../preferences-modal/options';\nimport { store as editPostStore } from '../../../store';\n\nconst { Fill, Slot } = createSlotFill( 'PluginDocumentSettingPanel' );\n\n/**\n * Renders items below the Status & Availability panel in the Document Sidebar.\n *\n * @param {Object} props Component properties.\n * @param {string} props.name Required. A machine-friendly name for the panel.\n * @param {string} [props.className] An optional class name added to the row.\n * @param {string} [props.title] The title of the panel\n * @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] 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.\n * @param {WPElement} props.children Children to be rendered\n *\n * @example\n * ```js\n * // Using ES5 syntax\n * var el = wp.element.createElement;\n * var __ = wp.i18n.__;\n * var registerPlugin = wp.plugins.registerPlugin;\n * var PluginDocumentSettingPanel = wp.editPost.PluginDocumentSettingPanel;\n *\n * function MyDocumentSettingPlugin() {\n * \treturn el(\n * \t\tPluginDocumentSettingPanel,\n * \t\t{\n * \t\t\tclassName: 'my-document-setting-plugin',\n * \t\t\ttitle: 'My Panel',\n * \t\t\tname: 'my-panel',\n * \t\t},\n * \t\t__( 'My Document Setting Panel' )\n * \t);\n * }\n *\n * registerPlugin( 'my-document-setting-plugin', {\n * \t\trender: MyDocumentSettingPlugin\n * } );\n * ```\n *\n * @example\n * ```jsx\n * // Using ESNext syntax\n * import { registerPlugin } from '@wordpress/plugins';\n * import { PluginDocumentSettingPanel } from '@wordpress/edit-post';\n *\n * const MyDocumentSettingTest = () => (\n * \t\t<PluginDocumentSettingPanel className=\"my-document-setting-plugin\" title=\"My Panel\" name=\"my-panel\">\n *\t\t\t<p>My Document Setting Panel</p>\n *\t\t</PluginDocumentSettingPanel>\n *\t);\n *\n * registerPlugin( 'document-setting-test', { render: MyDocumentSettingTest } );\n * ```\n *\n * @return {WPComponent} The component to be rendered.\n */\nconst PluginDocumentSettingPanel = ( {\n\tname,\n\tclassName,\n\ttitle,\n\ticon,\n\tchildren,\n} ) => {\n\tconst { name: pluginName } = usePluginContext();\n\tconst panelName = `${ pluginName }/${ name }`;\n\tconst { opened, isEnabled } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { isEditorPanelOpened, isEditorPanelEnabled } =\n\t\t\t\tselect( editPostStore );\n\n\t\t\treturn {\n\t\t\t\topened: isEditorPanelOpened( panelName ),\n\t\t\t\tisEnabled: isEditorPanelEnabled( panelName ),\n\t\t\t};\n\t\t},\n\t\t[ panelName ]\n\t);\n\tconst { toggleEditorPanelOpened } = useDispatch( editPostStore );\n\n\tif ( undefined === name ) {\n\t\twarning( 'PluginDocumentSettingPanel requires a name property.' );\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<EnablePluginDocumentSettingPanelOption\n\t\t\t\tlabel={ title }\n\t\t\t\tpanelName={ panelName }\n\t\t\t/>\n\t\t\t<Fill>\n\t\t\t\t{ isEnabled && (\n\t\t\t\t\t<PanelBody\n\t\t\t\t\t\tclassName={ className }\n\t\t\t\t\t\ttitle={ title }\n\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\topened={ opened }\n\t\t\t\t\t\tonToggle={ () => toggleEditorPanelOpened( panelName ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ children }\n\t\t\t\t\t</PanelBody>\n\t\t\t\t) }\n\t\t\t</Fill>\n\t\t</>\n\t);\n};\n\nPluginDocumentSettingPanel.Slot = Slot;\n\nexport default PluginDocumentSettingPanel;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,cAAc,EAAEC,SAAS,QAAQ,uBAAuB;AACjE,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,OAAOC,OAAO,MAAM,oBAAoB;;AAExC;AACA;AACA;AACA,SAASC,sCAAsC,QAAQ,iCAAiC;AACxF,SAASC,KAAK,IAAIC,aAAa,QAAQ,gBAAgB;AAEvD,MAAM;EAAEC,IAAI;EAAEC;AAAK,CAAC,GAAGV,cAAc,CAAE,4BAA6B,CAAC;;AAErE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMW,0BAA0B,GAAGA,CAAE;EACpCC,IAAI;EACJC,SAAS;EACTC,KAAK;EACLC,IAAI;EACJC;AACD,CAAC,KAAM;EACN,MAAM;IAAEJ,IAAI,EAAEK;EAAW,CAAC,GAAGf,gBAAgB,CAAC,CAAC;EAC/C,MAAMgB,SAAS,GAAI,GAAGD,UAAY,IAAIL,IAAM,EAAC;EAC7C,MAAM;IAAEO,MAAM;IAAEC;EAAU,CAAC,GAAGhB,SAAS,CACpCiB,MAAM,IAAM;IACb,MAAM;MAAEC,mBAAmB;MAAEC;IAAqB,CAAC,GAClDF,MAAM,CAAEb,aAAc,CAAC;IAExB,OAAO;MACNW,MAAM,EAAEG,mBAAmB,CAAEJ,SAAU,CAAC;MACxCE,SAAS,EAAEG,oBAAoB,CAAEL,SAAU;IAC5C,CAAC;EACF,CAAC,EACD,CAAEA,SAAS,CACZ,CAAC;E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