@wordpress/block-editor 11.2.0 → 11.3.1

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 (675) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/README.md +28 -4
  3. package/build/components/alignment-control/ui.js +1 -1
  4. package/build/components/alignment-control/ui.js.map +1 -1
  5. package/build/components/autocomplete/index.js +2 -7
  6. package/build/components/autocomplete/index.js.map +1 -1
  7. package/build/components/block-actions/index.js +7 -2
  8. package/build/components/block-actions/index.js.map +1 -1
  9. package/build/components/block-alignment-matrix-control/index.js +2 -2
  10. package/build/components/block-alignment-matrix-control/index.js.map +1 -1
  11. package/build/components/block-card/index.js +2 -4
  12. package/build/components/block-card/index.js.map +1 -1
  13. package/build/components/block-edit/index.js +8 -0
  14. package/build/components/block-edit/index.js.map +1 -1
  15. package/build/components/block-inspector/index.js +15 -14
  16. package/build/components/block-inspector/index.js.map +1 -1
  17. package/build/components/block-list/use-in-between-inserter.js +5 -0
  18. package/build/components/block-list/use-in-between-inserter.js.map +1 -1
  19. package/build/components/block-lock/modal.js +0 -1
  20. package/build/components/block-lock/modal.js.map +1 -1
  21. package/build/components/block-mover/mover-description.js +2 -2
  22. package/build/components/block-mover/mover-description.js.map +1 -1
  23. package/build/components/block-navigation/dropdown.js +3 -1
  24. package/build/components/block-navigation/dropdown.js.map +1 -1
  25. package/build/components/block-pattern-setup/index.js +1 -1
  26. package/build/components/block-pattern-setup/index.js.map +1 -1
  27. package/build/components/block-pattern-setup/use-patterns-setup.js +2 -2
  28. package/build/components/block-pattern-setup/use-patterns-setup.js.map +1 -1
  29. package/build/components/block-patterns-list/index.js +31 -3
  30. package/build/components/block-patterns-list/index.js.map +1 -1
  31. package/build/components/block-preview/auto.js +9 -11
  32. package/build/components/block-preview/auto.js.map +1 -1
  33. package/build/components/block-preview/index.js +32 -8
  34. package/build/components/block-preview/index.js.map +1 -1
  35. package/build/components/block-selection-clearer/index.js +1 -1
  36. package/build/components/block-selection-clearer/index.js.map +1 -1
  37. package/build/components/block-settings/container.native.js +7 -33
  38. package/build/components/block-settings/container.native.js.map +1 -1
  39. package/build/components/block-settings-menu/block-settings-dropdown.js +12 -6
  40. package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  41. package/build/components/block-settings-menu-controls/index.js +2 -8
  42. package/build/components/block-settings-menu-controls/index.js.map +1 -1
  43. package/build/components/block-switcher/utils.js +1 -1
  44. package/build/components/block-switcher/utils.js.map +1 -1
  45. package/build/components/block-tools/selected-block-popover.js +55 -47
  46. package/build/components/block-tools/selected-block-popover.js.map +1 -1
  47. package/build/components/block-vertical-alignment-control/icons.js +15 -1
  48. package/build/components/block-vertical-alignment-control/icons.js.map +1 -1
  49. package/build/components/block-vertical-alignment-control/ui.js +9 -4
  50. package/build/components/block-vertical-alignment-control/ui.js.map +1 -1
  51. package/build/components/color-style-selector/index.js +3 -1
  52. package/build/components/color-style-selector/index.js.map +1 -1
  53. package/build/components/date-format-picker/index.js +3 -4
  54. package/build/components/date-format-picker/index.js.map +1 -1
  55. package/build/components/font-family/index.js +1 -7
  56. package/build/components/font-family/index.js.map +1 -1
  57. package/build/components/font-sizes/fluid-utils.js +1 -1
  58. package/build/components/font-sizes/fluid-utils.js.map +1 -1
  59. package/build/components/font-sizes/utils.js +1 -1
  60. package/build/components/font-sizes/utils.js.map +1 -1
  61. package/build/components/global-styles/context.js +22 -0
  62. package/build/components/global-styles/context.js.map +1 -0
  63. package/build/components/global-styles/hooks.js +142 -0
  64. package/build/components/global-styles/hooks.js.map +1 -0
  65. package/build/components/global-styles/index.js +42 -0
  66. package/build/components/global-styles/index.js.map +1 -0
  67. package/build/components/global-styles/typography-utils.js +92 -0
  68. package/build/components/global-styles/typography-utils.js.map +1 -0
  69. package/build/components/global-styles/use-global-styles-output.js +974 -0
  70. package/build/components/global-styles/use-global-styles-output.js.map +1 -0
  71. package/build/components/global-styles/utils.js +340 -0
  72. package/build/components/global-styles/utils.js.map +1 -0
  73. package/build/components/height-control/index.js +13 -1
  74. package/build/components/height-control/index.js.map +1 -1
  75. package/build/components/iframe/index.js +5 -3
  76. package/build/components/iframe/index.js.map +1 -1
  77. package/build/components/image-editor/constants.js +1 -1
  78. package/build/components/image-editor/constants.js.map +1 -1
  79. package/build/components/image-editor/context.js +1 -2
  80. package/build/components/image-editor/context.js.map +1 -1
  81. package/build/components/image-editor/cropper.js +3 -1
  82. package/build/components/image-editor/cropper.js.map +1 -1
  83. package/build/components/image-editor/index.js +13 -9
  84. package/build/components/image-editor/index.js.map +1 -1
  85. package/build/components/image-editor/use-transform-image.js +11 -35
  86. package/build/components/image-editor/use-transform-image.js.map +1 -1
  87. package/build/components/image-size-control/index.js +1 -7
  88. package/build/components/image-size-control/index.js.map +1 -1
  89. package/build/components/index.js +8 -24
  90. package/build/components/index.js.map +1 -1
  91. package/build/components/inner-blocks/index.js +22 -32
  92. package/build/components/inner-blocks/index.js.map +1 -1
  93. package/build/components/inner-blocks/index.native.js +8 -23
  94. package/build/components/inner-blocks/index.native.js.map +1 -1
  95. package/build/components/inner-blocks/use-block-context.js +53 -0
  96. package/build/components/inner-blocks/use-block-context.js.map +1 -0
  97. package/build/components/inserter/block-patterns-explorer/explorer.js +0 -1
  98. package/build/components/inserter/block-patterns-explorer/explorer.js.map +1 -1
  99. package/build/components/inserter/block-patterns-tab.js +9 -2
  100. package/build/components/inserter/block-patterns-tab.js.map +1 -1
  101. package/build/components/inserter/block-types-tab.js +2 -2
  102. package/build/components/inserter/block-types-tab.js.map +1 -1
  103. package/build/components/inserter/hooks/use-patterns-state.js +1 -7
  104. package/build/components/inserter/hooks/use-patterns-state.js.map +1 -1
  105. package/build/components/inserter/index.js +5 -4
  106. package/build/components/inserter/index.js.map +1 -1
  107. package/build/components/inserter/media-tab/hooks.js +142 -56
  108. package/build/components/inserter/media-tab/hooks.js.map +1 -1
  109. package/build/components/inserter/media-tab/media-list.js +74 -21
  110. package/build/components/inserter/media-tab/media-list.js.map +1 -1
  111. package/build/components/inserter/media-tab/media-panel.js +11 -13
  112. package/build/components/inserter/media-tab/media-panel.js.map +1 -1
  113. package/build/components/inserter/media-tab/media-tab.js +6 -3
  114. package/build/components/inserter/media-tab/media-tab.js.map +1 -1
  115. package/build/components/inserter/media-tab/utils.js +26 -15
  116. package/build/components/inserter/media-tab/utils.js.map +1 -1
  117. package/build/components/inserter/menu.js +4 -0
  118. package/build/components/inserter/menu.js.map +1 -1
  119. package/build/components/inserter/preview-panel.js +5 -3
  120. package/build/components/inserter/preview-panel.js.map +1 -1
  121. package/build/components/inserter/search-results.js +2 -7
  122. package/build/components/inserter/search-results.js.map +1 -1
  123. package/build/components/inserter-list-item/index.js +1 -9
  124. package/build/components/inserter-list-item/index.js.map +1 -1
  125. package/build/components/inspector-controls/fill.js +15 -2
  126. package/build/components/inspector-controls/fill.js.map +1 -1
  127. package/build/components/inspector-controls/fill.native.js +14 -1
  128. package/build/components/inspector-controls/fill.native.js.map +1 -1
  129. package/build/components/inspector-controls/groups.js +4 -0
  130. package/build/components/inspector-controls/groups.js.map +1 -1
  131. package/build/components/inspector-controls/index.js +2 -2
  132. package/build/components/inspector-controls/index.js.map +1 -1
  133. package/build/components/inspector-controls/slot.js +14 -1
  134. package/build/components/inspector-controls/slot.js.map +1 -1
  135. package/build/components/inspector-controls/slot.native.js +14 -1
  136. package/build/components/inspector-controls/slot.native.js.map +1 -1
  137. package/build/components/inspector-controls-tabs/advanced-controls-panel.js +1 -1
  138. package/build/components/inspector-controls-tabs/advanced-controls-panel.js.map +1 -1
  139. package/build/components/inspector-controls-tabs/index.js +2 -2
  140. package/build/components/inspector-controls-tabs/index.js.map +1 -1
  141. package/build/components/inspector-controls-tabs/position-controls-panel.js +1 -1
  142. package/build/components/inspector-controls-tabs/position-controls-panel.js.map +1 -1
  143. package/build/components/inspector-controls-tabs/styles-tab.js +6 -4
  144. package/build/components/inspector-controls-tabs/styles-tab.js.map +1 -1
  145. package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js +17 -12
  146. package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +1 -1
  147. package/build/components/justify-content-control/ui.js +8 -1
  148. package/build/components/justify-content-control/ui.js.map +1 -1
  149. package/build/components/link-control/index.js +45 -17
  150. package/build/components/link-control/index.js.map +1 -1
  151. package/build/components/list-view/block.js +1 -1
  152. package/build/components/list-view/block.js.map +1 -1
  153. package/build/components/list-view/use-list-view-drop-zone.js +1 -1
  154. package/build/components/list-view/use-list-view-drop-zone.js.map +1 -1
  155. package/build/components/media-upload/index.native.js +4 -1
  156. package/build/components/media-upload/index.native.js.map +1 -1
  157. package/build/components/off-canvas-editor/appender.js +50 -3
  158. package/build/components/off-canvas-editor/appender.js.map +1 -1
  159. package/build/components/off-canvas-editor/block-contents.js +3 -1
  160. package/build/components/off-canvas-editor/block-contents.js.map +1 -1
  161. package/build/components/off-canvas-editor/block-select-button.js +10 -4
  162. package/build/components/off-canvas-editor/block-select-button.js.map +1 -1
  163. package/build/components/off-canvas-editor/block.js +6 -27
  164. package/build/components/off-canvas-editor/block.js.map +1 -1
  165. package/build/components/off-canvas-editor/branch.js +25 -10
  166. package/build/components/off-canvas-editor/branch.js.map +1 -1
  167. package/build/components/off-canvas-editor/index.js +27 -20
  168. package/build/components/off-canvas-editor/index.js.map +1 -1
  169. package/build/components/off-canvas-editor/link-ui.js +2 -2
  170. package/build/components/off-canvas-editor/link-ui.js.map +1 -1
  171. package/build/components/off-canvas-editor/use-list-view-drop-zone.js +1 -1
  172. package/build/components/off-canvas-editor/use-list-view-drop-zone.js.map +1 -1
  173. package/build/components/provider/index.js +21 -9
  174. package/build/components/provider/index.js.map +1 -1
  175. package/build/components/provider/index.native.js +5 -6
  176. package/build/components/provider/index.native.js.map +1 -1
  177. package/build/components/rich-text/use-before-input-rules.js +11 -3
  178. package/build/components/rich-text/use-before-input-rules.js.map +1 -1
  179. package/build/components/rich-text/utils.js +1 -1
  180. package/build/components/rich-text/utils.js.map +1 -1
  181. package/build/components/spacing-sizes-control/utils.js +2 -8
  182. package/build/components/spacing-sizes-control/utils.js.map +1 -1
  183. package/build/components/tool-selector/index.js +3 -1
  184. package/build/components/tool-selector/index.js.map +1 -1
  185. package/build/components/url-popover/image-url-input-ui.js +7 -8
  186. package/build/components/url-popover/image-url-input-ui.js.map +1 -1
  187. package/build/components/use-block-display-information/index.js +1 -1
  188. package/build/components/use-block-display-information/index.js.map +1 -1
  189. package/build/experiments.js +45 -0
  190. package/build/experiments.js.map +1 -0
  191. package/build/experiments.native.js +40 -0
  192. package/build/experiments.native.js.map +1 -0
  193. package/build/hooks/anchor.js +2 -1
  194. package/build/hooks/anchor.js.map +1 -1
  195. package/build/hooks/border.js +1 -1
  196. package/build/hooks/border.js.map +1 -1
  197. package/build/hooks/child-layout.js +5 -1
  198. package/build/hooks/child-layout.js.map +1 -1
  199. package/build/hooks/color-panel.js +1 -1
  200. package/build/hooks/color-panel.js.map +1 -1
  201. package/build/hooks/color.js +3 -3
  202. package/build/hooks/color.js.map +1 -1
  203. package/build/hooks/custom-class-name.js +2 -1
  204. package/build/hooks/custom-class-name.js.map +1 -1
  205. package/build/hooks/dimensions.js +7 -5
  206. package/build/hooks/dimensions.js.map +1 -1
  207. package/build/hooks/margin.js +1 -0
  208. package/build/hooks/margin.js.map +1 -1
  209. package/build/hooks/padding.js +1 -0
  210. package/build/hooks/padding.js.map +1 -1
  211. package/build/hooks/position.js +39 -17
  212. package/build/hooks/position.js.map +1 -1
  213. package/build/hooks/typography.js +1 -1
  214. package/build/hooks/typography.js.map +1 -1
  215. package/build/hooks/use-color-props.js +3 -3
  216. package/build/hooks/use-color-props.js.map +1 -1
  217. package/build/hooks/utils.js +69 -3
  218. package/build/hooks/utils.js.map +1 -1
  219. package/build/index.js +10 -1
  220. package/build/index.js.map +1 -1
  221. package/build/layouts/constrained.js +3 -0
  222. package/build/layouts/constrained.js.map +1 -1
  223. package/build/layouts/flex.js +59 -9
  224. package/build/layouts/flex.js.map +1 -1
  225. package/build/layouts/flow.js +0 -18
  226. package/build/layouts/flow.js.map +1 -1
  227. package/build/store/actions.js +3 -30
  228. package/build/store/actions.js.map +1 -1
  229. package/build/store/defaults.js +5 -2
  230. package/build/store/defaults.js.map +1 -1
  231. package/build/store/index.js +11 -2
  232. package/build/store/index.js.map +1 -1
  233. package/build/store/private-actions.js +78 -0
  234. package/build/store/private-actions.js.map +1 -0
  235. package/build/store/private-selectors.js +32 -0
  236. package/build/store/private-selectors.js.map +1 -0
  237. package/build/store/reducer.js +1 -1
  238. package/build/store/reducer.js.map +1 -1
  239. package/build/store/selectors.js +60 -48
  240. package/build/store/selectors.js.map +1 -1
  241. package/build/utils/block-variation-transforms.js +1 -1
  242. package/build/utils/block-variation-transforms.js.map +1 -1
  243. package/build/utils/parse-css-unit-to-px.js +1 -1
  244. package/build/utils/parse-css-unit-to-px.js.map +1 -1
  245. package/build/utils/transform-styles/index.js +1 -7
  246. package/build/utils/transform-styles/index.js.map +1 -1
  247. package/build-module/components/alignment-control/ui.js +1 -1
  248. package/build-module/components/alignment-control/ui.js.map +1 -1
  249. package/build-module/components/autocomplete/index.js +2 -6
  250. package/build-module/components/autocomplete/index.js.map +1 -1
  251. package/build-module/components/block-actions/index.js +7 -2
  252. package/build-module/components/block-actions/index.js.map +1 -1
  253. package/build-module/components/block-alignment-matrix-control/index.js +2 -2
  254. package/build-module/components/block-alignment-matrix-control/index.js.map +1 -1
  255. package/build-module/components/block-card/index.js +2 -4
  256. package/build-module/components/block-card/index.js.map +1 -1
  257. package/build-module/components/block-edit/index.js +7 -0
  258. package/build-module/components/block-edit/index.js.map +1 -1
  259. package/build-module/components/block-inspector/index.js +15 -14
  260. package/build-module/components/block-inspector/index.js.map +1 -1
  261. package/build-module/components/block-list/use-in-between-inserter.js +5 -0
  262. package/build-module/components/block-list/use-in-between-inserter.js.map +1 -1
  263. package/build-module/components/block-lock/modal.js +0 -1
  264. package/build-module/components/block-lock/modal.js.map +1 -1
  265. package/build-module/components/block-mover/mover-description.js +2 -2
  266. package/build-module/components/block-mover/mover-description.js.map +1 -1
  267. package/build-module/components/block-navigation/dropdown.js +3 -1
  268. package/build-module/components/block-navigation/dropdown.js.map +1 -1
  269. package/build-module/components/block-pattern-setup/index.js +1 -1
  270. package/build-module/components/block-pattern-setup/index.js.map +1 -1
  271. package/build-module/components/block-pattern-setup/use-patterns-setup.js +2 -2
  272. package/build-module/components/block-pattern-setup/use-patterns-setup.js.map +1 -1
  273. package/build-module/components/block-patterns-list/index.js +32 -3
  274. package/build-module/components/block-patterns-list/index.js.map +1 -1
  275. package/build-module/components/block-preview/auto.js +9 -11
  276. package/build-module/components/block-preview/auto.js.map +1 -1
  277. package/build-module/components/block-preview/index.js +31 -8
  278. package/build-module/components/block-preview/index.js.map +1 -1
  279. package/build-module/components/block-selection-clearer/index.js +1 -1
  280. package/build-module/components/block-selection-clearer/index.js.map +1 -1
  281. package/build-module/components/block-settings/container.native.js +6 -30
  282. package/build-module/components/block-settings/container.native.js.map +1 -1
  283. package/build-module/components/block-settings-menu/block-settings-dropdown.js +12 -6
  284. package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  285. package/build-module/components/block-settings-menu-controls/index.js +2 -7
  286. package/build-module/components/block-settings-menu-controls/index.js.map +1 -1
  287. package/build-module/components/block-switcher/utils.js +1 -1
  288. package/build-module/components/block-switcher/utils.js.map +1 -1
  289. package/build-module/components/block-tools/selected-block-popover.js +55 -48
  290. package/build-module/components/block-tools/selected-block-popover.js.map +1 -1
  291. package/build-module/components/block-vertical-alignment-control/icons.js +12 -0
  292. package/build-module/components/block-vertical-alignment-control/icons.js.map +1 -1
  293. package/build-module/components/block-vertical-alignment-control/ui.js +10 -5
  294. package/build-module/components/block-vertical-alignment-control/ui.js.map +1 -1
  295. package/build-module/components/color-style-selector/index.js +3 -1
  296. package/build-module/components/color-style-selector/index.js.map +1 -1
  297. package/build-module/components/date-format-picker/index.js +4 -5
  298. package/build-module/components/date-format-picker/index.js.map +1 -1
  299. package/build-module/components/font-family/index.js +1 -6
  300. package/build-module/components/font-family/index.js.map +1 -1
  301. package/build-module/components/font-sizes/fluid-utils.js +1 -1
  302. package/build-module/components/font-sizes/fluid-utils.js.map +1 -1
  303. package/build-module/components/font-sizes/utils.js +1 -1
  304. package/build-module/components/font-sizes/utils.js.map +1 -1
  305. package/build-module/components/global-styles/context.js +12 -0
  306. package/build-module/components/global-styles/context.js.map +1 -0
  307. package/build-module/components/global-styles/hooks.js +121 -0
  308. package/build-module/components/global-styles/hooks.js.map +1 -0
  309. package/build-module/components/global-styles/index.js +4 -0
  310. package/build-module/components/global-styles/index.js.map +1 -0
  311. package/build-module/components/global-styles/typography-utils.js +84 -0
  312. package/build-module/components/global-styles/typography-utils.js.map +1 -0
  313. package/build-module/components/global-styles/use-global-styles-output.js +930 -0
  314. package/build-module/components/global-styles/use-global-styles-output.js.map +1 -0
  315. package/build-module/components/global-styles/utils.js +321 -0
  316. package/build-module/components/global-styles/utils.js.map +1 -0
  317. package/build-module/components/height-control/index.js +14 -1
  318. package/build-module/components/height-control/index.js.map +1 -1
  319. package/build-module/components/iframe/index.js +6 -4
  320. package/build-module/components/iframe/index.js.map +1 -1
  321. package/build-module/components/image-editor/constants.js +1 -1
  322. package/build-module/components/image-editor/constants.js.map +1 -1
  323. package/build-module/components/image-editor/context.js +1 -2
  324. package/build-module/components/image-editor/context.js.map +1 -1
  325. package/build-module/components/image-editor/cropper.js +3 -1
  326. package/build-module/components/image-editor/cropper.js.map +1 -1
  327. package/build-module/components/image-editor/index.js +13 -3
  328. package/build-module/components/image-editor/index.js.map +1 -1
  329. package/build-module/components/image-editor/use-transform-image.js +12 -37
  330. package/build-module/components/image-editor/use-transform-image.js.map +1 -1
  331. package/build-module/components/image-size-control/index.js +1 -6
  332. package/build-module/components/image-size-control/index.js.map +1 -1
  333. package/build-module/components/index.js +2 -3
  334. package/build-module/components/index.js.map +1 -1
  335. package/build-module/components/inner-blocks/index.js +21 -32
  336. package/build-module/components/inner-blocks/index.js.map +1 -1
  337. package/build-module/components/inner-blocks/index.native.js +9 -22
  338. package/build-module/components/inner-blocks/index.native.js.map +1 -1
  339. package/build-module/components/inner-blocks/use-block-context.js +43 -0
  340. package/build-module/components/inner-blocks/use-block-context.js.map +1 -0
  341. package/build-module/components/inserter/block-patterns-explorer/explorer.js +0 -1
  342. package/build-module/components/inserter/block-patterns-explorer/explorer.js.map +1 -1
  343. package/build-module/components/inserter/block-patterns-tab.js +9 -2
  344. package/build-module/components/inserter/block-patterns-tab.js.map +1 -1
  345. package/build-module/components/inserter/block-types-tab.js +3 -3
  346. package/build-module/components/inserter/block-types-tab.js.map +1 -1
  347. package/build-module/components/inserter/hooks/use-patterns-state.js +1 -6
  348. package/build-module/components/inserter/hooks/use-patterns-state.js.map +1 -1
  349. package/build-module/components/inserter/index.js +5 -4
  350. package/build-module/components/inserter/index.js.map +1 -1
  351. package/build-module/components/inserter/media-tab/hooks.js +145 -56
  352. package/build-module/components/inserter/media-tab/hooks.js.map +1 -1
  353. package/build-module/components/inserter/media-tab/media-list.js +74 -24
  354. package/build-module/components/inserter/media-tab/media-list.js.map +1 -1
  355. package/build-module/components/inserter/media-tab/media-panel.js +14 -14
  356. package/build-module/components/inserter/media-tab/media-panel.js.map +1 -1
  357. package/build-module/components/inserter/media-tab/media-tab.js +7 -4
  358. package/build-module/components/inserter/media-tab/media-tab.js.map +1 -1
  359. package/build-module/components/inserter/media-tab/utils.js +27 -15
  360. package/build-module/components/inserter/media-tab/utils.js.map +1 -1
  361. package/build-module/components/inserter/menu.js +4 -0
  362. package/build-module/components/inserter/menu.js.map +1 -1
  363. package/build-module/components/inserter/preview-panel.js +5 -3
  364. package/build-module/components/inserter/preview-panel.js.map +1 -1
  365. package/build-module/components/inserter/search-results.js +2 -6
  366. package/build-module/components/inserter/search-results.js.map +1 -1
  367. package/build-module/components/inserter-list-item/index.js +1 -9
  368. package/build-module/components/inserter-list-item/index.js.map +1 -1
  369. package/build-module/components/inspector-controls/fill.js +14 -2
  370. package/build-module/components/inspector-controls/fill.js.map +1 -1
  371. package/build-module/components/inspector-controls/fill.native.js +13 -1
  372. package/build-module/components/inspector-controls/fill.native.js.map +1 -1
  373. package/build-module/components/inspector-controls/groups.js +4 -0
  374. package/build-module/components/inspector-controls/groups.js.map +1 -1
  375. package/build-module/components/inspector-controls/index.js +2 -2
  376. package/build-module/components/inspector-controls/index.js.map +1 -1
  377. package/build-module/components/inspector-controls/slot.js +13 -1
  378. package/build-module/components/inspector-controls/slot.js.map +1 -1
  379. package/build-module/components/inspector-controls/slot.native.js +13 -1
  380. package/build-module/components/inspector-controls/slot.native.js.map +1 -1
  381. package/build-module/components/inspector-controls-tabs/advanced-controls-panel.js +1 -1
  382. package/build-module/components/inspector-controls-tabs/advanced-controls-panel.js.map +1 -1
  383. package/build-module/components/inspector-controls-tabs/index.js +2 -2
  384. package/build-module/components/inspector-controls-tabs/index.js.map +1 -1
  385. package/build-module/components/inspector-controls-tabs/position-controls-panel.js +1 -1
  386. package/build-module/components/inspector-controls-tabs/position-controls-panel.js.map +1 -1
  387. package/build-module/components/inspector-controls-tabs/styles-tab.js +6 -4
  388. package/build-module/components/inspector-controls-tabs/styles-tab.js.map +1 -1
  389. package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js +17 -12
  390. package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +1 -1
  391. package/build-module/components/justify-content-control/ui.js +9 -2
  392. package/build-module/components/justify-content-control/ui.js.map +1 -1
  393. package/build-module/components/link-control/index.js +45 -16
  394. package/build-module/components/link-control/index.js.map +1 -1
  395. package/build-module/components/list-view/block.js +1 -1
  396. package/build-module/components/list-view/block.js.map +1 -1
  397. package/build-module/components/list-view/use-list-view-drop-zone.js +1 -1
  398. package/build-module/components/list-view/use-list-view-drop-zone.js.map +1 -1
  399. package/build-module/components/media-upload/index.native.js +4 -1
  400. package/build-module/components/media-upload/index.native.js.map +1 -1
  401. package/build-module/components/off-canvas-editor/appender.js +47 -4
  402. package/build-module/components/off-canvas-editor/appender.js.map +1 -1
  403. package/build-module/components/off-canvas-editor/block-contents.js +2 -1
  404. package/build-module/components/off-canvas-editor/block-contents.js.map +1 -1
  405. package/build-module/components/off-canvas-editor/block-select-button.js +9 -4
  406. package/build-module/components/off-canvas-editor/block-select-button.js.map +1 -1
  407. package/build-module/components/off-canvas-editor/block.js +6 -25
  408. package/build-module/components/off-canvas-editor/block.js.map +1 -1
  409. package/build-module/components/off-canvas-editor/branch.js +23 -11
  410. package/build-module/components/off-canvas-editor/branch.js.map +1 -1
  411. package/build-module/components/off-canvas-editor/index.js +27 -19
  412. package/build-module/components/off-canvas-editor/index.js.map +1 -1
  413. package/build-module/components/off-canvas-editor/link-ui.js +2 -2
  414. package/build-module/components/off-canvas-editor/link-ui.js.map +1 -1
  415. package/build-module/components/off-canvas-editor/use-list-view-drop-zone.js +1 -1
  416. package/build-module/components/off-canvas-editor/use-list-view-drop-zone.js.map +1 -1
  417. package/build-module/components/provider/index.js +16 -9
  418. package/build-module/components/provider/index.js.map +1 -1
  419. package/build-module/components/provider/index.native.js +4 -4
  420. package/build-module/components/provider/index.native.js.map +1 -1
  421. package/build-module/components/rich-text/use-before-input-rules.js +10 -2
  422. package/build-module/components/rich-text/use-before-input-rules.js.map +1 -1
  423. package/build-module/components/rich-text/utils.js +1 -1
  424. package/build-module/components/rich-text/utils.js.map +1 -1
  425. package/build-module/components/spacing-sizes-control/utils.js +2 -7
  426. package/build-module/components/spacing-sizes-control/utils.js.map +1 -1
  427. package/build-module/components/tool-selector/index.js +3 -1
  428. package/build-module/components/tool-selector/index.js.map +1 -1
  429. package/build-module/components/url-popover/image-url-input-ui.js +8 -8
  430. package/build-module/components/url-popover/image-url-input-ui.js.map +1 -1
  431. package/build-module/components/use-block-display-information/index.js +1 -1
  432. package/build-module/components/use-block-display-information/index.js.map +1 -1
  433. package/build-module/experiments.js +25 -0
  434. package/build-module/experiments.js.map +1 -0
  435. package/build-module/experiments.native.js +23 -0
  436. package/build-module/experiments.native.js.map +1 -0
  437. package/build-module/hooks/anchor.js +2 -1
  438. package/build-module/hooks/anchor.js.map +1 -1
  439. package/build-module/hooks/border.js +1 -1
  440. package/build-module/hooks/border.js.map +1 -1
  441. package/build-module/hooks/child-layout.js +5 -1
  442. package/build-module/hooks/child-layout.js.map +1 -1
  443. package/build-module/hooks/color-panel.js +1 -1
  444. package/build-module/hooks/color-panel.js.map +1 -1
  445. package/build-module/hooks/color.js +3 -3
  446. package/build-module/hooks/color.js.map +1 -1
  447. package/build-module/hooks/custom-class-name.js +2 -1
  448. package/build-module/hooks/custom-class-name.js.map +1 -1
  449. package/build-module/hooks/dimensions.js +6 -5
  450. package/build-module/hooks/dimensions.js.map +1 -1
  451. package/build-module/hooks/margin.js +1 -0
  452. package/build-module/hooks/margin.js.map +1 -1
  453. package/build-module/hooks/padding.js +1 -0
  454. package/build-module/hooks/padding.js.map +1 -1
  455. package/build-module/hooks/position.js +36 -16
  456. package/build-module/hooks/position.js.map +1 -1
  457. package/build-module/hooks/typography.js +1 -1
  458. package/build-module/hooks/typography.js.map +1 -1
  459. package/build-module/hooks/use-color-props.js +3 -3
  460. package/build-module/hooks/use-color-props.js.map +1 -1
  461. package/build-module/hooks/utils.js +70 -4
  462. package/build-module/hooks/utils.js.map +1 -1
  463. package/build-module/index.js +1 -0
  464. package/build-module/index.js.map +1 -1
  465. package/build-module/layouts/constrained.js +3 -0
  466. package/build-module/layouts/constrained.js.map +1 -1
  467. package/build-module/layouts/flex.js +60 -10
  468. package/build-module/layouts/flex.js.map +1 -1
  469. package/build-module/layouts/flow.js +0 -18
  470. package/build-module/layouts/flow.js.map +1 -1
  471. package/build-module/store/actions.js +2 -26
  472. package/build-module/store/actions.js.map +1 -1
  473. package/build-module/store/defaults.js +5 -2
  474. package/build-module/store/defaults.js.map +1 -1
  475. package/build-module/store/index.js +8 -2
  476. package/build-module/store/index.js.map +1 -1
  477. package/build-module/store/private-actions.js +66 -0
  478. package/build-module/store/private-actions.js.map +1 -0
  479. package/build-module/store/private-selectors.js +23 -0
  480. package/build-module/store/private-selectors.js.map +1 -0
  481. package/build-module/store/reducer.js +1 -1
  482. package/build-module/store/reducer.js.map +1 -1
  483. package/build-module/store/selectors.js +48 -37
  484. package/build-module/store/selectors.js.map +1 -1
  485. package/build-module/utils/block-variation-transforms.js +1 -1
  486. package/build-module/utils/block-variation-transforms.js.map +1 -1
  487. package/build-module/utils/parse-css-unit-to-px.js +1 -1
  488. package/build-module/utils/parse-css-unit-to-px.js.map +1 -1
  489. package/build-module/utils/transform-styles/index.js +1 -6
  490. package/build-module/utils/transform-styles/index.js.map +1 -1
  491. package/build-style/content-rtl.css +283 -3
  492. package/build-style/content.css +283 -3
  493. package/build-style/style-rtl.css +105 -221
  494. package/build-style/style.css +105 -221
  495. package/package.json +30 -29
  496. package/src/components/alignment-control/test/__snapshots__/index.js.snap +3 -3
  497. package/src/components/alignment-control/test/index.js +5 -15
  498. package/src/components/alignment-control/ui.js +1 -1
  499. package/src/components/autocomplete/index.js +3 -6
  500. package/src/components/block-actions/index.js +9 -0
  501. package/src/components/block-alignment-control/test/index.js +3 -11
  502. package/src/components/block-alignment-matrix-control/index.js +1 -2
  503. package/src/components/block-card/index.js +1 -4
  504. package/src/components/block-content-overlay/content.scss +4 -4
  505. package/src/components/block-edit/index.js +15 -1
  506. package/src/components/block-icon/content.scss +31 -0
  507. package/src/components/block-inspector/index.js +13 -17
  508. package/src/components/block-list/use-in-between-inserter.js +5 -0
  509. package/src/components/block-lock/modal.js +0 -1
  510. package/src/components/block-mover/mover-description.js +2 -2
  511. package/src/components/block-mover/stories/index.js +3 -3
  512. package/src/components/block-navigation/dropdown.js +1 -1
  513. package/src/components/block-pattern-setup/index.js +1 -4
  514. package/src/components/block-pattern-setup/use-patterns-setup.js +2 -5
  515. package/src/components/block-patterns-list/index.js +29 -3
  516. package/src/components/block-preview/README.md +9 -9
  517. package/src/components/block-preview/auto.js +9 -11
  518. package/src/components/block-preview/content.scss +23 -0
  519. package/src/components/block-preview/index.js +40 -10
  520. package/src/components/block-preview/style.scss +0 -23
  521. package/src/components/block-selection-clearer/index.js +1 -1
  522. package/src/components/block-selection-clearer/test/index.js +6 -6
  523. package/src/components/block-settings/container.native.js +7 -26
  524. package/src/components/block-settings-menu/block-settings-dropdown.js +13 -5
  525. package/src/components/block-settings-menu-controls/index.js +2 -10
  526. package/src/components/block-switcher/test/index.js +43 -44
  527. package/src/components/block-switcher/utils.js +1 -1
  528. package/src/components/block-tools/selected-block-popover.js +77 -80
  529. package/src/components/block-tools/style.scss +0 -1
  530. package/src/components/block-variation-picker/{style.scss → content.scss} +0 -0
  531. package/src/components/block-vertical-alignment-control/icons.js +12 -0
  532. package/src/components/block-vertical-alignment-control/test/index.js +3 -11
  533. package/src/components/block-vertical-alignment-control/ui.js +16 -6
  534. package/src/components/color-style-selector/index.js +1 -1
  535. package/src/components/colors/test/with-colors.js +2 -8
  536. package/src/components/date-format-picker/index.js +23 -24
  537. package/src/components/date-format-picker/style.scss +0 -6
  538. package/src/components/default-block-appender/content.scss +18 -0
  539. package/src/components/default-block-appender/test/index.js +2 -8
  540. package/src/components/font-family/index.js +1 -6
  541. package/src/components/font-sizes/fluid-utils.js +1 -1
  542. package/src/components/font-sizes/utils.js +1 -1
  543. package/src/components/global-styles/README.md +77 -0
  544. package/src/components/global-styles/context.js +15 -0
  545. package/src/components/global-styles/hooks.js +145 -0
  546. package/src/components/global-styles/index.js +7 -0
  547. package/src/components/global-styles/test/typography-utils.js +393 -0
  548. package/src/components/global-styles/test/use-global-styles-output.js +814 -0
  549. package/src/components/global-styles/test/utils.js +206 -0
  550. package/src/components/global-styles/typography-utils.js +87 -0
  551. package/src/components/global-styles/use-global-styles-output.js +1088 -0
  552. package/src/components/global-styles/utils.js +373 -0
  553. package/src/components/height-control/README.md +55 -0
  554. package/src/components/height-control/index.js +13 -1
  555. package/src/components/iframe/index.js +8 -2
  556. package/src/components/image-editor/constants.js +1 -1
  557. package/src/components/image-editor/context.js +5 -9
  558. package/src/components/image-editor/cropper.js +3 -1
  559. package/src/components/image-editor/index.js +13 -4
  560. package/src/components/image-editor/use-transform-image.js +14 -55
  561. package/src/components/image-size-control/index.js +1 -6
  562. package/src/components/index.js +2 -6
  563. package/src/components/inner-blocks/index.js +29 -33
  564. package/src/components/inner-blocks/index.native.js +27 -47
  565. package/src/components/inner-blocks/use-block-context.js +47 -0
  566. package/src/components/inserter/block-patterns-explorer/explorer.js +0 -1
  567. package/src/components/inserter/block-patterns-tab.js +9 -1
  568. package/src/components/inserter/block-types-tab.js +3 -4
  569. package/src/components/inserter/hooks/use-patterns-state.js +1 -6
  570. package/src/components/inserter/index.js +3 -4
  571. package/src/components/inserter/media-tab/hooks.js +167 -65
  572. package/src/components/inserter/media-tab/media-list.js +94 -26
  573. package/src/components/inserter/media-tab/media-panel.js +9 -20
  574. package/src/components/inserter/media-tab/media-tab.js +12 -4
  575. package/src/components/inserter/media-tab/utils.js +20 -10
  576. package/src/components/inserter/menu.js +8 -0
  577. package/src/components/inserter/preview-panel.js +4 -2
  578. package/src/components/inserter/search-results.js +2 -6
  579. package/src/components/inserter/stories/index.js +9 -9
  580. package/src/components/inserter/style.scss +58 -11
  581. package/src/components/inserter-list-item/index.js +0 -7
  582. package/src/components/inspector-controls/README.md +3 -7
  583. package/src/components/inspector-controls/fill.js +15 -1
  584. package/src/components/inspector-controls/fill.native.js +14 -1
  585. package/src/components/inspector-controls/groups.js +3 -0
  586. package/src/components/inspector-controls/index.js +2 -6
  587. package/src/components/inspector-controls/slot.js +14 -1
  588. package/src/components/inspector-controls/slot.native.js +14 -1
  589. package/src/components/inspector-controls-tabs/advanced-controls-panel.js +1 -1
  590. package/src/components/inspector-controls-tabs/index.js +2 -4
  591. package/src/components/inspector-controls-tabs/position-controls-panel.js +1 -1
  592. package/src/components/inspector-controls-tabs/styles-tab.js +5 -7
  593. package/src/components/inspector-controls-tabs/use-inspector-controls-tabs.js +21 -10
  594. package/src/components/justify-content-control/ui.js +9 -0
  595. package/src/components/link-control/index.js +59 -23
  596. package/src/components/link-control/style.scss +7 -24
  597. package/src/components/link-control/test/index.js +134 -5
  598. package/src/components/list-view/block.js +1 -1
  599. package/src/components/list-view/use-list-view-drop-zone.js +1 -1
  600. package/src/components/media-replace-flow/test/index.js +4 -12
  601. package/src/components/media-upload/index.native.js +2 -2
  602. package/src/components/off-canvas-editor/README.md +2 -2
  603. package/src/components/off-canvas-editor/appender.js +93 -37
  604. package/src/components/off-canvas-editor/block-contents.js +2 -1
  605. package/src/components/off-canvas-editor/block-select-button.js +12 -1
  606. package/src/components/off-canvas-editor/block.js +3 -42
  607. package/src/components/off-canvas-editor/branch.js +32 -5
  608. package/src/components/off-canvas-editor/index.js +20 -20
  609. package/src/components/off-canvas-editor/link-ui.js +2 -2
  610. package/src/components/off-canvas-editor/style.scss +5 -1
  611. package/src/components/off-canvas-editor/use-list-view-drop-zone.js +1 -1
  612. package/src/components/provider/index.js +33 -14
  613. package/src/components/provider/index.native.js +4 -3
  614. package/src/components/provider/test/experimental-provider.js +94 -0
  615. package/src/components/provider/test/use-block-sync.js +10 -0
  616. package/src/components/responsive-block-control/test/index.js +1 -5
  617. package/src/components/rich-text/use-before-input-rules.js +10 -2
  618. package/src/components/rich-text/utils.js +1 -1
  619. package/src/components/spacing-sizes-control/utils.js +2 -7
  620. package/src/components/tool-selector/index.js +1 -1
  621. package/src/components/url-input/test/button.js +24 -24
  622. package/src/components/url-popover/image-url-input-ui.js +7 -8
  623. package/src/components/url-popover/style.scss +0 -10
  624. package/src/components/use-block-display-information/index.js +1 -1
  625. package/src/components/warning/{style.scss → content.scss} +0 -0
  626. package/src/components/warning/test/index.js +1 -5
  627. package/src/content.scss +7 -0
  628. package/src/experiments.js +27 -0
  629. package/src/experiments.native.js +25 -0
  630. package/src/hooks/anchor.js +2 -1
  631. package/src/hooks/border.js +1 -1
  632. package/src/hooks/child-layout.js +6 -1
  633. package/src/hooks/color-panel.js +1 -1
  634. package/src/hooks/color.js +3 -3
  635. package/src/hooks/custom-class-name.js +2 -1
  636. package/src/hooks/dimensions.js +6 -6
  637. package/src/hooks/layout.scss +4 -0
  638. package/src/hooks/margin.js +1 -0
  639. package/src/hooks/padding.js +1 -0
  640. package/src/hooks/position.js +56 -36
  641. package/src/hooks/test/align.native.js +1 -1
  642. package/src/hooks/test/utils.js +104 -0
  643. package/src/hooks/typography.js +1 -1
  644. package/src/hooks/use-color-props.js +3 -3
  645. package/src/hooks/utils.js +68 -2
  646. package/src/index.js +1 -0
  647. package/src/layouts/constrained.js +3 -0
  648. package/src/layouts/flex.js +66 -14
  649. package/src/layouts/flow.js +0 -9
  650. package/src/store/actions.js +2 -26
  651. package/src/store/defaults.js +7 -2
  652. package/src/store/index.js +8 -2
  653. package/src/store/private-actions.js +65 -0
  654. package/src/store/private-selectors.js +20 -0
  655. package/src/store/reducer.js +1 -1
  656. package/src/store/selectors.js +103 -62
  657. package/src/store/test/actions.js +0 -18
  658. package/src/store/test/private-actions.js +22 -0
  659. package/src/store/test/private-selectors.js +52 -0
  660. package/src/store/test/selectors.js +52 -54
  661. package/src/style.scss +3 -5
  662. package/src/utils/block-variation-transforms.js +1 -1
  663. package/src/utils/parse-css-unit-to-px.js +3 -1
  664. package/src/utils/test/parse-css-unit-to-px.js +16 -24
  665. package/src/utils/transform-styles/index.js +1 -6
  666. package/build/components/inner-blocks/get-block-context.js +0 -45
  667. package/build/components/inner-blocks/get-block-context.js.map +0 -1
  668. package/build/components/off-canvas-editor/block-edit-button.js +0 -50
  669. package/build/components/off-canvas-editor/block-edit-button.js.map +0 -1
  670. package/build-module/components/inner-blocks/get-block-context.js +0 -37
  671. package/build-module/components/inner-blocks/get-block-context.js.map +0 -1
  672. package/build-module/components/off-canvas-editor/block-edit-button.js +0 -35
  673. package/build-module/components/off-canvas-editor/block-edit-button.js.map +0 -1
  674. package/src/components/inner-blocks/get-block-context.js +0 -39
  675. package/src/components/off-canvas-editor/block-edit-button.js +0 -27
@@ -28,7 +28,7 @@ var _useNestedSettingsUpdate = _interopRequireDefault(require("./use-nested-sett
28
28
 
29
29
  var _useInnerBlockTemplateSync = _interopRequireDefault(require("./use-inner-block-template-sync"));
30
30
 
31
- var _getBlockContext = _interopRequireDefault(require("./get-block-context"));
31
+ var _useBlockContext = _interopRequireDefault(require("./use-block-context"));
32
32
 
33
33
  var _blockList = require("../block-list");
34
34
 
@@ -42,6 +42,8 @@ var _store = require("../../store");
42
42
 
43
43
  var _useBlockDropZone = _interopRequireDefault(require("../use-block-drop-zone"));
44
44
 
45
+ var _useSetting = _interopRequireDefault(require("../use-setting"));
46
+
45
47
  /**
46
48
  * External dependencies
47
49
  */
@@ -53,7 +55,7 @@ var _useBlockDropZone = _interopRequireDefault(require("../use-block-drop-zone")
53
55
  /**
54
56
  * Internal dependencies
55
57
  */
56
-
58
+ const EMPTY_OBJECT = {};
57
59
  /**
58
60
  * InnerBlocks is a component which allows a single block to have multiple blocks
59
61
  * as children. The UncontrolledInnerBlocks component is used whenever the inner
@@ -62,6 +64,7 @@ var _useBlockDropZone = _interopRequireDefault(require("../use-block-drop-zone")
62
64
  *
63
65
  * @param {Object} props The component props.
64
66
  */
67
+
65
68
  function UncontrolledInnerBlocks(props) {
66
69
  const {
67
70
  clientId,
@@ -77,44 +80,29 @@ function UncontrolledInnerBlocks(props) {
77
80
  renderAppender,
78
81
  orientation,
79
82
  placeholder,
80
- __experimentalLayout
83
+ layout
81
84
  } = props;
82
- (0, _useNestedSettingsUpdate.default)(clientId, allowedBlocks, __experimentalDefaultBlock, __experimentalDirectInsert, templateLock, captureToolbars, orientation, __experimentalLayout);
85
+ (0, _useNestedSettingsUpdate.default)(clientId, allowedBlocks, __experimentalDefaultBlock, __experimentalDirectInsert, templateLock, captureToolbars, orientation, layout);
83
86
  (0, _useInnerBlockTemplateSync.default)(clientId, template, templateLock, templateInsertUpdatesSelection);
84
- const {
85
- context,
86
- name
87
- } = (0, _data.useSelect)(select => {
88
- var _blockType$providesCo;
89
-
90
- const block = select(_store.store).getBlock(clientId); // This check is here to avoid the Redux zombie bug where a child subscription
91
- // is called before a parent, causing potential JS errors when the child has been removed.
92
-
93
- if (!block) {
94
- return {};
95
- }
87
+ const context = (0, _useBlockContext.default)(clientId);
88
+ const name = (0, _data.useSelect)(select => {
89
+ var _select$getBlock;
96
90
 
97
- const blockType = (0, _blocks.getBlockType)(block.name);
98
-
99
- if (Object.keys((_blockType$providesCo = blockType === null || blockType === void 0 ? void 0 : blockType.providesContext) !== null && _blockType$providesCo !== void 0 ? _blockType$providesCo : {}).length === 0) {
100
- return {
101
- name: block.name
102
- };
103
- }
104
-
105
- return {
106
- context: (0, _getBlockContext.default)(block.attributes, blockType),
107
- name: block.name
108
- };
91
+ return (_select$getBlock = select(_store.store).getBlock(clientId)) === null || _select$getBlock === void 0 ? void 0 : _select$getBlock.name;
109
92
  }, [clientId]);
93
+ const defaultLayoutBlockSupport = (0, _blocks.getBlockSupport)(name, '__experimentalLayout') || EMPTY_OBJECT;
110
94
  const {
111
95
  allowSizingOnChildren = false
112
- } = (0, _blocks.getBlockSupport)(name, '__experimentalLayout') || {};
113
- const layout = (0, _element.useMemo)(() => ({ ...__experimentalLayout,
96
+ } = defaultLayoutBlockSupport;
97
+ const defaultLayout = (0, _useSetting.default)('layout') || EMPTY_OBJECT;
98
+ const usedLayout = layout || defaultLayoutBlockSupport;
99
+ const memoedLayout = (0, _element.useMemo)(() => ({ // Default layout will know about any content/wide size defined by the theme.
100
+ ...defaultLayout,
101
+ ...usedLayout,
114
102
  ...(allowSizingOnChildren && {
115
103
  allowSizingOnChildren: true
116
104
  })
117
- }), [__experimentalLayout, allowSizingOnChildren]); // This component needs to always be synchronous as it's the one changing
105
+ }), [defaultLayout, usedLayout, allowSizingOnChildren]); // This component needs to always be synchronous as it's the one changing
118
106
  // the async mode depending on the block selection.
119
107
 
120
108
  return (0, _element.createElement)(_blockContext.BlockContextProvider, {
@@ -123,7 +111,7 @@ function UncontrolledInnerBlocks(props) {
123
111
  rootClientId: clientId,
124
112
  renderAppender: renderAppender,
125
113
  __experimentalAppenderTagName: __experimentalAppenderTagName,
126
- __experimentalLayout: layout,
114
+ __experimentalLayout: memoedLayout,
127
115
  wrapperRef: wrapperRef,
128
116
  placeholder: placeholder
129
117
  }));
@@ -177,6 +165,7 @@ function useInnerBlocksProps() {
177
165
  } = options;
178
166
  const {
179
167
  clientId,
168
+ layout = null,
180
169
  __unstableLayoutClassNames: layoutClassNames = ''
181
170
  } = (0, _context.useBlockEditContext)();
182
171
  const isSmallScreen = (0, _compose.useViewportMatch)('medium', '<');
@@ -207,6 +196,7 @@ function useInnerBlocksProps() {
207
196
  const ref = (0, _compose.useMergeRefs)([props.ref, __unstableDisableDropZone ? null : blockDropZoneRef]);
208
197
  const innerBlocksProps = {
209
198
  __experimentalCaptureToolbars,
199
+ layout,
210
200
  ...options
211
201
  };
212
202
  const InnerBlocks = innerBlocksProps.value && innerBlocksProps.onChange ? ControlledInnerBlocks : UncontrolledInnerBlocks;
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/inner-blocks/index.js"],"names":["UncontrolledInnerBlocks","props","clientId","allowedBlocks","__experimentalDefaultBlock","__experimentalDirectInsert","template","templateLock","wrapperRef","templateInsertUpdatesSelection","__experimentalCaptureToolbars","captureToolbars","__experimentalAppenderTagName","renderAppender","orientation","placeholder","__experimentalLayout","context","name","select","block","blockEditorStore","getBlock","blockType","Object","keys","providesContext","length","attributes","allowSizingOnChildren","layout","ControlledInnerBlocks","ForwardedInnerBlocks","ref","innerBlocksProps","useInnerBlocksProps","options","__unstableDisableLayoutClassNames","__unstableDisableDropZone","__unstableLayoutClassNames","layoutClassNames","isSmallScreen","hasOverlay","getBlockName","isBlockSelected","hasSelectedInnerBlock","__unstableGetEditorMode","blockName","enableClickThrough","blocksStore","hasBlockSupport","blockDropZoneRef","rootClientId","InnerBlocks","value","onChange","className","children","save","getInnerBlocksProps","DefaultBlockAppender","ButtonBlockAppender","Content"],"mappings":";;;;;;;;;;AASA;;;;AANA;;AAKA;;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c,CACzBhC,KAAK,CAACgC,GADmB,EAEzBK,yBAAyB,GAAG,IAAH,GAAUa,gBAFV,CAAd,CAAZ;AAKA,QAAMjB,gBAAgB,GAAG;AACxBxB,IAAAA,6BADwB;AAExB,OAAG0B;AAFqB,GAAzB;AAIA,QAAMiB,WAAW,GAChBnB,gBAAgB,CAACoB,KAAjB,IAA0BpB,gBAAgB,CAACqB,QAA3C,GACGxB,qBADH,GAEG/B,uBAHJ;AAKA,SAAO,EACN,GAAGC,KADG;AAENgC,IAAAA,GAFM;AAGNuB,IAAAA,SAAS,EAAE,yBACVvD,KAAK,CAACuD,SADI,EAEV,iCAFU,EAGVnB,iCAAiC,GAAG,EAAH,GAAQG,gBAH/B,EAIV;AACC,qBAAeE;AADhB,KAJU,CAHL;AAWNe,IAAAA,QAAQ,EAAEvD,QAAQ,GACjB,4BAAC,WAAD,6BAAkBgC,gBAAlB;AAAqC,MAAA,QAAQ,EAAGhC;AAAhD,OADiB,GAGjB,4BAAC,yBAAD,EAAqBkC,OAArB;AAdK,GAAP;AAiBA;;AAEDD,mBAAmB,CAACuB,IAApB,GAA2BC,qCAA3B,C,CAEA;;AACA3B,oBAAoB,CAAC4B,oBAArB,GAA4CA,6BAA5C;AACA5B,oBAAoB,CAAC6B,mBAArB,GAA2CA,4BAA3C;;AAEA7B,oBAAoB,CAAC8B,OAArB,GAA+B,MAAM3B,mBAAmB,CAACuB,IAApB,GAA2BD,QAAhE;AAEA;AACA;AACA;;;eACezB,oB","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useViewportMatch, useMergeRefs } from '@wordpress/compose';\nimport { forwardRef, useMemo } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport {\n\tgetBlockSupport,\n\tgetBlockType,\n\tstore as blocksStore,\n\t__unstableGetInnerBlocksProps as getInnerBlocksProps,\n} from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport ButtonBlockAppender from './button-block-appender';\nimport DefaultBlockAppender from './default-block-appender';\nimport useNestedSettingsUpdate from './use-nested-settings-update';\nimport useInnerBlockTemplateSync from './use-inner-block-template-sync';\nimport getBlockContext from './get-block-context';\nimport { BlockListItems } from '../block-list';\nimport { BlockContextProvider } from '../block-context';\nimport { useBlockEditContext } from '../block-edit/context';\nimport useBlockSync from '../provider/use-block-sync';\nimport { store as blockEditorStore } from '../../store';\nimport useBlockDropZone from '../use-block-drop-zone';\n\n/**\n * InnerBlocks is a component which allows a single block to have multiple blocks\n * as children. The UncontrolledInnerBlocks component is used whenever the inner\n * blocks are not controlled by another entity. In other words, it is normally\n * used for inner blocks in the post editor\n *\n * @param {Object} props The component props.\n */\nfunction UncontrolledInnerBlocks( props ) {\n\tconst {\n\t\tclientId,\n\t\tallowedBlocks,\n\t\t__experimentalDefaultBlock,\n\t\t__experimentalDirectInsert,\n\t\ttemplate,\n\t\ttemplateLock,\n\t\twrapperRef,\n\t\ttemplateInsertUpdatesSelection,\n\t\t__experimentalCaptureToolbars: captureToolbars,\n\t\t__experimentalAppenderTagName,\n\t\trenderAppender,\n\t\torientation,\n\t\tplaceholder,\n\t\t__experimentalLayout,\n\t} = props;\n\n\tuseNestedSettingsUpdate(\n\t\tclientId,\n\t\tallowedBlocks,\n\t\t__experimentalDefaultBlock,\n\t\t__experimentalDirectInsert,\n\t\ttemplateLock,\n\t\tcaptureToolbars,\n\t\torientation,\n\t\t__experimentalLayout\n\t);\n\n\tuseInnerBlockTemplateSync(\n\t\tclientId,\n\t\ttemplate,\n\t\ttemplateLock,\n\t\ttemplateInsertUpdatesSelection\n\t);\n\n\tconst { context, name } = useSelect(\n\t\t( select ) => {\n\t\t\tconst block = select( blockEditorStore ).getBlock( clientId );\n\n\t\t\t// This check is here to avoid the Redux zombie bug where a child subscription\n\t\t\t// is called before a parent, causing potential JS errors when the child has been removed.\n\t\t\tif ( ! block ) {\n\t\t\t\treturn {};\n\t\t\t}\n\n\t\t\tconst blockType = getBlockType( block.name );\n\n\t\t\tif (\n\t\t\t\tObject.keys( blockType?.providesContext ?? {} ).length === 0\n\t\t\t) {\n\t\t\t\treturn { name: block.name };\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tcontext: getBlockContext( block.attributes, blockType ),\n\t\t\t\tname: block.name,\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\tconst { allowSizingOnChildren = false } =\n\t\tgetBlockSupport( name, '__experimentalLayout' ) || {};\n\n\tconst layout = useMemo(\n\t\t() => ( {\n\t\t\t...__experimentalLayout,\n\t\t\t...( allowSizingOnChildren && {\n\t\t\t\tallowSizingOnChildren: true,\n\t\t\t} ),\n\t\t} ),\n\t\t[ __experimentalLayout, allowSizingOnChildren ]\n\t);\n\n\t// This component needs to always be synchronous as it's the one changing\n\t// the async mode depending on the block selection.\n\treturn (\n\t\t<BlockContextProvider value={ context }>\n\t\t\t<BlockListItems\n\t\t\t\trootClientId={ clientId }\n\t\t\t\trenderAppender={ renderAppender }\n\t\t\t\t__experimentalAppenderTagName={ __experimentalAppenderTagName }\n\t\t\t\t__experimentalLayout={ layout }\n\t\t\t\twrapperRef={ wrapperRef }\n\t\t\t\tplaceholder={ placeholder }\n\t\t\t/>\n\t\t</BlockContextProvider>\n\t);\n}\n\n/**\n * The controlled inner blocks component wraps the uncontrolled inner blocks\n * component with the blockSync hook. This keeps the innerBlocks of the block in\n * the block-editor store in sync with the blocks of the controlling entity. An\n * example of an inner block controller is a template part block, which provides\n * its own blocks from the template part entity data source.\n *\n * @param {Object} props The component props.\n */\nfunction ControlledInnerBlocks( props ) {\n\tuseBlockSync( props );\n\treturn <UncontrolledInnerBlocks { ...props } />;\n}\n\nconst ForwardedInnerBlocks = forwardRef( ( props, ref ) => {\n\tconst innerBlocksProps = useInnerBlocksProps( { ref }, props );\n\treturn (\n\t\t<div className=\"block-editor-inner-blocks\">\n\t\t\t<div { ...innerBlocksProps } />\n\t\t</div>\n\t);\n} );\n\n/**\n * This hook is used to lightly mark an element as an inner blocks wrapper\n * element. Call this hook and pass the returned props to the element to mark as\n * an inner blocks wrapper, automatically rendering inner blocks as children. If\n * you define a ref for the element, it is important to pass the ref to this\n * hook, which the hook in turn will pass to the component through the props it\n * returns. Optionally, you can also pass any other props through this hook, and\n * they will be merged and returned.\n *\n * @param {Object} props Optional. Props to pass to the element. Must contain\n * the ref if one is defined.\n * @param {Object} options Optional. Inner blocks options.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/inner-blocks/README.md\n */\nexport function useInnerBlocksProps( props = {}, options = {} ) {\n\tconst { __unstableDisableLayoutClassNames, __unstableDisableDropZone } =\n\t\toptions;\n\tconst { clientId, __unstableLayoutClassNames: layoutClassNames = '' } =\n\t\tuseBlockEditContext();\n\tconst isSmallScreen = useViewportMatch( 'medium', '<' );\n\tconst { __experimentalCaptureToolbars, hasOverlay } = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! clientId ) {\n\t\t\t\treturn {};\n\t\t\t}\n\n\t\t\tconst {\n\t\t\t\tgetBlockName,\n\t\t\t\tisBlockSelected,\n\t\t\t\thasSelectedInnerBlock,\n\t\t\t\t__unstableGetEditorMode,\n\t\t\t} = select( blockEditorStore );\n\t\t\tconst blockName = getBlockName( clientId );\n\t\t\tconst enableClickThrough =\n\t\t\t\t__unstableGetEditorMode() === 'navigation' || isSmallScreen;\n\t\t\treturn {\n\t\t\t\t__experimentalCaptureToolbars: select(\n\t\t\t\t\tblocksStore\n\t\t\t\t).hasBlockSupport(\n\t\t\t\t\tblockName,\n\t\t\t\t\t'__experimentalExposeControlsToChildren',\n\t\t\t\t\tfalse\n\t\t\t\t),\n\t\t\t\thasOverlay:\n\t\t\t\t\tblockName !== 'core/template' &&\n\t\t\t\t\t! isBlockSelected( clientId ) &&\n\t\t\t\t\t! hasSelectedInnerBlock( clientId, true ) &&\n\t\t\t\t\tenableClickThrough,\n\t\t\t};\n\t\t},\n\t\t[ clientId, isSmallScreen ]\n\t);\n\n\tconst blockDropZoneRef = useBlockDropZone( {\n\t\trootClientId: clientId,\n\t} );\n\n\tconst ref = useMergeRefs( [\n\t\tprops.ref,\n\t\t__unstableDisableDropZone ? null : blockDropZoneRef,\n\t] );\n\n\tconst innerBlocksProps = {\n\t\t__experimentalCaptureToolbars,\n\t\t...options,\n\t};\n\tconst InnerBlocks =\n\t\tinnerBlocksProps.value && innerBlocksProps.onChange\n\t\t\t? ControlledInnerBlocks\n\t\t\t: UncontrolledInnerBlocks;\n\n\treturn {\n\t\t...props,\n\t\tref,\n\t\tclassName: classnames(\n\t\t\tprops.className,\n\t\t\t'block-editor-block-list__layout',\n\t\t\t__unstableDisableLayoutClassNames ? '' : layoutClassNames,\n\t\t\t{\n\t\t\t\t'has-overlay': hasOverlay,\n\t\t\t}\n\t\t),\n\t\tchildren: clientId ? (\n\t\t\t<InnerBlocks { ...innerBlocksProps } clientId={ clientId } />\n\t\t) : (\n\t\t\t<BlockListItems { ...options } />\n\t\t),\n\t};\n}\n\nuseInnerBlocksProps.save = getInnerBlocksProps;\n\n// Expose default appender placeholders as components.\nForwardedInnerBlocks.DefaultBlockAppender = DefaultBlockAppender;\nForwardedInnerBlocks.ButtonBlockAppender = ButtonBlockAppender;\n\nForwardedInnerBlocks.Content = () => useInnerBlocksProps.save().children;\n\n/**\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/inner-blocks/README.md\n */\nexport default ForwardedInnerBlocks;\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/inner-blocks/index.js"],"names":["EMPTY_OBJECT","UncontrolledInnerBlocks","props","clientId","allowedBlocks","__experimentalDefaultBlock","__experimentalDirectInsert","template","templateLock","wrapperRef","templateInsertUpdatesSelection","__experimentalCaptureToolbars","captureToolbars","__experimentalAppenderTagName","renderAppender","orientation","placeholder","layout","context","name","select","blockEditorStore","getBlock","defaultLayoutBlockSupport","allowSizingOnChildren","defaultLayout","usedLayout","memoedLayout","ControlledInnerBlocks","ForwardedInnerBlocks","ref","innerBlocksProps","useInnerBlocksProps","options","__unstableDisableLayoutClassNames","__unstableDisableDropZone","__unstableLayoutClassNames","layoutClassNames","isSmallScreen","hasOverlay","getBlockName","isBlockSelected","hasSelectedInnerBlock","__unstableGetEditorMode","blockName","enableClickThrough","blocksStore","hasBlockSupport","blockDropZoneRef","rootClientId","InnerBlocks","value","onChange","className","children","save","getInnerBlocksProps","DefaultBlockAppender","ButtonBlockAppender","Content"],"mappings":";;;;;;;;;;AASA;;;;AANA;;AAKA;;AAEA;;AACA;;AASA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AA/BA;AACA;AACA;;AAGA;AACA;AACA;;AAUA;AACA;AACA;AAcA,MAAMA,YAAY,GAAG,EAArB;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,SAASC,uBAAT,CAAkCC,KAAlC,EAA0C;AACzC,QAAM;AACLC,IAAAA,QADK;AAELC,IAAAA,aAFK;AAGLC,IAAAA,0BAHK;AAILC,IAAAA,0BAJK;AAKLC,IAAAA,QALK;AAMLC,IAAAA,YANK;AAOLC,IAAAA,UAPK;AAQLC,IAAAA,8BARK;AASLC,IAAAA,6BAA6B,EAAEC,eAT1B;AAULC,IAAAA,6BAVK;AAWLC,IAAAA,cAXK;AAYLC,IAAAA,WAZK;AAaLC,IAAAA,WAbK;AAcLC,IAAAA;AAdK,MAeFf,KAfJ;AAiBA,wCACCC,QADD,EAECC,aAFD,EAGCC,0BAHD,EAICC,0BAJD,EAKCE,YALD,EAMCI,eAND,EAOCG,WAPD,EAQCE,MARD;AAWA,0CACCd,QADD,EAECI,QAFD,EAGCC,YAHD,EAICE,8BAJD;AAOA,QAAMQ,OAAO,GAAG,8BAAiBf,QAAjB,CAAhB;AACA,QAAMgB,IAAI,GAAG,qBACVC,MAAF,IAAc;AAAA;;AACb,+BAAOA,MAAM,CAAEC,YAAF,CAAN,CAA2BC,QAA3B,CAAqCnB,QAArC,CAAP,qDAA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A,QAAMU,gBAAgB,GAAG,+BAAkB;AAC1CC,IAAAA,YAAY,EAAE9C;AAD4B,GAAlB,CAAzB;AAIA,QAAM2B,GAAG,GAAG,2BAAc,CACzB5B,KAAK,CAAC4B,GADmB,EAEzBK,yBAAyB,GAAG,IAAH,GAAUa,gBAFV,CAAd,CAAZ;AAKA,QAAMjB,gBAAgB,GAAG;AACxBpB,IAAAA,6BADwB;AAExBM,IAAAA,MAFwB;AAGxB,OAAGgB;AAHqB,GAAzB;AAKA,QAAMiB,WAAW,GAChBnB,gBAAgB,CAACoB,KAAjB,IAA0BpB,gBAAgB,CAACqB,QAA3C,GACGxB,qBADH,GAEG3B,uBAHJ;AAKA,SAAO,EACN,GAAGC,KADG;AAEN4B,IAAAA,GAFM;AAGNuB,IAAAA,SAAS,EAAE,yBACVnD,KAAK,CAACmD,SADI,EAEV,iCAFU,EAGVnB,iCAAiC,GAAG,EAAH,GAAQG,gBAH/B,EAIV;AACC,qBAAeE;AADhB,KAJU,CAHL;AAWNe,IAAAA,QAAQ,EAAEnD,QAAQ,GACjB,4BAAC,WAAD,6BAAkB4B,gBAAlB;AAAqC,MAAA,QAAQ,EAAG5B;AAAhD,OADiB,GAGjB,4BAAC,yBAAD,EAAqB8B,OAArB;AAdK,GAAP;AAiBA;;AAEDD,mBAAmB,CAACuB,IAApB,GAA2BC,qCAA3B,C,CAEA;;AACA3B,oBAAoB,CAAC4B,oBAArB,GAA4CA,6BAA5C;AACA5B,oBAAoB,CAAC6B,mBAArB,GAA2CA,4BAA3C;;AAEA7B,oBAAoB,CAAC8B,OAArB,GAA+B,MAAM3B,mBAAmB,CAACuB,IAApB,GAA2BD,QAAhE;AAEA;AACA;AACA;;;eACezB,oB","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useViewportMatch, useMergeRefs } from '@wordpress/compose';\nimport { forwardRef, useMemo } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport {\n\tgetBlockSupport,\n\tstore as blocksStore,\n\t__unstableGetInnerBlocksProps as getInnerBlocksProps,\n} from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport ButtonBlockAppender from './button-block-appender';\nimport DefaultBlockAppender from './default-block-appender';\nimport useNestedSettingsUpdate from './use-nested-settings-update';\nimport useInnerBlockTemplateSync from './use-inner-block-template-sync';\nimport useBlockContext from './use-block-context';\nimport { BlockListItems } from '../block-list';\nimport { BlockContextProvider } from '../block-context';\nimport { useBlockEditContext } from '../block-edit/context';\nimport useBlockSync from '../provider/use-block-sync';\nimport { store as blockEditorStore } from '../../store';\nimport useBlockDropZone from '../use-block-drop-zone';\nimport useSetting from '../use-setting';\n\nconst EMPTY_OBJECT = {};\n\n/**\n * InnerBlocks is a component which allows a single block to have multiple blocks\n * as children. The UncontrolledInnerBlocks component is used whenever the inner\n * blocks are not controlled by another entity. In other words, it is normally\n * used for inner blocks in the post editor\n *\n * @param {Object} props The component props.\n */\nfunction UncontrolledInnerBlocks( props ) {\n\tconst {\n\t\tclientId,\n\t\tallowedBlocks,\n\t\t__experimentalDefaultBlock,\n\t\t__experimentalDirectInsert,\n\t\ttemplate,\n\t\ttemplateLock,\n\t\twrapperRef,\n\t\ttemplateInsertUpdatesSelection,\n\t\t__experimentalCaptureToolbars: captureToolbars,\n\t\t__experimentalAppenderTagName,\n\t\trenderAppender,\n\t\torientation,\n\t\tplaceholder,\n\t\tlayout,\n\t} = props;\n\n\tuseNestedSettingsUpdate(\n\t\tclientId,\n\t\tallowedBlocks,\n\t\t__experimentalDefaultBlock,\n\t\t__experimentalDirectInsert,\n\t\ttemplateLock,\n\t\tcaptureToolbars,\n\t\torientation,\n\t\tlayout\n\t);\n\n\tuseInnerBlockTemplateSync(\n\t\tclientId,\n\t\ttemplate,\n\t\ttemplateLock,\n\t\ttemplateInsertUpdatesSelection\n\t);\n\n\tconst context = useBlockContext( clientId );\n\tconst name = useSelect(\n\t\t( select ) => {\n\t\t\treturn select( blockEditorStore ).getBlock( clientId )?.name;\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\tconst defaultLayoutBlockSupport =\n\t\tgetBlockSupport( name, '__experimentalLayout' ) || EMPTY_OBJECT;\n\n\tconst { allowSizingOnChildren = false } = defaultLayoutBlockSupport;\n\n\tconst defaultLayout = useSetting( 'layout' ) || EMPTY_OBJECT;\n\n\tconst usedLayout = layout || defaultLayoutBlockSupport;\n\n\tconst memoedLayout = useMemo(\n\t\t() => ( {\n\t\t\t// Default layout will know about any content/wide size defined by the theme.\n\t\t\t...defaultLayout,\n\t\t\t...usedLayout,\n\t\t\t...( allowSizingOnChildren && {\n\t\t\t\tallowSizingOnChildren: true,\n\t\t\t} ),\n\t\t} ),\n\t\t[ defaultLayout, usedLayout, allowSizingOnChildren ]\n\t);\n\n\t// This component needs to always be synchronous as it's the one changing\n\t// the async mode depending on the block selection.\n\treturn (\n\t\t<BlockContextProvider value={ context }>\n\t\t\t<BlockListItems\n\t\t\t\trootClientId={ clientId }\n\t\t\t\trenderAppender={ renderAppender }\n\t\t\t\t__experimentalAppenderTagName={ __experimentalAppenderTagName }\n\t\t\t\t__experimentalLayout={ memoedLayout }\n\t\t\t\twrapperRef={ wrapperRef }\n\t\t\t\tplaceholder={ placeholder }\n\t\t\t/>\n\t\t</BlockContextProvider>\n\t);\n}\n\n/**\n * The controlled inner blocks component wraps the uncontrolled inner blocks\n * component with the blockSync hook. This keeps the innerBlocks of the block in\n * the block-editor store in sync with the blocks of the controlling entity. An\n * example of an inner block controller is a template part block, which provides\n * its own blocks from the template part entity data source.\n *\n * @param {Object} props The component props.\n */\nfunction ControlledInnerBlocks( props ) {\n\tuseBlockSync( props );\n\treturn <UncontrolledInnerBlocks { ...props } />;\n}\n\nconst ForwardedInnerBlocks = forwardRef( ( props, ref ) => {\n\tconst innerBlocksProps = useInnerBlocksProps( { ref }, props );\n\treturn (\n\t\t<div className=\"block-editor-inner-blocks\">\n\t\t\t<div { ...innerBlocksProps } />\n\t\t</div>\n\t);\n} );\n\n/**\n * This hook is used to lightly mark an element as an inner blocks wrapper\n * element. Call this hook and pass the returned props to the element to mark as\n * an inner blocks wrapper, automatically rendering inner blocks as children. If\n * you define a ref for the element, it is important to pass the ref to this\n * hook, which the hook in turn will pass to the component through the props it\n * returns. Optionally, you can also pass any other props through this hook, and\n * they will be merged and returned.\n *\n * @param {Object} props Optional. Props to pass to the element. Must contain\n * the ref if one is defined.\n * @param {Object} options Optional. Inner blocks options.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/inner-blocks/README.md\n */\nexport function useInnerBlocksProps( props = {}, options = {} ) {\n\tconst { __unstableDisableLayoutClassNames, __unstableDisableDropZone } =\n\t\toptions;\n\tconst {\n\t\tclientId,\n\t\tlayout = null,\n\t\t__unstableLayoutClassNames: layoutClassNames = '',\n\t} = useBlockEditContext();\n\tconst isSmallScreen = useViewportMatch( 'medium', '<' );\n\tconst { __experimentalCaptureToolbars, hasOverlay } = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! clientId ) {\n\t\t\t\treturn {};\n\t\t\t}\n\n\t\t\tconst {\n\t\t\t\tgetBlockName,\n\t\t\t\tisBlockSelected,\n\t\t\t\thasSelectedInnerBlock,\n\t\t\t\t__unstableGetEditorMode,\n\t\t\t} = select( blockEditorStore );\n\t\t\tconst blockName = getBlockName( clientId );\n\t\t\tconst enableClickThrough =\n\t\t\t\t__unstableGetEditorMode() === 'navigation' || isSmallScreen;\n\t\t\treturn {\n\t\t\t\t__experimentalCaptureToolbars: select(\n\t\t\t\t\tblocksStore\n\t\t\t\t).hasBlockSupport(\n\t\t\t\t\tblockName,\n\t\t\t\t\t'__experimentalExposeControlsToChildren',\n\t\t\t\t\tfalse\n\t\t\t\t),\n\t\t\t\thasOverlay:\n\t\t\t\t\tblockName !== 'core/template' &&\n\t\t\t\t\t! isBlockSelected( clientId ) &&\n\t\t\t\t\t! hasSelectedInnerBlock( clientId, true ) &&\n\t\t\t\t\tenableClickThrough,\n\t\t\t};\n\t\t},\n\t\t[ clientId, isSmallScreen ]\n\t);\n\n\tconst blockDropZoneRef = useBlockDropZone( {\n\t\trootClientId: clientId,\n\t} );\n\n\tconst ref = useMergeRefs( [\n\t\tprops.ref,\n\t\t__unstableDisableDropZone ? null : blockDropZoneRef,\n\t] );\n\n\tconst innerBlocksProps = {\n\t\t__experimentalCaptureToolbars,\n\t\tlayout,\n\t\t...options,\n\t};\n\tconst InnerBlocks =\n\t\tinnerBlocksProps.value && innerBlocksProps.onChange\n\t\t\t? ControlledInnerBlocks\n\t\t\t: UncontrolledInnerBlocks;\n\n\treturn {\n\t\t...props,\n\t\tref,\n\t\tclassName: classnames(\n\t\t\tprops.className,\n\t\t\t'block-editor-block-list__layout',\n\t\t\t__unstableDisableLayoutClassNames ? '' : layoutClassNames,\n\t\t\t{\n\t\t\t\t'has-overlay': hasOverlay,\n\t\t\t}\n\t\t),\n\t\tchildren: clientId ? (\n\t\t\t<InnerBlocks { ...innerBlocksProps } clientId={ clientId } />\n\t\t) : (\n\t\t\t<BlockListItems { ...options } />\n\t\t),\n\t};\n}\n\nuseInnerBlocksProps.save = getInnerBlocksProps;\n\n// Expose default appender placeholders as components.\nForwardedInnerBlocks.DefaultBlockAppender = DefaultBlockAppender;\nForwardedInnerBlocks.ButtonBlockAppender = ButtonBlockAppender;\n\nForwardedInnerBlocks.Content = () => useInnerBlocksProps.save().children;\n\n/**\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/inner-blocks/README.md\n */\nexport default ForwardedInnerBlocks;\n"]}
@@ -12,8 +12,6 @@ var _element = require("@wordpress/element");
12
12
 
13
13
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
14
14
 
15
- var _data = require("@wordpress/data");
16
-
17
15
  var _blocks = require("@wordpress/blocks");
18
16
 
19
17
  var _buttonBlockAppender = _interopRequireDefault(require("./button-block-appender"));
@@ -24,7 +22,7 @@ var _useNestedSettingsUpdate = _interopRequireDefault(require("./use-nested-sett
24
22
 
25
23
  var _useInnerBlockTemplateSync = _interopRequireDefault(require("./use-inner-block-template-sync"));
26
24
 
27
- var _getBlockContext = _interopRequireDefault(require("./get-block-context"));
25
+ var _useBlockContext = _interopRequireDefault(require("./use-block-context"));
28
26
 
29
27
  var _blockList = _interopRequireDefault(require("../block-list"));
30
28
 
@@ -38,8 +36,6 @@ var _blockContext = require("../block-context");
38
36
 
39
37
  var _layout = require("../block-list/layout");
40
38
 
41
- var _store = require("../../store");
42
-
43
39
  /**
44
40
  * WordPress dependencies
45
41
  */
@@ -119,13 +115,15 @@ function UncontrolledInnerBlocks(props) {
119
115
  gridProperties,
120
116
  useCompactList
121
117
  } = props;
122
- const block = (0, _data.useSelect)(select => select(_store.store).getBlock(clientId), [clientId]) || {
123
- innerBlocks: []
124
- };
118
+ const context = (0, _useBlockContext.default)(clientId);
125
119
  (0, _useNestedSettingsUpdate.default)(clientId, allowedBlocks, templateLock);
126
120
  (0, _useInnerBlockTemplateSync.default)(clientId, template, templateLock, templateInsertUpdatesSelection);
127
121
  const BlockListComponent = useCompactList ? _blockListCompact.default : _blockList.default;
128
- let blockList = (0, _element.createElement)(BlockListComponent, {
122
+ return (0, _element.createElement)(_layout.LayoutProvider, {
123
+ value: layout
124
+ }, (0, _element.createElement)(_blockContext.BlockContextProvider, {
125
+ value: context
126
+ }, (0, _element.createElement)(BlockListComponent, {
129
127
  marginVertical: marginVertical,
130
128
  marginHorizontal: marginHorizontal,
131
129
  rootClientId: clientId,
@@ -143,20 +141,7 @@ function UncontrolledInnerBlocks(props) {
143
141
  filterInnerBlocks: filterInnerBlocks,
144
142
  gridProperties: gridProperties,
145
143
  blockWidth: blockWidth
146
- }); // Wrap context provider if (and only if) block has context to provide.
147
-
148
- const blockType = (0, _blocks.getBlockType)(block.name);
149
-
150
- if (blockType && blockType.providesContext) {
151
- const context = (0, _getBlockContext.default)(block.attributes, blockType);
152
- blockList = (0, _element.createElement)(_layout.LayoutProvider, {
153
- value: layout
154
- }, (0, _element.createElement)(_blockContext.BlockContextProvider, {
155
- value: context
156
- }, blockList));
157
- }
158
-
159
- return blockList;
144
+ })));
160
145
  }
161
146
  /**
162
147
  * The controlled inner blocks component wraps the uncontrolled inner blocks
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/inner-blocks/index.native.js"],"names":["useInnerBlocksProps","props","options","fallbackRef","clientId","ref","InnerBlocks","value","onChange","ControlledInnerBlocks","UncontrolledInnerBlocks","children","allowedBlocks","template","templateLock","templateInsertUpdatesSelection","orientation","renderAppender","renderFooterAppender","parentWidth","horizontal","contentResizeMode","contentStyle","onAddBlock","onDeleteBlock","marginVertical","marginHorizontal","horizontalAlignment","filterInnerBlocks","blockWidth","__experimentalLayout","layout","defaultLayout","gridProperties","useCompactList","block","select","blockEditorStore","getBlock","innerBlocks","BlockListComponent","BlockListCompact","BlockList","blockList","blockType","name","providesContext","context","attributes","allProps","DefaultBlockAppender","ButtonBlockAppender","save","getInnerBlocksProps","Content"],"mappings":";;;;;;;;;;AAQA;;;;AALA;;AACA;;AASA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AA5BA;AACA;AACA;;AAQA;AACA;AACA;;AAOA;AACA;AACA;;AASA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,mBAAT,GAAyD;AAAA,MAA3BC,KAA2B,uEAAnB,EAAmB;AAAA,MAAfC,OAAe,uEAAL,EAAK;AAC/D,QAAMC,WAAW,GAAG,sBAApB;AACA,QAAM;AAAEC,IAAAA;AAAF,MAAe,mCAArB;AAEA,QAAMC,GAAG,GAAGJ,KAAK,CAACI,GAAN,IAAaF,WAAzB;AACA,QAAMG,WAAW,GAChBJ,OAAO,CAACK,KAAR,IAAiBL,OAAO,CAACM,QAAzB,GACGC,qBADH,GAEGC,uBAHJ;AAKA,SAAO,EACN,GAAGT,KADG;AAENI,IAA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HgC,CAQhC;;AACA,SAAOA,KAAK,CAACM,KAAN,IAAeN,KAAK,CAACO,QAArB,GACN,4BAAC,qBAAD,EAA4ByC,QAA5B,CADM,GAGN,4BAAC,uBAAD,EAA8BA,QAA9B,CAHD;AAKA,CAdD,C,CAgBA;;;AACA3C,WAAW,CAAC4C,oBAAZ,GAAmCA,6BAAnC;AACA5C,WAAW,CAAC6C,mBAAZ,GAAkCA,4BAAlC;AAEAnD,mBAAmB,CAACoD,IAApB,GAA2BC,qCAA3B;;AAEA/C,WAAW,CAACgD,OAAZ,GAAsB,MAAMtD,mBAAmB,CAACoD,IAApB,GAA2BzC,QAAvD;AAEA;AACA;AACA;;;eACeL,W","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport {\n\tgetBlockType,\n\t__unstableGetInnerBlocksProps as getInnerBlocksProps,\n} from '@wordpress/blocks';\nimport { useRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport ButtonBlockAppender from './button-block-appender';\nimport DefaultBlockAppender from './default-block-appender';\nimport useNestedSettingsUpdate from './use-nested-settings-update';\nimport useInnerBlockTemplateSync from './use-inner-block-template-sync';\nimport getBlockContext from './get-block-context';\n\n/**\n * Internal dependencies\n */\nimport BlockList from '../block-list';\nimport BlockListCompact from '../block-list/block-list-compact';\nimport { useBlockEditContext } from '../block-edit/context';\nimport useBlockSync from '../provider/use-block-sync';\nimport { BlockContextProvider } from '../block-context';\nimport { defaultLayout, LayoutProvider } from '../block-list/layout';\nimport { store as blockEditorStore } from '../../store';\n\n/**\n * This hook is used to lightly mark an element as an inner blocks wrapper\n * element. Call this hook and pass the returned props to the element to mark as\n * an inner blocks wrapper, automatically rendering inner blocks as children. If\n * you define a ref for the element, it is important to pass the ref to this\n * hook, which the hook in turn will pass to the component through the props it\n * returns. Optionally, you can also pass any other props through this hook, and\n * they will be merged and returned.\n *\n * @param {Object} props Optional. Props to pass to the element. Must contain\n * the ref if one is defined.\n * @param {Object} options Optional. Inner blocks options.\n *\n * @see https://github.com/WordPress/gutenberg/blob/master/packages/block-editor/src/components/inner-blocks/README.md\n */\nexport function useInnerBlocksProps( props = {}, options = {} ) {\n\tconst fallbackRef = useRef();\n\tconst { clientId } = useBlockEditContext();\n\n\tconst ref = props.ref || fallbackRef;\n\tconst InnerBlocks =\n\t\toptions.value && options.onChange\n\t\t\t? ControlledInnerBlocks\n\t\t\t: UncontrolledInnerBlocks;\n\n\treturn {\n\t\t...props,\n\t\tref,\n\t\tchildren: (\n\t\t\t<InnerBlocks\n\t\t\t\t{ ...options }\n\t\t\t\tclientId={ clientId }\n\t\t\t\twrapperRef={ ref }\n\t\t\t/>\n\t\t),\n\t};\n}\n\n/**\n * InnerBlocks is a component which allows a single block to have multiple blocks\n * as children. The UncontrolledInnerBlocks component is used whenever the inner\n * blocks are not controlled by another entity. In other words, it is normally\n * used for inner blocks in the post editor\n *\n * @param {Object} props The component props.\n */\nfunction UncontrolledInnerBlocks( props ) {\n\tconst {\n\t\tclientId,\n\t\tallowedBlocks,\n\t\ttemplate,\n\t\ttemplateLock,\n\t\ttemplateInsertUpdatesSelection,\n\t\torientation,\n\t\trenderAppender,\n\t\trenderFooterAppender,\n\t\tparentWidth,\n\t\thorizontal,\n\t\tcontentResizeMode,\n\t\tcontentStyle,\n\t\tonAddBlock,\n\t\tonDeleteBlock,\n\t\tmarginVertical,\n\t\tmarginHorizontal,\n\t\thorizontalAlignment,\n\t\tfilterInnerBlocks,\n\t\tblockWidth,\n\t\t__experimentalLayout: layout = defaultLayout,\n\t\tgridProperties,\n\t\tuseCompactList,\n\t} = props;\n\n\tconst block = useSelect(\n\t\t( select ) => select( blockEditorStore ).getBlock( clientId ),\n\t\t[ clientId ]\n\t) || { innerBlocks: [] };\n\n\tuseNestedSettingsUpdate( clientId, allowedBlocks, templateLock );\n\n\tuseInnerBlockTemplateSync(\n\t\tclientId,\n\t\ttemplate,\n\t\ttemplateLock,\n\t\ttemplateInsertUpdatesSelection\n\t);\n\n\tconst BlockListComponent = useCompactList ? BlockListCompact : BlockList;\n\n\tlet blockList = (\n\t\t<BlockListComponent\n\t\t\tmarginVertical={ marginVertical }\n\t\t\tmarginHorizontal={ marginHorizontal }\n\t\t\trootClientId={ clientId }\n\t\t\trenderAppender={ renderAppender }\n\t\t\trenderFooterAppender={ renderFooterAppender }\n\t\t\twithFooter={ false }\n\t\t\torientation={ orientation }\n\t\t\tparentWidth={ parentWidth }\n\t\t\thorizontalAlignment={ horizontalAlignment }\n\t\t\thorizontal={ horizontal }\n\t\t\tcontentResizeMode={ contentResizeMode }\n\t\t\tcontentStyle={ contentStyle }\n\t\t\tonAddBlock={ onAddBlock }\n\t\t\tonDeleteBlock={ onDeleteBlock }\n\t\t\tfilterInnerBlocks={ filterInnerBlocks }\n\t\t\tgridProperties={ gridProperties }\n\t\t\tblockWidth={ blockWidth }\n\t\t/>\n\t);\n\n\t// Wrap context provider if (and only if) block has context to provide.\n\tconst blockType = getBlockType( block.name );\n\tif ( blockType && blockType.providesContext ) {\n\t\tconst context = getBlockContext( block.attributes, blockType );\n\n\t\tblockList = (\n\t\t\t<LayoutProvider value={ layout }>\n\t\t\t\t<BlockContextProvider value={ context }>\n\t\t\t\t\t{ blockList }\n\t\t\t\t</BlockContextProvider>\n\t\t\t</LayoutProvider>\n\t\t);\n\t}\n\n\treturn blockList;\n}\n\n/**\n * The controlled inner blocks component wraps the uncontrolled inner blocks\n * component with the blockSync hook. This keeps the innerBlocks of the block in\n * the block-editor store in sync with the blocks of the controlling entity. An\n * example of an inner block controller is a template part block, which provides\n * its own blocks from the template part entity data source.\n *\n * @param {Object} props The component props.\n */\nfunction ControlledInnerBlocks( props ) {\n\tuseBlockSync( props );\n\treturn <UncontrolledInnerBlocks { ...props } />;\n}\n\n/**\n * Wrapped InnerBlocks component which detects whether to use the controlled or\n * uncontrolled variations of the InnerBlocks component. This is the component\n * which should be used throughout the application.\n *\n * @param {Object} props The component props.\n */\nconst InnerBlocks = ( props ) => {\n\tconst { clientId } = useBlockEditContext();\n\n\tconst allProps = {\n\t\tclientId,\n\t\t...props,\n\t};\n\n\t// Detects if the InnerBlocks should be controlled by an incoming value.\n\treturn props.value && props.onChange ? (\n\t\t<ControlledInnerBlocks { ...allProps } />\n\t) : (\n\t\t<UncontrolledInnerBlocks { ...allProps } />\n\t);\n};\n\n// Expose default appender placeholders as components.\nInnerBlocks.DefaultBlockAppender = DefaultBlockAppender;\nInnerBlocks.ButtonBlockAppender = ButtonBlockAppender;\n\nuseInnerBlocksProps.save = getInnerBlocksProps;\n\nInnerBlocks.Content = () => useInnerBlocksProps.save().children;\n\n/**\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/inner-blocks/README.md\n */\nexport default InnerBlocks;\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/inner-blocks/index.native.js"],"names":["useInnerBlocksProps","props","options","fallbackRef","clientId","ref","InnerBlocks","value","onChange","ControlledInnerBlocks","UncontrolledInnerBlocks","children","allowedBlocks","template","templateLock","templateInsertUpdatesSelection","orientation","renderAppender","renderFooterAppender","parentWidth","horizontal","contentResizeMode","contentStyle","onAddBlock","onDeleteBlock","marginVertical","marginHorizontal","horizontalAlignment","filterInnerBlocks","blockWidth","__experimentalLayout","layout","defaultLayout","gridProperties","useCompactList","context","BlockListComponent","BlockListCompact","BlockList","allProps","DefaultBlockAppender","ButtonBlockAppender","save","getInnerBlocksProps","Content"],"mappings":";;;;;;;;;;AAIA;;;;AADA;;AAMA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAvBA;AACA;AACA;;AAIA;AACA;AACA;;AAOA;AACA;AACA;;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,mBAAT,GAAyD;AAAA,MAA3BC,KAA2B,uEAAnB,EAAmB;AAAA,MAAfC,OAAe,uEAAL,EAAK;AAC/D,QAAMC,WAAW,GAAG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AdD,C,CAgBA;;;AACAjC,WAAW,CAACkC,oBAAZ,GAAmCA,6BAAnC;AACAlC,WAAW,CAACmC,mBAAZ,GAAkCA,4BAAlC;AAEAzC,mBAAmB,CAAC0C,IAApB,GAA2BC,qCAA3B;;AAEArC,WAAW,CAACsC,OAAZ,GAAsB,MAAM5C,mBAAmB,CAAC0C,IAApB,GAA2B/B,QAAvD;AAEA;AACA;AACA;;;eACeL,W","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __unstableGetInnerBlocksProps as getInnerBlocksProps } from '@wordpress/blocks';\nimport { useRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport ButtonBlockAppender from './button-block-appender';\nimport DefaultBlockAppender from './default-block-appender';\nimport useNestedSettingsUpdate from './use-nested-settings-update';\nimport useInnerBlockTemplateSync from './use-inner-block-template-sync';\nimport useBlockContext from './use-block-context';\n\n/**\n * Internal dependencies\n */\nimport BlockList from '../block-list';\nimport BlockListCompact from '../block-list/block-list-compact';\nimport { useBlockEditContext } from '../block-edit/context';\nimport useBlockSync from '../provider/use-block-sync';\nimport { BlockContextProvider } from '../block-context';\nimport { defaultLayout, LayoutProvider } from '../block-list/layout';\n\n/**\n * This hook is used to lightly mark an element as an inner blocks wrapper\n * element. Call this hook and pass the returned props to the element to mark as\n * an inner blocks wrapper, automatically rendering inner blocks as children. If\n * you define a ref for the element, it is important to pass the ref to this\n * hook, which the hook in turn will pass to the component through the props it\n * returns. Optionally, you can also pass any other props through this hook, and\n * they will be merged and returned.\n *\n * @param {Object} props Optional. Props to pass to the element. Must contain\n * the ref if one is defined.\n * @param {Object} options Optional. Inner blocks options.\n *\n * @see https://github.com/WordPress/gutenberg/blob/master/packages/block-editor/src/components/inner-blocks/README.md\n */\nexport function useInnerBlocksProps( props = {}, options = {} ) {\n\tconst fallbackRef = useRef();\n\tconst { clientId } = useBlockEditContext();\n\n\tconst ref = props.ref || fallbackRef;\n\tconst InnerBlocks =\n\t\toptions.value && options.onChange\n\t\t\t? ControlledInnerBlocks\n\t\t\t: UncontrolledInnerBlocks;\n\n\treturn {\n\t\t...props,\n\t\tref,\n\t\tchildren: (\n\t\t\t<InnerBlocks\n\t\t\t\t{ ...options }\n\t\t\t\tclientId={ clientId }\n\t\t\t\twrapperRef={ ref }\n\t\t\t/>\n\t\t),\n\t};\n}\n\n/**\n * InnerBlocks is a component which allows a single block to have multiple blocks\n * as children. The UncontrolledInnerBlocks component is used whenever the inner\n * blocks are not controlled by another entity. In other words, it is normally\n * used for inner blocks in the post editor\n *\n * @param {Object} props The component props.\n */\nfunction UncontrolledInnerBlocks( props ) {\n\tconst {\n\t\tclientId,\n\t\tallowedBlocks,\n\t\ttemplate,\n\t\ttemplateLock,\n\t\ttemplateInsertUpdatesSelection,\n\t\torientation,\n\t\trenderAppender,\n\t\trenderFooterAppender,\n\t\tparentWidth,\n\t\thorizontal,\n\t\tcontentResizeMode,\n\t\tcontentStyle,\n\t\tonAddBlock,\n\t\tonDeleteBlock,\n\t\tmarginVertical,\n\t\tmarginHorizontal,\n\t\thorizontalAlignment,\n\t\tfilterInnerBlocks,\n\t\tblockWidth,\n\t\t__experimentalLayout: layout = defaultLayout,\n\t\tgridProperties,\n\t\tuseCompactList,\n\t} = props;\n\n\tconst context = useBlockContext( clientId );\n\n\tuseNestedSettingsUpdate( clientId, allowedBlocks, templateLock );\n\n\tuseInnerBlockTemplateSync(\n\t\tclientId,\n\t\ttemplate,\n\t\ttemplateLock,\n\t\ttemplateInsertUpdatesSelection\n\t);\n\n\tconst BlockListComponent = useCompactList ? BlockListCompact : BlockList;\n\n\treturn (\n\t\t<LayoutProvider value={ layout }>\n\t\t\t<BlockContextProvider value={ context }>\n\t\t\t\t<BlockListComponent\n\t\t\t\t\tmarginVertical={ marginVertical }\n\t\t\t\t\tmarginHorizontal={ marginHorizontal }\n\t\t\t\t\trootClientId={ clientId }\n\t\t\t\t\trenderAppender={ renderAppender }\n\t\t\t\t\trenderFooterAppender={ renderFooterAppender }\n\t\t\t\t\twithFooter={ false }\n\t\t\t\t\torientation={ orientation }\n\t\t\t\t\tparentWidth={ parentWidth }\n\t\t\t\t\thorizontalAlignment={ horizontalAlignment }\n\t\t\t\t\thorizontal={ horizontal }\n\t\t\t\t\tcontentResizeMode={ contentResizeMode }\n\t\t\t\t\tcontentStyle={ contentStyle }\n\t\t\t\t\tonAddBlock={ onAddBlock }\n\t\t\t\t\tonDeleteBlock={ onDeleteBlock }\n\t\t\t\t\tfilterInnerBlocks={ filterInnerBlocks }\n\t\t\t\t\tgridProperties={ gridProperties }\n\t\t\t\t\tblockWidth={ blockWidth }\n\t\t\t\t/>\n\t\t\t</BlockContextProvider>\n\t\t</LayoutProvider>\n\t);\n}\n\n/**\n * The controlled inner blocks component wraps the uncontrolled inner blocks\n * component with the blockSync hook. This keeps the innerBlocks of the block in\n * the block-editor store in sync with the blocks of the controlling entity. An\n * example of an inner block controller is a template part block, which provides\n * its own blocks from the template part entity data source.\n *\n * @param {Object} props The component props.\n */\nfunction ControlledInnerBlocks( props ) {\n\tuseBlockSync( props );\n\treturn <UncontrolledInnerBlocks { ...props } />;\n}\n\n/**\n * Wrapped InnerBlocks component which detects whether to use the controlled or\n * uncontrolled variations of the InnerBlocks component. This is the component\n * which should be used throughout the application.\n *\n * @param {Object} props The component props.\n */\nconst InnerBlocks = ( props ) => {\n\tconst { clientId } = useBlockEditContext();\n\n\tconst allProps = {\n\t\tclientId,\n\t\t...props,\n\t};\n\n\t// Detects if the InnerBlocks should be controlled by an incoming value.\n\treturn props.value && props.onChange ? (\n\t\t<ControlledInnerBlocks { ...allProps } />\n\t) : (\n\t\t<UncontrolledInnerBlocks { ...allProps } />\n\t);\n};\n\n// Expose default appender placeholders as components.\nInnerBlocks.DefaultBlockAppender = DefaultBlockAppender;\nInnerBlocks.ButtonBlockAppender = ButtonBlockAppender;\n\nuseInnerBlocksProps.save = getInnerBlocksProps;\n\nInnerBlocks.Content = () => useInnerBlocksProps.save().children;\n\n/**\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/inner-blocks/README.md\n */\nexport default InnerBlocks;\n"]}
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = useBlockContext;
7
+
8
+ var _blocks = require("@wordpress/blocks");
9
+
10
+ var _data = require("@wordpress/data");
11
+
12
+ var _store = require("../../store");
13
+
14
+ /**
15
+ * WordPress dependencies
16
+ */
17
+
18
+ /**
19
+ * Internal dependencies
20
+ */
21
+
22
+ /**
23
+ * Returns a context object for a given block.
24
+ *
25
+ * @param {string} clientId The block client ID.
26
+ *
27
+ * @return {Record<string,*>} Context value.
28
+ */
29
+ function useBlockContext(clientId) {
30
+ return (0, _data.useSelect)(select => {
31
+ const block = select(_store.store).getBlock(clientId);
32
+
33
+ if (!block) {
34
+ return undefined;
35
+ }
36
+
37
+ const blockType = select(_blocks.store).getBlockType(block.name);
38
+
39
+ if (!blockType) {
40
+ return undefined;
41
+ }
42
+
43
+ if (Object.keys(blockType.providesContext).length === 0) {
44
+ return undefined;
45
+ }
46
+
47
+ return Object.fromEntries(Object.entries(blockType.providesContext).map(_ref => {
48
+ let [contextName, attributeName] = _ref;
49
+ return [contextName, block.attributes[attributeName]];
50
+ }));
51
+ }, [clientId]);
52
+ }
53
+ //# sourceMappingURL=use-block-context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/inner-blocks/use-block-context.js"],"names":["useBlockContext","clientId","select","block","blockEditorStore","getBlock","undefined","blockType","blocksStore","getBlockType","name","Object","keys","providesContext","length","fromEntries","entries","map","contextName","attributeName","attributes"],"mappings":";;;;;;;AAGA;;AACA;;AAKA;;AATA;AACA;AACA;;AAIA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASA,eAAT,CAA0BC,QAA1B,EAAqC;AACnD,SAAO,qBACJC,MAAF,IAAc;AACb,UAAMC,KAAK,GAAGD,MAAM,CAAEE,YAAF,CAAN,CAA2BC,QAA3B,CAAqCJ,QAArC,CAAd;;AACA,QAAK,CAAEE,KAAP,EAAe;AACd,aAAOG,SAAP;AACA;;AAED,UAAMC,SAAS,GAAGL,MAAM,CAAEM,aAAF,CAAN,CAAsBC,YAAtB,CAAoCN,KAAK,CAACO,IAA1C,CAAlB;;AACA,QAAK,CAAEH,SAAP,EAAmB;AAClB,aAAOD,SAAP;AACA;;AAED,QAAKK,MAAM,CAACC,IAAP,CAAaL,SAAS,CAACM,eAAvB,EAAyCC,MAAzC,KAAoD,CAAzD,EAA6D;AAC5D,aAAOR,SAAP;AACA;;AAED,WAAOK,MAAM,CAACI,WAAP,CACNJ,MAAM,CAACK,OAAP,CAAgBT,SAAS,CAACM,eAA1B,EAA4CI,GAA5C,CACC;AAAA,UAAE,CAAEC,WAAF,EAAeC,aAAf,CAAF;AAAA,aAAsC,CACrCD,WADqC,EAErCf,KAAK,CAACiB,UAAN,CAAkBD,aAAlB,CAFqC,CAAtC;AAAA,KADD,CADM,CAAP;AAQA,GAxBK,EAyBN,CAAElB,QAAF,CAzBM,CAAP;AA2BA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\n\n/**\n * Returns a context object for a given block.\n *\n * @param {string} clientId The block client ID.\n *\n * @return {Record<string,*>} Context value.\n */\nexport default function useBlockContext( clientId ) {\n\treturn useSelect(\n\t\t( select ) => {\n\t\t\tconst block = select( blockEditorStore ).getBlock( clientId );\n\t\t\tif ( ! block ) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tconst blockType = select( blocksStore ).getBlockType( block.name );\n\t\t\tif ( ! blockType ) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tif ( Object.keys( blockType.providesContext ).length === 0 ) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\treturn Object.fromEntries(\n\t\t\t\tObject.entries( blockType.providesContext ).map(\n\t\t\t\t\t( [ contextName, attributeName ] ) => [\n\t\t\t\t\t\tcontextName,\n\t\t\t\t\t\tblock.attributes[ attributeName ],\n\t\t\t\t\t]\n\t\t\t\t)\n\t\t\t);\n\t\t},\n\t\t[ clientId ]\n\t);\n}\n"]}
@@ -53,7 +53,6 @@ function PatternsExplorerModal(_ref2) {
53
53
  } = _ref2;
54
54
  return (0, _element.createElement)(_components.Modal, {
55
55
  title: (0, _i18n.__)('Patterns'),
56
- closeLabel: (0, _i18n.__)('Close'),
57
56
  onRequestClose: onModalClose,
58
57
  isFullScreen: true
59
58
  }, (0, _element.createElement)(PatternsExplorer, restProps));
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/inserter/block-patterns-explorer/explorer.js"],"names":["PatternsExplorer","initialCategory","patternCategories","filterValue","setFilterValue","selectedCategory","setSelectedCategory","name","PatternsExplorerModal","onModalClose","restProps"],"mappings":";;;;;;;;;AAIA;;AADA;;AAEA;;AAKA;;AACA;;AAXA;AACA;AACA;;AAKA;AACA;AACA;AAIA,SAASA,gBAAT,OAAoE;AAAA,MAAzC;AAAEC,IAAAA,eAAF;AAAmBC,IAAAA;AAAnB,GAAyC;AACnE,QAAM,CAAEC,WAAF,EAAeC,cAAf,IAAkC,uBAAU,EAAV,CAAxC;AACA,QAAM,CAAEC,gBAAF,EAAoBC,mBAApB,IAA4C,uBACjDL,eADiD,aACjDA,eADiD,uBACjDA,eAAe,CAAEM,IADgC,CAAlD;AAGA,SACC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,4BAAC,gBAAD;AACC,IAAA,gBAAgB,EAAGF,gBADpB;AAEC,IAAA,iBAAiB,EAAGH,iBAFrB;AAGC,IAAA,eAAe,EAAGI,mBAHnB;AAIC,IAAA,WAAW,EAAGH,WAJf;AAKC,IAAA,cAAc,EAAGC;AALlB,IADD,EAQC,4BAAC,qBAAD;AACC,IAAA,WAAW,EAAGD,WADf;AAEC,IAAA,gBAAgB,EAAGE,gBAFpB;AAGC,IAAA,iBAAiB,EAAGH;AAHrB,IARD,CADD;AAgBA;;AAED,SAASM,qBAAT,QAAiE;AAAA,MAAjC;AAAEC,IAAAA,YAAF;AAAgB,OAAGC;AAAnB,GAAiC;AAChE,SACC,4BAAC,iBAAD;AACC,IAAA,KAAK,EAAG,cAAI,UAAJ,CADT;AAEC,IAAA,UAAU,EAAG,cAAI,OAAJ,CAFd;AAGC,IAAA,cAAc,EAAGD,YAHlB;AAIC,IAAA,YAAY;AAJb,KAMC,4BAAC,gBAAD,EAAuBC,SAAvB,CAND,CADD;AAUA;;eAEcF,qB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Modal } from '@wordpress/components';\nimport { useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport PatternExplorerSidebar from './sidebar';\nimport PatternList from './patterns-list';\n\nfunction PatternsExplorer( { initialCategory, patternCategories } ) {\n\tconst [ filterValue, setFilterValue ] = useState( '' );\n\tconst [ selectedCategory, setSelectedCategory ] = useState(\n\t\tinitialCategory?.name\n\t);\n\treturn (\n\t\t<div className=\"block-editor-block-patterns-explorer\">\n\t\t\t<PatternExplorerSidebar\n\t\t\t\tselectedCategory={ selectedCategory }\n\t\t\t\tpatternCategories={ patternCategories }\n\t\t\t\tonClickCategory={ setSelectedCategory }\n\t\t\t\tfilterValue={ filterValue }\n\t\t\t\tsetFilterValue={ setFilterValue }\n\t\t\t/>\n\t\t\t<PatternList\n\t\t\t\tfilterValue={ filterValue }\n\t\t\t\tselectedCategory={ selectedCategory }\n\t\t\t\tpatternCategories={ patternCategories }\n\t\t\t/>\n\t\t</div>\n\t);\n}\n\nfunction PatternsExplorerModal( { onModalClose, ...restProps } ) {\n\treturn (\n\t\t<Modal\n\t\t\ttitle={ __( 'Patterns' ) }\n\t\t\tcloseLabel={ __( 'Close' ) }\n\t\t\tonRequestClose={ onModalClose }\n\t\t\tisFullScreen\n\t\t>\n\t\t\t<PatternsExplorer { ...restProps } />\n\t\t</Modal>\n\t);\n}\n\nexport default PatternsExplorerModal;\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/inserter/block-patterns-explorer/explorer.js"],"names":["PatternsExplorer","initialCategory","patternCategories","filterValue","setFilterValue","selectedCategory","setSelectedCategory","name","PatternsExplorerModal","onModalClose","restProps"],"mappings":";;;;;;;;;AAIA;;AADA;;AAEA;;AAKA;;AACA;;AAXA;AACA;AACA;;AAKA;AACA;AACA;AAIA,SAASA,gBAAT,OAAoE;AAAA,MAAzC;AAAEC,IAAAA,eAAF;AAAmBC,IAAAA;AAAnB,GAAyC;AACnE,QAAM,CAAEC,WAAF,EAAeC,cAAf,IAAkC,uBAAU,EAAV,CAAxC;AACA,QAAM,CAAEC,gBAAF,EAAoBC,mBAApB,IAA4C,uBACjDL,eADiD,aACjDA,eADiD,uBACjDA,eAAe,CAAEM,IADgC,CAAlD;AAGA,SACC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,4BAAC,gBAAD;AACC,IAAA,gBAAgB,EAAGF,gBADpB;AAEC,IAAA,iBAAiB,EAAGH,iBAFrB;AAGC,IAAA,eAAe,EAAGI,mBAHnB;AAIC,IAAA,WAAW,EAAGH,WAJf;AAKC,IAAA,cAAc,EAAGC;AALlB,IADD,EAQC,4BAAC,qBAAD;AACC,IAAA,WAAW,EAAGD,WADf;AAEC,IAAA,gBAAgB,EAAGE,gBAFpB;AAGC,IAAA,iBAAiB,EAAGH;AAHrB,IARD,CADD;AAgBA;;AAED,SAASM,qBAAT,QAAiE;AAAA,MAAjC;AAAEC,IAAAA,YAAF;AAAgB,OAAGC;AAAnB,GAAiC;AAChE,SACC,4BAAC,iBAAD;AACC,IAAA,KAAK,EAAG,cAAI,UAAJ,CADT;AAEC,IAAA,cAAc,EAAGD,YAFlB;AAGC,IAAA,YAAY;AAHb,KAKC,4BAAC,gBAAD,EAAuBC,SAAvB,CALD,CADD;AASA;;eAEcF,qB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Modal } from '@wordpress/components';\nimport { useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport PatternExplorerSidebar from './sidebar';\nimport PatternList from './patterns-list';\n\nfunction PatternsExplorer( { initialCategory, patternCategories } ) {\n\tconst [ filterValue, setFilterValue ] = useState( '' );\n\tconst [ selectedCategory, setSelectedCategory ] = useState(\n\t\tinitialCategory?.name\n\t);\n\treturn (\n\t\t<div className=\"block-editor-block-patterns-explorer\">\n\t\t\t<PatternExplorerSidebar\n\t\t\t\tselectedCategory={ selectedCategory }\n\t\t\t\tpatternCategories={ patternCategories }\n\t\t\t\tonClickCategory={ setSelectedCategory }\n\t\t\t\tfilterValue={ filterValue }\n\t\t\t\tsetFilterValue={ setFilterValue }\n\t\t\t/>\n\t\t\t<PatternList\n\t\t\t\tfilterValue={ filterValue }\n\t\t\t\tselectedCategory={ selectedCategory }\n\t\t\t\tpatternCategories={ patternCategories }\n\t\t\t/>\n\t\t</div>\n\t);\n}\n\nfunction PatternsExplorerModal( { onModalClose, ...restProps } ) {\n\treturn (\n\t\t<Modal\n\t\t\ttitle={ __( 'Patterns' ) }\n\t\t\tonRequestClose={ onModalClose }\n\t\t\tisFullScreen\n\t\t>\n\t\t\t<PatternsExplorer { ...restProps } />\n\t\t</Modal>\n\t);\n}\n\nexport default PatternsExplorerModal;\n"]}
@@ -83,6 +83,7 @@ function BlockPatternsCategoryDialog(_ref3) {
83
83
  let {
84
84
  rootClientId,
85
85
  onInsert,
86
+ onHover,
86
87
  category,
87
88
  showTitlesAsTooltip
88
89
  } = _ref3;
@@ -101,6 +102,7 @@ function BlockPatternsCategoryDialog(_ref3) {
101
102
  }, (0, _element.createElement)(BlockPatternsCategoryPanel, {
102
103
  rootClientId: rootClientId,
103
104
  onInsert: onInsert,
105
+ onHover: onHover,
104
106
  category: category,
105
107
  showTitlesAsTooltip: showTitlesAsTooltip
106
108
  }));
@@ -110,6 +112,7 @@ function BlockPatternsCategoryPanel(_ref4) {
110
112
  let {
111
113
  rootClientId,
112
114
  onInsert,
115
+ onHover,
113
116
  category,
114
117
  showTitlesAsTooltip
115
118
  } = _ref4;
@@ -129,7 +132,9 @@ function BlockPatternsCategoryPanel(_ref4) {
129
132
  const availablePatternCategories = (_pattern$categories$f = (_pattern$categories3 = pattern.categories) === null || _pattern$categories3 === void 0 ? void 0 : _pattern$categories3.filter(cat => availableCategories.find(availableCategory => availableCategory.name === cat))) !== null && _pattern$categories$f !== void 0 ? _pattern$categories$f : [];
130
133
  return availablePatternCategories.length === 0;
131
134
  }), [allPatterns, category]);
132
- const currentShownPatterns = (0, _compose.useAsyncList)(currentCategoryPatterns);
135
+ const currentShownPatterns = (0, _compose.useAsyncList)(currentCategoryPatterns); // Hide block pattern preview on unmount.
136
+
137
+ (0, _element.useEffect)(() => () => onHover(null), []);
133
138
 
134
139
  if (!currentCategoryPatterns.length) {
135
140
  return null;
@@ -143,6 +148,7 @@ function BlockPatternsCategoryPanel(_ref4) {
143
148
  shownPatterns: currentShownPatterns,
144
149
  blockPatterns: currentCategoryPatterns,
145
150
  onClickPattern: onClick,
151
+ onHover: onHover,
146
152
  label: category.label,
147
153
  orientation: "vertical",
148
154
  category: category.label,
@@ -160,6 +166,7 @@ function BlockPatternsTabs(_ref5) {
160
166
  } = _ref5;
161
167
  const [showPatternsExplorer, setShowPatternsExplorer] = (0, _element.useState)(false);
162
168
  const categories = usePatternsCategories(rootClientId);
169
+ const initialCategory = selectedCategory || categories[0];
163
170
  const isMobile = (0, _compose.useViewportMatch)('medium', '<');
164
171
  return (0, _element.createElement)(_element.Fragment, null, !isMobile && (0, _element.createElement)("div", {
165
172
  className: "block-editor-inserter__block-patterns-tabs-container"
@@ -191,7 +198,7 @@ function BlockPatternsTabs(_ref5) {
191
198
  category: category,
192
199
  showTitlesAsTooltip: false
193
200
  })), showPatternsExplorer && (0, _element.createElement)(_explorer.default, {
194
- initialCategory: selectedCategory,
201
+ initialCategory: initialCategory,
195
202
  patternCategories: categories,
196
203
  onModalClose: () => setShowPatternsExplorer(false)
197
204
  }));
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/inserter/block-patterns-tab.js"],"names":["usePatternsCategories","rootClientId","allPatterns","allCategories","undefined","hasRegisteredCategory","pattern","categories","length","some","cat","category","name","populatedCategories","filter","includes","sort","currentName","nextName","categoryName","find","push","label","BlockPatternsCategoryDialog","onInsert","showTitlesAsTooltip","container","timeout","setTimeout","firstTabbable","focus","tabbable","current","clearTimeout","BlockPatternsCategoryPanel","onClick","availableCategories","currentCategoryPatterns","availablePatternCategories","availableCategory","currentShownPatterns","description","BlockPatternsTabs","onSelectCategory","selectedCategory","showPatternsExplorer","setShowPatternsExplorer","isMobile","map","chevronRight"],"mappings":";;;;;;;;;;;AAGA;;AAOA;;AACA;;AACA;;AAOA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AA5BA;AACA;AACA;;AAoBA;AACA;AACA;AAMA,SAASA,qBAAT,CAAgCC,YAAhC,EAA+C;AAC9C,QAAM,CAAEC,WAAF,EAAeC,aAAf,IAAiC,+BACtCC,SADsC,EAEtCH,YAFsC,CAAvC;AAKA,QAAMI,qBAAqB,GAAG,0BAC3BC,OAAF,IAAe;AACd,QAAK,CAAEA,OAAO,CAACC,UAAV,IAAwB,CAAED,OAAO,CAACC,UAAR,CAAmBC,MAAlD,EAA2D;AAC1D,aAAO,KAAP;AACA;;AAED,WAAOF,OAAO,CAACC,UAAR,CAAmBE,IAAnB,CAA2BC,GAAF,IAC/BP,aAAa,CAACM,IAAd,CAAsBE,QAAF,IAAgBA,QAAQ,CAACC,IAAT,KAAkBF,GAAtD,CADM,CAAP;AAGA,GAT4B,EAU7B,CAAEP,aAAF,CAV6B,CAA9B,CAN8C,CAmB9C;;AACA,QAAMU,mBAAmB,GAAG,sBAAS,MAAM;AAC1C,UAAMN,UAAU,GAAGJ,aAAa,CAC9BW,MADiB,CAC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D;AAwEA;;eAEcJ,iB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tuseMemo,\n\tuseState,\n\tuseCallback,\n\tuseRef,\n\tuseEffect,\n} from '@wordpress/element';\nimport { _x, __ } from '@wordpress/i18n';\nimport { useAsyncList, useViewportMatch } from '@wordpress/compose';\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\t__experimentalItem as Item,\n\t__experimentalHStack as HStack,\n\tFlexBlock,\n\tButton,\n} from '@wordpress/components';\nimport { Icon, chevronRight } from '@wordpress/icons';\nimport { focus } from '@wordpress/dom';\n\n/**\n * Internal dependencies\n */\nimport usePatternsState from './hooks/use-patterns-state';\nimport BlockPatternList from '../block-patterns-list';\nimport PatternsExplorerModal from './block-patterns-explorer/explorer';\nimport MobileTabNavigation from './mobile-tab-navigation';\n\nfunction usePatternsCategories( rootClientId ) {\n\tconst [ allPatterns, allCategories ] = usePatternsState(\n\t\tundefined,\n\t\trootClientId\n\t);\n\n\tconst hasRegisteredCategory = useCallback(\n\t\t( pattern ) => {\n\t\t\tif ( ! pattern.categories || ! pattern.categories.length ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn pattern.categories.some( ( cat ) =>\n\t\t\t\tallCategories.some( ( category ) => category.name === cat )\n\t\t\t);\n\t\t},\n\t\t[ allCategories ]\n\t);\n\n\t// Remove any empty categories.\n\tconst populatedCategories = useMemo( () => {\n\t\tconst categories = allCategories\n\t\t\t.filter( ( category ) =>\n\t\t\t\tallPatterns.some( ( pattern ) =>\n\t\t\t\t\tpattern.categories?.includes( category.name )\n\t\t\t\t)\n\t\t\t)\n\t\t\t.sort( ( { name: currentName }, { name: nextName } ) => {\n\t\t\t\tif (\n\t\t\t\t\t! [ currentName, nextName ].some( ( categoryName ) =>\n\t\t\t\t\t\t[ 'featured', 'text' ].includes( categoryName )\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t\t// Move `featured` category to the top and `text` to the bottom.\n\t\t\t\treturn currentName === 'featured' || nextName === 'text'\n\t\t\t\t\t? -1\n\t\t\t\t\t: 1;\n\t\t\t} );\n\n\t\tif (\n\t\t\tallPatterns.some(\n\t\t\t\t( pattern ) => ! hasRegisteredCategory( pattern )\n\t\t\t) &&\n\t\t\t! categories.find(\n\t\t\t\t( category ) => category.name === 'uncategorized'\n\t\t\t)\n\t\t) {\n\t\t\tcategories.push( {\n\t\t\t\tname: 'uncategorized',\n\t\t\t\tlabel: _x( 'Uncategorized' ),\n\t\t\t} );\n\t\t}\n\n\t\treturn categories;\n\t}, [ allPatterns, allCategories ] );\n\n\treturn populatedCategories;\n}\n\nexport function BlockPatternsCategoryDialog( {\n\trootClientId,\n\tonInsert,\n\tcategory,\n\tshowTitlesAsTooltip,\n} ) {\n\tconst container = useRef();\n\n\tuseEffect( () => {\n\t\tconst timeout = setTimeout( () => {\n\t\t\tconst [ firstTabbable ] = focus.tabbable.find( container.current );\n\t\t\tfirstTabbable?.focus();\n\t\t} );\n\t\treturn () => clearTimeout( timeout );\n\t}, [ category ] );\n\n\treturn (\n\t\t<div\n\t\t\tref={ container }\n\t\t\tclassName=\"block-editor-inserter__patterns-category-dialog\"\n\t\t>\n\t\t\t<BlockPatternsCategoryPanel\n\t\t\t\trootClientId={ rootClientId }\n\t\t\t\tonInsert={ onInsert }\n\t\t\t\tcategory={ category }\n\t\t\t\tshowTitlesAsTooltip={ showTitlesAsTooltip }\n\t\t\t/>\n\t\t</div>\n\t);\n}\n\nexport function BlockPatternsCategoryPanel( {\n\trootClientId,\n\tonInsert,\n\tcategory,\n\tshowTitlesAsTooltip,\n} ) {\n\tconst [ allPatterns, , onClick ] = usePatternsState(\n\t\tonInsert,\n\t\trootClientId\n\t);\n\n\tconst availableCategories = usePatternsCategories( rootClientId );\n\tconst currentCategoryPatterns = useMemo(\n\t\t() =>\n\t\t\tallPatterns.filter( ( pattern ) => {\n\t\t\t\tif ( category.name !== 'uncategorized' ) {\n\t\t\t\t\treturn pattern.categories?.includes( category.name );\n\t\t\t\t}\n\n\t\t\t\t// The uncategorized category should show all the patterns without any category\n\t\t\t\t// or with no available category.\n\t\t\t\tconst availablePatternCategories =\n\t\t\t\t\tpattern.categories?.filter( ( cat ) =>\n\t\t\t\t\t\tavailableCategories.find(\n\t\t\t\t\t\t\t( availableCategory ) =>\n\t\t\t\t\t\t\t\tavailableCategory.name === cat\n\t\t\t\t\t\t)\n\t\t\t\t\t) ?? [];\n\n\t\t\t\treturn availablePatternCategories.length === 0;\n\t\t\t} ),\n\t\t[ allPatterns, category ]\n\t);\n\n\tconst currentShownPatterns = useAsyncList( currentCategoryPatterns );\n\n\tif ( ! currentCategoryPatterns.length ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<div className=\"block-editor-inserter__patterns-category-panel\">\n\t\t\t<div className=\"block-editor-inserter__patterns-category-panel-title\">\n\t\t\t\t{ category.label }\n\t\t\t</div>\n\t\t\t<p>{ category.description }</p>\n\t\t\t<BlockPatternList\n\t\t\t\tshownPatterns={ currentShownPatterns }\n\t\t\t\tblockPatterns={ currentCategoryPatterns }\n\t\t\t\tonClickPattern={ onClick }\n\t\t\t\tlabel={ category.label }\n\t\t\t\torientation=\"vertical\"\n\t\t\t\tcategory={ category.label }\n\t\t\t\tisDraggable\n\t\t\t\tshowTitlesAsTooltip={ showTitlesAsTooltip }\n\t\t\t/>\n\t\t</div>\n\t);\n}\n\nfunction BlockPatternsTabs( {\n\tonSelectCategory,\n\tselectedCategory,\n\tonInsert,\n\trootClientId,\n} ) {\n\tconst [ showPatternsExplorer, setShowPatternsExplorer ] = useState( false );\n\tconst categories = usePatternsCategories( rootClientId );\n\tconst isMobile = useViewportMatch( 'medium', '<' );\n\treturn (\n\t\t<>\n\t\t\t{ ! isMobile && (\n\t\t\t\t<div className=\"block-editor-inserter__block-patterns-tabs-container\">\n\t\t\t\t\t<nav aria-label={ __( 'Block pattern categories' ) }>\n\t\t\t\t\t\t<ItemGroup\n\t\t\t\t\t\t\trole=\"list\"\n\t\t\t\t\t\t\tclassName=\"block-editor-inserter__block-patterns-tabs\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ categories.map( ( category ) => (\n\t\t\t\t\t\t\t\t<Item\n\t\t\t\t\t\t\t\t\trole=\"listitem\"\n\t\t\t\t\t\t\t\t\tkey={ category.name }\n\t\t\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\t\t\tonSelectCategory( category )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tclassName={\n\t\t\t\t\t\t\t\t\t\tcategory === selectedCategory\n\t\t\t\t\t\t\t\t\t\t\t? 'block-editor-inserter__patterns-category block-editor-inserter__patterns-selected-category'\n\t\t\t\t\t\t\t\t\t\t\t: 'block-editor-inserter__patterns-category'\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\taria-label={ category.label }\n\t\t\t\t\t\t\t\t\taria-current={\n\t\t\t\t\t\t\t\t\t\tcategory === selectedCategory\n\t\t\t\t\t\t\t\t\t\t\t? 'true'\n\t\t\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<HStack>\n\t\t\t\t\t\t\t\t\t\t<FlexBlock>\n\t\t\t\t\t\t\t\t\t\t\t{ category.label }\n\t\t\t\t\t\t\t\t\t\t</FlexBlock>\n\t\t\t\t\t\t\t\t\t\t<Icon icon={ chevronRight } />\n\t\t\t\t\t\t\t\t\t</HStack>\n\t\t\t\t\t\t\t\t</Item>\n\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t\t\t<div role=\"listitem\">\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\tclassName=\"block-editor-inserter__patterns-explore-button\"\n\t\t\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\t\t\tsetShowPatternsExplorer( true )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ __( 'Explore all patterns' ) }\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</ItemGroup>\n\t\t\t\t\t</nav>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t\t{ isMobile && (\n\t\t\t\t<MobileTabNavigation categories={ categories }>\n\t\t\t\t\t{ ( category ) => (\n\t\t\t\t\t\t<BlockPatternsCategoryPanel\n\t\t\t\t\t\t\tonInsert={ onInsert }\n\t\t\t\t\t\t\trootClientId={ rootClientId }\n\t\t\t\t\t\t\tcategory={ category }\n\t\t\t\t\t\t\tshowTitlesAsTooltip={ false }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</MobileTabNavigation>\n\t\t\t) }\n\t\t\t{ showPatternsExplorer && (\n\t\t\t\t<PatternsExplorerModal\n\t\t\t\t\tinitialCategory={ selectedCategory }\n\t\t\t\t\tpatternCategories={ categories }\n\t\t\t\t\tonModalClose={ () => setShowPatternsExplorer( false ) }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport default BlockPatternsTabs;\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/inserter/block-patterns-tab.js"],"names":["usePatternsCategories","rootClientId","allPatterns","allCategories","undefined","hasRegisteredCategory","pattern","categories","length","some","cat","category","name","populatedCategories","filter","includes","sort","currentName","nextName","categoryName","find","push","label","BlockPatternsCategoryDialog","onInsert","onHover","showTitlesAsTooltip","container","timeout","setTimeout","firstTabbable","focus","tabbable","current","clearTimeout","BlockPatternsCategoryPanel","onClick","availableCategories","currentCategoryPatterns","availablePatternCategories","availableCategory","currentShownPatterns","description","BlockPatternsTabs","onSelectCategory","selectedCategory","showPatternsExplorer","setShowPatternsExplorer","initialCategory","isMobile","map","chevronRight"],"mappings":";;;;;;;;;;;AAGA;;AAOA;;AACA;;AACA;;AAOA;;A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C,gBAAb,GACG,4FADH,GAEG,0CATL;AAWC,kBAAalC,QAAQ,CAACW,KAXvB;AAYC,oBACCX,QAAQ,KAAKkC,gBAAb,GACG,MADH,GAEGzC;AAfL,KAkBC,4BAAC,gCAAD,QACC,4BAAC,qBAAD,QACGO,QAAQ,CAACW,KADZ,CADD,EAIC,4BAAC,WAAD;AAAM,IAAA,IAAI,EAAG6B;AAAb,IAJD,CAlBD,CADC,CAJH,EA+BC;AAAK,IAAA,IAAI,EAAC;AAAV,KACC,4BAAC,kBAAD;AACC,IAAA,SAAS,EAAC,gDADX;AAEC,IAAA,OAAO,EAAG,MACTJ,uBAAuB,CAAE,IAAF,CAHzB;AAKC,IAAA,OAAO,EAAC;AALT,KAOG,cAAI,sBAAJ,CAPH,CADD,CA/BD,CADD,CADD,CAFF,EAkDGE,QAAQ,IACT,4BAAC,4BAAD;AAAqB,IAAA,UAAU,EAAG1C;AAAlC,KACKI,QAAF,IACD,4BAAC,0BAAD;AACC,IAAA,QAAQ,EAAGa,QADZ;AAEC,IAAA,YAAY,EAAGvB,YAFhB;AAGC,IAAA,QAAQ,EAAGU,QAHZ;AAIC,IAAA,mBAAmB,EAAG;AAJvB,IAFF,CAnDF,EA8DGmC,oBAAoB,IACrB,4BAAC,iBAAD;AACC,IAAA,eAAe,EAAGE,eADnB;AAEC,IAAA,iBAAiB,EAAGzC,UAFrB;AAGC,IAAA,YAAY,EAAG,MAAMwC,uBAAuB,CAAE,KAAF;AAH7C,IA/DF,CADD;AAwEA;;eAEcJ,iB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tuseMemo,\n\tuseState,\n\tuseCallback,\n\tuseRef,\n\tuseEffect,\n} from '@wordpress/element';\nimport { _x, __ } from '@wordpress/i18n';\nimport { useAsyncList, useViewportMatch } from '@wordpress/compose';\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\t__experimentalItem as Item,\n\t__experimentalHStack as HStack,\n\tFlexBlock,\n\tButton,\n} from '@wordpress/components';\nimport { Icon, chevronRight } from '@wordpress/icons';\nimport { focus } from '@wordpress/dom';\n\n/**\n * Internal dependencies\n */\nimport usePatternsState from './hooks/use-patterns-state';\nimport BlockPatternList from '../block-patterns-list';\nimport PatternsExplorerModal from './block-patterns-explorer/explorer';\nimport MobileTabNavigation from './mobile-tab-navigation';\n\nfunction usePatternsCategories( rootClientId ) {\n\tconst [ allPatterns, allCategories ] = usePatternsState(\n\t\tundefined,\n\t\trootClientId\n\t);\n\n\tconst hasRegisteredCategory = useCallback(\n\t\t( pattern ) => {\n\t\t\tif ( ! pattern.categories || ! pattern.categories.length ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn pattern.categories.some( ( cat ) =>\n\t\t\t\tallCategories.some( ( category ) => category.name === cat )\n\t\t\t);\n\t\t},\n\t\t[ allCategories ]\n\t);\n\n\t// Remove any empty categories.\n\tconst populatedCategories = useMemo( () => {\n\t\tconst categories = allCategories\n\t\t\t.filter( ( category ) =>\n\t\t\t\tallPatterns.some( ( pattern ) =>\n\t\t\t\t\tpattern.categories?.includes( category.name )\n\t\t\t\t)\n\t\t\t)\n\t\t\t.sort( ( { name: currentName }, { name: nextName } ) => {\n\t\t\t\tif (\n\t\t\t\t\t! [ currentName, nextName ].some( ( categoryName ) =>\n\t\t\t\t\t\t[ 'featured', 'text' ].includes( categoryName )\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t\t// Move `featured` category to the top and `text` to the bottom.\n\t\t\t\treturn currentName === 'featured' || nextName === 'text'\n\t\t\t\t\t? -1\n\t\t\t\t\t: 1;\n\t\t\t} );\n\n\t\tif (\n\t\t\tallPatterns.some(\n\t\t\t\t( pattern ) => ! hasRegisteredCategory( pattern )\n\t\t\t) &&\n\t\t\t! categories.find(\n\t\t\t\t( category ) => category.name === 'uncategorized'\n\t\t\t)\n\t\t) {\n\t\t\tcategories.push( {\n\t\t\t\tname: 'uncategorized',\n\t\t\t\tlabel: _x( 'Uncategorized' ),\n\t\t\t} );\n\t\t}\n\n\t\treturn categories;\n\t}, [ allPatterns, allCategories ] );\n\n\treturn populatedCategories;\n}\n\nexport function BlockPatternsCategoryDialog( {\n\trootClientId,\n\tonInsert,\n\tonHover,\n\tcategory,\n\tshowTitlesAsTooltip,\n} ) {\n\tconst container = useRef();\n\n\tuseEffect( () => {\n\t\tconst timeout = setTimeout( () => {\n\t\t\tconst [ firstTabbable ] = focus.tabbable.find( container.current );\n\t\t\tfirstTabbable?.focus();\n\t\t} );\n\t\treturn () => clearTimeout( timeout );\n\t}, [ category ] );\n\n\treturn (\n\t\t<div\n\t\t\tref={ container }\n\t\t\tclassName=\"block-editor-inserter__patterns-category-dialog\"\n\t\t>\n\t\t\t<BlockPatternsCategoryPanel\n\t\t\t\trootClientId={ rootClientId }\n\t\t\t\tonInsert={ onInsert }\n\t\t\t\tonHover={ onHover }\n\t\t\t\tcategory={ category }\n\t\t\t\tshowTitlesAsTooltip={ showTitlesAsTooltip }\n\t\t\t/>\n\t\t</div>\n\t);\n}\n\nexport function BlockPatternsCategoryPanel( {\n\trootClientId,\n\tonInsert,\n\tonHover,\n\tcategory,\n\tshowTitlesAsTooltip,\n} ) {\n\tconst [ allPatterns, , onClick ] = usePatternsState(\n\t\tonInsert,\n\t\trootClientId\n\t);\n\n\tconst availableCategories = usePatternsCategories( rootClientId );\n\tconst currentCategoryPatterns = useMemo(\n\t\t() =>\n\t\t\tallPatterns.filter( ( pattern ) => {\n\t\t\t\tif ( category.name !== 'uncategorized' ) {\n\t\t\t\t\treturn pattern.categories?.includes( category.name );\n\t\t\t\t}\n\n\t\t\t\t// The uncategorized category should show all the patterns without any category\n\t\t\t\t// or with no available category.\n\t\t\t\tconst availablePatternCategories =\n\t\t\t\t\tpattern.categories?.filter( ( cat ) =>\n\t\t\t\t\t\tavailableCategories.find(\n\t\t\t\t\t\t\t( availableCategory ) =>\n\t\t\t\t\t\t\t\tavailableCategory.name === cat\n\t\t\t\t\t\t)\n\t\t\t\t\t) ?? [];\n\n\t\t\t\treturn availablePatternCategories.length === 0;\n\t\t\t} ),\n\t\t[ allPatterns, category ]\n\t);\n\n\tconst currentShownPatterns = useAsyncList( currentCategoryPatterns );\n\n\t// Hide block pattern preview on unmount.\n\tuseEffect( () => () => onHover( null ), [] );\n\n\tif ( ! currentCategoryPatterns.length ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<div className=\"block-editor-inserter__patterns-category-panel\">\n\t\t\t<div className=\"block-editor-inserter__patterns-category-panel-title\">\n\t\t\t\t{ category.label }\n\t\t\t</div>\n\t\t\t<p>{ category.description }</p>\n\t\t\t<BlockPatternList\n\t\t\t\tshownPatterns={ currentShownPatterns }\n\t\t\t\tblockPatterns={ currentCategoryPatterns }\n\t\t\t\tonClickPattern={ onClick }\n\t\t\t\tonHover={ onHover }\n\t\t\t\tlabel={ category.label }\n\t\t\t\torientation=\"vertical\"\n\t\t\t\tcategory={ category.label }\n\t\t\t\tisDraggable\n\t\t\t\tshowTitlesAsTooltip={ showTitlesAsTooltip }\n\t\t\t/>\n\t\t</div>\n\t);\n}\n\nfunction BlockPatternsTabs( {\n\tonSelectCategory,\n\tselectedCategory,\n\tonInsert,\n\trootClientId,\n} ) {\n\tconst [ showPatternsExplorer, setShowPatternsExplorer ] = useState( false );\n\tconst categories = usePatternsCategories( rootClientId );\n\tconst initialCategory = selectedCategory || categories[ 0 ];\n\tconst isMobile = useViewportMatch( 'medium', '<' );\n\treturn (\n\t\t<>\n\t\t\t{ ! isMobile && (\n\t\t\t\t<div className=\"block-editor-inserter__block-patterns-tabs-container\">\n\t\t\t\t\t<nav aria-label={ __( 'Block pattern categories' ) }>\n\t\t\t\t\t\t<ItemGroup\n\t\t\t\t\t\t\trole=\"list\"\n\t\t\t\t\t\t\tclassName=\"block-editor-inserter__block-patterns-tabs\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ categories.map( ( category ) => (\n\t\t\t\t\t\t\t\t<Item\n\t\t\t\t\t\t\t\t\trole=\"listitem\"\n\t\t\t\t\t\t\t\t\tkey={ category.name }\n\t\t\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\t\t\tonSelectCategory( category )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tclassName={\n\t\t\t\t\t\t\t\t\t\tcategory === selectedCategory\n\t\t\t\t\t\t\t\t\t\t\t? 'block-editor-inserter__patterns-category block-editor-inserter__patterns-selected-category'\n\t\t\t\t\t\t\t\t\t\t\t: 'block-editor-inserter__patterns-category'\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\taria-label={ category.label }\n\t\t\t\t\t\t\t\t\taria-current={\n\t\t\t\t\t\t\t\t\t\tcategory === selectedCategory\n\t\t\t\t\t\t\t\t\t\t\t? 'true'\n\t\t\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<HStack>\n\t\t\t\t\t\t\t\t\t\t<FlexBlock>\n\t\t\t\t\t\t\t\t\t\t\t{ category.label }\n\t\t\t\t\t\t\t\t\t\t</FlexBlock>\n\t\t\t\t\t\t\t\t\t\t<Icon icon={ chevronRight } />\n\t\t\t\t\t\t\t\t\t</HStack>\n\t\t\t\t\t\t\t\t</Item>\n\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t\t\t<div role=\"listitem\">\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\tclassName=\"block-editor-inserter__patterns-explore-button\"\n\t\t\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\t\t\tsetShowPatternsExplorer( true )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ __( 'Explore all patterns' ) }\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</ItemGroup>\n\t\t\t\t\t</nav>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t\t{ isMobile && (\n\t\t\t\t<MobileTabNavigation categories={ categories }>\n\t\t\t\t\t{ ( category ) => (\n\t\t\t\t\t\t<BlockPatternsCategoryPanel\n\t\t\t\t\t\t\tonInsert={ onInsert }\n\t\t\t\t\t\t\trootClientId={ rootClientId }\n\t\t\t\t\t\t\tcategory={ category }\n\t\t\t\t\t\t\tshowTitlesAsTooltip={ false }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</MobileTabNavigation>\n\t\t\t) }\n\t\t\t{ showPatternsExplorer && (\n\t\t\t\t<PatternsExplorerModal\n\t\t\t\t\tinitialCategory={ initialCategory }\n\t\t\t\t\tpatternCategories={ categories }\n\t\t\t\t\tonModalClose={ () => setShowPatternsExplorer( false ) }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport default BlockPatternsTabs;\n"]}
@@ -102,7 +102,7 @@ function BlockTypesTab(_ref) {
102
102
  onSelect: onSelectItem,
103
103
  onHover: onHover,
104
104
  label: (0, _i18n._x)('Most used', 'blocks')
105
- })), (0, _lodash.map)(currentlyRenderedCategories, category => {
105
+ })), currentlyRenderedCategories.map(category => {
106
106
  const categoryItems = itemsPerCategory[category.slug];
107
107
 
108
108
  if (!categoryItems || !categoryItems.length) {
@@ -127,7 +127,7 @@ function BlockTypesTab(_ref) {
127
127
  onSelect: onSelectItem,
128
128
  onHover: onHover,
129
129
  label: (0, _i18n.__)('Uncategorized')
130
- })), (0, _lodash.map)(currentlyRenderedCollections, _ref2 => {
130
+ })), currentlyRenderedCollections.map(_ref2 => {
131
131
  let [namespace, collection] = _ref2;
132
132
  const collectionItems = itemsPerCollection[namespace];
133
133
 
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/inserter/block-types-tab.js"],"names":["getBlockNamespace","item","name","split","MAX_SUGGESTED_ITEMS","EMPTY_ARRAY","BlockTypesTab","rootClientId","onInsert","onHover","showMostUsedBlocks","items","categories","collections","onSelectItem","suggestedItems","slice","uncategorizedItems","filter","category","itemsPerCategory","itemList","itemsPerCollection","result","Object","keys","forEach","namespace","length","currentlyRenderedCategories","didRenderAllCategories","collectionEntries","entries","currentlyRenderedCollections","categoryItems","slug","title","icon","collection","collectionItems"],"mappings":";;;;;;;;;;AASA;;AANA;;AAKA;;AAEA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AAnBA;AACA;AACA;;AAGA;AACA;AACA;;AAKA;AACA;AACA;AAOA,MAAMA,iBAAiB,GAAKC,IAAF,IAAYA,IAAI,CAACC,IAAL,CAAUC,KAAV,CAAiB,GAAjB,EAAwB,CAAxB,CAAtC;;AAEA,MAAMC,mBAAmB,GAAG,CAA5B;AAEA;AACA;AACA;AACA;AACA;AACA;;AACA,MAAMC,WAAW,GAAG,EAApB;;AAEO,SAASC,aAAT,OAKH;AAAA,MAL2B;AAC9BC,IAAAA,YAD8B;AAE9BC,IAAAA,QAF8B;AAG9BC,IAAAA,OAH8B;AAI9BC,IAAAA;AAJ8B,GAK3B;AACH,QAAM,CAAEC,KAAF,EAASC,UAAT,EAAqBC,WAArB,EAAkCC,YAAlC,IAAmD,iCACxDP,YADwD,EAExDC,QAFwD,CAAzD;AAKA,QAAMO,cAAc,GAAG,sBAAS,MAAM;AACrC,WAAO,sBAASJ,KAAT,EAAgB,UAAhB,EAA4B,MAA5B,EAAqCK,KAArC,CACN,CADM,EAENZ,mBAFM,CAAP;AAIA,GALsB,EAKpB,CAAEO,KAAF,CALoB,CAAvB;AAOA,QAAMM,kBAAkB,GAAG,sBAAS,MAAM;AACzC,WAAON,KAAK,CAACO,MAAN,CAAgBjB,IAAF,IAAY,CAAEA,IAAI,CAACkB,QAAjC,CAAP;AACA,GAF0B,EAExB,CAAER,KAAF,CAFwB,CAA3B;AAIA,QAAMS,gBAAgB,GAAG,sBAAS,MAAM;AACvC,WAAO,mBACJC,QAAF,IACCA,QAAQ,CA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BADC,EAED,SAAiC;AAAA,QAA/B,CAAEN,SAAF,EAAaW,UAAb,CAA+B;AAChC,UAAMC,eAAe,GAAGjB,kBAAkB,CAAEK,SAAF,CAA1C;;AACA,QAAK,CAAEY,eAAF,IAAqB,CAAEA,eAAe,CAACX,MAA5C,EAAqD;AACpD,aAAO,IAAP;AACA;;AAED,WACC,4BAAC,cAAD;AACC,MAAA,GAAG,EAAGD,SADP;AAEC,MAAA,KAAK,EAAGW,UAAU,CAACF,KAFpB;AAGC,MAAA,IAAI,EAAGE,UAAU,CAACD;AAHnB,OAKC,4BAAC,uBAAD;AACC,MAAA,KAAK,EAAGE,eADT;AAEC,MAAA,QAAQ,EAAGzB,YAFZ;AAGC,MAAA,OAAO,EAAGL,OAHX;AAIC,MAAA,KAAK,EAAG6B,UAAU,CAACF;AAJpB,MALD,CADD;AAcA,GAtBA,CA/CH,CADD,CADD;AA4EA;;eAEc9B,a","sourcesContent":["/**\n * External dependencies\n */\nimport { map, groupBy } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { __, _x } from '@wordpress/i18n';\nimport { useMemo, useEffect } from '@wordpress/element';\nimport { pipe, useAsyncList } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport BlockTypesList from '../block-types-list';\nimport InserterPanel from './panel';\nimport useBlockTypesState from './hooks/use-block-types-state';\nimport InserterListbox from '../inserter-listbox';\nimport { orderBy } from '../../utils/sorting';\n\nconst getBlockNamespace = ( item ) => item.name.split( '/' )[ 0 ];\n\nconst MAX_SUGGESTED_ITEMS = 6;\n\n/**\n * Shared reference to an empty array for cases where it is important to avoid\n * returning a new array reference on every invocation and rerendering the component.\n *\n * @type {Array}\n */\nconst EMPTY_ARRAY = [];\n\nexport function BlockTypesTab( {\n\trootClientId,\n\tonInsert,\n\tonHover,\n\tshowMostUsedBlocks,\n} ) {\n\tconst [ items, categories, collections, onSelectItem ] = useBlockTypesState(\n\t\trootClientId,\n\t\tonInsert\n\t);\n\n\tconst suggestedItems = useMemo( () => {\n\t\treturn orderBy( items, 'frecency', 'desc' ).slice(\n\t\t\t0,\n\t\t\tMAX_SUGGESTED_ITEMS\n\t\t);\n\t}, [ items ] );\n\n\tconst uncategorizedItems = useMemo( () => {\n\t\treturn items.filter( ( item ) => ! item.category );\n\t}, [ items ] );\n\n\tconst itemsPerCategory = useMemo( () => {\n\t\treturn pipe(\n\t\t\t( itemList ) =>\n\t\t\t\titemList.filter(\n\t\t\t\t\t( item ) => item.category && item.category !== 'reusable'\n\t\t\t\t),\n\t\t\t( itemList ) => groupBy( itemList, 'category' )\n\t\t)( items );\n\t}, [ items ] );\n\n\tconst itemsPerCollection = useMemo( () => {\n\t\t// Create a new Object to avoid mutating collection.\n\t\tconst result = { ...collections };\n\t\tObject.keys( collections ).forEach( ( namespace ) => {\n\t\t\tresult[ namespace ] = items.filter(\n\t\t\t\t( item ) => getBlockNamespace( item ) === namespace\n\t\t\t);\n\t\t\tif ( result[ namespace ].length === 0 ) {\n\t\t\t\tdelete result[ namespace ];\n\t\t\t}\n\t\t} );\n\n\t\treturn result;\n\t}, [ items, collections ] );\n\n\t// Hide block preview on unmount.\n\tuseEffect( () => () => onHover( null ), [] );\n\n\t/**\n\t * The inserter contains a big number of blocks and opening it is a costful operation.\n\t * The rendering is the most costful part of it, in order to improve the responsiveness\n\t * of the \"opening\" action, these lazy lists allow us to render the inserter category per category,\n\t * once all the categories are rendered, we start rendering the collections and the uncategorized block types.\n\t */\n\tconst currentlyRenderedCategories = useAsyncList( categories );\n\tconst didRenderAllCategories =\n\t\tcategories.length === currentlyRenderedCategories.length;\n\n\t// Async List requires an array.\n\tconst collectionEntries = useMemo( () => {\n\t\treturn Object.entries( collections );\n\t}, [ collections ] );\n\tconst currentlyRenderedCollections = useAsyncList(\n\t\tdidRenderAllCategories ? collectionEntries : EMPTY_ARRAY\n\t);\n\n\treturn (\n\t\t<InserterListbox>\n\t\t\t<div>\n\t\t\t\t{ showMostUsedBlocks && !! suggestedItems.length && (\n\t\t\t\t\t<InserterPanel title={ _x( 'Most used', 'blocks' ) }>\n\t\t\t\t\t\t<BlockTypesList\n\t\t\t\t\t\t\titems={ suggestedItems }\n\t\t\t\t\t\t\tonSelect={ onSelectItem }\n\t\t\t\t\t\t\tonHover={ onHover }\n\t\t\t\t\t\t\tlabel={ _x( 'Most used', 'blocks' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</InserterPanel>\n\t\t\t\t) }\n\n\t\t\t\t{ map( currentlyRenderedCategories, ( category ) => {\n\t\t\t\t\tconst categoryItems = itemsPerCategory[ category.slug ];\n\t\t\t\t\tif ( ! categoryItems || ! categoryItems.length ) {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<InserterPanel\n\t\t\t\t\t\t\tkey={ category.slug }\n\t\t\t\t\t\t\ttitle={ category.title }\n\t\t\t\t\t\t\ticon={ category.icon }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<BlockTypesList\n\t\t\t\t\t\t\t\titems={ categoryItems }\n\t\t\t\t\t\t\t\tonSelect={ onSelectItem }\n\t\t\t\t\t\t\t\tonHover={ onHover }\n\t\t\t\t\t\t\t\tlabel={ category.title }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</InserterPanel>\n\t\t\t\t\t);\n\t\t\t\t} ) }\n\n\t\t\t\t{ didRenderAllCategories && uncategorizedItems.length > 0 && (\n\t\t\t\t\t<InserterPanel\n\t\t\t\t\t\tclassName=\"block-editor-inserter__uncategorized-blocks-panel\"\n\t\t\t\t\t\ttitle={ __( 'Uncategorized' ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<BlockTypesList\n\t\t\t\t\t\t\titems={ uncategorizedItems }\n\t\t\t\t\t\t\tonSelect={ onSelectItem }\n\t\t\t\t\t\t\tonHover={ onHover }\n\t\t\t\t\t\t\tlabel={ __( 'Uncategorized' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</InserterPanel>\n\t\t\t\t) }\n\n\t\t\t\t{ map(\n\t\t\t\t\tcurrentlyRenderedCollections,\n\t\t\t\t\t( [ namespace, collection ] ) => {\n\t\t\t\t\t\tconst collectionItems = itemsPerCollection[ namespace ];\n\t\t\t\t\t\tif ( ! collectionItems || ! collectionItems.length ) {\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<InserterPanel\n\t\t\t\t\t\t\t\tkey={ namespace }\n\t\t\t\t\t\t\t\ttitle={ collection.title }\n\t\t\t\t\t\t\t\ticon={ collection.icon }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<BlockTypesList\n\t\t\t\t\t\t\t\t\titems={ collectionItems }\n\t\t\t\t\t\t\t\t\tonSelect={ onSelectItem }\n\t\t\t\t\t\t\t\t\tonHover={ onHover }\n\t\t\t\t\t\t\t\t\tlabel={ collection.title }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</InserterPanel>\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t) }\n\t\t\t</div>\n\t\t</InserterListbox>\n\t);\n}\n\nexport default BlockTypesTab;\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/inserter/block-types-tab.js"],"names":["getBlockNamespace","item","name","split","MAX_SUGGESTED_ITEMS","EMPTY_ARRAY","BlockTypesTab","rootClientId","onInsert","onHover","showMostUsedBlocks","items","categories","collections","onSelectItem","suggestedItems","slice","uncategorizedItems","filter","category","itemsPerCategory","itemList","itemsPerCollection","result","Object","keys","forEach","namespace","length","currentlyRenderedCategories","didRenderAllCategories","collectionEntries","entries","currentlyRenderedCollections","map","categoryItems","slug","title","icon","collection","collectionItems"],"mappings":";;;;;;;;;;AASA;;AANA;;AAKA;;AAEA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AAnBA;AACA;AACA;;AAGA;AACA;AACA;;AAKA;AACA;AACA;AAOA,MAAMA,iBAAiB,GAAKC,IAAF,IAAYA,IAAI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AD;AACC,MAAA,KAAK,EAAGE,eADT;AAEC,MAAA,QAAQ,EAAG1B,YAFZ;AAGC,MAAA,OAAO,EAAGL,OAHX;AAIC,MAAA,KAAK,EAAG8B,UAAU,CAACF;AAJpB,MALD,CADD;AAcA,GArBA,CA/CH,CADD,CADD;AA2EA;;eAEc/B,a","sourcesContent":["/**\n * External dependencies\n */\nimport { groupBy } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { __, _x } from '@wordpress/i18n';\nimport { useMemo, useEffect } from '@wordpress/element';\nimport { pipe, useAsyncList } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport BlockTypesList from '../block-types-list';\nimport InserterPanel from './panel';\nimport useBlockTypesState from './hooks/use-block-types-state';\nimport InserterListbox from '../inserter-listbox';\nimport { orderBy } from '../../utils/sorting';\n\nconst getBlockNamespace = ( item ) => item.name.split( '/' )[ 0 ];\n\nconst MAX_SUGGESTED_ITEMS = 6;\n\n/**\n * Shared reference to an empty array for cases where it is important to avoid\n * returning a new array reference on every invocation and rerendering the component.\n *\n * @type {Array}\n */\nconst EMPTY_ARRAY = [];\n\nexport function BlockTypesTab( {\n\trootClientId,\n\tonInsert,\n\tonHover,\n\tshowMostUsedBlocks,\n} ) {\n\tconst [ items, categories, collections, onSelectItem ] = useBlockTypesState(\n\t\trootClientId,\n\t\tonInsert\n\t);\n\n\tconst suggestedItems = useMemo( () => {\n\t\treturn orderBy( items, 'frecency', 'desc' ).slice(\n\t\t\t0,\n\t\t\tMAX_SUGGESTED_ITEMS\n\t\t);\n\t}, [ items ] );\n\n\tconst uncategorizedItems = useMemo( () => {\n\t\treturn items.filter( ( item ) => ! item.category );\n\t}, [ items ] );\n\n\tconst itemsPerCategory = useMemo( () => {\n\t\treturn pipe(\n\t\t\t( itemList ) =>\n\t\t\t\titemList.filter(\n\t\t\t\t\t( item ) => item.category && item.category !== 'reusable'\n\t\t\t\t),\n\t\t\t( itemList ) => groupBy( itemList, 'category' )\n\t\t)( items );\n\t}, [ items ] );\n\n\tconst itemsPerCollection = useMemo( () => {\n\t\t// Create a new Object to avoid mutating collection.\n\t\tconst result = { ...collections };\n\t\tObject.keys( collections ).forEach( ( namespace ) => {\n\t\t\tresult[ namespace ] = items.filter(\n\t\t\t\t( item ) => getBlockNamespace( item ) === namespace\n\t\t\t);\n\t\t\tif ( result[ namespace ].length === 0 ) {\n\t\t\t\tdelete result[ namespace ];\n\t\t\t}\n\t\t} );\n\n\t\treturn result;\n\t}, [ items, collections ] );\n\n\t// Hide block preview on unmount.\n\tuseEffect( () => () => onHover( null ), [] );\n\n\t/**\n\t * The inserter contains a big number of blocks and opening it is a costful operation.\n\t * The rendering is the most costful part of it, in order to improve the responsiveness\n\t * of the \"opening\" action, these lazy lists allow us to render the inserter category per category,\n\t * once all the categories are rendered, we start rendering the collections and the uncategorized block types.\n\t */\n\tconst currentlyRenderedCategories = useAsyncList( categories );\n\tconst didRenderAllCategories =\n\t\tcategories.length === currentlyRenderedCategories.length;\n\n\t// Async List requires an array.\n\tconst collectionEntries = useMemo( () => {\n\t\treturn Object.entries( collections );\n\t}, [ collections ] );\n\tconst currentlyRenderedCollections = useAsyncList(\n\t\tdidRenderAllCategories ? collectionEntries : EMPTY_ARRAY\n\t);\n\n\treturn (\n\t\t<InserterListbox>\n\t\t\t<div>\n\t\t\t\t{ showMostUsedBlocks && !! suggestedItems.length && (\n\t\t\t\t\t<InserterPanel title={ _x( 'Most used', 'blocks' ) }>\n\t\t\t\t\t\t<BlockTypesList\n\t\t\t\t\t\t\titems={ suggestedItems }\n\t\t\t\t\t\t\tonSelect={ onSelectItem }\n\t\t\t\t\t\t\tonHover={ onHover }\n\t\t\t\t\t\t\tlabel={ _x( 'Most used', 'blocks' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</InserterPanel>\n\t\t\t\t) }\n\n\t\t\t\t{ currentlyRenderedCategories.map( ( category ) => {\n\t\t\t\t\tconst categoryItems = itemsPerCategory[ category.slug ];\n\t\t\t\t\tif ( ! categoryItems || ! categoryItems.length ) {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<InserterPanel\n\t\t\t\t\t\t\tkey={ category.slug }\n\t\t\t\t\t\t\ttitle={ category.title }\n\t\t\t\t\t\t\ticon={ category.icon }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<BlockTypesList\n\t\t\t\t\t\t\t\titems={ categoryItems }\n\t\t\t\t\t\t\t\tonSelect={ onSelectItem }\n\t\t\t\t\t\t\t\tonHover={ onHover }\n\t\t\t\t\t\t\t\tlabel={ category.title }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</InserterPanel>\n\t\t\t\t\t);\n\t\t\t\t} ) }\n\n\t\t\t\t{ didRenderAllCategories && uncategorizedItems.length > 0 && (\n\t\t\t\t\t<InserterPanel\n\t\t\t\t\t\tclassName=\"block-editor-inserter__uncategorized-blocks-panel\"\n\t\t\t\t\t\ttitle={ __( 'Uncategorized' ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<BlockTypesList\n\t\t\t\t\t\t\titems={ uncategorizedItems }\n\t\t\t\t\t\t\tonSelect={ onSelectItem }\n\t\t\t\t\t\t\tonHover={ onHover }\n\t\t\t\t\t\t\tlabel={ __( 'Uncategorized' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</InserterPanel>\n\t\t\t\t) }\n\n\t\t\t\t{ currentlyRenderedCollections.map(\n\t\t\t\t\t( [ namespace, collection ] ) => {\n\t\t\t\t\t\tconst collectionItems = itemsPerCollection[ namespace ];\n\t\t\t\t\t\tif ( ! collectionItems || ! collectionItems.length ) {\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<InserterPanel\n\t\t\t\t\t\t\t\tkey={ namespace }\n\t\t\t\t\t\t\t\ttitle={ collection.title }\n\t\t\t\t\t\t\t\ticon={ collection.icon }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<BlockTypesList\n\t\t\t\t\t\t\t\t\titems={ collectionItems }\n\t\t\t\t\t\t\t\t\tonSelect={ onSelectItem }\n\t\t\t\t\t\t\t\t\tonHover={ onHover }\n\t\t\t\t\t\t\t\t\tlabel={ collection.title }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</InserterPanel>\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t) }\n\t\t\t</div>\n\t\t</InserterListbox>\n\t);\n}\n\nexport default BlockTypesTab;\n"]}