@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,7 +5,7 @@ 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 _editor = require("@wordpress/editor");
|
|
10
10
|
var _taxonomyPanel = _interopRequireDefault(require("./taxonomy-panel"));
|
|
11
11
|
/**
|
|
@@ -17,9 +17,9 @@ var _taxonomyPanel = _interopRequireDefault(require("./taxonomy-panel"));
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
function PostTaxonomies() {
|
|
20
|
-
return (0,
|
|
20
|
+
return (0, _react.createElement)(_editor.PostTaxonomiesCheck, null, (0, _react.createElement)(_editor.PostTaxonomies, {
|
|
21
21
|
taxonomyWrapper: (content, taxonomy) => {
|
|
22
|
-
return (0,
|
|
22
|
+
return (0, _react.createElement)(_taxonomyPanel.default, {
|
|
23
23
|
taxonomy: taxonomy
|
|
24
24
|
}, content);
|
|
25
25
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_editor","require","_taxonomyPanel","_interopRequireDefault","PostTaxonomies","
|
|
1
|
+
{"version":3,"names":["_editor","require","_taxonomyPanel","_interopRequireDefault","PostTaxonomies","_react","createElement","PostTaxonomiesCheck","taxonomyWrapper","content","taxonomy","default","_default","exports"],"sources":["@wordpress/edit-post/src/components/sidebar/post-taxonomies/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tPostTaxonomies as PostTaxonomiesForm,\n\tPostTaxonomiesCheck,\n} from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport TaxonomyPanel from './taxonomy-panel';\n\nfunction PostTaxonomies() {\n\treturn (\n\t\t<PostTaxonomiesCheck>\n\t\t\t<PostTaxonomiesForm\n\t\t\t\ttaxonomyWrapper={ ( content, taxonomy ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<TaxonomyPanel taxonomy={ taxonomy }>\n\t\t\t\t\t\t\t{ content }\n\t\t\t\t\t\t</TaxonomyPanel>\n\t\t\t\t\t);\n\t\t\t\t} }\n\t\t\t/>\n\t\t</PostTaxonomiesCheck>\n\t);\n}\n\nexport default PostTaxonomies;\n"],"mappings":";;;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AAQA,IAAAC,cAAA,GAAAC,sBAAA,CAAAF,OAAA;AAXA;AACA;AACA;;AAMA;AACA;AACA;;AAGA,SAASG,cAAcA,CAAA,EAAG;EACzB,OACC,IAAAC,MAAA,CAAAC,aAAA,EAACN,OAAA,CAAAO,mBAAmB,QACnB,IAAAF,MAAA,CAAAC,aAAA,EAACN,OAAA,CAAAI,cAAkB;IAClBI,eAAe,EAAGA,CAAEC,OAAO,EAAEC,QAAQ,KAAM;MAC1C,OACC,IAAAL,MAAA,CAAAC,aAAA,EAACJ,cAAA,CAAAS,OAAa;QAACD,QAAQ,EAAGA;MAAU,GACjCD,OACY,CAAC;IAElB;EAAG,CACH,CACmB,CAAC;AAExB;AAAC,IAAAG,QAAA,GAEcR,cAAc;AAAAS,OAAA,CAAAF,OAAA,GAAAC,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 _data = require("@wordpress/data");
|
|
10
10
|
var _store = require("../../../store");
|
|
@@ -45,7 +45,7 @@ function TaxonomyPanel({
|
|
|
45
45
|
if (!taxonomyMenuName) {
|
|
46
46
|
return null;
|
|
47
47
|
}
|
|
48
|
-
return (0,
|
|
48
|
+
return (0, _react.createElement)(_components.PanelBody, {
|
|
49
49
|
title: taxonomyMenuName,
|
|
50
50
|
opened: isOpened,
|
|
51
51
|
onToggle: () => toggleEditorPanelOpened(panelName)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","_data","_store","TaxonomyPanel","taxonomy","children","slug","panelName","isEnabled","isOpened","useSelect","select","isEditorPanelEnabled","isEditorPanelOpened","editPostStore","toggleEditorPanelOpened","useDispatch","taxonomyMenuName","labels","menu_name","
|
|
1
|
+
{"version":3,"names":["_components","require","_data","_store","TaxonomyPanel","taxonomy","children","slug","panelName","isEnabled","isOpened","useSelect","select","isEditorPanelEnabled","isEditorPanelOpened","editPostStore","toggleEditorPanelOpened","useDispatch","taxonomyMenuName","labels","menu_name","_react","createElement","PanelBody","title","opened","onToggle","_default","exports","default"],"sources":["@wordpress/edit-post/src/components/sidebar/post-taxonomies/taxonomy-panel.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { PanelBody } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../../store';\n\nfunction TaxonomyPanel( { taxonomy, children } ) {\n\tconst slug = taxonomy?.slug;\n\tconst panelName = slug ? `taxonomy-panel-${ slug }` : '';\n\tconst { isEnabled, isOpened } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { isEditorPanelEnabled, isEditorPanelOpened } =\n\t\t\t\tselect( editPostStore );\n\t\t\treturn {\n\t\t\t\tisEnabled: slug ? isEditorPanelEnabled( panelName ) : false,\n\t\t\t\tisOpened: slug ? isEditorPanelOpened( panelName ) : false,\n\t\t\t};\n\t\t},\n\t\t[ panelName, slug ]\n\t);\n\tconst { toggleEditorPanelOpened } = useDispatch( editPostStore );\n\n\tif ( ! isEnabled ) {\n\t\treturn null;\n\t}\n\n\tconst taxonomyMenuName = taxonomy?.labels?.menu_name;\n\tif ( ! taxonomyMenuName ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PanelBody\n\t\t\ttitle={ taxonomyMenuName }\n\t\t\topened={ isOpened }\n\t\t\tonToggle={ () => toggleEditorPanelOpened( panelName ) }\n\t\t>\n\t\t\t{ children }\n\t\t</PanelBody>\n\t);\n}\n\nexport default TaxonomyPanel;\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAKA,IAAAE,MAAA,GAAAF,OAAA;AATA;AACA;AACA;;AAIA;AACA;AACA;;AAGA,SAASG,aAAaA,CAAE;EAAEC,QAAQ;EAAEC;AAAS,CAAC,EAAG;EAChD,MAAMC,IAAI,GAAGF,QAAQ,EAAEE,IAAI;EAC3B,MAAMC,SAAS,GAAGD,IAAI,GAAI,kBAAkBA,IAAM,EAAC,GAAG,EAAE;EACxD,MAAM;IAAEE,SAAS;IAAEC;EAAS,CAAC,GAAG,IAAAC,eAAS,EACtCC,MAAM,IAAM;IACb,MAAM;MAAEC,oBAAoB;MAAEC;IAAoB,CAAC,GAClDF,MAAM,CAAEG,YAAc,CAAC;IACxB,OAAO;MACNN,SAAS,EAAEF,IAAI,GAAGM,oBAAoB,CAAEL,SAAU,CAAC,GAAG,KAAK;MAC3DE,QAAQ,EAAEH,IAAI,GAAGO,mBAAmB,CAAEN,SAAU,CAAC,GAAG;IACrD,CAAC;EACF,CAAC,EACD,CAAEA,SAAS,EAAED,IAAI,CAClB,CAAC;EACD,MAAM;IAAES;EAAwB,CAAC,GAAG,IAAAC,iBAAW,EAAEF,YAAc,CAAC;EAEhE,IAAK,CAAEN,SAAS,EAAG;IAClB,OAAO,IAAI;EACZ;EAEA,MAAMS,gBAAgB,GAAGb,QAAQ,EAAEc,MAAM,EAAEC,SAAS;EACpD,IAAK,CAAEF,gBAAgB,EAAG;IACzB,OAAO,IAAI;EACZ;EAEA,OACC,IAAAG,MAAA,CAAAC,aAAA,EAACtB,WAAA,CAAAuB,SAAS;IACTC,KAAK,EAAGN,gBAAkB;IAC1BO,MAAM,EAAGf,QAAU;IACnBgB,QAAQ,EAAGA,CAAA,KAAMV,uBAAuB,CAAER,SAAU;EAAG,GAErDF,QACQ,CAAC;AAEd;AAAC,IAAAqB,QAAA,GAEcvB,aAAa;AAAAwB,OAAA,CAAAC,OAAA,GAAAF,QAAA"}
|
|
@@ -4,9 +4,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = PostTemplateCreateModal;
|
|
7
|
-
var
|
|
7
|
+
var _react = require("react");
|
|
8
8
|
var _data = require("@wordpress/data");
|
|
9
9
|
var _editor = require("@wordpress/editor");
|
|
10
|
+
var _element = require("@wordpress/element");
|
|
10
11
|
var _blocks = require("@wordpress/blocks");
|
|
11
12
|
var _components = require("@wordpress/components");
|
|
12
13
|
var _i18n = require("@wordpress/i18n");
|
|
@@ -66,16 +67,16 @@ function PostTemplateCreateModal({
|
|
|
66
67
|
cancel();
|
|
67
68
|
__unstableSwitchToTemplateMode(true);
|
|
68
69
|
};
|
|
69
|
-
return (0,
|
|
70
|
+
return (0, _react.createElement)(_components.Modal, {
|
|
70
71
|
title: (0, _i18n.__)('Create custom template'),
|
|
71
72
|
onRequestClose: cancel,
|
|
72
73
|
className: "edit-post-post-template__create-modal"
|
|
73
|
-
}, (0,
|
|
74
|
+
}, (0, _react.createElement)("form", {
|
|
74
75
|
className: "edit-post-post-template__create-form",
|
|
75
76
|
onSubmit: submit
|
|
76
|
-
}, (0,
|
|
77
|
+
}, (0, _react.createElement)(_components.__experimentalVStack, {
|
|
77
78
|
spacing: "3"
|
|
78
|
-
}, (0,
|
|
79
|
+
}, (0, _react.createElement)(_components.TextControl, {
|
|
79
80
|
__nextHasNoMarginBottom: true,
|
|
80
81
|
label: (0, _i18n.__)('Name'),
|
|
81
82
|
value: title,
|
|
@@ -83,12 +84,12 @@ function PostTemplateCreateModal({
|
|
|
83
84
|
placeholder: DEFAULT_TITLE,
|
|
84
85
|
disabled: isBusy,
|
|
85
86
|
help: (0, _i18n.__)('Describe the template, e.g. "Post with sidebar". A custom template can be manually applied to any post or page.')
|
|
86
|
-
}), (0,
|
|
87
|
+
}), (0, _react.createElement)(_components.__experimentalHStack, {
|
|
87
88
|
justify: "right"
|
|
88
|
-
}, (0,
|
|
89
|
+
}, (0, _react.createElement)(_components.Button, {
|
|
89
90
|
variant: "tertiary",
|
|
90
91
|
onClick: cancel
|
|
91
|
-
}, (0, _i18n.__)('Cancel')), (0,
|
|
92
|
+
}, (0, _i18n.__)('Cancel')), (0, _react.createElement)(_components.Button, {
|
|
92
93
|
variant: "primary",
|
|
93
94
|
type: "submit",
|
|
94
95
|
isBusy: isBusy,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_data","require","_editor","_element","_blocks","_components","_i18n","_url","_store","DEFAULT_TITLE","__","PostTemplateCreateModal","onClose","defaultBlockTemplate","useSelect","select","editorStore","getEditorSettings","__unstableCreateTemplate","__unstableSwitchToTemplateMode","useDispatch","editPostStore","title","setTitle","useState","isBusy","setIsBusy","cancel","submit","event","preventDefault","newTemplateContent","serialize","createBlock","tagName","layout","inherit","slug","cleanForSlug","content","_react","createElement","Modal","onRequestClose","className","onSubmit","__experimentalVStack","spacing","TextControl","__nextHasNoMarginBottom","label","value","onChange","placeholder","disabled","help","__experimentalHStack","justify","Button","variant","onClick","type"],"sources":["@wordpress/edit-post/src/components/sidebar/post-template/create-modal.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\nimport { useState } from '@wordpress/element';\nimport { serialize, createBlock } from '@wordpress/blocks';\nimport {\n\tModal,\n\tTextControl,\n\tButton,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { cleanForSlug } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../../store';\n\nconst DEFAULT_TITLE = __( 'Custom Template' );\n\nexport default function PostTemplateCreateModal( { onClose } ) {\n\tconst defaultBlockTemplate = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editorStore ).getEditorSettings().defaultBlockTemplate,\n\t\t[]\n\t);\n\n\tconst { __unstableCreateTemplate, __unstableSwitchToTemplateMode } =\n\t\tuseDispatch( editPostStore );\n\n\tconst [ title, setTitle ] = useState( '' );\n\n\tconst [ isBusy, setIsBusy ] = useState( false );\n\n\tconst cancel = () => {\n\t\tsetTitle( '' );\n\t\tonClose();\n\t};\n\n\tconst submit = async ( event ) => {\n\t\tevent.preventDefault();\n\n\t\tif ( isBusy ) {\n\t\t\treturn;\n\t\t}\n\n\t\tsetIsBusy( true );\n\n\t\tconst newTemplateContent =\n\t\t\tdefaultBlockTemplate ??\n\t\t\tserialize( [\n\t\t\t\tcreateBlock(\n\t\t\t\t\t'core/group',\n\t\t\t\t\t{\n\t\t\t\t\t\ttagName: 'header',\n\t\t\t\t\t\tlayout: { inherit: true },\n\t\t\t\t\t},\n\t\t\t\t\t[\n\t\t\t\t\t\tcreateBlock( 'core/site-title' ),\n\t\t\t\t\t\tcreateBlock( 'core/site-tagline' ),\n\t\t\t\t\t]\n\t\t\t\t),\n\t\t\t\tcreateBlock( 'core/separator' ),\n\t\t\t\tcreateBlock(\n\t\t\t\t\t'core/group',\n\t\t\t\t\t{\n\t\t\t\t\t\ttagName: 'main',\n\t\t\t\t\t},\n\t\t\t\t\t[\n\t\t\t\t\t\tcreateBlock(\n\t\t\t\t\t\t\t'core/group',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlayout: { inherit: true },\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t[ createBlock( 'core/post-title' ) ]\n\t\t\t\t\t\t),\n\t\t\t\t\t\tcreateBlock( 'core/post-content', {\n\t\t\t\t\t\t\tlayout: { inherit: true },\n\t\t\t\t\t\t} ),\n\t\t\t\t\t]\n\t\t\t\t),\n\t\t\t] );\n\n\t\tawait __unstableCreateTemplate( {\n\t\t\tslug: cleanForSlug( title || DEFAULT_TITLE ),\n\t\t\tcontent: newTemplateContent,\n\t\t\ttitle: title || DEFAULT_TITLE,\n\t\t} );\n\n\t\tsetIsBusy( false );\n\t\tcancel();\n\n\t\t__unstableSwitchToTemplateMode( true );\n\t};\n\n\treturn (\n\t\t<Modal\n\t\t\ttitle={ __( 'Create custom template' ) }\n\t\t\tonRequestClose={ cancel }\n\t\t\tclassName=\"edit-post-post-template__create-modal\"\n\t\t>\n\t\t\t<form\n\t\t\t\tclassName=\"edit-post-post-template__create-form\"\n\t\t\t\tonSubmit={ submit }\n\t\t\t>\n\t\t\t\t<VStack spacing=\"3\">\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Name' ) }\n\t\t\t\t\t\tvalue={ title }\n\t\t\t\t\t\tonChange={ setTitle }\n\t\t\t\t\t\tplaceholder={ DEFAULT_TITLE }\n\t\t\t\t\t\tdisabled={ isBusy }\n\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t'Describe the template, e.g. \"Post with sidebar\". A custom template can be manually applied to any post or page.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t/>\n\t\t\t\t\t<HStack justify=\"right\">\n\t\t\t\t\t\t<Button variant=\"tertiary\" onClick={ cancel }>\n\t\t\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t\t\t</Button>\n\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\t\tisBusy={ isBusy }\n\t\t\t\t\t\t\taria-disabled={ isBusy }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Create' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</HStack>\n\t\t\t\t</VStack>\n\t\t\t</form>\n\t\t</Modal>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AAOA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,IAAA,GAAAN,OAAA;AAKA,IAAAO,MAAA,GAAAP,OAAA;AApBA;AACA;AACA;;AAeA;AACA;AACA;;AAGA,MAAMQ,aAAa,GAAG,IAAAC,QAAE,EAAE,iBAAkB,CAAC;AAE9B,SAASC,uBAAuBA,CAAE;EAAEC;AAAQ,CAAC,EAAG;EAC9D,MAAMC,oBAAoB,GAAG,IAAAC,eAAS,EACnCC,MAAM,IACPA,MAAM,CAAEC,aAAY,CAAC,CAACC,iBAAiB,CAAC,CAAC,CAACJ,oBAAoB,EAC/D,EACD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AqD,MAAM;IACNC,OAAO,EAAC,SAAS;IACjBE,IAAI,EAAC,QAAQ;IACbpC,MAAM,EAAGA,MAAQ;IACjB,iBAAgBA;EAAQ,GAEtB,IAAAf,QAAE,EAAE,QAAS,CACR,CACD,CACD,CACH,CACA,CAAC;AAEV"}
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = PostTemplateForm;
|
|
8
|
+
var _react = require("react");
|
|
8
9
|
var _element = require("@wordpress/element");
|
|
9
10
|
var _blockEditor = require("@wordpress/block-editor");
|
|
10
11
|
var _i18n = require("@wordpress/i18n");
|
|
@@ -75,9 +76,9 @@ function PostTemplateForm({
|
|
|
75
76
|
__unstableSwitchToTemplateMode
|
|
76
77
|
} = (0, _data.useDispatch)(_store.store);
|
|
77
78
|
const [isCreateModalOpen, setIsCreateModalOpen] = (0, _element.useState)(false);
|
|
78
|
-
return (0,
|
|
79
|
+
return (0, _react.createElement)("div", {
|
|
79
80
|
className: "edit-post-post-template__form"
|
|
80
|
-
}, (0,
|
|
81
|
+
}, (0, _react.createElement)(_blockEditor.__experimentalInspectorPopoverHeader, {
|
|
81
82
|
title: (0, _i18n.__)('Template'),
|
|
82
83
|
help: (0, _i18n.__)('Templates define the way content is displayed when viewing your site.'),
|
|
83
84
|
actions: canCreate ? [{
|
|
@@ -86,11 +87,11 @@ function PostTemplateForm({
|
|
|
86
87
|
onClick: () => setIsCreateModalOpen(true)
|
|
87
88
|
}] : [],
|
|
88
89
|
onClose: onClose
|
|
89
|
-
}), isPostsPage ? (0,
|
|
90
|
+
}), isPostsPage ? (0, _react.createElement)(_components.Notice, {
|
|
90
91
|
className: "edit-post-post-template__notice",
|
|
91
92
|
status: "warning",
|
|
92
93
|
isDismissible: false
|
|
93
|
-
}, (0, _i18n.__)('The posts page template cannot be changed.')) : (0,
|
|
94
|
+
}, (0, _i18n.__)('The posts page template cannot be changed.')) : (0, _react.createElement)(_components.SelectControl, {
|
|
94
95
|
__nextHasNoMarginBottom: true,
|
|
95
96
|
hideLabelFromVision: true,
|
|
96
97
|
label: (0, _i18n.__)('Template'),
|
|
@@ -99,10 +100,10 @@ function PostTemplateForm({
|
|
|
99
100
|
onChange: slug => editPost({
|
|
100
101
|
template: slug || ''
|
|
101
102
|
})
|
|
102
|
-
}), canEdit && (0,
|
|
103
|
+
}), canEdit && (0, _react.createElement)("p", null, (0, _react.createElement)(_components.Button, {
|
|
103
104
|
variant: "link",
|
|
104
105
|
onClick: () => __unstableSwitchToTemplateMode()
|
|
105
|
-
}, (0, _i18n.__)('Edit template'))), isCreateModalOpen && (0,
|
|
106
|
+
}, (0, _i18n.__)('Edit template'))), isCreateModalOpen && (0, _react.createElement)(_createModal.default, {
|
|
106
107
|
onClose: () => setIsCreateModalOpen(false)
|
|
107
108
|
}));
|
|
108
109
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_blockEditor","_i18n","_icons","_components","_data","_editor","_coreData","_store","_createModal","_interopRequireDefault","PostTemplateForm","onClose","_options$find","_selectedOption$value","isPostsPage","availableTemplates","fetchedTemplates","selectedTemplateSlug","canCreate","canEdit","useSelect","select","canUser","getEntityRecord","getEntityRecords","coreStore","editorSettings","editorStore","getEditorSettings","siteSettings","undefined","_isPostsPage","getCurrentPostId","page_for_posts","canCreateTemplates","post_type","getCurrentPostType","per_page","getEditedPostAttribute","supportsTemplateMode","editPostStore","getEditedPostTemplate","options","useMemo","Object","entries","fromEntries","map","slug","title","rendered","value","label","selectedOption","find","option","editPost","useDispatch","__unstableSwitchToTemplateMode","isCreateModalOpen","setIsCreateModalOpen","useState","createElement","className","__experimentalInspectorPopoverHeader","__","help","actions","icon","addTemplate","onClick","Notice","status","isDismissible","SelectControl","__nextHasNoMarginBottom","hideLabelFromVision","onChange","template","Button","variant","default"],"sources":["@wordpress/edit-post/src/components/sidebar/post-template/form.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState, useMemo } from '@wordpress/element';\nimport { __experimentalInspectorPopoverHeader as InspectorPopoverHeader } from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\nimport { addTemplate } from '@wordpress/icons';\nimport { Notice, SelectControl, Button } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../../store';\nimport PostTemplateCreateModal from './create-modal';\n\nexport default function PostTemplateForm( { onClose } ) {\n\tconst {\n\t\tisPostsPage,\n\t\tavailableTemplates,\n\t\tfetchedTemplates,\n\t\tselectedTemplateSlug,\n\t\tcanCreate,\n\t\tcanEdit,\n\t} = useSelect( ( select ) => {\n\t\tconst { canUser, getEntityRecord, getEntityRecords } =\n\t\t\tselect( coreStore );\n\t\tconst editorSettings = select( editorStore ).getEditorSettings();\n\t\tconst siteSettings = canUser( 'read', 'settings' )\n\t\t\t? getEntityRecord( 'root', 'site' )\n\t\t\t: undefined;\n\t\tconst _isPostsPage =\n\t\t\tselect( editorStore ).getCurrentPostId() ===\n\t\t\tsiteSettings?.page_for_posts;\n\t\tconst canCreateTemplates = canUser( 'create', 'templates' );\n\n\t\treturn {\n\t\t\tisPostsPage: _isPostsPage,\n\t\t\tavailableTemplates: editorSettings.availableTemplates,\n\t\t\tfetchedTemplates: canCreateTemplates\n\t\t\t\t? getEntityRecords( 'postType', 'wp_template', {\n\t\t\t\t\t\tpost_type: select( editorStore ).getCurrentPostType(),\n\t\t\t\t\t\tper_page: -1,\n\t\t\t\t } )\n\t\t\t\t: undefined,\n\t\t\tselectedTemplateSlug:\n\t\t\t\tselect( editorStore ).getEditedPostAttribute( 'template' ),\n\t\t\tcanCreate:\n\t\t\t\tcanCreateTemplates &&\n\t\t\t\t! _isPostsPage &&\n\t\t\t\teditorSettings.supportsTemplateMode,\n\t\t\tcanEdit:\n\t\t\t\tcanCreateTemplates &&\n\t\t\t\teditorSettings.supportsTemplateMode &&\n\t\t\t\t!! select( editPostStore ).getEditedPostTemplate(),\n\t\t};\n\t}, [] );\n\n\tconst options = useMemo(\n\t\t() =>\n\t\t\tObject.entries( {\n\t\t\t\t...availableTemplates,\n\t\t\t\t...Object.fromEntries(\n\t\t\t\t\t( fetchedTemplates ?? [] ).map( ( { slug, title } ) => [\n\t\t\t\t\t\tslug,\n\t\t\t\t\t\ttitle.rendered,\n\t\t\t\t\t] )\n\t\t\t\t),\n\t\t\t} ).map( ( [ slug, title ] ) => ( { value: slug, label: title } ) ),\n\t\t[ availableTemplates, fetchedTemplates ]\n\t);\n\n\tconst selectedOption =\n\t\toptions.find( ( option ) => option.value === selectedTemplateSlug ) ??\n\t\toptions.find( ( option ) => ! option.value ); // The default option has '' value.\n\n\tconst { editPost } = useDispatch( editorStore );\n\tconst { __unstableSwitchToTemplateMode } = useDispatch( editPostStore );\n\n\tconst [ isCreateModalOpen, setIsCreateModalOpen ] = useState( false );\n\n\treturn (\n\t\t<div className=\"edit-post-post-template__form\">\n\t\t\t<InspectorPopoverHeader\n\t\t\t\ttitle={ __( 'Template' ) }\n\t\t\t\thelp={ __(\n\t\t\t\t\t'Templates define the way content is displayed when viewing your site.'\n\t\t\t\t) }\n\t\t\t\tactions={\n\t\t\t\t\tcanCreate\n\t\t\t\t\t\t? [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\ticon: addTemplate,\n\t\t\t\t\t\t\t\t\tlabel: __( 'Add template' ),\n\t\t\t\t\t\t\t\t\tonClick: () => setIsCreateModalOpen( true ),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t ]\n\t\t\t\t\t\t: []\n\t\t\t\t}\n\t\t\t\tonClose={ onClose }\n\t\t\t/>\n\t\t\t{ isPostsPage ? (\n\t\t\t\t<Notice\n\t\t\t\t\tclassName=\"edit-post-post-template__notice\"\n\t\t\t\t\tstatus=\"warning\"\n\t\t\t\t\tisDismissible={ false }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'The posts page template cannot be changed.' ) }\n\t\t\t\t</Notice>\n\t\t\t) : (\n\t\t\t\t<SelectControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\thideLabelFromVision\n\t\t\t\t\tlabel={ __( 'Template' ) }\n\t\t\t\t\tvalue={ selectedOption?.value ?? '' }\n\t\t\t\t\toptions={ options }\n\t\t\t\t\tonChange={ ( slug ) =>\n\t\t\t\t\t\teditPost( { template: slug || '' } )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ canEdit && (\n\t\t\t\t<p>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"link\"\n\t\t\t\t\t\tonClick={ () => __unstableSwitchToTemplateMode() }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Edit template' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</p>\n\t\t\t) }\n\t\t\t{ isCreateModalOpen && (\n\t\t\t\t<PostTemplateCreateModal\n\t\t\t\t\tonClose={ () => setIsCreateModalOpen( false ) }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</div>\n\t);\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_element","require","_blockEditor","_i18n","_icons","_components","_data","_editor","_coreData","_store","_createModal","_interopRequireDefault","PostTemplateForm","onClose","_options$find","_selectedOption$value","isPostsPage","availableTemplates","fetchedTemplates","selectedTemplateSlug","canCreate","canEdit","useSelect","select","canUser","getEntityRecord","getEntityRecords","coreStore","editorSettings","editorStore","getEditorSettings","siteSettings","undefined","_isPostsPage","getCurrentPostId","page_for_posts","canCreateTemplates","post_type","getCurrentPostType","per_page","getEditedPostAttribute","supportsTemplateMode","editPostStore","getEditedPostTemplate","options","useMemo","Object","entries","fromEntries","map","slug","title","rendered","value","label","selectedOption","find","option","editPost","useDispatch","__unstableSwitchToTemplateMode","isCreateModalOpen","setIsCreateModalOpen","useState","_react","createElement","className","__experimentalInspectorPopoverHeader","__","help","actions","icon","addTemplate","onClick","Notice","status","isDismissible","SelectControl","__nextHasNoMarginBottom","hideLabelFromVision","onChange","template","Button","variant","default"],"sources":["@wordpress/edit-post/src/components/sidebar/post-template/form.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState, useMemo } from '@wordpress/element';\nimport { __experimentalInspectorPopoverHeader as InspectorPopoverHeader } from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\nimport { addTemplate } from '@wordpress/icons';\nimport { Notice, SelectControl, Button } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../../store';\nimport PostTemplateCreateModal from './create-modal';\n\nexport default function PostTemplateForm( { onClose } ) {\n\tconst {\n\t\tisPostsPage,\n\t\tavailableTemplates,\n\t\tfetchedTemplates,\n\t\tselectedTemplateSlug,\n\t\tcanCreate,\n\t\tcanEdit,\n\t} = useSelect( ( select ) => {\n\t\tconst { canUser, getEntityRecord, getEntityRecords } =\n\t\t\tselect( coreStore );\n\t\tconst editorSettings = select( editorStore ).getEditorSettings();\n\t\tconst siteSettings = canUser( 'read', 'settings' )\n\t\t\t? getEntityRecord( 'root', 'site' )\n\t\t\t: undefined;\n\t\tconst _isPostsPage =\n\t\t\tselect( editorStore ).getCurrentPostId() ===\n\t\t\tsiteSettings?.page_for_posts;\n\t\tconst canCreateTemplates = canUser( 'create', 'templates' );\n\n\t\treturn {\n\t\t\tisPostsPage: _isPostsPage,\n\t\t\tavailableTemplates: editorSettings.availableTemplates,\n\t\t\tfetchedTemplates: canCreateTemplates\n\t\t\t\t? getEntityRecords( 'postType', 'wp_template', {\n\t\t\t\t\t\tpost_type: select( editorStore ).getCurrentPostType(),\n\t\t\t\t\t\tper_page: -1,\n\t\t\t\t } )\n\t\t\t\t: undefined,\n\t\t\tselectedTemplateSlug:\n\t\t\t\tselect( editorStore ).getEditedPostAttribute( 'template' ),\n\t\t\tcanCreate:\n\t\t\t\tcanCreateTemplates &&\n\t\t\t\t! _isPostsPage &&\n\t\t\t\teditorSettings.supportsTemplateMode,\n\t\t\tcanEdit:\n\t\t\t\tcanCreateTemplates &&\n\t\t\t\teditorSettings.supportsTemplateMode &&\n\t\t\t\t!! select( editPostStore ).getEditedPostTemplate(),\n\t\t};\n\t}, [] );\n\n\tconst options = useMemo(\n\t\t() =>\n\t\t\tObject.entries( {\n\t\t\t\t...availableTemplates,\n\t\t\t\t...Object.fromEntries(\n\t\t\t\t\t( fetchedTemplates ?? [] ).map( ( { slug, title } ) => [\n\t\t\t\t\t\tslug,\n\t\t\t\t\t\ttitle.rendered,\n\t\t\t\t\t] )\n\t\t\t\t),\n\t\t\t} ).map( ( [ slug, title ] ) => ( { value: slug, label: title } ) ),\n\t\t[ availableTemplates, fetchedTemplates ]\n\t);\n\n\tconst selectedOption =\n\t\toptions.find( ( option ) => option.value === selectedTemplateSlug ) ??\n\t\toptions.find( ( option ) => ! option.value ); // The default option has '' value.\n\n\tconst { editPost } = useDispatch( editorStore );\n\tconst { __unstableSwitchToTemplateMode } = useDispatch( editPostStore );\n\n\tconst [ isCreateModalOpen, setIsCreateModalOpen ] = useState( false );\n\n\treturn (\n\t\t<div className=\"edit-post-post-template__form\">\n\t\t\t<InspectorPopoverHeader\n\t\t\t\ttitle={ __( 'Template' ) }\n\t\t\t\thelp={ __(\n\t\t\t\t\t'Templates define the way content is displayed when viewing your site.'\n\t\t\t\t) }\n\t\t\t\tactions={\n\t\t\t\t\tcanCreate\n\t\t\t\t\t\t? [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\ticon: addTemplate,\n\t\t\t\t\t\t\t\t\tlabel: __( 'Add template' ),\n\t\t\t\t\t\t\t\t\tonClick: () => setIsCreateModalOpen( true ),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t ]\n\t\t\t\t\t\t: []\n\t\t\t\t}\n\t\t\t\tonClose={ onClose }\n\t\t\t/>\n\t\t\t{ isPostsPage ? (\n\t\t\t\t<Notice\n\t\t\t\t\tclassName=\"edit-post-post-template__notice\"\n\t\t\t\t\tstatus=\"warning\"\n\t\t\t\t\tisDismissible={ false }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'The posts page template cannot be changed.' ) }\n\t\t\t\t</Notice>\n\t\t\t) : (\n\t\t\t\t<SelectControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\thideLabelFromVision\n\t\t\t\t\tlabel={ __( 'Template' ) }\n\t\t\t\t\tvalue={ selectedOption?.value ?? '' }\n\t\t\t\t\toptions={ options }\n\t\t\t\t\tonChange={ ( slug ) =>\n\t\t\t\t\t\teditPost( { template: slug || '' } )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ canEdit && (\n\t\t\t\t<p>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"link\"\n\t\t\t\t\t\tonClick={ () => __unstableSwitchToTemplateMode() }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Edit template' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</p>\n\t\t\t) }\n\t\t\t{ isCreateModalOpen && (\n\t\t\t\t<PostTemplateCreateModal\n\t\t\t\t\tonClose={ () => setIsCreateModalOpen( false ) }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AACA,IAAAO,SAAA,GAAAP,OAAA;AAKA,IAAAQ,MAAA,GAAAR,OAAA;AACA,IAAAS,YAAA,GAAAC,sBAAA,CAAAV,OAAA;AAhBA;AAC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O,EAAGA,CAAA,KAAMiD,oBAAoB,CAAE,KAAM;EAAG,CAC/C,CAEE,CAAC;AAER"}
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = PostTemplate;
|
|
8
|
+
var _react = require("react");
|
|
8
9
|
var _element = require("@wordpress/element");
|
|
9
10
|
var _components = require("@wordpress/components");
|
|
10
11
|
var _i18n = require("@wordpress/i18n");
|
|
@@ -51,10 +52,10 @@ function PostTemplate() {
|
|
|
51
52
|
if (!isVisible) {
|
|
52
53
|
return null;
|
|
53
54
|
}
|
|
54
|
-
return (0,
|
|
55
|
+
return (0, _react.createElement)(_components.PanelRow, {
|
|
55
56
|
className: "edit-post-post-template",
|
|
56
57
|
ref: setPopoverAnchor
|
|
57
|
-
}, (0,
|
|
58
|
+
}, (0, _react.createElement)("span", null, (0, _i18n.__)('Template')), (0, _react.createElement)(_components.Dropdown, {
|
|
58
59
|
popoverProps: popoverProps,
|
|
59
60
|
className: "edit-post-post-template__dropdown",
|
|
60
61
|
contentClassName: "edit-post-post-template__dialog",
|
|
@@ -62,13 +63,13 @@ function PostTemplate() {
|
|
|
62
63
|
renderToggle: ({
|
|
63
64
|
isOpen,
|
|
64
65
|
onToggle
|
|
65
|
-
}) => (0,
|
|
66
|
+
}) => (0, _react.createElement)(PostTemplateToggle, {
|
|
66
67
|
isOpen: isOpen,
|
|
67
68
|
onClick: onToggle
|
|
68
69
|
}),
|
|
69
70
|
renderContent: ({
|
|
70
71
|
onClose
|
|
71
|
-
}) => (0,
|
|
72
|
+
}) => (0, _react.createElement)(_form.default, {
|
|
72
73
|
onClose: onClose
|
|
73
74
|
})
|
|
74
75
|
}));
|
|
@@ -89,7 +90,7 @@ function PostTemplateToggle({
|
|
|
89
90
|
const template = select(_coreData.store).canUser('create', 'templates') && select(_store.store).getEditedPostTemplate();
|
|
90
91
|
return template?.title || template?.slug || availableTemplates?.[templateSlug];
|
|
91
92
|
}, []);
|
|
92
|
-
return (0,
|
|
93
|
+
return (0, _react.createElement)(_components.Button, {
|
|
93
94
|
className: "edit-post-post-template__toggle",
|
|
94
95
|
variant: "tertiary",
|
|
95
96
|
"aria-expanded": isOpen,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_components","_i18n","_data","_editor","_coreData","_form","_interopRequireDefault","_store","PostTemplate","popoverAnchor","setPopoverAnchor","useState","popoverProps","useMemo","anchor","placement","isVisible","useSelect","select","_select$canUser","postTypeSlug","editorStore","getCurrentPostType","postType","coreStore","getPostType","viewable","settings","getEditorSettings","hasTemplates","availableTemplates","Object","keys","length","supportsTemplateMode","canCreateTemplates","canUser","createElement","PanelRow","className","ref","__","Dropdown","contentClassName","focusOnMount","renderToggle","isOpen","onToggle","PostTemplateToggle","onClick","renderContent","onClose","default","templateTitle","templateSlug","getEditedPostAttribute","template","editPostStore","getEditedPostTemplate","title","slug","Button","variant","sprintf"],"sources":["@wordpress/edit-post/src/components/sidebar/post-template/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState, useMemo } from '@wordpress/element';\nimport { PanelRow, Dropdown, Button } from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport PostTemplateForm from './form';\nimport { store as editPostStore } from '../../../store';\n\nexport default function PostTemplate() {\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the popover's anchor updates.\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState( null );\n\t// Memoize popoverProps to avoid returning a new object every time.\n\tconst popoverProps = useMemo(\n\t\t() => ( { anchor: popoverAnchor, placement: 'bottom-end' } ),\n\t\t[ popoverAnchor ]\n\t);\n\n\tconst isVisible = useSelect( ( select ) => {\n\t\tconst postTypeSlug = select( editorStore ).getCurrentPostType();\n\t\tconst postType = select( coreStore ).getPostType( postTypeSlug );\n\t\tif ( ! postType?.viewable ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst settings = select( editorStore ).getEditorSettings();\n\t\tconst hasTemplates =\n\t\t\t!! settings.availableTemplates &&\n\t\t\tObject.keys( settings.availableTemplates ).length > 0;\n\t\tif ( hasTemplates ) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif ( ! settings.supportsTemplateMode ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst canCreateTemplates =\n\t\t\tselect( coreStore ).canUser( 'create', 'templates' ) ?? false;\n\t\treturn canCreateTemplates;\n\t}, [] );\n\n\tif ( ! isVisible ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PanelRow className=\"edit-post-post-template\" ref={ setPopoverAnchor }>\n\t\t\t<span>{ __( 'Template' ) }</span>\n\t\t\t<Dropdown\n\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\tclassName=\"edit-post-post-template__dropdown\"\n\t\t\t\tcontentClassName=\"edit-post-post-template__dialog\"\n\t\t\t\tfocusOnMount\n\t\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t\t<PostTemplateToggle\n\t\t\t\t\t\tisOpen={ isOpen }\n\t\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\trenderContent={ ( { onClose } ) => (\n\t\t\t\t\t<PostTemplateForm onClose={ onClose } />\n\t\t\t\t) }\n\t\t\t/>\n\t\t</PanelRow>\n\t);\n}\n\nfunction PostTemplateToggle( { isOpen, onClick } ) {\n\tconst templateTitle = useSelect( ( select ) => {\n\t\tconst templateSlug =\n\t\t\tselect( editorStore ).getEditedPostAttribute( 'template' );\n\n\t\tconst { supportsTemplateMode, availableTemplates } =\n\t\t\tselect( editorStore ).getEditorSettings();\n\t\tif ( ! supportsTemplateMode && availableTemplates[ templateSlug ] ) {\n\t\t\treturn availableTemplates[ templateSlug ];\n\t\t}\n\t\tconst template =\n\t\t\tselect( coreStore ).canUser( 'create', 'templates' ) &&\n\t\t\tselect( editPostStore ).getEditedPostTemplate();\n\t\treturn (\n\t\t\ttemplate?.title ||\n\t\t\ttemplate?.slug ||\n\t\t\tavailableTemplates?.[ templateSlug ]\n\t\t);\n\t}, [] );\n\n\treturn (\n\t\t<Button\n\t\t\tclassName=\"edit-post-post-template__toggle\"\n\t\t\tvariant=\"tertiary\"\n\t\t\taria-expanded={ isOpen }\n\t\t\taria-label={\n\t\t\t\ttemplateTitle\n\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t// translators: %s: Name of the currently selected template.\n\t\t\t\t\t\t\t__( 'Select template: %s' ),\n\t\t\t\t\t\t\ttemplateTitle\n\t\t\t\t\t )\n\t\t\t\t\t: __( 'Select template' )\n\t\t\t}\n\t\t\tonClick={ onClick }\n\t\t>\n\t\t\t{ templateTitle ?? __( 'Default template' ) }\n\t\t</Button>\n\t);\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_element","require","_components","_i18n","_data","_editor","_coreData","_form","_interopRequireDefault","_store","PostTemplate","popoverAnchor","setPopoverAnchor","useState","popoverProps","useMemo","anchor","placement","isVisible","useSelect","select","_select$canUser","postTypeSlug","editorStore","getCurrentPostType","postType","coreStore","getPostType","viewable","settings","getEditorSettings","hasTemplates","availableTemplates","Object","keys","length","supportsTemplateMode","canCreateTemplates","canUser","_react","createElement","PanelRow","className","ref","__","Dropdown","contentClassName","focusOnMount","renderToggle","isOpen","onToggle","PostTemplateToggle","onClick","renderContent","onClose","default","templateTitle","templateSlug","getEditedPostAttribute","template","editPostStore","getEditedPostTemplate","title","slug","Button","variant","sprintf"],"sources":["@wordpress/edit-post/src/components/sidebar/post-template/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState, useMemo } from '@wordpress/element';\nimport { PanelRow, Dropdown, Button } from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport PostTemplateForm from './form';\nimport { store as editPostStore } from '../../../store';\n\nexport default function PostTemplate() {\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the popover's anchor updates.\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState( null );\n\t// Memoize popoverProps to avoid returning a new object every time.\n\tconst popoverProps = useMemo(\n\t\t() => ( { anchor: popoverAnchor, placement: 'bottom-end' } ),\n\t\t[ popoverAnchor ]\n\t);\n\n\tconst isVisible = useSelect( ( select ) => {\n\t\tconst postTypeSlug = select( editorStore ).getCurrentPostType();\n\t\tconst postType = select( coreStore ).getPostType( postTypeSlug );\n\t\tif ( ! postType?.viewable ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst settings = select( editorStore ).getEditorSettings();\n\t\tconst hasTemplates =\n\t\t\t!! settings.availableTemplates &&\n\t\t\tObject.keys( settings.availableTemplates ).length > 0;\n\t\tif ( hasTemplates ) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif ( ! settings.supportsTemplateMode ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst canCreateTemplates =\n\t\t\tselect( coreStore ).canUser( 'create', 'templates' ) ?? false;\n\t\treturn canCreateTemplates;\n\t}, [] );\n\n\tif ( ! isVisible ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PanelRow className=\"edit-post-post-template\" ref={ setPopoverAnchor }>\n\t\t\t<span>{ __( 'Template' ) }</span>\n\t\t\t<Dropdown\n\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\tclassName=\"edit-post-post-template__dropdown\"\n\t\t\t\tcontentClassName=\"edit-post-post-template__dialog\"\n\t\t\t\tfocusOnMount\n\t\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t\t<PostTemplateToggle\n\t\t\t\t\t\tisOpen={ isOpen }\n\t\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\trenderContent={ ( { onClose } ) => (\n\t\t\t\t\t<PostTemplateForm onClose={ onClose } />\n\t\t\t\t) }\n\t\t\t/>\n\t\t</PanelRow>\n\t);\n}\n\nfunction PostTemplateToggle( { isOpen, onClick } ) {\n\tconst templateTitle = useSelect( ( select ) => {\n\t\tconst templateSlug =\n\t\t\tselect( editorStore ).getEditedPostAttribute( 'template' );\n\n\t\tconst { supportsTemplateMode, availableTemplates } =\n\t\t\tselect( editorStore ).getEditorSettings();\n\t\tif ( ! supportsTemplateMode && availableTemplates[ templateSlug ] ) {\n\t\t\treturn availableTemplates[ templateSlug ];\n\t\t}\n\t\tconst template =\n\t\t\tselect( coreStore ).canUser( 'create', 'templates' ) &&\n\t\t\tselect( editPostStore ).getEditedPostTemplate();\n\t\treturn (\n\t\t\ttemplate?.title ||\n\t\t\ttemplate?.slug ||\n\t\t\tavailableTemplates?.[ templateSlug ]\n\t\t);\n\t}, [] );\n\n\treturn (\n\t\t<Button\n\t\t\tclassName=\"edit-post-post-template__toggle\"\n\t\t\tvariant=\"tertiary\"\n\t\t\taria-expanded={ isOpen }\n\t\t\taria-label={\n\t\t\t\ttemplateTitle\n\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t// translators: %s: Name of the currently selected template.\n\t\t\t\t\t\t\t__( 'Select template: %s' ),\n\t\t\t\t\t\t\ttemplateTitle\n\t\t\t\t\t )\n\t\t\t\t\t: __( 'Select template' )\n\t\t\t}\n\t\t\tonClick={ onClick }\n\t\t>\n\t\t\t{ templateTitle ?? __( 'Default template' ) }\n\t\t</Button>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AAKA,IAAAM,KAAA,GAAAC,sBAAA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AM,CAAEM,eAAU,CAAC,CAACY,OAAO,CAAE,QAAQ,EAAE,WAAY,CAAC,IACpDlB,MAAM,CAAEwC,YAAc,CAAC,CAACC,qBAAqB,CAAC,CAAC;IAChD,OACCF,QAAQ,EAAEG,KAAK,IACfH,QAAQ,EAAEI,IAAI,IACd/B,kBAAkB,GAAIyB,YAAY,CAAE;EAEtC,CAAC,EAAE,EAAG,CAAC;EAEP,OACC,IAAAlB,MAAA,CAAAC,aAAA,EAACtC,WAAA,CAAA8D,MAAM;IACNtB,SAAS,EAAC,iCAAiC;IAC3CuB,OAAO,EAAC,UAAU;IAClB,iBAAgBhB,MAAQ;IACxB,cACCO,aAAa,GACV,IAAAU,aAAO;IACP;IACA,IAAAtB,QAAE,EAAE,qBAAsB,CAAC,EAC3BY,aACA,CAAC,GACD,IAAAZ,QAAE,EAAE,iBAAkB,CACzB;IACDQ,OAAO,EAAGA;EAAS,GAEjBI,aAAa,aAAbA,aAAa,cAAbA,aAAa,GAAI,IAAAZ,QAAE,EAAE,kBAAmB,CACnC,CAAC;AAEX"}
|
|
@@ -4,13 +4,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = PostTrash;
|
|
7
|
-
var
|
|
7
|
+
var _react = require("react");
|
|
8
8
|
var _editor = require("@wordpress/editor");
|
|
9
9
|
/**
|
|
10
10
|
* WordPress dependencies
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
function PostTrash() {
|
|
14
|
-
return (0,
|
|
14
|
+
return (0, _react.createElement)(_editor.PostTrashCheck, null, (0, _react.createElement)(_editor.PostTrash, null));
|
|
15
15
|
}
|
|
16
16
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_editor","require","PostTrash","
|
|
1
|
+
{"version":3,"names":["_editor","require","PostTrash","_react","createElement","PostTrashCheck"],"sources":["@wordpress/edit-post/src/components/sidebar/post-trash/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { PostTrash as PostTrashLink, PostTrashCheck } from '@wordpress/editor';\n\nexport default function PostTrash() {\n\treturn (\n\t\t<PostTrashCheck>\n\t\t\t<PostTrashLink />\n\t\t</PostTrashCheck>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGe,SAASC,SAASA,CAAA,EAAG;EACnC,OACC,IAAAC,MAAA,CAAAC,aAAA,EAACJ,OAAA,CAAAK,cAAc,QACd,IAAAF,MAAA,CAAAC,aAAA,EAACJ,OAAA,CAAAE,SAAa,MAAE,CACD,CAAC;AAEnB"}
|
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = PostURL;
|
|
7
|
+
var _react = require("react");
|
|
7
8
|
var _element = require("@wordpress/element");
|
|
8
9
|
var _components = require("@wordpress/components");
|
|
9
10
|
var _i18n = require("@wordpress/i18n");
|
|
@@ -21,10 +22,10 @@ function PostURL() {
|
|
|
21
22
|
anchor: popoverAnchor,
|
|
22
23
|
placement: 'bottom-end'
|
|
23
24
|
}), [popoverAnchor]);
|
|
24
|
-
return (0,
|
|
25
|
+
return (0, _react.createElement)(_editor.PostURLCheck, null, (0, _react.createElement)(_components.PanelRow, {
|
|
25
26
|
className: "edit-post-post-url",
|
|
26
27
|
ref: setPopoverAnchor
|
|
27
|
-
}, (0,
|
|
28
|
+
}, (0, _react.createElement)("span", null, (0, _i18n.__)('URL')), (0, _react.createElement)(_components.Dropdown, {
|
|
28
29
|
popoverProps: popoverProps,
|
|
29
30
|
className: "edit-post-post-url__dropdown",
|
|
30
31
|
contentClassName: "edit-post-post-url__dialog",
|
|
@@ -32,13 +33,13 @@ function PostURL() {
|
|
|
32
33
|
renderToggle: ({
|
|
33
34
|
isOpen,
|
|
34
35
|
onToggle
|
|
35
|
-
}) => (0,
|
|
36
|
+
}) => (0, _react.createElement)(PostURLToggle, {
|
|
36
37
|
isOpen: isOpen,
|
|
37
38
|
onClick: onToggle
|
|
38
39
|
}),
|
|
39
40
|
renderContent: ({
|
|
40
41
|
onClose
|
|
41
|
-
}) => (0,
|
|
42
|
+
}) => (0, _react.createElement)(_editor.PostURL, {
|
|
42
43
|
onClose: onClose
|
|
43
44
|
})
|
|
44
45
|
})));
|
|
@@ -48,7 +49,7 @@ function PostURLToggle({
|
|
|
48
49
|
onClick
|
|
49
50
|
}) {
|
|
50
51
|
const label = (0, _editor.usePostURLLabel)();
|
|
51
|
-
return (0,
|
|
52
|
+
return (0, _react.createElement)(_components.Button, {
|
|
52
53
|
className: "edit-post-post-url__toggle",
|
|
53
54
|
variant: "tertiary",
|
|
54
55
|
"aria-expanded": isOpen
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_components","_i18n","_editor","PostURL","popoverAnchor","setPopoverAnchor","useState","popoverProps","useMemo","anchor","placement","createElement","PostURLCheck","PanelRow","className","ref","__","Dropdown","contentClassName","focusOnMount","renderToggle","isOpen","onToggle","PostURLToggle","onClick","renderContent","onClose","label","usePostURLLabel","Button","variant","sprintf"],"sources":["@wordpress/edit-post/src/components/sidebar/post-url/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo, useState } from '@wordpress/element';\nimport { PanelRow, Dropdown, Button } from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\tPostURLCheck,\n\tPostURL as PostURLForm,\n\tusePostURLLabel,\n} from '@wordpress/editor';\n\nexport default function PostURL() {\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the popover's anchor updates.\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState( null );\n\t// Memoize popoverProps to avoid returning a new object every time.\n\tconst popoverProps = useMemo(\n\t\t() => ( { anchor: popoverAnchor, placement: 'bottom-end' } ),\n\t\t[ popoverAnchor ]\n\t);\n\n\treturn (\n\t\t<PostURLCheck>\n\t\t\t<PanelRow className=\"edit-post-post-url\" ref={ setPopoverAnchor }>\n\t\t\t\t<span>{ __( 'URL' ) }</span>\n\t\t\t\t<Dropdown\n\t\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\t\tclassName=\"edit-post-post-url__dropdown\"\n\t\t\t\t\tcontentClassName=\"edit-post-post-url__dialog\"\n\t\t\t\t\tfocusOnMount\n\t\t\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t\t\t<PostURLToggle isOpen={ isOpen } onClick={ onToggle } />\n\t\t\t\t\t) }\n\t\t\t\t\trenderContent={ ( { onClose } ) => (\n\t\t\t\t\t\t<PostURLForm onClose={ onClose } />\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t</PanelRow>\n\t\t</PostURLCheck>\n\t);\n}\n\nfunction PostURLToggle( { isOpen, onClick } ) {\n\tconst label = usePostURLLabel();\n\treturn (\n\t\t<Button\n\t\t\tclassName=\"edit-post-post-url__toggle\"\n\t\t\tvariant=\"tertiary\"\n\t\t\taria-expanded={ isOpen }\n\t\t\t// translators: %s: Current post URL.\n\t\t\taria-label={ sprintf( __( 'Change URL: %s' ), label ) }\n\t\t\tonClick={ onClick }\n\t\t>\n\t\t\t{ label }\n\t\t</Button>\n\t);\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_element","require","_components","_i18n","_editor","PostURL","popoverAnchor","setPopoverAnchor","useState","popoverProps","useMemo","anchor","placement","_react","createElement","PostURLCheck","PanelRow","className","ref","__","Dropdown","contentClassName","focusOnMount","renderToggle","isOpen","onToggle","PostURLToggle","onClick","renderContent","onClose","label","usePostURLLabel","Button","variant","sprintf"],"sources":["@wordpress/edit-post/src/components/sidebar/post-url/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo, useState } from '@wordpress/element';\nimport { PanelRow, Dropdown, Button } from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\tPostURLCheck,\n\tPostURL as PostURLForm,\n\tusePostURLLabel,\n} from '@wordpress/editor';\n\nexport default function PostURL() {\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the popover's anchor updates.\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState( null );\n\t// Memoize popoverProps to avoid returning a new object every time.\n\tconst popoverProps = useMemo(\n\t\t() => ( { anchor: popoverAnchor, placement: 'bottom-end' } ),\n\t\t[ popoverAnchor ]\n\t);\n\n\treturn (\n\t\t<PostURLCheck>\n\t\t\t<PanelRow className=\"edit-post-post-url\" ref={ setPopoverAnchor }>\n\t\t\t\t<span>{ __( 'URL' ) }</span>\n\t\t\t\t<Dropdown\n\t\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\t\tclassName=\"edit-post-post-url__dropdown\"\n\t\t\t\t\tcontentClassName=\"edit-post-post-url__dialog\"\n\t\t\t\t\tfocusOnMount\n\t\t\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t\t\t<PostURLToggle isOpen={ isOpen } onClick={ onToggle } />\n\t\t\t\t\t) }\n\t\t\t\t\trenderContent={ ( { onClose } ) => (\n\t\t\t\t\t\t<PostURLForm onClose={ onClose } />\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t</PanelRow>\n\t\t</PostURLCheck>\n\t);\n}\n\nfunction PostURLToggle( { isOpen, onClick } ) {\n\tconst label = usePostURLLabel();\n\treturn (\n\t\t<Button\n\t\t\tclassName=\"edit-post-post-url__toggle\"\n\t\t\tvariant=\"tertiary\"\n\t\t\taria-expanded={ isOpen }\n\t\t\t// translators: %s: Current post URL.\n\t\t\taria-label={ sprintf( __( 'Change URL: %s' ), label ) }\n\t\t\tonClick={ onClick }\n\t\t>\n\t\t\t{ label }\n\t\t</Button>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AANA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AAM;IACNf,SAAS,EAAC,4BAA4B;IACtCgB,OAAO,EAAC,UAAU;IAClB,iBAAgBT;IAChB;IAAA;IACA,cAAa,IAAAU,aAAO,EAAE,IAAAf,QAAE,EAAE,gBAAiB,CAAC,EAAEW,KAAM,CAAG;IACvDH,OAAO,EAAGA;EAAS,GAEjBG,KACK,CAAC;AAEX"}
|
|
@@ -5,10 +5,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.PostVisibility = PostVisibility;
|
|
7
7
|
exports.default = void 0;
|
|
8
|
-
var
|
|
8
|
+
var _react = require("react");
|
|
9
9
|
var _i18n = require("@wordpress/i18n");
|
|
10
10
|
var _components = require("@wordpress/components");
|
|
11
11
|
var _editor = require("@wordpress/editor");
|
|
12
|
+
var _element = require("@wordpress/element");
|
|
12
13
|
/**
|
|
13
14
|
* WordPress dependencies
|
|
14
15
|
*/
|
|
@@ -24,26 +25,26 @@ function PostVisibility() {
|
|
|
24
25
|
anchor: popoverAnchor,
|
|
25
26
|
placement: 'bottom-end'
|
|
26
27
|
}), [popoverAnchor]);
|
|
27
|
-
return (0,
|
|
28
|
+
return (0, _react.createElement)(_editor.PostVisibilityCheck, {
|
|
28
29
|
render: ({
|
|
29
30
|
canEdit
|
|
30
|
-
}) => (0,
|
|
31
|
+
}) => (0, _react.createElement)(_components.PanelRow, {
|
|
31
32
|
ref: setPopoverAnchor,
|
|
32
33
|
className: "edit-post-post-visibility"
|
|
33
|
-
}, (0,
|
|
34
|
+
}, (0, _react.createElement)("span", null, (0, _i18n.__)('Visibility')), !canEdit && (0, _react.createElement)("span", null, (0, _react.createElement)(_editor.PostVisibilityLabel, null)), canEdit && (0, _react.createElement)(_components.Dropdown, {
|
|
34
35
|
contentClassName: "edit-post-post-visibility__dialog",
|
|
35
36
|
popoverProps: popoverProps,
|
|
36
37
|
focusOnMount: true,
|
|
37
38
|
renderToggle: ({
|
|
38
39
|
isOpen,
|
|
39
40
|
onToggle
|
|
40
|
-
}) => (0,
|
|
41
|
+
}) => (0, _react.createElement)(PostVisibilityToggle, {
|
|
41
42
|
isOpen: isOpen,
|
|
42
43
|
onClick: onToggle
|
|
43
44
|
}),
|
|
44
45
|
renderContent: ({
|
|
45
46
|
onClose
|
|
46
|
-
}) => (0,
|
|
47
|
+
}) => (0, _react.createElement)(_editor.PostVisibility, {
|
|
47
48
|
onClose: onClose
|
|
48
49
|
})
|
|
49
50
|
}))
|
|
@@ -54,7 +55,7 @@ function PostVisibilityToggle({
|
|
|
54
55
|
onClick
|
|
55
56
|
}) {
|
|
56
57
|
const label = (0, _editor.usePostVisibilityLabel)();
|
|
57
|
-
return (0,
|
|
58
|
+
return (0, _react.createElement)(_components.Button, {
|
|
58
59
|
className: "edit-post-post-visibility__toggle",
|
|
59
60
|
variant: "tertiary",
|
|
60
61
|
"aria-expanded": isOpen
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_i18n","require","_components","_editor","_element","PostVisibility","popoverAnchor","setPopoverAnchor","useState","popoverProps","useMemo","anchor","placement","_react","createElement","PostVisibilityCheck","render","canEdit","PanelRow","ref","className","__","PostVisibilityLabel","Dropdown","contentClassName","focusOnMount","renderToggle","isOpen","onToggle","PostVisibilityToggle","onClick","renderContent","onClose","label","usePostVisibilityLabel","Button","variant","sprintf","_default","exports","default"],"sources":["@wordpress/edit-post/src/components/sidebar/post-visibility/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { PanelRow, Dropdown, Button } from '@wordpress/components';\nimport {\n\tPostVisibility as PostVisibilityForm,\n\tPostVisibilityLabel,\n\tPostVisibilityCheck,\n\tusePostVisibilityLabel,\n} from '@wordpress/editor';\nimport { useMemo, useState } from '@wordpress/element';\n\nexport function PostVisibility() {\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the popover's anchor updates.\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState( null );\n\t// Memoize popoverProps to avoid returning a new object every time.\n\tconst popoverProps = useMemo(\n\t\t() => ( {\n\t\t\t// Anchor the popover to the middle of the entire row so that it doesn't\n\t\t\t// move around when the label changes.\n\t\t\tanchor: popoverAnchor,\n\t\t\tplacement: 'bottom-end',\n\t\t} ),\n\t\t[ popoverAnchor ]\n\t);\n\n\treturn (\n\t\t<PostVisibilityCheck\n\t\t\trender={ ( { canEdit } ) => (\n\t\t\t\t<PanelRow\n\t\t\t\t\tref={ setPopoverAnchor }\n\t\t\t\t\tclassName=\"edit-post-post-visibility\"\n\t\t\t\t>\n\t\t\t\t\t<span>{ __( 'Visibility' ) }</span>\n\t\t\t\t\t{ ! canEdit && (\n\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t<PostVisibilityLabel />\n\t\t\t\t\t\t</span>\n\t\t\t\t\t) }\n\t\t\t\t\t{ canEdit && (\n\t\t\t\t\t\t<Dropdown\n\t\t\t\t\t\t\tcontentClassName=\"edit-post-post-visibility__dialog\"\n\t\t\t\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\t\t\t\tfocusOnMount\n\t\t\t\t\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t\t\t\t\t<PostVisibilityToggle\n\t\t\t\t\t\t\t\t\tisOpen={ isOpen }\n\t\t\t\t\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\trenderContent={ ( { onClose } ) => (\n\t\t\t\t\t\t\t\t<PostVisibilityForm onClose={ onClose } />\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</PanelRow>\n\t\t\t) }\n\t\t/>\n\t);\n}\n\nfunction PostVisibilityToggle( { isOpen, onClick } ) {\n\tconst label = usePostVisibilityLabel();\n\treturn (\n\t\t<Button\n\t\t\tclassName=\"edit-post-post-visibility__toggle\"\n\t\t\tvariant=\"tertiary\"\n\t\t\taria-expanded={ isOpen }\n\t\t\t// translators: %s: Current post visibility.\n\t\t\taria-label={ sprintf( __( 'Select visibility: %s' ), label ) }\n\t\t\tonClick={ onClick }\n\t\t>\n\t\t\t{ label }\n\t\t</Button>\n\t);\n}\n\nexport default PostVisibility;\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAMA,IAAAG,QAAA,GAAAH,OAAA;AAXA;AACA;AACA;;AAWO,SAASI,cAAcA,CAAA,EAAG;EAChC;EACA;EACA,MAAM,CAAEC,aAAa,EAAEC,gBAAgB,CAAE,GAAG,IAAAC,iBAAQ,EAAE,IAAK,CAAC;EAC5D;EACA,MAAMC,YAAY,GAAG,IAAAC,gBAAO,EAC3B,OAAQ;IACP;IACA;IACAC,MAAM,EAAEL,aAAa;IACrBM,SAAS,EAAE;EACZ,CAAC,CAAE,EACH,CAAEN,aAAa,CAChB,CAAC;EAED,OACC,IAAAO,MAAA,CAAAC,aAAA,EAACX,OAAA,CAAAY,mBAAmB;IACnBC,MAAM,EAAGA,CAAE;MAAEC;IAAQ,CAAC,KACrB,IAAAJ,MAAA,CAAAC,aAAA,EAACZ,WAAA,CAAAgB,QAAQ;MACRC,GAAG,EAAGZ,gBAAkB;MACxBa,SAAS,EAAC;IAA2B,GAErC,IAAAP,MAAA,CAAAC,aAAA,gBAAQ,IAAAO,QAAE,EAAE,YAAa,CAAS,CAAC,EACjC,CAAEJ,OAAO,IACV,IAAAJ,MAAA,CAAAC,aAAA,gBACC,IAAAD,MAAA,CAAAC,aAAA,EAACX,OAAA,CAAAmB,mBAAmB,MAAE,CACjB,CACN,EACCL,OAAO,IACR,IAAAJ,MAAA,CAAAC,aAAA,EAACZ,WAAA,CAAAqB,QAAQ;MACRC,gBAAgB,EAAC,mCAAmC;MACpDf,YAAY,EAAGA,YAAc;MAC7BgB,YAAY;MACZC,YAAY,EAAGA,CAAE;QAAEC,MAAM;QAAEC;MAAS,CAAC,KACpC,IAAAf,MAAA,CAAAC,aAAA,EAACe,oBAAoB;QACpBF,MAAM,EAAGA,MAAQ;QACjBG,OAAO,EAAGF;MAAU,CACpB,CACC;MACHG,aAAa,EAAGA,CAAE;QAAEC;MAAQ,CAAC,KAC5B,IAAAnB,MAAA,CAAAC,aAAA,EAACX,OAAA,CAAAE,cAAkB;QAAC2B,OAAO,EAAGA;MAAS,CAAE;IACvC,CACH,CAEO;EACR,CACH,CAAC;AAEJ;AAEA,SAASH,oBAAoBA,CAAE;EAAEF,MAAM;EAAEG;AAAQ,CAAC,EAAG;EACpD,MAAMG,KAAK,GAAG,IAAAC,8BAAsB,EAAC,CAAC;EACtC,OACC,IAAArB,MAAA,CAAAC,aAAA,EAACZ,WAAA,CAAAiC,MAAM;IACNf,SAAS,EAAC,mCAAmC;IAC7CgB,OAAO,EAAC,UAAU;IAClB,iBAAgBT;IAChB;IAAA;IACA,cAAa,IAAAU,aAAO,EAAE,IAAAhB,QAAE,EAAE,uBAAwB,CAAC,EAAEY,KAAM,CAAG;IAC9DH,OAAO,EAAGA;EAAS,GAEjBG,KACK,CAAC;AAEX;AAAC,IAAAK,QAAA,GAEcjC,cAAc;AAAAkC,OAAA,CAAAC,OAAA,GAAAF,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 _i18n = require("@wordpress/i18n");
|
|
10
10
|
var _data = require("@wordpress/data");
|
|
@@ -48,17 +48,17 @@ const SettingsHeader = ({
|
|
|
48
48
|
const [templateAriaLabel, templateActiveClass] = sidebarName === 'edit-post/document' ? [(0, _i18n.__)('Template (selected)'), 'is-active'] : [(0, _i18n.__)('Template'), ''];
|
|
49
49
|
|
|
50
50
|
/* Use a list so screen readers will announce how many tabs there are. */
|
|
51
|
-
return (0,
|
|
51
|
+
return (0, _react.createElement)("ul", null, !isTemplateMode && (0, _react.createElement)("li", null, (0, _react.createElement)(_components.Button, {
|
|
52
52
|
onClick: openDocumentSettings,
|
|
53
53
|
className: `edit-post-sidebar__panel-tab ${documentActiveClass}`,
|
|
54
54
|
"aria-label": documentAriaLabel,
|
|
55
55
|
"data-label": documentLabel
|
|
56
|
-
}, documentLabel)), isTemplateMode && (0,
|
|
56
|
+
}, documentLabel)), isTemplateMode && (0, _react.createElement)("li", null, (0, _react.createElement)(_components.Button, {
|
|
57
57
|
onClick: openDocumentSettings,
|
|
58
58
|
className: `edit-post-sidebar__panel-tab ${templateActiveClass}`,
|
|
59
59
|
"aria-label": templateAriaLabel,
|
|
60
60
|
"data-label": (0, _i18n.__)('Template')
|
|
61
|
-
}, (0, _i18n.__)('Template'))), (0,
|
|
61
|
+
}, (0, _i18n.__)('Template'))), (0, _react.createElement)("li", null, (0, _react.createElement)(_components.Button, {
|
|
62
62
|
onClick: openBlockSettings,
|
|
63
63
|
className: `edit-post-sidebar__panel-tab ${blockActiveClass}`,
|
|
64
64
|
"aria-label": blockAriaLabel
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","_i18n","_data","_editor","_store","SettingsHeader","sidebarName","openGeneralSidebar","useDispatch","editPostStore","openDocumentSettings","openBlockSettings","documentLabel","isTemplateMode","useSelect","select","postTypeLabel","editorStore","getPostTypeLabel","_x","isEditingTemplate","documentAriaLabel","documentActiveClass","sprintf","__","blockAriaLabel","blockActiveClass","templateAriaLabel","templateActiveClass","
|
|
1
|
+
{"version":3,"names":["_components","require","_i18n","_data","_editor","_store","SettingsHeader","sidebarName","openGeneralSidebar","useDispatch","editPostStore","openDocumentSettings","openBlockSettings","documentLabel","isTemplateMode","useSelect","select","postTypeLabel","editorStore","getPostTypeLabel","_x","isEditingTemplate","documentAriaLabel","documentActiveClass","sprintf","__","blockAriaLabel","blockActiveClass","templateAriaLabel","templateActiveClass","_react","createElement","Button","onClick","className","_default","exports","default"],"sources":["@wordpress/edit-post/src/components/sidebar/settings-header/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Button } from '@wordpress/components';\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../../store';\n\nconst SettingsHeader = ( { sidebarName } ) => {\n\tconst { openGeneralSidebar } = useDispatch( editPostStore );\n\tconst openDocumentSettings = () =>\n\t\topenGeneralSidebar( 'edit-post/document' );\n\tconst openBlockSettings = () => openGeneralSidebar( 'edit-post/block' );\n\n\tconst { documentLabel, isTemplateMode } = useSelect( ( select ) => {\n\t\tconst postTypeLabel = select( editorStore ).getPostTypeLabel();\n\n\t\treturn {\n\t\t\t// translators: Default label for the Document sidebar tab, not selected.\n\t\t\tdocumentLabel: postTypeLabel || _x( 'Document', 'noun' ),\n\t\t\tisTemplateMode: select( editPostStore ).isEditingTemplate(),\n\t\t};\n\t}, [] );\n\n\tconst [ documentAriaLabel, documentActiveClass ] =\n\t\tsidebarName === 'edit-post/document'\n\t\t\t? // translators: ARIA label for the Document sidebar tab, selected. %s: Document label.\n\t\t\t [ sprintf( __( '%s (selected)' ), documentLabel ), 'is-active' ]\n\t\t\t: [ documentLabel, '' ];\n\n\tconst [ blockAriaLabel, blockActiveClass ] =\n\t\tsidebarName === 'edit-post/block'\n\t\t\t? // translators: ARIA label for the Block Settings Sidebar tab, selected.\n\t\t\t [ __( 'Block (selected)' ), 'is-active' ]\n\t\t\t: // translators: ARIA label for the Block Settings Sidebar tab, not selected.\n\t\t\t [ __( 'Block' ), '' ];\n\n\tconst [ templateAriaLabel, templateActiveClass ] =\n\t\tsidebarName === 'edit-post/document'\n\t\t\t? [ __( 'Template (selected)' ), 'is-active' ]\n\t\t\t: [ __( 'Template' ), '' ];\n\n\t/* Use a list so screen readers will announce how many tabs there are. */\n\treturn (\n\t\t<ul>\n\t\t\t{ ! isTemplateMode && (\n\t\t\t\t<li>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tonClick={ openDocumentSettings }\n\t\t\t\t\t\tclassName={ `edit-post-sidebar__panel-tab ${ documentActiveClass }` }\n\t\t\t\t\t\taria-label={ documentAriaLabel }\n\t\t\t\t\t\tdata-label={ documentLabel }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ documentLabel }\n\t\t\t\t\t</Button>\n\t\t\t\t</li>\n\t\t\t) }\n\t\t\t{ isTemplateMode && (\n\t\t\t\t<li>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tonClick={ openDocumentSettings }\n\t\t\t\t\t\tclassName={ `edit-post-sidebar__panel-tab ${ templateActiveClass }` }\n\t\t\t\t\t\taria-label={ templateAriaLabel }\n\t\t\t\t\t\tdata-label={ __( 'Template' ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Template' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</li>\n\t\t\t) }\n\t\t\t<li>\n\t\t\t\t<Button\n\t\t\t\t\tonClick={ openBlockSettings }\n\t\t\t\t\tclassName={ `edit-post-sidebar__panel-tab ${ blockActiveClass }` }\n\t\t\t\t\taria-label={ blockAriaLabel }\n\t\t\t\t\t// translators: Data label for the Block Settings Sidebar tab.\n\t\t\t\t\tdata-label={ __( 'Block' ) }\n\t\t\t\t>\n\t\t\t\t\t{\n\t\t\t\t\t\t// translators: Text label for the Block Settings Sidebar tab.\n\t\t\t\t\t\t__( 'Block' )\n\t\t\t\t\t}\n\t\t\t\t</Button>\n\t\t\t</li>\n\t\t</ul>\n\t);\n};\n\nexport default SettingsHeader;\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AAKA,IAAAI,MAAA,GAAAJ,OAA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