@wordpress/block-editor 12.18.2 → 12.19.1

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 (875) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/build/autocompleters/block.js +1 -2
  3. package/build/autocompleters/block.js.map +1 -1
  4. package/build/autocompleters/link.js +1 -2
  5. package/build/autocompleters/link.js.map +1 -1
  6. package/build/components/alignment-control/ui.js +1 -2
  7. package/build/components/alignment-control/ui.js.map +1 -1
  8. package/build/components/autocomplete/index.js +1 -2
  9. package/build/components/autocomplete/index.js.map +1 -1
  10. package/build/components/block-alignment-control/constants.js +2 -4
  11. package/build/components/block-alignment-control/constants.js.map +1 -1
  12. package/build/components/block-alignment-control/ui.js +1 -2
  13. package/build/components/block-alignment-control/ui.js.map +1 -1
  14. package/build/components/block-alignment-control/ui.native.js +1 -2
  15. package/build/components/block-alignment-control/ui.native.js.map +1 -1
  16. package/build/components/block-alignment-matrix-control/index.js +1 -2
  17. package/build/components/block-alignment-matrix-control/index.js.map +1 -1
  18. package/build/components/block-breadcrumb/index.js +1 -2
  19. package/build/components/block-breadcrumb/index.js.map +1 -1
  20. package/build/components/block-canvas/index.js +1 -2
  21. package/build/components/block-canvas/index.js.map +1 -1
  22. package/build/components/block-caption/index.native.js +1 -2
  23. package/build/components/block-caption/index.native.js.map +1 -1
  24. package/build/components/block-card/index.js +1 -2
  25. package/build/components/block-card/index.js.map +1 -1
  26. package/build/components/block-compare/index.js +1 -2
  27. package/build/components/block-compare/index.js.map +1 -1
  28. package/build/components/block-context/index.js +1 -2
  29. package/build/components/block-context/index.js.map +1 -1
  30. package/build/components/block-controls/groups.js +1 -2
  31. package/build/components/block-controls/groups.js.map +1 -1
  32. package/build/components/block-controls/index.js +1 -2
  33. package/build/components/block-controls/index.js.map +1 -1
  34. package/build/components/block-draggable/dropping-insertion-point.native.js +2 -2
  35. package/build/components/block-draggable/dropping-insertion-point.native.js.map +1 -1
  36. package/build/components/block-draggable/index.js +1 -2
  37. package/build/components/block-draggable/index.js.map +1 -1
  38. package/build/components/block-draggable/index.native.js +3 -4
  39. package/build/components/block-draggable/index.native.js.map +1 -1
  40. package/build/components/block-edit/context.js +4 -8
  41. package/build/components/block-edit/context.js.map +1 -1
  42. package/build/components/block-edit/edit.js +1 -2
  43. package/build/components/block-edit/edit.js.map +1 -1
  44. package/build/components/block-edit/edit.native.js +1 -2
  45. package/build/components/block-edit/edit.native.js.map +1 -1
  46. package/build/components/block-full-height-alignment-control/index.js +1 -2
  47. package/build/components/block-full-height-alignment-control/index.js.map +1 -1
  48. package/build/components/block-icon/index.js +1 -2
  49. package/build/components/block-icon/index.js.map +1 -1
  50. package/build/components/block-icon/index.native.js +1 -2
  51. package/build/components/block-icon/index.native.js.map +1 -1
  52. package/build/components/block-info-slot-fill/index.js +1 -2
  53. package/build/components/block-info-slot-fill/index.js.map +1 -1
  54. package/build/components/block-inspector/index.js +11 -9
  55. package/build/components/block-inspector/index.js.map +1 -1
  56. package/build/components/block-list/block-crash-boundary.js +1 -2
  57. package/build/components/block-list/block-crash-boundary.js.map +1 -1
  58. package/build/components/block-list/block-html.js +1 -2
  59. package/build/components/block-list/block-html.js.map +1 -1
  60. package/build/components/block-list/block-list-context.native.js +1 -2
  61. package/build/components/block-list/block-list-context.native.js.map +1 -1
  62. package/build/components/block-list/block-list-item-cell.native.js +1 -2
  63. package/build/components/block-list/block-list-item-cell.native.js.map +1 -1
  64. package/build/components/block-list/block-list-item.native.js +1 -2
  65. package/build/components/block-list/block-list-item.native.js.map +1 -1
  66. package/build/components/block-list/block-outline.native.js +1 -2
  67. package/build/components/block-list/block-outline.native.js.map +1 -1
  68. package/build/components/block-list/block-selection-button.native.js +1 -2
  69. package/build/components/block-list/block-selection-button.native.js.map +1 -1
  70. package/build/components/block-list/block.js +32 -21
  71. package/build/components/block-list/block.js.map +1 -1
  72. package/build/components/block-list/block.native.js +7 -6
  73. package/build/components/block-list/block.native.js.map +1 -1
  74. package/build/components/block-list/grid-item.native.js +1 -2
  75. package/build/components/block-list/grid-item.native.js.map +1 -1
  76. package/build/components/block-list/index.js +19 -9
  77. package/build/components/block-list/index.js.map +1 -1
  78. package/build/components/block-list/insertion-point.native.js +1 -2
  79. package/build/components/block-list/insertion-point.native.js.map +1 -1
  80. package/build/components/block-list/layout.js +2 -4
  81. package/build/components/block-list/layout.js.map +1 -1
  82. package/build/components/block-list/private-block-context.js +1 -2
  83. package/build/components/block-list/private-block-context.js.map +1 -1
  84. package/build/components/block-list/subdirectory-icon.js +1 -2
  85. package/build/components/block-list/subdirectory-icon.js.map +1 -1
  86. package/build/components/block-list/use-block-props/index.js +8 -1
  87. package/build/components/block-list/use-block-props/index.js.map +1 -1
  88. package/build/components/block-list/use-scroll-upon-insertion.native.js +1 -2
  89. package/build/components/block-list/use-scroll-upon-insertion.native.js.map +1 -1
  90. package/build/components/block-list-appender/index.js +5 -52
  91. package/build/components/block-list-appender/index.js.map +1 -1
  92. package/build/components/block-media-update-progress/index.native.js +11 -22
  93. package/build/components/block-media-update-progress/index.native.js.map +1 -1
  94. package/build/components/block-mover/button.js +2 -4
  95. package/build/components/block-mover/button.js.map +1 -1
  96. package/build/components/block-mover/index.js +1 -2
  97. package/build/components/block-mover/index.js.map +1 -1
  98. package/build/components/block-mover/index.native.js +3 -6
  99. package/build/components/block-mover/index.native.js.map +1 -1
  100. package/build/components/block-mover/mover-description.native.js +0 -2
  101. package/build/components/block-mover/mover-description.native.js.map +1 -1
  102. package/build/components/block-navigation/dropdown.js +1 -2
  103. package/build/components/block-navigation/dropdown.js.map +1 -1
  104. package/build/components/block-pattern-setup/constants.js +1 -2
  105. package/build/components/block-pattern-setup/constants.js.map +1 -1
  106. package/build/components/block-pattern-setup/index.js +1 -2
  107. package/build/components/block-pattern-setup/index.js.map +1 -1
  108. package/build/components/block-pattern-setup/setup-toolbar.js +1 -2
  109. package/build/components/block-pattern-setup/setup-toolbar.js.map +1 -1
  110. package/build/components/block-pattern-setup/use-patterns-setup.js +1 -2
  111. package/build/components/block-pattern-setup/use-patterns-setup.js.map +1 -1
  112. package/build/components/block-patterns-list/index.js +1 -2
  113. package/build/components/block-patterns-list/index.js.map +1 -1
  114. package/build/components/block-popover/drop-zone.js +1 -2
  115. package/build/components/block-popover/drop-zone.js.map +1 -1
  116. package/build/components/block-popover/inbetween.js +2 -4
  117. package/build/components/block-popover/inbetween.js.map +1 -1
  118. package/build/components/block-popover/index.js +1 -2
  119. package/build/components/block-popover/index.js.map +1 -1
  120. package/build/components/block-popover/use-popover-scroll.js +1 -2
  121. package/build/components/block-popover/use-popover-scroll.js.map +1 -1
  122. package/build/components/block-preview/auto.js +2 -1
  123. package/build/components/block-preview/auto.js.map +1 -1
  124. package/build/components/block-preview/index.js +1 -2
  125. package/build/components/block-preview/index.js.map +1 -1
  126. package/build/components/block-removal-warning-modal/index.js +4 -2
  127. package/build/components/block-removal-warning-modal/index.js.map +1 -1
  128. package/build/components/block-settings/button.native.js +1 -2
  129. package/build/components/block-settings/button.native.js.map +1 -1
  130. package/build/components/block-settings/container.native.js +1 -2
  131. package/build/components/block-settings/container.native.js.map +1 -1
  132. package/build/components/block-settings/index.native.js +2 -2
  133. package/build/components/block-settings/index.native.js.map +1 -1
  134. package/build/components/block-settings-menu/block-html-convert-button.js +1 -2
  135. package/build/components/block-settings-menu/block-html-convert-button.js.map +1 -1
  136. package/build/components/block-settings-menu/block-mode-toggle.js +1 -2
  137. package/build/components/block-settings-menu/block-mode-toggle.js.map +1 -1
  138. package/build/components/block-settings-menu/block-settings-dropdown.js +1 -2
  139. package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  140. package/build/components/block-settings-menu/block-settings-menu-first-item.js +1 -2
  141. package/build/components/block-settings-menu/block-settings-menu-first-item.js.map +1 -1
  142. package/build/components/block-settings-menu/index.js +1 -2
  143. package/build/components/block-settings-menu/index.js.map +1 -1
  144. package/build/components/block-settings-menu-controls/index.js +1 -2
  145. package/build/components/block-settings-menu-controls/index.js.map +1 -1
  146. package/build/components/block-styles/index.js +1 -2
  147. package/build/components/block-styles/index.js.map +1 -1
  148. package/build/components/block-styles/index.native.js +1 -2
  149. package/build/components/block-styles/index.native.js.map +1 -1
  150. package/build/components/block-styles/preview.native.js +1 -2
  151. package/build/components/block-styles/preview.native.js.map +1 -1
  152. package/build/components/block-switcher/block-transformations-menu.js +1 -2
  153. package/build/components/block-switcher/block-transformations-menu.js.map +1 -1
  154. package/build/components/block-switcher/block-transformations-menu.native.js +1 -2
  155. package/build/components/block-switcher/block-transformations-menu.native.js.map +1 -1
  156. package/build/components/block-switcher/block-variation-transformations.js +1 -2
  157. package/build/components/block-switcher/block-variation-transformations.js.map +1 -1
  158. package/build/components/block-switcher/index.js +13 -11
  159. package/build/components/block-switcher/index.js.map +1 -1
  160. package/build/components/block-switcher/pattern-transformations-menu.js +1 -2
  161. package/build/components/block-switcher/pattern-transformations-menu.js.map +1 -1
  162. package/build/components/block-switcher/use-transformed-patterns.js +1 -2
  163. package/build/components/block-switcher/use-transformed-patterns.js.map +1 -1
  164. package/build/components/block-title/use-block-display-title.js +21 -28
  165. package/build/components/block-title/use-block-display-title.js.map +1 -1
  166. package/build/components/block-toolbar/block-name-context.js +1 -2
  167. package/build/components/block-toolbar/block-name-context.js.map +1 -1
  168. package/build/components/block-toolbar/block-toolbar-last-item.js +1 -2
  169. package/build/components/block-toolbar/block-toolbar-last-item.js.map +1 -1
  170. package/build/components/block-toolbar/block-toolbar-menu.native.js +1 -2
  171. package/build/components/block-toolbar/block-toolbar-menu.native.js.map +1 -1
  172. package/build/components/block-tools/block-selection-button.js +20 -18
  173. package/build/components/block-tools/block-selection-button.js.map +1 -1
  174. package/build/components/block-tools/index.js +4 -12
  175. package/build/components/block-tools/index.js.map +1 -1
  176. package/build/components/block-tools/insertion-point.js +1 -2
  177. package/build/components/block-tools/insertion-point.js.map +1 -1
  178. package/build/components/block-tools/zoom-out-mode-inserters.js +1 -2
  179. package/build/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
  180. package/build/components/block-types-list/index.js +1 -2
  181. package/build/components/block-types-list/index.js.map +1 -1
  182. package/build/components/block-variation-picker/index.js +1 -2
  183. package/build/components/block-variation-picker/index.js.map +1 -1
  184. package/build/components/block-variation-picker/index.native.js +1 -2
  185. package/build/components/block-variation-picker/index.native.js.map +1 -1
  186. package/build/components/block-variation-transforms/index.js +1 -2
  187. package/build/components/block-variation-transforms/index.js.map +1 -1
  188. package/build/components/block-vertical-alignment-control/icons.js +5 -10
  189. package/build/components/block-vertical-alignment-control/icons.js.map +1 -1
  190. package/build/components/block-vertical-alignment-control/ui.js +1 -2
  191. package/build/components/block-vertical-alignment-control/ui.js.map +1 -1
  192. package/build/components/button-block-appender/index.js +2 -4
  193. package/build/components/button-block-appender/index.js.map +1 -1
  194. package/build/components/button-block-appender/index.native.js +1 -2
  195. package/build/components/button-block-appender/index.native.js.map +1 -1
  196. package/build/components/caption/index.native.js +1 -2
  197. package/build/components/caption/index.native.js.map +1 -1
  198. package/build/components/color-palette/index.js +1 -2
  199. package/build/components/color-palette/index.js.map +1 -1
  200. package/build/components/color-palette/with-color-context.js +1 -2
  201. package/build/components/color-palette/with-color-context.js.map +1 -1
  202. package/build/components/color-style-selector/index.js +1 -2
  203. package/build/components/color-style-selector/index.js.map +1 -1
  204. package/build/components/colors/index.js +2 -2
  205. package/build/components/colors/index.js.map +1 -1
  206. package/build/components/colors-gradients/control.js +1 -3
  207. package/build/components/colors-gradients/control.js.map +1 -1
  208. package/build/components/colors-gradients/panel-color-gradient-settings.js +1 -2
  209. package/build/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
  210. package/build/components/contrast-checker/index.js +1 -2
  211. package/build/components/contrast-checker/index.js.map +1 -1
  212. package/build/components/contrast-checker/index.native.js +1 -2
  213. package/build/components/contrast-checker/index.native.js.map +1 -1
  214. package/build/components/convert-to-group-buttons/toolbar.js +1 -2
  215. package/build/components/convert-to-group-buttons/toolbar.js.map +1 -1
  216. package/build/components/default-block-appender/index.js +31 -40
  217. package/build/components/default-block-appender/index.js.map +1 -1
  218. package/build/components/default-block-appender/index.native.js +1 -2
  219. package/build/components/default-block-appender/index.native.js.map +1 -1
  220. package/build/components/dimensions-tool/aspect-ratio-tool.js +2 -2
  221. package/build/components/dimensions-tool/aspect-ratio-tool.js.map +1 -1
  222. package/build/components/dimensions-tool/index.js +1 -2
  223. package/build/components/dimensions-tool/index.js.map +1 -1
  224. package/build/components/duotone-control/index.js +1 -2
  225. package/build/components/duotone-control/index.js.map +1 -1
  226. package/build/components/editable-text/index.js +1 -2
  227. package/build/components/editable-text/index.js.map +1 -1
  228. package/build/components/floating-toolbar/index.native.js +1 -2
  229. package/build/components/floating-toolbar/index.native.js.map +1 -1
  230. package/build/components/floating-toolbar/nav-up-icon.js +1 -2
  231. package/build/components/floating-toolbar/nav-up-icon.js.map +1 -1
  232. package/build/components/font-sizes/font-size-picker.js +1 -2
  233. package/build/components/font-sizes/font-size-picker.js.map +1 -1
  234. package/build/components/global-styles/border-panel.js +56 -8
  235. package/build/components/global-styles/border-panel.js.map +1 -1
  236. package/build/components/global-styles/color-panel.native.js +1 -2
  237. package/build/components/global-styles/color-panel.native.js.map +1 -1
  238. package/build/components/global-styles/context.js +2 -4
  239. package/build/components/global-styles/context.js.map +1 -1
  240. package/build/components/global-styles/get-global-styles-changes.js +2 -4
  241. package/build/components/global-styles/get-global-styles-changes.js.map +1 -1
  242. package/build/components/global-styles/index.js +2 -15
  243. package/build/components/global-styles/index.js.map +1 -1
  244. package/build/components/global-styles/shadow-panel-components.js +133 -0
  245. package/build/components/global-styles/shadow-panel-components.js.map +1 -0
  246. package/build/components/global-styles/typography-panel.js +6 -7
  247. package/build/components/global-styles/typography-panel.js.map +1 -1
  248. package/build/components/global-styles/use-global-styles-output.js +1 -1
  249. package/build/components/global-styles/use-global-styles-output.js.map +1 -1
  250. package/build/components/global-styles/utils.js +38 -14
  251. package/build/components/global-styles/utils.js.map +1 -1
  252. package/build/components/iframe/index.js +1 -2
  253. package/build/components/iframe/index.js.map +1 -1
  254. package/build/components/image-editor/constants.js +3 -6
  255. package/build/components/image-editor/constants.js.map +1 -1
  256. package/build/components/image-link-destinations/index.native.js +1 -2
  257. package/build/components/image-link-destinations/index.native.js.map +1 -1
  258. package/build/components/index.js +2 -2
  259. package/build/components/index.js.map +1 -1
  260. package/build/components/index.native.js +2 -2
  261. package/build/components/index.native.js.map +1 -1
  262. package/build/components/inner-blocks/button-block-appender.js +1 -2
  263. package/build/components/inner-blocks/button-block-appender.js.map +1 -1
  264. package/build/components/inner-blocks/constants.native.js +1 -2
  265. package/build/components/inner-blocks/constants.native.js.map +1 -1
  266. package/build/components/inner-blocks/default-block-appender.js +1 -2
  267. package/build/components/inner-blocks/default-block-appender.js.map +1 -1
  268. package/build/components/inner-blocks/index.js +33 -30
  269. package/build/components/inner-blocks/index.js.map +1 -1
  270. package/build/components/inner-blocks/index.native.js +2 -6
  271. package/build/components/inner-blocks/index.native.js.map +1 -1
  272. package/build/components/inner-blocks/use-inner-block-template-sync.js +2 -3
  273. package/build/components/inner-blocks/use-inner-block-template-sync.js.map +1 -1
  274. package/build/components/inner-blocks/warning-max-depth-exceeded.native.js +1 -2
  275. package/build/components/inner-blocks/warning-max-depth-exceeded.native.js.map +1 -1
  276. package/build/components/inner-blocks/with-client-id.js +1 -2
  277. package/build/components/inner-blocks/with-client-id.js.map +1 -1
  278. package/build/components/inserter/block-patterns-explorer/index.js +1 -2
  279. package/build/components/inserter/block-patterns-explorer/index.js.map +1 -1
  280. package/build/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js +1 -2
  281. package/build/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js.map +1 -1
  282. package/build/components/inserter/block-patterns-explorer/pattern-list.js +1 -2
  283. package/build/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
  284. package/build/components/inserter/block-patterns-tab/index.js +1 -2
  285. package/build/components/inserter/block-patterns-tab/index.js.map +1 -1
  286. package/build/components/inserter/block-patterns-tab/patterns-filter.js +4 -4
  287. package/build/components/inserter/block-patterns-tab/patterns-filter.js.map +1 -1
  288. package/build/components/inserter/block-patterns-tab/utils.js +5 -9
  289. package/build/components/inserter/block-patterns-tab/utils.js.map +1 -1
  290. package/build/components/inserter/block-types-tab.js +1 -2
  291. package/build/components/inserter/block-types-tab.js.map +1 -1
  292. package/build/components/inserter/block-types-tab.native.js +1 -2
  293. package/build/components/inserter/block-types-tab.native.js.map +1 -1
  294. package/build/components/inserter/hooks/use-block-type-impressions.native.js +1 -2
  295. package/build/components/inserter/hooks/use-block-type-impressions.native.js.map +1 -1
  296. package/build/components/inserter/hooks/use-block-types-state.js +1 -2
  297. package/build/components/inserter/hooks/use-block-types-state.js.map +1 -1
  298. package/build/components/inserter/hooks/use-insertion-point.js +1 -2
  299. package/build/components/inserter/hooks/use-insertion-point.js.map +1 -1
  300. package/build/components/inserter/hooks/use-patterns-state.js +1 -2
  301. package/build/components/inserter/hooks/use-patterns-state.js.map +1 -1
  302. package/build/components/inserter/index.js +2 -4
  303. package/build/components/inserter/index.js.map +1 -1
  304. package/build/components/inserter/index.native.js +1 -2
  305. package/build/components/inserter/index.native.js.map +1 -1
  306. package/build/components/inserter/library.js +1 -2
  307. package/build/components/inserter/library.js.map +1 -1
  308. package/build/components/inserter/media-tab/media-list.js +1 -2
  309. package/build/components/inserter/media-tab/media-list.js.map +1 -1
  310. package/build/components/inserter/media-tab/media-tab.js +1 -2
  311. package/build/components/inserter/media-tab/media-tab.js.map +1 -1
  312. package/build/components/inserter/menu.js +1 -2
  313. package/build/components/inserter/menu.js.map +1 -1
  314. package/build/components/inserter/menu.native.js +1 -2
  315. package/build/components/inserter/menu.native.js.map +1 -1
  316. package/build/components/inserter/no-results.js +1 -2
  317. package/build/components/inserter/no-results.js.map +1 -1
  318. package/build/components/inserter/no-results.native.js +1 -2
  319. package/build/components/inserter/no-results.native.js.map +1 -1
  320. package/build/components/inserter/panel.js +1 -2
  321. package/build/components/inserter/panel.js.map +1 -1
  322. package/build/components/inserter/preview-panel.js +1 -2
  323. package/build/components/inserter/preview-panel.js.map +1 -1
  324. package/build/components/inserter/quick-inserter.js +3 -2
  325. package/build/components/inserter/quick-inserter.js.map +1 -1
  326. package/build/components/inserter/reusable-blocks-tab.native.js +1 -2
  327. package/build/components/inserter/reusable-blocks-tab.native.js.map +1 -1
  328. package/build/components/inserter/search-items.js +0 -1
  329. package/build/components/inserter/search-items.js.map +1 -1
  330. package/build/components/inserter/search-results.js +1 -2
  331. package/build/components/inserter/search-results.js.map +1 -1
  332. package/build/components/inserter/search-results.native.js +1 -2
  333. package/build/components/inserter/search-results.native.js.map +1 -1
  334. package/build/components/inserter/tabs.js +1 -2
  335. package/build/components/inserter/tabs.js.map +1 -1
  336. package/build/components/inserter/tabs.native.js +1 -2
  337. package/build/components/inserter/tabs.native.js.map +1 -1
  338. package/build/components/inserter/tips.js +1 -2
  339. package/build/components/inserter/tips.js.map +1 -1
  340. package/build/components/inserter-button/index.native.js +1 -2
  341. package/build/components/inserter-button/index.native.js.map +1 -1
  342. package/build/components/inserter-button/sparkles.js +1 -2
  343. package/build/components/inserter-button/sparkles.js.map +1 -1
  344. package/build/components/inserter-draggable-blocks/index.js +11 -2
  345. package/build/components/inserter-draggable-blocks/index.js.map +1 -1
  346. package/build/components/inserter-list-item/index.js +1 -2
  347. package/build/components/inserter-list-item/index.js.map +1 -1
  348. package/build/components/inserter-listbox/context.js +1 -2
  349. package/build/components/inserter-listbox/context.js.map +1 -1
  350. package/build/components/inserter-listbox/group.js +1 -2
  351. package/build/components/inserter-listbox/group.js.map +1 -1
  352. package/build/components/inserter-listbox/index.js +1 -2
  353. package/build/components/inserter-listbox/index.js.map +1 -1
  354. package/build/components/inserter-listbox/item.js +1 -2
  355. package/build/components/inserter-listbox/item.js.map +1 -1
  356. package/build/components/inserter-listbox/row.js +1 -2
  357. package/build/components/inserter-listbox/row.js.map +1 -1
  358. package/build/components/inserter-menu-extension/index.js +1 -2
  359. package/build/components/inserter-menu-extension/index.js.map +1 -1
  360. package/build/components/inspector-controls/groups.js +1 -2
  361. package/build/components/inspector-controls/groups.js.map +1 -1
  362. package/build/components/inspector-controls/index.js +1 -2
  363. package/build/components/inspector-controls/index.js.map +1 -1
  364. package/build/components/inspector-controls-tabs/advanced-controls-panel.js +3 -4
  365. package/build/components/inspector-controls-tabs/advanced-controls-panel.js.map +1 -1
  366. package/build/components/inspector-controls-tabs/position-controls-panel.js +1 -2
  367. package/build/components/inspector-controls-tabs/position-controls-panel.js.map +1 -1
  368. package/build/components/inspector-controls-tabs/settings-tab.js +1 -2
  369. package/build/components/inspector-controls-tabs/settings-tab.js.map +1 -1
  370. package/build/components/inspector-controls-tabs/styles-tab.js +6 -6
  371. package/build/components/inspector-controls-tabs/styles-tab.js.map +1 -1
  372. package/build/components/inspector-controls-tabs/use-is-list-view-tab-disabled.js +1 -2
  373. package/build/components/inspector-controls-tabs/use-is-list-view-tab-disabled.js.map +1 -1
  374. package/build/components/inspector-controls-tabs/utils.js +3 -6
  375. package/build/components/inspector-controls-tabs/utils.js.map +1 -1
  376. package/build/components/justify-content-control/ui.js +1 -2
  377. package/build/components/justify-content-control/ui.js.map +1 -1
  378. package/build/components/keyboard-shortcuts/index.js +1 -2
  379. package/build/components/keyboard-shortcuts/index.js.map +1 -1
  380. package/build/components/line-height-control/index.js +1 -2
  381. package/build/components/line-height-control/index.js.map +1 -1
  382. package/build/components/line-height-control/utils.js +4 -8
  383. package/build/components/line-height-control/utils.js.map +1 -1
  384. package/build/components/link-control/constants.js +7 -14
  385. package/build/components/link-control/constants.js.map +1 -1
  386. package/build/components/link-control/index.js +2 -16
  387. package/build/components/link-control/index.js.map +1 -1
  388. package/build/components/link-control/link-preview.js +13 -15
  389. package/build/components/link-control/link-preview.js.map +1 -1
  390. package/build/components/link-control/search-create-button.js +1 -2
  391. package/build/components/link-control/search-create-button.js.map +1 -1
  392. package/build/components/link-control/search-input.js +1 -2
  393. package/build/components/link-control/search-input.js.map +1 -1
  394. package/build/components/link-control/search-item.js +1 -2
  395. package/build/components/link-control/search-item.js.map +1 -1
  396. package/build/components/link-control/settings-drawer.js +1 -2
  397. package/build/components/link-control/settings-drawer.js.map +1 -1
  398. package/build/components/link-control/settings.js +1 -2
  399. package/build/components/link-control/settings.js.map +1 -1
  400. package/build/components/link-control/use-create-page.js +0 -1
  401. package/build/components/link-control/use-create-page.js.map +1 -1
  402. package/build/components/link-control/use-rich-url-data.js +1 -2
  403. package/build/components/link-control/use-rich-url-data.js.map +1 -1
  404. package/build/components/link-control/viewer-slot.js +1 -2
  405. package/build/components/link-control/viewer-slot.js.map +1 -1
  406. package/build/components/list-view/appender.js +1 -2
  407. package/build/components/list-view/appender.js.map +1 -1
  408. package/build/components/list-view/block-contents.js +1 -2
  409. package/build/components/list-view/block-contents.js.map +1 -1
  410. package/build/components/list-view/block-select-button.js +1 -2
  411. package/build/components/list-view/block-select-button.js.map +1 -1
  412. package/build/components/list-view/block.js +33 -28
  413. package/build/components/list-view/block.js.map +1 -1
  414. package/build/components/list-view/branch.js +1 -2
  415. package/build/components/list-view/branch.js.map +1 -1
  416. package/build/components/list-view/context.js +1 -2
  417. package/build/components/list-view/context.js.map +1 -1
  418. package/build/components/list-view/index.js +20 -17
  419. package/build/components/list-view/index.js.map +1 -1
  420. package/build/components/list-view/leaf.js +1 -2
  421. package/build/components/list-view/leaf.js.map +1 -1
  422. package/build/components/list-view/use-clipboard-handler.js +159 -0
  423. package/build/components/list-view/use-clipboard-handler.js.map +1 -0
  424. package/build/components/list-view/use-list-view-drop-zone.js +1 -2
  425. package/build/components/list-view/use-list-view-drop-zone.js.map +1 -1
  426. package/build/components/list-view/utils.js +4 -4
  427. package/build/components/list-view/utils.js.map +1 -1
  428. package/build/components/media-placeholder/index.js +1 -2
  429. package/build/components/media-placeholder/index.js.map +1 -1
  430. package/build/components/media-placeholder/index.native.js +1 -2
  431. package/build/components/media-placeholder/index.native.js.map +1 -1
  432. package/build/components/media-replace-flow/index.js +1 -2
  433. package/build/components/media-replace-flow/index.js.map +1 -1
  434. package/build/components/media-replace-flow/index.native.js +1 -2
  435. package/build/components/media-replace-flow/index.native.js.map +1 -1
  436. package/build/components/media-upload/check.js +1 -2
  437. package/build/components/media-upload/check.js.map +1 -1
  438. package/build/components/media-upload/constants.native.js +8 -16
  439. package/build/components/media-upload/constants.native.js.map +1 -1
  440. package/build/components/media-upload/index.js +1 -2
  441. package/build/components/media-upload/index.js.map +1 -1
  442. package/build/components/media-upload/index.native.js +1 -2
  443. package/build/components/media-upload/index.native.js.map +1 -1
  444. package/build/components/media-upload-progress/constants.js +6 -12
  445. package/build/components/media-upload-progress/constants.js.map +1 -1
  446. package/build/components/media-upload-progress/index.native.js +1 -2
  447. package/build/components/media-upload-progress/index.native.js.map +1 -1
  448. package/build/components/multi-selection-inspector/index.js +1 -2
  449. package/build/components/multi-selection-inspector/index.js.map +1 -1
  450. package/build/components/navigable-toolbar/index.js +5 -2
  451. package/build/components/navigable-toolbar/index.js.map +1 -1
  452. package/build/components/observe-typing/index.js +1 -2
  453. package/build/components/observe-typing/index.js.map +1 -1
  454. package/build/components/panel-color-settings/index.js +1 -2
  455. package/build/components/panel-color-settings/index.js.map +1 -1
  456. package/build/components/plain-text/index.js +1 -2
  457. package/build/components/plain-text/index.js.map +1 -1
  458. package/build/components/provider/block-refs-provider.js +1 -2
  459. package/build/components/provider/block-refs-provider.js.map +1 -1
  460. package/build/components/provider/index.js +3 -5
  461. package/build/components/provider/index.js.map +1 -1
  462. package/build/components/provider/index.native.js +2 -4
  463. package/build/components/provider/index.native.js.map +1 -1
  464. package/build/components/provider/with-registry-provider.js +1 -2
  465. package/build/components/provider/with-registry-provider.js.map +1 -1
  466. package/build/components/publish-date-time-picker/index.js +1 -2
  467. package/build/components/publish-date-time-picker/index.js.map +1 -1
  468. package/build/components/responsive-block-control/index.js +3 -7
  469. package/build/components/responsive-block-control/index.js.map +1 -1
  470. package/build/components/rich-text/embed-handler-picker.native.js +1 -2
  471. package/build/components/rich-text/embed-handler-picker.native.js.map +1 -1
  472. package/build/components/rich-text/format-edit.js +1 -2
  473. package/build/components/rich-text/format-edit.js.map +1 -1
  474. package/build/components/rich-text/format-toolbar/index.js +1 -2
  475. package/build/components/rich-text/format-toolbar/index.js.map +1 -1
  476. package/build/components/rich-text/format-toolbar/index.native.js +1 -2
  477. package/build/components/rich-text/format-toolbar/index.native.js.map +1 -1
  478. package/build/components/rich-text/format-toolbar-container.js +1 -2
  479. package/build/components/rich-text/format-toolbar-container.js.map +1 -1
  480. package/build/components/rich-text/format-toolbar-container.native.js +1 -2
  481. package/build/components/rich-text/format-toolbar-container.native.js.map +1 -1
  482. package/build/components/rich-text/index.js +6 -7
  483. package/build/components/rich-text/index.js.map +1 -1
  484. package/build/components/rich-text/index.native.js +1 -2
  485. package/build/components/rich-text/index.native.js.map +1 -1
  486. package/build/components/rich-text/multiline.js +1 -2
  487. package/build/components/rich-text/multiline.js.map +1 -1
  488. package/build/components/rich-text/native/index.native.js +1 -6
  489. package/build/components/rich-text/native/index.native.js.map +1 -1
  490. package/build/components/rich-text/native/toolbar-button-with-options.native.js +1 -2
  491. package/build/components/rich-text/native/toolbar-button-with-options.native.js.map +1 -1
  492. package/build/components/rich-text/use-input-rules.js +1 -30
  493. package/build/components/rich-text/use-input-rules.js.map +1 -1
  494. package/build/components/skip-to-selected-block/index.js +1 -2
  495. package/build/components/skip-to-selected-block/index.js.map +1 -1
  496. package/build/components/spacing-sizes-control/index.js +3 -1
  497. package/build/components/spacing-sizes-control/index.js.map +1 -1
  498. package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js +0 -1
  499. package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
  500. package/build/components/spacing-sizes-control/utils.js +5 -10
  501. package/build/components/spacing-sizes-control/utils.js.map +1 -1
  502. package/build/components/tool-selector/index.js +1 -2
  503. package/build/components/tool-selector/index.js.map +1 -1
  504. package/build/components/typewriter/index.js +1 -2
  505. package/build/components/typewriter/index.js.map +1 -1
  506. package/build/components/ungroup-button/index.native.js +1 -2
  507. package/build/components/ungroup-button/index.native.js.map +1 -1
  508. package/build/components/unsupported-block-details/index.native.js +1 -2
  509. package/build/components/unsupported-block-details/index.native.js.map +1 -1
  510. package/build/components/url-input/button.js +1 -2
  511. package/build/components/url-input/button.js.map +1 -1
  512. package/build/components/url-input/index.js +1 -2
  513. package/build/components/url-input/index.js.map +1 -1
  514. package/build/components/url-popover/image-url-input-ui.js +18 -8
  515. package/build/components/url-popover/image-url-input-ui.js.map +1 -1
  516. package/build/components/url-popover/index.js +5 -5
  517. package/build/components/url-popover/index.js.map +1 -1
  518. package/build/components/use-block-drop-zone/index.js +15 -5
  519. package/build/components/use-block-drop-zone/index.js.map +1 -1
  520. package/build/components/use-flash-editable-blocks/index.js +60 -0
  521. package/build/components/use-flash-editable-blocks/index.js.map +1 -0
  522. package/build/components/use-moving-animation/index.js +1 -2
  523. package/build/components/use-moving-animation/index.js.map +1 -1
  524. package/build/components/use-on-block-drop/index.js +4 -4
  525. package/build/components/use-on-block-drop/index.js.map +1 -1
  526. package/build/components/use-settings/index.js +3 -162
  527. package/build/components/use-settings/index.js.map +1 -1
  528. package/build/components/video-player/gridicon-play.native.js +1 -2
  529. package/build/components/video-player/gridicon-play.native.js.map +1 -1
  530. package/build/components/video-player/index.native.js +2 -4
  531. package/build/components/video-player/index.native.js.map +1 -1
  532. package/build/components/warning/index.js +1 -2
  533. package/build/components/warning/index.js.map +1 -1
  534. package/build/components/warning/index.native.js +1 -2
  535. package/build/components/warning/index.native.js.map +1 -1
  536. package/build/components/writing-flow/index.js +1 -2
  537. package/build/components/writing-flow/index.js.map +1 -1
  538. package/build/components/writing-flow/use-clipboard-handler.js +3 -48
  539. package/build/components/writing-flow/use-clipboard-handler.js.map +1 -1
  540. package/build/components/writing-flow/use-drag-selection.js +13 -2
  541. package/build/components/writing-flow/use-drag-selection.js.map +1 -1
  542. package/build/components/writing-flow/utils.js +86 -0
  543. package/build/components/writing-flow/utils.js.map +1 -0
  544. package/build/hooks/align.js +1 -2
  545. package/build/hooks/align.js.map +1 -1
  546. package/build/hooks/align.native.js +2 -2
  547. package/build/hooks/align.native.js.map +1 -1
  548. package/build/hooks/anchor.js +1 -2
  549. package/build/hooks/anchor.js.map +1 -1
  550. package/build/hooks/aria-label.js +1 -2
  551. package/build/hooks/aria-label.js.map +1 -1
  552. package/build/hooks/background.js +52 -14
  553. package/build/hooks/background.js.map +1 -1
  554. package/build/hooks/block-hooks.js +1 -2
  555. package/build/hooks/block-hooks.js.map +1 -1
  556. package/build/hooks/block-renaming.js +1 -2
  557. package/build/hooks/block-renaming.js.map +1 -1
  558. package/build/hooks/border.js +42 -7
  559. package/build/hooks/border.js.map +1 -1
  560. package/build/hooks/color.js +4 -6
  561. package/build/hooks/color.js.map +1 -1
  562. package/build/hooks/content-lock-ui.js +1 -2
  563. package/build/hooks/content-lock-ui.js.map +1 -1
  564. package/build/hooks/custom-class-name.js +1 -2
  565. package/build/hooks/custom-class-name.js.map +1 -1
  566. package/build/hooks/custom-class-name.native.js +1 -2
  567. package/build/hooks/custom-class-name.native.js.map +1 -1
  568. package/build/hooks/dimensions.js +5 -10
  569. package/build/hooks/dimensions.js.map +1 -1
  570. package/build/hooks/duotone.js +1 -3
  571. package/build/hooks/duotone.js.map +1 -1
  572. package/build/hooks/font-family.js +2 -4
  573. package/build/hooks/font-family.js.map +1 -1
  574. package/build/hooks/font-size.js +25 -31
  575. package/build/hooks/font-size.js.map +1 -1
  576. package/build/hooks/index.js +2 -2
  577. package/build/hooks/index.js.map +1 -1
  578. package/build/hooks/layout-child.js +1 -2
  579. package/build/hooks/layout-child.js.map +1 -1
  580. package/build/hooks/layout.js +2 -4
  581. package/build/hooks/layout.js.map +1 -1
  582. package/build/hooks/line-height.js +1 -2
  583. package/build/hooks/line-height.js.map +1 -1
  584. package/build/hooks/position.js +1 -2
  585. package/build/hooks/position.js.map +1 -1
  586. package/build/hooks/style.js +3 -8
  587. package/build/hooks/style.js.map +1 -1
  588. package/build/hooks/typography.js +4 -6
  589. package/build/hooks/typography.js.map +1 -1
  590. package/build/hooks/typography.native.js +3 -6
  591. package/build/hooks/typography.native.js.map +1 -1
  592. package/build/hooks/use-bindings-attributes.js +11 -10
  593. package/build/hooks/use-bindings-attributes.js.map +1 -1
  594. package/build/layouts/constrained.js +1 -2
  595. package/build/layouts/constrained.js.map +1 -1
  596. package/build/layouts/definitions.js +1 -2
  597. package/build/layouts/definitions.js.map +1 -1
  598. package/build/layouts/flex.js +1 -2
  599. package/build/layouts/flex.js.map +1 -1
  600. package/build/layouts/flow.js +1 -2
  601. package/build/layouts/flow.js.map +1 -1
  602. package/build/layouts/grid.js +1 -2
  603. package/build/layouts/grid.js.map +1 -1
  604. package/build/private-apis.js +8 -5
  605. package/build/private-apis.js.map +1 -1
  606. package/build/private-apis.native.js +3 -4
  607. package/build/private-apis.native.js.map +1 -1
  608. package/build/store/actions.js +2 -4
  609. package/build/store/actions.js.map +1 -1
  610. package/build/store/constants.js +1 -2
  611. package/build/store/constants.js.map +1 -1
  612. package/build/store/defaults.js +2 -4
  613. package/build/store/defaults.js.map +1 -1
  614. package/build/store/defaults.native.js +1 -2
  615. package/build/store/defaults.native.js.map +1 -1
  616. package/build/store/get-block-settings.js +180 -0
  617. package/build/store/get-block-settings.js.map +1 -0
  618. package/build/store/index.js +4 -6
  619. package/build/store/index.js.map +1 -1
  620. package/build/store/private-actions.js +37 -3
  621. package/build/store/private-actions.js.map +1 -1
  622. package/build/store/private-selectors.js +55 -29
  623. package/build/store/private-selectors.js.map +1 -1
  624. package/build/store/reducer.js +29 -7
  625. package/build/store/reducer.js.map +1 -1
  626. package/build/store/selectors.js +98 -102
  627. package/build/store/selectors.js.map +1 -1
  628. package/build/store/undo-ignore.js +1 -2
  629. package/build/store/undo-ignore.js.map +1 -1
  630. package/build/utils/selection.js +1 -2
  631. package/build/utils/selection.js.map +1 -1
  632. package/build/utils/transform-styles/index.js +3 -4
  633. package/build/utils/transform-styles/index.js.map +1 -1
  634. package/build-module/components/block-breadcrumb/index.js +0 -1
  635. package/build-module/components/block-breadcrumb/index.js.map +1 -1
  636. package/build-module/components/block-inspector/index.js +10 -7
  637. package/build-module/components/block-inspector/index.js.map +1 -1
  638. package/build-module/components/block-list/block.js +32 -20
  639. package/build-module/components/block-list/block.js.map +1 -1
  640. package/build-module/components/block-list/block.native.js +6 -4
  641. package/build-module/components/block-list/block.native.js.map +1 -1
  642. package/build-module/components/block-list/index.js +18 -7
  643. package/build-module/components/block-list/index.js.map +1 -1
  644. package/build-module/components/block-list/use-block-props/index.js +8 -1
  645. package/build-module/components/block-list/use-block-props/index.js.map +1 -1
  646. package/build-module/components/block-list-appender/index.js +5 -51
  647. package/build-module/components/block-list-appender/index.js.map +1 -1
  648. package/build-module/components/block-mover/mover-description.native.js +0 -2
  649. package/build-module/components/block-mover/mover-description.native.js.map +1 -1
  650. package/build-module/components/block-popover/inbetween.js +0 -1
  651. package/build-module/components/block-popover/inbetween.js.map +1 -1
  652. package/build-module/components/block-preview/auto.js +2 -1
  653. package/build-module/components/block-preview/auto.js.map +1 -1
  654. package/build-module/components/block-removal-warning-modal/index.js +4 -2
  655. package/build-module/components/block-removal-warning-modal/index.js.map +1 -1
  656. package/build-module/components/block-switcher/index.js +12 -9
  657. package/build-module/components/block-switcher/index.js.map +1 -1
  658. package/build-module/components/block-title/use-block-display-title.js +22 -28
  659. package/build-module/components/block-title/use-block-display-title.js.map +1 -1
  660. package/build-module/components/block-tools/block-selection-button.js +20 -17
  661. package/build-module/components/block-tools/block-selection-button.js.map +1 -1
  662. package/build-module/components/block-tools/index.js +2 -10
  663. package/build-module/components/block-tools/index.js.map +1 -1
  664. package/build-module/components/colors-gradients/control.js +0 -1
  665. package/build-module/components/colors-gradients/control.js.map +1 -1
  666. package/build-module/components/default-block-appender/index.js +30 -37
  667. package/build-module/components/default-block-appender/index.js.map +1 -1
  668. package/build-module/components/global-styles/border-panel.js +57 -9
  669. package/build-module/components/global-styles/border-panel.js.map +1 -1
  670. package/build-module/components/global-styles/get-global-styles-changes.js +2 -4
  671. package/build-module/components/global-styles/get-global-styles-changes.js.map +1 -1
  672. package/build-module/components/global-styles/index.js +0 -1
  673. package/build-module/components/global-styles/index.js.map +1 -1
  674. package/build-module/components/global-styles/shadow-panel-components.js +121 -0
  675. package/build-module/components/global-styles/shadow-panel-components.js.map +1 -0
  676. package/build-module/components/global-styles/typography-panel.js +2 -3
  677. package/build-module/components/global-styles/typography-panel.js.map +1 -1
  678. package/build-module/components/global-styles/use-global-styles-output.js +2 -2
  679. package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
  680. package/build-module/components/global-styles/utils.js +30 -1
  681. package/build-module/components/global-styles/utils.js.map +1 -1
  682. package/build-module/components/inner-blocks/index.js +33 -29
  683. package/build-module/components/inner-blocks/index.js.map +1 -1
  684. package/build-module/components/inner-blocks/index.native.js +1 -4
  685. package/build-module/components/inner-blocks/index.native.js.map +1 -1
  686. package/build-module/components/inner-blocks/use-inner-block-template-sync.js +2 -3
  687. package/build-module/components/inner-blocks/use-inner-block-template-sync.js.map +1 -1
  688. package/build-module/components/inserter/block-patterns-tab/patterns-filter.js +4 -4
  689. package/build-module/components/inserter/block-patterns-tab/patterns-filter.js.map +1 -1
  690. package/build-module/components/inserter/block-patterns-tab/utils.js +2 -2
  691. package/build-module/components/inserter/block-patterns-tab/utils.js.map +1 -1
  692. package/build-module/components/inserter/quick-inserter.js +3 -2
  693. package/build-module/components/inserter/quick-inserter.js.map +1 -1
  694. package/build-module/components/inserter/search-items.js +0 -1
  695. package/build-module/components/inserter/search-items.js.map +1 -1
  696. package/build-module/components/inserter-draggable-blocks/index.js +12 -1
  697. package/build-module/components/inserter-draggable-blocks/index.js.map +1 -1
  698. package/build-module/components/inspector-controls-tabs/styles-tab.js +5 -4
  699. package/build-module/components/inspector-controls-tabs/styles-tab.js.map +1 -1
  700. package/build-module/components/link-control/index.js +1 -14
  701. package/build-module/components/link-control/index.js.map +1 -1
  702. package/build-module/components/link-control/link-preview.js +16 -18
  703. package/build-module/components/link-control/link-preview.js.map +1 -1
  704. package/build-module/components/link-control/use-create-page.js +0 -1
  705. package/build-module/components/link-control/use-create-page.js.map +1 -1
  706. package/build-module/components/list-view/block.js +32 -26
  707. package/build-module/components/list-view/block.js.map +1 -1
  708. package/build-module/components/list-view/index.js +17 -11
  709. package/build-module/components/list-view/index.js.map +1 -1
  710. package/build-module/components/list-view/use-clipboard-handler.js +153 -0
  711. package/build-module/components/list-view/use-clipboard-handler.js.map +1 -0
  712. package/build-module/components/list-view/utils.js +4 -4
  713. package/build-module/components/list-view/utils.js.map +1 -1
  714. package/build-module/components/navigable-toolbar/index.js +5 -2
  715. package/build-module/components/navigable-toolbar/index.js.map +1 -1
  716. package/build-module/components/provider/index.js +1 -1
  717. package/build-module/components/provider/index.js.map +1 -1
  718. package/build-module/components/responsive-block-control/index.js +3 -6
  719. package/build-module/components/responsive-block-control/index.js.map +1 -1
  720. package/build-module/components/rich-text/index.js +3 -1
  721. package/build-module/components/rich-text/index.js.map +1 -1
  722. package/build-module/components/rich-text/native/index.native.js +0 -4
  723. package/build-module/components/rich-text/native/index.native.js.map +1 -1
  724. package/build-module/components/rich-text/use-input-rules.js +2 -31
  725. package/build-module/components/rich-text/use-input-rules.js.map +1 -1
  726. package/build-module/components/spacing-sizes-control/index.js +4 -2
  727. package/build-module/components/spacing-sizes-control/index.js.map +1 -1
  728. package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js +0 -1
  729. package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
  730. package/build-module/components/url-popover/image-url-input-ui.js +21 -11
  731. package/build-module/components/url-popover/image-url-input-ui.js.map +1 -1
  732. package/build-module/components/url-popover/index.js +5 -4
  733. package/build-module/components/url-popover/index.js.map +1 -1
  734. package/build-module/components/use-block-drop-zone/index.js +15 -5
  735. package/build-module/components/use-block-drop-zone/index.js.map +1 -1
  736. package/build-module/components/use-flash-editable-blocks/index.js +53 -0
  737. package/build-module/components/use-flash-editable-blocks/index.js.map +1 -0
  738. package/build-module/components/use-on-block-drop/index.js +4 -4
  739. package/build-module/components/use-on-block-drop/index.js.map +1 -1
  740. package/build-module/components/use-settings/index.js +3 -159
  741. package/build-module/components/use-settings/index.js.map +1 -1
  742. package/build-module/components/writing-flow/use-clipboard-handler.js +4 -49
  743. package/build-module/components/writing-flow/use-clipboard-handler.js.map +1 -1
  744. package/build-module/components/writing-flow/use-drag-selection.js +13 -2
  745. package/build-module/components/writing-flow/use-drag-selection.js.map +1 -1
  746. package/build-module/components/writing-flow/utils.js +79 -0
  747. package/build-module/components/writing-flow/utils.js.map +1 -0
  748. package/build-module/hooks/background.js +48 -10
  749. package/build-module/hooks/background.js.map +1 -1
  750. package/build-module/hooks/border.js +38 -3
  751. package/build-module/hooks/border.js.map +1 -1
  752. package/build-module/hooks/duotone.js +0 -1
  753. package/build-module/hooks/duotone.js.map +1 -1
  754. package/build-module/hooks/font-size.js +23 -27
  755. package/build-module/hooks/font-size.js.map +1 -1
  756. package/build-module/hooks/style.js +3 -7
  757. package/build-module/hooks/style.js.map +1 -1
  758. package/build-module/hooks/use-bindings-attributes.js +9 -12
  759. package/build-module/hooks/use-bindings-attributes.js.map +1 -1
  760. package/build-module/private-apis.js +5 -1
  761. package/build-module/private-apis.js.map +1 -1
  762. package/build-module/store/get-block-settings.js +171 -0
  763. package/build-module/store/get-block-settings.js.map +1 -0
  764. package/build-module/store/private-actions.js +35 -3
  765. package/build-module/store/private-actions.js.map +1 -1
  766. package/build-module/store/private-selectors.js +42 -19
  767. package/build-module/store/private-selectors.js.map +1 -1
  768. package/build-module/store/reducer.js +26 -3
  769. package/build-module/store/reducer.js.map +1 -1
  770. package/build-module/store/selectors.js +65 -34
  771. package/build-module/store/selectors.js.map +1 -1
  772. package/build-style/content-rtl.css +23 -15
  773. package/build-style/content.css +23 -15
  774. package/build-style/style-rtl.css +61 -60
  775. package/build-style/style.css +61 -60
  776. package/package.json +31 -31
  777. package/src/components/block-canvas/style.scss +1 -1
  778. package/src/components/block-card/style.scss +3 -1
  779. package/src/components/block-controls/README.md +2 -2
  780. package/src/components/block-inspector/index.js +11 -9
  781. package/src/components/block-list/block.js +45 -20
  782. package/src/components/block-list/block.native.js +7 -4
  783. package/src/components/block-list/content.scss +23 -28
  784. package/src/components/block-list/index.js +49 -25
  785. package/src/components/block-list/use-block-props/index.js +8 -0
  786. package/src/components/block-list-appender/index.js +7 -74
  787. package/src/components/block-mover/style.scss +4 -3
  788. package/src/components/block-preview/auto.js +2 -1
  789. package/src/components/block-removal-warning-modal/index.js +17 -10
  790. package/src/components/block-switcher/index.js +22 -13
  791. package/src/components/block-title/test/index.js +86 -85
  792. package/src/components/block-title/use-block-display-title.js +25 -36
  793. package/src/components/block-toolbar/style.scss +8 -1
  794. package/src/components/block-tools/block-selection-button.js +23 -26
  795. package/src/components/block-tools/index.js +2 -12
  796. package/src/components/colors-gradients/control.js +0 -1
  797. package/src/components/default-block-appender/index.js +26 -38
  798. package/src/components/default-block-appender/test/index.js +24 -16
  799. package/src/components/font-sizes/README.MD +0 -9
  800. package/src/components/global-styles/border-panel.js +72 -1
  801. package/src/components/global-styles/get-global-styles-changes.js +2 -8
  802. package/src/components/global-styles/index.js +0 -1
  803. package/src/components/global-styles/shadow-panel-components.js +125 -0
  804. package/src/components/global-styles/style.scss +8 -9
  805. package/src/components/global-styles/test/get-global-styles-changes.js +3 -3
  806. package/src/components/global-styles/test/use-global-styles-output.js +1 -1
  807. package/src/components/global-styles/test/utils.js +86 -0
  808. package/src/components/global-styles/typography-panel.js +1 -2
  809. package/src/components/global-styles/use-global-styles-output.js +5 -1
  810. package/src/components/global-styles/utils.js +36 -0
  811. package/src/components/inner-blocks/index.js +31 -32
  812. package/src/components/inner-blocks/index.native.js +3 -9
  813. package/src/components/inner-blocks/use-inner-block-template-sync.js +1 -3
  814. package/src/components/inserter/block-patterns-tab/patterns-filter.js +4 -10
  815. package/src/components/inserter/block-patterns-tab/utils.js +2 -2
  816. package/src/components/inserter/quick-inserter.js +4 -2
  817. package/src/components/inserter/style.scss +3 -13
  818. package/src/components/inserter-draggable-blocks/index.js +12 -1
  819. package/src/components/inspector-controls-tabs/styles-tab.js +4 -2
  820. package/src/components/link-control/index.js +1 -20
  821. package/src/components/link-control/link-preview.js +19 -24
  822. package/src/components/link-control/style.scss +5 -18
  823. package/src/components/link-control/test/index.js +11 -90
  824. package/src/components/list-view/block.js +49 -41
  825. package/src/components/list-view/index.js +22 -9
  826. package/src/components/list-view/use-clipboard-handler.js +199 -0
  827. package/src/components/list-view/utils.js +4 -4
  828. package/src/components/media-replace-flow/style.scss +1 -1
  829. package/src/components/media-replace-flow/test/index.js +1 -1
  830. package/src/components/navigable-toolbar/index.js +8 -4
  831. package/src/components/provider/index.js +1 -1
  832. package/src/components/responsive-block-control/index.js +3 -5
  833. package/src/components/rich-text/index.js +3 -1
  834. package/src/components/rich-text/use-input-rules.js +2 -30
  835. package/src/components/spacing-sizes-control/index.js +2 -1
  836. package/src/components/url-input/style.scss +0 -2
  837. package/src/components/url-popover/image-url-input-ui.js +22 -10
  838. package/src/components/url-popover/index.js +75 -69
  839. package/src/components/url-popover/style.scss +12 -21
  840. package/src/components/use-block-drop-zone/index.js +17 -3
  841. package/src/components/use-flash-editable-blocks/index.js +62 -0
  842. package/src/components/use-on-block-drop/index.js +11 -4
  843. package/src/components/use-settings/index.js +9 -232
  844. package/src/components/writing-flow/use-clipboard-handler.js +6 -78
  845. package/src/components/writing-flow/use-drag-selection.js +12 -3
  846. package/src/components/writing-flow/utils.js +103 -0
  847. package/src/hooks/background.js +53 -8
  848. package/src/hooks/border.js +47 -6
  849. package/src/hooks/font-size.js +33 -33
  850. package/src/hooks/style.js +5 -9
  851. package/src/hooks/test/background.js +50 -0
  852. package/src/hooks/test/font-size.js +164 -0
  853. package/src/hooks/use-bindings-attributes.js +9 -19
  854. package/src/private-apis.js +4 -0
  855. package/src/store/get-block-settings.js +225 -0
  856. package/src/store/private-actions.js +44 -2
  857. package/src/store/private-selectors.js +53 -38
  858. package/src/store/reducer.js +30 -2
  859. package/src/store/selectors.js +74 -48
  860. package/src/store/test/get-block-settings.js +90 -0
  861. package/src/store/test/private-actions.js +18 -0
  862. package/src/store/test/private-selectors.js +19 -0
  863. package/src/store/test/reducer.js +19 -0
  864. package/build/components/global-styles/effects-panel.js +0 -219
  865. package/build/components/global-styles/effects-panel.js.map +0 -1
  866. package/build/hooks/effects.js +0 -66
  867. package/build/hooks/effects.js.map +0 -1
  868. package/build-module/components/global-styles/effects-panel.js +0 -210
  869. package/build-module/components/global-styles/effects-panel.js.map +0 -1
  870. package/build-module/hooks/effects.js +0 -51
  871. package/build-module/hooks/effects.js.map +0 -1
  872. package/src/components/global-styles/effects-panel.js +0 -244
  873. package/src/components/use-settings/test/index.js +0 -141
  874. package/src/hooks/effects.js +0 -57
  875. package/src/hooks/test/effects.js +0 -39
@@ -47,12 +47,12 @@ export function getCommonDepthClientIds(startId, endId, startParents, endParents
47
47
  *
48
48
  * @typedef {import('@wordpress/element').RefObject} RefObject
49
49
  *
50
- * @param {string} focusClientId The client ID of the block to focus.
51
- * @param {RefObject<HTMLElement>} treeGridElementRef The container element to search within.
50
+ * @param {string} focusClientId The client ID of the block to focus.
51
+ * @param {?HTMLElement} treeGridElement The container element to search within.
52
52
  */
53
- export function focusListItem(focusClientId, treeGridElementRef) {
53
+ export function focusListItem(focusClientId, treeGridElement) {
54
54
  const getFocusElement = () => {
55
- const row = treeGridElementRef.current?.querySelector(`[role=row][data-block="${focusClientId}"]`);
55
+ const row = treeGridElement?.querySelector(`[role=row][data-block="${focusClientId}"]`);
56
56
  if (!row) return null;
57
57
  // Focus the first focusable in the row, which is the ListViewBlockSelectButton.
58
58
  return focus.focusable.find(row)[0];
@@ -1 +1 @@
1
- {"version":3,"names":["__","sprintf","focus","getBlockPositionDescription","position","siblingCount","level","isClientIdSelected","clientId","selectedBlockClientIds","Array","isArray","length","indexOf","getCommonDepthClientIds","startId","endId","startParents","endParents","startPath","endPath","depth","Math","min","start","end","focusListItem","focusClientId","treeGridElementRef","getFocusElement","row","current","querySelector","focusable","find","focusElement","window","requestAnimationFrame","getDragDisplacementValues","blockIndexes","blockDropTargetIndex","blockDropPosition","firstDraggedBlockIndex","isDragged","displacement","isNesting","isAfterDraggedBlocks","thisBlockIndex","undefined"],"sources":["@wordpress/block-editor/src/components/list-view/utils.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { focus } from '@wordpress/dom';\n\nexport const getBlockPositionDescription = ( position, siblingCount, level ) =>\n\tsprintf(\n\t\t/* translators: 1: The numerical position of the block. 2: The total number of blocks. 3. The level of nesting for the block. */\n\t\t__( 'Block %1$d of %2$d, Level %3$d' ),\n\t\tposition,\n\t\tsiblingCount,\n\t\tlevel\n\t);\n\n/**\n * Returns true if the client ID occurs within the block selection or multi-selection,\n * or false otherwise.\n *\n * @param {string} clientId Block client ID.\n * @param {string|string[]} selectedBlockClientIds Selected block client ID, or an array of multi-selected blocks client IDs.\n *\n * @return {boolean} Whether the block is in multi-selection set.\n */\nexport const isClientIdSelected = ( clientId, selectedBlockClientIds ) =>\n\tArray.isArray( selectedBlockClientIds ) && selectedBlockClientIds.length\n\t\t? selectedBlockClientIds.indexOf( clientId ) !== -1\n\t\t: selectedBlockClientIds === clientId;\n\n/**\n * From a start and end clientId of potentially different nesting levels,\n * return the nearest-depth ids that have a common level of depth in the\n * nesting hierarchy. For multiple block selection, this ensure that the\n * selection is always at the same nesting level, and not split across\n * separate levels.\n *\n * @param {string} startId The first id of a selection.\n * @param {string} endId The end id of a selection, usually one that has been clicked on.\n * @param {string[]} startParents An array of ancestor ids for the start id, in descending order.\n * @param {string[]} endParents An array of ancestor ids for the end id, in descending order.\n * @return {Object} An object containing the start and end ids.\n */\nexport function getCommonDepthClientIds(\n\tstartId,\n\tendId,\n\tstartParents,\n\tendParents\n) {\n\tconst startPath = [ ...startParents, startId ];\n\tconst endPath = [ ...endParents, endId ];\n\tconst depth = Math.min( startPath.length, endPath.length ) - 1;\n\tconst start = startPath[ depth ];\n\tconst end = endPath[ depth ];\n\n\treturn {\n\t\tstart,\n\t\tend,\n\t};\n}\n\n/**\n * Shift focus to the list view item associated with a particular clientId.\n *\n * @typedef {import('@wordpress/element').RefObject} RefObject\n *\n * @param {string} focusClientId The client ID of the block to focus.\n * @param {RefObject<HTMLElement>} treeGridElementRef The container element to search within.\n */\nexport function focusListItem( focusClientId, treeGridElementRef ) {\n\tconst getFocusElement = () => {\n\t\tconst row = treeGridElementRef.current?.querySelector(\n\t\t\t`[role=row][data-block=\"${ focusClientId }\"]`\n\t\t);\n\t\tif ( ! row ) return null;\n\t\t// Focus the first focusable in the row, which is the ListViewBlockSelectButton.\n\t\treturn focus.focusable.find( row )[ 0 ];\n\t};\n\n\tlet focusElement = getFocusElement();\n\tif ( focusElement ) {\n\t\tfocusElement.focus();\n\t} else {\n\t\t// The element hasn't been painted yet. Defer focusing on the next frame.\n\t\t// This could happen when all blocks have been deleted and the default block\n\t\t// hasn't been added to the editor yet.\n\t\twindow.requestAnimationFrame( () => {\n\t\t\tfocusElement = getFocusElement();\n\n\t\t\t// Ignore if the element still doesn't exist.\n\t\t\tif ( focusElement ) {\n\t\t\t\tfocusElement.focus();\n\t\t\t}\n\t\t} );\n\t}\n}\n\n/**\n * Get values for the block that flag whether the block should be displaced up or down,\n * whether the block is being nested, and whether the block appears after the dragged\n * blocks. These values are used to determine the class names to apply to the block.\n * The list view rows are displaced visually via CSS rules. Displacement rules:\n * - `normal`: no displacement — used to apply a translateY of `0` so that the block\n * appears in its original position, and moves to that position smoothly when dragging\n * outside of the list view area.\n * - `up`: the block should be displaced up, creating room beneath the block for the drop indicator.\n * - `down`: the block should be displaced down, creating room above the block for the drop indicator.\n *\n * @param {Object} props\n * @param {Object} props.blockIndexes The indexes of all the blocks in the list view, keyed by clientId.\n * @param {number|null|undefined} props.blockDropTargetIndex The index of the block that the user is dropping to.\n * @param {?string} props.blockDropPosition The position relative to the block that the user is dropping to.\n * @param {string} props.clientId The client id for the current block.\n * @param {?number} props.firstDraggedBlockIndex The index of the first dragged block.\n * @param {?boolean} props.isDragged Whether the current block is being dragged. Dragged blocks skip displacement.\n * @return {Object} An object containing the `displacement`, `isAfterDraggedBlocks` and `isNesting` values.\n */\nexport function getDragDisplacementValues( {\n\tblockIndexes,\n\tblockDropTargetIndex,\n\tblockDropPosition,\n\tclientId,\n\tfirstDraggedBlockIndex,\n\tisDragged,\n} ) {\n\tlet displacement;\n\tlet isNesting;\n\tlet isAfterDraggedBlocks;\n\n\tif ( ! isDragged ) {\n\t\tisNesting = false;\n\t\tconst thisBlockIndex = blockIndexes[ clientId ];\n\t\tisAfterDraggedBlocks = thisBlockIndex > firstDraggedBlockIndex;\n\n\t\t// Determine where to displace the position of the current block, relative\n\t\t// to the blocks being dragged (in their original position) and the drop target\n\t\t// (the position where a user is currently dragging the blocks to).\n\t\tif (\n\t\t\tblockDropTargetIndex !== undefined &&\n\t\t\tblockDropTargetIndex !== null &&\n\t\t\tfirstDraggedBlockIndex !== undefined\n\t\t) {\n\t\t\t// If the block is being dragged and there is a valid drop target,\n\t\t\t// determine if the block being rendered should be displaced up or down.\n\n\t\t\tif ( thisBlockIndex !== undefined ) {\n\t\t\t\tif (\n\t\t\t\t\tthisBlockIndex >= firstDraggedBlockIndex &&\n\t\t\t\t\tthisBlockIndex < blockDropTargetIndex\n\t\t\t\t) {\n\t\t\t\t\t// If the current block appears after the set of dragged blocks\n\t\t\t\t\t// (in their original position), but is before the drop target,\n\t\t\t\t\t// then the current block should be displaced up.\n\t\t\t\t\tdisplacement = 'up';\n\t\t\t\t} else if (\n\t\t\t\t\tthisBlockIndex < firstDraggedBlockIndex &&\n\t\t\t\t\tthisBlockIndex >= blockDropTargetIndex\n\t\t\t\t) {\n\t\t\t\t\t// If the current block appears before the set of dragged blocks\n\t\t\t\t\t// (in their original position), but is after the drop target,\n\t\t\t\t\t// then the current block should be displaced down.\n\t\t\t\t\tdisplacement = 'down';\n\t\t\t\t} else {\n\t\t\t\t\tdisplacement = 'normal';\n\t\t\t\t}\n\t\t\t\tisNesting =\n\t\t\t\t\ttypeof blockDropTargetIndex === 'number' &&\n\t\t\t\t\tblockDropTargetIndex - 1 === thisBlockIndex &&\n\t\t\t\t\tblockDropPosition === 'inside';\n\t\t\t}\n\t\t} else if (\n\t\t\tblockDropTargetIndex === null &&\n\t\t\tfirstDraggedBlockIndex !== undefined\n\t\t) {\n\t\t\t// A `null` value for `blockDropTargetIndex` indicates that the\n\t\t\t// drop target is outside of the valid areas within the list view.\n\t\t\t// In this case, the drag is still active, but as there is no\n\t\t\t// valid drop target, we should remove the gap indicating where\n\t\t\t// the block would be inserted.\n\t\t\tif (\n\t\t\t\tthisBlockIndex !== undefined &&\n\t\t\t\tthisBlockIndex >= firstDraggedBlockIndex\n\t\t\t) {\n\t\t\t\tdisplacement = 'up';\n\t\t\t} else {\n\t\t\t\tdisplacement = 'normal';\n\t\t\t}\n\t\t} else if (\n\t\t\tblockDropTargetIndex !== undefined &&\n\t\t\tblockDropTargetIndex !== null &&\n\t\t\tfirstDraggedBlockIndex === undefined\n\t\t) {\n\t\t\t// If the blockdrop target is defined, but there are no dragged blocks,\n\t\t\t// then the block should be displaced relative to the drop target.\n\t\t\tif ( thisBlockIndex !== undefined ) {\n\t\t\t\tif ( thisBlockIndex < blockDropTargetIndex ) {\n\t\t\t\t\tdisplacement = 'normal';\n\t\t\t\t} else {\n\t\t\t\t\tdisplacement = 'down';\n\t\t\t\t}\n\t\t\t}\n\t\t} else if ( blockDropTargetIndex === null ) {\n\t\t\tdisplacement = 'normal';\n\t\t}\n\t}\n\n\treturn {\n\t\tdisplacement,\n\t\tisNesting,\n\t\tisAfterDraggedBlocks,\n\t};\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,KAAK,QAAQ,gBAAgB;AAEtC,OAAO,MAAMC,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,EACrC;UACD;UACA;UACA;UACAI,YAAY,GAAG,MAAM;QACtB,CAAC,MAAM;UACNA,YAAY,GAAG,QAAQ;QACxB;QACAC,SAAS,GACR,OAAOL,oBAAoB,KAAK,QAAQ,IACxCA,oBAAoB,GAAG,CAAC,KAAKO,cAAc,IAC3CN,iBAAiB,KAAK,QAAQ;MAChC;IACD,CAAC,MAAM,IACND,oBAAoB,KAAK,IAAI,IAC7BE,sBAAsB,KAAKM,SAAS,EACnC;MACD;MACA;MACA;MACA;MACA;MACA,IACCD,cAAc,KAAKC,SAAS,IAC5BD,cAAc,IAAIL,sBAAsB,EACvC;QACDE,YAAY,GAAG,IAAI;MACpB,CAAC,MAAM;QACNA,YAAY,GAAG,QAAQ;MACxB;IACD,CAAC,MAAM,IACNJ,oBAAoB,KAAKQ,SAAS,IAClCR,oBAAoB,KAAK,IAAI,IAC7BE,sBAAsB,KAAKM,SAAS,EACnC;MACD;MACA;MACA,IAAKD,cAAc,KAAKC,SAAS,EAAG;QACnC,IAAKD,cAAc,GAAGP,oBAAoB,EAAG;UAC5CI,YAAY,GAAG,QAAQ;QACxB,CAAC,MAAM;UACNA,YAAY,GAAG,MAAM;QACtB;MACD;IACD,CAAC,MAAM,IAAKJ,oBAAoB,KAAK,IAAI,EAAG;MAC3CI,YAAY,GAAG,QAAQ;IACxB;EACD;EAEA,OAAO;IACNA,YAAY;IACZC,SAAS;IACTC;EACD,CAAC;AACF"}
1
+ {"version":3,"names":["__","sprintf","focus","getBlockPositionDescription","position","siblingCount","level","isClientIdSelected","clientId","selectedBlockClientIds","Array","isArray","length","indexOf","getCommonDepthClientIds","startId","endId","startParents","endParents","startPath","endPath","depth","Math","min","start","end","focusListItem","focusClientId","treeGridElement","getFocusElement","row","querySelector","focusable","find","focusElement","window","requestAnimationFrame","getDragDisplacementValues","blockIndexes","blockDropTargetIndex","blockDropPosition","firstDraggedBlockIndex","isDragged","displacement","isNesting","isAfterDraggedBlocks","thisBlockIndex","undefined"],"sources":["@wordpress/block-editor/src/components/list-view/utils.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { focus } from '@wordpress/dom';\n\nexport const getBlockPositionDescription = ( position, siblingCount, level ) =>\n\tsprintf(\n\t\t/* translators: 1: The numerical position of the block. 2: The total number of blocks. 3. The level of nesting for the block. */\n\t\t__( 'Block %1$d of %2$d, Level %3$d' ),\n\t\tposition,\n\t\tsiblingCount,\n\t\tlevel\n\t);\n\n/**\n * Returns true if the client ID occurs within the block selection or multi-selection,\n * or false otherwise.\n *\n * @param {string} clientId Block client ID.\n * @param {string|string[]} selectedBlockClientIds Selected block client ID, or an array of multi-selected blocks client IDs.\n *\n * @return {boolean} Whether the block is in multi-selection set.\n */\nexport const isClientIdSelected = ( clientId, selectedBlockClientIds ) =>\n\tArray.isArray( selectedBlockClientIds ) && selectedBlockClientIds.length\n\t\t? selectedBlockClientIds.indexOf( clientId ) !== -1\n\t\t: selectedBlockClientIds === clientId;\n\n/**\n * From a start and end clientId of potentially different nesting levels,\n * return the nearest-depth ids that have a common level of depth in the\n * nesting hierarchy. For multiple block selection, this ensure that the\n * selection is always at the same nesting level, and not split across\n * separate levels.\n *\n * @param {string} startId The first id of a selection.\n * @param {string} endId The end id of a selection, usually one that has been clicked on.\n * @param {string[]} startParents An array of ancestor ids for the start id, in descending order.\n * @param {string[]} endParents An array of ancestor ids for the end id, in descending order.\n * @return {Object} An object containing the start and end ids.\n */\nexport function getCommonDepthClientIds(\n\tstartId,\n\tendId,\n\tstartParents,\n\tendParents\n) {\n\tconst startPath = [ ...startParents, startId ];\n\tconst endPath = [ ...endParents, endId ];\n\tconst depth = Math.min( startPath.length, endPath.length ) - 1;\n\tconst start = startPath[ depth ];\n\tconst end = endPath[ depth ];\n\n\treturn {\n\t\tstart,\n\t\tend,\n\t};\n}\n\n/**\n * Shift focus to the list view item associated with a particular clientId.\n *\n * @typedef {import('@wordpress/element').RefObject} RefObject\n *\n * @param {string} focusClientId The client ID of the block to focus.\n * @param {?HTMLElement} treeGridElement The container element to search within.\n */\nexport function focusListItem( focusClientId, treeGridElement ) {\n\tconst getFocusElement = () => {\n\t\tconst row = treeGridElement?.querySelector(\n\t\t\t`[role=row][data-block=\"${ focusClientId }\"]`\n\t\t);\n\t\tif ( ! row ) return null;\n\t\t// Focus the first focusable in the row, which is the ListViewBlockSelectButton.\n\t\treturn focus.focusable.find( row )[ 0 ];\n\t};\n\n\tlet focusElement = getFocusElement();\n\tif ( focusElement ) {\n\t\tfocusElement.focus();\n\t} else {\n\t\t// The element hasn't been painted yet. Defer focusing on the next frame.\n\t\t// This could happen when all blocks have been deleted and the default block\n\t\t// hasn't been added to the editor yet.\n\t\twindow.requestAnimationFrame( () => {\n\t\t\tfocusElement = getFocusElement();\n\n\t\t\t// Ignore if the element still doesn't exist.\n\t\t\tif ( focusElement ) {\n\t\t\t\tfocusElement.focus();\n\t\t\t}\n\t\t} );\n\t}\n}\n\n/**\n * Get values for the block that flag whether the block should be displaced up or down,\n * whether the block is being nested, and whether the block appears after the dragged\n * blocks. These values are used to determine the class names to apply to the block.\n * The list view rows are displaced visually via CSS rules. Displacement rules:\n * - `normal`: no displacement — used to apply a translateY of `0` so that the block\n * appears in its original position, and moves to that position smoothly when dragging\n * outside of the list view area.\n * - `up`: the block should be displaced up, creating room beneath the block for the drop indicator.\n * - `down`: the block should be displaced down, creating room above the block for the drop indicator.\n *\n * @param {Object} props\n * @param {Object} props.blockIndexes The indexes of all the blocks in the list view, keyed by clientId.\n * @param {number|null|undefined} props.blockDropTargetIndex The index of the block that the user is dropping to.\n * @param {?string} props.blockDropPosition The position relative to the block that the user is dropping to.\n * @param {string} props.clientId The client id for the current block.\n * @param {?number} props.firstDraggedBlockIndex The index of the first dragged block.\n * @param {?boolean} props.isDragged Whether the current block is being dragged. Dragged blocks skip displacement.\n * @return {Object} An object containing the `displacement`, `isAfterDraggedBlocks` and `isNesting` values.\n */\nexport function getDragDisplacementValues( {\n\tblockIndexes,\n\tblockDropTargetIndex,\n\tblockDropPosition,\n\tclientId,\n\tfirstDraggedBlockIndex,\n\tisDragged,\n} ) {\n\tlet displacement;\n\tlet isNesting;\n\tlet isAfterDraggedBlocks;\n\n\tif ( ! isDragged ) {\n\t\tisNesting = false;\n\t\tconst thisBlockIndex = blockIndexes[ clientId ];\n\t\tisAfterDraggedBlocks = thisBlockIndex > firstDraggedBlockIndex;\n\n\t\t// Determine where to displace the position of the current block, relative\n\t\t// to the blocks being dragged (in their original position) and the drop target\n\t\t// (the position where a user is currently dragging the blocks to).\n\t\tif (\n\t\t\tblockDropTargetIndex !== undefined &&\n\t\t\tblockDropTargetIndex !== null &&\n\t\t\tfirstDraggedBlockIndex !== undefined\n\t\t) {\n\t\t\t// If the block is being dragged and there is a valid drop target,\n\t\t\t// determine if the block being rendered should be displaced up or down.\n\n\t\t\tif ( thisBlockIndex !== undefined ) {\n\t\t\t\tif (\n\t\t\t\t\tthisBlockIndex >= firstDraggedBlockIndex &&\n\t\t\t\t\tthisBlockIndex < blockDropTargetIndex\n\t\t\t\t) {\n\t\t\t\t\t// If the current block appears after the set of dragged blocks\n\t\t\t\t\t// (in their original position), but is before the drop target,\n\t\t\t\t\t// then the current block should be displaced up.\n\t\t\t\t\tdisplacement = 'up';\n\t\t\t\t} else if (\n\t\t\t\t\tthisBlockIndex < firstDraggedBlockIndex &&\n\t\t\t\t\tthisBlockIndex >= blockDropTargetIndex\n\t\t\t\t) {\n\t\t\t\t\t// If the current block appears before the set of dragged blocks\n\t\t\t\t\t// (in their original position), but is after the drop target,\n\t\t\t\t\t// then the current block should be displaced down.\n\t\t\t\t\tdisplacement = 'down';\n\t\t\t\t} else {\n\t\t\t\t\tdisplacement = 'normal';\n\t\t\t\t}\n\t\t\t\tisNesting =\n\t\t\t\t\ttypeof blockDropTargetIndex === 'number' &&\n\t\t\t\t\tblockDropTargetIndex - 1 === thisBlockIndex &&\n\t\t\t\t\tblockDropPosition === 'inside';\n\t\t\t}\n\t\t} else if (\n\t\t\tblockDropTargetIndex === null &&\n\t\t\tfirstDraggedBlockIndex !== undefined\n\t\t) {\n\t\t\t// A `null` value for `blockDropTargetIndex` indicates that the\n\t\t\t// drop target is outside of the valid areas within the list view.\n\t\t\t// In this case, the drag is still active, but as there is no\n\t\t\t// valid drop target, we should remove the gap indicating where\n\t\t\t// the block would be inserted.\n\t\t\tif (\n\t\t\t\tthisBlockIndex !== undefined &&\n\t\t\t\tthisBlockIndex >= firstDraggedBlockIndex\n\t\t\t) {\n\t\t\t\tdisplacement = 'up';\n\t\t\t} else {\n\t\t\t\tdisplacement = 'normal';\n\t\t\t}\n\t\t} else if (\n\t\t\tblockDropTargetIndex !== undefined &&\n\t\t\tblockDropTargetIndex !== null &&\n\t\t\tfirstDraggedBlockIndex === undefined\n\t\t) {\n\t\t\t// If the blockdrop target is defined, but there are no dragged blocks,\n\t\t\t// then the block should be displaced relative to the drop target.\n\t\t\tif ( thisBlockIndex !== undefined ) {\n\t\t\t\tif ( thisBlockIndex < blockDropTargetIndex ) {\n\t\t\t\t\tdisplacement = 'normal';\n\t\t\t\t} else {\n\t\t\t\t\tdisplacement = 'down';\n\t\t\t\t}\n\t\t\t}\n\t\t} else if ( blockDropTargetIndex === null ) {\n\t\t\tdisplacement = 'normal';\n\t\t}\n\t}\n\n\treturn {\n\t\tdisplacement,\n\t\tisNesting,\n\t\tisAfterDraggedBlocks,\n\t};\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,KAAK,QAAQ,gBAAgB;AAEtC,OAAO,MAAMC,2BAA2B,GAAGA,CAAEC,QAAQ,EAAEC,YAAY,EAAEC,KAAK,KACzEL,OAAO,EACN;AACAD,EAAE,CAAE,gCAAiC,CAAC,EACtCI,QAAQ,EACRC,YAAY,EACZC,KACD,CAAC;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,kBAAkB,GAAGA,CAAEC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,IAAI,IAC7BE,sBAAsB,KAAKM,SAAS,EACnC;MACD;MACA;MACA;MACA;MACA;MACA,IACCD,cAAc,KAAKC,SAAS,IAC5BD,cAAc,IAAIL,sBAAsB,EACvC;QACDE,YAAY,GAAG,IAAI;MACpB,CAAC,MAAM;QACNA,YAAY,GAAG,QAAQ;MACxB;IACD,CAAC,MAAM,IACNJ,oBAAoB,KAAKQ,SAAS,IAClCR,oBAAoB,KAAK,IAAI,IAC7BE,sBAAsB,KAAKM,SAAS,EACnC;MACD;MACA;MACA,IAAKD,cAAc,KAAKC,SAAS,EAAG;QACnC,IAAKD,cAAc,GAAGP,oBAAoB,EAAG;UAC5CI,YAAY,GAAG,QAAQ;QACxB,CAAC,MAAM;UACNA,YAAY,GAAG,MAAM;QACtB;MACD;IACD,CAAC,MAAM,IAAKJ,oBAAoB,KAAK,IAAI,EAAG;MAC3CI,YAAY,GAAG,QAAQ;IACxB;EACD;EAEA,OAAO;IACNA,YAAY;IACZC,SAAS;IACTC;EACD,CAAC;AACF"}
@@ -20,7 +20,7 @@ function hasOnlyToolbarItem(elements) {
20
20
  return !elements.some(element => !(dataProp in element.dataset));
21
21
  }
22
22
  function getAllFocusableToolbarItemsIn(container) {
23
- return Array.from(container.querySelectorAll('[data-toolbar-item]:not([disabled]):not([aria-disabled="true"])'));
23
+ return Array.from(container.querySelectorAll('[data-toolbar-item]:not([disabled])'));
24
24
  }
25
25
  function hasFocusWithin(container) {
26
26
  return container.contains(container.ownerDocument.activeElement);
@@ -116,7 +116,10 @@ function useToolbarFocus({
116
116
  // We have to wait for the next browser paint because block controls aren't
117
117
  // rendered right away when the toolbar gets mounted.
118
118
  let raf = 0;
119
- if (!initialFocusOnMount) {
119
+
120
+ // If the toolbar already had focus before the render, we don't want to move it.
121
+ // https://github.com/WordPress/gutenberg/issues/58511
122
+ if (!initialFocusOnMount && !hasFocusWithin(navigableToolbarRef)) {
120
123
  raf = window.requestAnimationFrame(() => {
121
124
  const items = getAllFocusableToolbarItemsIn(navigableToolbarRef);
122
125
  const index = initialIndex || 0;
@@ -1 +1 @@
1
- {"version":3,"names":["NavigableMenu","Toolbar","useState","useRef","useLayoutEffect","useEffect","useCallback","useSelect","deprecated","focus","useShortcut","ESCAPE","store","blockEditorStore","unlock","hasOnlyToolbarItem","elements","dataProp","some","element","dataset","getAllFocusableToolbarItemsIn","container","Array","from","querySelectorAll","hasFocusWithin","contains","ownerDocument","activeElement","focusFirstTabbableIn","firstTabbable","tabbable","find","preventScroll","useIsAccessibleToolbar","toolbarRef","initialAccessibleToolbarState","isAccessibleToolbar","setIsAccessibleToolbar","determineIsAccessibleToolbar","tabbables","current","onlyToolbarItem","since","alternative","link","observer","window","MutationObserver","observe","childList","subtree","disconnect","useToolbarFocus","focusOnMount","defaultIndex","onIndexChange","shouldUseKeyboardFocusShortcut","focusEditorOnEscape","initialFocusOnMount","initialIndex","focusToolbar","focusToolbarViaShortcut","navigableToolbarRef","raf","requestAnimationFrame","items","index","cancelAnimationFrame","findIndex","item","tabIndex","getLastFocus","handleKeyDown","event","lastFocus","keyCode","preventDefault","addEventListener","removeEventListener","NavigableToolbar","children","__experimentalInitialIndex","__experimentalOnIndexChange","props","createElement","label","ref","orientation","role"],"sources":["@wordpress/block-editor/src/components/navigable-toolbar/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { NavigableMenu, Toolbar } from '@wordpress/components';\nimport {\n\tuseState,\n\tuseRef,\n\tuseLayoutEffect,\n\tuseEffect,\n\tuseCallback,\n} from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport deprecated from '@wordpress/deprecated';\nimport { focus } from '@wordpress/dom';\nimport { useShortcut } from '@wordpress/keyboard-shortcuts';\nimport { ESCAPE } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nfunction hasOnlyToolbarItem( elements ) {\n\tconst dataProp = 'toolbarItem';\n\treturn ! elements.some( ( element ) => ! ( dataProp in element.dataset ) );\n}\n\nfunction getAllFocusableToolbarItemsIn( container ) {\n\treturn Array.from(\n\t\tcontainer.querySelectorAll(\n\t\t\t'[data-toolbar-item]:not([disabled]):not([aria-disabled=\"true\"])'\n\t\t)\n\t);\n}\n\nfunction hasFocusWithin( container ) {\n\treturn container.contains( container.ownerDocument.activeElement );\n}\n\nfunction focusFirstTabbableIn( container ) {\n\tconst [ firstTabbable ] = focus.tabbable.find( container );\n\n\tif ( firstTabbable ) {\n\t\tfirstTabbable.focus( {\n\t\t\t// When focusing newly mounted toolbars,\n\t\t\t// the position of the popover is often not right on the first render\n\t\t\t// This prevents the layout shifts when focusing the dialogs.\n\t\t\tpreventScroll: true,\n\t\t} );\n\t}\n}\n\nfunction useIsAccessibleToolbar( toolbarRef ) {\n\t/*\n\t * By default, we'll assume the starting accessible state of the Toolbar\n\t * is true, as it seems to be the most common case.\n\t *\n\t * Transitioning from an (initial) false to true state causes the\n\t * <Toolbar /> component to mount twice, which is causing undesired\n\t * side-effects. These side-effects appear to only affect certain\n\t * E2E tests.\n\t *\n\t * This was initial discovered in this pull-request:\n\t * https://github.com/WordPress/gutenberg/pull/23425\n\t */\n\tconst initialAccessibleToolbarState = true;\n\n\t// By default, it's gonna render NavigableMenu. If all the tabbable elements\n\t// inside the toolbar are ToolbarItem components (or derived components like\n\t// ToolbarButton), then we can wrap them with the accessible Toolbar\n\t// component.\n\tconst [ isAccessibleToolbar, setIsAccessibleToolbar ] = useState(\n\t\tinitialAccessibleToolbarState\n\t);\n\n\tconst determineIsAccessibleToolbar = useCallback( () => {\n\t\tconst tabbables = focus.tabbable.find( toolbarRef.current );\n\t\tconst onlyToolbarItem = hasOnlyToolbarItem( tabbables );\n\t\tif ( ! onlyToolbarItem ) {\n\t\t\tdeprecated( 'Using custom components as toolbar controls', {\n\t\t\t\tsince: '5.6',\n\t\t\t\talternative:\n\t\t\t\t\t'ToolbarItem, ToolbarButton or ToolbarDropdownMenu components',\n\t\t\t\tlink: 'https://developer.wordpress.org/block-editor/components/toolbar-button/#inside-blockcontrols',\n\t\t\t} );\n\t\t}\n\t\tsetIsAccessibleToolbar( onlyToolbarItem );\n\t}, [ toolbarRef ] );\n\n\tuseLayoutEffect( () => {\n\t\t// Toolbar buttons may be rendered asynchronously, so we use\n\t\t// MutationObserver to check if the toolbar subtree has been modified.\n\t\tconst observer = new window.MutationObserver(\n\t\t\tdetermineIsAccessibleToolbar\n\t\t);\n\t\tobserver.observe( toolbarRef.current, {\n\t\t\tchildList: true,\n\t\t\tsubtree: true,\n\t\t} );\n\t\treturn () => observer.disconnect();\n\t}, [ determineIsAccessibleToolbar, isAccessibleToolbar, toolbarRef ] );\n\n\treturn isAccessibleToolbar;\n}\n\nfunction useToolbarFocus( {\n\ttoolbarRef,\n\tfocusOnMount,\n\tisAccessibleToolbar,\n\tdefaultIndex,\n\tonIndexChange,\n\tshouldUseKeyboardFocusShortcut,\n\tfocusEditorOnEscape,\n} ) {\n\t// Make sure we don't use modified versions of this prop.\n\tconst [ initialFocusOnMount ] = useState( focusOnMount );\n\tconst [ initialIndex ] = useState( defaultIndex );\n\n\tconst focusToolbar = useCallback( () => {\n\t\tfocusFirstTabbableIn( toolbarRef.current );\n\t}, [ toolbarRef ] );\n\n\tconst focusToolbarViaShortcut = () => {\n\t\tif ( shouldUseKeyboardFocusShortcut ) {\n\t\t\tfocusToolbar();\n\t\t}\n\t};\n\n\t// Focus on toolbar when pressing alt+F10 when the toolbar is visible.\n\tuseShortcut( 'core/block-editor/focus-toolbar', focusToolbarViaShortcut );\n\n\tuseEffect( () => {\n\t\tif ( initialFocusOnMount ) {\n\t\t\tfocusToolbar();\n\t\t}\n\t}, [ isAccessibleToolbar, initialFocusOnMount, focusToolbar ] );\n\n\tuseEffect( () => {\n\t\t// Store ref so we have access on useEffect cleanup: https://legacy.reactjs.org/blog/2020/08/10/react-v17-rc.html#effect-cleanup-timing\n\t\tconst navigableToolbarRef = toolbarRef.current;\n\t\t// If initialIndex is passed, we focus on that toolbar item when the\n\t\t// toolbar gets mounted and initial focus is not forced.\n\t\t// We have to wait for the next browser paint because block controls aren't\n\t\t// rendered right away when the toolbar gets mounted.\n\t\tlet raf = 0;\n\t\tif ( ! initialFocusOnMount ) {\n\t\t\traf = window.requestAnimationFrame( () => {\n\t\t\t\tconst items =\n\t\t\t\t\tgetAllFocusableToolbarItemsIn( navigableToolbarRef );\n\t\t\t\tconst index = initialIndex || 0;\n\t\t\t\tif ( items[ index ] && hasFocusWithin( navigableToolbarRef ) ) {\n\t\t\t\t\titems[ index ].focus( {\n\t\t\t\t\t\t// When focusing newly mounted toolbars,\n\t\t\t\t\t\t// the position of the popover is often not right on the first render\n\t\t\t\t\t\t// This prevents the layout shifts when focusing the dialogs.\n\t\t\t\t\t\tpreventScroll: true,\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\t\treturn () => {\n\t\t\twindow.cancelAnimationFrame( raf );\n\t\t\tif ( ! onIndexChange || ! navigableToolbarRef ) return;\n\t\t\t// When the toolbar element is unmounted and onIndexChange is passed, we\n\t\t\t// pass the focused toolbar item index so it can be hydrated later.\n\t\t\tconst items = getAllFocusableToolbarItemsIn( navigableToolbarRef );\n\t\t\tconst index = items.findIndex( ( item ) => item.tabIndex === 0 );\n\t\t\tonIndexChange( index );\n\t\t};\n\t}, [ initialIndex, initialFocusOnMount, onIndexChange, toolbarRef ] );\n\n\tconst { getLastFocus } = unlock( useSelect( blockEditorStore ) );\n\t/**\n\t * Handles returning focus to the block editor canvas when pressing escape.\n\t */\n\tuseEffect( () => {\n\t\tconst navigableToolbarRef = toolbarRef.current;\n\n\t\tif ( focusEditorOnEscape ) {\n\t\t\tconst handleKeyDown = ( event ) => {\n\t\t\t\tconst lastFocus = getLastFocus();\n\t\t\t\tif ( event.keyCode === ESCAPE && lastFocus?.current ) {\n\t\t\t\t\t// Focus the last focused element when pressing escape.\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\tlastFocus.current.focus();\n\t\t\t\t}\n\t\t\t};\n\t\t\tnavigableToolbarRef.addEventListener( 'keydown', handleKeyDown );\n\t\t\treturn () => {\n\t\t\t\tnavigableToolbarRef.removeEventListener(\n\t\t\t\t\t'keydown',\n\t\t\t\t\thandleKeyDown\n\t\t\t\t);\n\t\t\t};\n\t\t}\n\t}, [ focusEditorOnEscape, getLastFocus, toolbarRef ] );\n}\n\nexport default function NavigableToolbar( {\n\tchildren,\n\tfocusOnMount,\n\tfocusEditorOnEscape = false,\n\tshouldUseKeyboardFocusShortcut = true,\n\t__experimentalInitialIndex: initialIndex,\n\t__experimentalOnIndexChange: onIndexChange,\n\t...props\n} ) {\n\tconst toolbarRef = useRef();\n\tconst isAccessibleToolbar = useIsAccessibleToolbar( toolbarRef );\n\n\tuseToolbarFocus( {\n\t\ttoolbarRef,\n\t\tfocusOnMount,\n\t\tdefaultIndex: initialIndex,\n\t\tonIndexChange,\n\t\tisAccessibleToolbar,\n\t\tshouldUseKeyboardFocusShortcut,\n\t\tfocusEditorOnEscape,\n\t} );\n\n\tif ( isAccessibleToolbar ) {\n\t\treturn (\n\t\t\t<Toolbar\n\t\t\t\tlabel={ props[ 'aria-label' ] }\n\t\t\t\tref={ toolbarRef }\n\t\t\t\t{ ...props }\n\t\t\t>\n\t\t\t\t{ children }\n\t\t\t</Toolbar>\n\t\t);\n\t}\n\n\treturn (\n\t\t<NavigableMenu\n\t\t\torientation=\"horizontal\"\n\t\t\trole=\"toolbar\"\n\t\t\tref={ toolbarRef }\n\t\t\t{ ...props }\n\t\t>\n\t\t\t{ children }\n\t\t</NavigableMenu>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,aAAa,EAAEC,OAAO,QAAQ,uBAAuB;AAC9D,SACCC,QAAQ,EACRC,MAAM,EACNC,eAAe,EACfC,SAAS,EACTC,WAAW,QACL,oBAAoB;AAC3B,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,OAAOC,UAAU,MAAM,uBAAuB;AAC9C,SAASC,KAAK,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AAY,CAAI;MAC/BG,GAAG,EAAGpD,UAAY;MAAA,GACbiD;IAAK,GAERH,QACM,CAAC;EAEZ;EAEA,OACCI,aAAA,CAACtF,aAAa;IACbyF,WAAW,EAAC,YAAY;IACxBC,IAAI,EAAC,SAAS;IACdF,GAAG,EAAGpD,UAAY;IAAA,GACbiD;EAAK,GAERH,QACY,CAAC;AAElB"}
1
+ {"version":3,"names":["NavigableMenu","Toolbar","useState","useRef","useLayoutEffect","useEffect","useCallback","useSelect","deprecated","focus","useShortcut","ESCAPE","store","blockEditorStore","unlock","hasOnlyToolbarItem","elements","dataProp","some","element","dataset","getAllFocusableToolbarItemsIn","container","Array","from","querySelectorAll","hasFocusWithin","contains","ownerDocument","activeElement","focusFirstTabbableIn","firstTabbable","tabbable","find","preventScroll","useIsAccessibleToolbar","toolbarRef","initialAccessibleToolbarState","isAccessibleToolbar","setIsAccessibleToolbar","determineIsAccessibleToolbar","tabbables","current","onlyToolbarItem","since","alternative","link","observer","window","MutationObserver","observe","childList","subtree","disconnect","useToolbarFocus","focusOnMount","defaultIndex","onIndexChange","shouldUseKeyboardFocusShortcut","focusEditorOnEscape","initialFocusOnMount","initialIndex","focusToolbar","focusToolbarViaShortcut","navigableToolbarRef","raf","requestAnimationFrame","items","index","cancelAnimationFrame","findIndex","item","tabIndex","getLastFocus","handleKeyDown","event","lastFocus","keyCode","preventDefault","addEventListener","removeEventListener","NavigableToolbar","children","__experimentalInitialIndex","__experimentalOnIndexChange","props","createElement","label","ref","orientation","role"],"sources":["@wordpress/block-editor/src/components/navigable-toolbar/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { NavigableMenu, Toolbar } from '@wordpress/components';\nimport {\n\tuseState,\n\tuseRef,\n\tuseLayoutEffect,\n\tuseEffect,\n\tuseCallback,\n} from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport deprecated from '@wordpress/deprecated';\nimport { focus } from '@wordpress/dom';\nimport { useShortcut } from '@wordpress/keyboard-shortcuts';\nimport { ESCAPE } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nfunction hasOnlyToolbarItem( elements ) {\n\tconst dataProp = 'toolbarItem';\n\treturn ! elements.some( ( element ) => ! ( dataProp in element.dataset ) );\n}\n\nfunction getAllFocusableToolbarItemsIn( container ) {\n\treturn Array.from(\n\t\tcontainer.querySelectorAll( '[data-toolbar-item]:not([disabled])' )\n\t);\n}\n\nfunction hasFocusWithin( container ) {\n\treturn container.contains( container.ownerDocument.activeElement );\n}\n\nfunction focusFirstTabbableIn( container ) {\n\tconst [ firstTabbable ] = focus.tabbable.find( container );\n\n\tif ( firstTabbable ) {\n\t\tfirstTabbable.focus( {\n\t\t\t// When focusing newly mounted toolbars,\n\t\t\t// the position of the popover is often not right on the first render\n\t\t\t// This prevents the layout shifts when focusing the dialogs.\n\t\t\tpreventScroll: true,\n\t\t} );\n\t}\n}\n\nfunction useIsAccessibleToolbar( toolbarRef ) {\n\t/*\n\t * By default, we'll assume the starting accessible state of the Toolbar\n\t * is true, as it seems to be the most common case.\n\t *\n\t * Transitioning from an (initial) false to true state causes the\n\t * <Toolbar /> component to mount twice, which is causing undesired\n\t * side-effects. These side-effects appear to only affect certain\n\t * E2E tests.\n\t *\n\t * This was initial discovered in this pull-request:\n\t * https://github.com/WordPress/gutenberg/pull/23425\n\t */\n\tconst initialAccessibleToolbarState = true;\n\n\t// By default, it's gonna render NavigableMenu. If all the tabbable elements\n\t// inside the toolbar are ToolbarItem components (or derived components like\n\t// ToolbarButton), then we can wrap them with the accessible Toolbar\n\t// component.\n\tconst [ isAccessibleToolbar, setIsAccessibleToolbar ] = useState(\n\t\tinitialAccessibleToolbarState\n\t);\n\n\tconst determineIsAccessibleToolbar = useCallback( () => {\n\t\tconst tabbables = focus.tabbable.find( toolbarRef.current );\n\t\tconst onlyToolbarItem = hasOnlyToolbarItem( tabbables );\n\t\tif ( ! onlyToolbarItem ) {\n\t\t\tdeprecated( 'Using custom components as toolbar controls', {\n\t\t\t\tsince: '5.6',\n\t\t\t\talternative:\n\t\t\t\t\t'ToolbarItem, ToolbarButton or ToolbarDropdownMenu components',\n\t\t\t\tlink: 'https://developer.wordpress.org/block-editor/components/toolbar-button/#inside-blockcontrols',\n\t\t\t} );\n\t\t}\n\t\tsetIsAccessibleToolbar( onlyToolbarItem );\n\t}, [ toolbarRef ] );\n\n\tuseLayoutEffect( () => {\n\t\t// Toolbar buttons may be rendered asynchronously, so we use\n\t\t// MutationObserver to check if the toolbar subtree has been modified.\n\t\tconst observer = new window.MutationObserver(\n\t\t\tdetermineIsAccessibleToolbar\n\t\t);\n\t\tobserver.observe( toolbarRef.current, {\n\t\t\tchildList: true,\n\t\t\tsubtree: true,\n\t\t} );\n\t\treturn () => observer.disconnect();\n\t}, [ determineIsAccessibleToolbar, isAccessibleToolbar, toolbarRef ] );\n\n\treturn isAccessibleToolbar;\n}\n\nfunction useToolbarFocus( {\n\ttoolbarRef,\n\tfocusOnMount,\n\tisAccessibleToolbar,\n\tdefaultIndex,\n\tonIndexChange,\n\tshouldUseKeyboardFocusShortcut,\n\tfocusEditorOnEscape,\n} ) {\n\t// Make sure we don't use modified versions of this prop.\n\tconst [ initialFocusOnMount ] = useState( focusOnMount );\n\tconst [ initialIndex ] = useState( defaultIndex );\n\n\tconst focusToolbar = useCallback( () => {\n\t\tfocusFirstTabbableIn( toolbarRef.current );\n\t}, [ toolbarRef ] );\n\n\tconst focusToolbarViaShortcut = () => {\n\t\tif ( shouldUseKeyboardFocusShortcut ) {\n\t\t\tfocusToolbar();\n\t\t}\n\t};\n\n\t// Focus on toolbar when pressing alt+F10 when the toolbar is visible.\n\tuseShortcut( 'core/block-editor/focus-toolbar', focusToolbarViaShortcut );\n\n\tuseEffect( () => {\n\t\tif ( initialFocusOnMount ) {\n\t\t\tfocusToolbar();\n\t\t}\n\t}, [ isAccessibleToolbar, initialFocusOnMount, focusToolbar ] );\n\n\tuseEffect( () => {\n\t\t// Store ref so we have access on useEffect cleanup: https://legacy.reactjs.org/blog/2020/08/10/react-v17-rc.html#effect-cleanup-timing\n\t\tconst navigableToolbarRef = toolbarRef.current;\n\t\t// If initialIndex is passed, we focus on that toolbar item when the\n\t\t// toolbar gets mounted and initial focus is not forced.\n\t\t// We have to wait for the next browser paint because block controls aren't\n\t\t// rendered right away when the toolbar gets mounted.\n\t\tlet raf = 0;\n\n\t\t// If the toolbar already had focus before the render, we don't want to move it.\n\t\t// https://github.com/WordPress/gutenberg/issues/58511\n\t\tif (\n\t\t\t! initialFocusOnMount &&\n\t\t\t! hasFocusWithin( navigableToolbarRef )\n\t\t) {\n\t\t\traf = window.requestAnimationFrame( () => {\n\t\t\t\tconst items =\n\t\t\t\t\tgetAllFocusableToolbarItemsIn( navigableToolbarRef );\n\t\t\t\tconst index = initialIndex || 0;\n\t\t\t\tif ( items[ index ] && hasFocusWithin( navigableToolbarRef ) ) {\n\t\t\t\t\titems[ index ].focus( {\n\t\t\t\t\t\t// When focusing newly mounted toolbars,\n\t\t\t\t\t\t// the position of the popover is often not right on the first render\n\t\t\t\t\t\t// This prevents the layout shifts when focusing the dialogs.\n\t\t\t\t\t\tpreventScroll: true,\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\t\treturn () => {\n\t\t\twindow.cancelAnimationFrame( raf );\n\t\t\tif ( ! onIndexChange || ! navigableToolbarRef ) return;\n\t\t\t// When the toolbar element is unmounted and onIndexChange is passed, we\n\t\t\t// pass the focused toolbar item index so it can be hydrated later.\n\t\t\tconst items = getAllFocusableToolbarItemsIn( navigableToolbarRef );\n\t\t\tconst index = items.findIndex( ( item ) => item.tabIndex === 0 );\n\t\t\tonIndexChange( index );\n\t\t};\n\t}, [ initialIndex, initialFocusOnMount, onIndexChange, toolbarRef ] );\n\n\tconst { getLastFocus } = unlock( useSelect( blockEditorStore ) );\n\t/**\n\t * Handles returning focus to the block editor canvas when pressing escape.\n\t */\n\tuseEffect( () => {\n\t\tconst navigableToolbarRef = toolbarRef.current;\n\n\t\tif ( focusEditorOnEscape ) {\n\t\t\tconst handleKeyDown = ( event ) => {\n\t\t\t\tconst lastFocus = getLastFocus();\n\t\t\t\tif ( event.keyCode === ESCAPE && lastFocus?.current ) {\n\t\t\t\t\t// Focus the last focused element when pressing escape.\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\tlastFocus.current.focus();\n\t\t\t\t}\n\t\t\t};\n\t\t\tnavigableToolbarRef.addEventListener( 'keydown', handleKeyDown );\n\t\t\treturn () => {\n\t\t\t\tnavigableToolbarRef.removeEventListener(\n\t\t\t\t\t'keydown',\n\t\t\t\t\thandleKeyDown\n\t\t\t\t);\n\t\t\t};\n\t\t}\n\t}, [ focusEditorOnEscape, getLastFocus, toolbarRef ] );\n}\n\nexport default function NavigableToolbar( {\n\tchildren,\n\tfocusOnMount,\n\tfocusEditorOnEscape = false,\n\tshouldUseKeyboardFocusShortcut = true,\n\t__experimentalInitialIndex: initialIndex,\n\t__experimentalOnIndexChange: onIndexChange,\n\t...props\n} ) {\n\tconst toolbarRef = useRef();\n\tconst isAccessibleToolbar = useIsAccessibleToolbar( toolbarRef );\n\n\tuseToolbarFocus( {\n\t\ttoolbarRef,\n\t\tfocusOnMount,\n\t\tdefaultIndex: initialIndex,\n\t\tonIndexChange,\n\t\tisAccessibleToolbar,\n\t\tshouldUseKeyboardFocusShortcut,\n\t\tfocusEditorOnEscape,\n\t} );\n\n\tif ( isAccessibleToolbar ) {\n\t\treturn (\n\t\t\t<Toolbar\n\t\t\t\tlabel={ props[ 'aria-label' ] }\n\t\t\t\tref={ toolbarRef }\n\t\t\t\t{ ...props }\n\t\t\t>\n\t\t\t\t{ children }\n\t\t\t</Toolbar>\n\t\t);\n\t}\n\n\treturn (\n\t\t<NavigableMenu\n\t\t\torientation=\"horizontal\"\n\t\t\trole=\"toolbar\"\n\t\t\tref={ toolbarRef }\n\t\t\t{ ...props }\n\t\t>\n\t\t\t{ children }\n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C,MAAM,CAAC,CAAC;EAC3B,MAAMmC,mBAAmB,GAAGH,sBAAsB,CAAEC,UAAW,CAAC;EAEhEkB,eAAe,CAAE;IAChBlB,UAAU;IACVmB,YAAY;IACZC,YAAY,EAAEK,YAAY;IAC1BJ,aAAa;IACbnB,mBAAmB;IACnBoB,8BAA8B;IAC9BC;EACD,CAAE,CAAC;EAEH,IAAKrB,mBAAmB,EAAG;IAC1B,OACCgD,aAAA,CAACrF,OAAO;MACPsF,KAAK,EAAGF,KAAK,CAAE,YAAY,CAAI;MAC/BG,GAAG,EAAGpD,UAAY;MAAA,GACbiD;IAAK,GAERH,QACM,CAAC;EAEZ;EAEA,OACCI,aAAA,CAACtF,aAAa;IACbyF,WAAW,EAAC,YAAY;IACxBC,IAAI,EAAC,SAAS;IACdF,GAAG,EAAGpD,UAAY;IAAA,GACbiD;EAAK,GAERH,QACY,CAAC;AAElB"}
@@ -41,7 +41,7 @@ export const ExperimentalBlockEditorProvider = withRegistryProvider(props => {
41
41
  useBlockSync(props);
42
42
  return createElement(SlotFillProvider, {
43
43
  passthrough: true
44
- }, !settings.__unstableIsPreviewMode && createElement(KeyboardShortcuts.Register, null), createElement(BlockRefsProvider, null, children));
44
+ }, !settings?.__unstableIsPreviewMode && createElement(KeyboardShortcuts.Register, null), createElement(BlockRefsProvider, null, children));
45
45
  });
46
46
  export const BlockEditorProvider = props => {
47
47
  return createElement(ExperimentalBlockEditorProvider, {
@@ -1 +1 @@
1
- {"version":3,"names":["useDispatch","useEffect","SlotFillProvider","withRegistryProvider","useBlockSync","store","blockEditorStore","BlockRefsProvider","unlock","KeyboardShortcuts","ExperimentalBlockEditorProvider","props","children","settings","stripExperimentalSettings","__experimentalUpdateSettings","__internalIsInitialized","reset","createElement","passthrough","__unstableIsPreviewMode","Register","BlockEditorProvider"],"sources":["@wordpress/block-editor/src/components/provider/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch } from '@wordpress/data';\nimport { useEffect } from '@wordpress/element';\nimport { SlotFillProvider } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport withRegistryProvider from './with-registry-provider';\nimport useBlockSync from './use-block-sync';\nimport { store as blockEditorStore } from '../../store';\nimport { BlockRefsProvider } from './block-refs-provider';\nimport { unlock } from '../../lock-unlock';\nimport KeyboardShortcuts from '../keyboard-shortcuts';\n\n/** @typedef {import('@wordpress/data').WPDataRegistry} WPDataRegistry */\n\nexport const ExperimentalBlockEditorProvider = withRegistryProvider(\n\t( props ) => {\n\t\tconst { children, settings, stripExperimentalSettings = false } = props;\n\n\t\tconst { __experimentalUpdateSettings } = unlock(\n\t\t\tuseDispatch( blockEditorStore )\n\t\t);\n\t\tuseEffect( () => {\n\t\t\t__experimentalUpdateSettings(\n\t\t\t\t{\n\t\t\t\t\t...settings,\n\t\t\t\t\t__internalIsInitialized: true,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tstripExperimentalSettings,\n\t\t\t\t\treset: true,\n\t\t\t\t}\n\t\t\t);\n\t\t}, [\n\t\t\tsettings,\n\t\t\tstripExperimentalSettings,\n\t\t\t__experimentalUpdateSettings,\n\t\t] );\n\n\t\t// Syncs the entity provider with changes in the block-editor store.\n\t\tuseBlockSync( props );\n\n\t\treturn (\n\t\t\t<SlotFillProvider passthrough>\n\t\t\t\t{ ! settings.__unstableIsPreviewMode && (\n\t\t\t\t\t<KeyboardShortcuts.Register />\n\t\t\t\t) }\n\t\t\t\t<BlockRefsProvider>{ children }</BlockRefsProvider>\n\t\t\t</SlotFillProvider>\n\t\t);\n\t}\n);\n\nexport const BlockEditorProvider = ( props ) => {\n\treturn (\n\t\t<ExperimentalBlockEditorProvider\n\t\t\t{ ...props }\n\t\t\tstripExperimentalSettings={ true }\n\t\t>\n\t\t\t{ props.children }\n\t\t</ExperimentalBlockEditorProvider>\n\t);\n};\n\nexport default BlockEditorProvider;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,WAAW,QAAQ,iBAAiB;AAC7C,SAASC,S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version":3,"names":["useDispatch","useEffect","SlotFillProvider","withRegistryProvider","useBlockSync","store","blockEditorStore","BlockRefsProvider","unlock","KeyboardShortcuts","ExperimentalBlockEditorProvider","props","children","settings","stripExperimentalSettings","__experimentalUpdateSettings","__internalIsInitialized","reset","createElement","passthrough","__unstableIsPreviewMode","Register","BlockEditorProvider"],"sources":["@wordpress/block-editor/src/components/provider/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch } from '@wordpress/data';\nimport { useEffect } from '@wordpress/element';\nimport { SlotFillProvider } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport withRegistryProvider from './with-registry-provider';\nimport useBlockSync from './use-block-sync';\nimport { store as blockEditorStore } from '../../store';\nimport { BlockRefsProvider } from './block-refs-provider';\nimport { unlock } from '../../lock-unlock';\nimport KeyboardShortcuts from '../keyboard-shortcuts';\n\n/** @typedef {import('@wordpress/data').WPDataRegistry} WPDataRegistry */\n\nexport const ExperimentalBlockEditorProvider = withRegistryProvider(\n\t( props ) => {\n\t\tconst { children, settings, stripExperimentalSettings = false } = props;\n\n\t\tconst { __experimentalUpdateSettings } = unlock(\n\t\t\tuseDispatch( blockEditorStore )\n\t\t);\n\t\tuseEffect( () => {\n\t\t\t__experimentalUpdateSettings(\n\t\t\t\t{\n\t\t\t\t\t...settings,\n\t\t\t\t\t__internalIsInitialized: true,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tstripExperimentalSettings,\n\t\t\t\t\treset: true,\n\t\t\t\t}\n\t\t\t);\n\t\t}, [\n\t\t\tsettings,\n\t\t\tstripExperimentalSettings,\n\t\t\t__experimentalUpdateSettings,\n\t\t] );\n\n\t\t// Syncs the entity provider with changes in the block-editor store.\n\t\tuseBlockSync( props );\n\n\t\treturn (\n\t\t\t<SlotFillProvider passthrough>\n\t\t\t\t{ ! settings?.__unstableIsPreviewMode && (\n\t\t\t\t\t<KeyboardShortcuts.Register />\n\t\t\t\t) }\n\t\t\t\t<BlockRefsProvider>{ children }</BlockRefsProvider>\n\t\t\t</SlotFillProvider>\n\t\t);\n\t}\n);\n\nexport const BlockEditorProvider = ( props ) => {\n\treturn (\n\t\t<ExperimentalBlockEditorProvider\n\t\t\t{ ...props }\n\t\t\tstripExperimentalSettings={ true }\n\t\t>\n\t\t\t{ props.children }\n\t\t</ExperimentalBlockEditorProvider>\n\t);\n};\n\nexport default BlockEditorProvider;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,WAAW,QAAQ,iBAAiB;AAC7C,SAASC,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,gBAAgB,QAAQ,uBAAuB;;AAExD;AACA;AACA;AACA,OAAOC,oBAAoB,MAAM,0BAA0B;AAC3D,OAAOC,YAAY,MAAM,kBAAkB;AAC3C,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,aAAa;AACvD,SAASC,iBAAiB,QAAQ,uBAAuB;AACzD,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,OAAOC,iBAAiB,MAAM,uBAAuB;;AAErD;;AAEA,OAAO,MAAMC,+BAA+B,GAAGP,oBAAoB,CAChEQ,KAAK,IAAM;EACZ,MAAM;IAAEC,QAAQ;IAAEC,QAAQ;IAAEC,yBAAyB,GAAG;EAAM,CAAC,GAAGH,KAAK;EAEvE,MAAM;IAAEI;EAA6B,CAAC,GAAGP,MAAM,CAC9CR,WAAW,CAAEM,gBAAiB,CAC/B,CAAC;EACDL,SAAS,CAAE,MAAM;IAChBc,4BAA4B,CAC3B;MACC,GAAGF,QAAQ;MACXG,uBAAuB,EAAE;IAC1B,CAAC,EACD;MACCF,yBAAyB;MACzBG,KAAK,EAAE;IACR,CACD,CAAC;EACF,CAAC,EAAE,CACFJ,QAAQ,EACRC,yBAAyB,EACzBC,4BAA4B,CAC3B,CAAC;;EAEH;EACAX,YAAY,CAAEO,KAAM,CAAC;EAErB,OACCO,aAAA,CAAChB,gBAAgB;IAACiB,WAAW;EAAA,GAC1B,CAAEN,QAAQ,EAAEO,uBAAuB,IACpCF,aAAA,CAACT,iBAAiB,CAACY,QAAQ,MAAE,CAC7B,EACDH,aAAA,CAACX,iBAAiB,QAAGK,QAA6B,CACjC,CAAC;AAErB,CACD,CAAC;AAED,OAAO,MAAMU,mBAAmB,GAAKX,KAAK,IAAM;EAC/C,OACCO,aAAA,CAACR,+BAA+B;IAAA,GAC1BC,KAAK;IACVG,yBAAyB,EAAG;EAAM,GAEhCH,KAAK,CAACC,QACwB,CAAC;AAEpC,CAAC;AAED,eAAeU,mBAAmB"}
@@ -7,7 +7,7 @@ import classnames from 'classnames';
7
7
  /**
8
8
  * WordPress dependencies
9
9
  */
10
- import { __, sprintf } from '@wordpress/i18n';
10
+ import { __, _x, sprintf } from '@wordpress/i18n';
11
11
  import { Fragment } from '@wordpress/element';
12
12
  import { ToggleControl } from '@wordpress/components';
13
13
 
@@ -26,8 +26,7 @@ function ResponsiveBlockControl(props) {
26
26
  isResponsive = false,
27
27
  defaultLabel = {
28
28
  id: 'all',
29
- /* translators: 'Label. Used to signify a layout property (eg: margin, padding) will apply uniformly to all screensizes.' */
30
- label: __('All')
29
+ label: _x('All', 'screen sizes')
31
30
  },
32
31
  viewports = [{
33
32
  id: 'small',
@@ -43,10 +42,8 @@ function ResponsiveBlockControl(props) {
43
42
  if (!title || !property || !renderDefaultControl) {
44
43
  return null;
45
44
  }
46
- const toggleControlLabel = toggleLabel || sprintf( /* translators: 'Toggle control label. Should the property be the same across all screen sizes or unique per screen size.'. %s property value for the control (eg: margin, padding...etc) */
45
+ const toggleControlLabel = toggleLabel || sprintf( /* translators: %s: Property value for the control (eg: margin, padding, etc.). */
47
46
  __('Use the same %s on all screensizes.'), property);
48
-
49
- /* translators: 'Help text for the responsive mode toggle control.' */
50
47
  const toggleHelpText = __('Toggle between using the same value for all screen sizes or using a unique value per screen size.');
51
48
  const defaultControl = renderDefaultControl(createElement(ResponsiveBlockControlLabel, {
52
49
  property: property,
@@ -1 +1 @@
1
- {"version":3,"names":["classnames","__","sprintf","Fragment","ToggleControl","ResponsiveBlockControlLabel","ResponsiveBlockControl","props","title","property","toggleLabel","onIsResponsiveChange","renderDefaultControl","renderResponsiveControls","isResponsive","defaultLabel","id","label","viewports","toggleControlLabel","toggleHelpText","defaultControl","createElement","viewport","defaultResponsiveControls","map","key","className","__nextHasNoMarginBottom","checked","onChange","help"],"sources":["@wordpress/block-editor/src/components/responsive-block-control/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { Fragment } from '@wordpress/element';\nimport { ToggleControl } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport ResponsiveBlockControlLabel from './label';\n\nfunction ResponsiveBlockControl( props ) {\n\tconst {\n\t\ttitle,\n\t\tproperty,\n\t\ttoggleLabel,\n\t\tonIsResponsiveChange,\n\t\trenderDefaultControl,\n\t\trenderResponsiveControls,\n\t\tisResponsive = false,\n\t\tdefaultLabel = {\n\t\t\tid: 'all',\n\t\t\t/* translators: 'Label. Used to signify a layout property (eg: margin, padding) will apply uniformly to all screensizes.' */\n\t\t\tlabel: __( 'All' ),\n\t\t},\n\t\tviewports = [\n\t\t\t{\n\t\t\t\tid: 'small',\n\t\t\t\tlabel: __( 'Small screens' ),\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'medium',\n\t\t\t\tlabel: __( 'Medium screens' ),\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'large',\n\t\t\t\tlabel: __( 'Large screens' ),\n\t\t\t},\n\t\t],\n\t} = props;\n\n\tif ( ! title || ! property || ! renderDefaultControl ) {\n\t\treturn null;\n\t}\n\n\tconst toggleControlLabel =\n\t\ttoggleLabel ||\n\t\tsprintf(\n\t\t\t/* translators: 'Toggle control label. Should the property be the same across all screen sizes or unique per screen size.'. %s property value for the control (eg: margin, padding...etc) */\n\t\t\t__( 'Use the same %s on all screensizes.' ),\n\t\t\tproperty\n\t\t);\n\n\t/* translators: 'Help text for the responsive mode toggle control.' */\n\tconst toggleHelpText = __(\n\t\t'Toggle between using the same value for all screen sizes or using a unique value per screen size.'\n\t);\n\n\tconst defaultControl = renderDefaultControl(\n\t\t<ResponsiveBlockControlLabel\n\t\t\tproperty={ property }\n\t\t\tviewport={ defaultLabel }\n\t\t/>,\n\t\tdefaultLabel\n\t);\n\n\tconst defaultResponsiveControls = () => {\n\t\treturn viewports.map( ( viewport ) => (\n\t\t\t<Fragment key={ viewport.id }>\n\t\t\t\t{ renderDefaultControl(\n\t\t\t\t\t<ResponsiveBlockControlLabel\n\t\t\t\t\t\tproperty={ property }\n\t\t\t\t\t\tviewport={ viewport }\n\t\t\t\t\t/>,\n\t\t\t\t\tviewport\n\t\t\t\t) }\n\t\t\t</Fragment>\n\t\t) );\n\t};\n\n\treturn (\n\t\t<fieldset className=\"block-editor-responsive-block-control\">\n\t\t\t<legend className=\"block-editor-responsive-block-control__title\">\n\t\t\t\t{ title }\n\t\t\t</legend>\n\n\t\t\t<div className=\"block-editor-responsive-block-control__inner\">\n\t\t\t\t<ToggleControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tclassName=\"block-editor-responsive-block-control__toggle\"\n\t\t\t\t\tlabel={ toggleControlLabel }\n\t\t\t\t\tchecked={ ! isResponsive }\n\t\t\t\t\tonChange={ onIsResponsiveChange }\n\t\t\t\t\thelp={ toggleHelpText }\n\t\t\t\t/>\n\t\t\t\t<div\n\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t'block-editor-responsive-block-control__group',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t'is-responsive': isResponsive,\n\t\t\t\t\t\t}\n\t\t\t\t\t) }\n\t\t\t\t>\n\t\t\t\t\t{ ! isResponsive && defaultControl }\n\t\t\t\t\t{ isResponsive &&\n\t\t\t\t\t\t( renderResponsiveControls\n\t\t\t\t\t\t\t? renderResponsiveControls( viewports )\n\t\t\t\t\t\t\t: defaultResponsiveControls() ) }\n\t\t\t\t</div>\n\t\t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B,CAAC,EACFA,YACD,CAAC;EAED,MAAMS,yBAAyB,GAAGA,CAAA,KAAM;IACvC,OAAON,SAAS,CAACO,GAAG,CAAIF,QAAQ,IAC/BD,aAAA,CAACnB,QAAQ;MAACuB,GAAG,EAAGH,QAAQ,CAACP;IAAI,GAC1BJ,oBAAoB,CACrBU,aAAA,CAACjB,2BAA2B;MAC3BI,QAAQ,EAAGA,QAAU;MACrBc,QAAQ,EAAGA;IAAU,CACrB,CAAC,EACFA,QACD,CACS,CACT,CAAC;EACJ,CAAC;EAED,OACCD,aAAA;IAAUK,SAAS,EAAC;EAAuC,GAC1DL,aAAA;IAAQK,SAAS,EAAC;EAA8C,GAC7DnB,KACK,CAAC,EAETc,aAAA;IAAKK,SAAS,EAAC;EAA8C,GAC5DL,aAAA,CAAClB,aAAa;IACbwB,uBAAuB;IACvBD,SAAS,EAAC,+CAA+C;IACzDV,KAAK,EAAGE,kBAAoB;IAC5BU,OAAO,EAAG,CAAEf,YAAc;IAC1BgB,QAAQ,EAAGnB,oBAAsB;IACjCoB,IAAI,EAAGX;EAAgB,CACvB,CAAC,EACFE,aAAA;IACCK,SAAS,EAAG3B,UAAU,CACrB,8CAA8C,EAC9C;MACC,eAAe,EAAEc;IAClB,CACD;EAAG,GAED,CAAEA,YAAY,IAAIO,cAAc,EAChCP,YAAY,KACXD,wBAAwB,GACvBA,wBAAwB,CAAEK,SAAU,CAAC,GACrCM,yBAAyB,CAAC,CAAC,CAC3B,CACD,CACI,CAAC;AAEb;AAEA,eAAelB,sBAAsB"}
1
+ {"version":3,"names":["classnames","__","_x","sprintf","Fragment","ToggleControl","ResponsiveBlockControlLabel","ResponsiveBlockControl","props","title","property","toggleLabel","onIsResponsiveChange","renderDefaultControl","renderResponsiveControls","isResponsive","defaultLabel","id","label","viewports","toggleControlLabel","toggleHelpText","defaultControl","createElement","viewport","defaultResponsiveControls","map","key","className","__nextHasNoMarginBottom","checked","onChange","help"],"sources":["@wordpress/block-editor/src/components/responsive-block-control/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport { Fragment } from '@wordpress/element';\nimport { ToggleControl } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport ResponsiveBlockControlLabel from './label';\n\nfunction ResponsiveBlockControl( props ) {\n\tconst {\n\t\ttitle,\n\t\tproperty,\n\t\ttoggleLabel,\n\t\tonIsResponsiveChange,\n\t\trenderDefaultControl,\n\t\trenderResponsiveControls,\n\t\tisResponsive = false,\n\t\tdefaultLabel = {\n\t\t\tid: 'all',\n\t\t\tlabel: _x( 'All', 'screen sizes' ),\n\t\t},\n\t\tviewports = [\n\t\t\t{\n\t\t\t\tid: 'small',\n\t\t\t\tlabel: __( 'Small screens' ),\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'medium',\n\t\t\t\tlabel: __( 'Medium screens' ),\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'large',\n\t\t\t\tlabel: __( 'Large screens' ),\n\t\t\t},\n\t\t],\n\t} = props;\n\n\tif ( ! title || ! property || ! renderDefaultControl ) {\n\t\treturn null;\n\t}\n\n\tconst toggleControlLabel =\n\t\ttoggleLabel ||\n\t\tsprintf(\n\t\t\t/* translators: %s: Property value for the control (eg: margin, padding, etc.). */\n\t\t\t__( 'Use the same %s on all screensizes.' ),\n\t\t\tproperty\n\t\t);\n\n\tconst toggleHelpText = __(\n\t\t'Toggle between using the same value for all screen sizes or using a unique value per screen size.'\n\t);\n\n\tconst defaultControl = renderDefaultControl(\n\t\t<ResponsiveBlockControlLabel\n\t\t\tproperty={ property }\n\t\t\tviewport={ defaultLabel }\n\t\t/>,\n\t\tdefaultLabel\n\t);\n\n\tconst defaultResponsiveControls = () => {\n\t\treturn viewports.map( ( viewport ) => (\n\t\t\t<Fragment key={ viewport.id }>\n\t\t\t\t{ renderDefaultControl(\n\t\t\t\t\t<ResponsiveBlockControlLabel\n\t\t\t\t\t\tproperty={ property }\n\t\t\t\t\t\tviewport={ viewport }\n\t\t\t\t\t/>,\n\t\t\t\t\tviewport\n\t\t\t\t) }\n\t\t\t</Fragment>\n\t\t) );\n\t};\n\n\treturn (\n\t\t<fieldset className=\"block-editor-responsive-block-control\">\n\t\t\t<legend className=\"block-editor-responsive-block-control__title\">\n\t\t\t\t{ title }\n\t\t\t</legend>\n\n\t\t\t<div className=\"block-editor-responsive-block-control__inner\">\n\t\t\t\t<ToggleControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tclassName=\"block-editor-responsive-block-control__toggle\"\n\t\t\t\t\tlabel={ toggleControlLabel }\n\t\t\t\t\tchecked={ ! isResponsive }\n\t\t\t\t\tonChange={ onIsResponsiveChange }\n\t\t\t\t\thelp={ toggleHelpText }\n\t\t\t\t/>\n\t\t\t\t<div\n\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t'block-editor-responsive-block-control__group',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t'is-responsive': isResponsive,\n\t\t\t\t\t\t}\n\t\t\t\t\t) }\n\t\t\t\t>\n\t\t\t\t\t{ ! isResponsive && defaultControl }\n\t\t\t\t\t{ isResponsive &&\n\t\t\t\t\t\t( renderResponsiveControls\n\t\t\t\t\t\t\t? renderResponsiveControls( viewports )\n\t\t\t\t\t\t\t: defaultResponsiveControls() ) }\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</fieldset>\n\t);\n}\n\nexport default ResponsiveBlockControl;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,EAAE,EAAEC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AACjD,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,aAAa,QAAQ,uBAAuB;;AAErD;AACA;AACA;AACA,OAAOC,2BAA2B,MAAM,SAAS;AAEjD,SAASC,sBAAsBA,CAAEC,KAAK,EAAG;EACxC,M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,aAAA;IAAUK,SAAS,EAAC;EAAuC,GAC1DL,aAAA;IAAQK,SAAS,EAAC;EAA8C,GAC7DnB,KACK,CAAC,EAETc,aAAA;IAAKK,SAAS,EAAC;EAA8C,GAC5DL,aAAA,CAAClB,aAAa;IACbwB,uBAAuB;IACvBD,SAAS,EAAC,+CAA+C;IACzDV,KAAK,EAAGE,kBAAoB;IAC5BU,OAAO,EAAG,CAAEf,YAAc;IAC1BgB,QAAQ,EAAGnB,oBAAsB;IACjCoB,IAAI,EAAGX;EAAgB,CACvB,CAAC,EACFE,aAAA;IACCK,SAAS,EAAG5B,UAAU,CACrB,8CAA8C,EAC9C;MACC,eAAe,EAAEe;IAClB,CACD;EAAG,GAED,CAAEA,YAAY,IAAIO,cAAc,EAChCP,YAAY,KACXD,wBAAwB,GACvBA,wBAAwB,CAAEK,SAAU,CAAC,GACrCM,yBAAyB,CAAC,CAAC,CAC3B,CACD,CACI,CAAC;AAEb;AAEA,eAAelB,sBAAsB"}
@@ -39,6 +39,7 @@ import { getAllowedFormats } from './utils';
39
39
  import { Content } from './content';
40
40
  import { withDeprecations } from './with-deprecations';
41
41
  import { unlock } from '../../lock-unlock';
42
+ import { BLOCK_BINDINGS_ALLOWED_BLOCKS } from '../../hooks/use-bindings-attributes';
42
43
  export const keyboardShortcutContext = createContext();
43
44
  export const inputEventContext = createContext();
44
45
 
@@ -132,7 +133,7 @@ export function RichTextWrapper({
132
133
 
133
134
  // Disable Rich Text editing if block bindings specify that.
134
135
  let shouldDisableEditing = false;
135
- if (blockBindings) {
136
+ if (blockBindings && blockName in BLOCK_BINDINGS_ALLOWED_BLOCKS) {
136
137
  const blockTypeAttributes = getBlockType(blockName).attributes;
137
138
  const {
138
139
  getBlockBindingsSource
@@ -298,6 +299,7 @@ export function RichTextWrapper({
298
299
  role: "textbox",
299
300
  "aria-multiline": !disableLineBreaks,
300
301
  "aria-label": placeholder,
302
+ "aria-readonly": shouldDisableEditing,
301
303
  ...props,
302
304
  ...autocompleteProps,
303
305
  ref: useMergeRefs([
@@ -1 +1 @@
1
- {"version":3,"names":["classnames","useRef","useCallback","forwardRef","createContext","useDispatch","useSelect","useMergeRefs","__unstableUseRichText","useRichText","removeFormat","Popover","getBlockType","useBlockEditorAutocompleteProps","useBlockEditContext","FormatToolbarContainer","store","blockEditorStore","useUndoAutomaticChange","useMarkPersistent","usePasteHandler","useBeforeInputRules","useInputRules","useDelete","useEnter","useFormatTypes","useRemoveBrowserShortcuts","useShortcuts","useInputEvents","useInsertReplacementText","useFirefoxCompat","FormatEdit","getAllowedFormats","Content","withDeprecations","unlock","keyboardShortcutContext","inputEventContext","removeNativeProps","props","__unstableMobileNoFocusOnMount","deleteEnter","placeholderTextColor","textAlign","selectionColor","tagsToEliminate","disableEditingMenu","fontSize","fontFamily","fontWeight","fontStyle","minWidth","maxWidth","setRef","disableSuggestions","disableAutocorrection","restProps","RichTextWrapper","children","tagName","value","adjustedValue","onChange","adjustedOnChange","isSelected","originalIsSelected","multiline","inlineToolbar","wrapperClassName","autocompleters","onReplace","placeholder","allowedFormats","withoutInteractiveFormatting","onRemove","onMerge","onSplit","__unstableOnSplitAtEnd","onSplitAtEnd","__unstableOnSplitAtDoubleLineEnd","onSplitAtDoubleLineEnd","identifier","preserveWhiteSpace","__unstablePastePlainText","pastePlainText","__unstableEmbedURLOnPaste","__unstableDisableFormats","disableFormats","disableLineBreaks","__unstableAllowPrefixTransformations","forwardedRef","anchorRef","clientId","isBlockSelected","name","blockName","selector","select","getSelectionStart","getSelectionEnd","getBlockAttributes","selectionStart","selectionEnd","blockBindings","metadata","bindings","undefined","attributeKey","shouldDisableEditing","blockTypeAttributes","attributes","getBlockBindingsSource","attribute","args","Object","entries","source","lockAttributesEditing","offset","getBlockRootClientId","selectionChange","adjustedAllowedFormats","hasFormats","length","onSelectionChange","start","end","selection","unset","formatTypes","prepareHandlers","valueHandlers","changeHandlers","dependencies","addEditorOnlyFormats","reduce","accumulator","fn","text","formats","removeEditorOnlyFormats","forEach","formatType","__experimentalCreatePrepareEditableTree","addInvisibleFormats","getValue","ref","richTextRef","html","__unstableFormats","__unstableText","values","changeHandler","__unstableIsSelected","__unstableDependencies","__unstableAfterParse","__unstableBeforeSerialize","__unstableAddInvisibleFormats","autocompleteProps","completers","record","keyboardShortcuts","Set","inputEvents","onFocus","current","focus","TagName","createElement","Fragment","Provider","__unstableSlotNameProvider","inline","editableContentElement","role","contentEditable","suppressContentEditableWarning","className","tabIndex","ForwardedRichTextContainer","isEmpty","RichTextShortcut","RichTextToolbarButton","__unstableRichTextInputEvent"],"sources":["@wordpress/block-editor/src/components/rich-text/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseRef,\n\tuseCallback,\n\tforwardRef,\n\tcreateContext,\n} from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useMergeRefs } from '@wordpress/compose';\nimport {\n\t__unstableUseRichText as useRichText,\n\tremoveFormat,\n} from '@wordpress/rich-text';\nimport { Popover } from '@wordpress/components';\nimport { getBlockType } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { useBlockEditorAutocompleteProps } from '../autocomplete';\nimport { useBlockEditContext } from '../block-edit';\nimport FormatToolbarContainer from './format-toolbar-container';\nimport { store as blockEditorStore } from '../../store';\nimport { useUndoAutomaticChange } from './use-undo-automatic-change';\nimport { useMarkPersistent } from './use-mark-persistent';\nimport { usePasteHandler } from './use-paste-handler';\nimport { useBeforeInputRules } from './use-before-input-rules';\nimport { useInputRules } from './use-input-rules';\nimport { useDelete } from './use-delete';\nimport { useEnter } from './use-enter';\nimport { useFormatTypes } from './use-format-types';\nimport { useRemoveBrowserShortcuts } from './use-remove-browser-shortcuts';\nimport { useShortcuts } from './use-shortcuts';\nimport { useInputEvents } from './use-input-events';\nimport { useInsertReplacementText } from './use-insert-replacement-text';\nimport { useFirefoxCompat } from './use-firefox-compat';\nimport FormatEdit from './format-edit';\nimport { getAllowedFormats } from './utils';\nimport { Content } from './content';\nimport { withDeprecations } from './with-deprecations';\nimport { unlock } from '../../lock-unlock';\n\nexport const keyboardShortcutContext = createContext();\nexport const inputEventContext = createContext();\n\n/**\n * Removes props used for the native version of RichText so that they are not\n * passed to the DOM element and log warnings.\n *\n * @param {Object} props Props to filter.\n *\n * @return {Object} Filtered props.\n */\nfunction removeNativeProps( props ) {\n\tconst {\n\t\t__unstableMobileNoFocusOnMount,\n\t\tdeleteEnter,\n\t\tplaceholderTextColor,\n\t\ttextAlign,\n\t\tselectionColor,\n\t\ttagsToEliminate,\n\t\tdisableEditingMenu,\n\t\tfontSize,\n\t\tfontFamily,\n\t\tfontWeight,\n\t\tfontStyle,\n\t\tminWidth,\n\t\tmaxWidth,\n\t\tsetRef,\n\t\tdisableSuggestions,\n\t\tdisableAutocorrection,\n\t\t...restProps\n\t} = props;\n\treturn restProps;\n}\n\nexport function RichTextWrapper(\n\t{\n\t\tchildren,\n\t\ttagName = 'div',\n\t\tvalue: adjustedValue = '',\n\t\tonChange: adjustedOnChange,\n\t\tisSelected: originalIsSelected,\n\t\tmultiline,\n\t\tinlineToolbar,\n\t\twrapperClassName,\n\t\tautocompleters,\n\t\tonReplace,\n\t\tplaceholder,\n\t\tallowedFormats,\n\t\twithoutInteractiveFormatting,\n\t\tonRemove,\n\t\tonMerge,\n\t\tonSplit,\n\t\t__unstableOnSplitAtEnd: onSplitAtEnd,\n\t\t__unstableOnSplitAtDoubleLineEnd: onSplitAtDoubleLineEnd,\n\t\tidentifier,\n\t\tpreserveWhiteSpace,\n\t\t__unstablePastePlainText: pastePlainText,\n\t\t__unstableEmbedURLOnPaste,\n\t\t__unstableDisableFormats: disableFormats,\n\t\tdisableLineBreaks,\n\t\t__unstableAllowPrefixTransformations,\n\t\t...props\n\t},\n\tforwardedRef\n) {\n\tprops = removeNativeProps( props );\n\n\tconst anchorRef = useRef();\n\tconst {\n\t\tclientId,\n\t\tisSelected: isBlockSelected,\n\t\tname: blockName,\n\t} = useBlockEditContext();\n\tconst selector = ( select ) => {\n\t\t// Avoid subscribing to the block editor store if the block is not\n\t\t// selected.\n\t\tif ( ! isBlockSelected ) {\n\t\t\treturn { isSelected: false };\n\t\t}\n\n\t\tconst { getSelectionStart, getSelectionEnd, getBlockAttributes } =\n\t\t\tselect( blockEditorStore );\n\t\tconst selectionStart = getSelectionStart();\n\t\tconst selectionEnd = getSelectionEnd();\n\t\tconst blockBindings =\n\t\t\tgetBlockAttributes( clientId )?.metadata?.bindings;\n\n\t\tlet isSelected;\n\n\t\tif ( originalIsSelected === undefined ) {\n\t\t\tisSelected =\n\t\t\t\tselectionStart.clientId === clientId &&\n\t\t\t\tselectionEnd.clientId === clientId &&\n\t\t\t\tselectionStart.attributeKey === identifier;\n\t\t} else if ( originalIsSelected ) {\n\t\t\tisSelected = selectionStart.clientId === clientId;\n\t\t}\n\n\t\t// Disable Rich Text editing if block bindings specify that.\n\t\tlet shouldDisableEditing = false;\n\t\tif ( blockBindings ) {\n\t\t\tconst blockTypeAttributes = getBlockType( blockName ).attributes;\n\t\t\tconst { getBlockBindingsSource } = unlock(\n\t\t\t\tselect( blockEditorStore )\n\t\t\t);\n\t\t\tfor ( const [ attribute, args ] of Object.entries(\n\t\t\t\tblockBindings\n\t\t\t) ) {\n\t\t\t\t// If any of the attributes with source \"rich-text\" is part of the bindings,\n\t\t\t\t// has a source with `lockAttributesEditing`, disable it.\n\t\t\t\tif (\n\t\t\t\t\tblockTypeAttributes?.[ attribute ]?.source ===\n\t\t\t\t\t\t'rich-text' &&\n\t\t\t\t\tgetBlockBindingsSource( args.source )?.lockAttributesEditing\n\t\t\t\t) {\n\t\t\t\t\tshouldDisableEditing = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\tselectionStart: isSelected ? selectionStart.offset : undefined,\n\t\t\tselectionEnd: isSelected ? selectionEnd.offset : undefined,\n\t\t\tisSelected,\n\t\t\tshouldDisableEditing,\n\t\t};\n\t};\n\tconst { selectionStart, selectionEnd, isSelected, shouldDisableEditing } =\n\t\tuseSelect( selector, [\n\t\t\tclientId,\n\t\t\tidentifier,\n\t\t\toriginalIsSelected,\n\t\t\tisBlockSelected,\n\t\t] );\n\tconst { getSelectionStart, getSelectionEnd, getBlockRootClientId } =\n\t\tuseSelect( blockEditorStore );\n\tconst { selectionChange } = useDispatch( blockEditorStore );\n\tconst adjustedAllowedFormats = getAllowedFormats( {\n\t\tallowedFormats,\n\t\tdisableFormats,\n\t} );\n\tconst hasFormats =\n\t\t! adjustedAllowedFormats || adjustedAllowedFormats.length > 0;\n\n\tconst onSelectionChange = useCallback(\n\t\t( start, end ) => {\n\t\t\tconst selection = {};\n\t\t\tconst unset = start === undefined && end === undefined;\n\n\t\t\tif ( typeof start === 'number' || unset ) {\n\t\t\t\t// If we are only setting the start (or the end below), which\n\t\t\t\t// means a partial selection, and we're not updating a selection\n\t\t\t\t// with the same client ID, abort. This means the selected block\n\t\t\t\t// is a parent block.\n\t\t\t\tif (\n\t\t\t\t\tend === undefined &&\n\t\t\t\t\tgetBlockRootClientId( clientId ) !==\n\t\t\t\t\t\tgetBlockRootClientId( getSelectionEnd().clientId )\n\t\t\t\t) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tselection.start = {\n\t\t\t\t\tclientId,\n\t\t\t\t\tattributeKey: identifier,\n\t\t\t\t\toffset: start,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tif ( typeof end === 'number' || unset ) {\n\t\t\t\tif (\n\t\t\t\t\tstart === undefined &&\n\t\t\t\t\tgetBlockRootClientId( clientId ) !==\n\t\t\t\t\t\tgetBlockRootClientId( getSelectionStart().clientId )\n\t\t\t\t) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tselection.end = {\n\t\t\t\t\tclientId,\n\t\t\t\t\tattributeKey: identifier,\n\t\t\t\t\toffset: end,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tselectionChange( selection );\n\t\t},\n\t\t[ clientId, identifier ]\n\t);\n\n\tconst {\n\t\tformatTypes,\n\t\tprepareHandlers,\n\t\tvalueHandlers,\n\t\tchangeHandlers,\n\t\tdependencies,\n\t} = useFormatTypes( {\n\t\tclientId,\n\t\tidentifier,\n\t\twithoutInteractiveFormatting,\n\t\tallowedFormats: adjustedAllowedFormats,\n\t} );\n\n\tfunction addEditorOnlyFormats( value ) {\n\t\treturn valueHandlers.reduce(\n\t\t\t( accumulator, fn ) => fn( accumulator, value.text ),\n\t\t\tvalue.formats\n\t\t);\n\t}\n\n\tfunction removeEditorOnlyFormats( value ) {\n\t\tformatTypes.forEach( ( formatType ) => {\n\t\t\t// Remove formats created by prepareEditableTree, because they are editor only.\n\t\t\tif ( formatType.__experimentalCreatePrepareEditableTree ) {\n\t\t\t\tvalue = removeFormat(\n\t\t\t\t\tvalue,\n\t\t\t\t\tformatType.name,\n\t\t\t\t\t0,\n\t\t\t\t\tvalue.text.length\n\t\t\t\t);\n\t\t\t}\n\t\t} );\n\n\t\treturn value.formats;\n\t}\n\n\tfunction addInvisibleFormats( value ) {\n\t\treturn prepareHandlers.reduce(\n\t\t\t( accumulator, fn ) => fn( accumulator, value.text ),\n\t\t\tvalue.formats\n\t\t);\n\t}\n\n\tconst {\n\t\tvalue,\n\t\tgetValue,\n\t\tonChange,\n\t\tref: richTextRef,\n\t} = useRichText( {\n\t\tvalue: adjustedValue,\n\t\tonChange( html, { __unstableFormats, __unstableText } ) {\n\t\t\tadjustedOnChange( html );\n\t\t\tObject.values( changeHandlers ).forEach( ( changeHandler ) => {\n\t\t\t\tchangeHandler( __unstableFormats, __unstableText );\n\t\t\t} );\n\t\t},\n\t\tselectionStart,\n\t\tselectionEnd,\n\t\tonSelectionChange,\n\t\tplaceholder,\n\t\t__unstableIsSelected: isSelected,\n\t\t__unstableDisableFormats: disableFormats,\n\t\tpreserveWhiteSpace,\n\t\t__unstableDependencies: [ ...dependencies, tagName ],\n\t\t__unstableAfterParse: addEditorOnlyFormats,\n\t\t__unstableBeforeSerialize: removeEditorOnlyFormats,\n\t\t__unstableAddInvisibleFormats: addInvisibleFormats,\n\t} );\n\tconst autocompleteProps = useBlockEditorAutocompleteProps( {\n\t\tonReplace,\n\t\tcompleters: autocompleters,\n\t\trecord: value,\n\t\tonChange,\n\t} );\n\n\tuseMarkPersistent( { html: adjustedValue, value } );\n\n\tconst keyboardShortcuts = useRef( new Set() );\n\tconst inputEvents = useRef( new Set() );\n\n\tfunction onFocus() {\n\t\tanchorRef.current?.focus();\n\t}\n\n\tconst TagName = tagName;\n\treturn (\n\t\t<>\n\t\t\t{ isSelected && (\n\t\t\t\t<keyboardShortcutContext.Provider value={ keyboardShortcuts }>\n\t\t\t\t\t<inputEventContext.Provider value={ inputEvents }>\n\t\t\t\t\t\t<Popover.__unstableSlotNameProvider value=\"__unstable-block-tools-after\">\n\t\t\t\t\t\t\t{ children &&\n\t\t\t\t\t\t\t\tchildren( { value, onChange, onFocus } ) }\n\n\t\t\t\t\t\t\t<FormatEdit\n\t\t\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t\t\tonFocus={ onFocus }\n\t\t\t\t\t\t\t\tformatTypes={ formatTypes }\n\t\t\t\t\t\t\t\tforwardedRef={ anchorRef }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</Popover.__unstableSlotNameProvider>\n\t\t\t\t\t</inputEventContext.Provider>\n\t\t\t\t</keyboardShortcutContext.Provider>\n\t\t\t) }\n\t\t\t{ isSelected && hasFormats && (\n\t\t\t\t<FormatToolbarContainer\n\t\t\t\t\tinline={ inlineToolbar }\n\t\t\t\t\teditableContentElement={ anchorRef.current }\n\t\t\t\t\tvalue={ value }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t<TagName\n\t\t\t\t// Overridable props.\n\t\t\t\trole=\"textbox\"\n\t\t\t\taria-multiline={ ! disableLineBreaks }\n\t\t\t\taria-label={ placeholder }\n\t\t\t\t{ ...props }\n\t\t\t\t{ ...autocompleteProps }\n\t\t\t\tref={ useMergeRefs( [\n\t\t\t\t\t// Rich text ref must be first because its focus listener\n\t\t\t\t\t// must be set up before any other ref calls .focus() on\n\t\t\t\t\t// mount.\n\t\t\t\t\trichTextRef,\n\t\t\t\t\tforwardedRef,\n\t\t\t\t\tautocompleteProps.ref,\n\t\t\t\t\tprops.ref,\n\t\t\t\t\tuseBeforeInputRules( { value, onChange } ),\n\t\t\t\t\tuseInputRules( {\n\t\t\t\t\t\tgetValue,\n\t\t\t\t\t\tonChange,\n\t\t\t\t\t\t__unstableAllowPrefixTransformations,\n\t\t\t\t\t\tformatTypes,\n\t\t\t\t\t\tonReplace,\n\t\t\t\t\t\tselectionChange,\n\t\t\t\t\t} ),\n\t\t\t\t\tuseInsertReplacementText(),\n\t\t\t\t\tuseRemoveBrowserShortcuts(),\n\t\t\t\t\tuseShortcuts( keyboardShortcuts ),\n\t\t\t\t\tuseInputEvents( inputEvents ),\n\t\t\t\t\tuseUndoAutomaticChange(),\n\t\t\t\t\tusePasteHandler( {\n\t\t\t\t\t\tisSelected,\n\t\t\t\t\t\tdisableFormats,\n\t\t\t\t\t\tonChange,\n\t\t\t\t\t\tvalue,\n\t\t\t\t\t\tformatTypes,\n\t\t\t\t\t\ttagName,\n\t\t\t\t\t\tonReplace,\n\t\t\t\t\t\tonSplit,\n\t\t\t\t\t\t__unstableEmbedURLOnPaste,\n\t\t\t\t\t\tpastePlainText,\n\t\t\t\t\t} ),\n\t\t\t\t\tuseDelete( {\n\t\t\t\t\t\tvalue,\n\t\t\t\t\t\tonMerge,\n\t\t\t\t\t\tonRemove,\n\t\t\t\t\t} ),\n\t\t\t\t\tuseEnter( {\n\t\t\t\t\t\tremoveEditorOnlyFormats,\n\t\t\t\t\t\tvalue,\n\t\t\t\t\t\tonReplace,\n\t\t\t\t\t\tonSplit,\n\t\t\t\t\t\tonChange,\n\t\t\t\t\t\tdisableLineBreaks,\n\t\t\t\t\t\tonSplitAtEnd,\n\t\t\t\t\t\tonSplitAtDoubleLineEnd,\n\t\t\t\t\t} ),\n\t\t\t\t\tuseFirefoxCompat(),\n\t\t\t\t\tanchorRef,\n\t\t\t\t] ) }\n\t\t\t\tcontentEditable={ ! shouldDisableEditing }\n\t\t\t\tsuppressContentEditableWarning={ true }\n\t\t\t\tclassName={ classnames(\n\t\t\t\t\t'block-editor-rich-text__editable',\n\t\t\t\t\tprops.className,\n\t\t\t\t\t'rich-text'\n\t\t\t\t) }\n\t\t\t\t// Setting tabIndex to 0 is unnecessary, the element is already\n\t\t\t\t// focusable because it's contentEditable. This also fixes a\n\t\t\t\t// Safari bug where it's not possible to Shift+Click multi\n\t\t\t\t// select blocks when Shift Clicking into an element with\n\t\t\t\t// tabIndex because Safari will focus the element. However,\n\t\t\t\t// Safari will correctly ignore nested contentEditable elements.\n\t\t\t\ttabIndex={\n\t\t\t\t\tprops.tabIndex === 0 && ! shouldDisableEditing\n\t\t\t\t\t\t? null\n\t\t\t\t\t\t: props.tabIndex\n\t\t\t\t}\n\t\t\t\tdata-wp-block-attribute-key={ identifier }\n\t\t\t/>\n\t\t</>\n\t);\n}\n\nconst ForwardedRichTextContainer = withDeprecations(\n\tforwardRef( RichTextWrapper )\n);\n\nForwardedRichTextContainer.Content = Content;\nForwardedRichTextContainer.isEmpty = ( value ) => {\n\treturn ! value || value.length === 0;\n};\n\n/**\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/rich-text/README.md\n */\nexport default ForwardedRichTextContainer;\nexport { RichTextShortcut } from './shortcut';\nexport { RichTextToolbarButton } from './toolbar-button';\nexport { __unstableRichTextInputEvent } from './input-event';\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SACCC,MAAM,EACNC,WAAW,EACXC,UAAU,EACVC,aAAa,QACP,oBAAoB;AAC3B,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,S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ACPW,SAAS;MACTM,OAAO;MACPS,yBAAyB;MACzBD;IACD,CAAE,CAAC,EACH7D,SAAS,CAAE;MACVqC,KAAK;MACLe,OAAO;MACPD;IACD,CAAE,CAAC,EACHlD,QAAQ,CAAE;MACToH,uBAAuB;MACvBhF,KAAK;MACLU,SAAS;MACTM,OAAO;MACPd,QAAQ;MACR0B,iBAAiB;MACjBV,YAAY;MACZE;IACD,CAAE,CAAC,EACHlD,gBAAgB,CAAC,CAAC,EAClB6D,SAAS,CACR,CAAG;IACLoF,eAAe,EAAG,CAAEnE,oBAAsB;IAC1CoE,8BAA8B,EAAG,IAAM;IACvCC,SAAS,EAAGjL,UAAU,CACrB,kCAAkC,EAClCuC,KAAK,CAAC0I,SAAS,EACf,WACD;IACA;IACA;IACA;IACA;IACA;IACA;IAAA;IACAC,QAAQ,EACP3I,KAAK,CAAC2I,QAAQ,KAAK,CAAC,IAAI,CAAEtE,oBAAoB,GAC3C,IAAI,GACJrE,KAAK,CAAC2I,QACT;IACD,+BAA8BjG;EAAY,CAC1C,CACA,CAAC;AAEL;AAEA,MAAMkG,0BAA0B,GAAGjJ,gBAAgB,CAClD/B,UAAU,CAAEsD,eAAgB,CAC7B,CAAC;AAED0H,0BAA0B,CAAClJ,OAAO,GAAGA,OAAO;AAC5CkJ,0BAA0B,CAACC,OAAO,GAAKxH,KAAK,IAAM;EACjD,OAAO,CAAEA,KAAK,IAAIA,KAAK,CAAC+D,MAAM,KAAK,CAAC;AACrC,CAAC;;AAED;AACA;AACA;AACA,eAAewD,0BAA0B;AACzC,SAASE,gBAAgB,QAAQ,YAAY;AAC7C,SAASC,qBAAqB,QAAQ,kBAAkB;AACxD,SAASC,4BAA4B,QAAQ,eAAe"}
1
+ {"version":3,"names":["classnames","useRef","useCallback","forwardRef","createContext","useDispatch","useSelect","useMergeRefs","__unstableUseRichText","useRichText","removeFormat","Popover","getBlockType","useBlockEditorAutocompleteProps","useBlockEditContext","FormatToolbarContainer","store","blockEditorStore","useUndoAutomaticChange","useMarkPersistent","usePasteHandler","useBeforeInputRules","useInputRules","useDelete","useEnter","useFormatTypes","useRemoveBrowserShortcuts","useShortcuts","useInputEvents","useInsertReplacementText","useFirefoxCompat","FormatEdit","getAllowedFormats","Content","withDeprecations","unlock","BLOCK_BINDINGS_ALLOWED_BLOCKS","keyboardShortcutContext","inputEventContext","removeNativeProps","props","__unstableMobileNoFocusOnMount","deleteEnter","placeholderTextColor","textAlign","selectionColor","tagsToEliminate","disableEditingMenu","fontSize","fontFamily","fontWeight","fontStyle","minWidth","maxWidth","setRef","disableSuggestions","disableAutocorrection","restProps","RichTextWrapper","children","tagName","value","adjustedValue","onChange","adjustedOnChange","isSelected","originalIsSelected","multiline","inlineToolbar","wrapperClassName","autocompleters","onReplace","placeholder","allowedFormats","withoutInteractiveFormatting","onRemove","onMerge","onSplit","__unstableOnSplitAtEnd","onSplitAtEnd","__unstableOnSplitAtDoubleLineEnd","onSplitAtDoubleLineEnd","identifier","preserveWhiteSpace","__unstablePastePlainText","pastePlainText","__unstableEmbedURLOnPaste","__unstableDisableFormats","disableFormats","disableLineBreaks","__unstableAllowPrefixTransformations","forwardedRef","anchorRef","clientId","isBlockSelected","name","blockName","selector","select","getSelectionStart","getSelectionEnd","getBlockAttributes","selectionStart","selectionEnd","blockBindings","metadata","bindings","undefined","attributeKey","shouldDisableEditing","blockTypeAttributes","attributes","getBlockBindingsSource","attribute","args","Object","entries","source","lockAttributesEditing","offset","getBlockRootClientId","selectionChange","adjustedAllowedFormats","hasFormats","length","onSelectionChange","start","end","selection","unset","formatTypes","prepareHandlers","valueHandlers","changeHandlers","dependencies","addEditorOnlyFormats","reduce","accumulator","fn","text","formats","removeEditorOnlyFormats","forEach","formatType","__experimentalCreatePrepareEditableTree","addInvisibleFormats","getValue","ref","richTextRef","html","__unstableFormats","__unstableText","values","changeHandler","__unstableIsSelected","__unstableDependencies","__unstableAfterParse","__unstableBeforeSerialize","__unstableAddInvisibleFormats","autocompleteProps","completers","record","keyboardShortcuts","Set","inputEvents","onFocus","current","focus","TagName","createElement","Fragment","Provider","__unstableSlotNameProvider","inline","editableContentElement","role","contentEditable","suppressContentEditableWarning","className","tabIndex","ForwardedRichTextContainer","isEmpty","RichTextShortcut","RichTextToolbarButton","__unstableRichTextInputEvent"],"sources":["@wordpress/block-editor/src/components/rich-text/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseRef,\n\tuseCallback,\n\tforwardRef,\n\tcreateContext,\n} from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useMergeRefs } from '@wordpress/compose';\nimport {\n\t__unstableUseRichText as useRichText,\n\tremoveFormat,\n} from '@wordpress/rich-text';\nimport { Popover } from '@wordpress/components';\nimport { getBlockType } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { useBlockEditorAutocompleteProps } from '../autocomplete';\nimport { useBlockEditContext } from '../block-edit';\nimport FormatToolbarContainer from './format-toolbar-container';\nimport { store as blockEditorStore } from '../../store';\nimport { useUndoAutomaticChange } from './use-undo-automatic-change';\nimport { useMarkPersistent } from './use-mark-persistent';\nimport { usePasteHandler } from './use-paste-handler';\nimport { useBeforeInputRules } from './use-before-input-rules';\nimport { useInputRules } from './use-input-rules';\nimport { useDelete } from './use-delete';\nimport { useEnter } from './use-enter';\nimport { useFormatTypes } from './use-format-types';\nimport { useRemoveBrowserShortcuts } from './use-remove-browser-shortcuts';\nimport { useShortcuts } from './use-shortcuts';\nimport { useInputEvents } from './use-input-events';\nimport { useInsertReplacementText } from './use-insert-replacement-text';\nimport { useFirefoxCompat } from './use-firefox-compat';\nimport FormatEdit from './format-edit';\nimport { getAllowedFormats } from './utils';\nimport { Content } from './content';\nimport { withDeprecations } from './with-deprecations';\nimport { unlock } from '../../lock-unlock';\nimport { BLOCK_BINDINGS_ALLOWED_BLOCKS } from '../../hooks/use-bindings-attributes';\n\nexport const keyboardShortcutContext = createContext();\nexport const inputEventContext = createContext();\n\n/**\n * Removes props used for the native version of RichText so that they are not\n * passed to the DOM element and log warnings.\n *\n * @param {Object} props Props to filter.\n *\n * @return {Object} Filtered props.\n */\nfunction removeNativeProps( props ) {\n\tconst {\n\t\t__unstableMobileNoFocusOnMount,\n\t\tdeleteEnter,\n\t\tplaceholderTextColor,\n\t\ttextAlign,\n\t\tselectionColor,\n\t\ttagsToEliminate,\n\t\tdisableEditingMenu,\n\t\tfontSize,\n\t\tfontFamily,\n\t\tfontWeight,\n\t\tfontStyle,\n\t\tminWidth,\n\t\tmaxWidth,\n\t\tsetRef,\n\t\tdisableSuggestions,\n\t\tdisableAutocorrection,\n\t\t...restProps\n\t} = props;\n\treturn restProps;\n}\n\nexport function RichTextWrapper(\n\t{\n\t\tchildren,\n\t\ttagName = 'div',\n\t\tvalue: adjustedValue = '',\n\t\tonChange: adjustedOnChange,\n\t\tisSelected: originalIsSelected,\n\t\tmultiline,\n\t\tinlineToolbar,\n\t\twrapperClassName,\n\t\tautocompleters,\n\t\tonReplace,\n\t\tplaceholder,\n\t\tallowedFormats,\n\t\twithoutInteractiveFormatting,\n\t\tonRemove,\n\t\tonMerge,\n\t\tonSplit,\n\t\t__unstableOnSplitAtEnd: onSplitAtEnd,\n\t\t__unstableOnSplitAtDoubleLineEnd: onSplitAtDoubleLineEnd,\n\t\tidentifier,\n\t\tpreserveWhiteSpace,\n\t\t__unstablePastePlainText: pastePlainText,\n\t\t__unstableEmbedURLOnPaste,\n\t\t__unstableDisableFormats: disableFormats,\n\t\tdisableLineBreaks,\n\t\t__unstableAllowPrefixTransformations,\n\t\t...props\n\t},\n\tforwardedRef\n) {\n\tprops = removeNativeProps( props );\n\n\tconst anchorRef = useRef();\n\tconst {\n\t\tclientId,\n\t\tisSelected: isBlockSelected,\n\t\tname: blockName,\n\t} = useBlockEditContext();\n\tconst selector = ( select ) => {\n\t\t// Avoid subscribing to the block editor store if the block is not\n\t\t// selected.\n\t\tif ( ! isBlockSelected ) {\n\t\t\treturn { isSelected: false };\n\t\t}\n\n\t\tconst { getSelectionStart, getSelectionEnd, getBlockAttributes } =\n\t\t\tselect( blockEditorStore );\n\t\tconst selectionStart = getSelectionStart();\n\t\tconst selectionEnd = getSelectionEnd();\n\t\tconst blockBindings =\n\t\t\tgetBlockAttributes( clientId )?.metadata?.bindings;\n\n\t\tlet isSelected;\n\n\t\tif ( originalIsSelected === undefined ) {\n\t\t\tisSelected =\n\t\t\t\tselectionStart.clientId === clientId &&\n\t\t\t\tselectionEnd.clientId === clientId &&\n\t\t\t\tselectionStart.attributeKey === identifier;\n\t\t} else if ( originalIsSelected ) {\n\t\t\tisSelected = selectionStart.clientId === clientId;\n\t\t}\n\n\t\t// Disable Rich Text editing if block bindings specify that.\n\t\tlet shouldDisableEditing = false;\n\t\tif ( blockBindings && blockName in BLOCK_BINDINGS_ALLOWED_BLOCKS ) {\n\t\t\tconst blockTypeAttributes = getBlockType( blockName ).attributes;\n\t\t\tconst { getBlockBindingsSource } = unlock(\n\t\t\t\tselect( blockEditorStore )\n\t\t\t);\n\t\t\tfor ( const [ attribute, args ] of Object.entries(\n\t\t\t\tblockBindings\n\t\t\t) ) {\n\t\t\t\t// If any of the attributes with source \"rich-text\" is part of the bindings,\n\t\t\t\t// has a source with `lockAttributesEditing`, disable it.\n\t\t\t\tif (\n\t\t\t\t\tblockTypeAttributes?.[ attribute ]?.source ===\n\t\t\t\t\t\t'rich-text' &&\n\t\t\t\t\tgetBlockBindingsSource( args.source )?.lockAttributesEditing\n\t\t\t\t) {\n\t\t\t\t\tshouldDisableEditing = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\tselectionStart: isSelected ? selectionStart.offset : undefined,\n\t\t\tselectionEnd: isSelected ? selectionEnd.offset : undefined,\n\t\t\tisSelected,\n\t\t\tshouldDisableEditing,\n\t\t};\n\t};\n\tconst { selectionStart, selectionEnd, isSelected, shouldDisableEditing } =\n\t\tuseSelect( selector, [\n\t\t\tclientId,\n\t\t\tidentifier,\n\t\t\toriginalIsSelected,\n\t\t\tisBlockSelected,\n\t\t] );\n\tconst { getSelectionStart, getSelectionEnd, getBlockRootClientId } =\n\t\tuseSelect( blockEditorStore );\n\tconst { selectionChange } = useDispatch( blockEditorStore );\n\tconst adjustedAllowedFormats = getAllowedFormats( {\n\t\tallowedFormats,\n\t\tdisableFormats,\n\t} );\n\tconst hasFormats =\n\t\t! adjustedAllowedFormats || adjustedAllowedFormats.length > 0;\n\n\tconst onSelectionChange = useCallback(\n\t\t( start, end ) => {\n\t\t\tconst selection = {};\n\t\t\tconst unset = start === undefined && end === undefined;\n\n\t\t\tif ( typeof start === 'number' || unset ) {\n\t\t\t\t// If we are only setting the start (or the end below), which\n\t\t\t\t// means a partial selection, and we're not updating a selection\n\t\t\t\t// with the same client ID, abort. This means the selected block\n\t\t\t\t// is a parent block.\n\t\t\t\tif (\n\t\t\t\t\tend === undefined &&\n\t\t\t\t\tgetBlockRootClientId( clientId ) !==\n\t\t\t\t\t\tgetBlockRootClientId( getSelectionEnd().clientId )\n\t\t\t\t) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tselection.start = {\n\t\t\t\t\tclientId,\n\t\t\t\t\tattributeKey: identifier,\n\t\t\t\t\toffset: start,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tif ( typeof end === 'number' || unset ) {\n\t\t\t\tif (\n\t\t\t\t\tstart === undefined &&\n\t\t\t\t\tgetBlockRootClientId( clientId ) !==\n\t\t\t\t\t\tgetBlockRootClientId( getSelectionStart().clientId )\n\t\t\t\t) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tselection.end = {\n\t\t\t\t\tclientId,\n\t\t\t\t\tattributeKey: identifier,\n\t\t\t\t\toffset: end,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tselectionChange( selection );\n\t\t},\n\t\t[ clientId, identifier ]\n\t);\n\n\tconst {\n\t\tformatTypes,\n\t\tprepareHandlers,\n\t\tvalueHandlers,\n\t\tchangeHandlers,\n\t\tdependencies,\n\t} = useFormatTypes( {\n\t\tclientId,\n\t\tidentifier,\n\t\twithoutInteractiveFormatting,\n\t\tallowedFormats: adjustedAllowedFormats,\n\t} );\n\n\tfunction addEditorOnlyFormats( value ) {\n\t\treturn valueHandlers.reduce(\n\t\t\t( accumulator, fn ) => fn( accumulator, value.text ),\n\t\t\tvalue.formats\n\t\t);\n\t}\n\n\tfunction removeEditorOnlyFormats( value ) {\n\t\tformatTypes.forEach( ( formatType ) => {\n\t\t\t// Remove formats created by prepareEditableTree, because they are editor only.\n\t\t\tif ( formatType.__experimentalCreatePrepareEditableTree ) {\n\t\t\t\tvalue = removeFormat(\n\t\t\t\t\tvalue,\n\t\t\t\t\tformatType.name,\n\t\t\t\t\t0,\n\t\t\t\t\tvalue.text.length\n\t\t\t\t);\n\t\t\t}\n\t\t} );\n\n\t\treturn value.formats;\n\t}\n\n\tfunction addInvisibleFormats( value ) {\n\t\treturn prepareHandlers.reduce(\n\t\t\t( accumulator, fn ) => fn( accumulator, value.text ),\n\t\t\tvalue.formats\n\t\t);\n\t}\n\n\tconst {\n\t\tvalue,\n\t\tgetValue,\n\t\tonChange,\n\t\tref: richTextRef,\n\t} = useRichText( {\n\t\tvalue: adjustedValue,\n\t\tonChange( html, { __unstableFormats, __unstableText } ) {\n\t\t\tadjustedOnChange( html );\n\t\t\tObject.values( changeHandlers ).forEach( ( changeHandler ) => {\n\t\t\t\tchangeHandler( __unstableFormats, __unstableText );\n\t\t\t} );\n\t\t},\n\t\tselectionStart,\n\t\tselectionEnd,\n\t\tonSelectionChange,\n\t\tplaceholder,\n\t\t__unstableIsSelected: isSelected,\n\t\t__unstableDisableFormats: disableFormats,\n\t\tpreserveWhiteSpace,\n\t\t__unstableDependencies: [ ...dependencies, tagName ],\n\t\t__unstableAfterParse: addEditorOnlyFormats,\n\t\t__unstableBeforeSerialize: removeEditorOnlyFormats,\n\t\t__unstableAddInvisibleFormats: addInvisibleFormats,\n\t} );\n\tconst autocompleteProps = useBlockEditorAutocompleteProps( {\n\t\tonReplace,\n\t\tcompleters: autocompleters,\n\t\trecord: value,\n\t\tonChange,\n\t} );\n\n\tuseMarkPersistent( { html: adjustedValue, value } );\n\n\tconst keyboardShortcuts = useRef( new Set() );\n\tconst inputEvents = useRef( new Set() );\n\n\tfunction onFocus() {\n\t\tanchorRef.current?.focus();\n\t}\n\n\tconst TagName = tagName;\n\treturn (\n\t\t<>\n\t\t\t{ isSelected && (\n\t\t\t\t<keyboardShortcutContext.Provider value={ keyboardShortcuts }>\n\t\t\t\t\t<inputEventContext.Provider value={ inputEvents }>\n\t\t\t\t\t\t<Popover.__unstableSlotNameProvider value=\"__unstable-block-tools-after\">\n\t\t\t\t\t\t\t{ children &&\n\t\t\t\t\t\t\t\tchildren( { value, onChange, onFocus } ) }\n\n\t\t\t\t\t\t\t<FormatEdit\n\t\t\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t\t\tonFocus={ onFocus }\n\t\t\t\t\t\t\t\tformatTypes={ formatTypes }\n\t\t\t\t\t\t\t\tforwardedRef={ anchorRef }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</Popover.__unstableSlotNameProvider>\n\t\t\t\t\t</inputEventContext.Provider>\n\t\t\t\t</keyboardShortcutContext.Provider>\n\t\t\t) }\n\t\t\t{ isSelected && hasFormats && (\n\t\t\t\t<FormatToolbarContainer\n\t\t\t\t\tinline={ inlineToolbar }\n\t\t\t\t\teditableContentElement={ anchorRef.current }\n\t\t\t\t\tvalue={ value }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t<TagName\n\t\t\t\t// Overridable props.\n\t\t\t\trole=\"textbox\"\n\t\t\t\taria-multiline={ ! disableLineBreaks }\n\t\t\t\taria-label={ placeholder }\n\t\t\t\taria-readonly={ shouldDisableEditing }\n\t\t\t\t{ ...props }\n\t\t\t\t{ ...autocompleteProps }\n\t\t\t\tref={ useMergeRefs( [\n\t\t\t\t\t// Rich text ref must be first because its focus listener\n\t\t\t\t\t// must be set up before any other ref calls .focus() on\n\t\t\t\t\t// mount.\n\t\t\t\t\trichTextRef,\n\t\t\t\t\tforwardedRef,\n\t\t\t\t\tautocompleteProps.ref,\n\t\t\t\t\tprops.ref,\n\t\t\t\t\tuseBeforeInputRules( { value, onChange } ),\n\t\t\t\t\tuseInputRules( {\n\t\t\t\t\t\tgetValue,\n\t\t\t\t\t\tonChange,\n\t\t\t\t\t\t__unstableAllowPrefixTransformations,\n\t\t\t\t\t\tformatTypes,\n\t\t\t\t\t\tonReplace,\n\t\t\t\t\t\tselectionChange,\n\t\t\t\t\t} ),\n\t\t\t\t\tuseInsertReplacementText(),\n\t\t\t\t\tuseRemoveBrowserShortcuts(),\n\t\t\t\t\tuseShortcuts( keyboardShortcuts ),\n\t\t\t\t\tuseInputEvents( inputEvents ),\n\t\t\t\t\tuseUndoAutomaticChange(),\n\t\t\t\t\tusePasteHandler( {\n\t\t\t\t\t\tisSelected,\n\t\t\t\t\t\tdisableFormats,\n\t\t\t\t\t\tonChange,\n\t\t\t\t\t\tvalue,\n\t\t\t\t\t\tformatTypes,\n\t\t\t\t\t\ttagName,\n\t\t\t\t\t\tonReplace,\n\t\t\t\t\t\tonSplit,\n\t\t\t\t\t\t__unstableEmbedURLOnPaste,\n\t\t\t\t\t\tpastePlainText,\n\t\t\t\t\t} ),\n\t\t\t\t\tuseDelete( {\n\t\t\t\t\t\tvalue,\n\t\t\t\t\t\tonMerge,\n\t\t\t\t\t\tonRemove,\n\t\t\t\t\t} ),\n\t\t\t\t\tuseEnter( {\n\t\t\t\t\t\tremoveEditorOnlyFormats,\n\t\t\t\t\t\tvalue,\n\t\t\t\t\t\tonReplace,\n\t\t\t\t\t\tonSplit,\n\t\t\t\t\t\tonChange,\n\t\t\t\t\t\tdisableLineBreaks,\n\t\t\t\t\t\tonSplitAtEnd,\n\t\t\t\t\t\tonSplitAtDoubleLineEnd,\n\t\t\t\t\t} ),\n\t\t\t\t\tuseFirefoxCompat(),\n\t\t\t\t\tanchorRef,\n\t\t\t\t] ) }\n\t\t\t\tcontentEditable={ ! shouldDisableEditing }\n\t\t\t\tsuppressContentEditableWarning={ true }\n\t\t\t\tclassName={ classnames(\n\t\t\t\t\t'block-editor-rich-text__editable',\n\t\t\t\t\tprops.className,\n\t\t\t\t\t'rich-text'\n\t\t\t\t) }\n\t\t\t\t// Setting tabIndex to 0 is unnecessary, the element is already\n\t\t\t\t// focusable because it's contentEditable. This also fixes a\n\t\t\t\t// Safari bug where it's not possible to Shift+Click multi\n\t\t\t\t// select blocks when Shift Clicking into an element with\n\t\t\t\t// tabIndex because Safari will focus the element. However,\n\t\t\t\t// Safari will correctly ignore nested contentEditable elements.\n\t\t\t\ttabIndex={\n\t\t\t\t\tprops.tabIndex === 0 && ! shouldDisableEditing\n\t\t\t\t\t\t? null\n\t\t\t\t\t\t: props.tabIndex\n\t\t\t\t}\n\t\t\t\tdata-wp-block-attribute-key={ identifier }\n\t\t\t/>\n\t\t</>\n\t);\n}\n\nconst ForwardedRichTextContainer = withDeprecations(\n\tforwardRef( RichTextWrapper )\n);\n\nForwardedRichTextContainer.Content = Content;\nForwardedRichTextContainer.isEmpty = ( value ) => {\n\treturn ! value || value.length === 0;\n};\n\n/**\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/rich-text/README.md\n */\nexport default ForwardedRichTextContainer;\nexport { RichTextShortcut } from './shortcut';\nexport { RichTextToolbarButton } from './toolbar-button';\nexport { __unstableRichTextInputEvent } from './input-event';\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SACCC,MAAM,EACNC,WAAW,EACXC,UAAU,EACVC,aAAa,QACP,oBAAoB;AAC3B,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,YAAY,QAAQ,oBAAoB;AACjD,SACCC,qBA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ACdzB,QAAQ;MACRF,KAAK;MACLqE,WAAW;MACXtE,OAAO;MACPW,SAAS;MACTM,OAAO;MACPS,yBAAyB;MACzBD;IACD,CAAE,CAAC,EACH9D,SAAS,CAAE;MACVsC,KAAK;MACLe,OAAO;MACPD;IACD,CAAE,CAAC,EACHnD,QAAQ,CAAE;MACTqH,uBAAuB;MACvBhF,KAAK;MACLU,SAAS;MACTM,OAAO;MACPd,QAAQ;MACR0B,iBAAiB;MACjBV,YAAY;MACZE;IACD,CAAE,CAAC,EACHnD,gBAAgB,CAAC,CAAC,EAClB8D,SAAS,CACR,CAAG;IACLoF,eAAe,EAAG,CAAEnE,oBAAsB;IAC1CoE,8BAA8B,EAAG,IAAM;IACvCC,SAAS,EAAGlL,UAAU,CACrB,kCAAkC,EAClCwC,KAAK,CAAC0I,SAAS,EACf,WACD;IACA;IACA;IACA;IACA;IACA;IACA;IAAA;IACAC,QAAQ,EACP3I,KAAK,CAAC2I,QAAQ,KAAK,CAAC,IAAI,CAAEtE,oBAAoB,GAC3C,IAAI,GACJrE,KAAK,CAAC2I,QACT;IACD,+BAA8BjG;EAAY,CAC1C,CACA,CAAC;AAEL;AAEA,MAAMkG,0BAA0B,GAAGlJ,gBAAgB,CAClD/B,UAAU,CAAEuD,eAAgB,CAC7B,CAAC;AAED0H,0BAA0B,CAACnJ,OAAO,GAAGA,OAAO;AAC5CmJ,0BAA0B,CAACC,OAAO,GAAKxH,KAAK,IAAM;EACjD,OAAO,CAAEA,KAAK,IAAIA,KAAK,CAAC+D,MAAM,KAAK,CAAC;AACrC,CAAC;;AAED;AACA;AACA;AACA,eAAewD,0BAA0B;AACzC,SAASE,gBAAgB,QAAQ,YAAY;AAC7C,SAASC,qBAAqB,QAAQ,kBAAkB;AACxD,SAASC,4BAA4B,QAAQ,eAAe"}
@@ -629,7 +629,6 @@ export class RichText extends Component {
629
629
  } // no need to bump when 'undefined' as native side won't receive the key when the value is undefined, and that will cause force updating anyway,
630
630
  // see https://github.com/WordPress/gutenberg/blob/82e578dcc75e67891c750a41a04c1e31994192fc/packages/react-native-aztec/android/src/main/java/org/wordpress/mobile/ReactNativeAztec/ReactAztecManager.java#L213-L215
631
631
  }
632
-
633
632
  shouldComponentUpdate(nextProps, nextState) {
634
633
  if (nextProps.tagName !== this.props.tagName || nextProps.reversed !== this.props.reversed || nextProps.start !== this.props.start) {
635
634
  this.manipulateEventCounterToForceNativeToRefresh(); // force a refresh on the native side
@@ -655,7 +654,6 @@ export class RichText extends Component {
655
654
  }
656
655
  this.manipulateEventCounterToForceNativeToRefresh(); // force a refresh on the native side
657
656
  }
658
-
659
657
  if (!this.comesFromAztec) {
660
658
  if (typeof nextProps.selectionStart !== 'undefined' && typeof nextProps.selectionEnd !== 'undefined' && nextProps.selectionStart !== this.props.selectionStart && nextProps.selectionStart !== this.selectionStart && nextProps.__unstableIsSelected) {
661
659
  this.needsSelectionUpdate = true;
@@ -667,13 +665,11 @@ export class RichText extends Component {
667
665
  if (nextProps?.fontSize !== this.props?.fontSize) {
668
666
  this.manipulateEventCounterToForceNativeToRefresh(); // force a refresh on the native side
669
667
  }
670
-
671
668
  if (nextProps?.style?.fontSize !== this.props?.style?.fontSize && nextState.currentFontSize !== this.state.currentFontSize || nextState.currentFontSize !== this.state.currentFontSize || nextProps?.style?.lineHeight !== this.props?.style?.lineHeight) {
672
669
  this.needsSelectionUpdate = true;
673
670
  this.manipulateEventCounterToForceNativeToRefresh(); // force a refresh on the native side
674
671
  }
675
672
  }
676
-
677
673
  return true;
678
674
  }
679
675
  componentDidMount() {