@wordpress/block-editor 12.21.0 → 12.23.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 (408) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/README.md +4 -0
  3. package/build/components/block-actions/index.js +2 -4
  4. package/build/components/block-actions/index.js.map +1 -1
  5. package/build/components/block-heading-level-dropdown/index.js +5 -5
  6. package/build/components/block-heading-level-dropdown/index.js.map +1 -1
  7. package/build/components/block-heading-level-dropdown/index.native.js +5 -4
  8. package/build/components/block-heading-level-dropdown/index.native.js.map +1 -1
  9. package/build/components/block-list/block-crash-boundary.native.js +49 -0
  10. package/build/components/block-list/block-crash-boundary.native.js.map +1 -0
  11. package/build/components/block-list/block-crash-warning.native.js +24 -0
  12. package/build/components/block-list/block-crash-warning.native.js.map +1 -0
  13. package/build/components/block-list/block.js +11 -3
  14. package/build/components/block-list/block.js.map +1 -1
  15. package/build/components/block-list/block.native.js +7 -2
  16. package/build/components/block-list/block.native.js.map +1 -1
  17. package/build/components/block-mover/button.js +4 -1
  18. package/build/components/block-mover/button.js.map +1 -1
  19. package/build/components/block-mover/index.js +5 -1
  20. package/build/components/block-mover/index.js.map +1 -1
  21. package/build/components/block-patterns-list/index.js +4 -1
  22. package/build/components/block-patterns-list/index.js.map +1 -1
  23. package/build/components/block-settings/container.native.js +2 -1
  24. package/build/components/block-settings/container.native.js.map +1 -1
  25. package/build/components/block-settings-menu/block-settings-dropdown.js +36 -32
  26. package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  27. package/build/components/block-settings-menu-controls/index.js +1 -3
  28. package/build/components/block-settings-menu-controls/index.js.map +1 -1
  29. package/build/components/block-switcher/index.js +4 -3
  30. package/build/components/block-switcher/index.js.map +1 -1
  31. package/build/components/block-toolbar/index.js +8 -5
  32. package/build/components/block-toolbar/index.js.map +1 -1
  33. package/build/components/block-toolbar/shuffle.js +19 -10
  34. package/build/components/block-toolbar/shuffle.js.map +1 -1
  35. package/build/components/block-tools/block-selection-button.js +48 -8
  36. package/build/components/block-tools/block-selection-button.js.map +1 -1
  37. package/build/components/block-tools/index.js +14 -2
  38. package/build/components/block-tools/index.js.map +1 -1
  39. package/build/components/child-layout-control/index.js +108 -11
  40. package/build/components/child-layout-control/index.js.map +1 -1
  41. package/build/components/convert-to-group-buttons/toolbar.js +11 -0
  42. package/build/components/convert-to-group-buttons/toolbar.js.map +1 -1
  43. package/build/components/global-styles/advanced-panel.js +9 -2
  44. package/build/components/global-styles/advanced-panel.js.map +1 -1
  45. package/build/components/global-styles/background-panel.js +444 -0
  46. package/build/components/global-styles/background-panel.js.map +1 -0
  47. package/build/components/global-styles/color-panel.js +2 -1
  48. package/build/components/global-styles/color-panel.js.map +1 -1
  49. package/build/components/global-styles/dimensions-panel.js +8 -33
  50. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  51. package/build/components/global-styles/get-global-styles-changes.js +3 -0
  52. package/build/components/global-styles/get-global-styles-changes.js.map +1 -1
  53. package/build/components/global-styles/hooks.js +1 -1
  54. package/build/components/global-styles/hooks.js.map +1 -1
  55. package/build/components/global-styles/index.js +13 -0
  56. package/build/components/global-styles/index.js.map +1 -1
  57. package/build/components/global-styles/use-global-styles-output.js +16 -15
  58. package/build/components/global-styles/use-global-styles-output.js.map +1 -1
  59. package/build/components/global-styles/utils.js +2 -3
  60. package/build/components/global-styles/utils.js.map +1 -1
  61. package/build/components/iframe/index.js +43 -34
  62. package/build/components/iframe/index.js.map +1 -1
  63. package/build/components/inserter/block-patterns-explorer/index.js +3 -6
  64. package/build/components/inserter/block-patterns-explorer/index.js.map +1 -1
  65. package/build/components/inserter/block-patterns-explorer/pattern-list.js +3 -1
  66. package/build/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
  67. package/build/components/inserter/block-patterns-tab/index.js.map +1 -1
  68. package/build/components/inserter/block-patterns-tab/pattern-category-preview-panel.js +5 -0
  69. package/build/components/inserter/block-patterns-tab/pattern-category-preview-panel.js.map +1 -1
  70. package/build/components/inserter/library.js +2 -0
  71. package/build/components/inserter/library.js.map +1 -1
  72. package/build/components/inserter/menu.js +11 -11
  73. package/build/components/inserter/menu.js.map +1 -1
  74. package/build/components/inserter/mobile-tab-navigation.js +1 -1
  75. package/build/components/inserter/mobile-tab-navigation.js.map +1 -1
  76. package/build/components/inserter/search-items.js +36 -15
  77. package/build/components/inserter/search-items.js.map +1 -1
  78. package/build/components/inserter/search-results.js +2 -3
  79. package/build/components/inserter/search-results.js.map +1 -1
  80. package/build/components/inserter/tabs.js +1 -2
  81. package/build/components/inserter/tabs.js.map +1 -1
  82. package/build/components/inspector-controls-tabs/advanced-controls-panel.native.js +36 -0
  83. package/build/components/inspector-controls-tabs/advanced-controls-panel.native.js.map +1 -0
  84. package/build/components/keyboard-shortcuts/index.js +11 -0
  85. package/build/components/keyboard-shortcuts/index.js.map +1 -1
  86. package/build/components/list-view/block-select-button.js +18 -12
  87. package/build/components/list-view/block-select-button.js.map +1 -1
  88. package/build/components/list-view/block.js +4 -11
  89. package/build/components/list-view/block.js.map +1 -1
  90. package/build/components/list-view/index.js +17 -2
  91. package/build/components/list-view/index.js.map +1 -1
  92. package/build/components/list-view/use-list-view-collapse-items.js +47 -0
  93. package/build/components/list-view/use-list-view-collapse-items.js.map +1 -0
  94. package/build/components/list-view/utils.js +5 -3
  95. package/build/components/list-view/utils.js.map +1 -1
  96. package/build/components/rich-text/index.js +14 -11
  97. package/build/components/rich-text/index.js.map +1 -1
  98. package/build/components/rich-text/index.native.js +17 -11
  99. package/build/components/rich-text/index.native.js.map +1 -1
  100. package/build/components/rich-text/native/get-format-colors.native.js +1 -1
  101. package/build/components/rich-text/native/get-format-colors.native.js.map +1 -1
  102. package/build/components/rich-text/native/index.native.js +2 -2
  103. package/build/components/rich-text/native/index.native.js.map +1 -1
  104. package/build/components/rich-text/with-deprecations.js +0 -3
  105. package/build/components/rich-text/with-deprecations.js.map +1 -1
  106. package/build/components/spacing-sizes-control/sides-dropdown/index.js +1 -1
  107. package/build/components/spacing-sizes-control/sides-dropdown/index.js.map +1 -1
  108. package/build/components/url-popover/image-url-input-ui.js +50 -36
  109. package/build/components/url-popover/image-url-input-ui.js.map +1 -1
  110. package/build/components/use-block-display-information/index.js +4 -6
  111. package/build/components/use-block-display-information/index.js.map +1 -1
  112. package/build/components/use-moving-animation/index.js +4 -0
  113. package/build/components/use-moving-animation/index.js.map +1 -1
  114. package/build/components/warning/index.native.js +9 -4
  115. package/build/components/warning/index.native.js.map +1 -1
  116. package/build/hooks/anchor.js +9 -10
  117. package/build/hooks/anchor.js.map +1 -1
  118. package/build/hooks/background.js +85 -402
  119. package/build/hooks/background.js.map +1 -1
  120. package/build/hooks/index.js +9 -1
  121. package/build/hooks/index.js.map +1 -1
  122. package/build/hooks/layout-child.js +28 -6
  123. package/build/hooks/layout-child.js.map +1 -1
  124. package/build/hooks/layout.js +21 -10
  125. package/build/hooks/layout.js.map +1 -1
  126. package/build/hooks/position.js +1 -1
  127. package/build/hooks/position.js.map +1 -1
  128. package/build/hooks/use-zoom-out.js +47 -0
  129. package/build/hooks/use-zoom-out.js.map +1 -0
  130. package/build/index.js +7 -0
  131. package/build/index.js.map +1 -1
  132. package/build/private-apis.js +6 -1
  133. package/build/private-apis.js.map +1 -1
  134. package/build/private-apis.native.js +5 -1
  135. package/build/private-apis.native.js.map +1 -1
  136. package/build/store/private-actions.js +13 -0
  137. package/build/store/private-actions.js.map +1 -1
  138. package/build/store/private-keys.js +2 -1
  139. package/build/store/private-keys.js.map +1 -1
  140. package/build/store/private-selectors.js +24 -3
  141. package/build/store/private-selectors.js.map +1 -1
  142. package/build/store/reducer.js +53 -26
  143. package/build/store/reducer.js.map +1 -1
  144. package/build/store/selectors.js +34 -32
  145. package/build/store/selectors.js.map +1 -1
  146. package/build/store/utils.js +7 -1
  147. package/build/store/utils.js.map +1 -1
  148. package/build/utils/transform-styles/index.js +2 -1
  149. package/build/utils/transform-styles/index.js.map +1 -1
  150. package/build-module/components/block-actions/index.js +2 -4
  151. package/build-module/components/block-actions/index.js.map +1 -1
  152. package/build-module/components/block-heading-level-dropdown/index.js +5 -5
  153. package/build-module/components/block-heading-level-dropdown/index.js.map +1 -1
  154. package/build-module/components/block-heading-level-dropdown/index.native.js +5 -4
  155. package/build-module/components/block-heading-level-dropdown/index.native.js.map +1 -1
  156. package/build-module/components/block-list/block-crash-boundary.native.js +42 -0
  157. package/build-module/components/block-list/block-crash-boundary.native.js.map +1 -0
  158. package/build-module/components/block-list/block-crash-warning.native.js +15 -0
  159. package/build-module/components/block-list/block-crash-warning.native.js.map +1 -0
  160. package/build-module/components/block-list/block.js +11 -3
  161. package/build-module/components/block-list/block.js.map +1 -1
  162. package/build-module/components/block-list/block.native.js +7 -2
  163. package/build-module/components/block-list/block.native.js.map +1 -1
  164. package/build-module/components/block-mover/button.js +4 -1
  165. package/build-module/components/block-mover/button.js.map +1 -1
  166. package/build-module/components/block-mover/index.js +5 -1
  167. package/build-module/components/block-mover/index.js.map +1 -1
  168. package/build-module/components/block-patterns-list/index.js +4 -1
  169. package/build-module/components/block-patterns-list/index.js.map +1 -1
  170. package/build-module/components/block-settings/container.native.js +3 -2
  171. package/build-module/components/block-settings/container.native.js.map +1 -1
  172. package/build-module/components/block-settings-menu/block-settings-dropdown.js +37 -33
  173. package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  174. package/build-module/components/block-settings-menu-controls/index.js +1 -3
  175. package/build-module/components/block-settings-menu-controls/index.js.map +1 -1
  176. package/build-module/components/block-switcher/index.js +4 -3
  177. package/build-module/components/block-switcher/index.js.map +1 -1
  178. package/build-module/components/block-toolbar/index.js +8 -5
  179. package/build-module/components/block-toolbar/index.js.map +1 -1
  180. package/build-module/components/block-toolbar/shuffle.js +19 -10
  181. package/build-module/components/block-toolbar/shuffle.js.map +1 -1
  182. package/build-module/components/block-tools/block-selection-button.js +50 -10
  183. package/build-module/components/block-tools/block-selection-button.js.map +1 -1
  184. package/build-module/components/block-tools/index.js +14 -2
  185. package/build-module/components/block-tools/index.js.map +1 -1
  186. package/build-module/components/child-layout-control/index.js +109 -12
  187. package/build-module/components/child-layout-control/index.js.map +1 -1
  188. package/build-module/components/convert-to-group-buttons/toolbar.js +12 -1
  189. package/build-module/components/convert-to-group-buttons/toolbar.js.map +1 -1
  190. package/build-module/components/global-styles/advanced-panel.js +9 -2
  191. package/build-module/components/global-styles/advanced-panel.js.map +1 -1
  192. package/build-module/components/global-styles/background-panel.js +430 -0
  193. package/build-module/components/global-styles/background-panel.js.map +1 -0
  194. package/build-module/components/global-styles/color-panel.js +2 -1
  195. package/build-module/components/global-styles/color-panel.js.map +1 -1
  196. package/build-module/components/global-styles/dimensions-panel.js +9 -34
  197. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  198. package/build-module/components/global-styles/get-global-styles-changes.js +3 -0
  199. package/build-module/components/global-styles/get-global-styles-changes.js.map +1 -1
  200. package/build-module/components/global-styles/hooks.js +1 -1
  201. package/build-module/components/global-styles/hooks.js.map +1 -1
  202. package/build-module/components/global-styles/index.js +1 -0
  203. package/build-module/components/global-styles/index.js.map +1 -1
  204. package/build-module/components/global-styles/use-global-styles-output.js +17 -16
  205. package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
  206. package/build-module/components/global-styles/utils.js +1 -2
  207. package/build-module/components/global-styles/utils.js.map +1 -1
  208. package/build-module/components/iframe/index.js +43 -34
  209. package/build-module/components/iframe/index.js.map +1 -1
  210. package/build-module/components/inserter/block-patterns-explorer/index.js +3 -6
  211. package/build-module/components/inserter/block-patterns-explorer/index.js.map +1 -1
  212. package/build-module/components/inserter/block-patterns-explorer/pattern-list.js +3 -1
  213. package/build-module/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
  214. package/build-module/components/inserter/block-patterns-tab/index.js.map +1 -1
  215. package/build-module/components/inserter/block-patterns-tab/pattern-category-preview-panel.js +5 -0
  216. package/build-module/components/inserter/block-patterns-tab/pattern-category-preview-panel.js.map +1 -1
  217. package/build-module/components/inserter/library.js +2 -0
  218. package/build-module/components/inserter/library.js.map +1 -1
  219. package/build-module/components/inserter/menu.js +11 -11
  220. package/build-module/components/inserter/menu.js.map +1 -1
  221. package/build-module/components/inserter/mobile-tab-navigation.js +1 -1
  222. package/build-module/components/inserter/mobile-tab-navigation.js.map +1 -1
  223. package/build-module/components/inserter/search-items.js +33 -15
  224. package/build-module/components/inserter/search-items.js.map +1 -1
  225. package/build-module/components/inserter/search-results.js +2 -3
  226. package/build-module/components/inserter/search-results.js.map +1 -1
  227. package/build-module/components/inserter/tabs.js +1 -2
  228. package/build-module/components/inserter/tabs.js.map +1 -1
  229. package/build-module/components/inspector-controls-tabs/advanced-controls-panel.native.js +28 -0
  230. package/build-module/components/inspector-controls-tabs/advanced-controls-panel.native.js.map +1 -0
  231. package/build-module/components/keyboard-shortcuts/index.js +11 -0
  232. package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
  233. package/build-module/components/list-view/block-select-button.js +19 -13
  234. package/build-module/components/list-view/block-select-button.js.map +1 -1
  235. package/build-module/components/list-view/block.js +6 -13
  236. package/build-module/components/list-view/block.js.map +1 -1
  237. package/build-module/components/list-view/index.js +17 -2
  238. package/build-module/components/list-view/index.js.map +1 -1
  239. package/build-module/components/list-view/use-list-view-collapse-items.js +40 -0
  240. package/build-module/components/list-view/use-list-view-collapse-items.js.map +1 -0
  241. package/build-module/components/list-view/utils.js +2 -1
  242. package/build-module/components/list-view/utils.js.map +1 -1
  243. package/build-module/components/rich-text/index.js +15 -12
  244. package/build-module/components/rich-text/index.js.map +1 -1
  245. package/build-module/components/rich-text/index.native.js +16 -11
  246. package/build-module/components/rich-text/index.native.js.map +1 -1
  247. package/build-module/components/rich-text/native/get-format-colors.native.js +1 -1
  248. package/build-module/components/rich-text/native/get-format-colors.native.js.map +1 -1
  249. package/build-module/components/rich-text/native/index.native.js +2 -2
  250. package/build-module/components/rich-text/native/index.native.js.map +1 -1
  251. package/build-module/components/rich-text/with-deprecations.js +0 -3
  252. package/build-module/components/rich-text/with-deprecations.js.map +1 -1
  253. package/build-module/components/spacing-sizes-control/sides-dropdown/index.js +1 -1
  254. package/build-module/components/spacing-sizes-control/sides-dropdown/index.js.map +1 -1
  255. package/build-module/components/url-popover/image-url-input-ui.js +50 -36
  256. package/build-module/components/url-popover/image-url-input-ui.js.map +1 -1
  257. package/build-module/components/use-block-display-information/index.js +5 -7
  258. package/build-module/components/use-block-display-information/index.js.map +1 -1
  259. package/build-module/components/use-moving-animation/index.js +4 -0
  260. package/build-module/components/use-moving-animation/index.js.map +1 -1
  261. package/build-module/components/warning/index.native.js +9 -4
  262. package/build-module/components/warning/index.native.js.map +1 -1
  263. package/build-module/hooks/anchor.js +10 -11
  264. package/build-module/hooks/anchor.js.map +1 -1
  265. package/build-module/hooks/background.js +82 -397
  266. package/build-module/hooks/background.js.map +1 -1
  267. package/build-module/hooks/index.js +3 -1
  268. package/build-module/hooks/index.js.map +1 -1
  269. package/build-module/hooks/layout-child.js +28 -6
  270. package/build-module/hooks/layout-child.js.map +1 -1
  271. package/build-module/hooks/layout.js +21 -10
  272. package/build-module/hooks/layout.js.map +1 -1
  273. package/build-module/hooks/position.js +1 -1
  274. package/build-module/hooks/position.js.map +1 -1
  275. package/build-module/hooks/use-zoom-out.js +41 -0
  276. package/build-module/hooks/use-zoom-out.js.map +1 -0
  277. package/build-module/index.js +1 -1
  278. package/build-module/index.js.map +1 -1
  279. package/build-module/private-apis.js +7 -2
  280. package/build-module/private-apis.js.map +1 -1
  281. package/build-module/private-apis.native.js +5 -1
  282. package/build-module/private-apis.native.js.map +1 -1
  283. package/build-module/store/private-actions.js +12 -0
  284. package/build-module/store/private-actions.js.map +1 -1
  285. package/build-module/store/private-keys.js +1 -0
  286. package/build-module/store/private-keys.js.map +1 -1
  287. package/build-module/store/private-selectors.js +22 -4
  288. package/build-module/store/private-selectors.js.map +1 -1
  289. package/build-module/store/reducer.js +52 -26
  290. package/build-module/store/reducer.js.map +1 -1
  291. package/build-module/store/selectors.js +35 -33
  292. package/build-module/store/selectors.js.map +1 -1
  293. package/build-module/store/utils.js +6 -1
  294. package/build-module/store/utils.js.map +1 -1
  295. package/build-module/utils/transform-styles/index.js +2 -1
  296. package/build-module/utils/transform-styles/index.js.map +1 -1
  297. package/build-style/content-rtl.css +18 -1
  298. package/build-style/content.css +18 -1
  299. package/build-style/style-rtl.css +92 -99
  300. package/build-style/style.css +92 -99
  301. package/package.json +31 -31
  302. package/src/components/block-actions/index.js +2 -8
  303. package/src/components/block-bindings-toolbar-indicator/style.scss +10 -8
  304. package/src/components/block-heading-level-dropdown/README.md +5 -5
  305. package/src/components/block-heading-level-dropdown/index.js +5 -5
  306. package/src/components/block-heading-level-dropdown/index.native.js +5 -4
  307. package/src/components/block-list/block-crash-boundary.native.js +43 -0
  308. package/src/components/block-list/block-crash-warning.native.js +19 -0
  309. package/src/components/block-list/block.js +19 -3
  310. package/src/components/block-list/block.native.js +14 -7
  311. package/src/components/block-list/content.scss +16 -0
  312. package/src/components/block-mover/button.js +4 -1
  313. package/src/components/block-mover/index.js +8 -1
  314. package/src/components/block-patterns-list/index.js +22 -17
  315. package/src/components/block-preview/style.scss +28 -0
  316. package/src/components/block-settings/container.native.js +5 -1
  317. package/src/components/block-settings-menu/block-settings-dropdown.js +49 -58
  318. package/src/components/block-settings-menu-controls/README.md +0 -9
  319. package/src/components/block-settings-menu-controls/index.js +1 -6
  320. package/src/components/block-switcher/index.js +5 -3
  321. package/src/components/block-switcher/style.scss +1 -1
  322. package/src/components/block-toolbar/index.js +25 -20
  323. package/src/components/block-toolbar/shuffle.js +20 -14
  324. package/src/components/block-toolbar/style.scss +1 -1
  325. package/src/components/block-toolbar/test/index.native.js +1 -7
  326. package/src/components/block-tools/block-selection-button.js +66 -9
  327. package/src/components/block-tools/index.js +18 -1
  328. package/src/components/button-block-appender/content.scss +5 -1
  329. package/src/components/child-layout-control/index.js +147 -35
  330. package/src/components/convert-to-group-buttons/toolbar.js +13 -1
  331. package/src/components/default-block-appender/content.scss +2 -2
  332. package/src/components/global-styles/advanced-panel.js +8 -2
  333. package/src/components/global-styles/background-panel.js +591 -0
  334. package/src/components/global-styles/color-panel.js +2 -1
  335. package/src/components/global-styles/dimensions-panel.js +9 -34
  336. package/src/components/global-styles/get-global-styles-changes.js +3 -0
  337. package/src/components/global-styles/hooks.js +1 -0
  338. package/src/components/global-styles/index.js +4 -0
  339. package/src/components/global-styles/style.scss +78 -1
  340. package/src/{hooks/test/background.js → components/global-styles/test/background-panel.js} +36 -1
  341. package/src/components/global-styles/test/get-global-styles-changes.js +22 -3
  342. package/src/components/global-styles/test/use-global-styles-output.js +40 -9
  343. package/src/components/global-styles/use-global-styles-output.js +30 -17
  344. package/src/components/global-styles/utils.js +1 -18
  345. package/src/components/iframe/index.js +79 -53
  346. package/src/components/inserter/block-patterns-explorer/index.js +2 -9
  347. package/src/components/inserter/block-patterns-explorer/pattern-list.js +7 -1
  348. package/src/components/inserter/block-patterns-tab/index.js +1 -0
  349. package/src/components/inserter/block-patterns-tab/pattern-category-preview-panel.js +5 -0
  350. package/src/components/inserter/library.js +4 -0
  351. package/src/components/inserter/menu.js +12 -11
  352. package/src/components/inserter/mobile-tab-navigation.js +1 -1
  353. package/src/components/inserter/search-items.js +37 -15
  354. package/src/components/inserter/search-results.js +1 -2
  355. package/src/components/inserter/style.scss +6 -12
  356. package/src/components/inserter/tabs.js +1 -2
  357. package/src/components/inspector-controls-tabs/advanced-controls-panel.native.js +31 -0
  358. package/src/components/keyboard-shortcuts/index.js +11 -0
  359. package/src/components/link-control/style.scss +0 -5
  360. package/src/components/list-view/block-select-button.js +15 -19
  361. package/src/components/list-view/block.js +12 -21
  362. package/src/components/list-view/index.js +18 -1
  363. package/src/components/list-view/style.scss +38 -28
  364. package/src/components/list-view/use-list-view-collapse-items.js +33 -0
  365. package/src/components/list-view/utils.js +4 -1
  366. package/src/components/rich-text/README.md +6 -0
  367. package/src/components/rich-text/index.js +30 -13
  368. package/src/components/rich-text/index.native.js +14 -11
  369. package/src/components/rich-text/native/get-format-colors.native.js +1 -1
  370. package/src/components/rich-text/native/index.native.js +2 -2
  371. package/src/components/rich-text/with-deprecations.js +0 -3
  372. package/src/components/spacing-sizes-control/sides-dropdown/index.js +1 -1
  373. package/src/components/url-popover/image-url-input-ui.js +68 -51
  374. package/src/components/use-block-display-information/index.js +8 -10
  375. package/src/components/use-moving-animation/index.js +1 -0
  376. package/src/components/warning/index.native.js +19 -15
  377. package/src/hooks/anchor.js +43 -61
  378. package/src/hooks/background.js +100 -516
  379. package/src/hooks/index.js +3 -0
  380. package/src/hooks/layout-child.js +44 -8
  381. package/src/hooks/layout.js +22 -18
  382. package/src/hooks/position.js +1 -1
  383. package/src/hooks/test/__snapshots__/anchor.native.js.snap +7 -0
  384. package/src/hooks/test/anchor.native.js +32 -0
  385. package/src/hooks/use-zoom-out.js +36 -0
  386. package/src/index.js +1 -0
  387. package/src/private-apis.js +13 -1
  388. package/src/private-apis.native.js +4 -0
  389. package/src/store/private-actions.js +12 -0
  390. package/src/store/private-keys.js +1 -0
  391. package/src/store/private-selectors.js +54 -27
  392. package/src/store/reducer.js +63 -41
  393. package/src/store/selectors.js +195 -180
  394. package/src/store/test/private-actions.js +10 -0
  395. package/src/store/test/private-selectors.js +13 -0
  396. package/src/store/test/reducer.js +26 -0
  397. package/src/store/test/selectors.js +90 -199
  398. package/src/store/utils.js +13 -0
  399. package/src/style.scss +0 -2
  400. package/src/utils/transform-styles/index.js +2 -1
  401. package/tsconfig.json +1 -0
  402. package/build/utils/calculate-scale.js +0 -17
  403. package/build/utils/calculate-scale.js.map +0 -1
  404. package/build-module/utils/calculate-scale.js +0 -11
  405. package/build-module/utils/calculate-scale.js.map +0 -1
  406. package/src/hooks/anchor.scss +0 -4
  407. package/src/hooks/background.scss +0 -75
  408. package/src/utils/calculate-scale.js +0 -20
@@ -94,14 +94,13 @@ export function RichTextWrapper(
94
94
  minWidth,
95
95
  maxWidth,
96
96
  onBlur,
97
- setRef,
98
97
  disableSuggestions,
99
98
  disableAutocorrection,
100
99
  containerWidth,
101
100
  onEnter: onCustomEnter,
102
101
  ...props
103
102
  },
104
- forwardedRef
103
+ providedRef
105
104
  ) {
106
105
  const instanceId = useInstanceId( RichTextWrapper );
107
106
 
@@ -529,13 +528,13 @@ export function RichTextWrapper(
529
528
  [ onReplace, __unstableMarkAutomaticChange ]
530
529
  );
531
530
 
532
- const mergedRef = useMergeRefs( [ forwardedRef, fallbackRef ] );
531
+ const mergedRef = useMergeRefs( [ providedRef, fallbackRef ] );
533
532
 
534
533
  return (
535
534
  <RichText
536
535
  clientId={ clientId }
537
536
  identifier={ identifier }
538
- ref={ mergedRef }
537
+ nativeEditorRef={ mergedRef }
539
538
  value={ adjustedValue }
540
539
  onChange={ adjustedOnChange }
541
540
  selectionStart={ selectionStart }
@@ -586,7 +585,6 @@ export function RichTextWrapper(
586
585
  minWidth={ minWidth }
587
586
  maxWidth={ maxWidth }
588
587
  onBlur={ onBlur }
589
- setRef={ setRef }
590
588
  disableSuggestions={ disableSuggestions }
591
589
  disableAutocorrection={ disableAutocorrection }
592
590
  containerWidth={ containerWidth }
@@ -657,27 +655,32 @@ export function RichTextWrapper(
657
655
  );
658
656
  }
659
657
 
660
- const ForwardedRichTextContainer = withDeprecations(
658
+ // This export does not actually implement a private API, but was exported
659
+ // under this name for interoperability with the web version of the RichText
660
+ // component.
661
+ export const PrivateRichText = withDeprecations(
661
662
  forwardRef( RichTextWrapper )
662
663
  );
663
664
 
664
- ForwardedRichTextContainer.Content = Content;
665
+ PrivateRichText.Content = Content;
665
666
 
666
- ForwardedRichTextContainer.isEmpty = ( value ) => {
667
+ PrivateRichText.isEmpty = ( value ) => {
667
668
  return ! value || value.length === 0;
668
669
  };
669
670
 
670
- ForwardedRichTextContainer.Content.defaultProps = {
671
+ PrivateRichText.Content.defaultProps = {
671
672
  format: 'string',
672
673
  value: '',
673
674
  };
674
675
 
675
- ForwardedRichTextContainer.Raw = RichText;
676
+ PrivateRichText.Raw = forwardRef( ( props, ref ) => (
677
+ <RichText { ...props } nativeEditorRef={ ref } />
678
+ ) );
676
679
 
677
680
  /**
678
681
  * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/rich-text/README.md
679
682
  */
680
- export default ForwardedRichTextContainer;
683
+ export default PrivateRichText;
681
684
  export { RichTextShortcut } from './shortcut';
682
685
  export { RichTextToolbarButton } from './toolbar-button';
683
686
  export { __unstableRichTextInputEvent } from './input-event';
@@ -27,7 +27,7 @@ export function getFormatColors( formats, colors ) {
27
27
  );
28
28
  const currentStyles = currentFormat?.attributes?.style;
29
29
  if (
30
- colorObject &&
30
+ colorObject?.color &&
31
31
  ( ! currentStyles ||
32
32
  currentStyles?.indexOf( colorObject.color ) ===
33
33
  -1 )
@@ -1222,8 +1222,8 @@ export class RichText extends Component {
1222
1222
  ref={ ( ref ) => {
1223
1223
  this._editor = ref;
1224
1224
 
1225
- if ( this.props.setRef ) {
1226
- this.props.setRef( ref );
1225
+ if ( this.props.nativeEditorRef ) {
1226
+ this.props.nativeEditorRef( ref );
1227
1227
  }
1228
1228
  } }
1229
1229
  style={ {
@@ -3,7 +3,6 @@
3
3
  */
4
4
  import { forwardRef } from '@wordpress/element';
5
5
  import { children as childrenSource } from '@wordpress/blocks';
6
- import { useInstanceId } from '@wordpress/compose';
7
6
  import { __unstableCreateElement } from '@wordpress/rich-text';
8
7
  import deprecated from '@wordpress/deprecated';
9
8
 
@@ -36,12 +35,10 @@ export function withDeprecations( Component ) {
36
35
  }
37
36
 
38
37
  const NewComponent = props.multiline ? RichTextMultiline : Component;
39
- const instanceId = useInstanceId( NewComponent );
40
38
 
41
39
  return (
42
40
  <NewComponent
43
41
  { ...props }
44
- identifier={ props.identifier || instanceId }
45
42
  value={ value }
46
43
  onChange={ onChange }
47
44
  ref={ ref }
@@ -30,7 +30,7 @@ export default function SidesDropdown( {
30
30
  icon={ sideIcon }
31
31
  label={ labelProp }
32
32
  className="spacing-sizes-control__dropdown"
33
- toggleProps={ { isSmall: true } }
33
+ toggleProps={ { size: 'small' } }
34
34
  >
35
35
  { ( { onClose } ) => {
36
36
  return (
@@ -46,6 +46,7 @@ const ImageURLInputUI = ( {
46
46
  showLightboxSetting,
47
47
  lightboxEnabled,
48
48
  onSetLightbox,
49
+ resetLightbox,
49
50
  } ) => {
50
51
  const [ isOpen, setIsOpen ] = useState( false );
51
52
  // Use internal state instead of a ref to make sure that the component
@@ -241,7 +242,9 @@ const ImageURLInputUI = ( {
241
242
  );
242
243
 
243
244
  const linkEditorValue = urlInput !== null ? urlInput : url;
244
- const showLinkEditor = ( ! linkEditorValue && ! lightboxEnabled ) === true;
245
+ const hideLightboxPanel =
246
+ ! lightboxEnabled || ( lightboxEnabled && ! showLightboxSetting );
247
+ const showLinkEditor = ! linkEditorValue && hideLightboxPanel;
245
248
 
246
249
  const urlLabel = (
247
250
  getLinkDestinations().find(
@@ -249,6 +252,65 @@ const ImageURLInputUI = ( {
249
252
  ) || {}
250
253
  ).title;
251
254
 
255
+ const PopoverChildren = () => {
256
+ if (
257
+ lightboxEnabled &&
258
+ showLightboxSetting &&
259
+ ! url &&
260
+ ! isEditingLink
261
+ ) {
262
+ return (
263
+ <div className="block-editor-url-popover__expand-on-click">
264
+ <Icon icon={ fullscreen } />
265
+ <div className="text">
266
+ <p>{ __( 'Expand on click' ) }</p>
267
+ <p className="description">
268
+ { __( 'Scales the image with a lightbox effect' ) }
269
+ </p>
270
+ </div>
271
+ <Button
272
+ icon={ linkOff }
273
+ label={ __( 'Disable expand on click' ) }
274
+ onClick={ () => {
275
+ onSetLightbox( false );
276
+ } }
277
+ size="compact"
278
+ />
279
+ </div>
280
+ );
281
+ } else if ( ! url || isEditingLink ) {
282
+ return (
283
+ <URLPopover.LinkEditor
284
+ className="block-editor-format-toolbar__link-container-content"
285
+ value={ linkEditorValue }
286
+ onChangeInputValue={ setUrlInput }
287
+ onSubmit={ onSubmitLinkChange() }
288
+ autocompleteRef={ autocompleteRef }
289
+ />
290
+ );
291
+ } else if ( url && ! isEditingLink ) {
292
+ return (
293
+ <>
294
+ <URLPopover.LinkViewer
295
+ className="block-editor-format-toolbar__link-container-content"
296
+ url={ url }
297
+ onEditLinkClick={ startEditLink }
298
+ urlLabel={ urlLabel }
299
+ />
300
+ <Button
301
+ icon={ linkOff }
302
+ label={ __( 'Remove link' ) }
303
+ onClick={ () => {
304
+ onLinkRemove();
305
+ resetLightbox();
306
+ } }
307
+ size="compact"
308
+ />
309
+ </>
310
+ );
311
+ }
312
+ };
313
+
252
314
  return (
253
315
  <>
254
316
  <ToolbarButton
@@ -258,7 +320,9 @@ const ImageURLInputUI = ( {
258
320
  aria-expanded={ isOpen }
259
321
  onClick={ openLinkUI }
260
322
  ref={ setPopoverAnchor }
261
- isActive={ !! url || lightboxEnabled }
323
+ isActive={
324
+ !! url || ( lightboxEnabled && showLightboxSetting )
325
+ }
262
326
  />
263
327
  { isOpen && (
264
328
  <URLPopover
@@ -267,7 +331,7 @@ const ImageURLInputUI = ( {
267
331
  onFocusOutside={ onFocusOutside() }
268
332
  onClose={ closeLinkUI }
269
333
  renderSettings={
270
- ! lightboxEnabled ? () => advancedOptions : null
334
+ hideLightboxPanel ? () => advancedOptions : null
271
335
  }
272
336
  additionalControls={
273
337
  showLinkEditor && (
@@ -314,54 +378,7 @@ const ImageURLInputUI = ( {
314
378
  }
315
379
  offset={ 13 }
316
380
  >
317
- { ( ! url || isEditingLink ) && ! lightboxEnabled && (
318
- <>
319
- <URLPopover.LinkEditor
320
- className="block-editor-format-toolbar__link-container-content"
321
- value={ linkEditorValue }
322
- onChangeInputValue={ setUrlInput }
323
- onSubmit={ onSubmitLinkChange() }
324
- autocompleteRef={ autocompleteRef }
325
- />
326
- </>
327
- ) }
328
- { url && ! isEditingLink && ! lightboxEnabled && (
329
- <>
330
- <URLPopover.LinkViewer
331
- className="block-editor-format-toolbar__link-container-content"
332
- url={ url }
333
- onEditLinkClick={ startEditLink }
334
- urlLabel={ urlLabel }
335
- />
336
- <Button
337
- icon={ linkOff }
338
- label={ __( 'Remove link' ) }
339
- onClick={ onLinkRemove }
340
- size="compact"
341
- />
342
- </>
343
- ) }
344
- { ! url && ! isEditingLink && lightboxEnabled && (
345
- <div className="block-editor-url-popover__expand-on-click">
346
- <Icon icon={ fullscreen } />
347
- <div className="text">
348
- <p>{ __( 'Expand on click' ) }</p>
349
- <p className="description">
350
- { __(
351
- 'Scales the image with a lightbox effect'
352
- ) }
353
- </p>
354
- </div>
355
- <Button
356
- icon={ linkOff }
357
- label={ __( 'Disable expand on click' ) }
358
- onClick={ () => {
359
- onSetLightbox( false );
360
- } }
361
- size="compact"
362
- />
363
- </div>
364
- ) }
381
+ { PopoverChildren() }
365
382
  </URLPopover>
366
383
  ) }
367
384
  </>
@@ -6,6 +6,7 @@ import {
6
6
  store as blocksStore,
7
7
  isReusableBlock,
8
8
  isTemplatePart,
9
+ __experimentalGetBlockLabel as getBlockLabel,
9
10
  } from '@wordpress/blocks';
10
11
  import { __ } from '@wordpress/i18n';
11
12
 
@@ -68,11 +69,8 @@ export default function useBlockDisplayInformation( clientId ) {
68
69
  return useSelect(
69
70
  ( select ) => {
70
71
  if ( ! clientId ) return null;
71
- const {
72
- getBlockName,
73
- getBlockAttributes,
74
- __experimentalGetReusableBlockTitle,
75
- } = select( blockEditorStore );
72
+ const { getBlockName, getBlockAttributes } =
73
+ select( blockEditorStore );
76
74
  const { getBlockType, getActiveBlockVariation } =
77
75
  select( blocksStore );
78
76
  const blockName = getBlockName( clientId );
@@ -80,12 +78,12 @@ export default function useBlockDisplayInformation( clientId ) {
80
78
  if ( ! blockType ) return null;
81
79
  const attributes = getBlockAttributes( clientId );
82
80
  const match = getActiveBlockVariation( blockName, attributes );
83
- const isReusable = isReusableBlock( blockType );
84
- const resusableTitle = isReusable
85
- ? __experimentalGetReusableBlockTitle( attributes.ref )
81
+ const isSynced =
82
+ isReusableBlock( blockType ) || isTemplatePart( blockType );
83
+ const syncedTitle = isSynced
84
+ ? getBlockLabel( blockType, attributes )
86
85
  : undefined;
87
- const title = resusableTitle || blockType.title;
88
- const isSynced = isReusable || isTemplatePart( blockType );
86
+ const title = syncedTitle || blockType.title;
89
87
  const positionLabel = getPositionTypeLabel( attributes );
90
88
  const blockTypeInfo = {
91
89
  isSynced,
@@ -142,6 +142,7 @@ function useMovingAnimation( { triggerAnimationOnChange, clientId } ) {
142
142
 
143
143
  return () => {
144
144
  controller.stop();
145
+ controller.set( { x: 0, y: 0 } );
145
146
  };
146
147
  }, [
147
148
  previous,
@@ -16,33 +16,36 @@ import { normalizeIconObject } from '@wordpress/blocks';
16
16
  import styles from './style.scss';
17
17
 
18
18
  function Warning( {
19
+ actions,
19
20
  title,
20
21
  message,
21
22
  icon,
22
23
  iconClass,
23
24
  preferredColorScheme,
24
25
  getStylesFromColorScheme,
26
+ containerStyle: extraContainerStyle,
27
+ titleStyle: extraTitleStyle,
28
+ messageStyle: extraMessageStyle,
25
29
  ...viewProps
26
30
  } ) {
27
31
  icon = icon && normalizeIconObject( icon );
28
32
  const internalIconClass = 'warning-icon' + '-' + preferredColorScheme;
29
- const titleStyle = getStylesFromColorScheme(
30
- styles.title,
31
- styles.titleDark
32
- );
33
- const messageStyle = getStylesFromColorScheme(
34
- styles.message,
35
- styles.messageDark
36
- );
33
+
34
+ const containerStyle = [
35
+ getStylesFromColorScheme( styles.container, styles.containerDark ),
36
+ extraContainerStyle,
37
+ ];
38
+ const titleStyle = [
39
+ getStylesFromColorScheme( styles.title, styles.titleDark ),
40
+ extraTitleStyle,
41
+ ];
42
+ const messageStyle = [
43
+ getStylesFromColorScheme( styles.message, styles.messageDark ),
44
+ extraMessageStyle,
45
+ ];
37
46
 
38
47
  return (
39
- <View
40
- style={ getStylesFromColorScheme(
41
- styles.container,
42
- styles.containerDark
43
- ) }
44
- { ...viewProps }
45
- >
48
+ <View style={ containerStyle } { ...viewProps }>
46
49
  { icon && (
47
50
  <View style={ styles.icon }>
48
51
  <Icon
@@ -53,6 +56,7 @@ function Warning( {
53
56
  ) }
54
57
  { title && <Text style={ titleStyle }>{ title }</Text> }
55
58
  { message && <Text style={ messageStyle }>{ message }</Text> }
59
+ { actions }
56
60
  </View>
57
61
  );
58
62
  }
@@ -2,7 +2,7 @@
2
2
  * WordPress dependencies
3
3
  */
4
4
  import { addFilter } from '@wordpress/hooks';
5
- import { PanelBody, TextControl, ExternalLink } from '@wordpress/components';
5
+ import { TextControl, ExternalLink } from '@wordpress/components';
6
6
  import { __ } from '@wordpress/i18n';
7
7
  import { hasBlockSupport } from '@wordpress/blocks';
8
8
  import { Platform } from '@wordpress/element';
@@ -51,71 +51,53 @@ export function addAttribute( settings ) {
51
51
  return settings;
52
52
  }
53
53
 
54
- function BlockEditAnchorControlPure( {
55
- name: blockName,
56
- anchor,
57
- setAttributes,
58
- } ) {
54
+ function BlockEditAnchorControlPure( { anchor, setAttributes } ) {
59
55
  const blockEditingMode = useBlockEditingMode();
60
56
 
61
- const isWeb = Platform.OS === 'web';
62
- const textControl = (
63
- <TextControl
64
- __nextHasNoMarginBottom
65
- __next40pxDefaultSize
66
- className="html-anchor-control"
67
- label={ __( 'HTML anchor' ) }
68
- help={
69
- <>
70
- { __(
71
- 'Enter a word or two — without spaces — to make a unique web address just for this block, called an “anchor.” Then, you’ll be able to link directly to this section of your page.'
72
- ) }
57
+ if ( blockEditingMode !== 'default' ) {
58
+ return null;
59
+ }
73
60
 
74
- { isWeb && (
75
- <ExternalLink
76
- href={ __(
77
- 'https://wordpress.org/documentation/article/page-jumps/'
78
- ) }
79
- >
80
- { __( 'Learn more about anchors' ) }
81
- </ExternalLink>
82
- ) }
83
- </>
84
- }
85
- value={ anchor || '' }
86
- placeholder={ ! isWeb ? __( 'Add an anchor' ) : null }
87
- onChange={ ( nextValue ) => {
88
- nextValue = nextValue.replace( ANCHOR_REGEX, '-' );
89
- setAttributes( {
90
- anchor: nextValue,
91
- } );
92
- } }
93
- autoCapitalize="none"
94
- autoComplete="off"
95
- />
96
- );
61
+ const isWeb = Platform.OS === 'web';
97
62
 
98
63
  return (
99
- <>
100
- { isWeb && blockEditingMode === 'default' && (
101
- <InspectorControls group="advanced">
102
- { textControl }
103
- </InspectorControls>
104
- ) }
105
- { /*
106
- * We plan to remove scoping anchors to 'core/heading' to support
107
- * anchors for all eligble blocks. Additionally we plan to explore
108
- * leveraging InspectorAdvancedControls instead of a custom
109
- * PanelBody title. https://github.com/WordPress/gutenberg/issues/28363
110
- */ }
111
- { ! isWeb && blockName === 'core/heading' && (
112
- <InspectorControls>
113
- <PanelBody title={ __( 'Heading settings' ) }>
114
- { textControl }
115
- </PanelBody>
116
- </InspectorControls>
117
- ) }
118
- </>
64
+ <InspectorControls group="advanced">
65
+ <TextControl
66
+ __nextHasNoMarginBottom
67
+ __next40pxDefaultSize
68
+ className="html-anchor-control"
69
+ label={ __( 'HTML anchor' ) }
70
+ help={
71
+ <>
72
+ { __(
73
+ 'Enter a word or two — without spaces — to make a unique web address just for this block, called an “anchor”. Then, you’ll be able to link directly to this section of your page.'
74
+ ) }
75
+ { isWeb && (
76
+ <>
77
+ { ' ' }
78
+ <ExternalLink
79
+ href={ __(
80
+ 'https://wordpress.org/documentation/article/page-jumps/'
81
+ ) }
82
+ >
83
+ { __( 'Learn more about anchors' ) }
84
+ </ExternalLink>
85
+ </>
86
+ ) }
87
+ </>
88
+ }
89
+ value={ anchor || '' }
90
+ placeholder={ ! isWeb ? __( 'Add an anchor' ) : null }
91
+ onChange={ ( nextValue ) => {
92
+ nextValue = nextValue.replace( ANCHOR_REGEX, '-' );
93
+ setAttributes( {
94
+ anchor: nextValue,
95
+ } );
96
+ } }
97
+ autoCapitalize="none"
98
+ autoComplete="off"
99
+ />
100
+ </InspectorControls>
119
101
  );
120
102
  }
121
103