@wordpress/block-editor 14.8.1-next.cd6172eb0.0 → 14.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1161) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/LICENSE.md +1 -1
  3. package/README.md +48 -0
  4. package/build/autocompleters/block.js +1 -0
  5. package/build/autocompleters/block.js.map +1 -1
  6. package/build/autocompleters/link.js +1 -0
  7. package/build/autocompleters/link.js.map +1 -1
  8. package/build/components/alignment-control/ui.js +1 -0
  9. package/build/components/alignment-control/ui.js.map +1 -1
  10. package/build/components/audio-player/index.native.js +1 -1
  11. package/build/components/audio-player/index.native.js.map +1 -1
  12. package/build/components/autocomplete/index.js +1 -0
  13. package/build/components/autocomplete/index.js.map +1 -1
  14. package/build/components/background-image-control/index.js +5 -0
  15. package/build/components/background-image-control/index.js.map +1 -1
  16. package/build/components/block-actions/index.js +1 -0
  17. package/build/components/block-actions/index.js.map +1 -1
  18. package/build/components/block-alignment-control/ui.js +1 -0
  19. package/build/components/block-alignment-control/ui.js.map +1 -1
  20. package/build/components/block-alignment-control/ui.native.js +1 -0
  21. package/build/components/block-alignment-control/ui.native.js.map +1 -1
  22. package/build/components/block-alignment-control/use-available-alignments.js +1 -0
  23. package/build/components/block-alignment-control/use-available-alignments.js.map +1 -1
  24. package/build/components/block-alignment-matrix-control/index.js +32 -0
  25. package/build/components/block-alignment-matrix-control/index.js.map +1 -1
  26. package/build/components/block-breadcrumb/index.js +1 -0
  27. package/build/components/block-breadcrumb/index.js.map +1 -1
  28. package/build/components/block-card/index.js +45 -8
  29. package/build/components/block-card/index.js.map +1 -1
  30. package/build/components/block-compare/index.js +1 -0
  31. package/build/components/block-compare/index.js.map +1 -1
  32. package/build/components/block-controls/fill.js +1 -0
  33. package/build/components/block-controls/fill.js.map +1 -1
  34. package/build/components/block-edit/edit.js +148 -10
  35. package/build/components/block-edit/edit.js.map +1 -1
  36. package/build/components/block-edit/edit.native.js +1 -0
  37. package/build/components/block-edit/edit.native.js.map +1 -1
  38. package/build/components/block-heading-level-dropdown/index.js +1 -0
  39. package/build/components/block-heading-level-dropdown/index.js.map +1 -1
  40. package/build/components/block-heading-level-dropdown/index.native.js +1 -0
  41. package/build/components/block-heading-level-dropdown/index.native.js.map +1 -1
  42. package/build/components/block-inspector/index.js +1 -0
  43. package/build/components/block-inspector/index.js.map +1 -1
  44. package/build/components/block-list/block-invalid-warning.js +1 -0
  45. package/build/components/block-list/block-invalid-warning.js.map +1 -1
  46. package/build/components/block-list/block-list-context.native.js +1 -0
  47. package/build/components/block-list/block-list-context.native.js.map +1 -1
  48. package/build/components/block-list/block.js +1 -0
  49. package/build/components/block-list/block.js.map +1 -1
  50. package/build/components/block-list/block.native.js +1 -0
  51. package/build/components/block-list/block.native.js.map +1 -1
  52. package/build/components/block-list/index.js +2 -2
  53. package/build/components/block-list/index.js.map +1 -1
  54. package/build/components/block-list/index.native.js +1 -0
  55. package/build/components/block-list/index.native.js.map +1 -1
  56. package/build/components/block-list/use-block-props/index.js +4 -5
  57. package/build/components/block-list/use-block-props/index.js.map +1 -1
  58. package/build/components/block-list/use-block-props/use-firefox-draggable-compatibility.js +61 -8
  59. package/build/components/block-list/use-block-props/use-firefox-draggable-compatibility.js.map +1 -1
  60. package/build/components/block-list/use-block-props/use-focus-first-element.js +1 -0
  61. package/build/components/block-list/use-block-props/use-focus-first-element.js.map +1 -1
  62. package/build/components/block-list/use-in-between-inserter.js +1 -0
  63. package/build/components/block-list/use-in-between-inserter.js.map +1 -1
  64. package/build/components/block-list/zoom-out-separator.js +20 -3
  65. package/build/components/block-list/zoom-out-separator.js.map +1 -1
  66. package/build/components/block-lock/modal.js +5 -4
  67. package/build/components/block-lock/modal.js.map +1 -1
  68. package/build/components/block-manager/category.js +1 -0
  69. package/build/components/block-manager/category.js.map +1 -1
  70. package/build/components/block-manager/checklist.js +1 -0
  71. package/build/components/block-manager/checklist.js.map +1 -1
  72. package/build/components/block-manager/index.js +1 -0
  73. package/build/components/block-manager/index.js.map +1 -1
  74. package/build/components/block-media-update-progress/index.native.js +1 -0
  75. package/build/components/block-media-update-progress/index.native.js.map +1 -1
  76. package/build/components/block-mover/index.native.js +1 -0
  77. package/build/components/block-mover/index.native.js.map +1 -1
  78. package/build/components/block-mover/mover-description.native.js +1 -0
  79. package/build/components/block-mover/mover-description.native.js.map +1 -1
  80. package/build/components/block-parent-selector/index.js +2 -15
  81. package/build/components/block-parent-selector/index.js.map +1 -1
  82. package/build/components/block-pattern-setup/index.js +1 -0
  83. package/build/components/block-pattern-setup/index.js.map +1 -1
  84. package/build/components/block-pattern-setup/use-patterns-setup.js +1 -0
  85. package/build/components/block-pattern-setup/use-patterns-setup.js.map +1 -1
  86. package/build/components/block-patterns-list/index.js +1 -0
  87. package/build/components/block-patterns-list/index.js.map +1 -1
  88. package/build/components/block-quick-navigation/index.js +1 -0
  89. package/build/components/block-quick-navigation/index.js.map +1 -1
  90. package/build/components/block-rename/rename-control.js +1 -0
  91. package/build/components/block-rename/rename-control.js.map +1 -1
  92. package/build/components/block-settings-menu/block-settings-dropdown.js +6 -8
  93. package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  94. package/build/components/block-styles/index.js +1 -0
  95. package/build/components/block-styles/index.js.map +1 -1
  96. package/build/components/block-styles/index.native.js +1 -0
  97. package/build/components/block-styles/index.native.js.map +1 -1
  98. package/build/components/block-styles/menu-items.js +1 -0
  99. package/build/components/block-styles/menu-items.js.map +1 -1
  100. package/build/components/block-styles/preview.native.js +1 -0
  101. package/build/components/block-styles/preview.native.js.map +1 -1
  102. package/build/components/block-styles/utils.js +3 -3
  103. package/build/components/block-styles/utils.js.map +1 -1
  104. package/build/components/block-switcher/block-transformations-menu.js +1 -0
  105. package/build/components/block-switcher/block-transformations-menu.js.map +1 -1
  106. package/build/components/block-switcher/block-transformations-menu.native.js +1 -0
  107. package/build/components/block-switcher/block-transformations-menu.native.js.map +1 -1
  108. package/build/components/block-switcher/block-variation-transformations.js +1 -0
  109. package/build/components/block-switcher/block-variation-transformations.js.map +1 -1
  110. package/build/components/block-switcher/index.js +1 -0
  111. package/build/components/block-switcher/index.js.map +1 -1
  112. package/build/components/block-switcher/pattern-transformations-menu.js +1 -0
  113. package/build/components/block-switcher/pattern-transformations-menu.js.map +1 -1
  114. package/build/components/block-switcher/use-transformed-patterns.js +1 -0
  115. package/build/components/block-switcher/use-transformed-patterns.js.map +1 -1
  116. package/build/components/block-switcher/utils.js +1 -0
  117. package/build/components/block-switcher/utils.js.map +1 -1
  118. package/build/components/block-toolbar/block-toolbar-menu.native.js +1 -0
  119. package/build/components/block-toolbar/block-toolbar-menu.native.js.map +1 -1
  120. package/build/components/block-toolbar/change-design.js +1 -0
  121. package/build/components/block-toolbar/change-design.js.map +1 -1
  122. package/build/components/block-toolbar/index.js +2 -1
  123. package/build/components/block-toolbar/index.js.map +1 -1
  124. package/build/components/block-tools/use-selected-block-tool-props.js +1 -0
  125. package/build/components/block-tools/use-selected-block-tool-props.js.map +1 -1
  126. package/build/components/block-tools/zoom-out-mode-inserters.js +19 -6
  127. package/build/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
  128. package/build/components/block-types-list/index.js +1 -0
  129. package/build/components/block-types-list/index.js.map +1 -1
  130. package/build/components/block-variation-picker/index.js +1 -0
  131. package/build/components/block-variation-picker/index.js.map +1 -1
  132. package/build/components/block-variation-picker/index.native.js +1 -0
  133. package/build/components/block-variation-picker/index.native.js.map +1 -1
  134. package/build/components/block-variation-transforms/index.js +1 -0
  135. package/build/components/block-variation-transforms/index.js.map +1 -1
  136. package/build/components/block-vertical-alignment-control/ui.js +1 -0
  137. package/build/components/block-vertical-alignment-control/ui.js.map +1 -1
  138. package/build/components/border-radius-control/index.js +1 -0
  139. package/build/components/border-radius-control/index.js.map +1 -1
  140. package/build/components/border-radius-control/input-controls.js +1 -0
  141. package/build/components/border-radius-control/input-controls.js.map +1 -1
  142. package/build/components/border-radius-control/utils.js +1 -0
  143. package/build/components/border-radius-control/utils.js.map +1 -1
  144. package/build/components/button-block-appender/index.js +1 -5
  145. package/build/components/button-block-appender/index.js.map +1 -1
  146. package/build/components/child-layout-control/index.js +6 -0
  147. package/build/components/child-layout-control/index.js.map +1 -1
  148. package/build/components/colors/utils.js +1 -0
  149. package/build/components/colors/utils.js.map +1 -1
  150. package/build/components/colors/with-colors.js +1 -0
  151. package/build/components/colors/with-colors.js.map +1 -1
  152. package/build/components/colors-gradients/dropdown.js +52 -11
  153. package/build/components/colors-gradients/dropdown.js.map +1 -1
  154. package/build/components/colors-gradients/panel-color-gradient-settings.js +1 -0
  155. package/build/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
  156. package/build/components/colors-gradients/panel-color-gradient-settings.native.js +1 -0
  157. package/build/components/colors-gradients/panel-color-gradient-settings.native.js.map +1 -1
  158. package/build/components/contrast-checker/index.native.js +1 -1
  159. package/build/components/contrast-checker/index.native.js.map +1 -1
  160. package/build/components/convert-to-group-buttons/toolbar.js +1 -0
  161. package/build/components/convert-to-group-buttons/toolbar.js.map +1 -1
  162. package/build/components/date-format-picker/index.js +8 -16
  163. package/build/components/date-format-picker/index.js.map +1 -1
  164. package/build/components/dimensions-tool/scale-tool.js +1 -0
  165. package/build/components/dimensions-tool/scale-tool.js.map +1 -1
  166. package/build/components/duotone/utils.js +1 -0
  167. package/build/components/duotone/utils.js.map +1 -1
  168. package/build/components/editor-styles/index.js +1 -0
  169. package/build/components/editor-styles/index.js.map +1 -1
  170. package/build/components/font-appearance-control/index.js +10 -0
  171. package/build/components/font-appearance-control/index.js.map +1 -1
  172. package/build/components/font-family/index.js +11 -1
  173. package/build/components/font-family/index.js.map +1 -1
  174. package/build/components/font-sizes/with-font-sizes.js +1 -0
  175. package/build/components/font-sizes/with-font-sizes.js.map +1 -1
  176. package/build/components/global-styles/border-panel.js +1 -0
  177. package/build/components/global-styles/border-panel.js.map +1 -1
  178. package/build/components/global-styles/color-panel.js +28 -8
  179. package/build/components/global-styles/color-panel.js.map +1 -1
  180. package/build/components/global-styles/color-panel.native.js +1 -0
  181. package/build/components/global-styles/color-panel.native.js.map +1 -1
  182. package/build/components/global-styles/dimensions-panel.js +1 -0
  183. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  184. package/build/components/global-styles/filters-panel.js +3 -2
  185. package/build/components/global-styles/filters-panel.js.map +1 -1
  186. package/build/components/global-styles/get-global-styles-changes.js +1 -0
  187. package/build/components/global-styles/get-global-styles-changes.js.map +1 -1
  188. package/build/components/global-styles/shadow-panel-components.js +1 -0
  189. package/build/components/global-styles/shadow-panel-components.js.map +1 -1
  190. package/build/components/global-styles/typography-utils.js +2 -1
  191. package/build/components/global-styles/typography-utils.js.map +1 -1
  192. package/build/components/global-styles/use-global-styles-context.native.js +1 -0
  193. package/build/components/global-styles/use-global-styles-context.native.js.map +1 -1
  194. package/build/components/global-styles/use-global-styles-output.js +2 -1
  195. package/build/components/global-styles/use-global-styles-output.js.map +1 -1
  196. package/build/components/global-styles/utils.js +1 -0
  197. package/build/components/global-styles/utils.js.map +1 -1
  198. package/build/components/grid/grid-visualizer.js +10 -0
  199. package/build/components/grid/grid-visualizer.js.map +1 -1
  200. package/build/components/grid/use-grid-layout-sync.js +1 -0
  201. package/build/components/grid/use-grid-layout-sync.js.map +1 -1
  202. package/build/components/grid/utils.js +13 -1
  203. package/build/components/grid/utils.js.map +1 -1
  204. package/build/components/iframe/get-compatibility-styles.js +1 -0
  205. package/build/components/iframe/get-compatibility-styles.js.map +1 -1
  206. package/build/components/iframe/index.js +1 -1
  207. package/build/components/iframe/index.js.map +1 -1
  208. package/build/components/image-editor/aspect-ratio-dropdown.js +1 -0
  209. package/build/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
  210. package/build/components/index.js +15 -8
  211. package/build/components/index.js.map +1 -1
  212. package/build/components/inner-blocks/use-block-context.js +1 -0
  213. package/build/components/inner-blocks/use-block-context.js.map +1 -1
  214. package/build/components/inner-blocks/use-inner-block-template-sync.js +11 -11
  215. package/build/components/inner-blocks/use-inner-block-template-sync.js.map +1 -1
  216. package/build/components/inserter/block-patterns-explorer/index.js +1 -1
  217. package/build/components/inserter/block-patterns-explorer/index.js.map +1 -1
  218. package/build/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js +1 -0
  219. package/build/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js.map +1 -1
  220. package/build/components/inserter/block-patterns-explorer/pattern-list.js +1 -0
  221. package/build/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
  222. package/build/components/inserter/block-patterns-tab/index.js +1 -1
  223. package/build/components/inserter/block-patterns-tab/index.js.map +1 -1
  224. package/build/components/inserter/block-patterns-tab/pattern-category-previews.js +5 -4
  225. package/build/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
  226. package/build/components/inserter/block-patterns-tab/patterns-filter.js +2 -2
  227. package/build/components/inserter/block-patterns-tab/patterns-filter.js.map +1 -1
  228. package/build/components/inserter/block-patterns-tab/use-pattern-categories.js +1 -0
  229. package/build/components/inserter/block-patterns-tab/use-pattern-categories.js.map +1 -1
  230. package/build/components/inserter/block-types-tab.js +2 -1
  231. package/build/components/inserter/block-types-tab.js.map +1 -1
  232. package/build/components/inserter/block-types-tab.native.js +1 -0
  233. package/build/components/inserter/block-types-tab.native.js.map +1 -1
  234. package/build/components/inserter/category-tabs/index.js +2 -2
  235. package/build/components/inserter/category-tabs/index.js.map +1 -1
  236. package/build/components/inserter/hooks/use-block-type-impressions.native.js +1 -0
  237. package/build/components/inserter/hooks/use-block-type-impressions.native.js.map +1 -1
  238. package/build/components/inserter/hooks/use-patterns-state.js +1 -0
  239. package/build/components/inserter/hooks/use-patterns-state.js.map +1 -1
  240. package/build/components/inserter/index.js +7 -15
  241. package/build/components/inserter/index.js.map +1 -1
  242. package/build/components/inserter/index.native.js +1 -0
  243. package/build/components/inserter/index.native.js.map +1 -1
  244. package/build/components/inserter/media-tab/hooks.js +1 -0
  245. package/build/components/inserter/media-tab/hooks.js.map +1 -1
  246. package/build/components/inserter/media-tab/media-list.js +1 -0
  247. package/build/components/inserter/media-tab/media-list.js.map +1 -1
  248. package/build/components/inserter/media-tab/media-tab.js +1 -0
  249. package/build/components/inserter/media-tab/media-tab.js.map +1 -1
  250. package/build/components/inserter/menu.js +1 -0
  251. package/build/components/inserter/menu.js.map +1 -1
  252. package/build/components/inserter/mobile-tab-navigation.js +1 -0
  253. package/build/components/inserter/mobile-tab-navigation.js.map +1 -1
  254. package/build/components/inserter/quick-inserter.js +2 -13
  255. package/build/components/inserter/quick-inserter.js.map +1 -1
  256. package/build/components/inserter/search-items.js +1 -0
  257. package/build/components/inserter/search-items.js.map +1 -1
  258. package/build/components/inserter/search-results.js +1 -0
  259. package/build/components/inserter/search-results.js.map +1 -1
  260. package/build/components/inserter/tabs.native.js +1 -0
  261. package/build/components/inserter/tabs.native.js.map +1 -1
  262. package/build/components/inserter/utils.native.js +1 -0
  263. package/build/components/inserter/utils.native.js.map +1 -1
  264. package/build/components/inspector-controls/block-support-tools-panel.js +1 -0
  265. package/build/components/inspector-controls/block-support-tools-panel.js.map +1 -1
  266. package/build/components/inspector-controls/fill.js +1 -0
  267. package/build/components/inspector-controls/fill.js.map +1 -1
  268. package/build/components/inspector-controls/slot.js +2 -13
  269. package/build/components/inspector-controls/slot.js.map +1 -1
  270. package/build/components/inspector-controls-tabs/index.js +1 -0
  271. package/build/components/inspector-controls-tabs/index.js.map +1 -1
  272. package/build/components/inspector-controls-tabs/position-controls-panel.js +1 -0
  273. package/build/components/inspector-controls-tabs/position-controls-panel.js.map +1 -1
  274. package/build/components/inspector-popover-header/index.js +1 -0
  275. package/build/components/inspector-popover-header/index.js.map +1 -1
  276. package/build/components/justify-content-control/ui.js +1 -0
  277. package/build/components/justify-content-control/ui.js.map +1 -1
  278. package/build/components/keyboard-shortcuts/index.js +2 -2
  279. package/build/components/keyboard-shortcuts/index.js.map +1 -1
  280. package/build/components/line-height-control/index.js +9 -0
  281. package/build/components/line-height-control/index.js.map +1 -1
  282. package/build/components/link-control/index.js +13 -1
  283. package/build/components/link-control/index.js.map +1 -1
  284. package/build/components/link-control/search-input.js +11 -1
  285. package/build/components/link-control/search-input.js.map +1 -1
  286. package/build/components/link-control/search-item.js +12 -1
  287. package/build/components/link-control/search-item.js.map +1 -1
  288. package/build/components/link-control/search-results.js +13 -1
  289. package/build/components/link-control/search-results.js.map +1 -1
  290. package/build/components/link-control/settings.js +1 -0
  291. package/build/components/link-control/settings.js.map +1 -1
  292. package/build/components/link-control/use-internal-value.js +1 -0
  293. package/build/components/link-control/use-internal-value.js.map +1 -1
  294. package/build/components/link-control/use-search-handler.js +1 -0
  295. package/build/components/link-control/use-search-handler.js.map +1 -1
  296. package/build/components/list-view/block-select-button.js +1 -0
  297. package/build/components/list-view/block-select-button.js.map +1 -1
  298. package/build/components/list-view/block.js +1 -0
  299. package/build/components/list-view/block.js.map +1 -1
  300. package/build/components/list-view/branch.js +1 -0
  301. package/build/components/list-view/branch.js.map +1 -1
  302. package/build/components/list-view/index.js +1 -0
  303. package/build/components/list-view/index.js.map +1 -1
  304. package/build/components/list-view/use-block-selection.js +1 -0
  305. package/build/components/list-view/use-block-selection.js.map +1 -1
  306. package/build/components/list-view/use-clipboard-handler.js +1 -0
  307. package/build/components/list-view/use-clipboard-handler.js.map +1 -1
  308. package/build/components/list-view/use-list-view-block-indexes.js +1 -0
  309. package/build/components/list-view/use-list-view-block-indexes.js.map +1 -1
  310. package/build/components/list-view/use-list-view-drop-zone.js +1 -0
  311. package/build/components/list-view/use-list-view-drop-zone.js.map +1 -1
  312. package/build/components/list-view/utils.js +1 -0
  313. package/build/components/list-view/utils.js.map +1 -1
  314. package/build/components/media-placeholder/index.js +3 -2
  315. package/build/components/media-placeholder/index.js.map +1 -1
  316. package/build/components/media-placeholder/index.native.js +1 -0
  317. package/build/components/media-placeholder/index.native.js.map +1 -1
  318. package/build/components/media-replace-flow/index.js +27 -26
  319. package/build/components/media-replace-flow/index.js.map +1 -1
  320. package/build/components/media-upload/index.native.js +1 -0
  321. package/build/components/media-upload/index.native.js.map +1 -1
  322. package/build/components/multi-selection-inspector/index.js +9 -25
  323. package/build/components/multi-selection-inspector/index.js.map +1 -1
  324. package/build/components/navigable-toolbar/index.js +1 -0
  325. package/build/components/navigable-toolbar/index.js.map +1 -1
  326. package/build/components/panel-color-settings/index.js +1 -0
  327. package/build/components/panel-color-settings/index.js.map +1 -1
  328. package/build/components/plain-text/index.js +34 -0
  329. package/build/components/plain-text/index.js.map +1 -1
  330. package/build/components/provider/index.js +61 -5
  331. package/build/components/provider/index.js.map +1 -1
  332. package/build/components/provider/use-block-sync.js +1 -0
  333. package/build/components/provider/use-block-sync.js.map +1 -1
  334. package/build/components/provider/use-media-upload-settings.js +28 -0
  335. package/build/components/provider/use-media-upload-settings.js.map +1 -0
  336. package/build/components/resolution-tool/index.js +3 -1
  337. package/build/components/resolution-tool/index.js.map +1 -1
  338. package/build/components/responsive-block-control/index.js +2 -1
  339. package/build/components/responsive-block-control/index.js.map +1 -1
  340. package/build/components/rich-text/embed-handler-picker.native.js +1 -0
  341. package/build/components/rich-text/embed-handler-picker.native.js.map +1 -1
  342. package/build/components/rich-text/event-listeners/before-input-rules.js +1 -0
  343. package/build/components/rich-text/event-listeners/before-input-rules.js.map +1 -1
  344. package/build/components/rich-text/event-listeners/delete.js +7 -1
  345. package/build/components/rich-text/event-listeners/delete.js.map +1 -1
  346. package/build/components/rich-text/event-listeners/index.js +1 -0
  347. package/build/components/rich-text/event-listeners/index.js.map +1 -1
  348. package/build/components/rich-text/event-listeners/input-rules.js +1 -0
  349. package/build/components/rich-text/event-listeners/input-rules.js.map +1 -1
  350. package/build/components/rich-text/event-listeners/paste-handler.js +1 -0
  351. package/build/components/rich-text/event-listeners/paste-handler.js.map +1 -1
  352. package/build/components/rich-text/file-paste-handler.native.js +1 -0
  353. package/build/components/rich-text/file-paste-handler.native.js.map +1 -1
  354. package/build/components/rich-text/format-edit.js +1 -0
  355. package/build/components/rich-text/format-edit.js.map +1 -1
  356. package/build/components/rich-text/format-toolbar/index.js +1 -0
  357. package/build/components/rich-text/format-toolbar/index.js.map +1 -1
  358. package/build/components/rich-text/index.js +3 -2
  359. package/build/components/rich-text/index.js.map +1 -1
  360. package/build/components/rich-text/index.native.js +1 -0
  361. package/build/components/rich-text/index.native.js.map +1 -1
  362. package/build/components/rich-text/multiline.js +1 -0
  363. package/build/components/rich-text/multiline.js.map +1 -1
  364. package/build/components/rich-text/native/format-edit.js +1 -0
  365. package/build/components/rich-text/native/format-edit.js.map +1 -1
  366. package/build/components/rich-text/native/get-format-colors.native.js +1 -0
  367. package/build/components/rich-text/native/get-format-colors.native.js.map +1 -1
  368. package/build/components/rich-text/native/index.native.js +1 -0
  369. package/build/components/rich-text/native/index.native.js.map +1 -1
  370. package/build/components/rich-text/native/toolbar-button-with-options.native.js +1 -0
  371. package/build/components/rich-text/native/toolbar-button-with-options.native.js.map +1 -1
  372. package/build/components/rich-text/native/use-format-types.js +1 -0
  373. package/build/components/rich-text/native/use-format-types.js.map +1 -1
  374. package/build/components/rich-text/use-format-types.js +1 -0
  375. package/build/components/rich-text/use-format-types.js.map +1 -1
  376. package/build/components/spacing-sizes-control/hooks/use-spacing-sizes.js +1 -0
  377. package/build/components/spacing-sizes-control/hooks/use-spacing-sizes.js.map +1 -1
  378. package/build/components/spacing-sizes-control/input-controls/axial.js +1 -0
  379. package/build/components/spacing-sizes-control/input-controls/axial.js.map +1 -1
  380. package/build/components/spacing-sizes-control/input-controls/separated.js +1 -0
  381. package/build/components/spacing-sizes-control/input-controls/separated.js.map +1 -1
  382. package/build/components/spacing-sizes-control/input-controls/single.js +1 -0
  383. package/build/components/spacing-sizes-control/input-controls/single.js.map +1 -1
  384. package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js +1 -0
  385. package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
  386. package/build/components/spacing-sizes-control/utils.js +1 -0
  387. package/build/components/spacing-sizes-control/utils.js.map +1 -1
  388. package/build/components/tabbed-sidebar/index.js +1 -0
  389. package/build/components/tabbed-sidebar/index.js.map +1 -1
  390. package/build/components/text-alignment-control/index.js +1 -0
  391. package/build/components/text-alignment-control/index.js.map +1 -1
  392. package/build/components/text-decoration-control/index.js +1 -0
  393. package/build/components/text-decoration-control/index.js.map +1 -1
  394. package/build/components/text-transform-control/index.js +1 -0
  395. package/build/components/text-transform-control/index.js.map +1 -1
  396. package/build/components/unsupported-block-details/index.native.js +1 -0
  397. package/build/components/unsupported-block-details/index.native.js.map +1 -1
  398. package/build/components/url-input/index.js +1 -0
  399. package/build/components/url-input/index.js.map +1 -1
  400. package/build/components/url-popover/image-url-input-ui.js +1 -0
  401. package/build/components/url-popover/image-url-input-ui.js.map +1 -1
  402. package/build/components/use-block-commands/index.js +1 -0
  403. package/build/components/use-block-commands/index.js.map +1 -1
  404. package/build/components/use-block-drop-zone/index.js +3 -1
  405. package/build/components/use-block-drop-zone/index.js.map +1 -1
  406. package/build/components/use-block-drop-zone/index.native.js +1 -0
  407. package/build/components/use-block-drop-zone/index.native.js.map +1 -1
  408. package/build/components/use-flash-editable-blocks/index.js +1 -0
  409. package/build/components/use-flash-editable-blocks/index.js.map +1 -1
  410. package/build/components/use-on-block-drop/index.js +1 -0
  411. package/build/components/use-on-block-drop/index.js.map +1 -1
  412. package/build/components/use-on-block-drop/index.native.js +1 -0
  413. package/build/components/use-on-block-drop/index.native.js.map +1 -1
  414. package/build/components/use-paste-styles/index.js +1 -0
  415. package/build/components/use-paste-styles/index.js.map +1 -1
  416. package/build/components/warning/index.js +3 -3
  417. package/build/components/warning/index.js.map +1 -1
  418. package/build/components/writing-flow/use-arrow-nav.js +1 -0
  419. package/build/components/writing-flow/use-arrow-nav.js.map +1 -1
  420. package/build/components/writing-flow/use-clipboard-handler.js +1 -0
  421. package/build/components/writing-flow/use-clipboard-handler.js.map +1 -1
  422. package/build/components/writing-flow/use-input.js +1 -0
  423. package/build/components/writing-flow/use-input.js.map +1 -1
  424. package/build/components/writing-flow/use-tab-nav.js +1 -0
  425. package/build/components/writing-flow/use-tab-nav.js.map +1 -1
  426. package/build/components/writing-flow/utils.js +1 -0
  427. package/build/components/writing-flow/utils.js.map +1 -1
  428. package/build/components/writing-mode-control/index.js +1 -0
  429. package/build/components/writing-mode-control/index.js.map +1 -1
  430. package/build/hooks/align.js +1 -0
  431. package/build/hooks/align.js.map +1 -1
  432. package/build/hooks/align.native.js +1 -0
  433. package/build/hooks/align.native.js.map +1 -1
  434. package/build/hooks/background.js +2 -0
  435. package/build/hooks/background.js.map +1 -1
  436. package/build/hooks/block-bindings.js +16 -14
  437. package/build/hooks/block-bindings.js.map +1 -1
  438. package/build/hooks/block-hooks.js +1 -0
  439. package/build/hooks/block-hooks.js.map +1 -1
  440. package/build/hooks/block-style-variation.js +1 -0
  441. package/build/hooks/block-style-variation.js.map +1 -1
  442. package/build/hooks/border.js +4 -3
  443. package/build/hooks/border.js.map +1 -1
  444. package/build/hooks/color.js +1 -1
  445. package/build/hooks/color.js.map +1 -1
  446. package/build/hooks/dimensions.js +2 -2
  447. package/build/hooks/dimensions.js.map +1 -1
  448. package/build/hooks/duotone.js +1 -0
  449. package/build/hooks/duotone.js.map +1 -1
  450. package/build/hooks/font-family.js +1 -1
  451. package/build/hooks/font-family.js.map +1 -1
  452. package/build/hooks/gap.js +2 -2
  453. package/build/hooks/gap.js.map +1 -1
  454. package/build/hooks/index.js +1 -1
  455. package/build/hooks/index.js.map +1 -1
  456. package/build/hooks/index.native.js +7 -0
  457. package/build/hooks/index.native.js.map +1 -1
  458. package/build/hooks/layout.js +1 -0
  459. package/build/hooks/layout.js.map +1 -1
  460. package/build/hooks/position.js +1 -0
  461. package/build/hooks/position.js.map +1 -1
  462. package/build/hooks/style.js +7 -6
  463. package/build/hooks/style.js.map +1 -1
  464. package/build/hooks/supports.js +8 -7
  465. package/build/hooks/supports.js.map +1 -1
  466. package/build/hooks/text-align.js +1 -0
  467. package/build/hooks/text-align.js.map +1 -1
  468. package/build/hooks/typography.js +7 -6
  469. package/build/hooks/typography.js.map +1 -1
  470. package/build/hooks/use-zoom-out.js +58 -14
  471. package/build/hooks/use-zoom-out.js.map +1 -1
  472. package/build/hooks/utils.js +2 -1
  473. package/build/hooks/utils.js.map +1 -1
  474. package/build/layouts/constrained.js +1 -0
  475. package/build/layouts/constrained.js.map +1 -1
  476. package/build/layouts/flex.js +1 -0
  477. package/build/layouts/flex.js.map +1 -1
  478. package/build/layouts/flow.js +1 -0
  479. package/build/layouts/flow.js.map +1 -1
  480. package/build/layouts/index.js +1 -0
  481. package/build/layouts/index.js.map +1 -1
  482. package/build/layouts/utils.js +1 -0
  483. package/build/layouts/utils.js.map +1 -1
  484. package/build/store/actions.js +1 -0
  485. package/build/store/actions.js.map +1 -1
  486. package/build/store/get-block-settings.js +1 -0
  487. package/build/store/get-block-settings.js.map +1 -1
  488. package/build/store/private-actions.js +2 -1
  489. package/build/store/private-actions.js.map +1 -1
  490. package/build/store/private-selectors.js +12 -1
  491. package/build/store/private-selectors.js.map +1 -1
  492. package/build/store/reducer.js +94 -12
  493. package/build/store/reducer.js.map +1 -1
  494. package/build/store/selectors.js +19 -23
  495. package/build/store/selectors.js.map +1 -1
  496. package/build/store/utils.js +1 -0
  497. package/build/store/utils.js.map +1 -1
  498. package/build/utils/block-bindings.js +96 -0
  499. package/build/utils/block-bindings.js.map +1 -1
  500. package/build/utils/get-editor-region.js +1 -0
  501. package/build/utils/get-editor-region.js.map +1 -1
  502. package/build/utils/get-font-styles-and-weights.js +1 -0
  503. package/build/utils/get-font-styles-and-weights.js.map +1 -1
  504. package/build/utils/math.js +1 -0
  505. package/build/utils/math.js.map +1 -1
  506. package/build/utils/object.js +1 -0
  507. package/build/utils/object.js.map +1 -1
  508. package/build/utils/selection.js +1 -0
  509. package/build/utils/selection.js.map +1 -1
  510. package/build/utils/transform-styles/index.js +1 -0
  511. package/build/utils/transform-styles/index.js.map +1 -1
  512. package/build-module/autocompleters/block.js +1 -0
  513. package/build-module/autocompleters/block.js.map +1 -1
  514. package/build-module/autocompleters/link.js +1 -0
  515. package/build-module/autocompleters/link.js.map +1 -1
  516. package/build-module/components/alignment-control/ui.js +1 -0
  517. package/build-module/components/alignment-control/ui.js.map +1 -1
  518. package/build-module/components/audio-player/index.native.js +2 -2
  519. package/build-module/components/audio-player/index.native.js.map +1 -1
  520. package/build-module/components/autocomplete/index.js +1 -0
  521. package/build-module/components/autocomplete/index.js.map +1 -1
  522. package/build-module/components/background-image-control/index.js +6 -1
  523. package/build-module/components/background-image-control/index.js.map +1 -1
  524. package/build-module/components/block-actions/index.js +1 -0
  525. package/build-module/components/block-actions/index.js.map +1 -1
  526. package/build-module/components/block-alignment-control/ui.js +1 -0
  527. package/build-module/components/block-alignment-control/ui.js.map +1 -1
  528. package/build-module/components/block-alignment-control/ui.native.js +1 -0
  529. package/build-module/components/block-alignment-control/ui.native.js.map +1 -1
  530. package/build-module/components/block-alignment-control/use-available-alignments.js +1 -0
  531. package/build-module/components/block-alignment-control/use-available-alignments.js.map +1 -1
  532. package/build-module/components/block-alignment-matrix-control/index.js +32 -0
  533. package/build-module/components/block-alignment-matrix-control/index.js.map +1 -1
  534. package/build-module/components/block-breadcrumb/index.js +1 -0
  535. package/build-module/components/block-breadcrumb/index.js.map +1 -1
  536. package/build-module/components/block-card/index.js +45 -8
  537. package/build-module/components/block-card/index.js.map +1 -1
  538. package/build-module/components/block-compare/index.js +1 -0
  539. package/build-module/components/block-compare/index.js.map +1 -1
  540. package/build-module/components/block-controls/fill.js +1 -0
  541. package/build-module/components/block-controls/fill.js.map +1 -1
  542. package/build-module/components/block-edit/edit.js +149 -11
  543. package/build-module/components/block-edit/edit.js.map +1 -1
  544. package/build-module/components/block-edit/edit.native.js +1 -0
  545. package/build-module/components/block-edit/edit.native.js.map +1 -1
  546. package/build-module/components/block-heading-level-dropdown/index.js +1 -0
  547. package/build-module/components/block-heading-level-dropdown/index.js.map +1 -1
  548. package/build-module/components/block-heading-level-dropdown/index.native.js +1 -0
  549. package/build-module/components/block-heading-level-dropdown/index.native.js.map +1 -1
  550. package/build-module/components/block-inspector/index.js +1 -0
  551. package/build-module/components/block-inspector/index.js.map +1 -1
  552. package/build-module/components/block-list/block-invalid-warning.js +1 -0
  553. package/build-module/components/block-list/block-invalid-warning.js.map +1 -1
  554. package/build-module/components/block-list/block-list-context.native.js +1 -0
  555. package/build-module/components/block-list/block-list-context.native.js.map +1 -1
  556. package/build-module/components/block-list/block.js +1 -0
  557. package/build-module/components/block-list/block.js.map +1 -1
  558. package/build-module/components/block-list/block.native.js +1 -0
  559. package/build-module/components/block-list/block.native.js.map +1 -1
  560. package/build-module/components/block-list/index.js +3 -3
  561. package/build-module/components/block-list/index.js.map +1 -1
  562. package/build-module/components/block-list/index.native.js +1 -0
  563. package/build-module/components/block-list/index.native.js.map +1 -1
  564. package/build-module/components/block-list/use-block-props/index.js +3 -4
  565. package/build-module/components/block-list/use-block-props/index.js.map +1 -1
  566. package/build-module/components/block-list/use-block-props/use-firefox-draggable-compatibility.js +60 -8
  567. package/build-module/components/block-list/use-block-props/use-firefox-draggable-compatibility.js.map +1 -1
  568. package/build-module/components/block-list/use-block-props/use-focus-first-element.js +1 -0
  569. package/build-module/components/block-list/use-block-props/use-focus-first-element.js.map +1 -1
  570. package/build-module/components/block-list/use-in-between-inserter.js +1 -0
  571. package/build-module/components/block-list/use-in-between-inserter.js.map +1 -1
  572. package/build-module/components/block-list/zoom-out-separator.js +20 -3
  573. package/build-module/components/block-list/zoom-out-separator.js.map +1 -1
  574. package/build-module/components/block-lock/modal.js +5 -4
  575. package/build-module/components/block-lock/modal.js.map +1 -1
  576. package/build-module/components/block-manager/category.js +1 -0
  577. package/build-module/components/block-manager/category.js.map +1 -1
  578. package/build-module/components/block-manager/checklist.js +1 -0
  579. package/build-module/components/block-manager/checklist.js.map +1 -1
  580. package/build-module/components/block-manager/index.js +1 -0
  581. package/build-module/components/block-manager/index.js.map +1 -1
  582. package/build-module/components/block-media-update-progress/index.native.js +1 -0
  583. package/build-module/components/block-media-update-progress/index.native.js.map +1 -1
  584. package/build-module/components/block-mover/index.native.js +1 -0
  585. package/build-module/components/block-mover/index.native.js.map +1 -1
  586. package/build-module/components/block-mover/mover-description.native.js +1 -0
  587. package/build-module/components/block-mover/mover-description.native.js.map +1 -1
  588. package/build-module/components/block-parent-selector/index.js +2 -15
  589. package/build-module/components/block-parent-selector/index.js.map +1 -1
  590. package/build-module/components/block-pattern-setup/index.js +1 -0
  591. package/build-module/components/block-pattern-setup/index.js.map +1 -1
  592. package/build-module/components/block-pattern-setup/use-patterns-setup.js +1 -0
  593. package/build-module/components/block-pattern-setup/use-patterns-setup.js.map +1 -1
  594. package/build-module/components/block-patterns-list/index.js +1 -0
  595. package/build-module/components/block-patterns-list/index.js.map +1 -1
  596. package/build-module/components/block-quick-navigation/index.js +1 -0
  597. package/build-module/components/block-quick-navigation/index.js.map +1 -1
  598. package/build-module/components/block-rename/rename-control.js +1 -0
  599. package/build-module/components/block-rename/rename-control.js.map +1 -1
  600. package/build-module/components/block-settings-menu/block-settings-dropdown.js +6 -8
  601. package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  602. package/build-module/components/block-styles/index.js +1 -0
  603. package/build-module/components/block-styles/index.js.map +1 -1
  604. package/build-module/components/block-styles/index.native.js +1 -0
  605. package/build-module/components/block-styles/index.native.js.map +1 -1
  606. package/build-module/components/block-styles/menu-items.js +1 -0
  607. package/build-module/components/block-styles/menu-items.js.map +1 -1
  608. package/build-module/components/block-styles/preview.native.js +1 -0
  609. package/build-module/components/block-styles/preview.native.js.map +1 -1
  610. package/build-module/components/block-styles/utils.js +3 -3
  611. package/build-module/components/block-styles/utils.js.map +1 -1
  612. package/build-module/components/block-switcher/block-transformations-menu.js +1 -0
  613. package/build-module/components/block-switcher/block-transformations-menu.js.map +1 -1
  614. package/build-module/components/block-switcher/block-transformations-menu.native.js +1 -0
  615. package/build-module/components/block-switcher/block-transformations-menu.native.js.map +1 -1
  616. package/build-module/components/block-switcher/block-variation-transformations.js +1 -0
  617. package/build-module/components/block-switcher/block-variation-transformations.js.map +1 -1
  618. package/build-module/components/block-switcher/index.js +1 -0
  619. package/build-module/components/block-switcher/index.js.map +1 -1
  620. package/build-module/components/block-switcher/pattern-transformations-menu.js +1 -0
  621. package/build-module/components/block-switcher/pattern-transformations-menu.js.map +1 -1
  622. package/build-module/components/block-switcher/use-transformed-patterns.js +1 -0
  623. package/build-module/components/block-switcher/use-transformed-patterns.js.map +1 -1
  624. package/build-module/components/block-switcher/utils.js +1 -0
  625. package/build-module/components/block-switcher/utils.js.map +1 -1
  626. package/build-module/components/block-toolbar/block-toolbar-menu.native.js +1 -0
  627. package/build-module/components/block-toolbar/block-toolbar-menu.native.js.map +1 -1
  628. package/build-module/components/block-toolbar/change-design.js +1 -0
  629. package/build-module/components/block-toolbar/change-design.js.map +1 -1
  630. package/build-module/components/block-toolbar/index.js +2 -1
  631. package/build-module/components/block-toolbar/index.js.map +1 -1
  632. package/build-module/components/block-tools/use-selected-block-tool-props.js +1 -0
  633. package/build-module/components/block-tools/use-selected-block-tool-props.js.map +1 -1
  634. package/build-module/components/block-tools/zoom-out-mode-inserters.js +19 -6
  635. package/build-module/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
  636. package/build-module/components/block-types-list/index.js +1 -0
  637. package/build-module/components/block-types-list/index.js.map +1 -1
  638. package/build-module/components/block-variation-picker/index.js +1 -0
  639. package/build-module/components/block-variation-picker/index.js.map +1 -1
  640. package/build-module/components/block-variation-picker/index.native.js +1 -0
  641. package/build-module/components/block-variation-picker/index.native.js.map +1 -1
  642. package/build-module/components/block-variation-transforms/index.js +1 -0
  643. package/build-module/components/block-variation-transforms/index.js.map +1 -1
  644. package/build-module/components/block-vertical-alignment-control/ui.js +1 -0
  645. package/build-module/components/block-vertical-alignment-control/ui.js.map +1 -1
  646. package/build-module/components/border-radius-control/index.js +1 -0
  647. package/build-module/components/border-radius-control/index.js.map +1 -1
  648. package/build-module/components/border-radius-control/input-controls.js +1 -0
  649. package/build-module/components/border-radius-control/input-controls.js.map +1 -1
  650. package/build-module/components/border-radius-control/utils.js +1 -0
  651. package/build-module/components/border-radius-control/utils.js.map +1 -1
  652. package/build-module/components/button-block-appender/index.js +2 -6
  653. package/build-module/components/button-block-appender/index.js.map +1 -1
  654. package/build-module/components/child-layout-control/index.js +7 -1
  655. package/build-module/components/child-layout-control/index.js.map +1 -1
  656. package/build-module/components/colors/utils.js +1 -0
  657. package/build-module/components/colors/utils.js.map +1 -1
  658. package/build-module/components/colors/with-colors.js +1 -0
  659. package/build-module/components/colors/with-colors.js.map +1 -1
  660. package/build-module/components/colors-gradients/dropdown.js +52 -11
  661. package/build-module/components/colors-gradients/dropdown.js.map +1 -1
  662. package/build-module/components/colors-gradients/panel-color-gradient-settings.js +1 -0
  663. package/build-module/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
  664. package/build-module/components/colors-gradients/panel-color-gradient-settings.native.js +1 -0
  665. package/build-module/components/colors-gradients/panel-color-gradient-settings.native.js.map +1 -1
  666. package/build-module/components/contrast-checker/index.native.js +2 -2
  667. package/build-module/components/contrast-checker/index.native.js.map +1 -1
  668. package/build-module/components/convert-to-group-buttons/toolbar.js +1 -0
  669. package/build-module/components/convert-to-group-buttons/toolbar.js.map +1 -1
  670. package/build-module/components/date-format-picker/index.js +8 -16
  671. package/build-module/components/date-format-picker/index.js.map +1 -1
  672. package/build-module/components/dimensions-tool/scale-tool.js +1 -0
  673. package/build-module/components/dimensions-tool/scale-tool.js.map +1 -1
  674. package/build-module/components/duotone/utils.js +1 -0
  675. package/build-module/components/duotone/utils.js.map +1 -1
  676. package/build-module/components/editor-styles/index.js +1 -0
  677. package/build-module/components/editor-styles/index.js.map +1 -1
  678. package/build-module/components/font-appearance-control/index.js +9 -0
  679. package/build-module/components/font-appearance-control/index.js.map +1 -1
  680. package/build-module/components/font-family/index.js +11 -1
  681. package/build-module/components/font-family/index.js.map +1 -1
  682. package/build-module/components/font-sizes/with-font-sizes.js +1 -0
  683. package/build-module/components/font-sizes/with-font-sizes.js.map +1 -1
  684. package/build-module/components/global-styles/border-panel.js +1 -0
  685. package/build-module/components/global-styles/border-panel.js.map +1 -1
  686. package/build-module/components/global-styles/color-panel.js +30 -10
  687. package/build-module/components/global-styles/color-panel.js.map +1 -1
  688. package/build-module/components/global-styles/color-panel.native.js +1 -0
  689. package/build-module/components/global-styles/color-panel.native.js.map +1 -1
  690. package/build-module/components/global-styles/dimensions-panel.js +1 -0
  691. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  692. package/build-module/components/global-styles/filters-panel.js +4 -3
  693. package/build-module/components/global-styles/filters-panel.js.map +1 -1
  694. package/build-module/components/global-styles/get-global-styles-changes.js +1 -0
  695. package/build-module/components/global-styles/get-global-styles-changes.js.map +1 -1
  696. package/build-module/components/global-styles/shadow-panel-components.js +1 -0
  697. package/build-module/components/global-styles/shadow-panel-components.js.map +1 -1
  698. package/build-module/components/global-styles/typography-utils.js +2 -1
  699. package/build-module/components/global-styles/typography-utils.js.map +1 -1
  700. package/build-module/components/global-styles/use-global-styles-context.native.js +1 -0
  701. package/build-module/components/global-styles/use-global-styles-context.native.js.map +1 -1
  702. package/build-module/components/global-styles/use-global-styles-output.js +2 -1
  703. package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
  704. package/build-module/components/global-styles/utils.js +1 -0
  705. package/build-module/components/global-styles/utils.js.map +1 -1
  706. package/build-module/components/grid/grid-visualizer.js +10 -0
  707. package/build-module/components/grid/grid-visualizer.js.map +1 -1
  708. package/build-module/components/grid/use-grid-layout-sync.js +1 -0
  709. package/build-module/components/grid/use-grid-layout-sync.js.map +1 -1
  710. package/build-module/components/grid/utils.js +13 -1
  711. package/build-module/components/grid/utils.js.map +1 -1
  712. package/build-module/components/iframe/get-compatibility-styles.js +1 -0
  713. package/build-module/components/iframe/get-compatibility-styles.js.map +1 -1
  714. package/build-module/components/iframe/index.js +1 -1
  715. package/build-module/components/iframe/index.js.map +1 -1
  716. package/build-module/components/image-editor/aspect-ratio-dropdown.js +1 -0
  717. package/build-module/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
  718. package/build-module/components/index.js +4 -4
  719. package/build-module/components/index.js.map +1 -1
  720. package/build-module/components/inner-blocks/use-block-context.js +1 -0
  721. package/build-module/components/inner-blocks/use-block-context.js.map +1 -1
  722. package/build-module/components/inner-blocks/use-inner-block-template-sync.js +12 -12
  723. package/build-module/components/inner-blocks/use-inner-block-template-sync.js.map +1 -1
  724. package/build-module/components/inserter/block-patterns-explorer/index.js +1 -1
  725. package/build-module/components/inserter/block-patterns-explorer/index.js.map +1 -1
  726. package/build-module/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js +1 -0
  727. package/build-module/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js.map +1 -1
  728. package/build-module/components/inserter/block-patterns-explorer/pattern-list.js +1 -0
  729. package/build-module/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
  730. package/build-module/components/inserter/block-patterns-tab/index.js +1 -1
  731. package/build-module/components/inserter/block-patterns-tab/index.js.map +1 -1
  732. package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js +5 -4
  733. package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
  734. package/build-module/components/inserter/block-patterns-tab/patterns-filter.js +2 -2
  735. package/build-module/components/inserter/block-patterns-tab/patterns-filter.js.map +1 -1
  736. package/build-module/components/inserter/block-patterns-tab/use-pattern-categories.js +1 -0
  737. package/build-module/components/inserter/block-patterns-tab/use-pattern-categories.js.map +1 -1
  738. package/build-module/components/inserter/block-types-tab.js +2 -1
  739. package/build-module/components/inserter/block-types-tab.js.map +1 -1
  740. package/build-module/components/inserter/block-types-tab.native.js +1 -0
  741. package/build-module/components/inserter/block-types-tab.native.js.map +1 -1
  742. package/build-module/components/inserter/category-tabs/index.js +2 -2
  743. package/build-module/components/inserter/category-tabs/index.js.map +1 -1
  744. package/build-module/components/inserter/hooks/use-block-type-impressions.native.js +1 -0
  745. package/build-module/components/inserter/hooks/use-block-type-impressions.native.js.map +1 -1
  746. package/build-module/components/inserter/hooks/use-patterns-state.js +1 -0
  747. package/build-module/components/inserter/hooks/use-patterns-state.js.map +1 -1
  748. package/build-module/components/inserter/index.js +7 -15
  749. package/build-module/components/inserter/index.js.map +1 -1
  750. package/build-module/components/inserter/index.native.js +1 -0
  751. package/build-module/components/inserter/index.native.js.map +1 -1
  752. package/build-module/components/inserter/media-tab/hooks.js +1 -0
  753. package/build-module/components/inserter/media-tab/hooks.js.map +1 -1
  754. package/build-module/components/inserter/media-tab/media-list.js +1 -0
  755. package/build-module/components/inserter/media-tab/media-list.js.map +1 -1
  756. package/build-module/components/inserter/media-tab/media-tab.js +1 -0
  757. package/build-module/components/inserter/media-tab/media-tab.js.map +1 -1
  758. package/build-module/components/inserter/menu.js +1 -0
  759. package/build-module/components/inserter/menu.js.map +1 -1
  760. package/build-module/components/inserter/mobile-tab-navigation.js +1 -0
  761. package/build-module/components/inserter/mobile-tab-navigation.js.map +1 -1
  762. package/build-module/components/inserter/quick-inserter.js +2 -13
  763. package/build-module/components/inserter/quick-inserter.js.map +1 -1
  764. package/build-module/components/inserter/search-items.js +1 -0
  765. package/build-module/components/inserter/search-items.js.map +1 -1
  766. package/build-module/components/inserter/search-results.js +1 -0
  767. package/build-module/components/inserter/search-results.js.map +1 -1
  768. package/build-module/components/inserter/tabs.native.js +1 -0
  769. package/build-module/components/inserter/tabs.native.js.map +1 -1
  770. package/build-module/components/inserter/utils.native.js +1 -0
  771. package/build-module/components/inserter/utils.native.js.map +1 -1
  772. package/build-module/components/inspector-controls/block-support-tools-panel.js +1 -0
  773. package/build-module/components/inspector-controls/block-support-tools-panel.js.map +1 -1
  774. package/build-module/components/inspector-controls/fill.js +1 -0
  775. package/build-module/components/inspector-controls/fill.js.map +1 -1
  776. package/build-module/components/inspector-controls/slot.js +3 -14
  777. package/build-module/components/inspector-controls/slot.js.map +1 -1
  778. package/build-module/components/inspector-controls-tabs/index.js +1 -0
  779. package/build-module/components/inspector-controls-tabs/index.js.map +1 -1
  780. package/build-module/components/inspector-controls-tabs/position-controls-panel.js +1 -0
  781. package/build-module/components/inspector-controls-tabs/position-controls-panel.js.map +1 -1
  782. package/build-module/components/inspector-popover-header/index.js +1 -0
  783. package/build-module/components/inspector-popover-header/index.js.map +1 -1
  784. package/build-module/components/justify-content-control/ui.js +1 -0
  785. package/build-module/components/justify-content-control/ui.js.map +1 -1
  786. package/build-module/components/keyboard-shortcuts/index.js +2 -2
  787. package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
  788. package/build-module/components/line-height-control/index.js +8 -0
  789. package/build-module/components/line-height-control/index.js.map +1 -1
  790. package/build-module/components/link-control/index.js +11 -0
  791. package/build-module/components/link-control/index.js.map +1 -1
  792. package/build-module/components/link-control/search-input.js +9 -0
  793. package/build-module/components/link-control/search-input.js.map +1 -1
  794. package/build-module/components/link-control/search-item.js +9 -0
  795. package/build-module/components/link-control/search-item.js.map +1 -1
  796. package/build-module/components/link-control/search-results.js +12 -1
  797. package/build-module/components/link-control/search-results.js.map +1 -1
  798. package/build-module/components/link-control/settings.js +1 -0
  799. package/build-module/components/link-control/settings.js.map +1 -1
  800. package/build-module/components/link-control/use-internal-value.js +1 -0
  801. package/build-module/components/link-control/use-internal-value.js.map +1 -1
  802. package/build-module/components/link-control/use-search-handler.js +1 -0
  803. package/build-module/components/link-control/use-search-handler.js.map +1 -1
  804. package/build-module/components/list-view/block-select-button.js +1 -0
  805. package/build-module/components/list-view/block-select-button.js.map +1 -1
  806. package/build-module/components/list-view/block.js +1 -0
  807. package/build-module/components/list-view/block.js.map +1 -1
  808. package/build-module/components/list-view/branch.js +1 -0
  809. package/build-module/components/list-view/branch.js.map +1 -1
  810. package/build-module/components/list-view/index.js +1 -0
  811. package/build-module/components/list-view/index.js.map +1 -1
  812. package/build-module/components/list-view/use-block-selection.js +1 -0
  813. package/build-module/components/list-view/use-block-selection.js.map +1 -1
  814. package/build-module/components/list-view/use-clipboard-handler.js +1 -0
  815. package/build-module/components/list-view/use-clipboard-handler.js.map +1 -1
  816. package/build-module/components/list-view/use-list-view-block-indexes.js +1 -0
  817. package/build-module/components/list-view/use-list-view-block-indexes.js.map +1 -1
  818. package/build-module/components/list-view/use-list-view-drop-zone.js +1 -0
  819. package/build-module/components/list-view/use-list-view-drop-zone.js.map +1 -1
  820. package/build-module/components/list-view/utils.js +1 -0
  821. package/build-module/components/list-view/utils.js.map +1 -1
  822. package/build-module/components/media-placeholder/index.js +4 -3
  823. package/build-module/components/media-placeholder/index.js.map +1 -1
  824. package/build-module/components/media-placeholder/index.native.js +1 -0
  825. package/build-module/components/media-placeholder/index.native.js.map +1 -1
  826. package/build-module/components/media-replace-flow/index.js +29 -28
  827. package/build-module/components/media-replace-flow/index.js.map +1 -1
  828. package/build-module/components/media-upload/index.native.js +1 -0
  829. package/build-module/components/media-upload/index.native.js.map +1 -1
  830. package/build-module/components/multi-selection-inspector/index.js +9 -25
  831. package/build-module/components/multi-selection-inspector/index.js.map +1 -1
  832. package/build-module/components/navigable-toolbar/index.js +1 -0
  833. package/build-module/components/navigable-toolbar/index.js.map +1 -1
  834. package/build-module/components/panel-color-settings/index.js +1 -0
  835. package/build-module/components/panel-color-settings/index.js.map +1 -1
  836. package/build-module/components/plain-text/index.js +34 -0
  837. package/build-module/components/plain-text/index.js.map +1 -1
  838. package/build-module/components/provider/index.js +62 -5
  839. package/build-module/components/provider/index.js.map +1 -1
  840. package/build-module/components/provider/use-block-sync.js +1 -0
  841. package/build-module/components/provider/use-block-sync.js.map +1 -1
  842. package/build-module/components/provider/use-media-upload-settings.js +22 -0
  843. package/build-module/components/provider/use-media-upload-settings.js.map +1 -0
  844. package/build-module/components/resolution-tool/index.js +3 -1
  845. package/build-module/components/resolution-tool/index.js.map +1 -1
  846. package/build-module/components/responsive-block-control/index.js +2 -1
  847. package/build-module/components/responsive-block-control/index.js.map +1 -1
  848. package/build-module/components/rich-text/embed-handler-picker.native.js +1 -0
  849. package/build-module/components/rich-text/embed-handler-picker.native.js.map +1 -1
  850. package/build-module/components/rich-text/event-listeners/before-input-rules.js +1 -0
  851. package/build-module/components/rich-text/event-listeners/before-input-rules.js.map +1 -1
  852. package/build-module/components/rich-text/event-listeners/delete.js +7 -1
  853. package/build-module/components/rich-text/event-listeners/delete.js.map +1 -1
  854. package/build-module/components/rich-text/event-listeners/index.js +1 -0
  855. package/build-module/components/rich-text/event-listeners/index.js.map +1 -1
  856. package/build-module/components/rich-text/event-listeners/input-rules.js +1 -0
  857. package/build-module/components/rich-text/event-listeners/input-rules.js.map +1 -1
  858. package/build-module/components/rich-text/event-listeners/paste-handler.js +1 -0
  859. package/build-module/components/rich-text/event-listeners/paste-handler.js.map +1 -1
  860. package/build-module/components/rich-text/file-paste-handler.native.js +1 -0
  861. package/build-module/components/rich-text/file-paste-handler.native.js.map +1 -1
  862. package/build-module/components/rich-text/format-edit.js +1 -0
  863. package/build-module/components/rich-text/format-edit.js.map +1 -1
  864. package/build-module/components/rich-text/format-toolbar/index.js +1 -0
  865. package/build-module/components/rich-text/format-toolbar/index.js.map +1 -1
  866. package/build-module/components/rich-text/index.js +2 -1
  867. package/build-module/components/rich-text/index.js.map +1 -1
  868. package/build-module/components/rich-text/index.native.js +1 -0
  869. package/build-module/components/rich-text/index.native.js.map +1 -1
  870. package/build-module/components/rich-text/multiline.js +1 -0
  871. package/build-module/components/rich-text/multiline.js.map +1 -1
  872. package/build-module/components/rich-text/native/format-edit.js +1 -0
  873. package/build-module/components/rich-text/native/format-edit.js.map +1 -1
  874. package/build-module/components/rich-text/native/get-format-colors.native.js +1 -0
  875. package/build-module/components/rich-text/native/get-format-colors.native.js.map +1 -1
  876. package/build-module/components/rich-text/native/index.native.js +1 -0
  877. package/build-module/components/rich-text/native/index.native.js.map +1 -1
  878. package/build-module/components/rich-text/native/toolbar-button-with-options.native.js +1 -0
  879. package/build-module/components/rich-text/native/toolbar-button-with-options.native.js.map +1 -1
  880. package/build-module/components/rich-text/native/use-format-types.js +1 -0
  881. package/build-module/components/rich-text/native/use-format-types.js.map +1 -1
  882. package/build-module/components/rich-text/use-format-types.js +1 -0
  883. package/build-module/components/rich-text/use-format-types.js.map +1 -1
  884. package/build-module/components/spacing-sizes-control/hooks/use-spacing-sizes.js +1 -0
  885. package/build-module/components/spacing-sizes-control/hooks/use-spacing-sizes.js.map +1 -1
  886. package/build-module/components/spacing-sizes-control/input-controls/axial.js +1 -0
  887. package/build-module/components/spacing-sizes-control/input-controls/axial.js.map +1 -1
  888. package/build-module/components/spacing-sizes-control/input-controls/separated.js +1 -0
  889. package/build-module/components/spacing-sizes-control/input-controls/separated.js.map +1 -1
  890. package/build-module/components/spacing-sizes-control/input-controls/single.js +1 -0
  891. package/build-module/components/spacing-sizes-control/input-controls/single.js.map +1 -1
  892. package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js +1 -0
  893. package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
  894. package/build-module/components/spacing-sizes-control/utils.js +1 -0
  895. package/build-module/components/spacing-sizes-control/utils.js.map +1 -1
  896. package/build-module/components/tabbed-sidebar/index.js +1 -0
  897. package/build-module/components/tabbed-sidebar/index.js.map +1 -1
  898. package/build-module/components/text-alignment-control/index.js +1 -0
  899. package/build-module/components/text-alignment-control/index.js.map +1 -1
  900. package/build-module/components/text-decoration-control/index.js +1 -0
  901. package/build-module/components/text-decoration-control/index.js.map +1 -1
  902. package/build-module/components/text-transform-control/index.js +1 -0
  903. package/build-module/components/text-transform-control/index.js.map +1 -1
  904. package/build-module/components/unsupported-block-details/index.native.js +1 -0
  905. package/build-module/components/unsupported-block-details/index.native.js.map +1 -1
  906. package/build-module/components/url-input/index.js +1 -0
  907. package/build-module/components/url-input/index.js.map +1 -1
  908. package/build-module/components/url-popover/image-url-input-ui.js +1 -0
  909. package/build-module/components/url-popover/image-url-input-ui.js.map +1 -1
  910. package/build-module/components/use-block-commands/index.js +1 -0
  911. package/build-module/components/use-block-commands/index.js.map +1 -1
  912. package/build-module/components/use-block-drop-zone/index.js +3 -1
  913. package/build-module/components/use-block-drop-zone/index.js.map +1 -1
  914. package/build-module/components/use-block-drop-zone/index.native.js +1 -0
  915. package/build-module/components/use-block-drop-zone/index.native.js.map +1 -1
  916. package/build-module/components/use-flash-editable-blocks/index.js +1 -0
  917. package/build-module/components/use-flash-editable-blocks/index.js.map +1 -1
  918. package/build-module/components/use-on-block-drop/index.js +1 -0
  919. package/build-module/components/use-on-block-drop/index.js.map +1 -1
  920. package/build-module/components/use-on-block-drop/index.native.js +1 -0
  921. package/build-module/components/use-on-block-drop/index.native.js.map +1 -1
  922. package/build-module/components/use-paste-styles/index.js +1 -0
  923. package/build-module/components/use-paste-styles/index.js.map +1 -1
  924. package/build-module/components/warning/index.js +3 -3
  925. package/build-module/components/warning/index.js.map +1 -1
  926. package/build-module/components/writing-flow/use-arrow-nav.js +1 -0
  927. package/build-module/components/writing-flow/use-arrow-nav.js.map +1 -1
  928. package/build-module/components/writing-flow/use-clipboard-handler.js +1 -0
  929. package/build-module/components/writing-flow/use-clipboard-handler.js.map +1 -1
  930. package/build-module/components/writing-flow/use-input.js +1 -0
  931. package/build-module/components/writing-flow/use-input.js.map +1 -1
  932. package/build-module/components/writing-flow/use-tab-nav.js +1 -0
  933. package/build-module/components/writing-flow/use-tab-nav.js.map +1 -1
  934. package/build-module/components/writing-flow/utils.js +1 -0
  935. package/build-module/components/writing-flow/utils.js.map +1 -1
  936. package/build-module/components/writing-mode-control/index.js +1 -0
  937. package/build-module/components/writing-mode-control/index.js.map +1 -1
  938. package/build-module/hooks/align.js +1 -0
  939. package/build-module/hooks/align.js.map +1 -1
  940. package/build-module/hooks/align.native.js +1 -0
  941. package/build-module/hooks/align.native.js.map +1 -1
  942. package/build-module/hooks/background.js +2 -0
  943. package/build-module/hooks/background.js.map +1 -1
  944. package/build-module/hooks/block-bindings.js +14 -12
  945. package/build-module/hooks/block-bindings.js.map +1 -1
  946. package/build-module/hooks/block-hooks.js +1 -0
  947. package/build-module/hooks/block-hooks.js.map +1 -1
  948. package/build-module/hooks/block-style-variation.js +1 -0
  949. package/build-module/hooks/block-style-variation.js.map +1 -1
  950. package/build-module/hooks/border.js +4 -3
  951. package/build-module/hooks/border.js.map +1 -1
  952. package/build-module/hooks/color.js +1 -1
  953. package/build-module/hooks/color.js.map +1 -1
  954. package/build-module/hooks/dimensions.js +2 -2
  955. package/build-module/hooks/dimensions.js.map +1 -1
  956. package/build-module/hooks/duotone.js +1 -0
  957. package/build-module/hooks/duotone.js.map +1 -1
  958. package/build-module/hooks/font-family.js +1 -1
  959. package/build-module/hooks/font-family.js.map +1 -1
  960. package/build-module/hooks/gap.js +2 -2
  961. package/build-module/hooks/gap.js.map +1 -1
  962. package/build-module/hooks/index.js +1 -1
  963. package/build-module/hooks/index.js.map +1 -1
  964. package/build-module/hooks/index.native.js +1 -0
  965. package/build-module/hooks/index.native.js.map +1 -1
  966. package/build-module/hooks/layout.js +1 -0
  967. package/build-module/hooks/layout.js.map +1 -1
  968. package/build-module/hooks/position.js +1 -0
  969. package/build-module/hooks/position.js.map +1 -1
  970. package/build-module/hooks/style.js +7 -6
  971. package/build-module/hooks/style.js.map +1 -1
  972. package/build-module/hooks/supports.js +8 -7
  973. package/build-module/hooks/supports.js.map +1 -1
  974. package/build-module/hooks/text-align.js +1 -0
  975. package/build-module/hooks/text-align.js.map +1 -1
  976. package/build-module/hooks/typography.js +7 -6
  977. package/build-module/hooks/typography.js.map +1 -1
  978. package/build-module/hooks/use-zoom-out.js +58 -15
  979. package/build-module/hooks/use-zoom-out.js.map +1 -1
  980. package/build-module/hooks/utils.js +2 -1
  981. package/build-module/hooks/utils.js.map +1 -1
  982. package/build-module/layouts/constrained.js +1 -0
  983. package/build-module/layouts/constrained.js.map +1 -1
  984. package/build-module/layouts/flex.js +1 -0
  985. package/build-module/layouts/flex.js.map +1 -1
  986. package/build-module/layouts/flow.js +1 -0
  987. package/build-module/layouts/flow.js.map +1 -1
  988. package/build-module/layouts/index.js +1 -0
  989. package/build-module/layouts/index.js.map +1 -1
  990. package/build-module/layouts/utils.js +1 -0
  991. package/build-module/layouts/utils.js.map +1 -1
  992. package/build-module/store/actions.js +1 -0
  993. package/build-module/store/actions.js.map +1 -1
  994. package/build-module/store/get-block-settings.js +1 -0
  995. package/build-module/store/get-block-settings.js.map +1 -1
  996. package/build-module/store/private-actions.js +2 -1
  997. package/build-module/store/private-actions.js.map +1 -1
  998. package/build-module/store/private-selectors.js +12 -1
  999. package/build-module/store/private-selectors.js.map +1 -1
  1000. package/build-module/store/reducer.js +94 -12
  1001. package/build-module/store/reducer.js.map +1 -1
  1002. package/build-module/store/selectors.js +19 -23
  1003. package/build-module/store/selectors.js.map +1 -1
  1004. package/build-module/store/utils.js +1 -0
  1005. package/build-module/store/utils.js.map +1 -1
  1006. package/build-module/utils/block-bindings.js +91 -0
  1007. package/build-module/utils/block-bindings.js.map +1 -1
  1008. package/build-module/utils/get-editor-region.js +1 -0
  1009. package/build-module/utils/get-editor-region.js.map +1 -1
  1010. package/build-module/utils/get-font-styles-and-weights.js +1 -0
  1011. package/build-module/utils/get-font-styles-and-weights.js.map +1 -1
  1012. package/build-module/utils/math.js +1 -0
  1013. package/build-module/utils/math.js.map +1 -1
  1014. package/build-module/utils/object.js +1 -0
  1015. package/build-module/utils/object.js.map +1 -1
  1016. package/build-module/utils/selection.js +1 -0
  1017. package/build-module/utils/selection.js.map +1 -1
  1018. package/build-module/utils/transform-styles/index.js +1 -0
  1019. package/build-module/utils/transform-styles/index.js.map +1 -1
  1020. package/build-style/content-rtl.css +1 -1
  1021. package/build-style/content.css +1 -1
  1022. package/build-style/style-rtl.css +53 -57
  1023. package/build-style/style.css +53 -57
  1024. package/package.json +33 -33
  1025. package/src/components/alignment-control/stories/aliginment-toolbar.story.js +2 -2
  1026. package/src/components/alignment-control/stories/index.story.js +2 -2
  1027. package/src/components/audio-player/index.native.js +2 -2
  1028. package/src/components/background-image-control/index.js +4 -0
  1029. package/src/components/background-image-control/style.scss +4 -2
  1030. package/src/components/block-alignment-matrix-control/README.md +29 -6
  1031. package/src/components/block-alignment-matrix-control/index.js +31 -0
  1032. package/src/components/block-alignment-matrix-control/stories/index.story.js +78 -0
  1033. package/src/components/block-card/README.md +7 -0
  1034. package/src/components/block-card/index.js +41 -12
  1035. package/src/components/block-card/stories/index.story.js +79 -0
  1036. package/src/components/block-card/style.scss +9 -1
  1037. package/src/components/block-edit/edit.js +218 -11
  1038. package/src/components/block-heading-level-dropdown/stories/index.story.js +61 -0
  1039. package/src/components/block-list/index.js +2 -7
  1040. package/src/components/block-list/use-block-props/index.js +3 -5
  1041. package/src/components/block-list/use-block-props/use-firefox-draggable-compatibility.js +64 -6
  1042. package/src/components/block-list/zoom-out-separator.js +30 -0
  1043. package/src/components/block-lock/modal.js +4 -6
  1044. package/src/components/block-parent-selector/index.js +1 -19
  1045. package/src/components/block-patterns-list/stories/fixtures.js +1 -0
  1046. package/src/components/block-settings-menu/block-settings-dropdown.js +17 -20
  1047. package/src/components/block-styles/utils.js +3 -3
  1048. package/src/components/block-title/stories/index.story.js +76 -0
  1049. package/src/components/block-toolbar/index.js +1 -0
  1050. package/src/components/block-tools/style.scss +1 -0
  1051. package/src/components/block-tools/zoom-out-mode-inserters.js +21 -3
  1052. package/src/components/border-radius-control/README.md +59 -0
  1053. package/src/components/border-radius-control/stories/index.story.js +58 -0
  1054. package/src/components/button-block-appender/index.js +2 -7
  1055. package/src/components/child-layout-control/index.js +14 -0
  1056. package/src/components/colors-gradients/dropdown.js +57 -8
  1057. package/src/components/colors-gradients/style.scss +26 -0
  1058. package/src/components/contrast-checker/index.native.js +2 -2
  1059. package/src/components/contrast-checker/stories/index.story.js +117 -0
  1060. package/src/components/date-format-picker/README.md +6 -13
  1061. package/src/components/date-format-picker/index.js +10 -17
  1062. package/src/components/date-format-picker/stories/index.story.js +69 -0
  1063. package/src/components/date-format-picker/style.scss +3 -1
  1064. package/src/components/default-block-appender/content.scss +1 -0
  1065. package/src/components/dimensions-tool/stories/aspect-ratio-tool.story.js +3 -2
  1066. package/src/components/dimensions-tool/stories/index.story.js +3 -2
  1067. package/src/components/dimensions-tool/stories/scale-tool.story.js +3 -2
  1068. package/src/components/dimensions-tool/stories/width-height-tool.story.js +3 -2
  1069. package/src/components/font-appearance-control/index.js +15 -0
  1070. package/src/components/font-family/README.md +1 -0
  1071. package/src/components/font-family/index.js +17 -1
  1072. package/src/components/font-family/stories/index.story.js +1 -0
  1073. package/src/components/global-styles/color-panel.js +29 -7
  1074. package/src/components/global-styles/filters-panel.js +3 -6
  1075. package/src/components/global-styles/test/use-global-styles-output.js +1 -1
  1076. package/src/components/global-styles/typography-utils.js +1 -1
  1077. package/src/components/global-styles/use-global-styles-output.js +1 -1
  1078. package/src/components/grid/grid-visualizer.js +11 -0
  1079. package/src/components/grid/utils.js +19 -1
  1080. package/src/components/iframe/index.js +1 -1
  1081. package/src/components/index.js +7 -4
  1082. package/src/components/inner-blocks/use-inner-block-template-sync.js +17 -10
  1083. package/src/components/inserter/block-patterns-explorer/index.js +2 -3
  1084. package/src/components/inserter/block-patterns-tab/index.js +3 -1
  1085. package/src/components/inserter/block-patterns-tab/pattern-category-previews.js +4 -4
  1086. package/src/components/inserter/block-patterns-tab/patterns-filter.js +2 -2
  1087. package/src/components/inserter/block-types-tab.js +1 -1
  1088. package/src/components/inserter/category-tabs/index.js +3 -2
  1089. package/src/components/inserter/index.js +1 -13
  1090. package/src/components/inserter/menu.js +2 -0
  1091. package/src/components/inserter/quick-inserter.js +2 -25
  1092. package/src/components/inspector-controls/slot.js +3 -22
  1093. package/src/components/keyboard-shortcuts/index.js +2 -2
  1094. package/src/components/line-height-control/README.md +1 -0
  1095. package/src/components/line-height-control/index.js +12 -0
  1096. package/src/components/line-height-control/stories/index.story.js +1 -0
  1097. package/src/components/line-height-control/test/index.js +7 -1
  1098. package/src/components/link-control/index.js +10 -0
  1099. package/src/components/link-control/search-input.js +9 -0
  1100. package/src/components/link-control/search-item.js +9 -0
  1101. package/src/components/link-control/search-results.js +12 -1
  1102. package/src/components/list-view/style.scss +10 -5
  1103. package/src/components/media-placeholder/index.js +3 -3
  1104. package/src/components/media-replace-flow/README.md +7 -0
  1105. package/src/components/media-replace-flow/index.js +28 -36
  1106. package/src/components/media-replace-flow/style.scss +6 -6
  1107. package/src/components/multi-selection-inspector/index.js +17 -27
  1108. package/src/components/multi-selection-inspector/style.scss +0 -12
  1109. package/src/components/plain-text/README.md +2 -2
  1110. package/src/components/plain-text/index.js +34 -0
  1111. package/src/components/plain-text/stories/index.story.js +75 -0
  1112. package/src/components/provider/index.js +81 -4
  1113. package/src/components/provider/use-media-upload-settings.js +25 -0
  1114. package/src/components/resolution-tool/index.js +2 -0
  1115. package/src/components/resolution-tool/stories/index.story.js +37 -9
  1116. package/src/components/responsive-block-control/index.js +1 -1
  1117. package/src/components/rich-text/event-listeners/delete.js +6 -1
  1118. package/src/components/rich-text/index.js +1 -1
  1119. package/src/components/spacing-sizes-control/style.scss +0 -29
  1120. package/src/components/text-alignment-control/README.md +49 -0
  1121. package/src/components/text-alignment-control/stories/index.story.js +56 -18
  1122. package/src/components/text-decoration-control/README.md +0 -1
  1123. package/src/components/text-decoration-control/stories/index.story.js +51 -16
  1124. package/src/components/text-transform-control/README.md +3 -4
  1125. package/src/components/text-transform-control/stories/index.story.js +53 -16
  1126. package/src/components/use-block-drop-zone/index.js +8 -1
  1127. package/src/components/warning/index.js +3 -4
  1128. package/src/components/warning/stories/index.story.js +86 -0
  1129. package/src/components/warning/test/index.js +3 -1
  1130. package/src/components/writing-mode-control/stories/index.story.js +56 -0
  1131. package/src/hooks/background.js +6 -0
  1132. package/src/hooks/block-bindings.js +17 -18
  1133. package/src/hooks/border.js +9 -3
  1134. package/src/hooks/color.js +1 -1
  1135. package/src/hooks/dimensions.js +2 -2
  1136. package/src/hooks/font-family.js +1 -1
  1137. package/src/hooks/gap.js +2 -2
  1138. package/src/hooks/index.js +0 -1
  1139. package/src/hooks/index.native.js +1 -0
  1140. package/src/hooks/style.js +12 -6
  1141. package/src/hooks/supports.js +7 -7
  1142. package/src/hooks/test/font-size.js +15 -12
  1143. package/src/hooks/test/style.js +2 -1
  1144. package/src/hooks/typography.js +6 -6
  1145. package/src/hooks/use-zoom-out.js +56 -16
  1146. package/src/hooks/utils.js +1 -1
  1147. package/src/store/private-actions.js +1 -0
  1148. package/src/store/private-selectors.js +15 -5
  1149. package/src/store/reducer.js +112 -19
  1150. package/src/store/selectors.js +32 -32
  1151. package/src/store/test/private-selectors.js +53 -9
  1152. package/src/store/test/reducer.js +172 -166
  1153. package/src/store/test/selectors.js +24 -1
  1154. package/src/utils/block-bindings.js +95 -0
  1155. package/tsconfig.json +2 -5
  1156. package/tsconfig.tsbuildinfo +1 -1
  1157. package/build/hooks/use-bindings-attributes.js +0 -261
  1158. package/build/hooks/use-bindings-attributes.js.map +0 -1
  1159. package/build-module/hooks/use-bindings-attributes.js +0 -252
  1160. package/build-module/hooks/use-bindings-attributes.js.map +0 -1
  1161. package/src/hooks/use-bindings-attributes.js +0 -322
@@ -1 +1 @@
1
- {"version":3,"names":["useSelect","useDispatch","useRefEffect","ENTER","BACKSPACE","DELETE","createBlock","getDefaultBlockName","hasBlockSupport","getBlockTransforms","findTransform","store","blockEditorStore","useInput","__unstableIsFullySelected","getSelectedBlockClientIds","getSelectedBlockClientId","__unstableIsSelectionMergeable","hasMultiSelection","getBlockName","canInsertBlockType","getBlockRootClientId","getSelectionStart","getSelectionEnd","getBlockAttributes","replaceBlocks","__unstableSplitSelection","removeBlocks","__unstableDeleteSelection","__unstableExpandSelection","__unstableMarkAutomaticChange","node","onBeforeInput","event","contentEditable","preventDefault","onKeyDown","defaultPrevented","keyCode","shiftKey","clientId","blockName","selectionStart","selectionEnd","attributeKey","selectedAttributeValue","transforms","filter","type","transformation","item","regExp","test","transform","content","__deprecatedOnSplit","key","length","metaKey","ctrlKey","ownerDocument","defaultView","getSelection","removeAllRanges","onCompositionStart","addEventListener","removeEventListener"],"sources":["@wordpress/block-editor/src/components/writing-flow/use-input.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useRefEffect } from '@wordpress/compose';\nimport { ENTER, BACKSPACE, DELETE } from '@wordpress/keycodes';\nimport {\n\tcreateBlock,\n\tgetDefaultBlockName,\n\thasBlockSupport,\n\tgetBlockTransforms,\n\tfindTransform,\n} from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\n\n/**\n * Handles input for selections across blocks.\n */\nexport default function useInput() {\n\tconst {\n\t\t__unstableIsFullySelected,\n\t\tgetSelectedBlockClientIds,\n\t\tgetSelectedBlockClientId,\n\t\t__unstableIsSelectionMergeable,\n\t\thasMultiSelection,\n\t\tgetBlockName,\n\t\tcanInsertBlockType,\n\t\tgetBlockRootClientId,\n\t\tgetSelectionStart,\n\t\tgetSelectionEnd,\n\t\tgetBlockAttributes,\n\t} = useSelect( blockEditorStore );\n\tconst {\n\t\treplaceBlocks,\n\t\t__unstableSplitSelection,\n\t\tremoveBlocks,\n\t\t__unstableDeleteSelection,\n\t\t__unstableExpandSelection,\n\t\t__unstableMarkAutomaticChange,\n\t} = useDispatch( blockEditorStore );\n\n\treturn useRefEffect( ( node ) => {\n\t\tfunction onBeforeInput( event ) {\n\t\t\t// If writing flow is editable, NEVER allow the browser to alter the\n\t\t\t// DOM. This will cause React errors (and the DOM should only be\n\t\t\t// altered in a controlled fashion).\n\t\t\tif ( node.contentEditable === 'true' ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t}\n\n\t\tfunction onKeyDown( event ) {\n\t\t\tif ( event.defaultPrevented ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( ! hasMultiSelection() ) {\n\t\t\t\tif ( event.keyCode === ENTER ) {\n\t\t\t\t\tif ( event.shiftKey || __unstableIsFullySelected() ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst clientId = getSelectedBlockClientId();\n\t\t\t\t\tconst blockName = getBlockName( clientId );\n\t\t\t\t\tconst selectionStart = getSelectionStart();\n\t\t\t\t\tconst selectionEnd = getSelectionEnd();\n\n\t\t\t\t\tif (\n\t\t\t\t\t\tselectionStart.attributeKey ===\n\t\t\t\t\t\tselectionEnd.attributeKey\n\t\t\t\t\t) {\n\t\t\t\t\t\tconst selectedAttributeValue =\n\t\t\t\t\t\t\tgetBlockAttributes( clientId )[\n\t\t\t\t\t\t\t\tselectionStart.attributeKey\n\t\t\t\t\t\t\t];\n\t\t\t\t\t\tconst transforms = getBlockTransforms( 'from' ).filter(\n\t\t\t\t\t\t\t( { type } ) => type === 'enter'\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconst transformation = findTransform(\n\t\t\t\t\t\t\ttransforms,\n\t\t\t\t\t\t\t( item ) => {\n\t\t\t\t\t\t\t\treturn item.regExp.test(\n\t\t\t\t\t\t\t\t\tselectedAttributeValue\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tif ( transformation ) {\n\t\t\t\t\t\t\treplaceBlocks(\n\t\t\t\t\t\t\t\tclientId,\n\t\t\t\t\t\t\t\ttransformation.transform( {\n\t\t\t\t\t\t\t\t\tcontent: selectedAttributeValue,\n\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t__unstableMarkAutomaticChange();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (\n\t\t\t\t\t\t! hasBlockSupport( blockName, 'splitting', false ) &&\n\t\t\t\t\t\t! event.__deprecatedOnSplit\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Ensure template is not locked.\n\t\t\t\t\tif (\n\t\t\t\t\t\tcanInsertBlockType(\n\t\t\t\t\t\t\tblockName,\n\t\t\t\t\t\t\tgetBlockRootClientId( clientId )\n\t\t\t\t\t\t)\n\t\t\t\t\t) {\n\t\t\t\t\t\t__unstableSplitSelection();\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( event.keyCode === ENTER ) {\n\t\t\t\tnode.contentEditable = false;\n\t\t\t\tevent.preventDefault();\n\t\t\t\tif ( __unstableIsFullySelected() ) {\n\t\t\t\t\treplaceBlocks(\n\t\t\t\t\t\tgetSelectedBlockClientIds(),\n\t\t\t\t\t\tcreateBlock( getDefaultBlockName() )\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\t__unstableSplitSelection();\n\t\t\t\t}\n\t\t\t} else if (\n\t\t\t\tevent.keyCode === BACKSPACE ||\n\t\t\t\tevent.keyCode === DELETE\n\t\t\t) {\n\t\t\t\tnode.contentEditable = false;\n\t\t\t\tevent.preventDefault();\n\t\t\t\tif ( __unstableIsFullySelected() ) {\n\t\t\t\t\tremoveBlocks( getSelectedBlockClientIds() );\n\t\t\t\t} else if ( __unstableIsSelectionMergeable() ) {\n\t\t\t\t\t__unstableDeleteSelection( event.keyCode === DELETE );\n\t\t\t\t} else {\n\t\t\t\t\t__unstableExpandSelection();\n\t\t\t\t}\n\t\t\t} else if (\n\t\t\t\t// If key.length is longer than 1, it's a control key that doesn't\n\t\t\t\t// input anything.\n\t\t\t\tevent.key.length === 1 &&\n\t\t\t\t! ( event.metaKey || event.ctrlKey )\n\t\t\t) {\n\t\t\t\tnode.contentEditable = false;\n\t\t\t\tif ( __unstableIsSelectionMergeable() ) {\n\t\t\t\t\t__unstableDeleteSelection( event.keyCode === DELETE );\n\t\t\t\t} else {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t// Safari does not stop default behaviour with either\n\t\t\t\t\t// event.preventDefault() or node.contentEditable = false, so\n\t\t\t\t\t// remove the selection to stop browser manipulation.\n\t\t\t\t\tnode.ownerDocument.defaultView\n\t\t\t\t\t\t.getSelection()\n\t\t\t\t\t\t.removeAllRanges();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfunction onCompositionStart( event ) {\n\t\t\tif ( ! hasMultiSelection() ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tnode.contentEditable = false;\n\n\t\t\tif ( __unstableIsSelectionMergeable() ) {\n\t\t\t\t__unstableDeleteSelection();\n\t\t\t} else {\n\t\t\t\tevent.preventDefault();\n\t\t\t\t// Safari does not stop default behaviour with either\n\t\t\t\t// event.preventDefault() or node.contentEditable = false, so\n\t\t\t\t// remove the selection to stop browser manipulation.\n\t\t\t\tnode.ownerDocument.defaultView.getSelection().removeAllRanges();\n\t\t\t}\n\t\t}\n\n\t\tnode.addEventListener( 'beforeinput', onBeforeInput );\n\t\tnode.addEventListener( 'keydown', onKeyDown );\n\t\tnode.addEventListener( 'compositionstart', onCompositionStart );\n\t\treturn () => {\n\t\t\tnode.removeEventListener( 'beforeinput', onBeforeInput );\n\t\t\tnode.removeEventListener( 'keydown', onKeyDown );\n\t\t\tnode.removeEventListener( 'compositionstart', onCompositionStart );\n\t\t};\n\t}, [] );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,YAAY,QAAQ,oBAAoB;AACjD,SAASC,KAAK,EAAEC,SAAS,EAAEC,MAAM,QAAQ,qBAAqB;AAC9D,SACCC,WAAW,EACXC,mBAAmB,EACnBC,eAAe,EACfC,kBAAkB,EAClBC,aAAa,QACP,mBAAmB;;AAE1B;AACA;AACA;AACA,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,aAAa;;AAEvD;AACA;AACA;AACA,eAAe,SAASC,QAAQA,CAAA,EAAG;EAClC,MAAM;IACLC,yBAAyB;IACzBC,yBAAyB;IACzBC,wBAAwB;IACxBC,8BAA8B;IAC9BC,iBAAiB;IACjBC,YAAY;IACZC,kBAAkB;IAClBC,oBAAoB;IACpBC,iBAAiB;IACj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CAACmC,mBAAmB,CAAE,kBAAkB,EAAEF,kBAAmB,CAAC;IACnE,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;AACR","ignoreList":[]}
1
+ {"version":3,"names":["useSelect","useDispatch","useRefEffect","ENTER","BACKSPACE","DELETE","createBlock","getDefaultBlockName","hasBlockSupport","getBlockTransforms","findTransform","store","blockEditorStore","useInput","__unstableIsFullySelected","getSelectedBlockClientIds","getSelectedBlockClientId","__unstableIsSelectionMergeable","hasMultiSelection","getBlockName","canInsertBlockType","getBlockRootClientId","getSelectionStart","getSelectionEnd","getBlockAttributes","replaceBlocks","__unstableSplitSelection","removeBlocks","__unstableDeleteSelection","__unstableExpandSelection","__unstableMarkAutomaticChange","node","onBeforeInput","event","contentEditable","preventDefault","onKeyDown","defaultPrevented","keyCode","shiftKey","clientId","blockName","selectionStart","selectionEnd","attributeKey","selectedAttributeValue","transforms","filter","type","transformation","item","regExp","test","transform","content","__deprecatedOnSplit","key","length","metaKey","ctrlKey","ownerDocument","defaultView","getSelection","removeAllRanges","onCompositionStart","addEventListener","removeEventListener"],"sources":["@wordpress/block-editor/src/components/writing-flow/use-input.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useRefEffect } from '@wordpress/compose';\nimport { ENTER, BACKSPACE, DELETE } from '@wordpress/keycodes';\nimport {\n\tcreateBlock,\n\tgetDefaultBlockName,\n\thasBlockSupport,\n\tgetBlockTransforms,\n\tfindTransform,\n} from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\n\n/**\n * Handles input for selections across blocks.\n */\nexport default function useInput() {\n\tconst {\n\t\t__unstableIsFullySelected,\n\t\tgetSelectedBlockClientIds,\n\t\tgetSelectedBlockClientId,\n\t\t__unstableIsSelectionMergeable,\n\t\thasMultiSelection,\n\t\tgetBlockName,\n\t\tcanInsertBlockType,\n\t\tgetBlockRootClientId,\n\t\tgetSelectionStart,\n\t\tgetSelectionEnd,\n\t\tgetBlockAttributes,\n\t} = useSelect( blockEditorStore );\n\tconst {\n\t\treplaceBlocks,\n\t\t__unstableSplitSelection,\n\t\tremoveBlocks,\n\t\t__unstableDeleteSelection,\n\t\t__unstableExpandSelection,\n\t\t__unstableMarkAutomaticChange,\n\t} = useDispatch( blockEditorStore );\n\n\treturn useRefEffect( ( node ) => {\n\t\tfunction onBeforeInput( event ) {\n\t\t\t// If writing flow is editable, NEVER allow the browser to alter the\n\t\t\t// DOM. This will cause React errors (and the DOM should only be\n\t\t\t// altered in a controlled fashion).\n\t\t\tif ( node.contentEditable === 'true' ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t}\n\n\t\tfunction onKeyDown( event ) {\n\t\t\tif ( event.defaultPrevented ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( ! hasMultiSelection() ) {\n\t\t\t\tif ( event.keyCode === ENTER ) {\n\t\t\t\t\tif ( event.shiftKey || __unstableIsFullySelected() ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst clientId = getSelectedBlockClientId();\n\t\t\t\t\tconst blockName = getBlockName( clientId );\n\t\t\t\t\tconst selectionStart = getSelectionStart();\n\t\t\t\t\tconst selectionEnd = getSelectionEnd();\n\n\t\t\t\t\tif (\n\t\t\t\t\t\tselectionStart.attributeKey ===\n\t\t\t\t\t\tselectionEnd.attributeKey\n\t\t\t\t\t) {\n\t\t\t\t\t\tconst selectedAttributeValue =\n\t\t\t\t\t\t\tgetBlockAttributes( clientId )[\n\t\t\t\t\t\t\t\tselectionStart.attributeKey\n\t\t\t\t\t\t\t];\n\t\t\t\t\t\tconst transforms = getBlockTransforms( 'from' ).filter(\n\t\t\t\t\t\t\t( { type } ) => type === 'enter'\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconst transformation = findTransform(\n\t\t\t\t\t\t\ttransforms,\n\t\t\t\t\t\t\t( item ) => {\n\t\t\t\t\t\t\t\treturn item.regExp.test(\n\t\t\t\t\t\t\t\t\tselectedAttributeValue\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tif ( transformation ) {\n\t\t\t\t\t\t\treplaceBlocks(\n\t\t\t\t\t\t\t\tclientId,\n\t\t\t\t\t\t\t\ttransformation.transform( {\n\t\t\t\t\t\t\t\t\tcontent: selectedAttributeValue,\n\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t__unstableMarkAutomaticChange();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (\n\t\t\t\t\t\t! hasBlockSupport( blockName, 'splitting', false ) &&\n\t\t\t\t\t\t! event.__deprecatedOnSplit\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Ensure template is not locked.\n\t\t\t\t\tif (\n\t\t\t\t\t\tcanInsertBlockType(\n\t\t\t\t\t\t\tblockName,\n\t\t\t\t\t\t\tgetBlockRootClientId( clientId )\n\t\t\t\t\t\t)\n\t\t\t\t\t) {\n\t\t\t\t\t\t__unstableSplitSelection();\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( event.keyCode === ENTER ) {\n\t\t\t\tnode.contentEditable = false;\n\t\t\t\tevent.preventDefault();\n\t\t\t\tif ( __unstableIsFullySelected() ) {\n\t\t\t\t\treplaceBlocks(\n\t\t\t\t\t\tgetSelectedBlockClientIds(),\n\t\t\t\t\t\tcreateBlock( getDefaultBlockName() )\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\t__unstableSplitSelection();\n\t\t\t\t}\n\t\t\t} else if (\n\t\t\t\tevent.keyCode === BACKSPACE ||\n\t\t\t\tevent.keyCode === DELETE\n\t\t\t) {\n\t\t\t\tnode.contentEditable = false;\n\t\t\t\tevent.preventDefault();\n\t\t\t\tif ( __unstableIsFullySelected() ) {\n\t\t\t\t\tremoveBlocks( getSelectedBlockClientIds() );\n\t\t\t\t} else if ( __unstableIsSelectionMergeable() ) {\n\t\t\t\t\t__unstableDeleteSelection( event.keyCode === DELETE );\n\t\t\t\t} else {\n\t\t\t\t\t__unstableExpandSelection();\n\t\t\t\t}\n\t\t\t} else if (\n\t\t\t\t// If key.length is longer than 1, it's a control key that doesn't\n\t\t\t\t// input anything.\n\t\t\t\tevent.key.length === 1 &&\n\t\t\t\t! ( event.metaKey || event.ctrlKey )\n\t\t\t) {\n\t\t\t\tnode.contentEditable = false;\n\t\t\t\tif ( __unstableIsSelectionMergeable() ) {\n\t\t\t\t\t__unstableDeleteSelection( event.keyCode === DELETE );\n\t\t\t\t} else {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t// Safari does not stop default behaviour with either\n\t\t\t\t\t// event.preventDefault() or node.contentEditable = false, so\n\t\t\t\t\t// remove the selection to stop browser manipulation.\n\t\t\t\t\tnode.ownerDocument.defaultView\n\t\t\t\t\t\t.getSelection()\n\t\t\t\t\t\t.removeAllRanges();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfunction onCompositionStart( event ) {\n\t\t\tif ( ! hasMultiSelection() ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tnode.contentEditable = false;\n\n\t\t\tif ( __unstableIsSelectionMergeable() ) {\n\t\t\t\t__unstableDeleteSelection();\n\t\t\t} else {\n\t\t\t\tevent.preventDefault();\n\t\t\t\t// Safari does not stop default behaviour with either\n\t\t\t\t// event.preventDefault() or node.contentEditable = false, so\n\t\t\t\t// remove the selection to stop browser manipulation.\n\t\t\t\tnode.ownerDocument.defaultView.getSelection().removeAllRanges();\n\t\t\t}\n\t\t}\n\n\t\tnode.addEventListener( 'beforeinput', onBeforeInput );\n\t\tnode.addEventListener( 'keydown', onKeyDown );\n\t\tnode.addEventListener( 'compositionstart', onCompositionStart );\n\t\treturn () => {\n\t\t\tnode.removeEventListener( 'beforeinput', onBeforeInput );\n\t\t\tnode.removeEventListener( 'keydown', onKeyDown );\n\t\t\tnode.removeEventListener( 'compositionstart', onCompositionStart );\n\t\t};\n\t}, [] );\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,YAAY,QAAQ,oBAAoB;AACjD,SAASC,KAAK,EAAEC,SAAS,EAAEC,MAAM,QAAQ,qBAAqB;AAC9D,SACCC,WAAW,EACXC,mBAAmB,EACnBC,eAAe,EACfC,kBAAkB,EAClBC,aAAa,QACP,mBAAmB;;AAE1B;AACA;AACA;AACA,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,aAAa;;AAEvD;AACA;AACA;AACA,eAAe,SAASC,QAAQA,CAAA,EAAG;EAClC,MAAM;IACLC,yBAAyB;IACzBC,yBAAyB;IACzBC,wBAAwB;IACxBC,8BAA8B;IAC9BC,iBAAiB;IACjBC,YAAY;IACZC,kBAAkB;IAClBC,oBAAoB;IACpBC,iBAAiB;IACjBC,eAAe;IACfC;EACD,CAAC,GAAGxB,SAAS,CAAEY,gBAAiB,CAAC;EACjC,MAAM;IACLa,aAAa;IACbC,wBAAwB;IACxBC,YAAY;IACZC,yBAAyB;IACzBC,yBAAyB;IACzBC;EACD,CAAC,GAAG7B,WAAW,CAAEW,gBAAiB,CAAC;EAEnC,OAAOV,YAAY,CAAI6B,IAAI,IAAM;IAChC,SAASC,aAAaA,CAAEC,KAAK,EAAG;MAC/B;MACA;MACA;MACA,IAAKF,IAAI,CAACG,eAAe,KAAK,MAAM,EAAG;QACtCD,KAAK,CAACE,cAAc,CAAC,CAAC;MACvB;IACD;IAEA,SAASC,SAASA,CAAEH,KAAK,EAAG;MAC3B,IAAKA,KAAK,CAACI,gBAAgB,EAAG;QAC7B;MACD;MAEA,IAAK,CAAEnB,iBAAiB,CAAC,CAAC,EAAG;QAC5B,IAAKe,KAAK,CA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AG;MACpC,IAAK,CAAEf,iBAAiB,CAAC,CAAC,EAAG;QAC5B;MACD;MAEAa,IAAI,CAACG,eAAe,GAAG,KAAK;MAE5B,IAAKjB,8BAA8B,CAAC,CAAC,EAAG;QACvCW,yBAAyB,CAAC,CAAC;MAC5B,CAAC,MAAM;QACNK,KAAK,CAACE,cAAc,CAAC,CAAC;QACtB;QACA;QACA;QACAJ,IAAI,CAAC6B,aAAa,CAACC,WAAW,CAACC,YAAY,CAAC,CAAC,CAACC,eAAe,CAAC,CAAC;MAChE;IACD;IAEAhC,IAAI,CAACkC,gBAAgB,CAAE,aAAa,EAAEjC,aAAc,CAAC;IACrDD,IAAI,CAACkC,gBAAgB,CAAE,SAAS,EAAE7B,SAAU,CAAC;IAC7CL,IAAI,CAACkC,gBAAgB,CAAE,kBAAkB,EAAED,kBAAmB,CAAC;IAC/D,OAAO,MAAM;MACZjC,IAAI,CAACmC,mBAAmB,CAAE,aAAa,EAAElC,aAAc,CAAC;MACxDD,IAAI,CAACmC,mBAAmB,CAAE,SAAS,EAAE9B,SAAU,CAAC;MAChDL,IAAI,CAACmC,mBAAmB,CAAE,kBAAkB,EAAEF,kBAAmB,CAAC;IACnE,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;AACR","ignoreList":[]}
@@ -1,3 +1,4 @@
1
+ /* wp:polyfill */
1
2
  /**
2
3
  * WordPress dependencies
3
4
  */
@@ -1 +1 @@
1
- {"version":3,"names":["focus","isFormElement","TAB","useSelect","useDispatch","useRefEffect","useMergeRefs","useRef","store","blockEditorStore","isInSameBlock","isInsideRootBlock","unlock","jsx","_jsx","useTabNav","container","focusCaptureBeforeRef","focusCaptureAfterRef","hasMultiSelection","getSelectedBlockClientId","getBlockCount","getBlockOrder","getLastFocus","getSectionRootClientId","isZoomOut","setLastFocus","noCaptureRef","onFocusCapture","event","canvasElement","current","ownerDocument","target","defaultView","frameElement","querySelector","sectionRootClientId","sectionBlocks","length","isBefore","compareDocumentPosition","DOCUMENT_POSITION_FOLLOWING","tabbables","tabbable","find","next","before","ref","tabIndex","onFocus","after","node","onKeyDown","defaultPrevented","keyCode","isShift","shiftKey","direction","nextTabbable","currentBlock","closest","isElementPartOfSelectedBlock","preventScroll","onFocusOut","relatedTarget","activeElement","body","preventScrollOnTab","getAttribute","preventDefault","addEventListener","removeEventListener","mergedRefs"],"sources":["@wordpress/block-editor/src/components/writing-flow/use-tab-nav.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { focus, isFormElement } from '@wordpress/dom';\nimport { TAB } from '@wordpress/keycodes';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useRefEffect, useMergeRefs } from '@wordpress/compose';\nimport { useRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\nimport { isInSameBlock, isInsideRootBlock } from '../../utils/dom';\nimport { unlock } from '../../lock-unlock';\n\nexport default function useTabNav() {\n\tconst container = useRef();\n\tconst focusCaptureBeforeRef = useRef();\n\tconst focusCaptureAfterRef = useRef();\n\n\tconst {\n\t\thasMultiSelection,\n\t\tgetSelectedBlockClientId,\n\t\tgetBlockCount,\n\t\tgetBlockOrder,\n\t\tgetLastFocus,\n\t\tgetSectionRootClientId,\n\t\tisZoomOut,\n\t} = unlock( useSelect( blockEditorStore ) );\n\tconst { setLastFocus } = unlock( useDispatch( blockEditorStore ) );\n\n\t// Reference that holds the a flag for enabling or disabling\n\t// capturing on the focus capture elements.\n\tconst noCaptureRef = useRef();\n\n\tfunction onFocusCapture( event ) {\n\t\tconst canvasElement =\n\t\t\tcontainer.current.ownerDocument === event.target.ownerDocument\n\t\t\t\t? container.current\n\t\t\t\t: container.current.ownerDocument.defaultView.frameElement;\n\n\t\t// Do not capture incoming focus if set by us in WritingFlow.\n\t\tif ( noCaptureRef.current ) {\n\t\t\tnoCaptureRef.current = null;\n\t\t} else if ( hasMultiSelection() ) {\n\t\t\tcontainer.current.focus();\n\t\t} else if ( getSelectedBlockClientId() ) {\n\t\t\tif ( getLastFocus()?.current ) {\n\t\t\t\tgetLastFocus().current.focus();\n\t\t\t} else {\n\t\t\t\t// Handles when the last focus has not been set yet, or has been cleared by new blocks being added via the inserter.\n\t\t\t\tcontainer.current\n\t\t\t\t\t.querySelector(\n\t\t\t\t\t\t`[data-block=\"${ getSelectedBlockClientId() }\"]`\n\t\t\t\t\t)\n\t\t\t\t\t.focus();\n\t\t\t}\n\t\t}\n\t\t// In \"compose\" mode without a selected ID, we want to place focus on the section root when tabbing to the canvas.\n\t\telse if ( isZoomOut() ) {\n\t\t\tconst sectionRootClientId = getSectionRootClientId();\n\t\t\tconst sectionBlocks = getBlockOrder( sectionRootClientId );\n\n\t\t\t// If we have section within the section root, focus the first one.\n\t\t\tif ( sectionBlocks.length ) {\n\t\t\t\tcontainer.current\n\t\t\t\t\t.querySelector( `[data-block=\"${ sectionBlocks[ 0 ] }\"]` )\n\t\t\t\t\t.focus();\n\t\t\t}\n\t\t\t// If we don't have any section blocks, focus the section root.\n\t\t\telse if ( sectionRootClientId ) {\n\t\t\t\tcontainer.current\n\t\t\t\t\t.querySelector( `[data-block=\"${ sectionRootClientId }\"]` )\n\t\t\t\t\t.focus();\n\t\t\t} else {\n\t\t\t\t// If we don't have any section root, focus the canvas.\n\t\t\t\tcanvasElement.focus();\n\t\t\t}\n\t\t} else {\n\t\t\tconst isBefore =\n\t\t\t\t// eslint-disable-next-line no-bitwise\n\t\t\t\tevent.target.compareDocumentPosition( canvasElement ) &\n\t\t\t\tevent.target.DOCUMENT_POSITION_FOLLOWING;\n\t\t\tconst tabbables = focus.tabbable.find( container.current );\n\n\t\t\tif ( tabbables.length ) {\n\t\t\t\tconst next = isBefore\n\t\t\t\t\t? tabbables[ 0 ]\n\t\t\t\t\t: tabbables[ tabbables.length - 1 ];\n\t\t\t\tnext.focus();\n\t\t\t}\n\t\t}\n\t}\n\n\tconst before = (\n\t\t<div\n\t\t\tref={ focusCaptureBeforeRef }\n\t\t\ttabIndex=\"0\"\n\t\t\tonFocus={ onFocusCapture }\n\t\t/>\n\t);\n\n\tconst after = (\n\t\t<div\n\t\t\tref={ focusCaptureAfterRef }\n\t\t\ttabIndex=\"0\"\n\t\t\tonFocus={ onFocusCapture }\n\t\t/>\n\t);\n\n\tconst ref = useRefEffect( ( node ) => {\n\t\tfunction onKeyDown( event ) {\n\t\t\tif ( event.defaultPrevented ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// In Edit mode, Tab should focus the first tabbable element after\n\t\t\t// the content, which is normally the sidebar (with block controls)\n\t\t\t// and Shift+Tab should focus the first tabbable element before the\n\t\t\t// content, which is normally the block toolbar.\n\t\t\t// Arrow keys can be used, and Tab and arrow keys can be used in\n\t\t\t// Navigation mode (press Esc), to navigate through blocks.\n\t\t\tif ( event.keyCode !== TAB ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst isShift = event.shiftKey;\n\t\t\tconst direction = isShift ? 'findPrevious' : 'findNext';\n\t\t\tconst nextTabbable = focus.tabbable[ direction ]( event.target );\n\n\t\t\t// We want to constrain the tabbing to the block and its child blocks.\n\t\t\t// If the preceding form element is within a different block,\n\t\t\t// such as two sibling image blocks in the placeholder state,\n\t\t\t// we want shift + tab from the first form element to move to the image\n\t\t\t// block toolbar and not the previous image block's form element.\n\t\t\tconst currentBlock = event.target.closest( '[data-block]' );\n\t\t\tconst isElementPartOfSelectedBlock =\n\t\t\t\tcurrentBlock &&\n\t\t\t\tnextTabbable &&\n\t\t\t\t( isInSameBlock( currentBlock, nextTabbable ) ||\n\t\t\t\t\tisInsideRootBlock( currentBlock, nextTabbable ) );\n\n\t\t\t// Allow tabbing from the block wrapper to a form element,\n\t\t\t// and between form elements rendered in a block and its child blocks,\n\t\t\t// such as inside a placeholder. Form elements are generally\n\t\t\t// meant to be UI rather than part of the content. Ideally\n\t\t\t// these are not rendered in the content and perhaps in the\n\t\t\t// future they can be rendered in an iframe or shadow DOM.\n\t\t\tif (\n\t\t\t\tisFormElement( nextTabbable ) &&\n\t\t\t\tisElementPartOfSelectedBlock\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst next = isShift ? focusCaptureBeforeRef : focusCaptureAfterRef;\n\n\t\t\t// Disable focus capturing on the focus capture element, so it\n\t\t\t// doesn't refocus this block and so it allows default behaviour\n\t\t\t// (moving focus to the next tabbable element).\n\t\t\tnoCaptureRef.current = true;\n\n\t\t\t// Focusing the focus capture element, which is located above and\n\t\t\t// below the editor, should not scroll the page all the way up or\n\t\t\t// down.\n\t\t\tnext.current.focus( { preventScroll: true } );\n\t\t}\n\n\t\tfunction onFocusOut( event ) {\n\t\t\tsetLastFocus( { ...getLastFocus(), current: event.target } );\n\n\t\t\tconst { ownerDocument } = node;\n\n\t\t\t// If focus disappears due to there being no blocks, move focus to\n\t\t\t// the writing flow wrapper.\n\t\t\tif (\n\t\t\t\t! event.relatedTarget &&\n\t\t\t\townerDocument.activeElement === ownerDocument.body &&\n\t\t\t\tgetBlockCount() === 0\n\t\t\t) {\n\t\t\t\tnode.focus();\n\t\t\t}\n\t\t}\n\n\t\t// When tabbing back to an element in block list, this event handler prevents scrolling if the\n\t\t// focus capture divs (before/after) are outside of the viewport. (For example shift+tab back to a paragraph\n\t\t// when focus is on a sidebar element. This prevents the scrollable writing area from jumping either to the\n\t\t// top or bottom of the document.\n\t\t//\n\t\t// Note that it isn't possible to disable scrolling in the onFocus event. We need to intercept this\n\t\t// earlier in the keypress handler, and call focus( { preventScroll: true } ) instead.\n\t\t// https://developer.mozilla.org/en-US/docs/Web/API/HTMLOrForeignElement/focus#parameters\n\t\tfunction preventScrollOnTab( event ) {\n\t\t\tif ( event.keyCode !== TAB ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( event.target?.getAttribute( 'role' ) === 'region' ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( container.current === event.target ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst isShift = event.shiftKey;\n\t\t\tconst direction = isShift ? 'findPrevious' : 'findNext';\n\t\t\tconst target = focus.tabbable[ direction ]( event.target );\n\t\t\t// Only do something when the next tabbable is a focus capture div (before/after)\n\t\t\tif (\n\t\t\t\ttarget === focusCaptureBeforeRef.current ||\n\t\t\t\ttarget === focusCaptureAfterRef.current\n\t\t\t) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\ttarget.focus( { preventScroll: true } );\n\t\t\t}\n\t\t}\n\n\t\tconst { ownerDocument } = node;\n\t\tconst { defaultView } = ownerDocument;\n\t\tdefaultView.addEventListener( 'keydown', preventScrollOnTab );\n\t\tnode.addEventListener( 'keydown', onKeyDown );\n\t\tnode.addEventListener( 'focusout', onFocusOut );\n\t\treturn () => {\n\t\t\tdefaultView.removeEventListener( 'keydown', preventScrollOnTab );\n\t\t\tnode.removeEventListener( 'keydown', onKeyDown );\n\t\t\tnode.removeEventListener( 'focusout', onFocusOut );\n\t\t};\n\t}, [] );\n\n\tconst mergedRefs = useMergeRefs( [ container, ref ] );\n\n\treturn [ before, mergedRefs, after ];\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,KAAK,EAAEC,aAAa,QAAQ,gBAAgB;AACrD,SAASC,GAAG,QAAQ,qBAAqB;AACzC,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,YAAY,EAAEC,YAAY,QAAQ,oBAAoB;AAC/D,SAASC,MAAM,QAAQ,oBAAoB;;AAE3C;AACA;AACA;AACA,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,aAAa;AACvD,SAASC,aAAa,EAAEC,iBAAiB,QAAQ,iBAAiB;AAClE,SAASC,MAAM,QAAQ,mBAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE3C,eAAe,SAASC,SAASA,CAAA,EAAG;EACnC,MAAMC,SAAS,GAAGT,MAAM,CAAC,CAAC;EAC1B,MAAMU,qBAAqB,GAAGV,MAAM,CAAC,CAAC;EACtC,MAAMW,oBAAoB,GAAGX,MAAM,CAAC,CAAC;E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U,EAAER,UAAW,CAAC;IACnD,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,MAAMS,UAAU,GAAGnE,YAAY,CAAE,CAAEU,SAAS,EAAEgC,GAAG,CAAG,CAAC;EAErD,OAAO,CAAED,MAAM,EAAE0B,UAAU,EAAEtB,KAAK,CAAE;AACrC","ignoreList":[]}
1
+ {"version":3,"names":["focus","isFormElement","TAB","useSelect","useDispatch","useRefEffect","useMergeRefs","useRef","store","blockEditorStore","isInSameBlock","isInsideRootBlock","unlock","jsx","_jsx","useTabNav","container","focusCaptureBeforeRef","focusCaptureAfterRef","hasMultiSelection","getSelectedBlockClientId","getBlockCount","getBlockOrder","getLastFocus","getSectionRootClientId","isZoomOut","setLastFocus","noCaptureRef","onFocusCapture","event","canvasElement","current","ownerDocument","target","defaultView","frameElement","querySelector","sectionRootClientId","sectionBlocks","length","isBefore","compareDocumentPosition","DOCUMENT_POSITION_FOLLOWING","tabbables","tabbable","find","next","before","ref","tabIndex","onFocus","after","node","onKeyDown","defaultPrevented","keyCode","isShift","shiftKey","direction","nextTabbable","currentBlock","closest","isElementPartOfSelectedBlock","preventScroll","onFocusOut","relatedTarget","activeElement","body","preventScrollOnTab","getAttribute","preventDefault","addEventListener","removeEventListener","mergedRefs"],"sources":["@wordpress/block-editor/src/components/writing-flow/use-tab-nav.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { focus, isFormElement } from '@wordpress/dom';\nimport { TAB } from '@wordpress/keycodes';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useRefEffect, useMergeRefs } from '@wordpress/compose';\nimport { useRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\nimport { isInSameBlock, isInsideRootBlock } from '../../utils/dom';\nimport { unlock } from '../../lock-unlock';\n\nexport default function useTabNav() {\n\tconst container = useRef();\n\tconst focusCaptureBeforeRef = useRef();\n\tconst focusCaptureAfterRef = useRef();\n\n\tconst {\n\t\thasMultiSelection,\n\t\tgetSelectedBlockClientId,\n\t\tgetBlockCount,\n\t\tgetBlockOrder,\n\t\tgetLastFocus,\n\t\tgetSectionRootClientId,\n\t\tisZoomOut,\n\t} = unlock( useSelect( blockEditorStore ) );\n\tconst { setLastFocus } = unlock( useDispatch( blockEditorStore ) );\n\n\t// Reference that holds the a flag for enabling or disabling\n\t// capturing on the focus capture elements.\n\tconst noCaptureRef = useRef();\n\n\tfunction onFocusCapture( event ) {\n\t\tconst canvasElement =\n\t\t\tcontainer.current.ownerDocument === event.target.ownerDocument\n\t\t\t\t? container.current\n\t\t\t\t: container.current.ownerDocument.defaultView.frameElement;\n\n\t\t// Do not capture incoming focus if set by us in WritingFlow.\n\t\tif ( noCaptureRef.current ) {\n\t\t\tnoCaptureRef.current = null;\n\t\t} else if ( hasMultiSelection() ) {\n\t\t\tcontainer.current.focus();\n\t\t} else if ( getSelectedBlockClientId() ) {\n\t\t\tif ( getLastFocus()?.current ) {\n\t\t\t\tgetLastFocus().current.focus();\n\t\t\t} else {\n\t\t\t\t// Handles when the last focus has not been set yet, or has been cleared by new blocks being added via the inserter.\n\t\t\t\tcontainer.current\n\t\t\t\t\t.querySelector(\n\t\t\t\t\t\t`[data-block=\"${ getSelectedBlockClientId() }\"]`\n\t\t\t\t\t)\n\t\t\t\t\t.focus();\n\t\t\t}\n\t\t}\n\t\t// In \"compose\" mode without a selected ID, we want to place focus on the section root when tabbing to the canvas.\n\t\telse if ( isZoomOut() ) {\n\t\t\tconst sectionRootClientId = getSectionRootClientId();\n\t\t\tconst sectionBlocks = getBlockOrder( sectionRootClientId );\n\n\t\t\t// If we have section within the section root, focus the first one.\n\t\t\tif ( sectionBlocks.length ) {\n\t\t\t\tcontainer.current\n\t\t\t\t\t.querySelector( `[data-block=\"${ sectionBlocks[ 0 ] }\"]` )\n\t\t\t\t\t.focus();\n\t\t\t}\n\t\t\t// If we don't have any section blocks, focus the section root.\n\t\t\telse if ( sectionRootClientId ) {\n\t\t\t\tcontainer.current\n\t\t\t\t\t.querySelector( `[data-block=\"${ sectionRootClientId }\"]` )\n\t\t\t\t\t.focus();\n\t\t\t} else {\n\t\t\t\t// If we don't have any section root, focus the canvas.\n\t\t\t\tcanvasElement.focus();\n\t\t\t}\n\t\t} else {\n\t\t\tconst isBefore =\n\t\t\t\t// eslint-disable-next-line no-bitwise\n\t\t\t\tevent.target.compareDocumentPosition( canvasElement ) &\n\t\t\t\tevent.target.DOCUMENT_POSITION_FOLLOWING;\n\t\t\tconst tabbables = focus.tabbable.find( container.current );\n\n\t\t\tif ( tabbables.length ) {\n\t\t\t\tconst next = isBefore\n\t\t\t\t\t? tabbables[ 0 ]\n\t\t\t\t\t: tabbables[ tabbables.length - 1 ];\n\t\t\t\tnext.focus();\n\t\t\t}\n\t\t}\n\t}\n\n\tconst before = (\n\t\t<div\n\t\t\tref={ focusCaptureBeforeRef }\n\t\t\ttabIndex=\"0\"\n\t\t\tonFocus={ onFocusCapture }\n\t\t/>\n\t);\n\n\tconst after = (\n\t\t<div\n\t\t\tref={ focusCaptureAfterRef }\n\t\t\ttabIndex=\"0\"\n\t\t\tonFocus={ onFocusCapture }\n\t\t/>\n\t);\n\n\tconst ref = useRefEffect( ( node ) => {\n\t\tfunction onKeyDown( event ) {\n\t\t\tif ( event.defaultPrevented ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// In Edit mode, Tab should focus the first tabbable element after\n\t\t\t// the content, which is normally the sidebar (with block controls)\n\t\t\t// and Shift+Tab should focus the first tabbable element before the\n\t\t\t// content, which is normally the block toolbar.\n\t\t\t// Arrow keys can be used, and Tab and arrow keys can be used in\n\t\t\t// Navigation mode (press Esc), to navigate through blocks.\n\t\t\tif ( event.keyCode !== TAB ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst isShift = event.shiftKey;\n\t\t\tconst direction = isShift ? 'findPrevious' : 'findNext';\n\t\t\tconst nextTabbable = focus.tabbable[ direction ]( event.target );\n\n\t\t\t// We want to constrain the tabbing to the block and its child blocks.\n\t\t\t// If the preceding form element is within a different block,\n\t\t\t// such as two sibling image blocks in the placeholder state,\n\t\t\t// we want shift + tab from the first form element to move to the image\n\t\t\t// block toolbar and not the previous image block's form element.\n\t\t\tconst currentBlock = event.target.closest( '[data-block]' );\n\t\t\tconst isElementPartOfSelectedBlock =\n\t\t\t\tcurrentBlock &&\n\t\t\t\tnextTabbable &&\n\t\t\t\t( isInSameBlock( currentBlock, nextTabbable ) ||\n\t\t\t\t\tisInsideRootBlock( currentBlock, nextTabbable ) );\n\n\t\t\t// Allow tabbing from the block wrapper to a form element,\n\t\t\t// and between form elements rendered in a block and its child blocks,\n\t\t\t// such as inside a placeholder. Form elements are generally\n\t\t\t// meant to be UI rather than part of the content. Ideally\n\t\t\t// these are not rendered in the content and perhaps in the\n\t\t\t// future they can be rendered in an iframe or shadow DOM.\n\t\t\tif (\n\t\t\t\tisFormElement( nextTabbable ) &&\n\t\t\t\tisElementPartOfSelectedBlock\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst next = isShift ? focusCaptureBeforeRef : focusCaptureAfterRef;\n\n\t\t\t// Disable focus capturing on the focus capture element, so it\n\t\t\t// doesn't refocus this block and so it allows default behaviour\n\t\t\t// (moving focus to the next tabbable element).\n\t\t\tnoCaptureRef.current = true;\n\n\t\t\t// Focusing the focus capture element, which is located above and\n\t\t\t// below the editor, should not scroll the page all the way up or\n\t\t\t// down.\n\t\t\tnext.current.focus( { preventScroll: true } );\n\t\t}\n\n\t\tfunction onFocusOut( event ) {\n\t\t\tsetLastFocus( { ...getLastFocus(), current: event.target } );\n\n\t\t\tconst { ownerDocument } = node;\n\n\t\t\t// If focus disappears due to there being no blocks, move focus to\n\t\t\t// the writing flow wrapper.\n\t\t\tif (\n\t\t\t\t! event.relatedTarget &&\n\t\t\t\townerDocument.activeElement === ownerDocument.body &&\n\t\t\t\tgetBlockCount() === 0\n\t\t\t) {\n\t\t\t\tnode.focus();\n\t\t\t}\n\t\t}\n\n\t\t// When tabbing back to an element in block list, this event handler prevents scrolling if the\n\t\t// focus capture divs (before/after) are outside of the viewport. (For example shift+tab back to a paragraph\n\t\t// when focus is on a sidebar element. This prevents the scrollable writing area from jumping either to the\n\t\t// top or bottom of the document.\n\t\t//\n\t\t// Note that it isn't possible to disable scrolling in the onFocus event. We need to intercept this\n\t\t// earlier in the keypress handler, and call focus( { preventScroll: true } ) instead.\n\t\t// https://developer.mozilla.org/en-US/docs/Web/API/HTMLOrForeignElement/focus#parameters\n\t\tfunction preventScrollOnTab( event ) {\n\t\t\tif ( event.keyCode !== TAB ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( event.target?.getAttribute( 'role' ) === 'region' ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( container.current === event.target ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst isShift = event.shiftKey;\n\t\t\tconst direction = isShift ? 'findPrevious' : 'findNext';\n\t\t\tconst target = focus.tabbable[ direction ]( event.target );\n\t\t\t// Only do something when the next tabbable is a focus capture div (before/after)\n\t\t\tif (\n\t\t\t\ttarget === focusCaptureBeforeRef.current ||\n\t\t\t\ttarget === focusCaptureAfterRef.current\n\t\t\t) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\ttarget.focus( { preventScroll: true } );\n\t\t\t}\n\t\t}\n\n\t\tconst { ownerDocument } = node;\n\t\tconst { defaultView } = ownerDocument;\n\t\tdefaultView.addEventListener( 'keydown', preventScrollOnTab );\n\t\tnode.addEventListener( 'keydown', onKeyDown );\n\t\tnode.addEventListener( 'focusout', onFocusOut );\n\t\treturn () => {\n\t\t\tdefaultView.removeEventListener( 'keydown', preventScrollOnTab );\n\t\t\tnode.removeEventListener( 'keydown', onKeyDown );\n\t\t\tnode.removeEventListener( 'focusout', onFocusOut );\n\t\t};\n\t}, [] );\n\n\tconst mergedRefs = useMergeRefs( [ container, ref ] );\n\n\treturn [ before, mergedRefs, after ];\n}\n"],"mappings":";AAAA;AAC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CAACyC,cAAc,CAAC,CAAC;QACtBrC,MAAM,CAACjC,KAAK,CAAE;UAAE+D,aAAa,EAAE;QAAK,CAAE,CAAC;MACxC;IACD;IAEA,MAAM;MAAE/B;IAAc,CAAC,GAAGoB,IAAI;IAC9B,MAAM;MAAElB;IAAY,CAAC,GAAGF,aAAa;IACrCE,WAAW,CAACqC,gBAAgB,CAAE,SAAS,EAAEH,kBAAmB,CAAC;IAC7DhB,IAAI,CAACmB,gBAAgB,CAAE,SAAS,EAAElB,SAAU,CAAC;IAC7CD,IAAI,CAACmB,gBAAgB,CAAE,UAAU,EAAEP,UAAW,CAAC;IAC/C,OAAO,MAAM;MACZ9B,WAAW,CAACsC,mBAAmB,CAAE,SAAS,EAAEJ,kBAAmB,CAAC;MAChEhB,IAAI,CAACoB,mBAAmB,CAAE,SAAS,EAAEnB,SAAU,CAAC;MAChDD,IAAI,CAACoB,mBAAmB,CAAE,UAAU,EAAER,UAAW,CAAC;IACnD,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,MAAMS,UAAU,GAAGnE,YAAY,CAAE,CAAEU,SAAS,EAAEgC,GAAG,CAAG,CAAC;EAErD,OAAO,CAAED,MAAM,EAAE0B,UAAU,EAAEtB,KAAK,CAAE;AACrC","ignoreList":[]}
@@ -1,3 +1,4 @@
1
+ /* wp:polyfill */
1
2
  /**
2
3
  * WordPress dependencies
3
4
  */
@@ -1 +1 @@
1
- {"version":3,"names":["__unstableStripHTML","stripHTML","serialize","createBlock","pasteHandler","findTransform","getBlockTransforms","store","blocksStore","getPasteEventData","blockEditorStore","requiresWrapperOnCopy","Symbol","setClipboardBlocks","event","blocks","registry","_blocks","firstBlock","firstBlockType","select","getBlockType","name","getBlockRootClientId","getBlockName","getBlockAttributes","wrapperBlockClientId","clientId","wrapperBlockName","serialized","clipboardData","setData","toPlainText","getPasteBlocks","canUserUseUnfilteredHTML","plainText","html","files","length","fromTransforms","reduce","accumulator","file","transformation","transform","type","isMatch","push","flat","HTML","mode","replace","trim"],"sources":["@wordpress/block-editor/src/components/writing-flow/utils.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __unstableStripHTML as stripHTML } from '@wordpress/dom';\nimport {\n\tserialize,\n\tcreateBlock,\n\tpasteHandler,\n\tfindTransform,\n\tgetBlockTransforms,\n\tstore as blocksStore,\n} from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { getPasteEventData } from '../../utils/pasting';\nimport { store as blockEditorStore } from '../../store';\n\nexport const requiresWrapperOnCopy = Symbol( 'requiresWrapperOnCopy' );\n\n/**\n * Sets the clipboard data for the provided blocks, with both HTML and plain\n * text representations.\n *\n * @param {ClipboardEvent} event Clipboard event.\n * @param {WPBlock[]} blocks Blocks to set as clipboard data.\n * @param {Object} registry The registry to select from.\n */\nexport function setClipboardBlocks( event, blocks, registry ) {\n\tlet _blocks = blocks;\n\n\tconst [ firstBlock ] = blocks;\n\n\tif ( firstBlock ) {\n\t\tconst firstBlockType = registry\n\t\t\t.select( blocksStore )\n\t\t\t.getBlockType( firstBlock.name );\n\n\t\tif ( firstBlockType[ requiresWrapperOnCopy ] ) {\n\t\t\tconst { getBlockRootClientId, getBlockName, getBlockAttributes } =\n\t\t\t\tregistry.select( blockEditorStore );\n\t\t\tconst wrapperBlockClientId = getBlockRootClientId(\n\t\t\t\tfirstBlock.clientId\n\t\t\t);\n\t\t\tconst wrapperBlockName = getBlockName( wrapperBlockClientId );\n\n\t\t\tif ( wrapperBlockName ) {\n\t\t\t\t_blocks = createBlock(\n\t\t\t\t\twrapperBlockName,\n\t\t\t\t\tgetBlockAttributes( wrapperBlockClientId ),\n\t\t\t\t\t_blocks\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\tconst serialized = serialize( _blocks );\n\n\tevent.clipboardData.setData( 'text/plain', toPlainText( serialized ) );\n\tevent.clipboardData.setData( 'text/html', serialized );\n}\n\n/**\n * Returns the blocks to be pasted from the clipboard event.\n *\n * @param {ClipboardEvent} event The clipboard event.\n * @param {boolean} canUserUseUnfilteredHTML Whether the user can or can't post unfiltered HTML.\n * @return {Array|string} A list of blocks or a string, depending on `handlerMode`.\n */\nexport function getPasteBlocks( event, canUserUseUnfilteredHTML ) {\n\tconst { plainText, html, files } = getPasteEventData( event );\n\tlet blocks = [];\n\n\tif ( files.length ) {\n\t\tconst fromTransforms = getBlockTransforms( 'from' );\n\t\tblocks = files\n\t\t\t.reduce( ( accumulator, file ) => {\n\t\t\t\tconst transformation = findTransform(\n\t\t\t\t\tfromTransforms,\n\t\t\t\t\t( transform ) =>\n\t\t\t\t\t\ttransform.type === 'files' &&\n\t\t\t\t\t\ttransform.isMatch( [ file ] )\n\t\t\t\t);\n\t\t\t\tif ( transformation ) {\n\t\t\t\t\taccumulator.push( transformation.transform( [ file ] ) );\n\t\t\t\t}\n\t\t\t\treturn accumulator;\n\t\t\t}, [] )\n\t\t\t.flat();\n\t} else {\n\t\tblocks = pasteHandler( {\n\t\t\tHTML: html,\n\t\t\tplainText,\n\t\t\tmode: 'BLOCKS',\n\t\t\tcanUserUseUnfilteredHTML,\n\t\t} );\n\t}\n\n\treturn blocks;\n}\n\n/**\n * Given a string of HTML representing serialized blocks, returns the plain\n * text extracted after stripping the HTML of any tags and fixing line breaks.\n *\n * @param {string} html Serialized blocks.\n * @return {string} The plain-text content with any html removed.\n */\nfunction toPlainText( html ) {\n\t// Manually handle BR tags as line breaks prior to `stripHTML` call\n\thtml = html.replace( /<br>/g, '\\n' );\n\n\tconst plainText = stripHTML( html ).trim();\n\n\t// Merge any consecutive line breaks\n\treturn plainText.replace( /\\n\\n+/g, '\\n\\n' );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,mBAAmB,IAAIC,SAAS,QAAQ,gBAAgB;AACjE,SACCC,SAAS,EACTC,WAAW,EACXC,YAAY,EACZC,aAAa,EACbC,kBAAkB,EAClBC,KAAK,IAAIC,WAAW,QACd,mBAAmB;;AAE1B;AACA;AACA;AACA,SAASC,iBAAiB,QAAQ,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AI;IAAEC;EAAM,CAAC,GAAG5B,iBAAiB,CAAEK,KAAM,CAAC;EAC7D,IAAIC,MAAM,GAAG,EAAE;EAEf,IAAKsB,KAAK,CAACC,MAAM,EAAG;IACnB,MAAMC,cAAc,GAAGjC,kBAAkB,CAAE,MAAO,CAAC;IACnDS,MAAM,GAAGsB,KAAK,CACZG,MAAM,CAAE,CAAEC,WAAW,EAAEC,IAAI,KAAM;MACjC,MAAMC,cAAc,GAAGtC,aAAa,CACnCkC,cAAc,EACZK,SAAS,IACVA,SAAS,CAACC,IAAI,KAAK,OAAO,IAC1BD,SAAS,CAACE,OAAO,CAAE,CAAEJ,IAAI,CAAG,CAC9B,CAAC;MACD,IAAKC,cAAc,EAAG;QACrBF,WAAW,CAACM,IAAI,CAAEJ,cAAc,CAACC,SAAS,CAAE,CAAEF,IAAI,CAAG,CAAE,CAAC;MACzD;MACA,OAAOD,WAAW;IACnB,CAAC,EAAE,EAAG,CAAC,CACNO,IAAI,CAAC,CAAC;EACT,CAAC,MAAM;IACNjC,MAAM,GAAGX,YAAY,CAAE;MACtB6C,IAAI,EAAEb,IAAI;MACVD,SAAS;MACTe,IAAI,EAAE,QAAQ;MACdhB;IACD,CAAE,CAAC;EACJ;EAEA,OAAOnB,MAAM;AACd;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASiB,WAAWA,CAAEI,IAAI,EAAG;EAC5B;EACAA,IAAI,GAAGA,IAAI,CAACe,OAAO,CAAE,OAAO,EAAE,IAAK,CAAC;EAEpC,MAAMhB,SAAS,GAAGlC,SAAS,CAAEmC,IAAK,CAAC,CAACgB,IAAI,CAAC,CAAC;;EAE1C;EACA,OAAOjB,SAAS,CAACgB,OAAO,CAAE,QAAQ,EAAE,MAAO,CAAC;AAC7C","ignoreList":[]}
1
+ {"version":3,"names":["__unstableStripHTML","stripHTML","serialize","createBlock","pasteHandler","findTransform","getBlockTransforms","store","blocksStore","getPasteEventData","blockEditorStore","requiresWrapperOnCopy","Symbol","setClipboardBlocks","event","blocks","registry","_blocks","firstBlock","firstBlockType","select","getBlockType","name","getBlockRootClientId","getBlockName","getBlockAttributes","wrapperBlockClientId","clientId","wrapperBlockName","serialized","clipboardData","setData","toPlainText","getPasteBlocks","canUserUseUnfilteredHTML","plainText","html","files","length","fromTransforms","reduce","accumulator","file","transformation","transform","type","isMatch","push","flat","HTML","mode","replace","trim"],"sources":["@wordpress/block-editor/src/components/writing-flow/utils.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __unstableStripHTML as stripHTML } from '@wordpress/dom';\nimport {\n\tserialize,\n\tcreateBlock,\n\tpasteHandler,\n\tfindTransform,\n\tgetBlockTransforms,\n\tstore as blocksStore,\n} from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { getPasteEventData } from '../../utils/pasting';\nimport { store as blockEditorStore } from '../../store';\n\nexport const requiresWrapperOnCopy = Symbol( 'requiresWrapperOnCopy' );\n\n/**\n * Sets the clipboard data for the provided blocks, with both HTML and plain\n * text representations.\n *\n * @param {ClipboardEvent} event Clipboard event.\n * @param {WPBlock[]} blocks Blocks to set as clipboard data.\n * @param {Object} registry The registry to select from.\n */\nexport function setClipboardBlocks( event, blocks, registry ) {\n\tlet _blocks = blocks;\n\n\tconst [ firstBlock ] = blocks;\n\n\tif ( firstBlock ) {\n\t\tconst firstBlockType = registry\n\t\t\t.select( blocksStore )\n\t\t\t.getBlockType( firstBlock.name );\n\n\t\tif ( firstBlockType[ requiresWrapperOnCopy ] ) {\n\t\t\tconst { getBlockRootClientId, getBlockName, getBlockAttributes } =\n\t\t\t\tregistry.select( blockEditorStore );\n\t\t\tconst wrapperBlockClientId = getBlockRootClientId(\n\t\t\t\tfirstBlock.clientId\n\t\t\t);\n\t\t\tconst wrapperBlockName = getBlockName( wrapperBlockClientId );\n\n\t\t\tif ( wrapperBlockName ) {\n\t\t\t\t_blocks = createBlock(\n\t\t\t\t\twrapperBlockName,\n\t\t\t\t\tgetBlockAttributes( wrapperBlockClientId ),\n\t\t\t\t\t_blocks\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\tconst serialized = serialize( _blocks );\n\n\tevent.clipboardData.setData( 'text/plain', toPlainText( serialized ) );\n\tevent.clipboardData.setData( 'text/html', serialized );\n}\n\n/**\n * Returns the blocks to be pasted from the clipboard event.\n *\n * @param {ClipboardEvent} event The clipboard event.\n * @param {boolean} canUserUseUnfilteredHTML Whether the user can or can't post unfiltered HTML.\n * @return {Array|string} A list of blocks or a string, depending on `handlerMode`.\n */\nexport function getPasteBlocks( event, canUserUseUnfilteredHTML ) {\n\tconst { plainText, html, files } = getPasteEventData( event );\n\tlet blocks = [];\n\n\tif ( files.length ) {\n\t\tconst fromTransforms = getBlockTransforms( 'from' );\n\t\tblocks = files\n\t\t\t.reduce( ( accumulator, file ) => {\n\t\t\t\tconst transformation = findTransform(\n\t\t\t\t\tfromTransforms,\n\t\t\t\t\t( transform ) =>\n\t\t\t\t\t\ttransform.type === 'files' &&\n\t\t\t\t\t\ttransform.isMatch( [ file ] )\n\t\t\t\t);\n\t\t\t\tif ( transformation ) {\n\t\t\t\t\taccumulator.push( transformation.transform( [ file ] ) );\n\t\t\t\t}\n\t\t\t\treturn accumulator;\n\t\t\t}, [] )\n\t\t\t.flat();\n\t} else {\n\t\tblocks = pasteHandler( {\n\t\t\tHTML: html,\n\t\t\tplainText,\n\t\t\tmode: 'BLOCKS',\n\t\t\tcanUserUseUnfilteredHTML,\n\t\t} );\n\t}\n\n\treturn blocks;\n}\n\n/**\n * Given a string of HTML representing serialized blocks, returns the plain\n * text extracted after stripping the HTML of any tags and fixing line breaks.\n *\n * @param {string} html Serialized blocks.\n * @return {string} The plain-text content with any html removed.\n */\nfunction toPlainText( html ) {\n\t// Manually handle BR tags as line breaks prior to `stripHTML` call\n\thtml = html.replace( /<br>/g, '\\n' );\n\n\tconst plainText = stripHTML( html ).trim();\n\n\t// Merge any consecutive line breaks\n\treturn plainText.replace( /\\n\\n+/g, '\\n\\n' );\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AI,CAAC,CAAC;;EAE1C;EACA,OAAOjB,SAAS,CAACgB,OAAO,CAAE,QAAQ,EAAE,MAAO,CAAC;AAC7C","ignoreList":[]}
@@ -1,3 +1,4 @@
1
+ /* wp:polyfill */
1
2
  /**
2
3
  * External dependencies
3
4
  */
@@ -1 +1 @@
1
- {"version":3,"names":["clsx","__","isRTL","textHorizontal","textVertical","__experimentalToggleGroupControl","ToggleGroupControl","__experimentalToggleGroupControlOptionIcon","ToggleGroupControlOptionIcon","jsx","_jsx","WRITING_MODES","label","value","icon","WritingModeControl","className","onChange","isDeselectable","__nextHasNoMarginBottom","__next40pxDefaultSize","newValue","undefined","children","map","option"],"sources":["@wordpress/block-editor/src/components/writing-mode-control/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __, isRTL } from '@wordpress/i18n';\nimport { textHorizontal, textVertical } from '@wordpress/icons';\nimport {\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOptionIcon as ToggleGroupControlOptionIcon,\n} from '@wordpress/components';\n\nconst WRITING_MODES = [\n\t{\n\t\tlabel: __( 'Horizontal' ),\n\t\tvalue: 'horizontal-tb',\n\t\ticon: textHorizontal,\n\t},\n\t{\n\t\tlabel: __( 'Vertical' ),\n\t\tvalue: isRTL() ? 'vertical-lr' : 'vertical-rl',\n\t\ticon: textVertical,\n\t},\n];\n\n/**\n * Control to facilitate writing mode selections.\n *\n * @param {Object} props Component props.\n * @param {string} props.className Class name to add to the control.\n * @param {string} props.value Currently selected writing mode.\n * @param {Function} props.onChange Handles change in the writing mode selection.\n *\n * @return {Element} Writing Mode control.\n */\nexport default function WritingModeControl( { className, value, onChange } ) {\n\treturn (\n\t\t<ToggleGroupControl\n\t\t\tisDeselectable\n\t\t\t__nextHasNoMarginBottom\n\t\t\t__next40pxDefaultSize\n\t\t\tlabel={ __( 'Orientation' ) }\n\t\t\tclassName={ clsx( 'block-editor-writing-mode-control', className ) }\n\t\t\tvalue={ value }\n\t\t\tonChange={ ( newValue ) => {\n\t\t\t\tonChange( newValue === value ? undefined : newValue );\n\t\t\t} }\n\t\t>\n\t\t\t{ WRITING_MODES.map( ( option ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<ToggleGroupControlOptionIcon\n\t\t\t\t\t\tkey={ option.value }\n\t\t\t\t\t\tvalue={ option.value }\n\t\t\t\t\t\ticon={ option.icon }\n\t\t\t\t\t\tlabel={ option.label }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</ToggleGroupControl>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,EAAE,EAAEC,KAAK,QAAQ,iBAAiB;AAC3C,SAASC,cAAc,EAAEC,YAAY,QAAQ,kBAAkB;AAC/D,SACCC,gCAAgC,IAAIC,kBAAkB,EACtDC,0CAA0C,IAAIC,4BAA4B,QACpE,uBAAuB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE/B,MAAMC,aAAa,GAAG,CACrB;EACCC,KAAK,EAAEX,EAAE,CAAE,YAAa,CAAC;EACzBY,KAAK,EAAE,eAAe;EACtBC,IAAI,EAAEX;AACP,CAAC,EACD;EACCS,KAAK,EAAEX,EAAE,CAAE,UAAW,CAAC;EACvBY,KAAK,EAAEX,KAAK,CAAC,CAAC,GAAG,aAAa,GAAG,aAAa;EAC9CY,IAAI,EAAEV;AACP,CAAC,CACD;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASW,kBAAkBA,CAAE;EAAEC,SAAS;EAAEH,KAAK;EAAEI;AAAS,CAAC,EAAG;EAC5E,oBACCP,IAAA,CAACJ,kBAAkB;IAClBY,cAAc;IACdC,uBAAuB;IACvBC,qBAAqB;IACrBR,KAAK,EAAGX,EAAE,CAAE,aAAc,CAAG;IAC7Be,SAAS,EAAGhB,IAAI,CAAE,mCAAmC,EAAEgB,SAAU,CAAG;IACpEH,KAAK,EAAGA,KAAO;IACfI,QAAQ,EAAKI,QAAQ,IAAM;MAC1BJ,QAAQ,CAAEI,QAAQ,KAAKR,KAAK,GAAGS,SAAS,GAAGD,QAAS,CAAC;IACtD,CAAG;IAAAE,QAAA,EAEDZ,aAAa,CAACa,GAAG,CAAIC,MAAM,IAAM;MAClC,oBACCf,IAAA,CAACF,4BAA4B;QAE5BK,KAAK,EAAGY,MAAM,CAACZ,KAAO;QACtBC,IAAI,EAAGW,MAAM,CAACX,IAAM;QACpBF,KAAK,EAAGa,MAAM,CAACb;MAAO,GAHhBa,MAAM,CAACZ,KAIb,CAAC;IAEJ,CAAE;EAAC,CACgB,CAAC;AAEvB","ignoreList":[]}
1
+ {"version":3,"names":["clsx","__","isRTL","textHorizontal","textVertical","__experimentalToggleGroupControl","ToggleGroupControl","__experimentalToggleGroupControlOptionIcon","ToggleGroupControlOptionIcon","jsx","_jsx","WRITING_MODES","label","value","icon","WritingModeControl","className","onChange","isDeselectable","__nextHasNoMarginBottom","__next40pxDefaultSize","newValue","undefined","children","map","option"],"sources":["@wordpress/block-editor/src/components/writing-mode-control/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __, isRTL } from '@wordpress/i18n';\nimport { textHorizontal, textVertical } from '@wordpress/icons';\nimport {\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOptionIcon as ToggleGroupControlOptionIcon,\n} from '@wordpress/components';\n\nconst WRITING_MODES = [\n\t{\n\t\tlabel: __( 'Horizontal' ),\n\t\tvalue: 'horizontal-tb',\n\t\ticon: textHorizontal,\n\t},\n\t{\n\t\tlabel: __( 'Vertical' ),\n\t\tvalue: isRTL() ? 'vertical-lr' : 'vertical-rl',\n\t\ticon: textVertical,\n\t},\n];\n\n/**\n * Control to facilitate writing mode selections.\n *\n * @param {Object} props Component props.\n * @param {string} props.className Class name to add to the control.\n * @param {string} props.value Currently selected writing mode.\n * @param {Function} props.onChange Handles change in the writing mode selection.\n *\n * @return {Element} Writing Mode control.\n */\nexport default function WritingModeControl( { className, value, onChange } ) {\n\treturn (\n\t\t<ToggleGroupControl\n\t\t\tisDeselectable\n\t\t\t__nextHasNoMarginBottom\n\t\t\t__next40pxDefaultSize\n\t\t\tlabel={ __( 'Orientation' ) }\n\t\t\tclassName={ clsx( 'block-editor-writing-mode-control', className ) }\n\t\t\tvalue={ value }\n\t\t\tonChange={ ( newValue ) => {\n\t\t\t\tonChange( newValue === value ? undefined : newValue );\n\t\t\t} }\n\t\t>\n\t\t\t{ WRITING_MODES.map( ( option ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<ToggleGroupControlOptionIcon\n\t\t\t\t\t\tkey={ option.value }\n\t\t\t\t\t\tvalue={ option.value }\n\t\t\t\t\t\ticon={ option.icon }\n\t\t\t\t\t\tlabel={ option.label }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</ToggleGroupControl>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,EAAE,EAAEC,KAAK,QAAQ,iBAAiB;AAC3C,SAASC,cAAc,EAAEC,YAAY,QAAQ,kBAAkB;AAC/D,SACCC,gCAAgC,IAAIC,kBAAkB,EACtDC,0CAA0C,IAAIC,4BAA4B,QACpE,uBAAuB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE/B,MAAMC,aAAa,GAAG,CACrB;EACCC,KAAK,EAAEX,EAAE,CAAE,YAAa,CAAC;EACzBY,KAAK,EAAE,eAAe;EACtBC,IAAI,EAAEX;AACP,CAAC,EACD;EACCS,KAAK,EAAEX,EAAE,CAAE,UAAW,CAAC;EACvBY,KAAK,EAAEX,KAAK,CAAC,CAAC,GAAG,aAAa,GAAG,aAAa;EAC9CY,IAAI,EAAEV;AACP,CAAC,CACD;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASW,kBAAkBA,CAAE;EAAEC,SAAS;EAAEH,KAAK;EAAEI;AAAS,CAAC,EAAG;EAC5E,oBACCP,IAAA,CAACJ,kBAAkB;IAClBY,cAAc;IACdC,uBAAuB;IACvBC,qBAAqB;IACrBR,KAAK,EAAGX,EAAE,CAAE,aAAc,CAAG;IAC7Be,SAAS,EAAGhB,IAAI,CAAE,mCAAmC,EAAEgB,SAAU,CAAG;IACpEH,KAAK,EAAGA,KAAO;IACfI,QAAQ,EAAKI,QAAQ,IAAM;MAC1BJ,QAAQ,CAAEI,QAAQ,KAAKR,KAAK,GAAGS,SAAS,GAAGD,QAAS,CAAC;IACtD,CAAG;IAAAE,QAAA,EAEDZ,aAAa,CAACa,GAAG,CAAIC,MAAM,IAAM;MAClC,oBACCf,IAAA,CAACF,4BAA4B;QAE5BK,KAAK,EAAGY,MAAM,CAACZ,KAAO;QACtBC,IAAI,EAAGW,MAAM,CAACX,IAAM;QACpBF,KAAK,EAAGa,MAAM,CAACb;MAAO,GAHhBa,MAAM,CAACZ,KAIb,CAAC;IAEJ,CAAE;EAAC,CACgB,CAAC;AAEvB","ignoreList":[]}
@@ -1,3 +1,4 @@
1
+ /* wp:polyfill */
1
2
  /**
2
3
  * External dependencies
3
4
  */
@@ -1 +1 @@
1
- {"version":3,"names":["clsx","addFilter","getBlockSupport","getBlockType","hasBlockSupport","BlockControls","BlockAlignmentControl","useAvailableAlignments","useBlockEditingMode","jsx","_jsx","ALL_ALIGNMENTS","WIDE_ALIGNMENTS","getValidAlignments","blockAlign","hasWideBlockSupport","hasWideEnabled","validAlignments","Array","isArray","filter","value","includes","alignment","addAttribute","settings","_settings$attributes$","attributes","align","type","enum","BlockEditAlignmentToolbarControlsPure","name","blockName","setAttributes","blockAllowedAlignments","map","blockEditingMode","length","updateAlignment","nextAlign","blockType","blockDefaultAlign","default","group","__experimentalShareWithChildBlocks","children","onChange","controls","shareWithChildBlocks","edit","useBlockProps","addSaveProps","addAssignedAlign","attributeKeys","hasSupport","some","props","isAlignValid","className"],"sources":["@wordpress/block-editor/src/hooks/align.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { addFilter } from '@wordpress/hooks';\nimport {\n\tgetBlockSupport,\n\tgetBlockType,\n\thasBlockSupport,\n} from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { BlockControls, BlockAlignmentControl } from '../components';\nimport useAvailableAlignments from '../components/block-alignment-control/use-available-alignments';\nimport { useBlockEditingMode } from '../components/block-editing-mode';\n\n/**\n * An array which includes all possible valid alignments,\n * used to validate if an alignment is valid or not.\n *\n * @constant\n * @type {string[]}\n */\nconst ALL_ALIGNMENTS = [ 'left', 'center', 'right', 'wide', 'full' ];\n\n/**\n * An array which includes all wide alignments.\n * In order for this alignments to be valid they need to be supported by the block,\n * and by the theme.\n *\n * @constant\n * @type {string[]}\n */\nconst WIDE_ALIGNMENTS = [ 'wide', 'full' ];\n\n/**\n * Returns the valid alignments.\n * Takes into consideration the aligns supported by a block, if the block supports wide controls or not and if theme supports wide controls or not.\n * Exported just for testing purposes, not exported outside the module.\n *\n * @param {?boolean|string[]} blockAlign Aligns supported by the block.\n * @param {?boolean} hasWideBlockSupport True if block supports wide alignments. And False otherwise.\n * @param {?boolean} hasWideEnabled True if theme supports wide alignments. And False otherwise.\n *\n * @return {string[]} Valid alignments.\n */\nexport function getValidAlignments(\n\tblockAlign,\n\thasWideBlockSupport = true,\n\thasWideEnabled = true\n) {\n\tlet validAlignments;\n\tif ( Array.isArray( blockAlign ) ) {\n\t\tvalidAlignments = ALL_ALIGNMENTS.filter( ( value ) =>\n\t\t\tblockAlign.includes( value )\n\t\t);\n\t} else if ( blockAlign === true ) {\n\t\t// `true` includes all alignments...\n\t\tvalidAlignments = [ ...ALL_ALIGNMENTS ];\n\t} else {\n\t\tvalidAlignments = [];\n\t}\n\n\tif (\n\t\t! hasWideEnabled ||\n\t\t( blockAlign === true && ! hasWideBlockSupport )\n\t) {\n\t\treturn validAlignments.filter(\n\t\t\t( alignment ) => ! WIDE_ALIGNMENTS.includes( alignment )\n\t\t);\n\t}\n\n\treturn validAlignments;\n}\n\n/**\n * Filters registered block settings, extending attributes to include `align`.\n *\n * @param {Object} settings Original block settings.\n *\n * @return {Object} Filtered block settings.\n */\nexport function addAttribute( settings ) {\n\t// Allow blocks to specify their own attribute definition with default values if needed.\n\tif ( 'type' in ( settings.attributes?.align ?? {} ) ) {\n\t\treturn settings;\n\t}\n\tif ( hasBlockSupport( settings, 'align' ) ) {\n\t\t// Gracefully handle if settings.attributes is undefined.\n\t\tsettings.attributes = {\n\t\t\t...settings.attributes,\n\t\t\talign: {\n\t\t\t\ttype: 'string',\n\t\t\t\t// Allow for '' since it is used by the `updateAlignment` function\n\t\t\t\t// in toolbar controls for special cases with defined default values.\n\t\t\t\tenum: [ ...ALL_ALIGNMENTS, '' ],\n\t\t\t},\n\t\t};\n\t}\n\n\treturn settings;\n}\n\nfunction BlockEditAlignmentToolbarControlsPure( {\n\tname: blockName,\n\talign,\n\tsetAttributes,\n} ) {\n\t// Compute the block valid alignments by taking into account,\n\t// if the theme supports wide alignments or not and the layout's\n\t// available alignments. We do that for conditionally rendering\n\t// Slot.\n\tconst blockAllowedAlignments = getValidAlignments(\n\t\tgetBlockSupport( blockName, 'align' ),\n\t\thasBlockSupport( blockName, 'alignWide', true )\n\t);\n\n\tconst validAlignments = useAvailableAlignments(\n\t\tblockAllowedAlignments\n\t).map( ( { name } ) => name );\n\tconst blockEditingMode = useBlockEditingMode();\n\tif ( ! validAlignments.length || blockEditingMode !== 'default' ) {\n\t\treturn null;\n\t}\n\n\tconst updateAlignment = ( nextAlign ) => {\n\t\tif ( ! nextAlign ) {\n\t\t\tconst blockType = getBlockType( blockName );\n\t\t\tconst blockDefaultAlign = blockType?.attributes?.align?.default;\n\t\t\tif ( blockDefaultAlign ) {\n\t\t\t\tnextAlign = '';\n\t\t\t}\n\t\t}\n\t\tsetAttributes( { align: nextAlign } );\n\t};\n\n\treturn (\n\t\t<BlockControls group=\"block\" __experimentalShareWithChildBlocks>\n\t\t\t<BlockAlignmentControl\n\t\t\t\tvalue={ align }\n\t\t\t\tonChange={ updateAlignment }\n\t\t\t\tcontrols={ validAlignments }\n\t\t\t/>\n\t\t</BlockControls>\n\t);\n}\n\nexport default {\n\tshareWithChildBlocks: true,\n\tedit: BlockEditAlignmentToolbarControlsPure,\n\tuseBlockProps,\n\taddSaveProps: addAssignedAlign,\n\tattributeKeys: [ 'align' ],\n\thasSupport( name ) {\n\t\treturn hasBlockSupport( name, 'align', false );\n\t},\n};\n\nfunction useBlockProps( { name, align } ) {\n\tconst blockAllowedAlignments = getValidAlignments(\n\t\tgetBlockSupport( name, 'align' ),\n\t\thasBlockSupport( name, 'alignWide', true )\n\t);\n\tconst validAlignments = useAvailableAlignments( blockAllowedAlignments );\n\n\tif ( validAlignments.some( ( alignment ) => alignment.name === align ) ) {\n\t\treturn { 'data-align': align };\n\t}\n\n\treturn {};\n}\n\n/**\n * Override props assigned to save component to inject alignment class name if\n * block supports it.\n *\n * @param {Object} props Additional props applied to save element.\n * @param {Object} blockType Block type.\n * @param {Object} attributes Block attributes.\n *\n * @return {Object} Filtered props applied to save element.\n */\nexport function addAssignedAlign( props, blockType, attributes ) {\n\tconst { align } = attributes;\n\tconst blockAlign = getBlockSupport( blockType, 'align' );\n\tconst hasWideBlockSupport = hasBlockSupport( blockType, 'alignWide', true );\n\n\t// Compute valid alignments without taking into account if\n\t// the theme supports wide alignments or not.\n\t// This way changing themes does not impact the block save.\n\tconst isAlignValid = getValidAlignments(\n\t\tblockAlign,\n\t\thasWideBlockSupport\n\t).includes( align );\n\tif ( isAlignValid ) {\n\t\tprops.className = clsx( `align${ align }`, props.className );\n\t}\n\n\treturn props;\n}\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/editor/align/addAttribute',\n\taddAttribute\n);\n"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K,EAAEhB,SAAS,EAAEd,UAAU,EAAG;EAChE,MAAM;IAAEC;EAAM,CAAC,GAAGD,UAAU;EAC5B,MAAMb,UAAU,GAAGZ,eAAe,CAAEuC,SAAS,EAAE,OAAQ,CAAC;EACxD,MAAM1B,mBAAmB,GAAGX,eAAe,CAAEqC,SAAS,EAAE,WAAW,EAAE,IAAK,CAAC;;EAE3E;EACA;EACA;EACA,MAAMiB,YAAY,GAAG7C,kBAAkB,CACtCC,UAAU,EACVC,mBACD,CAAC,CAACO,QAAQ,CAAEM,KAAM,CAAC;EACnB,IAAK8B,YAAY,EAAG;IACnBD,KAAK,CAACE,SAAS,GAAG3D,IAAI,CAAE,QAAS4B,KAAK,EAAG,EAAE6B,KAAK,CAACE,SAAU,CAAC;EAC7D;EAEA,OAAOF,KAAK;AACb;AAEAxD,SAAS,CACR,0BAA0B,EAC1B,gCAAgC,EAChCuB,YACD,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["clsx","addFilter","getBlockSupport","getBlockType","hasBlockSupport","BlockControls","BlockAlignmentControl","useAvailableAlignments","useBlockEditingMode","jsx","_jsx","ALL_ALIGNMENTS","WIDE_ALIGNMENTS","getValidAlignments","blockAlign","hasWideBlockSupport","hasWideEnabled","validAlignments","Array","isArray","filter","value","includes","alignment","addAttribute","settings","_settings$attributes$","attributes","align","type","enum","BlockEditAlignmentToolbarControlsPure","name","blockName","setAttributes","blockAllowedAlignments","map","blockEditingMode","length","updateAlignment","nextAlign","blockType","blockDefaultAlign","default","group","__experimentalShareWithChildBlocks","children","onChange","controls","shareWithChildBlocks","edit","useBlockProps","addSaveProps","addAssignedAlign","attributeKeys","hasSupport","some","props","isAlignValid","className"],"sources":["@wordpress/block-editor/src/hooks/align.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { addFilter } from '@wordpress/hooks';\nimport {\n\tgetBlockSupport,\n\tgetBlockType,\n\thasBlockSupport,\n} from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { BlockControls, BlockAlignmentControl } from '../components';\nimport useAvailableAlignments from '../components/block-alignment-control/use-available-alignments';\nimport { useBlockEditingMode } from '../components/block-editing-mode';\n\n/**\n * An array which includes all possible valid alignments,\n * used to validate if an alignment is valid or not.\n *\n * @constant\n * @type {string[]}\n */\nconst ALL_ALIGNMENTS = [ 'left', 'center', 'right', 'wide', 'full' ];\n\n/**\n * An array which includes all wide alignments.\n * In order for this alignments to be valid they need to be supported by the block,\n * and by the theme.\n *\n * @constant\n * @type {string[]}\n */\nconst WIDE_ALIGNMENTS = [ 'wide', 'full' ];\n\n/**\n * Returns the valid alignments.\n * Takes into consideration the aligns supported by a block, if the block supports wide controls or not and if theme supports wide controls or not.\n * Exported just for testing purposes, not exported outside the module.\n *\n * @param {?boolean|string[]} blockAlign Aligns supported by the block.\n * @param {?boolean} hasWideBlockSupport True if block supports wide alignments. And False otherwise.\n * @param {?boolean} hasWideEnabled True if theme supports wide alignments. And False otherwise.\n *\n * @return {string[]} Valid alignments.\n */\nexport function getValidAlignments(\n\tblockAlign,\n\thasWideBlockSupport = true,\n\thasWideEnabled = true\n) {\n\tlet validAlignments;\n\tif ( Array.isArray( blockAlign ) ) {\n\t\tvalidAlignments = ALL_ALIGNMENTS.filter( ( value ) =>\n\t\t\tblockAlign.includes( value )\n\t\t);\n\t} else if ( blockAlign === true ) {\n\t\t// `true` includes all alignments...\n\t\tvalidAlignments = [ ...ALL_ALIGNMENTS ];\n\t} else {\n\t\tvalidAlignments = [];\n\t}\n\n\tif (\n\t\t! hasWideEnabled ||\n\t\t( blockAlign === true && ! hasWideBlockSupport )\n\t) {\n\t\treturn validAlignments.filter(\n\t\t\t( alignment ) => ! WIDE_ALIGNMENTS.includes( alignment )\n\t\t);\n\t}\n\n\treturn validAlignments;\n}\n\n/**\n * Filters registered block settings, extending attributes to include `align`.\n *\n * @param {Object} settings Original block settings.\n *\n * @return {Object} Filtered block settings.\n */\nexport function addAttribute( settings ) {\n\t// Allow blocks to specify their own attribute definition with default values if needed.\n\tif ( 'type' in ( settings.attributes?.align ?? {} ) ) {\n\t\treturn settings;\n\t}\n\tif ( hasBlockSupport( settings, 'align' ) ) {\n\t\t// Gracefully handle if settings.attributes is undefined.\n\t\tsettings.attributes = {\n\t\t\t...settings.attributes,\n\t\t\talign: {\n\t\t\t\ttype: 'string',\n\t\t\t\t// Allow for '' since it is used by the `updateAlignment` function\n\t\t\t\t// in toolbar controls for special cases with defined default values.\n\t\t\t\tenum: [ ...ALL_ALIGNMENTS, '' ],\n\t\t\t},\n\t\t};\n\t}\n\n\treturn settings;\n}\n\nfunction BlockEditAlignmentToolbarControlsPure( {\n\tname: blockName,\n\talign,\n\tsetAttributes,\n} ) {\n\t// Compute the block valid alignments by taking into account,\n\t// if the theme supports wide alignments or not and the layout's\n\t// available alignments. We do that for conditionally rendering\n\t// Slot.\n\tconst blockAllowedAlignments = getValidAlignments(\n\t\tgetBlockSupport( blockName, 'align' ),\n\t\thasBlockSupport( blockName, 'alignWide', true )\n\t);\n\n\tconst validAlignments = useAvailableAlignments(\n\t\tblockAllowedAlignments\n\t).map( ( { name } ) => name );\n\tconst blockEditingMode = useBlockEditingMode();\n\tif ( ! validAlignments.length || blockEditingMode !== 'default' ) {\n\t\treturn null;\n\t}\n\n\tconst updateAlignment = ( nextAlign ) => {\n\t\tif ( ! nextAlign ) {\n\t\t\tconst blockType = getBlockType( blockName );\n\t\t\tconst blockDefaultAlign = blockType?.attributes?.align?.default;\n\t\t\tif ( blockDefaultAlign ) {\n\t\t\t\tnextAlign = '';\n\t\t\t}\n\t\t}\n\t\tsetAttributes( { align: nextAlign } );\n\t};\n\n\treturn (\n\t\t<BlockControls group=\"block\" __experimentalShareWithChildBlocks>\n\t\t\t<BlockAlignmentControl\n\t\t\t\tvalue={ align }\n\t\t\t\tonChange={ updateAlignment }\n\t\t\t\tcontrols={ validAlignments }\n\t\t\t/>\n\t\t</BlockControls>\n\t);\n}\n\nexport default {\n\tshareWithChildBlocks: true,\n\tedit: BlockEditAlignmentToolbarControlsPure,\n\tuseBlockProps,\n\taddSaveProps: addAssignedAlign,\n\tattributeKeys: [ 'align' ],\n\thasSupport( name ) {\n\t\treturn hasBlockSupport( name, 'align', false );\n\t},\n};\n\nfunction useBlockProps( { name, align } ) {\n\tconst blockAllowedAlignments = getValidAlignments(\n\t\tgetBlockSupport( name, 'align' ),\n\t\thasBlockSupport( name, 'alignWide', true )\n\t);\n\tconst validAlignments = useAvailableAlignments( blockAllowedAlignments );\n\n\tif ( validAlignments.some( ( alignment ) => alignment.name === align ) ) {\n\t\treturn { 'data-align': align };\n\t}\n\n\treturn {};\n}\n\n/**\n * Override props assigned to save component to inject alignment class name if\n * block supports it.\n *\n * @param {Object} props Additional props applied to save element.\n * @param {Object} blockType Block type.\n * @param {Object} attributes Block attributes.\n *\n * @return {Object} Filtered props applied to save element.\n */\nexport function addAssignedAlign( props, blockType, attributes ) {\n\tconst { align } = attributes;\n\tconst blockAlign = getBlockSupport( blockType, 'align' );\n\tconst hasWideBlockSupport = hasBlockSupport( blockType, 'alignWide', true );\n\n\t// Compute valid alignments without taking into account if\n\t// the theme supports wide alignments or not.\n\t// This way changing themes does not impact the block save.\n\tconst isAlignValid = getValidAlignments(\n\t\tblockAlign,\n\t\thasWideBlockSupport\n\t).includes( align );\n\tif ( isAlignValid ) {\n\t\tprops.className = clsx( `align${ align }`, props.className );\n\t}\n\n\treturn props;\n}\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/editor/align/addAttribute',\n\taddAttribute\n);\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,SAAS,QAAQ,kBAAkB;AAC5C,SACCC,eAAe,EACfC,YAAY,EACZC,eAAe,QACT,mBAAmB;;AAE1B;AACA;AACA;AACA,SAASC,aAAa,EAAEC,qBAAqB,QAAQ,eAAe;AACpE,OAAOC,sBAAsB,MAAM,gEAAgE;AACn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Y,GAAG7C,kBAAkB,CACtCC,UAAU,EACVC,mBACD,CAAC,CAACO,QAAQ,CAAEM,KAAM,CAAC;EACnB,IAAK8B,YAAY,EAAG;IACnBD,KAAK,CAACE,SAAS,GAAG3D,IAAI,CAAE,QAAS4B,KAAK,EAAG,EAAE6B,KAAK,CAACE,SAAU,CAAC;EAC7D;EAEA,OAAOF,KAAK;AACb;AAEAxD,SAAS,CACR,0BAA0B,EAC1B,gCAAgC,EAChCuB,YACD,CAAC","ignoreList":[]}
@@ -1,3 +1,4 @@
1
+ /* wp:polyfill */
1
2
  /**
2
3
  * WordPress dependencies
3
4
  */
@@ -1 +1 @@
1
- {"version":3,"names":["addFilter","hasBlockSupport","WIDE_ALIGNMENTS","ALIGNMENTS","default","settings","name","excludeBlocks","includes","blockAlign","supports","align","Array","isArray","filter","alignment","Object","values","alignments","alignWide","attributes","type","enum"],"sources":["@wordpress/block-editor/src/hooks/align.native.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { addFilter } from '@wordpress/hooks';\nimport { hasBlockSupport } from '@wordpress/blocks';\nimport { WIDE_ALIGNMENTS } from '@wordpress/components';\n\nconst ALIGNMENTS = [ 'left', 'center', 'right' ];\n\nexport * from './align.js';\nexport { default } from './align.js';\n\n// Used to filter out blocks that don't support wide/full alignment on mobile\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/react-native-editor/align',\n\t( settings, name ) => {\n\t\tif (\n\t\t\tWIDE_ALIGNMENTS.excludeBlocks.includes( name ) &&\n\t\t\thasBlockSupport( settings, 'align' )\n\t\t) {\n\t\t\tconst blockAlign = settings.supports.align;\n\n\t\t\tsettings.supports = {\n\t\t\t\t...settings.supports,\n\t\t\t\talign: Array.isArray( blockAlign )\n\t\t\t\t\t? blockAlign.filter(\n\t\t\t\t\t\t\t( alignment ) =>\n\t\t\t\t\t\t\t\t! Object.values(\n\t\t\t\t\t\t\t\t\tWIDE_ALIGNMENTS.alignments\n\t\t\t\t\t\t\t\t).includes( alignment )\n\t\t\t\t\t )\n\t\t\t\t\t: blockAlign,\n\t\t\t\talignWide: false,\n\t\t\t};\n\t\t\tsettings.attributes = {\n\t\t\t\t...settings.attributes,\n\t\t\t\talign: {\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\t// Allow for '' since it is used by the `updateAlignment` function\n\t\t\t\t\t// in toolbar controls for special cases with defined default values.\n\t\t\t\t\tenum: [ ...ALIGNMENTS, '' ],\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\n\t\treturn settings;\n\t}\n);\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,kBAAkB;AAC5C,SAASC,eAAe,QAAQ,mBAAmB;AACnD,SAASC,eAAe,QAAQ,uBAAuB;AAEvD,MAAMC,UAAU,GAAG,CAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,CAAE;AAEhD,cAAc,YAAY;AAC1B,SAASC,OAAO,QAAQ,YAAY;;AAEpC;AACAJ,SAAS,CACR,0BAA0B,EAC1B,gCAAgC,EAChC,CAAEK,QAAQ,EAAEC,IAAI,KAAM;EACrB,IACCJ,eAAe,CAACK,aAAa,CAACC,QAAQ,CAAEF,IAAK,CAAC,IAC9CL,eAAe,CAAEI,QAAQ,EAAE,OAAQ,CAAC,EACnC;IACD,MAAMI,UAAU,GAAGJ,QAAQ,CAACK,QAAQ,CAACC,KAAK;IAE1CN,QAAQ,CAACK,QAAQ,GAAG;MACnB,GAAGL,QAAQ,CAACK,QAAQ;MACpBC,KAAK,EAAEC,KAAK,CAACC,OAAO,CAAEJ,UAAW,CAAC,GAC/BA,UAAU,CAACK,MAAM,CACfC,SAAS,IACV,CAAEC,MAAM,CAACC,MAAM,CACdf,eAAe,CAACgB,UACjB,CAAC,CAACV,QAAQ,CAAEO,SAAU,CACvB,CAAC,GACDN,UAAU;MACbU,SAAS,EAAE;IACZ,CAAC;IACDd,QAAQ,CAACe,UAAU,GAAG;MACrB,GAAGf,QAAQ,CAACe,UAAU;MACtBT,KAAK,EAAE;QACNU,IAAI,EAAE,QAAQ;QACd;QACA;QACAC,IAAI,EAAE,CAAE,GAAGnB,UAAU,EAAE,EAAE;MAC1B;IACD,CAAC;EACF;EAEA,OAAOE,QAAQ;AAChB,CACD,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["addFilter","hasBlockSupport","WIDE_ALIGNMENTS","ALIGNMENTS","default","settings","name","excludeBlocks","includes","blockAlign","supports","align","Array","isArray","filter","alignment","Object","values","alignments","alignWide","attributes","type","enum"],"sources":["@wordpress/block-editor/src/hooks/align.native.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { addFilter } from '@wordpress/hooks';\nimport { hasBlockSupport } from '@wordpress/blocks';\nimport { WIDE_ALIGNMENTS } from '@wordpress/components';\n\nconst ALIGNMENTS = [ 'left', 'center', 'right' ];\n\nexport * from './align.js';\nexport { default } from './align.js';\n\n// Used to filter out blocks that don't support wide/full alignment on mobile\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/react-native-editor/align',\n\t( settings, name ) => {\n\t\tif (\n\t\t\tWIDE_ALIGNMENTS.excludeBlocks.includes( name ) &&\n\t\t\thasBlockSupport( settings, 'align' )\n\t\t) {\n\t\t\tconst blockAlign = settings.supports.align;\n\n\t\t\tsettings.supports = {\n\t\t\t\t...settings.supports,\n\t\t\t\talign: Array.isArray( blockAlign )\n\t\t\t\t\t? blockAlign.filter(\n\t\t\t\t\t\t\t( alignment ) =>\n\t\t\t\t\t\t\t\t! Object.values(\n\t\t\t\t\t\t\t\t\tWIDE_ALIGNMENTS.alignments\n\t\t\t\t\t\t\t\t).includes( alignment )\n\t\t\t\t\t )\n\t\t\t\t\t: blockAlign,\n\t\t\t\talignWide: false,\n\t\t\t};\n\t\t\tsettings.attributes = {\n\t\t\t\t...settings.attributes,\n\t\t\t\talign: {\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\t// Allow for '' since it is used by the `updateAlignment` function\n\t\t\t\t\t// in toolbar controls for special cases with defined default values.\n\t\t\t\t\tenum: [ ...ALIGNMENTS, '' ],\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\n\t\treturn settings;\n\t}\n);\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,kBAAkB;AAC5C,SAASC,eAAe,QAAQ,mBAAmB;AACnD,SAASC,eAAe,QAAQ,uBAAuB;AAEvD,MAAMC,UAAU,GAAG,CAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,CAAE;AAEhD,cAAc,YAAY;AAC1B,SAASC,OAAO,QAAQ,YAAY;;AAEpC;AACAJ,SAAS,CACR,0BAA0B,EAC1B,gCAAgC,EAChC,CAAEK,QAAQ,EAAEC,IAAI,KAAM;EACrB,IACCJ,eAAe,CAACK,aAAa,CAACC,QAAQ,CAAEF,IAAK,CAAC,IAC9CL,eAAe,CAAEI,QAAQ,EAAE,OAAQ,CAAC,EACnC;IACD,MAAMI,UAAU,GAAGJ,QAAQ,CAACK,QAAQ,CAACC,KAAK;IAE1CN,QAAQ,CAACK,QAAQ,GAAG;MACnB,GAAGL,QAAQ,CAACK,QAAQ;MACpBC,KAAK,EAAEC,KAAK,CAACC,OAAO,CAAEJ,UAAW,CAAC,GAC/BA,UAAU,CAACK,MAAM,CACfC,SAAS,IACV,CAAEC,MAAM,CAACC,MAAM,CACdf,eAAe,CAACgB,UACjB,CAAC,CAACV,QAAQ,CAAEO,SAAU,CACvB,CAAC,GACDN,UAAU;MACbU,SAAS,EAAE;IACZ,CAAC;IACDd,QAAQ,CAACe,UAAU,GAAG;MACrB,GAAGf,QAAQ,CAACe,UAAU;MACtBT,KAAK,EAAE;QACNU,IAAI,EAAE,QAAQ;QACd;QACA;QACAC,IAAI,EAAE,CAAE,GAAGnB,UAAU,EAAE,EAAE;MAC1B;IACD,CAAC;EACF;EAEA,OAAOE,QAAQ;AAChB,CACD,CAAC","ignoreList":[]}
@@ -147,6 +147,7 @@ export function BackgroundImagePanel({
147
147
  backgroundSize: settings?.background?.backgroundSize && hasBackgroundSupport(name, 'backgroundSize')
148
148
  }
149
149
  };
150
+ const defaultControls = getBlockSupport(name, [BACKGROUND_SUPPORT_KEY, 'defaultControls']);
150
151
  return /*#__PURE__*/_jsx(StylesBackgroundPanel, {
151
152
  inheritedValue: inheritedValue,
152
153
  as: BackgroundInspectorControl,
@@ -154,6 +155,7 @@ export function BackgroundImagePanel({
154
155
  defaultValues: BACKGROUND_BLOCK_DEFAULT_VALUES,
155
156
  settings: updatedSettings,
156
157
  onChange: onChange,
158
+ defaultControls: defaultControls,
157
159
  value: style
158
160
  });
159
161
  }
@@ -1 +1 @@
1
- {"version":3,"names":["getBlockSupport","useSelect","useCallback","InspectorControls","cleanEmptyObject","store","blockEditorStore","default","StylesBackgroundPanel","useHasBackgroundPanel","hasBackgroundImageValue","globalStylesDataKey","jsx","_jsx","BACKGROUND_SUPPORT_KEY","BACKGROUND_BLOCK_DEFAULT_VALUES","backgroundSize","backgroundPosition","hasBackgroundSupport","blockName","feature","support","backgroundImage","backgroundRepeat","setBackgroundStyleDefaults","backgroundStyle","url","backgroundStylesWithDefaults","useBlockProps","name","style","background","backgroundStyles","getBackgroundImageClasses","BackgroundInspectorControl","children","resetAllFilter","attributes","undefined","group","BackgroundImagePanel","clientId","setAttributes","settings","inheritedValue","select","getBlockAttributes","getSettings","_settings","blocks","onChange","newStyle","updatedSettings","as","panelId","defaultValues","value","attributeKeys","hasSupport"],"sources":["@wordpress/block-editor/src/hooks/background.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { getBlockSupport } from '@wordpress/blocks';\nimport { useSelect } from '@wordpress/data';\nimport { useCallback } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport InspectorControls from '../components/inspector-controls';\nimport { cleanEmptyObject } from './utils';\nimport { store as blockEditorStore } from '../store';\nimport {\n\tdefault as StylesBackgroundPanel,\n\tuseHasBackgroundPanel,\n\thasBackgroundImageValue,\n} from '../components/global-styles/background-panel';\nimport { globalStylesDataKey } from '../store/private-keys';\n\nexport const BACKGROUND_SUPPORT_KEY = 'background';\n\n// Initial control values.\nexport const BACKGROUND_BLOCK_DEFAULT_VALUES = {\n\tbackgroundSize: 'cover',\n\tbackgroundPosition: '50% 50%', // used only when backgroundSize is 'contain'.\n};\n\n/**\n * Determine whether there is block support for background.\n *\n * @param {string} blockName Block name.\n * @param {string} feature Background image feature to check for.\n *\n * @return {boolean} Whether there is support.\n */\nexport function hasBackgroundSupport( blockName, feature = 'any' ) {\n\tconst support = getBlockSupport( blockName, BACKGROUND_SUPPORT_KEY );\n\n\tif ( support === true ) {\n\t\treturn true;\n\t}\n\n\tif ( feature === 'any' ) {\n\t\treturn (\n\t\t\t!! support?.backgroundImage ||\n\t\t\t!! support?.backgroundSize ||\n\t\t\t!! support?.backgroundRepeat\n\t\t);\n\t}\n\n\treturn !! support?.[ feature ];\n}\n\nexport function setBackgroundStyleDefaults( backgroundStyle ) {\n\tif ( ! backgroundStyle || ! backgroundStyle?.backgroundImage?.url ) {\n\t\treturn;\n\t}\n\n\tlet backgroundStylesWithDefaults;\n\n\t// Set block background defaults.\n\tif ( ! backgroundStyle?.backgroundSize ) {\n\t\tbackgroundStylesWithDefaults = {\n\t\t\tbackgroundSize: BACKGROUND_BLOCK_DEFAULT_VALUES.backgroundSize,\n\t\t};\n\t}\n\n\tif (\n\t\t'contain' === backgroundStyle?.backgroundSize &&\n\t\t! backgroundStyle?.backgroundPosition\n\t) {\n\t\tbackgroundStylesWithDefaults = {\n\t\t\tbackgroundPosition:\n\t\t\t\tBACKGROUND_BLOCK_DEFAULT_VALUES.backgroundPosition,\n\t\t};\n\t}\n\treturn backgroundStylesWithDefaults;\n}\n\nfunction useBlockProps( { name, style } ) {\n\tif (\n\t\t! hasBackgroundSupport( name ) ||\n\t\t! style?.background?.backgroundImage\n\t) {\n\t\treturn;\n\t}\n\n\tconst backgroundStyles = setBackgroundStyleDefaults( style?.background );\n\n\tif ( ! backgroundStyles ) {\n\t\treturn;\n\t}\n\n\treturn {\n\t\tstyle: {\n\t\t\t...backgroundStyles,\n\t\t},\n\t};\n}\n\n/**\n * Generates a CSS class name if an background image is set.\n *\n * @param {Object} style A block's style attribute.\n *\n * @return {string} CSS class name.\n */\nexport function getBackgroundImageClasses( style ) {\n\treturn hasBackgroundImageValue( style ) ? 'has-background' : '';\n}\n\nfunction BackgroundInspectorControl( { children } ) {\n\tconst resetAllFilter = useCallback( ( attributes ) => {\n\t\treturn {\n\t\t\t...attributes,\n\t\t\tstyle: {\n\t\t\t\t...attributes.style,\n\t\t\t\tbackground: undefined,\n\t\t\t},\n\t\t};\n\t}, [] );\n\treturn (\n\t\t<InspectorControls group=\"background\" resetAllFilter={ resetAllFilter }>\n\t\t\t{ children }\n\t\t</InspectorControls>\n\t);\n}\n\nexport function BackgroundImagePanel( {\n\tclientId,\n\tname,\n\tsetAttributes,\n\tsettings,\n} ) {\n\tconst { style, inheritedValue } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockAttributes, getSettings } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst _settings = getSettings();\n\t\t\treturn {\n\t\t\t\tstyle: getBlockAttributes( clientId )?.style,\n\t\t\t\t/*\n\t\t\t\t * To ensure we pass down the right inherited values:\n\t\t\t\t * @TODO 1. Pass inherited value down to all block style controls,\n\t\t\t\t * See: packages/block-editor/src/hooks/style.js\n\t\t\t\t * @TODO 2. Add support for block style variations,\n\t\t\t\t * See implementation: packages/block-editor/src/hooks/block-style-variation.js\n\t\t\t\t */\n\t\t\t\tinheritedValue:\n\t\t\t\t\t_settings[ globalStylesDataKey ]?.blocks?.[ name ],\n\t\t\t};\n\t\t},\n\t\t[ clientId, name ]\n\t);\n\n\tif (\n\t\t! useHasBackgroundPanel( settings ) ||\n\t\t! hasBackgroundSupport( name, 'backgroundImage' )\n\t) {\n\t\treturn null;\n\t}\n\n\tconst onChange = ( newStyle ) => {\n\t\tsetAttributes( {\n\t\t\tstyle: cleanEmptyObject( newStyle ),\n\t\t} );\n\t};\n\n\tconst updatedSettings = {\n\t\t...settings,\n\t\tbackground: {\n\t\t\t...settings.background,\n\t\t\tbackgroundSize:\n\t\t\t\tsettings?.background?.backgroundSize &&\n\t\t\t\thasBackgroundSupport( name, 'backgroundSize' ),\n\t\t},\n\t};\n\n\treturn (\n\t\t<StylesBackgroundPanel\n\t\t\tinheritedValue={ inheritedValue }\n\t\t\tas={ BackgroundInspectorControl }\n\t\t\tpanelId={ clientId }\n\t\t\tdefaultValues={ BACKGROUND_BLOCK_DEFAULT_VALUES }\n\t\t\tsettings={ updatedSettings }\n\t\t\tonChange={ onChange }\n\t\t\tvalue={ style }\n\t\t/>\n\t);\n}\n\nexport default {\n\tuseBlockProps,\n\tattributeKeys: [ 'style' ],\n\thasSupport: hasBackgroundSupport,\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,eAAe,QAAQ,mBAAmB;AACnD,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,WAAW,QAAQ,oBAAoB;;AAEhD;AACA;AACA;AACA,OAAOC,iBAAiB,MAAM,kCAAkC;AAChE,SAASC,gBAAgB,QAAQ,SAAS;AAC1C,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,UAAU;AACpD,SACCC,OAAO,IAAIC,qBAAqB,EAChCC,qBAAqB,EACrBC,uBAAuB,QACjB,8CAA8C;AACrD,SAASC,mBAAmB,QAAQ,uBAAuB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE5D,OAAO,MAAMC,sBAAsB,GAAG,YAAY;;AAElD;AACA,OAAO,MAAMC,+BAA+B,GAAG;EAC9CC,cAAc,EAAE,OAAO;EACvBC,kBAAkB,EAAE,SAAS,CAAE;AAChC,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,oBAAoBA,CAAEC,SAAS,EAAEC,OAAO,GAAG,KAAK,EAAG;EAClE,MAAMC,OAAO,GAAGrB,eAAe,CAAEmB,SAAS,EAAEL,sBAAuB,CAAC;EAEpE,IAAKO,OAAO,KAAK,IAAI,EAAG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AAGT,QAAQ;IACXZ,UAAU,EAAE;MACX,GAAGY,QAAQ,CAACZ,UAAU;MACtBf,cAAc,EACb2B,QAAQ,EAAEZ,UAAU,EAAEf,cAAc,IACpCE,oBAAoB,CAAEW,IAAI,EAAE,gBAAiB;IAC/C;EACD,CAAC;EAED,oBACChB,IAAA,CAACL,qBAAqB;IACrBoC,cAAc,EAAGA,cAAgB;IACjCS,EAAE,EAAGnB,0BAA4B;IACjCoB,OAAO,EAAGb,QAAU;IACpBc,aAAa,EAAGxC,+BAAiC;IACjD4B,QAAQ,EAAGS,eAAiB;IAC5BF,QAAQ,EAAGA,QAAU;IACrBM,KAAK,EAAG1B;EAAO,CACf,CAAC;AAEJ;AAEA,eAAe;EACdF,aAAa;EACb6B,aAAa,EAAE,CAAE,OAAO,CAAE;EAC1BC,UAAU,EAAExC;AACb,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["getBlockSupport","useSelect","useCallback","InspectorControls","cleanEmptyObject","store","blockEditorStore","default","StylesBackgroundPanel","useHasBackgroundPanel","hasBackgroundImageValue","globalStylesDataKey","jsx","_jsx","BACKGROUND_SUPPORT_KEY","BACKGROUND_BLOCK_DEFAULT_VALUES","backgroundSize","backgroundPosition","hasBackgroundSupport","blockName","feature","support","backgroundImage","backgroundRepeat","setBackgroundStyleDefaults","backgroundStyle","url","backgroundStylesWithDefaults","useBlockProps","name","style","background","backgroundStyles","getBackgroundImageClasses","BackgroundInspectorControl","children","resetAllFilter","attributes","undefined","group","BackgroundImagePanel","clientId","setAttributes","settings","inheritedValue","select","getBlockAttributes","getSettings","_settings","blocks","onChange","newStyle","updatedSettings","defaultControls","as","panelId","defaultValues","value","attributeKeys","hasSupport"],"sources":["@wordpress/block-editor/src/hooks/background.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { getBlockSupport } from '@wordpress/blocks';\nimport { useSelect } from '@wordpress/data';\nimport { useCallback } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport InspectorControls from '../components/inspector-controls';\nimport { cleanEmptyObject } from './utils';\nimport { store as blockEditorStore } from '../store';\nimport {\n\tdefault as StylesBackgroundPanel,\n\tuseHasBackgroundPanel,\n\thasBackgroundImageValue,\n} from '../components/global-styles/background-panel';\nimport { globalStylesDataKey } from '../store/private-keys';\n\nexport const BACKGROUND_SUPPORT_KEY = 'background';\n\n// Initial control values.\nexport const BACKGROUND_BLOCK_DEFAULT_VALUES = {\n\tbackgroundSize: 'cover',\n\tbackgroundPosition: '50% 50%', // used only when backgroundSize is 'contain'.\n};\n\n/**\n * Determine whether there is block support for background.\n *\n * @param {string} blockName Block name.\n * @param {string} feature Background image feature to check for.\n *\n * @return {boolean} Whether there is support.\n */\nexport function hasBackgroundSupport( blockName, feature = 'any' ) {\n\tconst support = getBlockSupport( blockName, BACKGROUND_SUPPORT_KEY );\n\n\tif ( support === true ) {\n\t\treturn true;\n\t}\n\n\tif ( feature === 'any' ) {\n\t\treturn (\n\t\t\t!! support?.backgroundImage ||\n\t\t\t!! support?.backgroundSize ||\n\t\t\t!! support?.backgroundRepeat\n\t\t);\n\t}\n\n\treturn !! support?.[ feature ];\n}\n\nexport function setBackgroundStyleDefaults( backgroundStyle ) {\n\tif ( ! backgroundStyle || ! backgroundStyle?.backgroundImage?.url ) {\n\t\treturn;\n\t}\n\n\tlet backgroundStylesWithDefaults;\n\n\t// Set block background defaults.\n\tif ( ! backgroundStyle?.backgroundSize ) {\n\t\tbackgroundStylesWithDefaults = {\n\t\t\tbackgroundSize: BACKGROUND_BLOCK_DEFAULT_VALUES.backgroundSize,\n\t\t};\n\t}\n\n\tif (\n\t\t'contain' === backgroundStyle?.backgroundSize &&\n\t\t! backgroundStyle?.backgroundPosition\n\t) {\n\t\tbackgroundStylesWithDefaults = {\n\t\t\tbackgroundPosition:\n\t\t\t\tBACKGROUND_BLOCK_DEFAULT_VALUES.backgroundPosition,\n\t\t};\n\t}\n\treturn backgroundStylesWithDefaults;\n}\n\nfunction useBlockProps( { name, style } ) {\n\tif (\n\t\t! hasBackgroundSupport( name ) ||\n\t\t! style?.background?.backgroundImage\n\t) {\n\t\treturn;\n\t}\n\n\tconst backgroundStyles = setBackgroundStyleDefaults( style?.background );\n\n\tif ( ! backgroundStyles ) {\n\t\treturn;\n\t}\n\n\treturn {\n\t\tstyle: {\n\t\t\t...backgroundStyles,\n\t\t},\n\t};\n}\n\n/**\n * Generates a CSS class name if an background image is set.\n *\n * @param {Object} style A block's style attribute.\n *\n * @return {string} CSS class name.\n */\nexport function getBackgroundImageClasses( style ) {\n\treturn hasBackgroundImageValue( style ) ? 'has-background' : '';\n}\n\nfunction BackgroundInspectorControl( { children } ) {\n\tconst resetAllFilter = useCallback( ( attributes ) => {\n\t\treturn {\n\t\t\t...attributes,\n\t\t\tstyle: {\n\t\t\t\t...attributes.style,\n\t\t\t\tbackground: undefined,\n\t\t\t},\n\t\t};\n\t}, [] );\n\treturn (\n\t\t<InspectorControls group=\"background\" resetAllFilter={ resetAllFilter }>\n\t\t\t{ children }\n\t\t</InspectorControls>\n\t);\n}\n\nexport function BackgroundImagePanel( {\n\tclientId,\n\tname,\n\tsetAttributes,\n\tsettings,\n} ) {\n\tconst { style, inheritedValue } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockAttributes, getSettings } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst _settings = getSettings();\n\t\t\treturn {\n\t\t\t\tstyle: getBlockAttributes( clientId )?.style,\n\t\t\t\t/*\n\t\t\t\t * To ensure we pass down the right inherited values:\n\t\t\t\t * @TODO 1. Pass inherited value down to all block style controls,\n\t\t\t\t * See: packages/block-editor/src/hooks/style.js\n\t\t\t\t * @TODO 2. Add support for block style variations,\n\t\t\t\t * See implementation: packages/block-editor/src/hooks/block-style-variation.js\n\t\t\t\t */\n\t\t\t\tinheritedValue:\n\t\t\t\t\t_settings[ globalStylesDataKey ]?.blocks?.[ name ],\n\t\t\t};\n\t\t},\n\t\t[ clientId, name ]\n\t);\n\n\tif (\n\t\t! useHasBackgroundPanel( settings ) ||\n\t\t! hasBackgroundSupport( name, 'backgroundImage' )\n\t) {\n\t\treturn null;\n\t}\n\n\tconst onChange = ( newStyle ) => {\n\t\tsetAttributes( {\n\t\t\tstyle: cleanEmptyObject( newStyle ),\n\t\t} );\n\t};\n\n\tconst updatedSettings = {\n\t\t...settings,\n\t\tbackground: {\n\t\t\t...settings.background,\n\t\t\tbackgroundSize:\n\t\t\t\tsettings?.background?.backgroundSize &&\n\t\t\t\thasBackgroundSupport( name, 'backgroundSize' ),\n\t\t},\n\t};\n\n\tconst defaultControls = getBlockSupport( name, [\n\t\tBACKGROUND_SUPPORT_KEY,\n\t\t'defaultControls',\n\t] );\n\n\treturn (\n\t\t<StylesBackgroundPanel\n\t\t\tinheritedValue={ inheritedValue }\n\t\t\tas={ BackgroundInspectorControl }\n\t\t\tpanelId={ clientId }\n\t\t\tdefaultValues={ BACKGROUND_BLOCK_DEFAULT_VALUES }\n\t\t\tsettings={ updatedSettings }\n\t\t\tonChange={ onChange }\n\t\t\tdefaultControls={ defaultControls }\n\t\t\tvalue={ style }\n\t\t/>\n\t);\n}\n\nexport default {\n\tuseBlockProps,\n\tattributeKeys: [ 'style' ],\n\thasSupport: hasBackgroundSupport,\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,eAAe,QAAQ,mBAAmB;AACnD,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,WAAW,QAAQ,oBAAoB;;AAEhD;AACA;AACA;AACA,OAAOC,iBAAiB,MAAM,kCAAkC;AAChE,SAASC,gBAAgB,QAAQ,SAAS;AAC1C,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,UAAU;AACpD,SACCC,OAAO,IAAIC,qBAAqB,EAChCC,qBAAqB,EACrBC,uBAAuB,QACjB,8CAA8C;AACrD,SAASC,mBAAmB,QAAQ,uBAAuB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE5D,OAAO,MAAMC,sBAAsB,GAAG,YAAY;;AAElD;AACA,OAAO,MAA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B,CAAC;EAED,IACC,CAAEpB,qBAAqB,CAAEkC,QAAS,CAAC,IACnC,CAAEzB,oBAAoB,CAAEW,IAAI,EAAE,iBAAkB,CAAC,EAChD;IACD,OAAO,IAAI;EACZ;EAEA,MAAMqB,QAAQ,GAAKC,QAAQ,IAAM;IAChCT,aAAa,CAAE;MACdZ,KAAK,EAAE1B,gBAAgB,CAAE+C,QAAS;IACnC,CAAE,CAAC;EACJ,CAAC;EAED,MAAMC,eAAe,GAAG;IACvB,GAAGT,QAAQ;IACXZ,UAAU,EAAE;MACX,GAAGY,QAAQ,CAACZ,UAAU;MACtBf,cAAc,EACb2B,QAAQ,EAAEZ,UAAU,EAAEf,cAAc,IACpCE,oBAAoB,CAAEW,IAAI,EAAE,gBAAiB;IAC/C;EACD,CAAC;EAED,MAAMwB,eAAe,GAAGrD,eAAe,CAAE6B,IAAI,EAAE,CAC9Cf,sBAAsB,EACtB,iBAAiB,CAChB,CAAC;EAEH,oBACCD,IAAA,CAACL,qBAAqB;IACrBoC,cAAc,EAAGA,cAAgB;IACjCU,EAAE,EAAGpB,0BAA4B;IACjCqB,OAAO,EAAGd,QAAU;IACpBe,aAAa,EAAGzC,+BAAiC;IACjD4B,QAAQ,EAAGS,eAAiB;IAC5BF,QAAQ,EAAGA,QAAU;IACrBG,eAAe,EAAGA,eAAiB;IACnCI,KAAK,EAAG3B;EAAO,CACf,CAAC;AAEJ;AAEA,eAAe;EACdF,aAAa;EACb8B,aAAa,EAAE,CAAE,OAAO,CAAE;EAC1BC,UAAU,EAAEzC;AACb,CAAC","ignoreList":[]}
@@ -1,3 +1,4 @@
1
+ /* wp:polyfill */
1
2
  /**
2
3
  * WordPress dependencies
3
4
  */
@@ -11,12 +12,11 @@ import { useViewportMatch } from '@wordpress/compose';
11
12
  /**
12
13
  * Internal dependencies
13
14
  */
14
- import { canBindAttribute, getBindableAttributes } from '../hooks/use-bindings-attributes';
15
+ import { canBindAttribute, getBindableAttributes, useBlockBindingsUtils } from '../utils/block-bindings';
15
16
  import { unlock } from '../lock-unlock';
16
17
  import InspectorControls from '../components/inspector-controls';
17
18
  import BlockContext from '../components/block-context';
18
19
  import { useBlockEditContext } from '../components/block-edit';
19
- import { useBlockBindingsUtils } from '../utils/block-bindings';
20
20
  import { store as blockEditorStore } from '../store';
21
21
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
22
22
  const {
@@ -33,7 +33,7 @@ const useToolsPanelDropdownMenuProps = () => {
33
33
  }
34
34
  } : {};
35
35
  };
36
- function BlockBindingsPanelDropdown({
36
+ function BlockBindingsPanelMenuContent({
37
37
  fieldsList,
38
38
  attribute,
39
39
  binding
@@ -139,21 +139,23 @@ function EditableBlockBindingsPanelItems({
139
139
  [attribute]: undefined
140
140
  });
141
141
  },
142
- children: /*#__PURE__*/_jsx(Menu, {
142
+ children: /*#__PURE__*/_jsxs(Menu, {
143
143
  placement: isMobile ? 'bottom-start' : 'left-start',
144
- gutter: isMobile ? 8 : 36,
145
- trigger: /*#__PURE__*/_jsx(Item, {
144
+ children: [/*#__PURE__*/_jsx(Menu.TriggerButton, {
145
+ render: /*#__PURE__*/_jsx(Item, {}),
146
146
  children: /*#__PURE__*/_jsx(BlockBindingsAttribute, {
147
147
  attribute: attribute,
148
148
  binding: binding,
149
149
  fieldsList: fieldsList
150
150
  })
151
- }),
152
- children: /*#__PURE__*/_jsx(BlockBindingsPanelDropdown, {
153
- fieldsList: fieldsList,
154
- attribute: attribute,
155
- binding: binding
156
- })
151
+ }), /*#__PURE__*/_jsx(Menu.Popover, {
152
+ gutter: isMobile ? 8 : 36,
153
+ children: /*#__PURE__*/_jsx(BlockBindingsPanelMenuContent, {
154
+ fieldsList: fieldsList,
155
+ attribute: attribute,
156
+ binding: binding
157
+ })
158
+ })]
157
159
  })
158
160
  }, attribute);
159
161
  })
@@ -1 +1 @@
1
- {"version":3,"names":["__","getBlockBindingsSource","getBlockBindingsSources","getBlockType","__experimentalItemGroup","ItemGroup","__experimentalItem","Item","__experimentalText","Text","__experimentalToolsPanel","ToolsPanel","__experimentalToolsPanelItem","ToolsPanelItem","__experimentalVStack","VStack","privateApis","componentsPrivateApis","useSelect","useContext","Fragment","useViewportMatch","canBindAttribute","getBindableAttributes","unlock","InspectorControls","BlockContext","useBlockEditContext","useBlockBindingsUtils","store","blockEditorStore","jsx","_jsx","jsxs","_jsxs","_Fragment","Menu","EMPTY_OBJECT","useToolsPanelDropdownMenuProps","isMobile","popoverProps","placement","offset","BlockBindingsPanelDropdown","fieldsList","attribute","binding","clientId","registeredSources","updateBlockBindings","currentKey","args","key","attributeType","select","name","blockName","getBlock","_attributeType","attributes","type","children","Object","entries","map","fields","i","Group","keys","length","GroupLabel","label","filter","RadioItem","onChange","source","value","checked","ItemLabel","ItemHelpText","Separator","BlockBindingsAttribute","sourceName","sourceProps","isSourceInvalid","className","spacing","truncate","variant","isDestructive","ReadOnlyBlockBindingsPanelItems","bindings","EditableBlockBindingsPanelItems","hasValue","onDeselect","undefined","gutter","trigger","BlockBindingsPanel","metadata","blockContext","removeAllBlockBindings","bindableAttributes","dropdownMenuProps","_fieldsList","canUpdateBlockBindings","forEach","getFieldsList","usesContext","context","sourceList","values","getSettings","filteredBindings","readOnly","group","resetAll","isBordered","isSeparated","as","edit","attributeKeys","hasSupport"],"sources":["@wordpress/block-editor/src/hooks/block-bindings.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\tgetBlockBindingsSource,\n\tgetBlockBindingsSources,\n\tgetBlockType,\n} from '@wordpress/blocks';\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\t__experimentalItem as Item,\n\t__experimentalText as Text,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n\t__experimentalVStack as VStack,\n\tprivateApis as componentsPrivateApis,\n} from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { useContext, Fragment } from '@wordpress/element';\nimport { useViewportMatch } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport {\n\tcanBindAttribute,\n\tgetBindableAttributes,\n} from '../hooks/use-bindings-attributes';\nimport { unlock } from '../lock-unlock';\nimport InspectorControls from '../components/inspector-controls';\nimport BlockContext from '../components/block-context';\nimport { useBlockEditContext } from '../components/block-edit';\nimport { useBlockBindingsUtils } from '../utils/block-bindings';\nimport { store as blockEditorStore } from '../store';\n\nconst { Menu } = unlock( componentsPrivateApis );\n\nconst EMPTY_OBJECT = {};\n\nconst useToolsPanelDropdownMenuProps = () => {\n\tconst isMobile = useViewportMatch( 'medium', '<' );\n\treturn ! isMobile\n\t\t? {\n\t\t\t\tpopoverProps: {\n\t\t\t\t\tplacement: 'left-start',\n\t\t\t\t\t// For non-mobile, inner sidebar width (248px) - button width (24px) - border (1px) + padding (16px) + spacing (20px)\n\t\t\t\t\toffset: 259,\n\t\t\t\t},\n\t\t }\n\t\t: {};\n};\n\nfunction BlockBindingsPanelDropdown( { fieldsList, attribute, binding } ) {\n\tconst { clientId } = useBlockEditContext();\n\tconst registeredSources = getBlockBindingsSources();\n\tconst { updateBlockBindings } = useBlockBindingsUtils();\n\tconst currentKey = binding?.args?.key;\n\tconst attributeType = useSelect(\n\t\t( select ) => {\n\t\t\tconst { name: blockName } =\n\t\t\t\tselect( blockEditorStore ).getBlock( clientId );\n\t\t\tconst _attributeType =\n\t\t\t\tgetBlockType( blockName ).attributes?.[ attribute ]?.type;\n\t\t\treturn _attributeType === 'rich-text' ? 'string' : _attributeType;\n\t\t},\n\t\t[ clientId, attribute ]\n\t);\n\treturn (\n\t\t<>\n\t\t\t{ Object.entries( fieldsList ).map( ( [ name, fields ], i ) => (\n\t\t\t\t<Fragment key={ name }>\n\t\t\t\t\t<Menu.Group>\n\t\t\t\t\t\t{ Object.keys( fieldsList ).length > 1 && (\n\t\t\t\t\t\t\t<Menu.GroupLabel>\n\t\t\t\t\t\t\t\t{ registeredSources[ name ].label }\n\t\t\t\t\t\t\t</Menu.GroupLabel>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ Object.entries( fields )\n\t\t\t\t\t\t\t.filter(\n\t\t\t\t\t\t\t\t( [ , args ] ) => args?.type === attributeType\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t.map( ( [ key, args ] ) => (\n\t\t\t\t\t\t\t\t<Menu.RadioItem\n\t\t\t\t\t\t\t\t\tkey={ key }\n\t\t\t\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\t\t\t\tupdateBlockBindings( {\n\t\t\t\t\t\t\t\t\t\t\t[ attribute ]: {\n\t\t\t\t\t\t\t\t\t\t\t\tsource: name,\n\t\t\t\t\t\t\t\t\t\t\t\targs: { key },\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tname={ attribute + '-binding' }\n\t\t\t\t\t\t\t\t\tvalue={ key }\n\t\t\t\t\t\t\t\t\tchecked={ key === currentKey }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<Menu.ItemLabel>\n\t\t\t\t\t\t\t\t\t\t{ args?.label }\n\t\t\t\t\t\t\t\t\t</Menu.ItemLabel>\n\t\t\t\t\t\t\t\t\t<Menu.ItemHelpText>\n\t\t\t\t\t\t\t\t\t\t{ args?.value }\n\t\t\t\t\t\t\t\t\t</Menu.ItemHelpText>\n\t\t\t\t\t\t\t\t</Menu.RadioItem>\n\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t</Menu.Group>\n\t\t\t\t\t{ i !== Object.keys( fieldsList ).length - 1 && (\n\t\t\t\t\t\t<Menu.Separator />\n\t\t\t\t\t) }\n\t\t\t\t</Fragment>\n\t\t\t) ) }\n\t\t</>\n\t);\n}\n\nfunction BlockBindingsAttribute( { attribute, binding, fieldsList } ) {\n\tconst { source: sourceName, args } = binding || {};\n\tconst sourceProps = getBlockBindingsSource( sourceName );\n\tconst isSourceInvalid = ! sourceProps;\n\treturn (\n\t\t<VStack className=\"block-editor-bindings__item\" spacing={ 0 }>\n\t\t\t<Text truncate>{ attribute }</Text>\n\t\t\t{ !! binding && (\n\t\t\t\t<Text\n\t\t\t\t\ttruncate\n\t\t\t\t\tvariant={ ! isSourceInvalid && 'muted' }\n\t\t\t\t\tisDestructive={ isSourceInvalid }\n\t\t\t\t>\n\t\t\t\t\t{ isSourceInvalid\n\t\t\t\t\t\t? __( 'Invalid source' )\n\t\t\t\t\t\t: fieldsList?.[ sourceName ]?.[ args?.key ]?.label ||\n\t\t\t\t\t\t sourceProps?.label ||\n\t\t\t\t\t\t sourceName }\n\t\t\t\t</Text>\n\t\t\t) }\n\t\t</VStack>\n\t);\n}\n\nfunction ReadOnlyBlockBindingsPanelItems( { bindings, fieldsList } ) {\n\treturn (\n\t\t<>\n\t\t\t{ Object.entries( bindings ).map( ( [ attribute, binding ] ) => (\n\t\t\t\t<Item key={ attribute }>\n\t\t\t\t\t<BlockBindingsAttribute\n\t\t\t\t\t\tattribute={ attribute }\n\t\t\t\t\t\tbinding={ binding }\n\t\t\t\t\t\tfieldsList={ fieldsList }\n\t\t\t\t\t/>\n\t\t\t\t</Item>\n\t\t\t) ) }\n\t\t</>\n\t);\n}\n\nfunction EditableBlockBindingsPanelItems( {\n\tattributes,\n\tbindings,\n\tfieldsList,\n} ) {\n\tconst { updateBlockBindings } = useBlockBindingsUtils();\n\tconst isMobile = useViewportMatch( 'medium', '<' );\n\treturn (\n\t\t<>\n\t\t\t{ attributes.map( ( attribute ) => {\n\t\t\t\tconst binding = bindings[ attribute ];\n\t\t\t\treturn (\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tkey={ attribute }\n\t\t\t\t\t\thasValue={ () => !! binding }\n\t\t\t\t\t\tlabel={ attribute }\n\t\t\t\t\t\tonDeselect={ () => {\n\t\t\t\t\t\t\tupdateBlockBindings( {\n\t\t\t\t\t\t\t\t[ attribute ]: undefined,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t<Menu\n\t\t\t\t\t\t\tplacement={\n\t\t\t\t\t\t\t\tisMobile ? 'bottom-start' : 'left-start'\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tgutter={ isMobile ? 8 : 36 }\n\t\t\t\t\t\t\ttrigger={\n\t\t\t\t\t\t\t\t<Item>\n\t\t\t\t\t\t\t\t\t<BlockBindingsAttribute\n\t\t\t\t\t\t\t\t\t\tattribute={ attribute }\n\t\t\t\t\t\t\t\t\t\tbinding={ binding }\n\t\t\t\t\t\t\t\t\t\tfieldsList={ fieldsList }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</Item>\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<BlockBindingsPanelDropdown\n\t\t\t\t\t\t\t\tfieldsList={ fieldsList }\n\t\t\t\t\t\t\t\tattribute={ attribute }\n\t\t\t\t\t\t\t\tbinding={ binding }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</Menu>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</>\n\t);\n}\n\nexport const BlockBindingsPanel = ( { name: blockName, metadata } ) => {\n\tconst blockContext = useContext( BlockContext );\n\tconst { removeAllBlockBindings } = useBlockBindingsUtils();\n\tconst bindableAttributes = getBindableAttributes( blockName );\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\t// `useSelect` is used purposely here to ensure `getFieldsList`\n\t// is updated whenever there are updates in block context.\n\t// `source.getFieldsList` may also call a selector via `select`.\n\tconst _fieldsList = {};\n\tconst { fieldsList, canUpdateBlockBindings } = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! bindableAttributes || bindableAttributes.length === 0 ) {\n\t\t\t\treturn EMPTY_OBJECT;\n\t\t\t}\n\t\t\tconst registeredSources = getBlockBindingsSources();\n\t\t\tObject.entries( registeredSources ).forEach(\n\t\t\t\t( [ sourceName, { getFieldsList, usesContext } ] ) => {\n\t\t\t\t\tif ( getFieldsList ) {\n\t\t\t\t\t\t// Populate context.\n\t\t\t\t\t\tconst context = {};\n\t\t\t\t\t\tif ( usesContext?.length ) {\n\t\t\t\t\t\t\tfor ( const key of usesContext ) {\n\t\t\t\t\t\t\t\tcontext[ key ] = blockContext[ key ];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst sourceList = getFieldsList( {\n\t\t\t\t\t\t\tselect,\n\t\t\t\t\t\t\tcontext,\n\t\t\t\t\t\t} );\n\t\t\t\t\t\t// Only add source if the list is not empty.\n\t\t\t\t\t\tif ( Object.keys( sourceList || {} ).length ) {\n\t\t\t\t\t\t\t_fieldsList[ sourceName ] = { ...sourceList };\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\t\t\treturn {\n\t\t\t\tfieldsList:\n\t\t\t\t\tObject.values( _fieldsList ).length > 0\n\t\t\t\t\t\t? _fieldsList\n\t\t\t\t\t\t: EMPTY_OBJECT,\n\t\t\t\tcanUpdateBlockBindings:\n\t\t\t\t\tselect( blockEditorStore ).getSettings()\n\t\t\t\t\t\t.canUpdateBlockBindings,\n\t\t\t};\n\t\t},\n\t\t[ blockContext, bindableAttributes ]\n\t);\n\t// Return early if there are no bindable attributes.\n\tif ( ! bindableAttributes || bindableAttributes.length === 0 ) {\n\t\treturn null;\n\t}\n\t// Filter bindings to only show bindable attributes and remove pattern overrides.\n\tconst { bindings } = metadata || {};\n\tconst filteredBindings = { ...bindings };\n\tObject.keys( filteredBindings ).forEach( ( key ) => {\n\t\tif (\n\t\t\t! canBindAttribute( blockName, key ) ||\n\t\t\tfilteredBindings[ key ].source === 'core/pattern-overrides'\n\t\t) {\n\t\t\tdelete filteredBindings[ key ];\n\t\t}\n\t} );\n\n\t// Lock the UI when the user can't update bindings or there are no fields to connect to.\n\tconst readOnly =\n\t\t! canUpdateBlockBindings || ! Object.keys( fieldsList ).length;\n\n\tif ( readOnly && Object.keys( filteredBindings ).length === 0 ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<InspectorControls group=\"bindings\">\n\t\t\t<ToolsPanel\n\t\t\t\tlabel={ __( 'Attributes' ) }\n\t\t\t\tresetAll={ () => {\n\t\t\t\t\tremoveAllBlockBindings();\n\t\t\t\t} }\n\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\tclassName=\"block-editor-bindings__panel\"\n\t\t\t>\n\t\t\t\t<ItemGroup isBordered isSeparated>\n\t\t\t\t\t{ readOnly ? (\n\t\t\t\t\t\t<ReadOnlyBlockBindingsPanelItems\n\t\t\t\t\t\t\tbindings={ filteredBindings }\n\t\t\t\t\t\t\tfieldsList={ fieldsList }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<EditableBlockBindingsPanelItems\n\t\t\t\t\t\t\tattributes={ bindableAttributes }\n\t\t\t\t\t\t\tbindings={ filteredBindings }\n\t\t\t\t\t\t\tfieldsList={ fieldsList }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</ItemGroup>\n\t\t\t\t{ /*\n\t\t\t\t\tUse a div element to make the ToolsPanelHiddenInnerWrapper\n\t\t\t\t\ttoggle the visibility of this help text automatically.\n\t\t\t\t*/ }\n\t\t\t\t<Text as=\"div\" variant=\"muted\">\n\t\t\t\t\t<p>\n\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t'Attributes connected to custom fields or other dynamic data.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t</p>\n\t\t\t\t</Text>\n\t\t\t</ToolsPanel>\n\t\t</InspectorControls>\n\t);\n};\n\nexport default {\n\tedit: BlockBindingsPanel,\n\tattributeKeys: [ 'metadata' ],\n\thasSupport() {\n\t\treturn true;\n\t},\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SACCC,sBAAsB,EACtBC,uBAAuB,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AAC,CACC;MAAC,CACC,CAAC;IAAA,CACI;EAAC,CACK,CAAC;AAEtB,CAAC;AAED,eAAe;EACdwH,IAAI,EAAEtB,kBAAkB;EACxBuB,aAAa,EAAE,CAAE,UAAU,CAAE;EAC7BC,UAAUA,CAAA,EAAG;IACZ,OAAO,IAAI;EACZ;AACD,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["__","getBlockBindingsSource","getBlockBindingsSources","getBlockType","__experimentalItemGroup","ItemGroup","__experimentalItem","Item","__experimentalText","Text","__experimentalToolsPanel","ToolsPanel","__experimentalToolsPanelItem","ToolsPanelItem","__experimentalVStack","VStack","privateApis","componentsPrivateApis","useSelect","useContext","Fragment","useViewportMatch","canBindAttribute","getBindableAttributes","useBlockBindingsUtils","unlock","InspectorControls","BlockContext","useBlockEditContext","store","blockEditorStore","jsx","_jsx","jsxs","_jsxs","_Fragment","Menu","EMPTY_OBJECT","useToolsPanelDropdownMenuProps","isMobile","popoverProps","placement","offset","BlockBindingsPanelMenuContent","fieldsList","attribute","binding","clientId","registeredSources","updateBlockBindings","currentKey","args","key","attributeType","select","name","blockName","getBlock","_attributeType","attributes","type","children","Object","entries","map","fields","i","Group","keys","length","GroupLabel","label","filter","RadioItem","onChange","source","value","checked","ItemLabel","ItemHelpText","Separator","BlockBindingsAttribute","sourceName","sourceProps","isSourceInvalid","className","spacing","truncate","variant","isDestructive","ReadOnlyBlockBindingsPanelItems","bindings","EditableBlockBindingsPanelItems","hasValue","onDeselect","undefined","TriggerButton","render","Popover","gutter","BlockBindingsPanel","metadata","blockContext","removeAllBlockBindings","bindableAttributes","dropdownMenuProps","_fieldsList","canUpdateBlockBindings","forEach","getFieldsList","usesContext","context","sourceList","values","getSettings","filteredBindings","readOnly","group","resetAll","isBordered","isSeparated","as","edit","attributeKeys","hasSupport"],"sources":["@wordpress/block-editor/src/hooks/block-bindings.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\tgetBlockBindingsSource,\n\tgetBlockBindingsSources,\n\tgetBlockType,\n} from '@wordpress/blocks';\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\t__experimentalItem as Item,\n\t__experimentalText as Text,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n\t__experimentalVStack as VStack,\n\tprivateApis as componentsPrivateApis,\n} from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { useContext, Fragment } from '@wordpress/element';\nimport { useViewportMatch } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport {\n\tcanBindAttribute,\n\tgetBindableAttributes,\n\tuseBlockBindingsUtils,\n} from '../utils/block-bindings';\nimport { unlock } from '../lock-unlock';\nimport InspectorControls from '../components/inspector-controls';\nimport BlockContext from '../components/block-context';\nimport { useBlockEditContext } from '../components/block-edit';\nimport { store as blockEditorStore } from '../store';\n\nconst { Menu } = unlock( componentsPrivateApis );\n\nconst EMPTY_OBJECT = {};\n\nconst useToolsPanelDropdownMenuProps = () => {\n\tconst isMobile = useViewportMatch( 'medium', '<' );\n\treturn ! isMobile\n\t\t? {\n\t\t\t\tpopoverProps: {\n\t\t\t\t\tplacement: 'left-start',\n\t\t\t\t\t// For non-mobile, inner sidebar width (248px) - button width (24px) - border (1px) + padding (16px) + spacing (20px)\n\t\t\t\t\toffset: 259,\n\t\t\t\t},\n\t\t }\n\t\t: {};\n};\n\nfunction BlockBindingsPanelMenuContent( { fieldsList, attribute, binding } ) {\n\tconst { clientId } = useBlockEditContext();\n\tconst registeredSources = getBlockBindingsSources();\n\tconst { updateBlockBindings } = useBlockBindingsUtils();\n\tconst currentKey = binding?.args?.key;\n\tconst attributeType = useSelect(\n\t\t( select ) => {\n\t\t\tconst { name: blockName } =\n\t\t\t\tselect( blockEditorStore ).getBlock( clientId );\n\t\t\tconst _attributeType =\n\t\t\t\tgetBlockType( blockName ).attributes?.[ attribute ]?.type;\n\t\t\treturn _attributeType === 'rich-text' ? 'string' : _attributeType;\n\t\t},\n\t\t[ clientId, attribute ]\n\t);\n\treturn (\n\t\t<>\n\t\t\t{ Object.entries( fieldsList ).map( ( [ name, fields ], i ) => (\n\t\t\t\t<Fragment key={ name }>\n\t\t\t\t\t<Menu.Group>\n\t\t\t\t\t\t{ Object.keys( fieldsList ).length > 1 && (\n\t\t\t\t\t\t\t<Menu.GroupLabel>\n\t\t\t\t\t\t\t\t{ registeredSources[ name ].label }\n\t\t\t\t\t\t\t</Menu.GroupLabel>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ Object.entries( fields )\n\t\t\t\t\t\t\t.filter(\n\t\t\t\t\t\t\t\t( [ , args ] ) => args?.type === attributeType\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t.map( ( [ key, args ] ) => (\n\t\t\t\t\t\t\t\t<Menu.RadioItem\n\t\t\t\t\t\t\t\t\tkey={ key }\n\t\t\t\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\t\t\t\tupdateBlockBindings( {\n\t\t\t\t\t\t\t\t\t\t\t[ attribute ]: {\n\t\t\t\t\t\t\t\t\t\t\t\tsource: name,\n\t\t\t\t\t\t\t\t\t\t\t\targs: { key },\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tname={ attribute + '-binding' }\n\t\t\t\t\t\t\t\t\tvalue={ key }\n\t\t\t\t\t\t\t\t\tchecked={ key === currentKey }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<Menu.ItemLabel>\n\t\t\t\t\t\t\t\t\t\t{ args?.label }\n\t\t\t\t\t\t\t\t\t</Menu.ItemLabel>\n\t\t\t\t\t\t\t\t\t<Menu.ItemHelpText>\n\t\t\t\t\t\t\t\t\t\t{ args?.value }\n\t\t\t\t\t\t\t\t\t</Menu.ItemHelpText>\n\t\t\t\t\t\t\t\t</Menu.RadioItem>\n\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t</Menu.Group>\n\t\t\t\t\t{ i !== Object.keys( fieldsList ).length - 1 && (\n\t\t\t\t\t\t<Menu.Separator />\n\t\t\t\t\t) }\n\t\t\t\t</Fragment>\n\t\t\t) ) }\n\t\t</>\n\t);\n}\n\nfunction BlockBindingsAttribute( { attribute, binding, fieldsList } ) {\n\tconst { source: sourceName, args } = binding || {};\n\tconst sourceProps = getBlockBindingsSource( sourceName );\n\tconst isSourceInvalid = ! sourceProps;\n\treturn (\n\t\t<VStack className=\"block-editor-bindings__item\" spacing={ 0 }>\n\t\t\t<Text truncate>{ attribute }</Text>\n\t\t\t{ !! binding && (\n\t\t\t\t<Text\n\t\t\t\t\ttruncate\n\t\t\t\t\tvariant={ ! isSourceInvalid && 'muted' }\n\t\t\t\t\tisDestructive={ isSourceInvalid }\n\t\t\t\t>\n\t\t\t\t\t{ isSourceInvalid\n\t\t\t\t\t\t? __( 'Invalid source' )\n\t\t\t\t\t\t: fieldsList?.[ sourceName ]?.[ args?.key ]?.label ||\n\t\t\t\t\t\t sourceProps?.label ||\n\t\t\t\t\t\t sourceName }\n\t\t\t\t</Text>\n\t\t\t) }\n\t\t</VStack>\n\t);\n}\n\nfunction ReadOnlyBlockBindingsPanelItems( { bindings, fieldsList } ) {\n\treturn (\n\t\t<>\n\t\t\t{ Object.entries( bindings ).map( ( [ attribute, binding ] ) => (\n\t\t\t\t<Item key={ attribute }>\n\t\t\t\t\t<BlockBindingsAttribute\n\t\t\t\t\t\tattribute={ attribute }\n\t\t\t\t\t\tbinding={ binding }\n\t\t\t\t\t\tfieldsList={ fieldsList }\n\t\t\t\t\t/>\n\t\t\t\t</Item>\n\t\t\t) ) }\n\t\t</>\n\t);\n}\n\nfunction EditableBlockBindingsPanelItems( {\n\tattributes,\n\tbindings,\n\tfieldsList,\n} ) {\n\tconst { updateBlockBindings } = useBlockBindingsUtils();\n\tconst isMobile = useViewportMatch( 'medium', '<' );\n\treturn (\n\t\t<>\n\t\t\t{ attributes.map( ( attribute ) => {\n\t\t\t\tconst binding = bindings[ attribute ];\n\t\t\t\treturn (\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tkey={ attribute }\n\t\t\t\t\t\thasValue={ () => !! binding }\n\t\t\t\t\t\tlabel={ attribute }\n\t\t\t\t\t\tonDeselect={ () => {\n\t\t\t\t\t\t\tupdateBlockBindings( {\n\t\t\t\t\t\t\t\t[ attribute ]: undefined,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t<Menu\n\t\t\t\t\t\t\tplacement={\n\t\t\t\t\t\t\t\tisMobile ? 'bottom-start' : 'left-start'\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Menu.TriggerButton render={ <Item /> }>\n\t\t\t\t\t\t\t\t<BlockBindingsAttribute\n\t\t\t\t\t\t\t\t\tattribute={ attribute }\n\t\t\t\t\t\t\t\t\tbinding={ binding }\n\t\t\t\t\t\t\t\t\tfieldsList={ fieldsList }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</Menu.TriggerButton>\n\t\t\t\t\t\t\t<Menu.Popover gutter={ isMobile ? 8 : 36 }>\n\t\t\t\t\t\t\t\t<BlockBindingsPanelMenuContent\n\t\t\t\t\t\t\t\t\tfieldsList={ fieldsList }\n\t\t\t\t\t\t\t\t\tattribute={ attribute }\n\t\t\t\t\t\t\t\t\tbinding={ binding }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</Menu.Popover>\n\t\t\t\t\t\t</Menu>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</>\n\t);\n}\n\nexport const BlockBindingsPanel = ( { name: blockName, metadata } ) => {\n\tconst blockContext = useContext( BlockContext );\n\tconst { removeAllBlockBindings } = useBlockBindingsUtils();\n\tconst bindableAttributes = getBindableAttributes( blockName );\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\t// `useSelect` is used purposely here to ensure `getFieldsList`\n\t// is updated whenever there are updates in block context.\n\t// `source.getFieldsList` may also call a selector via `select`.\n\tconst _fieldsList = {};\n\tconst { fieldsList, canUpdateBlockBindings } = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! bindableAttributes || bindableAttributes.length === 0 ) {\n\t\t\t\treturn EMPTY_OBJECT;\n\t\t\t}\n\t\t\tconst registeredSources = getBlockBindingsSources();\n\t\t\tObject.entries( registeredSources ).forEach(\n\t\t\t\t( [ sourceName, { getFieldsList, usesContext } ] ) => {\n\t\t\t\t\tif ( getFieldsList ) {\n\t\t\t\t\t\t// Populate context.\n\t\t\t\t\t\tconst context = {};\n\t\t\t\t\t\tif ( usesContext?.length ) {\n\t\t\t\t\t\t\tfor ( const key of usesContext ) {\n\t\t\t\t\t\t\t\tcontext[ key ] = blockContext[ key ];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst sourceList = getFieldsList( {\n\t\t\t\t\t\t\tselect,\n\t\t\t\t\t\t\tcontext,\n\t\t\t\t\t\t} );\n\t\t\t\t\t\t// Only add source if the list is not empty.\n\t\t\t\t\t\tif ( Object.keys( sourceList || {} ).length ) {\n\t\t\t\t\t\t\t_fieldsList[ sourceName ] = { ...sourceList };\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\t\t\treturn {\n\t\t\t\tfieldsList:\n\t\t\t\t\tObject.values( _fieldsList ).length > 0\n\t\t\t\t\t\t? _fieldsList\n\t\t\t\t\t\t: EMPTY_OBJECT,\n\t\t\t\tcanUpdateBlockBindings:\n\t\t\t\t\tselect( blockEditorStore ).getSettings()\n\t\t\t\t\t\t.canUpdateBlockBindings,\n\t\t\t};\n\t\t},\n\t\t[ blockContext, bindableAttributes ]\n\t);\n\t// Return early if there are no bindable attributes.\n\tif ( ! bindableAttributes || bindableAttributes.length === 0 ) {\n\t\treturn null;\n\t}\n\t// Filter bindings to only show bindable attributes and remove pattern overrides.\n\tconst { bindings } = metadata || {};\n\tconst filteredBindings = { ...bindings };\n\tObject.keys( filteredBindings ).forEach( ( key ) => {\n\t\tif (\n\t\t\t! canBindAttribute( blockName, key ) ||\n\t\t\tfilteredBindings[ key ].source === 'core/pattern-overrides'\n\t\t) {\n\t\t\tdelete filteredBindings[ key ];\n\t\t}\n\t} );\n\n\t// Lock the UI when the user can't update bindings or there are no fields to connect to.\n\tconst readOnly =\n\t\t! canUpdateBlockBindings || ! Object.keys( fieldsList ).length;\n\n\tif ( readOnly && Object.keys( filteredBindings ).length === 0 ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<InspectorControls group=\"bindings\">\n\t\t\t<ToolsPanel\n\t\t\t\tlabel={ __( 'Attributes' ) }\n\t\t\t\tresetAll={ () => {\n\t\t\t\t\tremoveAllBlockBindings();\n\t\t\t\t} }\n\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\tclassName=\"block-editor-bindings__panel\"\n\t\t\t>\n\t\t\t\t<ItemGroup isBordered isSeparated>\n\t\t\t\t\t{ readOnly ? (\n\t\t\t\t\t\t<ReadOnlyBlockBindingsPanelItems\n\t\t\t\t\t\t\tbindings={ filteredBindings }\n\t\t\t\t\t\t\tfieldsList={ fieldsList }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<EditableBlockBindingsPanelItems\n\t\t\t\t\t\t\tattributes={ bindableAttributes }\n\t\t\t\t\t\t\tbindings={ filteredBindings }\n\t\t\t\t\t\t\tfieldsList={ fieldsList }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</ItemGroup>\n\t\t\t\t{ /*\n\t\t\t\t\tUse a div element to make the ToolsPanelHiddenInnerWrapper\n\t\t\t\t\ttoggle the visibility of this help text automatically.\n\t\t\t\t*/ }\n\t\t\t\t<Text as=\"div\" variant=\"muted\">\n\t\t\t\t\t<p>\n\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t'Attributes connected to custom fields or other dynamic data.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t</p>\n\t\t\t\t</Text>\n\t\t\t</ToolsPanel>\n\t\t</InspectorControls>\n\t);\n};\n\nexport default {\n\tedit: BlockBindingsPanel,\n\tattributeKeys: [ 'metadata' ],\n\thasSupport() {\n\t\treturn true;\n\t},\n};\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SACCC,sBAAsB,EACtBC,uBAAuB,EACvBC,YAAY,QACN,mBAAmB;AAC1B,SACCC,uBAAuB,IAAIC,SAAS,EACpCC,kBAAkB,IAAIC,IAAI,EAC1BC,kBAAkB,IAAIC,IAAI,EAC1BC,wBAAwB,IAAIC,UAAU,EACtCC,4BAA4B,IAAIC,cAAc,EAC9CC,oBAAoB,IAAIC,MAAM,EAC9BC,WAAW,IAAIC,qBAAqB,QAC9B,uBAAuB;AAC9B,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,UAAU,EAAEC,QAAQ,QAAQ,oBAAoB;AACzD,SAASC,gBAAgB,QAAQ,oBAAoB;;AAErD;AACA;AACA;AACA,SACCC,gBAAgB,EAChBC,qBAAqB,EACrBC,qBAAqB,QACf,yBAAyB;AAChC,SAASC,MAAM,QAAQ,gBAAgB;AACvC,OAAOC,iBAAiB,MAAM,kCAAkC;AAChE,OAAOC,YAAY,MAAM,6BAA6B;AACtD,SAASC,mBAAmB,QAAQ,0BAA0B;AAC9D,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,UAAU;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA,EAAAd,QAAA,IAAAe,SAAA;AAErD,MAAM;EAAEC;AAAK,CAAC,GAAGX,MAAM,CAAER,qBAAsB,CAAC;AAEhD,MAAMoB,YAAY,GAAG,CAAC,CAAC;AAEvB,MAAMC,8BAA8B,GAAGA,CAAA,KAAM;EAC5C,MAAMC,QAAQ,GAAGlB,gBAAgB,C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