@wordpress/block-editor 10.5.0 → 11.1.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 (716) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/README.md +2 -1
  3. package/build/autocompleters/block.js +2 -6
  4. package/build/autocompleters/block.js.map +1 -1
  5. package/build/autocompleters/link.js +2 -0
  6. package/build/autocompleters/link.js.map +1 -1
  7. package/build/components/alignment-control/ui.js +1 -7
  8. package/build/components/alignment-control/ui.js.map +1 -1
  9. package/build/components/block-alignment-control/use-available-alignments.js +4 -3
  10. package/build/components/block-alignment-control/use-available-alignments.js.map +1 -1
  11. package/build/components/block-card/index.js +51 -3
  12. package/build/components/block-card/index.js.map +1 -1
  13. package/build/components/block-draggable/index.native.js +46 -39
  14. package/build/components/block-draggable/index.native.js.map +1 -1
  15. package/build/components/block-edit/edit.js +4 -3
  16. package/build/components/block-edit/edit.js.map +1 -1
  17. package/build/components/block-edit/edit.native.js +4 -7
  18. package/build/components/block-edit/edit.native.js.map +1 -1
  19. package/build/components/block-icon/index.js +4 -2
  20. package/build/components/block-icon/index.js.map +1 -1
  21. package/build/components/block-inspector/index.js +90 -37
  22. package/build/components/block-inspector/index.js.map +1 -1
  23. package/build/components/block-list/block-list-context.native.js +5 -8
  24. package/build/components/block-list/block-list-context.native.js.map +1 -1
  25. package/build/components/block-list/block.js +55 -24
  26. package/build/components/block-list/block.js.map +1 -1
  27. package/build/components/block-list/block.native.js +61 -28
  28. package/build/components/block-list/block.native.js.map +1 -1
  29. package/build/components/block-list-appender/index.js +46 -34
  30. package/build/components/block-list-appender/index.js.map +1 -1
  31. package/build/components/block-list-appender/index.native.js +39 -34
  32. package/build/components/block-list-appender/index.native.js.map +1 -1
  33. package/build/components/block-mobile-toolbar/block-actions-menu.native.js +30 -22
  34. package/build/components/block-mobile-toolbar/block-actions-menu.native.js.map +1 -1
  35. package/build/components/block-mobile-toolbar/index.native.js +1 -1
  36. package/build/components/block-mobile-toolbar/index.native.js.map +1 -1
  37. package/build/components/block-pattern-setup/index.js +16 -8
  38. package/build/components/block-pattern-setup/index.js.map +1 -1
  39. package/build/components/block-patterns-list/index.js +33 -11
  40. package/build/components/block-patterns-list/index.js.map +1 -1
  41. package/build/components/block-preview/auto.js +9 -3
  42. package/build/components/block-preview/auto.js.map +1 -1
  43. package/build/components/block-preview/index.js +5 -9
  44. package/build/components/block-preview/index.js.map +1 -1
  45. package/build/components/block-settings-menu/block-settings-dropdown.js +5 -2
  46. package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  47. package/build/components/block-styles/index.native.js +1 -3
  48. package/build/components/block-styles/index.native.js.map +1 -1
  49. package/build/components/block-styles/utils.js +7 -10
  50. package/build/components/block-styles/utils.js.map +1 -1
  51. package/build/components/block-toolbar/index.js +5 -1
  52. package/build/components/block-toolbar/index.js.map +1 -1
  53. package/build/components/block-toolbar/index.native.js +6 -8
  54. package/build/components/block-toolbar/index.native.js.map +1 -1
  55. package/build/components/block-tools/insertion-point.js +8 -49
  56. package/build/components/block-tools/insertion-point.js.map +1 -1
  57. package/build/components/block-tools/selected-block-popover.js +1 -3
  58. package/build/components/block-tools/selected-block-popover.js.map +1 -1
  59. package/build/components/block-variation-picker/index.js +2 -3
  60. package/build/components/block-variation-picker/index.js.map +1 -1
  61. package/build/components/colors/utils.js +2 -6
  62. package/build/components/colors/utils.js.map +1 -1
  63. package/build/components/colors-gradients/control.js +0 -3
  64. package/build/components/colors-gradients/control.js.map +1 -1
  65. package/build/components/colors-gradients/dropdown.js +0 -2
  66. package/build/components/colors-gradients/dropdown.js.map +1 -1
  67. package/build/components/colors-gradients/panel-color-gradient-settings.js +2 -19
  68. package/build/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
  69. package/build/components/colors-gradients/use-multiple-origin-colors-and-gradients.js +4 -3
  70. package/build/components/colors-gradients/use-multiple-origin-colors-and-gradients.js.map +1 -1
  71. package/build/components/copy-handler/index.js +37 -9
  72. package/build/components/copy-handler/index.js.map +1 -1
  73. package/build/components/font-sizes/fluid-utils.js +5 -2
  74. package/build/components/font-sizes/fluid-utils.js.map +1 -1
  75. package/build/components/font-sizes/utils.js +10 -4
  76. package/build/components/font-sizes/utils.js.map +1 -1
  77. package/build/components/font-sizes/with-font-sizes.js +11 -6
  78. package/build/components/font-sizes/with-font-sizes.js.map +1 -1
  79. package/build/components/gradients/use-gradient.js +2 -8
  80. package/build/components/gradients/use-gradient.js.map +1 -1
  81. package/build/components/height-control/index.js +115 -0
  82. package/build/components/height-control/index.js.map +1 -0
  83. package/build/components/iframe/index.js +22 -101
  84. package/build/components/iframe/index.js.map +1 -1
  85. package/build/components/iframe/use-compatibility-styles.js +93 -0
  86. package/build/components/iframe/use-compatibility-styles.js.map +1 -0
  87. package/build/components/image-editor/use-save-image.js +2 -0
  88. package/build/components/image-editor/use-save-image.js.map +1 -1
  89. package/build/components/image-editor/zoom-dropdown.js +1 -0
  90. package/build/components/image-editor/zoom-dropdown.js.map +1 -1
  91. package/build/components/index.js +9 -0
  92. package/build/components/index.js.map +1 -1
  93. package/build/components/inner-blocks/index.js +25 -7
  94. package/build/components/inner-blocks/index.js.map +1 -1
  95. package/build/components/inner-blocks/use-inner-block-template-sync.js +25 -10
  96. package/build/components/inner-blocks/use-inner-block-template-sync.js.map +1 -1
  97. package/build/components/inserter/block-patterns-explorer/sidebar.js +1 -0
  98. package/build/components/inserter/block-patterns-explorer/sidebar.js.map +1 -1
  99. package/build/components/inserter/block-patterns-tab.js +25 -46
  100. package/build/components/inserter/block-patterns-tab.js.map +1 -1
  101. package/build/components/inserter/block-types-tab.js +3 -1
  102. package/build/components/inserter/block-types-tab.js.map +1 -1
  103. package/build/components/inserter/hooks/use-debounced-input.js +27 -0
  104. package/build/components/inserter/hooks/use-debounced-input.js.map +1 -0
  105. package/build/components/inserter/hooks/use-insertion-point.js +4 -3
  106. package/build/components/inserter/hooks/use-insertion-point.js.map +1 -1
  107. package/build/components/inserter/index.js +20 -6
  108. package/build/components/inserter/index.js.map +1 -1
  109. package/build/components/inserter/index.native.js +3 -4
  110. package/build/components/inserter/index.native.js.map +1 -1
  111. package/build/components/inserter/media-tab/hooks.js +106 -0
  112. package/build/components/inserter/media-tab/hooks.js.map +1 -0
  113. package/build/components/inserter/media-tab/index.js +32 -0
  114. package/build/components/inserter/media-tab/index.js.map +1 -0
  115. package/build/components/inserter/media-tab/media-list.js +100 -0
  116. package/build/components/inserter/media-tab/media-list.js.map +1 -0
  117. package/build/components/inserter/media-tab/media-panel.js +96 -0
  118. package/build/components/inserter/media-tab/media-panel.js.map +1 -0
  119. package/build/components/inserter/media-tab/media-tab.js +120 -0
  120. package/build/components/inserter/media-tab/media-tab.js.map +1 -0
  121. package/build/components/inserter/media-tab/utils.js +54 -0
  122. package/build/components/inserter/media-tab/utils.js.map +1 -0
  123. package/build/components/inserter/menu.js +35 -12
  124. package/build/components/inserter/menu.js.map +1 -1
  125. package/build/components/inserter/mobile-tab-navigation.js +70 -0
  126. package/build/components/inserter/mobile-tab-navigation.js.map +1 -0
  127. package/build/components/inserter/quick-inserter.js +7 -3
  128. package/build/components/inserter/quick-inserter.js.map +1 -1
  129. package/build/components/inserter/search-items.js +15 -14
  130. package/build/components/inserter/search-items.js.map +1 -1
  131. package/build/components/inserter/search-results.js +7 -3
  132. package/build/components/inserter/search-results.js.map +1 -1
  133. package/build/components/inserter/tabs.js +16 -2
  134. package/build/components/inserter/tabs.js.map +1 -1
  135. package/build/components/inserter-list-item/index.js +4 -1
  136. package/build/components/inserter-list-item/index.js.map +1 -1
  137. package/build/components/inspector-controls/groups.js +2 -0
  138. package/build/components/inspector-controls/groups.js.map +1 -1
  139. package/build/components/inspector-controls-tabs/advanced-controls-panel.js +46 -0
  140. package/build/components/inspector-controls-tabs/advanced-controls-panel.js.map +1 -0
  141. package/build/components/inspector-controls-tabs/index.js +71 -0
  142. package/build/components/inspector-controls-tabs/index.js.map +1 -0
  143. package/build/components/inspector-controls-tabs/settings-tab.js +28 -0
  144. package/build/components/inspector-controls-tabs/settings-tab.js.map +1 -0
  145. package/build/components/inspector-controls-tabs/styles-tab.js +61 -0
  146. package/build/components/inspector-controls-tabs/styles-tab.js.map +1 -0
  147. package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js +97 -0
  148. package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +1 -0
  149. package/build/components/inspector-controls-tabs/use-is-list-view-tab-disabled.js +18 -0
  150. package/build/components/inspector-controls-tabs/use-is-list-view-tab-disabled.js.map +1 -0
  151. package/build/components/inspector-controls-tabs/utils.js +37 -0
  152. package/build/components/inspector-controls-tabs/utils.js.map +1 -0
  153. package/build/components/link-control/index.js +1 -0
  154. package/build/components/link-control/index.js.map +1 -1
  155. package/build/components/link-control/search-input.js +0 -1
  156. package/build/components/link-control/search-input.js.map +1 -1
  157. package/build/components/link-control/use-internal-input-value.js +3 -3
  158. package/build/components/link-control/use-internal-input-value.js.map +1 -1
  159. package/build/components/list-view/block-select-button.js +1 -1
  160. package/build/components/list-view/block-select-button.js.map +1 -1
  161. package/build/components/list-view/block.js +5 -2
  162. package/build/components/list-view/block.js.map +1 -1
  163. package/build/components/list-view/branch.js +13 -12
  164. package/build/components/list-view/branch.js.map +1 -1
  165. package/build/components/media-upload/index.native.js +2 -3
  166. package/build/components/media-upload/index.native.js.map +1 -1
  167. package/build/components/off-canvas-editor/appender.js +99 -0
  168. package/build/components/off-canvas-editor/appender.js.map +1 -0
  169. package/build/components/off-canvas-editor/block-edit-button.js +50 -0
  170. package/build/components/off-canvas-editor/block-edit-button.js.map +1 -0
  171. package/build/components/off-canvas-editor/block-select-button.js +3 -2
  172. package/build/components/off-canvas-editor/block-select-button.js.map +1 -1
  173. package/build/components/off-canvas-editor/block.js +82 -38
  174. package/build/components/off-canvas-editor/block.js.map +1 -1
  175. package/build/components/off-canvas-editor/branch.js +3 -5
  176. package/build/components/off-canvas-editor/branch.js.map +1 -1
  177. package/build/components/off-canvas-editor/index.js +24 -11
  178. package/build/components/off-canvas-editor/index.js.map +1 -1
  179. package/build/components/off-canvas-editor/leaf.js +1 -1
  180. package/build/components/off-canvas-editor/leaf.js.map +1 -1
  181. package/build/components/off-canvas-editor/link-ui.js +185 -0
  182. package/build/components/off-canvas-editor/link-ui.js.map +1 -0
  183. package/build/components/off-canvas-editor/update-attributes.js +108 -0
  184. package/build/components/off-canvas-editor/update-attributes.js.map +1 -0
  185. package/build/components/off-canvas-editor/use-inserted-block.js +58 -0
  186. package/build/components/off-canvas-editor/use-inserted-block.js.map +1 -0
  187. package/build/components/responsive-block-control/label.js.map +1 -1
  188. package/build/components/rich-text/format-edit.js +12 -10
  189. package/build/components/rich-text/format-edit.js.map +1 -1
  190. package/build/components/rich-text/format-toolbar/index.js +8 -4
  191. package/build/components/rich-text/format-toolbar/index.js.map +1 -1
  192. package/build/components/rich-text/index.js +3 -3
  193. package/build/components/rich-text/index.js.map +1 -1
  194. package/build/components/rich-text/index.native.js +0 -2
  195. package/build/components/rich-text/index.native.js.map +1 -1
  196. package/build/components/rich-text/use-insert-replacement-text.js +43 -0
  197. package/build/components/rich-text/use-insert-replacement-text.js.map +1 -0
  198. package/build/components/rich-text/use-paste-handler.js +21 -12
  199. package/build/components/rich-text/use-paste-handler.js.map +1 -1
  200. package/build/components/rich-text/use-undo-automatic-change.js +9 -1
  201. package/build/components/rich-text/use-undo-automatic-change.js.map +1 -1
  202. package/build/components/rich-text/utils.js +1 -19
  203. package/build/components/rich-text/utils.js.map +1 -1
  204. package/build/components/spacing-sizes-control/index.js +0 -1
  205. package/build/components/spacing-sizes-control/index.js.map +1 -1
  206. package/build/components/spacing-sizes-control/spacing-input-control.js +12 -3
  207. package/build/components/spacing-sizes-control/spacing-input-control.js.map +1 -1
  208. package/build/components/spacing-sizes-control/utils.js +1 -1
  209. package/build/components/spacing-sizes-control/utils.js.map +1 -1
  210. package/build/components/typewriter/index.js +1 -1
  211. package/build/components/typewriter/index.js.map +1 -1
  212. package/build/components/ungroup-button/index.native.js +4 -2
  213. package/build/components/ungroup-button/index.native.js.map +1 -1
  214. package/build/components/url-input/index.js +46 -43
  215. package/build/components/url-input/index.js.map +1 -1
  216. package/build/components/url-popover/image-url-input-ui.js +2 -2
  217. package/build/components/url-popover/image-url-input-ui.js.map +1 -1
  218. package/build/components/use-block-display-information/index.js +8 -4
  219. package/build/components/use-block-display-information/index.js.map +1 -1
  220. package/build/components/use-setting/index.js +9 -1
  221. package/build/components/use-setting/index.js.map +1 -1
  222. package/build/components/writing-flow/index.js +1 -1
  223. package/build/components/writing-flow/index.js.map +1 -1
  224. package/build/hooks/border.js +0 -1
  225. package/build/hooks/border.js.map +1 -1
  226. package/build/hooks/child-layout.js +209 -0
  227. package/build/hooks/child-layout.js.map +1 -0
  228. package/build/hooks/color-panel.js +0 -1
  229. package/build/hooks/color-panel.js.map +1 -1
  230. package/build/hooks/color.js +1 -2
  231. package/build/hooks/color.js.map +1 -1
  232. package/build/hooks/content-lock-ui.js +1 -1
  233. package/build/hooks/content-lock-ui.js.map +1 -1
  234. package/build/hooks/dimensions.js +25 -7
  235. package/build/hooks/dimensions.js.map +1 -1
  236. package/build/hooks/font-family.js +4 -4
  237. package/build/hooks/font-family.js.map +1 -1
  238. package/build/hooks/font-size.js +5 -3
  239. package/build/hooks/font-size.js.map +1 -1
  240. package/build/hooks/layout.js +57 -1
  241. package/build/hooks/layout.js.map +1 -1
  242. package/build/hooks/min-height.js +4 -10
  243. package/build/hooks/min-height.js.map +1 -1
  244. package/build/hooks/use-typography-props.js +11 -8
  245. package/build/hooks/use-typography-props.js.map +1 -1
  246. package/build/store/reducer.js +411 -274
  247. package/build/store/reducer.js.map +1 -1
  248. package/build/store/selectors.js +58 -48
  249. package/build/store/selectors.js.map +1 -1
  250. package/build/utils/pasting.js +6 -11
  251. package/build/utils/pasting.js.map +1 -1
  252. package/build/utils/sorting.js +63 -0
  253. package/build/utils/sorting.js.map +1 -0
  254. package/build-module/autocompleters/block.js +2 -6
  255. package/build-module/autocompleters/block.js.map +1 -1
  256. package/build-module/autocompleters/link.js +2 -0
  257. package/build-module/autocompleters/link.js.map +1 -1
  258. package/build-module/components/alignment-control/ui.js +1 -6
  259. package/build-module/components/alignment-control/ui.js.map +1 -1
  260. package/build-module/components/block-alignment-control/use-available-alignments.js +4 -3
  261. package/build-module/components/block-alignment-control/use-available-alignments.js.map +1 -1
  262. package/build-module/components/block-card/index.js +45 -3
  263. package/build-module/components/block-card/index.js.map +1 -1
  264. package/build-module/components/block-draggable/index.native.js +40 -31
  265. package/build-module/components/block-draggable/index.native.js.map +1 -1
  266. package/build-module/components/block-edit/edit.js +4 -2
  267. package/build-module/components/block-edit/edit.js.map +1 -1
  268. package/build-module/components/block-edit/edit.native.js +4 -6
  269. package/build-module/components/block-edit/edit.native.js.map +1 -1
  270. package/build-module/components/block-icon/index.js +4 -2
  271. package/build-module/components/block-icon/index.js.map +1 -1
  272. package/build-module/components/block-inspector/index.js +87 -34
  273. package/build-module/components/block-inspector/index.js.map +1 -1
  274. package/build-module/components/block-list/block-list-context.native.js +5 -8
  275. package/build-module/components/block-list/block-list-context.native.js.map +1 -1
  276. package/build-module/components/block-list/block.js +55 -25
  277. package/build-module/components/block-list/block.js.map +1 -1
  278. package/build-module/components/block-list/block.native.js +61 -28
  279. package/build-module/components/block-list/block.native.js.map +1 -1
  280. package/build-module/components/block-list-appender/index.js +46 -34
  281. package/build-module/components/block-list-appender/index.js.map +1 -1
  282. package/build-module/components/block-list-appender/index.native.js +39 -32
  283. package/build-module/components/block-list-appender/index.native.js.map +1 -1
  284. package/build-module/components/block-mobile-toolbar/block-actions-menu.native.js +31 -24
  285. package/build-module/components/block-mobile-toolbar/block-actions-menu.native.js.map +1 -1
  286. package/build-module/components/block-mobile-toolbar/index.native.js +1 -1
  287. package/build-module/components/block-mobile-toolbar/index.native.js.map +1 -1
  288. package/build-module/components/block-pattern-setup/index.js +16 -8
  289. package/build-module/components/block-pattern-setup/index.js.map +1 -1
  290. package/build-module/components/block-patterns-list/index.js +35 -13
  291. package/build-module/components/block-patterns-list/index.js.map +1 -1
  292. package/build-module/components/block-preview/auto.js +9 -3
  293. package/build-module/components/block-preview/auto.js.map +1 -1
  294. package/build-module/components/block-preview/index.js +5 -8
  295. package/build-module/components/block-preview/index.js.map +1 -1
  296. package/build-module/components/block-settings-menu/block-settings-dropdown.js +5 -2
  297. package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  298. package/build-module/components/block-styles/index.native.js +1 -2
  299. package/build-module/components/block-styles/index.native.js.map +1 -1
  300. package/build-module/components/block-styles/utils.js +7 -9
  301. package/build-module/components/block-styles/utils.js.map +1 -1
  302. package/build-module/components/block-toolbar/index.js +6 -2
  303. package/build-module/components/block-toolbar/index.js.map +1 -1
  304. package/build-module/components/block-toolbar/index.native.js +6 -8
  305. package/build-module/components/block-toolbar/index.native.js.map +1 -1
  306. package/build-module/components/block-tools/insertion-point.js +8 -49
  307. package/build-module/components/block-tools/insertion-point.js.map +1 -1
  308. package/build-module/components/block-tools/selected-block-popover.js +1 -2
  309. package/build-module/components/block-tools/selected-block-popover.js.map +1 -1
  310. package/build-module/components/block-variation-picker/index.js +2 -3
  311. package/build-module/components/block-variation-picker/index.js.map +1 -1
  312. package/build-module/components/colors/utils.js +3 -7
  313. package/build-module/components/colors/utils.js.map +1 -1
  314. package/build-module/components/colors-gradients/control.js +0 -3
  315. package/build-module/components/colors-gradients/control.js.map +1 -1
  316. package/build-module/components/colors-gradients/dropdown.js +0 -2
  317. package/build-module/components/colors-gradients/dropdown.js.map +1 -1
  318. package/build-module/components/colors-gradients/panel-color-gradient-settings.js +4 -19
  319. package/build-module/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
  320. package/build-module/components/colors-gradients/use-multiple-origin-colors-and-gradients.js +4 -2
  321. package/build-module/components/colors-gradients/use-multiple-origin-colors-and-gradients.js.map +1 -1
  322. package/build-module/components/copy-handler/index.js +38 -10
  323. package/build-module/components/copy-handler/index.js.map +1 -1
  324. package/build-module/components/font-sizes/fluid-utils.js +5 -2
  325. package/build-module/components/font-sizes/fluid-utils.js.map +1 -1
  326. package/build-module/components/font-sizes/utils.js +11 -5
  327. package/build-module/components/font-sizes/utils.js.map +1 -1
  328. package/build-module/components/font-sizes/with-font-sizes.js +12 -7
  329. package/build-module/components/font-sizes/with-font-sizes.js.map +1 -1
  330. package/build-module/components/gradients/use-gradient.js +2 -7
  331. package/build-module/components/gradients/use-gradient.js.map +1 -1
  332. package/build-module/components/height-control/index.js +103 -0
  333. package/build-module/components/height-control/index.js.map +1 -0
  334. package/build-module/components/iframe/index.js +21 -101
  335. package/build-module/components/iframe/index.js.map +1 -1
  336. package/build-module/components/iframe/use-compatibility-styles.js +85 -0
  337. package/build-module/components/iframe/use-compatibility-styles.js.map +1 -0
  338. package/build-module/components/image-editor/use-save-image.js +2 -0
  339. package/build-module/components/image-editor/use-save-image.js.map +1 -1
  340. package/build-module/components/image-editor/zoom-dropdown.js +1 -0
  341. package/build-module/components/image-editor/zoom-dropdown.js.map +1 -1
  342. package/build-module/components/index.js +1 -0
  343. package/build-module/components/index.js.map +1 -1
  344. package/build-module/components/inner-blocks/index.js +27 -9
  345. package/build-module/components/inner-blocks/index.js.map +1 -1
  346. package/build-module/components/inner-blocks/use-inner-block-template-sync.js +23 -10
  347. package/build-module/components/inner-blocks/use-inner-block-template-sync.js.map +1 -1
  348. package/build-module/components/inserter/block-patterns-explorer/sidebar.js +1 -0
  349. package/build-module/components/inserter/block-patterns-explorer/sidebar.js.map +1 -1
  350. package/build-module/components/inserter/block-patterns-tab.js +27 -49
  351. package/build-module/components/inserter/block-patterns-tab.js.map +1 -1
  352. package/build-module/components/inserter/block-types-tab.js +3 -2
  353. package/build-module/components/inserter/block-types-tab.js.map +1 -1
  354. package/build-module/components/inserter/hooks/use-debounced-input.js +18 -0
  355. package/build-module/components/inserter/hooks/use-debounced-input.js.map +1 -0
  356. package/build-module/components/inserter/hooks/use-insertion-point.js +4 -3
  357. package/build-module/components/inserter/hooks/use-insertion-point.js.map +1 -1
  358. package/build-module/components/inserter/index.js +20 -6
  359. package/build-module/components/inserter/index.js.map +1 -1
  360. package/build-module/components/inserter/index.native.js +3 -5
  361. package/build-module/components/inserter/index.native.js.map +1 -1
  362. package/build-module/components/inserter/media-tab/hooks.js +92 -0
  363. package/build-module/components/inserter/media-tab/hooks.js.map +1 -0
  364. package/build-module/components/inserter/media-tab/index.js +4 -0
  365. package/build-module/components/inserter/media-tab/index.js.map +1 -0
  366. package/build-module/components/inserter/media-tab/media-list.js +86 -0
  367. package/build-module/components/inserter/media-tab/media-list.js.map +1 -0
  368. package/build-module/components/inserter/media-tab/media-panel.js +77 -0
  369. package/build-module/components/inserter/media-tab/media-panel.js.map +1 -0
  370. package/build-module/components/inserter/media-tab/media-tab.js +100 -0
  371. package/build-module/components/inserter/media-tab/media-tab.js.map +1 -0
  372. package/build-module/components/inserter/media-tab/utils.js +45 -0
  373. package/build-module/components/inserter/media-tab/utils.js.map +1 -0
  374. package/build-module/components/inserter/menu.js +33 -12
  375. package/build-module/components/inserter/menu.js.map +1 -1
  376. package/build-module/components/inserter/mobile-tab-navigation.js +61 -0
  377. package/build-module/components/inserter/mobile-tab-navigation.js.map +1 -0
  378. package/build-module/components/inserter/quick-inserter.js +7 -3
  379. package/build-module/components/inserter/quick-inserter.js.map +1 -1
  380. package/build-module/components/inserter/search-items.js +15 -13
  381. package/build-module/components/inserter/search-items.js.map +1 -1
  382. package/build-module/components/inserter/search-results.js +7 -4
  383. package/build-module/components/inserter/search-results.js.map +1 -1
  384. package/build-module/components/inserter/tabs.js +15 -2
  385. package/build-module/components/inserter/tabs.js.map +1 -1
  386. package/build-module/components/inserter-list-item/index.js +5 -2
  387. package/build-module/components/inserter-list-item/index.js.map +1 -1
  388. package/build-module/components/inspector-controls/groups.js +2 -0
  389. package/build-module/components/inspector-controls/groups.js.map +1 -1
  390. package/build-module/components/inspector-controls-tabs/advanced-controls-panel.js +32 -0
  391. package/build-module/components/inspector-controls-tabs/advanced-controls-panel.js.map +1 -0
  392. package/build-module/components/inspector-controls-tabs/index.js +56 -0
  393. package/build-module/components/inspector-controls-tabs/index.js.map +1 -0
  394. package/build-module/components/inspector-controls-tabs/settings-tab.js +17 -0
  395. package/build-module/components/inspector-controls-tabs/settings-tab.js.map +1 -0
  396. package/build-module/components/inspector-controls-tabs/styles-tab.js +46 -0
  397. package/build-module/components/inspector-controls-tabs/styles-tab.js.map +1 -0
  398. package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js +81 -0
  399. package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +1 -0
  400. package/build-module/components/inspector-controls-tabs/use-is-list-view-tab-disabled.js +8 -0
  401. package/build-module/components/inspector-controls-tabs/use-is-list-view-tab-disabled.js.map +1 -0
  402. package/build-module/components/inspector-controls-tabs/utils.js +26 -0
  403. package/build-module/components/inspector-controls-tabs/utils.js.map +1 -0
  404. package/build-module/components/link-control/index.js +1 -0
  405. package/build-module/components/link-control/index.js.map +1 -1
  406. package/build-module/components/link-control/search-input.js +0 -1
  407. package/build-module/components/link-control/search-input.js.map +1 -1
  408. package/build-module/components/link-control/use-internal-input-value.js +3 -3
  409. package/build-module/components/link-control/use-internal-input-value.js.map +1 -1
  410. package/build-module/components/list-view/block-select-button.js +1 -1
  411. package/build-module/components/list-view/block-select-button.js.map +1 -1
  412. package/build-module/components/list-view/block.js +5 -2
  413. package/build-module/components/list-view/block.js.map +1 -1
  414. package/build-module/components/list-view/branch.js +12 -11
  415. package/build-module/components/list-view/branch.js.map +1 -1
  416. package/build-module/components/media-upload/index.native.js +2 -4
  417. package/build-module/components/media-upload/index.native.js.map +1 -1
  418. package/build-module/components/off-canvas-editor/appender.js +83 -0
  419. package/build-module/components/off-canvas-editor/appender.js.map +1 -0
  420. package/build-module/components/off-canvas-editor/block-edit-button.js +35 -0
  421. package/build-module/components/off-canvas-editor/block-edit-button.js.map +1 -0
  422. package/build-module/components/off-canvas-editor/block-select-button.js +3 -2
  423. package/build-module/components/off-canvas-editor/block-select-button.js.map +1 -1
  424. package/build-module/components/off-canvas-editor/block.js +83 -41
  425. package/build-module/components/off-canvas-editor/block.js.map +1 -1
  426. package/build-module/components/off-canvas-editor/branch.js +3 -4
  427. package/build-module/components/off-canvas-editor/branch.js.map +1 -1
  428. package/build-module/components/off-canvas-editor/index.js +24 -12
  429. package/build-module/components/off-canvas-editor/index.js.map +1 -1
  430. package/build-module/components/off-canvas-editor/leaf.js +1 -1
  431. package/build-module/components/off-canvas-editor/leaf.js.map +1 -1
  432. package/build-module/components/off-canvas-editor/link-ui.js +165 -0
  433. package/build-module/components/off-canvas-editor/link-ui.js.map +1 -0
  434. package/build-module/components/off-canvas-editor/update-attributes.js +97 -0
  435. package/build-module/components/off-canvas-editor/update-attributes.js.map +1 -0
  436. package/build-module/components/off-canvas-editor/use-inserted-block.js +47 -0
  437. package/build-module/components/off-canvas-editor/use-inserted-block.js.map +1 -0
  438. package/build-module/components/responsive-block-control/label.js +1 -2
  439. package/build-module/components/responsive-block-control/label.js.map +1 -1
  440. package/build-module/components/rich-text/format-edit.js +12 -9
  441. package/build-module/components/rich-text/format-edit.js.map +1 -1
  442. package/build-module/components/rich-text/format-toolbar/index.js +6 -2
  443. package/build-module/components/rich-text/format-toolbar/index.js.map +1 -1
  444. package/build-module/components/rich-text/index.js +2 -3
  445. package/build-module/components/rich-text/index.js.map +1 -1
  446. package/build-module/components/rich-text/index.native.js +0 -2
  447. package/build-module/components/rich-text/index.native.js.map +1 -1
  448. package/build-module/components/rich-text/use-insert-replacement-text.js +33 -0
  449. package/build-module/components/rich-text/use-insert-replacement-text.js.map +1 -0
  450. package/build-module/components/rich-text/use-paste-handler.js +22 -12
  451. package/build-module/components/rich-text/use-paste-handler.js.map +1 -1
  452. package/build-module/components/rich-text/use-undo-automatic-change.js +9 -1
  453. package/build-module/components/rich-text/use-undo-automatic-change.js.map +1 -1
  454. package/build-module/components/rich-text/utils.js +1 -16
  455. package/build-module/components/rich-text/utils.js.map +1 -1
  456. package/build-module/components/spacing-sizes-control/index.js +0 -1
  457. package/build-module/components/spacing-sizes-control/index.js.map +1 -1
  458. package/build-module/components/spacing-sizes-control/spacing-input-control.js +12 -3
  459. package/build-module/components/spacing-sizes-control/spacing-input-control.js.map +1 -1
  460. package/build-module/components/spacing-sizes-control/utils.js +1 -1
  461. package/build-module/components/spacing-sizes-control/utils.js.map +1 -1
  462. package/build-module/components/typewriter/index.js +1 -1
  463. package/build-module/components/typewriter/index.js.map +1 -1
  464. package/build-module/components/ungroup-button/index.native.js +3 -2
  465. package/build-module/components/ungroup-button/index.native.js.map +1 -1
  466. package/build-module/components/url-input/index.js +46 -43
  467. package/build-module/components/url-input/index.js.map +1 -1
  468. package/build-module/components/url-popover/image-url-input-ui.js +3 -3
  469. package/build-module/components/url-popover/image-url-input-ui.js.map +1 -1
  470. package/build-module/components/use-block-display-information/index.js +9 -5
  471. package/build-module/components/use-block-display-information/index.js.map +1 -1
  472. package/build-module/components/use-setting/index.js +8 -1
  473. package/build-module/components/use-setting/index.js.map +1 -1
  474. package/build-module/components/writing-flow/index.js +1 -1
  475. package/build-module/components/writing-flow/index.js.map +1 -1
  476. package/build-module/hooks/border.js +0 -1
  477. package/build-module/hooks/border.js.map +1 -1
  478. package/build-module/hooks/child-layout.js +189 -0
  479. package/build-module/hooks/child-layout.js.map +1 -0
  480. package/build-module/hooks/color-panel.js +0 -1
  481. package/build-module/hooks/color-panel.js.map +1 -1
  482. package/build-module/hooks/color.js +1 -2
  483. package/build-module/hooks/color.js.map +1 -1
  484. package/build-module/hooks/content-lock-ui.js +1 -1
  485. package/build-module/hooks/content-lock-ui.js.map +1 -1
  486. package/build-module/hooks/dimensions.js +25 -8
  487. package/build-module/hooks/dimensions.js.map +1 -1
  488. package/build-module/hooks/font-family.js +5 -5
  489. package/build-module/hooks/font-family.js.map +1 -1
  490. package/build-module/hooks/font-size.js +5 -3
  491. package/build-module/hooks/font-size.js.map +1 -1
  492. package/build-module/hooks/layout.js +55 -0
  493. package/build-module/hooks/layout.js.map +1 -1
  494. package/build-module/hooks/min-height.js +3 -9
  495. package/build-module/hooks/min-height.js.map +1 -1
  496. package/build-module/hooks/use-typography-props.js +11 -8
  497. package/build-module/hooks/use-typography-props.js.map +1 -1
  498. package/build-module/store/reducer.js +409 -274
  499. package/build-module/store/reducer.js.map +1 -1
  500. package/build-module/store/selectors.js +55 -48
  501. package/build-module/store/selectors.js.map +1 -1
  502. package/build-module/utils/pasting.js +6 -10
  503. package/build-module/utils/pasting.js.map +1 -1
  504. package/build-module/utils/sorting.js +56 -0
  505. package/build-module/utils/sorting.js.map +1 -0
  506. package/build-style/content-rtl.css +701 -0
  507. package/build-style/content.css +701 -0
  508. package/build-style/default-editor-styles-rtl.css +17 -3
  509. package/build-style/default-editor-styles.css +17 -3
  510. package/build-style/style-rtl.css +313 -665
  511. package/build-style/style.css +313 -665
  512. package/package.json +32 -30
  513. package/src/autocompleters/block.js +2 -6
  514. package/src/autocompleters/link.js +2 -0
  515. package/src/components/alignment-control/test/index.js +6 -1
  516. package/src/components/alignment-control/ui.js +1 -7
  517. package/src/components/block-alignment-control/test/index.js +6 -1
  518. package/src/components/block-alignment-control/use-available-alignments.js +4 -3
  519. package/src/components/block-card/index.js +46 -2
  520. package/src/components/block-card/style.scss +4 -0
  521. package/src/components/block-content-overlay/{style.scss → content.scss} +7 -1
  522. package/src/components/block-draggable/content.scss +20 -0
  523. package/src/components/block-draggable/index.native.js +54 -40
  524. package/src/components/block-draggable/style.scss +0 -21
  525. package/src/components/block-draggable/test/helpers.native.js +7 -9
  526. package/src/components/block-draggable/test/index.native.js +35 -45
  527. package/src/components/block-edit/edit.js +5 -2
  528. package/src/components/block-edit/edit.native.js +5 -6
  529. package/src/components/block-icon/index.js +4 -2
  530. package/src/components/block-icon/test/index.js +9 -5
  531. package/src/components/block-inspector/index.js +173 -85
  532. package/src/components/block-inspector/style.scss +16 -1
  533. package/src/components/block-list/block-list-context.native.js +5 -8
  534. package/src/components/block-list/block.js +74 -23
  535. package/src/components/block-list/block.native.js +78 -23
  536. package/src/components/block-list/{style.scss → content.scss} +1 -15
  537. package/src/components/block-list-appender/{style.scss → content.scss} +0 -0
  538. package/src/components/block-list-appender/index.js +65 -54
  539. package/src/components/block-list-appender/index.native.js +45 -34
  540. package/src/components/block-mobile-toolbar/block-actions-menu.native.js +42 -28
  541. package/src/components/block-mobile-toolbar/index.native.js +1 -1
  542. package/src/components/block-mobile-toolbar/test/__snapshots__/block-actions-menu.native.js.snap +125 -0
  543. package/src/components/block-mobile-toolbar/test/block-actions-menu.native.js +439 -0
  544. package/src/components/block-mover/test/__snapshots__/index.native.js.snap +42 -2
  545. package/src/components/block-mover/test/index.native.js +157 -1
  546. package/src/components/block-pattern-setup/index.js +17 -7
  547. package/src/components/block-pattern-setup/style.scss +29 -1
  548. package/src/components/block-patterns-list/index.js +47 -24
  549. package/src/components/block-preview/README.md +15 -10
  550. package/src/components/block-preview/auto.js +7 -1
  551. package/src/components/block-preview/content.scss +4 -0
  552. package/src/components/block-preview/index.js +7 -12
  553. package/src/components/block-preview/style.scss +0 -7
  554. package/src/components/block-preview/test/index.js +18 -35
  555. package/src/components/block-selection-clearer/test/index.js +12 -12
  556. package/src/components/block-settings-menu/block-settings-dropdown.js +32 -20
  557. package/src/components/block-styles/index.native.js +1 -2
  558. package/src/components/block-styles/utils.js +5 -7
  559. package/src/components/block-switcher/test/index.js +6 -1
  560. package/src/components/block-toolbar/index.js +12 -5
  561. package/src/components/block-toolbar/index.native.js +8 -11
  562. package/src/components/block-toolbar/style.scss +10 -0
  563. package/src/components/block-tools/insertion-point.js +3 -47
  564. package/src/components/block-tools/selected-block-popover.js +1 -3
  565. package/src/components/block-tools/style.scss +12 -5
  566. package/src/components/block-variation-picker/index.js +6 -5
  567. package/src/components/block-vertical-alignment-control/test/index.js +6 -1
  568. package/src/components/colors/test/with-colors.js +2 -0
  569. package/src/components/colors/utils.js +5 -3
  570. package/src/components/colors-gradients/control.js +0 -7
  571. package/src/components/colors-gradients/dropdown.js +0 -2
  572. package/src/components/colors-gradients/panel-color-gradient-settings.js +4 -22
  573. package/src/components/colors-gradients/use-multiple-origin-colors-and-gradients.js +4 -2
  574. package/src/components/copy-handler/index.js +53 -7
  575. package/src/components/default-block-appender/{style.scss → content.scss} +0 -0
  576. package/src/components/default-block-appender/test/index.js +2 -0
  577. package/src/components/font-sizes/fluid-utils.js +7 -1
  578. package/src/components/font-sizes/utils.js +5 -3
  579. package/src/components/font-sizes/with-font-sizes.js +4 -4
  580. package/src/components/gradients/use-gradient.js +2 -7
  581. package/src/components/height-control/index.js +123 -0
  582. package/src/components/height-control/stories/index.js +21 -0
  583. package/src/components/height-control/style.scss +5 -0
  584. package/src/components/iframe/index.js +33 -121
  585. package/src/components/iframe/use-compatibility-styles.js +95 -0
  586. package/src/components/image-editor/use-save-image.js +2 -0
  587. package/src/components/image-editor/zoom-dropdown.js +1 -0
  588. package/src/components/image-size-control/test/index.js +147 -79
  589. package/src/components/index.js +1 -0
  590. package/src/components/inner-blocks/{style.scss → content.scss} +0 -0
  591. package/src/components/inner-blocks/index.js +26 -7
  592. package/src/components/inner-blocks/use-inner-block-template-sync.js +28 -10
  593. package/src/components/inserter/block-patterns-explorer/sidebar.js +1 -0
  594. package/src/components/inserter/block-patterns-tab.js +28 -71
  595. package/src/components/inserter/block-types-tab.js +3 -2
  596. package/src/components/inserter/hooks/use-debounced-input.js +17 -0
  597. package/src/components/inserter/hooks/use-insertion-point.js +3 -2
  598. package/src/components/inserter/index.js +24 -3
  599. package/src/components/inserter/index.native.js +1 -1
  600. package/src/components/inserter/media-tab/hooks.js +89 -0
  601. package/src/components/inserter/media-tab/index.js +3 -0
  602. package/src/components/inserter/media-tab/media-list.js +93 -0
  603. package/src/components/inserter/media-tab/media-panel.js +83 -0
  604. package/src/components/inserter/media-tab/media-tab.js +135 -0
  605. package/src/components/inserter/media-tab/utils.js +37 -0
  606. package/src/components/inserter/menu.js +55 -13
  607. package/src/components/inserter/mobile-tab-navigation.js +85 -0
  608. package/src/components/inserter/quick-inserter.js +4 -0
  609. package/src/components/inserter/search-items.js +1 -2
  610. package/src/components/inserter/search-results.js +5 -2
  611. package/src/components/inserter/stories/index.js +1 -1
  612. package/src/components/inserter/stories/{fixtures.js → utils/fixtures.js} +0 -0
  613. package/src/components/inserter/style.scss +176 -11
  614. package/src/components/inserter/tabs.js +12 -1
  615. package/src/components/inserter-list-item/index.js +11 -1
  616. package/src/components/inserter-list-item/style.scss +26 -0
  617. package/src/components/inspector-controls/groups.js +2 -0
  618. package/src/components/inspector-controls-tabs/advanced-controls-panel.js +37 -0
  619. package/src/components/inspector-controls-tabs/index.js +62 -0
  620. package/src/components/inspector-controls-tabs/settings-tab.js +18 -0
  621. package/src/components/inspector-controls-tabs/styles-tab.js +51 -0
  622. package/src/components/inspector-controls-tabs/use-inspector-controls-tabs.js +89 -0
  623. package/src/components/inspector-controls-tabs/use-is-list-view-tab-disabled.js +9 -0
  624. package/src/components/inspector-controls-tabs/utils.js +28 -0
  625. package/src/components/line-height-control/test/index.js +5 -5
  626. package/src/components/link-control/README.md +1 -1
  627. package/src/components/link-control/index.js +1 -0
  628. package/src/components/link-control/search-input.js +0 -1
  629. package/src/components/link-control/test/index.js +204 -403
  630. package/src/components/link-control/use-internal-input-value.js +3 -3
  631. package/src/components/list-view/block-select-button.js +1 -1
  632. package/src/components/list-view/block.js +3 -0
  633. package/src/components/list-view/branch.js +10 -8
  634. package/src/components/list-view/style.scss +21 -16
  635. package/src/components/media-placeholder/{style.scss → content.scss} +0 -0
  636. package/src/components/media-replace-flow/test/index.js +39 -9
  637. package/src/components/media-upload/test/index.native.js +2 -0
  638. package/src/components/off-canvas-editor/appender.js +98 -0
  639. package/src/components/off-canvas-editor/block-edit-button.js +27 -0
  640. package/src/components/off-canvas-editor/block-select-button.js +6 -2
  641. package/src/components/off-canvas-editor/block.js +160 -77
  642. package/src/components/off-canvas-editor/branch.js +3 -5
  643. package/src/components/off-canvas-editor/index.js +68 -33
  644. package/src/components/off-canvas-editor/leaf.js +5 -1
  645. package/src/components/off-canvas-editor/link-ui.js +166 -0
  646. package/src/components/off-canvas-editor/style.scss +19 -386
  647. package/src/components/off-canvas-editor/test/use-inserted-block.js +108 -0
  648. package/src/components/off-canvas-editor/update-attributes.js +99 -0
  649. package/src/components/off-canvas-editor/use-inserted-block.js +47 -0
  650. package/src/components/plain-text/{style.scss → content.scss} +0 -0
  651. package/src/components/recursion-provider/test/index.js +27 -29
  652. package/src/components/responsive-block-control/label.js +2 -3
  653. package/src/components/responsive-block-control/test/index.js +4 -2
  654. package/src/components/rich-text/content.scss +42 -0
  655. package/src/components/rich-text/format-edit.js +6 -10
  656. package/src/components/rich-text/format-toolbar/index.js +6 -4
  657. package/src/components/rich-text/index.js +3 -2
  658. package/src/components/rich-text/index.native.js +0 -2
  659. package/src/components/rich-text/style.scss +0 -43
  660. package/src/components/rich-text/use-insert-replacement-text.js +31 -0
  661. package/src/components/rich-text/use-paste-handler.js +33 -14
  662. package/src/components/rich-text/use-undo-automatic-change.js +7 -1
  663. package/src/components/rich-text/utils.js +2 -21
  664. package/src/components/spacing-sizes-control/index.js +0 -1
  665. package/src/components/spacing-sizes-control/spacing-input-control.js +9 -0
  666. package/src/components/spacing-sizes-control/utils.js +1 -1
  667. package/src/components/typewriter/index.js +3 -1
  668. package/src/components/ungroup-button/index.native.js +6 -2
  669. package/src/components/url-input/index.js +57 -73
  670. package/src/components/url-input/test/button.js +2 -0
  671. package/src/components/url-popover/image-url-input-ui.js +5 -4
  672. package/src/components/url-popover/test/__snapshots__/index.js.snap +8 -6
  673. package/src/components/url-popover/test/index.js +37 -9
  674. package/src/components/use-block-display-information/index.js +14 -5
  675. package/src/components/use-setting/index.js +13 -1
  676. package/src/components/use-setting/test/index.js +99 -0
  677. package/src/components/warning/test/index.js +2 -0
  678. package/src/components/writing-flow/index.js +1 -1
  679. package/src/content.scss +10 -0
  680. package/src/hooks/border.js +0 -1
  681. package/src/hooks/child-layout.js +190 -0
  682. package/src/hooks/color-panel.js +0 -1
  683. package/src/hooks/color.js +0 -2
  684. package/src/hooks/content-lock-ui.js +1 -1
  685. package/src/hooks/dimensions.js +45 -7
  686. package/src/hooks/font-family.js +3 -5
  687. package/src/hooks/font-size.js +13 -4
  688. package/src/hooks/layout.js +60 -0
  689. package/src/hooks/min-height.js +2 -19
  690. package/src/hooks/test/use-typography-props.js +26 -0
  691. package/src/hooks/use-typography-props.js +15 -7
  692. package/src/store/reducer.js +471 -428
  693. package/src/store/selectors.js +57 -59
  694. package/src/store/test/performance.js +71 -0
  695. package/src/store/test/reducer.js +623 -491
  696. package/src/store/test/selectors.js +1820 -1306
  697. package/src/style.scss +4 -7
  698. package/src/utils/pasting.js +3 -9
  699. package/src/utils/sorting.js +54 -0
  700. package/src/utils/test/sorting.js +49 -0
  701. package/tsconfig.tsbuildinfo +1 -1
  702. package/build/components/block-preview/live.js +0 -30
  703. package/build/components/block-preview/live.js.map +0 -1
  704. package/build/components/colors-gradients/use-common-single-multiple-selects.js +0 -21
  705. package/build/components/colors-gradients/use-common-single-multiple-selects.js.map +0 -1
  706. package/build/components/rich-text/file-paste-handler.js +0 -21
  707. package/build/components/rich-text/file-paste-handler.js.map +0 -1
  708. package/build-module/components/block-preview/live.js +0 -20
  709. package/build-module/components/block-preview/live.js.map +0 -1
  710. package/build-module/components/colors-gradients/use-common-single-multiple-selects.js +0 -11
  711. package/build-module/components/colors-gradients/use-common-single-multiple-selects.js.map +0 -1
  712. package/build-module/components/rich-text/file-paste-handler.js +0 -13
  713. package/build-module/components/rich-text/file-paste-handler.js.map +0 -1
  714. package/src/components/block-preview/live.js +0 -19
  715. package/src/components/colors-gradients/use-common-single-multiple-selects.js +0 -11
  716. package/src/components/rich-text/file-paste-handler.js +0 -13
@@ -10,16 +10,10 @@ exports.getDefaultStyle = getDefaultStyle;
10
10
  exports.getRenderedStyles = getRenderedStyles;
11
11
  exports.replaceActiveStyle = replaceActiveStyle;
12
12
 
13
- var _lodash = require("lodash");
14
-
15
13
  var _tokenList = _interopRequireDefault(require("@wordpress/token-list"));
16
14
 
17
15
  var _i18n = require("@wordpress/i18n");
18
16
 
19
- /**
20
- * External dependencies
21
- */
22
-
23
17
  /**
24
18
  * WordPress dependencies
25
19
  */
@@ -39,8 +33,11 @@ function getActiveStyle(styles, className) {
39
33
  }
40
34
 
41
35
  const potentialStyleName = style.substring(9);
42
- const activeStyle = (0, _lodash.find)(styles, {
43
- name: potentialStyleName
36
+ const activeStyle = styles === null || styles === void 0 ? void 0 : styles.find(_ref => {
37
+ let {
38
+ name
39
+ } = _ref;
40
+ return name === potentialStyleName;
44
41
  });
45
42
 
46
43
  if (activeStyle) {
@@ -48,7 +45,7 @@ function getActiveStyle(styles, className) {
48
45
  }
49
46
  }
50
47
 
51
- return (0, _lodash.find)(styles, 'isDefault');
48
+ return getDefaultStyle(styles);
52
49
  }
53
50
  /**
54
51
  * Replaces the active style in the block's className.
@@ -104,6 +101,6 @@ function getRenderedStyles(styles) {
104
101
 
105
102
 
106
103
  function getDefaultStyle(styles) {
107
- return (0, _lodash.find)(styles, 'isDefault');
104
+ return styles === null || styles === void 0 ? void 0 : styles.find(style => style.isDefault);
108
105
  }
109
106
  //# sourceMappingURL=utils.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/block-styles/utils.js"],"names":["getActiveStyle","styles","className","style","TokenList","values","indexOf","potentialStyleName","substring","activeStyle","name","replaceActiveStyle","newStyle","list","remove","add","value","getRenderedStyles","length","getDefaultStyle","label","isDefault"],"mappings":";;;;;;;;;;;;AAGA;;AAIA;;AACA;;AARA;AACA;AACA;;AAEA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,cAAT,CAAyBC,MAAzB,EAAiCC,SAAjC,EAA6C;AACnD,OAAM,MAAMC,KAAZ,IAAqB,IAAIC,kBAAJ,CAAeF,SAAf,EAA2BG,MAA3B,EAArB,EAA2D;AAC1D,QAAKF,KAAK,CAACG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AACA","sourcesContent":["/**\n * External dependencies\n */\nimport { find } from 'lodash';\n/**\n * WordPress dependencies\n */\nimport TokenList from '@wordpress/token-list';\nimport { _x } from '@wordpress/i18n';\n\n/**\n * Returns the active style from the given className.\n *\n * @param {Array} styles Block styles.\n * @param {string} className Class name\n *\n * @return {Object?} The active style.\n */\nexport function getActiveStyle( styles, className ) {\n\tfor ( const style of new TokenList( className ).values() ) {\n\t\tif ( style.indexOf( 'is-style-' ) === -1 ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst potentialStyleName = style.substring( 9 );\n\t\tconst activeStyle = find( styles, { name: potentialStyleName } );\n\t\tif ( activeStyle ) {\n\t\t\treturn activeStyle;\n\t\t}\n\t}\n\n\treturn find( styles, 'isDefault' );\n}\n\n/**\n * Replaces the active style in the block's className.\n *\n * @param {string} className Class name.\n * @param {Object?} activeStyle The replaced style.\n * @param {Object} newStyle The replacing style.\n *\n * @return {string} The updated className.\n */\nexport function replaceActiveStyle( className, activeStyle, newStyle ) {\n\tconst list = new TokenList( className );\n\n\tif ( activeStyle ) {\n\t\tlist.remove( 'is-style-' + activeStyle.name );\n\t}\n\n\tlist.add( 'is-style-' + newStyle.name );\n\n\treturn list.value;\n}\n\n/**\n * Returns a collection of styles that can be represented on the frontend.\n * The function checks a style collection for a default style. If none is found, it adds one to\n * act as a fallback for when there is no active style applied to a block. The default item also serves\n * as a switch on the frontend to deactivate non-default styles.\n *\n * @param {Array} styles Block styles.\n *\n * @return {Array<Object?>} The style collection.\n */\nexport function getRenderedStyles( styles ) {\n\tif ( ! styles || styles.length === 0 ) {\n\t\treturn [];\n\t}\n\n\treturn getDefaultStyle( styles )\n\t\t? styles\n\t\t: [\n\t\t\t\t{\n\t\t\t\t\tname: 'default',\n\t\t\t\t\tlabel: _x( 'Default', 'block style' ),\n\t\t\t\t\tisDefault: true,\n\t\t\t\t},\n\t\t\t\t...styles,\n\t\t ];\n}\n\n/**\n * Returns a style object from a collection of styles where that style object is the default block style.\n *\n * @param {Array} styles Block styles.\n *\n * @return {Object?} The default style object, if found.\n */\nexport function getDefaultStyle( styles ) {\n\treturn find( styles, 'isDefault' );\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/block-styles/utils.js"],"names":["getActiveStyle","styles","className","style","TokenList","values","indexOf","potentialStyleName","substring","activeStyle","find","name","getDefaultStyle","replaceActiveStyle","newStyle","list","remove","add","value","getRenderedStyles","length","label","isDefault"],"mappings":";;;;;;;;;;;;AAGA;;AACA;;AAJA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,cAAT,CAAyBC,MAAzB,EAAiCC,SAAjC,EAA6C;AACnD,OAAM,MAAMC,KAAZ,IAAqB,IAAIC,kBAAJ,CAAeF,SAAf,EAA2BG,MAA3B,EAArB,EAA2D;AAC1D,QAAKF,KAAK,CAACG,OAAN,CAAe,WAAf,MAAiC,CAAC,CAAvC,EAA2C;AAC1C;AACA;;AAED,UAAMC,kBAAkB,GAAGJ,KAAK,CAACK,SAAN,CAAiB,CAAjB,CAA3B;AACA,UAAMC,WAAW,GAAGR,MAAH,aAAGA,MAAH,uBAAGA,MAAM,CAAES,IAAR,CACnB;AAAA,UAAE;AAAEC,QAAAA;AAAF,OAAF;AAAA,aAAgBA,IAAI,KAAKJ,kBAAzB;AAAA,KADmB,CAApB;;AAGA,QAAKE,WAAL,EAAmB;AAClB,aAAOA,WAAP;AACA;AACD;;AAED,SAAOG,eAAe,CAAEX,MAAF,CAAtB;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASY,kBAAT,CAA6BX,SAA7B,EAAwCO,WAAxC,EAAqDK,QAArD,EAAgE;AACtE,QAAMC,IAAI,GAAG,IAAIX,kBAAJ,CAAeF,SAAf,CAAb;;AAEA,MAAKO,WAAL,EAAmB;AAClBM,IAAAA,IAAI,CAACC,MAAL,CAAa,cAAcP,WAAW,CAACE,IAAvC;AACA;;AAEDI,EAAAA,IAAI,CAACE,GAAL,CAAU,cAAcH,QAAQ,CAACH,IAAjC;AAEA,SAAOI,IAAI,CAACG,KAAZ;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASC,iBAAT,CAA4BlB,MAA5B,EAAqC;AAC3C,MAAK,CAAEA,MAAF,IAAYA,MAAM,CAACmB,MAAP,KAAkB,CAAnC,EAAuC;AACtC,WAAO,EAAP;AACA;;AAED,SAAOR,eAAe,CAAEX,MAAF,CAAf,GACJA,MADI,GAEJ,CACA;AACCU,IAAAA,IAAI,EAAE,SADP;AAECU,IAAAA,KAAK,EAAE,cAAI,SAAJ,EAAe,aAAf,CAFR;AAGCC,IAAAA,SAAS,EAAE;AAHZ,GADA,EAMA,GAAGrB,MANH,CAFH;AAUA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASW,eAAT,CAA0BX,MAA1B,EAAmC;AACzC,SAAOA,MAAP,aAAOA,MAAP,uBAAOA,MAAM,CAAES,IAAR,CAAgBP,KAAF,IAAaA,KAAK,CAACmB,SAAjC,CAAP;AACA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport TokenList from '@wordpress/token-list';\nimport { _x } from '@wordpress/i18n';\n\n/**\n * Returns the active style from the given className.\n *\n * @param {Array} styles Block styles.\n * @param {string} className Class name\n *\n * @return {Object?} The active style.\n */\nexport function getActiveStyle( styles, className ) {\n\tfor ( const style of new TokenList( className ).values() ) {\n\t\tif ( style.indexOf( 'is-style-' ) === -1 ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst potentialStyleName = style.substring( 9 );\n\t\tconst activeStyle = styles?.find(\n\t\t\t( { name } ) => name === potentialStyleName\n\t\t);\n\t\tif ( activeStyle ) {\n\t\t\treturn activeStyle;\n\t\t}\n\t}\n\n\treturn getDefaultStyle( styles );\n}\n\n/**\n * Replaces the active style in the block's className.\n *\n * @param {string} className Class name.\n * @param {Object?} activeStyle The replaced style.\n * @param {Object} newStyle The replacing style.\n *\n * @return {string} The updated className.\n */\nexport function replaceActiveStyle( className, activeStyle, newStyle ) {\n\tconst list = new TokenList( className );\n\n\tif ( activeStyle ) {\n\t\tlist.remove( 'is-style-' + activeStyle.name );\n\t}\n\n\tlist.add( 'is-style-' + newStyle.name );\n\n\treturn list.value;\n}\n\n/**\n * Returns a collection of styles that can be represented on the frontend.\n * The function checks a style collection for a default style. If none is found, it adds one to\n * act as a fallback for when there is no active style applied to a block. The default item also serves\n * as a switch on the frontend to deactivate non-default styles.\n *\n * @param {Array} styles Block styles.\n *\n * @return {Array<Object?>} The style collection.\n */\nexport function getRenderedStyles( styles ) {\n\tif ( ! styles || styles.length === 0 ) {\n\t\treturn [];\n\t}\n\n\treturn getDefaultStyle( styles )\n\t\t? styles\n\t\t: [\n\t\t\t\t{\n\t\t\t\t\tname: 'default',\n\t\t\t\t\tlabel: _x( 'Default', 'block style' ),\n\t\t\t\t\tisDefault: true,\n\t\t\t\t},\n\t\t\t\t...styles,\n\t\t ];\n}\n\n/**\n * Returns a style object from a collection of styles where that style object is the default block style.\n *\n * @param {Array} styles Block styles.\n *\n * @return {Object?} The default style object, if found.\n */\nexport function getDefaultStyle( styles ) {\n\treturn styles?.find( ( style ) => style.isDefault );\n}\n"]}
@@ -134,7 +134,11 @@ const BlockToolbar = _ref => {
134
134
 
135
135
  const shouldShowVisualToolbar = isValid && isVisual;
136
136
  const isMultiToolbar = blockClientIds.length > 1;
137
- const classes = (0, _classnames.default)('block-editor-block-toolbar', shouldShowMovers && 'is-showing-movers');
137
+ const isSynced = (0, _blocks.isReusableBlock)(blockType) || (0, _blocks.isTemplatePart)(blockType);
138
+ const classes = (0, _classnames.default)('block-editor-block-toolbar', {
139
+ 'is-showing-movers': shouldShowMovers,
140
+ 'is-synced': isSynced
141
+ });
138
142
  return (0, _element.createElement)("div", {
139
143
  className: classes
140
144
  }, !isMultiToolbar && !displayHeaderToolbar && !isContentLocked && (0, _element.createElement)(_blockParentSelector.default, null), (0, _element.createElement)("div", (0, _extends2.default)({
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/block-toolbar/index.js"],"names":["BlockToolbar","hideDragHandle","blockClientIds","blockClientId","blockType","hasFixedToolbar","isDistractionFree","isValid","isVisual","isContentLocked","select","getBlockName","getBlockMode","getSelectedBlockClientIds","isBlockValid","getBlockRootClientId","getSettings","__unstableGetContentLockingParent","blockEditorStore","selectedBlockClientIds","selectedBlockClientId","blockRootClientId","settings","rootClientId","every","id","toggleBlockHighlight","nodeRef","showMovers","gestures","showMoversGestures","ref","onChange","isFocused","displayHeaderToolbar","shouldShowMovers","length","shouldShowVisualToolbar","isMultiToolbar","classes","name"],"mappings":";;;;;;;;;AASA;;;;AANA;;AAKA;;AAEA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AA5BA;AACA;AACA;;AAGA;AACA;AACA;;AAOA;AACA;AACA;AAcA,MAAMA,YAAY,GAAG,QAA0B;AAAA,MAAxB;AAAEC,IAAAA;AAAF,GAAwB;AAC9C,QAAM;AACLC,IAAAA,cADK;AAELC,IAAAA,aAFK;AAGLC,IAAAA,SAHK;AAILC,IAAAA,eAJK;AAKLC,IAAAA,iBALK;AAMLC,IAAAA,OANK;AAOLC,IAAAA,QAPK;AAQLC,IAAAA;AARK,MASF,qBAAaC,MAAF,IAAc;AAC5B,UAAM;AACLC,MAAAA,YADK;AAELC,MAAAA,YAFK;AAGLC,MAAAA,yBAHK;AAILC,MAAAA,YAJK;AAKLC,MAAAA,oBALK;AAMLC,MAAAA,WANK;AAOLC,MAAAA;AAPK,QAQFP,MAAM,CAAEQ,YAAF,CARV;AASA,UAAMC,sBAAsB,GAAGN,yBAAyB,EAAxD;AACA,UAAMO,qBAAqB,GAAGD,sBAAsB,CAAE,CAAF,CAApD;AACA,UAAME,iBAAiB,GAAGN,oBAAoB,CAAEK,qBAAF,CAA9C;AACA,UAAME,QAAQ,GAAGN,WAAW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C;AAA9B,IATD,EAUC,4BAAC,sBAAD,CAAe,IAAf;AACC,IAAA,KAAK,EAAC,QADP;AAEC,IAAA,SAAS,EAAC;AAFX,IAVD,EAcC,4BAAC,sBAAD,CAAe,IAAf;AACC,IAAA,KAAK,EAAC,OADP;AAEC,IAAA,SAAS,EAAC;AAFX,IAdD,EAkBC,4BAAC,yBAAD,CAA4B,QAA5B;AACC,IAAA,KAAK,EAAGjC,SAAH,aAAGA,SAAH,uBAAGA,SAAS,CAAEoC;AADpB,KAGC,4BAAC,6BAAD,CAAgC,IAAhC,OAHD,CAlBD,CAzBF,EAkDC,4BAAC,gCAAD;AAAyB,IAAA,SAAS,EAAGtC;AAArC,IAlDD,EAmDG,CAAEO,eAAF,IACD,4BAAC,0BAAD;AAAmB,IAAA,SAAS,EAAGP;AAA/B,IApDF,CADD;AAyDA,CAhJD;AAkJA;AACA;AACA;;;eACeF,Y","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useRef } from '@wordpress/element';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { getBlockType, hasBlockSupport } from '@wordpress/blocks';\nimport { ToolbarGroup } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport BlockMover from '../block-mover';\nimport BlockParentSelector from '../block-parent-selector';\nimport BlockSwitcher from '../block-switcher';\nimport BlockControls from '../block-controls';\nimport __unstableBlockToolbarLastItem from './block-toolbar-last-item';\nimport BlockSettingsMenu from '../block-settings-menu';\nimport { BlockLockToolbar } from '../block-lock';\nimport { BlockGroupToolbar } from '../convert-to-group-buttons';\nimport BlockEditVisuallyButton from '../block-edit-visually-button';\nimport { useShowMoversGestures } from './utils';\nimport { store as blockEditorStore } from '../../store';\nimport __unstableBlockNameContext from './block-name-context';\n\nconst BlockToolbar = ( { hideDragHandle } ) => {\n\tconst {\n\t\tblockClientIds,\n\t\tblockClientId,\n\t\tblockType,\n\t\thasFixedToolbar,\n\t\tisDistractionFree,\n\t\tisValid,\n\t\tisVisual,\n\t\tisContentLocked,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetBlockName,\n\t\t\tgetBlockMode,\n\t\t\tgetSelectedBlockClientIds,\n\t\t\tisBlockValid,\n\t\t\tgetBlockRootClientId,\n\t\t\tgetSettings,\n\t\t\t__unstableGetContentLockingParent,\n\t\t} = select( blockEditorStore );\n\t\tconst selectedBlockClientIds = getSelectedBlockClientIds();\n\t\tconst selectedBlockClientId = selectedBlockClientIds[ 0 ];\n\t\tconst blockRootClientId = getBlockRootClientId( selectedBlockClientId );\n\t\tconst settings = getSettings();\n\n\t\treturn {\n\t\t\tblockClientIds: selectedBlockClientIds,\n\t\t\tblockClientId: selectedBlockClientId,\n\t\t\tblockType:\n\t\t\t\tselectedBlockClientId &&\n\t\t\t\tgetBlockType( getBlockName( selectedBlockClientId ) ),\n\t\t\thasFixedToolbar: settings.hasFixedToolbar,\n\t\t\tisDistractionFree: settings.isDistractionFree,\n\t\t\trootClientId: blockRootClientId,\n\t\t\tisValid: selectedBlockClientIds.every( ( id ) =>\n\t\t\t\tisBlockValid( id )\n\t\t\t),\n\t\t\tisVisual: selectedBlockClientIds.every(\n\t\t\t\t( id ) => getBlockMode( id ) === 'visual'\n\t\t\t),\n\t\t\tisContentLocked: !! __unstableGetContentLockingParent(\n\t\t\t\tselectedBlockClientId\n\t\t\t),\n\t\t};\n\t}, [] );\n\n\t// Handles highlighting the current block outline on hover or focus of the\n\t// block type toolbar area.\n\tconst { toggleBlockHighlight } = useDispatch( blockEditorStore );\n\tconst nodeRef = useRef();\n\tconst { showMovers, gestures: showMoversGestures } = useShowMoversGestures(\n\t\t{\n\t\t\tref: nodeRef,\n\t\t\tonChange( isFocused ) {\n\t\t\t\tif ( isFocused && isDistractionFree ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\ttoggleBlockHighlight( blockClientId, isFocused );\n\t\t\t},\n\t\t}\n\t);\n\n\t// Account for the cases where the block toolbar is rendered within the\n\t// header area and not contextually to the block.\n\tconst displayHeaderToolbar =\n\t\tuseViewportMatch( 'medium', '<' ) || hasFixedToolbar;\n\n\tif ( blockType ) {\n\t\tif ( ! hasBlockSupport( blockType, '__experimentalToolbar', true ) ) {\n\t\t\treturn null;\n\t\t}\n\t}\n\n\tconst shouldShowMovers = displayHeaderToolbar || showMovers;\n\n\tif ( blockClientIds.length === 0 ) {\n\t\treturn null;\n\t}\n\n\tconst shouldShowVisualToolbar = isValid && isVisual;\n\tconst isMultiToolbar = blockClientIds.length > 1;\n\n\tconst classes = classnames(\n\t\t'block-editor-block-toolbar',\n\t\tshouldShowMovers && 'is-showing-movers'\n\t);\n\n\treturn (\n\t\t<div className={ classes }>\n\t\t\t{ ! isMultiToolbar &&\n\t\t\t\t! displayHeaderToolbar &&\n\t\t\t\t! isContentLocked && <BlockParentSelector /> }\n\t\t\t<div ref={ nodeRef } { ...showMoversGestures }>\n\t\t\t\t{ ( shouldShowVisualToolbar || isMultiToolbar ) &&\n\t\t\t\t\t! isContentLocked && (\n\t\t\t\t\t\t<ToolbarGroup className=\"block-editor-block-toolbar__block-controls\">\n\t\t\t\t\t\t\t<BlockSwitcher clientIds={ blockClientIds } />\n\t\t\t\t\t\t\t{ ! isMultiToolbar && (\n\t\t\t\t\t\t\t\t<BlockLockToolbar\n\t\t\t\t\t\t\t\t\tclientId={ blockClientIds[ 0 ] }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t<BlockMover\n\t\t\t\t\t\t\t\tclientIds={ blockClientIds }\n\t\t\t\t\t\t\t\thideDragHandle={ hideDragHandle }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</ToolbarGroup>\n\t\t\t\t\t) }\n\t\t\t</div>\n\t\t\t{ shouldShowVisualToolbar && isMultiToolbar && (\n\t\t\t\t<BlockGroupToolbar />\n\t\t\t) }\n\t\t\t{ shouldShowVisualToolbar && (\n\t\t\t\t<>\n\t\t\t\t\t<BlockControls.Slot\n\t\t\t\t\t\tgroup=\"parent\"\n\t\t\t\t\t\tclassName=\"block-editor-block-toolbar__slot\"\n\t\t\t\t\t/>\n\t\t\t\t\t<BlockControls.Slot\n\t\t\t\t\t\tgroup=\"block\"\n\t\t\t\t\t\tclassName=\"block-editor-block-toolbar__slot\"\n\t\t\t\t\t/>\n\t\t\t\t\t<BlockControls.Slot className=\"block-editor-block-toolbar__slot\" />\n\t\t\t\t\t<BlockControls.Slot\n\t\t\t\t\t\tgroup=\"inline\"\n\t\t\t\t\t\tclassName=\"block-editor-block-toolbar__slot\"\n\t\t\t\t\t/>\n\t\t\t\t\t<BlockControls.Slot\n\t\t\t\t\t\tgroup=\"other\"\n\t\t\t\t\t\tclassName=\"block-editor-block-toolbar__slot\"\n\t\t\t\t\t/>\n\t\t\t\t\t<__unstableBlockNameContext.Provider\n\t\t\t\t\t\tvalue={ blockType?.name }\n\t\t\t\t\t>\n\t\t\t\t\t\t<__unstableBlockToolbarLastItem.Slot />\n\t\t\t\t\t</__unstableBlockNameContext.Provider>\n\t\t\t\t</>\n\t\t\t) }\n\t\t\t<BlockEditVisuallyButton clientIds={ blockClientIds } />\n\t\t\t{ ! isContentLocked && (\n\t\t\t\t<BlockSettingsMenu clientIds={ blockClientIds } />\n\t\t\t) }\n\t\t</div>\n\t);\n};\n\n/**\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/block-toolbar/README.md\n */\nexport default BlockToolbar;\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/block-toolbar/index.js"],"names":["BlockToolbar","hideDragHandle","blockClientIds","blockClientId","blockType","hasFixedToolbar","isDistractionFree","isValid","isVisual","isContentLocked","select","getBlockName","getBlockMode","getSelectedBlockClientIds","isBlockValid","getBlockRootClientId","getSettings","__unstableGetContentLockingParent","blockEditorStore","selectedBlockClientIds","selectedBlockClientId","blockRootClientId","settings","rootClientId","every","id","toggleBlockHighlight","nodeRef","showMovers","gestures","showMoversGestures","ref","onChange","isFocused","displayHeaderToolbar","shouldShowMovers","length","shouldShowVisualToolbar","isMultiToolbar","isSynced","classes","name"],"mappings":";;;;;;;;;AASA;;;;AANA;;AAKA;;AAEA;;AACA;;AAMA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAjCA;AACA;AACA;;AAGA;AACA;AACA;;AAYA;AACA;AACA;AAcA,MAAMA,YAAY,GAAG,QAA0B;AAAA,MAAxB;AAAEC,IAAAA;AAAF,GAAwB;AAC9C,QAAM;AACLC,IAAAA,cADK;AAELC,IAAAA,aAFK;AAGLC,IAAAA,SAHK;AAILC,IAAAA,eAJK;AAKLC,IAAAA,iBALK;AAMLC,IAAAA,OANK;AAOLC,IAAAA,QAPK;AAQLC,IAAAA;AARK,MASF,qBAAaC,MAAF,IAAc;AAC5B,UAAM;AACLC,MAAAA,YADK;AAELC,MAAAA,YAFK;AAGLC,MAAAA,yBAHK;AAILC,MAAAA,YAJK;AAKLC,MAAAA,oBALK;AAMLC,MAAAA,WANK;AAOLC,MAAAA;AAPK,QAQFP,MAAM,CAAEQ,YAAF,CARV;AASA,UAAMC,sBAAsB,GAAGN,yBAAyB,EAAxD;AACA,UAAMO,qBAAqB,GAAGD,sBAAsB,CAAE,CAAF,CAApD;AACA,UAAME,iBAAiB,GAAGN,oBAAoB,CAAEK,qBAAF,CAA9C;AACA,UAAME,QAAQ,GAAGN,WAAW,EAA5B;AAEA,WAAO;AACNd,MAAAA,cAAc,EAAEiB,sBADV;AAENhB,MAAAA,aAAa,EAAEiB,qBAFT;AAGNhB,MAAAA,SAAS,EACRgB,qBAAqB,IACrB,0BAAcT,YAAY,CAAES,qBAAF,CAA1B,CALK;AAMNf,MAAAA,eAAe,EAAEiB,QAAQ,CAACjB,eANpB;AAONC,MAAAA,iBAAiB,EAAEgB,QAAQ,CAAChB,iBAPtB;AAQNiB,MAAAA,YAAY,EAAEF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AAFX,IAdD,EAkBC,4BAAC,yBAAD,CAA4B,QAA5B;AACC,IAAA,KAAK,EAAGjC,SAAH,aAAGA,SAAH,uBAAGA,SAAS,CAAEqC;AADpB,KAGC,4BAAC,6BAAD,CAAgC,IAAhC,OAHD,CAlBD,CAzBF,EAkDC,4BAAC,gCAAD;AAAyB,IAAA,SAAS,EAAGvC;AAArC,IAlDD,EAmDG,CAAEO,eAAF,IACD,4BAAC,0BAAD;AAAmB,IAAA,SAAS,EAAGP;AAA/B,IApDF,CADD;AAyDA,CAlJD;AAoJA;AACA;AACA;;;eACeF,Y","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useRef } from '@wordpress/element';\nimport { useViewportMatch } from '@wordpress/compose';\nimport {\n\tgetBlockType,\n\thasBlockSupport,\n\tisReusableBlock,\n\tisTemplatePart,\n} from '@wordpress/blocks';\nimport { ToolbarGroup } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport BlockMover from '../block-mover';\nimport BlockParentSelector from '../block-parent-selector';\nimport BlockSwitcher from '../block-switcher';\nimport BlockControls from '../block-controls';\nimport __unstableBlockToolbarLastItem from './block-toolbar-last-item';\nimport BlockSettingsMenu from '../block-settings-menu';\nimport { BlockLockToolbar } from '../block-lock';\nimport { BlockGroupToolbar } from '../convert-to-group-buttons';\nimport BlockEditVisuallyButton from '../block-edit-visually-button';\nimport { useShowMoversGestures } from './utils';\nimport { store as blockEditorStore } from '../../store';\nimport __unstableBlockNameContext from './block-name-context';\n\nconst BlockToolbar = ( { hideDragHandle } ) => {\n\tconst {\n\t\tblockClientIds,\n\t\tblockClientId,\n\t\tblockType,\n\t\thasFixedToolbar,\n\t\tisDistractionFree,\n\t\tisValid,\n\t\tisVisual,\n\t\tisContentLocked,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetBlockName,\n\t\t\tgetBlockMode,\n\t\t\tgetSelectedBlockClientIds,\n\t\t\tisBlockValid,\n\t\t\tgetBlockRootClientId,\n\t\t\tgetSettings,\n\t\t\t__unstableGetContentLockingParent,\n\t\t} = select( blockEditorStore );\n\t\tconst selectedBlockClientIds = getSelectedBlockClientIds();\n\t\tconst selectedBlockClientId = selectedBlockClientIds[ 0 ];\n\t\tconst blockRootClientId = getBlockRootClientId( selectedBlockClientId );\n\t\tconst settings = getSettings();\n\n\t\treturn {\n\t\t\tblockClientIds: selectedBlockClientIds,\n\t\t\tblockClientId: selectedBlockClientId,\n\t\t\tblockType:\n\t\t\t\tselectedBlockClientId &&\n\t\t\t\tgetBlockType( getBlockName( selectedBlockClientId ) ),\n\t\t\thasFixedToolbar: settings.hasFixedToolbar,\n\t\t\tisDistractionFree: settings.isDistractionFree,\n\t\t\trootClientId: blockRootClientId,\n\t\t\tisValid: selectedBlockClientIds.every( ( id ) =>\n\t\t\t\tisBlockValid( id )\n\t\t\t),\n\t\t\tisVisual: selectedBlockClientIds.every(\n\t\t\t\t( id ) => getBlockMode( id ) === 'visual'\n\t\t\t),\n\t\t\tisContentLocked: !! __unstableGetContentLockingParent(\n\t\t\t\tselectedBlockClientId\n\t\t\t),\n\t\t};\n\t}, [] );\n\n\t// Handles highlighting the current block outline on hover or focus of the\n\t// block type toolbar area.\n\tconst { toggleBlockHighlight } = useDispatch( blockEditorStore );\n\tconst nodeRef = useRef();\n\tconst { showMovers, gestures: showMoversGestures } = useShowMoversGestures(\n\t\t{\n\t\t\tref: nodeRef,\n\t\t\tonChange( isFocused ) {\n\t\t\t\tif ( isFocused && isDistractionFree ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\ttoggleBlockHighlight( blockClientId, isFocused );\n\t\t\t},\n\t\t}\n\t);\n\n\t// Account for the cases where the block toolbar is rendered within the\n\t// header area and not contextually to the block.\n\tconst displayHeaderToolbar =\n\t\tuseViewportMatch( 'medium', '<' ) || hasFixedToolbar;\n\n\tif ( blockType ) {\n\t\tif ( ! hasBlockSupport( blockType, '__experimentalToolbar', true ) ) {\n\t\t\treturn null;\n\t\t}\n\t}\n\n\tconst shouldShowMovers = displayHeaderToolbar || showMovers;\n\n\tif ( blockClientIds.length === 0 ) {\n\t\treturn null;\n\t}\n\n\tconst shouldShowVisualToolbar = isValid && isVisual;\n\tconst isMultiToolbar = blockClientIds.length > 1;\n\tconst isSynced =\n\t\tisReusableBlock( blockType ) || isTemplatePart( blockType );\n\n\tconst classes = classnames( 'block-editor-block-toolbar', {\n\t\t'is-showing-movers': shouldShowMovers,\n\t\t'is-synced': isSynced,\n\t} );\n\n\treturn (\n\t\t<div className={ classes }>\n\t\t\t{ ! isMultiToolbar &&\n\t\t\t\t! displayHeaderToolbar &&\n\t\t\t\t! isContentLocked && <BlockParentSelector /> }\n\t\t\t<div ref={ nodeRef } { ...showMoversGestures }>\n\t\t\t\t{ ( shouldShowVisualToolbar || isMultiToolbar ) &&\n\t\t\t\t\t! isContentLocked && (\n\t\t\t\t\t\t<ToolbarGroup className=\"block-editor-block-toolbar__block-controls\">\n\t\t\t\t\t\t\t<BlockSwitcher clientIds={ blockClientIds } />\n\t\t\t\t\t\t\t{ ! isMultiToolbar && (\n\t\t\t\t\t\t\t\t<BlockLockToolbar\n\t\t\t\t\t\t\t\t\tclientId={ blockClientIds[ 0 ] }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t<BlockMover\n\t\t\t\t\t\t\t\tclientIds={ blockClientIds }\n\t\t\t\t\t\t\t\thideDragHandle={ hideDragHandle }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</ToolbarGroup>\n\t\t\t\t\t) }\n\t\t\t</div>\n\t\t\t{ shouldShowVisualToolbar && isMultiToolbar && (\n\t\t\t\t<BlockGroupToolbar />\n\t\t\t) }\n\t\t\t{ shouldShowVisualToolbar && (\n\t\t\t\t<>\n\t\t\t\t\t<BlockControls.Slot\n\t\t\t\t\t\tgroup=\"parent\"\n\t\t\t\t\t\tclassName=\"block-editor-block-toolbar__slot\"\n\t\t\t\t\t/>\n\t\t\t\t\t<BlockControls.Slot\n\t\t\t\t\t\tgroup=\"block\"\n\t\t\t\t\t\tclassName=\"block-editor-block-toolbar__slot\"\n\t\t\t\t\t/>\n\t\t\t\t\t<BlockControls.Slot className=\"block-editor-block-toolbar__slot\" />\n\t\t\t\t\t<BlockControls.Slot\n\t\t\t\t\t\tgroup=\"inline\"\n\t\t\t\t\t\tclassName=\"block-editor-block-toolbar__slot\"\n\t\t\t\t\t/>\n\t\t\t\t\t<BlockControls.Slot\n\t\t\t\t\t\tgroup=\"other\"\n\t\t\t\t\t\tclassName=\"block-editor-block-toolbar__slot\"\n\t\t\t\t\t/>\n\t\t\t\t\t<__unstableBlockNameContext.Provider\n\t\t\t\t\t\tvalue={ blockType?.name }\n\t\t\t\t\t>\n\t\t\t\t\t\t<__unstableBlockToolbarLastItem.Slot />\n\t\t\t\t\t</__unstableBlockNameContext.Provider>\n\t\t\t\t</>\n\t\t\t) }\n\t\t\t<BlockEditVisuallyButton clientIds={ blockClientIds } />\n\t\t\t{ ! isContentLocked && (\n\t\t\t\t<BlockSettingsMenu clientIds={ blockClientIds } />\n\t\t\t) }\n\t\t</div>\n\t);\n};\n\n/**\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/block-toolbar/README.md\n */\nexport default BlockToolbar;\n"]}
@@ -26,9 +26,8 @@ var _store = require("../../store");
26
26
  */
27
27
  function BlockToolbar() {
28
28
  const {
29
- blockClientIds,
30
- isValid,
31
- mode
29
+ isSelected,
30
+ isValidAndVisual
32
31
  } = (0, _data.useSelect)(select => {
33
32
  const {
34
33
  getBlockMode,
@@ -37,17 +36,16 @@ function BlockToolbar() {
37
36
  } = select(_store.store);
38
37
  const selectedBlockClientIds = getSelectedBlockClientIds();
39
38
  return {
40
- blockClientIds: selectedBlockClientIds,
41
- isValid: selectedBlockClientIds.length === 1 ? isBlockValid(selectedBlockClientIds[0]) : null,
42
- mode: selectedBlockClientIds.length === 1 ? getBlockMode(selectedBlockClientIds[0]) : null
39
+ isSelected: selectedBlockClientIds.length > 0,
40
+ isValidAndVisual: selectedBlockClientIds.length === 1 ? isBlockValid(selectedBlockClientIds[0]) && getBlockMode(selectedBlockClientIds[0]) === 'visual' : false
43
41
  };
44
42
  }, []);
45
43
 
46
- if (blockClientIds.length === 0) {
44
+ if (!isSelected) {
47
45
  return null;
48
46
  }
49
47
 
50
- return (0, _element.createElement)(_element.Fragment, null, mode === 'visual' && isValid && (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_ungroupButton.default, null), (0, _element.createElement)(_blockControls.default.Slot, {
48
+ return (0, _element.createElement)(_element.Fragment, null, isValidAndVisual && (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_ungroupButton.default, null), (0, _element.createElement)(_blockControls.default.Slot, {
51
49
  group: "block"
52
50
  }), (0, _element.createElement)(_blockControls.default.Slot, null), (0, _element.createElement)(_blockControls.default.Slot, {
53
51
  group: "inline"
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/block-toolbar/index.native.js"],"names":["BlockToolbar","blockClientIds","isValid","mode","select","getBlockMode","getSelectedBlockClientIds","isBlockValid","blockEditorStore","selectedBlockClientIds","length"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AAVA;AACA;AACA;;AAGA;AACA;AACA;AAKe,SAASA,YAAT,GAAwB;AACtC,QAAM;AAAEC,IAAAA,cAAF;AAAkBC,IAAAA,OAAlB;AAA2BC,IAAAA;AAA3B,MAAoC,qBAAaC,MAAF,IAAc;AAClE,UAAM;AAAEC,MAAAA,YAAF;AAAgBC,MAAAA,yBAAhB;AAA2CC,MAAAA;AAA3C,QACLH,MAAM,CAAEI,YAAF,CADP;AAEA,UAAMC,sBAAsB,GAAGH,yBAAyB,EAAxD;AAEA,WAAO;AACNL,MAAAA,cAAc,EAAEQ,sBADV;AAENP,MAAAA,OAAO,EACNO,sBAAsB,CAACC,MAAvB,KAAkC,CAAlC,GACGH,YAAY,CAAEE,sBAAsB,CAAE,CAAF,CAAxB,CADf,GAEG,IALE;AAMNN,MAAAA,IAAI,EACHM,sBAAsB,CAACC,MAAvB,KAAkC,CAAlC,GACGL,YAAY,CAAEI,sBAAsB,CAAE,CAAF,CAAxB,CADf,GAEG;AATE,KAAP;AAWA,GAhByC,EAgBvC,EAhBuC,CAA1C;;AAkBA,MAAKR,cAAc,CAACS,MAAf,KAA0B,CAA/B,EAAmC;AAClC,WAAO,IAAP;AACA;;AAED,SACC,qDACGP,IAAI,KAAK,QAAT,IAAqBD,OAArB,IACD,qDACC,4BAAC,sBAAD,OADD,EAEC,4BAAC,sBAAD,CAAe,IAAf;AAAoB,IAAA,KAAK,EAAC;AAA1B,IAFD,EAGC,4BAAC,sBAAD,CAAe,IAAf,OAHD,EAIC,4BAAC,sBAAD,CAAe,IAAf;AAAoB,IAAA,KAAK,EAAC;AAA1B,IAJD,EAKC,4BAAC,sBAAD,CAAe,IAAf;AAAoB,IAAA,KAAK,EAAC;AAA1B,IALD,CAFF,CADD;AAaA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport BlockControls from '../block-controls';\nimport UngroupButton from '../ungroup-button';\nimport { store as blockEditorStore } from '../../store';\n\nexport default function BlockToolbar() {\n\tconst { blockClientIds, isValid, mode } = useSelect( ( select ) => {\n\t\tconst { getBlockMode, getSelectedBlockClientIds, isBlockValid } =\n\t\t\tselect( blockEditorStore );\n\t\tconst selectedBlockClientIds = getSelectedBlockClientIds();\n\n\t\treturn {\n\t\t\tblockClientIds: selectedBlockClientIds,\n\t\t\tisValid:\n\t\t\t\tselectedBlockClientIds.length === 1\n\t\t\t\t\t? isBlockValid( selectedBlockClientIds[ 0 ] )\n\t\t\t\t\t: null,\n\t\t\tmode:\n\t\t\t\tselectedBlockClientIds.length === 1\n\t\t\t\t\t? getBlockMode( selectedBlockClientIds[ 0 ] )\n\t\t\t\t\t: null,\n\t\t};\n\t}, [] );\n\n\tif ( blockClientIds.length === 0 ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{ mode === 'visual' && isValid && (\n\t\t\t\t<>\n\t\t\t\t\t<UngroupButton />\n\t\t\t\t\t<BlockControls.Slot group=\"block\" />\n\t\t\t\t\t<BlockControls.Slot />\n\t\t\t\t\t<BlockControls.Slot group=\"inline\" />\n\t\t\t\t\t<BlockControls.Slot group=\"other\" />\n\t\t\t\t</>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/block-toolbar/index.native.js"],"names":["BlockToolbar","isSelected","isValidAndVisual","select","getBlockMode","getSelectedBlockClientIds","isBlockValid","blockEditorStore","selectedBlockClientIds","length"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AAVA;AACA;AACA;;AAGA;AACA;AACA;AAKe,SAASA,YAAT,GAAwB;AACtC,QAAM;AAAEC,IAAAA,UAAF;AAAcC,IAAAA;AAAd,MAAmC,qBAAaC,MAAF,IAAc;AACjE,UAAM;AAAEC,MAAAA,YAAF;AAAgBC,MAAAA,yBAAhB;AAA2CC,MAAAA;AAA3C,QACLH,MAAM,CAAEI,YAAF,CADP;AAEA,UAAMC,sBAAsB,GAAGH,yBAAyB,EAAxD;AAEA,WAAO;AACNJ,MAAAA,UAAU,EAAEO,sBAAsB,CAACC,MAAvB,GAAgC,CADtC;AAENP,MAAAA,gBAAgB,EACfM,sBAAsB,CAACC,MAAvB,KAAkC,CAAlC,GACGH,YAAY,CAAEE,sBAAsB,CAAE,CAAF,CAAxB,CAAZ,IACAJ,YAAY,CAAEI,sBAAsB,CAAE,CAAF,CAAxB,CAAZ,KAAgD,QAFnD,GAGG;AANE,KAAP;AAQA,GAbwC,EAatC,EAbsC,CAAzC;;AAeA,MAAK,CAAEP,UAAP,EAAoB;AACnB,WAAO,IAAP;AACA;;AAED,SACC,qDACGC,gBAAgB,IACjB,qDACC,4BAAC,sBAAD,OADD,EAEC,4BAAC,sBAAD,CAAe,IAAf;AAAoB,IAAA,KAAK,EAAC;AAA1B,IAFD,EAGC,4BAAC,sBAAD,CAAe,IAAf,OAHD,EAIC,4BAAC,sBAAD,CAAe,IAAf;AAAoB,IAAA,KAAK,EAAC;AAA1B,IAJD,EAKC,4BAAC,sBAAD,CAAe,IAAf;AAAoB,IAAA,KAAK,EAAC;AAA1B,IALD,CAFF,CADD;AAaA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport BlockControls from '../block-controls';\nimport UngroupButton from '../ungroup-button';\nimport { store as blockEditorStore } from '../../store';\n\nexport default function BlockToolbar() {\n\tconst { isSelected, isValidAndVisual } = useSelect( ( select ) => {\n\t\tconst { getBlockMode, getSelectedBlockClientIds, isBlockValid } =\n\t\t\tselect( blockEditorStore );\n\t\tconst selectedBlockClientIds = getSelectedBlockClientIds();\n\n\t\treturn {\n\t\t\tisSelected: selectedBlockClientIds.length > 0,\n\t\t\tisValidAndVisual:\n\t\t\t\tselectedBlockClientIds.length === 1\n\t\t\t\t\t? isBlockValid( selectedBlockClientIds[ 0 ] ) &&\n\t\t\t\t\t getBlockMode( selectedBlockClientIds[ 0 ] ) === 'visual'\n\t\t\t\t\t: false,\n\t\t};\n\t}, [] );\n\n\tif ( ! isSelected ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{ isValidAndVisual && (\n\t\t\t\t<>\n\t\t\t\t\t<UngroupButton />\n\t\t\t\t\t<BlockControls.Slot group=\"block\" />\n\t\t\t\t\t<BlockControls.Slot />\n\t\t\t\t\t<BlockControls.Slot group=\"inline\" />\n\t\t\t\t\t<BlockControls.Slot group=\"other\" />\n\t\t\t\t</>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"]}
@@ -103,7 +103,6 @@ function InbetweenInsertionPointPopover(_ref) {
103
103
  isInserterShown: insertionPoint === null || insertionPoint === void 0 ? void 0 : insertionPoint.__unstableWithInserter
104
104
  };
105
105
  }, []);
106
- const isVertical = orientation === 'vertical';
107
106
  const disableMotion = (0, _compose.useReducedMotion)();
108
107
 
109
108
  function onClick(event) {
@@ -126,67 +125,27 @@ function InbetweenInsertionPointPopover(_ref) {
126
125
  if (event.target !== ref.current) {
127
126
  openRef.current = true;
128
127
  }
129
- } // Define animation variants for the line element.
130
-
128
+ }
131
129
 
132
- const horizontalLine = {
133
- start: {
134
- width: 0,
135
- top: '50%',
136
- bottom: '50%',
137
- x: 0
138
- },
139
- rest: {
140
- width: 4,
141
- top: 0,
142
- bottom: 0,
143
- x: -2
144
- },
145
- hover: {
146
- width: 4,
147
- top: 0,
148
- bottom: 0,
149
- x: -2
150
- }
151
- };
152
- const verticalLine = {
153
- start: {
154
- height: 0,
155
- left: '50%',
156
- right: '50%',
157
- y: 0
158
- },
159
- rest: {
160
- height: 4,
161
- left: 0,
162
- right: 0,
163
- y: -2
164
- },
165
- hover: {
166
- height: 4,
167
- left: 0,
168
- right: 0,
169
- y: -2
170
- }
171
- };
172
130
  const lineVariants = {
173
131
  // Initial position starts from the center and invisible.
174
- start: { ...(!isVertical ? horizontalLine.start : verticalLine.start),
175
- opacity: 0
132
+ start: {
133
+ opacity: 0,
134
+ scale: 0
176
135
  },
177
136
  // The line expands to fill the container. If the inserter is visible it
178
137
  // is delayed so it appears orchestrated.
179
- rest: { ...(!isVertical ? horizontalLine.rest : verticalLine.rest),
138
+ rest: {
180
139
  opacity: 1,
181
- borderRadius: '2px',
140
+ scale: 1,
182
141
  transition: {
183
142
  delay: isInserterShown ? 0.5 : 0,
184
143
  type: 'tween'
185
144
  }
186
145
  },
187
- hover: { ...(!isVertical ? horizontalLine.hover : verticalLine.hover),
146
+ hover: {
188
147
  opacity: 1,
189
- borderRadius: '2px',
148
+ scale: 1,
190
149
  transition: {
191
150
  delay: 0.5,
192
151
  type: 'tween'
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/block-tools/insertion-point.js"],"names":["InsertionPointOpenRef","InbetweenInsertionPointPopover","__unstablePopoverSlot","__unstableContentRef","selectBlock","hideInsertionPoint","blockEditorStore","openRef","ref","orientation","previousClientId","nextClientId","rootClientId","isInserterShown","isDistractionFree","isNavigationMode","select","getBlockOrder","getBlockListSettings","getBlockInsertionPoint","isBlockBeingDragged","getPreviousBlockClientId","getNextBlockClientId","getSettings","_isNavigationMode","insertionPoint","order","length","_previousClientId","index","_nextClientId","settings","__unstableWithInserter","isVertical","disableMotion","onClick","event","target","current","maybeHideInserterPoint","onFocus","horizontalLine","start","width","top","bottom","x","rest","hover","verticalLine","height","left","right","y","lineVariants","opacity","borderRadius","transition","delay","type","inserterVariants","scale","className","isOpen","InsertionPoint","props","isVisible","isBlockInsertionPointVisible","operation"],"mappings":";;;;;;;;;;AASA;;;;AANA;;AAKA;;AAEA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AAnBA;AACA;AACA;;AAGA;AACA;AACA;;AAMA;AACA;AACA;AAMO,MAAMA,qBAAqB,GAAG,6BAA9B;;;AAEP,SAASC,8BAAT,OAGI;AAAA,MAHqC;AACxCC,IAAAA,qBADwC;AAExCC,IAAAA;AAFwC,GAGrC;AACH,QAAM;AAAEC,IAAAA,WAAF;AAAeC,IAAAA;AAAf,MAAsC,uBAAaC,YAAb,CAA5C;AACA,QAAMC,OAAO,GAAG,yBAAYP,qBAAZ,CAAhB;AACA,QAAMQ,GAAG,GAAG,sBAAZ;AACA,QAAM;AACLC,IAAAA,WADK;AAELC,IAAAA,gBAFK;AAGLC,IAAAA,YAHK;AAILC,IAAAA,YAJK;AAKLC,IAAAA,eALK;AAMLC,IAAAA,iBANK;AAOLC,IAAAA;AAPK,MAQF,qBAAaC,MAAF,IAAc;AAAA;;AAC5B,UAAM;AACLC,MAAAA,aADK;AAELC,MAAAA,oBAFK;AAGLC,MAAAA,sBAHK;AAILC,MAAAA,mBAJK;AAKLC,MAAAA,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gBADZ;AAEC,IAAA,SAAS,EAAG,yBACX,mDADW;AAFb,KAMC,4BAAC,iBAAD;AACC,IAAA,QAAQ,EAAC,eADV;AAEC,IAAA,QAAQ,EAAGjD,YAFZ;AAGC,IAAA,YAAY,EAAGC,YAHhB;AAIC,IAAA,qBAAqB,MAJtB;AAKC,IAAA,QAAQ,EAAKmD,MAAF,IAAc;AACxBxD,MAAAA,OAAO,CAAC+B,OAAR,GAAkByB,MAAlB;AACA,KAPF;AAQC,IAAA,eAAe,EAAG,MAAM;AACvBxD,MAAAA,OAAO,CAAC+B,OAAR,GAAkB,KAAlB;AACA;AAVF,IAND,CAtBF,CAND,CADD;AAoDA;;AAEc,SAAS0B,cAAT,CAAyBC,KAAzB,EAAiC;AAC/C,QAAM;AAAExC,IAAAA,cAAF;AAAkByC,IAAAA;AAAlB,MAAgC,qBAAalD,MAAF,IAAc;AAC9D,UAAM;AAAEG,MAAAA,sBAAF;AAA0BgD,MAAAA;AAA1B,QACLnD,MAAM,CAAEV,YAAF,CADP;AAEA,WAAO;AACNmB,MAAAA,cAAc,EAAEN,sBAAsB,EADhC;AAEN+C,MAAAA,SAAS,EAAEC,4BAA4B;AAFjC,KAAP;AAIA,GAPqC,EAOnC,EAPmC,CAAtC;;AASA,MAAK,CAAED,SAAP,EAAmB;AAClB,WAAO,IAAP;AACA;AAED;AACD;AACA;AACA;;;AACC,SAAOzC,cAAc,CAAC2C,SAAf,KAA6B,SAA7B,GACN,4BAAC,iBAAD,CACC;AADD;AAEC,IAAA,GAAG,EAAI,GAAG3C,cAAc,CAACb,YAAc,IAAIa,cAAc,CAACI,KAAO;AAFlE,KAGMoC,KAHN,EADM,GAON,4BAAC,8BAAD,EAAqCA,KAArC,CAPD;AASA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useRef, createContext, useContext } from '@wordpress/element';\nimport { __unstableMotion as motion } from '@wordpress/components';\nimport { useReducedMotion } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport Inserter from '../inserter';\nimport { store as blockEditorStore } from '../../store';\nimport BlockPopoverInbetween from '../block-popover/inbetween';\nimport BlockDropZonePopover from '../block-popover/drop-zone';\n\nexport const InsertionPointOpenRef = createContext();\n\nfunction InbetweenInsertionPointPopover( {\n\t__unstablePopoverSlot,\n\t__unstableContentRef,\n} ) {\n\tconst { selectBlock, hideInsertionPoint } = useDispatch( blockEditorStore );\n\tconst openRef = useContext( InsertionPointOpenRef );\n\tconst ref = useRef();\n\tconst {\n\t\torientation,\n\t\tpreviousClientId,\n\t\tnextClientId,\n\t\trootClientId,\n\t\tisInserterShown,\n\t\tisDistractionFree,\n\t\tisNavigationMode,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetBlockOrder,\n\t\t\tgetBlockListSettings,\n\t\t\tgetBlockInsertionPoint,\n\t\t\tisBlockBeingDragged,\n\t\t\tgetPreviousBlockClientId,\n\t\t\tgetNextBlockClientId,\n\t\t\tgetSettings,\n\t\t\tisNavigationMode: _isNavigationMode,\n\t\t} = select( blockEditorStore );\n\t\tconst insertionPoint = getBlockInsertionPoint();\n\t\tconst order = getBlockOrder( insertionPoint.rootClientId );\n\n\t\tif ( ! order.length ) {\n\t\t\treturn {};\n\t\t}\n\n\t\tlet _previousClientId = order[ insertionPoint.index - 1 ];\n\t\tlet _nextClientId = order[ insertionPoint.index ];\n\n\t\twhile ( isBlockBeingDragged( _previousClientId ) ) {\n\t\t\t_previousClientId = getPreviousBlockClientId( _previousClientId );\n\t\t}\n\n\t\twhile ( isBlockBeingDragged( _nextClientId ) ) {\n\t\t\t_nextClientId = getNextBlockClientId( _nextClientId );\n\t\t}\n\n\t\tconst settings = getSettings();\n\n\t\treturn {\n\t\t\tpreviousClientId: _previousClientId,\n\t\t\tnextClientId: _nextClientId,\n\t\t\torientation:\n\t\t\t\tgetBlockListSettings( insertionPoint.rootClientId )\n\t\t\t\t\t?.orientation || 'vertical',\n\t\t\trootClientId: insertionPoint.rootClientId,\n\t\t\tisNavigationMode: _isNavigationMode(),\n\t\t\tisDistractionFree: settings.isDistractionFree,\n\t\t\tisInserterShown: insertionPoint?.__unstableWithInserter,\n\t\t};\n\t}, [] );\n\tconst isVertical = orientation === 'vertical';\n\n\tconst disableMotion = useReducedMotion();\n\n\tfunction onClick( event ) {\n\t\tif ( event.target === ref.current && nextClientId ) {\n\t\t\tselectBlock( nextClientId, -1 );\n\t\t}\n\t}\n\n\tfunction maybeHideInserterPoint( event ) {\n\t\t// Only hide the inserter if it's triggered on the wrapper,\n\t\t// and the inserter is not open.\n\t\tif ( event.target === ref.current && ! openRef.current ) {\n\t\t\thideInsertionPoint();\n\t\t}\n\t}\n\n\tfunction onFocus( event ) {\n\t\t// Only handle click on the wrapper specifically, and not an event\n\t\t// bubbled from the inserter itself.\n\t\tif ( event.target !== ref.current ) {\n\t\t\topenRef.current = true;\n\t\t}\n\t}\n\n\t// Define animation variants for the line element.\n\tconst horizontalLine = {\n\t\tstart: {\n\t\t\twidth: 0,\n\t\t\ttop: '50%',\n\t\t\tbottom: '50%',\n\t\t\tx: 0,\n\t\t},\n\t\trest: {\n\t\t\twidth: 4,\n\t\t\ttop: 0,\n\t\t\tbottom: 0,\n\t\t\tx: -2,\n\t\t},\n\t\thover: {\n\t\t\twidth: 4,\n\t\t\ttop: 0,\n\t\t\tbottom: 0,\n\t\t\tx: -2,\n\t\t},\n\t};\n\tconst verticalLine = {\n\t\tstart: {\n\t\t\theight: 0,\n\t\t\tleft: '50%',\n\t\t\tright: '50%',\n\t\t\ty: 0,\n\t\t},\n\t\trest: {\n\t\t\theight: 4,\n\t\t\tleft: 0,\n\t\t\tright: 0,\n\t\t\ty: -2,\n\t\t},\n\t\thover: {\n\t\t\theight: 4,\n\t\t\tleft: 0,\n\t\t\tright: 0,\n\t\t\ty: -2,\n\t\t},\n\t};\n\tconst lineVariants = {\n\t\t// Initial position starts from the center and invisible.\n\t\tstart: {\n\t\t\t...( ! isVertical ? horizontalLine.start : verticalLine.start ),\n\t\t\topacity: 0,\n\t\t},\n\t\t// The line expands to fill the container. If the inserter is visible it\n\t\t// is delayed so it appears orchestrated.\n\t\trest: {\n\t\t\t...( ! isVertical ? horizontalLine.rest : verticalLine.rest ),\n\t\t\topacity: 1,\n\t\t\tborderRadius: '2px',\n\t\t\ttransition: { delay: isInserterShown ? 0.5 : 0, type: 'tween' },\n\t\t},\n\t\thover: {\n\t\t\t...( ! isVertical ? horizontalLine.hover : verticalLine.hover ),\n\t\t\topacity: 1,\n\t\t\tborderRadius: '2px',\n\t\t\ttransition: { delay: 0.5, type: 'tween' },\n\t\t},\n\t};\n\n\tconst inserterVariants = {\n\t\tstart: {\n\t\t\tscale: disableMotion ? 1 : 0,\n\t\t},\n\t\trest: {\n\t\t\tscale: 1,\n\t\t\ttransition: { delay: 0.4, type: 'tween' },\n\t\t},\n\t};\n\n\tif ( isDistractionFree && ! isNavigationMode ) {\n\t\treturn null;\n\t}\n\n\tconst className = classnames(\n\t\t'block-editor-block-list__insertion-point',\n\t\t'is-' + orientation\n\t);\n\n\treturn (\n\t\t<BlockPopoverInbetween\n\t\t\tpreviousClientId={ previousClientId }\n\t\t\tnextClientId={ nextClientId }\n\t\t\t__unstablePopoverSlot={ __unstablePopoverSlot }\n\t\t\t__unstableContentRef={ __unstableContentRef }\n\t\t>\n\t\t\t<motion.div\n\t\t\t\tlayout={ ! disableMotion }\n\t\t\t\tinitial={ disableMotion ? 'rest' : 'start' }\n\t\t\t\tanimate=\"rest\"\n\t\t\t\twhileHover=\"hover\"\n\t\t\t\twhileTap=\"pressed\"\n\t\t\t\texit=\"start\"\n\t\t\t\tref={ ref }\n\t\t\t\ttabIndex={ -1 }\n\t\t\t\tonClick={ onClick }\n\t\t\t\tonFocus={ onFocus }\n\t\t\t\tclassName={ classnames( className, {\n\t\t\t\t\t'is-with-inserter': isInserterShown,\n\t\t\t\t} ) }\n\t\t\t\tonHoverEnd={ maybeHideInserterPoint }\n\t\t\t>\n\t\t\t\t<motion.div\n\t\t\t\t\tvariants={ lineVariants }\n\t\t\t\t\tclassName=\"block-editor-block-list__insertion-point-indicator\"\n\t\t\t\t\tdata-testid=\"block-list-insertion-point-indicator\"\n\t\t\t\t/>\n\t\t\t\t{ isInserterShown && (\n\t\t\t\t\t<motion.div\n\t\t\t\t\t\tvariants={ inserterVariants }\n\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t'block-editor-block-list__insertion-point-inserter'\n\t\t\t\t\t\t) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<Inserter\n\t\t\t\t\t\t\tposition=\"bottom center\"\n\t\t\t\t\t\t\tclientId={ nextClientId }\n\t\t\t\t\t\t\trootClientId={ rootClientId }\n\t\t\t\t\t\t\t__experimentalIsQuick\n\t\t\t\t\t\t\tonToggle={ ( isOpen ) => {\n\t\t\t\t\t\t\t\topenRef.current = isOpen;\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tonSelectOrClose={ () => {\n\t\t\t\t\t\t\t\topenRef.current = false;\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</motion.div>\n\t\t\t\t) }\n\t\t\t</motion.div>\n\t\t</BlockPopoverInbetween>\n\t);\n}\n\nexport default function InsertionPoint( props ) {\n\tconst { insertionPoint, isVisible } = useSelect( ( select ) => {\n\t\tconst { getBlockInsertionPoint, isBlockInsertionPointVisible } =\n\t\t\tselect( blockEditorStore );\n\t\treturn {\n\t\t\tinsertionPoint: getBlockInsertionPoint(),\n\t\t\tisVisible: isBlockInsertionPointVisible(),\n\t\t};\n\t}, [] );\n\n\tif ( ! isVisible ) {\n\t\treturn null;\n\t}\n\n\t/**\n\t * Render a popover that overlays the block when the desired operation is to replace it.\n\t * Otherwise, render a popover in between blocks for the indication of inserting between them.\n\t */\n\treturn insertionPoint.operation === 'replace' ? (\n\t\t<BlockDropZonePopover\n\t\t\t// Force remount to trigger the animation.\n\t\t\tkey={ `${ insertionPoint.rootClientId }-${ insertionPoint.index }` }\n\t\t\t{ ...props }\n\t\t/>\n\t) : (\n\t\t<InbetweenInsertionPointPopover { ...props } />\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/block-tools/insertion-point.js"],"names":["InsertionPointOpenRef","InbetweenInsertionPointPopover","__unstablePopoverSlot","__unstableContentRef","selectBlock","hideInsertionPoint","blockEditorStore","openRef","ref","orientation","previousClientId","nextClientId","rootClientId","isInserterShown","isDistractionFree","isNavigationMode","select","getBlockOrder","getBlockListSettings","getBlockInsertionPoint","isBlockBeingDragged","getPreviousBlockClientId","getNextBlockClientId","getSettings","_isNavigationMode","insertionPoint","order","length","_previousClientId","index","_nextClientId","settings","__unstableWithInserter","disableMotion","onClick","event","target","current","maybeHideInserterPoint","onFocus","lineVariants","start","opacity","scale","rest","transition","delay","type","hover","inserterVariants","className","isOpen","InsertionPoint","props","isVisible","isBlockInsertionPointVisible","operation"],"mappings":";;;;;;;;;;AASA;;;;AANA;;AAKA;;AAEA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AAnBA;AACA;AACA;;AAGA;AACA;AACA;;AAMA;AACA;AACA;AAMO,MAAMA,qBAAqB,GAAG,6BAA9B;;;AAEP,SAASC,8BAAT,OAGI;AAAA,MAHqC;AACxCC,IAAAA,qBADwC;AAExCC,IAAAA;AAFwC,GAGrC;AACH,QAAM;AAAEC,IAAAA,WAAF;AAAeC,IAAAA;AAAf,MAAsC,uBAAaC,YAAb,CAA5C;AACA,QAAMC,OAAO,GAAG,yBAAYP,qBAAZ,CAAhB;AACA,QAAMQ,GAAG,GAAG,sBAAZ;AACA,QAAM;AACLC,IAAAA,WADK;AAELC,IAAAA,gBAFK;AAGLC,IAAAA,YAHK;AAILC,IAAAA,YAJK;AAKLC,IAAAA,eALK;AAMLC,IAAAA,iBANK;AAOLC,IAAAA;AAPK,MAQF,qBAAaC,MAAF,IAAc;AAAA;;AAC5B,UAAM;AACLC,MAAAA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AS,EAAG,yBACX,mDADW;AAFb,KAMC,4BAAC,iBAAD;AACC,IAAA,QAAQ,EAAC,eADV;AAEC,IAAA,QAAQ,EAAGtC,YAFZ;AAGC,IAAA,YAAY,EAAGC,YAHhB;AAIC,IAAA,qBAAqB,MAJtB;AAKC,IAAA,QAAQ,EAAKuC,MAAF,IAAc;AACxB5C,MAAAA,OAAO,CAAC8B,OAAR,GAAkBc,MAAlB;AACA,KAPF;AAQC,IAAA,eAAe,EAAG,MAAM;AACvB5C,MAAAA,OAAO,CAAC8B,OAAR,GAAkB,KAAlB;AACA;AAVF,IAND,CAtBF,CAND,CADD;AAoDA;;AAEc,SAASe,cAAT,CAAyBC,KAAzB,EAAiC;AAC/C,QAAM;AAAE5B,IAAAA,cAAF;AAAkB6B,IAAAA;AAAlB,MAAgC,qBAAatC,MAAF,IAAc;AAC9D,UAAM;AAAEG,MAAAA,sBAAF;AAA0BoC,MAAAA;AAA1B,QACLvC,MAAM,CAAEV,YAAF,CADP;AAEA,WAAO;AACNmB,MAAAA,cAAc,EAAEN,sBAAsB,EADhC;AAENmC,MAAAA,SAAS,EAAEC,4BAA4B;AAFjC,KAAP;AAIA,GAPqC,EAOnC,EAPmC,CAAtC;;AASA,MAAK,CAAED,SAAP,EAAmB;AAClB,WAAO,IAAP;AACA;AAED;AACD;AACA;AACA;;;AACC,SAAO7B,cAAc,CAAC+B,SAAf,KAA6B,SAA7B,GACN,4BAAC,iBAAD,CACC;AADD;AAEC,IAAA,GAAG,EAAI,GAAG/B,cAAc,CAACb,YAAc,IAAIa,cAAc,CAACI,KAAO;AAFlE,KAGMwB,KAHN,EADM,GAON,4BAAC,8BAAD,EAAqCA,KAArC,CAPD;AASA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useRef, createContext, useContext } from '@wordpress/element';\nimport { __unstableMotion as motion } from '@wordpress/components';\nimport { useReducedMotion } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport Inserter from '../inserter';\nimport { store as blockEditorStore } from '../../store';\nimport BlockPopoverInbetween from '../block-popover/inbetween';\nimport BlockDropZonePopover from '../block-popover/drop-zone';\n\nexport const InsertionPointOpenRef = createContext();\n\nfunction InbetweenInsertionPointPopover( {\n\t__unstablePopoverSlot,\n\t__unstableContentRef,\n} ) {\n\tconst { selectBlock, hideInsertionPoint } = useDispatch( blockEditorStore );\n\tconst openRef = useContext( InsertionPointOpenRef );\n\tconst ref = useRef();\n\tconst {\n\t\torientation,\n\t\tpreviousClientId,\n\t\tnextClientId,\n\t\trootClientId,\n\t\tisInserterShown,\n\t\tisDistractionFree,\n\t\tisNavigationMode,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetBlockOrder,\n\t\t\tgetBlockListSettings,\n\t\t\tgetBlockInsertionPoint,\n\t\t\tisBlockBeingDragged,\n\t\t\tgetPreviousBlockClientId,\n\t\t\tgetNextBlockClientId,\n\t\t\tgetSettings,\n\t\t\tisNavigationMode: _isNavigationMode,\n\t\t} = select( blockEditorStore );\n\t\tconst insertionPoint = getBlockInsertionPoint();\n\t\tconst order = getBlockOrder( insertionPoint.rootClientId );\n\n\t\tif ( ! order.length ) {\n\t\t\treturn {};\n\t\t}\n\n\t\tlet _previousClientId = order[ insertionPoint.index - 1 ];\n\t\tlet _nextClientId = order[ insertionPoint.index ];\n\n\t\twhile ( isBlockBeingDragged( _previousClientId ) ) {\n\t\t\t_previousClientId = getPreviousBlockClientId( _previousClientId );\n\t\t}\n\n\t\twhile ( isBlockBeingDragged( _nextClientId ) ) {\n\t\t\t_nextClientId = getNextBlockClientId( _nextClientId );\n\t\t}\n\n\t\tconst settings = getSettings();\n\n\t\treturn {\n\t\t\tpreviousClientId: _previousClientId,\n\t\t\tnextClientId: _nextClientId,\n\t\t\torientation:\n\t\t\t\tgetBlockListSettings( insertionPoint.rootClientId )\n\t\t\t\t\t?.orientation || 'vertical',\n\t\t\trootClientId: insertionPoint.rootClientId,\n\t\t\tisNavigationMode: _isNavigationMode(),\n\t\t\tisDistractionFree: settings.isDistractionFree,\n\t\t\tisInserterShown: insertionPoint?.__unstableWithInserter,\n\t\t};\n\t}, [] );\n\n\tconst disableMotion = useReducedMotion();\n\n\tfunction onClick( event ) {\n\t\tif ( event.target === ref.current && nextClientId ) {\n\t\t\tselectBlock( nextClientId, -1 );\n\t\t}\n\t}\n\n\tfunction maybeHideInserterPoint( event ) {\n\t\t// Only hide the inserter if it's triggered on the wrapper,\n\t\t// and the inserter is not open.\n\t\tif ( event.target === ref.current && ! openRef.current ) {\n\t\t\thideInsertionPoint();\n\t\t}\n\t}\n\n\tfunction onFocus( event ) {\n\t\t// Only handle click on the wrapper specifically, and not an event\n\t\t// bubbled from the inserter itself.\n\t\tif ( event.target !== ref.current ) {\n\t\t\topenRef.current = true;\n\t\t}\n\t}\n\n\tconst lineVariants = {\n\t\t// Initial position starts from the center and invisible.\n\t\tstart: {\n\t\t\topacity: 0,\n\t\t\tscale: 0,\n\t\t},\n\t\t// The line expands to fill the container. If the inserter is visible it\n\t\t// is delayed so it appears orchestrated.\n\t\trest: {\n\t\t\topacity: 1,\n\t\t\tscale: 1,\n\t\t\ttransition: { delay: isInserterShown ? 0.5 : 0, type: 'tween' },\n\t\t},\n\t\thover: {\n\t\t\topacity: 1,\n\t\t\tscale: 1,\n\t\t\ttransition: { delay: 0.5, type: 'tween' },\n\t\t},\n\t};\n\n\tconst inserterVariants = {\n\t\tstart: {\n\t\t\tscale: disableMotion ? 1 : 0,\n\t\t},\n\t\trest: {\n\t\t\tscale: 1,\n\t\t\ttransition: { delay: 0.4, type: 'tween' },\n\t\t},\n\t};\n\n\tif ( isDistractionFree && ! isNavigationMode ) {\n\t\treturn null;\n\t}\n\n\tconst className = classnames(\n\t\t'block-editor-block-list__insertion-point',\n\t\t'is-' + orientation\n\t);\n\n\treturn (\n\t\t<BlockPopoverInbetween\n\t\t\tpreviousClientId={ previousClientId }\n\t\t\tnextClientId={ nextClientId }\n\t\t\t__unstablePopoverSlot={ __unstablePopoverSlot }\n\t\t\t__unstableContentRef={ __unstableContentRef }\n\t\t>\n\t\t\t<motion.div\n\t\t\t\tlayout={ ! disableMotion }\n\t\t\t\tinitial={ disableMotion ? 'rest' : 'start' }\n\t\t\t\tanimate=\"rest\"\n\t\t\t\twhileHover=\"hover\"\n\t\t\t\twhileTap=\"pressed\"\n\t\t\t\texit=\"start\"\n\t\t\t\tref={ ref }\n\t\t\t\ttabIndex={ -1 }\n\t\t\t\tonClick={ onClick }\n\t\t\t\tonFocus={ onFocus }\n\t\t\t\tclassName={ classnames( className, {\n\t\t\t\t\t'is-with-inserter': isInserterShown,\n\t\t\t\t} ) }\n\t\t\t\tonHoverEnd={ maybeHideInserterPoint }\n\t\t\t>\n\t\t\t\t<motion.div\n\t\t\t\t\tvariants={ lineVariants }\n\t\t\t\t\tclassName=\"block-editor-block-list__insertion-point-indicator\"\n\t\t\t\t\tdata-testid=\"block-list-insertion-point-indicator\"\n\t\t\t\t/>\n\t\t\t\t{ isInserterShown && (\n\t\t\t\t\t<motion.div\n\t\t\t\t\t\tvariants={ inserterVariants }\n\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t'block-editor-block-list__insertion-point-inserter'\n\t\t\t\t\t\t) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<Inserter\n\t\t\t\t\t\t\tposition=\"bottom center\"\n\t\t\t\t\t\t\tclientId={ nextClientId }\n\t\t\t\t\t\t\trootClientId={ rootClientId }\n\t\t\t\t\t\t\t__experimentalIsQuick\n\t\t\t\t\t\t\tonToggle={ ( isOpen ) => {\n\t\t\t\t\t\t\t\topenRef.current = isOpen;\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tonSelectOrClose={ () => {\n\t\t\t\t\t\t\t\topenRef.current = false;\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</motion.div>\n\t\t\t\t) }\n\t\t\t</motion.div>\n\t\t</BlockPopoverInbetween>\n\t);\n}\n\nexport default function InsertionPoint( props ) {\n\tconst { insertionPoint, isVisible } = useSelect( ( select ) => {\n\t\tconst { getBlockInsertionPoint, isBlockInsertionPointVisible } =\n\t\t\tselect( blockEditorStore );\n\t\treturn {\n\t\t\tinsertionPoint: getBlockInsertionPoint(),\n\t\t\tisVisible: isBlockInsertionPointVisible(),\n\t\t};\n\t}, [] );\n\n\tif ( ! isVisible ) {\n\t\treturn null;\n\t}\n\n\t/**\n\t * Render a popover that overlays the block when the desired operation is to replace it.\n\t * Otherwise, render a popover in between blocks for the indication of inserting between them.\n\t */\n\treturn insertionPoint.operation === 'replace' ? (\n\t\t<BlockDropZonePopover\n\t\t\t// Force remount to trigger the animation.\n\t\t\tkey={ `${ insertionPoint.rootClientId }-${ insertionPoint.index }` }\n\t\t\t{ ...props }\n\t\t/>\n\t) : (\n\t\t<InbetweenInsertionPointPopover { ...props } />\n\t);\n}\n"]}
@@ -11,8 +11,6 @@ var _element = require("@wordpress/element");
11
11
 
12
12
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
13
13
 
14
- var _lodash = require("lodash");
15
-
16
14
  var _classnames = _interopRequireDefault(require("classnames"));
17
15
 
18
16
  var _blocks = require("@wordpress/blocks");
@@ -202,7 +200,7 @@ function wrapperSelector(select) {
202
200
  const parentBlockListSettings = __experimentalGetBlockListSettingsForBlocks(blockParentsClientIds); // Get the clientId of the topmost parent with the capture toolbars setting.
203
201
 
204
202
 
205
- const capturingClientId = (0, _lodash.find)(blockParentsClientIds, parentClientId => {
203
+ const capturingClientId = blockParentsClientIds.find(parentClientId => {
206
204
  var _parentBlockListSetti;
207
205
 
208
206
  return (_parentBlockListSetti = parentBlockListSettings[parentClientId]) === null || _parentBlockListSetti === void 0 ? void 0 : _parentBlockListSetti.__experimentalCaptureToolbars;
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/block-tools/selected-block-popover.js"],"names":["selector","select","__unstableGetEditorMode","isMultiSelecting","hasMultiSelection","isTyping","__experimentalIsBlockInterfaceHidden","isBlockInterfaceHidden","getSettings","getLastMultiSelectedBlockClientId","blockEditorStore","editorMode","hasFixedToolbar","isDistractionFree","lastClientId","SelectedBlockPopover","clientId","rootClientId","isEmptyDefaultBlock","showContents","capturingClientId","__unstablePopoverSlot","__unstableContentRef","isInsertionPointVisible","isBlockInsertionPointVisible","getBlockInsertionPoint","getBlockOrder","insertionPoint","order","index","isLargeViewport","isToolbarForced","stopTyping","showEmptyBlockSideInserter","shouldShowBreadcrumb","shouldShowContextualToolbar","canFocusHiddenToolbar","current","isDisabled","initialToolbarItemIndexRef","popoverProps","contentElement","wrapperSelector","getSelectedBlockClientId","getFirstMultiSelectedBlockClientId","getBlockRootClientId","getBlock","getBlockParents","isNavigationMode","_isNavigationMode","__experimentalGetBlockListSettingsForBlocks","name","attributes","blockParentsClientIds","parentBlockListSettings","parentClientId","__experimentalCaptureToolbars","settings","WrappedBlockPopover","selected"],"mappings":";;;;;;;;;AASA;;;;AANA;;AACA;;AAMA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAvBA;AACA;AACA;;AAIA;AACA;AACA;;AAOA;AACA;AACA;AAQA,SAASA,QAAT,CAAmBC,MAAnB,EAA4B;AAC3B,QAAM;AACLC,IAAAA,uBADK;AAELC,IAAAA,gBAFK;AAGLC,IAAAA,iBAHK;AAILC,IAAAA,QAJK;AAKLC,IAAAA,oCAAoC,EAAEC,sBALjC;AAMLC,IAAAA,WANK;AAOLC,IAAAA;AAPK,MAQFR,MAAM,CAAES,YAAF,CARV;AAUA,SAAO;AACNC,IAAAA,UAAU,EAAET,uBAAuB,EAD7B;AAENC,IAAAA,gBAAgB,EAAEA,gBAAgB,EAF5B;AAGNE,IAAAA,QAAQ,EAAEA,QAAQ,EAHZ;AAINE,IAAAA,sBAAsB,EAAEA,sBAAsB,EAJxC;AAKNK,IAAAA,eAAe,EAAEJ,W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C,IAAAA,QADK;AAELC,IAAAA,YAFK;AAGLkC,IAAAA,IAHK;AAILjC,IAAAA,mBAJK;AAKLE,IAAAA,iBALK;AAMLP,IAAAA,iBANK;AAOLmC,IAAAA;AAPK,MAQFW,QARJ;;AAUA,MAAK,CAAER,IAAP,EAAc;AACb,WAAO,IAAP;AACA;;AAED,SACC,4BAAC,oBAAD;AACC,IAAA,QAAQ,EAAGnC,QADZ;AAEC,IAAA,YAAY,EAAGC,YAFhB;AAGC,IAAA,mBAAmB,EAAGC,mBAHvB;AAIC,IAAA,YAAY,EAAG,CAAEL,iBAAF,IAAuBmC,gBAJvC;AAKC,IAAA,iBAAiB,EAAG5B,iBALrB;AAMC,IAAA,qBAAqB,EAAGC,qBANzB;AAOC,IAAA,oBAAoB,EAAGC;AAPxB,IADD;AAWA","sourcesContent":["/**\n * External dependencies\n */\nimport { find } from 'lodash';\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useRef, useEffect } from '@wordpress/element';\nimport { isUnmodifiedDefaultBlock } from '@wordpress/blocks';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useShortcut } from '@wordpress/keyboard-shortcuts';\nimport { useViewportMatch } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport BlockSelectionButton from './block-selection-button';\nimport BlockContextualToolbar from './block-contextual-toolbar';\nimport { store as blockEditorStore } from '../../store';\nimport BlockPopover from '../block-popover';\nimport useBlockToolbarPopoverProps from './use-block-toolbar-popover-props';\nimport Inserter from '../inserter';\n\nfunction selector( select ) {\n\tconst {\n\t\t__unstableGetEditorMode,\n\t\tisMultiSelecting,\n\t\thasMultiSelection,\n\t\tisTyping,\n\t\t__experimentalIsBlockInterfaceHidden: isBlockInterfaceHidden,\n\t\tgetSettings,\n\t\tgetLastMultiSelectedBlockClientId,\n\t} = select( blockEditorStore );\n\n\treturn {\n\t\teditorMode: __unstableGetEditorMode(),\n\t\tisMultiSelecting: isMultiSelecting(),\n\t\tisTyping: isTyping(),\n\t\tisBlockInterfaceHidden: isBlockInterfaceHidden(),\n\t\thasFixedToolbar: getSettings().hasFixedToolbar,\n\t\tisDistractionFree: getSettings().isDistractionFree,\n\t\tlastClientId: hasMultiSelection()\n\t\t\t? getLastMultiSelectedBlockClientId()\n\t\t\t: null,\n\t};\n}\n\nfunction SelectedBlockPopover( {\n\tclientId,\n\trootClientId,\n\tisEmptyDefaultBlock,\n\tshowContents, // we may need to mount an empty popover because we reuse\n\tcapturingClientId,\n\t__unstablePopoverSlot,\n\t__unstableContentRef,\n} ) {\n\tconst {\n\t\teditorMode,\n\t\tisMultiSelecting,\n\t\tisTyping,\n\t\tisBlockInterfaceHidden,\n\t\thasFixedToolbar,\n\t\tisDistractionFree,\n\t\tlastClientId,\n\t} = useSelect( selector, [] );\n\tconst isInsertionPointVisible = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tisBlockInsertionPointVisible,\n\t\t\t\tgetBlockInsertionPoint,\n\t\t\t\tgetBlockOrder,\n\t\t\t} = select( blockEditorStore );\n\n\t\t\tif ( ! isBlockInsertionPointVisible() ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tconst insertionPoint = getBlockInsertionPoint();\n\t\t\tconst order = getBlockOrder( insertionPoint.rootClientId );\n\t\t\treturn order[ insertionPoint.index ] === clientId;\n\t\t},\n\t\t[ clientId ]\n\t);\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst isToolbarForced = useRef( false );\n\tconst { stopTyping } = useDispatch( blockEditorStore );\n\n\tconst showEmptyBlockSideInserter =\n\t\t! isTyping && editorMode === 'edit' && isEmptyDefaultBlock;\n\tconst shouldShowBreadcrumb =\n\t\teditorMode === 'navigation' || editorMode === 'zoom-out';\n\tconst shouldShowContextualToolbar =\n\t\teditorMode === 'edit' &&\n\t\t! hasFixedToolbar &&\n\t\tisLargeViewport &&\n\t\t! isMultiSelecting &&\n\t\t! showEmptyBlockSideInserter &&\n\t\t! isTyping &&\n\t\t! isBlockInterfaceHidden;\n\tconst canFocusHiddenToolbar =\n\t\teditorMode === 'edit' &&\n\t\t! shouldShowContextualToolbar &&\n\t\t! hasFixedToolbar &&\n\t\t! isDistractionFree &&\n\t\t! isEmptyDefaultBlock;\n\n\tuseShortcut(\n\t\t'core/block-editor/focus-toolbar',\n\t\t() => {\n\t\t\tisToolbarForced.current = true;\n\t\t\tstopTyping( true );\n\t\t},\n\t\t{\n\t\t\tisDisabled: ! canFocusHiddenToolbar,\n\t\t}\n\t);\n\n\tuseEffect( () => {\n\t\tisToolbarForced.current = false;\n\t} );\n\n\t// Stores the active toolbar item index so the block toolbar can return focus\n\t// to it when re-mounting.\n\tconst initialToolbarItemIndexRef = useRef();\n\n\tconst popoverProps = useBlockToolbarPopoverProps( {\n\t\tcontentElement: __unstableContentRef?.current,\n\t\tclientId,\n\t} );\n\n\tif (\n\t\t! shouldShowBreadcrumb &&\n\t\t! shouldShowContextualToolbar &&\n\t\t! showEmptyBlockSideInserter\n\t) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{ showEmptyBlockSideInserter && (\n\t\t\t\t<BlockPopover\n\t\t\t\t\tclientId={ capturingClientId || clientId }\n\t\t\t\t\t__unstableCoverTarget\n\t\t\t\t\tbottomClientId={ lastClientId }\n\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t'block-editor-block-list__block-side-inserter-popover',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t'is-insertion-point-visible':\n\t\t\t\t\t\t\t\tisInsertionPointVisible,\n\t\t\t\t\t\t}\n\t\t\t\t\t) }\n\t\t\t\t\t__unstablePopoverSlot={ __unstablePopoverSlot }\n\t\t\t\t\t__unstableContentRef={ __unstableContentRef }\n\t\t\t\t\tresize={ false }\n\t\t\t\t\tshift={ false }\n\t\t\t\t\t{ ...popoverProps }\n\t\t\t\t>\n\t\t\t\t\t<div className=\"block-editor-block-list__empty-block-inserter\">\n\t\t\t\t\t\t<Inserter\n\t\t\t\t\t\t\tposition=\"bottom right\"\n\t\t\t\t\t\t\trootClientId={ rootClientId }\n\t\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\t\t__experimentalIsQuick\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t</BlockPopover>\n\t\t\t) }\n\t\t\t{ ( shouldShowBreadcrumb || shouldShowContextualToolbar ) && (\n\t\t\t\t<BlockPopover\n\t\t\t\t\tclientId={ capturingClientId || clientId }\n\t\t\t\t\tbottomClientId={ lastClientId }\n\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t'block-editor-block-list__block-popover',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t'is-insertion-point-visible':\n\t\t\t\t\t\t\t\tisInsertionPointVisible,\n\t\t\t\t\t\t}\n\t\t\t\t\t) }\n\t\t\t\t\t__unstablePopoverSlot={ __unstablePopoverSlot }\n\t\t\t\t\t__unstableContentRef={ __unstableContentRef }\n\t\t\t\t\tresize={ false }\n\t\t\t\t\t{ ...popoverProps }\n\t\t\t\t>\n\t\t\t\t\t{ shouldShowContextualToolbar && showContents && (\n\t\t\t\t\t\t<BlockContextualToolbar\n\t\t\t\t\t\t\t// If the toolbar is being shown because of being forced\n\t\t\t\t\t\t\t// it should focus the toolbar right after the mount.\n\t\t\t\t\t\t\tfocusOnMount={ isToolbarForced.current }\n\t\t\t\t\t\t\t__experimentalInitialIndex={\n\t\t\t\t\t\t\t\tinitialToolbarItemIndexRef.current\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t__experimentalOnIndexChange={ ( index ) => {\n\t\t\t\t\t\t\t\tinitialToolbarItemIndexRef.current = index;\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t// Resets the index whenever the active block changes so\n\t\t\t\t\t\t\t// this is not persisted. See https://github.com/WordPress/gutenberg/pull/25760#issuecomment-717906169\n\t\t\t\t\t\t\tkey={ clientId }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ shouldShowBreadcrumb && (\n\t\t\t\t\t\t<BlockSelectionButton\n\t\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\t\trootClientId={ rootClientId }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</BlockPopover>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nfunction wrapperSelector( select ) {\n\tconst {\n\t\tgetSelectedBlockClientId,\n\t\tgetFirstMultiSelectedBlockClientId,\n\t\tgetBlockRootClientId,\n\t\tgetBlock,\n\t\tgetBlockParents,\n\t\tgetSettings,\n\t\tisNavigationMode: _isNavigationMode,\n\t\t__experimentalGetBlockListSettingsForBlocks,\n\t} = select( blockEditorStore );\n\n\tconst clientId =\n\t\tgetSelectedBlockClientId() || getFirstMultiSelectedBlockClientId();\n\n\tif ( ! clientId ) {\n\t\treturn;\n\t}\n\n\tconst { name, attributes = {} } = getBlock( clientId ) || {};\n\tconst blockParentsClientIds = getBlockParents( clientId );\n\n\t// Get Block List Settings for all ancestors of the current Block clientId.\n\tconst parentBlockListSettings = __experimentalGetBlockListSettingsForBlocks(\n\t\tblockParentsClientIds\n\t);\n\n\t// Get the clientId of the topmost parent with the capture toolbars setting.\n\tconst capturingClientId = find(\n\t\tblockParentsClientIds,\n\t\t( parentClientId ) =>\n\t\t\tparentBlockListSettings[ parentClientId ]\n\t\t\t\t?.__experimentalCaptureToolbars\n\t);\n\n\tconst settings = getSettings();\n\n\treturn {\n\t\tclientId,\n\t\trootClientId: getBlockRootClientId( clientId ),\n\t\tname,\n\t\tisDistractionFree: settings.isDistractionFree,\n\t\tisNavigationMode: _isNavigationMode(),\n\t\tisEmptyDefaultBlock:\n\t\t\tname && isUnmodifiedDefaultBlock( { name, attributes } ),\n\t\tcapturingClientId,\n\t};\n}\n\nexport default function WrappedBlockPopover( {\n\t__unstablePopoverSlot,\n\t__unstableContentRef,\n} ) {\n\tconst selected = useSelect( wrapperSelector, [] );\n\n\tif ( ! selected ) {\n\t\treturn null;\n\t}\n\n\tconst {\n\t\tclientId,\n\t\trootClientId,\n\t\tname,\n\t\tisEmptyDefaultBlock,\n\t\tcapturingClientId,\n\t\tisDistractionFree,\n\t\tisNavigationMode,\n\t} = selected;\n\n\tif ( ! name ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<SelectedBlockPopover\n\t\t\tclientId={ clientId }\n\t\t\trootClientId={ rootClientId }\n\t\t\tisEmptyDefaultBlock={ isEmptyDefaultBlock }\n\t\t\tshowContents={ ! isDistractionFree || isNavigationMode }\n\t\t\tcapturingClientId={ capturingClientId }\n\t\t\t__unstablePopoverSlot={ __unstablePopoverSlot }\n\t\t\t__unstableContentRef={ __unstableContentRef }\n\t\t/>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/block-tools/selected-block-popover.js"],"names":["selector","select","__unstableGetEditorMode","isMultiSelecting","hasMultiSelection","isTyping","__experimentalIsBlockInterfaceHidden","isBlockInterfaceHidden","getSettings","getLastMultiSelectedBlockClientId","blockEditorStore","editorMode","hasFixedToolbar","isDistractionFree","lastClientId","SelectedBlockPopover","clientId","rootClientId","isEmptyDefaultBlock","showContents","capturingClientId","__unstablePopoverSlot","__unstableContentRef","isInsertionPointVisible","isBlockInsertionPointVisible","getBlockInsertionPoint","getBlockOrder","insertionPoint","order","index","isLargeViewport","isToolbarForced","stopTyping","showEmptyBlockSideInserter","shouldShowBreadcrumb","shouldShowContextualToolbar","canFocusHiddenToolbar","current","isDisabled","initialToolbarItemIndexRef","popoverProps","contentElement","wrapperSelector","getSelectedBlockClientId","getFirstMultiSelectedBlockClientId","getBlockRootClientId","getBlock","getBlockParents","isNavigationMode","_isNavigationMode","__experimentalGetBlockListSettingsForBlocks","name","attributes","blockParentsClientIds","parentBlockListSettings","find","parentClientId","__experimentalCaptureToolbars","settings","WrappedBlockPopover","selected"],"mappings":";;;;;;;;;AAQA;;;;AALA;;AAMA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAtBA;A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AF5B;AAGNmC,IAAAA,IAHM;AAINtC,IAAAA,iBAAiB,EAAE6C,QAAQ,CAAC7C,iBAJtB;AAKNmC,IAAAA,gBAAgB,EAAEC,iBAAiB,EAL7B;AAMN/B,IAAAA,mBAAmB,EAClBiC,IAAI,IAAI,sCAA0B;AAAEA,MAAAA,IAAF;AAAQC,MAAAA;AAAR,KAA1B,CAPH;AAQNhC,IAAAA;AARM,GAAP;AAUA;;AAEc,SAASuC,mBAAT,QAGX;AAAA,MAHyC;AAC5CtC,IAAAA,qBAD4C;AAE5CC,IAAAA;AAF4C,GAGzC;AACH,QAAMsC,QAAQ,GAAG,qBAAWlB,eAAX,EAA4B,EAA5B,CAAjB;;AAEA,MAAK,CAAEkB,QAAP,EAAkB;AACjB,WAAO,IAAP;AACA;;AAED,QAAM;AACL5C,IAAAA,QADK;AAELC,IAAAA,YAFK;AAGLkC,IAAAA,IAHK;AAILjC,IAAAA,mBAJK;AAKLE,IAAAA,iBALK;AAMLP,IAAAA,iBANK;AAOLmC,IAAAA;AAPK,MAQFY,QARJ;;AAUA,MAAK,CAAET,IAAP,EAAc;AACb,WAAO,IAAP;AACA;;AAED,SACC,4BAAC,oBAAD;AACC,IAAA,QAAQ,EAAGnC,QADZ;AAEC,IAAA,YAAY,EAAGC,YAFhB;AAGC,IAAA,mBAAmB,EAAGC,mBAHvB;AAIC,IAAA,YAAY,EAAG,CAAEL,iBAAF,IAAuBmC,gBAJvC;AAKC,IAAA,iBAAiB,EAAG5B,iBALrB;AAMC,IAAA,qBAAqB,EAAGC,qBANzB;AAOC,IAAA,oBAAoB,EAAGC;AAPxB,IADD;AAWA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useRef, useEffect } from '@wordpress/element';\nimport { isUnmodifiedDefaultBlock } from '@wordpress/blocks';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useShortcut } from '@wordpress/keyboard-shortcuts';\nimport { useViewportMatch } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport BlockSelectionButton from './block-selection-button';\nimport BlockContextualToolbar from './block-contextual-toolbar';\nimport { store as blockEditorStore } from '../../store';\nimport BlockPopover from '../block-popover';\nimport useBlockToolbarPopoverProps from './use-block-toolbar-popover-props';\nimport Inserter from '../inserter';\n\nfunction selector( select ) {\n\tconst {\n\t\t__unstableGetEditorMode,\n\t\tisMultiSelecting,\n\t\thasMultiSelection,\n\t\tisTyping,\n\t\t__experimentalIsBlockInterfaceHidden: isBlockInterfaceHidden,\n\t\tgetSettings,\n\t\tgetLastMultiSelectedBlockClientId,\n\t} = select( blockEditorStore );\n\n\treturn {\n\t\teditorMode: __unstableGetEditorMode(),\n\t\tisMultiSelecting: isMultiSelecting(),\n\t\tisTyping: isTyping(),\n\t\tisBlockInterfaceHidden: isBlockInterfaceHidden(),\n\t\thasFixedToolbar: getSettings().hasFixedToolbar,\n\t\tisDistractionFree: getSettings().isDistractionFree,\n\t\tlastClientId: hasMultiSelection()\n\t\t\t? getLastMultiSelectedBlockClientId()\n\t\t\t: null,\n\t};\n}\n\nfunction SelectedBlockPopover( {\n\tclientId,\n\trootClientId,\n\tisEmptyDefaultBlock,\n\tshowContents, // we may need to mount an empty popover because we reuse\n\tcapturingClientId,\n\t__unstablePopoverSlot,\n\t__unstableContentRef,\n} ) {\n\tconst {\n\t\teditorMode,\n\t\tisMultiSelecting,\n\t\tisTyping,\n\t\tisBlockInterfaceHidden,\n\t\thasFixedToolbar,\n\t\tisDistractionFree,\n\t\tlastClientId,\n\t} = useSelect( selector, [] );\n\tconst isInsertionPointVisible = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tisBlockInsertionPointVisible,\n\t\t\t\tgetBlockInsertionPoint,\n\t\t\t\tgetBlockOrder,\n\t\t\t} = select( blockEditorStore );\n\n\t\t\tif ( ! isBlockInsertionPointVisible() ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tconst insertionPoint = getBlockInsertionPoint();\n\t\t\tconst order = getBlockOrder( insertionPoint.rootClientId );\n\t\t\treturn order[ insertionPoint.index ] === clientId;\n\t\t},\n\t\t[ clientId ]\n\t);\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst isToolbarForced = useRef( false );\n\tconst { stopTyping } = useDispatch( blockEditorStore );\n\n\tconst showEmptyBlockSideInserter =\n\t\t! isTyping && editorMode === 'edit' && isEmptyDefaultBlock;\n\tconst shouldShowBreadcrumb =\n\t\teditorMode === 'navigation' || editorMode === 'zoom-out';\n\tconst shouldShowContextualToolbar =\n\t\teditorMode === 'edit' &&\n\t\t! hasFixedToolbar &&\n\t\tisLargeViewport &&\n\t\t! isMultiSelecting &&\n\t\t! showEmptyBlockSideInserter &&\n\t\t! isTyping &&\n\t\t! isBlockInterfaceHidden;\n\tconst canFocusHiddenToolbar =\n\t\teditorMode === 'edit' &&\n\t\t! shouldShowContextualToolbar &&\n\t\t! hasFixedToolbar &&\n\t\t! isDistractionFree &&\n\t\t! isEmptyDefaultBlock;\n\n\tuseShortcut(\n\t\t'core/block-editor/focus-toolbar',\n\t\t() => {\n\t\t\tisToolbarForced.current = true;\n\t\t\tstopTyping( true );\n\t\t},\n\t\t{\n\t\t\tisDisabled: ! canFocusHiddenToolbar,\n\t\t}\n\t);\n\n\tuseEffect( () => {\n\t\tisToolbarForced.current = false;\n\t} );\n\n\t// Stores the active toolbar item index so the block toolbar can return focus\n\t// to it when re-mounting.\n\tconst initialToolbarItemIndexRef = useRef();\n\n\tconst popoverProps = useBlockToolbarPopoverProps( {\n\t\tcontentElement: __unstableContentRef?.current,\n\t\tclientId,\n\t} );\n\n\tif (\n\t\t! shouldShowBreadcrumb &&\n\t\t! shouldShowContextualToolbar &&\n\t\t! showEmptyBlockSideInserter\n\t) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{ showEmptyBlockSideInserter && (\n\t\t\t\t<BlockPopover\n\t\t\t\t\tclientId={ capturingClientId || clientId }\n\t\t\t\t\t__unstableCoverTarget\n\t\t\t\t\tbottomClientId={ lastClientId }\n\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t'block-editor-block-list__block-side-inserter-popover',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t'is-insertion-point-visible':\n\t\t\t\t\t\t\t\tisInsertionPointVisible,\n\t\t\t\t\t\t}\n\t\t\t\t\t) }\n\t\t\t\t\t__unstablePopoverSlot={ __unstablePopoverSlot }\n\t\t\t\t\t__unstableContentRef={ __unstableContentRef }\n\t\t\t\t\tresize={ false }\n\t\t\t\t\tshift={ false }\n\t\t\t\t\t{ ...popoverProps }\n\t\t\t\t>\n\t\t\t\t\t<div className=\"block-editor-block-list__empty-block-inserter\">\n\t\t\t\t\t\t<Inserter\n\t\t\t\t\t\t\tposition=\"bottom right\"\n\t\t\t\t\t\t\trootClientId={ rootClientId }\n\t\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\t\t__experimentalIsQuick\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t</BlockPopover>\n\t\t\t) }\n\t\t\t{ ( shouldShowBreadcrumb || shouldShowContextualToolbar ) && (\n\t\t\t\t<BlockPopover\n\t\t\t\t\tclientId={ capturingClientId || clientId }\n\t\t\t\t\tbottomClientId={ lastClientId }\n\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t'block-editor-block-list__block-popover',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t'is-insertion-point-visible':\n\t\t\t\t\t\t\t\tisInsertionPointVisible,\n\t\t\t\t\t\t}\n\t\t\t\t\t) }\n\t\t\t\t\t__unstablePopoverSlot={ __unstablePopoverSlot }\n\t\t\t\t\t__unstableContentRef={ __unstableContentRef }\n\t\t\t\t\tresize={ false }\n\t\t\t\t\t{ ...popoverProps }\n\t\t\t\t>\n\t\t\t\t\t{ shouldShowContextualToolbar && showContents && (\n\t\t\t\t\t\t<BlockContextualToolbar\n\t\t\t\t\t\t\t// If the toolbar is being shown because of being forced\n\t\t\t\t\t\t\t// it should focus the toolbar right after the mount.\n\t\t\t\t\t\t\tfocusOnMount={ isToolbarForced.current }\n\t\t\t\t\t\t\t__experimentalInitialIndex={\n\t\t\t\t\t\t\t\tinitialToolbarItemIndexRef.current\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t__experimentalOnIndexChange={ ( index ) => {\n\t\t\t\t\t\t\t\tinitialToolbarItemIndexRef.current = index;\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t// Resets the index whenever the active block changes so\n\t\t\t\t\t\t\t// this is not persisted. See https://github.com/WordPress/gutenberg/pull/25760#issuecomment-717906169\n\t\t\t\t\t\t\tkey={ clientId }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ shouldShowBreadcrumb && (\n\t\t\t\t\t\t<BlockSelectionButton\n\t\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\t\trootClientId={ rootClientId }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</BlockPopover>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nfunction wrapperSelector( select ) {\n\tconst {\n\t\tgetSelectedBlockClientId,\n\t\tgetFirstMultiSelectedBlockClientId,\n\t\tgetBlockRootClientId,\n\t\tgetBlock,\n\t\tgetBlockParents,\n\t\tgetSettings,\n\t\tisNavigationMode: _isNavigationMode,\n\t\t__experimentalGetBlockListSettingsForBlocks,\n\t} = select( blockEditorStore );\n\n\tconst clientId =\n\t\tgetSelectedBlockClientId() || getFirstMultiSelectedBlockClientId();\n\n\tif ( ! clientId ) {\n\t\treturn;\n\t}\n\n\tconst { name, attributes = {} } = getBlock( clientId ) || {};\n\tconst blockParentsClientIds = getBlockParents( clientId );\n\n\t// Get Block List Settings for all ancestors of the current Block clientId.\n\tconst parentBlockListSettings = __experimentalGetBlockListSettingsForBlocks(\n\t\tblockParentsClientIds\n\t);\n\n\t// Get the clientId of the topmost parent with the capture toolbars setting.\n\tconst capturingClientId = blockParentsClientIds.find(\n\t\t( parentClientId ) =>\n\t\t\tparentBlockListSettings[ parentClientId ]\n\t\t\t\t?.__experimentalCaptureToolbars\n\t);\n\n\tconst settings = getSettings();\n\n\treturn {\n\t\tclientId,\n\t\trootClientId: getBlockRootClientId( clientId ),\n\t\tname,\n\t\tisDistractionFree: settings.isDistractionFree,\n\t\tisNavigationMode: _isNavigationMode(),\n\t\tisEmptyDefaultBlock:\n\t\t\tname && isUnmodifiedDefaultBlock( { name, attributes } ),\n\t\tcapturingClientId,\n\t};\n}\n\nexport default function WrappedBlockPopover( {\n\t__unstablePopoverSlot,\n\t__unstableContentRef,\n} ) {\n\tconst selected = useSelect( wrapperSelector, [] );\n\n\tif ( ! selected ) {\n\t\treturn null;\n\t}\n\n\tconst {\n\t\tclientId,\n\t\trootClientId,\n\t\tname,\n\t\tisEmptyDefaultBlock,\n\t\tcapturingClientId,\n\t\tisDistractionFree,\n\t\tisNavigationMode,\n\t} = selected;\n\n\tif ( ! name ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<SelectedBlockPopover\n\t\t\tclientId={ clientId }\n\t\t\trootClientId={ rootClientId }\n\t\t\tisEmptyDefaultBlock={ isEmptyDefaultBlock }\n\t\t\tshowContents={ ! isDistractionFree || isNavigationMode }\n\t\t\tcapturingClientId={ capturingClientId }\n\t\t\t__unstablePopoverSlot={ __unstablePopoverSlot }\n\t\t\t__unstableContentRef={ __unstableContentRef }\n\t\t/>\n\t);\n}\n"]}
@@ -49,14 +49,13 @@ function BlockVariationPicker(_ref) {
49
49
  key: variation.name
50
50
  }, (0, _element.createElement)(_components.Button, {
51
51
  variant: "secondary",
52
- icon: variation.icon,
52
+ icon: variation.icon && variation.icon.src ? variation.icon.src : variation.icon,
53
53
  iconSize: 48,
54
54
  onClick: () => onSelect(variation),
55
55
  className: "block-editor-block-variation-picker__variation",
56
56
  label: variation.description || variation.title
57
57
  }), (0, _element.createElement)("span", {
58
- className: "block-editor-block-variation-picker__variation-label",
59
- role: "presentation"
58
+ className: "block-editor-block-variation-picker__variation-label"
60
59
  }, variation.title)))), allowSkip && (0, _element.createElement)("div", {
61
60
  className: "block-editor-block-variation-picker__skip"
62
61
  }, (0, _element.createElement)(_components.Button, {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/block-variation-picker/index.js"],"names":["BlockVariationPicker","icon","layout","label","instructions","variations","onSelect","allowSkip","classes","length","map","variation","name","description","title"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AAVA;AACA;AACA;;AAGA;AACA;AACA;AAKA,SAASA,oBAAT,OAOI;AAAA,MAP2B;AAC9BC,IAAAA,IAAI,GAAGC,aADuB;AAE9BC,IAAAA,KAAK,GAAG,cAAI,kBAAJ,CAFsB;AAG9BC,IAAAA,YAAY,GAAG,cAAI,mCAAJ,CAHe;AAI9BC,IAAAA,UAJ8B;AAK9BC,IAAAA,QAL8B;AAM9BC,IAAAA;AAN8B,GAO3B;AACH,QAAMC,OAAO,GAAG,yBAAY,qCAAZ,EAAmD;AAClE,2BAAuBH,UAAU,CAACI,MAAX,GAAoB;AADuB,GAAnD,CAAhB;AAIA,SACC,4BAAC,uBAAD;AACC,IAAA,IAAI,EAAGR,IADR;AAEC,IAAA,KAAK,EAAGE,KAFT;AAGC,IAAA,YAAY,EAAGC,YAHhB;AAIC,IAAA,SAAS,EAAGI;AAJb,KAWC;AACC,IAAA,SAAS,EAAC,iDADX;AAEC,IAAA,IAAI,EAAC,MAFN;AAGC,kBAAa,cAAI,kBAAJ;AAHd,KAKGH,UAAU,CAACK,GAAX,CAAkBC,SAAF,IACjB;AAAI,IAAA,GAAG,EAAGA,SAAS,CAACC;AAApB,KACC,4BAAC,kBAAD;AACC,IAAA,OAAO,EAAC,WADT;AAEC,IAAA,IAAI,EAAGD,SAAS,CAACV,IAFlB;AAGC,IAAA,QAAQ,EAAG,EAHZ;AAIC,IAAA,OAAO,EAAG,MAAMK,QAAQ,CAAEK,SAAF,CAJzB;AAKC,IAAA,SAAS,EAAC,gDALX;AAMC,IAAA,KAAK,EAAGA,SAAS,CAACE,WAAV,IAAyBF,SAAS,CAACG;AAN5C,IADD,EASC;AACC,IAAA,SAAS,EAAC,sDADX;AAEC,IAAA,IAAI,EAAC;AAFN,KAIGH,SAAS,CAACG,KAJb,CATD,CADC,CALH,CAXD,EAoCGP,SAAS,IACV;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,4BAAC,kBAAD;AAAQ,IAAA,OAAO,EAAC,MAAhB;AAAuB,IAAA,OAAO,EAAG,MAAMD,QAAQ;AAA/C,KACG,cAAI,MAAJ,CADH,CADD,CArCF,CADD;AA8CA;;eAEcN,oB","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { Button, Placeholder } from '@wordpress/components';\nimport { layout } from '@wordpress/icons';\n\nfunction BlockVariationPicker( {\n\ticon = layout,\n\tlabel = __( 'Choose variation' ),\n\tinstructions = __( 'Select a variation to start with.' ),\n\tvariations,\n\tonSelect,\n\tallowSkip,\n} ) {\n\tconst classes = classnames( 'block-editor-block-variation-picker', {\n\t\t'has-many-variations': variations.length > 4,\n\t} );\n\n\treturn (\n\t\t<Placeholder\n\t\t\ticon={ icon }\n\t\t\tlabel={ label }\n\t\t\tinstructions={ instructions }\n\t\t\tclassName={ classes }\n\t\t>\n\t\t\t{ /*\n\t\t\t * Disable reason: The `list` ARIA role is redundant but\n\t\t\t * Safari+VoiceOver won't announce the list otherwise.\n\t\t\t */\n\t\t\t/* eslint-disable jsx-a11y/no-redundant-roles */ }\n\t\t\t<ul\n\t\t\t\tclassName=\"block-editor-block-variation-picker__variations\"\n\t\t\t\trole=\"list\"\n\t\t\t\taria-label={ __( 'Block variations' ) }\n\t\t\t>\n\t\t\t\t{ variations.map( ( variation ) => (\n\t\t\t\t\t<li key={ variation.name }>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\ticon={ variation.icon }\n\t\t\t\t\t\t\ticonSize={ 48 }\n\t\t\t\t\t\t\tonClick={ () => onSelect( variation ) }\n\t\t\t\t\t\t\tclassName=\"block-editor-block-variation-picker__variation\"\n\t\t\t\t\t\t\tlabel={ variation.description || variation.title }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<span\n\t\t\t\t\t\t\tclassName=\"block-editor-block-variation-picker__variation-label\"\n\t\t\t\t\t\t\trole=\"presentation\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ variation.title }\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</li>\n\t\t\t\t) ) }\n\t\t\t</ul>\n\t\t\t{ /* eslint-enable jsx-a11y/no-redundant-roles */ }\n\t\t\t{ allowSkip && (\n\t\t\t\t<div className=\"block-editor-block-variation-picker__skip\">\n\t\t\t\t\t<Button variant=\"link\" onClick={ () => onSelect() }>\n\t\t\t\t\t\t{ __( 'Skip' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</Placeholder>\n\t);\n}\n\nexport default BlockVariationPicker;\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/block-variation-picker/index.js"],"names":["BlockVariationPicker","icon","layout","label","instructions","variations","onSelect","allowSkip","classes","length","map","variation","name","src","description","title"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AAVA;AACA;AACA;;AAGA;AACA;AACA;AAKA,SAASA,oBAAT,OAOI;AAAA,MAP2B;AAC9BC,IAAAA,IAAI,GAAGC,aADuB;AAE9BC,IAAAA,KAAK,GAAG,cAAI,kBAAJ,CAFsB;AAG9BC,IAAAA,YAAY,GAAG,cAAI,mCAAJ,CAHe;AAI9BC,IAAAA,UAJ8B;AAK9BC,IAAAA,QAL8B;AAM9BC,IAAAA;AAN8B,GAO3B;AACH,QAAMC,OAAO,GAAG,yBAAY,qCAAZ,EAAmD;AAClE,2BAAuBH,UAAU,CAACI,MAAX,GAAoB;AADuB,GAAnD,CAAhB;AAIA,SACC,4BAAC,uBAAD;AACC,IAAA,IAAI,EAAGR,IADR;AAEC,IAAA,KAAK,EAAGE,KAFT;AAGC,IAAA,YAAY,EAAGC,YAHhB;AAIC,IAAA,SAAS,EAAGI;AAJb,KAWC;AACC,IAAA,SAAS,EAAC,iDADX;AAEC,IAAA,IAAI,EAAC,MAFN;AAGC,kBAAa,cAAI,kBAAJ;AAHd,KAKGH,UAAU,CAACK,GAAX,CAAkBC,SAAF,IACjB;AAAI,IAAA,GAAG,EAAGA,SAAS,CAACC;AAApB,KACC,4BAAC,kBAAD;AACC,IAAA,OAAO,EAAC,WADT;AAEC,IAAA,IAAI,EACHD,SAAS,CAACV,IAAV,IAAkBU,SAAS,CAACV,IAAV,CAAeY,GAAjC,GACGF,SAAS,CAACV,IAAV,CAAeY,GADlB,GAEGF,SAAS,CAACV,IALf;AAOC,IAAA,QAAQ,EAAG,EAPZ;AAQC,IAAA,OAAO,EAAG,MAAMK,QAAQ,CAAEK,SAAF,CARzB;AASC,IAAA,SAAS,EAAC,gDATX;AAUC,IAAA,KAAK,EAAGA,SAAS,CAACG,WAAV,IAAyBH,SAAS,CAACI;AAV5C,IADD,EAaC;AAAM,IAAA,SAAS,EAAC;AAAhB,KACGJ,SAAS,CAACI,KADb,CAbD,CADC,CALH,CAXD,EAqCGR,SAAS,IACV;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,4BAAC,kBAAD;AAAQ,IAAA,OAAO,EAAC,MAAhB;AAAuB,IAAA,OAAO,EAAG,MAAMD,QAAQ;AAA/C,KACG,cAAI,MAAJ,CADH,CADD,CAtCF,CADD;AA+CA;;eAEcN,oB","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { Button, Placeholder } from '@wordpress/components';\nimport { layout } from '@wordpress/icons';\n\nfunction BlockVariationPicker( {\n\ticon = layout,\n\tlabel = __( 'Choose variation' ),\n\tinstructions = __( 'Select a variation to start with.' ),\n\tvariations,\n\tonSelect,\n\tallowSkip,\n} ) {\n\tconst classes = classnames( 'block-editor-block-variation-picker', {\n\t\t'has-many-variations': variations.length > 4,\n\t} );\n\n\treturn (\n\t\t<Placeholder\n\t\t\ticon={ icon }\n\t\t\tlabel={ label }\n\t\t\tinstructions={ instructions }\n\t\t\tclassName={ classes }\n\t\t>\n\t\t\t{ /*\n\t\t\t * Disable reason: The `list` ARIA role is redundant but\n\t\t\t * Safari+VoiceOver won't announce the list otherwise.\n\t\t\t */\n\t\t\t/* eslint-disable jsx-a11y/no-redundant-roles */ }\n\t\t\t<ul\n\t\t\t\tclassName=\"block-editor-block-variation-picker__variations\"\n\t\t\t\trole=\"list\"\n\t\t\t\taria-label={ __( 'Block variations' ) }\n\t\t\t>\n\t\t\t\t{ variations.map( ( variation ) => (\n\t\t\t\t\t<li key={ variation.name }>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t\tvariation.icon && variation.icon.src\n\t\t\t\t\t\t\t\t\t? variation.icon.src\n\t\t\t\t\t\t\t\t\t: variation.icon\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ticonSize={ 48 }\n\t\t\t\t\t\t\tonClick={ () => onSelect( variation ) }\n\t\t\t\t\t\t\tclassName=\"block-editor-block-variation-picker__variation\"\n\t\t\t\t\t\t\tlabel={ variation.description || variation.title }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<span className=\"block-editor-block-variation-picker__variation-label\">\n\t\t\t\t\t\t\t{ variation.title }\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</li>\n\t\t\t\t) ) }\n\t\t\t</ul>\n\t\t\t{ /* eslint-enable jsx-a11y/no-redundant-roles */ }\n\t\t\t{ allowSkip && (\n\t\t\t\t<div className=\"block-editor-block-variation-picker__skip\">\n\t\t\t\t\t<Button variant=\"link\" onClick={ () => onSelect() }>\n\t\t\t\t\t\t{ __( 'Skip' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</Placeholder>\n\t);\n}\n\nexport default BlockVariationPicker;\n"]}
@@ -36,9 +36,7 @@ var _a11y = _interopRequireDefault(require("colord/plugins/a11y"));
36
36
 
37
37
  const getColorObjectByAttributeValues = (colors, definedColor, customColor) => {
38
38
  if (definedColor) {
39
- const colorObj = (0, _lodash.find)(colors, {
40
- slug: definedColor
41
- });
39
+ const colorObj = colors === null || colors === void 0 ? void 0 : colors.find(color => color.slug === definedColor);
42
40
 
43
41
  if (colorObj) {
44
42
  return colorObj;
@@ -63,9 +61,7 @@ const getColorObjectByAttributeValues = (colors, definedColor, customColor) => {
63
61
  exports.getColorObjectByAttributeValues = getColorObjectByAttributeValues;
64
62
 
65
63
  const getColorObjectByColorValue = (colors, colorValue) => {
66
- return (0, _lodash.find)(colors, {
67
- color: colorValue
68
- });
64
+ return colors === null || colors === void 0 ? void 0 : colors.find(color => color.color === colorValue);
69
65
  };
70
66
  /**
71
67
  * Returns a class based on the context a color is being used and its slug.
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/colors/utils.js"],"names":["namesPlugin","a11yPlugin","getColorObjectByAttributeValues","colors","definedColor","customColor","colorObj","slug","color","getColorObjectByColorValue","colorValue","getColorClassName","colorContextName","colorSlug","undefined","getMostReadableColor","colordColor","getColorContrast","contrast","maxContrast","Math","max","map","find"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AANA;AACA;AACA;AAMA,oBAAQ,CAAEA,cAAF,EAAeC,aAAf,CAAR;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACO,MAAMC,+BAA+B,GAAG,CAC9CC,MAD8C,EAE9CC,YAF8C,EAG9CC,WAH8C,KAI1C;AACJ,MAAKD,YAAL,EAAoB;AACnB,UAAME,QAAQ,GAAG,kBAAMH,MAAN,EAAc;AAAEI,MAAAA,IAAI,EAAEH;AAAR,KAAd,CAAjB;;AAEA,QAAKE,QAAL,EAAgB;AACf,aAAOA,QAAP;AACA;AACD;;AACD,SAAO;AACNE,IAAAA,KAAK,EAAEH;AADD,GAAP;AAGA,CAfM;AAiBP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;AACO,MAAMI,0BAA0B,GAAG,CAAEN,MAAF,EAAUO,UAAV,KAA0B;AACnE,SAAO,kBAAMP,MAAN,EAAc;AAAEK,IAAAA,KAAK,EAAEE;AAAT,GAAd,CAAP;AACA,CAFM;AAIP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;AACO,SAASC,iBAAT,CAA4BC,gBAA5B,EAA8CC,SAA9C,EAA0D;AAChE,MAAK,CAAED,gBAAF,IAAsB,CAAEC,SAA7B,EAAyC;AACxC,WAAOC,SAAP;AACA;;AAED,SAAQ,OAAO,uBAAWD,SAAX,CAAwB,IAAID,gBAAkB,EAA7D;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASG,oBAAT,CAA+BZ,MAA/B,EAAuCO,UAAvC,EAAoD;AAC1D,QAAMM,WAAW,GAAG,oBAAQN,UAAR,CAApB;;AACA,QAAMO,gBAAgB,GAAG;AAAA,QAAE;AAAET,MAAAA;AAAF,KAAF;AAAA,WAAiBQ,WAAW,CAACE,QAAZ,CAAsBV,KAAtB,CAAjB;AAAA,GAAzB;;AAEA,QAAMW,WAAW,GAAGC,IAAI,CAACC,GAAL,CAAU,GAAGlB,MAAM,CAACmB,GAAP,CAAYL,gBAAZ,CAAb,CAApB;AACA,SAAOd,MAAM,CAACoB,IAAP,CAAef,KAAF,IAAaS,gBAAgB,CAAET,KAAF,CAAhB,KAA8BW,WAAxD,EACLX,KADF;AAEA","sourcesContent":["/**\n * External dependencies\n */\nimport { find, kebabCase } from 'lodash';\nimport { colord, extend } from 'colord';\nimport namesPlugin from 'colord/plugins/names';\nimport a11yPlugin from 'colord/plugins/a11y';\n\nextend( [ namesPlugin, a11yPlugin ] );\n\n/**\n * Provided an array of color objects as set by the theme or by the editor defaults,\n * and the values of the defined color or custom color returns a color object describing the color.\n *\n * @param {Array} colors Array of color objects as set by the theme or by the editor defaults.\n * @param {?string} definedColor A string containing the color slug.\n * @param {?string} customColor A string containing the customColor value.\n *\n * @return {?Object} If definedColor is passed and the name is found in colors,\n * the color object exactly as set by the theme or editor defaults is returned.\n * Otherwise, an object that just sets the color is defined.\n */\nexport const getColorObjectByAttributeValues = (\n\tcolors,\n\tdefinedColor,\n\tcustomColor\n) => {\n\tif ( definedColor ) {\n\t\tconst colorObj = find( colors, { slug: definedColor } );\n\n\t\tif ( colorObj ) {\n\t\t\treturn colorObj;\n\t\t}\n\t}\n\treturn {\n\t\tcolor: customColor,\n\t};\n};\n\n/**\n * Provided an array of color objects as set by the theme or by the editor defaults, and a color value returns the color object matching that value or undefined.\n *\n * @param {Array} colors Array of color objects as set by the theme or by the editor defaults.\n * @param {?string} colorValue A string containing the color value.\n *\n * @return {?Object} Color object included in the colors array whose color property equals colorValue.\n * Returns undefined if no color object matches this requirement.\n */\nexport const getColorObjectByColorValue = ( colors, colorValue ) => {\n\treturn find( colors, { color: colorValue } );\n};\n\n/**\n * Returns a class based on the context a color is being used and its slug.\n *\n * @param {string} colorContextName Context/place where color is being used e.g: background, text etc...\n * @param {string} colorSlug Slug of the color.\n *\n * @return {?string} String with the class corresponding to the color in the provided context.\n * Returns undefined if either colorContextName or colorSlug are not provided.\n */\nexport function getColorClassName( colorContextName, colorSlug ) {\n\tif ( ! colorContextName || ! colorSlug ) {\n\t\treturn undefined;\n\t}\n\n\treturn `has-${ kebabCase( colorSlug ) }-${ colorContextName }`;\n}\n\n/**\n * Given an array of color objects and a color value returns the color value of the most readable color in the array.\n *\n * @param {Array} colors Array of color objects as set by the theme or by the editor defaults.\n * @param {?string} colorValue A string containing the color value.\n *\n * @return {string} String with the color value of the most readable color.\n */\nexport function getMostReadableColor( colors, colorValue ) {\n\tconst colordColor = colord( colorValue );\n\tconst getColorContrast = ( { color } ) => colordColor.contrast( color );\n\n\tconst maxContrast = Math.max( ...colors.map( getColorContrast ) );\n\treturn colors.find( ( color ) => getColorContrast( color ) === maxContrast )\n\t\t.color;\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/colors/utils.js"],"names":["namesPlugin","a11yPlugin","getColorObjectByAttributeValues","colors","definedColor","customColor","colorObj","find","color","slug","getColorObjectByColorValue","colorValue","getColorClassName","colorContextName","colorSlug","undefined","getMostReadableColor","colordColor","getColorContrast","contrast","maxContrast","Math","max","map"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AANA;AACA;AACA;AAMA,oBAAQ,CAAEA,cAAF,EAAeC,aAAf,CAAR;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACO,MAAMC,+BAA+B,GAAG,CAC9CC,MAD8C,EAE9CC,YAF8C,EAG9CC,WAH8C,KAI1C;AACJ,MAAKD,YAAL,EAAoB;AACnB,UAAME,QAAQ,GAAGH,MAAH,aAAGA,MAAH,uBAAGA,MAAM,CAAEI,IAAR,CACdC,KAAF,IAAaA,KAAK,CAACC,IAAN,KAAeL,YADZ,CAAjB;;AAIA,QAAKE,QAAL,EAAgB;AACf,aAAOA,QAAP;AACA;AACD;;AACD,SAAO;AACNE,IAAAA,KAAK,EAAEH;AADD,GAAP;AAGA,CAjBM;AAmBP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;AACO,MAAMK,0BAA0B,GAAG,CAAEP,MAAF,EAAUQ,UAAV,KAA0B;AACnE,SAAOR,MAAP,aAAOA,MAAP,uBAAOA,MAAM,CAAEI,IAAR,CAAgBC,KAAF,IAAaA,KAAK,CAACA,KAAN,KAAgBG,UAA3C,CAAP;AACA,CAFM;AAIP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;AACO,SAASC,iBAAT,CAA4BC,gBAA5B,EAA8CC,SAA9C,EAA0D;AAChE,MAAK,CAAED,gBAAF,IAAsB,CAAEC,SAA7B,EAAyC;AACxC,WAAOC,SAAP;AACA;;AAED,SAAQ,OAAO,uBAAWD,SAAX,CAAwB,IAAID,gBAAkB,EAA7D;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASG,oBAAT,CAA+Bb,MAA/B,EAAuCQ,UAAvC,EAAoD;AAC1D,QAAMM,WAAW,GAAG,oBAAQN,UAAR,CAApB;;AACA,QAAMO,gBAAgB,GAAG;AAAA,QAAE;AAAEV,MAAAA;AAAF,KAAF;AAAA,WAAiBS,WAAW,CAACE,QAAZ,CAAsBX,KAAtB,CAAjB;AAAA,GAAzB;;AAEA,QAAMY,WAAW,GAAGC,IAAI,CAACC,GAAL,CAAU,GAAGnB,MAAM,CAACoB,GAAP,CAAYL,gBAAZ,CAAb,CAApB;AACA,SAAOf,MAAM,CAACI,IAAP,CAAeC,KAAF,IAAaU,gBAAgB,CAAEV,KAAF,CAAhB,KAA8BY,WAAxD,EACLZ,KADF;AAEA","sourcesContent":["/**\n * External dependencies\n */\nimport { kebabCase } from 'lodash';\nimport { colord, extend } from 'colord';\nimport namesPlugin from 'colord/plugins/names';\nimport a11yPlugin from 'colord/plugins/a11y';\n\nextend( [ namesPlugin, a11yPlugin ] );\n\n/**\n * Provided an array of color objects as set by the theme or by the editor defaults,\n * and the values of the defined color or custom color returns a color object describing the color.\n *\n * @param {Array} colors Array of color objects as set by the theme or by the editor defaults.\n * @param {?string} definedColor A string containing the color slug.\n * @param {?string} customColor A string containing the customColor value.\n *\n * @return {?Object} If definedColor is passed and the name is found in colors,\n * the color object exactly as set by the theme or editor defaults is returned.\n * Otherwise, an object that just sets the color is defined.\n */\nexport const getColorObjectByAttributeValues = (\n\tcolors,\n\tdefinedColor,\n\tcustomColor\n) => {\n\tif ( definedColor ) {\n\t\tconst colorObj = colors?.find(\n\t\t\t( color ) => color.slug === definedColor\n\t\t);\n\n\t\tif ( colorObj ) {\n\t\t\treturn colorObj;\n\t\t}\n\t}\n\treturn {\n\t\tcolor: customColor,\n\t};\n};\n\n/**\n * Provided an array of color objects as set by the theme or by the editor defaults, and a color value returns the color object matching that value or undefined.\n *\n * @param {Array} colors Array of color objects as set by the theme or by the editor defaults.\n * @param {?string} colorValue A string containing the color value.\n *\n * @return {?Object} Color object included in the colors array whose color property equals colorValue.\n * Returns undefined if no color object matches this requirement.\n */\nexport const getColorObjectByColorValue = ( colors, colorValue ) => {\n\treturn colors?.find( ( color ) => color.color === colorValue );\n};\n\n/**\n * Returns a class based on the context a color is being used and its slug.\n *\n * @param {string} colorContextName Context/place where color is being used e.g: background, text etc...\n * @param {string} colorSlug Slug of the color.\n *\n * @return {?string} String with the class corresponding to the color in the provided context.\n * Returns undefined if either colorContextName or colorSlug are not provided.\n */\nexport function getColorClassName( colorContextName, colorSlug ) {\n\tif ( ! colorContextName || ! colorSlug ) {\n\t\treturn undefined;\n\t}\n\n\treturn `has-${ kebabCase( colorSlug ) }-${ colorContextName }`;\n}\n\n/**\n * Given an array of color objects and a color value returns the color value of the most readable color in the array.\n *\n * @param {Array} colors Array of color objects as set by the theme or by the editor defaults.\n * @param {?string} colorValue A string containing the color value.\n *\n * @return {string} String with the color value of the most readable color.\n */\nexport function getMostReadableColor( colors, colorValue ) {\n\tconst colordColor = colord( colorValue );\n\tconst getColorContrast = ( { color } ) => colordColor.contrast( color );\n\n\tconst maxContrast = Math.max( ...colors.map( getColorContrast ) );\n\treturn colors.find( ( color ) => getColorContrast( color ) === maxContrast )\n\t\t.color;\n}\n"]}
@@ -49,7 +49,6 @@ function ColorGradientControlInner(_ref) {
49
49
  gradients,
50
50
  disableCustomColors,
51
51
  disableCustomGradients,
52
- __experimentalHasMultipleOrigins,
53
52
  __experimentalIsRenderedInSidebar,
54
53
  className,
55
54
  label,
@@ -77,7 +76,6 @@ function ColorGradientControlInner(_ref) {
77
76
  } : onColorChange,
78
77
  colors,
79
78
  disableCustomColors,
80
- __experimentalHasMultipleOrigins: __experimentalHasMultipleOrigins,
81
79
  __experimentalIsRenderedInSidebar: __experimentalIsRenderedInSidebar,
82
80
  clearable: clearable,
83
81
  enableAlpha: enableAlpha
@@ -91,7 +89,6 @@ function ColorGradientControlInner(_ref) {
91
89
  } : onGradientChange,
92
90
  gradients,
93
91
  disableCustomGradients,
94
- __experimentalHasMultipleOrigins: __experimentalHasMultipleOrigins,
95
92
  __experimentalIsRenderedInSidebar: __experimentalIsRenderedInSidebar,
96
93
  clearable: clearable
97
94
  })