@wordpress/block-editor 12.22.0 → 12.24.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 (1508) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/README.md +8 -0
  3. package/build/autocompleters/block.js.map +1 -1
  4. package/build/autocompleters/link.js.map +1 -1
  5. package/build/components/alignment-control/index.js.map +1 -1
  6. package/build/components/alignment-control/ui.js.map +1 -1
  7. package/build/components/autocomplete/index.js.map +1 -1
  8. package/build/components/block-actions/index.js.map +1 -1
  9. package/build/components/block-alignment-control/constants.js.map +1 -1
  10. package/build/components/block-alignment-control/index.js.map +1 -1
  11. package/build/components/block-alignment-control/ui.js.map +1 -1
  12. package/build/components/block-alignment-control/ui.native.js.map +1 -1
  13. package/build/components/block-alignment-control/use-available-alignments.js.map +1 -1
  14. package/build/components/block-alignment-matrix-control/index.js.map +1 -1
  15. package/build/components/block-bindings-toolbar-indicator/index.js.map +1 -1
  16. package/build/components/block-breadcrumb/index.js.map +1 -1
  17. package/build/components/block-canvas/index.js.map +1 -1
  18. package/build/components/block-caption/index.native.js.map +1 -1
  19. package/build/components/block-card/index.js.map +1 -1
  20. package/build/components/block-compare/block-view.js.map +1 -1
  21. package/build/components/block-compare/index.js.map +1 -1
  22. package/build/components/block-content-overlay/index.js.map +1 -1
  23. package/build/components/block-context/index.js.map +1 -1
  24. package/build/components/block-controls/fill.js.map +1 -1
  25. package/build/components/block-controls/groups.js.map +1 -1
  26. package/build/components/block-controls/hook.js.map +1 -1
  27. package/build/components/block-controls/index.js.map +1 -1
  28. package/build/components/block-controls/slot.js.map +1 -1
  29. package/build/components/block-controls/slot.native.js.map +1 -1
  30. package/build/components/block-controls/use-has-block-controls.js.map +1 -1
  31. package/build/components/block-draggable/draggable-chip.js.map +1 -1
  32. package/build/components/block-draggable/draggable-chip.native.js.map +1 -1
  33. package/build/components/block-draggable/dropping-insertion-point.native.js +1 -1
  34. package/build/components/block-draggable/dropping-insertion-point.native.js.map +1 -1
  35. package/build/components/block-draggable/index.js.map +1 -1
  36. package/build/components/block-draggable/index.native.js +1 -1
  37. package/build/components/block-draggable/index.native.js.map +1 -1
  38. package/build/components/block-draggable/use-scroll-when-dragging.js.map +1 -1
  39. package/build/components/block-draggable/use-scroll-when-dragging.native.js.map +1 -1
  40. package/build/components/block-edit/context.js +2 -1
  41. package/build/components/block-edit/context.js.map +1 -1
  42. package/build/components/block-edit/edit.js.map +1 -1
  43. package/build/components/block-edit/edit.native.js.map +1 -1
  44. package/build/components/block-edit/index.js +4 -2
  45. package/build/components/block-edit/index.js.map +1 -1
  46. package/build/components/block-edit-visually-button/index.js.map +1 -1
  47. package/build/components/block-editing-mode/index.js.map +1 -1
  48. package/build/components/block-full-height-alignment-control/index.js.map +1 -1
  49. package/build/components/block-heading-level-dropdown/heading-level-icon.js.map +1 -1
  50. package/build/components/block-heading-level-dropdown/index.js.map +1 -1
  51. package/build/components/block-heading-level-dropdown/index.native.js.map +1 -1
  52. package/build/components/block-icon/index.js.map +1 -1
  53. package/build/components/block-icon/index.native.js.map +1 -1
  54. package/build/components/block-info-slot-fill/index.js.map +1 -1
  55. package/build/components/block-inspector/index.js +5 -4
  56. package/build/components/block-inspector/index.js.map +1 -1
  57. package/build/components/block-inspector/useBlockInspectorAnimationSettings.js.map +1 -1
  58. package/build/components/block-list/block-crash-boundary.js.map +1 -1
  59. package/build/components/block-list/block-crash-boundary.native.js.map +1 -1
  60. package/build/components/block-list/block-crash-warning.js.map +1 -1
  61. package/build/components/block-list/block-crash-warning.native.js.map +1 -1
  62. package/build/components/block-list/block-html.js.map +1 -1
  63. package/build/components/block-list/block-invalid-warning.js.map +1 -1
  64. package/build/components/block-list/block-invalid-warning.native.js.map +1 -1
  65. package/build/components/block-list/block-list-context.native.js.map +1 -1
  66. package/build/components/block-list/block-list-item-cell.native.js.map +1 -1
  67. package/build/components/block-list/block-list-item.native.js.map +1 -1
  68. package/build/components/block-list/block-outline.native.js.map +1 -1
  69. package/build/components/block-list/block-selection-button.native.js.map +1 -1
  70. package/build/components/block-list/block.js +55 -29
  71. package/build/components/block-list/block.js.map +1 -1
  72. package/build/components/block-list/block.native.js +2 -2
  73. package/build/components/block-list/block.native.js.map +1 -1
  74. package/build/components/block-list/grid-item.native.js.map +1 -1
  75. package/build/components/block-list/index.js +16 -5
  76. package/build/components/block-list/index.js.map +1 -1
  77. package/build/components/block-list/index.native.js.map +1 -1
  78. package/build/components/block-list/insertion-point.native.js.map +1 -1
  79. package/build/components/block-list/layout.js.map +1 -1
  80. package/build/components/block-list/private-block-context.js.map +1 -1
  81. package/build/components/block-list/subdirectory-icon.js.map +1 -1
  82. package/build/components/block-list/use-block-props/index.js +2 -1
  83. package/build/components/block-list/use-block-props/index.js.map +1 -1
  84. package/build/components/block-list/use-block-props/index.native.js.map +1 -1
  85. package/build/components/block-list/use-block-props/use-block-moving-mode-class-names.js.map +1 -1
  86. package/build/components/block-list/use-block-props/use-block-refs.js.map +1 -1
  87. package/build/components/block-list/use-block-props/use-focus-first-element.js +3 -2
  88. package/build/components/block-list/use-block-props/use-focus-first-element.js.map +1 -1
  89. package/build/components/block-list/use-block-props/use-focus-handler.js.map +1 -1
  90. package/build/components/block-list/use-block-props/use-intersection-observer.js.map +1 -1
  91. package/build/components/block-list/use-block-props/use-is-hovered.js.map +1 -1
  92. package/build/components/block-list/use-block-props/use-nav-mode-exit.js.map +1 -1
  93. package/build/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +1 -1
  94. package/build/components/block-list/use-in-between-inserter.js.map +1 -1
  95. package/build/components/block-list/use-scroll-upon-insertion.native.js.map +1 -1
  96. package/build/components/block-list-appender/index.js.map +1 -1
  97. package/build/components/block-list-appender/index.native.js.map +1 -1
  98. package/build/components/block-lock/index.js.map +1 -1
  99. package/build/components/block-lock/menu-item.js.map +1 -1
  100. package/build/components/block-lock/modal.js.map +1 -1
  101. package/build/components/block-lock/toolbar.js.map +1 -1
  102. package/build/components/block-lock/use-block-lock.js.map +1 -1
  103. package/build/components/block-media-update-progress/index.native.js.map +1 -1
  104. package/build/components/block-mover/button.js +4 -1
  105. package/build/components/block-mover/button.js.map +1 -1
  106. package/build/components/block-mover/index.js +5 -1
  107. package/build/components/block-mover/index.js.map +1 -1
  108. package/build/components/block-mover/index.native.js.map +1 -1
  109. package/build/components/block-mover/mover-description.js.map +1 -1
  110. package/build/components/block-mover/mover-description.native.js.map +1 -1
  111. package/build/components/block-navigation/dropdown.js.map +1 -1
  112. package/build/components/block-parent-selector/index.js.map +1 -1
  113. package/build/components/block-pattern-setup/constants.js.map +1 -1
  114. package/build/components/block-pattern-setup/index.js.map +1 -1
  115. package/build/components/block-pattern-setup/setup-toolbar.js.map +1 -1
  116. package/build/components/block-pattern-setup/use-patterns-setup.js.map +1 -1
  117. package/build/components/block-patterns-list/index.js +4 -1
  118. package/build/components/block-patterns-list/index.js.map +1 -1
  119. package/build/components/block-patterns-paging/index.js +8 -4
  120. package/build/components/block-patterns-paging/index.js.map +1 -1
  121. package/build/components/block-popover/cover.js.map +1 -1
  122. package/build/components/block-popover/drop-zone.js.map +1 -1
  123. package/build/components/block-popover/inbetween.js.map +1 -1
  124. package/build/components/block-popover/index.js.map +1 -1
  125. package/build/components/block-popover/use-popover-scroll.js.map +1 -1
  126. package/build/components/block-preview/auto.js.map +1 -1
  127. package/build/components/block-preview/index.js.map +1 -1
  128. package/build/components/block-quick-navigation/index.js.map +1 -1
  129. package/build/components/block-removal-warning-modal/index.js.map +1 -1
  130. package/build/components/block-rename/index.js.map +1 -1
  131. package/build/components/block-rename/is-empty-string.js.map +1 -1
  132. package/build/components/block-rename/modal.js +13 -9
  133. package/build/components/block-rename/modal.js.map +1 -1
  134. package/build/components/block-rename/rename-control.js +3 -1
  135. package/build/components/block-rename/rename-control.js.map +1 -1
  136. package/build/components/block-rename/use-block-rename.js.map +1 -1
  137. package/build/components/block-selection-clearer/index.js.map +1 -1
  138. package/build/components/block-settings/button.native.js.map +1 -1
  139. package/build/components/block-settings/container.native.js.map +1 -1
  140. package/build/components/block-settings/index.native.js +1 -1
  141. package/build/components/block-settings/index.native.js.map +1 -1
  142. package/build/components/block-settings-menu/block-html-convert-button.js.map +1 -1
  143. package/build/components/block-settings-menu/block-mode-toggle.js.map +1 -1
  144. package/build/components/block-settings-menu/block-parent-selector-menu-item.js.map +1 -1
  145. package/build/components/block-settings-menu/block-settings-dropdown.js +7 -3
  146. package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  147. package/build/components/block-settings-menu/block-settings-menu-first-item.js.map +1 -1
  148. package/build/components/block-settings-menu/index.js.map +1 -1
  149. package/build/components/block-settings-menu-controls/index.js.map +1 -1
  150. package/build/components/block-styles/index.js.map +1 -1
  151. package/build/components/block-styles/index.native.js.map +1 -1
  152. package/build/components/block-styles/menu-items.js.map +1 -1
  153. package/build/components/block-styles/preview-panel.js.map +1 -1
  154. package/build/components/block-styles/preview.native.js.map +1 -1
  155. package/build/components/block-styles/use-styles-for-block.js.map +1 -1
  156. package/build/components/block-styles/utils.js.map +1 -1
  157. package/build/components/block-switcher/block-styles-menu.js.map +1 -1
  158. package/build/components/block-switcher/block-transformations-menu.js.map +1 -1
  159. package/build/components/block-switcher/block-transformations-menu.native.js.map +1 -1
  160. package/build/components/block-switcher/block-variation-transformations.js.map +1 -1
  161. package/build/components/block-switcher/index.js +4 -3
  162. package/build/components/block-switcher/index.js.map +1 -1
  163. package/build/components/block-switcher/pattern-transformations-menu.js.map +1 -1
  164. package/build/components/block-switcher/preview-block-popover.js.map +1 -1
  165. package/build/components/block-switcher/use-transformed-patterns.js.map +1 -1
  166. package/build/components/block-switcher/utils.js.map +1 -1
  167. package/build/components/block-title/index.js.map +1 -1
  168. package/build/components/block-title/use-block-display-title.js.map +1 -1
  169. package/build/components/block-toolbar/block-name-context.js.map +1 -1
  170. package/build/components/block-toolbar/block-toolbar-last-item.js.map +1 -1
  171. package/build/components/block-toolbar/block-toolbar-menu.native.js.map +1 -1
  172. package/build/components/block-toolbar/index.js +5 -4
  173. package/build/components/block-toolbar/index.js.map +1 -1
  174. package/build/components/block-toolbar/index.native.js.map +1 -1
  175. package/build/components/block-toolbar/shuffle.js +18 -9
  176. package/build/components/block-toolbar/shuffle.js.map +1 -1
  177. package/build/components/block-toolbar/use-has-block-toolbar.js +6 -3
  178. package/build/components/block-toolbar/use-has-block-toolbar.js.map +1 -1
  179. package/build/components/block-toolbar/utils.js.map +1 -1
  180. package/build/components/block-tools/block-selection-button.js +56 -12
  181. package/build/components/block-tools/block-selection-button.js.map +1 -1
  182. package/build/components/block-tools/block-toolbar-breadcrumb.js.map +1 -1
  183. package/build/components/block-tools/block-toolbar-popover.js.map +1 -1
  184. package/build/components/block-tools/empty-block-inserter.js.map +1 -1
  185. package/build/components/block-tools/index.js +15 -3
  186. package/build/components/block-tools/index.js.map +1 -1
  187. package/build/components/block-tools/insertion-point.js.map +1 -1
  188. package/build/components/block-tools/use-block-toolbar-popover-props.js.map +1 -1
  189. package/build/components/block-tools/use-selected-block-tool-props.js.map +1 -1
  190. package/build/components/block-tools/use-show-block-tools.js +7 -13
  191. package/build/components/block-tools/use-show-block-tools.js.map +1 -1
  192. package/build/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
  193. package/build/components/block-types-list/index.js.map +1 -1
  194. package/build/components/block-types-list/index.native.js.map +1 -1
  195. package/build/components/block-variation-picker/index.js.map +1 -1
  196. package/build/components/block-variation-picker/index.native.js.map +1 -1
  197. package/build/components/block-variation-transforms/index.js +4 -1
  198. package/build/components/block-variation-transforms/index.js.map +1 -1
  199. package/build/components/block-vertical-alignment-control/icons.js.map +1 -1
  200. package/build/components/block-vertical-alignment-control/index.js.map +1 -1
  201. package/build/components/block-vertical-alignment-control/ui.js.map +1 -1
  202. package/build/components/border-radius-control/all-input-control.js.map +1 -1
  203. package/build/components/border-radius-control/index.js.map +1 -1
  204. package/build/components/border-radius-control/input-controls.js.map +1 -1
  205. package/build/components/border-radius-control/linked-button.js.map +1 -1
  206. package/build/components/border-radius-control/utils.js.map +1 -1
  207. package/build/components/button-block-appender/index.js.map +1 -1
  208. package/build/components/button-block-appender/index.native.js +11 -1
  209. package/build/components/button-block-appender/index.native.js.map +1 -1
  210. package/build/components/caption/index.native.js.map +1 -1
  211. package/build/components/child-layout-control/index.js.map +1 -1
  212. package/build/components/color-palette/control.js.map +1 -1
  213. package/build/components/color-palette/index.js.map +1 -1
  214. package/build/components/color-palette/with-color-context.js.map +1 -1
  215. package/build/components/color-style-selector/index.js.map +1 -1
  216. package/build/components/colors/index.js +1 -1
  217. package/build/components/colors/index.js.map +1 -1
  218. package/build/components/colors/utils.js.map +1 -1
  219. package/build/components/colors/with-colors.js.map +1 -1
  220. package/build/components/colors-gradients/control.js.map +1 -1
  221. package/build/components/colors-gradients/dropdown.js.map +1 -1
  222. package/build/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
  223. package/build/components/colors-gradients/panel-color-gradient-settings.native.js.map +1 -1
  224. package/build/components/colors-gradients/use-multiple-origin-colors-and-gradients.js.map +1 -1
  225. package/build/components/contrast-checker/index.js.map +1 -1
  226. package/build/components/contrast-checker/index.native.js.map +1 -1
  227. package/build/components/convert-to-group-buttons/index.js.map +1 -1
  228. package/build/components/convert-to-group-buttons/index.native.js.map +1 -1
  229. package/build/components/convert-to-group-buttons/toolbar.js.map +1 -1
  230. package/build/components/convert-to-group-buttons/use-convert-to-group-button-props.js.map +1 -1
  231. package/build/components/copy-handler/index.js.map +1 -1
  232. package/build/components/date-format-picker/index.js.map +1 -1
  233. package/build/components/default-block-appender/index.js.map +1 -1
  234. package/build/components/default-block-appender/index.native.js.map +1 -1
  235. package/build/components/dimensions-tool/aspect-ratio-tool.js.map +1 -1
  236. package/build/components/dimensions-tool/index.js.map +1 -1
  237. package/build/components/dimensions-tool/scale-tool.js.map +1 -1
  238. package/build/components/dimensions-tool/width-height-tool.js +6 -2
  239. package/build/components/dimensions-tool/width-height-tool.js.map +1 -1
  240. package/build/components/duotone/utils.js.map +1 -1
  241. package/build/components/duotone-control/index.js.map +1 -1
  242. package/build/components/editable-text/index.js.map +1 -1
  243. package/build/components/editor-styles/index.js +2 -1
  244. package/build/components/editor-styles/index.js.map +1 -1
  245. package/build/components/floating-toolbar/index.native.js.map +1 -1
  246. package/build/components/floating-toolbar/nav-up-icon.js.map +1 -1
  247. package/build/components/font-appearance-control/index.js.map +1 -1
  248. package/build/components/font-family/index.js.map +1 -1
  249. package/build/components/font-sizes/fluid-utils.js.map +1 -1
  250. package/build/components/font-sizes/font-size-picker.js.map +1 -1
  251. package/build/components/font-sizes/index.js.map +1 -1
  252. package/build/components/font-sizes/index.native.js.map +1 -1
  253. package/build/components/font-sizes/utils.js.map +1 -1
  254. package/build/components/font-sizes/with-font-sizes.js.map +1 -1
  255. package/build/components/global-styles/advanced-panel.js +9 -2
  256. package/build/components/global-styles/advanced-panel.js.map +1 -1
  257. package/build/components/global-styles/background-panel.js +447 -0
  258. package/build/components/global-styles/background-panel.js.map +1 -0
  259. package/build/components/global-styles/border-panel.js.map +1 -1
  260. package/build/components/global-styles/color-panel.js +2 -1
  261. package/build/components/global-styles/color-panel.js.map +1 -1
  262. package/build/components/global-styles/color-panel.native.js.map +1 -1
  263. package/build/components/global-styles/context.js.map +1 -1
  264. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  265. package/build/components/global-styles/filters-panel.js.map +1 -1
  266. package/build/components/global-styles/get-block-css-selector.js.map +1 -1
  267. package/build/components/global-styles/get-global-styles-changes.js +3 -0
  268. package/build/components/global-styles/get-global-styles-changes.js.map +1 -1
  269. package/build/components/global-styles/hooks.js +1 -1
  270. package/build/components/global-styles/hooks.js.map +1 -1
  271. package/build/components/global-styles/image-settings-panel.js.map +1 -1
  272. package/build/components/global-styles/index.js +14 -1
  273. package/build/components/global-styles/index.js.map +1 -1
  274. package/build/components/global-styles/shadow-panel-components.js.map +1 -1
  275. package/build/components/global-styles/typography-panel.js.map +1 -1
  276. package/build/components/global-styles/typography-utils.js.map +1 -1
  277. package/build/components/global-styles/use-global-styles-output.js +19 -18
  278. package/build/components/global-styles/use-global-styles-output.js.map +1 -1
  279. package/build/components/global-styles/utils.js +2 -1
  280. package/build/components/global-styles/utils.js.map +1 -1
  281. package/build/components/gradients/index.js.map +1 -1
  282. package/build/components/gradients/index.native.js.map +1 -1
  283. package/build/components/gradients/use-gradient.js.map +1 -1
  284. package/build/components/gradients/with-gradient.js.map +1 -1
  285. package/build/components/grid-visualizer/grid-item-resizer.js.map +1 -1
  286. package/build/components/grid-visualizer/grid-visualizer.js.map +1 -1
  287. package/build/components/grid-visualizer/index.js.map +1 -1
  288. package/build/components/grid-visualizer/utils.js.map +1 -1
  289. package/build/components/height-control/index.js.map +1 -1
  290. package/build/components/iframe/get-compatibility-styles.js.map +1 -1
  291. package/build/components/iframe/index.js +14 -10
  292. package/build/components/iframe/index.js.map +1 -1
  293. package/build/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
  294. package/build/components/image-editor/constants.js.map +1 -1
  295. package/build/components/image-editor/context.js.map +1 -1
  296. package/build/components/image-editor/cropper.js +6 -2
  297. package/build/components/image-editor/cropper.js.map +1 -1
  298. package/build/components/image-editor/form-controls.js.map +1 -1
  299. package/build/components/image-editor/index.js +0 -2
  300. package/build/components/image-editor/index.js.map +1 -1
  301. package/build/components/image-editor/rotation-button.js.map +1 -1
  302. package/build/components/image-editor/use-save-image.js.map +1 -1
  303. package/build/components/image-editor/use-transform-image.js.map +1 -1
  304. package/build/components/image-editor/zoom-dropdown.js.map +1 -1
  305. package/build/components/image-link-destinations/index.native.js.map +1 -1
  306. package/build/components/image-size-control/index.js.map +1 -1
  307. package/build/components/image-size-control/use-dimension-handler.js.map +1 -1
  308. package/build/components/index.js +1 -1
  309. package/build/components/index.js.map +1 -1
  310. package/build/components/index.native.js +1 -1
  311. package/build/components/index.native.js.map +1 -1
  312. package/build/components/inner-blocks/button-block-appender.js.map +1 -1
  313. package/build/components/inner-blocks/constants.native.js.map +1 -1
  314. package/build/components/inner-blocks/default-block-appender.js.map +1 -1
  315. package/build/components/inner-blocks/index.js.map +1 -1
  316. package/build/components/inner-blocks/index.native.js.map +1 -1
  317. package/build/components/inner-blocks/use-block-context.js.map +1 -1
  318. package/build/components/inner-blocks/use-inner-block-template-sync.js.map +1 -1
  319. package/build/components/inner-blocks/use-nested-settings-update.js.map +1 -1
  320. package/build/components/inner-blocks/warning-max-depth-exceeded.native.js.map +1 -1
  321. package/build/components/inner-blocks/with-client-id.js.map +1 -1
  322. package/build/components/inserter/block-patterns-explorer/index.js.map +1 -1
  323. package/build/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js.map +1 -1
  324. package/build/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
  325. package/build/components/inserter/block-patterns-tab/index.js +31 -18
  326. package/build/components/inserter/block-patterns-tab/index.js.map +1 -1
  327. package/build/components/inserter/block-patterns-tab/pattern-category-preview-panel.js +2 -19
  328. package/build/components/inserter/block-patterns-tab/pattern-category-preview-panel.js.map +1 -1
  329. package/build/components/inserter/block-patterns-tab/pattern-category-previews.js +1 -3
  330. package/build/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
  331. package/build/components/inserter/block-patterns-tab/patterns-filter.js.map +1 -1
  332. package/build/components/inserter/block-patterns-tab/use-pattern-categories.js.map +1 -1
  333. package/build/components/inserter/block-patterns-tab/utils.js.map +1 -1
  334. package/build/components/inserter/block-types-tab.js.map +1 -1
  335. package/build/components/inserter/block-types-tab.native.js.map +1 -1
  336. package/build/components/inserter/hooks/use-block-type-impressions.native.js.map +1 -1
  337. package/build/components/inserter/hooks/use-block-types-state.js.map +1 -1
  338. package/build/components/inserter/hooks/use-clipboard-block.native.js.map +1 -1
  339. package/build/components/inserter/hooks/use-insertion-point.js.map +1 -1
  340. package/build/components/inserter/hooks/use-patterns-paging.js.map +1 -1
  341. package/build/components/inserter/hooks/use-patterns-state.js.map +1 -1
  342. package/build/components/inserter/index.js.map +1 -1
  343. package/build/components/inserter/index.native.js.map +1 -1
  344. package/build/components/inserter/library.js +2 -0
  345. package/build/components/inserter/library.js.map +1 -1
  346. package/build/components/inserter/media-tab/hooks.js.map +1 -1
  347. package/build/components/inserter/media-tab/index.js.map +1 -1
  348. package/build/components/inserter/media-tab/media-list.js.map +1 -1
  349. package/build/components/inserter/media-tab/media-panel.js.map +1 -1
  350. package/build/components/inserter/media-tab/media-preview.js.map +1 -1
  351. package/build/components/inserter/media-tab/media-tab.js.map +1 -1
  352. package/build/components/inserter/media-tab/utils.js.map +1 -1
  353. package/build/components/inserter/menu.js +25 -13
  354. package/build/components/inserter/menu.js.map +1 -1
  355. package/build/components/inserter/menu.native.js.map +1 -1
  356. package/build/components/inserter/mobile-tab-navigation.js.map +1 -1
  357. package/build/components/inserter/no-results.js.map +1 -1
  358. package/build/components/inserter/no-results.native.js.map +1 -1
  359. package/build/components/inserter/panel.js.map +1 -1
  360. package/build/components/inserter/preview-panel.js.map +1 -1
  361. package/build/components/inserter/quick-inserter.js.map +1 -1
  362. package/build/components/inserter/reusable-block-rename-hint.js.map +1 -1
  363. package/build/components/inserter/reusable-blocks-tab.native.js.map +1 -1
  364. package/build/components/inserter/search-items.js +36 -15
  365. package/build/components/inserter/search-items.js.map +1 -1
  366. package/build/components/inserter/search-results.js.map +1 -1
  367. package/build/components/inserter/search-results.native.js.map +1 -1
  368. package/build/components/inserter/tabs.js +7 -3
  369. package/build/components/inserter/tabs.js.map +1 -1
  370. package/build/components/inserter/tabs.native.js.map +1 -1
  371. package/build/components/inserter/tips.js.map +1 -1
  372. package/build/components/inserter/utils.native.js.map +1 -1
  373. package/build/components/inserter-button/index.native.js.map +1 -1
  374. package/build/components/inserter-button/sparkles.js.map +1 -1
  375. package/build/components/inserter-draggable-blocks/index.js.map +1 -1
  376. package/build/components/inserter-list-item/index.js.map +1 -1
  377. package/build/components/inserter-listbox/context.js.map +1 -1
  378. package/build/components/inserter-listbox/group.js.map +1 -1
  379. package/build/components/inserter-listbox/index.js.map +1 -1
  380. package/build/components/inserter-listbox/item.js.map +1 -1
  381. package/build/components/inserter-listbox/row.js.map +1 -1
  382. package/build/components/inserter-menu-extension/index.js.map +1 -1
  383. package/build/components/inspector-controls/block-support-slot-container.js.map +1 -1
  384. package/build/components/inspector-controls/block-support-tools-panel.js.map +1 -1
  385. package/build/components/inspector-controls/fill.js.map +1 -1
  386. package/build/components/inspector-controls/fill.native.js.map +1 -1
  387. package/build/components/inspector-controls/groups.js.map +1 -1
  388. package/build/components/inspector-controls/index.js.map +1 -1
  389. package/build/components/inspector-controls/slot.js.map +1 -1
  390. package/build/components/inspector-controls/slot.native.js.map +1 -1
  391. package/build/components/inspector-controls-tabs/advanced-controls-panel.js +1 -1
  392. package/build/components/inspector-controls-tabs/advanced-controls-panel.js.map +1 -1
  393. package/build/components/inspector-controls-tabs/advanced-controls-panel.native.js.map +1 -1
  394. package/build/components/inspector-controls-tabs/index.js.map +1 -1
  395. package/build/components/inspector-controls-tabs/position-controls-panel.js.map +1 -1
  396. package/build/components/inspector-controls-tabs/settings-tab-hint.js.map +1 -1
  397. package/build/components/inspector-controls-tabs/settings-tab.js.map +1 -1
  398. package/build/components/inspector-controls-tabs/styles-tab.js +1 -1
  399. package/build/components/inspector-controls-tabs/styles-tab.js.map +1 -1
  400. package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +1 -1
  401. package/build/components/inspector-controls-tabs/use-is-list-view-tab-disabled.js.map +1 -1
  402. package/build/components/inspector-controls-tabs/utils.js.map +1 -1
  403. package/build/components/inspector-popover-header/index.js.map +1 -1
  404. package/build/components/justify-content-control/index.js.map +1 -1
  405. package/build/components/justify-content-control/ui.js.map +1 -1
  406. package/build/components/keyboard-shortcuts/index.js +11 -0
  407. package/build/components/keyboard-shortcuts/index.js.map +1 -1
  408. package/build/components/letter-spacing-control/index.js.map +1 -1
  409. package/build/components/line-height-control/index.js.map +1 -1
  410. package/build/components/line-height-control/index.native.js.map +1 -1
  411. package/build/components/line-height-control/utils.js.map +1 -1
  412. package/build/components/link-control/constants.js.map +1 -1
  413. package/build/components/link-control/index.js.map +1 -1
  414. package/build/components/link-control/is-url-like.js.map +1 -1
  415. package/build/components/link-control/link-preview.js.map +1 -1
  416. package/build/components/link-control/search-create-button.js.map +1 -1
  417. package/build/components/link-control/search-input.js.map +1 -1
  418. package/build/components/link-control/search-item.js.map +1 -1
  419. package/build/components/link-control/search-results.js.map +1 -1
  420. package/build/components/link-control/settings-drawer.js.map +1 -1
  421. package/build/components/link-control/settings.js.map +1 -1
  422. package/build/components/link-control/use-create-page.js.map +1 -1
  423. package/build/components/link-control/use-internal-value.js.map +1 -1
  424. package/build/components/link-control/use-rich-url-data.js.map +1 -1
  425. package/build/components/link-control/use-search-handler.js.map +1 -1
  426. package/build/components/link-control/viewer-slot.js.map +1 -1
  427. package/build/components/list-view/appender.js.map +1 -1
  428. package/build/components/list-view/aria-referenced-text.js.map +1 -1
  429. package/build/components/list-view/block-contents.js.map +1 -1
  430. package/build/components/list-view/block-select-button.js +45 -1
  431. package/build/components/list-view/block-select-button.js.map +1 -1
  432. package/build/components/list-view/block.js +1 -1
  433. package/build/components/list-view/block.js.map +1 -1
  434. package/build/components/list-view/branch.js.map +1 -1
  435. package/build/components/list-view/context.js.map +1 -1
  436. package/build/components/list-view/drop-indicator.js.map +1 -1
  437. package/build/components/list-view/expander.js.map +1 -1
  438. package/build/components/list-view/index.js +17 -2
  439. package/build/components/list-view/index.js.map +1 -1
  440. package/build/components/list-view/leaf.js.map +1 -1
  441. package/build/components/list-view/use-block-selection.js.map +1 -1
  442. package/build/components/list-view/use-clipboard-handler.js.map +1 -1
  443. package/build/components/list-view/use-list-view-block-indexes.js.map +1 -1
  444. package/build/components/list-view/use-list-view-client-ids.js.map +1 -1
  445. package/build/components/list-view/use-list-view-collapse-items.js +47 -0
  446. package/build/components/list-view/use-list-view-collapse-items.js.map +1 -0
  447. package/build/components/list-view/use-list-view-drop-zone.js +5 -0
  448. package/build/components/list-view/use-list-view-drop-zone.js.map +1 -1
  449. package/build/components/list-view/use-list-view-expand-selected-item.js.map +1 -1
  450. package/build/components/list-view/use-list-view-images.js.map +1 -1
  451. package/build/components/list-view/use-list-view-scroll-into-view.js.map +1 -1
  452. package/build/components/list-view/utils.js.map +1 -1
  453. package/build/components/media-placeholder/index.js.map +1 -1
  454. package/build/components/media-placeholder/index.native.js.map +1 -1
  455. package/build/components/media-replace-flow/index.js.map +1 -1
  456. package/build/components/media-replace-flow/index.native.js.map +1 -1
  457. package/build/components/media-upload/check.js.map +1 -1
  458. package/build/components/media-upload/constants.native.js.map +1 -1
  459. package/build/components/media-upload/index.js.map +1 -1
  460. package/build/components/media-upload/index.native.js.map +1 -1
  461. package/build/components/media-upload-progress/constants.js.map +1 -1
  462. package/build/components/media-upload-progress/index.native.js.map +1 -1
  463. package/build/components/multi-selection-inspector/index.js.map +1 -1
  464. package/build/components/navigable-toolbar/index.js.map +1 -1
  465. package/build/components/observe-typing/index.js.map +1 -1
  466. package/build/components/panel-color-settings/index.js.map +1 -1
  467. package/build/components/plain-text/index.js.map +1 -1
  468. package/build/components/plain-text/index.native.js.map +1 -1
  469. package/build/components/preview-options/index.js.map +1 -1
  470. package/build/components/provider/block-refs-provider.js.map +1 -1
  471. package/build/components/provider/index.js.map +1 -1
  472. package/build/components/provider/index.native.js.map +1 -1
  473. package/build/components/provider/use-block-sync.js.map +1 -1
  474. package/build/components/provider/with-registry-provider.js.map +1 -1
  475. package/build/components/publish-date-time-picker/index.js.map +1 -1
  476. package/build/components/recursion-provider/index.js +2 -2
  477. package/build/components/recursion-provider/index.js.map +1 -1
  478. package/build/components/resizable-box-popover/index.js.map +1 -1
  479. package/build/components/resolution-tool/index.js.map +1 -1
  480. package/build/components/responsive-block-control/index.js.map +1 -1
  481. package/build/components/responsive-block-control/label.js.map +1 -1
  482. package/build/components/rich-text/content.js +26 -19
  483. package/build/components/rich-text/content.js.map +1 -1
  484. package/build/components/rich-text/embed-handler-picker.native.js.map +1 -1
  485. package/build/components/rich-text/file-paste-handler.native.js.map +1 -1
  486. package/build/components/rich-text/format-edit.js.map +1 -1
  487. package/build/components/rich-text/format-toolbar/index.js.map +1 -1
  488. package/build/components/rich-text/format-toolbar/index.native.js.map +1 -1
  489. package/build/components/rich-text/format-toolbar-container.js.map +1 -1
  490. package/build/components/rich-text/format-toolbar-container.native.js.map +1 -1
  491. package/build/components/rich-text/get-rich-text-values.js.map +1 -1
  492. package/build/components/rich-text/index.js +54 -11
  493. package/build/components/rich-text/index.js.map +1 -1
  494. package/build/components/rich-text/index.native.js +20 -12
  495. package/build/components/rich-text/index.native.js.map +1 -1
  496. package/build/components/rich-text/input-event.js.map +1 -1
  497. package/build/components/rich-text/input-event.native.js.map +1 -1
  498. package/build/components/rich-text/multiline.js.map +1 -1
  499. package/build/components/rich-text/native/format-edit.js.map +1 -1
  500. package/build/components/rich-text/native/get-format-colors.native.js +1 -1
  501. package/build/components/rich-text/native/get-format-colors.native.js.map +1 -1
  502. package/build/components/rich-text/native/index.js.map +1 -1
  503. package/build/components/rich-text/native/index.native.js +2 -2
  504. package/build/components/rich-text/native/index.native.js.map +1 -1
  505. package/build/components/rich-text/native/toolbar-button-with-options.native.js.map +1 -1
  506. package/build/components/rich-text/native/use-format-types.js.map +1 -1
  507. package/build/components/rich-text/prevent-event-discovery.js.map +1 -1
  508. package/build/components/rich-text/remove-browser-shortcuts.native.js.map +1 -1
  509. package/build/components/rich-text/shortcut.js.map +1 -1
  510. package/build/components/rich-text/shortcut.native.js.map +1 -1
  511. package/build/components/rich-text/split-value.js.map +1 -1
  512. package/build/components/rich-text/toolbar-button.js.map +1 -1
  513. package/build/components/rich-text/use-before-input-rules.js.map +1 -1
  514. package/build/components/rich-text/use-delete.js.map +1 -1
  515. package/build/components/rich-text/use-enter.js.map +1 -1
  516. package/build/components/rich-text/use-firefox-compat.js.map +1 -1
  517. package/build/components/rich-text/use-format-types.js.map +1 -1
  518. package/build/components/rich-text/use-input-events.js.map +1 -1
  519. package/build/components/rich-text/use-input-rules.js.map +1 -1
  520. package/build/components/rich-text/use-insert-replacement-text.js.map +1 -1
  521. package/build/components/rich-text/use-mark-persistent.js.map +1 -1
  522. package/build/components/rich-text/use-paste-handler.js.map +1 -1
  523. package/build/components/rich-text/use-remove-browser-shortcuts.js.map +1 -1
  524. package/build/components/rich-text/use-shortcuts.js.map +1 -1
  525. package/build/components/rich-text/use-undo-automatic-change.js +1 -1
  526. package/build/components/rich-text/use-undo-automatic-change.js.map +1 -1
  527. package/build/components/rich-text/utils.js.map +1 -1
  528. package/build/components/rich-text/with-deprecations.js +0 -3
  529. package/build/components/rich-text/with-deprecations.js.map +1 -1
  530. package/build/components/selection-scroll-into-view/index.js.map +1 -1
  531. package/build/components/skip-to-selected-block/index.js.map +1 -1
  532. package/build/components/spacing-sizes-control/hooks/use-spacing-sizes.js.map +1 -1
  533. package/build/components/spacing-sizes-control/index.js.map +1 -1
  534. package/build/components/spacing-sizes-control/input-controls/axial.js.map +1 -1
  535. package/build/components/spacing-sizes-control/input-controls/separated.js.map +1 -1
  536. package/build/components/spacing-sizes-control/input-controls/single.js.map +1 -1
  537. package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
  538. package/build/components/spacing-sizes-control/sides-dropdown/index.js.map +1 -1
  539. package/build/components/spacing-sizes-control/utils.js.map +1 -1
  540. package/build/components/text-decoration-control/index.js.map +1 -1
  541. package/build/components/text-transform-control/index.js.map +1 -1
  542. package/build/components/tool-selector/index.js.map +1 -1
  543. package/build/components/typewriter/index.js.map +1 -1
  544. package/build/components/ungroup-button/index.native.js.map +1 -1
  545. package/build/components/unit-control/index.js.map +1 -1
  546. package/build/components/unsupported-block-details/index.native.js.map +1 -1
  547. package/build/components/url-input/button.js.map +1 -1
  548. package/build/components/url-input/index.js.map +1 -1
  549. package/build/components/url-input/index.native.js.map +1 -1
  550. package/build/components/url-popover/image-url-input-ui.js +50 -36
  551. package/build/components/url-popover/image-url-input-ui.js.map +1 -1
  552. package/build/components/url-popover/index.js.map +1 -1
  553. package/build/components/url-popover/link-editor.js.map +1 -1
  554. package/build/components/url-popover/link-viewer-url.js.map +1 -1
  555. package/build/components/url-popover/link-viewer.js.map +1 -1
  556. package/build/components/use-block-commands/index.js +20 -2
  557. package/build/components/use-block-commands/index.js.map +1 -1
  558. package/build/components/use-block-display-information/index.js +4 -6
  559. package/build/components/use-block-display-information/index.js.map +1 -1
  560. package/build/components/use-block-drop-zone/index.js.map +1 -1
  561. package/build/components/use-block-drop-zone/index.native.js.map +1 -1
  562. package/build/components/use-flash-editable-blocks/index.js.map +1 -1
  563. package/build/components/use-moving-animation/index.js.map +1 -1
  564. package/build/components/use-on-block-drop/index.js.map +1 -1
  565. package/build/components/use-on-block-drop/index.native.js.map +1 -1
  566. package/build/components/use-on-block-drop/types.js.map +1 -1
  567. package/build/components/use-paste-styles/index.js +1 -0
  568. package/build/components/use-paste-styles/index.js.map +1 -1
  569. package/build/components/use-resize-canvas/index.js.map +1 -1
  570. package/build/components/use-settings/index.js.map +1 -1
  571. package/build/components/use-unsupported-block-editor/index.native.js.map +1 -1
  572. package/build/components/video-player/gridicon-play.native.js.map +1 -1
  573. package/build/components/video-player/index.native.js.map +1 -1
  574. package/build/components/warning/index.js.map +1 -1
  575. package/build/components/warning/index.native.js.map +1 -1
  576. package/build/components/writing-flow/index.js.map +1 -1
  577. package/build/components/writing-flow/use-arrow-nav.js.map +1 -1
  578. package/build/components/writing-flow/use-click-selection.js.map +1 -1
  579. package/build/components/writing-flow/use-clipboard-handler.js.map +1 -1
  580. package/build/components/writing-flow/use-drag-selection.js.map +1 -1
  581. package/build/components/writing-flow/use-input.js.map +1 -1
  582. package/build/components/writing-flow/use-multi-selection.js.map +1 -1
  583. package/build/components/writing-flow/use-select-all.js.map +1 -1
  584. package/build/components/writing-flow/use-selection-observer.js.map +1 -1
  585. package/build/components/writing-flow/use-tab-nav.js.map +1 -1
  586. package/build/components/writing-flow/utils.js.map +1 -1
  587. package/build/components/writing-mode-control/index.js.map +1 -1
  588. package/build/elements/index.js.map +1 -1
  589. package/build/hooks/align.js.map +1 -1
  590. package/build/hooks/align.native.js +1 -1
  591. package/build/hooks/align.native.js.map +1 -1
  592. package/build/hooks/anchor.js +2 -2
  593. package/build/hooks/anchor.js.map +1 -1
  594. package/build/hooks/aria-label.js.map +1 -1
  595. package/build/hooks/background.js +70 -424
  596. package/build/hooks/background.js.map +1 -1
  597. package/build/hooks/block-hooks.js.map +1 -1
  598. package/build/hooks/block-renaming.js +0 -37
  599. package/build/hooks/block-renaming.js.map +1 -1
  600. package/build/hooks/border.js.map +1 -1
  601. package/build/hooks/color.js +1 -1
  602. package/build/hooks/color.js.map +1 -1
  603. package/build/hooks/compat.js.map +1 -1
  604. package/build/hooks/content-lock-ui.js +5 -5
  605. package/build/hooks/content-lock-ui.js.map +1 -1
  606. package/build/hooks/contrast-checker.js.map +1 -1
  607. package/build/hooks/custom-class-name.js.map +1 -1
  608. package/build/hooks/custom-class-name.native.js.map +1 -1
  609. package/build/hooks/dimensions.js.map +1 -1
  610. package/build/hooks/duotone.js.map +1 -1
  611. package/build/hooks/font-family.js.map +1 -1
  612. package/build/hooks/font-size.js.map +1 -1
  613. package/build/hooks/gap.js.map +1 -1
  614. package/build/hooks/generated-class-name.js.map +1 -1
  615. package/build/hooks/index.js +13 -5
  616. package/build/hooks/index.js.map +1 -1
  617. package/build/hooks/index.native.js.map +1 -1
  618. package/build/hooks/layout-child.js.map +1 -1
  619. package/build/hooks/layout.js +38 -19
  620. package/build/hooks/layout.js.map +1 -1
  621. package/build/hooks/layout.native.js.map +1 -1
  622. package/build/hooks/line-height.js.map +1 -1
  623. package/build/hooks/lock.js.map +1 -1
  624. package/build/hooks/metadata.js.map +1 -1
  625. package/build/hooks/position.js.map +1 -1
  626. package/build/hooks/settings.js.map +1 -1
  627. package/build/hooks/spacing-visualizer.js.map +1 -1
  628. package/build/hooks/style.js.map +1 -1
  629. package/build/hooks/supports.js +27 -4
  630. package/build/hooks/supports.js.map +1 -1
  631. package/build/hooks/text-align.js +156 -0
  632. package/build/hooks/text-align.js.map +1 -0
  633. package/build/hooks/typography.js +3 -2
  634. package/build/hooks/typography.js.map +1 -1
  635. package/build/hooks/typography.native.js.map +1 -1
  636. package/build/hooks/use-bindings-attributes.js +66 -129
  637. package/build/hooks/use-bindings-attributes.js.map +1 -1
  638. package/build/hooks/use-border-props.js.map +1 -1
  639. package/build/hooks/use-cached-truthy.js.map +1 -1
  640. package/build/hooks/use-color-props.js.map +1 -1
  641. package/build/hooks/use-editor-wrapper-styles.native.js.map +1 -1
  642. package/build/hooks/use-shadow-props.js.map +1 -1
  643. package/build/hooks/use-spacing-props.js.map +1 -1
  644. package/build/hooks/use-typography-props.js +2 -1
  645. package/build/hooks/use-typography-props.js.map +1 -1
  646. package/build/hooks/use-zoom-out.js +54 -0
  647. package/build/hooks/use-zoom-out.js.map +1 -0
  648. package/build/hooks/utils.js +29 -5
  649. package/build/hooks/utils.js.map +1 -1
  650. package/build/index.js +7 -0
  651. package/build/index.js.map +1 -1
  652. package/build/index.native.js.map +1 -1
  653. package/build/layouts/constrained.js.map +1 -1
  654. package/build/layouts/definitions.js +8 -6
  655. package/build/layouts/definitions.js.map +1 -1
  656. package/build/layouts/flex.js.map +1 -1
  657. package/build/layouts/flow.js.map +1 -1
  658. package/build/layouts/grid.js +52 -9
  659. package/build/layouts/grid.js.map +1 -1
  660. package/build/layouts/index.js.map +1 -1
  661. package/build/layouts/utils.js.map +1 -1
  662. package/build/lock-unlock.js.map +1 -1
  663. package/build/private-apis.js +7 -2
  664. package/build/private-apis.js.map +1 -1
  665. package/build/private-apis.native.js +4 -2
  666. package/build/private-apis.native.js.map +1 -1
  667. package/build/store/actions.js +18 -4
  668. package/build/store/actions.js.map +1 -1
  669. package/build/store/array.js.map +1 -1
  670. package/build/store/constants.js.map +1 -1
  671. package/build/store/defaults.js.map +1 -1
  672. package/build/store/defaults.native.js.map +1 -1
  673. package/build/store/get-block-settings.js.map +1 -1
  674. package/build/store/index.js +1 -1
  675. package/build/store/index.js.map +1 -1
  676. package/build/store/private-actions.js +18 -2
  677. package/build/store/private-actions.js.map +1 -1
  678. package/build/store/private-keys.js +2 -1
  679. package/build/store/private-keys.js.map +1 -1
  680. package/build/store/private-selectors.js +113 -36
  681. package/build/store/private-selectors.js.map +1 -1
  682. package/build/store/reducer.js +22 -0
  683. package/build/store/reducer.js.map +1 -1
  684. package/build/store/selectors.js +152 -109
  685. package/build/store/selectors.js.map +1 -1
  686. package/build/store/undo-ignore.js.map +1 -1
  687. package/build/store/utils.js +7 -1
  688. package/build/store/utils.js.map +1 -1
  689. package/build/utils/dom.js.map +1 -1
  690. package/build/utils/get-px-from-css-unit.js.map +1 -1
  691. package/build/utils/index.js.map +1 -1
  692. package/build/utils/math.js.map +1 -1
  693. package/build/utils/object.js.map +1 -1
  694. package/build/utils/order-inserter-block-items.js.map +1 -1
  695. package/build/utils/pasting.js.map +1 -1
  696. package/build/utils/selection.js.map +1 -1
  697. package/build/utils/sorting.js.map +1 -1
  698. package/build/utils/transform-styles/index.js +3 -2
  699. package/build/utils/transform-styles/index.js.map +1 -1
  700. package/build/utils/use-notify-copy.js.map +1 -1
  701. package/build-module/autocompleters/block.js.map +1 -1
  702. package/build-module/autocompleters/link.js.map +1 -1
  703. package/build-module/components/alignment-control/index.js.map +1 -1
  704. package/build-module/components/alignment-control/ui.js.map +1 -1
  705. package/build-module/components/autocomplete/index.js.map +1 -1
  706. package/build-module/components/block-actions/index.js.map +1 -1
  707. package/build-module/components/block-alignment-control/constants.js.map +1 -1
  708. package/build-module/components/block-alignment-control/index.js.map +1 -1
  709. package/build-module/components/block-alignment-control/ui.js.map +1 -1
  710. package/build-module/components/block-alignment-control/ui.native.js.map +1 -1
  711. package/build-module/components/block-alignment-control/use-available-alignments.js.map +1 -1
  712. package/build-module/components/block-alignment-matrix-control/index.js.map +1 -1
  713. package/build-module/components/block-bindings-toolbar-indicator/index.js.map +1 -1
  714. package/build-module/components/block-breadcrumb/index.js.map +1 -1
  715. package/build-module/components/block-canvas/index.js.map +1 -1
  716. package/build-module/components/block-caption/index.native.js.map +1 -1
  717. package/build-module/components/block-card/index.js.map +1 -1
  718. package/build-module/components/block-compare/block-view.js.map +1 -1
  719. package/build-module/components/block-compare/index.js.map +1 -1
  720. package/build-module/components/block-content-overlay/index.js.map +1 -1
  721. package/build-module/components/block-context/index.js.map +1 -1
  722. package/build-module/components/block-controls/fill.js.map +1 -1
  723. package/build-module/components/block-controls/groups.js.map +1 -1
  724. package/build-module/components/block-controls/hook.js.map +1 -1
  725. package/build-module/components/block-controls/index.js.map +1 -1
  726. package/build-module/components/block-controls/slot.js.map +1 -1
  727. package/build-module/components/block-controls/slot.native.js.map +1 -1
  728. package/build-module/components/block-controls/use-has-block-controls.js.map +1 -1
  729. package/build-module/components/block-draggable/draggable-chip.js.map +1 -1
  730. package/build-module/components/block-draggable/draggable-chip.native.js.map +1 -1
  731. package/build-module/components/block-draggable/dropping-insertion-point.native.js.map +1 -1
  732. package/build-module/components/block-draggable/index.js.map +1 -1
  733. package/build-module/components/block-draggable/index.native.js.map +1 -1
  734. package/build-module/components/block-draggable/use-scroll-when-dragging.js.map +1 -1
  735. package/build-module/components/block-draggable/use-scroll-when-dragging.native.js.map +1 -1
  736. package/build-module/components/block-edit/context.js +1 -0
  737. package/build-module/components/block-edit/context.js.map +1 -1
  738. package/build-module/components/block-edit/edit.js.map +1 -1
  739. package/build-module/components/block-edit/edit.native.js.map +1 -1
  740. package/build-module/components/block-edit/index.js +5 -3
  741. package/build-module/components/block-edit/index.js.map +1 -1
  742. package/build-module/components/block-edit-visually-button/index.js.map +1 -1
  743. package/build-module/components/block-editing-mode/index.js.map +1 -1
  744. package/build-module/components/block-full-height-alignment-control/index.js.map +1 -1
  745. package/build-module/components/block-heading-level-dropdown/heading-level-icon.js.map +1 -1
  746. package/build-module/components/block-heading-level-dropdown/index.js.map +1 -1
  747. package/build-module/components/block-heading-level-dropdown/index.native.js.map +1 -1
  748. package/build-module/components/block-icon/index.js.map +1 -1
  749. package/build-module/components/block-icon/index.native.js.map +1 -1
  750. package/build-module/components/block-info-slot-fill/index.js.map +1 -1
  751. package/build-module/components/block-inspector/index.js +5 -4
  752. package/build-module/components/block-inspector/index.js.map +1 -1
  753. package/build-module/components/block-inspector/useBlockInspectorAnimationSettings.js.map +1 -1
  754. package/build-module/components/block-list/block-crash-boundary.js.map +1 -1
  755. package/build-module/components/block-list/block-crash-boundary.native.js.map +1 -1
  756. package/build-module/components/block-list/block-crash-warning.js.map +1 -1
  757. package/build-module/components/block-list/block-crash-warning.native.js.map +1 -1
  758. package/build-module/components/block-list/block-html.js.map +1 -1
  759. package/build-module/components/block-list/block-invalid-warning.js.map +1 -1
  760. package/build-module/components/block-list/block-invalid-warning.native.js.map +1 -1
  761. package/build-module/components/block-list/block-list-context.native.js.map +1 -1
  762. package/build-module/components/block-list/block-list-item-cell.native.js.map +1 -1
  763. package/build-module/components/block-list/block-list-item.native.js.map +1 -1
  764. package/build-module/components/block-list/block-outline.native.js.map +1 -1
  765. package/build-module/components/block-list/block-selection-button.native.js.map +1 -1
  766. package/build-module/components/block-list/block.js +55 -29
  767. package/build-module/components/block-list/block.js.map +1 -1
  768. package/build-module/components/block-list/block.native.js +2 -2
  769. package/build-module/components/block-list/block.native.js.map +1 -1
  770. package/build-module/components/block-list/grid-item.native.js.map +1 -1
  771. package/build-module/components/block-list/index.js +16 -5
  772. package/build-module/components/block-list/index.js.map +1 -1
  773. package/build-module/components/block-list/index.native.js.map +1 -1
  774. package/build-module/components/block-list/insertion-point.native.js.map +1 -1
  775. package/build-module/components/block-list/layout.js.map +1 -1
  776. package/build-module/components/block-list/private-block-context.js.map +1 -1
  777. package/build-module/components/block-list/subdirectory-icon.js.map +1 -1
  778. package/build-module/components/block-list/use-block-props/index.js +2 -1
  779. package/build-module/components/block-list/use-block-props/index.js.map +1 -1
  780. package/build-module/components/block-list/use-block-props/index.native.js.map +1 -1
  781. package/build-module/components/block-list/use-block-props/use-block-moving-mode-class-names.js.map +1 -1
  782. package/build-module/components/block-list/use-block-props/use-block-refs.js.map +1 -1
  783. package/build-module/components/block-list/use-block-props/use-focus-first-element.js +3 -2
  784. package/build-module/components/block-list/use-block-props/use-focus-first-element.js.map +1 -1
  785. package/build-module/components/block-list/use-block-props/use-focus-handler.js.map +1 -1
  786. package/build-module/components/block-list/use-block-props/use-intersection-observer.js.map +1 -1
  787. package/build-module/components/block-list/use-block-props/use-is-hovered.js.map +1 -1
  788. package/build-module/components/block-list/use-block-props/use-nav-mode-exit.js.map +1 -1
  789. package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +1 -1
  790. package/build-module/components/block-list/use-in-between-inserter.js.map +1 -1
  791. package/build-module/components/block-list/use-scroll-upon-insertion.native.js.map +1 -1
  792. package/build-module/components/block-list-appender/index.js.map +1 -1
  793. package/build-module/components/block-list-appender/index.native.js.map +1 -1
  794. package/build-module/components/block-lock/index.js.map +1 -1
  795. package/build-module/components/block-lock/menu-item.js.map +1 -1
  796. package/build-module/components/block-lock/modal.js.map +1 -1
  797. package/build-module/components/block-lock/toolbar.js.map +1 -1
  798. package/build-module/components/block-lock/use-block-lock.js.map +1 -1
  799. package/build-module/components/block-media-update-progress/index.native.js.map +1 -1
  800. package/build-module/components/block-mover/button.js +4 -1
  801. package/build-module/components/block-mover/button.js.map +1 -1
  802. package/build-module/components/block-mover/index.js +5 -1
  803. package/build-module/components/block-mover/index.js.map +1 -1
  804. package/build-module/components/block-mover/index.native.js.map +1 -1
  805. package/build-module/components/block-mover/mover-description.js.map +1 -1
  806. package/build-module/components/block-mover/mover-description.native.js.map +1 -1
  807. package/build-module/components/block-navigation/dropdown.js.map +1 -1
  808. package/build-module/components/block-parent-selector/index.js.map +1 -1
  809. package/build-module/components/block-pattern-setup/constants.js.map +1 -1
  810. package/build-module/components/block-pattern-setup/index.js.map +1 -1
  811. package/build-module/components/block-pattern-setup/setup-toolbar.js.map +1 -1
  812. package/build-module/components/block-pattern-setup/use-patterns-setup.js.map +1 -1
  813. package/build-module/components/block-patterns-list/index.js +4 -1
  814. package/build-module/components/block-patterns-list/index.js.map +1 -1
  815. package/build-module/components/block-patterns-paging/index.js +8 -4
  816. package/build-module/components/block-patterns-paging/index.js.map +1 -1
  817. package/build-module/components/block-popover/cover.js.map +1 -1
  818. package/build-module/components/block-popover/drop-zone.js.map +1 -1
  819. package/build-module/components/block-popover/inbetween.js.map +1 -1
  820. package/build-module/components/block-popover/index.js.map +1 -1
  821. package/build-module/components/block-popover/use-popover-scroll.js.map +1 -1
  822. package/build-module/components/block-preview/auto.js.map +1 -1
  823. package/build-module/components/block-preview/index.js.map +1 -1
  824. package/build-module/components/block-quick-navigation/index.js.map +1 -1
  825. package/build-module/components/block-removal-warning-modal/index.js.map +1 -1
  826. package/build-module/components/block-rename/index.js.map +1 -1
  827. package/build-module/components/block-rename/is-empty-string.js.map +1 -1
  828. package/build-module/components/block-rename/modal.js +14 -10
  829. package/build-module/components/block-rename/modal.js.map +1 -1
  830. package/build-module/components/block-rename/rename-control.js +3 -1
  831. package/build-module/components/block-rename/rename-control.js.map +1 -1
  832. package/build-module/components/block-rename/use-block-rename.js.map +1 -1
  833. package/build-module/components/block-selection-clearer/index.js.map +1 -1
  834. package/build-module/components/block-settings/button.native.js.map +1 -1
  835. package/build-module/components/block-settings/container.native.js.map +1 -1
  836. package/build-module/components/block-settings/index.native.js.map +1 -1
  837. package/build-module/components/block-settings-menu/block-html-convert-button.js.map +1 -1
  838. package/build-module/components/block-settings-menu/block-mode-toggle.js.map +1 -1
  839. package/build-module/components/block-settings-menu/block-parent-selector-menu-item.js.map +1 -1
  840. package/build-module/components/block-settings-menu/block-settings-dropdown.js +7 -3
  841. package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  842. package/build-module/components/block-settings-menu/block-settings-menu-first-item.js.map +1 -1
  843. package/build-module/components/block-settings-menu/index.js.map +1 -1
  844. package/build-module/components/block-settings-menu-controls/index.js.map +1 -1
  845. package/build-module/components/block-styles/index.js.map +1 -1
  846. package/build-module/components/block-styles/index.native.js.map +1 -1
  847. package/build-module/components/block-styles/menu-items.js.map +1 -1
  848. package/build-module/components/block-styles/preview-panel.js.map +1 -1
  849. package/build-module/components/block-styles/preview.native.js.map +1 -1
  850. package/build-module/components/block-styles/use-styles-for-block.js.map +1 -1
  851. package/build-module/components/block-styles/utils.js.map +1 -1
  852. package/build-module/components/block-switcher/block-styles-menu.js.map +1 -1
  853. package/build-module/components/block-switcher/block-transformations-menu.js.map +1 -1
  854. package/build-module/components/block-switcher/block-transformations-menu.native.js.map +1 -1
  855. package/build-module/components/block-switcher/block-variation-transformations.js.map +1 -1
  856. package/build-module/components/block-switcher/index.js +4 -3
  857. package/build-module/components/block-switcher/index.js.map +1 -1
  858. package/build-module/components/block-switcher/pattern-transformations-menu.js.map +1 -1
  859. package/build-module/components/block-switcher/preview-block-popover.js.map +1 -1
  860. package/build-module/components/block-switcher/use-transformed-patterns.js.map +1 -1
  861. package/build-module/components/block-switcher/utils.js.map +1 -1
  862. package/build-module/components/block-title/index.js.map +1 -1
  863. package/build-module/components/block-title/use-block-display-title.js.map +1 -1
  864. package/build-module/components/block-toolbar/block-name-context.js.map +1 -1
  865. package/build-module/components/block-toolbar/block-toolbar-last-item.js.map +1 -1
  866. package/build-module/components/block-toolbar/block-toolbar-menu.native.js.map +1 -1
  867. package/build-module/components/block-toolbar/index.js +5 -4
  868. package/build-module/components/block-toolbar/index.js.map +1 -1
  869. package/build-module/components/block-toolbar/index.native.js.map +1 -1
  870. package/build-module/components/block-toolbar/shuffle.js +18 -9
  871. package/build-module/components/block-toolbar/shuffle.js.map +1 -1
  872. package/build-module/components/block-toolbar/use-has-block-toolbar.js +6 -3
  873. package/build-module/components/block-toolbar/use-has-block-toolbar.js.map +1 -1
  874. package/build-module/components/block-toolbar/utils.js.map +1 -1
  875. package/build-module/components/block-tools/block-selection-button.js +58 -14
  876. package/build-module/components/block-tools/block-selection-button.js.map +1 -1
  877. package/build-module/components/block-tools/block-toolbar-breadcrumb.js.map +1 -1
  878. package/build-module/components/block-tools/block-toolbar-popover.js.map +1 -1
  879. package/build-module/components/block-tools/empty-block-inserter.js.map +1 -1
  880. package/build-module/components/block-tools/index.js +14 -2
  881. package/build-module/components/block-tools/index.js.map +1 -1
  882. package/build-module/components/block-tools/insertion-point.js.map +1 -1
  883. package/build-module/components/block-tools/use-block-toolbar-popover-props.js.map +1 -1
  884. package/build-module/components/block-tools/use-selected-block-tool-props.js.map +1 -1
  885. package/build-module/components/block-tools/use-show-block-tools.js +7 -13
  886. package/build-module/components/block-tools/use-show-block-tools.js.map +1 -1
  887. package/build-module/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
  888. package/build-module/components/block-types-list/index.js.map +1 -1
  889. package/build-module/components/block-types-list/index.native.js.map +1 -1
  890. package/build-module/components/block-variation-picker/index.js.map +1 -1
  891. package/build-module/components/block-variation-picker/index.native.js.map +1 -1
  892. package/build-module/components/block-variation-transforms/index.js +4 -1
  893. package/build-module/components/block-variation-transforms/index.js.map +1 -1
  894. package/build-module/components/block-vertical-alignment-control/icons.js.map +1 -1
  895. package/build-module/components/block-vertical-alignment-control/index.js.map +1 -1
  896. package/build-module/components/block-vertical-alignment-control/ui.js.map +1 -1
  897. package/build-module/components/border-radius-control/all-input-control.js.map +1 -1
  898. package/build-module/components/border-radius-control/index.js.map +1 -1
  899. package/build-module/components/border-radius-control/input-controls.js.map +1 -1
  900. package/build-module/components/border-radius-control/linked-button.js.map +1 -1
  901. package/build-module/components/border-radius-control/utils.js.map +1 -1
  902. package/build-module/components/button-block-appender/index.js.map +1 -1
  903. package/build-module/components/button-block-appender/index.native.js +11 -1
  904. package/build-module/components/button-block-appender/index.native.js.map +1 -1
  905. package/build-module/components/caption/index.native.js.map +1 -1
  906. package/build-module/components/child-layout-control/index.js.map +1 -1
  907. package/build-module/components/color-palette/control.js.map +1 -1
  908. package/build-module/components/color-palette/index.js.map +1 -1
  909. package/build-module/components/color-palette/with-color-context.js.map +1 -1
  910. package/build-module/components/color-style-selector/index.js.map +1 -1
  911. package/build-module/components/colors/index.js.map +1 -1
  912. package/build-module/components/colors/utils.js.map +1 -1
  913. package/build-module/components/colors/with-colors.js.map +1 -1
  914. package/build-module/components/colors-gradients/control.js.map +1 -1
  915. package/build-module/components/colors-gradients/dropdown.js.map +1 -1
  916. package/build-module/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
  917. package/build-module/components/colors-gradients/panel-color-gradient-settings.native.js.map +1 -1
  918. package/build-module/components/colors-gradients/use-multiple-origin-colors-and-gradients.js.map +1 -1
  919. package/build-module/components/contrast-checker/index.js.map +1 -1
  920. package/build-module/components/contrast-checker/index.native.js.map +1 -1
  921. package/build-module/components/convert-to-group-buttons/index.js.map +1 -1
  922. package/build-module/components/convert-to-group-buttons/index.native.js.map +1 -1
  923. package/build-module/components/convert-to-group-buttons/toolbar.js.map +1 -1
  924. package/build-module/components/convert-to-group-buttons/use-convert-to-group-button-props.js.map +1 -1
  925. package/build-module/components/copy-handler/index.js.map +1 -1
  926. package/build-module/components/date-format-picker/index.js.map +1 -1
  927. package/build-module/components/default-block-appender/index.js.map +1 -1
  928. package/build-module/components/default-block-appender/index.native.js.map +1 -1
  929. package/build-module/components/dimensions-tool/aspect-ratio-tool.js.map +1 -1
  930. package/build-module/components/dimensions-tool/index.js.map +1 -1
  931. package/build-module/components/dimensions-tool/scale-tool.js.map +1 -1
  932. package/build-module/components/dimensions-tool/width-height-tool.js.map +1 -1
  933. package/build-module/components/duotone/utils.js.map +1 -1
  934. package/build-module/components/duotone-control/index.js.map +1 -1
  935. package/build-module/components/editable-text/index.js.map +1 -1
  936. package/build-module/components/editor-styles/index.js +3 -2
  937. package/build-module/components/editor-styles/index.js.map +1 -1
  938. package/build-module/components/floating-toolbar/index.native.js.map +1 -1
  939. package/build-module/components/floating-toolbar/nav-up-icon.js.map +1 -1
  940. package/build-module/components/font-appearance-control/index.js.map +1 -1
  941. package/build-module/components/font-family/index.js.map +1 -1
  942. package/build-module/components/font-sizes/fluid-utils.js.map +1 -1
  943. package/build-module/components/font-sizes/font-size-picker.js.map +1 -1
  944. package/build-module/components/font-sizes/index.js.map +1 -1
  945. package/build-module/components/font-sizes/index.native.js.map +1 -1
  946. package/build-module/components/font-sizes/utils.js.map +1 -1
  947. package/build-module/components/font-sizes/with-font-sizes.js.map +1 -1
  948. package/build-module/components/global-styles/advanced-panel.js +9 -2
  949. package/build-module/components/global-styles/advanced-panel.js.map +1 -1
  950. package/build-module/components/global-styles/background-panel.js +433 -0
  951. package/build-module/components/global-styles/background-panel.js.map +1 -0
  952. package/build-module/components/global-styles/border-panel.js.map +1 -1
  953. package/build-module/components/global-styles/color-panel.js +2 -1
  954. package/build-module/components/global-styles/color-panel.js.map +1 -1
  955. package/build-module/components/global-styles/color-panel.native.js.map +1 -1
  956. package/build-module/components/global-styles/context.js.map +1 -1
  957. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  958. package/build-module/components/global-styles/filters-panel.js.map +1 -1
  959. package/build-module/components/global-styles/get-block-css-selector.js.map +1 -1
  960. package/build-module/components/global-styles/get-global-styles-changes.js +3 -0
  961. package/build-module/components/global-styles/get-global-styles-changes.js.map +1 -1
  962. package/build-module/components/global-styles/hooks.js +1 -1
  963. package/build-module/components/global-styles/hooks.js.map +1 -1
  964. package/build-module/components/global-styles/image-settings-panel.js.map +1 -1
  965. package/build-module/components/global-styles/index.js +1 -0
  966. package/build-module/components/global-styles/index.js.map +1 -1
  967. package/build-module/components/global-styles/shadow-panel-components.js.map +1 -1
  968. package/build-module/components/global-styles/typography-panel.js.map +1 -1
  969. package/build-module/components/global-styles/typography-utils.js.map +1 -1
  970. package/build-module/components/global-styles/use-global-styles-output.js +20 -19
  971. package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
  972. package/build-module/components/global-styles/utils.js +1 -0
  973. package/build-module/components/global-styles/utils.js.map +1 -1
  974. package/build-module/components/gradients/index.js.map +1 -1
  975. package/build-module/components/gradients/index.native.js.map +1 -1
  976. package/build-module/components/gradients/use-gradient.js.map +1 -1
  977. package/build-module/components/gradients/with-gradient.js.map +1 -1
  978. package/build-module/components/grid-visualizer/grid-item-resizer.js.map +1 -1
  979. package/build-module/components/grid-visualizer/grid-visualizer.js.map +1 -1
  980. package/build-module/components/grid-visualizer/index.js.map +1 -1
  981. package/build-module/components/grid-visualizer/utils.js.map +1 -1
  982. package/build-module/components/height-control/index.js.map +1 -1
  983. package/build-module/components/iframe/get-compatibility-styles.js.map +1 -1
  984. package/build-module/components/iframe/index.js +14 -10
  985. package/build-module/components/iframe/index.js.map +1 -1
  986. package/build-module/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
  987. package/build-module/components/image-editor/constants.js.map +1 -1
  988. package/build-module/components/image-editor/context.js.map +1 -1
  989. package/build-module/components/image-editor/cropper.js +7 -3
  990. package/build-module/components/image-editor/cropper.js.map +1 -1
  991. package/build-module/components/image-editor/form-controls.js.map +1 -1
  992. package/build-module/components/image-editor/index.js +0 -2
  993. package/build-module/components/image-editor/index.js.map +1 -1
  994. package/build-module/components/image-editor/rotation-button.js.map +1 -1
  995. package/build-module/components/image-editor/use-save-image.js.map +1 -1
  996. package/build-module/components/image-editor/use-transform-image.js.map +1 -1
  997. package/build-module/components/image-editor/zoom-dropdown.js.map +1 -1
  998. package/build-module/components/image-link-destinations/index.native.js.map +1 -1
  999. package/build-module/components/image-size-control/index.js.map +1 -1
  1000. package/build-module/components/image-size-control/use-dimension-handler.js.map +1 -1
  1001. package/build-module/components/index.js.map +1 -1
  1002. package/build-module/components/index.native.js.map +1 -1
  1003. package/build-module/components/inner-blocks/button-block-appender.js.map +1 -1
  1004. package/build-module/components/inner-blocks/constants.native.js.map +1 -1
  1005. package/build-module/components/inner-blocks/default-block-appender.js.map +1 -1
  1006. package/build-module/components/inner-blocks/index.js.map +1 -1
  1007. package/build-module/components/inner-blocks/index.native.js.map +1 -1
  1008. package/build-module/components/inner-blocks/use-block-context.js.map +1 -1
  1009. package/build-module/components/inner-blocks/use-inner-block-template-sync.js.map +1 -1
  1010. package/build-module/components/inner-blocks/use-nested-settings-update.js.map +1 -1
  1011. package/build-module/components/inner-blocks/warning-max-depth-exceeded.native.js.map +1 -1
  1012. package/build-module/components/inner-blocks/with-client-id.js.map +1 -1
  1013. package/build-module/components/inserter/block-patterns-explorer/index.js.map +1 -1
  1014. package/build-module/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js.map +1 -1
  1015. package/build-module/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
  1016. package/build-module/components/inserter/block-patterns-tab/index.js +32 -19
  1017. package/build-module/components/inserter/block-patterns-tab/index.js.map +1 -1
  1018. package/build-module/components/inserter/block-patterns-tab/pattern-category-preview-panel.js +2 -19
  1019. package/build-module/components/inserter/block-patterns-tab/pattern-category-preview-panel.js.map +1 -1
  1020. package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js +2 -4
  1021. package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
  1022. package/build-module/components/inserter/block-patterns-tab/patterns-filter.js.map +1 -1
  1023. package/build-module/components/inserter/block-patterns-tab/use-pattern-categories.js.map +1 -1
  1024. package/build-module/components/inserter/block-patterns-tab/utils.js.map +1 -1
  1025. package/build-module/components/inserter/block-types-tab.js.map +1 -1
  1026. package/build-module/components/inserter/block-types-tab.native.js.map +1 -1
  1027. package/build-module/components/inserter/hooks/use-block-type-impressions.native.js.map +1 -1
  1028. package/build-module/components/inserter/hooks/use-block-types-state.js.map +1 -1
  1029. package/build-module/components/inserter/hooks/use-clipboard-block.native.js.map +1 -1
  1030. package/build-module/components/inserter/hooks/use-insertion-point.js.map +1 -1
  1031. package/build-module/components/inserter/hooks/use-patterns-paging.js.map +1 -1
  1032. package/build-module/components/inserter/hooks/use-patterns-state.js.map +1 -1
  1033. package/build-module/components/inserter/index.js.map +1 -1
  1034. package/build-module/components/inserter/index.native.js.map +1 -1
  1035. package/build-module/components/inserter/library.js +2 -0
  1036. package/build-module/components/inserter/library.js.map +1 -1
  1037. package/build-module/components/inserter/media-tab/hooks.js.map +1 -1
  1038. package/build-module/components/inserter/media-tab/index.js.map +1 -1
  1039. package/build-module/components/inserter/media-tab/media-list.js.map +1 -1
  1040. package/build-module/components/inserter/media-tab/media-panel.js.map +1 -1
  1041. package/build-module/components/inserter/media-tab/media-preview.js.map +1 -1
  1042. package/build-module/components/inserter/media-tab/media-tab.js.map +1 -1
  1043. package/build-module/components/inserter/media-tab/utils.js.map +1 -1
  1044. package/build-module/components/inserter/menu.js +25 -13
  1045. package/build-module/components/inserter/menu.js.map +1 -1
  1046. package/build-module/components/inserter/menu.native.js.map +1 -1
  1047. package/build-module/components/inserter/mobile-tab-navigation.js.map +1 -1
  1048. package/build-module/components/inserter/no-results.js.map +1 -1
  1049. package/build-module/components/inserter/no-results.native.js.map +1 -1
  1050. package/build-module/components/inserter/panel.js.map +1 -1
  1051. package/build-module/components/inserter/preview-panel.js.map +1 -1
  1052. package/build-module/components/inserter/quick-inserter.js.map +1 -1
  1053. package/build-module/components/inserter/reusable-block-rename-hint.js.map +1 -1
  1054. package/build-module/components/inserter/reusable-blocks-tab.native.js.map +1 -1
  1055. package/build-module/components/inserter/search-items.js +33 -15
  1056. package/build-module/components/inserter/search-items.js.map +1 -1
  1057. package/build-module/components/inserter/search-results.js.map +1 -1
  1058. package/build-module/components/inserter/search-results.native.js.map +1 -1
  1059. package/build-module/components/inserter/tabs.js +7 -3
  1060. package/build-module/components/inserter/tabs.js.map +1 -1
  1061. package/build-module/components/inserter/tabs.native.js.map +1 -1
  1062. package/build-module/components/inserter/tips.js.map +1 -1
  1063. package/build-module/components/inserter/utils.native.js.map +1 -1
  1064. package/build-module/components/inserter-button/index.native.js.map +1 -1
  1065. package/build-module/components/inserter-button/sparkles.js.map +1 -1
  1066. package/build-module/components/inserter-draggable-blocks/index.js.map +1 -1
  1067. package/build-module/components/inserter-list-item/index.js.map +1 -1
  1068. package/build-module/components/inserter-listbox/context.js.map +1 -1
  1069. package/build-module/components/inserter-listbox/group.js.map +1 -1
  1070. package/build-module/components/inserter-listbox/index.js.map +1 -1
  1071. package/build-module/components/inserter-listbox/item.js.map +1 -1
  1072. package/build-module/components/inserter-listbox/row.js.map +1 -1
  1073. package/build-module/components/inserter-menu-extension/index.js.map +1 -1
  1074. package/build-module/components/inspector-controls/block-support-slot-container.js.map +1 -1
  1075. package/build-module/components/inspector-controls/block-support-tools-panel.js.map +1 -1
  1076. package/build-module/components/inspector-controls/fill.js.map +1 -1
  1077. package/build-module/components/inspector-controls/fill.native.js.map +1 -1
  1078. package/build-module/components/inspector-controls/groups.js.map +1 -1
  1079. package/build-module/components/inspector-controls/index.js.map +1 -1
  1080. package/build-module/components/inspector-controls/slot.js.map +1 -1
  1081. package/build-module/components/inspector-controls/slot.native.js.map +1 -1
  1082. package/build-module/components/inspector-controls-tabs/advanced-controls-panel.js.map +1 -1
  1083. package/build-module/components/inspector-controls-tabs/advanced-controls-panel.native.js.map +1 -1
  1084. package/build-module/components/inspector-controls-tabs/index.js.map +1 -1
  1085. package/build-module/components/inspector-controls-tabs/position-controls-panel.js.map +1 -1
  1086. package/build-module/components/inspector-controls-tabs/settings-tab-hint.js.map +1 -1
  1087. package/build-module/components/inspector-controls-tabs/settings-tab.js.map +1 -1
  1088. package/build-module/components/inspector-controls-tabs/styles-tab.js +1 -1
  1089. package/build-module/components/inspector-controls-tabs/styles-tab.js.map +1 -1
  1090. package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +1 -1
  1091. package/build-module/components/inspector-controls-tabs/use-is-list-view-tab-disabled.js.map +1 -1
  1092. package/build-module/components/inspector-controls-tabs/utils.js.map +1 -1
  1093. package/build-module/components/inspector-popover-header/index.js.map +1 -1
  1094. package/build-module/components/justify-content-control/index.js.map +1 -1
  1095. package/build-module/components/justify-content-control/ui.js.map +1 -1
  1096. package/build-module/components/keyboard-shortcuts/index.js +11 -0
  1097. package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
  1098. package/build-module/components/letter-spacing-control/index.js.map +1 -1
  1099. package/build-module/components/line-height-control/index.js.map +1 -1
  1100. package/build-module/components/line-height-control/index.native.js.map +1 -1
  1101. package/build-module/components/line-height-control/utils.js.map +1 -1
  1102. package/build-module/components/link-control/constants.js.map +1 -1
  1103. package/build-module/components/link-control/index.js.map +1 -1
  1104. package/build-module/components/link-control/is-url-like.js.map +1 -1
  1105. package/build-module/components/link-control/link-preview.js.map +1 -1
  1106. package/build-module/components/link-control/search-create-button.js.map +1 -1
  1107. package/build-module/components/link-control/search-input.js.map +1 -1
  1108. package/build-module/components/link-control/search-item.js.map +1 -1
  1109. package/build-module/components/link-control/search-results.js.map +1 -1
  1110. package/build-module/components/link-control/settings-drawer.js.map +1 -1
  1111. package/build-module/components/link-control/settings.js.map +1 -1
  1112. package/build-module/components/link-control/use-create-page.js.map +1 -1
  1113. package/build-module/components/link-control/use-internal-value.js.map +1 -1
  1114. package/build-module/components/link-control/use-rich-url-data.js.map +1 -1
  1115. package/build-module/components/link-control/use-search-handler.js.map +1 -1
  1116. package/build-module/components/link-control/viewer-slot.js.map +1 -1
  1117. package/build-module/components/list-view/appender.js.map +1 -1
  1118. package/build-module/components/list-view/aria-referenced-text.js.map +1 -1
  1119. package/build-module/components/list-view/block-contents.js.map +1 -1
  1120. package/build-module/components/list-view/block-select-button.js +45 -1
  1121. package/build-module/components/list-view/block-select-button.js.map +1 -1
  1122. package/build-module/components/list-view/block.js +1 -1
  1123. package/build-module/components/list-view/block.js.map +1 -1
  1124. package/build-module/components/list-view/branch.js.map +1 -1
  1125. package/build-module/components/list-view/context.js.map +1 -1
  1126. package/build-module/components/list-view/drop-indicator.js.map +1 -1
  1127. package/build-module/components/list-view/expander.js.map +1 -1
  1128. package/build-module/components/list-view/index.js +17 -2
  1129. package/build-module/components/list-view/index.js.map +1 -1
  1130. package/build-module/components/list-view/leaf.js.map +1 -1
  1131. package/build-module/components/list-view/use-block-selection.js.map +1 -1
  1132. package/build-module/components/list-view/use-clipboard-handler.js.map +1 -1
  1133. package/build-module/components/list-view/use-list-view-block-indexes.js.map +1 -1
  1134. package/build-module/components/list-view/use-list-view-client-ids.js.map +1 -1
  1135. package/build-module/components/list-view/use-list-view-collapse-items.js +40 -0
  1136. package/build-module/components/list-view/use-list-view-collapse-items.js.map +1 -0
  1137. package/build-module/components/list-view/use-list-view-drop-zone.js +5 -0
  1138. package/build-module/components/list-view/use-list-view-drop-zone.js.map +1 -1
  1139. package/build-module/components/list-view/use-list-view-expand-selected-item.js.map +1 -1
  1140. package/build-module/components/list-view/use-list-view-images.js.map +1 -1
  1141. package/build-module/components/list-view/use-list-view-scroll-into-view.js.map +1 -1
  1142. package/build-module/components/list-view/utils.js.map +1 -1
  1143. package/build-module/components/media-placeholder/index.js.map +1 -1
  1144. package/build-module/components/media-placeholder/index.native.js.map +1 -1
  1145. package/build-module/components/media-replace-flow/index.js.map +1 -1
  1146. package/build-module/components/media-replace-flow/index.native.js.map +1 -1
  1147. package/build-module/components/media-upload/check.js.map +1 -1
  1148. package/build-module/components/media-upload/constants.native.js.map +1 -1
  1149. package/build-module/components/media-upload/index.js.map +1 -1
  1150. package/build-module/components/media-upload/index.native.js.map +1 -1
  1151. package/build-module/components/media-upload-progress/constants.js.map +1 -1
  1152. package/build-module/components/media-upload-progress/index.native.js.map +1 -1
  1153. package/build-module/components/multi-selection-inspector/index.js.map +1 -1
  1154. package/build-module/components/navigable-toolbar/index.js.map +1 -1
  1155. package/build-module/components/observe-typing/index.js.map +1 -1
  1156. package/build-module/components/panel-color-settings/index.js.map +1 -1
  1157. package/build-module/components/plain-text/index.js.map +1 -1
  1158. package/build-module/components/plain-text/index.native.js.map +1 -1
  1159. package/build-module/components/preview-options/index.js.map +1 -1
  1160. package/build-module/components/provider/block-refs-provider.js.map +1 -1
  1161. package/build-module/components/provider/index.js.map +1 -1
  1162. package/build-module/components/provider/index.native.js.map +1 -1
  1163. package/build-module/components/provider/use-block-sync.js.map +1 -1
  1164. package/build-module/components/provider/with-registry-provider.js.map +1 -1
  1165. package/build-module/components/publish-date-time-picker/index.js.map +1 -1
  1166. package/build-module/components/recursion-provider/index.js +2 -2
  1167. package/build-module/components/recursion-provider/index.js.map +1 -1
  1168. package/build-module/components/resizable-box-popover/index.js.map +1 -1
  1169. package/build-module/components/resolution-tool/index.js.map +1 -1
  1170. package/build-module/components/responsive-block-control/index.js.map +1 -1
  1171. package/build-module/components/responsive-block-control/label.js.map +1 -1
  1172. package/build-module/components/rich-text/content.js +25 -19
  1173. package/build-module/components/rich-text/content.js.map +1 -1
  1174. package/build-module/components/rich-text/embed-handler-picker.native.js.map +1 -1
  1175. package/build-module/components/rich-text/file-paste-handler.native.js.map +1 -1
  1176. package/build-module/components/rich-text/format-edit.js.map +1 -1
  1177. package/build-module/components/rich-text/format-toolbar/index.js.map +1 -1
  1178. package/build-module/components/rich-text/format-toolbar/index.native.js.map +1 -1
  1179. package/build-module/components/rich-text/format-toolbar-container.js.map +1 -1
  1180. package/build-module/components/rich-text/format-toolbar-container.native.js.map +1 -1
  1181. package/build-module/components/rich-text/get-rich-text-values.js.map +1 -1
  1182. package/build-module/components/rich-text/index.js +57 -14
  1183. package/build-module/components/rich-text/index.js.map +1 -1
  1184. package/build-module/components/rich-text/index.native.js +19 -12
  1185. package/build-module/components/rich-text/index.native.js.map +1 -1
  1186. package/build-module/components/rich-text/input-event.js.map +1 -1
  1187. package/build-module/components/rich-text/input-event.native.js.map +1 -1
  1188. package/build-module/components/rich-text/multiline.js.map +1 -1
  1189. package/build-module/components/rich-text/native/format-edit.js.map +1 -1
  1190. package/build-module/components/rich-text/native/get-format-colors.native.js +1 -1
  1191. package/build-module/components/rich-text/native/get-format-colors.native.js.map +1 -1
  1192. package/build-module/components/rich-text/native/index.js.map +1 -1
  1193. package/build-module/components/rich-text/native/index.native.js +2 -2
  1194. package/build-module/components/rich-text/native/index.native.js.map +1 -1
  1195. package/build-module/components/rich-text/native/toolbar-button-with-options.native.js.map +1 -1
  1196. package/build-module/components/rich-text/native/use-format-types.js.map +1 -1
  1197. package/build-module/components/rich-text/prevent-event-discovery.js.map +1 -1
  1198. package/build-module/components/rich-text/remove-browser-shortcuts.native.js.map +1 -1
  1199. package/build-module/components/rich-text/shortcut.js.map +1 -1
  1200. package/build-module/components/rich-text/shortcut.native.js.map +1 -1
  1201. package/build-module/components/rich-text/split-value.js.map +1 -1
  1202. package/build-module/components/rich-text/toolbar-button.js.map +1 -1
  1203. package/build-module/components/rich-text/use-before-input-rules.js.map +1 -1
  1204. package/build-module/components/rich-text/use-delete.js.map +1 -1
  1205. package/build-module/components/rich-text/use-enter.js.map +1 -1
  1206. package/build-module/components/rich-text/use-firefox-compat.js.map +1 -1
  1207. package/build-module/components/rich-text/use-format-types.js.map +1 -1
  1208. package/build-module/components/rich-text/use-input-events.js.map +1 -1
  1209. package/build-module/components/rich-text/use-input-rules.js.map +1 -1
  1210. package/build-module/components/rich-text/use-insert-replacement-text.js.map +1 -1
  1211. package/build-module/components/rich-text/use-mark-persistent.js.map +1 -1
  1212. package/build-module/components/rich-text/use-paste-handler.js.map +1 -1
  1213. package/build-module/components/rich-text/use-remove-browser-shortcuts.js.map +1 -1
  1214. package/build-module/components/rich-text/use-shortcuts.js.map +1 -1
  1215. package/build-module/components/rich-text/use-undo-automatic-change.js +2 -2
  1216. package/build-module/components/rich-text/use-undo-automatic-change.js.map +1 -1
  1217. package/build-module/components/rich-text/utils.js.map +1 -1
  1218. package/build-module/components/rich-text/with-deprecations.js +0 -3
  1219. package/build-module/components/rich-text/with-deprecations.js.map +1 -1
  1220. package/build-module/components/selection-scroll-into-view/index.js.map +1 -1
  1221. package/build-module/components/skip-to-selected-block/index.js.map +1 -1
  1222. package/build-module/components/spacing-sizes-control/hooks/use-spacing-sizes.js.map +1 -1
  1223. package/build-module/components/spacing-sizes-control/index.js.map +1 -1
  1224. package/build-module/components/spacing-sizes-control/input-controls/axial.js.map +1 -1
  1225. package/build-module/components/spacing-sizes-control/input-controls/separated.js.map +1 -1
  1226. package/build-module/components/spacing-sizes-control/input-controls/single.js.map +1 -1
  1227. package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
  1228. package/build-module/components/spacing-sizes-control/sides-dropdown/index.js.map +1 -1
  1229. package/build-module/components/spacing-sizes-control/utils.js.map +1 -1
  1230. package/build-module/components/text-decoration-control/index.js.map +1 -1
  1231. package/build-module/components/text-transform-control/index.js.map +1 -1
  1232. package/build-module/components/tool-selector/index.js.map +1 -1
  1233. package/build-module/components/typewriter/index.js.map +1 -1
  1234. package/build-module/components/ungroup-button/index.native.js.map +1 -1
  1235. package/build-module/components/unit-control/index.js.map +1 -1
  1236. package/build-module/components/unsupported-block-details/index.native.js.map +1 -1
  1237. package/build-module/components/url-input/button.js.map +1 -1
  1238. package/build-module/components/url-input/index.js.map +1 -1
  1239. package/build-module/components/url-input/index.native.js.map +1 -1
  1240. package/build-module/components/url-popover/image-url-input-ui.js +50 -36
  1241. package/build-module/components/url-popover/image-url-input-ui.js.map +1 -1
  1242. package/build-module/components/url-popover/index.js.map +1 -1
  1243. package/build-module/components/url-popover/link-editor.js.map +1 -1
  1244. package/build-module/components/url-popover/link-viewer-url.js.map +1 -1
  1245. package/build-module/components/url-popover/link-viewer.js.map +1 -1
  1246. package/build-module/components/use-block-commands/index.js +20 -2
  1247. package/build-module/components/use-block-commands/index.js.map +1 -1
  1248. package/build-module/components/use-block-display-information/index.js +5 -7
  1249. package/build-module/components/use-block-display-information/index.js.map +1 -1
  1250. package/build-module/components/use-block-drop-zone/index.js.map +1 -1
  1251. package/build-module/components/use-block-drop-zone/index.native.js.map +1 -1
  1252. package/build-module/components/use-flash-editable-blocks/index.js.map +1 -1
  1253. package/build-module/components/use-moving-animation/index.js.map +1 -1
  1254. package/build-module/components/use-on-block-drop/index.js.map +1 -1
  1255. package/build-module/components/use-on-block-drop/index.native.js.map +1 -1
  1256. package/build-module/components/use-on-block-drop/types.js.map +1 -1
  1257. package/build-module/components/use-paste-styles/index.js +2 -1
  1258. package/build-module/components/use-paste-styles/index.js.map +1 -1
  1259. package/build-module/components/use-resize-canvas/index.js.map +1 -1
  1260. package/build-module/components/use-settings/index.js.map +1 -1
  1261. package/build-module/components/use-unsupported-block-editor/index.native.js.map +1 -1
  1262. package/build-module/components/video-player/gridicon-play.native.js.map +1 -1
  1263. package/build-module/components/video-player/index.native.js.map +1 -1
  1264. package/build-module/components/warning/index.js.map +1 -1
  1265. package/build-module/components/warning/index.native.js.map +1 -1
  1266. package/build-module/components/writing-flow/index.js.map +1 -1
  1267. package/build-module/components/writing-flow/use-arrow-nav.js.map +1 -1
  1268. package/build-module/components/writing-flow/use-click-selection.js.map +1 -1
  1269. package/build-module/components/writing-flow/use-clipboard-handler.js.map +1 -1
  1270. package/build-module/components/writing-flow/use-drag-selection.js.map +1 -1
  1271. package/build-module/components/writing-flow/use-input.js.map +1 -1
  1272. package/build-module/components/writing-flow/use-multi-selection.js.map +1 -1
  1273. package/build-module/components/writing-flow/use-select-all.js.map +1 -1
  1274. package/build-module/components/writing-flow/use-selection-observer.js.map +1 -1
  1275. package/build-module/components/writing-flow/use-tab-nav.js.map +1 -1
  1276. package/build-module/components/writing-flow/utils.js.map +1 -1
  1277. package/build-module/components/writing-mode-control/index.js.map +1 -1
  1278. package/build-module/elements/index.js.map +1 -1
  1279. package/build-module/hooks/align.js.map +1 -1
  1280. package/build-module/hooks/align.native.js.map +1 -1
  1281. package/build-module/hooks/anchor.js +2 -2
  1282. package/build-module/hooks/anchor.js.map +1 -1
  1283. package/build-module/hooks/aria-label.js.map +1 -1
  1284. package/build-module/hooks/background.js +67 -419
  1285. package/build-module/hooks/background.js.map +1 -1
  1286. package/build-module/hooks/block-hooks.js.map +1 -1
  1287. package/build-module/hooks/block-renaming.js +0 -36
  1288. package/build-module/hooks/block-renaming.js.map +1 -1
  1289. package/build-module/hooks/border.js.map +1 -1
  1290. package/build-module/hooks/color.js.map +1 -1
  1291. package/build-module/hooks/compat.js.map +1 -1
  1292. package/build-module/hooks/content-lock-ui.js +5 -5
  1293. package/build-module/hooks/content-lock-ui.js.map +1 -1
  1294. package/build-module/hooks/contrast-checker.js.map +1 -1
  1295. package/build-module/hooks/custom-class-name.js.map +1 -1
  1296. package/build-module/hooks/custom-class-name.native.js.map +1 -1
  1297. package/build-module/hooks/dimensions.js.map +1 -1
  1298. package/build-module/hooks/duotone.js.map +1 -1
  1299. package/build-module/hooks/font-family.js.map +1 -1
  1300. package/build-module/hooks/font-size.js.map +1 -1
  1301. package/build-module/hooks/gap.js.map +1 -1
  1302. package/build-module/hooks/generated-class-name.js.map +1 -1
  1303. package/build-module/hooks/index.js +6 -4
  1304. package/build-module/hooks/index.js.map +1 -1
  1305. package/build-module/hooks/index.native.js.map +1 -1
  1306. package/build-module/hooks/layout-child.js.map +1 -1
  1307. package/build-module/hooks/layout.js +38 -19
  1308. package/build-module/hooks/layout.js.map +1 -1
  1309. package/build-module/hooks/layout.native.js.map +1 -1
  1310. package/build-module/hooks/line-height.js.map +1 -1
  1311. package/build-module/hooks/lock.js.map +1 -1
  1312. package/build-module/hooks/metadata.js.map +1 -1
  1313. package/build-module/hooks/position.js.map +1 -1
  1314. package/build-module/hooks/settings.js.map +1 -1
  1315. package/build-module/hooks/spacing-visualizer.js.map +1 -1
  1316. package/build-module/hooks/style.js.map +1 -1
  1317. package/build-module/hooks/supports.js +22 -1
  1318. package/build-module/hooks/supports.js.map +1 -1
  1319. package/build-module/hooks/text-align.js +145 -0
  1320. package/build-module/hooks/text-align.js.map +1 -0
  1321. package/build-module/hooks/typography.js +2 -1
  1322. package/build-module/hooks/typography.js.map +1 -1
  1323. package/build-module/hooks/typography.native.js.map +1 -1
  1324. package/build-module/hooks/use-bindings-attributes.js +68 -132
  1325. package/build-module/hooks/use-bindings-attributes.js.map +1 -1
  1326. package/build-module/hooks/use-border-props.js.map +1 -1
  1327. package/build-module/hooks/use-cached-truthy.js.map +1 -1
  1328. package/build-module/hooks/use-color-props.js.map +1 -1
  1329. package/build-module/hooks/use-editor-wrapper-styles.native.js.map +1 -1
  1330. package/build-module/hooks/use-shadow-props.js.map +1 -1
  1331. package/build-module/hooks/use-spacing-props.js.map +1 -1
  1332. package/build-module/hooks/use-typography-props.js +2 -1
  1333. package/build-module/hooks/use-typography-props.js.map +1 -1
  1334. package/build-module/hooks/use-zoom-out.js +48 -0
  1335. package/build-module/hooks/use-zoom-out.js.map +1 -0
  1336. package/build-module/hooks/utils.js +30 -6
  1337. package/build-module/hooks/utils.js.map +1 -1
  1338. package/build-module/index.js +1 -1
  1339. package/build-module/index.js.map +1 -1
  1340. package/build-module/index.native.js.map +1 -1
  1341. package/build-module/layouts/constrained.js.map +1 -1
  1342. package/build-module/layouts/definitions.js +8 -6
  1343. package/build-module/layouts/definitions.js.map +1 -1
  1344. package/build-module/layouts/flex.js.map +1 -1
  1345. package/build-module/layouts/flow.js.map +1 -1
  1346. package/build-module/layouts/grid.js +52 -9
  1347. package/build-module/layouts/grid.js.map +1 -1
  1348. package/build-module/layouts/index.js.map +1 -1
  1349. package/build-module/layouts/utils.js.map +1 -1
  1350. package/build-module/lock-unlock.js.map +1 -1
  1351. package/build-module/private-apis.js +7 -2
  1352. package/build-module/private-apis.js.map +1 -1
  1353. package/build-module/private-apis.native.js +3 -1
  1354. package/build-module/private-apis.native.js.map +1 -1
  1355. package/build-module/store/actions.js +18 -4
  1356. package/build-module/store/actions.js.map +1 -1
  1357. package/build-module/store/array.js.map +1 -1
  1358. package/build-module/store/constants.js.map +1 -1
  1359. package/build-module/store/defaults.js.map +1 -1
  1360. package/build-module/store/defaults.native.js.map +1 -1
  1361. package/build-module/store/get-block-settings.js.map +1 -1
  1362. package/build-module/store/index.js.map +1 -1
  1363. package/build-module/store/private-actions.js +17 -2
  1364. package/build-module/store/private-actions.js.map +1 -1
  1365. package/build-module/store/private-keys.js +1 -0
  1366. package/build-module/store/private-keys.js.map +1 -1
  1367. package/build-module/store/private-selectors.js +105 -33
  1368. package/build-module/store/private-selectors.js.map +1 -1
  1369. package/build-module/store/reducer.js +21 -0
  1370. package/build-module/store/reducer.js.map +1 -1
  1371. package/build-module/store/selectors.js +130 -88
  1372. package/build-module/store/selectors.js.map +1 -1
  1373. package/build-module/store/undo-ignore.js.map +1 -1
  1374. package/build-module/store/utils.js +6 -1
  1375. package/build-module/store/utils.js.map +1 -1
  1376. package/build-module/utils/dom.js.map +1 -1
  1377. package/build-module/utils/get-px-from-css-unit.js.map +1 -1
  1378. package/build-module/utils/index.js.map +1 -1
  1379. package/build-module/utils/math.js.map +1 -1
  1380. package/build-module/utils/object.js.map +1 -1
  1381. package/build-module/utils/order-inserter-block-items.js.map +1 -1
  1382. package/build-module/utils/pasting.js.map +1 -1
  1383. package/build-module/utils/selection.js.map +1 -1
  1384. package/build-module/utils/sorting.js.map +1 -1
  1385. package/build-module/utils/transform-styles/index.js +2 -1
  1386. package/build-module/utils/transform-styles/index.js.map +1 -1
  1387. package/build-module/utils/use-notify-copy.js.map +1 -1
  1388. package/build-style/content-rtl.css +40 -19
  1389. package/build-style/content.css +40 -19
  1390. package/build-style/default-editor-styles-rtl.css +1 -1
  1391. package/build-style/default-editor-styles.css +1 -1
  1392. package/build-style/style-rtl.css +150 -130
  1393. package/build-style/style.css +150 -130
  1394. package/package.json +32 -33
  1395. package/src/components/block-bindings-toolbar-indicator/style.scss +1 -1
  1396. package/src/components/block-edit/context.js +1 -0
  1397. package/src/components/block-edit/index.js +4 -0
  1398. package/src/components/block-inspector/index.js +6 -4
  1399. package/src/components/block-list/block.js +69 -30
  1400. package/src/components/block-list/block.native.js +3 -2
  1401. package/src/components/block-list/content.scss +37 -19
  1402. package/src/components/block-list/index.js +22 -6
  1403. package/src/components/block-list/use-block-props/index.js +5 -1
  1404. package/src/components/block-list/use-block-props/use-focus-first-element.js +7 -3
  1405. package/src/components/block-mover/button.js +4 -1
  1406. package/src/components/block-mover/index.js +8 -1
  1407. package/src/components/block-patterns-list/index.js +22 -17
  1408. package/src/components/block-patterns-paging/index.js +4 -0
  1409. package/src/components/block-preview/style.scss +28 -0
  1410. package/src/components/block-rename/modal.js +17 -13
  1411. package/src/components/block-rename/rename-control.js +8 -1
  1412. package/src/components/block-settings-menu/block-settings-dropdown.js +8 -2
  1413. package/src/components/block-switcher/index.js +5 -3
  1414. package/src/components/block-switcher/style.scss +1 -1
  1415. package/src/components/block-toolbar/index.js +16 -9
  1416. package/src/components/block-toolbar/shuffle.js +19 -13
  1417. package/src/components/block-toolbar/style.scss +1 -1
  1418. package/src/components/block-toolbar/use-has-block-toolbar.js +5 -3
  1419. package/src/components/block-tools/block-selection-button.js +103 -34
  1420. package/src/components/block-tools/index.js +18 -1
  1421. package/src/components/block-tools/use-show-block-tools.js +4 -7
  1422. package/src/components/block-variation-transforms/index.js +3 -1
  1423. package/src/components/button-block-appender/content.scss +5 -1
  1424. package/src/components/button-block-appender/index.native.js +16 -1
  1425. package/src/components/default-block-appender/content.scss +3 -3
  1426. package/src/components/editor-styles/index.js +4 -2
  1427. package/src/components/global-styles/advanced-panel.js +8 -2
  1428. package/src/components/global-styles/background-panel.js +595 -0
  1429. package/src/components/global-styles/color-panel.js +2 -1
  1430. package/src/components/global-styles/get-global-styles-changes.js +3 -0
  1431. package/src/components/global-styles/hooks.js +1 -0
  1432. package/src/components/global-styles/index.js +4 -0
  1433. package/src/components/global-styles/style.scss +72 -1
  1434. package/src/{hooks/test/background.js → components/global-styles/test/background-panel.js} +36 -1
  1435. package/src/components/global-styles/test/get-global-styles-changes.js +22 -3
  1436. package/src/components/global-styles/test/use-global-styles-output.js +12 -21
  1437. package/src/components/global-styles/use-global-styles-output.js +32 -21
  1438. package/src/components/global-styles/utils.js +1 -0
  1439. package/src/components/iframe/index.js +17 -14
  1440. package/src/components/image-editor/cropper.js +11 -2
  1441. package/src/components/image-editor/index.js +0 -2
  1442. package/src/components/inserter/block-patterns-tab/index.js +54 -39
  1443. package/src/components/inserter/block-patterns-tab/pattern-category-preview-panel.js +9 -31
  1444. package/src/components/inserter/block-patterns-tab/pattern-category-previews.js +2 -2
  1445. package/src/components/inserter/library.js +4 -0
  1446. package/src/components/inserter/menu.js +35 -17
  1447. package/src/components/inserter/search-items.js +37 -15
  1448. package/src/components/inserter/style.scss +88 -70
  1449. package/src/components/inserter/tabs.js +7 -2
  1450. package/src/components/inspector-controls-tabs/styles-tab.js +1 -1
  1451. package/src/components/keyboard-shortcuts/index.js +11 -0
  1452. package/src/components/link-control/style.scss +10 -2
  1453. package/src/components/link-control/test/index.js +1 -1
  1454. package/src/components/list-view/block-select-button.js +44 -3
  1455. package/src/components/list-view/block.js +1 -1
  1456. package/src/components/list-view/index.js +18 -1
  1457. package/src/components/list-view/style.scss +4 -4
  1458. package/src/components/list-view/use-list-view-collapse-items.js +33 -0
  1459. package/src/components/list-view/use-list-view-drop-zone.js +5 -0
  1460. package/src/components/recursion-provider/index.js +2 -2
  1461. package/src/components/rich-text/README.md +4 -0
  1462. package/src/components/rich-text/content.js +26 -19
  1463. package/src/components/rich-text/index.js +76 -15
  1464. package/src/components/rich-text/index.native.js +17 -12
  1465. package/src/components/rich-text/native/get-format-colors.native.js +1 -1
  1466. package/src/components/rich-text/native/index.native.js +2 -2
  1467. package/src/components/rich-text/use-undo-automatic-change.js +2 -6
  1468. package/src/components/rich-text/with-deprecations.js +0 -3
  1469. package/src/components/url-popover/image-url-input-ui.js +68 -51
  1470. package/src/components/use-block-commands/index.js +46 -28
  1471. package/src/components/use-block-display-information/index.js +8 -10
  1472. package/src/components/use-paste-styles/index.js +2 -0
  1473. package/src/hooks/anchor.js +11 -9
  1474. package/src/hooks/background.js +77 -538
  1475. package/src/hooks/block-renaming.js +0 -33
  1476. package/src/hooks/content-lock-ui.js +5 -7
  1477. package/src/hooks/index.js +6 -2
  1478. package/src/hooks/layout.js +57 -25
  1479. package/src/hooks/supports.js +24 -0
  1480. package/src/hooks/test/text-align.js +114 -0
  1481. package/src/hooks/test/use-typography-props.js +3 -1
  1482. package/src/hooks/text-align.js +178 -0
  1483. package/src/hooks/typography.js +2 -0
  1484. package/src/hooks/use-bindings-attributes.js +90 -161
  1485. package/src/hooks/use-typography-props.js +4 -1
  1486. package/src/hooks/use-zoom-out.js +46 -0
  1487. package/src/hooks/utils.js +41 -3
  1488. package/src/index.js +1 -0
  1489. package/src/layouts/definitions.js +6 -6
  1490. package/src/layouts/grid.js +106 -47
  1491. package/src/private-apis.js +13 -1
  1492. package/src/private-apis.native.js +2 -0
  1493. package/src/store/actions.js +22 -6
  1494. package/src/store/private-actions.js +18 -3
  1495. package/src/store/private-keys.js +1 -0
  1496. package/src/store/private-selectors.js +160 -41
  1497. package/src/store/reducer.js +22 -0
  1498. package/src/store/selectors.js +333 -262
  1499. package/src/store/test/private-actions.js +10 -0
  1500. package/src/store/test/private-selectors.js +13 -0
  1501. package/src/store/test/reducer.js +26 -0
  1502. package/src/store/test/selectors.js +90 -199
  1503. package/src/store/utils.js +13 -0
  1504. package/src/style.scss +0 -2
  1505. package/src/utils/transform-styles/index.js +2 -1
  1506. package/tsconfig.tsbuildinfo +1 -1
  1507. package/src/hooks/anchor.scss +0 -4
  1508. package/src/hooks/background.scss +0 -75
@@ -1 +1 @@
1
- {"version":3,"names":["__","Fragment","useMemo","__experimentalHStack","HStack","PanelBody","ToggleControl","createBlock","store","blocksStore","useDispatch","useSelect","BlockIcon","InspectorControls","blockEditorStore","EMPTY_OBJECT","BlockHooksControlPure","name","clientId","metadata","ignoredHookedBlocks","blockTypes","select","getBlockTypes","hookedBlocksForCurrentBlock","filter","blockName","blockHooks","includes","blockIndex","rootClientId","innerBlocksLength","getBlocks","getBlockIndex","getBlockRootClientId","length","hookedBlockClientIds","getGlobalBlockCount","_hookedBlockClientIds","reduce","clientIds","block","relativePosition","candidates","undefined","hookedBlock","find","candidate","Object","values","insertBlock","removeBlock","groupedHookedBlocks","groups","namespace","split","push","insertBlockIntoDesignatedLocation","createElement","className","title","initialOpen","keys","map","vendor","key","checked","label","justify","icon","onChange","edit","attributeKeys","hasSupport"],"sources":["@wordpress/block-editor/src/hooks/block-hooks.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { Fragment, useMemo } from '@wordpress/element';\nimport {\n\t__experimentalHStack as HStack,\n\tPanelBody,\n\tToggleControl,\n} from '@wordpress/components';\nimport { createBlock, store as blocksStore } from '@wordpress/blocks';\nimport { useDispatch, useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { BlockIcon, InspectorControls } from '../components';\nimport { store as blockEditorStore } from '../store';\n\nconst EMPTY_OBJECT = {};\n\nfunction BlockHooksControlPure( {\n\tname,\n\tclientId,\n\tmetadata: { ignoredHookedBlocks = [] } = {},\n} ) {\n\tconst blockTypes = useSelect(\n\t\t( select ) => select( blocksStore ).getBlockTypes(),\n\t\t[]\n\t);\n\n\t// A hooked block added via a filter will not be exposed through a block\n\t// type's `blockHooks` property; however, if the containing layout has been\n\t// modified, it will be present in the anchor block's `ignoredHookedBlocks`\n\t// metadata.\n\tconst hookedBlocksForCurrentBlock = useMemo(\n\t\t() =>\n\t\t\tblockTypes?.filter(\n\t\t\t\t( { name: blockName, blockHooks } ) =>\n\t\t\t\t\t( blockHooks && name in blockHooks ) ||\n\t\t\t\t\tignoredHookedBlocks.includes( blockName )\n\t\t\t),\n\t\t[ blockTypes, name, ignoredHookedBlocks ]\n\t);\n\n\tconst { blockIndex, rootClientId, innerBlocksLength } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlocks, getBlockIndex, getBlockRootClientId } =\n\t\t\t\tselect( blockEditorStore );\n\n\t\t\treturn {\n\t\t\t\tblockIndex: getBlockIndex( clientId ),\n\t\t\t\tinnerBlocksLength: getBlocks( clientId )?.length,\n\t\t\t\trootClientId: getBlockRootClientId( clientId ),\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\tconst hookedBlockClientIds = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlocks, getGlobalBlockCount } =\n\t\t\t\tselect( blockEditorStore );\n\n\t\t\tconst _hookedBlockClientIds = hookedBlocksForCurrentBlock.reduce(\n\t\t\t\t( clientIds, block ) => {\n\t\t\t\t\t// If the block doesn't exist anywhere in the block tree,\n\t\t\t\t\t// we know that we have to set the toggle to disabled.\n\t\t\t\t\tif ( getGlobalBlockCount( block.name ) === 0 ) {\n\t\t\t\t\t\treturn clientIds;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst relativePosition = block?.blockHooks?.[ name ];\n\t\t\t\t\tlet candidates;\n\n\t\t\t\t\tswitch ( relativePosition ) {\n\t\t\t\t\t\tcase 'before':\n\t\t\t\t\t\tcase 'after':\n\t\t\t\t\t\t\t// Any of the current block's siblings (with the right block type) qualifies\n\t\t\t\t\t\t\t// as a hooked block (inserted `before` or `after` the current one), as the block\n\t\t\t\t\t\t\t// might've been automatically inserted and then moved around a bit by the user.\n\t\t\t\t\t\t\tcandidates = getBlocks( rootClientId );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'first_child':\n\t\t\t\t\t\tcase 'last_child':\n\t\t\t\t\t\t\t// Any of the current block's child blocks (with the right block type) qualifies\n\t\t\t\t\t\t\t// as a hooked first or last child block, as the block might've been automatically\n\t\t\t\t\t\t\t// inserted and then moved around a bit by the user.\n\t\t\t\t\t\t\tcandidates = getBlocks( clientId );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase undefined:\n\t\t\t\t\t\t\t// If we haven't found a blockHooks field with a relative position for the hooked\n\t\t\t\t\t\t\t// block, it means that it was added by a filter. In this case, we look for the block\n\t\t\t\t\t\t\t// both among the current block's siblings and its children.\n\t\t\t\t\t\t\tcandidates = [\n\t\t\t\t\t\t\t\t...getBlocks( rootClientId ),\n\t\t\t\t\t\t\t\t...getBlocks( clientId ),\n\t\t\t\t\t\t\t];\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst hookedBlock = candidates?.find(\n\t\t\t\t\t\t( candidate ) => candidate.name === block.name\n\t\t\t\t\t);\n\n\t\t\t\t\t// If the block exists in the designated location, we consider it hooked\n\t\t\t\t\t// and show the toggle as enabled.\n\t\t\t\t\tif ( hookedBlock ) {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t...clientIds,\n\t\t\t\t\t\t\t[ block.name ]: hookedBlock.clientId,\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\n\t\t\t\t\t// If no hooked block was found in any of its designated locations,\n\t\t\t\t\t// we set the toggle to disabled.\n\t\t\t\t\treturn clientIds;\n\t\t\t\t},\n\t\t\t\t{}\n\t\t\t);\n\n\t\t\tif ( Object.values( _hookedBlockClientIds ).length > 0 ) {\n\t\t\t\treturn _hookedBlockClientIds;\n\t\t\t}\n\n\t\t\treturn EMPTY_OBJECT;\n\t\t},\n\t\t[ hookedBlocksForCurrentBlock, name, clientId, rootClientId ]\n\t);\n\n\tconst { insertBlock, removeBlock } = useDispatch( blockEditorStore );\n\n\tif ( ! hookedBlocksForCurrentBlock.length ) {\n\t\treturn null;\n\t}\n\n\t// Group by block namespace (i.e. prefix before the slash).\n\tconst groupedHookedBlocks = hookedBlocksForCurrentBlock.reduce(\n\t\t( groups, block ) => {\n\t\t\tconst [ namespace ] = block.name.split( '/' );\n\t\t\tif ( ! groups[ namespace ] ) {\n\t\t\t\tgroups[ namespace ] = [];\n\t\t\t}\n\t\t\tgroups[ namespace ].push( block );\n\t\t\treturn groups;\n\t\t},\n\t\t{}\n\t);\n\n\tconst insertBlockIntoDesignatedLocation = ( block, relativePosition ) => {\n\t\tswitch ( relativePosition ) {\n\t\t\tcase 'before':\n\t\t\tcase 'after':\n\t\t\t\tinsertBlock(\n\t\t\t\t\tblock,\n\t\t\t\t\trelativePosition === 'after' ? blockIndex + 1 : blockIndex,\n\t\t\t\t\trootClientId, // Insert as a child of the current block's parent\n\t\t\t\t\tfalse\n\t\t\t\t);\n\t\t\t\tbreak;\n\n\t\t\tcase 'first_child':\n\t\t\tcase 'last_child':\n\t\t\t\tinsertBlock(\n\t\t\t\t\tblock,\n\t\t\t\t\t// TODO: It'd be great if insertBlock() would accept negative indices for insertion.\n\t\t\t\t\trelativePosition === 'first_child' ? 0 : innerBlocksLength,\n\t\t\t\t\tclientId, // Insert as a child of the current block.\n\t\t\t\t\tfalse\n\t\t\t\t);\n\t\t\t\tbreak;\n\n\t\t\tcase undefined:\n\t\t\t\t// If we do not know the relative position, it is because the block was\n\t\t\t\t// added via a filter. In this case, we default to inserting it after the\n\t\t\t\t// current block.\n\t\t\t\tinsertBlock(\n\t\t\t\t\tblock,\n\t\t\t\t\tblockIndex + 1,\n\t\t\t\t\trootClientId, // Insert as a child of the current block's parent\n\t\t\t\t\tfalse\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t}\n\t};\n\n\treturn (\n\t\t<InspectorControls>\n\t\t\t<PanelBody\n\t\t\t\tclassName=\"block-editor-hooks__block-hooks\"\n\t\t\t\ttitle={ __( 'Plugins' ) }\n\t\t\t\tinitialOpen\n\t\t\t>\n\t\t\t\t<p className=\"block-editor-hooks__block-hooks-helptext\">\n\t\t\t\t\t{ __(\n\t\t\t\t\t\t'Manage the inclusion of blocks added automatically by plugins.'\n\t\t\t\t\t) }\n\t\t\t\t</p>\n\t\t\t\t{ Object.keys( groupedHookedBlocks ).map( ( vendor ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<Fragment key={ vendor }>\n\t\t\t\t\t\t\t<h3>{ vendor }</h3>\n\t\t\t\t\t\t\t{ groupedHookedBlocks[ vendor ].map( ( block ) => {\n\t\t\t\t\t\t\t\tconst checked =\n\t\t\t\t\t\t\t\t\tblock.name in hookedBlockClientIds;\n\n\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\t\t\tchecked={ checked }\n\t\t\t\t\t\t\t\t\t\tkey={ block.title }\n\t\t\t\t\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t\t\t\t\t<HStack justify=\"flex-start\">\n\t\t\t\t\t\t\t\t\t\t\t\t<BlockIcon\n\t\t\t\t\t\t\t\t\t\t\t\t\ticon={ block.icon }\n\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t<span>{ block.title }</span>\n\t\t\t\t\t\t\t\t\t\t\t</HStack>\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tonChange={ () => {\n\t\t\t\t\t\t\t\t\t\t\tif ( ! checked ) {\n\t\t\t\t\t\t\t\t\t\t\t\t// Create and insert block.\n\t\t\t\t\t\t\t\t\t\t\t\tconst relativePosition =\n\t\t\t\t\t\t\t\t\t\t\t\t\tblock.blockHooks[ name ];\n\t\t\t\t\t\t\t\t\t\t\t\tinsertBlockIntoDesignatedLocation(\n\t\t\t\t\t\t\t\t\t\t\t\t\tcreateBlock( block.name ),\n\t\t\t\t\t\t\t\t\t\t\t\t\trelativePosition\n\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t// Remove block.\n\t\t\t\t\t\t\t\t\t\t\tremoveBlock(\n\t\t\t\t\t\t\t\t\t\t\t\thookedBlockClientIds[\n\t\t\t\t\t\t\t\t\t\t\t\t\tblock.name\n\t\t\t\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t\t\t\t\tfalse\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);\n\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t);\n\t\t\t\t} ) }\n\t\t\t</PanelBody>\n\t\t</InspectorControls>\n\t);\n}\n\nexport default {\n\tedit: BlockHooksControlPure,\n\tattributeKeys: [ 'metadata' ],\n\thasSupport() {\n\t\treturn true;\n\t},\n};\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,QAAQ,EAAEC,OAAO,QAA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CACO,CAAC;EAEb,CAAE,CACQ,CACO,CAAC;AAEtB;AAEA,eAAe;EACdsD,IAAI,EAAEvD,qBAAqB;EAC3BwD,aAAa,EAAE,CAAE,UAAU,CAAE;EAC7BC,UAAUA,CAAA,EAAG;IACZ,OAAO,IAAI;EACZ;AACD,CAAC"}
1
+ {"version":3,"names":["__","Fragment","useMemo","__experimentalHStack","HStack","PanelBody","ToggleControl","createBlock","store","blocksStore","useDispatch","useSelect","BlockIcon","InspectorControls","blockEditorStore","EMPTY_OBJECT","BlockHooksControlPure","name","clientId","metadata","ignoredHookedBlocks","blockTypes","select","getBlockTypes","hookedBlocksForCurrentBlock","filter","blockName","blockHooks","includes","blockIndex","rootClientId","innerBlocksLength","getBlocks","getBlockIndex","getBlockRootClientId","length","hookedBlockClientIds","getGlobalBlockCount","_hookedBlockClientIds","reduce","clientIds","block","relativePosition","candidates","undefined","hookedBlock","find","candidate","Object","values","insertBlock","removeBlock","groupedHookedBlocks","groups","namespace","split","push","insertBlockIntoDesignatedLocation","createElement","className","title","initialOpen","keys","map","vendor","key","checked","label","justify","icon","onChange","edit","attributeKeys","hasSupport"],"sources":["@wordpress/block-editor/src/hooks/block-hooks.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { Fragment, useMemo } from '@wordpress/element';\nimport {\n\t__experimentalHStack as HStack,\n\tPanelBody,\n\tToggleControl,\n} from '@wordpress/components';\nimport { createBlock, store as blocksStore } from '@wordpress/blocks';\nimport { useDispatch, useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { BlockIcon, InspectorControls } from '../components';\nimport { store as blockEditorStore } from '../store';\n\nconst EMPTY_OBJECT = {};\n\nfunction BlockHooksControlPure( {\n\tname,\n\tclientId,\n\tmetadata: { ignoredHookedBlocks = [] } = {},\n} ) {\n\tconst blockTypes = useSelect(\n\t\t( select ) => select( blocksStore ).getBlockTypes(),\n\t\t[]\n\t);\n\n\t// A hooked block added via a filter will not be exposed through a block\n\t// type's `blockHooks` property; however, if the containing layout has been\n\t// modified, it will be present in the anchor block's `ignoredHookedBlocks`\n\t// metadata.\n\tconst hookedBlocksForCurrentBlock = useMemo(\n\t\t() =>\n\t\t\tblockTypes?.filter(\n\t\t\t\t( { name: blockName, blockHooks } ) =>\n\t\t\t\t\t( blockHooks && name in blockHooks ) ||\n\t\t\t\t\tignoredHookedBlocks.includes( blockName )\n\t\t\t),\n\t\t[ blockTypes, name, ignoredHookedBlocks ]\n\t);\n\n\tconst { blockIndex, rootClientId, innerBlocksLength } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlocks, getBlockIndex, getBlockRootClientId } =\n\t\t\t\tselect( blockEditorStore );\n\n\t\t\treturn {\n\t\t\t\tblockIndex: getBlockIndex( clientId ),\n\t\t\t\tinnerBlocksLength: getBlocks( clientId )?.length,\n\t\t\t\trootClientId: getBlockRootClientId( clientId ),\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\tconst hookedBlockClientIds = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlocks, getGlobalBlockCount } =\n\t\t\t\tselect( blockEditorStore );\n\n\t\t\tconst _hookedBlockClientIds = hookedBlocksForCurrentBlock.reduce(\n\t\t\t\t( clientIds, block ) => {\n\t\t\t\t\t// If the block doesn't exist anywhere in the block tree,\n\t\t\t\t\t// we know that we have to set the toggle to disabled.\n\t\t\t\t\tif ( getGlobalBlockCount( block.name ) === 0 ) {\n\t\t\t\t\t\treturn clientIds;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst relativePosition = block?.blockHooks?.[ name ];\n\t\t\t\t\tlet candidates;\n\n\t\t\t\t\tswitch ( relativePosition ) {\n\t\t\t\t\t\tcase 'before':\n\t\t\t\t\t\tcase 'after':\n\t\t\t\t\t\t\t// Any of the current block's siblings (with the right block type) qualifies\n\t\t\t\t\t\t\t// as a hooked block (inserted `before` or `after` the current one), as the block\n\t\t\t\t\t\t\t// might've been automatically inserted and then moved around a bit by the user.\n\t\t\t\t\t\t\tcandidates = getBlocks( rootClientId );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'first_child':\n\t\t\t\t\t\tcase 'last_child':\n\t\t\t\t\t\t\t// Any of the current block's child blocks (with the right block type) qualifies\n\t\t\t\t\t\t\t// as a hooked first or last child block, as the block might've been automatically\n\t\t\t\t\t\t\t// inserted and then moved around a bit by the user.\n\t\t\t\t\t\t\tcandidates = getBlocks( clientId );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase undefined:\n\t\t\t\t\t\t\t// If we haven't found a blockHooks field with a relative position for the hooked\n\t\t\t\t\t\t\t// block, it means that it was added by a filter. In this case, we look for the block\n\t\t\t\t\t\t\t// both among the current block's siblings and its children.\n\t\t\t\t\t\t\tcandidates = [\n\t\t\t\t\t\t\t\t...getBlocks( rootClientId ),\n\t\t\t\t\t\t\t\t...getBlocks( clientId ),\n\t\t\t\t\t\t\t];\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst hookedBlock = candidates?.find(\n\t\t\t\t\t\t( candidate ) => candidate.name === block.name\n\t\t\t\t\t);\n\n\t\t\t\t\t// If the block exists in the designated location, we consider it hooked\n\t\t\t\t\t// and show the toggle as enabled.\n\t\t\t\t\tif ( hookedBlock ) {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t...clientIds,\n\t\t\t\t\t\t\t[ block.name ]: hookedBlock.clientId,\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\n\t\t\t\t\t// If no hooked block was found in any of its designated locations,\n\t\t\t\t\t// we set the toggle to disabled.\n\t\t\t\t\treturn clientIds;\n\t\t\t\t},\n\t\t\t\t{}\n\t\t\t);\n\n\t\t\tif ( Object.values( _hookedBlockClientIds ).length > 0 ) {\n\t\t\t\treturn _hookedBlockClientIds;\n\t\t\t}\n\n\t\t\treturn EMPTY_OBJECT;\n\t\t},\n\t\t[ hookedBlocksForCurrentBlock, name, clientId, rootClientId ]\n\t);\n\n\tconst { insertBlock, removeBlock } = useDispatch( blockEditorStore );\n\n\tif ( ! hookedBlocksForCurrentBlock.length ) {\n\t\treturn null;\n\t}\n\n\t// Group by block namespace (i.e. prefix before the slash).\n\tconst groupedHookedBlocks = hookedBlocksForCurrentBlock.reduce(\n\t\t( groups, block ) => {\n\t\t\tconst [ namespace ] = block.name.split( '/' );\n\t\t\tif ( ! groups[ namespace ] ) {\n\t\t\t\tgroups[ namespace ] = [];\n\t\t\t}\n\t\t\tgroups[ namespace ].push( block );\n\t\t\treturn groups;\n\t\t},\n\t\t{}\n\t);\n\n\tconst insertBlockIntoDesignatedLocation = ( block, relativePosition ) => {\n\t\tswitch ( relativePosition ) {\n\t\t\tcase 'before':\n\t\t\tcase 'after':\n\t\t\t\tinsertBlock(\n\t\t\t\t\tblock,\n\t\t\t\t\trelativePosition === 'after' ? blockIndex + 1 : blockIndex,\n\t\t\t\t\trootClientId, // Insert as a child of the current block's parent\n\t\t\t\t\tfalse\n\t\t\t\t);\n\t\t\t\tbreak;\n\n\t\t\tcase 'first_child':\n\t\t\tcase 'last_child':\n\t\t\t\tinsertBlock(\n\t\t\t\t\tblock,\n\t\t\t\t\t// TODO: It'd be great if insertBlock() would accept negative indices for insertion.\n\t\t\t\t\trelativePosition === 'first_child' ? 0 : innerBlocksLength,\n\t\t\t\t\tclientId, // Insert as a child of the current block.\n\t\t\t\t\tfalse\n\t\t\t\t);\n\t\t\t\tbreak;\n\n\t\t\tcase undefined:\n\t\t\t\t// If we do not know the relative position, it is because the block was\n\t\t\t\t// added via a filter. In this case, we default to inserting it after the\n\t\t\t\t// current block.\n\t\t\t\tinsertBlock(\n\t\t\t\t\tblock,\n\t\t\t\t\tblockIndex + 1,\n\t\t\t\t\trootClientId, // Insert as a child of the current block's parent\n\t\t\t\t\tfalse\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t}\n\t};\n\n\treturn (\n\t\t<InspectorControls>\n\t\t\t<PanelBody\n\t\t\t\tclassName=\"block-editor-hooks__block-hooks\"\n\t\t\t\ttitle={ __( 'Plugins' ) }\n\t\t\t\tinitialOpen\n\t\t\t>\n\t\t\t\t<p className=\"block-editor-hooks__block-hooks-helptext\">\n\t\t\t\t\t{ __(\n\t\t\t\t\t\t'Manage the inclusion of blocks added automatically by plugins.'\n\t\t\t\t\t) }\n\t\t\t\t</p>\n\t\t\t\t{ Object.keys( groupedHookedBlocks ).map( ( vendor ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<Fragment key={ vendor }>\n\t\t\t\t\t\t\t<h3>{ vendor }</h3>\n\t\t\t\t\t\t\t{ groupedHookedBlocks[ vendor ].map( ( block ) => {\n\t\t\t\t\t\t\t\tconst checked =\n\t\t\t\t\t\t\t\t\tblock.name in hookedBlockClientIds;\n\n\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\t\t\tchecked={ checked }\n\t\t\t\t\t\t\t\t\t\tkey={ block.title }\n\t\t\t\t\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t\t\t\t\t<HStack justify=\"flex-start\">\n\t\t\t\t\t\t\t\t\t\t\t\t<BlockIcon\n\t\t\t\t\t\t\t\t\t\t\t\t\ticon={ block.icon }\n\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t<span>{ block.title }</span>\n\t\t\t\t\t\t\t\t\t\t\t</HStack>\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tonChange={ () => {\n\t\t\t\t\t\t\t\t\t\t\tif ( ! checked ) {\n\t\t\t\t\t\t\t\t\t\t\t\t// Create and insert block.\n\t\t\t\t\t\t\t\t\t\t\t\tconst relativePosition =\n\t\t\t\t\t\t\t\t\t\t\t\t\tblock.blockHooks[ name ];\n\t\t\t\t\t\t\t\t\t\t\t\tinsertBlockIntoDesignatedLocation(\n\t\t\t\t\t\t\t\t\t\t\t\t\tcreateBlock( block.name ),\n\t\t\t\t\t\t\t\t\t\t\t\t\trelativePosition\n\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t// Remove block.\n\t\t\t\t\t\t\t\t\t\t\tremoveBlock(\n\t\t\t\t\t\t\t\t\t\t\t\thookedBlockClientIds[\n\t\t\t\t\t\t\t\t\t\t\t\t\tblock.name\n\t\t\t\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t\t\t\t\tfalse\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);\n\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t);\n\t\t\t\t} ) }\n\t\t\t</PanelBody>\n\t\t</InspectorControls>\n\t);\n}\n\nexport default {\n\tedit: BlockHooksControlPure,\n\tattributeKeys: [ 'metadata' ],\n\thasSupport() {\n\t\treturn true;\n\t},\n};\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,QAAQ,EAAEC,OAAO,QAAQ,oBAAoB;AACtD,SACCC,oBAAoB,IAAIC,MAAM,EAC9BC,SAAS,EACTC,aAAa,QACP,uBAAuB;AAC9B,SAASC,WAAW,EAAEC,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;AACrE,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;;AAExD;AACA;AACA;AACA,SAASC,SAAS,EAAEC,iBAAiB,QAAQ,eAAe;AAC5D,SAASL,KAAK,IAAIM,gBAAgB,QAAQ,UAAU;AAEpD,MAAMC,YAAY,GAAG,CAAC,CAAC;AAEvB,SAASC,qBAAqBA,CAAE;EAC/BC,IAAI;EACJC,QAAQ;EACRC,QAAQ,EAAE;IAAEC,mBAAmB,GAAG;EAAG,CA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AY,CAAC,EACjBZ,mBAAmB,CAAEY,MAAM,CAAE,CAACD,GAAG,CAAItB,KAAK,IAAM;MACjD,MAAMyB,OAAO,IACZzB,KAAK,CAACxB,IAAI,IAAImB,oBAAoB;MAEnC,OACCsB,aAAA,CAACpD,aAAa;QACb4D,OAAO,EAAGA,OAAS;QACnBD,GAAG,EAAGxB,KAAK,CAACmB,KAAO;QACnBO,KAAK,EACJT,aAAA,CAACtD,MAAM;UAACgE,OAAO,EAAC;QAAY,GAC3BV,aAAA,CAAC9C,SAAS;UACTyD,IAAI,EAAG5B,KAAK,CAAC4B;QAAM,CACnB,CAAC,EACFX,aAAA,eAAQjB,KAAK,CAACmB,KAAa,CACpB,CACR;QACDU,QAAQ,EAAGA,CAAA,KAAM;UAChB,IAAK,CAAEJ,OAAO,EAAG;YAChB;YACA,MAAMxB,gBAAgB,GACrBD,KAAK,CAACd,UAAU,CAAEV,IAAI,CAAE;YACzBwC,iCAAiC,CAChClD,WAAW,CAAEkC,KAAK,CAACxB,IAAK,CAAC,EACzByB,gBACD,CAAC;YACD;UACD;;UAEA;UACAS,WAAW,CACVf,oBAAoB,CACnBK,KAAK,CAACxB,IAAI,CACV,EACD,KACD,CAAC;QACF;MAAG,CACH,CAAC;IAEJ,CAAE,CACO,CAAC;EAEb,CAAE,CACQ,CACO,CAAC;AAEtB;AAEA,eAAe;EACdsD,IAAI,EAAEvD,qBAAqB;EAC3BwD,aAAa,EAAE,CAAE,UAAU,CAAE;EAC7BC,UAAUA,CAAA,EAAG;IACZ,OAAO,IAAI;EACZ;AACD,CAAC","ignoreList":[]}
@@ -1,16 +1,8 @@
1
- import { createElement } from "react";
2
1
  /**
3
2
  * WordPress dependencies
4
3
  */
5
4
  import { addFilter } from '@wordpress/hooks';
6
5
  import { hasBlockSupport } from '@wordpress/blocks';
7
- import { __ } from '@wordpress/i18n';
8
- import { TextControl } from '@wordpress/components';
9
-
10
- /**
11
- * Internal dependencies
12
- */
13
- import { InspectorControls } from '../components';
14
6
 
15
7
  /**
16
8
  * Filters registered block settings, adding an `__experimentalLabel` callback if one does not already exist.
@@ -44,33 +36,5 @@ export function addLabelCallback(settings) {
44
36
  }
45
37
  return settings;
46
38
  }
47
- function BlockRenameControlPure({
48
- metadata,
49
- setAttributes
50
- }) {
51
- return createElement(InspectorControls, {
52
- group: "advanced"
53
- }, createElement(TextControl, {
54
- __nextHasNoMarginBottom: true,
55
- __next40pxDefaultSize: true,
56
- label: __('Block name'),
57
- value: metadata?.name || '',
58
- onChange: newName => {
59
- setAttributes({
60
- metadata: {
61
- ...metadata,
62
- name: newName
63
- }
64
- });
65
- }
66
- }));
67
- }
68
- export default {
69
- edit: BlockRenameControlPure,
70
- attributeKeys: ['metadata'],
71
- hasSupport(name) {
72
- return hasBlockSupport(name, 'renaming', true);
73
- }
74
- };
75
39
  addFilter('blocks.registerBlockType', 'core/metadata/addLabelCallback', addLabelCallback);
76
40
  //# sourceMappingURL=block-renaming.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["addFilter","hasBlockSupport","__","TextControl","InspectorControls","addLabelCallback","settings","__experimentalLabel","supportsBlockNaming","attributes","context","metadata","name","BlockRenameControlPure","setAttributes","createElement","group","__nextHasNoMarginBottom","__next40pxDefaultSize","label","value","onChange","newName","edit","attributeKeys","hasSupport"],"sources":["@wordpress/block-editor/src/hooks/block-renaming.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { addFilter } from '@wordpress/hooks';\nimport { hasBlockSupport } from '@wordpress/blocks';\nimport { __ } from '@wordpress/i18n';\nimport { TextControl } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { InspectorControls } from '../components';\n\n/**\n * Filters registered block settings, adding an `__experimentalLabel` callback if one does not already exist.\n *\n * @param {Object} settings Original block settings.\n *\n * @return {Object} Filtered block settings.\n */\nexport function addLabelCallback( settings ) {\n\t// If blocks provide their own label callback, do not override it.\n\tif ( settings.__experimentalLabel ) {\n\t\treturn settings;\n\t}\n\n\tconst supportsBlockNaming = hasBlockSupport(\n\t\tsettings,\n\t\t'renaming',\n\t\ttrue // default value\n\t);\n\n\t// Check whether block metadata is supported before using it.\n\tif ( supportsBlockNaming ) {\n\t\tsettings.__experimentalLabel = ( attributes, { context } ) => {\n\t\t\tconst { metadata } = attributes;\n\n\t\t\t// In the list view, use the block's name attribute as the label.\n\t\t\tif ( context === 'list-view' && metadata?.name ) {\n\t\t\t\treturn metadata.name;\n\t\t\t}\n\t\t};\n\t}\n\n\treturn settings;\n}\n\nfunction BlockRenameControlPure( { metadata, setAttributes } ) {\n\treturn (\n\t\t<InspectorControls group=\"advanced\">\n\t\t\t<TextControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t__next40pxDefaultSize\n\t\t\t\tlabel={ __( 'Block name' ) }\n\t\t\t\tvalue={ metadata?.name || '' }\n\t\t\t\tonChange={ ( newName ) => {\n\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\tmetadata: { ...metadata, name: newName },\n\t\t\t\t\t} );\n\t\t\t\t} }\n\t\t\t/>\n\t\t</InspectorControls>\n\t);\n}\n\nexport default {\n\tedit: BlockRenameControlPure,\n\tattributeKeys: [ 'metadata' ],\n\thasSupport( name ) {\n\t\treturn hasBlockSupport( name, 'renaming', true );\n\t},\n};\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/metadata/addLabelCallback',\n\taddLabelCallback\n);\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,kBAAkB;AAC5C,SAASC,eAAe,QAAQ,mBAAmB;AACnD,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,WAAW,QAAQ,uBAAuB;;AAEnD;AACA;AACA;AACA,SAASC,iBAAiB,QAAQ,eAAe;;AAEjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,gBAAgBA,CAAEC,QAAQ,EAAG;EAC5C;EACA,IAAKA,QAAQ,CAACC,mBAAmB,EAAG;IACnC,OAAOD,QAAQ;EAChB;EAEA,MAAME,mBAAmB,GAAGP,eAAe,CAC1CK,QAAQ,EACR,UAAU,EACV,IAAI,CAAC;EACN,CAAC;;EAED;EACA,IAAKE,mBAAmB,EAAG;IAC1BF,QAAQ,CAACC,mBAAmB,GAAG,CAAEE,UAAU,EAAE;MAAEC;IAAQ,CAAC,KAAM;MAC7D,MAAM;QAAEC;MAAS,CAAC,GAAGF,UAAU;;MAE/B;MACA,IAAKC,OAAO,KAAK,WAAW,IAAIC,QAAQ,EAAEC,IAAI,EAAG;QAChD,OAAOD,QAAQ,CAACC,IAAI;MACrB;IACD,CAAC;EACF;EAEA,OAAON,QAAQ;AAChB;AAEA,SAASO,sBAAsBA,CAAE;EAAEF,QAAQ;EAAEG;AAAc,CAAC,EAAG;EAC9D,OACCC,aAAA,CAACX,iBAAiB;IAACY,KAAK,EAAC;EAAU,GAClCD,aAAA,CAACZ,WAAW;IACXc,uBAAuB;IACvBC,qBAAqB;IACrBC,KAAK,EAAGjB,EAAE,CAAE,YAAa,CAAG;IAC5BkB,KAAK,EAAGT,QAAQ,EAAEC,IAAI,IAAI,EAAI;IAC9BS,QAAQ,EAAKC,OAAO,IAAM;MACzBR,aAAa,CAAE;QACdH,QAAQ,EAAE;UAAE,GAAGA,QAAQ;UAAEC,IAAI,EAAEU;QAAQ;MACxC,CAAE,CAAC;IACJ;EAAG,CACH,CACiB,CAAC;AAEtB;AAEA,eAAe;EACdC,IAAI,EAAEV,sBAAsB;EAC5BW,aAAa,EAAE,CAAE,UAAU,CAAE;EAC7BC,UAAUA,CAAEb,IAAI,EAAG;IAClB,OAAOX,eAAe,CAAEW,IAAI,EAAE,UAAU,EAAE,IAAK,CAAC;EACjD;AACD,CAAC;AAEDZ,SAAS,CACR,0BAA0B,EAC1B,gCAAgC,EAChCK,gBACD,CAAC"}
1
+ {"version":3,"names":["addFilter","hasBlockSupport","addLabelCallback","settings","__experimentalLabel","supportsBlockNaming","attributes","context","metadata","name"],"sources":["@wordpress/block-editor/src/hooks/block-renaming.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { addFilter } from '@wordpress/hooks';\nimport { hasBlockSupport } from '@wordpress/blocks';\n\n/**\n * Filters registered block settings, adding an `__experimentalLabel` callback if one does not already exist.\n *\n * @param {Object} settings Original block settings.\n *\n * @return {Object} Filtered block settings.\n */\nexport function addLabelCallback( settings ) {\n\t// If blocks provide their own label callback, do not override it.\n\tif ( settings.__experimentalLabel ) {\n\t\treturn settings;\n\t}\n\n\tconst supportsBlockNaming = hasBlockSupport(\n\t\tsettings,\n\t\t'renaming',\n\t\ttrue // default value\n\t);\n\n\t// Check whether block metadata is supported before using it.\n\tif ( supportsBlockNaming ) {\n\t\tsettings.__experimentalLabel = ( attributes, { context } ) => {\n\t\t\tconst { metadata } = attributes;\n\n\t\t\t// In the list view, use the block's name attribute as the label.\n\t\t\tif ( context === 'list-view' && metadata?.name ) {\n\t\t\t\treturn metadata.name;\n\t\t\t}\n\t\t};\n\t}\n\n\treturn settings;\n}\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/metadata/addLabelCallback',\n\taddLabelCallback\n);\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,kBAAkB;AAC5C,SAASC,eAAe,QAAQ,mBAAmB;;AAEnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,gBAAgBA,CAAEC,QAAQ,EAAG;EAC5C;EACA,IAAKA,QAAQ,CAACC,mBAAmB,EAAG;IACnC,OAAOD,QAAQ;EAChB;EAEA,MAAME,mBAAmB,GAAGJ,eAAe,CAC1CE,QAAQ,EACR,UAAU,EACV,IAAI,CAAC;EACN,CAAC;;EAED;EACA,IAAKE,mBAAmB,EAAG;IAC1BF,QAAQ,CAACC,mBAAmB,GAAG,CAAEE,UAAU,EAAE;MAAEC;IAAQ,CAAC,KAAM;MAC7D,MAAM;QAAEC;MAAS,CAAC,GAAGF,UAAU;;MAE/B;MACA,IAAKC,OAAO,KAAK,WAAW,IAAIC,QAAQ,EAAEC,IAAI,EAAG;QAChD,OAAOD,QAAQ,CAACC,IAAI;MACrB;IACD,CAAC;EACF;EAEA,OAAON,QAAQ;AAChB;AAEAH,SAAS,CACR,0BAA0B,EAC1B,gCAAgC,EAChCE,gBACD,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["classnames","hasBlockSupport","getBlockSupport","__experimentalHasSplitBorders","hasSplitBorders","Platform","useCallback","useMemo","addFilter","useSelect","getColorClassName","InspectorControls","useMultipleOriginColorsAndGradients","cleanEmptyObject","shouldSkipSerialization","useBlockSettings","useHasBorderPanel","useHasBorderPanelControls","BorderPanel","StylesBorderPanel","store","blockEditorStore","__","BORDER_SUPPORT_KEY","SHADOW_SUPPORT_KEY","getColorByProperty","colors","property","value","matchedColor","some","origin","color","getMultiOriginColor","namedColor","customColor","colorObject","undefined","getColorSlugFromVariable","exec","styleToAttributes","style","border","borderColor","borderColorValue","borderColorSlug","startsWith","substring","length","updatedStyle","attributesToStyle","attributes","BordersInspectorControl","label","children","resetAllFilter","attributesResetAllFilter","existingStyle","createElement","group","clientId","name","setAttributes","settings","isEnabled","selector","select","getBlockAttributes","onChange","newStyle","defaultControls","as","panelId","hasBorderSupport","blockName","feature","OS","support","radius","width","hasShadowSupport","useBorderPanelLabel","hasBorderControl","hasShadowControl","controls","hasBorderColor","hasBorderStyle","hasBorderWidth","hasBorderRadius","hasShadow","removeBorderAttribute","attribute","addAttributes","type","addSaveProps","props","blockNameOrType","borderClasses","getBorderClasses","newClassName","className","borderColorClass","useBlockProps","borderTopColor","top","borderRightColor","right","borderBottomColor","bottom","borderLeftColor","left","extraStyles","attributeKeys","hasSupport"],"sources":["@wordpress/block-editor/src/hooks/border.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { hasBlockSupport, getBlockSupport } from '@wordpress/blocks';\nimport { __experimentalHasSplitBorders as hasSplitBorders } from '@wordpress/components';\nimport { Platform, useCallback, useMemo } from '@wordpress/element';\nimport { addFilter } from '@wordpress/hooks';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { getColorClassName } from '../components/colors';\nimport InspectorControls from '../components/inspector-controls';\nimport useMultipleOriginColorsAndGradients from '../components/colors-gradients/use-multiple-origin-colors-and-gradients';\nimport {\n\tcleanEmptyObject,\n\tshouldSkipSerialization,\n\tuseBlockSettings,\n} from './utils';\nimport {\n\tuseHasBorderPanel,\n\tuseHasBorderPanelControls,\n\tBorderPanel as StylesBorderPanel,\n} from '../components/global-styles';\nimport { store as blockEditorStore } from '../store';\nimport { __ } from '@wordpress/i18n';\n\nexport const BORDER_SUPPORT_KEY = '__experimentalBorder';\nexport const SHADOW_SUPPORT_KEY = 'shadow';\n\nconst getColorByProperty = ( colors, property, value ) => {\n\tlet matchedColor;\n\n\tcolors.some( ( origin ) =>\n\t\torigin.colors.some( ( color ) => {\n\t\t\tif ( color[ property ] === value ) {\n\t\t\t\tmatchedColor = color;\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t} )\n\t);\n\n\treturn matchedColor;\n};\n\nexport const getMultiOriginColor = ( { colors, namedColor, customColor } ) => {\n\t// Search each origin (default, theme, or user) for matching color by name.\n\tif ( namedColor ) {\n\t\tconst colorObject = getColorByProperty( colors, 'slug', namedColor );\n\t\tif ( colorObject ) {\n\t\t\treturn colorObject;\n\t\t}\n\t}\n\n\t// Skip if no custom color or matching named color.\n\tif ( ! customColor ) {\n\t\treturn { color: undefined };\n\t}\n\n\t// Attempt to find color via custom color value or build new object.\n\tconst colorObject = getColorByProperty( colors, 'color', customColor );\n\treturn colorObject ? colorObject : { color: customColor };\n};\n\nfunction getColorSlugFromVariable( value ) {\n\tconst namedColor = /var:preset\\|color\\|(.+)/.exec( value );\n\tif ( namedColor && namedColor[ 1 ] ) {\n\t\treturn namedColor[ 1 ];\n\t}\n\treturn null;\n}\n\nfunction styleToAttributes( style ) {\n\tif ( hasSplitBorders( style?.border ) ) {\n\t\treturn {\n\t\t\tstyle,\n\t\t\tborderColor: undefined,\n\t\t};\n\t}\n\n\tconst borderColorValue = style?.border?.color;\n\tconst borderColorSlug = borderColorValue?.startsWith( 'var:preset|color|' )\n\t\t? borderColorValue.substring( 'var:preset|color|'.length )\n\t\t: undefined;\n\tconst updatedStyle = { ...style };\n\tupdatedStyle.border = {\n\t\t...updatedStyle.border,\n\t\tcolor: borderColorSlug ? undefined : borderColorValue,\n\t};\n\treturn {\n\t\tstyle: cleanEmptyObject( updatedStyle ),\n\t\tborderColor: borderColorSlug,\n\t};\n}\n\nfunction attributesToStyle( attributes ) {\n\tif ( hasSplitBorders( attributes.style?.border ) ) {\n\t\treturn attributes.style;\n\t}\n\treturn {\n\t\t...attributes.style,\n\t\tborder: {\n\t\t\t...attributes.style?.border,\n\t\t\tcolor: attributes.borderColor\n\t\t\t\t? 'var:preset|color|' + attributes.borderColor\n\t\t\t\t: attributes.style?.border?.color,\n\t\t},\n\t};\n}\n\nfunction BordersInspectorControl( { label, children, resetAllFilter } ) {\n\tconst attributesResetAllFilter = useCallback(\n\t\t( attributes ) => {\n\t\t\tconst existingStyle = attributesToStyle( attributes );\n\t\t\tconst updatedStyle = resetAllFilter( existingStyle );\n\t\t\treturn {\n\t\t\t\t...attributes,\n\t\t\t\t...styleToAttributes( updatedStyle ),\n\t\t\t};\n\t\t},\n\t\t[ resetAllFilter ]\n\t);\n\n\treturn (\n\t\t<InspectorControls\n\t\t\tgroup=\"border\"\n\t\t\tresetAllFilter={ attributesResetAllFilter }\n\t\t\tlabel={ label }\n\t\t>\n\t\t\t{ children }\n\t\t</InspectorControls>\n\t);\n}\n\nexport function BorderPanel( { clientId, name, setAttributes, settings } ) {\n\tconst isEnabled = useHasBorderPanel( settings );\n\tfunction selector( select ) {\n\t\tconst { style, borderColor } =\n\t\t\tselect( blockEditorStore ).getBlockAttributes( clientId ) || {};\n\t\treturn { style, borderColor };\n\t}\n\tconst { style, borderColor } = useSelect( selector, [ clientId ] );\n\tconst value = useMemo( () => {\n\t\treturn attributesToStyle( { style, borderColor } );\n\t}, [ style, borderColor ] );\n\n\tconst onChange = ( newStyle ) => {\n\t\tsetAttributes( styleToAttributes( newStyle ) );\n\t};\n\n\tif ( ! isEnabled ) {\n\t\treturn null;\n\t}\n\n\tconst defaultControls = {\n\t\t...getBlockSupport( name, [\n\t\t\tBORDER_SUPPORT_KEY,\n\t\t\t'__experimentalDefaultControls',\n\t\t] ),\n\t\t...getBlockSupport( name, [\n\t\t\tSHADOW_SUPPORT_KEY,\n\t\t\t'__experimentalDefaultControls',\n\t\t] ),\n\t};\n\n\treturn (\n\t\t<StylesBorderPanel\n\t\t\tas={ BordersInspectorControl }\n\t\t\tpanelId={ clientId }\n\t\t\tsettings={ settings }\n\t\t\tvalue={ value }\n\t\t\tonChange={ onChange }\n\t\t\tdefaultControls={ defaultControls }\n\t\t/>\n\t);\n}\n\n/**\n * Determine whether there is block support for border properties.\n *\n * @param {string} blockName Block name.\n * @param {string} feature Border feature to check support for.\n *\n * @return {boolean} Whether there is support.\n */\nexport function hasBorderSupport( blockName, feature = 'any' ) {\n\tif ( Platform.OS !== 'web' ) {\n\t\treturn false;\n\t}\n\n\tconst support = getBlockSupport( blockName, BORDER_SUPPORT_KEY );\n\n\tif ( support === true ) {\n\t\treturn true;\n\t}\n\n\tif ( feature === 'any' ) {\n\t\treturn !! (\n\t\t\tsupport?.color ||\n\t\t\tsupport?.radius ||\n\t\t\tsupport?.width ||\n\t\t\tsupport?.style\n\t\t);\n\t}\n\n\treturn !! support?.[ feature ];\n}\n\n/**\n * Determine whether there is block support for shadow properties.\n *\n * @param {string} blockName Block name.\n *\n * @return {boolean} Whether there is support.\n */\nexport function hasShadowSupport( blockName ) {\n\treturn hasBlockSupport( blockName, SHADOW_SUPPORT_KEY );\n}\n\nexport function useBorderPanelLabel( {\n\tblockName,\n\thasBorderControl,\n\thasShadowControl,\n} = {} ) {\n\tconst settings = useBlockSettings( blockName );\n\tconst controls = useHasBorderPanelControls( settings );\n\n\tif ( ! hasBorderControl && ! hasShadowControl && blockName ) {\n\t\thasBorderControl =\n\t\t\tcontrols?.hasBorderColor ||\n\t\t\tcontrols?.hasBorderStyle ||\n\t\t\tcontrols?.hasBorderWidth ||\n\t\t\tcontrols?.hasBorderRadius;\n\t\thasShadowControl = controls?.hasShadow;\n\t}\n\n\tif ( hasBorderControl && hasShadowControl ) {\n\t\treturn __( 'Border & Shadow' );\n\t}\n\n\tif ( hasShadowControl ) {\n\t\treturn __( 'Shadow' );\n\t}\n\n\treturn __( 'Border' );\n}\n\n/**\n * Returns a new style object where the specified border attribute has been\n * removed.\n *\n * @param {Object} style Styles from block attributes.\n * @param {string} attribute The border style attribute to clear.\n *\n * @return {Object} Style object with the specified attribute removed.\n */\nexport function removeBorderAttribute( style, attribute ) {\n\treturn cleanEmptyObject( {\n\t\t...style,\n\t\tborder: {\n\t\t\t...style?.border,\n\t\t\t[ attribute ]: undefined,\n\t\t},\n\t} );\n}\n\n/**\n * Filters registered block settings, extending attributes to include\n * `borderColor` if needed.\n *\n * @param {Object} settings Original block settings.\n *\n * @return {Object} Updated block settings.\n */\nfunction addAttributes( settings ) {\n\tif ( ! hasBorderSupport( settings, 'color' ) ) {\n\t\treturn settings;\n\t}\n\n\t// Allow blocks to specify default value if needed.\n\tif ( settings.attributes.borderColor ) {\n\t\treturn settings;\n\t}\n\n\t// Add new borderColor attribute to block settings.\n\treturn {\n\t\t...settings,\n\t\tattributes: {\n\t\t\t...settings.attributes,\n\t\t\tborderColor: {\n\t\t\t\ttype: 'string',\n\t\t\t},\n\t\t},\n\t};\n}\n\n/**\n * Override props assigned to save component to inject border color.\n *\n * @param {Object} props Additional props applied to save element.\n * @param {Object|string} blockNameOrType Block type definition.\n * @param {Object} attributes Block's attributes.\n *\n * @return {Object} Filtered props to apply to save element.\n */\nfunction addSaveProps( props, blockNameOrType, attributes ) {\n\tif (\n\t\t! hasBorderSupport( blockNameOrType, 'color' ) ||\n\t\tshouldSkipSerialization( blockNameOrType, BORDER_SUPPORT_KEY, 'color' )\n\t) {\n\t\treturn props;\n\t}\n\n\tconst borderClasses = getBorderClasses( attributes );\n\tconst newClassName = classnames( props.className, borderClasses );\n\n\t// If we are clearing the last of the previous classes in `className`\n\t// set it to `undefined` to avoid rendering empty DOM attributes.\n\tprops.className = newClassName ? newClassName : undefined;\n\n\treturn props;\n}\n\n/**\n * Generates a CSS class name consisting of all the applicable border color\n * classes given the current block attributes.\n *\n * @param {Object} attributes Block's attributes.\n *\n * @return {string} CSS class name.\n */\nexport function getBorderClasses( attributes ) {\n\tconst { borderColor, style } = attributes;\n\tconst borderColorClass = getColorClassName( 'border-color', borderColor );\n\n\treturn classnames( {\n\t\t'has-border-color': borderColor || style?.border?.color,\n\t\t[ borderColorClass ]: !! borderColorClass,\n\t} );\n}\n\nfunction useBlockProps( { name, borderColor, style } ) {\n\tconst { colors } = useMultipleOriginColorsAndGradients();\n\n\tif (\n\t\t! hasBorderSupport( name, 'color' ) ||\n\t\tshouldSkipSerialization( name, BORDER_SUPPORT_KEY, 'color' )\n\t) {\n\t\treturn {};\n\t}\n\n\tconst { color: borderColorValue } = getMultiOriginColor( {\n\t\tcolors,\n\t\tnamedColor: borderColor,\n\t} );\n\tconst { color: borderTopColor } = getMultiOriginColor( {\n\t\tcolors,\n\t\tnamedColor: getColorSlugFromVariable( style?.border?.top?.color ),\n\t} );\n\tconst { color: borderRightColor } = getMultiOriginColor( {\n\t\tcolors,\n\t\tnamedColor: getColorSlugFromVariable( style?.border?.right?.color ),\n\t} );\n\n\tconst { color: borderBottomColor } = getMultiOriginColor( {\n\t\tcolors,\n\t\tnamedColor: getColorSlugFromVariable( style?.border?.bottom?.color ),\n\t} );\n\tconst { color: borderLeftColor } = getMultiOriginColor( {\n\t\tcolors,\n\t\tnamedColor: getColorSlugFromVariable( style?.border?.left?.color ),\n\t} );\n\n\tconst extraStyles = {\n\t\tborderTopColor: borderTopColor || borderColorValue,\n\t\tborderRightColor: borderRightColor || borderColorValue,\n\t\tborderBottomColor: borderBottomColor || borderColorValue,\n\t\tborderLeftColor: borderLeftColor || borderColorValue,\n\t};\n\n\treturn addSaveProps(\n\t\t{ style: cleanEmptyObject( extraStyles ) || {} },\n\t\tname,\n\t\t{ borderColor, style }\n\t);\n}\n\nexport default {\n\tuseBlockProps,\n\taddSaveProps,\n\tattributeKeys: [ 'borderColor', 'style' ],\n\thasSupport( name ) {\n\t\treturn hasBorderSupport( name, 'color' );\n\t},\n};\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/border/addAttributes',\n\taddAttributes\n);\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,eAAe,EAAEC,eAAe,QAAQ,mBAAmB;AACpE,SAASC,6BAA6B,IAAIC,eAAe,QAAQ,uBAAuB;AACxF,SAASC,QAAQ,EAAEC,WAAW,EAAEC,OAAO,QAAQ,oBAAoB;AACnE,SAASC,SAAS,QAAQ,kBAAkB;AAC5C,SAASC,SAAS,QAAQ,iBAAiB;;AAE3C;AACA;AACA;AACA,SAASC,iBAAiB,QAAQ,sBAAsB;AACxD,OAAOC,iBAAiB,MAAM,kCAAkC;AAChE,OAAOC,mCAAmC,MAAM,yEAAyE;AACzH,SACCC,gBAAgB,EAChBC,uBAAuB,EACvBC,gBAAgB,QACV,SAAS;AAChB,SACCC,iBAAiB,EACjBC,yBAAyB,EACzBC,WAAW,IAAIC,iBAAiB,QAC1B,6BAA6B;AACpC,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,UAAU;AACpD,SAASC,EAAE,QAAQ,iBAAiB;AAEpC,OAAO,MAAMC,kBAAkB,GAAG,sBAAsB;AACxD,OAAO,MAAMC,kBAAkB,GAAG,QAAQ;AAE1C,MAAMC,kBAAkB,GAAGA,CAAEC,MAAM,EAAEC,QAAQ,EAAEC,KAAK,KAAM;EACzD,IAAIC,YAAY;EAEhBH,MAAM,CAACI,IAAI,CAAIC,MAAM,IACpBA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AAE;IACxDP,MAAM;IACNQ,UAAU,EAAEI,wBAAwB,CAAEG,KAAK,EAAEC,MAAM,EAAEgE,KAAK,EAAE1E,KAAM;EACnE,CAAE,CAAC;EAEH,MAAM;IAAEA,KAAK,EAAE2E;EAAkB,CAAC,GAAG1E,mBAAmB,CAAE;IACzDP,MAAM;IACNQ,UAAU,EAAEI,wBAAwB,CAAEG,KAAK,EAAEC,MAAM,EAAEkE,MAAM,EAAE5E,KAAM;EACpE,CAAE,CAAC;EACH,MAAM;IAAEA,KAAK,EAAE6E;EAAgB,CAAC,GAAG5E,mBAAmB,CAAE;IACvDP,MAAM;IACNQ,UAAU,EAAEI,wBAAwB,CAAEG,KAAK,EAAEC,MAAM,EAAEoE,IAAI,EAAE9E,KAAM;EAClE,CAAE,CAAC;EAEH,MAAM+E,WAAW,GAAG;IACnBR,cAAc,EAAEA,cAAc,IAAI3D,gBAAgB;IAClD6D,gBAAgB,EAAEA,gBAAgB,IAAI7D,gBAAgB;IACtD+D,iBAAiB,EAAEA,iBAAiB,IAAI/D,gBAAgB;IACxDiE,eAAe,EAAEA,eAAe,IAAIjE;EACrC,CAAC;EAED,OAAOkD,YAAY,CAClB;IAAErD,KAAK,EAAE5B,gBAAgB,CAAEkG,WAAY,CAAC,IAAI,CAAC;EAAE,CAAC,EAChDlD,IAAI,EACJ;IAAElB,WAAW;IAAEF;EAAM,CACtB,CAAC;AACF;AAEA,eAAe;EACd6D,aAAa;EACbR,YAAY;EACZkB,aAAa,EAAE,CAAE,aAAa,EAAE,OAAO,CAAE;EACzCC,UAAUA,CAAEpD,IAAI,EAAG;IAClB,OAAOY,gBAAgB,CAAEZ,IAAI,EAAE,OAAQ,CAAC;EACzC;AACD,CAAC;AAEDrD,SAAS,CACR,0BAA0B,EAC1B,2BAA2B,EAC3BoF,aACD,CAAC"}
1
+ {"version":3,"names":["classnames","hasBlockSupport","getBlockSupport","__experimentalHasSplitBorders","hasSplitBorders","Platform","useCallback","useMemo","addFilter","useSelect","getColorClassName","InspectorControls","useMultipleOriginColorsAndGradients","cleanEmptyObject","shouldSkipSerialization","useBlockSettings","useHasBorderPanel","useHasBorderPanelControls","BorderPanel","StylesBorderPanel","store","blockEditorStore","__","BORDER_SUPPORT_KEY","SHADOW_SUPPORT_KEY","getColorByProperty","colors","property","value","matchedColor","some","origin","color","getMultiOriginColor","namedColor","customColor","colorObject","undefined","getColorSlugFromVariable","exec","styleToAttributes","style","border","borderColor","borderColorValue","borderColorSlug","startsWith","substring","length","updatedStyle","attributesToStyle","attributes","BordersInspectorControl","label","children","resetAllFilter","attributesResetAllFilter","existingStyle","createElement","group","clientId","name","setAttributes","settings","isEnabled","selector","select","getBlockAttributes","onChange","newStyle","defaultControls","as","panelId","hasBorderSupport","blockName","feature","OS","support","radius","width","hasShadowSupport","useBorderPanelLabel","hasBorderControl","hasShadowControl","controls","hasBorderColor","hasBorderStyle","hasBorderWidth","hasBorderRadius","hasShadow","removeBorderAttribute","attribute","addAttributes","type","addSaveProps","props","blockNameOrType","borderClasses","getBorderClasses","newClassName","className","borderColorClass","useBlockProps","borderTopColor","top","borderRightColor","right","borderBottomColor","bottom","borderLeftColor","left","extraStyles","attributeKeys","hasSupport"],"sources":["@wordpress/block-editor/src/hooks/border.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { hasBlockSupport, getBlockSupport } from '@wordpress/blocks';\nimport { __experimentalHasSplitBorders as hasSplitBorders } from '@wordpress/components';\nimport { Platform, useCallback, useMemo } from '@wordpress/element';\nimport { addFilter } from '@wordpress/hooks';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { getColorClassName } from '../components/colors';\nimport InspectorControls from '../components/inspector-controls';\nimport useMultipleOriginColorsAndGradients from '../components/colors-gradients/use-multiple-origin-colors-and-gradients';\nimport {\n\tcleanEmptyObject,\n\tshouldSkipSerialization,\n\tuseBlockSettings,\n} from './utils';\nimport {\n\tuseHasBorderPanel,\n\tuseHasBorderPanelControls,\n\tBorderPanel as StylesBorderPanel,\n} from '../components/global-styles';\nimport { store as blockEditorStore } from '../store';\nimport { __ } from '@wordpress/i18n';\n\nexport const BORDER_SUPPORT_KEY = '__experimentalBorder';\nexport const SHADOW_SUPPORT_KEY = 'shadow';\n\nconst getColorByProperty = ( colors, property, value ) => {\n\tlet matchedColor;\n\n\tcolors.some( ( origin ) =>\n\t\torigin.colors.some( ( color ) => {\n\t\t\tif ( color[ property ] === value ) {\n\t\t\t\tmatchedColor = color;\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t} )\n\t);\n\n\treturn matchedColor;\n};\n\nexport const getMultiOriginColor = ( { colors, namedColor, customColor } ) => {\n\t// Search each origin (default, theme, or user) for matching color by name.\n\tif ( namedColor ) {\n\t\tconst colorObject = getColorByProperty( colors, 'slug', namedColor );\n\t\tif ( colorObject ) {\n\t\t\treturn colorObject;\n\t\t}\n\t}\n\n\t// Skip if no custom color or matching named color.\n\tif ( ! customColor ) {\n\t\treturn { color: undefined };\n\t}\n\n\t// Attempt to find color via custom color value or build new object.\n\tconst colorObject = getColorByProperty( colors, 'color', customColor );\n\treturn colorObject ? colorObject : { color: customColor };\n};\n\nfunction getColorSlugFromVariable( value ) {\n\tconst namedColor = /var:preset\\|color\\|(.+)/.exec( value );\n\tif ( namedColor && namedColor[ 1 ] ) {\n\t\treturn namedColor[ 1 ];\n\t}\n\treturn null;\n}\n\nfunction styleToAttributes( style ) {\n\tif ( hasSplitBorders( style?.border ) ) {\n\t\treturn {\n\t\t\tstyle,\n\t\t\tborderColor: undefined,\n\t\t};\n\t}\n\n\tconst borderColorValue = style?.border?.color;\n\tconst borderColorSlug = borderColorValue?.startsWith( 'var:preset|color|' )\n\t\t? borderColorValue.substring( 'var:preset|color|'.length )\n\t\t: undefined;\n\tconst updatedStyle = { ...style };\n\tupdatedStyle.border = {\n\t\t...updatedStyle.border,\n\t\tcolor: borderColorSlug ? undefined : borderColorValue,\n\t};\n\treturn {\n\t\tstyle: cleanEmptyObject( updatedStyle ),\n\t\tborderColor: borderColorSlug,\n\t};\n}\n\nfunction attributesToStyle( attributes ) {\n\tif ( hasSplitBorders( attributes.style?.border ) ) {\n\t\treturn attributes.style;\n\t}\n\treturn {\n\t\t...attributes.style,\n\t\tborder: {\n\t\t\t...attributes.style?.border,\n\t\t\tcolor: attributes.borderColor\n\t\t\t\t? 'var:preset|color|' + attributes.borderColor\n\t\t\t\t: attributes.style?.border?.color,\n\t\t},\n\t};\n}\n\nfunction BordersInspectorControl( { label, children, resetAllFilter } ) {\n\tconst attributesResetAllFilter = useCallback(\n\t\t( attributes ) => {\n\t\t\tconst existingStyle = attributesToStyle( attributes );\n\t\t\tconst updatedStyle = resetAllFilter( existingStyle );\n\t\t\treturn {\n\t\t\t\t...attributes,\n\t\t\t\t...styleToAttributes( updatedStyle ),\n\t\t\t};\n\t\t},\n\t\t[ resetAllFilter ]\n\t);\n\n\treturn (\n\t\t<InspectorControls\n\t\t\tgroup=\"border\"\n\t\t\tresetAllFilter={ attributesResetAllFilter }\n\t\t\tlabel={ label }\n\t\t>\n\t\t\t{ children }\n\t\t</InspectorControls>\n\t);\n}\n\nexport function BorderPanel( { clientId, name, setAttributes, settings } ) {\n\tconst isEnabled = useHasBorderPanel( settings );\n\tfunction selector( select ) {\n\t\tconst { style, borderColor } =\n\t\t\tselect( blockEditorStore ).getBlockAttributes( clientId ) || {};\n\t\treturn { style, borderColor };\n\t}\n\tconst { style, borderColor } = useSelect( selector, [ clientId ] );\n\tconst value = useMemo( () => {\n\t\treturn attributesToStyle( { style, borderColor } );\n\t}, [ style, borderColor ] );\n\n\tconst onChange = ( newStyle ) => {\n\t\tsetAttributes( styleToAttributes( newStyle ) );\n\t};\n\n\tif ( ! isEnabled ) {\n\t\treturn null;\n\t}\n\n\tconst defaultControls = {\n\t\t...getBlockSupport( name, [\n\t\t\tBORDER_SUPPORT_KEY,\n\t\t\t'__experimentalDefaultControls',\n\t\t] ),\n\t\t...getBlockSupport( name, [\n\t\t\tSHADOW_SUPPORT_KEY,\n\t\t\t'__experimentalDefaultControls',\n\t\t] ),\n\t};\n\n\treturn (\n\t\t<StylesBorderPanel\n\t\t\tas={ BordersInspectorControl }\n\t\t\tpanelId={ clientId }\n\t\t\tsettings={ settings }\n\t\t\tvalue={ value }\n\t\t\tonChange={ onChange }\n\t\t\tdefaultControls={ defaultControls }\n\t\t/>\n\t);\n}\n\n/**\n * Determine whether there is block support for border properties.\n *\n * @param {string} blockName Block name.\n * @param {string} feature Border feature to check support for.\n *\n * @return {boolean} Whether there is support.\n */\nexport function hasBorderSupport( blockName, feature = 'any' ) {\n\tif ( Platform.OS !== 'web' ) {\n\t\treturn false;\n\t}\n\n\tconst support = getBlockSupport( blockName, BORDER_SUPPORT_KEY );\n\n\tif ( support === true ) {\n\t\treturn true;\n\t}\n\n\tif ( feature === 'any' ) {\n\t\treturn !! (\n\t\t\tsupport?.color ||\n\t\t\tsupport?.radius ||\n\t\t\tsupport?.width ||\n\t\t\tsupport?.style\n\t\t);\n\t}\n\n\treturn !! support?.[ feature ];\n}\n\n/**\n * Determine whether there is block support for shadow properties.\n *\n * @param {string} blockName Block name.\n *\n * @return {boolean} Whether there is support.\n */\nexport function hasShadowSupport( blockName ) {\n\treturn hasBlockSupport( blockName, SHADOW_SUPPORT_KEY );\n}\n\nexport function useBorderPanelLabel( {\n\tblockName,\n\thasBorderControl,\n\thasShadowControl,\n} = {} ) {\n\tconst settings = useBlockSettings( blockName );\n\tconst controls = useHasBorderPanelControls( settings );\n\n\tif ( ! hasBorderControl && ! hasShadowControl && blockName ) {\n\t\thasBorderControl =\n\t\t\tcontrols?.hasBorderColor ||\n\t\t\tcontrols?.hasBorderStyle ||\n\t\t\tcontrols?.hasBorderWidth ||\n\t\t\tcontrols?.hasBorderRadius;\n\t\thasShadowControl = controls?.hasShadow;\n\t}\n\n\tif ( hasBorderControl && hasShadowControl ) {\n\t\treturn __( 'Border & Shadow' );\n\t}\n\n\tif ( hasShadowControl ) {\n\t\treturn __( 'Shadow' );\n\t}\n\n\treturn __( 'Border' );\n}\n\n/**\n * Returns a new style object where the specified border attribute has been\n * removed.\n *\n * @param {Object} style Styles from block attributes.\n * @param {string} attribute The border style attribute to clear.\n *\n * @return {Object} Style object with the specified attribute removed.\n */\nexport function removeBorderAttribute( style, attribute ) {\n\treturn cleanEmptyObject( {\n\t\t...style,\n\t\tborder: {\n\t\t\t...style?.border,\n\t\t\t[ attribute ]: undefined,\n\t\t},\n\t} );\n}\n\n/**\n * Filters registered block settings, extending attributes to include\n * `borderColor` if needed.\n *\n * @param {Object} settings Original block settings.\n *\n * @return {Object} Updated block settings.\n */\nfunction addAttributes( settings ) {\n\tif ( ! hasBorderSupport( settings, 'color' ) ) {\n\t\treturn settings;\n\t}\n\n\t// Allow blocks to specify default value if needed.\n\tif ( settings.attributes.borderColor ) {\n\t\treturn settings;\n\t}\n\n\t// Add new borderColor attribute to block settings.\n\treturn {\n\t\t...settings,\n\t\tattributes: {\n\t\t\t...settings.attributes,\n\t\t\tborderColor: {\n\t\t\t\ttype: 'string',\n\t\t\t},\n\t\t},\n\t};\n}\n\n/**\n * Override props assigned to save component to inject border color.\n *\n * @param {Object} props Additional props applied to save element.\n * @param {Object|string} blockNameOrType Block type definition.\n * @param {Object} attributes Block's attributes.\n *\n * @return {Object} Filtered props to apply to save element.\n */\nfunction addSaveProps( props, blockNameOrType, attributes ) {\n\tif (\n\t\t! hasBorderSupport( blockNameOrType, 'color' ) ||\n\t\tshouldSkipSerialization( blockNameOrType, BORDER_SUPPORT_KEY, 'color' )\n\t) {\n\t\treturn props;\n\t}\n\n\tconst borderClasses = getBorderClasses( attributes );\n\tconst newClassName = classnames( props.className, borderClasses );\n\n\t// If we are clearing the last of the previous classes in `className`\n\t// set it to `undefined` to avoid rendering empty DOM attributes.\n\tprops.className = newClassName ? newClassName : undefined;\n\n\treturn props;\n}\n\n/**\n * Generates a CSS class name consisting of all the applicable border color\n * classes given the current block attributes.\n *\n * @param {Object} attributes Block's attributes.\n *\n * @return {string} CSS class name.\n */\nexport function getBorderClasses( attributes ) {\n\tconst { borderColor, style } = attributes;\n\tconst borderColorClass = getColorClassName( 'border-color', borderColor );\n\n\treturn classnames( {\n\t\t'has-border-color': borderColor || style?.border?.color,\n\t\t[ borderColorClass ]: !! borderColorClass,\n\t} );\n}\n\nfunction useBlockProps( { name, borderColor, style } ) {\n\tconst { colors } = useMultipleOriginColorsAndGradients();\n\n\tif (\n\t\t! hasBorderSupport( name, 'color' ) ||\n\t\tshouldSkipSerialization( name, BORDER_SUPPORT_KEY, 'color' )\n\t) {\n\t\treturn {};\n\t}\n\n\tconst { color: borderColorValue } = getMultiOriginColor( {\n\t\tcolors,\n\t\tnamedColor: borderColor,\n\t} );\n\tconst { color: borderTopColor } = getMultiOriginColor( {\n\t\tcolors,\n\t\tnamedColor: getColorSlugFromVariable( style?.border?.top?.color ),\n\t} );\n\tconst { color: borderRightColor } = getMultiOriginColor( {\n\t\tcolors,\n\t\tnamedColor: getColorSlugFromVariable( style?.border?.right?.color ),\n\t} );\n\n\tconst { color: borderBottomColor } = getMultiOriginColor( {\n\t\tcolors,\n\t\tnamedColor: getColorSlugFromVariable( style?.border?.bottom?.color ),\n\t} );\n\tconst { color: borderLeftColor } = getMultiOriginColor( {\n\t\tcolors,\n\t\tnamedColor: getColorSlugFromVariable( style?.border?.left?.color ),\n\t} );\n\n\tconst extraStyles = {\n\t\tborderTopColor: borderTopColor || borderColorValue,\n\t\tborderRightColor: borderRightColor || borderColorValue,\n\t\tborderBottomColor: borderBottomColor || borderColorValue,\n\t\tborderLeftColor: borderLeftColor || borderColorValue,\n\t};\n\n\treturn addSaveProps(\n\t\t{ style: cleanEmptyObject( extraStyles ) || {} },\n\t\tname,\n\t\t{ borderColor, style }\n\t);\n}\n\nexport default {\n\tuseBlockProps,\n\taddSaveProps,\n\tattributeKeys: [ 'borderColor', 'style' ],\n\thasSupport( name ) {\n\t\treturn hasBorderSupport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AAE5E,KAAM;EACpE,CAAE,CAAC;EACH,MAAM;IAAEA,KAAK,EAAE6E;EAAgB,CAAC,GAAG5E,mBAAmB,CAAE;IACvDP,MAAM;IACNQ,UAAU,EAAEI,wBAAwB,CAAEG,KAAK,EAAEC,MAAM,EAAEoE,IAAI,EAAE9E,KAAM;EAClE,CAAE,CAAC;EAEH,MAAM+E,WAAW,GAAG;IACnBR,cAAc,EAAEA,cAAc,IAAI3D,gBAAgB;IAClD6D,gBAAgB,EAAEA,gBAAgB,IAAI7D,gBAAgB;IACtD+D,iBAAiB,EAAEA,iBAAiB,IAAI/D,gBAAgB;IACxDiE,eAAe,EAAEA,eAAe,IAAIjE;EACrC,CAAC;EAED,OAAOkD,YAAY,CAClB;IAAErD,KAAK,EAAE5B,gBAAgB,CAAEkG,WAAY,CAAC,IAAI,CAAC;EAAE,CAAC,EAChDlD,IAAI,EACJ;IAAElB,WAAW;IAAEF;EAAM,CACtB,CAAC;AACF;AAEA,eAAe;EACd6D,aAAa;EACbR,YAAY;EACZkB,aAAa,EAAE,CAAE,aAAa,EAAE,OAAO,CAAE;EACzCC,UAAUA,CAAEpD,IAAI,EAAG;IAClB,OAAOY,gBAAgB,CAAEZ,IAAI,EAAE,OAAQ,CAAC;EACzC;AACD,CAAC;AAEDrD,SAAS,CACR,0BAA0B,EAC1B,2BAA2B,EAC3BoF,aACD,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["classnames","addFilter","getBlockSupport","useMemo","Platform","useCallback","useSelect","getColorClassName","getColorObjectByAttributeValues","__experimentalGetGradientClass","cleanEmptyObject","transformStyles","shouldSkipSerialization","getBackgroundImageClasses","useSettings","InspectorControls","useHasColorPanel","default","StylesColorPanel","BlockColorContrastChecker","store","blockEditorStore","COLOR_SUPPORT_KEY","hasColorSupport","blockNameOrType","colorSupport","link","gradient","background","text","hasLinkColorSupport","blockType","OS","hasGradientSupport","gradients","hasBackgroundColorSupport","hasTextColorSupport","addAttributes","settings","attributes","backgroundColor","Object","assign","type","textColor","addSaveProps","props","hasGradient","style","shouldSerialize","feature","textClass","undefined","gradientClass","backgroundClass","serializeHasBackground","hasBackground","color","newClassName","className","elements","styleToAttributes","textColorValue","textColorSlug","startsWith","substring","length","backgroundColorValue","backgroundColorSlug","gradientValue","gradientSlug","updatedStyle","attributesToStyle","ColorInspectorControl","children","resetAllFilter","attributesResetAllFilter","existingStyle","createElement","group","ColorEdit","clientId","name","setAttributes","isEnabled","selector","select","getBlockAttributes","value","onChange","newStyle","defaultControls","enableContrastChecking","as","panelId","enableContrastChecker","useBlockProps","userPalette","themePalette","defaultPalette","colors","extraStyles","saveProps","hasBackgroundValue","attributeKeys","hasSupport","MIGRATION_PATHS","linkColor","addTransforms","result","source","index","results","destinationBlockType","activeSupports"],"sources":["@wordpress/block-editor/src/hooks/color.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { addFilter } from '@wordpress/hooks';\nimport { getBlockSupport } from '@wordpress/blocks';\nimport { useMemo, Platform, useCallback } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport {\n\tgetColorClassName,\n\tgetColorObjectByAttributeValues,\n} from '../components/colors';\nimport { __experimentalGetGradientClass } from '../components/gradients';\nimport {\n\tcleanEmptyObject,\n\ttransformStyles,\n\tshouldSkipSerialization,\n} from './utils';\nimport { getBackgroundImageClasses } from './background';\nimport { useSettings } from '../components/use-settings';\nimport InspectorControls from '../components/inspector-controls';\nimport {\n\tuseHasColorPanel,\n\tdefault as StylesColorPanel,\n} from '../components/global-styles/color-panel';\nimport BlockColorContrastChecker from './contrast-checker';\nimport { store as blockEditorStore } from '../store';\n\nexport const COLOR_SUPPORT_KEY = 'color';\n\nconst hasColorSupport = ( blockNameOrType ) => {\n\tconst colorSupport = getBlockSupport( blockNameOrType, COLOR_SUPPORT_KEY );\n\treturn (\n\t\tcolorSupport &&\n\t\t( colorSupport.link === true ||\n\t\t\tcolorSupport.gradient === true ||\n\t\t\tcolorSupport.background !== false ||\n\t\t\tcolorSupport.text !== false )\n\t);\n};\n\nconst hasLinkColorSupport = ( blockType ) => {\n\tif ( Platform.OS !== 'web' ) {\n\t\treturn false;\n\t}\n\n\tconst colorSupport = getBlockSupport( blockType, COLOR_SUPPORT_KEY );\n\n\treturn (\n\t\tcolorSupport !== null &&\n\t\ttypeof colorSupport === 'object' &&\n\t\t!! colorSupport.link\n\t);\n};\n\nconst hasGradientSupport = ( blockNameOrType ) => {\n\tconst colorSupport = getBlockSupport( blockNameOrType, COLOR_SUPPORT_KEY );\n\n\treturn (\n\t\tcolorSupport !== null &&\n\t\ttypeof colorSupport === 'object' &&\n\t\t!! colorSupport.gradients\n\t);\n};\n\nconst hasBackgroundColorSupport = ( blockType ) => {\n\tconst colorSupport = getBlockSupport( blockType, COLOR_SUPPORT_KEY );\n\n\treturn colorSupport && colorSupport.background !== false;\n};\n\nconst hasTextColorSupport = ( blockType ) => {\n\tconst colorSupport = getBlockSupport( blockType, COLOR_SUPPORT_KEY );\n\n\treturn colorSupport && colorSupport.text !== false;\n};\n\n/**\n * Filters registered block settings, extending attributes to include\n * `backgroundColor` and `textColor` attribute.\n *\n * @param {Object} settings Original block settings.\n *\n * @return {Object} Filtered block settings.\n */\nfunction addAttributes( settings ) {\n\tif ( ! hasColorSupport( settings ) ) {\n\t\treturn settings;\n\t}\n\n\t// Allow blocks to specify their own attribute definition with default values if needed.\n\tif ( ! settings.attributes.backgroundColor ) {\n\t\tObject.assign( settings.attributes, {\n\t\t\tbackgroundColor: {\n\t\t\t\ttype: 'string',\n\t\t\t},\n\t\t} );\n\t}\n\tif ( ! settings.attributes.textColor ) {\n\t\tObject.assign( settings.attributes, {\n\t\t\ttextColor: {\n\t\t\t\ttype: 'string',\n\t\t\t},\n\t\t} );\n\t}\n\n\tif ( hasGradientSupport( settings ) && ! settings.attributes.gradient ) {\n\t\tObject.assign( settings.attributes, {\n\t\t\tgradient: {\n\t\t\t\ttype: 'string',\n\t\t\t},\n\t\t} );\n\t}\n\n\treturn settings;\n}\n\n/**\n * Override props assigned to save component to inject colors classnames.\n *\n * @param {Object} props Additional props applied to save element.\n * @param {Object|string} blockNameOrType Block type.\n * @param {Object} attributes Block attributes.\n *\n * @return {Object} Filtered props applied to save element.\n */\nexport function addSaveProps( props, blockNameOrType, attributes ) {\n\tif (\n\t\t! hasColorSupport( blockNameOrType ) ||\n\t\tshouldSkipSerialization( blockNameOrType, COLOR_SUPPORT_KEY )\n\t) {\n\t\treturn props;\n\t}\n\n\tconst hasGradient = hasGradientSupport( blockNameOrType );\n\n\t// I'd have preferred to avoid the \"style\" attribute usage here\n\tconst { backgroundColor, textColor, gradient, style } = attributes;\n\n\tconst shouldSerialize = ( feature ) =>\n\t\t! shouldSkipSerialization(\n\t\t\tblockNameOrType,\n\t\t\tCOLOR_SUPPORT_KEY,\n\t\t\tfeature\n\t\t);\n\n\t// Primary color classes must come before the `has-text-color`,\n\t// `has-background` and `has-link-color` classes to maintain backwards\n\t// compatibility and avoid block invalidations.\n\tconst textClass = shouldSerialize( 'text' )\n\t\t? getColorClassName( 'color', textColor )\n\t\t: undefined;\n\n\tconst gradientClass = shouldSerialize( 'gradients' )\n\t\t? __experimentalGetGradientClass( gradient )\n\t\t: undefined;\n\n\tconst backgroundClass = shouldSerialize( 'background' )\n\t\t? getColorClassName( 'background-color', backgroundColor )\n\t\t: undefined;\n\n\tconst serializeHasBackground =\n\t\tshouldSerialize( 'background' ) || shouldSerialize( 'gradients' );\n\tconst hasBackground =\n\t\tbackgroundColor ||\n\t\tstyle?.color?.background ||\n\t\t( hasGradient && ( gradient || style?.color?.gradient ) );\n\n\tconst newClassName = classnames(\n\t\tprops.className,\n\t\ttextClass,\n\t\tgradientClass,\n\t\t{\n\t\t\t// Don't apply the background class if there's a custom gradient.\n\t\t\t[ backgroundClass ]:\n\t\t\t\t( ! hasGradient || ! style?.color?.gradient ) &&\n\t\t\t\t!! backgroundClass,\n\t\t\t'has-text-color':\n\t\t\t\tshouldSerialize( 'text' ) &&\n\t\t\t\t( textColor || style?.color?.text ),\n\t\t\t'has-background': serializeHasBackground && hasBackground,\n\t\t\t'has-link-color':\n\t\t\t\tshouldSerialize( 'link' ) && style?.elements?.link?.color,\n\t\t}\n\t);\n\tprops.className = newClassName ? newClassName : undefined;\n\n\treturn props;\n}\n\nfunction styleToAttributes( style ) {\n\tconst textColorValue = style?.color?.text;\n\tconst textColorSlug = textColorValue?.startsWith( 'var:preset|color|' )\n\t\t? textColorValue.substring( 'var:preset|color|'.length )\n\t\t: undefined;\n\tconst backgroundColorValue = style?.color?.background;\n\tconst backgroundColorSlug = backgroundColorValue?.startsWith(\n\t\t'var:preset|color|'\n\t)\n\t\t? backgroundColorValue.substring( 'var:preset|color|'.length )\n\t\t: undefined;\n\tconst gradientValue = style?.color?.gradient;\n\tconst gradientSlug = gradientValue?.startsWith( 'var:preset|gradient|' )\n\t\t? gradientValue.substring( 'var:preset|gradient|'.length )\n\t\t: undefined;\n\tconst updatedStyle = { ...style };\n\tupdatedStyle.color = {\n\t\t...updatedStyle.color,\n\t\ttext: textColorSlug ? undefined : textColorValue,\n\t\tbackground: backgroundColorSlug ? undefined : backgroundColorValue,\n\t\tgradient: gradientSlug ? undefined : gradientValue,\n\t};\n\treturn {\n\t\tstyle: cleanEmptyObject( updatedStyle ),\n\t\ttextColor: textColorSlug,\n\t\tbackgroundColor: backgroundColorSlug,\n\t\tgradient: gradientSlug,\n\t};\n}\n\nfunction attributesToStyle( attributes ) {\n\treturn {\n\t\t...attributes.style,\n\t\tcolor: {\n\t\t\t...attributes.style?.color,\n\t\t\ttext: attributes.textColor\n\t\t\t\t? 'var:preset|color|' + attributes.textColor\n\t\t\t\t: attributes.style?.color?.text,\n\t\t\tbackground: attributes.backgroundColor\n\t\t\t\t? 'var:preset|color|' + attributes.backgroundColor\n\t\t\t\t: attributes.style?.color?.background,\n\t\t\tgradient: attributes.gradient\n\t\t\t\t? 'var:preset|gradient|' + attributes.gradient\n\t\t\t\t: attributes.style?.color?.gradient,\n\t\t},\n\t};\n}\n\nfunction ColorInspectorControl( { children, resetAllFilter } ) {\n\tconst attributesResetAllFilter = useCallback(\n\t\t( attributes ) => {\n\t\t\tconst existingStyle = attributesToStyle( attributes );\n\t\t\tconst updatedStyle = resetAllFilter( existingStyle );\n\t\t\treturn {\n\t\t\t\t...attributes,\n\t\t\t\t...styleToAttributes( updatedStyle ),\n\t\t\t};\n\t\t},\n\t\t[ resetAllFilter ]\n\t);\n\n\treturn (\n\t\t<InspectorControls\n\t\t\tgroup=\"color\"\n\t\t\tresetAllFilter={ attributesResetAllFilter }\n\t\t>\n\t\t\t{ children }\n\t\t</InspectorControls>\n\t);\n}\n\nexport function ColorEdit( { clientId, name, setAttributes, settings } ) {\n\tconst isEnabled = useHasColorPanel( settings );\n\tfunction selector( select ) {\n\t\tconst { style, textColor, backgroundColor, gradient } =\n\t\t\tselect( blockEditorStore ).getBlockAttributes( clientId ) || {};\n\t\treturn { style, textColor, backgroundColor, gradient };\n\t}\n\tconst { style, textColor, backgroundColor, gradient } = useSelect(\n\t\tselector,\n\t\t[ clientId ]\n\t);\n\tconst value = useMemo( () => {\n\t\treturn attributesToStyle( {\n\t\t\tstyle,\n\t\t\ttextColor,\n\t\t\tbackgroundColor,\n\t\t\tgradient,\n\t\t} );\n\t}, [ style, textColor, backgroundColor, gradient ] );\n\n\tconst onChange = ( newStyle ) => {\n\t\tsetAttributes( styleToAttributes( newStyle ) );\n\t};\n\n\tif ( ! isEnabled ) {\n\t\treturn null;\n\t}\n\n\tconst defaultControls = getBlockSupport( name, [\n\t\tCOLOR_SUPPORT_KEY,\n\t\t'__experimentalDefaultControls',\n\t] );\n\n\tconst enableContrastChecking =\n\t\tPlatform.OS === 'web' &&\n\t\t! value?.color?.gradient &&\n\t\t( settings?.color?.text || settings?.color?.link ) &&\n\t\t// Contrast checking is enabled by default.\n\t\t// Deactivating it requires `enableContrastChecker` to have\n\t\t// an explicit value of `false`.\n\t\tfalse !==\n\t\t\tgetBlockSupport( name, [\n\t\t\t\tCOLOR_SUPPORT_KEY,\n\t\t\t\t'enableContrastChecker',\n\t\t\t] );\n\n\treturn (\n\t\t<StylesColorPanel\n\t\t\tas={ ColorInspectorControl }\n\t\t\tpanelId={ clientId }\n\t\t\tsettings={ settings }\n\t\t\tvalue={ value }\n\t\t\tonChange={ onChange }\n\t\t\tdefaultControls={ defaultControls }\n\t\t\tenableContrastChecker={\n\t\t\t\tfalse !==\n\t\t\t\tgetBlockSupport( name, [\n\t\t\t\t\tCOLOR_SUPPORT_KEY,\n\t\t\t\t\t'enableContrastChecker',\n\t\t\t\t] )\n\t\t\t}\n\t\t>\n\t\t\t{ enableContrastChecking && (\n\t\t\t\t<BlockColorContrastChecker clientId={ clientId } />\n\t\t\t) }\n\t\t</StylesColorPanel>\n\t);\n}\n\nfunction useBlockProps( {\n\tname,\n\tbackgroundColor,\n\ttextColor,\n\tgradient,\n\tstyle,\n} ) {\n\tconst [ userPalette, themePalette, defaultPalette ] = useSettings(\n\t\t'color.palette.custom',\n\t\t'color.palette.theme',\n\t\t'color.palette.default'\n\t);\n\n\tconst colors = useMemo(\n\t\t() => [\n\t\t\t...( userPalette || [] ),\n\t\t\t...( themePalette || [] ),\n\t\t\t...( defaultPalette || [] ),\n\t\t],\n\t\t[ userPalette, themePalette, defaultPalette ]\n\t);\n\tif (\n\t\t! hasColorSupport( name ) ||\n\t\tshouldSkipSerialization( name, COLOR_SUPPORT_KEY )\n\t) {\n\t\treturn {};\n\t}\n\tconst extraStyles = {};\n\n\tif (\n\t\ttextColor &&\n\t\t! shouldSkipSerialization( name, COLOR_SUPPORT_KEY, 'text' )\n\t) {\n\t\textraStyles.color = getColorObjectByAttributeValues(\n\t\t\tcolors,\n\t\t\ttextColor\n\t\t)?.color;\n\t}\n\tif (\n\t\tbackgroundColor &&\n\t\t! shouldSkipSerialization( name, COLOR_SUPPORT_KEY, 'background' )\n\t) {\n\t\textraStyles.backgroundColor = getColorObjectByAttributeValues(\n\t\t\tcolors,\n\t\t\tbackgroundColor\n\t\t)?.color;\n\t}\n\n\tconst saveProps = addSaveProps( { style: extraStyles }, name, {\n\t\ttextColor,\n\t\tbackgroundColor,\n\t\tgradient,\n\t\tstyle,\n\t} );\n\n\tconst hasBackgroundValue =\n\t\tbackgroundColor ||\n\t\tstyle?.color?.background ||\n\t\tgradient ||\n\t\tstyle?.color?.gradient;\n\n\treturn {\n\t\t...saveProps,\n\t\tclassName: classnames(\n\t\t\tsaveProps.className,\n\t\t\t// Add background image classes in the editor, if not already handled by background color values.\n\t\t\t! hasBackgroundValue && getBackgroundImageClasses( style )\n\t\t),\n\t};\n}\n\nexport default {\n\tuseBlockProps,\n\taddSaveProps,\n\tattributeKeys: [ 'backgroundColor', 'textColor', 'gradient', 'style' ],\n\thasSupport: hasColorSupport,\n};\n\nconst MIGRATION_PATHS = {\n\tlinkColor: [ [ 'style', 'elements', 'link', 'color', 'text' ] ],\n\ttextColor: [ [ 'textColor' ], [ 'style', 'color', 'text' ] ],\n\tbackgroundColor: [\n\t\t[ 'backgroundColor' ],\n\t\t[ 'style', 'color', 'background' ],\n\t],\n\tgradient: [ [ 'gradient' ], [ 'style', 'color', 'gradient' ] ],\n};\n\nexport function addTransforms( result, source, index, results ) {\n\tconst destinationBlockType = result.name;\n\tconst activeSupports = {\n\t\tlinkColor: hasLinkColorSupport( destinationBlockType ),\n\t\ttextColor: hasTextColorSupport( destinationBlockType ),\n\t\tbackgroundColor: hasBackgroundColorSupport( destinationBlockType ),\n\t\tgradient: hasGradientSupport( destinationBlockType ),\n\t};\n\treturn transformStyles(\n\t\tactiveSupports,\n\t\tMIGRATION_PATHS,\n\t\tresult,\n\t\tsource,\n\t\tindex,\n\t\tresults\n\t);\n}\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/color/addAttribute',\n\taddAttributes\n);\n\naddFilter(\n\t'blocks.switchToBlockType.transformedBlock',\n\t'core/color/addTransforms',\n\taddT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AAC;AAED,MAAMmF,eAAe,GAAG;EACvBC,SAAS,EAAE,CAAE,CAAE,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAE,CAAE;EAC/D/D,SAAS,EAAE,CAAE,CAAE,WAAW,CAAE,EAAE,CAAE,OAAO,EAAE,OAAO,EAAE,MAAM,CAAE,CAAE;EAC5DJ,eAAe,EAAE,CAChB,CAAE,iBAAiB,CAAE,EACrB,CAAE,OAAO,EAAE,OAAO,EAAE,YAAY,CAAE,CAClC;EACDb,QAAQ,EAAE,CAAE,CAAE,UAAU,CAAE,EAAE,CAAE,OAAO,EAAE,OAAO,EAAE,UAAU,CAAE;AAC7D,CAAC;AAED,OAAO,SAASiF,aAAaA,CAAEC,MAAM,EAAEC,MAAM,EAAEC,KAAK,EAAEC,OAAO,EAAG;EAC/D,MAAMC,oBAAoB,GAAGJ,MAAM,CAAC3B,IAAI;EACxC,MAAMgC,cAAc,GAAG;IACtBP,SAAS,EAAE7E,mBAAmB,CAAEmF,oBAAqB,CAAC;IACtDrE,SAAS,EAAER,mBAAmB,CAAE6E,oBAAqB,CAAC;IACtDzE,eAAe,EAAEL,yBAAyB,CAAE8E,oBAAqB,CAAC;IAClEtF,QAAQ,EAAEM,kBAAkB,CAAEgF,oBAAqB;EACpD,CAAC;EACD,OAAOtG,eAAe,CACrBuG,cAAc,EACdR,eAAe,EACfG,MAAM,EACNC,MAAM,EACNC,KAAK,EACLC,OACD,CAAC;AACF;AAEA/G,SAAS,CACR,0BAA0B,EAC1B,yBAAyB,EACzBoC,aACD,CAAC;AAEDpC,SAAS,CACR,2CAA2C,EAC3C,0BAA0B,EAC1B2G,aACD,CAAC"}
1
+ {"version":3,"names":["classnames","addFilter","getBlockSupport","useMemo","Platform","useCallback","useSelect","getColorClassName","getColorObjectByAttributeValues","__experimentalGetGradientClass","cleanEmptyObject","transformStyles","shouldSkipSerialization","getBackgroundImageClasses","useSettings","InspectorControls","useHasColorPanel","default","StylesColorPanel","BlockColorContrastChecker","store","blockEditorStore","COLOR_SUPPORT_KEY","hasColorSupport","blockNameOrType","colorSupport","link","gradient","background","text","hasLinkColorSupport","blockType","OS","hasGradientSupport","gradients","hasBackgroundColorSupport","hasTextColorSupport","addAttributes","settings","attributes","backgroundColor","Object","assign","type","textColor","addSaveProps","props","hasGradient","style","shouldSerialize","feature","textClass","undefined","gradientClass","backgroundClass","serializeHasBackground","hasBackground","color","newClassName","className","elements","styleToAttributes","textColorValue","textColorSlug","startsWith","substring","length","backgroundColorValue","backgroundColorSlug","gradientValue","gradientSlug","updatedStyle","attributesToStyle","ColorInspectorControl","children","resetAllFilter","attributesResetAllFilter","existingStyle","createElement","group","ColorEdit","clientId","name","setAttributes","isEnabled","selector","select","getBlockAttributes","value","onChange","newStyle","defaultControls","enableContrastChecking","as","panelId","enableContrastChecker","useBlockProps","userPalette","themePalette","defaultPalette","colors","extraStyles","saveProps","hasBackgroundValue","attributeKeys","hasSupport","MIGRATION_PATHS","linkColor","addTransforms","result","source","index","results","destinationBlockType","activeSupports"],"sources":["@wordpress/block-editor/src/hooks/color.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { addFilter } from '@wordpress/hooks';\nimport { getBlockSupport } from '@wordpress/blocks';\nimport { useMemo, Platform, useCallback } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport {\n\tgetColorClassName,\n\tgetColorObjectByAttributeValues,\n} from '../components/colors';\nimport { __experimentalGetGradientClass } from '../components/gradients';\nimport {\n\tcleanEmptyObject,\n\ttransformStyles,\n\tshouldSkipSerialization,\n} from './utils';\nimport { getBackgroundImageClasses } from './background';\nimport { useSettings } from '../components/use-settings';\nimport InspectorControls from '../components/inspector-controls';\nimport {\n\tuseHasColorPanel,\n\tdefault as StylesColorPanel,\n} from '../components/global-styles/color-panel';\nimport BlockColorContrastChecker from './contrast-checker';\nimport { store as blockEditorStore } from '../store';\n\nexport const COLOR_SUPPORT_KEY = 'color';\n\nconst hasColorSupport = ( blockNameOrType ) => {\n\tconst colorSupport = getBlockSupport( blockNameOrType, COLOR_SUPPORT_KEY );\n\treturn (\n\t\tcolorSupport &&\n\t\t( colorSupport.link === true ||\n\t\t\tcolorSupport.gradient === true ||\n\t\t\tcolorSupport.background !== false ||\n\t\t\tcolorSupport.text !== false )\n\t);\n};\n\nconst hasLinkColorSupport = ( blockType ) => {\n\tif ( Platform.OS !== 'web' ) {\n\t\treturn false;\n\t}\n\n\tconst colorSupport = getBlockSupport( blockType, COLOR_SUPPORT_KEY );\n\n\treturn (\n\t\tcolorSupport !== null &&\n\t\ttypeof colorSupport === 'object' &&\n\t\t!! colorSupport.link\n\t);\n};\n\nconst hasGradientSupport = ( blockNameOrType ) => {\n\tconst colorSupport = getBlockSupport( blockNameOrType, COLOR_SUPPORT_KEY );\n\n\treturn (\n\t\tcolorSupport !== null &&\n\t\ttypeof colorSupport === 'object' &&\n\t\t!! colorSupport.gradients\n\t);\n};\n\nconst hasBackgroundColorSupport = ( blockType ) => {\n\tconst colorSupport = getBlockSupport( blockType, COLOR_SUPPORT_KEY );\n\n\treturn colorSupport && colorSupport.background !== false;\n};\n\nconst hasTextColorSupport = ( blockType ) => {\n\tconst colorSupport = getBlockSupport( blockType, COLOR_SUPPORT_KEY );\n\n\treturn colorSupport && colorSupport.text !== false;\n};\n\n/**\n * Filters registered block settings, extending attributes to include\n * `backgroundColor` and `textColor` attribute.\n *\n * @param {Object} settings Original block settings.\n *\n * @return {Object} Filtered block settings.\n */\nfunction addAttributes( settings ) {\n\tif ( ! hasColorSupport( settings ) ) {\n\t\treturn settings;\n\t}\n\n\t// Allow blocks to specify their own attribute definition with default values if needed.\n\tif ( ! settings.attributes.backgroundColor ) {\n\t\tObject.assign( settings.attributes, {\n\t\t\tbackgroundColor: {\n\t\t\t\ttype: 'string',\n\t\t\t},\n\t\t} );\n\t}\n\tif ( ! settings.attributes.textColor ) {\n\t\tObject.assign( settings.attributes, {\n\t\t\ttextColor: {\n\t\t\t\ttype: 'string',\n\t\t\t},\n\t\t} );\n\t}\n\n\tif ( hasGradientSupport( settings ) && ! settings.attributes.gradient ) {\n\t\tObject.assign( settings.attributes, {\n\t\t\tgradient: {\n\t\t\t\ttype: 'string',\n\t\t\t},\n\t\t} );\n\t}\n\n\treturn settings;\n}\n\n/**\n * Override props assigned to save component to inject colors classnames.\n *\n * @param {Object} props Additional props applied to save element.\n * @param {Object|string} blockNameOrType Block type.\n * @param {Object} attributes Block attributes.\n *\n * @return {Object} Filtered props applied to save element.\n */\nexport function addSaveProps( props, blockNameOrType, attributes ) {\n\tif (\n\t\t! hasColorSupport( blockNameOrType ) ||\n\t\tshouldSkipSerialization( blockNameOrType, COLOR_SUPPORT_KEY )\n\t) {\n\t\treturn props;\n\t}\n\n\tconst hasGradient = hasGradientSupport( blockNameOrType );\n\n\t// I'd have preferred to avoid the \"style\" attribute usage here\n\tconst { backgroundColor, textColor, gradient, style } = attributes;\n\n\tconst shouldSerialize = ( feature ) =>\n\t\t! shouldSkipSerialization(\n\t\t\tblockNameOrType,\n\t\t\tCOLOR_SUPPORT_KEY,\n\t\t\tfeature\n\t\t);\n\n\t// Primary color classes must come before the `has-text-color`,\n\t// `has-background` and `has-link-color` classes to maintain backwards\n\t// compatibility and avoid block invalidations.\n\tconst textClass = shouldSerialize( 'text' )\n\t\t? getColorClassName( 'color', textColor )\n\t\t: undefined;\n\n\tconst gradientClass = shouldSerialize( 'gradients' )\n\t\t? __experimentalGetGradientClass( gradient )\n\t\t: undefined;\n\n\tconst backgroundClass = shouldSerialize( 'background' )\n\t\t? getColorClassName( 'background-color', backgroundColor )\n\t\t: undefined;\n\n\tconst serializeHasBackground =\n\t\tshouldSerialize( 'background' ) || shouldSerialize( 'gradients' );\n\tconst hasBackground =\n\t\tbackgroundColor ||\n\t\tstyle?.color?.background ||\n\t\t( hasGradient && ( gradient || style?.color?.gradient ) );\n\n\tconst newClassName = classnames(\n\t\tprops.className,\n\t\ttextClass,\n\t\tgradientClass,\n\t\t{\n\t\t\t// Don't apply the background class if there's a custom gradient.\n\t\t\t[ backgroundClass ]:\n\t\t\t\t( ! hasGradient || ! style?.color?.gradient ) &&\n\t\t\t\t!! backgroundClass,\n\t\t\t'has-text-color':\n\t\t\t\tshouldSerialize( 'text' ) &&\n\t\t\t\t( textColor || style?.color?.text ),\n\t\t\t'has-background': serializeHasBackground && hasBackground,\n\t\t\t'has-link-color':\n\t\t\t\tshouldSerialize( 'link' ) && style?.elements?.link?.color,\n\t\t}\n\t);\n\tprops.className = newClassName ? newClassName : undefined;\n\n\treturn props;\n}\n\nfunction styleToAttributes( style ) {\n\tconst textColorValue = style?.color?.text;\n\tconst textColorSlug = textColorValue?.startsWith( 'var:preset|color|' )\n\t\t? textColorValue.substring( 'var:preset|color|'.length )\n\t\t: undefined;\n\tconst backgroundColorValue = style?.color?.background;\n\tconst backgroundColorSlug = backgroundColorValue?.startsWith(\n\t\t'var:preset|color|'\n\t)\n\t\t? backgroundColorValue.substring( 'var:preset|color|'.length )\n\t\t: undefined;\n\tconst gradientValue = style?.color?.gradient;\n\tconst gradientSlug = gradientValue?.startsWith( 'var:preset|gradient|' )\n\t\t? gradientValue.substring( 'var:preset|gradient|'.length )\n\t\t: undefined;\n\tconst updatedStyle = { ...style };\n\tupdatedStyle.color = {\n\t\t...updatedStyle.color,\n\t\ttext: textColorSlug ? undefined : textColorValue,\n\t\tbackground: backgroundColorSlug ? undefined : backgroundColorValue,\n\t\tgradient: gradientSlug ? undefined : gradientValue,\n\t};\n\treturn {\n\t\tstyle: cleanEmptyObject( updatedStyle ),\n\t\ttextColor: textColorSlug,\n\t\tbackgroundColor: backgroundColorSlug,\n\t\tgradient: gradientSlug,\n\t};\n}\n\nfunction attributesToStyle( attributes ) {\n\treturn {\n\t\t...attributes.style,\n\t\tcolor: {\n\t\t\t...attributes.style?.color,\n\t\t\ttext: attributes.textColor\n\t\t\t\t? 'var:preset|color|' + attributes.textColor\n\t\t\t\t: attributes.style?.color?.text,\n\t\t\tbackground: attributes.backgroundColor\n\t\t\t\t? 'var:preset|color|' + attributes.backgroundColor\n\t\t\t\t: attributes.style?.color?.background,\n\t\t\tgradient: attributes.gradient\n\t\t\t\t? 'var:preset|gradient|' + attributes.gradient\n\t\t\t\t: attributes.style?.color?.gradient,\n\t\t},\n\t};\n}\n\nfunction ColorInspectorControl( { children, resetAllFilter } ) {\n\tconst attributesResetAllFilter = useCallback(\n\t\t( attributes ) => {\n\t\t\tconst existingStyle = attributesToStyle( attributes );\n\t\t\tconst updatedStyle = resetAllFilter( existingStyle );\n\t\t\treturn {\n\t\t\t\t...attributes,\n\t\t\t\t...styleToAttributes( updatedStyle ),\n\t\t\t};\n\t\t},\n\t\t[ resetAllFilter ]\n\t);\n\n\treturn (\n\t\t<InspectorControls\n\t\t\tgroup=\"color\"\n\t\t\tresetAllFilter={ attributesResetAllFilter }\n\t\t>\n\t\t\t{ children }\n\t\t</InspectorControls>\n\t);\n}\n\nexport function ColorEdit( { clientId, name, setAttributes, settings } ) {\n\tconst isEnabled = useHasColorPanel( settings );\n\tfunction selector( select ) {\n\t\tconst { style, textColor, backgroundColor, gradient } =\n\t\t\tselect( blockEditorStore ).getBlockAttributes( clientId ) || {};\n\t\treturn { style, textColor, backgroundColor, gradient };\n\t}\n\tconst { style, textColor, backgroundColor, gradient } = useSelect(\n\t\tselector,\n\t\t[ clientId ]\n\t);\n\tconst value = useMemo( () => {\n\t\treturn attributesToStyle( {\n\t\t\tstyle,\n\t\t\ttextColor,\n\t\t\tbackgroundColor,\n\t\t\tgradient,\n\t\t} );\n\t}, [ style, textColor, backgroundColor, gradient ] );\n\n\tconst onChange = ( newStyle ) => {\n\t\tsetAttributes( styleToAttributes( newStyle ) );\n\t};\n\n\tif ( ! isEnabled ) {\n\t\treturn null;\n\t}\n\n\tconst defaultControls = getBlockSupport( name, [\n\t\tCOLOR_SUPPORT_KEY,\n\t\t'__experimentalDefaultControls',\n\t] );\n\n\tconst enableContrastChecking =\n\t\tPlatform.OS === 'web' &&\n\t\t! value?.color?.gradient &&\n\t\t( settings?.color?.text || settings?.color?.link ) &&\n\t\t// Contrast checking is enabled by default.\n\t\t// Deactivating it requires `enableContrastChecker` to have\n\t\t// an explicit value of `false`.\n\t\tfalse !==\n\t\t\tgetBlockSupport( name, [\n\t\t\t\tCOLOR_SUPPORT_KEY,\n\t\t\t\t'enableContrastChecker',\n\t\t\t] );\n\n\treturn (\n\t\t<StylesColorPanel\n\t\t\tas={ ColorInspectorControl }\n\t\t\tpanelId={ clientId }\n\t\t\tsettings={ settings }\n\t\t\tvalue={ value }\n\t\t\tonChange={ onChange }\n\t\t\tdefaultControls={ defaultControls }\n\t\t\tenableContrastChecker={\n\t\t\t\tfalse !==\n\t\t\t\tgetBlockSupport( name, [\n\t\t\t\t\tCOLOR_SUPPORT_KEY,\n\t\t\t\t\t'enableContrastChecker',\n\t\t\t\t] )\n\t\t\t}\n\t\t>\n\t\t\t{ enableContrastChecking && (\n\t\t\t\t<BlockColorContrastChecker clientId={ clientId } />\n\t\t\t) }\n\t\t</StylesColorPanel>\n\t);\n}\n\nfunction useBlockProps( {\n\tname,\n\tbackgroundColor,\n\ttextColor,\n\tgradient,\n\tstyle,\n} ) {\n\tconst [ userPalette, themePalette, defaultPalette ] = useSettings(\n\t\t'color.palette.custom',\n\t\t'color.palette.theme',\n\t\t'color.palette.default'\n\t);\n\n\tconst colors = useMemo(\n\t\t() => [\n\t\t\t...( userPalette || [] ),\n\t\t\t...( themePalette || [] ),\n\t\t\t...( defaultPalette || [] ),\n\t\t],\n\t\t[ userPalette, themePalette, defaultPalette ]\n\t);\n\tif (\n\t\t! hasColorSupport( name ) ||\n\t\tshouldSkipSerialization( name, COLOR_SUPPORT_KEY )\n\t) {\n\t\treturn {};\n\t}\n\tconst extraStyles = {};\n\n\tif (\n\t\ttextColor &&\n\t\t! shouldSkipSerialization( name, COLOR_SUPPORT_KEY, 'text' )\n\t) {\n\t\textraStyles.color = getColorObjectByAttributeValues(\n\t\t\tcolors,\n\t\t\ttextColor\n\t\t)?.color;\n\t}\n\tif (\n\t\tbackgroundColor &&\n\t\t! shouldSkipSerialization( name, COLOR_SUPPORT_KEY, 'background' )\n\t) {\n\t\textraStyles.backgroundColor = getColorObjectByAttributeValues(\n\t\t\tcolors,\n\t\t\tbackgroundColor\n\t\t)?.color;\n\t}\n\n\tconst saveProps = addSaveProps( { style: extraStyles }, name, {\n\t\ttextColor,\n\t\tbackgroundColor,\n\t\tgradient,\n\t\tstyle,\n\t} );\n\n\tconst hasBackgroundValue =\n\t\tbackgroundColor ||\n\t\tstyle?.color?.background ||\n\t\tgradient ||\n\t\tstyle?.color?.gradient;\n\n\treturn {\n\t\t...saveProps,\n\t\tclassName: classnames(\n\t\t\tsaveProps.className,\n\t\t\t// Add background image classes in the editor, if not already handled by background color values.\n\t\t\t! hasBackgroundValue && getBackgroundImageClasses( style )\n\t\t),\n\t};\n}\n\nexport default {\n\tuseBlockProps,\n\taddSaveProps,\n\tattributeKeys: [ 'backgroundColor', 'textColor', 'gradient', 'style' ],\n\thasSupport: hasColorSupport,\n};\n\nconst MIGRATION_PATHS = {\n\tlinkColor: [ [ 'style', 'elements', 'link', 'color', 'text' ] ],\n\ttextColor: [ [ 'textColor' ], [ 'style', 'color', 'text' ] ],\n\tbackgroundColor: [\n\t\t[ 'backgroundColor' ],\n\t\t[ 'style', 'color', 'background' ],\n\t],\n\tgradient: [ [ 'gradient' ], [ 'style', 'color', 'gradient' ] ],\n};\n\nexport function addTransforms( result, source, index, results ) {\n\tconst destinationBlockType = result.name;\n\tconst activeSupports = {\n\t\tlinkColor: hasLinkColorSupport( destinationBlockType ),\n\t\ttextColor: hasTextColorSupport( destinationBlockType ),\n\t\tbackgroundColor: hasBackgroundColorSupport( destinationBlockType ),\n\t\tgradient: hasGradientSupport( destinationBlockType ),\n\t};\n\treturn transformStyles(\n\t\tactiveSupports,\n\t\tMIGRATION_PATHS,\n\t\tresult,\n\t\tsource,\n\t\tindex,\n\t\tresults\n\t);\n}\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/color/addAttribute',\n\taddAttributes\n);\n\naddFilter(\n\t'blocks.switchToBlockType.transformedBlock',\n\t'core/color/addTransforms',\n\taddTransforms\n);\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,SAAS,QAAQ,kBAAkB;AAC5C,SAASC,eAAe,QAAQ,mBAAmB;AACnD,SAASC,OAAO,EAAEC,QAAQ,EAAEC,WAAW,QAAQ,oBAAoB;AACnE,SAASC,SAAS,QAAQ,iBAAiB;;AAE3C;AACA;AACA;AACA,SACCC,iBAAiB,EACjBC,+BAA+B,QACzB,sBAAsB;AAC7B,SAASC,8BAA8B,QAAQ,yBAAyB;AACxE,SACCC,gBAAgB,EAChBC,eAAe,EACfC,uBAAuB,QACjB,SAAS;AAChB,SAASC,yBAAyB,QAAQ,cAAc;AACxD,SAASC,WAAW,QAAQ,4BAA4B;AACxD,OAAOC,iBAAiB,MAAM,kCAAkC;AAChE,SACCC,gBAAgB,EAChBC,OAAO,IAAIC,gBAAgB,QACrB,yCAAyC;AAChD,OAAOC,yBAAyB,MAAM,oBAAoB;AAC1D,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,UAAU;AAEpD,OAAO,MAAMC,iBAAiB,GAAG,OAAO;AAExC,MAAMC,eAAe,GAAKC,eAAe,IAAM;EAC9C,MAAMC,YAAY,GAAGvB,eAAe,CAAEsB,eAAe,EAAEF,iBAAkB,CAAC;EAC1E,OACCG,YAAY,KACVA,YAAY,CAACC,IAAI,KAAK,IAAI,IAC3BD,YAAY,CAACE,QAAQ,KAAK,IAAI,IAC9BF,YAAY,CAACG,UAAU,KAAK,KAAK,IACjCH,YAAY,CAACI,IAAI,KAAK,KAAK,CAAE;AAEhC,CAAC;AAED,MAAMC,mBAAmB,GAAKC,SAAS,IAAM;EAC5C,IAAK3B,QAAQ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+1 @@
1
- {"version":3,"names":["hasBlockSupport","addFilter","migrateLightBlockWrapper","settings","apiVersion"],"sources":["@wordpress/block-editor/src/hooks/compat.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { hasBlockSupport } from '@wordpress/blocks';\nimport { addFilter } from '@wordpress/hooks';\n\nfunction migrateLightBlockWrapper( settings ) {\n\tconst { apiVersion = 1 } = settings;\n\tif (\n\t\tapiVersion < 2 &&\n\t\thasBlockSupport( settings, 'lightBlockWrapper', false )\n\t) {\n\t\tsettings.apiVersion = 2;\n\t}\n\n\treturn settings;\n}\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/compat/migrateLightBlockWrapper',\n\tmigrateLightBlockWrapper\n);\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,eAAe,QAAQ,mBAAmB;AACnD,SAASC,SAAS,QAAQ,kBAAkB;AAE5C,SAASC,wBAAwBA,CAAEC,QAAQ,EAAG;EAC7C,MAAM;IAAEC,UAAU,GAAG;EAAE,CAAC,GAAGD,QAAQ;EACnC,IACCC,UAAU,GAAG,CAAC,IACdJ,eAAe,CAAEG,QAAQ,EAAE,mBAAmB,EAAE,KAAM,CAAC,EACtD;IACDA,QAAQ,CAACC,UAAU,GAAG,CAAC;EACxB;EAEA,OAAOD,QAAQ;AAChB;AAEAF,SAAS,CACR,0BAA0B,EAC1B,sCAAsC,EACtCC,wBACD,CAAC"}
1
+ {"version":3,"names":["hasBlockSupport","addFilter","migrateLightBlockWrapper","settings","apiVersion"],"sources":["@wordpress/block-editor/src/hooks/compat.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { hasBlockSupport } from '@wordpress/blocks';\nimport { addFilter } from '@wordpress/hooks';\n\nfunction migrateLightBlockWrapper( settings ) {\n\tconst { apiVersion = 1 } = settings;\n\tif (\n\t\tapiVersion < 2 &&\n\t\thasBlockSupport( settings, 'lightBlockWrapper', false )\n\t) {\n\t\tsettings.apiVersion = 2;\n\t}\n\n\treturn settings;\n}\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/compat/migrateLightBlockWrapper',\n\tmigrateLightBlockWrapper\n);\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,eAAe,QAAQ,mBAAmB;AACnD,SAASC,SAAS,QAAQ,kBAAkB;AAE5C,SAASC,wBAAwBA,CAAEC,QAAQ,EAAG;EAC7C,MAAM;IAAEC,UAAU,GAAG;EAAE,CAAC,GAAGD,QAAQ;EACnC,IACCC,UAAU,GAAG,CAAC,IACdJ,eAAe,CAAEG,QAAQ,EAAE,mBAAmB,EAAE,KAAM,CAAC,EACtD;IACDA,QAAQ,CAACC,UAAU,GAAG,CAAC;EACxB;EAEA,OAAOD,QAAQ;AAChB;AAEAF,SAAS,CACR,0BAA0B,EAC1B,sCAAsC,EACtCC,wBACD,CAAC","ignoreList":[]}
@@ -34,14 +34,14 @@ function ContentLockControlsPure({
34
34
  isEditingAsBlocks
35
35
  } = useSelect(select => {
36
36
  const {
37
- __unstableGetContentLockingParent,
37
+ getContentLockingParent,
38
38
  getTemplateLock,
39
- __unstableGetTemporarilyEditingAsBlocks
40
- } = select(blockEditorStore);
39
+ getTemporarilyEditingAsBlocks
40
+ } = unlock(select(blockEditorStore));
41
41
  return {
42
42
  templateLock: getTemplateLock(clientId),
43
- isLockedByParent: !!__unstableGetContentLockingParent(clientId),
44
- isEditingAsBlocks: __unstableGetTemporarilyEditingAsBlocks() === clientId
43
+ isLockedByParent: !!getContentLockingParent(clientId),
44
+ isEditingAsBlocks: getTemporarilyEditingAsBlocks() === clientId
45
45
  };
46
46
  }, [clientId]);
47
47
  const {
@@ -1 +1 @@
1
- {"version":3,"names":["ToolbarButton","MenuItem","useDispatch","useSelect","__","useCallback","store","blockEditorStore","BlockControls","BlockSettingsMenuControls","unlock","ContentLockControlsPure","clientId","isSelected","getBlockListSettings","getSettings","templateLock","isLockedByParent","isEditingAsBlocks","select","__unstableGetContentLockingParent","getTemplateLock","__unstableGetTemporarilyEditingAsBlocks","updateSettings","updateBlockListSettings","__unstableSetTemporarilyEditingAsBlocks","stopEditingAsBlocks","isContentLocked","__unstableMarkNextChangeAsNotPersistent","updateBlockAttributes","stopEditingAsBlockCallback","showStopEditingAsBlocks","showStartEditingAsBlocks","createElement","Fragment","group","onClick","onClose","undefined","focusModeToRevert","focusMode","edit","hasSupport"],"sources":["@wordpress/block-editor/src/hooks/content-lock-ui.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { ToolbarButton, MenuItem } from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { useCallback } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../store';\nimport { BlockControls, BlockSettingsMenuControls } from '../components';\nimport { unlock } from '../lock-unlock';\n\n// The implementation of content locking is mainly in this file, although the mechanism\n// to stop temporarily editing as blocks when an outside block is selected is on component StopEditingAsBlocksOnOutsideSelect\n// at block-editor/src/components/block-list/index.js.\n// Besides the components on this file and the file referenced above the implementation\n// also includes artifacts on the store (actions, reducers, and selector).\n\nfunction ContentLockControlsPure( { clientId, isSelected } ) {\n\tconst { getBlockListSettings, getSettings } = useSelect( blockEditorStore );\n\tconst { templateLock, isLockedByParent, isEditingAsBlocks } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\t__unstableGetContentLockingParent,\n\t\t\t\tgetTemplateLock,\n\t\t\t\t__unstableGetTemporarilyEditingAsBlocks,\n\t\t\t} = select( blockEditorStore );\n\t\t\treturn {\n\t\t\t\ttemplateLock: getTemplateLock( clientId ),\n\t\t\t\tisLockedByParent:\n\t\t\t\t\t!! __unstableGetContentLockingParent( clientId ),\n\t\t\t\tisEditingAsBlocks:\n\t\t\t\t\t__unstableGetTemporarilyEditingAsBlocks() === clientId,\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\tconst {\n\t\tupdateSettings,\n\t\tupdateBlockListSettings,\n\t\t__unstableSetTemporarilyEditingAsBlocks,\n\t} = useDispatch( blockEditorStore );\n\tconst { stopEditingAsBlocks } = unlock( useDispatch( blockEditorStore ) );\n\tconst isContentLocked =\n\t\t! isLockedByParent && templateLock === 'contentOnly';\n\tconst { __unstableMarkNextChangeAsNotPersistent, updateBlockAttributes } =\n\t\tuseDispatch( blockEditorStore );\n\n\tconst stopEditingAsBlockCallback = useCallback( () => {\n\t\tstopEditingAsBlocks( clientId );\n\t}, [ clientId, stopEditingAsBlocks ] );\n\n\tif ( ! isContentLocked && ! isEditingAsBlocks ) {\n\t\treturn null;\n\t}\n\n\tconst showStopEditingAsBlocks = isEditingAsBlocks && ! isContentLocked;\n\tconst showStartEditingAsBlocks =\n\t\t! isEditingAsBlocks && isContentLocked && isSelected;\n\n\treturn (\n\t\t<>\n\t\t\t{ showStopEditingAsBlocks && (\n\t\t\t\t<>\n\t\t\t\t\t<BlockControls group=\"other\">\n\t\t\t\t\t\t<ToolbarButton onClick={ stopEditingAsBlockCallback }>\n\t\t\t\t\t\t\t{ __( 'Done' ) }\n\t\t\t\t\t\t</ToolbarButton>\n\t\t\t\t\t</BlockControls>\n\t\t\t\t</>\n\t\t\t) }\n\t\t\t{ showStartEditingAsBlocks && (\n\t\t\t\t<BlockSettingsMenuControls>\n\t\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\t\t\t\t\t\tupdateBlockAttributes( clientId, {\n\t\t\t\t\t\t\t\t\ttemplateLock: undefined,\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\tupdateBlockListSettings( clientId, {\n\t\t\t\t\t\t\t\t\t...getBlockListSettings( clientId ),\n\t\t\t\t\t\t\t\t\ttemplateLock: false,\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\tconst focusModeToRevert =\n\t\t\t\t\t\t\t\t\tgetSettings().focusMode;\n\t\t\t\t\t\t\t\tupdateSettings( { focusMode: true } );\n\t\t\t\t\t\t\t\t__unstableSetTemporarilyEditingAsBlocks(\n\t\t\t\t\t\t\t\t\tclientId,\n\t\t\t\t\t\t\t\t\tfocusModeToRevert\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Modify' ) }\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t) }\n\t\t\t\t</BlockSettingsMenuControls>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport default {\n\tedit: ContentLockControlsPure,\n\thasSupport() {\n\t\treturn true;\n\t},\n};\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,aAAa,EAAEC,QAAQ,QAAQ,uBAAuB;AAC/D,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,WAAW,QAAQ,oBAAoB;;AAEhD;AACA;AACA;AACA,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,UAAU;AACpD,SAASC,aAAa,EAAEC,yBAAyB,QAAQ,eAAe;AACxE,SAASC,MAAM,QAAQ,gBAAgB;;AAEvC;AACA;AACA;AACA;AACA;;AAEA,SAASC,uBAAuBA,CAAE;EAAEC,QAAQ;EAAEC;AAAW,CAAC,EAAG;EAC5D,MAAM;IAAEC,oBAAoB;IAAEC;EAAY,CAAC,GAAGZ,SAAS,CAAEI,gBAAiB,CAAC;EAC3E,MAAM;IAAES,YAAY;IAAEC,gBAAgB;IAAEC;EAAkB,CAAC,GAAGf,SAAS,CACpEgB,MAAM,IAAM;IACb,MAAM;MACLC,iCAAiC;MACjCC,eAAe;MACfC;IACD,CAAC,GAAGH,MAAM,CAAEZ,gBAAiB,CAAC;IAC9B,OAAO;MACNS,YAAY,EAAEK,eAAe,CAAET,QAAS,CAAC;MACzCK,gBAAgB,EACf,CAAC,CAAEG,iCAAiC,CAAER,QAA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,EAAEsB;MACf,CAAE,CAAC;MACHd,uBAAuB,CAAEZ,QAAQ,EAAE;QAClC,GAAGE,oBAAoB,CAAEF,QAAS,CAAC;QACnCI,YAAY,EAAE;MACf,CAAE,CAAC;MACH,MAAMuB,iBAAiB,GACtBxB,WAAW,CAAC,CAAC,CAACyB,SAAS;MACxBjB,cAAc,CAAE;QAAEiB,SAAS,EAAE;MAAK,CAAE,CAAC;MACrCf,uCAAuC,CACtCb,QAAQ,EACR2B,iBACD,CAAC;MACDF,OAAO,CAAC,CAAC;IACV;EAAG,GAEDjC,EAAE,CAAE,QAAS,CACN,CAEe,CAE3B,CAAC;AAEL;AAEA,eAAe;EACdqC,IAAI,EAAE9B,uBAAuB;EAC7B+B,UAAUA,CAAA,EAAG;IACZ,OAAO,IAAI;EACZ;AACD,CAAC"}
1
+ {"version":3,"names":["ToolbarButton","MenuItem","useDispatch","useSelect","__","useCallback","store","blockEditorStore","BlockControls","BlockSettingsMenuControls","unlock","ContentLockControlsPure","clientId","isSelected","getBlockListSettings","getSettings","templateLock","isLockedByParent","isEditingAsBlocks","select","getContentLockingParent","getTemplateLock","getTemporarilyEditingAsBlocks","updateSettings","updateBlockListSettings","__unstableSetTemporarilyEditingAsBlocks","stopEditingAsBlocks","isContentLocked","__unstableMarkNextChangeAsNotPersistent","updateBlockAttributes","stopEditingAsBlockCallback","showStopEditingAsBlocks","showStartEditingAsBlocks","createElement","Fragment","group","onClick","onClose","undefined","focusModeToRevert","focusMode","edit","hasSupport"],"sources":["@wordpress/block-editor/src/hooks/content-lock-ui.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { ToolbarButton, MenuItem } from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { useCallback } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../store';\nimport { BlockControls, BlockSettingsMenuControls } from '../components';\nimport { unlock } from '../lock-unlock';\n\n// The implementation of content locking is mainly in this file, although the mechanism\n// to stop temporarily editing as blocks when an outside block is selected is on component StopEditingAsBlocksOnOutsideSelect\n// at block-editor/src/components/block-list/index.js.\n// Besides the components on this file and the file referenced above the implementation\n// also includes artifacts on the store (actions, reducers, and selector).\n\nfunction ContentLockControlsPure( { clientId, isSelected } ) {\n\tconst { getBlockListSettings, getSettings } = useSelect( blockEditorStore );\n\tconst { templateLock, isLockedByParent, isEditingAsBlocks } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetContentLockingParent,\n\t\t\t\tgetTemplateLock,\n\t\t\t\tgetTemporarilyEditingAsBlocks,\n\t\t\t} = unlock( select( blockEditorStore ) );\n\t\t\treturn {\n\t\t\t\ttemplateLock: getTemplateLock( clientId ),\n\t\t\t\tisLockedByParent: !! getContentLockingParent( clientId ),\n\t\t\t\tisEditingAsBlocks: getTemporarilyEditingAsBlocks() === clientId,\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\tconst {\n\t\tupdateSettings,\n\t\tupdateBlockListSettings,\n\t\t__unstableSetTemporarilyEditingAsBlocks,\n\t} = useDispatch( blockEditorStore );\n\tconst { stopEditingAsBlocks } = unlock( useDispatch( blockEditorStore ) );\n\tconst isContentLocked =\n\t\t! isLockedByParent && templateLock === 'contentOnly';\n\tconst { __unstableMarkNextChangeAsNotPersistent, updateBlockAttributes } =\n\t\tuseDispatch( blockEditorStore );\n\n\tconst stopEditingAsBlockCallback = useCallback( () => {\n\t\tstopEditingAsBlocks( clientId );\n\t}, [ clientId, stopEditingAsBlocks ] );\n\n\tif ( ! isContentLocked && ! isEditingAsBlocks ) {\n\t\treturn null;\n\t}\n\n\tconst showStopEditingAsBlocks = isEditingAsBlocks && ! isContentLocked;\n\tconst showStartEditingAsBlocks =\n\t\t! isEditingAsBlocks && isContentLocked && isSelected;\n\n\treturn (\n\t\t<>\n\t\t\t{ showStopEditingAsBlocks && (\n\t\t\t\t<>\n\t\t\t\t\t<BlockControls group=\"other\">\n\t\t\t\t\t\t<ToolbarButton onClick={ stopEditingAsBlockCallback }>\n\t\t\t\t\t\t\t{ __( 'Done' ) }\n\t\t\t\t\t\t</ToolbarButton>\n\t\t\t\t\t</BlockControls>\n\t\t\t\t</>\n\t\t\t) }\n\t\t\t{ showStartEditingAsBlocks && (\n\t\t\t\t<BlockSettingsMenuControls>\n\t\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\t\t\t\t\t\tupdateBlockAttributes( clientId, {\n\t\t\t\t\t\t\t\t\ttemplateLock: undefined,\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\tupdateBlockListSettings( clientId, {\n\t\t\t\t\t\t\t\t\t...getBlockListSettings( clientId ),\n\t\t\t\t\t\t\t\t\ttemplateLock: false,\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\tconst focusModeToRevert =\n\t\t\t\t\t\t\t\t\tgetSettings().focusMode;\n\t\t\t\t\t\t\t\tupdateSettings( { focusMode: true } );\n\t\t\t\t\t\t\t\t__unstableSetTemporarilyEditingAsBlocks(\n\t\t\t\t\t\t\t\t\tclientId,\n\t\t\t\t\t\t\t\t\tfocusModeToRevert\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Modify' ) }\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t) }\n\t\t\t\t</BlockSettingsMenuControls>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport default {\n\tedit: ContentLockControlsPure,\n\thasSupport() {\n\t\treturn true;\n\t},\n};\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,aAAa,EAAEC,QAAQ,QAAQ,uBAAuB;AAC/D,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AAC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 @@
1
- {"version":3,"names":["useState","useEffect","ContrastChecker","__unstableUseBlockRef","useBlockRef","getComputedStyle","node","ownerDocument","defaultView","BlockColorContrastChecker","clientId","detectedBackgroundColor","setDetectedBackgroundColor","detectedColor","setDetectedColor","detectedLinkColor","setDetectedLinkColor","ref","current","color","firstLinkElement","querySelector","innerText","backgroundColorNode","backgroundColor","parentNode","nodeType","ELEMENT_NODE","createElement","textColor","enableAlphaChecker","linkColor"],"sources":["@wordpress/block-editor/src/hooks/contrast-checker.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState, useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport ContrastChecker from '../components/contrast-checker';\nimport { __unstableUseBlockRef as useBlockRef } from '../components/block-list/use-block-props/use-block-refs';\n\nfunction getComputedStyle( node ) {\n\treturn node.ownerDocument.defaultView.getComputedStyle( node );\n}\n\nexport default function BlockColorContrastChecker( { clientId } ) {\n\tconst [ detectedBackgroundColor, setDetectedBackgroundColor ] = useState();\n\tconst [ detectedColor, setDetectedColor ] = useState();\n\tconst [ detectedLinkColor, setDetectedLinkColor ] = useState();\n\tconst ref = useBlockRef( clientId );\n\n\t// There are so many things that can change the color of a block\n\t// So we perform this check on every render.\n\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\tuseEffect( () => {\n\t\tif ( ! ref.current ) {\n\t\t\treturn;\n\t\t}\n\t\tsetDetectedColor( getComputedStyle( ref.current ).color );\n\n\t\tconst firstLinkElement = ref.current?.querySelector( 'a' );\n\t\tif ( firstLinkElement && !! firstLinkElement.innerText ) {\n\t\t\tsetDetectedLinkColor( getComputedStyle( firstLinkElement ).color );\n\t\t}\n\n\t\tlet backgroundColorNode = ref.current;\n\t\tlet backgroundColor =\n\t\t\tgetComputedStyle( backgroundColorNode ).backgroundColor;\n\t\twhile (\n\t\t\tbackgroundColor === 'rgba(0, 0, 0, 0)' &&\n\t\t\tbackgroundColorNode.parentNode &&\n\t\t\tbackgroundColorNode.parentNode.nodeType ===\n\t\t\t\tbackgroundColorNode.parentNode.ELEMENT_NODE\n\t\t) {\n\t\t\tbackgroundColorNode = backgroundColorNode.parentNode;\n\t\t\tbackgroundColor =\n\t\t\t\tgetComputedStyle( backgroundColorNode ).backgroundColor;\n\t\t}\n\n\t\tsetDetectedBackgroundColor( backgroundColor );\n\t} );\n\n\treturn (\n\t\t<ContrastChecker\n\t\t\tbackgroundColor={ detectedBackgroundColor }\n\t\t\ttextColor={ detectedColor }\n\t\t\tenableAlphaChecker\n\t\t\tlinkColor={ detectedLinkColor }\n\t\t/>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,QAAQ,EAAEC,SAAS,QAAQ,oBAAoB;;AAExD;AACA;AACA;AACA,OAAOC,eAAe,MAAM,gCAAgC;AAC5D,SAASC,qBAAqB,IAAIC,WAAW,QAAQ,yDAAyD;AAE9G,SAASC,gBAAgBA,CAAEC,IAAI,EAAG;EACjC,OAAOA,IAAI,CAACC,aAAa,CAACC,WAAW,CAACH,gBAAgB,CAAEC,IAAK,CAAC;AAC/D;AAEA,eAAe,SAASG,yBAAyBA,CAAE;EAAEC;AAAS,CAAC,EAAG;EACjE,MAAM,CAAEC,uBAAuB,EAAEC,0BAA0B,CAAE,GAAGZ,QAAQ,CAAC,CAAC;EAC1E,MAAM,CAAEa,aAAa,EAAEC,gBAAgB,CAAE,GAAGd,QAAQ,CAAC,CAAC;EACtD,MAAM,CAAEe,iBAAiB,EAAEC,oBAAoB,CAAE,GAAGhB,QAAQ,CAAC,CAAC;EAC9D,MAAMiB,GAAG,GAAGb,WAAW,CAAEM,QAAS,CAAC;;EAEnC;EACA;EACA;EACAT,SAAS,CAAE,MAAM;IAChB,IAAK,CAAEgB,GAAG,CAACC,OAAO,EAAG;MACpB;IACD;IACAJ,gBAAgB,CAAET,gBAAgB,CAAEY,GAAG,CAACC,OAAQ,CAAC,CAACC,KAAM,CAAC;IAEzD,MAAMC,gBAAgB,GAAGH,GAAG,CAACC,OAAO,EAAEG,aAAa,CAAE,GAAI,CAAC;IAC1D,IAAKD,gBAAgB,IAAI,CAAC,CAAEA,gBAAgB,CAACE,SAAS,EAAG;MACxDN,oBAAoB,CAAEX,gBAAgB,CAAEe,gBAAiB,CAAC,CAACD,KAAM,CAAC;IACnE;IAEA,IAAII,mBAAmB,GAAGN,GAAG,CAACC,OAAO;IACrC,IAAIM,eAAe,GAClBnB,gBAAgB,CAAEkB,mBAAoB,CAAC,CAACC,eAAe;IACxD,OACCA,eAAe,KAAK,kBAAkB,IACtCD,mBAAmB,CAACE,UAAU,IAC9BF,mBAAmB,CAACE,UAAU,CAACC,QAAQ,KACtCH,mBAAmB,CAACE,UAAU,CAACE,YAAY,EAC3C;MACDJ,mBAAmB,GAAGA,mBAAmB,CAACE,UAAU;MACpDD,eAAe,GACdnB,gBAAgB,CAAEkB,mBAAoB,CAAC,CAACC,eAAe;IACzD;IAEAZ,0BAA0B,CAAEY,eAAgB,CAAC;EAC9C,CAAE,CAAC;EAEH,OACCI,aAAA,CAAC1B,eAAe;IACfsB,eAAe,EAAGb,uBAAyB;IAC3CkB,SAAS,EAAGhB,aAAe;IAC3BiB,kBAAkB;IAClBC,SAAS,EAAGhB;EAAmB,CAC/B,CAAC;AAEJ"}
1
+ {"version":3,"names":["useState","useEffect","ContrastChecker","__unstableUseBlockRef","useBlockRef","getComputedStyle","node","ownerDocument","defaultView","BlockColorContrastChecker","clientId","detectedBackgroundColor","setDetectedBackgroundColor","detectedColor","setDetectedColor","detectedLinkColor","setDetectedLinkColor","ref","current","color","firstLinkElement","querySelector","innerText","backgroundColorNode","backgroundColor","parentNode","nodeType","ELEMENT_NODE","createElement","textColor","enableAlphaChecker","linkColor"],"sources":["@wordpress/block-editor/src/hooks/contrast-checker.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState, useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport ContrastChecker from '../components/contrast-checker';\nimport { __unstableUseBlockRef as useBlockRef } from '../components/block-list/use-block-props/use-block-refs';\n\nfunction getComputedStyle( node ) {\n\treturn node.ownerDocument.defaultView.getComputedStyle( node );\n}\n\nexport default function BlockColorContrastChecker( { clientId } ) {\n\tconst [ detectedBackgroundColor, setDetectedBackgroundColor ] = useState();\n\tconst [ detectedColor, setDetectedColor ] = useState();\n\tconst [ detectedLinkColor, setDetectedLinkColor ] = useState();\n\tconst ref = useBlockRef( clientId );\n\n\t// There are so many things that can change the color of a block\n\t// So we perform this check on every render.\n\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\tuseEffect( () => {\n\t\tif ( ! ref.current ) {\n\t\t\treturn;\n\t\t}\n\t\tsetDetectedColor( getComputedStyle( ref.current ).color );\n\n\t\tconst firstLinkElement = ref.current?.querySelector( 'a' );\n\t\tif ( firstLinkElement && !! firstLinkElement.innerText ) {\n\t\t\tsetDetectedLinkColor( getComputedStyle( firstLinkElement ).color );\n\t\t}\n\n\t\tlet backgroundColorNode = ref.current;\n\t\tlet backgroundColor =\n\t\t\tgetComputedStyle( backgroundColorNode ).backgroundColor;\n\t\twhile (\n\t\t\tbackgroundColor === 'rgba(0, 0, 0, 0)' &&\n\t\t\tbackgroundColorNode.parentNode &&\n\t\t\tbackgroundColorNode.parentNode.nodeType ===\n\t\t\t\tbackgroundColorNode.parentNode.ELEMENT_NODE\n\t\t) {\n\t\t\tbackgroundColorNode = backgroundColorNode.parentNode;\n\t\t\tbackgroundColor =\n\t\t\t\tgetComputedStyle( backgroundColorNode ).backgroundColor;\n\t\t}\n\n\t\tsetDetectedBackgroundColor( backgroundColor );\n\t} );\n\n\treturn (\n\t\t<ContrastChecker\n\t\t\tbackgroundColor={ detectedBackgroundColor }\n\t\t\ttextColor={ detectedColor }\n\t\t\tenableAlphaChecker\n\t\t\tlinkColor={ detectedLinkColor }\n\t\t/>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,QAAQ,EAAEC,SAAS,QAAQ,oBAAoB;;AAExD;AACA;AACA;AACA,OAAOC,eA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AmB,CAACE,UAAU;MACpDD,eAAe,GACdnB,gBAAgB,CAAEkB,mBAAoB,CAAC,CAACC,eAAe;IACzD;IAEAZ,0BAA0B,CAAEY,eAAgB,CAAC;EAC9C,CAAE,CAAC;EAEH,OACCI,aAAA,CAAC1B,eAAe;IACfsB,eAAe,EAAGb,uBAAyB;IAC3CkB,SAAS,EAAGhB,aAAe;IAC3BiB,kBAAkB;IAClBC,SAAS,EAAGhB;EAAmB,CAC/B,CAAC;AAEJ","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["classnames","addFilter","TextControl","__","hasBlockSupport","InspectorControls","useBlockEditingMode","addAttribute","settings","attributes","className","type","CustomClassNameControlsPure","setAttributes","blockEditingMode","createElement","group","__nextHasNoMarginBottom","__next40pxDefaultSize","autoComplete","label","value","onChange","nextValue","undefined","help","edit","addSaveProps","attributeKeys","hasSupport","name","extraProps","blockType","addTransforms","result","source","index","results","length","innerBlocks","originClassName"],"sources":["@wordpress/block-editor/src/hooks/custom-class-name.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { addFilter } from '@wordpress/hooks';\nimport { TextControl } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { hasBlockSupport } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { InspectorControls } from '../components';\nimport { useBlockEditingMode } from '../components/block-editing-mode';\n\n/**\n * Filters registered block settings, extending attributes to include `className`.\n *\n * @param {Object} settings Original block settings.\n *\n * @return {Object} Filtered block settings.\n */\nexport function addAttribute( settings ) {\n\tif ( hasBlockSupport( settings, 'customClassName', true ) ) {\n\t\t// Gracefully handle if settings.attributes is undefined.\n\t\tsettings.attributes = {\n\t\t\t...settings.attributes,\n\t\t\tclassName: {\n\t\t\t\ttype: 'string',\n\t\t\t},\n\t\t};\n\t}\n\n\treturn settings;\n}\n\nfunction CustomClassNameControlsPure( { className, setAttributes } ) {\n\tconst blockEditingMode = useBlockEditingMode();\n\tif ( blockEditingMode !== 'default' ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<InspectorControls group=\"advanced\">\n\t\t\t<TextControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t__next40pxDefaultSize\n\t\t\t\tautoComplete=\"off\"\n\t\t\t\tlabel={ __( 'Additional CSS class(es)' ) }\n\t\t\t\tvalue={ className || '' }\n\t\t\t\tonChange={ ( nextValue ) => {\n\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\tclassName: nextValue !== '' ? nextValue : undefined,\n\t\t\t\t\t} );\n\t\t\t\t} }\n\t\t\t\thelp={ __( 'Separate multiple classes with spaces.' ) }\n\t\t\t/>\n\t\t</InspectorControls>\n\t);\n}\n\nexport default {\n\tedit: CustomClassNameControlsPure,\n\taddSaveProps,\n\tattributeKeys: [ 'className' ],\n\thasSupport( name ) {\n\t\treturn hasBlockSupport( name, 'customClassName', true );\n\t},\n};\n\n/**\n * Override props assigned to save component to inject the className, if block\n * supports customClassName. This is only applied if the block's save result is an\n * element and not a markup string.\n *\n * @param {Object} extraProps Additional props applied to save element.\n * @param {Object} blockType Block type.\n * @param {Object} attributes Current block attributes.\n *\n * @return {Object} Filtered props applied to save element.\n */\nexport function addSaveProps( extraProps, blockType, attributes ) {\n\tif (\n\t\thasBlockSupport( blockType, 'customClassName', true ) &&\n\t\tattributes.className\n\t) {\n\t\textraProps.className = classnames(\n\t\t\textraProps.className,\n\t\t\tattributes.className\n\t\t);\n\t}\n\n\treturn extraProps;\n}\n\nexport function addTransforms( result, source, index, results ) {\n\tif ( ! hasBlockSupport( result.name, 'customClassName', true ) ) {\n\t\treturn result;\n\t}\n\n\t// If the condition verifies we are probably in the presence of a wrapping transform\n\t// e.g: nesting paragraphs in a group or columns and in that case the class should not be kept.\n\tif ( results.length === 1 && result.innerBlocks.length === source.length ) {\n\t\treturn result;\n\t}\n\n\t// If we are transforming one block to multiple blocks or multiple blocks to one block,\n\t// we ignore the class during the transform.\n\tif (\n\t\t( results.length === 1 && source.length > 1 ) ||\n\t\t( results.length > 1 && source.length === 1 )\n\t) {\n\t\treturn result;\n\t}\n\n\t// If we are in presence of transform between one or more block in the source\n\t// that have one or more blocks in the result\n\t// we apply the class on source N to the result N,\n\t// if source N does not exists we do nothing.\n\tif ( source[ index ] ) {\n\t\tconst originClassName = source[ index ]?.attributes.className;\n\t\tif ( originClassName ) {\n\t\t\treturn {\n\t\t\t\t...result,\n\t\t\t\tattributes: {\n\t\t\t\t\t...result.attributes,\n\t\t\t\t\tclassName: originClassName,\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\t}\n\treturn result;\n}\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/editor/custom-class-name/attribute',\n\taddAttribute\n);\n\naddFilter(\n\t'blocks.switchToBlockType.transformedBlock',\n\t'core/color/addTransforms',\n\taddTransforms\n);\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,SAAS,QAAQ,kBAAkB;AAC5C,SAASC,WAAW,QAAQ,uBAAuB;AACnD,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,eAAe,QAAQ,mBAAmB;;AAEnD;AACA;AACA;AACA,SAASC,iBAAiB,QAAQ,eAAe;AACjD,SAASC,mBAAmB,QAAQ,kCAAkC;;AAEtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,YAAYA,CAAEC,QAAQ,EAAG;EACxC,IAAKJ,eAAe,CAAEI,QAAQ,EAAE,iBAAiB,EAAE,IAAK,CAAC,EAAG;IAC3D;IACAA,QAAQ,CAACC,UAAU,GAAG;MACrB,GAAGD,QAAQ,CAACC,UAAU;MACtBC,SAAS,EAAE;QACVC,IAAI,EAAE;MACP;IACD,CAAC;EACF;EAEA,OAAOH,QAAQ;AAChB;AAEA,SAASI,2BAA2BA,CAAE;EAAEF,SAAS;EAAEG;AAAc,CAAC,EAAG;EACpE,MAAMC,gBAAgB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AAI,EAAE,iBAAiB,EAAE,IAAK,CAAC,EAAG;IAChE,OAAOI,MAAM;EACd;;EAEA;EACA;EACA,IAAKG,OAAO,CAACC,MAAM,KAAK,CAAC,IAAIJ,MAAM,CAACK,WAAW,CAACD,MAAM,KAAKH,MAAM,CAACG,MAAM,EAAG;IAC1E,OAAOJ,MAAM;EACd;;EAEA;EACA;EACA,IACGG,OAAO,CAACC,MAAM,KAAK,CAAC,IAAIH,MAAM,CAACG,MAAM,GAAG,CAAC,IACzCD,OAAO,CAACC,MAAM,GAAG,CAAC,IAAIH,MAAM,CAACG,MAAM,KAAK,CAAG,EAC5C;IACD,OAAOJ,MAAM;EACd;;EAEA;EACA;EACA;EACA;EACA,IAAKC,MAAM,CAAEC,KAAK,CAAE,EAAG;IACtB,MAAMI,eAAe,GAAGL,MAAM,CAAEC,KAAK,CAAE,EAAE3B,UAAU,CAACC,SAAS;IAC7D,IAAK8B,eAAe,EAAG;MACtB,OAAO;QACN,GAAGN,MAAM;QACTzB,UAAU,EAAE;UACX,GAAGyB,MAAM,CAACzB,UAAU;UACpBC,SAAS,EAAE8B;QACZ;MACD,CAAC;IACF;EACD;EACA,OAAON,MAAM;AACd;AAEAjC,SAAS,CACR,0BAA0B,EAC1B,yCAAyC,EACzCM,YACD,CAAC;AAEDN,SAAS,CACR,2CAA2C,EAC3C,0BAA0B,EAC1BgC,aACD,CAAC"}
1
+ {"version":3,"names":["classnames","addFilter","TextControl","__","hasBlockSupport","InspectorControls","useBlockEditingMode","addAttribute","settings","attributes","className","type","CustomClassNameControlsPure","setAttributes","blockEditingMode","createElement","group","__nextHasNoMarginBottom","__next40pxDefaultSize","autoComplete","label","value","onChange","nextValue","undefined","help","edit","addSaveProps","attributeKeys","hasSupport","name","extraProps","blockType","addTransforms","result","source","index","results","length","innerBlocks","originClassName"],"sources":["@wordpress/block-editor/src/hooks/custom-class-name.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { addFilter } from '@wordpress/hooks';\nimport { TextControl } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { hasBlockSupport } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { InspectorControls } from '../components';\nimport { useBlockEditingMode } from '../components/block-editing-mode';\n\n/**\n * Filters registered block settings, extending attributes to include `className`.\n *\n * @param {Object} settings Original block settings.\n *\n * @return {Object} Filtered block settings.\n */\nexport function addAttribute( settings ) {\n\tif ( hasBlockSupport( settings, 'customClassName', true ) ) {\n\t\t// Gracefully handle if settings.attributes is undefined.\n\t\tsettings.attributes = {\n\t\t\t...settings.attributes,\n\t\t\tclassName: {\n\t\t\t\ttype: 'string',\n\t\t\t},\n\t\t};\n\t}\n\n\treturn settings;\n}\n\nfunction CustomClassNameControlsPure( { className, setAttributes } ) {\n\tconst blockEditingMode = useBlockEditingMode();\n\tif ( blockEditingMode !== 'default' ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<InspectorControls group=\"advanced\">\n\t\t\t<TextControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t__next40pxDefaultSize\n\t\t\t\tautoComplete=\"off\"\n\t\t\t\tlabel={ __( 'Additional CSS class(es)' ) }\n\t\t\t\tvalue={ className || '' }\n\t\t\t\tonChange={ ( nextValue ) => {\n\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\tclassName: nextValue !== '' ? nextValue : undefined,\n\t\t\t\t\t} );\n\t\t\t\t} }\n\t\t\t\thelp={ __( 'Separate multiple classes with spaces.' ) }\n\t\t\t/>\n\t\t</InspectorControls>\n\t);\n}\n\nexport default {\n\tedit: CustomClassNameControlsPure,\n\taddSaveProps,\n\tattributeKeys: [ 'className' ],\n\thasSupport( name ) {\n\t\treturn hasBlockSupport( name, 'customClassName', true );\n\t},\n};\n\n/**\n * Override props assigned to save component to inject the className, if block\n * supports customClassName. This is only applied if the block's save result is an\n * element and not a markup string.\n *\n * @param {Object} extraProps Additional props applied to save element.\n * @param {Object} blockType Block type.\n * @param {Object} attributes Current block attributes.\n *\n * @return {Object} Filtered props applied to save element.\n */\nexport function addSaveProps( extraProps, blockType, attributes ) {\n\tif (\n\t\thasBlockSupport( blockType, 'customClassName', true ) &&\n\t\tattributes.className\n\t) {\n\t\textraProps.className = classnames(\n\t\t\textraProps.className,\n\t\t\tattributes.className\n\t\t);\n\t}\n\n\treturn extraProps;\n}\n\nexport function addTransforms( result, source, index, results ) {\n\tif ( ! hasBlockSupport( result.name, 'customClassName', true ) ) {\n\t\treturn result;\n\t}\n\n\t// If the condition verifies we are probably in the presence of a wrapping transform\n\t// e.g: nesting paragraphs in a group or columns and in that case the class should not be kept.\n\tif ( results.length === 1 && result.innerBlocks.length === source.length ) {\n\t\treturn result;\n\t}\n\n\t// If we are transforming one block to multiple blocks or multiple blocks to one block,\n\t// we ignore the class during the transform.\n\tif (\n\t\t( results.length === 1 && source.length > 1 ) ||\n\t\t( results.length > 1 && source.length === 1 )\n\t) {\n\t\treturn result;\n\t}\n\n\t// If we are in presence of transform between one or more block in the source\n\t// that have one or more blocks in the result\n\t// we apply the class on source N to the result N,\n\t// if source N does not exists we do nothing.\n\tif ( source[ index ] ) {\n\t\tconst originClassName = source[ index ]?.attributes.className;\n\t\tif ( originClassName ) {\n\t\t\treturn {\n\t\t\t\t...result,\n\t\t\t\tattributes: {\n\t\t\t\t\t...result.attributes,\n\t\t\t\t\tclassName: originClassName,\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\t}\n\treturn result;\n}\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/editor/custom-class-name/attribute',\n\taddAttribute\n);\n\naddFilter(\n\t'blocks.switchToBlockType.transformedBlock',\n\t'core/color/addTransforms',\n\taddTransforms\n);\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,SAAS,QAAQ,kBAAkB;AAC5C,SAASC,WAAW,QAAQ,uBAAuB;AACnD,SAASC,EAA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D,CAAC;IACF;EACD;EACA,OAAON,MAAM;AACd;AAEAjC,SAAS,CACR,0BAA0B,EAC1B,yCAAyC,EACzCM,YACD,CAAC;AAEDN,SAAS,CACR,2CAA2C,EAC3C,0BAA0B,EAC1BgC,aACD,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["classnames","addFilter","hasBlockSupport","addAttribute","settings","attributes","className","type","addSaveProps","extraProps","blockType","attributeKeys","hasSupport","name"],"sources":["@wordpress/block-editor/src/hooks/custom-class-name.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { addFilter } from '@wordpress/hooks';\nimport { hasBlockSupport } from '@wordpress/blocks';\n\n/**\n * Filters registered block settings, extending attributes to include `className`.\n *\n * @param {Object} settings Original block settings.\n *\n * @return {Object} Filtered block settings.\n */\nexport function addAttribute( settings ) {\n\tif ( hasBlockSupport( settings, 'customClassName', true ) ) {\n\t\t// Gracefully handle if settings.attributes is undefined.\n\t\tsettings.attributes = {\n\t\t\t...settings.attributes,\n\t\t\tclassName: {\n\t\t\t\ttype: 'string',\n\t\t\t},\n\t\t};\n\t}\n\n\treturn settings;\n}\n\n/**\n * Override props assigned to save component to inject the className, if block\n * supports customClassName. This is only applied if the block's save result is an\n * element and not a markup string.\n *\n * @param {Object} extraProps Additional props applied to save element.\n * @param {Object} blockType Block type.\n * @param {Object} attributes Current block attributes.\n *\n * @return {Object} Filtered props applied to save element.\n */\nexport function addSaveProps( extraProps, blockType, attributes ) {\n\tif (\n\t\thasBlockSupport( blockType, 'customClassName', true ) &&\n\t\tattributes.className\n\t) {\n\t\textraProps.className = classnames(\n\t\t\textraProps.className,\n\t\t\tattributes.className\n\t\t);\n\t}\n\n\treturn extraProps;\n}\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/custom-class-name/attribute',\n\taddAttribute\n);\n\nexport default {\n\taddSaveProps,\n\tattributeKeys: [ 'className' ],\n\thasSupport( name ) {\n\t\treturn hasBlockSupport( name, 'customClassName', true );\n\t},\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,SAAS,QAAQ,kBAAkB;AAC5C,SAASC,eAAe,QAAQ,mBAAmB;;AAEnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,YAAYA,CAAEC,QAAQ,EAAG;EACxC,IAAKF,eAAe,CAAEE,QAAQ,EAAE,iBAAiB,EAAE,IAAK,CAAC,EAAG;IAC3D;IACAA,QAAQ,CAACC,UAAU,GAAG;MACrB,GAAGD,QAAQ,CAACC,UAAU;MACtBC,SAAS,EAAE;QACVC,IAAI,EAAE;MACP;IACD,CAAC;EACF;EAEA,OAAOH,QAAQ;AAChB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASI,YAAYA,CAAEC,UAAU,EAAEC,SAAS,EAAEL,UAAU,EAAG;EACjE,IACCH,eAAe,CAAEQ,SAAS,EAAE,iBAAiB,EAAE,IAAK,CAAC,IACrDL,UAAU,CAACC,SAAS,EACnB;IACDG,UAAU,CAACH,SAAS,GAAGN,UAAU,CAChCS,UAAU,CAACH,SAAS,EACpBD,UAAU,CAACC,SACZ,CAAC;EACF;EAEA,OAAOG,UAAU;AAClB;AAEAR,SAAS,CACR,0BAA0B,EAC1B,kCAAkC,EAClCE,YACD,CAAC;AAED,eAAe;EACdK,YAAY;EACZG,aAAa,EAAE,CAAE,WAAW,CAAE;EAC9BC,UAAUA,CAAEC,IAAI,EAAG;IAClB,OAAOX,eAAe,CAAEW,IAAI,EAAE,iBAAiB,EAAE,IAAK,CAAC;EACxD;AACD,CAAC"}
1
+ {"version":3,"names":["classnames","addFilter","hasBlockSupport","addAttribute","settings","attributes","className","type","addSaveProps","extraProps","blockType","attributeKeys","hasSupport","name"],"sources":["@wordpress/block-editor/src/hooks/custom-class-name.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { addFilter } from '@wordpress/hooks';\nimport { hasBlockSupport } from '@wordpress/blocks';\n\n/**\n * Filters registered block settings, extending attributes to include `className`.\n *\n * @param {Object} settings Original block settings.\n *\n * @return {Object} Filtered block settings.\n */\nexport function addAttribute( settings ) {\n\tif ( hasBlockSupport( settings, 'customClassName', true ) ) {\n\t\t// Gracefully handle if settings.attributes is undefined.\n\t\tsettings.attributes = {\n\t\t\t...settings.attributes,\n\t\t\tclassName: {\n\t\t\t\ttype: 'string',\n\t\t\t},\n\t\t};\n\t}\n\n\treturn settings;\n}\n\n/**\n * Override props assigned to save component to inject the className, if block\n * supports customClassName. This is only applied if the block's save result is an\n * element and not a markup string.\n *\n * @param {Object} extraProps Additional props applied to save element.\n * @param {Object} blockType Block type.\n * @param {Object} attributes Current block attributes.\n *\n * @return {Object} Filtered props applied to save element.\n */\nexport function addSaveProps( extraProps, blockType, attributes ) {\n\tif (\n\t\thasBlockSupport( blockType, 'customClassName', true ) &&\n\t\tattributes.className\n\t) {\n\t\textraProps.className = classnames(\n\t\t\textraProps.className,\n\t\t\tattributes.className\n\t\t);\n\t}\n\n\treturn extraProps;\n}\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/custom-class-name/attribute',\n\taddAttribute\n);\n\nexport default {\n\taddSaveProps,\n\tattributeKeys: [ 'className' ],\n\thasSupport( name ) {\n\t\treturn hasBlockSupport( name, 'customClassName', true );\n\t},\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,SAAS,QAAQ,kBAAkB;AAC5C,SAASC,eAAe,QAAQ,mBAAmB;;AAEnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,YAAYA,CAAEC,QAAQ,EAAG;EACxC,IAAKF,eAAe,CAAEE,QAAQ,EAAE,iBAAiB,EAAE,IAAK,CAAC,EAAG;IAC3D;IACAA,QAAQ,CAACC,UAAU,GAAG;MACrB,GAAGD,QAAQ,CAACC,UAAU;MACtBC,SAAS,EAAE;QACVC,IAAI,EAAE;MACP;IACD,CAAC;EACF;EAEA,OAAOH,QAAQ;AAChB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASI,YAAYA,CAAEC,UAAU,EAAEC,SAAS,EAAEL,UAAU,EAAG;EACjE,IACCH,eAAe,CAAEQ,SAAS,EAAE,iBAAiB,EAAE,IAAK,CAAC,IACrDL,UAAU,CAACC,SAAS,EACnB;IACDG,UAAU,CAACH,SAAS,GAAGN,UAAU,CAChCS,UAAU,CAACH,SAAS,EACpBD,UAAU,CAACC,SACZ,CAAC;EACF;EAEA,OAAOG,UAAU;AAClB;AAEAR,SAAS,CACR,0BAA0B,EAC1B,kCAAkC,EAClCE,YACD,CAAC;AAED,eAAe;EACdK,YAAY;EACZG,aAAa,EAAE,CAAE,WAAW,CAAE;EAC9BC,UAAUA,CAAEC,IAAI,EAAG;IAClB,OAAOX,eAAe,CAAEW,IAAI,EAAE,iBAAiB,EAAE,IAAK,CAAC;EACxD;AACD,CAAC","ignoreList":[]}