@wordpress/block-editor 12.0.0 → 12.2.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 (627) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +1 -1
  3. package/build/autocompleters/block.js +13 -5
  4. package/build/autocompleters/block.js.map +1 -1
  5. package/build/components/block-breadcrumb/index.js +6 -3
  6. package/build/components/block-breadcrumb/index.js.map +1 -1
  7. package/build/components/block-controls/slot.js +12 -4
  8. package/build/components/block-controls/slot.js.map +1 -1
  9. package/build/components/block-controls/slot.native.js +10 -1
  10. package/build/components/block-controls/slot.native.js.map +1 -1
  11. package/build/components/block-draggable/index.js +11 -7
  12. package/build/components/block-draggable/index.js.map +1 -1
  13. package/build/components/block-draggable/use-scroll-when-dragging.js +2 -2
  14. package/build/components/block-draggable/use-scroll-when-dragging.js.map +1 -1
  15. package/build/components/block-editing-mode/index.js +84 -0
  16. package/build/components/block-editing-mode/index.js.map +1 -0
  17. package/build/components/block-list/block-invalid-warning.native.js +15 -7
  18. package/build/components/block-list/block-invalid-warning.native.js.map +1 -1
  19. package/build/components/block-list/block-list-block-context.js +15 -0
  20. package/build/components/block-list/block-list-block-context.js.map +1 -0
  21. package/build/components/block-list/block-list-item-cell.native.js +15 -2
  22. package/build/components/block-list/block-list-item-cell.native.js.map +1 -1
  23. package/build/components/block-list/block-list-item.native.js +158 -195
  24. package/build/components/block-list/block-list-item.native.js.map +1 -1
  25. package/build/components/block-list/block-outline.native.js +57 -0
  26. package/build/components/block-list/block-outline.native.js.map +1 -0
  27. package/build/components/block-list/block.js +29 -37
  28. package/build/components/block-list/block.js.map +1 -1
  29. package/build/components/block-list/block.native.js +347 -311
  30. package/build/components/block-list/block.native.js.map +1 -1
  31. package/build/components/block-list/index.native.js +260 -357
  32. package/build/components/block-list/index.native.js.map +1 -1
  33. package/build/components/block-list/insertion-point.native.js +4 -2
  34. package/build/components/block-list/insertion-point.native.js.map +1 -1
  35. package/build/components/block-list/use-block-props/index.js +2 -2
  36. package/build/components/block-list/use-block-props/index.js.map +1 -1
  37. package/build/components/block-list/use-in-between-inserter.js +7 -5
  38. package/build/components/block-list/use-in-between-inserter.js.map +1 -1
  39. package/build/components/block-list-appender/index.js +15 -1
  40. package/build/components/block-list-appender/index.js.map +1 -1
  41. package/build/components/block-mobile-toolbar/block-actions-menu.native.js +19 -4
  42. package/build/components/block-mobile-toolbar/block-actions-menu.native.js.map +1 -1
  43. package/build/components/block-settings-menu/block-settings-dropdown.js +8 -10
  44. package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  45. package/build/components/block-settings-menu-controls/index.js +15 -4
  46. package/build/components/block-settings-menu-controls/index.js.map +1 -1
  47. package/build/components/block-styles/preview-panel.js +1 -2
  48. package/build/components/block-styles/preview-panel.js.map +1 -1
  49. package/build/components/block-switcher/block-transformations-menu.js +8 -0
  50. package/build/components/block-switcher/block-transformations-menu.js.map +1 -1
  51. package/build/components/block-switcher/block-variation-transformations.js +125 -0
  52. package/build/components/block-switcher/block-variation-transformations.js.map +1 -0
  53. package/build/components/block-switcher/index.js +34 -12
  54. package/build/components/block-switcher/index.js.map +1 -1
  55. package/build/components/block-switcher/pattern-transformations-menu.js +3 -3
  56. package/build/components/block-switcher/pattern-transformations-menu.js.map +1 -1
  57. package/build/components/block-toolbar/index.js +9 -7
  58. package/build/components/block-toolbar/index.js.map +1 -1
  59. package/build/components/block-tools/block-contextual-toolbar.js +22 -65
  60. package/build/components/block-tools/block-contextual-toolbar.js.map +1 -1
  61. package/build/components/block-tools/insertion-point.js +11 -5
  62. package/build/components/block-tools/insertion-point.js.map +1 -1
  63. package/build/components/block-tools/selected-block-popover.js +3 -8
  64. package/build/components/block-tools/selected-block-popover.js.map +1 -1
  65. package/build/components/colors-gradients/use-multiple-origin-colors-and-gradients.js +3 -2
  66. package/build/components/colors-gradients/use-multiple-origin-colors-and-gradients.js.map +1 -1
  67. package/build/components/convert-to-group-buttons/index.js +7 -2
  68. package/build/components/convert-to-group-buttons/index.js.map +1 -1
  69. package/build/components/convert-to-group-buttons/index.native.js +87 -3
  70. package/build/components/convert-to-group-buttons/index.native.js.map +1 -1
  71. package/build/components/convert-to-group-buttons/use-convert-to-group-button-props.js +23 -37
  72. package/build/components/convert-to-group-buttons/use-convert-to-group-button-props.js.map +1 -1
  73. package/build/components/global-styles/advanced-panel.js +86 -0
  74. package/build/components/global-styles/advanced-panel.js.map +1 -0
  75. package/build/components/global-styles/color-panel.js +4 -1
  76. package/build/components/global-styles/color-panel.js.map +1 -1
  77. package/build/components/global-styles/dimensions-panel.js +9 -8
  78. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  79. package/build/components/global-styles/hooks.js +1 -2
  80. package/build/components/global-styles/hooks.js.map +1 -1
  81. package/build/components/global-styles/index.js +24 -0
  82. package/build/components/global-styles/index.js.map +1 -1
  83. package/build/components/global-styles/typography-panel.js +1 -1
  84. package/build/components/global-styles/typography-panel.js.map +1 -1
  85. package/build/components/global-styles/use-global-styles-output.js +27 -4
  86. package/build/components/global-styles/use-global-styles-output.js.map +1 -1
  87. package/build/components/global-styles/utils.js +30 -0
  88. package/build/components/global-styles/utils.js.map +1 -1
  89. package/build/components/iframe/index.js +14 -7
  90. package/build/components/iframe/index.js.map +1 -1
  91. package/build/components/image-editor/use-save-image.js +24 -8
  92. package/build/components/image-editor/use-save-image.js.map +1 -1
  93. package/build/components/inner-blocks/index.js +2 -1
  94. package/build/components/inner-blocks/index.js.map +1 -1
  95. package/build/components/inner-blocks/index.native.js +7 -7
  96. package/build/components/inner-blocks/index.native.js.map +1 -1
  97. package/build/components/inner-blocks/use-nested-settings-update.js +13 -5
  98. package/build/components/inner-blocks/use-nested-settings-update.js.map +1 -1
  99. package/build/components/inserter/index.js +3 -7
  100. package/build/components/inserter/index.js.map +1 -1
  101. package/build/components/inserter/quick-inserter.js +2 -4
  102. package/build/components/inserter/quick-inserter.js.map +1 -1
  103. package/build/components/inserter/search-results.js +19 -6
  104. package/build/components/inserter/search-results.js.map +1 -1
  105. package/build/components/inserter-draggable-blocks/index.js +5 -0
  106. package/build/components/inserter-draggable-blocks/index.js.map +1 -1
  107. package/build/components/inspector-controls/fill.js +1 -1
  108. package/build/components/inspector-controls/fill.js.map +1 -1
  109. package/build/components/inspector-controls/fill.native.js +1 -1
  110. package/build/components/inspector-controls/fill.native.js.map +1 -1
  111. package/build/components/inspector-controls/slot.js +3 -6
  112. package/build/components/inspector-controls/slot.js.map +1 -1
  113. package/build/components/inspector-controls/slot.native.js +1 -1
  114. package/build/components/inspector-controls/slot.native.js.map +1 -1
  115. package/build/components/line-height-control/index.js +7 -2
  116. package/build/components/line-height-control/index.js.map +1 -1
  117. package/build/components/link-control/use-internal-input-value.js +9 -8
  118. package/build/components/link-control/use-internal-input-value.js.map +1 -1
  119. package/build/components/list-view/appender.js +6 -1
  120. package/build/components/list-view/appender.js.map +1 -1
  121. package/build/components/list-view/block-contents.js +9 -2
  122. package/build/components/list-view/block-contents.js.map +1 -1
  123. package/build/components/list-view/block-select-button.js +2 -1
  124. package/build/components/list-view/block-select-button.js.map +1 -1
  125. package/build/components/list-view/block.js +25 -29
  126. package/build/components/list-view/block.js.map +1 -1
  127. package/build/components/list-view/branch.js +1 -3
  128. package/build/components/list-view/branch.js.map +1 -1
  129. package/build/components/list-view/index.js +43 -22
  130. package/build/components/list-view/index.js.map +1 -1
  131. package/build/components/list-view/use-list-view-client-ids.js +27 -3
  132. package/build/components/list-view/use-list-view-client-ids.js.map +1 -1
  133. package/build/components/list-view/use-list-view-drop-zone.js +163 -11
  134. package/build/components/list-view/use-list-view-drop-zone.js.map +1 -1
  135. package/build/components/media-placeholder/index.js +68 -7
  136. package/build/components/media-placeholder/index.js.map +1 -1
  137. package/build/components/multi-selection-inspector/index.js +2 -2
  138. package/build/components/multi-selection-inspector/index.js.map +1 -1
  139. package/build/components/preview-options/index.js +6 -1
  140. package/build/components/preview-options/index.js.map +1 -1
  141. package/build/components/publish-date-time-picker/index.js +0 -2
  142. package/build/components/publish-date-time-picker/index.js.map +1 -1
  143. package/build/components/spacing-sizes-control/spacing-input-control.js +1 -1
  144. package/build/components/spacing-sizes-control/spacing-input-control.js.map +1 -1
  145. package/build/components/url-input/index.js +4 -2
  146. package/build/components/url-input/index.js.map +1 -1
  147. package/build/components/use-block-drop-zone/index.js +25 -15
  148. package/build/components/use-block-drop-zone/index.js.map +1 -1
  149. package/build/components/use-resize-canvas/index.js +8 -1
  150. package/build/components/use-resize-canvas/index.js.map +1 -1
  151. package/build/components/writing-flow/use-arrow-nav.js +13 -7
  152. package/build/components/writing-flow/use-arrow-nav.js.map +1 -1
  153. package/build/hooks/align.js +4 -8
  154. package/build/hooks/align.js.map +1 -1
  155. package/build/hooks/behaviors.js +115 -0
  156. package/build/hooks/behaviors.js.map +1 -0
  157. package/build/hooks/border.js +1 -1
  158. package/build/hooks/border.js.map +1 -1
  159. package/build/hooks/color.js +1 -1
  160. package/build/hooks/color.js.map +1 -1
  161. package/build/hooks/content-lock-ui.js +8 -12
  162. package/build/hooks/content-lock-ui.js.map +1 -1
  163. package/build/hooks/dimensions.js +0 -30
  164. package/build/hooks/dimensions.js.map +1 -1
  165. package/build/hooks/duotone.js +5 -9
  166. package/build/hooks/duotone.js.map +1 -1
  167. package/build/hooks/index.js +2 -0
  168. package/build/hooks/index.js.map +1 -1
  169. package/build/hooks/index.native.js +8 -0
  170. package/build/hooks/index.native.js.map +1 -1
  171. package/build/hooks/layout.js +10 -11
  172. package/build/hooks/layout.js.map +1 -1
  173. package/build/hooks/position.js +1 -1
  174. package/build/hooks/position.js.map +1 -1
  175. package/build/hooks/style.js +1 -1
  176. package/build/hooks/style.js.map +1 -1
  177. package/build/hooks/use-editor-wrapper-styles.native.js +255 -0
  178. package/build/hooks/use-editor-wrapper-styles.native.js.map +1 -0
  179. package/build/hooks/use-typography-props.js +14 -10
  180. package/build/hooks/use-typography-props.js.map +1 -1
  181. package/build/index.native.js +31 -0
  182. package/build/index.native.js.map +1 -0
  183. package/build/private-apis.js +4 -7
  184. package/build/private-apis.js.map +1 -1
  185. package/build/store/private-actions.js +46 -0
  186. package/build/store/private-actions.js.map +1 -1
  187. package/build/store/private-selectors.js +88 -0
  188. package/build/store/private-selectors.js.map +1 -1
  189. package/build/store/reducer.js +36 -1
  190. package/build/store/reducer.js.map +1 -1
  191. package/build/store/selectors.js +28 -18
  192. package/build/store/selectors.js.map +1 -1
  193. package/build/utils/order-inserter-block-items.js +41 -0
  194. package/build/utils/order-inserter-block-items.js.map +1 -0
  195. package/build/utils/use-should-contextual-toolbar-show.js +16 -12
  196. package/build/utils/use-should-contextual-toolbar-show.js.map +1 -1
  197. package/build-module/autocompleters/block.js +12 -5
  198. package/build-module/autocompleters/block.js.map +1 -1
  199. package/build-module/components/block-breadcrumb/index.js +5 -3
  200. package/build-module/components/block-breadcrumb/index.js.map +1 -1
  201. package/build-module/components/block-controls/slot.js +11 -4
  202. package/build-module/components/block-controls/slot.js.map +1 -1
  203. package/build-module/components/block-controls/slot.native.js +9 -1
  204. package/build-module/components/block-controls/slot.native.js.map +1 -1
  205. package/build-module/components/block-draggable/index.js +10 -6
  206. package/build-module/components/block-draggable/index.js.map +1 -1
  207. package/build-module/components/block-draggable/use-scroll-when-dragging.js +2 -2
  208. package/build-module/components/block-draggable/use-scroll-when-dragging.js.map +1 -1
  209. package/build-module/components/block-editing-mode/index.js +72 -0
  210. package/build-module/components/block-editing-mode/index.js.map +1 -0
  211. package/build-module/components/block-list/block-invalid-warning.native.js +16 -8
  212. package/build-module/components/block-list/block-invalid-warning.native.js.map +1 -1
  213. package/build-module/components/block-list/block-list-block-context.js +6 -0
  214. package/build-module/components/block-list/block-list-block-context.js.map +1 -0
  215. package/build-module/components/block-list/block-list-item-cell.native.js +13 -2
  216. package/build-module/components/block-list/block-list-item-cell.native.js.map +1 -1
  217. package/build-module/components/block-list/block-list-item.native.js +160 -190
  218. package/build-module/components/block-list/block-list-item.native.js.map +1 -1
  219. package/build-module/components/block-list/block-outline.native.js +44 -0
  220. package/build-module/components/block-list/block-outline.native.js.map +1 -0
  221. package/build-module/components/block-list/block.js +26 -34
  222. package/build-module/components/block-list/block.js.map +1 -1
  223. package/build-module/components/block-list/block.native.js +345 -310
  224. package/build-module/components/block-list/block.native.js.map +1 -1
  225. package/build-module/components/block-list/index.native.js +263 -355
  226. package/build-module/components/block-list/index.native.js.map +1 -1
  227. package/build-module/components/block-list/insertion-point.native.js +4 -2
  228. package/build-module/components/block-list/insertion-point.native.js.map +1 -1
  229. package/build-module/components/block-list/use-block-props/index.js +1 -1
  230. package/build-module/components/block-list/use-block-props/index.js.map +1 -1
  231. package/build-module/components/block-list/use-in-between-inserter.js +6 -5
  232. package/build-module/components/block-list/use-in-between-inserter.js.map +1 -1
  233. package/build-module/components/block-list-appender/index.js +15 -1
  234. package/build-module/components/block-list-appender/index.js.map +1 -1
  235. package/build-module/components/block-mobile-toolbar/block-actions-menu.native.js +18 -4
  236. package/build-module/components/block-mobile-toolbar/block-actions-menu.native.js.map +1 -1
  237. package/build-module/components/block-settings-menu/block-settings-dropdown.js +8 -9
  238. package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  239. package/build-module/components/block-settings-menu-controls/index.js +13 -5
  240. package/build-module/components/block-settings-menu-controls/index.js.map +1 -1
  241. package/build-module/components/block-styles/preview-panel.js +1 -2
  242. package/build-module/components/block-styles/preview-panel.js.map +1 -1
  243. package/build-module/components/block-switcher/block-transformations-menu.js +7 -0
  244. package/build-module/components/block-switcher/block-transformations-menu.js.map +1 -1
  245. package/build-module/components/block-switcher/block-variation-transformations.js +108 -0
  246. package/build-module/components/block-switcher/block-variation-transformations.js.map +1 -0
  247. package/build-module/components/block-switcher/index.js +33 -12
  248. package/build-module/components/block-switcher/index.js.map +1 -1
  249. package/build-module/components/block-switcher/pattern-transformations-menu.js +3 -3
  250. package/build-module/components/block-switcher/pattern-transformations-menu.js.map +1 -1
  251. package/build-module/components/block-toolbar/index.js +8 -7
  252. package/build-module/components/block-toolbar/index.js.map +1 -1
  253. package/build-module/components/block-tools/block-contextual-toolbar.js +22 -65
  254. package/build-module/components/block-tools/block-contextual-toolbar.js.map +1 -1
  255. package/build-module/components/block-tools/insertion-point.js +11 -5
  256. package/build-module/components/block-tools/insertion-point.js.map +1 -1
  257. package/build-module/components/block-tools/selected-block-popover.js +3 -7
  258. package/build-module/components/block-tools/selected-block-popover.js.map +1 -1
  259. package/build-module/components/colors-gradients/use-multiple-origin-colors-and-gradients.js +3 -2
  260. package/build-module/components/colors-gradients/use-multiple-origin-colors-and-gradients.js.map +1 -1
  261. package/build-module/components/convert-to-group-buttons/index.js +7 -2
  262. package/build-module/components/convert-to-group-buttons/index.js.map +1 -1
  263. package/build-module/components/convert-to-group-buttons/index.native.js +76 -1
  264. package/build-module/components/convert-to-group-buttons/index.native.js.map +1 -1
  265. package/build-module/components/convert-to-group-buttons/use-convert-to-group-button-props.js +22 -36
  266. package/build-module/components/convert-to-group-buttons/use-convert-to-group-button-props.js.map +1 -1
  267. package/build-module/components/global-styles/advanced-panel.js +74 -0
  268. package/build-module/components/global-styles/advanced-panel.js.map +1 -0
  269. package/build-module/components/global-styles/color-panel.js +5 -2
  270. package/build-module/components/global-styles/color-panel.js.map +1 -1
  271. package/build-module/components/global-styles/dimensions-panel.js +9 -8
  272. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  273. package/build-module/components/global-styles/hooks.js +1 -2
  274. package/build-module/components/global-styles/hooks.js.map +1 -1
  275. package/build-module/components/global-styles/index.js +3 -1
  276. package/build-module/components/global-styles/index.js.map +1 -1
  277. package/build-module/components/global-styles/typography-panel.js +1 -1
  278. package/build-module/components/global-styles/typography-panel.js.map +1 -1
  279. package/build-module/components/global-styles/use-global-styles-output.js +25 -4
  280. package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
  281. package/build-module/components/global-styles/utils.js +25 -0
  282. package/build-module/components/global-styles/utils.js.map +1 -1
  283. package/build-module/components/iframe/index.js +15 -8
  284. package/build-module/components/iframe/index.js.map +1 -1
  285. package/build-module/components/image-editor/use-save-image.js +24 -8
  286. package/build-module/components/image-editor/use-save-image.js.map +1 -1
  287. package/build-module/components/inner-blocks/index.js +2 -1
  288. package/build-module/components/inner-blocks/index.js.map +1 -1
  289. package/build-module/components/inner-blocks/index.native.js +7 -6
  290. package/build-module/components/inner-blocks/index.native.js.map +1 -1
  291. package/build-module/components/inner-blocks/use-nested-settings-update.js +13 -5
  292. package/build-module/components/inner-blocks/use-nested-settings-update.js.map +1 -1
  293. package/build-module/components/inserter/index.js +3 -7
  294. package/build-module/components/inserter/index.js.map +1 -1
  295. package/build-module/components/inserter/quick-inserter.js +2 -4
  296. package/build-module/components/inserter/quick-inserter.js.map +1 -1
  297. package/build-module/components/inserter/search-results.js +16 -6
  298. package/build-module/components/inserter/search-results.js.map +1 -1
  299. package/build-module/components/inserter-draggable-blocks/index.js +4 -0
  300. package/build-module/components/inserter-draggable-blocks/index.js.map +1 -1
  301. package/build-module/components/inspector-controls/fill.js +1 -1
  302. package/build-module/components/inspector-controls/fill.js.map +1 -1
  303. package/build-module/components/inspector-controls/fill.native.js +1 -1
  304. package/build-module/components/inspector-controls/fill.native.js.map +1 -1
  305. package/build-module/components/inspector-controls/slot.js +4 -7
  306. package/build-module/components/inspector-controls/slot.js.map +1 -1
  307. package/build-module/components/inspector-controls/slot.native.js +1 -1
  308. package/build-module/components/inspector-controls/slot.native.js.map +1 -1
  309. package/build-module/components/line-height-control/index.js +7 -2
  310. package/build-module/components/line-height-control/index.js.map +1 -1
  311. package/build-module/components/link-control/use-internal-input-value.js +9 -8
  312. package/build-module/components/link-control/use-internal-input-value.js.map +1 -1
  313. package/build-module/components/list-view/appender.js +6 -2
  314. package/build-module/components/list-view/appender.js.map +1 -1
  315. package/build-module/components/list-view/block-contents.js +9 -3
  316. package/build-module/components/list-view/block-contents.js.map +1 -1
  317. package/build-module/components/list-view/block-select-button.js +2 -1
  318. package/build-module/components/list-view/block-select-button.js.map +1 -1
  319. package/build-module/components/list-view/block.js +24 -29
  320. package/build-module/components/list-view/block.js.map +1 -1
  321. package/build-module/components/list-view/branch.js +1 -3
  322. package/build-module/components/list-view/branch.js.map +1 -1
  323. package/build-module/components/list-view/index.js +44 -23
  324. package/build-module/components/list-view/index.js.map +1 -1
  325. package/build-module/components/list-view/use-list-view-client-ids.js +26 -3
  326. package/build-module/components/list-view/use-list-view-client-ids.js.map +1 -1
  327. package/build-module/components/list-view/use-list-view-drop-zone.js +160 -11
  328. package/build-module/components/list-view/use-list-view-drop-zone.js.map +1 -1
  329. package/build-module/components/media-placeholder/index.js +66 -7
  330. package/build-module/components/media-placeholder/index.js.map +1 -1
  331. package/build-module/components/multi-selection-inspector/index.js +2 -2
  332. package/build-module/components/multi-selection-inspector/index.js.map +1 -1
  333. package/build-module/components/preview-options/index.js +7 -2
  334. package/build-module/components/preview-options/index.js.map +1 -1
  335. package/build-module/components/publish-date-time-picker/index.js +0 -2
  336. package/build-module/components/publish-date-time-picker/index.js.map +1 -1
  337. package/build-module/components/spacing-sizes-control/spacing-input-control.js +1 -1
  338. package/build-module/components/spacing-sizes-control/spacing-input-control.js.map +1 -1
  339. package/build-module/components/url-input/index.js +4 -2
  340. package/build-module/components/url-input/index.js.map +1 -1
  341. package/build-module/components/use-block-drop-zone/index.js +25 -16
  342. package/build-module/components/use-block-drop-zone/index.js.map +1 -1
  343. package/build-module/components/use-resize-canvas/index.js +8 -1
  344. package/build-module/components/use-resize-canvas/index.js.map +1 -1
  345. package/build-module/components/writing-flow/use-arrow-nav.js +13 -7
  346. package/build-module/components/writing-flow/use-arrow-nav.js.map +1 -1
  347. package/build-module/hooks/align.js +4 -7
  348. package/build-module/hooks/align.js.map +1 -1
  349. package/build-module/hooks/behaviors.js +97 -0
  350. package/build-module/hooks/behaviors.js.map +1 -0
  351. package/build-module/hooks/border.js +1 -1
  352. package/build-module/hooks/border.js.map +1 -1
  353. package/build-module/hooks/color.js +1 -1
  354. package/build-module/hooks/color.js.map +1 -1
  355. package/build-module/hooks/content-lock-ui.js +8 -11
  356. package/build-module/hooks/content-lock-ui.js.map +1 -1
  357. package/build-module/hooks/dimensions.js +0 -28
  358. package/build-module/hooks/dimensions.js.map +1 -1
  359. package/build-module/hooks/duotone.js +4 -7
  360. package/build-module/hooks/duotone.js.map +1 -1
  361. package/build-module/hooks/index.js +1 -0
  362. package/build-module/hooks/index.js.map +1 -1
  363. package/build-module/hooks/index.native.js +1 -0
  364. package/build-module/hooks/index.native.js.map +1 -1
  365. package/build-module/hooks/layout.js +9 -11
  366. package/build-module/hooks/layout.js.map +1 -1
  367. package/build-module/hooks/position.js +1 -1
  368. package/build-module/hooks/position.js.map +1 -1
  369. package/build-module/hooks/style.js +1 -1
  370. package/build-module/hooks/style.js.map +1 -1
  371. package/build-module/hooks/use-editor-wrapper-styles.native.js +242 -0
  372. package/build-module/hooks/use-editor-wrapper-styles.native.js.map +1 -0
  373. package/build-module/hooks/use-typography-props.js +14 -10
  374. package/build-module/hooks/use-typography-props.js.map +1 -1
  375. package/build-module/index.native.js +6 -0
  376. package/build-module/index.native.js.map +1 -0
  377. package/build-module/private-apis.js +3 -5
  378. package/build-module/private-apis.js.map +1 -1
  379. package/build-module/store/private-actions.js +42 -0
  380. package/build-module/store/private-actions.js.map +1 -1
  381. package/build-module/store/private-selectors.js +79 -0
  382. package/build-module/store/private-selectors.js.map +1 -1
  383. package/build-module/store/reducer.js +34 -1
  384. package/build-module/store/reducer.js.map +1 -1
  385. package/build-module/store/selectors.js +26 -17
  386. package/build-module/store/selectors.js.map +1 -1
  387. package/build-module/utils/order-inserter-block-items.js +32 -0
  388. package/build-module/utils/order-inserter-block-items.js.map +1 -0
  389. package/build-module/utils/use-should-contextual-toolbar-show.js +16 -12
  390. package/build-module/utils/use-should-contextual-toolbar-show.js.map +1 -1
  391. package/build-style/content-rtl.css +32 -14
  392. package/build-style/content.css +32 -14
  393. package/build-style/default-editor-styles-rtl.css +1 -1
  394. package/build-style/default-editor-styles.css +1 -1
  395. package/build-style/style-rtl.css +56 -77
  396. package/build-style/style.css +57 -77
  397. package/package.json +32 -31
  398. package/src/autocompleters/block.js +15 -7
  399. package/src/components/block-breadcrumb/index.js +11 -3
  400. package/src/components/block-breadcrumb/style.scss +2 -1
  401. package/src/components/block-controls/slot.js +8 -4
  402. package/src/components/block-controls/slot.native.js +6 -1
  403. package/src/components/block-draggable/index.js +10 -6
  404. package/src/components/block-draggable/use-scroll-when-dragging.js +8 -2
  405. package/src/components/block-editing-mode/index.js +71 -0
  406. package/src/components/block-list/block-invalid-warning.native.js +17 -9
  407. package/src/components/block-list/block-list-block-context.js +6 -0
  408. package/src/components/block-list/block-list-item-cell.native.js +10 -1
  409. package/src/components/block-list/block-list-item.native.js +180 -208
  410. package/src/components/block-list/block-outline.native.js +58 -0
  411. package/src/components/block-list/block.js +38 -56
  412. package/src/components/block-list/block.native.js +531 -501
  413. package/src/components/block-list/content.scss +5 -6
  414. package/src/components/block-list/index.native.js +324 -382
  415. package/src/components/block-list/insertion-point.native.js +2 -2
  416. package/src/components/block-list/test/block-invalid-warning.native.js +48 -0
  417. package/src/components/block-list/test/index.native.js +205 -0
  418. package/src/components/block-list/use-block-props/index.js +1 -1
  419. package/src/components/block-list/use-in-between-inserter.js +7 -3
  420. package/src/components/block-list-appender/index.js +22 -4
  421. package/src/components/block-mobile-toolbar/block-actions-menu.native.js +26 -1
  422. package/src/components/block-mover/style.scss +1 -0
  423. package/src/components/block-pattern-setup/style.scss +1 -4
  424. package/src/components/block-patterns-list/style.scss +1 -4
  425. package/src/components/block-settings-menu/block-settings-dropdown.js +10 -17
  426. package/src/components/block-settings-menu-controls/index.js +24 -4
  427. package/src/components/block-styles/preview-panel.js +1 -3
  428. package/src/components/block-styles/style.scss +4 -4
  429. package/src/components/block-switcher/block-transformations-menu.js +12 -0
  430. package/src/components/block-switcher/block-variation-transformations.js +115 -0
  431. package/src/components/block-switcher/index.js +38 -5
  432. package/src/components/block-switcher/pattern-transformations-menu.js +5 -5
  433. package/src/components/block-switcher/style.scss +6 -5
  434. package/src/components/block-toolbar/index.js +10 -11
  435. package/src/components/block-tools/block-contextual-toolbar.js +32 -67
  436. package/src/components/block-tools/insertion-point.js +23 -9
  437. package/src/components/block-tools/selected-block-popover.js +3 -5
  438. package/src/components/block-tools/style.scss +8 -0
  439. package/src/components/button-block-appender/content.scss +22 -0
  440. package/src/components/colors-gradients/use-multiple-origin-colors-and-gradients.js +16 -2
  441. package/src/components/convert-to-group-buttons/index.js +9 -2
  442. package/src/components/convert-to-group-buttons/index.native.js +79 -1
  443. package/src/components/convert-to-group-buttons/use-convert-to-group-button-props.js +32 -38
  444. package/src/components/global-styles/advanced-panel.js +82 -0
  445. package/src/components/global-styles/color-panel.js +6 -1
  446. package/src/components/global-styles/dimensions-panel.js +9 -8
  447. package/src/components/global-styles/hooks.js +1 -5
  448. package/src/components/global-styles/index.js +6 -1
  449. package/src/components/global-styles/style.scss +17 -0
  450. package/src/components/global-styles/test/utils.js +57 -1
  451. package/src/components/global-styles/typography-panel.js +1 -1
  452. package/src/components/global-styles/use-global-styles-output.js +21 -3
  453. package/src/components/global-styles/utils.js +27 -0
  454. package/src/components/iframe/index.js +22 -12
  455. package/src/components/image-editor/use-save-image.js +20 -9
  456. package/src/components/inner-blocks/README.md +5 -0
  457. package/src/components/inner-blocks/index.js +2 -0
  458. package/src/components/inner-blocks/index.native.js +16 -6
  459. package/src/components/inner-blocks/use-nested-settings-update.js +20 -3
  460. package/src/components/inserter/index.js +1 -9
  461. package/src/components/inserter/quick-inserter.js +0 -2
  462. package/src/components/inserter/search-results.js +32 -6
  463. package/src/components/inserter-draggable-blocks/index.js +4 -0
  464. package/src/components/inspector-controls/fill.js +1 -1
  465. package/src/components/inspector-controls/fill.native.js +1 -1
  466. package/src/components/inspector-controls/slot.js +4 -9
  467. package/src/components/inspector-controls/slot.native.js +1 -1
  468. package/src/components/line-height-control/index.js +7 -2
  469. package/src/components/line-height-control/stories/index.js +1 -1
  470. package/src/components/link-control/test/index.js +42 -0
  471. package/src/components/link-control/use-internal-input-value.js +8 -7
  472. package/src/components/list-view/appender.js +3 -2
  473. package/src/components/list-view/block-contents.js +32 -20
  474. package/src/components/list-view/block-select-button.js +5 -1
  475. package/src/components/list-view/block.js +34 -37
  476. package/src/components/list-view/branch.js +1 -7
  477. package/src/components/list-view/index.js +42 -17
  478. package/src/components/list-view/style.scss +7 -7
  479. package/src/components/list-view/test/use-list-view-drop-zone.js +88 -12
  480. package/src/components/list-view/use-list-view-client-ids.js +21 -4
  481. package/src/components/list-view/use-list-view-drop-zone.js +194 -11
  482. package/src/components/media-placeholder/index.js +74 -1
  483. package/src/components/multi-selection-inspector/index.js +2 -2
  484. package/src/components/preview-options/index.js +9 -2
  485. package/src/components/publish-date-time-picker/index.js +0 -2
  486. package/src/components/spacing-sizes-control/spacing-input-control.js +1 -0
  487. package/src/components/url-input/README.md +6 -0
  488. package/src/components/url-input/index.js +2 -2
  489. package/src/components/use-block-drop-zone/index.js +31 -17
  490. package/src/components/use-resize-canvas/index.js +9 -1
  491. package/src/components/writing-flow/test/index.js +15 -0
  492. package/src/components/writing-flow/use-arrow-nav.js +17 -4
  493. package/src/hooks/align.js +5 -12
  494. package/src/hooks/behaviors.js +104 -0
  495. package/src/hooks/border.js +2 -1
  496. package/src/hooks/color.js +2 -1
  497. package/src/hooks/content-lock-ui.js +3 -15
  498. package/src/hooks/dimensions.js +0 -40
  499. package/src/hooks/duotone.js +4 -11
  500. package/src/hooks/index.js +1 -0
  501. package/src/hooks/index.native.js +1 -0
  502. package/src/hooks/layout.js +14 -20
  503. package/src/hooks/position.js +2 -1
  504. package/src/hooks/style.js +2 -1
  505. package/src/hooks/test/use-editor-wrapper-styles.native.js +282 -0
  506. package/src/hooks/test/use-typography-props.js +47 -2
  507. package/src/hooks/use-editor-wrapper-styles.native.js +250 -0
  508. package/src/hooks/use-editor-wrapper-styles.native.scss +11 -0
  509. package/src/hooks/use-typography-props.js +10 -11
  510. package/src/index.native.js +6 -0
  511. package/src/private-apis.js +2 -4
  512. package/src/store/private-actions.js +39 -0
  513. package/src/store/private-selectors.js +95 -0
  514. package/src/store/reducer.js +27 -0
  515. package/src/store/selectors.js +25 -15
  516. package/src/store/test/private-actions.js +32 -1
  517. package/src/store/test/private-selectors.js +158 -0
  518. package/src/store/test/reducer.js +48 -0
  519. package/src/style.scss +0 -3
  520. package/src/utils/order-inserter-block-items.js +26 -0
  521. package/src/utils/use-should-contextual-toolbar-show.js +19 -9
  522. package/tsconfig.json +1 -0
  523. package/tsconfig.tsbuildinfo +1 -1
  524. package/build/components/block-list/block-list-compact.native.js +0 -75
  525. package/build/components/block-list/block-list-compact.native.js.map +0 -1
  526. package/build/components/off-canvas-editor/appender.js +0 -125
  527. package/build/components/off-canvas-editor/appender.js.map +0 -1
  528. package/build/components/off-canvas-editor/block-contents.js +0 -141
  529. package/build/components/off-canvas-editor/block-contents.js.map +0 -1
  530. package/build/components/off-canvas-editor/block-select-button.js +0 -126
  531. package/build/components/off-canvas-editor/block-select-button.js.map +0 -1
  532. package/build/components/off-canvas-editor/block.js +0 -297
  533. package/build/components/off-canvas-editor/block.js.map +0 -1
  534. package/build/components/off-canvas-editor/branch.js +0 -197
  535. package/build/components/off-canvas-editor/branch.js.map +0 -1
  536. package/build/components/off-canvas-editor/context.js +0 -19
  537. package/build/components/off-canvas-editor/context.js.map +0 -1
  538. package/build/components/off-canvas-editor/drop-indicator.js +0 -118
  539. package/build/components/off-canvas-editor/drop-indicator.js.map +0 -1
  540. package/build/components/off-canvas-editor/expander.js +0 -41
  541. package/build/components/off-canvas-editor/expander.js.map +0 -1
  542. package/build/components/off-canvas-editor/index.js +0 -236
  543. package/build/components/off-canvas-editor/index.js.map +0 -1
  544. package/build/components/off-canvas-editor/leaf-more-menu.js +0 -146
  545. package/build/components/off-canvas-editor/leaf-more-menu.js.map +0 -1
  546. package/build/components/off-canvas-editor/leaf.js +0 -60
  547. package/build/components/off-canvas-editor/leaf.js.map +0 -1
  548. package/build/components/off-canvas-editor/link-ui.js +0 -186
  549. package/build/components/off-canvas-editor/link-ui.js.map +0 -1
  550. package/build/components/off-canvas-editor/update-attributes.js +0 -108
  551. package/build/components/off-canvas-editor/update-attributes.js.map +0 -1
  552. package/build/components/off-canvas-editor/use-block-selection.js +0 -139
  553. package/build/components/off-canvas-editor/use-block-selection.js.map +0 -1
  554. package/build/components/off-canvas-editor/use-inserted-block.js +0 -58
  555. package/build/components/off-canvas-editor/use-inserted-block.js.map +0 -1
  556. package/build/components/off-canvas-editor/use-list-view-client-ids.js +0 -33
  557. package/build/components/off-canvas-editor/use-list-view-client-ids.js.map +0 -1
  558. package/build/components/off-canvas-editor/use-list-view-drop-zone.js +0 -235
  559. package/build/components/off-canvas-editor/use-list-view-drop-zone.js.map +0 -1
  560. package/build/components/off-canvas-editor/use-list-view-expand-selected-item.js +0 -60
  561. package/build/components/off-canvas-editor/use-list-view-expand-selected-item.js.map +0 -1
  562. package/build/components/off-canvas-editor/utils.js +0 -60
  563. package/build/components/off-canvas-editor/utils.js.map +0 -1
  564. package/build-module/components/block-list/block-list-compact.native.js +0 -60
  565. package/build-module/components/block-list/block-list-compact.native.js.map +0 -1
  566. package/build-module/components/off-canvas-editor/appender.js +0 -108
  567. package/build-module/components/off-canvas-editor/appender.js.map +0 -1
  568. package/build-module/components/off-canvas-editor/block-contents.js +0 -121
  569. package/build-module/components/off-canvas-editor/block-contents.js.map +0 -1
  570. package/build-module/components/off-canvas-editor/block-select-button.js +0 -107
  571. package/build-module/components/off-canvas-editor/block-select-button.js.map +0 -1
  572. package/build-module/components/off-canvas-editor/block.js +0 -273
  573. package/build-module/components/off-canvas-editor/block.js.map +0 -1
  574. package/build-module/components/off-canvas-editor/branch.js +0 -179
  575. package/build-module/components/off-canvas-editor/branch.js.map +0 -1
  576. package/build-module/components/off-canvas-editor/context.js +0 -7
  577. package/build-module/components/off-canvas-editor/context.js.map +0 -1
  578. package/build-module/components/off-canvas-editor/drop-indicator.js +0 -111
  579. package/build-module/components/off-canvas-editor/drop-indicator.js.map +0 -1
  580. package/build-module/components/off-canvas-editor/expander.js +0 -32
  581. package/build-module/components/off-canvas-editor/expander.js.map +0 -1
  582. package/build-module/components/off-canvas-editor/index.js +0 -213
  583. package/build-module/components/off-canvas-editor/index.js.map +0 -1
  584. package/build-module/components/off-canvas-editor/leaf-more-menu.js +0 -128
  585. package/build-module/components/off-canvas-editor/leaf-more-menu.js.map +0 -1
  586. package/build-module/components/off-canvas-editor/leaf.js +0 -45
  587. package/build-module/components/off-canvas-editor/leaf.js.map +0 -1
  588. package/build-module/components/off-canvas-editor/link-ui.js +0 -166
  589. package/build-module/components/off-canvas-editor/link-ui.js.map +0 -1
  590. package/build-module/components/off-canvas-editor/update-attributes.js +0 -97
  591. package/build-module/components/off-canvas-editor/update-attributes.js.map +0 -1
  592. package/build-module/components/off-canvas-editor/use-block-selection.js +0 -124
  593. package/build-module/components/off-canvas-editor/use-block-selection.js.map +0 -1
  594. package/build-module/components/off-canvas-editor/use-inserted-block.js +0 -47
  595. package/build-module/components/off-canvas-editor/use-inserted-block.js.map +0 -1
  596. package/build-module/components/off-canvas-editor/use-list-view-client-ids.js +0 -24
  597. package/build-module/components/off-canvas-editor/use-list-view-client-ids.js.map +0 -1
  598. package/build-module/components/off-canvas-editor/use-list-view-drop-zone.js +0 -220
  599. package/build-module/components/off-canvas-editor/use-list-view-drop-zone.js.map +0 -1
  600. package/build-module/components/off-canvas-editor/use-list-view-expand-selected-item.js +0 -50
  601. package/build-module/components/off-canvas-editor/use-list-view-expand-selected-item.js.map +0 -1
  602. package/build-module/components/off-canvas-editor/utils.js +0 -44
  603. package/build-module/components/off-canvas-editor/utils.js.map +0 -1
  604. package/src/components/block-list/block-list-compact.native.js +0 -63
  605. package/src/components/off-canvas-editor/README.md +0 -5
  606. package/src/components/off-canvas-editor/appender.js +0 -124
  607. package/src/components/off-canvas-editor/block-contents.js +0 -156
  608. package/src/components/off-canvas-editor/block-select-button.js +0 -128
  609. package/src/components/off-canvas-editor/block.js +0 -347
  610. package/src/components/off-canvas-editor/branch.js +0 -238
  611. package/src/components/off-canvas-editor/context.js +0 -8
  612. package/src/components/off-canvas-editor/drop-indicator.js +0 -126
  613. package/src/components/off-canvas-editor/expander.js +0 -26
  614. package/src/components/off-canvas-editor/index.js +0 -271
  615. package/src/components/off-canvas-editor/leaf-more-menu.js +0 -157
  616. package/src/components/off-canvas-editor/leaf.js +0 -52
  617. package/src/components/off-canvas-editor/link-ui.js +0 -167
  618. package/src/components/off-canvas-editor/style.scss +0 -34
  619. package/src/components/off-canvas-editor/test/use-inserted-block.js +0 -108
  620. package/src/components/off-canvas-editor/test/utils.js +0 -50
  621. package/src/components/off-canvas-editor/update-attributes.js +0 -99
  622. package/src/components/off-canvas-editor/use-block-selection.js +0 -169
  623. package/src/components/off-canvas-editor/use-inserted-block.js +0 -47
  624. package/src/components/off-canvas-editor/use-list-view-client-ids.js +0 -29
  625. package/src/components/off-canvas-editor/use-list-view-drop-zone.js +0 -260
  626. package/src/components/off-canvas-editor/use-list-view-expand-selected-item.js +0 -58
  627. package/src/components/off-canvas-editor/utils.js +0 -58
@@ -5,30 +5,24 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.default = exports.BlockListItem = void 0;
8
+ exports.default = void 0;
9
9
 
10
10
  var _element = require("@wordpress/element");
11
11
 
12
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
13
-
14
12
  var _reactNative = require("react-native");
15
13
 
16
14
  var _data = require("@wordpress/data");
17
15
 
18
- var _compose = require("@wordpress/compose");
19
-
20
- var _components = require("@wordpress/components");
21
-
22
16
  var _block = _interopRequireDefault(require("./block"));
23
17
 
24
- var _insertionPoint = _interopRequireDefault(require("./insertion-point"));
25
-
26
18
  var _gridItem = _interopRequireDefault(require("./grid-item"));
27
19
 
28
- var _blockListItemNative = _interopRequireDefault(require("./block-list-item.native.scss"));
20
+ var _insertionPoint = _interopRequireDefault(require("./insertion-point"));
29
21
 
30
22
  var _store = require("../../store");
31
23
 
24
+ var _useEditorWrapperStyles = require("../../hooks/use-editor-wrapper-styles");
25
+
32
26
  /**
33
27
  * External dependencies
34
28
  */
@@ -40,201 +34,170 @@ var _store = require("../../store");
40
34
  /**
41
35
  * Internal dependencies
42
36
  */
43
- const stretchStyle = {
44
- flex: 1
45
- };
46
37
 
47
- class BlockListItem extends _element.Component {
48
- getMarginHorizontal() {
49
- const {
50
- blockAlignment,
51
- marginHorizontal,
52
- parentBlockAlignment,
53
- hasParents,
54
- blockName,
55
- parentBlockName,
56
- parentWidth,
57
- blockWidth
58
- } = this.props;
38
+ /**
39
+ * BlockListItemContent component. Renders a block with an optional insertion point.
40
+ *
41
+ * @param {Object} props Component properties.
42
+ * @param {number} props.blockWidth The width of the block.
43
+ * @param {string} props.clientId The block client ID.
44
+ * @param {string} props.contentResizeMode The content resize mode, e.g "stretch".
45
+ * @param {Object} props.contentStyle Styles for the block content
46
+ * @param {Object} props.index Block item index
47
+ * @param {boolean} props.isStackedHorizontally Whether the block is stacked horizontally.
48
+ * @param {number} props.marginHorizontal The horizontal margin.
49
+ * @param {number} props.marginVertical The vertical margin.
50
+ * @param {Function} props.onAddBlock On add block callback.
51
+ * @param {Function} props.onDeleteBlock On delete block callback.
52
+ * @param {number} props.parentWidth The width of the parent block.
53
+ * @param {string} props.rootClientId The root client ID.
54
+ * @param {Function} props.shouldShowInnerBlockAppender Whether to show the inner block appender.
55
+ *
56
+ * @return {WPComponent} The rendered block list item content.
57
+ */
58
+ function BlockListItemContent(_ref) {
59
+ let {
60
+ blockWidth,
61
+ clientId,
62
+ contentResizeMode,
63
+ contentStyle,
64
+ index,
65
+ isStackedHorizontally,
66
+ marginHorizontal,
67
+ marginVertical,
68
+ onAddBlock,
69
+ onDeleteBlock,
70
+ parentWidth,
71
+ rootClientId,
72
+ shouldShowInnerBlockAppender
73
+ } = _ref;
74
+ const {
75
+ blockAlignment,
76
+ blockName,
77
+ hasParents,
78
+ parentBlockAlignment,
79
+ parentBlockName,
80
+ shouldShowInsertionPointAfter,
81
+ shouldShowInsertionPointBefore
82
+ } = (0, _data.useSelect)(select => {
59
83
  const {
60
- isFullWidth,
61
- isWideWidth,
62
- isWider,
63
- isContainerRelated
64
- } = _components.alignmentHelpers;
65
-
66
- if (isFullWidth(blockAlignment)) {
67
- if (!hasParents) {
68
- return 0;
69
- }
70
-
71
- return marginHorizontal;
72
- }
73
-
74
- if (isWideWidth(blockAlignment)) {
75
- return marginHorizontal;
76
- }
77
-
78
- const screenWidth = Math.floor(_reactNative.Dimensions.get('window').width);
79
-
80
- if (isFullWidth(parentBlockAlignment) && !isWider(blockWidth, 'medium')) {
81
- if (isContainerRelated(blockName) || isWider(screenWidth, 'mobile')) {
82
- return marginHorizontal;
83
- }
84
-
85
- return marginHorizontal * 2;
86
- }
87
-
88
- if (isContainerRelated(parentBlockName) && !isContainerRelated(blockName)) {
89
- const isScreenWidthEqual = parentWidth === screenWidth;
90
-
91
- if (isScreenWidthEqual || isWider(screenWidth, 'mobile')) {
92
- return marginHorizontal;
93
- }
94
- }
95
-
96
- return marginHorizontal;
97
- }
98
-
99
- getContentStyles(readableContentViewStyle) {
84
+ getBlockAttributes,
85
+ getBlockInsertionPoint,
86
+ getBlockName,
87
+ getBlockOrder,
88
+ isBlockInsertionPointVisible
89
+ } = select(_store.store);
90
+ const blockClientIds = getBlockOrder(rootClientId);
91
+ const insertionPoint = getBlockInsertionPoint();
92
+ const insertionPointVisibleInCurrentRoot = !isStackedHorizontally && isBlockInsertionPointVisible() && insertionPoint.rootClientId === rootClientId;
93
+ const isListEmpty = blockClientIds.length === 0;
94
+ const isInsertionPointBeforeBlock = blockClientIds[insertionPoint.index] === clientId;
95
+ const isInsertionPointAtEnd = blockClientIds.length === insertionPoint.index;
96
+ const isBlockLastInList = blockClientIds[insertionPoint.index - 1] === clientId;
97
+ const showInsertionPointBefore = insertionPointVisibleInCurrentRoot && (isListEmpty || isInsertionPointBeforeBlock);
98
+ const showInsertionPointAfter = insertionPointVisibleInCurrentRoot && isInsertionPointAtEnd && isBlockLastInList;
99
+ const blockHasParents = !!rootClientId;
100
+ const name = getBlockName(clientId);
101
+ const parentName = getBlockName(rootClientId);
100
102
  const {
101
- blockAlignment,
102
- blockName,
103
- hasParents,
104
- parentBlockName
105
- } = this.props;
103
+ align
104
+ } = getBlockAttributes(clientId) || {};
106
105
  const {
107
- isFullWidth,
108
- isContainerRelated
109
- } = _components.alignmentHelpers;
110
- return [readableContentViewStyle, isFullWidth(blockAlignment) && !hasParents && {
111
- width: _blockListItemNative.default.fullAlignment.width
112
- }, !blockAlignment && hasParents && !isContainerRelated(parentBlockName) && isContainerRelated(blockName) && {
113
- paddingHorizontal: _blockListItemNative.default.fullAlignmentPadding.paddingLeft
114
- }];
115
- }
106
+ align: parentBlockAlign
107
+ } = getBlockAttributes(rootClientId) || {};
108
+ return {
109
+ blockAlignment: align,
110
+ blockName: name,
111
+ hasParents: blockHasParents,
112
+ parentBlockAlignment: parentBlockAlign,
113
+ parentBlockName: parentName,
114
+ shouldShowInsertionPointAfter: showInsertionPointAfter,
115
+ shouldShowInsertionPointBefore: showInsertionPointBefore
116
+ };
117
+ }, [isStackedHorizontally, rootClientId, clientId]);
118
+ const [wrapperStyles, margin] = (0, _useEditorWrapperStyles.useEditorWrapperStyles)({
119
+ align: blockAlignment,
120
+ blockName,
121
+ blockWidth,
122
+ contentResizeMode,
123
+ hasParents,
124
+ marginHorizontal,
125
+ parentBlockAlignment,
126
+ parentBlockName,
127
+ parentWidth
128
+ });
129
+ const shouldShowBlockInsertionPointAfter = !shouldShowInnerBlockAppender() && shouldShowInsertionPointAfter;
130
+ return (0, _element.createElement)(_reactNative.View, {
131
+ style: wrapperStyles
132
+ }, shouldShowInsertionPointBefore && (0, _element.createElement)(_insertionPoint.default, {
133
+ testID: `block-insertion-point-before-row-${index + 1}`
134
+ }), (0, _element.createElement)(_block.default, {
135
+ blockWidth: blockWidth,
136
+ clientId: clientId,
137
+ contentStyle: contentStyle,
138
+ isStackedHorizontally: isStackedHorizontally,
139
+ marginHorizontal: margin,
140
+ marginVertical: marginVertical,
141
+ onAddBlock: onAddBlock,
142
+ parentBlockAlignment: parentBlockAlignment,
143
+ onDeleteBlock: onDeleteBlock,
144
+ parentWidth: parentWidth,
145
+ rootClientId: rootClientId
146
+ }), shouldShowBlockInsertionPointAfter && (0, _element.createElement)(_insertionPoint.default, {
147
+ testID: `block-insertion-point-after-row-${index + 1}`
148
+ }));
149
+ }
150
+ /**
151
+ * BlockListItem component. Renders a block list item either as a grid item or as a standalone item.
152
+ *
153
+ * @param {Object} props Component properties.
154
+ * @param {boolean} props.isGridItem Whether the block is a grid item.
155
+ * @param {number} props.numOfColumns The number of columns for grid layout.
156
+ * @param {number} props.parentWidth The width of the parent block.
157
+ * @param {number} props.tileCount The total number of tiles in the grid.
158
+ * @param {number} props.tileIndex The index of the current tile in the grid.
159
+ * @param {number} props.blockWidth The width of the block.
160
+ * @param {string} props.clientId The block client ID.
161
+ * @param {string} props.contentResizeMode The content resize mode, e.g "stretch".
162
+ * @param {Object} props.contentStyle Styles for the block content
163
+ * @param {Object} props.index Block item index
164
+ * @param {boolean} props.isStackedHorizontally Whether the block is stacked horizontally.
165
+ * @param {number} props.marginHorizontal The horizontal margin.
166
+ * @param {number} props.marginVertical The vertical margin.
167
+ * @param {Function} props.onAddBlock On add block callback.
168
+ * @param {Function} props.onDeleteBlock On delete block callback.
169
+ * @param {string} props.rootClientId The root client ID.
170
+ * @param {Function} props.shouldShowInnerBlockAppender Whether to show the inner block appender.
171
+ *
172
+ * @return {WPComponent|null} The rendered block list item or null if the block width is not provided.
173
+ */
116
174
 
117
- renderContent() {
118
- const {
119
- blockAlignment,
120
- clientId,
121
- isReadOnly,
122
- shouldShowInsertionPointBefore,
123
- shouldShowInsertionPointAfter,
124
- contentResizeMode,
125
- shouldShowInnerBlockAppender,
126
- parentWidth,
127
- marginHorizontal,
128
- blockName,
129
- blockWidth,
130
- ...restProps
131
- } = this.props;
132
- const readableContentViewStyle = contentResizeMode === 'stretch' && stretchStyle;
133
- const {
134
- isContainerRelated
135
- } = _components.alignmentHelpers;
136
- return (0, _element.createElement)(_components.ReadableContentView, {
137
- align: blockAlignment,
138
- style: [readableContentViewStyle, isContainerRelated(blockName) && parentWidth && {
139
- maxWidth: parentWidth + 2 * marginHorizontal
140
- }]
141
- }, (0, _element.createElement)(_reactNative.View, {
142
- style: this.getContentStyles(readableContentViewStyle),
143
- pointerEvents: isReadOnly ? 'box-only' : 'auto'
144
- }, shouldShowInsertionPointBefore && (0, _element.createElement)(_insertionPoint.default, null), (0, _element.createElement)(_block.default, (0, _extends2.default)({
145
- key: clientId,
146
- showTitle: false,
147
- clientId: clientId,
148
- parentWidth: parentWidth
149
- }, restProps, {
150
- marginHorizontal: this.getMarginHorizontal(),
151
- blockWidth: blockWidth
152
- })), !shouldShowInnerBlockAppender() && shouldShowInsertionPointAfter && (0, _element.createElement)(_insertionPoint.default, null)));
175
+
176
+ function BlockListItem(props) {
177
+ const {
178
+ isGridItem,
179
+ numOfColumns,
180
+ tileCount,
181
+ tileIndex,
182
+ ...restProps
183
+ } = props;
184
+
185
+ if (!(props !== null && props !== void 0 && props.blockWidth)) {
186
+ return null;
153
187
  }
154
188
 
155
- render() {
156
- const {
157
- parentWidth,
158
- blockWidth,
159
- isGridItem
160
- } = this.props;
161
-
162
- if (!blockWidth) {
163
- return null;
164
- }
165
-
166
- if (isGridItem) {
167
- const {
168
- numOfColumns,
169
- tileCount,
170
- tileIndex
171
- } = this.props;
172
- return (0, _element.createElement)(_gridItem.default, {
173
- maxWidth: parentWidth,
174
- numOfColumns: numOfColumns,
175
- tileCount: tileCount,
176
- index: tileIndex
177
- }, this.renderContent());
178
- }
179
-
180
- return this.renderContent();
189
+ if (isGridItem) {
190
+ return (0, _element.createElement)(_gridItem.default, {
191
+ maxWidth: props === null || props === void 0 ? void 0 : props.parentWidth,
192
+ numOfColumns: numOfColumns,
193
+ tileCount: tileCount,
194
+ index: tileIndex
195
+ }, (0, _element.createElement)(BlockListItemContent, restProps));
181
196
  }
182
197
 
198
+ return (0, _element.createElement)(BlockListItemContent, restProps);
183
199
  }
184
200
 
185
- exports.BlockListItem = BlockListItem;
186
-
187
- var _default = (0, _compose.compose)([(0, _data.withSelect)((select, _ref) => {
188
- let {
189
- rootClientId,
190
- isStackedHorizontally,
191
- clientId
192
- } = _ref;
193
- const {
194
- getBlockOrder,
195
- getBlockInsertionPoint,
196
- isBlockInsertionPointVisible,
197
- getSettings,
198
- getBlockParents,
199
- getBlock
200
- } = select(_store.store);
201
- const blockClientIds = getBlockOrder(rootClientId);
202
- const insertionPoint = getBlockInsertionPoint();
203
- const blockInsertionPointIsVisible = isBlockInsertionPointVisible();
204
- const shouldShowInsertionPointBefore = !isStackedHorizontally && blockInsertionPointIsVisible && insertionPoint.rootClientId === rootClientId && ( // If list is empty, show the insertion point (via the default appender)
205
- blockClientIds.length === 0 || // Or if the insertion point is right before the denoted block.
206
- blockClientIds[insertionPoint.index] === clientId);
207
- const shouldShowInsertionPointAfter = !isStackedHorizontally && blockInsertionPointIsVisible && insertionPoint.rootClientId === rootClientId && // If the insertion point is at the end of the list.
208
- blockClientIds.length === insertionPoint.index && // And the denoted block is the last one on the list, show the indicator at the end of the block.
209
- blockClientIds[insertionPoint.index - 1] === clientId;
210
- const isReadOnly = getSettings().readOnly;
211
- const {
212
- attributes,
213
- name
214
- } = getBlock(clientId) || {};
215
- const {
216
- align
217
- } = attributes || {};
218
- const parents = getBlockParents(clientId, true);
219
- const hasParents = !!parents.length;
220
- const parentBlock = hasParents ? getBlock(parents[0]) : {};
221
- const {
222
- align: parentBlockAlignment
223
- } = (parentBlock === null || parentBlock === void 0 ? void 0 : parentBlock.attributes) || {};
224
- const {
225
- name: parentBlockName
226
- } = parentBlock || {};
227
- return {
228
- shouldShowInsertionPointBefore,
229
- shouldShowInsertionPointAfter,
230
- isReadOnly,
231
- hasParents,
232
- blockAlignment: align,
233
- parentBlockAlignment,
234
- blockName: name,
235
- parentBlockName
236
- };
237
- })])(BlockListItem);
238
-
201
+ var _default = BlockListItem;
239
202
  exports.default = _default;
240
203
  //# sourceMappingURL=block-list-item.native.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/block-list/block-list-item.native.js"],"names":["stretchStyle","flex","BlockListItem","Component","getMarginHorizontal","blockAlignment","marginHorizontal","parentBlockAlignment","hasParents","blockName","parentBlockName","parentWidth","blockWidth","props","isFullWidth","isWideWidth","isWider","isContainerRelated","alignmentHelpers","screenWidth","Math","floor","Dimensions","get","width","isScreenWidthEqual","getContentStyles","readableContentViewStyle","styles","fullAlignment","paddingHorizontal","fullAlignmentPadding","paddingLeft","renderContent","clientId","isReadOnly","shouldShowInsertionPointBefore","shouldShowInsertionPointAfter","contentResizeMode","shouldShowInnerBlockAppender","restProps","maxWidth","render","isGridItem","numOfColumns","tileCount","tileIndex","select","rootClientId","isStackedHorizontally","getBlockOrder","getBlockInsertionPoint","isBlockInsertionPointVisible","getSettings","getBlockParents","getBlock","blockEditorStore","blockClientIds","insertionPoint","blockInsertionPointIsVisible","length","index","readOnly","attributes","name","align","parents","parentBlock"],"mappings":";;;;;;;;;AAQA;;;;AALA;;AAMA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AAEA;;AACA;;AArBA;AACA;AACA;;AAGA;AACA;AACA;;AAMA;AACA;AACA;AAQA,MAAMA,YAAY,GAAG;AACpBC,EAAAA,IAAI,EAAE;AADc,CAArB;;AAIO,MAAMC,aAAN,SAA4BC,kBAA5B,CAAsC;AAC5CC,EAAAA,mBAAmB,GAAG;AACrB,UAAM;AACLC,MAAAA,cADK;AAELC,MAAAA,gBAFK;AAGLC,MAAAA,oBAHK;AAILC,MAAAA,UAJK;AAKLC,MAAAA,SALK;AAMLC,MAAAA,eANK;AAOLC,MAAAA,WAPK;AAQLC,MAAAA;AARK,QASF,KAAKC,KATT;AAUA,UAAM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,GAAP;AAUA,CArDF,CADuB,CAAT,EAwDVR,aAxDU,C","sourcesContent":["/**\n * External dependencies\n */\nimport { View, Dimensions } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport { withSelect } from '@wordpress/data';\nimport { compose } from '@wordpress/compose';\nimport { ReadableContentView, alignmentHelpers } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport BlockListBlock from './block';\nimport BlockInsertionPoint from './insertion-point';\nimport Grid from './grid-item';\n\nimport styles from './block-list-item.native.scss';\nimport { store as blockEditorStore } from '../../store';\n\nconst stretchStyle = {\n\tflex: 1,\n};\n\nexport class BlockListItem extends Component {\n\tgetMarginHorizontal() {\n\t\tconst {\n\t\t\tblockAlignment,\n\t\t\tmarginHorizontal,\n\t\t\tparentBlockAlignment,\n\t\t\thasParents,\n\t\t\tblockName,\n\t\t\tparentBlockName,\n\t\t\tparentWidth,\n\t\t\tblockWidth,\n\t\t} = this.props;\n\t\tconst { isFullWidth, isWideWidth, isWider, isContainerRelated } =\n\t\t\talignmentHelpers;\n\n\t\tif ( isFullWidth( blockAlignment ) ) {\n\t\t\tif ( ! hasParents ) {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\treturn marginHorizontal;\n\t\t}\n\t\tif ( isWideWidth( blockAlignment ) ) {\n\t\t\treturn marginHorizontal;\n\t\t}\n\n\t\tconst screenWidth = Math.floor( Dimensions.get( 'window' ).width );\n\n\t\tif (\n\t\t\tisFullWidth( parentBlockAlignment ) &&\n\t\t\t! isWider( blockWidth, 'medium' )\n\t\t) {\n\t\t\tif (\n\t\t\t\tisContainerRelated( blockName ) ||\n\t\t\t\tisWider( screenWidth, 'mobile' )\n\t\t\t) {\n\t\t\t\treturn marginHorizontal;\n\t\t\t}\n\t\t\treturn marginHorizontal * 2;\n\t\t}\n\n\t\tif (\n\t\t\tisContainerRelated( parentBlockName ) &&\n\t\t\t! isContainerRelated( blockName )\n\t\t) {\n\t\t\tconst isScreenWidthEqual = parentWidth === screenWidth;\n\t\t\tif ( isScreenWidthEqual || isWider( screenWidth, 'mobile' ) ) {\n\t\t\t\treturn marginHorizontal;\n\t\t\t}\n\t\t}\n\n\t\treturn marginHorizontal;\n\t}\n\n\tgetContentStyles( readableContentViewStyle ) {\n\t\tconst { blockAlignment, blockName, hasParents, parentBlockName } =\n\t\t\tthis.props;\n\t\tconst { isFullWidth, isContainerRelated } = alignmentHelpers;\n\n\t\treturn [\n\t\t\treadableContentViewStyle,\n\t\t\tisFullWidth( blockAlignment ) &&\n\t\t\t\t! hasParents && {\n\t\t\t\t\twidth: styles.fullAlignment.width,\n\t\t\t\t},\n\t\t\t! blockAlignment &&\n\t\t\t\thasParents &&\n\t\t\t\t! isContainerRelated( parentBlockName ) &&\n\t\t\t\tisContainerRelated( blockName ) && {\n\t\t\t\t\tpaddingHorizontal: styles.fullAlignmentPadding.paddingLeft,\n\t\t\t\t},\n\t\t];\n\t}\n\n\trenderContent() {\n\t\tconst {\n\t\t\tblockAlignment,\n\t\t\tclientId,\n\t\t\tisReadOnly,\n\t\t\tshouldShowInsertionPointBefore,\n\t\t\tshouldShowInsertionPointAfter,\n\t\t\tcontentResizeMode,\n\t\t\tshouldShowInnerBlockAppender,\n\t\t\tparentWidth,\n\t\t\tmarginHorizontal,\n\t\t\tblockName,\n\t\t\tblockWidth,\n\t\t\t...restProps\n\t\t} = this.props;\n\n\t\tconst readableContentViewStyle =\n\t\t\tcontentResizeMode === 'stretch' && stretchStyle;\n\t\tconst { isContainerRelated } = alignmentHelpers;\n\n\t\treturn (\n\t\t\t<ReadableContentView\n\t\t\t\talign={ blockAlignment }\n\t\t\t\tstyle={ [\n\t\t\t\t\treadableContentViewStyle,\n\t\t\t\t\tisContainerRelated( blockName ) &&\n\t\t\t\t\t\tparentWidth && {\n\t\t\t\t\t\t\tmaxWidth: parentWidth + 2 * marginHorizontal,\n\t\t\t\t\t\t},\n\t\t\t\t] }\n\t\t\t>\n\t\t\t\t<View\n\t\t\t\t\tstyle={ this.getContentStyles( readableContentViewStyle ) }\n\t\t\t\t\tpointerEvents={ isReadOnly ? 'box-only' : 'auto' }\n\t\t\t\t>\n\t\t\t\t\t{ shouldShowInsertionPointBefore && (\n\t\t\t\t\t\t<BlockInsertionPoint />\n\t\t\t\t\t) }\n\t\t\t\t\t<BlockListBlock\n\t\t\t\t\t\tkey={ clientId }\n\t\t\t\t\t\tshowTitle={ false }\n\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\tparentWidth={ parentWidth }\n\t\t\t\t\t\t{ ...restProps }\n\t\t\t\t\t\tmarginHorizontal={ this.getMarginHorizontal() }\n\t\t\t\t\t\tblockWidth={ blockWidth }\n\t\t\t\t\t/>\n\t\t\t\t\t{ ! shouldShowInnerBlockAppender() &&\n\t\t\t\t\t\tshouldShowInsertionPointAfter && (\n\t\t\t\t\t\t\t<BlockInsertionPoint />\n\t\t\t\t\t\t) }\n\t\t\t\t</View>\n\t\t\t</ReadableContentView>\n\t\t);\n\t}\n\n\trender() {\n\t\tconst { parentWidth, blockWidth, isGridItem } = this.props;\n\n\t\tif ( ! blockWidth ) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif ( isGridItem ) {\n\t\t\tconst { numOfColumns, tileCount, tileIndex } = this.props;\n\t\t\treturn (\n\t\t\t\t<Grid\n\t\t\t\t\tmaxWidth={ parentWidth }\n\t\t\t\t\tnumOfColumns={ numOfColumns }\n\t\t\t\t\ttileCount={ tileCount }\n\t\t\t\t\tindex={ tileIndex }\n\t\t\t\t>\n\t\t\t\t\t{ this.renderContent() }\n\t\t\t\t</Grid>\n\t\t\t);\n\t\t}\n\t\treturn this.renderContent();\n\t}\n}\n\nexport default compose( [\n\twithSelect(\n\t\t( select, { rootClientId, isStackedHorizontally, clientId } ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockOrder,\n\t\t\t\tgetBlockInsertionPoint,\n\t\t\t\tisBlockInsertionPointVisible,\n\t\t\t\tgetSettings,\n\t\t\t\tgetBlockParents,\n\t\t\t\tgetBlock,\n\t\t\t} = select( blockEditorStore );\n\n\t\t\tconst blockClientIds = getBlockOrder( rootClientId );\n\t\t\tconst insertionPoint = getBlockInsertionPoint();\n\t\t\tconst blockInsertionPointIsVisible = isBlockInsertionPointVisible();\n\t\t\tconst shouldShowInsertionPointBefore =\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\tblockClientIds[ insertionPoint.index ] === clientId );\n\n\t\t\tconst shouldShowInsertionPointAfter =\n\t\t\t\t! isStackedHorizontally &&\n\t\t\t\tblockInsertionPointIsVisible &&\n\t\t\t\tinsertionPoint.rootClientId === rootClientId &&\n\t\t\t\t// If the insertion point is at the end of the list.\n\t\t\t\tblockClientIds.length === insertionPoint.index &&\n\t\t\t\t// And the denoted block is the last one on the list, show the indicator at the end of the block.\n\t\t\t\tblockClientIds[ insertionPoint.index - 1 ] === clientId;\n\n\t\t\tconst isReadOnly = getSettings().readOnly;\n\n\t\t\tconst { attributes, name } = getBlock( clientId ) || {};\n\t\t\tconst { align } = attributes || {};\n\t\t\tconst parents = getBlockParents( clientId, true );\n\t\t\tconst hasParents = !! parents.length;\n\t\t\tconst parentBlock = hasParents ? getBlock( parents[ 0 ] ) : {};\n\t\t\tconst { align: parentBlockAlignment } =\n\t\t\t\tparentBlock?.attributes || {};\n\t\t\tconst { name: parentBlockName } = parentBlock || {};\n\n\t\t\treturn {\n\t\t\t\tshouldShowInsertionPointBefore,\n\t\t\t\tshouldShowInsertionPointAfter,\n\t\t\t\tisReadOnly,\n\t\t\t\thasParents,\n\t\t\t\tblockAlignment: align,\n\t\t\t\tparentBlockAlignment,\n\t\t\t\tblockName: name,\n\t\t\t\tparentBlockName,\n\t\t\t};\n\t\t}\n\t),\n] )( BlockListItem );\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/block-list/block-list-item.native.js"],"names":["BlockListItemContent","blockWidth","clientId","contentResizeMode","contentStyle","index","isStackedHorizontally","marginHorizontal","marginVertical","onAddBlock","onDeleteBlock","parentWidth","rootClientId","shouldShowInnerBlockAppender","blockAlignment","blockName","hasParents","parentBlockAlignment","parentBlockName","shouldShowInsertionPointAfter","shouldShowInsertionPointBefore","select","getBlockAttributes","getBlockInsertionPoint","getBlockName","getBlockOrder","isBlockInsertionPointVisible","blockEditorStore","blockClientIds","insertionPoint","insertionPointVisibleInCurrentRoot","isListEmpty","length","isInsertionPointBeforeBlock","isInsertionPointAtEnd","isBlockLastInList","showInsertionPointBefore","showInsertionPointAfter","blockHasParents","name","parentName","align","parentBlockAlign","wrapperStyles","margin","shouldShowBlockInsertionPointAfter","BlockListItem","props","isGridItem","numOfColumns","tileCount","tileIndex","restProps"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AAjBA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,oBAAT,OAcI;AAAA,MAd2B;AAC9BC,IAAAA,UAD8B;AAE9BC,IAAAA,QAF8B;AAG9BC,IAAAA,iBAH8B;AAI9BC,IAAAA,YAJ8B;AAK9BC,IAAAA,KAL8B;AAM9BC,IAAAA,qBAN8B;AAO9BC,IAAAA,gBAP8B;AAQ9BC,IAAAA,cAR8B;AAS9BC,IAAAA,UAT8B;AAU9BC,IAAAA,aAV8B;AAW9BC,IAAAA,WAX8B;AAY9BC,IAAAA,YAZ8B;AAa9BC,IAAAA;AAb8B,GAc3B;AACH,QAAM;AACLC,IAAAA,cADK;AAELC,IAAAA,SAFK;AAGLC,IAAAA,UAHK;AAILC,IAAAA,oBA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AGC;AAXhB,IAND,EAmBGiC,kCAAkC,IACnC,4BAAC,uBAAD;AACC,IAAA,MAAM,EAAI,mCAAmCxC,KAAK,GAAG,CAAG;AADzD,IApBF,CADD;AA2BA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,SAASyC,aAAT,CAAwBC,KAAxB,EAAgC;AAC/B,QAAM;AAAEC,IAAAA,UAAF;AAAcC,IAAAA,YAAd;AAA4BC,IAAAA,SAA5B;AAAuCC,IAAAA,SAAvC;AAAkD,OAAGC;AAArD,MACLL,KADD;;AAGA,MAAK,EAAEA,KAAF,aAAEA,KAAF,eAAEA,KAAK,CAAE9C,UAAT,CAAL,EAA2B;AAC1B,WAAO,IAAP;AACA;;AAED,MAAK+C,UAAL,EAAkB;AACjB,WACC,4BAAC,iBAAD;AACC,MAAA,QAAQ,EAAGD,KAAH,aAAGA,KAAH,uBAAGA,KAAK,CAAEpC,WADnB;AAEC,MAAA,YAAY,EAAGsC,YAFhB;AAGC,MAAA,SAAS,EAAGC,SAHb;AAIC,MAAA,KAAK,EAAGC;AAJT,OAMC,4BAAC,oBAAD,EAA2BC,SAA3B,CAND,CADD;AAUA;;AAED,SAAO,4BAAC,oBAAD,EAA2BA,SAA3B,CAAP;AACA;;eAEcN,a","sourcesContent":["/**\n * External dependencies\n */\nimport { View } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport Block from './block';\nimport Grid from './grid-item';\nimport BlockInsertionPoint from './insertion-point';\nimport { store as blockEditorStore } from '../../store';\nimport { useEditorWrapperStyles } from '../../hooks/use-editor-wrapper-styles';\n\n/**\n * BlockListItemContent component. Renders a block with an optional insertion point.\n *\n * @param {Object} props Component properties.\n * @param {number} props.blockWidth The width of the block.\n * @param {string} props.clientId The block client ID.\n * @param {string} props.contentResizeMode The content resize mode, e.g \"stretch\".\n * @param {Object} props.contentStyle Styles for the block content\n * @param {Object} props.index Block item index\n * @param {boolean} props.isStackedHorizontally Whether the block is stacked horizontally.\n * @param {number} props.marginHorizontal The horizontal margin.\n * @param {number} props.marginVertical The vertical margin.\n * @param {Function} props.onAddBlock On add block callback.\n * @param {Function} props.onDeleteBlock On delete block callback.\n * @param {number} props.parentWidth The width of the parent block.\n * @param {string} props.rootClientId The root client ID.\n * @param {Function} props.shouldShowInnerBlockAppender Whether to show the inner block appender.\n *\n * @return {WPComponent} The rendered block list item content.\n */\nfunction BlockListItemContent( {\n\tblockWidth,\n\tclientId,\n\tcontentResizeMode,\n\tcontentStyle,\n\tindex,\n\tisStackedHorizontally,\n\tmarginHorizontal,\n\tmarginVertical,\n\tonAddBlock,\n\tonDeleteBlock,\n\tparentWidth,\n\trootClientId,\n\tshouldShowInnerBlockAppender,\n} ) {\n\tconst {\n\t\tblockAlignment,\n\t\tblockName,\n\t\thasParents,\n\t\tparentBlockAlignment,\n\t\tparentBlockName,\n\t\tshouldShowInsertionPointAfter,\n\t\tshouldShowInsertionPointBefore,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockAttributes,\n\t\t\t\tgetBlockInsertionPoint,\n\t\t\t\tgetBlockName,\n\t\t\t\tgetBlockOrder,\n\t\t\t\tisBlockInsertionPointVisible,\n\t\t\t} = select( blockEditorStore );\n\t\t\tconst blockClientIds = getBlockOrder( rootClientId );\n\t\t\tconst insertionPoint = getBlockInsertionPoint();\n\n\t\t\tconst insertionPointVisibleInCurrentRoot =\n\t\t\t\t! isStackedHorizontally &&\n\t\t\t\tisBlockInsertionPointVisible() &&\n\t\t\t\tinsertionPoint.rootClientId === rootClientId;\n\n\t\t\tconst isListEmpty = blockClientIds.length === 0;\n\t\t\tconst isInsertionPointBeforeBlock =\n\t\t\t\tblockClientIds[ insertionPoint.index ] === clientId;\n\t\t\tconst isInsertionPointAtEnd =\n\t\t\t\tblockClientIds.length === insertionPoint.index;\n\t\t\tconst isBlockLastInList =\n\t\t\t\tblockClientIds[ insertionPoint.index - 1 ] === clientId;\n\n\t\t\tconst showInsertionPointBefore =\n\t\t\t\tinsertionPointVisibleInCurrentRoot &&\n\t\t\t\t( isListEmpty || isInsertionPointBeforeBlock );\n\n\t\t\tconst showInsertionPointAfter =\n\t\t\t\tinsertionPointVisibleInCurrentRoot &&\n\t\t\t\tisInsertionPointAtEnd &&\n\t\t\t\tisBlockLastInList;\n\n\t\t\tconst blockHasParents = !! rootClientId;\n\t\t\tconst name = getBlockName( clientId );\n\t\t\tconst parentName = getBlockName( rootClientId );\n\t\t\tconst { align } = getBlockAttributes( clientId ) || {};\n\t\t\tconst { align: parentBlockAlign } =\n\t\t\t\tgetBlockAttributes( rootClientId ) || {};\n\n\t\t\treturn {\n\t\t\t\tblockAlignment: align,\n\t\t\t\tblockName: name,\n\t\t\t\thasParents: blockHasParents,\n\t\t\t\tparentBlockAlignment: parentBlockAlign,\n\t\t\t\tparentBlockName: parentName,\n\t\t\t\tshouldShowInsertionPointAfter: showInsertionPointAfter,\n\t\t\t\tshouldShowInsertionPointBefore: showInsertionPointBefore,\n\t\t\t};\n\t\t},\n\t\t[ isStackedHorizontally, rootClientId, clientId ]\n\t);\n\n\tconst [ wrapperStyles, margin ] = useEditorWrapperStyles( {\n\t\talign: blockAlignment,\n\t\tblockName,\n\t\tblockWidth,\n\t\tcontentResizeMode,\n\t\thasParents,\n\t\tmarginHorizontal,\n\t\tparentBlockAlignment,\n\t\tparentBlockName,\n\t\tparentWidth,\n\t} );\n\n\tconst shouldShowBlockInsertionPointAfter =\n\t\t! shouldShowInnerBlockAppender() && shouldShowInsertionPointAfter;\n\n\treturn (\n\t\t<View style={ wrapperStyles }>\n\t\t\t{ shouldShowInsertionPointBefore && (\n\t\t\t\t<BlockInsertionPoint\n\t\t\t\t\ttestID={ `block-insertion-point-before-row-${ index + 1 }` }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t<Block\n\t\t\t\tblockWidth={ blockWidth }\n\t\t\t\tclientId={ clientId }\n\t\t\t\tcontentStyle={ contentStyle }\n\t\t\t\tisStackedHorizontally={ isStackedHorizontally }\n\t\t\t\tmarginHorizontal={ margin }\n\t\t\t\tmarginVertical={ marginVertical }\n\t\t\t\tonAddBlock={ onAddBlock }\n\t\t\t\tparentBlockAlignment={ parentBlockAlignment }\n\t\t\t\tonDeleteBlock={ onDeleteBlock }\n\t\t\t\tparentWidth={ parentWidth }\n\t\t\t\trootClientId={ rootClientId }\n\t\t\t/>\n\t\t\t{ shouldShowBlockInsertionPointAfter && (\n\t\t\t\t<BlockInsertionPoint\n\t\t\t\t\ttestID={ `block-insertion-point-after-row-${ index + 1 }` }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</View>\n\t);\n}\n\n/**\n * BlockListItem component. Renders a block list item either as a grid item or as a standalone item.\n *\n * @param {Object} props Component properties.\n * @param {boolean} props.isGridItem Whether the block is a grid item.\n * @param {number} props.numOfColumns The number of columns for grid layout.\n * @param {number} props.parentWidth The width of the parent block.\n * @param {number} props.tileCount The total number of tiles in the grid.\n * @param {number} props.tileIndex The index of the current tile in the grid.\n * @param {number} props.blockWidth The width of the block.\n * @param {string} props.clientId The block client ID.\n * @param {string} props.contentResizeMode The content resize mode, e.g \"stretch\".\n * @param {Object} props.contentStyle Styles for the block content\n * @param {Object} props.index Block item index\n * @param {boolean} props.isStackedHorizontally Whether the block is stacked horizontally.\n * @param {number} props.marginHorizontal The horizontal margin.\n * @param {number} props.marginVertical The vertical margin.\n * @param {Function} props.onAddBlock On add block callback.\n * @param {Function} props.onDeleteBlock On delete block callback.\n * @param {string} props.rootClientId The root client ID.\n * @param {Function} props.shouldShowInnerBlockAppender Whether to show the inner block appender.\n *\n * @return {WPComponent|null} The rendered block list item or null if the block width is not provided.\n */\nfunction BlockListItem( props ) {\n\tconst { isGridItem, numOfColumns, tileCount, tileIndex, ...restProps } =\n\t\tprops;\n\n\tif ( ! props?.blockWidth ) {\n\t\treturn null;\n\t}\n\n\tif ( isGridItem ) {\n\t\treturn (\n\t\t\t<Grid\n\t\t\t\tmaxWidth={ props?.parentWidth }\n\t\t\t\tnumOfColumns={ numOfColumns }\n\t\t\t\ttileCount={ tileCount }\n\t\t\t\tindex={ tileIndex }\n\t\t\t>\n\t\t\t\t<BlockListItemContent { ...restProps } />\n\t\t\t</Grid>\n\t\t);\n\t}\n\n\treturn <BlockListItemContent { ...restProps } />;\n}\n\nexport default BlockListItem;\n"]}
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.default = void 0;
9
+
10
+ var _element = require("@wordpress/element");
11
+
12
+ var _reactNative = require("react-native");
13
+
14
+ var _compose = require("@wordpress/compose");
15
+
16
+ var _components = require("@wordpress/components");
17
+
18
+ var _block = _interopRequireDefault(require("./block.scss"));
19
+
20
+ /**
21
+ * External dependencies
22
+ */
23
+
24
+ /**
25
+ * WordPress dependencies
26
+ */
27
+
28
+ /**
29
+ * Internal dependencies
30
+ */
31
+ function BlockOutline(_ref) {
32
+ let {
33
+ align,
34
+ blockWidth,
35
+ isParentSelected,
36
+ isSelected,
37
+ name,
38
+ screenWidth
39
+ } = _ref;
40
+ const {
41
+ isFullWidth,
42
+ isContainerRelated
43
+ } = _components.alignmentHelpers;
44
+ const isScreenWidthWider = blockWidth < screenWidth;
45
+ const styleSolidBorder = [_block.default.solidBorder, isFullWidth(align) && isScreenWidthWider && _block.default.borderFullWidth, isFullWidth(align) && isContainerRelated(name) && isScreenWidthWider && _block.default.containerBorderFullWidth, (0, _compose.usePreferredColorSchemeStyle)(_block.default.solidBorderColor, _block.default.solidBorderColorDark)];
46
+ const styleDashedBorder = [_block.default.dashedBorder, (0, _compose.usePreferredColorSchemeStyle)(_block.default.dashedBorderColor, _block.default.dashedBorderColorDark)];
47
+ return (0, _element.createElement)(_element.Fragment, null, isSelected && (0, _element.createElement)(_reactNative.View, {
48
+ pointerEvents: "box-none",
49
+ style: styleSolidBorder
50
+ }), isParentSelected && (0, _element.createElement)(_reactNative.View, {
51
+ style: styleDashedBorder
52
+ }));
53
+ }
54
+
55
+ var _default = BlockOutline;
56
+ exports.default = _default;
57
+ //# sourceMappingURL=block-outline.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/block-list/block-outline.native.js"],"names":["BlockOutline","align","blockWidth","isParentSelected","isSelected","name","screenWidth","isFullWidth","isContainerRelated","alignmentHelpers","isScreenWidthWider","styleSolidBorder","styles","solidBorder","borderFullWidth","containerBorderFullWidth","solidBorderColor","solidBorderColorDark","styleDashedBorder","dashedBorder","dashedBorderColor","dashedBorderColorDark"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AACA;;AAKA;;AAdA;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;AAGA,SAASA,YAAT,OAOI;AAAA,MAPmB;AACtBC,IAAAA,KADsB;AAEtBC,IAAAA,UAFsB;AAGtBC,IAAAA,gBAHsB;AAItBC,IAAAA,UAJsB;AAKtBC,IAAAA,IALsB;AAMtBC,IAAAA;AANsB,GAOnB;AACH,QAAM;AAAEC,IAAAA,WAAF;AAAeC,IAAAA;AAAf,MAAsCC,4BAA5C;AACA,QAAMC,kBAAkB,GAAGR,UAAU,GAAGI,WAAxC;AAEA,QAAMK,gBAAgB,GAAG,CACxBC,eAAOC,WADiB,EAExBN,WAAW,CAAEN,KAAF,CAAX,IAAwBS,kBAAxB,IAA8CE,eAAOE,eAF7B,EAGxBP,WAAW,CAAEN,KAAF,CAAX,IACCO,kBAAkB,CAAEH,IAAF,CADnB,IAECK,kBAFD,IAGCE,eAAOG,wBANgB,EAOxB,2CACCH,eAAOI,gBADR,EAECJ,eAAOK,oBAFR,CAPwB,CAAzB;AAYA,QAAMC,iBAAiB,GAAG,CACzBN,eAAOO,YADkB,EAEzB,2CACCP,eAAOQ,iBADR,EAECR,eAAOS,qBAFR,CAFyB,CAA1B;AAQA,SACC,qDACGjB,UAAU,IACX,4BAAC,iBAAD;AAAM,IAAA,aAAa,EAAC,UAApB;AAA+B,IAAA,KAAK,EAAGO;AAAvC,IAFF,EAIGR,gBAAgB,IAAI,4BAAC,iBAAD;AAAM,IAAA,KAAK,EAAGe;AAAd,IAJvB,CADD;AAQA;;eAEclB,Y","sourcesContent":["/**\n * External dependencies\n */\nimport { View } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { usePreferredColorSchemeStyle } from '@wordpress/compose';\nimport { alignmentHelpers } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport styles from './block.scss';\n\nfunction BlockOutline( {\n\talign,\n\tblockWidth,\n\tisParentSelected,\n\tisSelected,\n\tname,\n\tscreenWidth,\n} ) {\n\tconst { isFullWidth, isContainerRelated } = alignmentHelpers;\n\tconst isScreenWidthWider = blockWidth < screenWidth;\n\n\tconst styleSolidBorder = [\n\t\tstyles.solidBorder,\n\t\tisFullWidth( align ) && isScreenWidthWider && styles.borderFullWidth,\n\t\tisFullWidth( align ) &&\n\t\t\tisContainerRelated( name ) &&\n\t\t\tisScreenWidthWider &&\n\t\t\tstyles.containerBorderFullWidth,\n\t\tusePreferredColorSchemeStyle(\n\t\t\tstyles.solidBorderColor,\n\t\t\tstyles.solidBorderColorDark\n\t\t),\n\t];\n\tconst styleDashedBorder = [\n\t\tstyles.dashedBorder,\n\t\tusePreferredColorSchemeStyle(\n\t\t\tstyles.dashedBorderColor,\n\t\t\tstyles.dashedBorderColorDark\n\t\t),\n\t];\n\n\treturn (\n\t\t<>\n\t\t\t{ isSelected && (\n\t\t\t\t<View pointerEvents=\"box-none\" style={ styleSolidBorder } />\n\t\t\t) }\n\t\t\t{ isParentSelected && <View style={ styleDashedBorder } /> }\n\t\t</>\n\t);\n}\n\nexport default BlockOutline;\n"]}
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.default = exports.BlockListBlockContext = void 0;
8
+ exports.default = void 0;
9
9
 
10
10
  var _element = require("@wordpress/element");
11
11
 
@@ -37,6 +37,10 @@ var _store = require("../../store");
37
37
 
38
38
  var _layout = require("./layout");
39
39
 
40
+ var _lockUnlock = require("../../lock-unlock");
41
+
42
+ var _blockListBlockContext = require("./block-list-block-context");
43
+
40
44
  /**
41
45
  * External dependencies
42
46
  */
@@ -48,7 +52,7 @@ var _layout = require("./layout");
48
52
  /**
49
53
  * Internal dependencies
50
54
  */
51
- const BlockListBlockContext = (0, _element.createContext)();
55
+
52
56
  /**
53
57
  * Merges wrapper props with special handling for classNames and styles.
54
58
  *
@@ -57,9 +61,6 @@ const BlockListBlockContext = (0, _element.createContext)();
57
61
  *
58
62
  * @return {Object} Merged props.
59
63
  */
60
-
61
- exports.BlockListBlockContext = BlockListBlockContext;
62
-
63
64
  function mergeWrapperProps(propsA, propsB) {
64
65
  const newProps = { ...propsA,
65
66
  ...propsB
@@ -116,28 +117,20 @@ function BlockListBlock(_ref2) {
116
117
  } = _ref2;
117
118
  const {
118
119
  themeSupportsLayout,
119
- hasContentLockedParent,
120
- isContentBlock,
121
- isContentLocking,
122
- isTemporarilyEditingAsBlocks
120
+ isTemporarilyEditingAsBlocks,
121
+ blockEditingMode
123
122
  } = (0, _data.useSelect)(select => {
124
123
  const {
125
124
  getSettings,
126
- __unstableGetContentLockingParent,
127
- getTemplateLock,
128
- __unstableGetTemporarilyEditingAsBlocks
129
- } = select(_store.store);
130
-
131
- const _hasContentLockedParent = !!__unstableGetContentLockingParent(clientId);
132
-
125
+ __unstableGetTemporarilyEditingAsBlocks,
126
+ getBlockEditingMode
127
+ } = (0, _lockUnlock.unlock)(select(_store.store));
133
128
  return {
134
129
  themeSupportsLayout: getSettings().supportsLayout,
135
- isContentBlock: select(_blocks.store).__experimentalHasContentRoleAttribute(name),
136
- hasContentLockedParent: _hasContentLockedParent,
137
- isContentLocking: getTemplateLock(clientId) === 'contentOnly' && !_hasContentLockedParent,
138
- isTemporarilyEditingAsBlocks: __unstableGetTemporarilyEditingAsBlocks() === clientId
130
+ isTemporarilyEditingAsBlocks: __unstableGetTemporarilyEditingAsBlocks() === clientId,
131
+ blockEditingMode: getBlockEditingMode(clientId)
139
132
  };
140
- }, [name, clientId]);
133
+ }, [clientId]);
141
134
  const {
142
135
  removeBlock
143
136
  } = (0, _data.useDispatch)(_store.store);
@@ -164,7 +157,7 @@ function BlockListBlock(_ref2) {
164
157
  });
165
158
  const blockType = (0, _blocks.getBlockType)(name);
166
159
 
167
- if (hasContentLockedParent && !isContentBlock) {
160
+ if (blockEditingMode === 'disabled') {
168
161
  wrapperProps = { ...wrapperProps,
169
162
  tabIndex: -1
170
163
  };
@@ -225,15 +218,14 @@ function BlockListBlock(_ref2) {
225
218
  const value = {
226
219
  clientId,
227
220
  className: (0, _classnames.default)({
228
- 'is-content-locked': isContentLocking,
229
- 'is-content-locked-temporarily-editing-as-blocks': isTemporarilyEditingAsBlocks,
230
- 'is-content-block': hasContentLockedParent && isContentBlock
221
+ 'is-editing-disabled': blockEditingMode === 'disabled',
222
+ 'is-content-locked-temporarily-editing-as-blocks': isTemporarilyEditingAsBlocks
231
223
  }, dataAlign && themeSupportsLayout && `align${dataAlign}`, className),
232
224
  wrapperProps: restWrapperProps,
233
225
  isAligned
234
226
  };
235
227
  const memoizedValue = (0, _element.useMemo)(() => value, Object.values(value));
236
- return (0, _element.createElement)(BlockListBlockContext.Provider, {
228
+ return (0, _element.createElement)(_blockListBlockContext.BlockListBlockContext.Provider, {
237
229
  value: memoizedValue
238
230
  }, (0, _element.createElement)(_blockCrashBoundary.default, {
239
231
  fallback: (0, _element.createElement)(Block, {
@@ -371,22 +363,22 @@ const applyWithDispatch = (0, _data.withDispatch)((dispatch, ownProps, registry)
371
363
  if (blockOrder.length === 1 && (0, _blocks.isUnmodifiedBlock)(getBlock(firstClientId))) {
372
364
  removeBlock(_clientId);
373
365
  } else {
374
- if (canInsertBlockType(getBlockName(firstClientId), targetRootClientId)) {
375
- moveBlocksToPosition([firstClientId], _clientId, targetRootClientId, getBlockIndex(_clientId));
376
- } else {
377
- const replacement = (0, _blocks.switchToBlockType)(getBlock(firstClientId), (0, _blocks.getDefaultBlockName)());
366
+ registry.batch(() => {
367
+ if (canInsertBlockType(getBlockName(firstClientId), targetRootClientId)) {
368
+ moveBlocksToPosition([firstClientId], _clientId, targetRootClientId, getBlockIndex(_clientId));
369
+ } else {
370
+ const replacement = (0, _blocks.switchToBlockType)(getBlock(firstClientId), (0, _blocks.getDefaultBlockName)());
378
371
 
379
- if (replacement && replacement.length) {
380
- registry.batch(() => {
372
+ if (replacement && replacement.length) {
381
373
  insertBlocks(replacement, getBlockIndex(_clientId), targetRootClientId, changeSelection);
382
374
  removeBlock(firstClientId, false);
383
- });
375
+ }
384
376
  }
385
- }
386
377
 
387
- if (!getBlockOrder(_clientId).length && (0, _blocks.isUnmodifiedBlock)(getBlock(_clientId))) {
388
- removeBlock(_clientId, false);
389
- }
378
+ if (!getBlockOrder(_clientId).length && (0, _blocks.isUnmodifiedBlock)(getBlock(_clientId))) {
379
+ removeBlock(_clientId, false);
380
+ }
381
+ });
390
382
  }
391
383
  } // For `Delete` or forward merge, we should do the exact same thing
392
384
  // as `Backspace`, but from the other block.