@wordpress/block-editor 14.5.0 → 14.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (541) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/README.md +0 -8
  3. package/build/autocompleters/block.js +13 -5
  4. package/build/autocompleters/block.js.map +1 -1
  5. package/build/components/block-canvas/index.js +10 -0
  6. package/build/components/block-canvas/index.js.map +1 -1
  7. package/build/components/block-card/index.js +2 -2
  8. package/build/components/block-card/index.js.map +1 -1
  9. package/build/components/block-full-height-alignment-control/index.js +1 -1
  10. package/build/components/block-full-height-alignment-control/index.js.map +1 -1
  11. package/build/components/block-list/block.js +15 -29
  12. package/build/components/block-list/block.js.map +1 -1
  13. package/build/components/block-list/block.native.js +1 -7
  14. package/build/components/block-list/block.native.js.map +1 -1
  15. package/build/components/block-list/index.js +5 -5
  16. package/build/components/block-list/index.js.map +1 -1
  17. package/build/components/block-list/use-block-props/index.js +1 -2
  18. package/build/components/block-list/use-block-props/index.js.map +1 -1
  19. package/build/components/block-list/use-block-props/use-focus-first-element.js +4 -3
  20. package/build/components/block-list/use-block-props/use-focus-first-element.js.map +1 -1
  21. package/build/components/block-list/use-block-props/use-selected-block-event-handlers.js +3 -6
  22. package/build/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +1 -1
  23. package/build/components/block-list/use-in-between-inserter.js +1 -1
  24. package/build/components/block-list/use-in-between-inserter.js.map +1 -1
  25. package/build/components/block-patterns-list/index.js +23 -26
  26. package/build/components/block-patterns-list/index.js.map +1 -1
  27. package/build/components/block-patterns-paging/index.js +1 -1
  28. package/build/components/block-patterns-paging/index.js.map +1 -1
  29. package/build/components/block-popover/index.js +3 -46
  30. package/build/components/block-popover/index.js.map +1 -1
  31. package/build/components/block-preview/async.js +51 -0
  32. package/build/components/block-preview/async.js.map +1 -0
  33. package/build/components/block-preview/index.js +6 -3
  34. package/build/components/block-preview/index.js.map +1 -1
  35. package/build/components/block-settings-menu/block-settings-dropdown.js +5 -0
  36. package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  37. package/build/components/block-settings-menu/index.js +4 -3
  38. package/build/components/block-settings-menu/index.js.map +1 -1
  39. package/build/components/block-toolbar/change-design.js +119 -0
  40. package/build/components/block-toolbar/change-design.js.map +1 -0
  41. package/build/components/block-toolbar/index.js +19 -7
  42. package/build/components/block-toolbar/index.js.map +1 -1
  43. package/build/components/block-tools/index.js +16 -19
  44. package/build/components/block-tools/index.js.map +1 -1
  45. package/build/components/block-tools/insertion-point.js +4 -3
  46. package/build/components/block-tools/insertion-point.js.map +1 -1
  47. package/build/components/block-tools/use-block-toolbar-popover-props.js +1 -1
  48. package/build/components/block-tools/use-block-toolbar-popover-props.js.map +1 -1
  49. package/build/components/block-tools/use-show-block-tools.js +7 -10
  50. package/build/components/block-tools/use-show-block-tools.js.map +1 -1
  51. package/build/components/block-tools/zoom-out-mode-inserters.js +20 -29
  52. package/build/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
  53. package/build/components/block-variation-transforms/index.js +2 -2
  54. package/build/components/block-variation-transforms/index.js.map +1 -1
  55. package/build/components/block-vertical-alignment-control/ui.js +6 -10
  56. package/build/components/block-vertical-alignment-control/ui.js.map +1 -1
  57. package/build/components/border-radius-control/linked-button.js +7 -10
  58. package/build/components/border-radius-control/linked-button.js.map +1 -1
  59. package/build/components/collab/block-comment-icon-slot.js +18 -0
  60. package/build/components/collab/block-comment-icon-slot.js.map +1 -0
  61. package/build/components/collab/block-comment-icon-toolbar-slot.js +18 -0
  62. package/build/components/collab/block-comment-icon-toolbar-slot.js.map +1 -0
  63. package/build/components/colors-gradients/use-multiple-origin-colors-and-gradients.js +7 -1
  64. package/build/components/colors-gradients/use-multiple-origin-colors-and-gradients.js.map +1 -1
  65. package/build/components/convert-to-group-buttons/toolbar.js +4 -4
  66. package/build/components/convert-to-group-buttons/toolbar.js.map +1 -1
  67. package/build/components/global-styles/color-panel.js +1 -4
  68. package/build/components/global-styles/color-panel.js.map +1 -1
  69. package/build/components/global-styles/dimensions-panel.js +26 -14
  70. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  71. package/build/components/global-styles/use-global-styles-context.native.js +6 -0
  72. package/build/components/global-styles/use-global-styles-context.native.js.map +1 -1
  73. package/build/components/iframe/get-compatibility-styles.js +4 -4
  74. package/build/components/iframe/get-compatibility-styles.js.map +1 -1
  75. package/build/components/iframe/index.js +33 -22
  76. package/build/components/iframe/index.js.map +1 -1
  77. package/build/components/image-size-control/index.js +61 -20
  78. package/build/components/image-size-control/index.js.map +1 -1
  79. package/build/components/inner-blocks/index.js +9 -5
  80. package/build/components/inner-blocks/index.js.map +1 -1
  81. package/build/components/inserter/block-patterns-explorer/pattern-list.js +2 -2
  82. package/build/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
  83. package/build/components/inserter/block-patterns-tab/index.js +1 -2
  84. package/build/components/inserter/block-patterns-tab/index.js.map +1 -1
  85. package/build/components/inserter/block-patterns-tab/pattern-category-previews.js +5 -3
  86. package/build/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
  87. package/build/components/inserter/block-patterns-tab/patterns-filter.js +1 -1
  88. package/build/components/inserter/block-patterns-tab/patterns-filter.js.map +1 -1
  89. package/build/components/inserter/block-patterns-tab/use-pattern-categories.js +3 -0
  90. package/build/components/inserter/block-patterns-tab/use-pattern-categories.js.map +1 -1
  91. package/build/components/inserter/block-patterns-tab/utils.js +5 -1
  92. package/build/components/inserter/block-patterns-tab/utils.js.map +1 -1
  93. package/build/components/inserter/category-tabs/index.js +15 -2
  94. package/build/components/inserter/category-tabs/index.js.map +1 -1
  95. package/build/components/inserter/hooks/use-block-types-state.js +1 -1
  96. package/build/components/inserter/hooks/use-block-types-state.js.map +1 -1
  97. package/build/components/inserter/hooks/use-patterns-paging.js +0 -5
  98. package/build/components/inserter/hooks/use-patterns-paging.js.map +1 -1
  99. package/build/components/inserter/menu.js +4 -2
  100. package/build/components/inserter/menu.js.map +1 -1
  101. package/build/components/inserter/search-results.js +0 -2
  102. package/build/components/inserter/search-results.js.map +1 -1
  103. package/build/components/inserter-button/index.native.js +1 -1
  104. package/build/components/inserter-button/index.native.js.map +1 -1
  105. package/build/components/inspector-controls-tabs/index.js +0 -2
  106. package/build/components/inspector-controls-tabs/index.js.map +1 -1
  107. package/build/components/inspector-controls-tabs/utils.js +3 -6
  108. package/build/components/inspector-controls-tabs/utils.js.map +1 -1
  109. package/build/components/link-control/link-preview.js +12 -9
  110. package/build/components/link-control/link-preview.js.map +1 -1
  111. package/build/components/list-view/appender.js +4 -3
  112. package/build/components/list-view/appender.js.map +1 -1
  113. package/build/components/list-view/branch.js +6 -5
  114. package/build/components/list-view/branch.js.map +1 -1
  115. package/build/components/list-view/index.js +1 -2
  116. package/build/components/list-view/index.js.map +1 -1
  117. package/build/components/media-placeholder/index.js +4 -4
  118. package/build/components/media-placeholder/index.js.map +1 -1
  119. package/build/components/provider/index.js +1 -1
  120. package/build/components/provider/index.js.map +1 -1
  121. package/build/components/rich-text/event-listeners/index.js +3 -1
  122. package/build/components/rich-text/event-listeners/index.js.map +1 -1
  123. package/build/components/rich-text/index.js +1 -1
  124. package/build/components/rich-text/index.js.map +1 -1
  125. package/build/components/rich-text/index.native.js +2 -6
  126. package/build/components/rich-text/index.native.js.map +1 -1
  127. package/build/components/spacing-sizes-control/index.js +2 -2
  128. package/build/components/spacing-sizes-control/index.js.map +1 -1
  129. package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js +3 -3
  130. package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
  131. package/build/components/spacing-sizes-control/linked-button.js +1 -5
  132. package/build/components/spacing-sizes-control/linked-button.js.map +1 -1
  133. package/build/components/tabbed-sidebar/index.js +1 -1
  134. package/build/components/tabbed-sidebar/index.js.map +1 -1
  135. package/build/components/tool-selector/index.js +1 -4
  136. package/build/components/tool-selector/index.js.map +1 -1
  137. package/build/components/url-input/index.js +4 -2
  138. package/build/components/url-input/index.js.map +1 -1
  139. package/build/components/use-block-commands/index.js +6 -7
  140. package/build/components/use-block-commands/index.js.map +1 -1
  141. package/build/components/use-block-drop-zone/index.js +5 -5
  142. package/build/components/use-block-drop-zone/index.js.map +1 -1
  143. package/build/components/use-block-drop-zone/index.native.js +0 -1
  144. package/build/components/use-block-drop-zone/index.native.js.map +1 -1
  145. package/build/components/use-moving-animation/index.js +1 -3
  146. package/build/components/use-moving-animation/index.js.map +1 -1
  147. package/build/components/use-settings/index.js +1 -3
  148. package/build/components/use-settings/index.js.map +1 -1
  149. package/build/components/writing-flow/index.js +5 -3
  150. package/build/components/writing-flow/index.js.map +1 -1
  151. package/build/components/writing-flow/use-tab-nav.js +2 -3
  152. package/build/components/writing-flow/use-tab-nav.js.map +1 -1
  153. package/build/hooks/block-bindings.js +19 -8
  154. package/build/hooks/block-bindings.js.map +1 -1
  155. package/build/hooks/contrast-checker.js +0 -1
  156. package/build/hooks/contrast-checker.js.map +1 -1
  157. package/build/hooks/duotone.js +2 -2
  158. package/build/hooks/duotone.js.map +1 -1
  159. package/build/hooks/font-family.js +1 -1
  160. package/build/hooks/font-family.js.map +1 -1
  161. package/build/hooks/style.js +4 -1
  162. package/build/hooks/style.js.map +1 -1
  163. package/build/hooks/supports.js +6 -6
  164. package/build/hooks/supports.js.map +1 -1
  165. package/build/hooks/typography.js +5 -5
  166. package/build/hooks/typography.js.map +1 -1
  167. package/build/hooks/use-zoom-out.js +13 -22
  168. package/build/hooks/use-zoom-out.js.map +1 -1
  169. package/build/hooks/utils.js +2 -2
  170. package/build/hooks/utils.js.map +1 -1
  171. package/build/index.js +0 -7
  172. package/build/index.js.map +1 -1
  173. package/build/lock-unlock.js.map +1 -1
  174. package/build/private-apis.js +6 -3
  175. package/build/private-apis.js.map +1 -1
  176. package/build/store/actions.js +2 -33
  177. package/build/store/actions.js.map +1 -1
  178. package/build/store/defaults.js +1 -1
  179. package/build/store/defaults.js.map +1 -1
  180. package/build/store/private-actions.js +57 -8
  181. package/build/store/private-actions.js.map +1 -1
  182. package/build/store/private-selectors.js +10 -22
  183. package/build/store/private-selectors.js.map +1 -1
  184. package/build/store/reducer.js +16 -6
  185. package/build/store/reducer.js.map +1 -1
  186. package/build/store/selectors.js +53 -15
  187. package/build/store/selectors.js.map +1 -1
  188. package/build/store/utils.js +5 -4
  189. package/build/store/utils.js.map +1 -1
  190. package/build/utils/dom.js +37 -17
  191. package/build/utils/dom.js.map +1 -1
  192. package/build/utils/get-font-styles-and-weights.js +1 -1
  193. package/build/utils/get-font-styles-and-weights.js.map +1 -1
  194. package/build/utils/transform-styles/index.js +4 -3
  195. package/build/utils/transform-styles/index.js.map +1 -1
  196. package/build-module/autocompleters/block.js +14 -6
  197. package/build-module/autocompleters/block.js.map +1 -1
  198. package/build-module/components/block-canvas/index.js +11 -1
  199. package/build-module/components/block-canvas/index.js.map +1 -1
  200. package/build-module/components/block-card/index.js +3 -3
  201. package/build-module/components/block-card/index.js.map +1 -1
  202. package/build-module/components/block-full-height-alignment-control/index.js +1 -1
  203. package/build-module/components/block-full-height-alignment-control/index.js.map +1 -1
  204. package/build-module/components/block-list/block.js +16 -28
  205. package/build-module/components/block-list/block.js.map +1 -1
  206. package/build-module/components/block-list/block.native.js +1 -7
  207. package/build-module/components/block-list/block.native.js.map +1 -1
  208. package/build-module/components/block-list/index.js +5 -5
  209. package/build-module/components/block-list/index.js.map +1 -1
  210. package/build-module/components/block-list/use-block-props/index.js +1 -2
  211. package/build-module/components/block-list/use-block-props/index.js.map +1 -1
  212. package/build-module/components/block-list/use-block-props/use-focus-first-element.js +4 -3
  213. package/build-module/components/block-list/use-block-props/use-focus-first-element.js.map +1 -1
  214. package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js +3 -6
  215. package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +1 -1
  216. package/build-module/components/block-list/use-in-between-inserter.js +1 -1
  217. package/build-module/components/block-list/use-in-between-inserter.js.map +1 -1
  218. package/build-module/components/block-patterns-list/index.js +23 -26
  219. package/build-module/components/block-patterns-list/index.js.map +1 -1
  220. package/build-module/components/block-patterns-paging/index.js +1 -1
  221. package/build-module/components/block-patterns-paging/index.js.map +1 -1
  222. package/build-module/components/block-popover/index.js +4 -47
  223. package/build-module/components/block-popover/index.js.map +1 -1
  224. package/build-module/components/block-preview/async.js +44 -0
  225. package/build-module/components/block-preview/async.js.map +1 -0
  226. package/build-module/components/block-preview/index.js +6 -3
  227. package/build-module/components/block-preview/index.js.map +1 -1
  228. package/build-module/components/block-settings-menu/block-settings-dropdown.js +5 -0
  229. package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  230. package/build-module/components/block-settings-menu/index.js +5 -4
  231. package/build-module/components/block-settings-menu/index.js.map +1 -1
  232. package/build-module/components/block-toolbar/change-design.js +111 -0
  233. package/build-module/components/block-toolbar/change-design.js.map +1 -0
  234. package/build-module/components/block-toolbar/index.js +19 -7
  235. package/build-module/components/block-toolbar/index.js.map +1 -1
  236. package/build-module/components/block-tools/index.js +17 -20
  237. package/build-module/components/block-tools/index.js.map +1 -1
  238. package/build-module/components/block-tools/insertion-point.js +4 -3
  239. package/build-module/components/block-tools/insertion-point.js.map +1 -1
  240. package/build-module/components/block-tools/use-block-toolbar-popover-props.js +2 -2
  241. package/build-module/components/block-tools/use-block-toolbar-popover-props.js.map +1 -1
  242. package/build-module/components/block-tools/use-show-block-tools.js +7 -10
  243. package/build-module/components/block-tools/use-show-block-tools.js.map +1 -1
  244. package/build-module/components/block-tools/zoom-out-mode-inserters.js +20 -29
  245. package/build-module/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
  246. package/build-module/components/block-variation-transforms/index.js +2 -2
  247. package/build-module/components/block-variation-transforms/index.js.map +1 -1
  248. package/build-module/components/block-vertical-alignment-control/ui.js +6 -10
  249. package/build-module/components/block-vertical-alignment-control/ui.js.map +1 -1
  250. package/build-module/components/border-radius-control/linked-button.js +8 -11
  251. package/build-module/components/border-radius-control/linked-button.js.map +1 -1
  252. package/build-module/components/collab/block-comment-icon-slot.js +11 -0
  253. package/build-module/components/collab/block-comment-icon-slot.js.map +1 -0
  254. package/build-module/components/collab/block-comment-icon-toolbar-slot.js +11 -0
  255. package/build-module/components/collab/block-comment-icon-toolbar-slot.js.map +1 -0
  256. package/build-module/components/colors-gradients/use-multiple-origin-colors-and-gradients.js +7 -1
  257. package/build-module/components/colors-gradients/use-multiple-origin-colors-and-gradients.js.map +1 -1
  258. package/build-module/components/convert-to-group-buttons/toolbar.js +4 -4
  259. package/build-module/components/convert-to-group-buttons/toolbar.js.map +1 -1
  260. package/build-module/components/global-styles/color-panel.js +2 -5
  261. package/build-module/components/global-styles/color-panel.js.map +1 -1
  262. package/build-module/components/global-styles/dimensions-panel.js +26 -14
  263. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  264. package/build-module/components/global-styles/use-global-styles-context.native.js +6 -0
  265. package/build-module/components/global-styles/use-global-styles-context.native.js.map +1 -1
  266. package/build-module/components/iframe/get-compatibility-styles.js +4 -4
  267. package/build-module/components/iframe/get-compatibility-styles.js.map +1 -1
  268. package/build-module/components/iframe/index.js +33 -22
  269. package/build-module/components/iframe/index.js.map +1 -1
  270. package/build-module/components/image-size-control/index.js +62 -21
  271. package/build-module/components/image-size-control/index.js.map +1 -1
  272. package/build-module/components/inner-blocks/index.js +9 -5
  273. package/build-module/components/inner-blocks/index.js.map +1 -1
  274. package/build-module/components/inserter/block-patterns-explorer/pattern-list.js +2 -2
  275. package/build-module/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
  276. package/build-module/components/inserter/block-patterns-tab/index.js +1 -2
  277. package/build-module/components/inserter/block-patterns-tab/index.js.map +1 -1
  278. package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js +6 -4
  279. package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
  280. package/build-module/components/inserter/block-patterns-tab/patterns-filter.js +1 -1
  281. package/build-module/components/inserter/block-patterns-tab/patterns-filter.js.map +1 -1
  282. package/build-module/components/inserter/block-patterns-tab/use-pattern-categories.js +4 -1
  283. package/build-module/components/inserter/block-patterns-tab/use-pattern-categories.js.map +1 -1
  284. package/build-module/components/inserter/block-patterns-tab/utils.js +4 -0
  285. package/build-module/components/inserter/block-patterns-tab/utils.js.map +1 -1
  286. package/build-module/components/inserter/category-tabs/index.js +15 -2
  287. package/build-module/components/inserter/category-tabs/index.js.map +1 -1
  288. package/build-module/components/inserter/hooks/use-block-types-state.js +1 -1
  289. package/build-module/components/inserter/hooks/use-block-types-state.js.map +1 -1
  290. package/build-module/components/inserter/hooks/use-patterns-paging.js +1 -6
  291. package/build-module/components/inserter/hooks/use-patterns-paging.js.map +1 -1
  292. package/build-module/components/inserter/menu.js +5 -3
  293. package/build-module/components/inserter/menu.js.map +1 -1
  294. package/build-module/components/inserter/search-results.js +0 -2
  295. package/build-module/components/inserter/search-results.js.map +1 -1
  296. package/build-module/components/inserter-button/index.native.js +1 -1
  297. package/build-module/components/inserter-button/index.native.js.map +1 -1
  298. package/build-module/components/inspector-controls-tabs/index.js +0 -2
  299. package/build-module/components/inspector-controls-tabs/index.js.map +1 -1
  300. package/build-module/components/inspector-controls-tabs/utils.js +3 -6
  301. package/build-module/components/inspector-controls-tabs/utils.js.map +1 -1
  302. package/build-module/components/link-control/link-preview.js +13 -10
  303. package/build-module/components/link-control/link-preview.js.map +1 -1
  304. package/build-module/components/list-view/appender.js +4 -3
  305. package/build-module/components/list-view/appender.js.map +1 -1
  306. package/build-module/components/list-view/branch.js +7 -6
  307. package/build-module/components/list-view/branch.js.map +1 -1
  308. package/build-module/components/list-view/index.js +1 -2
  309. package/build-module/components/list-view/index.js.map +1 -1
  310. package/build-module/components/media-placeholder/index.js +4 -4
  311. package/build-module/components/media-placeholder/index.js.map +1 -1
  312. package/build-module/components/provider/index.js +1 -1
  313. package/build-module/components/provider/index.js.map +1 -1
  314. package/build-module/components/rich-text/event-listeners/index.js +4 -2
  315. package/build-module/components/rich-text/event-listeners/index.js.map +1 -1
  316. package/build-module/components/rich-text/index.js +1 -1
  317. package/build-module/components/rich-text/index.js.map +1 -1
  318. package/build-module/components/rich-text/index.native.js +2 -6
  319. package/build-module/components/rich-text/index.native.js.map +1 -1
  320. package/build-module/components/spacing-sizes-control/index.js +3 -3
  321. package/build-module/components/spacing-sizes-control/index.js.map +1 -1
  322. package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js +4 -4
  323. package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
  324. package/build-module/components/spacing-sizes-control/linked-button.js +2 -6
  325. package/build-module/components/spacing-sizes-control/linked-button.js.map +1 -1
  326. package/build-module/components/tabbed-sidebar/index.js +1 -1
  327. package/build-module/components/tabbed-sidebar/index.js.map +1 -1
  328. package/build-module/components/tool-selector/index.js +1 -4
  329. package/build-module/components/tool-selector/index.js.map +1 -1
  330. package/build-module/components/url-input/index.js +4 -2
  331. package/build-module/components/url-input/index.js.map +1 -1
  332. package/build-module/components/use-block-commands/index.js +5 -5
  333. package/build-module/components/use-block-commands/index.js.map +1 -1
  334. package/build-module/components/use-block-drop-zone/index.js +5 -5
  335. package/build-module/components/use-block-drop-zone/index.js.map +1 -1
  336. package/build-module/components/use-block-drop-zone/index.native.js +0 -1
  337. package/build-module/components/use-block-drop-zone/index.native.js.map +1 -1
  338. package/build-module/components/use-moving-animation/index.js +1 -3
  339. package/build-module/components/use-moving-animation/index.js.map +1 -1
  340. package/build-module/components/use-settings/index.js +1 -3
  341. package/build-module/components/use-settings/index.js.map +1 -1
  342. package/build-module/components/writing-flow/index.js +5 -3
  343. package/build-module/components/writing-flow/index.js.map +1 -1
  344. package/build-module/components/writing-flow/use-tab-nav.js +2 -3
  345. package/build-module/components/writing-flow/use-tab-nav.js.map +1 -1
  346. package/build-module/hooks/block-bindings.js +20 -9
  347. package/build-module/hooks/block-bindings.js.map +1 -1
  348. package/build-module/hooks/contrast-checker.js +0 -1
  349. package/build-module/hooks/contrast-checker.js.map +1 -1
  350. package/build-module/hooks/duotone.js +2 -2
  351. package/build-module/hooks/duotone.js.map +1 -1
  352. package/build-module/hooks/font-family.js +1 -1
  353. package/build-module/hooks/font-family.js.map +1 -1
  354. package/build-module/hooks/style.js +4 -1
  355. package/build-module/hooks/style.js.map +1 -1
  356. package/build-module/hooks/supports.js +6 -6
  357. package/build-module/hooks/supports.js.map +1 -1
  358. package/build-module/hooks/typography.js +5 -5
  359. package/build-module/hooks/typography.js.map +1 -1
  360. package/build-module/hooks/use-zoom-out.js +15 -23
  361. package/build-module/hooks/use-zoom-out.js.map +1 -1
  362. package/build-module/hooks/utils.js +2 -2
  363. package/build-module/hooks/utils.js.map +1 -1
  364. package/build-module/index.js +1 -1
  365. package/build-module/index.js.map +1 -1
  366. package/build-module/lock-unlock.js.map +1 -1
  367. package/build-module/private-apis.js +7 -5
  368. package/build-module/private-apis.js.map +1 -1
  369. package/build-module/store/actions.js +2 -33
  370. package/build-module/store/actions.js.map +1 -1
  371. package/build-module/store/defaults.js +1 -1
  372. package/build-module/store/defaults.js.map +1 -1
  373. package/build-module/store/private-actions.js +54 -7
  374. package/build-module/store/private-actions.js.map +1 -1
  375. package/build-module/store/private-selectors.js +10 -21
  376. package/build-module/store/private-selectors.js.map +1 -1
  377. package/build-module/store/reducer.js +16 -6
  378. package/build-module/store/reducer.js.map +1 -1
  379. package/build-module/store/selectors.js +54 -16
  380. package/build-module/store/selectors.js.map +1 -1
  381. package/build-module/store/utils.js +3 -3
  382. package/build-module/store/utils.js.map +1 -1
  383. package/build-module/utils/dom.js +35 -16
  384. package/build-module/utils/dom.js.map +1 -1
  385. package/build-module/utils/get-font-styles-and-weights.js +2 -2
  386. package/build-module/utils/get-font-styles-and-weights.js.map +1 -1
  387. package/build-module/utils/transform-styles/index.js +3 -2
  388. package/build-module/utils/transform-styles/index.js.map +1 -1
  389. package/build-style/content-rtl.css +16 -10
  390. package/build-style/content.css +16 -10
  391. package/build-style/style-rtl.css +47 -25
  392. package/build-style/style.css +47 -25
  393. package/build-types/utils/dom.d.ts +7 -9
  394. package/build-types/utils/dom.d.ts.map +1 -1
  395. package/package.json +34 -32
  396. package/src/autocompleters/block.js +16 -7
  397. package/src/components/block-canvas/index.js +17 -1
  398. package/src/components/block-canvas/style.scss +3 -1
  399. package/src/components/block-card/index.js +3 -3
  400. package/src/components/block-full-height-alignment-control/index.js +1 -1
  401. package/src/components/block-inspector/style.scss +2 -7
  402. package/src/components/block-list/block.js +29 -50
  403. package/src/components/block-list/block.native.js +0 -4
  404. package/src/components/block-list/content.scss +1 -1
  405. package/src/components/block-list/index.js +4 -4
  406. package/src/components/block-list/use-block-props/index.js +0 -2
  407. package/src/components/block-list/use-block-props/use-focus-first-element.js +5 -3
  408. package/src/components/block-list/use-block-props/use-selected-block-event-handlers.js +7 -20
  409. package/src/components/block-list/use-in-between-inserter.js +1 -1
  410. package/src/components/block-patterns-list/README.md +8 -8
  411. package/src/components/block-patterns-list/index.js +35 -51
  412. package/src/components/block-patterns-list/stories/fixtures.js +834 -0
  413. package/src/components/block-patterns-list/stories/index.story.js +64 -0
  414. package/src/components/block-patterns-list/style.scss +2 -0
  415. package/src/components/block-patterns-paging/index.js +1 -1
  416. package/src/components/block-popover/index.js +4 -66
  417. package/src/components/block-preview/async.js +43 -0
  418. package/src/components/block-preview/index.js +8 -3
  419. package/src/components/block-settings-menu/block-settings-dropdown.js +4 -0
  420. package/src/components/block-settings-menu/index.js +3 -0
  421. package/src/components/block-toolbar/change-design.js +127 -0
  422. package/src/components/block-toolbar/index.js +25 -8
  423. package/src/components/block-toolbar/style.scss +16 -0
  424. package/src/components/block-tools/index.js +30 -27
  425. package/src/components/block-tools/insertion-point.js +4 -3
  426. package/src/components/block-tools/style.scss +12 -20
  427. package/src/components/block-tools/use-block-toolbar-popover-props.js +2 -2
  428. package/src/components/block-tools/use-show-block-tools.js +3 -14
  429. package/src/components/block-tools/zoom-out-mode-inserters.js +25 -40
  430. package/src/components/block-variation-transforms/index.js +2 -2
  431. package/src/components/block-vertical-alignment-control/ui.js +11 -15
  432. package/src/components/border-radius-control/linked-button.js +9 -11
  433. package/src/components/collab/block-comment-icon-slot.js +12 -0
  434. package/src/components/collab/block-comment-icon-toolbar-slot.js +12 -0
  435. package/src/components/colors-gradients/use-multiple-origin-colors-and-gradients.js +7 -1
  436. package/src/components/convert-to-group-buttons/toolbar.js +4 -4
  437. package/src/components/default-block-appender/content.scss +13 -19
  438. package/src/components/global-styles/color-panel.js +2 -10
  439. package/src/components/global-styles/dimensions-panel.js +22 -16
  440. package/src/components/global-styles/test/use-global-styles-context.native.js +1 -0
  441. package/src/components/global-styles/use-global-styles-context.native.js +6 -0
  442. package/src/components/iframe/content.scss +4 -9
  443. package/src/components/iframe/get-compatibility-styles.js +4 -9
  444. package/src/components/iframe/index.js +48 -34
  445. package/src/components/iframe/style.scss +2 -3
  446. package/src/components/image-size-control/index.js +74 -43
  447. package/src/components/image-size-control/test/index.js +5 -63
  448. package/src/components/inner-blocks/index.js +12 -6
  449. package/src/components/inserter/block-patterns-explorer/pattern-list.js +3 -6
  450. package/src/components/inserter/block-patterns-tab/index.js +0 -1
  451. package/src/components/inserter/block-patterns-tab/pattern-category-previews.js +10 -4
  452. package/src/components/inserter/block-patterns-tab/patterns-filter.js +1 -1
  453. package/src/components/inserter/block-patterns-tab/use-pattern-categories.js +8 -0
  454. package/src/components/inserter/block-patterns-tab/utils.js +5 -0
  455. package/src/components/inserter/category-tabs/index.js +16 -2
  456. package/src/components/inserter/hooks/use-block-types-state.js +6 -1
  457. package/src/components/inserter/hooks/use-patterns-paging.js +1 -6
  458. package/src/components/inserter/menu.js +6 -4
  459. package/src/components/inserter/search-results.js +0 -6
  460. package/src/components/inserter/style.scss +13 -0
  461. package/src/components/inserter-button/index.native.js +1 -1
  462. package/src/components/inspector-controls-tabs/index.js +1 -6
  463. package/src/components/inspector-controls-tabs/utils.js +0 -3
  464. package/src/components/link-control/link-preview.js +15 -8
  465. package/src/components/link-control/test/index.js +63 -24
  466. package/src/components/list-view/appender.js +5 -6
  467. package/src/components/list-view/branch.js +8 -6
  468. package/src/components/list-view/index.js +1 -2
  469. package/src/components/media-placeholder/index.js +4 -4
  470. package/src/components/provider/index.js +1 -3
  471. package/src/components/provider/test/experimental-provider.js +43 -1
  472. package/src/components/rich-text/event-listeners/index.js +4 -2
  473. package/src/components/rich-text/index.js +8 -1
  474. package/src/components/rich-text/index.native.js +0 -2
  475. package/src/components/spacing-sizes-control/index.js +3 -3
  476. package/src/components/spacing-sizes-control/input-controls/spacing-input-control.js +4 -4
  477. package/src/components/spacing-sizes-control/linked-button.js +2 -12
  478. package/src/components/tabbed-sidebar/index.js +1 -1
  479. package/src/components/tabbed-sidebar/style.scss +1 -1
  480. package/src/components/tool-selector/index.js +1 -5
  481. package/src/components/url-input/index.js +4 -5
  482. package/src/components/use-block-commands/index.js +245 -234
  483. package/src/components/use-block-drop-zone/index.js +5 -5
  484. package/src/components/use-block-drop-zone/index.native.js +0 -1
  485. package/src/components/use-moving-animation/index.js +0 -1
  486. package/src/components/use-settings/index.js +0 -1
  487. package/src/components/writing-flow/index.js +5 -3
  488. package/src/components/writing-flow/use-tab-nav.js +1 -2
  489. package/src/hooks/block-bindings.js +48 -31
  490. package/src/hooks/contrast-checker.js +0 -1
  491. package/src/hooks/duotone.js +2 -2
  492. package/src/hooks/font-family.js +1 -1
  493. package/src/hooks/style.js +7 -3
  494. package/src/hooks/supports.js +6 -6
  495. package/src/hooks/typography.js +5 -5
  496. package/src/hooks/use-zoom-out.js +14 -34
  497. package/src/hooks/utils.js +7 -2
  498. package/src/index.js +0 -1
  499. package/src/private-apis.js +6 -3
  500. package/src/store/actions.js +3 -52
  501. package/src/store/defaults.js +2 -1
  502. package/src/store/private-actions.js +71 -8
  503. package/src/store/private-selectors.js +14 -25
  504. package/src/store/reducer.js +25 -11
  505. package/src/store/selectors.js +116 -53
  506. package/src/store/test/actions.js +41 -0
  507. package/src/store/test/private-selectors.js +5 -0
  508. package/src/store/test/reducer.js +23 -0
  509. package/src/store/utils.js +12 -11
  510. package/src/utils/dom.js +42 -17
  511. package/src/utils/get-font-styles-and-weights.js +2 -2
  512. package/src/utils/test/dom.js +224 -0
  513. package/src/utils/transform-styles/index.js +3 -2
  514. package/tsconfig.json +1 -0
  515. package/tsconfig.tsbuildinfo +1 -1
  516. package/build/components/block-list/use-block-props/use-zoom-out-mode-exit.js +0 -57
  517. package/build/components/block-list/use-block-props/use-zoom-out-mode-exit.js.map +0 -1
  518. package/build/components/block-toolbar/shuffle.js +0 -110
  519. package/build/components/block-toolbar/shuffle.js.map +0 -1
  520. package/build/components/block-tools/zoom-out-popover.js +0 -58
  521. package/build/components/block-tools/zoom-out-popover.js.map +0 -1
  522. package/build/components/block-tools/zoom-out-toolbar.js +0 -132
  523. package/build/components/block-tools/zoom-out-toolbar.js.map +0 -1
  524. package/build/components/block-vertical-alignment-control/icons.js +0 -48
  525. package/build/components/block-vertical-alignment-control/icons.js.map +0 -1
  526. package/build-module/components/block-list/use-block-props/use-zoom-out-mode-exit.js +0 -51
  527. package/build-module/components/block-list/use-block-props/use-zoom-out-mode-exit.js.map +0 -1
  528. package/build-module/components/block-toolbar/shuffle.js +0 -103
  529. package/build-module/components/block-toolbar/shuffle.js.map +0 -1
  530. package/build-module/components/block-tools/zoom-out-popover.js +0 -49
  531. package/build-module/components/block-tools/zoom-out-popover.js.map +0 -1
  532. package/build-module/components/block-tools/zoom-out-toolbar.js +0 -124
  533. package/build-module/components/block-tools/zoom-out-toolbar.js.map +0 -1
  534. package/build-module/components/block-vertical-alignment-control/icons.js +0 -41
  535. package/build-module/components/block-vertical-alignment-control/icons.js.map +0 -1
  536. package/src/components/block-list/use-block-props/use-zoom-out-mode-exit.js +0 -65
  537. package/src/components/block-toolbar/shuffle.js +0 -111
  538. package/src/components/block-tools/zoom-out-popover.js +0 -47
  539. package/src/components/block-tools/zoom-out-toolbar.js +0 -135
  540. package/src/components/block-vertical-alignment-control/icons.js +0 -34
  541. /package/src/{lock-unlock.js → lock-unlock.ts} +0 -0
@@ -1 +1 @@
1
- {"version":3,"names":["clsx","useState","createPortal","forwardRef","useMemo","useEffect","useRef","__","useResizeObserver","useMergeRefs","useRefEffect","useDisabled","__experimentalStyleProvider","StyleProvider","useSelect","useBlockSelectionClearer","useWritingFlow","getCompatibilityStyles","store","blockEditorStore","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","bubbleEvent","event","Constructor","frame","init","key","contentDocument","defaultView","MouseEvent","rect","getBoundingClientRect","clientX","left","clientY","top","newEvent","type","defaultPrevented","preventDefault","cancelled","dispatchEvent","useBubbleEvents","iframeDocument","frameElement","html","documentElement","eventTypes","handlers","name","prototype","Object","getPrototypeOf","constructorName","constructor","window","addEventListener","removeEventListener","Iframe","contentRef","children","tabIndex","scale","frameSize","readonly","forwardedRef","ref","title","props","resolvedAssets","isPreviewMode","select","getSettings","settings","__unstableResolvedAssets","__unstableIsPreviewMode","styles","scripts","setIframeDocument","initialContainerWidth","bodyClasses","setBodyClasses","clearerRef","before","writingFlowRef","after","contentResizeListener","height","contentHeight","containerResizeListener","width","containerWidth","setRef","node","_load","iFrameDocument","preventFileDropDefault","onLoad","ownerDocument","classList","add","Array","from","body","filter","startsWith","dir","compatStyle","getElementById","id","head","appendChild","cloneNode","console","warn","iframeWindowInnerHeight","setIframeWindowInnerHeight","iframeResizeRef","nodeWindow","innerHeight","onResize","windowInnerWidth","setWindowInnerWidth","windowResizeRef","innerWidth","isZoomedOut","current","disabledRef","isDisabled","bodyRef","src","cleanup","_src","URL","createObjectURL","Blob","revokeObjectURL","zoomOutAnimationClassnameRef","handleZoomOutAnimationClassname","clearTimeout","setTimeout","remove","maxWidth","style","setProperty","Math","min","parseInt","max","removeProperty","shouldRenderFocusCaptureElements","iframe","border","onKeyDown","currentTarget","target","stopPropagation","nativeEvent","KeyboardEvent","className","document","IframeIfReady","isInitialised","__internalIsInitialized"],"sources":["@wordpress/block-editor/src/components/iframe/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseState,\n\tcreatePortal,\n\tforwardRef,\n\tuseMemo,\n\tuseEffect,\n\tuseRef,\n} from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tuseResizeObserver,\n\tuseMergeRefs,\n\tuseRefEffect,\n\tuseDisabled,\n} from '@wordpress/compose';\nimport { __experimentalStyleProvider as StyleProvider } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { useBlockSelectionClearer } from '../block-selection-clearer';\nimport { useWritingFlow } from '../writing-flow';\nimport { getCompatibilityStyles } from './get-compatibility-styles';\nimport { store as blockEditorStore } from '../../store';\n\nfunction bubbleEvent( event, Constructor, frame ) {\n\tconst init = {};\n\n\tfor ( const key in event ) {\n\t\tinit[ key ] = event[ key ];\n\t}\n\n\t// Check if the event is a MouseEvent generated within the iframe.\n\t// If so, adjust the coordinates to be relative to the position of\n\t// the iframe. This ensures that components such as Draggable\n\t// receive coordinates relative to the window, instead of relative\n\t// to the iframe. Without this, the Draggable event handler would\n\t// result in components \"jumping\" position as soon as the user\n\t// drags over the iframe.\n\tif ( event instanceof frame.contentDocument.defaultView.MouseEvent ) {\n\t\tconst rect = frame.getBoundingClientRect();\n\t\tinit.clientX += rect.left;\n\t\tinit.clientY += rect.top;\n\t}\n\n\tconst newEvent = new Constructor( event.type, init );\n\tif ( init.defaultPrevented ) {\n\t\tnewEvent.preventDefault();\n\t}\n\tconst cancelled = ! frame.dispatchEvent( newEvent );\n\n\tif ( cancelled ) {\n\t\tevent.preventDefault();\n\t}\n}\n\n/**\n * Bubbles some event types (keydown, keypress, and dragover) to parent document\n * document to ensure that the keyboard shortcuts and drag and drop work.\n *\n * Ideally, we should remove event bubbling in the future. Keyboard shortcuts\n * should be context dependent, e.g. actions on blocks like Cmd+A should not\n * work globally outside the block editor.\n *\n * @param {Document} iframeDocument Document to attach listeners to.\n */\nfunction useBubbleEvents( iframeDocument ) {\n\treturn useRefEffect( () => {\n\t\tconst { defaultView } = iframeDocument;\n\t\tif ( ! defaultView ) {\n\t\t\treturn;\n\t\t}\n\t\tconst { frameElement } = defaultView;\n\t\tconst html = iframeDocument.documentElement;\n\t\tconst eventTypes = [ 'dragover', 'mousemove' ];\n\t\tconst handlers = {};\n\t\tfor ( const name of eventTypes ) {\n\t\t\thandlers[ name ] = ( event ) => {\n\t\t\t\tconst prototype = Object.getPrototypeOf( event );\n\t\t\t\tconst constructorName = prototype.constructor.name;\n\t\t\t\tconst Constructor = window[ constructorName ];\n\t\t\t\tbubbleEvent( event, Constructor, frameElement );\n\t\t\t};\n\t\t\thtml.addEventListener( name, handlers[ name ] );\n\t\t}\n\n\t\treturn () => {\n\t\t\tfor ( const name of eventTypes ) {\n\t\t\t\thtml.removeEventListener( name, handlers[ name ] );\n\t\t\t}\n\t\t};\n\t} );\n}\n\nfunction Iframe( {\n\tcontentRef,\n\tchildren,\n\ttabIndex = 0,\n\tscale = 1,\n\tframeSize = 0,\n\treadonly,\n\tforwardedRef: ref,\n\ttitle = __( 'Editor canvas' ),\n\t...props\n} ) {\n\tconst { resolvedAssets, isPreviewMode } = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\tconst settings = getSettings();\n\t\treturn {\n\t\t\tresolvedAssets: settings.__unstableResolvedAssets,\n\t\t\tisPreviewMode: settings.__unstableIsPreviewMode,\n\t\t};\n\t}, [] );\n\tconst { styles = '', scripts = '' } = resolvedAssets;\n\tconst [ iframeDocument, setIframeDocument ] = useState();\n\tconst initialContainerWidth = useRef();\n\tconst [ bodyClasses, setBodyClasses ] = useState( [] );\n\tconst clearerRef = useBlockSelectionClearer();\n\tconst [ before, writingFlowRef, after ] = useWritingFlow();\n\tconst [ contentResizeListener, { height: contentHeight } ] =\n\t\tuseResizeObserver();\n\tconst [ containerResizeListener, { width: containerWidth } ] =\n\t\tuseResizeObserver();\n\n\tconst setRef = useRefEffect( ( node ) => {\n\t\tnode._load = () => {\n\t\t\tsetIframeDocument( node.contentDocument );\n\t\t};\n\t\tlet iFrameDocument;\n\t\t// Prevent the default browser action for files dropped outside of dropzones.\n\t\tfunction preventFileDropDefault( event ) {\n\t\t\tevent.preventDefault();\n\t\t}\n\t\tfunction onLoad() {\n\t\t\tconst { contentDocument, ownerDocument } = node;\n\t\t\tconst { documentElement } = contentDocument;\n\t\t\tiFrameDocument = contentDocument;\n\n\t\t\tdocumentElement.classList.add( 'block-editor-iframe__html' );\n\n\t\t\tclearerRef( documentElement );\n\n\t\t\t// Ideally ALL classes that are added through get_body_class should\n\t\t\t// be added in the editor too, which we'll somehow have to get from\n\t\t\t// the server in the future (which will run the PHP filters).\n\t\t\tsetBodyClasses(\n\t\t\t\tArray.from( ownerDocument.body.classList ).filter(\n\t\t\t\t\t( name ) =>\n\t\t\t\t\t\tname.startsWith( 'admin-color-' ) ||\n\t\t\t\t\t\tname.startsWith( 'post-type-' ) ||\n\t\t\t\t\t\tname === 'wp-embed-responsive'\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tcontentDocument.dir = ownerDocument.dir;\n\n\t\t\tfor ( const compatStyle of getCompatibilityStyles() ) {\n\t\t\t\tif ( contentDocument.getElementById( compatStyle.id ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tcontentDocument.head.appendChild(\n\t\t\t\t\tcompatStyle.cloneNode( true )\n\t\t\t\t);\n\n\t\t\t\tif ( ! isPreviewMode ) {\n\t\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\t\tconsole.warn(\n\t\t\t\t\t\t`${ compatStyle.id } was added to the iframe incorrectly. Please use block.json or enqueue_block_assets to add styles to the iframe.`,\n\t\t\t\t\t\tcompatStyle\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tiFrameDocument.addEventListener(\n\t\t\t\t'dragover',\n\t\t\t\tpreventFileDropDefault,\n\t\t\t\tfalse\n\t\t\t);\n\t\t\tiFrameDocument.addEventListener(\n\t\t\t\t'drop',\n\t\t\t\tpreventFileDropDefault,\n\t\t\t\tfalse\n\t\t\t);\n\t\t}\n\n\t\tnode.addEventListener( 'load', onLoad );\n\n\t\treturn () => {\n\t\t\tdelete node._load;\n\t\t\tnode.removeEventListener( 'load', onLoad );\n\t\t\tiFrameDocument?.removeEventListener(\n\t\t\t\t'dragover',\n\t\t\t\tpreventFileDropDefault\n\t\t\t);\n\t\t\tiFrameDocument?.removeEventListener(\n\t\t\t\t'drop',\n\t\t\t\tpreventFileDropDefault\n\t\t\t);\n\t\t};\n\t}, [] );\n\n\tconst [ iframeWindowInnerHeight, setIframeWindowInnerHeight ] = useState();\n\n\tconst iframeResizeRef = useRefEffect( ( node ) => {\n\t\tconst nodeWindow = node.ownerDocument.defaultView;\n\n\t\tsetIframeWindowInnerHeight( nodeWindow.innerHeight );\n\t\tconst onResize = () => {\n\t\t\tsetIframeWindowInnerHeight( nodeWindow.innerHeight );\n\t\t};\n\t\tnodeWindow.addEventListener( 'resize', onResize );\n\t\treturn () => {\n\t\t\tnodeWindow.removeEventListener( 'resize', onResize );\n\t\t};\n\t}, [] );\n\n\tconst [ windowInnerWidth, setWindowInnerWidth ] = useState();\n\n\tconst windowResizeRef = useRefEffect( ( node ) => {\n\t\tconst nodeWindow = node.ownerDocument.defaultView;\n\n\t\tsetWindowInnerWidth( nodeWindow.innerWidth );\n\t\tconst onResize = () => {\n\t\t\tsetWindowInnerWidth( nodeWindow.innerWidth );\n\t\t};\n\t\tnodeWindow.addEventListener( 'resize', onResize );\n\t\treturn () => {\n\t\t\tnodeWindow.removeEventListener( 'resize', onResize );\n\t\t};\n\t}, [] );\n\n\tconst isZoomedOut = scale !== 1;\n\n\tuseEffect( () => {\n\t\tif ( ! isZoomedOut ) {\n\t\t\tinitialContainerWidth.current = containerWidth;\n\t\t}\n\t}, [ containerWidth, isZoomedOut ] );\n\n\tconst disabledRef = useDisabled( { isDisabled: ! readonly } );\n\tconst bodyRef = useMergeRefs( [\n\t\tuseBubbleEvents( iframeDocument ),\n\t\tcontentRef,\n\t\tclearerRef,\n\t\twritingFlowRef,\n\t\tdisabledRef,\n\t\t// Avoid resize listeners when not needed, these will trigger\n\t\t// unnecessary re-renders when animating the iframe width, or when\n\t\t// expanding preview iframes.\n\t\tisZoomedOut ? iframeResizeRef : null,\n\t] );\n\n\t// Correct doctype is required to enable rendering in standards\n\t// mode. Also preload the styles to avoid a flash of unstyled\n\t// content.\n\tconst html = `<!doctype html>\n<html>\n\t<head>\n\t\t<meta charset=\"utf-8\">\n\t\t<script>window.frameElement._load()</script>\n\t\t<style>\n\t\t\thtml{\n\t\t\t\theight: auto !important;\n\t\t\t\tmin-height: 100%;\n\t\t\t}\n\t\t\t/* Lowest specificity to not override global styles */\n\t\t\t:where(body) {\n\t\t\t\tmargin: 0;\n\t\t\t\t/* Default background color in case zoom out mode background\n\t\t\t\tcolors the html element */\n\t\t\t\tbackground-color: white;\n\t\t\t}\n\t\t</style>\n\t\t${ styles }\n\t\t${ scripts }\n\t</head>\n\t<body>\n\t\t<script>document.currentScript.parentElement.remove()</script>\n\t</body>\n</html>`;\n\n\tconst [ src, cleanup ] = useMemo( () => {\n\t\tconst _src = URL.createObjectURL(\n\t\t\tnew window.Blob( [ html ], { type: 'text/html' } )\n\t\t);\n\t\treturn [ _src, () => URL.revokeObjectURL( _src ) ];\n\t}, [ html ] );\n\n\tuseEffect( () => cleanup, [ cleanup ] );\n\n\tconst zoomOutAnimationClassnameRef = useRef( null );\n\tconst handleZoomOutAnimationClassname = () => {\n\t\tclearTimeout( zoomOutAnimationClassnameRef.current );\n\n\t\tiframeDocument.documentElement.classList.add( 'zoom-out-animation' );\n\n\t\tzoomOutAnimationClassnameRef.current = setTimeout( () => {\n\t\t\tiframeDocument.documentElement.classList.remove(\n\t\t\t\t'zoom-out-animation'\n\t\t\t);\n\t\t}, 400 ); // 400ms should match the animation speed used in components/iframe/content.scss\n\t};\n\n\t// Toggle zoom out CSS Classes only when zoom out mode changes. We could add these into the useEffect\n\t// that controls settings the CSS variables, but then we would need to do more work to ensure we're\n\t// only toggling these when the zoom out mode changes, as that useEffect is also triggered by a large\n\t// number of dependencies.\n\tuseEffect( () => {\n\t\tif ( ! iframeDocument || ! isZoomedOut ) {\n\t\t\treturn;\n\t\t}\n\n\t\thandleZoomOutAnimationClassname();\n\t\tiframeDocument.documentElement.classList.add( 'is-zoomed-out' );\n\n\t\treturn () => {\n\t\t\thandleZoomOutAnimationClassname();\n\t\t\tiframeDocument.documentElement.classList.remove( 'is-zoomed-out' );\n\t\t};\n\t}, [ iframeDocument, isZoomedOut ] );\n\n\t// Calculate the scaling and CSS variables for the zoom out canvas\n\tuseEffect( () => {\n\t\tif ( ! iframeDocument || ! isZoomedOut ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst maxWidth = 750;\n\t\t// Note: When we initialize the zoom out when the canvas is smaller (sidebars open),\n\t\t// initialContainerWidth will be smaller than the full page, and reflow will happen\n\t\t// when the canvas area becomes larger due to sidebars closing. This is a known but\n\t\t// minor divergence for now.\n\n\t\t// This scaling calculation has to happen within the JS because CSS calc() can\n\t\t// only divide and multiply by a unitless value. I.e. calc( 100px / 2 ) is valid\n\t\t// but calc( 100px / 2px ) is not.\n\t\tiframeDocument.documentElement.style.setProperty(\n\t\t\t'--wp-block-editor-iframe-zoom-out-scale',\n\t\t\tscale === 'default'\n\t\t\t\t? ( Math.min( containerWidth, maxWidth ) -\n\t\t\t\t\t\tparseInt( frameSize ) * 2 ) /\n\t\t\t\t\t\tMath.max(\n\t\t\t\t\t\t\tinitialContainerWidth.current,\n\t\t\t\t\t\t\tcontainerWidth\n\t\t\t\t\t\t)\n\t\t\t\t: scale\n\t\t);\n\n\t\t// frameSize has to be a px value for the scaling and frame size to be computed correctly.\n\t\tiframeDocument.documentElement.style.setProperty(\n\t\t\t'--wp-block-editor-iframe-zoom-out-frame-size',\n\t\t\ttypeof frameSize === 'number' ? `${ frameSize }px` : frameSize\n\t\t);\n\t\tiframeDocument.documentElement.style.setProperty(\n\t\t\t'--wp-block-editor-iframe-zoom-out-content-height',\n\t\t\t`${ contentHeight }px`\n\t\t);\n\t\tiframeDocument.documentElement.style.setProperty(\n\t\t\t'--wp-block-editor-iframe-zoom-out-inner-height',\n\t\t\t`${ iframeWindowInnerHeight }px`\n\t\t);\n\t\tiframeDocument.documentElement.style.setProperty(\n\t\t\t'--wp-block-editor-iframe-zoom-out-container-width',\n\t\t\t`${ containerWidth }px`\n\t\t);\n\t\tiframeDocument.documentElement.style.setProperty(\n\t\t\t'--wp-block-editor-iframe-zoom-out-outer-container-width',\n\t\t\t`${ Math.max( initialContainerWidth.current, containerWidth ) }px`\n\t\t);\n\n\t\t// iframeDocument.documentElement.style.setProperty(\n\t\t// \t'--wp-block-editor-iframe-zoom-out-outer-container-width',\n\t\t// \t`${ Math.max( initialContainerWidth.current, containerWidth ) }px`\n\t\t// );\n\n\t\treturn () => {\n\t\t\tiframeDocument.documentElement.style.removeProperty(\n\t\t\t\t'--wp-block-editor-iframe-zoom-out-scale'\n\t\t\t);\n\t\t\tiframeDocument.documentElement.style.removeProperty(\n\t\t\t\t'--wp-block-editor-iframe-zoom-out-frame-size'\n\t\t\t);\n\t\t\tiframeDocument.documentElement.style.removeProperty(\n\t\t\t\t'--wp-block-editor-iframe-zoom-out-content-height'\n\t\t\t);\n\t\t\tiframeDocument.documentElement.style.removeProperty(\n\t\t\t\t'--wp-block-editor-iframe-zoom-out-inner-height'\n\t\t\t);\n\t\t\tiframeDocument.documentElement.style.removeProperty(\n\t\t\t\t'--wp-block-editor-iframe-zoom-out-container-width'\n\t\t\t);\n\t\t\tiframeDocument.documentElement.style.removeProperty(\n\t\t\t\t'--wp-block-editor-iframe-zoom-out-outer-container-width'\n\t\t\t);\n\t\t};\n\t}, [\n\t\tscale,\n\t\tframeSize,\n\t\tiframeDocument,\n\t\tiframeWindowInnerHeight,\n\t\tcontentHeight,\n\t\tcontainerWidth,\n\t\twindowInnerWidth,\n\t\tisZoomedOut,\n\t] );\n\n\t// Make sure to not render the before and after focusable div elements in view\n\t// mode. They're only needed to capture focus in edit mode.\n\tconst shouldRenderFocusCaptureElements = tabIndex >= 0 && ! isPreviewMode;\n\n\tconst iframe = (\n\t\t<>\n\t\t\t{ shouldRenderFocusCaptureElements && before }\n\t\t\t{ /* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */ }\n\t\t\t<iframe\n\t\t\t\t{ ...props }\n\t\t\t\tstyle={ {\n\t\t\t\t\t...props.style,\n\t\t\t\t\theight: props.style?.height,\n\t\t\t\t\tborder: 0,\n\t\t\t\t} }\n\t\t\t\tref={ useMergeRefs( [ ref, setRef ] ) }\n\t\t\t\ttabIndex={ tabIndex }\n\t\t\t\t// Correct doctype is required to enable rendering in standards\n\t\t\t\t// mode. Also preload the styles to avoid a flash of unstyled\n\t\t\t\t// content.\n\t\t\t\tsrc={ src }\n\t\t\t\ttitle={ title }\n\t\t\t\tonKeyDown={ ( event ) => {\n\t\t\t\t\tif ( props.onKeyDown ) {\n\t\t\t\t\t\tprops.onKeyDown( event );\n\t\t\t\t\t}\n\t\t\t\t\t// If the event originates from inside the iframe, it means\n\t\t\t\t\t// it bubbled through the portal, but only with React\n\t\t\t\t\t// events. We need to to bubble native events as well,\n\t\t\t\t\t// though by doing so we also trigger another React event,\n\t\t\t\t\t// so we need to stop the propagation of this event to avoid\n\t\t\t\t\t// duplication.\n\t\t\t\t\tif (\n\t\t\t\t\t\tevent.currentTarget.ownerDocument !==\n\t\t\t\t\t\tevent.target.ownerDocument\n\t\t\t\t\t) {\n\t\t\t\t\t\t// We should only stop propagation of the React event,\n\t\t\t\t\t\t// the native event should further bubble inside the\n\t\t\t\t\t\t// iframe to the document and window.\n\t\t\t\t\t\t// Alternatively, we could consider redispatching the\n\t\t\t\t\t\t// native event in the iframe.\n\t\t\t\t\t\tconst { stopPropagation } = event.nativeEvent;\n\t\t\t\t\t\tevent.nativeEvent.stopPropagation = () => {};\n\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\tevent.nativeEvent.stopPropagation = stopPropagation;\n\t\t\t\t\t\tbubbleEvent(\n\t\t\t\t\t\t\tevent,\n\t\t\t\t\t\t\twindow.KeyboardEvent,\n\t\t\t\t\t\t\tevent.currentTarget\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ iframeDocument &&\n\t\t\t\t\tcreatePortal(\n\t\t\t\t\t\t// We want to prevent React events from bubbling throught the iframe\n\t\t\t\t\t\t// we bubble these manually.\n\t\t\t\t\t\t/* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */\n\t\t\t\t\t\t<body\n\t\t\t\t\t\t\tref={ bodyRef }\n\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\t'block-editor-iframe__body',\n\t\t\t\t\t\t\t\t'editor-styles-wrapper',\n\t\t\t\t\t\t\t\t...bodyClasses\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ contentResizeListener }\n\t\t\t\t\t\t\t<StyleProvider document={ iframeDocument }>\n\t\t\t\t\t\t\t\t{ children }\n\t\t\t\t\t\t\t</StyleProvider>\n\t\t\t\t\t\t</body>,\n\t\t\t\t\t\tiframeDocument.documentElement\n\t\t\t\t\t) }\n\t\t\t</iframe>\n\t\t\t{ shouldRenderFocusCaptureElements && after }\n\t\t</>\n\t);\n\n\treturn (\n\t\t<div className=\"block-editor-iframe__container\" ref={ windowResizeRef }>\n\t\t\t{ containerResizeListener }\n\t\t\t<div\n\t\t\t\tclassName={ clsx(\n\t\t\t\t\t'block-editor-iframe__scale-container',\n\t\t\t\t\tisZoomedOut && 'is-zoomed-out'\n\t\t\t\t) }\n\t\t\t\tstyle={ {\n\t\t\t\t\t'--wp-block-editor-iframe-zoom-out-outer-container-width':\n\t\t\t\t\t\tisZoomedOut &&\n\t\t\t\t\t\t`${ Math.max(\n\t\t\t\t\t\t\tinitialContainerWidth.current,\n\t\t\t\t\t\t\tcontainerWidth\n\t\t\t\t\t\t) }px`,\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ iframe }\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\nfunction IframeIfReady( props, ref ) {\n\tconst isInitialised = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockEditorStore ).getSettings().__internalIsInitialized,\n\t\t[]\n\t);\n\n\t// We shouldn't render the iframe until the editor settings are initialised.\n\t// The initial settings are needed to get the styles for the srcDoc, which\n\t// cannot be changed after the iframe is mounted. srcDoc is used to to set\n\t// the initial iframe HTML, which is required to avoid a flash of unstyled\n\t// content.\n\tif ( ! isInitialised ) {\n\t\treturn null;\n\t}\n\n\treturn <Iframe { ...props } forwardedRef={ ref } />;\n}\n\nexport default forwardRef( IframeIfReady );\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SACCC,QAAQ,EACRC,YAAY,EACZC,UAAU,EACVC,OAAO,EACPC,SAAS,EACTC,MAAM,QACA,oBAAoB;AAC3B,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SACCC,iBAAiB,EACjBC,YAAY,EACZC,YAAY,EACZC,WAAW,QACL,oBAAoB;AAC3B,SAASC,2BAA2B,IAAIC,aAAa,QAAQ,uBAAuB;AACpF,SAASC,SAAS,QAAQ,iBAAiB;;AAE3C;AACA;AACA;AACA,SAASC,wBAAwB,QAAQ,4BAA4B;AACrE,SAASC,cAAc,QAAQ,iBAAiB;AAChD,SAASC,sBAAsB,QAAQ,4BAA4B;AACnE,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,aAAa;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA,EAAAC,QAAA,IAAAC,SAAA;AAExD,SAASC,WAAWA,CAAEC,KAAK,EAAEC,WAAW,EAAEC,KAAK,EAAG;EACjD,MAAMC,IAAI,GAAG,CAAC,CAAC;EAEf,KAAM,MAAMC,GAAG,IAAIJ,KAAK,EAA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,CAAC;MACH,CAAG;MAAA/B,QAAA,EAED2F;IAAM,CACJ,CAAC;EAAA,CACF,CAAC;AAER;AAEA,SAASU,aAAaA,CAAE7F,KAAK,EAAEF,GAAG,EAAG;EACpC,MAAMgG,aAAa,GAAGzJ,SAAS,CAC5B8D,MAAM,IACPA,MAAM,CAAEzD,gBAAiB,CAAC,CAAC0D,WAAW,CAAC,CAAC,CAAC2F,uBAAuB,EACjE,EACD,CAAC;;EAED;EACA;EACA;EACA;EACA;EACA,IAAK,CAAED,aAAa,EAAG;IACtB,OAAO,IAAI;EACZ;EAEA,oBAAOlJ,IAAA,CAAC0C,MAAM;IAAA,GAAMU,KAAK;IAAGH,YAAY,EAAGC;EAAK,CAAE,CAAC;AACpD;AAEA,eAAepE,UAAU,CAAEmK,aAAc,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["clsx","useState","createPortal","forwardRef","useMemo","useEffect","useRef","__","useResizeObserver","useMergeRefs","useRefEffect","useDisabled","__experimentalStyleProvider","StyleProvider","useSelect","useBlockSelectionClearer","useWritingFlow","getCompatibilityStyles","store","blockEditorStore","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","bubbleEvent","event","Constructor","frame","init","key","contentDocument","defaultView","MouseEvent","rect","getBoundingClientRect","clientX","left","clientY","top","newEvent","type","defaultPrevented","preventDefault","cancelled","dispatchEvent","useBubbleEvents","iframeDocument","frameElement","html","documentElement","eventTypes","handlers","name","prototype","Object","getPrototypeOf","constructorName","constructor","window","addEventListener","removeEventListener","Iframe","contentRef","children","tabIndex","scale","frameSize","readonly","forwardedRef","ref","title","props","resolvedAssets","isPreviewMode","select","getSettings","settings","__unstableResolvedAssets","styles","scripts","setIframeDocument","initialContainerWidthRef","bodyClasses","setBodyClasses","clearerRef","before","writingFlowRef","after","contentResizeListener","height","contentHeight","containerResizeListener","width","containerWidth","setRef","node","_load","iFrameDocument","preventFileDropDefault","onLoad","ownerDocument","classList","add","Array","from","body","filter","startsWith","dir","compatStyle","getElementById","id","head","appendChild","cloneNode","console","warn","target","tagName","href","getAttribute","location","hash","slice","iframeWindowInnerHeight","setIframeWindowInnerHeight","iframeResizeRef","nodeWindow","innerHeight","onResize","windowInnerWidth","setWindowInnerWidth","windowResizeRef","innerWidth","isZoomedOut","current","scaleContainerWidth","Math","max","disabledRef","isDisabled","bodyRef","origin","src","cleanup","_src","URL","createObjectURL","Blob","revokeObjectURL","zoomOutAnimationClassnameRef","handleZoomOutAnimationClassname","clearTimeout","setTimeout","remove","maxWidth","style","setProperty","min","parseInt","removeProperty","shouldRenderFocusCaptureElements","iframe","border","onKeyDown","currentTarget","stopPropagation","nativeEvent","KeyboardEvent","className","document","IframeIfReady","isInitialised","__internalIsInitialized"],"sources":["@wordpress/block-editor/src/components/iframe/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseState,\n\tcreatePortal,\n\tforwardRef,\n\tuseMemo,\n\tuseEffect,\n\tuseRef,\n} from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tuseResizeObserver,\n\tuseMergeRefs,\n\tuseRefEffect,\n\tuseDisabled,\n} from '@wordpress/compose';\nimport { __experimentalStyleProvider as StyleProvider } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { useBlockSelectionClearer } from '../block-selection-clearer';\nimport { useWritingFlow } from '../writing-flow';\nimport { getCompatibilityStyles } from './get-compatibility-styles';\nimport { store as blockEditorStore } from '../../store';\n\nfunction bubbleEvent( event, Constructor, frame ) {\n\tconst init = {};\n\n\tfor ( const key in event ) {\n\t\tinit[ key ] = event[ key ];\n\t}\n\n\t// Check if the event is a MouseEvent generated within the iframe.\n\t// If so, adjust the coordinates to be relative to the position of\n\t// the iframe. This ensures that components such as Draggable\n\t// receive coordinates relative to the window, instead of relative\n\t// to the iframe. Without this, the Draggable event handler would\n\t// result in components \"jumping\" position as soon as the user\n\t// drags over the iframe.\n\tif ( event instanceof frame.contentDocument.defaultView.MouseEvent ) {\n\t\tconst rect = frame.getBoundingClientRect();\n\t\tinit.clientX += rect.left;\n\t\tinit.clientY += rect.top;\n\t}\n\n\tconst newEvent = new Constructor( event.type, init );\n\tif ( init.defaultPrevented ) {\n\t\tnewEvent.preventDefault();\n\t}\n\tconst cancelled = ! frame.dispatchEvent( newEvent );\n\n\tif ( cancelled ) {\n\t\tevent.preventDefault();\n\t}\n}\n\n/**\n * Bubbles some event types (keydown, keypress, and dragover) to parent document\n * document to ensure that the keyboard shortcuts and drag and drop work.\n *\n * Ideally, we should remove event bubbling in the future. Keyboard shortcuts\n * should be context dependent, e.g. actions on blocks like Cmd+A should not\n * work globally outside the block editor.\n *\n * @param {Document} iframeDocument Document to attach listeners to.\n */\nfunction useBubbleEvents( iframeDocument ) {\n\treturn useRefEffect( () => {\n\t\tconst { defaultView } = iframeDocument;\n\t\tif ( ! defaultView ) {\n\t\t\treturn;\n\t\t}\n\t\tconst { frameElement } = defaultView;\n\t\tconst html = iframeDocument.documentElement;\n\t\tconst eventTypes = [ 'dragover', 'mousemove' ];\n\t\tconst handlers = {};\n\t\tfor ( const name of eventTypes ) {\n\t\t\thandlers[ name ] = ( event ) => {\n\t\t\t\tconst prototype = Object.getPrototypeOf( event );\n\t\t\t\tconst constructorName = prototype.constructor.name;\n\t\t\t\tconst Constructor = window[ constructorName ];\n\t\t\t\tbubbleEvent( event, Constructor, frameElement );\n\t\t\t};\n\t\t\thtml.addEventListener( name, handlers[ name ] );\n\t\t}\n\n\t\treturn () => {\n\t\t\tfor ( const name of eventTypes ) {\n\t\t\t\thtml.removeEventListener( name, handlers[ name ] );\n\t\t\t}\n\t\t};\n\t} );\n}\n\nfunction Iframe( {\n\tcontentRef,\n\tchildren,\n\ttabIndex = 0,\n\tscale = 1,\n\tframeSize = 0,\n\treadonly,\n\tforwardedRef: ref,\n\ttitle = __( 'Editor canvas' ),\n\t...props\n} ) {\n\tconst { resolvedAssets, isPreviewMode } = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\tconst settings = getSettings();\n\t\treturn {\n\t\t\tresolvedAssets: settings.__unstableResolvedAssets,\n\t\t\tisPreviewMode: settings.isPreviewMode,\n\t\t};\n\t}, [] );\n\tconst { styles = '', scripts = '' } = resolvedAssets;\n\tconst [ iframeDocument, setIframeDocument ] = useState();\n\tconst initialContainerWidthRef = useRef( 0 );\n\tconst [ bodyClasses, setBodyClasses ] = useState( [] );\n\tconst clearerRef = useBlockSelectionClearer();\n\tconst [ before, writingFlowRef, after ] = useWritingFlow();\n\tconst [ contentResizeListener, { height: contentHeight } ] =\n\t\tuseResizeObserver();\n\tconst [ containerResizeListener, { width: containerWidth } ] =\n\t\tuseResizeObserver();\n\n\tconst setRef = useRefEffect( ( node ) => {\n\t\tnode._load = () => {\n\t\t\tsetIframeDocument( node.contentDocument );\n\t\t};\n\t\tlet iFrameDocument;\n\t\t// Prevent the default browser action for files dropped outside of dropzones.\n\t\tfunction preventFileDropDefault( event ) {\n\t\t\tevent.preventDefault();\n\t\t}\n\t\tfunction onLoad() {\n\t\t\tconst { contentDocument, ownerDocument } = node;\n\t\t\tconst { documentElement } = contentDocument;\n\t\t\tiFrameDocument = contentDocument;\n\n\t\t\tdocumentElement.classList.add( 'block-editor-iframe__html' );\n\n\t\t\tclearerRef( documentElement );\n\n\t\t\t// Ideally ALL classes that are added through get_body_class should\n\t\t\t// be added in the editor too, which we'll somehow have to get from\n\t\t\t// the server in the future (which will run the PHP filters).\n\t\t\tsetBodyClasses(\n\t\t\t\tArray.from( ownerDocument.body.classList ).filter(\n\t\t\t\t\t( name ) =>\n\t\t\t\t\t\tname.startsWith( 'admin-color-' ) ||\n\t\t\t\t\t\tname.startsWith( 'post-type-' ) ||\n\t\t\t\t\t\tname === 'wp-embed-responsive'\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tcontentDocument.dir = ownerDocument.dir;\n\n\t\t\tfor ( const compatStyle of getCompatibilityStyles() ) {\n\t\t\t\tif ( contentDocument.getElementById( compatStyle.id ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tcontentDocument.head.appendChild(\n\t\t\t\t\tcompatStyle.cloneNode( true )\n\t\t\t\t);\n\n\t\t\t\tif ( ! isPreviewMode ) {\n\t\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\t\tconsole.warn(\n\t\t\t\t\t\t`${ compatStyle.id } was added to the iframe incorrectly. Please use block.json or enqueue_block_assets to add styles to the iframe.`,\n\t\t\t\t\t\tcompatStyle\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tiFrameDocument.addEventListener(\n\t\t\t\t'dragover',\n\t\t\t\tpreventFileDropDefault,\n\t\t\t\tfalse\n\t\t\t);\n\t\t\tiFrameDocument.addEventListener(\n\t\t\t\t'drop',\n\t\t\t\tpreventFileDropDefault,\n\t\t\t\tfalse\n\t\t\t);\n\t\t\t// Prevent clicks on links from navigating away. Note that links\n\t\t\t// inside `contenteditable` are already disabled by the browser, so\n\t\t\t// this is for links in blocks outside of `contenteditable`.\n\t\t\tiFrameDocument.addEventListener( 'click', ( event ) => {\n\t\t\t\tif ( event.target.tagName === 'A' ) {\n\t\t\t\t\tevent.preventDefault();\n\n\t\t\t\t\t// Appending a hash to the current URL will not reload the\n\t\t\t\t\t// page. This is useful for e.g. footnotes.\n\t\t\t\t\tconst href = event.target.getAttribute( 'href' );\n\t\t\t\t\tif ( href.startsWith( '#' ) ) {\n\t\t\t\t\t\tiFrameDocument.defaultView.location.hash =\n\t\t\t\t\t\t\thref.slice( 1 );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\n\t\tnode.addEventListener( 'load', onLoad );\n\n\t\treturn () => {\n\t\t\tdelete node._load;\n\t\t\tnode.removeEventListener( 'load', onLoad );\n\t\t\tiFrameDocument?.removeEventListener(\n\t\t\t\t'dragover',\n\t\t\t\tpreventFileDropDefault\n\t\t\t);\n\t\t\tiFrameDocument?.removeEventListener(\n\t\t\t\t'drop',\n\t\t\t\tpreventFileDropDefault\n\t\t\t);\n\t\t};\n\t}, [] );\n\n\tconst [ iframeWindowInnerHeight, setIframeWindowInnerHeight ] = useState();\n\n\tconst iframeResizeRef = useRefEffect( ( node ) => {\n\t\tconst nodeWindow = node.ownerDocument.defaultView;\n\n\t\tsetIframeWindowInnerHeight( nodeWindow.innerHeight );\n\t\tconst onResize = () => {\n\t\t\tsetIframeWindowInnerHeight( nodeWindow.innerHeight );\n\t\t};\n\t\tnodeWindow.addEventListener( 'resize', onResize );\n\t\treturn () => {\n\t\t\tnodeWindow.removeEventListener( 'resize', onResize );\n\t\t};\n\t}, [] );\n\n\tconst [ windowInnerWidth, setWindowInnerWidth ] = useState();\n\n\tconst windowResizeRef = useRefEffect( ( node ) => {\n\t\tconst nodeWindow = node.ownerDocument.defaultView;\n\n\t\tsetWindowInnerWidth( nodeWindow.innerWidth );\n\t\tconst onResize = () => {\n\t\t\tsetWindowInnerWidth( nodeWindow.innerWidth );\n\t\t};\n\t\tnodeWindow.addEventListener( 'resize', onResize );\n\t\treturn () => {\n\t\t\tnodeWindow.removeEventListener( 'resize', onResize );\n\t\t};\n\t}, [] );\n\n\tconst isZoomedOut = scale !== 1;\n\n\tuseEffect( () => {\n\t\tif ( ! isZoomedOut ) {\n\t\t\tinitialContainerWidthRef.current = containerWidth;\n\t\t}\n\t}, [ containerWidth, isZoomedOut ] );\n\n\tconst scaleContainerWidth = Math.max(\n\t\tinitialContainerWidthRef.current,\n\t\tcontainerWidth\n\t);\n\n\tconst disabledRef = useDisabled( { isDisabled: ! readonly } );\n\tconst bodyRef = useMergeRefs( [\n\t\tuseBubbleEvents( iframeDocument ),\n\t\tcontentRef,\n\t\tclearerRef,\n\t\twritingFlowRef,\n\t\tdisabledRef,\n\t\t// Avoid resize listeners when not needed, these will trigger\n\t\t// unnecessary re-renders when animating the iframe width, or when\n\t\t// expanding preview iframes.\n\t\tisZoomedOut ? iframeResizeRef : null,\n\t] );\n\n\t// Correct doctype is required to enable rendering in standards\n\t// mode. Also preload the styles to avoid a flash of unstyled\n\t// content.\n\tconst html = `<!doctype html>\n<html>\n\t<head>\n\t\t<meta charset=\"utf-8\">\n\t\t<base href=\"${ window.location.origin }\">\n\t\t<script>window.frameElement._load()</script>\n\t\t<style>\n\t\t\thtml{\n\t\t\t\theight: auto !important;\n\t\t\t\tmin-height: 100%;\n\t\t\t}\n\t\t\t/* Lowest specificity to not override global styles */\n\t\t\t:where(body) {\n\t\t\t\tmargin: 0;\n\t\t\t\t/* Default background color in case zoom out mode background\n\t\t\t\tcolors the html element */\n\t\t\t\tbackground-color: white;\n\t\t\t}\n\t\t</style>\n\t\t${ styles }\n\t\t${ scripts }\n\t</head>\n\t<body>\n\t\t<script>document.currentScript.parentElement.remove()</script>\n\t</body>\n</html>`;\n\n\tconst [ src, cleanup ] = useMemo( () => {\n\t\tconst _src = URL.createObjectURL(\n\t\t\tnew window.Blob( [ html ], { type: 'text/html' } )\n\t\t);\n\t\treturn [ _src, () => URL.revokeObjectURL( _src ) ];\n\t}, [ html ] );\n\n\tuseEffect( () => cleanup, [ cleanup ] );\n\n\tconst zoomOutAnimationClassnameRef = useRef( null );\n\n\t// Toggle zoom out CSS Classes only when zoom out mode changes. We could add these into the useEffect\n\t// that controls settings the CSS variables, but then we would need to do more work to ensure we're\n\t// only toggling these when the zoom out mode changes, as that useEffect is also triggered by a large\n\t// number of dependencies.\n\tuseEffect( () => {\n\t\tif ( ! iframeDocument || ! isZoomedOut ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst handleZoomOutAnimationClassname = () => {\n\t\t\tclearTimeout( zoomOutAnimationClassnameRef.current );\n\n\t\t\tiframeDocument.documentElement.classList.add(\n\t\t\t\t'zoom-out-animation'\n\t\t\t);\n\n\t\t\tzoomOutAnimationClassnameRef.current = setTimeout( () => {\n\t\t\t\tiframeDocument.documentElement.classList.remove(\n\t\t\t\t\t'zoom-out-animation'\n\t\t\t\t);\n\t\t\t}, 400 ); // 400ms should match the animation speed used in components/iframe/content.scss\n\t\t};\n\n\t\thandleZoomOutAnimationClassname();\n\t\tiframeDocument.documentElement.classList.add( 'is-zoomed-out' );\n\n\t\treturn () => {\n\t\t\thandleZoomOutAnimationClassname();\n\t\t\tiframeDocument.documentElement.classList.remove( 'is-zoomed-out' );\n\t\t};\n\t}, [ iframeDocument, isZoomedOut ] );\n\n\t// Calculate the scaling and CSS variables for the zoom out canvas\n\tuseEffect( () => {\n\t\tif ( ! iframeDocument || ! isZoomedOut ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst maxWidth = 750;\n\t\t// Note: When we initialize the zoom out when the canvas is smaller (sidebars open),\n\t\t// initialContainerWidthRef will be smaller than the full page, and reflow will happen\n\t\t// when the canvas area becomes larger due to sidebars closing. This is a known but\n\t\t// minor divergence for now.\n\n\t\t// This scaling calculation has to happen within the JS because CSS calc() can\n\t\t// only divide and multiply by a unitless value. I.e. calc( 100px / 2 ) is valid\n\t\t// but calc( 100px / 2px ) is not.\n\t\tiframeDocument.documentElement.style.setProperty(\n\t\t\t'--wp-block-editor-iframe-zoom-out-scale',\n\t\t\tscale === 'auto-scaled'\n\t\t\t\t? ( Math.min( containerWidth, maxWidth ) -\n\t\t\t\t\t\tparseInt( frameSize ) * 2 ) /\n\t\t\t\t\t\tscaleContainerWidth\n\t\t\t\t: scale\n\t\t);\n\n\t\t// frameSize has to be a px value for the scaling and frame size to be computed correctly.\n\t\tiframeDocument.documentElement.style.setProperty(\n\t\t\t'--wp-block-editor-iframe-zoom-out-frame-size',\n\t\t\ttypeof frameSize === 'number' ? `${ frameSize }px` : frameSize\n\t\t);\n\t\tiframeDocument.documentElement.style.setProperty(\n\t\t\t'--wp-block-editor-iframe-zoom-out-content-height',\n\t\t\t`${ contentHeight }px`\n\t\t);\n\t\tiframeDocument.documentElement.style.setProperty(\n\t\t\t'--wp-block-editor-iframe-zoom-out-inner-height',\n\t\t\t`${ iframeWindowInnerHeight }px`\n\t\t);\n\t\tiframeDocument.documentElement.style.setProperty(\n\t\t\t'--wp-block-editor-iframe-zoom-out-container-width',\n\t\t\t`${ containerWidth }px`\n\t\t);\n\t\tiframeDocument.documentElement.style.setProperty(\n\t\t\t'--wp-block-editor-iframe-zoom-out-scale-container-width',\n\t\t\t`${ scaleContainerWidth }px`\n\t\t);\n\n\t\treturn () => {\n\t\t\tiframeDocument.documentElement.style.removeProperty(\n\t\t\t\t'--wp-block-editor-iframe-zoom-out-scale'\n\t\t\t);\n\t\t\tiframeDocument.documentElement.style.removeProperty(\n\t\t\t\t'--wp-block-editor-iframe-zoom-out-frame-size'\n\t\t\t);\n\t\t\tiframeDocument.documentElement.style.removeProperty(\n\t\t\t\t'--wp-block-editor-iframe-zoom-out-content-height'\n\t\t\t);\n\t\t\tiframeDocument.documentElement.style.removeProperty(\n\t\t\t\t'--wp-block-editor-iframe-zoom-out-inner-height'\n\t\t\t);\n\t\t\tiframeDocument.documentElement.style.removeProperty(\n\t\t\t\t'--wp-block-editor-iframe-zoom-out-container-width'\n\t\t\t);\n\t\t\tiframeDocument.documentElement.style.removeProperty(\n\t\t\t\t'--wp-block-editor-iframe-zoom-out-scale-container-width'\n\t\t\t);\n\t\t};\n\t}, [\n\t\tscale,\n\t\tframeSize,\n\t\tiframeDocument,\n\t\tiframeWindowInnerHeight,\n\t\tcontentHeight,\n\t\tcontainerWidth,\n\t\twindowInnerWidth,\n\t\tisZoomedOut,\n\t\tscaleContainerWidth,\n\t] );\n\n\t// Make sure to not render the before and after focusable div elements in view\n\t// mode. They're only needed to capture focus in edit mode.\n\tconst shouldRenderFocusCaptureElements = tabIndex >= 0 && ! isPreviewMode;\n\n\tconst iframe = (\n\t\t<>\n\t\t\t{ shouldRenderFocusCaptureElements && before }\n\t\t\t{ /* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */ }\n\t\t\t<iframe\n\t\t\t\t{ ...props }\n\t\t\t\tstyle={ {\n\t\t\t\t\t...props.style,\n\t\t\t\t\theight: props.style?.height,\n\t\t\t\t\tborder: 0,\n\t\t\t\t} }\n\t\t\t\tref={ useMergeRefs( [ ref, setRef ] ) }\n\t\t\t\ttabIndex={ tabIndex }\n\t\t\t\t// Correct doctype is required to enable rendering in standards\n\t\t\t\t// mode. Also preload the styles to avoid a flash of unstyled\n\t\t\t\t// content.\n\t\t\t\tsrc={ src }\n\t\t\t\ttitle={ title }\n\t\t\t\tonKeyDown={ ( event ) => {\n\t\t\t\t\tif ( props.onKeyDown ) {\n\t\t\t\t\t\tprops.onKeyDown( event );\n\t\t\t\t\t}\n\t\t\t\t\t// If the event originates from inside the iframe, it means\n\t\t\t\t\t// it bubbled through the portal, but only with React\n\t\t\t\t\t// events. We need to to bubble native events as well,\n\t\t\t\t\t// though by doing so we also trigger another React event,\n\t\t\t\t\t// so we need to stop the propagation of this event to avoid\n\t\t\t\t\t// duplication.\n\t\t\t\t\tif (\n\t\t\t\t\t\tevent.currentTarget.ownerDocument !==\n\t\t\t\t\t\tevent.target.ownerDocument\n\t\t\t\t\t) {\n\t\t\t\t\t\t// We should only stop propagation of the React event,\n\t\t\t\t\t\t// the native event should further bubble inside the\n\t\t\t\t\t\t// iframe to the document and window.\n\t\t\t\t\t\t// Alternatively, we could consider redispatching the\n\t\t\t\t\t\t// native event in the iframe.\n\t\t\t\t\t\tconst { stopPropagation } = event.nativeEvent;\n\t\t\t\t\t\tevent.nativeEvent.stopPropagation = () => {};\n\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\tevent.nativeEvent.stopPropagation = stopPropagation;\n\t\t\t\t\t\tbubbleEvent(\n\t\t\t\t\t\t\tevent,\n\t\t\t\t\t\t\twindow.KeyboardEvent,\n\t\t\t\t\t\t\tevent.currentTarget\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ iframeDocument &&\n\t\t\t\t\tcreatePortal(\n\t\t\t\t\t\t// We want to prevent React events from bubbling throught the iframe\n\t\t\t\t\t\t// we bubble these manually.\n\t\t\t\t\t\t/* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */\n\t\t\t\t\t\t<body\n\t\t\t\t\t\t\tref={ bodyRef }\n\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\t'block-editor-iframe__body',\n\t\t\t\t\t\t\t\t'editor-styles-wrapper',\n\t\t\t\t\t\t\t\t...bodyClasses\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ contentResizeListener }\n\t\t\t\t\t\t\t<StyleProvider document={ iframeDocument }>\n\t\t\t\t\t\t\t\t{ children }\n\t\t\t\t\t\t\t</StyleProvider>\n\t\t\t\t\t\t</body>,\n\t\t\t\t\t\tiframeDocument.documentElement\n\t\t\t\t\t) }\n\t\t\t</iframe>\n\t\t\t{ shouldRenderFocusCaptureElements && after }\n\t\t</>\n\t);\n\n\treturn (\n\t\t<div className=\"block-editor-iframe__container\" ref={ windowResizeRef }>\n\t\t\t{ containerResizeListener }\n\t\t\t<div\n\t\t\t\tclassName={ clsx(\n\t\t\t\t\t'block-editor-iframe__scale-container',\n\t\t\t\t\tisZoomedOut && 'is-zoomed-out'\n\t\t\t\t) }\n\t\t\t\tstyle={ {\n\t\t\t\t\t'--wp-block-editor-iframe-zoom-out-scale-container-width':\n\t\t\t\t\t\tisZoomedOut && `${ scaleContainerWidth }px`,\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ iframe }\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\nfunction IframeIfReady( props, ref ) {\n\tconst isInitialised = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockEditorStore ).getSettings().__internalIsInitialized,\n\t\t[]\n\t);\n\n\t// We shouldn't render the iframe until the editor settings are initialised.\n\t// The initial settings are needed to get the styles for the srcDoc, which\n\t// cannot be changed after the iframe is mounted. srcDoc is used to to set\n\t// the initial iframe HTML, which is required to avoid a flash of unstyled\n\t// content.\n\tif ( ! isInitialised ) {\n\t\treturn null;\n\t}\n\n\treturn <Iframe { ...props } forwardedRef={ ref } />;\n}\n\nexport default forwardRef( IframeIfReady );\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SACCC,QAAQ,EACRC,YAAY,EACZC,UAAU,EACVC,OAAO,EACPC,SAAS,EACTC,MAAM,QACA,oBAAoB;AAC3B,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SACCC,iBAAiB,EACjBC,YAAY,EACZC,YAAY,EACZC,WAAW,QACL,oBAAoB;AAC3B,SAASC,2BAA2B,IAAIC,aAAa,QAAQ,uBAAuB;AACpF,SAASC,SAAS,QAAQ,iBAAiB;;AAE3C;AACA;AACA;AACA,SAASC,wBAAwB,QAAQ,4BAA4B;AACrE,SAASC,cAAc,QAAQ,iBAAiB;AAChD,SAASC,sBAAsB,QAAQ,4BAA4B;AACnE,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,aAAa;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA,EAAAC,QAAA,IAAAC,SAAA;AAExD,SAASC,WAAWA,CAAEC,KAAK,EAAEC,WAAW,EAAEC,KAAK,EAAG;EACjD,MAAMC,IAAI,GAAG,CAAC,CAAC;EAEf,KAAM,MAAMC,GAAG,IAAIJ,KAAK,EAAG;IAC1BG,IAAI,CAAEC,GAAG,CAAE,GAAGJ,KAAK,CAAEI,GAAG,CAAE;EAC3B;;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,IAAKJ,KAAK,YAAYE,KAAK,CAACG,eAAe,CAACC,WAAW,CAACC,UAAU,EAAG;IACpE,MAAMC,IAAI,GAAGN,KAAK,CAACO,qBAAqB,CAAC,CAAC;IAC1CN,IAAI,CAACO,OAAO,IAAIF,IAAI,CAACG,IAAI;IACzBR,IAAI,CAACS,OAAO,IAAIJ,IAAI,CAACK,GAAG;EACzB;EAEA,MAAMC,QAAQ,GAAG,IAAIb,WAAW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G;QACP,yDAAyD,EACxDtB,WAAW,IAAI,GAAIE,mBAAmB;MACxC,CAAG;MAAAzE,QAAA,EAEDmG;IAAM,CACJ,CAAC;EAAA,CACF,CAAC;AAER;AAEA,SAASS,aAAaA,CAAEpG,KAAK,EAAEF,GAAG,EAAG;EACpC,MAAMuG,aAAa,GAAGhK,SAAS,CAC5B8D,MAAM,IACPA,MAAM,CAAEzD,gBAAiB,CAAC,CAAC0D,WAAW,CAAC,CAAC,CAACkG,uBAAuB,EACjE,EACD,CAAC;;EAED;EACA;EACA;EACA;EACA;EACA,IAAK,CAAED,aAAa,EAAG;IACtB,OAAO,IAAI;EACZ;EAEA,oBAAOzJ,IAAA,CAAC0C,MAAM;IAAA,GAAMU,KAAK;IAAGH,YAAY,EAAGC;EAAK,CAAE,CAAC;AACpD;AAEA,eAAepE,UAAU,CAAE0K,aAAc,CAAC","ignoreList":[]}
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * WordPress dependencies
3
3
  */
4
- import { Button, ButtonGroup, SelectControl, __experimentalNumberControl as NumberControl, __experimentalHStack as HStack } from '@wordpress/components';
4
+ import { SelectControl, __experimentalNumberControl as NumberControl, __experimentalHStack as HStack, __experimentalToggleGroupControl as ToggleGroupControl, __experimentalToggleGroupControlOption as ToggleGroupControlOption } from '@wordpress/components';
5
5
  import { __ } from '@wordpress/i18n';
6
6
 
7
7
  /**
@@ -11,6 +11,24 @@ import useDimensionHandler from './use-dimension-handler';
11
11
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
12
12
  const IMAGE_SIZE_PRESETS = [25, 50, 75, 100];
13
13
  const noop = () => {};
14
+
15
+ /**
16
+ * Get scaled width and height for the given scale.
17
+ *
18
+ * @param {number} scale The scale to get the scaled width and height for.
19
+ * @param {number} imageWidth The image width.
20
+ * @param {number} imageHeight The image height.
21
+ *
22
+ * @return {Object} The scaled width and height.
23
+ */
24
+ function getScaledWidthAndHeight(scale, imageWidth, imageHeight) {
25
+ const scaledWidth = Math.round(imageWidth * (scale / 100));
26
+ const scaledHeight = Math.round(imageHeight * (scale / 100));
27
+ return {
28
+ scaledWidth,
29
+ scaledHeight
30
+ };
31
+ }
14
32
  export default function ImageSizeControl({
15
33
  imageSizeHelp,
16
34
  imageWidth,
@@ -29,6 +47,35 @@ export default function ImageSizeControl({
29
47
  updateDimension,
30
48
  updateDimensions
31
49
  } = useDimensionHandler(height, width, imageHeight, imageWidth, onChange);
50
+
51
+ /**
52
+ * Updates the dimensions for the given scale.
53
+ * Handler for toggle group control change.
54
+ *
55
+ * @param {number} scale The scale to update the dimensions for.
56
+ */
57
+ const handleUpdateDimensions = scale => {
58
+ if (undefined === scale) {
59
+ updateDimensions();
60
+ return;
61
+ }
62
+ const {
63
+ scaledWidth,
64
+ scaledHeight
65
+ } = getScaledWidthAndHeight(scale, imageWidth, imageHeight);
66
+ updateDimensions(scaledHeight, scaledWidth);
67
+ };
68
+
69
+ /**
70
+ * Add the stored image preset value to toggle group control.
71
+ */
72
+ const selectedValue = IMAGE_SIZE_PRESETS.find(scale => {
73
+ const {
74
+ scaledWidth,
75
+ scaledHeight
76
+ } = getScaledWidthAndHeight(scale, imageWidth, imageHeight);
77
+ return currentWidth === scaledWidth && currentHeight === scaledHeight;
78
+ });
32
79
  return /*#__PURE__*/_jsxs(_Fragment, {
33
80
  children: [imageSizeOptions && imageSizeOptions.length > 0 && /*#__PURE__*/_jsx(SelectControl, {
34
81
  __nextHasNoMarginBottom: true,
@@ -58,26 +105,20 @@ export default function ImageSizeControl({
58
105
  onChange: value => updateDimension('height', value),
59
106
  size: "__unstable-large"
60
107
  })]
61
- }), /*#__PURE__*/_jsxs(HStack, {
62
- children: [/*#__PURE__*/_jsx(ButtonGroup, {
63
- "aria-label": __('Image size presets'),
64
- children: IMAGE_SIZE_PRESETS.map(scale => {
65
- const scaledWidth = Math.round(imageWidth * (scale / 100));
66
- const scaledHeight = Math.round(imageHeight * (scale / 100));
67
- const isCurrent = currentWidth === scaledWidth && currentHeight === scaledHeight;
68
- return /*#__PURE__*/_jsxs(Button, {
69
- size: "small",
70
- variant: isCurrent ? 'primary' : undefined,
71
- isPressed: isCurrent,
72
- onClick: () => updateDimensions(scaledHeight, scaledWidth),
73
- children: [scale, "%"]
74
- }, scale);
75
- })
76
- }), /*#__PURE__*/_jsx(Button, {
77
- size: "small",
78
- onClick: () => updateDimensions(),
79
- children: __('Reset')
80
- })]
108
+ }), /*#__PURE__*/_jsx(ToggleGroupControl, {
109
+ label: __('Image size presets'),
110
+ hideLabelFromVision: true,
111
+ onChange: handleUpdateDimensions,
112
+ value: selectedValue,
113
+ isBlock: true,
114
+ __next40pxDefaultSize: true,
115
+ __nextHasNoMarginBottom: true,
116
+ children: IMAGE_SIZE_PRESETS.map(scale => {
117
+ return /*#__PURE__*/_jsx(ToggleGroupControlOption, {
118
+ value: scale,
119
+ label: `${scale}%`
120
+ }, scale);
121
+ })
81
122
  })]
82
123
  })]
83
124
  });
@@ -1 +1 @@
1
- {"version":3,"names":["Button","ButtonGroup","SelectControl","__experimentalNumberControl","NumberControl","__experimentalHStack","HStack","__","useDimensionHandler","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","IMAGE_SIZE_PRESETS","noop","ImageSizeControl","imageSizeHelp","imageWidth","imageHeight","imageSizeOptions","isResizable","slug","width","height","onChange","onChangeImage","currentHeight","currentWidth","updateDimension","updateDimensions","children","length","__nextHasNoMarginBottom","label","value","options","help","size","className","align","spacing","min","map","scale","scaledWidth","Math","round","scaledHeight","isCurrent","variant","undefined","isPressed","onClick"],"sources":["@wordpress/block-editor/src/components/image-size-control/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tButton,\n\tButtonGroup,\n\tSelectControl,\n\t__experimentalNumberControl as NumberControl,\n\t__experimentalHStack as HStack,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport useDimensionHandler from './use-dimension-handler';\n\nconst IMAGE_SIZE_PRESETS = [ 25, 50, 75, 100 ];\nconst noop = () => {};\n\nexport default function ImageSizeControl( {\n\timageSizeHelp,\n\timageWidth,\n\timageHeight,\n\timageSizeOptions = [],\n\tisResizable = true,\n\tslug,\n\twidth,\n\theight,\n\tonChange,\n\tonChangeImage = noop,\n} ) {\n\tconst { currentHeight, currentWidth, updateDimension, updateDimensions } =\n\t\tuseDimensionHandler( height, width, imageHeight, imageWidth, onChange );\n\n\treturn (\n\t\t<>\n\t\t\t{ imageSizeOptions && imageSizeOptions.length > 0 && (\n\t\t\t\t<SelectControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Resolution' ) }\n\t\t\t\t\tvalue={ slug }\n\t\t\t\t\toptions={ imageSizeOptions }\n\t\t\t\t\tonChange={ onChangeImage }\n\t\t\t\t\thelp={ imageSizeHelp }\n\t\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ isResizable && (\n\t\t\t\t<div className=\"block-editor-image-size-control\">\n\t\t\t\t\t<HStack align=\"baseline\" spacing=\"3\">\n\t\t\t\t\t\t<NumberControl\n\t\t\t\t\t\t\tclassName=\"block-editor-image-size-control__width\"\n\t\t\t\t\t\t\tlabel={ __( 'Width' ) }\n\t\t\t\t\t\t\tvalue={ currentWidth }\n\t\t\t\t\t\t\tmin={ 1 }\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tupdateDimension( 'width', value )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<NumberControl\n\t\t\t\t\t\t\tclassName=\"block-editor-image-size-control__height\"\n\t\t\t\t\t\t\tlabel={ __( 'Height' ) }\n\t\t\t\t\t\t\tvalue={ currentHeight }\n\t\t\t\t\t\t\tmin={ 1 }\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tupdateDimension( 'height', value )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</HStack>\n\t\t\t\t\t<HStack>\n\t\t\t\t\t\t<ButtonGroup aria-label={ __( 'Image size presets' ) }>\n\t\t\t\t\t\t\t{ IMAGE_SIZE_PRESETS.map( ( scale ) => {\n\t\t\t\t\t\t\t\tconst scaledWidth = Math.round(\n\t\t\t\t\t\t\t\t\timageWidth * ( scale / 100 )\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tconst scaledHeight = Math.round(\n\t\t\t\t\t\t\t\t\timageHeight * ( scale / 100 )\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\tconst isCurrent =\n\t\t\t\t\t\t\t\t\tcurrentWidth === scaledWidth &&\n\t\t\t\t\t\t\t\t\tcurrentHeight === scaledHeight;\n\n\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\tkey={ scale }\n\t\t\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\t\t\tvariant={\n\t\t\t\t\t\t\t\t\t\t\tisCurrent ? 'primary' : undefined\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tisPressed={ isCurrent }\n\t\t\t\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\t\t\t\tupdateDimensions(\n\t\t\t\t\t\t\t\t\t\t\t\tscaledHeight,\n\t\t\t\t\t\t\t\t\t\t\t\tscaledWidth\n\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ scale }%\n\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t</ButtonGroup>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tsize=\"small\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5BlB,aAAa,KAAKqB,YAAY;YAE/B,oBACCrC,KAAA,CAACZ,MAAM;cAENuC,IAAI,EAAC,OAAO;cACZY,OAAO,EACND,SAAS,GAAG,SAAS,GAAGE,SACxB;cACDC,SAAS,EAAGH,SAAW;cACvBI,OAAO,EAAGA,CAAA,KACTvB,gBAAgB,CACfkB,YAAY,EACZH,WACD,CACA;cAAAd,QAAA,GAECa,KAAK,EAAE,GACV;YAAA,GAdOA,KAcC,CAAC;UAEX,CAAE;QAAC,CACS,CAAC,eACdnC,IAAA,CAACV,MAAM;UACNuC,IAAI,EAAC,OAAO;UACZe,OAAO,EAAGA,CAAA,KAAMvB,gBAAgB,CAAC,CAAG;UAAAC,QAAA,EAElCzB,EAAE,CAAE,OAAQ;QAAC,CACR,CAAC;MAAA,CACF,CAAC;IAAA,CACL,CACL;EAAA,CACA,CAAC;AAEL","ignoreList":[]}
1
+ {"version":3,"names":["SelectControl","__experimentalNumberControl","NumberControl","__experimentalHStack","HStack","__experimentalToggleGroupControl","ToggleGroupControl","__experimentalToggleGroupControlOption","ToggleGroupControlOption","__","useDimensionHandler","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","IMAGE_SIZE_PRESETS","noop","getScaledWidthAndHeight","scale","imageWidth","imageHeight","scaledWidth","Math","round","scaledHeight","ImageSizeControl","imageSizeHelp","imageSizeOptions","isResizable","slug","width","height","onChange","onChangeImage","currentHeight","currentWidth","updateDimension","updateDimensions","handleUpdateDimensions","undefined","selectedValue","find","children","length","__nextHasNoMarginBottom","label","value","options","help","size","className","align","spacing","min","hideLabelFromVision","isBlock","__next40pxDefaultSize","map"],"sources":["@wordpress/block-editor/src/components/image-size-control/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tSelectControl,\n\t__experimentalNumberControl as NumberControl,\n\t__experimentalHStack as HStack,\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport useDimensionHandler from './use-dimension-handler';\n\nconst IMAGE_SIZE_PRESETS = [ 25, 50, 75, 100 ];\nconst noop = () => {};\n\n/**\n * Get scaled width and height for the given scale.\n *\n * @param {number} scale The scale to get the scaled width and height for.\n * @param {number} imageWidth The image width.\n * @param {number} imageHeight The image height.\n *\n * @return {Object} The scaled width and height.\n */\nfunction getScaledWidthAndHeight( scale, imageWidth, imageHeight ) {\n\tconst scaledWidth = Math.round( imageWidth * ( scale / 100 ) );\n\tconst scaledHeight = Math.round( imageHeight * ( scale / 100 ) );\n\n\treturn {\n\t\tscaledWidth,\n\t\tscaledHeight,\n\t};\n}\n\nexport default function ImageSizeControl( {\n\timageSizeHelp,\n\timageWidth,\n\timageHeight,\n\timageSizeOptions = [],\n\tisResizable = true,\n\tslug,\n\twidth,\n\theight,\n\tonChange,\n\tonChangeImage = noop,\n} ) {\n\tconst { currentHeight, currentWidth, updateDimension, updateDimensions } =\n\t\tuseDimensionHandler( height, width, imageHeight, imageWidth, onChange );\n\n\t/**\n\t * Updates the dimensions for the given scale.\n\t * Handler for toggle group control change.\n\t *\n\t * @param {number} scale The scale to update the dimensions for.\n\t */\n\tconst handleUpdateDimensions = ( scale ) => {\n\t\tif ( undefined === scale ) {\n\t\t\tupdateDimensions();\n\t\t\treturn;\n\t\t}\n\n\t\tconst { scaledWidth, scaledHeight } = getScaledWidthAndHeight(\n\t\t\tscale,\n\t\t\timageWidth,\n\t\t\timageHeight\n\t\t);\n\n\t\tupdateDimensions( scaledHeight, scaledWidth );\n\t};\n\n\t/**\n\t * Add the stored image preset value to toggle group control.\n\t */\n\tconst selectedValue = IMAGE_SIZE_PRESETS.find( ( scale ) => {\n\t\tconst { scaledWidth, scaledHeight } = getScaledWidthAndHeight(\n\t\t\tscale,\n\t\t\timageWidth,\n\t\t\timageHeight\n\t\t);\n\n\t\treturn currentWidth === scaledWidth && currentHeight === scaledHeight;\n\t} );\n\n\treturn (\n\t\t<>\n\t\t\t{ imageSizeOptions && imageSizeOptions.length > 0 && (\n\t\t\t\t<SelectControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Resolution' ) }\n\t\t\t\t\tvalue={ slug }\n\t\t\t\t\toptions={ imageSizeOptions }\n\t\t\t\t\tonChange={ onChangeImage }\n\t\t\t\t\thelp={ imageSizeHelp }\n\t\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ isResizable && (\n\t\t\t\t<div className=\"block-editor-image-size-control\">\n\t\t\t\t\t<HStack align=\"baseline\" spacing=\"3\">\n\t\t\t\t\t\t<NumberControl\n\t\t\t\t\t\t\tclassName=\"block-editor-image-size-control__width\"\n\t\t\t\t\t\t\tlabel={ __( 'Width' ) }\n\t\t\t\t\t\t\tvalue={ currentWidth }\n\t\t\t\t\t\t\tmin={ 1 }\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tupdateDimension( 'width', value )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<NumberControl\n\t\t\t\t\t\t\tclassName=\"block-editor-image-size-control__height\"\n\t\t\t\t\t\t\tlabel={ __( 'Height' ) }\n\t\t\t\t\t\t\tvalue={ currentHeight }\n\t\t\t\t\t\t\tmin={ 1 }\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tupdateDimension( 'height', value )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</HStack>\n\t\t\t\t\t<ToggleGroupControl\n\t\t\t\t\t\tlabel={ __( 'Image size presets' ) }\n\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\tonChange={ handleUpdateDimensions }\n\t\t\t\t\t\tvalue={ selectedValue }\n\t\t\t\t\t\tisBlock\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t>\n\t\t\t\t\t\t{ IMAGE_SIZE_PRESETS.map( ( scale ) => {\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\t\t\tkey={ scale }\n\t\t\t\t\t\t\t\t\tvalue={ scale }\n\t\t\t\t\t\t\t\t\tlabel={ `${ scale }%` }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} ) }\n\t\t\t\t\t</ToggleGroupControl>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SACCA,aAAa,EACbC,2BAA2B,IAAIC,aAAa,EAC5CC,oBAAoB,IAAIC,MAAM,EAC9BC,gCAAgC,IAAIC,kBAAkB,EACtDC,sCAAsC,IAAIC,wBAAwB,QAC5D,uBAAuB;AAC9B,SAASC,EAAE,QAAQ,iBAAiB;;AAEpC;AACA;AACA;AACA,OAAOC,mBAAmB,MAAM,yBAAyB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA,EAAAC,QAAA,IAAAC,SAAA;AAE1D,MAAMC,kBAAkB,GAAG,CAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,CAAE;AAC9C,MAAMC,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;;AAErB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,uBAAuBA,CAAEC,KAAK,EAAEC,UAAU,EAAEC,WAAW,EAAG;EAClE,MAAMC,WAAW,GAAGC,IAAI,CAACC,KAAK,CAAEJ,UAAU,IAAKD,KAAK,GAAG,GAAG,CAAG,CAAC;EAC9D,MAAMM,YAAY,GAAGF,IAAI,CAACC,KAAK,CAAEH,WAAW,IAAKF,KAAK,GAAG,GAAG,CAAG,CAAC;EAEhE,OA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B,CAAC;IAAA,CACjB,CACL;EAAA,CACA,CAAC;AAEL","ignoreList":[]}
@@ -163,17 +163,21 @@ export function useInnerBlocksProps(props = {}, options = {}) {
163
163
  const selected = useSelect(select => {
164
164
  const {
165
165
  getBlockName,
166
- __unstableGetEditorMode,
166
+ isZoomOut,
167
167
  getTemplateLock,
168
168
  getBlockRootClientId,
169
169
  getBlockEditingMode,
170
170
  getBlockSettings,
171
171
  getSectionRootClientId
172
172
  } = unlock(select(blockEditorStore));
173
- let _isDropZoneDisabled;
174
173
  if (!clientId) {
174
+ const sectionRootClientId = getSectionRootClientId();
175
+ // Disable the root drop zone when zoomed out and the section root client id
176
+ // is not the root block list (represented by an empty string).
177
+ // This avoids drag handling bugs caused by having two block lists acting as
178
+ // drop zones - the actual 'root' block list and the section root.
175
179
  return {
176
- isDropZoneDisabled: _isDropZoneDisabled
180
+ isDropZoneDisabled: isZoomOut() && sectionRootClientId !== ''
177
181
  };
178
182
  }
179
183
  const {
@@ -184,8 +188,8 @@ export function useInnerBlocksProps(props = {}, options = {}) {
184
188
  const blockEditingMode = getBlockEditingMode(clientId);
185
189
  const parentClientId = getBlockRootClientId(clientId);
186
190
  const [defaultLayout] = getBlockSettings(clientId, 'layout');
187
- _isDropZoneDisabled = blockEditingMode === 'disabled';
188
- if (__unstableGetEditorMode() === 'zoom-out') {
191
+ let _isDropZoneDisabled = blockEditingMode === 'disabled';
192
+ if (isZoomOut()) {
189
193
  // In zoom out mode, we want to disable the drop zone for the sections.
190
194
  // The inner blocks belonging to the section drop zone is
191
195
  // already disabled by the blocks themselves being disabled.
@@ -1 +1 @@
1
- {"version":3,"names":["clsx","useMergeRefs","forwardRef","useMemo","memo","useSelect","getBlockSupport","store","blocksStore","__unstableGetInnerBlocksProps","getInnerBlocksProps","ButtonBlockAppender","DefaultBlockAppender","useNestedSettingsUpdate","useInnerBlockTemplateSync","useBlockContext","BlockListItems","BlockContextProvider","useBlockEditContext","useBlockSync","blockEditorStore","useBlockDropZone","unlock","jsx","_jsx","EMPTY_OBJECT","BlockContext","children","clientId","context","value","BlockListItemsMemo","UncontrolledInnerBlocks","props","allowedBlocks","prioritizedInserterBlocks","defaultBlock","directInsert","__experimentalDefaultBlock","__experimentalDirectInsert","template","templateLock","wrapperRef","templateInsertUpdatesSelection","__experimentalCaptureToolbars","captureToolbars","__experimentalAppenderTagName","renderAppender","orientation","placeholder","layout","name","blockType","parentLock","defaultLayout","defaultLayoutBlockSupport","allowSizingOnChildren","usedLayout","memoedLayout","items","rootClientId","providesContext","Object","keys","length","ControlledInnerBlocks","ForwardedInnerBlocks","ref","innerBlocksProps","useInnerBlocksProps","className","options","__unstableDisableLayoutClassNames","__unstableDisableDropZone","dropZoneElement","__unstableLayoutClassNames","layoutClassNames","selected","select","getBlockName","__unstableGetEditorMode","getTemplateLock","getBlockRootClientId","getBlockEditingMode","getBlockSettings","getSectionRootClientId","_isDropZoneDisabled","isDropZoneDisabled","hasBlockSupport","getBlockType","blockName","blockEditingMode","parentClientId","sectionRootClientId","blockDropZoneRef","isManualPlacement","window","__experimentalEnableGridInteractivity","InnerBlocks","onChange","save","Content"],"sources":["@wordpress/block-editor/src/components/inner-blocks/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useMergeRefs } from '@wordpress/compose';\nimport { forwardRef, useMemo, memo } 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 { unlock } from '../../lock-unlock';\n\nconst EMPTY_OBJECT = {};\n\nfunction BlockContext( { children, clientId } ) {\n\tconst context = useBlockContext( clientId );\n\treturn (\n\t\t<BlockContextProvider value={ context }>\n\t\t\t{ children }\n\t\t</BlockContextProvider>\n\t);\n}\n\nconst BlockListItemsMemo = memo( BlockListItems );\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\tprioritizedInserterBlocks,\n\t\tdefaultBlock,\n\t\tdirectInsert,\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\tname,\n\t\tblockType,\n\t\tparentLock,\n\t\tdefaultLayout,\n\t} = props;\n\n\tuseNestedSettingsUpdate(\n\t\tclientId,\n\t\tparentLock,\n\t\tallowedBlocks,\n\t\tprioritizedInserterBlocks,\n\t\tdefaultBlock,\n\t\tdirectInsert,\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 defaultLayoutBlockSupport =\n\t\tgetBlockSupport( name, 'layout' ) ||\n\t\tgetBlockSupport( name, '__experimentalLayout' ) ||\n\t\tEMPTY_OBJECT;\n\n\tconst { allowSizingOnChildren = false } = defaultLayoutBlockSupport;\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// For controlled inner blocks, we don't want a change in blocks to\n\t// re-render the blocks list.\n\tconst items = (\n\t\t<BlockListItemsMemo\n\t\t\trootClientId={ clientId }\n\t\t\trenderAppender={ renderAppender }\n\t\t\t__experimentalAppenderTagName={ __experimentalAppenderTagName }\n\t\t\tlayout={ memoedLayout }\n\t\t\twrapperRef={ wrapperRef }\n\t\t\tplaceholder={ placeholder }\n\t\t/>\n\t);\n\n\tif (\n\t\t! blockType?.providesContext ||\n\t\tObject.keys( blockType.providesContext ).length === 0\n\t) {\n\t\treturn items;\n\t}\n\n\treturn <BlockContext clientId={ clientId }>{ items }</BlockContext>;\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 {\n\t\t__unstableDisableLayoutClassNames,\n\t\t__unstableDisableDropZone,\n\t\tdropZoneElement,\n\t} = options;\n\tconst {\n\t\tclientId,\n\t\tlayout = null,\n\t\t__unstableLayoutClassNames: layoutClassNames = '',\n\t} = useBlockEditContext();\n\tconst selected = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockName,\n\t\t\t\t__unstableGetEditorMode,\n\t\t\t\tgetTemplateLock,\n\t\t\t\tgetBlockRootClientId,\n\t\t\t\tgetBlockEditingMode,\n\t\t\t\tgetBlockSettings,\n\t\t\t\tgetSectionRootClientId,\n\t\t\t} = unlock( select( blockEditorStore ) );\n\t\t\tlet _isDropZoneDisabled;\n\n\t\t\tif ( ! clientId ) {\n\t\t\t\treturn { isDropZoneDisabled: _isDropZoneDisabled };\n\t\t\t}\n\n\t\t\tconst { hasBlockSupport, getBlockType } = select( blocksStore );\n\t\t\tconst blockName = getBlockName( clientId );\n\t\t\tconst blockEditingMode = getBlockEditingMode( clientId );\n\t\t\tconst parentClientId = getBlockRootClientId( clientId );\n\t\t\tconst [ defaultLayout ] = getBlockSettings( clientId, 'layout' );\n\n\t\t\t_isDropZoneDisabled = blockEditingMode === 'disabled';\n\n\t\t\tif ( __unstableGetEditorMode() === 'zoom-out' ) {\n\t\t\t\t// In zoom out mode, we want to disable the drop zone for the sections.\n\t\t\t\t// The inner blocks belonging to the section drop zone is\n\t\t\t\t// already disabled by the blocks themselves being disabled.\n\t\t\t\tconst sectionRootClientId = getSectionRootClientId();\n\n\t\t\t\t_isDropZoneDisabled = clientId !== sectionRootClientId;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\t__experimentalCaptureToolbars: 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\tname: blockName,\n\t\t\t\tblockType: getBlockType( blockName ),\n\t\t\t\tparentLock: getTemplateLock( parentClientId ),\n\t\t\t\tparentClientId,\n\t\t\t\tisDropZoneDisabled: _isDropZoneDisabled,\n\t\t\t\tdefaultLayout,\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\tconst {\n\t\t__experimentalCaptureToolbars,\n\t\tname,\n\t\tblockType,\n\t\tparentLock,\n\t\tparentClientId,\n\t\tisDropZoneDisabled,\n\t\tdefaultLayout,\n\t} = selected;\n\n\tconst blockDropZoneRef = useBlockDropZone( {\n\t\tdropZoneElement,\n\t\trootClientId: clientId,\n\t\tparentClientId,\n\t} );\n\n\tconst ref = useMergeRefs( [\n\t\tprops.ref,\n\t\t__unstableDisableDropZone ||\n\t\tisDropZoneDisabled ||\n\t\t( layout?.isManualPlacement &&\n\t\t\twindow.__experimentalEnableGridInteractivity )\n\t\t\t? null\n\t\t\t: blockDropZoneRef,\n\t] );\n\n\tconst innerBlocksProps = {\n\t\t__experimentalCaptureToolbars,\n\t\tlayout,\n\t\tname,\n\t\tblockType,\n\t\tparentLock,\n\t\tdefaultLayout,\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: clsx(\n\t\t\tprops.className,\n\t\t\t'block-editor-block-list__layout',\n\t\t\t__unstableDisableLayoutClassNames ? '' : layoutClassNames\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"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,YAAY,QAAQ,oBAAoB;AACjD,SAASC,UAAU,EAAEC,OAAO,EAAEC,IAAI,QAAQ,oBAAoB;AAC9D,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SACCC,eAAe,EACfC,KAAK,IAAIC,WAAW,EACpBC,6BAA6B,IAAIC,mBAAmB,QAC9C,mBAAmB;;AAE1B;AACA;AACA;AACA,OAAOC,mBAAmB,MAAM,yBAAyB;AACzD,OAAOC,oBAAoB,MAAM,0BAA0B;AAC3D,OAAOC,uBAAuB,MAAM,8BAA8B;AAClE,OAAOC,yBAAyB,MAAM,iCAAiC;AACvE,OAAOC,eAAe,MAAM,qBAAqB;AACjD,SAASC,cAAc,QAAQ,eAAe;AAC9C,SAASC,oBAAoB,QAAQ,kBAAkB;AACvD,SAASC,mBAAmB,QAAQ,uBAAuB;AAC3D,OAAOC,YAAY,MAAM,4BAA4B;AACrD,SAASZ,KAAK,IAAIa,gBAAgB,QAAQ,aAAa;AACvD,OAAOC,gBAAgB,MAAM,wBAAwB;AACrD,SAASC,MAAM,QAAQ,mBAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE3C,MAAMC,YAAY,GAAG,CAAC,CAAC;AAEvB,SAASC,YAAYA,C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AAE,CAAC,gBAE7DJ,IAAA,CAACR,cAAc;MAAA,GAAMuD;IAAO,CAAI;EAElC,CAAC;AACF;AAEAF,mBAAmB,CAAC+B,IAAI,GAAG1F,mBAAmB;;AAE9C;AACAwD,oBAAoB,CAACtD,oBAAoB,GAAGA,oBAAoB;AAChEsD,oBAAoB,CAACvD,mBAAmB,GAAGA,mBAAmB;AAE9DuD,oBAAoB,CAACmC,OAAO,GAAG,MAAMhC,mBAAmB,CAAC+B,IAAI,CAAC,CAAC,CAACzE,QAAQ;;AAExE;AACA;AACA;AACA,eAAeuC,oBAAoB","ignoreList":[]}
1
+ {"version":3,"names":["clsx","useMergeRefs","forwardRef","useMemo","memo","useSelect","getBlockSupport","store","blocksStore","__unstableGetInnerBlocksProps","getInnerBlocksProps","ButtonBlockAppender","DefaultBlockAppender","useNestedSettingsUpdate","useInnerBlockTemplateSync","useBlockContext","BlockListItems","BlockContextProvider","useBlockEditContext","useBlockSync","blockEditorStore","useBlockDropZone","unlock","jsx","_jsx","EMPTY_OBJECT","BlockContext","children","clientId","context","value","BlockListItemsMemo","UncontrolledInnerBlocks","props","allowedBlocks","prioritizedInserterBlocks","defaultBlock","directInsert","__experimentalDefaultBlock","__experimentalDirectInsert","template","templateLock","wrapperRef","templateInsertUpdatesSelection","__experimentalCaptureToolbars","captureToolbars","__experimentalAppenderTagName","renderAppender","orientation","placeholder","layout","name","blockType","parentLock","defaultLayout","defaultLayoutBlockSupport","allowSizingOnChildren","usedLayout","memoedLayout","items","rootClientId","providesContext","Object","keys","length","ControlledInnerBlocks","ForwardedInnerBlocks","ref","innerBlocksProps","useInnerBlocksProps","className","options","__unstableDisableLayoutClassNames","__unstableDisableDropZone","dropZoneElement","__unstableLayoutClassNames","layoutClassNames","selected","select","getBlockName","isZoomOut","getTemplateLock","getBlockRootClientId","getBlockEditingMode","getBlockSettings","getSectionRootClientId","sectionRootClientId","isDropZoneDisabled","hasBlockSupport","getBlockType","blockName","blockEditingMode","parentClientId","_isDropZoneDisabled","blockDropZoneRef","isManualPlacement","window","__experimentalEnableGridInteractivity","InnerBlocks","onChange","save","Content"],"sources":["@wordpress/block-editor/src/components/inner-blocks/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useMergeRefs } from '@wordpress/compose';\nimport { forwardRef, useMemo, memo } 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 { unlock } from '../../lock-unlock';\n\nconst EMPTY_OBJECT = {};\n\nfunction BlockContext( { children, clientId } ) {\n\tconst context = useBlockContext( clientId );\n\treturn (\n\t\t<BlockContextProvider value={ context }>\n\t\t\t{ children }\n\t\t</BlockContextProvider>\n\t);\n}\n\nconst BlockListItemsMemo = memo( BlockListItems );\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\tprioritizedInserterBlocks,\n\t\tdefaultBlock,\n\t\tdirectInsert,\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\tname,\n\t\tblockType,\n\t\tparentLock,\n\t\tdefaultLayout,\n\t} = props;\n\n\tuseNestedSettingsUpdate(\n\t\tclientId,\n\t\tparentLock,\n\t\tallowedBlocks,\n\t\tprioritizedInserterBlocks,\n\t\tdefaultBlock,\n\t\tdirectInsert,\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 defaultLayoutBlockSupport =\n\t\tgetBlockSupport( name, 'layout' ) ||\n\t\tgetBlockSupport( name, '__experimentalLayout' ) ||\n\t\tEMPTY_OBJECT;\n\n\tconst { allowSizingOnChildren = false } = defaultLayoutBlockSupport;\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// For controlled inner blocks, we don't want a change in blocks to\n\t// re-render the blocks list.\n\tconst items = (\n\t\t<BlockListItemsMemo\n\t\t\trootClientId={ clientId }\n\t\t\trenderAppender={ renderAppender }\n\t\t\t__experimentalAppenderTagName={ __experimentalAppenderTagName }\n\t\t\tlayout={ memoedLayout }\n\t\t\twrapperRef={ wrapperRef }\n\t\t\tplaceholder={ placeholder }\n\t\t/>\n\t);\n\n\tif (\n\t\t! blockType?.providesContext ||\n\t\tObject.keys( blockType.providesContext ).length === 0\n\t) {\n\t\treturn items;\n\t}\n\n\treturn <BlockContext clientId={ clientId }>{ items }</BlockContext>;\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 {\n\t\t__unstableDisableLayoutClassNames,\n\t\t__unstableDisableDropZone,\n\t\tdropZoneElement,\n\t} = options;\n\tconst {\n\t\tclientId,\n\t\tlayout = null,\n\t\t__unstableLayoutClassNames: layoutClassNames = '',\n\t} = useBlockEditContext();\n\tconst selected = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockName,\n\t\t\t\tisZoomOut,\n\t\t\t\tgetTemplateLock,\n\t\t\t\tgetBlockRootClientId,\n\t\t\t\tgetBlockEditingMode,\n\t\t\t\tgetBlockSettings,\n\t\t\t\tgetSectionRootClientId,\n\t\t\t} = unlock( select( blockEditorStore ) );\n\n\t\t\tif ( ! clientId ) {\n\t\t\t\tconst sectionRootClientId = getSectionRootClientId();\n\t\t\t\t// Disable the root drop zone when zoomed out and the section root client id\n\t\t\t\t// is not the root block list (represented by an empty string).\n\t\t\t\t// This avoids drag handling bugs caused by having two block lists acting as\n\t\t\t\t// drop zones - the actual 'root' block list and the section root.\n\t\t\t\treturn {\n\t\t\t\t\tisDropZoneDisabled:\n\t\t\t\t\t\tisZoomOut() && sectionRootClientId !== '',\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tconst { hasBlockSupport, getBlockType } = select( blocksStore );\n\t\t\tconst blockName = getBlockName( clientId );\n\t\t\tconst blockEditingMode = getBlockEditingMode( clientId );\n\t\t\tconst parentClientId = getBlockRootClientId( clientId );\n\t\t\tconst [ defaultLayout ] = getBlockSettings( clientId, 'layout' );\n\n\t\t\tlet _isDropZoneDisabled = blockEditingMode === 'disabled';\n\n\t\t\tif ( isZoomOut() ) {\n\t\t\t\t// In zoom out mode, we want to disable the drop zone for the sections.\n\t\t\t\t// The inner blocks belonging to the section drop zone is\n\t\t\t\t// already disabled by the blocks themselves being disabled.\n\t\t\t\tconst sectionRootClientId = getSectionRootClientId();\n\t\t\t\t_isDropZoneDisabled = clientId !== sectionRootClientId;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\t__experimentalCaptureToolbars: 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\tname: blockName,\n\t\t\t\tblockType: getBlockType( blockName ),\n\t\t\t\tparentLock: getTemplateLock( parentClientId ),\n\t\t\t\tparentClientId,\n\t\t\t\tisDropZoneDisabled: _isDropZoneDisabled,\n\t\t\t\tdefaultLayout,\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\tconst {\n\t\t__experimentalCaptureToolbars,\n\t\tname,\n\t\tblockType,\n\t\tparentLock,\n\t\tparentClientId,\n\t\tisDropZoneDisabled,\n\t\tdefaultLayout,\n\t} = selected;\n\n\tconst blockDropZoneRef = useBlockDropZone( {\n\t\tdropZoneElement,\n\t\trootClientId: clientId,\n\t\tparentClientId,\n\t} );\n\n\tconst ref = useMergeRefs( [\n\t\tprops.ref,\n\t\t__unstableDisableDropZone ||\n\t\tisDropZoneDisabled ||\n\t\t( layout?.isManualPlacement &&\n\t\t\twindow.__experimentalEnableGridInteractivity )\n\t\t\t? null\n\t\t\t: blockDropZoneRef,\n\t] );\n\n\tconst innerBlocksProps = {\n\t\t__experimentalCaptureToolbars,\n\t\tlayout,\n\t\tname,\n\t\tblockType,\n\t\tparentLock,\n\t\tdefaultLayout,\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: clsx(\n\t\t\tprops.className,\n\t\t\t'block-editor-block-list__layout',\n\t\t\t__unstableDisableLayoutClassNames ? '' : layoutClassNames\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"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI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oB","ignoreList":[]}
@@ -57,7 +57,8 @@ function PatternList({
57
57
  return true;
58
58
  }
59
59
  if (selectedCategory === 'uncategorized') {
60
- const hasKnownCategory = pattern.categories.some(category => registeredPatternCategories.includes(category));
60
+ var _pattern$categories$s;
61
+ const hasKnownCategory = (_pattern$categories$s = pattern.categories?.some(category => registeredPatternCategories.includes(category))) !== null && _pattern$categories$s !== void 0 ? _pattern$categories$s : false;
61
62
  return !pattern.categories?.length || !hasKnownCategory;
62
63
  }
63
64
  return pattern.categories?.includes(selectedCategory);
@@ -96,7 +97,6 @@ function PatternList({
96
97
  }), /*#__PURE__*/_jsx(InserterListbox, {
97
98
  children: hasItems && /*#__PURE__*/_jsxs(_Fragment, {
98
99
  children: [/*#__PURE__*/_jsx(BlockPatternsList, {
99
- shownPatterns: pagingProps.categoryPatternsAsyncList,
100
100
  blockPatterns: pagingProps.categoryPatterns,
101
101
  onClickPattern: onClickPattern,
102
102
  isDraggable: false
@@ -1 +1 @@
1
- {"version":3,"names":["useMemo","useEffect","useRef","useState","_n","sprintf","useDebounce","__experimentalHeading","Heading","speak","BlockPatternsList","useInsertionPoint","usePatternsState","InserterListbox","searchItems","BlockPatternsPaging","usePatternsPaging","INSERTER_PATTERN_TYPES","allPatternsCategory","myPatternsCategory","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","PatternsListHeader","filterValue","filteredBlockPatternsLength","level","lineHeight","className","children","PatternList","searchValue","selectedCategory","patternCategories","rootClientId","container","debouncedSpeak","destinationRootClientId","onInsertBlocks","shouldFocusBlock","patterns","onClickPattern","registeredPatternCategories","map","patternCategory","name","filteredBlockPatterns","filteredPatterns","filter","pattern","type","user","hasKnownCategory","categories","some","category","includes","length","count","resultsFoundMessage","pagingProps","previousSearchValue","setPreviousSearchValue","changePage","hasItems","ref","shownPatterns","categoryPatternsAsyncList","blockPatterns","categoryPatterns","isDraggable"],"sources":["@wordpress/block-editor/src/components/inserter/block-patterns-explorer/pattern-list.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo, useEffect, useRef, useState } from '@wordpress/element';\nimport { _n, sprintf } from '@wordpress/i18n';\nimport { useDebounce } from '@wordpress/compose';\nimport { __experimentalHeading as Heading } from '@wordpress/components';\nimport { speak } from '@wordpress/a11y';\n\n/**\n * Internal dependencies\n */\nimport BlockPatternsList from '../../block-patterns-list';\nimport useInsertionPoint from '../hooks/use-insertion-point';\nimport usePatternsState from '../hooks/use-patterns-state';\nimport InserterListbox from '../../inserter-listbox';\nimport { searchItems } from '../search-items';\nimport BlockPatternsPaging from '../../block-patterns-paging';\nimport usePatternsPaging from '../hooks/use-patterns-paging';\nimport {\n\tINSERTER_PATTERN_TYPES,\n\tallPatternsCategory,\n\tmyPatternsCategory,\n} from '../block-patterns-tab/utils';\n\nfunction PatternsListHeader( { filterValue, filteredBlockPatternsLength } ) {\n\tif ( ! filterValue ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Heading\n\t\t\tlevel={ 2 }\n\t\t\tlineHeight=\"48px\"\n\t\t\tclassName=\"block-editor-block-patterns-explorer__search-results-count\"\n\t\t>\n\t\t\t{ sprintf(\n\t\t\t\t/* translators: %d: number of patterns. */\n\t\t\t\t_n(\n\t\t\t\t\t'%d pattern found',\n\t\t\t\t\t'%d patterns found',\n\t\t\t\t\tfilteredBlockPatternsLength\n\t\t\t\t),\n\t\t\t\tfilteredBlockPatternsLength\n\t\t\t) }\n\t\t</Heading>\n\t);\n}\n\nfunction PatternList( {\n\tsearchValue,\n\tselectedCategory,\n\tpatternCategories,\n\trootClientId,\n} ) {\n\tconst container = useRef();\n\tconst debouncedSpeak = useDebounce( speak, 500 );\n\tconst [ destinationRootClientId, onInsertBlocks ] = useInsertionPoint( {\n\t\trootClientId,\n\t\tshouldFocusBlock: true,\n\t} );\n\tconst [ patterns, , onClickPattern ] = usePatternsState(\n\t\tonInsertBlocks,\n\t\tdestinationRootClientId,\n\t\tselectedCategory\n\t);\n\n\tconst registeredPatternCategories = useMemo(\n\t\t() =>\n\t\t\tpatternCategories.map(\n\t\t\t\t( patternCategory ) => patternCategory.name\n\t\t\t),\n\t\t[ patternCategories ]\n\t);\n\n\tconst filteredBlockPatterns = useMemo( () => {\n\t\tconst filteredPatterns = patterns.filter( ( pattern ) => {\n\t\t\tif ( selectedCategory === allPatternsCategory.name ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tif (\n\t\t\t\tselectedCategory === myPatternsCategory.name &&\n\t\t\t\tpattern.type === INSERTER_PATTERN_TYPES.user\n\t\t\t) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tif ( selectedCategory === 'uncategorized' ) {\n\t\t\t\tconst hasKnownCategory = pattern.categories.some(\n\t\t\t\t\t( category ) =>\n\t\t\t\t\t\tregisteredPatternCategories.includes( category )\n\t\t\t\t);\n\n\t\t\t\treturn ! pattern.categories?.length || ! hasKnownCategory;\n\t\t\t}\n\n\t\t\treturn pattern.categories?.includes( selectedCategory );\n\t\t} );\n\n\t\tif ( ! searchValue ) {\n\t\t\treturn filteredPatterns;\n\t\t}\n\n\t\treturn searchItems( filteredPatterns, searchValue );\n\t}, [\n\t\tsearchValue,\n\t\tpatterns,\n\t\tselectedCategory,\n\t\tregisteredPatternCategories,\n\t] );\n\n\t// Announce search results on change.\n\tuseEffect( () => {\n\t\tif ( ! searchValue ) {\n\t\t\treturn;\n\t\t}\n\t\tconst count = filteredBlockPatterns.length;\n\t\tconst resultsFoundMessage = sprintf(\n\t\t\t/* translators: %d: number of results. */\n\t\t\t_n( '%d result found.', '%d results found.', count ),\n\t\t\tcount\n\t\t);\n\t\tdebouncedSpeak( resultsFoundMessage );\n\t}, [ searchValue, debouncedSpeak, filteredBlockPatterns.length ] );\n\n\tconst pagingProps = usePatternsPaging(\n\t\tfilteredBlockPatterns,\n\t\tselectedCategory,\n\t\tcontainer\n\t);\n\n\t// Reset page when search value changes.\n\tconst [ previousSearchValue, setPreviousSearchValue ] =\n\t\tuseState( searchValue );\n\tif ( searchValue !== previousSearchValue ) {\n\t\tsetPreviousSearchValue( searchValue );\n\t\tpagingProps.changePage( 1 );\n\t}\n\n\tconst hasItems = !! filteredBlockPatterns?.length;\n\treturn (\n\t\t<div\n\t\t\tclassName=\"block-editor-block-patterns-explorer__list\"\n\t\t\tref={ container }\n\t\t>\n\t\t\t<PatternsListHeader\n\t\t\t\tfilterValue={ searchValue }\n\t\t\t\tfilteredBlockPatternsLength={ filteredBlockPatterns.length }\n\t\t\t/>\n\n\t\t\t<InserterListbox>\n\t\t\t\t{ hasItems && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<BlockPatternsList\n\t\t\t\t\t\t\tshownPatterns={\n\t\t\t\t\t\t\t\tpagingProps.categoryPatternsAsyncList\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tblockPatterns={ pagingProps.categoryPatterns }\n\t\t\t\t\t\t\tonClickPattern={ onClickPattern }\n\t\t\t\t\t\t\tisDraggable={ false }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<BlockPatternsPaging { ...pagingProps } />\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</InserterListbox>\n\t\t</div>\n\t);\n}\n\nexport default PatternList;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,OAAO,EAAEC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,oBAAoB;AACzE,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,WAAW,QAAQ,oBAAoB;AAChD,SAASC,qBAAqB,IAAIC,OAAO,QAAQ,uBAAuB;AACxE,SAASC,KAAK,QAAQ,iBAAiB;;AAEvC;AACA;AACA;AACA,OAAOC,iBAAiB,MAAM,2BAA2B;AACzD,OAAOC,iBAAiB,MAAM,8BAA8B;AAC5D,OAAOC,gBAAgB,MAAM,6BAA6B;AAC1D,OAAOC,eAAe,MAAM,wBAAwB;AACpD,SAASC,WAAW,QAAQ,iBAAiB;AAC7C,OAAOC,mBAAmB,MAAM,6BAA6B;AAC7D,OA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A,MAAM,CAAE0B,mBAAmB,EAAEC,sBAAsB,CAAE,GACpD9D,QAAQ,CAAE+B,WAAY,CAAC;EACxB,IAAKA,WAAW,KAAK8B,mBAAmB,EAAG;IAC1CC,sBAAsB,CAAE/B,WAAY,CAAC;IACrC6B,WAAW,CAACG,UAAU,CAAE,CAAE,CAAC;EAC5B;EAEA,MAAMC,QAAQ,GAAG,CAAC,CAAElB,qBAAqB,EAAEW,MAAM;EACjD,oBACCnC,KAAA;IACCM,SAAS,EAAC,4CAA4C;IACtDqC,GAAG,EAAG9B,SAAW;IAAAN,QAAA,gBAEjBX,IAAA,CAACK,kBAAkB;MAClBC,WAAW,EAAGO,WAAa;MAC3BN,2BAA2B,EAAGqB,qBAAqB,CAACW;IAAQ,CAC5D,CAAC,eAEFvC,IAAA,CAACR,eAAe;MAAAmB,QAAA,EACbmC,QAAQ,iBACT1C,KAAA,CAAAF,SAAA;QAAAS,QAAA,gBACCX,IAAA,CAACX,iBAAiB;UACjB2D,aAAa,EACZN,WAAW,CAACO,yBACZ;UACDC,aAAa,EAAGR,WAAW,CAACS,gBAAkB;UAC9C5B,cAAc,EAAGA,cAAgB;UACjC6B,WAAW,EAAG;QAAO,CACrB,CAAC,eACFpD,IAAA,CAACN,mBAAmB;UAAA,GAAMgD;QAAW,CAAI,CAAC;MAAA,CACzC;IACF,CACe,CAAC;EAAA,CACd,CAAC;AAER;AAEA,eAAe9B,WAAW","ignoreList":[]}
1
+ {"version":3,"names":["useMemo","useEffect","useRef","useState","_n","sprintf","useDebounce","__experimentalHeading","Heading","speak","BlockPatternsList","useInsertionPoint","usePatternsState","InserterListbox","searchItems","BlockPatternsPaging","usePatternsPaging","INSERTER_PATTERN_TYPES","allPatternsCategory","myPatternsCategory","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","PatternsListHeader","filterValue","filteredBlockPatternsLength","level","lineHeight","className","children","PatternList","searchValue","selectedCategory","patternCategories","rootClientId","container","debouncedSpeak","destinationRootClientId","onInsertBlocks","shouldFocusBlock","patterns","onClickPattern","registeredPatternCategories","map","patternCategory","name","filteredBlockPatterns","filteredPatterns","filter","pattern","type","user","_pattern$categories$s","hasKnownCategory","categories","some","category","includes","length","count","resultsFoundMessage","pagingProps","previousSearchValue","setPreviousSearchValue","changePage","hasItems","ref","blockPatterns","categoryPatterns","isDraggable"],"sources":["@wordpress/block-editor/src/components/inserter/block-patterns-explorer/pattern-list.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo, useEffect, useRef, useState } from '@wordpress/element';\nimport { _n, sprintf } from '@wordpress/i18n';\nimport { useDebounce } from '@wordpress/compose';\nimport { __experimentalHeading as Heading } from '@wordpress/components';\nimport { speak } from '@wordpress/a11y';\n\n/**\n * Internal dependencies\n */\nimport BlockPatternsList from '../../block-patterns-list';\nimport useInsertionPoint from '../hooks/use-insertion-point';\nimport usePatternsState from '../hooks/use-patterns-state';\nimport InserterListbox from '../../inserter-listbox';\nimport { searchItems } from '../search-items';\nimport BlockPatternsPaging from '../../block-patterns-paging';\nimport usePatternsPaging from '../hooks/use-patterns-paging';\nimport {\n\tINSERTER_PATTERN_TYPES,\n\tallPatternsCategory,\n\tmyPatternsCategory,\n} from '../block-patterns-tab/utils';\n\nfunction PatternsListHeader( { filterValue, filteredBlockPatternsLength } ) {\n\tif ( ! filterValue ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Heading\n\t\t\tlevel={ 2 }\n\t\t\tlineHeight=\"48px\"\n\t\t\tclassName=\"block-editor-block-patterns-explorer__search-results-count\"\n\t\t>\n\t\t\t{ sprintf(\n\t\t\t\t/* translators: %d: number of patterns. */\n\t\t\t\t_n(\n\t\t\t\t\t'%d pattern found',\n\t\t\t\t\t'%d patterns found',\n\t\t\t\t\tfilteredBlockPatternsLength\n\t\t\t\t),\n\t\t\t\tfilteredBlockPatternsLength\n\t\t\t) }\n\t\t</Heading>\n\t);\n}\n\nfunction PatternList( {\n\tsearchValue,\n\tselectedCategory,\n\tpatternCategories,\n\trootClientId,\n} ) {\n\tconst container = useRef();\n\tconst debouncedSpeak = useDebounce( speak, 500 );\n\tconst [ destinationRootClientId, onInsertBlocks ] = useInsertionPoint( {\n\t\trootClientId,\n\t\tshouldFocusBlock: true,\n\t} );\n\tconst [ patterns, , onClickPattern ] = usePatternsState(\n\t\tonInsertBlocks,\n\t\tdestinationRootClientId,\n\t\tselectedCategory\n\t);\n\n\tconst registeredPatternCategories = useMemo(\n\t\t() =>\n\t\t\tpatternCategories.map(\n\t\t\t\t( patternCategory ) => patternCategory.name\n\t\t\t),\n\t\t[ patternCategories ]\n\t);\n\n\tconst filteredBlockPatterns = useMemo( () => {\n\t\tconst filteredPatterns = patterns.filter( ( pattern ) => {\n\t\t\tif ( selectedCategory === allPatternsCategory.name ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tif (\n\t\t\t\tselectedCategory === myPatternsCategory.name &&\n\t\t\t\tpattern.type === INSERTER_PATTERN_TYPES.user\n\t\t\t) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tif ( selectedCategory === 'uncategorized' ) {\n\t\t\t\tconst hasKnownCategory =\n\t\t\t\t\tpattern.categories?.some( ( category ) =>\n\t\t\t\t\t\tregisteredPatternCategories.includes( category )\n\t\t\t\t\t) ?? false;\n\n\t\t\t\treturn ! pattern.categories?.length || ! hasKnownCategory;\n\t\t\t}\n\n\t\t\treturn pattern.categories?.includes( selectedCategory );\n\t\t} );\n\n\t\tif ( ! searchValue ) {\n\t\t\treturn filteredPatterns;\n\t\t}\n\n\t\treturn searchItems( filteredPatterns, searchValue );\n\t}, [\n\t\tsearchValue,\n\t\tpatterns,\n\t\tselectedCategory,\n\t\tregisteredPatternCategories,\n\t] );\n\n\t// Announce search results on change.\n\tuseEffect( () => {\n\t\tif ( ! searchValue ) {\n\t\t\treturn;\n\t\t}\n\t\tconst count = filteredBlockPatterns.length;\n\t\tconst resultsFoundMessage = sprintf(\n\t\t\t/* translators: %d: number of results. */\n\t\t\t_n( '%d result found.', '%d results found.', count ),\n\t\t\tcount\n\t\t);\n\t\tdebouncedSpeak( resultsFoundMessage );\n\t}, [ searchValue, debouncedSpeak, filteredBlockPatterns.length ] );\n\n\tconst pagingProps = usePatternsPaging(\n\t\tfilteredBlockPatterns,\n\t\tselectedCategory,\n\t\tcontainer\n\t);\n\n\t// Reset page when search value changes.\n\tconst [ previousSearchValue, setPreviousSearchValue ] =\n\t\tuseState( searchValue );\n\tif ( searchValue !== previousSearchValue ) {\n\t\tsetPreviousSearchValue( searchValue );\n\t\tpagingProps.changePage( 1 );\n\t}\n\n\tconst hasItems = !! filteredBlockPatterns?.length;\n\treturn (\n\t\t<div\n\t\t\tclassName=\"block-editor-block-patterns-explorer__list\"\n\t\t\tref={ container }\n\t\t>\n\t\t\t<PatternsListHeader\n\t\t\t\tfilterValue={ searchValue }\n\t\t\t\tfilteredBlockPatternsLength={ filteredBlockPatterns.length }\n\t\t\t/>\n\n\t\t\t<InserterListbox>\n\t\t\t\t{ hasItems && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<BlockPatternsList\n\t\t\t\t\t\t\tblockPatterns={ pagingProps.categoryPatterns }\n\t\t\t\t\t\t\tonClickPattern={ onClickPattern }\n\t\t\t\t\t\t\tisDraggable={ false }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<BlockPatternsPaging { ...pagingProps } />\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</InserterListbox>\n\t\t</div>\n\t);\n}\n\nexport default PatternList;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,OAAO,EAAEC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,oBAAoB;AACzE,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,WAAW,QAAQ,oBAAoB;AAChD,SAASC,qBAAqB,IAAIC,OAAO,QAAQ,uBAAuB;AACxE,SAASC,KAAK,QAAQ,iBAAiB;;AAEvC;AACA;AACA;AACA,OAAOC,iBAAiB,MAAM,2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
63
  rootClientId: rootClientId,
64
- category: category,
65
- showTitlesAsTooltip: false
64
+ category: category
66
65
  }, category.name)
67
66
  })
68
67
  }), showPatternsExplorer && /*#__PURE__*/_jsx(PatternsExplorerModal, {
@@ -1 +1 @@
1
- {"version":3,"names":["useState","useViewportMatch","Button","Spinner","__","useSelect","PatternsExplorerModal","MobileTabNavigation","PatternCategoryPreviews","usePatternCategories","CategoryTabs","InserterNoResults","store","blockEditorStore","unlock","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","BlockPatternsTab","onSelectCategory","selectedCategory","onInsert","rootClientId","children","showPatternsExplorer","setShowPatternsExplorer","categories","isMobile","isResolvingPatterns","select","className","length","__next40pxDefaultSize","onClick","variant","category","showTitlesAsTooltip","name","initialCategory","patternCategories","onModalClose"],"sources":["@wordpress/block-editor/src/components/inserter/block-patterns-tab/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState } from '@wordpress/element';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { Button, Spinner } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport PatternsExplorerModal from '../block-patterns-explorer';\nimport MobileTabNavigation from '../mobile-tab-navigation';\nimport { PatternCategoryPreviews } from './pattern-category-previews';\nimport { usePatternCategories } from './use-pattern-categories';\nimport CategoryTabs from '../category-tabs';\nimport InserterNoResults from '../no-results';\nimport { store as blockEditorStore } from '../../../store';\nimport { unlock } from '../../../lock-unlock';\n\nfunction BlockPatternsTab( {\n\tonSelectCategory,\n\tselectedCategory,\n\tonInsert,\n\trootClientId,\n\tchildren,\n} ) {\n\tconst [ showPatternsExplorer, setShowPatternsExplorer ] = useState( false );\n\n\tconst categories = usePatternCategories( rootClientId );\n\n\tconst isMobile = useViewportMatch( 'medium', '<' );\n\tconst isResolvingPatterns = useSelect(\n\t\t( select ) =>\n\t\t\tunlock( select( blockEditorStore ) ).isResolvingPatterns(),\n\t\t[]\n\t);\n\n\tif ( isResolvingPatterns ) {\n\t\treturn (\n\t\t\t<div className=\"block-editor-inserter__patterns-loading\">\n\t\t\t\t<Spinner />\n\t\t\t</div>\n\t\t);\n\t}\n\n\tif ( ! categories.length ) {\n\t\treturn <InserterNoResults />;\n\t}\n\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<CategoryTabs\n\t\t\t\t\t\tcategories={ categories }\n\t\t\t\t\t\tselectedCategory={ selectedCategory }\n\t\t\t\t\t\tonSelectCategory={ onSelectCategory }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ children }\n\t\t\t\t\t</CategoryTabs>\n\t\t\t\t\t<Button\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tclassName=\"block-editor-inserter__patterns-explore-button\"\n\t\t\t\t\t\tonClick={ () => setShowPatternsExplorer( true ) }\n\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Explore all patterns' ) }\n\t\t\t\t\t</Button>\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<div className=\"block-editor-inserter__category-panel\">\n\t\t\t\t\t\t\t<PatternCategoryPreviews\n\t\t\t\t\t\t\t\tkey={ category.name }\n\t\t\t\t\t\t\t\tonInsert={ onInsert }\n\t\t\t\t\t\t\t\trootClientId={ rootClientId }\n\t\t\t\t\t\t\t\tcategory={ category }\n\t\t\t\t\t\t\t\tshowTitlesAsTooltip={ false }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</div>\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 || categories[ 0 ] }\n\t\t\t\t\tpatternCategories={ categories }\n\t\t\t\t\tonModalClose={ () => setShowPatternsExplorer( false ) }\n\t\t\t\t\trootClientId={ rootClientId }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport default BlockPatternsTab;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,MAAM,EAAEC,OAAO,QAAQ,uBAAuB;AACvD,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,SAAS,QAAQ,iBAAiB;;AAE3C;AACA;AACA;AACA,OAAOC,qBAAqB,MAAM,4BAA4B;AAC9D,OAAOC,mBAAmB,MAAM,0BAA0B;AAC1D,SAASC,uBAAuB,QAAQ,6BAA6B;AACrE,SAASC,oBAAoB,QAAQ,0BAA0B;AAC/D,OAAOC,YAAY,MAAM,kBAAkB;AAC3C,OAAOC,iBAAiB,MAAM,eAAe;AAC7C,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,gBAAgB;AAC1D,SAASC,MAAM,QAAQ,sBAAsB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA,EAAAC,QAAA,IAAAC,SAAA;AAE9C,SAASC,gBAAgBA,CAAE;EAC1BC,gBAAgB;EAChBC,gBAAgB;EAChBC,QAAQ;EACRC,YAAY;EACZC;AACD,CAAC,EAAG;EACH,MAAM,CAAEC,oBAAoB,EAAEC,uBAAuB,CAAE,GAAG5B,QAAQ,CAAE,KAAM,CAAC;EAE3E,MAAM6B,UAAU,GAAGpB,oBAAoB,CAAEgB,YAAa,CAAC;EAEvD,MAAMK,QAAQ,GAAG7B,gBAAgB,CAAE,QAAQ,EAAE,GAAI,CAAC;EAClD,MAAM8B,mBAAmB,GAAG1B,SAAS,CAClC2B,MAAM,IACPlB,MAAM,CAAEkB,MAAM,CAAEnB,gBAAiB,CAAE,CAAC,CAACkB,mBAAmB,C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I;MACvDa,iBAAiB,EAAGb,UAAY;MAChCc,YAAY,EAAGA,CAAA,KAAMf,uBAAuB,CAAE,KAAM,CAAG;MACvDH,YAAY,EAAGA;IAAc,CAC7B,CACD;EAAA,CACA,CAAC;AAEL;AAEA,eAAeJ,gBAAgB","ignoreList":[]}
1
+ {"version":3,"names":["useState","useViewportMatch","Button","Spinner","__","useSelect","PatternsExplorerModal","MobileTabNavigation","PatternCategoryPreviews","usePatternCategories","CategoryTabs","InserterNoResults","store","blockEditorStore","unlock","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","BlockPatternsTab","onSelectCategory","selectedCategory","onInsert","rootClientId","children","showPatternsExplorer","setShowPatternsExplorer","categories","isMobile","isResolvingPatterns","select","className","length","__next40pxDefaultSize","onClick","variant","category","name","initialCategory","patternCategories","onModalClose"],"sources":["@wordpress/block-editor/src/components/inserter/block-patterns-tab/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState } from '@wordpress/element';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { Button, Spinner } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport PatternsExplorerModal from '../block-patterns-explorer';\nimport MobileTabNavigation from '../mobile-tab-navigation';\nimport { PatternCategoryPreviews } from './pattern-category-previews';\nimport { usePatternCategories } from './use-pattern-categories';\nimport CategoryTabs from '../category-tabs';\nimport InserterNoResults from '../no-results';\nimport { store as blockEditorStore } from '../../../store';\nimport { unlock } from '../../../lock-unlock';\n\nfunction BlockPatternsTab( {\n\tonSelectCategory,\n\tselectedCategory,\n\tonInsert,\n\trootClientId,\n\tchildren,\n} ) {\n\tconst [ showPatternsExplorer, setShowPatternsExplorer ] = useState( false );\n\n\tconst categories = usePatternCategories( rootClientId );\n\n\tconst isMobile = useViewportMatch( 'medium', '<' );\n\tconst isResolvingPatterns = useSelect(\n\t\t( select ) =>\n\t\t\tunlock( select( blockEditorStore ) ).isResolvingPatterns(),\n\t\t[]\n\t);\n\n\tif ( isResolvingPatterns ) {\n\t\treturn (\n\t\t\t<div className=\"block-editor-inserter__patterns-loading\">\n\t\t\t\t<Spinner />\n\t\t\t</div>\n\t\t);\n\t}\n\n\tif ( ! categories.length ) {\n\t\treturn <InserterNoResults />;\n\t}\n\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<CategoryTabs\n\t\t\t\t\t\tcategories={ categories }\n\t\t\t\t\t\tselectedCategory={ selectedCategory }\n\t\t\t\t\t\tonSelectCategory={ onSelectCategory }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ children }\n\t\t\t\t\t</CategoryTabs>\n\t\t\t\t\t<Button\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tclassName=\"block-editor-inserter__patterns-explore-button\"\n\t\t\t\t\t\tonClick={ () => setShowPatternsExplorer( true ) }\n\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Explore all patterns' ) }\n\t\t\t\t\t</Button>\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<div className=\"block-editor-inserter__category-panel\">\n\t\t\t\t\t\t\t<PatternCategoryPreviews\n\t\t\t\t\t\t\t\tkey={ category.name }\n\t\t\t\t\t\t\t\tonInsert={ onInsert }\n\t\t\t\t\t\t\t\trootClientId={ rootClientId }\n\t\t\t\t\t\t\t\tcategory={ category }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</div>\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 || categories[ 0 ] }\n\t\t\t\t\tpatternCategories={ categories }\n\t\t\t\t\tonModalClose={ () => setShowPatternsExplorer( false ) }\n\t\t\t\t\trootClientId={ rootClientId }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport default BlockPatternsTab;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,MAAM,EAAEC,OAAO,QAAQ,uBAAuB;AACvD,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,SAAS,QAAQ,iBAAiB;;AAE3C;AACA;AACA;AACA,OAAOC,qBAAqB,MAAM,4BAA4B;AAC9D,OAAOC,mBAAmB,MAAM,0BAA0B;AAC1D,SAASC,uBAAuB,QAAQ,6BAA6B;AACrE,SAASC,oBAAoB,QAAQ,0BAA0B;AAC/D,OAAOC,YAAY,MAAM,kBAAkB;AAC3C,OAAOC,iBAAiB,MAAM,eAAe;AAC7C,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,gBAAgB;AAC1D,SAASC,MAAM,QAAQ,sBAAsB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA,EAAAC,QAAA,IAAAC,SAAA;AAE9C,SAASC,gBAAgBA,CAAE;EAC1BC,gBAAgB;EAChBC,gBAAgB;EAChBC,QAAQ;EACRC,YAAY;EACZC;AACD,CAAC,EAAG;EACH,MAAM,CAAEC,oBAAoB,EAAEC,uBAAuB,CAAE,GAAG5B,QAAQ,CAAE,KAAM,CAAC;EAE3E,MAAM6B,UAAU,GAAGpB,oBAAoB,CAAEgB,YAAa,CAAC;EAEvD,MAAMK,QAAQ,GAAG7B,gBAAgB,CAAE,QAAQ,EAAE,GAAI,CAAC;EAClD,MAAM8B,mBAAmB,GAAG1B,SAAS,CAClC2B,MAAM,IACPlB,MAAM,CAAEkB,MAAM,CAAEnB,gBAAiB,CAAE,CAAC,CAACkB,mBAAmB,CAAC,CAAC,EAC3D,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