@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,28 +1,27 @@
|
|
|
1
1
|
import { createElement, Fragment } from "@wordpress/element";
|
|
2
|
-
|
|
3
2
|
/**
|
|
4
3
|
* External dependencies
|
|
5
4
|
*/
|
|
6
5
|
import classnames from 'classnames';
|
|
6
|
+
|
|
7
7
|
/**
|
|
8
8
|
* WordPress dependencies
|
|
9
9
|
*/
|
|
10
|
-
|
|
11
10
|
import { AutosaveMonitor, LocalAutosaveMonitor, UnsavedChangesWarning, EditorNotices, EditorKeyboardShortcutsRegister, EditorKeyboardShortcuts, EditorSnackbars, PostSyncStatusModal, store as editorStore } from '@wordpress/editor';
|
|
12
11
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
13
|
-
import { BlockBreadcrumb, privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
|
|
12
|
+
import { useBlockCommands, BlockBreadcrumb, privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
|
|
14
13
|
import { Button, ScrollLock, Popover } from '@wordpress/components';
|
|
15
14
|
import { useViewportMatch } from '@wordpress/compose';
|
|
16
15
|
import { PluginArea } from '@wordpress/plugins';
|
|
17
16
|
import { __, _x, sprintf } from '@wordpress/i18n';
|
|
18
17
|
import { ComplementaryArea, FullscreenMode, InterfaceSkeleton, store as interfaceStore } from '@wordpress/interface';
|
|
19
|
-
import { useState, useEffect, useCallback } from '@wordpress/element';
|
|
18
|
+
import { useState, useEffect, useCallback, useMemo } from '@wordpress/element';
|
|
20
19
|
import { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';
|
|
21
20
|
import { store as noticesStore } from '@wordpress/notices';
|
|
21
|
+
|
|
22
22
|
/**
|
|
23
23
|
* Internal dependencies
|
|
24
24
|
*/
|
|
25
|
-
|
|
26
25
|
import TextEditor from '../text-editor';
|
|
27
26
|
import VisualEditor from '../visual-editor';
|
|
28
27
|
import EditPostKeyboardShortcuts from '../keyboard-shortcuts';
|
|
@@ -45,21 +44,51 @@ const {
|
|
|
45
44
|
const interfaceLabels = {
|
|
46
45
|
/* translators: accessibility text for the editor top bar landmark region. */
|
|
47
46
|
header: __('Editor top bar'),
|
|
48
|
-
|
|
49
47
|
/* translators: accessibility text for the editor content landmark region. */
|
|
50
48
|
body: __('Editor content'),
|
|
51
|
-
|
|
52
49
|
/* translators: accessibility text for the editor settings landmark region. */
|
|
53
50
|
sidebar: __('Editor settings'),
|
|
54
|
-
|
|
55
51
|
/* translators: accessibility text for the editor publish landmark region. */
|
|
56
52
|
actions: __('Editor publish'),
|
|
57
|
-
|
|
58
53
|
/* translators: accessibility text for the editor footer landmark region. */
|
|
59
54
|
footer: __('Editor footer')
|
|
60
55
|
};
|
|
61
|
-
|
|
56
|
+
function useEditorStyles() {
|
|
57
|
+
const {
|
|
58
|
+
hasThemeStyleSupport,
|
|
59
|
+
editorSettings
|
|
60
|
+
} = useSelect(select => ({
|
|
61
|
+
hasThemeStyleSupport: select(editPostStore).isFeatureActive('themeStyles'),
|
|
62
|
+
editorSettings: select(editorStore).getEditorSettings()
|
|
63
|
+
}), []);
|
|
64
|
+
|
|
65
|
+
// Compute the default styles.
|
|
66
|
+
return useMemo(() => {
|
|
67
|
+
var _editorSettings$style, _editorSettings$style2;
|
|
68
|
+
const presetStyles = (_editorSettings$style = editorSettings.styles?.filter(style => style.__unstableType && style.__unstableType !== 'theme')) !== null && _editorSettings$style !== void 0 ? _editorSettings$style : [];
|
|
69
|
+
const defaultEditorStyles = [...editorSettings.defaultEditorStyles, ...presetStyles];
|
|
70
|
+
|
|
71
|
+
// Has theme styles if the theme supports them and if some styles were not preset styles (in which case they're theme styles).
|
|
72
|
+
const hasThemeStyles = hasThemeStyleSupport && presetStyles.length !== ((_editorSettings$style2 = editorSettings.styles?.length) !== null && _editorSettings$style2 !== void 0 ? _editorSettings$style2 : 0);
|
|
73
|
+
|
|
74
|
+
// If theme styles are not present or displayed, ensure that
|
|
75
|
+
// base layout styles are still present in the editor.
|
|
76
|
+
if (!editorSettings.disableLayoutStyles && !hasThemeStyles) {
|
|
77
|
+
defaultEditorStyles.push({
|
|
78
|
+
css: getLayoutStyles({
|
|
79
|
+
style: {},
|
|
80
|
+
selector: 'body',
|
|
81
|
+
hasBlockGapSupport: false,
|
|
82
|
+
hasFallbackGapSupport: true,
|
|
83
|
+
fallbackGapValue: '0.5em'
|
|
84
|
+
})
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
return hasThemeStyles ? editorSettings.styles : defaultEditorStyles;
|
|
88
|
+
}, [editorSettings.defaultEditorStyles, editorSettings.disableLayoutStyles, editorSettings.styles, hasThemeStyleSupport]);
|
|
89
|
+
}
|
|
62
90
|
function Layout() {
|
|
91
|
+
useBlockCommands();
|
|
63
92
|
const isMobileViewport = useViewportMatch('medium', '<');
|
|
64
93
|
const isHugeViewport = useViewportMatch('huge', '>=');
|
|
65
94
|
const isLargeViewport = useViewportMatch('large');
|
|
@@ -87,43 +116,14 @@ function Layout() {
|
|
|
87
116
|
isDistractionFree,
|
|
88
117
|
showBlockBreadcrumbs,
|
|
89
118
|
isTemplateMode,
|
|
90
|
-
documentLabel
|
|
91
|
-
styles
|
|
119
|
+
documentLabel
|
|
92
120
|
} = useSelect(select => {
|
|
93
121
|
const {
|
|
94
122
|
getEditorSettings,
|
|
95
123
|
getPostTypeLabel
|
|
96
124
|
} = select(editorStore);
|
|
97
|
-
const {
|
|
98
|
-
isFeatureActive
|
|
99
|
-
} = select(editPostStore);
|
|
100
125
|
const editorSettings = getEditorSettings();
|
|
101
126
|
const postTypeLabel = getPostTypeLabel();
|
|
102
|
-
const hasThemeStyles = isFeatureActive('themeStyles');
|
|
103
|
-
const themeStyles = [];
|
|
104
|
-
const presetStyles = [];
|
|
105
|
-
editorSettings.styles?.forEach(style => {
|
|
106
|
-
if (!style.__unstableType || style.__unstableType === 'theme') {
|
|
107
|
-
themeStyles.push(style);
|
|
108
|
-
} else {
|
|
109
|
-
presetStyles.push(style);
|
|
110
|
-
}
|
|
111
|
-
});
|
|
112
|
-
const defaultEditorStyles = [...editorSettings.defaultEditorStyles, ...presetStyles]; // If theme styles are not present or displayed, ensure that
|
|
113
|
-
// base layout styles are still present in the editor.
|
|
114
|
-
|
|
115
|
-
if (!editorSettings.disableLayoutStyles && !(hasThemeStyles && themeStyles.length)) {
|
|
116
|
-
defaultEditorStyles.push({
|
|
117
|
-
css: getLayoutStyles({
|
|
118
|
-
style: {},
|
|
119
|
-
selector: 'body',
|
|
120
|
-
hasBlockGapSupport: false,
|
|
121
|
-
hasFallbackGapSupport: true,
|
|
122
|
-
fallbackGapValue: '0.5em'
|
|
123
|
-
})
|
|
124
|
-
});
|
|
125
|
-
}
|
|
126
|
-
|
|
127
127
|
return {
|
|
128
128
|
isTemplateMode: select(editPostStore).isEditingTemplate(),
|
|
129
129
|
hasFixedToolbar: select(editPostStore).isFeatureActive('fixedToolbar'),
|
|
@@ -140,14 +140,13 @@ function Layout() {
|
|
|
140
140
|
isDistractionFree: select(editPostStore).isFeatureActive('distractionFree'),
|
|
141
141
|
showBlockBreadcrumbs: select(editPostStore).isFeatureActive('showBlockBreadcrumbs'),
|
|
142
142
|
// translators: Default label for the Document in the Block Breadcrumb.
|
|
143
|
-
documentLabel: postTypeLabel || _x('Document', 'noun')
|
|
144
|
-
styles: hasThemeStyles && themeStyles.length ? editorSettings.styles : defaultEditorStyles
|
|
143
|
+
documentLabel: postTypeLabel || _x('Document', 'noun')
|
|
145
144
|
};
|
|
146
145
|
}, []);
|
|
146
|
+
const styles = useEditorStyles();
|
|
147
|
+
const openSidebarPanel = () => openGeneralSidebar(hasBlockSelected ? 'edit-post/block' : 'edit-post/document');
|
|
147
148
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
149
|
+
// Inserter and Sidebars are mutually exclusive
|
|
151
150
|
useEffect(() => {
|
|
152
151
|
if (sidebarIsOpened && !isHugeViewport) {
|
|
153
152
|
setIsInserterOpened(false);
|
|
@@ -157,15 +156,15 @@ function Layout() {
|
|
|
157
156
|
if (isInserterOpened && !isHugeViewport) {
|
|
158
157
|
closeGeneralSidebar();
|
|
159
158
|
}
|
|
160
|
-
}, [isInserterOpened, isHugeViewport]);
|
|
161
|
-
// Note 'truthy' callback implies an open panel.
|
|
159
|
+
}, [isInserterOpened, isHugeViewport]);
|
|
162
160
|
|
|
161
|
+
// Local state for save panel.
|
|
162
|
+
// Note 'truthy' callback implies an open panel.
|
|
163
163
|
const [entitiesSavedStatesCallback, setEntitiesSavedStatesCallback] = useState(false);
|
|
164
164
|
const closeEntitiesSavedStates = useCallback(arg => {
|
|
165
165
|
if (typeof entitiesSavedStatesCallback === 'function') {
|
|
166
166
|
entitiesSavedStatesCallback(arg);
|
|
167
167
|
}
|
|
168
|
-
|
|
169
168
|
setEntitiesSavedStatesCallback(false);
|
|
170
169
|
}, [entitiesSavedStatesCallback]);
|
|
171
170
|
const className = classnames('edit-post-layout', 'is-mode-' + mode, {
|
|
@@ -177,31 +176,26 @@ function Layout() {
|
|
|
177
176
|
'is-entity-save-view-open': !!entitiesSavedStatesCallback
|
|
178
177
|
});
|
|
179
178
|
const secondarySidebarLabel = isListViewOpened ? __('Document Overview') : __('Block Library');
|
|
180
|
-
|
|
181
179
|
const secondarySidebar = () => {
|
|
182
180
|
if (mode === 'visual' && isInserterOpened) {
|
|
183
181
|
return createElement(InserterSidebar, null);
|
|
184
182
|
}
|
|
185
|
-
|
|
186
183
|
if (mode === 'visual' && isListViewOpened) {
|
|
187
184
|
return createElement(ListViewSidebar, null);
|
|
188
185
|
}
|
|
189
|
-
|
|
190
186
|
return null;
|
|
191
187
|
};
|
|
192
|
-
|
|
193
188
|
function onPluginAreaError(name) {
|
|
194
|
-
createErrorNotice(sprintf(
|
|
195
|
-
/* translators: %s: plugin name */
|
|
189
|
+
createErrorNotice(sprintf( /* translators: %s: plugin name */
|
|
196
190
|
__('The "%s" plugin has encountered an error and cannot be rendered.'), name));
|
|
197
191
|
}
|
|
198
|
-
|
|
199
192
|
return createElement(Fragment, null, createElement(FullscreenMode, {
|
|
200
193
|
isActive: isFullscreenActive
|
|
201
194
|
}), createElement(BrowserURL, null), createElement(UnsavedChangesWarning, null), createElement(AutosaveMonitor, null), createElement(LocalAutosaveMonitor, null), createElement(EditPostKeyboardShortcuts, null), createElement(EditorKeyboardShortcutsRegister, null), createElement(EditorKeyboardShortcuts, null), createElement(SettingsSidebar, null), createElement(InterfaceSkeleton, {
|
|
202
195
|
isDistractionFree: isDistractionFree && isLargeViewport,
|
|
203
196
|
className: className,
|
|
204
|
-
labels: {
|
|
197
|
+
labels: {
|
|
198
|
+
...interfaceLabels,
|
|
205
199
|
secondarySidebar: secondarySidebarLabel
|
|
206
200
|
},
|
|
207
201
|
header: createElement(Header, {
|
|
@@ -247,6 +241,5 @@ function Layout() {
|
|
|
247
241
|
onError: onPluginAreaError
|
|
248
242
|
}));
|
|
249
243
|
}
|
|
250
|
-
|
|
251
244
|
export default Layout;
|
|
252
245
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-post/src/components/layout/index.js"],"names":["classnames","AutosaveMonitor","LocalAutosaveMonitor","UnsavedChangesWarning","EditorNotices","EditorKeyboardShortcutsRegister","EditorKeyboardShortcuts","EditorSnackbars","PostSyncStatusModal","store","editorStore","useSelect","useDispatch","BlockBreadcrumb","privateApis","blockEditorPrivateApis","Button","ScrollLock","Popover","useViewportMatch","PluginArea","__","_x","sprintf","ComplementaryArea","FullscreenMode","InterfaceSkeleton","interfaceStore","useState","useEffect","useCallback","keyboardShortcutsStore","noticesStore","TextEditor","VisualEditor","EditPostKeyboardShortcuts","KeyboardShortcutHelpModal","EditPostPreferencesModal","BrowserURL","Header","InserterSidebar","ListViewSidebar","SettingsSidebar","MetaBoxes","WelcomeGuide","ActionsPanel","StartPageOptions","editPostStore","unlock","getLayoutStyles","interfaceLabels","header","body","sidebar","actions","footer","Layout","isMobileViewport","isHugeViewport","isLargeViewport","openGeneralSidebar","closeGeneralSidebar","setIsInserterOpened","createErrorNotice","mode","isFullscreenActive","isRichEditingEnabled","sidebarIsOpened","hasActiveMetaboxes","hasFixedToolbar","previousShortcut","nextShortcut","hasBlockSelected","isInserterOpened","isListViewOpened","showIconLabels","isDistractionFree","showBlockBreadcrumbs","isTemplateMode","documentLabel","styles","select","getEditorSettings","getPostTypeLabel","isFeatureActive","editorSettings","postTypeLabel","hasThemeStyles","themeStyles","presetStyles","forEach","style","__unstableType","push","defaultEditorStyles","disableLayoutStyles","length","css","selector","hasBlockGapSupport","hasFallbackGapSupport","fallbackGapValue","isEditingTemplate","getActiveComplementaryArea","name","isPublishSidebarOpened","getEditorMode","richEditingEnabled","hasMetaBoxes","getAllShortcutKeyCombinations","openSidebarPanel","entitiesSavedStatesCallback","setEntitiesSavedStatesCallback","closeEntitiesSavedStates","arg","className","secondarySidebarLabel","secondarySidebar","onPluginAreaError","previous","next"],"mappings":";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D;AACC,MAAA,wBAAwB,EAAGkC,wBAD5B;AAEC,MAAA,yBAAyB,EACxBF,2BAHF;AAKC,MAAA,8BAA8B,EAC7BC;AANF,MAtEF;AAgFC,IAAA,SAAS,EAAG;AACXO,MAAAA,QAAQ,EAAEjD,gBADC;AAEXkD,MAAAA,IAAI,EAAEjD;AAFK;AAhFb,IAVD,EA+FC,cAAC,wBAAD,OA/FD,EAgGC,cAAC,yBAAD,OAhGD,EAiGC,cAAC,YAAD,OAjGD,EAkGC,cAAC,mBAAD,OAlGD,EAmGC,cAAC,gBAAD,OAnGD,EAoGC,cAAC,OAAD,CAAS,IAAT,OApGD,EAqGC,cAAC,UAAD;AAAY,IAAA,OAAO,EAAG+C;AAAtB,IArGD,CADD;AAyGA;;AAED,eAAe9D,MAAf","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tAutosaveMonitor,\n\tLocalAutosaveMonitor,\n\tUnsavedChangesWarning,\n\tEditorNotices,\n\tEditorKeyboardShortcutsRegister,\n\tEditorKeyboardShortcuts,\n\tEditorSnackbars,\n\tPostSyncStatusModal,\n\tstore as editorStore,\n} from '@wordpress/editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tBlockBreadcrumb,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { Button, ScrollLock, Popover } from '@wordpress/components';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { PluginArea } from '@wordpress/plugins';\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport {\n\tComplementaryArea,\n\tFullscreenMode,\n\tInterfaceSkeleton,\n\tstore as interfaceStore,\n} from '@wordpress/interface';\nimport { useState, useEffect, useCallback } from '@wordpress/element';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport TextEditor from '../text-editor';\nimport VisualEditor from '../visual-editor';\nimport EditPostKeyboardShortcuts from '../keyboard-shortcuts';\nimport KeyboardShortcutHelpModal from '../keyboard-shortcut-help-modal';\nimport EditPostPreferencesModal from '../preferences-modal';\nimport BrowserURL from '../browser-url';\nimport Header from '../header';\nimport InserterSidebar from '../secondary-sidebar/inserter-sidebar';\nimport ListViewSidebar from '../secondary-sidebar/list-view-sidebar';\nimport SettingsSidebar from '../sidebar/settings-sidebar';\nimport MetaBoxes from '../meta-boxes';\nimport WelcomeGuide from '../welcome-guide';\nimport ActionsPanel from './actions-panel';\nimport StartPageOptions from '../start-page-options';\nimport { store as editPostStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nconst { getLayoutStyles } = unlock( blockEditorPrivateApis );\n\nconst interfaceLabels = {\n\t/* translators: accessibility text for the editor top bar landmark region. */\n\theader: __( 'Editor top bar' ),\n\t/* translators: accessibility text for the editor content landmark region. */\n\tbody: __( 'Editor content' ),\n\t/* translators: accessibility text for the editor settings landmark region. */\n\tsidebar: __( 'Editor settings' ),\n\t/* translators: accessibility text for the editor publish landmark region. */\n\tactions: __( 'Editor publish' ),\n\t/* translators: accessibility text for the editor footer landmark region. */\n\tfooter: __( 'Editor footer' ),\n};\n\nfunction Layout() {\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst isHugeViewport = useViewportMatch( 'huge', '>=' );\n\tconst isLargeViewport = useViewportMatch( 'large' );\n\tconst { openGeneralSidebar, closeGeneralSidebar, setIsInserterOpened } =\n\t\tuseDispatch( editPostStore );\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\tconst {\n\t\tmode,\n\t\tisFullscreenActive,\n\t\tisRichEditingEnabled,\n\t\tsidebarIsOpened,\n\t\thasActiveMetaboxes,\n\t\thasFixedToolbar,\n\t\tpreviousShortcut,\n\t\tnextShortcut,\n\t\thasBlockSelected,\n\t\tisInserterOpened,\n\t\tisListViewOpened,\n\t\tshowIconLabels,\n\t\tisDistractionFree,\n\t\tshowBlockBreadcrumbs,\n\t\tisTemplateMode,\n\t\tdocumentLabel,\n\t\tstyles,\n\t} = useSelect( ( select ) => {\n\t\tconst { getEditorSettings, getPostTypeLabel } = select( editorStore );\n\t\tconst { isFeatureActive } = select( editPostStore );\n\t\tconst editorSettings = getEditorSettings();\n\t\tconst postTypeLabel = getPostTypeLabel();\n\t\tconst hasThemeStyles = isFeatureActive( 'themeStyles' );\n\n\t\tconst themeStyles = [];\n\t\tconst presetStyles = [];\n\t\teditorSettings.styles?.forEach( ( style ) => {\n\t\t\tif ( ! style.__unstableType || style.__unstableType === 'theme' ) {\n\t\t\t\tthemeStyles.push( style );\n\t\t\t} else {\n\t\t\t\tpresetStyles.push( style );\n\t\t\t}\n\t\t} );\n\n\t\tconst defaultEditorStyles = [\n\t\t\t...editorSettings.defaultEditorStyles,\n\t\t\t...presetStyles,\n\t\t];\n\n\t\t// If theme styles are not present or displayed, ensure that\n\t\t// base layout styles are still present in the editor.\n\t\tif (\n\t\t\t! editorSettings.disableLayoutStyles &&\n\t\t\t! ( hasThemeStyles && themeStyles.length )\n\t\t) {\n\t\t\tdefaultEditorStyles.push( {\n\t\t\t\tcss: getLayoutStyles( {\n\t\t\t\t\tstyle: {},\n\t\t\t\t\tselector: 'body',\n\t\t\t\t\thasBlockGapSupport: false,\n\t\t\t\t\thasFallbackGapSupport: true,\n\t\t\t\t\tfallbackGapValue: '0.5em',\n\t\t\t\t} ),\n\t\t\t} );\n\t\t}\n\n\t\treturn {\n\t\t\tisTemplateMode: select( editPostStore ).isEditingTemplate(),\n\t\t\thasFixedToolbar:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'fixedToolbar' ),\n\t\t\tsidebarIsOpened: !! (\n\t\t\t\tselect( interfaceStore ).getActiveComplementaryArea(\n\t\t\t\t\teditPostStore.name\n\t\t\t\t) || select( editPostStore ).isPublishSidebarOpened()\n\t\t\t),\n\t\t\tisFullscreenActive:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'fullscreenMode' ),\n\t\t\tisInserterOpened: select( editPostStore ).isInserterOpened(),\n\t\t\tisListViewOpened: select( editPostStore ).isListViewOpened(),\n\t\t\tmode: select( editPostStore ).getEditorMode(),\n\t\t\tisRichEditingEnabled: editorSettings.richEditingEnabled,\n\t\t\thasActiveMetaboxes: select( editPostStore ).hasMetaBoxes(),\n\t\t\tpreviousShortcut: select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getAllShortcutKeyCombinations( 'core/edit-post/previous-region' ),\n\t\t\tnextShortcut: select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getAllShortcutKeyCombinations( 'core/edit-post/next-region' ),\n\t\t\tshowIconLabels:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'showIconLabels' ),\n\t\t\tisDistractionFree:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'distractionFree' ),\n\t\t\tshowBlockBreadcrumbs: select( editPostStore ).isFeatureActive(\n\t\t\t\t'showBlockBreadcrumbs'\n\t\t\t),\n\t\t\t// translators: Default label for the Document in the Block Breadcrumb.\n\t\t\tdocumentLabel: postTypeLabel || _x( 'Document', 'noun' ),\n\t\t\tstyles:\n\t\t\t\thasThemeStyles && themeStyles.length\n\t\t\t\t\t? editorSettings.styles\n\t\t\t\t\t: defaultEditorStyles,\n\t\t};\n\t}, [] );\n\n\tconst openSidebarPanel = () =>\n\t\topenGeneralSidebar(\n\t\t\thasBlockSelected ? 'edit-post/block' : 'edit-post/document'\n\t\t);\n\n\t// Inserter and Sidebars are mutually exclusive\n\tuseEffect( () => {\n\t\tif ( sidebarIsOpened && ! isHugeViewport ) {\n\t\t\tsetIsInserterOpened( false );\n\t\t}\n\t}, [ sidebarIsOpened, isHugeViewport ] );\n\tuseEffect( () => {\n\t\tif ( isInserterOpened && ! isHugeViewport ) {\n\t\t\tcloseGeneralSidebar();\n\t\t}\n\t}, [ isInserterOpened, isHugeViewport ] );\n\n\t// Local state for save panel.\n\t// Note 'truthy' callback implies an open panel.\n\tconst [ entitiesSavedStatesCallback, setEntitiesSavedStatesCallback ] =\n\t\tuseState( false );\n\tconst closeEntitiesSavedStates = useCallback(\n\t\t( arg ) => {\n\t\t\tif ( typeof entitiesSavedStatesCallback === 'function' ) {\n\t\t\t\tentitiesSavedStatesCallback( arg );\n\t\t\t}\n\t\t\tsetEntitiesSavedStatesCallback( false );\n\t\t},\n\t\t[ entitiesSavedStatesCallback ]\n\t);\n\n\tconst className = classnames( 'edit-post-layout', 'is-mode-' + mode, {\n\t\t'is-sidebar-opened': sidebarIsOpened,\n\t\t'has-fixed-toolbar': hasFixedToolbar,\n\t\t'has-metaboxes': hasActiveMetaboxes,\n\t\t'show-icon-labels': showIconLabels,\n\t\t'is-distraction-free': isDistractionFree && isLargeViewport,\n\t\t'is-entity-save-view-open': !! entitiesSavedStatesCallback,\n\t} );\n\n\tconst secondarySidebarLabel = isListViewOpened\n\t\t? __( 'Document Overview' )\n\t\t: __( 'Block Library' );\n\n\tconst secondarySidebar = () => {\n\t\tif ( mode === 'visual' && isInserterOpened ) {\n\t\t\treturn <InserterSidebar />;\n\t\t}\n\t\tif ( mode === 'visual' && isListViewOpened ) {\n\t\t\treturn <ListViewSidebar />;\n\t\t}\n\n\t\treturn null;\n\t};\n\n\tfunction onPluginAreaError( name ) {\n\t\tcreateErrorNotice(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: plugin name */\n\t\t\t\t__(\n\t\t\t\t\t'The \"%s\" plugin has encountered an error and cannot be rendered.'\n\t\t\t\t),\n\t\t\t\tname\n\t\t\t)\n\t\t);\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<FullscreenMode isActive={ isFullscreenActive } />\n\t\t\t<BrowserURL />\n\t\t\t<UnsavedChangesWarning />\n\t\t\t<AutosaveMonitor />\n\t\t\t<LocalAutosaveMonitor />\n\t\t\t<EditPostKeyboardShortcuts />\n\t\t\t<EditorKeyboardShortcutsRegister />\n\t\t\t<EditorKeyboardShortcuts />\n\t\t\t<SettingsSidebar />\n\t\t\t<InterfaceSkeleton\n\t\t\t\tisDistractionFree={ isDistractionFree && isLargeViewport }\n\t\t\t\tclassName={ className }\n\t\t\t\tlabels={ {\n\t\t\t\t\t...interfaceLabels,\n\t\t\t\t\tsecondarySidebar: secondarySidebarLabel,\n\t\t\t\t} }\n\t\t\t\theader={\n\t\t\t\t\t<Header\n\t\t\t\t\t\tsetEntitiesSavedStatesCallback={\n\t\t\t\t\t\t\tsetEntitiesSavedStatesCallback\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t}\n\t\t\t\teditorNotices={ <EditorNotices /> }\n\t\t\t\tsecondarySidebar={ secondarySidebar() }\n\t\t\t\tsidebar={\n\t\t\t\t\t( ! isMobileViewport || sidebarIsOpened ) && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t{ ! isMobileViewport && ! sidebarIsOpened && (\n\t\t\t\t\t\t\t\t<div className=\"edit-post-layout__toggle-sidebar-panel\">\n\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\t\t\t\tclassName=\"edit-post-layout__toggle-sidebar-panel-button\"\n\t\t\t\t\t\t\t\t\t\tonClick={ openSidebarPanel }\n\t\t\t\t\t\t\t\t\t\taria-expanded={ false }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ hasBlockSelected\n\t\t\t\t\t\t\t\t\t\t\t? __( 'Open block settings' )\n\t\t\t\t\t\t\t\t\t\t\t: __( 'Open document settings' ) }\n\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t<ComplementaryArea.Slot scope=\"core/edit-post\" />\n\t\t\t\t\t\t</>\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\tnotices={ <EditorSnackbars /> }\n\t\t\t\tcontent={\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ ! isDistractionFree && <EditorNotices /> }\n\t\t\t\t\t\t{ ( mode === 'text' || ! isRichEditingEnabled ) && (\n\t\t\t\t\t\t\t<TextEditor />\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ isRichEditingEnabled && mode === 'visual' && (\n\t\t\t\t\t\t\t<VisualEditor styles={ styles } />\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ ! isDistractionFree && ! isTemplateMode && (\n\t\t\t\t\t\t\t<div className=\"edit-post-layout__metaboxes\">\n\t\t\t\t\t\t\t\t<MetaBoxes location=\"normal\" />\n\t\t\t\t\t\t\t\t<MetaBoxes location=\"advanced\" />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ isMobileViewport && sidebarIsOpened && (\n\t\t\t\t\t\t\t<ScrollLock />\n\t\t\t\t\t\t) }\n\t\t\t\t\t</>\n\t\t\t\t}\n\t\t\t\tfooter={\n\t\t\t\t\t! isDistractionFree &&\n\t\t\t\t\t! isMobileViewport &&\n\t\t\t\t\tshowBlockBreadcrumbs &&\n\t\t\t\t\tisRichEditingEnabled &&\n\t\t\t\t\tmode === 'visual' && (\n\t\t\t\t\t\t<div className=\"edit-post-layout__footer\">\n\t\t\t\t\t\t\t<BlockBreadcrumb rootLabelText={ documentLabel } />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\tactions={\n\t\t\t\t\t<ActionsPanel\n\t\t\t\t\t\tcloseEntitiesSavedStates={ closeEntitiesSavedStates }\n\t\t\t\t\t\tisEntitiesSavedStatesOpen={\n\t\t\t\t\t\t\tentitiesSavedStatesCallback\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsetEntitiesSavedStatesCallback={\n\t\t\t\t\t\t\tsetEntitiesSavedStatesCallback\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t}\n\t\t\t\tshortcuts={ {\n\t\t\t\t\tprevious: previousShortcut,\n\t\t\t\t\tnext: nextShortcut,\n\t\t\t\t} }\n\t\t\t/>\n\t\t\t<EditPostPreferencesModal />\n\t\t\t<KeyboardShortcutHelpModal />\n\t\t\t<WelcomeGuide />\n\t\t\t<PostSyncStatusModal />\n\t\t\t<StartPageOptions />\n\t\t\t<Popover.Slot />\n\t\t\t<PluginArea onError={ onPluginAreaError } />\n\t\t</>\n\t);\n}\n\nexport default Layout;\n"]}
|
|
1
|
+
{"version":3,"names":["classnames","AutosaveMonitor","LocalAutosaveMonitor","UnsavedChangesWarning","EditorNotices","EditorKeyboardShortcutsRegister","EditorKeyboardShortcuts","EditorSnackbars","PostSyncStatusModal","store","editorStore","useSelect","useDispatch","useBlockCommands","BlockBreadcrumb","privateApis","blockEditorPrivateApis","Button","ScrollLock","Popover","useViewportMatch","PluginArea","__","_x","sprintf","ComplementaryArea","FullscreenMode","InterfaceSkeleton","interfaceStore","useState","useEffect","useCallback","useMemo","keyboardShortcutsStore","noticesStore","TextEditor","VisualEditor","EditPostKeyboardShortcuts","KeyboardShortcutHelpModal","EditPostPreferencesModal","BrowserURL","Header","InserterSidebar","ListViewSidebar","SettingsSidebar","MetaBoxes","WelcomeGuide","ActionsPanel","StartPageOptions","editPostStore","unlock","getLayoutStyles","interfaceLabels","header","body","sidebar","actions","footer","useEditorStyles","hasThemeStyleSupport","editorSettings","select","isFeatureActive","getEditorSettings","_editorSettings$style","_editorSettings$style2","presetStyles","styles","filter","style","__unstableType","defaultEditorStyles","hasThemeStyles","length","disableLayoutStyles","push","css","selector","hasBlockGapSupport","hasFallbackGapSupport","fallbackGapValue","Layout","isMobileViewport","isHugeViewport","isLargeViewport","openGeneralSidebar","closeGeneralSidebar","setIsInserterOpened","createErrorNotice","mode","isFullscreenActive","isRichEditingEnabled","sidebarIsOpened","hasActiveMetaboxes","hasFixedToolbar","previousShortcut","nextShortcut","hasBlockSelected","isInserterOpened","isListViewOpened","showIconLabels","isDistractionFree","showBlockBreadcrumbs","isTemplateMode","documentLabel","getPostTypeLabel","postTypeLabel","isEditingTemplate","getActiveComplementaryArea","name","isPublishSidebarOpened","getEditorMode","richEditingEnabled","hasMetaBoxes","getAllShortcutKeyCombinations","openSidebarPanel","entitiesSavedStatesCallback","setEntitiesSavedStatesCallback","closeEntitiesSavedStates","arg","className","secondarySidebarLabel","secondarySidebar","createElement","onPluginAreaError","Fragment","isActive","labels","editorNotices","variant","onClick","Slot","scope","notices","content","location","rootLabelText","isEntitiesSavedStatesOpen","shortcuts","previous","next","onError"],"sources":["@wordpress/edit-post/src/components/layout/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tAutosaveMonitor,\n\tLocalAutosaveMonitor,\n\tUnsavedChangesWarning,\n\tEditorNotices,\n\tEditorKeyboardShortcutsRegister,\n\tEditorKeyboardShortcuts,\n\tEditorSnackbars,\n\tPostSyncStatusModal,\n\tstore as editorStore,\n} from '@wordpress/editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tuseBlockCommands,\n\tBlockBreadcrumb,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { Button, ScrollLock, Popover } from '@wordpress/components';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { PluginArea } from '@wordpress/plugins';\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport {\n\tComplementaryArea,\n\tFullscreenMode,\n\tInterfaceSkeleton,\n\tstore as interfaceStore,\n} from '@wordpress/interface';\nimport { useState, useEffect, useCallback, useMemo } from '@wordpress/element';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport TextEditor from '../text-editor';\nimport VisualEditor from '../visual-editor';\nimport EditPostKeyboardShortcuts from '../keyboard-shortcuts';\nimport KeyboardShortcutHelpModal from '../keyboard-shortcut-help-modal';\nimport EditPostPreferencesModal from '../preferences-modal';\nimport BrowserURL from '../browser-url';\nimport Header from '../header';\nimport InserterSidebar from '../secondary-sidebar/inserter-sidebar';\nimport ListViewSidebar from '../secondary-sidebar/list-view-sidebar';\nimport SettingsSidebar from '../sidebar/settings-sidebar';\nimport MetaBoxes from '../meta-boxes';\nimport WelcomeGuide from '../welcome-guide';\nimport ActionsPanel from './actions-panel';\nimport StartPageOptions from '../start-page-options';\nimport { store as editPostStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nconst { getLayoutStyles } = unlock( blockEditorPrivateApis );\n\nconst interfaceLabels = {\n\t/* translators: accessibility text for the editor top bar landmark region. */\n\theader: __( 'Editor top bar' ),\n\t/* translators: accessibility text for the editor content landmark region. */\n\tbody: __( 'Editor content' ),\n\t/* translators: accessibility text for the editor settings landmark region. */\n\tsidebar: __( 'Editor settings' ),\n\t/* translators: accessibility text for the editor publish landmark region. */\n\tactions: __( 'Editor publish' ),\n\t/* translators: accessibility text for the editor footer landmark region. */\n\tfooter: __( 'Editor footer' ),\n};\n\nfunction useEditorStyles() {\n\tconst { hasThemeStyleSupport, editorSettings } = useSelect(\n\t\t( select ) => ( {\n\t\t\thasThemeStyleSupport:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'themeStyles' ),\n\t\t\teditorSettings: select( editorStore ).getEditorSettings(),\n\t\t} ),\n\t\t[]\n\t);\n\n\t// Compute the default styles.\n\treturn useMemo( () => {\n\t\tconst presetStyles =\n\t\t\teditorSettings.styles?.filter(\n\t\t\t\t( style ) =>\n\t\t\t\t\tstyle.__unstableType && style.__unstableType !== 'theme'\n\t\t\t) ?? [];\n\n\t\tconst defaultEditorStyles = [\n\t\t\t...editorSettings.defaultEditorStyles,\n\t\t\t...presetStyles,\n\t\t];\n\n\t\t// Has theme styles if the theme supports them and if some styles were not preset styles (in which case they're theme styles).\n\t\tconst hasThemeStyles =\n\t\t\thasThemeStyleSupport &&\n\t\t\tpresetStyles.length !== ( editorSettings.styles?.length ?? 0 );\n\n\t\t// If theme styles are not present or displayed, ensure that\n\t\t// base layout styles are still present in the editor.\n\t\tif ( ! editorSettings.disableLayoutStyles && ! hasThemeStyles ) {\n\t\t\tdefaultEditorStyles.push( {\n\t\t\t\tcss: getLayoutStyles( {\n\t\t\t\t\tstyle: {},\n\t\t\t\t\tselector: 'body',\n\t\t\t\t\thasBlockGapSupport: false,\n\t\t\t\t\thasFallbackGapSupport: true,\n\t\t\t\t\tfallbackGapValue: '0.5em',\n\t\t\t\t} ),\n\t\t\t} );\n\t\t}\n\n\t\treturn hasThemeStyles ? editorSettings.styles : defaultEditorStyles;\n\t}, [\n\t\teditorSettings.defaultEditorStyles,\n\t\teditorSettings.disableLayoutStyles,\n\t\teditorSettings.styles,\n\t\thasThemeStyleSupport,\n\t] );\n}\n\nfunction Layout() {\n\tuseBlockCommands();\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst isHugeViewport = useViewportMatch( 'huge', '>=' );\n\tconst isLargeViewport = useViewportMatch( 'large' );\n\tconst { openGeneralSidebar, closeGeneralSidebar, setIsInserterOpened } =\n\t\tuseDispatch( editPostStore );\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\tconst {\n\t\tmode,\n\t\tisFullscreenActive,\n\t\tisRichEditingEnabled,\n\t\tsidebarIsOpened,\n\t\thasActiveMetaboxes,\n\t\thasFixedToolbar,\n\t\tpreviousShortcut,\n\t\tnextShortcut,\n\t\thasBlockSelected,\n\t\tisInserterOpened,\n\t\tisListViewOpened,\n\t\tshowIconLabels,\n\t\tisDistractionFree,\n\t\tshowBlockBreadcrumbs,\n\t\tisTemplateMode,\n\t\tdocumentLabel,\n\t} = useSelect( ( select ) => {\n\t\tconst { getEditorSettings, getPostTypeLabel } = select( editorStore );\n\t\tconst editorSettings = getEditorSettings();\n\t\tconst postTypeLabel = getPostTypeLabel();\n\n\t\treturn {\n\t\t\tisTemplateMode: select( editPostStore ).isEditingTemplate(),\n\t\t\thasFixedToolbar:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'fixedToolbar' ),\n\t\t\tsidebarIsOpened: !! (\n\t\t\t\tselect( interfaceStore ).getActiveComplementaryArea(\n\t\t\t\t\teditPostStore.name\n\t\t\t\t) || select( editPostStore ).isPublishSidebarOpened()\n\t\t\t),\n\t\t\tisFullscreenActive:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'fullscreenMode' ),\n\t\t\tisInserterOpened: select( editPostStore ).isInserterOpened(),\n\t\t\tisListViewOpened: select( editPostStore ).isListViewOpened(),\n\t\t\tmode: select( editPostStore ).getEditorMode(),\n\t\t\tisRichEditingEnabled: editorSettings.richEditingEnabled,\n\t\t\thasActiveMetaboxes: select( editPostStore ).hasMetaBoxes(),\n\t\t\tpreviousShortcut: select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getAllShortcutKeyCombinations( 'core/edit-post/previous-region' ),\n\t\t\tnextShortcut: select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getAllShortcutKeyCombinations( 'core/edit-post/next-region' ),\n\t\t\tshowIconLabels:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'showIconLabels' ),\n\t\t\tisDistractionFree:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'distractionFree' ),\n\t\t\tshowBlockBreadcrumbs: select( editPostStore ).isFeatureActive(\n\t\t\t\t'showBlockBreadcrumbs'\n\t\t\t),\n\t\t\t// translators: Default label for the Document in the Block Breadcrumb.\n\t\t\tdocumentLabel: postTypeLabel || _x( 'Document', 'noun' ),\n\t\t};\n\t}, [] );\n\n\tconst styles = useEditorStyles();\n\n\tconst openSidebarPanel = () =>\n\t\topenGeneralSidebar(\n\t\t\thasBlockSelected ? 'edit-post/block' : 'edit-post/document'\n\t\t);\n\n\t// Inserter and Sidebars are mutually exclusive\n\tuseEffect( () => {\n\t\tif ( sidebarIsOpened && ! isHugeViewport ) {\n\t\t\tsetIsInserterOpened( false );\n\t\t}\n\t}, [ sidebarIsOpened, isHugeViewport ] );\n\tuseEffect( () => {\n\t\tif ( isInserterOpened && ! isHugeViewport ) {\n\t\t\tcloseGeneralSidebar();\n\t\t}\n\t}, [ isInserterOpened, isHugeViewport ] );\n\n\t// Local state for save panel.\n\t// Note 'truthy' callback implies an open panel.\n\tconst [ entitiesSavedStatesCallback, setEntitiesSavedStatesCallback ] =\n\t\tuseState( false );\n\tconst closeEntitiesSavedStates = useCallback(\n\t\t( arg ) => {\n\t\t\tif ( typeof entitiesSavedStatesCallback === 'function' ) {\n\t\t\t\tentitiesSavedStatesCallback( arg );\n\t\t\t}\n\t\t\tsetEntitiesSavedStatesCallback( false );\n\t\t},\n\t\t[ entitiesSavedStatesCallback ]\n\t);\n\n\tconst className = classnames( 'edit-post-layout', 'is-mode-' + mode, {\n\t\t'is-sidebar-opened': sidebarIsOpened,\n\t\t'has-fixed-toolbar': hasFixedToolbar,\n\t\t'has-metaboxes': hasActiveMetaboxes,\n\t\t'show-icon-labels': showIconLabels,\n\t\t'is-distraction-free': isDistractionFree && isLargeViewport,\n\t\t'is-entity-save-view-open': !! entitiesSavedStatesCallback,\n\t} );\n\n\tconst secondarySidebarLabel = isListViewOpened\n\t\t? __( 'Document Overview' )\n\t\t: __( 'Block Library' );\n\n\tconst secondarySidebar = () => {\n\t\tif ( mode === 'visual' && isInserterOpened ) {\n\t\t\treturn <InserterSidebar />;\n\t\t}\n\t\tif ( mode === 'visual' && isListViewOpened ) {\n\t\t\treturn <ListViewSidebar />;\n\t\t}\n\n\t\treturn null;\n\t};\n\n\tfunction onPluginAreaError( name ) {\n\t\tcreateErrorNotice(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: plugin name */\n\t\t\t\t__(\n\t\t\t\t\t'The \"%s\" plugin has encountered an error and cannot be rendered.'\n\t\t\t\t),\n\t\t\t\tname\n\t\t\t)\n\t\t);\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<FullscreenMode isActive={ isFullscreenActive } />\n\t\t\t<BrowserURL />\n\t\t\t<UnsavedChangesWarning />\n\t\t\t<AutosaveMonitor />\n\t\t\t<LocalAutosaveMonitor />\n\t\t\t<EditPostKeyboardShortcuts />\n\t\t\t<EditorKeyboardShortcutsRegister />\n\t\t\t<EditorKeyboardShortcuts />\n\t\t\t<SettingsSidebar />\n\t\t\t<InterfaceSkeleton\n\t\t\t\tisDistractionFree={ isDistractionFree && isLargeViewport }\n\t\t\t\tclassName={ className }\n\t\t\t\tlabels={ {\n\t\t\t\t\t...interfaceLabels,\n\t\t\t\t\tsecondarySidebar: secondarySidebarLabel,\n\t\t\t\t} }\n\t\t\t\theader={\n\t\t\t\t\t<Header\n\t\t\t\t\t\tsetEntitiesSavedStatesCallback={\n\t\t\t\t\t\t\tsetEntitiesSavedStatesCallback\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t}\n\t\t\t\teditorNotices={ <EditorNotices /> }\n\t\t\t\tsecondarySidebar={ secondarySidebar() }\n\t\t\t\tsidebar={\n\t\t\t\t\t( ! isMobileViewport || sidebarIsOpened ) && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t{ ! isMobileViewport && ! sidebarIsOpened && (\n\t\t\t\t\t\t\t\t<div className=\"edit-post-layout__toggle-sidebar-panel\">\n\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\t\t\t\tclassName=\"edit-post-layout__toggle-sidebar-panel-button\"\n\t\t\t\t\t\t\t\t\t\tonClick={ openSidebarPanel }\n\t\t\t\t\t\t\t\t\t\taria-expanded={ false }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ hasBlockSelected\n\t\t\t\t\t\t\t\t\t\t\t? __( 'Open block settings' )\n\t\t\t\t\t\t\t\t\t\t\t: __( 'Open document settings' ) }\n\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t<ComplementaryArea.Slot scope=\"core/edit-post\" />\n\t\t\t\t\t\t</>\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\tnotices={ <EditorSnackbars /> }\n\t\t\t\tcontent={\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ ! isDistractionFree && <EditorNotices /> }\n\t\t\t\t\t\t{ ( mode === 'text' || ! isRichEditingEnabled ) && (\n\t\t\t\t\t\t\t<TextEditor />\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ isRichEditingEnabled && mode === 'visual' && (\n\t\t\t\t\t\t\t<VisualEditor styles={ styles } />\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ ! isDistractionFree && ! isTemplateMode && (\n\t\t\t\t\t\t\t<div className=\"edit-post-layout__metaboxes\">\n\t\t\t\t\t\t\t\t<MetaBoxes location=\"normal\" />\n\t\t\t\t\t\t\t\t<MetaBoxes location=\"advanced\" />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ isMobileViewport && sidebarIsOpened && (\n\t\t\t\t\t\t\t<ScrollLock />\n\t\t\t\t\t\t) }\n\t\t\t\t\t</>\n\t\t\t\t}\n\t\t\t\tfooter={\n\t\t\t\t\t! isDistractionFree &&\n\t\t\t\t\t! isMobileViewport &&\n\t\t\t\t\tshowBlockBreadcrumbs &&\n\t\t\t\t\tisRichEditingEnabled &&\n\t\t\t\t\tmode === 'visual' && (\n\t\t\t\t\t\t<div className=\"edit-post-layout__footer\">\n\t\t\t\t\t\t\t<BlockBreadcrumb rootLabelText={ documentLabel } />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\tactions={\n\t\t\t\t\t<ActionsPanel\n\t\t\t\t\t\tcloseEntitiesSavedStates={ closeEntitiesSavedStates }\n\t\t\t\t\t\tisEntitiesSavedStatesOpen={\n\t\t\t\t\t\t\tentitiesSavedStatesCallback\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsetEntitiesSavedStatesCallback={\n\t\t\t\t\t\t\tsetEntitiesSavedStatesCallback\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t}\n\t\t\t\tshortcuts={ {\n\t\t\t\t\tprevious: previousShortcut,\n\t\t\t\t\tnext: nextShortcut,\n\t\t\t\t} }\n\t\t\t/>\n\t\t\t<EditPostPreferencesModal />\n\t\t\t<KeyboardShortcutHelpModal />\n\t\t\t<WelcomeGuide />\n\t\t\t<PostSyncStatusModal />\n\t\t\t<StartPageOptions />\n\t\t\t<Popover.Slot />\n\t\t\t<PluginArea onError={ onPluginAreaError } />\n\t\t</>\n\t);\n}\n\nexport default Layout;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SACCC,eAAe,EACfC,oBAAoB,EACpBC,qBAAqB,EACrBC,aAAa,EACbC,+BAA+B,EAC/BC,uBAAuB,EACvBC,eAAe,EACfC,mBAAmB,EACnBC,KAAK,IAAIC,WAAW,QACd,mBAAmB;AAC1B,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SACCC,gBAAgB,EAChBC,eAAe,EACfC,WAAW,IAAIC,sBAAsB,QAC/B,yBAAyB;AAChC,SAASC,MAAM,EAAEC,UAAU,EAAEC,OAAO,QAAQ,uBAAuB;AACnE,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,UAAU,QAAQ,oBAAoB;AAC/C,SAASC,EAAE,EAAEC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AACjD,SACCC,iBAAiB,EACjBC,cAAc,EACdC,iBAAiB,EACjBlB,KAAK,IAAImB,cAAc,QACjB,sBAAsB;AAC7B,SAASC,QAAQ,EAAEC,SAAS,EAAEC,WAAW,EAAEC,OAAO,QAAQ,oBAAoB;AAC9E,SAASvB,KAAK,IAAIwB,sBAAsB,QAAQ,+BAA+B;AAC/E,SAASxB,KAAK,IAAIyB,YAAY,QAAQ,oBAAoB;;AAE1D;AACA;AACA;AACA,OAAOC,UAAU,MAAM,gBAAgB;AACvC,OAAOC,YAAY,MAAM,kBAAkB;AAC3C,OAAOC,yBAAyB,MAAM,uBAAuB;AAC7D,OAAOC,yBAAyB,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AC,EAChBR,aAAA,CAACtG,UAAU;IAACwH,OAAO,EAAGjB;EAAmB,CAAE,CAC1C,CAAC;AAEL;AAEA,eAAe3C,MAAM"}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { createElement, Fragment } from "@wordpress/element";
|
|
2
|
-
|
|
3
2
|
/**
|
|
4
3
|
* External dependencies
|
|
5
4
|
*/
|
|
6
5
|
import { Platform, SafeAreaView, View } from 'react-native';
|
|
7
6
|
import SafeArea from 'react-native-safe-area';
|
|
7
|
+
|
|
8
8
|
/**
|
|
9
9
|
* WordPress dependencies
|
|
10
10
|
*/
|
|
11
|
-
|
|
12
11
|
import { Component } from '@wordpress/element';
|
|
13
12
|
import { withSelect } from '@wordpress/data';
|
|
14
13
|
import { BottomSheetSettings, FloatingToolbar, store as blockEditorStore } from '@wordpress/block-editor';
|
|
@@ -16,16 +15,15 @@ import { compose, withPreferredColorScheme } from '@wordpress/compose';
|
|
|
16
15
|
import { HTMLTextInput, KeyboardAvoidingView, NoticeList, Tooltip, __unstableAutocompletionItemsSlot as AutocompletionItemsSlot } from '@wordpress/components';
|
|
17
16
|
import { AutosaveMonitor, store as editorStore } from '@wordpress/editor';
|
|
18
17
|
import { sendNativeEditorDidLayout } from '@wordpress/react-native-bridge';
|
|
18
|
+
|
|
19
19
|
/**
|
|
20
20
|
* Internal dependencies
|
|
21
21
|
*/
|
|
22
|
-
|
|
23
22
|
import styles from './style.scss';
|
|
24
23
|
import headerToolbarStyles from '../header/header-toolbar/style.scss';
|
|
25
24
|
import Header from '../header';
|
|
26
25
|
import VisualEditor from '../visual-editor';
|
|
27
26
|
import { store as editPostStore } from '../../store';
|
|
28
|
-
|
|
29
27
|
class Layout extends Component {
|
|
30
28
|
constructor() {
|
|
31
29
|
super(...arguments);
|
|
@@ -42,47 +40,39 @@ class Layout extends Component {
|
|
|
42
40
|
};
|
|
43
41
|
SafeArea.getSafeAreaInsetsForRootView().then(this.onSafeAreaInsetsUpdate);
|
|
44
42
|
}
|
|
45
|
-
|
|
46
43
|
componentDidMount() {
|
|
47
44
|
this._isMounted = true;
|
|
48
45
|
this.safeAreaSubscription = SafeArea.addEventListener('safeAreaInsetsForRootViewDidChange', this.onSafeAreaInsetsUpdate);
|
|
49
46
|
}
|
|
50
|
-
|
|
51
47
|
componentWillUnmount() {
|
|
52
48
|
this.safeAreaSubscription?.remove();
|
|
53
49
|
this._isMounted = false;
|
|
54
50
|
}
|
|
55
|
-
|
|
56
51
|
onSafeAreaInsetsUpdate(result) {
|
|
57
52
|
const {
|
|
58
53
|
safeAreaInsets
|
|
59
54
|
} = result;
|
|
60
|
-
|
|
61
55
|
if (this._isMounted) {
|
|
62
56
|
this.setState({
|
|
63
57
|
safeAreaInsets
|
|
64
58
|
});
|
|
65
59
|
}
|
|
66
60
|
}
|
|
67
|
-
|
|
68
61
|
onRootViewLayout(event) {
|
|
69
62
|
if (this._isMounted) {
|
|
70
63
|
this.setHeightState(event);
|
|
71
64
|
}
|
|
72
65
|
}
|
|
73
|
-
|
|
74
66
|
setHeightState(event) {
|
|
75
67
|
const {
|
|
76
68
|
height
|
|
77
69
|
} = event.nativeEvent.layout;
|
|
78
|
-
|
|
79
70
|
if (height !== this.state.rootViewHeight) {
|
|
80
71
|
this.setState({
|
|
81
72
|
rootViewHeight: height
|
|
82
73
|
}, sendNativeEditorDidLayout);
|
|
83
74
|
}
|
|
84
75
|
}
|
|
85
|
-
|
|
86
76
|
renderHTML() {
|
|
87
77
|
const {
|
|
88
78
|
globalStyles
|
|
@@ -92,32 +82,30 @@ class Layout extends Component {
|
|
|
92
82
|
style: globalStyles
|
|
93
83
|
});
|
|
94
84
|
}
|
|
95
|
-
|
|
96
85
|
renderVisual() {
|
|
97
86
|
const {
|
|
98
87
|
isReady
|
|
99
88
|
} = this.props;
|
|
100
|
-
|
|
101
89
|
if (!isReady) {
|
|
102
90
|
return null;
|
|
103
91
|
}
|
|
104
|
-
|
|
105
92
|
return createElement(VisualEditor, {
|
|
106
93
|
setTitleRef: this.props.setTitleRef
|
|
107
94
|
});
|
|
108
95
|
}
|
|
109
|
-
|
|
110
96
|
render() {
|
|
111
97
|
const {
|
|
112
98
|
getStylesFromColorScheme,
|
|
113
99
|
mode,
|
|
114
100
|
globalStyles
|
|
115
101
|
} = this.props;
|
|
116
|
-
const isHtmlView = mode === 'text';
|
|
102
|
+
const isHtmlView = mode === 'text';
|
|
117
103
|
|
|
104
|
+
// Add a margin view at the bottom for the header.
|
|
118
105
|
const marginBottom = Platform.OS === 'android' && !isHtmlView ? headerToolbarStyles['header-toolbar__container'].height : 0;
|
|
119
106
|
const containerStyles = getStylesFromColorScheme(styles.container, styles.containerDark);
|
|
120
|
-
const toolbarKeyboardAvoidingViewStyle = {
|
|
107
|
+
const toolbarKeyboardAvoidingViewStyle = {
|
|
108
|
+
...styles.toolbarKeyboardAvoidingView,
|
|
121
109
|
left: this.state.safeAreaInsets.left,
|
|
122
110
|
right: this.state.safeAreaInsets.right,
|
|
123
111
|
bottom: this.state.safeAreaInsets.bottom,
|
|
@@ -145,9 +133,7 @@ class Layout extends Component {
|
|
|
145
133
|
withAnimatedHeight: true
|
|
146
134
|
}, Platform.OS === 'ios' && createElement(Fragment, null, createElement(AutocompletionItemsSlot, null), createElement(FloatingToolbar, null)), createElement(Header, null), createElement(BottomSheetSettings, null)), Platform.OS === 'android' && createElement(AutocompletionItemsSlot, null)));
|
|
147
135
|
}
|
|
148
|
-
|
|
149
136
|
}
|
|
150
|
-
|
|
151
137
|
export default compose([withSelect(select => {
|
|
152
138
|
const {
|
|
153
139
|
__unstableIsEditorReady: isEditorReady
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-post/src/components/layout/index.native.js"],"names":["Platform","SafeAreaView","View","SafeArea","Component","withSelect","BottomSheetSettings","FloatingToolbar","store","blockEditorStore","compose","withPreferredColorScheme","HTMLTextInput","KeyboardAvoidingView","NoticeList","Tooltip","__unstableAutocompletionItemsSlot","AutocompletionItemsSlot","AutosaveMonitor","editorStore","sendNativeEditorDidLayout","styles","headerToolbarStyles","Header","VisualEditor","editPostStore","Layout","constructor","arguments","onSafeAreaInsetsUpdate","bind","onRootViewLayout","state","rootViewHeight","safeAreaInsets","top","bottom","right","left","getSafeAreaInsetsForRootView","then","componentDidMount","_isMounted","safeAreaSubscription","addEventListener","componentWillUnmount","remove","result","setState","event","setHeightState","height","nativeEvent","layout","renderHTML","globalStyles","props","renderVisual","isReady","setTitleRef","render","getStylesFromColorScheme","mode","isHtmlView","marginBottom","OS","containerStyles","container","containerDark","toolbarKeyboardAvoidingViewStyle","toolbarKeyboardAvoidingView","backgroundColor","editorStyles","background","backgroundDark","flex","flexBasis","select","__unstableIsEditorReady","isEditorReady","getEditorMode","getSettings","__experimentalGlobalStylesBaseStyles","color"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,QAAT,EAAmBC,YAAnB,EAAiCC,IAAjC,QAA6C,cAA7C;AACA,OAAOC,QAAP,MAAqB,wBAArB;AAEA;AACA;AACA;;AACA,SAASC,SAAT,QAA0B,oBAA1B;AACA,SAASC,UAAT,QAA2B,iBAA3B;AACA,SACCC,mBADD,EAECC,eAFD,EAGCC,KAAK,IAAIC,gBAHV,QAIO,yBAJP;AAKA,SAASC,OAAT,EAAkBC,wBAAlB,QAAkD,oBAAlD;AACA,SACCC,aADD,EAECC,oBAFD,EAGCC,UAHD,EAICC,OAJD,EAKCC,iCAAiC,IAAIC,uBALtC,QAMO,uBANP;AAOA,SAASC,eAAT,EAA0BV,KAAK,IAAIW,WAAnC,QAAsD,mBAAtD;AACA,SAASC,yBAAT,QAA0C,gCAA1C;AAEA;AACA;AACA;;AACA,OAAOC,MAAP,MAAmB,cAAnB;AACA,OAAOC,mBAAP,MAAgC,qCAAhC;AACA,OAAOC,MAAP,MAAmB,WAAnB;AACA,OAAOC,YAAP,MAAyB,kBAAzB;AACA,SAAShB,KAAK,IAAIiB,aAAlB,QAAuC,aAAvC;;AAEA,MAAMC,MAAN,SAAqBtB,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,CADD,CADD;AAyCA;;AApJ6B;;AAuJ/B,eAAevD,OAAO,CAAE,CACvBL,UAAU,CAAIwE,MAAF,IAAc;AACzB,QAAM;AAAEC,IAAAA,uBAAuB,EAAEC;AAA3B,MACLF,MAAM,CAAE1D,WAAF,CADP;AAEA,QAAM;AAAE6D,IAAAA;AAAF,MAAoBH,MAAM,CAAEpD,aAAF,CAAhC;AACA,QAAM;AAAEwD,IAAAA;AAAF,MAAkBJ,MAAM,CAAEpE,gBAAF,CAA9B;AACA,QAAM8C,YAAY,GACjB0B,WAAW,IAAIC,oCAAf,EAAqDC,KADtD;AAGA,SAAO;AACNzB,IAAAA,OAAO,EAAEqB,aAAa,EADhB;AAENjB,IAAAA,IAAI,EAAEkB,aAAa,EAFb;AAGNzB,IAAAA;AAHM,GAAP;AAKA,CAbS,CADa,EAevB5C,wBAfuB,CAAF,CAAP,CAgBVe,MAhBU,CAAf","sourcesContent":["/**\n * External dependencies\n */\nimport { Platform, SafeAreaView, View } from 'react-native';\nimport SafeArea from 'react-native-safe-area';\n\n/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport { withSelect } from '@wordpress/data';\nimport {\n\tBottomSheetSettings,\n\tFloatingToolbar,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { compose, withPreferredColorScheme } from '@wordpress/compose';\nimport {\n\tHTMLTextInput,\n\tKeyboardAvoidingView,\n\tNoticeList,\n\tTooltip,\n\t__unstableAutocompletionItemsSlot as AutocompletionItemsSlot,\n} from '@wordpress/components';\nimport { AutosaveMonitor, store as editorStore } from '@wordpress/editor';\nimport { sendNativeEditorDidLayout } from '@wordpress/react-native-bridge';\n\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\nimport headerToolbarStyles from '../header/header-toolbar/style.scss';\nimport Header from '../header';\nimport VisualEditor from '../visual-editor';\nimport { store as editPostStore } from '../../store';\n\nclass Layout extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\n\t\tthis.onSafeAreaInsetsUpdate = this.onSafeAreaInsetsUpdate.bind( this );\n\t\tthis.onRootViewLayout = this.onRootViewLayout.bind( this );\n\n\t\tthis.state = {\n\t\t\trootViewHeight: 0,\n\t\t\tsafeAreaInsets: { top: 0, bottom: 0, right: 0, left: 0 },\n\t\t};\n\n\t\tSafeArea.getSafeAreaInsetsForRootView().then(\n\t\t\tthis.onSafeAreaInsetsUpdate\n\t\t);\n\t}\n\n\tcomponentDidMount() {\n\t\tthis._isMounted = true;\n\t\tthis.safeAreaSubscription = SafeArea.addEventListener(\n\t\t\t'safeAreaInsetsForRootViewDidChange',\n\t\t\tthis.onSafeAreaInsetsUpdate\n\t\t);\n\t}\n\n\tcomponentWillUnmount() {\n\t\tthis.safeAreaSubscription?.remove();\n\t\tthis._isMounted = false;\n\t}\n\n\tonSafeAreaInsetsUpdate( result ) {\n\t\tconst { safeAreaInsets } = result;\n\t\tif ( this._isMounted ) {\n\t\t\tthis.setState( { safeAreaInsets } );\n\t\t}\n\t}\n\n\tonRootViewLayout( event ) {\n\t\tif ( this._isMounted ) {\n\t\t\tthis.setHeightState( event );\n\t\t}\n\t}\n\n\tsetHeightState( event ) {\n\t\tconst { height } = event.nativeEvent.layout;\n\t\tif ( height !== this.state.rootViewHeight ) {\n\t\t\tthis.setState(\n\t\t\t\t{ rootViewHeight: height },\n\t\t\t\tsendNativeEditorDidLayout\n\t\t\t);\n\t\t}\n\t}\n\n\trenderHTML() {\n\t\tconst { globalStyles } = this.props;\n\t\treturn (\n\t\t\t<HTMLTextInput\n\t\t\t\tparentHeight={ this.state.rootViewHeight }\n\t\t\t\tstyle={ globalStyles }\n\t\t\t/>\n\t\t);\n\t}\n\n\trenderVisual() {\n\t\tconst { isReady } = this.props;\n\n\t\tif ( ! isReady ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn <VisualEditor setTitleRef={ this.props.setTitleRef } />;\n\t}\n\n\trender() {\n\t\tconst { getStylesFromColorScheme, mode, globalStyles } = this.props;\n\n\t\tconst isHtmlView = mode === 'text';\n\n\t\t// Add a margin view at the bottom for the header.\n\t\tconst marginBottom =\n\t\t\tPlatform.OS === 'android' && ! isHtmlView\n\t\t\t\t? headerToolbarStyles[ 'header-toolbar__container' ].height\n\t\t\t\t: 0;\n\n\t\tconst containerStyles = getStylesFromColorScheme(\n\t\t\tstyles.container,\n\t\t\tstyles.containerDark\n\t\t);\n\n\t\tconst toolbarKeyboardAvoidingViewStyle = {\n\t\t\t...styles.toolbarKeyboardAvoidingView,\n\t\t\tleft: this.state.safeAreaInsets.left,\n\t\t\tright: this.state.safeAreaInsets.right,\n\t\t\tbottom: this.state.safeAreaInsets.bottom,\n\t\t\tbackgroundColor: containerStyles.backgroundColor,\n\t\t};\n\n\t\tconst editorStyles = [\n\t\t\tgetStylesFromColorScheme(\n\t\t\t\tstyles.background,\n\t\t\t\tstyles.backgroundDark\n\t\t\t),\n\t\t\tglobalStyles?.background && {\n\t\t\t\tbackgroundColor: globalStyles.background,\n\t\t\t},\n\t\t];\n\n\t\treturn (\n\t\t\t<Tooltip.Slot>\n\t\t\t\t<SafeAreaView\n\t\t\t\t\tstyle={ containerStyles }\n\t\t\t\t\tonLayout={ this.onRootViewLayout }\n\t\t\t\t>\n\t\t\t\t\t<AutosaveMonitor disableIntervalChecks />\n\t\t\t\t\t<View style={ editorStyles }>\n\t\t\t\t\t\t{ isHtmlView ? this.renderHTML() : this.renderVisual() }\n\t\t\t\t\t\t{ ! isHtmlView && Platform.OS === 'android' && (\n\t\t\t\t\t\t\t<FloatingToolbar />\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<NoticeList />\n\t\t\t\t\t</View>\n\t\t\t\t\t<View\n\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\tflex: 0,\n\t\t\t\t\t\t\tflexBasis: marginBottom,\n\t\t\t\t\t\t\theight: marginBottom,\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t\t{ ! isHtmlView && (\n\t\t\t\t\t\t<KeyboardAvoidingView\n\t\t\t\t\t\t\tparentHeight={ this.state.rootViewHeight }\n\t\t\t\t\t\t\tstyle={ toolbarKeyboardAvoidingViewStyle }\n\t\t\t\t\t\t\twithAnimatedHeight\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ Platform.OS === 'ios' && (\n\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t<AutocompletionItemsSlot />\n\t\t\t\t\t\t\t\t\t<FloatingToolbar />\n\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t<Header />\n\t\t\t\t\t\t\t<BottomSheetSettings />\n\t\t\t\t\t\t</KeyboardAvoidingView>\n\t\t\t\t\t) }\n\t\t\t\t\t{ Platform.OS === 'android' && <AutocompletionItemsSlot /> }\n\t\t\t\t</SafeAreaView>\n\t\t\t</Tooltip.Slot>\n\t\t);\n\t}\n}\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\tconst { __unstableIsEditorReady: isEditorReady } =\n\t\t\tselect( editorStore );\n\t\tconst { getEditorMode } = select( editPostStore );\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\tconst globalStyles =\n\t\t\tgetSettings()?.__experimentalGlobalStylesBaseStyles?.color;\n\n\t\treturn {\n\t\t\tisReady: isEditorReady(),\n\t\t\tmode: getEditorMode(),\n\t\t\tglobalStyles,\n\t\t};\n\t} ),\n\twithPreferredColorScheme,\n] )( Layout );\n"]}
|
|
1
|
+
{"version":3,"names":["Platform","SafeAreaView","View","SafeArea","Component","withSelect","BottomSheetSettings","FloatingToolbar","store","blockEditorStore","compose","withPreferredColorScheme","HTMLTextInput","KeyboardAvoidingView","NoticeList","Tooltip","__unstableAutocompletionItemsSlot","AutocompletionItemsSlot","AutosaveMonitor","editorStore","sendNativeEditorDidLayout","styles","headerToolbarStyles","Header","VisualEditor","editPostStore","Layout","constructor","arguments","onSafeAreaInsetsUpdate","bind","onRootViewLayout","state","rootViewHeight","safeAreaInsets","top","bottom","right","left","getSafeAreaInsetsForRootView","then","componentDidMount","_isMounted","safeAreaSubscription","addEventListener","componentWillUnmount","remove","result","setState","event","setHeightState","height","nativeEvent","layout","renderHTML","globalStyles","props","createElement","parentHeight","style","renderVisual","isReady","setTitleRef","render","getStylesFromColorScheme","mode","isHtmlView","marginBottom","OS","containerStyles","container","containerDark","toolbarKeyboardAvoidingViewStyle","toolbarKeyboardAvoidingView","backgroundColor","editorStyles","background","backgroundDark","Slot","onLayout","disableIntervalChecks","flex","flexBasis","withAnimatedHeight","Fragment","select","__unstableIsEditorReady","isEditorReady","getEditorMode","getSettings","__experimentalGlobalStylesBaseStyles","color"],"sources":["@wordpress/edit-post/src/components/layout/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { Platform, SafeAreaView, View } from 'react-native';\nimport SafeArea from 'react-native-safe-area';\n\n/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport { withSelect } from '@wordpress/data';\nimport {\n\tBottomSheetSettings,\n\tFloatingToolbar,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { compose, withPreferredColorScheme } from '@wordpress/compose';\nimport {\n\tHTMLTextInput,\n\tKeyboardAvoidingView,\n\tNoticeList,\n\tTooltip,\n\t__unstableAutocompletionItemsSlot as AutocompletionItemsSlot,\n} from '@wordpress/components';\nimport { AutosaveMonitor, store as editorStore } from '@wordpress/editor';\nimport { sendNativeEditorDidLayout } from '@wordpress/react-native-bridge';\n\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\nimport headerToolbarStyles from '../header/header-toolbar/style.scss';\nimport Header from '../header';\nimport VisualEditor from '../visual-editor';\nimport { store as editPostStore } from '../../store';\n\nclass Layout extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\n\t\tthis.onSafeAreaInsetsUpdate = this.onSafeAreaInsetsUpdate.bind( this );\n\t\tthis.onRootViewLayout = this.onRootViewLayout.bind( this );\n\n\t\tthis.state = {\n\t\t\trootViewHeight: 0,\n\t\t\tsafeAreaInsets: { top: 0, bottom: 0, right: 0, left: 0 },\n\t\t};\n\n\t\tSafeArea.getSafeAreaInsetsForRootView().then(\n\t\t\tthis.onSafeAreaInsetsUpdate\n\t\t);\n\t}\n\n\tcomponentDidMount() {\n\t\tthis._isMounted = true;\n\t\tthis.safeAreaSubscription = SafeArea.addEventListener(\n\t\t\t'safeAreaInsetsForRootViewDidChange',\n\t\t\tthis.onSafeAreaInsetsUpdate\n\t\t);\n\t}\n\n\tcomponentWillUnmount() {\n\t\tthis.safeAreaSubscription?.remove();\n\t\tthis._isMounted = false;\n\t}\n\n\tonSafeAreaInsetsUpdate( result ) {\n\t\tconst { safeAreaInsets } = result;\n\t\tif ( this._isMounted ) {\n\t\t\tthis.setState( { safeAreaInsets } );\n\t\t}\n\t}\n\n\tonRootViewLayout( event ) {\n\t\tif ( this._isMounted ) {\n\t\t\tthis.setHeightState( event );\n\t\t}\n\t}\n\n\tsetHeightState( event ) {\n\t\tconst { height } = event.nativeEvent.layout;\n\t\tif ( height !== this.state.rootViewHeight ) {\n\t\t\tthis.setState(\n\t\t\t\t{ rootViewHeight: height },\n\t\t\t\tsendNativeEditorDidLayout\n\t\t\t);\n\t\t}\n\t}\n\n\trenderHTML() {\n\t\tconst { globalStyles } = this.props;\n\t\treturn (\n\t\t\t<HTMLTextInput\n\t\t\t\tparentHeight={ this.state.rootViewHeight }\n\t\t\t\tstyle={ globalStyles }\n\t\t\t/>\n\t\t);\n\t}\n\n\trenderVisual() {\n\t\tconst { isReady } = this.props;\n\n\t\tif ( ! isReady ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn <VisualEditor setTitleRef={ this.props.setTitleRef } />;\n\t}\n\n\trender() {\n\t\tconst { getStylesFromColorScheme, mode, globalStyles } = this.props;\n\n\t\tconst isHtmlView = mode === 'text';\n\n\t\t// Add a margin view at the bottom for the header.\n\t\tconst marginBottom =\n\t\t\tPlatform.OS === 'android' && ! isHtmlView\n\t\t\t\t? headerToolbarStyles[ 'header-toolbar__container' ].height\n\t\t\t\t: 0;\n\n\t\tconst containerStyles = getStylesFromColorScheme(\n\t\t\tstyles.container,\n\t\t\tstyles.containerDark\n\t\t);\n\n\t\tconst toolbarKeyboardAvoidingViewStyle = {\n\t\t\t...styles.toolbarKeyboardAvoidingView,\n\t\t\tleft: this.state.safeAreaInsets.left,\n\t\t\tright: this.state.safeAreaInsets.right,\n\t\t\tbottom: this.state.safeAreaInsets.bottom,\n\t\t\tbackgroundColor: containerStyles.backgroundColor,\n\t\t};\n\n\t\tconst editorStyles = [\n\t\t\tgetStylesFromColorScheme(\n\t\t\t\tstyles.background,\n\t\t\t\tstyles.backgroundDark\n\t\t\t),\n\t\t\tglobalStyles?.background && {\n\t\t\t\tbackgroundColor: globalStyles.background,\n\t\t\t},\n\t\t];\n\n\t\treturn (\n\t\t\t<Tooltip.Slot>\n\t\t\t\t<SafeAreaView\n\t\t\t\t\tstyle={ containerStyles }\n\t\t\t\t\tonLayout={ this.onRootViewLayout }\n\t\t\t\t>\n\t\t\t\t\t<AutosaveMonitor disableIntervalChecks />\n\t\t\t\t\t<View style={ editorStyles }>\n\t\t\t\t\t\t{ isHtmlView ? this.renderHTML() : this.renderVisual() }\n\t\t\t\t\t\t{ ! isHtmlView && Platform.OS === 'android' && (\n\t\t\t\t\t\t\t<FloatingToolbar />\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<NoticeList />\n\t\t\t\t\t</View>\n\t\t\t\t\t<View\n\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\tflex: 0,\n\t\t\t\t\t\t\tflexBasis: marginBottom,\n\t\t\t\t\t\t\theight: marginBottom,\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t\t{ ! isHtmlView && (\n\t\t\t\t\t\t<KeyboardAvoidingView\n\t\t\t\t\t\t\tparentHeight={ this.state.rootViewHeight }\n\t\t\t\t\t\t\tstyle={ toolbarKeyboardAvoidingViewStyle }\n\t\t\t\t\t\t\twithAnimatedHeight\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ Platform.OS === 'ios' && (\n\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t<AutocompletionItemsSlot />\n\t\t\t\t\t\t\t\t\t<FloatingToolbar />\n\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t<Header />\n\t\t\t\t\t\t\t<BottomSheetSettings />\n\t\t\t\t\t\t</KeyboardAvoidingView>\n\t\t\t\t\t) }\n\t\t\t\t\t{ Platform.OS === 'android' && <AutocompletionItemsSlot /> }\n\t\t\t\t</SafeAreaView>\n\t\t\t</Tooltip.Slot>\n\t\t);\n\t}\n}\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\tconst { __unstableIsEditorReady: isEditorReady } =\n\t\t\tselect( editorStore );\n\t\tconst { getEditorMode } = select( editPostStore );\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\tconst globalStyles =\n\t\t\tgetSettings()?.__experimentalGlobalStylesBaseStyles?.color;\n\n\t\treturn {\n\t\t\tisReady: isEditorReady(),\n\t\t\tmode: getEditorMode(),\n\t\t\tglobalStyles,\n\t\t};\n\t} ),\n\twithPreferredColorScheme,\n] )( Layout );\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,QAAQ,EAAEC,YAAY,EAAEC,IAAI,QAAQ,cAAc;AAC3D,OAAOC,QAAQ,MAAM,wBAAwB;;AAE7C;AACA;AACA;AACA,SAASC,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,UAAU,QAAQ,iBAAiB;AAC5C,SACCC,mBAAmB,EACnBC,eAAe,EACfC,KAAK,IAAIC,gBAAgB,QACnB,yBAAyB;AAChC,SAASC,OAAO,EAAEC,wBAAwB,QAAQ,oBAAoB;AACtE,SACCC,aAAa,EACbC,oBAAoB,EACpBC,UAAU,EACVC,OAAO,EACPC,iCAAiC,IAAIC,uBAAuB,QACtD,uBAAuB;AAC9B,SAASC,eAAe,EAAEV,KAAK,IAAIW,WAAW,QAAQ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,YAAY,EAAG,IAAI,CAAC1B,KAAK,CAACC,cAAgB;MAC1C0B,KAAK,EAAGa,gCAAkC;MAC1CW,kBAAkB;IAAA,GAEhBnF,QAAQ,CAACoE,EAAE,KAAK,KAAK,IACtBX,aAAA,CAAA2B,QAAA,QACC3B,aAAA,CAACxC,uBAAuB,MAAE,CAAC,EAC3BwC,aAAA,CAAClD,eAAe,MAAE,CACjB,CACF,EACDkD,aAAA,CAAClC,MAAM,MAAE,CAAC,EACVkC,aAAA,CAACnD,mBAAmB,MAAE,CACD,CACtB,EACCN,QAAQ,CAACoE,EAAE,KAAK,SAAS,IAAIX,aAAA,CAACxC,uBAAuB,MAAE,CAC5C,CACD,CAAC;EAEjB;AACD;AAEA,eAAeP,OAAO,CAAE,CACvBL,UAAU,CAAIgF,MAAM,IAAM;EACzB,MAAM;IAAEC,uBAAuB,EAAEC;EAAc,CAAC,GAC/CF,MAAM,CAAElE,WAAY,CAAC;EACtB,MAAM;IAAEqE;EAAc,CAAC,GAAGH,MAAM,CAAE5D,aAAc,CAAC;EACjD,MAAM;IAAEgE;EAAY,CAAC,GAAGJ,MAAM,CAAE5E,gBAAiB,CAAC;EAClD,MAAM8C,YAAY,GACjBkC,WAAW,CAAC,CAAC,EAAEC,oCAAoC,EAAEC,KAAK;EAE3D,OAAO;IACN9B,OAAO,EAAE0B,aAAa,CAAC,CAAC;IACxBtB,IAAI,EAAEuB,aAAa,CAAC,CAAC;IACrBjC;EACD,CAAC;AACF,CAAE,CAAC,EACH5C,wBAAwB,CACvB,CAAC,CAAEe,MAAO,CAAC"}
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { createElement, Fragment } from "@wordpress/element";
|
|
2
|
-
|
|
3
2
|
/**
|
|
4
3
|
* WordPress dependencies
|
|
5
4
|
*/
|
|
6
5
|
import { useSelect, useRegistry } from '@wordpress/data';
|
|
7
6
|
import { useEffect } from '@wordpress/element';
|
|
8
7
|
import { store as editorStore } from '@wordpress/editor';
|
|
8
|
+
|
|
9
9
|
/**
|
|
10
10
|
* Internal dependencies
|
|
11
11
|
*/
|
|
12
|
-
|
|
13
12
|
import MetaBoxesArea from './meta-boxes-area';
|
|
14
13
|
import MetaBoxVisibility from './meta-box-visibility';
|
|
15
14
|
import { store as editPostStore } from '../../store';
|
|
@@ -34,20 +33,19 @@ export default function MetaBoxes({
|
|
|
34
33
|
areMetaBoxesInitialized: _areMetaBoxesInitialized(),
|
|
35
34
|
isEditorReady: __unstableIsEditorReady()
|
|
36
35
|
};
|
|
37
|
-
}, [location]);
|
|
36
|
+
}, [location]);
|
|
37
|
+
|
|
38
|
+
// When editor is ready, initialize postboxes (wp core script) and metabox
|
|
38
39
|
// saving. This initializes all meta box locations, not just this specific
|
|
39
40
|
// one.
|
|
40
|
-
|
|
41
41
|
useEffect(() => {
|
|
42
42
|
if (isEditorReady && !areMetaBoxesInitialized) {
|
|
43
43
|
registry.dispatch(editPostStore).initializeMetaBoxes();
|
|
44
44
|
}
|
|
45
45
|
}, [isEditorReady, areMetaBoxesInitialized]);
|
|
46
|
-
|
|
47
46
|
if (!areMetaBoxesInitialized) {
|
|
48
47
|
return null;
|
|
49
48
|
}
|
|
50
|
-
|
|
51
49
|
return createElement(Fragment, null, (metaBoxes !== null && metaBoxes !== void 0 ? metaBoxes : []).map(({
|
|
52
50
|
id
|
|
53
51
|
}) => createElement(MetaBoxVisibility, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["useSelect","useRegistry","useEffect","store","editorStore","MetaBoxesArea","MetaBoxVisibility","editPostStore","MetaBoxes","location","registry","metaBoxes","areMetaBoxesInitialized","isEditorReady","select","__unstableIsEditorReady","getMetaBoxesPerLocation","_areMetaBoxesInitialized","dispatch","initializeMetaBoxes","createElement","Fragment","map","id","key"],"sources":["@wordpress/edit-post/src/components/meta-boxes/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useRegistry } from '@wordpress/data';\nimport { useEffect } from '@wordpress/element';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport MetaBoxesArea from './meta-boxes-area';\nimport MetaBoxVisibility from './meta-box-visibility';\nimport { store as editPostStore } from '../../store';\n\nexport default function MetaBoxes( { location } ) {\n\tconst registry = useRegistry();\n\tconst { metaBoxes, areMetaBoxesInitialized, isEditorReady } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { __unstableIsEditorReady } = select( editorStore );\n\t\t\tconst {\n\t\t\t\tgetMetaBoxesPerLocation,\n\t\t\t\tareMetaBoxesInitialized: _areMetaBoxesInitialized,\n\t\t\t} = select( editPostStore );\n\t\t\treturn {\n\t\t\t\tmetaBoxes: getMetaBoxesPerLocation( location ),\n\t\t\t\tareMetaBoxesInitialized: _areMetaBoxesInitialized(),\n\t\t\t\tisEditorReady: __unstableIsEditorReady(),\n\t\t\t};\n\t\t},\n\t\t[ location ]\n\t);\n\n\t// When editor is ready, initialize postboxes (wp core script) and metabox\n\t// saving. This initializes all meta box locations, not just this specific\n\t// one.\n\tuseEffect( () => {\n\t\tif ( isEditorReady && ! areMetaBoxesInitialized ) {\n\t\t\tregistry.dispatch( editPostStore ).initializeMetaBoxes();\n\t\t}\n\t}, [ isEditorReady, areMetaBoxesInitialized ] );\n\n\tif ( ! areMetaBoxesInitialized ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{ ( metaBoxes ?? [] ).map( ( { id } ) => (\n\t\t\t\t<MetaBoxVisibility key={ id } id={ id } />\n\t\t\t) ) }\n\t\t\t<MetaBoxesArea location={ location } />\n\t\t</>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;;AAExD;AACA;AACA;AACA,OAAOC,aAAa,MAAM,mBAAmB;AAC7C,OAAOC,iBAAiB,M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*/
|
|
4
4
|
import { Component } from '@wordpress/element';
|
|
5
5
|
import { withSelect } from '@wordpress/data';
|
|
6
|
+
|
|
6
7
|
/**
|
|
7
8
|
* Internal dependencies
|
|
8
9
|
*/
|
|
9
|
-
|
|
10
10
|
import { store as editPostStore } from '../../store';
|
|
11
|
-
|
|
12
11
|
class MetaBoxVisibility extends Component {
|
|
13
12
|
componentDidMount() {
|
|
14
13
|
this.updateDOM();
|
|
15
14
|
}
|
|
16
|
-
|
|
17
15
|
componentDidUpdate(prevProps) {
|
|
18
16
|
if (this.props.isVisible !== prevProps.isVisible) {
|
|
19
17
|
this.updateDOM();
|
|
20
18
|
}
|
|
21
19
|
}
|
|
22
|
-
|
|
23
20
|
updateDOM() {
|
|
24
21
|
const {
|
|
25
22
|
id,
|
|
26
23
|
isVisible
|
|
27
24
|
} = this.props;
|
|
28
25
|
const element = document.getElementById(id);
|
|
29
|
-
|
|
30
26
|
if (!element) {
|
|
31
27
|
return;
|
|
32
28
|
}
|
|
33
|
-
|
|
34
29
|
if (isVisible) {
|
|
35
30
|
element.classList.remove('is-hidden');
|
|
36
31
|
} else {
|
|
37
32
|
element.classList.add('is-hidden');
|
|
38
33
|
}
|
|
39
34
|
}
|
|
40
|
-
|
|
41
35
|
render() {
|
|
42
36
|
return null;
|
|
43
37
|
}
|
|
44
|
-
|
|
45
38
|
}
|
|
46
|
-
|
|
47
39
|
export default withSelect((select, {
|
|
48
40
|
id
|
|
49
41
|
}) => ({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["Component","withSelect","store","editPostStore","MetaBoxVisibility","componentDidMount","updateDOM","componentDidUpdate","prevProps","props","isVisible","id","element","document","getElementById","classList","remove","add","render","select","isEditorPanelEnabled"],"sources":["@wordpress/edit-post/src/components/meta-boxes/meta-box-visibility.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport { withSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../store';\n\nclass MetaBoxVisibility extends Component {\n\tcomponentDidMount() {\n\t\tthis.updateDOM();\n\t}\n\n\tcomponentDidUpdate( prevProps ) {\n\t\tif ( this.props.isVisible !== prevProps.isVisible ) {\n\t\t\tthis.updateDOM();\n\t\t}\n\t}\n\n\tupdateDOM() {\n\t\tconst { id, isVisible } = this.props;\n\n\t\tconst element = document.getElementById( id );\n\t\tif ( ! element ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( isVisible ) {\n\t\t\telement.classList.remove( 'is-hidden' );\n\t\t} else {\n\t\t\telement.classList.add( 'is-hidden' );\n\t\t}\n\t}\n\n\trender() {\n\t\treturn null;\n\t}\n}\n\nexport default withSelect( ( select, { id } ) => ( {\n\tisVisible: select( editPostStore ).isEditorPanelEnabled(\n\t\t`meta-box-${ id }`\n\t),\n} ) )( MetaBoxVisibility );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,UAAU,QAAQ,iBAAiB;;AAE5C;AACA;AACA;AACA,SAASC,KAAK,IAAIC,aAAa,QAAQ,aAAa;AAEpD,MAAMC,iBAAiB,SAASJ,SAAS,CAAC;EACzCK,iBAAiBA,CAAA,EAAG;IACnB,IAAI,CAACC,SAAS,CAAC,CAAC;EACjB;EAEAC,kBAAkBA,CAAEC,SAAS,EAAG;IAC/B,IAAK,IAAI,CAACC,KAAK,CAACC,SAAS,KAAKF,SAAS,CAACE,SAAS,EAAG;MACnD,IAAI,CAACJ,SAAS,CAAC,CAAC;IACjB;EACD;EAEAA,SAASA,CAAA,EAAG;IACX,MAAM;MAAEK,EAAE;MAAED;IAAU,CAAC,GAAG,IAAI,CAACD,KAAK;IAEpC,MAAMG,OAAO,GAAGC,QAAQ,CAACC,cAAc,CAAEH,EAAG,CAAC;IAC7C,IAAK,CAAEC,OAAO,EAAG;MAChB;IACD;IAEA,IAAKF,SAAS,EAAG;MAChBE,OAAO,CAACG,SAAS,CAACC,MAAM,CAAE,WAAY,CAAC;IACxC,CAAC,MAAM;MACNJ,OAAO,CAACG,SAAS,CAACE,GAAG,CAAE,WAAY,CAAC;IACrC;EACD;EAEAC,MAAMA,CAAA,EAAG;IACR,OAAO,IAAI;EACZ;AACD;AAEA,eAAejB,UAAU,CAAE,CAAEkB,MAAM,EAAE;EAAER;AAAG,CAAC,MAAQ;EAClDD,SAAS,EAAES,MAAM,CAAEhB,aAAc,CAAC,CAACiB,oBAAoB,CACrD,YAAYT,EAAI,EAClB;AACD,CAAC,CAAG,CAAC,CAAEP,iBAAkB,CAAC"}
|