@wordpress/edit-post 7.11.0 → 7.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/build/components/block-manager/category.js +14 -22
- package/build/components/block-manager/category.js.map +1 -1
- package/build/components/block-manager/checklist.js +6 -13
- package/build/components/block-manager/checklist.js.map +1 -1
- package/build/components/block-manager/index.js +29 -17
- package/build/components/block-manager/index.js.map +1 -1
- package/build/components/block-settings-menu/plugin-block-settings-menu-item.js +21 -26
- package/build/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
- package/build/components/device-preview/index.js +3 -5
- package/build/components/device-preview/index.js.map +1 -1
- package/build/components/editor-initialization/index.js +3 -4
- package/build/components/editor-initialization/index.js.map +1 -1
- package/build/components/header/document-title/index.js +103 -0
- package/build/components/header/document-title/index.js.map +1 -0
- package/build/components/header/fullscreen-mode-close/index.js +8 -9
- package/build/components/header/fullscreen-mode-close/index.js.map +1 -1
- package/build/components/header/header-toolbar/index.js +2 -2
- package/build/components/header/header-toolbar/index.js.map +1 -1
- package/build/components/header/header-toolbar/index.native.js +12 -13
- package/build/components/header/header-toolbar/index.native.js.map +1 -1
- package/build/components/header/index.js +14 -20
- package/build/components/header/index.js.map +1 -1
- package/build/components/header/main-dashboard-button/index.js +3 -4
- package/build/components/header/main-dashboard-button/index.js.map +1 -1
- package/build/components/header/more-menu/index.js +19 -23
- package/build/components/header/more-menu/index.js.map +1 -1
- package/build/components/header/plugin-sidebar-more-menu-item/index.js +4 -7
- package/build/components/header/plugin-sidebar-more-menu-item/index.js.map +1 -1
- package/build/components/header/post-publish-button-or-toggle.js +15 -16
- package/build/components/header/post-publish-button-or-toggle.js.map +1 -1
- package/build/components/header/tools-more-menu-group/index.js +7 -10
- package/build/components/header/tools-more-menu-group/index.js.map +1 -1
- package/build/components/header/writing-menu/index.js +0 -8
- package/build/components/header/writing-menu/index.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +3 -4
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/index.js +45 -54
- package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/shortcut.js +10 -12
- package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
- package/build/components/keyboard-shortcuts/index.js +1 -1
- package/build/components/keyboard-shortcuts/index.js.map +1 -1
- package/build/components/layout/actions-panel.js +5 -6
- package/build/components/layout/actions-panel.js.map +1 -1
- package/build/components/layout/index.js +3 -4
- package/build/components/layout/index.js.map +1 -1
- package/build/components/layout/index.native.js +3 -7
- package/build/components/layout/index.native.js.map +1 -1
- package/build/components/meta-boxes/index.js +9 -13
- package/build/components/meta-boxes/index.js.map +1 -1
- package/build/components/meta-boxes/meta-box-visibility.js +5 -8
- package/build/components/meta-boxes/meta-box-visibility.js.map +1 -1
- package/build/components/meta-boxes/meta-boxes-area/index.js +3 -4
- package/build/components/meta-boxes/meta-boxes-area/index.js.map +1 -1
- package/build/components/preferences-modal/meta-boxes-section.js +18 -24
- package/build/components/preferences-modal/meta-boxes-section.js.map +1 -1
- package/build/components/preferences-modal/options/enable-custom-fields.js +8 -10
- package/build/components/preferences-modal/options/enable-custom-fields.js.map +1 -1
- package/build/components/preferences-modal/options/enable-feature.js +12 -16
- package/build/components/preferences-modal/options/enable-feature.js.map +1 -1
- package/build/components/preferences-modal/options/enable-panel.js +10 -17
- package/build/components/preferences-modal/options/enable-panel.js.map +1 -1
- package/build/components/preferences-modal/options/enable-plugin-document-setting-panel.js +7 -10
- package/build/components/preferences-modal/options/enable-plugin-document-setting-panel.js.map +1 -1
- package/build/components/secondary-sidebar/inserter-sidebar.js +4 -8
- package/build/components/secondary-sidebar/inserter-sidebar.js.map +1 -1
- package/build/components/secondary-sidebar/list-view-sidebar.js +58 -44
- package/build/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
- package/build/components/sidebar/discussion-panel/index.js +5 -7
- package/build/components/sidebar/discussion-panel/index.js.map +1 -1
- package/build/components/sidebar/featured-image/index.js +9 -17
- package/build/components/sidebar/featured-image/index.js.map +1 -1
- package/build/components/sidebar/page-attributes/index.js +3 -9
- package/build/components/sidebar/page-attributes/index.js.map +1 -1
- package/build/components/sidebar/plugin-document-setting-panel/index.js +20 -25
- package/build/components/sidebar/plugin-document-setting-panel/index.js.map +1 -1
- package/build/components/sidebar/plugin-post-publish-panel/index.js +12 -15
- package/build/components/sidebar/plugin-post-publish-panel/index.js.map +1 -1
- package/build/components/sidebar/plugin-post-status-info/index.js +6 -9
- package/build/components/sidebar/plugin-post-status-info/index.js.map +1 -1
- package/build/components/sidebar/plugin-pre-publish-panel/index.js +12 -15
- package/build/components/sidebar/plugin-pre-publish-panel/index.js.map +1 -1
- package/build/components/sidebar/plugin-sidebar/index.js +8 -12
- package/build/components/sidebar/plugin-sidebar/index.js.map +1 -1
- package/build/components/sidebar/post-excerpt/index.js +5 -7
- package/build/components/sidebar/post-excerpt/index.js.map +1 -1
- package/build/components/sidebar/post-schedule/index.js +16 -23
- package/build/components/sidebar/post-schedule/index.js.map +1 -1
- package/build/components/sidebar/post-status/index.js +8 -12
- package/build/components/sidebar/post-status/index.js.map +1 -1
- package/build/components/sidebar/post-taxonomies/taxonomy-panel.js +9 -15
- package/build/components/sidebar/post-taxonomies/taxonomy-panel.js.map +1 -1
- package/build/components/sidebar/post-template/create-modal.js +3 -4
- package/build/components/sidebar/post-template/create-modal.js.map +1 -1
- package/build/components/sidebar/post-template/form.js +13 -20
- package/build/components/sidebar/post-template/form.js.map +1 -1
- package/build/components/sidebar/post-template/index.js +18 -25
- package/build/components/sidebar/post-template/index.js.map +1 -1
- package/build/components/sidebar/post-url/index.js +16 -23
- package/build/components/sidebar/post-url/index.js.map +1 -1
- package/build/components/sidebar/post-visibility/index.js +26 -36
- package/build/components/sidebar/post-visibility/index.js.map +1 -1
- package/build/components/sidebar/settings-header/index.js +3 -4
- package/build/components/sidebar/settings-header/index.js.map +1 -1
- package/build/components/sidebar/template-summary/index.js +1 -1
- package/build/components/sidebar/template-summary/index.js.map +1 -1
- package/build/components/start-page-options/index.js +3 -4
- package/build/components/start-page-options/index.js.map +1 -1
- package/build/components/view-link/index.js +1 -1
- package/build/components/view-link/index.js.map +1 -1
- package/build/components/visual-editor/block-inspector-button.js +4 -5
- package/build/components/visual-editor/block-inspector-button.js.map +1 -1
- package/build/components/visual-editor/header.native.js +6 -7
- package/build/components/visual-editor/header.native.js.map +1 -1
- package/build/components/visual-editor/index.js +49 -57
- package/build/components/visual-editor/index.js.map +1 -1
- package/build/components/welcome-guide/image.js +4 -5
- package/build/components/welcome-guide/image.js.map +1 -1
- package/build/editor.js +42 -30
- package/build/editor.js.map +1 -1
- package/build/editor.native.js +7 -11
- package/build/editor.native.js.map +1 -1
- package/build/hooks/validate-multiple-use/index.js +24 -37
- package/build/hooks/validate-multiple-use/index.js.map +1 -1
- package/build/index.js +18 -2
- package/build/index.js.map +1 -1
- package/build/{private-apis.js → lock-unlock.js} +1 -1
- package/build/lock-unlock.js.map +1 -0
- package/build/plugins/index.js +20 -23
- package/build/plugins/index.js.map +1 -1
- package/build/plugins/keyboard-shortcuts-help-menu-item/index.js +3 -4
- package/build/plugins/keyboard-shortcuts-help-menu-item/index.js.map +1 -1
- package/build/store/actions.js +60 -88
- package/build/store/actions.js.map +1 -1
- package/build/store/reducer.js +11 -43
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +11 -16
- package/build/store/selectors.js.map +1 -1
- package/build-module/components/block-manager/category.js +14 -22
- package/build-module/components/block-manager/category.js.map +1 -1
- package/build-module/components/block-manager/checklist.js +6 -13
- package/build-module/components/block-manager/checklist.js.map +1 -1
- package/build-module/components/block-manager/index.js +32 -20
- package/build-module/components/block-manager/index.js.map +1 -1
- package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js +21 -26
- package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
- package/build-module/components/device-preview/index.js +3 -5
- package/build-module/components/device-preview/index.js.map +1 -1
- package/build-module/components/editor-initialization/index.js +3 -4
- package/build-module/components/editor-initialization/index.js.map +1 -1
- package/build-module/components/header/document-title/index.js +88 -0
- package/build-module/components/header/document-title/index.js.map +1 -0
- package/build-module/components/header/fullscreen-mode-close/index.js +7 -8
- package/build-module/components/header/fullscreen-mode-close/index.js.map +1 -1
- package/build-module/components/header/header-toolbar/index.js +1 -1
- package/build-module/components/header/header-toolbar/index.js.map +1 -1
- package/build-module/components/header/header-toolbar/index.native.js +12 -13
- package/build-module/components/header/header-toolbar/index.native.js.map +1 -1
- package/build-module/components/header/index.js +14 -20
- package/build-module/components/header/index.js.map +1 -1
- package/build-module/components/header/main-dashboard-button/index.js +3 -4
- package/build-module/components/header/main-dashboard-button/index.js.map +1 -1
- package/build-module/components/header/more-menu/index.js +19 -23
- package/build-module/components/header/more-menu/index.js.map +1 -1
- package/build-module/components/header/plugin-sidebar-more-menu-item/index.js +4 -4
- 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 +15 -16
- package/build-module/components/header/post-publish-button-or-toggle.js.map +1 -1
- package/build-module/components/header/tools-more-menu-group/index.js +7 -10
- package/build-module/components/header/tools-more-menu-group/index.js.map +1 -1
- package/build-module/components/header/writing-menu/index.js +0 -8
- package/build-module/components/header/writing-menu/index.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +3 -4
- package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/index.js +43 -52
- package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +10 -12
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/index.js +1 -1
- package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
- package/build-module/components/layout/actions-panel.js +5 -6
- package/build-module/components/layout/actions-panel.js.map +1 -1
- package/build-module/components/layout/index.js +3 -4
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/layout/index.native.js +3 -7
- package/build-module/components/layout/index.native.js.map +1 -1
- package/build-module/components/meta-boxes/index.js +9 -13
- package/build-module/components/meta-boxes/index.js.map +1 -1
- package/build-module/components/meta-boxes/meta-box-visibility.js +5 -8
- 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 -4
- package/build-module/components/meta-boxes/meta-boxes-area/index.js.map +1 -1
- package/build-module/components/preferences-modal/meta-boxes-section.js +18 -24
- package/build-module/components/preferences-modal/meta-boxes-section.js.map +1 -1
- package/build-module/components/preferences-modal/options/enable-custom-fields.js +8 -10
- package/build-module/components/preferences-modal/options/enable-custom-fields.js.map +1 -1
- package/build-module/components/preferences-modal/options/enable-feature.js +12 -16
- package/build-module/components/preferences-modal/options/enable-feature.js.map +1 -1
- package/build-module/components/preferences-modal/options/enable-panel.js +10 -17
- 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 +7 -10
- package/build-module/components/preferences-modal/options/enable-plugin-document-setting-panel.js.map +1 -1
- package/build-module/components/secondary-sidebar/inserter-sidebar.js +4 -5
- package/build-module/components/secondary-sidebar/inserter-sidebar.js.map +1 -1
- package/build-module/components/secondary-sidebar/list-view-sidebar.js +58 -44
- package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
- package/build-module/components/sidebar/discussion-panel/index.js +5 -7
- package/build-module/components/sidebar/discussion-panel/index.js.map +1 -1
- package/build-module/components/sidebar/featured-image/index.js +9 -17
- package/build-module/components/sidebar/featured-image/index.js.map +1 -1
- package/build-module/components/sidebar/page-attributes/index.js +3 -9
- package/build-module/components/sidebar/page-attributes/index.js.map +1 -1
- package/build-module/components/sidebar/plugin-document-setting-panel/index.js +20 -25
- 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 +12 -15
- 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 +6 -9
- 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 +12 -15
- package/build-module/components/sidebar/plugin-pre-publish-panel/index.js.map +1 -1
- package/build-module/components/sidebar/plugin-sidebar/index.js +8 -9
- package/build-module/components/sidebar/plugin-sidebar/index.js.map +1 -1
- package/build-module/components/sidebar/post-excerpt/index.js +5 -7
- package/build-module/components/sidebar/post-excerpt/index.js.map +1 -1
- package/build-module/components/sidebar/post-schedule/index.js +16 -23
- package/build-module/components/sidebar/post-schedule/index.js.map +1 -1
- package/build-module/components/sidebar/post-status/index.js +9 -13
- package/build-module/components/sidebar/post-status/index.js.map +1 -1
- package/build-module/components/sidebar/post-taxonomies/taxonomy-panel.js +9 -15
- package/build-module/components/sidebar/post-taxonomies/taxonomy-panel.js.map +1 -1
- package/build-module/components/sidebar/post-template/create-modal.js +3 -4
- package/build-module/components/sidebar/post-template/create-modal.js.map +1 -1
- package/build-module/components/sidebar/post-template/form.js +13 -20
- package/build-module/components/sidebar/post-template/form.js.map +1 -1
- package/build-module/components/sidebar/post-template/index.js +18 -25
- package/build-module/components/sidebar/post-template/index.js.map +1 -1
- package/build-module/components/sidebar/post-url/index.js +16 -23
- package/build-module/components/sidebar/post-url/index.js.map +1 -1
- package/build-module/components/sidebar/post-visibility/index.js +26 -36
- package/build-module/components/sidebar/post-visibility/index.js.map +1 -1
- package/build-module/components/sidebar/settings-header/index.js +3 -4
- package/build-module/components/sidebar/settings-header/index.js.map +1 -1
- package/build-module/components/sidebar/template-summary/index.js +1 -1
- package/build-module/components/sidebar/template-summary/index.js.map +1 -1
- package/build-module/components/start-page-options/index.js +3 -4
- package/build-module/components/start-page-options/index.js.map +1 -1
- package/build-module/components/view-link/index.js +1 -1
- package/build-module/components/view-link/index.js.map +1 -1
- package/build-module/components/visual-editor/block-inspector-button.js +4 -5
- package/build-module/components/visual-editor/block-inspector-button.js.map +1 -1
- package/build-module/components/visual-editor/header.native.js +6 -7
- package/build-module/components/visual-editor/header.native.js.map +1 -1
- package/build-module/components/visual-editor/index.js +47 -54
- package/build-module/components/visual-editor/index.js.map +1 -1
- package/build-module/components/welcome-guide/image.js +4 -5
- package/build-module/components/welcome-guide/image.js.map +1 -1
- package/build-module/editor.js +38 -26
- package/build-module/editor.js.map +1 -1
- package/build-module/editor.native.js +7 -10
- package/build-module/editor.native.js.map +1 -1
- package/build-module/hooks/validate-multiple-use/index.js +24 -34
- package/build-module/hooks/validate-multiple-use/index.js.map +1 -1
- package/build-module/index.js +18 -2
- package/build-module/index.js.map +1 -1
- package/build-module/{private-apis.js → lock-unlock.js} +1 -1
- package/build-module/lock-unlock.js.map +1 -0
- package/build-module/plugins/index.js +20 -23
- package/build-module/plugins/index.js.map +1 -1
- package/build-module/plugins/keyboard-shortcuts-help-menu-item/index.js +3 -4
- package/build-module/plugins/keyboard-shortcuts-help-menu-item/index.js.map +1 -1
- package/build-module/store/actions.js +60 -88
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/reducer.js +11 -43
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +11 -16
- package/build-module/store/selectors.js.map +1 -1
- package/build-style/style-rtl.css +66 -102
- package/build-style/style.css +66 -102
- package/package.json +32 -32
- package/src/components/block-manager/index.js +51 -31
- package/src/components/block-manager/style.scss +3 -1
- package/src/components/device-preview/index.js +1 -2
- package/src/components/header/document-title/index.js +86 -0
- package/src/components/header/document-title/style.scss +61 -0
- package/src/components/header/header-toolbar/index.js +1 -1
- package/src/components/header/header-toolbar/style.scss +0 -1
- package/src/components/header/index.js +7 -10
- package/src/components/header/style.scss +6 -0
- package/src/components/header/writing-menu/index.js +0 -10
- package/src/components/keyboard-shortcuts/index.js +1 -1
- package/src/components/preferences-modal/options/enable-custom-fields.js +2 -2
- package/src/components/preferences-modal/options/test/__snapshots__/enable-custom-fields.js.snap +2 -2
- package/src/components/preferences-modal/test/__snapshots__/index.js.snap +10 -4
- package/src/components/secondary-sidebar/list-view-sidebar.js +68 -66
- package/src/components/secondary-sidebar/style.scss +28 -31
- package/src/components/sidebar/post-status/index.js +2 -1
- package/src/components/visual-editor/index.js +22 -32
- package/src/components/visual-editor/style.scss +0 -13
- package/src/editor.js +22 -1
- package/src/index.js +30 -3
- package/src/plugins/index.js +1 -1
- package/src/style.scss +1 -1
- package/src/test/editor.native.js +34 -9
- package/build/components/header/template-title/delete-template.js +0 -117
- package/build/components/header/template-title/delete-template.js.map +0 -1
- package/build/components/header/template-title/edit-template-title.js +0 -95
- package/build/components/header/template-title/edit-template-title.js.map +0 -1
- package/build/components/header/template-title/index.js +0 -124
- package/build/components/header/template-title/index.js.map +0 -1
- package/build/components/header/template-title/template-description.js +0 -55
- package/build/components/header/template-title/template-description.js.map +0 -1
- package/build/private-apis.js.map +0 -1
- package/build-module/components/header/template-title/delete-template.js +0 -104
- package/build-module/components/header/template-title/delete-template.js.map +0 -1
- package/build-module/components/header/template-title/edit-template-title.js +0 -83
- package/build-module/components/header/template-title/edit-template-title.js.map +0 -1
- package/build-module/components/header/template-title/index.js +0 -105
- package/build-module/components/header/template-title/index.js.map +0 -1
- package/build-module/components/header/template-title/template-description.js +0 -45
- package/build-module/components/header/template-title/template-description.js.map +0 -1
- package/build-module/private-apis.js.map +0 -1
- package/src/components/header/template-title/delete-template.js +0 -106
- package/src/components/header/template-title/edit-template-title.js +0 -78
- package/src/components/header/template-title/index.js +0 -115
- package/src/components/header/template-title/style.scss +0 -94
- package/src/components/header/template-title/template-description.js +0 -42
- /package/src/{private-apis.js → lock-unlock.js} +0 -0
package/build/plugins/index.js
CHANGED
|
@@ -31,29 +31,26 @@ var _welcomeGuideMenuItem = _interopRequireDefault(require("./welcome-guide-menu
|
|
|
31
31
|
*/
|
|
32
32
|
(0, _plugins.registerPlugin)('edit-post', {
|
|
33
33
|
render() {
|
|
34
|
-
return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_toolsMoreMenuGroup.default, null,
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
/* translators: accessibility text */
|
|
55
|
-
(0, _i18n.__)('(opens in a new tab)'))));
|
|
56
|
-
}));
|
|
34
|
+
return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_toolsMoreMenuGroup.default, null, ({
|
|
35
|
+
onClose
|
|
36
|
+
}) => (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_components.MenuItem, {
|
|
37
|
+
role: "menuitem",
|
|
38
|
+
href: (0, _url.addQueryArgs)('edit.php', {
|
|
39
|
+
post_type: 'wp_block'
|
|
40
|
+
})
|
|
41
|
+
}, (0, _i18n.__)('Manage Patterns')), (0, _element.createElement)(_keyboardShortcutsHelpMenuItem.default, {
|
|
42
|
+
onSelect: onClose
|
|
43
|
+
}), (0, _element.createElement)(_welcomeGuideMenuItem.default, null), (0, _element.createElement)(_copyContentMenuItem.default, null), (0, _element.createElement)(_components.MenuItem, {
|
|
44
|
+
role: "menuitem",
|
|
45
|
+
icon: _icons.external,
|
|
46
|
+
href: (0, _i18n.__)('https://wordpress.org/documentation/article/wordpress-block-editor/'),
|
|
47
|
+
target: "_blank",
|
|
48
|
+
rel: "noopener noreferrer"
|
|
49
|
+
}, (0, _i18n.__)('Help'), (0, _element.createElement)(_components.VisuallyHidden, {
|
|
50
|
+
as: "span"
|
|
51
|
+
},
|
|
52
|
+
/* translators: accessibility text */
|
|
53
|
+
(0, _i18n.__)('(opens in a new tab)'))))));
|
|
57
54
|
}
|
|
58
55
|
|
|
59
56
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-post/src/plugins/index.js"],"names":["render","onClose","post_type","external"],"mappings":";;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AAfA;AACA;AACA;;AAOA;AACA;AACA;AAMA,6BAAgB,WAAhB,EAA6B;AAC5BA,EAAAA,MAAM,GAAG;AACR,WACC,qDACC,4BAAC,2BAAD,QACG
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-post/src/plugins/index.js"],"names":["render","onClose","post_type","external"],"mappings":";;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AAfA;AACA;AACA;;AAOA;AACA;AACA;AAMA,6BAAgB,WAAhB,EAA6B;AAC5BA,EAAAA,MAAM,GAAG;AACR,WACC,qDACC,4BAAC,2BAAD,QACG,CAAE;AAAEC,MAAAA;AAAF,KAAF,KACD,qDACC,4BAAC,oBAAD;AACC,MAAA,IAAI,EAAC,UADN;AAEC,MAAA,IAAI,EAAG,uBAAc,UAAd,EAA0B;AAChCC,QAAAA,SAAS,EAAE;AADqB,OAA1B;AAFR,OAMG,cAAI,iBAAJ,CANH,CADD,EASC,4BAAC,sCAAD;AACC,MAAA,QAAQ,EAAGD;AADZ,MATD,EAYC,4BAAC,6BAAD,OAZD,EAaC,4BAAC,4BAAD,OAbD,EAcC,4BAAC,oBAAD;AACC,MAAA,IAAI,EAAC,UADN;AAEC,MAAA,IAAI,EAAGE,eAFR;AAGC,MAAA,IAAI,EAAG,cACN,qEADM,CAHR;AAMC,MAAA,MAAM,EAAC,QANR;AAOC,MAAA,GAAG,EAAC;AAPL,OASG,cAAI,MAAJ,CATH,EAUC,4BAAC,0BAAD;AAAgB,MAAA,EAAE,EAAC;AAAnB;AAEE;AACA,kBAAI,sBAAJ,CAHF,CAVD,CAdD,CAFF,CADD,CADD;AAwCA;;AA1C2B,CAA7B","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { MenuItem, VisuallyHidden } from '@wordpress/components';\nimport { external } from '@wordpress/icons';\nimport { __ } from '@wordpress/i18n';\nimport { registerPlugin } from '@wordpress/plugins';\nimport { addQueryArgs } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport CopyContentMenuItem from './copy-content-menu-item';\nimport KeyboardShortcutsHelpMenuItem from './keyboard-shortcuts-help-menu-item';\nimport ToolsMoreMenuGroup from '../components/header/tools-more-menu-group';\nimport WelcomeGuideMenuItem from './welcome-guide-menu-item';\n\nregisterPlugin( 'edit-post', {\n\trender() {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<ToolsMoreMenuGroup>\n\t\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\trole=\"menuitem\"\n\t\t\t\t\t\t\t\thref={ addQueryArgs( 'edit.php', {\n\t\t\t\t\t\t\t\t\tpost_type: 'wp_block',\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\t{ __( 'Manage Patterns' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t<KeyboardShortcutsHelpMenuItem\n\t\t\t\t\t\t\t\tonSelect={ onClose }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<WelcomeGuideMenuItem />\n\t\t\t\t\t\t\t<CopyContentMenuItem />\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\trole=\"menuitem\"\n\t\t\t\t\t\t\t\ticon={ external }\n\t\t\t\t\t\t\t\thref={ __(\n\t\t\t\t\t\t\t\t\t'https://wordpress.org/documentation/article/wordpress-block-editor/'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\trel=\"noopener noreferrer\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Help' ) }\n\t\t\t\t\t\t\t\t<VisuallyHidden as=\"span\">\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t/* translators: accessibility text */\n\t\t\t\t\t\t\t\t\t\t__( '(opens in a new tab)' )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\t\t\t\t</ToolsMoreMenuGroup>\n\t\t\t</>\n\t\t);\n\t},\n} );\n"]}
|
|
@@ -25,10 +25,9 @@ var _store = require("../../store");
|
|
|
25
25
|
/**
|
|
26
26
|
* Internal dependencies
|
|
27
27
|
*/
|
|
28
|
-
function KeyboardShortcutsHelpMenuItem(
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
} = _ref;
|
|
28
|
+
function KeyboardShortcutsHelpMenuItem({
|
|
29
|
+
openModal
|
|
30
|
+
}) {
|
|
32
31
|
return (0, _element.createElement)(_components.MenuItem, {
|
|
33
32
|
onClick: () => {
|
|
34
33
|
openModal('edit-post/keyboard-shortcut-help');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-post/src/plugins/keyboard-shortcuts-help-menu-item/index.js"],"names":["KeyboardShortcutsHelpMenuItem","openModal","displayShortcut","access","dispatch","editPostStore"],"mappings":";;;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AAKA;;AAXA;AACA;AACA;;AAMA;AACA;AACA;AAGO,SAASA,6BAAT,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-post/src/plugins/keyboard-shortcuts-help-menu-item/index.js"],"names":["KeyboardShortcutsHelpMenuItem","openModal","displayShortcut","access","dispatch","editPostStore"],"mappings":";;;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AAKA;;AAXA;AACA;AACA;;AAMA;AACA;AACA;AAGO,SAASA,6BAAT,CAAwC;AAAEC,EAAAA;AAAF,CAAxC,EAAwD;AAC9D,SACC,4BAAC,oBAAD;AACC,IAAA,OAAO,EAAG,MAAM;AACfA,MAAAA,SAAS,CAAE,kCAAF,CAAT;AACA,KAHF;AAIC,IAAA,QAAQ,EAAGC,0BAAgBC,MAAhB,CAAwB,GAAxB;AAJZ,KAMG,cAAI,oBAAJ,CANH,CADD;AAUA;;eAEc,wBAAgBC,QAAF,IAAgB;AAC5C,QAAM;AAAEH,IAAAA;AAAF,MAAgBG,QAAQ,CAAEC,YAAF,CAA9B;AAEA,SAAO;AACNJ,IAAAA;AADM,GAAP;AAGA,CANc,EAMVD,6BANU,C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { MenuItem } from '@wordpress/components';\nimport { withDispatch } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { displayShortcut } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../store';\n\nexport function KeyboardShortcutsHelpMenuItem( { openModal } ) {\n\treturn (\n\t\t<MenuItem\n\t\t\tonClick={ () => {\n\t\t\t\topenModal( 'edit-post/keyboard-shortcut-help' );\n\t\t\t} }\n\t\t\tshortcut={ displayShortcut.access( 'h' ) }\n\t\t>\n\t\t\t{ __( 'Keyboard shortcuts' ) }\n\t\t</MenuItem>\n\t);\n}\n\nexport default withDispatch( ( dispatch ) => {\n\tconst { openModal } = dispatch( editPostStore );\n\n\treturn {\n\t\topenModal,\n\t};\n} )( KeyboardShortcutsHelpMenuItem );\n"]}
|
package/build/store/actions.js
CHANGED
|
@@ -60,12 +60,9 @@ var _ = require(".");
|
|
|
60
60
|
*
|
|
61
61
|
* @param {?string} name Sidebar name to be opened.
|
|
62
62
|
*/
|
|
63
|
-
const openGeneralSidebar = name =>
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
} = _ref;
|
|
67
|
-
return registry.dispatch(_interface.store).enableComplementaryArea(_.store.name, name);
|
|
68
|
-
};
|
|
63
|
+
const openGeneralSidebar = name => ({
|
|
64
|
+
registry
|
|
65
|
+
}) => registry.dispatch(_interface.store).enableComplementaryArea(_.store.name, name);
|
|
69
66
|
/**
|
|
70
67
|
* Returns an action object signalling that the user closed the sidebar.
|
|
71
68
|
*/
|
|
@@ -73,12 +70,9 @@ const openGeneralSidebar = name => _ref => {
|
|
|
73
70
|
|
|
74
71
|
exports.openGeneralSidebar = openGeneralSidebar;
|
|
75
72
|
|
|
76
|
-
const closeGeneralSidebar = () =>
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
} = _ref2;
|
|
80
|
-
return registry.dispatch(_interface.store).disableComplementaryArea(_.store.name);
|
|
81
|
-
};
|
|
73
|
+
const closeGeneralSidebar = () => ({
|
|
74
|
+
registry
|
|
75
|
+
}) => registry.dispatch(_interface.store).disableComplementaryArea(_.store.name);
|
|
82
76
|
/**
|
|
83
77
|
* Returns an action object used in signalling that the user opened a modal.
|
|
84
78
|
*
|
|
@@ -155,14 +149,13 @@ function togglePublishSidebar() {
|
|
|
155
149
|
*/
|
|
156
150
|
|
|
157
151
|
|
|
158
|
-
const toggleEditorPanelEnabled = panelName =>
|
|
152
|
+
const toggleEditorPanelEnabled = panelName => ({
|
|
153
|
+
registry
|
|
154
|
+
}) => {
|
|
159
155
|
var _registry$select$get;
|
|
160
156
|
|
|
161
|
-
let {
|
|
162
|
-
registry
|
|
163
|
-
} = _ref3;
|
|
164
157
|
const inactivePanels = (_registry$select$get = registry.select(_preferences.store).get('core/edit-post', 'inactivePanels')) !== null && _registry$select$get !== void 0 ? _registry$select$get : [];
|
|
165
|
-
const isPanelInactive = !!
|
|
158
|
+
const isPanelInactive = !!inactivePanels?.includes(panelName); // If the panel is inactive, remove it to enable it, else add it to
|
|
166
159
|
// make it inactive.
|
|
167
160
|
|
|
168
161
|
let updatedInactivePanels;
|
|
@@ -184,14 +177,13 @@ const toggleEditorPanelEnabled = panelName => _ref3 => {
|
|
|
184
177
|
|
|
185
178
|
exports.toggleEditorPanelEnabled = toggleEditorPanelEnabled;
|
|
186
179
|
|
|
187
|
-
const toggleEditorPanelOpened = panelName =>
|
|
180
|
+
const toggleEditorPanelOpened = panelName => ({
|
|
181
|
+
registry
|
|
182
|
+
}) => {
|
|
188
183
|
var _registry$select$get2;
|
|
189
184
|
|
|
190
|
-
let {
|
|
191
|
-
registry
|
|
192
|
-
} = _ref4;
|
|
193
185
|
const openPanels = (_registry$select$get2 = registry.select(_preferences.store).get('core/edit-post', 'openPanels')) !== null && _registry$select$get2 !== void 0 ? _registry$select$get2 : [];
|
|
194
|
-
const isPanelOpen = !!
|
|
186
|
+
const isPanelOpen = !!openPanels?.includes(panelName); // If the panel is open, remove it to close it, else add it to
|
|
195
187
|
// make it open.
|
|
196
188
|
|
|
197
189
|
let updatedOpenPanels;
|
|
@@ -228,12 +220,9 @@ function removeEditorPanel(panelName) {
|
|
|
228
220
|
*/
|
|
229
221
|
|
|
230
222
|
|
|
231
|
-
const toggleFeature = feature =>
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
} = _ref5;
|
|
235
|
-
return registry.dispatch(_preferences.store).toggle('core/edit-post', feature);
|
|
236
|
-
};
|
|
223
|
+
const toggleFeature = feature => ({
|
|
224
|
+
registry
|
|
225
|
+
}) => registry.dispatch(_preferences.store).toggle('core/edit-post', feature);
|
|
237
226
|
/**
|
|
238
227
|
* Triggers an action used to switch editor mode.
|
|
239
228
|
*
|
|
@@ -243,10 +232,9 @@ const toggleFeature = feature => _ref5 => {
|
|
|
243
232
|
|
|
244
233
|
exports.toggleFeature = toggleFeature;
|
|
245
234
|
|
|
246
|
-
const switchEditorMode = mode =>
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
} = _ref6;
|
|
235
|
+
const switchEditorMode = mode => ({
|
|
236
|
+
registry
|
|
237
|
+
}) => {
|
|
250
238
|
registry.dispatch(_preferences.store).set('core/edit-post', 'editorMode', mode); // Unselect blocks when we switch to the code editor.
|
|
251
239
|
|
|
252
240
|
if (mode !== 'visual') {
|
|
@@ -265,10 +253,9 @@ const switchEditorMode = mode => _ref6 => {
|
|
|
265
253
|
|
|
266
254
|
exports.switchEditorMode = switchEditorMode;
|
|
267
255
|
|
|
268
|
-
const togglePinnedPluginItem = pluginName =>
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
} = _ref7;
|
|
256
|
+
const togglePinnedPluginItem = pluginName => ({
|
|
257
|
+
registry
|
|
258
|
+
}) => {
|
|
272
259
|
const isPinned = registry.select(_interface.store).isItemPinned('core/edit-post', pluginName);
|
|
273
260
|
registry.dispatch(_interface.store)[isPinned ? 'unpinItem' : 'pinItem']('core/edit-post', pluginName);
|
|
274
261
|
};
|
|
@@ -282,13 +269,11 @@ const togglePinnedPluginItem = pluginName => _ref7 => {
|
|
|
282
269
|
|
|
283
270
|
exports.togglePinnedPluginItem = togglePinnedPluginItem;
|
|
284
271
|
|
|
285
|
-
const updatePreferredStyleVariations = (blockName, blockStyle) =>
|
|
272
|
+
const updatePreferredStyleVariations = (blockName, blockStyle) => ({
|
|
273
|
+
registry
|
|
274
|
+
}) => {
|
|
286
275
|
var _registry$select$get3;
|
|
287
276
|
|
|
288
|
-
let {
|
|
289
|
-
registry
|
|
290
|
-
} = _ref8;
|
|
291
|
-
|
|
292
277
|
if (!blockName) {
|
|
293
278
|
return;
|
|
294
279
|
}
|
|
@@ -316,12 +301,11 @@ const updatePreferredStyleVariations = (blockName, blockStyle) => _ref8 => {
|
|
|
316
301
|
|
|
317
302
|
exports.updatePreferredStyleVariations = updatePreferredStyleVariations;
|
|
318
303
|
|
|
319
|
-
const showBlockTypes = blockNames =>
|
|
304
|
+
const showBlockTypes = blockNames => ({
|
|
305
|
+
registry
|
|
306
|
+
}) => {
|
|
320
307
|
var _registry$select$get4;
|
|
321
308
|
|
|
322
|
-
let {
|
|
323
|
-
registry
|
|
324
|
-
} = _ref9;
|
|
325
309
|
const existingBlockNames = (_registry$select$get4 = registry.select(_preferences.store).get('core/edit-post', 'hiddenBlockTypes')) !== null && _registry$select$get4 !== void 0 ? _registry$select$get4 : [];
|
|
326
310
|
const newBlockNames = existingBlockNames.filter(type => !(Array.isArray(blockNames) ? blockNames : [blockNames]).includes(type));
|
|
327
311
|
registry.dispatch(_preferences.store).set('core/edit-post', 'hiddenBlockTypes', newBlockNames);
|
|
@@ -335,12 +319,11 @@ const showBlockTypes = blockNames => _ref9 => {
|
|
|
335
319
|
|
|
336
320
|
exports.showBlockTypes = showBlockTypes;
|
|
337
321
|
|
|
338
|
-
const hideBlockTypes = blockNames =>
|
|
322
|
+
const hideBlockTypes = blockNames => ({
|
|
323
|
+
registry
|
|
324
|
+
}) => {
|
|
339
325
|
var _registry$select$get5;
|
|
340
326
|
|
|
341
|
-
let {
|
|
342
|
-
registry
|
|
343
|
-
} = _ref10;
|
|
344
327
|
const existingBlockNames = (_registry$select$get5 = registry.select(_preferences.store).get('core/edit-post', 'hiddenBlockTypes')) !== null && _registry$select$get5 !== void 0 ? _registry$select$get5 : [];
|
|
345
328
|
const mergedBlockNames = new Set([...existingBlockNames, ...(Array.isArray(blockNames) ? blockNames : [blockNames])]);
|
|
346
329
|
registry.dispatch(_preferences.store).set('core/edit-post', 'hiddenBlockTypes', [...mergedBlockNames]);
|
|
@@ -365,12 +348,11 @@ function setAvailableMetaBoxesPerLocation(metaBoxesPerLocation) {
|
|
|
365
348
|
*/
|
|
366
349
|
|
|
367
350
|
|
|
368
|
-
const requestMetaBoxUpdates = () => async
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
} = _ref11;
|
|
351
|
+
const requestMetaBoxUpdates = () => async ({
|
|
352
|
+
registry,
|
|
353
|
+
select,
|
|
354
|
+
dispatch
|
|
355
|
+
}) => {
|
|
374
356
|
dispatch({
|
|
375
357
|
type: 'REQUEST_META_BOX_UPDATES'
|
|
376
358
|
}); // Saves the wp_editor fields.
|
|
@@ -395,10 +377,7 @@ const requestMetaBoxUpdates = () => async _ref11 => {
|
|
|
395
377
|
|
|
396
378
|
return memo;
|
|
397
379
|
}, new window.FormData());
|
|
398
|
-
additionalData.forEach(
|
|
399
|
-
let [key, value] = _ref12;
|
|
400
|
-
return formData.append(key, value);
|
|
401
|
-
});
|
|
380
|
+
additionalData.forEach(([key, value]) => formData.append(key, value));
|
|
402
381
|
|
|
403
382
|
try {
|
|
404
383
|
// Save the metaboxes.
|
|
@@ -509,24 +488,20 @@ function setIsEditingTemplate(value) {
|
|
|
509
488
|
*/
|
|
510
489
|
|
|
511
490
|
|
|
512
|
-
const __unstableSwitchToTemplateMode =
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
const
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
type: 'snackbar'
|
|
527
|
-
});
|
|
528
|
-
}
|
|
529
|
-
};
|
|
491
|
+
const __unstableSwitchToTemplateMode = (newTemplate = false) => ({
|
|
492
|
+
registry,
|
|
493
|
+
select,
|
|
494
|
+
dispatch
|
|
495
|
+
}) => {
|
|
496
|
+
dispatch(setIsEditingTemplate(true));
|
|
497
|
+
const isWelcomeGuideActive = select.isFeatureActive('welcomeGuideTemplate');
|
|
498
|
+
|
|
499
|
+
if (!isWelcomeGuideActive) {
|
|
500
|
+
const message = newTemplate ? (0, _i18n.__)("Custom template created. You're in template mode now.") : (0, _i18n.__)('Editing template. Changes made here affect all posts and pages that use the template.');
|
|
501
|
+
registry.dispatch(_notices.store).createSuccessNotice(message, {
|
|
502
|
+
type: 'snackbar'
|
|
503
|
+
});
|
|
504
|
+
}
|
|
530
505
|
};
|
|
531
506
|
/**
|
|
532
507
|
* Create a block based template.
|
|
@@ -537,10 +512,9 @@ const __unstableSwitchToTemplateMode = function () {
|
|
|
537
512
|
|
|
538
513
|
exports.__unstableSwitchToTemplateMode = __unstableSwitchToTemplateMode;
|
|
539
514
|
|
|
540
|
-
const __unstableCreateTemplate = template => async
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
} = _ref14;
|
|
515
|
+
const __unstableCreateTemplate = template => async ({
|
|
516
|
+
registry
|
|
517
|
+
}) => {
|
|
544
518
|
const savedTemplate = await registry.dispatch(_coreData.store).saveEntityRecord('postType', 'wp_template', template);
|
|
545
519
|
const post = registry.select(_editor.store).getCurrentPost();
|
|
546
520
|
registry.dispatch(_coreData.store).editEntityRecord('postType', post.type, post.id, {
|
|
@@ -554,13 +528,11 @@ let metaBoxesInitialized = false;
|
|
|
554
528
|
* Initializes WordPress `postboxes` script and the logic for saving meta boxes.
|
|
555
529
|
*/
|
|
556
530
|
|
|
557
|
-
const initializeMetaBoxes = () =>
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
} = _ref15;
|
|
563
|
-
|
|
531
|
+
const initializeMetaBoxes = () => ({
|
|
532
|
+
registry,
|
|
533
|
+
select,
|
|
534
|
+
dispatch
|
|
535
|
+
}) => {
|
|
564
536
|
const isEditorReady = registry.select(_editor.store).__unstableIsEditorReady();
|
|
565
537
|
|
|
566
538
|
if (!isEditorReady) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-post/src/store/actions.js"],"names":["openGeneralSidebar","name","registry","dispatch","interfaceStore","enableComplementaryArea","editPostStore","closeGeneralSidebar","disableComplementaryArea","openModal","type","closeModal","openPublishSidebar","closePublishSidebar","togglePublishSidebar","toggleEditorPanelEnabled","panelName","inactivePanels","select","preferencesStore","get","isPanelInactive","includes","updatedInactivePanels","filter","invactivePanelName","set","toggleEditorPanelOpened","openPanels","isPanelOpen","updatedOpenPanels","openPanelName","removeEditorPanel","toggleFeature","feature","toggle","switchEditorMode","mode","blockEditorStore","clearSelectedBlock","message","togglePinnedPluginItem","pluginName","isPinned","isItemPinned","updatePreferredStyleVariations","blockName","blockStyle","existingVariations","updatedVariations","showBlockTypes","blockNames","existingBlockNames","newBlockNames","Array","isArray","hideBlockTypes","mergedBlockNames","Set","setAvailableMetaBoxesPerLocation","metaBoxesPerLocation","requestMetaBoxUpdates","window","tinyMCE","triggerSave","post","editorStore","getCurrentPost","additionalData","comment_status","ping_status","sticky","author","Boolean","baseFormData","FormData","document","querySelector","activeMetaBoxLocations","getActiveMetaBoxLocations","formDataToMerge","map","location","formData","reduce","memo","currentFormData","key","value","append","forEach","url","_wpMetaBoxUrl","method","body","parse","metaBoxUpdatesSuccess","metaBoxUpdatesFailure","__experimentalSetPreviewDeviceType","deviceType","setIsInserterOpened","setIsListViewOpened","isOpen","setIsEditingTemplate","__unstableSwitchToTemplateMode","newTemplate","isWelcomeGuideActive","isFeatureActive","noticesStore","createSuccessNotice","__unstableCreateTemplate","template","savedTemplate","coreStore","saveEntityRecord","editEntityRecord","id","slug","metaBoxesInitialized","initializeMetaBoxes","isEditorReady","__unstableIsEditorReady","postType","getCurrentPostType","postboxes","page","add_postbox_toggles","wasSavingPost","isSavingPost","wasAutosavingPost","isAutosavingPost","subscribe","shouldTriggerMetaboxesSave","hasMetaBoxes"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AAjBA;AACA;AACA;;AAWA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACO,MAAMA,kBAAkB,GAC5BC,IAAF,IACA;AAAA,MAAE;AAAEC,IAAAA;AAAF,GAAF;AAAA,SACCA,QAAQ,CACNC,QADF,CACYC,gBADZ,EAEEC,uBAFF,CAE2BC,QAAcL,IAFzC,EAE+CA,IAF/C,CADD;AAAA,CAFM;AAOP;AACA;AACA;;;;;AACO,MAAMM,mBAAmB,GAC/B,MACA;AAAA,MAAE;AAAEL,IAAAA;AAAF,GAAF;AAAA,SACCA,QAAQ,CACNC,QADF,CACYC,gBADZ,EAEEI,wBAFF,CAE4BF,QAAcL,IAF1C,CADD;AAAA,CAFM;AAOP;AACA;AACA;AACA;AACA;AACA;AACA;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0C;AACzC5D,IAAAA,MAAM,CAAC8D,SAAP,CAAiBE,mBAAjB,CAAsCJ,QAAtC;AACA;;AAEDJ,EAAAA,oBAAoB,GAAG,IAAvB;AAEA,MAAIS,aAAa,GAAG7H,QAAQ,CAACgB,MAAT,CAAiBgD,aAAjB,EAA+B8D,YAA/B,EAApB;AACA,MAAIC,iBAAiB,GAAG/H,QAAQ,CAC9BgB,MADsB,CACdgD,aADc,EAEtBgE,gBAFsB,EAAxB,CApBqC,CAwBrC;;AACAhI,EAAAA,QAAQ,CAACiI,SAAT,CAAoB,YAAY;AAC/B,UAAMH,YAAY,GAAG9H,QAAQ,CAACgB,MAAT,CAAiBgD,aAAjB,EAA+B8D,YAA/B,EAArB;AACA,UAAME,gBAAgB,GAAGhI,QAAQ,CAC/BgB,MADuB,CACfgD,aADe,EAEvBgE,gBAFuB,EAAzB,CAF+B,CAM/B;;AACA,UAAME,0BAA0B,GAC/BL,aAAa,IACb,CAAEE,iBADF,IAEA,CAAED,YAFF,IAGA9G,MAAM,CAACmH,YAAP,EAJD,CAP+B,CAa/B;;AACAN,IAAAA,aAAa,GAAGC,YAAhB;AACAC,IAAAA,iBAAiB,GAAGC,gBAApB;;AAEA,QAAKE,0BAAL,EAAkC;AACjC,YAAMjI,QAAQ,CAAC0D,qBAAT,EAAN;AACA;AACD,GApBD;AAsBA1D,EAAAA,QAAQ,CAAE;AACTO,IAAAA,IAAI,EAAE;AADG,GAAF,CAAR;AAGA,CApDK","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport apiFetch from '@wordpress/api-fetch';\nimport { store as interfaceStore } from '@wordpress/interface';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { speak } from '@wordpress/a11y';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { getMetaBoxContainer } from '../utils/meta-boxes';\nimport { store as editPostStore } from '.';\n\n/**\n * Returns an action object used in signalling that the user opened an editor sidebar.\n *\n * @param {?string} name Sidebar name to be opened.\n */\nexport const openGeneralSidebar =\n\t( name ) =>\n\t( { registry } ) =>\n\t\tregistry\n\t\t\t.dispatch( interfaceStore )\n\t\t\t.enableComplementaryArea( editPostStore.name, name );\n\n/**\n * Returns an action object signalling that the user closed the sidebar.\n */\nexport const closeGeneralSidebar =\n\t() =>\n\t( { registry } ) =>\n\t\tregistry\n\t\t\t.dispatch( interfaceStore )\n\t\t\t.disableComplementaryArea( editPostStore.name );\n\n/**\n * Returns an action object used in signalling that the user opened a modal.\n *\n * @param {string} name A string that uniquely identifies the modal.\n *\n * @return {Object} Action object.\n */\nexport function openModal( name ) {\n\treturn {\n\t\ttype: 'OPEN_MODAL',\n\t\tname,\n\t};\n}\n\n/**\n * Returns an action object signalling that the user closed a modal.\n *\n * @return {Object} Action object.\n */\nexport function closeModal() {\n\treturn {\n\t\ttype: 'CLOSE_MODAL',\n\t};\n}\n\n/**\n * Returns an action object used in signalling that the user opened the publish\n * sidebar.\n *\n * @return {Object} Action object\n */\nexport function openPublishSidebar() {\n\treturn {\n\t\ttype: 'OPEN_PUBLISH_SIDEBAR',\n\t};\n}\n\n/**\n * Returns an action object used in signalling that the user closed the\n * publish sidebar.\n *\n * @return {Object} Action object.\n */\nexport function closePublishSidebar() {\n\treturn {\n\t\ttype: 'CLOSE_PUBLISH_SIDEBAR',\n\t};\n}\n\n/**\n * Returns an action object used in signalling that the user toggles the publish sidebar.\n *\n * @return {Object} Action object\n */\nexport function togglePublishSidebar() {\n\treturn {\n\t\ttype: 'TOGGLE_PUBLISH_SIDEBAR',\n\t};\n}\n\n/**\n * Returns an action object used to enable or disable a panel in the editor.\n *\n * @param {string} panelName A string that identifies the panel to enable or disable.\n *\n * @return {Object} Action object.\n */\nexport const toggleEditorPanelEnabled =\n\t( panelName ) =>\n\t( { registry } ) => {\n\t\tconst inactivePanels =\n\t\t\tregistry\n\t\t\t\t.select( preferencesStore )\n\t\t\t\t.get( 'core/edit-post', 'inactivePanels' ) ?? [];\n\n\t\tconst isPanelInactive = !! inactivePanels?.includes( panelName );\n\n\t\t// If the panel is inactive, remove it to enable it, else add it to\n\t\t// make it inactive.\n\t\tlet updatedInactivePanels;\n\t\tif ( isPanelInactive ) {\n\t\t\tupdatedInactivePanels = inactivePanels.filter(\n\t\t\t\t( invactivePanelName ) => invactivePanelName !== panelName\n\t\t\t);\n\t\t} else {\n\t\t\tupdatedInactivePanels = [ ...inactivePanels, panelName ];\n\t\t}\n\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.set( 'core/edit-post', 'inactivePanels', updatedInactivePanels );\n\t};\n\n/**\n * Opens a closed panel and closes an open panel.\n *\n * @param {string} panelName A string that identifies the panel to open or close.\n */\nexport const toggleEditorPanelOpened =\n\t( panelName ) =>\n\t( { registry } ) => {\n\t\tconst openPanels =\n\t\t\tregistry\n\t\t\t\t.select( preferencesStore )\n\t\t\t\t.get( 'core/edit-post', 'openPanels' ) ?? [];\n\n\t\tconst isPanelOpen = !! openPanels?.includes( panelName );\n\n\t\t// If the panel is open, remove it to close it, else add it to\n\t\t// make it open.\n\t\tlet updatedOpenPanels;\n\t\tif ( isPanelOpen ) {\n\t\t\tupdatedOpenPanels = openPanels.filter(\n\t\t\t\t( openPanelName ) => openPanelName !== panelName\n\t\t\t);\n\t\t} else {\n\t\t\tupdatedOpenPanels = [ ...openPanels, panelName ];\n\t\t}\n\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.set( 'core/edit-post', 'openPanels', updatedOpenPanels );\n\t};\n\n/**\n * Returns an action object used to remove a panel from the editor.\n *\n * @param {string} panelName A string that identifies the panel to remove.\n *\n * @return {Object} Action object.\n */\nexport function removeEditorPanel( panelName ) {\n\treturn {\n\t\ttype: 'REMOVE_PANEL',\n\t\tpanelName,\n\t};\n}\n\n/**\n * Triggers an action used to toggle a feature flag.\n *\n * @param {string} feature Feature name.\n */\nexport const toggleFeature =\n\t( feature ) =>\n\t( { registry } ) =>\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.toggle( 'core/edit-post', feature );\n\n/**\n * Triggers an action used to switch editor mode.\n *\n * @param {string} mode The editor mode.\n */\nexport const switchEditorMode =\n\t( mode ) =>\n\t( { registry } ) => {\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.set( 'core/edit-post', 'editorMode', mode );\n\n\t\t// Unselect blocks when we switch to the code editor.\n\t\tif ( mode !== 'visual' ) {\n\t\t\tregistry.dispatch( blockEditorStore ).clearSelectedBlock();\n\t\t}\n\n\t\tconst message =\n\t\t\tmode === 'visual'\n\t\t\t\t? __( 'Visual editor selected' )\n\t\t\t\t: __( 'Code editor selected' );\n\t\tspeak( message, 'assertive' );\n\t};\n\n/**\n * Triggers an action object used to toggle a plugin name flag.\n *\n * @param {string} pluginName Plugin name.\n */\nexport const togglePinnedPluginItem =\n\t( pluginName ) =>\n\t( { registry } ) => {\n\t\tconst isPinned = registry\n\t\t\t.select( interfaceStore )\n\t\t\t.isItemPinned( 'core/edit-post', pluginName );\n\n\t\tregistry\n\t\t\t.dispatch( interfaceStore )\n\t\t\t[ isPinned ? 'unpinItem' : 'pinItem' ](\n\t\t\t\t'core/edit-post',\n\t\t\t\tpluginName\n\t\t\t);\n\t};\n\n/**\n * Returns an action object used in signaling that a style should be auto-applied when a block is created.\n *\n * @param {string} blockName Name of the block.\n * @param {?string} blockStyle Name of the style that should be auto applied. If undefined, the \"auto apply\" setting of the block is removed.\n */\nexport const updatePreferredStyleVariations =\n\t( blockName, blockStyle ) =>\n\t( { registry } ) => {\n\t\tif ( ! blockName ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst existingVariations =\n\t\t\tregistry\n\t\t\t\t.select( preferencesStore )\n\t\t\t\t.get( 'core/edit-post', 'preferredStyleVariations' ) ?? {};\n\n\t\t// When the blockStyle is omitted, remove the block's preferred variation.\n\t\tif ( ! blockStyle ) {\n\t\t\tconst updatedVariations = {\n\t\t\t\t...existingVariations,\n\t\t\t};\n\n\t\t\tdelete updatedVariations[ blockName ];\n\n\t\t\tregistry\n\t\t\t\t.dispatch( preferencesStore )\n\t\t\t\t.set(\n\t\t\t\t\t'core/edit-post',\n\t\t\t\t\t'preferredStyleVariations',\n\t\t\t\t\tupdatedVariations\n\t\t\t\t);\n\t\t} else {\n\t\t\t// Else add the variation.\n\t\t\tregistry\n\t\t\t\t.dispatch( preferencesStore )\n\t\t\t\t.set( 'core/edit-post', 'preferredStyleVariations', {\n\t\t\t\t\t...existingVariations,\n\t\t\t\t\t[ blockName ]: blockStyle,\n\t\t\t\t} );\n\t\t}\n\t};\n\n/**\n * Update the provided block types to be visible.\n *\n * @param {string[]} blockNames Names of block types to show.\n */\nexport const showBlockTypes =\n\t( blockNames ) =>\n\t( { registry } ) => {\n\t\tconst existingBlockNames =\n\t\t\tregistry\n\t\t\t\t.select( preferencesStore )\n\t\t\t\t.get( 'core/edit-post', 'hiddenBlockTypes' ) ?? [];\n\n\t\tconst newBlockNames = existingBlockNames.filter(\n\t\t\t( type ) =>\n\t\t\t\t! (\n\t\t\t\t\tArray.isArray( blockNames ) ? blockNames : [ blockNames ]\n\t\t\t\t).includes( type )\n\t\t);\n\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.set( 'core/edit-post', 'hiddenBlockTypes', newBlockNames );\n\t};\n\n/**\n * Update the provided block types to be hidden.\n *\n * @param {string[]} blockNames Names of block types to hide.\n */\nexport const hideBlockTypes =\n\t( blockNames ) =>\n\t( { registry } ) => {\n\t\tconst existingBlockNames =\n\t\t\tregistry\n\t\t\t\t.select( preferencesStore )\n\t\t\t\t.get( 'core/edit-post', 'hiddenBlockTypes' ) ?? [];\n\n\t\tconst mergedBlockNames = new Set( [\n\t\t\t...existingBlockNames,\n\t\t\t...( Array.isArray( blockNames ) ? blockNames : [ blockNames ] ),\n\t\t] );\n\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.set( 'core/edit-post', 'hiddenBlockTypes', [\n\t\t\t\t...mergedBlockNames,\n\t\t\t] );\n\t};\n\n/**\n * Stores info about which Meta boxes are available in which location.\n *\n * @param {Object} metaBoxesPerLocation Meta boxes per location.\n */\nexport function setAvailableMetaBoxesPerLocation( metaBoxesPerLocation ) {\n\treturn {\n\t\ttype: 'SET_META_BOXES_PER_LOCATIONS',\n\t\tmetaBoxesPerLocation,\n\t};\n}\n\n/**\n * Update a metabox.\n */\nexport const requestMetaBoxUpdates =\n\t() =>\n\tasync ( { registry, select, dispatch } ) => {\n\t\tdispatch( {\n\t\t\ttype: 'REQUEST_META_BOX_UPDATES',\n\t\t} );\n\n\t\t// Saves the wp_editor fields.\n\t\tif ( window.tinyMCE ) {\n\t\t\twindow.tinyMCE.triggerSave();\n\t\t}\n\n\t\t// Additional data needed for backward compatibility.\n\t\t// If we do not provide this data, the post will be overridden with the default values.\n\t\tconst post = registry.select( editorStore ).getCurrentPost();\n\t\tconst additionalData = [\n\t\t\tpost.comment_status\n\t\t\t\t? [ 'comment_status', post.comment_status ]\n\t\t\t\t: false,\n\t\t\tpost.ping_status ? [ 'ping_status', post.ping_status ] : false,\n\t\t\tpost.sticky ? [ 'sticky', post.sticky ] : false,\n\t\t\tpost.author ? [ 'post_author', post.author ] : false,\n\t\t].filter( Boolean );\n\n\t\t// We gather all the metaboxes locations data and the base form data.\n\t\tconst baseFormData = new window.FormData(\n\t\t\tdocument.querySelector( '.metabox-base-form' )\n\t\t);\n\t\tconst activeMetaBoxLocations = select.getActiveMetaBoxLocations();\n\t\tconst formDataToMerge = [\n\t\t\tbaseFormData,\n\t\t\t...activeMetaBoxLocations.map(\n\t\t\t\t( location ) =>\n\t\t\t\t\tnew window.FormData( getMetaBoxContainer( location ) )\n\t\t\t),\n\t\t];\n\n\t\t// Merge all form data objects into a single one.\n\t\tconst formData = formDataToMerge.reduce( ( memo, currentFormData ) => {\n\t\t\tfor ( const [ key, value ] of currentFormData ) {\n\t\t\t\tmemo.append( key, value );\n\t\t\t}\n\t\t\treturn memo;\n\t\t}, new window.FormData() );\n\t\tadditionalData.forEach( ( [ key, value ] ) =>\n\t\t\tformData.append( key, value )\n\t\t);\n\n\t\ttry {\n\t\t\t// Save the metaboxes.\n\t\t\tawait apiFetch( {\n\t\t\t\turl: window._wpMetaBoxUrl,\n\t\t\t\tmethod: 'POST',\n\t\t\t\tbody: formData,\n\t\t\t\tparse: false,\n\t\t\t} );\n\t\t\tdispatch.metaBoxUpdatesSuccess();\n\t\t} catch {\n\t\t\tdispatch.metaBoxUpdatesFailure();\n\t\t}\n\t};\n\n/**\n * Returns an action object used to signal a successful meta box update.\n *\n * @return {Object} Action object.\n */\nexport function metaBoxUpdatesSuccess() {\n\treturn {\n\t\ttype: 'META_BOX_UPDATES_SUCCESS',\n\t};\n}\n\n/**\n * Returns an action object used to signal a failed meta box update.\n *\n * @return {Object} Action object.\n */\nexport function metaBoxUpdatesFailure() {\n\treturn {\n\t\ttype: 'META_BOX_UPDATES_FAILURE',\n\t};\n}\n\n/**\n * Returns an action object used to toggle the width of the editing canvas.\n *\n * @param {string} deviceType\n *\n * @return {Object} Action object.\n */\nexport function __experimentalSetPreviewDeviceType( deviceType ) {\n\treturn {\n\t\ttype: 'SET_PREVIEW_DEVICE_TYPE',\n\t\tdeviceType,\n\t};\n}\n\n/**\n * Returns an action object used to open/close the inserter.\n *\n * @param {boolean|Object} value Whether the inserter should be\n * opened (true) or closed (false).\n * To specify an insertion point,\n * use an object.\n * @param {string} value.rootClientId The root client ID to insert at.\n * @param {number} value.insertionIndex The index to insert at.\n *\n * @return {Object} Action object.\n */\nexport function setIsInserterOpened( value ) {\n\treturn {\n\t\ttype: 'SET_IS_INSERTER_OPENED',\n\t\tvalue,\n\t};\n}\n\n/**\n * Returns an action object used to open/close the list view.\n *\n * @param {boolean} isOpen A boolean representing whether the list view should be opened or closed.\n * @return {Object} Action object.\n */\nexport function setIsListViewOpened( isOpen ) {\n\treturn {\n\t\ttype: 'SET_IS_LIST_VIEW_OPENED',\n\t\tisOpen,\n\t};\n}\n\n/**\n * Returns an action object used to switch to template editing.\n *\n * @param {boolean} value Is editing template.\n * @return {Object} Action object.\n */\nexport function setIsEditingTemplate( value ) {\n\treturn {\n\t\ttype: 'SET_IS_EDITING_TEMPLATE',\n\t\tvalue,\n\t};\n}\n\n/**\n * Switches to the template mode.\n *\n * @param {boolean} newTemplate Is new template.\n */\nexport const __unstableSwitchToTemplateMode =\n\t( newTemplate = false ) =>\n\t( { registry, select, dispatch } ) => {\n\t\tdispatch( setIsEditingTemplate( true ) );\n\t\tconst isWelcomeGuideActive = select.isFeatureActive(\n\t\t\t'welcomeGuideTemplate'\n\t\t);\n\t\tif ( ! isWelcomeGuideActive ) {\n\t\t\tconst message = newTemplate\n\t\t\t\t? __( \"Custom template created. You're in template mode now.\" )\n\t\t\t\t: __(\n\t\t\t\t\t\t'Editing template. Changes made here affect all posts and pages that use the template.'\n\t\t\t\t );\n\t\t\tregistry.dispatch( noticesStore ).createSuccessNotice( message, {\n\t\t\t\ttype: 'snackbar',\n\t\t\t} );\n\t\t}\n\t};\n\n/**\n * Create a block based template.\n *\n * @param {Object?} template Template to create and assign.\n */\nexport const __unstableCreateTemplate =\n\t( template ) =>\n\tasync ( { registry } ) => {\n\t\tconst savedTemplate = await registry\n\t\t\t.dispatch( coreStore )\n\t\t\t.saveEntityRecord( 'postType', 'wp_template', template );\n\t\tconst post = registry.select( editorStore ).getCurrentPost();\n\t\tregistry\n\t\t\t.dispatch( coreStore )\n\t\t\t.editEntityRecord( 'postType', post.type, post.id, {\n\t\t\t\ttemplate: savedTemplate.slug,\n\t\t\t} );\n\t};\n\nlet metaBoxesInitialized = false;\n\n/**\n * Initializes WordPress `postboxes` script and the logic for saving meta boxes.\n */\nexport const initializeMetaBoxes =\n\t() =>\n\t( { registry, select, dispatch } ) => {\n\t\tconst isEditorReady = registry\n\t\t\t.select( editorStore )\n\t\t\t.__unstableIsEditorReady();\n\n\t\tif ( ! isEditorReady ) {\n\t\t\treturn;\n\t\t}\n\t\t// Only initialize once.\n\t\tif ( metaBoxesInitialized ) {\n\t\t\treturn;\n\t\t}\n\t\tconst postType = registry.select( editorStore ).getCurrentPostType();\n\t\tif ( window.postboxes.page !== postType ) {\n\t\t\twindow.postboxes.add_postbox_toggles( postType );\n\t\t}\n\n\t\tmetaBoxesInitialized = true;\n\n\t\tlet wasSavingPost = registry.select( editorStore ).isSavingPost();\n\t\tlet wasAutosavingPost = registry\n\t\t\t.select( editorStore )\n\t\t\t.isAutosavingPost();\n\n\t\t// Save metaboxes when performing a full save on the post.\n\t\tregistry.subscribe( async () => {\n\t\t\tconst isSavingPost = registry.select( editorStore ).isSavingPost();\n\t\t\tconst isAutosavingPost = registry\n\t\t\t\t.select( editorStore )\n\t\t\t\t.isAutosavingPost();\n\n\t\t\t// Save metaboxes on save completion, except for autosaves.\n\t\t\tconst shouldTriggerMetaboxesSave =\n\t\t\t\twasSavingPost &&\n\t\t\t\t! wasAutosavingPost &&\n\t\t\t\t! isSavingPost &&\n\t\t\t\tselect.hasMetaBoxes();\n\n\t\t\t// Save current state for next inspection.\n\t\t\twasSavingPost = isSavingPost;\n\t\t\twasAutosavingPost = isAutosavingPost;\n\n\t\t\tif ( shouldTriggerMetaboxesSave ) {\n\t\t\t\tawait dispatch.requestMetaBoxUpdates();\n\t\t\t}\n\t\t} );\n\n\t\tdispatch( {\n\t\t\ttype: 'META_BOXES_INITIALIZED',\n\t\t} );\n\t};\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-post/src/store/actions.js"],"names":["openGeneralSidebar","name","registry","dispatch","interfaceStore","enableComplementaryArea","editPostStore","closeGeneralSidebar","disableComplementaryArea","openModal","type","closeModal","openPublishSidebar","closePublishSidebar","togglePublishSidebar","toggleEditorPanelEnabled","panelName","inactivePanels","select","preferencesStore","get","isPanelInactive","includes","updatedInactivePanels","filter","invactivePanelName","set","toggleEditorPanelOpened","openPanels","isPanelOpen","updatedOpenPanels","openPanelName","removeEditorPanel","toggleFeature","feature","toggle","switchEditorMode","mode","blockEditorStore","clearSelectedBlock","message","togglePinnedPluginItem","pluginName","isPinned","isItemPinned","updatePreferredStyleVariations","blockName","blockStyle","existingVariations","updatedVariations","showBlockTypes","blockNames","existingBlockNames","newBlockNames","Array","isArray","hideBlockTypes","mergedBlockNames","Set","setAvailableMetaBoxesPerLocation","metaBoxesPerLocation","requestMetaBoxUpdates","window","tinyMCE","triggerSave","post","editorStore","getCurrentPost","additionalData","comment_status","ping_status","sticky","author","Boolean","baseFormData","FormData","document","querySelector","activeMetaBoxLocations","getActiveMetaBoxLocations","formDataToMerge","map","location","formData","reduce","memo","currentFormData","key","value","append","forEach","url","_wpMetaBoxUrl","method","body","parse","metaBoxUpdatesSuccess","metaBoxUpdatesFailure","__experimentalSetPreviewDeviceType","deviceType","setIsInserterOpened","setIsListViewOpened","isOpen","setIsEditingTemplate","__unstableSwitchToTemplateMode","newTemplate","isWelcomeGuideActive","isFeatureActive","noticesStore","createSuccessNotice","__unstableCreateTemplate","template","savedTemplate","coreStore","saveEntityRecord","editEntityRecord","id","slug","metaBoxesInitialized","initializeMetaBoxes","isEditorReady","__unstableIsEditorReady","postType","getCurrentPostType","postboxes","page","add_postbox_toggles","wasSavingPost","isSavingPost","wasAutosavingPost","isAutosavingPost","subscribe","shouldTriggerMetaboxesSave","hasMetaBoxes"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AAjBA;AACA;AACA;;AAWA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACO,MAAMA,kBAAkB,GAC5BC,IAAF,IACA,CAAE;AAAEC,EAAAA;AAAF,CAAF,KACCA,QAAQ,CACNC,QADF,CACYC,gBADZ,EAEEC,uBAFF,CAE2BC,QAAcL,IAFzC,EAE+CA,IAF/C,CAH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AAC8D,SAAP,CAAiBE,mBAAjB,CAAsCJ,QAAtC;AACA;;AAEDJ,EAAAA,oBAAoB,GAAG,IAAvB;AAEA,MAAIS,aAAa,GAAG7H,QAAQ,CAACgB,MAAT,CAAiBgD,aAAjB,EAA+B8D,YAA/B,EAApB;AACA,MAAIC,iBAAiB,GAAG/H,QAAQ,CAC9BgB,MADsB,CACdgD,aADc,EAEtBgE,gBAFsB,EAAxB,CApBqC,CAwBrC;;AACAhI,EAAAA,QAAQ,CAACiI,SAAT,CAAoB,YAAY;AAC/B,UAAMH,YAAY,GAAG9H,QAAQ,CAACgB,MAAT,CAAiBgD,aAAjB,EAA+B8D,YAA/B,EAArB;AACA,UAAME,gBAAgB,GAAGhI,QAAQ,CAC/BgB,MADuB,CACfgD,aADe,EAEvBgE,gBAFuB,EAAzB,CAF+B,CAM/B;;AACA,UAAME,0BAA0B,GAC/BL,aAAa,IACb,CAAEE,iBADF,IAEA,CAAED,YAFF,IAGA9G,MAAM,CAACmH,YAAP,EAJD,CAP+B,CAa/B;;AACAN,IAAAA,aAAa,GAAGC,YAAhB;AACAC,IAAAA,iBAAiB,GAAGC,gBAApB;;AAEA,QAAKE,0BAAL,EAAkC;AACjC,YAAMjI,QAAQ,CAAC0D,qBAAT,EAAN;AACA;AACD,GApBD;AAsBA1D,EAAAA,QAAQ,CAAE;AACTO,IAAAA,IAAI,EAAE;AADG,GAAF,CAAR;AAGA,CApDK","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport apiFetch from '@wordpress/api-fetch';\nimport { store as interfaceStore } from '@wordpress/interface';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { speak } from '@wordpress/a11y';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { getMetaBoxContainer } from '../utils/meta-boxes';\nimport { store as editPostStore } from '.';\n\n/**\n * Returns an action object used in signalling that the user opened an editor sidebar.\n *\n * @param {?string} name Sidebar name to be opened.\n */\nexport const openGeneralSidebar =\n\t( name ) =>\n\t( { registry } ) =>\n\t\tregistry\n\t\t\t.dispatch( interfaceStore )\n\t\t\t.enableComplementaryArea( editPostStore.name, name );\n\n/**\n * Returns an action object signalling that the user closed the sidebar.\n */\nexport const closeGeneralSidebar =\n\t() =>\n\t( { registry } ) =>\n\t\tregistry\n\t\t\t.dispatch( interfaceStore )\n\t\t\t.disableComplementaryArea( editPostStore.name );\n\n/**\n * Returns an action object used in signalling that the user opened a modal.\n *\n * @param {string} name A string that uniquely identifies the modal.\n *\n * @return {Object} Action object.\n */\nexport function openModal( name ) {\n\treturn {\n\t\ttype: 'OPEN_MODAL',\n\t\tname,\n\t};\n}\n\n/**\n * Returns an action object signalling that the user closed a modal.\n *\n * @return {Object} Action object.\n */\nexport function closeModal() {\n\treturn {\n\t\ttype: 'CLOSE_MODAL',\n\t};\n}\n\n/**\n * Returns an action object used in signalling that the user opened the publish\n * sidebar.\n *\n * @return {Object} Action object\n */\nexport function openPublishSidebar() {\n\treturn {\n\t\ttype: 'OPEN_PUBLISH_SIDEBAR',\n\t};\n}\n\n/**\n * Returns an action object used in signalling that the user closed the\n * publish sidebar.\n *\n * @return {Object} Action object.\n */\nexport function closePublishSidebar() {\n\treturn {\n\t\ttype: 'CLOSE_PUBLISH_SIDEBAR',\n\t};\n}\n\n/**\n * Returns an action object used in signalling that the user toggles the publish sidebar.\n *\n * @return {Object} Action object\n */\nexport function togglePublishSidebar() {\n\treturn {\n\t\ttype: 'TOGGLE_PUBLISH_SIDEBAR',\n\t};\n}\n\n/**\n * Returns an action object used to enable or disable a panel in the editor.\n *\n * @param {string} panelName A string that identifies the panel to enable or disable.\n *\n * @return {Object} Action object.\n */\nexport const toggleEditorPanelEnabled =\n\t( panelName ) =>\n\t( { registry } ) => {\n\t\tconst inactivePanels =\n\t\t\tregistry\n\t\t\t\t.select( preferencesStore )\n\t\t\t\t.get( 'core/edit-post', 'inactivePanels' ) ?? [];\n\n\t\tconst isPanelInactive = !! inactivePanels?.includes( panelName );\n\n\t\t// If the panel is inactive, remove it to enable it, else add it to\n\t\t// make it inactive.\n\t\tlet updatedInactivePanels;\n\t\tif ( isPanelInactive ) {\n\t\t\tupdatedInactivePanels = inactivePanels.filter(\n\t\t\t\t( invactivePanelName ) => invactivePanelName !== panelName\n\t\t\t);\n\t\t} else {\n\t\t\tupdatedInactivePanels = [ ...inactivePanels, panelName ];\n\t\t}\n\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.set( 'core/edit-post', 'inactivePanels', updatedInactivePanels );\n\t};\n\n/**\n * Opens a closed panel and closes an open panel.\n *\n * @param {string} panelName A string that identifies the panel to open or close.\n */\nexport const toggleEditorPanelOpened =\n\t( panelName ) =>\n\t( { registry } ) => {\n\t\tconst openPanels =\n\t\t\tregistry\n\t\t\t\t.select( preferencesStore )\n\t\t\t\t.get( 'core/edit-post', 'openPanels' ) ?? [];\n\n\t\tconst isPanelOpen = !! openPanels?.includes( panelName );\n\n\t\t// If the panel is open, remove it to close it, else add it to\n\t\t// make it open.\n\t\tlet updatedOpenPanels;\n\t\tif ( isPanelOpen ) {\n\t\t\tupdatedOpenPanels = openPanels.filter(\n\t\t\t\t( openPanelName ) => openPanelName !== panelName\n\t\t\t);\n\t\t} else {\n\t\t\tupdatedOpenPanels = [ ...openPanels, panelName ];\n\t\t}\n\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.set( 'core/edit-post', 'openPanels', updatedOpenPanels );\n\t};\n\n/**\n * Returns an action object used to remove a panel from the editor.\n *\n * @param {string} panelName A string that identifies the panel to remove.\n *\n * @return {Object} Action object.\n */\nexport function removeEditorPanel( panelName ) {\n\treturn {\n\t\ttype: 'REMOVE_PANEL',\n\t\tpanelName,\n\t};\n}\n\n/**\n * Triggers an action used to toggle a feature flag.\n *\n * @param {string} feature Feature name.\n */\nexport const toggleFeature =\n\t( feature ) =>\n\t( { registry } ) =>\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.toggle( 'core/edit-post', feature );\n\n/**\n * Triggers an action used to switch editor mode.\n *\n * @param {string} mode The editor mode.\n */\nexport const switchEditorMode =\n\t( mode ) =>\n\t( { registry } ) => {\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.set( 'core/edit-post', 'editorMode', mode );\n\n\t\t// Unselect blocks when we switch to the code editor.\n\t\tif ( mode !== 'visual' ) {\n\t\t\tregistry.dispatch( blockEditorStore ).clearSelectedBlock();\n\t\t}\n\n\t\tconst message =\n\t\t\tmode === 'visual'\n\t\t\t\t? __( 'Visual editor selected' )\n\t\t\t\t: __( 'Code editor selected' );\n\t\tspeak( message, 'assertive' );\n\t};\n\n/**\n * Triggers an action object used to toggle a plugin name flag.\n *\n * @param {string} pluginName Plugin name.\n */\nexport const togglePinnedPluginItem =\n\t( pluginName ) =>\n\t( { registry } ) => {\n\t\tconst isPinned = registry\n\t\t\t.select( interfaceStore )\n\t\t\t.isItemPinned( 'core/edit-post', pluginName );\n\n\t\tregistry\n\t\t\t.dispatch( interfaceStore )\n\t\t\t[ isPinned ? 'unpinItem' : 'pinItem' ](\n\t\t\t\t'core/edit-post',\n\t\t\t\tpluginName\n\t\t\t);\n\t};\n\n/**\n * Returns an action object used in signaling that a style should be auto-applied when a block is created.\n *\n * @param {string} blockName Name of the block.\n * @param {?string} blockStyle Name of the style that should be auto applied. If undefined, the \"auto apply\" setting of the block is removed.\n */\nexport const updatePreferredStyleVariations =\n\t( blockName, blockStyle ) =>\n\t( { registry } ) => {\n\t\tif ( ! blockName ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst existingVariations =\n\t\t\tregistry\n\t\t\t\t.select( preferencesStore )\n\t\t\t\t.get( 'core/edit-post', 'preferredStyleVariations' ) ?? {};\n\n\t\t// When the blockStyle is omitted, remove the block's preferred variation.\n\t\tif ( ! blockStyle ) {\n\t\t\tconst updatedVariations = {\n\t\t\t\t...existingVariations,\n\t\t\t};\n\n\t\t\tdelete updatedVariations[ blockName ];\n\n\t\t\tregistry\n\t\t\t\t.dispatch( preferencesStore )\n\t\t\t\t.set(\n\t\t\t\t\t'core/edit-post',\n\t\t\t\t\t'preferredStyleVariations',\n\t\t\t\t\tupdatedVariations\n\t\t\t\t);\n\t\t} else {\n\t\t\t// Else add the variation.\n\t\t\tregistry\n\t\t\t\t.dispatch( preferencesStore )\n\t\t\t\t.set( 'core/edit-post', 'preferredStyleVariations', {\n\t\t\t\t\t...existingVariations,\n\t\t\t\t\t[ blockName ]: blockStyle,\n\t\t\t\t} );\n\t\t}\n\t};\n\n/**\n * Update the provided block types to be visible.\n *\n * @param {string[]} blockNames Names of block types to show.\n */\nexport const showBlockTypes =\n\t( blockNames ) =>\n\t( { registry } ) => {\n\t\tconst existingBlockNames =\n\t\t\tregistry\n\t\t\t\t.select( preferencesStore )\n\t\t\t\t.get( 'core/edit-post', 'hiddenBlockTypes' ) ?? [];\n\n\t\tconst newBlockNames = existingBlockNames.filter(\n\t\t\t( type ) =>\n\t\t\t\t! (\n\t\t\t\t\tArray.isArray( blockNames ) ? blockNames : [ blockNames ]\n\t\t\t\t).includes( type )\n\t\t);\n\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.set( 'core/edit-post', 'hiddenBlockTypes', newBlockNames );\n\t};\n\n/**\n * Update the provided block types to be hidden.\n *\n * @param {string[]} blockNames Names of block types to hide.\n */\nexport const hideBlockTypes =\n\t( blockNames ) =>\n\t( { registry } ) => {\n\t\tconst existingBlockNames =\n\t\t\tregistry\n\t\t\t\t.select( preferencesStore )\n\t\t\t\t.get( 'core/edit-post', 'hiddenBlockTypes' ) ?? [];\n\n\t\tconst mergedBlockNames = new Set( [\n\t\t\t...existingBlockNames,\n\t\t\t...( Array.isArray( blockNames ) ? blockNames : [ blockNames ] ),\n\t\t] );\n\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.set( 'core/edit-post', 'hiddenBlockTypes', [\n\t\t\t\t...mergedBlockNames,\n\t\t\t] );\n\t};\n\n/**\n * Stores info about which Meta boxes are available in which location.\n *\n * @param {Object} metaBoxesPerLocation Meta boxes per location.\n */\nexport function setAvailableMetaBoxesPerLocation( metaBoxesPerLocation ) {\n\treturn {\n\t\ttype: 'SET_META_BOXES_PER_LOCATIONS',\n\t\tmetaBoxesPerLocation,\n\t};\n}\n\n/**\n * Update a metabox.\n */\nexport const requestMetaBoxUpdates =\n\t() =>\n\tasync ( { registry, select, dispatch } ) => {\n\t\tdispatch( {\n\t\t\ttype: 'REQUEST_META_BOX_UPDATES',\n\t\t} );\n\n\t\t// Saves the wp_editor fields.\n\t\tif ( window.tinyMCE ) {\n\t\t\twindow.tinyMCE.triggerSave();\n\t\t}\n\n\t\t// Additional data needed for backward compatibility.\n\t\t// If we do not provide this data, the post will be overridden with the default values.\n\t\tconst post = registry.select( editorStore ).getCurrentPost();\n\t\tconst additionalData = [\n\t\t\tpost.comment_status\n\t\t\t\t? [ 'comment_status', post.comment_status ]\n\t\t\t\t: false,\n\t\t\tpost.ping_status ? [ 'ping_status', post.ping_status ] : false,\n\t\t\tpost.sticky ? [ 'sticky', post.sticky ] : false,\n\t\t\tpost.author ? [ 'post_author', post.author ] : false,\n\t\t].filter( Boolean );\n\n\t\t// We gather all the metaboxes locations data and the base form data.\n\t\tconst baseFormData = new window.FormData(\n\t\t\tdocument.querySelector( '.metabox-base-form' )\n\t\t);\n\t\tconst activeMetaBoxLocations = select.getActiveMetaBoxLocations();\n\t\tconst formDataToMerge = [\n\t\t\tbaseFormData,\n\t\t\t...activeMetaBoxLocations.map(\n\t\t\t\t( location ) =>\n\t\t\t\t\tnew window.FormData( getMetaBoxContainer( location ) )\n\t\t\t),\n\t\t];\n\n\t\t// Merge all form data objects into a single one.\n\t\tconst formData = formDataToMerge.reduce( ( memo, currentFormData ) => {\n\t\t\tfor ( const [ key, value ] of currentFormData ) {\n\t\t\t\tmemo.append( key, value );\n\t\t\t}\n\t\t\treturn memo;\n\t\t}, new window.FormData() );\n\t\tadditionalData.forEach( ( [ key, value ] ) =>\n\t\t\tformData.append( key, value )\n\t\t);\n\n\t\ttry {\n\t\t\t// Save the metaboxes.\n\t\t\tawait apiFetch( {\n\t\t\t\turl: window._wpMetaBoxUrl,\n\t\t\t\tmethod: 'POST',\n\t\t\t\tbody: formData,\n\t\t\t\tparse: false,\n\t\t\t} );\n\t\t\tdispatch.metaBoxUpdatesSuccess();\n\t\t} catch {\n\t\t\tdispatch.metaBoxUpdatesFailure();\n\t\t}\n\t};\n\n/**\n * Returns an action object used to signal a successful meta box update.\n *\n * @return {Object} Action object.\n */\nexport function metaBoxUpdatesSuccess() {\n\treturn {\n\t\ttype: 'META_BOX_UPDATES_SUCCESS',\n\t};\n}\n\n/**\n * Returns an action object used to signal a failed meta box update.\n *\n * @return {Object} Action object.\n */\nexport function metaBoxUpdatesFailure() {\n\treturn {\n\t\ttype: 'META_BOX_UPDATES_FAILURE',\n\t};\n}\n\n/**\n * Returns an action object used to toggle the width of the editing canvas.\n *\n * @param {string} deviceType\n *\n * @return {Object} Action object.\n */\nexport function __experimentalSetPreviewDeviceType( deviceType ) {\n\treturn {\n\t\ttype: 'SET_PREVIEW_DEVICE_TYPE',\n\t\tdeviceType,\n\t};\n}\n\n/**\n * Returns an action object used to open/close the inserter.\n *\n * @param {boolean|Object} value Whether the inserter should be\n * opened (true) or closed (false).\n * To specify an insertion point,\n * use an object.\n * @param {string} value.rootClientId The root client ID to insert at.\n * @param {number} value.insertionIndex The index to insert at.\n *\n * @return {Object} Action object.\n */\nexport function setIsInserterOpened( value ) {\n\treturn {\n\t\ttype: 'SET_IS_INSERTER_OPENED',\n\t\tvalue,\n\t};\n}\n\n/**\n * Returns an action object used to open/close the list view.\n *\n * @param {boolean} isOpen A boolean representing whether the list view should be opened or closed.\n * @return {Object} Action object.\n */\nexport function setIsListViewOpened( isOpen ) {\n\treturn {\n\t\ttype: 'SET_IS_LIST_VIEW_OPENED',\n\t\tisOpen,\n\t};\n}\n\n/**\n * Returns an action object used to switch to template editing.\n *\n * @param {boolean} value Is editing template.\n * @return {Object} Action object.\n */\nexport function setIsEditingTemplate( value ) {\n\treturn {\n\t\ttype: 'SET_IS_EDITING_TEMPLATE',\n\t\tvalue,\n\t};\n}\n\n/**\n * Switches to the template mode.\n *\n * @param {boolean} newTemplate Is new template.\n */\nexport const __unstableSwitchToTemplateMode =\n\t( newTemplate = false ) =>\n\t( { registry, select, dispatch } ) => {\n\t\tdispatch( setIsEditingTemplate( true ) );\n\t\tconst isWelcomeGuideActive = select.isFeatureActive(\n\t\t\t'welcomeGuideTemplate'\n\t\t);\n\t\tif ( ! isWelcomeGuideActive ) {\n\t\t\tconst message = newTemplate\n\t\t\t\t? __( \"Custom template created. You're in template mode now.\" )\n\t\t\t\t: __(\n\t\t\t\t\t\t'Editing template. Changes made here affect all posts and pages that use the template.'\n\t\t\t\t );\n\t\t\tregistry.dispatch( noticesStore ).createSuccessNotice( message, {\n\t\t\t\ttype: 'snackbar',\n\t\t\t} );\n\t\t}\n\t};\n\n/**\n * Create a block based template.\n *\n * @param {Object?} template Template to create and assign.\n */\nexport const __unstableCreateTemplate =\n\t( template ) =>\n\tasync ( { registry } ) => {\n\t\tconst savedTemplate = await registry\n\t\t\t.dispatch( coreStore )\n\t\t\t.saveEntityRecord( 'postType', 'wp_template', template );\n\t\tconst post = registry.select( editorStore ).getCurrentPost();\n\t\tregistry\n\t\t\t.dispatch( coreStore )\n\t\t\t.editEntityRecord( 'postType', post.type, post.id, {\n\t\t\t\ttemplate: savedTemplate.slug,\n\t\t\t} );\n\t};\n\nlet metaBoxesInitialized = false;\n\n/**\n * Initializes WordPress `postboxes` script and the logic for saving meta boxes.\n */\nexport const initializeMetaBoxes =\n\t() =>\n\t( { registry, select, dispatch } ) => {\n\t\tconst isEditorReady = registry\n\t\t\t.select( editorStore )\n\t\t\t.__unstableIsEditorReady();\n\n\t\tif ( ! isEditorReady ) {\n\t\t\treturn;\n\t\t}\n\t\t// Only initialize once.\n\t\tif ( metaBoxesInitialized ) {\n\t\t\treturn;\n\t\t}\n\t\tconst postType = registry.select( editorStore ).getCurrentPostType();\n\t\tif ( window.postboxes.page !== postType ) {\n\t\t\twindow.postboxes.add_postbox_toggles( postType );\n\t\t}\n\n\t\tmetaBoxesInitialized = true;\n\n\t\tlet wasSavingPost = registry.select( editorStore ).isSavingPost();\n\t\tlet wasAutosavingPost = registry\n\t\t\t.select( editorStore )\n\t\t\t.isAutosavingPost();\n\n\t\t// Save metaboxes when performing a full save on the post.\n\t\tregistry.subscribe( async () => {\n\t\t\tconst isSavingPost = registry.select( editorStore ).isSavingPost();\n\t\t\tconst isAutosavingPost = registry\n\t\t\t\t.select( editorStore )\n\t\t\t\t.isAutosavingPost();\n\n\t\t\t// Save metaboxes on save completion, except for autosaves.\n\t\t\tconst shouldTriggerMetaboxesSave =\n\t\t\t\twasSavingPost &&\n\t\t\t\t! wasAutosavingPost &&\n\t\t\t\t! isSavingPost &&\n\t\t\t\tselect.hasMetaBoxes();\n\n\t\t\t// Save current state for next inspection.\n\t\t\twasSavingPost = isSavingPost;\n\t\t\twasAutosavingPost = isAutosavingPost;\n\n\t\t\tif ( shouldTriggerMetaboxesSave ) {\n\t\t\t\tawait dispatch.requestMetaBoxUpdates();\n\t\t\t}\n\t\t} );\n\n\t\tdispatch( {\n\t\t\ttype: 'META_BOXES_INITIALIZED',\n\t\t} );\n\t};\n"]}
|
package/build/store/reducer.js
CHANGED
|
@@ -27,10 +27,7 @@ var _data = require("@wordpress/data");
|
|
|
27
27
|
*
|
|
28
28
|
* @return {Array} Updated state.
|
|
29
29
|
*/
|
|
30
|
-
function removedPanels() {
|
|
31
|
-
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
32
|
-
let action = arguments.length > 1 ? arguments[1] : undefined;
|
|
33
|
-
|
|
30
|
+
function removedPanels(state = [], action) {
|
|
34
31
|
switch (action.type) {
|
|
35
32
|
case 'REMOVE_PANEL':
|
|
36
33
|
if (!state.includes(action.panelName)) {
|
|
@@ -51,10 +48,7 @@ function removedPanels() {
|
|
|
51
48
|
*/
|
|
52
49
|
|
|
53
50
|
|
|
54
|
-
function activeModal() {
|
|
55
|
-
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
|
56
|
-
let action = arguments.length > 1 ? arguments[1] : undefined;
|
|
57
|
-
|
|
51
|
+
function activeModal(state = null, action) {
|
|
58
52
|
switch (action.type) {
|
|
59
53
|
case 'OPEN_MODAL':
|
|
60
54
|
return action.name;
|
|
@@ -66,10 +60,7 @@ function activeModal() {
|
|
|
66
60
|
return state;
|
|
67
61
|
}
|
|
68
62
|
|
|
69
|
-
function publishSidebarActive() {
|
|
70
|
-
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
71
|
-
let action = arguments.length > 1 ? arguments[1] : undefined;
|
|
72
|
-
|
|
63
|
+
function publishSidebarActive(state = false, action) {
|
|
73
64
|
switch (action.type) {
|
|
74
65
|
case 'OPEN_PUBLISH_SIDEBAR':
|
|
75
66
|
return true;
|
|
@@ -95,10 +86,7 @@ function publishSidebarActive() {
|
|
|
95
86
|
*/
|
|
96
87
|
|
|
97
88
|
|
|
98
|
-
function isSavingMetaBoxes() {
|
|
99
|
-
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
100
|
-
let action = arguments.length > 1 ? arguments[1] : undefined;
|
|
101
|
-
|
|
89
|
+
function isSavingMetaBoxes(state = false, action) {
|
|
102
90
|
switch (action.type) {
|
|
103
91
|
case 'REQUEST_META_BOX_UPDATES':
|
|
104
92
|
return true;
|
|
@@ -112,9 +100,7 @@ function isSavingMetaBoxes() {
|
|
|
112
100
|
}
|
|
113
101
|
}
|
|
114
102
|
|
|
115
|
-
function mergeMetaboxes() {
|
|
116
|
-
let metaboxes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
117
|
-
let newMetaboxes = arguments.length > 1 ? arguments[1] : undefined;
|
|
103
|
+
function mergeMetaboxes(metaboxes = [], newMetaboxes) {
|
|
118
104
|
const mergedMetaboxes = [...metaboxes];
|
|
119
105
|
|
|
120
106
|
for (const metabox of newMetaboxes) {
|
|
@@ -139,10 +125,7 @@ function mergeMetaboxes() {
|
|
|
139
125
|
*/
|
|
140
126
|
|
|
141
127
|
|
|
142
|
-
function metaBoxLocations() {
|
|
143
|
-
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
144
|
-
let action = arguments.length > 1 ? arguments[1] : undefined;
|
|
145
|
-
|
|
128
|
+
function metaBoxLocations(state = {}, action) {
|
|
146
129
|
switch (action.type) {
|
|
147
130
|
case 'SET_META_BOXES_PER_LOCATIONS':
|
|
148
131
|
{
|
|
@@ -169,10 +152,7 @@ function metaBoxLocations() {
|
|
|
169
152
|
*/
|
|
170
153
|
|
|
171
154
|
|
|
172
|
-
function deviceType() {
|
|
173
|
-
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'Desktop';
|
|
174
|
-
let action = arguments.length > 1 ? arguments[1] : undefined;
|
|
175
|
-
|
|
155
|
+
function deviceType(state = 'Desktop', action) {
|
|
176
156
|
switch (action.type) {
|
|
177
157
|
case 'SET_PREVIEW_DEVICE_TYPE':
|
|
178
158
|
return action.deviceType;
|
|
@@ -191,10 +171,7 @@ function deviceType() {
|
|
|
191
171
|
*/
|
|
192
172
|
|
|
193
173
|
|
|
194
|
-
function blockInserterPanel() {
|
|
195
|
-
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
196
|
-
let action = arguments.length > 1 ? arguments[1] : undefined;
|
|
197
|
-
|
|
174
|
+
function blockInserterPanel(state = false, action) {
|
|
198
175
|
switch (action.type) {
|
|
199
176
|
case 'SET_IS_LIST_VIEW_OPENED':
|
|
200
177
|
return action.isOpen ? false : state;
|
|
@@ -216,10 +193,7 @@ function blockInserterPanel() {
|
|
|
216
193
|
*/
|
|
217
194
|
|
|
218
195
|
|
|
219
|
-
function listViewPanel() {
|
|
220
|
-
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
221
|
-
let action = arguments.length > 1 ? arguments[1] : undefined;
|
|
222
|
-
|
|
196
|
+
function listViewPanel(state = false, action) {
|
|
223
197
|
switch (action.type) {
|
|
224
198
|
case 'SET_IS_INSERTER_OPENED':
|
|
225
199
|
return action.value ? false : state;
|
|
@@ -238,10 +212,7 @@ function listViewPanel() {
|
|
|
238
212
|
*/
|
|
239
213
|
|
|
240
214
|
|
|
241
|
-
function isEditingTemplate() {
|
|
242
|
-
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
243
|
-
let action = arguments.length > 1 ? arguments[1] : undefined;
|
|
244
|
-
|
|
215
|
+
function isEditingTemplate(state = false, action) {
|
|
245
216
|
switch (action.type) {
|
|
246
217
|
case 'SET_IS_EDITING_TEMPLATE':
|
|
247
218
|
return action.value;
|
|
@@ -259,10 +230,7 @@ function isEditingTemplate() {
|
|
|
259
230
|
*/
|
|
260
231
|
|
|
261
232
|
|
|
262
|
-
function metaBoxesInitialized() {
|
|
263
|
-
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
264
|
-
let action = arguments.length > 1 ? arguments[1] : undefined;
|
|
265
|
-
|
|
233
|
+
function metaBoxesInitialized(state = false, action) {
|
|
266
234
|
switch (action.type) {
|
|
267
235
|
case 'META_BOXES_INITIALIZED':
|
|
268
236
|
return true;
|