@wordpress/block-editor 8.5.4 → 9.0.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 (299) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/README.md +4 -2
  3. package/build/components/block-alignment-control/constants.js +48 -0
  4. package/build/components/block-alignment-control/constants.js.map +1 -0
  5. package/build/components/block-alignment-control/ui.js +9 -40
  6. package/build/components/block-alignment-control/ui.js.map +1 -1
  7. package/build/components/block-alignment-control/ui.native.js +92 -0
  8. package/build/components/block-alignment-control/ui.native.js.map +1 -0
  9. package/build/components/block-content-overlay/index.js +13 -4
  10. package/build/components/block-content-overlay/index.js.map +1 -1
  11. package/build/components/block-list/block.native.js +3 -1
  12. package/build/components/block-list/block.native.js.map +1 -1
  13. package/build/components/block-list/use-block-props/use-block-class-names.js +1 -7
  14. package/build/components/block-list/use-block-props/use-block-class-names.js.map +1 -1
  15. package/build/components/block-lock/modal.js +34 -4
  16. package/build/components/block-lock/modal.js.map +1 -1
  17. package/build/components/block-lock/toolbar.js +2 -1
  18. package/build/components/block-lock/toolbar.js.map +1 -1
  19. package/build/components/block-lock/use-block-lock.js +4 -1
  20. package/build/components/block-lock/use-block-lock.js.map +1 -1
  21. package/build/components/block-mover/button.js +4 -4
  22. package/build/components/block-mover/button.js.map +1 -1
  23. package/build/components/block-mover/index.js +39 -65
  24. package/build/components/block-mover/index.js.map +1 -1
  25. package/build/components/block-navigation/dropdown.js +11 -5
  26. package/build/components/block-navigation/dropdown.js.map +1 -1
  27. package/build/components/block-popover/inbetween.js +183 -0
  28. package/build/components/block-popover/inbetween.js.map +1 -0
  29. package/build/components/block-popover/index.js +97 -0
  30. package/build/components/block-popover/index.js.map +1 -0
  31. package/build/components/{block-tools → block-popover}/use-popover-scroll.js +4 -1
  32. package/build/components/block-popover/use-popover-scroll.js.map +1 -0
  33. package/build/components/block-styles/index.js +1 -10
  34. package/build/components/block-styles/index.js.map +1 -1
  35. package/build/components/block-tools/back-compat.js +2 -2
  36. package/build/components/block-tools/back-compat.js.map +1 -1
  37. package/build/components/block-tools/block-selection-button.js +4 -2
  38. package/build/components/block-tools/block-selection-button.js.map +1 -1
  39. package/build/components/block-tools/index.js +5 -5
  40. package/build/components/block-tools/index.js.map +1 -1
  41. package/build/components/block-tools/insertion-point.js +14 -121
  42. package/build/components/block-tools/insertion-point.js.map +1 -1
  43. package/build/components/block-tools/{block-popover.js → selected-block-popover.js} +25 -108
  44. package/build/components/block-tools/selected-block-popover.js.map +1 -0
  45. package/build/components/color-style-selector/index.js +9 -0
  46. package/build/components/color-style-selector/index.js.map +1 -1
  47. package/build/components/duotone-control/index.js +5 -1
  48. package/build/components/duotone-control/index.js.map +1 -1
  49. package/build/components/index.js +0 -9
  50. package/build/components/index.js.map +1 -1
  51. package/build/components/inserter/index.native.js +30 -8
  52. package/build/components/inserter/index.native.js.map +1 -1
  53. package/build/components/list-view/block.js +15 -15
  54. package/build/components/list-view/block.js.map +1 -1
  55. package/build/components/list-view/branch.js +9 -13
  56. package/build/components/list-view/branch.js.map +1 -1
  57. package/build/components/list-view/context.js +1 -4
  58. package/build/components/list-view/context.js.map +1 -1
  59. package/build/components/list-view/index.js +15 -32
  60. package/build/components/list-view/index.js.map +1 -1
  61. package/build/components/rich-text/index.js +0 -5
  62. package/build/components/rich-text/index.js.map +1 -1
  63. package/build/components/rich-text/index.native.js +0 -4
  64. package/build/components/rich-text/index.native.js.map +1 -1
  65. package/build/components/url-input/index.js +7 -3
  66. package/build/components/url-input/index.js.map +1 -1
  67. package/build/components/use-block-display-information/index.js +3 -1
  68. package/build/components/use-block-display-information/index.js.map +1 -1
  69. package/build/components/use-setting/index.js +42 -18
  70. package/build/components/use-setting/index.js.map +1 -1
  71. package/build/hooks/border.js +468 -44
  72. package/build/hooks/border.js.map +1 -1
  73. package/build/hooks/dimensions.js +2 -2
  74. package/build/hooks/dimensions.js.map +1 -1
  75. package/build/hooks/index.js +3 -1
  76. package/build/hooks/index.js.map +1 -1
  77. package/build/hooks/margin.js +64 -12
  78. package/build/hooks/margin.js.map +1 -1
  79. package/build/hooks/padding.js +60 -12
  80. package/build/hooks/padding.js.map +1 -1
  81. package/build/hooks/settings.js +32 -0
  82. package/build/hooks/settings.js.map +1 -0
  83. package/build/hooks/use-border-props.js +22 -32
  84. package/build/hooks/use-border-props.js.map +1 -1
  85. package/build/store/actions.js +14 -2
  86. package/build/store/actions.js.map +1 -1
  87. package/build/store/defaults.js +0 -1
  88. package/build/store/defaults.js.map +1 -1
  89. package/build/store/reducer.js +0 -26
  90. package/build/store/reducer.js.map +1 -1
  91. package/build/store/selectors.js +47 -15
  92. package/build/store/selectors.js.map +1 -1
  93. package/build-module/components/block-alignment-control/constants.js +36 -0
  94. package/build-module/components/block-alignment-control/constants.js.map +1 -0
  95. package/build-module/components/block-alignment-control/ui.js +4 -35
  96. package/build-module/components/block-alignment-control/ui.js.map +1 -1
  97. package/build-module/components/block-alignment-control/ui.native.js +78 -0
  98. package/build-module/components/block-alignment-control/ui.native.js.map +1 -0
  99. package/build-module/components/block-content-overlay/index.js +13 -4
  100. package/build-module/components/block-content-overlay/index.js.map +1 -1
  101. package/build-module/components/block-list/block.native.js +3 -1
  102. package/build-module/components/block-list/block.native.js.map +1 -1
  103. package/build-module/components/block-list/use-block-props/use-block-class-names.js +1 -7
  104. package/build-module/components/block-list/use-block-props/use-block-class-names.js.map +1 -1
  105. package/build-module/components/block-lock/modal.js +34 -5
  106. package/build-module/components/block-lock/modal.js.map +1 -1
  107. package/build-module/components/block-lock/toolbar.js +2 -1
  108. package/build-module/components/block-lock/toolbar.js.map +1 -1
  109. package/build-module/components/block-lock/use-block-lock.js +4 -1
  110. package/build-module/components/block-lock/use-block-lock.js.map +1 -1
  111. package/build-module/components/block-mover/button.js +5 -5
  112. package/build-module/components/block-mover/button.js.map +1 -1
  113. package/build-module/components/block-mover/index.js +38 -63
  114. package/build-module/components/block-mover/index.js.map +1 -1
  115. package/build-module/components/block-navigation/dropdown.js +10 -5
  116. package/build-module/components/block-navigation/dropdown.js.map +1 -1
  117. package/build-module/components/block-popover/inbetween.js +165 -0
  118. package/build-module/components/block-popover/inbetween.js.map +1 -0
  119. package/build-module/components/block-popover/index.js +83 -0
  120. package/build-module/components/block-popover/index.js.map +1 -0
  121. package/build-module/components/{block-tools → block-popover}/use-popover-scroll.js +3 -1
  122. package/build-module/components/block-popover/use-popover-scroll.js.map +1 -0
  123. package/build-module/components/block-styles/index.js +1 -9
  124. package/build-module/components/block-styles/index.js.map +1 -1
  125. package/build-module/components/block-tools/back-compat.js +1 -1
  126. package/build-module/components/block-tools/back-compat.js.map +1 -1
  127. package/build-module/components/block-tools/block-selection-button.js +3 -2
  128. package/build-module/components/block-tools/block-selection-button.js.map +1 -1
  129. package/build-module/components/block-tools/index.js +3 -3
  130. package/build-module/components/block-tools/index.js.map +1 -1
  131. package/build-module/components/block-tools/insertion-point.js +16 -121
  132. package/build-module/components/block-tools/insertion-point.js.map +1 -1
  133. package/build-module/components/block-tools/{block-popover.js → selected-block-popover.js} +25 -105
  134. package/build-module/components/block-tools/selected-block-popover.js.map +1 -0
  135. package/build-module/components/color-style-selector/index.js +6 -0
  136. package/build-module/components/color-style-selector/index.js.map +1 -1
  137. package/build-module/components/duotone-control/index.js +4 -1
  138. package/build-module/components/duotone-control/index.js.map +1 -1
  139. package/build-module/components/index.js +0 -1
  140. package/build-module/components/index.js.map +1 -1
  141. package/build-module/components/inserter/index.native.js +31 -10
  142. package/build-module/components/inserter/index.native.js.map +1 -1
  143. package/build-module/components/list-view/block.js +15 -16
  144. package/build-module/components/list-view/block.js.map +1 -1
  145. package/build-module/components/list-view/branch.js +9 -13
  146. package/build-module/components/list-view/branch.js.map +1 -1
  147. package/build-module/components/list-view/context.js +1 -4
  148. package/build-module/components/list-view/context.js.map +1 -1
  149. package/build-module/components/list-view/index.js +15 -31
  150. package/build-module/components/list-view/index.js.map +1 -1
  151. package/build-module/components/rich-text/index.js +0 -4
  152. package/build-module/components/rich-text/index.js.map +1 -1
  153. package/build-module/components/rich-text/index.native.js +0 -4
  154. package/build-module/components/rich-text/index.native.js.map +1 -1
  155. package/build-module/components/url-input/index.js +7 -3
  156. package/build-module/components/url-input/index.js.map +1 -1
  157. package/build-module/components/use-block-display-information/index.js +3 -1
  158. package/build-module/components/use-block-display-information/index.js.map +1 -1
  159. package/build-module/components/use-setting/index.js +43 -19
  160. package/build-module/components/use-setting/index.js.map +1 -1
  161. package/build-module/hooks/border.js +458 -44
  162. package/build-module/hooks/border.js.map +1 -1
  163. package/build-module/hooks/dimensions.js +5 -5
  164. package/build-module/hooks/dimensions.js.map +1 -1
  165. package/build-module/hooks/index.js +2 -1
  166. package/build-module/hooks/index.js.map +1 -1
  167. package/build-module/hooks/margin.js +61 -13
  168. package/build-module/hooks/margin.js.map +1 -1
  169. package/build-module/hooks/padding.js +57 -13
  170. package/build-module/hooks/padding.js.map +1 -1
  171. package/build-module/hooks/settings.js +29 -0
  172. package/build-module/hooks/settings.js.map +1 -0
  173. package/build-module/hooks/use-border-props.js +21 -30
  174. package/build-module/hooks/use-border-props.js.map +1 -1
  175. package/build-module/store/actions.js +14 -2
  176. package/build-module/store/actions.js.map +1 -1
  177. package/build-module/store/defaults.js +0 -1
  178. package/build-module/store/defaults.js.map +1 -1
  179. package/build-module/store/reducer.js +0 -24
  180. package/build-module/store/reducer.js.map +1 -1
  181. package/build-module/store/selectors.js +44 -15
  182. package/build-module/store/selectors.js.map +1 -1
  183. package/build-style/style-rtl.css +128 -276
  184. package/build-style/style.css +128 -276
  185. package/package.json +28 -28
  186. package/src/components/block-alignment-control/constants.js +45 -0
  187. package/src/components/block-alignment-control/ui.js +69 -109
  188. package/src/components/block-alignment-control/ui.native.js +86 -0
  189. package/src/components/block-content-overlay/index.js +19 -2
  190. package/src/components/block-list/block.native.js +2 -0
  191. package/src/components/block-list/style.scss +7 -18
  192. package/src/components/block-list/use-block-props/use-block-class-names.js +1 -11
  193. package/src/components/block-lock/modal.js +42 -3
  194. package/src/components/block-lock/toolbar.js +2 -2
  195. package/src/components/block-lock/use-block-lock.js +4 -1
  196. package/src/components/block-mover/button.js +5 -7
  197. package/src/components/block-mover/index.js +37 -60
  198. package/src/components/block-mover/stories/index.js +110 -0
  199. package/src/components/block-mover/style.scss +48 -138
  200. package/src/components/block-navigation/dropdown.js +12 -8
  201. package/src/components/block-popover/README.md +41 -0
  202. package/src/components/block-popover/inbetween.js +180 -0
  203. package/src/components/block-popover/index.js +90 -0
  204. package/src/components/block-popover/style.scss +27 -0
  205. package/src/components/{block-tools → block-popover}/use-popover-scroll.js +3 -1
  206. package/src/components/block-styles/index.js +1 -12
  207. package/src/components/block-switcher/style.scss +0 -4
  208. package/src/components/block-toolbar/style.scss +0 -12
  209. package/src/components/block-tools/back-compat.js +1 -1
  210. package/src/components/block-tools/block-selection-button.js +3 -1
  211. package/src/components/block-tools/index.js +6 -4
  212. package/src/components/block-tools/insertion-point.js +19 -152
  213. package/src/components/block-tools/{block-popover.js → selected-block-popover.js} +24 -116
  214. package/src/components/block-tools/style.scss +11 -123
  215. package/src/components/border-radius-control/style.scss +5 -2
  216. package/src/components/color-palette/test/__snapshots__/control.js.snap +1 -1
  217. package/src/components/color-style-selector/index.js +18 -9
  218. package/src/components/default-block-appender/style.scss +1 -2
  219. package/src/components/duotone-control/index.js +8 -1
  220. package/src/components/gradients/README.md +29 -0
  221. package/src/components/image-size-control/README.md +1 -1
  222. package/src/components/index.js +0 -1
  223. package/src/components/inserter/index.native.js +60 -25
  224. package/src/components/inserter/style.native.scss +25 -3
  225. package/src/components/list-view/block.js +24 -34
  226. package/src/components/list-view/branch.js +10 -20
  227. package/src/components/list-view/context.js +1 -4
  228. package/src/components/list-view/index.js +11 -41
  229. package/src/components/navigable-toolbar/README.md +16 -0
  230. package/src/components/rich-text/index.js +0 -2
  231. package/src/components/rich-text/index.native.js +0 -4
  232. package/src/components/url-input/index.js +6 -3
  233. package/src/components/use-block-display-information/index.js +2 -0
  234. package/src/components/use-setting/index.js +57 -21
  235. package/src/hooks/border.js +438 -72
  236. package/src/hooks/border.scss +48 -0
  237. package/src/hooks/dimensions.js +44 -38
  238. package/src/hooks/index.js +2 -1
  239. package/src/hooks/margin.js +64 -15
  240. package/src/hooks/padding.js +60 -15
  241. package/src/hooks/padding.scss +12 -0
  242. package/src/hooks/settings.js +32 -0
  243. package/src/hooks/test/settings.js +48 -0
  244. package/src/hooks/use-border-props.js +15 -32
  245. package/src/store/actions.js +14 -2
  246. package/src/store/defaults.js +0 -1
  247. package/src/store/reducer.js +0 -21
  248. package/src/store/selectors.js +46 -15
  249. package/src/store/test/actions.js +0 -18
  250. package/src/store/test/reducer.js +0 -19
  251. package/src/store/test/selectors.js +17 -19
  252. package/src/style.scss +2 -2
  253. package/tsconfig.tsbuildinfo +1 -1
  254. package/build/components/block-mobile-toolbar/index.js +0 -42
  255. package/build/components/block-mobile-toolbar/index.js.map +0 -1
  256. package/build/components/block-tools/block-popover.js.map +0 -1
  257. package/build/components/block-tools/use-popover-scroll.js.map +0 -1
  258. package/build/components/border-style-control/index.js +0 -60
  259. package/build/components/border-style-control/index.js.map +0 -1
  260. package/build/components/list-view/appender.js +0 -93
  261. package/build/components/list-view/appender.js.map +0 -1
  262. package/build/components/list-view/list-item.js +0 -62
  263. package/build/components/list-view/list-item.js.map +0 -1
  264. package/build/components/rich-text/use-caret-in-format.js +0 -43
  265. package/build/components/rich-text/use-caret-in-format.js.map +0 -1
  266. package/build/hooks/border-color.js +0 -302
  267. package/build/hooks/border-color.js.map +0 -1
  268. package/build/hooks/border-style.js +0 -96
  269. package/build/hooks/border-style.js.map +0 -1
  270. package/build/hooks/border-width.js +0 -162
  271. package/build/hooks/border-width.js.map +0 -1
  272. package/build-module/components/block-mobile-toolbar/index.js +0 -31
  273. package/build-module/components/block-mobile-toolbar/index.js.map +0 -1
  274. package/build-module/components/block-tools/block-popover.js.map +0 -1
  275. package/build-module/components/block-tools/use-popover-scroll.js.map +0 -1
  276. package/build-module/components/border-style-control/index.js +0 -50
  277. package/build-module/components/border-style-control/index.js.map +0 -1
  278. package/build-module/components/list-view/appender.js +0 -76
  279. package/build-module/components/list-view/appender.js.map +0 -1
  280. package/build-module/components/list-view/list-item.js +0 -47
  281. package/build-module/components/list-view/list-item.js.map +0 -1
  282. package/build-module/components/rich-text/use-caret-in-format.js +0 -33
  283. package/build-module/components/rich-text/use-caret-in-format.js.map +0 -1
  284. package/build-module/hooks/border-color.js +0 -276
  285. package/build-module/hooks/border-color.js.map +0 -1
  286. package/build-module/hooks/border-style.js +0 -78
  287. package/build-module/hooks/border-style.js.map +0 -1
  288. package/build-module/hooks/border-width.js +0 -143
  289. package/build-module/hooks/border-width.js.map +0 -1
  290. package/src/components/block-mobile-toolbar/index.js +0 -24
  291. package/src/components/block-mobile-toolbar/style.scss +0 -29
  292. package/src/components/border-style-control/index.js +0 -47
  293. package/src/components/border-style-control/style.scss +0 -18
  294. package/src/components/list-view/appender.js +0 -82
  295. package/src/components/list-view/list-item.js +0 -59
  296. package/src/components/rich-text/use-caret-in-format.js +0 -28
  297. package/src/hooks/border-color.js +0 -315
  298. package/src/hooks/border-style.js +0 -64
  299. package/src/hooks/border-width.js +0 -139
@@ -34,6 +34,7 @@ import { applyFilters } from '@wordpress/hooks';
34
34
  import { symbol } from '@wordpress/icons';
35
35
  import { __ } from '@wordpress/i18n';
36
36
  import { create, remove, toHTMLString } from '@wordpress/rich-text';
37
+ import deprecated from '@wordpress/deprecated';
37
38
 
38
39
  /**
39
40
  * Internal dependencies
@@ -1344,12 +1345,20 @@ export function isAncestorBeingDragged( state, clientId ) {
1344
1345
  /**
1345
1346
  * Returns true if the caret is within formatted text, or false otherwise.
1346
1347
  *
1347
- * @param {Object} state Global application state.
1348
+ * @deprecated
1348
1349
  *
1349
1350
  * @return {boolean} Whether the caret is within formatted text.
1350
1351
  */
1351
- export function isCaretWithinFormattedText( state ) {
1352
- return state.isCaretWithinFormattedText;
1352
+ export function isCaretWithinFormattedText() {
1353
+ deprecated(
1354
+ 'wp.data.select( "core/block-editor" ).isCaretWithinFormattedText',
1355
+ {
1356
+ since: '6.1',
1357
+ version: '6.3',
1358
+ }
1359
+ );
1360
+
1361
+ return false;
1353
1362
  }
1354
1363
 
1355
1364
  /**
@@ -1695,6 +1704,26 @@ export function canMoveBlocks( state, clientIds, rootClientId = null ) {
1695
1704
  );
1696
1705
  }
1697
1706
 
1707
+ /**
1708
+ * Determines if the given block is allowed to be edited.
1709
+ *
1710
+ * @param {Object} state Editor state.
1711
+ * @param {string} clientId The block client Id.
1712
+ *
1713
+ * @return {boolean} Whether the given block is allowed to be edited.
1714
+ */
1715
+ export function canEditBlock( state, clientId ) {
1716
+ const attributes = getBlockAttributes( state, clientId );
1717
+ if ( attributes === null ) {
1718
+ return true;
1719
+ }
1720
+
1721
+ const { lock } = attributes;
1722
+
1723
+ // When the edit is true, we cannot edit the block.
1724
+ return ! lock?.edit;
1725
+ }
1726
+
1698
1727
  /**
1699
1728
  * Determines if the given block type can be locked/unlocked by a user.
1700
1729
  *
@@ -2021,23 +2050,25 @@ export const getInserterItems = createSelector(
2021
2050
  *
2022
2051
  * Items are returned ordered descendingly by their 'frecency'.
2023
2052
  *
2024
- * @param {Object} state Editor state.
2025
- * @param {?string} rootClientId Optional root client ID of block list.
2053
+ * @param {Object} state Editor state.
2054
+ * @param {Object|Object[]} blocks Block object or array objects.
2055
+ * @param {?string} rootClientId Optional root client ID of block list.
2026
2056
  *
2027
2057
  * @return {WPEditorTransformItem[]} Items that appear in inserter.
2028
2058
  *
2029
2059
  * @typedef {Object} WPEditorTransformItem
2030
- * @property {string} id Unique identifier for the item.
2031
- * @property {string} name The type of block to create.
2032
- * @property {string} title Title of the item, as it appears in the inserter.
2033
- * @property {string} icon Dashicon for the item, as it appears in the inserter.
2034
- * @property {boolean} isDisabled Whether or not the user should be prevented from inserting
2035
- * this item.
2036
- * @property {number} frecency Heuristic that combines frequency and recency.
2060
+ * @property {string} id Unique identifier for the item.
2061
+ * @property {string} name The type of block to create.
2062
+ * @property {string} title Title of the item, as it appears in the inserter.
2063
+ * @property {string} icon Dashicon for the item, as it appears in the inserter.
2064
+ * @property {boolean} isDisabled Whether or not the user should be prevented from inserting
2065
+ * this item.
2066
+ * @property {number} frecency Heuristic that combines frequency and recency.
2037
2067
  */
2038
2068
  export const getBlockTransformItems = createSelector(
2039
2069
  ( state, blocks, rootClientId = null ) => {
2040
- const [ sourceBlock ] = blocks;
2070
+ const normalizedBlocks = castArray( blocks );
2071
+ const [ sourceBlock ] = normalizedBlocks;
2041
2072
  const buildBlockTypeTransformItem = buildBlockTypeItem( state, {
2042
2073
  buildScope: 'transform',
2043
2074
  } );
@@ -2059,11 +2090,11 @@ export const getBlockTransformItems = createSelector(
2059
2090
  isDisabled: false,
2060
2091
  name: '*',
2061
2092
  title: __( 'Unwrap' ),
2062
- icon: itemsByName[ sourceBlock.name ]?.icon,
2093
+ icon: itemsByName[ sourceBlock?.name ]?.icon,
2063
2094
  };
2064
2095
 
2065
2096
  const possibleTransforms = getPossibleBlockTransformations(
2066
- blocks
2097
+ normalizedBlocks
2067
2098
  ).reduce( ( accumulator, block ) => {
2068
2099
  if ( block === '*' ) {
2069
2100
  accumulator.push( itemsByName[ '*' ] );
@@ -26,8 +26,6 @@ import { STORE_NAME as blockEditorStoreName } from '../../store/constants';
26
26
 
27
27
  const {
28
28
  clearSelectedBlock,
29
- enterFormattedText,
30
- exitFormattedText,
31
29
  hideInsertionPoint,
32
30
  insertBlock,
33
31
  insertBlocks,
@@ -819,22 +817,6 @@ describe( 'actions', () => {
819
817
  } );
820
818
  } );
821
819
 
822
- describe( 'enterFormattedText', () => {
823
- it( 'should return the ENTER_FORMATTED_TEXT action', () => {
824
- expect( enterFormattedText() ).toEqual( {
825
- type: 'ENTER_FORMATTED_TEXT',
826
- } );
827
- } );
828
- } );
829
-
830
- describe( 'exitFormattedText', () => {
831
- it( 'should return the EXIT_FORMATTED_TEXT action', () => {
832
- expect( exitFormattedText() ).toEqual( {
833
- type: 'EXIT_FORMATTED_TEXT',
834
- } );
835
- } );
836
- } );
837
-
838
820
  describe( 'toggleSelection', () => {
839
821
  it( 'should return the TOGGLE_SELECTION action with default value for isSelectionEnabled = true', () => {
840
822
  expect( toggleSelection() ).toEqual( {
@@ -22,7 +22,6 @@ import {
22
22
  blocks,
23
23
  isTyping,
24
24
  draggedBlocks,
25
- isCaretWithinFormattedText,
26
25
  selection,
27
26
  initialPosition,
28
27
  isMultiSelecting,
@@ -2160,24 +2159,6 @@ describe( 'state', () => {
2160
2159
  } );
2161
2160
  } );
2162
2161
 
2163
- describe( 'isCaretWithinFormattedText()', () => {
2164
- it( 'should set the flag to true', () => {
2165
- const state = isCaretWithinFormattedText( false, {
2166
- type: 'ENTER_FORMATTED_TEXT',
2167
- } );
2168
-
2169
- expect( state ).toBe( true );
2170
- } );
2171
-
2172
- it( 'should set the flag to false', () => {
2173
- const state = isCaretWithinFormattedText( true, {
2174
- type: 'EXIT_FORMATTED_TEXT',
2175
- } );
2176
-
2177
- expect( state ).toBe( false );
2178
- } );
2179
- } );
2180
-
2181
2162
  describe( 'initialPosition()', () => {
2182
2163
  it( 'should return with block clientId as selected', () => {
2183
2164
  const state = initialPosition( undefined, {
@@ -54,7 +54,6 @@ const {
54
54
  getDraggedBlockClientIds,
55
55
  isBlockBeingDragged,
56
56
  isAncestorBeingDragged,
57
- isCaretWithinFormattedText,
58
57
  getBlockInsertionPoint,
59
58
  isBlockInsertionPointVisible,
60
59
  isSelectionEnabled,
@@ -2056,24 +2055,6 @@ describe( 'selectors', () => {
2056
2055
  } );
2057
2056
  } );
2058
2057
 
2059
- describe( 'isCaretWithinFormattedText', () => {
2060
- it( 'returns true if the isCaretWithinFormattedText state is also true', () => {
2061
- const state = {
2062
- isCaretWithinFormattedText: true,
2063
- };
2064
-
2065
- expect( isCaretWithinFormattedText( state ) ).toBe( true );
2066
- } );
2067
-
2068
- it( 'returns false if the isCaretWithinFormattedText state is also false', () => {
2069
- const state = {
2070
- isCaretWithinFormattedText: false,
2071
- };
2072
-
2073
- expect( isCaretWithinFormattedText( state ) ).toBe( false );
2074
- } );
2075
- } );
2076
-
2077
2058
  describe( 'isSelectionEnabled', () => {
2078
2059
  it( 'should return true if selection is enable', () => {
2079
2060
  const state = {
@@ -3112,6 +3093,23 @@ describe( 'selectors', () => {
3112
3093
  ] )
3113
3094
  );
3114
3095
  } );
3096
+ it( 'should support single block object', () => {
3097
+ const state = {
3098
+ blocks: {
3099
+ byClientId: {},
3100
+ attributes: {},
3101
+ order: {},
3102
+ parents: {},
3103
+ cache: {},
3104
+ },
3105
+ settings: {},
3106
+ preferences: {},
3107
+ blockListSettings: {},
3108
+ };
3109
+ const block = { name: 'core/with-tranforms-a' };
3110
+ const items = getBlockTransformItems( state, block );
3111
+ expect( items ).toHaveLength( 2 );
3112
+ } );
3115
3113
  it( 'should return only eligible blocks for transformation - `allowedBlocks`', () => {
3116
3114
  const state = {
3117
3115
  blocks: {
package/src/style.scss CHANGED
@@ -12,11 +12,11 @@
12
12
  @import "./components/block-compare/style.scss";
13
13
  @import "./components/block-content-overlay/style.scss";
14
14
  @import "./components/block-draggable/style.scss";
15
- @import "./components/block-mobile-toolbar/style.scss";
16
15
  @import "./components/block-mover/style.scss";
17
16
  @import "./components/block-navigation/style.scss";
18
17
  @import "./components/block-parent-selector/style.scss";
19
18
  @import "./components/block-patterns-list/style.scss";
19
+ @import "./components/block-popover/style.scss";
20
20
  @import "./components/block-preview/style.scss";
21
21
  @import "./components/block-settings-menu/style.scss";
22
22
  @import "./components/block-styles/style.scss";
@@ -26,7 +26,6 @@
26
26
  @import "./components/block-pattern-setup/style.scss";
27
27
  @import "./components/block-variation-transforms/style.scss";
28
28
  @import "./components/border-radius-control/style.scss";
29
- @import "./components/border-style-control/style.scss";
30
29
  @import "./components/button-block-appender/style.scss";
31
30
  @import "./components/colors-gradients/style.scss";
32
31
  @import "./components/contrast-checker/style.scss";
@@ -59,6 +58,7 @@
59
58
  @import "./hooks/dimensions.scss";
60
59
  @import "./hooks/typography.scss";
61
60
  @import "./hooks/color.scss";
61
+ @import "./hooks/padding.scss";
62
62
 
63
63
  @import "./components/block-toolbar/style.scss";
64
64
  @import "./components/inserter/style.scss";
@@ -1 +1 @@
1
- {"program":{"fileNames":["../../node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/typescript/lib/lib.es2015.d.ts","../../node_modules/typescript/lib/lib.es2016.d.ts","../../node_modules/typescript/lib/lib.es2017.d.ts","../../node_modules/typescript/lib/lib.es2018.d.ts","../../node_modules/typescript/lib/lib.es2019.d.ts","../../node_modules/typescript/lib/lib.es2020.d.ts","../../node_modules/typescript/lib/lib.es2021.d.ts","../../node_modules/typescript/lib/lib.esnext.d.ts","../../node_modules/typescript/lib/lib.dom.d.ts","../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../node_modules/@types/react/global.d.ts","../../node_modules/@types/react/node_modules/csstype/index.d.ts","../../node_modules/@types/prop-types/index.d.ts","../../node_modules/@types/scheduler/tracing.d.ts","../../node_modules/@types/react/index.d.ts","../element/build-types/react.d.ts","../element/build-types/create-interpolate-element.d.ts","../../node_modules/@types/react-dom/index.d.ts","../element/build-types/react-platform.d.ts","../element/build-types/utils.d.ts","../element/build-types/platform.d.ts","../element/build-types/serialize.d.ts","../element/build-types/raw-html.d.ts","../element/build-types/index.d.ts","./src/components/block-context/index.js","./src/utils/dom.js"],"fileInfos":[{"version":"aa9fb4c70f369237c2f45f9d969c9a59e0eae9a192962eb48581fe864aa609db","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","e6b724280c694a9f588847f754198fb96c43d805f065c3a5b28bbc9594541c84","e21c071ca3e1b4a815d5f04a7475adcaeea5d64367e840dd0154096d705c3940","eb75e89d63b3b72dd9ca8b0cac801cecae5be352307c004adeaa60bc9d6df51f","2cc028cd0bdb35b1b5eb723d84666a255933fffbea607f72cbd0c7c7b4bee144",{"version":"e54c8715a4954cfdc66cd69489f2b725c09ebf37492dbd91cff0a1688b1159e8","affectsGlobalScope":true},{"version":"51b8b27c21c066bf877646e320bf6a722b80d1ade65e686923cd9d4494aef1ca","affectsGlobalScope":true},{"version":"43fb1d932e4966a39a41b464a12a81899d9ae5f2c829063f5571b6b87e6d2f9c","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"2c8c5ee58f30e7c944e04ab1fb5506fdbb4dd507c9efa6972cf4b91cec90c503","affectsGlobalScope":true},{"version":"2bb4b3927299434052b37851a47bf5c39764f2ba88a888a107b32262e9292b7c","affectsGlobalScope":true},{"version":"810627a82ac06fb5166da5ada4159c4ec11978dfbb0805fe804c86406dab8357","affectsGlobalScope":true},{"version":"62d80405c46c3f4c527ee657ae9d43fda65a0bf582292429aea1e69144a522a6","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"75ec0bdd727d887f1b79ed6619412ea72ba3c81d92d0787ccb64bab18d261f14","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"12a310447c5d23c7d0d5ca2af606e3bd08afda69100166730ab92c62999ebb9d","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"df9c8a72ca8b0ed62f5470b41208a0587f0f73f0a7db28e5a1272cf92537518e","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"93544ca2f26a48716c1b6c5091842cad63129daac422dfa4bc52460465f22bb1","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"1b3fe904465430e030c93239a348f05e1be80640d91f2f004c3512c2c2c89f34","affectsGlobalScope":true},{"version":"7435b75fdf3509622e79622dbe5091cf4b09688410ee2034e4fc17d0c99d0862","affectsGlobalScope":true},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true},{"version":"9f1817f7c3f02f6d56e0f403b927e90bb133f371dcebc36fa7d6d208ef6899da","affectsGlobalScope":true},{"version":"cd6efb9467a8b6338ece2e2855e37765700f2cd061ca54b01b33878cf5c7677e","affectsGlobalScope":true},{"version":"fb4416144c1bf0323ccbc9afb0ab289c07312214e8820ad17d709498c865a3fe","affectsGlobalScope":true},{"version":"5b0ca94ec819d68d33da516306c15297acec88efeb0ae9e2b39f71dbd9685ef7","affectsGlobalScope":true},{"version":"4632665b87204bb1caa8b44d165bce0c50dfab177df5b561b345a567cabacf9a","affectsGlobalScope":true},{"version":"ecf78e637f710f340ec08d5d92b3f31b134a46a4fcf2e758690d8c46ce62cba6","affectsGlobalScope":true},"381899b8d1d4c1be716f18cb5242ba39f66f4b1e31d45af62a32a99f8edcb39d","f7b46d22a307739c145e5fddf537818038fdfffd580d79ed717f4d4d37249380","f5a8b384f182b3851cec3596ccc96cb7464f8d3469f48c74bf2befb782a19de5",{"version":"1bc82f5b3bb93df76d19730c84467b0b346187198537135d63a672956f323720","affectsGlobalScope":true},"e59d00012fb20e6746def2f4bc94650526aa6c574c49ad6a50a992f61a3ee675","e47b8ec56eb49bc1c53c9012daa9874de14ad0c5da442485aec333571c74b526","45a63e17814c570ea59407f231ef9c561510bd6edb36f17479b09b44619496c6","64edfb2b255173bc63214290f9c3ed2306d658b5895ca482a0f20f03fd544ffc","d2d9e98a2b167079474768593e1e7125fc3db055add8fbdb5977e3d05a8a3696","6462da67490105ba7d98cf312c2faf8794c425781128b161ea8394d66502eec8","62359da52b6c8d00c50c2e50738fac82e902f916fdf458d8159e7edb1c60c3a8","1e0ac21bc775686383ea8c8e48bd98b385e6195b25c85525a7affd08a2cd38b9","0449615e1ed03c7d54fc435a63b7ef0cb4e5cea5ac40c9a63280a46f7eeae0ff","c2785f1635be52763ea678e43064f7b5195af88fc8652781950ae12bdd8049d7","4e8c59b6c243b9148b72d7428c71592176a520225ee91b718f4a655a5baf6624"],"options":{"allowSyntheticDefaultImports":true,"composite":true,"declaration":true,"declarationDir":"./build-types","declarationMap":true,"emitDeclarationOnly":true,"esModuleInterop":false,"importsNotUsedAsValues":2,"jsx":1,"module":99,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"rootDir":"./src","strict":true,"target":99},"fileIdsList":[[49],[45,46,47,48],[49,58],[50],[50,51,53,54,55,56,57],[52],[49,50]],"referencedMap":[[52,1],[49,2],[59,3],[51,4],[58,5],[57,1],[53,6],[50,1],[56,7]],"exportedModulesMap":[[52,1],[49,2],[59,3],[51,4],[58,5],[57,1],[53,6],[50,1],[56,7]],"semanticDiagnosticsPerFile":[47,52,45,49,46,48,10,12,11,2,13,14,15,16,17,18,19,20,3,4,24,21,22,23,25,26,27,5,28,29,30,31,6,32,33,34,35,7,40,36,37,38,39,8,41,42,43,1,9,44,59,60,51,58,55,57,53,50,56,54]},"version":"4.4.2"}
1
+ {"program":{"fileNames":["../../node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/typescript/lib/lib.es2015.d.ts","../../node_modules/typescript/lib/lib.es2016.d.ts","../../node_modules/typescript/lib/lib.es2017.d.ts","../../node_modules/typescript/lib/lib.es2018.d.ts","../../node_modules/typescript/lib/lib.es2019.d.ts","../../node_modules/typescript/lib/lib.es2020.d.ts","../../node_modules/typescript/lib/lib.es2021.d.ts","../../node_modules/typescript/lib/lib.esnext.d.ts","../../node_modules/typescript/lib/lib.dom.d.ts","../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../node_modules/@types/react/global.d.ts","../../node_modules/@types/react/node_modules/csstype/index.d.ts","../../node_modules/@types/prop-types/index.d.ts","../../node_modules/@types/scheduler/tracing.d.ts","../../node_modules/@types/react/index.d.ts","../element/build-types/react.d.ts","../element/build-types/create-interpolate-element.d.ts","../../node_modules/@types/react-dom/index.d.ts","../element/build-types/react-platform.d.ts","../element/build-types/utils.d.ts","../element/build-types/platform.d.ts","../element/build-types/serialize.d.ts","../element/build-types/raw-html.d.ts","../element/build-types/index.d.ts","./src/components/block-context/index.js","./src/utils/dom.js"],"fileInfos":[{"version":"aa9fb4c70f369237c2f45f9d969c9a59e0eae9a192962eb48581fe864aa609db","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","e6b724280c694a9f588847f754198fb96c43d805f065c3a5b28bbc9594541c84","e21c071ca3e1b4a815d5f04a7475adcaeea5d64367e840dd0154096d705c3940","eb75e89d63b3b72dd9ca8b0cac801cecae5be352307c004adeaa60bc9d6df51f","2cc028cd0bdb35b1b5eb723d84666a255933fffbea607f72cbd0c7c7b4bee144",{"version":"e54c8715a4954cfdc66cd69489f2b725c09ebf37492dbd91cff0a1688b1159e8","affectsGlobalScope":true},{"version":"51b8b27c21c066bf877646e320bf6a722b80d1ade65e686923cd9d4494aef1ca","affectsGlobalScope":true},{"version":"43fb1d932e4966a39a41b464a12a81899d9ae5f2c829063f5571b6b87e6d2f9c","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"2c8c5ee58f30e7c944e04ab1fb5506fdbb4dd507c9efa6972cf4b91cec90c503","affectsGlobalScope":true},{"version":"2bb4b3927299434052b37851a47bf5c39764f2ba88a888a107b32262e9292b7c","affectsGlobalScope":true},{"version":"810627a82ac06fb5166da5ada4159c4ec11978dfbb0805fe804c86406dab8357","affectsGlobalScope":true},{"version":"62d80405c46c3f4c527ee657ae9d43fda65a0bf582292429aea1e69144a522a6","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"75ec0bdd727d887f1b79ed6619412ea72ba3c81d92d0787ccb64bab18d261f14","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"12a310447c5d23c7d0d5ca2af606e3bd08afda69100166730ab92c62999ebb9d","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"df9c8a72ca8b0ed62f5470b41208a0587f0f73f0a7db28e5a1272cf92537518e","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"93544ca2f26a48716c1b6c5091842cad63129daac422dfa4bc52460465f22bb1","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"1b3fe904465430e030c93239a348f05e1be80640d91f2f004c3512c2c2c89f34","affectsGlobalScope":true},{"version":"7435b75fdf3509622e79622dbe5091cf4b09688410ee2034e4fc17d0c99d0862","affectsGlobalScope":true},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true},{"version":"9f1817f7c3f02f6d56e0f403b927e90bb133f371dcebc36fa7d6d208ef6899da","affectsGlobalScope":true},{"version":"cd6efb9467a8b6338ece2e2855e37765700f2cd061ca54b01b33878cf5c7677e","affectsGlobalScope":true},{"version":"fb4416144c1bf0323ccbc9afb0ab289c07312214e8820ad17d709498c865a3fe","affectsGlobalScope":true},{"version":"5b0ca94ec819d68d33da516306c15297acec88efeb0ae9e2b39f71dbd9685ef7","affectsGlobalScope":true},{"version":"4632665b87204bb1caa8b44d165bce0c50dfab177df5b561b345a567cabacf9a","affectsGlobalScope":true},{"version":"ecf78e637f710f340ec08d5d92b3f31b134a46a4fcf2e758690d8c46ce62cba6","affectsGlobalScope":true},"381899b8d1d4c1be716f18cb5242ba39f66f4b1e31d45af62a32a99f8edcb39d","f7b46d22a307739c145e5fddf537818038fdfffd580d79ed717f4d4d37249380","f5a8b384f182b3851cec3596ccc96cb7464f8d3469f48c74bf2befb782a19de5",{"version":"1bc82f5b3bb93df76d19730c84467b0b346187198537135d63a672956f323720","affectsGlobalScope":true},"e59d00012fb20e6746def2f4bc94650526aa6c574c49ad6a50a992f61a3ee675","e47b8ec56eb49bc1c53c9012daa9874de14ad0c5da442485aec333571c74b526","45a63e17814c570ea59407f231ef9c561510bd6edb36f17479b09b44619496c6","5d7018910750d9cb4a912577ad2951fc3fad83c30d637689b69ffc6bbb0c9f5a","d2d9e98a2b167079474768593e1e7125fc3db055add8fbdb5977e3d05a8a3696","6462da67490105ba7d98cf312c2faf8794c425781128b161ea8394d66502eec8","62359da52b6c8d00c50c2e50738fac82e902f916fdf458d8159e7edb1c60c3a8","1e0ac21bc775686383ea8c8e48bd98b385e6195b25c85525a7affd08a2cd38b9","0449615e1ed03c7d54fc435a63b7ef0cb4e5cea5ac40c9a63280a46f7eeae0ff","c2785f1635be52763ea678e43064f7b5195af88fc8652781950ae12bdd8049d7","4e8c59b6c243b9148b72d7428c71592176a520225ee91b718f4a655a5baf6624"],"options":{"allowSyntheticDefaultImports":true,"composite":true,"declaration":true,"declarationDir":"./build-types","declarationMap":true,"emitDeclarationOnly":true,"esModuleInterop":false,"importsNotUsedAsValues":2,"jsx":1,"module":99,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"rootDir":"./src","strict":true,"target":99},"fileIdsList":[[49],[45,46,47,48],[49,58],[50],[50,51,53,54,55,56,57],[52],[49,50]],"referencedMap":[[52,1],[49,2],[59,3],[51,4],[58,5],[57,1],[53,6],[50,1],[56,7]],"exportedModulesMap":[[52,1],[49,2],[59,3],[51,4],[58,5],[57,1],[53,6],[50,1],[56,7]],"semanticDiagnosticsPerFile":[47,52,45,49,46,48,10,12,11,2,13,14,15,16,17,18,19,20,3,4,24,21,22,23,25,26,27,5,28,29,30,31,6,32,33,34,35,7,40,36,37,38,39,8,41,42,43,1,9,44,59,60,51,58,55,57,53,50,56,54]},"version":"4.4.2"}
@@ -1,42 +0,0 @@
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 = void 0;
9
-
10
- var _element = require("@wordpress/element");
11
-
12
- var _compose = require("@wordpress/compose");
13
-
14
- var _blockMover = _interopRequireDefault(require("../block-mover"));
15
-
16
- /**
17
- * WordPress dependencies
18
- */
19
-
20
- /**
21
- * Internal dependencies
22
- */
23
- function BlockMobileToolbar(_ref) {
24
- let {
25
- clientId
26
- } = _ref;
27
- const isMobile = (0, _compose.useViewportMatch)('small', '<');
28
-
29
- if (!isMobile) {
30
- return null;
31
- }
32
-
33
- return (0, _element.createElement)("div", {
34
- className: "block-editor-block-mobile-toolbar"
35
- }, (0, _element.createElement)(_blockMover.default, {
36
- clientIds: [clientId]
37
- }));
38
- }
39
-
40
- var _default = BlockMobileToolbar;
41
- exports.default = _default;
42
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/block-mobile-toolbar/index.js"],"names":["BlockMobileToolbar","clientId","isMobile"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AARA;AACA;AACA;;AAGA;AACA;AACA;AAGA,SAASA,kBAAT,OAA4C;AAAA,MAAf;AAAEC,IAAAA;AAAF,GAAe;AAC3C,QAAMC,QAAQ,GAAG,+BAAkB,OAAlB,EAA2B,GAA3B,CAAjB;;AACA,MAAK,CAAEA,QAAP,EAAkB;AACjB,WAAO,IAAP;AACA;;AAED,SACC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,4BAAC,mBAAD;AAAY,IAAA,SAAS,EAAG,CAAED,QAAF;AAAxB,IADD,CADD;AAKA;;eAEcD,kB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useViewportMatch } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport BlockMover from '../block-mover';\n\nfunction BlockMobileToolbar( { clientId } ) {\n\tconst isMobile = useViewportMatch( 'small', '<' );\n\tif ( ! isMobile ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<div className=\"block-editor-block-mobile-toolbar\">\n\t\t\t<BlockMover clientIds={ [ clientId ] } />\n\t\t</div>\n\t);\n}\n\nexport default BlockMobileToolbar;\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/block-tools/block-popover.js"],"names":["selector","select","isNavigationMode","isMultiSelecting","hasMultiSelection","isTyping","isCaretWithinFormattedText","getSettings","getLastMultiSelectedBlockClientId","blockEditorStore","hasFixedToolbar","lastClientId","BlockPopover","clientId","rootClientId","isValid","isEmptyDefaultBlock","capturingClientId","__unstablePopoverSlot","__unstableContentRef","isInsertionPointVisible","isBlockInsertionPointVisible","getBlockInsertionPoint","getBlockOrder","insertionPoint","order","index","isLargeViewport","isToolbarForced","setIsToolbarForced","isInserterShown","setIsInserterShown","stopTyping","showEmptyBlockSideInserter","shouldShowBreadcrumb","shouldShowContextualToolbar","canFocusHiddenToolbar","isDisabled","initialToolbarItemIndexRef","selectedElement","lastSelectedElement","capturingElement","popoverScrollRef","node","anchorRef","top","bottom","onFocus","onBlur","popoverPosition","ownerDocument","stickyBoundaryElement","undefined","defaultView","frameElement","body","current","wrapperSelector","getSelectedBlockClientId","getFirstMultiSelectedBlockClientId","getBlockRootClientId","getBlock","getBlockParents","__experimentalGetBlockListSettingsForBlocks","name","attributes","blockParentsClientIds","parentBlockListSettings","parentClientId","__experimentalCaptureToolbars","WrappedBlockPopover","selected"],"mappings":";;;;;;;;;AASA;;AANA;;AACA;;AAMA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAzBA;AACA;AACA;;AAIA;AACA;AACA;;AASA;AACA;AACA;AAQA,SAASA,QAAT,CAAmBC,MAAnB,EAA4B;AAC3B,QAAM;AACLC,IAAAA,gBADK;AAELC,IAAAA,gBAFK;AAGLC,IAAAA,iBAHK;AAILC,IAAAA,QAJK;AAKLC,IAAAA,0BALK;AAMLC,IAAAA,WANK;AAOLC,IAAAA;AAPK,MAQFP,MAAM,CAAEQ,YAAF,CARV;AASA,SAAO;AACNP,IAAAA,gBAAgB,EAAEA,gBAAgB,EAD5B;AAENC,IAAAA,gBAAgB,EAAEA,gBAAgB,EAF5B;AAGNE,IAAAA,QAAQ,EAAEA,QAAQ,EAHZ;AAINC,IAAAA,0BAA0B,EAAEA,0BAA0B,EAJhD;AAKNF,IAAAA,iBAAiB,EAAEA,iBAAiB,EAL9B;AAMNM,IAAAA,eAAe,EAAEH,WAAW,GAAGG,eANzB;AAONC,IAAAA,YAAY,EAAEH,iCAAiC;AAPzC,GAAP;AASA;;AAED,SAASI,YAAT,OAQI;AAAA,MARmB;AACtBC,IAAAA,QADsB;AAEtBC,IAAAA,YAFsB;AAGtBC,IAAAA,OAHsB;AAItBC,IAAAA,mBAJsB;AAKtBC,IAAAA,iBALsB;AAMtBC,IAAAA,qBANsB;AAOtBC,IAAAA;AAPsB,GAQnB;AACH,QAAM;AACLjB,IAAAA,gBADK;AAELC,IAAAA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APxB,IADD;AAWA","sourcesContent":["/**\n * External dependencies\n */\nimport { find } from 'lodash';\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useState, useRef, useEffect } from '@wordpress/element';\nimport { isUnmodifiedDefaultBlock } from '@wordpress/blocks';\nimport { Popover } from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useShortcut } from '@wordpress/keyboard-shortcuts';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { getScrollContainer } from '@wordpress/dom';\n\n/**\n * Internal dependencies\n */\nimport BlockSelectionButton from './block-selection-button';\nimport BlockContextualToolbar from './block-contextual-toolbar';\nimport Inserter from '../inserter';\nimport { store as blockEditorStore } from '../../store';\nimport { __unstableUseBlockElement as useBlockElement } from '../block-list/use-block-props/use-block-refs';\nimport { usePopoverScroll } from './use-popover-scroll';\n\nfunction selector( select ) {\n\tconst {\n\t\tisNavigationMode,\n\t\tisMultiSelecting,\n\t\thasMultiSelection,\n\t\tisTyping,\n\t\tisCaretWithinFormattedText,\n\t\tgetSettings,\n\t\tgetLastMultiSelectedBlockClientId,\n\t} = select( blockEditorStore );\n\treturn {\n\t\tisNavigationMode: isNavigationMode(),\n\t\tisMultiSelecting: isMultiSelecting(),\n\t\tisTyping: isTyping(),\n\t\tisCaretWithinFormattedText: isCaretWithinFormattedText(),\n\t\thasMultiSelection: hasMultiSelection(),\n\t\thasFixedToolbar: getSettings().hasFixedToolbar,\n\t\tlastClientId: getLastMultiSelectedBlockClientId(),\n\t};\n}\n\nfunction BlockPopover( {\n\tclientId,\n\trootClientId,\n\tisValid,\n\tisEmptyDefaultBlock,\n\tcapturingClientId,\n\t__unstablePopoverSlot,\n\t__unstableContentRef,\n} ) {\n\tconst {\n\t\tisNavigationMode,\n\t\tisMultiSelecting,\n\t\tisTyping,\n\t\tisCaretWithinFormattedText,\n\t\thasMultiSelection,\n\t\thasFixedToolbar,\n\t\tlastClientId,\n\t} = useSelect( selector, [] );\n\tconst isInsertionPointVisible = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tisBlockInsertionPointVisible,\n\t\t\t\tgetBlockInsertionPoint,\n\t\t\t\tgetBlockOrder,\n\t\t\t} = select( blockEditorStore );\n\n\t\t\tif ( ! isBlockInsertionPointVisible() ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tconst insertionPoint = getBlockInsertionPoint();\n\t\t\tconst order = getBlockOrder( insertionPoint.rootClientId );\n\t\t\treturn order[ insertionPoint.index ] === clientId;\n\t\t},\n\t\t[ clientId ]\n\t);\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst [ isToolbarForced, setIsToolbarForced ] = useState( false );\n\tconst [ isInserterShown, setIsInserterShown ] = useState( false );\n\tconst { stopTyping } = useDispatch( blockEditorStore );\n\n\t// Controls when the side inserter on empty lines should\n\t// be shown, including writing and selection modes.\n\tconst showEmptyBlockSideInserter =\n\t\t! isTyping && ! isNavigationMode && isEmptyDefaultBlock && isValid;\n\tconst shouldShowBreadcrumb = isNavigationMode;\n\tconst shouldShowContextualToolbar =\n\t\t! isNavigationMode &&\n\t\t! hasFixedToolbar &&\n\t\tisLargeViewport &&\n\t\t! showEmptyBlockSideInserter &&\n\t\t! isMultiSelecting &&\n\t\t( ! isTyping || isCaretWithinFormattedText );\n\tconst canFocusHiddenToolbar =\n\t\t! isNavigationMode &&\n\t\t! shouldShowContextualToolbar &&\n\t\t! hasFixedToolbar &&\n\t\t! isEmptyDefaultBlock;\n\n\tuseShortcut(\n\t\t'core/block-editor/focus-toolbar',\n\t\t() => {\n\t\t\tsetIsToolbarForced( true );\n\t\t\tstopTyping( true );\n\t\t},\n\t\t{\n\t\t\tisDisabled: ! canFocusHiddenToolbar,\n\t\t}\n\t);\n\n\tuseEffect( () => {\n\t\tif ( ! shouldShowContextualToolbar ) {\n\t\t\tsetIsToolbarForced( false );\n\t\t}\n\t}, [ shouldShowContextualToolbar ] );\n\n\t// Stores the active toolbar item index so the block toolbar can return focus\n\t// to it when re-mounting.\n\tconst initialToolbarItemIndexRef = useRef();\n\n\tconst selectedElement = useBlockElement( clientId );\n\tconst lastSelectedElement = useBlockElement( lastClientId );\n\tconst capturingElement = useBlockElement( capturingClientId );\n\n\tconst popoverScrollRef = usePopoverScroll( __unstableContentRef );\n\n\tif (\n\t\t! shouldShowBreadcrumb &&\n\t\t! shouldShowContextualToolbar &&\n\t\t! isToolbarForced &&\n\t\t! showEmptyBlockSideInserter\n\t) {\n\t\treturn null;\n\t}\n\n\tlet node = selectedElement;\n\n\tif ( ! node ) {\n\t\treturn null;\n\t}\n\n\tif ( capturingClientId ) {\n\t\tnode = capturingElement;\n\t}\n\n\tlet anchorRef = node;\n\n\tif ( hasMultiSelection ) {\n\t\t// Wait to render the popover until the bottom reference is available\n\t\t// as well.\n\t\tif ( ! lastSelectedElement ) {\n\t\t\treturn null;\n\t\t}\n\n\t\tanchorRef = {\n\t\t\ttop: node,\n\t\t\tbottom: lastSelectedElement,\n\t\t};\n\t}\n\n\tfunction onFocus() {\n\t\tsetIsInserterShown( true );\n\t}\n\n\tfunction onBlur() {\n\t\tsetIsInserterShown( false );\n\t}\n\n\t// Position above the anchor, pop out towards the right, and position in the\n\t// left corner. For the side inserter, pop out towards the left, and\n\t// position in the right corner.\n\t// To do: refactor `Popover` to make this prop clearer.\n\tconst popoverPosition = showEmptyBlockSideInserter\n\t\t? 'top left right'\n\t\t: 'top right left';\n\tconst { ownerDocument } = node;\n\tconst stickyBoundaryElement = showEmptyBlockSideInserter\n\t\t? undefined\n\t\t: // The sticky boundary element should be the boundary at which the\n\t\t // the block toolbar becomes sticky when the block scolls out of view.\n\t\t // In case of an iframe, this should be the iframe boundary, otherwise\n\t\t // the scroll container.\n\t\t ownerDocument.defaultView.frameElement ||\n\t\t getScrollContainer( node ) ||\n\t\t ownerDocument.body;\n\n\treturn (\n\t\t<Popover\n\t\t\tref={ popoverScrollRef }\n\t\t\tnoArrow\n\t\t\tanimate={ false }\n\t\t\tposition={ popoverPosition }\n\t\t\tfocusOnMount={ false }\n\t\t\tanchorRef={ anchorRef }\n\t\t\tclassName={ classnames( 'block-editor-block-list__block-popover', {\n\t\t\t\t'is-insertion-point-visible': isInsertionPointVisible,\n\t\t\t} ) }\n\t\t\t__unstableStickyBoundaryElement={ stickyBoundaryElement }\n\t\t\t// Render in the old slot if needed for backward compatibility,\n\t\t\t// otherwise render in place (not in the the default popover slot).\n\t\t\t__unstableSlotName={ __unstablePopoverSlot || null }\n\t\t\t__unstableBoundaryParent\n\t\t\t// Observe movement for block animations (especially horizontal).\n\t\t\t__unstableObserveElement={ node }\n\t\t\tshouldAnchorIncludePadding\n\t\t\t// Used to safeguard sticky position behavior against cases where it would permanently\n\t\t\t// obscure specific sections of a block.\n\t\t\t__unstableEditorCanvasWrapper={ __unstableContentRef?.current }\n\t\t>\n\t\t\t{ ( shouldShowContextualToolbar || isToolbarForced ) && (\n\t\t\t\t<div\n\t\t\t\t\tonFocus={ onFocus }\n\t\t\t\t\tonBlur={ onBlur }\n\t\t\t\t\t// While ideally it would be enough to capture the\n\t\t\t\t\t// bubbling focus event from the Inserter, due to the\n\t\t\t\t\t// characteristics of click focusing of `button`s in\n\t\t\t\t\t// Firefox and Safari, it is not reliable.\n\t\t\t\t\t//\n\t\t\t\t\t// See: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#Clicking_and_focus\n\t\t\t\t\ttabIndex={ -1 }\n\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t'block-editor-block-list__block-popover-inserter',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t'is-visible': isInserterShown,\n\t\t\t\t\t\t}\n\t\t\t\t\t) }\n\t\t\t\t>\n\t\t\t\t\t<Inserter\n\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\trootClientId={ rootClientId }\n\t\t\t\t\t\t__experimentalIsQuick\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t\t{ ( shouldShowContextualToolbar || isToolbarForced ) && (\n\t\t\t\t<BlockContextualToolbar\n\t\t\t\t\t// If the toolbar is being shown because of being forced\n\t\t\t\t\t// it should focus the toolbar right after the mount.\n\t\t\t\t\tfocusOnMount={ isToolbarForced }\n\t\t\t\t\t__experimentalInitialIndex={\n\t\t\t\t\t\tinitialToolbarItemIndexRef.current\n\t\t\t\t\t}\n\t\t\t\t\t__experimentalOnIndexChange={ ( index ) => {\n\t\t\t\t\t\tinitialToolbarItemIndexRef.current = index;\n\t\t\t\t\t} }\n\t\t\t\t\t// Resets the index whenever the active block changes so\n\t\t\t\t\t// this is not persisted. See https://github.com/WordPress/gutenberg/pull/25760#issuecomment-717906169\n\t\t\t\t\tkey={ clientId }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ shouldShowBreadcrumb && (\n\t\t\t\t<BlockSelectionButton\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\trootClientId={ rootClientId }\n\t\t\t\t\tblockElement={ node }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ showEmptyBlockSideInserter && (\n\t\t\t\t<div className=\"block-editor-block-list__empty-block-inserter\">\n\t\t\t\t\t<Inserter\n\t\t\t\t\t\tposition=\"bottom right\"\n\t\t\t\t\t\trootClientId={ rootClientId }\n\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\t__experimentalIsQuick\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</Popover>\n\t);\n}\n\nfunction wrapperSelector( select ) {\n\tconst {\n\t\tgetSelectedBlockClientId,\n\t\tgetFirstMultiSelectedBlockClientId,\n\t\tgetBlockRootClientId,\n\t\tgetBlock,\n\t\tgetBlockParents,\n\t\t__experimentalGetBlockListSettingsForBlocks,\n\t} = select( blockEditorStore );\n\n\tconst clientId =\n\t\tgetSelectedBlockClientId() || getFirstMultiSelectedBlockClientId();\n\n\tif ( ! clientId ) {\n\t\treturn;\n\t}\n\n\tconst { name, attributes = {}, isValid } = getBlock( clientId ) || {};\n\tconst blockParentsClientIds = getBlockParents( clientId );\n\n\t// Get Block List Settings for all ancestors of the current Block clientId.\n\tconst parentBlockListSettings = __experimentalGetBlockListSettingsForBlocks(\n\t\tblockParentsClientIds\n\t);\n\n\t// Get the clientId of the topmost parent with the capture toolbars setting.\n\tconst capturingClientId = find(\n\t\tblockParentsClientIds,\n\t\t( parentClientId ) =>\n\t\t\tparentBlockListSettings[ parentClientId ]\n\t\t\t\t?.__experimentalCaptureToolbars\n\t);\n\n\treturn {\n\t\tclientId,\n\t\trootClientId: getBlockRootClientId( clientId ),\n\t\tname,\n\t\tisValid,\n\t\tisEmptyDefaultBlock:\n\t\t\tname && isUnmodifiedDefaultBlock( { name, attributes } ),\n\t\tcapturingClientId,\n\t};\n}\n\nexport default function WrappedBlockPopover( {\n\t__unstablePopoverSlot,\n\t__unstableContentRef,\n} ) {\n\tconst selected = useSelect( wrapperSelector, [] );\n\n\tif ( ! selected ) {\n\t\treturn null;\n\t}\n\n\tconst {\n\t\tclientId,\n\t\trootClientId,\n\t\tname,\n\t\tisValid,\n\t\tisEmptyDefaultBlock,\n\t\tcapturingClientId,\n\t} = selected;\n\n\tif ( ! name ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<BlockPopover\n\t\t\tclientId={ clientId }\n\t\t\trootClientId={ rootClientId }\n\t\t\tisValid={ isValid }\n\t\t\tisEmptyDefaultBlock={ isEmptyDefaultBlock }\n\t\t\tcapturingClientId={ capturingClientId }\n\t\t\t__unstablePopoverSlot={ __unstablePopoverSlot }\n\t\t\t__unstableContentRef={ __unstableContentRef }\n\t\t/>\n\t);\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/block-tools/use-popover-scroll.js"],"names":["usePopoverScroll","scrollableRef","node","onWheel","event","deltaX","deltaY","current","scrollBy","options","passive","addEventListener","removeEventListener"],"mappings":";;;;;;;AAGA;;AAHA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,gBAAT,CAA2BC,aAA3B,EAA2C;AACjD,SAAO,2BACJC,IAAF,IAAY;AACX,QAAK,CAAED,aAAP,EAAuB;AACtB;AACA;;AAED,aAASE,OAAT,CAAkBC,KAAlB,EAA0B;AACzB,YAAM;AAAEC,QAAAA,MAAF;AAAUC,QAAAA;AAAV,UAAqBF,KAA3B;AACAH,MAAAA,aAAa,CAACM,OAAd,CAAsBC,QAAtB,CAAgCH,MAAhC,EAAwCC,MAAxC;AACA,KARU,CASX;AACA;;;AACA,UAAMG,OAAO,GAAG;AAAEC,MAAAA,OAAO,EAAE;AAAX,KAAhB;AACAR,IAAAA,IAAI,CAACS,gBAAL,CAAuB,OAAvB,EAAgCR,OAAhC,EAAyCM,OAAzC;AACA,WAAO,MAAM;AACZP,MAAAA,IAAI,CAACU,mBAAL,CAA0B,OAA1B,EAAmCT,OAAnC,EAA4CM,OAA5C;AACA,KAFD;AAGA,GAjBK,EAkBN,CAAER,aAAF,CAlBM,CAAP;AAoBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useRefEffect } from '@wordpress/compose';\n\n/**\n * Allow scrolling \"through\" popovers over the canvas. This is only called for\n * as long as the pointer is over a popover. Do not use React events because it\n * will bubble through portals.\n *\n * @param {Object} scrollableRef\n */\nexport function usePopoverScroll( scrollableRef ) {\n\treturn useRefEffect(\n\t\t( node ) => {\n\t\t\tif ( ! scrollableRef ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tfunction onWheel( event ) {\n\t\t\t\tconst { deltaX, deltaY } = event;\n\t\t\t\tscrollableRef.current.scrollBy( deltaX, deltaY );\n\t\t\t}\n\t\t\t// Tell the browser that we do not call event.preventDefault\n\t\t\t// See https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#improving_scrolling_performance_with_passive_listeners\n\t\t\tconst options = { passive: true };\n\t\t\tnode.addEventListener( 'wheel', onWheel, options );\n\t\t\treturn () => {\n\t\t\t\tnode.removeEventListener( 'wheel', onWheel, options );\n\t\t\t};\n\t\t},\n\t\t[ scrollableRef ]\n\t);\n}\n"]}
@@ -1,60 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = BorderStyleControl;
7
-
8
- var _element = require("@wordpress/element");
9
-
10
- var _components = require("@wordpress/components");
11
-
12
- var _i18n = require("@wordpress/i18n");
13
-
14
- var _icons = require("@wordpress/icons");
15
-
16
- /**
17
- * WordPress dependencies
18
- */
19
- const BORDER_STYLES = [{
20
- label: (0, _i18n.__)('Solid'),
21
- icon: _icons.lineSolid,
22
- value: 'solid'
23
- }, {
24
- label: (0, _i18n.__)('Dashed'),
25
- icon: _icons.lineDashed,
26
- value: 'dashed'
27
- }, {
28
- label: (0, _i18n.__)('Dotted'),
29
- icon: _icons.lineDotted,
30
- value: 'dotted'
31
- }];
32
- /**
33
- * Control to display border style options.
34
- *
35
- * @param {Object} props Component props.
36
- * @param {Function} props.onChange Handler for changing border style selection.
37
- * @param {string} props.value Currently selected border style value.
38
- *
39
- * @return {WPElement} Custom border style segmented control.
40
- */
41
-
42
- function BorderStyleControl(_ref) {
43
- let {
44
- onChange,
45
- value
46
- } = _ref;
47
- return (0, _element.createElement)("fieldset", {
48
- className: "components-border-style-control"
49
- }, (0, _element.createElement)("legend", null, (0, _i18n.__)('Style')), (0, _element.createElement)("div", {
50
- className: "components-border-style-control__buttons"
51
- }, BORDER_STYLES.map(borderStyle => (0, _element.createElement)(_components.Button, {
52
- key: borderStyle.value,
53
- icon: borderStyle.icon,
54
- isSmall: true,
55
- isPressed: borderStyle.value === value,
56
- onClick: () => onChange(borderStyle.value === value ? undefined : borderStyle.value),
57
- "aria-label": borderStyle.label
58
- }))));
59
- }
60
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/border-style-control/index.js"],"names":["BORDER_STYLES","label","icon","lineSolid","value","lineDashed","lineDotted","BorderStyleControl","onChange","map","borderStyle","undefined"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AALA;AACA;AACA;AAKA,MAAMA,aAAa,GAAG,CACrB;AAAEC,EAAAA,KAAK,EAAE,cAAI,OAAJ,CAAT;AAAwBC,EAAAA,IAAI,EAAEC,gBAA9B;AAAyCC,EAAAA,KAAK,EAAE;AAAhD,CADqB,EAErB;AAAEH,EAAAA,KAAK,EAAE,cAAI,QAAJ,CAAT;AAAyBC,EAAAA,IAAI,EAAEG,iBAA/B;AAA2CD,EAAAA,KAAK,EAAE;AAAlD,CAFqB,EAGrB;AAAEH,EAAAA,KAAK,EAAE,cAAI,QAAJ,CAAT;AAAyBC,EAAAA,IAAI,EAAEI,iBAA/B;AAA2CF,EAAAA,KAAK,EAAE;AAAlD,CAHqB,CAAtB;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACe,SAASG,kBAAT,OAAmD;AAAA,MAAtB;AAAEC,IAAAA,QAAF;AAAYJ,IAAAA;AAAZ,GAAsB;AACjE,SACC;AAAU,IAAA,SAAS,EAAC;AAApB,KACC,4CAAU,cAAI,OAAJ,CAAV,CADD,EAEC;AAAK,IAAA,SAAS,EAAC;AAAf,KACGJ,aAAa,CAACS,GAAd,CAAqBC,WAAF,IACpB,4BAAC,kBAAD;AACC,IAAA,GAAG,EAAGA,WAAW,CAACN,KADnB;AAEC,IAAA,IAAI,EAAGM,WAAW,CAACR,IAFpB;AAGC,IAAA,OAAO,MAHR;AAIC,IAAA,SAAS,EAAGQ,WAAW,CAACN,KAAZ,KAAsBA,KAJnC;AAKC,IAAA,OAAO,EAAG,MACTI,QAAQ,CACPE,WAAW,CAACN,KAAZ,KAAsBA,KAAtB,GACGO,SADH,GAEGD,WAAW,CAACN,KAHR,CANV;AAYC,kBAAaM,WAAW,CAACT;AAZ1B,IADC,CADH,CAFD,CADD;AAuBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Button } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { lineDashed, lineDotted, lineSolid } from '@wordpress/icons';\n\nconst BORDER_STYLES = [\n\t{ label: __( 'Solid' ), icon: lineSolid, value: 'solid' },\n\t{ label: __( 'Dashed' ), icon: lineDashed, value: 'dashed' },\n\t{ label: __( 'Dotted' ), icon: lineDotted, value: 'dotted' },\n];\n\n/**\n * Control to display border style options.\n *\n * @param {Object} props Component props.\n * @param {Function} props.onChange Handler for changing border style selection.\n * @param {string} props.value Currently selected border style value.\n *\n * @return {WPElement} Custom border style segmented control.\n */\nexport default function BorderStyleControl( { onChange, value } ) {\n\treturn (\n\t\t<fieldset className=\"components-border-style-control\">\n\t\t\t<legend>{ __( 'Style' ) }</legend>\n\t\t\t<div className=\"components-border-style-control__buttons\">\n\t\t\t\t{ BORDER_STYLES.map( ( borderStyle ) => (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tkey={ borderStyle.value }\n\t\t\t\t\t\ticon={ borderStyle.icon }\n\t\t\t\t\t\tisSmall\n\t\t\t\t\t\tisPressed={ borderStyle.value === value }\n\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\tonChange(\n\t\t\t\t\t\t\t\tborderStyle.value === value\n\t\t\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t\t\t: borderStyle.value\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\t\t\t\t\t\taria-label={ borderStyle.label }\n\t\t\t\t\t/>\n\t\t\t\t) ) }\n\t\t\t</div>\n\t\t</fieldset>\n\t);\n}\n"]}
@@ -1,93 +0,0 @@
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 = ListViewAppender;
9
-
10
- var _element = require("@wordpress/element");
11
-
12
- var _classnames = _interopRequireDefault(require("classnames"));
13
-
14
- var _components = require("@wordpress/components");
15
-
16
- var _compose = require("@wordpress/compose");
17
-
18
- var _i18n = require("@wordpress/i18n");
19
-
20
- var _data = require("@wordpress/data");
21
-
22
- var _leaf = _interopRequireDefault(require("./leaf"));
23
-
24
- var _inserter = _interopRequireDefault(require("../inserter"));
25
-
26
- var _store = require("../../store");
27
-
28
- /**
29
- * External dependencies
30
- */
31
-
32
- /**
33
- * WordPress dependencies
34
- */
35
-
36
- /**
37
- * Internal dependencies
38
- */
39
- function ListViewAppender(_ref) {
40
- let {
41
- parentBlockClientId,
42
- position,
43
- level,
44
- rowCount,
45
- path
46
- } = _ref;
47
- const isDragging = (0, _data.useSelect)(select => {
48
- const {
49
- isBlockBeingDragged,
50
- isAncestorBeingDragged
51
- } = select(_store.store);
52
- return isBlockBeingDragged(parentBlockClientId) || isAncestorBeingDragged(parentBlockClientId);
53
- }, [parentBlockClientId]);
54
- const instanceId = (0, _compose.useInstanceId)(ListViewAppender);
55
- const descriptionId = `list-view-appender-row__description_${instanceId}`;
56
- const appenderPositionDescription = (0, _i18n.sprintf)(
57
- /* translators: 1: The numerical position of the block that will be inserted. 2: The level of nesting for the block that will be inserted. */
58
- (0, _i18n.__)('Add block at position %1$d, Level %2$d'), position, level);
59
- return (0, _element.createElement)(_leaf.default, {
60
- className: (0, _classnames.default)({
61
- 'is-dragging': isDragging
62
- }),
63
- level: level,
64
- position: position,
65
- rowCount: rowCount,
66
- path: path
67
- }, (0, _element.createElement)(_components.__experimentalTreeGridCell, {
68
- className: "block-editor-list-view-appender__cell",
69
- colSpan: "3"
70
- }, _ref2 => {
71
- let {
72
- ref,
73
- tabIndex,
74
- onFocus
75
- } = _ref2;
76
- return (0, _element.createElement)("div", {
77
- className: "block-editor-list-view-appender__container"
78
- }, (0, _element.createElement)(_inserter.default, {
79
- rootClientId: parentBlockClientId,
80
- __experimentalIsQuick: true,
81
- "aria-describedby": descriptionId,
82
- toggleProps: {
83
- ref,
84
- tabIndex,
85
- onFocus
86
- }
87
- }), (0, _element.createElement)("div", {
88
- className: "block-editor-list-view-appender__description",
89
- id: descriptionId
90
- }, appenderPositionDescription));
91
- }));
92
- }
93
- //# sourceMappingURL=appender.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/list-view/appender.js"],"names":["ListViewAppender","parentBlockClientId","position","level","rowCount","path","isDragging","select","isBlockBeingDragged","isAncestorBeingDragged","blockEditorStore","instanceId","descriptionId","appenderPositionDescription","ref","tabIndex","onFocus"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AAlBA;AACA;AACA;;AAGA;AACA;AACA;;AAMA;AACA;AACA;AAKe,SAASA,gBAAT,OAMX;AAAA,MANsC;AACzCC,IAAAA,mBADyC;AAEzCC,IAAAA,QAFyC;AAGzCC,IAAAA,KAHyC;AAIzCC,IAAAA,QAJyC;AAKzCC,IAAAA;AALyC,GAMtC;AACH,QAAMC,UAAU,GAAG,qBAChBC,MAAF,IAAc;AACb,UAAM;AAAEC,MAAAA,mBAAF;AAAuBC,MAAAA;AAAvB,QAAkDF,MAAM,CAC7DG,YAD6D,CAA9D;AAIA,WACCF,mBAAmB,CAAEP,mBAAF,CAAnB,IACAQ,sBAAsB,CAAER,mBAAF,CAFvB;AAIA,GAViB,EAWlB,CAAEA,mBAAF,CAXkB,CAAnB;AAaA,QAAMU,UAAU,GAAG,4BAAeX,gBAAf,CAAnB;AACA,QAAMY,aAAa,GAAI,uCAAuCD,UAAY,EAA1E;AAEA,QAAME,2BAA2B,GAAG;AACnC;AACA,gBAAI,wCAAJ,CAFmC,EAGnCX,QAHmC,EAInCC,KAJmC,CAApC;AAOA,SACC,4BAAC,aAAD;AACC,IAAA,SAAS,EAAG,yBAAY;AAAE,qBAAeG;AAAjB,KAAZ,CADb;AAEC,IAAA,KAAK,EAAGH,KAFT;AAGC,IAAA,QAAQ,EAAGD,QAHZ;AAIC,IAAA,QAAQ,EAAGE,QAJZ;AAKC,IAAA,IAAI,EAAGC;AALR,KAOC,4BAAC,sCAAD;AACC,IAAA,SAAS,EAAC,uCADX;AAEC,IAAA,OAAO,EAAC;AAFT,KAIG;AAAA,QAAE;AAAES,MAAAA,GAAF;AAAOC,MAAAA,QAAP;AAAiBC,MAAAA;AAAjB,KAAF;AAAA,WACD;AAAK,MAAA,SAAS,EAAC;AAAf,OACC,4BAAC,iBAAD;AACC,MAAA,YAAY,EAAGf,mBADhB;AAEC,MAAA,qBAAqB,MAFtB;AAGC,0BAAmBW,aAHpB;AAIC,MAAA,WAAW,EAAG;AAAEE,QAAAA,GAAF;AAAOC,QAAAA,QAAP;AAAiBC,QAAAA;AAAjB;AAJf,MADD,EAOC;AACC,MAAA,SAAS,EAAC,8CADX;AAEC,MAAA,EAAE,EAAGJ;AAFN,OAIGC,2BAJH,CAPD,CADC;AAAA,GAJH,CAPD,CADD;AA+BA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { __experimentalTreeGridCell as TreeGridCell } from '@wordpress/components';\nimport { useInstanceId } from '@wordpress/compose';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport ListViewLeaf from './leaf';\nimport Inserter from '../inserter';\nimport { store as blockEditorStore } from '../../store';\n\nexport default function ListViewAppender( {\n\tparentBlockClientId,\n\tposition,\n\tlevel,\n\trowCount,\n\tpath,\n} ) {\n\tconst isDragging = useSelect(\n\t\t( select ) => {\n\t\t\tconst { isBlockBeingDragged, isAncestorBeingDragged } = select(\n\t\t\t\tblockEditorStore\n\t\t\t);\n\n\t\t\treturn (\n\t\t\t\tisBlockBeingDragged( parentBlockClientId ) ||\n\t\t\t\tisAncestorBeingDragged( parentBlockClientId )\n\t\t\t);\n\t\t},\n\t\t[ parentBlockClientId ]\n\t);\n\tconst instanceId = useInstanceId( ListViewAppender );\n\tconst descriptionId = `list-view-appender-row__description_${ instanceId }`;\n\n\tconst appenderPositionDescription = sprintf(\n\t\t/* translators: 1: The numerical position of the block that will be inserted. 2: The level of nesting for the block that will be inserted. */\n\t\t__( 'Add block at position %1$d, Level %2$d' ),\n\t\tposition,\n\t\tlevel\n\t);\n\n\treturn (\n\t\t<ListViewLeaf\n\t\t\tclassName={ classnames( { 'is-dragging': isDragging } ) }\n\t\t\tlevel={ level }\n\t\t\tposition={ position }\n\t\t\trowCount={ rowCount }\n\t\t\tpath={ path }\n\t\t>\n\t\t\t<TreeGridCell\n\t\t\t\tclassName=\"block-editor-list-view-appender__cell\"\n\t\t\t\tcolSpan=\"3\"\n\t\t\t>\n\t\t\t\t{ ( { ref, tabIndex, onFocus } ) => (\n\t\t\t\t\t<div className=\"block-editor-list-view-appender__container\">\n\t\t\t\t\t\t<Inserter\n\t\t\t\t\t\t\trootClientId={ parentBlockClientId }\n\t\t\t\t\t\t\t__experimentalIsQuick\n\t\t\t\t\t\t\taria-describedby={ descriptionId }\n\t\t\t\t\t\t\ttoggleProps={ { ref, tabIndex, onFocus } }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclassName=\"block-editor-list-view-appender__description\"\n\t\t\t\t\t\t\tid={ descriptionId }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ appenderPositionDescription }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t</TreeGridCell>\n\t\t</ListViewLeaf>\n\t);\n}\n"]}