@wordpress/block-editor 12.25.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 (674) hide show
  1. package/CHANGELOG.md +9 -3
  2. package/README.md +6 -0
  3. package/build/components/block-actions/index.js +4 -2
  4. package/build/components/block-actions/index.js.map +1 -1
  5. package/build/components/block-alignment-control/ui.js +2 -2
  6. package/build/components/block-alignment-control/ui.js.map +1 -1
  7. package/build/components/block-card/index.js +2 -2
  8. package/build/components/block-card/index.js.map +1 -1
  9. package/build/components/block-compare/index.js +2 -2
  10. package/build/components/block-compare/index.js.map +1 -1
  11. package/build/components/block-edit/edit.js +2 -2
  12. package/build/components/block-edit/edit.js.map +1 -1
  13. package/build/components/block-icon/index.js +2 -2
  14. package/build/components/block-icon/index.js.map +1 -1
  15. package/build/components/block-inspector/index.js +1 -1
  16. package/build/components/block-inspector/index.js.map +1 -1
  17. package/build/components/block-list/block.js +4 -4
  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 +2 -2
  22. package/build/components/block-list/index.js.map +1 -1
  23. package/build/components/block-list/use-block-props/index.js +5 -2
  24. package/build/components/block-list/use-block-props/index.js.map +1 -1
  25. package/build/components/block-list/use-block-props/use-scroll-into-view.js +44 -0
  26. package/build/components/block-list/use-block-props/use-scroll-into-view.js.map +1 -0
  27. package/build/components/block-list-appender/index.js +2 -2
  28. package/build/components/block-list-appender/index.js.map +1 -1
  29. package/build/components/block-mover/button.js +2 -2
  30. package/build/components/block-mover/button.js.map +1 -1
  31. package/build/components/block-mover/index.js +2 -2
  32. package/build/components/block-mover/index.js.map +1 -1
  33. package/build/components/block-patterns-list/index.js +26 -5
  34. package/build/components/block-patterns-list/index.js.map +1 -1
  35. package/build/components/block-popover/cover.js +9 -6
  36. package/build/components/block-popover/cover.js.map +1 -1
  37. package/build/components/block-popover/inbetween.js +2 -2
  38. package/build/components/block-popover/inbetween.js.map +1 -1
  39. package/build/components/block-popover/index.js +22 -4
  40. package/build/components/block-popover/index.js.map +1 -1
  41. package/build/components/block-preview/index.js +2 -2
  42. package/build/components/block-preview/index.js.map +1 -1
  43. package/build/components/block-settings-menu/block-settings-dropdown.js +8 -5
  44. package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  45. package/build/components/block-settings-menu-controls/index.js +10 -7
  46. package/build/components/block-settings-menu-controls/index.js.map +1 -1
  47. package/build/components/block-styles/index.js +2 -2
  48. package/build/components/block-styles/index.js.map +1 -1
  49. package/build/components/block-toolbar/index.js +3 -3
  50. package/build/components/block-toolbar/index.js.map +1 -1
  51. package/build/components/block-tools/block-selection-button.js +2 -2
  52. package/build/components/block-tools/block-selection-button.js.map +1 -1
  53. package/build/components/block-tools/block-toolbar-breadcrumb.js +4 -4
  54. package/build/components/block-tools/block-toolbar-breadcrumb.js.map +1 -1
  55. package/build/components/block-tools/block-toolbar-popover.js +2 -2
  56. package/build/components/block-tools/block-toolbar-popover.js.map +1 -1
  57. package/build/components/block-tools/empty-block-inserter.js +2 -2
  58. package/build/components/block-tools/empty-block-inserter.js.map +1 -1
  59. package/build/components/block-tools/index.js +20 -1
  60. package/build/components/block-tools/index.js.map +1 -1
  61. package/build/components/block-tools/insertion-point.js +4 -4
  62. package/build/components/block-tools/insertion-point.js.map +1 -1
  63. package/build/components/block-tools/zoom-out-mode-inserters.js +66 -22
  64. package/build/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
  65. package/build/components/block-variation-picker/index.js +2 -2
  66. package/build/components/block-variation-picker/index.js.map +1 -1
  67. package/build/components/button-block-appender/index.js +2 -2
  68. package/build/components/button-block-appender/index.js.map +1 -1
  69. package/build/components/child-layout-control/index.js +2 -2
  70. package/build/components/child-layout-control/index.js.map +1 -1
  71. package/build/components/colors-gradients/control.js +3 -3
  72. package/build/components/colors-gradients/control.js.map +1 -1
  73. package/build/components/colors-gradients/dropdown.js +2 -2
  74. package/build/components/colors-gradients/dropdown.js.map +1 -1
  75. package/build/components/colors-gradients/panel-color-gradient-settings.js +2 -2
  76. package/build/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
  77. package/build/components/convert-to-group-buttons/index.js +6 -0
  78. package/build/components/convert-to-group-buttons/index.js.map +1 -1
  79. package/build/components/default-block-appender/index.js +2 -2
  80. package/build/components/default-block-appender/index.js.map +1 -1
  81. package/build/components/dimensions-tool/aspect-ratio-tool.js +30 -36
  82. package/build/components/dimensions-tool/aspect-ratio-tool.js.map +1 -1
  83. package/build/components/global-styles/background-panel.js +3 -3
  84. package/build/components/global-styles/background-panel.js.map +1 -1
  85. package/build/components/global-styles/color-panel.js +3 -3
  86. package/build/components/global-styles/color-panel.js.map +1 -1
  87. package/build/components/global-styles/dimensions-panel.js +4 -4
  88. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  89. package/build/components/global-styles/filters-panel.js +2 -2
  90. package/build/components/global-styles/filters-panel.js.map +1 -1
  91. package/build/components/global-styles/shadow-panel-components.js +4 -4
  92. package/build/components/global-styles/shadow-panel-components.js.map +1 -1
  93. package/build/components/global-styles/use-global-styles-output.js +1 -1
  94. package/build/components/global-styles/use-global-styles-output.js.map +1 -1
  95. package/build/components/grid-visualizer/grid-item-resizer.js +141 -24
  96. package/build/components/grid-visualizer/grid-item-resizer.js.map +1 -1
  97. package/build/components/grid-visualizer/grid-visualizer.js +11 -5
  98. package/build/components/grid-visualizer/grid-visualizer.js.map +1 -1
  99. package/build/components/iframe/index.js +69 -30
  100. package/build/components/iframe/index.js.map +1 -1
  101. package/build/components/image-editor/aspect-ratio-dropdown.js +53 -36
  102. package/build/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
  103. package/build/components/image-editor/cropper.js +2 -2
  104. package/build/components/image-editor/cropper.js.map +1 -1
  105. package/build/components/image-editor/index.js +1 -1
  106. package/build/components/image-editor/index.js.map +1 -1
  107. package/build/components/index.js +8 -0
  108. package/build/components/index.js.map +1 -1
  109. package/build/components/inner-blocks/button-block-appender.js +2 -2
  110. package/build/components/inner-blocks/button-block-appender.js.map +1 -1
  111. package/build/components/inner-blocks/index.js +22 -21
  112. package/build/components/inner-blocks/index.js.map +1 -1
  113. package/build/components/inserter/block-patterns-explorer/pattern-list.js +1 -1
  114. package/build/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
  115. package/build/components/inserter/block-patterns-tab/index.js +9 -0
  116. package/build/components/inserter/block-patterns-tab/index.js.map +1 -1
  117. package/build/components/inserter/block-patterns-tab/pattern-category-previews.js +1 -1
  118. package/build/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
  119. package/build/components/inserter/block-types-tab.js +5 -3
  120. package/build/components/inserter/block-types-tab.js.map +1 -1
  121. package/build/components/inserter/hooks/use-insertion-point.js +11 -2
  122. package/build/components/inserter/hooks/use-insertion-point.js.map +1 -1
  123. package/build/components/inserter/hooks/use-patterns-state.js +12 -5
  124. package/build/components/inserter/hooks/use-patterns-state.js.map +1 -1
  125. package/build/components/inserter/index.js +2 -2
  126. package/build/components/inserter/index.js.map +1 -1
  127. package/build/components/inserter/library.js +8 -2
  128. package/build/components/inserter/library.js.map +1 -1
  129. package/build/components/inserter/media-tab/media-preview.js +2 -2
  130. package/build/components/inserter/media-tab/media-preview.js.map +1 -1
  131. package/build/components/inserter/menu.js +72 -56
  132. package/build/components/inserter/menu.js.map +1 -1
  133. package/build/components/inserter/quick-inserter.js +2 -2
  134. package/build/components/inserter/quick-inserter.js.map +1 -1
  135. package/build/components/inserter/tabs.js +17 -5
  136. package/build/components/inserter/tabs.js.map +1 -1
  137. package/build/components/inserter-list-item/index.js +3 -3
  138. package/build/components/inserter-list-item/index.js.map +1 -1
  139. package/build/components/keyboard-shortcuts/index.js +9 -0
  140. package/build/components/keyboard-shortcuts/index.js.map +1 -1
  141. package/build/components/link-control/index.js +2 -2
  142. package/build/components/link-control/index.js.map +1 -1
  143. package/build/components/link-control/link-preview.js +3 -3
  144. package/build/components/link-control/link-preview.js.map +1 -1
  145. package/build/components/link-control/search-results.js +2 -2
  146. package/build/components/link-control/search-results.js.map +1 -1
  147. package/build/components/list-view/block-contents.js +2 -2
  148. package/build/components/list-view/block-contents.js.map +1 -1
  149. package/build/components/list-view/block-select-button.js +11 -3
  150. package/build/components/list-view/block-select-button.js.map +1 -1
  151. package/build/components/list-view/block.js +35 -12
  152. package/build/components/list-view/block.js.map +1 -1
  153. package/build/components/list-view/drop-indicator.js +3 -3
  154. package/build/components/list-view/drop-indicator.js.map +1 -1
  155. package/build/components/list-view/index.js +2 -2
  156. package/build/components/list-view/index.js.map +1 -1
  157. package/build/components/list-view/leaf.js +2 -2
  158. package/build/components/list-view/leaf.js.map +1 -1
  159. package/build/components/media-placeholder/index.js +4 -4
  160. package/build/components/media-placeholder/index.js.map +1 -1
  161. package/build/components/media-replace-flow/index.js +2 -2
  162. package/build/components/media-replace-flow/index.js.map +1 -1
  163. package/build/components/plain-text/index.js +2 -2
  164. package/build/components/plain-text/index.js.map +1 -1
  165. package/build/components/provider/use-block-sync.js +18 -0
  166. package/build/components/provider/use-block-sync.js.map +1 -1
  167. package/build/components/responsive-block-control/index.js +2 -2
  168. package/build/components/responsive-block-control/index.js.map +1 -1
  169. package/build/components/rich-text/event-listeners/enter.js +33 -42
  170. package/build/components/rich-text/event-listeners/enter.js.map +1 -1
  171. package/build/components/rich-text/event-listeners/paste-handler.js +22 -42
  172. package/build/components/rich-text/event-listeners/paste-handler.js.map +1 -1
  173. package/build/components/rich-text/format-toolbar/index.js +2 -2
  174. package/build/components/rich-text/format-toolbar/index.js.map +1 -1
  175. package/build/components/rich-text/index.js +9 -2
  176. package/build/components/rich-text/index.js.map +1 -1
  177. package/build/components/rich-text/index.native.js +2 -2
  178. package/build/components/rich-text/index.native.js.map +1 -1
  179. package/build/components/rich-text/multiline.js +30 -2
  180. package/build/components/rich-text/multiline.js.map +1 -1
  181. package/build/components/segmented-text-control/index.js +2 -2
  182. package/build/components/segmented-text-control/index.js.map +1 -1
  183. package/build/components/text-alignment-control/index.js +2 -2
  184. package/build/components/text-alignment-control/index.js.map +1 -1
  185. package/build/components/text-decoration-control/index.js +2 -2
  186. package/build/components/text-decoration-control/index.js.map +1 -1
  187. package/build/components/text-transform-control/index.js +2 -2
  188. package/build/components/text-transform-control/index.js.map +1 -1
  189. package/build/components/url-input/index.js +4 -4
  190. package/build/components/url-input/index.js.map +1 -1
  191. package/build/components/url-popover/link-editor.js +2 -2
  192. package/build/components/url-popover/link-editor.js.map +1 -1
  193. package/build/components/url-popover/link-viewer-url.js +2 -2
  194. package/build/components/url-popover/link-viewer-url.js.map +1 -1
  195. package/build/components/url-popover/link-viewer.js +2 -2
  196. package/build/components/url-popover/link-viewer.js.map +1 -1
  197. package/build/components/warning/index.js +2 -2
  198. package/build/components/warning/index.js.map +1 -1
  199. package/build/components/writing-flow/index.js +2 -2
  200. package/build/components/writing-flow/index.js.map +1 -1
  201. package/build/components/writing-flow/use-clipboard-handler.js +77 -30
  202. package/build/components/writing-flow/use-clipboard-handler.js.map +1 -1
  203. package/build/components/writing-flow/use-input.js +44 -2
  204. package/build/components/writing-flow/use-input.js.map +1 -1
  205. package/build/components/writing-flow/use-tab-nav.js +6 -1
  206. package/build/components/writing-flow/use-tab-nav.js.map +1 -1
  207. package/build/components/writing-mode-control/index.js +2 -2
  208. package/build/components/writing-mode-control/index.js.map +1 -1
  209. package/build/hooks/align.js +2 -2
  210. package/build/hooks/align.js.map +1 -1
  211. package/build/hooks/background.js +1 -1
  212. package/build/hooks/background.js.map +1 -1
  213. package/build/hooks/border.js +3 -3
  214. package/build/hooks/border.js.map +1 -1
  215. package/build/hooks/color.js +3 -3
  216. package/build/hooks/color.js.map +1 -1
  217. package/build/hooks/content-lock-ui.js +5 -28
  218. package/build/hooks/content-lock-ui.js.map +1 -1
  219. package/build/hooks/custom-class-name.js +2 -2
  220. package/build/hooks/custom-class-name.js.map +1 -1
  221. package/build/hooks/custom-class-name.native.js +2 -2
  222. package/build/hooks/custom-class-name.native.js.map +1 -1
  223. package/build/hooks/dimensions.js +2 -2
  224. package/build/hooks/dimensions.js.map +1 -1
  225. package/build/hooks/layout-child.js +16 -8
  226. package/build/hooks/layout-child.js.map +1 -1
  227. package/build/hooks/layout.js +2 -2
  228. package/build/hooks/layout.js.map +1 -1
  229. package/build/hooks/position.js +2 -2
  230. package/build/hooks/position.js.map +1 -1
  231. package/build/hooks/text-align.js +3 -3
  232. package/build/hooks/text-align.js.map +1 -1
  233. package/build/hooks/use-bindings-attributes.js +39 -13
  234. package/build/hooks/use-bindings-attributes.js.map +1 -1
  235. package/build/hooks/use-color-props.js +2 -2
  236. package/build/hooks/use-color-props.js.map +1 -1
  237. package/build/hooks/use-typography-props.js +2 -2
  238. package/build/hooks/use-typography-props.js.map +1 -1
  239. package/build/hooks/utils.js +2 -2
  240. package/build/hooks/utils.js.map +1 -1
  241. package/build/layouts/grid.js +7 -6
  242. package/build/layouts/grid.js.map +1 -1
  243. package/build/private-apis.js +4 -1
  244. package/build/private-apis.js.map +1 -1
  245. package/build/store/actions.js +134 -40
  246. package/build/store/actions.js.map +1 -1
  247. package/build/store/private-actions.js +26 -1
  248. package/build/store/private-actions.js.map +1 -1
  249. package/build/store/private-keys.js +2 -1
  250. package/build/store/private-keys.js.map +1 -1
  251. package/build/store/private-selectors.js +6 -0
  252. package/build/store/private-selectors.js.map +1 -1
  253. package/build/store/selectors.js +4 -1
  254. package/build/store/selectors.js.map +1 -1
  255. package/build/utils/selection.js +8 -0
  256. package/build/utils/selection.js.map +1 -1
  257. package/build/utils/transform-styles/index.js +12 -7
  258. package/build/utils/transform-styles/index.js.map +1 -1
  259. package/build-module/components/block-actions/index.js +4 -2
  260. package/build-module/components/block-actions/index.js.map +1 -1
  261. package/build-module/components/block-alignment-control/ui.js +2 -2
  262. package/build-module/components/block-alignment-control/ui.js.map +1 -1
  263. package/build-module/components/block-card/index.js +2 -2
  264. package/build-module/components/block-card/index.js.map +1 -1
  265. package/build-module/components/block-compare/index.js +2 -2
  266. package/build-module/components/block-compare/index.js.map +1 -1
  267. package/build-module/components/block-edit/edit.js +2 -2
  268. package/build-module/components/block-edit/edit.js.map +1 -1
  269. package/build-module/components/block-icon/index.js +2 -2
  270. package/build-module/components/block-icon/index.js.map +1 -1
  271. package/build-module/components/block-inspector/index.js +1 -1
  272. package/build-module/components/block-inspector/index.js.map +1 -1
  273. package/build-module/components/block-list/block.js +4 -4
  274. package/build-module/components/block-list/block.js.map +1 -1
  275. package/build-module/components/block-list/block.native.js +2 -2
  276. package/build-module/components/block-list/block.native.js.map +1 -1
  277. package/build-module/components/block-list/index.js +2 -2
  278. package/build-module/components/block-list/index.js.map +1 -1
  279. package/build-module/components/block-list/use-block-props/index.js +5 -2
  280. package/build-module/components/block-list/use-block-props/index.js.map +1 -1
  281. package/build-module/components/block-list/use-block-props/use-scroll-into-view.js +37 -0
  282. package/build-module/components/block-list/use-block-props/use-scroll-into-view.js.map +1 -0
  283. package/build-module/components/block-list-appender/index.js +2 -2
  284. package/build-module/components/block-list-appender/index.js.map +1 -1
  285. package/build-module/components/block-mover/button.js +2 -2
  286. package/build-module/components/block-mover/button.js.map +1 -1
  287. package/build-module/components/block-mover/index.js +2 -2
  288. package/build-module/components/block-mover/index.js.map +1 -1
  289. package/build-module/components/block-patterns-list/index.js +27 -6
  290. package/build-module/components/block-patterns-list/index.js.map +1 -1
  291. package/build-module/components/block-popover/cover.js +9 -5
  292. package/build-module/components/block-popover/cover.js.map +1 -1
  293. package/build-module/components/block-popover/inbetween.js +2 -2
  294. package/build-module/components/block-popover/inbetween.js.map +1 -1
  295. package/build-module/components/block-popover/index.js +21 -3
  296. package/build-module/components/block-popover/index.js.map +1 -1
  297. package/build-module/components/block-preview/index.js +2 -2
  298. package/build-module/components/block-preview/index.js.map +1 -1
  299. package/build-module/components/block-settings-menu/block-settings-dropdown.js +8 -5
  300. package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  301. package/build-module/components/block-settings-menu-controls/index.js +10 -7
  302. package/build-module/components/block-settings-menu-controls/index.js.map +1 -1
  303. package/build-module/components/block-styles/index.js +2 -2
  304. package/build-module/components/block-styles/index.js.map +1 -1
  305. package/build-module/components/block-toolbar/index.js +3 -3
  306. package/build-module/components/block-toolbar/index.js.map +1 -1
  307. package/build-module/components/block-tools/block-selection-button.js +2 -2
  308. package/build-module/components/block-tools/block-selection-button.js.map +1 -1
  309. package/build-module/components/block-tools/block-toolbar-breadcrumb.js +4 -4
  310. package/build-module/components/block-tools/block-toolbar-breadcrumb.js.map +1 -1
  311. package/build-module/components/block-tools/block-toolbar-popover.js +2 -2
  312. package/build-module/components/block-tools/block-toolbar-popover.js.map +1 -1
  313. package/build-module/components/block-tools/empty-block-inserter.js +2 -2
  314. package/build-module/components/block-tools/empty-block-inserter.js.map +1 -1
  315. package/build-module/components/block-tools/index.js +20 -1
  316. package/build-module/components/block-tools/index.js.map +1 -1
  317. package/build-module/components/block-tools/insertion-point.js +4 -4
  318. package/build-module/components/block-tools/insertion-point.js.map +1 -1
  319. package/build-module/components/block-tools/zoom-out-mode-inserters.js +67 -23
  320. package/build-module/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
  321. package/build-module/components/block-variation-picker/index.js +2 -2
  322. package/build-module/components/block-variation-picker/index.js.map +1 -1
  323. package/build-module/components/button-block-appender/index.js +2 -2
  324. package/build-module/components/button-block-appender/index.js.map +1 -1
  325. package/build-module/components/child-layout-control/index.js +2 -2
  326. package/build-module/components/child-layout-control/index.js.map +1 -1
  327. package/build-module/components/colors-gradients/control.js +3 -3
  328. package/build-module/components/colors-gradients/control.js.map +1 -1
  329. package/build-module/components/colors-gradients/dropdown.js +2 -2
  330. package/build-module/components/colors-gradients/dropdown.js.map +1 -1
  331. package/build-module/components/colors-gradients/panel-color-gradient-settings.js +2 -2
  332. package/build-module/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
  333. package/build-module/components/convert-to-group-buttons/index.js +7 -1
  334. package/build-module/components/convert-to-group-buttons/index.js.map +1 -1
  335. package/build-module/components/default-block-appender/index.js +2 -2
  336. package/build-module/components/default-block-appender/index.js.map +1 -1
  337. package/build-module/components/dimensions-tool/aspect-ratio-tool.js +30 -36
  338. package/build-module/components/dimensions-tool/aspect-ratio-tool.js.map +1 -1
  339. package/build-module/components/global-styles/background-panel.js +3 -3
  340. package/build-module/components/global-styles/background-panel.js.map +1 -1
  341. package/build-module/components/global-styles/color-panel.js +3 -3
  342. package/build-module/components/global-styles/color-panel.js.map +1 -1
  343. package/build-module/components/global-styles/dimensions-panel.js +4 -4
  344. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  345. package/build-module/components/global-styles/filters-panel.js +2 -2
  346. package/build-module/components/global-styles/filters-panel.js.map +1 -1
  347. package/build-module/components/global-styles/shadow-panel-components.js +4 -4
  348. package/build-module/components/global-styles/shadow-panel-components.js.map +1 -1
  349. package/build-module/components/global-styles/use-global-styles-output.js +1 -1
  350. package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
  351. package/build-module/components/grid-visualizer/grid-item-resizer.js +141 -24
  352. package/build-module/components/grid-visualizer/grid-item-resizer.js.map +1 -1
  353. package/build-module/components/grid-visualizer/grid-visualizer.js +12 -6
  354. package/build-module/components/grid-visualizer/grid-visualizer.js.map +1 -1
  355. package/build-module/components/iframe/index.js +70 -31
  356. package/build-module/components/iframe/index.js.map +1 -1
  357. package/build-module/components/image-editor/aspect-ratio-dropdown.js +52 -36
  358. package/build-module/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
  359. package/build-module/components/image-editor/cropper.js +2 -2
  360. package/build-module/components/image-editor/cropper.js.map +1 -1
  361. package/build-module/components/image-editor/index.js +1 -1
  362. package/build-module/components/image-editor/index.js.map +1 -1
  363. package/build-module/components/index.js +1 -0
  364. package/build-module/components/index.js.map +1 -1
  365. package/build-module/components/inner-blocks/button-block-appender.js +2 -2
  366. package/build-module/components/inner-blocks/button-block-appender.js.map +1 -1
  367. package/build-module/components/inner-blocks/index.js +22 -21
  368. package/build-module/components/inner-blocks/index.js.map +1 -1
  369. package/build-module/components/inserter/block-patterns-explorer/pattern-list.js +1 -1
  370. package/build-module/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
  371. package/build-module/components/inserter/block-patterns-tab/index.js +10 -1
  372. package/build-module/components/inserter/block-patterns-tab/index.js.map +1 -1
  373. package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js +1 -1
  374. package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
  375. package/build-module/components/inserter/block-types-tab.js +6 -4
  376. package/build-module/components/inserter/block-types-tab.js.map +1 -1
  377. package/build-module/components/inserter/hooks/use-insertion-point.js +11 -2
  378. package/build-module/components/inserter/hooks/use-insertion-point.js.map +1 -1
  379. package/build-module/components/inserter/hooks/use-patterns-state.js +12 -5
  380. package/build-module/components/inserter/hooks/use-patterns-state.js.map +1 -1
  381. package/build-module/components/inserter/index.js +2 -2
  382. package/build-module/components/inserter/index.js.map +1 -1
  383. package/build-module/components/inserter/library.js +8 -2
  384. package/build-module/components/inserter/library.js.map +1 -1
  385. package/build-module/components/inserter/media-tab/media-preview.js +2 -2
  386. package/build-module/components/inserter/media-tab/media-preview.js.map +1 -1
  387. package/build-module/components/inserter/menu.js +72 -56
  388. package/build-module/components/inserter/menu.js.map +1 -1
  389. package/build-module/components/inserter/quick-inserter.js +2 -2
  390. package/build-module/components/inserter/quick-inserter.js.map +1 -1
  391. package/build-module/components/inserter/tabs.js +18 -6
  392. package/build-module/components/inserter/tabs.js.map +1 -1
  393. package/build-module/components/inserter-list-item/index.js +3 -3
  394. package/build-module/components/inserter-list-item/index.js.map +1 -1
  395. package/build-module/components/keyboard-shortcuts/index.js +9 -0
  396. package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
  397. package/build-module/components/link-control/index.js +2 -2
  398. package/build-module/components/link-control/index.js.map +1 -1
  399. package/build-module/components/link-control/link-preview.js +3 -3
  400. package/build-module/components/link-control/link-preview.js.map +1 -1
  401. package/build-module/components/link-control/search-results.js +2 -2
  402. package/build-module/components/link-control/search-results.js.map +1 -1
  403. package/build-module/components/list-view/block-contents.js +2 -2
  404. package/build-module/components/list-view/block-contents.js.map +1 -1
  405. package/build-module/components/list-view/block-select-button.js +11 -3
  406. package/build-module/components/list-view/block-select-button.js.map +1 -1
  407. package/build-module/components/list-view/block.js +36 -13
  408. package/build-module/components/list-view/block.js.map +1 -1
  409. package/build-module/components/list-view/drop-indicator.js +3 -3
  410. package/build-module/components/list-view/drop-indicator.js.map +1 -1
  411. package/build-module/components/list-view/index.js +2 -2
  412. package/build-module/components/list-view/index.js.map +1 -1
  413. package/build-module/components/list-view/leaf.js +2 -2
  414. package/build-module/components/list-view/leaf.js.map +1 -1
  415. package/build-module/components/media-placeholder/index.js +4 -4
  416. package/build-module/components/media-placeholder/index.js.map +1 -1
  417. package/build-module/components/media-replace-flow/index.js +2 -2
  418. package/build-module/components/media-replace-flow/index.js.map +1 -1
  419. package/build-module/components/plain-text/index.js +2 -2
  420. package/build-module/components/plain-text/index.js.map +1 -1
  421. package/build-module/components/provider/use-block-sync.js +19 -1
  422. package/build-module/components/provider/use-block-sync.js.map +1 -1
  423. package/build-module/components/responsive-block-control/index.js +2 -2
  424. package/build-module/components/responsive-block-control/index.js.map +1 -1
  425. package/build-module/components/rich-text/event-listeners/enter.js +33 -43
  426. package/build-module/components/rich-text/event-listeners/enter.js.map +1 -1
  427. package/build-module/components/rich-text/event-listeners/paste-handler.js +23 -43
  428. package/build-module/components/rich-text/event-listeners/paste-handler.js.map +1 -1
  429. package/build-module/components/rich-text/format-toolbar/index.js +2 -2
  430. package/build-module/components/rich-text/format-toolbar/index.js.map +1 -1
  431. package/build-module/components/rich-text/index.js +9 -2
  432. package/build-module/components/rich-text/index.js.map +1 -1
  433. package/build-module/components/rich-text/index.native.js +2 -2
  434. package/build-module/components/rich-text/index.native.js.map +1 -1
  435. package/build-module/components/rich-text/multiline.js +31 -3
  436. package/build-module/components/rich-text/multiline.js.map +1 -1
  437. package/build-module/components/segmented-text-control/index.js +2 -2
  438. package/build-module/components/segmented-text-control/index.js.map +1 -1
  439. package/build-module/components/text-alignment-control/index.js +2 -2
  440. package/build-module/components/text-alignment-control/index.js.map +1 -1
  441. package/build-module/components/text-decoration-control/index.js +2 -2
  442. package/build-module/components/text-decoration-control/index.js.map +1 -1
  443. package/build-module/components/text-transform-control/index.js +2 -2
  444. package/build-module/components/text-transform-control/index.js.map +1 -1
  445. package/build-module/components/url-input/index.js +4 -4
  446. package/build-module/components/url-input/index.js.map +1 -1
  447. package/build-module/components/url-popover/link-editor.js +2 -2
  448. package/build-module/components/url-popover/link-editor.js.map +1 -1
  449. package/build-module/components/url-popover/link-viewer-url.js +2 -2
  450. package/build-module/components/url-popover/link-viewer-url.js.map +1 -1
  451. package/build-module/components/url-popover/link-viewer.js +2 -2
  452. package/build-module/components/url-popover/link-viewer.js.map +1 -1
  453. package/build-module/components/warning/index.js +2 -2
  454. package/build-module/components/warning/index.js.map +1 -1
  455. package/build-module/components/writing-flow/index.js +2 -2
  456. package/build-module/components/writing-flow/index.js.map +1 -1
  457. package/build-module/components/writing-flow/use-clipboard-handler.js +78 -31
  458. package/build-module/components/writing-flow/use-clipboard-handler.js.map +1 -1
  459. package/build-module/components/writing-flow/use-input.js +45 -3
  460. package/build-module/components/writing-flow/use-input.js.map +1 -1
  461. package/build-module/components/writing-flow/use-tab-nav.js +6 -1
  462. package/build-module/components/writing-flow/use-tab-nav.js.map +1 -1
  463. package/build-module/components/writing-mode-control/index.js +2 -2
  464. package/build-module/components/writing-mode-control/index.js.map +1 -1
  465. package/build-module/hooks/align.js +2 -2
  466. package/build-module/hooks/align.js.map +1 -1
  467. package/build-module/hooks/background.js +1 -1
  468. package/build-module/hooks/background.js.map +1 -1
  469. package/build-module/hooks/border.js +3 -3
  470. package/build-module/hooks/border.js.map +1 -1
  471. package/build-module/hooks/color.js +3 -3
  472. package/build-module/hooks/color.js.map +1 -1
  473. package/build-module/hooks/content-lock-ui.js +5 -28
  474. package/build-module/hooks/content-lock-ui.js.map +1 -1
  475. package/build-module/hooks/custom-class-name.js +2 -2
  476. package/build-module/hooks/custom-class-name.js.map +1 -1
  477. package/build-module/hooks/custom-class-name.native.js +2 -2
  478. package/build-module/hooks/custom-class-name.native.js.map +1 -1
  479. package/build-module/hooks/dimensions.js +2 -2
  480. package/build-module/hooks/dimensions.js.map +1 -1
  481. package/build-module/hooks/layout-child.js +16 -8
  482. package/build-module/hooks/layout-child.js.map +1 -1
  483. package/build-module/hooks/layout.js +2 -2
  484. package/build-module/hooks/layout.js.map +1 -1
  485. package/build-module/hooks/position.js +2 -2
  486. package/build-module/hooks/position.js.map +1 -1
  487. package/build-module/hooks/text-align.js +3 -3
  488. package/build-module/hooks/text-align.js.map +1 -1
  489. package/build-module/hooks/use-bindings-attributes.js +39 -13
  490. package/build-module/hooks/use-bindings-attributes.js.map +1 -1
  491. package/build-module/hooks/use-color-props.js +2 -2
  492. package/build-module/hooks/use-color-props.js.map +1 -1
  493. package/build-module/hooks/use-typography-props.js +2 -2
  494. package/build-module/hooks/use-typography-props.js.map +1 -1
  495. package/build-module/hooks/utils.js +2 -2
  496. package/build-module/hooks/utils.js.map +1 -1
  497. package/build-module/layouts/grid.js +7 -6
  498. package/build-module/layouts/grid.js.map +1 -1
  499. package/build-module/private-apis.js +5 -2
  500. package/build-module/private-apis.js.map +1 -1
  501. package/build-module/store/actions.js +136 -42
  502. package/build-module/store/actions.js.map +1 -1
  503. package/build-module/store/private-actions.js +24 -0
  504. package/build-module/store/private-actions.js.map +1 -1
  505. package/build-module/store/private-keys.js +1 -0
  506. package/build-module/store/private-keys.js.map +1 -1
  507. package/build-module/store/private-selectors.js +5 -0
  508. package/build-module/store/private-selectors.js.map +1 -1
  509. package/build-module/store/selectors.js +4 -1
  510. package/build-module/store/selectors.js.map +1 -1
  511. package/build-module/utils/selection.js +7 -0
  512. package/build-module/utils/selection.js.map +1 -1
  513. package/build-module/utils/transform-styles/index.js +12 -7
  514. package/build-module/utils/transform-styles/index.js.map +1 -1
  515. package/build-style/content-rtl.css +89 -96
  516. package/build-style/content.css +89 -96
  517. package/build-style/style-rtl.css +14 -4
  518. package/build-style/style.css +14 -4
  519. package/build-types/components/block-context/index.d.ts +1 -1
  520. package/build-types/components/block-context/index.d.ts.map +1 -1
  521. package/package.json +32 -32
  522. package/src/components/block-actions/index.js +5 -1
  523. package/src/components/block-alignment-control/ui.js +2 -2
  524. package/src/components/block-card/index.js +2 -2
  525. package/src/components/block-compare/index.js +2 -2
  526. package/src/components/block-content-overlay/content.scss +4 -37
  527. package/src/components/block-draggable/test/helpers.native.js +8 -8
  528. package/src/components/block-edit/edit.js +2 -2
  529. package/src/components/block-icon/index.js +2 -2
  530. package/src/components/block-inspector/index.js +2 -1
  531. package/src/components/block-list/block.js +4 -4
  532. package/src/components/block-list/block.native.js +2 -2
  533. package/src/components/block-list/content.scss +46 -73
  534. package/src/components/block-list/index.js +2 -2
  535. package/src/components/block-list/use-block-props/index.js +4 -2
  536. package/src/components/block-list/use-block-props/use-scroll-into-view.js +38 -0
  537. package/src/components/block-list-appender/index.js +2 -2
  538. package/src/components/block-mover/button.js +2 -2
  539. package/src/components/block-mover/index.js +2 -2
  540. package/src/components/block-patterns-list/index.js +29 -4
  541. package/src/components/block-popover/README.md +1 -1
  542. package/src/components/block-popover/cover.js +22 -7
  543. package/src/components/block-popover/inbetween.js +2 -2
  544. package/src/components/block-popover/index.js +24 -6
  545. package/src/components/block-preview/index.js +2 -2
  546. package/src/components/block-settings-menu/block-settings-dropdown.js +14 -6
  547. package/src/components/block-settings-menu-controls/index.js +25 -16
  548. package/src/components/block-styles/index.js +2 -2
  549. package/src/components/block-toolbar/index.js +3 -3
  550. package/src/components/block-tools/block-selection-button.js +2 -2
  551. package/src/components/block-tools/block-toolbar-breadcrumb.js +5 -5
  552. package/src/components/block-tools/block-toolbar-popover.js +4 -7
  553. package/src/components/block-tools/empty-block-inserter.js +2 -2
  554. package/src/components/block-tools/index.js +24 -3
  555. package/src/components/block-tools/insertion-point.js +4 -4
  556. package/src/components/block-tools/style.scss +8 -0
  557. package/src/components/block-tools/zoom-out-mode-inserters.js +73 -21
  558. package/src/components/block-variation-picker/index.js +2 -2
  559. package/src/components/button-block-appender/index.js +2 -2
  560. package/src/components/child-layout-control/index.js +14 -2
  561. package/src/components/colors-gradients/control.js +3 -3
  562. package/src/components/colors-gradients/dropdown.js +2 -2
  563. package/src/components/colors-gradients/panel-color-gradient-settings.js +2 -2
  564. package/src/components/colors-gradients/test/control.js +3 -3
  565. package/src/components/convert-to-group-buttons/index.js +10 -1
  566. package/src/components/default-block-appender/index.js +2 -2
  567. package/src/components/dimensions-tool/aspect-ratio-tool.js +40 -67
  568. package/src/components/dimensions-tool/test/index.js +10 -0
  569. package/src/components/editable-text/README.md +0 -4
  570. package/src/components/global-styles/background-panel.js +3 -3
  571. package/src/components/global-styles/color-panel.js +3 -3
  572. package/src/components/global-styles/dimensions-panel.js +4 -4
  573. package/src/components/global-styles/filters-panel.js +2 -2
  574. package/src/components/global-styles/shadow-panel-components.js +6 -9
  575. package/src/components/global-styles/test/get-global-styles-changes.js +0 -2
  576. package/src/components/global-styles/test/use-global-styles-output.js +5 -5
  577. package/src/components/global-styles/use-global-styles-output.js +1 -1
  578. package/src/components/grid-visualizer/grid-item-resizer.js +169 -40
  579. package/src/components/grid-visualizer/grid-visualizer.js +19 -6
  580. package/src/components/iframe/content.scss +63 -0
  581. package/src/components/iframe/index.js +119 -39
  582. package/src/components/image-editor/aspect-ratio-dropdown.js +91 -59
  583. package/src/components/image-editor/cropper.js +2 -2
  584. package/src/components/image-editor/index.js +1 -1
  585. package/src/components/image-editor/test/index.js +22 -0
  586. package/src/components/index.js +1 -0
  587. package/src/components/inner-blocks/button-block-appender.js +2 -2
  588. package/src/components/inner-blocks/index.js +19 -17
  589. package/src/components/inserter/block-patterns-explorer/pattern-list.js +2 -1
  590. package/src/components/inserter/block-patterns-tab/index.js +17 -1
  591. package/src/components/inserter/block-patterns-tab/pattern-category-previews.js +2 -1
  592. package/src/components/inserter/block-types-tab.js +7 -9
  593. package/src/components/inserter/hooks/use-insertion-point.js +15 -1
  594. package/src/components/inserter/hooks/use-patterns-state.js +18 -5
  595. package/src/components/inserter/index.js +4 -5
  596. package/src/components/inserter/library.js +6 -0
  597. package/src/components/inserter/media-tab/media-preview.js +2 -2
  598. package/src/components/inserter/menu.js +113 -107
  599. package/src/components/inserter/quick-inserter.js +2 -2
  600. package/src/components/inserter/style.scss +6 -8
  601. package/src/components/inserter/tabs.js +29 -15
  602. package/src/components/inserter-list-item/index.js +3 -3
  603. package/src/components/keyboard-shortcuts/index.js +12 -0
  604. package/src/components/line-height-control/test/index.js +16 -14
  605. package/src/components/link-control/index.js +2 -2
  606. package/src/components/link-control/link-preview.js +3 -3
  607. package/src/components/link-control/search-results.js +2 -2
  608. package/src/components/list-view/block-contents.js +2 -2
  609. package/src/components/list-view/block-select-button.js +14 -3
  610. package/src/components/list-view/block.js +54 -30
  611. package/src/components/list-view/drop-indicator.js +3 -3
  612. package/src/components/list-view/index.js +2 -2
  613. package/src/components/list-view/leaf.js +2 -5
  614. package/src/components/media-placeholder/index.js +4 -4
  615. package/src/components/media-replace-flow/index.js +2 -2
  616. package/src/components/plain-text/index.js +2 -2
  617. package/src/components/provider/use-block-sync.js +27 -1
  618. package/src/components/responsive-block-control/index.js +2 -2
  619. package/src/components/rich-text/README.md +0 -8
  620. package/src/components/rich-text/event-listeners/enter.js +28 -48
  621. package/src/components/rich-text/event-listeners/paste-handler.js +21 -58
  622. package/src/components/rich-text/format-toolbar/index.js +2 -2
  623. package/src/components/rich-text/index.js +10 -3
  624. package/src/components/rich-text/index.native.js +2 -2
  625. package/src/components/rich-text/multiline.js +31 -3
  626. package/src/components/segmented-text-control/index.js +2 -2
  627. package/src/components/text-alignment-control/index.js +2 -2
  628. package/src/components/text-decoration-control/index.js +2 -2
  629. package/src/components/text-transform-control/index.js +2 -2
  630. package/src/components/url-input/index.js +4 -4
  631. package/src/components/url-popover/link-editor.js +2 -2
  632. package/src/components/url-popover/link-viewer-url.js +2 -2
  633. package/src/components/url-popover/link-viewer.js +2 -2
  634. package/src/components/warning/index.js +2 -2
  635. package/src/components/writing-flow/index.js +2 -2
  636. package/src/components/writing-flow/use-clipboard-handler.js +107 -47
  637. package/src/components/writing-flow/use-input.js +75 -1
  638. package/src/components/writing-flow/use-tab-nav.js +10 -1
  639. package/src/components/writing-mode-control/index.js +2 -5
  640. package/src/content.scss +1 -0
  641. package/src/hooks/align.js +2 -2
  642. package/src/hooks/background.js +1 -1
  643. package/src/hooks/border.js +3 -3
  644. package/src/hooks/color.js +12 -19
  645. package/src/hooks/color.scss +1 -0
  646. package/src/hooks/content-lock-ui.js +16 -33
  647. package/src/hooks/custom-class-name.js +2 -2
  648. package/src/hooks/custom-class-name.native.js +2 -2
  649. package/src/hooks/dimensions.js +2 -2
  650. package/src/hooks/layout-child.js +34 -20
  651. package/src/hooks/layout.js +2 -2
  652. package/src/hooks/position.js +2 -2
  653. package/src/hooks/text-align.js +3 -3
  654. package/src/hooks/use-bindings-attributes.js +48 -16
  655. package/src/hooks/use-color-props.js +2 -2
  656. package/src/hooks/use-typography-props.js +2 -2
  657. package/src/hooks/utils.js +2 -2
  658. package/src/layouts/grid.js +3 -7
  659. package/src/private-apis.js +4 -0
  660. package/src/store/actions.js +225 -70
  661. package/src/store/private-actions.js +24 -0
  662. package/src/store/private-keys.js +1 -0
  663. package/src/store/private-selectors.js +15 -0
  664. package/src/store/selectors.js +4 -2
  665. package/src/utils/selection.js +8 -0
  666. package/src/utils/test/__snapshots__/transform-styles.js.snap +6 -0
  667. package/src/utils/test/transform-styles.js +14 -0
  668. package/src/utils/transform-styles/index.js +12 -9
  669. package/tsconfig.tsbuildinfo +1 -1
  670. package/build/components/rich-text/split-value.js +0 -81
  671. package/build/components/rich-text/split-value.js.map +0 -1
  672. package/build-module/components/rich-text/split-value.js +0 -75
  673. package/build-module/components/rich-text/split-value.js.map +0 -1
  674. package/src/components/rich-text/split-value.js +0 -64
@@ -1 +1 @@
1
- {"version":3,"names":["classnames","createHigherOrderComponent","useInstanceId","addFilter","getBlockSupport","hasBlockSupport","useSelect","Button","ButtonGroup","ToggleControl","PanelBody","privateApis","componentsPrivateApis","__","store","blockEditorStore","InspectorControls","useSettings","getLayoutType","getLayoutTypes","useBlockEditingMode","LAYOUT_DEFINITIONS","useBlockSettings","useStyleOverride","unlock","layoutBlockSupportKey","hasLayoutBlockSupport","blockName","useLayoutClasses","blockAttributes","kebabCase","layout","default","defaultBlockLayout","usedLayout","inherit","contentSize","wideSize","type","layoutClassnames","className","baseClassName","splitBlockName","split","fullBlockName","pop","join","compoundClassName","push","hasGlobalPadding","select","getSettings","__experimentalFeatures","useRootPaddingAwareAlignments","orientation","justifyContent","flexWrap","useLayoutStyles","selector","style","fullLayoutType","blockGapSupport","hasBlockGapSupport","getLayoutStyle","LayoutPanelPure","setAttributes","name","clientId","settings","layoutSettings","themeSupportsLayout","supportsLayout","blockEditingMode","layoutBlockSupport","blockSupportAndThemeSettings","allowSwitching","allowEditing","allowInheriting","blockSupportAndLayout","defaultType","blockLayoutType","showInheritToggle","layoutType","constrainedType","displayControlsForLegacyLayouts","hasContentSizeOrLegacySettings","onChangeType","newType","onChangeLayout","newLayout","createElement","Fragment","title","__nextHasNoMarginBottom","label","checked","onChange","help","LayoutTypeSwitcher","inspectorControls","toolBarControls","shareWithChildBlocks","edit","attributeKeys","hasSupport","map","key","isPressed","onClick","addAttribute","_settings$attributes$","attributes","BlockWithLayoutStyles","block","BlockListBlock","props","layoutClasses","id","selectorPrefix","css","layoutClassNames","__unstableLayoutClassNames","withLayoutStyles","blockSupportsLayout","extraProps","getBlockSettings","disableLayoutStyles","undefined"],"sources":["@wordpress/block-editor/src/hooks/layout.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { createHigherOrderComponent, useInstanceId } from '@wordpress/compose';\nimport { addFilter } from '@wordpress/hooks';\nimport { getBlockSupport, hasBlockSupport } from '@wordpress/blocks';\nimport { useSelect } from '@wordpress/data';\nimport {\n\tButton,\n\tButtonGroup,\n\tToggleControl,\n\tPanelBody,\n\tprivateApis as componentsPrivateApis,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../store';\nimport { InspectorControls } from '../components';\nimport { useSettings } from '../components/use-settings';\nimport { getLayoutType, getLayoutTypes } from '../layouts';\nimport { useBlockEditingMode } from '../components/block-editing-mode';\nimport { LAYOUT_DEFINITIONS } from '../layouts/definitions';\nimport { useBlockSettings, useStyleOverride } from './utils';\nimport { unlock } from '../lock-unlock';\n\nconst layoutBlockSupportKey = 'layout';\n\nfunction hasLayoutBlockSupport( blockName ) {\n\treturn (\n\t\thasBlockSupport( blockName, 'layout' ) ||\n\t\thasBlockSupport( blockName, '__experimentalLayout' )\n\t);\n}\n\n/**\n * Generates the utility classnames for the given block's layout attributes.\n *\n * @param { Object } blockAttributes Block attributes.\n * @param { string } blockName Block name.\n *\n * @return { Array } Array of CSS classname strings.\n */\nexport function useLayoutClasses( blockAttributes = {}, blockName = '' ) {\n\tconst { kebabCase } = unlock( componentsPrivateApis );\n\tconst { layout } = blockAttributes;\n\tconst { default: defaultBlockLayout } =\n\t\tgetBlockSupport( blockName, layoutBlockSupportKey ) || {};\n\tconst usedLayout =\n\t\tlayout?.inherit || layout?.contentSize || layout?.wideSize\n\t\t\t? { ...layout, type: 'constrained' }\n\t\t\t: layout || defaultBlockLayout || {};\n\n\tconst layoutClassnames = [];\n\n\tif ( LAYOUT_DEFINITIONS[ usedLayout?.type || 'default' ]?.className ) {\n\t\tconst baseClassName =\n\t\t\tLAYOUT_DEFINITIONS[ usedLayout?.type || 'default' ]?.className;\n\t\tconst splitBlockName = blockName.split( '/' );\n\t\tconst fullBlockName =\n\t\t\tsplitBlockName[ 0 ] === 'core'\n\t\t\t\t? splitBlockName.pop()\n\t\t\t\t: splitBlockName.join( '-' );\n\t\tconst compoundClassName = `wp-block-${ fullBlockName }-${ baseClassName }`;\n\t\tlayoutClassnames.push( baseClassName, compoundClassName );\n\t}\n\n\tconst hasGlobalPadding = useSelect(\n\t\t( select ) => {\n\t\t\treturn (\n\t\t\t\t( usedLayout?.inherit ||\n\t\t\t\t\tusedLayout?.contentSize ||\n\t\t\t\t\tusedLayout?.type === 'constrained' ) &&\n\t\t\t\tselect( blockEditorStore ).getSettings().__experimentalFeatures\n\t\t\t\t\t?.useRootPaddingAwareAlignments\n\t\t\t);\n\t\t},\n\t\t[ usedLayout?.contentSize, usedLayout?.inherit, usedLayout?.type ]\n\t);\n\n\tif ( hasGlobalPadding ) {\n\t\tlayoutClassnames.push( 'has-global-padding' );\n\t}\n\n\tif ( usedLayout?.orientation ) {\n\t\tlayoutClassnames.push( `is-${ kebabCase( usedLayout.orientation ) }` );\n\t}\n\n\tif ( usedLayout?.justifyContent ) {\n\t\tlayoutClassnames.push(\n\t\t\t`is-content-justification-${ kebabCase(\n\t\t\t\tusedLayout.justifyContent\n\t\t\t) }`\n\t\t);\n\t}\n\n\tif ( usedLayout?.flexWrap && usedLayout.flexWrap === 'nowrap' ) {\n\t\tlayoutClassnames.push( 'is-nowrap' );\n\t}\n\n\treturn layoutClassnames;\n}\n\n/**\n * Generates a CSS rule with the given block's layout styles.\n *\n * @param { Object } blockAttributes Block attributes.\n * @param { string } blockName Block name.\n * @param { string } selector A selector to use in generating the CSS rule.\n *\n * @return { string } CSS rule.\n */\nexport function useLayoutStyles( blockAttributes = {}, blockName, selector ) {\n\tconst { layout = {}, style = {} } = blockAttributes;\n\t// Update type for blocks using legacy layouts.\n\tconst usedLayout =\n\t\tlayout?.inherit || layout?.contentSize || layout?.wideSize\n\t\t\t? { ...layout, type: 'constrained' }\n\t\t\t: layout || {};\n\tconst fullLayoutType = getLayoutType( usedLayout?.type || 'default' );\n\tconst [ blockGapSupport ] = useSettings( 'spacing.blockGap' );\n\tconst hasBlockGapSupport = blockGapSupport !== null;\n\treturn fullLayoutType?.getLayoutStyle?.( {\n\t\tblockName,\n\t\tselector,\n\t\tlayout,\n\t\tstyle,\n\t\thasBlockGapSupport,\n\t} );\n}\n\nfunction LayoutPanelPure( {\n\tlayout,\n\tsetAttributes,\n\tname: blockName,\n\tclientId,\n} ) {\n\tconst settings = useBlockSettings( blockName );\n\t// Block settings come from theme.json under settings.[blockName].\n\tconst { layout: layoutSettings } = settings;\n\tconst { themeSupportsLayout } = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\treturn {\n\t\t\tthemeSupportsLayout: getSettings().supportsLayout,\n\t\t};\n\t}, [] );\n\tconst blockEditingMode = useBlockEditingMode();\n\n\tif ( blockEditingMode !== 'default' ) {\n\t\treturn null;\n\t}\n\n\t// Layout block support comes from the block's block.json.\n\tconst layoutBlockSupport = getBlockSupport(\n\t\tblockName,\n\t\tlayoutBlockSupportKey,\n\t\t{}\n\t);\n\tconst blockSupportAndThemeSettings = {\n\t\t...layoutSettings,\n\t\t...layoutBlockSupport,\n\t};\n\tconst {\n\t\tallowSwitching,\n\t\tallowEditing = true,\n\t\tallowInheriting = true,\n\t\tdefault: defaultBlockLayout,\n\t} = blockSupportAndThemeSettings;\n\n\tif ( ! allowEditing ) {\n\t\treturn null;\n\t}\n\n\t/*\n\t * Try to find the layout type from either the\n\t * block's layout settings or any saved layout config.\n\t */\n\tconst blockSupportAndLayout = {\n\t\t...layoutBlockSupport,\n\t\t...layout,\n\t};\n\tconst { type, default: { type: defaultType = 'default' } = {} } =\n\t\tblockSupportAndLayout;\n\tconst blockLayoutType = type || defaultType;\n\n\t// Only show the inherit toggle if it's supported,\n\t// and either the default / flow or the constrained layout type is in use, as the toggle switches from one to the other.\n\tconst showInheritToggle = !! (\n\t\tallowInheriting &&\n\t\t( ! blockLayoutType ||\n\t\t\tblockLayoutType === 'default' ||\n\t\t\tblockLayoutType === 'constrained' ||\n\t\t\tblockSupportAndLayout.inherit )\n\t);\n\n\tconst usedLayout = layout || defaultBlockLayout || {};\n\tconst { inherit = false, contentSize = null } = usedLayout;\n\t/**\n\t * `themeSupportsLayout` is only relevant to the `default/flow` or\n\t * `constrained` layouts and it should not be taken into account when other\n\t * `layout` types are used.\n\t */\n\tif (\n\t\t( blockLayoutType === 'default' ||\n\t\t\tblockLayoutType === 'constrained' ) &&\n\t\t! themeSupportsLayout\n\t) {\n\t\treturn null;\n\t}\n\tconst layoutType = getLayoutType( blockLayoutType );\n\tconst constrainedType = getLayoutType( 'constrained' );\n\tconst displayControlsForLegacyLayouts =\n\t\t! usedLayout.type && ( contentSize || inherit );\n\tconst hasContentSizeOrLegacySettings = !! inherit || !! contentSize;\n\n\tconst onChangeType = ( newType ) =>\n\t\tsetAttributes( { layout: { type: newType } } );\n\tconst onChangeLayout = ( newLayout ) =>\n\t\tsetAttributes( { layout: newLayout } );\n\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Layout' ) }>\n\t\t\t\t\t{ showInheritToggle && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\tclassName=\"block-editor-hooks__toggle-control\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Inner blocks use content width' ) }\n\t\t\t\t\t\t\t\tchecked={\n\t\t\t\t\t\t\t\t\tlayoutType?.name === 'constrained' ||\n\t\t\t\t\t\t\t\t\thasContentSizeOrLegacySettings\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\tlayout: {\n\t\t\t\t\t\t\t\t\t\t\ttype:\n\t\t\t\t\t\t\t\t\t\t\t\tlayoutType?.name ===\n\t\t\t\t\t\t\t\t\t\t\t\t\t'constrained' ||\n\t\t\t\t\t\t\t\t\t\t\t\thasContentSizeOrLegacySettings\n\t\t\t\t\t\t\t\t\t\t\t\t\t? 'default'\n\t\t\t\t\t\t\t\t\t\t\t\t\t: 'constrained',\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\thelp={\n\t\t\t\t\t\t\t\t\tlayoutType?.name === 'constrained' ||\n\t\t\t\t\t\t\t\t\thasContentSizeOrLegacySettings\n\t\t\t\t\t\t\t\t\t\t? __(\n\t\t\t\t\t\t\t\t\t\t\t\t'Nested blocks use content width with options for full and wide widths.'\n\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t\t: __(\n\t\t\t\t\t\t\t\t\t\t\t\t'Nested blocks will fill the width of this container. Toggle to constrain.'\n\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\n\t\t\t\t\t{ ! inherit && allowSwitching && (\n\t\t\t\t\t\t<LayoutTypeSwitcher\n\t\t\t\t\t\t\ttype={ blockLayoutType }\n\t\t\t\t\t\t\tonChange={ onChangeType }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\n\t\t\t\t\t{ layoutType && layoutType.name !== 'default' && (\n\t\t\t\t\t\t<layoutType.inspectorControls\n\t\t\t\t\t\t\tlayout={ usedLayout }\n\t\t\t\t\t\t\tonChange={ onChangeLayout }\n\t\t\t\t\t\t\tlayoutBlockSupport={ blockSupportAndThemeSettings }\n\t\t\t\t\t\t\tname={ blockName }\n\t\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ constrainedType && displayControlsForLegacyLayouts && (\n\t\t\t\t\t\t<constrainedType.inspectorControls\n\t\t\t\t\t\t\tlayout={ usedLayout }\n\t\t\t\t\t\t\tonChange={ onChangeLayout }\n\t\t\t\t\t\t\tlayoutBlockSupport={ blockSupportAndThemeSettings }\n\t\t\t\t\t\t\tname={ blockName }\n\t\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t\t{ ! inherit && layoutType && (\n\t\t\t\t<layoutType.toolBarControls\n\t\t\t\t\tlayout={ usedLayout }\n\t\t\t\t\tonChange={ onChangeLayout }\n\t\t\t\t\tlayoutBlockSupport={ layoutBlockSupport }\n\t\t\t\t\tname={ blockName }\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport default {\n\tshareWithChildBlocks: true,\n\tedit: LayoutPanelPure,\n\tattributeKeys: [ 'layout' ],\n\thasSupport( name ) {\n\t\treturn hasLayoutBlockSupport( name );\n\t},\n};\n\nfunction LayoutTypeSwitcher( { type, onChange } ) {\n\treturn (\n\t\t<ButtonGroup>\n\t\t\t{ getLayoutTypes().map( ( { name, label } ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tkey={ name }\n\t\t\t\t\t\tisPressed={ type === name }\n\t\t\t\t\t\tonClick={ () => onChange( name ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ label }\n\t\t\t\t\t</Button>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</ButtonGroup>\n\t);\n}\n\n/**\n * Filters registered block settings, extending attributes to include `layout`.\n *\n * @param {Object} settings Original block settings.\n *\n * @return {Object} Filtered block settings.\n */\nexport function addAttribute( settings ) {\n\tif ( 'type' in ( settings.attributes?.layout ?? {} ) ) {\n\t\treturn settings;\n\t}\n\tif ( hasLayoutBlockSupport( settings ) ) {\n\t\tsettings.attributes = {\n\t\t\t...settings.attributes,\n\t\t\tlayout: {\n\t\t\t\ttype: 'object',\n\t\t\t},\n\t\t};\n\t}\n\n\treturn settings;\n}\n\nfunction BlockWithLayoutStyles( {\n\tblock: BlockListBlock,\n\tprops,\n\tblockGapSupport,\n\tlayoutClasses,\n} ) {\n\tconst { name, attributes } = props;\n\tconst id = useInstanceId( BlockListBlock );\n\tconst { layout } = attributes;\n\tconst { default: defaultBlockLayout } =\n\t\tgetBlockSupport( name, layoutBlockSupportKey ) || {};\n\tconst usedLayout =\n\t\tlayout?.inherit || layout?.contentSize || layout?.wideSize\n\t\t\t? { ...layout, type: 'constrained' }\n\t\t\t: layout || defaultBlockLayout || {};\n\n\tconst { kebabCase } = unlock( componentsPrivateApis );\n\tconst selectorPrefix = `wp-container-${ kebabCase( name ) }-is-layout-`;\n\t// Higher specificity to override defaults from theme.json.\n\tconst selector = `.${ selectorPrefix }${ id }`;\n\tconst hasBlockGapSupport = blockGapSupport !== null;\n\n\t// Get CSS string for the current layout type.\n\t// The CSS and `style` element is only output if it is not empty.\n\tconst fullLayoutType = getLayoutType( usedLayout?.type || 'default' );\n\tconst css = fullLayoutType?.getLayoutStyle?.( {\n\t\tblockName: name,\n\t\tselector,\n\t\tlayout: usedLayout,\n\t\tstyle: attributes?.style,\n\t\thasBlockGapSupport,\n\t} );\n\n\t// Attach a `wp-container-` id-based class name as well as a layout class name such as `is-layout-flex`.\n\tconst layoutClassNames = classnames(\n\t\t{\n\t\t\t[ `${ selectorPrefix }${ id }` ]: !! css, // Only attach a container class if there is generated CSS to be attached.\n\t\t},\n\t\tlayoutClasses\n\t);\n\n\tuseStyleOverride( { css } );\n\n\treturn (\n\t\t<BlockListBlock\n\t\t\t{ ...props }\n\t\t\t__unstableLayoutClassNames={ layoutClassNames }\n\t\t/>\n\t);\n}\n\n/**\n * Override the default block element to add the layout styles.\n *\n * @param {Function} BlockListBlock Original component.\n *\n * @return {Function} Wrapped component.\n */\nexport const withLayoutStyles = createHigherOrderComponent(\n\t( BlockListBlock ) => ( props ) => {\n\t\tconst { clientId, name, attributes } = props;\n\t\tconst blockSupportsLayout = hasLayoutBlockSupport( name );\n\t\tconst layoutClasses = useLayoutClasses( attributes, name );\n\t\tconst extraProps = useSelect(\n\t\t\t( select ) => {\n\t\t\t\t// The callback returns early to avoid block editor subscription.\n\t\t\t\tif ( ! blockSupportsLayout ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst { getSettings, getBlockSettings } = unlock(\n\t\t\t\t\tselect( blockEditorStore )\n\t\t\t\t);\n\t\t\t\tconst { disableLayoutStyles } = getSettings();\n\n\t\t\t\tif ( disableLayoutStyles ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst [ blockGapSupport ] = getBlockSettings(\n\t\t\t\t\tclientId,\n\t\t\t\t\t'spacing.blockGap'\n\t\t\t\t);\n\n\t\t\t\treturn { blockGapSupport };\n\t\t\t},\n\t\t\t[ blockSupportsLayout, clientId ]\n\t\t);\n\n\t\tif ( ! extraProps ) {\n\t\t\treturn (\n\t\t\t\t<BlockListBlock\n\t\t\t\t\t{ ...props }\n\t\t\t\t\t__unstableLayoutClassNames={\n\t\t\t\t\t\tblockSupportsLayout ? layoutClasses : undefined\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<BlockWithLayoutStyles\n\t\t\t\tblock={ BlockListBlock }\n\t\t\t\tprops={ props }\n\t\t\t\tlayoutClasses={ layoutClasses }\n\t\t\t\t{ ...extraProps }\n\t\t\t/>\n\t\t);\n\t},\n\t'withLayoutStyles'\n);\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/layout/addAttribute',\n\taddAttribute\n);\naddFilter(\n\t'editor.BlockListBlock',\n\t'core/editor/layout/with-layout-styles',\n\twithLayoutStyles\n);\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,0BAA0B,EAAEC,aAAa,QAAQ,oBAAoB;AAC9E,SAASC,SAAS,QAAQ,kBAAkB;AAC5C,SAASC,eAAe,EAAEC,eAAe,QAAQ,mBAAmB;AACpE,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAC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;EACzD,MAAMkD,aAAa,GAAGxF,gBAAgB,CAAEmF,UAAU,EAAE7C,IAAK,CAAC;EAC1D,MAAM0D,UAAU,GAAGtH,SAAS,CACzB4C,MAAM,IAAM;IACb;IACA,IAAK,CAAEyE,mBAAmB,EAAG;MAC5B;IACD;IAEA,MAAM;MAAExE,WAAW;MAAE0E;IAAiB,CAAC,GAAGrG,MAAM,CAC/C0B,MAAM,CAAEnC,gBAAiB,CAC1B,CAAC;IACD,MAAM;MAAE+G;IAAoB,CAAC,GAAG3E,WAAW,CAAC,CAAC;IAE7C,IAAK2E,mBAAmB,EAAG;MAC1B;IACD;IAEA,MAAM,CAAEjE,eAAe,CAAE,GAAGgE,gBAAgB,CAC3C1D,QAAQ,EACR,kBACD,CAAC;IAED,OAAO;MAAEN;IAAgB,CAAC;EAC3B,CAAC,EACD,CAAE8D,mBAAmB,EAAExD,QAAQ,CAChC,CAAC;EAED,IAAK,CAAEyD,UAAU,EAAG;IACnB,OACClC,aAAA,CAACwB,cAAc;MAAA,GACTC,KAAK;MACVM,0BAA0B,EACzBE,mBAAmB,GAAGP,aAAa,GAAGW;IACtC,CACD,CAAC;EAEJ;EAEA,OACCrC,aAAA,CAACsB,qBAAqB;IACrBC,KAAK,EAAGC,cAAgB;IACxBC,KAAK,EAAGA,KAAO;IACfC,aAAa,EAAGA,aAAe;IAAA,GAC1BQ;EAAU,CACf,CAAC;AAEJ,CAAC,EACD,kBACD,CAAC;AAEDzH,SAAS,CACR,0BAA0B,EAC1B,0BAA0B,EAC1B0G,YACD,CAAC;AACD1G,SAAS,CACR,uBAAuB,EACvB,uCAAuC,EACvCuH,gBACD,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["clsx","createHigherOrderComponent","useInstanceId","addFilter","getBlockSupport","hasBlockSupport","useSelect","Button","ButtonGroup","ToggleControl","PanelBody","privateApis","componentsPrivateApis","__","store","blockEditorStore","InspectorControls","useSettings","getLayoutType","getLayoutTypes","useBlockEditingMode","LAYOUT_DEFINITIONS","useBlockSettings","useStyleOverride","unlock","layoutBlockSupportKey","hasLayoutBlockSupport","blockName","useLayoutClasses","blockAttributes","kebabCase","layout","default","defaultBlockLayout","usedLayout","inherit","contentSize","wideSize","type","layoutClassnames","className","baseClassName","splitBlockName","split","fullBlockName","pop","join","compoundClassName","push","hasGlobalPadding","select","getSettings","__experimentalFeatures","useRootPaddingAwareAlignments","orientation","justifyContent","flexWrap","useLayoutStyles","selector","style","fullLayoutType","blockGapSupport","hasBlockGapSupport","getLayoutStyle","LayoutPanelPure","setAttributes","name","clientId","settings","layoutSettings","themeSupportsLayout","supportsLayout","blockEditingMode","layoutBlockSupport","blockSupportAndThemeSettings","allowSwitching","allowEditing","allowInheriting","blockSupportAndLayout","defaultType","blockLayoutType","showInheritToggle","layoutType","constrainedType","displayControlsForLegacyLayouts","hasContentSizeOrLegacySettings","onChangeType","newType","onChangeLayout","newLayout","createElement","Fragment","title","__nextHasNoMarginBottom","label","checked","onChange","help","LayoutTypeSwitcher","inspectorControls","toolBarControls","shareWithChildBlocks","edit","attributeKeys","hasSupport","map","key","isPressed","onClick","addAttribute","_settings$attributes$","attributes","BlockWithLayoutStyles","block","BlockListBlock","props","layoutClasses","id","selectorPrefix","css","layoutClassNames","__unstableLayoutClassNames","withLayoutStyles","blockSupportsLayout","extraProps","getBlockSettings","disableLayoutStyles","undefined"],"sources":["@wordpress/block-editor/src/hooks/layout.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { createHigherOrderComponent, useInstanceId } from '@wordpress/compose';\nimport { addFilter } from '@wordpress/hooks';\nimport { getBlockSupport, hasBlockSupport } from '@wordpress/blocks';\nimport { useSelect } from '@wordpress/data';\nimport {\n\tButton,\n\tButtonGroup,\n\tToggleControl,\n\tPanelBody,\n\tprivateApis as componentsPrivateApis,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../store';\nimport { InspectorControls } from '../components';\nimport { useSettings } from '../components/use-settings';\nimport { getLayoutType, getLayoutTypes } from '../layouts';\nimport { useBlockEditingMode } from '../components/block-editing-mode';\nimport { LAYOUT_DEFINITIONS } from '../layouts/definitions';\nimport { useBlockSettings, useStyleOverride } from './utils';\nimport { unlock } from '../lock-unlock';\n\nconst layoutBlockSupportKey = 'layout';\n\nfunction hasLayoutBlockSupport( blockName ) {\n\treturn (\n\t\thasBlockSupport( blockName, 'layout' ) ||\n\t\thasBlockSupport( blockName, '__experimentalLayout' )\n\t);\n}\n\n/**\n * Generates the utility classnames for the given block's layout attributes.\n *\n * @param { Object } blockAttributes Block attributes.\n * @param { string } blockName Block name.\n *\n * @return { Array } Array of CSS classname strings.\n */\nexport function useLayoutClasses( blockAttributes = {}, blockName = '' ) {\n\tconst { kebabCase } = unlock( componentsPrivateApis );\n\tconst { layout } = blockAttributes;\n\tconst { default: defaultBlockLayout } =\n\t\tgetBlockSupport( blockName, layoutBlockSupportKey ) || {};\n\tconst usedLayout =\n\t\tlayout?.inherit || layout?.contentSize || layout?.wideSize\n\t\t\t? { ...layout, type: 'constrained' }\n\t\t\t: layout || defaultBlockLayout || {};\n\n\tconst layoutClassnames = [];\n\n\tif ( LAYOUT_DEFINITIONS[ usedLayout?.type || 'default' ]?.className ) {\n\t\tconst baseClassName =\n\t\t\tLAYOUT_DEFINITIONS[ usedLayout?.type || 'default' ]?.className;\n\t\tconst splitBlockName = blockName.split( '/' );\n\t\tconst fullBlockName =\n\t\t\tsplitBlockName[ 0 ] === 'core'\n\t\t\t\t? splitBlockName.pop()\n\t\t\t\t: splitBlockName.join( '-' );\n\t\tconst compoundClassName = `wp-block-${ fullBlockName }-${ baseClassName }`;\n\t\tlayoutClassnames.push( baseClassName, compoundClassName );\n\t}\n\n\tconst hasGlobalPadding = useSelect(\n\t\t( select ) => {\n\t\t\treturn (\n\t\t\t\t( usedLayout?.inherit ||\n\t\t\t\t\tusedLayout?.contentSize ||\n\t\t\t\t\tusedLayout?.type === 'constrained' ) &&\n\t\t\t\tselect( blockEditorStore ).getSettings().__experimentalFeatures\n\t\t\t\t\t?.useRootPaddingAwareAlignments\n\t\t\t);\n\t\t},\n\t\t[ usedLayout?.contentSize, usedLayout?.inherit, usedLayout?.type ]\n\t);\n\n\tif ( hasGlobalPadding ) {\n\t\tlayoutClassnames.push( 'has-global-padding' );\n\t}\n\n\tif ( usedLayout?.orientation ) {\n\t\tlayoutClassnames.push( `is-${ kebabCase( usedLayout.orientation ) }` );\n\t}\n\n\tif ( usedLayout?.justifyContent ) {\n\t\tlayoutClassnames.push(\n\t\t\t`is-content-justification-${ kebabCase(\n\t\t\t\tusedLayout.justifyContent\n\t\t\t) }`\n\t\t);\n\t}\n\n\tif ( usedLayout?.flexWrap && usedLayout.flexWrap === 'nowrap' ) {\n\t\tlayoutClassnames.push( 'is-nowrap' );\n\t}\n\n\treturn layoutClassnames;\n}\n\n/**\n * Generates a CSS rule with the given block's layout styles.\n *\n * @param { Object } blockAttributes Block attributes.\n * @param { string } blockName Block name.\n * @param { string } selector A selector to use in generating the CSS rule.\n *\n * @return { string } CSS rule.\n */\nexport function useLayoutStyles( blockAttributes = {}, blockName, selector ) {\n\tconst { layout = {}, style = {} } = blockAttributes;\n\t// Update type for blocks using legacy layouts.\n\tconst usedLayout =\n\t\tlayout?.inherit || layout?.contentSize || layout?.wideSize\n\t\t\t? { ...layout, type: 'constrained' }\n\t\t\t: layout || {};\n\tconst fullLayoutType = getLayoutType( usedLayout?.type || 'default' );\n\tconst [ blockGapSupport ] = useSettings( 'spacing.blockGap' );\n\tconst hasBlockGapSupport = blockGapSupport !== null;\n\treturn fullLayoutType?.getLayoutStyle?.( {\n\t\tblockName,\n\t\tselector,\n\t\tlayout,\n\t\tstyle,\n\t\thasBlockGapSupport,\n\t} );\n}\n\nfunction LayoutPanelPure( {\n\tlayout,\n\tsetAttributes,\n\tname: blockName,\n\tclientId,\n} ) {\n\tconst settings = useBlockSettings( blockName );\n\t// Block settings come from theme.json under settings.[blockName].\n\tconst { layout: layoutSettings } = settings;\n\tconst { themeSupportsLayout } = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\treturn {\n\t\t\tthemeSupportsLayout: getSettings().supportsLayout,\n\t\t};\n\t}, [] );\n\tconst blockEditingMode = useBlockEditingMode();\n\n\tif ( blockEditingMode !== 'default' ) {\n\t\treturn null;\n\t}\n\n\t// Layout block support comes from the block's block.json.\n\tconst layoutBlockSupport = getBlockSupport(\n\t\tblockName,\n\t\tlayoutBlockSupportKey,\n\t\t{}\n\t);\n\tconst blockSupportAndThemeSettings = {\n\t\t...layoutSettings,\n\t\t...layoutBlockSupport,\n\t};\n\tconst {\n\t\tallowSwitching,\n\t\tallowEditing = true,\n\t\tallowInheriting = true,\n\t\tdefault: defaultBlockLayout,\n\t} = blockSupportAndThemeSettings;\n\n\tif ( ! allowEditing ) {\n\t\treturn null;\n\t}\n\n\t/*\n\t * Try to find the layout type from either the\n\t * block's layout settings or any saved layout config.\n\t */\n\tconst blockSupportAndLayout = {\n\t\t...layoutBlockSupport,\n\t\t...layout,\n\t};\n\tconst { type, default: { type: defaultType = 'default' } = {} } =\n\t\tblockSupportAndLayout;\n\tconst blockLayoutType = type || defaultType;\n\n\t// Only show the inherit toggle if it's supported,\n\t// and either the default / flow or the constrained layout type is in use, as the toggle switches from one to the other.\n\tconst showInheritToggle = !! (\n\t\tallowInheriting &&\n\t\t( ! blockLayoutType ||\n\t\t\tblockLayoutType === 'default' ||\n\t\t\tblockLayoutType === 'constrained' ||\n\t\t\tblockSupportAndLayout.inherit )\n\t);\n\n\tconst usedLayout = layout || defaultBlockLayout || {};\n\tconst { inherit = false, contentSize = null } = usedLayout;\n\t/**\n\t * `themeSupportsLayout` is only relevant to the `default/flow` or\n\t * `constrained` layouts and it should not be taken into account when other\n\t * `layout` types are used.\n\t */\n\tif (\n\t\t( blockLayoutType === 'default' ||\n\t\t\tblockLayoutType === 'constrained' ) &&\n\t\t! themeSupportsLayout\n\t) {\n\t\treturn null;\n\t}\n\tconst layoutType = getLayoutType( blockLayoutType );\n\tconst constrainedType = getLayoutType( 'constrained' );\n\tconst displayControlsForLegacyLayouts =\n\t\t! usedLayout.type && ( contentSize || inherit );\n\tconst hasContentSizeOrLegacySettings = !! inherit || !! contentSize;\n\n\tconst onChangeType = ( newType ) =>\n\t\tsetAttributes( { layout: { type: newType } } );\n\tconst onChangeLayout = ( newLayout ) =>\n\t\tsetAttributes( { layout: newLayout } );\n\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Layout' ) }>\n\t\t\t\t\t{ showInheritToggle && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\tclassName=\"block-editor-hooks__toggle-control\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Inner blocks use content width' ) }\n\t\t\t\t\t\t\t\tchecked={\n\t\t\t\t\t\t\t\t\tlayoutType?.name === 'constrained' ||\n\t\t\t\t\t\t\t\t\thasContentSizeOrLegacySettings\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\tlayout: {\n\t\t\t\t\t\t\t\t\t\t\ttype:\n\t\t\t\t\t\t\t\t\t\t\t\tlayoutType?.name ===\n\t\t\t\t\t\t\t\t\t\t\t\t\t'constrained' ||\n\t\t\t\t\t\t\t\t\t\t\t\thasContentSizeOrLegacySettings\n\t\t\t\t\t\t\t\t\t\t\t\t\t? 'default'\n\t\t\t\t\t\t\t\t\t\t\t\t\t: 'constrained',\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\thelp={\n\t\t\t\t\t\t\t\t\tlayoutType?.name === 'constrained' ||\n\t\t\t\t\t\t\t\t\thasContentSizeOrLegacySettings\n\t\t\t\t\t\t\t\t\t\t? __(\n\t\t\t\t\t\t\t\t\t\t\t\t'Nested blocks use content width with options for full and wide widths.'\n\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t\t: __(\n\t\t\t\t\t\t\t\t\t\t\t\t'Nested blocks will fill the width of this container. Toggle to constrain.'\n\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\n\t\t\t\t\t{ ! inherit && allowSwitching && (\n\t\t\t\t\t\t<LayoutTypeSwitcher\n\t\t\t\t\t\t\ttype={ blockLayoutType }\n\t\t\t\t\t\t\tonChange={ onChangeType }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\n\t\t\t\t\t{ layoutType && layoutType.name !== 'default' && (\n\t\t\t\t\t\t<layoutType.inspectorControls\n\t\t\t\t\t\t\tlayout={ usedLayout }\n\t\t\t\t\t\t\tonChange={ onChangeLayout }\n\t\t\t\t\t\t\tlayoutBlockSupport={ blockSupportAndThemeSettings }\n\t\t\t\t\t\t\tname={ blockName }\n\t\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ constrainedType && displayControlsForLegacyLayouts && (\n\t\t\t\t\t\t<constrainedType.inspectorControls\n\t\t\t\t\t\t\tlayout={ usedLayout }\n\t\t\t\t\t\t\tonChange={ onChangeLayout }\n\t\t\t\t\t\t\tlayoutBlockSupport={ blockSupportAndThemeSettings }\n\t\t\t\t\t\t\tname={ blockName }\n\t\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t\t{ ! inherit && layoutType && (\n\t\t\t\t<layoutType.toolBarControls\n\t\t\t\t\tlayout={ usedLayout }\n\t\t\t\t\tonChange={ onChangeLayout }\n\t\t\t\t\tlayoutBlockSupport={ layoutBlockSupport }\n\t\t\t\t\tname={ blockName }\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport default {\n\tshareWithChildBlocks: true,\n\tedit: LayoutPanelPure,\n\tattributeKeys: [ 'layout' ],\n\thasSupport( name ) {\n\t\treturn hasLayoutBlockSupport( name );\n\t},\n};\n\nfunction LayoutTypeSwitcher( { type, onChange } ) {\n\treturn (\n\t\t<ButtonGroup>\n\t\t\t{ getLayoutTypes().map( ( { name, label } ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tkey={ name }\n\t\t\t\t\t\tisPressed={ type === name }\n\t\t\t\t\t\tonClick={ () => onChange( name ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ label }\n\t\t\t\t\t</Button>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</ButtonGroup>\n\t);\n}\n\n/**\n * Filters registered block settings, extending attributes to include `layout`.\n *\n * @param {Object} settings Original block settings.\n *\n * @return {Object} Filtered block settings.\n */\nexport function addAttribute( settings ) {\n\tif ( 'type' in ( settings.attributes?.layout ?? {} ) ) {\n\t\treturn settings;\n\t}\n\tif ( hasLayoutBlockSupport( settings ) ) {\n\t\tsettings.attributes = {\n\t\t\t...settings.attributes,\n\t\t\tlayout: {\n\t\t\t\ttype: 'object',\n\t\t\t},\n\t\t};\n\t}\n\n\treturn settings;\n}\n\nfunction BlockWithLayoutStyles( {\n\tblock: BlockListBlock,\n\tprops,\n\tblockGapSupport,\n\tlayoutClasses,\n} ) {\n\tconst { name, attributes } = props;\n\tconst id = useInstanceId( BlockListBlock );\n\tconst { layout } = attributes;\n\tconst { default: defaultBlockLayout } =\n\t\tgetBlockSupport( name, layoutBlockSupportKey ) || {};\n\tconst usedLayout =\n\t\tlayout?.inherit || layout?.contentSize || layout?.wideSize\n\t\t\t? { ...layout, type: 'constrained' }\n\t\t\t: layout || defaultBlockLayout || {};\n\n\tconst { kebabCase } = unlock( componentsPrivateApis );\n\tconst selectorPrefix = `wp-container-${ kebabCase( name ) }-is-layout-`;\n\t// Higher specificity to override defaults from theme.json.\n\tconst selector = `.${ selectorPrefix }${ id }`;\n\tconst hasBlockGapSupport = blockGapSupport !== null;\n\n\t// Get CSS string for the current layout type.\n\t// The CSS and `style` element is only output if it is not empty.\n\tconst fullLayoutType = getLayoutType( usedLayout?.type || 'default' );\n\tconst css = fullLayoutType?.getLayoutStyle?.( {\n\t\tblockName: name,\n\t\tselector,\n\t\tlayout: usedLayout,\n\t\tstyle: attributes?.style,\n\t\thasBlockGapSupport,\n\t} );\n\n\t// Attach a `wp-container-` id-based class name as well as a layout class name such as `is-layout-flex`.\n\tconst layoutClassNames = clsx(\n\t\t{\n\t\t\t[ `${ selectorPrefix }${ id }` ]: !! css, // Only attach a container class if there is generated CSS to be attached.\n\t\t},\n\t\tlayoutClasses\n\t);\n\n\tuseStyleOverride( { css } );\n\n\treturn (\n\t\t<BlockListBlock\n\t\t\t{ ...props }\n\t\t\t__unstableLayoutClassNames={ layoutClassNames }\n\t\t/>\n\t);\n}\n\n/**\n * Override the default block element to add the layout styles.\n *\n * @param {Function} BlockListBlock Original component.\n *\n * @return {Function} Wrapped component.\n */\nexport const withLayoutStyles = createHigherOrderComponent(\n\t( BlockListBlock ) => ( props ) => {\n\t\tconst { clientId, name, attributes } = props;\n\t\tconst blockSupportsLayout = hasLayoutBlockSupport( name );\n\t\tconst layoutClasses = useLayoutClasses( attributes, name );\n\t\tconst extraProps = useSelect(\n\t\t\t( select ) => {\n\t\t\t\t// The callback returns early to avoid block editor subscription.\n\t\t\t\tif ( ! blockSupportsLayout ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst { getSettings, getBlockSettings } = unlock(\n\t\t\t\t\tselect( blockEditorStore )\n\t\t\t\t);\n\t\t\t\tconst { disableLayoutStyles } = getSettings();\n\n\t\t\t\tif ( disableLayoutStyles ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst [ blockGapSupport ] = getBlockSettings(\n\t\t\t\t\tclientId,\n\t\t\t\t\t'spacing.blockGap'\n\t\t\t\t);\n\n\t\t\t\treturn { blockGapSupport };\n\t\t\t},\n\t\t\t[ blockSupportsLayout, clientId ]\n\t\t);\n\n\t\tif ( ! extraProps ) {\n\t\t\treturn (\n\t\t\t\t<BlockListBlock\n\t\t\t\t\t{ ...props }\n\t\t\t\t\t__unstableLayoutClassNames={\n\t\t\t\t\t\tblockSupportsLayout ? layoutClasses : undefined\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<BlockWithLayoutStyles\n\t\t\t\tblock={ BlockListBlock }\n\t\t\t\tprops={ props }\n\t\t\t\tlayoutClasses={ layoutClasses }\n\t\t\t\t{ ...extraProps }\n\t\t\t/>\n\t\t);\n\t},\n\t'withLayoutStyles'\n);\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/layout/addAttribute',\n\taddAttribute\n);\naddFilter(\n\t'editor.BlockListBlock',\n\t'core/editor/layout/with-layout-styles',\n\twithLayoutStyles\n);\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,0BAA0B,EAAEC,aAAa,QAAQ,oBAAoB;AAC9E,SAASC,SAAS,QAAQ,kBAAkB;AAC5C,SAASC,eAAe,EAAEC,eAAe,QAAQ,mBAAmB;AACpE,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SACCC,MAAM,EACNC,WAAW,EACXC,aAAa,EACbC,SAAS,EACTC,WAAW,IAAIC,qBAAqB,QAC9B,uBAAuB;AAC9B,SAASC,EAAE,QAAQ,iBAAiB;;AAEpC;AACA;AACA;AACA,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,UAAU;AACpD,SAASC,iBAAiB,QAAQ,eAAe;AACjD,SAASC,WAAW,QAAQ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AC/C0B,MAAM,CAAEnC,gBAAiB,CAC1B,CAAC;IACD,MAAM;MAAE+G;IAAoB,CAAC,GAAG3E,WAAW,CAAC,CAAC;IAE7C,IAAK2E,mBAAmB,EAAG;MAC1B;IACD;IAEA,MAAM,CAAEjE,eAAe,CAAE,GAAGgE,gBAAgB,CAC3C1D,QAAQ,EACR,kBACD,CAAC;IAED,OAAO;MAAEN;IAAgB,CAAC;EAC3B,CAAC,EACD,CAAE8D,mBAAmB,EAAExD,QAAQ,CAChC,CAAC;EAED,IAAK,CAAEyD,UAAU,EAAG;IACnB,OACClC,aAAA,CAACwB,cAAc;MAAA,GACTC,KAAK;MACVM,0BAA0B,EACzBE,mBAAmB,GAAGP,aAAa,GAAGW;IACtC,CACD,CAAC;EAEJ;EAEA,OACCrC,aAAA,CAACsB,qBAAqB;IACrBC,KAAK,EAAGC,cAAgB;IACxBC,KAAK,EAAGA,KAAO;IACfC,aAAa,EAAGA,aAAe;IAAA,GAC1BQ;EAAU,CACf,CAAC;AAEJ,CAAC,EACD,kBACD,CAAC;AAEDzH,SAAS,CACR,0BAA0B,EAC1B,0BAA0B,EAC1B0G,YACD,CAAC;AACD1G,SAAS,CACR,uBAAuB,EACvB,uCAAuC,EACvCuH,gBACD,CAAC","ignoreList":[]}
@@ -2,7 +2,7 @@ import { createElement } from "react";
2
2
  /**
3
3
  * External dependencies
4
4
  */
5
- import classnames from 'classnames';
5
+ import clsx from 'clsx';
6
6
 
7
7
  /**
8
8
  * WordPress dependencies
@@ -318,7 +318,7 @@ function useBlockProps({
318
318
  }
319
319
 
320
320
  // Attach a `wp-container-` id-based class name.
321
- const className = classnames({
321
+ const className = clsx({
322
322
  [`wp-container-${id}`]: allowPositionStyles && !!css,
323
323
  // Only attach a container class if there is generated CSS to be attached.
324
324
  [`is-position-${style?.position?.type}`]: allowPositionStyles && !!css && !!style?.position?.type
@@ -1 +1 @@
1
- {"version":3,"names":["classnames","__","_x","sprintf","getBlockSupport","hasBlockSupport","BaseControl","privateApis","componentsPrivateApis","useInstanceId","useSelect","useMemo","Platform","useSettings","InspectorControls","useBlockDisplayInformation","cleanEmptyObject","useStyleOverride","unlock","store","blockEditorStore","CustomSelectControl","POSITION_SUPPORT_KEY","OPTION_CLASSNAME","DEFAULT_OPTION","key","value","name","className","STICKY_OPTION","__experimentalHint","FIXED_OPTION","POSITION_SIDES","VALID_POSITION_TYPES","getPositionCSS","selector","style","output","type","positionType","position","includes","forEach","side","undefined","hasStickyPositionSupport","blockType","support","sticky","hasFixedPositionSupport","fixed","hasPositionSupport","hasPositionValue","props","attributes","hasStickyOrFixedPositionValue","resetPosition","setAttributes","top","right","bottom","left","useIsPositionDisabled","blockName","allowFixed","allowSticky","isDisabled","PositionPanelPure","clientId","firstParentClientId","select","getBlockParents","parents","length","blockInformation","stickyHelpText","title","options","availableOptions","push","onChangeType","next","placementValue","newStyle","selectedOption","find","option","web","createElement","group","__nextHasNoMarginBottom","help","__next40pxDefaultSize","label","hideLabelFromVision","describedBy","__experimentalShowSelectedHint","onChange","selectedItem","size","native","edit","Edit","isPositionDisabled","useBlockProps","attributeKeys","hasSupport","hasPositionBlockSupport","allowPositionStyles","id","positionSelector","css"],"sources":["@wordpress/block-editor/src/hooks/position.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport { getBlockSupport, hasBlockSupport } from '@wordpress/blocks';\nimport {\n\tBaseControl,\n\tprivateApis as componentsPrivateApis,\n} from '@wordpress/components';\nimport { useInstanceId } from '@wordpress/compose';\nimport { useSelect } from '@wordpress/data';\nimport { useMemo, Platform } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { useSettings } from '../components/use-settings';\nimport InspectorControls from '../components/inspector-controls';\nimport useBlockDisplayInformation from '../components/use-block-display-information';\nimport { cleanEmptyObject, useStyleOverride } from './utils';\nimport { unlock } from '../lock-unlock';\nimport { store as blockEditorStore } from '../store';\n\nconst { CustomSelectControl } = unlock( componentsPrivateApis );\n\nconst POSITION_SUPPORT_KEY = 'position';\n\nconst OPTION_CLASSNAME =\n\t'block-editor-hooks__position-selection__select-control__option';\n\nconst DEFAULT_OPTION = {\n\tkey: 'default',\n\tvalue: '',\n\tname: __( 'Default' ),\n\tclassName: OPTION_CLASSNAME,\n};\n\nconst STICKY_OPTION = {\n\tkey: 'sticky',\n\tvalue: 'sticky',\n\tname: _x( 'Sticky', 'Name for the value of the CSS position property' ),\n\tclassName: OPTION_CLASSNAME,\n\t__experimentalHint: __(\n\t\t'The block will stick to the top of the window instead of scrolling.'\n\t),\n};\n\nconst FIXED_OPTION = {\n\tkey: 'fixed',\n\tvalue: 'fixed',\n\tname: _x( 'Fixed', 'Name for the value of the CSS position property' ),\n\tclassName: OPTION_CLASSNAME,\n\t__experimentalHint: __(\n\t\t'The block will not move when the page is scrolled.'\n\t),\n};\n\nconst POSITION_SIDES = [ 'top', 'right', 'bottom', 'left' ];\nconst VALID_POSITION_TYPES = [ 'sticky', 'fixed' ];\n\n/**\n * Get calculated position CSS.\n *\n * @param {Object} props Component props.\n * @param {string} props.selector Selector to use.\n * @param {Object} props.style Style object.\n * @return {string} The generated CSS rules.\n */\nexport function getPositionCSS( { selector, style } ) {\n\tlet output = '';\n\n\tconst { type: positionType } = style?.position || {};\n\n\tif ( ! VALID_POSITION_TYPES.includes( positionType ) ) {\n\t\treturn output;\n\t}\n\n\toutput += `${ selector } {`;\n\toutput += `position: ${ positionType };`;\n\n\tPOSITION_SIDES.forEach( ( side ) => {\n\t\tif ( style?.position?.[ side ] !== undefined ) {\n\t\t\toutput += `${ side }: ${ style.position[ side ] };`;\n\t\t}\n\t} );\n\n\tif ( positionType === 'sticky' || positionType === 'fixed' ) {\n\t\t// TODO: Replace hard-coded z-index value with a z-index preset approach in theme.json.\n\t\toutput += `z-index: 10`;\n\t}\n\toutput += `}`;\n\n\treturn output;\n}\n\n/**\n * Determines if there is sticky position support.\n *\n * @param {string|Object} blockType Block name or Block Type object.\n *\n * @return {boolean} Whether there is support.\n */\nexport function hasStickyPositionSupport( blockType ) {\n\tconst support = getBlockSupport( blockType, POSITION_SUPPORT_KEY );\n\treturn !! ( true === support || support?.sticky );\n}\n\n/**\n * Determines if there is fixed position support.\n *\n * @param {string|Object} blockType Block name or Block Type object.\n *\n * @return {boolean} Whether there is support.\n */\nexport function hasFixedPositionSupport( blockType ) {\n\tconst support = getBlockSupport( blockType, POSITION_SUPPORT_KEY );\n\treturn !! ( true === support || support?.fixed );\n}\n\n/**\n * Determines if there is position support.\n *\n * @param {string|Object} blockType Block name or Block Type object.\n *\n * @return {boolean} Whether there is support.\n */\nexport function hasPositionSupport( blockType ) {\n\tconst support = getBlockSupport( blockType, POSITION_SUPPORT_KEY );\n\treturn !! support;\n}\n\n/**\n * Checks if there is a current value in the position block support attributes.\n *\n * @param {Object} props Block props.\n * @return {boolean} Whether or not the block has a position value set.\n */\nexport function hasPositionValue( props ) {\n\treturn props.attributes.style?.position?.type !== undefined;\n}\n\n/**\n * Checks if the block is currently set to a sticky or fixed position.\n * This check is helpful for determining how to position block toolbars or other elements.\n *\n * @param {Object} attributes Block attributes.\n * @return {boolean} Whether or not the block is set to a sticky or fixed position.\n */\nexport function hasStickyOrFixedPositionValue( attributes ) {\n\tconst positionType = attributes?.style?.position?.type;\n\treturn positionType === 'sticky' || positionType === 'fixed';\n}\n\n/**\n * Resets the position block support attributes. This can be used when disabling\n * the position support controls for a block via a `ToolsPanel`.\n *\n * @param {Object} props Block props.\n * @param {Object} props.attributes Block's attributes.\n * @param {Object} props.setAttributes Function to set block's attributes.\n */\nexport function resetPosition( { attributes = {}, setAttributes } ) {\n\tconst { style = {} } = attributes;\n\n\tsetAttributes( {\n\t\tstyle: cleanEmptyObject( {\n\t\t\t...style,\n\t\t\tposition: {\n\t\t\t\t...style?.position,\n\t\t\t\ttype: undefined,\n\t\t\t\ttop: undefined,\n\t\t\t\tright: undefined,\n\t\t\t\tbottom: undefined,\n\t\t\t\tleft: undefined,\n\t\t\t},\n\t\t} ),\n\t} );\n}\n\n/**\n * Custom hook that checks if position settings have been disabled.\n *\n * @param {string} name The name of the block.\n *\n * @return {boolean} Whether padding setting is disabled.\n */\nexport function useIsPositionDisabled( { name: blockName } = {} ) {\n\tconst [ allowFixed, allowSticky ] = useSettings(\n\t\t'position.fixed',\n\t\t'position.sticky'\n\t);\n\tconst isDisabled = ! allowFixed && ! allowSticky;\n\n\treturn ! hasPositionSupport( blockName ) || isDisabled;\n}\n\n/*\n * Position controls rendered in an inspector control panel.\n *\n * @param {Object} props\n *\n * @return {Element} Position panel.\n */\nexport function PositionPanelPure( {\n\tstyle = {},\n\tclientId,\n\tname: blockName,\n\tsetAttributes,\n} ) {\n\tconst allowFixed = hasFixedPositionSupport( blockName );\n\tconst allowSticky = hasStickyPositionSupport( blockName );\n\tconst value = style?.position?.type;\n\n\tconst { firstParentClientId } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockParents } = select( blockEditorStore );\n\t\t\tconst parents = getBlockParents( clientId );\n\t\t\treturn { firstParentClientId: parents[ parents.length - 1 ] };\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\tconst blockInformation = useBlockDisplayInformation( firstParentClientId );\n\tconst stickyHelpText =\n\t\tallowSticky && value === STICKY_OPTION.value && blockInformation\n\t\t\t? sprintf(\n\t\t\t\t\t/* translators: %s: the name of the parent block. */\n\t\t\t\t\t__(\n\t\t\t\t\t\t'The block will stick to the scrollable area of the parent %s block.'\n\t\t\t\t\t),\n\t\t\t\t\tblockInformation.title\n\t\t\t )\n\t\t\t: null;\n\n\tconst options = useMemo( () => {\n\t\tconst availableOptions = [ DEFAULT_OPTION ];\n\t\t// Display options if they are allowed, or if a block already has a valid value set.\n\t\t// This allows for a block to be switched off from a position type that is not allowed.\n\t\tif ( allowSticky || value === STICKY_OPTION.value ) {\n\t\t\tavailableOptions.push( STICKY_OPTION );\n\t\t}\n\t\tif ( allowFixed || value === FIXED_OPTION.value ) {\n\t\t\tavailableOptions.push( FIXED_OPTION );\n\t\t}\n\t\treturn availableOptions;\n\t}, [ allowFixed, allowSticky, value ] );\n\n\tconst onChangeType = ( next ) => {\n\t\t// For now, use a hard-coded `0px` value for the position.\n\t\t// `0px` is preferred over `0` as it can be used in `calc()` functions.\n\t\t// In the future, it could be useful to allow for an offset value.\n\t\tconst placementValue = '0px';\n\n\t\tconst newStyle = {\n\t\t\t...style,\n\t\t\tposition: {\n\t\t\t\t...style?.position,\n\t\t\t\ttype: next,\n\t\t\t\ttop:\n\t\t\t\t\tnext === 'sticky' || next === 'fixed'\n\t\t\t\t\t\t? placementValue\n\t\t\t\t\t\t: undefined,\n\t\t\t},\n\t\t};\n\n\t\tsetAttributes( {\n\t\t\tstyle: cleanEmptyObject( newStyle ),\n\t\t} );\n\t};\n\n\tconst selectedOption = value\n\t\t? options.find( ( option ) => option.value === value ) || DEFAULT_OPTION\n\t\t: DEFAULT_OPTION;\n\n\t// Only display position controls if there is at least one option to choose from.\n\treturn Platform.select( {\n\t\tweb:\n\t\t\toptions.length > 1 ? (\n\t\t\t\t<InspectorControls group=\"position\">\n\t\t\t\t\t<BaseControl\n\t\t\t\t\t\tclassName=\"block-editor-hooks__position-selection\"\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\thelp={ stickyHelpText }\n\t\t\t\t\t>\n\t\t\t\t\t\t<CustomSelectControl\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tclassName=\"block-editor-hooks__position-selection__select-control\"\n\t\t\t\t\t\t\tlabel={ __( 'Position' ) }\n\t\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t\tdescribedBy={ sprintf(\n\t\t\t\t\t\t\t\t// translators: %s: Currently selected position.\n\t\t\t\t\t\t\t\t__( 'Currently selected position: %s' ),\n\t\t\t\t\t\t\t\tselectedOption.name\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\toptions={ options }\n\t\t\t\t\t\t\tvalue={ selectedOption }\n\t\t\t\t\t\t\t__experimentalShowSelectedHint\n\t\t\t\t\t\t\tonChange={ ( { selectedItem } ) => {\n\t\t\t\t\t\t\t\tonChangeType( selectedItem.value );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tsize={ '__unstable-large' }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</BaseControl>\n\t\t\t\t</InspectorControls>\n\t\t\t) : null,\n\t\tnative: null,\n\t} );\n}\n\nexport default {\n\tedit: function Edit( props ) {\n\t\tconst isPositionDisabled = useIsPositionDisabled( props );\n\t\tif ( isPositionDisabled ) {\n\t\t\treturn null;\n\t\t}\n\t\treturn <PositionPanelPure { ...props } />;\n\t},\n\tuseBlockProps,\n\tattributeKeys: [ 'style' ],\n\thasSupport( name ) {\n\t\treturn hasBlockSupport( name, POSITION_SUPPORT_KEY );\n\t},\n};\n\nfunction useBlockProps( { name, style } ) {\n\tconst hasPositionBlockSupport = hasBlockSupport(\n\t\tname,\n\t\tPOSITION_SUPPORT_KEY\n\t);\n\tconst isPositionDisabled = useIsPositionDisabled( { name } );\n\tconst allowPositionStyles = hasPositionBlockSupport && ! isPositionDisabled;\n\n\tconst id = useInstanceId( useBlockProps );\n\n\t// Higher specificity to override defaults in editor UI.\n\tconst positionSelector = `.wp-container-${ id }.wp-container-${ id }`;\n\n\t// Get CSS string for the current position values.\n\tlet css;\n\tif ( allowPositionStyles ) {\n\t\tcss =\n\t\t\tgetPositionCSS( {\n\t\t\t\tselector: positionSelector,\n\t\t\t\tstyle,\n\t\t\t} ) || '';\n\t}\n\n\t// Attach a `wp-container-` id-based class name.\n\tconst className = classnames( {\n\t\t[ `wp-container-${ id }` ]: allowPositionStyles && !! css, // Only attach a container class if there is generated CSS to be attached.\n\t\t[ `is-position-${ style?.position?.type }` ]:\n\t\t\tallowPositionStyles && !! css && !! style?.position?.type,\n\t} );\n\n\tuseStyleOverride( { css } );\n\n\treturn { className };\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,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AAEnC;EAAK,CAAE,CAAC;EAC5D,MAAMiF,mBAAmB,GAAGD,uBAAuB,IAAI,CAAEJ,kBAAkB;EAE3E,MAAMM,EAAE,GAAGpG,aAAa,CAAE+F,aAAc,CAAC;;EAEzC;EACA,MAAMM,gBAAgB,GAAI,iBAAiBD,EAAI,iBAAiBA,EAAI,EAAC;;EAErE;EACA,IAAIE,GAAG;EACP,IAAKH,mBAAmB,EAAG;IAC1BG,GAAG,GACF7E,cAAc,CAAE;MACfC,QAAQ,EAAE2E,gBAAgB;MAC1B1E;IACD,CAAE,CAAC,IAAI,EAAE;EACX;;EAEA;EACA,MAAMR,SAAS,GAAG5B,UAAU,CAAE;IAC7B,CAAG,gBAAgB6G,EAAI,EAAC,GAAID,mBAAmB,IAAI,CAAC,CAAEG,GAAG;IAAE;IAC3D,CAAG,eAAe3E,KAAK,EAAEI,QAAQ,EAAEF,IAAM,EAAC,GACzCsE,mBAAmB,IAAI,CAAC,CAAEG,GAAG,IAAI,CAAC,CAAE3E,KAAK,EAAEI,QAAQ,EAAEF;EACvD,CAAE,CAAC;EAEHrB,gBAAgB,CAAE;IAAE8F;EAAI,CAAE,CAAC;EAE3B,OAAO;IAAEnF;EAAU,CAAC;AACrB","ignoreList":[]}
1
+ {"version":3,"names":["clsx","__","_x","sprintf","getBlockSupport","hasBlockSupport","BaseControl","privateApis","componentsPrivateApis","useInstanceId","useSelect","useMemo","Platform","useSettings","InspectorControls","useBlockDisplayInformation","cleanEmptyObject","useStyleOverride","unlock","store","blockEditorStore","CustomSelectControl","POSITION_SUPPORT_KEY","OPTION_CLASSNAME","DEFAULT_OPTION","key","value","name","className","STICKY_OPTION","__experimentalHint","FIXED_OPTION","POSITION_SIDES","VALID_POSITION_TYPES","getPositionCSS","selector","style","output","type","positionType","position","includes","forEach","side","undefined","hasStickyPositionSupport","blockType","support","sticky","hasFixedPositionSupport","fixed","hasPositionSupport","hasPositionValue","props","attributes","hasStickyOrFixedPositionValue","resetPosition","setAttributes","top","right","bottom","left","useIsPositionDisabled","blockName","allowFixed","allowSticky","isDisabled","PositionPanelPure","clientId","firstParentClientId","select","getBlockParents","parents","length","blockInformation","stickyHelpText","title","options","availableOptions","push","onChangeType","next","placementValue","newStyle","selectedOption","find","option","web","createElement","group","__nextHasNoMarginBottom","help","__next40pxDefaultSize","label","hideLabelFromVision","describedBy","__experimentalShowSelectedHint","onChange","selectedItem","size","native","edit","Edit","isPositionDisabled","useBlockProps","attributeKeys","hasSupport","hasPositionBlockSupport","allowPositionStyles","id","positionSelector","css"],"sources":["@wordpress/block-editor/src/hooks/position.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport { getBlockSupport, hasBlockSupport } from '@wordpress/blocks';\nimport {\n\tBaseControl,\n\tprivateApis as componentsPrivateApis,\n} from '@wordpress/components';\nimport { useInstanceId } from '@wordpress/compose';\nimport { useSelect } from '@wordpress/data';\nimport { useMemo, Platform } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { useSettings } from '../components/use-settings';\nimport InspectorControls from '../components/inspector-controls';\nimport useBlockDisplayInformation from '../components/use-block-display-information';\nimport { cleanEmptyObject, useStyleOverride } from './utils';\nimport { unlock } from '../lock-unlock';\nimport { store as blockEditorStore } from '../store';\n\nconst { CustomSelectControl } = unlock( componentsPrivateApis );\n\nconst POSITION_SUPPORT_KEY = 'position';\n\nconst OPTION_CLASSNAME =\n\t'block-editor-hooks__position-selection__select-control__option';\n\nconst DEFAULT_OPTION = {\n\tkey: 'default',\n\tvalue: '',\n\tname: __( 'Default' ),\n\tclassName: OPTION_CLASSNAME,\n};\n\nconst STICKY_OPTION = {\n\tkey: 'sticky',\n\tvalue: 'sticky',\n\tname: _x( 'Sticky', 'Name for the value of the CSS position property' ),\n\tclassName: OPTION_CLASSNAME,\n\t__experimentalHint: __(\n\t\t'The block will stick to the top of the window instead of scrolling.'\n\t),\n};\n\nconst FIXED_OPTION = {\n\tkey: 'fixed',\n\tvalue: 'fixed',\n\tname: _x( 'Fixed', 'Name for the value of the CSS position property' ),\n\tclassName: OPTION_CLASSNAME,\n\t__experimentalHint: __(\n\t\t'The block will not move when the page is scrolled.'\n\t),\n};\n\nconst POSITION_SIDES = [ 'top', 'right', 'bottom', 'left' ];\nconst VALID_POSITION_TYPES = [ 'sticky', 'fixed' ];\n\n/**\n * Get calculated position CSS.\n *\n * @param {Object} props Component props.\n * @param {string} props.selector Selector to use.\n * @param {Object} props.style Style object.\n * @return {string} The generated CSS rules.\n */\nexport function getPositionCSS( { selector, style } ) {\n\tlet output = '';\n\n\tconst { type: positionType } = style?.position || {};\n\n\tif ( ! VALID_POSITION_TYPES.includes( positionType ) ) {\n\t\treturn output;\n\t}\n\n\toutput += `${ selector } {`;\n\toutput += `position: ${ positionType };`;\n\n\tPOSITION_SIDES.forEach( ( side ) => {\n\t\tif ( style?.position?.[ side ] !== undefined ) {\n\t\t\toutput += `${ side }: ${ style.position[ side ] };`;\n\t\t}\n\t} );\n\n\tif ( positionType === 'sticky' || positionType === 'fixed' ) {\n\t\t// TODO: Replace hard-coded z-index value with a z-index preset approach in theme.json.\n\t\toutput += `z-index: 10`;\n\t}\n\toutput += `}`;\n\n\treturn output;\n}\n\n/**\n * Determines if there is sticky position support.\n *\n * @param {string|Object} blockType Block name or Block Type object.\n *\n * @return {boolean} Whether there is support.\n */\nexport function hasStickyPositionSupport( blockType ) {\n\tconst support = getBlockSupport( blockType, POSITION_SUPPORT_KEY );\n\treturn !! ( true === support || support?.sticky );\n}\n\n/**\n * Determines if there is fixed position support.\n *\n * @param {string|Object} blockType Block name or Block Type object.\n *\n * @return {boolean} Whether there is support.\n */\nexport function hasFixedPositionSupport( blockType ) {\n\tconst support = getBlockSupport( blockType, POSITION_SUPPORT_KEY );\n\treturn !! ( true === support || support?.fixed );\n}\n\n/**\n * Determines if there is position support.\n *\n * @param {string|Object} blockType Block name or Block Type object.\n *\n * @return {boolean} Whether there is support.\n */\nexport function hasPositionSupport( blockType ) {\n\tconst support = getBlockSupport( blockType, POSITION_SUPPORT_KEY );\n\treturn !! support;\n}\n\n/**\n * Checks if there is a current value in the position block support attributes.\n *\n * @param {Object} props Block props.\n * @return {boolean} Whether or not the block has a position value set.\n */\nexport function hasPositionValue( props ) {\n\treturn props.attributes.style?.position?.type !== undefined;\n}\n\n/**\n * Checks if the block is currently set to a sticky or fixed position.\n * This check is helpful for determining how to position block toolbars or other elements.\n *\n * @param {Object} attributes Block attributes.\n * @return {boolean} Whether or not the block is set to a sticky or fixed position.\n */\nexport function hasStickyOrFixedPositionValue( attributes ) {\n\tconst positionType = attributes?.style?.position?.type;\n\treturn positionType === 'sticky' || positionType === 'fixed';\n}\n\n/**\n * Resets the position block support attributes. This can be used when disabling\n * the position support controls for a block via a `ToolsPanel`.\n *\n * @param {Object} props Block props.\n * @param {Object} props.attributes Block's attributes.\n * @param {Object} props.setAttributes Function to set block's attributes.\n */\nexport function resetPosition( { attributes = {}, setAttributes } ) {\n\tconst { style = {} } = attributes;\n\n\tsetAttributes( {\n\t\tstyle: cleanEmptyObject( {\n\t\t\t...style,\n\t\t\tposition: {\n\t\t\t\t...style?.position,\n\t\t\t\ttype: undefined,\n\t\t\t\ttop: undefined,\n\t\t\t\tright: undefined,\n\t\t\t\tbottom: undefined,\n\t\t\t\tleft: undefined,\n\t\t\t},\n\t\t} ),\n\t} );\n}\n\n/**\n * Custom hook that checks if position settings have been disabled.\n *\n * @param {string} name The name of the block.\n *\n * @return {boolean} Whether padding setting is disabled.\n */\nexport function useIsPositionDisabled( { name: blockName } = {} ) {\n\tconst [ allowFixed, allowSticky ] = useSettings(\n\t\t'position.fixed',\n\t\t'position.sticky'\n\t);\n\tconst isDisabled = ! allowFixed && ! allowSticky;\n\n\treturn ! hasPositionSupport( blockName ) || isDisabled;\n}\n\n/*\n * Position controls rendered in an inspector control panel.\n *\n * @param {Object} props\n *\n * @return {Element} Position panel.\n */\nexport function PositionPanelPure( {\n\tstyle = {},\n\tclientId,\n\tname: blockName,\n\tsetAttributes,\n} ) {\n\tconst allowFixed = hasFixedPositionSupport( blockName );\n\tconst allowSticky = hasStickyPositionSupport( blockName );\n\tconst value = style?.position?.type;\n\n\tconst { firstParentClientId } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockParents } = select( blockEditorStore );\n\t\t\tconst parents = getBlockParents( clientId );\n\t\t\treturn { firstParentClientId: parents[ parents.length - 1 ] };\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\tconst blockInformation = useBlockDisplayInformation( firstParentClientId );\n\tconst stickyHelpText =\n\t\tallowSticky && value === STICKY_OPTION.value && blockInformation\n\t\t\t? sprintf(\n\t\t\t\t\t/* translators: %s: the name of the parent block. */\n\t\t\t\t\t__(\n\t\t\t\t\t\t'The block will stick to the scrollable area of the parent %s block.'\n\t\t\t\t\t),\n\t\t\t\t\tblockInformation.title\n\t\t\t )\n\t\t\t: null;\n\n\tconst options = useMemo( () => {\n\t\tconst availableOptions = [ DEFAULT_OPTION ];\n\t\t// Display options if they are allowed, or if a block already has a valid value set.\n\t\t// This allows for a block to be switched off from a position type that is not allowed.\n\t\tif ( allowSticky || value === STICKY_OPTION.value ) {\n\t\t\tavailableOptions.push( STICKY_OPTION );\n\t\t}\n\t\tif ( allowFixed || value === FIXED_OPTION.value ) {\n\t\t\tavailableOptions.push( FIXED_OPTION );\n\t\t}\n\t\treturn availableOptions;\n\t}, [ allowFixed, allowSticky, value ] );\n\n\tconst onChangeType = ( next ) => {\n\t\t// For now, use a hard-coded `0px` value for the position.\n\t\t// `0px` is preferred over `0` as it can be used in `calc()` functions.\n\t\t// In the future, it could be useful to allow for an offset value.\n\t\tconst placementValue = '0px';\n\n\t\tconst newStyle = {\n\t\t\t...style,\n\t\t\tposition: {\n\t\t\t\t...style?.position,\n\t\t\t\ttype: next,\n\t\t\t\ttop:\n\t\t\t\t\tnext === 'sticky' || next === 'fixed'\n\t\t\t\t\t\t? placementValue\n\t\t\t\t\t\t: undefined,\n\t\t\t},\n\t\t};\n\n\t\tsetAttributes( {\n\t\t\tstyle: cleanEmptyObject( newStyle ),\n\t\t} );\n\t};\n\n\tconst selectedOption = value\n\t\t? options.find( ( option ) => option.value === value ) || DEFAULT_OPTION\n\t\t: DEFAULT_OPTION;\n\n\t// Only display position controls if there is at least one option to choose from.\n\treturn Platform.select( {\n\t\tweb:\n\t\t\toptions.length > 1 ? (\n\t\t\t\t<InspectorControls group=\"position\">\n\t\t\t\t\t<BaseControl\n\t\t\t\t\t\tclassName=\"block-editor-hooks__position-selection\"\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\thelp={ stickyHelpText }\n\t\t\t\t\t>\n\t\t\t\t\t\t<CustomSelectControl\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tclassName=\"block-editor-hooks__position-selection__select-control\"\n\t\t\t\t\t\t\tlabel={ __( 'Position' ) }\n\t\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t\tdescribedBy={ sprintf(\n\t\t\t\t\t\t\t\t// translators: %s: Currently selected position.\n\t\t\t\t\t\t\t\t__( 'Currently selected position: %s' ),\n\t\t\t\t\t\t\t\tselectedOption.name\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\toptions={ options }\n\t\t\t\t\t\t\tvalue={ selectedOption }\n\t\t\t\t\t\t\t__experimentalShowSelectedHint\n\t\t\t\t\t\t\tonChange={ ( { selectedItem } ) => {\n\t\t\t\t\t\t\t\tonChangeType( selectedItem.value );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tsize={ '__unstable-large' }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</BaseControl>\n\t\t\t\t</InspectorControls>\n\t\t\t) : null,\n\t\tnative: null,\n\t} );\n}\n\nexport default {\n\tedit: function Edit( props ) {\n\t\tconst isPositionDisabled = useIsPositionDisabled( props );\n\t\tif ( isPositionDisabled ) {\n\t\t\treturn null;\n\t\t}\n\t\treturn <PositionPanelPure { ...props } />;\n\t},\n\tuseBlockProps,\n\tattributeKeys: [ 'style' ],\n\thasSupport( name ) {\n\t\treturn hasBlockSupport( name, POSITION_SUPPORT_KEY );\n\t},\n};\n\nfunction useBlockProps( { name, style } ) {\n\tconst hasPositionBlockSupport = hasBlockSupport(\n\t\tname,\n\t\tPOSITION_SUPPORT_KEY\n\t);\n\tconst isPositionDisabled = useIsPositionDisabled( { name } );\n\tconst allowPositionStyles = hasPositionBlockSupport && ! isPositionDisabled;\n\n\tconst id = useInstanceId( useBlockProps );\n\n\t// Higher specificity to override defaults in editor UI.\n\tconst positionSelector = `.wp-container-${ id }.wp-container-${ id }`;\n\n\t// Get CSS string for the current position values.\n\tlet css;\n\tif ( allowPositionStyles ) {\n\t\tcss =\n\t\t\tgetPositionCSS( {\n\t\t\t\tselector: positionSelector,\n\t\t\t\tstyle,\n\t\t\t} ) || '';\n\t}\n\n\t// Attach a `wp-container-` id-based class name.\n\tconst className = clsx( {\n\t\t[ `wp-container-${ id }` ]: allowPositionStyles && !! css, // Only attach a container class if there is generated CSS to be attached.\n\t\t[ `is-position-${ style?.position?.type }` ]:\n\t\t\tallowPositionStyles && !! css && !! style?.position?.type,\n\t} );\n\n\tuseStyleOverride( { css } );\n\n\treturn { className };\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,EAAE,EAAEC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AACjD,SAASC,eAAe,EAAEC,eAAe,QAAQ,mBAAmB;AACpE,SACCC,WAAW,EACXC,WAAW,IAAIC,qBAAqB,QAC9B,uBAAuB;AAC9B,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,OAAO,EAAEC,QAAQ,QAAQ,oBAAoB;;AAEtD;AACA;AACA;AACA,SAASC,WAAW,QAAQ,4BAA4B;AACxD,OAAOC,iBAAiB,MAA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S,GAAG5B,IAAI,CAAE;IACvB,CAAG,gBAAgB6G,EAAI,EAAC,GAAID,mBAAmB,IAAI,CAAC,CAAEG,GAAG;IAAE;IAC3D,CAAG,eAAe3E,KAAK,EAAEI,QAAQ,EAAEF,IAAM,EAAC,GACzCsE,mBAAmB,IAAI,CAAC,CAAEG,GAAG,IAAI,CAAC,CAAE3E,KAAK,EAAEI,QAAQ,EAAEF;EACvD,CAAE,CAAC;EAEHrB,gBAAgB,CAAE;IAAE8F;EAAI,CAAE,CAAC;EAE3B,OAAO;IAAEnF;EAAU,CAAC;AACrB","ignoreList":[]}
@@ -2,7 +2,7 @@ import { createElement } from "react";
2
2
  /**
3
3
  * External dependencies
4
4
  */
5
- import classnames from 'classnames';
5
+ import clsx from 'clsx';
6
6
 
7
7
  /**
8
8
  * WordPress dependencies
@@ -110,7 +110,7 @@ function useBlockProps({
110
110
  return null;
111
111
  }
112
112
  const textAlign = style.typography.textAlign;
113
- const className = classnames({
113
+ const className = clsx({
114
114
  [`has-text-align-${textAlign}`]: textAlign
115
115
  });
116
116
  return {
@@ -138,7 +138,7 @@ export function addAssignedTextAlign(props, blockType, attributes) {
138
138
  const blockTextAlign = getBlockSupport(blockType, TEXT_ALIGN_SUPPORT_KEY);
139
139
  const isTextAlignValid = getValidTextAlignments(blockTextAlign).includes(textAlign);
140
140
  if (isTextAlignValid && !shouldSkipSerialization(blockType, TYPOGRAPHY_SUPPORT_KEY, 'textAlign')) {
141
- props.className = classnames(`has-text-align-${textAlign}`, props.className);
141
+ props.className = clsx(`has-text-align-${textAlign}`, props.className);
142
142
  }
143
143
  return props;
144
144
  }
@@ -1 +1 @@
1
- {"version":3,"names":["classnames","__","getBlockSupport","hasBlockSupport","alignLeft","alignRight","alignCenter","AlignmentControl","BlockControls","useBlockEditingMode","cleanEmptyObject","shouldSkipSerialization","TYPOGRAPHY_SUPPORT_KEY","TEXT_ALIGN_SUPPORT_KEY","TEXT_ALIGNMENT_OPTIONS","icon","title","align","VALID_TEXT_ALIGNMENTS","getValidTextAlignments","blockTextAlign","validTextAlignments","Array","isArray","filter","textAlign","includes","BlockEditTextAlignmentToolbarControlsPure","style","name","blockName","setAttributes","blockEditingMode","length","textAlignmentControls","control","onChange","newTextAlignValue","newStyle","typography","createElement","group","value","alignmentControls","edit","useBlockProps","addSaveProps","addAssignedTextAlign","attributeKeys","hasSupport","className","props","blockType","attributes","isTextAlignValid"],"sources":["@wordpress/block-editor/src/hooks/text-align.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { getBlockSupport, hasBlockSupport } from '@wordpress/blocks';\nimport { alignLeft, alignRight, alignCenter } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { AlignmentControl, BlockControls } from '../components';\nimport { useBlockEditingMode } from '../components/block-editing-mode';\nimport { cleanEmptyObject, shouldSkipSerialization } from './utils';\nimport { TYPOGRAPHY_SUPPORT_KEY } from './typography';\n\nexport const TEXT_ALIGN_SUPPORT_KEY = 'typography.textAlign';\n\nconst TEXT_ALIGNMENT_OPTIONS = [\n\t{\n\t\ticon: alignLeft,\n\t\ttitle: __( 'Align text left' ),\n\t\talign: 'left',\n\t},\n\t{\n\t\ticon: alignCenter,\n\t\ttitle: __( 'Align text center' ),\n\t\talign: 'center',\n\t},\n\t{\n\t\ticon: alignRight,\n\t\ttitle: __( 'Align text right' ),\n\t\talign: 'right',\n\t},\n];\n\nconst VALID_TEXT_ALIGNMENTS = [ 'left', 'center', 'right' ];\n\n/**\n * Returns the valid text alignments.\n * Takes into consideration the text aligns supported by a block.\n * Exported just for testing purposes, not exported outside the module.\n *\n * @param {?boolean|string[]} blockTextAlign Text aligns supported by the block.\n *\n * @return {string[]} Valid text alignments.\n */\nexport function getValidTextAlignments( blockTextAlign ) {\n\tlet validTextAlignments;\n\tif ( Array.isArray( blockTextAlign ) ) {\n\t\tvalidTextAlignments = VALID_TEXT_ALIGNMENTS.filter( ( textAlign ) =>\n\t\t\tblockTextAlign.includes( textAlign )\n\t\t);\n\t} else if ( blockTextAlign === true ) {\n\t\t// `true` includes all alignments...\n\t\tvalidTextAlignments = [ ...VALID_TEXT_ALIGNMENTS ];\n\t} else {\n\t\tvalidTextAlignments = [];\n\t}\n\n\treturn validTextAlignments;\n}\n\nfunction BlockEditTextAlignmentToolbarControlsPure( {\n\tstyle,\n\tname: blockName,\n\tsetAttributes,\n} ) {\n\tconst validTextAlignments = getValidTextAlignments(\n\t\tgetBlockSupport( blockName, TEXT_ALIGN_SUPPORT_KEY )\n\t);\n\tconst blockEditingMode = useBlockEditingMode();\n\tif ( ! validTextAlignments.length || blockEditingMode !== 'default' ) {\n\t\treturn null;\n\t}\n\n\tconst textAlignmentControls = TEXT_ALIGNMENT_OPTIONS.filter( ( control ) =>\n\t\tvalidTextAlignments.includes( control.align )\n\t);\n\n\tconst onChange = ( newTextAlignValue ) => {\n\t\tconst newStyle = {\n\t\t\t...style,\n\t\t\ttypography: {\n\t\t\t\t...style?.typography,\n\t\t\t\ttextAlign: newTextAlignValue,\n\t\t\t},\n\t\t};\n\n\t\tsetAttributes( { style: cleanEmptyObject( newStyle ) } );\n\t};\n\n\treturn (\n\t\t<BlockControls group=\"block\">\n\t\t\t<AlignmentControl\n\t\t\t\tvalue={ style?.typography?.textAlign }\n\t\t\t\tonChange={ onChange }\n\t\t\t\talignmentControls={ textAlignmentControls }\n\t\t\t/>\n\t\t</BlockControls>\n\t);\n}\n\nexport default {\n\tedit: BlockEditTextAlignmentToolbarControlsPure,\n\tuseBlockProps,\n\taddSaveProps: addAssignedTextAlign,\n\tattributeKeys: [ 'style' ],\n\thasSupport( name ) {\n\t\treturn hasBlockSupport( name, TEXT_ALIGN_SUPPORT_KEY, false );\n\t},\n};\n\nfunction useBlockProps( { name, style } ) {\n\tif ( ! style?.typography?.textAlign ) {\n\t\treturn null;\n\t}\n\n\tconst validTextAlignments = getValidTextAlignments(\n\t\tgetBlockSupport( name, TEXT_ALIGN_SUPPORT_KEY )\n\t);\n\n\tif ( ! validTextAlignments.length ) {\n\t\treturn null;\n\t}\n\n\tif (\n\t\tshouldSkipSerialization( name, TYPOGRAPHY_SUPPORT_KEY, 'textAlign' )\n\t) {\n\t\treturn null;\n\t}\n\n\tconst textAlign = style.typography.textAlign;\n\n\tconst className = classnames( {\n\t\t[ `has-text-align-${ textAlign }` ]: textAlign,\n\t} );\n\treturn { className };\n}\n\n/**\n * Override props assigned to save component to inject text alignment class\n * name if block supports it.\n *\n * @param {Object} props Additional props applied to save element.\n * @param {Object} blockType Block type.\n * @param {Object} attributes Block attributes.\n *\n * @return {Object} Filtered props applied to save element.\n */\nexport function addAssignedTextAlign( props, blockType, attributes ) {\n\tif ( ! attributes?.style?.typography?.textAlign ) {\n\t\treturn props;\n\t}\n\n\tconst { textAlign } = attributes.style.typography;\n\tconst blockTextAlign = getBlockSupport( blockType, TEXT_ALIGN_SUPPORT_KEY );\n\tconst isTextAlignValid =\n\t\tgetValidTextAlignments( blockTextAlign ).includes( textAlign );\n\tif (\n\t\tisTextAlignValid &&\n\t\t! shouldSkipSerialization(\n\t\t\tblockType,\n\t\t\tTYPOGRAPHY_SUPPORT_KEY,\n\t\t\t'textAlign'\n\t\t)\n\t) {\n\t\tprops.className = classnames(\n\t\t\t`has-text-align-${ textAlign }`,\n\t\t\tprops.className\n\t\t);\n\t}\n\treturn props;\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,eAAe,EAAEC,eAAe,QAAQ,mBAAmB;AACpE,SAASC,SAAS,EAAEC,UAAU,EAAEC,WAAW,QAAQ,kBAAkB;;AAErE;AACA;AACA;AACA,SAASC,gBAAgB,EAAEC,aAAa,QAAQ,eAAe;AAC/D,SAASC,mBAAmB,QAAQ,kCAAkC;AACtE,SAASC,gBAAgB,EAAEC,uBAAuB,QAAQ,SA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O,IAAI;EACZ;EAEA,IACCtB,uBAAuB,CAAEkB,IAAI,EAAEjB,sBAAsB,EAAE,WAAY,CAAC,EACnE;IACD,OAAO,IAAI;EACZ;EAEA,MAAMa,SAAS,GAAGG,KAAK,CAACW,UAAU,CAACd,SAAS;EAE5C,MAAMyB,SAAS,GAAGlD,UAAU,CAAE;IAC7B,CAAG,kBAAkByB,SAAW,EAAC,GAAIA;EACtC,CAAE,CAAC;EACH,OAAO;IAAEyB;EAAU,CAAC;AACrB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASH,oBAAoBA,CAAEI,KAAK,EAAEC,SAAS,EAAEC,UAAU,EAAG;EACpE,IAAK,CAAEA,UAAU,EAAEzB,KAAK,EAAEW,UAAU,EAAEd,SAAS,EAAG;IACjD,OAAO0B,KAAK;EACb;EAEA,MAAM;IAAE1B;EAAU,CAAC,GAAG4B,UAAU,CAACzB,KAAK,CAACW,UAAU;EACjD,MAAMnB,cAAc,GAAGlB,eAAe,CAAEkD,SAAS,EAAEvC,sBAAuB,CAAC;EAC3E,MAAMyC,gBAAgB,GACrBnC,sBAAsB,CAAEC,cAAe,CAAC,CAACM,QAAQ,CAAED,SAAU,CAAC;EAC/D,IACC6B,gBAAgB,IAChB,CAAE3C,uBAAuB,CACxByC,SAAS,EACTxC,sBAAsB,EACtB,WACD,CAAC,EACA;IACDuC,KAAK,CAACD,SAAS,GAAGlD,UAAU,CAC1B,kBAAkByB,SAAW,EAAC,EAC/B0B,KAAK,CAACD,SACP,CAAC;EACF;EACA,OAAOC,KAAK;AACb","ignoreList":[]}
1
+ {"version":3,"names":["clsx","__","getBlockSupport","hasBlockSupport","alignLeft","alignRight","alignCenter","AlignmentControl","BlockControls","useBlockEditingMode","cleanEmptyObject","shouldSkipSerialization","TYPOGRAPHY_SUPPORT_KEY","TEXT_ALIGN_SUPPORT_KEY","TEXT_ALIGNMENT_OPTIONS","icon","title","align","VALID_TEXT_ALIGNMENTS","getValidTextAlignments","blockTextAlign","validTextAlignments","Array","isArray","filter","textAlign","includes","BlockEditTextAlignmentToolbarControlsPure","style","name","blockName","setAttributes","blockEditingMode","length","textAlignmentControls","control","onChange","newTextAlignValue","newStyle","typography","createElement","group","value","alignmentControls","edit","useBlockProps","addSaveProps","addAssignedTextAlign","attributeKeys","hasSupport","className","props","blockType","attributes","isTextAlignValid"],"sources":["@wordpress/block-editor/src/hooks/text-align.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { getBlockSupport, hasBlockSupport } from '@wordpress/blocks';\nimport { alignLeft, alignRight, alignCenter } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { AlignmentControl, BlockControls } from '../components';\nimport { useBlockEditingMode } from '../components/block-editing-mode';\nimport { cleanEmptyObject, shouldSkipSerialization } from './utils';\nimport { TYPOGRAPHY_SUPPORT_KEY } from './typography';\n\nexport const TEXT_ALIGN_SUPPORT_KEY = 'typography.textAlign';\n\nconst TEXT_ALIGNMENT_OPTIONS = [\n\t{\n\t\ticon: alignLeft,\n\t\ttitle: __( 'Align text left' ),\n\t\talign: 'left',\n\t},\n\t{\n\t\ticon: alignCenter,\n\t\ttitle: __( 'Align text center' ),\n\t\talign: 'center',\n\t},\n\t{\n\t\ticon: alignRight,\n\t\ttitle: __( 'Align text right' ),\n\t\talign: 'right',\n\t},\n];\n\nconst VALID_TEXT_ALIGNMENTS = [ 'left', 'center', 'right' ];\n\n/**\n * Returns the valid text alignments.\n * Takes into consideration the text aligns supported by a block.\n * Exported just for testing purposes, not exported outside the module.\n *\n * @param {?boolean|string[]} blockTextAlign Text aligns supported by the block.\n *\n * @return {string[]} Valid text alignments.\n */\nexport function getValidTextAlignments( blockTextAlign ) {\n\tlet validTextAlignments;\n\tif ( Array.isArray( blockTextAlign ) ) {\n\t\tvalidTextAlignments = VALID_TEXT_ALIGNMENTS.filter( ( textAlign ) =>\n\t\t\tblockTextAlign.includes( textAlign )\n\t\t);\n\t} else if ( blockTextAlign === true ) {\n\t\t// `true` includes all alignments...\n\t\tvalidTextAlignments = [ ...VALID_TEXT_ALIGNMENTS ];\n\t} else {\n\t\tvalidTextAlignments = [];\n\t}\n\n\treturn validTextAlignments;\n}\n\nfunction BlockEditTextAlignmentToolbarControlsPure( {\n\tstyle,\n\tname: blockName,\n\tsetAttributes,\n} ) {\n\tconst validTextAlignments = getValidTextAlignments(\n\t\tgetBlockSupport( blockName, TEXT_ALIGN_SUPPORT_KEY )\n\t);\n\tconst blockEditingMode = useBlockEditingMode();\n\tif ( ! validTextAlignments.length || blockEditingMode !== 'default' ) {\n\t\treturn null;\n\t}\n\n\tconst textAlignmentControls = TEXT_ALIGNMENT_OPTIONS.filter( ( control ) =>\n\t\tvalidTextAlignments.includes( control.align )\n\t);\n\n\tconst onChange = ( newTextAlignValue ) => {\n\t\tconst newStyle = {\n\t\t\t...style,\n\t\t\ttypography: {\n\t\t\t\t...style?.typography,\n\t\t\t\ttextAlign: newTextAlignValue,\n\t\t\t},\n\t\t};\n\n\t\tsetAttributes( { style: cleanEmptyObject( newStyle ) } );\n\t};\n\n\treturn (\n\t\t<BlockControls group=\"block\">\n\t\t\t<AlignmentControl\n\t\t\t\tvalue={ style?.typography?.textAlign }\n\t\t\t\tonChange={ onChange }\n\t\t\t\talignmentControls={ textAlignmentControls }\n\t\t\t/>\n\t\t</BlockControls>\n\t);\n}\n\nexport default {\n\tedit: BlockEditTextAlignmentToolbarControlsPure,\n\tuseBlockProps,\n\taddSaveProps: addAssignedTextAlign,\n\tattributeKeys: [ 'style' ],\n\thasSupport( name ) {\n\t\treturn hasBlockSupport( name, TEXT_ALIGN_SUPPORT_KEY, false );\n\t},\n};\n\nfunction useBlockProps( { name, style } ) {\n\tif ( ! style?.typography?.textAlign ) {\n\t\treturn null;\n\t}\n\n\tconst validTextAlignments = getValidTextAlignments(\n\t\tgetBlockSupport( name, TEXT_ALIGN_SUPPORT_KEY )\n\t);\n\n\tif ( ! validTextAlignments.length ) {\n\t\treturn null;\n\t}\n\n\tif (\n\t\tshouldSkipSerialization( name, TYPOGRAPHY_SUPPORT_KEY, 'textAlign' )\n\t) {\n\t\treturn null;\n\t}\n\n\tconst textAlign = style.typography.textAlign;\n\n\tconst className = clsx( {\n\t\t[ `has-text-align-${ textAlign }` ]: textAlign,\n\t} );\n\treturn { className };\n}\n\n/**\n * Override props assigned to save component to inject text alignment class\n * name if block supports it.\n *\n * @param {Object} props Additional props applied to save element.\n * @param {Object} blockType Block type.\n * @param {Object} attributes Block attributes.\n *\n * @return {Object} Filtered props applied to save element.\n */\nexport function addAssignedTextAlign( props, blockType, attributes ) {\n\tif ( ! attributes?.style?.typography?.textAlign ) {\n\t\treturn props;\n\t}\n\n\tconst { textAlign } = attributes.style.typography;\n\tconst blockTextAlign = getBlockSupport( blockType, TEXT_ALIGN_SUPPORT_KEY );\n\tconst isTextAlignValid =\n\t\tgetValidTextAlignments( blockTextAlign ).includes( textAlign );\n\tif (\n\t\tisTextAlignValid &&\n\t\t! shouldSkipSerialization(\n\t\t\tblockType,\n\t\t\tTYPOGRAPHY_SUPPORT_KEY,\n\t\t\t'textAlign'\n\t\t)\n\t) {\n\t\tprops.className = clsx(\n\t\t\t`has-text-align-${ textAlign }`,\n\t\t\tprops.className\n\t\t);\n\t}\n\treturn props;\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,eAAe,EAAEC,eAAe,QAAQ,mBAAmB;AACpE,SAASC,SAAS,EAAEC,UAAU,EAAEC,WAAW,QAAQ,kBAAkB;;AAErE;AACA;AACA;AACA,SAASC,gBAAgB,EAAEC,aAAa,QAAQ,eAAe;AAC/D,SAASC,mBAAmB,QAAQ,kCAAkC;AACtE,SAASC,gBAAgB,EAAEC,uBAAuB,QAAQ,SAAS;AACnE,SAASC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EAEA,IACCtB,uBAAuB,CAAEkB,IAAI,EAAEjB,sBAAsB,EAAE,WAAY,CAAC,EACnE;IACD,OAAO,IAAI;EACZ;EAEA,MAAMa,SAAS,GAAGG,KAAK,CAACW,UAAU,CAACd,SAAS;EAE5C,MAAMyB,SAAS,GAAGlD,IAAI,CAAE;IACvB,CAAG,kBAAkByB,SAAW,EAAC,GAAIA;EACtC,CAAE,CAAC;EACH,OAAO;IAAEyB;EAAU,CAAC;AACrB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASH,oBAAoBA,CAAEI,KAAK,EAAEC,SAAS,EAAEC,UAAU,EAAG;EACpE,IAAK,CAAEA,UAAU,EAAEzB,KAAK,EAAEW,UAAU,EAAEd,SAAS,EAAG;IACjD,OAAO0B,KAAK;EACb;EAEA,MAAM;IAAE1B;EAAU,CAAC,GAAG4B,UAAU,CAACzB,KAAK,CAACW,UAAU;EACjD,MAAMnB,cAAc,GAAGlB,eAAe,CAAEkD,SAAS,EAAEvC,sBAAuB,CAAC;EAC3E,MAAMyC,gBAAgB,GACrBnC,sBAAsB,CAAEC,cAAe,CAAC,CAACM,QAAQ,CAAED,SAAU,CAAC;EAC/D,IACC6B,gBAAgB,IAChB,CAAE3C,uBAAuB,CACxByC,SAAS,EACTxC,sBAAsB,EACtB,WACD,CAAC,EACA;IACDuC,KAAK,CAACD,SAAS,GAAGlD,IAAI,CACpB,kBAAkByB,SAAW,EAAC,EAC/B0B,KAAK,CAACD,SACP,CAAC;EACF;EACA,OAAOC,KAAK;AACb","ignoreList":[]}
@@ -26,8 +26,8 @@ import { unlock } from '../lock-unlock';
26
26
  const BLOCK_BINDINGS_ALLOWED_BLOCKS = {
27
27
  'core/paragraph': ['content'],
28
28
  'core/heading': ['content'],
29
- 'core/image': ['url', 'title', 'alt'],
30
- 'core/button': ['url', 'text', 'linkTarget']
29
+ 'core/image': ['id', 'url', 'title', 'alt'],
30
+ 'core/button': ['url', 'text', 'linkTarget', 'rel']
31
31
  };
32
32
 
33
33
  /**
@@ -95,26 +95,52 @@ export const withBlockBindingSupport = createHigherOrderComponent(BlockEdit => p
95
95
  const _setAttributes = useCallback(nextAttributes => {
96
96
  registry.batch(() => {
97
97
  if (!bindings) {
98
- return setAttributes(nextAttributes);
98
+ setAttributes(nextAttributes);
99
+ return;
99
100
  }
100
101
  const keptAttributes = {
101
102
  ...nextAttributes
102
103
  };
103
- for (const [attributeName, boundAttribute] of Object.entries(bindings)) {
104
- const source = sources[boundAttribute.source];
105
- if (!source?.setValue || !canBindAttribute(name, attributeName)) {
104
+ const updatesBySource = new Map();
105
+
106
+ // Loop only over the updated attributes to avoid modifying the bound ones that haven't changed.
107
+ for (const [attributeName, newValue] of Object.entries(keptAttributes)) {
108
+ if (!bindings[attributeName] || !canBindAttribute(name, attributeName)) {
109
+ continue;
110
+ }
111
+ const source = sources[bindings[attributeName].source];
112
+ if (!source?.setValue && !source?.setValues) {
106
113
  continue;
107
114
  }
108
- source.setValue({
109
- registry,
110
- context,
111
- clientId,
112
- attributeName,
113
- args: boundAttribute.args,
114
- value: nextAttributes[attributeName]
115
+ updatesBySource.set(source, {
116
+ ...updatesBySource.get(source),
117
+ [attributeName]: newValue
115
118
  });
116
119
  delete keptAttributes[attributeName];
117
120
  }
121
+ if (updatesBySource.size) {
122
+ for (const [source, attributes] of updatesBySource) {
123
+ if (source.setValues) {
124
+ source.setValues({
125
+ registry,
126
+ context,
127
+ clientId,
128
+ attributes
129
+ });
130
+ } else {
131
+ for (const [attributeName, value] of Object.entries(attributes)) {
132
+ source.setValue({
133
+ registry,
134
+ context,
135
+ clientId,
136
+ attributeName,
137
+ args: bindings[attributeName].args,
138
+ value
139
+ });
140
+ }
141
+ }
142
+ }
143
+ }
118
144
  if (Object.keys(keptAttributes).length) {
119
145
  setAttributes(keptAttributes);
120
146
  }
@@ -1 +1 @@
1
- {"version":3,"names":["store","blocksStore","createHigherOrderComponent","useRegistry","useSelect","useCallback","addFilter","unlock","BLOCK_BINDINGS_ALLOWED_BLOCKS","canBindBlock","blockName","canBindAttribute","attributeName","includes","withBlockBindingSupport","BlockEdit","props","registry","sources","select","getAllBlockBindingsSources","bindings","attributes","metadata","name","clientId","context","boundAttributes","boundAttribute","Object","entries","source","getValue","args","undefined","getPlaceholder","setAttributes","_setAttributes","nextAttributes","batch","keptAttributes","setValue","value","keys","length","createElement","Fragment","shimAttributeSource","settings","edit"],"sources":["@wordpress/block-editor/src/hooks/use-bindings-attributes.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport { createHigherOrderComponent } from '@wordpress/compose';\nimport { useRegistry, useSelect } from '@wordpress/data';\nimport { useCallback } from '@wordpress/element';\nimport { addFilter } from '@wordpress/hooks';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../lock-unlock';\n\n/** @typedef {import('@wordpress/compose').WPHigherOrderComponent} WPHigherOrderComponent */\n/** @typedef {import('@wordpress/blocks').WPBlockSettings} WPBlockSettings */\n\n/**\n * Given a binding of block attributes, returns a higher order component that\n * overrides its `attributes` and `setAttributes` props to sync any changes needed.\n *\n * @return {WPHigherOrderComponent} Higher-order component.\n */\n\nconst BLOCK_BINDINGS_ALLOWED_BLOCKS = {\n\t'core/paragraph': [ 'content' ],\n\t'core/heading': [ 'content' ],\n\t'core/image': [ 'url', 'title', 'alt' ],\n\t'core/button': [ 'url', 'text', 'linkTarget' ],\n};\n\n/**\n * Based on the given block name,\n * check if it is possible to bind the block.\n *\n * @param {string} blockName - The block name.\n * @return {boolean} Whether it is possible to bind the block to sources.\n */\nexport function canBindBlock( blockName ) {\n\treturn blockName in BLOCK_BINDINGS_ALLOWED_BLOCKS;\n}\n\n/**\n * Based on the given block name and attribute name,\n * check if it is possible to bind the block attribute.\n *\n * @param {string} blockName - The block name.\n * @param {string} attributeName - The attribute name.\n * @return {boolean} Whether it is possible to bind the block attribute.\n */\nexport function canBindAttribute( blockName, attributeName ) {\n\treturn (\n\t\tcanBindBlock( blockName ) &&\n\t\tBLOCK_BINDINGS_ALLOWED_BLOCKS[ blockName ].includes( attributeName )\n\t);\n}\n\nexport const withBlockBindingSupport = createHigherOrderComponent(\n\t( BlockEdit ) => ( props ) => {\n\t\tconst registry = useRegistry();\n\t\tconst sources = useSelect( ( select ) =>\n\t\t\tunlock( select( blocksStore ) ).getAllBlockBindingsSources()\n\t\t);\n\t\tconst bindings = props.attributes.metadata?.bindings;\n\t\tconst { name, clientId, context } = props;\n\t\tconst boundAttributes = useSelect( () => {\n\t\t\tif ( ! bindings ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst attributes = {};\n\n\t\t\tfor ( const [ attributeName, boundAttribute ] of Object.entries(\n\t\t\t\tbindings\n\t\t\t) ) {\n\t\t\t\tconst source = sources[ boundAttribute.source ];\n\t\t\t\tif (\n\t\t\t\t\t! source?.getValue ||\n\t\t\t\t\t! canBindAttribute( name, attributeName )\n\t\t\t\t) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tconst args = {\n\t\t\t\t\tregistry,\n\t\t\t\t\tcontext,\n\t\t\t\t\tclientId,\n\t\t\t\t\tattributeName,\n\t\t\t\t\targs: boundAttribute.args,\n\t\t\t\t};\n\n\t\t\t\tattributes[ attributeName ] = source.getValue( args );\n\n\t\t\t\tif ( attributes[ attributeName ] === undefined ) {\n\t\t\t\t\tif ( attributeName === 'url' ) {\n\t\t\t\t\t\tattributes[ attributeName ] = null;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tattributes[ attributeName ] =\n\t\t\t\t\t\t\tsource.getPlaceholder?.( args );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn attributes;\n\t\t}, [ bindings, name, clientId, context, registry, sources ] );\n\n\t\tconst { setAttributes } = props;\n\n\t\tconst _setAttributes = useCallback(\n\t\t\t( nextAttributes ) => {\n\t\t\t\tregistry.batch( () => {\n\t\t\t\t\tif ( ! bindings ) {\n\t\t\t\t\t\treturn setAttributes( nextAttributes );\n\t\t\t\t\t}\n\n\t\t\t\t\tconst keptAttributes = { ...nextAttributes };\n\n\t\t\t\t\tfor ( const [\n\t\t\t\t\t\tattributeName,\n\t\t\t\t\t\tboundAttribute,\n\t\t\t\t\t] of Object.entries( bindings ) ) {\n\t\t\t\t\t\tconst source = sources[ boundAttribute.source ];\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t! source?.setValue ||\n\t\t\t\t\t\t\t! canBindAttribute( name, attributeName )\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tsource.setValue( {\n\t\t\t\t\t\t\tregistry,\n\t\t\t\t\t\t\tcontext,\n\t\t\t\t\t\t\tclientId,\n\t\t\t\t\t\t\tattributeName,\n\t\t\t\t\t\t\targs: boundAttribute.args,\n\t\t\t\t\t\t\tvalue: nextAttributes[ attributeName ],\n\t\t\t\t\t\t} );\n\t\t\t\t\t\tdelete keptAttributes[ attributeName ];\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( Object.keys( keptAttributes ).length ) {\n\t\t\t\t\t\tsetAttributes( keptAttributes );\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t},\n\t\t\t[\n\t\t\t\tregistry,\n\t\t\t\tbindings,\n\t\t\t\tname,\n\t\t\t\tclientId,\n\t\t\t\tcontext,\n\t\t\t\tsetAttributes,\n\t\t\t\tsources,\n\t\t\t]\n\t\t);\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<BlockEdit\n\t\t\t\t\t{ ...props }\n\t\t\t\t\tattributes={ { ...props.attributes, ...boundAttributes } }\n\t\t\t\t\tsetAttributes={ _setAttributes }\n\t\t\t\t/>\n\t\t\t</>\n\t\t);\n\t},\n\t'withBlockBindingSupport'\n);\n\n/**\n * Filters a registered block's settings to enhance a block's `edit` component\n * to upgrade bound attributes.\n *\n * @param {WPBlockSettings} settings - Registered block settings.\n * @param {string} name - Block name.\n * @return {WPBlockSettings} Filtered block settings.\n */\nfunction shimAttributeSource( settings, name ) {\n\tif ( ! canBindBlock( name ) ) {\n\t\treturn settings;\n\t}\n\n\treturn {\n\t\t...settings,\n\t\tedit: withBlockBindingSupport( settings.edit ),\n\t};\n}\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/editor/custom-sources-backwards-compatibility/shim-attribute-source',\n\tshimAttributeSource\n);\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;AACxD,SAASC,0BAA0B,QAAQ,oBAAoB;AAC/D,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,WAAW,QAAQ,oBAAoB;AAChD,SAASC,SAAS,QAAQ,kBAAkB;;AAE5C;AACA;AACA;AACA,SAASC,MAAM,QAAQ,gBAAgB;;AAEvC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAMC,6BAA6B,GAAG;EACrC,gBAAgB,EAAE,CAAE,SAAS,CAAE;EAC/B,cAAc,EAAE,CAAE,SAAS,CAAE;EAC7B,YAAY,EAAE,CAAE,KAAK,EAAE,OAAO,EAAE,KAAK,CAAE;EACvC,aAAa,EAAE,CAAE,KAAK,EAAE,MAAM,EAAE,YAAY;AAC7C,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,YAAYA,CAAEC,SAAS,EAAG;EACzC,OAAOA,SAAS,IAAIF,6BAA6B;AAClD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASG,gBAAgBA,CAAED,SAAS,EAAEE,aAAa,EAAG;EAC5D,OACCH,YAAY,CAAEC,SAAU,CAAC,IACzBF,6BAA6B,CAAEE,SAAS,CAAE,CAACG,QAAQ,CAAED,aAAc,CAAC;AAEtE;AAEA,OAAO,MAAME,uBAAuB,GAAGZ,0BAA0B,CAC9Da,SAAS,IAAQC,KAAK,IAAM;EAC7B,MAAMC,QAAQ,G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AAG;IAC1DS,aAAa,EAAGC;EAAgB,CAChC,CACA,CAAC;AAEL,CAAC,EACD,yBACD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASU,mBAAmBA,CAAEC,QAAQ,EAAExB,IAAI,EAAG;EAC9C,IAAK,CAAEf,YAAY,CAAEe,IAAK,CAAC,EAAG;IAC7B,OAAOwB,QAAQ;EAChB;EAEA,OAAO;IACN,GAAGA,QAAQ;IACXC,IAAI,EAAEnC,uBAAuB,CAAEkC,QAAQ,CAACC,IAAK;EAC9C,CAAC;AACF;AAEA3C,SAAS,CACR,0BAA0B,EAC1B,0EAA0E,EAC1EyC,mBACD,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["store","blocksStore","createHigherOrderComponent","useRegistry","useSelect","useCallback","addFilter","unlock","BLOCK_BINDINGS_ALLOWED_BLOCKS","canBindBlock","blockName","canBindAttribute","attributeName","includes","withBlockBindingSupport","BlockEdit","props","registry","sources","select","getAllBlockBindingsSources","bindings","attributes","metadata","name","clientId","context","boundAttributes","boundAttribute","Object","entries","source","getValue","args","undefined","getPlaceholder","setAttributes","_setAttributes","nextAttributes","batch","keptAttributes","updatesBySource","Map","newValue","setValue","setValues","set","get","size","value","keys","length","createElement","Fragment","shimAttributeSource","settings","edit"],"sources":["@wordpress/block-editor/src/hooks/use-bindings-attributes.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport { createHigherOrderComponent } from '@wordpress/compose';\nimport { useRegistry, useSelect } from '@wordpress/data';\nimport { useCallback } from '@wordpress/element';\nimport { addFilter } from '@wordpress/hooks';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../lock-unlock';\n\n/** @typedef {import('@wordpress/compose').WPHigherOrderComponent} WPHigherOrderComponent */\n/** @typedef {import('@wordpress/blocks').WPBlockSettings} WPBlockSettings */\n\n/**\n * Given a binding of block attributes, returns a higher order component that\n * overrides its `attributes` and `setAttributes` props to sync any changes needed.\n *\n * @return {WPHigherOrderComponent} Higher-order component.\n */\n\nconst BLOCK_BINDINGS_ALLOWED_BLOCKS = {\n\t'core/paragraph': [ 'content' ],\n\t'core/heading': [ 'content' ],\n\t'core/image': [ 'id', 'url', 'title', 'alt' ],\n\t'core/button': [ 'url', 'text', 'linkTarget', 'rel' ],\n};\n\n/**\n * Based on the given block name,\n * check if it is possible to bind the block.\n *\n * @param {string} blockName - The block name.\n * @return {boolean} Whether it is possible to bind the block to sources.\n */\nexport function canBindBlock( blockName ) {\n\treturn blockName in BLOCK_BINDINGS_ALLOWED_BLOCKS;\n}\n\n/**\n * Based on the given block name and attribute name,\n * check if it is possible to bind the block attribute.\n *\n * @param {string} blockName - The block name.\n * @param {string} attributeName - The attribute name.\n * @return {boolean} Whether it is possible to bind the block attribute.\n */\nexport function canBindAttribute( blockName, attributeName ) {\n\treturn (\n\t\tcanBindBlock( blockName ) &&\n\t\tBLOCK_BINDINGS_ALLOWED_BLOCKS[ blockName ].includes( attributeName )\n\t);\n}\n\nexport const withBlockBindingSupport = createHigherOrderComponent(\n\t( BlockEdit ) => ( props ) => {\n\t\tconst registry = useRegistry();\n\t\tconst sources = useSelect( ( select ) =>\n\t\t\tunlock( select( blocksStore ) ).getAllBlockBindingsSources()\n\t\t);\n\t\tconst bindings = props.attributes.metadata?.bindings;\n\t\tconst { name, clientId, context } = props;\n\t\tconst boundAttributes = useSelect( () => {\n\t\t\tif ( ! bindings ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst attributes = {};\n\n\t\t\tfor ( const [ attributeName, boundAttribute ] of Object.entries(\n\t\t\t\tbindings\n\t\t\t) ) {\n\t\t\t\tconst source = sources[ boundAttribute.source ];\n\t\t\t\tif (\n\t\t\t\t\t! source?.getValue ||\n\t\t\t\t\t! canBindAttribute( name, attributeName )\n\t\t\t\t) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tconst args = {\n\t\t\t\t\tregistry,\n\t\t\t\t\tcontext,\n\t\t\t\t\tclientId,\n\t\t\t\t\tattributeName,\n\t\t\t\t\targs: boundAttribute.args,\n\t\t\t\t};\n\n\t\t\t\tattributes[ attributeName ] = source.getValue( args );\n\n\t\t\t\tif ( attributes[ attributeName ] === undefined ) {\n\t\t\t\t\tif ( attributeName === 'url' ) {\n\t\t\t\t\t\tattributes[ attributeName ] = null;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tattributes[ attributeName ] =\n\t\t\t\t\t\t\tsource.getPlaceholder?.( args );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn attributes;\n\t\t}, [ bindings, name, clientId, context, registry, sources ] );\n\n\t\tconst { setAttributes } = props;\n\n\t\tconst _setAttributes = useCallback(\n\t\t\t( nextAttributes ) => {\n\t\t\t\tregistry.batch( () => {\n\t\t\t\t\tif ( ! bindings ) {\n\t\t\t\t\t\tsetAttributes( nextAttributes );\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst keptAttributes = { ...nextAttributes };\n\t\t\t\t\tconst updatesBySource = new Map();\n\n\t\t\t\t\t// Loop only over the updated attributes to avoid modifying the bound ones that haven't changed.\n\t\t\t\t\tfor ( const [ attributeName, newValue ] of Object.entries(\n\t\t\t\t\t\tkeptAttributes\n\t\t\t\t\t) ) {\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t! bindings[ attributeName ] ||\n\t\t\t\t\t\t\t! canBindAttribute( name, attributeName )\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst source =\n\t\t\t\t\t\t\tsources[ bindings[ attributeName ].source ];\n\t\t\t\t\t\tif ( ! source?.setValue && ! source?.setValues ) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tupdatesBySource.set( source, {\n\t\t\t\t\t\t\t...updatesBySource.get( source ),\n\t\t\t\t\t\t\t[ attributeName ]: newValue,\n\t\t\t\t\t\t} );\n\t\t\t\t\t\tdelete keptAttributes[ attributeName ];\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( updatesBySource.size ) {\n\t\t\t\t\t\tfor ( const [\n\t\t\t\t\t\t\tsource,\n\t\t\t\t\t\t\tattributes,\n\t\t\t\t\t\t] of updatesBySource ) {\n\t\t\t\t\t\t\tif ( source.setValues ) {\n\t\t\t\t\t\t\t\tsource.setValues( {\n\t\t\t\t\t\t\t\t\tregistry,\n\t\t\t\t\t\t\t\t\tcontext,\n\t\t\t\t\t\t\t\t\tclientId,\n\t\t\t\t\t\t\t\t\tattributes,\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tfor ( const [\n\t\t\t\t\t\t\t\t\tattributeName,\n\t\t\t\t\t\t\t\t\tvalue,\n\t\t\t\t\t\t\t\t] of Object.entries( attributes ) ) {\n\t\t\t\t\t\t\t\t\tsource.setValue( {\n\t\t\t\t\t\t\t\t\t\tregistry,\n\t\t\t\t\t\t\t\t\t\tcontext,\n\t\t\t\t\t\t\t\t\t\tclientId,\n\t\t\t\t\t\t\t\t\t\tattributeName,\n\t\t\t\t\t\t\t\t\t\targs: bindings[ attributeName ].args,\n\t\t\t\t\t\t\t\t\t\tvalue,\n\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( Object.keys( keptAttributes ).length ) {\n\t\t\t\t\t\tsetAttributes( keptAttributes );\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t},\n\t\t\t[\n\t\t\t\tregistry,\n\t\t\t\tbindings,\n\t\t\t\tname,\n\t\t\t\tclientId,\n\t\t\t\tcontext,\n\t\t\t\tsetAttributes,\n\t\t\t\tsources,\n\t\t\t]\n\t\t);\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<BlockEdit\n\t\t\t\t\t{ ...props }\n\t\t\t\t\tattributes={ { ...props.attributes, ...boundAttributes } }\n\t\t\t\t\tsetAttributes={ _setAttributes }\n\t\t\t\t/>\n\t\t\t</>\n\t\t);\n\t},\n\t'withBlockBindingSupport'\n);\n\n/**\n * Filters a registered block's settings to enhance a block's `edit` component\n * to upgrade bound attributes.\n *\n * @param {WPBlockSettings} settings - Registered block settings.\n * @param {string} name - Block name.\n * @return {WPBlockSettings} Filtered block settings.\n */\nfunction shimAttributeSource( settings, name ) {\n\tif ( ! canBindBlock( name ) ) {\n\t\treturn settings;\n\t}\n\n\treturn {\n\t\t...settings,\n\t\tedit: withBlockBindingSupport( settings.edit ),\n\t};\n}\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/editor/custom-sources-backwards-compatibility/shim-attribute-source',\n\tshimAttributeSource\n);\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;AACxD,SAASC,0BAA0B,QAAQ,oBAAoB;AAC/D,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,WAAW,QAAQ,oBAAoB;AAChD,SAASC,SAAS,QAAQ,kBAAkB;;AAE5C;AACA;AACA;AACA,SAASC,MAAM,QAAQ,gBAAgB;;AAEvC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAMC,6BAA6B,GAAG;EACrC,gBAAgB,EAAE,CAAE,SAAS,CAAE;EAC/B,cAAc,EAAE,CAAE,SAAS,CAAE;EAC7B,YAAY,EAAE,CAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,CAAE;EAC7C,aAAa,EAAE,CAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,KAAK;AACpD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,YAAYA,CAAEC,SAAS,EAAG;EACzC,OAAOA,SAAS,IAAIF,6BAA6B;AAClD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;A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,GAAGA,QAAQ;IACXC,IAAI,EAAE1C,uBAAuB,CAAEyC,QAAQ,CAACC,IAAK;EAC9C,CAAC;AACF;AAEAlD,SAAS,CACR,0BAA0B,EAC1B,0EAA0E,EAC1EgD,mBACD,CAAC","ignoreList":[]}
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * External dependencies
3
3
  */
4
- import classnames from 'classnames';
4
+ import clsx from 'clsx';
5
5
 
6
6
  /**
7
7
  * WordPress dependencies
@@ -46,7 +46,7 @@ export function getColorClassesAndStyles(attributes) {
46
46
  const hasGradient = gradientClass || style?.color?.gradient;
47
47
 
48
48
  // Determine color CSS class name list.
49
- const className = classnames(textClass, gradientClass, {
49
+ const className = clsx(textClass, gradientClass, {
50
50
  // Don't apply the background class if there's a gradient.
51
51
  [backgroundClass]: !hasGradient && !!backgroundClass,
52
52
  'has-text-color': textColor || style?.color?.text,
@@ -1 +1 @@
1
- {"version":3,"names":["classnames","useMemo","getInlineStyles","getColorClassName","getColorObjectByAttributeValues","__experimentalGetGradientClass","getGradientValueBySlug","useSettings","getColorClassesAndStyles","attributes","backgroundColor","textColor","gradient","style","backgroundClass","textClass","gradientClass","hasGradient","color","className","text","background","elements","link","colorStyles","styleProp","undefined","useColorProps","userPalette","themePalette","defaultPalette","userGradients","themeGradients","defaultGradients","colors","gradients","colorProps","backgroundColorObject","textColorObject"],"sources":["@wordpress/block-editor/src/hooks/use-color-props.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { getInlineStyles } from './style';\nimport {\n\tgetColorClassName,\n\tgetColorObjectByAttributeValues,\n} from '../components/colors';\nimport {\n\t__experimentalGetGradientClass,\n\tgetGradientValueBySlug,\n} from '../components/gradients';\nimport { useSettings } from '../components/use-settings';\n\n// The code in this file has largely been lifted from the color block support\n// hook.\n//\n// This utility is intended to assist where the serialization of the colors\n// block support is being skipped for a block but the color related CSS classes\n// & styles still need to be generated so they can be applied to inner elements.\n\n/**\n * Provides the CSS class names and inline styles for a block's color support\n * attributes.\n *\n * @param {Object} attributes Block attributes.\n *\n * @return {Object} Color block support derived CSS classes & styles.\n */\nexport function getColorClassesAndStyles( attributes ) {\n\tconst { backgroundColor, textColor, gradient, style } = attributes;\n\n\t// Collect color CSS classes.\n\tconst backgroundClass = getColorClassName(\n\t\t'background-color',\n\t\tbackgroundColor\n\t);\n\tconst textClass = getColorClassName( 'color', textColor );\n\n\tconst gradientClass = __experimentalGetGradientClass( gradient );\n\tconst hasGradient = gradientClass || style?.color?.gradient;\n\n\t// Determine color CSS class name list.\n\tconst className = classnames( textClass, gradientClass, {\n\t\t// Don't apply the background class if there's a gradient.\n\t\t[ backgroundClass ]: ! hasGradient && !! backgroundClass,\n\t\t'has-text-color': textColor || style?.color?.text,\n\t\t'has-background':\n\t\t\tbackgroundColor ||\n\t\t\tstyle?.color?.background ||\n\t\t\tgradient ||\n\t\t\tstyle?.color?.gradient,\n\t\t'has-link-color': style?.elements?.link?.color,\n\t} );\n\n\t// Collect inline styles for colors.\n\tconst colorStyles = style?.color || {};\n\tconst styleProp = getInlineStyles( { color: colorStyles } );\n\n\treturn {\n\t\tclassName: className || undefined,\n\t\tstyle: styleProp,\n\t};\n}\n\n/**\n * Determines the color related props for a block derived from its color block\n * support attributes.\n *\n * Inline styles are forced for named colors to ensure these selections are\n * reflected when themes do not load their color stylesheets in the editor.\n *\n * @param {Object} attributes Block attributes.\n *\n * @return {Object} ClassName & style props from colors block support.\n */\nexport function useColorProps( attributes ) {\n\tconst { backgroundColor, textColor, gradient } = attributes;\n\n\tconst [\n\t\tuserPalette,\n\t\tthemePalette,\n\t\tdefaultPalette,\n\t\tuserGradients,\n\t\tthemeGradients,\n\t\tdefaultGradients,\n\t] = useSettings(\n\t\t'color.palette.custom',\n\t\t'color.palette.theme',\n\t\t'color.palette.default',\n\t\t'color.gradients.custom',\n\t\t'color.gradients.theme',\n\t\t'color.gradients.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\tconst gradients = useMemo(\n\t\t() => [\n\t\t\t...( userGradients || [] ),\n\t\t\t...( themeGradients || [] ),\n\t\t\t...( defaultGradients || [] ),\n\t\t],\n\t\t[ userGradients, themeGradients, defaultGradients ]\n\t);\n\n\tconst colorProps = getColorClassesAndStyles( attributes );\n\n\t// Force inline styles to apply colors when themes do not load their color\n\t// stylesheets in the editor.\n\tif ( backgroundColor ) {\n\t\tconst backgroundColorObject = getColorObjectByAttributeValues(\n\t\t\tcolors,\n\t\t\tbackgroundColor\n\t\t);\n\n\t\tcolorProps.style.backgroundColor = backgroundColorObject.color;\n\t}\n\n\tif ( gradient ) {\n\t\tcolorProps.style.background = getGradientValueBySlug(\n\t\t\tgradients,\n\t\t\tgradient\n\t\t);\n\t}\n\n\tif ( textColor ) {\n\t\tconst textColorObject = getColorObjectByAttributeValues(\n\t\t\tcolors,\n\t\t\ttextColor\n\t\t);\n\n\t\tcolorProps.style.color = textColorObject.color;\n\t}\n\n\treturn colorProps;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,OAAO,QAAQ,oBAAoB;;AAE5C;AACA;AACA;AACA,SAASC,eAAe,QAAQ,SAAS;AACzC,SACCC,iBAAiB,EACjBC,+BAA+B,QACzB,sBAAsB;AAC7B,SACCC,8BAA8B,EAC9BC,sBAAsB,QAChB,yBAAyB;AAChC,SAASC,WAAW,QAAQ,4BAA4B;;AAExD;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,wBAAwBA,CAAEC,UAAU,EAAG;EACtD,MAAM;IAAEC,eAAe;IAAEC,SAAS;I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G1B,WAAW,CACd,sBAAsB,EACtB,qBAAqB,EACrB,uBAAuB,EACvB,wBAAwB,EACxB,uBAAuB,EACvB,yBACD,CAAC;EAED,MAAM2B,MAAM,GAAGjC,OAAO,CACrB,MAAM,CACL,IAAK2B,WAAW,IAAI,EAAE,CAAE,EACxB,IAAKC,YAAY,IAAI,EAAE,CAAE,EACzB,IAAKC,cAAc,IAAI,EAAE,CAAE,CAC3B,EACD,CAAEF,WAAW,EAAEC,YAAY,EAAEC,cAAc,CAC5C,CAAC;EACD,MAAMK,SAAS,GAAGlC,OAAO,CACxB,MAAM,CACL,IAAK8B,aAAa,IAAI,EAAE,CAAE,EAC1B,IAAKC,cAAc,IAAI,EAAE,CAAE,EAC3B,IAAKC,gBAAgB,IAAI,EAAE,CAAE,CAC7B,EACD,CAAEF,aAAa,EAAEC,cAAc,EAAEC,gBAAgB,CAClD,CAAC;EAED,MAAMG,UAAU,GAAG5B,wBAAwB,CAAEC,UAAW,CAAC;;EAEzD;EACA;EACA,IAAKC,eAAe,EAAG;IACtB,MAAM2B,qBAAqB,GAAGjC,+BAA+B,CAC5D8B,MAAM,EACNxB,eACD,CAAC;IAED0B,UAAU,CAACvB,KAAK,CAACH,eAAe,GAAG2B,qBAAqB,CAACnB,KAAK;EAC/D;EAEA,IAAKN,QAAQ,EAAG;IACfwB,UAAU,CAACvB,KAAK,CAACQ,UAAU,GAAGf,sBAAsB,CACnD6B,SAAS,EACTvB,QACD,CAAC;EACF;EAEA,IAAKD,SAAS,EAAG;IAChB,MAAM2B,eAAe,GAAGlC,+BAA+B,CACtD8B,MAAM,EACNvB,SACD,CAAC;IAEDyB,UAAU,CAACvB,KAAK,CAACK,KAAK,GAAGoB,eAAe,CAACpB,KAAK;EAC/C;EAEA,OAAOkB,UAAU;AAClB","ignoreList":[]}
1
+ {"version":3,"names":["clsx","useMemo","getInlineStyles","getColorClassName","getColorObjectByAttributeValues","__experimentalGetGradientClass","getGradientValueBySlug","useSettings","getColorClassesAndStyles","attributes","backgroundColor","textColor","gradient","style","backgroundClass","textClass","gradientClass","hasGradient","color","className","text","background","elements","link","colorStyles","styleProp","undefined","useColorProps","userPalette","themePalette","defaultPalette","userGradients","themeGradients","defaultGradients","colors","gradients","colorProps","backgroundColorObject","textColorObject"],"sources":["@wordpress/block-editor/src/hooks/use-color-props.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { getInlineStyles } from './style';\nimport {\n\tgetColorClassName,\n\tgetColorObjectByAttributeValues,\n} from '../components/colors';\nimport {\n\t__experimentalGetGradientClass,\n\tgetGradientValueBySlug,\n} from '../components/gradients';\nimport { useSettings } from '../components/use-settings';\n\n// The code in this file has largely been lifted from the color block support\n// hook.\n//\n// This utility is intended to assist where the serialization of the colors\n// block support is being skipped for a block but the color related CSS classes\n// & styles still need to be generated so they can be applied to inner elements.\n\n/**\n * Provides the CSS class names and inline styles for a block's color support\n * attributes.\n *\n * @param {Object} attributes Block attributes.\n *\n * @return {Object} Color block support derived CSS classes & styles.\n */\nexport function getColorClassesAndStyles( attributes ) {\n\tconst { backgroundColor, textColor, gradient, style } = attributes;\n\n\t// Collect color CSS classes.\n\tconst backgroundClass = getColorClassName(\n\t\t'background-color',\n\t\tbackgroundColor\n\t);\n\tconst textClass = getColorClassName( 'color', textColor );\n\n\tconst gradientClass = __experimentalGetGradientClass( gradient );\n\tconst hasGradient = gradientClass || style?.color?.gradient;\n\n\t// Determine color CSS class name list.\n\tconst className = clsx( textClass, gradientClass, {\n\t\t// Don't apply the background class if there's a gradient.\n\t\t[ backgroundClass ]: ! hasGradient && !! backgroundClass,\n\t\t'has-text-color': textColor || style?.color?.text,\n\t\t'has-background':\n\t\t\tbackgroundColor ||\n\t\t\tstyle?.color?.background ||\n\t\t\tgradient ||\n\t\t\tstyle?.color?.gradient,\n\t\t'has-link-color': style?.elements?.link?.color,\n\t} );\n\n\t// Collect inline styles for colors.\n\tconst colorStyles = style?.color || {};\n\tconst styleProp = getInlineStyles( { color: colorStyles } );\n\n\treturn {\n\t\tclassName: className || undefined,\n\t\tstyle: styleProp,\n\t};\n}\n\n/**\n * Determines the color related props for a block derived from its color block\n * support attributes.\n *\n * Inline styles are forced for named colors to ensure these selections are\n * reflected when themes do not load their color stylesheets in the editor.\n *\n * @param {Object} attributes Block attributes.\n *\n * @return {Object} ClassName & style props from colors block support.\n */\nexport function useColorProps( attributes ) {\n\tconst { backgroundColor, textColor, gradient } = attributes;\n\n\tconst [\n\t\tuserPalette,\n\t\tthemePalette,\n\t\tdefaultPalette,\n\t\tuserGradients,\n\t\tthemeGradients,\n\t\tdefaultGradients,\n\t] = useSettings(\n\t\t'color.palette.custom',\n\t\t'color.palette.theme',\n\t\t'color.palette.default',\n\t\t'color.gradients.custom',\n\t\t'color.gradients.theme',\n\t\t'color.gradients.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\tconst gradients = useMemo(\n\t\t() => [\n\t\t\t...( userGradients || [] ),\n\t\t\t...( themeGradients || [] ),\n\t\t\t...( defaultGradients || [] ),\n\t\t],\n\t\t[ userGradients, themeGradients, defaultGradients ]\n\t);\n\n\tconst colorProps = getColorClassesAndStyles( attributes );\n\n\t// Force inline styles to apply colors when themes do not load their color\n\t// stylesheets in the editor.\n\tif ( backgroundColor ) {\n\t\tconst backgroundColorObject = getColorObjectByAttributeValues(\n\t\t\tcolors,\n\t\t\tbackgroundColor\n\t\t);\n\n\t\tcolorProps.style.backgroundColor = backgroundColorObject.color;\n\t}\n\n\tif ( gradient ) {\n\t\tcolorProps.style.background = getGradientValueBySlug(\n\t\t\tgradients,\n\t\t\tgradient\n\t\t);\n\t}\n\n\tif ( textColor ) {\n\t\tconst textColorObject = getColorObjectByAttributeValues(\n\t\t\tcolors,\n\t\t\ttextColor\n\t\t);\n\n\t\tcolorProps.style.color = textColorObject.color;\n\t}\n\n\treturn colorProps;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,OAAO,QAAQ,oBAAoB;;AAE5C;AACA;AACA;AACA,SAASC,eAAe,QAAQ,SAAS;AACzC,SACCC,iBAAiB,EACjBC,+BAA+B,QACzB,sBAAsB;AAC7B,SACCC,8BAA8B,EAC9BC,sBAAsB,QAChB,yBAAyB;AAChC,SAASC,WAAW,QAAQ,4BAA4B;;AAExD;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,wBAAwBA,CAAEC,UAAU,EAAG;EACtD,MAAM;IAAEC,eAAe;IAAEC,SAAS;IAAEC,QAAQ;IAAEC;EAAM,CAAC,GAAGJ,UAAU;;EAElE;EACA,MAAMK,eAAe,GAAGX,iBAAiB,CACxC,kBAAkB,EAClBO,eACD,CAAC;EACD,MAAMK,SAAS,GAAGZ,iBAAiB,CAAE,OAAO,EAAEQ,SAAU,CAAC;EAEzD,MAAMK,aAAa,GAAGX,8BAA8B,CAAEO,QAAS,CAAC;EAChE,MAAMK,WAAW,GAAGD,aAAa,IAAIH,KAAK,EAAEK,KAAK,EAAEN,QAAQ;;EAE3D;EACA,MAAMO,SAAS,GAAGnB,IAAI,CAAEe,SAAS,EAAEC,aAAa,EAAE;IACjD;IACA,CAAEF,eAAe,GAAI,CAAEG,WAAW,IAAI,CAAC,CAAEH,eAAe;IACxD,gBAAgB,EAAEH,SAAS,IAAIE,KAAK,EAAEK,KAAK,EAAEE,IAAI;IACjD,gBAAgB,EACfV,eAAe,IACfG,KAAK,EAAEK,KAAK,EAAEG,UAAU,IACxBT,QAAQ,IACRC,KAAK,EAAEK,KAAK,EAAEN,QAAQ;IACvB,gBAAgB,EAAEC,KAAK,EA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AA+B,CAC5D8B,MAAM,EACNxB,eACD,CAAC;IAED0B,UAAU,CAACvB,KAAK,CAACH,eAAe,GAAG2B,qBAAqB,CAACnB,KAAK;EAC/D;EAEA,IAAKN,QAAQ,EAAG;IACfwB,UAAU,CAACvB,KAAK,CAACQ,UAAU,GAAGf,sBAAsB,CACnD6B,SAAS,EACTvB,QACD,CAAC;EACF;EAEA,IAAKD,SAAS,EAAG;IAChB,MAAM2B,eAAe,GAAGlC,+BAA+B,CACtD8B,MAAM,EACNvB,SACD,CAAC;IAEDyB,UAAU,CAACvB,KAAK,CAACK,KAAK,GAAGoB,eAAe,CAACpB,KAAK;EAC/C;EAEA,OAAOkB,UAAU;AAClB","ignoreList":[]}
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * External dependencies
3
3
  */
4
- import classnames from 'classnames';
4
+ import clsx from 'clsx';
5
5
 
6
6
  /**
7
7
  * WordPress dependencies
@@ -46,7 +46,7 @@ export function getTypographyClassesAndStyles(attributes, settings) {
46
46
  });
47
47
  const fontFamilyClassName = !!attributes?.fontFamily ? `has-${kebabCase(attributes.fontFamily)}-font-family` : '';
48
48
  const textAlignClassName = !!attributes?.style?.typography?.textAlign ? `has-text-align-${attributes?.style?.typography?.textAlign}` : '';
49
- const className = classnames(fontFamilyClassName, textAlignClassName, getFontSizeClass(attributes?.fontSize));
49
+ const className = clsx(fontFamilyClassName, textAlignClassName, getFontSizeClass(attributes?.fontSize));
50
50
  return {
51
51
  className,
52
52
  style
@@ -1 +1 @@
1
- {"version":3,"names":["classnames","privateApis","componentsPrivateApis","getInlineStyles","getFontSizeClass","getTypographyFontSizeValue","unlock","getTypographyClassesAndStyles","attributes","settings","kebabCase","typographyStyles","style","typography","fontSize","size","fontFamilyClassName","fontFamily","textAlignClassName","textAlign","className"],"sources":["@wordpress/block-editor/src/hooks/use-typography-props.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { privateApis as componentsPrivateApis } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { getInlineStyles } from './style';\nimport { getFontSizeClass } from '../components/font-sizes';\nimport { getTypographyFontSizeValue } from '../components/global-styles/typography-utils';\nimport { unlock } from '../lock-unlock';\n\n/*\n * This utility is intended to assist where the serialization of the typography\n * block support is being skipped for a block but the typography related CSS\n * styles still need to be generated so they can be applied to inner elements.\n */\n/**\n * Provides the CSS class names and inline styles for a block's typography support\n * attributes.\n *\n * @param {Object} attributes Block attributes.\n * @param {Object|boolean} settings Merged theme.json settings\n *\n * @return {Object} Typography block support derived CSS classes & styles.\n */\nexport function getTypographyClassesAndStyles( attributes, settings ) {\n\tconst { kebabCase } = unlock( componentsPrivateApis );\n\tlet typographyStyles = attributes?.style?.typography || {};\n\ttypographyStyles = {\n\t\t...typographyStyles,\n\t\tfontSize: getTypographyFontSizeValue(\n\t\t\t{ size: attributes?.style?.typography?.fontSize },\n\t\t\tsettings\n\t\t),\n\t};\n\n\tconst style = getInlineStyles( { typography: typographyStyles } );\n\tconst fontFamilyClassName = !! attributes?.fontFamily\n\t\t? `has-${ kebabCase( attributes.fontFamily ) }-font-family`\n\t\t: '';\n\tconst textAlignClassName = !! attributes?.style?.typography?.textAlign\n\t\t? `has-text-align-${ attributes?.style?.typography?.textAlign }`\n\t\t: '';\n\tconst className = classnames(\n\t\tfontFamilyClassName,\n\t\ttextAlignClassName,\n\t\tgetFontSizeClass( attributes?.fontSize )\n\t);\n\n\treturn {\n\t\tclassName,\n\t\tstyle,\n\t};\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,WAAW,IAAIC,qBAAqB,QAAQ,uBAAuB;;AAE5E;AACA;AACA;AACA,SAASC,eAAe,QAAQ,SAAS;AACzC,SAASC,gBAAgB,QAAQ,0BAA0B;AAC3D,SAASC,0BAA0B,QAAQ,8CAA8C;AACzF,SAASC,MAAM,QAAQ,gBAAgB;;AAEvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,6BAA6BA,CAAEC,UAAU,EAAEC,QAAQ,EAAG;EACrE,MAAM;IAAEC;EAAU,CAAC,GAAGJ,MAAM,CAAEJ,qBAAsB,CAAC;EACrD,IAAIS,gBAAgB,GAAGH,UAAU,EAAEI,KAAK,EAAEC,UAAU,IAAI,CAAC,CAAC;EAC1DF,gBAAgB,GAAG;IAClB,GAAGA,gBAAgB;IACnBG,QAAQ,EAAET,0BAA0B,CACnC;MAAEU,IAAI,EAAEP,UAAU,EAAEI,KAAK,EAAEC,UAAU,EAAEC;IAAS,CAAC,EACjDL,QACD;EACD,CAAC;EAED,MAAMG,KAAK,GAAGT,eAAe,CAAE;IAAEU,UAAU,EAAEF;EAAiB,CAAE,CAAC;EACjE,MAAMK,mBAAmB,GAAG,CAAC,CAAER,UAAU,EAAES,UAAU,GACjD,OAAOP,SAAS,CAAEF,UAAU,CAACS,UAAW,CAAG,cAAa,GACzD,EAAE;EACL,MAAMC,kBAAkB,GAAG,CAAC,CAAEV,UAAU,EAAEI,KAAK,EAAEC,UAAU,EAAEM,SAAS,GAClE,kBAAkBX,UAAU,EAAEI,KAAK,EAAEC,UAAU,EAAEM,SAAW,EAAC,GAC9D,EAAE;EACL,MAAMC,SAAS,GAAGpB,UAAU,CAC3BgB,mBAAmB,EACnBE,kBAAkB,EAClBd,gBAAgB,CAAEI,UAAU,EAAEM,QAAS,CACxC,CAAC;EAED,OAAO;IACNM,SAAS;IACTR;EACD,CAAC;AACF","ignoreList":[]}
1
+ {"version":3,"names":["clsx","privateApis","componentsPrivateApis","getInlineStyles","getFontSizeClass","getTypographyFontSizeValue","unlock","getTypographyClassesAndStyles","attributes","settings","kebabCase","typographyStyles","style","typography","fontSize","size","fontFamilyClassName","fontFamily","textAlignClassName","textAlign","className"],"sources":["@wordpress/block-editor/src/hooks/use-typography-props.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { privateApis as componentsPrivateApis } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { getInlineStyles } from './style';\nimport { getFontSizeClass } from '../components/font-sizes';\nimport { getTypographyFontSizeValue } from '../components/global-styles/typography-utils';\nimport { unlock } from '../lock-unlock';\n\n/*\n * This utility is intended to assist where the serialization of the typography\n * block support is being skipped for a block but the typography related CSS\n * styles still need to be generated so they can be applied to inner elements.\n */\n/**\n * Provides the CSS class names and inline styles for a block's typography support\n * attributes.\n *\n * @param {Object} attributes Block attributes.\n * @param {Object|boolean} settings Merged theme.json settings\n *\n * @return {Object} Typography block support derived CSS classes & styles.\n */\nexport function getTypographyClassesAndStyles( attributes, settings ) {\n\tconst { kebabCase } = unlock( componentsPrivateApis );\n\tlet typographyStyles = attributes?.style?.typography || {};\n\ttypographyStyles = {\n\t\t...typographyStyles,\n\t\tfontSize: getTypographyFontSizeValue(\n\t\t\t{ size: attributes?.style?.typography?.fontSize },\n\t\t\tsettings\n\t\t),\n\t};\n\n\tconst style = getInlineStyles( { typography: typographyStyles } );\n\tconst fontFamilyClassName = !! attributes?.fontFamily\n\t\t? `has-${ kebabCase( attributes.fontFamily ) }-font-family`\n\t\t: '';\n\tconst textAlignClassName = !! attributes?.style?.typography?.textAlign\n\t\t? `has-text-align-${ attributes?.style?.typography?.textAlign }`\n\t\t: '';\n\tconst className = clsx(\n\t\tfontFamilyClassName,\n\t\ttextAlignClassName,\n\t\tgetFontSizeClass( attributes?.fontSize )\n\t);\n\n\treturn {\n\t\tclassName,\n\t\tstyle,\n\t};\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,WAAW,IAAIC,qBAAqB,QAAQ,uBAAuB;;AAE5E;AACA;AACA;AACA,SAASC,eAAe,QAAQ,SAAS;AACzC,SAASC,gBAAgB,QAAQ,0BAA0B;AAC3D,SAASC,0BAA0B,QAAQ,8CAA8C;AACzF,SAASC,MAAM,QAAQ,gBAAgB;;AAEvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,6BAA6BA,CAAEC,UAAU,EAAEC,QAAQ,EAAG;EACrE,MAAM;IAAEC;EAAU,CAAC,GAAGJ,MAAM,CAAEJ,qBAAsB,CAAC;EACrD,IAAIS,gBAAgB,GAAGH,UAAU,EAAEI,KAAK,EAAEC,UAAU,IAAI,CAAC,CAAC;EAC1DF,gBAAgB,GAAG;IAClB,GAAGA,gBAAgB;IACnBG,QAAQ,EAAET,0BAA0B,CACnC;MAAEU,IAAI,EAAEP,UAAU,EAAEI,KAAK,EAAEC,UAAU,EAAEC;IAAS,CAAC,EACjDL,QACD;EACD,CAAC;EAED,MAAMG,KAAK,GAAGT,eAAe,CAAE;IAAEU,UAAU,EAAEF;EAAiB,CAAE,CAAC;EACjE,MAAMK,mBAAmB,GAAG,CAAC,CAAER,UAAU,EAAES,UAAU,GACjD,OAAOP,SAAS,CAAEF,UAAU,CAACS,UAAW,CAAG,cAAa,GACzD,EAAE;EACL,MAAMC,kBAAkB,GAAG,CAAC,CAAEV,UAAU,EAAEI,KAAK,EAAEC,UAAU,EAAEM,SAAS,GAClE,kBAAkBX,UAAU,EAAEI,KAAK,EAAEC,UAAU,EAAEM,SAAW,EAAC,GAC9D,EAAE;EACL,MAAMC,SAAS,GAAGpB,IAAI,CACrBgB,mBAAmB,EACnBE,kBAAkB,EAClBd,gBAAgB,CAAEI,UAAU,EAAEM,QAAS,CACxC,CAAC;EAED,OAAO;IACNM,SAAS;IACTR;EACD,CAAC;AACF","ignoreList":[]}
@@ -20,7 +20,7 @@ import { unlock } from '../lock-unlock';
20
20
  /**
21
21
  * External dependencies
22
22
  */
23
- import classnames from 'classnames';
23
+ import clsx from 'clsx';
24
24
 
25
25
  /**
26
26
  * Removed falsy values from nested object.
@@ -369,7 +369,7 @@ export function createBlockListBlockFilter(features) {
369
369
  return {
370
370
  ...acc,
371
371
  ...wrapperProps,
372
- className: classnames(acc.className, wrapperProps.className),
372
+ className: clsx(acc.className, wrapperProps.className),
373
373
  style: {
374
374
  ...acc.style,
375
375
  ...wrapperProps.style