@wordpress/block-editor 12.24.0 → 12.26.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 (973) hide show
  1. package/CHANGELOG.md +11 -3
  2. package/README.md +7 -1
  3. package/build/components/alignment-control/ui.js +3 -1
  4. package/build/components/alignment-control/ui.js.map +1 -1
  5. package/build/components/block-actions/index.js +4 -2
  6. package/build/components/block-actions/index.js.map +1 -1
  7. package/build/components/block-alignment-control/ui.js +2 -2
  8. package/build/components/block-alignment-control/ui.js.map +1 -1
  9. package/build/components/block-card/index.js +2 -2
  10. package/build/components/block-card/index.js.map +1 -1
  11. package/build/components/block-compare/index.js +2 -2
  12. package/build/components/block-compare/index.js.map +1 -1
  13. package/build/components/block-edit/edit.js +2 -2
  14. package/build/components/block-edit/edit.js.map +1 -1
  15. package/build/components/block-icon/index.js +2 -2
  16. package/build/components/block-icon/index.js.map +1 -1
  17. package/build/components/block-list/block.js +4 -13
  18. package/build/components/block-list/block.js.map +1 -1
  19. package/build/components/block-list/block.native.js +2 -2
  20. package/build/components/block-list/block.native.js.map +1 -1
  21. package/build/components/block-list/index.js +6 -5
  22. package/build/components/block-list/index.js.map +1 -1
  23. package/build/components/block-list/index.native.js +1 -9
  24. package/build/components/block-list/index.native.js.map +1 -1
  25. package/build/components/block-list/use-block-props/index.js +11 -8
  26. package/build/components/block-list/use-block-props/index.js.map +1 -1
  27. package/build/components/block-list/use-block-props/use-block-refs.js +17 -46
  28. package/build/components/block-list/use-block-props/use-block-refs.js.map +1 -1
  29. package/build/components/block-list/use-block-props/use-is-hovered.js +10 -14
  30. package/build/components/block-list/use-block-props/use-is-hovered.js.map +1 -1
  31. package/build/components/block-list/use-block-props/use-scroll-into-view.js +44 -0
  32. package/build/components/block-list/use-block-props/use-scroll-into-view.js.map +1 -0
  33. package/build/components/block-list-appender/index.js +2 -2
  34. package/build/components/block-list-appender/index.js.map +1 -1
  35. package/build/components/block-mover/button.js +2 -2
  36. package/build/components/block-mover/button.js.map +1 -1
  37. package/build/components/block-mover/index.js +2 -2
  38. package/build/components/block-mover/index.js.map +1 -1
  39. package/build/components/block-mover/index.native.js +3 -1
  40. package/build/components/block-mover/index.native.js.map +1 -1
  41. package/build/components/block-patterns-list/index.js +26 -5
  42. package/build/components/block-patterns-list/index.js.map +1 -1
  43. package/build/components/block-popover/cover.js +9 -6
  44. package/build/components/block-popover/cover.js.map +1 -1
  45. package/build/components/block-popover/inbetween.js +2 -2
  46. package/build/components/block-popover/inbetween.js.map +1 -1
  47. package/build/components/block-popover/index.js +22 -4
  48. package/build/components/block-popover/index.js.map +1 -1
  49. package/build/components/block-preview/index.js +2 -2
  50. package/build/components/block-preview/index.js.map +1 -1
  51. package/build/components/block-settings-menu/block-settings-dropdown.js +8 -30
  52. package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  53. package/build/components/block-settings-menu-controls/index.js +10 -7
  54. package/build/components/block-settings-menu-controls/index.js.map +1 -1
  55. package/build/components/block-styles/index.js +2 -2
  56. package/build/components/block-styles/index.js.map +1 -1
  57. package/build/components/block-switcher/pattern-transformations-menu.js +3 -1
  58. package/build/components/block-switcher/pattern-transformations-menu.js.map +1 -1
  59. package/build/components/block-switcher/use-transformed-patterns.js +6 -2
  60. package/build/components/block-switcher/use-transformed-patterns.js.map +1 -1
  61. package/build/components/block-switcher/utils.js +15 -5
  62. package/build/components/block-switcher/utils.js.map +1 -1
  63. package/build/components/block-toolbar/index.js +3 -3
  64. package/build/components/block-toolbar/index.js.map +1 -1
  65. package/build/components/block-toolbar/use-has-block-toolbar.js +14 -9
  66. package/build/components/block-toolbar/use-has-block-toolbar.js.map +1 -1
  67. package/build/components/block-tools/block-selection-button.js +2 -2
  68. package/build/components/block-tools/block-selection-button.js.map +1 -1
  69. package/build/components/block-tools/block-toolbar-breadcrumb.js +4 -4
  70. package/build/components/block-tools/block-toolbar-breadcrumb.js.map +1 -1
  71. package/build/components/block-tools/block-toolbar-popover.js +2 -2
  72. package/build/components/block-tools/block-toolbar-popover.js.map +1 -1
  73. package/build/components/block-tools/empty-block-inserter.js +2 -2
  74. package/build/components/block-tools/empty-block-inserter.js.map +1 -1
  75. package/build/components/block-tools/index.js +23 -2
  76. package/build/components/block-tools/index.js.map +1 -1
  77. package/build/components/block-tools/insertion-point.js +4 -4
  78. package/build/components/block-tools/insertion-point.js.map +1 -1
  79. package/build/components/block-tools/use-show-block-tools.js +2 -5
  80. package/build/components/block-tools/use-show-block-tools.js.map +1 -1
  81. package/build/components/block-tools/zoom-out-mode-inserters.js +68 -20
  82. package/build/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
  83. package/build/components/block-variation-picker/index.js +5 -4
  84. package/build/components/block-variation-picker/index.js.map +1 -1
  85. package/build/components/block-variation-transforms/index.js +3 -1
  86. package/build/components/block-variation-transforms/index.js.map +1 -1
  87. package/build/components/button-block-appender/index.js +2 -2
  88. package/build/components/button-block-appender/index.js.map +1 -1
  89. package/build/components/child-layout-control/index.js +2 -2
  90. package/build/components/child-layout-control/index.js.map +1 -1
  91. package/build/components/colors-gradients/control.js +3 -3
  92. package/build/components/colors-gradients/control.js.map +1 -1
  93. package/build/components/colors-gradients/dropdown.js +2 -2
  94. package/build/components/colors-gradients/dropdown.js.map +1 -1
  95. package/build/components/colors-gradients/panel-color-gradient-settings.js +2 -2
  96. package/build/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
  97. package/build/components/convert-to-group-buttons/index.js +6 -0
  98. package/build/components/convert-to-group-buttons/index.js.map +1 -1
  99. package/build/components/default-block-appender/index.js +2 -2
  100. package/build/components/default-block-appender/index.js.map +1 -1
  101. package/build/components/dimensions-tool/aspect-ratio-tool.js +30 -36
  102. package/build/components/dimensions-tool/aspect-ratio-tool.js.map +1 -1
  103. package/build/components/floating-toolbar/index.native.js +9 -5
  104. package/build/components/floating-toolbar/index.native.js.map +1 -1
  105. package/build/components/global-styles/background-panel.js +4 -4
  106. package/build/components/global-styles/background-panel.js.map +1 -1
  107. package/build/components/global-styles/color-panel.js +6 -4
  108. package/build/components/global-styles/color-panel.js.map +1 -1
  109. package/build/components/global-styles/dimensions-panel.js +20 -4
  110. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  111. package/build/components/global-styles/filters-panel.js +2 -2
  112. package/build/components/global-styles/filters-panel.js.map +1 -1
  113. package/build/components/global-styles/hooks.js +3 -2
  114. package/build/components/global-styles/hooks.js.map +1 -1
  115. package/build/components/global-styles/shadow-panel-components.js +4 -4
  116. package/build/components/global-styles/shadow-panel-components.js.map +1 -1
  117. package/build/components/global-styles/typography-panel.js +23 -23
  118. package/build/components/global-styles/typography-panel.js.map +1 -1
  119. package/build/components/global-styles/use-global-styles-output.js +149 -132
  120. package/build/components/global-styles/use-global-styles-output.js.map +1 -1
  121. package/build/components/global-styles/utils.js +45 -0
  122. package/build/components/global-styles/utils.js.map +1 -1
  123. package/build/components/grid-visualizer/grid-item-resizer.js +141 -24
  124. package/build/components/grid-visualizer/grid-item-resizer.js.map +1 -1
  125. package/build/components/grid-visualizer/grid-visualizer.js +11 -5
  126. package/build/components/grid-visualizer/grid-visualizer.js.map +1 -1
  127. package/build/components/iframe/index.js +69 -30
  128. package/build/components/iframe/index.js.map +1 -1
  129. package/build/components/image-editor/aspect-ratio-dropdown.js +53 -36
  130. package/build/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
  131. package/build/components/image-editor/cropper.js +2 -2
  132. package/build/components/image-editor/cropper.js.map +1 -1
  133. package/build/components/image-editor/index.js +1 -1
  134. package/build/components/image-editor/index.js.map +1 -1
  135. package/build/components/index.js +8 -0
  136. package/build/components/index.js.map +1 -1
  137. package/build/components/inner-blocks/button-block-appender.js +2 -2
  138. package/build/components/inner-blocks/button-block-appender.js.map +1 -1
  139. package/build/components/inner-blocks/index.js +25 -10
  140. package/build/components/inner-blocks/index.js.map +1 -1
  141. package/build/components/inserter/block-patterns-explorer/pattern-list.js +1 -1
  142. package/build/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
  143. package/build/components/inserter/block-patterns-tab/index.js +20 -30
  144. package/build/components/inserter/block-patterns-tab/index.js.map +1 -1
  145. package/build/components/inserter/block-patterns-tab/pattern-category-previews.js +1 -1
  146. package/build/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
  147. package/build/components/inserter/block-types-tab.js +9 -3
  148. package/build/components/inserter/block-types-tab.js.map +1 -1
  149. package/build/components/inserter/category-tabs/index.js +56 -0
  150. package/build/components/inserter/category-tabs/index.js.map +1 -0
  151. package/build/components/inserter/hooks/use-insertion-point.js +11 -2
  152. package/build/components/inserter/hooks/use-insertion-point.js.map +1 -1
  153. package/build/components/inserter/hooks/use-patterns-state.js +12 -5
  154. package/build/components/inserter/hooks/use-patterns-state.js.map +1 -1
  155. package/build/components/inserter/index.js +2 -2
  156. package/build/components/inserter/index.js.map +1 -1
  157. package/build/components/inserter/library.js +8 -2
  158. package/build/components/inserter/library.js.map +1 -1
  159. package/build/components/inserter/media-tab/index.js +2 -2
  160. package/build/components/inserter/media-tab/index.js.map +1 -1
  161. package/build/components/inserter/media-tab/media-panel.js +0 -25
  162. package/build/components/inserter/media-tab/media-panel.js.map +1 -1
  163. package/build/components/inserter/media-tab/media-preview.js +15 -5
  164. package/build/components/inserter/media-tab/media-preview.js.map +1 -1
  165. package/build/components/inserter/media-tab/media-tab.js +15 -29
  166. package/build/components/inserter/media-tab/media-tab.js.map +1 -1
  167. package/build/components/inserter/menu.js +115 -109
  168. package/build/components/inserter/menu.js.map +1 -1
  169. package/build/components/inserter/quick-inserter.js +2 -2
  170. package/build/components/inserter/quick-inserter.js.map +1 -1
  171. package/build/components/inserter/tabs.js +23 -11
  172. package/build/components/inserter/tabs.js.map +1 -1
  173. package/build/components/inserter-list-item/index.js +3 -3
  174. package/build/components/inserter-list-item/index.js.map +1 -1
  175. package/build/components/keyboard-shortcuts/index.js +9 -0
  176. package/build/components/keyboard-shortcuts/index.js.map +1 -1
  177. package/build/components/line-height-control/index.js +6 -2
  178. package/build/components/line-height-control/index.js.map +1 -1
  179. package/build/components/link-control/index.js +2 -2
  180. package/build/components/link-control/index.js.map +1 -1
  181. package/build/components/link-control/link-preview.js +3 -3
  182. package/build/components/link-control/link-preview.js.map +1 -1
  183. package/build/components/link-control/search-item.js +9 -3
  184. package/build/components/link-control/search-item.js.map +1 -1
  185. package/build/components/link-control/search-results.js +2 -2
  186. package/build/components/link-control/search-results.js.map +1 -1
  187. package/build/components/list-view/block-contents.js +2 -2
  188. package/build/components/list-view/block-contents.js.map +1 -1
  189. package/build/components/list-view/block-select-button.js +15 -172
  190. package/build/components/list-view/block-select-button.js.map +1 -1
  191. package/build/components/list-view/block.js +196 -21
  192. package/build/components/list-view/block.js.map +1 -1
  193. package/build/components/list-view/drop-indicator.js +3 -3
  194. package/build/components/list-view/drop-indicator.js.map +1 -1
  195. package/build/components/list-view/index.js +3 -3
  196. package/build/components/list-view/index.js.map +1 -1
  197. package/build/components/list-view/leaf.js +2 -2
  198. package/build/components/list-view/leaf.js.map +1 -1
  199. package/build/components/list-view/use-list-view-drop-zone.js +1 -1
  200. package/build/components/list-view/use-list-view-drop-zone.js.map +1 -1
  201. package/build/components/list-view/utils.js +3 -1
  202. package/build/components/list-view/utils.js.map +1 -1
  203. package/build/components/media-placeholder/index.js +7 -7
  204. package/build/components/media-placeholder/index.js.map +1 -1
  205. package/build/components/media-replace-flow/index.js +2 -2
  206. package/build/components/media-replace-flow/index.js.map +1 -1
  207. package/build/components/navigable-toolbar/index.js +3 -1
  208. package/build/components/navigable-toolbar/index.js.map +1 -1
  209. package/build/components/plain-text/index.js +2 -2
  210. package/build/components/plain-text/index.js.map +1 -1
  211. package/build/components/provider/block-refs-provider.js +3 -4
  212. package/build/components/provider/block-refs-provider.js.map +1 -1
  213. package/build/components/provider/use-block-sync.js +10 -1
  214. package/build/components/provider/use-block-sync.js.map +1 -1
  215. package/build/components/responsive-block-control/index.js +2 -2
  216. package/build/components/responsive-block-control/index.js.map +1 -1
  217. package/build/components/rich-text/event-listeners/before-input-rules.js +93 -0
  218. package/build/components/rich-text/event-listeners/before-input-rules.js.map +1 -0
  219. package/build/components/rich-text/event-listeners/delete.js +58 -0
  220. package/build/components/rich-text/event-listeners/delete.js.map +1 -0
  221. package/build/components/rich-text/event-listeners/enter.js +89 -0
  222. package/build/components/rich-text/event-listeners/enter.js.map +1 -0
  223. package/build/components/rich-text/event-listeners/firefox-compat.js +36 -0
  224. package/build/components/rich-text/event-listeners/firefox-compat.js.map +1 -0
  225. package/build/components/rich-text/event-listeners/index.js +44 -0
  226. package/build/components/rich-text/event-listeners/index.js.map +1 -0
  227. package/build/components/rich-text/event-listeners/input-events.js +22 -0
  228. package/build/components/rich-text/event-listeners/input-events.js.map +1 -0
  229. package/build/components/rich-text/event-listeners/input-rules.js +135 -0
  230. package/build/components/rich-text/event-listeners/input-rules.js.map +1 -0
  231. package/build/components/rich-text/event-listeners/insert-replacement-text.js +33 -0
  232. package/build/components/rich-text/event-listeners/insert-replacement-text.js.map +1 -0
  233. package/build/components/rich-text/event-listeners/paste-handler.js +126 -0
  234. package/build/components/rich-text/event-listeners/paste-handler.js.map +1 -0
  235. package/build/components/rich-text/event-listeners/remove-browser-shortcuts.js +27 -0
  236. package/build/components/rich-text/event-listeners/remove-browser-shortcuts.js.map +1 -0
  237. package/build/components/rich-text/event-listeners/shortcuts.js +22 -0
  238. package/build/components/rich-text/event-listeners/shortcuts.js.map +1 -0
  239. package/build/components/rich-text/event-listeners/undo-automatic-change.js +51 -0
  240. package/build/components/rich-text/event-listeners/undo-automatic-change.js.map +1 -0
  241. package/build/components/rich-text/format-toolbar/index.js +2 -2
  242. package/build/components/rich-text/format-toolbar/index.js.map +1 -1
  243. package/build/components/rich-text/index.js +20 -33
  244. package/build/components/rich-text/index.js.map +1 -1
  245. package/build/components/rich-text/index.native.js +15 -5
  246. package/build/components/rich-text/index.native.js.map +1 -1
  247. package/build/components/rich-text/multiline.js +36 -4
  248. package/build/components/rich-text/multiline.js.map +1 -1
  249. package/build/components/rich-text/native/index.native.js +12 -0
  250. package/build/components/rich-text/native/index.native.js.map +1 -1
  251. package/build/components/rich-text/use-format-types.js +8 -4
  252. package/build/components/rich-text/use-format-types.js.map +1 -1
  253. package/build/components/segmented-text-control/index.js +62 -0
  254. package/build/components/segmented-text-control/index.js.map +1 -0
  255. package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js +16 -2
  256. package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
  257. package/build/components/text-alignment-control/index.js +76 -0
  258. package/build/components/text-alignment-control/index.js.map +1 -0
  259. package/build/components/text-decoration-control/index.js +22 -26
  260. package/build/components/text-decoration-control/index.js.map +1 -1
  261. package/build/components/text-transform-control/index.js +19 -23
  262. package/build/components/text-transform-control/index.js.map +1 -1
  263. package/build/components/url-input/index.js +4 -4
  264. package/build/components/url-input/index.js.map +1 -1
  265. package/build/components/url-popover/link-editor.js +2 -2
  266. package/build/components/url-popover/link-editor.js.map +1 -1
  267. package/build/components/url-popover/link-viewer-url.js +2 -2
  268. package/build/components/url-popover/link-viewer-url.js.map +1 -1
  269. package/build/components/url-popover/link-viewer.js +2 -2
  270. package/build/components/url-popover/link-viewer.js.map +1 -1
  271. package/build/components/use-block-display-information/index.js +9 -3
  272. package/build/components/use-block-display-information/index.js.map +1 -1
  273. package/build/components/use-on-block-drop/index.js +3 -1
  274. package/build/components/use-on-block-drop/index.js.map +1 -1
  275. package/build/components/warning/index.js +2 -2
  276. package/build/components/warning/index.js.map +1 -1
  277. package/build/components/writing-flow/index.js +2 -2
  278. package/build/components/writing-flow/index.js.map +1 -1
  279. package/build/components/writing-flow/use-clipboard-handler.js +77 -30
  280. package/build/components/writing-flow/use-clipboard-handler.js.map +1 -1
  281. package/build/components/writing-flow/use-drag-selection.js +3 -1
  282. package/build/components/writing-flow/use-drag-selection.js.map +1 -1
  283. package/build/components/writing-flow/use-input.js +44 -2
  284. package/build/components/writing-flow/use-input.js.map +1 -1
  285. package/build/components/writing-flow/use-tab-nav.js +9 -2
  286. package/build/components/writing-flow/use-tab-nav.js.map +1 -1
  287. package/build/components/writing-mode-control/index.js +17 -21
  288. package/build/components/writing-mode-control/index.js.map +1 -1
  289. package/build/hooks/align.js +2 -2
  290. package/build/hooks/align.js.map +1 -1
  291. package/build/hooks/background.js +1 -1
  292. package/build/hooks/background.js.map +1 -1
  293. package/build/hooks/border.js +3 -3
  294. package/build/hooks/border.js.map +1 -1
  295. package/build/hooks/color.js +3 -3
  296. package/build/hooks/color.js.map +1 -1
  297. package/build/hooks/content-lock-ui.js +5 -28
  298. package/build/hooks/content-lock-ui.js.map +1 -1
  299. package/build/hooks/custom-class-name.js +2 -2
  300. package/build/hooks/custom-class-name.js.map +1 -1
  301. package/build/hooks/custom-class-name.native.js +2 -2
  302. package/build/hooks/custom-class-name.native.js.map +1 -1
  303. package/build/hooks/dimensions.js +2 -2
  304. package/build/hooks/dimensions.js.map +1 -1
  305. package/build/hooks/duotone.js +3 -1
  306. package/build/hooks/duotone.js.map +1 -1
  307. package/build/hooks/layout-child.js +16 -8
  308. package/build/hooks/layout-child.js.map +1 -1
  309. package/build/hooks/layout.js +2 -2
  310. package/build/hooks/layout.js.map +1 -1
  311. package/build/hooks/position.js +2 -2
  312. package/build/hooks/position.js.map +1 -1
  313. package/build/hooks/text-align.js +3 -3
  314. package/build/hooks/text-align.js.map +1 -1
  315. package/build/hooks/use-bindings-attributes.js +39 -13
  316. package/build/hooks/use-bindings-attributes.js.map +1 -1
  317. package/build/hooks/use-color-props.js +2 -2
  318. package/build/hooks/use-color-props.js.map +1 -1
  319. package/build/hooks/use-typography-props.js +2 -2
  320. package/build/hooks/use-typography-props.js.map +1 -1
  321. package/build/hooks/utils.js +13 -8
  322. package/build/hooks/utils.js.map +1 -1
  323. package/build/layouts/grid.js +7 -6
  324. package/build/layouts/grid.js.map +1 -1
  325. package/build/private-apis.js +8 -3
  326. package/build/private-apis.js.map +1 -1
  327. package/build/store/actions.js +143 -25
  328. package/build/store/actions.js.map +1 -1
  329. package/build/store/private-actions.js +26 -1
  330. package/build/store/private-actions.js.map +1 -1
  331. package/build/store/private-keys.js +2 -1
  332. package/build/store/private-keys.js.map +1 -1
  333. package/build/store/private-selectors.js +33 -6
  334. package/build/store/private-selectors.js.map +1 -1
  335. package/build/store/reducer.js +11 -8
  336. package/build/store/reducer.js.map +1 -1
  337. package/build/store/selectors.js +25 -8
  338. package/build/store/selectors.js.map +1 -1
  339. package/build/utils/object.js +17 -0
  340. package/build/utils/object.js.map +1 -1
  341. package/build/utils/order-inserter-block-items.js +6 -2
  342. package/build/utils/order-inserter-block-items.js.map +1 -1
  343. package/build/utils/pasting.js +6 -2
  344. package/build/utils/pasting.js.map +1 -1
  345. package/build/utils/selection.js +8 -0
  346. package/build/utils/selection.js.map +1 -1
  347. package/build/utils/transform-styles/index.js +12 -7
  348. package/build/utils/transform-styles/index.js.map +1 -1
  349. package/build-module/components/alignment-control/ui.js +3 -1
  350. package/build-module/components/alignment-control/ui.js.map +1 -1
  351. package/build-module/components/block-actions/index.js +4 -2
  352. package/build-module/components/block-actions/index.js.map +1 -1
  353. package/build-module/components/block-alignment-control/ui.js +2 -2
  354. package/build-module/components/block-alignment-control/ui.js.map +1 -1
  355. package/build-module/components/block-card/index.js +2 -2
  356. package/build-module/components/block-card/index.js.map +1 -1
  357. package/build-module/components/block-compare/index.js +2 -2
  358. package/build-module/components/block-compare/index.js.map +1 -1
  359. package/build-module/components/block-edit/edit.js +2 -2
  360. package/build-module/components/block-edit/edit.js.map +1 -1
  361. package/build-module/components/block-icon/index.js +2 -2
  362. package/build-module/components/block-icon/index.js.map +1 -1
  363. package/build-module/components/block-list/block.js +4 -13
  364. package/build-module/components/block-list/block.js.map +1 -1
  365. package/build-module/components/block-list/block.native.js +2 -2
  366. package/build-module/components/block-list/block.native.js.map +1 -1
  367. package/build-module/components/block-list/index.js +6 -5
  368. package/build-module/components/block-list/index.js.map +1 -1
  369. package/build-module/components/block-list/index.native.js +1 -9
  370. package/build-module/components/block-list/index.native.js.map +1 -1
  371. package/build-module/components/block-list/use-block-props/index.js +11 -8
  372. package/build-module/components/block-list/use-block-props/index.js.map +1 -1
  373. package/build-module/components/block-list/use-block-props/use-block-refs.js +19 -48
  374. package/build-module/components/block-list/use-block-props/use-block-refs.js.map +1 -1
  375. package/build-module/components/block-list/use-block-props/use-is-hovered.js +10 -14
  376. package/build-module/components/block-list/use-block-props/use-is-hovered.js.map +1 -1
  377. package/build-module/components/block-list/use-block-props/use-scroll-into-view.js +37 -0
  378. package/build-module/components/block-list/use-block-props/use-scroll-into-view.js.map +1 -0
  379. package/build-module/components/block-list-appender/index.js +2 -2
  380. package/build-module/components/block-list-appender/index.js.map +1 -1
  381. package/build-module/components/block-mover/button.js +2 -2
  382. package/build-module/components/block-mover/button.js.map +1 -1
  383. package/build-module/components/block-mover/index.js +2 -2
  384. package/build-module/components/block-mover/index.js.map +1 -1
  385. package/build-module/components/block-mover/index.native.js +3 -1
  386. package/build-module/components/block-mover/index.native.js.map +1 -1
  387. package/build-module/components/block-patterns-list/index.js +27 -6
  388. package/build-module/components/block-patterns-list/index.js.map +1 -1
  389. package/build-module/components/block-popover/cover.js +9 -5
  390. package/build-module/components/block-popover/cover.js.map +1 -1
  391. package/build-module/components/block-popover/inbetween.js +2 -2
  392. package/build-module/components/block-popover/inbetween.js.map +1 -1
  393. package/build-module/components/block-popover/index.js +21 -3
  394. package/build-module/components/block-popover/index.js.map +1 -1
  395. package/build-module/components/block-preview/index.js +2 -2
  396. package/build-module/components/block-preview/index.js.map +1 -1
  397. package/build-module/components/block-settings-menu/block-settings-dropdown.js +9 -31
  398. package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  399. package/build-module/components/block-settings-menu-controls/index.js +10 -7
  400. package/build-module/components/block-settings-menu-controls/index.js.map +1 -1
  401. package/build-module/components/block-styles/index.js +2 -2
  402. package/build-module/components/block-styles/index.js.map +1 -1
  403. package/build-module/components/block-switcher/pattern-transformations-menu.js +3 -1
  404. package/build-module/components/block-switcher/pattern-transformations-menu.js.map +1 -1
  405. package/build-module/components/block-switcher/use-transformed-patterns.js +6 -2
  406. package/build-module/components/block-switcher/use-transformed-patterns.js.map +1 -1
  407. package/build-module/components/block-switcher/utils.js +15 -5
  408. package/build-module/components/block-switcher/utils.js.map +1 -1
  409. package/build-module/components/block-toolbar/index.js +3 -3
  410. package/build-module/components/block-toolbar/index.js.map +1 -1
  411. package/build-module/components/block-toolbar/use-has-block-toolbar.js +14 -9
  412. package/build-module/components/block-toolbar/use-has-block-toolbar.js.map +1 -1
  413. package/build-module/components/block-tools/block-selection-button.js +2 -2
  414. package/build-module/components/block-tools/block-selection-button.js.map +1 -1
  415. package/build-module/components/block-tools/block-toolbar-breadcrumb.js +4 -4
  416. package/build-module/components/block-tools/block-toolbar-breadcrumb.js.map +1 -1
  417. package/build-module/components/block-tools/block-toolbar-popover.js +2 -2
  418. package/build-module/components/block-tools/block-toolbar-popover.js.map +1 -1
  419. package/build-module/components/block-tools/empty-block-inserter.js +2 -2
  420. package/build-module/components/block-tools/empty-block-inserter.js.map +1 -1
  421. package/build-module/components/block-tools/index.js +23 -2
  422. package/build-module/components/block-tools/index.js.map +1 -1
  423. package/build-module/components/block-tools/insertion-point.js +4 -4
  424. package/build-module/components/block-tools/insertion-point.js.map +1 -1
  425. package/build-module/components/block-tools/use-show-block-tools.js +2 -5
  426. package/build-module/components/block-tools/use-show-block-tools.js.map +1 -1
  427. package/build-module/components/block-tools/zoom-out-mode-inserters.js +69 -21
  428. package/build-module/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
  429. package/build-module/components/block-variation-picker/index.js +5 -4
  430. package/build-module/components/block-variation-picker/index.js.map +1 -1
  431. package/build-module/components/block-variation-transforms/index.js +3 -1
  432. package/build-module/components/block-variation-transforms/index.js.map +1 -1
  433. package/build-module/components/button-block-appender/index.js +2 -2
  434. package/build-module/components/button-block-appender/index.js.map +1 -1
  435. package/build-module/components/child-layout-control/index.js +2 -2
  436. package/build-module/components/child-layout-control/index.js.map +1 -1
  437. package/build-module/components/colors-gradients/control.js +3 -3
  438. package/build-module/components/colors-gradients/control.js.map +1 -1
  439. package/build-module/components/colors-gradients/dropdown.js +2 -2
  440. package/build-module/components/colors-gradients/dropdown.js.map +1 -1
  441. package/build-module/components/colors-gradients/panel-color-gradient-settings.js +2 -2
  442. package/build-module/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
  443. package/build-module/components/convert-to-group-buttons/index.js +7 -1
  444. package/build-module/components/convert-to-group-buttons/index.js.map +1 -1
  445. package/build-module/components/default-block-appender/index.js +2 -2
  446. package/build-module/components/default-block-appender/index.js.map +1 -1
  447. package/build-module/components/dimensions-tool/aspect-ratio-tool.js +30 -36
  448. package/build-module/components/dimensions-tool/aspect-ratio-tool.js.map +1 -1
  449. package/build-module/components/floating-toolbar/index.native.js +9 -5
  450. package/build-module/components/floating-toolbar/index.native.js.map +1 -1
  451. package/build-module/components/global-styles/background-panel.js +4 -4
  452. package/build-module/components/global-styles/background-panel.js.map +1 -1
  453. package/build-module/components/global-styles/color-panel.js +6 -4
  454. package/build-module/components/global-styles/color-panel.js.map +1 -1
  455. package/build-module/components/global-styles/dimensions-panel.js +21 -5
  456. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  457. package/build-module/components/global-styles/filters-panel.js +2 -2
  458. package/build-module/components/global-styles/filters-panel.js.map +1 -1
  459. package/build-module/components/global-styles/hooks.js +3 -2
  460. package/build-module/components/global-styles/hooks.js.map +1 -1
  461. package/build-module/components/global-styles/shadow-panel-components.js +4 -4
  462. package/build-module/components/global-styles/shadow-panel-components.js.map +1 -1
  463. package/build-module/components/global-styles/typography-panel.js +24 -24
  464. package/build-module/components/global-styles/typography-panel.js.map +1 -1
  465. package/build-module/components/global-styles/use-global-styles-output.js +149 -132
  466. package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
  467. package/build-module/components/global-styles/utils.js +44 -0
  468. package/build-module/components/global-styles/utils.js.map +1 -1
  469. package/build-module/components/grid-visualizer/grid-item-resizer.js +141 -24
  470. package/build-module/components/grid-visualizer/grid-item-resizer.js.map +1 -1
  471. package/build-module/components/grid-visualizer/grid-visualizer.js +12 -6
  472. package/build-module/components/grid-visualizer/grid-visualizer.js.map +1 -1
  473. package/build-module/components/iframe/index.js +70 -31
  474. package/build-module/components/iframe/index.js.map +1 -1
  475. package/build-module/components/image-editor/aspect-ratio-dropdown.js +52 -36
  476. package/build-module/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
  477. package/build-module/components/image-editor/cropper.js +2 -2
  478. package/build-module/components/image-editor/cropper.js.map +1 -1
  479. package/build-module/components/image-editor/index.js +1 -1
  480. package/build-module/components/image-editor/index.js.map +1 -1
  481. package/build-module/components/index.js +1 -0
  482. package/build-module/components/index.js.map +1 -1
  483. package/build-module/components/inner-blocks/button-block-appender.js +2 -2
  484. package/build-module/components/inner-blocks/button-block-appender.js.map +1 -1
  485. package/build-module/components/inner-blocks/index.js +25 -10
  486. package/build-module/components/inner-blocks/index.js.map +1 -1
  487. package/build-module/components/inserter/block-patterns-explorer/pattern-list.js +1 -1
  488. package/build-module/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
  489. package/build-module/components/inserter/block-patterns-tab/index.js +21 -31
  490. package/build-module/components/inserter/block-patterns-tab/index.js.map +1 -1
  491. package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js +1 -1
  492. package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
  493. package/build-module/components/inserter/block-types-tab.js +10 -4
  494. package/build-module/components/inserter/block-types-tab.js.map +1 -1
  495. package/build-module/components/inserter/category-tabs/index.js +49 -0
  496. package/build-module/components/inserter/category-tabs/index.js.map +1 -0
  497. package/build-module/components/inserter/hooks/use-insertion-point.js +11 -2
  498. package/build-module/components/inserter/hooks/use-insertion-point.js.map +1 -1
  499. package/build-module/components/inserter/hooks/use-patterns-state.js +12 -5
  500. package/build-module/components/inserter/hooks/use-patterns-state.js.map +1 -1
  501. package/build-module/components/inserter/index.js +2 -2
  502. package/build-module/components/inserter/index.js.map +1 -1
  503. package/build-module/components/inserter/library.js +8 -2
  504. package/build-module/components/inserter/library.js.map +1 -1
  505. package/build-module/components/inserter/media-tab/index.js +1 -1
  506. package/build-module/components/inserter/media-tab/index.js.map +1 -1
  507. package/build-module/components/inserter/media-tab/media-panel.js +0 -24
  508. package/build-module/components/inserter/media-tab/media-panel.js.map +1 -1
  509. package/build-module/components/inserter/media-tab/media-preview.js +15 -5
  510. package/build-module/components/inserter/media-tab/media-preview.js.map +1 -1
  511. package/build-module/components/inserter/media-tab/media-tab.js +17 -31
  512. package/build-module/components/inserter/media-tab/media-tab.js.map +1 -1
  513. package/build-module/components/inserter/menu.js +117 -111
  514. package/build-module/components/inserter/menu.js.map +1 -1
  515. package/build-module/components/inserter/quick-inserter.js +2 -2
  516. package/build-module/components/inserter/quick-inserter.js.map +1 -1
  517. package/build-module/components/inserter/tabs.js +24 -12
  518. package/build-module/components/inserter/tabs.js.map +1 -1
  519. package/build-module/components/inserter-list-item/index.js +3 -3
  520. package/build-module/components/inserter-list-item/index.js.map +1 -1
  521. package/build-module/components/keyboard-shortcuts/index.js +9 -0
  522. package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
  523. package/build-module/components/line-height-control/index.js +6 -2
  524. package/build-module/components/line-height-control/index.js.map +1 -1
  525. package/build-module/components/link-control/index.js +2 -2
  526. package/build-module/components/link-control/index.js.map +1 -1
  527. package/build-module/components/link-control/link-preview.js +3 -3
  528. package/build-module/components/link-control/link-preview.js.map +1 -1
  529. package/build-module/components/link-control/search-item.js +9 -3
  530. package/build-module/components/link-control/search-item.js.map +1 -1
  531. package/build-module/components/link-control/search-results.js +2 -2
  532. package/build-module/components/link-control/search-results.js.map +1 -1
  533. package/build-module/components/list-view/block-contents.js +2 -2
  534. package/build-module/components/list-view/block-contents.js.map +1 -1
  535. package/build-module/components/list-view/block-select-button.js +17 -174
  536. package/build-module/components/list-view/block-select-button.js.map +1 -1
  537. package/build-module/components/list-view/block.js +198 -23
  538. package/build-module/components/list-view/block.js.map +1 -1
  539. package/build-module/components/list-view/drop-indicator.js +3 -3
  540. package/build-module/components/list-view/drop-indicator.js.map +1 -1
  541. package/build-module/components/list-view/index.js +3 -3
  542. package/build-module/components/list-view/index.js.map +1 -1
  543. package/build-module/components/list-view/leaf.js +2 -2
  544. package/build-module/components/list-view/leaf.js.map +1 -1
  545. package/build-module/components/list-view/use-list-view-drop-zone.js +1 -1
  546. package/build-module/components/list-view/use-list-view-drop-zone.js.map +1 -1
  547. package/build-module/components/list-view/utils.js +3 -1
  548. package/build-module/components/list-view/utils.js.map +1 -1
  549. package/build-module/components/media-placeholder/index.js +7 -7
  550. package/build-module/components/media-placeholder/index.js.map +1 -1
  551. package/build-module/components/media-replace-flow/index.js +2 -2
  552. package/build-module/components/media-replace-flow/index.js.map +1 -1
  553. package/build-module/components/navigable-toolbar/index.js +3 -1
  554. package/build-module/components/navigable-toolbar/index.js.map +1 -1
  555. package/build-module/components/plain-text/index.js +2 -2
  556. package/build-module/components/plain-text/index.js.map +1 -1
  557. package/build-module/components/provider/block-refs-provider.js +3 -4
  558. package/build-module/components/provider/block-refs-provider.js.map +1 -1
  559. package/build-module/components/provider/use-block-sync.js +10 -1
  560. package/build-module/components/provider/use-block-sync.js.map +1 -1
  561. package/build-module/components/responsive-block-control/index.js +2 -2
  562. package/build-module/components/responsive-block-control/index.js.map +1 -1
  563. package/build-module/components/rich-text/event-listeners/before-input-rules.js +86 -0
  564. package/build-module/components/rich-text/event-listeners/before-input-rules.js.map +1 -0
  565. package/build-module/components/rich-text/event-listeners/delete.js +51 -0
  566. package/build-module/components/rich-text/event-listeners/delete.js.map +1 -0
  567. package/build-module/components/rich-text/event-listeners/enter.js +82 -0
  568. package/build-module/components/rich-text/event-listeners/enter.js.map +1 -0
  569. package/build-module/components/rich-text/event-listeners/firefox-compat.js +29 -0
  570. package/build-module/components/rich-text/event-listeners/firefox-compat.js.map +1 -0
  571. package/build-module/components/rich-text/event-listeners/index.js +36 -0
  572. package/build-module/components/rich-text/event-listeners/index.js.map +1 -0
  573. package/build-module/components/rich-text/event-listeners/input-events.js +15 -0
  574. package/build-module/components/rich-text/event-listeners/input-events.js.map +1 -0
  575. package/build-module/components/rich-text/event-listeners/input-rules.js +127 -0
  576. package/build-module/components/rich-text/event-listeners/input-rules.js.map +1 -0
  577. package/build-module/components/rich-text/event-listeners/insert-replacement-text.js +27 -0
  578. package/build-module/components/rich-text/event-listeners/insert-replacement-text.js.map +1 -0
  579. package/build-module/components/rich-text/event-listeners/paste-handler.js +122 -0
  580. package/build-module/components/rich-text/event-listeners/paste-handler.js.map +1 -0
  581. package/build-module/components/rich-text/event-listeners/remove-browser-shortcuts.js +21 -0
  582. package/build-module/components/rich-text/event-listeners/remove-browser-shortcuts.js.map +1 -0
  583. package/build-module/components/rich-text/event-listeners/shortcuts.js +15 -0
  584. package/build-module/components/rich-text/event-listeners/shortcuts.js.map +1 -0
  585. package/build-module/components/rich-text/event-listeners/undo-automatic-change.js +45 -0
  586. package/build-module/components/rich-text/event-listeners/undo-automatic-change.js.map +1 -0
  587. package/build-module/components/rich-text/format-toolbar/index.js +2 -2
  588. package/build-module/components/rich-text/format-toolbar/index.js.map +1 -1
  589. package/build-module/components/rich-text/index.js +21 -34
  590. package/build-module/components/rich-text/index.js.map +1 -1
  591. package/build-module/components/rich-text/index.native.js +15 -5
  592. package/build-module/components/rich-text/index.native.js.map +1 -1
  593. package/build-module/components/rich-text/multiline.js +37 -5
  594. package/build-module/components/rich-text/multiline.js.map +1 -1
  595. package/build-module/components/rich-text/native/index.native.js +12 -0
  596. package/build-module/components/rich-text/native/index.native.js.map +1 -1
  597. package/build-module/components/rich-text/use-format-types.js +8 -4
  598. package/build-module/components/rich-text/use-format-types.js.map +1 -1
  599. package/build-module/components/segmented-text-control/index.js +55 -0
  600. package/build-module/components/segmented-text-control/index.js.map +1 -0
  601. package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js +16 -2
  602. package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
  603. package/build-module/components/text-alignment-control/index.js +68 -0
  604. package/build-module/components/text-alignment-control/index.js.map +1 -0
  605. package/build-module/components/text-decoration-control/index.js +22 -26
  606. package/build-module/components/text-decoration-control/index.js.map +1 -1
  607. package/build-module/components/text-transform-control/index.js +19 -23
  608. package/build-module/components/text-transform-control/index.js.map +1 -1
  609. package/build-module/components/url-input/index.js +4 -4
  610. package/build-module/components/url-input/index.js.map +1 -1
  611. package/build-module/components/url-popover/link-editor.js +2 -2
  612. package/build-module/components/url-popover/link-editor.js.map +1 -1
  613. package/build-module/components/url-popover/link-viewer-url.js +2 -2
  614. package/build-module/components/url-popover/link-viewer-url.js.map +1 -1
  615. package/build-module/components/url-popover/link-viewer.js +2 -2
  616. package/build-module/components/url-popover/link-viewer.js.map +1 -1
  617. package/build-module/components/use-block-display-information/index.js +9 -3
  618. package/build-module/components/use-block-display-information/index.js.map +1 -1
  619. package/build-module/components/use-on-block-drop/index.js +3 -1
  620. package/build-module/components/use-on-block-drop/index.js.map +1 -1
  621. package/build-module/components/warning/index.js +2 -2
  622. package/build-module/components/warning/index.js.map +1 -1
  623. package/build-module/components/writing-flow/index.js +2 -2
  624. package/build-module/components/writing-flow/index.js.map +1 -1
  625. package/build-module/components/writing-flow/use-clipboard-handler.js +78 -31
  626. package/build-module/components/writing-flow/use-clipboard-handler.js.map +1 -1
  627. package/build-module/components/writing-flow/use-drag-selection.js +3 -1
  628. package/build-module/components/writing-flow/use-drag-selection.js.map +1 -1
  629. package/build-module/components/writing-flow/use-input.js +45 -3
  630. package/build-module/components/writing-flow/use-input.js.map +1 -1
  631. package/build-module/components/writing-flow/use-tab-nav.js +9 -2
  632. package/build-module/components/writing-flow/use-tab-nav.js.map +1 -1
  633. package/build-module/components/writing-mode-control/index.js +17 -21
  634. package/build-module/components/writing-mode-control/index.js.map +1 -1
  635. package/build-module/hooks/align.js +2 -2
  636. package/build-module/hooks/align.js.map +1 -1
  637. package/build-module/hooks/background.js +1 -1
  638. package/build-module/hooks/background.js.map +1 -1
  639. package/build-module/hooks/border.js +3 -3
  640. package/build-module/hooks/border.js.map +1 -1
  641. package/build-module/hooks/color.js +3 -3
  642. package/build-module/hooks/color.js.map +1 -1
  643. package/build-module/hooks/content-lock-ui.js +5 -28
  644. package/build-module/hooks/content-lock-ui.js.map +1 -1
  645. package/build-module/hooks/custom-class-name.js +2 -2
  646. package/build-module/hooks/custom-class-name.js.map +1 -1
  647. package/build-module/hooks/custom-class-name.native.js +2 -2
  648. package/build-module/hooks/custom-class-name.native.js.map +1 -1
  649. package/build-module/hooks/dimensions.js +2 -2
  650. package/build-module/hooks/dimensions.js.map +1 -1
  651. package/build-module/hooks/duotone.js +3 -1
  652. package/build-module/hooks/duotone.js.map +1 -1
  653. package/build-module/hooks/layout-child.js +16 -8
  654. package/build-module/hooks/layout-child.js.map +1 -1
  655. package/build-module/hooks/layout.js +2 -2
  656. package/build-module/hooks/layout.js.map +1 -1
  657. package/build-module/hooks/position.js +2 -2
  658. package/build-module/hooks/position.js.map +1 -1
  659. package/build-module/hooks/text-align.js +3 -3
  660. package/build-module/hooks/text-align.js.map +1 -1
  661. package/build-module/hooks/use-bindings-attributes.js +39 -13
  662. package/build-module/hooks/use-bindings-attributes.js.map +1 -1
  663. package/build-module/hooks/use-color-props.js +2 -2
  664. package/build-module/hooks/use-color-props.js.map +1 -1
  665. package/build-module/hooks/use-typography-props.js +2 -2
  666. package/build-module/hooks/use-typography-props.js.map +1 -1
  667. package/build-module/hooks/utils.js +13 -8
  668. package/build-module/hooks/utils.js.map +1 -1
  669. package/build-module/layouts/grid.js +7 -6
  670. package/build-module/layouts/grid.js.map +1 -1
  671. package/build-module/private-apis.js +9 -4
  672. package/build-module/private-apis.js.map +1 -1
  673. package/build-module/store/actions.js +145 -27
  674. package/build-module/store/actions.js.map +1 -1
  675. package/build-module/store/private-actions.js +24 -0
  676. package/build-module/store/private-actions.js.map +1 -1
  677. package/build-module/store/private-keys.js +1 -0
  678. package/build-module/store/private-keys.js.map +1 -1
  679. package/build-module/store/private-selectors.js +32 -5
  680. package/build-module/store/private-selectors.js.map +1 -1
  681. package/build-module/store/reducer.js +11 -8
  682. package/build-module/store/reducer.js.map +1 -1
  683. package/build-module/store/selectors.js +25 -8
  684. package/build-module/store/selectors.js.map +1 -1
  685. package/build-module/utils/object.js +16 -0
  686. package/build-module/utils/object.js.map +1 -1
  687. package/build-module/utils/order-inserter-block-items.js +6 -2
  688. package/build-module/utils/order-inserter-block-items.js.map +1 -1
  689. package/build-module/utils/pasting.js +6 -2
  690. package/build-module/utils/pasting.js.map +1 -1
  691. package/build-module/utils/selection.js +7 -0
  692. package/build-module/utils/selection.js.map +1 -1
  693. package/build-module/utils/transform-styles/index.js +12 -7
  694. package/build-module/utils/transform-styles/index.js.map +1 -1
  695. package/build-style/content-rtl.css +124 -158
  696. package/build-style/content.css +124 -158
  697. package/build-style/style-rtl.css +114 -203
  698. package/build-style/style.css +114 -203
  699. package/build-types/components/block-context/index.d.ts +1 -1
  700. package/build-types/components/block-context/index.d.ts.map +1 -1
  701. package/package.json +32 -32
  702. package/src/components/alignment-control/ui.js +3 -1
  703. package/src/components/block-actions/index.js +5 -1
  704. package/src/components/block-alignment-control/ui.js +2 -2
  705. package/src/components/block-bindings-toolbar-indicator/style.scss +1 -4
  706. package/src/components/block-canvas/style.scss +1 -3
  707. package/src/components/block-card/index.js +2 -2
  708. package/src/components/block-compare/index.js +2 -2
  709. package/src/components/block-content-overlay/content.scss +4 -37
  710. package/src/components/block-edit/edit.js +2 -2
  711. package/src/components/block-icon/index.js +2 -2
  712. package/src/components/block-list/block.js +6 -17
  713. package/src/components/block-list/block.native.js +2 -2
  714. package/src/components/block-list/content.scss +53 -72
  715. package/src/components/block-list/index.js +6 -6
  716. package/src/components/block-list/index.native.js +1 -6
  717. package/src/components/block-list/use-block-props/index.js +16 -6
  718. package/src/components/block-list/use-block-props/use-block-refs.js +17 -57
  719. package/src/components/block-list/use-block-props/use-is-hovered.js +11 -16
  720. package/src/components/block-list/use-block-props/use-scroll-into-view.js +38 -0
  721. package/src/components/block-list-appender/index.js +2 -2
  722. package/src/components/block-mover/button.js +2 -2
  723. package/src/components/block-mover/index.js +2 -2
  724. package/src/components/block-mover/index.native.js +3 -1
  725. package/src/components/block-patterns-list/index.js +29 -4
  726. package/src/components/block-patterns-list/style.scss +1 -3
  727. package/src/components/block-popover/README.md +1 -1
  728. package/src/components/block-popover/cover.js +22 -7
  729. package/src/components/block-popover/inbetween.js +2 -2
  730. package/src/components/block-popover/index.js +24 -6
  731. package/src/components/block-preview/index.js +2 -2
  732. package/src/components/block-preview/style.scss +13 -15
  733. package/src/components/block-settings-menu/block-settings-dropdown.js +15 -57
  734. package/src/components/block-settings-menu-controls/index.js +25 -16
  735. package/src/components/block-styles/index.js +2 -2
  736. package/src/components/block-switcher/pattern-transformations-menu.js +3 -1
  737. package/src/components/block-switcher/use-transformed-patterns.js +6 -2
  738. package/src/components/block-switcher/utils.js +14 -5
  739. package/src/components/block-toolbar/index.js +3 -3
  740. package/src/components/block-toolbar/style.scss +8 -11
  741. package/src/components/block-toolbar/use-has-block-toolbar.js +21 -16
  742. package/src/components/block-tools/block-selection-button.js +2 -2
  743. package/src/components/block-tools/block-toolbar-breadcrumb.js +5 -5
  744. package/src/components/block-tools/block-toolbar-popover.js +4 -7
  745. package/src/components/block-tools/empty-block-inserter.js +2 -2
  746. package/src/components/block-tools/index.js +27 -4
  747. package/src/components/block-tools/insertion-point.js +4 -4
  748. package/src/components/block-tools/style.scss +8 -0
  749. package/src/components/block-tools/use-show-block-tools.js +36 -48
  750. package/src/components/block-tools/zoom-out-mode-inserters.js +74 -18
  751. package/src/components/block-variation-picker/content.scss +22 -72
  752. package/src/components/block-variation-picker/index.js +5 -4
  753. package/src/components/block-variation-transforms/index.js +3 -1
  754. package/src/components/button-block-appender/index.js +2 -2
  755. package/src/components/child-layout-control/index.js +14 -2
  756. package/src/components/colors-gradients/control.js +3 -3
  757. package/src/components/colors-gradients/dropdown.js +2 -2
  758. package/src/components/colors-gradients/panel-color-gradient-settings.js +2 -2
  759. package/src/components/colors-gradients/test/control.js +3 -3
  760. package/src/components/convert-to-group-buttons/index.js +10 -1
  761. package/src/components/default-block-appender/index.js +2 -2
  762. package/src/components/dimensions-tool/aspect-ratio-tool.js +40 -67
  763. package/src/components/dimensions-tool/test/index.js +10 -0
  764. package/src/components/editable-text/README.md +0 -4
  765. package/src/components/floating-toolbar/index.native.js +5 -2
  766. package/src/components/global-styles/background-panel.js +4 -6
  767. package/src/components/global-styles/color-panel.js +6 -4
  768. package/src/components/global-styles/dimensions-panel.js +22 -5
  769. package/src/components/global-styles/filters-panel.js +2 -2
  770. package/src/components/global-styles/hooks.js +2 -0
  771. package/src/components/global-styles/shadow-panel-components.js +6 -9
  772. package/src/components/global-styles/test/get-global-styles-changes.js +0 -2
  773. package/src/components/global-styles/test/use-global-styles-output.js +5 -5
  774. package/src/components/global-styles/test/utils.js +21 -0
  775. package/src/components/global-styles/typography-panel.js +27 -23
  776. package/src/components/global-styles/use-global-styles-output.js +211 -187
  777. package/src/components/global-styles/utils.js +55 -0
  778. package/src/components/grid-visualizer/grid-item-resizer.js +169 -40
  779. package/src/components/grid-visualizer/grid-visualizer.js +19 -6
  780. package/src/components/iframe/content.scss +63 -0
  781. package/src/components/iframe/index.js +119 -39
  782. package/src/components/image-editor/aspect-ratio-dropdown.js +91 -59
  783. package/src/components/image-editor/cropper.js +2 -2
  784. package/src/components/image-editor/index.js +1 -1
  785. package/src/components/image-editor/test/index.js +22 -0
  786. package/src/components/index.js +1 -0
  787. package/src/components/inner-blocks/button-block-appender.js +2 -2
  788. package/src/components/inner-blocks/index.js +24 -9
  789. package/src/components/inserter/block-patterns-explorer/pattern-list.js +2 -1
  790. package/src/components/inserter/block-patterns-tab/index.js +30 -64
  791. package/src/components/inserter/block-patterns-tab/pattern-category-previews.js +2 -1
  792. package/src/components/inserter/block-types-tab.js +12 -9
  793. package/src/components/inserter/category-tabs/index.js +74 -0
  794. package/src/components/inserter/hooks/use-insertion-point.js +15 -1
  795. package/src/components/inserter/hooks/use-patterns-state.js +18 -5
  796. package/src/components/inserter/index.js +4 -5
  797. package/src/components/inserter/library.js +6 -0
  798. package/src/components/inserter/media-tab/index.js +1 -1
  799. package/src/components/inserter/media-tab/media-panel.js +0 -22
  800. package/src/components/inserter/media-tab/media-preview.js +17 -9
  801. package/src/components/inserter/media-tab/media-tab.js +44 -83
  802. package/src/components/inserter/menu.js +168 -140
  803. package/src/components/inserter/quick-inserter.js +2 -2
  804. package/src/components/inserter/style.scss +96 -178
  805. package/src/components/inserter/tabs.js +33 -27
  806. package/src/components/inserter-list-item/index.js +3 -3
  807. package/src/components/keyboard-shortcuts/index.js +12 -0
  808. package/src/components/line-height-control/index.js +6 -2
  809. package/src/components/line-height-control/test/index.js +16 -14
  810. package/src/components/link-control/index.js +2 -2
  811. package/src/components/link-control/link-preview.js +3 -3
  812. package/src/components/link-control/search-item.js +9 -3
  813. package/src/components/link-control/search-results.js +2 -2
  814. package/src/components/list-view/block-contents.js +2 -2
  815. package/src/components/list-view/block-select-button.js +85 -267
  816. package/src/components/list-view/block.js +240 -26
  817. package/src/components/list-view/drop-indicator.js +3 -3
  818. package/src/components/list-view/index.js +3 -3
  819. package/src/components/list-view/leaf.js +2 -5
  820. package/src/components/list-view/style.scss +20 -28
  821. package/src/components/list-view/use-list-view-drop-zone.js +1 -1
  822. package/src/components/list-view/utils.js +3 -1
  823. package/src/components/media-placeholder/content.scss +0 -11
  824. package/src/components/media-placeholder/index.js +7 -7
  825. package/src/components/media-replace-flow/index.js +2 -2
  826. package/src/components/navigable-toolbar/index.js +3 -1
  827. package/src/components/plain-text/index.js +2 -2
  828. package/src/components/provider/block-refs-provider.js +3 -8
  829. package/src/components/provider/test/use-block-sync.js +7 -0
  830. package/src/components/provider/use-block-sync.js +10 -1
  831. package/src/components/responsive-block-control/index.js +2 -2
  832. package/src/components/rich-text/README.md +0 -8
  833. package/src/components/rich-text/event-listeners/before-input-rules.js +92 -0
  834. package/src/components/rich-text/event-listeners/delete.js +53 -0
  835. package/src/components/rich-text/event-listeners/enter.js +84 -0
  836. package/src/components/rich-text/event-listeners/firefox-compat.js +31 -0
  837. package/src/components/rich-text/event-listeners/index.js +56 -0
  838. package/src/components/rich-text/event-listeners/input-events.js +13 -0
  839. package/src/components/rich-text/event-listeners/input-rules.js +146 -0
  840. package/src/components/rich-text/event-listeners/insert-replacement-text.js +28 -0
  841. package/src/components/rich-text/event-listeners/paste-handler.js +132 -0
  842. package/src/components/rich-text/event-listeners/remove-browser-shortcuts.js +24 -0
  843. package/src/components/rich-text/event-listeners/shortcuts.js +13 -0
  844. package/src/components/rich-text/event-listeners/undo-automatic-change.js +45 -0
  845. package/src/components/rich-text/format-toolbar/index.js +2 -2
  846. package/src/components/rich-text/index.js +17 -37
  847. package/src/components/rich-text/index.native.js +13 -2
  848. package/src/components/rich-text/multiline.js +37 -5
  849. package/src/components/rich-text/native/index.native.js +11 -0
  850. package/src/components/rich-text/use-format-types.js +6 -2
  851. package/src/components/segmented-text-control/index.js +63 -0
  852. package/src/components/{writing-mode-control → segmented-text-control}/style.scss +2 -5
  853. package/src/components/spacing-sizes-control/input-controls/spacing-input-control.js +16 -1
  854. package/src/components/text-alignment-control/index.js +91 -0
  855. package/src/components/text-alignment-control/stories/index.story.js +39 -0
  856. package/src/components/text-decoration-control/index.js +22 -35
  857. package/src/components/text-transform-control/index.js +19 -32
  858. package/src/components/url-input/index.js +4 -4
  859. package/src/components/url-popover/link-editor.js +2 -2
  860. package/src/components/url-popover/link-viewer-url.js +2 -2
  861. package/src/components/url-popover/link-viewer.js +2 -2
  862. package/src/components/use-block-display-information/index.js +9 -3
  863. package/src/components/use-on-block-drop/index.js +3 -1
  864. package/src/components/warning/index.js +2 -2
  865. package/src/components/writing-flow/index.js +2 -2
  866. package/src/components/writing-flow/use-clipboard-handler.js +107 -47
  867. package/src/components/writing-flow/use-drag-selection.js +3 -1
  868. package/src/components/writing-flow/use-input.js +75 -1
  869. package/src/components/writing-flow/use-tab-nav.js +13 -2
  870. package/src/components/writing-mode-control/index.js +17 -33
  871. package/src/content.scss +1 -0
  872. package/src/hooks/align.js +2 -2
  873. package/src/hooks/background.js +1 -1
  874. package/src/hooks/border.js +3 -3
  875. package/src/hooks/color.js +12 -19
  876. package/src/hooks/color.scss +1 -0
  877. package/src/hooks/content-lock-ui.js +16 -33
  878. package/src/hooks/custom-class-name.js +2 -2
  879. package/src/hooks/custom-class-name.native.js +2 -2
  880. package/src/hooks/dimensions.js +2 -2
  881. package/src/hooks/duotone.js +3 -1
  882. package/src/hooks/layout-child.js +34 -20
  883. package/src/hooks/layout.js +2 -2
  884. package/src/hooks/position.js +2 -2
  885. package/src/hooks/text-align.js +3 -3
  886. package/src/hooks/use-bindings-attributes.js +48 -16
  887. package/src/hooks/use-color-props.js +2 -2
  888. package/src/hooks/use-typography-props.js +2 -2
  889. package/src/hooks/utils.js +18 -4
  890. package/src/layouts/grid.js +3 -7
  891. package/src/private-apis.js +8 -2
  892. package/src/store/actions.js +233 -54
  893. package/src/store/private-actions.js +24 -0
  894. package/src/store/private-keys.js +1 -0
  895. package/src/store/private-selectors.js +43 -4
  896. package/src/store/reducer.js +13 -23
  897. package/src/store/selectors.js +24 -9
  898. package/src/style.scss +1 -2
  899. package/src/utils/object.js +16 -0
  900. package/src/utils/order-inserter-block-items.js +6 -2
  901. package/src/utils/pasting.js +6 -2
  902. package/src/utils/selection.js +8 -0
  903. package/src/utils/test/__snapshots__/transform-styles.js.snap +6 -0
  904. package/src/utils/test/transform-styles.js +14 -0
  905. package/src/utils/transform-styles/index.js +12 -9
  906. package/tsconfig.tsbuildinfo +1 -1
  907. package/build/components/block-list/use-block-props/use-block-moving-mode-class-names.js +0 -54
  908. package/build/components/block-list/use-block-props/use-block-moving-mode-class-names.js.map +0 -1
  909. package/build/components/rich-text/split-value.js +0 -81
  910. package/build/components/rich-text/split-value.js.map +0 -1
  911. package/build/components/rich-text/use-before-input-rules.js +0 -98
  912. package/build/components/rich-text/use-before-input-rules.js.map +0 -1
  913. package/build/components/rich-text/use-delete.js +0 -64
  914. package/build/components/rich-text/use-delete.js.map +0 -1
  915. package/build/components/rich-text/use-enter.js +0 -109
  916. package/build/components/rich-text/use-enter.js.map +0 -1
  917. package/build/components/rich-text/use-firefox-compat.js +0 -44
  918. package/build/components/rich-text/use-firefox-compat.js.map +0 -1
  919. package/build/components/rich-text/use-input-events.js +0 -25
  920. package/build/components/rich-text/use-input-events.js.map +0 -1
  921. package/build/components/rich-text/use-input-rules.js +0 -139
  922. package/build/components/rich-text/use-input-rules.js.map +0 -1
  923. package/build/components/rich-text/use-insert-replacement-text.js +0 -38
  924. package/build/components/rich-text/use-insert-replacement-text.js.map +0 -1
  925. package/build/components/rich-text/use-paste-handler.js +0 -158
  926. package/build/components/rich-text/use-paste-handler.js.map +0 -1
  927. package/build/components/rich-text/use-remove-browser-shortcuts.js +0 -32
  928. package/build/components/rich-text/use-remove-browser-shortcuts.js.map +0 -1
  929. package/build/components/rich-text/use-shortcuts.js +0 -25
  930. package/build/components/rich-text/use-shortcuts.js.map +0 -1
  931. package/build/components/rich-text/use-undo-automatic-change.js +0 -53
  932. package/build/components/rich-text/use-undo-automatic-change.js.map +0 -1
  933. package/build-module/components/block-list/use-block-props/use-block-moving-mode-class-names.js +0 -47
  934. package/build-module/components/block-list/use-block-props/use-block-moving-mode-class-names.js.map +0 -1
  935. package/build-module/components/rich-text/split-value.js +0 -75
  936. package/build-module/components/rich-text/split-value.js.map +0 -1
  937. package/build-module/components/rich-text/use-before-input-rules.js +0 -92
  938. package/build-module/components/rich-text/use-before-input-rules.js.map +0 -1
  939. package/build-module/components/rich-text/use-delete.js +0 -57
  940. package/build-module/components/rich-text/use-delete.js.map +0 -1
  941. package/build-module/components/rich-text/use-enter.js +0 -102
  942. package/build-module/components/rich-text/use-enter.js.map +0 -1
  943. package/build-module/components/rich-text/use-firefox-compat.js +0 -37
  944. package/build-module/components/rich-text/use-firefox-compat.js.map +0 -1
  945. package/build-module/components/rich-text/use-input-events.js +0 -18
  946. package/build-module/components/rich-text/use-input-events.js.map +0 -1
  947. package/build-module/components/rich-text/use-input-rules.js +0 -132
  948. package/build-module/components/rich-text/use-input-rules.js.map +0 -1
  949. package/build-module/components/rich-text/use-insert-replacement-text.js +0 -32
  950. package/build-module/components/rich-text/use-insert-replacement-text.js.map +0 -1
  951. package/build-module/components/rich-text/use-paste-handler.js +0 -152
  952. package/build-module/components/rich-text/use-paste-handler.js.map +0 -1
  953. package/build-module/components/rich-text/use-remove-browser-shortcuts.js +0 -26
  954. package/build-module/components/rich-text/use-remove-browser-shortcuts.js.map +0 -1
  955. package/build-module/components/rich-text/use-shortcuts.js +0 -18
  956. package/build-module/components/rich-text/use-shortcuts.js.map +0 -1
  957. package/build-module/components/rich-text/use-undo-automatic-change.js +0 -46
  958. package/build-module/components/rich-text/use-undo-automatic-change.js.map +0 -1
  959. package/src/components/block-list/use-block-props/use-block-moving-mode-class-names.js +0 -55
  960. package/src/components/rich-text/split-value.js +0 -64
  961. package/src/components/rich-text/use-before-input-rules.js +0 -99
  962. package/src/components/rich-text/use-delete.js +0 -59
  963. package/src/components/rich-text/use-enter.js +0 -110
  964. package/src/components/rich-text/use-firefox-compat.js +0 -39
  965. package/src/components/rich-text/use-input-events.js +0 -19
  966. package/src/components/rich-text/use-input-rules.js +0 -150
  967. package/src/components/rich-text/use-insert-replacement-text.js +0 -31
  968. package/src/components/rich-text/use-paste-handler.js +0 -180
  969. package/src/components/rich-text/use-remove-browser-shortcuts.js +0 -29
  970. package/src/components/rich-text/use-shortcuts.js +0 -19
  971. package/src/components/rich-text/use-undo-automatic-change.js +0 -46
  972. package/src/components/text-decoration-control/style.scss +0 -18
  973. package/src/components/text-transform-control/style.scss +0 -18
@@ -1 +1 @@
1
- {"version":3,"names":["_classnames","_interopRequireDefault","require","_blocks","_components","_element","_hooks","_data","_colors","_inspectorControls","_useMultipleOriginColorsAndGradients","_utils","_globalStyles","_store","_i18n","BORDER_SUPPORT_KEY","exports","SHADOW_SUPPORT_KEY","getColorByProperty","colors","property","value","matchedColor","some","origin","color","getMultiOriginColor","namedColor","customColor","colorObject","undefined","getColorSlugFromVariable","exec","styleToAttributes","style","hasSplitBorders","border","borderColor","borderColorValue","borderColorSlug","startsWith","substring","length","updatedStyle","cleanEmptyObject","attributesToStyle","attributes","BordersInspectorControl","label","children","resetAllFilter","attributesResetAllFilter","useCallback","existingStyle","_react","createElement","default","group","BorderPanel","clientId","name","setAttributes","settings","isEnabled","useHasBorderPanel","selector","select","blockEditorStore","getBlockAttributes","useSelect","useMemo","onChange","newStyle","defaultControls","getBlockSupport","as","panelId","hasBorderSupport","blockName","feature","Platform","OS","support","radius","width","hasShadowSupport","hasBlockSupport","useBorderPanelLabel","hasBorderControl","hasShadowControl","useBlockSettings","controls","useHasBorderPanelControls","hasBorderColor","hasBorderStyle","hasBorderWidth","hasBorderRadius","hasShadow","__","removeBorderAttribute","attribute","addAttributes","type","addSaveProps","props","blockNameOrType","shouldSkipSerialization","borderClasses","getBorderClasses","newClassName","classnames","className","borderColorClass","getColorClassName","useBlockProps","useMultipleOriginColorsAndGradients","borderTopColor","top","borderRightColor","right","borderBottomColor","bottom","borderLeftColor","left","extraStyles","_default","attributeKeys","hasSupport","addFilter"],"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":";;;;;;;;;;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AAKA,IAAAM,OAAA,GAAAN,OAAA;AACA,IAAAO,kBAAA,GAAAR,sBAAA,CAAAC,OAAA;AACA,IAAAQ,oCAAA,GAAAT,sBAAA,CAAAC,OAAA;AACA,IAAAS,MAAA,GAAAT,OAAA;AAKA,IAAAU,aAAA,GAAAV,OAAA;AAKA,IAAAW,MAAA,GAAAX,OAAA;AACA,IAAAY,KAAA,GAAAZ,OAAA;AA/BA;AACA;AACA;;AAGA;AACA;AACA;;AAOA;AACA;AACA;;AAiBO,MAAMa,kBAAkB,GAAAC,OAAA,CAAAD,kBAAA,GAAG,sBAAsB;AACjD,MAAME,kBAAkB,GAAAD,OAAA,CAAAC,kBAAA,GAAG,QAAQ;AAE1C,MAAMC,kBAAkB,GAAGA,CAAEC,MAAM,EAAEC,QAAQ,EAAEC,KAAK,KAAM;EACzD,IAAIC,YAAY;EAEhBH,MAAM,CAACI,IAAI,CAAIC,MAAM,IACpBA,MAAM,CAACL,MAAM,CAACI,IAAI,CAAIE,KAAK,IAAM;IAChC,IAAKA,KAAK,CAAEL,QAAQ,CAAE,KAAKC,KAAK,EAAG;MAClCC,YAAY,GAAGG,KAAK;MACpB,OAAO,IAAI;IACZ;IAEA,OAAO,KAAK;EACb,CAAE,CACH,CAAC;EAED,OAAOH,YAAY;AACpB,CAAC;AAEM,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AwB,CAAEG,KAAK,EAAEE,MAAM,EAAEmF,KAAK,EAAE9F,KAAM;EACnE,CAAE,CAAC;EAEH,MAAM;IAAEA,KAAK,EAAE+F;EAAkB,CAAC,GAAG9F,mBAAmB,CAAE;IACzDP,MAAM;IACNQ,UAAU,EAAEI,wBAAwB,CAAEG,KAAK,EAAEE,MAAM,EAAEqF,MAAM,EAAEhG,KAAM;EACpE,CAAE,CAAC;EACH,MAAM;IAAEA,KAAK,EAAEiG;EAAgB,CAAC,GAAGhG,mBAAmB,CAAE;IACvDP,MAAM;IACNQ,UAAU,EAAEI,wBAAwB,CAAEG,KAAK,EAAEE,MAAM,EAAEuF,IAAI,EAAElG,KAAM;EAClE,CAAE,CAAC;EAEH,MAAMmG,WAAW,GAAG;IACnBR,cAAc,EAAEA,cAAc,IAAI9E,gBAAgB;IAClDgF,gBAAgB,EAAEA,gBAAgB,IAAIhF,gBAAgB;IACtDkF,iBAAiB,EAAEA,iBAAiB,IAAIlF,gBAAgB;IACxDoF,eAAe,EAAEA,eAAe,IAAIpF;EACrC,CAAC;EAED,OAAOiE,YAAY,CAClB;IAAErE,KAAK,EAAE,IAAAU,uBAAgB,EAAEgF,WAAY,CAAC,IAAI,CAAC;EAAE,CAAC,EAChDhE,IAAI,EACJ;IAAEvB,WAAW;IAAEH;EAAM,CACtB,CAAC;AACF;AAAC,IAAA2F,QAAA,GAAA7G,OAAA,CAAAwC,OAAA,GAEc;EACd0D,aAAa;EACbX,YAAY;EACZuB,aAAa,EAAE,CAAE,aAAa,EAAE,OAAO,CAAE;EACzCC,UAAUA,CAAEnE,IAAI,EAAG;IAClB,OAAOiB,gBAAgB,CAAEjB,IAAI,EAAE,OAAQ,CAAC;EACzC;AACD,CAAC;AAED,IAAAoE,gBAAS,EACR,0BAA0B,EAC1B,2BAA2B,EAC3B3B,aACD,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_blocks","_components","_element","_hooks","_data","_colors","_inspectorControls","_useMultipleOriginColorsAndGradients","_utils","_globalStyles","_store","_i18n","BORDER_SUPPORT_KEY","exports","SHADOW_SUPPORT_KEY","getColorByProperty","colors","property","value","matchedColor","some","origin","color","getMultiOriginColor","namedColor","customColor","colorObject","undefined","getColorSlugFromVariable","exec","styleToAttributes","style","hasSplitBorders","border","borderColor","borderColorValue","borderColorSlug","startsWith","substring","length","updatedStyle","cleanEmptyObject","attributesToStyle","attributes","BordersInspectorControl","label","children","resetAllFilter","attributesResetAllFilter","useCallback","existingStyle","_react","createElement","default","group","BorderPanel","clientId","name","setAttributes","settings","isEnabled","useHasBorderPanel","selector","select","blockEditorStore","getBlockAttributes","useSelect","useMemo","onChange","newStyle","defaultControls","getBlockSupport","as","panelId","hasBorderSupport","blockName","feature","Platform","OS","support","radius","width","hasShadowSupport","hasBlockSupport","useBorderPanelLabel","hasBorderControl","hasShadowControl","useBlockSettings","controls","useHasBorderPanelControls","hasBorderColor","hasBorderStyle","hasBorderWidth","hasBorderRadius","hasShadow","__","removeBorderAttribute","attribute","addAttributes","type","addSaveProps","props","blockNameOrType","shouldSkipSerialization","borderClasses","getBorderClasses","newClassName","clsx","className","borderColorClass","getColorClassName","useBlockProps","useMultipleOriginColorsAndGradients","borderTopColor","top","borderRightColor","right","borderBottomColor","bottom","borderLeftColor","left","extraStyles","_default","attributeKeys","hasSupport","addFilter"],"sources":["@wordpress/block-editor/src/hooks/border.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\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 = clsx( 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 clsx( {\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":";;;;;;;;;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AAKA,IAAAM,OAAA,GAAAN,OAAA;AACA,IAAAO,kBAAA,GAAAR,sBAAA,CAAAC,OAAA;AACA,IAAAQ,oCAAA,GAAAT,sBAAA,CAAAC,OAAA;AACA,IAAAS,MAAA,GAAAT,OAAA;AAKA,IAAAU,aAAA,GAAAV,OAAA;AAKA,IAAAW,MAAA,GAAAX,OAAA;AACA,IAAAY,KAAA,GAAAZ,OAAA;AA/BA;AACA;AACA;;AAGA;AACA;AACA;;AAOA;AACA;AACA;;AAiBO,MAAMa,kBAAkB,GAAAC,OAAA,CAAAD,kBAAA,GAAG,sBAAsB;AACjD,MAAME,kBAAkB,GAAAD,OAAA,CAAAC,kBAAA,GAAG,QAAQ;AAE1C,MAAMC,kBAAkB,GAAGA,CAAEC,MAAM,EAAEC,QAAQ,EAAEC,KAAK,KAAM;EACzD,IAAIC,YAAY;EAEhBH,MAAM,CAACI,IAAI,CAAIC,MAAM,IACpBA,MAAM,CAACL,MAAM,CAACI,IAAI,CAAIE,KAAK,IAAM;IAChC,IAAKA,KAAK,CAAEL,QAAQ,CAAE,KAAKC,KAAK,EAAG;MAClCC,YAAY,GAAGG,KAAK;MACpB,OAAO,IAAI;IACZ;IAEA,OAAO,KAAK;EACb,CAAE,CACH,CAAC;EAED,OAAOH,YAAY;AACpB,CAAC;AAEM,MAA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
12
  var _react = require("react");
13
- var _classnames = _interopRequireDefault(require("classnames"));
13
+ var _clsx = _interopRequireDefault(require("clsx"));
14
14
  var _hooks = require("@wordpress/hooks");
15
15
  var _blocks = require("@wordpress/blocks");
16
16
  var _element = require("@wordpress/element");
@@ -133,7 +133,7 @@ function addSaveProps(props, blockNameOrType, attributes) {
133
133
  const backgroundClass = shouldSerialize('background') ? (0, _colors.getColorClassName)('background-color', backgroundColor) : undefined;
134
134
  const serializeHasBackground = shouldSerialize('background') || shouldSerialize('gradients');
135
135
  const hasBackground = backgroundColor || style?.color?.background || hasGradient && (gradient || style?.color?.gradient);
136
- const newClassName = (0, _classnames.default)(props.className, textClass, gradientClass, {
136
+ const newClassName = (0, _clsx.default)(props.className, textClass, gradientClass, {
137
137
  // Don't apply the background class if there's a custom gradient.
138
138
  [backgroundClass]: (!hasGradient || !style?.color?.gradient) && !!backgroundClass,
139
139
  'has-text-color': shouldSerialize('text') && (textColor || style?.color?.text),
@@ -283,7 +283,7 @@ function useBlockProps({
283
283
  const hasBackgroundValue = backgroundColor || style?.color?.background || gradient || style?.color?.gradient;
284
284
  return {
285
285
  ...saveProps,
286
- className: (0, _classnames.default)(saveProps.className,
286
+ className: (0, _clsx.default)(saveProps.className,
287
287
  // Add background image classes in the editor, if not already handled by background color values.
288
288
  !hasBackgroundValue && (0, _background.getBackgroundImageClasses)(style))
289
289
  };
@@ -1 +1 @@
1
- {"version":3,"names":["_classnames","_interopRequireDefault","require","_hooks","_blocks","_element","_data","_colors","_gradients","_utils","_background","_useSettings","_inspectorControls","_colorPanel","_interopRequireWildcard","_contrastChecker","_store","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","COLOR_SUPPORT_KEY","exports","hasColorSupport","blockNameOrType","colorSupport","getBlockSupport","link","gradient","background","text","hasLinkColorSupport","blockType","Platform","OS","hasGradientSupport","gradients","hasBackgroundColorSupport","hasTextColorSupport","addAttributes","settings","attributes","backgroundColor","assign","type","textColor","addSaveProps","props","shouldSkipSerialization","hasGradient","style","shouldSerialize","feature","textClass","getColorClassName","undefined","gradientClass","__experimentalGetGradientClass","backgroundClass","serializeHasBackground","hasBackground","color","newClassName","classnames","className","elements","styleToAttributes","textColorValue","textColorSlug","startsWith","substring","length","backgroundColorValue","backgroundColorSlug","gradientValue","gradientSlug","updatedStyle","cleanEmptyObject","attributesToStyle","ColorInspectorControl","children","resetAllFilter","attributesResetAllFilter","useCallback","existingStyle","_react","createElement","group","ColorEdit","clientId","name","setAttributes","isEnabled","useHasColorPanel","selector","select","blockEditorStore","getBlockAttributes","useSelect","value","useMemo","onChange","newStyle","defaultControls","enableContrastChecking","as","panelId","enableContrastChecker","useBlockProps","userPalette","themePalette","defaultPalette","useSettings","colors","extraStyles","getColorObjectByAttributeValues","saveProps","hasBackgroundValue","getBackgroundImageClasses","_default","attributeKeys","hasSupport","MIGRATION_PATHS","linkColor","addTransforms","result","source","index","results","destinationBlockType","activeSupports","transformStyles","addFilter"],"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":";;;;;;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AAKA,IAAAK,OAAA,GAAAL,OAAA;AAIA,IAAAM,UAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AAKA,IAAAQ,WAAA,GAAAR,OAAA;AACA,IAAAS,YAAA,GAAAT,OAAA;AACA,IAAAU,kBAAA,GAAAX,sBAAA,CAAAC,OAAA;AACA,IAAAW,WAAA,GAAAC,uBAAA,CAAAZ,OAAA;AAIA,IAAAa,gBAAA,GAAAd,sBAAA,CAAAC,OAAA;AACA,IAAAc,MAAA,GAAAd,OAAA;AAAqD,SAAAe,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAJ,wBAAAI,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAA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C;AAED,IAAA6F,gBAAS,EACR,2CAA2C,EAC3C,0BAA0B,EAC1BR,aACD,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_hooks","_blocks","_element","_data","_colors","_gradients","_utils","_background","_useSettings","_inspectorControls","_colorPanel","_interopRequireWildcard","_contrastChecker","_store","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","COLOR_SUPPORT_KEY","exports","hasColorSupport","blockNameOrType","colorSupport","getBlockSupport","link","gradient","background","text","hasLinkColorSupport","blockType","Platform","OS","hasGradientSupport","gradients","hasBackgroundColorSupport","hasTextColorSupport","addAttributes","settings","attributes","backgroundColor","assign","type","textColor","addSaveProps","props","shouldSkipSerialization","hasGradient","style","shouldSerialize","feature","textClass","getColorClassName","undefined","gradientClass","__experimentalGetGradientClass","backgroundClass","serializeHasBackground","hasBackground","color","newClassName","clsx","className","elements","styleToAttributes","textColorValue","textColorSlug","startsWith","substring","length","backgroundColorValue","backgroundColorSlug","gradientValue","gradientSlug","updatedStyle","cleanEmptyObject","attributesToStyle","ColorInspectorControl","children","resetAllFilter","attributesResetAllFilter","useCallback","existingStyle","_react","createElement","group","ColorEdit","clientId","name","setAttributes","isEnabled","useHasColorPanel","selector","select","blockEditorStore","getBlockAttributes","useSelect","value","useMemo","onChange","newStyle","defaultControls","enableContrastChecking","as","panelId","enableContrastChecker","useBlockProps","userPalette","themePalette","defaultPalette","useSettings","colors","extraStyles","getColorObjectByAttributeValues","saveProps","hasBackgroundValue","getBackgroundImageClasses","_default","attributeKeys","hasSupport","MIGRATION_PATHS","linkColor","addTransforms","result","source","index","results","destinationBlockType","activeSupports","transformStyles","addFilter"],"sources":["@wordpress/block-editor/src/hooks/color.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\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 = clsx( props.className, textClass, gradientClass, {\n\t\t// Don't apply the background class if there's a custom gradient.\n\t\t[ backgroundClass ]:\n\t\t\t( ! hasGradient || ! style?.color?.gradient ) && !! backgroundClass,\n\t\t'has-text-color':\n\t\t\tshouldSerialize( 'text' ) && ( textColor || style?.color?.text ),\n\t\t'has-background': serializeHasBackground && hasBackground,\n\t\t'has-link-color':\n\t\t\tshouldSerialize( 'link' ) && style?.elements?.link?.color,\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: clsx(\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":";;;;;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AAKA,IAAAK,OAAA,GAAAL,OAAA;AAIA,IAAAM,UAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AAKA,IAAAQ,WAAA,GAAAR,OAAA;AACA,IAAAS,YAAA,GAAAT,OAAA;AACA,IAAAU,kBAAA,GAAAX,sBAAA,CAAAC,OAAA;AACA,IAAAW,WAAA,GAAAC,uBAAA,CAAAZ,OAAA;AAIA,IAAAa,gBAAA,GAAAd,sBAAA,CAAAC,OAAA;AACA,IAAAc,MAAA,GAAAd,OAAA;AAAqD,SAAAe,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAA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AEkG,oBAAqB,CAAC;IACtDpF,SAAS,EAAEP,mBAAmB,CAAE2F,oBAAqB,CAAC;IACtDvF,eAAe,EAAEL,yBAAyB,CAAE4F,oBAAqB,CAAC;IAClErG,QAAQ,EAAEO,kBAAkB,CAAE8F,oBAAqB;EACpD,CAAC;EACD,OAAO,IAAAE,sBAAe,EACrBD,cAAc,EACdR,eAAe,EACfG,MAAM,EACNC,MAAM,EACNC,KAAK,EACLC,OACD,CAAC;AACF;AAEA,IAAAI,gBAAS,EACR,0BAA0B,EAC1B,yBAAyB,EACzB7F,aACD,CAAC;AAED,IAAA6F,gBAAS,EACR,2CAA2C,EAC3C,0BAA0B,EAC1BR,aACD,CAAC","ignoreList":[]}
@@ -30,10 +30,6 @@ function ContentLockControlsPure({
30
30
  clientId,
31
31
  isSelected
32
32
  }) {
33
- const {
34
- getBlockListSettings,
35
- getSettings
36
- } = (0, _data.useSelect)(_store.store);
37
33
  const {
38
34
  templateLock,
39
35
  isLockedByParent,
@@ -51,18 +47,10 @@ function ContentLockControlsPure({
51
47
  };
52
48
  }, [clientId]);
53
49
  const {
54
- updateSettings,
55
- updateBlockListSettings,
56
- __unstableSetTemporarilyEditingAsBlocks
57
- } = (0, _data.useDispatch)(_store.store);
58
- const {
59
- stopEditingAsBlocks
50
+ stopEditingAsBlocks,
51
+ modifyContentLockBlock
60
52
  } = (0, _lockUnlock.unlock)((0, _data.useDispatch)(_store.store));
61
53
  const isContentLocked = !isLockedByParent && templateLock === 'contentOnly';
62
- const {
63
- __unstableMarkNextChangeAsNotPersistent,
64
- updateBlockAttributes
65
- } = (0, _data.useDispatch)(_store.store);
66
54
  const stopEditingAsBlockCallback = (0, _element.useCallback)(() => {
67
55
  stopEditingAsBlocks(clientId);
68
56
  }, [clientId, stopEditingAsBlocks]);
@@ -76,22 +64,11 @@ function ContentLockControlsPure({
76
64
  }, (0, _react.createElement)(_components.ToolbarButton, {
77
65
  onClick: stopEditingAsBlockCallback
78
66
  }, (0, _i18n.__)('Done')))), showStartEditingAsBlocks && (0, _react.createElement)(_components2.BlockSettingsMenuControls, null, ({
67
+ selectedClientIds,
79
68
  onClose
80
- }) => (0, _react.createElement)(_components.MenuItem, {
69
+ }) => selectedClientIds.length === 1 && selectedClientIds[0] === clientId && (0, _react.createElement)(_components.MenuItem, {
81
70
  onClick: () => {
82
- __unstableMarkNextChangeAsNotPersistent();
83
- updateBlockAttributes(clientId, {
84
- templateLock: undefined
85
- });
86
- updateBlockListSettings(clientId, {
87
- ...getBlockListSettings(clientId),
88
- templateLock: false
89
- });
90
- const focusModeToRevert = getSettings().focusMode;
91
- updateSettings({
92
- focusMode: true
93
- });
94
- __unstableSetTemporarilyEditingAsBlocks(clientId, focusModeToRevert);
71
+ modifyContentLockBlock(clientId);
95
72
  onClose();
96
73
  }
97
74
  }, (0, _i18n.__)('Modify'))));
@@ -1 +1 @@
1
- {"version":3,"names":["_components","require","_data","_i18n","_element","_store","_components2","_lockUnlock","ContentLockControlsPure","clientId","isSelected","getBlockListSettings","getSettings","useSelect","blockEditorStore","templateLock","isLockedByParent","isEditingAsBlocks","select","getContentLockingParent","getTemplateLock","getTemporarilyEditingAsBlocks","unlock","updateSettings","updateBlockListSettings","__unstableSetTemporarilyEditingAsBlocks","useDispatch","stopEditingAsBlocks","isContentLocked","__unstableMarkNextChangeAsNotPersistent","updateBlockAttributes","stopEditingAsBlockCallback","useCallback","showStopEditingAsBlocks","showStartEditingAsBlocks","_react","createElement","Fragment","BlockControls","group","ToolbarButton","onClick","__","BlockSettingsMenuControls","onClose","MenuItem","undefined","focusModeToRevert","focusMode","_default","exports","default","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":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAA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CAAE,CAAC;MACrCvB,uCAAuC,CACtChB,QAAQ,EACRsC,iBACD,CAAC;MACDH,OAAO,CAAC,CAAC;IACV;EAAG,GAED,IAAAF,QAAE,EAAE,QAAS,CACN,CAEe,CAE3B,CAAC;AAEL;AAAC,IAAAO,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEc;EACdC,IAAI,EAAE5C,uBAAuB;EAC7B6C,UAAUA,CAAA,EAAG;IACZ,OAAO,IAAI;EACZ;AACD,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_components","require","_data","_i18n","_element","_store","_components2","_lockUnlock","ContentLockControlsPure","clientId","isSelected","templateLock","isLockedByParent","isEditingAsBlocks","useSelect","select","getContentLockingParent","getTemplateLock","getTemporarilyEditingAsBlocks","unlock","blockEditorStore","stopEditingAsBlocks","modifyContentLockBlock","useDispatch","isContentLocked","stopEditingAsBlockCallback","useCallback","showStopEditingAsBlocks","showStartEditingAsBlocks","_react","createElement","Fragment","BlockControls","group","ToolbarButton","onClick","__","BlockSettingsMenuControls","selectedClientIds","onClose","length","MenuItem","_default","exports","default","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 { 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 { stopEditingAsBlocks, modifyContentLockBlock } = unlock(\n\t\tuseDispatch( blockEditorStore )\n\t);\n\tconst isContentLocked =\n\t\t! isLockedByParent && templateLock === 'contentOnly';\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{ ( { selectedClientIds, onClose } ) =>\n\t\t\t\t\t\tselectedClientIds.length === 1 &&\n\t\t\t\t\t\tselectedClientIds[ 0 ] === clientId && (\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\tmodifyContentLockBlock( clientId );\n\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Modify' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t)\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":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AAKA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AACA,IAAAM,WAAA,GAAAN,OAAA;AAbA;AACA;AACA;;AAMA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;;AAEA,SAASO,uBAAuBA,CAAE;EAAEC,QAAQ;EAAEC;AAAW,CAAC,EAAG;EAC5D,MAAM;IAAEC,YAAY;IAAEC,gBAAgB;IAAEC;EAAkB,CAAC,GAAG,IAAAC,eAAS,EACpEC,MAAM,IAAM;IACb,MAAM;MACLC,uBAAuB;MACvBC,eAAe;MACfC;IACD,CAAC,GAAG,IAAAC,kBAAM,EAAEJ,MAAM,CAAEK,YAAiB,CAAE,CAAC;IACxC,OAAO;MACNT,YAAY,EAAEM,eAAe,CAAER,QAAS,CAAC;MACzCG,gBAAgB,EAAE,CAAC,CAAEI,uBAAuB,CAAEP,QAAS,CAAC;MACxDI,iBAAiB,EAAEK,6BAA6B,CAAC,CAAC,KAAKT;IACxD,CAAC;EACF,CAAC,EACD,CAAEA,QAAQ,CACX,CAAC;EAED,MAAM;IAAEY,mBAAmB;IAAEC;EAAuB,CAAC,GAAG,IAAAH,kBAAM,EAC7D,IAAAI,iBAAW,EAAEH,YAAiB,CAC/B,CAAC;EACD,MAAMI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A,GAAAC,OAAA,CAAAC,OAAA,GAEc;EACdC,IAAI,EAAErC,uBAAuB;EAC7BsC,UAAUA,CAAA,EAAG;IACZ,OAAO,IAAI;EACZ;AACD,CAAC","ignoreList":[]}
@@ -9,7 +9,7 @@ exports.addSaveProps = addSaveProps;
9
9
  exports.addTransforms = addTransforms;
10
10
  exports.default = void 0;
11
11
  var _react = require("react");
12
- var _classnames = _interopRequireDefault(require("classnames"));
12
+ var _clsx = _interopRequireDefault(require("clsx"));
13
13
  var _hooks = require("@wordpress/hooks");
14
14
  var _components = require("@wordpress/components");
15
15
  var _i18n = require("@wordpress/i18n");
@@ -92,7 +92,7 @@ var _default = exports.default = {
92
92
  */
93
93
  function addSaveProps(extraProps, blockType, attributes) {
94
94
  if ((0, _blocks.hasBlockSupport)(blockType, 'customClassName', true) && attributes.className) {
95
- extraProps.className = (0, _classnames.default)(extraProps.className, attributes.className);
95
+ extraProps.className = (0, _clsx.default)(extraProps.className, attributes.className);
96
96
  }
97
97
  return extraProps;
98
98
  }
@@ -1 +1 @@
1
- {"version":3,"names":["_classnames","_interopRequireDefault","require","_hooks","_components","_i18n","_blocks","_components2","_blockEditingMode","addAttribute","settings","hasBlockSupport","attributes","className","type","CustomClassNameControlsPure","setAttributes","blockEditingMode","useBlockEditingMode","_react","createElement","InspectorControls","group","TextControl","__nextHasNoMarginBottom","__next40pxDefaultSize","autoComplete","label","__","value","onChange","nextValue","undefined","help","_default","exports","default","edit","addSaveProps","attributeKeys","hasSupport","name","extraProps","blockType","classnames","addTransforms","result","source","index","results","length","innerBlocks","originClassName","addFilter"],"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":";;;;;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AAKA,IAAAK,YAAA,GAAAL,OAAA;AACA,IAAAM,iBAAA,GAAAN,OAAA;AAjBA;AACA;AACA;;AAGA;AACA;AACA;;AAM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EAAEuC;QACZ;MACD,CAAC;IACF;EACD;EACA,OAAON,MAAM;AACd;AAEA,IAAAO,gBAAS,EACR,0BAA0B,EAC1B,yCAAyC,EACzC5C,YACD,CAAC;AAED,IAAA4C,gBAAS,EACR,2CAA2C,EAC3C,0BAA0B,EAC1BR,aACD,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_hooks","_components","_i18n","_blocks","_components2","_blockEditingMode","addAttribute","settings","hasBlockSupport","attributes","className","type","CustomClassNameControlsPure","setAttributes","blockEditingMode","useBlockEditingMode","_react","createElement","InspectorControls","group","TextControl","__nextHasNoMarginBottom","__next40pxDefaultSize","autoComplete","label","__","value","onChange","nextValue","undefined","help","_default","exports","default","edit","addSaveProps","attributeKeys","hasSupport","name","extraProps","blockType","clsx","addTransforms","result","source","index","results","length","innerBlocks","originClassName","addFilter"],"sources":["@wordpress/block-editor/src/hooks/custom-class-name.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\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 = clsx(\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":";;;;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AAKA,IAAAK,YAAA,GAAAL,OAAA;AACA,IAAAM,iBAAA,GAAAN,OAAA;AAjBA;AACA;AACA;;AAGA;AACA;AACA;;AAMA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASO,YAAYA,CAAEC,QAAQ,EAAG;EACxC,IAAK,IAAAC,uBAAe,EAAED,QAAQ,EAAE,iBAAiB,EAAE,IAAK,CAAC,EAAG;IAC3D;IACAA,QAAQ,CAACE,UAAU,GAAG;MACrB,GAAGF,QAAQ,CAACE,UAAU;MACtBC,SAAS,EAAE;QACVC,IAAI,EAAE;MACP;IACD,CAAC;EACF;EAEA,OAAOJ,QAAQ;AAChB;AAEA,SAASK,2BAA2BA,CAAE;EAAEF,SAAS;EAAEG;AAAc,CAAC,EAAG;EACpE,MAAMC,gBAAgB,GAAG,IAAAC,qCAAmB,EAAC,CAAC;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,MAAM,EAAEC,MAAM,EAAEC,KAAK,EAAEC,OAAO,EAAG;EAC/D,IAAK,CAAE,IAAAtC,uBAAe,EAAEmC,MAAM,CAACL,IAAI,EAAE,iBAAiB,EAAE,IAAK,CAAC,EAAG;IAChE,OAAOK,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,EAAEpC,UAAU,CAACC,SAAS;IAC7D,IAAKuC,eAAe,EAAG;MACtB,OAAO;QACN,GAAGN,MAAM;QACTlC,UAAU,EAAE;UACX,GAAGkC,MAAM,CAAClC,UAAU;UACpBC,SAAS,EAAEuC;QACZ;MACD,CAAC;IACF;EACD;EACA,OAAON,MAAM;AACd;AAEA,IAAAO,gBAAS,EACR,0BAA0B,EAC1B,yCAAyC,EACzC5C,YACD,CAAC;AAED,IAAA4C,gBAAS,EACR,2CAA2C,EAC3C,0BAA0B,EAC1BR,aACD,CAAC","ignoreList":[]}
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.addAttribute = addAttribute;
8
8
  exports.addSaveProps = addSaveProps;
9
9
  exports.default = void 0;
10
- var _classnames = _interopRequireDefault(require("classnames"));
10
+ var _clsx = _interopRequireDefault(require("clsx"));
11
11
  var _hooks = require("@wordpress/hooks");
12
12
  var _blocks = require("@wordpress/blocks");
13
13
  /**
@@ -51,7 +51,7 @@ function addAttribute(settings) {
51
51
  */
52
52
  function addSaveProps(extraProps, blockType, attributes) {
53
53
  if ((0, _blocks.hasBlockSupport)(blockType, 'customClassName', true) && attributes.className) {
54
- extraProps.className = (0, _classnames.default)(extraProps.className, attributes.className);
54
+ extraProps.className = (0, _clsx.default)(extraProps.className, attributes.className);
55
55
  }
56
56
  return extraProps;
57
57
  }
@@ -1 +1 @@
1
- {"version":3,"names":["_classnames","_interopRequireDefault","require","_hooks","_blocks","addAttribute","settings","hasBlockSupport","attributes","className","type","addSaveProps","extraProps","blockType","classnames","addFilter","_default","exports","default","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":";;;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AATA;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASG,YAAYA,CAAEC,QAAQ,EAAG;EACxC,IAAK,IAAAC,uBAAe,EAAED,QAAQ,EAAE,iBAAiB,EAAE,IAAK,CAAC,EAAG;IAC3D;IACAA,QAAQ,CAACE,UAAU,GAAG;MACrB,GAAGF,QAAQ,CAACE,UAAU;MACtBC,SAAS,EAAE;QACVC,IAAI,EAAE;MACP;IACD,CAAC;EACF;EAEA,OAAOJ,QAAQ;AAChB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASK,YAAYA,CAAEC,UAAU,EAAEC,SAAS,EAAEL,UAAU,EAAG;EACjE,IACC,IAAAD,uBAAe,EAAEM,SAAS,EAAE,iBAAiB,EAAE,IAAK,CAAC,IACrDL,UAAU,CAACC,SAAS,EACnB;IACDG,UAAU,CAACH,SAAS,GAAG,IAAAK,mBAAU,EAChCF,UAAU,CAACH,SAAS,EACpBD,UAAU,CAACC,SACZ,CAAC;EACF;EAEA,OAAOG,UAAU;AAClB;AAEA,IAAAG,gBAAS,EACR,0BAA0B,EAC1B,kCAAkC,EAClCV,YACD,CAAC;AAAC,IAAAW,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEa;EACdP,YAAY;EACZQ,aAAa,EAAE,CAAE,WAAW,CAAE;EAC9BC,UAAUA,CAAEC,IAAI,EAAG;IAClB,OAAO,IAAAd,uBAAe,EAAEc,IAAI,EAAE,iBAAiB,EAAE,IAAK,CAAC;EACxD;AACD,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_hooks","_blocks","addAttribute","settings","hasBlockSupport","attributes","className","type","addSaveProps","extraProps","blockType","clsx","addFilter","_default","exports","default","attributeKeys","hasSupport","name"],"sources":["@wordpress/block-editor/src/hooks/custom-class-name.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\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 = clsx(\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":";;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AATA;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASG,YAAYA,CAAEC,QAAQ,EAAG;EACxC,IAAK,IAAAC,uBAAe,EAAED,QAAQ,EAAE,iBAAiB,EAAE,IAAK,CAAC,EAAG;IAC3D;IACAA,QAAQ,CAACE,UAAU,GAAG;MACrB,GAAGF,QAAQ,CAACE,UAAU;MACtBC,SAAS,EAAE;QACVC,IAAI,EAAE;MACP;IACD,CAAC;EACF;EAEA,OAAOJ,QAAQ;AAChB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASK,YAAYA,CAAEC,UAAU,EAAEC,SAAS,EAAEL,UAAU,EAAG;EACjE,IACC,IAAAD,uBAAe,EAAEM,SAAS,EAAE,iBAAiB,EAAE,IAAK,CAAC,IACrDL,UAAU,CAACC,SAAS,EACnB;IACDG,UAAU,CAACH,SAAS,GAAG,IAAAK,aAAI,EAC1BF,UAAU,CAACH,SAAS,EACpBD,UAAU,CAACC,SACZ,CAAC;EACF;EAEA,OAAOG,UAAU;AAClB;AAEA,IAAAG,gBAAS,EACR,0BAA0B,EAC1B,kCAAkC,EAClCV,YACD,CAAC;AAAC,IAAAW,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEa;EACdP,YAAY;EACZQ,aAAa,EAAE,CAAE,WAAW,CAAE;EAC9BC,UAAUA,CAAEC,IAAI,EAAG;IAClB,OAAO,IAAAd,uBAAe,EAAEc,IAAI,EAAE,iBAAiB,EAAE,IAAK,CAAC;EACxD;AACD,CAAC","ignoreList":[]}
@@ -10,7 +10,7 @@ exports.default = exports.SPACING_SUPPORT_KEY = void 0;
10
10
  exports.hasDimensionsSupport = hasDimensionsSupport;
11
11
  exports.useCustomSides = useCustomSides;
12
12
  var _react = require("react");
13
- var _classnames = _interopRequireDefault(require("classnames"));
13
+ var _clsx = _interopRequireDefault(require("clsx"));
14
14
  var _element = require("@wordpress/element");
15
15
  var _data = require("@wordpress/data");
16
16
  var _blocks = require("@wordpress/blocks");
@@ -147,7 +147,7 @@ function useBlockProps({
147
147
  if (!hasDimensionsSupport(name, 'aspectRatio') || (0, _utils.shouldSkipSerialization)(name, DIMENSIONS_SUPPORT_KEY, 'aspectRatio')) {
148
148
  return {};
149
149
  }
150
- const className = (0, _classnames.default)({
150
+ const className = (0, _clsx.default)({
151
151
  'has-aspect-ratio': !!style?.dimensions?.aspectRatio
152
152
  });
153
153
 
@@ -1 +1 @@
1
- {"version":3,"names":["_classnames","_interopRequireDefault","require","_element","_data","_blocks","_deprecated","_inspectorControls","_globalStyles","_spacingVisualizer","_store","_lockUnlock","_utils","DIMENSIONS_SUPPORT_KEY","exports","SPACING_SUPPORT_KEY","ALL_SIDES","AXIAL_SIDES","useVisualizer","property","setProperty","useState","hideBlockInterface","showBlockInterface","unlock","useDispatch","blockEditorStore","useEffect","DimensionsInspectorControl","children","resetAllFilter","attributesResetAllFilter","useCallback","attributes","existingStyle","style","updatedStyle","_react","createElement","default","group","DimensionsPanel","clientId","name","setAttributes","settings","isEnabled","useHasDimensionsPanel","value","useSelect","select","getBlockAttributes","visualizedProperty","setVisualizedProperty","onChange","newStyle","cleanEmptyObject","defaultDimensionsControls","getBlockSupport","defaultSpacingControls","defaultControls","Fragment","as","panelId","onVisualize","spacing","padding","PaddingVisualizer","forceShow","margin","MarginVisualizer","hasDimensionsSupport","blockName","feature","Platform","OS","support","aspectRatio","minHeight","_default","useBlockProps","attributeKeys","hasSupport","shouldSkipSerialization","className","classnames","dimensions","inlineStyleOverrides","useCustomSides","deprecated","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.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AAEA;AACA;AACA;AACO,SAASC,cAAcA,CAAA,EAAG;EAChC,IAAAC,mBAAU,EAAE,6CAA6C,EAAE;IAC1DC,KAAK,EAAE,KAAK;IACZC,OAAO,EAAE;EACV,CAAE,CAAC;AACJ","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_element","_data","_blocks","_deprecated","_inspectorControls","_globalStyles","_spacingVisualizer","_store","_lockUnlock","_utils","DIMENSIONS_SUPPORT_KEY","exports","SPACING_SUPPORT_KEY","ALL_SIDES","AXIAL_SIDES","useVisualizer","property","setProperty","useState","hideBlockInterface","showBlockInterface","unlock","useDispatch","blockEditorStore","useEffect","DimensionsInspectorControl","children","resetAllFilter","attributesResetAllFilter","useCallback","attributes","existingStyle","style","updatedStyle","_react","createElement","default","group","DimensionsPanel","clientId","name","setAttributes","settings","isEnabled","useHasDimensionsPanel","value","useSelect","select","getBlockAttributes","visualizedProperty","setVisualizedProperty","onChange","newStyle","cleanEmptyObject","defaultDimensionsControls","getBlockSupport","defaultSpacingControls","defaultControls","Fragment","as","panelId","onVisualize","spacing","padding","PaddingVisualizer","forceShow","margin","MarginVisualizer","hasDimensionsSupport","blockName","feature","Platform","OS","support","aspectRatio","minHeight","_default","useBlockProps","attributeKeys","hasSupport","shouldSkipSerialization","className","clsx","dimensions","inlineStyleOverrides","useCustomSides","deprecated","since","version"],"sources":["@wordpress/block-editor/src/hooks/dimensions.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\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 = clsx( {\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":";;;;;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAL,sBAAA,CAAAC,OAAA;AAKA,IA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AIH,OAAO,CAAE;AAC/B;AAAC,IAAAM,QAAA,GAAAjE,OAAA,CAAAyB,OAAA,GAEc;EACdyC,aAAa;EACbC,aAAa,EAAE,CAAE,WAAW,EAAE,OAAO,CAAE;EACvCC,UAAUA,CAAEvC,IAAI,EAAG;IAClB,OAAO4B,oBAAoB,CAAE5B,IAAI,EAAE,aAAc,CAAC;EACnD;AACD,CAAC;AAED,SAASqC,aAAaA,CAAE;EAAErC,IAAI;EAAEmC,SAAS;EAAE3C;AAAM,CAAC,EAAG;EACpD,IACC,CAAEoC,oBAAoB,CAAE5B,IAAI,EAAE,aAAc,CAAC,IAC7C,IAAAwC,8BAAuB,EAAExC,IAAI,EAAE9B,sBAAsB,EAAE,aAAc,CAAC,EACrE;IACD,OAAO,CAAC,CAAC;EACV;EAEA,MAAMuE,SAAS,GAAG,IAAAC,aAAI,EAAE;IACvB,kBAAkB,EAAE,CAAC,CAAElD,KAAK,EAAEmD,UAAU,EAAET;EAC3C,CAAE,CAAC;;EAEH;EACA;EACA,MAAMU,oBAAoB,GAAG,CAAC,CAAC;;EAE/B;EACA;EACA;EACA;EACA;EACA;EACA,IAAKpD,KAAK,EAAEmD,UAAU,EAAET,WAAW,EAAG;IACrC;IACAU,oBAAoB,CAACT,SAAS,GAAG,OAAO;EACzC,CAAC,MAAM,IAAKA,SAAS,IAAI3C,KAAK,EAAEmD,UAAU,EAAER,SAAS,EAAG;IACvD;IACAS,oBAAoB,CAACV,WAAW,GAAG,OAAO;EAC3C;EAEA,OAAO;IAAEO,SAAS;IAAEjD,KAAK,EAAEoD;EAAqB,CAAC;AAClD;;AAEA;AACA;AACA;AACO,SAASC,cAAcA,CAAA,EAAG;EAChC,IAAAC,mBAAU,EAAE,6CAA6C,EAAE;IAC1DC,KAAK,EAAE,KAAK;IACZC,OAAO,EAAE;EACV,CAAE,CAAC;AACJ","ignoreList":[]}
@@ -232,7 +232,9 @@ function useDuotoneStyles({
232
232
  } : undefined);
233
233
  const blockElement = (0, _useBlockRefs.__unstableUseBlockElement)(clientId);
234
234
  (0, _element.useEffect)(() => {
235
- if (!isValidFilter) return;
235
+ if (!isValidFilter) {
236
+ return;
237
+ }
236
238
 
237
239
  // Safari does not always update the duotone filter when the duotone colors
238
240
  // are changed. When using Safari, force the block element to be repainted by