@wordpress/block-editor 12.24.0 → 12.25.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 (510) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/README.md +1 -1
  3. package/build/components/alignment-control/ui.js +3 -1
  4. package/build/components/alignment-control/ui.js.map +1 -1
  5. package/build/components/block-inspector/index.js +1 -1
  6. package/build/components/block-inspector/index.js.map +1 -1
  7. package/build/components/block-list/block.js +0 -9
  8. package/build/components/block-list/block.js.map +1 -1
  9. package/build/components/block-list/index.js +4 -3
  10. package/build/components/block-list/index.js.map +1 -1
  11. package/build/components/block-list/index.native.js +1 -9
  12. package/build/components/block-list/index.native.js.map +1 -1
  13. package/build/components/block-list/use-block-props/index.js +6 -6
  14. package/build/components/block-list/use-block-props/index.js.map +1 -1
  15. package/build/components/block-list/use-block-props/use-block-refs.js +17 -46
  16. package/build/components/block-list/use-block-props/use-block-refs.js.map +1 -1
  17. package/build/components/block-list/use-block-props/use-is-hovered.js +10 -14
  18. package/build/components/block-list/use-block-props/use-is-hovered.js.map +1 -1
  19. package/build/components/block-mover/index.native.js +3 -1
  20. package/build/components/block-mover/index.native.js.map +1 -1
  21. package/build/components/block-settings-menu/block-settings-dropdown.js +0 -25
  22. package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  23. package/build/components/block-switcher/pattern-transformations-menu.js +3 -1
  24. package/build/components/block-switcher/pattern-transformations-menu.js.map +1 -1
  25. package/build/components/block-switcher/use-transformed-patterns.js +6 -2
  26. package/build/components/block-switcher/use-transformed-patterns.js.map +1 -1
  27. package/build/components/block-switcher/utils.js +15 -5
  28. package/build/components/block-switcher/utils.js.map +1 -1
  29. package/build/components/block-toolbar/use-has-block-toolbar.js +14 -9
  30. package/build/components/block-toolbar/use-has-block-toolbar.js.map +1 -1
  31. package/build/components/block-tools/index.js +3 -1
  32. package/build/components/block-tools/index.js.map +1 -1
  33. package/build/components/block-tools/use-show-block-tools.js +2 -5
  34. package/build/components/block-tools/use-show-block-tools.js.map +1 -1
  35. package/build/components/block-tools/zoom-out-mode-inserters.js +5 -1
  36. package/build/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
  37. package/build/components/block-variation-picker/index.js +3 -2
  38. package/build/components/block-variation-picker/index.js.map +1 -1
  39. package/build/components/block-variation-transforms/index.js +3 -1
  40. package/build/components/block-variation-transforms/index.js.map +1 -1
  41. package/build/components/floating-toolbar/index.native.js +9 -5
  42. package/build/components/floating-toolbar/index.native.js.map +1 -1
  43. package/build/components/global-styles/background-panel.js +1 -1
  44. package/build/components/global-styles/background-panel.js.map +1 -1
  45. package/build/components/global-styles/color-panel.js +3 -1
  46. package/build/components/global-styles/color-panel.js.map +1 -1
  47. package/build/components/global-styles/dimensions-panel.js +16 -0
  48. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  49. package/build/components/global-styles/hooks.js +3 -2
  50. package/build/components/global-styles/hooks.js.map +1 -1
  51. package/build/components/global-styles/typography-panel.js +23 -23
  52. package/build/components/global-styles/typography-panel.js.map +1 -1
  53. package/build/components/global-styles/use-global-styles-output.js +149 -132
  54. package/build/components/global-styles/use-global-styles-output.js.map +1 -1
  55. package/build/components/global-styles/utils.js +45 -0
  56. package/build/components/global-styles/utils.js.map +1 -1
  57. package/build/components/inner-blocks/index.js +16 -2
  58. package/build/components/inner-blocks/index.js.map +1 -1
  59. package/build/components/inserter/block-patterns-tab/index.js +12 -31
  60. package/build/components/inserter/block-patterns-tab/index.js.map +1 -1
  61. package/build/components/inserter/block-types-tab.js +4 -0
  62. package/build/components/inserter/block-types-tab.js.map +1 -1
  63. package/build/components/inserter/category-tabs/index.js +56 -0
  64. package/build/components/inserter/category-tabs/index.js.map +1 -0
  65. package/build/components/inserter/media-tab/index.js +2 -2
  66. package/build/components/inserter/media-tab/index.js.map +1 -1
  67. package/build/components/inserter/media-tab/media-panel.js +0 -25
  68. package/build/components/inserter/media-tab/media-panel.js.map +1 -1
  69. package/build/components/inserter/media-tab/media-preview.js +13 -3
  70. package/build/components/inserter/media-tab/media-preview.js.map +1 -1
  71. package/build/components/inserter/media-tab/media-tab.js +15 -29
  72. package/build/components/inserter/media-tab/media-tab.js.map +1 -1
  73. package/build/components/inserter/menu.js +59 -69
  74. package/build/components/inserter/menu.js.map +1 -1
  75. package/build/components/inserter/tabs.js +6 -6
  76. package/build/components/inserter/tabs.js.map +1 -1
  77. package/build/components/line-height-control/index.js +6 -2
  78. package/build/components/line-height-control/index.js.map +1 -1
  79. package/build/components/link-control/search-item.js +9 -3
  80. package/build/components/link-control/search-item.js.map +1 -1
  81. package/build/components/list-view/block-select-button.js +5 -170
  82. package/build/components/list-view/block-select-button.js.map +1 -1
  83. package/build/components/list-view/block.js +166 -14
  84. package/build/components/list-view/block.js.map +1 -1
  85. package/build/components/list-view/index.js +1 -1
  86. package/build/components/list-view/index.js.map +1 -1
  87. package/build/components/list-view/use-list-view-drop-zone.js +1 -1
  88. package/build/components/list-view/use-list-view-drop-zone.js.map +1 -1
  89. package/build/components/list-view/utils.js +3 -1
  90. package/build/components/list-view/utils.js.map +1 -1
  91. package/build/components/media-placeholder/index.js +3 -3
  92. package/build/components/media-placeholder/index.js.map +1 -1
  93. package/build/components/navigable-toolbar/index.js +3 -1
  94. package/build/components/navigable-toolbar/index.js.map +1 -1
  95. package/build/components/provider/block-refs-provider.js +3 -4
  96. package/build/components/provider/block-refs-provider.js.map +1 -1
  97. package/build/components/provider/use-block-sync.js +3 -12
  98. package/build/components/provider/use-block-sync.js.map +1 -1
  99. package/build/components/rich-text/event-listeners/before-input-rules.js +93 -0
  100. package/build/components/rich-text/event-listeners/before-input-rules.js.map +1 -0
  101. package/build/components/rich-text/event-listeners/delete.js +58 -0
  102. package/build/components/rich-text/event-listeners/delete.js.map +1 -0
  103. package/build/components/rich-text/event-listeners/enter.js +98 -0
  104. package/build/components/rich-text/event-listeners/enter.js.map +1 -0
  105. package/build/components/rich-text/event-listeners/firefox-compat.js +36 -0
  106. package/build/components/rich-text/event-listeners/firefox-compat.js.map +1 -0
  107. package/build/components/rich-text/event-listeners/index.js +44 -0
  108. package/build/components/rich-text/event-listeners/index.js.map +1 -0
  109. package/build/components/rich-text/event-listeners/input-events.js +22 -0
  110. package/build/components/rich-text/event-listeners/input-events.js.map +1 -0
  111. package/build/components/rich-text/event-listeners/input-rules.js +135 -0
  112. package/build/components/rich-text/event-listeners/input-rules.js.map +1 -0
  113. package/build/components/rich-text/event-listeners/insert-replacement-text.js +33 -0
  114. package/build/components/rich-text/event-listeners/insert-replacement-text.js.map +1 -0
  115. package/build/components/rich-text/event-listeners/paste-handler.js +146 -0
  116. package/build/components/rich-text/event-listeners/paste-handler.js.map +1 -0
  117. package/build/components/rich-text/event-listeners/remove-browser-shortcuts.js +27 -0
  118. package/build/components/rich-text/event-listeners/remove-browser-shortcuts.js.map +1 -0
  119. package/build/components/rich-text/event-listeners/shortcuts.js +22 -0
  120. package/build/components/rich-text/event-listeners/shortcuts.js.map +1 -0
  121. package/build/components/rich-text/event-listeners/undo-automatic-change.js +51 -0
  122. package/build/components/rich-text/event-listeners/undo-automatic-change.js.map +1 -0
  123. package/build/components/rich-text/index.js +11 -31
  124. package/build/components/rich-text/index.js.map +1 -1
  125. package/build/components/rich-text/index.native.js +13 -3
  126. package/build/components/rich-text/index.native.js.map +1 -1
  127. package/build/components/rich-text/multiline.js +6 -2
  128. package/build/components/rich-text/multiline.js.map +1 -1
  129. package/build/components/rich-text/native/index.native.js +12 -0
  130. package/build/components/rich-text/native/index.native.js.map +1 -1
  131. package/build/components/rich-text/use-format-types.js +8 -4
  132. package/build/components/rich-text/use-format-types.js.map +1 -1
  133. package/build/components/segmented-text-control/index.js +62 -0
  134. package/build/components/segmented-text-control/index.js.map +1 -0
  135. package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js +16 -2
  136. package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
  137. package/build/components/text-alignment-control/index.js +76 -0
  138. package/build/components/text-alignment-control/index.js.map +1 -0
  139. package/build/components/text-decoration-control/index.js +21 -25
  140. package/build/components/text-decoration-control/index.js.map +1 -1
  141. package/build/components/text-transform-control/index.js +18 -22
  142. package/build/components/text-transform-control/index.js.map +1 -1
  143. package/build/components/use-block-display-information/index.js +9 -3
  144. package/build/components/use-block-display-information/index.js.map +1 -1
  145. package/build/components/use-on-block-drop/index.js +3 -1
  146. package/build/components/use-on-block-drop/index.js.map +1 -1
  147. package/build/components/writing-flow/use-drag-selection.js +3 -1
  148. package/build/components/writing-flow/use-drag-selection.js.map +1 -1
  149. package/build/components/writing-flow/use-tab-nav.js +3 -1
  150. package/build/components/writing-flow/use-tab-nav.js.map +1 -1
  151. package/build/components/writing-mode-control/index.js +16 -20
  152. package/build/components/writing-mode-control/index.js.map +1 -1
  153. package/build/hooks/duotone.js +3 -1
  154. package/build/hooks/duotone.js.map +1 -1
  155. package/build/hooks/utils.js +11 -6
  156. package/build/hooks/utils.js.map +1 -1
  157. package/build/private-apis.js +4 -2
  158. package/build/private-apis.js.map +1 -1
  159. package/build/store/actions.js +32 -8
  160. package/build/store/actions.js.map +1 -1
  161. package/build/store/private-selectors.js +27 -6
  162. package/build/store/private-selectors.js.map +1 -1
  163. package/build/store/reducer.js +11 -8
  164. package/build/store/reducer.js.map +1 -1
  165. package/build/store/selectors.js +21 -7
  166. package/build/store/selectors.js.map +1 -1
  167. package/build/utils/object.js +17 -0
  168. package/build/utils/object.js.map +1 -1
  169. package/build/utils/order-inserter-block-items.js +6 -2
  170. package/build/utils/order-inserter-block-items.js.map +1 -1
  171. package/build/utils/pasting.js +6 -2
  172. package/build/utils/pasting.js.map +1 -1
  173. package/build-module/components/alignment-control/ui.js +3 -1
  174. package/build-module/components/alignment-control/ui.js.map +1 -1
  175. package/build-module/components/block-inspector/index.js +1 -1
  176. package/build-module/components/block-inspector/index.js.map +1 -1
  177. package/build-module/components/block-list/block.js +0 -9
  178. package/build-module/components/block-list/block.js.map +1 -1
  179. package/build-module/components/block-list/index.js +4 -3
  180. package/build-module/components/block-list/index.js.map +1 -1
  181. package/build-module/components/block-list/index.native.js +1 -9
  182. package/build-module/components/block-list/index.native.js.map +1 -1
  183. package/build-module/components/block-list/use-block-props/index.js +6 -6
  184. package/build-module/components/block-list/use-block-props/index.js.map +1 -1
  185. package/build-module/components/block-list/use-block-props/use-block-refs.js +19 -48
  186. package/build-module/components/block-list/use-block-props/use-block-refs.js.map +1 -1
  187. package/build-module/components/block-list/use-block-props/use-is-hovered.js +10 -14
  188. package/build-module/components/block-list/use-block-props/use-is-hovered.js.map +1 -1
  189. package/build-module/components/block-mover/index.native.js +3 -1
  190. package/build-module/components/block-mover/index.native.js.map +1 -1
  191. package/build-module/components/block-settings-menu/block-settings-dropdown.js +1 -26
  192. package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  193. package/build-module/components/block-switcher/pattern-transformations-menu.js +3 -1
  194. package/build-module/components/block-switcher/pattern-transformations-menu.js.map +1 -1
  195. package/build-module/components/block-switcher/use-transformed-patterns.js +6 -2
  196. package/build-module/components/block-switcher/use-transformed-patterns.js.map +1 -1
  197. package/build-module/components/block-switcher/utils.js +15 -5
  198. package/build-module/components/block-switcher/utils.js.map +1 -1
  199. package/build-module/components/block-toolbar/use-has-block-toolbar.js +14 -9
  200. package/build-module/components/block-toolbar/use-has-block-toolbar.js.map +1 -1
  201. package/build-module/components/block-tools/index.js +3 -1
  202. package/build-module/components/block-tools/index.js.map +1 -1
  203. package/build-module/components/block-tools/use-show-block-tools.js +2 -5
  204. package/build-module/components/block-tools/use-show-block-tools.js.map +1 -1
  205. package/build-module/components/block-tools/zoom-out-mode-inserters.js +5 -1
  206. package/build-module/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
  207. package/build-module/components/block-variation-picker/index.js +3 -2
  208. package/build-module/components/block-variation-picker/index.js.map +1 -1
  209. package/build-module/components/block-variation-transforms/index.js +3 -1
  210. package/build-module/components/block-variation-transforms/index.js.map +1 -1
  211. package/build-module/components/floating-toolbar/index.native.js +9 -5
  212. package/build-module/components/floating-toolbar/index.native.js.map +1 -1
  213. package/build-module/components/global-styles/background-panel.js +1 -1
  214. package/build-module/components/global-styles/background-panel.js.map +1 -1
  215. package/build-module/components/global-styles/color-panel.js +3 -1
  216. package/build-module/components/global-styles/color-panel.js.map +1 -1
  217. package/build-module/components/global-styles/dimensions-panel.js +17 -1
  218. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  219. package/build-module/components/global-styles/hooks.js +3 -2
  220. package/build-module/components/global-styles/hooks.js.map +1 -1
  221. package/build-module/components/global-styles/typography-panel.js +24 -24
  222. package/build-module/components/global-styles/typography-panel.js.map +1 -1
  223. package/build-module/components/global-styles/use-global-styles-output.js +149 -132
  224. package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
  225. package/build-module/components/global-styles/utils.js +44 -0
  226. package/build-module/components/global-styles/utils.js.map +1 -1
  227. package/build-module/components/inner-blocks/index.js +16 -2
  228. package/build-module/components/inner-blocks/index.js.map +1 -1
  229. package/build-module/components/inserter/block-patterns-tab/index.js +13 -32
  230. package/build-module/components/inserter/block-patterns-tab/index.js.map +1 -1
  231. package/build-module/components/inserter/block-types-tab.js +4 -0
  232. package/build-module/components/inserter/block-types-tab.js.map +1 -1
  233. package/build-module/components/inserter/category-tabs/index.js +49 -0
  234. package/build-module/components/inserter/category-tabs/index.js.map +1 -0
  235. package/build-module/components/inserter/media-tab/index.js +1 -1
  236. package/build-module/components/inserter/media-tab/index.js.map +1 -1
  237. package/build-module/components/inserter/media-tab/media-panel.js +0 -24
  238. package/build-module/components/inserter/media-tab/media-panel.js.map +1 -1
  239. package/build-module/components/inserter/media-tab/media-preview.js +13 -3
  240. package/build-module/components/inserter/media-tab/media-preview.js.map +1 -1
  241. package/build-module/components/inserter/media-tab/media-tab.js +17 -31
  242. package/build-module/components/inserter/media-tab/media-tab.js.map +1 -1
  243. package/build-module/components/inserter/menu.js +61 -71
  244. package/build-module/components/inserter/menu.js.map +1 -1
  245. package/build-module/components/inserter/tabs.js +6 -6
  246. package/build-module/components/inserter/tabs.js.map +1 -1
  247. package/build-module/components/line-height-control/index.js +6 -2
  248. package/build-module/components/line-height-control/index.js.map +1 -1
  249. package/build-module/components/link-control/search-item.js +9 -3
  250. package/build-module/components/link-control/search-item.js.map +1 -1
  251. package/build-module/components/list-view/block-select-button.js +7 -172
  252. package/build-module/components/list-view/block-select-button.js.map +1 -1
  253. package/build-module/components/list-view/block.js +167 -15
  254. package/build-module/components/list-view/block.js.map +1 -1
  255. package/build-module/components/list-view/index.js +1 -1
  256. package/build-module/components/list-view/index.js.map +1 -1
  257. package/build-module/components/list-view/use-list-view-drop-zone.js +1 -1
  258. package/build-module/components/list-view/use-list-view-drop-zone.js.map +1 -1
  259. package/build-module/components/list-view/utils.js +3 -1
  260. package/build-module/components/list-view/utils.js.map +1 -1
  261. package/build-module/components/media-placeholder/index.js +3 -3
  262. package/build-module/components/media-placeholder/index.js.map +1 -1
  263. package/build-module/components/navigable-toolbar/index.js +3 -1
  264. package/build-module/components/navigable-toolbar/index.js.map +1 -1
  265. package/build-module/components/provider/block-refs-provider.js +3 -4
  266. package/build-module/components/provider/block-refs-provider.js.map +1 -1
  267. package/build-module/components/provider/use-block-sync.js +4 -13
  268. package/build-module/components/provider/use-block-sync.js.map +1 -1
  269. package/build-module/components/rich-text/event-listeners/before-input-rules.js +86 -0
  270. package/build-module/components/rich-text/event-listeners/before-input-rules.js.map +1 -0
  271. package/build-module/components/rich-text/event-listeners/delete.js +51 -0
  272. package/build-module/components/rich-text/event-listeners/delete.js.map +1 -0
  273. package/build-module/components/rich-text/event-listeners/enter.js +92 -0
  274. package/build-module/components/rich-text/event-listeners/enter.js.map +1 -0
  275. package/build-module/components/rich-text/event-listeners/firefox-compat.js +29 -0
  276. package/build-module/components/rich-text/event-listeners/firefox-compat.js.map +1 -0
  277. package/build-module/components/rich-text/event-listeners/index.js +36 -0
  278. package/build-module/components/rich-text/event-listeners/index.js.map +1 -0
  279. package/build-module/components/rich-text/event-listeners/input-events.js +15 -0
  280. package/build-module/components/rich-text/event-listeners/input-events.js.map +1 -0
  281. package/build-module/components/rich-text/event-listeners/input-rules.js +127 -0
  282. package/build-module/components/rich-text/event-listeners/input-rules.js.map +1 -0
  283. package/build-module/components/rich-text/event-listeners/insert-replacement-text.js +27 -0
  284. package/build-module/components/rich-text/event-listeners/insert-replacement-text.js.map +1 -0
  285. package/build-module/components/rich-text/event-listeners/paste-handler.js +142 -0
  286. package/build-module/components/rich-text/event-listeners/paste-handler.js.map +1 -0
  287. package/build-module/components/rich-text/event-listeners/remove-browser-shortcuts.js +21 -0
  288. package/build-module/components/rich-text/event-listeners/remove-browser-shortcuts.js.map +1 -0
  289. package/build-module/components/rich-text/event-listeners/shortcuts.js +15 -0
  290. package/build-module/components/rich-text/event-listeners/shortcuts.js.map +1 -0
  291. package/build-module/components/rich-text/event-listeners/undo-automatic-change.js +45 -0
  292. package/build-module/components/rich-text/event-listeners/undo-automatic-change.js.map +1 -0
  293. package/build-module/components/rich-text/index.js +12 -32
  294. package/build-module/components/rich-text/index.js.map +1 -1
  295. package/build-module/components/rich-text/index.native.js +13 -3
  296. package/build-module/components/rich-text/index.native.js.map +1 -1
  297. package/build-module/components/rich-text/multiline.js +6 -2
  298. package/build-module/components/rich-text/multiline.js.map +1 -1
  299. package/build-module/components/rich-text/native/index.native.js +12 -0
  300. package/build-module/components/rich-text/native/index.native.js.map +1 -1
  301. package/build-module/components/rich-text/use-format-types.js +8 -4
  302. package/build-module/components/rich-text/use-format-types.js.map +1 -1
  303. package/build-module/components/segmented-text-control/index.js +55 -0
  304. package/build-module/components/segmented-text-control/index.js.map +1 -0
  305. package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js +16 -2
  306. package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
  307. package/build-module/components/text-alignment-control/index.js +68 -0
  308. package/build-module/components/text-alignment-control/index.js.map +1 -0
  309. package/build-module/components/text-decoration-control/index.js +21 -25
  310. package/build-module/components/text-decoration-control/index.js.map +1 -1
  311. package/build-module/components/text-transform-control/index.js +18 -22
  312. package/build-module/components/text-transform-control/index.js.map +1 -1
  313. package/build-module/components/use-block-display-information/index.js +9 -3
  314. package/build-module/components/use-block-display-information/index.js.map +1 -1
  315. package/build-module/components/use-on-block-drop/index.js +3 -1
  316. package/build-module/components/use-on-block-drop/index.js.map +1 -1
  317. package/build-module/components/writing-flow/use-drag-selection.js +3 -1
  318. package/build-module/components/writing-flow/use-drag-selection.js.map +1 -1
  319. package/build-module/components/writing-flow/use-tab-nav.js +3 -1
  320. package/build-module/components/writing-flow/use-tab-nav.js.map +1 -1
  321. package/build-module/components/writing-mode-control/index.js +16 -20
  322. package/build-module/components/writing-mode-control/index.js.map +1 -1
  323. package/build-module/hooks/duotone.js +3 -1
  324. package/build-module/hooks/duotone.js.map +1 -1
  325. package/build-module/hooks/utils.js +11 -6
  326. package/build-module/hooks/utils.js.map +1 -1
  327. package/build-module/private-apis.js +4 -2
  328. package/build-module/private-apis.js.map +1 -1
  329. package/build-module/store/actions.js +32 -8
  330. package/build-module/store/actions.js.map +1 -1
  331. package/build-module/store/private-selectors.js +27 -5
  332. package/build-module/store/private-selectors.js.map +1 -1
  333. package/build-module/store/reducer.js +11 -8
  334. package/build-module/store/reducer.js.map +1 -1
  335. package/build-module/store/selectors.js +21 -7
  336. package/build-module/store/selectors.js.map +1 -1
  337. package/build-module/utils/object.js +16 -0
  338. package/build-module/utils/object.js.map +1 -1
  339. package/build-module/utils/order-inserter-block-items.js +6 -2
  340. package/build-module/utils/order-inserter-block-items.js.map +1 -1
  341. package/build-module/utils/pasting.js +6 -2
  342. package/build-module/utils/pasting.js.map +1 -1
  343. package/build-style/content-rtl.css +41 -68
  344. package/build-style/content.css +41 -68
  345. package/build-style/style-rtl.css +100 -199
  346. package/build-style/style.css +100 -199
  347. package/package.json +31 -31
  348. package/src/components/alignment-control/ui.js +3 -1
  349. package/src/components/block-bindings-toolbar-indicator/style.scss +1 -4
  350. package/src/components/block-canvas/style.scss +1 -3
  351. package/src/components/block-draggable/test/helpers.native.js +8 -8
  352. package/src/components/block-inspector/index.js +1 -2
  353. package/src/components/block-list/block.js +2 -13
  354. package/src/components/block-list/content.scss +9 -1
  355. package/src/components/block-list/index.js +4 -4
  356. package/src/components/block-list/index.native.js +1 -6
  357. package/src/components/block-list/use-block-props/index.js +12 -4
  358. package/src/components/block-list/use-block-props/use-block-refs.js +17 -57
  359. package/src/components/block-list/use-block-props/use-is-hovered.js +11 -16
  360. package/src/components/block-mover/index.native.js +3 -1
  361. package/src/components/block-patterns-list/style.scss +1 -3
  362. package/src/components/block-preview/style.scss +13 -15
  363. package/src/components/block-settings-menu/block-settings-dropdown.js +1 -51
  364. package/src/components/block-switcher/pattern-transformations-menu.js +3 -1
  365. package/src/components/block-switcher/use-transformed-patterns.js +6 -2
  366. package/src/components/block-switcher/utils.js +14 -5
  367. package/src/components/block-toolbar/style.scss +8 -11
  368. package/src/components/block-toolbar/use-has-block-toolbar.js +21 -16
  369. package/src/components/block-tools/index.js +3 -1
  370. package/src/components/block-tools/use-show-block-tools.js +36 -48
  371. package/src/components/block-tools/zoom-out-mode-inserters.js +5 -1
  372. package/src/components/block-variation-picker/content.scss +22 -72
  373. package/src/components/block-variation-picker/index.js +3 -2
  374. package/src/components/block-variation-transforms/index.js +3 -1
  375. package/src/components/floating-toolbar/index.native.js +5 -2
  376. package/src/components/global-styles/background-panel.js +1 -3
  377. package/src/components/global-styles/color-panel.js +3 -1
  378. package/src/components/global-styles/dimensions-panel.js +18 -1
  379. package/src/components/global-styles/hooks.js +2 -0
  380. package/src/components/global-styles/test/utils.js +21 -0
  381. package/src/components/global-styles/typography-panel.js +27 -23
  382. package/src/components/global-styles/use-global-styles-output.js +211 -187
  383. package/src/components/global-styles/utils.js +55 -0
  384. package/src/components/inner-blocks/index.js +14 -1
  385. package/src/components/inserter/block-patterns-tab/index.js +15 -65
  386. package/src/components/inserter/block-types-tab.js +5 -0
  387. package/src/components/inserter/category-tabs/index.js +74 -0
  388. package/src/components/inserter/media-tab/index.js +1 -1
  389. package/src/components/inserter/media-tab/media-panel.js +0 -22
  390. package/src/components/inserter/media-tab/media-preview.js +15 -7
  391. package/src/components/inserter/media-tab/media-tab.js +44 -83
  392. package/src/components/inserter/menu.js +139 -117
  393. package/src/components/inserter/style.scss +90 -170
  394. package/src/components/inserter/tabs.js +5 -13
  395. package/src/components/line-height-control/index.js +6 -2
  396. package/src/components/link-control/search-item.js +9 -3
  397. package/src/components/list-view/block-select-button.js +73 -266
  398. package/src/components/list-view/block.js +218 -28
  399. package/src/components/list-view/index.js +1 -1
  400. package/src/components/list-view/style.scss +20 -28
  401. package/src/components/list-view/use-list-view-drop-zone.js +1 -1
  402. package/src/components/list-view/utils.js +3 -1
  403. package/src/components/media-placeholder/content.scss +0 -11
  404. package/src/components/media-placeholder/index.js +3 -3
  405. package/src/components/navigable-toolbar/index.js +3 -1
  406. package/src/components/provider/block-refs-provider.js +3 -8
  407. package/src/components/provider/test/use-block-sync.js +7 -0
  408. package/src/components/provider/use-block-sync.js +3 -20
  409. package/src/components/rich-text/event-listeners/before-input-rules.js +92 -0
  410. package/src/components/rich-text/event-listeners/delete.js +53 -0
  411. package/src/components/rich-text/event-listeners/enter.js +104 -0
  412. package/src/components/rich-text/event-listeners/firefox-compat.js +31 -0
  413. package/src/components/rich-text/event-listeners/index.js +56 -0
  414. package/src/components/rich-text/event-listeners/input-events.js +13 -0
  415. package/src/components/rich-text/event-listeners/input-rules.js +146 -0
  416. package/src/components/rich-text/event-listeners/insert-replacement-text.js +28 -0
  417. package/src/components/rich-text/event-listeners/paste-handler.js +169 -0
  418. package/src/components/rich-text/event-listeners/remove-browser-shortcuts.js +24 -0
  419. package/src/components/rich-text/event-listeners/shortcuts.js +13 -0
  420. package/src/components/rich-text/event-listeners/undo-automatic-change.js +45 -0
  421. package/src/components/rich-text/index.js +7 -34
  422. package/src/components/rich-text/index.native.js +11 -0
  423. package/src/components/rich-text/multiline.js +6 -2
  424. package/src/components/rich-text/native/index.native.js +11 -0
  425. package/src/components/rich-text/use-format-types.js +6 -2
  426. package/src/components/segmented-text-control/index.js +63 -0
  427. package/src/components/{writing-mode-control → segmented-text-control}/style.scss +2 -5
  428. package/src/components/spacing-sizes-control/input-controls/spacing-input-control.js +16 -1
  429. package/src/components/text-alignment-control/index.js +91 -0
  430. package/src/components/text-alignment-control/stories/index.story.js +39 -0
  431. package/src/components/text-decoration-control/index.js +20 -33
  432. package/src/components/text-transform-control/index.js +17 -30
  433. package/src/components/use-block-display-information/index.js +9 -3
  434. package/src/components/use-on-block-drop/index.js +3 -1
  435. package/src/components/writing-flow/use-drag-selection.js +3 -1
  436. package/src/components/writing-flow/use-tab-nav.js +3 -1
  437. package/src/components/writing-mode-control/index.js +15 -28
  438. package/src/hooks/duotone.js +3 -1
  439. package/src/hooks/utils.js +16 -2
  440. package/src/private-apis.js +4 -2
  441. package/src/store/actions.js +36 -12
  442. package/src/store/private-selectors.js +28 -4
  443. package/src/store/reducer.js +13 -23
  444. package/src/store/selectors.js +20 -7
  445. package/src/style.scss +1 -2
  446. package/src/utils/object.js +16 -0
  447. package/src/utils/order-inserter-block-items.js +6 -2
  448. package/src/utils/pasting.js +6 -2
  449. package/build/components/block-list/use-block-props/use-block-moving-mode-class-names.js +0 -54
  450. package/build/components/block-list/use-block-props/use-block-moving-mode-class-names.js.map +0 -1
  451. package/build/components/rich-text/use-before-input-rules.js +0 -98
  452. package/build/components/rich-text/use-before-input-rules.js.map +0 -1
  453. package/build/components/rich-text/use-delete.js +0 -64
  454. package/build/components/rich-text/use-delete.js.map +0 -1
  455. package/build/components/rich-text/use-enter.js +0 -109
  456. package/build/components/rich-text/use-enter.js.map +0 -1
  457. package/build/components/rich-text/use-firefox-compat.js +0 -44
  458. package/build/components/rich-text/use-firefox-compat.js.map +0 -1
  459. package/build/components/rich-text/use-input-events.js +0 -25
  460. package/build/components/rich-text/use-input-events.js.map +0 -1
  461. package/build/components/rich-text/use-input-rules.js +0 -139
  462. package/build/components/rich-text/use-input-rules.js.map +0 -1
  463. package/build/components/rich-text/use-insert-replacement-text.js +0 -38
  464. package/build/components/rich-text/use-insert-replacement-text.js.map +0 -1
  465. package/build/components/rich-text/use-paste-handler.js +0 -158
  466. package/build/components/rich-text/use-paste-handler.js.map +0 -1
  467. package/build/components/rich-text/use-remove-browser-shortcuts.js +0 -32
  468. package/build/components/rich-text/use-remove-browser-shortcuts.js.map +0 -1
  469. package/build/components/rich-text/use-shortcuts.js +0 -25
  470. package/build/components/rich-text/use-shortcuts.js.map +0 -1
  471. package/build/components/rich-text/use-undo-automatic-change.js +0 -53
  472. package/build/components/rich-text/use-undo-automatic-change.js.map +0 -1
  473. package/build-module/components/block-list/use-block-props/use-block-moving-mode-class-names.js +0 -47
  474. package/build-module/components/block-list/use-block-props/use-block-moving-mode-class-names.js.map +0 -1
  475. package/build-module/components/rich-text/use-before-input-rules.js +0 -92
  476. package/build-module/components/rich-text/use-before-input-rules.js.map +0 -1
  477. package/build-module/components/rich-text/use-delete.js +0 -57
  478. package/build-module/components/rich-text/use-delete.js.map +0 -1
  479. package/build-module/components/rich-text/use-enter.js +0 -102
  480. package/build-module/components/rich-text/use-enter.js.map +0 -1
  481. package/build-module/components/rich-text/use-firefox-compat.js +0 -37
  482. package/build-module/components/rich-text/use-firefox-compat.js.map +0 -1
  483. package/build-module/components/rich-text/use-input-events.js +0 -18
  484. package/build-module/components/rich-text/use-input-events.js.map +0 -1
  485. package/build-module/components/rich-text/use-input-rules.js +0 -132
  486. package/build-module/components/rich-text/use-input-rules.js.map +0 -1
  487. package/build-module/components/rich-text/use-insert-replacement-text.js +0 -32
  488. package/build-module/components/rich-text/use-insert-replacement-text.js.map +0 -1
  489. package/build-module/components/rich-text/use-paste-handler.js +0 -152
  490. package/build-module/components/rich-text/use-paste-handler.js.map +0 -1
  491. package/build-module/components/rich-text/use-remove-browser-shortcuts.js +0 -26
  492. package/build-module/components/rich-text/use-remove-browser-shortcuts.js.map +0 -1
  493. package/build-module/components/rich-text/use-shortcuts.js +0 -18
  494. package/build-module/components/rich-text/use-shortcuts.js.map +0 -1
  495. package/build-module/components/rich-text/use-undo-automatic-change.js +0 -46
  496. package/build-module/components/rich-text/use-undo-automatic-change.js.map +0 -1
  497. package/src/components/block-list/use-block-props/use-block-moving-mode-class-names.js +0 -55
  498. package/src/components/rich-text/use-before-input-rules.js +0 -99
  499. package/src/components/rich-text/use-delete.js +0 -59
  500. package/src/components/rich-text/use-enter.js +0 -110
  501. package/src/components/rich-text/use-firefox-compat.js +0 -39
  502. package/src/components/rich-text/use-input-events.js +0 -19
  503. package/src/components/rich-text/use-input-rules.js +0 -150
  504. package/src/components/rich-text/use-insert-replacement-text.js +0 -31
  505. package/src/components/rich-text/use-paste-handler.js +0 -180
  506. package/src/components/rich-text/use-remove-browser-shortcuts.js +0 -29
  507. package/src/components/rich-text/use-shortcuts.js +0 -19
  508. package/src/components/rich-text/use-undo-automatic-change.js +0 -46
  509. package/src/components/text-decoration-control/style.scss +0 -18
  510. package/src/components/text-transform-control/style.scss +0 -18
@@ -40,14 +40,15 @@ function Root({
40
40
  const {
41
41
  getSettings,
42
42
  __unstableGetEditorMode,
43
- getTemporarilyEditingAsBlocks
43
+ getTemporarilyEditingAsBlocks,
44
+ isTyping
44
45
  } = unlock(select(blockEditorStore));
45
46
  const {
46
47
  outlineMode,
47
48
  focusMode
48
49
  } = getSettings();
49
50
  return {
50
- isOutlineMode: outlineMode,
51
+ isOutlineMode: outlineMode && !isTyping(),
51
52
  isFocusMode: focusMode,
52
53
  editorMode: __unstableGetEditorMode(),
53
54
  temporarilyEditingAsBlocks: getTemporarilyEditingAsBlocks()
@@ -169,7 +170,7 @@ function Items({
169
170
  order: _order,
170
171
  selectedBlocks: getSelectedBlockClientIds(),
171
172
  visibleBlocks: __unstableGetVisibleBlocks(),
172
- shouldRenderAppender: hasAppender && (hasCustomAppender ? !getTemplateLock(rootClientId) && getBlockEditingMode(rootClientId) !== 'disabled' && __unstableGetEditorMode() !== 'zoom-out' : rootClientId === selectedBlockClientId || !rootClientId && !selectedBlockClientId && !_order.length)
173
+ shouldRenderAppender: hasAppender && __unstableGetEditorMode() !== 'zoom-out' && (hasCustomAppender ? !getTemplateLock(rootClientId) && getBlockEditingMode(rootClientId) !== 'disabled' : rootClientId === selectedBlockClientId || !rootClientId && !selectedBlockClientId && !_order.length)
173
174
  };
174
175
  }, [rootClientId, hasAppender, hasCustomAppender]);
175
176
  return createElement(LayoutProvider, {
@@ -1 +1 @@
1
- {"version":3,"names":["classnames","AsyncModeProvider","useSelect","useDispatch","useRegistry","useViewportMatch","useMergeRefs","useDebounce","createContext","useMemo","useCallback","useEffect","BlockListBlock","BlockListAppender","useInBetweenInserter","store","blockEditorStore","LayoutProvider","defaultLayout","useBlockSelectionClearer","useInnerBlocksProps","BlockEditContextProvider","DEFAULT_BLOCK_EDIT_CONTEXT","useTypingObserver","unlock","IntersectionObserver","pendingBlockVisibilityUpdatesPerRegistry","WeakMap","Root","className","settings","isLargeViewport","isOutlineMode","isFocusMode","editorMode","temporarilyEditingAsBlocks","select","getSettings","__unstableGetEditorMode","getTemporarilyEditingAsBlocks","outlineMode","focusMode","registry","setBlockVisibility","delayedBlockVisibilityUpdates","updates","get","forEach","id","isIntersecting","trailing","intersectionObserver","Observer","window","entries","set","entry","clientId","target","getAttribute","push","innerBlocksProps","ref","createElement","Provider","value","StopEditingAsBlocksOnOutsideSelect","stopEditingAsBlocks","isBlockOrDescendantSelected","isBlockSelected","hasSelectedInnerBlock","BlockList","EMPTY_ARRAY","EMPTY_SET","Set","Items","placeholder","rootClientId","renderAppender","CustomAppender","__experimentalAppenderTagName","layout","hasAppender","hasCustomAppender","order","selectedBlocks","visibleBlocks","shouldRenderAppender","getBlockOrder","getSelectedBlockClientId","getSelectedBlockClientIds","__unstableGetVisibleBlocks","getTemplateLock","getBlockEditingMode","_order","__unstableIsPreviewMode","selectedBlockClientId","length","map","key","has","includes","tagName","BlockListItems","props"],"sources":["@wordpress/block-editor/src/components/block-list/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\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 { 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 {\n\t\tisOutlineMode,\n\t\tisFocusMode,\n\t\teditorMode,\n\t\ttemporarilyEditingAsBlocks,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetSettings,\n\t\t\t__unstableGetEditorMode,\n\t\t\tgetTemporarilyEditingAsBlocks,\n\t\t} = unlock( select( blockEditorStore ) );\n\t\tconst { outlineMode, focusMode } = getSettings();\n\t\treturn {\n\t\t\tisOutlineMode: outlineMode,\n\t\t\tisFocusMode: focusMode,\n\t\t\teditorMode: __unstableGetEditorMode(),\n\t\t\ttemporarilyEditingAsBlocks: getTemporarilyEditingAsBlocks(),\n\t\t};\n\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: classnames( '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\t'is-navigate-mode': editorMode === 'navigation',\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 { order, selectedBlocks, visibleBlocks, shouldRenderAppender } =\n\t\tuseSelect(\n\t\t\t( select ) => {\n\t\t\t\tconst {\n\t\t\t\t\tgetSettings,\n\t\t\t\t\tgetBlockOrder,\n\t\t\t\t\tgetSelectedBlockClientId,\n\t\t\t\t\tgetSelectedBlockClientIds,\n\t\t\t\t\t__unstableGetVisibleBlocks,\n\t\t\t\t\tgetTemplateLock,\n\t\t\t\t\tgetBlockEditingMode,\n\t\t\t\t\t__unstableGetEditorMode,\n\t\t\t\t} = select( blockEditorStore );\n\n\t\t\t\tconst _order = getBlockOrder( rootClientId );\n\n\t\t\t\tif ( getSettings().__unstableIsPreviewMode ) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\torder: _order,\n\t\t\t\t\t\tselectedBlocks: EMPTY_ARRAY,\n\t\t\t\t\t\tvisibleBlocks: EMPTY_SET,\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tconst selectedBlockClientId = getSelectedBlockClientId();\n\t\t\t\treturn {\n\t\t\t\t\torder: _order,\n\t\t\t\t\tselectedBlocks: getSelectedBlockClientIds(),\n\t\t\t\t\tvisibleBlocks: __unstableGetVisibleBlocks(),\n\t\t\t\t\tshouldRenderAppender:\n\t\t\t\t\t\thasAppender &&\n\t\t\t\t\t\t( hasCustomAppender\n\t\t\t\t\t\t\t? ! getTemplateLock( rootClientId ) &&\n\t\t\t\t\t\t\t getBlockEditingMode( rootClientId ) !==\n\t\t\t\t\t\t\t\t\t'disabled' &&\n\t\t\t\t\t\t\t __unstableGetEditorMode() !== 'zoom-out'\n\t\t\t\t\t\t\t: rootClientId === selectedBlockClientId ||\n\t\t\t\t\t\t\t ( ! rootClientId &&\n\t\t\t\t\t\t\t\t\t! selectedBlockClientId &&\n\t\t\t\t\t\t\t\t\t! _order.length ) ),\n\t\t\t\t};\n\t\t\t},\n\t\t\t[ rootClientId, hasAppender, hasCustomAppender ]\n\t\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<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</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":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SACCC,iBAAiB,EACjBC,SAAS,EACTC,WAAW,EACXC,WAAW,QACL,iBAAiB;AACxB,SACCC,gBAAgB,EAChBC,YAAY,EACZC,WAAW,QACL,oBAAoB;AAC3B,SACCC,aAAa,EACbC,OAAO,EACPC,WAAW,EACXC,SAAS,QACH,oBAAoB;;AAE3B;AACA;AACA;AACA,OAAOC,cAAc,MAAM,SAAS;AACpC,OAAOC,iBAAiB,MAAM,wBAAwB;AACtD,SAASC,oBAAoB,QAAQ,2BAA2B;AAChE,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,aAAa;AACvD,SAASC,cAAc,EAAEC,aAAa,QAAQ,UAAU;AACxD,SAASC,wBAAwB,QAAQ,4BAA4B;AACrE,SAASC,mBAAmB,QAAQ,iBAAiB;AACrD,SACCC,wBAAwB,EACxBC,0BAA0B,QACpB,uBAAuB;AAC9B,SAASC,iBAAiB,QAAQ,mBAAmB;AACrD,SAASC,MAAM,QAAQ,mBAAmB;AAE1C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B,QAAQ,CAAE5C,QAAS;EACpC,GAEDM,aAAA,CAACnD,cAAc;IACdiE,YAAY,EAAGA,YAAc;IAC7BpB,QAAQ,EAAGA;EAAU,CACrB,CACiB,CAClB,CAAC,EACD2B,KAAK,CAACa,MAAM,GAAG,CAAC,IAAIrB,WAAW,EAC/BW,oBAAoB,IACrBxB,aAAA,CAAClD,iBAAiB;IACjByF,OAAO,EAAGtB,6BAA+B;IACzCH,YAAY,EAAGA,YAAc;IAC7BE,cAAc,EAAGA;EAAgB,CACjC,CAEa,CAAC;AAEnB;AAEA,OAAO,SAASwB,cAAcA,CAAEC,KAAK,EAAG;EACvC;EACA;EACA,OACCzC,aAAA,CAAC9D,iBAAiB;IAACgE,KAAK,EAAG;EAAO,GACjCF,aAAA,CAACY,KAAK;IAAA,GAAM6B;EAAK,CAAI,CACH,CAAC;AAEtB","ignoreList":[]}
1
+ {"version":3,"names":["classnames","AsyncModeProvider","useSelect","useDispatch","useRegistry","useViewportMatch","useMergeRefs","useDebounce","createContext","useMemo","useCallback","useEffect","BlockListBlock","BlockListAppender","useInBetweenInserter","store","blockEditorStore","LayoutProvider","defaultLayout","useBlockSelectionClearer","useInnerBlocksProps","BlockEditContextProvider","DEFAULT_BLOCK_EDIT_CONTEXT","useTypingObserver","unlock","IntersectionObserver","pendingBlockVisibilityUpdatesPerRegistry","WeakMap","Root","className","settings","isLargeViewport","isOutlineMode","isFocusMode","editorMode","temporarilyEditingAsBlocks","select","getSettings","__unstableGetEditorMode","getTemporarilyEditingAsBlocks","isTyping","outlineMode","focusMode","registry","setBlockVisibility","delayedBlockVisibilityUpdates","updates","get","forEach","id","isIntersecting","trailing","intersectionObserver","Observer","window","entries","set","entry","clientId","target","getAttribute","push","innerBlocksProps","ref","createElement","Provider","value","StopEditingAsBlocksOnOutsideSelect","stopEditingAsBlocks","isBlockOrDescendantSelected","isBlockSelected","hasSelectedInnerBlock","BlockList","EMPTY_ARRAY","EMPTY_SET","Set","Items","placeholder","rootClientId","renderAppender","CustomAppender","__experimentalAppenderTagName","layout","hasAppender","hasCustomAppender","order","selectedBlocks","visibleBlocks","shouldRenderAppender","getBlockOrder","getSelectedBlockClientId","getSelectedBlockClientIds","__unstableGetVisibleBlocks","getTemplateLock","getBlockEditingMode","_order","__unstableIsPreviewMode","selectedBlockClientId","length","map","key","has","includes","tagName","BlockListItems","props"],"sources":["@wordpress/block-editor/src/components/block-list/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\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 { 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 {\n\t\tisOutlineMode,\n\t\tisFocusMode,\n\t\teditorMode,\n\t\ttemporarilyEditingAsBlocks,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetSettings,\n\t\t\t__unstableGetEditorMode,\n\t\t\tgetTemporarilyEditingAsBlocks,\n\t\t\tisTyping,\n\t\t} = unlock( select( blockEditorStore ) );\n\t\tconst { outlineMode, focusMode } = getSettings();\n\t\treturn {\n\t\t\tisOutlineMode: outlineMode && ! isTyping(),\n\t\t\tisFocusMode: focusMode,\n\t\t\teditorMode: __unstableGetEditorMode(),\n\t\t\ttemporarilyEditingAsBlocks: getTemporarilyEditingAsBlocks(),\n\t\t};\n\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: classnames( '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\t'is-navigate-mode': editorMode === 'navigation',\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 { order, selectedBlocks, visibleBlocks, shouldRenderAppender } =\n\t\tuseSelect(\n\t\t\t( select ) => {\n\t\t\t\tconst {\n\t\t\t\t\tgetSettings,\n\t\t\t\t\tgetBlockOrder,\n\t\t\t\t\tgetSelectedBlockClientId,\n\t\t\t\t\tgetSelectedBlockClientIds,\n\t\t\t\t\t__unstableGetVisibleBlocks,\n\t\t\t\t\tgetTemplateLock,\n\t\t\t\t\tgetBlockEditingMode,\n\t\t\t\t\t__unstableGetEditorMode,\n\t\t\t\t} = select( blockEditorStore );\n\n\t\t\t\tconst _order = getBlockOrder( rootClientId );\n\n\t\t\t\tif ( getSettings().__unstableIsPreviewMode ) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\torder: _order,\n\t\t\t\t\t\tselectedBlocks: EMPTY_ARRAY,\n\t\t\t\t\t\tvisibleBlocks: EMPTY_SET,\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tconst selectedBlockClientId = getSelectedBlockClientId();\n\t\t\t\treturn {\n\t\t\t\t\torder: _order,\n\t\t\t\t\tselectedBlocks: getSelectedBlockClientIds(),\n\t\t\t\t\tvisibleBlocks: __unstableGetVisibleBlocks(),\n\t\t\t\t\tshouldRenderAppender:\n\t\t\t\t\t\thasAppender &&\n\t\t\t\t\t\t__unstableGetEditorMode() !== 'zoom-out' &&\n\t\t\t\t\t\t( hasCustomAppender\n\t\t\t\t\t\t\t? ! getTemplateLock( rootClientId ) &&\n\t\t\t\t\t\t\t getBlockEditingMode( rootClientId ) !== 'disabled'\n\t\t\t\t\t\t\t: rootClientId === selectedBlockClientId ||\n\t\t\t\t\t\t\t ( ! rootClientId &&\n\t\t\t\t\t\t\t\t\t! selectedBlockClientId &&\n\t\t\t\t\t\t\t\t\t! _order.length ) ),\n\t\t\t\t};\n\t\t\t},\n\t\t\t[ rootClientId, hasAppender, hasCustomAppender ]\n\t\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<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</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":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SACCC,iBAAiB,EACjBC,SAAS,EACTC,WAAW,EACXC,WAAW,QACL,iBAAiB;AACxB,SACCC,gBAAgB,EAChBC,YAAY,EACZC,WAAW,QACL,oBAAoB;AAC3B,SACCC,aAAa,EACbC,OAAO,EACPC,WAAW,EACXC,SAAS,QACH,oBAAoB;;AAE3B;AACA;AACA;AACA,OAAOC,cAAc,MAAM,SAAS;AACpC,OAAOC,iBAAiB,MAAM,wBAAwB;AACtD,SAASC,oBAAoB,QAAQ,2BAA2B;AAChE,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,aAAa;AACvD,SAASC,cAAc,EAAEC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AEF,OACCpB,aAAA,CAAC/C,cAAc;IAACiD,KAAK,EAAGgB;EAAQ,GAC7BG,KAAK,CAACc,GAAG,CAAIzC,QAAQ,IACtBM,aAAA,CAAC/D,iBAAiB;IACjBmG,GAAG,EAAG1C,QAAU;IAChBQ,KAAK;IACJ;IACA;IACA,CAAEqB,aAAa,CAACc,GAAG,CAAE3C,QAAS,CAAC,IAC/B,CAAE4B,cAAc,CAACgB,QAAQ,CAAE5C,QAAS;EACpC,GAEDM,aAAA,CAACpD,cAAc;IACdkE,YAAY,EAAGA,YAAc;IAC7BpB,QAAQ,EAAGA;EAAU,CACrB,CACiB,CAClB,CAAC,EACD2B,KAAK,CAACa,MAAM,GAAG,CAAC,IAAIrB,WAAW,EAC/BW,oBAAoB,IACrBxB,aAAA,CAACnD,iBAAiB;IACjB0F,OAAO,EAAGtB,6BAA+B;IACzCH,YAAY,EAAGA,YAAc;IAC7BE,cAAc,EAAGA;EAAgB,CACjC,CAEa,CAAC;AAEnB;AAEA,OAAO,SAASwB,cAAcA,CAAEC,KAAK,EAAG;EACvC;EACA;EACA,OACCzC,aAAA,CAAC/D,iBAAiB;IAACiE,KAAK,EAAG;EAAO,GACjCF,aAAA,CAACY,KAAK;IAAA,GAAM6B;EAAK,CAAI,CACH,CAAC;AAEtB","ignoreList":[]}
@@ -175,7 +175,6 @@ export default function BlockList({
175
175
  };
176
176
  const {
177
177
  blockToolbar,
178
- headerToolbar,
179
178
  floatingToolbar
180
179
  } = styles;
181
180
  const containerStyle = {
@@ -189,7 +188,7 @@ export default function BlockList({
189
188
  const {
190
189
  isWider
191
190
  } = alignmentHelpers;
192
- const extraScrollHeight = headerToolbar.height + blockToolbar.height + (isFloatingToolbarVisible ? floatingToolbar.height : 0);
191
+ const extraScrollHeight = blockToolbar.height + (isFloatingToolbarVisible ? floatingToolbar.height : 0);
193
192
  return createElement(View, {
194
193
  style: containerStyle,
195
194
  onAccessibilityEscape: clearSelectedBlock,
@@ -205,17 +204,10 @@ export default function BlockList({
205
204
  }, ({
206
205
  onScroll
207
206
  }) => createElement(KeyboardAwareFlatList, {
208
- ...(Platform.OS === 'android' ? {
209
- removeClippedSubviews: false
210
- } : {}),
211
- // Disable clipping on Android to fix focus losing. See https://github.com/wordpress-mobile/gutenberg-mobile/pull/741#issuecomment-472746541
212
207
  accessibilityLabel: "block-list",
213
208
  ref: scrollRef,
214
209
  extraScrollHeight: extraScrollHeight,
215
210
  keyboardShouldPersistTaps: "always",
216
- scrollViewStyle: {
217
- flex: 1
218
- },
219
211
  extraData: getExtraData(),
220
212
  scrollEnabled: isRootList,
221
213
  contentContainerStyle: [horizontal && styles.horizontalContentContainer, isWider(blockWidth, 'medium') && (isContentStretch && isMultiBlocks ? styles.horizontalContentContainerStretch : styles.horizontalContentContainerCenter)],
@@ -1 +1 @@
1
- {"version":3,"names":["View","Platform","Pressable","useRef","useState","useCallback","useSelect","useDispatch","createBlock","KeyboardAwareFlatList","WIDE_ALIGNMENTS","alignmentHelpers","__","styles","BlockListAppender","BlockListItem","BlockListItemCell","BlockListProvider","DEFAULT_BLOCK_LIST_CONTEXT","BlockDraggableWrapper","useEditorWrapperStyles","store","blockEditorStore","identity","x","stylesMemo","getStyles","isStackedHorizontally","horizontalAlignment","styleName","computedStyles","horizontal","overflowVisible","BlockList","blockWidth","initialBlockWidth","contentResizeMode","contentStyle","filterInnerBlocks","gridProperties","header","marginHorizontal","defaultBlock","marginLeft","marginVertical","marginTop","onAddBlock","onDeleteBlock","orientation","parentWidth","renderAppender","renderFooterAppender","rootClientId","withFooter","blockClientIds","blockCount","blockInsertionPointIsVisible","isReadOnly","isRootList","isFloatingToolbarVisible","maxWidth","isRTL","select","getBlockCount","getBlockHierarchyRootClientId","getBlockOrder","getSelectedBlockClientId","isBlockInsertionPointVisible","getSettings","selectedBlockClientId","rootBlockId","blockOrder","isRTLSetting","maxWidthSetting","readOnly","OS","undefined","insertBlock","clearSelectedBlock","extraData","setBlockWidth","addBlockToEndOfPost","newBlock","scrollRef","shouldFlatListPreventAutomaticScroll","shouldShowInnerBlockAppender","length","getExtraData","current","onLayout","nativeEvent","layout","layoutWidth","Math","floor","width","min","renderItem","item","clientId","index","isGridItem","gridItemProps","numOfColumns","numColumns","tileCount","tileIndex","indexOf","createElement","blockToolbar","headerToolbar","floatingToolbar","containerStyle","flex","isContentStretch","isMultiBlocks","isWider","extraScrollHeight","height","style","onAccessibilityEscape","testID","value","onScroll","removeClippedSubviews","accessibilityLabel","ref","keyboardShouldPersistTaps","scrollViewStyle","scrollEnabled","contentContainerStyle","horizontalContentContainer","horizontalContentContainerStretch","horizontalContentContainerCenter","data","keyExtractor","CellRendererComponent","shouldPreventAutomaticScroll","ListHeaderComponent","ListEmptyComponent","EmptyList","ListFooterComponent","Footer","Fragment","map","currentClientId","key","innerAppender","showSeparator","onAddParagraphBlock","paragraphBlock","onPress","blockListFooter","shouldShowInsertionPoint","getBlockInsertionPoint","insertionPoint","align","alignments","full","wrapperStyles","containerStyles","defaultAppender"],"sources":["@wordpress/block-editor/src/components/block-list/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { View, Platform, Pressable } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { useRef, useState, useCallback } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { createBlock } from '@wordpress/blocks';\nimport {\n\tKeyboardAwareFlatList,\n\tWIDE_ALIGNMENTS,\n\talignmentHelpers,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\nimport BlockListAppender from '../block-list-appender';\nimport BlockListItem from './block-list-item';\nimport BlockListItemCell from './block-list-item-cell';\nimport {\n\tBlockListProvider,\n\tDEFAULT_BLOCK_LIST_CONTEXT,\n} from './block-list-context';\nimport { BlockDraggableWrapper } from '../block-draggable';\nimport { useEditorWrapperStyles } from '../../hooks/use-editor-wrapper-styles';\nimport { store as blockEditorStore } from '../../store';\n\nconst identity = ( x ) => x;\n\nconst stylesMemo = {};\nconst getStyles = ( isStackedHorizontally, horizontalAlignment ) => {\n\tconst styleName = `${ isStackedHorizontally }-${ horizontalAlignment }`;\n\tif ( stylesMemo[ styleName ] ) {\n\t\treturn stylesMemo[ styleName ];\n\t}\n\tconst computedStyles = [\n\t\tisStackedHorizontally && styles.horizontal,\n\t\thorizontalAlignment && styles[ `is-aligned-${ horizontalAlignment }` ],\n\t\tstyles.overflowVisible,\n\t];\n\tstylesMemo[ styleName ] = computedStyles;\n\treturn computedStyles;\n};\n\nexport default function BlockList( {\n\tblockWidth: initialBlockWidth,\n\tcontentResizeMode,\n\tcontentStyle,\n\tfilterInnerBlocks,\n\tgridProperties,\n\theader,\n\thorizontal,\n\thorizontalAlignment,\n\tmarginHorizontal = styles.defaultBlock.marginLeft,\n\tmarginVertical = styles.defaultBlock.marginTop,\n\tonAddBlock,\n\tonDeleteBlock,\n\torientation,\n\tparentWidth,\n\trenderAppender,\n\trenderFooterAppender,\n\trootClientId,\n\twithFooter = true,\n} ) {\n\tconst {\n\t\tblockClientIds,\n\t\tblockCount,\n\t\tblockInsertionPointIsVisible,\n\t\tisReadOnly,\n\t\tisRootList,\n\t\tisFloatingToolbarVisible,\n\t\tisStackedHorizontally,\n\t\tmaxWidth,\n\t\tisRTL,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockCount,\n\t\t\t\tgetBlockHierarchyRootClientId,\n\t\t\t\tgetBlockOrder,\n\t\t\t\tgetSelectedBlockClientId,\n\t\t\t\tisBlockInsertionPointVisible,\n\t\t\t\tgetSettings,\n\t\t\t} = select( blockEditorStore );\n\n\t\t\tconst selectedBlockClientId = getSelectedBlockClientId();\n\t\t\tconst rootBlockId = getBlockHierarchyRootClientId(\n\t\t\t\tselectedBlockClientId\n\t\t\t);\n\n\t\t\tlet blockOrder = getBlockOrder( rootClientId );\n\t\t\t// Display only block which fulfill the condition in passed `filterInnerBlocks` function.\n\t\t\tif ( filterInnerBlocks ) {\n\t\t\t\tblockOrder = filterInnerBlocks( blockOrder );\n\t\t\t}\n\n\t\t\tconst {\n\t\t\t\tisRTL: isRTLSetting,\n\t\t\t\tmaxWidth: maxWidthSetting,\n\t\t\t\treadOnly,\n\t\t\t} = getSettings();\n\n\t\t\treturn {\n\t\t\t\tblockClientIds: blockOrder,\n\t\t\t\tblockCount: getBlockCount(),\n\t\t\t\tblockInsertionPointIsVisible:\n\t\t\t\t\tPlatform.OS === 'ios' && isBlockInsertionPointVisible(),\n\t\t\t\tisReadOnly: readOnly,\n\t\t\t\tisRootList: rootClientId === undefined,\n\t\t\t\tisFloatingToolbarVisible:\n\t\t\t\t\t!! selectedBlockClientId && !! getBlockCount( rootBlockId ),\n\t\t\t\tisStackedHorizontally: orientation === 'horizontal',\n\t\t\t\tmaxWidth: maxWidthSetting,\n\t\t\t\tisRTL: isRTLSetting,\n\t\t\t};\n\t\t},\n\t\t[ filterInnerBlocks, orientation, rootClientId ]\n\t);\n\n\tconst { insertBlock, clearSelectedBlock } = useDispatch( blockEditorStore );\n\n\tconst extraData = useRef( {\n\t\tparentWidth,\n\t\trenderFooterAppender,\n\t\trenderAppender,\n\t\tonDeleteBlock,\n\t\tcontentStyle,\n\t} );\n\n\tconst [ blockWidth, setBlockWidth ] = useState( initialBlockWidth || 0 );\n\n\tconst addBlockToEndOfPost = ( newBlock ) => {\n\t\tinsertBlock( newBlock, blockCount );\n\t};\n\n\tconst scrollRef = useRef( null );\n\n\tconst shouldFlatListPreventAutomaticScroll = () =>\n\t\tblockInsertionPointIsVisible;\n\n\tconst shouldShowInnerBlockAppender = () =>\n\t\trenderAppender && blockClientIds.length > 0;\n\n\tconst getExtraData = () => {\n\t\tif (\n\t\t\textraData.current.parentWidth !== parentWidth ||\n\t\t\textraData.current.renderFooterAppender !== renderFooterAppender ||\n\t\t\textraData.current.onDeleteBlock !== onDeleteBlock ||\n\t\t\textraData.current.contentStyle !== contentStyle ||\n\t\t\textraData.current.renderAppender !== renderAppender ||\n\t\t\textraData.current.blockWidth !== blockWidth ||\n\t\t\textraData.current.gridProperties !== gridProperties\n\t\t) {\n\t\t\textraData.current = {\n\t\t\t\tparentWidth,\n\t\t\t\trenderFooterAppender,\n\t\t\t\tonDeleteBlock,\n\t\t\t\tcontentStyle,\n\t\t\t\trenderAppender,\n\t\t\t\tblockWidth,\n\t\t\t\tgridProperties,\n\t\t\t};\n\t\t}\n\t\treturn extraData.current;\n\t};\n\n\tconst onLayout = ( { nativeEvent } ) => {\n\t\tconst { layout } = nativeEvent;\n\n\t\tconst layoutWidth = Math.floor( layout.width );\n\t\tif ( isRootList && blockWidth !== layoutWidth ) {\n\t\t\tsetBlockWidth( Math.min( layoutWidth, maxWidth ) );\n\t\t} else if ( ! isRootList && ! blockWidth ) {\n\t\t\tsetBlockWidth( Math.min( layoutWidth, maxWidth ) );\n\t\t}\n\t};\n\n\tconst renderItem = ( { item: clientId, index } ) => {\n\t\t// Extracting the grid item properties here to avoid\n\t\t// re-renders in the blockListItem component.\n\t\tconst isGridItem = !! gridProperties;\n\t\tconst gridItemProps = gridProperties && {\n\t\t\tnumOfColumns: gridProperties.numColumns,\n\t\t\ttileCount: blockClientIds.length,\n\t\t\ttileIndex: blockClientIds.indexOf( clientId ),\n\t\t};\n\t\treturn (\n\t\t\t<BlockListItem\n\t\t\t\tindex={ index }\n\t\t\t\tisStackedHorizontally={ isStackedHorizontally }\n\t\t\t\trootClientId={ rootClientId }\n\t\t\t\tclientId={ clientId }\n\t\t\t\tparentWidth={ parentWidth }\n\t\t\t\tcontentResizeMode={ contentResizeMode }\n\t\t\t\tcontentStyle={ contentStyle }\n\t\t\t\tonAddBlock={ onAddBlock }\n\t\t\t\tmarginVertical={ marginVertical }\n\t\t\t\tmarginHorizontal={ marginHorizontal }\n\t\t\t\tonDeleteBlock={ onDeleteBlock }\n\t\t\t\tshouldShowInnerBlockAppender={ shouldShowInnerBlockAppender }\n\t\t\t\tblockWidth={ blockWidth }\n\t\t\t\tisGridItem={ isGridItem }\n\t\t\t\t{ ...gridItemProps }\n\t\t\t/>\n\t\t);\n\t};\n\n\tconst { blockToolbar, headerToolbar, floatingToolbar } = styles;\n\n\tconst containerStyle = {\n\t\tflex: isRootList ? 1 : 0,\n\t\t// We set negative margin in the parent to remove the edge spacing between parent block and child block in ineer blocks.\n\t\tmarginVertical: isRootList ? 0 : -marginVertical,\n\t\tmarginHorizontal: isRootList ? 0 : -marginHorizontal,\n\t};\n\n\tconst isContentStretch = contentResizeMode === 'stretch';\n\tconst isMultiBlocks = blockClientIds.length > 1;\n\tconst { isWider } = alignmentHelpers;\n\tconst extraScrollHeight =\n\t\theaderToolbar.height +\n\t\tblockToolbar.height +\n\t\t( isFloatingToolbarVisible ? floatingToolbar.height : 0 );\n\n\treturn (\n\t\t<View\n\t\t\tstyle={ containerStyle }\n\t\t\tonAccessibilityEscape={ clearSelectedBlock }\n\t\t\tonLayout={ onLayout }\n\t\t\ttestID=\"block-list-wrapper\"\n\t\t>\n\t\t\t{ isRootList ? (\n\t\t\t\t<BlockListProvider\n\t\t\t\t\tvalue={ {\n\t\t\t\t\t\t...DEFAULT_BLOCK_LIST_CONTEXT,\n\t\t\t\t\t\tscrollRef: scrollRef.current,\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t<BlockDraggableWrapper isRTL={ isRTL }>\n\t\t\t\t\t\t{ ( { onScroll } ) => (\n\t\t\t\t\t\t\t<KeyboardAwareFlatList\n\t\t\t\t\t\t\t\t{ ...( Platform.OS === 'android'\n\t\t\t\t\t\t\t\t\t? { removeClippedSubviews: false }\n\t\t\t\t\t\t\t\t\t: {} ) } // Disable clipping on Android to fix focus losing. See https://github.com/wordpress-mobile/gutenberg-mobile/pull/741#issuecomment-472746541\n\t\t\t\t\t\t\t\taccessibilityLabel=\"block-list\"\n\t\t\t\t\t\t\t\tref={ scrollRef }\n\t\t\t\t\t\t\t\textraScrollHeight={ extraScrollHeight }\n\t\t\t\t\t\t\t\tkeyboardShouldPersistTaps=\"always\"\n\t\t\t\t\t\t\t\tscrollViewStyle={ { flex: 1 } }\n\t\t\t\t\t\t\t\textraData={ getExtraData() }\n\t\t\t\t\t\t\t\tscrollEnabled={ isRootList }\n\t\t\t\t\t\t\t\tcontentContainerStyle={ [\n\t\t\t\t\t\t\t\t\thorizontal &&\n\t\t\t\t\t\t\t\t\t\tstyles.horizontalContentContainer,\n\t\t\t\t\t\t\t\t\tisWider( blockWidth, 'medium' ) &&\n\t\t\t\t\t\t\t\t\t\t( isContentStretch && isMultiBlocks\n\t\t\t\t\t\t\t\t\t\t\t? styles.horizontalContentContainerStretch\n\t\t\t\t\t\t\t\t\t\t\t: styles.horizontalContentContainerCenter ),\n\t\t\t\t\t\t\t\t] }\n\t\t\t\t\t\t\t\tdata={ blockClientIds }\n\t\t\t\t\t\t\t\tkeyExtractor={ identity }\n\t\t\t\t\t\t\t\trenderItem={ renderItem }\n\t\t\t\t\t\t\t\tCellRendererComponent={ BlockListItemCell }\n\t\t\t\t\t\t\t\tshouldPreventAutomaticScroll={\n\t\t\t\t\t\t\t\t\tshouldFlatListPreventAutomaticScroll\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tListHeaderComponent={ header }\n\t\t\t\t\t\t\t\tListEmptyComponent={\n\t\t\t\t\t\t\t\t\t! isReadOnly && (\n\t\t\t\t\t\t\t\t\t\t<EmptyList\n\t\t\t\t\t\t\t\t\t\t\torientation={ orientation }\n\t\t\t\t\t\t\t\t\t\t\trootClientId={ rootClientId }\n\t\t\t\t\t\t\t\t\t\t\trenderAppender={ renderAppender }\n\t\t\t\t\t\t\t\t\t\t\trenderFooterAppender={\n\t\t\t\t\t\t\t\t\t\t\t\trenderFooterAppender\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tListFooterComponent={\n\t\t\t\t\t\t\t\t\t<Footer\n\t\t\t\t\t\t\t\t\t\taddBlockToEndOfPost={\n\t\t\t\t\t\t\t\t\t\t\taddBlockToEndOfPost\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tisReadOnly={ isReadOnly }\n\t\t\t\t\t\t\t\t\t\trenderFooterAppender={\n\t\t\t\t\t\t\t\t\t\t\trenderFooterAppender\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\twithFooter={ withFooter }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tonScroll={ onScroll }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</BlockDraggableWrapper>\n\t\t\t\t</BlockListProvider>\n\t\t\t) : (\n\t\t\t\t<>\n\t\t\t\t\t{ blockClientIds.length > 0 ? (\n\t\t\t\t\t\t<View style={ [ { flex: 0 }, styles.overflowVisible ] }>\n\t\t\t\t\t\t\t<View\n\t\t\t\t\t\t\t\tstyle={ [\n\t\t\t\t\t\t\t\t\t...getStyles(\n\t\t\t\t\t\t\t\t\t\tisStackedHorizontally,\n\t\t\t\t\t\t\t\t\t\thorizontalAlignment\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\thorizontal &&\n\t\t\t\t\t\t\t\t\t\tstyles.horizontalContentContainer,\n\t\t\t\t\t\t\t\t] }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ blockClientIds.map(\n\t\t\t\t\t\t\t\t\t( currentClientId, index ) => {\n\t\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t\t<View key={ currentClientId }>\n\t\t\t\t\t\t\t\t\t\t\t\t{ renderItem( {\n\t\t\t\t\t\t\t\t\t\t\t\t\titem: currentClientId,\n\t\t\t\t\t\t\t\t\t\t\t\t\tindex,\n\t\t\t\t\t\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t\t\t\t\t\t</View>\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t<Footer\n\t\t\t\t\t\t\t\t\taddBlockToEndOfPost={ addBlockToEndOfPost }\n\t\t\t\t\t\t\t\t\tisReadOnly={ isReadOnly }\n\t\t\t\t\t\t\t\t\trenderFooterAppender={\n\t\t\t\t\t\t\t\t\t\trenderFooterAppender\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\twithFooter={ withFooter }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</View>\n\t\t\t\t\t\t</View>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<EmptyList\n\t\t\t\t\t\t\torientation={ orientation }\n\t\t\t\t\t\t\trootClientId={ rootClientId }\n\t\t\t\t\t\t\trenderAppender={ renderAppender }\n\t\t\t\t\t\t\trenderFooterAppender={ renderFooterAppender }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</>\n\t\t\t) }\n\t\t\t{ shouldShowInnerBlockAppender() && (\n\t\t\t\t<View\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\tmarginHorizontal:\n\t\t\t\t\t\t\tmarginHorizontal - styles.innerAppender.marginLeft,\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t<BlockListAppender\n\t\t\t\t\t\trootClientId={ rootClientId }\n\t\t\t\t\t\trenderAppender={ renderAppender }\n\t\t\t\t\t\tshowSeparator\n\t\t\t\t\t/>\n\t\t\t\t</View>\n\t\t\t) }\n\t\t</View>\n\t);\n}\n\nfunction Footer( {\n\taddBlockToEndOfPost,\n\tisReadOnly,\n\trenderFooterAppender,\n\twithFooter,\n} ) {\n\tconst onAddParagraphBlock = useCallback( () => {\n\t\tconst paragraphBlock = createBlock( 'core/paragraph' );\n\t\taddBlockToEndOfPost( paragraphBlock );\n\t}, [ addBlockToEndOfPost ] );\n\n\tif ( ! isReadOnly && withFooter ) {\n\t\treturn (\n\t\t\t<Pressable\n\t\t\t\taccessibilityLabel={ __( 'Add paragraph block' ) }\n\t\t\t\ttestID={ __( 'Add paragraph block' ) }\n\t\t\t\tonPress={ onAddParagraphBlock }\n\t\t\t>\n\t\t\t\t<View style={ styles.blockListFooter } />\n\t\t\t</Pressable>\n\t\t);\n\t} else if ( renderFooterAppender ) {\n\t\treturn <View>{ renderFooterAppender() }</View>;\n\t}\n\n\treturn null;\n}\n\nfunction EmptyList( {\n\torientation,\n\trenderAppender,\n\trenderFooterAppender,\n\trootClientId,\n} ) {\n\tconst { shouldShowInsertionPoint } = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetBlockOrder,\n\t\t\tgetBlockInsertionPoint,\n\t\t\tisBlockInsertionPointVisible,\n\t\t} = select( blockEditorStore );\n\n\t\tconst isStackedHorizontally = orientation === 'horizontal';\n\t\tconst blockClientIds = getBlockOrder( rootClientId );\n\t\tconst insertionPoint = getBlockInsertionPoint();\n\t\tconst blockInsertionPointIsVisible = isBlockInsertionPointVisible();\n\n\t\treturn {\n\t\t\tshouldShowInsertionPoint:\n\t\t\t\t! isStackedHorizontally &&\n\t\t\t\tblockInsertionPointIsVisible &&\n\t\t\t\tinsertionPoint.rootClientId === rootClientId &&\n\t\t\t\t// If list is empty, show the insertion point (via the default appender)\n\t\t\t\t( blockClientIds.length === 0 ||\n\t\t\t\t\t// Or if the insertion point is right before the denoted block.\n\t\t\t\t\t! blockClientIds[ insertionPoint.index ] ),\n\t\t};\n\t} );\n\tconst align = renderAppender ? WIDE_ALIGNMENTS.alignments.full : undefined;\n\tconst [ wrapperStyles ] = useEditorWrapperStyles( { align } );\n\n\tif ( renderFooterAppender || renderAppender === false ) {\n\t\treturn null;\n\t}\n\n\tconst containerStyles = [ styles.defaultAppender, wrapperStyles ];\n\n\treturn (\n\t\t<View style={ containerStyles }>\n\t\t\t<BlockListAppender\n\t\t\t\trootClientId={ rootClientId }\n\t\t\t\trenderAppender={ renderAppender }\n\t\t\t\tshowSeparator={ shouldShowInsertionPoint }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A4B,IAC5BmG,cAAc,CAACvG,YAAY,KAAKA,YAAY;MAC5C;MACEE,cAAc,CAACgC,MAAM,KAAK,CAAC;MAC5B;MACA,CAAEhC,cAAc,CAAEqG,cAAc,CAACvD,KAAK,CAAE;IAC3C,CAAC;EACF,CAAE,CAAC;EACH,MAAMwD,KAAK,GAAG1G,cAAc,GAAGxC,eAAe,CAACmJ,UAAU,CAACC,IAAI,GAAGlF,SAAS;EAC1E,MAAM,CAAEmF,aAAa,CAAE,GAAG3I,sBAAsB,CAAE;IAAEwI;EAAM,CAAE,CAAC;EAE7D,IAAKzG,oBAAoB,IAAID,cAAc,KAAK,KAAK,EAAG;IACvD,OAAO,IAAI;EACZ;EAEA,MAAM8G,eAAe,GAAG,CAAEnJ,MAAM,CAACoJ,eAAe,EAAEF,aAAa,CAAE;EAEjE,OACCnD,aAAA,CAAC5G,IAAI;IAACuH,KAAK,EAAGyC;EAAiB,GAC9BpD,aAAA,CAAC9F,iBAAiB;IACjBsC,YAAY,EAAGA,YAAc;IAC7BF,cAAc,EAAGA,cAAgB;IACjCkG,aAAa,EAAGK;EAA0B,CAC1C,CACI,CAAC;AAET","ignoreList":[]}
1
+ {"version":3,"names":["View","Platform","Pressable","useRef","useState","useCallback","useSelect","useDispatch","createBlock","KeyboardAwareFlatList","WIDE_ALIGNMENTS","alignmentHelpers","__","styles","BlockListAppender","BlockListItem","BlockListItemCell","BlockListProvider","DEFAULT_BLOCK_LIST_CONTEXT","BlockDraggableWrapper","useEditorWrapperStyles","store","blockEditorStore","identity","x","stylesMemo","getStyles","isStackedHorizontally","horizontalAlignment","styleName","computedStyles","horizontal","overflowVisible","BlockList","blockWidth","initialBlockWidth","contentResizeMode","contentStyle","filterInnerBlocks","gridProperties","header","marginHorizontal","defaultBlock","marginLeft","marginVertical","marginTop","onAddBlock","onDeleteBlock","orientation","parentWidth","renderAppender","renderFooterAppender","rootClientId","withFooter","blockClientIds","blockCount","blockInsertionPointIsVisible","isReadOnly","isRootList","isFloatingToolbarVisible","maxWidth","isRTL","select","getBlockCount","getBlockHierarchyRootClientId","getBlockOrder","getSelectedBlockClientId","isBlockInsertionPointVisible","getSettings","selectedBlockClientId","rootBlockId","blockOrder","isRTLSetting","maxWidthSetting","readOnly","OS","undefined","insertBlock","clearSelectedBlock","extraData","setBlockWidth","addBlockToEndOfPost","newBlock","scrollRef","shouldFlatListPreventAutomaticScroll","shouldShowInnerBlockAppender","length","getExtraData","current","onLayout","nativeEvent","layout","layoutWidth","Math","floor","width","min","renderItem","item","clientId","index","isGridItem","gridItemProps","numOfColumns","numColumns","tileCount","tileIndex","indexOf","createElement","blockToolbar","floatingToolbar","containerStyle","flex","isContentStretch","isMultiBlocks","isWider","extraScrollHeight","height","style","onAccessibilityEscape","testID","value","onScroll","accessibilityLabel","ref","keyboardShouldPersistTaps","scrollEnabled","contentContainerStyle","horizontalContentContainer","horizontalContentContainerStretch","horizontalContentContainerCenter","data","keyExtractor","CellRendererComponent","shouldPreventAutomaticScroll","ListHeaderComponent","ListEmptyComponent","EmptyList","ListFooterComponent","Footer","Fragment","map","currentClientId","key","innerAppender","showSeparator","onAddParagraphBlock","paragraphBlock","onPress","blockListFooter","shouldShowInsertionPoint","getBlockInsertionPoint","insertionPoint","align","alignments","full","wrapperStyles","containerStyles","defaultAppender"],"sources":["@wordpress/block-editor/src/components/block-list/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { View, Platform, Pressable } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { useRef, useState, useCallback } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { createBlock } from '@wordpress/blocks';\nimport {\n\tKeyboardAwareFlatList,\n\tWIDE_ALIGNMENTS,\n\talignmentHelpers,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\nimport BlockListAppender from '../block-list-appender';\nimport BlockListItem from './block-list-item';\nimport BlockListItemCell from './block-list-item-cell';\nimport {\n\tBlockListProvider,\n\tDEFAULT_BLOCK_LIST_CONTEXT,\n} from './block-list-context';\nimport { BlockDraggableWrapper } from '../block-draggable';\nimport { useEditorWrapperStyles } from '../../hooks/use-editor-wrapper-styles';\nimport { store as blockEditorStore } from '../../store';\n\nconst identity = ( x ) => x;\n\nconst stylesMemo = {};\nconst getStyles = ( isStackedHorizontally, horizontalAlignment ) => {\n\tconst styleName = `${ isStackedHorizontally }-${ horizontalAlignment }`;\n\tif ( stylesMemo[ styleName ] ) {\n\t\treturn stylesMemo[ styleName ];\n\t}\n\tconst computedStyles = [\n\t\tisStackedHorizontally && styles.horizontal,\n\t\thorizontalAlignment && styles[ `is-aligned-${ horizontalAlignment }` ],\n\t\tstyles.overflowVisible,\n\t];\n\tstylesMemo[ styleName ] = computedStyles;\n\treturn computedStyles;\n};\n\nexport default function BlockList( {\n\tblockWidth: initialBlockWidth,\n\tcontentResizeMode,\n\tcontentStyle,\n\tfilterInnerBlocks,\n\tgridProperties,\n\theader,\n\thorizontal,\n\thorizontalAlignment,\n\tmarginHorizontal = styles.defaultBlock.marginLeft,\n\tmarginVertical = styles.defaultBlock.marginTop,\n\tonAddBlock,\n\tonDeleteBlock,\n\torientation,\n\tparentWidth,\n\trenderAppender,\n\trenderFooterAppender,\n\trootClientId,\n\twithFooter = true,\n} ) {\n\tconst {\n\t\tblockClientIds,\n\t\tblockCount,\n\t\tblockInsertionPointIsVisible,\n\t\tisReadOnly,\n\t\tisRootList,\n\t\tisFloatingToolbarVisible,\n\t\tisStackedHorizontally,\n\t\tmaxWidth,\n\t\tisRTL,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockCount,\n\t\t\t\tgetBlockHierarchyRootClientId,\n\t\t\t\tgetBlockOrder,\n\t\t\t\tgetSelectedBlockClientId,\n\t\t\t\tisBlockInsertionPointVisible,\n\t\t\t\tgetSettings,\n\t\t\t} = select( blockEditorStore );\n\n\t\t\tconst selectedBlockClientId = getSelectedBlockClientId();\n\t\t\tconst rootBlockId = getBlockHierarchyRootClientId(\n\t\t\t\tselectedBlockClientId\n\t\t\t);\n\n\t\t\tlet blockOrder = getBlockOrder( rootClientId );\n\t\t\t// Display only block which fulfill the condition in passed `filterInnerBlocks` function.\n\t\t\tif ( filterInnerBlocks ) {\n\t\t\t\tblockOrder = filterInnerBlocks( blockOrder );\n\t\t\t}\n\n\t\t\tconst {\n\t\t\t\tisRTL: isRTLSetting,\n\t\t\t\tmaxWidth: maxWidthSetting,\n\t\t\t\treadOnly,\n\t\t\t} = getSettings();\n\n\t\t\treturn {\n\t\t\t\tblockClientIds: blockOrder,\n\t\t\t\tblockCount: getBlockCount(),\n\t\t\t\tblockInsertionPointIsVisible:\n\t\t\t\t\tPlatform.OS === 'ios' && isBlockInsertionPointVisible(),\n\t\t\t\tisReadOnly: readOnly,\n\t\t\t\tisRootList: rootClientId === undefined,\n\t\t\t\tisFloatingToolbarVisible:\n\t\t\t\t\t!! selectedBlockClientId && !! getBlockCount( rootBlockId ),\n\t\t\t\tisStackedHorizontally: orientation === 'horizontal',\n\t\t\t\tmaxWidth: maxWidthSetting,\n\t\t\t\tisRTL: isRTLSetting,\n\t\t\t};\n\t\t},\n\t\t[ filterInnerBlocks, orientation, rootClientId ]\n\t);\n\n\tconst { insertBlock, clearSelectedBlock } = useDispatch( blockEditorStore );\n\n\tconst extraData = useRef( {\n\t\tparentWidth,\n\t\trenderFooterAppender,\n\t\trenderAppender,\n\t\tonDeleteBlock,\n\t\tcontentStyle,\n\t} );\n\n\tconst [ blockWidth, setBlockWidth ] = useState( initialBlockWidth || 0 );\n\n\tconst addBlockToEndOfPost = ( newBlock ) => {\n\t\tinsertBlock( newBlock, blockCount );\n\t};\n\n\tconst scrollRef = useRef( null );\n\n\tconst shouldFlatListPreventAutomaticScroll = () =>\n\t\tblockInsertionPointIsVisible;\n\n\tconst shouldShowInnerBlockAppender = () =>\n\t\trenderAppender && blockClientIds.length > 0;\n\n\tconst getExtraData = () => {\n\t\tif (\n\t\t\textraData.current.parentWidth !== parentWidth ||\n\t\t\textraData.current.renderFooterAppender !== renderFooterAppender ||\n\t\t\textraData.current.onDeleteBlock !== onDeleteBlock ||\n\t\t\textraData.current.contentStyle !== contentStyle ||\n\t\t\textraData.current.renderAppender !== renderAppender ||\n\t\t\textraData.current.blockWidth !== blockWidth ||\n\t\t\textraData.current.gridProperties !== gridProperties\n\t\t) {\n\t\t\textraData.current = {\n\t\t\t\tparentWidth,\n\t\t\t\trenderFooterAppender,\n\t\t\t\tonDeleteBlock,\n\t\t\t\tcontentStyle,\n\t\t\t\trenderAppender,\n\t\t\t\tblockWidth,\n\t\t\t\tgridProperties,\n\t\t\t};\n\t\t}\n\t\treturn extraData.current;\n\t};\n\n\tconst onLayout = ( { nativeEvent } ) => {\n\t\tconst { layout } = nativeEvent;\n\n\t\tconst layoutWidth = Math.floor( layout.width );\n\t\tif ( isRootList && blockWidth !== layoutWidth ) {\n\t\t\tsetBlockWidth( Math.min( layoutWidth, maxWidth ) );\n\t\t} else if ( ! isRootList && ! blockWidth ) {\n\t\t\tsetBlockWidth( Math.min( layoutWidth, maxWidth ) );\n\t\t}\n\t};\n\n\tconst renderItem = ( { item: clientId, index } ) => {\n\t\t// Extracting the grid item properties here to avoid\n\t\t// re-renders in the blockListItem component.\n\t\tconst isGridItem = !! gridProperties;\n\t\tconst gridItemProps = gridProperties && {\n\t\t\tnumOfColumns: gridProperties.numColumns,\n\t\t\ttileCount: blockClientIds.length,\n\t\t\ttileIndex: blockClientIds.indexOf( clientId ),\n\t\t};\n\t\treturn (\n\t\t\t<BlockListItem\n\t\t\t\tindex={ index }\n\t\t\t\tisStackedHorizontally={ isStackedHorizontally }\n\t\t\t\trootClientId={ rootClientId }\n\t\t\t\tclientId={ clientId }\n\t\t\t\tparentWidth={ parentWidth }\n\t\t\t\tcontentResizeMode={ contentResizeMode }\n\t\t\t\tcontentStyle={ contentStyle }\n\t\t\t\tonAddBlock={ onAddBlock }\n\t\t\t\tmarginVertical={ marginVertical }\n\t\t\t\tmarginHorizontal={ marginHorizontal }\n\t\t\t\tonDeleteBlock={ onDeleteBlock }\n\t\t\t\tshouldShowInnerBlockAppender={ shouldShowInnerBlockAppender }\n\t\t\t\tblockWidth={ blockWidth }\n\t\t\t\tisGridItem={ isGridItem }\n\t\t\t\t{ ...gridItemProps }\n\t\t\t/>\n\t\t);\n\t};\n\n\tconst { blockToolbar, floatingToolbar } = styles;\n\n\tconst containerStyle = {\n\t\tflex: isRootList ? 1 : 0,\n\t\t// We set negative margin in the parent to remove the edge spacing between parent block and child block in ineer blocks.\n\t\tmarginVertical: isRootList ? 0 : -marginVertical,\n\t\tmarginHorizontal: isRootList ? 0 : -marginHorizontal,\n\t};\n\n\tconst isContentStretch = contentResizeMode === 'stretch';\n\tconst isMultiBlocks = blockClientIds.length > 1;\n\tconst { isWider } = alignmentHelpers;\n\tconst extraScrollHeight =\n\t\tblockToolbar.height +\n\t\t( isFloatingToolbarVisible ? floatingToolbar.height : 0 );\n\n\treturn (\n\t\t<View\n\t\t\tstyle={ containerStyle }\n\t\t\tonAccessibilityEscape={ clearSelectedBlock }\n\t\t\tonLayout={ onLayout }\n\t\t\ttestID=\"block-list-wrapper\"\n\t\t>\n\t\t\t{ isRootList ? (\n\t\t\t\t<BlockListProvider\n\t\t\t\t\tvalue={ {\n\t\t\t\t\t\t...DEFAULT_BLOCK_LIST_CONTEXT,\n\t\t\t\t\t\tscrollRef: scrollRef.current,\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t<BlockDraggableWrapper isRTL={ isRTL }>\n\t\t\t\t\t\t{ ( { onScroll } ) => (\n\t\t\t\t\t\t\t<KeyboardAwareFlatList\n\t\t\t\t\t\t\t\taccessibilityLabel=\"block-list\"\n\t\t\t\t\t\t\t\tref={ scrollRef }\n\t\t\t\t\t\t\t\textraScrollHeight={ extraScrollHeight }\n\t\t\t\t\t\t\t\tkeyboardShouldPersistTaps=\"always\"\n\t\t\t\t\t\t\t\textraData={ getExtraData() }\n\t\t\t\t\t\t\t\tscrollEnabled={ isRootList }\n\t\t\t\t\t\t\t\tcontentContainerStyle={ [\n\t\t\t\t\t\t\t\t\thorizontal &&\n\t\t\t\t\t\t\t\t\t\tstyles.horizontalContentContainer,\n\t\t\t\t\t\t\t\t\tisWider( blockWidth, 'medium' ) &&\n\t\t\t\t\t\t\t\t\t\t( isContentStretch && isMultiBlocks\n\t\t\t\t\t\t\t\t\t\t\t? styles.horizontalContentContainerStretch\n\t\t\t\t\t\t\t\t\t\t\t: styles.horizontalContentContainerCenter ),\n\t\t\t\t\t\t\t\t] }\n\t\t\t\t\t\t\t\tdata={ blockClientIds }\n\t\t\t\t\t\t\t\tkeyExtractor={ identity }\n\t\t\t\t\t\t\t\trenderItem={ renderItem }\n\t\t\t\t\t\t\t\tCellRendererComponent={ BlockListItemCell }\n\t\t\t\t\t\t\t\tshouldPreventAutomaticScroll={\n\t\t\t\t\t\t\t\t\tshouldFlatListPreventAutomaticScroll\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tListHeaderComponent={ header }\n\t\t\t\t\t\t\t\tListEmptyComponent={\n\t\t\t\t\t\t\t\t\t! isReadOnly && (\n\t\t\t\t\t\t\t\t\t\t<EmptyList\n\t\t\t\t\t\t\t\t\t\t\torientation={ orientation }\n\t\t\t\t\t\t\t\t\t\t\trootClientId={ rootClientId }\n\t\t\t\t\t\t\t\t\t\t\trenderAppender={ renderAppender }\n\t\t\t\t\t\t\t\t\t\t\trenderFooterAppender={\n\t\t\t\t\t\t\t\t\t\t\t\trenderFooterAppender\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tListFooterComponent={\n\t\t\t\t\t\t\t\t\t<Footer\n\t\t\t\t\t\t\t\t\t\taddBlockToEndOfPost={\n\t\t\t\t\t\t\t\t\t\t\taddBlockToEndOfPost\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tisReadOnly={ isReadOnly }\n\t\t\t\t\t\t\t\t\t\trenderFooterAppender={\n\t\t\t\t\t\t\t\t\t\t\trenderFooterAppender\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\twithFooter={ withFooter }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tonScroll={ onScroll }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</BlockDraggableWrapper>\n\t\t\t\t</BlockListProvider>\n\t\t\t) : (\n\t\t\t\t<>\n\t\t\t\t\t{ blockClientIds.length > 0 ? (\n\t\t\t\t\t\t<View style={ [ { flex: 0 }, styles.overflowVisible ] }>\n\t\t\t\t\t\t\t<View\n\t\t\t\t\t\t\t\tstyle={ [\n\t\t\t\t\t\t\t\t\t...getStyles(\n\t\t\t\t\t\t\t\t\t\tisStackedHorizontally,\n\t\t\t\t\t\t\t\t\t\thorizontalAlignment\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\thorizontal &&\n\t\t\t\t\t\t\t\t\t\tstyles.horizontalContentContainer,\n\t\t\t\t\t\t\t\t] }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ blockClientIds.map(\n\t\t\t\t\t\t\t\t\t( currentClientId, index ) => {\n\t\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t\t<View key={ currentClientId }>\n\t\t\t\t\t\t\t\t\t\t\t\t{ renderItem( {\n\t\t\t\t\t\t\t\t\t\t\t\t\titem: currentClientId,\n\t\t\t\t\t\t\t\t\t\t\t\t\tindex,\n\t\t\t\t\t\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t\t\t\t\t\t</View>\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t<Footer\n\t\t\t\t\t\t\t\t\taddBlockToEndOfPost={ addBlockToEndOfPost }\n\t\t\t\t\t\t\t\t\tisReadOnly={ isReadOnly }\n\t\t\t\t\t\t\t\t\trenderFooterAppender={\n\t\t\t\t\t\t\t\t\t\trenderFooterAppender\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\twithFooter={ withFooter }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</View>\n\t\t\t\t\t\t</View>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<EmptyList\n\t\t\t\t\t\t\torientation={ orientation }\n\t\t\t\t\t\t\trootClientId={ rootClientId }\n\t\t\t\t\t\t\trenderAppender={ renderAppender }\n\t\t\t\t\t\t\trenderFooterAppender={ renderFooterAppender }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</>\n\t\t\t) }\n\t\t\t{ shouldShowInnerBlockAppender() && (\n\t\t\t\t<View\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\tmarginHorizontal:\n\t\t\t\t\t\t\tmarginHorizontal - styles.innerAppender.marginLeft,\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t<BlockListAppender\n\t\t\t\t\t\trootClientId={ rootClientId }\n\t\t\t\t\t\trenderAppender={ renderAppender }\n\t\t\t\t\t\tshowSeparator\n\t\t\t\t\t/>\n\t\t\t\t</View>\n\t\t\t) }\n\t\t</View>\n\t);\n}\n\nfunction Footer( {\n\taddBlockToEndOfPost,\n\tisReadOnly,\n\trenderFooterAppender,\n\twithFooter,\n} ) {\n\tconst onAddParagraphBlock = useCallback( () => {\n\t\tconst paragraphBlock = createBlock( 'core/paragraph' );\n\t\taddBlockToEndOfPost( paragraphBlock );\n\t}, [ addBlockToEndOfPost ] );\n\n\tif ( ! isReadOnly && withFooter ) {\n\t\treturn (\n\t\t\t<Pressable\n\t\t\t\taccessibilityLabel={ __( 'Add paragraph block' ) }\n\t\t\t\ttestID={ __( 'Add paragraph block' ) }\n\t\t\t\tonPress={ onAddParagraphBlock }\n\t\t\t>\n\t\t\t\t<View style={ styles.blockListFooter } />\n\t\t\t</Pressable>\n\t\t);\n\t} else if ( renderFooterAppender ) {\n\t\treturn <View>{ renderFooterAppender() }</View>;\n\t}\n\n\treturn null;\n}\n\nfunction EmptyList( {\n\torientation,\n\trenderAppender,\n\trenderFooterAppender,\n\trootClientId,\n} ) {\n\tconst { shouldShowInsertionPoint } = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetBlockOrder,\n\t\t\tgetBlockInsertionPoint,\n\t\t\tisBlockInsertionPointVisible,\n\t\t} = select( blockEditorStore );\n\n\t\tconst isStackedHorizontally = orientation === 'horizontal';\n\t\tconst blockClientIds = getBlockOrder( rootClientId );\n\t\tconst insertionPoint = getBlockInsertionPoint();\n\t\tconst blockInsertionPointIsVisible = isBlockInsertionPointVisible();\n\n\t\treturn {\n\t\t\tshouldShowInsertionPoint:\n\t\t\t\t! isStackedHorizontally &&\n\t\t\t\tblockInsertionPointIsVisible &&\n\t\t\t\tinsertionPoint.rootClientId === rootClientId &&\n\t\t\t\t// If list is empty, show the insertion point (via the default appender)\n\t\t\t\t( blockClientIds.length === 0 ||\n\t\t\t\t\t// Or if the insertion point is right before the denoted block.\n\t\t\t\t\t! blockClientIds[ insertionPoint.index ] ),\n\t\t};\n\t} );\n\tconst align = renderAppender ? WIDE_ALIGNMENTS.alignments.full : undefined;\n\tconst [ wrapperStyles ] = useEditorWrapperStyles( { align } );\n\n\tif ( renderFooterAppender || renderAppender === false ) {\n\t\treturn null;\n\t}\n\n\tconst containerStyles = [ styles.defaultAppender, wrapperStyles ];\n\n\treturn (\n\t\t<View style={ containerStyles }>\n\t\t\t<BlockListAppender\n\t\t\t\trootClientId={ rootClientId }\n\t\t\t\trenderAppender={ renderAppender }\n\t\t\t\tshowSeparator={ shouldShowInsertionPoint }\n\t\t\t/>\n\t\t</View>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;A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GAAG/E,SAAS;EAC1E,MAAM,CAAEgF,aAAa,CAAE,GAAGxI,sBAAsB,CAAE;IAAEqI;EAAM,CAAE,CAAC;EAE7D,IAAKtG,oBAAoB,IAAID,cAAc,KAAK,KAAK,EAAG;IACvD,OAAO,IAAI;EACZ;EAEA,MAAM2G,eAAe,GAAG,CAAEhJ,MAAM,CAACiJ,eAAe,EAAEF,aAAa,CAAE;EAEjE,OACChD,aAAA,CAAC5G,IAAI;IAACsH,KAAK,EAAGuC;EAAiB,GAC9BjD,aAAA,CAAC9F,iBAAiB;IACjBsC,YAAY,EAAGA,YAAc;IAC7BF,cAAc,EAAGA,cAAgB;IACjC+F,aAAa,EAAGK;EAA0B,CAC1C,CACI,CAAC;AAET","ignoreList":[]}
@@ -85,7 +85,6 @@ export function useBlockProps(props = {}, {
85
85
  blockTitle,
86
86
  isSelected,
87
87
  isSubtreeDisabled,
88
- isOutlineEnabled,
89
88
  hasOverlay,
90
89
  initialPosition,
91
90
  blockEditingMode,
@@ -95,7 +94,6 @@ export function useBlockProps(props = {}, {
95
94
  isReusable,
96
95
  isDragging,
97
96
  hasChildSelected,
98
- removeOutline,
99
97
  isBlockMovingMode,
100
98
  canInsertMovingBlock,
101
99
  isEditingDisabled,
@@ -114,9 +112,7 @@ export function useBlockProps(props = {}, {
114
112
  }), useBlockRefProvider(clientId), useFocusHandler(clientId), useEventHandlers({
115
113
  clientId,
116
114
  isSelected
117
- }), useNavModeExit(clientId), useIsHovered({
118
- isEnabled: isOutlineEnabled
119
- }), useIntersectionObserver(), useMovingAnimation({
115
+ }), useNavModeExit(clientId), useIsHovered(), useIntersectionObserver(), useMovingAnimation({
120
116
  triggerAnimationOnChange: index,
121
117
  clientId
122
118
  }), useDisabled({
@@ -136,6 +132,10 @@ export function useBlockProps(props = {}, {
136
132
  if (blockApiVersion < 2 && clientId === blockEditContext.clientId) {
137
133
  typeof SCRIPT_DEBUG !== "undefined" && SCRIPT_DEBUG === true ? warning(`Block type "${name}" must support API version 2 or higher to work correctly with "useBlockProps" method.`) : void 0;
138
134
  }
135
+ let hasNegativeMargin = false;
136
+ if (wrapperProps?.style?.marginTop?.charAt(0) === '-' || wrapperProps?.style?.marginBottom?.charAt(0) === '-' || wrapperProps?.style?.marginLeft?.charAt(0) === '-' || wrapperProps?.style?.marginRight?.charAt(0) === '-') {
137
+ hasNegativeMargin = true;
138
+ }
139
139
  return {
140
140
  tabIndex: blockEditingMode === 'disabled' ? -1 : 0,
141
141
  ...wrapperProps,
@@ -159,11 +159,11 @@ export function useBlockProps(props = {}, {
159
159
  'is-reusable': isReusable,
160
160
  'is-dragging': isDragging,
161
161
  'has-child-selected': hasChildSelected,
162
- 'remove-outline': removeOutline,
163
162
  'is-block-moving-mode': isBlockMovingMode,
164
163
  'can-insert-moving-block': canInsertMovingBlock,
165
164
  'is-editing-disabled': isEditingDisabled,
166
165
  'has-editable-outline': hasEditableOutline,
166
+ 'has-negative-margin': hasNegativeMargin,
167
167
  'is-content-locked-temporarily-editing-as-blocks': isTemporarilyEditingAsBlocks
168
168
  }, className, props.className, wrapperProps.className, defaultClassName),
169
169
  style: {
@@ -1 +1 @@
1
- {"version":3,"names":["classnames","useContext","__","sprintf","__unstableGetBlockProps","getBlockProps","useMergeRefs","useDisabled","warning","useMovingAnimation","PrivateBlockContext","useFocusFirstElement","useIsHovered","blockBindingsKey","useBlockEditContext","useFocusHandler","useEventHandlers","useNavModeExit","useBlockRefProvider","useIntersectionObserver","useFlashEditableBlocks","canBindBlock","useBlockProps","props","__unstableIsHtml","clientId","className","wrapperProps","isAligned","index","mode","name","blockApiVersion","blockTitle","isSelected","isSubtreeDisabled","isOutlineEnabled","hasOverlay","initialPosition","blockEditingMode","isHighlighted","isMultiSelected","isPartiallySelected","isReusable","isDragging","hasChildSelected","removeOutline","isBlockMovingMode","canInsertMovingBlock","isEditingDisabled","hasEditableOutline","isTemporarilyEditingAsBlocks","defaultClassName","templateLock","blockLabel","htmlSuffix","mergedRefs","ref","isEnabled","triggerAnimationOnChange","isDisabled","blockEditContext","hasBlockBindings","bindingsStyle","SCRIPT_DEBUG","tabIndex","id","role","inert","undefined","style","save"],"sources":["@wordpress/block-editor/src/components/block-list/use-block-props/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\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 { useNavModeExit } from './use-nav-mode-exit';\nimport { useBlockRefProvider } from './use-block-refs';\nimport { useIntersectionObserver } from './use-intersection-observer';\nimport { useFlashEditableBlocks } from '../../use-flash-editable-blocks';\nimport { canBindBlock } from '../../../hooks/use-bindings-attributes';\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\tisOutlineEnabled,\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\tremoveOutline,\n\t\tisBlockMovingMode,\n\t\tcanInsertMovingBlock,\n\t\tisEditingDisabled,\n\t\thasEditableOutline,\n\t\tisTemporarilyEditingAsBlocks,\n\t\tdefaultClassName,\n\t\ttemplateLock,\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 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\tuseNavModeExit( clientId ),\n\t\tuseIsHovered( { isEnabled: isOutlineEnabled } ),\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: name === 'core/block' || templateLock === 'contentOnly',\n\t\t} ),\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\treturn {\n\t\ttabIndex: blockEditingMode === 'disabled' ? -1 : 0,\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: classnames(\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'remove-outline': removeOutline,\n\t\t\t\t'is-block-moving-mode': isBlockMovingMode,\n\t\t\t\t'can-insert-moving-block': canInsertMovingBlock,\n\t\t\t\t'is-editing-disabled': isEditingDisabled,\n\t\t\t\t'has-editable-outline': hasEditableOutline,\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":"AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,UAAU,QAAQ,oBAAoB;AAC/C,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,uBAAuB,IAAIC,aAAa,QAAQ,mBAAmB;AAC5E,SAASC,YAAY,EAAEC,WAAW,QAAQ,oBAAoB;AAC9D,OAAOC,OAAO,MAAM,oBAAoB;;AAExC;AACA;AACA;AACA,OAAOC,kBAAkB,MAAM,4BAA4B;AAC3D,SAASC,mBAAmB,QAAQ,0BAA0B;AAC9D,SAASC,oBAAoB,QAAQ,2BAA2B;AAChE,SAASC,YAAY,QAAQ,kBAAkB;AAC/C,SACCC,gBAAgB,EAChBC,mBAAmB,QACb,0BAA0B;AACjC,SAASC,eAAe,QAAQ,qBAAqB;AACrD,SAASC,gBAAgB,QAAQ,qCAAqC;AACtE,SAASC,cAAc,QAAQ,qBAAqB;AACpD,SAASC,mBAAmB,QAAQ,kBAAkB;AACtD,SAASC,uBAAuB,QAAQ,6BAA6B;AACrE,SAASC,sBAAsB,QAAQ,iCAAiC;AACxE,SAASC,YAAY,QAAQ,wCAAwC;;AAErE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,aAAaA,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C5C,aAAa,EAAEC,UAAU;MACzB,aAAa,EAAEC,UAAU;MACzB,oBAAoB,EAAEC,gBAAgB;MACtC,gBAAgB,EAAEC,aAAa;MAC/B,sBAAsB,EAAEC,iBAAiB;MACzC,yBAAyB,EAAEC,oBAAoB;MAC/C,qBAAqB,EAAEC,iBAAiB;MACxC,sBAAsB,EAAEC,kBAAkB;MAC1C,iDAAiD,EAChDC;IACF,CAAC,EACDzB,SAAS,EACTH,KAAK,CAACG,SAAS,EACfC,YAAY,CAACD,SAAS,EACtB0B,gBACD,CAAC;IACDkB,KAAK,EAAE;MAAE,GAAG3C,YAAY,CAAC2C,KAAK;MAAE,GAAG/C,KAAK,CAAC+C,KAAK;MAAE,GAAGP;IAAc;EAClE,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACAzC,aAAa,CAACiD,IAAI,GAAGlE,aAAa","ignoreList":[]}
1
+ {"version":3,"names":["classnames","useContext","__","sprintf","__unstableGetBlockProps","getBlockProps","useMergeRefs","useDisabled","warning","useMovingAnimation","PrivateBlockContext","useFocusFirstElement","useIsHovered","blockBindingsKey","useBlockEditContext","useFocusHandler","useEventHandlers","useNavModeExit","useBlockRefProvider","useIntersectionObserver","useFlashEditableBlocks","canBindBlock","useBlockProps","props","__unstableIsHtml","clientId","className","wrapperProps","isAligned","index","mode","name","blockApiVersion","blockTitle","isSelected","isSubtreeDisabled","hasOverlay","initialPosition","blockEditingMode","isHighlighted","isMultiSelected","isPartiallySelected","isReusable","isDragging","hasChildSelected","isBlockMovingMode","canInsertMovingBlock","isEditingDisabled","hasEditableOutline","isTemporarilyEditingAsBlocks","defaultClassName","templateLock","blockLabel","htmlSuffix","mergedRefs","ref","triggerAnimationOnChange","isDisabled","isEnabled","blockEditContext","hasBlockBindings","bindingsStyle","SCRIPT_DEBUG","hasNegativeMargin","style","marginTop","charAt","marginBottom","marginLeft","marginRight","tabIndex","id","role","inert","undefined","save"],"sources":["@wordpress/block-editor/src/components/block-list/use-block-props/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\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 { useNavModeExit } from './use-nav-mode-exit';\nimport { useBlockRefProvider } from './use-block-refs';\nimport { useIntersectionObserver } from './use-intersection-observer';\nimport { useFlashEditableBlocks } from '../../use-flash-editable-blocks';\nimport { canBindBlock } from '../../../hooks/use-bindings-attributes';\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\tisBlockMovingMode,\n\t\tcanInsertMovingBlock,\n\t\tisEditingDisabled,\n\t\thasEditableOutline,\n\t\tisTemporarilyEditingAsBlocks,\n\t\tdefaultClassName,\n\t\ttemplateLock,\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 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\tuseNavModeExit( clientId ),\n\t\tuseIsHovered(),\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: name === 'core/block' || templateLock === 'contentOnly',\n\t\t} ),\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\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: classnames(\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-block-moving-mode': isBlockMovingMode,\n\t\t\t\t'can-insert-moving-block': canInsertMovingBlock,\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":"AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,UAAU,QAAQ,oBAAoB;AAC/C,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,uBAAuB,IAAIC,aAAa,QAAQ,mBAAmB;AAC5E,SAASC,YAAY,EAAEC,WAAW,QAAQ,oBAAoB;AAC9D,OAAOC,OAAO,MAAM,oBAAoB;;AAExC;AACA;AACA;AACA,OAAOC,kBAAkB,MAAM,4BAA4B;AAC3D,SAASC,mBAAmB,QAAQ,0BAA0B;AAC9D,SAASC,oBAAoB,QAAQ,2BAA2B;AAChE,SAASC,YAAY,QAAQ,kBAAkB;AAC/C,SACCC,gBAAgB,EAChBC,mBAAmB,QACb,0BAA0B;AACjC,SAASC,eAAe,QAAQ,qBAAqB;AACrD,SAASC,gBAAgB,QAAQ,qCAAqC;AACtE,SAASC,cAAc,QAAQ,qBAAqB;AACpD,SAASC,mBAAmB,QAAQ,kBAAkB;AACtD,SAASC,uBAAuB,QAAQ,6BAA6B;AACrE,SAASC,sBAAsB,QAAQ,iCAAiC;AACxE,SAASC,YAAY,QAAQ,wCAAwC;;AAErE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA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IACxCmB,IAAI,EAAE,UAAU;IAChB,YAAY,EAAEpB,UAAU;IACxB,YAAY,EAAE3B,QAAQ;IACtB,WAAW,EAAEM,IAAI;IACjB,YAAY,EAAEE,UAAU;IACxBwC,KAAK,EAAEtC,iBAAiB,GAAG,MAAM,GAAGuC,SAAS;IAC7ChD,SAAS,EAAE1B,UAAU,CACpB,gCAAgC,EAChC;MACC;MACA,UAAU,EAAE,CAAE4B,SAAS;MACvB,mBAAmB,EAAEQ,UAAU;MAC/B,aAAa,EAAEF,UAAU;MACzB,gBAAgB,EAAEK,aAAa;MAC/B,mBAAmB,EAAEC,eAAe;MACpC,uBAAuB,EAAEC,mBAAmB;MAC5C,aAAa,EAAEC,UAAU;MACzB,aAAa,EAAEC,UAAU;MACzB,oBAAoB,EAAEC,gBAAgB;MACtC,sBAAsB,EAAEC,iBAAiB;MACzC,yBAAyB,EAAEC,oBAAoB;MAC/C,qBAAqB,EAAEC,iBAAiB;MACxC,sBAAsB,EAAEC,kBAAkB;MAC1C,qBAAqB,EAAEe,iBAAiB;MACxC,iDAAiD,EAChDd;IACF,CAAC,EACDvB,SAAS,EACTH,KAAK,CAACG,SAAS,EACfC,YAAY,CAACD,SAAS,EACtBwB,gBACD,CAAC;IACDc,KAAK,EAAE;MAAE,GAAGrC,YAAY,CAACqC,KAAK;MAAE,GAAGzC,KAAK,CAACyC,KAAK;MAAE,GAAGH;IAAc;EAClE,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACAvC,aAAa,CAACqD,IAAI,GAAGtE,aAAa","ignoreList":[]}
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * WordPress dependencies
3
3
  */
4
- import { useContext, useLayoutEffect, useMemo, useRef, useState } from '@wordpress/element';
5
- import { useRefEffect } from '@wordpress/compose';
4
+ import { useContext, useMemo, useRef } from '@wordpress/element';
5
+ import { useRefEffect, useObservableValue } from '@wordpress/compose';
6
6
 
7
7
  /**
8
8
  * Internal dependencies
@@ -21,31 +21,19 @@ import { BlockRefs } from '../../provider/block-refs-provider';
21
21
  */
22
22
  export function useBlockRefProvider(clientId) {
23
23
  const {
24
- refs,
25
- callbacks
24
+ refsMap
26
25
  } = useContext(BlockRefs);
27
- const ref = useRef();
28
- useLayoutEffect(() => {
29
- refs.set(ref, clientId);
30
- return () => {
31
- refs.delete(ref);
32
- };
33
- }, [clientId]);
34
26
  return useRefEffect(element => {
35
- // Update the ref in the provider.
36
- ref.current = element;
37
- // Call any update functions.
38
- callbacks.forEach((id, setElement) => {
39
- if (clientId === id) {
40
- setElement(element);
41
- }
42
- });
27
+ refsMap.set(clientId, element);
28
+ return () => refsMap.delete(clientId);
43
29
  }, [clientId]);
44
30
  }
45
31
 
46
32
  /**
47
- * Gets a ref pointing to the current block element. Continues to return a
48
- * stable ref even if the block client ID changes.
33
+ * Gets a ref pointing to the current block element. Continues to return the same
34
+ * stable ref object even if the `clientId` argument changes. This hook is not
35
+ * reactive, i.e., it won't trigger a rerender of the calling component if the
36
+ * ref value changes. For reactive use cases there is the `useBlockElement` hook.
49
37
  *
50
38
  * @param {string} clientId The client ID to get a ref for.
51
39
  *
@@ -53,26 +41,19 @@ export function useBlockRefProvider(clientId) {
53
41
  */
54
42
  function useBlockRef(clientId) {
55
43
  const {
56
- refs
44
+ refsMap
57
45
  } = useContext(BlockRefs);
58
- const freshClientId = useRef();
59
- freshClientId.current = clientId;
46
+ const latestClientId = useRef();
47
+ latestClientId.current = clientId;
48
+
60
49
  // Always return an object, even if no ref exists for a given client ID, so
61
50
  // that `current` works at a later point.
62
51
  return useMemo(() => ({
63
52
  get current() {
64
- let element = null;
65
-
66
- // Multiple refs may be created for a single block. Find the
67
- // first that has an element set.
68
- for (const [ref, id] of refs.entries()) {
69
- if (id === freshClientId.current && ref.current) {
70
- element = ref.current;
71
- }
72
- }
73
- return element;
53
+ var _refsMap$get;
54
+ return (_refsMap$get = refsMap.get(latestClientId.current)) !== null && _refsMap$get !== void 0 ? _refsMap$get : null;
74
55
  }
75
- }), []);
56
+ }), [refsMap]);
76
57
  }
77
58
 
78
59
  /**
@@ -84,21 +65,11 @@ function useBlockRef(clientId) {
84
65
  * @return {Element|null} The block's wrapper element.
85
66
  */
86
67
  function useBlockElement(clientId) {
68
+ var _useObservableValue;
87
69
  const {
88
- callbacks
70
+ refsMap
89
71
  } = useContext(BlockRefs);
90
- const ref = useBlockRef(clientId);
91
- const [element, setElement] = useState(null);
92
- useLayoutEffect(() => {
93
- if (!clientId) {
94
- return;
95
- }
96
- callbacks.set(setElement, clientId);
97
- return () => {
98
- callbacks.delete(setElement);
99
- };
100
- }, [clientId]);
101
- return ref.current || element;
72
+ return (_useObservableValue = useObservableValue(refsMap, clientId)) !== null && _useObservableValue !== void 0 ? _useObservableValue : null;
102
73
  }
103
74
  export { useBlockRef as __unstableUseBlockRef };
104
75
  export { useBlockElement as __unstableUseBlockElement };
@@ -1 +1 @@
1
- {"version":3,"names":["useContext","useLayoutEffect","useMemo","useRef","useState","useRefEffect","BlockRefs","useBlockRefProvider","clientId","refs","callbacks","ref","set","delete","element","current","forEach","id","setElement","useBlockRef","freshClientId","entries","useBlockElement","__unstableUseBlockRef","__unstableUseBlockElement"],"sources":["@wordpress/block-editor/src/components/block-list/use-block-props/use-block-refs.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tuseContext,\n\tuseLayoutEffect,\n\tuseMemo,\n\tuseRef,\n\tuseState,\n} from '@wordpress/element';\nimport { useRefEffect } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { BlockRefs } from '../../provider/block-refs-provider';\n\n/** @typedef {import('@wordpress/element').RefCallback} RefCallback */\n/** @typedef {import('@wordpress/element').RefObject} RefObject */\n\n/**\n * Provides a ref to the BlockRefs context.\n *\n * @param {string} clientId The client ID of the element ref.\n *\n * @return {RefCallback} Ref callback.\n */\nexport function useBlockRefProvider( clientId ) {\n\tconst { refs, callbacks } = useContext( BlockRefs );\n\tconst ref = useRef();\n\tuseLayoutEffect( () => {\n\t\trefs.set( ref, clientId );\n\t\treturn () => {\n\t\t\trefs.delete( ref );\n\t\t};\n\t}, [ clientId ] );\n\treturn useRefEffect(\n\t\t( element ) => {\n\t\t\t// Update the ref in the provider.\n\t\t\tref.current = element;\n\t\t\t// Call any update functions.\n\t\t\tcallbacks.forEach( ( id, setElement ) => {\n\t\t\t\tif ( clientId === id ) {\n\t\t\t\t\tsetElement( element );\n\t\t\t\t}\n\t\t\t} );\n\t\t},\n\t\t[ clientId ]\n\t);\n}\n\n/**\n * Gets a ref pointing to the current block element. Continues to return a\n * stable ref even if the block client ID changes.\n *\n * @param {string} clientId The client ID to get a ref for.\n *\n * @return {RefObject} A ref containing the element.\n */\nfunction useBlockRef( clientId ) {\n\tconst { refs } = useContext( BlockRefs );\n\tconst freshClientId = useRef();\n\tfreshClientId.current = clientId;\n\t// Always return an object, even if no ref exists for a given client ID, so\n\t// that `current` works at a later point.\n\treturn useMemo(\n\t\t() => ( {\n\t\t\tget current() {\n\t\t\t\tlet element = null;\n\n\t\t\t\t// Multiple refs may be created for a single block. Find the\n\t\t\t\t// first that has an element set.\n\t\t\t\tfor ( const [ ref, id ] of refs.entries() ) {\n\t\t\t\t\tif ( id === freshClientId.current && ref.current ) {\n\t\t\t\t\t\telement = ref.current;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn element;\n\t\t\t},\n\t\t} ),\n\t\t[]\n\t);\n}\n\n/**\n * Return the element for a given client ID. Updates whenever the element\n * changes, becomes available, or disappears.\n *\n * @param {string} clientId The client ID to an element for.\n *\n * @return {Element|null} The block's wrapper element.\n */\nfunction useBlockElement( clientId ) {\n\tconst { callbacks } = useContext( BlockRefs );\n\tconst ref = useBlockRef( clientId );\n\tconst [ element, setElement ] = useState( null );\n\n\tuseLayoutEffect( () => {\n\t\tif ( ! clientId ) {\n\t\t\treturn;\n\t\t}\n\n\t\tcallbacks.set( setElement, clientId );\n\t\treturn () => {\n\t\t\tcallbacks.delete( setElement );\n\t\t};\n\t}, [ clientId ] );\n\n\treturn ref.current || element;\n}\n\nexport { useBlockRef as __unstableUseBlockRef };\nexport { useBlockElement as __unstableUseBlockElement };\n"],"mappings":"AAAA;AACA;AACA;AACA,SACCA,UAAU,EACVC,eAAe,EACfC,OAAO,EACPC,MAAM,EACNC,QAAQ,QACF,oBAAoB;AAC3B,SAASC,YAAY,QAAQ,oBAAoB;;AAEjD;AACA;AACA;AACA,SAASC,SAAS,QAAQ,oCAAoC;;AAE9D;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,mBAAmBA,CAAEC,QAAQ,EAAG;EAC/C,MAAM;IAAEC,IAAI;IAAEC;EAAU,CAAC,GAAGV,UAAU,CAAEM,SAAU,CAAC;EACnD,MAAMK,GAAG,GAAGR,MAAM,CAAC,CAAC;EACpBF,eAAe,CAAE,MAAM;IACtBQ,IAAI,CAACG,GAAG,CAAED,GAAG,EAAEH,QAAS,CAAC;IACzB,OAAO,MAAM;MACZC,IAAI,CAACI,MAAM,CAAEF,GAAI,CAAC;IACnB,CAAC;EACF,CAAC,EAAE,CAAEH,QAAQ,CAAG,CAAC;EACjB,OAAOH,YAAY,CAChBS,OAAO,IAAM;IACd;IACAH,GAAG,CAACI,OAAO,GAAGD,OAAO;IACrB;IACAJ,SAAS,CAACM,OAAO,CAAE,CAAEC,EAAE,EAAEC,UAAU,KAAM;MACxC,IAAKV,QAAQ,KAAKS,EAAE,EAAG;QACtBC,UAAU,CAAEJ,OAAQ,CAAC;MACtB;IACD,CAAE,CAAC;EACJ,CAAC,EACD,CAAEN,QAAQ,CACX,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASW,WAAWA,CAAEX,QAAQ,EAAG;EAChC,MAAM;IAAEC;EAAK,CAAC,GAAGT,UAAU,CAAEM,SAAU,CAAC;EACxC,MAAMc,aAAa,GAAGjB,MAAM,CAAC,CAAC;EAC9BiB,aAAa,CAACL,OAAO,GAAGP,QAAQ;EAChC;EACA;EACA,OAAON,OAAO,CACb,OAAQ;IACP,IAAIa,OAAOA,CAAA,EAAG;MACb,IAAID,OAAO,GAAG,IAAI;;MAElB;MACA;MACA,KAAM,MAAM,CAAEH,GAAG,EAAEM,EAAE,CAAE,IAAIR,IAAI,CAACY,OAAO,CAAC,CAAC,EAAG;QAC3C,IAAKJ,EAAE,KAAKG,aAAa,CAACL,OAAO,IAAIJ,GAAG,CAACI,OAAO,EAAG;UAClDD,OAAO,GAAGH,GAAG,CAACI,OAAO;QACtB;MACD;MAEA,OAAOD,OAAO;IACf;EACD,CAAC,CAAE,EACH,EACD,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASQ,eAAeA,CAAEd,QAAQ,EAAG;EACpC,MAAM;IAAEE;EAAU,CAAC,GAAGV,UAAU,CAAEM,SAAU,CAAC;EAC7C,MAAMK,GAAG,GAAGQ,WAAW,CAAEX,QAAS,CAAC;EACnC,MAAM,CAAEM,OAAO,EAAEI,UAAU,CAAE,GAAGd,QAAQ,CAAE,IAAK,CAAC;EAEhDH,eAAe,CAAE,MAAM;IACtB,IAAK,CAAEO,QAAQ,EAAG;MACjB;IACD;IAEAE,SAAS,CAACE,GAAG,CAAEM,UAAU,EAAEV,QAAS,CAAC;IACrC,OAAO,MAAM;MACZE,SAAS,CAACG,MAAM,CAAEK,UAAW,CAAC;IAC/B,CAAC;EACF,CAAC,EAAE,CAAEV,QAAQ,CAAG,CAAC;EAEjB,OAAOG,GAAG,CAACI,OAAO,IAAID,OAAO;AAC9B;AAEA,SAASK,WAAW,IAAII,qBAAqB;AAC7C,SAASD,eAAe,IAAIE,yBAAyB","ignoreList":[]}
1
+ {"version":3,"names":["useContext","useMemo","useRef","useRefEffect","useObservableValue","BlockRefs","useBlockRefProvider","clientId","refsMap","element","set","delete","useBlockRef","latestClientId","current","_refsMap$get","get","useBlockElement","_useObservableValue","__unstableUseBlockRef","__unstableUseBlockElement"],"sources":["@wordpress/block-editor/src/components/block-list/use-block-props/use-block-refs.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useContext, useMemo, useRef } from '@wordpress/element';\nimport { useRefEffect, useObservableValue } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { BlockRefs } from '../../provider/block-refs-provider';\n\n/** @typedef {import('@wordpress/element').RefCallback} RefCallback */\n/** @typedef {import('@wordpress/element').RefObject} RefObject */\n\n/**\n * Provides a ref to the BlockRefs context.\n *\n * @param {string} clientId The client ID of the element ref.\n *\n * @return {RefCallback} Ref callback.\n */\nexport function useBlockRefProvider( clientId ) {\n\tconst { refsMap } = useContext( BlockRefs );\n\treturn useRefEffect(\n\t\t( element ) => {\n\t\t\trefsMap.set( clientId, element );\n\t\t\treturn () => refsMap.delete( clientId );\n\t\t},\n\t\t[ clientId ]\n\t);\n}\n\n/**\n * Gets a ref pointing to the current block element. Continues to return the same\n * stable ref object even if the `clientId` argument changes. This hook is not\n * reactive, i.e., it won't trigger a rerender of the calling component if the\n * ref value changes. For reactive use cases there is the `useBlockElement` hook.\n *\n * @param {string} clientId The client ID to get a ref for.\n *\n * @return {RefObject} A ref containing the element.\n */\nfunction useBlockRef( clientId ) {\n\tconst { refsMap } = useContext( BlockRefs );\n\tconst latestClientId = useRef();\n\tlatestClientId.current = clientId;\n\n\t// Always return an object, even if no ref exists for a given client ID, so\n\t// that `current` works at a later point.\n\treturn useMemo(\n\t\t() => ( {\n\t\t\tget current() {\n\t\t\t\treturn refsMap.get( latestClientId.current ) ?? null;\n\t\t\t},\n\t\t} ),\n\t\t[ refsMap ]\n\t);\n}\n\n/**\n * Return the element for a given client ID. Updates whenever the element\n * changes, becomes available, or disappears.\n *\n * @param {string} clientId The client ID to an element for.\n *\n * @return {Element|null} The block's wrapper element.\n */\nfunction useBlockElement( clientId ) {\n\tconst { refsMap } = useContext( BlockRefs );\n\treturn useObservableValue( refsMap, clientId ) ?? null;\n}\n\nexport { useBlockRef as __unstableUseBlockRef };\nexport { useBlockElement as __unstableUseBlockEl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QAAAa,mBAAA,GAAOd,kBAAkB,CAAEI,OAAO,EAAED,QAAS,CAAC,cAAAW,mBAAA,cAAAA,mBAAA,GAAI,IAAI;AACvD;AAEA,SAASN,WAAW,IAAIO,qBAAqB;AAC7C,SAASF,eAAe,IAAIG,yBAAyB","ignoreList":[]}
@@ -15,21 +15,17 @@ function listener(event) {
15
15
  * Adds `is-hovered` class when the block is hovered and in navigation or
16
16
  * outline mode.
17
17
  */
18
- export function useIsHovered({
19
- isEnabled
20
- }) {
18
+ export function useIsHovered() {
21
19
  return useRefEffect(node => {
22
- if (isEnabled) {
23
- node.addEventListener('mouseout', listener);
24
- node.addEventListener('mouseover', listener);
25
- return () => {
26
- node.removeEventListener('mouseout', listener);
27
- node.removeEventListener('mouseover', listener);
20
+ node.addEventListener('mouseout', listener);
21
+ node.addEventListener('mouseover', listener);
22
+ return () => {
23
+ node.removeEventListener('mouseout', listener);
24
+ node.removeEventListener('mouseover', listener);
28
25
 
29
- // Remove class in case it lingers.
30
- node.classList.remove('is-hovered');
31
- };
32
- }
33
- }, [isEnabled]);
26
+ // Remove class in case it lingers.
27
+ node.classList.remove('is-hovered');
28
+ };
29
+ }, []);
34
30
  }
35
31
  //# sourceMappingURL=use-is-hovered.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["useRefEffect","listener","event","defaultPrevented","action","type","preventDefault","currentTarget","classList","useIsHovered","isEnabled","node","addEventListener","removeEventListener","remove"],"sources":["@wordpress/block-editor/src/components/block-list/use-block-props/use-is-hovered.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useRefEffect } from '@wordpress/compose';\n\nfunction listener( event ) {\n\tif ( event.defaultPrevented ) {\n\t\treturn;\n\t}\n\n\tconst action = event.type === 'mouseover' ? 'add' : 'remove';\n\n\tevent.preventDefault();\n\tevent.currentTarget.classList[ action ]( 'is-hovered' );\n}\n\n/*\n * Adds `is-hovered` class when the block is hovered and in navigation or\n * outline mode.\n */\nexport function useIsHovered( { isEnabled } ) {\n\treturn useRefEffect(\n\t\t( node ) => {\n\t\t\tif ( isEnabled ) {\n\t\t\t\tnode.addEventListener( 'mouseout', listener );\n\t\t\t\tnode.addEventListener( 'mouseover', listener );\n\n\t\t\t\treturn () => {\n\t\t\t\t\tnode.removeEventListener( 'mouseout', listener );\n\t\t\t\t\tnode.removeEventListener( 'mouseover', listener );\n\n\t\t\t\t\t// Remove class in case it lingers.\n\t\t\t\t\tnode.classList.remove( 'is-hovered' );\n\t\t\t\t};\n\t\t\t}\n\t\t},\n\t\t[ isEnabled ]\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,YAAY,QAAQ,oBAAoB;AAEjD,SAASC,QAAQA,CAAEC,KAAK,EAAG;EAC1B,IAAKA,KAAK,CAACC,gBAAgB,EAAG;IAC7B;EACD;EAEA,MAAMC,MAAM,GAAGF,KAAK,CAACG,IAAI,KAAK,WAAW,GAAG,KAAK,GAAG,QAAQ;EAE5DH,KAAK,CAACI,cAAc,CAAC,CAAC;EACtBJ,KAAK,CAACK,aAAa,CAACC,SAAS,CAAEJ,MAAM,CAAE,CAAE,YAAa,CAAC;AACxD;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASK,YAAYA,CAAE;EAAEC;AAAU,CAAC,EAAG;EAC7C,OAAOV,YAAY,CAChBW,IAAI,IAAM;IACX,IAAKD,SAAS,EAAG;MAChBC,IAAI,CAACC,gBAAgB,CAAE,UAAU,EAAEX,QAAS,CAAC;MAC7CU,IAAI,CAACC,gBAAgB,CAAE,WAAW,EAAEX,QAAS,CAAC;MAE9C,OAAO,MAAM;QACZU,IAAI,CAACE,mBAAmB,CAAE,UAAU,EAAEZ,QAAS,CAAC;QAChDU,IAAI,CAACE,mBAAmB,CAAE,WAAW,EAAEZ,QAAS,CAAC;;QAEjD;QACAU,IAAI,CAACH,SAAS,CAACM,MAAM,CAAE,YAAa,CAAC;MACtC,CAAC;IACF;EACD,CAAC,EACD,CAAEJ,SAAS,CACZ,CAAC;AACF","ignoreList":[]}
1
+ {"version":3,"names":["useRefEffect","listener","event","defaultPrevented","action","type","preventDefault","currentTarget","classList","useIsHovered","node","addEventListener","removeEventListener","remove"],"sources":["@wordpress/block-editor/src/components/block-list/use-block-props/use-is-hovered.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useRefEffect } from '@wordpress/compose';\n\nfunction listener( event ) {\n\tif ( event.defaultPrevented ) {\n\t\treturn;\n\t}\n\n\tconst action = event.type === 'mouseover' ? 'add' : 'remove';\n\n\tevent.preventDefault();\n\tevent.currentTarget.classList[ action ]( 'is-hovered' );\n}\n\n/*\n * Adds `is-hovered` class when the block is hovered and in navigation or\n * outline mode.\n */\nexport function useIsHovered() {\n\treturn useRefEffect( ( node ) => {\n\t\tnode.addEventListener( 'mouseout', listener );\n\t\tnode.addEventListener( 'mouseover', listener );\n\n\t\treturn () => {\n\t\t\tnode.removeEventListener( 'mouseout', listener );\n\t\t\tnode.removeEventListener( 'mouseover', listener );\n\n\t\t\t// Remove class in case it lingers.\n\t\t\tnode.classList.remove( 'is-hovered' );\n\t\t};\n\t}, [] );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,YAAY,QAAQ,oBAAoB;AAEjD,SAASC,QAAQA,CAAEC,KAAK,EAAG;EAC1B,IAAKA,KAAK,CAACC,gBAAgB,EAAG;IAC7B;EACD;EAEA,MAAMC,MAAM,GAAGF,KAAK,CAACG,IAAI,KAAK,WAAW,GAAG,KAAK,GAAG,QAAQ;EAE5DH,KAAK,CAACI,cAAc,CAAC,CAAC;EACtBJ,KAAK,CAACK,aAAa,CAACC,SAAS,CAAEJ,MAAM,CAAE,CAAE,YAAa,CAAC;AACxD;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASK,YAAYA,CAAA,EAAG;EAC9B,OAAOT,YAAY,CAAIU,IAAI,IAAM;IAChCA,IAAI,CAACC,gBAAgB,CAAE,UAAU,EAAEV,QAAS,CAAC;IAC7CS,IAAI,CAACC,gBAAgB,CAAE,WAAW,EAAEV,QAAS,CAAC;IAE9C,OAAO,MAAM;MACZS,IAAI,CAACE,mBAAmB,CAAE,UAAU,EAAEX,QAAS,CAAC;MAChDS,IAAI,CAACE,mBAAmB,CAAE,WAAW,EAAEX,QAAS,CAAC;;MAEjD;MACAS,IAAI,CAACF,SAAS,CAACK,MAAM,CAAE,YAAa,CAAC;IACtC,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;AACR","ignoreList":[]}
@@ -86,7 +86,9 @@ export const BlockMover = ({
86
86
  }].filter(el => el.value === blockPageMoverState);
87
87
  const onPickerSelect = value => {
88
88
  const option = blockPageMoverOptions.find(el => el.value === value);
89
- if (option && option.onSelect) option.onSelect();
89
+ if (option && option.onSelect) {
90
+ option.onSelect();
91
+ }
90
92
  };
91
93
  const onLongPressMoveUp = useCallback(showBlockPageMover(BLOCK_MOVER_DIRECTION_TOP), []);
92
94
  const onLongPressMoveDown = useCallback(showBlockPageMover(BLOCK_MOVER_DIRECTION_BOTTOM), []);