@wordpress/block-library 9.24.0 → 9.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (300) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/build/avatar/edit.js +84 -39
  3. package/build/avatar/edit.js.map +1 -1
  4. package/build/avatar/user-control.js +32 -17
  5. package/build/avatar/user-control.js.map +1 -1
  6. package/build/button/edit.js +29 -17
  7. package/build/button/edit.js.map +1 -1
  8. package/build/columns/edit.js +18 -22
  9. package/build/columns/edit.js.map +1 -1
  10. package/build/comment-author-name/edit.js +41 -12
  11. package/build/comment-author-name/edit.js.map +1 -1
  12. package/build/comment-date/edit.js +41 -12
  13. package/build/comment-date/edit.js.map +1 -1
  14. package/build/comment-edit-link/edit.js +27 -7
  15. package/build/comment-edit-link/edit.js.map +1 -1
  16. package/build/comments/edit/comments-inspector-controls.js +1 -3
  17. package/build/comments/edit/comments-inspector-controls.js.map +1 -1
  18. package/build/comments-pagination/edit.js +23 -9
  19. package/build/comments-pagination/edit.js.map +1 -1
  20. package/build/comments-title/edit.js +41 -12
  21. package/build/comments-title/edit.js.map +1 -1
  22. package/build/details/edit.js +27 -3
  23. package/build/details/edit.js.map +1 -1
  24. package/build/embed/edit.js +2 -4
  25. package/build/embed/edit.js.map +1 -1
  26. package/build/embed/embed-controls.js +41 -22
  27. package/build/embed/embed-controls.js.map +1 -1
  28. package/build/embed/variations.js +0 -10
  29. package/build/embed/variations.js.map +1 -1
  30. package/build/file/inspector.js +73 -30
  31. package/build/file/inspector.js.map +1 -1
  32. package/build/form/edit.js +67 -38
  33. package/build/form/edit.js.map +1 -1
  34. package/build/form/index.js +3 -3
  35. package/build/form/index.js.map +1 -1
  36. package/build/form-input/edit.js +47 -18
  37. package/build/form-input/edit.js.map +1 -1
  38. package/build/form-input/index.js +2 -1
  39. package/build/form-input/index.js.map +1 -1
  40. package/build/form-submission-notification/index.js +2 -1
  41. package/build/form-submission-notification/index.js.map +1 -1
  42. package/build/form-submit-button/index.js +2 -1
  43. package/build/form-submit-button/index.js.map +1 -1
  44. package/build/image/image.js +1 -0
  45. package/build/image/image.js.map +1 -1
  46. package/build/image/view.js +0 -3
  47. package/build/image/view.js.map +1 -1
  48. package/build/latest-posts/edit.js +154 -82
  49. package/build/latest-posts/edit.js.map +1 -1
  50. package/build/list/ordered-list-settings.js +131 -52
  51. package/build/list/ordered-list-settings.js.map +1 -1
  52. package/build/navigation/edit/index.js +93 -51
  53. package/build/navigation/edit/index.js.map +1 -1
  54. package/build/navigation/edit/overlay-menu-preview.js +43 -27
  55. package/build/navigation/edit/overlay-menu-preview.js.map +1 -1
  56. package/build/navigation-link/edit.js +11 -0
  57. package/build/navigation-link/edit.js.map +1 -1
  58. package/build/navigation-link/index.js +3 -0
  59. package/build/navigation-link/index.js.map +1 -1
  60. package/build/navigation-link/transforms.js +2 -0
  61. package/build/navigation-link/transforms.js.map +1 -1
  62. package/build/navigation-link/update-attributes.js +1 -0
  63. package/build/navigation-link/update-attributes.js.map +1 -1
  64. package/build/navigation-submenu/index.js +3 -0
  65. package/build/navigation-submenu/index.js.map +1 -1
  66. package/build/post-author/edit.js +75 -18
  67. package/build/post-author/edit.js.map +1 -1
  68. package/build/post-comments-count/index.js +3 -1
  69. package/build/post-comments-count/index.js.map +1 -1
  70. package/build/post-comments-count/transforms.js +26 -0
  71. package/build/post-comments-count/transforms.js.map +1 -0
  72. package/build/post-comments-link/index.js +3 -1
  73. package/build/post-comments-link/index.js.map +1 -1
  74. package/build/post-comments-link/transforms.js +26 -0
  75. package/build/post-comments-link/transforms.js.map +1 -0
  76. package/build/post-navigation-link/edit.js +72 -33
  77. package/build/post-navigation-link/edit.js.map +1 -1
  78. package/build/post-title/edit.js +56 -18
  79. package/build/post-title/edit.js.map +1 -1
  80. package/build/query/edit/enhanced-pagination-modal.js +1 -1
  81. package/build/query/edit/enhanced-pagination-modal.js.map +1 -1
  82. package/build/query/edit/inspector-controls/enhanced-pagination-control.js +3 -6
  83. package/build/query/edit/inspector-controls/enhanced-pagination-control.js.map +1 -1
  84. package/build/rss/edit.js +120 -46
  85. package/build/rss/edit.js.map +1 -1
  86. package/build/separator/edit.js +52 -20
  87. package/build/separator/edit.js.map +1 -1
  88. package/build/shortcode/index.js +2 -1
  89. package/build/shortcode/index.js.map +1 -1
  90. package/build/site-logo/edit.js +53 -19
  91. package/build/site-logo/edit.js.map +1 -1
  92. package/build/social-link/edit.js +21 -5
  93. package/build/social-link/edit.js.map +1 -1
  94. package/build/social-link/edit.native.js +13 -5
  95. package/build/social-link/edit.native.js.map +1 -1
  96. package/build/social-link/social-list.js +17 -25
  97. package/build/social-link/social-list.js.map +1 -1
  98. package/build/social-link/variations.js +53 -48
  99. package/build/social-link/variations.js.map +1 -1
  100. package/build/social-links/edit.js +38 -45
  101. package/build/social-links/edit.js.map +1 -1
  102. package/build/video/tracks-editor.js +63 -21
  103. package/build/video/tracks-editor.js.map +1 -1
  104. package/build-module/avatar/edit.js +83 -38
  105. package/build-module/avatar/edit.js.map +1 -1
  106. package/build-module/avatar/user-control.js +33 -18
  107. package/build-module/avatar/user-control.js.map +1 -1
  108. package/build-module/button/edit.js +30 -18
  109. package/build-module/button/edit.js.map +1 -1
  110. package/build-module/columns/edit.js +18 -22
  111. package/build-module/columns/edit.js.map +1 -1
  112. package/build-module/comment-author-name/edit.js +42 -13
  113. package/build-module/comment-author-name/edit.js.map +1 -1
  114. package/build-module/comment-date/edit.js +42 -13
  115. package/build-module/comment-date/edit.js.map +1 -1
  116. package/build-module/comment-edit-link/edit.js +28 -8
  117. package/build-module/comment-edit-link/edit.js.map +1 -1
  118. package/build-module/comments/edit/comments-inspector-controls.js +1 -3
  119. package/build-module/comments/edit/comments-inspector-controls.js.map +1 -1
  120. package/build-module/comments-pagination/edit.js +24 -10
  121. package/build-module/comments-pagination/edit.js.map +1 -1
  122. package/build-module/comments-title/edit.js +42 -13
  123. package/build-module/comments-title/edit.js.map +1 -1
  124. package/build-module/details/edit.js +29 -5
  125. package/build-module/details/edit.js.map +1 -1
  126. package/build-module/embed/edit.js +2 -4
  127. package/build-module/embed/edit.js.map +1 -1
  128. package/build-module/embed/embed-controls.js +42 -23
  129. package/build-module/embed/embed-controls.js.map +1 -1
  130. package/build-module/embed/variations.js +0 -10
  131. package/build-module/embed/variations.js.map +1 -1
  132. package/build-module/file/inspector.js +74 -31
  133. package/build-module/file/inspector.js.map +1 -1
  134. package/build-module/form/edit.js +68 -39
  135. package/build-module/form/edit.js.map +1 -1
  136. package/build-module/form/index.js +3 -3
  137. package/build-module/form/index.js.map +1 -1
  138. package/build-module/form-input/edit.js +48 -19
  139. package/build-module/form-input/edit.js.map +1 -1
  140. package/build-module/form-input/index.js +2 -1
  141. package/build-module/form-input/index.js.map +1 -1
  142. package/build-module/form-submission-notification/index.js +2 -1
  143. package/build-module/form-submission-notification/index.js.map +1 -1
  144. package/build-module/form-submit-button/index.js +2 -1
  145. package/build-module/form-submit-button/index.js.map +1 -1
  146. package/build-module/image/image.js +1 -0
  147. package/build-module/image/image.js.map +1 -1
  148. package/build-module/image/view.js +0 -3
  149. package/build-module/image/view.js.map +1 -1
  150. package/build-module/latest-posts/edit.js +155 -83
  151. package/build-module/latest-posts/edit.js.map +1 -1
  152. package/build-module/list/ordered-list-settings.js +132 -53
  153. package/build-module/list/ordered-list-settings.js.map +1 -1
  154. package/build-module/navigation/edit/index.js +94 -52
  155. package/build-module/navigation/edit/index.js.map +1 -1
  156. package/build-module/navigation/edit/overlay-menu-preview.js +44 -28
  157. package/build-module/navigation/edit/overlay-menu-preview.js.map +1 -1
  158. package/build-module/navigation-link/edit.js +11 -0
  159. package/build-module/navigation-link/edit.js.map +1 -1
  160. package/build-module/navigation-link/index.js +3 -0
  161. package/build-module/navigation-link/index.js.map +1 -1
  162. package/build-module/navigation-link/transforms.js +2 -0
  163. package/build-module/navigation-link/transforms.js.map +1 -1
  164. package/build-module/navigation-link/update-attributes.js +1 -0
  165. package/build-module/navigation-link/update-attributes.js.map +1 -1
  166. package/build-module/navigation-submenu/index.js +3 -0
  167. package/build-module/navigation-submenu/index.js.map +1 -1
  168. package/build-module/post-author/edit.js +76 -19
  169. package/build-module/post-author/edit.js.map +1 -1
  170. package/build-module/post-comments-count/index.js +3 -1
  171. package/build-module/post-comments-count/index.js.map +1 -1
  172. package/build-module/post-comments-count/transforms.js +19 -0
  173. package/build-module/post-comments-count/transforms.js.map +1 -0
  174. package/build-module/post-comments-link/index.js +3 -1
  175. package/build-module/post-comments-link/index.js.map +1 -1
  176. package/build-module/post-comments-link/transforms.js +19 -0
  177. package/build-module/post-comments-link/transforms.js.map +1 -0
  178. package/build-module/post-navigation-link/edit.js +73 -34
  179. package/build-module/post-navigation-link/edit.js.map +1 -1
  180. package/build-module/post-title/edit.js +57 -19
  181. package/build-module/post-title/edit.js.map +1 -1
  182. package/build-module/query/edit/enhanced-pagination-modal.js +1 -1
  183. package/build-module/query/edit/enhanced-pagination-modal.js.map +1 -1
  184. package/build-module/query/edit/inspector-controls/enhanced-pagination-control.js +3 -6
  185. package/build-module/query/edit/inspector-controls/enhanced-pagination-control.js.map +1 -1
  186. package/build-module/rss/edit.js +121 -47
  187. package/build-module/rss/edit.js.map +1 -1
  188. package/build-module/separator/edit.js +54 -22
  189. package/build-module/separator/edit.js.map +1 -1
  190. package/build-module/shortcode/index.js +2 -1
  191. package/build-module/shortcode/index.js.map +1 -1
  192. package/build-module/site-logo/edit.js +54 -20
  193. package/build-module/site-logo/edit.js.map +1 -1
  194. package/build-module/social-link/edit.js +24 -8
  195. package/build-module/social-link/edit.js.map +1 -1
  196. package/build-module/social-link/edit.native.js +15 -6
  197. package/build-module/social-link/edit.native.js.map +1 -1
  198. package/build-module/social-link/social-list.js +16 -21
  199. package/build-module/social-link/social-list.js.map +1 -1
  200. package/build-module/social-link/variations.js +53 -48
  201. package/build-module/social-link/variations.js.map +1 -1
  202. package/build-module/social-links/edit.js +40 -47
  203. package/build-module/social-links/edit.js.map +1 -1
  204. package/build-module/video/tracks-editor.js +65 -23
  205. package/build-module/video/tracks-editor.js.map +1 -1
  206. package/build-style/calendar/style-rtl.css +7 -7
  207. package/build-style/calendar/style.css +7 -7
  208. package/build-style/comments-pagination/editor-rtl.css +0 -12
  209. package/build-style/comments-pagination/editor.css +0 -14
  210. package/build-style/comments-pagination/style-rtl.css +0 -7
  211. package/build-style/comments-pagination/style.css +0 -9
  212. package/build-style/editor-rtl.css +9 -21
  213. package/build-style/editor.css +9 -23
  214. package/build-style/gallery/style-rtl.css +1 -0
  215. package/build-style/gallery/style.css +1 -0
  216. package/build-style/navigation/editor-rtl.css +8 -3
  217. package/build-style/navigation/editor.css +8 -3
  218. package/build-style/navigation/style-rtl.css +4 -0
  219. package/build-style/navigation/style.css +4 -0
  220. package/build-style/pullquote/editor-rtl.css +1 -1
  221. package/build-style/pullquote/editor.css +1 -1
  222. package/build-style/pullquote/style-rtl.css +2 -3
  223. package/build-style/pullquote/style.css +2 -3
  224. package/build-style/pullquote/theme-rtl.css +2 -2
  225. package/build-style/pullquote/theme.css +2 -2
  226. package/build-style/style-rtl.css +14 -17
  227. package/build-style/style.css +14 -19
  228. package/build-style/theme-rtl.css +2 -2
  229. package/build-style/theme.css +2 -2
  230. package/package.json +35 -35
  231. package/src/avatar/edit.js +99 -51
  232. package/src/avatar/user-control.js +34 -29
  233. package/src/button/edit.js +44 -29
  234. package/src/calendar/style.scss +10 -10
  235. package/src/columns/edit.js +20 -31
  236. package/src/comment-author-name/edit.js +54 -13
  237. package/src/comment-date/edit.js +50 -15
  238. package/src/comment-edit-link/edit.js +39 -11
  239. package/src/comments/edit/comments-inspector-controls.js +0 -2
  240. package/src/comments-pagination/edit.js +29 -9
  241. package/src/comments-pagination/editor.scss +0 -15
  242. package/src/comments-pagination/style.scss +0 -8
  243. package/src/comments-title/edit.js +53 -15
  244. package/src/details/edit.js +36 -4
  245. package/src/editor.scss +0 -1
  246. package/src/embed/edit.js +3 -5
  247. package/src/embed/embed-controls.js +55 -33
  248. package/src/embed/variations.js +0 -8
  249. package/src/file/inspector.js +99 -45
  250. package/src/form/block.json +1 -2
  251. package/src/form/edit.js +91 -47
  252. package/src/form/index.js +1 -0
  253. package/src/form-input/edit.js +56 -18
  254. package/src/form-input/index.js +1 -0
  255. package/src/form-submission-notification/index.js +1 -0
  256. package/src/form-submit-button/index.js +1 -0
  257. package/src/gallery/style.scss +1 -0
  258. package/src/image/image.js +1 -0
  259. package/src/image/index.php +4 -1
  260. package/src/image/view.js +0 -3
  261. package/src/latest-posts/edit.js +206 -98
  262. package/src/list/ordered-list-settings.js +172 -62
  263. package/src/navigation/edit/index.js +127 -64
  264. package/src/navigation/edit/overlay-menu-preview.js +43 -26
  265. package/src/navigation/editor.scss +8 -4
  266. package/src/navigation/style.scss +8 -0
  267. package/src/navigation-link/block.json +3 -0
  268. package/src/navigation-link/edit.js +14 -1
  269. package/src/navigation-link/index.php +4 -0
  270. package/src/navigation-link/transforms.js +2 -1
  271. package/src/navigation-link/update-attributes.js +1 -0
  272. package/src/navigation-submenu/block.json +3 -0
  273. package/src/navigation-submenu/index.php +4 -0
  274. package/src/post-author/edit.js +91 -27
  275. package/src/post-comments-count/index.js +2 -0
  276. package/src/post-comments-count/transforms.js +20 -0
  277. package/src/post-comments-link/index.js +2 -0
  278. package/src/post-comments-link/transforms.js +20 -0
  279. package/src/post-navigation-link/edit.js +96 -51
  280. package/src/post-title/edit.js +76 -24
  281. package/src/pullquote/editor.scss +1 -1
  282. package/src/pullquote/style.scss +2 -3
  283. package/src/pullquote/theme.scss +2 -2
  284. package/src/query/edit/enhanced-pagination-modal.js +1 -5
  285. package/src/query/edit/inspector-controls/enhanced-pagination-control.js +3 -13
  286. package/src/rss/edit.js +141 -55
  287. package/src/separator/edit.js +66 -21
  288. package/src/shortcode/block.json +2 -1
  289. package/src/site-logo/edit.js +69 -26
  290. package/src/site-title/index.php +1 -1
  291. package/src/social-link/edit.js +18 -7
  292. package/src/social-link/edit.native.js +10 -4
  293. package/src/social-link/index.php +62 -49
  294. package/src/social-link/social-list.js +15 -20
  295. package/src/social-link/variations.js +53 -48
  296. package/src/social-links/edit.js +38 -60
  297. package/src/video/tracks-editor.js +75 -22
  298. package/build-style/post-author/editor-rtl.css +0 -140
  299. package/build-style/post-author/editor.css +0 -140
  300. package/src/post-author/editor.scss +0 -7
@@ -3,67 +3,146 @@
3
3
  */
4
4
  import { __ } from '@wordpress/i18n';
5
5
  import { InspectorControls } from '@wordpress/block-editor';
6
- import { TextControl, PanelBody, ToggleControl, SelectControl } from '@wordpress/components';
6
+ import { TextControl, PanelBody, ToggleControl, SelectControl, __experimentalToolsPanel as ToolsPanel, __experimentalToolsPanelItem as ToolsPanelItem } from '@wordpress/components';
7
+ import { Platform } from '@wordpress/element';
8
+
9
+ /**
10
+ * Internal dependencies
11
+ */
12
+ import { useToolsPanelDropdownMenuProps } from '../utils/hooks';
7
13
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
14
+ const LIST_STYLE_OPTIONS = [{
15
+ label: __('Numbers'),
16
+ value: 'decimal'
17
+ }, {
18
+ label: __('Uppercase letters'),
19
+ value: 'upper-alpha'
20
+ }, {
21
+ label: __('Lowercase letters'),
22
+ value: 'lower-alpha'
23
+ }, {
24
+ label: __('Uppercase Roman numerals'),
25
+ value: 'upper-roman'
26
+ }, {
27
+ label: __('Lowercase Roman numerals'),
28
+ value: 'lower-roman'
29
+ }];
8
30
  const OrderedListSettings = ({
9
31
  setAttributes,
10
32
  reversed,
11
33
  start,
12
34
  type
13
- }) => /*#__PURE__*/_jsx(InspectorControls, {
14
- children: /*#__PURE__*/_jsxs(PanelBody, {
15
- title: __('Settings'),
16
- children: [/*#__PURE__*/_jsx(SelectControl, {
17
- __next40pxDefaultSize: true,
18
- __nextHasNoMarginBottom: true,
19
- label: __('List style'),
20
- options: [{
21
- label: __('Numbers'),
22
- value: 'decimal'
23
- }, {
24
- label: __('Uppercase letters'),
25
- value: 'upper-alpha'
26
- }, {
27
- label: __('Lowercase letters'),
28
- value: 'lower-alpha'
29
- }, {
30
- label: __('Uppercase Roman numerals'),
31
- value: 'upper-roman'
32
- }, {
33
- label: __('Lowercase Roman numerals'),
34
- value: 'lower-roman'
35
- }],
36
- value: type,
37
- onChange: newValue => setAttributes({
38
- type: newValue
39
- })
40
- }), /*#__PURE__*/_jsx(TextControl, {
41
- __next40pxDefaultSize: true,
42
- __nextHasNoMarginBottom: true,
43
- label: __('Start value'),
44
- type: "number",
45
- onChange: value => {
46
- const int = parseInt(value, 10);
35
+ }) => {
36
+ const dropdownMenuProps = useToolsPanelDropdownMenuProps();
37
+ return /*#__PURE__*/_jsx(InspectorControls, {
38
+ children: Platform.isNative ? /*#__PURE__*/_jsxs(PanelBody, {
39
+ title: __('Settings'),
40
+ children: [/*#__PURE__*/_jsx(SelectControl, {
41
+ __next40pxDefaultSize: true,
42
+ __nextHasNoMarginBottom: true,
43
+ label: __('List style'),
44
+ options: LIST_STYLE_OPTIONS,
45
+ value: type,
46
+ onChange: newValue => setAttributes({
47
+ type: newValue
48
+ })
49
+ }), /*#__PURE__*/_jsx(TextControl, {
50
+ __next40pxDefaultSize: true,
51
+ __nextHasNoMarginBottom: true,
52
+ label: __('Start value'),
53
+ type: "number",
54
+ onChange: value => {
55
+ const int = parseInt(value, 10);
56
+ setAttributes({
57
+ // It should be possible to unset the value,
58
+ // e.g. with an empty string.
59
+ start: isNaN(int) ? undefined : int
60
+ });
61
+ },
62
+ value: Number.isInteger(start) ? start.toString(10) : '',
63
+ step: "1"
64
+ }), /*#__PURE__*/_jsx(ToggleControl, {
65
+ __nextHasNoMarginBottom: true,
66
+ label: __('Reverse order'),
67
+ checked: reversed || false,
68
+ onChange: value => {
69
+ setAttributes({
70
+ // Unset the attribute if not reversed.
71
+ reversed: value || undefined
72
+ });
73
+ }
74
+ })]
75
+ }) : /*#__PURE__*/_jsxs(ToolsPanel, {
76
+ label: __('Settings'),
77
+ resetAll: () => {
47
78
  setAttributes({
48
- // It should be possible to unset the value,
49
- // e.g. with an empty string.
50
- start: isNaN(int) ? undefined : int
79
+ type: undefined,
80
+ start: undefined,
81
+ reversed: undefined
51
82
  });
52
83
  },
53
- value: Number.isInteger(start) ? start.toString(10) : '',
54
- step: "1"
55
- }), /*#__PURE__*/_jsx(ToggleControl, {
56
- __nextHasNoMarginBottom: true,
57
- label: __('Reverse order'),
58
- checked: reversed || false,
59
- onChange: value => {
60
- setAttributes({
61
- // Unset the attribute if not reversed.
62
- reversed: value || undefined
63
- });
64
- }
65
- })]
66
- })
67
- });
84
+ dropdownMenuProps: dropdownMenuProps,
85
+ children: [/*#__PURE__*/_jsx(ToolsPanelItem, {
86
+ label: __('List style'),
87
+ isShownByDefault: true,
88
+ hasValue: () => !!type,
89
+ onDeselect: () => setAttributes({
90
+ type: undefined
91
+ }),
92
+ children: /*#__PURE__*/_jsx(SelectControl, {
93
+ __next40pxDefaultSize: true,
94
+ __nextHasNoMarginBottom: true,
95
+ label: __('List style'),
96
+ options: LIST_STYLE_OPTIONS,
97
+ value: type || 'decimal',
98
+ onChange: newValue => setAttributes({
99
+ type: newValue
100
+ })
101
+ })
102
+ }), /*#__PURE__*/_jsx(ToolsPanelItem, {
103
+ label: __('Start value'),
104
+ isShownByDefault: true,
105
+ hasValue: () => !!start,
106
+ onDeselect: () => setAttributes({
107
+ start: undefined
108
+ }),
109
+ children: /*#__PURE__*/_jsx(TextControl, {
110
+ __next40pxDefaultSize: true,
111
+ __nextHasNoMarginBottom: true,
112
+ label: __('Start value'),
113
+ type: "number",
114
+ onChange: value => {
115
+ const int = parseInt(value, 10);
116
+ setAttributes({
117
+ // It should be possible to unset the value,
118
+ // e.g. with an empty string.
119
+ start: isNaN(int) ? undefined : int
120
+ });
121
+ },
122
+ value: Number.isInteger(start) ? start.toString(10) : '',
123
+ step: "1"
124
+ })
125
+ }), /*#__PURE__*/_jsx(ToolsPanelItem, {
126
+ label: __('Reverse order'),
127
+ isShownByDefault: true,
128
+ hasValue: () => !!reversed,
129
+ onDeselect: () => setAttributes({
130
+ reversed: undefined
131
+ }),
132
+ children: /*#__PURE__*/_jsx(ToggleControl, {
133
+ __nextHasNoMarginBottom: true,
134
+ label: __('Reverse order'),
135
+ checked: reversed || false,
136
+ onChange: value => {
137
+ setAttributes({
138
+ // Unset the attribute if not reversed.
139
+ reversed: value || undefined
140
+ });
141
+ }
142
+ })
143
+ })]
144
+ })
145
+ });
146
+ };
68
147
  export default OrderedListSettings;
69
148
  //# sourceMappingURL=ordered-list-settings.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["__","InspectorControls","TextControl","PanelBody","ToggleControl","SelectControl","jsx","_jsx","jsxs","_jsxs","OrderedListSettings","setAttributes","reversed","start","type","children","title","__next40pxDefaultSize","__nextHasNoMarginBottom","label","options","value","onChange","newValue","int","parseInt","isNaN","undefined","Number","isInteger","toString","step","checked"],"sources":["@wordpress/block-library/src/list/ordered-list-settings.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { InspectorControls } from '@wordpress/block-editor';\nimport {\n\tTextControl,\n\tPanelBody,\n\tToggleControl,\n\tSelectControl,\n} from '@wordpress/components';\n\nconst OrderedListSettings = ( { setAttributes, reversed, start, type } ) => (\n\t<InspectorControls>\n\t\t<PanelBody title={ __( 'Settings' ) }>\n\t\t\t<SelectControl\n\t\t\t\t__next40pxDefaultSize\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\tlabel={ __( 'List style' ) }\n\t\t\t\toptions={ [\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: __( 'Numbers' ),\n\t\t\t\t\t\tvalue: 'decimal',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: __( 'Uppercase letters' ),\n\t\t\t\t\t\tvalue: 'upper-alpha',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: __( 'Lowercase letters' ),\n\t\t\t\t\t\tvalue: 'lower-alpha',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: __( 'Uppercase Roman numerals' ),\n\t\t\t\t\t\tvalue: 'upper-roman',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: __( 'Lowercase Roman numerals' ),\n\t\t\t\t\t\tvalue: 'lower-roman',\n\t\t\t\t\t},\n\t\t\t\t] }\n\t\t\t\tvalue={ type }\n\t\t\t\tonChange={ ( newValue ) => setAttributes( { type: newValue } ) }\n\t\t\t/>\n\t\t\t<TextControl\n\t\t\t\t__next40pxDefaultSize\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\tlabel={ __( 'Start value' ) }\n\t\t\t\ttype=\"number\"\n\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\tconst int = parseInt( value, 10 );\n\n\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t// It should be possible to unset the value,\n\t\t\t\t\t\t// e.g. with an empty string.\n\t\t\t\t\t\tstart: isNaN( int ) ? undefined : int,\n\t\t\t\t\t} );\n\t\t\t\t} }\n\t\t\t\tvalue={ Number.isInteger( start ) ? start.toString( 10 ) : '' }\n\t\t\t\tstep=\"1\"\n\t\t\t/>\n\t\t\t<ToggleControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\tlabel={ __( 'Reverse order' ) }\n\t\t\t\tchecked={ reversed || false }\n\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t// Unset the attribute if not reversed.\n\t\t\t\t\t\treversed: value || undefined,\n\t\t\t\t\t} );\n\t\t\t\t} }\n\t\t\t/>\n\t\t</PanelBody>\n\t</InspectorControls>\n);\n\nexport default OrderedListSettings;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,iBAAiB,QAAQ,yBAAyB;AAC3D,SACCC,WAAW,EACXC,SAAS,EACTC,aAAa,EACbC,aAAa,QACP,uBAAuB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IA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E,CAAC;MACJ,CAAG;MACHH,KAAK,EAAGO,MAAM,CAACC,SAAS,CAAEhB,KAAM,CAAC,GAAGA,KAAK,CAACiB,QAAQ,CAAE,EAAG,CAAC,GAAG,EAAI;MAC/DC,IAAI,EAAC;IAAG,CACR,CAAC,eACFxB,IAAA,CAACH,aAAa;MACbc,uBAAuB;MACvBC,KAAK,EAAGnB,EAAE,CAAE,eAAgB,CAAG;MAC/BgC,OAAO,EAAGpB,QAAQ,IAAI,KAAO;MAC7BU,QAAQ,EAAKD,KAAK,IAAM;QACvBV,aAAa,CAAE;UACd;UACAC,QAAQ,EAAES,KAAK,IAAIM;QACpB,CAAE,CAAC;MACJ;IAAG,CACH,CAAC;EAAA,CACQ;AAAC,CACM,CACnB;AAED,eAAejB,mBAAmB","ignoreList":[]}
1
+ {"version":3,"names":["__","InspectorControls","TextControl","PanelBody","ToggleControl","SelectControl","__experimentalToolsPanel","ToolsPanel","__experimentalToolsPanelItem","ToolsPanelItem","Platform","useToolsPanelDropdownMenuProps","jsx","_jsx","jsxs","_jsxs","LIST_STYLE_OPTIONS","label","value","OrderedListSettings","setAttributes","reversed","start","type","dropdownMenuProps","children","isNative","title","__next40pxDefaultSize","__nextHasNoMarginBottom","options","onChange","newValue","int","parseInt","isNaN","undefined","Number","isInteger","toString","step","checked","resetAll","isShownByDefault","hasValue","onDeselect"],"sources":["@wordpress/block-library/src/list/ordered-list-settings.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { InspectorControls } from '@wordpress/block-editor';\nimport {\n\tTextControl,\n\tPanelBody,\n\tToggleControl,\n\tSelectControl,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\nimport { Platform } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\n\nconst LIST_STYLE_OPTIONS = [\n\t{\n\t\tlabel: __( 'Numbers' ),\n\t\tvalue: 'decimal',\n\t},\n\t{\n\t\tlabel: __( 'Uppercase letters' ),\n\t\tvalue: 'upper-alpha',\n\t},\n\t{\n\t\tlabel: __( 'Lowercase letters' ),\n\t\tvalue: 'lower-alpha',\n\t},\n\t{\n\t\tlabel: __( 'Uppercase Roman numerals' ),\n\t\tvalue: 'upper-roman',\n\t},\n\t{\n\t\tlabel: __( 'Lowercase Roman numerals' ),\n\t\tvalue: 'lower-roman',\n\t},\n];\n\nconst OrderedListSettings = ( { setAttributes, reversed, start, type } ) => {\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\treturn (\n\t\t<InspectorControls>\n\t\t\t{ Platform.isNative ? (\n\t\t\t\t<PanelBody title={ __( 'Settings' ) }>\n\t\t\t\t\t<SelectControl\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'List style' ) }\n\t\t\t\t\t\toptions={ LIST_STYLE_OPTIONS }\n\t\t\t\t\t\tvalue={ type }\n\t\t\t\t\t\tonChange={ ( newValue ) =>\n\t\t\t\t\t\t\tsetAttributes( { type: newValue } )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Start value' ) }\n\t\t\t\t\t\ttype=\"number\"\n\t\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\t\tconst int = parseInt( value, 10 );\n\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t// It should be possible to unset the value,\n\t\t\t\t\t\t\t\t// e.g. with an empty string.\n\t\t\t\t\t\t\t\tstart: isNaN( int ) ? undefined : int,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tvalue={\n\t\t\t\t\t\t\tNumber.isInteger( start )\n\t\t\t\t\t\t\t\t? start.toString( 10 )\n\t\t\t\t\t\t\t\t: ''\n\t\t\t\t\t\t}\n\t\t\t\t\t\tstep=\"1\"\n\t\t\t\t\t/>\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Reverse order' ) }\n\t\t\t\t\t\tchecked={ reversed || false }\n\t\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t// Unset the attribute if not reversed.\n\t\t\t\t\t\t\t\treversed: value || undefined,\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</PanelBody>\n\t\t\t) : (\n\t\t\t\t<ToolsPanel\n\t\t\t\t\tlabel={ __( 'Settings' ) }\n\t\t\t\t\tresetAll={ () => {\n\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\ttype: undefined,\n\t\t\t\t\t\t\tstart: undefined,\n\t\t\t\t\t\t\treversed: undefined,\n\t\t\t\t\t\t} );\n\t\t\t\t\t} }\n\t\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t>\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tlabel={ __( 'List style' ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\thasValue={ () => !! type }\n\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\ttype: undefined,\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\t\t<SelectControl\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={ __( 'List style' ) }\n\t\t\t\t\t\t\toptions={ LIST_STYLE_OPTIONS }\n\t\t\t\t\t\t\tvalue={ type || 'decimal' }\n\t\t\t\t\t\t\tonChange={ ( newValue ) =>\n\t\t\t\t\t\t\t\tsetAttributes( { type: newValue } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tlabel={ __( 'Start value' ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\thasValue={ () => !! start }\n\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tstart: undefined,\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\t\t<TextControl\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={ __( 'Start value' ) }\n\t\t\t\t\t\t\ttype=\"number\"\n\t\t\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\t\t\tconst int = parseInt( value, 10 );\n\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t// It should be possible to unset the value,\n\t\t\t\t\t\t\t\t\t// e.g. with an empty string.\n\t\t\t\t\t\t\t\t\tstart: isNaN( int ) ? undefined : int,\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tvalue={\n\t\t\t\t\t\t\t\tNumber.isInteger( start )\n\t\t\t\t\t\t\t\t\t? start.toString( 10 )\n\t\t\t\t\t\t\t\t\t: ''\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tstep=\"1\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tlabel={ __( 'Reverse order' ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\thasValue={ () => !! reversed }\n\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\treversed: undefined,\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\t\t<ToggleControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={ __( 'Reverse order' ) }\n\t\t\t\t\t\t\tchecked={ reversed || false }\n\t\t\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t// Unset the attribute if not reversed.\n\t\t\t\t\t\t\t\t\treversed: value || undefined,\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t</ToolsPanel>\n\t\t\t) }\n\t\t</InspectorControls>\n\t);\n};\n\nexport default OrderedListSettings;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,iBAAiB,QAAQ,yBAAyB;AAC3D,SACCC,WAAW,EACXC,SAAS,EACTC,aAAa,EACbC,aAAa,EACbC,wBAAwB,IAAIC,UAAU,EACtCC,4BAA4B,IAAIC,cAAc,QACxC,uBAAuB;AAC9B,SAASC,QAAQ,QAAQ,oBAAoB;;AAE7C;AACA;AACA;AACA,SAASC,8BAA8B,QAAQ,gBAAgB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAEhE,MAAMC,kBAAkB,GAAG,CAC1B;EACCC,KAAK,EAAEjB,EAAE,CAAE,SAAU,CAAC;EACtBkB,KAAK,EAAE;AACR,CAAC,EACD;EACCD,KAAK,EAAEjB,EAAE,CAAE,mBAAoB,CAAC;EAChCkB,KAAK,EAAE;AACR,CAAC,EACD;EACCD,KAAK,EAAEjB,EAAE,CAAE,mBAAoB,CAAC;EAChCkB,KAAK,EAAE;AACR,CAAC,EACD;EACCD,KAAK,EAAEjB,EAAE,CAAE,0BAA2B,CAAC;EACvCkB,KAAK,EAAE;AACR,CAA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AAK,EAAEc;QACR,CAAE,CACF;QAAAX,QAAA,eAEDZ,IAAA,CAACX,WAAW;UACX0B,qBAAqB;UACrBC,uBAAuB;UACvBZ,KAAK,EAAGjB,EAAE,CAAE,aAAc,CAAG;UAC7BuB,IAAI,EAAC,QAAQ;UACbQ,QAAQ,EAAKb,KAAK,IAAM;YACvB,MAAMe,GAAG,GAAGC,QAAQ,CAAEhB,KAAK,EAAE,EAAG,CAAC;YAEjCE,aAAa,CAAE;cACd;cACA;cACAE,KAAK,EAAEa,KAAK,CAAEF,GAAI,CAAC,GAAGG,SAAS,GAAGH;YACnC,CAAE,CAAC;UACJ,CAAG;UACHf,KAAK,EACJmB,MAAM,CAACC,SAAS,CAAEhB,KAAM,CAAC,GACtBA,KAAK,CAACiB,QAAQ,CAAE,EAAG,CAAC,GACpB,EACH;UACDC,IAAI,EAAC;QAAG,CACR;MAAC,CACa,CAAC,eACjB3B,IAAA,CAACJ,cAAc;QACdQ,KAAK,EAAGjB,EAAE,CAAE,eAAgB,CAAG;QAC/B2C,gBAAgB;QAChBC,QAAQ,EAAGA,CAAA,KAAM,CAAC,CAAEvB,QAAU;QAC9BwB,UAAU,EAAGA,CAAA,KACZzB,aAAa,CAAE;UACdC,QAAQ,EAAEe;QACX,CAAE,CACF;QAAAX,QAAA,eAEDZ,IAAA,CAACT,aAAa;UACbyB,uBAAuB;UACvBZ,KAAK,EAAGjB,EAAE,CAAE,eAAgB,CAAG;UAC/ByC,OAAO,EAAGpB,QAAQ,IAAI,KAAO;UAC7BU,QAAQ,EAAKb,KAAK,IAAM;YACvBE,aAAa,CAAE;cACd;cACAC,QAAQ,EAAEH,KAAK,IAAIkB;YACpB,CAAE,CAAC;UACJ;QAAG,CACH;MAAC,CACa,CAAC;IAAA,CACN;EACZ,CACiB,CAAC;AAEtB,CAAC;AAED,eAAejB,mBAAmB","ignoreList":[]}
@@ -10,7 +10,7 @@ import { useCallback, useState, useEffect, useRef, Platform } from '@wordpress/e
10
10
  import { InspectorControls, useBlockProps, RecursionProvider, useHasRecursion, store as blockEditorStore, withColors, ContrastChecker, getColorClassName, Warning, __experimentalColorGradientSettingsDropdown as ColorGradientSettingsDropdown, __experimentalUseMultipleOriginColorsAndGradients as useMultipleOriginColorsAndGradients, useBlockEditingMode } from '@wordpress/block-editor';
11
11
  import { EntityProvider, store as coreStore } from '@wordpress/core-data';
12
12
  import { useDispatch, useSelect } from '@wordpress/data';
13
- import { PanelBody, ToggleControl, __experimentalToggleGroupControl as ToggleGroupControl, __experimentalToggleGroupControlOption as ToggleGroupControlOption, Button, Spinner, Notice } from '@wordpress/components';
13
+ import { __experimentalToolsPanel as ToolsPanel, __experimentalToolsPanelItem as ToolsPanelItem, __experimentalToggleGroupControl as ToggleGroupControl, __experimentalToggleGroupControlOption as ToggleGroupControlOption, __experimentalVStack as VStack, ToggleControl, Button, Spinner, Notice } from '@wordpress/components';
14
14
  import { __ } from '@wordpress/i18n';
15
15
  import { speak } from '@wordpress/a11y';
16
16
  import { close, Icon } from '@wordpress/icons';
@@ -40,6 +40,7 @@ import DeletedNavigationWarning from './deleted-navigation-warning';
40
40
  import AccessibleDescription from './accessible-description';
41
41
  import AccessibleMenuDescription from './accessible-menu-description';
42
42
  import { unlock } from '../../lock-unlock';
43
+ import { useToolsPanelDropdownMenuProps } from '../../utils/hooks';
43
44
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
44
45
  function ColorTools({
45
46
  textColor,
@@ -377,10 +378,21 @@ function Navigation({
377
378
  isFirstRender.current = false;
378
379
  }, [submenuAccessibilityNotice]);
379
380
  const overlayMenuPreviewId = useInstanceId(OverlayMenuPreview, `overlay-menu-preview`);
381
+ const dropdownMenuProps = useToolsPanelDropdownMenuProps();
380
382
  const stylingInspectorControls = /*#__PURE__*/_jsxs(_Fragment, {
381
383
  children: [/*#__PURE__*/_jsx(InspectorControls, {
382
- children: hasSubmenuIndicatorSetting && /*#__PURE__*/_jsxs(PanelBody, {
383
- title: __('Display'),
384
+ children: hasSubmenuIndicatorSetting && /*#__PURE__*/_jsxs(ToolsPanel, {
385
+ label: __('Display'),
386
+ resetAll: () => {
387
+ setAttributes({
388
+ showSubmenuIcon: true,
389
+ openSubmenusOnClick: false,
390
+ overlayMenu: 'mobile',
391
+ hasIcon: true,
392
+ icon: 'handle'
393
+ });
394
+ },
395
+ dropdownMenuProps: dropdownMenuProps,
384
396
  children: [isResponsive && /*#__PURE__*/_jsxs(_Fragment, {
385
397
  children: [/*#__PURE__*/_jsxs(Button, {
386
398
  __next40pxDefaultSize: true,
@@ -404,68 +416,98 @@ function Navigation({
404
416
  children: __('Close')
405
417
  })]
406
418
  })]
407
- }), /*#__PURE__*/_jsx("div", {
419
+ }), overlayMenuPreview && /*#__PURE__*/_jsx(VStack, {
408
420
  id: overlayMenuPreviewId,
409
- children: overlayMenuPreview && /*#__PURE__*/_jsx(OverlayMenuPreview, {
421
+ spacing: 4,
422
+ style: {
423
+ gridColumn: 'span 2'
424
+ },
425
+ children: /*#__PURE__*/_jsx(OverlayMenuPreview, {
410
426
  setAttributes: setAttributes,
411
427
  hasIcon: hasIcon,
412
428
  icon: icon,
413
429
  hidden: !overlayMenuPreview
414
430
  })
415
431
  })]
416
- }), /*#__PURE__*/_jsxs(ToggleGroupControl, {
417
- __next40pxDefaultSize: true,
418
- __nextHasNoMarginBottom: true,
432
+ }), /*#__PURE__*/_jsx(ToolsPanelItem, {
433
+ hasValue: () => overlayMenu !== 'mobile',
419
434
  label: __('Overlay Menu'),
420
- "aria-label": __('Configure overlay menu'),
421
- value: overlayMenu,
422
- help: __('Collapses the navigation options in a menu icon opening an overlay.'),
423
- onChange: value => setAttributes({
424
- overlayMenu: value
435
+ onDeselect: () => setAttributes({
436
+ overlayMenu: 'mobile'
425
437
  }),
426
- isBlock: true,
427
- children: [/*#__PURE__*/_jsx(ToggleGroupControlOption, {
428
- value: "never",
429
- label: __('Off')
430
- }), /*#__PURE__*/_jsx(ToggleGroupControlOption, {
431
- value: "mobile",
432
- label: __('Mobile')
433
- }), /*#__PURE__*/_jsx(ToggleGroupControlOption, {
434
- value: "always",
435
- label: __('Always')
436
- })]
438
+ isShownByDefault: true,
439
+ children: /*#__PURE__*/_jsxs(ToggleGroupControl, {
440
+ __next40pxDefaultSize: true,
441
+ __nextHasNoMarginBottom: true,
442
+ label: __('Overlay Menu'),
443
+ "aria-label": __('Configure overlay menu'),
444
+ value: overlayMenu,
445
+ help: __('Collapses the navigation options in a menu icon opening an overlay.'),
446
+ onChange: value => setAttributes({
447
+ overlayMenu: value
448
+ }),
449
+ isBlock: true,
450
+ children: [/*#__PURE__*/_jsx(ToggleGroupControlOption, {
451
+ value: "never",
452
+ label: __('Off')
453
+ }), /*#__PURE__*/_jsx(ToggleGroupControlOption, {
454
+ value: "mobile",
455
+ label: __('Mobile')
456
+ }), /*#__PURE__*/_jsx(ToggleGroupControlOption, {
457
+ value: "always",
458
+ label: __('Always')
459
+ })]
460
+ })
437
461
  }), hasSubmenus && /*#__PURE__*/_jsxs(_Fragment, {
438
462
  children: [/*#__PURE__*/_jsx("h3", {
463
+ className: "wp-block-navigation__submenu-header",
439
464
  children: __('Submenus')
440
- }), /*#__PURE__*/_jsx(ToggleControl, {
441
- __nextHasNoMarginBottom: true,
442
- checked: openSubmenusOnClick,
443
- onChange: value => {
444
- setAttributes({
445
- openSubmenusOnClick: value,
446
- ...(value && {
447
- showSubmenuIcon: true
448
- }) // Make sure arrows are shown when we toggle this on.
449
- });
450
- },
451
- label: __('Open on click')
452
- }), /*#__PURE__*/_jsx(ToggleControl, {
453
- __nextHasNoMarginBottom: true,
454
- checked: showSubmenuIcon,
455
- onChange: value => {
456
- setAttributes({
457
- showSubmenuIcon: value
458
- });
459
- },
460
- disabled: attributes.openSubmenusOnClick,
461
- label: __('Show arrow')
462
- }), submenuAccessibilityNotice && /*#__PURE__*/_jsx("div", {
463
- children: /*#__PURE__*/_jsx(Notice, {
464
- spokenMessage: null,
465
- status: "warning",
466
- isDismissible: false,
467
- children: submenuAccessibilityNotice
465
+ }), /*#__PURE__*/_jsx(ToolsPanelItem, {
466
+ hasValue: () => openSubmenusOnClick,
467
+ label: __('Open on click'),
468
+ onDeselect: () => setAttributes({
469
+ openSubmenusOnClick: false,
470
+ showSubmenuIcon: true
471
+ }),
472
+ isShownByDefault: true,
473
+ children: /*#__PURE__*/_jsx(ToggleControl, {
474
+ __nextHasNoMarginBottom: true,
475
+ checked: openSubmenusOnClick,
476
+ onChange: value => {
477
+ setAttributes({
478
+ openSubmenusOnClick: value,
479
+ ...(value && {
480
+ showSubmenuIcon: true
481
+ }) // Make sure arrows are shown when we toggle this on.
482
+ });
483
+ },
484
+ label: __('Open on click')
485
+ })
486
+ }), /*#__PURE__*/_jsx(ToolsPanelItem, {
487
+ hasValue: () => !showSubmenuIcon,
488
+ label: __('Show arrow'),
489
+ onDeselect: () => setAttributes({
490
+ showSubmenuIcon: true
491
+ }),
492
+ isDisabled: attributes.openSubmenusOnClick,
493
+ isShownByDefault: true,
494
+ children: /*#__PURE__*/_jsx(ToggleControl, {
495
+ __nextHasNoMarginBottom: true,
496
+ checked: showSubmenuIcon,
497
+ onChange: value => {
498
+ setAttributes({
499
+ showSubmenuIcon: value
500
+ });
501
+ },
502
+ disabled: attributes.openSubmenusOnClick,
503
+ label: __('Show arrow')
468
504
  })
505
+ }), submenuAccessibilityNotice && /*#__PURE__*/_jsx(Notice, {
506
+ spokenMessage: null,
507
+ status: "warning",
508
+ isDismissible: false,
509
+ className: "wp-block-navigation__submenu-accessibility-notice",
510
+ children: submenuAccessibilityNotice
469
511
  })]
470
512
  })]
471
513
  })