@wordpress/block-editor 14.6.0 → 14.7.1-next.082ed6819.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 (332) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/components/block-controls/slot.js +6 -3
  3. package/build/components/block-controls/slot.js.map +1 -1
  4. package/build/components/block-inspector/index.js +1 -2
  5. package/build/components/block-inspector/index.js.map +1 -1
  6. package/build/components/block-list/block.js +14 -28
  7. package/build/components/block-list/block.js.map +1 -1
  8. package/build/components/block-lock/modal.js +1 -1
  9. package/build/components/block-lock/modal.js.map +1 -1
  10. package/build/components/block-manager/category.js +79 -0
  11. package/build/components/block-manager/category.js.map +1 -0
  12. package/build/components/block-manager/checklist.js +40 -0
  13. package/build/components/block-manager/checklist.js.map +1 -0
  14. package/build/components/block-manager/index.js +108 -0
  15. package/build/components/block-manager/index.js.map +1 -0
  16. package/build/components/block-patterns-list/index.js +23 -26
  17. package/build/components/block-patterns-list/index.js.map +1 -1
  18. package/build/components/block-popover/index.js +1 -1
  19. package/build/components/block-popover/index.js.map +1 -1
  20. package/build/components/block-preview/async.js +51 -0
  21. package/build/components/block-preview/async.js.map +1 -0
  22. package/build/components/block-preview/index.js +4 -1
  23. package/build/components/block-preview/index.js.map +1 -1
  24. package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  25. package/build/components/block-settings-menu/index.js.map +1 -1
  26. package/build/components/block-toolbar/change-design.js +1 -4
  27. package/build/components/block-toolbar/change-design.js.map +1 -1
  28. package/build/components/block-toolbar/index.js +7 -2
  29. package/build/components/block-toolbar/index.js.map +1 -1
  30. package/build/components/block-toolbar/switch-section-style.js +105 -0
  31. package/build/components/block-toolbar/switch-section-style.js.map +1 -0
  32. package/build/components/block-tools/index.js +12 -9
  33. package/build/components/block-tools/index.js.map +1 -1
  34. package/build/components/block-tools/use-block-toolbar-popover-props.js +1 -1
  35. package/build/components/block-tools/use-block-toolbar-popover-props.js.map +1 -1
  36. package/build/components/block-tools/use-show-block-tools.js +4 -1
  37. package/build/components/block-tools/use-show-block-tools.js.map +1 -1
  38. package/build/components/collab/block-comment-icon-slot.js +2 -6
  39. package/build/components/collab/block-comment-icon-slot.js.map +1 -1
  40. package/build/components/collab/block-comment-icon-toolbar-slot.js +2 -6
  41. package/build/components/collab/block-comment-icon-toolbar-slot.js.map +1 -1
  42. package/build/components/color-palette/with-color-context.js +4 -2
  43. package/build/components/color-palette/with-color-context.js.map +1 -1
  44. package/build/components/font-family/index.js +14 -13
  45. package/build/components/font-family/index.js.map +1 -1
  46. package/build/components/global-styles/dimensions-panel.js +26 -14
  47. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  48. package/build/components/global-styles/use-global-styles-output.js +1 -1
  49. package/build/components/global-styles/use-global-styles-output.js.map +1 -1
  50. package/build/components/iframe/get-compatibility-styles.js +4 -4
  51. package/build/components/iframe/get-compatibility-styles.js.map +1 -1
  52. package/build/components/iframe/index.js +156 -23
  53. package/build/components/iframe/index.js.map +1 -1
  54. package/build/components/inserter/block-patterns-explorer/pattern-list.js +2 -2
  55. package/build/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
  56. package/build/components/inserter/block-patterns-tab/index.js +1 -2
  57. package/build/components/inserter/block-patterns-tab/index.js.map +1 -1
  58. package/build/components/inserter/block-patterns-tab/pattern-category-previews.js +4 -6
  59. package/build/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
  60. package/build/components/inserter/block-patterns-tab/use-pattern-categories.js +3 -0
  61. package/build/components/inserter/block-patterns-tab/use-pattern-categories.js.map +1 -1
  62. package/build/components/inserter/block-patterns-tab/utils.js +5 -1
  63. package/build/components/inserter/block-patterns-tab/utils.js.map +1 -1
  64. package/build/components/inserter/category-tabs/index.js +7 -8
  65. package/build/components/inserter/category-tabs/index.js.map +1 -1
  66. package/build/components/inserter/hooks/use-block-types-state.js +1 -1
  67. package/build/components/inserter/hooks/use-block-types-state.js.map +1 -1
  68. package/build/components/inserter/hooks/use-patterns-paging.js +0 -5
  69. package/build/components/inserter/hooks/use-patterns-paging.js.map +1 -1
  70. package/build/components/inserter/search-results.js +0 -2
  71. package/build/components/inserter/search-results.js.map +1 -1
  72. package/build/components/inserter-draggable-blocks/index.js +2 -1
  73. package/build/components/inserter-draggable-blocks/index.js.map +1 -1
  74. package/build/components/inspector-controls/slot.js +7 -4
  75. package/build/components/inspector-controls/slot.js.map +1 -1
  76. package/build/components/inspector-controls-tabs/position-controls-panel.js +1 -1
  77. package/build/components/inspector-controls-tabs/position-controls-panel.js.map +1 -1
  78. package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js +4 -4
  79. package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +1 -1
  80. package/build/components/media-placeholder/index.js +33 -25
  81. package/build/components/media-placeholder/index.js.map +1 -1
  82. package/build/components/rich-text/index.js +1 -1
  83. package/build/components/rich-text/index.js.map +1 -1
  84. package/build/components/tabbed-sidebar/index.js +1 -1
  85. package/build/components/tabbed-sidebar/index.js.map +1 -1
  86. package/build/components/url-input/index.js +3 -1
  87. package/build/components/url-input/index.js.map +1 -1
  88. package/build/components/use-block-commands/index.js +5 -6
  89. package/build/components/use-block-commands/index.js.map +1 -1
  90. package/build/hooks/border.js +3 -3
  91. package/build/hooks/border.js.map +1 -1
  92. package/build/hooks/color.js +1 -1
  93. package/build/hooks/color.js.map +1 -1
  94. package/build/hooks/dimensions.js +2 -2
  95. package/build/hooks/dimensions.js.map +1 -1
  96. package/build/hooks/font-family.js +1 -1
  97. package/build/hooks/font-family.js.map +1 -1
  98. package/build/hooks/style.js +6 -6
  99. package/build/hooks/style.js.map +1 -1
  100. package/build/hooks/supports.js +7 -7
  101. package/build/hooks/supports.js.map +1 -1
  102. package/build/hooks/typography.js +6 -6
  103. package/build/hooks/typography.js.map +1 -1
  104. package/build/hooks/utils.js +3 -3
  105. package/build/hooks/utils.js.map +1 -1
  106. package/build/layouts/flex.js +11 -9
  107. package/build/layouts/flex.js.map +1 -1
  108. package/build/lock-unlock.js.map +1 -1
  109. package/build/private-apis.js +4 -4
  110. package/build/private-apis.js.map +1 -1
  111. package/build/store/private-selectors.js +3 -3
  112. package/build/store/private-selectors.js.map +1 -1
  113. package/build/store/selectors.js +12 -8
  114. package/build/store/selectors.js.map +1 -1
  115. package/build/store/utils.js +5 -4
  116. package/build/store/utils.js.map +1 -1
  117. package/build/utils/dom.js +27 -22
  118. package/build/utils/dom.js.map +1 -1
  119. package/build-module/components/block-controls/slot.js +6 -3
  120. package/build-module/components/block-controls/slot.js.map +1 -1
  121. package/build-module/components/block-inspector/index.js +1 -2
  122. package/build-module/components/block-inspector/index.js.map +1 -1
  123. package/build-module/components/block-list/block.js +15 -27
  124. package/build-module/components/block-list/block.js.map +1 -1
  125. package/build-module/components/block-lock/modal.js +1 -1
  126. package/build-module/components/block-lock/modal.js.map +1 -1
  127. package/build-module/components/block-manager/category.js +71 -0
  128. package/build-module/components/block-manager/category.js.map +1 -0
  129. package/build-module/components/block-manager/checklist.js +32 -0
  130. package/build-module/components/block-manager/checklist.js.map +1 -0
  131. package/build-module/components/block-manager/index.js +102 -0
  132. package/build-module/components/block-manager/index.js.map +1 -0
  133. package/build-module/components/block-patterns-list/index.js +23 -26
  134. package/build-module/components/block-patterns-list/index.js.map +1 -1
  135. package/build-module/components/block-popover/index.js +2 -2
  136. package/build-module/components/block-popover/index.js.map +1 -1
  137. package/build-module/components/block-preview/async.js +44 -0
  138. package/build-module/components/block-preview/async.js.map +1 -0
  139. package/build-module/components/block-preview/index.js +4 -1
  140. package/build-module/components/block-preview/index.js.map +1 -1
  141. package/build-module/components/block-settings-menu/block-settings-dropdown.js +2 -2
  142. package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  143. package/build-module/components/block-settings-menu/index.js +2 -2
  144. package/build-module/components/block-settings-menu/index.js.map +1 -1
  145. package/build-module/components/block-toolbar/change-design.js +1 -4
  146. package/build-module/components/block-toolbar/change-design.js.map +1 -1
  147. package/build-module/components/block-toolbar/index.js +7 -2
  148. package/build-module/components/block-toolbar/index.js.map +1 -1
  149. package/build-module/components/block-toolbar/switch-section-style.js +97 -0
  150. package/build-module/components/block-toolbar/switch-section-style.js.map +1 -0
  151. package/build-module/components/block-tools/index.js +13 -10
  152. package/build-module/components/block-tools/index.js.map +1 -1
  153. package/build-module/components/block-tools/use-block-toolbar-popover-props.js +2 -2
  154. package/build-module/components/block-tools/use-block-toolbar-popover-props.js.map +1 -1
  155. package/build-module/components/block-tools/use-show-block-tools.js +4 -1
  156. package/build-module/components/block-tools/use-show-block-tools.js.map +1 -1
  157. package/build-module/components/collab/block-comment-icon-slot.js +2 -6
  158. package/build-module/components/collab/block-comment-icon-slot.js.map +1 -1
  159. package/build-module/components/collab/block-comment-icon-toolbar-slot.js +2 -6
  160. package/build-module/components/collab/block-comment-icon-toolbar-slot.js.map +1 -1
  161. package/build-module/components/color-palette/with-color-context.js +4 -2
  162. package/build-module/components/color-palette/with-color-context.js.map +1 -1
  163. package/build-module/components/font-family/index.js +15 -14
  164. package/build-module/components/font-family/index.js.map +1 -1
  165. package/build-module/components/global-styles/dimensions-panel.js +26 -14
  166. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  167. package/build-module/components/global-styles/use-global-styles-output.js +1 -1
  168. package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
  169. package/build-module/components/iframe/get-compatibility-styles.js +4 -4
  170. package/build-module/components/iframe/get-compatibility-styles.js.map +1 -1
  171. package/build-module/components/iframe/index.js +157 -24
  172. package/build-module/components/iframe/index.js.map +1 -1
  173. package/build-module/components/inserter/block-patterns-explorer/pattern-list.js +2 -2
  174. package/build-module/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
  175. package/build-module/components/inserter/block-patterns-tab/index.js +1 -2
  176. package/build-module/components/inserter/block-patterns-tab/index.js.map +1 -1
  177. package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js +5 -7
  178. package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
  179. package/build-module/components/inserter/block-patterns-tab/use-pattern-categories.js +4 -1
  180. package/build-module/components/inserter/block-patterns-tab/use-pattern-categories.js.map +1 -1
  181. package/build-module/components/inserter/block-patterns-tab/utils.js +4 -0
  182. package/build-module/components/inserter/block-patterns-tab/utils.js.map +1 -1
  183. package/build-module/components/inserter/category-tabs/index.js +8 -9
  184. package/build-module/components/inserter/category-tabs/index.js.map +1 -1
  185. package/build-module/components/inserter/hooks/use-block-types-state.js +1 -1
  186. package/build-module/components/inserter/hooks/use-block-types-state.js.map +1 -1
  187. package/build-module/components/inserter/hooks/use-patterns-paging.js +1 -6
  188. package/build-module/components/inserter/hooks/use-patterns-paging.js.map +1 -1
  189. package/build-module/components/inserter/search-results.js +0 -2
  190. package/build-module/components/inserter/search-results.js.map +1 -1
  191. package/build-module/components/inserter-draggable-blocks/index.js +2 -1
  192. package/build-module/components/inserter-draggable-blocks/index.js.map +1 -1
  193. package/build-module/components/inspector-controls/slot.js +7 -4
  194. package/build-module/components/inspector-controls/slot.js.map +1 -1
  195. package/build-module/components/inspector-controls-tabs/position-controls-panel.js +1 -1
  196. package/build-module/components/inspector-controls-tabs/position-controls-panel.js.map +1 -1
  197. package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js +4 -4
  198. package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +1 -1
  199. package/build-module/components/media-placeholder/index.js +33 -25
  200. package/build-module/components/media-placeholder/index.js.map +1 -1
  201. package/build-module/components/rich-text/index.js +1 -1
  202. package/build-module/components/rich-text/index.js.map +1 -1
  203. package/build-module/components/tabbed-sidebar/index.js +1 -1
  204. package/build-module/components/tabbed-sidebar/index.js.map +1 -1
  205. package/build-module/components/url-input/index.js +3 -1
  206. package/build-module/components/url-input/index.js.map +1 -1
  207. package/build-module/components/use-block-commands/index.js +4 -4
  208. package/build-module/components/use-block-commands/index.js.map +1 -1
  209. package/build-module/hooks/border.js +3 -3
  210. package/build-module/hooks/border.js.map +1 -1
  211. package/build-module/hooks/color.js +1 -1
  212. package/build-module/hooks/color.js.map +1 -1
  213. package/build-module/hooks/dimensions.js +2 -2
  214. package/build-module/hooks/dimensions.js.map +1 -1
  215. package/build-module/hooks/font-family.js +1 -1
  216. package/build-module/hooks/font-family.js.map +1 -1
  217. package/build-module/hooks/style.js +6 -6
  218. package/build-module/hooks/style.js.map +1 -1
  219. package/build-module/hooks/supports.js +7 -7
  220. package/build-module/hooks/supports.js.map +1 -1
  221. package/build-module/hooks/typography.js +6 -6
  222. package/build-module/hooks/typography.js.map +1 -1
  223. package/build-module/hooks/utils.js +3 -3
  224. package/build-module/hooks/utils.js.map +1 -1
  225. package/build-module/layouts/flex.js +11 -9
  226. package/build-module/layouts/flex.js.map +1 -1
  227. package/build-module/lock-unlock.js.map +1 -1
  228. package/build-module/private-apis.js +6 -6
  229. package/build-module/private-apis.js.map +1 -1
  230. package/build-module/store/private-selectors.js +3 -3
  231. package/build-module/store/private-selectors.js.map +1 -1
  232. package/build-module/store/selectors.js +12 -8
  233. package/build-module/store/selectors.js.map +1 -1
  234. package/build-module/store/utils.js +3 -3
  235. package/build-module/store/utils.js.map +1 -1
  236. package/build-module/utils/dom.js +25 -21
  237. package/build-module/utils/dom.js.map +1 -1
  238. package/build-style/content-rtl.css +30 -15
  239. package/build-style/content.css +30 -15
  240. package/build-style/style-rtl.css +92 -3
  241. package/build-style/style.css +92 -3
  242. package/build-types/utils/dom.d.ts +7 -9
  243. package/build-types/utils/dom.d.ts.map +1 -1
  244. package/package.json +32 -31
  245. package/src/components/block-canvas/style.scss +1 -1
  246. package/src/components/block-controls/slot.js +5 -3
  247. package/src/components/block-inspector/index.js +0 -2
  248. package/src/components/block-inspector/style.scss +2 -1
  249. package/src/components/block-list/block.js +28 -48
  250. package/src/components/block-lock/modal.js +1 -1
  251. package/src/components/block-manager/category.js +102 -0
  252. package/src/components/block-manager/checklist.js +34 -0
  253. package/src/components/block-manager/index.js +127 -0
  254. package/src/components/block-manager/style.scss +82 -0
  255. package/src/components/block-mover/README.md +15 -8
  256. package/src/components/block-mover/stories/index.story.js +73 -71
  257. package/src/components/block-mover/style.scss +3 -0
  258. package/src/components/block-patterns-list/README.md +8 -8
  259. package/src/components/block-patterns-list/index.js +35 -51
  260. package/src/components/block-patterns-list/stories/index.story.js +2 -19
  261. package/src/components/block-popover/index.js +4 -4
  262. package/src/components/block-preview/async.js +43 -0
  263. package/src/components/block-preview/index.js +6 -1
  264. package/src/components/block-settings-menu/block-settings-dropdown.js +2 -2
  265. package/src/components/block-settings-menu/index.js +2 -2
  266. package/src/components/block-toolbar/change-design.js +1 -7
  267. package/src/components/block-toolbar/index.js +6 -0
  268. package/src/components/block-toolbar/switch-section-style.js +115 -0
  269. package/src/components/block-tools/index.js +26 -10
  270. package/src/components/block-tools/style.scss +12 -0
  271. package/src/components/block-tools/use-block-toolbar-popover-props.js +2 -2
  272. package/src/components/block-tools/use-show-block-tools.js +3 -1
  273. package/src/components/collab/block-comment-icon-slot.js +2 -6
  274. package/src/components/collab/block-comment-icon-toolbar-slot.js +3 -5
  275. package/src/components/color-palette/with-color-context.js +25 -7
  276. package/src/components/default-block-appender/content.scss +13 -19
  277. package/src/components/font-family/index.js +13 -13
  278. package/src/components/global-styles/dimensions-panel.js +22 -16
  279. package/src/components/global-styles/test/use-global-styles-output.js +1 -1
  280. package/src/components/global-styles/use-global-styles-output.js +1 -1
  281. package/src/components/iframe/content.scss +16 -3
  282. package/src/components/iframe/get-compatibility-styles.js +4 -9
  283. package/src/components/iframe/index.js +204 -44
  284. package/src/components/inserter/block-patterns-explorer/pattern-list.js +3 -6
  285. package/src/components/inserter/block-patterns-tab/index.js +0 -1
  286. package/src/components/inserter/block-patterns-tab/pattern-category-previews.js +15 -17
  287. package/src/components/inserter/block-patterns-tab/use-pattern-categories.js +8 -0
  288. package/src/components/inserter/block-patterns-tab/utils.js +5 -0
  289. package/src/components/inserter/category-tabs/index.js +8 -9
  290. package/src/components/inserter/hooks/use-block-types-state.js +6 -1
  291. package/src/components/inserter/hooks/use-patterns-paging.js +1 -6
  292. package/src/components/inserter/search-results.js +0 -6
  293. package/src/components/inserter-draggable-blocks/index.js +10 -1
  294. package/src/components/inspector-controls/README.md +2 -0
  295. package/src/components/inspector-controls/slot.js +6 -4
  296. package/src/components/inspector-controls-tabs/position-controls-panel.js +1 -3
  297. package/src/components/inspector-controls-tabs/use-inspector-controls-tabs.js +10 -10
  298. package/src/components/media-placeholder/index.js +41 -37
  299. package/src/components/provider/test/use-block-sync.js +3 -1
  300. package/src/components/rich-text/content.scss +15 -10
  301. package/src/components/rich-text/index.js +8 -1
  302. package/src/components/tabbed-sidebar/index.js +1 -1
  303. package/src/components/tabbed-sidebar/style.scss +1 -1
  304. package/src/components/url-input/index.js +3 -4
  305. package/src/components/use-block-commands/index.js +245 -234
  306. package/src/hooks/border.js +3 -9
  307. package/src/hooks/color.js +1 -1
  308. package/src/hooks/dimensions.js +2 -2
  309. package/src/hooks/font-family.js +1 -1
  310. package/src/hooks/style.js +6 -12
  311. package/src/hooks/supports.js +7 -7
  312. package/src/hooks/test/style.js +1 -2
  313. package/src/hooks/typography.js +6 -6
  314. package/src/hooks/utils.js +8 -3
  315. package/src/layouts/flex.js +26 -18
  316. package/src/private-apis.js +6 -6
  317. package/src/store/private-selectors.js +6 -7
  318. package/src/store/selectors.js +60 -45
  319. package/src/store/test/private-selectors.js +5 -0
  320. package/src/store/test/selectors.js +87 -58
  321. package/src/store/utils.js +12 -11
  322. package/src/style.scss +1 -0
  323. package/src/utils/dom.js +26 -21
  324. package/src/utils/test/dom.js +224 -0
  325. package/tsconfig.json +1 -0
  326. package/tsconfig.tsbuildinfo +1 -1
  327. package/build/components/block-info-slot-fill/index.js +0 -39
  328. package/build/components/block-info-slot-fill/index.js.map +0 -1
  329. package/build-module/components/block-info-slot-fill/index.js +0 -32
  330. package/build-module/components/block-info-slot-fill/index.js.map +0 -1
  331. package/src/components/block-info-slot-fill/index.js +0 -27
  332. /package/src/{lock-unlock.js → lock-unlock.ts} +0 -0
@@ -36,20 +36,18 @@ export function getBlockClientId(node: Node | null): string | undefined;
36
36
  */
37
37
  export function rectUnion(rect1: DOMRect, rect2: DOMRect): DOMRect;
38
38
  /**
39
- * Returns the rect of the element including all visible nested elements.
40
- *
41
- * Visible nested elements, including elements that overflow the parent, are
42
- * taken into account.
43
- *
44
- * This function is useful for calculating the visible area of a block that
45
- * contains nested elements that overflow the block, e.g. the Navigation block,
46
- * which can contain overflowing Submenu blocks.
39
+ * Returns the bounding rectangle of an element, with special handling for blocks
40
+ * that have visible overflowing children (defined in WITH_OVERFLOW_ELEMENT_BLOCKS).
47
41
  *
42
+ * For blocks like Navigation that can have overflowing elements (e.g. submenus),
43
+ * this function calculates the combined bounds of both the parent and its visible
44
+ * children. The returned rect may extend beyond the viewport.
48
45
  * The returned rect represents the full extent of the element and its visible
49
46
  * children, which may extend beyond the viewport.
50
47
  *
51
48
  * @param {Element} element Element.
52
49
  * @return {DOMRect} Bounding client rect of the element and its visible children.
53
50
  */
54
- export function getVisibleElementBounds(element: Element): DOMRect;
51
+ export function getElementBounds(element: Element): DOMRect;
52
+ export const WITH_OVERFLOW_ELEMENT_BLOCKS: string[];
55
53
  //# sourceMappingURL=dom.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"dom.d.ts","sourceRoot":"","sources":["../../src/utils/dom.js"],"names":[],"mappings":"AAIA;;;;;;;GAOG;AACH,iCALW,OAAO,KACP,OAAO,GAEN,OAAO,CAIlB;AAED;;;;;;;;;GASG;AACH,gDANW,OAAO,WACP,OAAO,GAEN,OAAO,CAQlB;AAED;;;;;;;GAOG;AACH,uCALW,IAAI,OAAC,GAEJ,MAAM,GAAC,SAAS,CAoB3B;AAED;;;;;;GAMG;AACH,iCAJW,OAAO,SACP,OAAO,GACN,OAAO,CASlB;AA8DD;;;;;;;;;;;;;;;GAeG;AACH,iDAHW,OAAO,GACN,OAAO,CA6ClB"}
1
+ {"version":3,"file":"dom.d.ts","sourceRoot":"","sources":["../../src/utils/dom.js"],"names":[],"mappings":"AAIA;;;;;;;GAOG;AACH,iCALW,OAAO,KACP,OAAO,GAEN,OAAO,CAIlB;AAED;;;;;;;;;GASG;AACH,gDANW,OAAO,WACP,OAAO,GAEN,OAAO,CAQlB;AAED;;;;;;;GAOG;AACH,uCALW,IAAI,OAAC,GAEJ,MAAM,GAAC,SAAS,CAoB3B;AAED;;;;;;GAMG;AACH,iCAJW,OAAO,SACP,OAAO,GACN,OAAO,CASlB;AA+DD;;;;;;;;;;;;GAYG;AACH,0CAHW,OAAO,GACN,OAAO,CAoDlB;AAhED,oDAAkE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/block-editor",
3
- "version": "14.6.0",
3
+ "version": "14.7.1-next.082ed6819.0",
4
4
  "description": "Generic block editor.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -26,6 +26,7 @@
26
26
  "main": "build/index.js",
27
27
  "module": "build-module/index.js",
28
28
  "react-native": "src/index",
29
+ "wpScript": true,
29
30
  "sideEffects": [
30
31
  "build-style/**",
31
32
  "src/**/*.scss",
@@ -36,36 +37,37 @@
36
37
  "@emotion/react": "^11.7.1",
37
38
  "@emotion/styled": "^11.6.0",
38
39
  "@react-spring/web": "^9.4.5",
39
- "@wordpress/a11y": "*",
40
- "@wordpress/api-fetch": "*",
41
- "@wordpress/blob": "*",
42
- "@wordpress/block-serialization-default-parser": "*",
43
- "@wordpress/blocks": "*",
44
- "@wordpress/commands": "*",
40
+ "@wordpress/a11y": "^4.12.1-next.082ed6819.0",
41
+ "@wordpress/api-fetch": "^7.12.1-next.082ed6819.0",
42
+ "@wordpress/blob": "^4.12.1-next.082ed6819.0",
43
+ "@wordpress/block-serialization-default-parser": "^5.12.1-next.082ed6819.0",
44
+ "@wordpress/blocks": "^14.1.1-next.082ed6819.0",
45
+ "@wordpress/commands": "^1.12.1-next.082ed6819.0",
45
46
  "@wordpress/components": "*",
46
- "@wordpress/compose": "*",
47
+ "@wordpress/compose": "^7.12.1-next.082ed6819.0",
47
48
  "@wordpress/data": "*",
48
- "@wordpress/date": "*",
49
- "@wordpress/deprecated": "*",
50
- "@wordpress/dom": "*",
51
- "@wordpress/element": "*",
52
- "@wordpress/escape-html": "*",
53
- "@wordpress/hooks": "*",
54
- "@wordpress/html-entities": "*",
55
- "@wordpress/i18n": "*",
56
- "@wordpress/icons": "*",
57
- "@wordpress/is-shallow-equal": "*",
58
- "@wordpress/keyboard-shortcuts": "*",
59
- "@wordpress/keycodes": "*",
60
- "@wordpress/notices": "*",
61
- "@wordpress/preferences": "*",
62
- "@wordpress/private-apis": "*",
63
- "@wordpress/rich-text": "*",
64
- "@wordpress/style-engine": "*",
65
- "@wordpress/token-list": "*",
66
- "@wordpress/url": "*",
67
- "@wordpress/warning": "*",
68
- "@wordpress/wordcount": "*",
49
+ "@wordpress/date": "^5.12.1-next.082ed6819.0",
50
+ "@wordpress/deprecated": "^4.12.1-next.082ed6819.0",
51
+ "@wordpress/dom": "^4.12.1-next.082ed6819.0",
52
+ "@wordpress/element": "^6.12.1-next.082ed6819.0",
53
+ "@wordpress/escape-html": "^3.12.1-next.082ed6819.0",
54
+ "@wordpress/hooks": "^4.12.1-next.082ed6819.0",
55
+ "@wordpress/html-entities": "^4.12.1-next.082ed6819.0",
56
+ "@wordpress/i18n": "^5.12.1-next.082ed6819.0",
57
+ "@wordpress/icons": "^10.12.1-next.082ed6819.0",
58
+ "@wordpress/is-shallow-equal": "^5.12.1-next.082ed6819.0",
59
+ "@wordpress/keyboard-shortcuts": "^5.12.1-next.082ed6819.0",
60
+ "@wordpress/keycodes": "^4.12.1-next.082ed6819.0",
61
+ "@wordpress/notices": "^5.12.1-next.082ed6819.0",
62
+ "@wordpress/preferences": "^4.12.1-next.082ed6819.0",
63
+ "@wordpress/priority-queue": "^3.12.1-next.082ed6819.0",
64
+ "@wordpress/private-apis": "^1.12.1-next.082ed6819.0",
65
+ "@wordpress/rich-text": "^7.12.1-next.082ed6819.0",
66
+ "@wordpress/style-engine": "^2.12.1-next.082ed6819.0",
67
+ "@wordpress/token-list": "^3.12.1-next.082ed6819.0",
68
+ "@wordpress/url": "^4.12.1-next.082ed6819.0",
69
+ "@wordpress/warning": "^3.12.1-next.082ed6819.0",
70
+ "@wordpress/wordcount": "^4.12.1-next.082ed6819.0",
69
71
  "change-case": "^4.1.2",
70
72
  "clsx": "^2.1.1",
71
73
  "colord": "^2.7.0",
@@ -88,6 +90,5 @@
88
90
  "publishConfig": {
89
91
  "access": "public"
90
92
  },
91
- "wpScript": true,
92
- "gitHead": "dcf4613b33b0eda14e203ac30f700ed0db70347f"
93
+ "gitHead": "2bb7bad15ddb8e88210fab7d4a1ef1565466e424"
93
94
  }
@@ -3,7 +3,7 @@ iframe[name="editor-canvas"] {
3
3
  width: 100%;
4
4
  height: 100%;
5
5
  display: block;
6
- background-color: transparent;
7
6
  // Handles transitions between device previews
8
7
  @include editor-canvas-resize-animation;
8
+ background-color: $gray-300;
9
9
  }
@@ -31,9 +31,10 @@ export default function BlockControlsSlot( { group = 'default', ...props } ) {
31
31
  [ toolbarState, contextState ]
32
32
  );
33
33
 
34
- const Slot = groups[ group ]?.Slot;
35
- const fills = useSlotFills( Slot?.__unstableName );
36
- if ( ! Slot ) {
34
+ const slotFill = groups[ group ];
35
+ const fills = useSlotFills( slotFill.name );
36
+
37
+ if ( ! slotFill ) {
37
38
  warning( `Unknown BlockControls group "${ group }" provided.` );
38
39
  return null;
39
40
  }
@@ -42,6 +43,7 @@ export default function BlockControlsSlot( { group = 'default', ...props } ) {
42
43
  return null;
43
44
  }
44
45
 
46
+ const { Slot } = slotFill;
45
47
  const slot = <Slot { ...props } bubblesVirtually fillProps={ fillProps } />;
46
48
 
47
49
  if ( group === 'default' ) {
@@ -26,7 +26,6 @@ import useInspectorControlsTabs from '../inspector-controls-tabs/use-inspector-c
26
26
  import AdvancedControls from '../inspector-controls-tabs/advanced-controls-panel';
27
27
  import PositionControls from '../inspector-controls-tabs/position-controls-panel';
28
28
  import useBlockInspectorAnimationSettings from './useBlockInspectorAnimationSettings';
29
- import BlockInfo from '../block-info-slot-fill';
30
29
  import BlockQuickNavigation from '../block-quick-navigation';
31
30
  import { useBorderPanelLabel } from '../../hooks/border';
32
31
 
@@ -253,7 +252,6 @@ const BlockInspectorSingleBlock = ( {
253
252
  className={ blockInformation.isSynced && 'is-synced' }
254
253
  />
255
254
  <BlockVariationTransforms blockClientId={ clientId } />
256
- <BlockInfo.Slot />
257
255
  { showTabs && (
258
256
  <InspectorControlsTabs
259
257
  hasBlockStyles={ hasBlockStyles }
@@ -10,7 +10,8 @@
10
10
  margin-bottom: 1.5em;
11
11
  }
12
12
 
13
- .components-base-control {
13
+ .components-base-control,
14
+ .components-radio-control {
14
15
  &:where(:not(:last-child)) {
15
16
  margin-bottom: $grid-unit-20;
16
17
  }
@@ -24,8 +24,8 @@ import {
24
24
  isReusableBlock,
25
25
  getBlockDefaultClassName,
26
26
  hasBlockSupport,
27
+ createBlock,
27
28
  store as blocksStore,
28
- privateApis as blocksPrivateApis,
29
29
  } from '@wordpress/blocks';
30
30
  import { withFilters } from '@wordpress/components';
31
31
  import { withDispatch, useDispatch, useSelect } from '@wordpress/data';
@@ -47,8 +47,6 @@ import { PrivateBlockContext } from './private-block-context';
47
47
 
48
48
  import { unlock } from '../../lock-unlock';
49
49
 
50
- const { isUnmodifiedBlockContent } = unlock( blocksPrivateApis );
51
-
52
50
  /**
53
51
  * Merges wrapper props with special handling for classNames and styles.
54
52
  *
@@ -313,6 +311,7 @@ const applyWithDispatch = withDispatch( ( dispatch, ownProps, registry ) => {
313
311
  function switchToDefaultOrRemove() {
314
312
  const block = getBlock( clientId );
315
313
  const defaultBlockName = getDefaultBlockName();
314
+ const defaultBlockType = getBlockType( defaultBlockName );
316
315
  if ( getBlockName( clientId ) !== defaultBlockName ) {
317
316
  const replacement = switchToBlockType(
318
317
  block,
@@ -329,6 +328,15 @@ const applyWithDispatch = withDispatch( ( dispatch, ownProps, registry ) => {
329
328
  selectBlock( nextBlockClientId );
330
329
  } );
331
330
  }
331
+ } else if ( defaultBlockType.merge ) {
332
+ const attributes = defaultBlockType.merge(
333
+ {},
334
+ block.attributes
335
+ );
336
+ replaceBlocks(
337
+ [ clientId ],
338
+ [ createBlock( defaultBlockName, attributes ) ]
339
+ );
332
340
  }
333
341
  }
334
342
 
@@ -342,6 +350,9 @@ const applyWithDispatch = withDispatch( ( dispatch, ownProps, registry ) => {
342
350
  * to the moved block.
343
351
  */
344
352
  function moveFirstItemUp( _clientId, changeSelection = true ) {
353
+ const wrapperBlockName = getBlockName( _clientId );
354
+ const wrapperBlockType = getBlockType( wrapperBlockName );
355
+ const isTextualWrapper = wrapperBlockType.category === 'text';
345
356
  const targetRootClientId = getBlockRootClientId( _clientId );
346
357
  const blockOrder = getBlockOrder( _clientId );
347
358
  const [ firstClientId ] = blockOrder;
@@ -351,50 +362,14 @@ const applyWithDispatch = withDispatch( ( dispatch, ownProps, registry ) => {
351
362
  isUnmodifiedBlock( getBlock( firstClientId ) )
352
363
  ) {
353
364
  removeBlock( _clientId );
354
- } else {
365
+ } else if ( isTextualWrapper ) {
355
366
  registry.batch( () => {
356
- const firstBlock = getBlock( firstClientId );
357
- const isFirstBlockContentUnmodified =
358
- isUnmodifiedBlockContent( firstBlock );
359
- const defaultBlockName = getDefaultBlockName();
360
- const replacement = switchToBlockType(
361
- firstBlock,
362
- defaultBlockName
363
- );
364
- const canTransformToDefaultBlock =
365
- !! replacement?.length &&
366
- replacement.every( ( block ) =>
367
- canInsertBlockType( block.name, _clientId )
368
- );
369
-
370
367
  if (
371
- isFirstBlockContentUnmodified &&
372
- canTransformToDefaultBlock
373
- ) {
374
- // Step 1: If the block is empty and can be transformed to the default block type.
375
- replaceBlocks(
376
- firstClientId,
377
- replacement,
378
- changeSelection
379
- );
380
- } else if (
381
- isFirstBlockContentUnmodified &&
382
- firstBlock.name === defaultBlockName
383
- ) {
384
- // Step 2: If the block is empty and is already the default block type.
385
- removeBlock( firstClientId );
386
- const nextBlockClientId =
387
- getNextBlockClientId( clientId );
388
- if ( nextBlockClientId ) {
389
- selectBlock( nextBlockClientId );
390
- }
391
- } else if (
392
368
  canInsertBlockType(
393
- firstBlock.name,
369
+ getBlockName( firstClientId ),
394
370
  targetRootClientId
395
371
  )
396
372
  ) {
397
- // Step 3: If the block can be moved up.
398
373
  moveBlocksToPosition(
399
374
  [ firstClientId ],
400
375
  _clientId,
@@ -402,17 +377,21 @@ const applyWithDispatch = withDispatch( ( dispatch, ownProps, registry ) => {
402
377
  getBlockIndex( _clientId )
403
378
  );
404
379
  } else {
405
- const canLiftAndTransformToDefaultBlock =
406
- !! replacement?.length &&
380
+ const replacement = switchToBlockType(
381
+ getBlock( firstClientId ),
382
+ getDefaultBlockName()
383
+ );
384
+
385
+ if (
386
+ replacement &&
387
+ replacement.length &&
407
388
  replacement.every( ( block ) =>
408
389
  canInsertBlockType(
409
390
  block.name,
410
391
  targetRootClientId
411
392
  )
412
- );
413
-
414
- if ( canLiftAndTransformToDefaultBlock ) {
415
- // Step 4: If the block can be transformed to the default block type and moved up.
393
+ )
394
+ ) {
416
395
  insertBlocks(
417
396
  replacement,
418
397
  getBlockIndex( _clientId ),
@@ -421,7 +400,6 @@ const applyWithDispatch = withDispatch( ( dispatch, ownProps, registry ) => {
421
400
  );
422
401
  removeBlock( firstClientId, false );
423
402
  } else {
424
- // Step 5: Continue the default behavior.
425
403
  switchToDefaultOrRemove();
426
404
  }
427
405
  }
@@ -433,6 +411,8 @@ const applyWithDispatch = withDispatch( ( dispatch, ownProps, registry ) => {
433
411
  removeBlock( _clientId, false );
434
412
  }
435
413
  } );
414
+ } else {
415
+ switchToDefaultOrRemove();
436
416
  }
437
417
  }
438
418
 
@@ -24,7 +24,7 @@ import useBlockDisplayInformation from '../use-block-display-information';
24
24
  import { store as blockEditorStore } from '../../store';
25
25
 
26
26
  // Entity based blocks which allow edit locking
27
- const ALLOWS_EDIT_LOCKING = [ 'core/block', 'core/navigation' ];
27
+ const ALLOWS_EDIT_LOCKING = [ 'core/navigation' ];
28
28
 
29
29
  function getTemplateLockValue( lock ) {
30
30
  // Prevents all operations.
@@ -0,0 +1,102 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { useCallback } from '@wordpress/element';
5
+ import { useInstanceId } from '@wordpress/compose';
6
+ import { CheckboxControl } from '@wordpress/components';
7
+
8
+ /**
9
+ * Internal dependencies
10
+ */
11
+ import BlockTypesChecklist from './checklist';
12
+
13
+ function BlockManagerCategory( {
14
+ title,
15
+ blockTypes,
16
+ selectedBlockTypes,
17
+ onChange,
18
+ } ) {
19
+ const instanceId = useInstanceId( BlockManagerCategory );
20
+
21
+ const toggleVisible = useCallback(
22
+ ( blockType, nextIsChecked ) => {
23
+ if ( nextIsChecked ) {
24
+ onChange( [ ...selectedBlockTypes, blockType ] );
25
+ } else {
26
+ onChange(
27
+ selectedBlockTypes.filter(
28
+ ( { name } ) => name !== blockType.name
29
+ )
30
+ );
31
+ }
32
+ },
33
+ [ selectedBlockTypes, onChange ]
34
+ );
35
+
36
+ const toggleAllVisible = useCallback(
37
+ ( nextIsChecked ) => {
38
+ if ( nextIsChecked ) {
39
+ onChange( [
40
+ ...selectedBlockTypes,
41
+ ...blockTypes.filter(
42
+ ( blockType ) =>
43
+ ! selectedBlockTypes.find(
44
+ ( { name } ) => name === blockType.name
45
+ )
46
+ ),
47
+ ] );
48
+ } else {
49
+ onChange(
50
+ selectedBlockTypes.filter(
51
+ ( selectedBlockType ) =>
52
+ ! blockTypes.find(
53
+ ( { name } ) => name === selectedBlockType.name
54
+ )
55
+ )
56
+ );
57
+ }
58
+ },
59
+ [ blockTypes, selectedBlockTypes, onChange ]
60
+ );
61
+
62
+ if ( ! blockTypes.length ) {
63
+ return null;
64
+ }
65
+
66
+ const checkedBlockNames = blockTypes
67
+ .map( ( { name } ) => name )
68
+ .filter( ( type ) =>
69
+ ( selectedBlockTypes ?? [] ).some(
70
+ ( selectedBlockType ) => selectedBlockType.name === type
71
+ )
72
+ );
73
+
74
+ const titleId = 'block-editor-block-manager__category-title-' + instanceId;
75
+
76
+ const isAllChecked = checkedBlockNames.length === blockTypes.length;
77
+ const isIndeterminate = ! isAllChecked && checkedBlockNames.length > 0;
78
+
79
+ return (
80
+ <div
81
+ role="group"
82
+ aria-labelledby={ titleId }
83
+ className="block-editor-block-manager__category"
84
+ >
85
+ <CheckboxControl
86
+ __nextHasNoMarginBottom
87
+ checked={ isAllChecked }
88
+ onChange={ toggleAllVisible }
89
+ className="block-editor-block-manager__category-title"
90
+ indeterminate={ isIndeterminate }
91
+ label={ <span id={ titleId }>{ title }</span> }
92
+ />
93
+ <BlockTypesChecklist
94
+ blockTypes={ blockTypes }
95
+ value={ checkedBlockNames }
96
+ onItemChange={ toggleVisible }
97
+ />
98
+ </div>
99
+ );
100
+ }
101
+
102
+ export default BlockManagerCategory;
@@ -0,0 +1,34 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { CheckboxControl } from '@wordpress/components';
5
+
6
+ /**
7
+ * Internal dependencies
8
+ */
9
+ import BlockIcon from '../block-icon';
10
+
11
+ function BlockTypesChecklist( { blockTypes, value, onItemChange } ) {
12
+ return (
13
+ <ul className="block-editor-block-manager__checklist">
14
+ { blockTypes.map( ( blockType ) => (
15
+ <li
16
+ key={ blockType.name }
17
+ className="block-editor-block-manager__checklist-item"
18
+ >
19
+ <CheckboxControl
20
+ __nextHasNoMarginBottom
21
+ label={ blockType.title }
22
+ checked={ value.includes( blockType.name ) }
23
+ onChange={ ( ...args ) =>
24
+ onItemChange( blockType, ...args )
25
+ }
26
+ />
27
+ <BlockIcon icon={ blockType.icon } />
28
+ </li>
29
+ ) ) }
30
+ </ul>
31
+ );
32
+ }
33
+
34
+ export default BlockTypesChecklist;
@@ -0,0 +1,127 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { store as blocksStore } from '@wordpress/blocks';
5
+ import { useSelect } from '@wordpress/data';
6
+ import { SearchControl, Button } from '@wordpress/components';
7
+ import { __, _n, sprintf } from '@wordpress/i18n';
8
+ import { useEffect, useState } from '@wordpress/element';
9
+ import { useDebounce } from '@wordpress/compose';
10
+ import { speak } from '@wordpress/a11y';
11
+
12
+ /**
13
+ * Internal dependencies
14
+ */
15
+ import BlockManagerCategory from './category';
16
+
17
+ /**
18
+ * Provides a list of blocks with checkboxes.
19
+ *
20
+ * @param {Object} props Props.
21
+ * @param {Array} props.blockTypes An array of blocks.
22
+ * @param {Array} props.selectedBlockTypes An array of selected blocks.
23
+ * @param {Function} props.onChange Function to be called when the selected blocks change.
24
+ */
25
+ export default function BlockManager( {
26
+ blockTypes,
27
+ selectedBlockTypes,
28
+ onChange,
29
+ } ) {
30
+ const debouncedSpeak = useDebounce( speak, 500 );
31
+ const [ search, setSearch ] = useState( '' );
32
+ const { categories, isMatchingSearchTerm } = useSelect( ( select ) => {
33
+ return {
34
+ categories: select( blocksStore ).getCategories(),
35
+ isMatchingSearchTerm: select( blocksStore ).isMatchingSearchTerm,
36
+ };
37
+ }, [] );
38
+
39
+ function enableAllBlockTypes() {
40
+ onChange( blockTypes );
41
+ }
42
+
43
+ const filteredBlockTypes = blockTypes.filter( ( blockType ) => {
44
+ return ! search || isMatchingSearchTerm( blockType, search );
45
+ } );
46
+
47
+ const numberOfHiddenBlocks = blockTypes.length - selectedBlockTypes.length;
48
+
49
+ // Announce search results on change
50
+ useEffect( () => {
51
+ if ( ! search ) {
52
+ return;
53
+ }
54
+ const count = filteredBlockTypes.length;
55
+ const resultsFoundMessage = sprintf(
56
+ /* translators: %d: number of results. */
57
+ _n( '%d result found.', '%d results found.', count ),
58
+ count
59
+ );
60
+ debouncedSpeak( resultsFoundMessage );
61
+ }, [ filteredBlockTypes?.length, search, debouncedSpeak ] );
62
+
63
+ return (
64
+ <div className="block-editor-block-manager__content">
65
+ { !! numberOfHiddenBlocks && (
66
+ <div className="block-editor-block-manager__disabled-blocks-count">
67
+ { sprintf(
68
+ /* translators: %d: number of blocks. */
69
+ _n(
70
+ '%d block is hidden.',
71
+ '%d blocks are hidden.',
72
+ numberOfHiddenBlocks
73
+ ),
74
+ numberOfHiddenBlocks
75
+ ) }
76
+ <Button
77
+ __next40pxDefaultSize
78
+ variant="link"
79
+ onClick={ enableAllBlockTypes }
80
+ >
81
+ { __( 'Reset' ) }
82
+ </Button>
83
+ </div>
84
+ ) }
85
+ <SearchControl
86
+ __nextHasNoMarginBottom
87
+ label={ __( 'Search for a block' ) }
88
+ placeholder={ __( 'Search for a block' ) }
89
+ value={ search }
90
+ onChange={ ( nextSearch ) => setSearch( nextSearch ) }
91
+ className="block-editor-block-manager__search"
92
+ />
93
+ <div
94
+ tabIndex="0"
95
+ role="region"
96
+ aria-label={ __( 'Available block types' ) }
97
+ className="block-editor-block-manager__results"
98
+ >
99
+ { filteredBlockTypes.length === 0 && (
100
+ <p className="block-editor-block-manager__no-results">
101
+ { __( 'No blocks found.' ) }
102
+ </p>
103
+ ) }
104
+ { categories.map( ( category ) => (
105
+ <BlockManagerCategory
106
+ key={ category.slug }
107
+ title={ category.title }
108
+ blockTypes={ filteredBlockTypes.filter(
109
+ ( blockType ) =>
110
+ blockType.category === category.slug
111
+ ) }
112
+ selectedBlockTypes={ selectedBlockTypes }
113
+ onChange={ onChange }
114
+ />
115
+ ) ) }
116
+ <BlockManagerCategory
117
+ title={ __( 'Uncategorized' ) }
118
+ blockTypes={ filteredBlockTypes.filter(
119
+ ( { category } ) => ! category
120
+ ) }
121
+ selectedBlockTypes={ selectedBlockTypes }
122
+ onChange={ onChange }
123
+ />
124
+ </div>
125
+ </div>
126
+ );
127
+ }