@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.
Files changed (252) hide show
  1. package/README.md +1 -1
  2. package/build/components/block-editor/back-button.js +60 -0
  3. package/build/components/block-editor/back-button.js.map +1 -0
  4. package/build/components/block-editor/index.js +18 -4
  5. package/build/components/block-editor/index.js.map +1 -1
  6. package/build/components/edit-template-part-menu-button/index.js +63 -0
  7. package/build/components/edit-template-part-menu-button/index.js.map +1 -0
  8. package/build/components/editor/global-styles-provider.js +1 -1
  9. package/build/components/editor/global-styles-provider.js.map +1 -1
  10. package/build/components/editor/index.js +7 -7
  11. package/build/components/editor/index.js.map +1 -1
  12. package/build/components/editor/utils.js +1 -1
  13. package/build/components/editor/utils.js.map +1 -1
  14. package/build/components/{sidebar → global-styles}/border-panel.js +0 -0
  15. package/build/components/global-styles/border-panel.js.map +1 -0
  16. package/build/components/{sidebar → global-styles}/color-palette-panel.js +4 -2
  17. package/build/components/global-styles/color-palette-panel.js.map +1 -0
  18. package/build/components/{sidebar → global-styles}/color-panel.js +7 -11
  19. package/build/components/global-styles/color-panel.js.map +1 -0
  20. package/build/components/global-styles/context-menu.js +58 -0
  21. package/build/components/global-styles/context-menu.js.map +1 -0
  22. package/build/components/{sidebar → global-styles}/dimensions-panel.js +6 -7
  23. package/build/components/global-styles/dimensions-panel.js.map +1 -0
  24. package/build/components/global-styles/header.js +54 -0
  25. package/build/components/global-styles/header.js.map +1 -0
  26. package/build/components/global-styles/index.js +89 -0
  27. package/build/components/global-styles/index.js.map +1 -0
  28. package/build/components/global-styles/navigation-button.js +43 -0
  29. package/build/components/global-styles/navigation-button.js.map +1 -0
  30. package/build/components/global-styles/palette.js +57 -0
  31. package/build/components/global-styles/palette.js.map +1 -0
  32. package/build/components/global-styles/preview.js +59 -0
  33. package/build/components/global-styles/preview.js.map +1 -0
  34. package/build/components/global-styles/screen-block-list.js +76 -0
  35. package/build/components/global-styles/screen-block-list.js.map +1 -0
  36. package/build/components/global-styles/screen-block.js +45 -0
  37. package/build/components/global-styles/screen-block.js.map +1 -0
  38. package/build/components/global-styles/screen-color-palette.js +48 -0
  39. package/build/components/global-styles/screen-color-palette.js.map +1 -0
  40. package/build/components/global-styles/screen-colors.js +51 -0
  41. package/build/components/global-styles/screen-colors.js.map +1 -0
  42. package/build/components/global-styles/screen-layout.js +60 -0
  43. package/build/components/global-styles/screen-layout.js.map +1 -0
  44. package/build/components/global-styles/screen-root.js +44 -0
  45. package/build/components/global-styles/screen-root.js.map +1 -0
  46. package/build/components/global-styles/screen-typography.js +50 -0
  47. package/build/components/global-styles/screen-typography.js.map +1 -0
  48. package/build/components/global-styles/subtitle.js +25 -0
  49. package/build/components/global-styles/subtitle.js.map +1 -0
  50. package/build/components/{sidebar → global-styles}/typography-panel.js +1 -3
  51. package/build/components/global-styles/typography-panel.js.map +1 -0
  52. package/build/components/header/plugin-more-menu-item/index.js +82 -0
  53. package/build/components/header/plugin-more-menu-item/index.js.map +1 -0
  54. package/build/components/header/plugin-sidebar-more-menu-item/index.js +75 -0
  55. package/build/components/header/plugin-sidebar-more-menu-item/index.js.map +1 -0
  56. package/build/components/header/undo-redo/redo.js +1 -1
  57. package/build/components/header/undo-redo/redo.js.map +1 -1
  58. package/build/components/header/undo-redo/undo.js +1 -1
  59. package/build/components/header/undo-redo/undo.js.map +1 -1
  60. package/build/components/keyboard-shortcuts/index.js +2 -10
  61. package/build/components/keyboard-shortcuts/index.js.map +1 -1
  62. package/build/components/navigation-sidebar/index.js +1 -1
  63. package/build/components/navigation-sidebar/index.js.map +1 -1
  64. package/build/components/navigation-sidebar/navigation-panel/constants.js +10 -10
  65. package/build/components/navigation-sidebar/navigation-panel/constants.js.map +1 -1
  66. package/build/components/save-button/index.js +1 -1
  67. package/build/components/save-button/index.js.map +1 -1
  68. package/build/components/secondary-sidebar/inserter-sidebar.js +2 -1
  69. package/build/components/secondary-sidebar/inserter-sidebar.js.map +1 -1
  70. package/build/components/sidebar/global-styles-sidebar.js +11 -161
  71. package/build/components/sidebar/global-styles-sidebar.js.map +1 -1
  72. package/build/components/sidebar/index.js +1 -6
  73. package/build/components/sidebar/index.js.map +1 -1
  74. package/build/components/sidebar/plugin-sidebar/index.js +95 -0
  75. package/build/components/sidebar/plugin-sidebar/index.js.map +1 -0
  76. package/build/components/template-details/index.js +12 -6
  77. package/build/components/template-details/index.js.map +1 -1
  78. package/build/components/template-details/template-areas.js +73 -0
  79. package/build/components/template-details/template-areas.js.map +1 -0
  80. package/build/components/template-part-converter/index.js +1 -1
  81. package/build/components/template-part-converter/index.js.map +1 -1
  82. package/build/components/url-query-controller/index.js +1 -1
  83. package/build/components/url-query-controller/index.js.map +1 -1
  84. package/build/index.js +24 -0
  85. package/build/index.js.map +1 -1
  86. package/build/store/actions.js +54 -1
  87. package/build/store/actions.js.map +1 -1
  88. package/build/store/constants.js +19 -1
  89. package/build/store/constants.js.map +1 -1
  90. package/build/store/reducer.js +16 -7
  91. package/build/store/reducer.js.map +1 -1
  92. package/build/store/selectors.js +91 -9
  93. package/build/store/selectors.js.map +1 -1
  94. package/build-module/components/block-editor/back-button.js +48 -0
  95. package/build-module/components/block-editor/back-button.js.map +1 -0
  96. package/build-module/components/block-editor/index.js +15 -4
  97. package/build-module/components/block-editor/index.js.map +1 -1
  98. package/build-module/components/edit-template-part-menu-button/index.js +49 -0
  99. package/build-module/components/edit-template-part-menu-button/index.js.map +1 -0
  100. package/build-module/components/editor/global-styles-provider.js +1 -1
  101. package/build-module/components/editor/global-styles-provider.js.map +1 -1
  102. package/build-module/components/editor/index.js +4 -5
  103. package/build-module/components/editor/index.js.map +1 -1
  104. package/build-module/components/editor/utils.js +1 -1
  105. package/build-module/components/editor/utils.js.map +1 -1
  106. package/build-module/components/{sidebar → global-styles}/border-panel.js +0 -0
  107. package/build-module/components/global-styles/border-panel.js.map +1 -0
  108. package/build-module/components/{sidebar → global-styles}/color-palette-panel.js +4 -2
  109. package/build-module/components/global-styles/color-palette-panel.js.map +1 -0
  110. package/build-module/components/{sidebar → global-styles}/color-panel.js +8 -12
  111. package/build-module/components/global-styles/color-panel.js.map +1 -0
  112. package/build-module/components/global-styles/context-menu.js +41 -0
  113. package/build-module/components/global-styles/context-menu.js.map +1 -0
  114. package/build-module/components/{sidebar → global-styles}/dimensions-panel.js +6 -7
  115. package/build-module/components/global-styles/dimensions-panel.js.map +1 -0
  116. package/build-module/components/global-styles/header.js +41 -0
  117. package/build-module/components/global-styles/header.js.map +1 -0
  118. package/build-module/components/global-styles/index.js +70 -0
  119. package/build-module/components/global-styles/index.js.map +1 -0
  120. package/build-module/components/global-styles/navigation-button.js +31 -0
  121. package/build-module/components/global-styles/navigation-button.js.map +1 -0
  122. package/build-module/components/global-styles/palette.js +43 -0
  123. package/build-module/components/global-styles/palette.js.map +1 -0
  124. package/build-module/components/global-styles/preview.js +50 -0
  125. package/build-module/components/global-styles/preview.js.map +1 -0
  126. package/build-module/components/global-styles/screen-block-list.js +58 -0
  127. package/build-module/components/global-styles/screen-block-list.js.map +1 -0
  128. package/build-module/components/global-styles/screen-block.js +32 -0
  129. package/build-module/components/global-styles/screen-block.js.map +1 -0
  130. package/build-module/components/global-styles/screen-color-palette.js +35 -0
  131. package/build-module/components/global-styles/screen-color-palette.js.map +1 -0
  132. package/build-module/components/global-styles/screen-colors.js +38 -0
  133. package/build-module/components/global-styles/screen-colors.js.map +1 -0
  134. package/build-module/components/global-styles/screen-layout.js +44 -0
  135. package/build-module/components/global-styles/screen-layout.js.map +1 -0
  136. package/build-module/components/global-styles/screen-root.js +29 -0
  137. package/build-module/components/global-styles/screen-root.js.map +1 -0
  138. package/build-module/components/global-styles/screen-typography.js +37 -0
  139. package/build-module/components/global-styles/screen-typography.js.map +1 -0
  140. package/build-module/components/global-styles/subtitle.js +17 -0
  141. package/build-module/components/global-styles/subtitle.js.map +1 -0
  142. package/build-module/components/{sidebar → global-styles}/typography-panel.js +1 -2
  143. package/build-module/components/global-styles/typography-panel.js.map +1 -0
  144. package/build-module/components/header/plugin-more-menu-item/index.js +70 -0
  145. package/build-module/components/header/plugin-more-menu-item/index.js.map +1 -0
  146. package/build-module/components/header/plugin-sidebar-more-menu-item/index.js +64 -0
  147. package/build-module/components/header/plugin-sidebar-more-menu-item/index.js.map +1 -0
  148. package/build-module/components/header/undo-redo/redo.js +1 -1
  149. package/build-module/components/header/undo-redo/redo.js.map +1 -1
  150. package/build-module/components/header/undo-redo/undo.js +1 -1
  151. package/build-module/components/header/undo-redo/undo.js.map +1 -1
  152. package/build-module/components/keyboard-shortcuts/index.js +3 -11
  153. package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
  154. package/build-module/components/navigation-sidebar/index.js +1 -1
  155. package/build-module/components/navigation-sidebar/index.js.map +1 -1
  156. package/build-module/components/navigation-sidebar/navigation-panel/constants.js +5 -3
  157. package/build-module/components/navigation-sidebar/navigation-panel/constants.js.map +1 -1
  158. package/build-module/components/save-button/index.js +1 -1
  159. package/build-module/components/save-button/index.js.map +1 -1
  160. package/build-module/components/secondary-sidebar/inserter-sidebar.js +2 -1
  161. package/build-module/components/secondary-sidebar/inserter-sidebar.js.map +1 -1
  162. package/build-module/components/sidebar/global-styles-sidebar.js +13 -159
  163. package/build-module/components/sidebar/global-styles-sidebar.js.map +1 -1
  164. package/build-module/components/sidebar/index.js +2 -7
  165. package/build-module/components/sidebar/index.js.map +1 -1
  166. package/build-module/components/sidebar/plugin-sidebar/index.js +84 -0
  167. package/build-module/components/sidebar/plugin-sidebar/index.js.map +1 -0
  168. package/build-module/components/template-details/index.js +13 -8
  169. package/build-module/components/template-details/index.js.map +1 -1
  170. package/build-module/components/template-details/template-areas.js +60 -0
  171. package/build-module/components/template-details/template-areas.js.map +1 -0
  172. package/build-module/components/template-part-converter/index.js +1 -1
  173. package/build-module/components/template-part-converter/index.js.map +1 -1
  174. package/build-module/components/url-query-controller/index.js +1 -1
  175. package/build-module/components/url-query-controller/index.js.map +1 -1
  176. package/build-module/index.js +3 -0
  177. package/build-module/index.js.map +1 -1
  178. package/build-module/store/actions.js +45 -1
  179. package/build-module/store/actions.js.map +1 -1
  180. package/build-module/store/constants.js +13 -0
  181. package/build-module/store/constants.js.map +1 -1
  182. package/build-module/store/reducer.js +16 -7
  183. package/build-module/store/reducer.js.map +1 -1
  184. package/build-module/store/selectors.js +85 -9
  185. package/build-module/store/selectors.js.map +1 -1
  186. package/build-style/style-rtl.css +122 -17
  187. package/build-style/style.css +122 -17
  188. package/package.json +26 -26
  189. package/src/components/block-editor/back-button.js +44 -0
  190. package/src/components/block-editor/index.js +16 -1
  191. package/src/components/block-editor/style.scss +26 -0
  192. package/src/components/edit-template-part-menu-button/index.js +57 -0
  193. package/src/components/editor/global-styles-provider.js +1 -1
  194. package/src/components/editor/index.js +5 -8
  195. package/src/components/editor/utils.js +1 -0
  196. package/src/components/{sidebar → global-styles}/border-panel.js +0 -0
  197. package/src/components/{sidebar → global-styles}/color-palette-panel.js +13 -11
  198. package/src/components/{sidebar → global-styles}/color-panel.js +12 -17
  199. package/src/components/global-styles/context-menu.js +54 -0
  200. package/src/components/{sidebar → global-styles}/dimensions-panel.js +6 -10
  201. package/src/components/global-styles/header.js +50 -0
  202. package/src/components/global-styles/index.js +81 -0
  203. package/src/components/global-styles/navigation-button.js +35 -0
  204. package/src/components/global-styles/palette.js +67 -0
  205. package/src/components/global-styles/preview.js +41 -0
  206. package/src/components/global-styles/screen-block-list.js +59 -0
  207. package/src/components/global-styles/screen-block.js +28 -0
  208. package/src/components/global-styles/screen-color-palette.js +33 -0
  209. package/src/components/global-styles/screen-colors.js +36 -0
  210. package/src/components/global-styles/screen-layout.js +45 -0
  211. package/src/components/global-styles/screen-root.js +43 -0
  212. package/src/components/global-styles/screen-typography.js +33 -0
  213. package/src/components/global-styles/style.scss +35 -0
  214. package/src/components/global-styles/subtitle.js +10 -0
  215. package/src/components/{sidebar → global-styles}/typography-panel.js +1 -2
  216. package/src/components/header/plugin-more-menu-item/index.js +71 -0
  217. package/src/components/header/plugin-sidebar-more-menu-item/index.js +64 -0
  218. package/src/components/header/undo-redo/redo.js +4 -1
  219. package/src/components/header/undo-redo/undo.js +4 -1
  220. package/src/components/keyboard-shortcuts/index.js +25 -40
  221. package/src/components/navigation-sidebar/index.js +1 -1
  222. package/src/components/navigation-sidebar/navigation-panel/constants.js +9 -4
  223. package/src/components/navigation-sidebar/navigation-panel/style.scss +1 -0
  224. package/src/components/save-button/index.js +1 -1
  225. package/src/components/secondary-sidebar/inserter-sidebar.js +1 -0
  226. package/src/components/sidebar/global-styles-sidebar.js +14 -187
  227. package/src/components/sidebar/index.js +2 -7
  228. package/src/components/sidebar/plugin-sidebar/index.js +80 -0
  229. package/src/components/sidebar/style.scss +40 -0
  230. package/src/components/template-details/index.js +17 -7
  231. package/src/components/template-details/style.scss +36 -27
  232. package/src/components/template-details/template-areas.js +66 -0
  233. package/src/components/template-part-converter/index.js +1 -1
  234. package/src/components/url-query-controller/index.js +1 -1
  235. package/src/index.js +3 -0
  236. package/src/store/actions.js +53 -1
  237. package/src/store/constants.js +15 -0
  238. package/src/store/reducer.js +26 -12
  239. package/src/store/selectors.js +96 -9
  240. package/src/store/test/reducer.js +40 -23
  241. package/src/store/test/selectors.js +34 -3
  242. package/src/style.scss +1 -0
  243. package/build/components/sidebar/border-panel.js.map +0 -1
  244. package/build/components/sidebar/color-palette-panel.js.map +0 -1
  245. package/build/components/sidebar/color-panel.js.map +0 -1
  246. package/build/components/sidebar/dimensions-panel.js.map +0 -1
  247. package/build/components/sidebar/typography-panel.js.map +0 -1
  248. package/build-module/components/sidebar/border-panel.js.map +0 -1
  249. package/build-module/components/sidebar/color-palette-panel.js.map +0 -1
  250. package/build-module/components/sidebar/color-panel.js.map +0 -1
  251. package/build-module/components/sidebar/dimensions-panel.js.map +0 -1
  252. 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,qBAAaC,MAAF,IAAcA,MAAM,CAAEC,eAAF,CAAN,CAAoBF,OAApB,EAAzB,CAAhB;AACA,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( ( select ) => select( coreStore ).hasRedo() );\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"]}
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,qBAAaC,MAAF,IAAcA,MAAM,CAAEC,eAAF,CAAN,CAAoBF,OAApB,EAAzB,CAAhB;AACA,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( ( select ) => select( coreStore ).hasUndo() );\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"]}
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', (0, _element.useCallback)(() => {
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","bindGlobal","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,qBAAaC,MAAF,IACjCA,MAAM,CAAEC,YAAF,CAAN,CAAwBC,gBAAxB,EADsB,CAAvB;AAGA,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,sCACC,qBADD,EA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C,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;AACjBb,MAAAA,IAAI,EAAE,iCADW;AAEjBe,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;AACjBb,MAAAA,IAAI,EAAE,8CADW;AAEjBe,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;;AAEDrB,iBAAiB,CAAC4B,QAAlB,GAA6BR,yBAA7B;eACepB,iB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useCallback, 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( ( select ) =>\n\t\tselect( editSiteStore ).isListViewOpened()\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(\n\t\t'core/edit-site/undo',\n\t\t( event ) => {\n\t\t\tundo();\n\t\t\tevent.preventDefault();\n\t\t},\n\t\t{ bindGlobal: true }\n\t);\n\n\tuseShortcut(\n\t\t'core/edit-site/redo',\n\t\t( event ) => {\n\t\t\tredo();\n\t\t\tevent.preventDefault();\n\t\t},\n\t\t{ bindGlobal: true }\n\t);\n\n\tuseShortcut(\n\t\t'core/edit-site/toggle-list-view',\n\t\tuseCallback( () => {\n\t\t\tsetIsListViewOpened( ! isListViewOpen );\n\t\t}, [ isListViewOpen, setIsListViewOpened ] ),\n\t\t{ bindGlobal: true }\n\t);\n\n\tuseShortcut(\n\t\t'core/edit-site/toggle-block-settings-sidebar',\n\t\t( event ) => {\n\t\t\t// This shortcut has no known clashes, but use preventDefault to prevent any\n\t\t\t// obscure shortcuts from triggering.\n\t\t\tevent.preventDefault();\n\n\t\t\tif ( isBlockInspectorOpen ) {\n\t\t\t\tdisableComplementaryArea( STORE_NAME );\n\t\t\t} else {\n\t\t\t\tenableComplementaryArea( STORE_NAME, SIDEBAR_BLOCK );\n\t\t\t}\n\t\t},\n\t\t{ bindGlobal: true }\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"]}
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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AAAA,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.TEMPLATE_PART_AREA_SIDEBAR = exports.TEMPLATE_PART_AREA_FOOTER = exports.TEMPLATE_PART_AREA_HEADER = 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;
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","TEMPLATE_PART_AREA_HEADER","TEMPLATE_PART_AREA_FOOTER","TEMPLATE_PART_AREA_SIDEBAR","TEMPLATE_PARTS_SUB_MENUS","area","menu","title"],"mappings":";;;;;;;AAGA;;AAHA;AACA;AACA;AAGO,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,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CU,EAAAA,KAAK,EAAE,cAAI,SAAJ;AAHR,CADuC,EAMvC;AACCF,EAAAA,IAAI,EAAEH,yBADP;AAECI,EAAAA,IAAI,EAAER,2BAFP;AAGCS,EAAAA,KAAK,EAAE,cAAI,SAAJ;AAHR,CANuC,EAWvC;AACCF,EAAAA,IAAI,EAAEF,0BADP;AAECG,EAAAA,IAAI,EAAEP,4BAFP;AAGCQ,EAAAA,KAAK,EAAE,cAAI,UAAJ;AAHR,CAXuC,EAgBvC;AACCF,EAAAA,IAAI,EAAE,eADP;AAECC,EAAAA,IAAI,EAAEN,2BAFP;AAGCO,EAAAA,KAAK,EAAE,cAAI,SAAJ;AAHR,CAhBuC,CAAjC","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\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_PART_AREA_HEADER = 'header';\nexport const TEMPLATE_PART_AREA_FOOTER = 'footer';\nexport const TEMPLATE_PART_AREA_SIDEBAR = 'sidebar';\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"]}
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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vC;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;AALjB,IADD,CAXD,CADD;AAwBA","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/>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n"]}
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 _blocks = require("@wordpress/blocks");
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 _typographyPanel = _interopRequireWildcard(require("./typography-panel"));
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 GlobalStylesPanel({
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: identifier,
160
- title: title,
161
- icon: icon,
162
- closeLabel: closeLabel,
163
- header: (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)("strong", null, title), (0, _element.createElement)(_components.Button, {
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)(_components.TabPanel, {
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":["GlobalStylesPanel","wrapperPanelTitle","context","getStyle","setStyle","getSetting","setSetting","hasBorderPanel","hasColorPanel","hasTypographyPanel","hasDimensionsPanel","content","getPanelTitle","blockName","blockType","undefined","title","GlobalStylesBlockPanels","blocks","panels","block","name","GlobalStylesSidebar","identifier","icon","closeLabel","root","canRestart","onReset","tab"],"mappings":";;;;;;;;;;;AAWA;;AARA;;AAKA;;AACA;;AACA;;AAMA;;AAIA;;AACA;;AAIA;;AACA;;AACA;;AA3BA;AACA;AACA;;AAGA;AACA;AACA;;AAMA;AACA;AACA;AAiBA,SAASA,iBAAT,CAA4B;AAC3BC,EAAAA,iBAD2B;AAE3BC,EAAAA,OAF2B;AAG3BC,EAAAA,QAH2B;AAI3BC,EAAAA,QAJ2B;AAK3BC,EAAAA,UAL2B;AAM3BC,EAAAA;AAN2B,CAA5B,EAOI;AACH,QAAMC,cAAc,GAAG,oCAAmBL,OAAnB,CAAvB;AACA,QAAMM,aAAa,GAAG,kCAAkBN,OAAlB,CAAtB;AACA,QAAMO,kBAAkB,GAAG,4CAAuBP,OAAvB,CAA3B;AACA,QAAMQ,kBAAkB,GAAG,4CAAuBR,OAAvB,CAA3B;;AAEA,MAAK,CAAEM,aAAF,IAAmB,CAAEC,kBAArB,IAA2C,CAAEC,kBAAl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GP,KAHT;AAIC,IAAA,IAAI,EAAGQ,IAJR;AAKC,IAAA,UAAU,EAAGC,UALd;AAMC,IAAA,MAAM,EACL,qDACC,4CAAUT,KAAV,CADD,EAEC,4BAAC,kBAAD;AACC,MAAA,SAAS,EAAC,+CADX;AAEC,MAAA,OAAO,MAFR;AAGC,MAAA,OAAO,EAAC,UAHT;AAIC,MAAA,QAAQ,EAAG,CAAEW,UAJd;AAKC,MAAA,OAAO,EAAGC;AALX,OAOG,cAAI,mBAAJ,CAPH,CAFD;AAPF,KAqBC,4BAAC,oBAAD;AACC,IAAA,IAAI,EAAG,CACN;AAAEP,MAAAA,IAAI,EAAE,MAAR;AAAgBL,MAAAA,KAAK,EAAE,cAAI,MAAJ;AAAvB,KADM,EAEN;AAAEK,MAAAA,IAAI,EAAE,OAAR;AAAiBL,MAAAA,KAAK,EAAE,cAAI,eAAJ;AAAxB,KAFM;AADR,KAMKa,GAAF,IAAW;AACZ;AACA,QAAK,YAAYA,GAAG,CAACR,IAArB,EAA4B;AAC3B,aACC,4BAAC,uBAAD;AACC,QAAA,MAAM,EAAGH,MADV;AAEC,QAAA,QAAQ,EAAGf,QAFZ;AAGC,QAAA,QAAQ,EAAGC,QAHZ;AAIC,QAAA,UAAU,EAAGC,UAJd;AAKC,QAAA,UAAU,EAAGC;AALd,QADD;AASA;;AACD,WACC,4BAAC,iBAAD;AACC,MAAA,UAAU,EAAG,KADd;AAEC,MAAA,OAAO,EAAGoB,IAFX;AAGC,MAAA,QAAQ,EAAGvB,QAHZ;AAIC,MAAA,QAAQ,EAAGC,QAJZ;AAKC,MAAA,UAAU,EAAGC,UALd;AAMC,MAAA,UAAU,EAAGC;AANd,MADD;AAUA,GA7BF,CArBD,CADD;AAuDA","sourcesContent":["/**\n * External dependencies\n */\nimport { map, sortBy } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { Button, PanelBody, TabPanel } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { getBlockType } from '@wordpress/blocks';\nimport { useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport {\n\tuseGlobalStylesContext,\n\tuseGlobalStylesReset,\n} from '../editor/global-styles-provider';\nimport DefaultSidebar from './default-sidebar';\nimport {\n\tdefault as TypographyPanel,\n\tuseHasTypographyPanel,\n} from './typography-panel';\nimport { default as BorderPanel, useHasBorderPanel } from './border-panel';\nimport { default as ColorPanel, useHasColorPanel } from './color-panel';\nimport {\n\tdefault as DimensionsPanel,\n\tuseHasDimensionsPanel,\n} from './dimensions-panel';\n\nfunction GlobalStylesPanel( {\n\twrapperPanelTitle,\n\tcontext,\n\tgetStyle,\n\tsetStyle,\n\tgetSetting,\n\tsetSetting,\n} ) {\n\tconst hasBorderPanel = useHasBorderPanel( context );\n\tconst hasColorPanel = useHasColorPanel( context );\n\tconst hasTypographyPanel = useHasTypographyPanel( context );\n\tconst hasDimensionsPanel = useHasDimensionsPanel( context );\n\n\tif ( ! hasColorPanel && ! hasTypographyPanel && ! hasDimensionsPanel ) {\n\t\treturn null;\n\t}\n\n\tconst content = (\n\t\t<>\n\t\t\t{ hasTypographyPanel && (\n\t\t\t\t<TypographyPanel\n\t\t\t\t\tcontext={ context }\n\t\t\t\t\tgetStyle={ getStyle }\n\t\t\t\t\tsetStyle={ setStyle }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ hasColorPanel && (\n\t\t\t\t<ColorPanel\n\t\t\t\t\tcontext={ context }\n\t\t\t\t\tgetStyle={ getStyle }\n\t\t\t\t\tsetStyle={ setStyle }\n\t\t\t\t\tgetSetting={ getSetting }\n\t\t\t\t\tsetSetting={ setSetting }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ hasDimensionsPanel && (\n\t\t\t\t<DimensionsPanel\n\t\t\t\t\tcontext={ context }\n\t\t\t\t\tgetStyle={ getStyle }\n\t\t\t\t\tsetStyle={ setStyle }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ hasBorderPanel && (\n\t\t\t\t<BorderPanel\n\t\t\t\t\tcontext={ context }\n\t\t\t\t\tgetStyle={ getStyle }\n\t\t\t\t\tsetStyle={ setStyle }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n\tif ( ! wrapperPanelTitle ) {\n\t\treturn content;\n\t}\n\treturn (\n\t\t<PanelBody title={ wrapperPanelTitle } initialOpen={ false }>\n\t\t\t{ content }\n\t\t</PanelBody>\n\t);\n}\n\nfunction getPanelTitle( blockName ) {\n\tconst blockType = getBlockType( blockName );\n\n\t// Protect against blocks that aren't registered\n\t// eg: widget-area\n\tif ( blockType === undefined ) {\n\t\treturn blockName;\n\t}\n\n\treturn blockType.title;\n}\n\nfunction GlobalStylesBlockPanels( {\n\tblocks,\n\tgetStyle,\n\tsetStyle,\n\tgetSetting,\n\tsetSetting,\n} ) {\n\tconst panels = useMemo(\n\t\t() =>\n\t\t\tsortBy(\n\t\t\t\tmap( blocks, ( block, name ) => {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tblock,\n\t\t\t\t\t\tname,\n\t\t\t\t\t\twrapperPanelTitle: getPanelTitle( name ),\n\t\t\t\t\t};\n\t\t\t\t} ),\n\t\t\t\t( { wrapperPanelTitle } ) => wrapperPanelTitle\n\t\t\t),\n\t\t[ blocks ]\n\t);\n\n\treturn map( panels, ( { block, name, wrapperPanelTitle } ) => {\n\t\treturn (\n\t\t\t<GlobalStylesPanel\n\t\t\t\tkey={ 'panel-' + name }\n\t\t\t\twrapperPanelTitle={ wrapperPanelTitle }\n\t\t\t\tcontext={ block }\n\t\t\t\tgetStyle={ getStyle }\n\t\t\t\tsetStyle={ setStyle }\n\t\t\t\tgetSetting={ getSetting }\n\t\t\t\tsetSetting={ setSetting }\n\t\t\t/>\n\t\t);\n\t} );\n}\n\nexport default function GlobalStylesSidebar( {\n\tidentifier,\n\ttitle,\n\ticon,\n\tcloseLabel,\n} ) {\n\tconst {\n\t\troot,\n\t\tblocks,\n\t\tgetStyle,\n\t\tsetStyle,\n\t\tgetSetting,\n\t\tsetSetting,\n\t} = useGlobalStylesContext();\n\tconst [ canRestart, onReset ] = useGlobalStylesReset();\n\n\tif ( typeof blocks !== 'object' || ! root ) {\n\t\t// No sidebar is shown.\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<DefaultSidebar\n\t\t\tclassName=\"edit-site-global-styles-sidebar\"\n\t\t\tidentifier={ identifier }\n\t\t\ttitle={ title }\n\t\t\ticon={ icon }\n\t\t\tcloseLabel={ closeLabel }\n\t\t\theader={\n\t\t\t\t<>\n\t\t\t\t\t<strong>{ title }</strong>\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<TabPanel\n\t\t\t\ttabs={ [\n\t\t\t\t\t{ name: 'root', title: __( 'Root' ) },\n\t\t\t\t\t{ name: 'block', title: __( 'By Block Type' ) },\n\t\t\t\t] }\n\t\t\t>\n\t\t\t\t{ ( tab ) => {\n\t\t\t\t\t/* Per Block Context */\n\t\t\t\t\tif ( 'block' === tab.name ) {\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<GlobalStylesBlockPanels\n\t\t\t\t\t\t\t\tblocks={ blocks }\n\t\t\t\t\t\t\t\tgetStyle={ getStyle }\n\t\t\t\t\t\t\t\tsetStyle={ setStyle }\n\t\t\t\t\t\t\t\tgetSetting={ getSetting }\n\t\t\t\t\t\t\t\tsetSetting={ setSetting }\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\treturn (\n\t\t\t\t\t\t<GlobalStylesPanel\n\t\t\t\t\t\t\thasWrapper={ false }\n\t\t\t\t\t\t\tcontext={ root }\n\t\t\t\t\t\t\tgetStyle={ getStyle }\n\t\t\t\t\t\t\tsetStyle={ setStyle }\n\t\t\t\t\t\t\tgetSetting={ getSetting }\n\t\t\t\t\t\t\tsetSetting={ setSetting }\n\t\t\t\t\t\t/>\n\t\t\t\t\t);\n\t\t\t\t} }\n\t\t\t</TabPanel>\n\t\t</DefaultSidebar>\n\t);\n}\n"]}
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