@wordpress/edit-post 7.19.3 → 7.20.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 +22 -22
- package/build/components/block-manager/category.js +5 -4
- package/build/components/block-manager/category.js.map +1 -1
- package/build/components/block-manager/checklist.js +5 -5
- package/build/components/block-manager/checklist.js.map +1 -1
- package/build/components/block-manager/index.js +10 -9
- package/build/components/block-manager/index.js.map +1 -1
- package/build/components/block-settings-menu/plugin-block-settings-menu-item.js +5 -5
- package/build/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
- package/build/components/device-preview/index.js +5 -5
- package/build/components/device-preview/index.js.map +1 -1
- package/build/components/header/document-actions/index.js +9 -9
- package/build/components/header/document-actions/index.js.map +1 -1
- package/build/components/header/fullscreen-mode-close/index.js +6 -6
- package/build/components/header/fullscreen-mode-close/index.js.map +1 -1
- package/build/components/header/header-toolbar/index.js +9 -8
- package/build/components/header/header-toolbar/index.js.map +1 -1
- package/build/components/header/header-toolbar/index.native.js +12 -11
- package/build/components/header/header-toolbar/index.native.js.map +1 -1
- package/build/components/header/index.js +14 -14
- package/build/components/header/index.js.map +1 -1
- package/build/components/header/index.native.js +3 -2
- package/build/components/header/index.native.js.map +1 -1
- package/build/components/header/main-dashboard-button/index.js +2 -2
- package/build/components/header/main-dashboard-button/index.js.map +1 -1
- package/build/components/header/mode-switcher/index.js +3 -3
- package/build/components/header/mode-switcher/index.js.map +1 -1
- package/build/components/header/more-menu/index.js +6 -6
- package/build/components/header/more-menu/index.js.map +1 -1
- package/build/components/header/plugin-more-menu-item/index.js +3 -3
- package/build/components/header/plugin-more-menu-item/index.js.map +1 -1
- package/build/components/header/plugin-sidebar-more-menu-item/index.js +5 -5
- 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 -2
- package/build/components/header/post-publish-button-or-toggle.js.map +1 -1
- package/build/components/header/preferences-menu-item/index.js +2 -2
- package/build/components/header/preferences-menu-item/index.js.map +1 -1
- package/build/components/header/tools-more-menu-group/index.js +3 -3
- package/build/components/header/tools-more-menu-group/index.js.map +1 -1
- package/build/components/header/writing-menu/index.js +6 -6
- package/build/components/header/writing-menu/index.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +2 -2
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/index.js +15 -15
- package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/shortcut.js +8 -7
- package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
- package/build/components/layout/actions-panel.js +9 -8
- package/build/components/layout/actions-panel.js.map +1 -1
- package/build/components/layout/index.js +22 -21
- package/build/components/layout/index.js.map +1 -1
- package/build/components/layout/index.native.js +10 -9
- package/build/components/layout/index.native.js.map +1 -1
- package/build/components/meta-boxes/index.js +5 -4
- package/build/components/meta-boxes/index.js.map +1 -1
- package/build/components/meta-boxes/meta-boxes-area/index.js +6 -5
- package/build/components/meta-boxes/meta-boxes-area/index.js.map +1 -1
- package/build/components/preferences-modal/index.js +27 -26
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/preferences-modal/meta-boxes-section.js +4 -4
- package/build/components/preferences-modal/meta-boxes-section.js.map +1 -1
- package/build/components/preferences-modal/options/enable-custom-fields.js +5 -4
- package/build/components/preferences-modal/options/enable-custom-fields.js.map +1 -1
- package/build/components/preferences-modal/options/enable-plugin-document-setting-panel.js +2 -2
- package/build/components/preferences-modal/options/enable-plugin-document-setting-panel.js.map +1 -1
- package/build/components/secondary-sidebar/inserter-sidebar.js +7 -6
- package/build/components/secondary-sidebar/inserter-sidebar.js.map +1 -1
- package/build/components/secondary-sidebar/list-view-outline.js +18 -18
- package/build/components/secondary-sidebar/list-view-outline.js.map +1 -1
- package/build/components/secondary-sidebar/list-view-sidebar.js +9 -8
- package/build/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
- package/build/components/sidebar/discussion-panel/index.js +6 -6
- package/build/components/sidebar/discussion-panel/index.js.map +1 -1
- package/build/components/sidebar/featured-image/index.js +3 -3
- package/build/components/sidebar/featured-image/index.js.map +1 -1
- package/build/components/sidebar/last-revision/index.js +3 -3
- package/build/components/sidebar/last-revision/index.js.map +1 -1
- package/build/components/sidebar/page-attributes/index.js +3 -3
- package/build/components/sidebar/page-attributes/index.js.map +1 -1
- package/build/components/sidebar/plugin-document-setting-panel/index.js +6 -6
- package/build/components/sidebar/plugin-document-setting-panel/index.js.map +1 -1
- package/build/components/sidebar/plugin-post-publish-panel/index.js +5 -5
- package/build/components/sidebar/plugin-post-publish-panel/index.js.map +1 -1
- package/build/components/sidebar/plugin-post-status-info/index.js +7 -7
- package/build/components/sidebar/plugin-post-status-info/index.js.map +1 -1
- package/build/components/sidebar/plugin-pre-publish-panel/index.js +5 -5
- package/build/components/sidebar/plugin-pre-publish-panel/index.js.map +1 -1
- package/build/components/sidebar/plugin-sidebar/index.js +4 -4
- package/build/components/sidebar/plugin-sidebar/index.js.map +1 -1
- package/build/components/sidebar/post-author/index.js +3 -3
- package/build/components/sidebar/post-author/index.js.map +1 -1
- package/build/components/sidebar/post-excerpt/index.js +3 -3
- package/build/components/sidebar/post-excerpt/index.js.map +1 -1
- package/build/components/sidebar/post-format/index.js +3 -3
- package/build/components/sidebar/post-format/index.js.map +1 -1
- package/build/components/sidebar/post-pending-status/index.js +2 -2
- package/build/components/sidebar/post-pending-status/index.js.map +1 -1
- package/build/components/sidebar/post-schedule/index.js +7 -6
- package/build/components/sidebar/post-schedule/index.js.map +1 -1
- package/build/components/sidebar/post-slug/index.js +3 -3
- package/build/components/sidebar/post-slug/index.js.map +1 -1
- package/build/components/sidebar/post-status/index.js +28 -30
- package/build/components/sidebar/post-status/index.js.map +1 -1
- package/build/components/sidebar/post-sticky/index.js +2 -2
- package/build/components/sidebar/post-sticky/index.js.map +1 -1
- package/build/components/sidebar/post-taxonomies/index.js +3 -3
- package/build/components/sidebar/post-taxonomies/index.js.map +1 -1
- package/build/components/sidebar/post-taxonomies/taxonomy-panel.js +2 -2
- package/build/components/sidebar/post-taxonomies/taxonomy-panel.js.map +1 -1
- package/build/components/sidebar/post-template/create-modal.js +9 -8
- package/build/components/sidebar/post-template/create-modal.js.map +1 -1
- package/build/components/sidebar/post-template/form.js +7 -6
- package/build/components/sidebar/post-template/form.js.map +1 -1
- package/build/components/sidebar/post-template/index.js +6 -5
- package/build/components/sidebar/post-template/index.js.map +1 -1
- package/build/components/sidebar/post-trash/index.js +2 -2
- package/build/components/sidebar/post-trash/index.js.map +1 -1
- package/build/components/sidebar/post-url/index.js +6 -5
- package/build/components/sidebar/post-url/index.js.map +1 -1
- package/build/components/sidebar/post-visibility/index.js +8 -7
- package/build/components/sidebar/post-visibility/index.js.map +1 -1
- package/build/components/sidebar/settings-header/index.js +4 -4
- package/build/components/sidebar/settings-header/index.js.map +1 -1
- package/build/components/sidebar/settings-sidebar/index.js +6 -5
- package/build/components/sidebar/settings-sidebar/index.js.map +1 -1
- package/build/components/sidebar/template-summary/index.js +5 -5
- package/build/components/sidebar/template-summary/index.js.map +1 -1
- package/build/components/start-page-options/index.js +7 -6
- package/build/components/start-page-options/index.js.map +1 -1
- package/build/components/text-editor/index.js +6 -6
- package/build/components/text-editor/index.js.map +1 -1
- package/build/components/view-link/index.js +2 -2
- package/build/components/view-link/index.js.map +1 -1
- package/build/components/visual-editor/block-inspector-button.js +2 -2
- package/build/components/visual-editor/block-inspector-button.js.map +1 -1
- package/build/components/visual-editor/header.native.js +4 -3
- package/build/components/visual-editor/header.native.js.map +1 -1
- package/build/components/visual-editor/index.js +14 -13
- package/build/components/visual-editor/index.js.map +1 -1
- package/build/components/visual-editor/index.native.js +3 -2
- package/build/components/visual-editor/index.native.js.map +1 -1
- package/build/components/welcome-guide/default.js +17 -16
- package/build/components/welcome-guide/default.js.map +1 -1
- package/build/components/welcome-guide/image.js +4 -4
- package/build/components/welcome-guide/image.js.map +1 -1
- package/build/components/welcome-guide/index.js +2 -2
- package/build/components/welcome-guide/index.js.map +1 -1
- package/build/components/welcome-guide/template.js +5 -5
- package/build/components/welcome-guide/template.js.map +1 -1
- package/build/editor.js +5 -4
- package/build/editor.js.map +1 -1
- package/build/editor.native.js +5 -4
- package/build/editor.native.js.map +1 -1
- package/build/hooks/validate-multiple-use/index.js +11 -11
- package/build/hooks/validate-multiple-use/index.js.map +1 -1
- package/build/index.js +3 -2
- package/build/index.js.map +1 -1
- package/build/index.native.js +2 -2
- package/build/index.native.js.map +1 -1
- package/build/plugins/copy-content-menu-item/index.js +2 -2
- package/build/plugins/copy-content-menu-item/index.js.map +1 -1
- package/build/plugins/index.js +6 -6
- package/build/plugins/index.js.map +1 -1
- package/build/plugins/keyboard-shortcuts-help-menu-item/index.js +2 -2
- package/build/plugins/keyboard-shortcuts-help-menu-item/index.js.map +1 -1
- package/build/plugins/welcome-guide-menu-item/index.js +2 -2
- package/build/plugins/welcome-guide-menu-item/index.js.map +1 -1
- package/build-module/components/block-manager/category.js +1 -1
- package/build-module/components/block-manager/checklist.js +1 -1
- package/build-module/components/block-manager/index.js +1 -1
- package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js +3 -3
- package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
- package/build-module/components/device-preview/index.js +1 -1
- package/build-module/components/header/document-actions/index.js +1 -1
- package/build-module/components/header/fullscreen-mode-close/index.js +1 -1
- package/build-module/components/header/header-toolbar/index.js +1 -1
- package/build-module/components/header/header-toolbar/index.native.js +1 -1
- package/build-module/components/header/index.js +1 -1
- package/build-module/components/header/index.native.js +1 -1
- package/build-module/components/header/main-dashboard-button/index.js +1 -1
- package/build-module/components/header/mode-switcher/index.js +1 -1
- package/build-module/components/header/more-menu/index.js +1 -1
- package/build-module/components/header/plugin-more-menu-item/index.js +3 -3
- 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 +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 +1 -1
- package/build-module/components/header/preferences-menu-item/index.js +1 -1
- package/build-module/components/header/tools-more-menu-group/index.js +1 -1
- package/build-module/components/header/writing-menu/index.js +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/index.js +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +1 -1
- package/build-module/components/layout/actions-panel.js +1 -1
- package/build-module/components/layout/index.js +1 -1
- package/build-module/components/layout/index.native.js +1 -1
- package/build-module/components/meta-boxes/index.js +1 -1
- package/build-module/components/meta-boxes/meta-boxes-area/index.js +2 -2
- package/build-module/components/meta-boxes/meta-boxes-area/index.js.map +1 -1
- package/build-module/components/preferences-modal/index.js +1 -1
- package/build-module/components/preferences-modal/meta-boxes-section.js +1 -1
- package/build-module/components/preferences-modal/options/enable-custom-fields.js +1 -1
- package/build-module/components/preferences-modal/options/enable-plugin-document-setting-panel.js +1 -1
- package/build-module/components/secondary-sidebar/inserter-sidebar.js +1 -1
- package/build-module/components/secondary-sidebar/list-view-outline.js +1 -1
- package/build-module/components/secondary-sidebar/list-view-sidebar.js +1 -1
- package/build-module/components/sidebar/discussion-panel/index.js +1 -1
- package/build-module/components/sidebar/featured-image/index.js +1 -1
- package/build-module/components/sidebar/last-revision/index.js +1 -1
- package/build-module/components/sidebar/page-attributes/index.js +1 -1
- package/build-module/components/sidebar/plugin-document-setting-panel/index.js +4 -4
- 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 +4 -4
- 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 -6
- 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 +4 -4
- package/build-module/components/sidebar/plugin-pre-publish-panel/index.js.map +1 -1
- package/build-module/components/sidebar/plugin-sidebar/index.js +3 -3
- package/build-module/components/sidebar/plugin-sidebar/index.js.map +1 -1
- package/build-module/components/sidebar/post-author/index.js +1 -1
- package/build-module/components/sidebar/post-excerpt/index.js +1 -1
- package/build-module/components/sidebar/post-format/index.js +1 -1
- package/build-module/components/sidebar/post-pending-status/index.js +1 -1
- package/build-module/components/sidebar/post-schedule/index.js +1 -1
- package/build-module/components/sidebar/post-slug/index.js +1 -1
- package/build-module/components/sidebar/post-status/index.js +25 -26
- package/build-module/components/sidebar/post-status/index.js.map +1 -1
- package/build-module/components/sidebar/post-sticky/index.js +1 -1
- package/build-module/components/sidebar/post-taxonomies/index.js +1 -1
- package/build-module/components/sidebar/post-taxonomies/taxonomy-panel.js +1 -1
- package/build-module/components/sidebar/post-template/create-modal.js +1 -1
- package/build-module/components/sidebar/post-template/form.js +1 -1
- package/build-module/components/sidebar/post-template/index.js +1 -1
- package/build-module/components/sidebar/post-trash/index.js +1 -1
- package/build-module/components/sidebar/post-url/index.js +1 -1
- package/build-module/components/sidebar/post-visibility/index.js +1 -1
- package/build-module/components/sidebar/settings-header/index.js +1 -1
- package/build-module/components/sidebar/settings-sidebar/index.js +1 -1
- package/build-module/components/sidebar/template-summary/index.js +1 -1
- package/build-module/components/start-page-options/index.js +1 -1
- package/build-module/components/text-editor/index.js +1 -1
- package/build-module/components/view-link/index.js +1 -1
- package/build-module/components/visual-editor/block-inspector-button.js +1 -1
- package/build-module/components/visual-editor/header.native.js +1 -1
- package/build-module/components/visual-editor/index.js +1 -1
- package/build-module/components/visual-editor/index.native.js +1 -1
- package/build-module/components/welcome-guide/default.js +1 -1
- package/build-module/components/welcome-guide/image.js +1 -1
- package/build-module/components/welcome-guide/index.js +1 -1
- package/build-module/components/welcome-guide/template.js +1 -1
- package/build-module/editor.js +1 -1
- package/build-module/editor.native.js +1 -1
- package/build-module/hooks/validate-multiple-use/index.js +3 -3
- package/build-module/hooks/validate-multiple-use/index.js.map +1 -1
- package/build-module/index.js +1 -1
- package/build-module/index.native.js +1 -1
- package/build-module/plugins/copy-content-menu-item/index.js +1 -1
- package/build-module/plugins/index.js +1 -1
- package/build-module/plugins/keyboard-shortcuts-help-menu-item/index.js +1 -1
- package/build-module/plugins/welcome-guide-menu-item/index.js +1 -1
- package/build-style/classic-rtl.css +1 -1
- package/build-style/classic.css +1 -1
- package/build-style/style-rtl.css +13 -17
- package/build-style/style.css +13 -17
- package/package.json +32 -32
- package/src/components/block-settings-menu/plugin-block-settings-menu-item.js +2 -2
- package/src/components/header/plugin-more-menu-item/index.js +3 -3
- package/src/components/header/plugin-sidebar-more-menu-item/index.js +3 -3
- package/src/components/meta-boxes/meta-boxes-area/index.js +1 -1
- package/src/components/sidebar/plugin-document-setting-panel/index.js +3 -3
- package/src/components/sidebar/plugin-post-publish-panel/index.js +3 -3
- package/src/components/sidebar/plugin-post-status-info/index.js +5 -5
- package/src/components/sidebar/plugin-pre-publish-panel/index.js +3 -3
- package/src/components/sidebar/plugin-sidebar/index.js +2 -2
- package/src/components/sidebar/post-status/index.js +19 -25
- package/src/hooks/validate-multiple-use/index.js +2 -2
- package/src/style.scss +0 -1
- package/src/components/sidebar/post-status/style.scss +0 -5
|
@@ -5,8 +5,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
|
-
var
|
|
8
|
+
var _react = require("react");
|
|
9
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
|
+
var _element = require("@wordpress/element");
|
|
10
11
|
var _components = require("@wordpress/components");
|
|
11
12
|
var _data = require("@wordpress/data");
|
|
12
13
|
var _store = require("../../../store");
|
|
@@ -27,7 +28,7 @@ var _store = require("../../../store");
|
|
|
27
28
|
*
|
|
28
29
|
* @param {Object} props Component props.
|
|
29
30
|
* @param {string} props.location metabox location.
|
|
30
|
-
* @return {
|
|
31
|
+
* @return {Component} The component to be rendered.
|
|
31
32
|
*/
|
|
32
33
|
function MetaBoxesArea({
|
|
33
34
|
location
|
|
@@ -51,12 +52,12 @@ function MetaBoxesArea({
|
|
|
51
52
|
const classes = (0, _classnames.default)('edit-post-meta-boxes-area', `is-${location}`, {
|
|
52
53
|
'is-loading': isSaving
|
|
53
54
|
});
|
|
54
|
-
return (0,
|
|
55
|
+
return (0, _react.createElement)("div", {
|
|
55
56
|
className: classes
|
|
56
|
-
}, isSaving && (0,
|
|
57
|
+
}, isSaving && (0, _react.createElement)(_components.Spinner, null), (0, _react.createElement)("div", {
|
|
57
58
|
className: "edit-post-meta-boxes-area__container",
|
|
58
59
|
ref: container
|
|
59
|
-
}), (0,
|
|
60
|
+
}), (0, _react.createElement)("div", {
|
|
60
61
|
className: "edit-post-meta-boxes-area__clear"
|
|
61
62
|
}));
|
|
62
63
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_classnames","_interopRequireDefault","require","_element","_components","_data","_store","MetaBoxesArea","location","container","useRef","formRef","useEffect","current","document","querySelector","appendChild","isSaving","useSelect","select","editPostStore","isSavingMetaBoxes","classes","classnames","_react","createElement","className","Spinner","ref","_default","exports","default"],"sources":["@wordpress/edit-post/src/components/meta-boxes/meta-boxes-area/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useRef, useEffect } from '@wordpress/element';\nimport { Spinner } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../../store';\n\n/**\n * Render metabox area.\n *\n * @param {Object} props Component props.\n * @param {string} props.location metabox location.\n * @return {Component} The component to be rendered.\n */\nfunction MetaBoxesArea( { location } ) {\n\tconst container = useRef( null );\n\tconst formRef = useRef( null );\n\n\tuseEffect( () => {\n\t\tformRef.current = document.querySelector(\n\t\t\t'.metabox-location-' + location\n\t\t);\n\n\t\tif ( formRef.current ) {\n\t\t\tcontainer.current.appendChild( formRef.current );\n\t\t}\n\n\t\treturn () => {\n\t\t\tif ( formRef.current ) {\n\t\t\t\tdocument\n\t\t\t\t\t.querySelector( '#metaboxes' )\n\t\t\t\t\t.appendChild( formRef.current );\n\t\t\t}\n\t\t};\n\t}, [ location ] );\n\n\tconst isSaving = useSelect( ( select ) => {\n\t\treturn select( editPostStore ).isSavingMetaBoxes();\n\t}, [] );\n\n\tconst classes = classnames(\n\t\t'edit-post-meta-boxes-area',\n\t\t`is-${ location }`,\n\t\t{\n\t\t\t'is-loading': isSaving,\n\t\t}\n\t);\n\n\treturn (\n\t\t<div className={ classes }>\n\t\t\t{ isSaving && <Spinner /> }\n\t\t\t<div\n\t\t\t\tclassName=\"edit-post-meta-boxes-area__container\"\n\t\t\t\tref={ container }\n\t\t\t/>\n\t\t\t<div className=\"edit-post-meta-boxes-area__clear\" />\n\t\t</div>\n\t);\n}\n\nexport default MetaBoxesArea;\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AAKA,IAAAI,MAAA,GAAAJ,OAAA;AAfA;AACA;AACA;;AAGA;AACA;AACA;;AAKA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASK,aAAaA,CAAE;EAAEC;AAAS,CAAC,EAAG;EACtC,MAAMC,SAAS,GAAG,IAAAC,eAAM,EAAE,IAAK,CAAC;EAChC,MAAMC,OAAO,GAAG,IAAAD,eAAM,EAAE,IAAK,CAAC;EAE9B,IAAAE,kBAAS,EAAE,MAAM;IAChBD,OAAO,CAACE,OAAO,GAAGC,QAAQ,CAACC,aAAa,CACvC,oBAAoB,GAAGP,QACxB,CAAC;IAED,IAAKG,OAAO,CAACE,OAAO,EAAG;MACtBJ,SAAS,CAACI,OAAO,CAACG,WAAW,CAAEL,OAAO,CAACE,OAAQ,CAAC;IACjD;IAEA,OAAO,MAAM;MACZ,IAAKF,OAAO,CAACE,OAAO,EAAG;QACtBC,QAAQ,CACNC,aAAa,CAAE,YAAa,CAAC,CAC7BC,WAAW,CAAEL,OAAO,CAACE,OAAQ,CAAC;MACjC;IACD,CAAC;EACF,CAAC,EAAE,CAAEL,QAAQ,CAAG,CAAC;EAEjB,MAAMS,QAAQ,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IACzC,OAAOA,MAAM,CAAEC,YAAc,CAAC,CAACC,iBAAiB,CAAC,CAAC;EACnD,CAAC,EAAE,EAAG,CAAC;EAEP,MAAMC,OAAO,GAAG,IAAAC,mBAAU,EACzB,2BAA2B,EAC1B,MAAMf,QAAU,EAAC,EAClB;IACC,YAAY,EAAES;EACf,CACD,CAAC;EAED,OACC,IAAAO,MAAA,CAAAC,aAAA;IAAKC,SAAS,EAAGJ;EAAS,GACvBL,QAAQ,IAAI,IAAAO,MAAA,CAAAC,aAAA,EAACrB,WAAA,CAAAuB,OAAO,MAAE,CAAC,EACzB,IAAAH,MAAA,CAAAC,aAAA;IACCC,SAAS,EAAC,sCAAsC;IAChDE,GAAG,EAAGnB;EAAW,CACjB,CAAC,EACF,IAAAe,MAAA,CAAAC,aAAA;IAAKC,SAAS,EAAC;EAAkC,CAAE,CAC/C,CAAC;AAER;AAAC,IAAAG,QAAA,GAEctB,aAAa;AAAAuB,OAAA,CAAAC,OAAA,GAAAF,QAAA"}
|
|
@@ -6,10 +6,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.PREFERENCES_MODAL_NAME = void 0;
|
|
8
8
|
exports.default = EditPostPreferencesModal;
|
|
9
|
-
var
|
|
9
|
+
var _react = require("react");
|
|
10
10
|
var _i18n = require("@wordpress/i18n");
|
|
11
11
|
var _compose = require("@wordpress/compose");
|
|
12
12
|
var _data = require("@wordpress/data");
|
|
13
|
+
var _element = require("@wordpress/element");
|
|
13
14
|
var _editor = require("@wordpress/editor");
|
|
14
15
|
var _interface = require("@wordpress/interface");
|
|
15
16
|
var _preferences = require("@wordpress/preferences");
|
|
@@ -63,37 +64,37 @@ function EditPostPreferencesModal() {
|
|
|
63
64
|
const sections = (0, _element.useMemo)(() => [{
|
|
64
65
|
name: 'general',
|
|
65
66
|
tabLabel: (0, _i18n.__)('General'),
|
|
66
|
-
content: (0,
|
|
67
|
+
content: (0, _react.createElement)(_react.Fragment, null, isLargeViewport && (0, _react.createElement)(_interface.PreferencesModalSection, {
|
|
67
68
|
title: (0, _i18n.__)('Publishing'),
|
|
68
69
|
description: (0, _i18n.__)('Change options related to publishing.')
|
|
69
|
-
}, (0,
|
|
70
|
+
}, (0, _react.createElement)(_options.EnablePublishSidebarOption, {
|
|
70
71
|
help: (0, _i18n.__)('Review settings, such as visibility and tags.'),
|
|
71
72
|
label: (0, _i18n.__)('Include pre-publish checklist')
|
|
72
|
-
})), (0,
|
|
73
|
+
})), (0, _react.createElement)(_interface.PreferencesModalSection, {
|
|
73
74
|
title: (0, _i18n.__)('Appearance'),
|
|
74
75
|
description: (0, _i18n.__)('Customize options related to the block editor interface and editing flow.')
|
|
75
|
-
}, (0,
|
|
76
|
+
}, (0, _react.createElement)(_options.EnableFeature, {
|
|
76
77
|
featureName: "distractionFree",
|
|
77
78
|
onToggle: toggleDistractionFree,
|
|
78
79
|
help: (0, _i18n.__)('Reduce visual distractions by hiding the toolbar and other elements to focus on writing.'),
|
|
79
80
|
label: (0, _i18n.__)('Distraction free')
|
|
80
|
-
}), (0,
|
|
81
|
+
}), (0, _react.createElement)(_options.EnableFeature, {
|
|
81
82
|
featureName: "focusMode",
|
|
82
83
|
help: (0, _i18n.__)('Highlights the current block and fades other content.'),
|
|
83
84
|
label: (0, _i18n.__)('Spotlight mode')
|
|
84
|
-
}), (0,
|
|
85
|
+
}), (0, _react.createElement)(_options.EnableFeature, {
|
|
85
86
|
featureName: "showIconLabels",
|
|
86
87
|
label: (0, _i18n.__)('Show button text labels'),
|
|
87
88
|
help: (0, _i18n.__)('Show text instead of icons on buttons.')
|
|
88
|
-
}), (0,
|
|
89
|
+
}), (0, _react.createElement)(_options.EnableFeature, {
|
|
89
90
|
featureName: "showListViewByDefault",
|
|
90
91
|
help: (0, _i18n.__)('Opens the block list view sidebar by default.'),
|
|
91
92
|
label: (0, _i18n.__)('Always open list view')
|
|
92
|
-
}), (0,
|
|
93
|
+
}), (0, _react.createElement)(_options.EnableFeature, {
|
|
93
94
|
featureName: "themeStyles",
|
|
94
95
|
help: (0, _i18n.__)('Make the editor look like your theme.'),
|
|
95
96
|
label: (0, _i18n.__)('Use theme styles')
|
|
96
|
-
}), showBlockBreadcrumbsOption && (0,
|
|
97
|
+
}), showBlockBreadcrumbsOption && (0, _react.createElement)(_options.EnableFeature, {
|
|
97
98
|
featureName: "showBlockBreadcrumbs",
|
|
98
99
|
help: (0, _i18n.__)('Shows block breadcrumbs at the bottom of the editor.'),
|
|
99
100
|
label: (0, _i18n.__)('Display block breadcrumbs')
|
|
@@ -101,47 +102,47 @@ function EditPostPreferencesModal() {
|
|
|
101
102
|
}, {
|
|
102
103
|
name: 'blocks',
|
|
103
104
|
tabLabel: (0, _i18n.__)('Blocks'),
|
|
104
|
-
content: (0,
|
|
105
|
+
content: (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(_interface.PreferencesModalSection, {
|
|
105
106
|
title: (0, _i18n.__)('Block interactions'),
|
|
106
107
|
description: (0, _i18n.__)('Customize how you interact with blocks in the block library and editing canvas.')
|
|
107
|
-
}, (0,
|
|
108
|
+
}, (0, _react.createElement)(_options.EnableFeature, {
|
|
108
109
|
featureName: "mostUsedBlocks",
|
|
109
110
|
help: (0, _i18n.__)('Places the most frequent blocks in the block library.'),
|
|
110
111
|
label: (0, _i18n.__)('Show most used blocks')
|
|
111
|
-
}), (0,
|
|
112
|
+
}), (0, _react.createElement)(_options.EnableFeature, {
|
|
112
113
|
featureName: "keepCaretInsideBlock",
|
|
113
114
|
help: (0, _i18n.__)('Aids screen readers by stopping text caret from leaving blocks.'),
|
|
114
115
|
label: (0, _i18n.__)('Contain text cursor inside block')
|
|
115
|
-
})), (0,
|
|
116
|
+
})), (0, _react.createElement)(_interface.PreferencesModalSection, {
|
|
116
117
|
title: (0, _i18n.__)('Visible blocks'),
|
|
117
118
|
description: (0, _i18n.__)("Disable blocks that you don't want to appear in the inserter. They can always be toggled back on later.")
|
|
118
|
-
}, (0,
|
|
119
|
+
}, (0, _react.createElement)(_blockManager.default, null)))
|
|
119
120
|
}, {
|
|
120
121
|
name: 'panels',
|
|
121
122
|
tabLabel: (0, _i18n.__)('Panels'),
|
|
122
|
-
content: (0,
|
|
123
|
+
content: (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(_interface.PreferencesModalSection, {
|
|
123
124
|
title: (0, _i18n.__)('Document settings'),
|
|
124
125
|
description: (0, _i18n.__)('Choose what displays in the panel.')
|
|
125
|
-
}, (0,
|
|
126
|
-
taxonomyWrapper: (content, taxonomy) => (0,
|
|
126
|
+
}, (0, _react.createElement)(_options.EnablePluginDocumentSettingPanelOption.Slot, null), (0, _react.createElement)(_editor.PostTaxonomies, {
|
|
127
|
+
taxonomyWrapper: (content, taxonomy) => (0, _react.createElement)(_options.EnablePanelOption, {
|
|
127
128
|
label: taxonomy.labels.menu_name,
|
|
128
129
|
panelName: `taxonomy-panel-${taxonomy.slug}`
|
|
129
130
|
})
|
|
130
|
-
}), (0,
|
|
131
|
+
}), (0, _react.createElement)(_editor.PostFeaturedImageCheck, null, (0, _react.createElement)(_options.EnablePanelOption, {
|
|
131
132
|
label: (0, _i18n.__)('Featured image'),
|
|
132
133
|
panelName: "featured-image"
|
|
133
|
-
})), (0,
|
|
134
|
+
})), (0, _react.createElement)(_editor.PostExcerptCheck, null, (0, _react.createElement)(_options.EnablePanelOption, {
|
|
134
135
|
label: (0, _i18n.__)('Excerpt'),
|
|
135
136
|
panelName: "post-excerpt"
|
|
136
|
-
})), (0,
|
|
137
|
+
})), (0, _react.createElement)(_editor.PostTypeSupportCheck, {
|
|
137
138
|
supportKeys: ['comments', 'trackbacks']
|
|
138
|
-
}, (0,
|
|
139
|
+
}, (0, _react.createElement)(_options.EnablePanelOption, {
|
|
139
140
|
label: (0, _i18n.__)('Discussion'),
|
|
140
141
|
panelName: "discussion-panel"
|
|
141
|
-
})), (0,
|
|
142
|
+
})), (0, _react.createElement)(_editor.PageAttributesCheck, null, (0, _react.createElement)(_options.EnablePanelOption, {
|
|
142
143
|
label: (0, _i18n.__)('Page attributes'),
|
|
143
144
|
panelName: "page-attributes"
|
|
144
|
-
}))), (0,
|
|
145
|
+
}))), (0, _react.createElement)(_metaBoxesSection.default, {
|
|
145
146
|
title: (0, _i18n.__)('Additional'),
|
|
146
147
|
description: (0, _i18n.__)('Add extra areas to the editor.')
|
|
147
148
|
}))
|
|
@@ -149,9 +150,9 @@ function EditPostPreferencesModal() {
|
|
|
149
150
|
if (!isModalActive) {
|
|
150
151
|
return null;
|
|
151
152
|
}
|
|
152
|
-
return (0,
|
|
153
|
+
return (0, _react.createElement)(_interface.PreferencesModal, {
|
|
153
154
|
closeModal: closeModal
|
|
154
|
-
}, (0,
|
|
155
|
+
}, (0, _react.createElement)(_interface.PreferencesModalTabs, {
|
|
155
156
|
sections: sections
|
|
156
157
|
}));
|
|
157
158
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_i18n","_compose","_data","_editor","_interface","_preferences","_options","_metaBoxesSection","_interopRequireDefault","_store","_blockManager","PREFERENCES_MODAL_NAME","exports","EditPostPreferencesModal","isLargeViewport","useViewportMatch","closeModal","useDispatch","interfaceStore","isModalActive","showBlockBreadcrumbsOption","useSelect","select","getEditorSettings","editorStore","getEditorMode","isFeatureActive","editPostStore","modalActive","mode","isRichEditingEnabled","richEditingEnabled","isDistractionFreeEnabled","closeGeneralSidebar","setIsListViewOpened","setIsInserterOpened","set","setPreference","preferencesStore","toggleDistractionFree","sections","useMemo","name","tabLabel","__","content","createElement","Fragment","PreferencesModalSection","title","description","EnablePublishSidebarOption","help","label","EnableFeature","featureName","onToggle","default","EnablePluginDocumentSettingPanelOption","Slot","PostTaxonomies","taxonomyWrapper","taxonomy","EnablePanelOption","labels","menu_name","panelName","slug","PostFeaturedImageCheck","PostExcerptCheck","PostTypeSupportCheck","supportKeys","PageAttributesCheck","PreferencesModal","PreferencesModalTabs"],"sources":["@wordpress/edit-post/src/components/preferences-modal/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\n\nimport { __ } from '@wordpress/i18n';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport {\n\tPostTaxonomies,\n\tPostExcerptCheck,\n\tPageAttributesCheck,\n\tPostFeaturedImageCheck,\n\tPostTypeSupportCheck,\n\tstore as editorStore,\n} from '@wordpress/editor';\nimport {\n\tPreferencesModal,\n\tPreferencesModalTabs,\n\tPreferencesModalSection,\n\tstore as interfaceStore,\n} from '@wordpress/interface';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\n\nimport {\n\tEnablePluginDocumentSettingPanelOption,\n\tEnablePublishSidebarOption,\n\tEnablePanelOption,\n\tEnableFeature,\n} from './options';\nimport MetaBoxesSection from './meta-boxes-section';\nimport { store as editPostStore } from '../../store';\nimport BlockManager from '../block-manager';\n\nexport const PREFERENCES_MODAL_NAME = 'edit-post/preferences';\n\nexport default function EditPostPreferencesModal() {\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst { closeModal } = useDispatch( interfaceStore );\n\tconst [ isModalActive, showBlockBreadcrumbsOption ] = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditorSettings } = select( editorStore );\n\t\t\tconst { getEditorMode, isFeatureActive } = select( editPostStore );\n\t\t\tconst modalActive = select( interfaceStore ).isModalActive(\n\t\t\t\tPREFERENCES_MODAL_NAME\n\t\t\t);\n\t\t\tconst mode = getEditorMode();\n\t\t\tconst isRichEditingEnabled = getEditorSettings().richEditingEnabled;\n\t\t\tconst isDistractionFreeEnabled =\n\t\t\t\tisFeatureActive( 'distractionFree' );\n\t\t\treturn [\n\t\t\t\tmodalActive,\n\t\t\t\t! isDistractionFreeEnabled &&\n\t\t\t\t\tisLargeViewport &&\n\t\t\t\t\tisRichEditingEnabled &&\n\t\t\t\t\tmode === 'visual',\n\t\t\t\tisDistractionFreeEnabled,\n\t\t\t];\n\t\t},\n\t\t[ isLargeViewport ]\n\t);\n\n\tconst { closeGeneralSidebar, setIsListViewOpened, setIsInserterOpened } =\n\t\tuseDispatch( editPostStore );\n\n\tconst { set: setPreference } = useDispatch( preferencesStore );\n\n\tconst toggleDistractionFree = () => {\n\t\tsetPreference( 'core/edit-post', 'fixedToolbar', false );\n\t\tsetIsInserterOpened( false );\n\t\tsetIsListViewOpened( false );\n\t\tcloseGeneralSidebar();\n\t};\n\n\tconst sections = useMemo(\n\t\t() => [\n\t\t\t{\n\t\t\t\tname: 'general',\n\t\t\t\ttabLabel: __( 'General' ),\n\t\t\t\tcontent: (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ isLargeViewport && (\n\t\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\t\ttitle={ __( 'Publishing' ) }\n\t\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t\t'Change options related to publishing.'\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<EnablePublishSidebarOption\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Review settings, such as visibility and tags.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t\t'Include pre-publish checklist'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t) }\n\n\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\ttitle={ __( 'Appearance' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t'Customize options related to the block editor interface and editing flow.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"distractionFree\"\n\t\t\t\t\t\t\t\tonToggle={ toggleDistractionFree }\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Reduce visual distractions by hiding the toolbar and other elements to focus on writing.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Distraction free' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"focusMode\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Highlights the current block and fades other content.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Spotlight mode' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"showIconLabels\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Show button text labels' ) }\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Show text instead of icons on buttons.'\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<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"showListViewByDefault\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Opens the block list view sidebar by default.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Always open list view' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"themeStyles\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Make the editor look like your theme.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Use theme styles' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t{ showBlockBreadcrumbsOption && (\n\t\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\t\tfeatureName=\"showBlockBreadcrumbs\"\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Shows block breadcrumbs at the bottom of the editor.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Display block breadcrumbs' ) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t</>\n\t\t\t\t),\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'blocks',\n\t\t\t\ttabLabel: __( 'Blocks' ),\n\t\t\t\tcontent: (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\ttitle={ __( 'Block interactions' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t'Customize how you interact with blocks in the block library and editing canvas.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"mostUsedBlocks\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Places the most frequent blocks in the block library.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Show most used blocks' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"keepCaretInsideBlock\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Aids screen readers by stopping text caret from leaving blocks.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t'Contain text cursor inside 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</PreferencesModalSection>\n\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\ttitle={ __( 'Visible blocks' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t\"Disable blocks that you don't want to appear in the inserter. They can always be toggled back on later.\"\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<BlockManager />\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t</>\n\t\t\t\t),\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'panels',\n\t\t\t\ttabLabel: __( 'Panels' ),\n\t\t\t\tcontent: (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\ttitle={ __( 'Document settings' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t'Choose what displays in the panel.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<EnablePluginDocumentSettingPanelOption.Slot />\n\t\t\t\t\t\t\t<PostTaxonomies\n\t\t\t\t\t\t\t\ttaxonomyWrapper={ ( content, taxonomy ) => (\n\t\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\t\tlabel={ taxonomy.labels.menu_name }\n\t\t\t\t\t\t\t\t\t\tpanelName={ `taxonomy-panel-${ taxonomy.slug }` }\n\t\t\t\t\t\t\t\t\t/>\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<PostFeaturedImageCheck>\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Featured image' ) }\n\t\t\t\t\t\t\t\t\tpanelName=\"featured-image\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PostFeaturedImageCheck>\n\t\t\t\t\t\t\t<PostExcerptCheck>\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Excerpt' ) }\n\t\t\t\t\t\t\t\t\tpanelName=\"post-excerpt\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PostExcerptCheck>\n\t\t\t\t\t\t\t<PostTypeSupportCheck\n\t\t\t\t\t\t\t\tsupportKeys={ [ 'comments', 'trackbacks' ] }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Discussion' ) }\n\t\t\t\t\t\t\t\t\tpanelName=\"discussion-panel\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PostTypeSupportCheck>\n\t\t\t\t\t\t\t<PageAttributesCheck>\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Page attributes' ) }\n\t\t\t\t\t\t\t\t\tpanelName=\"page-attributes\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PageAttributesCheck>\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t<MetaBoxesSection\n\t\t\t\t\t\t\ttitle={ __( 'Additional' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t'Add extra areas to the editor.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</>\n\t\t\t\t),\n\t\t\t},\n\t\t],\n\t\t[ isLargeViewport, showBlockBreadcrumbsOption ]\n\t);\n\n\tif ( ! isModalActive ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PreferencesModal closeModal={ closeModal }>\n\t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AG,IAAAT,QAAE,EAAE,YAAa,CAAG;MAC5BsB,SAAS,EAAC;IAAkB,CAC5B,CACoB,CAAC,EACvB,IAAApE,QAAA,CAAAgD,aAAA,EAAC3C,OAAA,CAAAqE,mBAAmB,QACnB,IAAA1E,QAAA,CAAAgD,aAAA,EAACxC,QAAA,CAAAyD,iBAAiB;MACjBV,KAAK,EAAG,IAAAT,QAAE,EAAE,iBAAkB,CAAG;MACjCsB,SAAS,EAAC;IAAiB,CAC3B,CACmB,CACG,CAAC,EAC1B,IAAApE,QAAA,CAAAgD,aAAA,EAACvC,iBAAA,CAAAkD,OAAgB;MAChBR,KAAK,EAAG,IAAAL,QAAE,EAAE,YAAa,CAAG;MAC5BM,WAAW,EAAG,IAAAN,QAAE,EACf,gCACD;IAAG,CACH,CACA;EAEJ,CAAC,CACD,EACD,CAAE9B,eAAe,EAAEM,0BAA0B,CAC9C,CAAC;EAED,IAAK,CAAED,aAAa,EAAG;IACtB,OAAO,IAAI;EACZ;EAEA,OACC,IAAArB,QAAA,CAAAgD,aAAA,EAAC1C,UAAA,CAAAqE,gBAAgB;IAACzD,UAAU,EAAGA;EAAY,GAC1C,IAAAlB,QAAA,CAAAgD,aAAA,EAAC1C,UAAA,CAAAsE,oBAAoB;IAAClC,QAAQ,EAAGA;EAAU,CAAE,CAC5B,CAAC;AAErB"}
|
|
1
|
+
{"version":3,"names":["_i18n","require","_compose","_data","_element","_editor","_interface","_preferences","_options","_metaBoxesSection","_interopRequireDefault","_store","_blockManager","PREFERENCES_MODAL_NAME","exports","EditPostPreferencesModal","isLargeViewport","useViewportMatch","closeModal","useDispatch","interfaceStore","isModalActive","showBlockBreadcrumbsOption","useSelect","select","getEditorSettings","editorStore","getEditorMode","isFeatureActive","editPostStore","modalActive","mode","isRichEditingEnabled","richEditingEnabled","isDistractionFreeEnabled","closeGeneralSidebar","setIsListViewOpened","setIsInserterOpened","set","setPreference","preferencesStore","toggleDistractionFree","sections","useMemo","name","tabLabel","__","content","_react","createElement","Fragment","PreferencesModalSection","title","description","EnablePublishSidebarOption","help","label","EnableFeature","featureName","onToggle","default","EnablePluginDocumentSettingPanelOption","Slot","PostTaxonomies","taxonomyWrapper","taxonomy","EnablePanelOption","labels","menu_name","panelName","slug","PostFeaturedImageCheck","PostExcerptCheck","PostTypeSupportCheck","supportKeys","PageAttributesCheck","PreferencesModal","PreferencesModalTabs"],"sources":["@wordpress/edit-post/src/components/preferences-modal/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\n\nimport { __ } from '@wordpress/i18n';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport {\n\tPostTaxonomies,\n\tPostExcerptCheck,\n\tPageAttributesCheck,\n\tPostFeaturedImageCheck,\n\tPostTypeSupportCheck,\n\tstore as editorStore,\n} from '@wordpress/editor';\nimport {\n\tPreferencesModal,\n\tPreferencesModalTabs,\n\tPreferencesModalSection,\n\tstore as interfaceStore,\n} from '@wordpress/interface';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\n\nimport {\n\tEnablePluginDocumentSettingPanelOption,\n\tEnablePublishSidebarOption,\n\tEnablePanelOption,\n\tEnableFeature,\n} from './options';\nimport MetaBoxesSection from './meta-boxes-section';\nimport { store as editPostStore } from '../../store';\nimport BlockManager from '../block-manager';\n\nexport const PREFERENCES_MODAL_NAME = 'edit-post/preferences';\n\nexport default function EditPostPreferencesModal() {\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst { closeModal } = useDispatch( interfaceStore );\n\tconst [ isModalActive, showBlockBreadcrumbsOption ] = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditorSettings } = select( editorStore );\n\t\t\tconst { getEditorMode, isFeatureActive } = select( editPostStore );\n\t\t\tconst modalActive = select( interfaceStore ).isModalActive(\n\t\t\t\tPREFERENCES_MODAL_NAME\n\t\t\t);\n\t\t\tconst mode = getEditorMode();\n\t\t\tconst isRichEditingEnabled = getEditorSettings().richEditingEnabled;\n\t\t\tconst isDistractionFreeEnabled =\n\t\t\t\tisFeatureActive( 'distractionFree' );\n\t\t\treturn [\n\t\t\t\tmodalActive,\n\t\t\t\t! isDistractionFreeEnabled &&\n\t\t\t\t\tisLargeViewport &&\n\t\t\t\t\tisRichEditingEnabled &&\n\t\t\t\t\tmode === 'visual',\n\t\t\t\tisDistractionFreeEnabled,\n\t\t\t];\n\t\t},\n\t\t[ isLargeViewport ]\n\t);\n\n\tconst { closeGeneralSidebar, setIsListViewOpened, setIsInserterOpened } =\n\t\tuseDispatch( editPostStore );\n\n\tconst { set: setPreference } = useDispatch( preferencesStore );\n\n\tconst toggleDistractionFree = () => {\n\t\tsetPreference( 'core/edit-post', 'fixedToolbar', false );\n\t\tsetIsInserterOpened( false );\n\t\tsetIsListViewOpened( false );\n\t\tcloseGeneralSidebar();\n\t};\n\n\tconst sections = useMemo(\n\t\t() => [\n\t\t\t{\n\t\t\t\tname: 'general',\n\t\t\t\ttabLabel: __( 'General' ),\n\t\t\t\tcontent: (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ isLargeViewport && (\n\t\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\t\ttitle={ __( 'Publishing' ) }\n\t\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t\t'Change options related to publishing.'\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<EnablePublishSidebarOption\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Review settings, such as visibility and tags.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t\t'Include pre-publish checklist'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t) }\n\n\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\ttitle={ __( 'Appearance' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t'Customize options related to the block editor interface and editing flow.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"distractionFree\"\n\t\t\t\t\t\t\t\tonToggle={ toggleDistractionFree }\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Reduce visual distractions by hiding the toolbar and other elements to focus on writing.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Distraction free' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"focusMode\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Highlights the current block and fades other content.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Spotlight mode' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"showIconLabels\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Show button text labels' ) }\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Show text instead of icons on buttons.'\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<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"showListViewByDefault\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Opens the block list view sidebar by default.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Always open list view' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"themeStyles\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Make the editor look like your theme.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Use theme styles' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t{ showBlockBreadcrumbsOption && (\n\t\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\t\tfeatureName=\"showBlockBreadcrumbs\"\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Shows block breadcrumbs at the bottom of the editor.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Display block breadcrumbs' ) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t</>\n\t\t\t\t),\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'blocks',\n\t\t\t\ttabLabel: __( 'Blocks' ),\n\t\t\t\tcontent: (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\ttitle={ __( 'Block interactions' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t'Customize how you interact with blocks in the block library and editing canvas.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"mostUsedBlocks\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Places the most frequent blocks in the block library.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Show most used blocks' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"keepCaretInsideBlock\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Aids screen readers by stopping text caret from leaving blocks.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t'Contain text cursor inside 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</PreferencesModalSection>\n\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\ttitle={ __( 'Visible blocks' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t\"Disable blocks that you don't want to appear in the inserter. They can always be toggled back on later.\"\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<BlockManager />\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t</>\n\t\t\t\t),\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'panels',\n\t\t\t\ttabLabel: __( 'Panels' ),\n\t\t\t\tcontent: (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\ttitle={ __( 'Document settings' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t'Choose what displays in the panel.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<EnablePluginDocumentSettingPanelOption.Slot />\n\t\t\t\t\t\t\t<PostTaxonomies\n\t\t\t\t\t\t\t\ttaxonomyWrapper={ ( content, taxonomy ) => (\n\t\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\t\tlabel={ taxonomy.labels.menu_name }\n\t\t\t\t\t\t\t\t\t\tpanelName={ `taxonomy-panel-${ taxonomy.slug }` }\n\t\t\t\t\t\t\t\t\t/>\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<PostFeaturedImageCheck>\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Featured image' ) }\n\t\t\t\t\t\t\t\t\tpanelName=\"featured-image\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PostFeaturedImageCheck>\n\t\t\t\t\t\t\t<PostExcerptCheck>\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Excerpt' ) }\n\t\t\t\t\t\t\t\t\tpanelName=\"post-excerpt\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PostExcerptCheck>\n\t\t\t\t\t\t\t<PostTypeSupportCheck\n\t\t\t\t\t\t\t\tsupportKeys={ [ 'comments', 'trackbacks' ] }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Discussion' ) }\n\t\t\t\t\t\t\t\t\tpanelName=\"discussion-panel\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PostTypeSupportCheck>\n\t\t\t\t\t\t\t<PageAttributesCheck>\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Page attributes' ) }\n\t\t\t\t\t\t\t\t\tpanelName=\"page-attributes\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PageAttributesCheck>\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t<MetaBoxesSection\n\t\t\t\t\t\t\ttitle={ __( 'Additional' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t'Add extra areas to the editor.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</>\n\t\t\t\t),\n\t\t\t},\n\t\t],\n\t\t[ isLargeViewport, showBlockBreadcrumbsOption ]\n\t);\n\n\tif ( ! isModalActive ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PreferencesModal closeModal={ closeModal }>\n\t\t\t<PreferencesModalTabs sections={ sections } />\n\t\t</PreferencesModal>\n\t);\n}\n"],"mappings":";;;;;;;;;AAIA,IAAAA,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IAAA3B,MAAA,CAAAC,aAAA,EAACzC,QAAA,CAAA0D,iBAAiB;MACjBV,KAAK,EAAG,IAAAV,QAAE,EAAE,iBAAkB,CAAG;MACjCuB,SAAS,EAAC;IAAiB,CAC3B,CACmB,CACG,CAAC,EAC1B,IAAArB,MAAA,CAAAC,aAAA,EAACxC,iBAAA,CAAAmD,OAAgB;MAChBR,KAAK,EAAG,IAAAN,QAAE,EAAE,YAAa,CAAG;MAC5BO,WAAW,EAAG,IAAAP,QAAE,EACf,gCACD;IAAG,CACH,CACA;EAEJ,CAAC,CACD,EACD,CAAE9B,eAAe,EAAEM,0BAA0B,CAC9C,CAAC;EAED,IAAK,CAAED,aAAa,EAAG;IACtB,OAAO,IAAI;EACZ;EAEA,OACC,IAAA2B,MAAA,CAAAC,aAAA,EAAC3C,UAAA,CAAAsE,gBAAgB;IAAC1D,UAAU,EAAGA;EAAY,GAC1C,IAAA8B,MAAA,CAAAC,aAAA,EAAC3C,UAAA,CAAAuE,oBAAoB;IAACnC,QAAQ,EAAGA;EAAU,CAAE,CAC5B,CAAC;AAErB"}
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.MetaBoxesSection = MetaBoxesSection;
|
|
7
7
|
exports.default = void 0;
|
|
8
|
-
var
|
|
8
|
+
var _react = require("react");
|
|
9
9
|
var _i18n = require("@wordpress/i18n");
|
|
10
10
|
var _data = require("@wordpress/data");
|
|
11
11
|
var _editor = require("@wordpress/editor");
|
|
@@ -32,14 +32,14 @@ function MetaBoxesSection({
|
|
|
32
32
|
if (!areCustomFieldsRegistered && thirdPartyMetaBoxes.length === 0) {
|
|
33
33
|
return null;
|
|
34
34
|
}
|
|
35
|
-
return (0,
|
|
35
|
+
return (0, _react.createElement)(_interface.PreferencesModalSection, {
|
|
36
36
|
...sectionProps
|
|
37
|
-
}, areCustomFieldsRegistered && (0,
|
|
37
|
+
}, areCustomFieldsRegistered && (0, _react.createElement)(_options.EnableCustomFieldsOption, {
|
|
38
38
|
label: (0, _i18n.__)('Custom fields')
|
|
39
39
|
}), thirdPartyMetaBoxes.map(({
|
|
40
40
|
id,
|
|
41
41
|
title
|
|
42
|
-
}) => (0,
|
|
42
|
+
}) => (0, _react.createElement)(_options.EnablePanelOption, {
|
|
43
43
|
key: id,
|
|
44
44
|
label: title,
|
|
45
45
|
panelName: `meta-box-${id}`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_data","_editor","_interface","_options","_store","MetaBoxesSection","areCustomFieldsRegistered","metaBoxes","sectionProps","thirdPartyMetaBoxes","filter","id","length","
|
|
1
|
+
{"version":3,"names":["_i18n","require","_data","_editor","_interface","_options","_store","MetaBoxesSection","areCustomFieldsRegistered","metaBoxes","sectionProps","thirdPartyMetaBoxes","filter","id","length","_react","createElement","PreferencesModalSection","EnableCustomFieldsOption","label","__","map","title","EnablePanelOption","key","panelName","_default","withSelect","select","getEditorSettings","editorStore","getAllMetaBoxes","editPostStore","enableCustomFields","undefined","exports","default"],"sources":["@wordpress/edit-post/src/components/preferences-modal/meta-boxes-section.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { withSelect } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\nimport { PreferencesModalSection } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport { EnableCustomFieldsOption, EnablePanelOption } from './options';\nimport { store as editPostStore } from '../../store';\n\nexport function MetaBoxesSection( {\n\tareCustomFieldsRegistered,\n\tmetaBoxes,\n\t...sectionProps\n} ) {\n\t// The 'Custom Fields' meta box is a special case that we handle separately.\n\tconst thirdPartyMetaBoxes = metaBoxes.filter(\n\t\t( { id } ) => id !== 'postcustom'\n\t);\n\n\tif ( ! areCustomFieldsRegistered && thirdPartyMetaBoxes.length === 0 ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PreferencesModalSection { ...sectionProps }>\n\t\t\t{ areCustomFieldsRegistered && (\n\t\t\t\t<EnableCustomFieldsOption label={ __( 'Custom fields' ) } />\n\t\t\t) }\n\t\t\t{ thirdPartyMetaBoxes.map( ( { id, title } ) => (\n\t\t\t\t<EnablePanelOption\n\t\t\t\t\tkey={ id }\n\t\t\t\t\tlabel={ title }\n\t\t\t\t\tpanelName={ `meta-box-${ id }` }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t</PreferencesModalSection>\n\t);\n}\n\nexport default withSelect( ( select ) => {\n\tconst { getEditorSettings } = select( editorStore );\n\tconst { getAllMetaBoxes } = select( editPostStore );\n\n\treturn {\n\t\t// This setting should not live in the block editor's store.\n\t\tareCustomFieldsRegistered:\n\t\t\tgetEditorSettings().enableCustomFields !== undefined,\n\t\tmetaBoxes: getAllMetaBoxes(),\n\t};\n} )( MetaBoxesSection );\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AAKA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AAZA;AACA;AACA;;AAMA;AACA;AACA;;AAIO,SAASM,gBAAgBA,CAAE;EACjCC,yBAAyB;EACzBC,SAAS;EACT,GAAGC;AACJ,CAAC,EAAG;EACH;EACA,MAAMC,mBAAmB,GAAGF,SAAS,CAACG,MAAM,CAC3C,CAAE;IAAEC;EAAG,CAAC,KAAMA,EAAE,KAAK,YACtB,CAAC;EAED,IAAK,CAAEL,yBAAyB,IAAIG,mBAAmB,CAACG,MAAM,KAAK,CAAC,EAAG;IACtE,OAAO,IAAI;EACZ;EAEA,OACC,IAAAC,MAAA,CAAAC,aAAA,EAACZ,UAAA,CAAAa,uBAAuB;IAAA,GAAMP;EAAY,GACvCF,yBAAyB,IAC1B,IAAAO,MAAA,CAAAC,aAAA,EAACX,QAAA,CAAAa,wBAAwB;IAACC,KAAK,EAAG,IAAAC,QAAE,EAAE,eAAgB;EAAG,CAAE,CAC3D,EACCT,mBAAmB,CAACU,GAAG,CAAE,CAAE;IAAER,EAAE;IAAES;EAAM,CAAC,KACzC,IAAAP,MAAA,CAAAC,aAAA,EAACX,QAAA,CAAAkB,iBAAiB;IACjBC,GAAG,EAAGX,EAAI;IACVM,KAAK,EAAGG,KAAO;IACfG,SAAS,EAAI,YAAYZ,EAAI;EAAG,CAChC,CACA,CACsB,CAAC;AAE5B;AAAC,IAAAa,QAAA,GAEc,IAAAC,gBAAU,EAAIC,MAAM,IAAM;EACxC,MAAM;IAAEC;EAAkB,CAAC,GAAGD,MAAM,CAAEE,aAAY,CAAC;EACnD,MAAM;IAAEC;EAAgB,CAAC,GAAGH,MAAM,CAAEI,YAAc,CAAC;EAEnD,OAAO;IACN;IACAxB,yBAAyB,EACxBqB,iBAAiB,CAAC,CAAC,CAACI,kBAAkB,KAAKC,SAAS;IACrDzB,SAAS,EAAEsB,eAAe,CAAC;EAC5B,CAAC;AACF,CAAE,CAAC,CAAExB,gBAAiB,CAAC;AAAA4B,OAAA,CAAAC,OAAA,GAAAV,QAAA"}
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.CustomFieldsConfirmation = CustomFieldsConfirmation;
|
|
7
7
|
exports.EnableCustomFieldsOption = EnableCustomFieldsOption;
|
|
8
8
|
exports.default = void 0;
|
|
9
|
+
var _react = require("react");
|
|
9
10
|
var _element = require("@wordpress/element");
|
|
10
11
|
var _i18n = require("@wordpress/i18n");
|
|
11
12
|
var _components = require("@wordpress/components");
|
|
@@ -28,9 +29,9 @@ function CustomFieldsConfirmation({
|
|
|
28
29
|
willEnable
|
|
29
30
|
}) {
|
|
30
31
|
const [isReloading, setIsReloading] = (0, _element.useState)(false);
|
|
31
|
-
return (0,
|
|
32
|
+
return (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)("p", {
|
|
32
33
|
className: "edit-post-preferences-modal__custom-fields-confirmation-message"
|
|
33
|
-
}, (0, _i18n.__)('A page reload is required for this change. Make sure your content is saved before reloading.')), (0,
|
|
34
|
+
}, (0, _i18n.__)('A page reload is required for this change. Make sure your content is saved before reloading.')), (0, _react.createElement)(_components.Button, {
|
|
34
35
|
className: "edit-post-preferences-modal__custom-fields-confirmation-button",
|
|
35
36
|
variant: "secondary",
|
|
36
37
|
isBusy: isReloading,
|
|
@@ -46,11 +47,11 @@ function EnableCustomFieldsOption({
|
|
|
46
47
|
areCustomFieldsEnabled
|
|
47
48
|
}) {
|
|
48
49
|
const [isChecked, setIsChecked] = (0, _element.useState)(areCustomFieldsEnabled);
|
|
49
|
-
return (0,
|
|
50
|
+
return (0, _react.createElement)(_interface.___unstablePreferencesModalBaseOption, {
|
|
50
51
|
label: label,
|
|
51
52
|
isChecked: isChecked,
|
|
52
53
|
onChange: setIsChecked
|
|
53
|
-
}, isChecked !== areCustomFieldsEnabled && (0,
|
|
54
|
+
}, isChecked !== areCustomFieldsEnabled && (0, _react.createElement)(CustomFieldsConfirmation, {
|
|
54
55
|
willEnable: isChecked
|
|
55
56
|
}));
|
|
56
57
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_i18n","_components","_data","_editor","_interface","_url","submitCustomFieldsForm","customFieldsForm","document","getElementById","querySelector","setAttribute","getPathAndQueryString","window","location","href","submit","CustomFieldsConfirmation","willEnable","isReloading","setIsReloading","useState","createElement","Fragment","className","__","Button","variant","isBusy","disabled","onClick","EnableCustomFieldsOption","label","areCustomFieldsEnabled","isChecked","setIsChecked","___unstablePreferencesModalBaseOption","onChange","_default","withSelect","select","editorStore","getEditorSettings","enableCustomFields","exports","default"],"sources":["@wordpress/edit-post/src/components/preferences-modal/options/enable-custom-fields.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { withSelect } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\nimport { ___unstablePreferencesModalBaseOption as BaseOption } from '@wordpress/interface';\nimport { getPathAndQueryString } from '@wordpress/url';\n\nfunction submitCustomFieldsForm() {\n\tconst customFieldsForm = document.getElementById(\n\t\t'toggle-custom-fields-form'\n\t);\n\n\t// Ensure the referrer values is up to update with any\n\tcustomFieldsForm\n\t\t.querySelector( '[name=\"_wp_http_referer\"]' )\n\t\t.setAttribute( 'value', getPathAndQueryString( window.location.href ) );\n\n\tcustomFieldsForm.submit();\n}\n\nexport function CustomFieldsConfirmation( { willEnable } ) {\n\tconst [ isReloading, setIsReloading ] = useState( false );\n\treturn (\n\t\t<>\n\t\t\t<p className=\"edit-post-preferences-modal__custom-fields-confirmation-message\">\n\t\t\t\t{ __(\n\t\t\t\t\t'A page reload is required for this change. Make sure your content is saved before reloading.'\n\t\t\t\t) }\n\t\t\t</p>\n\t\t\t<Button\n\t\t\t\tclassName=\"edit-post-preferences-modal__custom-fields-confirmation-button\"\n\t\t\t\tvariant=\"secondary\"\n\t\t\t\tisBusy={ isReloading }\n\t\t\t\tdisabled={ isReloading }\n\t\t\t\tonClick={ () => {\n\t\t\t\t\tsetIsReloading( true );\n\t\t\t\t\tsubmitCustomFieldsForm();\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ willEnable\n\t\t\t\t\t? __( 'Show & Reload Page' )\n\t\t\t\t\t: __( 'Hide & Reload Page' ) }\n\t\t\t</Button>\n\t\t</>\n\t);\n}\n\nexport function EnableCustomFieldsOption( { label, areCustomFieldsEnabled } ) {\n\tconst [ isChecked, setIsChecked ] = useState( areCustomFieldsEnabled );\n\n\treturn (\n\t\t<BaseOption\n\t\t\tlabel={ label }\n\t\t\tisChecked={ isChecked }\n\t\t\tonChange={ setIsChecked }\n\t\t>\n\t\t\t{ isChecked !== areCustomFieldsEnabled && (\n\t\t\t\t<CustomFieldsConfirmation willEnable={ isChecked } />\n\t\t\t) }\n\t\t</BaseOption>\n\t);\n}\n\nexport default withSelect( ( select ) => ( {\n\tareCustomFieldsEnabled:\n\t\t!! select( editorStore ).getEditorSettings().enableCustomFields,\n} ) )( EnableCustomFieldsOption );\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_element","require","_i18n","_components","_data","_editor","_interface","_url","submitCustomFieldsForm","customFieldsForm","document","getElementById","querySelector","setAttribute","getPathAndQueryString","window","location","href","submit","CustomFieldsConfirmation","willEnable","isReloading","setIsReloading","useState","_react","createElement","Fragment","className","__","Button","variant","isBusy","disabled","onClick","EnableCustomFieldsOption","label","areCustomFieldsEnabled","isChecked","setIsChecked","___unstablePreferencesModalBaseOption","onChange","_default","withSelect","select","editorStore","getEditorSettings","enableCustomFields","exports","default"],"sources":["@wordpress/edit-post/src/components/preferences-modal/options/enable-custom-fields.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { withSelect } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\nimport { ___unstablePreferencesModalBaseOption as BaseOption } from '@wordpress/interface';\nimport { getPathAndQueryString } from '@wordpress/url';\n\nfunction submitCustomFieldsForm() {\n\tconst customFieldsForm = document.getElementById(\n\t\t'toggle-custom-fields-form'\n\t);\n\n\t// Ensure the referrer values is up to update with any\n\tcustomFieldsForm\n\t\t.querySelector( '[name=\"_wp_http_referer\"]' )\n\t\t.setAttribute( 'value', getPathAndQueryString( window.location.href ) );\n\n\tcustomFieldsForm.submit();\n}\n\nexport function CustomFieldsConfirmation( { willEnable } ) {\n\tconst [ isReloading, setIsReloading ] = useState( false );\n\treturn (\n\t\t<>\n\t\t\t<p className=\"edit-post-preferences-modal__custom-fields-confirmation-message\">\n\t\t\t\t{ __(\n\t\t\t\t\t'A page reload is required for this change. Make sure your content is saved before reloading.'\n\t\t\t\t) }\n\t\t\t</p>\n\t\t\t<Button\n\t\t\t\tclassName=\"edit-post-preferences-modal__custom-fields-confirmation-button\"\n\t\t\t\tvariant=\"secondary\"\n\t\t\t\tisBusy={ isReloading }\n\t\t\t\tdisabled={ isReloading }\n\t\t\t\tonClick={ () => {\n\t\t\t\t\tsetIsReloading( true );\n\t\t\t\t\tsubmitCustomFieldsForm();\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ willEnable\n\t\t\t\t\t? __( 'Show & Reload Page' )\n\t\t\t\t\t: __( 'Hide & Reload Page' ) }\n\t\t\t</Button>\n\t\t</>\n\t);\n}\n\nexport function EnableCustomFieldsOption( { label, areCustomFieldsEnabled } ) {\n\tconst [ isChecked, setIsChecked ] = useState( areCustomFieldsEnabled );\n\n\treturn (\n\t\t<BaseOption\n\t\t\tlabel={ label }\n\t\t\tisChecked={ isChecked }\n\t\t\tonChange={ setIsChecked }\n\t\t>\n\t\t\t{ isChecked !== areCustomFieldsEnabled && (\n\t\t\t\t<CustomFieldsConfirmation willEnable={ isChecked } />\n\t\t\t) }\n\t\t</BaseOption>\n\t);\n}\n\nexport default withSelect( ( select ) => ( {\n\tareCustomFieldsEnabled:\n\t\t!! select( editorStore ).getEditorSettings().enableCustomFields,\n} ) )( EnableCustomFieldsOption );\n"],"mappings":";;;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,UAAA,GAAAL,OAAA;AACA,IAAAM,IAAA,GAAAN,OAAA;AATA;AACA;AACA;;AASA,SAASO,sBAAsBA,CAAA,EAAG;EACjC,MAAMC,gBAAgB,GAAGC,QAAQ,CAACC,cAAc,CAC/C,2BACD,CAAC;;EAED;EACAF,gBAAgB,CACdG,aAAa,CAAE,2BAA4B,CAAC,CAC5CC,YAAY,CAAE,OAAO,EAAE,IAAAC,0BAAqB,EAAEC,MAAM,CAACC,QAAQ,CAACC,IAAK,CAAE,CAAC;EAExER,gBAAgB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,CAAC,CAAEO,MAAM,CAAEC,aAAY,CAAC,CAACC,iBAAiB,CAAC,CAAC,CAACC;AAC/C,CAAC,CAAG,CAAC,CAAEZ,wBAAyB,CAAC;AAAAa,OAAA,CAAAC,OAAA,GAAAP,QAAA"}
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
var
|
|
7
|
+
var _react = require("react");
|
|
8
8
|
var _components = require("@wordpress/components");
|
|
9
9
|
var _index = require("./index");
|
|
10
10
|
/**
|
|
@@ -22,7 +22,7 @@ const {
|
|
|
22
22
|
const EnablePluginDocumentSettingPanelOption = ({
|
|
23
23
|
label,
|
|
24
24
|
panelName
|
|
25
|
-
}) => (0,
|
|
25
|
+
}) => (0, _react.createElement)(Fill, null, (0, _react.createElement)(_index.EnablePanelOption, {
|
|
26
26
|
label: label,
|
|
27
27
|
panelName: panelName
|
|
28
28
|
}));
|
package/build/components/preferences-modal/options/enable-plugin-document-setting-panel.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","_index","Fill","Slot","createSlotFill","EnablePluginDocumentSettingPanelOption","label","panelName","
|
|
1
|
+
{"version":3,"names":["_components","require","_index","Fill","Slot","createSlotFill","EnablePluginDocumentSettingPanelOption","label","panelName","_react","createElement","EnablePanelOption","_default","exports","default"],"sources":["@wordpress/edit-post/src/components/preferences-modal/options/enable-plugin-document-setting-panel.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createSlotFill } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { EnablePanelOption } from './index';\n\nconst { Fill, Slot } = createSlotFill(\n\t'EnablePluginDocumentSettingPanelOption'\n);\n\nconst EnablePluginDocumentSettingPanelOption = ( { label, panelName } ) => (\n\t<Fill>\n\t\t<EnablePanelOption label={ label } panelName={ panelName } />\n\t</Fill>\n);\n\nEnablePluginDocumentSettingPanelOption.Slot = Slot;\n\nexport default EnablePluginDocumentSettingPanelOption;\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AAKA,IAAAC,MAAA,GAAAD,OAAA;AARA;AACA;AACA;;AAGA;AACA;AACA;;AAGA,MAAM;EAAEE,IAAI;EAAEC;AAAK,CAAC,GAAG,IAAAC,0BAAc,EACpC,wCACD,CAAC;AAED,MAAMC,sCAAsC,GAAGA,CAAE;EAAEC,KAAK;EAAEC;AAAU,CAAC,KACpE,IAAAC,MAAA,CAAAC,aAAA,EAACP,IAAI,QACJ,IAAAM,MAAA,CAAAC,aAAA,EAACR,MAAA,CAAAS,iBAAiB;EAACJ,KAAK,EAAGA,KAAO;EAACC,SAAS,EAAGA;AAAW,CAAE,CACvD,CACN;AAEDF,sCAAsC,CAACF,IAAI,GAAGA,IAAI;AAAC,IAAAQ,QAAA,GAEpCN,sCAAsC;AAAAO,OAAA,CAAAC,OAAA,GAAAF,QAAA"}
|
|
@@ -4,13 +4,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = InserterSidebar;
|
|
7
|
-
var
|
|
7
|
+
var _react = require("react");
|
|
8
8
|
var _data = require("@wordpress/data");
|
|
9
9
|
var _components = require("@wordpress/components");
|
|
10
10
|
var _blockEditor = require("@wordpress/block-editor");
|
|
11
11
|
var _icons = require("@wordpress/icons");
|
|
12
12
|
var _compose = require("@wordpress/compose");
|
|
13
13
|
var _i18n = require("@wordpress/i18n");
|
|
14
|
+
var _element = require("@wordpress/element");
|
|
14
15
|
var _store = require("../../store");
|
|
15
16
|
/**
|
|
16
17
|
* WordPress dependencies
|
|
@@ -47,19 +48,19 @@ function InserterSidebar() {
|
|
|
47
48
|
(0, _element.useEffect)(() => {
|
|
48
49
|
libraryRef.current.focusSearch();
|
|
49
50
|
}, []);
|
|
50
|
-
return (0,
|
|
51
|
+
return (0, _react.createElement)("div", {
|
|
51
52
|
ref: inserterDialogRef,
|
|
52
53
|
...inserterDialogProps,
|
|
53
54
|
className: "edit-post-editor__inserter-panel"
|
|
54
|
-
}, (0,
|
|
55
|
+
}, (0, _react.createElement)(TagName, {
|
|
55
56
|
className: "edit-post-editor__inserter-panel-header"
|
|
56
|
-
}, (0,
|
|
57
|
+
}, (0, _react.createElement)(_components.Button, {
|
|
57
58
|
icon: _icons.close,
|
|
58
59
|
label: (0, _i18n.__)('Close block inserter'),
|
|
59
60
|
onClick: () => setIsInserterOpened(false)
|
|
60
|
-
})), (0,
|
|
61
|
+
})), (0, _react.createElement)("div", {
|
|
61
62
|
className: "edit-post-editor__inserter-panel-content"
|
|
62
|
-
}, (0,
|
|
63
|
+
}, (0, _react.createElement)(_blockEditor.__experimentalLibrary, {
|
|
63
64
|
showMostUsedBlocks: showMostUsedBlocks,
|
|
64
65
|
showInserterHelpPanel: true,
|
|
65
66
|
shouldFocusBlock: isMobileViewport,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_data","require","_components","_blockEditor","_icons","_compose","_i18n","_element","_store","InserterSidebar","insertionPoint","showMostUsedBlocks","useSelect","select","isFeatureActive","__experimentalGetInsertionPoint","editPostStore","setIsInserterOpened","useDispatch","isMobileViewport","useViewportMatch","TagName","VisuallyHidden","inserterDialogRef","inserterDialogProps","useDialog","onClose","focusOnMount","libraryRef","useRef","useEffect","current","focusSearch","_react","createElement","ref","className","Button","icon","close","label","__","onClick","__experimentalLibrary","showInserterHelpPanel","shouldFocusBlock","rootClientId","__experimentalInsertionIndex","insertionIndex","__experimentalFilterValue","filterValue"],"sources":["@wordpress/edit-post/src/components/secondary-sidebar/inserter-sidebar.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { Button, VisuallyHidden } from '@wordpress/components';\nimport { __experimentalLibrary as Library } from '@wordpress/block-editor';\nimport { close } from '@wordpress/icons';\nimport {\n\tuseViewportMatch,\n\t__experimentalUseDialog as useDialog,\n} from '@wordpress/compose';\nimport { __ } from '@wordpress/i18n';\nimport { useEffect, useRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../store';\n\nexport default function InserterSidebar() {\n\tconst { insertionPoint, showMostUsedBlocks } = useSelect( ( select ) => {\n\t\tconst { isFeatureActive, __experimentalGetInsertionPoint } =\n\t\t\tselect( editPostStore );\n\t\treturn {\n\t\t\tinsertionPoint: __experimentalGetInsertionPoint(),\n\t\t\tshowMostUsedBlocks: isFeatureActive( 'mostUsedBlocks' ),\n\t\t};\n\t}, [] );\n\tconst { setIsInserterOpened } = useDispatch( editPostStore );\n\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst TagName = ! isMobileViewport ? VisuallyHidden : 'div';\n\tconst [ inserterDialogRef, inserterDialogProps ] = useDialog( {\n\t\tonClose: () => setIsInserterOpened( false ),\n\t\tfocusOnMount: null,\n\t} );\n\n\tconst libraryRef = useRef();\n\tuseEffect( () => {\n\t\tlibraryRef.current.focusSearch();\n\t}, [] );\n\n\treturn (\n\t\t<div\n\t\t\tref={ inserterDialogRef }\n\t\t\t{ ...inserterDialogProps }\n\t\t\tclassName=\"edit-post-editor__inserter-panel\"\n\t\t>\n\t\t\t<TagName className=\"edit-post-editor__inserter-panel-header\">\n\t\t\t\t<Button\n\t\t\t\t\ticon={ close }\n\t\t\t\t\tlabel={ __( 'Close block inserter' ) }\n\t\t\t\t\tonClick={ () => setIsInserterOpened( false ) }\n\t\t\t\t/>\n\t\t\t</TagName>\n\t\t\t<div className=\"edit-post-editor__inserter-panel-content\">\n\t\t\t\t<Library\n\t\t\t\t\tshowMostUsedBlocks={ showMostUsedBlocks }\n\t\t\t\t\tshowInserterHelpPanel\n\t\t\t\t\tshouldFocusBlock={ isMobileViewport }\n\t\t\t\t\trootClientId={ insertionPoint.rootClientId }\n\t\t\t\t\t__experimentalInsertionIndex={\n\t\t\t\t\t\tinsertionPoint.ins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