@wordpress/block-editor 12.23.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 (1403) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/README.md +4 -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 +44 -26
  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.map +1 -1
  105. package/build/components/block-mover/index.js.map +1 -1
  106. package/build/components/block-mover/index.native.js.map +1 -1
  107. package/build/components/block-mover/mover-description.js.map +1 -1
  108. package/build/components/block-mover/mover-description.native.js.map +1 -1
  109. package/build/components/block-navigation/dropdown.js.map +1 -1
  110. package/build/components/block-parent-selector/index.js.map +1 -1
  111. package/build/components/block-pattern-setup/constants.js.map +1 -1
  112. package/build/components/block-pattern-setup/index.js.map +1 -1
  113. package/build/components/block-pattern-setup/setup-toolbar.js.map +1 -1
  114. package/build/components/block-pattern-setup/use-patterns-setup.js.map +1 -1
  115. package/build/components/block-patterns-list/index.js.map +1 -1
  116. package/build/components/block-patterns-paging/index.js +8 -4
  117. package/build/components/block-patterns-paging/index.js.map +1 -1
  118. package/build/components/block-popover/cover.js.map +1 -1
  119. package/build/components/block-popover/drop-zone.js.map +1 -1
  120. package/build/components/block-popover/inbetween.js.map +1 -1
  121. package/build/components/block-popover/index.js.map +1 -1
  122. package/build/components/block-popover/use-popover-scroll.js.map +1 -1
  123. package/build/components/block-preview/auto.js.map +1 -1
  124. package/build/components/block-preview/index.js.map +1 -1
  125. package/build/components/block-quick-navigation/index.js.map +1 -1
  126. package/build/components/block-removal-warning-modal/index.js.map +1 -1
  127. package/build/components/block-rename/index.js.map +1 -1
  128. package/build/components/block-rename/is-empty-string.js.map +1 -1
  129. package/build/components/block-rename/modal.js +13 -9
  130. package/build/components/block-rename/modal.js.map +1 -1
  131. package/build/components/block-rename/rename-control.js +3 -1
  132. package/build/components/block-rename/rename-control.js.map +1 -1
  133. package/build/components/block-rename/use-block-rename.js.map +1 -1
  134. package/build/components/block-selection-clearer/index.js.map +1 -1
  135. package/build/components/block-settings/button.native.js.map +1 -1
  136. package/build/components/block-settings/container.native.js.map +1 -1
  137. package/build/components/block-settings/index.native.js +1 -1
  138. package/build/components/block-settings/index.native.js.map +1 -1
  139. package/build/components/block-settings-menu/block-html-convert-button.js.map +1 -1
  140. package/build/components/block-settings-menu/block-mode-toggle.js.map +1 -1
  141. package/build/components/block-settings-menu/block-parent-selector-menu-item.js.map +1 -1
  142. package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  143. package/build/components/block-settings-menu/block-settings-menu-first-item.js.map +1 -1
  144. package/build/components/block-settings-menu/index.js.map +1 -1
  145. package/build/components/block-settings-menu-controls/index.js.map +1 -1
  146. package/build/components/block-styles/index.js.map +1 -1
  147. package/build/components/block-styles/index.native.js.map +1 -1
  148. package/build/components/block-styles/menu-items.js.map +1 -1
  149. package/build/components/block-styles/preview-panel.js.map +1 -1
  150. package/build/components/block-styles/preview.native.js.map +1 -1
  151. package/build/components/block-styles/use-styles-for-block.js.map +1 -1
  152. package/build/components/block-styles/utils.js.map +1 -1
  153. package/build/components/block-switcher/block-styles-menu.js.map +1 -1
  154. package/build/components/block-switcher/block-transformations-menu.js.map +1 -1
  155. package/build/components/block-switcher/block-transformations-menu.native.js.map +1 -1
  156. package/build/components/block-switcher/block-variation-transformations.js.map +1 -1
  157. package/build/components/block-switcher/index.js.map +1 -1
  158. package/build/components/block-switcher/pattern-transformations-menu.js.map +1 -1
  159. package/build/components/block-switcher/preview-block-popover.js.map +1 -1
  160. package/build/components/block-switcher/use-transformed-patterns.js.map +1 -1
  161. package/build/components/block-switcher/utils.js.map +1 -1
  162. package/build/components/block-title/index.js.map +1 -1
  163. package/build/components/block-title/use-block-display-title.js.map +1 -1
  164. package/build/components/block-toolbar/block-name-context.js.map +1 -1
  165. package/build/components/block-toolbar/block-toolbar-last-item.js.map +1 -1
  166. package/build/components/block-toolbar/block-toolbar-menu.native.js.map +1 -1
  167. package/build/components/block-toolbar/index.js +1 -1
  168. package/build/components/block-toolbar/index.js.map +1 -1
  169. package/build/components/block-toolbar/index.native.js.map +1 -1
  170. package/build/components/block-toolbar/shuffle.js.map +1 -1
  171. package/build/components/block-toolbar/use-has-block-toolbar.js +6 -3
  172. package/build/components/block-toolbar/use-has-block-toolbar.js.map +1 -1
  173. package/build/components/block-toolbar/utils.js.map +1 -1
  174. package/build/components/block-tools/block-selection-button.js +16 -12
  175. package/build/components/block-tools/block-selection-button.js.map +1 -1
  176. package/build/components/block-tools/block-toolbar-breadcrumb.js.map +1 -1
  177. package/build/components/block-tools/block-toolbar-popover.js.map +1 -1
  178. package/build/components/block-tools/empty-block-inserter.js.map +1 -1
  179. package/build/components/block-tools/index.js +1 -1
  180. package/build/components/block-tools/index.js.map +1 -1
  181. package/build/components/block-tools/insertion-point.js.map +1 -1
  182. package/build/components/block-tools/use-block-toolbar-popover-props.js.map +1 -1
  183. package/build/components/block-tools/use-selected-block-tool-props.js.map +1 -1
  184. package/build/components/block-tools/use-show-block-tools.js +7 -13
  185. package/build/components/block-tools/use-show-block-tools.js.map +1 -1
  186. package/build/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
  187. package/build/components/block-types-list/index.js.map +1 -1
  188. package/build/components/block-types-list/index.native.js.map +1 -1
  189. package/build/components/block-variation-picker/index.js.map +1 -1
  190. package/build/components/block-variation-picker/index.native.js.map +1 -1
  191. package/build/components/block-variation-transforms/index.js +4 -1
  192. package/build/components/block-variation-transforms/index.js.map +1 -1
  193. package/build/components/block-vertical-alignment-control/icons.js.map +1 -1
  194. package/build/components/block-vertical-alignment-control/index.js.map +1 -1
  195. package/build/components/block-vertical-alignment-control/ui.js.map +1 -1
  196. package/build/components/border-radius-control/all-input-control.js.map +1 -1
  197. package/build/components/border-radius-control/index.js.map +1 -1
  198. package/build/components/border-radius-control/input-controls.js.map +1 -1
  199. package/build/components/border-radius-control/linked-button.js.map +1 -1
  200. package/build/components/border-radius-control/utils.js.map +1 -1
  201. package/build/components/button-block-appender/index.js.map +1 -1
  202. package/build/components/button-block-appender/index.native.js +11 -1
  203. package/build/components/button-block-appender/index.native.js.map +1 -1
  204. package/build/components/caption/index.native.js.map +1 -1
  205. package/build/components/child-layout-control/index.js.map +1 -1
  206. package/build/components/color-palette/control.js.map +1 -1
  207. package/build/components/color-palette/index.js.map +1 -1
  208. package/build/components/color-palette/with-color-context.js.map +1 -1
  209. package/build/components/color-style-selector/index.js.map +1 -1
  210. package/build/components/colors/index.js +1 -1
  211. package/build/components/colors/index.js.map +1 -1
  212. package/build/components/colors/utils.js.map +1 -1
  213. package/build/components/colors/with-colors.js.map +1 -1
  214. package/build/components/colors-gradients/control.js.map +1 -1
  215. package/build/components/colors-gradients/dropdown.js.map +1 -1
  216. package/build/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
  217. package/build/components/colors-gradients/panel-color-gradient-settings.native.js.map +1 -1
  218. package/build/components/colors-gradients/use-multiple-origin-colors-and-gradients.js.map +1 -1
  219. package/build/components/contrast-checker/index.js.map +1 -1
  220. package/build/components/contrast-checker/index.native.js.map +1 -1
  221. package/build/components/convert-to-group-buttons/index.js.map +1 -1
  222. package/build/components/convert-to-group-buttons/index.native.js.map +1 -1
  223. package/build/components/convert-to-group-buttons/toolbar.js.map +1 -1
  224. package/build/components/convert-to-group-buttons/use-convert-to-group-button-props.js.map +1 -1
  225. package/build/components/copy-handler/index.js.map +1 -1
  226. package/build/components/date-format-picker/index.js.map +1 -1
  227. package/build/components/default-block-appender/index.js.map +1 -1
  228. package/build/components/default-block-appender/index.native.js.map +1 -1
  229. package/build/components/dimensions-tool/aspect-ratio-tool.js.map +1 -1
  230. package/build/components/dimensions-tool/index.js.map +1 -1
  231. package/build/components/dimensions-tool/scale-tool.js.map +1 -1
  232. package/build/components/dimensions-tool/width-height-tool.js +6 -2
  233. package/build/components/dimensions-tool/width-height-tool.js.map +1 -1
  234. package/build/components/duotone/utils.js.map +1 -1
  235. package/build/components/duotone-control/index.js.map +1 -1
  236. package/build/components/editable-text/index.js.map +1 -1
  237. package/build/components/editor-styles/index.js +2 -1
  238. package/build/components/editor-styles/index.js.map +1 -1
  239. package/build/components/floating-toolbar/index.native.js.map +1 -1
  240. package/build/components/floating-toolbar/nav-up-icon.js.map +1 -1
  241. package/build/components/font-appearance-control/index.js.map +1 -1
  242. package/build/components/font-family/index.js.map +1 -1
  243. package/build/components/font-sizes/fluid-utils.js.map +1 -1
  244. package/build/components/font-sizes/font-size-picker.js.map +1 -1
  245. package/build/components/font-sizes/index.js.map +1 -1
  246. package/build/components/font-sizes/index.native.js.map +1 -1
  247. package/build/components/font-sizes/utils.js.map +1 -1
  248. package/build/components/font-sizes/with-font-sizes.js.map +1 -1
  249. package/build/components/global-styles/advanced-panel.js.map +1 -1
  250. package/build/components/global-styles/background-panel.js +19 -16
  251. package/build/components/global-styles/background-panel.js.map +1 -1
  252. package/build/components/global-styles/border-panel.js.map +1 -1
  253. package/build/components/global-styles/color-panel.js.map +1 -1
  254. package/build/components/global-styles/color-panel.native.js.map +1 -1
  255. package/build/components/global-styles/context.js.map +1 -1
  256. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  257. package/build/components/global-styles/filters-panel.js.map +1 -1
  258. package/build/components/global-styles/get-block-css-selector.js.map +1 -1
  259. package/build/components/global-styles/get-global-styles-changes.js.map +1 -1
  260. package/build/components/global-styles/hooks.js.map +1 -1
  261. package/build/components/global-styles/image-settings-panel.js.map +1 -1
  262. package/build/components/global-styles/index.js +1 -1
  263. package/build/components/global-styles/index.js.map +1 -1
  264. package/build/components/global-styles/shadow-panel-components.js.map +1 -1
  265. package/build/components/global-styles/typography-panel.js.map +1 -1
  266. package/build/components/global-styles/typography-utils.js.map +1 -1
  267. package/build/components/global-styles/use-global-styles-output.js +4 -4
  268. package/build/components/global-styles/use-global-styles-output.js.map +1 -1
  269. package/build/components/global-styles/utils.js.map +1 -1
  270. package/build/components/gradients/index.js.map +1 -1
  271. package/build/components/gradients/index.native.js.map +1 -1
  272. package/build/components/gradients/use-gradient.js.map +1 -1
  273. package/build/components/gradients/with-gradient.js.map +1 -1
  274. package/build/components/grid-visualizer/grid-item-resizer.js.map +1 -1
  275. package/build/components/grid-visualizer/grid-visualizer.js.map +1 -1
  276. package/build/components/grid-visualizer/index.js.map +1 -1
  277. package/build/components/grid-visualizer/utils.js.map +1 -1
  278. package/build/components/height-control/index.js.map +1 -1
  279. package/build/components/iframe/get-compatibility-styles.js.map +1 -1
  280. package/build/components/iframe/index.js +12 -13
  281. package/build/components/iframe/index.js.map +1 -1
  282. package/build/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
  283. package/build/components/image-editor/constants.js.map +1 -1
  284. package/build/components/image-editor/context.js.map +1 -1
  285. package/build/components/image-editor/cropper.js +6 -2
  286. package/build/components/image-editor/cropper.js.map +1 -1
  287. package/build/components/image-editor/form-controls.js.map +1 -1
  288. package/build/components/image-editor/index.js +0 -2
  289. package/build/components/image-editor/index.js.map +1 -1
  290. package/build/components/image-editor/rotation-button.js.map +1 -1
  291. package/build/components/image-editor/use-save-image.js.map +1 -1
  292. package/build/components/image-editor/use-transform-image.js.map +1 -1
  293. package/build/components/image-editor/zoom-dropdown.js.map +1 -1
  294. package/build/components/image-link-destinations/index.native.js.map +1 -1
  295. package/build/components/image-size-control/index.js.map +1 -1
  296. package/build/components/image-size-control/use-dimension-handler.js.map +1 -1
  297. package/build/components/index.js +1 -1
  298. package/build/components/index.js.map +1 -1
  299. package/build/components/index.native.js +1 -1
  300. package/build/components/index.native.js.map +1 -1
  301. package/build/components/inner-blocks/button-block-appender.js.map +1 -1
  302. package/build/components/inner-blocks/constants.native.js.map +1 -1
  303. package/build/components/inner-blocks/default-block-appender.js.map +1 -1
  304. package/build/components/inner-blocks/index.js.map +1 -1
  305. package/build/components/inner-blocks/index.native.js.map +1 -1
  306. package/build/components/inner-blocks/use-block-context.js.map +1 -1
  307. package/build/components/inner-blocks/use-inner-block-template-sync.js.map +1 -1
  308. package/build/components/inner-blocks/use-nested-settings-update.js.map +1 -1
  309. package/build/components/inner-blocks/warning-max-depth-exceeded.native.js.map +1 -1
  310. package/build/components/inner-blocks/with-client-id.js.map +1 -1
  311. package/build/components/inserter/block-patterns-explorer/index.js.map +1 -1
  312. package/build/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js.map +1 -1
  313. package/build/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
  314. package/build/components/inserter/block-patterns-tab/index.js +31 -18
  315. package/build/components/inserter/block-patterns-tab/index.js.map +1 -1
  316. package/build/components/inserter/block-patterns-tab/pattern-category-preview-panel.js +2 -24
  317. package/build/components/inserter/block-patterns-tab/pattern-category-preview-panel.js.map +1 -1
  318. package/build/components/inserter/block-patterns-tab/pattern-category-previews.js +1 -3
  319. package/build/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
  320. package/build/components/inserter/block-patterns-tab/patterns-filter.js.map +1 -1
  321. package/build/components/inserter/block-patterns-tab/use-pattern-categories.js.map +1 -1
  322. package/build/components/inserter/block-patterns-tab/utils.js.map +1 -1
  323. package/build/components/inserter/block-types-tab.js.map +1 -1
  324. package/build/components/inserter/block-types-tab.native.js.map +1 -1
  325. package/build/components/inserter/hooks/use-block-type-impressions.native.js.map +1 -1
  326. package/build/components/inserter/hooks/use-block-types-state.js.map +1 -1
  327. package/build/components/inserter/hooks/use-clipboard-block.native.js.map +1 -1
  328. package/build/components/inserter/hooks/use-insertion-point.js.map +1 -1
  329. package/build/components/inserter/hooks/use-patterns-paging.js.map +1 -1
  330. package/build/components/inserter/hooks/use-patterns-state.js.map +1 -1
  331. package/build/components/inserter/index.js.map +1 -1
  332. package/build/components/inserter/index.native.js.map +1 -1
  333. package/build/components/inserter/library.js.map +1 -1
  334. package/build/components/inserter/media-tab/hooks.js.map +1 -1
  335. package/build/components/inserter/media-tab/index.js.map +1 -1
  336. package/build/components/inserter/media-tab/media-list.js.map +1 -1
  337. package/build/components/inserter/media-tab/media-panel.js.map +1 -1
  338. package/build/components/inserter/media-tab/media-preview.js.map +1 -1
  339. package/build/components/inserter/media-tab/media-tab.js.map +1 -1
  340. package/build/components/inserter/media-tab/utils.js.map +1 -1
  341. package/build/components/inserter/menu.js +17 -11
  342. package/build/components/inserter/menu.js.map +1 -1
  343. package/build/components/inserter/menu.native.js.map +1 -1
  344. package/build/components/inserter/mobile-tab-navigation.js.map +1 -1
  345. package/build/components/inserter/no-results.js.map +1 -1
  346. package/build/components/inserter/no-results.native.js.map +1 -1
  347. package/build/components/inserter/panel.js.map +1 -1
  348. package/build/components/inserter/preview-panel.js.map +1 -1
  349. package/build/components/inserter/quick-inserter.js.map +1 -1
  350. package/build/components/inserter/reusable-block-rename-hint.js.map +1 -1
  351. package/build/components/inserter/reusable-blocks-tab.native.js.map +1 -1
  352. package/build/components/inserter/search-items.js.map +1 -1
  353. package/build/components/inserter/search-results.js.map +1 -1
  354. package/build/components/inserter/search-results.native.js.map +1 -1
  355. package/build/components/inserter/tabs.js +7 -3
  356. package/build/components/inserter/tabs.js.map +1 -1
  357. package/build/components/inserter/tabs.native.js.map +1 -1
  358. package/build/components/inserter/tips.js.map +1 -1
  359. package/build/components/inserter/utils.native.js.map +1 -1
  360. package/build/components/inserter-button/index.native.js.map +1 -1
  361. package/build/components/inserter-button/sparkles.js.map +1 -1
  362. package/build/components/inserter-draggable-blocks/index.js.map +1 -1
  363. package/build/components/inserter-list-item/index.js.map +1 -1
  364. package/build/components/inserter-listbox/context.js.map +1 -1
  365. package/build/components/inserter-listbox/group.js.map +1 -1
  366. package/build/components/inserter-listbox/index.js.map +1 -1
  367. package/build/components/inserter-listbox/item.js.map +1 -1
  368. package/build/components/inserter-listbox/row.js.map +1 -1
  369. package/build/components/inserter-menu-extension/index.js.map +1 -1
  370. package/build/components/inspector-controls/block-support-slot-container.js.map +1 -1
  371. package/build/components/inspector-controls/block-support-tools-panel.js.map +1 -1
  372. package/build/components/inspector-controls/fill.js.map +1 -1
  373. package/build/components/inspector-controls/fill.native.js.map +1 -1
  374. package/build/components/inspector-controls/groups.js.map +1 -1
  375. package/build/components/inspector-controls/index.js.map +1 -1
  376. package/build/components/inspector-controls/slot.js.map +1 -1
  377. package/build/components/inspector-controls/slot.native.js.map +1 -1
  378. package/build/components/inspector-controls-tabs/advanced-controls-panel.js +1 -1
  379. package/build/components/inspector-controls-tabs/advanced-controls-panel.js.map +1 -1
  380. package/build/components/inspector-controls-tabs/advanced-controls-panel.native.js.map +1 -1
  381. package/build/components/inspector-controls-tabs/index.js.map +1 -1
  382. package/build/components/inspector-controls-tabs/position-controls-panel.js.map +1 -1
  383. package/build/components/inspector-controls-tabs/settings-tab-hint.js.map +1 -1
  384. package/build/components/inspector-controls-tabs/settings-tab.js.map +1 -1
  385. package/build/components/inspector-controls-tabs/styles-tab.js +1 -1
  386. package/build/components/inspector-controls-tabs/styles-tab.js.map +1 -1
  387. package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +1 -1
  388. package/build/components/inspector-controls-tabs/use-is-list-view-tab-disabled.js.map +1 -1
  389. package/build/components/inspector-controls-tabs/utils.js.map +1 -1
  390. package/build/components/inspector-popover-header/index.js.map +1 -1
  391. package/build/components/justify-content-control/index.js.map +1 -1
  392. package/build/components/justify-content-control/ui.js.map +1 -1
  393. package/build/components/keyboard-shortcuts/index.js.map +1 -1
  394. package/build/components/letter-spacing-control/index.js.map +1 -1
  395. package/build/components/line-height-control/index.js.map +1 -1
  396. package/build/components/line-height-control/index.native.js.map +1 -1
  397. package/build/components/line-height-control/utils.js.map +1 -1
  398. package/build/components/link-control/constants.js.map +1 -1
  399. package/build/components/link-control/index.js.map +1 -1
  400. package/build/components/link-control/is-url-like.js.map +1 -1
  401. package/build/components/link-control/link-preview.js.map +1 -1
  402. package/build/components/link-control/search-create-button.js.map +1 -1
  403. package/build/components/link-control/search-input.js.map +1 -1
  404. package/build/components/link-control/search-item.js.map +1 -1
  405. package/build/components/link-control/search-results.js.map +1 -1
  406. package/build/components/link-control/settings-drawer.js.map +1 -1
  407. package/build/components/link-control/settings.js.map +1 -1
  408. package/build/components/link-control/use-create-page.js.map +1 -1
  409. package/build/components/link-control/use-internal-value.js.map +1 -1
  410. package/build/components/link-control/use-rich-url-data.js.map +1 -1
  411. package/build/components/link-control/use-search-handler.js.map +1 -1
  412. package/build/components/link-control/viewer-slot.js.map +1 -1
  413. package/build/components/list-view/appender.js.map +1 -1
  414. package/build/components/list-view/aria-referenced-text.js.map +1 -1
  415. package/build/components/list-view/block-contents.js.map +1 -1
  416. package/build/components/list-view/block-select-button.js +29 -1
  417. package/build/components/list-view/block-select-button.js.map +1 -1
  418. package/build/components/list-view/block.js.map +1 -1
  419. package/build/components/list-view/branch.js.map +1 -1
  420. package/build/components/list-view/context.js.map +1 -1
  421. package/build/components/list-view/drop-indicator.js.map +1 -1
  422. package/build/components/list-view/expander.js.map +1 -1
  423. package/build/components/list-view/index.js.map +1 -1
  424. package/build/components/list-view/leaf.js.map +1 -1
  425. package/build/components/list-view/use-block-selection.js.map +1 -1
  426. package/build/components/list-view/use-clipboard-handler.js.map +1 -1
  427. package/build/components/list-view/use-list-view-block-indexes.js.map +1 -1
  428. package/build/components/list-view/use-list-view-client-ids.js.map +1 -1
  429. package/build/components/list-view/use-list-view-collapse-items.js.map +1 -1
  430. package/build/components/list-view/use-list-view-drop-zone.js +5 -0
  431. package/build/components/list-view/use-list-view-drop-zone.js.map +1 -1
  432. package/build/components/list-view/use-list-view-expand-selected-item.js.map +1 -1
  433. package/build/components/list-view/use-list-view-images.js.map +1 -1
  434. package/build/components/list-view/use-list-view-scroll-into-view.js.map +1 -1
  435. package/build/components/list-view/utils.js.map +1 -1
  436. package/build/components/media-placeholder/index.js.map +1 -1
  437. package/build/components/media-placeholder/index.native.js.map +1 -1
  438. package/build/components/media-replace-flow/index.js.map +1 -1
  439. package/build/components/media-replace-flow/index.native.js.map +1 -1
  440. package/build/components/media-upload/check.js.map +1 -1
  441. package/build/components/media-upload/constants.native.js.map +1 -1
  442. package/build/components/media-upload/index.js.map +1 -1
  443. package/build/components/media-upload/index.native.js.map +1 -1
  444. package/build/components/media-upload-progress/constants.js.map +1 -1
  445. package/build/components/media-upload-progress/index.native.js.map +1 -1
  446. package/build/components/multi-selection-inspector/index.js.map +1 -1
  447. package/build/components/navigable-toolbar/index.js.map +1 -1
  448. package/build/components/observe-typing/index.js.map +1 -1
  449. package/build/components/panel-color-settings/index.js.map +1 -1
  450. package/build/components/plain-text/index.js.map +1 -1
  451. package/build/components/plain-text/index.native.js.map +1 -1
  452. package/build/components/preview-options/index.js.map +1 -1
  453. package/build/components/provider/block-refs-provider.js.map +1 -1
  454. package/build/components/provider/index.js.map +1 -1
  455. package/build/components/provider/index.native.js.map +1 -1
  456. package/build/components/provider/use-block-sync.js.map +1 -1
  457. package/build/components/provider/with-registry-provider.js.map +1 -1
  458. package/build/components/publish-date-time-picker/index.js.map +1 -1
  459. package/build/components/recursion-provider/index.js +2 -2
  460. package/build/components/recursion-provider/index.js.map +1 -1
  461. package/build/components/resizable-box-popover/index.js.map +1 -1
  462. package/build/components/resolution-tool/index.js.map +1 -1
  463. package/build/components/responsive-block-control/index.js.map +1 -1
  464. package/build/components/responsive-block-control/label.js.map +1 -1
  465. package/build/components/rich-text/content.js +26 -19
  466. package/build/components/rich-text/content.js.map +1 -1
  467. package/build/components/rich-text/embed-handler-picker.native.js.map +1 -1
  468. package/build/components/rich-text/file-paste-handler.native.js.map +1 -1
  469. package/build/components/rich-text/format-edit.js.map +1 -1
  470. package/build/components/rich-text/format-toolbar/index.js.map +1 -1
  471. package/build/components/rich-text/format-toolbar/index.native.js.map +1 -1
  472. package/build/components/rich-text/format-toolbar-container.js.map +1 -1
  473. package/build/components/rich-text/format-toolbar-container.native.js.map +1 -1
  474. package/build/components/rich-text/get-rich-text-values.js.map +1 -1
  475. package/build/components/rich-text/index.js +40 -0
  476. package/build/components/rich-text/index.js.map +1 -1
  477. package/build/components/rich-text/index.native.js +3 -1
  478. package/build/components/rich-text/index.native.js.map +1 -1
  479. package/build/components/rich-text/input-event.js.map +1 -1
  480. package/build/components/rich-text/input-event.native.js.map +1 -1
  481. package/build/components/rich-text/multiline.js.map +1 -1
  482. package/build/components/rich-text/native/format-edit.js.map +1 -1
  483. package/build/components/rich-text/native/get-format-colors.native.js.map +1 -1
  484. package/build/components/rich-text/native/index.js.map +1 -1
  485. package/build/components/rich-text/native/index.native.js.map +1 -1
  486. package/build/components/rich-text/native/toolbar-button-with-options.native.js.map +1 -1
  487. package/build/components/rich-text/native/use-format-types.js.map +1 -1
  488. package/build/components/rich-text/prevent-event-discovery.js.map +1 -1
  489. package/build/components/rich-text/remove-browser-shortcuts.native.js.map +1 -1
  490. package/build/components/rich-text/shortcut.js.map +1 -1
  491. package/build/components/rich-text/shortcut.native.js.map +1 -1
  492. package/build/components/rich-text/split-value.js.map +1 -1
  493. package/build/components/rich-text/toolbar-button.js.map +1 -1
  494. package/build/components/rich-text/use-before-input-rules.js.map +1 -1
  495. package/build/components/rich-text/use-delete.js.map +1 -1
  496. package/build/components/rich-text/use-enter.js.map +1 -1
  497. package/build/components/rich-text/use-firefox-compat.js.map +1 -1
  498. package/build/components/rich-text/use-format-types.js.map +1 -1
  499. package/build/components/rich-text/use-input-events.js.map +1 -1
  500. package/build/components/rich-text/use-input-rules.js.map +1 -1
  501. package/build/components/rich-text/use-insert-replacement-text.js.map +1 -1
  502. package/build/components/rich-text/use-mark-persistent.js.map +1 -1
  503. package/build/components/rich-text/use-paste-handler.js.map +1 -1
  504. package/build/components/rich-text/use-remove-browser-shortcuts.js.map +1 -1
  505. package/build/components/rich-text/use-shortcuts.js.map +1 -1
  506. package/build/components/rich-text/use-undo-automatic-change.js +1 -1
  507. package/build/components/rich-text/use-undo-automatic-change.js.map +1 -1
  508. package/build/components/rich-text/utils.js.map +1 -1
  509. package/build/components/rich-text/with-deprecations.js.map +1 -1
  510. package/build/components/selection-scroll-into-view/index.js.map +1 -1
  511. package/build/components/skip-to-selected-block/index.js.map +1 -1
  512. package/build/components/spacing-sizes-control/hooks/use-spacing-sizes.js.map +1 -1
  513. package/build/components/spacing-sizes-control/index.js.map +1 -1
  514. package/build/components/spacing-sizes-control/input-controls/axial.js.map +1 -1
  515. package/build/components/spacing-sizes-control/input-controls/separated.js.map +1 -1
  516. package/build/components/spacing-sizes-control/input-controls/single.js.map +1 -1
  517. package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
  518. package/build/components/spacing-sizes-control/sides-dropdown/index.js.map +1 -1
  519. package/build/components/spacing-sizes-control/utils.js.map +1 -1
  520. package/build/components/text-decoration-control/index.js.map +1 -1
  521. package/build/components/text-transform-control/index.js.map +1 -1
  522. package/build/components/tool-selector/index.js.map +1 -1
  523. package/build/components/typewriter/index.js.map +1 -1
  524. package/build/components/ungroup-button/index.native.js.map +1 -1
  525. package/build/components/unit-control/index.js.map +1 -1
  526. package/build/components/unsupported-block-details/index.native.js.map +1 -1
  527. package/build/components/url-input/button.js.map +1 -1
  528. package/build/components/url-input/index.js.map +1 -1
  529. package/build/components/url-input/index.native.js.map +1 -1
  530. package/build/components/url-popover/image-url-input-ui.js.map +1 -1
  531. package/build/components/url-popover/index.js.map +1 -1
  532. package/build/components/url-popover/link-editor.js.map +1 -1
  533. package/build/components/url-popover/link-viewer-url.js.map +1 -1
  534. package/build/components/url-popover/link-viewer.js.map +1 -1
  535. package/build/components/use-block-commands/index.js +20 -2
  536. package/build/components/use-block-commands/index.js.map +1 -1
  537. package/build/components/use-block-display-information/index.js.map +1 -1
  538. package/build/components/use-block-drop-zone/index.js.map +1 -1
  539. package/build/components/use-block-drop-zone/index.native.js.map +1 -1
  540. package/build/components/use-flash-editable-blocks/index.js.map +1 -1
  541. package/build/components/use-moving-animation/index.js.map +1 -1
  542. package/build/components/use-on-block-drop/index.js.map +1 -1
  543. package/build/components/use-on-block-drop/index.native.js.map +1 -1
  544. package/build/components/use-on-block-drop/types.js.map +1 -1
  545. package/build/components/use-paste-styles/index.js +1 -0
  546. package/build/components/use-paste-styles/index.js.map +1 -1
  547. package/build/components/use-resize-canvas/index.js.map +1 -1
  548. package/build/components/use-settings/index.js.map +1 -1
  549. package/build/components/use-unsupported-block-editor/index.native.js.map +1 -1
  550. package/build/components/video-player/gridicon-play.native.js.map +1 -1
  551. package/build/components/video-player/index.native.js.map +1 -1
  552. package/build/components/warning/index.js.map +1 -1
  553. package/build/components/warning/index.native.js.map +1 -1
  554. package/build/components/writing-flow/index.js.map +1 -1
  555. package/build/components/writing-flow/use-arrow-nav.js.map +1 -1
  556. package/build/components/writing-flow/use-click-selection.js.map +1 -1
  557. package/build/components/writing-flow/use-clipboard-handler.js.map +1 -1
  558. package/build/components/writing-flow/use-drag-selection.js.map +1 -1
  559. package/build/components/writing-flow/use-input.js.map +1 -1
  560. package/build/components/writing-flow/use-multi-selection.js.map +1 -1
  561. package/build/components/writing-flow/use-select-all.js.map +1 -1
  562. package/build/components/writing-flow/use-selection-observer.js.map +1 -1
  563. package/build/components/writing-flow/use-tab-nav.js.map +1 -1
  564. package/build/components/writing-flow/utils.js.map +1 -1
  565. package/build/components/writing-mode-control/index.js.map +1 -1
  566. package/build/elements/index.js.map +1 -1
  567. package/build/hooks/align.js.map +1 -1
  568. package/build/hooks/align.native.js +1 -1
  569. package/build/hooks/align.native.js.map +1 -1
  570. package/build/hooks/anchor.js.map +1 -1
  571. package/build/hooks/aria-label.js.map +1 -1
  572. package/build/hooks/background.js +3 -3
  573. package/build/hooks/background.js.map +1 -1
  574. package/build/hooks/block-hooks.js.map +1 -1
  575. package/build/hooks/block-renaming.js +0 -37
  576. package/build/hooks/block-renaming.js.map +1 -1
  577. package/build/hooks/border.js.map +1 -1
  578. package/build/hooks/color.js +1 -1
  579. package/build/hooks/color.js.map +1 -1
  580. package/build/hooks/compat.js.map +1 -1
  581. package/build/hooks/content-lock-ui.js +5 -5
  582. package/build/hooks/content-lock-ui.js.map +1 -1
  583. package/build/hooks/contrast-checker.js.map +1 -1
  584. package/build/hooks/custom-class-name.js.map +1 -1
  585. package/build/hooks/custom-class-name.native.js.map +1 -1
  586. package/build/hooks/dimensions.js.map +1 -1
  587. package/build/hooks/duotone.js.map +1 -1
  588. package/build/hooks/font-family.js.map +1 -1
  589. package/build/hooks/font-size.js.map +1 -1
  590. package/build/hooks/gap.js.map +1 -1
  591. package/build/hooks/generated-class-name.js.map +1 -1
  592. package/build/hooks/index.js +6 -5
  593. package/build/hooks/index.js.map +1 -1
  594. package/build/hooks/index.native.js.map +1 -1
  595. package/build/hooks/layout-child.js.map +1 -1
  596. package/build/hooks/layout.js +38 -19
  597. package/build/hooks/layout.js.map +1 -1
  598. package/build/hooks/layout.native.js.map +1 -1
  599. package/build/hooks/line-height.js.map +1 -1
  600. package/build/hooks/lock.js.map +1 -1
  601. package/build/hooks/metadata.js.map +1 -1
  602. package/build/hooks/position.js.map +1 -1
  603. package/build/hooks/settings.js.map +1 -1
  604. package/build/hooks/spacing-visualizer.js.map +1 -1
  605. package/build/hooks/style.js.map +1 -1
  606. package/build/hooks/supports.js +27 -4
  607. package/build/hooks/supports.js.map +1 -1
  608. package/build/hooks/text-align.js +156 -0
  609. package/build/hooks/text-align.js.map +1 -0
  610. package/build/hooks/typography.js +3 -2
  611. package/build/hooks/typography.js.map +1 -1
  612. package/build/hooks/typography.native.js.map +1 -1
  613. package/build/hooks/use-bindings-attributes.js +66 -129
  614. package/build/hooks/use-bindings-attributes.js.map +1 -1
  615. package/build/hooks/use-border-props.js.map +1 -1
  616. package/build/hooks/use-cached-truthy.js.map +1 -1
  617. package/build/hooks/use-color-props.js.map +1 -1
  618. package/build/hooks/use-editor-wrapper-styles.native.js.map +1 -1
  619. package/build/hooks/use-shadow-props.js.map +1 -1
  620. package/build/hooks/use-spacing-props.js.map +1 -1
  621. package/build/hooks/use-typography-props.js +2 -1
  622. package/build/hooks/use-typography-props.js.map +1 -1
  623. package/build/hooks/use-zoom-out.js +22 -15
  624. package/build/hooks/use-zoom-out.js.map +1 -1
  625. package/build/hooks/utils.js +29 -5
  626. package/build/hooks/utils.js.map +1 -1
  627. package/build/index.js.map +1 -1
  628. package/build/index.native.js.map +1 -1
  629. package/build/layouts/constrained.js.map +1 -1
  630. package/build/layouts/definitions.js +8 -6
  631. package/build/layouts/definitions.js.map +1 -1
  632. package/build/layouts/flex.js.map +1 -1
  633. package/build/layouts/flow.js.map +1 -1
  634. package/build/layouts/grid.js +52 -9
  635. package/build/layouts/grid.js.map +1 -1
  636. package/build/layouts/index.js.map +1 -1
  637. package/build/layouts/utils.js.map +1 -1
  638. package/build/lock-unlock.js.map +1 -1
  639. package/build/private-apis.js +1 -1
  640. package/build/private-apis.js.map +1 -1
  641. package/build/private-apis.native.js +1 -1
  642. package/build/private-apis.native.js.map +1 -1
  643. package/build/store/actions.js +18 -4
  644. package/build/store/actions.js.map +1 -1
  645. package/build/store/array.js.map +1 -1
  646. package/build/store/constants.js.map +1 -1
  647. package/build/store/defaults.js.map +1 -1
  648. package/build/store/defaults.native.js.map +1 -1
  649. package/build/store/get-block-settings.js.map +1 -1
  650. package/build/store/index.js +1 -1
  651. package/build/store/index.js.map +1 -1
  652. package/build/store/private-actions.js +5 -2
  653. package/build/store/private-actions.js.map +1 -1
  654. package/build/store/private-keys.js.map +1 -1
  655. package/build/store/private-selectors.js +94 -38
  656. package/build/store/private-selectors.js.map +1 -1
  657. package/build/store/reducer.js.map +1 -1
  658. package/build/store/selectors.js +122 -81
  659. package/build/store/selectors.js.map +1 -1
  660. package/build/store/undo-ignore.js.map +1 -1
  661. package/build/store/utils.js.map +1 -1
  662. package/build/utils/dom.js.map +1 -1
  663. package/build/utils/get-px-from-css-unit.js.map +1 -1
  664. package/build/utils/index.js.map +1 -1
  665. package/build/utils/math.js.map +1 -1
  666. package/build/utils/object.js.map +1 -1
  667. package/build/utils/order-inserter-block-items.js.map +1 -1
  668. package/build/utils/pasting.js.map +1 -1
  669. package/build/utils/selection.js.map +1 -1
  670. package/build/utils/sorting.js.map +1 -1
  671. package/build/utils/transform-styles/index.js +1 -1
  672. package/build/utils/transform-styles/index.js.map +1 -1
  673. package/build/utils/use-notify-copy.js.map +1 -1
  674. package/build-module/autocompleters/block.js.map +1 -1
  675. package/build-module/autocompleters/link.js.map +1 -1
  676. package/build-module/components/alignment-control/index.js.map +1 -1
  677. package/build-module/components/alignment-control/ui.js.map +1 -1
  678. package/build-module/components/autocomplete/index.js.map +1 -1
  679. package/build-module/components/block-actions/index.js.map +1 -1
  680. package/build-module/components/block-alignment-control/constants.js.map +1 -1
  681. package/build-module/components/block-alignment-control/index.js.map +1 -1
  682. package/build-module/components/block-alignment-control/ui.js.map +1 -1
  683. package/build-module/components/block-alignment-control/ui.native.js.map +1 -1
  684. package/build-module/components/block-alignment-control/use-available-alignments.js.map +1 -1
  685. package/build-module/components/block-alignment-matrix-control/index.js.map +1 -1
  686. package/build-module/components/block-bindings-toolbar-indicator/index.js.map +1 -1
  687. package/build-module/components/block-breadcrumb/index.js.map +1 -1
  688. package/build-module/components/block-canvas/index.js.map +1 -1
  689. package/build-module/components/block-caption/index.native.js.map +1 -1
  690. package/build-module/components/block-card/index.js.map +1 -1
  691. package/build-module/components/block-compare/block-view.js.map +1 -1
  692. package/build-module/components/block-compare/index.js.map +1 -1
  693. package/build-module/components/block-content-overlay/index.js.map +1 -1
  694. package/build-module/components/block-context/index.js.map +1 -1
  695. package/build-module/components/block-controls/fill.js.map +1 -1
  696. package/build-module/components/block-controls/groups.js.map +1 -1
  697. package/build-module/components/block-controls/hook.js.map +1 -1
  698. package/build-module/components/block-controls/index.js.map +1 -1
  699. package/build-module/components/block-controls/slot.js.map +1 -1
  700. package/build-module/components/block-controls/slot.native.js.map +1 -1
  701. package/build-module/components/block-controls/use-has-block-controls.js.map +1 -1
  702. package/build-module/components/block-draggable/draggable-chip.js.map +1 -1
  703. package/build-module/components/block-draggable/draggable-chip.native.js.map +1 -1
  704. package/build-module/components/block-draggable/dropping-insertion-point.native.js.map +1 -1
  705. package/build-module/components/block-draggable/index.js.map +1 -1
  706. package/build-module/components/block-draggable/index.native.js.map +1 -1
  707. package/build-module/components/block-draggable/use-scroll-when-dragging.js.map +1 -1
  708. package/build-module/components/block-draggable/use-scroll-when-dragging.native.js.map +1 -1
  709. package/build-module/components/block-edit/context.js +1 -0
  710. package/build-module/components/block-edit/context.js.map +1 -1
  711. package/build-module/components/block-edit/edit.js.map +1 -1
  712. package/build-module/components/block-edit/edit.native.js.map +1 -1
  713. package/build-module/components/block-edit/index.js +5 -3
  714. package/build-module/components/block-edit/index.js.map +1 -1
  715. package/build-module/components/block-edit-visually-button/index.js.map +1 -1
  716. package/build-module/components/block-editing-mode/index.js.map +1 -1
  717. package/build-module/components/block-full-height-alignment-control/index.js.map +1 -1
  718. package/build-module/components/block-heading-level-dropdown/heading-level-icon.js.map +1 -1
  719. package/build-module/components/block-heading-level-dropdown/index.js.map +1 -1
  720. package/build-module/components/block-heading-level-dropdown/index.native.js.map +1 -1
  721. package/build-module/components/block-icon/index.js.map +1 -1
  722. package/build-module/components/block-icon/index.native.js.map +1 -1
  723. package/build-module/components/block-info-slot-fill/index.js.map +1 -1
  724. package/build-module/components/block-inspector/index.js +5 -4
  725. package/build-module/components/block-inspector/index.js.map +1 -1
  726. package/build-module/components/block-inspector/useBlockInspectorAnimationSettings.js.map +1 -1
  727. package/build-module/components/block-list/block-crash-boundary.js.map +1 -1
  728. package/build-module/components/block-list/block-crash-boundary.native.js.map +1 -1
  729. package/build-module/components/block-list/block-crash-warning.js.map +1 -1
  730. package/build-module/components/block-list/block-crash-warning.native.js.map +1 -1
  731. package/build-module/components/block-list/block-html.js.map +1 -1
  732. package/build-module/components/block-list/block-invalid-warning.js.map +1 -1
  733. package/build-module/components/block-list/block-invalid-warning.native.js.map +1 -1
  734. package/build-module/components/block-list/block-list-context.native.js.map +1 -1
  735. package/build-module/components/block-list/block-list-item-cell.native.js.map +1 -1
  736. package/build-module/components/block-list/block-list-item.native.js.map +1 -1
  737. package/build-module/components/block-list/block-outline.native.js.map +1 -1
  738. package/build-module/components/block-list/block-selection-button.native.js.map +1 -1
  739. package/build-module/components/block-list/block.js +44 -26
  740. package/build-module/components/block-list/block.js.map +1 -1
  741. package/build-module/components/block-list/block.native.js +2 -2
  742. package/build-module/components/block-list/block.native.js.map +1 -1
  743. package/build-module/components/block-list/grid-item.native.js.map +1 -1
  744. package/build-module/components/block-list/index.js +16 -5
  745. package/build-module/components/block-list/index.js.map +1 -1
  746. package/build-module/components/block-list/index.native.js.map +1 -1
  747. package/build-module/components/block-list/insertion-point.native.js.map +1 -1
  748. package/build-module/components/block-list/layout.js.map +1 -1
  749. package/build-module/components/block-list/private-block-context.js.map +1 -1
  750. package/build-module/components/block-list/subdirectory-icon.js.map +1 -1
  751. package/build-module/components/block-list/use-block-props/index.js +2 -1
  752. package/build-module/components/block-list/use-block-props/index.js.map +1 -1
  753. package/build-module/components/block-list/use-block-props/index.native.js.map +1 -1
  754. package/build-module/components/block-list/use-block-props/use-block-moving-mode-class-names.js.map +1 -1
  755. package/build-module/components/block-list/use-block-props/use-block-refs.js.map +1 -1
  756. package/build-module/components/block-list/use-block-props/use-focus-first-element.js +3 -2
  757. package/build-module/components/block-list/use-block-props/use-focus-first-element.js.map +1 -1
  758. package/build-module/components/block-list/use-block-props/use-focus-handler.js.map +1 -1
  759. package/build-module/components/block-list/use-block-props/use-intersection-observer.js.map +1 -1
  760. package/build-module/components/block-list/use-block-props/use-is-hovered.js.map +1 -1
  761. package/build-module/components/block-list/use-block-props/use-nav-mode-exit.js.map +1 -1
  762. package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +1 -1
  763. package/build-module/components/block-list/use-in-between-inserter.js.map +1 -1
  764. package/build-module/components/block-list/use-scroll-upon-insertion.native.js.map +1 -1
  765. package/build-module/components/block-list-appender/index.js.map +1 -1
  766. package/build-module/components/block-list-appender/index.native.js.map +1 -1
  767. package/build-module/components/block-lock/index.js.map +1 -1
  768. package/build-module/components/block-lock/menu-item.js.map +1 -1
  769. package/build-module/components/block-lock/modal.js.map +1 -1
  770. package/build-module/components/block-lock/toolbar.js.map +1 -1
  771. package/build-module/components/block-lock/use-block-lock.js.map +1 -1
  772. package/build-module/components/block-media-update-progress/index.native.js.map +1 -1
  773. package/build-module/components/block-mover/button.js.map +1 -1
  774. package/build-module/components/block-mover/index.js.map +1 -1
  775. package/build-module/components/block-mover/index.native.js.map +1 -1
  776. package/build-module/components/block-mover/mover-description.js.map +1 -1
  777. package/build-module/components/block-mover/mover-description.native.js.map +1 -1
  778. package/build-module/components/block-navigation/dropdown.js.map +1 -1
  779. package/build-module/components/block-parent-selector/index.js.map +1 -1
  780. package/build-module/components/block-pattern-setup/constants.js.map +1 -1
  781. package/build-module/components/block-pattern-setup/index.js.map +1 -1
  782. package/build-module/components/block-pattern-setup/setup-toolbar.js.map +1 -1
  783. package/build-module/components/block-pattern-setup/use-patterns-setup.js.map +1 -1
  784. package/build-module/components/block-patterns-list/index.js.map +1 -1
  785. package/build-module/components/block-patterns-paging/index.js +8 -4
  786. package/build-module/components/block-patterns-paging/index.js.map +1 -1
  787. package/build-module/components/block-popover/cover.js.map +1 -1
  788. package/build-module/components/block-popover/drop-zone.js.map +1 -1
  789. package/build-module/components/block-popover/inbetween.js.map +1 -1
  790. package/build-module/components/block-popover/index.js.map +1 -1
  791. package/build-module/components/block-popover/use-popover-scroll.js.map +1 -1
  792. package/build-module/components/block-preview/auto.js.map +1 -1
  793. package/build-module/components/block-preview/index.js.map +1 -1
  794. package/build-module/components/block-quick-navigation/index.js.map +1 -1
  795. package/build-module/components/block-removal-warning-modal/index.js.map +1 -1
  796. package/build-module/components/block-rename/index.js.map +1 -1
  797. package/build-module/components/block-rename/is-empty-string.js.map +1 -1
  798. package/build-module/components/block-rename/modal.js +14 -10
  799. package/build-module/components/block-rename/modal.js.map +1 -1
  800. package/build-module/components/block-rename/rename-control.js +3 -1
  801. package/build-module/components/block-rename/rename-control.js.map +1 -1
  802. package/build-module/components/block-rename/use-block-rename.js.map +1 -1
  803. package/build-module/components/block-selection-clearer/index.js.map +1 -1
  804. package/build-module/components/block-settings/button.native.js.map +1 -1
  805. package/build-module/components/block-settings/container.native.js.map +1 -1
  806. package/build-module/components/block-settings/index.native.js.map +1 -1
  807. package/build-module/components/block-settings-menu/block-html-convert-button.js.map +1 -1
  808. package/build-module/components/block-settings-menu/block-mode-toggle.js.map +1 -1
  809. package/build-module/components/block-settings-menu/block-parent-selector-menu-item.js.map +1 -1
  810. package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  811. package/build-module/components/block-settings-menu/block-settings-menu-first-item.js.map +1 -1
  812. package/build-module/components/block-settings-menu/index.js.map +1 -1
  813. package/build-module/components/block-settings-menu-controls/index.js.map +1 -1
  814. package/build-module/components/block-styles/index.js.map +1 -1
  815. package/build-module/components/block-styles/index.native.js.map +1 -1
  816. package/build-module/components/block-styles/menu-items.js.map +1 -1
  817. package/build-module/components/block-styles/preview-panel.js.map +1 -1
  818. package/build-module/components/block-styles/preview.native.js.map +1 -1
  819. package/build-module/components/block-styles/use-styles-for-block.js.map +1 -1
  820. package/build-module/components/block-styles/utils.js.map +1 -1
  821. package/build-module/components/block-switcher/block-styles-menu.js.map +1 -1
  822. package/build-module/components/block-switcher/block-transformations-menu.js.map +1 -1
  823. package/build-module/components/block-switcher/block-transformations-menu.native.js.map +1 -1
  824. package/build-module/components/block-switcher/block-variation-transformations.js.map +1 -1
  825. package/build-module/components/block-switcher/index.js.map +1 -1
  826. package/build-module/components/block-switcher/pattern-transformations-menu.js.map +1 -1
  827. package/build-module/components/block-switcher/preview-block-popover.js.map +1 -1
  828. package/build-module/components/block-switcher/use-transformed-patterns.js.map +1 -1
  829. package/build-module/components/block-switcher/utils.js.map +1 -1
  830. package/build-module/components/block-title/index.js.map +1 -1
  831. package/build-module/components/block-title/use-block-display-title.js.map +1 -1
  832. package/build-module/components/block-toolbar/block-name-context.js.map +1 -1
  833. package/build-module/components/block-toolbar/block-toolbar-last-item.js.map +1 -1
  834. package/build-module/components/block-toolbar/block-toolbar-menu.native.js.map +1 -1
  835. package/build-module/components/block-toolbar/index.js +1 -1
  836. package/build-module/components/block-toolbar/index.js.map +1 -1
  837. package/build-module/components/block-toolbar/index.native.js.map +1 -1
  838. package/build-module/components/block-toolbar/shuffle.js.map +1 -1
  839. package/build-module/components/block-toolbar/use-has-block-toolbar.js +6 -3
  840. package/build-module/components/block-toolbar/use-has-block-toolbar.js.map +1 -1
  841. package/build-module/components/block-toolbar/utils.js.map +1 -1
  842. package/build-module/components/block-tools/block-selection-button.js +16 -12
  843. package/build-module/components/block-tools/block-selection-button.js.map +1 -1
  844. package/build-module/components/block-tools/block-toolbar-breadcrumb.js.map +1 -1
  845. package/build-module/components/block-tools/block-toolbar-popover.js.map +1 -1
  846. package/build-module/components/block-tools/empty-block-inserter.js.map +1 -1
  847. package/build-module/components/block-tools/index.js.map +1 -1
  848. package/build-module/components/block-tools/insertion-point.js.map +1 -1
  849. package/build-module/components/block-tools/use-block-toolbar-popover-props.js.map +1 -1
  850. package/build-module/components/block-tools/use-selected-block-tool-props.js.map +1 -1
  851. package/build-module/components/block-tools/use-show-block-tools.js +7 -13
  852. package/build-module/components/block-tools/use-show-block-tools.js.map +1 -1
  853. package/build-module/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
  854. package/build-module/components/block-types-list/index.js.map +1 -1
  855. package/build-module/components/block-types-list/index.native.js.map +1 -1
  856. package/build-module/components/block-variation-picker/index.js.map +1 -1
  857. package/build-module/components/block-variation-picker/index.native.js.map +1 -1
  858. package/build-module/components/block-variation-transforms/index.js +4 -1
  859. package/build-module/components/block-variation-transforms/index.js.map +1 -1
  860. package/build-module/components/block-vertical-alignment-control/icons.js.map +1 -1
  861. package/build-module/components/block-vertical-alignment-control/index.js.map +1 -1
  862. package/build-module/components/block-vertical-alignment-control/ui.js.map +1 -1
  863. package/build-module/components/border-radius-control/all-input-control.js.map +1 -1
  864. package/build-module/components/border-radius-control/index.js.map +1 -1
  865. package/build-module/components/border-radius-control/input-controls.js.map +1 -1
  866. package/build-module/components/border-radius-control/linked-button.js.map +1 -1
  867. package/build-module/components/border-radius-control/utils.js.map +1 -1
  868. package/build-module/components/button-block-appender/index.js.map +1 -1
  869. package/build-module/components/button-block-appender/index.native.js +11 -1
  870. package/build-module/components/button-block-appender/index.native.js.map +1 -1
  871. package/build-module/components/caption/index.native.js.map +1 -1
  872. package/build-module/components/child-layout-control/index.js.map +1 -1
  873. package/build-module/components/color-palette/control.js.map +1 -1
  874. package/build-module/components/color-palette/index.js.map +1 -1
  875. package/build-module/components/color-palette/with-color-context.js.map +1 -1
  876. package/build-module/components/color-style-selector/index.js.map +1 -1
  877. package/build-module/components/colors/index.js.map +1 -1
  878. package/build-module/components/colors/utils.js.map +1 -1
  879. package/build-module/components/colors/with-colors.js.map +1 -1
  880. package/build-module/components/colors-gradients/control.js.map +1 -1
  881. package/build-module/components/colors-gradients/dropdown.js.map +1 -1
  882. package/build-module/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
  883. package/build-module/components/colors-gradients/panel-color-gradient-settings.native.js.map +1 -1
  884. package/build-module/components/colors-gradients/use-multiple-origin-colors-and-gradients.js.map +1 -1
  885. package/build-module/components/contrast-checker/index.js.map +1 -1
  886. package/build-module/components/contrast-checker/index.native.js.map +1 -1
  887. package/build-module/components/convert-to-group-buttons/index.js.map +1 -1
  888. package/build-module/components/convert-to-group-buttons/index.native.js.map +1 -1
  889. package/build-module/components/convert-to-group-buttons/toolbar.js.map +1 -1
  890. package/build-module/components/convert-to-group-buttons/use-convert-to-group-button-props.js.map +1 -1
  891. package/build-module/components/copy-handler/index.js.map +1 -1
  892. package/build-module/components/date-format-picker/index.js.map +1 -1
  893. package/build-module/components/default-block-appender/index.js.map +1 -1
  894. package/build-module/components/default-block-appender/index.native.js.map +1 -1
  895. package/build-module/components/dimensions-tool/aspect-ratio-tool.js.map +1 -1
  896. package/build-module/components/dimensions-tool/index.js.map +1 -1
  897. package/build-module/components/dimensions-tool/scale-tool.js.map +1 -1
  898. package/build-module/components/dimensions-tool/width-height-tool.js.map +1 -1
  899. package/build-module/components/duotone/utils.js.map +1 -1
  900. package/build-module/components/duotone-control/index.js.map +1 -1
  901. package/build-module/components/editable-text/index.js.map +1 -1
  902. package/build-module/components/editor-styles/index.js +3 -2
  903. package/build-module/components/editor-styles/index.js.map +1 -1
  904. package/build-module/components/floating-toolbar/index.native.js.map +1 -1
  905. package/build-module/components/floating-toolbar/nav-up-icon.js.map +1 -1
  906. package/build-module/components/font-appearance-control/index.js.map +1 -1
  907. package/build-module/components/font-family/index.js.map +1 -1
  908. package/build-module/components/font-sizes/fluid-utils.js.map +1 -1
  909. package/build-module/components/font-sizes/font-size-picker.js.map +1 -1
  910. package/build-module/components/font-sizes/index.js.map +1 -1
  911. package/build-module/components/font-sizes/index.native.js.map +1 -1
  912. package/build-module/components/font-sizes/utils.js.map +1 -1
  913. package/build-module/components/font-sizes/with-font-sizes.js.map +1 -1
  914. package/build-module/components/global-styles/advanced-panel.js.map +1 -1
  915. package/build-module/components/global-styles/background-panel.js +19 -16
  916. package/build-module/components/global-styles/background-panel.js.map +1 -1
  917. package/build-module/components/global-styles/border-panel.js.map +1 -1
  918. package/build-module/components/global-styles/color-panel.js.map +1 -1
  919. package/build-module/components/global-styles/color-panel.native.js.map +1 -1
  920. package/build-module/components/global-styles/context.js.map +1 -1
  921. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  922. package/build-module/components/global-styles/filters-panel.js.map +1 -1
  923. package/build-module/components/global-styles/get-block-css-selector.js.map +1 -1
  924. package/build-module/components/global-styles/get-global-styles-changes.js.map +1 -1
  925. package/build-module/components/global-styles/hooks.js.map +1 -1
  926. package/build-module/components/global-styles/image-settings-panel.js.map +1 -1
  927. package/build-module/components/global-styles/index.js.map +1 -1
  928. package/build-module/components/global-styles/shadow-panel-components.js.map +1 -1
  929. package/build-module/components/global-styles/typography-panel.js.map +1 -1
  930. package/build-module/components/global-styles/typography-utils.js.map +1 -1
  931. package/build-module/components/global-styles/use-global-styles-output.js +4 -4
  932. package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
  933. package/build-module/components/global-styles/utils.js.map +1 -1
  934. package/build-module/components/gradients/index.js.map +1 -1
  935. package/build-module/components/gradients/index.native.js.map +1 -1
  936. package/build-module/components/gradients/use-gradient.js.map +1 -1
  937. package/build-module/components/gradients/with-gradient.js.map +1 -1
  938. package/build-module/components/grid-visualizer/grid-item-resizer.js.map +1 -1
  939. package/build-module/components/grid-visualizer/grid-visualizer.js.map +1 -1
  940. package/build-module/components/grid-visualizer/index.js.map +1 -1
  941. package/build-module/components/grid-visualizer/utils.js.map +1 -1
  942. package/build-module/components/height-control/index.js.map +1 -1
  943. package/build-module/components/iframe/get-compatibility-styles.js.map +1 -1
  944. package/build-module/components/iframe/index.js +12 -13
  945. package/build-module/components/iframe/index.js.map +1 -1
  946. package/build-module/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
  947. package/build-module/components/image-editor/constants.js.map +1 -1
  948. package/build-module/components/image-editor/context.js.map +1 -1
  949. package/build-module/components/image-editor/cropper.js +7 -3
  950. package/build-module/components/image-editor/cropper.js.map +1 -1
  951. package/build-module/components/image-editor/form-controls.js.map +1 -1
  952. package/build-module/components/image-editor/index.js +0 -2
  953. package/build-module/components/image-editor/index.js.map +1 -1
  954. package/build-module/components/image-editor/rotation-button.js.map +1 -1
  955. package/build-module/components/image-editor/use-save-image.js.map +1 -1
  956. package/build-module/components/image-editor/use-transform-image.js.map +1 -1
  957. package/build-module/components/image-editor/zoom-dropdown.js.map +1 -1
  958. package/build-module/components/image-link-destinations/index.native.js.map +1 -1
  959. package/build-module/components/image-size-control/index.js.map +1 -1
  960. package/build-module/components/image-size-control/use-dimension-handler.js.map +1 -1
  961. package/build-module/components/index.js.map +1 -1
  962. package/build-module/components/index.native.js.map +1 -1
  963. package/build-module/components/inner-blocks/button-block-appender.js.map +1 -1
  964. package/build-module/components/inner-blocks/constants.native.js.map +1 -1
  965. package/build-module/components/inner-blocks/default-block-appender.js.map +1 -1
  966. package/build-module/components/inner-blocks/index.js.map +1 -1
  967. package/build-module/components/inner-blocks/index.native.js.map +1 -1
  968. package/build-module/components/inner-blocks/use-block-context.js.map +1 -1
  969. package/build-module/components/inner-blocks/use-inner-block-template-sync.js.map +1 -1
  970. package/build-module/components/inner-blocks/use-nested-settings-update.js.map +1 -1
  971. package/build-module/components/inner-blocks/warning-max-depth-exceeded.native.js.map +1 -1
  972. package/build-module/components/inner-blocks/with-client-id.js.map +1 -1
  973. package/build-module/components/inserter/block-patterns-explorer/index.js.map +1 -1
  974. package/build-module/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js.map +1 -1
  975. package/build-module/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
  976. package/build-module/components/inserter/block-patterns-tab/index.js +32 -19
  977. package/build-module/components/inserter/block-patterns-tab/index.js.map +1 -1
  978. package/build-module/components/inserter/block-patterns-tab/pattern-category-preview-panel.js +2 -24
  979. package/build-module/components/inserter/block-patterns-tab/pattern-category-preview-panel.js.map +1 -1
  980. package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js +2 -4
  981. package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
  982. package/build-module/components/inserter/block-patterns-tab/patterns-filter.js.map +1 -1
  983. package/build-module/components/inserter/block-patterns-tab/use-pattern-categories.js.map +1 -1
  984. package/build-module/components/inserter/block-patterns-tab/utils.js.map +1 -1
  985. package/build-module/components/inserter/block-types-tab.js.map +1 -1
  986. package/build-module/components/inserter/block-types-tab.native.js.map +1 -1
  987. package/build-module/components/inserter/hooks/use-block-type-impressions.native.js.map +1 -1
  988. package/build-module/components/inserter/hooks/use-block-types-state.js.map +1 -1
  989. package/build-module/components/inserter/hooks/use-clipboard-block.native.js.map +1 -1
  990. package/build-module/components/inserter/hooks/use-insertion-point.js.map +1 -1
  991. package/build-module/components/inserter/hooks/use-patterns-paging.js.map +1 -1
  992. package/build-module/components/inserter/hooks/use-patterns-state.js.map +1 -1
  993. package/build-module/components/inserter/index.js.map +1 -1
  994. package/build-module/components/inserter/index.native.js.map +1 -1
  995. package/build-module/components/inserter/library.js.map +1 -1
  996. package/build-module/components/inserter/media-tab/hooks.js.map +1 -1
  997. package/build-module/components/inserter/media-tab/index.js.map +1 -1
  998. package/build-module/components/inserter/media-tab/media-list.js.map +1 -1
  999. package/build-module/components/inserter/media-tab/media-panel.js.map +1 -1
  1000. package/build-module/components/inserter/media-tab/media-preview.js.map +1 -1
  1001. package/build-module/components/inserter/media-tab/media-tab.js.map +1 -1
  1002. package/build-module/components/inserter/media-tab/utils.js.map +1 -1
  1003. package/build-module/components/inserter/menu.js +17 -11
  1004. package/build-module/components/inserter/menu.js.map +1 -1
  1005. package/build-module/components/inserter/menu.native.js.map +1 -1
  1006. package/build-module/components/inserter/mobile-tab-navigation.js.map +1 -1
  1007. package/build-module/components/inserter/no-results.js.map +1 -1
  1008. package/build-module/components/inserter/no-results.native.js.map +1 -1
  1009. package/build-module/components/inserter/panel.js.map +1 -1
  1010. package/build-module/components/inserter/preview-panel.js.map +1 -1
  1011. package/build-module/components/inserter/quick-inserter.js.map +1 -1
  1012. package/build-module/components/inserter/reusable-block-rename-hint.js.map +1 -1
  1013. package/build-module/components/inserter/reusable-blocks-tab.native.js.map +1 -1
  1014. package/build-module/components/inserter/search-items.js.map +1 -1
  1015. package/build-module/components/inserter/search-results.js.map +1 -1
  1016. package/build-module/components/inserter/search-results.native.js.map +1 -1
  1017. package/build-module/components/inserter/tabs.js +7 -3
  1018. package/build-module/components/inserter/tabs.js.map +1 -1
  1019. package/build-module/components/inserter/tabs.native.js.map +1 -1
  1020. package/build-module/components/inserter/tips.js.map +1 -1
  1021. package/build-module/components/inserter/utils.native.js.map +1 -1
  1022. package/build-module/components/inserter-button/index.native.js.map +1 -1
  1023. package/build-module/components/inserter-button/sparkles.js.map +1 -1
  1024. package/build-module/components/inserter-draggable-blocks/index.js.map +1 -1
  1025. package/build-module/components/inserter-list-item/index.js.map +1 -1
  1026. package/build-module/components/inserter-listbox/context.js.map +1 -1
  1027. package/build-module/components/inserter-listbox/group.js.map +1 -1
  1028. package/build-module/components/inserter-listbox/index.js.map +1 -1
  1029. package/build-module/components/inserter-listbox/item.js.map +1 -1
  1030. package/build-module/components/inserter-listbox/row.js.map +1 -1
  1031. package/build-module/components/inserter-menu-extension/index.js.map +1 -1
  1032. package/build-module/components/inspector-controls/block-support-slot-container.js.map +1 -1
  1033. package/build-module/components/inspector-controls/block-support-tools-panel.js.map +1 -1
  1034. package/build-module/components/inspector-controls/fill.js.map +1 -1
  1035. package/build-module/components/inspector-controls/fill.native.js.map +1 -1
  1036. package/build-module/components/inspector-controls/groups.js.map +1 -1
  1037. package/build-module/components/inspector-controls/index.js.map +1 -1
  1038. package/build-module/components/inspector-controls/slot.js.map +1 -1
  1039. package/build-module/components/inspector-controls/slot.native.js.map +1 -1
  1040. package/build-module/components/inspector-controls-tabs/advanced-controls-panel.js.map +1 -1
  1041. package/build-module/components/inspector-controls-tabs/advanced-controls-panel.native.js.map +1 -1
  1042. package/build-module/components/inspector-controls-tabs/index.js.map +1 -1
  1043. package/build-module/components/inspector-controls-tabs/position-controls-panel.js.map +1 -1
  1044. package/build-module/components/inspector-controls-tabs/settings-tab-hint.js.map +1 -1
  1045. package/build-module/components/inspector-controls-tabs/settings-tab.js.map +1 -1
  1046. package/build-module/components/inspector-controls-tabs/styles-tab.js +1 -1
  1047. package/build-module/components/inspector-controls-tabs/styles-tab.js.map +1 -1
  1048. package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +1 -1
  1049. package/build-module/components/inspector-controls-tabs/use-is-list-view-tab-disabled.js.map +1 -1
  1050. package/build-module/components/inspector-controls-tabs/utils.js.map +1 -1
  1051. package/build-module/components/inspector-popover-header/index.js.map +1 -1
  1052. package/build-module/components/justify-content-control/index.js.map +1 -1
  1053. package/build-module/components/justify-content-control/ui.js.map +1 -1
  1054. package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
  1055. package/build-module/components/letter-spacing-control/index.js.map +1 -1
  1056. package/build-module/components/line-height-control/index.js.map +1 -1
  1057. package/build-module/components/line-height-control/index.native.js.map +1 -1
  1058. package/build-module/components/line-height-control/utils.js.map +1 -1
  1059. package/build-module/components/link-control/constants.js.map +1 -1
  1060. package/build-module/components/link-control/index.js.map +1 -1
  1061. package/build-module/components/link-control/is-url-like.js.map +1 -1
  1062. package/build-module/components/link-control/link-preview.js.map +1 -1
  1063. package/build-module/components/link-control/search-create-button.js.map +1 -1
  1064. package/build-module/components/link-control/search-input.js.map +1 -1
  1065. package/build-module/components/link-control/search-item.js.map +1 -1
  1066. package/build-module/components/link-control/search-results.js.map +1 -1
  1067. package/build-module/components/link-control/settings-drawer.js.map +1 -1
  1068. package/build-module/components/link-control/settings.js.map +1 -1
  1069. package/build-module/components/link-control/use-create-page.js.map +1 -1
  1070. package/build-module/components/link-control/use-internal-value.js.map +1 -1
  1071. package/build-module/components/link-control/use-rich-url-data.js.map +1 -1
  1072. package/build-module/components/link-control/use-search-handler.js.map +1 -1
  1073. package/build-module/components/link-control/viewer-slot.js.map +1 -1
  1074. package/build-module/components/list-view/appender.js.map +1 -1
  1075. package/build-module/components/list-view/aria-referenced-text.js.map +1 -1
  1076. package/build-module/components/list-view/block-contents.js.map +1 -1
  1077. package/build-module/components/list-view/block-select-button.js +29 -1
  1078. package/build-module/components/list-view/block-select-button.js.map +1 -1
  1079. package/build-module/components/list-view/block.js.map +1 -1
  1080. package/build-module/components/list-view/branch.js.map +1 -1
  1081. package/build-module/components/list-view/context.js.map +1 -1
  1082. package/build-module/components/list-view/drop-indicator.js.map +1 -1
  1083. package/build-module/components/list-view/expander.js.map +1 -1
  1084. package/build-module/components/list-view/index.js.map +1 -1
  1085. package/build-module/components/list-view/leaf.js.map +1 -1
  1086. package/build-module/components/list-view/use-block-selection.js.map +1 -1
  1087. package/build-module/components/list-view/use-clipboard-handler.js.map +1 -1
  1088. package/build-module/components/list-view/use-list-view-block-indexes.js.map +1 -1
  1089. package/build-module/components/list-view/use-list-view-client-ids.js.map +1 -1
  1090. package/build-module/components/list-view/use-list-view-collapse-items.js.map +1 -1
  1091. package/build-module/components/list-view/use-list-view-drop-zone.js +5 -0
  1092. package/build-module/components/list-view/use-list-view-drop-zone.js.map +1 -1
  1093. package/build-module/components/list-view/use-list-view-expand-selected-item.js.map +1 -1
  1094. package/build-module/components/list-view/use-list-view-images.js.map +1 -1
  1095. package/build-module/components/list-view/use-list-view-scroll-into-view.js.map +1 -1
  1096. package/build-module/components/list-view/utils.js.map +1 -1
  1097. package/build-module/components/media-placeholder/index.js.map +1 -1
  1098. package/build-module/components/media-placeholder/index.native.js.map +1 -1
  1099. package/build-module/components/media-replace-flow/index.js.map +1 -1
  1100. package/build-module/components/media-replace-flow/index.native.js.map +1 -1
  1101. package/build-module/components/media-upload/check.js.map +1 -1
  1102. package/build-module/components/media-upload/constants.native.js.map +1 -1
  1103. package/build-module/components/media-upload/index.js.map +1 -1
  1104. package/build-module/components/media-upload/index.native.js.map +1 -1
  1105. package/build-module/components/media-upload-progress/constants.js.map +1 -1
  1106. package/build-module/components/media-upload-progress/index.native.js.map +1 -1
  1107. package/build-module/components/multi-selection-inspector/index.js.map +1 -1
  1108. package/build-module/components/navigable-toolbar/index.js.map +1 -1
  1109. package/build-module/components/observe-typing/index.js.map +1 -1
  1110. package/build-module/components/panel-color-settings/index.js.map +1 -1
  1111. package/build-module/components/plain-text/index.js.map +1 -1
  1112. package/build-module/components/plain-text/index.native.js.map +1 -1
  1113. package/build-module/components/preview-options/index.js.map +1 -1
  1114. package/build-module/components/provider/block-refs-provider.js.map +1 -1
  1115. package/build-module/components/provider/index.js.map +1 -1
  1116. package/build-module/components/provider/index.native.js.map +1 -1
  1117. package/build-module/components/provider/use-block-sync.js.map +1 -1
  1118. package/build-module/components/provider/with-registry-provider.js.map +1 -1
  1119. package/build-module/components/publish-date-time-picker/index.js.map +1 -1
  1120. package/build-module/components/recursion-provider/index.js +2 -2
  1121. package/build-module/components/recursion-provider/index.js.map +1 -1
  1122. package/build-module/components/resizable-box-popover/index.js.map +1 -1
  1123. package/build-module/components/resolution-tool/index.js.map +1 -1
  1124. package/build-module/components/responsive-block-control/index.js.map +1 -1
  1125. package/build-module/components/responsive-block-control/label.js.map +1 -1
  1126. package/build-module/components/rich-text/content.js +25 -19
  1127. package/build-module/components/rich-text/content.js.map +1 -1
  1128. package/build-module/components/rich-text/embed-handler-picker.native.js.map +1 -1
  1129. package/build-module/components/rich-text/file-paste-handler.native.js.map +1 -1
  1130. package/build-module/components/rich-text/format-edit.js.map +1 -1
  1131. package/build-module/components/rich-text/format-toolbar/index.js.map +1 -1
  1132. package/build-module/components/rich-text/format-toolbar/index.native.js.map +1 -1
  1133. package/build-module/components/rich-text/format-toolbar-container.js.map +1 -1
  1134. package/build-module/components/rich-text/format-toolbar-container.native.js.map +1 -1
  1135. package/build-module/components/rich-text/get-rich-text-values.js.map +1 -1
  1136. package/build-module/components/rich-text/index.js +42 -2
  1137. package/build-module/components/rich-text/index.js.map +1 -1
  1138. package/build-module/components/rich-text/index.native.js +3 -1
  1139. package/build-module/components/rich-text/index.native.js.map +1 -1
  1140. package/build-module/components/rich-text/input-event.js.map +1 -1
  1141. package/build-module/components/rich-text/input-event.native.js.map +1 -1
  1142. package/build-module/components/rich-text/multiline.js.map +1 -1
  1143. package/build-module/components/rich-text/native/format-edit.js.map +1 -1
  1144. package/build-module/components/rich-text/native/get-format-colors.native.js.map +1 -1
  1145. package/build-module/components/rich-text/native/index.js.map +1 -1
  1146. package/build-module/components/rich-text/native/index.native.js.map +1 -1
  1147. package/build-module/components/rich-text/native/toolbar-button-with-options.native.js.map +1 -1
  1148. package/build-module/components/rich-text/native/use-format-types.js.map +1 -1
  1149. package/build-module/components/rich-text/prevent-event-discovery.js.map +1 -1
  1150. package/build-module/components/rich-text/remove-browser-shortcuts.native.js.map +1 -1
  1151. package/build-module/components/rich-text/shortcut.js.map +1 -1
  1152. package/build-module/components/rich-text/shortcut.native.js.map +1 -1
  1153. package/build-module/components/rich-text/split-value.js.map +1 -1
  1154. package/build-module/components/rich-text/toolbar-button.js.map +1 -1
  1155. package/build-module/components/rich-text/use-before-input-rules.js.map +1 -1
  1156. package/build-module/components/rich-text/use-delete.js.map +1 -1
  1157. package/build-module/components/rich-text/use-enter.js.map +1 -1
  1158. package/build-module/components/rich-text/use-firefox-compat.js.map +1 -1
  1159. package/build-module/components/rich-text/use-format-types.js.map +1 -1
  1160. package/build-module/components/rich-text/use-input-events.js.map +1 -1
  1161. package/build-module/components/rich-text/use-input-rules.js.map +1 -1
  1162. package/build-module/components/rich-text/use-insert-replacement-text.js.map +1 -1
  1163. package/build-module/components/rich-text/use-mark-persistent.js.map +1 -1
  1164. package/build-module/components/rich-text/use-paste-handler.js.map +1 -1
  1165. package/build-module/components/rich-text/use-remove-browser-shortcuts.js.map +1 -1
  1166. package/build-module/components/rich-text/use-shortcuts.js.map +1 -1
  1167. package/build-module/components/rich-text/use-undo-automatic-change.js +2 -2
  1168. package/build-module/components/rich-text/use-undo-automatic-change.js.map +1 -1
  1169. package/build-module/components/rich-text/utils.js.map +1 -1
  1170. package/build-module/components/rich-text/with-deprecations.js.map +1 -1
  1171. package/build-module/components/selection-scroll-into-view/index.js.map +1 -1
  1172. package/build-module/components/skip-to-selected-block/index.js.map +1 -1
  1173. package/build-module/components/spacing-sizes-control/hooks/use-spacing-sizes.js.map +1 -1
  1174. package/build-module/components/spacing-sizes-control/index.js.map +1 -1
  1175. package/build-module/components/spacing-sizes-control/input-controls/axial.js.map +1 -1
  1176. package/build-module/components/spacing-sizes-control/input-controls/separated.js.map +1 -1
  1177. package/build-module/components/spacing-sizes-control/input-controls/single.js.map +1 -1
  1178. package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
  1179. package/build-module/components/spacing-sizes-control/sides-dropdown/index.js.map +1 -1
  1180. package/build-module/components/spacing-sizes-control/utils.js.map +1 -1
  1181. package/build-module/components/text-decoration-control/index.js.map +1 -1
  1182. package/build-module/components/text-transform-control/index.js.map +1 -1
  1183. package/build-module/components/tool-selector/index.js.map +1 -1
  1184. package/build-module/components/typewriter/index.js.map +1 -1
  1185. package/build-module/components/ungroup-button/index.native.js.map +1 -1
  1186. package/build-module/components/unit-control/index.js.map +1 -1
  1187. package/build-module/components/unsupported-block-details/index.native.js.map +1 -1
  1188. package/build-module/components/url-input/button.js.map +1 -1
  1189. package/build-module/components/url-input/index.js.map +1 -1
  1190. package/build-module/components/url-input/index.native.js.map +1 -1
  1191. package/build-module/components/url-popover/image-url-input-ui.js.map +1 -1
  1192. package/build-module/components/url-popover/index.js.map +1 -1
  1193. package/build-module/components/url-popover/link-editor.js.map +1 -1
  1194. package/build-module/components/url-popover/link-viewer-url.js.map +1 -1
  1195. package/build-module/components/url-popover/link-viewer.js.map +1 -1
  1196. package/build-module/components/use-block-commands/index.js +20 -2
  1197. package/build-module/components/use-block-commands/index.js.map +1 -1
  1198. package/build-module/components/use-block-display-information/index.js.map +1 -1
  1199. package/build-module/components/use-block-drop-zone/index.js.map +1 -1
  1200. package/build-module/components/use-block-drop-zone/index.native.js.map +1 -1
  1201. package/build-module/components/use-flash-editable-blocks/index.js.map +1 -1
  1202. package/build-module/components/use-moving-animation/index.js.map +1 -1
  1203. package/build-module/components/use-on-block-drop/index.js.map +1 -1
  1204. package/build-module/components/use-on-block-drop/index.native.js.map +1 -1
  1205. package/build-module/components/use-on-block-drop/types.js.map +1 -1
  1206. package/build-module/components/use-paste-styles/index.js +2 -1
  1207. package/build-module/components/use-paste-styles/index.js.map +1 -1
  1208. package/build-module/components/use-resize-canvas/index.js.map +1 -1
  1209. package/build-module/components/use-settings/index.js.map +1 -1
  1210. package/build-module/components/use-unsupported-block-editor/index.native.js.map +1 -1
  1211. package/build-module/components/video-player/gridicon-play.native.js.map +1 -1
  1212. package/build-module/components/video-player/index.native.js.map +1 -1
  1213. package/build-module/components/warning/index.js.map +1 -1
  1214. package/build-module/components/warning/index.native.js.map +1 -1
  1215. package/build-module/components/writing-flow/index.js.map +1 -1
  1216. package/build-module/components/writing-flow/use-arrow-nav.js.map +1 -1
  1217. package/build-module/components/writing-flow/use-click-selection.js.map +1 -1
  1218. package/build-module/components/writing-flow/use-clipboard-handler.js.map +1 -1
  1219. package/build-module/components/writing-flow/use-drag-selection.js.map +1 -1
  1220. package/build-module/components/writing-flow/use-input.js.map +1 -1
  1221. package/build-module/components/writing-flow/use-multi-selection.js.map +1 -1
  1222. package/build-module/components/writing-flow/use-select-all.js.map +1 -1
  1223. package/build-module/components/writing-flow/use-selection-observer.js.map +1 -1
  1224. package/build-module/components/writing-flow/use-tab-nav.js.map +1 -1
  1225. package/build-module/components/writing-flow/utils.js.map +1 -1
  1226. package/build-module/components/writing-mode-control/index.js.map +1 -1
  1227. package/build-module/elements/index.js.map +1 -1
  1228. package/build-module/hooks/align.js.map +1 -1
  1229. package/build-module/hooks/align.native.js.map +1 -1
  1230. package/build-module/hooks/anchor.js.map +1 -1
  1231. package/build-module/hooks/aria-label.js.map +1 -1
  1232. package/build-module/hooks/background.js +2 -2
  1233. package/build-module/hooks/background.js.map +1 -1
  1234. package/build-module/hooks/block-hooks.js.map +1 -1
  1235. package/build-module/hooks/block-renaming.js +0 -36
  1236. package/build-module/hooks/block-renaming.js.map +1 -1
  1237. package/build-module/hooks/border.js.map +1 -1
  1238. package/build-module/hooks/color.js.map +1 -1
  1239. package/build-module/hooks/compat.js.map +1 -1
  1240. package/build-module/hooks/content-lock-ui.js +5 -5
  1241. package/build-module/hooks/content-lock-ui.js.map +1 -1
  1242. package/build-module/hooks/contrast-checker.js.map +1 -1
  1243. package/build-module/hooks/custom-class-name.js.map +1 -1
  1244. package/build-module/hooks/custom-class-name.native.js.map +1 -1
  1245. package/build-module/hooks/dimensions.js.map +1 -1
  1246. package/build-module/hooks/duotone.js.map +1 -1
  1247. package/build-module/hooks/font-family.js.map +1 -1
  1248. package/build-module/hooks/font-size.js.map +1 -1
  1249. package/build-module/hooks/gap.js.map +1 -1
  1250. package/build-module/hooks/generated-class-name.js.map +1 -1
  1251. package/build-module/hooks/index.js +5 -4
  1252. package/build-module/hooks/index.js.map +1 -1
  1253. package/build-module/hooks/index.native.js.map +1 -1
  1254. package/build-module/hooks/layout-child.js.map +1 -1
  1255. package/build-module/hooks/layout.js +38 -19
  1256. package/build-module/hooks/layout.js.map +1 -1
  1257. package/build-module/hooks/layout.native.js.map +1 -1
  1258. package/build-module/hooks/line-height.js.map +1 -1
  1259. package/build-module/hooks/lock.js.map +1 -1
  1260. package/build-module/hooks/metadata.js.map +1 -1
  1261. package/build-module/hooks/position.js.map +1 -1
  1262. package/build-module/hooks/settings.js.map +1 -1
  1263. package/build-module/hooks/spacing-visualizer.js.map +1 -1
  1264. package/build-module/hooks/style.js.map +1 -1
  1265. package/build-module/hooks/supports.js +22 -1
  1266. package/build-module/hooks/supports.js.map +1 -1
  1267. package/build-module/hooks/text-align.js +145 -0
  1268. package/build-module/hooks/text-align.js.map +1 -0
  1269. package/build-module/hooks/typography.js +2 -1
  1270. package/build-module/hooks/typography.js.map +1 -1
  1271. package/build-module/hooks/typography.native.js.map +1 -1
  1272. package/build-module/hooks/use-bindings-attributes.js +68 -132
  1273. package/build-module/hooks/use-bindings-attributes.js.map +1 -1
  1274. package/build-module/hooks/use-border-props.js.map +1 -1
  1275. package/build-module/hooks/use-cached-truthy.js.map +1 -1
  1276. package/build-module/hooks/use-color-props.js.map +1 -1
  1277. package/build-module/hooks/use-editor-wrapper-styles.native.js.map +1 -1
  1278. package/build-module/hooks/use-shadow-props.js.map +1 -1
  1279. package/build-module/hooks/use-spacing-props.js.map +1 -1
  1280. package/build-module/hooks/use-typography-props.js +2 -1
  1281. package/build-module/hooks/use-typography-props.js.map +1 -1
  1282. package/build-module/hooks/use-zoom-out.js +23 -16
  1283. package/build-module/hooks/use-zoom-out.js.map +1 -1
  1284. package/build-module/hooks/utils.js +30 -6
  1285. package/build-module/hooks/utils.js.map +1 -1
  1286. package/build-module/index.js.map +1 -1
  1287. package/build-module/index.native.js.map +1 -1
  1288. package/build-module/layouts/constrained.js.map +1 -1
  1289. package/build-module/layouts/definitions.js +8 -6
  1290. package/build-module/layouts/definitions.js.map +1 -1
  1291. package/build-module/layouts/flex.js.map +1 -1
  1292. package/build-module/layouts/flow.js.map +1 -1
  1293. package/build-module/layouts/grid.js +52 -9
  1294. package/build-module/layouts/grid.js.map +1 -1
  1295. package/build-module/layouts/index.js.map +1 -1
  1296. package/build-module/layouts/utils.js.map +1 -1
  1297. package/build-module/lock-unlock.js.map +1 -1
  1298. package/build-module/private-apis.js.map +1 -1
  1299. package/build-module/private-apis.native.js.map +1 -1
  1300. package/build-module/store/actions.js +18 -4
  1301. package/build-module/store/actions.js.map +1 -1
  1302. package/build-module/store/array.js.map +1 -1
  1303. package/build-module/store/constants.js.map +1 -1
  1304. package/build-module/store/defaults.js.map +1 -1
  1305. package/build-module/store/defaults.native.js.map +1 -1
  1306. package/build-module/store/get-block-settings.js.map +1 -1
  1307. package/build-module/store/index.js.map +1 -1
  1308. package/build-module/store/private-actions.js +5 -2
  1309. package/build-module/store/private-actions.js.map +1 -1
  1310. package/build-module/store/private-keys.js.map +1 -1
  1311. package/build-module/store/private-selectors.js +87 -33
  1312. package/build-module/store/private-selectors.js.map +1 -1
  1313. package/build-module/store/reducer.js.map +1 -1
  1314. package/build-module/store/selectors.js +95 -55
  1315. package/build-module/store/selectors.js.map +1 -1
  1316. package/build-module/store/undo-ignore.js.map +1 -1
  1317. package/build-module/store/utils.js.map +1 -1
  1318. package/build-module/utils/dom.js.map +1 -1
  1319. package/build-module/utils/get-px-from-css-unit.js.map +1 -1
  1320. package/build-module/utils/index.js.map +1 -1
  1321. package/build-module/utils/math.js.map +1 -1
  1322. package/build-module/utils/object.js.map +1 -1
  1323. package/build-module/utils/order-inserter-block-items.js.map +1 -1
  1324. package/build-module/utils/pasting.js.map +1 -1
  1325. package/build-module/utils/selection.js.map +1 -1
  1326. package/build-module/utils/sorting.js.map +1 -1
  1327. package/build-module/utils/transform-styles/index.js.map +1 -1
  1328. package/build-module/utils/use-notify-copy.js.map +1 -1
  1329. package/build-style/content-rtl.css +36 -18
  1330. package/build-style/content.css +36 -18
  1331. package/build-style/default-editor-styles-rtl.css +1 -1
  1332. package/build-style/default-editor-styles.css +1 -1
  1333. package/build-style/style-rtl.css +73 -58
  1334. package/build-style/style.css +73 -58
  1335. package/package.json +32 -33
  1336. package/src/components/block-bindings-toolbar-indicator/style.scss +1 -1
  1337. package/src/components/block-edit/context.js +1 -0
  1338. package/src/components/block-edit/index.js +4 -0
  1339. package/src/components/block-inspector/index.js +6 -4
  1340. package/src/components/block-list/block.js +50 -27
  1341. package/src/components/block-list/block.native.js +3 -2
  1342. package/src/components/block-list/content.scss +37 -19
  1343. package/src/components/block-list/index.js +22 -6
  1344. package/src/components/block-list/use-block-props/index.js +5 -1
  1345. package/src/components/block-list/use-block-props/use-focus-first-element.js +7 -3
  1346. package/src/components/block-patterns-paging/index.js +4 -0
  1347. package/src/components/block-rename/modal.js +17 -13
  1348. package/src/components/block-rename/rename-control.js +8 -1
  1349. package/src/components/block-toolbar/index.js +26 -22
  1350. package/src/components/block-toolbar/use-has-block-toolbar.js +5 -3
  1351. package/src/components/block-tools/block-selection-button.js +55 -43
  1352. package/src/components/block-tools/use-show-block-tools.js +4 -7
  1353. package/src/components/block-variation-transforms/index.js +3 -1
  1354. package/src/components/button-block-appender/index.native.js +16 -1
  1355. package/src/components/default-block-appender/content.scss +1 -1
  1356. package/src/components/editor-styles/index.js +4 -2
  1357. package/src/components/global-styles/background-panel.js +30 -26
  1358. package/src/components/global-styles/style.scss +2 -8
  1359. package/src/components/global-styles/test/use-global-styles-output.js +8 -17
  1360. package/src/components/global-styles/use-global-styles-output.js +5 -5
  1361. package/src/components/iframe/index.js +20 -27
  1362. package/src/components/image-editor/cropper.js +11 -2
  1363. package/src/components/image-editor/index.js +0 -2
  1364. package/src/components/inserter/block-patterns-tab/index.js +53 -39
  1365. package/src/components/inserter/block-patterns-tab/pattern-category-preview-panel.js +9 -36
  1366. package/src/components/inserter/block-patterns-tab/pattern-category-previews.js +2 -2
  1367. package/src/components/inserter/menu.js +27 -16
  1368. package/src/components/inserter/style.scss +83 -59
  1369. package/src/components/inserter/tabs.js +7 -2
  1370. package/src/components/inspector-controls-tabs/styles-tab.js +1 -1
  1371. package/src/components/link-control/style.scss +10 -2
  1372. package/src/components/link-control/test/index.js +1 -1
  1373. package/src/components/list-view/block-select-button.js +31 -2
  1374. package/src/components/list-view/use-list-view-drop-zone.js +5 -0
  1375. package/src/components/recursion-provider/index.js +2 -2
  1376. package/src/components/rich-text/README.md +4 -0
  1377. package/src/components/rich-text/content.js +26 -19
  1378. package/src/components/rich-text/index.js +46 -2
  1379. package/src/components/rich-text/index.native.js +3 -1
  1380. package/src/components/rich-text/use-undo-automatic-change.js +2 -6
  1381. package/src/components/use-block-commands/index.js +46 -28
  1382. package/src/components/use-paste-styles/index.js +2 -0
  1383. package/src/hooks/background.js +2 -2
  1384. package/src/hooks/block-renaming.js +0 -33
  1385. package/src/hooks/content-lock-ui.js +5 -7
  1386. package/src/hooks/index.js +5 -2
  1387. package/src/hooks/layout.js +57 -25
  1388. package/src/hooks/supports.js +24 -0
  1389. package/src/hooks/test/text-align.js +114 -0
  1390. package/src/hooks/test/use-typography-props.js +3 -1
  1391. package/src/hooks/text-align.js +178 -0
  1392. package/src/hooks/typography.js +2 -0
  1393. package/src/hooks/use-bindings-attributes.js +90 -161
  1394. package/src/hooks/use-typography-props.js +4 -1
  1395. package/src/hooks/use-zoom-out.js +25 -15
  1396. package/src/hooks/utils.js +41 -3
  1397. package/src/layouts/definitions.js +6 -6
  1398. package/src/layouts/grid.js +106 -47
  1399. package/src/store/actions.js +22 -6
  1400. package/src/store/private-actions.js +6 -3
  1401. package/src/store/private-selectors.js +127 -35
  1402. package/src/store/selectors.js +142 -86
  1403. package/tsconfig.tsbuildinfo +1 -1
@@ -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;AAC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AAK,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( 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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,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\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,yB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7D,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;AAC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AAE,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","ignoreList":[]}
@@ -1 +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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,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;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,gB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AAO,EAAGN;EAA4B,GAClD1B,EAAE,CAAE,MAAO,CACC,CACD,CACd,CACF,EACC4B,wBAAwB,IACzBC,aAAA,CAACxB,yBAAyB,QACvB,CAAE;IAAE4B;EAAQ,CAAC,KACdJ,aAAA,CAAChC,QAAQ;IACRmC,OAAO,EAAGA,CAAA,KAAM;MACfR,uCAAuC,CAAC,CAAC;MACzCC,qBAAqB,CAAEjB,QAAQ,EAAE;QAChCI,YAAY,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","ignoreList":[]}
@@ -1 +1 @@
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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,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,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","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,GAAGR,mBAAmB,CAAC,CAAC;EAC9C,IAAKQ,gBAAgB,KAAK,SAAS,EAAG;IACrC,OAAO,IAAI;EACZ;EAEA,OACCC,aAAA,CAACV,iBAAiB;IAACW,KAAK,EAAC;EAAU,GAClCD,aAAA,CAACb,WAAW;IACXe,uBAAuB;IACvBC,qBAAqB;IACrBC,YAAY,EAAC,KAAK;IAClBC,KAAK,EAAGjB,EAAE,CAAE,0BAA2B,CAAG;IAC1CkB,KAAK,EAAGX,SAAS,IAAI,EAAI;IACzBY,QAAQ,EAAKC,SAAS,IAAM;MAC3BV,aAAa,CAAE;QACdH,SAAS,EAAEa,SAAS,KAAK,EAAE,GAAGA,SAAS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;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,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;EA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,CAAEC,MAAM,EAAEC,MAAM,EAAEC,KAAK,EAAEC,OAAO,EAAG;EAC/D,IAAK,CAAEjC,eAAe,CAAE8B,MAAM,CAACJ,IAAI,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","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":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["classnames","Platform","useState","useEffect","useCallback","useDispatch","useSelect","getBlockSupport","deprecated","InspectorControls","DimensionsPanel","StylesDimensionsPanel","useHasDimensionsPanel","MarginVisualizer","PaddingVisualizer","store","blockEditorStore","unlock","cleanEmptyObject","shouldSkipSerialization","DIMENSIONS_SUPPORT_KEY","SPACING_SUPPORT_KEY","ALL_SIDES","AXIAL_SIDES","useVisualizer","property","setProperty","hideBlockInterface","showBlockInterface","DimensionsInspectorControl","children","resetAllFilter","attributesResetAllFilter","attributes","existingStyle","style","updatedStyle","createElement","group","clientId","name","setAttributes","settings","isEnabled","value","select","getBlockAttributes","visualizedProperty","setVisualizedProperty","onChange","newStyle","defaultDimensionsControls","defaultSpacingControls","defaultControls","Fragment","as","panelId","onVisualize","spacing","padding","forceShow","margin","hasDimensionsSupport","blockName","feature","OS","support","aspectRatio","minHeight","useBlockProps","attributeKeys","hasSupport","className","dimensions","inlineStyleOverrides","useCustomSides","since","version"],"sources":["@wordpress/block-editor/src/hooks/dimensions.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { Platform, useState, useEffect, useCallback } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { getBlockSupport } from '@wordpress/blocks';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport InspectorControls from '../components/inspector-controls';\nimport {\n\tDimensionsPanel as StylesDimensionsPanel,\n\tuseHasDimensionsPanel,\n} from '../components/global-styles';\nimport { MarginVisualizer, PaddingVisualizer } from './spacing-visualizer';\nimport { store as blockEditorStore } from '../store';\nimport { unlock } from '../lock-unlock';\nimport { cleanEmptyObject, shouldSkipSerialization } from './utils';\n\nexport const DIMENSIONS_SUPPORT_KEY = 'dimensions';\nexport const SPACING_SUPPORT_KEY = 'spacing';\nexport const ALL_SIDES = [ 'top', 'right', 'bottom', 'left' ];\nexport const AXIAL_SIDES = [ 'vertical', 'horizontal' ];\n\nfunction useVisualizer() {\n\tconst [ property, setProperty ] = useState( false );\n\tconst { hideBlockInterface, showBlockInterface } = unlock(\n\t\tuseDispatch( blockEditorStore )\n\t);\n\tuseEffect( () => {\n\t\tif ( ! property ) {\n\t\t\tshowBlockInterface();\n\t\t} else {\n\t\t\thideBlockInterface();\n\t\t}\n\t}, [ property, showBlockInterface, hideBlockInterface ] );\n\n\treturn [ property, setProperty ];\n}\n\nfunction DimensionsInspectorControl( { children, resetAllFilter } ) {\n\tconst attributesResetAllFilter = useCallback(\n\t\t( attributes ) => {\n\t\t\tconst existingStyle = attributes.style;\n\t\t\tconst updatedStyle = resetAllFilter( existingStyle );\n\t\t\treturn {\n\t\t\t\t...attributes,\n\t\t\t\tstyle: 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=\"dimensions\"\n\t\t\tresetAllFilter={ attributesResetAllFilter }\n\t\t>\n\t\t\t{ children }\n\t\t</InspectorControls>\n\t);\n}\n\nexport function DimensionsPanel( { clientId, name, setAttributes, settings } ) {\n\tconst isEnabled = useHasDimensionsPanel( settings );\n\tconst value = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockEditorStore ).getBlockAttributes( clientId )?.style,\n\t\t[ clientId ]\n\t);\n\tconst [ visualizedProperty, setVisualizedProperty ] = useVisualizer();\n\tconst onChange = ( newStyle ) => {\n\t\tsetAttributes( {\n\t\t\tstyle: cleanEmptyObject( newStyle ),\n\t\t} );\n\t};\n\n\tif ( ! isEnabled ) {\n\t\treturn null;\n\t}\n\n\tconst defaultDimensionsControls = getBlockSupport( name, [\n\t\tDIMENSIONS_SUPPORT_KEY,\n\t\t'__experimentalDefaultControls',\n\t] );\n\tconst defaultSpacingControls = getBlockSupport( name, [\n\t\tSPACING_SUPPORT_KEY,\n\t\t'__experimentalDefaultControls',\n\t] );\n\tconst defaultControls = {\n\t\t...defaultDimensionsControls,\n\t\t...defaultSpacingControls,\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<StylesDimensionsPanel\n\t\t\t\tas={ DimensionsInspectorControl }\n\t\t\t\tpanelId={ clientId }\n\t\t\t\tsettings={ settings }\n\t\t\t\tvalue={ value }\n\t\t\t\tonChange={ onChange }\n\t\t\t\tdefaultControls={ defaultControls }\n\t\t\t\tonVisualize={ setVisualizedProperty }\n\t\t\t/>\n\t\t\t{ !! settings?.spacing?.padding && (\n\t\t\t\t<PaddingVisualizer\n\t\t\t\t\tforceShow={ visualizedProperty === 'padding' }\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\tvalue={ value }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ !! settings?.spacing?.margin && (\n\t\t\t\t<MarginVisualizer\n\t\t\t\t\tforceShow={ visualizedProperty === 'margin' }\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\tvalue={ value }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\n/**\n * Determine whether there is block support for dimensions.\n *\n * @param {string} blockName Block name.\n * @param {string} feature Background image feature to check for.\n *\n * @return {boolean} Whether there is support.\n */\nexport function hasDimensionsSupport( blockName, feature = 'any' ) {\n\tif ( Platform.OS !== 'web' ) {\n\t\treturn false;\n\t}\n\n\tconst support = getBlockSupport( blockName, DIMENSIONS_SUPPORT_KEY );\n\n\tif ( support === true ) {\n\t\treturn true;\n\t}\n\n\tif ( feature === 'any' ) {\n\t\treturn !! ( support?.aspectRatio || !! support?.minHeight );\n\t}\n\n\treturn !! support?.[ feature ];\n}\n\nexport default {\n\tuseBlockProps,\n\tattributeKeys: [ 'minHeight', 'style' ],\n\thasSupport( name ) {\n\t\treturn hasDimensionsSupport( name, 'aspectRatio' );\n\t},\n};\n\nfunction useBlockProps( { name, minHeight, style } ) {\n\tif (\n\t\t! hasDimensionsSupport( name, 'aspectRatio' ) ||\n\t\tshouldSkipSerialization( name, DIMENSIONS_SUPPORT_KEY, 'aspectRatio' )\n\t) {\n\t\treturn {};\n\t}\n\n\tconst className = classnames( {\n\t\t'has-aspect-ratio': !! style?.dimensions?.aspectRatio,\n\t} );\n\n\t// Allow dimensions-based inline style overrides to override any global styles rules that\n\t// might be set for the block, and therefore affect the display of the aspect ratio.\n\tconst inlineStyleOverrides = {};\n\n\t// Apply rules to unset incompatible styles.\n\t// Note that a set `aspectRatio` will win out if both an aspect ratio and a minHeight are set.\n\t// This is because the aspect ratio is a newer block support, so (in theory) any aspect ratio\n\t// that is set should be intentional and should override any existing minHeight. The Cover block\n\t// and dimensions controls have logic that will manually clear the aspect ratio if a minHeight\n\t// is set.\n\tif ( style?.dimensions?.aspectRatio ) {\n\t\t// To ensure the aspect ratio does not get overridden by `minHeight` unset any existing rule.\n\t\tinlineStyleOverrides.minHeight = 'unset';\n\t} else if ( minHeight || style?.dimensions?.minHeight ) {\n\t\t// To ensure the minHeight does not get overridden by `aspectRatio` unset any existing rule.\n\t\tinlineStyleOverrides.aspectRatio = 'unset';\n\t}\n\n\treturn { className, style: inlineStyleOverrides };\n}\n\n/**\n * @deprecated\n */\nexport function useCustomSides() {\n\tdeprecated( 'wp.blockEditor.__experimentalUseCustomSides', {\n\t\tsince: '6.3',\n\t\tversion: '6.4',\n\t} );\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,QAAQ,EAAEC,QAAQ,EAAEC,SAAS,EAAEC,WAAW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C,UAAUA,CAAE/B,IAAI,EAAG;IAClB,OAAOsB,oBAAoB,CAAEtB,IAAI,EAAE,aAAc,CAAC;EACnD;AACD,CAAC;AAED,SAAS6B,aAAaA,CAAE;EAAE7B,IAAI;EAAE4B,SAAS;EAAEjC;AAAM,CAAC,EAAG;EACpD,IACC,CAAE2B,oBAAoB,CAAEtB,IAAI,EAAE,aAAc,CAAC,IAC7CrB,uBAAuB,CAAEqB,IAAI,EAAEpB,sBAAsB,EAAE,aAAc,CAAC,EACrE;IACD,OAAO,CAAC,CAAC;EACV;EAEA,MAAMoD,SAAS,GAAGxE,UAAU,CAAE;IAC7B,kBAAkB,EAAE,CAAC,CAAEmC,KAAK,EAAEsC,UAAU,EAAEN;EAC3C,CAAE,CAAC;;EAEH;EACA;EACA,MAAMO,oBAAoB,GAAG,CAAC,CAAC;;EAE/B;EACA;EACA;EACA;EACA;EACA;EACA,IAAKvC,KAAK,EAAEsC,UAAU,EAAEN,WAAW,EAAG;IACrC;IACAO,oBAAoB,CAACN,SAAS,GAAG,OAAO;EACzC,CAAC,MAAM,IAAKA,SAAS,IAAIjC,KAAK,EAAEsC,UAAU,EAAEL,SAAS,EAAG;IACvD;IACAM,oBAAoB,CAACP,WAAW,GAAG,OAAO;EAC3C;EAEA,OAAO;IAAEK,SAAS;IAAErC,KAAK,EAAEuC;EAAqB,CAAC;AAClD;;AAEA;AACA;AACA;AACA,OAAO,SAASC,cAAcA,CAAA,EAAG;EAChCnE,UAAU,CAAE,6CAA6C,EAAE;IAC1DoE,KAAK,EAAE,KAAK;IACZC,OAAO,EAAE;EACV,CAAE,CAAC;AACJ"}
1
+ {"version":3,"names":["classnames","Platform","useState","useEffect","useCallback","useDispatch","useSelect","getBlockSupport","deprecated","InspectorControls","DimensionsPanel","StylesDimensionsPanel","useHasDimensionsPanel","MarginVisualizer","PaddingVisualizer","store","blockEditorStore","unlock","cleanEmptyObject","shouldSkipSerialization","DIMENSIONS_SUPPORT_KEY","SPACING_SUPPORT_KEY","ALL_SIDES","AXIAL_SIDES","useVisualizer","property","setProperty","hideBlockInterface","showBlockInterface","DimensionsInspectorControl","children","resetAllFilter","attributesResetAllFilter","attributes","existingStyle","style","updatedStyle","createElement","group","clientId","name","setAttributes","settings","isEnabled","value","select","getBlockAttributes","visualizedProperty","setVisualizedProperty","onChange","newStyle","defaultDimensionsControls","defaultSpacingControls","defaultControls","Fragment","as","panelId","onVisualize","spacing","padding","forceShow","margin","hasDimensionsSupport","blockName","feature","OS","support","aspectRatio","minHeight","useBlockProps","attributeKeys","hasSupport","className","dimensions","inlineStyleOverrides","useCustomSides","since","version"],"sources":["@wordpress/block-editor/src/hooks/dimensions.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { Platform, useState, useEffect, useCallback } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { getBlockSupport } from '@wordpress/blocks';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport InspectorControls from '../components/inspector-controls';\nimport {\n\tDimensionsPanel as StylesDimensionsPanel,\n\tuseHasDimensionsPanel,\n} from '../components/global-styles';\nimport { MarginVisualizer, PaddingVisualizer } from './spacing-visualizer';\nimport { store as blockEditorStore } from '../store';\nimport { unlock } from '../lock-unlock';\nimport { cleanEmptyObject, shouldSkipSerialization } from './utils';\n\nexport const DIMENSIONS_SUPPORT_KEY = 'dimensions';\nexport const SPACING_SUPPORT_KEY = 'spacing';\nexport const ALL_SIDES = [ 'top', 'right', 'bottom', 'left' ];\nexport const AXIAL_SIDES = [ 'vertical', 'horizontal' ];\n\nfunction useVisualizer() {\n\tconst [ property, setProperty ] = useState( false );\n\tconst { hideBlockInterface, showBlockInterface } = unlock(\n\t\tuseDispatch( blockEditorStore )\n\t);\n\tuseEffect( () => {\n\t\tif ( ! property ) {\n\t\t\tshowBlockInterface();\n\t\t} else {\n\t\t\thideBlockInterface();\n\t\t}\n\t}, [ property, showBlockInterface, hideBlockInterface ] );\n\n\treturn [ property, setProperty ];\n}\n\nfunction DimensionsInspectorControl( { children, resetAllFilter } ) {\n\tconst attributesResetAllFilter = useCallback(\n\t\t( attributes ) => {\n\t\t\tconst existingStyle = attributes.style;\n\t\t\tconst updatedStyle = resetAllFilter( existingStyle );\n\t\t\treturn {\n\t\t\t\t...attributes,\n\t\t\t\tstyle: 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=\"dimensions\"\n\t\t\tresetAllFilter={ attributesResetAllFilter }\n\t\t>\n\t\t\t{ children }\n\t\t</InspectorControls>\n\t);\n}\n\nexport function DimensionsPanel( { clientId, name, setAttributes, settings } ) {\n\tconst isEnabled = useHasDimensionsPanel( settings );\n\tconst value = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockEditorStore ).getBlockAttributes( clientId )?.style,\n\t\t[ clientId ]\n\t);\n\tconst [ visualizedProperty, setVisualizedProperty ] = useVisualizer();\n\tconst onChange = ( newStyle ) => {\n\t\tsetAttributes( {\n\t\t\tstyle: cleanEmptyObject( newStyle ),\n\t\t} );\n\t};\n\n\tif ( ! isEnabled ) {\n\t\treturn null;\n\t}\n\n\tconst defaultDimensionsControls = getBlockSupport( name, [\n\t\tDIMENSIONS_SUPPORT_KEY,\n\t\t'__experimentalDefaultControls',\n\t] );\n\tconst defaultSpacingControls = getBlockSupport( name, [\n\t\tSPACING_SUPPORT_KEY,\n\t\t'__experimentalDefaultControls',\n\t] );\n\tconst defaultControls = {\n\t\t...defaultDimensionsControls,\n\t\t...defaultSpacingControls,\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<StylesDimensionsPanel\n\t\t\t\tas={ DimensionsInspectorControl }\n\t\t\t\tpanelId={ clientId }\n\t\t\t\tsettings={ settings }\n\t\t\t\tvalue={ value }\n\t\t\t\tonChange={ onChange }\n\t\t\t\tdefaultControls={ defaultControls }\n\t\t\t\tonVisualize={ setVisualizedProperty }\n\t\t\t/>\n\t\t\t{ !! settings?.spacing?.padding && (\n\t\t\t\t<PaddingVisualizer\n\t\t\t\t\tforceShow={ visualizedProperty === 'padding' }\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\tvalue={ value }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ !! settings?.spacing?.margin && (\n\t\t\t\t<MarginVisualizer\n\t\t\t\t\tforceShow={ visualizedProperty === 'margin' }\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\tvalue={ value }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\n/**\n * Determine whether there is block support for dimensions.\n *\n * @param {string} blockName Block name.\n * @param {string} feature Background image feature to check for.\n *\n * @return {boolean} Whether there is support.\n */\nexport function hasDimensionsSupport( blockName, feature = 'any' ) {\n\tif ( Platform.OS !== 'web' ) {\n\t\treturn false;\n\t}\n\n\tconst support = getBlockSupport( blockName, DIMENSIONS_SUPPORT_KEY );\n\n\tif ( support === true ) {\n\t\treturn true;\n\t}\n\n\tif ( feature === 'any' ) {\n\t\treturn !! ( support?.aspectRatio || !! support?.minHeight );\n\t}\n\n\treturn !! support?.[ feature ];\n}\n\nexport default {\n\tuseBlockProps,\n\tattributeKeys: [ 'minHeight', 'style' ],\n\thasSupport( name ) {\n\t\treturn hasDimensionsSupport( name, 'aspectRatio' );\n\t},\n};\n\nfunction useBlockProps( { name, minHeight, style } ) {\n\tif (\n\t\t! hasDimensionsSupport( name, 'aspectRatio' ) ||\n\t\tshouldSkipSerialization( name, DIMENSIONS_SUPPORT_KEY, 'aspectRatio' )\n\t) {\n\t\treturn {};\n\t}\n\n\tconst className = classnames( {\n\t\t'has-aspect-ratio': !! style?.dimensions?.aspectRatio,\n\t} );\n\n\t// Allow dimensions-based inline style overrides to override any global styles rules that\n\t// might be set for the block, and therefore affect the display of the aspect ratio.\n\tconst inlineStyleOverrides = {};\n\n\t// Apply rules to unset incompatible styles.\n\t// Note that a set `aspectRatio` will win out if both an aspect ratio and a minHeight are set.\n\t// This is because the aspect ratio is a newer block support, so (in theory) any aspect ratio\n\t// that is set should be intentional and should override any existing minHeight. The Cover block\n\t// and dimensions controls have logic that will manually clear the aspect ratio if a minHeight\n\t// is set.\n\tif ( style?.dimensions?.aspectRatio ) {\n\t\t// To ensure the aspect ratio does not get overridden by `minHeight` unset any existing rule.\n\t\tinlineStyleOverrides.minHeight = 'unset';\n\t} else if ( minHeight || style?.dimensions?.minHeight ) {\n\t\t// To ensure the minHeight does not get overridden by `aspectRatio` unset any existing rule.\n\t\tinlineStyleOverrides.aspectRatio = 'unset';\n\t}\n\n\treturn { className, style: inlineStyleOverrides };\n}\n\n/**\n * @deprecated\n */\nexport function useCustomSides() {\n\tdeprecated( 'wp.blockEditor.__experimentalUseCustomSides', {\n\t\tsince: '6.3',\n\t\tversion: '6.4',\n\t} );\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,QAAQ,EAAEC,QAAQ,EAAEC,SAAS,EAAEC,WAAW,QAAQ,oBAAoB;AAC/E,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,eAAe,QAAQ,mBAAmB;AACnD,OAAOC,UAAU,MAAM,uBAAuB;;AAE9C;AACA;AACA;AACA,OAAOC,iBAAiB,MAAM,kCAAkC;AAChE,SACCC,eAAe,IAAIC,qBAAqB,EACxCC,qBAAqB,QACf,6BAA6B;AACpC,SAASC,gBAAgB,EAAEC,iBAAiB,QAAQ,sBAAsB;AAC1E,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,UAAU;AACpD,SAASC,MAAM,QAAQ,gBAAgB;AACvC,SAASC,gBAAgB,EAAEC,uBAAuB,QAAQ,SAAS;AAEnE,OAAO,MAAMC,sBAAsB,GAAG,YAAY;AAClD,OAAO,MAAMC,mBAAmB,GAAG,SAAS;AAC5C,OAAO,MAAMC,SAAS,GAAG,CAAE,KAAK,E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IAAKvC,KAAK,EAAEsC,UAAU,EAAEN,WAAW,EAAG;IACrC;IACAO,oBAAoB,CAACN,SAAS,GAAG,OAAO;EACzC,CAAC,MAAM,IAAKA,SAAS,IAAIjC,KAAK,EAAEsC,UAAU,EAAEL,SAAS,EAAG;IACvD;IACAM,oBAAoB,CAACP,WAAW,GAAG,OAAO;EAC3C;EAEA,OAAO;IAAEK,SAAS;IAAErC,KAAK,EAAEuC;EAAqB,CAAC;AAClD;;AAEA;AACA;AACA;AACA,OAAO,SAASC,cAAcA,CAAA,EAAG;EAChCnE,UAAU,CAAE,6CAA6C,EAAE;IAC1DoE,KAAK,EAAE,KAAK;IACZC,OAAO,EAAE;EACV,CAAE,CAAC;AACJ","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["extend","namesPlugin","getBlockSupport","getBlockType","hasBlockSupport","useInstanceId","addFilter","useMemo","useEffect","BlockControls","InspectorControls","__experimentalDuotoneControl","DuotoneControl","useSettings","getDuotoneFilter","getDuotoneStylesheet","getDuotoneUnsetStylesheet","getBlockCSSSelector","scopeSelector","useBlockSettings","useStyleOverride","default","StylesFiltersPanel","useBlockEditingMode","__unstableUseBlockElement","useBlockElement","EMPTY_ARRAY","isSafari","window","navigator","userAgent","includes","useMultiOriginPresets","presetSetting","defaultSetting","enableDefault","userPresets","themePresets","defaultPresets","getColorsFromDuotonePreset","duotone","duotonePalette","preset","find","slug","colors","undefined","getDuotonePresetFromColors","Array","isArray","duotonePreset","every","val","index","DuotonePanelPure","style","setAttributes","name","duotoneStyle","color","settings","blockEditingMode","colorPalette","enableCustomColors","enableCustomDuotone","disableCustomColors","disableCustomDuotone","length","duotonePresetOrColors","createElement","Fragment","group","value","filter","onChange","newDuotone","newStyle","__experimentalShareWithChildBlocks","maybePreset","shareWithChildBlocks","edit","useBlockProps","attributeKeys","hasSupport","addDuotoneAttributes","attributes","Object","assign","type","useDuotoneStyles","clientId","id","filterId","selector","duotoneSelector","attribute","duotoneAttr","isCustom","isPreset","isCSS","selectors","split","selectorsScoped","map","selectorPart","trim","join","isValidFilter","css","__unstableType","assets","blockElement","display","offsetHeight","blockType","duotoneSupport","experimentalDuotone","rootSelector","fallback","filterClass","shouldRender","className"],"sources":["@wordpress/block-editor/src/hooks/duotone.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { extend } from 'colord';\nimport namesPlugin from 'colord/plugins/names';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tgetBlockSupport,\n\tgetBlockType,\n\thasBlockSupport,\n} from '@wordpress/blocks';\nimport { useInstanceId } from '@wordpress/compose';\nimport { addFilter } from '@wordpress/hooks';\nimport { useMemo, useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport {\n\tBlockControls,\n\tInspectorControls,\n\t__experimentalDuotoneControl as DuotoneControl,\n\tuseSettings,\n} from '../components';\nimport {\n\tgetDuotoneFilter,\n\tgetDuotoneStylesheet,\n\tgetDuotoneUnsetStylesheet,\n} from '../components/duotone/utils';\nimport { getBlockCSSSelector } from '../components/global-styles/get-block-css-selector';\nimport { scopeSelector } from '../components/global-styles/utils';\nimport { useBlockSettings, useStyleOverride } from './utils';\nimport { default as StylesFiltersPanel } from '../components/global-styles/filters-panel';\nimport { useBlockEditingMode } from '../components/block-editing-mode';\nimport { __unstableUseBlockElement as useBlockElement } from '../components/block-list/use-block-props/use-block-refs';\n\nconst EMPTY_ARRAY = [];\n\n// Safari does not always update the duotone filter when the duotone colors\n// are changed. This browser check is later used to force a re-render of the block\n// element to ensure the duotone filter is updated. The check is included at the\n// root of this file as it only needs to be run once per page load.\nconst isSafari =\n\twindow?.navigator.userAgent &&\n\twindow.navigator.userAgent.includes( 'Safari' ) &&\n\t! window.navigator.userAgent.includes( 'Chrome' ) &&\n\t! window.navigator.userAgent.includes( 'Chromium' );\n\nextend( [ namesPlugin ] );\n\nfunction useMultiOriginPresets( { presetSetting, defaultSetting } ) {\n\tconst [ enableDefault, userPresets, themePresets, defaultPresets ] =\n\t\tuseSettings(\n\t\t\tdefaultSetting,\n\t\t\t`${ presetSetting }.custom`,\n\t\t\t`${ presetSetting }.theme`,\n\t\t\t`${ presetSetting }.default`\n\t\t);\n\treturn useMemo(\n\t\t() => [\n\t\t\t...( userPresets || EMPTY_ARRAY ),\n\t\t\t...( themePresets || EMPTY_ARRAY ),\n\t\t\t...( ( enableDefault && defaultPresets ) || EMPTY_ARRAY ),\n\t\t],\n\t\t[ enableDefault, userPresets, themePresets, defaultPresets ]\n\t);\n}\n\nexport function getColorsFromDuotonePreset( duotone, duotonePalette ) {\n\tif ( ! duotone ) {\n\t\treturn;\n\t}\n\tconst preset = duotonePalette?.find( ( { slug } ) => {\n\t\treturn duotone === `var:preset|duotone|${ slug }`;\n\t} );\n\n\treturn preset ? preset.colors : undefined;\n}\n\nexport function getDuotonePresetFromColors( colors, duotonePalette ) {\n\tif ( ! colors || ! Array.isArray( colors ) ) {\n\t\treturn;\n\t}\n\n\tconst preset = duotonePalette?.find( ( duotonePreset ) => {\n\t\treturn duotonePreset?.colors?.every(\n\t\t\t( val, index ) => val === colors[ index ]\n\t\t);\n\t} );\n\n\treturn preset ? `var:preset|duotone|${ preset.slug }` : undefined;\n}\n\nfunction DuotonePanelPure( { style, setAttributes, name } ) {\n\tconst duotoneStyle = style?.color?.duotone;\n\tconst settings = useBlockSettings( name );\n\tconst blockEditingMode = useBlockEditingMode();\n\n\tconst duotonePalette = useMultiOriginPresets( {\n\t\tpresetSetting: 'color.duotone',\n\t\tdefaultSetting: 'color.defaultDuotone',\n\t} );\n\tconst colorPalette = useMultiOriginPresets( {\n\t\tpresetSetting: 'color.palette',\n\t\tdefaultSetting: 'color.defaultPalette',\n\t} );\n\tconst [ enableCustomColors, enableCustomDuotone ] = useSettings(\n\t\t'color.custom',\n\t\t'color.customDuotone'\n\t);\n\tconst disableCustomColors = ! enableCustomColors;\n\tconst disableCustomDuotone =\n\t\t! enableCustomDuotone ||\n\t\t( colorPalette?.length === 0 && disableCustomColors );\n\n\tif ( duotonePalette?.length === 0 && disableCustomDuotone ) {\n\t\treturn null;\n\t}\n\n\tif ( blockEditingMode !== 'default' ) {\n\t\treturn null;\n\t}\n\n\tconst duotonePresetOrColors = ! Array.isArray( duotoneStyle )\n\t\t? getColorsFromDuotonePreset( duotoneStyle, duotonePalette )\n\t\t: duotoneStyle;\n\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls group=\"filter\">\n\t\t\t\t<StylesFiltersPanel\n\t\t\t\t\tvalue={ { filter: { duotone: duotonePresetOrColors } } }\n\t\t\t\t\tonChange={ ( newDuotone ) => {\n\t\t\t\t\t\tconst newStyle = {\n\t\t\t\t\t\t\t...style,\n\t\t\t\t\t\t\tcolor: {\n\t\t\t\t\t\t\t\t...newDuotone?.filter,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t};\n\t\t\t\t\t\tsetAttributes( { style: newStyle } );\n\t\t\t\t\t} }\n\t\t\t\t\tsettings={ settings }\n\t\t\t\t/>\n\t\t\t</InspectorControls>\n\t\t\t<BlockControls group=\"block\" __experimentalShareWithChildBlocks>\n\t\t\t\t<DuotoneControl\n\t\t\t\t\tduotonePalette={ duotonePalette }\n\t\t\t\t\tcolorPalette={ colorPalette }\n\t\t\t\t\tdisableCustomDuotone={ disableCustomDuotone }\n\t\t\t\t\tdisableCustomColors={ disableCustomColors }\n\t\t\t\t\tvalue={ duotonePresetOrColors }\n\t\t\t\t\tonChange={ ( newDuotone ) => {\n\t\t\t\t\t\tconst maybePreset = getDuotonePresetFromColors(\n\t\t\t\t\t\t\tnewDuotone,\n\t\t\t\t\t\t\tduotonePalette\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tconst newStyle = {\n\t\t\t\t\t\t\t...style,\n\t\t\t\t\t\t\tcolor: {\n\t\t\t\t\t\t\t\t...style?.color,\n\t\t\t\t\t\t\t\tduotone: maybePreset ?? newDuotone, // use preset or fallback to custom colors.\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t};\n\t\t\t\t\t\tsetAttributes( { style: newStyle } );\n\t\t\t\t\t} }\n\t\t\t\t\tsettings={ settings }\n\t\t\t\t/>\n\t\t\t</BlockControls>\n\t\t</>\n\t);\n}\n\nexport default {\n\tshareWithChildBlocks: true,\n\tedit: DuotonePanelPure,\n\tuseBlockProps,\n\tattributeKeys: [ 'style' ],\n\thasSupport( name ) {\n\t\treturn hasBlockSupport( name, 'filter.duotone' );\n\t},\n};\n\n/**\n * Filters registered block settings, extending attributes to include\n * the `duotone` attribute.\n *\n * @param {Object} settings Original block settings.\n *\n * @return {Object} Filtered block settings.\n */\nfunction addDuotoneAttributes( settings ) {\n\t// Previous `color.__experimentalDuotone` support flag is migrated via\n\t// block_type_metadata_settings filter in `lib/block-supports/duotone.php`.\n\tif ( ! hasBlockSupport( settings, 'filter.duotone' ) ) {\n\t\treturn settings;\n\t}\n\n\t// Allow blocks to specify their own attribute definition with default\n\t// values if needed.\n\tif ( ! settings.attributes.style ) {\n\t\tObject.assign( settings.attributes, {\n\t\t\tstyle: {\n\t\t\t\ttype: 'object',\n\t\t\t},\n\t\t} );\n\t}\n\n\treturn settings;\n}\n\nfunction useDuotoneStyles( {\n\tclientId,\n\tid: filterId,\n\tselector: duotoneSelector,\n\tattribute: duotoneAttr,\n} ) {\n\tconst duotonePalette = useMultiOriginPresets( {\n\t\tpresetSetting: 'color.duotone',\n\t\tdefaultSetting: 'color.defaultDuotone',\n\t} );\n\n\t// Possible values for duotone attribute:\n\t// 1. Array of colors - e.g. ['#000000', '#ffffff'].\n\t// 2. Variable for an existing Duotone preset - e.g. 'var:preset|duotone|green-blue' or 'var(--wp--preset--duotone--green-blue)''\n\t// 3. A CSS string - e.g. 'unset' to remove globally applied duotone.\n\tconst isCustom = Array.isArray( duotoneAttr );\n\tconst duotonePreset = isCustom\n\t\t? undefined\n\t\t: getColorsFromDuotonePreset( duotoneAttr, duotonePalette );\n\tconst isPreset = typeof duotoneAttr === 'string' && duotonePreset;\n\tconst isCSS = typeof duotoneAttr === 'string' && ! isPreset;\n\n\t// Match the structure of WP_Duotone_Gutenberg::render_duotone_support() in PHP.\n\tlet colors = null;\n\tif ( isPreset ) {\n\t\t// Array of colors.\n\t\tcolors = duotonePreset;\n\t} else if ( isCSS ) {\n\t\t// CSS filter property string (e.g. 'unset').\n\t\tcolors = duotoneAttr;\n\t} else if ( isCustom ) {\n\t\t// Array of colors.\n\t\tcolors = duotoneAttr;\n\t}\n\n\t// Build the CSS selectors to which the filter will be applied.\n\tconst selectors = duotoneSelector.split( ',' );\n\n\tconst selectorsScoped = selectors.map( ( selectorPart ) => {\n\t\t// Extra .editor-styles-wrapper specificity is needed in the editor\n\t\t// since we're not using inline styles to apply the filter. We need to\n\t\t// override duotone applied by global styles and theme.json.\n\n\t\t// Assuming the selector part is a subclass selector (not a tag name)\n\t\t// so we can prepend the filter id class. If we want to support elements\n\t\t// such as `img` or namespaces, we'll need to add a case for that here.\n\t\treturn `.${ filterId }${ selectorPart.trim() }`;\n\t} );\n\n\tconst selector = selectorsScoped.join( ', ' );\n\n\tconst isValidFilter = Array.isArray( colors ) || colors === 'unset';\n\n\tuseStyleOverride(\n\t\tisValidFilter\n\t\t\t? {\n\t\t\t\t\tcss:\n\t\t\t\t\t\tcolors !== 'unset'\n\t\t\t\t\t\t\t? getDuotoneStylesheet( selector, filterId )\n\t\t\t\t\t\t\t: getDuotoneUnsetStylesheet( selector ),\n\t\t\t\t\t__unstableType: 'presets',\n\t\t\t }\n\t\t\t: undefined\n\t);\n\tuseStyleOverride(\n\t\tisValidFilter\n\t\t\t? {\n\t\t\t\t\tassets:\n\t\t\t\t\t\tcolors !== 'unset'\n\t\t\t\t\t\t\t? getDuotoneFilter( filterId, colors )\n\t\t\t\t\t\t\t: '',\n\t\t\t\t\t__unstableType: 'svgs',\n\t\t\t }\n\t\t\t: undefined\n\t);\n\n\tconst blockElement = useBlockElement( clientId );\n\n\tuseEffect( () => {\n\t\tif ( ! isValidFilter ) return;\n\n\t\t// Safari does not always update the duotone filter when the duotone colors\n\t\t// are changed. When using Safari, force the block element to be repainted by\n\t\t// the browser to ensure any changes are reflected visually. This logic matches\n\t\t// that used on the site frontend in `block-supports/duotone.php`.\n\t\tif ( blockElement && isSafari ) {\n\t\t\tconst display = blockElement.style.display;\n\t\t\t// Switch to `inline-block` to force a repaint. In the editor, `inline-block`\n\t\t\t// is used instead of `none` to ensure that scroll position is not affected,\n\t\t\t// as `none` results in the editor scrolling to the top of the block.\n\t\t\tblockElement.style.display = 'inline-block';\n\t\t\t// Simply accessing el.offsetHeight flushes layout and style\n\t\t\t// changes in WebKit without having to wait for setTimeout.\n\t\t\t// eslint-disable-next-line no-unused-expressions\n\t\t\tblockElement.offsetHeight;\n\t\t\tblockElement.style.display = display;\n\t\t}\n\t}, [ isValidFilter, blockElement ] );\n}\n\nfunction useBlockProps( { name, style } ) {\n\tconst id = useInstanceId( useBlockProps );\n\tconst selector = useMemo( () => {\n\t\tconst blockType = getBlockType( name );\n\n\t\tif ( blockType ) {\n\t\t\t// Backwards compatibility for `supports.color.__experimentalDuotone`\n\t\t\t// is provided via the `block_type_metadata_settings` filter. If\n\t\t\t// `supports.filter.duotone` has not been set and the\n\t\t\t// experimental property has been, the experimental property\n\t\t\t// value is copied into `supports.filter.duotone`.\n\t\t\tconst duotoneSupport = getBlockSupport(\n\t\t\t\tblockType,\n\t\t\t\t'filter.duotone',\n\t\t\t\tfalse\n\t\t\t);\n\t\t\tif ( ! duotoneSupport ) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t// If the experimental duotone support was set, that value is\n\t\t\t// to be treated as a selector and requires scoping.\n\t\t\tconst experimentalDuotone = getBlockSupport(\n\t\t\t\tblockType,\n\t\t\t\t'color.__experimentalDuotone',\n\t\t\t\tfalse\n\t\t\t);\n\t\t\tif ( experimentalDuotone ) {\n\t\t\t\tconst rootSelector = getBlockCSSSelector( blockType );\n\t\t\t\treturn typeof experimentalDuotone === 'string'\n\t\t\t\t\t? scopeSelector( rootSelector, experimentalDuotone )\n\t\t\t\t\t: rootSelector;\n\t\t\t}\n\n\t\t\t// Regular filter.duotone support uses filter.duotone selectors with fallbacks.\n\t\t\treturn getBlockCSSSelector( blockType, 'filter.duotone', {\n\t\t\t\tfallback: true,\n\t\t\t} );\n\t\t}\n\t}, [ name ] );\n\n\tconst attribute = style?.color?.duotone;\n\n\tconst filterClass = `wp-duotone-${ id }`;\n\n\tconst shouldRender = selector && attribute;\n\n\tuseDuotoneStyles( {\n\t\tclientId: id,\n\t\tid: filterClass,\n\t\tselector,\n\t\tattribute,\n\t} );\n\n\treturn {\n\t\tclassName: shouldRender ? filterClass : '',\n\t};\n}\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/editor/duotone/add-attributes',\n\taddDuotoneAttributes\n);\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,MAAM,QAAQ,QAAQ;AAC/B,OAAOC,WAAW,MAAM,sBAAsB;;AAE9C;AACA;AACA;AACA,SACCC,eAAe,EACfC,YAAY,EACZC,eAAe,QACT,mBAAmB;AAC1B,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,SAAS,QAAQ,kBAAkB;AAC5C,SAASC,OAAO,EAAEC,SAAS,QAAQ,oBAAoB;;AAEvD;AACA;AACA;AACA,SACCC,aAAa,EACbC,iBAAiB,EACjBC,4BAA4B,IAAIC,cAAc,EAC9CC,WAAW,QACL,eAAe;AACtB,SACCC,gBAAgB,EAChBC,oBAAoB,EACpBC,yBAAyB,QACnB,6BAA6B;AACpC,SAASC,mBAAmB,QAAQ,oDAAoD;AACxF,SAASC,aAAa,QAAQ,mCAAmC;AACjE,SAASC,gBAAgB,EAAEC,gBAAgB,QAAQ,SAAS;AAC5D,SAASC,OAAO,IAAIC,kBAAkB,QAAQ,2CAA2C;AACzF,SAASC,mBAAmB,QAAQ,kCAAkC;AACtE,SAASC,yBAAyB,IAAIC,eAAe,QAAQ,yDAAyD;AAEtH,MAAMC,WAAW,GAAG,EAAE;;AAEtB;AACA;AACA;AACA;AACA,MAAMC,QAAQ,GACbC,M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MAAM6B,YAAY,GAAG3B,QAAQ,IAAIE,SAAS;EAE1CN,gBAAgB,CAAE;IACjBC,QAAQ,EAAEC,EAAE;IACZA,EAAE,EAAE4B,WAAW;IACf1B,QAAQ;IACRE;EACD,CAAE,CAAC;EAEH,OAAO;IACN0B,SAAS,EAAED,YAAY,GAAGD,WAAW,GAAG;EACzC,CAAC;AACF;AAEAjH,SAAS,CACR,0BAA0B,EAC1B,oCAAoC,EACpC8E,oBACD,CAAC"}
1
+ {"version":3,"names":["extend","namesPlugin","getBlockSupport","getBlockType","hasBlockSupport","useInstanceId","addFilter","useMemo","useEffect","BlockControls","InspectorControls","__experimentalDuotoneControl","DuotoneControl","useSettings","getDuotoneFilter","getDuotoneStylesheet","getDuotoneUnsetStylesheet","getBlockCSSSelector","scopeSelector","useBlockSettings","useStyleOverride","default","StylesFiltersPanel","useBlockEditingMode","__unstableUseBlockElement","useBlockElement","EMPTY_ARRAY","isSafari","window","navigator","userAgent","includes","useMultiOriginPresets","presetSetting","defaultSetting","enableDefault","userPresets","themePresets","defaultPresets","getColorsFromDuotonePreset","duotone","duotonePalette","preset","find","slug","colors","undefined","getDuotonePresetFromColors","Array","isArray","duotonePreset","every","val","index","DuotonePanelPure","style","setAttributes","name","duotoneStyle","color","settings","blockEditingMode","colorPalette","enableCustomColors","enableCustomDuotone","disableCustomColors","disableCustomDuotone","length","duotonePresetOrColors","createElement","Fragment","group","value","filter","onChange","newDuotone","newStyle","__experimentalShareWithChildBlocks","maybePreset","shareWithChildBlocks","edit","useBlockProps","attributeKeys","hasSupport","addDuotoneAttributes","attributes","Object","assign","type","useDuotoneStyles","clientId","id","filterId","selector","duotoneSelector","attribute","duotoneAttr","isCustom","isPreset","isCSS","selectors","split","selectorsScoped","map","selectorPart","trim","join","isValidFilter","css","__unstableType","assets","blockElement","display","offsetHeight","blockType","duotoneSupport","experimentalDuotone","rootSelector","fallback","filterClass","shouldRender","className"],"sources":["@wordpress/block-editor/src/hooks/duotone.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { extend } from 'colord';\nimport namesPlugin from 'colord/plugins/names';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tgetBlockSupport,\n\tgetBlockType,\n\thasBlockSupport,\n} from '@wordpress/blocks';\nimport { useInstanceId } from '@wordpress/compose';\nimport { addFilter } from '@wordpress/hooks';\nimport { useMemo, useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport {\n\tBlockControls,\n\tInspectorControls,\n\t__experimentalDuotoneControl as DuotoneControl,\n\tuseSettings,\n} from '../components';\nimport {\n\tgetDuotoneFilter,\n\tgetDuotoneStylesheet,\n\tgetDuotoneUnsetStylesheet,\n} from '../components/duotone/utils';\nimport { getBlockCSSSelector } from '../components/global-styles/get-block-css-selector';\nimport { scopeSelector } from '../components/global-styles/utils';\nimport { useBlockSettings, useStyleOverride } from './utils';\nimport { default as StylesFiltersPanel } from '../components/global-styles/filters-panel';\nimport { useBlockEditingMode } from '../components/block-editing-mode';\nimport { __unstableUseBlockElement as useBlockElement } from '../components/block-list/use-block-props/use-block-refs';\n\nconst EMPTY_ARRAY = [];\n\n// Safari does not always update the duotone filter when the duotone colors\n// are changed. This browser check is later used to force a re-render of the block\n// element to ensure the duotone filter is updated. The check is included at the\n// root of this file as it only needs to be run once per page load.\nconst isSafari =\n\twindow?.navigator.userAgent &&\n\twindow.navigator.userAgent.includes( 'Safari' ) &&\n\t! window.navigator.userAgent.includes( 'Chrome' ) &&\n\t! window.navigator.userAgent.includes( 'Chromium' );\n\nextend( [ namesPlugin ] );\n\nfunction useMultiOriginPresets( { presetSetting, defaultSetting } ) {\n\tconst [ enableDefault, userPresets, themePresets, defaultPresets ] =\n\t\tuseSettings(\n\t\t\tdefaultSetting,\n\t\t\t`${ presetSetting }.custom`,\n\t\t\t`${ presetSetting }.theme`,\n\t\t\t`${ presetSetting }.default`\n\t\t);\n\treturn useMemo(\n\t\t() => [\n\t\t\t...( userPresets || EMPTY_ARRAY ),\n\t\t\t...( themePresets || EMPTY_ARRAY ),\n\t\t\t...( ( enableDefault && defaultPresets ) || EMPTY_ARRAY ),\n\t\t],\n\t\t[ enableDefault, userPresets, themePresets, defaultPresets ]\n\t);\n}\n\nexport function getColorsFromDuotonePreset( duotone, duotonePalette ) {\n\tif ( ! duotone ) {\n\t\treturn;\n\t}\n\tconst preset = duotonePalette?.find( ( { slug } ) => {\n\t\treturn duotone === `var:preset|duotone|${ slug }`;\n\t} );\n\n\treturn preset ? preset.colors : undefined;\n}\n\nexport function getDuotonePresetFromColors( colors, duotonePalette ) {\n\tif ( ! colors || ! Array.isArray( colors ) ) {\n\t\treturn;\n\t}\n\n\tconst preset = duotonePalette?.find( ( duotonePreset ) => {\n\t\treturn duotonePreset?.colors?.every(\n\t\t\t( val, index ) => val === colors[ index ]\n\t\t);\n\t} );\n\n\treturn preset ? `var:preset|duotone|${ preset.slug }` : undefined;\n}\n\nfunction DuotonePanelPure( { style, setAttributes, name } ) {\n\tconst duotoneStyle = style?.color?.duotone;\n\tconst settings = useBlockSettings( name );\n\tconst blockEditingMode = useBlockEditingMode();\n\n\tconst duotonePalette = useMultiOriginPresets( {\n\t\tpresetSetting: 'color.duotone',\n\t\tdefaultSetting: 'color.defaultDuotone',\n\t} );\n\tconst colorPalette = useMultiOriginPresets( {\n\t\tpresetSetting: 'color.palette',\n\t\tdefaultSetting: 'color.defaultPalette',\n\t} );\n\tconst [ enableCustomColors, enableCustomDuotone ] = useSettings(\n\t\t'color.custom',\n\t\t'color.customDuotone'\n\t);\n\tconst disableCustomColors = ! enableCustomColors;\n\tconst disableCustomDuotone =\n\t\t! enableCustomDuotone ||\n\t\t( colorPalette?.length === 0 && disableCustomColors );\n\n\tif ( duotonePalette?.length === 0 && disableCustomDuotone ) {\n\t\treturn null;\n\t}\n\n\tif ( blockEditingMode !== 'default' ) {\n\t\treturn null;\n\t}\n\n\tconst duotonePresetOrColors = ! Array.isArray( duotoneStyle )\n\t\t? getColorsFromDuotonePreset( duotoneStyle, duotonePalette )\n\t\t: duotoneStyle;\n\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls group=\"filter\">\n\t\t\t\t<StylesFiltersPanel\n\t\t\t\t\tvalue={ { filter: { duotone: duotonePresetOrColors } } }\n\t\t\t\t\tonChange={ ( newDuotone ) => {\n\t\t\t\t\t\tconst newStyle = {\n\t\t\t\t\t\t\t...style,\n\t\t\t\t\t\t\tcolor: {\n\t\t\t\t\t\t\t\t...newDuotone?.filter,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t};\n\t\t\t\t\t\tsetAttributes( { style: newStyle } );\n\t\t\t\t\t} }\n\t\t\t\t\tsettings={ settings }\n\t\t\t\t/>\n\t\t\t</InspectorControls>\n\t\t\t<BlockControls group=\"block\" __experimentalShareWithChildBlocks>\n\t\t\t\t<DuotoneControl\n\t\t\t\t\tduotonePalette={ duotonePalette }\n\t\t\t\t\tcolorPalette={ colorPalette }\n\t\t\t\t\tdisableCustomDuotone={ disableCustomDuotone }\n\t\t\t\t\tdisableCustomColors={ disableCustomColors }\n\t\t\t\t\tvalue={ duotonePresetOrColors }\n\t\t\t\t\tonChange={ ( newDuotone ) => {\n\t\t\t\t\t\tconst maybePreset = getDuotonePresetFromColors(\n\t\t\t\t\t\t\tnewDuotone,\n\t\t\t\t\t\t\tduotonePalette\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tconst newStyle = {\n\t\t\t\t\t\t\t...style,\n\t\t\t\t\t\t\tcolor: {\n\t\t\t\t\t\t\t\t...style?.color,\n\t\t\t\t\t\t\t\tduotone: maybePreset ?? newDuotone, // use preset or fallback to custom colors.\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t};\n\t\t\t\t\t\tsetAttributes( { style: newStyle } );\n\t\t\t\t\t} }\n\t\t\t\t\tsettings={ settings }\n\t\t\t\t/>\n\t\t\t</BlockControls>\n\t\t</>\n\t);\n}\n\nexport default {\n\tshareWithChildBlocks: true,\n\tedit: DuotonePanelPure,\n\tuseBlockProps,\n\tattributeKeys: [ 'style' ],\n\thasSupport( name ) {\n\t\treturn hasBlockSupport( name, 'filter.duotone' );\n\t},\n};\n\n/**\n * Filters registered block settings, extending attributes to include\n * the `duotone` attribute.\n *\n * @param {Object} settings Original block settings.\n *\n * @return {Object} Filtered block settings.\n */\nfunction addDuotoneAttributes( settings ) {\n\t// Previous `color.__experimentalDuotone` support flag is migrated via\n\t// block_type_metadata_settings filter in `lib/block-supports/duotone.php`.\n\tif ( ! hasBlockSupport( settings, 'filter.duotone' ) ) {\n\t\treturn settings;\n\t}\n\n\t// Allow blocks to specify their own attribute definition with default\n\t// values if needed.\n\tif ( ! settings.attributes.style ) {\n\t\tObject.assign( settings.attributes, {\n\t\t\tstyle: {\n\t\t\t\ttype: 'object',\n\t\t\t},\n\t\t} );\n\t}\n\n\treturn settings;\n}\n\nfunction useDuotoneStyles( {\n\tclientId,\n\tid: filterId,\n\tselector: duotoneSelector,\n\tattribute: duotoneAttr,\n} ) {\n\tconst duotonePalette = useMultiOriginPresets( {\n\t\tpresetSetting: 'color.duotone',\n\t\tdefaultSetting: 'color.defaultDuotone',\n\t} );\n\n\t// Possible values for duotone attribute:\n\t// 1. Array of colors - e.g. ['#000000', '#ffffff'].\n\t// 2. Variable for an existing Duotone preset - e.g. 'var:preset|duotone|green-blue' or 'var(--wp--preset--duotone--green-blue)''\n\t// 3. A CSS string - e.g. 'unset' to remove globally applied duotone.\n\tconst isCustom = Array.isArray( duotoneAttr );\n\tconst duotonePreset = isCustom\n\t\t? undefined\n\t\t: getColorsFromDuotonePreset( duotoneAttr, duotonePalette );\n\tconst isPreset = typeof duotoneAttr === 'string' && duotonePreset;\n\tconst isCSS = typeof duotoneAttr === 'string' && ! isPreset;\n\n\t// Match the structure of WP_Duotone_Gutenberg::render_duotone_support() in PHP.\n\tlet colors = null;\n\tif ( isPreset ) {\n\t\t// Array of colors.\n\t\tcolors = duotonePreset;\n\t} else if ( isCSS ) {\n\t\t// CSS filter property string (e.g. 'unset').\n\t\tcolors = duotoneAttr;\n\t} else if ( isCustom ) {\n\t\t// Array of colors.\n\t\tcolors = duotoneAttr;\n\t}\n\n\t// Build the CSS selectors to which the filter will be applied.\n\tconst selectors = duotoneSelector.split( ',' );\n\n\tconst selectorsScoped = selectors.map( ( selectorPart ) => {\n\t\t// Extra .editor-styles-wrapper specificity is needed in the editor\n\t\t// since we're not using inline styles to apply the filter. We need to\n\t\t// override duotone applied by global styles and theme.json.\n\n\t\t// Assuming the selector part is a subclass selector (not a tag name)\n\t\t// so we can prepend the filter id class. If we want to support elements\n\t\t// such as `img` or namespaces, we'll need to add a case for that here.\n\t\treturn `.${ filterId }${ selectorPart.trim() }`;\n\t} );\n\n\tconst selector = selectorsScoped.join( ', ' );\n\n\tconst isValidFilter = Array.isArray( colors ) || colors === 'unset';\n\n\tuseStyleOverride(\n\t\tisValidFilter\n\t\t\t? {\n\t\t\t\t\tcss:\n\t\t\t\t\t\tcolors !== 'unset'\n\t\t\t\t\t\t\t? getDuotoneStylesheet( selector, filterId )\n\t\t\t\t\t\t\t: getDuotoneUnsetStylesheet( selector ),\n\t\t\t\t\t__unstableType: 'presets',\n\t\t\t }\n\t\t\t: undefined\n\t);\n\tuseStyleOverride(\n\t\tisValidFilter\n\t\t\t? {\n\t\t\t\t\tassets:\n\t\t\t\t\t\tcolors !== 'unset'\n\t\t\t\t\t\t\t? getDuotoneFilter( filterId, colors )\n\t\t\t\t\t\t\t: '',\n\t\t\t\t\t__unstableType: 'svgs',\n\t\t\t }\n\t\t\t: undefined\n\t);\n\n\tconst blockElement = useBlockElement( clientId );\n\n\tuseEffect( () => {\n\t\tif ( ! isValidFilter ) return;\n\n\t\t// Safari does not always update the duotone filter when the duotone colors\n\t\t// are changed. When using Safari, force the block element to be repainted by\n\t\t// the browser to ensure any changes are reflected visually. This logic matches\n\t\t// that used on the site frontend in `block-supports/duotone.php`.\n\t\tif ( blockElement && isSafari ) {\n\t\t\tconst display = blockElement.style.display;\n\t\t\t// Switch to `inline-block` to force a repaint. In the editor, `inline-block`\n\t\t\t// is used instead of `none` to ensure that scroll position is not affected,\n\t\t\t// as `none` results in the editor scrolling to the top of the block.\n\t\t\tblockElement.style.display = 'inline-block';\n\t\t\t// Simply accessing el.offsetHeight flushes layout and style\n\t\t\t// changes in WebKit without having to wait for setTimeout.\n\t\t\t// eslint-disable-next-line no-unused-expressions\n\t\t\tblockElement.offsetHeight;\n\t\t\tblockElement.style.display = display;\n\t\t}\n\t}, [ isValidFilter, blockElement ] );\n}\n\nfunction useBlockProps( { name, style } ) {\n\tconst id = useInstanceId( useBlockProps );\n\tconst selector = useMemo( () => {\n\t\tconst blockType = getBlockType( name );\n\n\t\tif ( blockType ) {\n\t\t\t// Backwards compatibility for `supports.color.__experimentalDuotone`\n\t\t\t// is provided via the `block_type_metadata_settings` filter. If\n\t\t\t// `supports.filter.duotone` has not been set and the\n\t\t\t// experimental property has been, the experimental property\n\t\t\t// value is copied into `supports.filter.duotone`.\n\t\t\tconst duotoneSupport = getBlockSupport(\n\t\t\t\tblockType,\n\t\t\t\t'filter.duotone',\n\t\t\t\tfalse\n\t\t\t);\n\t\t\tif ( ! duotoneSupport ) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t// If the experimental duotone support was set, that value is\n\t\t\t// to be treated as a selector and requires scoping.\n\t\t\tconst experimentalDuotone = getBlockSupport(\n\t\t\t\tblockType,\n\t\t\t\t'color.__experimentalDuotone',\n\t\t\t\tfalse\n\t\t\t);\n\t\t\tif ( experimentalDuotone ) {\n\t\t\t\tconst rootSelector = getBlockCSSSelector( blockType );\n\t\t\t\treturn typeof experimentalDuotone === 'string'\n\t\t\t\t\t? scopeSelector( rootSelector, experimentalDuotone )\n\t\t\t\t\t: rootSelector;\n\t\t\t}\n\n\t\t\t// Regular filter.duotone support uses filter.duotone selectors with fallbacks.\n\t\t\treturn getBlockCSSSelector( blockType, 'filter.duotone', {\n\t\t\t\tfallback: true,\n\t\t\t} );\n\t\t}\n\t}, [ name ] );\n\n\tconst attribute = style?.color?.duotone;\n\n\tconst filterClass = `wp-duotone-${ id }`;\n\n\tconst shouldRender = selector && attribute;\n\n\tuseDuotoneStyles( {\n\t\tclientId: id,\n\t\tid: filterClass,\n\t\tselector,\n\t\tattribute,\n\t} );\n\n\treturn {\n\t\tclassName: shouldRender ? filterClass : '',\n\t};\n}\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/editor/duotone/add-attributes',\n\taddDuotoneAttributes\n);\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,MAAM,QAAQ,QAAQ;AAC/B,OAAOC,WAAW,MAAM,sBAAsB;;AAE9C;AACA;AACA;AACA,SACCC,eAAe,EACfC,YAAY,EACZC,eAAe,QACT,mBAAmB;AAC1B,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,SAAS,QAAQ,kBAAkB;AAC5C,SAASC,OAAO,EAAEC,SAAS,QAAQ,oBAAoB;;AAEvD;AACA;AACA;AACA,SACCC,aAAa,EACbC,iBAAiB,EACjBC,4BAA4B,IAAIC,cAAc,EAC9CC,WAAW,QACL,eAAe;AACtB,SACCC,gBAAgB,EAChBC,oBAAoB,EACpBC,yBAAyB,QACnB,6BAA6B;AACpC,SAASC,mBAAmB,QAAQ,oDAAoD;AACxF,SAASC,aAAa,QAAQ,mCAAmC;AACjE,SAASC,gBAAgB,EAAEC,gBAAgB,QAAQ,SAAS;AAC5D,SAASC,OAAO,IAAIC,kBAAkB,QAAQ,2CAA2C;AACzF,SAASC,mBAAmB,QAAQ,kCAAkC;AACtE,SAASC,yBAAyB,IAAIC,eAAe,QAAQ,yDAAyD;AAEtH,MAAMC,WAAW,GAAG,EAAE;;AAEtB;AACA;AACA;AACA;AACA,MAAMC,QAAQ,GACbC,MAAM,EAAEC,SAAS,CAACC,SAAS,IAC3BF,MAAM,CAACC,SAAS,CAACC,SAAS,CAACC,QAAQ,CAAE,QAAS,CAAC,IAC/C,CAAEH,MAAM,CAACC,SAAS,CAACC,SAAS,CAACC,QAAQ,CAAE,QAAS,CAAC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