@wordpress/block-editor 12.4.0 → 12.6.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 (524) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/README.md +1 -0
  3. package/build/components/block-draggable/index.js +6 -3
  4. package/build/components/block-draggable/index.js.map +1 -1
  5. package/build/components/block-draggable/index.native.js +2 -2
  6. package/build/components/block-draggable/index.native.js.map +1 -1
  7. package/build/components/block-edit/edit.js +25 -13
  8. package/build/components/block-edit/edit.js.map +1 -1
  9. package/build/components/block-heading-level-dropdown/heading-level-icon.js +10 -2
  10. package/build/components/block-heading-level-dropdown/heading-level-icon.js.map +1 -1
  11. package/build/components/block-heading-level-dropdown/index.native.js +4 -3
  12. package/build/components/block-heading-level-dropdown/index.native.js.map +1 -1
  13. package/build/components/block-list/block-outline.native.js +14 -18
  14. package/build/components/block-list/block-outline.native.js.map +1 -1
  15. package/build/components/block-list/block.native.js +21 -42
  16. package/build/components/block-list/block.native.js.map +1 -1
  17. package/build/components/block-lock/toolbar.js +25 -6
  18. package/build/components/block-lock/toolbar.js.map +1 -1
  19. package/build/components/block-mover/index.native.js +1 -1
  20. package/build/components/block-mover/index.native.js.map +1 -1
  21. package/build/components/block-parent-selector/index.js +8 -5
  22. package/build/components/block-parent-selector/index.js.map +1 -1
  23. package/build/components/block-removal-warning-modal/index.js +15 -25
  24. package/build/components/block-removal-warning-modal/index.js.map +1 -1
  25. package/build/components/block-settings/button.native.js +2 -2
  26. package/build/components/block-settings/button.native.js.map +1 -1
  27. package/build/components/{block-mobile-toolbar/block-actions-menu.native.js → block-toolbar/block-toolbar-menu.native.js} +10 -11
  28. package/build/components/block-toolbar/block-toolbar-menu.native.js.map +1 -0
  29. package/build/components/block-toolbar/index.js +12 -8
  30. package/build/components/block-toolbar/index.js.map +1 -1
  31. package/build/components/block-toolbar/index.native.js +62 -3
  32. package/build/components/block-toolbar/index.native.js.map +1 -1
  33. package/build/components/block-tools/block-contextual-toolbar.js +7 -11
  34. package/build/components/block-tools/block-contextual-toolbar.js.map +1 -1
  35. package/build/components/colors-gradients/control.js +4 -2
  36. package/build/components/colors-gradients/control.js.map +1 -1
  37. package/build/components/dimensions-tool/aspect-ratio-tool.js +99 -0
  38. package/build/components/dimensions-tool/aspect-ratio-tool.js.map +1 -0
  39. package/build/components/dimensions-tool/index.js +207 -0
  40. package/build/components/dimensions-tool/index.js.map +1 -0
  41. package/build/components/dimensions-tool/scale-tool.js +111 -0
  42. package/build/components/dimensions-tool/scale-tool.js.map +1 -0
  43. package/build/components/dimensions-tool/width-height-tool.js +125 -0
  44. package/build/components/dimensions-tool/width-height-tool.js.map +1 -0
  45. package/build/components/global-styles/color-panel.js +22 -16
  46. package/build/components/global-styles/color-panel.js.map +1 -1
  47. package/build/components/global-styles/dimensions-panel.js +13 -2
  48. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  49. package/build/components/global-styles/filters-panel.js +1 -1
  50. package/build/components/global-styles/filters-panel.js.map +1 -1
  51. package/build/components/global-styles/get-block-css-selector.js +4 -8
  52. package/build/components/global-styles/get-block-css-selector.js.map +1 -1
  53. package/build/components/global-styles/hooks.js +15 -25
  54. package/build/components/global-styles/hooks.js.map +1 -1
  55. package/build/components/global-styles/typography-panel.js +52 -5
  56. package/build/components/global-styles/typography-panel.js.map +1 -1
  57. package/build/components/global-styles/use-global-styles-output.js +12 -18
  58. package/build/components/global-styles/use-global-styles-output.js.map +1 -1
  59. package/build/components/global-styles/utils.js +6 -6
  60. package/build/components/global-styles/utils.js.map +1 -1
  61. package/build/components/iframe/index.js +36 -48
  62. package/build/components/iframe/index.js.map +1 -1
  63. package/build/components/iframe/use-compatibility-styles.js +5 -0
  64. package/build/components/iframe/use-compatibility-styles.js.map +1 -1
  65. package/build/components/image-editor/aspect-ratio-dropdown.js +1 -1
  66. package/build/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
  67. package/build/components/image-editor/use-save-image.js +1 -2
  68. package/build/components/image-editor/use-save-image.js.map +1 -1
  69. package/build/components/image-size-control/index.js +6 -0
  70. package/build/components/image-size-control/index.js.map +1 -1
  71. package/build/components/index.js +9 -0
  72. package/build/components/index.js.map +1 -1
  73. package/build/components/inner-blocks/index.js +3 -1
  74. package/build/components/inner-blocks/index.js.map +1 -1
  75. package/build/components/inner-blocks/index.native.js +3 -1
  76. package/build/components/inner-blocks/index.native.js.map +1 -1
  77. package/build/components/inner-blocks/use-nested-settings-update.js +33 -7
  78. package/build/components/inner-blocks/use-nested-settings-update.js.map +1 -1
  79. package/build/components/inserter/block-patterns-explorer/patterns-list.js +2 -2
  80. package/build/components/inserter/block-patterns-explorer/patterns-list.js.map +1 -1
  81. package/build/components/inserter/block-patterns-tab.js +7 -35
  82. package/build/components/inserter/block-patterns-tab.js.map +1 -1
  83. package/build/components/inserter/hooks/use-block-types-state.js +3 -4
  84. package/build/components/inserter/hooks/use-block-types-state.js.map +1 -1
  85. package/build/components/inserter/hooks/use-patterns-state.js +9 -3
  86. package/build/components/inserter/hooks/use-patterns-state.js.map +1 -1
  87. package/build/components/inserter/index.js +2 -4
  88. package/build/components/inserter/index.js.map +1 -1
  89. package/build/components/inserter/index.native.js +21 -32
  90. package/build/components/inserter/index.native.js.map +1 -1
  91. package/build/components/inserter/media-tab/hooks.js +2 -21
  92. package/build/components/inserter/media-tab/hooks.js.map +1 -1
  93. package/build/components/inserter/reusable-block-rename-hint.js +82 -0
  94. package/build/components/inserter/reusable-block-rename-hint.js.map +1 -0
  95. package/build/components/inserter/reusable-blocks-tab.js +6 -2
  96. package/build/components/inserter/reusable-blocks-tab.js.map +1 -1
  97. package/build/components/inserter/reusable-blocks-tab.native.js +2 -2
  98. package/build/components/inserter/reusable-blocks-tab.native.js.map +1 -1
  99. package/build/components/inserter/tabs.native.js +1 -1
  100. package/build/components/inserter/tabs.native.js.map +1 -1
  101. package/build/components/inserter-draggable-blocks/index.js +9 -1
  102. package/build/components/inserter-draggable-blocks/index.js.map +1 -1
  103. package/build/components/link-control/constants.js +1 -1
  104. package/build/components/link-control/constants.js.map +1 -1
  105. package/build/components/link-control/index.js +21 -16
  106. package/build/components/link-control/index.js.map +1 -1
  107. package/build/components/link-control/search-create-button.js +5 -21
  108. package/build/components/link-control/search-create-button.js.map +1 -1
  109. package/build/components/link-control/search-input.js +4 -4
  110. package/build/components/link-control/search-input.js.map +1 -1
  111. package/build/components/link-control/search-item.js +13 -30
  112. package/build/components/link-control/search-item.js.map +1 -1
  113. package/build/components/link-control/search-results.js +2 -2
  114. package/build/components/link-control/search-results.js.map +1 -1
  115. package/build/components/link-control/settings-drawer.js +2 -3
  116. package/build/components/link-control/settings-drawer.js.map +1 -1
  117. package/build/components/list-view/appender.js +2 -6
  118. package/build/components/list-view/appender.js.map +1 -1
  119. package/build/components/list-view/use-list-view-client-ids.js +2 -2
  120. package/build/components/list-view/use-list-view-client-ids.js.map +1 -1
  121. package/build/components/media-placeholder/index.native.js +65 -31
  122. package/build/components/media-placeholder/index.native.js.map +1 -1
  123. package/build/components/preview-options/index.js +2 -2
  124. package/build/components/preview-options/index.js.map +1 -1
  125. package/build/components/provider/index.js +5 -2
  126. package/build/components/provider/index.js.map +1 -1
  127. package/build/components/provider/use-block-sync.js +21 -0
  128. package/build/components/provider/use-block-sync.js.map +1 -1
  129. package/build/components/resolution-tool/index.js +55 -0
  130. package/build/components/resolution-tool/index.js.map +1 -0
  131. package/build/components/rich-text/content.js +0 -36
  132. package/build/components/rich-text/content.js.map +1 -1
  133. package/build/components/rich-text/get-rich-text-values.js +118 -0
  134. package/build/components/rich-text/get-rich-text-values.js.map +1 -0
  135. package/build/components/spacing-sizes-control/hooks/use-spacing-sizes.js +1 -1
  136. package/build/components/spacing-sizes-control/hooks/use-spacing-sizes.js.map +1 -1
  137. package/build/components/spacing-sizes-control/input-controls/axial.js +6 -2
  138. package/build/components/spacing-sizes-control/input-controls/axial.js.map +1 -1
  139. package/build/components/spacing-sizes-control/input-controls/separated.js +5 -1
  140. package/build/components/spacing-sizes-control/input-controls/separated.js.map +1 -1
  141. package/build/components/spacing-sizes-control/input-controls/single.js +5 -1
  142. package/build/components/spacing-sizes-control/input-controls/single.js.map +1 -1
  143. package/build/components/spacing-sizes-control/utils.js +1 -1
  144. package/build/components/spacing-sizes-control/utils.js.map +1 -1
  145. package/build/components/url-input/index.js +4 -2
  146. package/build/components/url-input/index.js.map +1 -1
  147. package/build/components/use-block-display-information/index.js +7 -3
  148. package/build/components/use-block-display-information/index.js.map +1 -1
  149. package/build/components/use-block-drop-zone/index.native.js +49 -8
  150. package/build/components/use-block-drop-zone/index.native.js.map +1 -1
  151. package/build/components/use-setting/index.js +5 -9
  152. package/build/components/use-setting/index.js.map +1 -1
  153. package/build/components/writing-flow/use-tab-nav.js +10 -27
  154. package/build/components/writing-flow/use-tab-nav.js.map +1 -1
  155. package/build/components/writing-mode-control/index.js +70 -0
  156. package/build/components/writing-mode-control/index.js.map +1 -0
  157. package/build/hooks/behaviors.js +25 -20
  158. package/build/hooks/behaviors.js.map +1 -1
  159. package/build/hooks/margin.js +1 -1
  160. package/build/hooks/margin.js.map +1 -1
  161. package/build/hooks/padding.js +1 -1
  162. package/build/hooks/padding.js.map +1 -1
  163. package/build/hooks/supports.js +7 -1
  164. package/build/hooks/supports.js.map +1 -1
  165. package/build/hooks/typography.js +2 -1
  166. package/build/hooks/typography.js.map +1 -1
  167. package/build/hooks/utils.js +5 -9
  168. package/build/hooks/utils.js.map +1 -1
  169. package/build/private-apis.js +16 -3
  170. package/build/private-apis.js.map +1 -1
  171. package/build/private-apis.native.js +3 -0
  172. package/build/private-apis.native.js.map +1 -1
  173. package/build/store/actions.js +196 -2
  174. package/build/store/actions.js.map +1 -1
  175. package/build/store/defaults.js +1 -0
  176. package/build/store/defaults.js.map +1 -1
  177. package/build/store/index.js +10 -1
  178. package/build/store/index.js.map +1 -1
  179. package/build/store/private-actions.js +46 -40
  180. package/build/store/private-actions.js.map +1 -1
  181. package/build/store/private-selectors.js +8 -9
  182. package/build/store/private-selectors.js.map +1 -1
  183. package/build/store/reducer.js +22 -9
  184. package/build/store/reducer.js.map +1 -1
  185. package/build/store/selectors.js +52 -23
  186. package/build/store/selectors.js.map +1 -1
  187. package/build/utils/object.js +38 -2
  188. package/build/utils/object.js.map +1 -1
  189. package/build-module/components/block-draggable/index.js +6 -3
  190. package/build-module/components/block-draggable/index.js.map +1 -1
  191. package/build-module/components/block-draggable/index.native.js +2 -2
  192. package/build-module/components/block-draggable/index.native.js.map +1 -1
  193. package/build-module/components/block-edit/edit.js +27 -10
  194. package/build-module/components/block-edit/edit.js.map +1 -1
  195. package/build-module/components/block-heading-level-dropdown/heading-level-icon.js +9 -2
  196. package/build-module/components/block-heading-level-dropdown/heading-level-icon.js.map +1 -1
  197. package/build-module/components/block-heading-level-dropdown/index.native.js +4 -3
  198. package/build-module/components/block-heading-level-dropdown/index.native.js.map +1 -1
  199. package/build-module/components/block-list/block-outline.native.js +14 -18
  200. package/build-module/components/block-list/block-outline.native.js.map +1 -1
  201. package/build-module/components/block-list/block.native.js +24 -43
  202. package/build-module/components/block-list/block.native.js.map +1 -1
  203. package/build-module/components/block-lock/toolbar.js +25 -7
  204. package/build-module/components/block-lock/toolbar.js.map +1 -1
  205. package/build-module/components/block-mover/index.native.js +3 -3
  206. package/build-module/components/block-mover/index.native.js.map +1 -1
  207. package/build-module/components/block-parent-selector/index.js +7 -5
  208. package/build-module/components/block-parent-selector/index.js.map +1 -1
  209. package/build-module/components/block-removal-warning-modal/index.js +17 -24
  210. package/build-module/components/block-removal-warning-modal/index.js.map +1 -1
  211. package/build-module/components/block-settings/button.native.js +3 -3
  212. package/build-module/components/block-settings/button.native.js.map +1 -1
  213. package/build-module/components/{block-mobile-toolbar/block-actions-menu.native.js → block-toolbar/block-toolbar-menu.native.js} +13 -13
  214. package/build-module/components/block-toolbar/block-toolbar-menu.native.js.map +1 -0
  215. package/build-module/components/block-toolbar/index.js +12 -8
  216. package/build-module/components/block-toolbar/index.js.map +1 -1
  217. package/build-module/components/block-toolbar/index.native.js +60 -4
  218. package/build-module/components/block-toolbar/index.native.js.map +1 -1
  219. package/build-module/components/block-tools/block-contextual-toolbar.js +8 -11
  220. package/build-module/components/block-tools/block-contextual-toolbar.js.map +1 -1
  221. package/build-module/components/colors-gradients/control.js +3 -2
  222. package/build-module/components/colors-gradients/control.js.map +1 -1
  223. package/build-module/components/dimensions-tool/aspect-ratio-tool.js +87 -0
  224. package/build-module/components/dimensions-tool/aspect-ratio-tool.js.map +1 -0
  225. package/build-module/components/dimensions-tool/index.js +195 -0
  226. package/build-module/components/dimensions-tool/index.js.map +1 -0
  227. package/build-module/components/dimensions-tool/scale-tool.js +103 -0
  228. package/build-module/components/dimensions-tool/scale-tool.js.map +1 -0
  229. package/build-module/components/dimensions-tool/width-height-tool.js +122 -0
  230. package/build-module/components/dimensions-tool/width-height-tool.js.map +1 -0
  231. package/build-module/components/global-styles/color-panel.js +22 -16
  232. package/build-module/components/global-styles/color-panel.js.map +1 -1
  233. package/build-module/components/global-styles/dimensions-panel.js +13 -2
  234. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  235. package/build-module/components/global-styles/filters-panel.js +2 -2
  236. package/build-module/components/global-styles/filters-panel.js.map +1 -1
  237. package/build-module/components/global-styles/get-block-css-selector.js +4 -8
  238. package/build-module/components/global-styles/get-block-css-selector.js.map +1 -1
  239. package/build-module/components/global-styles/hooks.js +14 -24
  240. package/build-module/components/global-styles/hooks.js.map +1 -1
  241. package/build-module/components/global-styles/typography-panel.js +51 -5
  242. package/build-module/components/global-styles/typography-panel.js.map +1 -1
  243. package/build-module/components/global-styles/use-global-styles-output.js +13 -18
  244. package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
  245. package/build-module/components/global-styles/utils.js +5 -5
  246. package/build-module/components/global-styles/utils.js.map +1 -1
  247. package/build-module/components/iframe/index.js +37 -49
  248. package/build-module/components/iframe/index.js.map +1 -1
  249. package/build-module/components/iframe/use-compatibility-styles.js +5 -0
  250. package/build-module/components/iframe/use-compatibility-styles.js.map +1 -1
  251. package/build-module/components/image-editor/aspect-ratio-dropdown.js +1 -1
  252. package/build-module/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
  253. package/build-module/components/image-editor/use-save-image.js +1 -2
  254. package/build-module/components/image-editor/use-save-image.js.map +1 -1
  255. package/build-module/components/image-size-control/index.js +5 -0
  256. package/build-module/components/image-size-control/index.js.map +1 -1
  257. package/build-module/components/index.js +1 -0
  258. package/build-module/components/index.js.map +1 -1
  259. package/build-module/components/inner-blocks/index.js +3 -1
  260. package/build-module/components/inner-blocks/index.js.map +1 -1
  261. package/build-module/components/inner-blocks/index.native.js +3 -1
  262. package/build-module/components/inner-blocks/index.native.js.map +1 -1
  263. package/build-module/components/inner-blocks/use-nested-settings-update.js +30 -7
  264. package/build-module/components/inner-blocks/use-nested-settings-update.js.map +1 -1
  265. package/build-module/components/inserter/block-patterns-explorer/patterns-list.js +2 -2
  266. package/build-module/components/inserter/block-patterns-explorer/patterns-list.js.map +1 -1
  267. package/build-module/components/inserter/block-patterns-tab.js +7 -33
  268. package/build-module/components/inserter/block-patterns-tab.js.map +1 -1
  269. package/build-module/components/inserter/hooks/use-block-types-state.js +3 -4
  270. package/build-module/components/inserter/hooks/use-block-types-state.js.map +1 -1
  271. package/build-module/components/inserter/hooks/use-patterns-state.js +9 -3
  272. package/build-module/components/inserter/hooks/use-patterns-state.js.map +1 -1
  273. package/build-module/components/inserter/index.js +2 -4
  274. package/build-module/components/inserter/index.js.map +1 -1
  275. package/build-module/components/inserter/index.native.js +22 -33
  276. package/build-module/components/inserter/index.native.js.map +1 -1
  277. package/build-module/components/inserter/media-tab/hooks.js +2 -21
  278. package/build-module/components/inserter/media-tab/hooks.js.map +1 -1
  279. package/build-module/components/inserter/reusable-block-rename-hint.js +67 -0
  280. package/build-module/components/inserter/reusable-block-rename-hint.js.map +1 -0
  281. package/build-module/components/inserter/reusable-blocks-tab.js +5 -2
  282. package/build-module/components/inserter/reusable-blocks-tab.js.map +1 -1
  283. package/build-module/components/inserter/reusable-blocks-tab.native.js +2 -2
  284. package/build-module/components/inserter/reusable-blocks-tab.native.js.map +1 -1
  285. package/build-module/components/inserter/tabs.native.js +1 -1
  286. package/build-module/components/inserter/tabs.native.js.map +1 -1
  287. package/build-module/components/inserter-draggable-blocks/index.js +9 -2
  288. package/build-module/components/inserter-draggable-blocks/index.js.map +1 -1
  289. package/build-module/components/link-control/constants.js +1 -1
  290. package/build-module/components/link-control/constants.js.map +1 -1
  291. package/build-module/components/link-control/index.js +21 -16
  292. package/build-module/components/link-control/index.js.map +1 -1
  293. package/build-module/components/link-control/search-create-button.js +7 -20
  294. package/build-module/components/link-control/search-create-button.js.map +1 -1
  295. package/build-module/components/link-control/search-input.js +4 -4
  296. package/build-module/components/link-control/search-input.js.map +1 -1
  297. package/build-module/components/link-control/search-item.js +14 -28
  298. package/build-module/components/link-control/search-item.js.map +1 -1
  299. package/build-module/components/link-control/search-results.js +3 -3
  300. package/build-module/components/link-control/search-results.js.map +1 -1
  301. package/build-module/components/link-control/settings-drawer.js +4 -5
  302. package/build-module/components/link-control/settings-drawer.js.map +1 -1
  303. package/build-module/components/list-view/appender.js +2 -6
  304. package/build-module/components/list-view/appender.js.map +1 -1
  305. package/build-module/components/list-view/use-list-view-client-ids.js +2 -2
  306. package/build-module/components/list-view/use-list-view-client-ids.js.map +1 -1
  307. package/build-module/components/media-placeholder/index.native.js +66 -33
  308. package/build-module/components/media-placeholder/index.native.js.map +1 -1
  309. package/build-module/components/preview-options/index.js +2 -2
  310. package/build-module/components/preview-options/index.js.map +1 -1
  311. package/build-module/components/provider/index.js +5 -2
  312. package/build-module/components/provider/index.js.map +1 -1
  313. package/build-module/components/provider/use-block-sync.js +21 -0
  314. package/build-module/components/provider/use-block-sync.js.map +1 -1
  315. package/build-module/components/resolution-tool/index.js +45 -0
  316. package/build-module/components/resolution-tool/index.js.map +1 -0
  317. package/build-module/components/rich-text/content.js +1 -36
  318. package/build-module/components/rich-text/content.js.map +1 -1
  319. package/build-module/components/rich-text/get-rich-text-values.js +105 -0
  320. package/build-module/components/rich-text/get-rich-text-values.js.map +1 -0
  321. package/build-module/components/spacing-sizes-control/hooks/use-spacing-sizes.js +1 -1
  322. package/build-module/components/spacing-sizes-control/hooks/use-spacing-sizes.js.map +1 -1
  323. package/build-module/components/spacing-sizes-control/input-controls/axial.js +7 -3
  324. package/build-module/components/spacing-sizes-control/input-controls/axial.js.map +1 -1
  325. package/build-module/components/spacing-sizes-control/input-controls/separated.js +6 -2
  326. package/build-module/components/spacing-sizes-control/input-controls/separated.js.map +1 -1
  327. package/build-module/components/spacing-sizes-control/input-controls/single.js +6 -2
  328. package/build-module/components/spacing-sizes-control/input-controls/single.js.map +1 -1
  329. package/build-module/components/spacing-sizes-control/utils.js +1 -1
  330. package/build-module/components/spacing-sizes-control/utils.js.map +1 -1
  331. package/build-module/components/url-input/index.js +4 -2
  332. package/build-module/components/url-input/index.js.map +1 -1
  333. package/build-module/components/use-block-display-information/index.js +7 -3
  334. package/build-module/components/use-block-display-information/index.js.map +1 -1
  335. package/build-module/components/use-block-drop-zone/index.native.js +50 -8
  336. package/build-module/components/use-block-drop-zone/index.native.js.map +1 -1
  337. package/build-module/components/use-setting/index.js +5 -9
  338. package/build-module/components/use-setting/index.js.map +1 -1
  339. package/build-module/components/writing-flow/use-tab-nav.js +8 -26
  340. package/build-module/components/writing-flow/use-tab-nav.js.map +1 -1
  341. package/build-module/components/writing-mode-control/index.js +57 -0
  342. package/build-module/components/writing-mode-control/index.js.map +1 -0
  343. package/build-module/hooks/behaviors.js +26 -20
  344. package/build-module/hooks/behaviors.js.map +1 -1
  345. package/build-module/hooks/margin.js +1 -1
  346. package/build-module/hooks/margin.js.map +1 -1
  347. package/build-module/hooks/padding.js +1 -1
  348. package/build-module/hooks/padding.js.map +1 -1
  349. package/build-module/hooks/supports.js +7 -1
  350. package/build-module/hooks/supports.js.map +1 -1
  351. package/build-module/hooks/typography.js +2 -1
  352. package/build-module/hooks/typography.js.map +1 -1
  353. package/build-module/hooks/utils.js +6 -9
  354. package/build-module/hooks/utils.js.map +1 -1
  355. package/build-module/private-apis.js +11 -2
  356. package/build-module/private-apis.js.map +1 -1
  357. package/build-module/private-apis.native.js +2 -0
  358. package/build-module/private-apis.native.js.map +1 -1
  359. package/build-module/store/actions.js +193 -3
  360. package/build-module/store/actions.js.map +1 -1
  361. package/build-module/store/defaults.js +1 -0
  362. package/build-module/store/defaults.js.map +1 -1
  363. package/build-module/store/index.js +10 -1
  364. package/build-module/store/index.js.map +1 -1
  365. package/build-module/store/private-actions.js +45 -36
  366. package/build-module/store/private-actions.js.map +1 -1
  367. package/build-module/store/private-selectors.js +5 -5
  368. package/build-module/store/private-selectors.js.map +1 -1
  369. package/build-module/store/reducer.js +22 -9
  370. package/build-module/store/reducer.js.map +1 -1
  371. package/build-module/store/selectors.js +49 -21
  372. package/build-module/store/selectors.js.map +1 -1
  373. package/build-module/utils/object.js +34 -2
  374. package/build-module/utils/object.js.map +1 -1
  375. package/build-style/content-rtl.css +4 -0
  376. package/build-style/content.css +4 -0
  377. package/build-style/style-rtl.css +137 -129
  378. package/build-style/style.css +137 -129
  379. package/package.json +33 -32
  380. package/src/components/alignment-control/test/__snapshots__/index.js.snap +6 -6
  381. package/src/components/block-alignment-control/test/__snapshots__/index.js.snap +5 -5
  382. package/src/components/block-controls/README.md +89 -0
  383. package/src/components/block-draggable/index.js +13 -4
  384. package/src/components/block-draggable/index.native.js +7 -3
  385. package/src/components/block-draggable/style.scss +1 -0
  386. package/src/components/block-draggable/test/index.native.js +0 -54
  387. package/src/components/block-edit/edit.js +26 -9
  388. package/src/components/block-edit/test/edit.js +1 -1
  389. package/src/components/block-heading-level-dropdown/heading-level-icon.js +6 -1
  390. package/src/components/block-heading-level-dropdown/index.native.js +8 -4
  391. package/src/components/block-inspector/style.scss +2 -1
  392. package/src/components/block-list/block-outline.native.js +26 -25
  393. package/src/components/block-list/block.native.js +24 -38
  394. package/src/components/block-list/block.native.scss +18 -40
  395. package/src/components/block-list/style.native.scss +3 -3
  396. package/src/components/block-lock/toolbar.js +34 -6
  397. package/src/components/block-mover/index.native.js +3 -3
  398. package/src/components/block-mover/test/__snapshots__/index.native.js.snap +16 -6
  399. package/src/components/block-parent-selector/index.js +13 -8
  400. package/src/components/block-removal-warning-modal/index.js +17 -33
  401. package/src/components/block-settings/button.native.js +12 -6
  402. package/src/components/{block-mobile-toolbar/block-actions-menu.native.js → block-toolbar/block-toolbar-menu.native.js} +19 -18
  403. package/src/components/block-toolbar/index.js +11 -9
  404. package/src/components/block-toolbar/index.native.js +86 -6
  405. package/src/components/{block-mobile-toolbar/test/block-actions-menu.native.js → block-toolbar/test/block-toolbar-menu.native.js} +20 -54
  406. package/src/components/block-toolbar/test/index.native.js +42 -0
  407. package/src/components/block-tools/block-contextual-toolbar.js +5 -11
  408. package/src/components/block-tools/style.scss +73 -26
  409. package/src/components/button-block-appender/styles.native.scss +2 -2
  410. package/src/components/caption/README.md +49 -0
  411. package/src/components/colors-gradients/control.js +3 -2
  412. package/src/components/default-block-appender/content.scss +11 -0
  413. package/src/components/dimensions-tool/aspect-ratio-tool.js +124 -0
  414. package/src/components/dimensions-tool/index.js +212 -0
  415. package/src/components/dimensions-tool/scale-tool.js +124 -0
  416. package/src/components/dimensions-tool/stories/aspect-ratio-tool.js +52 -0
  417. package/src/components/dimensions-tool/stories/index.js +54 -0
  418. package/src/components/dimensions-tool/stories/scale-tool.js +48 -0
  419. package/src/components/dimensions-tool/stories/width-height-tool.js +54 -0
  420. package/src/components/dimensions-tool/test/index.js +641 -0
  421. package/src/components/dimensions-tool/width-height-tool.js +113 -0
  422. package/src/components/font-family/README.md +71 -0
  423. package/src/components/global-styles/color-panel.js +24 -17
  424. package/src/components/global-styles/dimensions-panel.js +8 -2
  425. package/src/components/global-styles/filters-panel.js +2 -2
  426. package/src/components/global-styles/get-block-css-selector.js +5 -9
  427. package/src/components/global-styles/hooks.js +22 -26
  428. package/src/components/global-styles/typography-panel.js +57 -5
  429. package/src/components/global-styles/use-global-styles-output.js +36 -18
  430. package/src/components/global-styles/utils.js +15 -6
  431. package/src/components/iframe/index.js +30 -56
  432. package/src/components/iframe/use-compatibility-styles.js +5 -0
  433. package/src/components/image-editor/aspect-ratio-dropdown.js +1 -1
  434. package/src/components/image-editor/use-save-image.js +0 -1
  435. package/src/components/image-size-control/index.js +6 -0
  436. package/src/components/index.js +1 -0
  437. package/src/components/inner-blocks/README.md +10 -0
  438. package/src/components/inner-blocks/index.js +4 -0
  439. package/src/components/inner-blocks/index.native.js +4 -0
  440. package/src/components/inner-blocks/use-nested-settings-update.js +32 -5
  441. package/src/components/inserter/block-patterns-explorer/patterns-list.js +8 -2
  442. package/src/components/inserter/block-patterns-tab.js +8 -56
  443. package/src/components/inserter/hooks/use-block-types-state.js +3 -4
  444. package/src/components/inserter/hooks/use-patterns-state.js +35 -19
  445. package/src/components/inserter/index.js +2 -3
  446. package/src/components/inserter/index.native.js +17 -36
  447. package/src/components/inserter/media-tab/hooks.js +2 -22
  448. package/src/components/inserter/reusable-block-rename-hint.js +69 -0
  449. package/src/components/inserter/reusable-blocks-tab.js +5 -1
  450. package/src/components/inserter/reusable-blocks-tab.native.js +2 -2
  451. package/src/components/inserter/style.native.scss +10 -15
  452. package/src/components/inserter/style.scss +28 -0
  453. package/src/components/inserter/tabs.native.js +5 -1
  454. package/src/components/inserter-draggable-blocks/index.js +13 -2
  455. package/src/components/link-control/constants.js +1 -1
  456. package/src/components/link-control/index.js +36 -29
  457. package/src/components/link-control/search-create-button.js +8 -26
  458. package/src/components/link-control/search-input.js +4 -3
  459. package/src/components/link-control/search-item.js +21 -43
  460. package/src/components/link-control/search-results.js +48 -46
  461. package/src/components/link-control/settings-drawer.js +6 -5
  462. package/src/components/link-control/style.scss +58 -123
  463. package/src/components/link-control/test/index.js +161 -123
  464. package/src/components/list-view/appender.js +5 -6
  465. package/src/components/list-view/style.scss +1 -2
  466. package/src/components/list-view/use-list-view-client-ids.js +2 -2
  467. package/src/components/media-placeholder/index.native.js +108 -59
  468. package/src/components/media-placeholder/styles.native.scss +59 -24
  469. package/src/components/media-replace-flow/test/index.js +1 -1
  470. package/src/components/panel-color-settings/README.md +98 -0
  471. package/src/components/preview-options/README.md +18 -17
  472. package/src/components/preview-options/index.js +2 -2
  473. package/src/components/provider/index.js +9 -2
  474. package/src/components/provider/test/use-block-sync.js +21 -6
  475. package/src/components/provider/use-block-sync.js +19 -0
  476. package/src/components/recursion-provider/README.md +101 -0
  477. package/src/components/resolution-tool/index.js +56 -0
  478. package/src/components/resolution-tool/stories/index.js +48 -0
  479. package/src/components/rich-text/content.js +1 -46
  480. package/src/components/rich-text/get-rich-text-values.js +105 -0
  481. package/src/components/spacing-sizes-control/hooks/use-spacing-sizes.js +1 -1
  482. package/src/components/spacing-sizes-control/input-controls/axial.js +17 -2
  483. package/src/components/spacing-sizes-control/input-controls/separated.js +17 -2
  484. package/src/components/spacing-sizes-control/input-controls/single.js +12 -2
  485. package/src/components/spacing-sizes-control/utils.js +1 -1
  486. package/src/components/text-transform-control/README.md +44 -0
  487. package/src/components/url-input/index.js +2 -0
  488. package/src/components/use-block-display-information/index.js +12 -5
  489. package/src/components/use-block-drop-zone/index.native.js +65 -28
  490. package/src/components/use-setting/index.js +8 -8
  491. package/src/components/writing-flow/use-tab-nav.js +10 -33
  492. package/src/components/writing-mode-control/index.js +68 -0
  493. package/src/components/writing-mode-control/style.scss +18 -0
  494. package/src/hooks/behaviors.js +25 -16
  495. package/src/hooks/margin.js +4 -1
  496. package/src/hooks/padding.js +4 -1
  497. package/src/hooks/supports.js +7 -0
  498. package/src/hooks/typography.js +2 -0
  499. package/src/hooks/utils.js +8 -7
  500. package/src/private-apis.js +13 -1
  501. package/src/private-apis.native.js +2 -0
  502. package/src/store/actions.js +195 -3
  503. package/src/store/defaults.js +1 -0
  504. package/src/store/index.js +10 -0
  505. package/src/store/private-actions.js +39 -39
  506. package/src/store/private-selectors.js +5 -8
  507. package/src/store/reducer.js +22 -9
  508. package/src/store/selectors.js +87 -25
  509. package/src/store/test/actions.js +114 -0
  510. package/src/store/test/private-actions.js +56 -0
  511. package/src/store/test/private-selectors.js +5 -5
  512. package/src/store/test/reducer.js +14 -7
  513. package/src/store/test/selectors.js +1 -1
  514. package/src/utils/object.js +32 -2
  515. package/src/utils/test/object.js +36 -0
  516. package/build/components/block-mobile-toolbar/block-actions-menu.native.js.map +0 -1
  517. package/build/components/block-mobile-toolbar/index.native.js +0 -135
  518. package/build/components/block-mobile-toolbar/index.native.js.map +0 -1
  519. package/build-module/components/block-mobile-toolbar/block-actions-menu.native.js.map +0 -1
  520. package/build-module/components/block-mobile-toolbar/index.native.js +0 -116
  521. package/build-module/components/block-mobile-toolbar/index.native.js.map +0 -1
  522. package/src/components/block-mobile-toolbar/index.native.js +0 -127
  523. package/src/components/block-mobile-toolbar/style.native.scss +0 -16
  524. /package/src/components/{block-mobile-toolbar/test/__snapshots__/block-actions-menu.native.js.snap → block-toolbar/test/__snapshots__/block-toolbar-menu.native.js.snap} +0 -0
@@ -1,14 +1,17 @@
1
1
  /**
2
2
  * External dependencies
3
3
  */
4
- import { useSharedValue } from 'react-native-reanimated';
4
+ import {
5
+ runOnJS,
6
+ useDerivedValue,
7
+ useSharedValue,
8
+ } from 'react-native-reanimated';
5
9
 
6
10
  /**
7
11
  * WordPress dependencies
8
12
  */
9
13
  import { useSelect } from '@wordpress/data';
10
14
  import { useCallback } from '@wordpress/element';
11
- import { useThrottle } from '@wordpress/compose';
12
15
 
13
16
  /**
14
17
  * Internal dependencies
@@ -18,6 +21,8 @@ import { useBlockListContext } from '../block-list/block-list-context';
18
21
  import { getDistanceToNearestEdge } from '../../utils/math';
19
22
  import useOnBlockDrop from '../use-on-block-drop';
20
23
 
24
+ const UPDATE_TARGET_BLOCK_INDEX_THRESHOLD = 20; // In pixels
25
+
21
26
  /** @typedef {import('../../utils/math').WPPoint} WPPoint */
22
27
 
23
28
  /**
@@ -111,6 +116,14 @@ export default function useBlockDropZone( {
111
116
  rootClientId: targetRootClientId = '',
112
117
  } = {} ) {
113
118
  const targetBlockIndex = useSharedValue( null );
119
+ const dragPosition = {
120
+ x: useSharedValue( 0 ),
121
+ y: useSharedValue( 0 ),
122
+ };
123
+ const prevDragPosition = {
124
+ x: useSharedValue( 0 ),
125
+ y: useSharedValue( 0 ),
126
+ };
114
127
 
115
128
  const { getBlockListSettings, getSettings } = useSelect( blockEditorStore );
116
129
  const { blocksLayouts, getBlockLayoutsOrderedByYCoord } =
@@ -118,43 +131,67 @@ export default function useBlockDropZone( {
118
131
 
119
132
  const getSortedBlocksLayouts = useCallback( () => {
120
133
  return getBlockLayoutsOrderedByYCoord( blocksLayouts.current );
134
+ // We use the value of `blocksLayouts` as the dependency.
135
+ // eslint-disable-next-line react-hooks/exhaustive-deps
121
136
  }, [ blocksLayouts.current ] );
122
137
 
123
138
  const isRTL = getSettings().isRTL;
124
139
 
125
140
  const onBlockDrop = useOnBlockDrop();
126
141
 
127
- const throttled = useThrottle(
128
- useCallback(
129
- ( event ) => {
130
- const sortedBlockLayouts = getSortedBlocksLayouts();
131
-
132
- const targetIndex = getNearestBlockIndex(
133
- sortedBlockLayouts,
134
- { x: event.x, y: event.y },
135
- getBlockListSettings( targetRootClientId )?.orientation,
136
- isRTL
137
- );
138
- if ( targetIndex !== null ) {
139
- targetBlockIndex.value = targetIndex ?? 0;
140
- }
141
- },
142
- [
143
- getSortedBlocksLayouts,
144
- getNearestBlockIndex,
145
- getBlockListSettings,
146
- targetBlockIndex,
147
- ]
148
- ),
149
- 200
142
+ const updateTargetBlockIndex = useCallback(
143
+ ( event ) => {
144
+ const sortedBlockLayouts = getSortedBlocksLayouts();
145
+
146
+ const targetIndex = getNearestBlockIndex(
147
+ sortedBlockLayouts,
148
+ { x: event.x, y: event.y },
149
+ getBlockListSettings( targetRootClientId )?.orientation,
150
+ isRTL
151
+ );
152
+ if ( targetIndex !== null ) {
153
+ targetBlockIndex.value = targetIndex ?? 0;
154
+ }
155
+ },
156
+ [
157
+ getSortedBlocksLayouts,
158
+ getBlockListSettings,
159
+ targetRootClientId,
160
+ isRTL,
161
+ targetBlockIndex,
162
+ ]
150
163
  );
151
164
 
165
+ useDerivedValue( () => {
166
+ const x = dragPosition.x.value;
167
+ const y = dragPosition.y.value;
168
+ const prevX = prevDragPosition.x.value;
169
+ const prevY = prevDragPosition.y.value;
170
+ // `updateTargetBlockIndex` performs expensive calculations, so we throttle
171
+ // the call using a offset threshold based on the dragging position.
172
+ if (
173
+ Math.abs( x - prevX ) >= UPDATE_TARGET_BLOCK_INDEX_THRESHOLD ||
174
+ Math.abs( y - prevY ) >= UPDATE_TARGET_BLOCK_INDEX_THRESHOLD
175
+ ) {
176
+ runOnJS( updateTargetBlockIndex )( { x, y } );
177
+ prevDragPosition.x.value = x;
178
+ prevDragPosition.y.value = y;
179
+ return true;
180
+ }
181
+ return false;
182
+ } );
183
+
152
184
  return {
153
- onBlockDragOver( event ) {
154
- throttled( event );
185
+ onBlockDragOver( { x, y } ) {
186
+ dragPosition.x.value = x;
187
+ dragPosition.y.value = y;
188
+ },
189
+ onBlockDragOverWorklet( { x, y } ) {
190
+ 'worklet';
191
+ dragPosition.x.value = x;
192
+ dragPosition.y.value = y;
155
193
  },
156
194
  onBlockDragEnd() {
157
- throttled.cancel();
158
195
  targetBlockIndex.value = null;
159
196
  },
160
197
  onBlockDrop: ( event ) => {
@@ -1,8 +1,3 @@
1
- /**
2
- * External dependencies
3
- */
4
- import { get } from 'lodash';
5
-
6
1
  /**
7
2
  * WordPress dependencies
8
3
  */
@@ -18,6 +13,7 @@ import { applyFilters } from '@wordpress/hooks';
18
13
  */
19
14
  import { useBlockEditContext } from '../block-edit';
20
15
  import { store as blockEditorStore } from '../../store';
16
+ import { getValueFromObjectPath } from '../../utils/object';
21
17
 
22
18
  const blockedPaths = [
23
19
  'color',
@@ -165,11 +161,14 @@ export default function useSetting( path ) {
165
161
  candidateClientId
166
162
  );
167
163
  result =
168
- get(
164
+ getValueFromObjectPath(
169
165
  candidateAtts,
170
166
  `settings.blocks.${ blockName }.${ normalizedPath }`
171
167
  ) ??
172
- get( candidateAtts, `settings.${ normalizedPath }` );
168
+ getValueFromObjectPath(
169
+ candidateAtts,
170
+ `settings.${ normalizedPath }`
171
+ );
173
172
  if ( result !== undefined ) {
174
173
  // Stop the search for more distant ancestors and move on.
175
174
  break;
@@ -183,7 +182,8 @@ export default function useSetting( path ) {
183
182
  const defaultsPath = `__experimentalFeatures.${ normalizedPath }`;
184
183
  const blockPath = `__experimentalFeatures.blocks.${ blockName }.${ normalizedPath }`;
185
184
  result =
186
- get( settings, blockPath ) ?? get( settings, defaultsPath );
185
+ getValueFromObjectPath( settings, blockPath ) ??
186
+ getValueFromObjectPath( settings, defaultsPath );
187
187
  }
188
188
 
189
189
  // Return if the setting was found in either the block instance or the store.
@@ -11,6 +11,7 @@ import { useRef } from '@wordpress/element';
11
11
  * Internal dependencies
12
12
  */
13
13
  import { store as blockEditorStore } from '../../store';
14
+ import { isInSameBlock, isInsideRootBlock } from '../../utils/dom';
14
15
 
15
16
  export default function useTabNav() {
16
17
  const container = useRef();
@@ -116,41 +117,20 @@ export default function useTabNav() {
116
117
  return;
117
118
  }
118
119
 
120
+ const nextTabbable = focus.tabbable[ direction ]( event.target );
121
+
119
122
  // We want to constrain the tabbing to the block and its child blocks.
120
123
  // If the preceding form element is within a different block,
121
124
  // such as two sibling image blocks in the placeholder state,
122
125
  // we want shift + tab from the first form element to move to the image
123
126
  // block toolbar and not the previous image block's form element.
124
- // TODO: Should this become a utility function?
125
- /**
126
- * Determine whether an element is part of or is the selected block.
127
- *
128
- * @param {Object} selectedBlockElement
129
- * @param {Object} element
130
- * @return {boolean} Whether the element is part of or is the selected block.
131
- */
132
- const isElementPartOfSelectedBlock = (
133
- selectedBlockElement,
134
- element
135
- ) => {
136
- // Check if the element is or is within the selected block by finding the
137
- // closest element with a data-block attribute and seeing if
138
- // it matches our current selected block ID
139
- const elementBlockId = element
140
- .closest( '[data-block]' )
141
- ?.getAttribute( 'data-block' );
142
- const isElementSameBlock =
143
- elementBlockId === getSelectedBlockClientId();
144
-
145
- // Check if the element is a child of the selected block. This could be a
146
- // child block in a group or column block, etc.
147
- const isElementChildOfBlock =
148
- selectedBlockElement.contains( element );
149
-
150
- return isElementSameBlock || isElementChildOfBlock;
151
- };
127
+ const currentBlock = event.target.closest( '[data-block]' );
128
+ const isElementPartOfSelectedBlock =
129
+ currentBlock &&
130
+ nextTabbable &&
131
+ ( isInSameBlock( currentBlock, nextTabbable ) ||
132
+ isInsideRootBlock( currentBlock, nextTabbable ) );
152
133
 
153
- const nextTabbable = focus.tabbable[ direction ]( event.target );
154
134
  // Allow tabbing from the block wrapper to a form element,
155
135
  // and between form elements rendered in a block and its child blocks,
156
136
  // such as inside a placeholder. Form elements are generally
@@ -159,10 +139,7 @@ export default function useTabNav() {
159
139
  // future they can be rendered in an iframe or shadow DOM.
160
140
  if (
161
141
  isFormElement( nextTabbable ) &&
162
- isElementPartOfSelectedBlock(
163
- event.target.closest( '[data-block]' ),
164
- nextTabbable
165
- )
142
+ isElementPartOfSelectedBlock
166
143
  ) {
167
144
  return;
168
145
  }
@@ -0,0 +1,68 @@
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import classnames from 'classnames';
5
+
6
+ /**
7
+ * WordPress dependencies
8
+ */
9
+ import { BaseControl, Button } from '@wordpress/components';
10
+ import { __, isRTL } from '@wordpress/i18n';
11
+ import { textHorizontal, textVertical } from '@wordpress/icons';
12
+
13
+ const WRITING_MODES = [
14
+ {
15
+ name: __( 'Horizontal' ),
16
+ value: 'horizontal-tb',
17
+ icon: textHorizontal,
18
+ },
19
+ {
20
+ name: __( 'Vertical' ),
21
+ value: isRTL() ? 'vertical-lr' : 'vertical-rl',
22
+ icon: textVertical,
23
+ },
24
+ ];
25
+
26
+ /**
27
+ * Control to facilitate writing mode selections.
28
+ *
29
+ * @param {Object} props Component props.
30
+ * @param {string} props.className Class name to add to the control.
31
+ * @param {string} props.value Currently selected writing mode.
32
+ * @param {Function} props.onChange Handles change in the writing mode selection.
33
+ *
34
+ * @return {WPElement} Writing Mode control.
35
+ */
36
+ export default function WritingModeControl( { className, value, onChange } ) {
37
+ return (
38
+ <fieldset
39
+ className={ classnames(
40
+ 'block-editor-writing-mode-control',
41
+ className
42
+ ) }
43
+ >
44
+ <BaseControl.VisualLabel as="legend">
45
+ { __( 'Orientation' ) }
46
+ </BaseControl.VisualLabel>
47
+ <div className="block-editor-writing-mode-control__buttons">
48
+ { WRITING_MODES.map( ( writingMode ) => {
49
+ return (
50
+ <Button
51
+ key={ writingMode.value }
52
+ icon={ writingMode.icon }
53
+ label={ writingMode.name }
54
+ isPressed={ writingMode.value === value }
55
+ onClick={ () => {
56
+ onChange(
57
+ writingMode.value === value
58
+ ? undefined
59
+ : writingMode.value
60
+ );
61
+ } }
62
+ />
63
+ );
64
+ } ) }
65
+ </div>
66
+ </fieldset>
67
+ );
68
+ }
@@ -0,0 +1,18 @@
1
+ .block-editor-writing-mode-control {
2
+ border: 0;
3
+ margin: 0;
4
+ padding: 0;
5
+
6
+ .block-editor-writing-mode-control__buttons {
7
+ // 4px of padding makes the row 40px high, same as an input.
8
+ padding: $grid-unit-05 0;
9
+ display: flex;
10
+ }
11
+
12
+ .components-button.has-icon {
13
+ height: $grid-unit-40;
14
+ margin-right: $grid-unit-05;
15
+ min-width: $grid-unit-40;
16
+ padding: 0;
17
+ }
18
+ }
@@ -7,6 +7,7 @@ import { __ } from '@wordpress/i18n';
7
7
  import { hasBlockSupport } from '@wordpress/blocks';
8
8
  import { createHigherOrderComponent } from '@wordpress/compose';
9
9
  import { useSelect } from '@wordpress/data';
10
+ import { useMemo } from '@wordpress/element';
10
11
 
11
12
  /**
12
13
  * Internal dependencies
@@ -65,35 +66,40 @@ function BehaviorsControl( {
65
66
  ...behaviorsOptions,
66
67
  ];
67
68
 
69
+ const { behaviors, behaviorsValue } = useMemo( () => {
70
+ const mergedBehaviors = {
71
+ ...themeBehaviors,
72
+ ...( blockBehaviors || {} ),
73
+ };
74
+
75
+ let value = '';
76
+ if ( blockBehaviors === undefined ) {
77
+ value = 'default';
78
+ }
79
+ if ( blockBehaviors?.lightbox.enabled ) {
80
+ value = 'lightbox';
81
+ }
82
+ return {
83
+ behaviors: mergedBehaviors,
84
+ behaviorsValue: value,
85
+ };
86
+ }, [ blockBehaviors, themeBehaviors ] );
68
87
  // If every behavior is disabled, do not show the behaviors inspector control.
69
88
  if ( behaviorsOptions.length === 0 ) {
70
89
  return null;
71
90
  }
72
- // Block behaviors take precedence over theme behaviors.
73
- const behaviors = { ...themeBehaviors, ...( blockBehaviors || {} ) };
74
91
 
75
92
  const helpText = disabled
76
93
  ? __( 'The lightbox behavior is disabled for linked images.' )
77
94
  : '';
78
95
 
79
- const value = () => {
80
- if ( blockBehaviors === undefined ) {
81
- return 'default';
82
- }
83
- if ( behaviors?.lightbox.enabled ) {
84
- return 'lightbox';
85
- }
86
- return '';
87
- };
88
-
89
96
  return (
90
97
  <InspectorControls group="advanced">
91
- { /* This div is needed to prevent a margin bottom between the dropdown and the button. */ }
92
98
  <div>
93
99
  <SelectControl
94
100
  label={ __( 'Behaviors' ) }
95
101
  // At the moment we are only supporting one behavior (Lightbox)
96
- value={ value() }
102
+ value={ behaviorsValue }
97
103
  options={ options }
98
104
  onChange={ onChangeBehavior }
99
105
  hideCancelButton={ true }
@@ -101,7 +107,7 @@ function BehaviorsControl( {
101
107
  size="__unstable-large"
102
108
  disabled={ disabled }
103
109
  />
104
- { behaviors?.lightbox.enabled && (
110
+ { behaviorsValue === 'lightbox' && (
105
111
  <SelectControl
106
112
  label={ __( 'Animation' ) }
107
113
  // At the moment we are only supporting one behavior (Lightbox)
@@ -115,7 +121,10 @@ function BehaviorsControl( {
115
121
  value: 'zoom',
116
122
  label: __( 'Zoom' ),
117
123
  },
118
- { value: 'fade', label: 'Fade' },
124
+ {
125
+ value: 'fade',
126
+ label: __( 'Fade' ),
127
+ },
119
128
  ] }
120
129
  onChange={ onChangeAnimation }
121
130
  hideCancelButton={ false }
@@ -23,7 +23,10 @@ export function MarginVisualizer( { clientId, attributes, forceShow } ) {
23
23
  const margin = attributes?.style?.spacing?.margin;
24
24
 
25
25
  useEffect( () => {
26
- if ( ! blockElement ) {
26
+ if (
27
+ ! blockElement ||
28
+ null === blockElement.ownerDocument.defaultView
29
+ ) {
27
30
  return;
28
31
  }
29
32
 
@@ -23,7 +23,10 @@ export function PaddingVisualizer( { clientId, attributes, forceShow } ) {
23
23
  const padding = attributes?.style?.spacing?.padding;
24
24
 
25
25
  useEffect( () => {
26
- if ( ! blockElement ) {
26
+ if (
27
+ ! blockElement ||
28
+ null === blockElement.ownerDocument.defaultView
29
+ ) {
27
30
  return;
28
31
  }
29
32
 
@@ -30,11 +30,17 @@ const TEXT_COLUMNS_SUPPORT_KEY = 'typography.textColumns';
30
30
  * decorations e.g. settings found in `block.json`.
31
31
  */
32
32
  const TEXT_DECORATION_SUPPORT_KEY = 'typography.__experimentalTextDecoration';
33
+ /**
34
+ * Key within block settings' supports array indicating support for writing mode
35
+ * e.g. settings found in `block.json`.
36
+ */
37
+ const WRITING_MODE_SUPPORT_KEY = 'typography.__experimentalWritingMode';
33
38
  /**
34
39
  * Key within block settings' supports array indicating support for text
35
40
  * transforms e.g. settings found in `block.json`.
36
41
  */
37
42
  const TEXT_TRANSFORM_SUPPORT_KEY = 'typography.__experimentalTextTransform';
43
+
38
44
  /**
39
45
  * Key within block settings' supports array indicating support for letter-spacing
40
46
  * e.g. settings found in `block.json`.
@@ -50,6 +56,7 @@ const TYPOGRAPHY_SUPPORT_KEYS = [
50
56
  TEXT_COLUMNS_SUPPORT_KEY,
51
57
  TEXT_DECORATION_SUPPORT_KEY,
52
58
  TEXT_TRANSFORM_SUPPORT_KEY,
59
+ WRITING_MODE_SUPPORT_KEY,
53
60
  LETTER_SPACING_SUPPORT_KEY,
54
61
  ];
55
62
  const SPACING_SUPPORT_KEY = 'spacing';
@@ -30,6 +30,7 @@ const TEXT_DECORATION_SUPPORT_KEY = 'typography.__experimentalTextDecoration';
30
30
  const TEXT_COLUMNS_SUPPORT_KEY = 'typography.textColumns';
31
31
  const FONT_STYLE_SUPPORT_KEY = 'typography.__experimentalFontStyle';
32
32
  const FONT_WEIGHT_SUPPORT_KEY = 'typography.__experimentalFontWeight';
33
+ const WRITING_MODE_SUPPORT_KEY = 'typography.__experimentalWritingMode';
33
34
  export const TYPOGRAPHY_SUPPORT_KEY = 'typography';
34
35
  export const TYPOGRAPHY_SUPPORT_KEYS = [
35
36
  LINE_HEIGHT_SUPPORT_KEY,
@@ -39,6 +40,7 @@ export const TYPOGRAPHY_SUPPORT_KEYS = [
39
40
  FONT_FAMILY_SUPPORT_KEY,
40
41
  TEXT_COLUMNS_SUPPORT_KEY,
41
42
  TEXT_DECORATION_SUPPORT_KEY,
43
+ WRITING_MODE_SUPPORT_KEY,
42
44
  TEXT_TRANSFORM_SUPPORT_KEY,
43
45
  LETTER_SPACING_SUPPORT_KEY,
44
46
  ];
@@ -1,8 +1,3 @@
1
- /**
2
- * External dependencies
3
- */
4
- import { get } from 'lodash';
5
-
6
1
  /**
7
2
  * WordPress dependencies
8
3
  */
@@ -14,7 +9,7 @@ import { useMemo } from '@wordpress/element';
14
9
  */
15
10
  import { useSetting } from '../components';
16
11
  import { useSettingsForBlockElement } from '../components/global-styles/hooks';
17
- import { setImmutably } from '../utils/object';
12
+ import { getValueFromObjectPath, setImmutably } from '../utils/object';
18
13
 
19
14
  /**
20
15
  * Removed falsy values from nested object.
@@ -79,7 +74,10 @@ export function transformStyles(
79
74
  Object.entries( activeSupports ).forEach( ( [ support, isActive ] ) => {
80
75
  if ( isActive ) {
81
76
  migrationPaths[ support ].forEach( ( path ) => {
82
- const styleValue = get( referenceBlockAttributes, path );
77
+ const styleValue = getValueFromObjectPath(
78
+ referenceBlockAttributes,
79
+ path
80
+ );
83
81
  if ( styleValue ) {
84
82
  returnBlock = {
85
83
  ...returnBlock,
@@ -136,6 +134,7 @@ export function useBlockSettings( name, parentLayout ) {
136
134
  const lineHeight = useSetting( 'typography.lineHeight' );
137
135
  const textColumns = useSetting( 'typography.textColumns' );
138
136
  const textDecoration = useSetting( 'typography.textDecoration' );
137
+ const writingMode = useSetting( 'typography.writingMode' );
139
138
  const textTransform = useSetting( 'typography.textTransform' );
140
139
  const letterSpacing = useSetting( 'typography.letterSpacing' );
141
140
  const padding = useSetting( 'spacing.padding' );
@@ -211,6 +210,7 @@ export function useBlockSettings( name, parentLayout ) {
211
210
  textDecoration,
212
211
  textTransform,
213
212
  letterSpacing,
213
+ writingMode,
214
214
  },
215
215
  spacing: {
216
216
  spacingSizes: {
@@ -244,6 +244,7 @@ export function useBlockSettings( name, parentLayout ) {
244
244
  textDecoration,
245
245
  textTransform,
246
246
  letterSpacing,
247
+ writingMode,
247
248
  padding,
248
249
  margin,
249
250
  blockGap,
@@ -4,7 +4,8 @@
4
4
  import * as globalStyles from './components/global-styles';
5
5
  import { ExperimentalBlockEditorProvider } from './components/provider';
6
6
  import { lock } from './lock-unlock';
7
- import { getRichTextValues } from './components/rich-text/content';
7
+ import { getRichTextValues } from './components/rich-text/get-rich-text-values';
8
+ import { kebabCase } from './utils/object';
8
9
  import ResizableBoxPopover from './components/resizable-box-popover';
9
10
  import { ComposedPrivateInserter as PrivateInserter } from './components/inserter';
10
11
  import { PrivateListView } from './components/list-view';
@@ -16,6 +17,12 @@ import BlockQuickNavigation from './components/block-quick-navigation';
16
17
  import { LayoutStyle } from './components/block-list/layout';
17
18
  import { BlockRemovalWarningModal } from './components/block-removal-warning-modal';
18
19
  import { useLayoutClasses, useLayoutStyles } from './hooks';
20
+ import DimensionsTool from './components/dimensions-tool';
21
+ import ResolutionTool from './components/resolution-tool';
22
+ import {
23
+ default as ReusableBlocksRenameHint,
24
+ useReusableBlocksRenameHint,
25
+ } from './components/inserter/reusable-block-rename-hint';
19
26
 
20
27
  /**
21
28
  * Private @wordpress/block-editor APIs.
@@ -25,6 +32,7 @@ lock( privateApis, {
25
32
  ...globalStyles,
26
33
  ExperimentalBlockEditorProvider,
27
34
  getRichTextValues,
35
+ kebabCase,
28
36
  PrivateInserter,
29
37
  PrivateListView,
30
38
  ResizableBoxPopover,
@@ -37,4 +45,8 @@ lock( privateApis, {
37
45
  BlockRemovalWarningModal,
38
46
  useLayoutClasses,
39
47
  useLayoutStyles,
48
+ DimensionsTool,
49
+ ResolutionTool,
50
+ ReusableBlocksRenameHint,
51
+ useReusableBlocksRenameHint,
40
52
  } );
@@ -3,6 +3,7 @@
3
3
  */
4
4
  import * as globalStyles from './components/global-styles';
5
5
  import { ExperimentalBlockEditorProvider } from './components/provider';
6
+ import { kebabCase } from './utils/object';
6
7
  import { lock } from './lock-unlock';
7
8
 
8
9
  /**
@@ -11,5 +12,6 @@ import { lock } from './lock-unlock';
11
12
  export const privateApis = {};
12
13
  lock( privateApis, {
13
14
  ...globalStyles,
15
+ kebabCase,
14
16
  ExperimentalBlockEditorProvider,
15
17
  } );