@wordpress/edit-site 3.0.2 → 3.0.3
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/README.md +1 -1
- package/build/components/block-editor/back-button.js +60 -0
- package/build/components/block-editor/back-button.js.map +1 -0
- package/build/components/block-editor/index.js +18 -4
- package/build/components/block-editor/index.js.map +1 -1
- package/build/components/edit-template-part-menu-button/index.js +63 -0
- package/build/components/edit-template-part-menu-button/index.js.map +1 -0
- package/build/components/editor/global-styles-provider.js +1 -1
- package/build/components/editor/global-styles-provider.js.map +1 -1
- package/build/components/editor/index.js +7 -7
- package/build/components/editor/index.js.map +1 -1
- package/build/components/editor/utils.js +1 -1
- package/build/components/editor/utils.js.map +1 -1
- package/build/components/{sidebar → global-styles}/border-panel.js +0 -0
- package/build/components/global-styles/border-panel.js.map +1 -0
- package/build/components/{sidebar → global-styles}/color-palette-panel.js +4 -2
- package/build/components/global-styles/color-palette-panel.js.map +1 -0
- package/build/components/{sidebar → global-styles}/color-panel.js +7 -11
- package/build/components/global-styles/color-panel.js.map +1 -0
- package/build/components/global-styles/context-menu.js +58 -0
- package/build/components/global-styles/context-menu.js.map +1 -0
- package/build/components/{sidebar → global-styles}/dimensions-panel.js +6 -7
- package/build/components/global-styles/dimensions-panel.js.map +1 -0
- package/build/components/global-styles/header.js +54 -0
- package/build/components/global-styles/header.js.map +1 -0
- package/build/components/global-styles/index.js +89 -0
- package/build/components/global-styles/index.js.map +1 -0
- package/build/components/global-styles/navigation-button.js +43 -0
- package/build/components/global-styles/navigation-button.js.map +1 -0
- package/build/components/global-styles/palette.js +57 -0
- package/build/components/global-styles/palette.js.map +1 -0
- package/build/components/global-styles/preview.js +59 -0
- package/build/components/global-styles/preview.js.map +1 -0
- package/build/components/global-styles/screen-block-list.js +76 -0
- package/build/components/global-styles/screen-block-list.js.map +1 -0
- package/build/components/global-styles/screen-block.js +45 -0
- package/build/components/global-styles/screen-block.js.map +1 -0
- package/build/components/global-styles/screen-color-palette.js +48 -0
- package/build/components/global-styles/screen-color-palette.js.map +1 -0
- package/build/components/global-styles/screen-colors.js +51 -0
- package/build/components/global-styles/screen-colors.js.map +1 -0
- package/build/components/global-styles/screen-layout.js +60 -0
- package/build/components/global-styles/screen-layout.js.map +1 -0
- package/build/components/global-styles/screen-root.js +44 -0
- package/build/components/global-styles/screen-root.js.map +1 -0
- package/build/components/global-styles/screen-typography.js +50 -0
- package/build/components/global-styles/screen-typography.js.map +1 -0
- package/build/components/global-styles/subtitle.js +25 -0
- package/build/components/global-styles/subtitle.js.map +1 -0
- package/build/components/{sidebar → global-styles}/typography-panel.js +1 -3
- package/build/components/global-styles/typography-panel.js.map +1 -0
- package/build/components/header/plugin-more-menu-item/index.js +82 -0
- package/build/components/header/plugin-more-menu-item/index.js.map +1 -0
- package/build/components/header/plugin-sidebar-more-menu-item/index.js +75 -0
- package/build/components/header/plugin-sidebar-more-menu-item/index.js.map +1 -0
- package/build/components/header/undo-redo/redo.js +1 -1
- package/build/components/header/undo-redo/redo.js.map +1 -1
- package/build/components/header/undo-redo/undo.js +1 -1
- package/build/components/header/undo-redo/undo.js.map +1 -1
- package/build/components/keyboard-shortcuts/index.js +2 -10
- package/build/components/keyboard-shortcuts/index.js.map +1 -1
- package/build/components/navigation-sidebar/index.js +1 -1
- package/build/components/navigation-sidebar/index.js.map +1 -1
- package/build/components/navigation-sidebar/navigation-panel/constants.js +10 -10
- package/build/components/navigation-sidebar/navigation-panel/constants.js.map +1 -1
- package/build/components/save-button/index.js +1 -1
- package/build/components/save-button/index.js.map +1 -1
- package/build/components/secondary-sidebar/inserter-sidebar.js +2 -1
- package/build/components/secondary-sidebar/inserter-sidebar.js.map +1 -1
- package/build/components/sidebar/global-styles-sidebar.js +11 -161
- package/build/components/sidebar/global-styles-sidebar.js.map +1 -1
- package/build/components/sidebar/index.js +1 -6
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/sidebar/plugin-sidebar/index.js +95 -0
- package/build/components/sidebar/plugin-sidebar/index.js.map +1 -0
- package/build/components/template-details/index.js +12 -6
- package/build/components/template-details/index.js.map +1 -1
- package/build/components/template-details/template-areas.js +73 -0
- package/build/components/template-details/template-areas.js.map +1 -0
- package/build/components/template-part-converter/index.js +1 -1
- package/build/components/template-part-converter/index.js.map +1 -1
- package/build/components/url-query-controller/index.js +1 -1
- package/build/components/url-query-controller/index.js.map +1 -1
- package/build/index.js +24 -0
- package/build/index.js.map +1 -1
- package/build/store/actions.js +54 -1
- package/build/store/actions.js.map +1 -1
- package/build/store/constants.js +19 -1
- package/build/store/constants.js.map +1 -1
- package/build/store/reducer.js +16 -7
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +91 -9
- package/build/store/selectors.js.map +1 -1
- package/build-module/components/block-editor/back-button.js +48 -0
- package/build-module/components/block-editor/back-button.js.map +1 -0
- package/build-module/components/block-editor/index.js +15 -4
- package/build-module/components/block-editor/index.js.map +1 -1
- package/build-module/components/edit-template-part-menu-button/index.js +49 -0
- package/build-module/components/edit-template-part-menu-button/index.js.map +1 -0
- package/build-module/components/editor/global-styles-provider.js +1 -1
- package/build-module/components/editor/global-styles-provider.js.map +1 -1
- package/build-module/components/editor/index.js +4 -5
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/editor/utils.js +1 -1
- package/build-module/components/editor/utils.js.map +1 -1
- package/build-module/components/{sidebar → global-styles}/border-panel.js +0 -0
- package/build-module/components/global-styles/border-panel.js.map +1 -0
- package/build-module/components/{sidebar → global-styles}/color-palette-panel.js +4 -2
- package/build-module/components/global-styles/color-palette-panel.js.map +1 -0
- package/build-module/components/{sidebar → global-styles}/color-panel.js +8 -12
- package/build-module/components/global-styles/color-panel.js.map +1 -0
- package/build-module/components/global-styles/context-menu.js +41 -0
- package/build-module/components/global-styles/context-menu.js.map +1 -0
- package/build-module/components/{sidebar → global-styles}/dimensions-panel.js +6 -7
- package/build-module/components/global-styles/dimensions-panel.js.map +1 -0
- package/build-module/components/global-styles/header.js +41 -0
- package/build-module/components/global-styles/header.js.map +1 -0
- package/build-module/components/global-styles/index.js +70 -0
- package/build-module/components/global-styles/index.js.map +1 -0
- package/build-module/components/global-styles/navigation-button.js +31 -0
- package/build-module/components/global-styles/navigation-button.js.map +1 -0
- package/build-module/components/global-styles/palette.js +43 -0
- package/build-module/components/global-styles/palette.js.map +1 -0
- package/build-module/components/global-styles/preview.js +50 -0
- package/build-module/components/global-styles/preview.js.map +1 -0
- package/build-module/components/global-styles/screen-block-list.js +58 -0
- package/build-module/components/global-styles/screen-block-list.js.map +1 -0
- package/build-module/components/global-styles/screen-block.js +32 -0
- package/build-module/components/global-styles/screen-block.js.map +1 -0
- package/build-module/components/global-styles/screen-color-palette.js +35 -0
- package/build-module/components/global-styles/screen-color-palette.js.map +1 -0
- package/build-module/components/global-styles/screen-colors.js +38 -0
- package/build-module/components/global-styles/screen-colors.js.map +1 -0
- package/build-module/components/global-styles/screen-layout.js +44 -0
- package/build-module/components/global-styles/screen-layout.js.map +1 -0
- package/build-module/components/global-styles/screen-root.js +29 -0
- package/build-module/components/global-styles/screen-root.js.map +1 -0
- package/build-module/components/global-styles/screen-typography.js +37 -0
- package/build-module/components/global-styles/screen-typography.js.map +1 -0
- package/build-module/components/global-styles/subtitle.js +17 -0
- package/build-module/components/global-styles/subtitle.js.map +1 -0
- package/build-module/components/{sidebar → global-styles}/typography-panel.js +1 -2
- package/build-module/components/global-styles/typography-panel.js.map +1 -0
- package/build-module/components/header/plugin-more-menu-item/index.js +70 -0
- package/build-module/components/header/plugin-more-menu-item/index.js.map +1 -0
- package/build-module/components/header/plugin-sidebar-more-menu-item/index.js +64 -0
- package/build-module/components/header/plugin-sidebar-more-menu-item/index.js.map +1 -0
- package/build-module/components/header/undo-redo/redo.js +1 -1
- package/build-module/components/header/undo-redo/redo.js.map +1 -1
- package/build-module/components/header/undo-redo/undo.js +1 -1
- package/build-module/components/header/undo-redo/undo.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/index.js +3 -11
- package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
- package/build-module/components/navigation-sidebar/index.js +1 -1
- package/build-module/components/navigation-sidebar/index.js.map +1 -1
- package/build-module/components/navigation-sidebar/navigation-panel/constants.js +5 -3
- package/build-module/components/navigation-sidebar/navigation-panel/constants.js.map +1 -1
- package/build-module/components/save-button/index.js +1 -1
- package/build-module/components/save-button/index.js.map +1 -1
- package/build-module/components/secondary-sidebar/inserter-sidebar.js +2 -1
- package/build-module/components/secondary-sidebar/inserter-sidebar.js.map +1 -1
- package/build-module/components/sidebar/global-styles-sidebar.js +13 -159
- package/build-module/components/sidebar/global-styles-sidebar.js.map +1 -1
- package/build-module/components/sidebar/index.js +2 -7
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar/plugin-sidebar/index.js +84 -0
- package/build-module/components/sidebar/plugin-sidebar/index.js.map +1 -0
- package/build-module/components/template-details/index.js +13 -8
- package/build-module/components/template-details/index.js.map +1 -1
- package/build-module/components/template-details/template-areas.js +60 -0
- package/build-module/components/template-details/template-areas.js.map +1 -0
- package/build-module/components/template-part-converter/index.js +1 -1
- package/build-module/components/template-part-converter/index.js.map +1 -1
- package/build-module/components/url-query-controller/index.js +1 -1
- package/build-module/components/url-query-controller/index.js.map +1 -1
- package/build-module/index.js +3 -0
- package/build-module/index.js.map +1 -1
- package/build-module/store/actions.js +45 -1
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/constants.js +13 -0
- package/build-module/store/constants.js.map +1 -1
- package/build-module/store/reducer.js +16 -7
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +85 -9
- package/build-module/store/selectors.js.map +1 -1
- package/build-style/style-rtl.css +122 -17
- package/build-style/style.css +122 -17
- package/package.json +26 -26
- package/src/components/block-editor/back-button.js +44 -0
- package/src/components/block-editor/index.js +16 -1
- package/src/components/block-editor/style.scss +26 -0
- package/src/components/edit-template-part-menu-button/index.js +57 -0
- package/src/components/editor/global-styles-provider.js +1 -1
- package/src/components/editor/index.js +5 -8
- package/src/components/editor/utils.js +1 -0
- package/src/components/{sidebar → global-styles}/border-panel.js +0 -0
- package/src/components/{sidebar → global-styles}/color-palette-panel.js +13 -11
- package/src/components/{sidebar → global-styles}/color-panel.js +12 -17
- package/src/components/global-styles/context-menu.js +54 -0
- package/src/components/{sidebar → global-styles}/dimensions-panel.js +6 -10
- package/src/components/global-styles/header.js +50 -0
- package/src/components/global-styles/index.js +81 -0
- package/src/components/global-styles/navigation-button.js +35 -0
- package/src/components/global-styles/palette.js +67 -0
- package/src/components/global-styles/preview.js +41 -0
- package/src/components/global-styles/screen-block-list.js +59 -0
- package/src/components/global-styles/screen-block.js +28 -0
- package/src/components/global-styles/screen-color-palette.js +33 -0
- package/src/components/global-styles/screen-colors.js +36 -0
- package/src/components/global-styles/screen-layout.js +45 -0
- package/src/components/global-styles/screen-root.js +43 -0
- package/src/components/global-styles/screen-typography.js +33 -0
- package/src/components/global-styles/style.scss +35 -0
- package/src/components/global-styles/subtitle.js +10 -0
- package/src/components/{sidebar → global-styles}/typography-panel.js +1 -2
- package/src/components/header/plugin-more-menu-item/index.js +71 -0
- package/src/components/header/plugin-sidebar-more-menu-item/index.js +64 -0
- package/src/components/header/undo-redo/redo.js +4 -1
- package/src/components/header/undo-redo/undo.js +4 -1
- package/src/components/keyboard-shortcuts/index.js +25 -40
- package/src/components/navigation-sidebar/index.js +1 -1
- package/src/components/navigation-sidebar/navigation-panel/constants.js +9 -4
- package/src/components/navigation-sidebar/navigation-panel/style.scss +1 -0
- package/src/components/save-button/index.js +1 -1
- package/src/components/secondary-sidebar/inserter-sidebar.js +1 -0
- package/src/components/sidebar/global-styles-sidebar.js +14 -187
- package/src/components/sidebar/index.js +2 -7
- package/src/components/sidebar/plugin-sidebar/index.js +80 -0
- package/src/components/sidebar/style.scss +40 -0
- package/src/components/template-details/index.js +17 -7
- package/src/components/template-details/style.scss +36 -27
- package/src/components/template-details/template-areas.js +66 -0
- package/src/components/template-part-converter/index.js +1 -1
- package/src/components/url-query-controller/index.js +1 -1
- package/src/index.js +3 -0
- package/src/store/actions.js +53 -1
- package/src/store/constants.js +15 -0
- package/src/store/reducer.js +26 -12
- package/src/store/selectors.js +96 -9
- package/src/store/test/reducer.js +40 -23
- package/src/store/test/selectors.js +34 -3
- package/src/style.scss +1 -0
- package/build/components/sidebar/border-panel.js.map +0 -1
- package/build/components/sidebar/color-palette-panel.js.map +0 -1
- package/build/components/sidebar/color-panel.js.map +0 -1
- package/build/components/sidebar/dimensions-panel.js.map +0 -1
- package/build/components/sidebar/typography-panel.js.map +0 -1
- package/build-module/components/sidebar/border-panel.js.map +0 -1
- package/build-module/components/sidebar/color-palette-panel.js.map +0 -1
- package/build-module/components/sidebar/color-panel.js.map +0 -1
- package/build-module/components/sidebar/dimensions-panel.js.map +0 -1
- package/build-module/components/sidebar/typography-panel.js.map +0 -1
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = PluginSidebarMoreMenuItem;
|
|
9
|
+
|
|
10
|
+
var _element = require("@wordpress/element");
|
|
11
|
+
|
|
12
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
|
+
|
|
14
|
+
var _interface = require("@wordpress/interface");
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* WordPress dependencies
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Renders a menu item in `Plugins` group in `More Menu` drop down,
|
|
22
|
+
* and can be used to activate the corresponding `PluginSidebar` component.
|
|
23
|
+
* The text within the component appears as the menu item label.
|
|
24
|
+
*
|
|
25
|
+
* @param {Object} props Component props.
|
|
26
|
+
* @param {string} props.target A string identifying the target sidebar you wish to be activated by this menu item. Must be the same as the `name` prop you have given to that sidebar.
|
|
27
|
+
* @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered to the left of the menu item label.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```js
|
|
31
|
+
* // Using ES5 syntax
|
|
32
|
+
* var __ = wp.i18n.__;
|
|
33
|
+
* var PluginSidebarMoreMenuItem = wp.editSite.PluginSidebarMoreMenuItem;
|
|
34
|
+
* var moreIcon = wp.element.createElement( 'svg' ); //... svg element.
|
|
35
|
+
*
|
|
36
|
+
* function MySidebarMoreMenuItem() {
|
|
37
|
+
* return wp.element.createElement(
|
|
38
|
+
* PluginSidebarMoreMenuItem,
|
|
39
|
+
* {
|
|
40
|
+
* target: 'my-sidebar',
|
|
41
|
+
* icon: moreIcon,
|
|
42
|
+
* },
|
|
43
|
+
* __( 'My sidebar title' )
|
|
44
|
+
* )
|
|
45
|
+
* }
|
|
46
|
+
* ```
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```jsx
|
|
50
|
+
* // Using ESNext syntax
|
|
51
|
+
* import { __ } from '@wordpress/i18n';
|
|
52
|
+
* import { PluginSidebarMoreMenuItem } from '@wordpress/edit-site';
|
|
53
|
+
* import { more } from '@wordpress/icons';
|
|
54
|
+
*
|
|
55
|
+
* const MySidebarMoreMenuItem = () => (
|
|
56
|
+
* <PluginSidebarMoreMenuItem
|
|
57
|
+
* target="my-sidebar"
|
|
58
|
+
* icon={ more }
|
|
59
|
+
* >
|
|
60
|
+
* { __( 'My sidebar title' ) }
|
|
61
|
+
* </PluginSidebarMoreMenuItem>
|
|
62
|
+
* );
|
|
63
|
+
* ```
|
|
64
|
+
*
|
|
65
|
+
* @return {WPComponent} The component to be rendered.
|
|
66
|
+
*/
|
|
67
|
+
function PluginSidebarMoreMenuItem(props) {
|
|
68
|
+
return (0, _element.createElement)(_interface.ComplementaryAreaMoreMenuItem // Menu item is marked with unstable prop for backward compatibility.
|
|
69
|
+
// @see https://github.com/WordPress/gutenberg/issues/14457
|
|
70
|
+
, (0, _extends2.default)({
|
|
71
|
+
__unstableExplicitMenuItem: true,
|
|
72
|
+
scope: "core/edit-site"
|
|
73
|
+
}, props));
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/header/plugin-sidebar-more-menu-item/index.js"],"names":["PluginSidebarMoreMenuItem","props"],"mappings":";;;;;;;;;;;;;AAGA;;AAHA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEe,SAASA,yBAAT,CAAoCC,KAApC,EAA4C;AAC1D,SACC,4BAAC,wCAAD,CACC;AACA;AAFD;AAGC,IAAA,0BAA0B,MAH3B;AAIC,IAAA,KAAK,EAAC;AAJP,KAKMA,KALN,EADD;AASA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { ComplementaryAreaMoreMenuItem } from '@wordpress/interface';\n\n/**\n * Renders a menu item in `Plugins` group in `More Menu` drop down,\n * and can be used to activate the corresponding `PluginSidebar` component.\n * The text within the component appears as the menu item label.\n *\n * @param {Object} props Component props.\n * @param {string} props.target A string identifying the target sidebar you wish to be activated by this menu item. Must be the same as the `name` prop you have given to that sidebar.\n * @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered to the left of the menu item label.\n *\n * @example\n * ```js\n * // Using ES5 syntax\n * var __ = wp.i18n.__;\n * var PluginSidebarMoreMenuItem = wp.editSite.PluginSidebarMoreMenuItem;\n * var moreIcon = wp.element.createElement( 'svg' ); //... svg element.\n *\n * function MySidebarMoreMenuItem() {\n * \treturn wp.element.createElement(\n * \t\tPluginSidebarMoreMenuItem,\n * \t\t{\n * \t\t\ttarget: 'my-sidebar',\n * \t\t\ticon: moreIcon,\n * \t\t},\n * \t\t__( 'My sidebar title' )\n * \t)\n * }\n * ```\n *\n * @example\n * ```jsx\n * // Using ESNext syntax\n * import { __ } from '@wordpress/i18n';\n * import { PluginSidebarMoreMenuItem } from '@wordpress/edit-site';\n * import { more } from '@wordpress/icons';\n *\n * const MySidebarMoreMenuItem = () => (\n * \t<PluginSidebarMoreMenuItem\n * \t\ttarget=\"my-sidebar\"\n * \t\ticon={ more }\n * \t>\n * \t\t{ __( 'My sidebar title' ) }\n * \t</PluginSidebarMoreMenuItem>\n * );\n * ```\n *\n * @return {WPComponent} The component to be rendered.\n */\n\nexport default function PluginSidebarMoreMenuItem( props ) {\n\treturn (\n\t\t<ComplementaryAreaMoreMenuItem\n\t\t\t// Menu item is marked with unstable prop for backward compatibility.\n\t\t\t// @see https://github.com/WordPress/gutenberg/issues/14457\n\t\t\t__unstableExplicitMenuItem\n\t\t\tscope=\"core/edit-site\"\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n"]}
|
|
@@ -23,7 +23,7 @@ var _coreData = require("@wordpress/core-data");
|
|
|
23
23
|
* WordPress dependencies
|
|
24
24
|
*/
|
|
25
25
|
function RedoButton() {
|
|
26
|
-
const hasRedo = (0, _data.useSelect)(select => select(_coreData.store).hasRedo());
|
|
26
|
+
const hasRedo = (0, _data.useSelect)(select => select(_coreData.store).hasRedo(), []);
|
|
27
27
|
const {
|
|
28
28
|
redo
|
|
29
29
|
} = (0, _data.useDispatch)(_coreData.store);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/header/undo-redo/redo.js"],"names":["RedoButton","hasRedo","select","coreStore","redo","redoIcon","undoIcon","displayShortcut","primaryShift","undefined"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AACA;;AARA;AACA;AACA;AAQe,SAASA,UAAT,GAAsB;AACpC,QAAMC,OAAO,GAAG,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/header/undo-redo/redo.js"],"names":["RedoButton","hasRedo","select","coreStore","redo","redoIcon","undoIcon","displayShortcut","primaryShift","undefined"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AACA;;AARA;AACA;AACA;AAQe,SAASA,UAAT,GAAsB;AACpC,QAAMC,OAAO,GAAG,qBACbC,MAAF,IAAcA,MAAM,CAAEC,eAAF,CAAN,CAAoBF,OAApB,EADC,EAEf,EAFe,CAAhB;AAIA,QAAM;AAAEG,IAAAA;AAAF,MAAW,uBAAaD,eAAb,CAAjB;AACA,SACC,4BAAC,kBAAD;AACC,IAAA,IAAI,EAAG,CAAE,kBAAF,GAAYE,WAAZ,GAAuBC,WAD/B;AAEC,IAAA,KAAK,EAAG,cAAI,MAAJ,CAFT;AAGC,IAAA,QAAQ,EAAGC,0BAAgBC,YAAhB,CAA8B,GAA9B,CAHZ,CAIC;AACA;AACA;AAND;AAOC,qBAAgB,CAAEP,OAPnB;AAQC,IAAA,OAAO,EAAGA,OAAO,GAAGG,IAAH,GAAUK;AAR5B,IADD;AAYA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, isRTL } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { redo as redoIcon, undo as undoIcon } from '@wordpress/icons';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport { store as coreStore } from '@wordpress/core-data';\n\nexport default function RedoButton() {\n\tconst hasRedo = useSelect(\n\t\t( select ) => select( coreStore ).hasRedo(),\n\t\t[]\n\t);\n\tconst { redo } = useDispatch( coreStore );\n\treturn (\n\t\t<Button\n\t\t\ticon={ ! isRTL() ? redoIcon : undoIcon }\n\t\t\tlabel={ __( 'Redo' ) }\n\t\t\tshortcut={ displayShortcut.primaryShift( 'z' ) }\n\t\t\t// If there are no undo levels we don't want to actually disable this\n\t\t\t// button, because it will remove focus for keyboard users.\n\t\t\t// See: https://github.com/WordPress/gutenberg/issues/3486\n\t\t\taria-disabled={ ! hasRedo }\n\t\t\tonClick={ hasRedo ? redo : undefined }\n\t\t/>\n\t);\n}\n"]}
|
|
@@ -23,7 +23,7 @@ var _coreData = require("@wordpress/core-data");
|
|
|
23
23
|
* WordPress dependencies
|
|
24
24
|
*/
|
|
25
25
|
function UndoButton() {
|
|
26
|
-
const hasUndo = (0, _data.useSelect)(select => select(_coreData.store).hasUndo());
|
|
26
|
+
const hasUndo = (0, _data.useSelect)(select => select(_coreData.store).hasUndo(), []);
|
|
27
27
|
const {
|
|
28
28
|
undo
|
|
29
29
|
} = (0, _data.useDispatch)(_coreData.store);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/header/undo-redo/undo.js"],"names":["UndoButton","hasUndo","select","coreStore","undo","undoIcon","redoIcon","displayShortcut","primary","undefined"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AACA;;AARA;AACA;AACA;AAQe,SAASA,UAAT,GAAsB;AACpC,QAAMC,OAAO,GAAG,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/header/undo-redo/undo.js"],"names":["UndoButton","hasUndo","select","coreStore","undo","undoIcon","redoIcon","displayShortcut","primary","undefined"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AACA;;AARA;AACA;AACA;AAQe,SAASA,UAAT,GAAsB;AACpC,QAAMC,OAAO,GAAG,qBACbC,MAAF,IAAcA,MAAM,CAAEC,eAAF,CAAN,CAAoBF,OAApB,EADC,EAEf,EAFe,CAAhB;AAIA,QAAM;AAAEG,IAAAA;AAAF,MAAW,uBAAaD,eAAb,CAAjB;AACA,SACC,4BAAC,kBAAD;AACC,IAAA,IAAI,EAAG,CAAE,kBAAF,GAAYE,WAAZ,GAAuBC,WAD/B;AAEC,IAAA,KAAK,EAAG,cAAI,MAAJ,CAFT;AAGC,IAAA,QAAQ,EAAGC,0BAAgBC,OAAhB,CAAyB,GAAzB,CAHZ,CAIC;AACA;AACA;AAND;AAOC,qBAAgB,CAAEP,OAPnB;AAQC,IAAA,OAAO,EAAGA,OAAO,GAAGG,IAAH,GAAUK;AAR5B,IADD;AAYA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, isRTL } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { undo as undoIcon, redo as redoIcon } from '@wordpress/icons';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport { store as coreStore } from '@wordpress/core-data';\n\nexport default function UndoButton() {\n\tconst hasUndo = useSelect(\n\t\t( select ) => select( coreStore ).hasUndo(),\n\t\t[]\n\t);\n\tconst { undo } = useDispatch( coreStore );\n\treturn (\n\t\t<Button\n\t\t\ticon={ ! isRTL() ? undoIcon : redoIcon }\n\t\t\tlabel={ __( 'Undo' ) }\n\t\t\tshortcut={ displayShortcut.primary( 'z' ) }\n\t\t\t// If there are no undo levels we don't want to actually disable this\n\t\t\t// button, because it will remove focus for keyboard users.\n\t\t\t// See: https://github.com/WordPress/gutenberg/issues/3486\n\t\t\taria-disabled={ ! hasUndo }\n\t\t\tonClick={ hasUndo ? undo : undefined }\n\t\t/>\n\t);\n}\n"]}
|
|
@@ -31,7 +31,7 @@ var _constants2 = require("../../store/constants");
|
|
|
31
31
|
* Internal dependencies
|
|
32
32
|
*/
|
|
33
33
|
function KeyboardShortcuts() {
|
|
34
|
-
const isListViewOpen = (0, _data.useSelect)(select => select(_store.store).isListViewOpened());
|
|
34
|
+
const isListViewOpen = (0, _data.useSelect)(select => select(_store.store).isListViewOpened(), []);
|
|
35
35
|
const isBlockInspectorOpen = (0, _data.useSelect)(select => select(_interface.store).getActiveComplementaryArea(_store.store.name) === _constants.SIDEBAR_BLOCK, []);
|
|
36
36
|
const {
|
|
37
37
|
redo,
|
|
@@ -47,19 +47,13 @@ function KeyboardShortcuts() {
|
|
|
47
47
|
(0, _keyboardShortcuts.useShortcut)('core/edit-site/undo', event => {
|
|
48
48
|
undo();
|
|
49
49
|
event.preventDefault();
|
|
50
|
-
}, {
|
|
51
|
-
bindGlobal: true
|
|
52
50
|
});
|
|
53
51
|
(0, _keyboardShortcuts.useShortcut)('core/edit-site/redo', event => {
|
|
54
52
|
redo();
|
|
55
53
|
event.preventDefault();
|
|
56
|
-
}, {
|
|
57
|
-
bindGlobal: true
|
|
58
54
|
});
|
|
59
|
-
(0, _keyboardShortcuts.useShortcut)('core/edit-site/toggle-list-view', (
|
|
55
|
+
(0, _keyboardShortcuts.useShortcut)('core/edit-site/toggle-list-view', () => {
|
|
60
56
|
setIsListViewOpened(!isListViewOpen);
|
|
61
|
-
}, [isListViewOpen, setIsListViewOpened]), {
|
|
62
|
-
bindGlobal: true
|
|
63
57
|
});
|
|
64
58
|
(0, _keyboardShortcuts.useShortcut)('core/edit-site/toggle-block-settings-sidebar', event => {
|
|
65
59
|
// This shortcut has no known clashes, but use preventDefault to prevent any
|
|
@@ -71,8 +65,6 @@ function KeyboardShortcuts() {
|
|
|
71
65
|
} else {
|
|
72
66
|
enableComplementaryArea(_constants2.STORE_NAME, _constants.SIDEBAR_BLOCK);
|
|
73
67
|
}
|
|
74
|
-
}, {
|
|
75
|
-
bindGlobal: true
|
|
76
68
|
});
|
|
77
69
|
return null;
|
|
78
70
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/keyboard-shortcuts/index.js"],"names":["KeyboardShortcuts","isListViewOpen","select","editSiteStore","isListViewOpened","isBlockInspectorOpen","interfaceStore","getActiveComplementaryArea","name","SIDEBAR_BLOCK","redo","undo","coreStore","setIsListViewOpened","enableComplementaryArea","disableComplementaryArea","event","preventDefault","
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/keyboard-shortcuts/index.js"],"names":["KeyboardShortcuts","isListViewOpen","select","editSiteStore","isListViewOpened","isBlockInspectorOpen","interfaceStore","getActiveComplementaryArea","name","SIDEBAR_BLOCK","redo","undo","coreStore","setIsListViewOpened","enableComplementaryArea","disableComplementaryArea","event","preventDefault","STORE_NAME","KeyboardShortcutsRegister","registerShortcut","keyboardShortcutsStore","category","description","keyCombination","modifier","character","Register"],"mappings":";;;;;;;AAGA;;AACA;;AAIA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AAlBA;AACA;AACA;;AAWA;AACA;AACA;AAKA,SAASA,iBAAT,GAA6B;AAC5B,QAAMC,cAAc,GAAG,qBACpBC,MAAF,IAAcA,MAAM,CAAEC,YAAF,CAAN,CAAwBC,gBAAxB,EADQ,EAEtB,EAFsB,CAAvB;AAIA,QAAMC,oBAAoB,GAAG,qBAC1BH,MAAF,IACCA,MAAM,CAAEI,gBAAF,CAAN,CAAyBC,0BAAzB,CACCJ,aAAcK,IADf,MAEMC,wBAJqB,EAK5B,EAL4B,CAA7B;AAOA,QAAM;AAAEC,IAAAA,IAAF;AAAQC,IAAAA;AAAR,MAAiB,uBAAaC,eAAb,CAAvB;AACA,QAAM;AAAEC,IAAAA;AAAF,MAA0B,uBAAaV,YAAb,CAAhC;AACA,QAAM;AAAEW,IAAAA,uBAAF;AAA2BC,IAAAA;AAA3B,MAAwD,uBAC7DT,gBAD6D,CAA9D;AAIA,sCAAa,qBAAb,EAAsCU,KAAF,IAAa;AAChDL,IAAAA,IAAI;AACJK,IAAAA,KAAK,CAACC,cAAN;AACA,GAHD;AAKA,sCAAa,qBAAb,EAAsCD,KAAF,IAAa;AAChDN,IAAAA,IAAI;AACJM,IAAAA,KAAK,CAACC,cAAN;AACA,GAHD;AAKA,sCAAa,iCAAb,EAAgD,MAAM;AACrDJ,IAAAA,mBAAmB,CAAE,CAAEZ,cAAJ,CAAnB;AACA,GAFD;AAIA,sCAAa,8CAAb,EAA+De,KAAF,IAAa;AACzE;AACA;AACAA,IAAAA,KAAK,CAACC,cAAN;;AAEA,QAAKZ,oBAAL,EAA4B;AAC3BU,MAAAA,wBAAwB,CAAEG,sBAAF,CAAxB;AACA,KAFD,MAEO;AACNJ,MAAAA,uBAAuB,CAAEI,sBAAF,EAAcT,wBAAd,CAAvB;AACA;AACD,GAVD;AAYA,SAAO,IAAP;AACA;;AACD,SAASU,yBAAT,GAAqC;AACpC;AACA,QAAM;AAAEC,IAAAA;AAAF,MAAuB,uBAAaC,wBAAb,CAA7B;AACA,0BAAW,MAAM;AAChBD,IAAAA,gBAAgB,CAAE;AACjBZ,MAAAA,IAAI,EAAE,qBADW;AAEjBc,MAAAA,QAAQ,EAAE,QAFO;AAGjBC,MAAAA,WAAW,EAAE,cAAI,yBAAJ,CAHI;AAIjBC,MAAAA,cAAc,EAAE;AACfC,QAAAA,QAAQ,EAAE,SADK;AAEfC,QAAAA,SAAS,EAAE;AAFI;AAJC,KAAF,CAAhB;AAUAN,IAAAA,gBAAgB,CAAE;AACjBZ,MAAAA,IAAI,EAAE,qBADW;AAEjBc,MAAAA,QAAQ,EAAE,QAFO;AAGjBC,MAAAA,WAAW,EAAE,cAAI,sBAAJ,CAHI;AAIjBC,MAAAA,cAAc,EAAE;AACfC,QAAAA,QAAQ,EAAE,cADK;AAEfC,QAAAA,SAAS,EAAE;AAFI;AAJC,KAAF,CAAhB;AAUAN,IAAAA,gBAAgB,CAAE;AACjBZ,MAAAA,IAAI,EAAE,iCADW;AAEjBc,MAAAA,QAAQ,EAAE,QAFO;AAGjBC,MAAAA,WAAW,EAAE,cAAI,2BAAJ,CAHI;AAIjBC,MAAAA,cAAc,EAAE;AACfC,QAAAA,QAAQ,EAAE,QADK;AAEfC,QAAAA,SAAS,EAAE;AAFI;AAJC,KAAF,CAAhB;AAUAN,IAAAA,gBAAgB,CAAE;AACjBZ,MAAAA,IAAI,EAAE,8CADW;AAEjBc,MAAAA,QAAQ,EAAE,QAFO;AAGjBC,MAAAA,WAAW,EAAE,cAAI,0CAAJ,CAHI;AAIjBC,MAAAA,cAAc,EAAE;AACfC,QAAAA,QAAQ,EAAE,cADK;AAEfC,QAAAA,SAAS,EAAE;AAFI;AAJC,KAAF,CAAhB;AASA,GAxCD,EAwCG,CAAEN,gBAAF,CAxCH;AA0CA,SAAO,IAAP;AACA;;AAEDpB,iBAAiB,CAAC2B,QAAlB,GAA6BR,yBAA7B;eACenB,iB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect } from '@wordpress/element';\nimport {\n\tuseShortcut,\n\tstore as keyboardShortcutsStore,\n} from '@wordpress/keyboard-shortcuts';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as interfaceStore } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { SIDEBAR_BLOCK } from '../sidebar/constants';\nimport { STORE_NAME } from '../../store/constants';\n\nfunction KeyboardShortcuts() {\n\tconst isListViewOpen = useSelect(\n\t\t( select ) => select( editSiteStore ).isListViewOpened(),\n\t\t[]\n\t);\n\tconst isBlockInspectorOpen = useSelect(\n\t\t( select ) =>\n\t\t\tselect( interfaceStore ).getActiveComplementaryArea(\n\t\t\t\teditSiteStore.name\n\t\t\t) === SIDEBAR_BLOCK,\n\t\t[]\n\t);\n\tconst { redo, undo } = useDispatch( coreStore );\n\tconst { setIsListViewOpened } = useDispatch( editSiteStore );\n\tconst { enableComplementaryArea, disableComplementaryArea } = useDispatch(\n\t\tinterfaceStore\n\t);\n\n\tuseShortcut( 'core/edit-site/undo', ( event ) => {\n\t\tundo();\n\t\tevent.preventDefault();\n\t} );\n\n\tuseShortcut( 'core/edit-site/redo', ( event ) => {\n\t\tredo();\n\t\tevent.preventDefault();\n\t} );\n\n\tuseShortcut( 'core/edit-site/toggle-list-view', () => {\n\t\tsetIsListViewOpened( ! isListViewOpen );\n\t} );\n\n\tuseShortcut( 'core/edit-site/toggle-block-settings-sidebar', ( event ) => {\n\t\t// This shortcut has no known clashes, but use preventDefault to prevent any\n\t\t// obscure shortcuts from triggering.\n\t\tevent.preventDefault();\n\n\t\tif ( isBlockInspectorOpen ) {\n\t\t\tdisableComplementaryArea( STORE_NAME );\n\t\t} else {\n\t\t\tenableComplementaryArea( STORE_NAME, SIDEBAR_BLOCK );\n\t\t}\n\t} );\n\n\treturn null;\n}\nfunction KeyboardShortcutsRegister() {\n\t// Registering the shortcuts\n\tconst { registerShortcut } = useDispatch( keyboardShortcutsStore );\n\tuseEffect( () => {\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-site/undo',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Undo your last changes.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'primary',\n\t\t\t\tcharacter: 'z',\n\t\t\t},\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-site/redo',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Redo your last undo.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'primaryShift',\n\t\t\t\tcharacter: 'z',\n\t\t\t},\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-site/toggle-list-view',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Open the block list view.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'access',\n\t\t\t\tcharacter: 'o',\n\t\t\t},\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-site/toggle-block-settings-sidebar',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Show or hide the block settings sidebar.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'primaryShift',\n\t\t\t\tcharacter: ',',\n\t\t\t},\n\t\t} );\n\t}, [ registerShortcut ] );\n\n\treturn null;\n}\n\nKeyboardShortcuts.Register = KeyboardShortcutsRegister;\nexport default KeyboardShortcuts;\n"]}
|
|
@@ -37,7 +37,7 @@ exports.NavigationPanelPreviewFill = NavigationPanelPreviewFill;
|
|
|
37
37
|
function NavigationSidebar() {
|
|
38
38
|
const isNavigationOpen = (0, _data.useSelect)(select => {
|
|
39
39
|
return select(_store.store).isNavigationOpened();
|
|
40
|
-
});
|
|
40
|
+
}, []);
|
|
41
41
|
return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_navigationToggle.default, {
|
|
42
42
|
isOpen: isNavigationOpen
|
|
43
43
|
}), (0, _element.createElement)(_navigationPanel.default, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/navigation-sidebar/index.js"],"names":["Fill","NavigationPanelPreviewFill","Slot","NavigationPanelPreviewSlot","NavigationSidebar","isNavigationOpen","select","editSiteStore","isNavigationOpened"],"mappings":";;;;;;;;;;;;AAGA;;AACA;;AAKA;;AACA;;AACA;;AAXA;AACA;AACA;;AAIA;AACA;AACA;AAKO,MAAM;AACZA,EAAAA,IAAI,EAAEC,0BADM;AAEZC,EAAAA,IAAI,EAAEC;AAFM,IAGT,gCAAgB,gCAAhB,CAHG;;;;AAKQ,SAASC,iBAAT,GAA6B;AAC3C,QAAMC,gBAAgB,GAAG,qBAAaC,MAAF,IAAc;AACjD,WAAOA,MAAM,CAAEC,YAAF,CAAN,CAAwBC,kBAAxB,EAAP;AACA,GAFwB,CAAzB;AAIA,SACC,qDACC,4BAAC,yBAAD;AAAkB,IAAA,MAAM,EAAGH;AAA3B,IADD,EAEC,4BAAC,wBAAD;AAAiB,IAAA,MAAM,EAAGA;AAA1B,IAFD,EAGC,4BAAC,0BAAD,OAHD,CADD;AAOA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createSlotFill } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport NavigationPanel from './navigation-panel';\nimport NavigationToggle from './navigation-toggle';\nimport { store as editSiteStore } from '../../store';\n\nexport const {\n\tFill: NavigationPanelPreviewFill,\n\tSlot: NavigationPanelPreviewSlot,\n} = createSlotFill( 'EditSiteNavigationPanelPreview' );\n\nexport default function NavigationSidebar() {\n\tconst isNavigationOpen = useSelect( ( select ) => {\n\t\treturn select( editSiteStore ).isNavigationOpened();\n\t} );\n\n\treturn (\n\t\t<>\n\t\t\t<NavigationToggle isOpen={ isNavigationOpen } />\n\t\t\t<NavigationPanel isOpen={ isNavigationOpen } />\n\t\t\t<NavigationPanelPreviewSlot />\n\t\t</>\n\t);\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/navigation-sidebar/index.js"],"names":["Fill","NavigationPanelPreviewFill","Slot","NavigationPanelPreviewSlot","NavigationSidebar","isNavigationOpen","select","editSiteStore","isNavigationOpened"],"mappings":";;;;;;;;;;;;AAGA;;AACA;;AAKA;;AACA;;AACA;;AAXA;AACA;AACA;;AAIA;AACA;AACA;AAKO,MAAM;AACZA,EAAAA,IAAI,EAAEC,0BADM;AAEZC,EAAAA,IAAI,EAAEC;AAFM,IAGT,gCAAgB,gCAAhB,CAHG;;;;AAKQ,SAASC,iBAAT,GAA6B;AAC3C,QAAMC,gBAAgB,GAAG,qBAAaC,MAAF,IAAc;AACjD,WAAOA,MAAM,CAAEC,YAAF,CAAN,CAAwBC,kBAAxB,EAAP;AACA,GAFwB,EAEtB,EAFsB,CAAzB;AAIA,SACC,qDACC,4BAAC,yBAAD;AAAkB,IAAA,MAAM,EAAGH;AAA3B,IADD,EAEC,4BAAC,wBAAD;AAAiB,IAAA,MAAM,EAAGA;AAA1B,IAFD,EAGC,4BAAC,0BAAD,OAHD,CADD;AAOA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createSlotFill } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport NavigationPanel from './navigation-panel';\nimport NavigationToggle from './navigation-toggle';\nimport { store as editSiteStore } from '../../store';\n\nexport const {\n\tFill: NavigationPanelPreviewFill,\n\tSlot: NavigationPanelPreviewSlot,\n} = createSlotFill( 'EditSiteNavigationPanelPreview' );\n\nexport default function NavigationSidebar() {\n\tconst isNavigationOpen = useSelect( ( select ) => {\n\t\treturn select( editSiteStore ).isNavigationOpened();\n\t}, [] );\n\n\treturn (\n\t\t<>\n\t\t\t<NavigationToggle isOpen={ isNavigationOpen } />\n\t\t\t<NavigationPanel isOpen={ isNavigationOpen } />\n\t\t\t<NavigationPanelPreviewSlot />\n\t\t</>\n\t);\n}\n"]}
|
|
@@ -3,13 +3,19 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.TEMPLATE_PARTS_SUB_MENUS = exports.
|
|
6
|
+
exports.TEMPLATE_PARTS_SUB_MENUS = exports.MENU_TEMPLATE_PARTS_GENERAL = exports.MENU_TEMPLATE_PARTS_SIDEBARS = exports.MENU_TEMPLATE_PARTS_FOOTERS = exports.MENU_TEMPLATE_PARTS_HEADERS = exports.SEARCH_DEBOUNCE_IN_MS = exports.MENU_TEMPLATES_UNUSED = exports.MENU_TEMPLATES_POSTS = exports.MENU_TEMPLATES_PAGES = exports.MENU_TEMPLATES_GENERAL = exports.MENU_TEMPLATES = exports.MENU_TEMPLATE_PARTS = exports.MENU_CONTENT_POSTS = exports.MENU_CONTENT_PAGES = exports.MENU_CONTENT_CATEGORIES = exports.MENU_ROOT = exports.TEMPLATE_OVERRIDES = exports.TEMPLATES_NEW_OPTIONS = exports.TEMPLATES_PAGES_PREFIXES = exports.TEMPLATES_POSTS_PREFIXES = exports.TEMPLATES_GENERAL = exports.TEMPLATES_TOP_LEVEL = exports.TEMPLATES_SECONDARY = exports.TEMPLATES_PRIMARY = void 0;
|
|
7
7
|
|
|
8
8
|
var _i18n = require("@wordpress/i18n");
|
|
9
9
|
|
|
10
|
+
var _constants = require("../../../store/constants");
|
|
11
|
+
|
|
10
12
|
/**
|
|
11
13
|
* WordPress dependencies
|
|
12
14
|
*/
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Internal dependencies
|
|
18
|
+
*/
|
|
13
19
|
const TEMPLATES_PRIMARY = ['index', 'singular', 'archive', 'single', 'page', 'home', '404', 'search'];
|
|
14
20
|
exports.TEMPLATES_PRIMARY = TEMPLATES_PRIMARY;
|
|
15
21
|
const TEMPLATES_SECONDARY = ['author', 'category', 'taxonomy', 'date', 'tag', 'attachment', 'single-post', 'front-page'];
|
|
@@ -60,22 +66,16 @@ const MENU_TEMPLATE_PARTS_SIDEBARS = 'template-parts-sidebars';
|
|
|
60
66
|
exports.MENU_TEMPLATE_PARTS_SIDEBARS = MENU_TEMPLATE_PARTS_SIDEBARS;
|
|
61
67
|
const MENU_TEMPLATE_PARTS_GENERAL = 'template-parts-general';
|
|
62
68
|
exports.MENU_TEMPLATE_PARTS_GENERAL = MENU_TEMPLATE_PARTS_GENERAL;
|
|
63
|
-
const TEMPLATE_PART_AREA_HEADER = 'header';
|
|
64
|
-
exports.TEMPLATE_PART_AREA_HEADER = TEMPLATE_PART_AREA_HEADER;
|
|
65
|
-
const TEMPLATE_PART_AREA_FOOTER = 'footer';
|
|
66
|
-
exports.TEMPLATE_PART_AREA_FOOTER = TEMPLATE_PART_AREA_FOOTER;
|
|
67
|
-
const TEMPLATE_PART_AREA_SIDEBAR = 'sidebar';
|
|
68
|
-
exports.TEMPLATE_PART_AREA_SIDEBAR = TEMPLATE_PART_AREA_SIDEBAR;
|
|
69
69
|
const TEMPLATE_PARTS_SUB_MENUS = [{
|
|
70
|
-
area: TEMPLATE_PART_AREA_HEADER,
|
|
70
|
+
area: _constants.TEMPLATE_PART_AREA_HEADER,
|
|
71
71
|
menu: MENU_TEMPLATE_PARTS_HEADERS,
|
|
72
72
|
title: (0, _i18n.__)('Headers')
|
|
73
73
|
}, {
|
|
74
|
-
area: TEMPLATE_PART_AREA_FOOTER,
|
|
74
|
+
area: _constants.TEMPLATE_PART_AREA_FOOTER,
|
|
75
75
|
menu: MENU_TEMPLATE_PARTS_FOOTERS,
|
|
76
76
|
title: (0, _i18n.__)('Footers')
|
|
77
77
|
}, {
|
|
78
|
-
area: TEMPLATE_PART_AREA_SIDEBAR,
|
|
78
|
+
area: _constants.TEMPLATE_PART_AREA_SIDEBAR,
|
|
79
79
|
menu: MENU_TEMPLATE_PARTS_SIDEBARS,
|
|
80
80
|
title: (0, _i18n.__)('Sidebars')
|
|
81
81
|
}, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/navigation-sidebar/navigation-panel/constants.js"],"names":["TEMPLATES_PRIMARY","TEMPLATES_SECONDARY","TEMPLATES_TOP_LEVEL","TEMPLATES_GENERAL","TEMPLATES_POSTS_PREFIXES","TEMPLATES_PAGES_PREFIXES","TEMPLATES_NEW_OPTIONS","TEMPLATE_OVERRIDES","singular","index","home","MENU_ROOT","MENU_CONTENT_CATEGORIES","MENU_CONTENT_PAGES","MENU_CONTENT_POSTS","MENU_TEMPLATE_PARTS","MENU_TEMPLATES","MENU_TEMPLATES_GENERAL","MENU_TEMPLATES_PAGES","MENU_TEMPLATES_POSTS","MENU_TEMPLATES_UNUSED","SEARCH_DEBOUNCE_IN_MS","MENU_TEMPLATE_PARTS_HEADERS","MENU_TEMPLATE_PARTS_FOOTERS","MENU_TEMPLATE_PARTS_SIDEBARS","MENU_TEMPLATE_PARTS_GENERAL","
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/navigation-sidebar/navigation-panel/constants.js"],"names":["TEMPLATES_PRIMARY","TEMPLATES_SECONDARY","TEMPLATES_TOP_LEVEL","TEMPLATES_GENERAL","TEMPLATES_POSTS_PREFIXES","TEMPLATES_PAGES_PREFIXES","TEMPLATES_NEW_OPTIONS","TEMPLATE_OVERRIDES","singular","index","home","MENU_ROOT","MENU_CONTENT_CATEGORIES","MENU_CONTENT_PAGES","MENU_CONTENT_POSTS","MENU_TEMPLATE_PARTS","MENU_TEMPLATES","MENU_TEMPLATES_GENERAL","MENU_TEMPLATES_PAGES","MENU_TEMPLATES_POSTS","MENU_TEMPLATES_UNUSED","SEARCH_DEBOUNCE_IN_MS","MENU_TEMPLATE_PARTS_HEADERS","MENU_TEMPLATE_PARTS_FOOTERS","MENU_TEMPLATE_PARTS_SIDEBARS","MENU_TEMPLATE_PARTS_GENERAL","TEMPLATE_PARTS_SUB_MENUS","area","TEMPLATE_PART_AREA_HEADER","menu","title","TEMPLATE_PART_AREA_FOOTER","TEMPLATE_PART_AREA_SIDEBAR"],"mappings":";;;;;;;AAGA;;AAKA;;AARA;AACA;AACA;;AAGA;AACA;AACA;AAOO,MAAMA,iBAAiB,GAAG,CAChC,OADgC,EAEhC,UAFgC,EAGhC,SAHgC,EAIhC,QAJgC,EAKhC,MALgC,EAMhC,MANgC,EAOhC,KAPgC,EAQhC,QARgC,CAA1B;;AAWA,MAAMC,mBAAmB,GAAG,CAClC,QADkC,EAElC,UAFkC,EAGlC,UAHkC,EAIlC,MAJkC,EAKlC,KALkC,EAMlC,YANkC,EAOlC,aAPkC,EAQlC,YARkC,CAA5B;;AAWA,MAAMC,mBAAmB,GAAG,CAClC,GAAGF,iBAD+B,EAElC,GAAGC,mBAF+B,CAA5B;;AAKA,MAAME,iBAAiB,GAAG,CAAE,WAAF,CAA1B;;AAEA,MAAMC,wBAAwB,GAAG,CACvC,OADuC,EAEvC,SAFuC,EAGvC,cAHuC,EAIvC,MAJuC,CAAjC;;AAOA,MAAMC,wBAAwB,GAAG,CAAE,OAAF,CAAjC;;AAEA,MAAMC,qBAAqB,GAAG,CACpC,YADoC,EAEpC,aAFoC,EAGpC,MAHoC,EAIpC,SAJoC,EAKpC,QALoC,EAMpC,KANoC,EAOpC,OAPoC,CAA9B;;AAUA,MAAMC,kBAAkB,GAAG;AACjCC,EAAAA,QAAQ,EAAE,CAAE,QAAF,EAAY,MAAZ,CADuB;AAEjCC,EAAAA,KAAK,EAAE,CAAE,SAAF,EAAa,KAAb,EAAoB,QAApB,EAA8B,UAA9B,EAA0C,MAA1C,CAF0B;AAGjCC,EAAAA,IAAI,EAAE,CAAE,YAAF;AAH2B,CAA3B;;AAMA,MAAMC,SAAS,GAAG,MAAlB;;AACA,MAAMC,uBAAuB,GAAG,oBAAhC;;AACA,MAAMC,kBAAkB,GAAG,eAA3B;;AACA,MAAMC,kBAAkB,GAAG,eAA3B;;AACA,MAAMC,mBAAmB,GAAG,gBAA5B;;AACA,MAAMC,cAAc,GAAG,WAAvB;;AACA,MAAMC,sBAAsB,GAAG,mBAA/B;;AACA,MAAMC,oBAAoB,GAAG,iBAA7B;;AACA,MAAMC,oBAAoB,GAAG,iBAA7B;;AACA,MAAMC,qBAAqB,GAAG,kBAA9B;;AAEA,MAAMC,qBAAqB,GAAG,EAA9B;;AAEA,MAAMC,2BAA2B,GAAG,wBAApC;;AACA,MAAMC,2BAA2B,GAAG,wBAApC;;AACA,MAAMC,4BAA4B,GAAG,yBAArC;;AACA,MAAMC,2BAA2B,GAAG,wBAApC;;AAEA,MAAMC,wBAAwB,GAAG,CACvC;AACCC,EAAAA,IAAI,EAAEC,oCADP;AAECC,EAAAA,IAAI,EAAEP,2BAFP;AAGCQ,EAAAA,KAAK,EAAE,cAAI,SAAJ;AAHR,CADuC,EAMvC;AACCH,EAAAA,IAAI,EAAEI,oCADP;AAECF,EAAAA,IAAI,EAAEN,2BAFP;AAGCO,EAAAA,KAAK,EAAE,cAAI,SAAJ;AAHR,CANuC,EAWvC;AACCH,EAAAA,IAAI,EAAEK,qCADP;AAECH,EAAAA,IAAI,EAAEL,4BAFP;AAGCM,EAAAA,KAAK,EAAE,cAAI,UAAJ;AAHR,CAXuC,EAgBvC;AACCH,EAAAA,IAAI,EAAE,eADP;AAECE,EAAAA,IAAI,EAAEJ,2BAFP;AAGCK,EAAAA,KAAK,EAAE,cAAI,SAAJ;AAHR,CAhBuC,CAAjC","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport {\n\tTEMPLATE_PART_AREA_HEADER,\n\tTEMPLATE_PART_AREA_FOOTER,\n\tTEMPLATE_PART_AREA_SIDEBAR,\n} from '../../../store/constants';\n\nexport const TEMPLATES_PRIMARY = [\n\t'index',\n\t'singular',\n\t'archive',\n\t'single',\n\t'page',\n\t'home',\n\t'404',\n\t'search',\n];\n\nexport const TEMPLATES_SECONDARY = [\n\t'author',\n\t'category',\n\t'taxonomy',\n\t'date',\n\t'tag',\n\t'attachment',\n\t'single-post',\n\t'front-page',\n];\n\nexport const TEMPLATES_TOP_LEVEL = [\n\t...TEMPLATES_PRIMARY,\n\t...TEMPLATES_SECONDARY,\n];\n\nexport const TEMPLATES_GENERAL = [ 'page-home' ];\n\nexport const TEMPLATES_POSTS_PREFIXES = [\n\t'post-',\n\t'author-',\n\t'single-post-',\n\t'tag-',\n];\n\nexport const TEMPLATES_PAGES_PREFIXES = [ 'page-' ];\n\nexport const TEMPLATES_NEW_OPTIONS = [\n\t'front-page',\n\t'single-post',\n\t'page',\n\t'archive',\n\t'search',\n\t'404',\n\t'index',\n];\n\nexport const TEMPLATE_OVERRIDES = {\n\tsingular: [ 'single', 'page' ],\n\tindex: [ 'archive', '404', 'search', 'singular', 'home' ],\n\thome: [ 'front-page' ],\n};\n\nexport const MENU_ROOT = 'root';\nexport const MENU_CONTENT_CATEGORIES = 'content-categories';\nexport const MENU_CONTENT_PAGES = 'content-pages';\nexport const MENU_CONTENT_POSTS = 'content-posts';\nexport const MENU_TEMPLATE_PARTS = 'template-parts';\nexport const MENU_TEMPLATES = 'templates';\nexport const MENU_TEMPLATES_GENERAL = 'templates-general';\nexport const MENU_TEMPLATES_PAGES = 'templates-pages';\nexport const MENU_TEMPLATES_POSTS = 'templates-posts';\nexport const MENU_TEMPLATES_UNUSED = 'templates-unused';\n\nexport const SEARCH_DEBOUNCE_IN_MS = 75;\n\nexport const MENU_TEMPLATE_PARTS_HEADERS = 'template-parts-headers';\nexport const MENU_TEMPLATE_PARTS_FOOTERS = 'template-parts-footers';\nexport const MENU_TEMPLATE_PARTS_SIDEBARS = 'template-parts-sidebars';\nexport const MENU_TEMPLATE_PARTS_GENERAL = 'template-parts-general';\n\nexport const TEMPLATE_PARTS_SUB_MENUS = [\n\t{\n\t\tarea: TEMPLATE_PART_AREA_HEADER,\n\t\tmenu: MENU_TEMPLATE_PARTS_HEADERS,\n\t\ttitle: __( 'Headers' ),\n\t},\n\t{\n\t\tarea: TEMPLATE_PART_AREA_FOOTER,\n\t\tmenu: MENU_TEMPLATE_PARTS_FOOTERS,\n\t\ttitle: __( 'Footers' ),\n\t},\n\t{\n\t\tarea: TEMPLATE_PART_AREA_SIDEBAR,\n\t\tmenu: MENU_TEMPLATE_PARTS_SIDEBARS,\n\t\ttitle: __( 'Sidebars' ),\n\t},\n\t{\n\t\tarea: 'uncategorized',\n\t\tmenu: MENU_TEMPLATE_PARTS_GENERAL,\n\t\ttitle: __( 'General' ),\n\t},\n];\n"]}
|
|
@@ -43,7 +43,7 @@ function SaveButton({
|
|
|
43
43
|
isDirty: dirtyEntityRecords.length > 0,
|
|
44
44
|
isSaving: (0, _lodash.some)(dirtyEntityRecords, record => isSavingEntityRecord(record.kind, record.name, record.key))
|
|
45
45
|
};
|
|
46
|
-
});
|
|
46
|
+
}, []);
|
|
47
47
|
const disabled = !isDirty || isSaving;
|
|
48
48
|
return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_components.Button, {
|
|
49
49
|
variant: "primary",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/save-button/index.js"],"names":["SaveButton","openEntitiesSavedStates","isEntitiesSavedStatesOpen","isDirty","isSaving","select","__experimentalGetDirtyEntityRecords","isSavingEntityRecord","coreStore","dirtyEntityRecords","length","record","kind","name","key","disabled","undefined"],"mappings":";;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AACA;;AAXA;AACA;AACA;;AAGA;AACA;AACA;AAMe,SAASA,UAAT,CAAqB;AACnCC,EAAAA,uBADmC;AAEnCC,EAAAA;AAFmC,CAArB,EAGX;AACH,QAAM;AAAEC,IAAAA,OAAF;AAAWC,IAAAA;AAAX,MAAwB,qBAAaC,MAAF,IAAc;AACtD,UAAM;AACLC,MAAAA,mCADK;AAELC,MAAAA;AAFK,QAGFF,MAAM,CAAEG,eAAF,CAHV;;AAIA,UAAMC,kBAAkB,GAAGH,mCAAmC,EAA9D;;AACA,WAAO;AACNH,MAAAA,OAAO,EAAEM,kBAAkB,CAACC,MAAnB,GAA4B,CAD/B;AAENN,MAAAA,QAAQ,EAAE,kBAAMK,kBAAN,EAA4BE,MAAF,IACnCJ,oBAAoB,CAAEI,MAAM,CAACC,IAAT,EAAeD,MAAM,CAACE,IAAtB,EAA4BF,MAAM,CAACG,GAAnC,CADX;AAFJ,KAAP;AAMA,GAZ6B,CAA9B;AAcA,QAAMC,QAAQ,GAAG,CAAEZ,OAAF,IAAaC,QAA9B;AAEA,SACC,qDACC,4BAAC,kBAAD;AACC,IAAA,OAAO,EAAC,SADT;AAEC,IAAA,SAAS,EAAC,+BAFX;AAGC,qBAAgBW,QAHjB;AAIC,qBAAgBb,yBAJjB;AAKC,IAAA,QAAQ,EAAGa,QALZ;AAMC,IAAA,MAAM,EAAGX,QANV;AAOC,IAAA,OAAO,EAAGW,QAAQ,GAAGC,SAAH,GAAef;AAPlC,KASG,cAAI,MAAJ,CATH,CADD,CADD;AAeA","sourcesContent":["/**\n * External dependencies\n */\nimport { some } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { Button } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\n\nexport default function SaveButton( {\n\topenEntitiesSavedStates,\n\tisEntitiesSavedStatesOpen,\n} ) {\n\tconst { isDirty, isSaving } = useSelect( ( select ) => {\n\t\tconst {\n\t\t\t__experimentalGetDirtyEntityRecords,\n\t\t\tisSavingEntityRecord,\n\t\t} = select( coreStore );\n\t\tconst dirtyEntityRecords = __experimentalGetDirtyEntityRecords();\n\t\treturn {\n\t\t\tisDirty: dirtyEntityRecords.length > 0,\n\t\t\tisSaving: some( dirtyEntityRecords, ( record ) =>\n\t\t\t\tisSavingEntityRecord( record.kind, record.name, record.key )\n\t\t\t),\n\t\t};\n\t} );\n\n\tconst disabled = ! isDirty || isSaving;\n\n\treturn (\n\t\t<>\n\t\t\t<Button\n\t\t\t\tvariant=\"primary\"\n\t\t\t\tclassName=\"edit-site-save-button__button\"\n\t\t\t\taria-disabled={ disabled }\n\t\t\t\taria-expanded={ isEntitiesSavedStatesOpen }\n\t\t\t\tdisabled={ disabled }\n\t\t\t\tisBusy={ isSaving }\n\t\t\t\tonClick={ disabled ? undefined : openEntitiesSavedStates }\n\t\t\t>\n\t\t\t\t{ __( 'Save' ) }\n\t\t\t</Button>\n\t\t</>\n\t);\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/save-button/index.js"],"names":["SaveButton","openEntitiesSavedStates","isEntitiesSavedStatesOpen","isDirty","isSaving","select","__experimentalGetDirtyEntityRecords","isSavingEntityRecord","coreStore","dirtyEntityRecords","length","record","kind","name","key","disabled","undefined"],"mappings":";;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AACA;;AAXA;AACA;AACA;;AAGA;AACA;AACA;AAMe,SAASA,UAAT,CAAqB;AACnCC,EAAAA,uBADmC;AAEnCC,EAAAA;AAFmC,CAArB,EAGX;AACH,QAAM;AAAEC,IAAAA,OAAF;AAAWC,IAAAA;AAAX,MAAwB,qBAAaC,MAAF,IAAc;AACtD,UAAM;AACLC,MAAAA,mCADK;AAELC,MAAAA;AAFK,QAGFF,MAAM,CAAEG,eAAF,CAHV;;AAIA,UAAMC,kBAAkB,GAAGH,mCAAmC,EAA9D;;AACA,WAAO;AACNH,MAAAA,OAAO,EAAEM,kBAAkB,CAACC,MAAnB,GAA4B,CAD/B;AAENN,MAAAA,QAAQ,EAAE,kBAAMK,kBAAN,EAA4BE,MAAF,IACnCJ,oBAAoB,CAAEI,MAAM,CAACC,IAAT,EAAeD,MAAM,CAACE,IAAtB,EAA4BF,MAAM,CAACG,GAAnC,CADX;AAFJ,KAAP;AAMA,GAZ6B,EAY3B,EAZ2B,CAA9B;AAcA,QAAMC,QAAQ,GAAG,CAAEZ,OAAF,IAAaC,QAA9B;AAEA,SACC,qDACC,4BAAC,kBAAD;AACC,IAAA,OAAO,EAAC,SADT;AAEC,IAAA,SAAS,EAAC,+BAFX;AAGC,qBAAgBW,QAHjB;AAIC,qBAAgBb,yBAJjB;AAKC,IAAA,QAAQ,EAAGa,QALZ;AAMC,IAAA,MAAM,EAAGX,QANV;AAOC,IAAA,OAAO,EAAGW,QAAQ,GAAGC,SAAH,GAAef;AAPlC,KASG,cAAI,MAAJ,CATH,CADD,CADD;AAeA","sourcesContent":["/**\n * External dependencies\n */\nimport { some } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { Button } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\n\nexport default function SaveButton( {\n\topenEntitiesSavedStates,\n\tisEntitiesSavedStatesOpen,\n} ) {\n\tconst { isDirty, isSaving } = useSelect( ( select ) => {\n\t\tconst {\n\t\t\t__experimentalGetDirtyEntityRecords,\n\t\t\tisSavingEntityRecord,\n\t\t} = select( coreStore );\n\t\tconst dirtyEntityRecords = __experimentalGetDirtyEntityRecords();\n\t\treturn {\n\t\t\tisDirty: dirtyEntityRecords.length > 0,\n\t\t\tisSaving: some( dirtyEntityRecords, ( record ) =>\n\t\t\t\tisSavingEntityRecord( record.kind, record.name, record.key )\n\t\t\t),\n\t\t};\n\t}, [] );\n\n\tconst disabled = ! isDirty || isSaving;\n\n\treturn (\n\t\t<>\n\t\t\t<Button\n\t\t\t\tvariant=\"primary\"\n\t\t\t\tclassName=\"edit-site-save-button__button\"\n\t\t\t\taria-disabled={ disabled }\n\t\t\t\taria-expanded={ isEntitiesSavedStatesOpen }\n\t\t\t\tdisabled={ disabled }\n\t\t\t\tisBusy={ isSaving }\n\t\t\t\tonClick={ disabled ? undefined : openEntitiesSavedStates }\n\t\t\t>\n\t\t\t\t{ __( 'Save' ) }\n\t\t\t</Button>\n\t\t</>\n\t);\n}\n"]}
|
|
@@ -54,7 +54,8 @@ function InserterSidebar() {
|
|
|
54
54
|
showInserterHelpPanel: true,
|
|
55
55
|
shouldFocusBlock: isMobile,
|
|
56
56
|
rootClientId: insertionPoint.rootClientId,
|
|
57
|
-
__experimentalInsertionIndex: insertionPoint.insertionIndex
|
|
57
|
+
__experimentalInsertionIndex: insertionPoint.insertionIndex,
|
|
58
|
+
__experimentalFilterValue: insertionPoint.filterValue
|
|
58
59
|
})));
|
|
59
60
|
}
|
|
60
61
|
//# sourceMappingURL=inserter-sidebar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/secondary-sidebar/inserter-sidebar.js"],"names":["InserterSidebar","setIsInserterOpened","editSiteStore","insertionPoint","select","__experimentalGetInsertionPoint","isMobile","inserterDialogRef","inserterDialogProps","onClose","close","rootClientId","insertionIndex"],"mappings":";;;;;;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AAQA;;AAfA;AACA;AACA;;AAUA;AACA;AACA;AAGe,SAASA,eAAT,GAA2B;AACzC,QAAM;AAAEC,IAAAA;AAAF,MAA0B,uBAAaC,YAAb,CAAhC;AACA,QAAMC,cAAc,GAAG,qBACpBC,MAAF,IAAcA,MAAM,CAAEF,YAAF,CAAN,CAAwBG,+BAAxB,EADQ,EAEtB,EAFsB,CAAvB;AAKA,QAAMC,QAAQ,GAAG,+BAAkB,QAAlB,EAA4B,GAA5B,CAAjB;AACA,QAAM,CAAEC,iBAAF,EAAqBC,mBAArB,IAA6C,sCAAW;AAC7DC,IAAAA,OAAO,EAAE,MAAMR,mBAAmB,CAAE,KAAF;AAD2B,GAAX,CAAnD;AAIA,SACC;AACC,IAAA,GAAG,EAAGM;AADP,KAEMC,mBAFN;AAGC,IAAA,SAAS,EAAC;AAHX,MAKC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,4BAAC,kBAAD;AACC,IAAA,IAAI,EAAGE,YADR;AAEC,IAAA,OAAO,EAAG,MAAMT,mBAAmB,CAAE,KAAF;AAFpC,IADD,CALD,EAWC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,4BAAC,kCAAD;AACC,IAAA,qBAAqB,MADtB;AAEC,IAAA,gBAAgB,EAAGK,QAFpB;AAGC,IAAA,YAAY,EAAGH,cAAc,CAACQ,YAH/B;AAIC,IAAA,4BAA4B,EAC3BR,cAAc,CAACS;
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/secondary-sidebar/inserter-sidebar.js"],"names":["InserterSidebar","setIsInserterOpened","editSiteStore","insertionPoint","select","__experimentalGetInsertionPoint","isMobile","inserterDialogRef","inserterDialogProps","onClose","close","rootClientId","insertionIndex","filterValue"],"mappings":";;;;;;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AAQA;;AAfA;AACA;AACA;;AAUA;AACA;AACA;AAGe,SAASA,eAAT,GAA2B;AACzC,QAAM;AAAEC,IAAAA;AAAF,MAA0B,uBAAaC,YAAb,CAAhC;AACA,QAAMC,cAAc,GAAG,qBACpBC,MAAF,IAAcA,MAAM,CAAEF,YAAF,CAAN,CAAwBG,+BAAxB,EADQ,EAEtB,EAFsB,CAAvB;AAKA,QAAMC,QAAQ,GAAG,+BAAkB,QAAlB,EAA4B,GAA5B,CAAjB;AACA,QAAM,CAAEC,iBAAF,EAAqBC,mBAArB,IAA6C,sCAAW;AAC7DC,IAAAA,OAAO,EAAE,MAAMR,mBAAmB,CAAE,KAAF;AAD2B,GAAX,CAAnD;AAIA,SACC;AACC,IAAA,GAAG,EAAGM;AADP,KAEMC,mBAFN;AAGC,IAAA,SAAS,EAAC;AAHX,MAKC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,4BAAC,kBAAD;AACC,IAAA,IAAI,EAAGE,YADR;AAEC,IAAA,OAAO,EAAG,MAAMT,mBAAmB,CAAE,KAAF;AAFpC,IADD,CALD,EAWC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,4BAAC,kCAAD;AACC,IAAA,qBAAqB,MADtB;AAEC,IAAA,gBAAgB,EAAGK,QAFpB;AAGC,IAAA,YAAY,EAAGH,cAAc,CAACQ,YAH/B;AAIC,IAAA,4BAA4B,EAC3BR,cAAc,CAACS,cALjB;AAOC,IAAA,yBAAyB,EAAGT,cAAc,CAACU;AAP5C,IADD,CAXD,CADD;AAyBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { Button } 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';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\n\nexport default function InserterSidebar() {\n\tconst { setIsInserterOpened } = useDispatch( editSiteStore );\n\tconst insertionPoint = useSelect(\n\t\t( select ) => select( editSiteStore ).__experimentalGetInsertionPoint(),\n\t\t[]\n\t);\n\n\tconst isMobile = useViewportMatch( 'medium', '<' );\n\tconst [ inserterDialogRef, inserterDialogProps ] = useDialog( {\n\t\tonClose: () => setIsInserterOpened( false ),\n\t} );\n\n\treturn (\n\t\t<div\n\t\t\tref={ inserterDialogRef }\n\t\t\t{ ...inserterDialogProps }\n\t\t\tclassName=\"edit-site-editor__inserter-panel\"\n\t\t>\n\t\t\t<div className=\"edit-site-editor__inserter-panel-header\">\n\t\t\t\t<Button\n\t\t\t\t\ticon={ close }\n\t\t\t\t\tonClick={ () => setIsInserterOpened( false ) }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t\t<div className=\"edit-site-editor__inserter-panel-content\">\n\t\t\t\t<Library\n\t\t\t\t\tshowInserterHelpPanel\n\t\t\t\t\tshouldFocusBlock={ isMobile }\n\t\t\t\t\trootClientId={ insertionPoint.rootClientId }\n\t\t\t\t\t__experimentalInsertionIndex={\n\t\t\t\t\t\tinsertionPoint.insertionIndex\n\t\t\t\t\t}\n\t\t\t\t\t__experimentalFilterValue={ insertionPoint.filterValue }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n"]}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
4
|
-
|
|
5
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
6
4
|
|
|
7
5
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -11,29 +9,17 @@ exports.default = GlobalStylesSidebar;
|
|
|
11
9
|
|
|
12
10
|
var _element = require("@wordpress/element");
|
|
13
11
|
|
|
14
|
-
var _lodash = require("lodash");
|
|
15
|
-
|
|
16
12
|
var _components = require("@wordpress/components");
|
|
17
13
|
|
|
18
14
|
var _i18n = require("@wordpress/i18n");
|
|
19
15
|
|
|
20
|
-
var
|
|
16
|
+
var _icons = require("@wordpress/icons");
|
|
21
17
|
|
|
22
18
|
var _globalStylesProvider = require("../editor/global-styles-provider");
|
|
23
19
|
|
|
24
20
|
var _defaultSidebar = _interopRequireDefault(require("./default-sidebar"));
|
|
25
21
|
|
|
26
|
-
var
|
|
27
|
-
|
|
28
|
-
var _borderPanel = _interopRequireWildcard(require("./border-panel"));
|
|
29
|
-
|
|
30
|
-
var _colorPanel = _interopRequireWildcard(require("./color-panel"));
|
|
31
|
-
|
|
32
|
-
var _dimensionsPanel = _interopRequireWildcard(require("./dimensions-panel"));
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* External dependencies
|
|
36
|
-
*/
|
|
22
|
+
var _globalStyles = _interopRequireDefault(require("../global-styles"));
|
|
37
23
|
|
|
38
24
|
/**
|
|
39
25
|
* WordPress dependencies
|
|
@@ -42,159 +28,23 @@ var _dimensionsPanel = _interopRequireWildcard(require("./dimensions-panel"));
|
|
|
42
28
|
/**
|
|
43
29
|
* Internal dependencies
|
|
44
30
|
*/
|
|
45
|
-
function
|
|
46
|
-
wrapperPanelTitle,
|
|
47
|
-
context,
|
|
48
|
-
getStyle,
|
|
49
|
-
setStyle,
|
|
50
|
-
getSetting,
|
|
51
|
-
setSetting
|
|
52
|
-
}) {
|
|
53
|
-
const hasBorderPanel = (0, _borderPanel.useHasBorderPanel)(context);
|
|
54
|
-
const hasColorPanel = (0, _colorPanel.useHasColorPanel)(context);
|
|
55
|
-
const hasTypographyPanel = (0, _typographyPanel.useHasTypographyPanel)(context);
|
|
56
|
-
const hasDimensionsPanel = (0, _dimensionsPanel.useHasDimensionsPanel)(context);
|
|
57
|
-
|
|
58
|
-
if (!hasColorPanel && !hasTypographyPanel && !hasDimensionsPanel) {
|
|
59
|
-
return null;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
const content = (0, _element.createElement)(_element.Fragment, null, hasTypographyPanel && (0, _element.createElement)(_typographyPanel.default, {
|
|
63
|
-
context: context,
|
|
64
|
-
getStyle: getStyle,
|
|
65
|
-
setStyle: setStyle
|
|
66
|
-
}), hasColorPanel && (0, _element.createElement)(_colorPanel.default, {
|
|
67
|
-
context: context,
|
|
68
|
-
getStyle: getStyle,
|
|
69
|
-
setStyle: setStyle,
|
|
70
|
-
getSetting: getSetting,
|
|
71
|
-
setSetting: setSetting
|
|
72
|
-
}), hasDimensionsPanel && (0, _element.createElement)(_dimensionsPanel.default, {
|
|
73
|
-
context: context,
|
|
74
|
-
getStyle: getStyle,
|
|
75
|
-
setStyle: setStyle
|
|
76
|
-
}), hasBorderPanel && (0, _element.createElement)(_borderPanel.default, {
|
|
77
|
-
context: context,
|
|
78
|
-
getStyle: getStyle,
|
|
79
|
-
setStyle: setStyle
|
|
80
|
-
}));
|
|
81
|
-
|
|
82
|
-
if (!wrapperPanelTitle) {
|
|
83
|
-
return content;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
return (0, _element.createElement)(_components.PanelBody, {
|
|
87
|
-
title: wrapperPanelTitle,
|
|
88
|
-
initialOpen: false
|
|
89
|
-
}, content);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
function getPanelTitle(blockName) {
|
|
93
|
-
const blockType = (0, _blocks.getBlockType)(blockName); // Protect against blocks that aren't registered
|
|
94
|
-
// eg: widget-area
|
|
95
|
-
|
|
96
|
-
if (blockType === undefined) {
|
|
97
|
-
return blockName;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
return blockType.title;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
function GlobalStylesBlockPanels({
|
|
104
|
-
blocks,
|
|
105
|
-
getStyle,
|
|
106
|
-
setStyle,
|
|
107
|
-
getSetting,
|
|
108
|
-
setSetting
|
|
109
|
-
}) {
|
|
110
|
-
const panels = (0, _element.useMemo)(() => (0, _lodash.sortBy)((0, _lodash.map)(blocks, (block, name) => {
|
|
111
|
-
return {
|
|
112
|
-
block,
|
|
113
|
-
name,
|
|
114
|
-
wrapperPanelTitle: getPanelTitle(name)
|
|
115
|
-
};
|
|
116
|
-
}), ({
|
|
117
|
-
wrapperPanelTitle
|
|
118
|
-
}) => wrapperPanelTitle), [blocks]);
|
|
119
|
-
return (0, _lodash.map)(panels, ({
|
|
120
|
-
block,
|
|
121
|
-
name,
|
|
122
|
-
wrapperPanelTitle
|
|
123
|
-
}) => {
|
|
124
|
-
return (0, _element.createElement)(GlobalStylesPanel, {
|
|
125
|
-
key: 'panel-' + name,
|
|
126
|
-
wrapperPanelTitle: wrapperPanelTitle,
|
|
127
|
-
context: block,
|
|
128
|
-
getStyle: getStyle,
|
|
129
|
-
setStyle: setStyle,
|
|
130
|
-
getSetting: getSetting,
|
|
131
|
-
setSetting: setSetting
|
|
132
|
-
});
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
function GlobalStylesSidebar({
|
|
137
|
-
identifier,
|
|
138
|
-
title,
|
|
139
|
-
icon,
|
|
140
|
-
closeLabel
|
|
141
|
-
}) {
|
|
142
|
-
const {
|
|
143
|
-
root,
|
|
144
|
-
blocks,
|
|
145
|
-
getStyle,
|
|
146
|
-
setStyle,
|
|
147
|
-
getSetting,
|
|
148
|
-
setSetting
|
|
149
|
-
} = (0, _globalStylesProvider.useGlobalStylesContext)();
|
|
31
|
+
function GlobalStylesSidebar() {
|
|
150
32
|
const [canRestart, onReset] = (0, _globalStylesProvider.useGlobalStylesReset)();
|
|
151
|
-
|
|
152
|
-
if (typeof blocks !== 'object' || !root) {
|
|
153
|
-
// No sidebar is shown.
|
|
154
|
-
return null;
|
|
155
|
-
}
|
|
156
|
-
|
|
157
33
|
return (0, _element.createElement)(_defaultSidebar.default, {
|
|
158
34
|
className: "edit-site-global-styles-sidebar",
|
|
159
|
-
identifier:
|
|
160
|
-
title:
|
|
161
|
-
icon:
|
|
162
|
-
closeLabel:
|
|
163
|
-
header: (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)("strong", null,
|
|
35
|
+
identifier: "edit-site/global-styles",
|
|
36
|
+
title: (0, _i18n.__)('Styles'),
|
|
37
|
+
icon: _icons.styles,
|
|
38
|
+
closeLabel: (0, _i18n.__)('Close global styles sidebar'),
|
|
39
|
+
header: (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)("strong", null, (0, _i18n.__)('Styles')), (0, _element.createElement)("span", {
|
|
40
|
+
className: "edit-site-global-styles-sidebar__beta"
|
|
41
|
+
}, (0, _i18n.__)('Beta')), (0, _element.createElement)(_components.Button, {
|
|
164
42
|
className: "edit-site-global-styles-sidebar__reset-button",
|
|
165
43
|
isSmall: true,
|
|
166
44
|
variant: "tertiary",
|
|
167
45
|
disabled: !canRestart,
|
|
168
46
|
onClick: onReset
|
|
169
47
|
}, (0, _i18n.__)('Reset to defaults')))
|
|
170
|
-
}, (0, _element.createElement)(
|
|
171
|
-
tabs: [{
|
|
172
|
-
name: 'root',
|
|
173
|
-
title: (0, _i18n.__)('Root')
|
|
174
|
-
}, {
|
|
175
|
-
name: 'block',
|
|
176
|
-
title: (0, _i18n.__)('By Block Type')
|
|
177
|
-
}]
|
|
178
|
-
}, tab => {
|
|
179
|
-
/* Per Block Context */
|
|
180
|
-
if ('block' === tab.name) {
|
|
181
|
-
return (0, _element.createElement)(GlobalStylesBlockPanels, {
|
|
182
|
-
blocks: blocks,
|
|
183
|
-
getStyle: getStyle,
|
|
184
|
-
setStyle: setStyle,
|
|
185
|
-
getSetting: getSetting,
|
|
186
|
-
setSetting: setSetting
|
|
187
|
-
});
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
return (0, _element.createElement)(GlobalStylesPanel, {
|
|
191
|
-
hasWrapper: false,
|
|
192
|
-
context: root,
|
|
193
|
-
getStyle: getStyle,
|
|
194
|
-
setStyle: setStyle,
|
|
195
|
-
getSetting: getSetting,
|
|
196
|
-
setSetting: setSetting
|
|
197
|
-
});
|
|
198
|
-
}));
|
|
48
|
+
}, (0, _element.createElement)(_globalStyles.default, null));
|
|
199
49
|
}
|
|
200
50
|
//# sourceMappingURL=global-styles-sidebar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar/global-styles-sidebar.js"],"names":["
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar/global-styles-sidebar.js"],"names":["GlobalStylesSidebar","canRestart","onReset","styles"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AAZA;AACA;AACA;;AAKA;AACA;AACA;AAKe,SAASA,mBAAT,GAA+B;AAC7C,QAAM,CAAEC,UAAF,EAAcC,OAAd,IAA0B,iDAAhC;AAEA,SACC,4BAAC,uBAAD;AACC,IAAA,SAAS,EAAC,iCADX;AAEC,IAAA,UAAU,EAAC,yBAFZ;AAGC,IAAA,KAAK,EAAG,cAAI,QAAJ,CAHT;AAIC,IAAA,IAAI,EAAGC,aAJR;AAKC,IAAA,UAAU,EAAG,cAAI,6BAAJ,CALd;AAMC,IAAA,MAAM,EACL,qDACC,4CAAU,cAAI,QAAJ,CAAV,CADD,EAEC;AAAM,MAAA,SAAS,EAAC;AAAhB,OACG,cAAI,MAAJ,CADH,CAFD,EAKC,4BAAC,kBAAD;AACC,MAAA,SAAS,EAAC,+CADX;AAEC,MAAA,OAAO,MAFR;AAGC,MAAA,OAAO,EAAC,UAHT;AAIC,MAAA,QAAQ,EAAG,CAAEF,UAJd;AAKC,MAAA,OAAO,EAAGC;AALX,OAOG,cAAI,mBAAJ,CAPH,CALD;AAPF,KAwBC,4BAAC,qBAAD,OAxBD,CADD;AA4BA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Button } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { styles } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { useGlobalStylesReset } from '../editor/global-styles-provider';\nimport DefaultSidebar from './default-sidebar';\nimport GlobalStyles from '../global-styles';\n\nexport default function GlobalStylesSidebar() {\n\tconst [ canRestart, onReset ] = useGlobalStylesReset();\n\n\treturn (\n\t\t<DefaultSidebar\n\t\t\tclassName=\"edit-site-global-styles-sidebar\"\n\t\t\tidentifier=\"edit-site/global-styles\"\n\t\t\ttitle={ __( 'Styles' ) }\n\t\t\ticon={ styles }\n\t\t\tcloseLabel={ __( 'Close global styles sidebar' ) }\n\t\t\theader={\n\t\t\t\t<>\n\t\t\t\t\t<strong>{ __( 'Styles' ) }</strong>\n\t\t\t\t\t<span className=\"edit-site-global-styles-sidebar__beta\">\n\t\t\t\t\t\t{ __( 'Beta' ) }\n\t\t\t\t\t</span>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tclassName=\"edit-site-global-styles-sidebar__reset-button\"\n\t\t\t\t\t\tisSmall\n\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\tdisabled={ ! canRestart }\n\t\t\t\t\t\tonClick={ onReset }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Reset to defaults' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</>\n\t\t\t}\n\t\t>\n\t\t\t<GlobalStyles />\n\t\t</DefaultSidebar>\n\t);\n}\n"]}
|
|
@@ -93,11 +93,6 @@ function SidebarComplementaryAreaFills() {
|
|
|
93
93
|
headerClassName: "edit-site-sidebar__panel-tabs"
|
|
94
94
|
}, sidebarName === _constants2.SIDEBAR_TEMPLATE && (0, _element.createElement)(_components.PanelBody, null, (0, _element.createElement)(_templateCard.default, null)), sidebarName === _constants2.SIDEBAR_BLOCK && (0, _element.createElement)(InspectorSlot, {
|
|
95
95
|
bubblesVirtually: true
|
|
96
|
-
})), (0, _element.createElement)(_globalStylesSidebar.default,
|
|
97
|
-
identifier: "edit-site/global-styles",
|
|
98
|
-
title: (0, _i18n.__)('Global Styles'),
|
|
99
|
-
closeLabel: (0, _i18n.__)('Close global styles sidebar'),
|
|
100
|
-
icon: _icons.typography
|
|
101
|
-
}));
|
|
96
|
+
})), (0, _element.createElement)(_globalStylesSidebar.default, null));
|
|
102
97
|
}
|
|
103
98
|
//# sourceMappingURL=index.js.map
|