@wordpress/block-editor 14.3.3 → 14.4.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 (418) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/README.md +46 -0
  3. package/build/autocompleters/link.js +2 -1
  4. package/build/autocompleters/link.js.map +1 -1
  5. package/build/components/block-actions/index.js +1 -13
  6. package/build/components/block-actions/index.js.map +1 -1
  7. package/build/components/block-inspector/index.js +56 -75
  8. package/build/components/block-inspector/index.js.map +1 -1
  9. package/build/components/block-list/block.js +5 -19
  10. package/build/components/block-list/block.js.map +1 -1
  11. package/build/components/block-list/index.js +5 -8
  12. package/build/components/block-list/index.js.map +1 -1
  13. package/build/components/block-list/use-block-props/index.js +3 -11
  14. package/build/components/block-list/use-block-props/index.js.map +1 -1
  15. package/build/components/block-list/use-block-props/use-zoom-out-mode-exit.js +9 -12
  16. package/build/components/block-list/use-block-props/use-zoom-out-mode-exit.js.map +1 -1
  17. package/build/components/block-list/use-in-between-inserter.js +5 -3
  18. package/build/components/block-list/use-in-between-inserter.js.map +1 -1
  19. package/build/components/block-list/zoom-out-separator.js +14 -6
  20. package/build/components/block-list/zoom-out-separator.js.map +1 -1
  21. package/build/components/block-navigation/dropdown.js +2 -4
  22. package/build/components/block-navigation/dropdown.js.map +1 -1
  23. package/build/components/block-parent-selector/index.js +13 -10
  24. package/build/components/block-parent-selector/index.js.map +1 -1
  25. package/build/components/block-pattern-setup/setup-toolbar.js +10 -20
  26. package/build/components/block-pattern-setup/setup-toolbar.js.map +1 -1
  27. package/build/components/block-patterns-paging/index.js +11 -13
  28. package/build/components/block-patterns-paging/index.js.map +1 -1
  29. package/build/components/block-quick-navigation/index.js +2 -4
  30. package/build/components/block-quick-navigation/index.js.map +1 -1
  31. package/build/components/block-settings-menu/block-settings-dropdown.js +79 -76
  32. package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  33. package/build/components/block-settings-menu-controls/index.js +1 -6
  34. package/build/components/block-settings-menu-controls/index.js.map +1 -1
  35. package/build/components/block-switcher/index.js +17 -14
  36. package/build/components/block-switcher/index.js.map +1 -1
  37. package/build/components/block-toolbar/index.js +16 -19
  38. package/build/components/block-toolbar/index.js.map +1 -1
  39. package/build/components/block-toolbar/use-has-block-toolbar.js +3 -5
  40. package/build/components/block-toolbar/use-has-block-toolbar.js.map +1 -1
  41. package/build/components/block-tools/index.js +8 -11
  42. package/build/components/block-tools/index.js.map +1 -1
  43. package/build/components/block-tools/insertion-point.js +1 -4
  44. package/build/components/block-tools/insertion-point.js.map +1 -1
  45. package/build/components/block-tools/use-show-block-tools.js +2 -5
  46. package/build/components/block-tools/use-show-block-tools.js.map +1 -1
  47. package/build/components/block-tools/zoom-out-mode-inserter-button.js +1 -12
  48. package/build/components/block-tools/zoom-out-mode-inserter-button.js.map +1 -1
  49. package/build/components/block-tools/zoom-out-mode-inserters.js +14 -17
  50. package/build/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
  51. package/build/components/block-tools/zoom-out-toolbar.js +2 -12
  52. package/build/components/block-tools/zoom-out-toolbar.js.map +1 -1
  53. package/build/components/block-variation-picker/index.js +2 -4
  54. package/build/components/block-variation-picker/index.js.map +1 -1
  55. package/build/components/block-variation-transforms/index.js +3 -4
  56. package/build/components/block-variation-transforms/index.js.map +1 -1
  57. package/build/components/button-block-appender/index.js +2 -4
  58. package/build/components/button-block-appender/index.js.map +1 -1
  59. package/build/components/colors-gradients/dropdown.js +2 -4
  60. package/build/components/colors-gradients/dropdown.js.map +1 -1
  61. package/build/components/global-styles/border-panel.js +1 -1
  62. package/build/components/global-styles/border-panel.js.map +1 -1
  63. package/build/components/global-styles/color-panel.js +2 -4
  64. package/build/components/global-styles/color-panel.js.map +1 -1
  65. package/build/components/global-styles/dimensions-panel.js +3 -3
  66. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  67. package/build/components/global-styles/filters-panel.js +2 -4
  68. package/build/components/global-styles/filters-panel.js.map +1 -1
  69. package/build/components/global-styles/shadow-panel-components.js +24 -29
  70. package/build/components/global-styles/shadow-panel-components.js.map +1 -1
  71. package/build/components/inner-blocks/index.js +1 -9
  72. package/build/components/inner-blocks/index.js.map +1 -1
  73. package/build/components/inserter/block-types-tab.js +1 -1
  74. package/build/components/inserter/block-types-tab.js.map +1 -1
  75. package/build/components/inserter/hooks/use-block-types-state.js +24 -5
  76. package/build/components/inserter/hooks/use-block-types-state.js.map +1 -1
  77. package/build/components/inserter/hooks/use-insertion-point.js +22 -12
  78. package/build/components/inserter/hooks/use-insertion-point.js.map +1 -1
  79. package/build/components/inserter/hooks/use-patterns-state.js +23 -10
  80. package/build/components/inserter/hooks/use-patterns-state.js.map +1 -1
  81. package/build/components/inserter/media-tab/media-preview.js +35 -13
  82. package/build/components/inserter/media-tab/media-preview.js.map +1 -1
  83. package/build/components/inserter/menu.js +2 -2
  84. package/build/components/inserter/menu.js.map +1 -1
  85. package/build/components/inserter/mobile-tab-navigation.js +5 -5
  86. package/build/components/inserter/mobile-tab-navigation.js.map +1 -1
  87. package/build/components/inserter/quick-inserter.js +4 -4
  88. package/build/components/inserter/quick-inserter.js.map +1 -1
  89. package/build/components/inspector-controls-tabs/index.js +11 -8
  90. package/build/components/inspector-controls-tabs/index.js.map +1 -1
  91. package/build/components/inspector-popover-header/index.js +4 -8
  92. package/build/components/inspector-popover-header/index.js.map +1 -1
  93. package/build/components/link-control/index.js +5 -10
  94. package/build/components/link-control/index.js.map +1 -1
  95. package/build/components/link-control/settings-drawer.js +2 -4
  96. package/build/components/link-control/settings-drawer.js.map +1 -1
  97. package/build/components/list-view/block-contents.js +1 -25
  98. package/build/components/list-view/block-contents.js.map +1 -1
  99. package/build/components/list-view/block-select-button.js +1 -4
  100. package/build/components/list-view/block-select-button.js.map +1 -1
  101. package/build/components/media-placeholder/index.js +29 -43
  102. package/build/components/media-placeholder/index.js.map +1 -1
  103. package/build/components/rich-text/index.js +4 -8
  104. package/build/components/rich-text/index.js.map +1 -1
  105. package/build/components/skip-to-selected-block/index.js +2 -4
  106. package/build/components/skip-to-selected-block/index.js.map +1 -1
  107. package/build/components/tool-selector/index.js +13 -12
  108. package/build/components/tool-selector/index.js.map +1 -1
  109. package/build/components/url-input/button.js +14 -16
  110. package/build/components/url-input/button.js.map +1 -1
  111. package/build/components/url-input/index.js +2 -4
  112. package/build/components/url-input/index.js.map +1 -1
  113. package/build/components/use-block-commands/index.js +0 -61
  114. package/build/components/use-block-commands/index.js.map +1 -1
  115. package/build/components/writing-flow/use-tab-nav.js +2 -25
  116. package/build/components/writing-flow/use-tab-nav.js.map +1 -1
  117. package/build/hooks/block-bindings.js +6 -13
  118. package/build/hooks/block-bindings.js.map +1 -1
  119. package/build/hooks/duotone.js +4 -1
  120. package/build/hooks/duotone.js.map +1 -1
  121. package/build/hooks/layout-child.js +3 -1
  122. package/build/hooks/layout-child.js.map +1 -1
  123. package/build/hooks/position.js +3 -2
  124. package/build/hooks/position.js.map +1 -1
  125. package/build/hooks/use-bindings-attributes.js +5 -4
  126. package/build/hooks/use-bindings-attributes.js.map +1 -1
  127. package/build/layouts/flex.js +6 -38
  128. package/build/layouts/flex.js.map +1 -1
  129. package/build/private-apis.js +0 -2
  130. package/build/private-apis.js.map +1 -1
  131. package/build/store/actions.js +13 -14
  132. package/build/store/actions.js.map +1 -1
  133. package/build/store/private-actions.js +15 -0
  134. package/build/store/private-actions.js.map +1 -1
  135. package/build/store/private-selectors.js +104 -7
  136. package/build/store/private-selectors.js.map +1 -1
  137. package/build/store/reducer.js +22 -26
  138. package/build/store/reducer.js.map +1 -1
  139. package/build/store/selectors.js +127 -56
  140. package/build/store/selectors.js.map +1 -1
  141. package/build/store/utils.js +4 -3
  142. package/build/store/utils.js.map +1 -1
  143. package/build/utils/block-bindings.js +50 -0
  144. package/build/utils/block-bindings.js.map +1 -1
  145. package/build/utils/index.js +7 -0
  146. package/build/utils/index.js.map +1 -1
  147. package/build-module/autocompleters/link.js +2 -1
  148. package/build-module/autocompleters/link.js.map +1 -1
  149. package/build-module/components/block-actions/index.js +1 -13
  150. package/build-module/components/block-actions/index.js.map +1 -1
  151. package/build-module/components/block-inspector/index.js +57 -76
  152. package/build-module/components/block-inspector/index.js.map +1 -1
  153. package/build-module/components/block-list/block.js +5 -19
  154. package/build-module/components/block-list/block.js.map +1 -1
  155. package/build-module/components/block-list/index.js +5 -8
  156. package/build-module/components/block-list/index.js.map +1 -1
  157. package/build-module/components/block-list/use-block-props/index.js +3 -11
  158. package/build-module/components/block-list/use-block-props/index.js.map +1 -1
  159. package/build-module/components/block-list/use-block-props/use-zoom-out-mode-exit.js +9 -12
  160. package/build-module/components/block-list/use-block-props/use-zoom-out-mode-exit.js.map +1 -1
  161. package/build-module/components/block-list/use-in-between-inserter.js +5 -3
  162. package/build-module/components/block-list/use-in-between-inserter.js.map +1 -1
  163. package/build-module/components/block-list/zoom-out-separator.js +14 -6
  164. package/build-module/components/block-list/zoom-out-separator.js.map +1 -1
  165. package/build-module/components/block-navigation/dropdown.js +2 -4
  166. package/build-module/components/block-navigation/dropdown.js.map +1 -1
  167. package/build-module/components/block-parent-selector/index.js +13 -10
  168. package/build-module/components/block-parent-selector/index.js.map +1 -1
  169. package/build-module/components/block-pattern-setup/setup-toolbar.js +10 -20
  170. package/build-module/components/block-pattern-setup/setup-toolbar.js.map +1 -1
  171. package/build-module/components/block-patterns-paging/index.js +11 -13
  172. package/build-module/components/block-patterns-paging/index.js.map +1 -1
  173. package/build-module/components/block-quick-navigation/index.js +2 -4
  174. package/build-module/components/block-quick-navigation/index.js.map +1 -1
  175. package/build-module/components/block-settings-menu/block-settings-dropdown.js +79 -76
  176. package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  177. package/build-module/components/block-settings-menu-controls/index.js +2 -7
  178. package/build-module/components/block-settings-menu-controls/index.js.map +1 -1
  179. package/build-module/components/block-switcher/index.js +17 -14
  180. package/build-module/components/block-switcher/index.js.map +1 -1
  181. package/build-module/components/block-toolbar/index.js +17 -20
  182. package/build-module/components/block-toolbar/index.js.map +1 -1
  183. package/build-module/components/block-toolbar/use-has-block-toolbar.js +3 -5
  184. package/build-module/components/block-toolbar/use-has-block-toolbar.js.map +1 -1
  185. package/build-module/components/block-tools/index.js +8 -11
  186. package/build-module/components/block-tools/index.js.map +1 -1
  187. package/build-module/components/block-tools/insertion-point.js +1 -4
  188. package/build-module/components/block-tools/insertion-point.js.map +1 -1
  189. package/build-module/components/block-tools/use-show-block-tools.js +2 -5
  190. package/build-module/components/block-tools/use-show-block-tools.js.map +1 -1
  191. package/build-module/components/block-tools/zoom-out-mode-inserter-button.js +1 -12
  192. package/build-module/components/block-tools/zoom-out-mode-inserter-button.js.map +1 -1
  193. package/build-module/components/block-tools/zoom-out-mode-inserters.js +14 -17
  194. package/build-module/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
  195. package/build-module/components/block-tools/zoom-out-toolbar.js +2 -12
  196. package/build-module/components/block-tools/zoom-out-toolbar.js.map +1 -1
  197. package/build-module/components/block-variation-picker/index.js +2 -4
  198. package/build-module/components/block-variation-picker/index.js.map +1 -1
  199. package/build-module/components/block-variation-transforms/index.js +3 -4
  200. package/build-module/components/block-variation-transforms/index.js.map +1 -1
  201. package/build-module/components/button-block-appender/index.js +2 -4
  202. package/build-module/components/button-block-appender/index.js.map +1 -1
  203. package/build-module/components/colors-gradients/dropdown.js +2 -4
  204. package/build-module/components/colors-gradients/dropdown.js.map +1 -1
  205. package/build-module/components/global-styles/border-panel.js +1 -1
  206. package/build-module/components/global-styles/border-panel.js.map +1 -1
  207. package/build-module/components/global-styles/color-panel.js +2 -4
  208. package/build-module/components/global-styles/color-panel.js.map +1 -1
  209. package/build-module/components/global-styles/dimensions-panel.js +1 -1
  210. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  211. package/build-module/components/global-styles/filters-panel.js +2 -4
  212. package/build-module/components/global-styles/filters-panel.js.map +1 -1
  213. package/build-module/components/global-styles/shadow-panel-components.js +25 -30
  214. package/build-module/components/global-styles/shadow-panel-components.js.map +1 -1
  215. package/build-module/components/inner-blocks/index.js +1 -9
  216. package/build-module/components/inner-blocks/index.js.map +1 -1
  217. package/build-module/components/inserter/block-types-tab.js +1 -1
  218. package/build-module/components/inserter/block-types-tab.js.map +1 -1
  219. package/build-module/components/inserter/hooks/use-block-types-state.js +27 -8
  220. package/build-module/components/inserter/hooks/use-block-types-state.js.map +1 -1
  221. package/build-module/components/inserter/hooks/use-insertion-point.js +22 -12
  222. package/build-module/components/inserter/hooks/use-insertion-point.js.map +1 -1
  223. package/build-module/components/inserter/hooks/use-patterns-state.js +23 -10
  224. package/build-module/components/inserter/hooks/use-patterns-state.js.map +1 -1
  225. package/build-module/components/inserter/media-tab/media-preview.js +35 -13
  226. package/build-module/components/inserter/media-tab/media-preview.js.map +1 -1
  227. package/build-module/components/inserter/menu.js +2 -2
  228. package/build-module/components/inserter/menu.js.map +1 -1
  229. package/build-module/components/inserter/mobile-tab-navigation.js +6 -6
  230. package/build-module/components/inserter/mobile-tab-navigation.js.map +1 -1
  231. package/build-module/components/inserter/quick-inserter.js +4 -4
  232. package/build-module/components/inserter/quick-inserter.js.map +1 -1
  233. package/build-module/components/inspector-controls-tabs/index.js +12 -9
  234. package/build-module/components/inspector-controls-tabs/index.js.map +1 -1
  235. package/build-module/components/inspector-popover-header/index.js +4 -8
  236. package/build-module/components/inspector-popover-header/index.js.map +1 -1
  237. package/build-module/components/link-control/index.js +5 -10
  238. package/build-module/components/link-control/index.js.map +1 -1
  239. package/build-module/components/link-control/settings-drawer.js +2 -4
  240. package/build-module/components/link-control/settings-drawer.js.map +1 -1
  241. package/build-module/components/list-view/block-contents.js +1 -25
  242. package/build-module/components/list-view/block-contents.js.map +1 -1
  243. package/build-module/components/list-view/block-select-button.js +2 -5
  244. package/build-module/components/list-view/block-select-button.js.map +1 -1
  245. package/build-module/components/media-placeholder/index.js +30 -44
  246. package/build-module/components/media-placeholder/index.js.map +1 -1
  247. package/build-module/components/rich-text/index.js +4 -8
  248. package/build-module/components/rich-text/index.js.map +1 -1
  249. package/build-module/components/skip-to-selected-block/index.js +2 -4
  250. package/build-module/components/skip-to-selected-block/index.js.map +1 -1
  251. package/build-module/components/tool-selector/index.js +13 -12
  252. package/build-module/components/tool-selector/index.js.map +1 -1
  253. package/build-module/components/url-input/button.js +15 -17
  254. package/build-module/components/url-input/button.js.map +1 -1
  255. package/build-module/components/url-input/index.js +2 -4
  256. package/build-module/components/url-input/index.js.map +1 -1
  257. package/build-module/components/use-block-commands/index.js +1 -62
  258. package/build-module/components/use-block-commands/index.js.map +1 -1
  259. package/build-module/components/writing-flow/use-tab-nav.js +3 -26
  260. package/build-module/components/writing-flow/use-tab-nav.js.map +1 -1
  261. package/build-module/hooks/block-bindings.js +6 -13
  262. package/build-module/hooks/block-bindings.js.map +1 -1
  263. package/build-module/hooks/duotone.js +4 -1
  264. package/build-module/hooks/duotone.js.map +1 -1
  265. package/build-module/hooks/layout-child.js +4 -1
  266. package/build-module/hooks/layout-child.js.map +1 -1
  267. package/build-module/hooks/position.js +4 -1
  268. package/build-module/hooks/position.js.map +1 -1
  269. package/build-module/hooks/use-bindings-attributes.js +5 -4
  270. package/build-module/hooks/use-bindings-attributes.js.map +1 -1
  271. package/build-module/layouts/flex.js +7 -39
  272. package/build-module/layouts/flex.js.map +1 -1
  273. package/build-module/private-apis.js +0 -2
  274. package/build-module/private-apis.js.map +1 -1
  275. package/build-module/store/actions.js +12 -12
  276. package/build-module/store/actions.js.map +1 -1
  277. package/build-module/store/private-actions.js +14 -0
  278. package/build-module/store/private-actions.js.map +1 -1
  279. package/build-module/store/private-selectors.js +98 -7
  280. package/build-module/store/private-selectors.js.map +1 -1
  281. package/build-module/store/reducer.js +21 -25
  282. package/build-module/store/reducer.js.map +1 -1
  283. package/build-module/store/selectors.js +129 -58
  284. package/build-module/store/selectors.js.map +1 -1
  285. package/build-module/store/utils.js +3 -2
  286. package/build-module/store/utils.js.map +1 -1
  287. package/build-module/utils/block-bindings.js +50 -0
  288. package/build-module/utils/block-bindings.js.map +1 -1
  289. package/build-module/utils/index.js +1 -0
  290. package/build-module/utils/index.js.map +1 -1
  291. package/build-style/content-rtl.css +16 -70
  292. package/build-style/content.css +16 -70
  293. package/build-style/default-editor-styles-rtl.css +10 -1
  294. package/build-style/default-editor-styles.css +10 -1
  295. package/build-style/style-rtl.css +51 -149
  296. package/build-style/style.css +51 -149
  297. package/package.json +32 -32
  298. package/src/autocompleters/link.js +2 -1
  299. package/src/components/block-actions/index.js +1 -13
  300. package/src/components/block-draggable/style.scss +2 -2
  301. package/src/components/block-inspector/index.js +79 -95
  302. package/src/components/block-inspector/style.scss +2 -0
  303. package/src/components/block-list/block.js +7 -28
  304. package/src/components/block-list/content.scss +1 -61
  305. package/src/components/block-list/index.js +21 -29
  306. package/src/components/block-list/use-block-props/index.js +3 -10
  307. package/src/components/block-list/use-block-props/use-zoom-out-mode-exit.js +19 -11
  308. package/src/components/block-list/use-in-between-inserter.js +5 -2
  309. package/src/components/block-list/zoom-out-separator.js +24 -8
  310. package/src/components/block-navigation/dropdown.js +1 -2
  311. package/src/components/block-parent-selector/index.js +13 -10
  312. package/src/components/block-pattern-setup/setup-toolbar.js +5 -10
  313. package/src/components/block-patterns-paging/index.js +8 -7
  314. package/src/components/block-patterns-paging/style.scss +10 -27
  315. package/src/components/block-quick-navigation/index.js +1 -2
  316. package/src/components/block-settings-menu/block-settings-dropdown.js +120 -106
  317. package/src/components/block-settings-menu-controls/index.js +0 -15
  318. package/src/components/block-switcher/index.js +37 -30
  319. package/src/components/block-toolbar/index.js +22 -34
  320. package/src/components/block-toolbar/style.scss +10 -1
  321. package/src/components/block-toolbar/use-has-block-toolbar.js +19 -31
  322. package/src/components/block-tools/index.js +7 -16
  323. package/src/components/block-tools/insertion-point.js +1 -4
  324. package/src/components/block-tools/style.scss +3 -88
  325. package/src/components/block-tools/use-show-block-tools.js +2 -12
  326. package/src/components/block-tools/zoom-out-mode-inserter-button.js +2 -17
  327. package/src/components/block-tools/zoom-out-mode-inserters.js +11 -19
  328. package/src/components/block-tools/zoom-out-toolbar.js +2 -13
  329. package/src/components/block-variation-picker/index.js +1 -2
  330. package/src/components/block-variation-transforms/index.js +2 -2
  331. package/src/components/button-block-appender/content.scss +0 -5
  332. package/src/components/button-block-appender/index.js +1 -2
  333. package/src/components/colors-gradients/dropdown.js +1 -5
  334. package/src/components/font-family/README.md +5 -1
  335. package/src/components/global-styles/border-panel.js +1 -1
  336. package/src/components/global-styles/color-panel.js +1 -5
  337. package/src/components/global-styles/dimensions-panel.js +1 -1
  338. package/src/components/global-styles/filters-panel.js +1 -2
  339. package/src/components/global-styles/shadow-panel-components.js +28 -33
  340. package/src/components/global-styles/style.scss +5 -0
  341. package/src/components/inner-blocks/index.js +1 -16
  342. package/src/components/inserter/block-types-tab.js +1 -1
  343. package/src/components/inserter/hooks/use-block-types-state.js +34 -14
  344. package/src/components/inserter/hooks/use-insertion-point.js +35 -13
  345. package/src/components/inserter/hooks/use-patterns-state.js +46 -9
  346. package/src/components/inserter/media-tab/media-preview.js +38 -12
  347. package/src/components/inserter/menu.js +2 -2
  348. package/src/components/inserter/mobile-tab-navigation.js +10 -13
  349. package/src/components/inserter/quick-inserter.js +5 -4
  350. package/src/components/inserter/style.scss +0 -28
  351. package/src/components/inspector-controls-tabs/index.js +21 -20
  352. package/src/components/inspector-controls-tabs/style.scss +2 -6
  353. package/src/components/inspector-popover-header/index.js +2 -4
  354. package/src/components/inspector-popover-header/style.scss +0 -13
  355. package/src/components/link-control/index.js +2 -5
  356. package/src/components/link-control/settings-drawer.js +1 -2
  357. package/src/components/list-view/block-contents.js +1 -28
  358. package/src/components/list-view/block-select-button.js +2 -5
  359. package/src/components/list-view/style.scss +18 -14
  360. package/src/components/media-placeholder/content.scss +3 -19
  361. package/src/components/media-placeholder/index.js +23 -29
  362. package/src/components/rich-text/index.js +4 -13
  363. package/src/components/skip-to-selected-block/index.js +1 -2
  364. package/src/components/skip-to-selected-block/style.scss +0 -9
  365. package/src/components/tool-selector/index.js +14 -9
  366. package/src/components/tool-selector/style.scss +5 -0
  367. package/src/components/url-input/button.js +16 -12
  368. package/src/components/url-input/index.js +1 -2
  369. package/src/components/url-input/style.scss +0 -6
  370. package/src/components/use-block-commands/index.js +0 -58
  371. package/src/components/writing-flow/use-tab-nav.js +4 -36
  372. package/src/content.scss +0 -1
  373. package/src/hooks/block-bindings.js +9 -10
  374. package/src/hooks/duotone.js +4 -1
  375. package/src/hooks/layout-child.js +4 -1
  376. package/src/hooks/position.js +4 -1
  377. package/src/hooks/use-bindings-attributes.js +66 -63
  378. package/src/layouts/flex.js +10 -53
  379. package/src/private-apis.js +0 -2
  380. package/src/store/actions.js +14 -13
  381. package/src/store/private-actions.js +14 -0
  382. package/src/store/private-selectors.js +120 -16
  383. package/src/store/reducer.js +22 -28
  384. package/src/store/selectors.js +203 -114
  385. package/src/store/test/private-actions.js +15 -0
  386. package/src/store/test/private-selectors.js +34 -0
  387. package/src/store/test/reducer.js +40 -4
  388. package/src/store/test/selectors.js +183 -20
  389. package/src/store/utils.js +4 -2
  390. package/src/utils/block-bindings.js +49 -0
  391. package/src/utils/index.js +1 -0
  392. package/build/components/block-controls/use-has-block-controls.js +0 -43
  393. package/build/components/block-controls/use-has-block-controls.js.map +0 -1
  394. package/build/components/block-list/use-block-props/use-nav-mode-exit.js +0 -54
  395. package/build/components/block-list/use-block-props/use-nav-mode-exit.js.map +0 -1
  396. package/build/components/block-tools/block-selection-button.js +0 -259
  397. package/build/components/block-tools/block-selection-button.js.map +0 -1
  398. package/build/components/block-tools/block-toolbar-breadcrumb.js +0 -57
  399. package/build/components/block-tools/block-toolbar-breadcrumb.js.map +0 -1
  400. package/build/components/inserter/tabs.js +0 -78
  401. package/build/components/inserter/tabs.js.map +0 -1
  402. package/build-module/components/block-controls/use-has-block-controls.js +0 -34
  403. package/build-module/components/block-controls/use-has-block-controls.js.map +0 -1
  404. package/build-module/components/block-list/use-block-props/use-nav-mode-exit.js +0 -48
  405. package/build-module/components/block-list/use-block-props/use-nav-mode-exit.js.map +0 -1
  406. package/build-module/components/block-tools/block-selection-button.js +0 -254
  407. package/build-module/components/block-tools/block-selection-button.js.map +0 -1
  408. package/build-module/components/block-tools/block-toolbar-breadcrumb.js +0 -49
  409. package/build-module/components/block-tools/block-toolbar-breadcrumb.js.map +0 -1
  410. package/build-module/components/inserter/tabs.js +0 -72
  411. package/build-module/components/inserter/tabs.js.map +0 -1
  412. package/src/components/block-controls/use-has-block-controls.js +0 -35
  413. package/src/components/block-list/use-block-props/use-nav-mode-exit.js +0 -46
  414. package/src/components/block-tools/block-selection-button.js +0 -302
  415. package/src/components/block-tools/block-toolbar-breadcrumb.js +0 -51
  416. package/src/components/inner-blocks/content.scss +0 -13
  417. package/src/components/inserter/tabs.js +0 -78
  418. package/src/components/inserter/test/block-types-tab.native.js +0 -67
@@ -10,7 +10,8 @@ import { parse as grammarParse } from '@wordpress/block-serialization-default-pa
10
10
  import { selectBlockPatternsKey } from './private-keys';
11
11
  import { unlock } from '../lock-unlock';
12
12
  import { STORE_NAME } from './constants';
13
- export const withRootClientIdOptionKey = Symbol('withRootClientId');
13
+ import { getSectionRootClientId } from './private-selectors';
14
+ export const isFiltered = Symbol('isFiltered');
14
15
  const parsedPatternCache = new WeakMap();
15
16
  const grammarMapCache = new WeakMap();
16
17
  function parsePattern(pattern) {
@@ -87,6 +88,6 @@ export const getAllPatternsDependants = select => state => {
87
88
  return [state.settings.__experimentalBlockPatterns, state.settings.__experimentalUserPatternCategories, state.settings.__experimentalReusableBlocks, state.settings[selectBlockPatternsKey]?.(select), state.blockPatterns, unlock(select(STORE_NAME)).getReusableBlocks()];
88
89
  };
89
90
  export function getInsertBlockTypeDependants(state, rootClientId) {
90
- return [state.blockListSettings[rootClientId], state.blocks.byClientId.get(rootClientId), state.settings.allowedBlockTypes, state.settings.templateLock, state.blockEditingModes];
91
+ return [state.blockListSettings[rootClientId], state.blocks.byClientId.get(rootClientId), state.settings.allowedBlockTypes, state.settings.templateLock, state.blockEditingModes, state.editorMode, getSectionRootClientId(state)];
91
92
  }
92
93
  //# sourceMappingURL=utils.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["parse","grammarParse","selectBlockPatternsKey","unlock","STORE_NAME","withRootClientIdOptionKey","Symbol","parsedPatternCache","WeakMap","grammarMapCache","parsePattern","pattern","blocks","content","__unstableSkipMigrationLogs","length","attributes","metadata","categories","patternName","name","title","getParsedPattern","parsedPattern","get","set","getGrammar","grammarMap","filter","block","blockName","checkAllowList","list","item","defaultResult","Array","isArray","includes","checkAllowListRecursive","allowedBlockTypes","blocksQueue","shift","isAllowed","innerBlocks","forEach","innerBlock","push","getAllPatternsDependants","select","state","settings","__experimentalBlockPatterns","__experimentalUserPatternCategories","__experimentalReusableBlocks","blockPatterns","getReusableBlocks","getInsertBlockTypeDependants","rootClientId","blockListSettings","byClientId","templateLock","blockEditingModes"],"sources":["@wordpress/block-editor/src/store/utils.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { parse } from '@wordpress/blocks';\nimport { parse as grammarParse } from '@wordpress/block-serialization-default-parser';\n\n/**\n * Internal dependencies\n */\nimport { selectBlockPatternsKey } from './private-keys';\nimport { unlock } from '../lock-unlock';\nimport { STORE_NAME } from './constants';\n\nexport const withRootClientIdOptionKey = Symbol( 'withRootClientId' );\n\nconst parsedPatternCache = new WeakMap();\nconst grammarMapCache = new WeakMap();\n\nfunction parsePattern( pattern ) {\n\tconst blocks = parse( pattern.content, {\n\t\t__unstableSkipMigrationLogs: true,\n\t} );\n\tif ( blocks.length === 1 ) {\n\t\tblocks[ 0 ].attributes = {\n\t\t\t...blocks[ 0 ].attributes,\n\t\t\tmetadata: {\n\t\t\t\t...( blocks[ 0 ].attributes.metadata || {} ),\n\t\t\t\tcategories: pattern.categories,\n\t\t\t\tpatternName: pattern.name,\n\t\t\t\tname: blocks[ 0 ].attributes.metadata?.name || pattern.title,\n\t\t\t},\n\t\t};\n\t}\n\treturn {\n\t\t...pattern,\n\t\tblocks,\n\t};\n}\n\nexport function getParsedPattern( pattern ) {\n\tlet parsedPattern = parsedPatternCache.get( pattern );\n\tif ( ! parsedPattern ) {\n\t\tparsedPattern = parsePattern( pattern );\n\t\tparsedPatternCache.set( pattern, parsedPattern );\n\t}\n\treturn parsedPattern;\n}\n\nexport function getGrammar( pattern ) {\n\tlet grammarMap = grammarMapCache.get( pattern );\n\tif ( ! grammarMap ) {\n\t\tgrammarMap = grammarParse( pattern.content );\n\t\t// Block names are null only at the top level for whitespace.\n\t\tgrammarMap = grammarMap.filter( ( block ) => block.blockName !== null );\n\t\tgrammarMapCache.set( pattern, grammarMap );\n\t}\n\treturn grammarMap;\n}\n\nexport const checkAllowList = ( list, item, defaultResult = null ) => {\n\tif ( typeof list === 'boolean' ) {\n\t\treturn list;\n\t}\n\tif ( Array.isArray( list ) ) {\n\t\t// TODO: when there is a canonical way to detect that we are editing a post\n\t\t// the following check should be changed to something like:\n\t\t// if ( list.includes( 'core/post-content' ) && getEditorMode() === 'post-content' && item === null )\n\t\tif ( list.includes( 'core/post-content' ) && item === null ) {\n\t\t\treturn true;\n\t\t}\n\t\treturn list.includes( item );\n\t}\n\treturn defaultResult;\n};\n\nexport const checkAllowListRecursive = ( blocks, allowedBlockTypes ) => {\n\tif ( typeof allowedBlockTypes === 'boolean' ) {\n\t\treturn allowedBlockTypes;\n\t}\n\n\tconst blocksQueue = [ ...blocks ];\n\twhile ( blocksQueue.length > 0 ) {\n\t\tconst block = blocksQueue.shift();\n\n\t\tconst isAllowed = checkAllowList(\n\t\t\tallowedBlockTypes,\n\t\t\tblock.name || block.blockName,\n\t\t\ttrue\n\t\t);\n\t\tif ( ! isAllowed ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tblock.innerBlocks?.forEach( ( innerBlock ) => {\n\t\t\tblocksQueue.push( innerBlock );\n\t\t} );\n\t}\n\n\treturn true;\n};\n\nexport const getAllPatternsDependants = ( select ) => ( state ) => {\n\treturn [\n\t\tstate.settings.__experimentalBlockPatterns,\n\t\tstate.settings.__experimentalUserPatternCategories,\n\t\tstate.settings.__experimentalReusableBlocks,\n\t\tstate.settings[ selectBlockPatternsKey ]?.( select ),\n\t\tstate.blockPatterns,\n\t\tunlock( select( STORE_NAME ) ).getReusableBlocks(),\n\t];\n};\n\nexport function getInsertBlockTypeDependants( state, rootClientId ) {\n\treturn [\n\t\tstate.blockListSettings[ rootClientId ],\n\t\tstate.blocks.byClientId.get( rootClientId ),\n\t\tstate.settings.allowedBlockTypes,\n\t\tstate.settings.templateLock,\n\t\tstate.blockEditingModes,\n\t];\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,KAAK,QAAQ,mBAAmB;AACzC,SAASA,KAAK,IAAIC,YAAY,QAAQ,+CAA+C;;AAErF;AACA;AACA;AACA,SAASC,sBAAsB,QAAQ,gBAAgB;AACvD,SAASC,MAAM,QAAQ,gBAAgB;AACvC,SAASC,UAAU,QAAQ,aAAa;AAExC,OAAO,MAAMC,yBAAyB,GAAGC,MAAM,CAAE,kBAAmB,CAAC;AAErE,MAAMC,kBAAkB,GAAG,IAAIC,OAAO,CAAC,CAAC;AACxC,MAAMC,eAAe,GAAG,IAAID,OAAO,CAAC,CAAC;AAErC,SAASE,YAAYA,CAAEC,OAAO,EAAG;EAChC,MAAMC,MAAM,GAAGZ,KAAK,CAAEW,OAAO,CAACE,OAAO,EAAE;IACtCC,2BAA2B,EAAE;EAC9B,CAAE,CAAC;EACH,IAAKF,MAAM,CAACG,MAAM,KAAK,CAAC,EAAG;IAC1BH,MAAM,CAAE,CAAC,CAAE,CAACI,UAAU,GAAG;MACxB,GAAGJ,MAAM,CAAE,CAAC,CAAE,CAACI,UAAU;MACzBC,QAAQ,EAAE;QACT,IAAKL,MAAM,CAAE,CAAC,CAAE,CAACI,UAAU,CAACC,QAAQ,IAAI,CAAC,CAAC,CAAE;QAC5CC,UAAU,EAAEP,OAAO,CAACO,UAAU;QAC9BC,WAAW,EAAER,OAAO,CAACS,IAAI;QACzBA,IAAI,EAA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C,GAAG,CAAEiC,YAAa,CAAC,EAC3CR,KAAK,CAACC,QAAQ,CAACX,iBAAiB,EAChCU,KAAK,CAACC,QAAQ,CAACU,YAAY,EAC3BX,KAAK,CAACY,iBAAiB,CACvB;AACF","ignoreList":[]}
1
+ {"version":3,"names":["parse","grammarParse","selectBlockPatternsKey","unlock","STORE_NAME","getSectionRootClientId","isFiltered","Symbol","parsedPatternCache","WeakMap","grammarMapCache","parsePattern","pattern","blocks","content","__unstableSkipMigrationLogs","length","attributes","metadata","categories","patternName","name","title","getParsedPattern","parsedPattern","get","set","getGrammar","grammarMap","filter","block","blockName","checkAllowList","list","item","defaultResult","Array","isArray","includes","checkAllowListRecursive","allowedBlockTypes","blocksQueue","shift","isAllowed","innerBlocks","forEach","innerBlock","push","getAllPatternsDependants","select","state","settings","__experimentalBlockPatterns","__experimentalUserPatternCategories","__experimentalReusableBlocks","blockPatterns","getReusableBlocks","getInsertBlockTypeDependants","rootClientId","blockListSettings","byClientId","templateLock","blockEditingModes","editorMode"],"sources":["@wordpress/block-editor/src/store/utils.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { parse } from '@wordpress/blocks';\nimport { parse as grammarParse } from '@wordpress/block-serialization-default-parser';\n\n/**\n * Internal dependencies\n */\nimport { selectBlockPatternsKey } from './private-keys';\nimport { unlock } from '../lock-unlock';\nimport { STORE_NAME } from './constants';\nimport { getSectionRootClientId } from './private-selectors';\n\nexport const isFiltered = Symbol( 'isFiltered' );\nconst parsedPatternCache = new WeakMap();\nconst grammarMapCache = new WeakMap();\n\nfunction parsePattern( pattern ) {\n\tconst blocks = parse( pattern.content, {\n\t\t__unstableSkipMigrationLogs: true,\n\t} );\n\tif ( blocks.length === 1 ) {\n\t\tblocks[ 0 ].attributes = {\n\t\t\t...blocks[ 0 ].attributes,\n\t\t\tmetadata: {\n\t\t\t\t...( blocks[ 0 ].attributes.metadata || {} ),\n\t\t\t\tcategories: pattern.categories,\n\t\t\t\tpatternName: pattern.name,\n\t\t\t\tname: blocks[ 0 ].attributes.metadata?.name || pattern.title,\n\t\t\t},\n\t\t};\n\t}\n\treturn {\n\t\t...pattern,\n\t\tblocks,\n\t};\n}\n\nexport function getParsedPattern( pattern ) {\n\tlet parsedPattern = parsedPatternCache.get( pattern );\n\tif ( ! parsedPattern ) {\n\t\tparsedPattern = parsePattern( pattern );\n\t\tparsedPatternCache.set( pattern, parsedPattern );\n\t}\n\treturn parsedPattern;\n}\n\nexport function getGrammar( pattern ) {\n\tlet grammarMap = grammarMapCache.get( pattern );\n\tif ( ! grammarMap ) {\n\t\tgrammarMap = grammarParse( pattern.content );\n\t\t// Block names are null only at the top level for whitespace.\n\t\tgrammarMap = grammarMap.filter( ( block ) => block.blockName !== null );\n\t\tgrammarMapCache.set( pattern, grammarMap );\n\t}\n\treturn grammarMap;\n}\n\nexport const checkAllowList = ( list, item, defaultResult = null ) => {\n\tif ( typeof list === 'boolean' ) {\n\t\treturn list;\n\t}\n\tif ( Array.isArray( list ) ) {\n\t\t// TODO: when there is a canonical way to detect that we are editing a post\n\t\t// the following check should be changed to something like:\n\t\t// if ( list.includes( 'core/post-content' ) && getEditorMode() === 'post-content' && item === null )\n\t\tif ( list.includes( 'core/post-content' ) && item === null ) {\n\t\t\treturn true;\n\t\t}\n\t\treturn list.includes( item );\n\t}\n\treturn defaultResult;\n};\n\nexport const checkAllowListRecursive = ( blocks, allowedBlockTypes ) => {\n\tif ( typeof allowedBlockTypes === 'boolean' ) {\n\t\treturn allowedBlockTypes;\n\t}\n\n\tconst blocksQueue = [ ...blocks ];\n\twhile ( blocksQueue.length > 0 ) {\n\t\tconst block = blocksQueue.shift();\n\n\t\tconst isAllowed = checkAllowList(\n\t\t\tallowedBlockTypes,\n\t\t\tblock.name || block.blockName,\n\t\t\ttrue\n\t\t);\n\t\tif ( ! isAllowed ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tblock.innerBlocks?.forEach( ( innerBlock ) => {\n\t\t\tblocksQueue.push( innerBlock );\n\t\t} );\n\t}\n\n\treturn true;\n};\n\nexport const getAllPatternsDependants = ( select ) => ( state ) => {\n\treturn [\n\t\tstate.settings.__experimentalBlockPatterns,\n\t\tstate.settings.__experimentalUserPatternCategories,\n\t\tstate.settings.__experimentalReusableBlocks,\n\t\tstate.settings[ selectBlockPatternsKey ]?.( select ),\n\t\tstate.blockPatterns,\n\t\tunlock( select( STORE_NAME ) ).getReusableBlocks(),\n\t];\n};\n\nexport function getInsertBlockTypeDependants( state, rootClientId ) {\n\treturn [\n\t\tstate.blockListSettings[ rootClientId ],\n\t\tstate.blocks.byClientId.get( rootClientId ),\n\t\tstate.settings.allowedBlockTypes,\n\t\tstate.settings.templateLock,\n\t\tstate.blockEditingModes,\n\t\tstate.editorMode,\n\t\tgetSectionRootClientId( state ),\n\t];\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,KAAK,QAAQ,mBAAmB;AACzC,SAASA,KAAK,IAAIC,YAAY,QAAQ,+CAA+C;;AAErF;AACA;AACA;AACA,SAASC,sBAAsB,QAAQ,gBAAgB;AACvD,SAASC,MAAM,QAAQ,gBAAgB;AACvC,SAASC,UAAU,QAAQ,aAAa;AACxC,SAASC,sBAAsB,QAAQ,qBAAqB;AAE5D,OAAO,MAAMC,UAAU,GAAGC,MAAM,CAAE,YAAa,CAAC;AAChD,MAAMC,kBAAkB,GAAG,IAAIC,OAAO,CAAC,CAAC;AACxC,MAAMC,eAAe,GAAG,IAAID,OAAO,CAAC,CAAC;AAErC,SAASE,YAAYA,CAAEC,OAAO,EAAG;EAChC,MAAMC,MAAM,GAAGb,KAAK,CAAEY,OAAO,CAACE,OAAO,EAAE;IACtCC,2BAA2B,EAAE;EAC9B,CAAE,CAAC;EACH,IAAKF,MAAM,CAACG,MAAM,KAAK,CAAC,EAAG;IAC1BH,MAAM,CAAE,CAAC,CAAE,CAACI,UAAU,GAAG;MACxB,GAAGJ,MAAM,CAAE,CAAC,CAAE,CAACI,UAAU;MACzBC,QAAQ,EAAE;QACT,IA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AACF,CAAC;AAED,OAAO,SAASC,4BAA4BA,CAAEP,KAAK,EAAEQ,YAAY,EAAG;EACnE,OAAO,CACNR,KAAK,CAACS,iBAAiB,CAAED,YAAY,CAAE,EACvCR,KAAK,CAACrC,MAAM,CAAC+C,UAAU,CAACnC,GAAG,CAAEiC,YAAa,CAAC,EAC3CR,KAAK,CAACC,QAAQ,CAACX,iBAAiB,EAChCU,KAAK,CAACC,QAAQ,CAACU,YAAY,EAC3BX,KAAK,CAACY,iBAAiB,EACvBZ,KAAK,CAACa,UAAU,EAChB1D,sBAAsB,CAAE6C,KAAM,CAAC,CAC/B;AACF","ignoreList":[]}
@@ -11,6 +11,56 @@ import { useBlockEditContext } from '../components/block-edit';
11
11
  function isObjectEmpty(object) {
12
12
  return !object || Object.keys(object).length === 0;
13
13
  }
14
+
15
+ /**
16
+ * Contains utils to update the block `bindings` metadata.
17
+ *
18
+ * @typedef {Object} WPBlockBindingsUtils
19
+ *
20
+ * @property {Function} updateBlockBindings Updates the value of the bindings connected to block attributes.
21
+ * @property {Function} removeAllBlockBindings Removes the bindings property of the `metadata` attribute.
22
+ */
23
+
24
+ /**
25
+ * Retrieves the existing utils needed to update the block `bindings` metadata.
26
+ * They can be used to create, modify, or remove connections from the existing block attributes.
27
+ *
28
+ * It contains the following utils:
29
+ * - `updateBlockBindings`: Updates the value of the bindings connected to block attributes. It can be used to remove a specific binding by setting the value to `undefined`.
30
+ * - `removeAllBlockBindings`: Removes the bindings property of the `metadata` attribute.
31
+ *
32
+ * @since 6.7.0 Introduced in WordPress core.
33
+ *
34
+ * @return {?WPBlockBindingsUtils} Object containing the block bindings utils.
35
+ *
36
+ * @example
37
+ * ```js
38
+ * import { useBlockBindingsUtils } from '@wordpress/block-editor'
39
+ * const { updateBlockBindings, removeAllBlockBindings } = useBlockBindingsUtils();
40
+ *
41
+ * // Update url and alt attributes.
42
+ * updateBlockBindings( {
43
+ * url: {
44
+ * source: 'core/post-meta',
45
+ * args: {
46
+ * key: 'url_custom_field',
47
+ * },
48
+ * },
49
+ * alt: {
50
+ * source: 'core/post-meta',
51
+ * args: {
52
+ * key: 'text_custom_field',
53
+ * },
54
+ * },
55
+ * } );
56
+ *
57
+ * // Remove binding from url attribute.
58
+ * updateBlockBindings( { url: undefined } );
59
+ *
60
+ * // Remove bindings from all attributes.
61
+ * removeAllBlockBindings();
62
+ * ```
63
+ */
14
64
  export function useBlockBindingsUtils() {
15
65
  const {
16
66
  clientId
@@ -1 +1 @@
1
- {"version":3,"names":["useDispatch","useRegistry","store","blockEditorStore","useBlockEditContext","isObjectEmpty","object","Object","keys","length","useBlockBindingsUtils","clientId","updateBlockAttributes","getBlockAttributes","select","updateBlockBindings","bindings","metadata","currentBindings","newBindings","entries","forEach","attribute","binding","newMetadata","undefined","removeAllBlockBindings"],"sources":["@wordpress/block-editor/src/utils/block-bindings.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch, useRegistry } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../store';\nimport { useBlockEditContext } from '../components/block-edit';\n\nfunction isObjectEmpty( object ) {\n\treturn ! object || Object.keys( object ).length === 0;\n}\n\nexport function useBlockBindingsUtils() {\n\tconst { clientId } = useBlockEditContext();\n\tconst { updateBlockAttributes } = useDispatch( blockEditorStore );\n\tconst { getBlockAttributes } = useRegistry().select( blockEditorStore );\n\n\t/**\n\t * Updates the value of the bindings connected to block attributes.\n\t * It removes the binding when the new value is `undefined`.\n\t *\n\t * @param {Object} bindings Bindings including the attributes to update and the new object.\n\t * @param {string} bindings.source The source name to connect to.\n\t * @param {Object} [bindings.args] Object containing the arguments needed by the source.\n\t *\n\t * @example\n\t * ```js\n\t * import { useBlockBindingsUtils } from '@wordpress/block-editor'\n\t *\n\t * const { updateBlockBindings } = useBlockBindingsUtils();\n\t * updateBlockBindings( {\n\t * url: {\n\t * source: 'core/post-meta',\n\t * args: {\n\t * key: 'url_custom_field',\n\t * },\n\t * \t },\n\t * alt: {\n\t * source: 'core/post-meta',\n\t * args: {\n\t * key: 'text_custom_field',\n\t * },\n\t * \t }\n\t * } );\n\t * ```\n\t */\n\tconst updateBlockBindings = ( bindings ) => {\n\t\tconst { metadata: { bindings: currentBindings, ...metadata } = {} } =\n\t\t\tgetBlockAttributes( clientId );\n\t\tconst newBindings = { ...currentBindings };\n\n\t\tObject.entries( bindings ).forEach( ( [ attribute, binding ] ) => {\n\t\t\tif ( ! binding && newBindings[ attribute ] ) {\n\t\t\t\tdelete newBindings[ attribute ];\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tnewBindings[ attribute ] = binding;\n\t\t} );\n\n\t\tconst newMetadata = {\n\t\t\t...metadata,\n\t\t\tbindings: newBindings,\n\t\t};\n\n\t\tif ( isObjectEmpty( newMetadata.bindings ) ) {\n\t\t\tdelete newMetadata.bindings;\n\t\t}\n\n\t\tupdateBlockAttributes( clientId, {\n\t\t\tmetadata: isObjectEmpty( newMetadata ) ? undefined : newMetadata,\n\t\t} );\n\t};\n\n\t/**\n\t * Removes the bindings property of the `metadata` attribute.\n\t *\n\t * @example\n\t * ```js\n\t * import { useBlockBindingsUtils } from '@wordpress/block-editor'\n\t *\n\t * const { removeAllBlockBindings } = useBlockBindingsUtils();\n\t * removeAllBlockBindings();\n\t * ```\n\t */\n\tconst removeAllBlockBindings = () => {\n\t\tconst { metadata: { bindings, ...metadata } = {} } =\n\t\t\tgetBlockAttributes( clientId );\n\t\tupdateBlockAttributes( clientId, {\n\t\t\tmetadata: isObjectEmpty( metadata ) ? undefined : metadata,\n\t\t} );\n\t};\n\n\treturn { updateBlockBindings, removeAllBlockBindings };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAW,EAAEC,WAAW,QAAQ,iBAAiB;;AAE1D;AACA;AACA;AACA,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,UAAU;AACpD,SAASC,mBAAmB,QAAQ,0BAA0B;AAE9D,SAASC,aAAaA,CAAEC,MAAM,EAAG;EAChC,OA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EAAE;MAChCM,QAAQ,EAAEZ,aAAa,CAAEmB,WAAY,CAAC,GAAGC,SAAS,GAAGD;IACtD,CAAE,CAAC;EACJ,CAAC;;EAED;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACC,MAAME,sBAAsB,GAAGA,CAAA,KAAM;IACpC,MAAM;MAAET,QAAQ,EAAE;QAAED,QAAQ;QAAE,GAAGC;MAAS,CAAC,GAAG,CAAC;IAAE,CAAC,GACjDJ,kBAAkB,CAAEF,QAAS,CAAC;IAC/BC,qBAAqB,CAAED,QAAQ,EAAE;MAChCM,QAAQ,EAAEZ,aAAa,CAAEY,QAAS,CAAC,GAAGQ,SAAS,GAAGR;IACnD,CAAE,CAAC;EACJ,CAAC;EAED,OAAO;IAAEF,mBAAmB;IAAEW;EAAuB,CAAC;AACvD","ignoreList":[]}
1
+ {"version":3,"names":["useDispatch","useRegistry","store","blockEditorStore","useBlockEditContext","isObjectEmpty","object","Object","keys","length","useBlockBindingsUtils","clientId","updateBlockAttributes","getBlockAttributes","select","updateBlockBindings","bindings","metadata","currentBindings","newBindings","entries","forEach","attribute","binding","newMetadata","undefined","removeAllBlockBindings"],"sources":["@wordpress/block-editor/src/utils/block-bindings.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch, useRegistry } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../store';\nimport { useBlockEditContext } from '../components/block-edit';\n\nfunction isObjectEmpty( object ) {\n\treturn ! object || Object.keys( object ).length === 0;\n}\n\n/**\n * Contains utils to update the block `bindings` metadata.\n *\n * @typedef {Object} WPBlockBindingsUtils\n *\n * @property {Function} updateBlockBindings Updates the value of the bindings connected to block attributes.\n * @property {Function} removeAllBlockBindings Removes the bindings property of the `metadata` attribute.\n */\n\n/**\n * Retrieves the existing utils needed to update the block `bindings` metadata.\n * They can be used to create, modify, or remove connections from the existing block attributes.\n *\n * It contains the following utils:\n * - `updateBlockBindings`: Updates the value of the bindings connected to block attributes. It can be used to remove a specific binding by setting the value to `undefined`.\n * - `removeAllBlockBindings`: Removes the bindings property of the `metadata` attribute.\n *\n * @since 6.7.0 Introduced in WordPress core.\n *\n * @return {?WPBlockBindingsUtils} Object containing the block bindings utils.\n *\n * @example\n * ```js\n * import { useBlockBindingsUtils } from '@wordpress/block-editor'\n * const { updateBlockBindings, removeAllBlockBindings } = useBlockBindingsUtils();\n *\n * // Update url and alt attributes.\n * updateBlockBindings( {\n * url: {\n * source: 'core/post-meta',\n * args: {\n * key: 'url_custom_field',\n * },\n * },\n * alt: {\n * source: 'core/post-meta',\n * args: {\n * key: 'text_custom_field',\n * },\n * },\n * } );\n *\n * // Remove binding from url attribute.\n * updateBlockBindings( { url: undefined } );\n *\n * // Remove bindings from all attributes.\n * removeAllBlockBindings();\n * ```\n */\nexport function useBlockBindingsUtils() {\n\tconst { clientId } = useBlockEditContext();\n\tconst { updateBlockAttributes } = useDispatch( blockEditorStore );\n\tconst { getBlockAttributes } = useRegistry().select( blockEditorStore );\n\n\t/**\n\t * Updates the value of the bindings connected to block attributes.\n\t * It removes the binding when the new value is `undefined`.\n\t *\n\t * @param {Object} bindings Bindings including the attributes to update and the new object.\n\t * @param {string} bindings.source The source name to connect to.\n\t * @param {Object} [bindings.args] Object containing the arguments needed by the source.\n\t *\n\t * @example\n\t * ```js\n\t * import { useBlockBindingsUtils } from '@wordpress/block-editor'\n\t *\n\t * const { updateBlockBindings } = useBlockBindingsUtils();\n\t * updateBlockBindings( {\n\t * url: {\n\t * source: 'core/post-meta',\n\t * args: {\n\t * key: 'url_custom_field',\n\t * },\n\t * \t },\n\t * alt: {\n\t * source: 'core/post-meta',\n\t * args: {\n\t * key: 'text_custom_field',\n\t * },\n\t * \t }\n\t * } );\n\t * ```\n\t */\n\tconst updateBlockBindings = ( bindings ) => {\n\t\tconst { metadata: { bindings: currentBindings, ...metadata } = {} } =\n\t\t\tgetBlockAttributes( clientId );\n\t\tconst newBindings = { ...currentBindings };\n\n\t\tObject.entries( bindings ).forEach( ( [ attribute, binding ] ) => {\n\t\t\tif ( ! binding && newBindings[ attribute ] ) {\n\t\t\t\tdelete newBindings[ attribute ];\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tnewBindings[ attribute ] = binding;\n\t\t} );\n\n\t\tconst newMetadata = {\n\t\t\t...metadata,\n\t\t\tbindings: newBindings,\n\t\t};\n\n\t\tif ( isObjectEmpty( newMetadata.bindings ) ) {\n\t\t\tdelete newMetadata.bindings;\n\t\t}\n\n\t\tupdateBlockAttributes( clientId, {\n\t\t\tmetadata: isObjectEmpty( newMetadata ) ? undefined : newMetadata,\n\t\t} );\n\t};\n\n\t/**\n\t * Removes the bindings property of the `metadata` attribute.\n\t *\n\t * @example\n\t * ```js\n\t * import { useBlockBindingsUtils } from '@wordpress/block-editor'\n\t *\n\t * const { removeAllBlockBindings } = useBlockBindingsUtils();\n\t * removeAllBlockBindings();\n\t * ```\n\t */\n\tconst removeAllBlockBindings = () => {\n\t\tconst { metadata: { bindings, ...metadata } = {} } =\n\t\t\tgetBlockAttributes( clientId );\n\t\tupdateBlockAttributes( clientId, {\n\t\t\tmetadata: isObjectEmpty( metadata ) ? undefined : metadata,\n\t\t} );\n\t};\n\n\treturn { updateBlockBindings, removeAllBlockBindings };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAW,EAAEC,WAAW,QAAQ,iBAAiB;;AAE1D;AACA;AACA;AACA,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,UAAU;AACpD,SAASC,mBAAmB,QAAQ,0BAA0B;AAE9D,SAASC,aAAaA,CAAEC,MAAM,EAAG;EAChC,OAAO,CAAEA,MAAM,IAAIC,MAAM,CAACC,IAAI,CAAEF,MAAO,CAAC,CAACG,MAAM,KAAK,CAAC;AACtD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC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BAAqB,CAAED,QAAQ,EAAE;MAChCM,QAAQ,EAAEZ,aAAa,CAAEmB,WAAY,CAAC,GAAGC,SAAS,GAAGD;IACtD,CAAE,CAAC;EACJ,CAAC;;EAED;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACC,MAAME,sBAAsB,GAAGA,CAAA,KAAM;IACpC,MAAM;MAAET,QAAQ,EAAE;QAAED,QAAQ;QAAE,GAAGC;MAAS,CAAC,GAAG,CAAC;IAAE,CAAC,GACjDJ,kBAAkB,CAAEF,QAAS,CAAC;IAC/BC,qBAAqB,CAAED,QAAQ,EAAE;MAChCM,QAAQ,EAAEZ,aAAa,CAAEY,QAAS,CAAC,GAAGQ,SAAS,GAAGR;IACnD,CAAE,CAAC;EACJ,CAAC;EAED,OAAO;IAAEF,mBAAmB;IAAEW;EAAuB,CAAC;AACvD","ignoreList":[]}
@@ -1,3 +1,4 @@
1
1
  export { default as transformStyles } from './transform-styles';
2
2
  export { default as getPxFromCssUnit } from './get-px-from-css-unit';
3
+ export { useBlockBindingsUtils } from './block-bindings';
3
4
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["default","transformStyles","getPxFromCssUnit"],"sources":["@wordpress/block-editor/src/utils/index.js"],"sourcesContent":["export { default as transformStyles } from './transform-styles';\nexport { default as getPxFromCssUnit } from './get-px-from-css-unit';\n"],"mappings":"AAAA,SAASA,OAAO,IAAIC,eAAe,QAAQ,oBAAoB;AAC/D,SAASD,OAAO,IAAIE,gBAAgB,QAAQ,wBAAwB","ignoreList":[]}
1
+ {"version":3,"names":["default","transformStyles","getPxFromCssUnit","useBlockBindingsUtils"],"sources":["@wordpress/block-editor/src/utils/index.js"],"sourcesContent":["export { default as transformStyles } from './transform-styles';\nexport { default as getPxFromCssUnit } from './get-px-from-css-unit';\nexport { useBlockBindingsUtils } from './block-bindings';\n"],"mappings":"AAAA,SAASA,OAAO,IAAIC,eAAe,QAAQ,oBAAoB;AAC/D,SAASD,OAAO,IAAIE,gBAAgB,QAAQ,wBAAwB;AACpE,SAASC,qBAAqB,QAAQ,kBAAkB","ignoreList":[]}
@@ -29,6 +29,9 @@
29
29
  /**
30
30
  * Fonts & basic variables.
31
31
  */
32
+ /**
33
+ * Typography
34
+ */
32
35
  /**
33
36
  * Grid System.
34
37
  * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/
@@ -43,7 +46,10 @@
43
46
  * Dimensions.
44
47
  */
45
48
  /**
46
- * Editor widths.
49
+ * Mobile specific styles
50
+ */
51
+ /**
52
+ * Editor styles.
47
53
  */
48
54
  /**
49
55
  * Block & Editor UI.
@@ -67,6 +73,9 @@
67
73
  * Creates a fading overlay to signify that the content is longer
68
74
  * than the space allows.
69
75
  */
76
+ /**
77
+ * Typography
78
+ */
70
79
  /**
71
80
  * Breakpoint mixins
72
81
  */
@@ -182,12 +191,12 @@ _::-webkit-full-page-media, _:future, :root .has-multi-selection .block-editor-b
182
191
  outline-color: transparent;
183
192
  }
184
193
  .block-editor-block-list__layout .block-editor-block-list__block.is-highlighted,
185
- .block-editor-block-list__layout .block-editor-block-list__block.is-highlighted ~ .is-multi-selected, .block-editor-block-list__layout.is-navigate-mode .block-editor-block-list__block.is-selected,
194
+ .block-editor-block-list__layout .block-editor-block-list__block.is-highlighted ~ .is-multi-selected,
186
195
  .block-editor-block-list__layout .block-editor-block-list__block:not([contenteditable=true]):focus {
187
196
  outline: none;
188
197
  }
189
198
  .block-editor-block-list__layout .block-editor-block-list__block.is-highlighted::after,
190
- .block-editor-block-list__layout .block-editor-block-list__block.is-highlighted ~ .is-multi-selected::after, .block-editor-block-list__layout.is-navigate-mode .block-editor-block-list__block.is-selected::after,
199
+ .block-editor-block-list__layout .block-editor-block-list__block.is-highlighted ~ .is-multi-selected::after,
191
200
  .block-editor-block-list__layout .block-editor-block-list__block:not([contenteditable=true]):focus::after {
192
201
  content: "";
193
202
  position: absolute;
@@ -202,53 +211,21 @@ _::-webkit-full-page-media, _:future, :root .has-multi-selection .block-editor-b
202
211
  outline-offset: calc(1 * ((-1 * var(--wp-admin-border-width-focus) ) / var(--wp-block-editor-iframe-zoom-out-scale, 1)));
203
212
  z-index: 1;
204
213
  }
205
- .block-editor-block-list__layout .is-block-moving-mode.block-editor-block-list__block.is-selected::after {
206
- content: "";
207
- position: absolute;
208
- z-index: 0;
209
- pointer-events: none;
210
- transition: border-color 0.1s linear, border-style 0.1s linear, box-shadow 0.1s linear;
211
- left: 0;
212
- right: 0;
213
- top: -14px;
214
- border-radius: 2px;
215
- border-top: 4px solid #ccc;
216
- bottom: auto;
217
- box-shadow: none;
218
- }
219
- .block-editor-block-list__layout .is-block-moving-mode.can-insert-moving-block.block-editor-block-list__block.is-selected::after {
220
- border-color: var(--wp-admin-theme-color);
221
- }
222
- .has-multi-selection .block-editor-block-list__layout {
223
- -webkit-user-select: none;
224
- user-select: none;
225
- }
226
214
  .block-editor-block-list__layout [class^=components-] {
227
215
  -webkit-user-select: text;
228
216
  user-select: text;
229
217
  }
230
218
 
231
- .is-block-moving-mode.block-editor-block-list__block-selection-button {
232
- opacity: 0;
233
- font-size: 1px;
234
- height: 1px;
235
- padding: 0;
236
- }
237
-
238
219
  .block-editor-block-list__layout .block-editor-block-list__block {
239
220
  position: relative;
240
221
  overflow-wrap: break-word;
241
222
  pointer-events: auto;
242
- -webkit-user-select: text;
243
- user-select: text;
244
223
  /**
245
224
  * Notices
246
225
  */
247
226
  }
248
227
  .block-editor-block-list__layout .block-editor-block-list__block.is-editing-disabled {
249
228
  pointer-events: none;
250
- -webkit-user-select: none;
251
- user-select: none;
252
229
  }
253
230
  .block-editor-block-list__layout .block-editor-block-list__block.has-negative-margin.is-selected, .block-editor-block-list__layout .block-editor-block-list__block.has-negative-margin.has-child-selected {
254
231
  z-index: 20;
@@ -289,12 +266,6 @@ _::-webkit-full-page-media, _:future, :root .has-multi-selection .block-editor-b
289
266
  .block-editor-block-list__layout .block-editor-block-list__block.has-warning.is-multi-selected::after {
290
267
  background-color: transparent;
291
268
  }
292
- .block-editor-block-list__layout .block-editor-block-list__block.is-reusable > .block-editor-inner-blocks > .block-editor-block-list__layout.has-overlay::after {
293
- display: none;
294
- }
295
- .block-editor-block-list__layout .block-editor-block-list__block.is-reusable > .block-editor-inner-blocks > .block-editor-block-list__layout.has-overlay .block-editor-block-list__layout.has-overlay::after {
296
- display: block;
297
- }
298
269
  .block-editor-block-list__layout .block-editor-block-list__block.is-reusable.has-child-selected::after {
299
270
  box-shadow: 0 0 0 1px var(--wp-admin-theme-color);
300
271
  }
@@ -354,7 +325,7 @@ _::-webkit-full-page-media, _:future, :root .has-multi-selection .block-editor-b
354
325
  background-color: rgba(var(--wp-admin-theme-color--rgb), 0);
355
326
  }
356
327
  }
357
- .is-root-container:not([inert]) .block-editor-block-list__block.is-reusable.is-selected .block-editor-block-list__block.has-editable-outline::after {
328
+ .is-root-container:not([inert]) .block-editor-block-list__block.is-selected .block-editor-block-list__block.has-editable-outline::after {
358
329
  animation-name: block-editor-is-editable__animation;
359
330
  animation-duration: 0.8s;
360
331
  animation-timing-function: ease-out;
@@ -369,7 +340,7 @@ _::-webkit-full-page-media, _:future, :root .has-multi-selection .block-editor-b
369
340
  top: 0;
370
341
  }
371
342
  @media (prefers-reduced-motion: reduce) {
372
- .is-root-container:not([inert]) .block-editor-block-list__block.is-reusable.is-selected .block-editor-block-list__block.has-editable-outline::after {
343
+ .is-root-container:not([inert]) .block-editor-block-list__block.is-selected .block-editor-block-list__block.has-editable-outline::after {
373
344
  animation-name: block-editor-is-editable__animation_reduce-motion;
374
345
  animation-delay: 0s;
375
346
  }
@@ -631,9 +602,6 @@ _::-webkit-full-page-media, _:future, :root .has-multi-selection .block-editor-b
631
602
  color: #1e1e1e;
632
603
  box-shadow: inset 0 0 0 1px #1e1e1e;
633
604
  }
634
- .block-editor-button-block-appender.components-button.components-button {
635
- padding: 12px;
636
- }
637
605
  .is-dark-theme .block-editor-button-block-appender {
638
606
  color: rgba(255, 255, 255, 0.65);
639
607
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.65);
@@ -855,37 +823,15 @@ _::-webkit-full-page-media, _:future, :root .has-multi-selection .block-editor-b
855
823
  flex: 1;
856
824
  }
857
825
 
858
- .block-editor-block-list__layout.has-overlay::after {
859
- content: "";
860
- position: absolute;
861
- top: 0;
862
- left: 0;
863
- bottom: 0;
864
- right: 0;
865
- z-index: 60;
866
- }
867
-
868
826
  .block-editor-media-placeholder__url-input-form {
869
- display: flex;
870
- }
871
- .block-editor-media-placeholder__url-input-form input[type=url].block-editor-media-placeholder__url-input-field {
872
- width: 100%;
873
- min-width: 200px;
874
- flex-grow: 1;
875
- border: none;
876
- border-radius: 0;
877
- margin: 2px;
827
+ min-width: 260px;
878
828
  }
879
829
  @media (min-width: 600px) {
880
- .block-editor-media-placeholder__url-input-form input[type=url].block-editor-media-placeholder__url-input-field {
830
+ .block-editor-media-placeholder__url-input-form {
881
831
  width: 300px;
882
832
  }
883
833
  }
884
834
 
885
- .block-editor-media-placeholder__url-input-submit-button {
886
- flex-shrink: 1;
887
- }
888
-
889
835
  .block-editor-media-placeholder__cancel-button.is-link {
890
836
  margin: 1em;
891
837
  display: block;
@@ -29,6 +29,9 @@
29
29
  /**
30
30
  * Fonts & basic variables.
31
31
  */
32
+ /**
33
+ * Typography
34
+ */
32
35
  /**
33
36
  * Grid System.
34
37
  * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/
@@ -43,7 +46,10 @@
43
46
  * Dimensions.
44
47
  */
45
48
  /**
46
- * Editor widths.
49
+ * Mobile specific styles
50
+ */
51
+ /**
52
+ * Editor styles.
47
53
  */
48
54
  /**
49
55
  * Block & Editor UI.
@@ -67,6 +73,9 @@
67
73
  * Creates a fading overlay to signify that the content is longer
68
74
  * than the space allows.
69
75
  */
76
+ /**
77
+ * Typography
78
+ */
70
79
  /**
71
80
  * Breakpoint mixins
72
81
  */
@@ -182,12 +191,12 @@ _::-webkit-full-page-media, _:future, :root .has-multi-selection .block-editor-b
182
191
  outline-color: transparent;
183
192
  }
184
193
  .block-editor-block-list__layout .block-editor-block-list__block.is-highlighted,
185
- .block-editor-block-list__layout .block-editor-block-list__block.is-highlighted ~ .is-multi-selected, .block-editor-block-list__layout.is-navigate-mode .block-editor-block-list__block.is-selected,
194
+ .block-editor-block-list__layout .block-editor-block-list__block.is-highlighted ~ .is-multi-selected,
186
195
  .block-editor-block-list__layout .block-editor-block-list__block:not([contenteditable=true]):focus {
187
196
  outline: none;
188
197
  }
189
198
  .block-editor-block-list__layout .block-editor-block-list__block.is-highlighted::after,
190
- .block-editor-block-list__layout .block-editor-block-list__block.is-highlighted ~ .is-multi-selected::after, .block-editor-block-list__layout.is-navigate-mode .block-editor-block-list__block.is-selected::after,
199
+ .block-editor-block-list__layout .block-editor-block-list__block.is-highlighted ~ .is-multi-selected::after,
191
200
  .block-editor-block-list__layout .block-editor-block-list__block:not([contenteditable=true]):focus::after {
192
201
  content: "";
193
202
  position: absolute;
@@ -202,53 +211,21 @@ _::-webkit-full-page-media, _:future, :root .has-multi-selection .block-editor-b
202
211
  outline-offset: calc(1 * ((-1 * var(--wp-admin-border-width-focus) ) / var(--wp-block-editor-iframe-zoom-out-scale, 1)));
203
212
  z-index: 1;
204
213
  }
205
- .block-editor-block-list__layout .is-block-moving-mode.block-editor-block-list__block.is-selected::after {
206
- content: "";
207
- position: absolute;
208
- z-index: 0;
209
- pointer-events: none;
210
- transition: border-color 0.1s linear, border-style 0.1s linear, box-shadow 0.1s linear;
211
- right: 0;
212
- left: 0;
213
- top: -14px;
214
- border-radius: 2px;
215
- border-top: 4px solid #ccc;
216
- bottom: auto;
217
- box-shadow: none;
218
- }
219
- .block-editor-block-list__layout .is-block-moving-mode.can-insert-moving-block.block-editor-block-list__block.is-selected::after {
220
- border-color: var(--wp-admin-theme-color);
221
- }
222
- .has-multi-selection .block-editor-block-list__layout {
223
- -webkit-user-select: none;
224
- user-select: none;
225
- }
226
214
  .block-editor-block-list__layout [class^=components-] {
227
215
  -webkit-user-select: text;
228
216
  user-select: text;
229
217
  }
230
218
 
231
- .is-block-moving-mode.block-editor-block-list__block-selection-button {
232
- opacity: 0;
233
- font-size: 1px;
234
- height: 1px;
235
- padding: 0;
236
- }
237
-
238
219
  .block-editor-block-list__layout .block-editor-block-list__block {
239
220
  position: relative;
240
221
  overflow-wrap: break-word;
241
222
  pointer-events: auto;
242
- -webkit-user-select: text;
243
- user-select: text;
244
223
  /**
245
224
  * Notices
246
225
  */
247
226
  }
248
227
  .block-editor-block-list__layout .block-editor-block-list__block.is-editing-disabled {
249
228
  pointer-events: none;
250
- -webkit-user-select: none;
251
- user-select: none;
252
229
  }
253
230
  .block-editor-block-list__layout .block-editor-block-list__block.has-negative-margin.is-selected, .block-editor-block-list__layout .block-editor-block-list__block.has-negative-margin.has-child-selected {
254
231
  z-index: 20;
@@ -289,12 +266,6 @@ _::-webkit-full-page-media, _:future, :root .has-multi-selection .block-editor-b
289
266
  .block-editor-block-list__layout .block-editor-block-list__block.has-warning.is-multi-selected::after {
290
267
  background-color: transparent;
291
268
  }
292
- .block-editor-block-list__layout .block-editor-block-list__block.is-reusable > .block-editor-inner-blocks > .block-editor-block-list__layout.has-overlay::after {
293
- display: none;
294
- }
295
- .block-editor-block-list__layout .block-editor-block-list__block.is-reusable > .block-editor-inner-blocks > .block-editor-block-list__layout.has-overlay .block-editor-block-list__layout.has-overlay::after {
296
- display: block;
297
- }
298
269
  .block-editor-block-list__layout .block-editor-block-list__block.is-reusable.has-child-selected::after {
299
270
  box-shadow: 0 0 0 1px var(--wp-admin-theme-color);
300
271
  }
@@ -354,7 +325,7 @@ _::-webkit-full-page-media, _:future, :root .has-multi-selection .block-editor-b
354
325
  background-color: rgba(var(--wp-admin-theme-color--rgb), 0);
355
326
  }
356
327
  }
357
- .is-root-container:not([inert]) .block-editor-block-list__block.is-reusable.is-selected .block-editor-block-list__block.has-editable-outline::after {
328
+ .is-root-container:not([inert]) .block-editor-block-list__block.is-selected .block-editor-block-list__block.has-editable-outline::after {
358
329
  animation-name: block-editor-is-editable__animation;
359
330
  animation-duration: 0.8s;
360
331
  animation-timing-function: ease-out;
@@ -369,7 +340,7 @@ _::-webkit-full-page-media, _:future, :root .has-multi-selection .block-editor-b
369
340
  top: 0;
370
341
  }
371
342
  @media (prefers-reduced-motion: reduce) {
372
- .is-root-container:not([inert]) .block-editor-block-list__block.is-reusable.is-selected .block-editor-block-list__block.has-editable-outline::after {
343
+ .is-root-container:not([inert]) .block-editor-block-list__block.is-selected .block-editor-block-list__block.has-editable-outline::after {
373
344
  animation-name: block-editor-is-editable__animation_reduce-motion;
374
345
  animation-delay: 0s;
375
346
  }
@@ -631,9 +602,6 @@ _::-webkit-full-page-media, _:future, :root .has-multi-selection .block-editor-b
631
602
  color: #1e1e1e;
632
603
  box-shadow: inset 0 0 0 1px #1e1e1e;
633
604
  }
634
- .block-editor-button-block-appender.components-button.components-button {
635
- padding: 12px;
636
- }
637
605
  .is-dark-theme .block-editor-button-block-appender {
638
606
  color: rgba(255, 255, 255, 0.65);
639
607
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.65);
@@ -855,37 +823,15 @@ _::-webkit-full-page-media, _:future, :root .has-multi-selection .block-editor-b
855
823
  flex: 1;
856
824
  }
857
825
 
858
- .block-editor-block-list__layout.has-overlay::after {
859
- content: "";
860
- position: absolute;
861
- top: 0;
862
- right: 0;
863
- bottom: 0;
864
- left: 0;
865
- z-index: 60;
866
- }
867
-
868
826
  .block-editor-media-placeholder__url-input-form {
869
- display: flex;
870
- }
871
- .block-editor-media-placeholder__url-input-form input[type=url].block-editor-media-placeholder__url-input-field {
872
- width: 100%;
873
- min-width: 200px;
874
- flex-grow: 1;
875
- border: none;
876
- border-radius: 0;
877
- margin: 2px;
827
+ min-width: 260px;
878
828
  }
879
829
  @media (min-width: 600px) {
880
- .block-editor-media-placeholder__url-input-form input[type=url].block-editor-media-placeholder__url-input-field {
830
+ .block-editor-media-placeholder__url-input-form {
881
831
  width: 300px;
882
832
  }
883
833
  }
884
834
 
885
- .block-editor-media-placeholder__url-input-submit-button {
886
- flex-shrink: 1;
887
- }
888
-
889
835
  .block-editor-media-placeholder__cancel-button.is-link {
890
836
  margin: 1em;
891
837
  display: block;
@@ -29,6 +29,9 @@
29
29
  /**
30
30
  * Fonts & basic variables.
31
31
  */
32
+ /**
33
+ * Typography
34
+ */
32
35
  /**
33
36
  * Grid System.
34
37
  * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/
@@ -43,7 +46,10 @@
43
46
  * Dimensions.
44
47
  */
45
48
  /**
46
- * Editor widths.
49
+ * Mobile specific styles
50
+ */
51
+ /**
52
+ * Editor styles.
47
53
  */
48
54
  /**
49
55
  * Block & Editor UI.
@@ -67,6 +73,9 @@
67
73
  * Creates a fading overlay to signify that the content is longer
68
74
  * than the space allows.
69
75
  */
76
+ /**
77
+ * Typography
78
+ */
70
79
  /**
71
80
  * Breakpoint mixins
72
81
  */
@@ -29,6 +29,9 @@
29
29
  /**
30
30
  * Fonts & basic variables.
31
31
  */
32
+ /**
33
+ * Typography
34
+ */
32
35
  /**
33
36
  * Grid System.
34
37
  * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/
@@ -43,7 +46,10 @@
43
46
  * Dimensions.
44
47
  */
45
48
  /**
46
- * Editor widths.
49
+ * Mobile specific styles
50
+ */
51
+ /**
52
+ * Editor styles.
47
53
  */
48
54
  /**
49
55
  * Block & Editor UI.
@@ -67,6 +73,9 @@
67
73
  * Creates a fading overlay to signify that the content is longer
68
74
  * than the space allows.
69
75
  */
76
+ /**
77
+ * Typography
78
+ */
70
79
  /**
71
80
  * Breakpoint mixins
72
81
  */