@wordpress/block-editor 12.15.0 → 12.16.1-next.79a6196f.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 (927) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/LICENSE.md +1 -1
  3. package/README.md +12 -10
  4. package/build/components/block-canvas/index.js +21 -7
  5. package/build/components/block-canvas/index.js.map +1 -1
  6. package/build/components/block-card/index.js +2 -2
  7. package/build/components/block-card/index.js.map +1 -1
  8. package/build/components/block-controls/hook.js +3 -23
  9. package/build/components/block-controls/hook.js.map +1 -1
  10. package/build/components/block-draggable/draggable-chip.js +6 -1
  11. package/build/components/block-draggable/draggable-chip.js.map +1 -1
  12. package/build/components/block-draggable/index.js +76 -6
  13. package/build/components/block-draggable/index.js.map +1 -1
  14. package/build/components/block-draggable/index.native.js +0 -6
  15. package/build/components/block-draggable/index.native.js.map +1 -1
  16. package/build/components/block-draggable/use-scroll-when-dragging.native.js +1 -1
  17. package/build/components/block-draggable/use-scroll-when-dragging.native.js.map +1 -1
  18. package/build/components/block-edit/context.js +5 -1
  19. package/build/components/block-edit/context.js.map +1 -1
  20. package/build/components/block-edit/index.js +18 -9
  21. package/build/components/block-edit/index.js.map +1 -1
  22. package/build/components/block-editing-mode/index.js +2 -3
  23. package/build/components/block-editing-mode/index.js.map +1 -1
  24. package/build/components/block-info-slot-fill/index.js +3 -4
  25. package/build/components/block-info-slot-fill/index.js.map +1 -1
  26. package/build/components/block-inspector/index.js +1 -1
  27. package/build/components/block-inspector/index.js.map +1 -1
  28. package/build/components/block-list/block-list-item-cell.native.js +1 -0
  29. package/build/components/block-list/block-list-item-cell.native.js.map +1 -1
  30. package/build/components/block-list/block.js +257 -95
  31. package/build/components/block-list/block.js.map +1 -1
  32. package/build/components/block-list/block.native.js +58 -23
  33. package/build/components/block-list/block.native.js.map +1 -1
  34. package/build/components/block-list/index.native.js +3 -5
  35. package/build/components/block-list/index.native.js.map +1 -1
  36. package/build/components/block-list/private-block-context.js +14 -0
  37. package/build/components/block-list/private-block-context.js.map +1 -0
  38. package/build/components/block-list/use-block-props/index.js +49 -69
  39. package/build/components/block-list/use-block-props/index.js.map +1 -1
  40. package/build/components/block-list/use-block-props/use-focus-first-element.js +4 -29
  41. package/build/components/block-list/use-block-props/use-focus-first-element.js.map +1 -1
  42. package/build/components/block-list/use-block-props/use-is-hovered.js +4 -14
  43. package/build/components/block-list/use-block-props/use-is-hovered.js.map +1 -1
  44. package/build/components/block-list/use-block-props/use-selected-block-event-handlers.js +4 -2
  45. package/build/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +1 -1
  46. package/build/components/block-list/use-in-between-inserter.js +3 -2
  47. package/build/components/block-list/use-in-between-inserter.js.map +1 -1
  48. package/build/components/block-list/use-scroll-upon-insertion.native.js +41 -0
  49. package/build/components/block-list/use-scroll-upon-insertion.native.js.map +1 -0
  50. package/build/components/block-lock/toolbar.js +21 -27
  51. package/build/components/block-lock/toolbar.js.map +1 -1
  52. package/build/components/block-mover/index.js +2 -1
  53. package/build/components/block-mover/index.js.map +1 -1
  54. package/build/components/block-patterns-list/index.js +5 -5
  55. package/build/components/block-patterns-list/index.js.map +1 -1
  56. package/build/components/block-removal-warning-modal/index.js +2 -9
  57. package/build/components/block-removal-warning-modal/index.js.map +1 -1
  58. package/build/components/block-rename/modal.js +3 -0
  59. package/build/components/block-rename/modal.js.map +1 -1
  60. package/build/components/block-settings/container.native.js +6 -4
  61. package/build/components/block-settings/container.native.js.map +1 -1
  62. package/build/components/block-styles/index.js +1 -1
  63. package/build/components/block-styles/index.js.map +1 -1
  64. package/build/components/block-styles/index.native.js +3 -2
  65. package/build/components/block-styles/index.native.js.map +1 -1
  66. package/build/components/block-switcher/index.js +4 -4
  67. package/build/components/block-switcher/index.js.map +1 -1
  68. package/build/components/block-toolbar/index.js +90 -29
  69. package/build/components/block-toolbar/index.js.map +1 -1
  70. package/build/components/block-tools/block-toolbar-breadcrumb.js +49 -0
  71. package/build/components/block-tools/block-toolbar-breadcrumb.js.map +1 -0
  72. package/build/components/block-tools/block-toolbar-popover.js +84 -0
  73. package/build/components/block-tools/block-toolbar-popover.js.map +1 -0
  74. package/build/components/block-tools/index.js +27 -24
  75. package/build/components/block-tools/index.js.map +1 -1
  76. package/build/components/block-types-list/index.native.js +4 -3
  77. package/build/components/block-types-list/index.native.js.map +1 -1
  78. package/build/components/block-variation-picker/index.native.js +2 -1
  79. package/build/components/block-variation-picker/index.native.js.map +1 -1
  80. package/build/components/block-variation-transforms/index.js +29 -2
  81. package/build/components/block-variation-transforms/index.js.map +1 -1
  82. package/build/components/border-radius-control/linked-button.js +1 -1
  83. package/build/components/border-radius-control/linked-button.js.map +1 -1
  84. package/build/components/colors/utils.js +10 -2
  85. package/build/components/colors/utils.js.map +1 -1
  86. package/build/components/colors/with-colors.js +6 -2
  87. package/build/components/colors/with-colors.js.map +1 -1
  88. package/build/components/colors-gradients/control.js +28 -17
  89. package/build/components/colors-gradients/control.js.map +1 -1
  90. package/build/components/duotone-control/index.js +1 -4
  91. package/build/components/duotone-control/index.js.map +1 -1
  92. package/build/components/font-sizes/utils.js +10 -2
  93. package/build/components/font-sizes/utils.js.map +1 -1
  94. package/build/components/global-styles/border-panel.js +2 -1
  95. package/build/components/global-styles/border-panel.js.map +1 -1
  96. package/build/components/global-styles/color-panel.js +24 -21
  97. package/build/components/global-styles/color-panel.js.map +1 -1
  98. package/build/components/global-styles/dimensions-panel.js +4 -3
  99. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  100. package/build/components/global-styles/effects-panel.js +2 -1
  101. package/build/components/global-styles/effects-panel.js.map +1 -1
  102. package/build/components/global-styles/filters-panel.js +6 -3
  103. package/build/components/global-styles/filters-panel.js.map +1 -1
  104. package/build/components/global-styles/get-global-styles-changes.js +192 -0
  105. package/build/components/global-styles/get-global-styles-changes.js.map +1 -0
  106. package/build/components/global-styles/hooks.js +3 -2
  107. package/build/components/global-styles/hooks.js.map +1 -1
  108. package/build/components/global-styles/image-settings-panel.js +7 -1
  109. package/build/components/global-styles/image-settings-panel.js.map +1 -1
  110. package/build/components/global-styles/index.js +7 -0
  111. package/build/components/global-styles/index.js.map +1 -1
  112. package/build/components/global-styles/typography-panel.js +43 -36
  113. package/build/components/global-styles/typography-panel.js.map +1 -1
  114. package/build/components/global-styles/use-global-styles-output.js +22 -8
  115. package/build/components/global-styles/use-global-styles-output.js.map +1 -1
  116. package/build/components/global-styles/utils.js +8 -1
  117. package/build/components/global-styles/utils.js.map +1 -1
  118. package/build/components/height-control/index.js +6 -2
  119. package/build/components/height-control/index.js.map +1 -1
  120. package/build/components/image-link-destinations/index.native.js +118 -0
  121. package/build/components/image-link-destinations/index.native.js.map +1 -0
  122. package/build/components/image-size-control/index.js +2 -2
  123. package/build/components/image-size-control/index.js.map +1 -1
  124. package/build/components/index.native.js +14 -5
  125. package/build/components/index.native.js.map +1 -1
  126. package/build/components/inner-blocks/index.js +61 -22
  127. package/build/components/inner-blocks/index.js.map +1 -1
  128. package/build/components/inner-blocks/index.native.js +18 -4
  129. package/build/components/inner-blocks/index.native.js.map +1 -1
  130. package/build/components/inner-blocks/use-inner-block-template-sync.js +5 -6
  131. package/build/components/inner-blocks/use-inner-block-template-sync.js.map +1 -1
  132. package/build/components/inner-blocks/use-nested-settings-update.js +5 -9
  133. package/build/components/inner-blocks/use-nested-settings-update.js.map +1 -1
  134. package/build/components/inserter/block-patterns-explorer/pattern-list.js +1 -1
  135. package/build/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
  136. package/build/components/inserter/block-patterns-tab/pattern-category-previews.js +10 -9
  137. package/build/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
  138. package/build/components/inserter/block-patterns-tab/patterns-filter.js +10 -10
  139. package/build/components/inserter/block-patterns-tab/patterns-filter.js.map +1 -1
  140. package/build/components/inserter/block-patterns-tab/use-pattern-categories.js +9 -9
  141. package/build/components/inserter/block-patterns-tab/use-pattern-categories.js.map +1 -1
  142. package/build/components/inserter/block-patterns-tab/utils.js +10 -14
  143. package/build/components/inserter/block-patterns-tab/utils.js.map +1 -1
  144. package/build/components/inserter/hooks/use-block-types-state.js +4 -14
  145. package/build/components/inserter/hooks/use-block-types-state.js.map +1 -1
  146. package/build/components/inserter/hooks/use-patterns-state.js +1 -1
  147. package/build/components/inserter/hooks/use-patterns-state.js.map +1 -1
  148. package/build/components/inserter/index.js +1 -2
  149. package/build/components/inserter/index.js.map +1 -1
  150. package/build/components/inserter/library.js +3 -7
  151. package/build/components/inserter/library.js.map +1 -1
  152. package/build/components/inserter/media-tab/media-panel.js +2 -2
  153. package/build/components/inserter/media-tab/media-panel.js.map +1 -1
  154. package/build/components/inserter/menu.js +26 -33
  155. package/build/components/inserter/menu.js.map +1 -1
  156. package/build/components/inserter/preview-panel.js +2 -2
  157. package/build/components/inserter/preview-panel.js.map +1 -1
  158. package/build/components/inserter/tabs.js +21 -21
  159. package/build/components/inserter/tabs.js.map +1 -1
  160. package/build/components/inserter-button/index.native.js +98 -0
  161. package/build/components/inserter-button/index.native.js.map +1 -0
  162. package/build/components/inserter-button/sparkles.js +23 -0
  163. package/build/components/inserter-button/sparkles.js.map +1 -0
  164. package/build/components/inserter-draggable-blocks/index.js +8 -4
  165. package/build/components/inserter-draggable-blocks/index.js.map +1 -1
  166. package/build/components/inserter-list-item/index.js +2 -4
  167. package/build/components/inserter-list-item/index.js.map +1 -1
  168. package/build/components/inspector-controls/block-support-tools-panel.js +3 -1
  169. package/build/components/inspector-controls/block-support-tools-panel.js.map +1 -1
  170. package/build/components/inspector-controls/fill.js +3 -3
  171. package/build/components/inspector-controls/fill.js.map +1 -1
  172. package/build/components/inspector-controls/fill.native.js +3 -3
  173. package/build/components/inspector-controls/fill.native.js.map +1 -1
  174. package/build/components/inspector-controls-tabs/index.js +34 -23
  175. package/build/components/inspector-controls-tabs/index.js.map +1 -1
  176. package/build/components/list-view/block-select-button.js +4 -0
  177. package/build/components/list-view/block-select-button.js.map +1 -1
  178. package/build/components/list-view/block.js +57 -3
  179. package/build/components/list-view/block.js.map +1 -1
  180. package/build/components/media-upload-progress/constants.js +19 -0
  181. package/build/components/media-upload-progress/constants.js.map +1 -0
  182. package/build/components/media-upload-progress/index.native.js +42 -17
  183. package/build/components/media-upload-progress/index.native.js.map +1 -1
  184. package/build/components/navigable-toolbar/index.js +11 -16
  185. package/build/components/navigable-toolbar/index.js.map +1 -1
  186. package/build/components/plain-text/index.native.js +8 -3
  187. package/build/components/plain-text/index.native.js.map +1 -1
  188. package/build/components/preview-options/index.js +6 -62
  189. package/build/components/preview-options/index.js.map +1 -1
  190. package/build/components/provider/index.js +3 -1
  191. package/build/components/provider/index.js.map +1 -1
  192. package/build/components/provider/use-block-sync.js +7 -1
  193. package/build/components/provider/use-block-sync.js.map +1 -1
  194. package/build/components/rich-text/content.js +26 -23
  195. package/build/components/rich-text/content.js.map +1 -1
  196. package/build/components/rich-text/get-rich-text-values.js +2 -1
  197. package/build/components/rich-text/get-rich-text-values.js.map +1 -1
  198. package/build/components/rich-text/index.js +19 -37
  199. package/build/components/rich-text/index.js.map +1 -1
  200. package/build/components/rich-text/index.native.js +9 -16
  201. package/build/components/rich-text/index.native.js.map +1 -1
  202. package/build/components/rich-text/native/get-format-colors.native.js +22 -24
  203. package/build/components/rich-text/native/get-format-colors.native.js.map +1 -1
  204. package/build/components/rich-text/native/index.native.js +22 -57
  205. package/build/components/rich-text/native/index.native.js.map +1 -1
  206. package/build/components/rich-text/use-input-rules.js +7 -3
  207. package/build/components/rich-text/use-input-rules.js.map +1 -1
  208. package/build/components/rich-text/use-mark-persistent.js +1 -1
  209. package/build/components/rich-text/use-mark-persistent.js.map +1 -1
  210. package/build/components/rich-text/with-deprecations.js +50 -0
  211. package/build/components/rich-text/with-deprecations.js.map +1 -0
  212. package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js +1 -1
  213. package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
  214. package/build/components/url-input/index.js +9 -6
  215. package/build/components/url-input/index.js.map +1 -1
  216. package/build/components/use-block-commands/index.js +14 -18
  217. package/build/components/use-block-commands/index.js.map +1 -1
  218. package/build/components/use-block-drop-zone/index.js +108 -17
  219. package/build/components/use-block-drop-zone/index.js.map +1 -1
  220. package/build/components/use-moving-animation/index.js +100 -92
  221. package/build/components/use-moving-animation/index.js.map +1 -1
  222. package/build/components/use-on-block-drop/index.js +9 -12
  223. package/build/components/use-on-block-drop/index.js.map +1 -1
  224. package/build/components/use-resize-canvas/index.js +4 -1
  225. package/build/components/use-resize-canvas/index.js.map +1 -1
  226. package/build/components/use-settings/index.js +14 -0
  227. package/build/components/use-settings/index.js.map +1 -1
  228. package/build/components/writing-flow/index.js +0 -1
  229. package/build/components/writing-flow/index.js.map +1 -1
  230. package/build/components/writing-flow/use-drag-selection.js +15 -4
  231. package/build/components/writing-flow/use-drag-selection.js.map +1 -1
  232. package/build/components/writing-flow/use-selection-observer.js +73 -27
  233. package/build/components/writing-flow/use-selection-observer.js.map +1 -1
  234. package/build/components/writing-flow/use-tab-nav.js +7 -4
  235. package/build/components/writing-flow/use-tab-nav.js.map +1 -1
  236. package/build/hooks/align.js +21 -69
  237. package/build/hooks/align.js.map +1 -1
  238. package/build/hooks/align.native.js +11 -1
  239. package/build/hooks/align.native.js.map +1 -1
  240. package/build/hooks/anchor.js +14 -30
  241. package/build/hooks/anchor.js.map +1 -1
  242. package/build/hooks/aria-label.js +9 -1
  243. package/build/hooks/aria-label.js.map +1 -1
  244. package/build/hooks/background.js +198 -36
  245. package/build/hooks/background.js.map +1 -1
  246. package/build/hooks/block-hooks.js +24 -32
  247. package/build/hooks/block-hooks.js.map +1 -1
  248. package/build/hooks/block-renaming.js +18 -22
  249. package/build/hooks/block-renaming.js.map +1 -1
  250. package/build/hooks/border.js +53 -80
  251. package/build/hooks/border.js.map +1 -1
  252. package/build/hooks/color.js +79 -90
  253. package/build/hooks/color.js.map +1 -1
  254. package/build/hooks/content-lock-ui.js +29 -29
  255. package/build/hooks/content-lock-ui.js.map +1 -1
  256. package/build/hooks/custom-class-name.js +13 -30
  257. package/build/hooks/custom-class-name.js.map +1 -1
  258. package/build/hooks/custom-class-name.native.js +9 -1
  259. package/build/hooks/custom-class-name.native.js.map +1 -1
  260. package/build/hooks/dimensions.js +13 -14
  261. package/build/hooks/dimensions.js.map +1 -1
  262. package/build/hooks/duotone.js +31 -61
  263. package/build/hooks/duotone.js.map +1 -1
  264. package/build/hooks/font-family.js +23 -28
  265. package/build/hooks/font-family.js.map +1 -1
  266. package/build/hooks/font-size.js +52 -120
  267. package/build/hooks/font-size.js.map +1 -1
  268. package/build/hooks/index.js +27 -16
  269. package/build/hooks/index.js.map +1 -1
  270. package/build/hooks/index.native.js +15 -6
  271. package/build/hooks/index.native.js.map +1 -1
  272. package/build/hooks/layout-child.js +68 -0
  273. package/build/hooks/layout-child.js.map +1 -0
  274. package/build/hooks/layout.js +25 -104
  275. package/build/hooks/layout.js.map +1 -1
  276. package/build/hooks/padding.js +2 -2
  277. package/build/hooks/padding.js.map +1 -1
  278. package/build/hooks/position.js +40 -62
  279. package/build/hooks/position.js.map +1 -1
  280. package/build/hooks/style.js +52 -89
  281. package/build/hooks/style.js.map +1 -1
  282. package/build/hooks/typography.js +25 -10
  283. package/build/hooks/typography.js.map +1 -1
  284. package/build/hooks/typography.native.js +43 -18
  285. package/build/hooks/typography.native.js.map +1 -1
  286. package/build/hooks/use-typography-props.js +10 -2
  287. package/build/hooks/use-typography-props.js.map +1 -1
  288. package/build/hooks/utils.js +200 -10
  289. package/build/hooks/utils.js.map +1 -1
  290. package/build/private-apis.js +2 -6
  291. package/build/private-apis.js.map +1 -1
  292. package/build/private-apis.native.js +0 -2
  293. package/build/private-apis.native.js.map +1 -1
  294. package/build/store/actions.js +0 -16
  295. package/build/store/actions.js.map +1 -1
  296. package/build/store/private-actions.js +54 -0
  297. package/build/store/private-actions.js.map +1 -1
  298. package/build/store/private-selectors.js +46 -0
  299. package/build/store/private-selectors.js.map +1 -1
  300. package/build/store/reducer.js +18 -2
  301. package/build/store/reducer.js.map +1 -1
  302. package/build/store/selectors.js +11 -73
  303. package/build/store/selectors.js.map +1 -1
  304. package/build/store/undo-ignore.js +12 -0
  305. package/build/store/undo-ignore.js.map +1 -0
  306. package/build/store/utils.js +66 -0
  307. package/build/store/utils.js.map +1 -0
  308. package/build/utils/get-px-from-css-unit.js +16 -0
  309. package/build/utils/get-px-from-css-unit.js.map +1 -0
  310. package/build/utils/index.js +2 -2
  311. package/build/utils/index.js.map +1 -1
  312. package/build/utils/object.js +38 -99
  313. package/build/utils/object.js.map +1 -1
  314. package/build/utils/selection.js +9 -1
  315. package/build/utils/selection.js.map +1 -1
  316. package/build/utils/use-can-block-toolbar-be-focused.js +46 -0
  317. package/build/utils/use-can-block-toolbar-be-focused.js.map +1 -0
  318. package/build-module/components/block-canvas/index.js +22 -8
  319. package/build-module/components/block-canvas/index.js.map +1 -1
  320. package/build-module/components/block-card/index.js +2 -2
  321. package/build-module/components/block-card/index.js.map +1 -1
  322. package/build-module/components/block-controls/hook.js +4 -24
  323. package/build-module/components/block-controls/hook.js.map +1 -1
  324. package/build-module/components/block-draggable/draggable-chip.js +6 -1
  325. package/build-module/components/block-draggable/draggable-chip.js.map +1 -1
  326. package/build-module/components/block-draggable/index.js +76 -6
  327. package/build-module/components/block-draggable/index.js.map +1 -1
  328. package/build-module/components/block-draggable/index.native.js +1 -7
  329. package/build-module/components/block-draggable/index.native.js.map +1 -1
  330. package/build-module/components/block-draggable/use-scroll-when-dragging.native.js +1 -1
  331. package/build-module/components/block-draggable/use-scroll-when-dragging.native.js.map +1 -1
  332. package/build-module/components/block-edit/context.js +2 -0
  333. package/build-module/components/block-edit/context.js.map +1 -1
  334. package/build-module/components/block-edit/index.js +19 -10
  335. package/build-module/components/block-edit/index.js.map +1 -1
  336. package/build-module/components/block-editing-mode/index.js +3 -4
  337. package/build-module/components/block-editing-mode/index.js.map +1 -1
  338. package/build-module/components/block-info-slot-fill/index.js +3 -3
  339. package/build-module/components/block-info-slot-fill/index.js.map +1 -1
  340. package/build-module/components/block-inspector/index.js +1 -1
  341. package/build-module/components/block-inspector/index.js.map +1 -1
  342. package/build-module/components/block-list/block-list-item-cell.native.js +1 -0
  343. package/build-module/components/block-list/block-list-item-cell.native.js.map +1 -1
  344. package/build-module/components/block-list/block.js +261 -99
  345. package/build-module/components/block-list/block.js.map +1 -1
  346. package/build-module/components/block-list/block.native.js +60 -25
  347. package/build-module/components/block-list/block.native.js.map +1 -1
  348. package/build-module/components/block-list/index.native.js +3 -5
  349. package/build-module/components/block-list/index.native.js.map +1 -1
  350. package/build-module/components/block-list/private-block-context.js +6 -0
  351. package/build-module/components/block-list/private-block-context.js.map +1 -0
  352. package/build-module/components/block-list/use-block-props/index.js +50 -70
  353. package/build-module/components/block-list/use-block-props/index.js.map +1 -1
  354. package/build-module/components/block-list/use-block-props/use-focus-first-element.js +4 -29
  355. package/build-module/components/block-list/use-block-props/use-focus-first-element.js.map +1 -1
  356. package/build-module/components/block-list/use-block-props/use-is-hovered.js +4 -14
  357. package/build-module/components/block-list/use-block-props/use-is-hovered.js.map +1 -1
  358. package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js +4 -2
  359. package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +1 -1
  360. package/build-module/components/block-list/use-in-between-inserter.js +3 -2
  361. package/build-module/components/block-list/use-in-between-inserter.js.map +1 -1
  362. package/build-module/components/block-list/use-scroll-upon-insertion.native.js +33 -0
  363. package/build-module/components/block-list/use-scroll-upon-insertion.native.js.map +1 -0
  364. package/build-module/components/block-lock/toolbar.js +22 -28
  365. package/build-module/components/block-lock/toolbar.js.map +1 -1
  366. package/build-module/components/block-mover/index.js +2 -1
  367. package/build-module/components/block-mover/index.js.map +1 -1
  368. package/build-module/components/block-patterns-list/index.js +6 -6
  369. package/build-module/components/block-patterns-list/index.js.map +1 -1
  370. package/build-module/components/block-removal-warning-modal/index.js +3 -10
  371. package/build-module/components/block-removal-warning-modal/index.js.map +1 -1
  372. package/build-module/components/block-rename/modal.js +3 -0
  373. package/build-module/components/block-rename/modal.js.map +1 -1
  374. package/build-module/components/block-settings/container.native.js +4 -2
  375. package/build-module/components/block-settings/container.native.js.map +1 -1
  376. package/build-module/components/block-styles/index.js +1 -1
  377. package/build-module/components/block-styles/index.js.map +1 -1
  378. package/build-module/components/block-styles/index.native.js +3 -2
  379. package/build-module/components/block-styles/index.native.js.map +1 -1
  380. package/build-module/components/block-switcher/index.js +4 -4
  381. package/build-module/components/block-switcher/index.js.map +1 -1
  382. package/build-module/components/block-toolbar/index.js +89 -27
  383. package/build-module/components/block-toolbar/index.js.map +1 -1
  384. package/build-module/components/block-tools/block-toolbar-breadcrumb.js +41 -0
  385. package/build-module/components/block-tools/block-toolbar-breadcrumb.js.map +1 -0
  386. package/build-module/components/block-tools/block-toolbar-popover.js +74 -0
  387. package/build-module/components/block-tools/block-toolbar-popover.js.map +1 -0
  388. package/build-module/components/block-tools/index.js +27 -24
  389. package/build-module/components/block-tools/index.js.map +1 -1
  390. package/build-module/components/block-types-list/index.native.js +2 -1
  391. package/build-module/components/block-types-list/index.native.js.map +1 -1
  392. package/build-module/components/block-variation-picker/index.native.js +2 -1
  393. package/build-module/components/block-variation-picker/index.native.js.map +1 -1
  394. package/build-module/components/block-variation-transforms/index.js +30 -3
  395. package/build-module/components/block-variation-transforms/index.js.map +1 -1
  396. package/build-module/components/border-radius-control/linked-button.js +1 -1
  397. package/build-module/components/border-radius-control/linked-button.js.map +1 -1
  398. package/build-module/components/colors/utils.js +9 -1
  399. package/build-module/components/colors/utils.js.map +1 -1
  400. package/build-module/components/colors/with-colors.js +5 -1
  401. package/build-module/components/colors/with-colors.js.map +1 -1
  402. package/build-module/components/colors-gradients/control.js +29 -18
  403. package/build-module/components/colors-gradients/control.js.map +1 -1
  404. package/build-module/components/duotone-control/index.js +1 -4
  405. package/build-module/components/duotone-control/index.js.map +1 -1
  406. package/build-module/components/font-sizes/utils.js +9 -1
  407. package/build-module/components/font-sizes/utils.js.map +1 -1
  408. package/build-module/components/global-styles/border-panel.js +3 -2
  409. package/build-module/components/global-styles/border-panel.js.map +1 -1
  410. package/build-module/components/global-styles/color-panel.js +26 -23
  411. package/build-module/components/global-styles/color-panel.js.map +1 -1
  412. package/build-module/components/global-styles/dimensions-panel.js +5 -4
  413. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  414. package/build-module/components/global-styles/effects-panel.js +3 -2
  415. package/build-module/components/global-styles/effects-panel.js.map +1 -1
  416. package/build-module/components/global-styles/filters-panel.js +8 -5
  417. package/build-module/components/global-styles/filters-panel.js.map +1 -1
  418. package/build-module/components/global-styles/get-global-styles-changes.js +184 -0
  419. package/build-module/components/global-styles/get-global-styles-changes.js.map +1 -0
  420. package/build-module/components/global-styles/hooks.js +3 -2
  421. package/build-module/components/global-styles/hooks.js.map +1 -1
  422. package/build-module/components/global-styles/image-settings-panel.js +7 -1
  423. package/build-module/components/global-styles/image-settings-panel.js.map +1 -1
  424. package/build-module/components/global-styles/index.js +1 -0
  425. package/build-module/components/global-styles/index.js.map +1 -1
  426. package/build-module/components/global-styles/typography-panel.js +45 -38
  427. package/build-module/components/global-styles/typography-panel.js.map +1 -1
  428. package/build-module/components/global-styles/use-global-styles-output.js +15 -1
  429. package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
  430. package/build-module/components/global-styles/utils.js +7 -0
  431. package/build-module/components/global-styles/utils.js.map +1 -1
  432. package/build-module/components/height-control/index.js +6 -2
  433. package/build-module/components/height-control/index.js.map +1 -1
  434. package/build-module/components/image-link-destinations/index.native.js +109 -0
  435. package/build-module/components/image-link-destinations/index.native.js.map +1 -0
  436. package/build-module/components/image-size-control/index.js +2 -2
  437. package/build-module/components/image-size-control/index.js.map +1 -1
  438. package/build-module/components/index.native.js +3 -1
  439. package/build-module/components/index.native.js.map +1 -1
  440. package/build-module/components/inner-blocks/index.js +62 -23
  441. package/build-module/components/inner-blocks/index.js.map +1 -1
  442. package/build-module/components/inner-blocks/index.native.js +18 -4
  443. package/build-module/components/inner-blocks/index.native.js.map +1 -1
  444. package/build-module/components/inner-blocks/use-inner-block-template-sync.js +5 -6
  445. package/build-module/components/inner-blocks/use-inner-block-template-sync.js.map +1 -1
  446. package/build-module/components/inner-blocks/use-nested-settings-update.js +6 -10
  447. package/build-module/components/inner-blocks/use-nested-settings-update.js.map +1 -1
  448. package/build-module/components/inserter/block-patterns-explorer/pattern-list.js +2 -2
  449. package/build-module/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
  450. package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js +11 -10
  451. package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
  452. package/build-module/components/inserter/block-patterns-tab/patterns-filter.js +11 -11
  453. package/build-module/components/inserter/block-patterns-tab/patterns-filter.js.map +1 -1
  454. package/build-module/components/inserter/block-patterns-tab/use-pattern-categories.js +11 -11
  455. package/build-module/components/inserter/block-patterns-tab/use-pattern-categories.js.map +1 -1
  456. package/build-module/components/inserter/block-patterns-tab/utils.js +7 -11
  457. package/build-module/components/inserter/block-patterns-tab/utils.js.map +1 -1
  458. package/build-module/components/inserter/hooks/use-block-types-state.js +4 -14
  459. package/build-module/components/inserter/hooks/use-block-types-state.js.map +1 -1
  460. package/build-module/components/inserter/hooks/use-patterns-state.js +2 -2
  461. package/build-module/components/inserter/hooks/use-patterns-state.js.map +1 -1
  462. package/build-module/components/inserter/index.js +1 -2
  463. package/build-module/components/inserter/index.js.map +1 -1
  464. package/build-module/components/inserter/library.js +3 -7
  465. package/build-module/components/inserter/library.js.map +1 -1
  466. package/build-module/components/inserter/media-tab/media-panel.js +1 -1
  467. package/build-module/components/inserter/media-tab/media-panel.js.map +1 -1
  468. package/build-module/components/inserter/menu.js +26 -33
  469. package/build-module/components/inserter/menu.js.map +1 -1
  470. package/build-module/components/inserter/preview-panel.js +2 -2
  471. package/build-module/components/inserter/preview-panel.js.map +1 -1
  472. package/build-module/components/inserter/tabs.js +22 -22
  473. package/build-module/components/inserter/tabs.js.map +1 -1
  474. package/build-module/components/inserter-button/index.native.js +89 -0
  475. package/build-module/components/inserter-button/index.native.js.map +1 -0
  476. package/build-module/components/inserter-button/sparkles.js +15 -0
  477. package/build-module/components/inserter-button/sparkles.js.map +1 -0
  478. package/build-module/components/inserter-draggable-blocks/index.js +9 -5
  479. package/build-module/components/inserter-draggable-blocks/index.js.map +1 -1
  480. package/build-module/components/inserter-list-item/index.js +2 -4
  481. package/build-module/components/inserter-list-item/index.js.map +1 -1
  482. package/build-module/components/inspector-controls/block-support-tools-panel.js +3 -1
  483. package/build-module/components/inspector-controls/block-support-tools-panel.js.map +1 -1
  484. package/build-module/components/inspector-controls/fill.js +3 -3
  485. package/build-module/components/inspector-controls/fill.js.map +1 -1
  486. package/build-module/components/inspector-controls/fill.native.js +3 -3
  487. package/build-module/components/inspector-controls/fill.native.js.map +1 -1
  488. package/build-module/components/inspector-controls-tabs/index.js +35 -24
  489. package/build-module/components/inspector-controls-tabs/index.js.map +1 -1
  490. package/build-module/components/list-view/block-select-button.js +4 -0
  491. package/build-module/components/list-view/block-select-button.js.map +1 -1
  492. package/build-module/components/list-view/block.js +58 -4
  493. package/build-module/components/list-view/block.js.map +1 -1
  494. package/build-module/components/media-upload-progress/constants.js +7 -0
  495. package/build-module/components/media-upload-progress/constants.js.map +1 -0
  496. package/build-module/components/media-upload-progress/index.native.js +37 -8
  497. package/build-module/components/media-upload-progress/index.native.js.map +1 -1
  498. package/build-module/components/navigable-toolbar/index.js +11 -16
  499. package/build-module/components/navigable-toolbar/index.js.map +1 -1
  500. package/build-module/components/plain-text/index.native.js +6 -1
  501. package/build-module/components/plain-text/index.native.js.map +1 -1
  502. package/build-module/components/preview-options/index.js +6 -62
  503. package/build-module/components/preview-options/index.js.map +1 -1
  504. package/build-module/components/provider/index.js +3 -1
  505. package/build-module/components/provider/index.js.map +1 -1
  506. package/build-module/components/provider/use-block-sync.js +7 -1
  507. package/build-module/components/provider/use-block-sync.js.map +1 -1
  508. package/build-module/components/rich-text/content.js +25 -21
  509. package/build-module/components/rich-text/content.js.map +1 -1
  510. package/build-module/components/rich-text/get-rich-text-values.js +2 -1
  511. package/build-module/components/rich-text/get-rich-text-values.js.map +1 -1
  512. package/build-module/components/rich-text/index.js +21 -39
  513. package/build-module/components/rich-text/index.js.map +1 -1
  514. package/build-module/components/rich-text/index.native.js +10 -18
  515. package/build-module/components/rich-text/index.native.js.map +1 -1
  516. package/build-module/components/rich-text/native/get-format-colors.native.js +22 -24
  517. package/build-module/components/rich-text/native/get-format-colors.native.js.map +1 -1
  518. package/build-module/components/rich-text/native/index.native.js +22 -56
  519. package/build-module/components/rich-text/native/index.native.js.map +1 -1
  520. package/build-module/components/rich-text/use-input-rules.js +7 -3
  521. package/build-module/components/rich-text/use-input-rules.js.map +1 -1
  522. package/build-module/components/rich-text/use-mark-persistent.js +1 -1
  523. package/build-module/components/rich-text/use-mark-persistent.js.map +1 -1
  524. package/build-module/components/rich-text/with-deprecations.js +42 -0
  525. package/build-module/components/rich-text/with-deprecations.js.map +1 -0
  526. package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js +1 -1
  527. package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
  528. package/build-module/components/url-input/index.js +9 -6
  529. package/build-module/components/url-input/index.js.map +1 -1
  530. package/build-module/components/use-block-commands/index.js +14 -18
  531. package/build-module/components/use-block-commands/index.js.map +1 -1
  532. package/build-module/components/use-block-drop-zone/index.js +107 -18
  533. package/build-module/components/use-block-drop-zone/index.js.map +1 -1
  534. package/build-module/components/use-moving-animation/index.js +102 -94
  535. package/build-module/components/use-moving-animation/index.js.map +1 -1
  536. package/build-module/components/use-on-block-drop/index.js +9 -12
  537. package/build-module/components/use-on-block-drop/index.js.map +1 -1
  538. package/build-module/components/use-resize-canvas/index.js +4 -1
  539. package/build-module/components/use-resize-canvas/index.js.map +1 -1
  540. package/build-module/components/use-settings/index.js +13 -1
  541. package/build-module/components/use-settings/index.js.map +1 -1
  542. package/build-module/components/writing-flow/index.js +0 -1
  543. package/build-module/components/writing-flow/index.js.map +1 -1
  544. package/build-module/components/writing-flow/use-drag-selection.js +15 -4
  545. package/build-module/components/writing-flow/use-drag-selection.js.map +1 -1
  546. package/build-module/components/writing-flow/use-selection-observer.js +73 -27
  547. package/build-module/components/writing-flow/use-selection-observer.js.map +1 -1
  548. package/build-module/components/writing-flow/use-tab-nav.js +7 -4
  549. package/build-module/components/writing-flow/use-tab-nav.js.map +1 -1
  550. package/build-module/hooks/align.js +20 -67
  551. package/build-module/hooks/align.js.map +1 -1
  552. package/build-module/hooks/align.native.js +1 -0
  553. package/build-module/hooks/align.native.js.map +1 -1
  554. package/build-module/hooks/anchor.js +12 -27
  555. package/build-module/hooks/anchor.js.map +1 -1
  556. package/build-module/hooks/aria-label.js +7 -1
  557. package/build-module/hooks/aria-label.js.map +1 -1
  558. package/build-module/hooks/background.js +197 -37
  559. package/build-module/hooks/background.js.map +1 -1
  560. package/build-module/hooks/block-hooks.js +22 -30
  561. package/build-module/hooks/block-hooks.js.map +1 -1
  562. package/build-module/hooks/block-renaming.js +17 -21
  563. package/build-module/hooks/block-renaming.js.map +1 -1
  564. package/build-module/hooks/border.js +52 -79
  565. package/build-module/hooks/border.js.map +1 -1
  566. package/build-module/hooks/color.js +78 -88
  567. package/build-module/hooks/color.js.map +1 -1
  568. package/build-module/hooks/content-lock-ui.js +27 -27
  569. package/build-module/hooks/content-lock-ui.js.map +1 -1
  570. package/build-module/hooks/custom-class-name.js +12 -28
  571. package/build-module/hooks/custom-class-name.js.map +1 -1
  572. package/build-module/hooks/custom-class-name.native.js +7 -1
  573. package/build-module/hooks/custom-class-name.native.js.map +1 -1
  574. package/build-module/hooks/dimensions.js +15 -16
  575. package/build-module/hooks/dimensions.js.map +1 -1
  576. package/build-module/hooks/duotone.js +30 -61
  577. package/build-module/hooks/duotone.js.map +1 -1
  578. package/build-module/hooks/font-family.js +20 -25
  579. package/build-module/hooks/font-family.js.map +1 -1
  580. package/build-module/hooks/font-size.js +50 -120
  581. package/build-module/hooks/font-size.js.map +1 -1
  582. package/build-module/hooks/index.js +20 -16
  583. package/build-module/hooks/index.js.map +1 -1
  584. package/build-module/hooks/index.native.js +10 -6
  585. package/build-module/hooks/index.native.js.map +1 -1
  586. package/build-module/hooks/layout-child.js +60 -0
  587. package/build-module/hooks/layout-child.js.map +1 -0
  588. package/build-module/hooks/layout.js +21 -100
  589. package/build-module/hooks/layout.js.map +1 -1
  590. package/build-module/hooks/padding.js +2 -2
  591. package/build-module/hooks/padding.js.map +1 -1
  592. package/build-module/hooks/position.js +38 -59
  593. package/build-module/hooks/position.js.map +1 -1
  594. package/build-module/hooks/style.js +52 -85
  595. package/build-module/hooks/style.js.map +1 -1
  596. package/build-module/hooks/typography.js +26 -11
  597. package/build-module/hooks/typography.js.map +1 -1
  598. package/build-module/hooks/typography.native.js +43 -17
  599. package/build-module/hooks/typography.native.js.map +1 -1
  600. package/build-module/hooks/use-typography-props.js +9 -1
  601. package/build-module/hooks/use-typography-props.js.map +1 -1
  602. package/build-module/hooks/utils.js +194 -9
  603. package/build-module/hooks/utils.js.map +1 -1
  604. package/build-module/private-apis.js +2 -6
  605. package/build-module/private-apis.js.map +1 -1
  606. package/build-module/private-apis.native.js +0 -2
  607. package/build-module/private-apis.native.js.map +1 -1
  608. package/build-module/store/actions.js +0 -15
  609. package/build-module/store/actions.js.map +1 -1
  610. package/build-module/store/private-actions.js +52 -0
  611. package/build-module/store/private-actions.js.map +1 -1
  612. package/build-module/store/private-selectors.js +44 -1
  613. package/build-module/store/private-selectors.js.map +1 -1
  614. package/build-module/store/reducer.js +18 -2
  615. package/build-module/store/reducer.js.map +1 -1
  616. package/build-module/store/selectors.js +4 -65
  617. package/build-module/store/selectors.js.map +1 -1
  618. package/build-module/store/undo-ignore.js +5 -0
  619. package/build-module/store/undo-ignore.js.map +1 -0
  620. package/build-module/store/utils.js +56 -0
  621. package/build-module/store/utils.js.map +1 -0
  622. package/build-module/utils/get-px-from-css-unit.js +9 -0
  623. package/build-module/utils/get-px-from-css-unit.js.map +1 -0
  624. package/build-module/utils/index.js +1 -1
  625. package/build-module/utils/index.js.map +1 -1
  626. package/build-module/utils/object.js +37 -97
  627. package/build-module/utils/object.js.map +1 -1
  628. package/build-module/utils/selection.js +9 -1
  629. package/build-module/utils/selection.js.map +1 -1
  630. package/build-module/utils/use-can-block-toolbar-be-focused.js +40 -0
  631. package/build-module/utils/use-can-block-toolbar-be-focused.js.map +1 -0
  632. package/build-style/content-rtl.css +7 -6
  633. package/build-style/content.css +7 -6
  634. package/build-style/style-rtl.css +164 -301
  635. package/build-style/style.css +164 -301
  636. package/package.json +31 -31
  637. package/src/components/alignment-control/README.md +0 -5
  638. package/src/components/block-alignment-control/README.md +0 -5
  639. package/src/components/block-alignment-matrix-control/README.md +0 -10
  640. package/src/components/block-breadcrumb/README.md +0 -5
  641. package/src/components/block-canvas/index.js +29 -17
  642. package/src/components/block-canvas/style.scss +6 -0
  643. package/src/components/block-caption/README.md +2 -7
  644. package/src/components/block-card/README.md +0 -5
  645. package/src/components/block-card/index.js +6 -4
  646. package/src/components/block-card/style.scss +7 -3
  647. package/src/components/block-controls/hook.js +8 -30
  648. package/src/components/block-controls/test/index.js +3 -3
  649. package/src/components/block-draggable/draggable-chip.js +11 -1
  650. package/src/components/block-draggable/index.js +116 -4
  651. package/src/components/block-draggable/index.native.js +0 -5
  652. package/src/components/block-draggable/style.scss +35 -0
  653. package/src/components/block-draggable/test/helpers.native.js +8 -7
  654. package/src/components/block-draggable/use-scroll-when-dragging.native.js +1 -1
  655. package/src/components/block-edit/context.js +3 -0
  656. package/src/components/block-edit/index.js +36 -10
  657. package/src/components/block-editing-mode/index.js +3 -3
  658. package/src/components/block-icon/README.md +0 -5
  659. package/src/components/block-info-slot-fill/index.js +6 -3
  660. package/src/components/block-inspector/README.md +0 -5
  661. package/src/components/block-inspector/index.js +3 -1
  662. package/src/components/block-inspector/style.scss +0 -4
  663. package/src/components/block-list/block-list-item-cell.native.js +5 -1
  664. package/src/components/block-list/block.js +309 -104
  665. package/src/components/block-list/block.native.js +69 -21
  666. package/src/components/block-list/content.scss +14 -10
  667. package/src/components/block-list/index.native.js +3 -5
  668. package/src/components/block-list/{block-list-block-context.js → private-block-context.js} +1 -1
  669. package/src/components/block-list/use-block-props/index.js +43 -86
  670. package/src/components/block-list/use-block-props/use-focus-first-element.js +1 -34
  671. package/src/components/block-list/use-block-props/use-is-hovered.js +2 -13
  672. package/src/components/block-list/use-block-props/use-selected-block-event-handlers.js +1 -5
  673. package/src/components/block-list/use-in-between-inserter.js +4 -1
  674. package/src/components/block-list/use-scroll-upon-insertion.native.js +52 -0
  675. package/src/components/block-lock/toolbar.js +23 -34
  676. package/src/components/block-mover/README.md +0 -5
  677. package/src/components/block-mover/index.js +1 -1
  678. package/src/components/block-parent-selector/README.md +0 -5
  679. package/src/components/block-patterns-list/README.md +0 -5
  680. package/src/components/block-patterns-list/index.js +9 -6
  681. package/src/components/block-removal-warning-modal/index.js +7 -14
  682. package/src/components/block-rename/modal.js +7 -1
  683. package/src/components/block-settings/container.native.js +3 -5
  684. package/src/components/block-styles/index.js +1 -1
  685. package/src/components/block-styles/index.native.js +4 -2
  686. package/src/components/block-styles/style.scss +0 -11
  687. package/src/components/block-switcher/index.js +49 -59
  688. package/src/components/block-switcher/test/__snapshots__/index.js.snap +3 -1
  689. package/src/components/block-toolbar/README.md +0 -5
  690. package/src/components/block-toolbar/index.js +179 -95
  691. package/src/components/block-toolbar/style.scss +50 -66
  692. package/src/components/block-tools/block-toolbar-breadcrumb.js +46 -0
  693. package/src/components/block-tools/block-toolbar-popover.js +84 -0
  694. package/src/components/block-tools/index.js +42 -29
  695. package/src/components/block-tools/style.scss +60 -172
  696. package/src/components/block-types-list/README.md +0 -5
  697. package/src/components/block-types-list/index.native.js +2 -1
  698. package/src/components/block-variation-picker/README.md +0 -5
  699. package/src/components/block-variation-picker/index.native.js +1 -1
  700. package/src/components/block-variation-transforms/README.md +0 -5
  701. package/src/components/block-variation-transforms/index.js +49 -3
  702. package/src/components/border-radius-control/linked-button.js +1 -1
  703. package/src/components/caption/README.md +0 -5
  704. package/src/components/color-palette/test/__snapshots__/control.js.snap +0 -1
  705. package/src/components/colors/utils.js +8 -1
  706. package/src/components/colors/with-colors.js +3 -1
  707. package/src/components/colors-gradients/control.js +49 -30
  708. package/src/components/colors-gradients/style.scss +0 -7
  709. package/src/components/contrast-checker/README.md +0 -4
  710. package/src/components/copy-handler/README.md +0 -10
  711. package/src/components/duotone-control/index.js +2 -5
  712. package/src/components/duotone-control/style.scss +1 -6
  713. package/src/components/font-sizes/utils.js +7 -1
  714. package/src/components/global-styles/border-panel.js +2 -1
  715. package/src/components/global-styles/color-panel.js +36 -26
  716. package/src/components/global-styles/dimensions-panel.js +4 -3
  717. package/src/components/global-styles/effects-panel.js +2 -1
  718. package/src/components/global-styles/filters-panel.js +6 -5
  719. package/src/components/global-styles/get-global-styles-changes.js +210 -0
  720. package/src/components/global-styles/hooks.js +5 -0
  721. package/src/components/global-styles/image-settings-panel.js +6 -0
  722. package/src/components/global-styles/index.js +1 -0
  723. package/src/components/global-styles/test/get-global-styles-changes.js +234 -0
  724. package/src/components/global-styles/typography-panel.js +60 -47
  725. package/src/components/global-styles/use-global-styles-output.js +9 -5
  726. package/src/components/global-styles/utils.js +7 -0
  727. package/src/components/height-control/README.md +2 -7
  728. package/src/components/height-control/index.js +4 -0
  729. package/src/components/image-link-destinations/index.native.js +152 -0
  730. package/src/components/image-link-destinations/style.native.scss +16 -0
  731. package/src/components/image-size-control/index.js +5 -2
  732. package/src/components/index.native.js +3 -2
  733. package/src/components/inner-blocks/README.md +13 -2
  734. package/src/components/inner-blocks/index.js +68 -29
  735. package/src/components/inner-blocks/index.native.js +19 -7
  736. package/src/components/inner-blocks/use-inner-block-template-sync.js +5 -7
  737. package/src/components/inner-blocks/use-nested-settings-update.js +6 -13
  738. package/src/components/inserter/block-patterns-explorer/pattern-list.js +2 -2
  739. package/src/components/inserter/block-patterns-tab/pattern-category-previews.js +15 -15
  740. package/src/components/inserter/block-patterns-tab/patterns-filter.js +15 -13
  741. package/src/components/inserter/block-patterns-tab/use-pattern-categories.js +15 -18
  742. package/src/components/inserter/block-patterns-tab/utils.js +11 -12
  743. package/src/components/inserter/hooks/use-block-types-state.js +9 -11
  744. package/src/components/inserter/hooks/use-patterns-state.js +2 -2
  745. package/src/components/inserter/index.js +0 -1
  746. package/src/components/inserter/library.js +2 -8
  747. package/src/components/inserter/media-tab/media-panel.js +1 -1
  748. package/src/components/inserter/menu.js +26 -36
  749. package/src/components/inserter/preview-panel.js +2 -2
  750. package/src/components/inserter/style.scss +21 -21
  751. package/src/components/inserter/tabs.js +34 -25
  752. package/src/components/inserter-button/README.md +62 -0
  753. package/src/components/inserter-button/index.native.js +116 -0
  754. package/src/components/inserter-button/sparkles.js +15 -0
  755. package/src/components/inserter-button/style.native.scss +72 -0
  756. package/src/components/inserter-draggable-blocks/index.js +18 -5
  757. package/src/components/inserter-list-item/index.js +6 -6
  758. package/src/components/inspector-controls/block-support-tools-panel.js +2 -0
  759. package/src/components/inspector-controls/fill.js +6 -3
  760. package/src/components/inspector-controls/fill.native.js +6 -3
  761. package/src/components/inspector-controls-tabs/index.js +39 -28
  762. package/src/components/inspector-controls-tabs/style.scss +3 -2
  763. package/src/components/letter-spacing-control/README.md +0 -5
  764. package/src/components/line-height-control/README.md +0 -5
  765. package/src/components/link-control/style.scss +1 -1
  766. package/src/components/link-control/test/index.js +1 -1
  767. package/src/components/list-view/README.md +0 -5
  768. package/src/components/list-view/block-select-button.js +4 -0
  769. package/src/components/list-view/block.js +73 -2
  770. package/src/components/list-view/style.scss +6 -0
  771. package/src/components/media-upload-progress/constants.js +6 -0
  772. package/src/components/media-upload-progress/index.native.js +66 -14
  773. package/src/components/media-upload-progress/test/index.native.js +2 -2
  774. package/src/components/multi-selection-inspector/README.md +0 -5
  775. package/src/components/navigable-toolbar/README.md +2 -0
  776. package/src/components/navigable-toolbar/index.js +15 -13
  777. package/src/components/plain-text/index.native.js +6 -1
  778. package/src/components/preview-options/index.js +6 -86
  779. package/src/components/provider/index.js +1 -1
  780. package/src/components/provider/test/use-block-sync.js +20 -17
  781. package/src/components/provider/use-block-sync.js +6 -0
  782. package/src/components/rich-text/content.js +27 -20
  783. package/src/components/rich-text/get-rich-text-values.js +6 -1
  784. package/src/components/rich-text/index.js +23 -52
  785. package/src/components/rich-text/index.native.js +8 -25
  786. package/src/components/rich-text/native/get-format-colors.native.js +33 -40
  787. package/src/components/rich-text/native/index.native.js +22 -71
  788. package/src/components/rich-text/native/test/__snapshots__/index.native.js.snap +3 -3
  789. package/src/components/rich-text/native/test/index.native.js +72 -5
  790. package/src/components/rich-text/use-input-rules.js +8 -3
  791. package/src/components/rich-text/use-mark-persistent.js +1 -2
  792. package/src/components/rich-text/with-deprecations.js +51 -0
  793. package/src/components/spacing-sizes-control/input-controls/spacing-input-control.js +1 -1
  794. package/src/components/text-decoration-control/README.md +40 -0
  795. package/src/components/text-transform-control/README.md +0 -4
  796. package/src/components/ungroup-button/README.md +0 -5
  797. package/src/components/unit-control/README.md +0 -4
  798. package/src/components/url-input/index.js +11 -11
  799. package/src/components/use-block-commands/index.js +18 -21
  800. package/src/components/use-block-drop-zone/index.js +181 -30
  801. package/src/components/use-moving-animation/index.js +107 -103
  802. package/src/components/use-on-block-drop/index.js +9 -24
  803. package/src/components/use-on-block-drop/test/index.js +12 -26
  804. package/src/components/use-resize-canvas/README.md +3 -7
  805. package/src/components/use-resize-canvas/index.js +4 -1
  806. package/src/components/use-settings/README.md +0 -4
  807. package/src/components/use-settings/index.js +15 -1
  808. package/src/components/writing-flow/index.js +0 -1
  809. package/src/components/writing-flow/use-drag-selection.js +18 -4
  810. package/src/components/writing-flow/use-selection-observer.js +99 -37
  811. package/src/components/writing-flow/use-tab-nav.js +7 -7
  812. package/src/hooks/align.js +16 -81
  813. package/src/hooks/align.native.js +1 -0
  814. package/src/hooks/anchor.js +14 -38
  815. package/src/hooks/aria-label.js +8 -5
  816. package/src/hooks/background.js +269 -32
  817. package/src/hooks/block-hooks.js +22 -51
  818. package/src/hooks/block-renaming.js +23 -37
  819. package/src/hooks/border.js +62 -124
  820. package/src/hooks/color.js +111 -138
  821. package/src/hooks/content-lock-ui.js +110 -122
  822. package/src/hooks/custom-class-name.js +9 -45
  823. package/src/hooks/custom-class-name.native.js +8 -5
  824. package/src/hooks/dimensions.js +14 -16
  825. package/src/hooks/duotone.js +70 -127
  826. package/src/hooks/font-family.js +14 -36
  827. package/src/hooks/font-size.js +67 -168
  828. package/src/hooks/index.js +58 -16
  829. package/src/hooks/index.native.js +22 -6
  830. package/src/hooks/layout-child.js +53 -0
  831. package/src/hooks/layout.js +17 -103
  832. package/src/hooks/padding.js +2 -2
  833. package/src/hooks/position.js +50 -90
  834. package/src/hooks/style.js +118 -193
  835. package/src/hooks/test/align.js +1 -178
  836. package/src/hooks/test/anchor.js +4 -9
  837. package/src/hooks/test/custom-class-name.js +3 -8
  838. package/src/hooks/test/style.js +4 -14
  839. package/src/hooks/typography.js +14 -16
  840. package/src/hooks/typography.native.js +31 -33
  841. package/src/hooks/use-typography-props.js +7 -1
  842. package/src/hooks/utils.js +261 -10
  843. package/src/private-apis.js +2 -6
  844. package/src/private-apis.native.js +0 -2
  845. package/src/store/actions.js +0 -15
  846. package/src/store/private-actions.js +48 -0
  847. package/src/store/private-selectors.js +56 -0
  848. package/src/store/reducer.js +20 -1
  849. package/src/store/selectors.js +10 -82
  850. package/src/store/undo-ignore.js +4 -0
  851. package/src/store/utils.js +74 -0
  852. package/src/style.scss +1 -2
  853. package/src/utils/get-px-from-css-unit.js +8 -0
  854. package/src/utils/index.js +1 -1
  855. package/src/utils/object.js +34 -104
  856. package/src/utils/selection.js +9 -2
  857. package/src/utils/test/object.js +1 -96
  858. package/src/utils/use-can-block-toolbar-be-focused.js +48 -0
  859. package/build/components/block-list/block-list-block-context.js +0 -14
  860. package/build/components/block-list/block-list-block-context.js.map +0 -1
  861. package/build/components/block-list/use-block-props/use-block-class-names.js +0 -67
  862. package/build/components/block-list/use-block-props/use-block-class-names.js.map +0 -1
  863. package/build/components/block-list/use-block-props/use-block-custom-class-name.js +0 -46
  864. package/build/components/block-list/use-block-props/use-block-custom-class-name.js.map +0 -1
  865. package/build/components/block-list/use-block-props/use-block-default-class-name.js +0 -37
  866. package/build/components/block-list/use-block-props/use-block-default-class-name.js.map +0 -1
  867. package/build/components/block-tools/back-compat.js +0 -45
  868. package/build/components/block-tools/back-compat.js.map +0 -1
  869. package/build/components/block-tools/block-contextual-toolbar.js +0 -91
  870. package/build/components/block-tools/block-contextual-toolbar.js.map +0 -1
  871. package/build/components/block-tools/selected-block-tools.js +0 -113
  872. package/build/components/block-tools/selected-block-tools.js.map +0 -1
  873. package/build/components/inserter/hooks/use-debounced-input.js +0 -22
  874. package/build/components/inserter/hooks/use-debounced-input.js.map +0 -1
  875. package/build/components/use-display-block-controls/index.js +0 -39
  876. package/build/components/use-display-block-controls/index.js.map +0 -1
  877. package/build/components/use-display-block-controls/index.native.js +0 -39
  878. package/build/components/use-display-block-controls/index.native.js.map +0 -1
  879. package/build/hooks/custom-fields.js +0 -120
  880. package/build/hooks/custom-fields.js.map +0 -1
  881. package/build/utils/parse-css-unit-to-px.js +0 -302
  882. package/build/utils/parse-css-unit-to-px.js.map +0 -1
  883. package/build/utils/use-should-contextual-toolbar-show.js +0 -63
  884. package/build/utils/use-should-contextual-toolbar-show.js.map +0 -1
  885. package/build-module/components/block-list/block-list-block-context.js +0 -6
  886. package/build-module/components/block-list/block-list-block-context.js.map +0 -1
  887. package/build-module/components/block-list/use-block-props/use-block-class-names.js +0 -60
  888. package/build-module/components/block-list/use-block-props/use-block-class-names.js.map +0 -1
  889. package/build-module/components/block-list/use-block-props/use-block-custom-class-name.js +0 -40
  890. package/build-module/components/block-list/use-block-props/use-block-custom-class-name.js.map +0 -1
  891. package/build-module/components/block-list/use-block-props/use-block-default-class-name.js +0 -31
  892. package/build-module/components/block-list/use-block-props/use-block-default-class-name.js.map +0 -1
  893. package/build-module/components/block-tools/back-compat.js +0 -35
  894. package/build-module/components/block-tools/back-compat.js.map +0 -1
  895. package/build-module/components/block-tools/block-contextual-toolbar.js +0 -83
  896. package/build-module/components/block-tools/block-contextual-toolbar.js.map +0 -1
  897. package/build-module/components/block-tools/selected-block-tools.js +0 -105
  898. package/build-module/components/block-tools/selected-block-tools.js.map +0 -1
  899. package/build-module/components/inserter/hooks/use-debounced-input.js +0 -15
  900. package/build-module/components/inserter/hooks/use-debounced-input.js.map +0 -1
  901. package/build-module/components/use-display-block-controls/index.js +0 -32
  902. package/build-module/components/use-display-block-controls/index.js.map +0 -1
  903. package/build-module/components/use-display-block-controls/index.native.js +0 -32
  904. package/build-module/components/use-display-block-controls/index.native.js.map +0 -1
  905. package/build-module/hooks/custom-fields.js +0 -118
  906. package/build-module/hooks/custom-fields.js.map +0 -1
  907. package/build-module/utils/parse-css-unit-to-px.js +0 -294
  908. package/build-module/utils/parse-css-unit-to-px.js.map +0 -1
  909. package/build-module/utils/use-should-contextual-toolbar-show.js +0 -57
  910. package/build-module/utils/use-should-contextual-toolbar-show.js.map +0 -1
  911. package/src/components/block-list/use-block-props/use-block-class-names.js +0 -66
  912. package/src/components/block-list/use-block-props/use-block-custom-class-name.js +0 -44
  913. package/src/components/block-list/use-block-props/use-block-default-class-name.js +0 -35
  914. package/src/components/block-parent-selector/style.scss +0 -11
  915. package/src/components/block-tools/back-compat.js +0 -35
  916. package/src/components/block-tools/block-contextual-toolbar.js +0 -100
  917. package/src/components/block-tools/selected-block-tools.js +0 -127
  918. package/src/components/inserter/hooks/use-debounced-input.js +0 -18
  919. package/src/components/preview-options/README.md +0 -94
  920. package/src/components/preview-options/style.scss +0 -64
  921. package/src/components/use-display-block-controls/index.js +0 -36
  922. package/src/components/use-display-block-controls/index.native.js +0 -37
  923. package/src/hooks/custom-fields.js +0 -142
  924. package/src/hooks/test/color.js +0 -112
  925. package/src/utils/parse-css-unit-to-px.js +0 -329
  926. package/src/utils/test/parse-css-unit-to-px.js +0 -172
  927. package/src/utils/use-should-contextual-toolbar-show.js +0 -85
@@ -1 +1 @@
1
- {"version":3,"names":["_components","require","_blocks","_data","_draggableChip","_interopRequireDefault","InserterDraggableBlocks","isEnabled","blocks","icon","children","isPattern","transferData","type","blockTypeIcon","useSelect","select","getBlockType","blocksStore","length","name","_react","createElement","Draggable","__experimentalTransferDataType","onDragStart","event","dataTransfer","setData","serialize","__experimentalDragComponent","default","count","onDraggableStart","onDraggableEnd","draggable","undefined","onDragEnd","_default","exports"],"sources":["@wordpress/block-editor/src/components/inserter-draggable-blocks/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Draggable } from '@wordpress/components';\nimport { serialize, store as blocksStore } from '@wordpress/blocks';\nimport { useSelect } from '@wordpress/data';\n/**\n * Internal dependencies\n */\nimport BlockDraggableChip from '../block-draggable/draggable-chip';\n\nconst InserterDraggableBlocks = ( {\n\tisEnabled,\n\tblocks,\n\ticon,\n\tchildren,\n\tisPattern,\n} ) => {\n\tconst transferData = {\n\t\ttype: 'inserter',\n\t\tblocks,\n\t};\n\n\tconst blockTypeIcon = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockType } = select( blocksStore );\n\t\t\treturn (\n\t\t\t\tblocks.length === 1 && getBlockType( blocks[ 0 ].name )?.icon\n\t\t\t);\n\t\t},\n\t\t[ blocks ]\n\t);\n\n\treturn (\n\t\t<Draggable\n\t\t\t__experimentalTransferDataType=\"wp-blocks\"\n\t\t\ttransferData={ transferData }\n\t\t\tonDragStart={ ( event ) => {\n\t\t\t\tevent.dataTransfer.setData( 'text/html', serialize( blocks ) );\n\t\t\t} }\n\t\t\t__experimentalDragComponent={\n\t\t\t\t<BlockDraggableChip\n\t\t\t\t\tcount={ blocks.length }\n\t\t\t\t\ticon={ icon || ( ! isPattern && blockTypeIcon ) }\n\t\t\t\t\tisPattern={ isPattern }\n\t\t\t\t/>\n\t\t\t}\n\t\t>\n\t\t\t{ ( { onDraggableStart, onDraggableEnd } ) => {\n\t\t\t\treturn children( {\n\t\t\t\t\tdraggable: isEnabled,\n\t\t\t\t\tonDragStart: isEnabled ? onDraggableStart : undefined,\n\t\t\t\t\tonDragEnd: isEnabled ? onDraggableEnd : undefined,\n\t\t\t\t} );\n\t\t\t} }\n\t\t</Draggable>\n\t);\n};\n\nexport default InserterDraggableBlocks;\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AAIA,IAAAG,cAAA,GAAAC,sBAAA,CAAAJ,OAAA;AATA;AACA;AACA;;AAIA;AACA;AACA;;AAGA,MAAMK,uBAAuB,GAAGA,CAAE;EACjCC,SAAS;EACTC,MAAM;EACNC,IAAI;EACJC,QAAQ;EACRC;AACD,CAAC,KAAM;EACN,MAAMC,YAAY,GAAG;IACpBC,IAAI,EAAE,UAAU;IAChBL;EACD,CAAC;EAED,MAAMM,aAAa,GAAG,IAAAC,eAAS,EAC5BC,MAAM,IAAM;IACb,MAAM;MAAEC;IAAa,CAAC,GAAGD,MAAM,CAAEE,aAAY,CAAC;IAC9C,OACCV,MAAM,CAACW,MAAM,KAAK,CAAC,IAAIF,YAAY,CAAET,MAAM,CAAE,CAAC,CAAE,CAACY,IAAK,CAAC,EAAEX,IAAI;EAE/D,CAAC,EACD,CAAED,MAAM,CACT,CAAC;EAED,OACC,IAAAa,MAAA,CAAAC,aAAA,EAACtB,WAAA,CAAAuB,SAAS;IACTC,8BAA8B,EAAC,WAAW;IAC1CZ,YAAY,EAAGA,YAAc;IAC7Ba,WAAW,EAAKC,KAAK,IAAM;MAC1BA,KAAK,CAACC,YAAY,CAACC,OAAO,CAAE,WAAW,EAAE,IAAAC,iBAAS,EAAErB,MAAO,CAAE,CAAC;IAC/D,CAAG;IACHsB,2BAA2B,EAC1B,IAAAT,MAAA,CAAAC,aAAA,EAAClB,cAAA,CAAA2B,OAAkB;MAClBC,KAAK,EAAGxB,MAAM,CAACW,MAAQ;MACvBV,IAAI,EAAGA,IAAI,IAAM,CAAEE,SAAS,IAAIG,aAAiB;MACjDH,SAAS,EAAGA;IAAW,CACvB;EACD,GAEC,CAAE;IAAEsB,gBAAgB;IAAEC;EAAe,CAAC,KAAM;IAC7C,OAAOxB,QAAQ,CAAE;MAChByB,SAAS,EAAE5B,SAAS;MACpBkB,WAAW,EAAElB,SAAS,GAAG0B,gBAAgB,GAAGG,SAAS;MACrDC,SAAS,EAAE9B,SAAS,GAAG2B,cAAc,GAAGE;IACzC,CAAE,CAAC;EACJ,CACU,CAAC;AAEd,CAAC;AAAC,IAAAE,QAAA,GAEahC,uBAAuB;AAAAiC,OAAA,CAAAR,OAAA,GAAAO,QAAA"}
1
+ {"version":3,"names":["_components","require","_blocks","_data","_draggableChip","_interopRequireDefault","_utils","InserterDraggableBlocks","isEnabled","blocks","icon","children","pattern","transferData","type","blockTypeIcon","useSelect","select","getBlockType","blocksStore","length","name","_react","createElement","Draggable","__experimentalTransferDataType","onDragStart","event","parsedBlocks","INSERTER_PATTERN_TYPES","user","syncStatus","createBlock","ref","id","dataTransfer","setData","serialize","__experimentalDragComponent","default","count","isPattern","onDraggableStart","onDraggableEnd","draggable","undefined","onDragEnd","_default","exports"],"sources":["@wordpress/block-editor/src/components/inserter-draggable-blocks/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Draggable } from '@wordpress/components';\nimport {\n\tcreateBlock,\n\tserialize,\n\tstore as blocksStore,\n} from '@wordpress/blocks';\nimport { useSelect } from '@wordpress/data';\n/**\n * Internal dependencies\n */\nimport BlockDraggableChip from '../block-draggable/draggable-chip';\nimport { INSERTER_PATTERN_TYPES } from '../inserter/block-patterns-tab/utils';\n\nconst InserterDraggableBlocks = ( {\n\tisEnabled,\n\tblocks,\n\ticon,\n\tchildren,\n\tpattern,\n} ) => {\n\tconst transferData = {\n\t\ttype: 'inserter',\n\t\tblocks,\n\t};\n\n\tconst blockTypeIcon = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockType } = select( blocksStore );\n\t\t\treturn (\n\t\t\t\tblocks.length === 1 && getBlockType( blocks[ 0 ].name )?.icon\n\t\t\t);\n\t\t},\n\t\t[ blocks ]\n\t);\n\n\treturn (\n\t\t<Draggable\n\t\t\t__experimentalTransferDataType=\"wp-blocks\"\n\t\t\ttransferData={ transferData }\n\t\t\tonDragStart={ ( event ) => {\n\t\t\t\tconst parsedBlocks =\n\t\t\t\t\tpattern?.type === INSERTER_PATTERN_TYPES.user &&\n\t\t\t\t\tpattern?.syncStatus !== 'unsynced'\n\t\t\t\t\t\t? [ createBlock( 'core/block', { ref: pattern.id } ) ]\n\t\t\t\t\t\t: blocks;\n\t\t\t\tevent.dataTransfer.setData(\n\t\t\t\t\t'text/html',\n\t\t\t\t\tserialize( parsedBlocks )\n\t\t\t\t);\n\t\t\t} }\n\t\t\t__experimentalDragComponent={\n\t\t\t\t<BlockDraggableChip\n\t\t\t\t\tcount={ blocks.length }\n\t\t\t\t\ticon={ icon || ( ! pattern && blockTypeIcon ) }\n\t\t\t\t\tisPattern={ !! pattern }\n\t\t\t\t/>\n\t\t\t}\n\t\t>\n\t\t\t{ ( { onDraggableStart, onDraggableEnd } ) => {\n\t\t\t\treturn children( {\n\t\t\t\t\tdraggable: isEnabled,\n\t\t\t\t\tonDragStart: isEnabled ? onDraggableStart : undefined,\n\t\t\t\t\tonDragEnd: isEnabled ? onDraggableEnd : undefined,\n\t\t\t\t} );\n\t\t\t} }\n\t\t</Draggable>\n\t);\n};\n\nexport default InserterDraggableBlocks;\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAKA,IAAAE,KAAA,GAAAF,OAAA;AAIA,IAAAG,cAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AAdA;AACA;AACA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AEC;EAAe,CAAC,KAAM;IAC7C,OAAOhC,QAAQ,CAAE;MAChBiC,SAAS,EAAEpC,SAAS;MACpBkB,WAAW,EAAElB,SAAS,GAAGkC,gBAAgB,GAAGG,SAAS;MACrDC,SAAS,EAAEtC,SAAS,GAAGmC,cAAc,GAAGE;IACzC,CAAE,CAAC;EACJ,CACU,CAAC;AAEd,CAAC;AAAC,IAAAE,QAAA,GAEaxC,uBAAuB;AAAAyC,OAAA,CAAAT,OAAA,GAAAQ,QAAA"}
@@ -40,12 +40,10 @@ function InserterListItem({
40
40
  backgroundColor: item.icon.background,
41
41
  color: item.icon.foreground
42
42
  } : {};
43
- const blocks = (0, _element.useMemo)(() => {
44
- return [(0, _blocks.createBlock)(item.name, item.initialAttributes, (0, _blocks.createBlocksFromInnerBlocksTemplate)(item.innerBlocks))];
45
- }, [item.name, item.initialAttributes, item.initialAttributes]);
43
+ const blocks = (0, _element.useMemo)(() => [(0, _blocks.createBlock)(item.name, item.initialAttributes, (0, _blocks.createBlocksFromInnerBlocksTemplate)(item.innerBlocks))], [item.name, item.initialAttributes, item.innerBlocks]);
46
44
  const isSynced = (0, _blocks.isReusableBlock)(item) && item.syncStatus !== 'unsynced' || (0, _blocks.isTemplatePart)(item);
47
45
  return (0, _react.createElement)(_inserterDraggableBlocks.default, {
48
- isEnabled: isDraggable && !item.disabled,
46
+ isEnabled: isDraggable && !item.isDisabled,
49
47
  blocks: blocks,
50
48
  icon: item.icon
51
49
  }, ({
@@ -1 +1 @@
1
- {"version":3,"names":["_classnames","_interopRequireDefault","require","_element","_blocks","_components","_keycodes","_blockIcon","_inserterListbox","_inserterDraggableBlocks","InserterListItem","className","isFirst","item","onSelect","onHover","isDraggable","props","isDragging","useRef","itemIconStyle","icon","backgroundColor","background","color","foreground","blocks","useMemo","createBlock","name","initialAttributes","createBlocksFromInnerBlocksTemplate","innerBlocks","isSynced","isReusableBlock","syncStatus","isTemplatePart","_react","createElement","default","isEnabled","disabled","draggable","onDragStart","onDragEnd","classnames","event","current","InserterListboxItem","isDisabled","onClick","preventDefault","isAppleOS","metaKey","ctrlKey","onKeyDown","keyCode","ENTER","onMouseEnter","onMouseLeave","style","showColors","__experimentalTruncate","numberOfLines","title","_default","memo","exports"],"sources":["@wordpress/block-editor/src/components/inserter-list-item/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useMemo, useRef, memo } from '@wordpress/element';\nimport {\n\tcreateBlock,\n\tcreateBlocksFromInnerBlocksTemplate,\n\tisReusableBlock,\n\tisTemplatePart,\n} from '@wordpress/blocks';\nimport { __experimentalTruncate as Truncate } from '@wordpress/components';\nimport { ENTER, isAppleOS } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport BlockIcon from '../block-icon';\nimport { InserterListboxItem } from '../inserter-listbox';\nimport InserterDraggableBlocks from '../inserter-draggable-blocks';\n\nfunction InserterListItem( {\n\tclassName,\n\tisFirst,\n\titem,\n\tonSelect,\n\tonHover,\n\tisDraggable,\n\t...props\n} ) {\n\tconst isDragging = useRef( false );\n\tconst itemIconStyle = item.icon\n\t\t? {\n\t\t\t\tbackgroundColor: item.icon.background,\n\t\t\t\tcolor: item.icon.foreground,\n\t\t }\n\t\t: {};\n\tconst blocks = useMemo( () => {\n\t\treturn [\n\t\t\tcreateBlock(\n\t\t\t\titem.name,\n\t\t\t\titem.initialAttributes,\n\t\t\t\tcreateBlocksFromInnerBlocksTemplate( item.innerBlocks )\n\t\t\t),\n\t\t];\n\t}, [ item.name, item.initialAttributes, item.initialAttributes ] );\n\n\tconst isSynced =\n\t\t( isReusableBlock( item ) && item.syncStatus !== 'unsynced' ) ||\n\t\tisTemplatePart( item );\n\n\treturn (\n\t\t<InserterDraggableBlocks\n\t\t\tisEnabled={ isDraggable && ! item.disabled }\n\t\t\tblocks={ blocks }\n\t\t\ticon={ item.icon }\n\t\t>\n\t\t\t{ ( { draggable, onDragStart, onDragEnd } ) => (\n\t\t\t\t<div\n\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t'block-editor-block-types-list__list-item',\n\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t'is-synced': isSynced,\n\t\t\t\t\t\t}\n\t\t\t\t\t) }\n\t\t\t\t\tdraggable={ draggable }\n\t\t\t\t\tonDragStart={ ( event ) => {\n\t\t\t\t\t\tisDragging.current = true;\n\t\t\t\t\t\tif ( onDragStart ) {\n\t\t\t\t\t\t\tonHover( null );\n\t\t\t\t\t\t\tonDragStart( event );\n\t\t\t\t\t\t}\n\t\t\t\t\t} }\n\t\t\t\t\tonDragEnd={ ( event ) => {\n\t\t\t\t\t\tisDragging.current = false;\n\t\t\t\t\t\tif ( onDragEnd ) {\n\t\t\t\t\t\t\tonDragEnd( event );\n\t\t\t\t\t\t}\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t<InserterListboxItem\n\t\t\t\t\t\tisFirst={ isFirst }\n\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t'block-editor-block-types-list__item',\n\t\t\t\t\t\t\tclassName\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tdisabled={ item.isDisabled }\n\t\t\t\t\t\tonClick={ ( event ) => {\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\tonSelect(\n\t\t\t\t\t\t\t\titem,\n\t\t\t\t\t\t\t\tisAppleOS() ? event.metaKey : event.ctrlKey\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tonHover( null );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tonKeyDown={ ( event ) => {\n\t\t\t\t\t\t\tconst { keyCode } = event;\n\t\t\t\t\t\t\tif ( keyCode === ENTER ) {\n\t\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\t\tonSelect(\n\t\t\t\t\t\t\t\t\titem,\n\t\t\t\t\t\t\t\t\tisAppleOS() ? event.metaKey : event.ctrlKey\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tonHover( null );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tonMouseEnter={ () => {\n\t\t\t\t\t\t\tif ( isDragging.current ) {\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tonHover( item );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tonMouseLeave={ () => onHover( null ) }\n\t\t\t\t\t\t{ ...props }\n\t\t\t\t\t>\n\t\t\t\t\t\t<span\n\t\t\t\t\t\t\tclassName=\"block-editor-block-types-list__item-icon\"\n\t\t\t\t\t\t\tstyle={ itemIconStyle }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<BlockIcon icon={ item.icon } showColors />\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<span className=\"block-editor-block-types-list__item-title\">\n\t\t\t\t\t\t\t<Truncate numberOfLines={ 3 }>\n\t\t\t\t\t\t\t\t{ item.title }\n\t\t\t\t\t\t\t</Truncate>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</InserterListboxItem>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</InserterDraggableBlocks>\n\t);\n}\n\nexport default memo( InserterListItem );\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAMA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AAKA,IAAAK,UAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,gBAAA,GAAAN,OAAA;AACA,IAAAO,wBAAA,GAAAR,sBAAA,CAAAC,OAAA;AAvBA;AACA;AACA;;AAGA;AACA;AACA;;AAWA;AACA;AACA;;AAKA,SAASQ,gBAAgBA,CAAE;EAC1BC,SAAS;EACTC,OAAO;EACPC,IAAI;EACJC,QAAQ;EACRC,OAAO;EACPC,WAAW;EACX,GAAGC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AAC,0CAA0C;IACpDiD,KAAK,EAAGxC;EAAe,GAEvB,IAAAiB,MAAA,CAAAC,aAAA,EAAC/B,UAAA,CAAAgC,OAAS;IAAClB,IAAI,EAAGR,IAAI,CAACQ,IAAM;IAACwC,UAAU;EAAA,CAAE,CACrC,CAAC,EACP,IAAAxB,MAAA,CAAAC,aAAA;IAAM3B,SAAS,EAAC;EAA2C,GAC1D,IAAA0B,MAAA,CAAAC,aAAA,EAACjC,WAAA,CAAAyD,sBAAQ;IAACC,aAAa,EAAG;EAAG,GAC1BlD,IAAI,CAACmD,KACE,CACL,CACc,CACjB,CAEkB,CAAC;AAE5B;AAAC,IAAAC,QAAA,GAEc,IAAAC,aAAI,EAAExD,gBAAiB,CAAC;AAAAyD,OAAA,CAAA5B,OAAA,GAAA0B,QAAA"}
1
+ {"version":3,"names":["_classnames","_interopRequireDefault","require","_element","_blocks","_components","_keycodes","_blockIcon","_inserterListbox","_inserterDraggableBlocks","InserterListItem","className","isFirst","item","onSelect","onHover","isDraggable","props","isDragging","useRef","itemIconStyle","icon","backgroundColor","background","color","foreground","blocks","useMemo","createBlock","name","initialAttributes","createBlocksFromInnerBlocksTemplate","innerBlocks","isSynced","isReusableBlock","syncStatus","isTemplatePart","_react","createElement","default","isEnabled","isDisabled","draggable","onDragStart","onDragEnd","classnames","event","current","InserterListboxItem","disabled","onClick","preventDefault","isAppleOS","metaKey","ctrlKey","onKeyDown","keyCode","ENTER","onMouseEnter","onMouseLeave","style","showColors","__experimentalTruncate","numberOfLines","title","_default","memo","exports"],"sources":["@wordpress/block-editor/src/components/inserter-list-item/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useMemo, useRef, memo } from '@wordpress/element';\nimport {\n\tcreateBlock,\n\tcreateBlocksFromInnerBlocksTemplate,\n\tisReusableBlock,\n\tisTemplatePart,\n} from '@wordpress/blocks';\nimport { __experimentalTruncate as Truncate } from '@wordpress/components';\nimport { ENTER, isAppleOS } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport BlockIcon from '../block-icon';\nimport { InserterListboxItem } from '../inserter-listbox';\nimport InserterDraggableBlocks from '../inserter-draggable-blocks';\n\nfunction InserterListItem( {\n\tclassName,\n\tisFirst,\n\titem,\n\tonSelect,\n\tonHover,\n\tisDraggable,\n\t...props\n} ) {\n\tconst isDragging = useRef( false );\n\tconst itemIconStyle = item.icon\n\t\t? {\n\t\t\t\tbackgroundColor: item.icon.background,\n\t\t\t\tcolor: item.icon.foreground,\n\t\t }\n\t\t: {};\n\tconst blocks = useMemo(\n\t\t() => [\n\t\t\tcreateBlock(\n\t\t\t\titem.name,\n\t\t\t\titem.initialAttributes,\n\t\t\t\tcreateBlocksFromInnerBlocksTemplate( item.innerBlocks )\n\t\t\t),\n\t\t],\n\t\t[ item.name, item.initialAttributes, item.innerBlocks ]\n\t);\n\n\tconst isSynced =\n\t\t( isReusableBlock( item ) && item.syncStatus !== 'unsynced' ) ||\n\t\tisTemplatePart( item );\n\n\treturn (\n\t\t<InserterDraggableBlocks\n\t\t\tisEnabled={ isDraggable && ! item.isDisabled }\n\t\t\tblocks={ blocks }\n\t\t\ticon={ item.icon }\n\t\t>\n\t\t\t{ ( { draggable, onDragStart, onDragEnd } ) => (\n\t\t\t\t<div\n\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t'block-editor-block-types-list__list-item',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t'is-synced': isSynced,\n\t\t\t\t\t\t}\n\t\t\t\t\t) }\n\t\t\t\t\tdraggable={ draggable }\n\t\t\t\t\tonDragStart={ ( event ) => {\n\t\t\t\t\t\tisDragging.current = true;\n\t\t\t\t\t\tif ( onDragStart ) {\n\t\t\t\t\t\t\tonHover( null );\n\t\t\t\t\t\t\tonDragStart( event );\n\t\t\t\t\t\t}\n\t\t\t\t\t} }\n\t\t\t\t\tonDragEnd={ ( event ) => {\n\t\t\t\t\t\tisDragging.current = false;\n\t\t\t\t\t\tif ( onDragEnd ) {\n\t\t\t\t\t\t\tonDragEnd( event );\n\t\t\t\t\t\t}\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t<InserterListboxItem\n\t\t\t\t\t\tisFirst={ isFirst }\n\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t'block-editor-block-types-list__item',\n\t\t\t\t\t\t\tclassName\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tdisabled={ item.isDisabled }\n\t\t\t\t\t\tonClick={ ( event ) => {\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\tonSelect(\n\t\t\t\t\t\t\t\titem,\n\t\t\t\t\t\t\t\tisAppleOS() ? event.metaKey : event.ctrlKey\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tonHover( null );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tonKeyDown={ ( event ) => {\n\t\t\t\t\t\t\tconst { keyCode } = event;\n\t\t\t\t\t\t\tif ( keyCode === ENTER ) {\n\t\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\t\tonSelect(\n\t\t\t\t\t\t\t\t\titem,\n\t\t\t\t\t\t\t\t\tisAppleOS() ? event.metaKey : event.ctrlKey\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tonHover( null );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tonMouseEnter={ () => {\n\t\t\t\t\t\t\tif ( isDragging.current ) {\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tonHover( item );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tonMouseLeave={ () => onHover( null ) }\n\t\t\t\t\t\t{ ...props }\n\t\t\t\t\t>\n\t\t\t\t\t\t<span\n\t\t\t\t\t\t\tclassName=\"block-editor-block-types-list__item-icon\"\n\t\t\t\t\t\t\tstyle={ itemIconStyle }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<BlockIcon icon={ item.icon } showColors />\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<span className=\"block-editor-block-types-list__item-title\">\n\t\t\t\t\t\t\t<Truncate numberOfLines={ 3 }>\n\t\t\t\t\t\t\t\t{ item.title }\n\t\t\t\t\t\t\t</Truncate>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</InserterListboxItem>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</InserterDraggableBlocks>\n\t);\n}\n\nexport default memo( InserterListItem );\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAMA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AAKA,IAAAK,UAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,gBAAA,GAAAN,OAAA;AACA,IAAAO,wBAAA,GAAAR,sBAAA,CAAAC,OAAA;AAvBA;AACA;AACA;;AAGA;AACA;AACA;;AAWA;AACA;AACA;;AAKA,SAASQ,gBAAgBA,CAAE;EAC1BC,SAAS;EACTC,OAAO;EACPC,IAAI;EACJC,QAAQ;EACRC,OAAO;EACPC,WAAW;EACX,GAAGC;AACJ,CAAC,EAAG;EACH,MAAMC,UAAU,GAAG,IAAAC,eAAM,EAAE,KAAM,CAAC;EAClC,MAAMC,aAAa,GAAGP,IAAI,CAACQ,IAAI,GAC5B;IACAC,eAAe,EAAET,IAAI,CAACQ,IAAI,CAACE,UAAU;IACrCC,KAAK,EAAEX,IAAI,CAACQ,IAAI,CAACI;EACjB,CAAC,GACD,CAAC,CAAC;EACL,MAAMC,MAAM,GAAG,IAAAC,gBAAO,EACrB,MAAM,CACL,IAAAC,mBAAW,EACVf,IAAI,CAACgB,IAAI,EACThB,IAAI,CAACiB,iBAAiB,EACtB,IAAAC,2CAAmC,EAAElB,IAAI,CAACmB,WAAY,CAC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AC;AAAAyD,OAAA,CAAA5B,OAAA,GAAA0B,QAAA"}
@@ -10,6 +10,7 @@ var _data = require("@wordpress/data");
10
10
  var _element = require("@wordpress/element");
11
11
  var _store = require("../../store");
12
12
  var _utils = require("../../hooks/utils");
13
+ var _utils2 = require("../global-styles/utils");
13
14
  /**
14
15
  * WordPress dependencies
15
16
  */
@@ -69,7 +70,8 @@ function BlockSupportToolsPanel({
69
70
  shouldRenderPlaceholderItems: true // Required to maintain fills ordering.
70
71
  ,
71
72
  __experimentalFirstVisibleItemClass: "first",
72
- __experimentalLastVisibleItemClass: "last"
73
+ __experimentalLastVisibleItemClass: "last",
74
+ dropdownMenuProps: _utils2.TOOLSPANEL_DROPDOWNMENU_PROPS
73
75
  }, children);
74
76
  }
75
77
  //# sourceMappingURL=block-support-tools-panel.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_components","require","_data","_element","_store","_utils","BlockSupportToolsPanel","children","group","label","updateBlockAttributes","useDispatch","blockEditorStore","getBlockAttributes","getMultiSelectedBlockClientIds","getSelectedBlockClientId","hasMultiSelection","useSelect","panelId","resetAll","useCallback","resetFilters","newAttributes","clientIds","forEach","clientId","style","newBlockAttributes","resetFilter","cleanEmptyObject","_react","createElement","__experimentalToolsPanel","className","key","hasInnerWrapper","shouldRenderPlaceholderItems","__experimentalFirstVisibleItemClass","__experimentalLastVisibleItemClass"],"sources":["@wordpress/block-editor/src/components/inspector-controls/block-support-tools-panel.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalToolsPanel as ToolsPanel } from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useCallback } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\nimport { cleanEmptyObject } from '../../hooks/utils';\n\nexport default function BlockSupportToolsPanel( { children, group, label } ) {\n\tconst { updateBlockAttributes } = useDispatch( blockEditorStore );\n\tconst {\n\t\tgetBlockAttributes,\n\t\tgetMultiSelectedBlockClientIds,\n\t\tgetSelectedBlockClientId,\n\t\thasMultiSelection,\n\t} = useSelect( blockEditorStore );\n\n\tconst panelId = getSelectedBlockClientId();\n\tconst resetAll = useCallback(\n\t\t( resetFilters = [] ) => {\n\t\t\tconst newAttributes = {};\n\n\t\t\tconst clientIds = hasMultiSelection()\n\t\t\t\t? getMultiSelectedBlockClientIds()\n\t\t\t\t: [ panelId ];\n\n\t\t\tclientIds.forEach( ( clientId ) => {\n\t\t\t\tconst { style } = getBlockAttributes( clientId );\n\t\t\t\tlet newBlockAttributes = { style };\n\n\t\t\t\tresetFilters.forEach( ( resetFilter ) => {\n\t\t\t\t\tnewBlockAttributes = {\n\t\t\t\t\t\t...newBlockAttributes,\n\t\t\t\t\t\t...resetFilter( newBlockAttributes ),\n\t\t\t\t\t};\n\t\t\t\t} );\n\n\t\t\t\t// Enforce a cleaned style object.\n\t\t\t\tnewBlockAttributes = {\n\t\t\t\t\t...newBlockAttributes,\n\t\t\t\t\tstyle: cleanEmptyObject( newBlockAttributes.style ),\n\t\t\t\t};\n\n\t\t\t\tnewAttributes[ clientId ] = newBlockAttributes;\n\t\t\t} );\n\n\t\t\tupdateBlockAttributes( clientIds, newAttributes, true );\n\t\t},\n\t\t[\n\t\t\tgetBlockAttributes,\n\t\t\tgetMultiSelectedBlockClientIds,\n\t\t\thasMultiSelection,\n\t\t\tpanelId,\n\t\t\tupdateBlockAttributes,\n\t\t]\n\t);\n\n\treturn (\n\t\t<ToolsPanel\n\t\t\tclassName={ `${ group }-block-support-panel` }\n\t\t\tlabel={ label }\n\t\t\tresetAll={ resetAll }\n\t\t\tkey={ panelId }\n\t\t\tpanelId={ panelId }\n\t\t\thasInnerWrapper={ true }\n\t\t\tshouldRenderPlaceholderItems={ true } // Required to maintain fills ordering.\n\t\t\t__experimentalFirstVisibleItemClass=\"first\"\n\t\t\t__experimentalLastVisibleItemClass=\"last\"\n\t\t>\n\t\t\t{ children }\n\t\t</ToolsPanel>\n\t);\n}\n"],"mappings":";;;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AAC;IAEHjB,qBAAqB,CAAEa,SAAS,EAAED,aAAa,EAAE,IAAK,CAAC;EACxD,CAAC,EACD,CACCT,kBAAkB,EAClBC,8BAA8B,EAC9BE,iBAAiB,EACjBE,OAAO,EACPR,qBAAqB,CAEvB,CAAC;EAED,OACC,IAAAoB,MAAA,CAAAC,aAAA,EAAC/B,WAAA,CAAAgC,wBAAU;IACVC,SAAS,EAAI,GAAGzB,KAAO,sBAAuB;IAC9CC,KAAK,EAAGA,KAAO;IACfU,QAAQ,EAAGA,QAAU;IACrBe,GAAG,EAAGhB,OAAS;IACfA,OAAO,EAAGA,OAAS;IACnBiB,eAAe,EAAG,IAAM;IACxBC,4BAA4B,EAAG,IAAM,CAAC;IAAA;IACtCC,mCAAmC,EAAC,OAAO;IAC3CC,kCAAkC,EAAC;EAAM,GAEvC/B,QACS,CAAC;AAEf"}
1
+ {"version":3,"names":["_components","require","_data","_element","_store","_utils","_utils2","BlockSupportToolsPanel","children","group","label","updateBlockAttributes","useDispatch","blockEditorStore","getBlockAttributes","getMultiSelectedBlockClientIds","getSelectedBlockClientId","hasMultiSelection","useSelect","panelId","resetAll","useCallback","resetFilters","newAttributes","clientIds","forEach","clientId","style","newBlockAttributes","resetFilter","cleanEmptyObject","_react","createElement","__experimentalToolsPanel","className","key","hasInnerWrapper","shouldRenderPlaceholderItems","__experimentalFirstVisibleItemClass","__experimentalLastVisibleItemClass","dropdownMenuProps","TOOLSPANEL_DROPDOWNMENU_PROPS"],"sources":["@wordpress/block-editor/src/components/inspector-controls/block-support-tools-panel.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalToolsPanel as ToolsPanel } from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useCallback } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\nimport { cleanEmptyObject } from '../../hooks/utils';\nimport { TOOLSPANEL_DROPDOWNMENU_PROPS } from '../global-styles/utils';\n\nexport default function BlockSupportToolsPanel( { children, group, label } ) {\n\tconst { updateBlockAttributes } = useDispatch( blockEditorStore );\n\tconst {\n\t\tgetBlockAttributes,\n\t\tgetMultiSelectedBlockClientIds,\n\t\tgetSelectedBlockClientId,\n\t\thasMultiSelection,\n\t} = useSelect( blockEditorStore );\n\n\tconst panelId = getSelectedBlockClientId();\n\tconst resetAll = useCallback(\n\t\t( resetFilters = [] ) => {\n\t\t\tconst newAttributes = {};\n\n\t\t\tconst clientIds = hasMultiSelection()\n\t\t\t\t? getMultiSelectedBlockClientIds()\n\t\t\t\t: [ panelId ];\n\n\t\t\tclientIds.forEach( ( clientId ) => {\n\t\t\t\tconst { style } = getBlockAttributes( clientId );\n\t\t\t\tlet newBlockAttributes = { style };\n\n\t\t\t\tresetFilters.forEach( ( resetFilter ) => {\n\t\t\t\t\tnewBlockAttributes = {\n\t\t\t\t\t\t...newBlockAttributes,\n\t\t\t\t\t\t...resetFilter( newBlockAttributes ),\n\t\t\t\t\t};\n\t\t\t\t} );\n\n\t\t\t\t// Enforce a cleaned style object.\n\t\t\t\tnewBlockAttributes = {\n\t\t\t\t\t...newBlockAttributes,\n\t\t\t\t\tstyle: cleanEmptyObject( newBlockAttributes.style ),\n\t\t\t\t};\n\n\t\t\t\tnewAttributes[ clientId ] = newBlockAttributes;\n\t\t\t} );\n\n\t\t\tupdateBlockAttributes( clientIds, newAttributes, true );\n\t\t},\n\t\t[\n\t\t\tgetBlockAttributes,\n\t\t\tgetMultiSelectedBlockClientIds,\n\t\t\thasMultiSelection,\n\t\t\tpanelId,\n\t\t\tupdateBlockAttributes,\n\t\t]\n\t);\n\n\treturn (\n\t\t<ToolsPanel\n\t\t\tclassName={ `${ group }-block-support-panel` }\n\t\t\tlabel={ label }\n\t\t\tresetAll={ resetAll }\n\t\t\tkey={ panelId }\n\t\t\tpanelId={ panelId }\n\t\t\thasInnerWrapper={ true }\n\t\t\tshouldRenderPlaceholderItems={ true } // Required to maintain fills ordering.\n\t\t\t__experimentalFirstV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CAAE,CAAC;;MAEH;MACAA,kBAAkB,GAAG;QACpB,GAAGA,kBAAkB;QACrBD,KAAK,EAAE,IAAAG,uBAAgB,EAAEF,kBAAkB,CAACD,KAAM;MACnD,CAAC;MAEDJ,aAAa,CAAEG,QAAQ,CAAE,GAAGE,kBAAkB;IAC/C,CAAE,CAAC;IAEHjB,qBAAqB,CAAEa,SAAS,EAAED,aAAa,EAAE,IAAK,CAAC;EACxD,CAAC,EACD,CACCT,kBAAkB,EAClBC,8BAA8B,EAC9BE,iBAAiB,EACjBE,OAAO,EACPR,qBAAqB,CAEvB,CAAC;EAED,OACC,IAAAoB,MAAA,CAAAC,aAAA,EAAChC,WAAA,CAAAiC,wBAAU;IACVC,SAAS,EAAI,GAAGzB,KAAO,sBAAuB;IAC9CC,KAAK,EAAGA,KAAO;IACfU,QAAQ,EAAGA,QAAU;IACrBe,GAAG,EAAGhB,OAAS;IACfA,OAAO,EAAGA,OAAS;IACnBiB,eAAe,EAAG,IAAM;IACxBC,4BAA4B,EAAG,IAAM,CAAC;IAAA;IACtCC,mCAAmC,EAAC,OAAO;IAC3CC,kCAAkC,EAAC,MAAM;IACzCC,iBAAiB,EAAGC;EAA+B,GAEjDjC,QACS,CAAC;AAEf"}
@@ -10,7 +10,7 @@ var _components = require("@wordpress/components");
10
10
  var _warning = _interopRequireDefault(require("@wordpress/warning"));
11
11
  var _deprecated = _interopRequireDefault(require("@wordpress/deprecated"));
12
12
  var _element = require("@wordpress/element");
13
- var _useDisplayBlockControls = _interopRequireDefault(require("../use-display-block-controls"));
13
+ var _context = require("../block-edit/context");
14
14
  var _groups = _interopRequireDefault(require("./groups"));
15
15
  /**
16
16
  * WordPress dependencies
@@ -34,13 +34,13 @@ function InspectorControlsFill({
34
34
  });
35
35
  group = __experimentalGroup;
36
36
  }
37
- const isDisplayed = (0, _useDisplayBlockControls.default)();
37
+ const context = (0, _context.useBlockEditContext)();
38
38
  const Fill = _groups.default[group]?.Fill;
39
39
  if (!Fill) {
40
40
  typeof SCRIPT_DEBUG !== "undefined" && SCRIPT_DEBUG === true ? (0, _warning.default)(`Unknown InspectorControls group "${group}" provided.`) : void 0;
41
41
  return null;
42
42
  }
43
- if (!isDisplayed) {
43
+ if (!context[_context.mayDisplayControlsKey]) {
44
44
  return null;
45
45
  }
46
46
  return (0, _react.createElement)(_components.__experimentalStyleProvider, {
@@ -1 +1 @@
1
- {"version":3,"names":["_components","require","_warning","_interopRequireDefault","_deprecated","_element","_useDisplayBlockControls","_groups","InspectorControlsFill","children","group","__experimentalGroup","resetAllFilter","deprecated","since","version","alternative","isDisplayed","useDisplayBlockControls","Fill","groups","SCRIPT_DEBUG","warning","_react","createElement","__experimentalStyleProvider","document","fillProps","ToolsPanelInspectorControl","RegisterResetAll","registerResetAllFilter","deregisterResetAllFilter","useContext","ToolsPanelContext","useEffect","forwardedContext","innerMarkup","reduce","inner","Provider","props"],"sources":["@wordpress/block-editor/src/components/inspector-controls/fill.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalStyleProvider as StyleProvider,\n\t__experimentalToolsPanelContext as ToolsPanelContext,\n} from '@wordpress/components';\nimport warning from '@wordpress/warning';\nimport deprecated from '@wordpress/deprecated';\nimport { useEffect, useContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport useDisplayBlockControls from '../use-display-block-controls';\nimport groups from './groups';\n\nexport default function InspectorControlsFill( {\n\tchildren,\n\tgroup = 'default',\n\t__experimentalGroup,\n\tresetAllFilter,\n} ) {\n\tif ( __experimentalGroup ) {\n\t\tdeprecated(\n\t\t\t'`__experimentalGroup` property in `InspectorControlsFill`',\n\t\t\t{\n\t\t\t\tsince: '6.2',\n\t\t\t\tversion: '6.4',\n\t\t\t\talternative: '`group`',\n\t\t\t}\n\t\t);\n\t\tgroup = __experimentalGroup;\n\t}\n\n\tconst isDisplayed = useDisplayBlockControls();\n\tconst Fill = groups[ group ]?.Fill;\n\tif ( ! Fill ) {\n\t\twarning( `Unknown InspectorControls group \"${ group }\" provided.` );\n\t\treturn null;\n\t}\n\tif ( ! isDisplayed ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<StyleProvider document={ document }>\n\t\t\t<Fill>\n\t\t\t\t{ ( fillProps ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<ToolsPanelInspectorControl\n\t\t\t\t\t\t\tfillProps={ fillProps }\n\t\t\t\t\t\t\tchildren={ children }\n\t\t\t\t\t\t\tresetAllFilter={ resetAllFilter }\n\t\t\t\t\t\t/>\n\t\t\t\t\t);\n\t\t\t\t} }\n\t\t\t</Fill>\n\t\t</StyleProvider>\n\t);\n}\n\nfunction RegisterResetAll( { resetAllFilter, children } ) {\n\tconst { registerResetAllFilter, deregisterResetAllFilter } =\n\t\tuseContext( ToolsPanelContext );\n\tuseEffect( () => {\n\t\tif (\n\t\t\tresetAllFilter &&\n\t\t\tregisterResetAllFilter &&\n\t\t\tderegisterResetAllFilter\n\t\t) {\n\t\t\tregisterResetAllFilter( resetAllFilter );\n\t\t\treturn () => {\n\t\t\t\tderegisterResetAllFilter( resetAllFilter );\n\t\t\t};\n\t\t}\n\t}, [ resetAllFilter, registerResetAllFilter, deregisterResetAllFilter ] );\n\treturn children;\n}\n\nfunction ToolsPanelInspectorControl( { children, resetAllFilter, fillProps } ) {\n\t// `fillProps.forwardedContext` is an array of context provider entries, provided by slot,\n\t// that should wrap the fill markup.\n\tconst { forwardedContext = [] } = fillProps;\n\n\t// Children passed to InspectorControlsFill will not have\n\t// access to any React Context whose Provider is part of\n\t// the InspectorControlsSlot tree. So we re-create the\n\t// Provider in this subtree.\n\tconst innerMarkup = (\n\t\t<RegisterResetAll resetAllFilter={ resetAllFilter }>\n\t\t\t{ children }\n\t\t</RegisterResetAll>\n\t);\n\treturn forwardedContext.reduce(\n\t\t( inner, [ Provider, props ] ) => (\n\t\t\t<Provider { ...props }>{ inner }</Provider>\n\t\t),\n\t\tinnerMarkup\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IA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AgBA,CAAE;EAAEjB,cAAc;EAAEH;AAAS,CAAC,EAAG;EACzD,MAAM;IAAEqB,sBAAsB;IAAEC;EAAyB,CAAC,GACzD,IAAAC,mBAAU,EAAEC,2CAAkB,CAAC;EAChC,IAAAC,kBAAS,EAAE,MAAM;IAChB,IACCtB,cAAc,IACdkB,sBAAsB,IACtBC,wBAAwB,EACvB;MACDD,sBAAsB,CAAElB,cAAe,CAAC;MACxC,OAAO,MAAM;QACZmB,wBAAwB,CAAEnB,cAAe,CAAC;MAC3C,CAAC;IACF;EACD,CAAC,EAAE,CAAEA,cAAc,EAAEkB,sBAAsB,EAAEC,wBAAwB,CAAG,CAAC;EACzE,OAAOtB,QAAQ;AAChB;AAEA,SAASmB,0BAA0BA,CAAE;EAAEnB,QAAQ;EAAEG,cAAc;EAAEe;AAAU,CAAC,EAAG;EAC9E;EACA;EACA,MAAM;IAAEQ,gBAAgB,GAAG;EAAG,CAAC,GAAGR,SAAS;;EAE3C;EACA;EACA;EACA;EACA,MAAMS,WAAW,GAChB,IAAAb,MAAA,CAAAC,aAAA,EAACK,gBAAgB;IAACjB,cAAc,EAAGA;EAAgB,GAChDH,QACe,CAClB;EACD,OAAO0B,gBAAgB,CAACE,MAAM,CAC7B,CAAEC,KAAK,EAAE,CAAEC,QAAQ,EAAEC,KAAK,CAAE,KAC3B,IAAAjB,MAAA,CAAAC,aAAA,EAACe,QAAQ;IAAA,GAAMC;EAAK,GAAKF,KAAiB,CAC1C,EACDF,WACD,CAAC;AACF"}
1
+ {"version":3,"names":["_components","require","_warning","_interopRequireDefault","_deprecated","_element","_context","_groups","InspectorControlsFill","children","group","__experimentalGroup","resetAllFilter","deprecated","since","version","alternative","context","useBlockEditContext","Fill","groups","SCRIPT_DEBUG","warning","mayDisplayControlsKey","_react","createElement","__experimentalStyleProvider","document","fillProps","ToolsPanelInspectorControl","RegisterResetAll","registerResetAllFilter","deregisterResetAllFilter","useContext","ToolsPanelContext","useEffect","forwardedContext","innerMarkup","reduce","inner","Provider","props"],"sources":["@wordpress/block-editor/src/components/inspector-controls/fill.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalStyleProvider as StyleProvider,\n\t__experimentalToolsPanelContext as ToolsPanelContext,\n} from '@wordpress/components';\nimport warning from '@wordpress/warning';\nimport deprecated from '@wordpress/deprecated';\nimport { useEffect, useContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport {\n\tuseBlockEditContext,\n\tmayDisplayControlsKey,\n} from '../block-edit/context';\nimport groups from './groups';\n\nexport default function InspectorControlsFill( {\n\tchildren,\n\tgroup = 'default',\n\t__experimentalGroup,\n\tresetAllFilter,\n} ) {\n\tif ( __experimentalGroup ) {\n\t\tdeprecated(\n\t\t\t'`__experimentalGroup` property in `InspectorControlsFill`',\n\t\t\t{\n\t\t\t\tsince: '6.2',\n\t\t\t\tversion: '6.4',\n\t\t\t\talternative: '`group`',\n\t\t\t}\n\t\t);\n\t\tgroup = __experimentalGroup;\n\t}\n\n\tconst context = useBlockEditContext();\n\tconst Fill = groups[ group ]?.Fill;\n\tif ( ! Fill ) {\n\t\twarning( `Unknown InspectorControls group \"${ group }\" provided.` );\n\t\treturn null;\n\t}\n\tif ( ! context[ mayDisplayControlsKey ] ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<StyleProvider document={ document }>\n\t\t\t<Fill>\n\t\t\t\t{ ( fillProps ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<ToolsPanelInspectorControl\n\t\t\t\t\t\t\tfillProps={ fillProps }\n\t\t\t\t\t\t\tchildren={ children }\n\t\t\t\t\t\t\tresetAllFilter={ resetAllFilter }\n\t\t\t\t\t\t/>\n\t\t\t\t\t);\n\t\t\t\t} }\n\t\t\t</Fill>\n\t\t</StyleProvider>\n\t);\n}\n\nfunction RegisterResetAll( { resetAllFilter, children } ) {\n\tconst { registerResetAllFilter, deregisterResetAllFilter } =\n\t\tuseContext( ToolsPanelContext );\n\tuseEffect( () => {\n\t\tif (\n\t\t\tresetAllFilter &&\n\t\t\tregisterResetAllFilter &&\n\t\t\tderegisterResetAllFilter\n\t\t) {\n\t\t\tregisterResetAllFilter( resetAllFilter );\n\t\t\treturn () => {\n\t\t\t\tderegisterResetAllFilter( resetAllFilter );\n\t\t\t};\n\t\t}\n\t}, [ resetAllFilter, registerResetAllFilter, deregisterResetAllFilter ] );\n\treturn children;\n}\n\nfunction ToolsPanelInspectorControl( { children, resetAllFilter, fillProps } ) {\n\t// `fillProps.forwardedContext` is an array of context provider entries, provided by slot,\n\t// that should wrap the fill markup.\n\tconst { forwardedContext = [] } = fillProps;\n\n\t// Children passed to InspectorControlsFill will not have\n\t// access to any React Context whose Provider is part of\n\t// the InspectorControlsSlot tree. So we re-create the\n\t// Provider in this subtree.\n\tconst innerMarkup = (\n\t\t<RegisterResetAll resetAllFilter={ resetAllFilter }>\n\t\t\t{ children }\n\t\t</RegisterResetAll>\n\t);\n\treturn forwardedContext.reduce(\n\t\t( inner, [ Provider, props ] ) => (\n\t\t\t<Provider { ...props }>{ inner }</Provider>\n\t\t),\n\t\tinnerMarkup\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AAIA,IAAAC,QAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,WAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AAKA,IAAAK,QAAA,GAAAL,OAAA;AAIA,IAAAM,OAAA,GAAAJ,sBAAA,CAAAF,OAAA;AAlBA;AACA;AACA;;AASA;AACA;AACA;;AAOe,SAASO,qBAAqBA,CAAE;EAC9CC,QAAQ;EACRC,KAAK,GAAG,SAAS;EACjBC,mBAAmB;EACnBC;AACD,CAAC,EAAG;EACH,IAAKD,mBAAmB,EAAG;IAC1B,IAAAE,mBAAU,EACT,2DAA2D,EAC3D;MACCC,KAAK,EAAE,KAAK;MACZC,OAAO,EAAE,KAAK;MACdC,WAAW,EAAE;IACd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gB;AAAU,CAAC,EAAG;EAC9E;EACA;EACA,MAAM;IAAEQ,gBAAgB,GAAG;EAAG,CAAC,GAAGR,SAAS;;EAE3C;EACA;EACA;EACA;EACA,MAAMS,WAAW,GAChB,IAAAb,MAAA,CAAAC,aAAA,EAACK,gBAAgB;IAAClB,cAAc,EAAGA;EAAgB,GAChDH,QACe,CAClB;EACD,OAAO2B,gBAAgB,CAACE,MAAM,CAC7B,CAAEC,KAAK,EAAE,CAAEC,QAAQ,EAAEC,KAAK,CAAE,KAC3B,IAAAjB,MAAA,CAAAC,aAAA,EAACe,QAAQ;IAAA,GAAMC;EAAK,GAAKF,KAAiB,CAC1C,EACDF,WACD,CAAC;AACF"}
@@ -12,7 +12,7 @@ var _components = require("@wordpress/components");
12
12
  var _warning = _interopRequireDefault(require("@wordpress/warning"));
13
13
  var _deprecated = _interopRequireDefault(require("@wordpress/deprecated"));
14
14
  var _groups = _interopRequireDefault(require("./groups"));
15
- var _useDisplayBlockControls = _interopRequireDefault(require("../use-display-block-controls"));
15
+ var _context = require("../block-edit/context");
16
16
  var _blockSettings = require("../block-settings");
17
17
  /**
18
18
  * External dependencies
@@ -40,13 +40,13 @@ function InspectorControlsFill({
40
40
  });
41
41
  group = __experimentalGroup;
42
42
  }
43
- const isDisplayed = (0, _useDisplayBlockControls.default)();
43
+ const context = (0, _context.useBlockEditContext)();
44
44
  const Fill = _groups.default[group]?.Fill;
45
45
  if (!Fill) {
46
46
  typeof SCRIPT_DEBUG !== "undefined" && SCRIPT_DEBUG === true ? (0, _warning.default)(`Unknown InspectorControls group "${group}" provided.`) : void 0;
47
47
  return null;
48
48
  }
49
- if (!isDisplayed) {
49
+ if (!context[_context.mayDisplayControlsKey]) {
50
50
  return null;
51
51
  }
52
52
  return (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(Fill, {
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNative","require","_element","_components","_warning","_interopRequireDefault","_deprecated","_groups","_useDisplayBlockControls","_blockSettings","InspectorControlsFill","children","group","__experimentalGroup","props","deprecated","since","version","alternative","isDisplayed","useDisplayBlockControls","Fill","groups","SCRIPT_DEBUG","warning","_react","createElement","Fragment","BottomSheetConsumer","View","Children","count","BlockSettingsButton"],"sources":["@wordpress/block-editor/src/components/inspector-controls/fill.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { View } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { Children } from '@wordpress/element';\nimport { BottomSheetConsumer } from '@wordpress/components';\nimport warning from '@wordpress/warning';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport groups from './groups';\nimport useDisplayBlockControls from '../use-display-block-controls';\nimport { BlockSettingsButton } from '../block-settings';\n\nexport default function InspectorControlsFill( {\n\tchildren,\n\tgroup = 'default',\n\t__experimentalGroup,\n\t...props\n} ) {\n\tif ( __experimentalGroup ) {\n\t\tdeprecated(\n\t\t\t'`__experimentalGroup` property in `InspectorControlsFill`',\n\t\t\t{\n\t\t\t\tsince: '6.2',\n\t\t\t\tversion: '6.4',\n\t\t\t\talternative: '`group`',\n\t\t\t}\n\t\t);\n\t\tgroup = __experimentalGroup;\n\t}\n\tconst isDisplayed = useDisplayBlockControls();\n\n\tconst Fill = groups[ group ]?.Fill;\n\tif ( ! Fill ) {\n\t\twarning( `Unknown InspectorControls group \"${ group }\" provided.` );\n\t\treturn null;\n\t}\n\tif ( ! isDisplayed ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<Fill { ...props }>\n\t\t\t\t{\n\t\t\t\t\t<BottomSheetConsumer>\n\t\t\t\t\t\t{ () => <View>{ children }</View> }\n\t\t\t\t\t</BottomSheetConsumer>\n\t\t\t\t}\n\t\t\t</Fill>\n\t\t\t{ Children.count( children ) > 0 && <BlockSettingsButton /> }\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IA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B,QAAS,CAAC,GAAG,CAAC,IAAI,IAAAc,MAAA,CAAAC,aAAA,EAACjB,cAAA,CAAAuB,mBAAmB,MAAE,CACzD,CAAC;AAEL"}
1
+ {"version":3,"names":["_reactNative","require","_element","_components","_warning","_interopRequireDefault","_deprecated","_groups","_context","_blockSettings","InspectorControlsFill","children","group","__experimentalGroup","props","deprecated","since","version","alternative","context","useBlockEditContext","Fill","groups","SCRIPT_DEBUG","warning","mayDisplayControlsKey","_react","createElement","Fragment","BottomSheetConsumer","View","Children","count","BlockSettingsButton"],"sources":["@wordpress/block-editor/src/components/inspector-controls/fill.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { View } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { Children } from '@wordpress/element';\nimport { BottomSheetConsumer } from '@wordpress/components';\nimport warning from '@wordpress/warning';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport groups from './groups';\nimport {\n\tuseBlockEditContext,\n\tmayDisplayControlsKey,\n} from '../block-edit/context';\nimport { BlockSettingsButton } from '../block-settings';\n\nexport default function InspectorControlsFill( {\n\tchildren,\n\tgroup = 'default',\n\t__experimentalGroup,\n\t...props\n} ) {\n\tif ( __experimentalGroup ) {\n\t\tdeprecated(\n\t\t\t'`__experimentalGroup` property in `InspectorControlsFill`',\n\t\t\t{\n\t\t\t\tsince: '6.2',\n\t\t\t\tversion: '6.4',\n\t\t\t\talternative: '`group`',\n\t\t\t}\n\t\t);\n\t\tgroup = __experimentalGroup;\n\t}\n\tconst context = useBlockEditContext();\n\n\tconst Fill = groups[ group ]?.Fill;\n\tif ( ! Fill ) {\n\t\twarning( `Unknown InspectorControls group \"${ group }\" provided.` );\n\t\treturn null;\n\t}\n\tif ( ! context[ mayDisplayControlsKey ] ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<Fill { ...props }>\n\t\t\t\t{\n\t\t\t\t\t<BottomSheetConsumer>\n\t\t\t\t\t\t{ () =>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EAACN,IAAI;IAAA,GAAMP;EAAK,GAEd,IAAAY,MAAA,CAAAC,aAAA,EAACxB,WAAA,CAAA0B,mBAAmB,QACjB,MAAM,IAAAH,MAAA,CAAAC,aAAA,EAAC3B,YAAA,CAAA8B,IAAI,QAAGnB,QAAgB,CACZ,CAEjB,CAAC,EACLoB,iBAAQ,CAACC,KAAK,CAAErB,QAAS,CAAC,GAAG,CAAC,IAAI,IAAAe,MAAA,CAAAC,aAAA,EAAClB,cAAA,CAAAwB,mBAAmB,MAAE,CACzD,CAAC;AAEL"}
@@ -12,6 +12,7 @@ var _settingsTab = _interopRequireDefault(require("./settings-tab"));
12
12
  var _stylesTab = _interopRequireDefault(require("./styles-tab"));
13
13
  var _inspectorControls = _interopRequireDefault(require("../inspector-controls"));
14
14
  var _useIsListViewTabDisabled = _interopRequireDefault(require("./use-is-list-view-tab-disabled"));
15
+ var _lockUnlock = require("../../lock-unlock");
15
16
  /**
16
17
  * WordPress dependencies
17
18
  */
@@ -20,6 +21,9 @@ var _useIsListViewTabDisabled = _interopRequireDefault(require("./use-is-list-vi
20
21
  * Internal dependencies
21
22
  */
22
23
 
24
+ const {
25
+ Tabs
26
+ } = (0, _lockUnlock.unlock)(_components.privateApis);
23
27
  function InspectorControlsTabs({
24
28
  blockName,
25
29
  clientId,
@@ -32,29 +36,36 @@ function InspectorControlsTabs({
32
36
  // which at the time is the first tab. This check allows blocks known to
33
37
  // include the list view tab to set it as the tab selected by default.
34
38
  const initialTabName = !(0, _useIsListViewTabDisabled.default)(blockName) ? _utils.TAB_LIST_VIEW.name : undefined;
35
- return (0, _react.createElement)(_components.TabPanel, {
36
- className: "block-editor-block-inspector__tabs",
37
- tabs: tabs,
38
- initialTabName: initialTabName,
39
+ return (0, _react.createElement)("div", {
40
+ className: "block-editor-block-inspector__tabs"
41
+ }, (0, _react.createElement)(Tabs, {
42
+ initialTabId: initialTabName,
39
43
  key: clientId
40
- }, tab => {
41
- if (tab.name === _utils.TAB_SETTINGS.name) {
42
- return (0, _react.createElement)(_settingsTab.default, {
43
- showAdvancedControls: !!blockName
44
- });
45
- }
46
- if (tab.name === _utils.TAB_STYLES.name) {
47
- return (0, _react.createElement)(_stylesTab.default, {
48
- blockName: blockName,
49
- clientId: clientId,
50
- hasBlockStyles: hasBlockStyles
51
- });
52
- }
53
- if (tab.name === _utils.TAB_LIST_VIEW.name) {
54
- return (0, _react.createElement)(_inspectorControls.default.Slot, {
55
- group: "list"
56
- });
57
- }
58
- });
44
+ }, (0, _react.createElement)(Tabs.TabList, null, tabs.map(tab => (0, _react.createElement)(Tabs.Tab, {
45
+ key: tab.name,
46
+ tabId: tab.name,
47
+ render: (0, _react.createElement)(_components.Button, {
48
+ icon: tab.icon,
49
+ label: tab.title,
50
+ className: tab.className
51
+ })
52
+ }))), (0, _react.createElement)(Tabs.TabPanel, {
53
+ tabId: _utils.TAB_SETTINGS.name,
54
+ focusable: false
55
+ }, (0, _react.createElement)(_settingsTab.default, {
56
+ showAdvancedControls: !!blockName
57
+ })), (0, _react.createElement)(Tabs.TabPanel, {
58
+ tabId: _utils.TAB_STYLES.name,
59
+ focusable: false
60
+ }, (0, _react.createElement)(_stylesTab.default, {
61
+ blockName: blockName,
62
+ clientId: clientId,
63
+ hasBlockStyles: hasBlockStyles
64
+ })), (0, _react.createElement)(Tabs.TabPanel, {
65
+ tabId: _utils.TAB_LIST_VIEW.name,
66
+ focusable: false
67
+ }, (0, _react.createElement)(_inspectorControls.default.Slot, {
68
+ group: "list"
69
+ }))));
59
70
  }
60
71
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_components","require","_utils","_settingsTab","_interopRequireDefault","_stylesTab","_inspectorControls","_useIsListViewTabDisabled","InspectorControlsTabs","blockName","clientId","hasBlockStyles","tabs","initialTabName","useIsListViewTabDisabled","TAB_LIST_VIEW","name","undefined","_react","createElement","TabPanel","className","key","tab","TAB_SETTINGS","default","showAdvancedControls","TAB_STYLES","Slot","group"],"sources":["@wordpress/block-editor/src/components/inspector-controls-tabs/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { TabPanel } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { TAB_SETTINGS, TAB_STYLES, TAB_LIST_VIEW } from './utils';\nimport SettingsTab from './settings-tab';\nimport StylesTab from './styles-tab';\nimport InspectorControls from '../inspector-controls';\nimport useIsListViewTabDisabled from './use-is-list-view-tab-disabled';\n\nexport default function InspectorControlsTabs( {\n\tblockName,\n\tclientId,\n\thasBlockStyles,\n\ttabs,\n} ) {\n\t// The tabs panel will mount before fills are rendered to the list view\n\t// slot. This means the list view tab isn't initially included in the\n\t// available tabs so the panel defaults selection to the settings tab\n\t// which at the time is the first tab. This check allows blocks known to\n\t// include the list view tab to set it as the tab selected by default.\n\tconst initialTabName = ! useIsListViewTabDisabled( blockName )\n\t\t? TAB_LIST_VIEW.name\n\t\t: undefined;\n\treturn (\n\t\t<TabPanel\n\t\t\tclassName=\"block-editor-block-inspector__tabs\"\n\t\t\ttabs={ tabs }\n\t\t\tinitialTabName={ initialTabName }\n\t\t\tkey={ clientId }\n\t\t>\n\t\t\t{ ( tab ) => {\n\t\t\t\tif ( tab.name === TAB_SETTINGS.name ) {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<SettingsTab showAdvancedControls={ !! blockName } />\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tif ( tab.name === TAB_STYLES.name ) {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<StylesTab\n\t\t\t\t\t\t\tblockName={ blockName }\n\t\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\t\thasBlockStyles={ hasBlockStyles }\n\t\t\t\t\t\t/>\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tif ( tab.name === TAB_LIST_VIEW.name ) {\n\t\t\t\t\treturn <InspectorControls.Slot group=\"list\" />;\n\t\t\t\t}\n\t\t\t} }\n\t\t</TabPanel>\n\t);\n}\n"],"mappings":";;;;;;;;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AAAmB,OAAiB,CAACG,IAAI;QAACC,KAAK,EAAC;MAAM,CAAE,CAAC;IAC/C;EACD,CACS,CAAC;AAEb"}
1
+ {"version":3,"names":["_components","require","_utils","_settingsTab","_interopRequireDefault","_stylesTab","_inspectorControls","_useIsListViewTabDisabled","_lockUnlock","Tabs","unlock","componentsPrivateApis","InspectorControlsTabs","blockName","clientId","hasBlockStyles","tabs","initialTabName","useIsListViewTabDisabled","TAB_LIST_VIEW","name","undefined","_react","createElement","className","initialTabId","key","TabList","map","tab","Tab","tabId","render","Button","icon","label","title","TabPanel","TAB_SETTINGS","focusable","default","showAdvancedControls","TAB_STYLES","Slot","group"],"sources":["@wordpress/block-editor/src/components/inspector-controls-tabs/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tButton,\n\tprivateApis as componentsPrivateApis,\n} from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { TAB_SETTINGS, TAB_STYLES, TAB_LIST_VIEW } from './utils';\nimport SettingsTab from './settings-tab';\nimport StylesTab from './styles-tab';\nimport InspectorControls from '../inspector-controls';\nimport useIsListViewTabDisabled from './use-is-list-view-tab-disabled';\nimport { unlock } from '../../lock-unlock';\n\nconst { Tabs } = unlock( componentsPrivateApis );\n\nexport default function InspectorControlsTabs( {\n\tblockName,\n\tclientId,\n\thasBlockStyles,\n\ttabs,\n} ) {\n\t// The tabs panel will mount before fills are rendered to the list view\n\t// slot. This means the list view tab isn't initially included in the\n\t// available tabs so the panel defaults selection to the settings tab\n\t// which at the time is the first tab. This check allows blocks known to\n\t// include the list view tab to set it as the tab selected by default.\n\tconst initialTabName = ! useIsListViewTabDisabled( blockName )\n\t\t? TAB_LIST_VIEW.name\n\t\t: undefined;\n\n\treturn (\n\t\t<div className=\"block-editor-block-inspector__tabs\">\n\t\t\t<Tabs initialTabId={ initialTabName } key={ clientId }>\n\t\t\t\t<Tabs.TabList>\n\t\t\t\t\t{ tabs.map( ( tab ) => (\n\t\t\t\t\t\t<Tabs.Tab\n\t\t\t\t\t\t\tkey={ tab.name }\n\t\t\t\t\t\t\ttabId={ tab.name }\n\t\t\t\t\t\t\trender={\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\ticon={ tab.icon }\n\t\t\t\t\t\t\t\t\tlabel={ tab.title }\n\t\t\t\t\t\t\t\t\tclassName={ tab.className }\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) ) }\n\t\t\t\t</Tabs.TabList>\n\t\t\t\t<Tabs.TabPanel tabId={ TAB_SETTINGS.name } focusable={ false }>\n\t\t\t\t\t<SettingsTab showAdvancedControls={ !! blockName } />\n\t\t\t\t</Tabs.TabPanel>\n\t\t\t\t<Tabs.TabPanel tabId={ TAB_STYLES.name } focusable={ false }>\n\t\t\t\t\t<StylesTab\n\t\t\t\t\t\tblockName={ blockName }\n\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\thasBlockStyles={ hasBlockStyles }\n\t\t\t\t\t/>\n\t\t\t\t</Tabs.TabPanel>\n\t\t\t\t<Tabs.TabPanel tabId={ TAB_LIST_VIEW.name } focusable={ false }>\n\t\t\t\t\t<InspectorControls.Slot group=\"list\" />\n\t\t\t\t</Tabs.TabPanel>\n\t\t\t</Tabs>\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AAQA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,UAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,kBAAA,GAAAF,sBAAA,CAAAH,OAAA;AACA,IAAAM,yBAAA,GAAAH,sBAAA,CAAAH,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA;AAhBA;AACA;AACA;;AAMA;AACA;AACA;;AAQA,MAAM;EAAEQ;AAAK,CAAC,GAAG,IAAAC,kBAAM,EAAEC,uBAAsB,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A,CAAAC,aAAA,EAAClB,UAAA,CAAAmC,OAAS;IACT3B,SAAS,EAAGA,SAAW;IACvBC,QAAQ,EAAGA,QAAU;IACrBC,cAAc,EAAGA;EAAgB,CACjC,CACa,CAAC,EAChB,IAAAO,MAAA,CAAAC,aAAA,EAACd,IAAI,CAAC4B,QAAQ;IAACN,KAAK,EAAGZ,oBAAa,CAACC,IAAM;IAACmB,SAAS,EAAG;EAAO,GAC9D,IAAAjB,MAAA,CAAAC,aAAA,EAACjB,kBAAA,CAAAkC,OAAiB,CAACG,IAAI;IAACC,KAAK,EAAC;EAAM,CAAE,CACxB,CACV,CACF,CAAC;AAER"}
@@ -42,6 +42,8 @@ function ListViewBlockSelectButton({
42
42
  clientId
43
43
  },
44
44
  onClick,
45
+ onContextMenu,
46
+ onMouseDown,
45
47
  onToggleExpanded,
46
48
  tabIndex,
47
49
  onFocus,
@@ -204,7 +206,9 @@ function ListViewBlockSelectButton({
204
206
  return (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(_components.Button, {
205
207
  className: (0, _classnames.default)('block-editor-list-view-block-select-button', className),
206
208
  onClick: onClick,
209
+ onContextMenu: onContextMenu,
207
210
  onKeyDown: onKeyDownHandler,
211
+ onMouseDown: onMouseDown,
208
212
  ref: ref,
209
213
  tabIndex: tabIndex,
210
214
  onFocus: onFocus,
@@ -1 +1 @@
1
- {"version":3,"names":["_classnames","_interopRequireDefault","require","_blocks","_components","_element","_icons","_keycodes","_data","_keyboardShortcuts","_i18n","_isShallowEqual","_blockIcon","_useBlockDisplayInformation","_useBlockDisplayTitle","_expander","_blockLock","_store","_useListViewImages","_context","ListViewBlockSelectButton","className","block","clientId","onClick","onToggleExpanded","tabIndex","onFocus","onDragStart","onDragEnd","draggable","isExpanded","ariaLabel","ariaDescribedBy","updateFocusAndSelection","ref","blockInformation","useBlockDisplayInformation","blockTitle","useBlockDisplayTitle","context","isLocked","useBlockLock","canInsertBlockType","getSelectedBlockClientIds","getPreviousBlockClientId","getBlockRootClientId","getBlockOrder","getBlocksByClientId","canRemoveBlocks","useSelect","blockEditorStore","duplicateBlocks","multiSelect","removeBlocks","useDispatch","isMatch","useShortcutEventMatch","isSticky","positionType","images","useListViewImages","rootClientId","useListViewContext","positionLabel","sprintf","__","onDragStartHandler","event","dataTransfer","clearData","getBlocksToUpdate","selectedBlockClientIds","isUpdatingSelectedBlocks","includes","firstBlockClientId","firstBlockRootClientId","blocksToUpdate","onKeyDownHandler","keyCode","ENTER","SPACE","BACKSPACE","DELETE","_getPreviousBlockClie","blocksToDelete","blockToFocus","shouldUpdateSelection","length","defaultPrevented","preventDefault","canDuplicate","every","hasBlockSupport","name","updatedBlocks","blockClientIds","isShallowEqual","_react","createElement","Fragment","Button","classnames","onKeyDown","href","default","icon","showColors","__experimentalHStack","alignment","justify","spacing","__experimentalTruncate","ellipsizeMode","anchor","Tooltip","text","Icon","pinSmall","map","image","index","key","style","backgroundImage","url","zIndex","lock","_default","forwardRef","exports"],"sources":["@wordpress/block-editor/src/components/list-view/block-select-button.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { hasBlockSupport } from '@wordpress/blocks';\nimport {\n\tButton,\n\t__experimentalHStack as HStack,\n\t__experimentalTruncate as Truncate,\n\tTooltip,\n} from '@wordpress/components';\nimport { forwardRef } from '@wordpress/element';\nimport { Icon, lockSmall as lock, pinSmall } from '@wordpress/icons';\nimport { SPACE, ENTER, BACKSPACE, DELETE } from '@wordpress/keycodes';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __unstableUseShortcutEventMatch as useShortcutEventMatch } from '@wordpress/keyboard-shortcuts';\nimport { __, sprintf } from '@wordpress/i18n';\nimport isShallowEqual from '@wordpress/is-shallow-equal';\n\n/**\n * Internal dependencies\n */\nimport BlockIcon from '../block-icon';\nimport useBlockDisplayInformation from '../use-block-display-information';\nimport useBlockDisplayTitle from '../block-title/use-block-display-title';\nimport ListViewExpander from './expander';\nimport { useBlockLock } from '../block-lock';\nimport { store as blockEditorStore } from '../../store';\nimport useListViewImages from './use-list-view-images';\nimport { useListViewContext } from './context';\n\nfunction ListViewBlockSelectButton(\n\t{\n\t\tclassName,\n\t\tblock: { clientId },\n\t\tonClick,\n\t\tonToggleExpanded,\n\t\ttabIndex,\n\t\tonFocus,\n\t\tonDragStart,\n\t\tonDragEnd,\n\t\tdraggable,\n\t\tisExpanded,\n\t\tariaLabel,\n\t\tariaDescribedBy,\n\t\tupdateFocusAndSelection,\n\t},\n\tref\n) {\n\tconst blockInformation = useBlockDisplayInformation( clientId );\n\tconst blockTitle = useBlockDisplayTitle( {\n\t\tclientId,\n\t\tcontext: 'list-view',\n\t} );\n\tconst { isLocked } = useBlockLock( clientId );\n\tconst {\n\t\tcanInsertBlockType,\n\t\tgetSelectedBlockClientIds,\n\t\tgetPreviousBlockClientId,\n\t\tgetBlockRootClientId,\n\t\tgetBlockOrder,\n\t\tgetBlocksByClientId,\n\t\tcanRemoveBlocks,\n\t} = useSelect( blockEditorStore );\n\tconst { duplicateBlocks, multiSelect, removeBlocks } =\n\t\tuseDispatch( blockEditorStore );\n\tconst isMatch = useShortcutEventMatch();\n\tconst isSticky = blockInformation?.positionType === 'sticky';\n\tconst images = useListViewImages( { clientId, isExpanded } );\n\tconst { rootClientId } = useListViewContext();\n\n\tconst positionLabel = blockInformation?.positionLabel\n\t\t? sprintf(\n\t\t\t\t// translators: 1: Position of selected block, e.g. \"Sticky\" or \"Fixed\".\n\t\t\t\t__( 'Position: %1$s' ),\n\t\t\t\tblockInformation.positionLabel\n\t\t )\n\t\t: '';\n\n\t// The `href` attribute triggers the browser's native HTML drag operations.\n\t// When the link is dragged, the element's outerHTML is set in DataTransfer object as text/html.\n\t// We need to clear any HTML drag data to prevent `pasteHandler` from firing\n\t// inside the `useOnBlockDrop` hook.\n\tconst onDragStartHandler = ( event ) => {\n\t\tevent.dataTransfer.clearData();\n\t\tonDragStart?.( event );\n\t};\n\n\t// Determine which blocks to update:\n\t// If the current (focused) block is part of the block selection, use the whole selection.\n\t// If the focused block is not part of the block selection, only update the focused block.\n\tfunction getBlocksToUpdate() {\n\t\tconst selectedBlockClientIds = getSelectedBlockClientIds();\n\t\tconst isUpdatingSelectedBlocks =\n\t\t\tselectedBlockClientIds.includes( clientId );\n\t\tconst firstBlockClientId = isUpdatingSelectedBlocks\n\t\t\t? selectedBlockClientIds[ 0 ]\n\t\t\t: clientId;\n\t\tconst firstBlockRootClientId =\n\t\t\tgetBlockRootClientId( firstBlockClientId );\n\n\t\tconst blocksToUpdate = isUpdatingSelectedBlocks\n\t\t\t? selectedBlockClientIds\n\t\t\t: [ clientId ];\n\n\t\treturn {\n\t\t\tblocksToUpdate,\n\t\t\tfirstBlockClientId,\n\t\t\tfirstBlockRootClientId,\n\t\t\tselectedBlockClientIds,\n\t\t};\n\t}\n\n\t/**\n\t * @param {KeyboardEvent} event\n\t */\n\tasync function onKeyDownHandler( event ) {\n\t\tif ( event.keyCode === ENTER || event.keyCode === SPACE ) {\n\t\t\tonClick( event );\n\t\t} else if (\n\t\t\tevent.keyCode === BACKSPACE ||\n\t\t\tevent.keyCode === DELETE ||\n\t\t\tisMatch( 'core/block-editor/remove', event )\n\t\t) {\n\t\t\tconst {\n\t\t\t\tblocksToUpdate: blocksToDelete,\n\t\t\t\tfirstBlockClientId,\n\t\t\t\tfirstBlockRootClientId,\n\t\t\t\tselectedBlockClientIds,\n\t\t\t} = getBlocksToUpdate();\n\n\t\t\t// Don't update the selection if the blocks cannot be deleted.\n\t\t\tif ( ! canRemoveBlocks( blocksToDelete, firstBlockRootClientId ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tlet blockToFocus =\n\t\t\t\tgetPreviousBlockClientId( firstBlockClientId ) ??\n\t\t\t\t// If the previous block is not found (when the first block is deleted),\n\t\t\t\t// fallback to focus the parent block.\n\t\t\t\tfirstBlockRootClientId;\n\n\t\t\tremoveBlocks( blocksToDelete, false );\n\n\t\t\t// Update the selection if the original selection has been removed.\n\t\t\tconst shouldUpdateSelection =\n\t\t\t\tselectedBlockClientIds.length > 0 &&\n\t\t\t\tgetSelectedBlockClientIds().length === 0;\n\n\t\t\t// If there's no previous block nor parent block, focus the first block.\n\t\t\tif ( ! blockToFocus ) {\n\t\t\t\tblockToFocus = getBlockOrder()[ 0 ];\n\t\t\t}\n\n\t\t\tupdateFocusAndSelection( blockToFocus, shouldUpdateSelection );\n\t\t} else if ( isMatch( 'core/block-editor/duplicate', event ) ) {\n\t\t\tif ( event.defaultPrevented ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tevent.preventDefault();\n\n\t\t\tconst { blocksToUpdate, firstBlockRootClientId } =\n\t\t\t\tgetBlocksToUpdate();\n\n\t\t\tconst canDuplicate = getBlocksByClientId( blocksToUpdate ).every(\n\t\t\t\t( block ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t!! block &&\n\t\t\t\t\t\thasBlockSupport( block.name, 'multiple', true ) &&\n\t\t\t\t\t\tcanInsertBlockType( block.name, firstBlockRootClientId )\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tif ( canDuplicate ) {\n\t\t\t\tconst updatedBlocks = await duplicateBlocks(\n\t\t\t\t\tblocksToUpdate,\n\t\t\t\t\tfalse\n\t\t\t\t);\n\n\t\t\t\tif ( updatedBlocks?.length ) {\n\t\t\t\t\t// If blocks have been duplicated, focus the first duplicated block.\n\t\t\t\t\tupdateFocusAndSelection( updatedBlocks[ 0 ], false );\n\t\t\t\t}\n\t\t\t}\n\t\t} else if ( isMatch( 'core/block-editor/select-all', event ) ) {\n\t\t\tif ( event.defaultPrevented ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tevent.preventDefault();\n\n\t\t\tconst { firstBlockRootClientId, selectedBlockClientIds } =\n\t\t\t\tgetBlocksToUpdate();\n\t\t\tconst blockClientIds = getBlockOrder( firstBlockRootClientId );\n\t\t\tif ( ! blockClientIds.length ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// If we have selected all sibling nested blocks, try selecting up a level.\n\t\t\t// This is a similar implementation to that used by `useSelectAll`.\n\t\t\t// `isShallowEqual` is used for the list view instead of a length check,\n\t\t\t// as the array of siblings of the currently focused block may be a different\n\t\t\t// set of blocks from the current block selection if the user is focused\n\t\t\t// on a different part of the list view from the block selection.\n\t\t\tif ( isShallowEqual( selectedBlockClientIds, blockClientIds ) ) {\n\t\t\t\t// Only select up a level if the first block is not the root block.\n\t\t\t\t// This ensures that the block selection can't break out of the root block\n\t\t\t\t// used by the list view, if the list view is only showing a partial hierarchy.\n\t\t\t\tif (\n\t\t\t\t\tfirstBlockRootClientId &&\n\t\t\t\t\tfirstBlockRootClientId !== rootClientId\n\t\t\t\t) {\n\t\t\t\t\tupdateFocusAndSelection( firstBlockRootClientId, true );\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Select all while passing `null` to skip focusing to the editor canvas,\n\t\t\t// and retain focus within the list view.\n\t\t\tmultiSelect(\n\t\t\t\tblockClientIds[ 0 ],\n\t\t\t\tblockClientIds[ blockClientIds.length - 1 ],\n\t\t\t\tnull\n\t\t\t);\n\t\t}\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<Button\n\t\t\t\tclassName={ classnames(\n\t\t\t\t\t'block-editor-list-view-block-select-button',\n\t\t\t\t\tclassName\n\t\t\t\t) }\n\t\t\t\tonClick={ onClick }\n\t\t\t\tonKeyDown={ onKeyDownHandler }\n\t\t\t\tref={ ref }\n\t\t\t\ttabIndex={ tabIndex }\n\t\t\t\tonFocus={ onFocus }\n\t\t\t\tonDragStart={ onDragStartHandler }\n\t\t\t\tonDragEnd={ onDragEnd }\n\t\t\t\tdraggable={ draggable }\n\t\t\t\thref={ `#block-${ clientId }` }\n\t\t\t\taria-label={ ariaLabel }\n\t\t\t\taria-describedby={ ariaDescribedBy }\n\t\t\t\taria-expanded={ isExpanded }\n\t\t\t>\n\t\t\t\t<ListViewExpander onClick={ onToggleExpanded } />\n\t\t\t\t<BlockIcon\n\t\t\t\t\ticon={ blockInformation?.icon }\n\t\t\t\t\tshowColors\n\t\t\t\t\tcontext=\"list-view\"\n\t\t\t\t/>\n\t\t\t\t<HStack\n\t\t\t\t\talignment=\"center\"\n\t\t\t\t\tclassName=\"block-editor-list-view-block-select-button__label-wrapper\"\n\t\t\t\t\tjustify=\"flex-start\"\n\t\t\t\t\tspacing={ 1 }\n\t\t\t\t>\n\t\t\t\t\t<span className=\"block-editor-list-view-block-select-button__title\">\n\t\t\t\t\t\t<Truncate ellipsizeMode=\"auto\">{ blockTitle }</Truncate>\n\t\t\t\t\t</span>\n\t\t\t\t\t{ blockInformation?.anchor && (\n\t\t\t\t\t\t<span className=\"block-editor-list-view-block-select-button__anchor-wrapper\">\n\t\t\t\t\t\t\t<Truncate\n\t\t\t\t\t\t\t\tclassName=\"block-editor-list-view-block-select-button__anchor\"\n\t\t\t\t\t\t\t\tellipsizeMode=\"auto\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ blockInformation.anchor }\n\t\t\t\t\t\t\t</Truncate>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t) }\n\t\t\t\t\t{ positionLabel && isSticky && (\n\t\t\t\t\t\t<Tooltip text={ positionLabel }>\n\t\t\t\t\t\t\t<Icon icon={ pinSmall } />\n\t\t\t\t\t\t</Tooltip>\n\t\t\t\t\t) }\n\t\t\t\t\t{ images.length ? (\n\t\t\t\t\t\t<span\n\t\t\t\t\t\t\tclassName=\"block-editor-list-view-block-select-button__images\"\n\t\t\t\t\t\t\taria-hidden\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ images.map( ( image, index ) => (\n\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\tclassName=\"block-editor-list-view-block-select-button__image\"\n\t\t\t\t\t\t\t\t\tkey={ image.clientId }\n\t\t\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\t\t\tbackgroundImage: `url(${ image.url })`,\n\t\t\t\t\t\t\t\t\t\tzIndex: images.length - index, // Ensure the first image is on top, and subsequent images are behind.\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t\t</span>\n\t\t\t\t\t) : null }\n\t\t\t\t\t{ isLocked && (\n\t\t\t\t\t\t<span className=\"block-editor-list-view-block-select-button__lock\">\n\t\t\t\t\t\t\t<Icon icon={ lock } />\n\t\t\t\t\t\t</span>\n\t\t\t\t\t) }\n\t\t\t\t</HStack>\n\t\t\t</Button>\n\t\t</>\n\t);\n}\n\nexport default forwardRef( ListViewBlockSelectButton );\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAMA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAAAN,OAAA;AACA,IAAAO,kBAAA,GAAAP,OAAA;AACA,IAAAQ,KAAA,GAAAR,OAAA;AACA,IAAAS,eAAA,GAAAV,sBAAA,CAAAC,OAAA;AAKA,IAAAU,UAAA,GAAAX,sBAAA,CAAAC,OAAA;AACA,IAAAW,2BAAA,GAAAZ,sBAAA,CAAAC,OAAA;AACA,IAAAY,qBAAA,GAAAb,sBAAA,CAAAC,OAAA;AACA,IAAAa,SAAA,GAAAd,sBAAA,CAAAC,OAAA;AACA,IAAAc,UAAA,GAAAd,OAAA;AACA,IAAAe,MAAA,GAAAf,OAAA;AACA,IAAAgB,kBAAA,GAAAjB,sBAAA,CAAAC,OAAA;AACA,IAAAiB,QAAA,GAAAjB,OAAA;AAjCA;AACA;AACA;;AAGA;AACA;AACA;;AAgBA;AACA;AACA;;AAUA,SAASkB,yBAAyBA,CACjC;EACCC,SAAS;EACTC,KAAK,EAAE;IAAEC;E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AACK,GAAK,GAAE;MACtCC,MAAM,EAAElE,MAAM,CAAC4B,MAAM,GAAGiC,KAAK,CAAE;IAChC;EAAG,CACH,CACA,CACG,CAAC,GACJ,IAAI,EACNhF,QAAQ,IACT,IAAAyD,MAAA,CAAAC,aAAA;IAAM9E,SAAS,EAAC;EAAkD,GACjE,IAAA6E,MAAA,CAAAC,aAAA,EAAC7F,MAAA,CAAA+G,IAAI;IAACX,IAAI,EAAGqB;EAAM,CAAE,CAChB,CAEA,CACD,CACP,CAAC;AAEL;AAAC,IAAAC,QAAA,GAEc,IAAAC,mBAAU,EAAE7G,yBAA0B,CAAC;AAAA8G,OAAA,CAAAzB,OAAA,GAAAuB,QAAA"}
1
+ {"version":3,"names":["_classnames","_interopRequireDefault","require","_blocks","_components","_element","_icons","_keycodes","_data","_keyboardShortcuts","_i18n","_isShallowEqual","_blockIcon","_useBlockDisplayInformation","_useBlockDisplayTitle","_expander","_blockLock","_store","_useListViewImages","_context","ListViewBlockSelectButton","className","block","clientId","onClick","onContextMenu","onMouseDown","onToggleExpanded","tabIndex","onFocus","onDragStart","onDragEnd","draggable","isExpanded","ariaLabel","ariaDescribedBy","updateFocusAndSelection","ref","blockInformation","useBlockDisplayInformation","blockTitle","useBlockDisplayTitle","context","isLocked","useBlockLock","canInsertBlockType","getSelectedBlockClientIds","getPreviousBlockClientId","getBlockRootClientId","getBlockOrder","getBlocksByClientId","canRemoveBlocks","useSelect","blockEditorStore","duplicateBlocks","multiSelect","removeBlocks","useDispatch","isMatch","useShortcutEventMatch","isSticky","positionType","images","useListViewImages","rootClientId","useListViewContext","positionLabel","sprintf","__","onDragStartHandler","event","dataTransfer","clearData","getBlocksToUpdate","selectedBlockClientIds","isUpdatingSelectedBlocks","includes","firstBlockClientId","firstBlockRootClientId","blocksToUpdate","onKeyDownHandler","keyCode","ENTER","SPACE","BACKSPACE","DELETE","_getPreviousBlockClie","blocksToDelete","blockToFocus","shouldUpdateSelection","length","defaultPrevented","preventDefault","canDuplicate","every","hasBlockSupport","name","updatedBlocks","blockClientIds","isShallowEqual","_react","createElement","Fragment","Button","classnames","onKeyDown","href","default","icon","showColors","__experimentalHStack","alignment","justify","spacing","__experimentalTruncate","ellipsizeMode","anchor","Tooltip","text","Icon","pinSmall","map","image","index","key","style","backgroundImage","url","zIndex","lock","_default","forwardRef","exports"],"sources":["@wordpress/block-editor/src/components/list-view/block-select-button.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { hasBlockSupport } from '@wordpress/blocks';\nimport {\n\tButton,\n\t__experimentalHStack as HStack,\n\t__experimentalTruncate as Truncate,\n\tTooltip,\n} from '@wordpress/components';\nimport { forwardRef } from '@wordpress/element';\nimport { Icon, lockSmall as lock, pinSmall } from '@wordpress/icons';\nimport { SPACE, ENTER, BACKSPACE, DELETE } from '@wordpress/keycodes';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __unstableUseShortcutEventMatch as useShortcutEventMatch } from '@wordpress/keyboard-shortcuts';\nimport { __, sprintf } from '@wordpress/i18n';\nimport isShallowEqual from '@wordpress/is-shallow-equal';\n\n/**\n * Internal dependencies\n */\nimport BlockIcon from '../block-icon';\nimport useBlockDisplayInformation from '../use-block-display-information';\nimport useBlockDisplayTitle from '../block-title/use-block-display-title';\nimport ListViewExpander from './expander';\nimport { useBlockLock } from '../block-lock';\nimport { store as blockEditorStore } from '../../store';\nimport useListViewImages from './use-list-view-images';\nimport { useListViewContext } from './context';\n\nfunction ListViewBlockSelectButton(\n\t{\n\t\tclassName,\n\t\tblock: { clientId },\n\t\tonClick,\n\t\tonContextMenu,\n\t\tonMouseDown,\n\t\tonToggleExpanded,\n\t\ttabIndex,\n\t\tonFocus,\n\t\tonDragStart,\n\t\tonDragEnd,\n\t\tdraggable,\n\t\tisExpanded,\n\t\tariaLabel,\n\t\tariaDescribedBy,\n\t\tupdateFocusAndSelection,\n\t},\n\tref\n) {\n\tconst blockInformation = useBlockDisplayInformation( clientId );\n\tconst blockTitle = useBlockDisplayTitle( {\n\t\tclientId,\n\t\tcontext: 'list-view',\n\t} );\n\tconst { isLocked } = useBlockLock( clientId );\n\tconst {\n\t\tcanInsertBlockType,\n\t\tgetSelectedBlockClientIds,\n\t\tgetPreviousBlockClientId,\n\t\tgetBlockRootClientId,\n\t\tgetBlockOrder,\n\t\tgetBlocksByClientId,\n\t\tcanRemoveBlocks,\n\t} = useSelect( blockEditorStore );\n\tconst { duplicateBlocks, multiSelect, removeBlocks } =\n\t\tuseDispatch( blockEditorStore );\n\tconst isMatch = useShortcutEventMatch();\n\tconst isSticky = blockInformation?.positionType === 'sticky';\n\tconst images = useListViewImages( { clientId, isExpanded } );\n\tconst { rootClientId } = useListViewContext();\n\n\tconst positionLabel = blockInformation?.positionLabel\n\t\t? sprintf(\n\t\t\t\t// translators: 1: Position of selected block, e.g. \"Sticky\" or \"Fixed\".\n\t\t\t\t__( 'Position: %1$s' ),\n\t\t\t\tblockInformation.positionLabel\n\t\t )\n\t\t: '';\n\n\t// The `href` attribute triggers the browser's native HTML drag operations.\n\t// When the link is dragged, the element's outerHTML is set in DataTransfer object as text/html.\n\t// We need to clear any HTML drag data to prevent `pasteHandler` from firing\n\t// inside the `useOnBlockDrop` hook.\n\tconst onDragStartHandler = ( event ) => {\n\t\tevent.dataTransfer.clearData();\n\t\tonDragStart?.( event );\n\t};\n\n\t// Determine which blocks to update:\n\t// If the current (focused) block is part of the block selection, use the whole selection.\n\t// If the focused block is not part of the block selection, only update the focused block.\n\tfunction getBlocksToUpdate() {\n\t\tconst selectedBlockClientIds = getSelectedBlockClientIds();\n\t\tconst isUpdatingSelectedBlocks =\n\t\t\tselectedBlockClientIds.includes( clientId );\n\t\tconst firstBlockClientId = isUpdatingSelectedBlocks\n\t\t\t? selectedBlockClientIds[ 0 ]\n\t\t\t: clientId;\n\t\tconst firstBlockRootClientId =\n\t\t\tgetBlockRootClientId( firstBlockClientId );\n\n\t\tconst blocksToUpdate = isUpdatingSelectedBlocks\n\t\t\t? selectedBlockClientIds\n\t\t\t: [ clientId ];\n\n\t\treturn {\n\t\t\tblocksToUpdate,\n\t\t\tfirstBlockClientId,\n\t\t\tfirstBlockRootClientId,\n\t\t\tselectedBlockClientIds,\n\t\t};\n\t}\n\n\t/**\n\t * @param {KeyboardEvent} event\n\t */\n\tasync function onKeyDownHandler( event ) {\n\t\tif ( event.keyCode === ENTER || event.keyCode === SPACE ) {\n\t\t\tonClick( event );\n\t\t} else if (\n\t\t\tevent.keyCode === BACKSPACE ||\n\t\t\tevent.keyCode === DELETE ||\n\t\t\tisMatch( 'core/block-editor/remove', event )\n\t\t) {\n\t\t\tconst {\n\t\t\t\tblocksToUpdate: blocksToDelete,\n\t\t\t\tfirstBlockClientId,\n\t\t\t\tfirstBlockRootClientId,\n\t\t\t\tselectedBlockClientIds,\n\t\t\t} = getBlocksToUpdate();\n\n\t\t\t// Don't update the selection if the blocks cannot be deleted.\n\t\t\tif ( ! canRemoveBlocks( blocksToDelete, firstBlockRootClientId ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tlet blockToFocus =\n\t\t\t\tgetPreviousBlockClientId( firstBlockClientId ) ??\n\t\t\t\t// If the previous block is not found (when the first block is deleted),\n\t\t\t\t// fallback to focus the parent block.\n\t\t\t\tfirstBlockRootClientId;\n\n\t\t\tremoveBlocks( blocksToDelete, false );\n\n\t\t\t// Update the selection if the original selection has been removed.\n\t\t\tconst shouldUpdateSelection =\n\t\t\t\tselectedBlockClientIds.length > 0 &&\n\t\t\t\tgetSelectedBlockClientIds().length === 0;\n\n\t\t\t// If there's no previous block nor parent block, focus the first block.\n\t\t\tif ( ! blockToFocus ) {\n\t\t\t\tblockToFocus = getBlockOrder()[ 0 ];\n\t\t\t}\n\n\t\t\tupdateFocusAndSelection( blockToFocus, shouldUpdateSelection );\n\t\t} else if ( isMatch( 'core/block-editor/duplicate', event ) ) {\n\t\t\tif ( event.defaultPrevented ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tevent.preventDefault();\n\n\t\t\tconst { blocksToUpdate, firstBlockRootClientId } =\n\t\t\t\tgetBlocksToUpdate();\n\n\t\t\tconst canDuplicate = getBlocksByClientId( blocksToUpdate ).every(\n\t\t\t\t( block ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t!! block &&\n\t\t\t\t\t\thasBlockSupport( block.name, 'multiple', true ) &&\n\t\t\t\t\t\tcanInsertBlockType( block.name, firstBlockRootClientId )\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tif ( canDuplicate ) {\n\t\t\t\tconst updatedBlocks = await duplicateBlocks(\n\t\t\t\t\tblocksToUpdate,\n\t\t\t\t\tfalse\n\t\t\t\t);\n\n\t\t\t\tif ( updatedBlocks?.length ) {\n\t\t\t\t\t// If blocks have been duplicated, focus the first duplicated block.\n\t\t\t\t\tupdateFocusAndSelection( updatedBlocks[ 0 ], false );\n\t\t\t\t}\n\t\t\t}\n\t\t} else if ( isMatch( 'core/block-editor/select-all', event ) ) {\n\t\t\tif ( event.defaultPrevented ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tevent.preventDefault();\n\n\t\t\tconst { firstBlockRootClientId, selectedBlockClientIds } =\n\t\t\t\tgetBlocksToUpdate();\n\t\t\tconst blockClientIds = getBlockOrder( firstBlockRootClientId );\n\t\t\tif ( ! blockClientIds.length ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// If we have selected all sibling nested blocks, try selecting up a level.\n\t\t\t// This is a similar implementation to that used by `useSelectAll`.\n\t\t\t// `isShallowEqual` is used for the list view instead of a length check,\n\t\t\t// as the array of siblings of the currently focused block may be a different\n\t\t\t// set of blocks from the current block selection if the user is focused\n\t\t\t// on a different part of the list view from the block selection.\n\t\t\tif ( isShallowEqual( selectedBlockClientIds, blockClientIds ) ) {\n\t\t\t\t// Only select up a level if the first block is not the root block.\n\t\t\t\t// This ensures that the block selection can't break out of the root block\n\t\t\t\t// used by the list view, if the list view is only showing a partial hierarchy.\n\t\t\t\tif (\n\t\t\t\t\tfirstBlockRootClientId &&\n\t\t\t\t\tfirstBlockRootClientId !== rootClientId\n\t\t\t\t) {\n\t\t\t\t\tupdateFocusAndSelection( firstBlockRootClientId, true );\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Select all while passing `null` to skip focusing to the editor canvas,\n\t\t\t// and retain focus within the list view.\n\t\t\tmultiSelect(\n\t\t\t\tblockClientIds[ 0 ],\n\t\t\t\tblockClientIds[ blockClientIds.length - 1 ],\n\t\t\t\tnull\n\t\t\t);\n\t\t}\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<Button\n\t\t\t\tclassName={ classnames(\n\t\t\t\t\t'block-editor-list-view-block-select-button',\n\t\t\t\t\tclassName\n\t\t\t\t) }\n\t\t\t\tonClick={ onClick }\n\t\t\t\tonContextMenu={ onContextMenu }\n\t\t\t\tonKeyDown={ onKeyDownHandler }\n\t\t\t\tonMouseDown={ onMouseDown }\n\t\t\t\tref={ ref }\n\t\t\t\ttabIndex={ tabIndex }\n\t\t\t\tonFocus={ onFocus }\n\t\t\t\tonDragStart={ onDragStartHandler }\n\t\t\t\tonDragEnd={ onDragEnd }\n\t\t\t\tdraggable={ draggable }\n\t\t\t\thref={ `#block-${ clientId }` }\n\t\t\t\taria-label={ ariaLabel }\n\t\t\t\taria-describedby={ ariaDescribedBy }\n\t\t\t\taria-expanded={ isExpanded }\n\t\t\t>\n\t\t\t\t<ListViewExpander onClick={ onToggleExpanded } />\n\t\t\t\t<BlockIcon\n\t\t\t\t\ticon={ blockInformation?.icon }\n\t\t\t\t\tshowColors\n\t\t\t\t\tcontext=\"list-view\"\n\t\t\t\t/>\n\t\t\t\t<HStack\n\t\t\t\t\talignment=\"center\"\n\t\t\t\t\tclassName=\"block-editor-list-view-block-select-button__label-wrapper\"\n\t\t\t\t\tjustify=\"flex-start\"\n\t\t\t\t\tspacing={ 1 }\n\t\t\t\t>\n\t\t\t\t\t<span className=\"block-editor-list-view-block-select-button__title\">\n\t\t\t\t\t\t<Truncate ellipsizeMode=\"auto\">{ blockTitle }</Truncate>\n\t\t\t\t\t</span>\n\t\t\t\t\t{ blockInformation?.anchor && (\n\t\t\t\t\t\t<span className=\"block-editor-list-view-block-select-button__anchor-wrapper\">\n\t\t\t\t\t\t\t<Truncate\n\t\t\t\t\t\t\t\tclassName=\"block-editor-list-view-block-select-button__anchor\"\n\t\t\t\t\t\t\t\tellipsizeMode=\"auto\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ blockInformation.anchor }\n\t\t\t\t\t\t\t</Truncate>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t) }\n\t\t\t\t\t{ positionLabel && isSticky && (\n\t\t\t\t\t\t<Tooltip text={ positionLabel }>\n\t\t\t\t\t\t\t<Icon icon={ pinSmall } />\n\t\t\t\t\t\t</Tooltip>\n\t\t\t\t\t) }\n\t\t\t\t\t{ images.length ? (\n\t\t\t\t\t\t<span\n\t\t\t\t\t\t\tclassName=\"block-editor-list-view-block-select-button__images\"\n\t\t\t\t\t\t\taria-hidden\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ images.map( ( image, index ) => (\n\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\tclassName=\"block-editor-list-view-block-select-button__image\"\n\t\t\t\t\t\t\t\t\tkey={ image.clientId }\n\t\t\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\t\t\tbackgroundImage: `url(${ image.url })`,\n\t\t\t\t\t\t\t\t\t\tzIndex: images.length - index, // Ensure the first image is on top, and subsequent images are behind.\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t\t</span>\n\t\t\t\t\t) : null }\n\t\t\t\t\t{ isLocked && (\n\t\t\t\t\t\t<span className=\"block-editor-list-view-block-select-button__lock\">\n\t\t\t\t\t\t\t<Icon icon={ lock } />\n\t\t\t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AAA,EAAC/F,MAAA,CAAAiH,IAAI;IAACX,IAAI,EAAGqB;EAAM,CAAE,CAChB,CAEA,CACD,CACP,CAAC;AAEL;AAAC,IAAAC,QAAA,GAEc,IAAAC,mBAAU,EAAE/G,yBAA0B,CAAC;AAAAgH,OAAA,CAAAzB,OAAA,GAAAuB,QAAA"}
@@ -57,10 +57,13 @@ function ListViewBlock({
57
57
  }) {
58
58
  const cellRef = (0, _element.useRef)(null);
59
59
  const rowRef = (0, _element.useRef)(null);
60
+ const settingsRef = (0, _element.useRef)(null);
60
61
  const [isHovered, setIsHovered] = (0, _element.useState)(false);
62
+ const [settingsAnchorRect, setSettingsAnchorRect] = (0, _element.useState)();
61
63
  const {
62
64
  isLocked,
63
- canEdit
65
+ canEdit,
66
+ canMove
64
67
  } = (0, _blockLock.useBlockLock)(clientId);
65
68
  const isFirstSelectedBlock = isSelected && selectedClientIds[0] === clientId;
66
69
  const isLastSelectedBlock = isSelected && selectedClientIds[selectedClientIds.length - 1] === clientId;
@@ -85,6 +88,7 @@ function ListViewBlock({
85
88
  blockEditingMode: getBlockEditingMode(clientId)
86
89
  };
87
90
  }, [clientId]);
91
+ const allowRightClickOverrides = (0, _data.useSelect)(select => select(_store.store).getSettings().allowRightClickOverrides, []);
88
92
  const showBlockActions =
89
93
  // When a block hides its toolbar it also hides the block settings menu,
90
94
  // since that menu is part of the toolbar in the editor canvas.
@@ -156,6 +160,47 @@ function ListViewBlock({
156
160
  expand(clientId);
157
161
  }
158
162
  }, [clientId, expand, collapse, isExpanded]);
163
+
164
+ // Allow right-clicking an item in the List View to open up the block settings dropdown.
165
+ const onContextMenu = (0, _element.useCallback)(event => {
166
+ if (showBlockActions && allowRightClickOverrides) {
167
+ settingsRef.current?.click();
168
+ // Ensure the position of the settings dropdown is at the cursor.
169
+ setSettingsAnchorRect(new window.DOMRect(event.clientX, event.clientY, 0, 0));
170
+ event.preventDefault();
171
+ }
172
+ }, [allowRightClickOverrides, settingsRef, showBlockActions]);
173
+ const onMouseDown = (0, _element.useCallback)(event => {
174
+ // Prevent right-click from focusing the block,
175
+ // because focus will be handled when opening the block settings dropdown.
176
+ if (allowRightClickOverrides && event.button === 2) {
177
+ event.preventDefault();
178
+ }
179
+ }, [allowRightClickOverrides]);
180
+ const settingsPopoverAnchor = (0, _element.useMemo)(() => {
181
+ const {
182
+ ownerDocument
183
+ } = rowRef?.current || {};
184
+
185
+ // If no custom position is set, the settings dropdown will be anchored to the
186
+ // DropdownMenu toggle button.
187
+ if (!settingsAnchorRect || !ownerDocument) {
188
+ return undefined;
189
+ }
190
+
191
+ // Position the settings dropdown at the cursor when right-clicking a block.
192
+ return {
193
+ ownerDocument,
194
+ getBoundingClientRect() {
195
+ return settingsAnchorRect;
196
+ }
197
+ };
198
+ }, [settingsAnchorRect]);
199
+ const clearSettingsAnchorRect = (0, _element.useCallback)(() => {
200
+ // Clear the custom position for the settings dropdown so that it is restored back
201
+ // to being anchored to the DropdownMenu toggle button.
202
+ setSettingsAnchorRect(undefined);
203
+ }, [setSettingsAnchorRect]);
159
204
  let colSpan;
160
205
  if (hasRenderedMovers) {
161
206
  colSpan = 2;
@@ -170,7 +215,8 @@ function ListViewBlock({
170
215
  'is-synced-branch': isSyncedBranch,
171
216
  'is-dragging': isDragged,
172
217
  'has-single-cell': !showBlockActions,
173
- 'is-synced': blockInformation?.isSynced
218
+ 'is-synced': blockInformation?.isSynced,
219
+ 'is-draggable': canMove
174
220
  });
175
221
 
176
222
  // Only include all selected blocks if the currently clicked on block
@@ -219,6 +265,8 @@ function ListViewBlock({
219
265
  }, (0, _react.createElement)(_blockContents.default, {
220
266
  block: block,
221
267
  onClick: selectEditorBlock,
268
+ onContextMenu: onContextMenu,
269
+ onMouseDown: onMouseDown,
222
270
  onToggleExpanded: toggleExpanded,
223
271
  isSelected: isSelected,
224
272
  position: position,
@@ -259,7 +307,8 @@ function ListViewBlock({
259
307
  onFocus: onFocus
260
308
  })))), showBlockActions && BlockSettingsMenu && (0, _react.createElement)(_components.__experimentalTreeGridCell, {
261
309
  className: listViewBlockSettingsClassName,
262
- "aria-selected": !!isSelected
310
+ "aria-selected": !!isSelected,
311
+ ref: settingsRef
263
312
  }, ({
264
313
  ref,
265
314
  tabIndex,
@@ -269,10 +318,15 @@ function ListViewBlock({
269
318
  block: block,
270
319
  icon: _icons.moreVertical,
271
320
  label: settingsAriaLabel,
321
+ popoverProps: {
322
+ anchor: settingsPopoverAnchor // Used to position the settings at the cursor on right-click.
323
+ },
324
+
272
325
  toggleProps: {
273
326
  ref,
274
327
  className: 'block-editor-list-view-block__menu',
275
328
  tabIndex,
329
+ onClick: clearSettingsAnchorRect,
276
330
  onFocus
277
331
  },
278
332
  disableOpenOnArrowDown: true,