@wordpress/block-editor 14.9.0 → 14.10.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 (370) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/LICENSE.md +1 -1
  3. package/README.md +40 -0
  4. package/build/components/audio-player/index.native.js +1 -1
  5. package/build/components/audio-player/index.native.js.map +1 -1
  6. package/build/components/background-image-control/index.js +4 -0
  7. package/build/components/background-image-control/index.js.map +1 -1
  8. package/build/components/block-alignment-matrix-control/index.js +32 -0
  9. package/build/components/block-alignment-matrix-control/index.js.map +1 -1
  10. package/build/components/block-card/index.js +45 -8
  11. package/build/components/block-card/index.js.map +1 -1
  12. package/build/components/block-edit/edit.js +147 -10
  13. package/build/components/block-edit/edit.js.map +1 -1
  14. package/build/components/block-list/index.js +1 -2
  15. package/build/components/block-list/index.js.map +1 -1
  16. package/build/components/block-list/use-block-props/index.js +2 -2
  17. package/build/components/block-list/use-block-props/index.js.map +1 -1
  18. package/build/components/block-list/zoom-out-separator.js +20 -3
  19. package/build/components/block-list/zoom-out-separator.js.map +1 -1
  20. package/build/components/block-settings-menu/block-settings-dropdown.js +5 -8
  21. package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  22. package/build/components/block-styles/utils.js +3 -3
  23. package/build/components/block-styles/utils.js.map +1 -1
  24. package/build/components/block-tools/zoom-out-mode-inserters.js +19 -6
  25. package/build/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
  26. package/build/components/button-block-appender/index.js +1 -5
  27. package/build/components/button-block-appender/index.js.map +1 -1
  28. package/build/components/child-layout-control/index.js +6 -0
  29. package/build/components/child-layout-control/index.js.map +1 -1
  30. package/build/components/colors-gradients/dropdown.js +51 -11
  31. package/build/components/colors-gradients/dropdown.js.map +1 -1
  32. package/build/components/contrast-checker/index.native.js +1 -1
  33. package/build/components/contrast-checker/index.native.js.map +1 -1
  34. package/build/components/date-format-picker/index.js +7 -16
  35. package/build/components/date-format-picker/index.js.map +1 -1
  36. package/build/components/font-appearance-control/index.js +9 -0
  37. package/build/components/font-appearance-control/index.js.map +1 -1
  38. package/build/components/font-family/index.js +10 -1
  39. package/build/components/font-family/index.js.map +1 -1
  40. package/build/components/global-styles/color-panel.js +3 -0
  41. package/build/components/global-styles/color-panel.js.map +1 -1
  42. package/build/components/global-styles/typography-utils.js +1 -1
  43. package/build/components/global-styles/typography-utils.js.map +1 -1
  44. package/build/components/global-styles/use-global-styles-output.js +2 -2
  45. package/build/components/global-styles/use-global-styles-output.js.map +1 -1
  46. package/build/components/grid/grid-visualizer.js +9 -0
  47. package/build/components/grid/grid-visualizer.js.map +1 -1
  48. package/build/components/grid/utils.js +12 -1
  49. package/build/components/grid/utils.js.map +1 -1
  50. package/build/components/iframe/index.js +1 -1
  51. package/build/components/iframe/index.js.map +1 -1
  52. package/build/components/inner-blocks/use-inner-block-template-sync.js +11 -11
  53. package/build/components/inner-blocks/use-inner-block-template-sync.js.map +1 -1
  54. package/build/components/inserter/block-patterns-explorer/index.js +1 -1
  55. package/build/components/inserter/block-patterns-explorer/index.js.map +1 -1
  56. package/build/components/inserter/block-patterns-tab/index.js +1 -1
  57. package/build/components/inserter/block-patterns-tab/index.js.map +1 -1
  58. package/build/components/inserter/block-patterns-tab/pattern-category-previews.js +4 -4
  59. package/build/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
  60. package/build/components/inserter/block-patterns-tab/patterns-filter.js +2 -2
  61. package/build/components/inserter/block-patterns-tab/patterns-filter.js.map +1 -1
  62. package/build/components/inserter/category-tabs/index.js +1 -2
  63. package/build/components/inserter/category-tabs/index.js.map +1 -1
  64. package/build/components/inserter/index.js +6 -15
  65. package/build/components/inserter/index.js.map +1 -1
  66. package/build/components/inserter/quick-inserter.js +2 -13
  67. package/build/components/inserter/quick-inserter.js.map +1 -1
  68. package/build/components/keyboard-shortcuts/index.js +2 -2
  69. package/build/components/keyboard-shortcuts/index.js.map +1 -1
  70. package/build/components/line-height-control/index.js +9 -0
  71. package/build/components/line-height-control/index.js.map +1 -1
  72. package/build/components/media-placeholder/index.js +2 -2
  73. package/build/components/media-placeholder/index.js.map +1 -1
  74. package/build/components/media-replace-flow/index.js +26 -26
  75. package/build/components/media-replace-flow/index.js.map +1 -1
  76. package/build/components/plain-text/index.js +34 -0
  77. package/build/components/plain-text/index.js.map +1 -1
  78. package/build/components/provider/index.js +61 -5
  79. package/build/components/provider/index.js.map +1 -1
  80. package/build/components/provider/use-media-upload-settings.js +28 -0
  81. package/build/components/provider/use-media-upload-settings.js.map +1 -0
  82. package/build/components/resolution-tool/index.js +3 -1
  83. package/build/components/resolution-tool/index.js.map +1 -1
  84. package/build/components/responsive-block-control/index.js +1 -1
  85. package/build/components/responsive-block-control/index.js.map +1 -1
  86. package/build/components/rich-text/event-listeners/delete.js +7 -1
  87. package/build/components/rich-text/event-listeners/delete.js.map +1 -1
  88. package/build/components/rich-text/index.js +2 -2
  89. package/build/components/rich-text/index.js.map +1 -1
  90. package/build/components/use-block-drop-zone/index.js +2 -1
  91. package/build/components/use-block-drop-zone/index.js.map +1 -1
  92. package/build/hooks/background.js +2 -0
  93. package/build/hooks/background.js.map +1 -1
  94. package/build/hooks/block-bindings.js +15 -14
  95. package/build/hooks/block-bindings.js.map +1 -1
  96. package/build/hooks/border.js +3 -3
  97. package/build/hooks/border.js.map +1 -1
  98. package/build/hooks/color.js +1 -1
  99. package/build/hooks/color.js.map +1 -1
  100. package/build/hooks/dimensions.js +2 -2
  101. package/build/hooks/dimensions.js.map +1 -1
  102. package/build/hooks/font-family.js +1 -1
  103. package/build/hooks/font-family.js.map +1 -1
  104. package/build/hooks/gap.js +2 -2
  105. package/build/hooks/gap.js.map +1 -1
  106. package/build/hooks/index.js +0 -1
  107. package/build/hooks/index.js.map +1 -1
  108. package/build/hooks/index.native.js +7 -0
  109. package/build/hooks/index.native.js.map +1 -1
  110. package/build/hooks/style.js +7 -7
  111. package/build/hooks/style.js.map +1 -1
  112. package/build/hooks/supports.js +7 -7
  113. package/build/hooks/supports.js.map +1 -1
  114. package/build/hooks/typography.js +6 -6
  115. package/build/hooks/typography.js.map +1 -1
  116. package/build/hooks/use-zoom-out.js +12 -1
  117. package/build/hooks/use-zoom-out.js.map +1 -1
  118. package/build/hooks/utils.js +1 -1
  119. package/build/hooks/utils.js.map +1 -1
  120. package/build/store/private-actions.js +1 -1
  121. package/build/store/private-actions.js.map +1 -1
  122. package/build/store/private-selectors.js +11 -1
  123. package/build/store/private-selectors.js.map +1 -1
  124. package/build/store/reducer.js +93 -12
  125. package/build/store/reducer.js.map +1 -1
  126. package/build/store/selectors.js +6 -8
  127. package/build/store/selectors.js.map +1 -1
  128. package/build/utils/block-bindings.js +95 -0
  129. package/build/utils/block-bindings.js.map +1 -1
  130. package/build-module/components/audio-player/index.native.js +2 -2
  131. package/build-module/components/audio-player/index.native.js.map +1 -1
  132. package/build-module/components/background-image-control/index.js +5 -1
  133. package/build-module/components/background-image-control/index.js.map +1 -1
  134. package/build-module/components/block-alignment-matrix-control/index.js +32 -0
  135. package/build-module/components/block-alignment-matrix-control/index.js.map +1 -1
  136. package/build-module/components/block-card/index.js +45 -8
  137. package/build-module/components/block-card/index.js.map +1 -1
  138. package/build-module/components/block-edit/edit.js +148 -11
  139. package/build-module/components/block-edit/edit.js.map +1 -1
  140. package/build-module/components/block-list/index.js +2 -3
  141. package/build-module/components/block-list/index.js.map +1 -1
  142. package/build-module/components/block-list/use-block-props/index.js +1 -1
  143. package/build-module/components/block-list/use-block-props/index.js.map +1 -1
  144. package/build-module/components/block-list/zoom-out-separator.js +20 -3
  145. package/build-module/components/block-list/zoom-out-separator.js.map +1 -1
  146. package/build-module/components/block-settings-menu/block-settings-dropdown.js +5 -8
  147. package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  148. package/build-module/components/block-styles/utils.js +3 -3
  149. package/build-module/components/block-styles/utils.js.map +1 -1
  150. package/build-module/components/block-tools/zoom-out-mode-inserters.js +19 -6
  151. package/build-module/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
  152. package/build-module/components/button-block-appender/index.js +2 -6
  153. package/build-module/components/button-block-appender/index.js.map +1 -1
  154. package/build-module/components/child-layout-control/index.js +7 -1
  155. package/build-module/components/child-layout-control/index.js.map +1 -1
  156. package/build-module/components/colors-gradients/dropdown.js +51 -11
  157. package/build-module/components/colors-gradients/dropdown.js.map +1 -1
  158. package/build-module/components/contrast-checker/index.native.js +2 -2
  159. package/build-module/components/contrast-checker/index.native.js.map +1 -1
  160. package/build-module/components/date-format-picker/index.js +7 -16
  161. package/build-module/components/date-format-picker/index.js.map +1 -1
  162. package/build-module/components/font-appearance-control/index.js +8 -0
  163. package/build-module/components/font-appearance-control/index.js.map +1 -1
  164. package/build-module/components/font-family/index.js +10 -1
  165. package/build-module/components/font-family/index.js.map +1 -1
  166. package/build-module/components/global-styles/color-panel.js +3 -0
  167. package/build-module/components/global-styles/color-panel.js.map +1 -1
  168. package/build-module/components/global-styles/typography-utils.js +1 -1
  169. package/build-module/components/global-styles/typography-utils.js.map +1 -1
  170. package/build-module/components/global-styles/use-global-styles-output.js +2 -2
  171. package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
  172. package/build-module/components/grid/grid-visualizer.js +9 -0
  173. package/build-module/components/grid/grid-visualizer.js.map +1 -1
  174. package/build-module/components/grid/utils.js +12 -1
  175. package/build-module/components/grid/utils.js.map +1 -1
  176. package/build-module/components/iframe/index.js +1 -1
  177. package/build-module/components/iframe/index.js.map +1 -1
  178. package/build-module/components/inner-blocks/use-inner-block-template-sync.js +12 -12
  179. package/build-module/components/inner-blocks/use-inner-block-template-sync.js.map +1 -1
  180. package/build-module/components/inserter/block-patterns-explorer/index.js +1 -1
  181. package/build-module/components/inserter/block-patterns-explorer/index.js.map +1 -1
  182. package/build-module/components/inserter/block-patterns-tab/index.js +1 -1
  183. package/build-module/components/inserter/block-patterns-tab/index.js.map +1 -1
  184. package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js +4 -4
  185. package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
  186. package/build-module/components/inserter/block-patterns-tab/patterns-filter.js +2 -2
  187. package/build-module/components/inserter/block-patterns-tab/patterns-filter.js.map +1 -1
  188. package/build-module/components/inserter/category-tabs/index.js +1 -2
  189. package/build-module/components/inserter/category-tabs/index.js.map +1 -1
  190. package/build-module/components/inserter/index.js +6 -15
  191. package/build-module/components/inserter/index.js.map +1 -1
  192. package/build-module/components/inserter/quick-inserter.js +2 -13
  193. package/build-module/components/inserter/quick-inserter.js.map +1 -1
  194. package/build-module/components/keyboard-shortcuts/index.js +2 -2
  195. package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
  196. package/build-module/components/line-height-control/index.js +8 -0
  197. package/build-module/components/line-height-control/index.js.map +1 -1
  198. package/build-module/components/media-placeholder/index.js +3 -3
  199. package/build-module/components/media-placeholder/index.js.map +1 -1
  200. package/build-module/components/media-replace-flow/index.js +28 -28
  201. package/build-module/components/media-replace-flow/index.js.map +1 -1
  202. package/build-module/components/plain-text/index.js +34 -0
  203. package/build-module/components/plain-text/index.js.map +1 -1
  204. package/build-module/components/provider/index.js +62 -5
  205. package/build-module/components/provider/index.js.map +1 -1
  206. package/build-module/components/provider/use-media-upload-settings.js +22 -0
  207. package/build-module/components/provider/use-media-upload-settings.js.map +1 -0
  208. package/build-module/components/resolution-tool/index.js +3 -1
  209. package/build-module/components/resolution-tool/index.js.map +1 -1
  210. package/build-module/components/responsive-block-control/index.js +1 -1
  211. package/build-module/components/responsive-block-control/index.js.map +1 -1
  212. package/build-module/components/rich-text/event-listeners/delete.js +7 -1
  213. package/build-module/components/rich-text/event-listeners/delete.js.map +1 -1
  214. package/build-module/components/rich-text/index.js +1 -1
  215. package/build-module/components/rich-text/index.js.map +1 -1
  216. package/build-module/components/use-block-drop-zone/index.js +2 -1
  217. package/build-module/components/use-block-drop-zone/index.js.map +1 -1
  218. package/build-module/hooks/background.js +2 -0
  219. package/build-module/hooks/background.js.map +1 -1
  220. package/build-module/hooks/block-bindings.js +13 -12
  221. package/build-module/hooks/block-bindings.js.map +1 -1
  222. package/build-module/hooks/border.js +3 -3
  223. package/build-module/hooks/border.js.map +1 -1
  224. package/build-module/hooks/color.js +1 -1
  225. package/build-module/hooks/color.js.map +1 -1
  226. package/build-module/hooks/dimensions.js +2 -2
  227. package/build-module/hooks/dimensions.js.map +1 -1
  228. package/build-module/hooks/font-family.js +1 -1
  229. package/build-module/hooks/font-family.js.map +1 -1
  230. package/build-module/hooks/gap.js +2 -2
  231. package/build-module/hooks/gap.js.map +1 -1
  232. package/build-module/hooks/index.js +0 -1
  233. package/build-module/hooks/index.js.map +1 -1
  234. package/build-module/hooks/index.native.js +1 -0
  235. package/build-module/hooks/index.native.js.map +1 -1
  236. package/build-module/hooks/style.js +7 -7
  237. package/build-module/hooks/style.js.map +1 -1
  238. package/build-module/hooks/supports.js +7 -7
  239. package/build-module/hooks/supports.js.map +1 -1
  240. package/build-module/hooks/typography.js +6 -6
  241. package/build-module/hooks/typography.js.map +1 -1
  242. package/build-module/hooks/use-zoom-out.js +12 -2
  243. package/build-module/hooks/use-zoom-out.js.map +1 -1
  244. package/build-module/hooks/utils.js +1 -1
  245. package/build-module/hooks/utils.js.map +1 -1
  246. package/build-module/store/private-actions.js +1 -1
  247. package/build-module/store/private-actions.js.map +1 -1
  248. package/build-module/store/private-selectors.js +11 -1
  249. package/build-module/store/private-selectors.js.map +1 -1
  250. package/build-module/store/reducer.js +93 -12
  251. package/build-module/store/reducer.js.map +1 -1
  252. package/build-module/store/selectors.js +6 -8
  253. package/build-module/store/selectors.js.map +1 -1
  254. package/build-module/utils/block-bindings.js +90 -0
  255. package/build-module/utils/block-bindings.js.map +1 -1
  256. package/build-style/style-rtl.css +27 -9
  257. package/build-style/style.css +27 -9
  258. package/package.json +33 -33
  259. package/src/components/audio-player/index.native.js +2 -2
  260. package/src/components/background-image-control/index.js +4 -0
  261. package/src/components/background-image-control/style.scss +4 -2
  262. package/src/components/block-alignment-matrix-control/README.md +29 -6
  263. package/src/components/block-alignment-matrix-control/index.js +31 -0
  264. package/src/components/block-alignment-matrix-control/stories/index.story.js +78 -0
  265. package/src/components/block-card/README.md +7 -0
  266. package/src/components/block-card/index.js +41 -12
  267. package/src/components/block-card/stories/index.story.js +79 -0
  268. package/src/components/block-card/style.scss +9 -1
  269. package/src/components/block-edit/edit.js +218 -11
  270. package/src/components/block-list/index.js +2 -7
  271. package/src/components/block-list/use-block-props/index.js +1 -1
  272. package/src/components/block-list/zoom-out-separator.js +30 -0
  273. package/src/components/block-settings-menu/block-settings-dropdown.js +17 -20
  274. package/src/components/block-styles/utils.js +3 -3
  275. package/src/components/block-title/stories/index.story.js +76 -0
  276. package/src/components/block-tools/style.scss +1 -0
  277. package/src/components/block-tools/zoom-out-mode-inserters.js +21 -3
  278. package/src/components/border-radius-control/README.md +59 -0
  279. package/src/components/border-radius-control/stories/index.story.js +58 -0
  280. package/src/components/button-block-appender/index.js +2 -7
  281. package/src/components/child-layout-control/index.js +14 -0
  282. package/src/components/colors-gradients/dropdown.js +57 -8
  283. package/src/components/colors-gradients/style.scss +5 -0
  284. package/src/components/contrast-checker/index.native.js +2 -2
  285. package/src/components/contrast-checker/stories/index.story.js +117 -0
  286. package/src/components/date-format-picker/README.md +6 -13
  287. package/src/components/date-format-picker/index.js +10 -17
  288. package/src/components/date-format-picker/stories/index.story.js +69 -0
  289. package/src/components/date-format-picker/style.scss +3 -1
  290. package/src/components/default-block-appender/content.scss +1 -0
  291. package/src/components/dimensions-tool/stories/aspect-ratio-tool.story.js +2 -1
  292. package/src/components/dimensions-tool/stories/index.story.js +2 -1
  293. package/src/components/dimensions-tool/stories/scale-tool.story.js +2 -1
  294. package/src/components/dimensions-tool/stories/width-height-tool.story.js +2 -1
  295. package/src/components/font-appearance-control/index.js +15 -0
  296. package/src/components/font-family/README.md +1 -0
  297. package/src/components/font-family/index.js +17 -1
  298. package/src/components/font-family/stories/index.story.js +1 -0
  299. package/src/components/global-styles/color-panel.js +3 -0
  300. package/src/components/global-styles/test/use-global-styles-output.js +1 -1
  301. package/src/components/global-styles/typography-utils.js +1 -1
  302. package/src/components/global-styles/use-global-styles-output.js +2 -2
  303. package/src/components/grid/grid-visualizer.js +11 -0
  304. package/src/components/grid/utils.js +19 -1
  305. package/src/components/iframe/index.js +1 -1
  306. package/src/components/inner-blocks/use-inner-block-template-sync.js +17 -10
  307. package/src/components/inserter/block-patterns-explorer/index.js +2 -3
  308. package/src/components/inserter/block-patterns-tab/index.js +3 -1
  309. package/src/components/inserter/block-patterns-tab/pattern-category-previews.js +4 -4
  310. package/src/components/inserter/block-patterns-tab/patterns-filter.js +2 -2
  311. package/src/components/inserter/category-tabs/index.js +3 -2
  312. package/src/components/inserter/index.js +1 -13
  313. package/src/components/inserter/quick-inserter.js +2 -25
  314. package/src/components/keyboard-shortcuts/index.js +2 -2
  315. package/src/components/line-height-control/README.md +1 -0
  316. package/src/components/line-height-control/index.js +12 -0
  317. package/src/components/line-height-control/stories/index.story.js +1 -0
  318. package/src/components/line-height-control/test/index.js +7 -1
  319. package/src/components/list-view/style.scss +10 -5
  320. package/src/components/media-placeholder/index.js +3 -3
  321. package/src/components/media-replace-flow/README.md +7 -0
  322. package/src/components/media-replace-flow/index.js +28 -36
  323. package/src/components/media-replace-flow/style.scss +6 -6
  324. package/src/components/plain-text/README.md +2 -2
  325. package/src/components/plain-text/index.js +34 -0
  326. package/src/components/plain-text/stories/index.story.js +75 -0
  327. package/src/components/provider/index.js +81 -4
  328. package/src/components/provider/use-media-upload-settings.js +25 -0
  329. package/src/components/resolution-tool/index.js +2 -0
  330. package/src/components/resolution-tool/stories/index.story.js +36 -8
  331. package/src/components/responsive-block-control/index.js +1 -1
  332. package/src/components/rich-text/event-listeners/delete.js +6 -1
  333. package/src/components/rich-text/index.js +1 -1
  334. package/src/components/text-alignment-control/README.md +49 -0
  335. package/src/components/text-alignment-control/stories/index.story.js +56 -18
  336. package/src/components/text-decoration-control/README.md +0 -1
  337. package/src/components/text-decoration-control/stories/index.story.js +51 -16
  338. package/src/components/text-transform-control/README.md +3 -4
  339. package/src/components/text-transform-control/stories/index.story.js +53 -16
  340. package/src/components/use-block-drop-zone/index.js +8 -1
  341. package/src/components/warning/stories/index.story.js +86 -0
  342. package/src/hooks/background.js +6 -0
  343. package/src/hooks/block-bindings.js +17 -18
  344. package/src/hooks/border.js +9 -3
  345. package/src/hooks/color.js +1 -1
  346. package/src/hooks/dimensions.js +2 -2
  347. package/src/hooks/font-family.js +1 -1
  348. package/src/hooks/gap.js +2 -2
  349. package/src/hooks/index.js +0 -1
  350. package/src/hooks/index.native.js +1 -0
  351. package/src/hooks/style.js +13 -7
  352. package/src/hooks/supports.js +7 -7
  353. package/src/hooks/test/style.js +2 -1
  354. package/src/hooks/typography.js +6 -6
  355. package/src/hooks/use-zoom-out.js +10 -2
  356. package/src/hooks/utils.js +1 -1
  357. package/src/store/private-actions.js +1 -0
  358. package/src/store/private-selectors.js +15 -5
  359. package/src/store/reducer.js +112 -19
  360. package/src/store/selectors.js +6 -8
  361. package/src/store/test/private-selectors.js +53 -9
  362. package/src/store/test/reducer.js +172 -166
  363. package/src/store/test/selectors.js +23 -0
  364. package/src/utils/block-bindings.js +95 -0
  365. package/tsconfig.json +2 -5
  366. package/build/hooks/use-bindings-attributes.js +0 -262
  367. package/build/hooks/use-bindings-attributes.js.map +0 -1
  368. package/build-module/hooks/use-bindings-attributes.js +0 -253
  369. package/build-module/hooks/use-bindings-attributes.js.map +0 -1
  370. package/src/hooks/use-bindings-attributes.js +0 -322
@@ -7,10 +7,14 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports.default = void 0;
9
9
  var _clsx = _interopRequireDefault(require("clsx"));
10
- var _components = require("@wordpress/components");
11
10
  var _blocks = require("@wordpress/blocks");
11
+ var _components = require("@wordpress/components");
12
+ var _data = require("@wordpress/data");
12
13
  var _element = require("@wordpress/element");
13
14
  var _blockContext = _interopRequireDefault(require("../block-context"));
15
+ var _isUrlLike = _interopRequireDefault(require("../link-control/is-url-like"));
16
+ var _blockBindings = require("../../utils/block-bindings");
17
+ var _lockUnlock = require("../../lock-unlock");
14
18
  var _jsxRuntime = require("react/jsx-runtime");
15
19
  /**
16
20
  * External dependencies
@@ -52,33 +56,166 @@ const Edit = props => {
52
56
  const EditWithFilters = (0, _components.withFilters)('editor.BlockEdit')(Edit);
53
57
  const EditWithGeneratedProps = props => {
54
58
  const {
55
- attributes = {},
56
- name
59
+ name,
60
+ clientId,
61
+ attributes,
62
+ setAttributes
57
63
  } = props;
64
+ const registry = (0, _data.useRegistry)();
58
65
  const blockType = (0, _blocks.getBlockType)(name);
59
66
  const blockContext = (0, _element.useContext)(_blockContext.default);
67
+ const registeredSources = (0, _data.useSelect)(select => (0, _lockUnlock.unlock)(select(_blocks.store)).getAllBlockBindingsSources(), []);
68
+ const {
69
+ blockBindings,
70
+ context,
71
+ hasPatternOverrides
72
+ } = (0, _element.useMemo)(() => {
73
+ // Assign context values using the block type's declared context needs.
74
+ const computedContext = blockType?.usesContext ? Object.fromEntries(Object.entries(blockContext).filter(([key]) => blockType.usesContext.includes(key))) : DEFAULT_BLOCK_CONTEXT;
75
+ // Add context requested by Block Bindings sources.
76
+ if (attributes?.metadata?.bindings) {
77
+ Object.values(attributes?.metadata?.bindings || {}).forEach(binding => {
78
+ registeredSources[binding?.source]?.usesContext?.forEach(key => {
79
+ computedContext[key] = blockContext[key];
80
+ });
81
+ });
82
+ }
83
+ return {
84
+ blockBindings: (0, _blockBindings.replacePatternOverridesDefaultBinding)(name, attributes?.metadata?.bindings),
85
+ context: computedContext,
86
+ hasPatternOverrides: (0, _blockBindings.hasPatternOverridesDefaultBinding)(attributes?.metadata?.bindings)
87
+ };
88
+ }, [name, blockType?.usesContext, blockContext, attributes?.metadata?.bindings, registeredSources]);
89
+ const computedAttributes = (0, _data.useSelect)(select => {
90
+ if (!blockBindings) {
91
+ return attributes;
92
+ }
93
+ const attributesFromSources = {};
94
+ const blockBindingsBySource = new Map();
95
+ for (const [attributeName, binding] of Object.entries(blockBindings)) {
96
+ const {
97
+ source: sourceName,
98
+ args: sourceArgs
99
+ } = binding;
100
+ const source = registeredSources[sourceName];
101
+ if (!source || !(0, _blockBindings.canBindAttribute)(name, attributeName)) {
102
+ continue;
103
+ }
104
+ blockBindingsBySource.set(source, {
105
+ ...blockBindingsBySource.get(source),
106
+ [attributeName]: {
107
+ args: sourceArgs
108
+ }
109
+ });
110
+ }
111
+ if (blockBindingsBySource.size) {
112
+ for (const [source, bindings] of blockBindingsBySource) {
113
+ // Get values in batch if the source supports it.
114
+ let values = {};
115
+ if (!source.getValues) {
116
+ Object.keys(bindings).forEach(attr => {
117
+ // Default to the the source label when `getValues` doesn't exist.
118
+ values[attr] = source.label;
119
+ });
120
+ } else {
121
+ values = source.getValues({
122
+ select,
123
+ context,
124
+ clientId,
125
+ bindings
126
+ });
127
+ }
128
+ for (const [attributeName, value] of Object.entries(values)) {
129
+ if (attributeName === 'url' && (!value || !(0, _isUrlLike.default)(value))) {
130
+ // Return null if value is not a valid URL.
131
+ attributesFromSources[attributeName] = null;
132
+ } else {
133
+ attributesFromSources[attributeName] = value;
134
+ }
135
+ }
136
+ }
137
+ }
138
+ return {
139
+ ...attributes,
140
+ ...attributesFromSources
141
+ };
142
+ }, [attributes, blockBindings, clientId, context, name, registeredSources]);
143
+ const setBoundAttributes = (0, _element.useCallback)(nextAttributes => {
144
+ if (!blockBindings) {
145
+ setAttributes(nextAttributes);
146
+ return;
147
+ }
148
+ registry.batch(() => {
149
+ const keptAttributes = {
150
+ ...nextAttributes
151
+ };
152
+ const blockBindingsBySource = new Map();
60
153
 
61
- // Assign context values using the block type's declared context needs.
62
- const context = (0, _element.useMemo)(() => {
63
- return blockType && blockType.usesContext ? Object.fromEntries(Object.entries(blockContext).filter(([key]) => blockType.usesContext.includes(key))) : DEFAULT_BLOCK_CONTEXT;
64
- }, [blockType, blockContext]);
154
+ // Loop only over the updated attributes to avoid modifying the bound ones that haven't changed.
155
+ for (const [attributeName, newValue] of Object.entries(keptAttributes)) {
156
+ if (!blockBindings[attributeName] || !(0, _blockBindings.canBindAttribute)(name, attributeName)) {
157
+ continue;
158
+ }
159
+ const binding = blockBindings[attributeName];
160
+ const source = registeredSources[binding?.source];
161
+ if (!source?.setValues) {
162
+ continue;
163
+ }
164
+ blockBindingsBySource.set(source, {
165
+ ...blockBindingsBySource.get(source),
166
+ [attributeName]: {
167
+ args: binding.args,
168
+ newValue
169
+ }
170
+ });
171
+ delete keptAttributes[attributeName];
172
+ }
173
+ if (blockBindingsBySource.size) {
174
+ for (const [source, bindings] of blockBindingsBySource) {
175
+ source.setValues({
176
+ select: registry.select,
177
+ dispatch: registry.dispatch,
178
+ context,
179
+ clientId,
180
+ bindings
181
+ });
182
+ }
183
+ }
184
+ const hasParentPattern = !!context['pattern/overrides'];
185
+ if (
186
+ // Don't update non-connected attributes if the block is using pattern overrides
187
+ // and the editing is happening while overriding the pattern (not editing the original).
188
+ !(hasPatternOverrides && hasParentPattern) && Object.keys(keptAttributes).length) {
189
+ // Don't update caption and href until they are supported.
190
+ if (hasPatternOverrides) {
191
+ delete keptAttributes.caption;
192
+ delete keptAttributes.href;
193
+ }
194
+ setAttributes(keptAttributes);
195
+ }
196
+ });
197
+ }, [blockBindings, clientId, context, hasPatternOverrides, setAttributes, registeredSources, name, registry]);
65
198
  if (!blockType) {
66
199
  return null;
67
200
  }
68
201
  if (blockType.apiVersion > 1) {
69
202
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(EditWithFilters, {
70
203
  ...props,
71
- context: context
204
+ attributes: computedAttributes,
205
+ context: context,
206
+ setAttributes: setBoundAttributes
72
207
  });
73
208
  }
74
209
 
75
210
  // Generate a class name for the block's editable form.
76
211
  const generatedClassName = (0, _blocks.hasBlockSupport)(blockType, 'className', true) ? (0, _blocks.getBlockDefaultClassName)(name) : null;
77
- const className = (0, _clsx.default)(generatedClassName, attributes.className, props.className);
212
+ const className = (0, _clsx.default)(generatedClassName, attributes?.className, props.className);
78
213
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(EditWithFilters, {
79
214
  ...props,
215
+ attributes: computedAttributes,
216
+ className: className,
80
217
  context: context,
81
- className: className
218
+ setAttributes: setBoundAttributes
82
219
  });
83
220
  };
84
221
  var _default = exports.default = EditWithGeneratedProps;
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_components","_blocks","_element","_blockContext","_jsxRuntime","DEFAULT_BLOCK_CONTEXT","Edit","props","name","blockType","getBlockType","Component","edit","save","jsx","EditWithFilters","withFilters","EditWithGeneratedProps","attributes","blockContext","useContext","BlockContext","context","useMemo","usesContext","Object","fromEntries","entries","filter","key","includes","apiVersion","generatedClassName","hasBlockSupport","getBlockDefaultClassName","className","clsx","_default","exports","default"],"sources":["@wordpress/block-editor/src/components/block-edit/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { withFilters } from '@wordpress/components';\nimport {\n\tgetBlockDefaultClassName,\n\thasBlockSupport,\n\tgetBlockType,\n} from '@wordpress/blocks';\nimport { useContext, useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport BlockContext from '../block-context';\n\n/**\n * Default value used for blocks which do not define their own context needs,\n * used to guarantee that a block's `context` prop will always be an object. It\n * is assigned as a constant since it is always expected to be an empty object,\n * and in order to avoid unnecessary React reconciliations of a changing object.\n *\n * @type {{}}\n */\nconst DEFAULT_BLOCK_CONTEXT = {};\n\nconst Edit = ( props ) => {\n\tconst { name } = props;\n\tconst blockType = getBlockType( name );\n\n\tif ( ! blockType ) {\n\t\treturn null;\n\t}\n\n\t// `edit` and `save` are functions or components describing the markup\n\t// with which a block is displayed. If `blockType` is valid, assign\n\t// them preferentially as the render value for the block.\n\tconst Component = blockType.edit || blockType.save;\n\n\treturn <Component { ...props } />;\n};\n\nconst EditWithFilters = withFilters( 'editor.BlockEdit' )( Edit );\n\nconst EditWithGeneratedProps = ( props ) => {\n\tconst { attributes = {}, name } = props;\n\tconst blockType = getBlockType( name );\n\tconst blockContext = useContext( BlockContext );\n\n\t// Assign context values using the block type's declared context needs.\n\tconst context = useMemo( () => {\n\t\treturn blockType && blockType.usesContext\n\t\t\t? Object.fromEntries(\n\t\t\t\t\tObject.entries( blockContext ).filter( ( [ key ] ) =>\n\t\t\t\t\t\tblockType.usesContext.includes( key )\n\t\t\t\t\t)\n\t\t\t )\n\t\t\t: DEFAULT_BLOCK_CONTEXT;\n\t}, [ blockType, blockContext ] );\n\n\tif ( ! blockType ) {\n\t\treturn null;\n\t}\n\n\tif ( blockType.apiVersion > 1 ) {\n\t\treturn <EditWithFilters { ...props } context={ context } />;\n\t}\n\n\t// Generate a class name for the block's editable form.\n\tconst generatedClassName = hasBlockSupport( blockType, 'className', true )\n\t\t? getBlockDefaultClassName( name )\n\t\t: null;\n\tconst className = clsx(\n\t\tgeneratedClassName,\n\t\tattributes.className,\n\t\tprops.className\n\t);\n\n\treturn (\n\t\t<EditWithFilters\n\t\t\t{ ...props }\n\t\t\tcontext={ context }\n\t\t\tclassName={ className }\n\t\t/>\n\t);\n};\n\nexport default EditWithGeneratedProps;\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAKA,IAAAG,QAAA,GAAAH,OAAA;AAKA,IAAAI,aAAA,GAAAL,sBAAA,CAAAC,OAAA;AAA4C,IAAAK,WAAA,GAAAL,OAAA;AAnB5C;AACA;AACA;;AAGA;AACA;AACA;;AASA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GACA,MAAMM,qBAAqB,GAAG,CAAC,CAAC;AAEhC,MAAMC,IAAI,GAAKC,KAAK,IAAM;EACzB,MAAM;IAAEC;EAAK,CAAC,GAAGD,KAAK;EACtB,MAAME,SAAS,GAAG,IAAAC,o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AAW,EAAE,IAAK,CAAC,GACvE,IAAAyB,gCAAwB,EAAE1B,IAAK,CAAC,GAChC,IAAI;EACP,MAAM2B,SAAS,GAAG,IAAAC,aAAI,EACrBJ,kBAAkB,EAClBd,UAAU,CAACiB,SAAS,EACpB5B,KAAK,CAAC4B,SACP,CAAC;EAED,oBACC,IAAA/B,WAAA,CAAAU,GAAA,EAACC,eAAe;IAAA,GACVR,KAAK;IACVe,OAAO,EAAGA,OAAS;IACnBa,SAAS,EAAGA;EAAW,CACvB,CAAC;AAEJ,CAAC;AAAC,IAAAE,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEatB,sBAAsB","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_blocks","_components","_data","_element","_blockContext","_isUrlLike","_blockBindings","_lockUnlock","_jsxRuntime","DEFAULT_BLOCK_CONTEXT","Edit","props","name","blockType","getBlockType","Component","edit","save","jsx","EditWithFilters","withFilters","EditWithGeneratedProps","clientId","attributes","setAttributes","registry","useRegistry","blockContext","useContext","BlockContext","registeredSources","useSelect","select","unlock","blocksStore","getAllBlockBindingsSources","blockBindings","context","hasPatternOverrides","useMemo","computedContext","usesContext","Object","fromEntries","entries","filter","key","includes","metadata","bindings","values","forEach","binding","source","replacePatternOverridesDefaultBinding","hasPatternOverridesDefaultBinding","computedAttributes","attributesFromSources","blockBindingsBySource","Map","attributeName","sourceName","args","sourceArgs","canBindAttribute","set","get","size","getValues","keys","attr","label","value","isURLLike","setBoundAttributes","useCallback","nextAttributes","batch","keptAttributes","newValue","setValues","dispatch","hasParentPattern","length","caption","href","apiVersion","generatedClassName","hasBlockSupport","getBlockDefaultClassName","className","clsx","_default","exports","default"],"sources":["@wordpress/block-editor/src/components/block-edit/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tgetBlockDefaultClassName,\n\tgetBlockType,\n\thasBlockSupport,\n\tstore as blocksStore,\n} from '@wordpress/blocks';\nimport { withFilters } from '@wordpress/components';\nimport { useRegistry, useSelect } from '@wordpress/data';\nimport { useCallback, useContext, useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport BlockContext from '../block-context';\nimport isURLLike from '../link-control/is-url-like';\nimport {\n\tcanBindAttribute,\n\thasPatternOverridesDefaultBinding,\n\treplacePatternOverridesDefaultBinding,\n} from '../../utils/block-bindings';\nimport { unlock } from '../../lock-unlock';\n\n/**\n * Default value used for blocks which do not define their own context needs,\n * used to guarantee that a block's `context` prop will always be an object. It\n * is assigned as a constant since it is always expected to be an empty object,\n * and in order to avoid unnecessary React reconciliations of a changing object.\n *\n * @type {{}}\n */\nconst DEFAULT_BLOCK_CONTEXT = {};\n\nconst Edit = ( props ) => {\n\tconst { name } = props;\n\tconst blockType = getBlockType( name );\n\n\tif ( ! blockType ) {\n\t\treturn null;\n\t}\n\n\t// `edit` and `save` are functions or components describing the markup\n\t// with which a block is displayed. If `blockType` is valid, assign\n\t// them preferentially as the render value for the block.\n\tconst Component = blockType.edit || blockType.save;\n\n\treturn <Component { ...props } />;\n};\n\nconst EditWithFilters = withFilters( 'editor.BlockEdit' )( Edit );\n\nconst EditWithGeneratedProps = ( props ) => {\n\tconst { name, clientId, attributes, setAttributes } = props;\n\tconst registry = useRegistry();\n\tconst blockType = getBlockType( name );\n\tconst blockContext = useContext( BlockContext );\n\tconst registeredSources = useSelect(\n\t\t( select ) =>\n\t\t\tunlock( select( blocksStore ) ).getAllBlockBindingsSources(),\n\t\t[]\n\t);\n\n\tconst { blockBindings, context, hasPatternOverrides } = useMemo( () => {\n\t\t// Assign context values using the block type's declared context needs.\n\t\tconst computedContext = blockType?.usesContext\n\t\t\t? Object.fromEntries(\n\t\t\t\t\tObject.entries( blockContext ).filter( ( [ key ] ) =>\n\t\t\t\t\t\tblockType.usesContext.includes( key )\n\t\t\t\t\t)\n\t\t\t )\n\t\t\t: DEFAULT_BLOCK_CONTEXT;\n\t\t// Add context requested by Block Bindings sources.\n\t\tif ( attributes?.metadata?.bindings ) {\n\t\t\tObject.values( attributes?.metadata?.bindings || {} ).forEach(\n\t\t\t\t( binding ) => {\n\t\t\t\t\tregisteredSources[ binding?.source ]?.usesContext?.forEach(\n\t\t\t\t\t\t( key ) => {\n\t\t\t\t\t\t\tcomputedContext[ key ] = blockContext[ key ];\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}\n\t\treturn {\n\t\t\tblockBindings: replacePatternOverridesDefaultBinding(\n\t\t\t\tname,\n\t\t\t\tattributes?.metadata?.bindings\n\t\t\t),\n\t\t\tcontext: computedContext,\n\t\t\thasPatternOverrides: hasPatternOverridesDefaultBinding(\n\t\t\t\tattributes?.metadata?.bindings\n\t\t\t),\n\t\t};\n\t}, [\n\t\tname,\n\t\tblockType?.usesContext,\n\t\tblockContext,\n\t\tattributes?.metadata?.bindings,\n\t\tregisteredSources,\n\t] );\n\n\tconst computedAttributes = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! blockBindings ) {\n\t\t\t\treturn attributes;\n\t\t\t}\n\n\t\t\tconst attributesFromSources = {};\n\t\t\tconst blockBindingsBySource = new Map();\n\n\t\t\tfor ( const [ attributeName, binding ] of Object.entries(\n\t\t\t\tblockBindings\n\t\t\t) ) {\n\t\t\t\tconst { source: sourceName, args: sourceArgs } = binding;\n\t\t\t\tconst source = registeredSources[ sourceName ];\n\t\t\t\tif ( ! source || ! canBindAttribute( name, attributeName ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tblockBindingsBySource.set( source, {\n\t\t\t\t\t...blockBindingsBySource.get( source ),\n\t\t\t\t\t[ attributeName ]: {\n\t\t\t\t\t\targs: sourceArgs,\n\t\t\t\t\t},\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\tif ( blockBindingsBySource.size ) {\n\t\t\t\tfor ( const [ source, bindings ] of blockBindingsBySource ) {\n\t\t\t\t\t// Get values in batch if the source supports it.\n\t\t\t\t\tlet values = {};\n\t\t\t\t\tif ( ! source.getValues ) {\n\t\t\t\t\t\tObject.keys( bindings ).forEach( ( attr ) => {\n\t\t\t\t\t\t\t// Default to the the source label when `getValues` doesn't exist.\n\t\t\t\t\t\t\tvalues[ attr ] = source.label;\n\t\t\t\t\t\t} );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvalues = source.getValues( {\n\t\t\t\t\t\t\tselect,\n\t\t\t\t\t\t\tcontext,\n\t\t\t\t\t\t\tclientId,\n\t\t\t\t\t\t\tbindings,\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t\tfor ( const [ attributeName, value ] of Object.entries(\n\t\t\t\t\t\tvalues\n\t\t\t\t\t) ) {\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tattributeName === 'url' &&\n\t\t\t\t\t\t\t( ! value || ! isURLLike( value ) )\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t// Return null if value is not a valid URL.\n\t\t\t\t\t\t\tattributesFromSources[ attributeName ] = null;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tattributesFromSources[ attributeName ] = value;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\t...attributes,\n\t\t\t\t...attributesFromSources,\n\t\t\t};\n\t\t},\n\t\t[\n\t\t\tattributes,\n\t\t\tblockBindings,\n\t\t\tclientId,\n\t\t\tcontext,\n\t\t\tname,\n\t\t\tregisteredSources,\n\t\t]\n\t);\n\n\tconst setBoundAttributes = useCallback(\n\t\t( nextAttributes ) => {\n\t\t\tif ( ! blockBindings ) {\n\t\t\t\tsetAttributes( nextAttributes );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tregistry.batch( () => {\n\t\t\t\tconst keptAttributes = { ...nextAttributes };\n\t\t\t\tconst blockBindingsBySource = new Map();\n\n\t\t\t\t// Loop only over the updated attributes to avoid modifying the bound ones that haven't changed.\n\t\t\t\tfor ( const [ attributeName, newValue ] of Object.entries(\n\t\t\t\t\tkeptAttributes\n\t\t\t\t) ) {\n\t\t\t\t\tif (\n\t\t\t\t\t\t! blockBindings[ attributeName ] ||\n\t\t\t\t\t\t! canBindAttribute( name, attributeName )\n\t\t\t\t\t) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst binding = blockBindings[ attributeName ];\n\t\t\t\t\tconst source = registeredSources[ binding?.source ];\n\t\t\t\t\tif ( ! source?.setValues ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tblockBindingsBySource.set( source, {\n\t\t\t\t\t\t...blockBindingsBySource.get( source ),\n\t\t\t\t\t\t[ attributeName ]: {\n\t\t\t\t\t\t\targs: binding.args,\n\t\t\t\t\t\t\tnewValue,\n\t\t\t\t\t\t},\n\t\t\t\t\t} );\n\t\t\t\t\tdelete keptAttributes[ attributeName ];\n\t\t\t\t}\n\n\t\t\t\tif ( blockBindingsBySource.size ) {\n\t\t\t\t\tfor ( const [\n\t\t\t\t\t\tsource,\n\t\t\t\t\t\tbindings,\n\t\t\t\t\t] of blockBindingsBySource ) {\n\t\t\t\t\t\tsource.setValues( {\n\t\t\t\t\t\t\tselect: registry.select,\n\t\t\t\t\t\t\tdispatch: registry.dispatch,\n\t\t\t\t\t\t\tcontext,\n\t\t\t\t\t\t\tclientId,\n\t\t\t\t\t\t\tbindings,\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst hasParentPattern = !! context[ 'pattern/overrides' ];\n\n\t\t\t\tif (\n\t\t\t\t\t// Don't update non-connected attributes if the block is using pattern overrides\n\t\t\t\t\t// and the editing is happening while overriding the pattern (not editing the original).\n\t\t\t\t\t! ( hasPatternOverrides && hasParentPattern ) &&\n\t\t\t\t\tObject.keys( keptAttributes ).length\n\t\t\t\t) {\n\t\t\t\t\t// Don't update caption and href until they are supported.\n\t\t\t\t\tif ( hasPatternOverrides ) {\n\t\t\t\t\t\tdelete keptAttributes.caption;\n\t\t\t\t\t\tdelete keptAttributes.href;\n\t\t\t\t\t}\n\t\t\t\t\tsetAttributes( keptAttributes );\n\t\t\t\t}\n\t\t\t} );\n\t\t},\n\t\t[\n\t\t\tblockBindings,\n\t\t\tclientId,\n\t\t\tcontext,\n\t\t\thasPatternOverrides,\n\t\t\tsetAttributes,\n\t\t\tregisteredSources,\n\t\t\tname,\n\t\t\tregistry,\n\t\t]\n\t);\n\n\tif ( ! blockType ) {\n\t\treturn null;\n\t}\n\n\tif ( blockType.apiVersion > 1 ) {\n\t\treturn (\n\t\t\t<EditWithFilters\n\t\t\t\t{ ...props }\n\t\t\t\tattributes={ computedAttributes }\n\t\t\t\tcontext={ context }\n\t\t\t\tsetAttributes={ setBoundAttributes }\n\t\t\t/>\n\t\t);\n\t}\n\n\t// Generate a class name for the block's editable form.\n\tconst generatedClassName = hasBlockSupport( blockType, 'className', true )\n\t\t? getBlockDefaultClassName( name )\n\t\t: null;\n\tconst className = clsx(\n\t\tgeneratedClassName,\n\t\tattributes?.className,\n\t\tprops.className\n\t);\n\n\treturn (\n\t\t<EditWithFilters\n\t\t\t{ ...props }\n\t\t\tattributes={ computedAttributes }\n\t\t\tclassName={ className }\n\t\t\tcontext={ context }\n\t\t\tsetAttributes={ setBoundAttributes }\n\t\t/>\n\t);\n};\n\nexport default EditWithGeneratedProps;\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,OAAA,GAAAD,OAAA;AAMA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AAKA,IAAAK,aAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,UAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,cAAA,GAAAP,OAAA;AAKA,IAAAQ,WAAA,GAAAR,OAAA;AAA2C,IAAAS,WAA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ACrB/E,KAAK,CAAC+E,SACP,CAAC;EAED,oBACC,IAAAlF,WAAA,CAAAU,GAAA,EAACC,eAAe;IAAA,GACVR,KAAK;IACVY,UAAU,EAAGiC,kBAAoB;IACjCkC,SAAS,EAAGA,SAAW;IACvBrD,OAAO,EAAGA,OAAS;IACnBb,aAAa,EAAGkD;EAAoB,CACpC,CAAC;AAEJ,CAAC;AAAC,IAAAkB,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEazE,sBAAsB","ignoreList":[]}
@@ -42,7 +42,6 @@ function Root({
42
42
  className,
43
43
  ...settings
44
44
  }) {
45
- const isLargeViewport = (0, _compose.useViewportMatch)('medium');
46
45
  const {
47
46
  isOutlineMode,
48
47
  isFocusMode,
@@ -98,7 +97,7 @@ function Root({
98
97
  ref: (0, _compose.useMergeRefs)([(0, _blockSelectionClearer.useBlockSelectionClearer)(), (0, _useInBetweenInserter.useInBetweenInserter)(), (0, _observeTyping.useTypingObserver)()]),
99
98
  className: (0, _clsx.default)('is-root-container', className, {
100
99
  'is-outline-mode': isOutlineMode,
101
- 'is-focus-mode': isFocusMode && isLargeViewport
100
+ 'is-focus-mode': isFocusMode
102
101
  })
103
102
  }, settings);
104
103
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(IntersectionObserver.Provider, {
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_data","_compose","_element","_block","_blockListAppender","_useInBetweenInserter","_store","_layout","_blockSelectionClearer","_innerBlocks","_context","_observeTyping","_zoomOutSeparator","_lockUnlock","_jsxRuntime","IntersectionObserver","exports","createContext","pendingBlockVisibilityUpdatesPerRegistry","WeakMap","Root","className","settings","isLargeViewport","useViewportMatch","isOutlineMode","isFocusMode","temporarilyEditingAsBlocks","useSelect","select","getSettings","getTemporarilyEditingAsBlocks","isTyping","unlock","blockEditorStore","outlineMode","focusMode","registry","useRegistry","setBlockVisibility","useDispatch","delayedBlockVisibilityUpdates","useDebounce","useCallback","updates","get","forEach","id","isIntersecting","trailing","intersectionObserver","useMemo","Observer","window","entries","set","entry","clientId","target","getAttribute","push","innerBlocksProps","useInnerBlocksProps","ref","useMergeRefs","useBlockSelectionClearer","useInBetweenInserter","useTypingObserver","clsx","jsxs","Provider","value","children","jsx","StopEditingAsBlocksOnOutsideSelect","stopEditingAsBlocks","isBlockOrDescendantSelected","isBlockSelected","hasSelectedInnerBlock","useEffect","BlockList","BlockEditContextProvider","DEFAULT_BLOCK_EDIT_CONTEXT","EMPTY_ARRAY","EMPTY_SET","Set","Items","placeholder","rootClientId","renderAppender","CustomAppender","__experimentalAppenderTagName","layout","defaultLayout","hasAppender","hasCustomAppender","order","isZoomOut","selectedBlocks","visibleBlocks","shouldRenderAppender","getBlockOrder","getSelectedBlockClientId","getSelectedBlockClientIds","__unstableGetVisibleBlocks","getTemplateLock","getBlockEditingMode","isSectionBlock","_isZoomOut","_order","isPreviewMode","selectedBlockClientId","length","LayoutProvider","map","AsyncModeProvider","has","includes","ZoomOutSeparator","position","default","tagName","BlockListItems","props"],"sources":["@wordpress/block-editor/src/components/block-list/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tAsyncModeProvider,\n\tuseSelect,\n\tuseDispatch,\n\tuseRegistry,\n} from '@wordpress/data';\nimport {\n\tuseViewportMatch,\n\tuseMergeRefs,\n\tuseDebounce,\n} from '@wordpress/compose';\nimport {\n\tcreateContext,\n\tuseMemo,\n\tuseCallback,\n\tuseEffect,\n} from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport BlockListBlock from './block';\nimport BlockListAppender from '../block-list-appender';\nimport { useInBetweenInserter } from './use-in-between-inserter';\nimport { store as blockEditorStore } from '../../store';\nimport { LayoutProvider, defaultLayout } from './layout';\nimport { useBlockSelectionClearer } from '../block-selection-clearer';\nimport { useInnerBlocksProps } from '../inner-blocks';\nimport {\n\tBlockEditContextProvider,\n\tDEFAULT_BLOCK_EDIT_CONTEXT,\n} from '../block-edit/context';\nimport { useTypingObserver } from '../observe-typing';\nimport { ZoomOutSeparator } from './zoom-out-separator';\nimport { unlock } from '../../lock-unlock';\n\nexport const IntersectionObserver = createContext();\nconst pendingBlockVisibilityUpdatesPerRegistry = new WeakMap();\n\nfunction Root( { className, ...settings } ) {\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst { isOutlineMode, isFocusMode, temporarilyEditingAsBlocks } =\n\t\tuseSelect( ( select ) => {\n\t\t\tconst { getSettings, getTemporarilyEditingAsBlocks, isTyping } =\n\t\t\t\tunlock( select( blockEditorStore ) );\n\t\t\tconst { outlineMode, focusMode } = getSettings();\n\t\t\treturn {\n\t\t\t\tisOutlineMode: outlineMode && ! isTyping(),\n\t\t\t\tisFocusMode: focusMode,\n\t\t\t\ttemporarilyEditingAsBlocks: getTemporarilyEditingAsBlocks(),\n\t\t\t};\n\t\t}, [] );\n\tconst registry = useRegistry();\n\tconst { setBlockVisibility } = useDispatch( blockEditorStore );\n\n\tconst delayedBlockVisibilityUpdates = useDebounce(\n\t\tuseCallback( () => {\n\t\t\tconst updates = {};\n\t\t\tpendingBlockVisibilityUpdatesPerRegistry\n\t\t\t\t.get( registry )\n\t\t\t\t.forEach( ( [ id, isIntersecting ] ) => {\n\t\t\t\t\tupdates[ id ] = isIntersecting;\n\t\t\t\t} );\n\t\t\tsetBlockVisibility( updates );\n\t\t}, [ registry ] ),\n\t\t300,\n\t\t{\n\t\t\ttrailing: true,\n\t\t}\n\t);\n\tconst intersectionObserver = useMemo( () => {\n\t\tconst { IntersectionObserver: Observer } = window;\n\n\t\tif ( ! Observer ) {\n\t\t\treturn;\n\t\t}\n\n\t\treturn new Observer( ( entries ) => {\n\t\t\tif ( ! pendingBlockVisibilityUpdatesPerRegistry.get( registry ) ) {\n\t\t\t\tpendingBlockVisibilityUpdatesPerRegistry.set( registry, [] );\n\t\t\t}\n\t\t\tfor ( const entry of entries ) {\n\t\t\t\tconst clientId = entry.target.getAttribute( 'data-block' );\n\t\t\t\tpendingBlockVisibilityUpdatesPerRegistry\n\t\t\t\t\t.get( registry )\n\t\t\t\t\t.push( [ clientId, entry.isIntersecting ] );\n\t\t\t}\n\t\t\tdelayedBlockVisibilityUpdates();\n\t\t} );\n\t}, [] );\n\tconst innerBlocksProps = useInnerBlocksProps(\n\t\t{\n\t\t\tref: useMergeRefs( [\n\t\t\t\tuseBlockSelectionClearer(),\n\t\t\t\tuseInBetweenInserter(),\n\t\t\t\tuseTypingObserver(),\n\t\t\t] ),\n\t\t\tclassName: clsx( 'is-root-container', className, {\n\t\t\t\t'is-outline-mode': isOutlineMode,\n\t\t\t\t'is-focus-mode': isFocusMode && isLargeViewport,\n\t\t\t} ),\n\t\t},\n\t\tsettings\n\t);\n\treturn (\n\t\t<IntersectionObserver.Provider value={ intersectionObserver }>\n\t\t\t<div { ...innerBlocksProps } />\n\t\t\t{ !! temporarilyEditingAsBlocks && (\n\t\t\t\t<StopEditingAsBlocksOnOutsideSelect\n\t\t\t\t\tclientId={ temporarilyEditingAsBlocks }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</IntersectionObserver.Provider>\n\t);\n}\n\nfunction StopEditingAsBlocksOnOutsideSelect( { clientId } ) {\n\tconst { stopEditingAsBlocks } = unlock( useDispatch( blockEditorStore ) );\n\tconst isBlockOrDescendantSelected = useSelect(\n\t\t( select ) => {\n\t\t\tconst { isBlockSelected, hasSelectedInnerBlock } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\treturn (\n\t\t\t\tisBlockSelected( clientId ) ||\n\t\t\t\thasSelectedInnerBlock( clientId, true )\n\t\t\t);\n\t\t},\n\t\t[ clientId ]\n\t);\n\tuseEffect( () => {\n\t\tif ( ! isBlockOrDescendantSelected ) {\n\t\t\tstopEditingAsBlocks( clientId );\n\t\t}\n\t}, [ isBlockOrDescendantSelected, clientId, stopEditingAsBlocks ] );\n\treturn null;\n}\n\nexport default function BlockList( settings ) {\n\treturn (\n\t\t<BlockEditContextProvider value={ DEFAULT_BLOCK_EDIT_CONTEXT }>\n\t\t\t<Root { ...settings } />\n\t\t</BlockEditContextProvider>\n\t);\n}\n\nconst EMPTY_ARRAY = [];\nconst EMPTY_SET = new Set();\n\nfunction Items( {\n\tplaceholder,\n\trootClientId,\n\trenderAppender: CustomAppender,\n\t__experimentalAppenderTagName,\n\tlayout = defaultLayout,\n} ) {\n\t// Avoid passing CustomAppender to useSelect because it could be a new\n\t// function on every render.\n\tconst hasAppender = CustomAppender !== false;\n\tconst hasCustomAppender = !! CustomAppender;\n\tconst {\n\t\torder,\n\t\tisZoomOut,\n\t\tselectedBlocks,\n\t\tvisibleBlocks,\n\t\tshouldRenderAppender,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetSettings,\n\t\t\t\tgetBlockOrder,\n\t\t\t\tgetSelectedBlockClientId,\n\t\t\t\tgetSelectedBlockClientIds,\n\t\t\t\t__unstableGetVisibleBlocks,\n\t\t\t\tgetTemplateLock,\n\t\t\t\tgetBlockEditingMode,\n\t\t\t\tisSectionBlock,\n\t\t\t\tisZoomOut: _isZoomOut,\n\t\t\t} = unlock( select( blockEditorStore ) );\n\n\t\t\tconst _order = getBlockOrder( rootClientId );\n\n\t\t\tif ( getSettings().isPreviewMode ) {\n\t\t\t\treturn {\n\t\t\t\t\torder: _order,\n\t\t\t\t\tselectedBlocks: EMPTY_ARRAY,\n\t\t\t\t\tvisibleBlocks: EMPTY_SET,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tconst selectedBlockClientId = getSelectedBlockClientId();\n\t\t\treturn {\n\t\t\t\torder: _order,\n\t\t\t\tselectedBlocks: getSelectedBlockClientIds(),\n\t\t\t\tvisibleBlocks: __unstableGetVisibleBlocks(),\n\t\t\t\tisZoomOut: _isZoomOut(),\n\t\t\t\tshouldRenderAppender:\n\t\t\t\t\t! isSectionBlock( rootClientId ) &&\n\t\t\t\t\tgetBlockEditingMode( rootClientId ) !== 'disabled' &&\n\t\t\t\t\t! getTemplateLock( rootClientId ) &&\n\t\t\t\t\thasAppender &&\n\t\t\t\t\t! _isZoomOut() &&\n\t\t\t\t\t( hasCustomAppender ||\n\t\t\t\t\t\trootClientId === selectedBlockClientId ||\n\t\t\t\t\t\t( ! rootClientId &&\n\t\t\t\t\t\t\t! selectedBlockClientId &&\n\t\t\t\t\t\t\t! _order.length ) ),\n\t\t\t};\n\t\t},\n\t\t[ rootClientId, hasAppender, hasCustomAppender ]\n\t);\n\n\treturn (\n\t\t<LayoutProvider value={ layout }>\n\t\t\t{ order.map( ( clientId ) => (\n\t\t\t\t<AsyncModeProvider\n\t\t\t\t\tkey={ clientId }\n\t\t\t\t\tvalue={\n\t\t\t\t\t\t// Only provide data asynchronously if the block is\n\t\t\t\t\t\t// not visible and not selected.\n\t\t\t\t\t\t! visibleBlocks.has( clientId ) &&\n\t\t\t\t\t\t! selectedBlocks.includes( clientId )\n\t\t\t\t\t}\n\t\t\t\t>\n\t\t\t\t\t{ isZoomOut && (\n\t\t\t\t\t\t<ZoomOutSeparator\n\t\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\t\trootClientId={ rootClientId }\n\t\t\t\t\t\t\tposition=\"top\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t<BlockListBlock\n\t\t\t\t\t\trootClientId={ rootClientId }\n\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t/>\n\t\t\t\t\t{ isZoomOut && (\n\t\t\t\t\t\t<ZoomOutSeparator\n\t\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\t\trootClientId={ rootClientId }\n\t\t\t\t\t\t\tposition=\"bottom\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</AsyncModeProvider>\n\t\t\t) ) }\n\t\t\t{ order.length < 1 && placeholder }\n\t\t\t{ shouldRenderAppender && (\n\t\t\t\t<BlockListAppender\n\t\t\t\t\ttagName={ __experimentalAppenderTagName }\n\t\t\t\t\trootClientId={ rootClientId }\n\t\t\t\t\tCustomAppender={ CustomAppender }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</LayoutProvider>\n\t);\n}\n\nexport function BlockListItems( props ) {\n\t// This component needs to always be synchronous as it's the one changing\n\t// the async mode depending on the block selection.\n\treturn (\n\t\t<AsyncModeProvider value={ false }>\n\t\t\t<Items { ...props } />\n\t\t</AsyncModeProvider>\n\t);\n}\n"],"mappings":";;;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AAMA,IAAAE,QAAA,GAAAF,OAAA;AAKA,IAAAG,QAAA,GAAAH,OAAA;AAUA,IAAAI,MAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,kBAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,qBAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,OAAA,GAAAR,OAAA;AACA,IAAAS,sBAAA,GAAAT,OAAA;AACA,IAAAU,YAAA,GAAAV,OAAA;AACA,IAAAW,QAAA,GAAAX,OAAA;AAIA,IAAAY,cAAA,GAAAZ,OAAA;AACA,IAAAa,iBAAA,GAAAb,OAAA;AACA,IAAAc,WAAA,GAAAd,OAAA;AAA2C,IAAAe,WAAA,GAAAf,OAAA;AA1C3C;AACA;AACA;;AAGA;AACA;AACA;;AAmBA;AACA;AACA;;AAgBO,MAAMgB,oBAAoB,GAAAC,OAAA,CAAAD,oBAAA,GAAG,IAAAE,sBAAa,EAAC,CAAC;AACnD,MAAMC,wCAAwC,GAAG,IAAIC,OAAO,CAAC,CAAC;AAE9D,SAASC,IAAIA,CAAE;EAAEC,SAAS;EAAE,GAAGC;AAAS,CAAC,EAAG;EAC3C,MAAMC,eAAe,GAAG,IAAAC,yBAAgB,EAAE,QAAS,CAAC;EACpD,MAAM;IAAEC,aAAa;IAAEC,WAAW;IAAEC;EAA2B,CAAC,GAC/D,IAAAC,eAAS,EAAIC,MA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ACiB,GAAG,CAAE3D,QAAS,CAAC,IAC/B,CAAEyC,cAAc,CAACmB,QAAQ,CAAE5D,QAAS,CACpC;MAAAe,QAAA,GAECyB,SAAS,iBACV,IAAAnF,WAAA,CAAA2D,GAAA,EAAC7D,iBAAA,CAAA0G,gBAAgB;QAChB7D,QAAQ,EAAGA,QAAU;QACrB+B,YAAY,EAAGA,YAAc;QAC7B+B,QAAQ,EAAC;MAAK,CACd,CACD,eACD,IAAAzG,WAAA,CAAA2D,GAAA,EAACtE,MAAA,CAAAqH,OAAc;QACdhC,YAAY,EAAGA,YAAc;QAC7B/B,QAAQ,EAAGA;MAAU,CACrB,CAAC,EACAwC,SAAS,iBACV,IAAAnF,WAAA,CAAA2D,GAAA,EAAC7D,iBAAA,CAAA0G,gBAAgB;QAChB7D,QAAQ,EAAGA,QAAU;QACrB+B,YAAY,EAAGA,YAAc;QAC7B+B,QAAQ,EAAC;MAAQ,CACjB,CACD;IAAA,GAzBK9D,QA0BY,CAClB,CAAC,EACDuC,KAAK,CAACgB,MAAM,GAAG,CAAC,IAAIzB,WAAW,EAC/Ba,oBAAoB,iBACrB,IAAAtF,WAAA,CAAA2D,GAAA,EAACrE,kBAAA,CAAAoH,OAAiB;MACjBC,OAAO,EAAG9B,6BAA+B;MACzCH,YAAY,EAAGA,YAAc;MAC7BE,cAAc,EAAGA;IAAgB,CACjC,CACD;EAAA,CACc,CAAC;AAEnB;AAEO,SAASgC,cAAcA,CAAEC,KAAK,EAAG;EACvC;EACA;EACA,oBACC,IAAA7G,WAAA,CAAA2D,GAAA,EAACzE,KAAA,CAAAmH,iBAAiB;IAAC5C,KAAK,EAAG,KAAO;IAAAC,QAAA,eACjC,IAAA1D,WAAA,CAAA2D,GAAA,EAACa,KAAK;MAAA,GAAMqC;IAAK,CAAI;EAAC,CACJ,CAAC;AAEtB","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_data","_compose","_element","_block","_blockListAppender","_useInBetweenInserter","_store","_layout","_blockSelectionClearer","_innerBlocks","_context","_observeTyping","_zoomOutSeparator","_lockUnlock","_jsxRuntime","IntersectionObserver","exports","createContext","pendingBlockVisibilityUpdatesPerRegistry","WeakMap","Root","className","settings","isOutlineMode","isFocusMode","temporarilyEditingAsBlocks","useSelect","select","getSettings","getTemporarilyEditingAsBlocks","isTyping","unlock","blockEditorStore","outlineMode","focusMode","registry","useRegistry","setBlockVisibility","useDispatch","delayedBlockVisibilityUpdates","useDebounce","useCallback","updates","get","forEach","id","isIntersecting","trailing","intersectionObserver","useMemo","Observer","window","entries","set","entry","clientId","target","getAttribute","push","innerBlocksProps","useInnerBlocksProps","ref","useMergeRefs","useBlockSelectionClearer","useInBetweenInserter","useTypingObserver","clsx","jsxs","Provider","value","children","jsx","StopEditingAsBlocksOnOutsideSelect","stopEditingAsBlocks","isBlockOrDescendantSelected","isBlockSelected","hasSelectedInnerBlock","useEffect","BlockList","BlockEditContextProvider","DEFAULT_BLOCK_EDIT_CONTEXT","EMPTY_ARRAY","EMPTY_SET","Set","Items","placeholder","rootClientId","renderAppender","CustomAppender","__experimentalAppenderTagName","layout","defaultLayout","hasAppender","hasCustomAppender","order","isZoomOut","selectedBlocks","visibleBlocks","shouldRenderAppender","getBlockOrder","getSelectedBlockClientId","getSelectedBlockClientIds","__unstableGetVisibleBlocks","getTemplateLock","getBlockEditingMode","isSectionBlock","_isZoomOut","_order","isPreviewMode","selectedBlockClientId","length","LayoutProvider","map","AsyncModeProvider","has","includes","ZoomOutSeparator","position","default","tagName","BlockListItems","props"],"sources":["@wordpress/block-editor/src/components/block-list/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tAsyncModeProvider,\n\tuseSelect,\n\tuseDispatch,\n\tuseRegistry,\n} from '@wordpress/data';\nimport { useMergeRefs, useDebounce } from '@wordpress/compose';\nimport {\n\tcreateContext,\n\tuseMemo,\n\tuseCallback,\n\tuseEffect,\n} from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport BlockListBlock from './block';\nimport BlockListAppender from '../block-list-appender';\nimport { useInBetweenInserter } from './use-in-between-inserter';\nimport { store as blockEditorStore } from '../../store';\nimport { LayoutProvider, defaultLayout } from './layout';\nimport { useBlockSelectionClearer } from '../block-selection-clearer';\nimport { useInnerBlocksProps } from '../inner-blocks';\nimport {\n\tBlockEditContextProvider,\n\tDEFAULT_BLOCK_EDIT_CONTEXT,\n} from '../block-edit/context';\nimport { useTypingObserver } from '../observe-typing';\nimport { ZoomOutSeparator } from './zoom-out-separator';\nimport { unlock } from '../../lock-unlock';\n\nexport const IntersectionObserver = createContext();\nconst pendingBlockVisibilityUpdatesPerRegistry = new WeakMap();\n\nfunction Root( { className, ...settings } ) {\n\tconst { isOutlineMode, isFocusMode, temporarilyEditingAsBlocks } =\n\t\tuseSelect( ( select ) => {\n\t\t\tconst { getSettings, getTemporarilyEditingAsBlocks, isTyping } =\n\t\t\t\tunlock( select( blockEditorStore ) );\n\t\t\tconst { outlineMode, focusMode } = getSettings();\n\t\t\treturn {\n\t\t\t\tisOutlineMode: outlineMode && ! isTyping(),\n\t\t\t\tisFocusMode: focusMode,\n\t\t\t\ttemporarilyEditingAsBlocks: getTemporarilyEditingAsBlocks(),\n\t\t\t};\n\t\t}, [] );\n\tconst registry = useRegistry();\n\tconst { setBlockVisibility } = useDispatch( blockEditorStore );\n\n\tconst delayedBlockVisibilityUpdates = useDebounce(\n\t\tuseCallback( () => {\n\t\t\tconst updates = {};\n\t\t\tpendingBlockVisibilityUpdatesPerRegistry\n\t\t\t\t.get( registry )\n\t\t\t\t.forEach( ( [ id, isIntersecting ] ) => {\n\t\t\t\t\tupdates[ id ] = isIntersecting;\n\t\t\t\t} );\n\t\t\tsetBlockVisibility( updates );\n\t\t}, [ registry ] ),\n\t\t300,\n\t\t{\n\t\t\ttrailing: true,\n\t\t}\n\t);\n\tconst intersectionObserver = useMemo( () => {\n\t\tconst { IntersectionObserver: Observer } = window;\n\n\t\tif ( ! Observer ) {\n\t\t\treturn;\n\t\t}\n\n\t\treturn new Observer( ( entries ) => {\n\t\t\tif ( ! pendingBlockVisibilityUpdatesPerRegistry.get( registry ) ) {\n\t\t\t\tpendingBlockVisibilityUpdatesPerRegistry.set( registry, [] );\n\t\t\t}\n\t\t\tfor ( const entry of entries ) {\n\t\t\t\tconst clientId = entry.target.getAttribute( 'data-block' );\n\t\t\t\tpendingBlockVisibilityUpdatesPerRegistry\n\t\t\t\t\t.get( registry )\n\t\t\t\t\t.push( [ clientId, entry.isIntersecting ] );\n\t\t\t}\n\t\t\tdelayedBlockVisibilityUpdates();\n\t\t} );\n\t}, [] );\n\tconst innerBlocksProps = useInnerBlocksProps(\n\t\t{\n\t\t\tref: useMergeRefs( [\n\t\t\t\tuseBlockSelectionClearer(),\n\t\t\t\tuseInBetweenInserter(),\n\t\t\t\tuseTypingObserver(),\n\t\t\t] ),\n\t\t\tclassName: clsx( 'is-root-container', className, {\n\t\t\t\t'is-outline-mode': isOutlineMode,\n\t\t\t\t'is-focus-mode': isFocusMode,\n\t\t\t} ),\n\t\t},\n\t\tsettings\n\t);\n\treturn (\n\t\t<IntersectionObserver.Provider value={ intersectionObserver }>\n\t\t\t<div { ...innerBlocksProps } />\n\t\t\t{ !! temporarilyEditingAsBlocks && (\n\t\t\t\t<StopEditingAsBlocksOnOutsideSelect\n\t\t\t\t\tclientId={ temporarilyEditingAsBlocks }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</IntersectionObserver.Provider>\n\t);\n}\n\nfunction StopEditingAsBlocksOnOutsideSelect( { clientId } ) {\n\tconst { stopEditingAsBlocks } = unlock( useDispatch( blockEditorStore ) );\n\tconst isBlockOrDescendantSelected = useSelect(\n\t\t( select ) => {\n\t\t\tconst { isBlockSelected, hasSelectedInnerBlock } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\treturn (\n\t\t\t\tisBlockSelected( clientId ) ||\n\t\t\t\thasSelectedInnerBlock( clientId, true )\n\t\t\t);\n\t\t},\n\t\t[ clientId ]\n\t);\n\tuseEffect( () => {\n\t\tif ( ! isBlockOrDescendantSelected ) {\n\t\t\tstopEditingAsBlocks( clientId );\n\t\t}\n\t}, [ isBlockOrDescendantSelected, clientId, stopEditingAsBlocks ] );\n\treturn null;\n}\n\nexport default function BlockList( settings ) {\n\treturn (\n\t\t<BlockEditContextProvider value={ DEFAULT_BLOCK_EDIT_CONTEXT }>\n\t\t\t<Root { ...settings } />\n\t\t</BlockEditContextProvider>\n\t);\n}\n\nconst EMPTY_ARRAY = [];\nconst EMPTY_SET = new Set();\n\nfunction Items( {\n\tplaceholder,\n\trootClientId,\n\trenderAppender: CustomAppender,\n\t__experimentalAppenderTagName,\n\tlayout = defaultLayout,\n} ) {\n\t// Avoid passing CustomAppender to useSelect because it could be a new\n\t// function on every render.\n\tconst hasAppender = CustomAppender !== false;\n\tconst hasCustomAppender = !! CustomAppender;\n\tconst {\n\t\torder,\n\t\tisZoomOut,\n\t\tselectedBlocks,\n\t\tvisibleBlocks,\n\t\tshouldRenderAppender,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetSettings,\n\t\t\t\tgetBlockOrder,\n\t\t\t\tgetSelectedBlockClientId,\n\t\t\t\tgetSelectedBlockClientIds,\n\t\t\t\t__unstableGetVisibleBlocks,\n\t\t\t\tgetTemplateLock,\n\t\t\t\tgetBlockEditingMode,\n\t\t\t\tisSectionBlock,\n\t\t\t\tisZoomOut: _isZoomOut,\n\t\t\t} = unlock( select( blockEditorStore ) );\n\n\t\t\tconst _order = getBlockOrder( rootClientId );\n\n\t\t\tif ( getSettings().isPreviewMode ) {\n\t\t\t\treturn {\n\t\t\t\t\torder: _order,\n\t\t\t\t\tselectedBlocks: EMPTY_ARRAY,\n\t\t\t\t\tvisibleBlocks: EMPTY_SET,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tconst selectedBlockClientId = getSelectedBlockClientId();\n\t\t\treturn {\n\t\t\t\torder: _order,\n\t\t\t\tselectedBlocks: getSelectedBlockClientIds(),\n\t\t\t\tvisibleBlocks: __unstableGetVisibleBlocks(),\n\t\t\t\tisZoomOut: _isZoomOut(),\n\t\t\t\tshouldRenderAppender:\n\t\t\t\t\t! isSectionBlock( rootClientId ) &&\n\t\t\t\t\tgetBlockEditingMode( rootClientId ) !== 'disabled' &&\n\t\t\t\t\t! getTemplateLock( rootClientId ) &&\n\t\t\t\t\thasAppender &&\n\t\t\t\t\t! _isZoomOut() &&\n\t\t\t\t\t( hasCustomAppender ||\n\t\t\t\t\t\trootClientId === selectedBlockClientId ||\n\t\t\t\t\t\t( ! rootClientId &&\n\t\t\t\t\t\t\t! selectedBlockClientId &&\n\t\t\t\t\t\t\t! _order.length ) ),\n\t\t\t};\n\t\t},\n\t\t[ rootClientId, hasAppender, hasCustomAppender ]\n\t);\n\n\treturn (\n\t\t<LayoutProvider value={ layout }>\n\t\t\t{ order.map( ( clientId ) => (\n\t\t\t\t<AsyncModeProvider\n\t\t\t\t\tkey={ clientId }\n\t\t\t\t\tvalue={\n\t\t\t\t\t\t// Only provide data asynchronously if the block is\n\t\t\t\t\t\t// not visible and not selected.\n\t\t\t\t\t\t! visibleBlocks.has( clientId ) &&\n\t\t\t\t\t\t! selectedBlocks.includes( clientId )\n\t\t\t\t\t}\n\t\t\t\t>\n\t\t\t\t\t{ isZoomOut && (\n\t\t\t\t\t\t<ZoomOutSeparator\n\t\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\t\trootClientId={ rootClientId }\n\t\t\t\t\t\t\tposition=\"top\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t<BlockListBlock\n\t\t\t\t\t\trootClientId={ rootClientId }\n\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t/>\n\t\t\t\t\t{ isZoomOut && (\n\t\t\t\t\t\t<ZoomOutSeparator\n\t\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\t\trootClientId={ rootClientId }\n\t\t\t\t\t\t\tposition=\"bottom\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</AsyncModeProvider>\n\t\t\t) ) }\n\t\t\t{ order.length < 1 && placeholder }\n\t\t\t{ shouldRenderAppender && (\n\t\t\t\t<BlockListAppender\n\t\t\t\t\ttagName={ __experimentalAppenderTagName }\n\t\t\t\t\trootClientId={ rootClientId }\n\t\t\t\t\tCustomAppender={ CustomAppender }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</LayoutProvider>\n\t);\n}\n\nexport function BlockListItems( props ) {\n\t// This component needs to always be synchronous as it's the one changing\n\t// the async mode depending on the block selection.\n\treturn (\n\t\t<AsyncModeProvider value={ false }>\n\t\t\t<Items { ...props } />\n\t\t</AsyncModeProvider>\n\t);\n}\n"],"mappings":";;;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AAMA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AAUA,IAAAI,MAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,kBAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,qBAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,OAAA,GAAAR,OAAA;AACA,IAAAS,sBAAA,GAAAT,OAAA;AACA,IAAAU,YAAA,GAAAV,OAAA;AACA,IAAAW,QAAA,GAAAX,OAAA;AAIA,IAAAY,cAAA,GAAAZ,OAAA;AACA,IAAAa,iBAAA,GAAAb,OAAA;AACA,IAAAc,WAAA,GAAAd,OAAA;AAA2C,IAAAe,WAAA,GAAAf,OAAA;AAtC3C;AACA;AACA;;AAGA;AACA;AACA;;AAeA;AACA;AACA;;AAgBO,MAAMgB,oBAAoB,GAAAC,OAAA,CAAAD,oBAAA,GAAG,IAAAE,sBAAa,EAAC,CAAC;AACnD,MAAMC,wCAAwC,GAAG,IAAIC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,EAACa,KAAK;MAAA,GAAMqC;IAAK,CAAI;EAAC,CACJ,CAAC;AAEtB","ignoreList":[]}
@@ -22,7 +22,7 @@ var _useBlockRefs = require("./use-block-refs");
22
22
  var _useIntersectionObserver = require("./use-intersection-observer");
23
23
  var _useScrollIntoView = require("./use-scroll-into-view");
24
24
  var _useFlashEditableBlocks = require("../../use-flash-editable-blocks");
25
- var _useBindingsAttributes = require("../../../hooks/use-bindings-attributes");
25
+ var _blockBindings = require("../../../utils/block-bindings");
26
26
  var _useFirefoxDraggableCompatibility = require("./use-firefox-draggable-compatibility");
27
27
  /**
28
28
  * External dependencies
@@ -135,7 +135,7 @@ function useBlockProps(props = {}, {
135
135
  }), canMove ? ffDragRef : undefined]);
136
136
  const blockEditContext = (0, _context.useBlockEditContext)();
137
137
  const hasBlockBindings = !!blockEditContext[_context.blockBindingsKey];
138
- const bindingsStyle = hasBlockBindings && (0, _useBindingsAttributes.canBindBlock)(name) ? {
138
+ const bindingsStyle = hasBlockBindings && (0, _blockBindings.canBindBlock)(name) ? {
139
139
  '--wp-admin-theme-color': 'var(--wp-block-synced-color)',
140
140
  '--wp-admin-theme-color--rgb': 'var(--wp-block-synced-color--rgb)'
141
141
  } : {};
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_element","_i18n","_blocks","_compose","_warning","_useMovingAnimation","_privateBlockContext","_useFocusFirstElement","_useIsHovered","_context","_useFocusHandler","_useSelectedBlockEventHandlers","_useBlockRefs","_useIntersectionObserver","_useScrollIntoView","_useFlashEditableBlocks","_useBindingsAttributes","_useFirefoxDraggableCompatibility","useBlockProps","props","__unstableIsHtml","clientId","className","wrapperProps","isAligned","index","mode","name","blockApiVersion","blockTitle","isSelected","isSubtreeDisabled","hasOverlay","initialPosition","blockEditingMode","isHighlighted","isMultiSelected","isPartiallySelected","isReusable","isDragging","hasChildSelected","isEditingDisabled","hasEditableOutline","isTemporarilyEditingAsBlocks","defaultClassName","isSectionBlock","canMove","useContext","PrivateBlockContext","blockLabel","sprintf","__","htmlSuffix","ffDragRef","useFirefoxDraggableCompatibility","mergedRefs","useMergeRefs","ref","useFocusFirstElement","useBlockRefProvider","useFocusHandler","useEventHandlers","useIsHovered","useIntersectionObserver","useMovingAnimation","triggerAnimationOnChange","useDisabled","isDisabled","useFlashEditableBlocks","isEnabled","useScrollIntoView","undefined","blockEditContext","useBlockEditContext","hasBlockBindings","blockBindingsKey","bindingsStyle","canBindBlock","globalThis","SCRIPT_DEBUG","warning","hasNegativeMargin","style","marginTop","charAt","marginBottom","marginLeft","marginRight","tabIndex","draggable","id","role","inert","clsx","save","getBlockProps"],"sources":["@wordpress/block-editor/src/components/block-list/use-block-props/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useContext } from '@wordpress/element';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { __unstableGetBlockProps as getBlockProps } from '@wordpress/blocks';\nimport { useMergeRefs, useDisabled } from '@wordpress/compose';\nimport warning from '@wordpress/warning';\n\n/**\n * Internal dependencies\n */\nimport useMovingAnimation from '../../use-moving-animation';\nimport { PrivateBlockContext } from '../private-block-context';\nimport { useFocusFirstElement } from './use-focus-first-element';\nimport { useIsHovered } from './use-is-hovered';\nimport {\n\tblockBindingsKey,\n\tuseBlockEditContext,\n} from '../../block-edit/context';\nimport { useFocusHandler } from './use-focus-handler';\nimport { useEventHandlers } from './use-selected-block-event-handlers';\nimport { useBlockRefProvider } from './use-block-refs';\nimport { useIntersectionObserver } from './use-intersection-observer';\nimport { useScrollIntoView } from './use-scroll-into-view';\nimport { useFlashEditableBlocks } from '../../use-flash-editable-blocks';\nimport { canBindBlock } from '../../../hooks/use-bindings-attributes';\nimport { useFirefoxDraggableCompatibility } from './use-firefox-draggable-compatibility';\n\n/**\n * This hook is used to lightly mark an element as a block element. The element\n * should be the outermost element of a block. Call this hook and pass the\n * returned props to the element to mark as a block. If you define a ref for the\n * element, it is important to pass the ref to this hook, which the hook in turn\n * will pass to the component through the props it returns. Optionally, you can\n * also pass any other props through this hook, and they will be merged and\n * returned.\n *\n * Use of this hook on the outermost element of a block is required if using API >= v2.\n *\n * @example\n * ```js\n * import { useBlockProps } from '@wordpress/block-editor';\n *\n * export default function Edit() {\n *\n * const blockProps = useBlockProps( {\n * className: 'my-custom-class',\n * style: {\n * color: '#222222',\n * backgroundColor: '#eeeeee'\n * }\n * } )\n *\n * return (\n *\t <div { ...blockProps }>\n *\n * </div>\n * )\n * }\n *\n * ```\n *\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 Options for internal use only.\n * @param {boolean} options.__unstableIsHtml\n *\n * @return {Object} Props to pass to the element to mark as a block.\n */\nexport function useBlockProps( props = {}, { __unstableIsHtml } = {} ) {\n\tconst {\n\t\tclientId,\n\t\tclassName,\n\t\twrapperProps = {},\n\t\tisAligned,\n\t\tindex,\n\t\tmode,\n\t\tname,\n\t\tblockApiVersion,\n\t\tblockTitle,\n\t\tisSelected,\n\t\tisSubtreeDisabled,\n\t\thasOverlay,\n\t\tinitialPosition,\n\t\tblockEditingMode,\n\t\tisHighlighted,\n\t\tisMultiSelected,\n\t\tisPartiallySelected,\n\t\tisReusable,\n\t\tisDragging,\n\t\thasChildSelected,\n\t\tisEditingDisabled,\n\t\thasEditableOutline,\n\t\tisTemporarilyEditingAsBlocks,\n\t\tdefaultClassName,\n\t\tisSectionBlock,\n\t\tcanMove,\n\t} = useContext( PrivateBlockContext );\n\n\t// translators: %s: Type of block (i.e. Text, Image etc)\n\tconst blockLabel = sprintf( __( 'Block: %s' ), blockTitle );\n\tconst htmlSuffix = mode === 'html' && ! __unstableIsHtml ? '-visual' : '';\n\tconst ffDragRef = useFirefoxDraggableCompatibility();\n\tconst mergedRefs = useMergeRefs( [\n\t\tprops.ref,\n\t\tuseFocusFirstElement( { clientId, initialPosition } ),\n\t\tuseBlockRefProvider( clientId ),\n\t\tuseFocusHandler( clientId ),\n\t\tuseEventHandlers( { clientId, isSelected } ),\n\t\tuseIsHovered( { clientId } ),\n\t\tuseIntersectionObserver(),\n\t\tuseMovingAnimation( { triggerAnimationOnChange: index, clientId } ),\n\t\tuseDisabled( { isDisabled: ! hasOverlay } ),\n\t\tuseFlashEditableBlocks( {\n\t\t\tclientId,\n\t\t\tisEnabled: isSectionBlock,\n\t\t} ),\n\t\tuseScrollIntoView( { isSelected } ),\n\t\tcanMove ? ffDragRef : undefined,\n\t] );\n\n\tconst blockEditContext = useBlockEditContext();\n\tconst hasBlockBindings = !! blockEditContext[ blockBindingsKey ];\n\tconst bindingsStyle =\n\t\thasBlockBindings && canBindBlock( name )\n\t\t\t? {\n\t\t\t\t\t'--wp-admin-theme-color': 'var(--wp-block-synced-color)',\n\t\t\t\t\t'--wp-admin-theme-color--rgb':\n\t\t\t\t\t\t'var(--wp-block-synced-color--rgb)',\n\t\t\t }\n\t\t\t: {};\n\n\t// Ensures it warns only inside the `edit` implementation for the block.\n\tif ( blockApiVersion < 2 && clientId === blockEditContext.clientId ) {\n\t\twarning(\n\t\t\t`Block type \"${ name }\" must support API version 2 or higher to work correctly with \"useBlockProps\" method.`\n\t\t);\n\t}\n\n\tlet hasNegativeMargin = false;\n\tif (\n\t\twrapperProps?.style?.marginTop?.charAt( 0 ) === '-' ||\n\t\twrapperProps?.style?.marginBottom?.charAt( 0 ) === '-' ||\n\t\twrapperProps?.style?.marginLeft?.charAt( 0 ) === '-' ||\n\t\twrapperProps?.style?.marginRight?.charAt( 0 ) === '-'\n\t) {\n\t\thasNegativeMargin = true;\n\t}\n\n\treturn {\n\t\ttabIndex: blockEditingMode === 'disabled' ? -1 : 0,\n\t\tdraggable: canMove && ! hasChildSelected ? true : undefined,\n\t\t...wrapperProps,\n\t\t...props,\n\t\tref: mergedRefs,\n\t\tid: `block-${ clientId }${ htmlSuffix }`,\n\t\trole: 'document',\n\t\t'aria-label': blockLabel,\n\t\t'data-block': clientId,\n\t\t'data-type': name,\n\t\t'data-title': blockTitle,\n\t\tinert: isSubtreeDisabled ? 'true' : undefined,\n\t\tclassName: clsx(\n\t\t\t'block-editor-block-list__block',\n\t\t\t{\n\t\t\t\t// The wp-block className is important for editor styles.\n\t\t\t\t'wp-block': ! isAligned,\n\t\t\t\t'has-block-overlay': hasOverlay,\n\t\t\t\t'is-selected': isSelected,\n\t\t\t\t'is-highlighted': isHighlighted,\n\t\t\t\t'is-multi-selected': isMultiSelected,\n\t\t\t\t'is-partially-selected': isPartiallySelected,\n\t\t\t\t'is-reusable': isReusable,\n\t\t\t\t'is-dragging': isDragging,\n\t\t\t\t'has-child-selected': hasChildSelected,\n\t\t\t\t'is-editing-disabled': isEditingDisabled,\n\t\t\t\t'has-editable-outline': hasEditableOutline,\n\t\t\t\t'has-negative-margin': hasNegativeMargin,\n\t\t\t\t'is-content-locked-temporarily-editing-as-blocks':\n\t\t\t\t\tisTemporarilyEditingAsBlocks,\n\t\t\t},\n\t\t\tclassName,\n\t\t\tprops.className,\n\t\t\twrapperProps.className,\n\t\t\tdefaultClassName\n\t\t),\n\t\tstyle: { ...wrapperProps.style, ...props.style, ...bindingsStyle },\n\t};\n}\n\n/**\n * Call within a save function to get the props for the block wrapper.\n *\n * @param {Object} props Optional. Props to pass to the element.\n */\nuseBlockProps.save = getBlockProps;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAN,sBAAA,CAAAC,OAAA;AAKA,IAAAM,mBAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,oBAAA,GAAAP,OAAA;AACA,IAAAQ,qBAAA,GAAAR,OAAA;AACA,IAAAS,aAAA,GAAAT,OAAA;AACA,IAAAU,QAAA,GAAAV,OAAA;AAIA,IAAAW,gB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EAAEC,iBAAiB;MACxC,sBAAsB,EAAEC,kBAAkB;MAC1C,qBAAqB,EAAEuC,iBAAiB;MACxC,iDAAiD,EAChDtC;IACF,CAAC,EACDrB,SAAS,EACTH,KAAK,CAACG,SAAS,EACfC,YAAY,CAACD,SAAS,EACtBsB,gBACD,CAAC;IACDsC,KAAK,EAAE;MAAE,GAAG3D,YAAY,CAAC2D,KAAK;MAAE,GAAG/D,KAAK,CAAC+D,KAAK;MAAE,GAAGN;IAAc;EAClE,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA1D,aAAa,CAAC4E,IAAI,GAAGC,+BAAa","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_element","_i18n","_blocks","_compose","_warning","_useMovingAnimation","_privateBlockContext","_useFocusFirstElement","_useIsHovered","_context","_useFocusHandler","_useSelectedBlockEventHandlers","_useBlockRefs","_useIntersectionObserver","_useScrollIntoView","_useFlashEditableBlocks","_blockBindings","_useFirefoxDraggableCompatibility","useBlockProps","props","__unstableIsHtml","clientId","className","wrapperProps","isAligned","index","mode","name","blockApiVersion","blockTitle","isSelected","isSubtreeDisabled","hasOverlay","initialPosition","blockEditingMode","isHighlighted","isMultiSelected","isPartiallySelected","isReusable","isDragging","hasChildSelected","isEditingDisabled","hasEditableOutline","isTemporarilyEditingAsBlocks","defaultClassName","isSectionBlock","canMove","useContext","PrivateBlockContext","blockLabel","sprintf","__","htmlSuffix","ffDragRef","useFirefoxDraggableCompatibility","mergedRefs","useMergeRefs","ref","useFocusFirstElement","useBlockRefProvider","useFocusHandler","useEventHandlers","useIsHovered","useIntersectionObserver","useMovingAnimation","triggerAnimationOnChange","useDisabled","isDisabled","useFlashEditableBlocks","isEnabled","useScrollIntoView","undefined","blockEditContext","useBlockEditContext","hasBlockBindings","blockBindingsKey","bindingsStyle","canBindBlock","globalThis","SCRIPT_DEBUG","warning","hasNegativeMargin","style","marginTop","charAt","marginBottom","marginLeft","marginRight","tabIndex","draggable","id","role","inert","clsx","save","getBlockProps"],"sources":["@wordpress/block-editor/src/components/block-list/use-block-props/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useContext } from '@wordpress/element';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { __unstableGetBlockProps as getBlockProps } from '@wordpress/blocks';\nimport { useMergeRefs, useDisabled } from '@wordpress/compose';\nimport warning from '@wordpress/warning';\n\n/**\n * Internal dependencies\n */\nimport useMovingAnimation from '../../use-moving-animation';\nimport { PrivateBlockContext } from '../private-block-context';\nimport { useFocusFirstElement } from './use-focus-first-element';\nimport { useIsHovered } from './use-is-hovered';\nimport {\n\tblockBindingsKey,\n\tuseBlockEditContext,\n} from '../../block-edit/context';\nimport { useFocusHandler } from './use-focus-handler';\nimport { useEventHandlers } from './use-selected-block-event-handlers';\nimport { useBlockRefProvider } from './use-block-refs';\nimport { useIntersectionObserver } from './use-intersection-observer';\nimport { useScrollIntoView } from './use-scroll-into-view';\nimport { useFlashEditableBlocks } from '../../use-flash-editable-blocks';\nimport { canBindBlock } from '../../../utils/block-bindings';\nimport { useFirefoxDraggableCompatibility } from './use-firefox-draggable-compatibility';\n\n/**\n * This hook is used to lightly mark an element as a block element. The element\n * should be the outermost element of a block. Call this hook and pass the\n * returned props to the element to mark as a block. If you define a ref for the\n * element, it is important to pass the ref to this hook, which the hook in turn\n * will pass to the component through the props it returns. Optionally, you can\n * also pass any other props through this hook, and they will be merged and\n * returned.\n *\n * Use of this hook on the outermost element of a block is required if using API >= v2.\n *\n * @example\n * ```js\n * import { useBlockProps } from '@wordpress/block-editor';\n *\n * export default function Edit() {\n *\n * const blockProps = useBlockProps( {\n * className: 'my-custom-class',\n * style: {\n * color: '#222222',\n * backgroundColor: '#eeeeee'\n * }\n * } )\n *\n * return (\n *\t <div { ...blockProps }>\n *\n * </div>\n * )\n * }\n *\n * ```\n *\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 Options for internal use only.\n * @param {boolean} options.__unstableIsHtml\n *\n * @return {Object} Props to pass to the element to mark as a block.\n */\nexport function useBlockProps( props = {}, { __unstableIsHtml } = {} ) {\n\tconst {\n\t\tclientId,\n\t\tclassName,\n\t\twrapperProps = {},\n\t\tisAligned,\n\t\tindex,\n\t\tmode,\n\t\tname,\n\t\tblockApiVersion,\n\t\tblockTitle,\n\t\tisSelected,\n\t\tisSubtreeDisabled,\n\t\thasOverlay,\n\t\tinitialPosition,\n\t\tblockEditingMode,\n\t\tisHighlighted,\n\t\tisMultiSelected,\n\t\tisPartiallySelected,\n\t\tisReusable,\n\t\tisDragging,\n\t\thasChildSelected,\n\t\tisEditingDisabled,\n\t\thasEditableOutline,\n\t\tisTemporarilyEditingAsBlocks,\n\t\tdefaultClassName,\n\t\tisSectionBlock,\n\t\tcanMove,\n\t} = useContext( PrivateBlockContext );\n\n\t// translators: %s: Type of block (i.e. Text, Image etc)\n\tconst blockLabel = sprintf( __( 'Block: %s' ), blockTitle );\n\tconst htmlSuffix = mode === 'html' && ! __unstableIsHtml ? '-visual' : '';\n\tconst ffDragRef = useFirefoxDraggableCompatibility();\n\tconst mergedRefs = useMergeRefs( [\n\t\tprops.ref,\n\t\tuseFocusFirstElement( { clientId, initialPosition } ),\n\t\tuseBlockRefProvider( clientId ),\n\t\tuseFocusHandler( clientId ),\n\t\tuseEventHandlers( { clientId, isSelected } ),\n\t\tuseIsHovered( { clientId } ),\n\t\tuseIntersectionObserver(),\n\t\tuseMovingAnimation( { triggerAnimationOnChange: index, clientId } ),\n\t\tuseDisabled( { isDisabled: ! hasOverlay } ),\n\t\tuseFlashEditableBlocks( {\n\t\t\tclientId,\n\t\t\tisEnabled: isSectionBlock,\n\t\t} ),\n\t\tuseScrollIntoView( { isSelected } ),\n\t\tcanMove ? ffDragRef : undefined,\n\t] );\n\n\tconst blockEditContext = useBlockEditContext();\n\tconst hasBlockBindings = !! blockEditContext[ blockBindingsKey ];\n\tconst bindingsStyle =\n\t\thasBlockBindings && canBindBlock( name )\n\t\t\t? {\n\t\t\t\t\t'--wp-admin-theme-color': 'var(--wp-block-synced-color)',\n\t\t\t\t\t'--wp-admin-theme-color--rgb':\n\t\t\t\t\t\t'var(--wp-block-synced-color--rgb)',\n\t\t\t }\n\t\t\t: {};\n\n\t// Ensures it warns only inside the `edit` implementation for the block.\n\tif ( blockApiVersion < 2 && clientId === blockEditContext.clientId ) {\n\t\twarning(\n\t\t\t`Block type \"${ name }\" must support API version 2 or higher to work correctly with \"useBlockProps\" method.`\n\t\t);\n\t}\n\n\tlet hasNegativeMargin = false;\n\tif (\n\t\twrapperProps?.style?.marginTop?.charAt( 0 ) === '-' ||\n\t\twrapperProps?.style?.marginBottom?.charAt( 0 ) === '-' ||\n\t\twrapperProps?.style?.marginLeft?.charAt( 0 ) === '-' ||\n\t\twrapperProps?.style?.marginRight?.charAt( 0 ) === '-'\n\t) {\n\t\thasNegativeMargin = true;\n\t}\n\n\treturn {\n\t\ttabIndex: blockEditingMode === 'disabled' ? -1 : 0,\n\t\tdraggable: canMove && ! hasChildSelected ? true : undefined,\n\t\t...wrapperProps,\n\t\t...props,\n\t\tref: mergedRefs,\n\t\tid: `block-${ clientId }${ htmlSuffix }`,\n\t\trole: 'document',\n\t\t'aria-label': blockLabel,\n\t\t'data-block': clientId,\n\t\t'data-type': name,\n\t\t'data-title': blockTitle,\n\t\tinert: isSubtreeDisabled ? 'true' : undefined,\n\t\tclassName: clsx(\n\t\t\t'block-editor-block-list__block',\n\t\t\t{\n\t\t\t\t// The wp-block className is important for editor styles.\n\t\t\t\t'wp-block': ! isAligned,\n\t\t\t\t'has-block-overlay': hasOverlay,\n\t\t\t\t'is-selected': isSelected,\n\t\t\t\t'is-highlighted': isHighlighted,\n\t\t\t\t'is-multi-selected': isMultiSelected,\n\t\t\t\t'is-partially-selected': isPartiallySelected,\n\t\t\t\t'is-reusable': isReusable,\n\t\t\t\t'is-dragging': isDragging,\n\t\t\t\t'has-child-selected': hasChildSelected,\n\t\t\t\t'is-editing-disabled': isEditingDisabled,\n\t\t\t\t'has-editable-outline': hasEditableOutline,\n\t\t\t\t'has-negative-margin': hasNegativeMargin,\n\t\t\t\t'is-content-locked-temporarily-editing-as-blocks':\n\t\t\t\t\tisTemporarilyEditingAsBlocks,\n\t\t\t},\n\t\t\tclassName,\n\t\t\tprops.className,\n\t\t\twrapperProps.className,\n\t\t\tdefaultClassName\n\t\t),\n\t\tstyle: { ...wrapperProps.style, ...props.style, ...bindingsStyle },\n\t};\n}\n\n/**\n * Call within a save function to get the props for the block wrapper.\n *\n * @param {Object} props Optional. Props to pass to the element.\n */\nuseBlockProps.save = getBlockProps;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAN,sBAAA,CAAAC,OAAA;AAKA,IAAAM,mBAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,oBAAA,GAAAP,OAAA;AACA,IAAAQ,qBAAA,GAAAR,OAAA;AACA,IAAAS,aAAA,GAAAT,OAAA;AACA,IAAAU,QAAA,GAAAV,OAAA;AAIA,IAAAW,gBAAA,GAAAX,OAAA;AACA,IAAAY,8BAAA,GAAAZ,OAAA;AACA,IAAAa,aAAA,GAAAb,OAAA;AACA,IAAAc,wBAAA,GAAAd,OAAA;AACA,IAAAe,kBAAA,GAAAf,OAAA;AACA,IAAAgB,uBAAA,GAAAhB,OAAA;AACA,IAAAiB,cAAA,GAAAjB,OAAA;AACA,IAAAkB,iCAAA,GAAAlB,OAAA;AAhCA;AACA;AACA;;AAGA;AACA;AACA;;AAOA;AACA;AACA;;AAkBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A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+BAAa","ignoreList":[]}
@@ -37,14 +37,16 @@ function ZoomOutSeparator({
37
37
  sectionClientIds,
38
38
  insertionPoint,
39
39
  blockInsertionPointVisible,
40
- blockInsertionPoint
40
+ blockInsertionPoint,
41
+ blocksBeingDragged
41
42
  } = (0, _data.useSelect)(select => {
42
43
  const {
43
44
  getInsertionPoint,
44
45
  getBlockOrder,
45
46
  getSectionRootClientId,
46
47
  isBlockInsertionPointVisible,
47
- getBlockInsertionPoint
48
+ getBlockInsertionPoint,
49
+ getDraggedBlockClientIds
48
50
  } = (0, _lockUnlock.unlock)(select(_store.store));
49
51
  const root = getSectionRootClientId();
50
52
  const sectionRootClientIds = getBlockOrder(root);
@@ -54,7 +56,8 @@ function ZoomOutSeparator({
54
56
  blockOrder: getBlockOrder(root),
55
57
  insertionPoint: getInsertionPoint(),
56
58
  blockInsertionPoint: getBlockInsertionPoint(),
57
- blockInsertionPointVisible: isBlockInsertionPointVisible()
59
+ blockInsertionPointVisible: isBlockInsertionPointVisible(),
60
+ blocksBeingDragged: getDraggedBlockClientIds()
58
61
  };
59
62
  }, []);
60
63
  const isReducedMotion = (0, _compose.useReducedMotion)();
@@ -68,6 +71,7 @@ function ZoomOutSeparator({
68
71
  }
69
72
  const hasTopInsertionPoint = insertionPoint?.index === 0 && clientId === sectionClientIds[insertionPoint.index];
70
73
  const hasBottomInsertionPoint = insertionPoint && insertionPoint.hasOwnProperty('index') && clientId === sectionClientIds[insertionPoint.index - 1];
74
+
71
75
  // We want to show the zoom out separator in either of these conditions:
72
76
  // 1. If the inserter has an insertion index set
73
77
  // 2. We are dragging a pattern over an insertion point
@@ -77,6 +81,19 @@ function ZoomOutSeparator({
77
81
  if (position === 'bottom') {
78
82
  isVisible = hasBottomInsertionPoint || blockInsertionPointVisible && clientId === sectionClientIds[blockInsertionPoint.index - 1];
79
83
  }
84
+ const blockBeingDraggedClientId = blocksBeingDragged[0];
85
+ const isCurrentBlockBeingDragged = blocksBeingDragged.includes(clientId);
86
+ const blockBeingDraggedIndex = sectionClientIds.indexOf(blockBeingDraggedClientId);
87
+ const blockBeingDraggedPreviousSiblingClientId = blockBeingDraggedIndex > 0 ? sectionClientIds[blockBeingDraggedIndex - 1] : null;
88
+ const isCurrentBlockPreviousSiblingOfBlockBeingDragged = blockBeingDraggedPreviousSiblingClientId === clientId;
89
+
90
+ // The separators are visually top/bottom of the block, but in actual fact
91
+ // the "top" separator is the "bottom" separator of the previous block.
92
+ // Therefore, this logic hides the separator if the current block is being dragged
93
+ // or if the current block is the previous sibling of the block being dragged.
94
+ if (isCurrentBlockBeingDragged || isCurrentBlockPreviousSiblingOfBlockBeingDragged) {
95
+ isVisible = false;
96
+ }
80
97
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__unstableAnimatePresence, {
81
98
  children: isVisible && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__unstableMotion.div, {
82
99
  initial: {
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_components","_compose","_data","_element","_i18n","_store","_lockUnlock","_jsxRuntime","ZoomOutSeparator","clientId","rootClientId","position","isDraggedOver","setIsDraggedOver","useState","sectionRootClientId","sectionClientIds","insertionPoint","blockInsertionPointVisible","blockInsertionPoint","useSelect","select","getInsertionPoint","getBlockOrder","getSectionRootClientId","isBlockInsertionPointVisible","getBlockInsertionPoint","unlock","blockEditorStore","root","sectionRootClientIds","blockOrder","isReducedMotion","useReducedMotion","isVisible","isSectionBlock","includes","hasTopInsertionPoint","index","hasBottomInsertionPoint","hasOwnProperty","jsx","__unstableAnimatePresence","children","__unstableMotion","div","initial","height","animate","exit","transition","type","duration","ease","className","clsx","onDragOver","onDragLeave","opacity","delay","__"],"sources":["@wordpress/block-editor/src/components/block-list/zoom-out-separator.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\t__unstableMotion as motion,\n\t__unstableAnimatePresence as AnimatePresence,\n} from '@wordpress/components';\nimport { useReducedMotion } from '@wordpress/compose';\nimport { useSelect } from '@wordpress/data';\nimport { useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nexport function ZoomOutSeparator( {\n\tclientId,\n\trootClientId = '',\n\tposition = 'top',\n} ) {\n\tconst [ isDraggedOver, setIsDraggedOver ] = useState( false );\n\tconst {\n\t\tsectionRootClientId,\n\t\tsectionClientIds,\n\t\tinsertionPoint,\n\t\tblockInsertionPointVisible,\n\t\tblockInsertionPoint,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetInsertionPoint,\n\t\t\tgetBlockOrder,\n\t\t\tgetSectionRootClientId,\n\t\t\tisBlockInsertionPointVisible,\n\t\t\tgetBlockInsertionPoint,\n\t\t} = unlock( select( blockEditorStore ) );\n\n\t\tconst root = getSectionRootClientId();\n\t\tconst sectionRootClientIds = getBlockOrder( root );\n\t\treturn {\n\t\t\tsectionRootClientId: root,\n\t\t\tsectionClientIds: sectionRootClientIds,\n\t\t\tblockOrder: getBlockOrder( root ),\n\t\t\tinsertionPoint: getInsertionPoint(),\n\t\t\tblockInsertionPoint: getBlockInsertionPoint(),\n\t\t\tblockInsertionPointVisible: isBlockInsertionPointVisible(),\n\t\t};\n\t}, [] );\n\n\tconst isReducedMotion = useReducedMotion();\n\n\tif ( ! clientId ) {\n\t\treturn;\n\t}\n\n\tlet isVisible = false;\n\n\tconst isSectionBlock =\n\t\trootClientId === sectionRootClientId &&\n\t\tsectionClientIds &&\n\t\tsectionClientIds.includes( clientId );\n\n\tif ( ! isSectionBlock ) {\n\t\treturn null;\n\t}\n\n\tconst hasTopInsertionPoint =\n\t\tinsertionPoint?.index === 0 &&\n\t\tclientId === sectionClientIds[ insertionPoint.index ];\n\tconst hasBottomInsertionPoint =\n\t\tinsertionPoint &&\n\t\tinsertionPoint.hasOwnProperty( 'index' ) &&\n\t\tclientId === sectionClientIds[ insertionPoint.index - 1 ];\n\t// We want to show the zoom out separator in either of these conditions:\n\t// 1. If the inserter has an insertion index set\n\t// 2. We are dragging a pattern over an insertion point\n\tif ( position === 'top' ) {\n\t\tisVisible =\n\t\t\thasTopInsertionPoint ||\n\t\t\t( blockInsertionPointVisible &&\n\t\t\t\tblockInsertionPoint.index === 0 &&\n\t\t\t\tclientId === sectionClientIds[ blockInsertionPoint.index ] );\n\t}\n\n\tif ( position === 'bottom' ) {\n\t\tisVisible =\n\t\t\thasBottomInsertionPoint ||\n\t\t\t( blockInsertionPointVisible &&\n\t\t\t\tclientId ===\n\t\t\t\t\tsectionClientIds[ blockInsertionPoint.index - 1 ] );\n\t}\n\n\treturn (\n\t\t<AnimatePresence>\n\t\t\t{ isVisible && (\n\t\t\t\t<motion.div\n\t\t\t\t\tinitial={ { height: 0 } }\n\t\t\t\t\tanimate={ {\n\t\t\t\t\t\t// Use a height equal to that of the zoom out frame size.\n\t\t\t\t\t\theight: 'calc(1 * var(--wp-block-editor-iframe-zoom-out-frame-size) / var(--wp-block-editor-iframe-zoom-out-scale)',\n\t\t\t\t\t} }\n\t\t\t\t\texit={ { height: 0 } }\n\t\t\t\t\ttransition={ {\n\t\t\t\t\t\ttype: 'tween',\n\t\t\t\t\t\tduration: isReducedMotion ? 0 : 0.2,\n\t\t\t\t\t\tease: [ 0.6, 0, 0.4, 1 ],\n\t\t\t\t\t} }\n\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t'block-editor-block-list__zoom-out-separator',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t'is-dragged-over': isDraggedOver,\n\t\t\t\t\t\t}\n\t\t\t\t\t) }\n\t\t\t\t\tdata-is-insertion-point=\"true\"\n\t\t\t\t\tonDragOver={ () => setIsDraggedOver( true ) }\n\t\t\t\t\tonDragLeave={ () => setIsDraggedOver( false ) }\n\t\t\t\t>\n\t\t\t\t\t<motion.div\n\t\t\t\t\t\tinitial={ { opacity: 0 } }\n\t\t\t\t\t\tanimate={ { opacity: 1 } }\n\t\t\t\t\t\texit={ { opacity: 0, transition: { delay: -0.125 } } }\n\t\t\t\t\t\ttransition={ {\n\t\t\t\t\t\t\tease: 'linear',\n\t\t\t\t\t\t\tduration: 0.1,\n\t\t\t\t\t\t\tdelay: 0.125,\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Drop pattern.' ) }\n\t\t\t\t\t</motion.div>\n\t\t\t\t</motion.div>\n\t\t\t) }\n\t\t</AnimatePresence>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AAIA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AAKA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA;AAA2C,IAAAQ,WAAA,GAAAR,OAAA;AArB3C;AACA;AACA;;AAGA;AACA;AACA;;AAUA;AACA;AACA;;AAIO,SAASS,gBAAgBA,CAAE;EACjCC,QAAQ;EACRC,YAAY,GAAG,EAAE;EACjBC,QAAQ,GAAG;AACZ,CAAC,EAAG;EACH,MAAM,CAAEC,aAAa,EAAEC,gBAAgB,CAAE,GAAG,IAAAC,iBAAQ,EAAE,KAAM,CAAC;EAC7D,MAAM;IACLC,mBAAmB;IACnBC,gBAAgB;IAChBC,cAAc;IACdC,0BAA0B;IAC1BC;EACD,CAAC,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IAC5B,MAAM;MACLC,iBAAiB;MACjBC,aAAa;MACbC,sBAAsB;MACtBC,4BAA4B;MAC5BC;IACD,CAAC,GAAG,IAAAC,kBAAM,EAAEN,MAAM,CAAEO,YAAiB,CAAE,CAAC;IAExC,MAAMC,IAAI,GAAGL,sBAAsB,CAAC,CAAC;IACrC,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AAE,EAAE,eAAgB;MAAC,CACZ;IAAC,CACF;EACZ,CACe,CAAC;AAEpB","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_components","_compose","_data","_element","_i18n","_store","_lockUnlock","_jsxRuntime","ZoomOutSeparator","clientId","rootClientId","position","isDraggedOver","setIsDraggedOver","useState","sectionRootClientId","sectionClientIds","insertionPoint","blockInsertionPointVisible","blockInsertionPoint","blocksBeingDragged","useSelect","select","getInsertionPoint","getBlockOrder","getSectionRootClientId","isBlockInsertionPointVisible","getBlockInsertionPoint","getDraggedBlockClientIds","unlock","blockEditorStore","root","sectionRootClientIds","blockOrder","isReducedMotion","useReducedMotion","isVisible","isSectionBlock","includes","hasTopInsertionPoint","index","hasBottomInsertionPoint","hasOwnProperty","blockBeingDraggedClientId","isCurrentBlockBeingDragged","blockBeingDraggedIndex","indexOf","blockBeingDraggedPreviousSiblingClientId","isCurrentBlockPreviousSiblingOfBlockBeingDragged","jsx","__unstableAnimatePresence","children","__unstableMotion","div","initial","height","animate","exit","transition","type","duration","ease","className","clsx","onDragOver","onDragLeave","opacity","delay","__"],"sources":["@wordpress/block-editor/src/components/block-list/zoom-out-separator.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\t__unstableMotion as motion,\n\t__unstableAnimatePresence as AnimatePresence,\n} from '@wordpress/components';\nimport { useReducedMotion } from '@wordpress/compose';\nimport { useSelect } from '@wordpress/data';\nimport { useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nexport function ZoomOutSeparator( {\n\tclientId,\n\trootClientId = '',\n\tposition = 'top',\n} ) {\n\tconst [ isDraggedOver, setIsDraggedOver ] = useState( false );\n\tconst {\n\t\tsectionRootClientId,\n\t\tsectionClientIds,\n\t\tinsertionPoint,\n\t\tblockInsertionPointVisible,\n\t\tblockInsertionPoint,\n\t\tblocksBeingDragged,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetInsertionPoint,\n\t\t\tgetBlockOrder,\n\t\t\tgetSectionRootClientId,\n\t\t\tisBlockInsertionPointVisible,\n\t\t\tgetBlockInsertionPoint,\n\t\t\tgetDraggedBlockClientIds,\n\t\t} = unlock( select( blockEditorStore ) );\n\n\t\tconst root = getSectionRootClientId();\n\t\tconst sectionRootClientIds = getBlockOrder( root );\n\t\treturn {\n\t\t\tsectionRootClientId: root,\n\t\t\tsectionClientIds: sectionRootClientIds,\n\t\t\tblockOrder: getBlockOrder( root ),\n\t\t\tinsertionPoint: getInsertionPoint(),\n\t\t\tblockInsertionPoint: getBlockInsertionPoint(),\n\t\t\tblockInsertionPointVisible: isBlockInsertionPointVisible(),\n\t\t\tblocksBeingDragged: getDraggedBlockClientIds(),\n\t\t};\n\t}, [] );\n\n\tconst isReducedMotion = useReducedMotion();\n\n\tif ( ! clientId ) {\n\t\treturn;\n\t}\n\n\tlet isVisible = false;\n\n\tconst isSectionBlock =\n\t\trootClientId === sectionRootClientId &&\n\t\tsectionClientIds &&\n\t\tsectionClientIds.includes( clientId );\n\n\tif ( ! isSectionBlock ) {\n\t\treturn null;\n\t}\n\n\tconst hasTopInsertionPoint =\n\t\tinsertionPoint?.index === 0 &&\n\t\tclientId === sectionClientIds[ insertionPoint.index ];\n\tconst hasBottomInsertionPoint =\n\t\tinsertionPoint &&\n\t\tinsertionPoint.hasOwnProperty( 'index' ) &&\n\t\tclientId === sectionClientIds[ insertionPoint.index - 1 ];\n\n\t// We want to show the zoom out separator in either of these conditions:\n\t// 1. If the inserter has an insertion index set\n\t// 2. We are dragging a pattern over an insertion point\n\tif ( position === 'top' ) {\n\t\tisVisible =\n\t\t\thasTopInsertionPoint ||\n\t\t\t( blockInsertionPointVisible &&\n\t\t\t\tblockInsertionPoint.index === 0 &&\n\t\t\t\tclientId === sectionClientIds[ blockInsertionPoint.index ] );\n\t}\n\n\tif ( position === 'bottom' ) {\n\t\tisVisible =\n\t\t\thasBottomInsertionPoint ||\n\t\t\t( blockInsertionPointVisible &&\n\t\t\t\tclientId ===\n\t\t\t\t\tsectionClientIds[ blockInsertionPoint.index - 1 ] );\n\t}\n\n\tconst blockBeingDraggedClientId = blocksBeingDragged[ 0 ];\n\n\tconst isCurrentBlockBeingDragged = blocksBeingDragged.includes( clientId );\n\n\tconst blockBeingDraggedIndex = sectionClientIds.indexOf(\n\t\tblockBeingDraggedClientId\n\t);\n\tconst blockBeingDraggedPreviousSiblingClientId =\n\t\tblockBeingDraggedIndex > 0\n\t\t\t? sectionClientIds[ blockBeingDraggedIndex - 1 ]\n\t\t\t: null;\n\n\tconst isCurrentBlockPreviousSiblingOfBlockBeingDragged =\n\t\tblockBeingDraggedPreviousSiblingClientId === clientId;\n\n\t// The separators are visually top/bottom of the block, but in actual fact\n\t// the \"top\" separator is the \"bottom\" separator of the previous block.\n\t// Therefore, this logic hides the separator if the current block is being dragged\n\t// or if the current block is the previous sibling of the block being dragged.\n\tif (\n\t\tisCurrentBlockBeingDragged ||\n\t\tisCurrentBlockPreviousSiblingOfBlockBeingDragged\n\t) {\n\t\tisVisible = false;\n\t}\n\n\treturn (\n\t\t<AnimatePresence>\n\t\t\t{ isVisible && (\n\t\t\t\t<motion.div\n\t\t\t\t\tinitial={ { height: 0 } }\n\t\t\t\t\tanimate={ {\n\t\t\t\t\t\t// Use a height equal to that of the zoom out frame size.\n\t\t\t\t\t\theight: 'calc(1 * var(--wp-block-editor-iframe-zoom-out-frame-size) / var(--wp-block-editor-iframe-zoom-out-scale)',\n\t\t\t\t\t} }\n\t\t\t\t\texit={ { height: 0 } }\n\t\t\t\t\ttransition={ {\n\t\t\t\t\t\ttype: 'tween',\n\t\t\t\t\t\tduration: isReducedMotion ? 0 : 0.2,\n\t\t\t\t\t\tease: [ 0.6, 0, 0.4, 1 ],\n\t\t\t\t\t} }\n\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t'block-editor-block-list__zoom-out-separator',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t'is-dragged-over': isDraggedOver,\n\t\t\t\t\t\t}\n\t\t\t\t\t) }\n\t\t\t\t\tdata-is-insertion-point=\"true\"\n\t\t\t\t\tonDragOver={ () => setIsDraggedOver( true ) }\n\t\t\t\t\tonDragLeave={ () => setIsDraggedOver( false ) }\n\t\t\t\t>\n\t\t\t\t\t<motion.div\n\t\t\t\t\t\tinitial={ { opacity: 0 } }\n\t\t\t\t\t\tanimate={ { opacity: 1 } }\n\t\t\t\t\t\texit={ { opacity: 0, transition: { delay: -0.125 } } }\n\t\t\t\t\t\ttransition={ {\n\t\t\t\t\t\t\tease: 'linear',\n\t\t\t\t\t\t\tduration: 0.1,\n\t\t\t\t\t\t\tdelay: 0.125,\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Drop pattern.' ) }\n\t\t\t\t\t</motion.div>\n\t\t\t\t</motion.div>\n\t\t\t) }\n\t\t</AnimatePresence>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AAIA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AAKA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA;AAA2C,IAAAQ,WAAA,GAAAR,OAAA;AArB3C;AACA;AACA;;AAGA;AACA;AACA;;AAUA;AACA;AACA;;AAIO,SAASS,gBAAgBA,CAAE;EACjCC,QAAQ;EACRC,YAAY,GAAG,EAAE;EACjBC,QAAQ,GAAG;AACZ,CAAC,EAAG;EACH,MAAM,CAAEC,aAAa,EAAEC,gBAAgB,CAAE,GAAG,IAAAC,iBAAQ,EAAE,KAAM,CAAC;EAC7D,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E,IAAI,EAAG;QAAEF,MAAM,EAAE;MAAE,CAAG;MACtBG,UAAU,EAAG;QACZC,IAAI,EAAE,OAAO;QACbC,QAAQ,EAAE1B,eAAe,GAAG,CAAC,GAAG,GAAG;QACnC2B,IAAI,EAAE,CAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC;MACvB,CAAG;MACHC,SAAS,EAAG,IAAAC,aAAI,EACf,6CAA6C,EAC7C;QACC,iBAAiB,EAAEnD;MACpB,CACD,CAAG;MACH,2BAAwB,MAAM;MAC9BoD,UAAU,EAAGA,CAAA,KAAMnD,gBAAgB,CAAE,IAAK,CAAG;MAC7CoD,WAAW,EAAGA,CAAA,KAAMpD,gBAAgB,CAAE,KAAM,CAAG;MAAAsC,QAAA,eAE/C,IAAA5C,WAAA,CAAA0C,GAAA,EAACjD,WAAA,CAAAoD,gBAAM,CAACC,GAAG;QACVC,OAAO,EAAG;UAAEY,OAAO,EAAE;QAAE,CAAG;QAC1BV,OAAO,EAAG;UAAEU,OAAO,EAAE;QAAE,CAAG;QAC1BT,IAAI,EAAG;UAAES,OAAO,EAAE,CAAC;UAAER,UAAU,EAAE;YAAES,KAAK,EAAE,CAAC;UAAM;QAAE,CAAG;QACtDT,UAAU,EAAG;UACZG,IAAI,EAAE,QAAQ;UACdD,QAAQ,EAAE,GAAG;UACbO,KAAK,EAAE;QACR,CAAG;QAAAhB,QAAA,EAED,IAAAiB,QAAE,EAAE,eAAgB;MAAC,CACZ;IAAC,CACF;EACZ,CACe,CAAC;AAEpB","ignoreList":[]}
@@ -71,8 +71,7 @@ function BlockSettingsDropdown({
71
71
  previousBlockClientId,
72
72
  selectedBlockClientIds,
73
73
  openedBlockSettingsMenu,
74
- isContentOnly,
75
- isZoomOut
74
+ isContentOnly
76
75
  } = (0, _data.useSelect)(select => {
77
76
  const {
78
77
  getBlockName,
@@ -81,8 +80,7 @@ function BlockSettingsDropdown({
81
80
  getSelectedBlockClientIds,
82
81
  getBlockAttributes,
83
82
  getOpenedBlockSettingsMenu,
84
- getBlockEditingMode,
85
- isZoomOut: _isZoomOut
83
+ getBlockEditingMode
86
84
  } = (0, _lockUnlock.unlock)(select(_store.store));
87
85
  const {
88
86
  getActiveBlockVariation
@@ -95,8 +93,7 @@ function BlockSettingsDropdown({
95
93
  previousBlockClientId: getPreviousBlockClientId(firstBlockClientId),
96
94
  selectedBlockClientIds: getSelectedBlockClientIds(),
97
95
  openedBlockSettingsMenu: getOpenedBlockSettingsMenu(),
98
- isContentOnly: getBlockEditingMode(firstBlockClientId) === 'contentOnly',
99
- isZoomOut: _isZoomOut()
96
+ isContentOnly: getBlockEditingMode(firstBlockClientId) === 'contentOnly'
100
97
  };
101
98
  }, [firstBlockClientId]);
102
99
  const {
@@ -208,7 +205,7 @@ function BlockSettingsDropdown({
208
205
  parentBlockType: parentBlockType
209
206
  }), count === 1 && /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockHtmlConvertButton.default, {
210
207
  clientId: firstBlockClientId
211
- }), (!isContentOnly || isZoomOut) && /*#__PURE__*/(0, _jsxRuntime.jsx)(CopyMenuItem, {
208
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(CopyMenuItem, {
212
209
  clientIds: clientIds,
213
210
  onCopy: onCopy,
214
211
  shortcut: _keycodes.displayShortcut.primary('c')
@@ -240,7 +237,7 @@ function BlockSettingsDropdown({
240
237
  onClick: onPasteStyles,
241
238
  children: (0, _i18n.__)('Paste styles')
242
239
  })]
243
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockSettingsMenuControls.default.Slot, {
240
+ }), !isContentOnly && /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockSettingsMenuControls.default.Slot, {
244
241
  fillProps: {
245
242
  onClose,
246
243
  count,