@wordpress/block-editor 14.4.0 → 14.5.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 (817) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/README.md +6 -2
  3. package/build/autocompleters/block.js.map +1 -1
  4. package/build/components/background-image-control/index.js +1 -1
  5. package/build/components/background-image-control/index.js.map +1 -1
  6. package/build/components/block-controls/slot.js.map +1 -1
  7. package/build/components/block-controls/slot.native.js.map +1 -1
  8. package/build/components/block-draggable/draggable-chip.js +1 -1
  9. package/build/components/block-draggable/draggable-chip.js.map +1 -1
  10. package/build/components/block-list/block-invalid-warning.native.js +1 -1
  11. package/build/components/block-list/block-invalid-warning.native.js.map +1 -1
  12. package/build/components/block-list/block-list-item.native.js.map +1 -1
  13. package/build/components/block-list/block.js.map +1 -1
  14. package/build/components/block-list/index.js +1 -0
  15. package/build/components/block-list/index.js.map +1 -1
  16. package/build/components/block-list/index.native.js.map +1 -1
  17. package/build/components/block-list/use-block-props/index.js.map +1 -1
  18. package/build/components/block-list/use-block-props/use-selected-block-event-handlers.js +14 -6
  19. package/build/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +1 -1
  20. package/build/components/block-list/zoom-out-separator.js +10 -7
  21. package/build/components/block-list/zoom-out-separator.js.map +1 -1
  22. package/build/components/block-lock/modal.js +1 -1
  23. package/build/components/block-lock/modal.js.map +1 -1
  24. package/build/components/block-mover/button.js.map +1 -1
  25. package/build/components/block-parent-selector/index.js +1 -1
  26. package/build/components/block-parent-selector/index.js.map +1 -1
  27. package/build/components/block-pattern-setup/index.js.map +1 -1
  28. package/build/components/block-patterns-list/index.js.map +1 -1
  29. package/build/components/block-popover/index.js +45 -2
  30. package/build/components/block-popover/index.js.map +1 -1
  31. package/build/components/block-preview/auto.js +1 -4
  32. package/build/components/block-preview/auto.js.map +1 -1
  33. package/build/components/block-preview/index.js.map +1 -1
  34. package/build/components/block-rename/modal.js +2 -2
  35. package/build/components/block-rename/modal.js.map +1 -1
  36. package/build/components/block-settings-menu/block-parent-selector-menu-item.js +1 -1
  37. package/build/components/block-settings-menu/block-parent-selector-menu-item.js.map +1 -1
  38. package/build/components/block-switcher/block-transformations-menu.native.js +1 -1
  39. package/build/components/block-switcher/block-transformations-menu.native.js.map +1 -1
  40. package/build/components/block-switcher/index.js +2 -1
  41. package/build/components/block-switcher/index.js.map +1 -1
  42. package/build/components/block-switcher/pattern-transformations-menu.js.map +1 -1
  43. package/build/components/block-switcher/use-transformed-patterns.js +1 -0
  44. package/build/components/block-switcher/use-transformed-patterns.js.map +1 -1
  45. package/build/components/block-switcher/utils.js +1 -0
  46. package/build/components/block-switcher/utils.js.map +1 -1
  47. package/build/components/block-toolbar/index.js.map +1 -1
  48. package/build/components/block-tools/index.js +0 -7
  49. package/build/components/block-tools/index.js.map +1 -1
  50. package/build/components/block-tools/insertion-point.js.map +1 -1
  51. package/build/components/block-tools/use-show-block-tools.js +7 -3
  52. package/build/components/block-tools/use-show-block-tools.js.map +1 -1
  53. package/build/components/block-tools/zoom-out-popover.js +3 -2
  54. package/build/components/block-tools/zoom-out-popover.js.map +1 -1
  55. package/build/components/block-tools/zoom-out-toolbar.js +3 -20
  56. package/build/components/block-tools/zoom-out-toolbar.js.map +1 -1
  57. package/build/components/block-types-list/index.js.map +1 -1
  58. package/build/components/block-types-list/index.native.js.map +1 -1
  59. package/build/components/block-variation-transforms/index.js +3 -2
  60. package/build/components/block-variation-transforms/index.js.map +1 -1
  61. package/build/components/border-radius-control/index.js.map +1 -1
  62. package/build/components/border-radius-control/utils.js.map +1 -1
  63. package/build/components/button-block-appender/index.js.map +1 -1
  64. package/build/components/color-style-selector/index.js.map +1 -1
  65. package/build/components/colors/utils.js.map +1 -1
  66. package/build/components/colors/with-colors.js.map +1 -1
  67. package/build/components/colors-gradients/panel-color-gradient-settings.native.js.map +1 -1
  68. package/build/components/date-format-picker/index.js +1 -0
  69. package/build/components/date-format-picker/index.js.map +1 -1
  70. package/build/components/duotone/utils.js.map +1 -1
  71. package/build/components/duotone-control/index.js.map +1 -1
  72. package/build/components/font-sizes/fluid-utils.js.map +1 -1
  73. package/build/components/font-sizes/utils.js.map +1 -1
  74. package/build/components/font-sizes/with-font-sizes.js.map +1 -1
  75. package/build/components/global-styles/border-panel.js.map +1 -1
  76. package/build/components/global-styles/color-panel.js +1 -1
  77. package/build/components/global-styles/color-panel.js.map +1 -1
  78. package/build/components/global-styles/filters-panel.js.map +1 -1
  79. package/build/components/global-styles/get-block-css-selector.js.map +1 -1
  80. package/build/components/global-styles/get-global-styles-changes.js +2 -1
  81. package/build/components/global-styles/get-global-styles-changes.js.map +1 -1
  82. package/build/components/global-styles/hooks.js.map +1 -1
  83. package/build/components/global-styles/typography-panel.js.map +1 -1
  84. package/build/components/global-styles/use-global-styles-context.native.js.map +1 -1
  85. package/build/components/global-styles/use-global-styles-output.js.map +1 -1
  86. package/build/components/global-styles/utils.js.map +1 -1
  87. package/build/components/gradients/use-gradient.js.map +1 -1
  88. package/build/components/grid/grid-item-movers.js.map +1 -1
  89. package/build/components/grid/grid-visualizer.js.map +1 -1
  90. package/build/components/iframe/index.js +49 -9
  91. package/build/components/iframe/index.js.map +1 -1
  92. package/build/components/image-editor/use-save-image.js +1 -1
  93. package/build/components/image-editor/use-save-image.js.map +1 -1
  94. package/build/components/inner-blocks/use-nested-settings-update.js +15 -8
  95. package/build/components/inner-blocks/use-nested-settings-update.js.map +1 -1
  96. package/build/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js +1 -1
  97. package/build/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js.map +1 -1
  98. package/build/components/inserter/block-patterns-explorer/pattern-list.js +2 -2
  99. package/build/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
  100. package/build/components/inserter/block-patterns-tab/use-pattern-categories.js +1 -1
  101. package/build/components/inserter/block-patterns-tab/use-pattern-categories.js.map +1 -1
  102. package/build/components/inserter/block-types-tab.native.js.map +1 -1
  103. package/build/components/inserter/category-tabs/index.js +1 -10
  104. package/build/components/inserter/category-tabs/index.js.map +1 -1
  105. package/build/components/inserter/hooks/use-block-types-state.js +1 -1
  106. package/build/components/inserter/hooks/use-block-types-state.js.map +1 -1
  107. package/build/components/inserter/hooks/use-patterns-state.js +1 -1
  108. package/build/components/inserter/hooks/use-patterns-state.js.map +1 -1
  109. package/build/components/inserter/media-tab/media-panel.js.map +1 -1
  110. package/build/components/inserter/media-tab/media-preview.js +1 -1
  111. package/build/components/inserter/media-tab/media-preview.js.map +1 -1
  112. package/build/components/inserter/media-tab/media-tab.js.map +1 -1
  113. package/build/components/inserter/media-tab/utils.js.map +1 -1
  114. package/build/components/inserter/menu.js +5 -2
  115. package/build/components/inserter/menu.js.map +1 -1
  116. package/build/components/inserter/mobile-tab-navigation.js.map +1 -1
  117. package/build/components/inserter/preview-panel.js.map +1 -1
  118. package/build/components/inserter/quick-inserter.js +1 -1
  119. package/build/components/inserter/quick-inserter.js.map +1 -1
  120. package/build/components/inserter/search-results.js +1 -1
  121. package/build/components/inserter/search-results.js.map +1 -1
  122. package/build/components/inserter/tabs.native.js.map +1 -1
  123. package/build/components/inspector-controls/block-support-tools-panel.js.map +1 -1
  124. package/build/components/inspector-controls/fill.js.map +1 -1
  125. package/build/components/inspector-controls/fill.native.js.map +1 -1
  126. package/build/components/inspector-controls/slot.js.map +1 -1
  127. package/build/components/inspector-controls/slot.native.js.map +1 -1
  128. package/build/components/line-height-control/index.js.map +1 -1
  129. package/build/components/link-control/is-url-like.js.map +1 -1
  130. package/build/components/link-control/search-create-button.js +1 -1
  131. package/build/components/link-control/search-create-button.js.map +1 -1
  132. package/build/components/link-control/search-input.js +3 -5
  133. package/build/components/link-control/search-input.js.map +1 -1
  134. package/build/components/link-control/search-results.js +5 -15
  135. package/build/components/link-control/search-results.js.map +1 -1
  136. package/build/components/link-control/settings-drawer.js.map +1 -1
  137. package/build/components/link-control/use-rich-url-data.js.map +1 -1
  138. package/build/components/list-view/appender.js +1 -1
  139. package/build/components/list-view/appender.js.map +1 -1
  140. package/build/components/list-view/block-select-button.js.map +1 -1
  141. package/build/components/list-view/block.js.map +1 -1
  142. package/build/components/list-view/branch.js.map +1 -1
  143. package/build/components/list-view/drop-indicator.js.map +1 -1
  144. package/build/components/list-view/index.js.map +1 -1
  145. package/build/components/list-view/use-block-selection.js +2 -2
  146. package/build/components/list-view/use-block-selection.js.map +1 -1
  147. package/build/components/list-view/utils.js +1 -1
  148. package/build/components/list-view/utils.js.map +1 -1
  149. package/build/components/media-placeholder/index.native.js +1 -1
  150. package/build/components/media-placeholder/index.native.js.map +1 -1
  151. package/build/components/media-replace-flow/index.js.map +1 -1
  152. package/build/components/multi-selection-inspector/index.js +2 -2
  153. package/build/components/multi-selection-inspector/index.js.map +1 -1
  154. package/build/components/observe-typing/index.js +1 -0
  155. package/build/components/observe-typing/index.js.map +1 -1
  156. package/build/components/recursion-provider/index.js +1 -0
  157. package/build/components/recursion-provider/index.js.map +1 -1
  158. package/build/components/responsive-block-control/index.js +3 -3
  159. package/build/components/responsive-block-control/index.js.map +1 -1
  160. package/build/components/responsive-block-control/label.js +1 -1
  161. package/build/components/responsive-block-control/label.js.map +1 -1
  162. package/build/components/rich-text/content.js.map +1 -1
  163. package/build/components/rich-text/file-paste-handler.native.js.map +1 -1
  164. package/build/components/rich-text/format-toolbar/index.js.map +1 -1
  165. package/build/components/rich-text/format-toolbar/index.native.js.map +1 -1
  166. package/build/components/rich-text/index.js +3 -2
  167. package/build/components/rich-text/index.js.map +1 -1
  168. package/build/components/rich-text/multiline.js.map +1 -1
  169. package/build/components/rich-text/native/get-format-colors.native.js.map +1 -1
  170. package/build/components/rich-text/native/index.native.js.map +1 -1
  171. package/build/components/rich-text/native/use-format-types.js +1 -0
  172. package/build/components/rich-text/native/use-format-types.js.map +1 -1
  173. package/build/components/rich-text/toolbar-button.js.map +1 -1
  174. package/build/components/rich-text/use-format-types.js +1 -0
  175. package/build/components/rich-text/use-format-types.js.map +1 -1
  176. package/build/components/spacing-sizes-control/input-controls/axial.js.map +1 -1
  177. package/build/components/spacing-sizes-control/input-controls/separated.js.map +1 -1
  178. package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
  179. package/build/components/spacing-sizes-control/utils.js +1 -0
  180. package/build/components/spacing-sizes-control/utils.js.map +1 -1
  181. package/build/components/tool-selector/index.js +9 -3
  182. package/build/components/tool-selector/index.js.map +1 -1
  183. package/build/components/typewriter/index.js +1 -0
  184. package/build/components/typewriter/index.js.map +1 -1
  185. package/build/components/unsupported-block-details/index.native.js.map +1 -1
  186. package/build/components/url-input/index.js +1 -1
  187. package/build/components/url-input/index.js.map +1 -1
  188. package/build/components/use-block-drop-zone/index.js.map +1 -1
  189. package/build/components/use-flash-editable-blocks/index.js.map +1 -1
  190. package/build/components/use-moving-animation/index.js.map +1 -1
  191. package/build/components/use-resize-canvas/index.js +1 -2
  192. package/build/components/use-resize-canvas/index.js.map +1 -1
  193. package/build/components/writing-flow/use-tab-nav.js +21 -5
  194. package/build/components/writing-flow/use-tab-nav.js.map +1 -1
  195. package/build/hooks/align.js.map +1 -1
  196. package/build/hooks/block-hooks.js +1 -1
  197. package/build/hooks/block-hooks.js.map +1 -1
  198. package/build/hooks/block-style-variation.js.map +1 -1
  199. package/build/hooks/duotone.js.map +1 -1
  200. package/build/hooks/font-family.js.map +1 -1
  201. package/build/hooks/gap.js.map +1 -1
  202. package/build/hooks/generated-class-name.js +1 -0
  203. package/build/hooks/generated-class-name.js.map +1 -1
  204. package/build/hooks/grid-visualizer.js +13 -11
  205. package/build/hooks/grid-visualizer.js.map +1 -1
  206. package/build/hooks/layout-child.js +41 -3
  207. package/build/hooks/layout-child.js.map +1 -1
  208. package/build/hooks/layout.js.map +1 -1
  209. package/build/hooks/position.js +1 -1
  210. package/build/hooks/position.js.map +1 -1
  211. package/build/hooks/spacing-visualizer.js.map +1 -1
  212. package/build/hooks/style.js.map +1 -1
  213. package/build/hooks/text-align.js.map +1 -1
  214. package/build/hooks/use-typography-props.js.map +1 -1
  215. package/build/hooks/use-zoom-out.js +24 -16
  216. package/build/hooks/use-zoom-out.js.map +1 -1
  217. package/build/layouts/constrained.js.map +1 -1
  218. package/build/layouts/flex.js.map +1 -1
  219. package/build/layouts/grid.js.map +1 -1
  220. package/build/layouts/utils.js.map +1 -1
  221. package/build/private-apis.js +2 -0
  222. package/build/private-apis.js.map +1 -1
  223. package/build/store/actions.js +5 -6
  224. package/build/store/actions.js.map +1 -1
  225. package/build/store/private-selectors.js.map +1 -1
  226. package/build/store/reducer.js +2 -18
  227. package/build/store/reducer.js.map +1 -1
  228. package/build/store/selectors.js +22 -15
  229. package/build/store/selectors.js.map +1 -1
  230. package/build/utils/block-bindings.js +9 -6
  231. package/build/utils/block-bindings.js.map +1 -1
  232. package/build/utils/get-font-styles-and-weights.js +1 -1
  233. package/build/utils/get-font-styles-and-weights.js.map +1 -1
  234. package/build/utils/object.js +1 -0
  235. package/build/utils/object.js.map +1 -1
  236. package/build/utils/pasting.js.map +1 -1
  237. package/build-module/autocompleters/block.js +1 -3
  238. package/build-module/autocompleters/block.js.map +1 -1
  239. package/build-module/autocompleters/link.js +1 -3
  240. package/build-module/autocompleters/link.js.map +1 -1
  241. package/build-module/components/audio-player/index.native.js +1 -2
  242. package/build-module/components/audio-player/index.native.js.map +1 -1
  243. package/build-module/components/background-image-control/index.js +2 -3
  244. package/build-module/components/background-image-control/index.js.map +1 -1
  245. package/build-module/components/block-alignment-control/ui.js +1 -2
  246. package/build-module/components/block-alignment-control/ui.js.map +1 -1
  247. package/build-module/components/block-breadcrumb/index.js +1 -2
  248. package/build-module/components/block-breadcrumb/index.js.map +1 -1
  249. package/build-module/components/block-canvas/index.js +1 -2
  250. package/build-module/components/block-canvas/index.js.map +1 -1
  251. package/build-module/components/block-card/index.js +1 -2
  252. package/build-module/components/block-card/index.js.map +1 -1
  253. package/build-module/components/block-compare/block-view.js +1 -2
  254. package/build-module/components/block-compare/block-view.js.map +1 -1
  255. package/build-module/components/block-compare/index.js +1 -2
  256. package/build-module/components/block-compare/index.js.map +1 -1
  257. package/build-module/components/block-controls/fill.js +1 -3
  258. package/build-module/components/block-controls/fill.js.map +1 -1
  259. package/build-module/components/block-controls/slot.js.map +1 -1
  260. package/build-module/components/block-controls/slot.native.js.map +1 -1
  261. package/build-module/components/block-draggable/draggable-chip.js +2 -3
  262. package/build-module/components/block-draggable/draggable-chip.js.map +1 -1
  263. package/build-module/components/block-draggable/draggable-chip.native.js +1 -2
  264. package/build-module/components/block-draggable/draggable-chip.native.js.map +1 -1
  265. package/build-module/components/block-draggable/index.native.js +1 -3
  266. package/build-module/components/block-draggable/index.native.js.map +1 -1
  267. package/build-module/components/block-edit/index.js +1 -2
  268. package/build-module/components/block-edit/index.js.map +1 -1
  269. package/build-module/components/block-edit/multiple-usage-warning.js +1 -2
  270. package/build-module/components/block-edit/multiple-usage-warning.js.map +1 -1
  271. package/build-module/components/block-inspector/index.js +1 -3
  272. package/build-module/components/block-inspector/index.js.map +1 -1
  273. package/build-module/components/block-list/block-crash-warning.js +1 -1
  274. package/build-module/components/block-list/block-crash-warning.js.map +1 -1
  275. package/build-module/components/block-list/block-crash-warning.native.js +1 -1
  276. package/build-module/components/block-list/block-crash-warning.native.js.map +1 -1
  277. package/build-module/components/block-list/block-invalid-warning.js +1 -3
  278. package/build-module/components/block-list/block-invalid-warning.js.map +1 -1
  279. package/build-module/components/block-list/block-invalid-warning.native.js +1 -1
  280. package/build-module/components/block-list/block-invalid-warning.native.js.map +1 -1
  281. package/build-module/components/block-list/block-list-item.native.js +1 -2
  282. package/build-module/components/block-list/block-list-item.native.js.map +1 -1
  283. package/build-module/components/block-list/block-selection-button.native.js +1 -2
  284. package/build-module/components/block-list/block-selection-button.native.js.map +1 -1
  285. package/build-module/components/block-list/block.js +1 -3
  286. package/build-module/components/block-list/block.js.map +1 -1
  287. package/build-module/components/block-list/block.native.js +1 -2
  288. package/build-module/components/block-list/block.native.js.map +1 -1
  289. package/build-module/components/block-list/index.js +2 -2
  290. package/build-module/components/block-list/index.js.map +1 -1
  291. package/build-module/components/block-list/index.native.js +1 -3
  292. package/build-module/components/block-list/index.native.js.map +1 -1
  293. package/build-module/components/block-list/insertion-point.native.js +1 -2
  294. package/build-module/components/block-list/insertion-point.native.js.map +1 -1
  295. package/build-module/components/block-list/use-block-props/index.js.map +1 -1
  296. package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js +14 -6
  297. package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +1 -1
  298. package/build-module/components/block-list/zoom-out-separator.js +10 -7
  299. package/build-module/components/block-list/zoom-out-separator.js.map +1 -1
  300. package/build-module/components/block-lock/menu-item.js +1 -3
  301. package/build-module/components/block-lock/menu-item.js.map +1 -1
  302. package/build-module/components/block-lock/modal.js +2 -3
  303. package/build-module/components/block-lock/modal.js.map +1 -1
  304. package/build-module/components/block-lock/toolbar.js +1 -3
  305. package/build-module/components/block-lock/toolbar.js.map +1 -1
  306. package/build-module/components/block-media-update-progress/index.native.js +1 -2
  307. package/build-module/components/block-media-update-progress/index.native.js.map +1 -1
  308. package/build-module/components/block-mover/button.js +1 -3
  309. package/build-module/components/block-mover/button.js.map +1 -1
  310. package/build-module/components/block-mover/index.js +1 -2
  311. package/build-module/components/block-mover/index.js.map +1 -1
  312. package/build-module/components/block-mover/index.native.js +1 -2
  313. package/build-module/components/block-mover/index.native.js.map +1 -1
  314. package/build-module/components/block-navigation/dropdown.js +1 -2
  315. package/build-module/components/block-navigation/dropdown.js.map +1 -1
  316. package/build-module/components/block-parent-selector/index.js +1 -1
  317. package/build-module/components/block-parent-selector/index.js.map +1 -1
  318. package/build-module/components/block-pattern-setup/index.js +1 -3
  319. package/build-module/components/block-pattern-setup/index.js.map +1 -1
  320. package/build-module/components/block-pattern-setup/setup-toolbar.js +1 -2
  321. package/build-module/components/block-pattern-setup/setup-toolbar.js.map +1 -1
  322. package/build-module/components/block-patterns-list/index.js +1 -3
  323. package/build-module/components/block-patterns-list/index.js.map +1 -1
  324. package/build-module/components/block-patterns-paging/index.js +1 -2
  325. package/build-module/components/block-patterns-paging/index.js.map +1 -1
  326. package/build-module/components/block-popover/index.js +45 -2
  327. package/build-module/components/block-popover/index.js.map +1 -1
  328. package/build-module/components/block-preview/auto.js +2 -7
  329. package/build-module/components/block-preview/auto.js.map +1 -1
  330. package/build-module/components/block-preview/index.js +1 -2
  331. package/build-module/components/block-preview/index.js.map +1 -1
  332. package/build-module/components/block-quick-navigation/index.js +1 -2
  333. package/build-module/components/block-quick-navigation/index.js.map +1 -1
  334. package/build-module/components/block-removal-warning-modal/index.js +1 -2
  335. package/build-module/components/block-removal-warning-modal/index.js.map +1 -1
  336. package/build-module/components/block-rename/modal.js +3 -4
  337. package/build-module/components/block-rename/modal.js.map +1 -1
  338. package/build-module/components/block-rename/rename-control.js +1 -3
  339. package/build-module/components/block-rename/rename-control.js.map +1 -1
  340. package/build-module/components/block-settings/container.native.js +1 -3
  341. package/build-module/components/block-settings/container.native.js.map +1 -1
  342. package/build-module/components/block-settings-menu/block-parent-selector-menu-item.js +1 -1
  343. package/build-module/components/block-settings-menu/block-parent-selector-menu-item.js.map +1 -1
  344. package/build-module/components/block-settings-menu/block-settings-dropdown.js +1 -3
  345. package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  346. package/build-module/components/block-settings-menu-controls/index.js +1 -2
  347. package/build-module/components/block-settings-menu-controls/index.js.map +1 -1
  348. package/build-module/components/block-styles/index.js +1 -2
  349. package/build-module/components/block-styles/index.js.map +1 -1
  350. package/build-module/components/block-styles/menu-items.js +1 -2
  351. package/build-module/components/block-styles/menu-items.js.map +1 -1
  352. package/build-module/components/block-styles/preview.native.js +1 -2
  353. package/build-module/components/block-styles/preview.native.js.map +1 -1
  354. package/build-module/components/block-switcher/block-transformations-menu.js +1 -3
  355. package/build-module/components/block-switcher/block-transformations-menu.js.map +1 -1
  356. package/build-module/components/block-switcher/block-transformations-menu.native.js +1 -1
  357. package/build-module/components/block-switcher/block-transformations-menu.native.js.map +1 -1
  358. package/build-module/components/block-switcher/block-variation-transformations.js +1 -3
  359. package/build-module/components/block-switcher/block-variation-transformations.js.map +1 -1
  360. package/build-module/components/block-switcher/index.js +3 -4
  361. package/build-module/components/block-switcher/index.js.map +1 -1
  362. package/build-module/components/block-switcher/pattern-transformations-menu.js +1 -2
  363. package/build-module/components/block-switcher/pattern-transformations-menu.js.map +1 -1
  364. package/build-module/components/block-switcher/preview-block-popover.js +1 -2
  365. package/build-module/components/block-switcher/preview-block-popover.js.map +1 -1
  366. package/build-module/components/block-switcher/use-transformed-patterns.js +1 -0
  367. package/build-module/components/block-switcher/use-transformed-patterns.js.map +1 -1
  368. package/build-module/components/block-switcher/utils.js +1 -0
  369. package/build-module/components/block-switcher/utils.js.map +1 -1
  370. package/build-module/components/block-toolbar/block-toolbar-menu.native.js +1 -2
  371. package/build-module/components/block-toolbar/block-toolbar-menu.native.js.map +1 -1
  372. package/build-module/components/block-toolbar/index.js +1 -3
  373. package/build-module/components/block-toolbar/index.js.map +1 -1
  374. package/build-module/components/block-toolbar/index.native.js +1 -3
  375. package/build-module/components/block-toolbar/index.native.js.map +1 -1
  376. package/build-module/components/block-tools/index.js +1 -9
  377. package/build-module/components/block-tools/index.js.map +1 -1
  378. package/build-module/components/block-tools/insertion-point.js +1 -2
  379. package/build-module/components/block-tools/insertion-point.js.map +1 -1
  380. package/build-module/components/block-tools/use-show-block-tools.js +7 -3
  381. package/build-module/components/block-tools/use-show-block-tools.js.map +1 -1
  382. package/build-module/components/block-tools/zoom-out-popover.js +2 -1
  383. package/build-module/components/block-tools/zoom-out-popover.js.map +1 -1
  384. package/build-module/components/block-tools/zoom-out-toolbar.js +5 -23
  385. package/build-module/components/block-tools/zoom-out-toolbar.js.map +1 -1
  386. package/build-module/components/block-types-list/index.js +1 -2
  387. package/build-module/components/block-types-list/index.js.map +1 -1
  388. package/build-module/components/block-types-list/index.native.js +1 -2
  389. package/build-module/components/block-types-list/index.native.js.map +1 -1
  390. package/build-module/components/block-variation-picker/index.js +1 -2
  391. package/build-module/components/block-variation-picker/index.js.map +1 -1
  392. package/build-module/components/block-variation-picker/index.native.js +1 -2
  393. package/build-module/components/block-variation-picker/index.native.js.map +1 -1
  394. package/build-module/components/block-variation-transforms/index.js +4 -4
  395. package/build-module/components/block-variation-transforms/index.js.map +1 -1
  396. package/build-module/components/border-radius-control/index.js +1 -3
  397. package/build-module/components/border-radius-control/index.js.map +1 -1
  398. package/build-module/components/border-radius-control/utils.js.map +1 -1
  399. package/build-module/components/button-block-appender/index.js.map +1 -1
  400. package/build-module/components/button-block-appender/index.native.js +1 -2
  401. package/build-module/components/button-block-appender/index.native.js.map +1 -1
  402. package/build-module/components/child-layout-control/index.js +1 -3
  403. package/build-module/components/child-layout-control/index.js.map +1 -1
  404. package/build-module/components/color-style-selector/index.js.map +1 -1
  405. package/build-module/components/colors/utils.js.map +1 -1
  406. package/build-module/components/colors/with-colors.js.map +1 -1
  407. package/build-module/components/colors-gradients/control.js +1 -2
  408. package/build-module/components/colors-gradients/control.js.map +1 -1
  409. package/build-module/components/colors-gradients/dropdown.js +1 -3
  410. package/build-module/components/colors-gradients/dropdown.js.map +1 -1
  411. package/build-module/components/colors-gradients/panel-color-gradient-settings.js +1 -3
  412. package/build-module/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
  413. package/build-module/components/colors-gradients/panel-color-gradient-settings.native.js +1 -3
  414. package/build-module/components/colors-gradients/panel-color-gradient-settings.native.js.map +1 -1
  415. package/build-module/components/contrast-checker/index.native.js +1 -2
  416. package/build-module/components/contrast-checker/index.native.js.map +1 -1
  417. package/build-module/components/convert-to-group-buttons/index.js +1 -3
  418. package/build-module/components/convert-to-group-buttons/index.js.map +1 -1
  419. package/build-module/components/convert-to-group-buttons/toolbar.js +1 -2
  420. package/build-module/components/convert-to-group-buttons/toolbar.js.map +1 -1
  421. package/build-module/components/date-format-picker/index.js +2 -2
  422. package/build-module/components/date-format-picker/index.js.map +1 -1
  423. package/build-module/components/default-block-appender/index.js +1 -2
  424. package/build-module/components/default-block-appender/index.js.map +1 -1
  425. package/build-module/components/dimensions-tool/index.js +1 -3
  426. package/build-module/components/dimensions-tool/index.js.map +1 -1
  427. package/build-module/components/dimensions-tool/width-height-tool.js +1 -3
  428. package/build-module/components/dimensions-tool/width-height-tool.js.map +1 -1
  429. package/build-module/components/duotone/utils.js.map +1 -1
  430. package/build-module/components/duotone-control/index.js +1 -2
  431. package/build-module/components/duotone-control/index.js.map +1 -1
  432. package/build-module/components/editor-styles/index.js +1 -3
  433. package/build-module/components/editor-styles/index.js.map +1 -1
  434. package/build-module/components/floating-toolbar/index.native.js +1 -2
  435. package/build-module/components/floating-toolbar/index.native.js.map +1 -1
  436. package/build-module/components/floating-toolbar/nav-up-icon.js +1 -2
  437. package/build-module/components/floating-toolbar/nav-up-icon.js.map +1 -1
  438. package/build-module/components/font-sizes/fluid-utils.js.map +1 -1
  439. package/build-module/components/font-sizes/utils.js.map +1 -1
  440. package/build-module/components/font-sizes/with-font-sizes.js +2 -2
  441. package/build-module/components/font-sizes/with-font-sizes.js.map +1 -1
  442. package/build-module/components/global-styles/advanced-panel.js +1 -2
  443. package/build-module/components/global-styles/advanced-panel.js.map +1 -1
  444. package/build-module/components/global-styles/border-panel.js +1 -2
  445. package/build-module/components/global-styles/border-panel.js.map +1 -1
  446. package/build-module/components/global-styles/color-panel.js +2 -3
  447. package/build-module/components/global-styles/color-panel.js.map +1 -1
  448. package/build-module/components/global-styles/dimensions-panel.js +1 -2
  449. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  450. package/build-module/components/global-styles/filters-panel.js +1 -2
  451. package/build-module/components/global-styles/filters-panel.js.map +1 -1
  452. package/build-module/components/global-styles/get-block-css-selector.js.map +1 -1
  453. package/build-module/components/global-styles/get-global-styles-changes.js +2 -1
  454. package/build-module/components/global-styles/get-global-styles-changes.js.map +1 -1
  455. package/build-module/components/global-styles/hooks.js.map +1 -1
  456. package/build-module/components/global-styles/image-settings-panel.js +1 -2
  457. package/build-module/components/global-styles/image-settings-panel.js.map +1 -1
  458. package/build-module/components/global-styles/shadow-panel-components.js +1 -2
  459. package/build-module/components/global-styles/shadow-panel-components.js.map +1 -1
  460. package/build-module/components/global-styles/typography-panel.js +1 -2
  461. package/build-module/components/global-styles/typography-panel.js.map +1 -1
  462. package/build-module/components/global-styles/use-global-styles-context.native.js.map +1 -1
  463. package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
  464. package/build-module/components/global-styles/utils.js.map +1 -1
  465. package/build-module/components/gradients/use-gradient.js.map +1 -1
  466. package/build-module/components/grid/grid-item-movers.js +1 -3
  467. package/build-module/components/grid/grid-item-movers.js.map +1 -1
  468. package/build-module/components/grid/grid-visualizer.js.map +1 -1
  469. package/build-module/components/height-control/index.js +1 -2
  470. package/build-module/components/height-control/index.js.map +1 -1
  471. package/build-module/components/iframe/index.js +50 -12
  472. package/build-module/components/iframe/index.js.map +1 -1
  473. package/build-module/components/image-editor/aspect-ratio-dropdown.js +1 -3
  474. package/build-module/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
  475. package/build-module/components/image-editor/cropper.js +1 -3
  476. package/build-module/components/image-editor/cropper.js.map +1 -1
  477. package/build-module/components/image-editor/form-controls.js +1 -3
  478. package/build-module/components/image-editor/form-controls.js.map +1 -1
  479. package/build-module/components/image-editor/index.js +1 -2
  480. package/build-module/components/image-editor/index.js.map +1 -1
  481. package/build-module/components/image-editor/use-save-image.js +1 -1
  482. package/build-module/components/image-editor/use-save-image.js.map +1 -1
  483. package/build-module/components/image-link-destinations/index.native.js +1 -3
  484. package/build-module/components/image-link-destinations/index.native.js.map +1 -1
  485. package/build-module/components/image-size-control/index.js +1 -3
  486. package/build-module/components/image-size-control/index.js.map +1 -1
  487. package/build-module/components/inner-blocks/use-nested-settings-update.js +16 -9
  488. package/build-module/components/inner-blocks/use-nested-settings-update.js.map +1 -1
  489. package/build-module/components/inner-blocks/warning-max-depth-exceeded.native.js +1 -2
  490. package/build-module/components/inner-blocks/warning-max-depth-exceeded.native.js.map +1 -1
  491. package/build-module/components/inserter/block-patterns-explorer/index.js +1 -2
  492. package/build-module/components/inserter/block-patterns-explorer/index.js.map +1 -1
  493. package/build-module/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js +2 -3
  494. package/build-module/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js.map +1 -1
  495. package/build-module/components/inserter/block-patterns-explorer/pattern-list.js +3 -5
  496. package/build-module/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
  497. package/build-module/components/inserter/block-patterns-tab/index.js +1 -3
  498. package/build-module/components/inserter/block-patterns-tab/index.js.map +1 -1
  499. package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js +1 -3
  500. package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
  501. package/build-module/components/inserter/block-patterns-tab/patterns-filter.js +1 -3
  502. package/build-module/components/inserter/block-patterns-tab/patterns-filter.js.map +1 -1
  503. package/build-module/components/inserter/block-patterns-tab/use-pattern-categories.js +1 -1
  504. package/build-module/components/inserter/block-patterns-tab/use-pattern-categories.js.map +1 -1
  505. package/build-module/components/inserter/block-types-tab.js +1 -3
  506. package/build-module/components/inserter/block-types-tab.js.map +1 -1
  507. package/build-module/components/inserter/block-types-tab.native.js.map +1 -1
  508. package/build-module/components/inserter/category-tabs/index.js +3 -13
  509. package/build-module/components/inserter/category-tabs/index.js.map +1 -1
  510. package/build-module/components/inserter/hooks/use-block-types-state.js +1 -1
  511. package/build-module/components/inserter/hooks/use-block-types-state.js.map +1 -1
  512. package/build-module/components/inserter/hooks/use-patterns-state.js +1 -1
  513. package/build-module/components/inserter/hooks/use-patterns-state.js.map +1 -1
  514. package/build-module/components/inserter/index.native.js +1 -3
  515. package/build-module/components/inserter/index.native.js.map +1 -1
  516. package/build-module/components/inserter/media-tab/media-panel.js +1 -2
  517. package/build-module/components/inserter/media-tab/media-panel.js.map +1 -1
  518. package/build-module/components/inserter/media-tab/media-preview.js +2 -4
  519. package/build-module/components/inserter/media-tab/media-preview.js.map +1 -1
  520. package/build-module/components/inserter/media-tab/media-tab.js +1 -3
  521. package/build-module/components/inserter/media-tab/media-tab.js.map +1 -1
  522. package/build-module/components/inserter/media-tab/utils.js.map +1 -1
  523. package/build-module/components/inserter/menu.js +6 -5
  524. package/build-module/components/inserter/menu.js.map +1 -1
  525. package/build-module/components/inserter/menu.native.js +1 -3
  526. package/build-module/components/inserter/menu.native.js.map +1 -1
  527. package/build-module/components/inserter/mobile-tab-navigation.js +1 -2
  528. package/build-module/components/inserter/mobile-tab-navigation.js.map +1 -1
  529. package/build-module/components/inserter/no-results.js +1 -2
  530. package/build-module/components/inserter/no-results.js.map +1 -1
  531. package/build-module/components/inserter/no-results.native.js +1 -2
  532. package/build-module/components/inserter/no-results.native.js.map +1 -1
  533. package/build-module/components/inserter/panel.js +1 -3
  534. package/build-module/components/inserter/panel.js.map +1 -1
  535. package/build-module/components/inserter/preview-panel.js +1 -2
  536. package/build-module/components/inserter/preview-panel.js.map +1 -1
  537. package/build-module/components/inserter/quick-inserter.js +2 -3
  538. package/build-module/components/inserter/quick-inserter.js.map +1 -1
  539. package/build-module/components/inserter/search-results.js +2 -3
  540. package/build-module/components/inserter/search-results.js.map +1 -1
  541. package/build-module/components/inserter/tabs.native.js.map +1 -1
  542. package/build-module/components/inserter-button/index.native.js +1 -2
  543. package/build-module/components/inserter-button/index.native.js.map +1 -1
  544. package/build-module/components/inserter-list-item/index.js +1 -2
  545. package/build-module/components/inserter-list-item/index.js.map +1 -1
  546. package/build-module/components/inserter-listbox/index.js +1 -2
  547. package/build-module/components/inserter-listbox/index.js.map +1 -1
  548. package/build-module/components/inspector-controls/block-support-tools-panel.js.map +1 -1
  549. package/build-module/components/inspector-controls/fill.js.map +1 -1
  550. package/build-module/components/inspector-controls/fill.native.js +1 -3
  551. package/build-module/components/inspector-controls/fill.native.js.map +1 -1
  552. package/build-module/components/inspector-controls/slot.js.map +1 -1
  553. package/build-module/components/inspector-controls/slot.native.js.map +1 -1
  554. package/build-module/components/inspector-controls-tabs/index.js +1 -2
  555. package/build-module/components/inspector-controls-tabs/index.js.map +1 -1
  556. package/build-module/components/inspector-controls-tabs/settings-tab.js +1 -3
  557. package/build-module/components/inspector-controls-tabs/settings-tab.js.map +1 -1
  558. package/build-module/components/inspector-controls-tabs/styles-tab.js +1 -3
  559. package/build-module/components/inspector-controls-tabs/styles-tab.js.map +1 -1
  560. package/build-module/components/inspector-popover-header/index.js +1 -2
  561. package/build-module/components/inspector-popover-header/index.js.map +1 -1
  562. package/build-module/components/line-height-control/index.js.map +1 -1
  563. package/build-module/components/link-control/index.js +1 -3
  564. package/build-module/components/link-control/index.js.map +1 -1
  565. package/build-module/components/link-control/is-url-like.js.map +1 -1
  566. package/build-module/components/link-control/link-preview.js +1 -3
  567. package/build-module/components/link-control/link-preview.js.map +1 -1
  568. package/build-module/components/link-control/search-create-button.js +1 -1
  569. package/build-module/components/link-control/search-create-button.js.map +1 -1
  570. package/build-module/components/link-control/search-input.js +4 -7
  571. package/build-module/components/link-control/search-input.js.map +1 -1
  572. package/build-module/components/link-control/search-results.js +6 -17
  573. package/build-module/components/link-control/search-results.js.map +1 -1
  574. package/build-module/components/link-control/settings-drawer.js +1 -3
  575. package/build-module/components/link-control/settings-drawer.js.map +1 -1
  576. package/build-module/components/link-control/settings.js +1 -2
  577. package/build-module/components/link-control/settings.js.map +1 -1
  578. package/build-module/components/link-control/use-rich-url-data.js.map +1 -1
  579. package/build-module/components/list-view/appender.js +2 -3
  580. package/build-module/components/list-view/appender.js.map +1 -1
  581. package/build-module/components/list-view/block-contents.js +1 -3
  582. package/build-module/components/list-view/block-contents.js.map +1 -1
  583. package/build-module/components/list-view/block-select-button.js +1 -2
  584. package/build-module/components/list-view/block-select-button.js.map +1 -1
  585. package/build-module/components/list-view/block.js +1 -3
  586. package/build-module/components/list-view/block.js.map +1 -1
  587. package/build-module/components/list-view/branch.js +1 -3
  588. package/build-module/components/list-view/branch.js.map +1 -1
  589. package/build-module/components/list-view/drop-indicator.js +1 -2
  590. package/build-module/components/list-view/drop-indicator.js.map +1 -1
  591. package/build-module/components/list-view/index.js +1 -2
  592. package/build-module/components/list-view/index.js.map +1 -1
  593. package/build-module/components/list-view/use-block-selection.js +2 -2
  594. package/build-module/components/list-view/use-block-selection.js.map +1 -1
  595. package/build-module/components/list-view/utils.js +1 -1
  596. package/build-module/components/list-view/utils.js.map +1 -1
  597. package/build-module/components/media-placeholder/index.js +1 -3
  598. package/build-module/components/media-placeholder/index.js.map +1 -1
  599. package/build-module/components/media-placeholder/index.native.js +2 -4
  600. package/build-module/components/media-placeholder/index.native.js.map +1 -1
  601. package/build-module/components/media-replace-flow/index.js +1 -3
  602. package/build-module/components/media-replace-flow/index.js.map +1 -1
  603. package/build-module/components/media-upload/index.native.js +1 -3
  604. package/build-module/components/media-upload/index.native.js.map +1 -1
  605. package/build-module/components/media-upload-progress/index.native.js +1 -2
  606. package/build-module/components/media-upload-progress/index.native.js.map +1 -1
  607. package/build-module/components/multi-selection-inspector/index.js +3 -4
  608. package/build-module/components/multi-selection-inspector/index.js.map +1 -1
  609. package/build-module/components/observe-typing/index.js +1 -0
  610. package/build-module/components/observe-typing/index.js.map +1 -1
  611. package/build-module/components/provider/index.js +1 -2
  612. package/build-module/components/provider/index.js.map +1 -1
  613. package/build-module/components/publish-date-time-picker/index.js +1 -2
  614. package/build-module/components/publish-date-time-picker/index.js.map +1 -1
  615. package/build-module/components/recursion-provider/index.js +1 -0
  616. package/build-module/components/recursion-provider/index.js.map +1 -1
  617. package/build-module/components/responsive-block-control/index.js +4 -5
  618. package/build-module/components/responsive-block-control/index.js.map +1 -1
  619. package/build-module/components/responsive-block-control/label.js +2 -4
  620. package/build-module/components/responsive-block-control/label.js.map +1 -1
  621. package/build-module/components/rich-text/content.js.map +1 -1
  622. package/build-module/components/rich-text/event-listeners/before-input-rules.js +2 -2
  623. package/build-module/components/rich-text/event-listeners/before-input-rules.js.map +1 -1
  624. package/build-module/components/rich-text/event-listeners/delete.js +2 -2
  625. package/build-module/components/rich-text/event-listeners/delete.js.map +1 -1
  626. package/build-module/components/rich-text/event-listeners/enter.js +2 -2
  627. package/build-module/components/rich-text/event-listeners/enter.js.map +1 -1
  628. package/build-module/components/rich-text/event-listeners/firefox-compat.js +2 -2
  629. package/build-module/components/rich-text/event-listeners/firefox-compat.js.map +1 -1
  630. package/build-module/components/rich-text/event-listeners/input-events.js +2 -2
  631. package/build-module/components/rich-text/event-listeners/input-events.js.map +1 -1
  632. package/build-module/components/rich-text/event-listeners/input-rules.js +2 -2
  633. package/build-module/components/rich-text/event-listeners/input-rules.js.map +1 -1
  634. package/build-module/components/rich-text/event-listeners/insert-replacement-text.js +2 -2
  635. package/build-module/components/rich-text/event-listeners/insert-replacement-text.js.map +1 -1
  636. package/build-module/components/rich-text/event-listeners/paste-handler.js +2 -2
  637. package/build-module/components/rich-text/event-listeners/paste-handler.js.map +1 -1
  638. package/build-module/components/rich-text/event-listeners/remove-browser-shortcuts.js +2 -2
  639. package/build-module/components/rich-text/event-listeners/remove-browser-shortcuts.js.map +1 -1
  640. package/build-module/components/rich-text/event-listeners/shortcuts.js +2 -2
  641. package/build-module/components/rich-text/event-listeners/shortcuts.js.map +1 -1
  642. package/build-module/components/rich-text/event-listeners/undo-automatic-change.js +2 -2
  643. package/build-module/components/rich-text/event-listeners/undo-automatic-change.js.map +1 -1
  644. package/build-module/components/rich-text/file-paste-handler.native.js.map +1 -1
  645. package/build-module/components/rich-text/format-toolbar/index.js +1 -3
  646. package/build-module/components/rich-text/format-toolbar/index.js.map +1 -1
  647. package/build-module/components/rich-text/format-toolbar/index.native.js +1 -3
  648. package/build-module/components/rich-text/format-toolbar/index.native.js.map +1 -1
  649. package/build-module/components/rich-text/index.js +4 -5
  650. package/build-module/components/rich-text/index.js.map +1 -1
  651. package/build-module/components/rich-text/index.native.js +1 -3
  652. package/build-module/components/rich-text/index.native.js.map +1 -1
  653. package/build-module/components/rich-text/multiline.js.map +1 -1
  654. package/build-module/components/rich-text/native/get-format-colors.native.js.map +1 -1
  655. package/build-module/components/rich-text/native/index.js +1 -1
  656. package/build-module/components/rich-text/native/index.js.map +1 -1
  657. package/build-module/components/rich-text/native/index.native.js +1 -3
  658. package/build-module/components/rich-text/native/index.native.js.map +1 -1
  659. package/build-module/components/rich-text/native/toolbar-button-with-options.native.js +1 -3
  660. package/build-module/components/rich-text/native/toolbar-button-with-options.native.js.map +1 -1
  661. package/build-module/components/rich-text/native/use-format-types.js +1 -0
  662. package/build-module/components/rich-text/native/use-format-types.js.map +1 -1
  663. package/build-module/components/rich-text/toolbar-button.js.map +1 -1
  664. package/build-module/components/rich-text/use-format-types.js +1 -0
  665. package/build-module/components/rich-text/use-format-types.js.map +1 -1
  666. package/build-module/components/spacing-sizes-control/index.js +1 -2
  667. package/build-module/components/spacing-sizes-control/index.js.map +1 -1
  668. package/build-module/components/spacing-sizes-control/input-controls/axial.js +1 -2
  669. package/build-module/components/spacing-sizes-control/input-controls/axial.js.map +1 -1
  670. package/build-module/components/spacing-sizes-control/input-controls/separated.js +1 -2
  671. package/build-module/components/spacing-sizes-control/input-controls/separated.js.map +1 -1
  672. package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js +1 -3
  673. package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
  674. package/build-module/components/spacing-sizes-control/utils.js +1 -0
  675. package/build-module/components/spacing-sizes-control/utils.js.map +1 -1
  676. package/build-module/components/tabbed-sidebar/index.js +1 -2
  677. package/build-module/components/tabbed-sidebar/index.js.map +1 -1
  678. package/build-module/components/tool-selector/index.js +10 -6
  679. package/build-module/components/tool-selector/index.js.map +1 -1
  680. package/build-module/components/typewriter/index.js +1 -0
  681. package/build-module/components/typewriter/index.js.map +1 -1
  682. package/build-module/components/unsupported-block-details/index.native.js +1 -2
  683. package/build-module/components/unsupported-block-details/index.native.js.map +1 -1
  684. package/build-module/components/url-input/button.js +1 -2
  685. package/build-module/components/url-input/button.js.map +1 -1
  686. package/build-module/components/url-input/index.js +2 -4
  687. package/build-module/components/url-input/index.js.map +1 -1
  688. package/build-module/components/url-popover/image-url-input-ui.js +1 -3
  689. package/build-module/components/url-popover/image-url-input-ui.js.map +1 -1
  690. package/build-module/components/url-popover/index.js +1 -2
  691. package/build-module/components/url-popover/index.js.map +1 -1
  692. package/build-module/components/url-popover/link-editor.js +1 -2
  693. package/build-module/components/url-popover/link-editor.js.map +1 -1
  694. package/build-module/components/url-popover/link-viewer.js +1 -2
  695. package/build-module/components/url-popover/link-viewer.js.map +1 -1
  696. package/build-module/components/use-block-drop-zone/index.js.map +1 -1
  697. package/build-module/components/use-flash-editable-blocks/index.js.map +1 -1
  698. package/build-module/components/use-moving-animation/index.js.map +1 -1
  699. package/build-module/components/use-resize-canvas/index.js +1 -2
  700. package/build-module/components/use-resize-canvas/index.js.map +1 -1
  701. package/build-module/components/video-player/index.native.js +1 -2
  702. package/build-module/components/video-player/index.native.js.map +1 -1
  703. package/build-module/components/warning/index.js +1 -2
  704. package/build-module/components/warning/index.js.map +1 -1
  705. package/build-module/components/warning/index.native.js +1 -2
  706. package/build-module/components/warning/index.native.js.map +1 -1
  707. package/build-module/components/writing-flow/index.js +1 -3
  708. package/build-module/components/writing-flow/index.js.map +1 -1
  709. package/build-module/components/writing-flow/use-tab-nav.js +21 -5
  710. package/build-module/components/writing-flow/use-tab-nav.js.map +1 -1
  711. package/build-module/hooks/align.js.map +1 -1
  712. package/build-module/hooks/anchor.js +1 -3
  713. package/build-module/hooks/anchor.js.map +1 -1
  714. package/build-module/hooks/block-bindings.js +1 -3
  715. package/build-module/hooks/block-bindings.js.map +1 -1
  716. package/build-module/hooks/block-hooks.js +2 -3
  717. package/build-module/hooks/block-hooks.js.map +1 -1
  718. package/build-module/hooks/block-style-variation.js +1 -2
  719. package/build-module/hooks/block-style-variation.js.map +1 -1
  720. package/build-module/hooks/dimensions.js +1 -3
  721. package/build-module/hooks/dimensions.js.map +1 -1
  722. package/build-module/hooks/duotone.js +1 -3
  723. package/build-module/hooks/duotone.js.map +1 -1
  724. package/build-module/hooks/font-family.js.map +1 -1
  725. package/build-module/hooks/gap.js.map +1 -1
  726. package/build-module/hooks/generated-class-name.js +1 -0
  727. package/build-module/hooks/generated-class-name.js.map +1 -1
  728. package/build-module/hooks/grid-visualizer.js +14 -14
  729. package/build-module/hooks/grid-visualizer.js.map +1 -1
  730. package/build-module/hooks/layout-child.js +42 -6
  731. package/build-module/hooks/layout-child.js.map +1 -1
  732. package/build-module/hooks/layout.js +1 -3
  733. package/build-module/hooks/layout.js.map +1 -1
  734. package/build-module/hooks/position.js +1 -1
  735. package/build-module/hooks/position.js.map +1 -1
  736. package/build-module/hooks/spacing-visualizer.js.map +1 -1
  737. package/build-module/hooks/style.js +1 -3
  738. package/build-module/hooks/style.js.map +1 -1
  739. package/build-module/hooks/text-align.js.map +1 -1
  740. package/build-module/hooks/typography.native.js +1 -2
  741. package/build-module/hooks/typography.native.js.map +1 -1
  742. package/build-module/hooks/use-bindings-attributes.js +1 -2
  743. package/build-module/hooks/use-bindings-attributes.js.map +1 -1
  744. package/build-module/hooks/use-typography-props.js.map +1 -1
  745. package/build-module/hooks/use-zoom-out.js +24 -17
  746. package/build-module/hooks/use-zoom-out.js.map +1 -1
  747. package/build-module/layouts/constrained.js +1 -3
  748. package/build-module/layouts/constrained.js.map +1 -1
  749. package/build-module/layouts/flex.js +1 -3
  750. package/build-module/layouts/flex.js.map +1 -1
  751. package/build-module/layouts/grid.js +1 -3
  752. package/build-module/layouts/grid.js.map +1 -1
  753. package/build-module/layouts/utils.js.map +1 -1
  754. package/build-module/private-apis.js +2 -0
  755. package/build-module/private-apis.js.map +1 -1
  756. package/build-module/store/actions.js +5 -6
  757. package/build-module/store/actions.js.map +1 -1
  758. package/build-module/store/private-selectors.js.map +1 -1
  759. package/build-module/store/reducer.js +1 -16
  760. package/build-module/store/reducer.js.map +1 -1
  761. package/build-module/store/selectors.js +21 -12
  762. package/build-module/store/selectors.js.map +1 -1
  763. package/build-module/utils/block-bindings.js +9 -6
  764. package/build-module/utils/block-bindings.js.map +1 -1
  765. package/build-module/utils/get-font-styles-and-weights.js +1 -1
  766. package/build-module/utils/get-font-styles-and-weights.js.map +1 -1
  767. package/build-module/utils/get-px-from-css-unit.js +1 -1
  768. package/build-module/utils/get-px-from-css-unit.js.map +1 -1
  769. package/build-module/utils/object.js +1 -0
  770. package/build-module/utils/object.js.map +1 -1
  771. package/build-module/utils/pasting.js.map +1 -1
  772. package/build-style/content-rtl.css +13 -26
  773. package/build-style/content.css +13 -26
  774. package/build-style/style-rtl.css +23 -41
  775. package/build-style/style.css +23 -41
  776. package/package.json +33 -33
  777. package/src/components/block-canvas/style.scss +0 -1
  778. package/src/components/block-list/content.scss +3 -2
  779. package/src/components/block-list/use-block-props/use-selected-block-event-handlers.js +25 -4
  780. package/src/components/block-list/zoom-out-separator.js +8 -6
  781. package/src/components/block-popover/index.js +64 -2
  782. package/src/components/block-preview/auto.js +1 -4
  783. package/src/components/block-tools/index.js +0 -11
  784. package/src/components/block-tools/style.scss +1 -1
  785. package/src/components/block-tools/use-show-block-tools.js +10 -3
  786. package/src/components/block-tools/zoom-out-popover.js +2 -1
  787. package/src/components/block-tools/zoom-out-toolbar.js +2 -23
  788. package/src/components/iframe/content.scss +27 -32
  789. package/src/components/iframe/index.js +63 -13
  790. package/src/components/iframe/style.scss +18 -0
  791. package/src/components/inner-blocks/use-nested-settings-update.js +16 -10
  792. package/src/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js +1 -1
  793. package/src/components/inserter/category-tabs/index.js +1 -11
  794. package/src/components/inserter/menu.js +7 -2
  795. package/src/components/inserter/quick-inserter.js +1 -1
  796. package/src/components/inserter/style.scss +1 -41
  797. package/src/components/link-control/search-input.js +4 -5
  798. package/src/components/link-control/search-results.js +2 -13
  799. package/src/components/link-control/test/index.js +84 -46
  800. package/src/components/media-replace-flow/test/index.js +1 -1
  801. package/src/components/responsive-block-control/style.scss +0 -1
  802. package/src/components/rich-text/style.scss +5 -0
  803. package/src/components/tool-selector/index.js +7 -2
  804. package/src/components/use-resize-canvas/index.js +1 -3
  805. package/src/components/writing-flow/use-tab-nav.js +28 -4
  806. package/src/hooks/grid-visualizer.js +23 -9
  807. package/src/hooks/layout-child.js +48 -3
  808. package/src/hooks/use-zoom-out.js +36 -20
  809. package/src/private-apis.js +2 -0
  810. package/src/store/actions.js +3 -2
  811. package/src/store/reducer.js +0 -17
  812. package/src/store/selectors.js +23 -12
  813. package/src/store/test/private-selectors.js +7 -1
  814. package/src/store/test/selectors.js +13 -2
  815. package/src/style.scss +1 -0
  816. package/src/utils/block-bindings.js +9 -6
  817. package/src/utils/test/use-block-bindings-utils.js +174 -0
@@ -19,8 +19,7 @@ import { Icon, close } from '@wordpress/icons';
19
19
  import styles from './style.scss';
20
20
  import { store as blockEditorStore } from '../../store';
21
21
  import InserterButton from '../inserter-button';
22
- import { jsx as _jsx } from "react/jsx-runtime";
23
- import { jsxs as _jsxs } from "react/jsx-runtime";
22
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
24
23
  const hitSlop = {
25
24
  top: 22,
26
25
  bottom: 22,
@@ -1 +1 @@
1
- {"version":3,"names":["ScrollView","View","Text","TouchableWithoutFeedback","Platform","useDispatch","usePreferredColorSchemeStyle","createBlocksFromInnerBlocksTemplate","__","PanelBody","BottomSheet","FooterMessageControl","Icon","close","styles","store","blockEditorStore","InserterButton","jsx","_jsx","jsxs","_jsxs","hitSlop","top","bottom","left","right","BlockVariationPicker","isVisible","onClose","clientId","variations","replaceInnerBlocks","isIOS","OS","cancelButtonStyle","cancelButton","cancelButtonDark","leftButton","onPress","children","style","maxFontSizeMultiplier","icon","size","closeIcon","onVariationSelect","variation","innerBlocks","title","contentStyle","testID","horizontal","showsHorizontalScrollIndicator","contentContainerStyle","containerStyle","map","v","item","onSelect","name","label"],"sources":["@wordpress/block-editor/src/components/block-variation-picker/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport {\n\tScrollView,\n\tView,\n\tText,\n\tTouchableWithoutFeedback,\n\tPlatform,\n} from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { useDispatch } from '@wordpress/data';\nimport { usePreferredColorSchemeStyle } from '@wordpress/compose';\nimport { createBlocksFromInnerBlocksTemplate } from '@wordpress/blocks';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tPanelBody,\n\tBottomSheet,\n\tFooterMessageControl,\n} from '@wordpress/components';\nimport { Icon, close } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\nimport { store as blockEditorStore } from '../../store';\nimport InserterButton from '../inserter-button';\n\nconst hitSlop = { top: 22, bottom: 22, left: 22, right: 22 };\n\nfunction BlockVariationPicker( { isVisible, onClose, clientId, variations } ) {\n\tconst { replaceInnerBlocks } = useDispatch( blockEditorStore );\n\tconst isIOS = Platform.OS === 'ios';\n\n\tconst cancelButtonStyle = usePreferredColorSchemeStyle(\n\t\tstyles.cancelButton,\n\t\tstyles.cancelButtonDark\n\t);\n\n\tconst leftButton = (\n\t\t<TouchableWithoutFeedback onPress={ onClose } hitSlop={ hitSlop }>\n\t\t\t<View>\n\t\t\t\t{ isIOS ? (\n\t\t\t\t\t<Text\n\t\t\t\t\t\tstyle={ cancelButtonStyle }\n\t\t\t\t\t\tmaxFontSizeMultiplier={ 2 }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t\t</Text>\n\t\t\t\t) : (\n\t\t\t\t\t<Icon\n\t\t\t\t\t\ticon={ close }\n\t\t\t\t\t\tsize={ 24 }\n\t\t\t\t\t\tstyle={ styles.closeIcon }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</View>\n\t\t</TouchableWithoutFeedback>\n\t);\n\n\tconst onVariationSelect = ( variation ) => {\n\t\treplaceInnerBlocks(\n\t\t\tclientId,\n\t\t\tcreateBlocksFromInnerBlocksTemplate( variation.innerBlocks )\n\t\t);\n\t\tonClose();\n\t};\n\n\treturn (\n\t\t<BottomSheet\n\t\t\tisVisible={ isVisible }\n\t\t\tonClose={ onClose }\n\t\t\ttitle={ __( 'Select a layout' ) }\n\t\t\tcontentStyle={ styles.contentStyle }\n\t\t\tleftButton={ leftButton }\n\t\t\ttestID=\"block-variation-modal\"\n\t\t>\n\t\t\t<ScrollView\n\t\t\t\thorizontal\n\t\t\t\tshowsHorizontalScrollIndicator={ false }\n\t\t\t\tcontentContainerStyle={ styles.contentContainerStyle }\n\t\t\t\tstyle={ styles.containerStyle }\n\t\t\t>\n\t\t\t\t{ variations.map( ( v ) => (\n\t\t\t\t\t<InserterButton\n\t\t\t\t\t\titem={ v }\n\t\t\t\t\t\tkey={ v.name }\n\t\t\t\t\t\tonSelect={ () => onVariationSelect( v ) }\n\t\t\t\t\t/>\n\t\t\t\t) ) }\n\t\t\t</ScrollView>\n\t\t\t<PanelBody>\n\t\t\t\t<FooterMessageControl\n\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t'Note: Column layout may vary between themes and screen sizes'\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t</PanelBody>\n\t\t</BottomSheet>\n\t);\n}\n\nexport default BlockVariationPicker;\n"],"mappings":"AAAA;AACA;AACA;AACA,SACCA,UAAU,EACVC,IAAI,EACJC,IAAI,EACJC,wBAAwB,EACxBC,QAAQ,QACF,cAAc;;AAErB;AACA;AACA;AACA,SAASC,WAAW,QAAQ,iBAAiB;AAC7C,SAASC,4BAA4B,QAAQ,oBAAoB;AACjE,SAASC,mCAAmC,QAAQ,mBAAmB;AACvE,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SACCC,SAAS,EACTC,WAAW,EACXC,oBAAoB,QACd,uBAAuB;AAC9B,SAASC,IAAI,EAAEC,KAAK,QAAQ,kBAAkB;;AAE9C;AACA;AACA;AACA,OAAOC,MAAM,MAAM,cAAc;AACjC,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,aAAa;AACvD,OAAOC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AAW;IACvBC,OAAO,EAAGA,OAAS;IACnBoB,KAAK,EAAGzC,EAAE,CAAE,iBAAkB,CAAG;IACjC0C,YAAY,EAAGpC,MAAM,CAACoC,YAAc;IACpCZ,UAAU,EAAGA,UAAY;IACzBa,MAAM,EAAC,uBAAuB;IAAAX,QAAA,gBAE9BrB,IAAA,CAACnB,UAAU;MACVoD,UAAU;MACVC,8BAA8B,EAAG,KAAO;MACxCC,qBAAqB,EAAGxC,MAAM,CAACwC,qBAAuB;MACtDb,KAAK,EAAG3B,MAAM,CAACyC,cAAgB;MAAAf,QAAA,EAE7BT,UAAU,CAACyB,GAAG,CAAIC,CAAC,iBACpBtC,IAAA,CAACF,cAAc;QACdyC,IAAI,EAAGD,CAAG;QAEVE,QAAQ,EAAGA,CAAA,KAAMb,iBAAiB,CAAEW,CAAE;MAAG,GADnCA,CAAC,CAACG,IAER,CACA;IAAC,CACQ,CAAC,eACbzC,IAAA,CAACV,SAAS;MAAA+B,QAAA,eACTrB,IAAA,CAACR,oBAAoB;QACpBkD,KAAK,EAAGrD,EAAE,CACT,8DACD;MAAG,CACH;IAAC,CACQ,CAAC;EAAA,CACA,CAAC;AAEhB;AAEA,eAAemB,oBAAoB","ignoreList":[]}
1
+ {"version":3,"names":["ScrollView","View","Text","TouchableWithoutFeedback","Platform","useDispatch","usePreferredColorSchemeStyle","createBlocksFromInnerBlocksTemplate","__","PanelBody","BottomSheet","FooterMessageControl","Icon","close","styles","store","blockEditorStore","InserterButton","jsx","_jsx","jsxs","_jsxs","hitSlop","top","bottom","left","right","BlockVariationPicker","isVisible","onClose","clientId","variations","replaceInnerBlocks","isIOS","OS","cancelButtonStyle","cancelButton","cancelButtonDark","leftButton","onPress","children","style","maxFontSizeMultiplier","icon","size","closeIcon","onVariationSelect","variation","innerBlocks","title","contentStyle","testID","horizontal","showsHorizontalScrollIndicator","contentContainerStyle","containerStyle","map","v","item","onSelect","name","label"],"sources":["@wordpress/block-editor/src/components/block-variation-picker/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport {\n\tScrollView,\n\tView,\n\tText,\n\tTouchableWithoutFeedback,\n\tPlatform,\n} from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { useDispatch } from '@wordpress/data';\nimport { usePreferredColorSchemeStyle } from '@wordpress/compose';\nimport { createBlocksFromInnerBlocksTemplate } from '@wordpress/blocks';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tPanelBody,\n\tBottomSheet,\n\tFooterMessageControl,\n} from '@wordpress/components';\nimport { Icon, close } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\nimport { store as blockEditorStore } from '../../store';\nimport InserterButton from '../inserter-button';\n\nconst hitSlop = { top: 22, bottom: 22, left: 22, right: 22 };\n\nfunction BlockVariationPicker( { isVisible, onClose, clientId, variations } ) {\n\tconst { replaceInnerBlocks } = useDispatch( blockEditorStore );\n\tconst isIOS = Platform.OS === 'ios';\n\n\tconst cancelButtonStyle = usePreferredColorSchemeStyle(\n\t\tstyles.cancelButton,\n\t\tstyles.cancelButtonDark\n\t);\n\n\tconst leftButton = (\n\t\t<TouchableWithoutFeedback onPress={ onClose } hitSlop={ hitSlop }>\n\t\t\t<View>\n\t\t\t\t{ isIOS ? (\n\t\t\t\t\t<Text\n\t\t\t\t\t\tstyle={ cancelButtonStyle }\n\t\t\t\t\t\tmaxFontSizeMultiplier={ 2 }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t\t</Text>\n\t\t\t\t) : (\n\t\t\t\t\t<Icon\n\t\t\t\t\t\ticon={ close }\n\t\t\t\t\t\tsize={ 24 }\n\t\t\t\t\t\tstyle={ styles.closeIcon }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</View>\n\t\t</TouchableWithoutFeedback>\n\t);\n\n\tconst onVariationSelect = ( variation ) => {\n\t\treplaceInnerBlocks(\n\t\t\tclientId,\n\t\t\tcreateBlocksFromInnerBlocksTemplate( variation.innerBlocks )\n\t\t);\n\t\tonClose();\n\t};\n\n\treturn (\n\t\t<BottomSheet\n\t\t\tisVisible={ isVisible }\n\t\t\tonClose={ onClose }\n\t\t\ttitle={ __( 'Select a layout' ) }\n\t\t\tcontentStyle={ styles.contentStyle }\n\t\t\tleftButton={ leftButton }\n\t\t\ttestID=\"block-variation-modal\"\n\t\t>\n\t\t\t<ScrollView\n\t\t\t\thorizontal\n\t\t\t\tshowsHorizontalScrollIndicator={ false }\n\t\t\t\tcontentContainerStyle={ styles.contentContainerStyle }\n\t\t\t\tstyle={ styles.containerStyle }\n\t\t\t>\n\t\t\t\t{ variations.map( ( v ) => (\n\t\t\t\t\t<InserterButton\n\t\t\t\t\t\titem={ v }\n\t\t\t\t\t\tkey={ v.name }\n\t\t\t\t\t\tonSelect={ () => onVariationSelect( v ) }\n\t\t\t\t\t/>\n\t\t\t\t) ) }\n\t\t\t</ScrollView>\n\t\t\t<PanelBody>\n\t\t\t\t<FooterMessageControl\n\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t'Note: Column layout may vary between themes and screen sizes'\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t</PanelBody>\n\t\t</BottomSheet>\n\t);\n}\n\nexport default BlockVariationPicker;\n"],"mappings":"AAAA;AACA;AACA;AACA,SACCA,UAAU,EACVC,IAAI,EACJC,IAAI,EACJC,wBAAwB,EACxBC,QAAQ,QACF,cAAc;;AAErB;AACA;AACA;AACA,SAASC,WAAW,QAAQ,iBAAiB;AAC7C,SAASC,4BAA4B,QAAQ,oBAAoB;AACjE,SAASC,mCAAmC,QAAQ,mBAAmB;AACvE,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SACCC,SAAS,EACTC,WAAW,EACXC,oBAAoB,QACd,uBAAuB;AAC9B,SAASC,IAAI,EAAEC,KAAK,QAAQ,kBAAkB;;AAE9C;AACA;AACA;AACA,OAAOC,MAAM,MAAM,cAAc;AACjC,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,aAAa;AAC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A,SAAW;IACvBC,OAAO,EAAGA,OAAS;IACnBoB,KAAK,EAAGzC,EAAE,CAAE,iBAAkB,CAAG;IACjC0C,YAAY,EAAGpC,MAAM,CAACoC,YAAc;IACpCZ,UAAU,EAAGA,UAAY;IACzBa,MAAM,EAAC,uBAAuB;IAAAX,QAAA,gBAE9BrB,IAAA,CAACnB,UAAU;MACVoD,UAAU;MACVC,8BAA8B,EAAG,KAAO;MACxCC,qBAAqB,EAAGxC,MAAM,CAACwC,qBAAuB;MACtDb,KAAK,EAAG3B,MAAM,CAACyC,cAAgB;MAAAf,QAAA,EAE7BT,UAAU,CAACyB,GAAG,CAAIC,CAAC,iBACpBtC,IAAA,CAACF,cAAc;QACdyC,IAAI,EAAGD,CAAG;QAEVE,QAAQ,EAAGA,CAAA,KAAMb,iBAAiB,CAAEW,CAAE;MAAG,GADnCA,CAAC,CAACG,IAER,CACA;IAAC,CACQ,CAAC,eACbzC,IAAA,CAACV,SAAS;MAAA+B,QAAA,eACTrB,IAAA,CAACR,oBAAoB;QACpBkD,KAAK,EAAGrD,EAAE,CACT,8DACD;MAAG,CACH;IAAC,CACQ,CAAC;EAAA,CACA,CAAC;AAEhB;AAEA,eAAemB,oBAAoB","ignoreList":[]}
@@ -1,3 +1,4 @@
1
+ /* wp:polyfill */
1
2
  /**
2
3
  * WordPress dependencies
3
4
  */
@@ -14,8 +15,7 @@ import { chevronDown } from '@wordpress/icons';
14
15
  import BlockIcon from '../block-icon';
15
16
  import { store as blockEditorStore } from '../../store';
16
17
  import { unlock } from '../../lock-unlock';
17
- import { jsx as _jsx } from "react/jsx-runtime";
18
- import { jsxs as _jsxs } from "react/jsx-runtime";
18
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
19
19
  function VariationsButtons({
20
20
  className,
21
21
  onSelectVariation,
@@ -35,7 +35,7 @@ function VariationsButtons({
35
35
  showColors: true
36
36
  }),
37
37
  isPressed: selectedValue === variation.name,
38
- label: selectedValue === variation.name ? variation.title : sprintf( /* translators: %s: Name of the block variation */
38
+ label: selectedValue === variation.name ? variation.title : sprintf(/* translators: %s: Name of the block variation */
39
39
  __('Transform to %s'), variation.title),
40
40
  onClick: () => onSelectVariation(variation.name),
41
41
  "aria-label": variation.title,
@@ -103,7 +103,7 @@ function VariationsToggleGroupControl({
103
103
  showColors: true
104
104
  }),
105
105
  value: variation.name,
106
- label: selectedValue === variation.name ? variation.title : sprintf( /* translators: %s: Name of the block variation */
106
+ label: selectedValue === variation.name ? variation.title : sprintf(/* translators: %s: Name of the block variation */
107
107
  __('Transform to %s'), variation.title)
108
108
  }, variation.name))
109
109
  })
@@ -1 +1 @@
1
- {"version":3,"names":["store","blocksStore","__","sprintf","Button","DropdownMenu","MenuGroup","MenuItemsChoice","__experimentalToggleGroupControl","ToggleGroupControl","__experimentalToggleGroupControlOptionIcon","ToggleGroupControlOptionIcon","VisuallyHidden","useSelect","useDispatch","useMemo","chevronDown","BlockIcon","blockEditorStore","unlock","jsx","_jsx","jsxs","_jsxs","VariationsButtons","className","onSelectVariation","selectedValue","variations","children","as","map","variation","__next40pxDefaultSize","size","icon","showColors","isPressed","name","label","title","onClick","showTooltip","VariationsDropdown","selectOptions","description","value","info","text","popoverProps","position","toggleProps","iconPosition","choices","onSelect","VariationsToggleGroupControl","hideLabelFromVision","onChange","__nextHasNoMarginBottom","__experimentalBlockVariationTransforms","blockClientId","updateBlockAttributes","activeBlockVariation","isContentOnly","select","getActiveBlockVariation","getBlockVariations","getBlockName","getBlockAttributes","getBlockEditingMode","hasContentRoleAttribute","isContentBlock","hasUniqueIcons","variationIcons","Set","forEach","add","src","length","variationName","find","attributes","baseClass","showButtons","ButtonComponent","Component"],"sources":["@wordpress/block-editor/src/components/block-variation-transforms/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\tButton,\n\tDropdownMenu,\n\tMenuGroup,\n\tMenuItemsChoice,\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOptionIcon as ToggleGroupControlOptionIcon,\n\tVisuallyHidden,\n} from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport { chevronDown } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport BlockIcon from '../block-icon';\nimport { store as blockEditorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nfunction VariationsButtons( {\n\tclassName,\n\tonSelectVariation,\n\tselectedValue,\n\tvariations,\n} ) {\n\treturn (\n\t\t<fieldset className={ className }>\n\t\t\t<VisuallyHidden as=\"legend\">\n\t\t\t\t{ __( 'Transform to variation' ) }\n\t\t\t</VisuallyHidden>\n\t\t\t{ variations.map( ( variation ) => (\n\t\t\t\t<Button\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\tkey={ variation.name }\n\t\t\t\t\ticon={ <BlockIcon icon={ variation.icon } showColors /> }\n\t\t\t\t\tisPressed={ selectedValue === variation.name }\n\t\t\t\t\tlabel={\n\t\t\t\t\t\tselectedValue === variation.name\n\t\t\t\t\t\t\t? variation.title\n\t\t\t\t\t\t\t: sprintf(\n\t\t\t\t\t\t\t\t\t/* translators: %s: Name of the block variation */\n\t\t\t\t\t\t\t\t\t__( 'Transform to %s' ),\n\t\t\t\t\t\t\t\t\tvariation.title\n\t\t\t\t\t\t\t )\n\t\t\t\t\t}\n\t\t\t\t\tonClick={ () => onSelectVariation( variation.name ) }\n\t\t\t\t\taria-label={ variation.title }\n\t\t\t\t\tshowTooltip\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t</fieldset>\n\t);\n}\n\nfunction VariationsDropdown( {\n\tclassName,\n\tonSelectVariation,\n\tselectedValue,\n\tvariations,\n} ) {\n\tconst selectOptions = variations.map(\n\t\t( { name, title, description } ) => ( {\n\t\t\tvalue: name,\n\t\t\tlabel: title,\n\t\t\tinfo: description,\n\t\t} )\n\t);\n\n\treturn (\n\t\t<DropdownMenu\n\t\t\tclassName={ className }\n\t\t\tlabel={ __( 'Transform to variation' ) }\n\t\t\ttext={ __( 'Transform to variation' ) }\n\t\t\tpopoverProps={ {\n\t\t\t\tposition: 'bottom center',\n\t\t\t\tclassName: `${ className }__popover`,\n\t\t\t} }\n\t\t\ticon={ chevronDown }\n\t\t\ttoggleProps={ { iconPosition: 'right' } }\n\t\t>\n\t\t\t{ () => (\n\t\t\t\t<div className={ `${ className }__container` }>\n\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t<MenuItemsChoice\n\t\t\t\t\t\t\tchoices={ selectOptions }\n\t\t\t\t\t\t\tvalue={ selectedValue }\n\t\t\t\t\t\t\tonSelect={ onSelectVariation }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</MenuGroup>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</DropdownMenu>\n\t);\n}\n\nfunction VariationsToggleGroupControl( {\n\tclassName,\n\tonSelectVariation,\n\tselectedValue,\n\tvariations,\n} ) {\n\treturn (\n\t\t<div className={ className }>\n\t\t\t<ToggleGroupControl\n\t\t\t\tlabel={ __( 'Transform to variation' ) }\n\t\t\t\tvalue={ selectedValue }\n\t\t\t\thideLabelFromVision\n\t\t\t\tonChange={ onSelectVariation }\n\t\t\t\t__next40pxDefaultSize\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t>\n\t\t\t\t{ variations.map( ( variation ) => (\n\t\t\t\t\t<ToggleGroupControlOptionIcon\n\t\t\t\t\t\tkey={ variation.name }\n\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t<BlockIcon icon={ variation.icon } showColors />\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvalue={ variation.name }\n\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\tselectedValue === variation.name\n\t\t\t\t\t\t\t\t? variation.title\n\t\t\t\t\t\t\t\t: sprintf(\n\t\t\t\t\t\t\t\t\t\t/* translators: %s: Name of the block variation */\n\t\t\t\t\t\t\t\t\t\t__( 'Transform to %s' ),\n\t\t\t\t\t\t\t\t\t\tvariation.title\n\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t) ) }\n\t\t\t</ToggleGroupControl>\n\t\t</div>\n\t);\n}\n\nfunction __experimentalBlockVariationTransforms( { blockClientId } ) {\n\tconst { updateBlockAttributes } = useDispatch( blockEditorStore );\n\tconst { activeBlockVariation, variations, isContentOnly } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getActiveBlockVariation, getBlockVariations } =\n\t\t\t\tselect( blocksStore );\n\n\t\t\tconst { getBlockName, getBlockAttributes, getBlockEditingMode } =\n\t\t\t\tselect( blockEditorStore );\n\n\t\t\tconst name = blockClientId && getBlockName( blockClientId );\n\n\t\t\tconst { hasContentRoleAttribute } = unlock( select( blocksStore ) );\n\t\t\tconst isContentBlock = hasContentRoleAttribute( name );\n\n\t\t\treturn {\n\t\t\t\tactiveBlockVariation: getActiveBlockVariation(\n\t\t\t\t\tname,\n\t\t\t\t\tgetBlockAttributes( blockClientId )\n\t\t\t\t),\n\t\t\t\tvariations: name && getBlockVariations( name, 'transform' ),\n\t\t\t\tisContentOnly:\n\t\t\t\t\tgetBlockEditingMode( blockClientId ) === 'contentOnly' &&\n\t\t\t\t\t! isContentBlock,\n\t\t\t};\n\t\t},\n\t\t[ blockClientId ]\n\t);\n\n\tconst selectedValue = activeBlockVariation?.name;\n\n\t// Check if each variation has a unique icon.\n\tconst hasUniqueIcons = useMemo( () => {\n\t\tconst variationIcons = new Set();\n\t\tif ( ! variations ) {\n\t\t\treturn false;\n\t\t}\n\t\tvariations.forEach( ( variation ) => {\n\t\t\tif ( variation.icon ) {\n\t\t\t\tvariationIcons.add( variation.icon?.src || variation.icon );\n\t\t\t}\n\t\t} );\n\t\treturn variationIcons.size === variations.length;\n\t}, [ variations ] );\n\n\tconst onSelectVariation = ( variationName ) => {\n\t\tupdateBlockAttributes( blockClientId, {\n\t\t\t...variations.find( ( { name } ) => name === variationName )\n\t\t\t\t.attributes,\n\t\t} );\n\t};\n\n\tif ( ! variations?.length || isContentOnly ) {\n\t\treturn null;\n\t}\n\n\tconst baseClass = 'block-editor-block-variation-transforms';\n\n\t// Show buttons if there are more than 5 variations because the ToggleGroupControl does not wrap\n\tconst showButtons = variations.length > 5;\n\n\tconst ButtonComponent = showButtons\n\t\t? VariationsButtons\n\t\t: VariationsToggleGroupControl;\n\n\tconst Component = hasUniqueIcons ? ButtonComponent : VariationsDropdown;\n\n\treturn (\n\t\t<Component\n\t\t\tclassName={ baseClass }\n\t\t\tonSelectVariation={ onSelectVariation }\n\t\t\tselectedValue={ selectedValue }\n\t\t\tvariations={ variations }\n\t\t/>\n\t);\n}\n\nexport default __experimentalBlockVariationTransforms;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;AACxD,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SACCC,MAAM,EACNC,YAAY,EACZC,SAAS,EACTC,eAAe,EACfC,gCAAgC,IAAIC,kBAAkB,EACtDC,0CAA0C,IAAIC,4BAA4B,EAC1EC,cAAc,QACR,uBAAuB;AAC9B,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,WAAW,QAAQ,kBAAkB;;AAE9C;AACA;AACA;AACA,OAAOC,SAAS,MAAM,eAAe;AACrC,SAASjB,KAAK,IAAIkB,gBAAgB,QAAQ,aAAa;AACvD,SAASC,MAAM,QAAQ,mBAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAE3C,SAASC,iBAAiBA,CAAE;EAC3BC,SAAS;EACTC,iBAAiB;EACjBC,aAAa;EACbC;AACD,CAAC,EAAG;EACH,oBACCL,KAAA;IAAUE,SAAS,EAAGA,SAAW;IAAAI,QAAA,gBAChCR,I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ACG,IAAI,EAAE0C,GAAG,IAAI7C,SAAS,CAACG,IAAK,CAAC;MAC5D;IACD,CAAE,CAAC;IACH,OAAOsC,cAAc,CAACvC,IAAI,KAAKN,UAAU,CAACkD,MAAM;EACjD,CAAC,EAAE,CAAElD,UAAU,CAAG,CAAC;EAEnB,MAAMF,iBAAiB,GAAKqD,aAAa,IAAM;IAC9ClB,qBAAqB,CAAED,aAAa,EAAE;MACrC,GAAGhC,UAAU,CAACoD,IAAI,CAAE,CAAE;QAAE1C;MAAK,CAAC,KAAMA,IAAI,KAAKyC,aAAc,CAAC,CAC1DE;IACH,CAAE,CAAC;EACJ,CAAC;EAED,IAAK,CAAErD,UAAU,EAAEkD,MAAM,IAAIf,aAAa,EAAG;IAC5C,OAAO,IAAI;EACZ;EAEA,MAAMmB,SAAS,GAAG,yCAAyC;;EAE3D;EACA,MAAMC,WAAW,GAAGvD,UAAU,CAACkD,MAAM,GAAG,CAAC;EAEzC,MAAMM,eAAe,GAAGD,WAAW,GAChC3D,iBAAiB,GACjB+B,4BAA4B;EAE/B,MAAM8B,SAAS,GAAGb,cAAc,GAAGY,eAAe,GAAGzC,kBAAkB;EAEvE,oBACCtB,IAAA,CAACgE,SAAS;IACT5D,SAAS,EAAGyD,SAAW;IACvBxD,iBAAiB,EAAGA,iBAAmB;IACvCC,aAAa,EAAGA,aAAe;IAC/BC,UAAU,EAAGA;EAAY,CACzB,CAAC;AAEJ;AAEA,eAAe+B,sCAAsC","ignoreList":[]}
1
+ {"version":3,"names":["store","blocksStore","__","sprintf","Button","DropdownMenu","MenuGroup","MenuItemsChoice","__experimentalToggleGroupControl","ToggleGroupControl","__experimentalToggleGroupControlOptionIcon","ToggleGroupControlOptionIcon","VisuallyHidden","useSelect","useDispatch","useMemo","chevronDown","BlockIcon","blockEditorStore","unlock","jsx","_jsx","jsxs","_jsxs","VariationsButtons","className","onSelectVariation","selectedValue","variations","children","as","map","variation","__next40pxDefaultSize","size","icon","showColors","isPressed","name","label","title","onClick","showTooltip","VariationsDropdown","selectOptions","description","value","info","text","popoverProps","position","toggleProps","iconPosition","choices","onSelect","VariationsToggleGroupControl","hideLabelFromVision","onChange","__nextHasNoMarginBottom","__experimentalBlockVariationTransforms","blockClientId","updateBlockAttributes","activeBlockVariation","isContentOnly","select","getActiveBlockVariation","getBlockVariations","getBlockName","getBlockAttributes","getBlockEditingMode","hasContentRoleAttribute","isContentBlock","hasUniqueIcons","variationIcons","Set","forEach","add","src","length","variationName","find","attributes","baseClass","showButtons","ButtonComponent","Component"],"sources":["@wordpress/block-editor/src/components/block-variation-transforms/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\tButton,\n\tDropdownMenu,\n\tMenuGroup,\n\tMenuItemsChoice,\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOptionIcon as ToggleGroupControlOptionIcon,\n\tVisuallyHidden,\n} from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport { chevronDown } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport BlockIcon from '../block-icon';\nimport { store as blockEditorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nfunction VariationsButtons( {\n\tclassName,\n\tonSelectVariation,\n\tselectedValue,\n\tvariations,\n} ) {\n\treturn (\n\t\t<fieldset className={ className }>\n\t\t\t<VisuallyHidden as=\"legend\">\n\t\t\t\t{ __( 'Transform to variation' ) }\n\t\t\t</VisuallyHidden>\n\t\t\t{ variations.map( ( variation ) => (\n\t\t\t\t<Button\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\tkey={ variation.name }\n\t\t\t\t\ticon={ <BlockIcon icon={ variation.icon } showColors /> }\n\t\t\t\t\tisPressed={ selectedValue === variation.name }\n\t\t\t\t\tlabel={\n\t\t\t\t\t\tselectedValue === variation.name\n\t\t\t\t\t\t\t? variation.title\n\t\t\t\t\t\t\t: sprintf(\n\t\t\t\t\t\t\t\t\t/* translators: %s: Name of the block variation */\n\t\t\t\t\t\t\t\t\t__( 'Transform to %s' ),\n\t\t\t\t\t\t\t\t\tvariation.title\n\t\t\t\t\t\t\t )\n\t\t\t\t\t}\n\t\t\t\t\tonClick={ () => onSelectVariation( variation.name ) }\n\t\t\t\t\taria-label={ variation.title }\n\t\t\t\t\tshowTooltip\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t</fieldset>\n\t);\n}\n\nfunction VariationsDropdown( {\n\tclassName,\n\tonSelectVariation,\n\tselectedValue,\n\tvariations,\n} ) {\n\tconst selectOptions = variations.map(\n\t\t( { name, title, description } ) => ( {\n\t\t\tvalue: name,\n\t\t\tlabel: title,\n\t\t\tinfo: description,\n\t\t} )\n\t);\n\n\treturn (\n\t\t<DropdownMenu\n\t\t\tclassName={ className }\n\t\t\tlabel={ __( 'Transform to variation' ) }\n\t\t\ttext={ __( 'Transform to variation' ) }\n\t\t\tpopoverProps={ {\n\t\t\t\tposition: 'bottom center',\n\t\t\t\tclassName: `${ className }__popover`,\n\t\t\t} }\n\t\t\ticon={ chevronDown }\n\t\t\ttoggleProps={ { iconPosition: 'right' } }\n\t\t>\n\t\t\t{ () => (\n\t\t\t\t<div className={ `${ className }__container` }>\n\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t<MenuItemsChoice\n\t\t\t\t\t\t\tchoices={ selectOptions }\n\t\t\t\t\t\t\tvalue={ selectedValue }\n\t\t\t\t\t\t\tonSelect={ onSelectVariation }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</MenuGroup>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</DropdownMenu>\n\t);\n}\n\nfunction VariationsToggleGroupControl( {\n\tclassName,\n\tonSelectVariation,\n\tselectedValue,\n\tvariations,\n} ) {\n\treturn (\n\t\t<div className={ className }>\n\t\t\t<ToggleGroupControl\n\t\t\t\tlabel={ __( 'Transform to variation' ) }\n\t\t\t\tvalue={ selectedValue }\n\t\t\t\thideLabelFromVision\n\t\t\t\tonChange={ onSelectVariation }\n\t\t\t\t__next40pxDefaultSize\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t>\n\t\t\t\t{ variations.map( ( variation ) => (\n\t\t\t\t\t<ToggleGroupControlOptionIcon\n\t\t\t\t\t\tkey={ variation.name }\n\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t<BlockIcon icon={ variation.icon } showColors />\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvalue={ variation.name }\n\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\tselectedValue === variation.name\n\t\t\t\t\t\t\t\t? variation.title\n\t\t\t\t\t\t\t\t: sprintf(\n\t\t\t\t\t\t\t\t\t\t/* translators: %s: Name of the block variation */\n\t\t\t\t\t\t\t\t\t\t__( 'Transform to %s' ),\n\t\t\t\t\t\t\t\t\t\tvariation.title\n\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t) ) }\n\t\t\t</ToggleGroupControl>\n\t\t</div>\n\t);\n}\n\nfunction __experimentalBlockVariationTransforms( { blockClientId } ) {\n\tconst { updateBlockAttributes } = useDispatch( blockEditorStore );\n\tconst { activeBlockVariation, variations, isContentOnly } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getActiveBlockVariation, getBlockVariations } =\n\t\t\t\tselect( blocksStore );\n\n\t\t\tconst { getBlockName, getBlockAttributes, getBlockEditingMode } =\n\t\t\t\tselect( blockEditorStore );\n\n\t\t\tconst name = blockClientId && getBlockName( blockClientId );\n\n\t\t\tconst { hasContentRoleAttribute } = unlock( select( blocksStore ) );\n\t\t\tconst isContentBlock = hasContentRoleAttribute( name );\n\n\t\t\treturn {\n\t\t\t\tactiveBlockVariation: getActiveBlockVariation(\n\t\t\t\t\tname,\n\t\t\t\t\tgetBlockAttributes( blockClientId )\n\t\t\t\t),\n\t\t\t\tvariations: name && getBlockVariations( name, 'transform' ),\n\t\t\t\tisContentOnly:\n\t\t\t\t\tgetBlockEditingMode( blockClientId ) === 'contentOnly' &&\n\t\t\t\t\t! isContentBlock,\n\t\t\t};\n\t\t},\n\t\t[ blockClientId ]\n\t);\n\n\tconst selectedValue = activeBlockVariation?.name;\n\n\t// Check if each variation has a unique icon.\n\tconst hasUniqueIcons = useMemo( () => {\n\t\tconst variationIcons = new Set();\n\t\tif ( ! variations ) {\n\t\t\treturn false;\n\t\t}\n\t\tvariations.forEach( ( variation ) => {\n\t\t\tif ( variation.icon ) {\n\t\t\t\tvariationIcons.add( variation.icon?.src || variation.icon );\n\t\t\t}\n\t\t} );\n\t\treturn variationIcons.size === variations.length;\n\t}, [ variations ] );\n\n\tconst onSelectVariation = ( variationName ) => {\n\t\tupdateBlockAttributes( blockClientId, {\n\t\t\t...variations.find( ( { name } ) => name === variationName )\n\t\t\t\t.attributes,\n\t\t} );\n\t};\n\n\tif ( ! variations?.length || isContentOnly ) {\n\t\treturn null;\n\t}\n\n\tconst baseClass = 'block-editor-block-variation-transforms';\n\n\t// Show buttons if there are more than 5 variations because the ToggleGroupControl does not wrap\n\tconst showButtons = variations.length > 5;\n\n\tconst ButtonComponent = showButtons\n\t\t? VariationsButtons\n\t\t: VariationsToggleGroupControl;\n\n\tconst Component = hasUniqueIcons ? ButtonComponent : VariationsDropdown;\n\n\treturn (\n\t\t<Component\n\t\t\tclassName={ baseClass }\n\t\t\tonSelectVariation={ onSelectVariation }\n\t\t\tselectedValue={ selectedValue }\n\t\t\tvariations={ variations }\n\t\t/>\n\t);\n}\n\nexport default __experimentalBlockVariationTransforms;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;AACxD,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SACCC,MAAM,EACNC,YAAY,EACZC,SAAS,EACTC,eAAe,EACfC,gCAAgC,IAAIC,kBAAkB,EACtDC,0CAA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AEvE,oBACCtB,IAAA,CAACgE,SAAS;IACT5D,SAAS,EAAGyD,SAAW;IACvBxD,iBAAiB,EAAGA,iBAAmB;IACvCC,aAAa,EAAGA,aAAe;IAC/BC,UAAU,EAAGA;EAAY,CACzB,CAAC;AAEJ;AAEA,eAAe+B,sCAAsC","ignoreList":[]}
@@ -13,9 +13,7 @@ import InputControls from './input-controls';
13
13
  import LinkedButton from './linked-button';
14
14
  import { useSettings } from '../use-settings';
15
15
  import { getAllValue, getAllUnit, hasDefinedValues, hasMixedValues } from './utils';
16
- import { jsx as _jsx } from "react/jsx-runtime";
17
- import { Fragment as _Fragment } from "react/jsx-runtime";
18
- import { jsxs as _jsxs } from "react/jsx-runtime";
16
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
19
17
  const DEFAULT_VALUES = {
20
18
  topLeft: undefined,
21
19
  topRight: undefined,
@@ -1 +1 @@
1
- {"version":3,"names":["BaseControl","RangeControl","__experimentalParseQuantityAndUnitFromRawValue","parseQuantityAndUnitFromRawValue","__experimentalUseCustomUnits","useCustomUnits","useState","__","AllInputControl","InputControls","LinkedButton","useSettings","getAllValue","getAllUnit","hasDefinedValues","hasMixedValues","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","DEFAULT_VALUES","topLeft","undefined","topRight","bottomLeft","bottomRight","MIN_BORDER_RADIUS_VALUE","MAX_BORDER_RADIUS_VALUES","px","em","rem","BorderRadiusControl","onChange","values","isLinked","setIsLinked","selectedUnits","setSelectedUnits","flat","availableUnits","units","unit","unitConfig","find","item","value","step","allValue","toggleLinked","handleSliderChange","next","className","children","VisualLabel","as","min","__next40pxDefaultSize","label","hideLabelFromVision","max","initialPosition","withInputField","__nextHasNoMarginBottom","onClick"],"sources":["@wordpress/block-editor/src/components/border-radius-control/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tBaseControl,\n\tRangeControl,\n\t__experimentalParseQuantityAndUnitFromRawValue as parseQuantityAndUnitFromRawValue,\n\t__experimentalUseCustomUnits as useCustomUnits,\n} from '@wordpress/components';\nimport { useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport AllInputControl from './all-input-control';\nimport InputControls from './input-controls';\nimport LinkedButton from './linked-button';\nimport { useSettings } from '../use-settings';\nimport {\n\tgetAllValue,\n\tgetAllUnit,\n\thasDefinedValues,\n\thasMixedValues,\n} from './utils';\n\nconst DEFAULT_VALUES = {\n\ttopLeft: undefined,\n\ttopRight: undefined,\n\tbottomLeft: undefined,\n\tbottomRight: undefined,\n};\nconst MIN_BORDER_RADIUS_VALUE = 0;\nconst MAX_BORDER_RADIUS_VALUES = {\n\tpx: 100,\n\tem: 20,\n\trem: 20,\n};\n\n/**\n * Control to display border radius options.\n *\n * @param {Object} props Component props.\n * @param {Function} props.onChange Callback to handle onChange.\n * @param {Object} props.values Border radius values.\n *\n * @return {Element} Custom border radius control.\n */\nexport default function BorderRadiusControl( { onChange, values } ) {\n\tconst [ isLinked, setIsLinked ] = useState(\n\t\t! hasDefinedValues( values ) || ! hasMixedValues( values )\n\t);\n\n\t// Tracking selected units via internal state allows filtering of CSS unit\n\t// only values from being saved while maintaining preexisting unit selection\n\t// behaviour. Filtering CSS unit only values prevents invalid style values.\n\tconst [ selectedUnits, setSelectedUnits ] = useState( {\n\t\tflat:\n\t\t\ttypeof values === 'string'\n\t\t\t\t? parseQuantityAndUnitFromRawValue( values )[ 1 ]\n\t\t\t\t: undefined,\n\t\ttopLeft: parseQuantityAndUnitFromRawValue( values?.topLeft )[ 1 ],\n\t\ttopRight: parseQuantityAndUnitFromRawValue( values?.topRight )[ 1 ],\n\t\tbottomLeft: parseQuantityAndUnitFromRawValue( values?.bottomLeft )[ 1 ],\n\t\tbottomRight: parseQuantityAndUnitFromRawValue(\n\t\t\tvalues?.bottomRight\n\t\t)[ 1 ],\n\t} );\n\n\tconst [ availableUnits ] = useSettings( 'spacing.units' );\n\tconst units = useCustomUnits( {\n\t\tavailableUnits: availableUnits || [ 'px', 'em', 'rem' ],\n\t} );\n\n\tconst unit = getAllUnit( selectedUnits );\n\tconst unitConfig = units && units.find( ( item ) => item.value === unit );\n\tconst step = unitConfig?.step || 1;\n\n\tconst [ allValue ] = parseQuantityAndUnitFromRawValue(\n\t\tgetAllValue( values )\n\t);\n\n\tconst toggleLinked = () => setIsLinked( ! isLinked );\n\n\tconst handleSliderChange = ( next ) => {\n\t\tonChange( next !== undefined ? `${ next }${ unit }` : undefined );\n\t};\n\n\treturn (\n\t\t<fieldset className=\"components-border-radius-control\">\n\t\t\t<BaseControl.VisualLabel as=\"legend\">\n\t\t\t\t{ __( 'Radius' ) }\n\t\t\t</BaseControl.VisualLabel>\n\t\t\t<div className=\"components-border-radius-control__wrapper\">\n\t\t\t\t{ isLinked ? (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<AllInputControl\n\t\t\t\t\t\t\tclassName=\"components-border-radius-control__unit-control\"\n\t\t\t\t\t\t\tvalues={ values }\n\t\t\t\t\t\t\tmin={ MIN_BORDER_RADIUS_VALUE }\n\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t\tselectedUnits={ selectedUnits }\n\t\t\t\t\t\t\tsetSelectedUnits={ setSelectedUnits }\n\t\t\t\t\t\t\tunits={ units }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<RangeControl\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tlabel={ __( 'Border radius' ) }\n\t\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t\tclassName=\"components-border-radius-control__range-control\"\n\t\t\t\t\t\t\tvalue={ allValue ?? '' }\n\t\t\t\t\t\t\tmin={ MIN_BORDER_RADIUS_VALUE }\n\t\t\t\t\t\t\tmax={ MAX_BORDER_RADIUS_VALUES[ unit ] }\n\t\t\t\t\t\t\tinitialPosition={ 0 }\n\t\t\t\t\t\t\twithInputField={ false }\n\t\t\t\t\t\t\tonChange={ handleSliderChange }\n\t\t\t\t\t\t\tstep={ step }\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t/>\n\t\t\t\t\t</>\n\t\t\t\t) : (\n\t\t\t\t\t<InputControls\n\t\t\t\t\t\tmin={ MIN_BORDER_RADIUS_VALUE }\n\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\tselectedUnits={ selectedUnits }\n\t\t\t\t\t\tsetSelectedUnits={ setSelectedUnits }\n\t\t\t\t\t\tvalues={ values || DEFAULT_VALUES }\n\t\t\t\t\t\tunits={ units }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t<LinkedButton onClick={ toggleLinked } isLinked={ isLinked } />\n\t\t\t</div>\n\t\t</fieldset>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SACCA,WAAW,EACXC,YAAY,EACZC,8CAA8C,IAAIC,gCAAgC,EAClFC,4BAA4B,IAAIC,cAAc,QACxC,uBAAuB;AAC9B,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,EAAE,QAAQ,iBAAiB;;AAEpC;AACA;AACA;AACA,OAAOC,eAAe,MAAM,qBAAqB;AACjD,OAAOC,aAAa,MAAM,kBAAkB;AAC5C,OAAOC,YAAY,MAAM,iBAAiB;AAC1C,SAASC,WAAW,QAAQ,iBAAiB;AAC7C,SACCC,WAAW,EACXC,UAAU,EACVC,gBAAgB,EAChBC,cAAc,QACR,SAAS;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,QAAA,IAAAC,SAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAEjB,MAAMC,cAAc,GAAG;EACtBC,OAAO,EAAEC,SAAS;EAClBC,QAAQ,EAAED,SAAS;EACnBE,UAAU,EAAEF,SAAS;EACrBG,WAAW,EAAEH;AACd,CAAC;AACD,MAAMI,uBAAuB,GAAG,CAAC;AACjC,MAAMC,wBAAwB,GAAG;EAChCC,EAAE,EAAE,GAAG;EACPC,EAAE,EAAE,EAAE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,EAAGiB,kBAAoB;UAC/BH,IAAI,EAAGA,IAAM;UACbgB,uBAAuB;QAAA,CACvB,CAAC;MAAA,CACD,CAAC,gBAEH/C,IAAA,CAACR,aAAa;QACbgD,GAAG,EAAG7B,uBAAyB;QAC/BM,QAAQ,EAAGA,QAAU;QACrBI,aAAa,EAAGA,aAAe;QAC/BC,gBAAgB,EAAGA,gBAAkB;QACrCJ,MAAM,EAAGA,MAAM,IAAIb,cAAgB;QACnCoB,KAAK,EAAGA;MAAO,CACf,CACD,eACDzB,IAAA,CAACP,YAAY;QAACuD,OAAO,EAAGf,YAAc;QAACd,QAAQ,EAAGA;MAAU,CAAE,CAAC;IAAA,CAC3D,CAAC;EAAA,CACG,CAAC;AAEb","ignoreList":[]}
1
+ {"version":3,"names":["BaseControl","RangeControl","__experimentalParseQuantityAndUnitFromRawValue","parseQuantityAndUnitFromRawValue","__experimentalUseCustomUnits","useCustomUnits","useState","__","AllInputControl","InputControls","LinkedButton","useSettings","getAllValue","getAllUnit","hasDefinedValues","hasMixedValues","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","DEFAULT_VALUES","topLeft","undefined","topRight","bottomLeft","bottomRight","MIN_BORDER_RADIUS_VALUE","MAX_BORDER_RADIUS_VALUES","px","em","rem","BorderRadiusControl","onChange","values","isLinked","setIsLinked","selectedUnits","setSelectedUnits","flat","availableUnits","units","unit","unitConfig","find","item","value","step","allValue","toggleLinked","handleSliderChange","next","className","children","VisualLabel","as","min","__next40pxDefaultSize","label","hideLabelFromVision","max","initialPosition","withInputField","__nextHasNoMarginBottom","onClick"],"sources":["@wordpress/block-editor/src/components/border-radius-control/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tBaseControl,\n\tRangeControl,\n\t__experimentalParseQuantityAndUnitFromRawValue as parseQuantityAndUnitFromRawValue,\n\t__experimentalUseCustomUnits as useCustomUnits,\n} from '@wordpress/components';\nimport { useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport AllInputControl from './all-input-control';\nimport InputControls from './input-controls';\nimport LinkedButton from './linked-button';\nimport { useSettings } from '../use-settings';\nimport {\n\tgetAllValue,\n\tgetAllUnit,\n\thasDefinedValues,\n\thasMixedValues,\n} from './utils';\n\nconst DEFAULT_VALUES = {\n\ttopLeft: undefined,\n\ttopRight: undefined,\n\tbottomLeft: undefined,\n\tbottomRight: undefined,\n};\nconst MIN_BORDER_RADIUS_VALUE = 0;\nconst MAX_BORDER_RADIUS_VALUES = {\n\tpx: 100,\n\tem: 20,\n\trem: 20,\n};\n\n/**\n * Control to display border radius options.\n *\n * @param {Object} props Component props.\n * @param {Function} props.onChange Callback to handle onChange.\n * @param {Object} props.values Border radius values.\n *\n * @return {Element} Custom border radius control.\n */\nexport default function BorderRadiusControl( { onChange, values } ) {\n\tconst [ isLinked, setIsLinked ] = useState(\n\t\t! hasDefinedValues( values ) || ! hasMixedValues( values )\n\t);\n\n\t// Tracking selected units via internal state allows filtering of CSS unit\n\t// only values from being saved while maintaining preexisting unit selection\n\t// behaviour. Filtering CSS unit only values prevents invalid style values.\n\tconst [ selectedUnits, setSelectedUnits ] = useState( {\n\t\tflat:\n\t\t\ttypeof values === 'string'\n\t\t\t\t? parseQuantityAndUnitFromRawValue( values )[ 1 ]\n\t\t\t\t: undefined,\n\t\ttopLeft: parseQuantityAndUnitFromRawValue( values?.topLeft )[ 1 ],\n\t\ttopRight: parseQuantityAndUnitFromRawValue( values?.topRight )[ 1 ],\n\t\tbottomLeft: parseQuantityAndUnitFromRawValue( values?.bottomLeft )[ 1 ],\n\t\tbottomRight: parseQuantityAndUnitFromRawValue(\n\t\t\tvalues?.bottomRight\n\t\t)[ 1 ],\n\t} );\n\n\tconst [ availableUnits ] = useSettings( 'spacing.units' );\n\tconst units = useCustomUnits( {\n\t\tavailableUnits: availableUnits || [ 'px', 'em', 'rem' ],\n\t} );\n\n\tconst unit = getAllUnit( selectedUnits );\n\tconst unitConfig = units && units.find( ( item ) => item.value === unit );\n\tconst step = unitConfig?.step || 1;\n\n\tconst [ allValue ] = parseQuantityAndUnitFromRawValue(\n\t\tgetAllValue( values )\n\t);\n\n\tconst toggleLinked = () => setIsLinked( ! isLinked );\n\n\tconst handleSliderChange = ( next ) => {\n\t\tonChange( next !== undefined ? `${ next }${ unit }` : undefined );\n\t};\n\n\treturn (\n\t\t<fieldset className=\"components-border-radius-control\">\n\t\t\t<BaseControl.VisualLabel as=\"legend\">\n\t\t\t\t{ __( 'Radius' ) }\n\t\t\t</BaseControl.VisualLabel>\n\t\t\t<div className=\"components-border-radius-control__wrapper\">\n\t\t\t\t{ isLinked ? (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<AllInputControl\n\t\t\t\t\t\t\tclassName=\"components-border-radius-control__unit-control\"\n\t\t\t\t\t\t\tvalues={ values }\n\t\t\t\t\t\t\tmin={ MIN_BORDER_RADIUS_VALUE }\n\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t\tselectedUnits={ selectedUnits }\n\t\t\t\t\t\t\tsetSelectedUnits={ setSelectedUnits }\n\t\t\t\t\t\t\tunits={ units }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<RangeControl\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tlabel={ __( 'Border radius' ) }\n\t\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t\tclassName=\"components-border-radius-control__range-control\"\n\t\t\t\t\t\t\tvalue={ allValue ?? '' }\n\t\t\t\t\t\t\tmin={ MIN_BORDER_RADIUS_VALUE }\n\t\t\t\t\t\t\tmax={ MAX_BORDER_RADIUS_VALUES[ unit ] }\n\t\t\t\t\t\t\tinitialPosition={ 0 }\n\t\t\t\t\t\t\twithInputField={ false }\n\t\t\t\t\t\t\tonChange={ handleSliderChange }\n\t\t\t\t\t\t\tstep={ step }\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t/>\n\t\t\t\t\t</>\n\t\t\t\t) : (\n\t\t\t\t\t<InputControls\n\t\t\t\t\t\tmin={ MIN_BORDER_RADIUS_VALUE }\n\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\tselectedUnits={ selectedUnits }\n\t\t\t\t\t\tsetSelectedUnits={ setSelectedUnits }\n\t\t\t\t\t\tvalues={ values || DEFAULT_VALUES }\n\t\t\t\t\t\tunits={ units }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t<LinkedButton onClick={ toggleLinked } isLinked={ isLinked } />\n\t\t\t</div>\n\t\t</fieldset>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SACCA,WAAW,EACXC,YAAY,EACZC,8CAA8C,IAAIC,gCAAgC,EAClFC,4BAA4B,IAAIC,cAAc,QACxC,uBAAuB;AAC9B,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,EAAE,QAAQ,iBAAiB;;AAEpC;AACA;AACA;AACA,OAAOC,eAAe,MAAM,qBAAqB;AACjD,OAAOC,aAAa,MAAM,kBAAkB;AAC5C,OAAOC,YAAY,MAAM,iBAAiB;AAC1C,SAASC,WAAW,QAAQ,iBAAiB;AAC7C,SACCC,WAAW,EACXC,UAAU,EACVC,gBAAgB,EAChBC,cAAc,QACR,SAAS;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AAEjB,MAAMC,cAAc,GAAG;EACtBC,OAAO,EAAEC,SAAS;EAClBC,QAAQ,EAAED,SAAS;EACnBE,UAAU,EAAEF,SAAS;EACrBG,WAAW,EAAEH;AACd,CAAC;AACD,MAAMI,uBAAuB,GAAG,CAAC;AACjC,MAAMC,wBAAwB,GAAG;EAChCC,EAAE,EAAE,GAAG;EACPC,EAAE,EAAE,EAAE;EACNC,GAAG,EAAE;AACN,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,mBAAmBA,CAAE;EAAEC,QAA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,aAAa;QACbgD,GAAG,EAAG7B,uBAAyB;QAC/BM,QAAQ,EAAGA,QAAU;QACrBI,aAAa,EAAGA,aAAe;QAC/BC,gBAAgB,EAAGA,gBAAkB;QACrCJ,MAAM,EAAGA,MAAM,IAAIb,cAAgB;QACnCoB,KAAK,EAAGA;MAAO,CACf,CACD,eACDzB,IAAA,CAACP,YAAY;QAACuD,OAAO,EAAGf,YAAc;QAACd,QAAQ,EAAGA;MAAU,CAAE,CAAC;IAAA,CAC3D,CAAC;EAAA,CACG,CAAC;AAEb","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["__experimentalParseQuantityAndUnitFromRawValue","parseQuantityAndUnitFromRawValue","mode","inputArray","arr","sort","a","b","filter","v","length","shift","getAllUnit","selectedUnits","flat","cornerUnits","Object","values","Boolean","getAllValue","parsedQuantitiesAndUnits","map","value","allValues","_value$","allUnits","every","unit","allValue","undefined","hasMixedValues","isMixed","isNaN","parseFloat","hasDefinedValues","filteredValues"],"sources":["@wordpress/block-editor/src/components/border-radius-control/utils.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalParseQuantityAndUnitFromRawValue as parseQuantityAndUnitFromRawValue } from '@wordpress/components';\n\n/**\n * Gets the (non-undefined) item with the highest occurrence within an array\n * Based in part on: https://stackoverflow.com/a/20762713\n *\n * Undefined values are always sorted to the end by `sort`, so this function\n * returns the first element, to always prioritize real values over undefined\n * values.\n *\n * See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#description\n *\n * @param {Array<any>} inputArray Array of items to check.\n * @return {any} The item with the most occurrences.\n */\nexport function mode( inputArray ) {\n\tconst arr = [ ...inputArray ];\n\treturn arr\n\t\t.sort(\n\t\t\t( a, b ) =>\n\t\t\t\tinputArray.filter( ( v ) => v === b ).length -\n\t\t\t\tinputArray.filter( ( v ) => v === a ).length\n\t\t)\n\t\t.shift();\n}\n\n/**\n * Returns the most common CSS unit from the current CSS unit selections.\n *\n * - If a single flat border radius is set, its unit will be used\n * - If individual corner selections, the most common of those will be used\n * - Failing any unit selections a default of 'px' is returned.\n *\n * @param {Object} selectedUnits Unit selections for flat radius & each corner.\n * @return {string} Most common CSS unit from current selections. Default: `px`.\n */\nexport function getAllUnit( selectedUnits = {} ) {\n\tconst { flat, ...cornerUnits } = selectedUnits;\n\treturn (\n\t\tflat || mode( Object.values( cornerUnits ).filter( Boolean ) ) || 'px'\n\t);\n}\n\n/**\n * Gets the 'all' input value and unit from values data.\n *\n * @param {Object|string} values Radius values.\n * @return {string} A value + unit for the 'all' input.\n */\nexport function getAllValue( values = {} ) {\n\t/**\n\t * Border radius support was originally a single pixel value.\n\t *\n\t * To maintain backwards compatibility treat this case as the all value.\n\t */\n\tif ( typeof values === 'string' ) {\n\t\treturn values;\n\t}\n\n\tconst parsedQuantitiesAndUnits = Object.values( values ).map( ( value ) =>\n\t\tparseQuantityAndUnitFromRawValue( value )\n\t);\n\n\tconst allValues = parsedQuantitiesAndUnits.map(\n\t\t( value ) => value[ 0 ] ?? ''\n\t);\n\tconst allUnits = parsedQuantitiesAndUnits.map( ( value ) => value[ 1 ] );\n\n\tconst value = allValues.every( ( v ) => v === allValues[ 0 ] )\n\t\t? allValues[ 0 ]\n\t\t: '';\n\tconst unit = mode( allUnits );\n\n\tconst allValue = value === 0 || value ? `${ value }${ unit }` : undefined;\n\n\treturn allValue;\n}\n\n/**\n * Checks to determine if values are mixed.\n *\n * @param {Object} values Radius values.\n * @return {boolean} Whether values are mixed.\n */\nexport function hasMixedValues( values = {} ) {\n\tconst allValue = getAllValue( values );\n\tconst isMixed =\n\t\ttypeof values === 'string' ? false : isNaN( parseFloat( allValue ) );\n\n\treturn isMixed;\n}\n\n/**\n * Checks to determine if values are defined.\n *\n * @param {Object} values Radius values.\n * @return {boolean} Whether values are mixed.\n */\nexport function hasDefinedValues( values ) {\n\tif ( ! values ) {\n\t\treturn false;\n\t}\n\n\t// A string value represents a shorthand value.\n\tif ( typeof values === 'string' ) {\n\t\treturn true;\n\t}\n\n\t// An object represents longhand border radius values, if any are set\n\t// flag values as being defined.\n\tconst filteredValues = Object.values( values ).filter( ( value ) => {\n\t\treturn !! value || value === 0;\n\t} );\n\n\treturn !! filteredValues.length;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,8CAA8C,IAAIC,gCAAgC,QAAQ,uBAAuB;;AAE1H;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,IAAIA,CAAEC,UAAU,EAAG;EAClC,MAAMC,GAAG,GAAG,CAAE,GAAGD,UAAU,CAAE;EAC7B,OAAOC,GAAG,CACRC,IAAI,CACJ,CAAEC,CAAC,EAAEC,CAAC,KACLJ,UAAU,CAACK,MAAM,CAAIC,CAAC,IAAMA,CAAC,KAAKF,CAAE,CAAC,CAACG,MAAM,GAC5CP,UAAU,CAACK,MAAM,CAAIC,CAAC,IAAMA,CAAC,KAAKH,CAAE,CAAC,CAACI,MACxC,CAAC,CACAC,KAAK,CAAC,CAAC;AACV;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,UAAUA,CAAEC,aAAa,GAAG,CAAC,CAAC,EAAG;EAChD,MAAM;IAAEC,IAAI;IAAE,GAAGC;EAAY,CAAC,GAAGF,aAAa;EAC9C,OACCC,IAAI,IAAIZ,IAAI,CAAEc,MAAM,CAACC,MAAM,CAAEF,WAAY,CAAC,CAACP,MAAM,CAAEU,OAAQ,CAAE,CAAC,IAAI,IAAI;AAExE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,WAAWA,CAAEF,MAAM,GAAG,CAAC,CAAC,EAAG;EAC1C;AACD;AACA;AACA;AACA;EACC,IAAK,OAAOA,MAAM,KAAK,QAAQ,EAAG;IACjC,OAAOA,MAAM;EACd;EAEA,MAAMG,wBAAwB,GAAGJ,MAAM,CAACC,MAAM,CAAEA,MAAO,CAAC,CAACI,GAAG,C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AM,CAAEA,MAAO,CAAC,CAACT,MAAM,CAAIc,KAAK,IAAM;IACnE,OAAO,CAAC,CAAEA,KAAK,IAAIA,KAAK,KAAK,CAAC;EAC/B,CAAE,CAAC;EAEH,OAAO,CAAC,CAAEa,cAAc,CAACzB,MAAM;AAChC","ignoreList":[]}
1
+ {"version":3,"names":["__experimentalParseQuantityAndUnitFromRawValue","parseQuantityAndUnitFromRawValue","mode","inputArray","arr","sort","a","b","filter","v","length","shift","getAllUnit","selectedUnits","flat","cornerUnits","Object","values","Boolean","getAllValue","parsedQuantitiesAndUnits","map","value","allValues","_value$","allUnits","every","unit","allValue","undefined","hasMixedValues","isMixed","isNaN","parseFloat","hasDefinedValues","filteredValues"],"sources":["@wordpress/block-editor/src/components/border-radius-control/utils.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalParseQuantityAndUnitFromRawValue as parseQuantityAndUnitFromRawValue } from '@wordpress/components';\n\n/**\n * Gets the (non-undefined) item with the highest occurrence within an array\n * Based in part on: https://stackoverflow.com/a/20762713\n *\n * Undefined values are always sorted to the end by `sort`, so this function\n * returns the first element, to always prioritize real values over undefined\n * values.\n *\n * See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#description\n *\n * @param {Array<any>} inputArray Array of items to check.\n * @return {any} The item with the most occurrences.\n */\nexport function mode( inputArray ) {\n\tconst arr = [ ...inputArray ];\n\treturn arr\n\t\t.sort(\n\t\t\t( a, b ) =>\n\t\t\t\tinputArray.filter( ( v ) => v === b ).length -\n\t\t\t\tinputArray.filter( ( v ) => v === a ).length\n\t\t)\n\t\t.shift();\n}\n\n/**\n * Returns the most common CSS unit from the current CSS unit selections.\n *\n * - If a single flat border radius is set, its unit will be used\n * - If individual corner selections, the most common of those will be used\n * - Failing any unit selections a default of 'px' is returned.\n *\n * @param {Object} selectedUnits Unit selections for flat radius & each corner.\n * @return {string} Most common CSS unit from current selections. Default: `px`.\n */\nexport function getAllUnit( selectedUnits = {} ) {\n\tconst { flat, ...cornerUnits } = selectedUnits;\n\treturn (\n\t\tflat || mode( Object.values( cornerUnits ).filter( Boolean ) ) || 'px'\n\t);\n}\n\n/**\n * Gets the 'all' input value and unit from values data.\n *\n * @param {Object|string} values Radius values.\n * @return {string} A value + unit for the 'all' input.\n */\nexport function getAllValue( values = {} ) {\n\t/**\n\t * Border radius support was originally a single pixel value.\n\t *\n\t * To maintain backwards compatibility treat this case as the all value.\n\t */\n\tif ( typeof values === 'string' ) {\n\t\treturn values;\n\t}\n\n\tconst parsedQuantitiesAndUnits = Object.values( values ).map( ( value ) =>\n\t\tparseQuantityAndUnitFromRawValue( value )\n\t);\n\n\tconst allValues = parsedQuantitiesAndUnits.map(\n\t\t( value ) => value[ 0 ] ?? ''\n\t);\n\tconst allUnits = parsedQuantitiesAndUnits.map( ( value ) => value[ 1 ] );\n\n\tconst value = allValues.every( ( v ) => v === allValues[ 0 ] )\n\t\t? allValues[ 0 ]\n\t\t: '';\n\tconst unit = mode( allUnits );\n\n\tconst allValue = value === 0 || value ? `${ value }${ unit }` : undefined;\n\n\treturn allValue;\n}\n\n/**\n * Checks to determine if values are mixed.\n *\n * @param {Object} values Radius values.\n * @return {boolean} Whether values are mixed.\n */\nexport function hasMixedValues( values = {} ) {\n\tconst allValue = getAllValue( values );\n\tconst isMixed =\n\t\ttypeof values === 'string' ? false : isNaN( parseFloat( allValue ) );\n\n\treturn isMixed;\n}\n\n/**\n * Checks to determine if values are defined.\n *\n * @param {Object} values Radius values.\n * @return {boolean} Whether values are mixed.\n */\nexport function hasDefinedValues( values ) {\n\tif ( ! values ) {\n\t\treturn false;\n\t}\n\n\t// A string value represents a shorthand value.\n\tif ( typeof values === 'string' ) {\n\t\treturn true;\n\t}\n\n\t// An object represents longhand border radius values, if any are set\n\t// flag values as being defined.\n\tconst filteredValues = Object.values( values ).filter( ( value ) => {\n\t\treturn !! value || value === 0;\n\t} );\n\n\treturn !! filteredValues.length;\n}\n"],"mappings":"AAAA;AAC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AAM;AAChC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["clsx","Button","forwardRef","useRef","_x","sprintf","Icon","plus","deprecated","Inserter","useMergeRefs","jsx","_jsx","ButtonBlockAppender","rootClientId","className","onFocus","tabIndex","onSelect","ref","inserterButtonRef","mergedInserterButtonRef","position","__experimentalIsQuick","onSelectOrClose","args","current","focus","renderToggle","onToggle","disabled","isOpen","blockTitle","hasSingleBlockType","isToggleButton","label","__next40pxDefaultSize","onClick","undefined","showTooltip","children","icon","isAppender","ButtonBlockerAppender","props","alternative","since"],"sources":["@wordpress/block-editor/src/components/button-block-appender/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { Button } from '@wordpress/components';\nimport { forwardRef, useRef } from '@wordpress/element';\nimport { _x, sprintf } from '@wordpress/i18n';\nimport { Icon, plus } from '@wordpress/icons';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport Inserter from '../inserter';\nimport { useMergeRefs } from '@wordpress/compose';\n\nfunction ButtonBlockAppender(\n\t{ rootClientId, className, onFocus, tabIndex, onSelect },\n\tref\n) {\n\tconst inserterButtonRef = useRef();\n\n\tconst mergedInserterButtonRef = useMergeRefs( [ inserterButtonRef, ref ] );\n\treturn (\n\t\t<Inserter\n\t\t\tposition=\"bottom center\"\n\t\t\trootClientId={ rootClientId }\n\t\t\t__experimentalIsQuick\n\t\t\tonSelectOrClose={ ( ...args ) => {\n\t\t\t\tif ( onSelect && typeof onSelect === 'function' ) {\n\t\t\t\t\tonSelect( ...args );\n\t\t\t\t}\n\t\t\t\tinserterButtonRef.current?.focus();\n\t\t\t} }\n\t\t\trenderToggle={ ( {\n\t\t\t\tonToggle,\n\t\t\t\tdisabled,\n\t\t\t\tisOpen,\n\t\t\t\tblockTitle,\n\t\t\t\thasSingleBlockType,\n\t\t\t} ) => {\n\t\t\t\tconst isToggleButton = ! hasSingleBlockType;\n\t\t\t\tconst label = hasSingleBlockType\n\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t// translators: %s: the name of the block when there is only one\n\t\t\t\t\t\t\t_x(\n\t\t\t\t\t\t\t\t'Add %s',\n\t\t\t\t\t\t\t\t'directly add the only allowed block'\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tblockTitle\n\t\t\t\t\t )\n\t\t\t\t\t: _x(\n\t\t\t\t\t\t\t'Add block',\n\t\t\t\t\t\t\t'Generic label for block inserter button'\n\t\t\t\t\t );\n\n\t\t\t\treturn (\n\t\t\t\t\t<Button\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tref={ mergedInserterButtonRef }\n\t\t\t\t\t\tonFocus={ onFocus }\n\t\t\t\t\t\ttabIndex={ tabIndex }\n\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\tclassName,\n\t\t\t\t\t\t\t'block-editor-button-block-appender'\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\t\taria-haspopup={ isToggleButton ? 'true' : undefined }\n\t\t\t\t\t\taria-expanded={ isToggleButton ? isOpen : undefined }\n\t\t\t\t\t\t// Disable reason: There shouldn't be a case where this button is disabled but not visually hidden.\n\t\t\t\t\t\t// eslint-disable-next-line no-restricted-syntax\n\t\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t\tshowTooltip\n\t\t\t\t\t>\n\t\t\t\t\t\t<Icon icon={ plus } />\n\t\t\t\t\t</Button>\n\t\t\t\t);\n\t\t\t} }\n\t\t\tisAppender\n\t\t/>\n\t);\n}\n\n/**\n * Use `ButtonBlockAppender` instead.\n *\n * @deprecated\n */\nexport const ButtonBlockerAppender = forwardRef( ( props, ref ) => {\n\tdeprecated( `wp.blockEditor.ButtonBlockerAppender`, {\n\t\talternative: 'wp.blockEditor.ButtonBlockAppender',\n\t\tsince: '5.9',\n\t} );\n\n\treturn ButtonBlockAppender( props, ref );\n} );\n\n/**\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/button-block-appender/README.md\n */\nexport default forwardRef( ButtonBlockAppender );\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,MAAM,QAAQ,uBAAuB;AAC9C,SAASC,UAAU,EAAEC,MAAM,QAAQ,oBAAoB;AACvD,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,IAAI,EAAEC,IAAI,QAAQ,kBAAkB;AAC7C,OAAOC,UAAU,MAAM,uBAAuB;;AAE9C;AACA;AACA;AACA,OAAOC,QAAQ,MAAM,aAAa;AAClC,SAASC,YAAY,QAAQ,oBAAoB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAElD,SAASC,mBAAmBA,CAC3B;EAAEC,YAAY;EAAEC,SAAS;EAAEC,OAAO;EAAEC,QAAQ;EAAEC;AAAS,CAAC,EACxDC,GAAG,EACF;EACD,MAAMC,iBAAiB,GAAGjB,MAAM,CAAC,CAAC;EAElC,MAAMkB,uBAAuB,GAAGX,YAAY,CAAE,CAAEU,iBAAiB,EAAED,GAAG,CAAG,CAAC;EAC1E,oBACCP,IAAA,CAACH,QAAQ;IACRa,QAAQ,EAAC,eAAe;IACxBR,YAAY,EAAGA,YAAc;IAC7BS,qBAAqB;IACrBC,eAAe,EAAGA,CAAE,GAAGC,IAAI,KAAM;MAChC,IAAKP,QAAQ,IAAI,OAAOA,QAAQ,KAAK,UAAU,EAAG;QACjDA,QAAQ,CAAE,GAAGO,IAAK,CAAC;MACpB;MACAL,iBAAiB,CAACM,OAAO,EAAEC,KAAK,CAAC,CAAC;IACnC,CAAG;IACHC,YAAY,EAAGA,CAAE;MAChBC,QAAQ;MACRC,QAAQ;MACRC,MAAM;MACNC,UAAU;MACVC;IACD,CAAC,KAAM;MACN,MAAMC,cAAc,GAAG,CAAED,kBAAkB;MAC3C,MAAME,KAAK,GAAGF,kBAAkB,GAC7B5B,OAAO;MACP;MACAD,EAAE,CACD,QAAQ,EACR,qCACD,CAAC,EACD4B,UACA,CAAC,GACD5B,EAAE,CACF,WAAW,EACX,yCACA,CAAC;MAEJ,oBACCQ,IAAA,CAACX,MAAM;QACNmC,qBAAqB;QACrBjB,GAAG,EAAGE,uBAAyB;QAC/BL,OAAO,EAAGA,OAAS;QACnBC,QAAQ,EAAGA,QAAU;QACrBF,SAAS,EAAGf,IAAI,CACfe,SAAS,EACT,oCACD,CAAG;QACHsB,OAAO,EAAGR,QAAU;QACpB,iBAAgBK,cAAc,GAAG,MAAM,GAAGI,SAAW;QACrD,iBAAgBJ,cAAc,GAAGH,MAAM,GAAGO;QAC1C;QACA;QAAA;QACAR,QAAQ,EAAGA,QAAU;QACrBK,KAAK,EAAGA,KAAO;QACfI,WAAW;QAAAC,QAAA,eAEX5B,IAAA,CAACN,IAAI;UAACmC,IAAI,EAAGlC;QAAM,CAAE;MAAC,CACf,CAAC;IAEX,CAAG;IACHmC,UAAU;EAAA,CACV,CAAC;AAEJ;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,qBAAqB,GAAGzC,UAAU,CAAE,CAAE0C,KAAK,EAAEzB,GAAG,KAAM;EAClEX,UAAU,CAAG,sCAAqC,EAAE;IACnDqC,WAAW,EAAE,oCAAoC;IACjDC,KAAK,EAAE;EACR,CAAE,CAAC;EAEH,OAAOjC,mBAAmB,CAAE+B,KAAK,EAAEzB,GAAI,CAAC;AACzC,CAAE,CAAC;;AAEH;AACA;AACA;AACA,eAAejB,UAAU,CAAEW,mBAAoB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["clsx","Button","forwardRef","useRef","_x","sprintf","Icon","plus","deprecated","Inserter","useMergeRefs","jsx","_jsx","ButtonBlockAppender","rootClientId","className","onFocus","tabIndex","onSelect","ref","inserterButtonRef","mergedInserterButtonRef","position","__experimentalIsQuick","onSelectOrClose","args","current","focus","renderToggle","onToggle","disabled","isOpen","blockTitle","hasSingleBlockType","isToggleButton","label","__next40pxDefaultSize","onClick","undefined","showTooltip","children","icon","isAppender","ButtonBlockerAppender","props","alternative","since"],"sources":["@wordpress/block-editor/src/components/button-block-appender/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { Button } from '@wordpress/components';\nimport { forwardRef, useRef } from '@wordpress/element';\nimport { _x, sprintf } from '@wordpress/i18n';\nimport { Icon, plus } from '@wordpress/icons';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport Inserter from '../inserter';\nimport { useMergeRefs } from '@wordpress/compose';\n\nfunction ButtonBlockAppender(\n\t{ rootClientId, className, onFocus, tabIndex, onSelect },\n\tref\n) {\n\tconst inserterButtonRef = useRef();\n\n\tconst mergedInserterButtonRef = useMergeRefs( [ inserterButtonRef, ref ] );\n\treturn (\n\t\t<Inserter\n\t\t\tposition=\"bottom center\"\n\t\t\trootClientId={ rootClientId }\n\t\t\t__experimentalIsQuick\n\t\t\tonSelectOrClose={ ( ...args ) => {\n\t\t\t\tif ( onSelect && typeof onSelect === 'function' ) {\n\t\t\t\t\tonSelect( ...args );\n\t\t\t\t}\n\t\t\t\tinserterButtonRef.current?.focus();\n\t\t\t} }\n\t\t\trenderToggle={ ( {\n\t\t\t\tonToggle,\n\t\t\t\tdisabled,\n\t\t\t\tisOpen,\n\t\t\t\tblockTitle,\n\t\t\t\thasSingleBlockType,\n\t\t\t} ) => {\n\t\t\t\tconst isToggleButton = ! hasSingleBlockType;\n\t\t\t\tconst label = hasSingleBlockType\n\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t// translators: %s: the name of the block when there is only one\n\t\t\t\t\t\t\t_x(\n\t\t\t\t\t\t\t\t'Add %s',\n\t\t\t\t\t\t\t\t'directly add the only allowed block'\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tblockTitle\n\t\t\t\t\t )\n\t\t\t\t\t: _x(\n\t\t\t\t\t\t\t'Add block',\n\t\t\t\t\t\t\t'Generic label for block inserter button'\n\t\t\t\t\t );\n\n\t\t\t\treturn (\n\t\t\t\t\t<Button\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tref={ mergedInserterButtonRef }\n\t\t\t\t\t\tonFocus={ onFocus }\n\t\t\t\t\t\ttabIndex={ tabIndex }\n\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\tclassName,\n\t\t\t\t\t\t\t'block-editor-button-block-appender'\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\t\taria-haspopup={ isToggleButton ? 'true' : undefined }\n\t\t\t\t\t\taria-expanded={ isToggleButton ? isOpen : undefined }\n\t\t\t\t\t\t// Disable reason: There shouldn't be a case where this button is disabled but not visually hidden.\n\t\t\t\t\t\t// eslint-disable-next-line no-restricted-syntax\n\t\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t\tshowTooltip\n\t\t\t\t\t>\n\t\t\t\t\t\t<Icon icon={ plus } />\n\t\t\t\t\t</Button>\n\t\t\t\t);\n\t\t\t} }\n\t\t\tisAppender\n\t\t/>\n\t);\n}\n\n/**\n * Use `ButtonBlockAppender` instead.\n *\n * @deprecated\n */\nexport const ButtonBlockerAppender = forwardRef( ( props, ref ) => {\n\tdeprecated( `wp.blockEditor.ButtonBlockerAppender`, {\n\t\talternative: 'wp.blockEditor.ButtonBlockAppender',\n\t\tsince: '5.9',\n\t} );\n\n\treturn ButtonBlockAppender( props, ref );\n} );\n\n/**\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/button-block-appender/README.md\n */\nexport default forwardRef( ButtonBlockAppender );\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,MAAM,QAAQ,uBAAuB;AAC9C,SAASC,UAAU,EAAEC,MAAM,QAAQ,oBAAoB;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,QAAU;QACrBF,SAAS,EAAGf,IAAI,CACfe,SAAS,EACT,oCACD,CAAG;QACHsB,OAAO,EAAGR,QAAU;QACpB,iBAAgBK,cAAc,GAAG,MAAM,GAAGI,SAAW;QACrD,iBAAgBJ,cAAc,GAAGH,MAAM,GAAGO;QAC1C;QACA;QAAA;QACAR,QAAQ,EAAGA,QAAU;QACrBK,KAAK,EAAGA,KAAO;QACfI,WAAW;QAAAC,QAAA,eAEX5B,IAAA,CAACN,IAAI;UAACmC,IAAI,EAAGlC;QAAM,CAAE;MAAC,CACf,CAAC;IAEX,CAAG;IACHmC,UAAU;EAAA,CACV,CAAC;AAEJ;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,qBAAqB,GAAGzC,UAAU,CAAE,CAAE0C,KAAK,EAAEzB,GAAG,KAAM;EAClEX,UAAU,CAAE,sCAAsC,EAAE;IACnDqC,WAAW,EAAE,oCAAoC;IACjDC,KAAK,EAAE;EACR,CAAE,CAAC;EAEH,OAAOjC,mBAAmB,CAAE+B,KAAK,EAAEzB,GAAI,CAAC;AACzC,CAAE,CAAC;;AAEH;AACA;AACA;AACA,eAAejB,UAAU,CAAEW,mBAAoB,CAAC","ignoreList":[]}
@@ -16,8 +16,7 @@ import { useCallback } from '@wordpress/element';
16
16
  */
17
17
  import Inserter from '../inserter';
18
18
  import styles from './styles.scss';
19
- import { jsx as _jsx } from "react/jsx-runtime";
20
- import { Fragment as _Fragment } from "react/jsx-runtime";
19
+ import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
21
20
  function ButtonBlockAppender({
22
21
  rootClientId,
23
22
  getStylesFromColorScheme,
@@ -1 +1 @@
1
- {"version":3,"names":["View","withPreferredColorScheme","Button","Icon","plusCircleFilled","useCallback","Inserter","styles","jsx","_jsx","Fragment","_Fragment","ButtonBlockAppender","rootClientId","getStylesFromColorScheme","showSeparator","isFloating","onAddBlock","onAppenderPress","onToggle","appenderStyle","appender","appenderLight","appenderDark","addBlockButtonStyle","addBlockButton","floatingAddBlockButtonDark","addBlockButtonDark","children","renderToggle","disabled","isOpen","testID","onClick","fixedRatio","style","floatingAppender","icon","color","size","isAppender"],"sources":["@wordpress/block-editor/src/components/button-block-appender/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { View } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { withPreferredColorScheme } from '@wordpress/compose';\nimport { Button } from '@wordpress/components';\nimport { Icon, plusCircleFilled } from '@wordpress/icons';\nimport { useCallback } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport Inserter from '../inserter';\nimport styles from './styles.scss';\n\nfunction ButtonBlockAppender( {\n\trootClientId,\n\tgetStylesFromColorScheme,\n\tshowSeparator,\n\tisFloating = false,\n\tonAddBlock,\n} ) {\n\tconst onAppenderPress = useCallback(\n\t\t( onToggle ) => () => {\n\t\t\tif ( onAddBlock ) {\n\t\t\t\tonAddBlock();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( onToggle ) {\n\t\t\t\tonToggle();\n\t\t\t}\n\t\t},\n\t\t[ onAddBlock ]\n\t);\n\n\tconst appenderStyle = {\n\t\t...styles.appender,\n\t\t...getStylesFromColorScheme(\n\t\t\tstyles.appenderLight,\n\t\t\tstyles.appenderDark\n\t\t),\n\t};\n\tconst addBlockButtonStyle = getStylesFromColorScheme(\n\t\tstyles.addBlockButton,\n\t\tisFloating\n\t\t\t? styles.floatingAddBlockButtonDark\n\t\t\t: styles.addBlockButtonDark\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t<Inserter\n\t\t\t\trootClientId={ rootClientId }\n\t\t\t\trenderToggle={ ( { onToggle, disabled, isOpen } ) => (\n\t\t\t\t\t<Button\n\t\t\t\t\t\ttestID=\"appender-button\"\n\t\t\t\t\t\tonClick={ onAppenderPress( onToggle ) }\n\t\t\t\t\t\taria-expanded={ isOpen }\n\t\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t\t\tfixedRatio={ false }\n\t\t\t\t\t>\n\t\t\t\t\t\t<View\n\t\t\t\t\t\t\tstyle={ [\n\t\t\t\t\t\t\t\tappenderStyle,\n\t\t\t\t\t\t\t\tisFloating && styles.floatingAppender,\n\t\t\t\t\t\t\t] }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\t\ticon={ plusCircleFilled }\n\t\t\t\t\t\t\t\tstyle={ addBlockButtonStyle }\n\t\t\t\t\t\t\t\tcolor={ addBlockButtonStyle.color }\n\t\t\t\t\t\t\t\tsize={ addBlockButtonStyle.size }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</View>\n\t\t\t\t\t</Button>\n\t\t\t\t) }\n\t\t\t\tisAppender\n\t\t\t\tshowSeparator={ showSeparator }\n\t\t\t/>\n\t\t</>\n\t);\n}\n\n/**\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/button-block-appender/README.md\n */\nexport default withPreferredColorScheme( ButtonBlockAppender );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,IAAI,QAAQ,cAAc;;AAEnC;AACA;AACA;AACA,SAASC,wBAAwB,QAAQ,oBAAoB;AAC7D,SAASC,MAAM,QAAQ,uBAAuB;AAC9C,SAASC,IAAI,EAAEC,gBAAgB,QAAQ,kBAAkB;AACzD,SAASC,WAAW,QAAQ,oBAAoB;;AAEhD;AACA;AACA;AACA,OAAOC,QAAQ,MAAM,aAAa;AAClC,OAAOC,MAAM,MAAM,eAAe;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,QAAA,IAAAC,SAAA;AAEnC,SAASC,mBAAmBA,CAAE;EAC7BC,YAAY;EACZC,wBAAwB;EACxBC,aAAa;EACbC,UAAU,GAAG,KAAK;EAClBC;AACD,CAAC,EAAG;EACH,MAAMC,eAAe,GAAGb,WAAW,CAChCc,QAAQ,IAAM,MAAM;IACrB,IAAKF,UAAU,EAAG;MACjBA,UAAU,CAAC,CAAC;MACZ;IACD;IAEA,IAAKE,QAAQ,EAAG;MACfA,QAAQ,CAAC,CAAC;IACX;EACD,CAAC,EACD,CAAEF,UAAU,CACb,CAAC;EAED,MAAMG,aAAa,GAAG;IACrB,GAAGb,MAAM,CAACc,QAAQ;IAClB,GAAGP,wBAAwB,CAC1BP,MAAM,CAACe,aAAa,EACpBf,MAAM,CAACgB,YACR;EACD,CAAC;EACD,MAAMC,mBAAmB,GAAGV,wBAAwB,CACnDP,MAAM,CAACkB,cAAc,EACrBT,UAAU,GACPT,MAAM,CAACmB,0BAA0B,GACjCnB,MAAM,CAACoB,kBACX,CAAC;EAED,oBACClB,IAAA,CAAAE,SAAA;IAAAiB,QAAA,eACCnB,IAAA,CAACH,QAAQ;MACRO,YAAY,EAAGA,YAAc;MAC7BgB,YAAY,EAAGA,CAAE;QAAEV,QAAQ;QAAEW,QAAQ;QAAEC;MAAO,CAAC,kBAC9CtB,IAAA,CAACP,MAAM;QACN8B,MAAM,EAAC,iBAAiB;QACxBC,OAAO,EAAGf,eAAe,CAAEC,QAAS,CAAG;QACvC,iBAAgBY,MAAQ;QACxBD,QAAQ,EAAGA,QAAU;QACrBI,UAAU,EAAG,KAAO;QAAAN,QAAA,eAEpBnB,IAAA,CAACT,IAAI;UACJmC,KAAK,EAAG,CACPf,aAAa,EACbJ,UAAU,IAAIT,MAAM,CAAC6B,gBAAgB,CACnC;UAAAR,QAAA,eAEHnB,IAAA,CAACN,IAAI;YACJkC,IAAI,EAAGjC,gBAAkB;YACzB+B,KAAK,EAAGX,mBAAqB;YAC7Bc,KAAK,EAAGd,mBAAmB,CAACc,KAAO;YACnCC,IAAI,EAAGf,mBAAmB,CAACe;UAAM,CACjC;QAAC,CACG;MAAC,CACA,CACN;MACHC,UAAU;MACVzB,aAAa,EAAGA;IAAe,CAC/B;EAAC,CACD,CAAC;AAEL;;AAEA;AACA;AACA;AACA,eAAed,wBAAwB,CAAEW,mBAAoB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["View","withPreferredColorScheme","Button","Icon","plusCircleFilled","useCallback","Inserter","styles","jsx","_jsx","Fragment","_Fragment","ButtonBlockAppender","rootClientId","getStylesFromColorScheme","showSeparator","isFloating","onAddBlock","onAppenderPress","onToggle","appenderStyle","appender","appenderLight","appenderDark","addBlockButtonStyle","addBlockButton","floatingAddBlockButtonDark","addBlockButtonDark","children","renderToggle","disabled","isOpen","testID","onClick","fixedRatio","style","floatingAppender","icon","color","size","isAppender"],"sources":["@wordpress/block-editor/src/components/button-block-appender/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { View } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { withPreferredColorScheme } from '@wordpress/compose';\nimport { Button } from '@wordpress/components';\nimport { Icon, plusCircleFilled } from '@wordpress/icons';\nimport { useCallback } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport Inserter from '../inserter';\nimport styles from './styles.scss';\n\nfunction ButtonBlockAppender( {\n\trootClientId,\n\tgetStylesFromColorScheme,\n\tshowSeparator,\n\tisFloating = false,\n\tonAddBlock,\n} ) {\n\tconst onAppenderPress = useCallback(\n\t\t( onToggle ) => () => {\n\t\t\tif ( onAddBlock ) {\n\t\t\t\tonAddBlock();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( onToggle ) {\n\t\t\t\tonToggle();\n\t\t\t}\n\t\t},\n\t\t[ onAddBlock ]\n\t);\n\n\tconst appenderStyle = {\n\t\t...styles.appender,\n\t\t...getStylesFromColorScheme(\n\t\t\tstyles.appenderLight,\n\t\t\tstyles.appenderDark\n\t\t),\n\t};\n\tconst addBlockButtonStyle = getStylesFromColorScheme(\n\t\tstyles.addBlockButton,\n\t\tisFloating\n\t\t\t? styles.floatingAddBlockButtonDark\n\t\t\t: styles.addBlockButtonDark\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t<Inserter\n\t\t\t\trootClientId={ rootClientId }\n\t\t\t\trenderToggle={ ( { onToggle, disabled, isOpen } ) => (\n\t\t\t\t\t<Button\n\t\t\t\t\t\ttestID=\"appender-button\"\n\t\t\t\t\t\tonClick={ onAppenderPress( onToggle ) }\n\t\t\t\t\t\taria-expanded={ isOpen }\n\t\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t\t\tfixedRatio={ false }\n\t\t\t\t\t>\n\t\t\t\t\t\t<View\n\t\t\t\t\t\t\tstyle={ [\n\t\t\t\t\t\t\t\tappenderStyle,\n\t\t\t\t\t\t\t\tisFloating && styles.floatingAppender,\n\t\t\t\t\t\t\t] }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\t\ticon={ plusCircleFilled }\n\t\t\t\t\t\t\t\tstyle={ addBlockButtonStyle }\n\t\t\t\t\t\t\t\tcolor={ addBlockButtonStyle.color }\n\t\t\t\t\t\t\t\tsize={ addBlockButtonStyle.size }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</View>\n\t\t\t\t\t</Button>\n\t\t\t\t) }\n\t\t\t\tisAppender\n\t\t\t\tshowSeparator={ showSeparator }\n\t\t\t/>\n\t\t</>\n\t);\n}\n\n/**\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/button-block-appender/README.md\n */\nexport default withPreferredColorScheme( ButtonBlockAppender );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,IAAI,QAAQ,cAAc;;AAEnC;AACA;AACA;AACA,SAASC,wBAAwB,QAAQ,oBAAoB;AAC7D,SAASC,MAAM,QAAQ,uBAAuB;AAC9C,SAASC,IAAI,EAAEC,gBAAgB,QAAQ,kBAAkB;AACzD,SAASC,WAAW,QAAQ,oBAAoB;;AAEhD;AACA;AACA;AACA,OAAOC,QAAQ,MAAM,aAAa;AAClC,OAAOC,MAAM,MAAM,eAAe;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA;AAEnC,SAASC,mBAAmBA,CAAE;EAC7BC,YAAY;EACZC,wBAAwB;EACxBC,aAAa;EACbC,UAAU,GAAG,KAAK;EAClBC;AACD,CA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CAC/B;EAAC,CACD,CAAC;AAEL;;AAEA;AACA;AACA;AACA,eAAed,wBAAwB,CAAEW,mBAAoB,CAAC","ignoreList":[]}
@@ -11,9 +11,7 @@ import { useSelect, useDispatch } from '@wordpress/data';
11
11
  */
12
12
  import { useGetNumberOfBlocksBeforeCell } from '../grid/use-get-number-of-blocks-before-cell';
13
13
  import { store as blockEditorStore } from '../../store';
14
- import { jsx as _jsx } from "react/jsx-runtime";
15
- import { jsxs as _jsxs } from "react/jsx-runtime";
16
- import { Fragment as _Fragment } from "react/jsx-runtime";
14
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
17
15
  function helpText(selfStretch, parentLayout) {
18
16
  const {
19
17
  orientation = 'horizontal'
@@ -1 +1 @@
1
- {"version":3,"names":["__experimentalToggleGroupControl","ToggleGroupControl","__experimentalToggleGroupControlOption","ToggleGroupControlOption","__experimentalUnitControl","UnitControl","__experimentalInputControl","InputControl","__experimentalHStack","HStack","__experimentalVStack","VStack","__experimentalToolsPanelItem","ToolsPanelItem","Flex","FlexItem","__","_x","useEffect","useSelect","useDispatch","useGetNumberOfBlocksBeforeCell","store","blockEditorStore","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","helpText","selfStretch","parentLayout","orientation","ChildLayoutControl","value","childLayout","onChange","isShownByDefault","panelId","type","parentType","default","defaultParentType","parentLayoutType","FlexControls","GridControls","flexSize","hasFlexValue","flexResetLabel","resetFlex","undefined","as","spacing","hasValue","label","onDeselect","children","__nextHasNoMarginBottom","size","childLayoutOrientation","help","newFlexSize","isBlock","hideLabelFromVision","columnStart","rowStart","columnSpan","rowSpan","columnCount","rowCount","rootClientId","select","getBlockRootClientId","moveBlocksToPosition","__unstableMarkNextChangeAsNotPersistent","getNumberOfBlocksBeforeCell","hasStartValue","hasSpanValue","resetGridStarts","resetGridSpans","newColumnSpan","parseInt","min","newRowSpan","window","__experimentalEnableGridInteractivity","style","width","newColumnStart","max","newRowStart"],"sources":["@wordpress/block-editor/src/components/child-layout-control/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n\t__experimentalUnitControl as UnitControl,\n\t__experimentalInputControl as InputControl,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n\tFlex,\n\tFlexItem,\n} from '@wordpress/components';\nimport { __, _x } from '@wordpress/i18n';\nimport { useEffect } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { useGetNumberOfBlocksBeforeCell } from '../grid/use-get-number-of-blocks-before-cell';\nimport { store as blockEditorStore } from '../../store';\n\nfunction helpText( selfStretch, parentLayout ) {\n\tconst { orientation = 'horizontal' } = parentLayout;\n\n\tif ( selfStretch === 'fill' ) {\n\t\treturn __( 'Stretch to fill available space.' );\n\t}\n\tif ( selfStretch === 'fixed' && orientation === 'horizontal' ) {\n\t\treturn __( 'Specify a fixed width.' );\n\t} else if ( selfStretch === 'fixed' ) {\n\t\treturn __( 'Specify a fixed height.' );\n\t}\n\treturn __( 'Fit contents.' );\n}\n\n/**\n * Form to edit the child layout value.\n *\n * @param {Object} props Props.\n * @param {Object} props.value The child layout value.\n * @param {Function} props.onChange Function to update the child layout value.\n * @param {Object} props.parentLayout The parent layout value.\n *\n * @param {boolean} props.isShownByDefault\n * @param {string} props.panelId\n * @return {Element} child layout edit element.\n */\nexport default function ChildLayoutControl( {\n\tvalue: childLayout = {},\n\tonChange,\n\tparentLayout,\n\tisShownByDefault,\n\tpanelId,\n} ) {\n\tconst {\n\t\ttype: parentType,\n\t\tdefault: { type: defaultParentType = 'default' } = {},\n\t} = parentLayout ?? {};\n\tconst parentLayoutType = parentType || defaultParentType;\n\n\tif ( parentLayoutType === 'flex' ) {\n\t\treturn (\n\t\t\t<FlexControls\n\t\t\t\tchildLayout={ childLayout }\n\t\t\t\tonChange={ onChange }\n\t\t\t\tparentLayout={ parentLayout }\n\t\t\t\tisShownByDefault={ isShownByDefault }\n\t\t\t\tpanelId={ panelId }\n\t\t\t/>\n\t\t);\n\t} else if ( parentLayoutType === 'grid' ) {\n\t\treturn (\n\t\t\t<GridControls\n\t\t\t\tchildLayout={ childLayout }\n\t\t\t\tonChange={ onChange }\n\t\t\t\tparentLayout={ parentLayout }\n\t\t\t\tisShownByDefault={ isShownByDefault }\n\t\t\t\tpanelId={ panelId }\n\t\t\t/>\n\t\t);\n\t}\n\n\treturn null;\n}\n\nfunction FlexControls( {\n\tchildLayout,\n\tonChange,\n\tparentLayout,\n\tisShownByDefault,\n\tpanelId,\n} ) {\n\tconst { selfStretch, flexSize } = childLayout;\n\tconst { orientation = 'horizontal' } = parentLayout ?? {};\n\tconst hasFlexValue = () => !! selfStretch;\n\tconst flexResetLabel =\n\t\torientation === 'horizontal' ? __( 'Width' ) : __( 'Height' );\n\tconst resetFlex = () => {\n\t\tonChange( {\n\t\t\tselfStretch: undefined,\n\t\t\tflexSize: undefined,\n\t\t} );\n\t};\n\n\tuseEffect( () => {\n\t\tif ( selfStretch === 'fixed' && ! flexSize ) {\n\t\t\tonChange( {\n\t\t\t\t...childLayout,\n\t\t\t\tselfStretch: 'fit',\n\t\t\t} );\n\t\t}\n\t}, [] );\n\n\treturn (\n\t\t<VStack\n\t\t\tas={ ToolsPanelItem }\n\t\t\tspacing={ 2 }\n\t\t\thasValue={ hasFlexValue }\n\t\t\tlabel={ flexResetLabel }\n\t\t\tonDeselect={ resetFlex }\n\t\t\tisShownByDefault={ isShownByDefault }\n\t\t\tpanelId={ panelId }\n\t\t>\n\t\t\t<ToggleGroupControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\tlabel={ childLayoutOrientation( parentLayout ) }\n\t\t\t\tvalue={ selfStretch || 'fit' }\n\t\t\t\thelp={ helpText( selfStretch, parentLayout ) }\n\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\tconst newFlexSize = value !== 'fixed' ? null : flexSize;\n\t\t\t\t\tonChange( {\n\t\t\t\t\t\tselfStretch: value,\n\t\t\t\t\t\tflexSize: newFlexSize,\n\t\t\t\t\t} );\n\t\t\t\t} }\n\t\t\t\tisBlock\n\t\t\t>\n\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\tkey=\"fit\"\n\t\t\t\t\tvalue=\"fit\"\n\t\t\t\t\tlabel={ _x(\n\t\t\t\t\t\t'Fit',\n\t\t\t\t\t\t'Intrinsic block width in flex layout'\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\tkey=\"fill\"\n\t\t\t\t\tvalue=\"fill\"\n\t\t\t\t\tlabel={ _x(\n\t\t\t\t\t\t'Grow',\n\t\t\t\t\t\t'Block with expanding width in flex layout'\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\tkey=\"fixed\"\n\t\t\t\t\tvalue=\"fixed\"\n\t\t\t\t\tlabel={ _x(\n\t\t\t\t\t\t'Fixed',\n\t\t\t\t\t\t'Block with fixed width in flex layout'\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t</ToggleGroupControl>\n\t\t\t{ selfStretch === 'fixed' && (\n\t\t\t\t<UnitControl\n\t\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\tonChange( {\n\t\t\t\t\t\t\tselfStretch,\n\t\t\t\t\t\t\tflexSize: value,\n\t\t\t\t\t\t} );\n\t\t\t\t\t} }\n\t\t\t\t\tvalue={ flexSize }\n\t\t\t\t\tlabel={ flexResetLabel }\n\t\t\t\t\thideLabelFromVision\n\t\t\t\t/>\n\t\t\t) }\n\t\t</VStack>\n\t);\n}\n\nexport function childLayoutOrientation( parentLayout ) {\n\tconst { orientation = 'horizontal' } = parentLayout;\n\treturn orientation === 'horizontal' ? __( 'Width' ) : __( 'Height' );\n}\n\nfunction GridControls( {\n\tchildLayout,\n\tonChange,\n\tparentLayout,\n\tisShownByDefault,\n\tpanelId,\n} ) {\n\tconst { columnStart, rowStart, columnSpan, rowSpan } = childLayout;\n\tconst { columnCount = 3, rowCount } = parentLayout ?? {};\n\tconst rootClientId = useSelect( ( select ) =>\n\t\tselect( blockEditorStore ).getBlockRootClientId( panelId )\n\t);\n\tconst { moveBlocksToPosition, __unstableMarkNextChangeAsNotPersistent } =\n\t\tuseDispatch( blockEditorStore );\n\tconst getNumberOfBlocksBeforeCell = useGetNumberOfBlocksBeforeCell(\n\t\trootClientId,\n\t\tcolumnCount\n\t);\n\tconst hasStartValue = () => !! columnStart || !! rowStart;\n\tconst hasSpanValue = () => !! columnSpan || !! rowSpan;\n\tconst resetGridStarts = () => {\n\t\tonChange( {\n\t\t\tcolumnStart: undefined,\n\t\t\trowStart: undefined,\n\t\t} );\n\t};\n\tconst resetGridSpans = () => {\n\t\tonChange( {\n\t\t\tcolumnSpan: undefined,\n\t\t\trowSpan: undefined,\n\t\t} );\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<HStack\n\t\t\t\tas={ ToolsPanelItem }\n\t\t\t\thasValue={ hasSpanValue }\n\t\t\t\tlabel={ __( 'Grid span' ) }\n\t\t\t\tonDeselect={ resetGridSpans }\n\t\t\t\tisShownByDefault={ isShownByDefault }\n\t\t\t\tpanelId={ panelId }\n\t\t\t>\n\t\t\t\t<InputControl\n\t\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\t\tlabel={ __( 'Column span' ) }\n\t\t\t\t\ttype=\"number\"\n\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\t// Don't allow unsetting.\n\t\t\t\t\t\tconst newColumnSpan =\n\t\t\t\t\t\t\tvalue === '' ? 1 : parseInt( value, 10 );\n\t\t\t\t\t\tonChange( {\n\t\t\t\t\t\t\tcolumnStart,\n\t\t\t\t\t\t\trowStart,\n\t\t\t\t\t\t\trowSpan,\n\t\t\t\t\t\t\tcolumnSpan: newColumnSpan,\n\t\t\t\t\t\t} );\n\t\t\t\t\t} }\n\t\t\t\t\tvalue={ columnSpan ?? 1 }\n\t\t\t\t\tmin={ 1 }\n\t\t\t\t/>\n\t\t\t\t<InputControl\n\t\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\t\tlabel={ __( 'Row span' ) }\n\t\t\t\t\ttype=\"number\"\n\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\t// Don't allow unsetting.\n\t\t\t\t\t\tconst newRowSpan =\n\t\t\t\t\t\t\tvalue === '' ? 1 : parseInt( value, 10 );\n\t\t\t\t\t\tonChange( {\n\t\t\t\t\t\t\tcolumnStart,\n\t\t\t\t\t\t\trowStart,\n\t\t\t\t\t\t\tcolumnSpan,\n\t\t\t\t\t\t\trowSpan: newRowSpan,\n\t\t\t\t\t\t} );\n\t\t\t\t\t} }\n\t\t\t\t\tvalue={ rowSpan ?? 1 }\n\t\t\t\t\tmin={ 1 }\n\t\t\t\t/>\n\t\t\t</HStack>\n\t\t\t{ window.__experimentalEnableGridInteractivity && columnCount && (\n\t\t\t\t// Use Flex with an explicit width on the FlexItem instead of HStack to\n\t\t\t\t// work around an issue in webkit where inputs with a max attribute are\n\t\t\t\t// sized incorrectly.\n\t\t\t\t<Flex\n\t\t\t\t\tas={ ToolsPanelItem }\n\t\t\t\t\thasValue={ hasStartValue }\n\t\t\t\t\tlabel={ __( 'Grid placement' ) }\n\t\t\t\t\tonDeselect={ resetGridStarts }\n\t\t\t\t\tisShownByDefault={ false }\n\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t>\n\t\t\t\t\t<FlexItem style={ { width: '50%' } }>\n\t\t\t\t\t\t<InputControl\n\t\t\t\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\t\t\t\tlabel={ __( 'Column' ) }\n\t\t\t\t\t\t\ttype=\"number\"\n\t\t\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\t\t\t// Don't allow unsetting.\n\t\t\t\t\t\t\t\tconst newColumnStart =\n\t\t\t\t\t\t\t\t\tvalue === '' ? 1 : parseInt( value, 10 );\n\t\t\t\t\t\t\t\tonChange( {\n\t\t\t\t\t\t\t\t\tcolumnStart: newColumnStart,\n\t\t\t\t\t\t\t\t\trowStart,\n\t\t\t\t\t\t\t\t\tcolumnSpan,\n\t\t\t\t\t\t\t\t\trowSpan,\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\t\t\t\t\t\tmoveBlocksToPosition(\n\t\t\t\t\t\t\t\t\t[ panelId ],\n\t\t\t\t\t\t\t\t\trootClientId,\n\t\t\t\t\t\t\t\t\trootClientId,\n\t\t\t\t\t\t\t\t\tgetNumberOfBlocksBeforeCell(\n\t\t\t\t\t\t\t\t\t\tnewColumnStart,\n\t\t\t\t\t\t\t\t\t\trowStart\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\tvalue={ columnStart ?? 1 }\n\t\t\t\t\t\t\tmin={ 1 }\n\t\t\t\t\t\t\tmax={\n\t\t\t\t\t\t\t\tcolumnCount\n\t\t\t\t\t\t\t\t\t? columnCount - ( columnSpan ?? 1 ) + 1\n\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</FlexItem>\n\t\t\t\t\t<FlexItem style={ { width: '50%' } }>\n\t\t\t\t\t\t<InputControl\n\t\t\t\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\t\t\t\tlabel={ __( 'Row' ) }\n\t\t\t\t\t\t\ttype=\"number\"\n\t\t\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\t\t\t// Don't allow unsetting.\n\t\t\t\t\t\t\t\tconst newRowStart =\n\t\t\t\t\t\t\t\t\tvalue === '' ? 1 : parseInt( value, 10 );\n\t\t\t\t\t\t\t\tonChange( {\n\t\t\t\t\t\t\t\t\tcolumnStart,\n\t\t\t\t\t\t\t\t\trowStart: newRowStart,\n\t\t\t\t\t\t\t\t\tcolumnSpan,\n\t\t\t\t\t\t\t\t\trowSpan,\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\t\t\t\t\t\tmoveBlocksToPosition(\n\t\t\t\t\t\t\t\t\t[ panelId ],\n\t\t\t\t\t\t\t\t\trootClientId,\n\t\t\t\t\t\t\t\t\trootClientId,\n\t\t\t\t\t\t\t\t\tgetNumberOfBlocksBeforeCell(\n\t\t\t\t\t\t\t\t\t\tcolumnStart,\n\t\t\t\t\t\t\t\t\t\tnewRowStart\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\tvalue={ rowStart ?? 1 }\n\t\t\t\t\t\t\tmin={ 1 }\n\t\t\t\t\t\t\tmax={\n\t\t\t\t\t\t\t\trowCount\n\t\t\t\t\t\t\t\t\t? rowCount - ( rowSpan ?? 1 ) + 1\n\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</FlexItem>\n\t\t\t\t</Flex>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SACCA,gCAAgC,IAAIC,kBAAkB,EACtDC,sCAAsC,IAAIC,wBAAwB,EAClEC,yBAAyB,IAAIC,WAAW,EACxCC,0BAA0B,IAAIC,YAAY,EAC1CC,oBAAoB,IAAIC,MAAM,EAC9BC,oBAAoB,IAAIC,MAAM,EAC9BC,4BAA4B,IAAIC,cAAc,EAC9CC,IAAI,EACJC,QAAQ,QACF,uBAAuB;AAC9B,SAASC,EAAE,EAAEC,EAAE,QAAQ,iBAAiB;AACxC,SAASC,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,SAAS,EAAEC,W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U,GAAI,CAAC,CAAE,GAAG,CAAC,GACrChB;QACH,CACD;MAAC,CACO,CAAC,eACX1B,IAAA,CAACV,QAAQ;QAACwE,KAAK,EAAG;UAAEC,KAAK,EAAE;QAAM,CAAG;QAAA/B,QAAA,eACnChC,IAAA,CAAClB,YAAY;UACZoD,IAAI,EAAC,kBAAkB;UACvBJ,KAAK,EAAGvC,EAAE,CAAE,KAAM,CAAG;UACrBwB,IAAI,EAAC,QAAQ;UACbH,QAAQ,EAAKF,KAAK,IAAM;YACvB;YACA,MAAMwD,WAAW,GAChBxD,KAAK,KAAK,EAAE,GAAG,CAAC,GAAG+C,QAAQ,CAAE/C,KAAK,EAAE,EAAG,CAAC;YACzCE,QAAQ,CAAE;cACT4B,WAAW;cACXC,QAAQ,EAAEyB,WAAW;cACrBxB,UAAU;cACVC;YACD,CAAE,CAAC;YACHO,uCAAuC,CAAC,CAAC;YACzCD,oBAAoB,CACnB,CAAEnC,OAAO,CAAE,EACXgC,YAAY,EACZA,YAAY,EACZK,2BAA2B,CAC1BX,WAAW,EACX0B,WACD,CACD,CAAC;UACF,CAAG;UACHxD,KAAK,EAAG+B,QAAQ,aAARA,QAAQ,cAARA,QAAQ,GAAI,CAAG;UACvBiB,GAAG,EAAG,CAAG;UACTO,GAAG,EACFpB,QAAQ,GACLA,QAAQ,IAAKF,OAAO,aAAPA,OAAO,cAAPA,OAAO,GAAI,CAAC,CAAE,GAAG,CAAC,GAC/BjB;QACH,CACD;MAAC,CACO,CAAC;IAAA,CACN,CACN;EAAA,CACA,CAAC;AAEL","ignoreList":[]}
1
+ {"version":3,"names":["__experimentalToggleGroupControl","ToggleGroupControl","__experimentalToggleGroupControlOption","ToggleGroupControlOption","__experimentalUnitControl","UnitControl","__experimentalInputControl","InputControl","__experimentalHStack","HStack","__experimentalVStack","VStack","__experimentalToolsPanelItem","ToolsPanelItem","Flex","FlexItem","__","_x","useEffect","useSelect","useDispatch","useGetNumberOfBlocksBeforeCell","store","blockEditorStore","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","helpText","selfStretch","parentLayout","orientation","ChildLayoutControl","value","childLayout","onChange","isShownByDefault","panelId","type","parentType","default","defaultParentType","parentLayoutType","FlexControls","GridControls","flexSize","hasFlexValue","flexResetLabel","resetFlex","undefined","as","spacing","hasValue","label","onDeselect","children","__nextHasNoMarginBottom","size","childLayoutOrientation","help","newFlexSize","isBlock","hideLabelFromVision","columnStart","rowStart","columnSpan","rowSpan","columnCount","rowCount","rootClientId","select","getBlockRootClientId","moveBlocksToPosition","__unstableMarkNextChangeAsNotPersistent","getNumberOfBlocksBeforeCell","hasStartValue","hasSpanValue","resetGridStarts","resetGridSpans","newColumnSpan","parseInt","min","newRowSpan","window","__experimentalEnableGridInteractivity","style","width","newColumnStart","max","newRowStart"],"sources":["@wordpress/block-editor/src/components/child-layout-control/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n\t__experimentalUnitControl as UnitControl,\n\t__experimentalInputControl as InputControl,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n\tFlex,\n\tFlexItem,\n} from '@wordpress/components';\nimport { __, _x } from '@wordpress/i18n';\nimport { useEffect } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { useGetNumberOfBlocksBeforeCell } from '../grid/use-get-number-of-blocks-before-cell';\nimport { store as blockEditorStore } from '../../store';\n\nfunction helpText( selfStretch, parentLayout ) {\n\tconst { orientation = 'horizontal' } = parentLayout;\n\n\tif ( selfStretch === 'fill' ) {\n\t\treturn __( 'Stretch to fill available space.' );\n\t}\n\tif ( selfStretch === 'fixed' && orientation === 'horizontal' ) {\n\t\treturn __( 'Specify a fixed width.' );\n\t} else if ( selfStretch === 'fixed' ) {\n\t\treturn __( 'Specify a fixed height.' );\n\t}\n\treturn __( 'Fit contents.' );\n}\n\n/**\n * Form to edit the child layout value.\n *\n * @param {Object} props Props.\n * @param {Object} props.value The child layout value.\n * @param {Function} props.onChange Function to update the child layout value.\n * @param {Object} props.parentLayout The parent layout value.\n *\n * @param {boolean} props.isShownByDefault\n * @param {string} props.panelId\n * @return {Element} child layout edit element.\n */\nexport default function ChildLayoutControl( {\n\tvalue: childLayout = {},\n\tonChange,\n\tparentLayout,\n\tisShownByDefault,\n\tpanelId,\n} ) {\n\tconst {\n\t\ttype: parentType,\n\t\tdefault: { type: defaultParentType = 'default' } = {},\n\t} = parentLayout ?? {};\n\tconst parentLayoutType = parentType || defaultParentType;\n\n\tif ( parentLayoutType === 'flex' ) {\n\t\treturn (\n\t\t\t<FlexControls\n\t\t\t\tchildLayout={ childLayout }\n\t\t\t\tonChange={ onChange }\n\t\t\t\tparentLayout={ parentLayout }\n\t\t\t\tisShownByDefault={ isShownByDefault }\n\t\t\t\tpanelId={ panelId }\n\t\t\t/>\n\t\t);\n\t} else if ( parentLayoutType === 'grid' ) {\n\t\treturn (\n\t\t\t<GridControls\n\t\t\t\tchildLayout={ childLayout }\n\t\t\t\tonChange={ onChange }\n\t\t\t\tparentLayout={ parentLayout }\n\t\t\t\tisShownByDefault={ isShownByDefault }\n\t\t\t\tpanelId={ panelId }\n\t\t\t/>\n\t\t);\n\t}\n\n\treturn null;\n}\n\nfunction FlexControls( {\n\tchildLayout,\n\tonChange,\n\tparentLayout,\n\tisShownByDefault,\n\tpanelId,\n} ) {\n\tconst { selfStretch, flexSize } = childLayout;\n\tconst { orientation = 'horizontal' } = parentLayout ?? {};\n\tconst hasFlexValue = () => !! selfStretch;\n\tconst flexResetLabel =\n\t\torientation === 'horizontal' ? __( 'Width' ) : __( 'Height' );\n\tconst resetFlex = () => {\n\t\tonChange( {\n\t\t\tselfStretch: undefined,\n\t\t\tflexSize: undefined,\n\t\t} );\n\t};\n\n\tuseEffect( () => {\n\t\tif ( selfStretch === 'fixed' && ! flexSize ) {\n\t\t\tonChange( {\n\t\t\t\t...childLayout,\n\t\t\t\tselfStretch: 'fit',\n\t\t\t} );\n\t\t}\n\t}, [] );\n\n\treturn (\n\t\t<VStack\n\t\t\tas={ ToolsPanelItem }\n\t\t\tspacing={ 2 }\n\t\t\thasValue={ hasFlexValue }\n\t\t\tlabel={ flexResetLabel }\n\t\t\tonDeselect={ resetFlex }\n\t\t\tisShownByDefault={ isShownByDefault }\n\t\t\tpanelId={ panelId }\n\t\t>\n\t\t\t<ToggleGroupControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\tlabel={ childLayoutOrientation( parentLayout ) }\n\t\t\t\tvalue={ selfStretch || 'fit' }\n\t\t\t\thelp={ helpText( selfStretch, parentLayout ) }\n\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\tconst newFlexSize = value !== 'fixed' ? null : flexSize;\n\t\t\t\t\tonChange( {\n\t\t\t\t\t\tselfStretch: value,\n\t\t\t\t\t\tflexSize: newFlexSize,\n\t\t\t\t\t} );\n\t\t\t\t} }\n\t\t\t\tisBlock\n\t\t\t>\n\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\tkey=\"fit\"\n\t\t\t\t\tvalue=\"fit\"\n\t\t\t\t\tlabel={ _x(\n\t\t\t\t\t\t'Fit',\n\t\t\t\t\t\t'Intrinsic block width in flex layout'\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\tkey=\"fill\"\n\t\t\t\t\tvalue=\"fill\"\n\t\t\t\t\tlabel={ _x(\n\t\t\t\t\t\t'Grow',\n\t\t\t\t\t\t'Block with expanding width in flex layout'\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\tkey=\"fixed\"\n\t\t\t\t\tvalue=\"fixed\"\n\t\t\t\t\tlabel={ _x(\n\t\t\t\t\t\t'Fixed',\n\t\t\t\t\t\t'Block with fixed width in flex layout'\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t</ToggleGroupControl>\n\t\t\t{ selfStretch === 'fixed' && (\n\t\t\t\t<UnitControl\n\t\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\tonChange( {\n\t\t\t\t\t\t\tselfStretch,\n\t\t\t\t\t\t\tflexSize: value,\n\t\t\t\t\t\t} );\n\t\t\t\t\t} }\n\t\t\t\t\tvalue={ flexSize }\n\t\t\t\t\tlabel={ flexResetLabel }\n\t\t\t\t\thideLabelFromVision\n\t\t\t\t/>\n\t\t\t) }\n\t\t</VStack>\n\t);\n}\n\nexport function childLayoutOrientation( parentLayout ) {\n\tconst { orientation = 'horizontal' } = parentLayout;\n\treturn orientation === 'horizontal' ? __( 'Width' ) : __( 'Height' );\n}\n\nfunction GridControls( {\n\tchildLayout,\n\tonChange,\n\tparentLayout,\n\tisShownByDefault,\n\tpanelId,\n} ) {\n\tconst { columnStart, rowStart, columnSpan, rowSpan } = childLayout;\n\tconst { columnCount = 3, rowCount } = parentLayout ?? {};\n\tconst rootClientId = useSelect( ( select ) =>\n\t\tselect( blockEditorStore ).getBlockRootClientId( panelId )\n\t);\n\tconst { moveBlocksToPosition, __unstableMarkNextChangeAsNotPersistent } =\n\t\tuseDispatch( blockEditorStore );\n\tconst getNumberOfBlocksBeforeCell = useGetNumberOfBlocksBeforeCell(\n\t\trootClientId,\n\t\tcolumnCount\n\t);\n\tconst hasStartValue = () => !! columnStart || !! rowStart;\n\tconst hasSpanValue = () => !! columnSpan || !! rowSpan;\n\tconst resetGridStarts = () => {\n\t\tonChange( {\n\t\t\tcolumnStart: undefined,\n\t\t\trowStart: undefined,\n\t\t} );\n\t};\n\tconst resetGridSpans = () => {\n\t\tonChange( {\n\t\t\tcolumnSpan: undefined,\n\t\t\trowSpan: undefined,\n\t\t} );\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<HStack\n\t\t\t\tas={ ToolsPanelItem }\n\t\t\t\thasValue={ hasSpanValue }\n\t\t\t\tlabel={ __( 'Grid span' ) }\n\t\t\t\tonDeselect={ resetGridSpans }\n\t\t\t\tisShownByDefault={ isShownByDefault }\n\t\t\t\tpanelId={ panelId }\n\t\t\t>\n\t\t\t\t<InputControl\n\t\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\t\tlabel={ __( 'Column span' ) }\n\t\t\t\t\ttype=\"number\"\n\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\t// Don't allow unsetting.\n\t\t\t\t\t\tconst newColumnSpan =\n\t\t\t\t\t\t\tvalue === '' ? 1 : parseInt( value, 10 );\n\t\t\t\t\t\tonChange( {\n\t\t\t\t\t\t\tcolumnStart,\n\t\t\t\t\t\t\trowStart,\n\t\t\t\t\t\t\trowSpan,\n\t\t\t\t\t\t\tcolumnSpan: newColumnSpan,\n\t\t\t\t\t\t} );\n\t\t\t\t\t} }\n\t\t\t\t\tvalue={ columnSpan ?? 1 }\n\t\t\t\t\tmin={ 1 }\n\t\t\t\t/>\n\t\t\t\t<InputControl\n\t\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\t\tlabel={ __( 'Row span' ) }\n\t\t\t\t\ttype=\"number\"\n\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\t// Don't allow unsetting.\n\t\t\t\t\t\tconst newRowSpan =\n\t\t\t\t\t\t\tvalue === '' ? 1 : parseInt( value, 10 );\n\t\t\t\t\t\tonChange( {\n\t\t\t\t\t\t\tcolumnStart,\n\t\t\t\t\t\t\trowStart,\n\t\t\t\t\t\t\tcolumnSpan,\n\t\t\t\t\t\t\trowSpan: newRowSpan,\n\t\t\t\t\t\t} );\n\t\t\t\t\t} }\n\t\t\t\t\tvalue={ rowSpan ?? 1 }\n\t\t\t\t\tmin={ 1 }\n\t\t\t\t/>\n\t\t\t</HStack>\n\t\t\t{ window.__experimentalEnableGridInteractivity && columnCount && (\n\t\t\t\t// Use Flex with an explicit width on the FlexItem instead of HStack to\n\t\t\t\t// work around an issue in webkit where inputs with a max attribute are\n\t\t\t\t// sized incorrectly.\n\t\t\t\t<Flex\n\t\t\t\t\tas={ ToolsPanelItem }\n\t\t\t\t\thasValue={ hasStartValue }\n\t\t\t\t\tlabel={ __( 'Grid placement' ) }\n\t\t\t\t\tonDeselect={ resetGridStarts }\n\t\t\t\t\tisShownByDefault={ false }\n\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t>\n\t\t\t\t\t<FlexItem style={ { width: '50%' } }>\n\t\t\t\t\t\t<InputControl\n\t\t\t\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\t\t\t\tlabel={ __( 'Column' ) }\n\t\t\t\t\t\t\ttype=\"number\"\n\t\t\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\t\t\t// Don't allow unsetting.\n\t\t\t\t\t\t\t\tconst newColumnStart =\n\t\t\t\t\t\t\t\t\tvalue === '' ? 1 : parseInt( value, 10 );\n\t\t\t\t\t\t\t\tonChange( {\n\t\t\t\t\t\t\t\t\tcolumnStart: newColumnStart,\n\t\t\t\t\t\t\t\t\trowStart,\n\t\t\t\t\t\t\t\t\tcolumnSpan,\n\t\t\t\t\t\t\t\t\trowSpan,\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\t\t\t\t\t\tmoveBlocksToPosition(\n\t\t\t\t\t\t\t\t\t[ panelId ],\n\t\t\t\t\t\t\t\t\trootClientId,\n\t\t\t\t\t\t\t\t\trootClientId,\n\t\t\t\t\t\t\t\t\tgetNumberOfBlocksBeforeCell(\n\t\t\t\t\t\t\t\t\t\tnewColumnStart,\n\t\t\t\t\t\t\t\t\t\trowStart\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\tvalue={ columnStart ?? 1 }\n\t\t\t\t\t\t\tmin={ 1 }\n\t\t\t\t\t\t\tmax={\n\t\t\t\t\t\t\t\tcolumnCount\n\t\t\t\t\t\t\t\t\t? columnCount - ( columnSpan ?? 1 ) + 1\n\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</FlexItem>\n\t\t\t\t\t<FlexItem style={ { width: '50%' } }>\n\t\t\t\t\t\t<InputControl\n\t\t\t\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\t\t\t\tlabel={ __( 'Row' ) }\n\t\t\t\t\t\t\ttype=\"number\"\n\t\t\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\t\t\t// Don't allow unsetting.\n\t\t\t\t\t\t\t\tconst newRowStart =\n\t\t\t\t\t\t\t\t\tvalue === '' ? 1 : parseInt( value, 10 );\n\t\t\t\t\t\t\t\tonChange( {\n\t\t\t\t\t\t\t\t\tcolumnStart,\n\t\t\t\t\t\t\t\t\trowStart: newRowStart,\n\t\t\t\t\t\t\t\t\tcolumnSpan,\n\t\t\t\t\t\t\t\t\trowSpan,\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\t\t\t\t\t\tmoveBlocksToPosition(\n\t\t\t\t\t\t\t\t\t[ panelId ],\n\t\t\t\t\t\t\t\t\trootClientId,\n\t\t\t\t\t\t\t\t\trootClientId,\n\t\t\t\t\t\t\t\t\tgetNumberOfBlocksBeforeCell(\n\t\t\t\t\t\t\t\t\t\tcolumnStart,\n\t\t\t\t\t\t\t\t\t\tnewRowStart\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\tvalue={ rowStart ?? 1 }\n\t\t\t\t\t\t\tmin={ 1 }\n\t\t\t\t\t\t\tmax={\n\t\t\t\t\t\t\t\trowCount\n\t\t\t\t\t\t\t\t\t? rowCount - ( rowSpan ?? 1 ) + 1\n\t\t\t\t\t\t\t\t\t: undefined\n\t\t\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AAG;UACvBiB,GAAG,EAAG,CAAG;UACTO,GAAG,EACFpB,QAAQ,GACLA,QAAQ,IAAKF,OAAO,aAAPA,OAAO,cAAPA,OAAO,GAAI,CAAC,CAAE,GAAG,CAAC,GAC/BjB;QACH,CACD;MAAC,CACO,CAAC;IAAA,CACN,CACN;EAAA,CACA,CAAC;AAEL","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["ToolbarButton","Dropdown","ToolbarGroup","SVG","Path","__","DOWN","deprecated","jsx","_jsx","ColorSelectorSVGIcon","xmlns","viewBox","children","d","ColorSelectorIcon","style","className","renderToggleComponent","TextColor","BackgroundColor","onToggle","isOpen","openOnArrowDown","event","keyCode","preventDefault","label","onClick","onKeyDown","icon","BlockColorsStyleSelector","other","alternative","since","version","popoverProps","placement","contentClassName","renderToggle","renderContent"],"sources":["@wordpress/block-editor/src/components/color-style-selector/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tToolbarButton,\n\tDropdown,\n\tToolbarGroup,\n\tSVG,\n\tPath,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { DOWN } from '@wordpress/keycodes';\nimport deprecated from '@wordpress/deprecated';\n\nconst ColorSelectorSVGIcon = () => (\n\t<SVG xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\">\n\t\t<Path d=\"M7.434 5l3.18 9.16H8.538l-.692-2.184H4.628l-.705 2.184H2L5.18 5h2.254zm-1.13 1.904h-.115l-1.148 3.593H7.44L6.304 6.904zM14.348 7.006c1.853 0 2.9.876 2.9 2.374v4.78h-1.79v-.914h-.114c-.362.64-1.123 1.022-2.031 1.022-1.346 0-2.292-.826-2.292-2.108 0-1.27.972-2.006 2.71-2.107l1.696-.102V9.38c0-.584-.42-.914-1.18-.914-.667 0-1.112.228-1.264.647h-1.701c.12-1.295 1.307-2.107 3.066-2.107zm1.079 4.1l-1.416.09c-.793.056-1.18.342-1.18.844 0 .52.45.837 1.091.837.857 0 1.505-.545 1.505-1.256v-.515z\" />\n\t</SVG>\n);\n\n/**\n * Color Selector Icon component.\n *\n * @param {Object} props Component properties.\n * @param {Object} props.style Style object.\n * @param {string} props.className Class name for component.\n *\n * @return {*} React Icon component.\n */\nconst ColorSelectorIcon = ( { style, className } ) => {\n\treturn (\n\t\t<div className=\"block-library-colors-selector__icon-container\">\n\t\t\t<div\n\t\t\t\tclassName={ `${ className } block-library-colors-selector__state-selection` }\n\t\t\t\tstyle={ style }\n\t\t\t>\n\t\t\t\t<ColorSelectorSVGIcon />\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n\n/**\n * Renders the Colors Selector Toolbar with the icon button.\n *\n * @param {Object} props Component properties.\n * @param {Object} props.TextColor Text color component that wraps icon.\n * @param {Object} props.BackgroundColor Background color component that wraps icon.\n *\n * @return {*} React toggle button component.\n */\nconst renderToggleComponent =\n\t( { TextColor, BackgroundColor } ) =>\n\t( { onToggle, isOpen } ) => {\n\t\tconst openOnArrowDown = ( event ) => {\n\t\t\tif ( ! isOpen && event.keyCode === DOWN ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tonToggle();\n\t\t\t}\n\t\t};\n\n\t\treturn (\n\t\t\t<ToolbarGroup>\n\t\t\t\t<ToolbarButton\n\t\t\t\t\tclassName=\"components-toolbar__control block-library-colors-selector__toggle\"\n\t\t\t\t\tlabel={ __( 'Open Colors Selector' ) }\n\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\tonKeyDown={ openOnArrowDown }\n\t\t\t\t\ticon={\n\t\t\t\t\t\t<BackgroundColor>\n\t\t\t\t\t\t\t<TextColor>\n\t\t\t\t\t\t\t\t<ColorSelectorIcon />\n\t\t\t\t\t\t\t</TextColor>\n\t\t\t\t\t\t</BackgroundColor>\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t</ToolbarGroup>\n\t\t);\n\t};\n\nconst BlockColorsStyleSelector = ( { children, ...other } ) => {\n\tdeprecated( `wp.blockEditor.BlockColorsStyleSelector`, {\n\t\talternative: 'block supports API',\n\t\tsince: '6.1',\n\t\tversion: '6.3',\n\t} );\n\n\treturn (\n\t\t<Dropdown\n\t\t\tpopoverProps={ { placement: 'bottom-start' } }\n\t\t\tclassName=\"block-library-colors-selector\"\n\t\t\tcontentClassName=\"block-library-colors-selector__popover\"\n\t\t\trenderToggle={ renderToggleComponent( other ) }\n\t\t\trenderContent={ () => children }\n\t\t/>\n\t);\n};\n\nexport default BlockColorsStyleSelector;\n"],"mappings":"AAAA;AACA;AACA;AACA,SACCA,aAAa,EACbC,QAAQ,EACRC,YAAY,EACZC,GAAG,EACHC,IAAI,QACE,uBAAuB;AAC9B,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,IAAI,QAAQ,qBAAqB;AAC1C,OAAOC,UAAU,MAAM,uBAAuB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE/C,MAAMC,oBAAoB,GAAGA,CAAA,kBAC5BD,IAAA,CAACN,GAAG;EAACQ,KAAK,EAAC,4BAA4B;EAACC,OAAO,EAAC,WAAW;EAAAC,QAAA,eAC1DJ,IAAA,CAACL,IAAI;IAACU,CAAC,EAAC;EAA6e,CAAE;AAAC,CACpf,CACL;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,iBAAiB,GAAGA,CAAE;EAAEC,KAAK;EAAEC;AAAU,CAAC,KAAM;EACrD,oBACCR,IAAA;IAAKQ,SAAS,EAAC,+CAA+C;IAAAJ,QAAA,eAC7DJ,IAAA;MACCQ,SAAS,EAAI,GAAGA,SAAW,iDAAkD;MAC7ED,KAAK,EAAGA,KAAO;MAAAH,QAAA,eAEfJ,IAAA,CAACC,oBAAoB,IAAE;IAAC,CACpB;EAAC,CACF,CAAC;AAER,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMQ,qBAAqB,GAC1BA,CAAE;EAAEC,SAAS;EAAEC;AAAgB,CAAC,KAChC,CAAE;EAAEC,QAAQ;EAAEC;AAAO,CAAC,KAAM;EAC3B,MAAMC,eAAe,GAAKC,KAAK,IAAM;IACpC,IAAK,CAAEF,MAAM,IAAIE,KAAK,CAACC,OAAO,KAAKnB,IAAI,EAAG;MACzCkB,KAAK,CAACE,cAAc,CAAC,CAAC;MACtBL,QAAQ,CAAC,CAAC;IACX;EACD,CAAC;EAED,oBACCZ,IAAA,CAACP,YAAY;IAAAW,QAAA,eACZJ,IAAA,CAACT,aAAa;MACbiB,SAAS,EAAC,mEAAmE;MAC7EU,KAAK,EAAGtB,EAAE,CAAE,sBAAuB,CAAG;MACtCuB,OAAO,EAAGP,QAAU;MACpBQ,SAAS,EAAGN,eAAiB;MAC7BO,IAAI,eACHrB,IAAA,CAACW,eAAe;QAAAP,QAAA,eACfJ,IAAA,CAACU,SAAS;UAAAN,QAAA,eACTJ,IAAA,CAACM,iBAAiB,IAAE;QAAC,CACX;MAAC,CACI;IACjB,CACD;EAAC,CACW,CAAC;AAEjB,CAAC;AAEF,MAAMgB,wBAAwB,GAAGA,CAAE;EAAElB,QAAQ;EAAE,GAAGmB;AAAM,CAAC,KAAM;EAC9DzB,UAAU,CAAG,yCAAwC,EAAE;IACtD0B,WAAW,EAAE,oBAAoB;IACjCC,KAAK,EAAE,KAAK;IACZC,OAAO,EAAE;EACV,CAAE,CAAC;EAEH,oBACC1B,IAAA,CAACR,QAAQ;IACRmC,YAAY,EAAG;MAAEC,SAAS,EAAE;IAAe,CAAG;IAC9CpB,SAAS,EAAC,+BAA+B;IACzCqB,gBAAgB,EAAC,wCAAwC;IACzDC,YAAY,EAAGrB,qBAAqB,CAAEc,KAAM,CAAG;IAC/CQ,aAAa,EAAGA,CAAA,KAAM3B;EAAU,CAChC,CAAC;AAEJ,CAAC;AAED,eAAekB,wBAAwB","ignoreList":[]}
1
+ {"version":3,"names":["ToolbarButton","Dropdown","ToolbarGroup","SVG","Path","__","DOWN","deprecated","jsx","_jsx","ColorSelectorSVGIcon","xmlns","viewBox","children","d","ColorSelectorIcon","style","className","renderToggleComponent","TextColor","BackgroundColor","onToggle","isOpen","openOnArrowDown","event","keyCode","preventDefault","label","onClick","onKeyDown","icon","BlockColorsStyleSelector","other","alternative","since","version","popoverProps","placement","contentClassName","renderToggle","renderContent"],"sources":["@wordpress/block-editor/src/components/color-style-selector/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tToolbarButton,\n\tDropdown,\n\tToolbarGroup,\n\tSVG,\n\tPath,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { DOWN } from '@wordpress/keycodes';\nimport deprecated from '@wordpress/deprecated';\n\nconst ColorSelectorSVGIcon = () => (\n\t<SVG xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\">\n\t\t<Path d=\"M7.434 5l3.18 9.16H8.538l-.692-2.184H4.628l-.705 2.184H2L5.18 5h2.254zm-1.13 1.904h-.115l-1.148 3.593H7.44L6.304 6.904zM14.348 7.006c1.853 0 2.9.876 2.9 2.374v4.78h-1.79v-.914h-.114c-.362.64-1.123 1.022-2.031 1.022-1.346 0-2.292-.826-2.292-2.108 0-1.27.972-2.006 2.71-2.107l1.696-.102V9.38c0-.584-.42-.914-1.18-.914-.667 0-1.112.228-1.264.647h-1.701c.12-1.295 1.307-2.107 3.066-2.107zm1.079 4.1l-1.416.09c-.793.056-1.18.342-1.18.844 0 .52.45.837 1.091.837.857 0 1.505-.545 1.505-1.256v-.515z\" />\n\t</SVG>\n);\n\n/**\n * Color Selector Icon component.\n *\n * @param {Object} props Component properties.\n * @param {Object} props.style Style object.\n * @param {string} props.className Class name for component.\n *\n * @return {*} React Icon component.\n */\nconst ColorSelectorIcon = ( { style, className } ) => {\n\treturn (\n\t\t<div className=\"block-library-colors-selector__icon-container\">\n\t\t\t<div\n\t\t\t\tclassName={ `${ className } block-library-colors-selector__state-selection` }\n\t\t\t\tstyle={ style }\n\t\t\t>\n\t\t\t\t<ColorSelectorSVGIcon />\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n\n/**\n * Renders the Colors Selector Toolbar with the icon button.\n *\n * @param {Object} props Component properties.\n * @param {Object} props.TextColor Text color component that wraps icon.\n * @param {Object} props.BackgroundColor Background color component that wraps icon.\n *\n * @return {*} React toggle button component.\n */\nconst renderToggleComponent =\n\t( { TextColor, BackgroundColor } ) =>\n\t( { onToggle, isOpen } ) => {\n\t\tconst openOnArrowDown = ( event ) => {\n\t\t\tif ( ! isOpen && event.keyCode === DOWN ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tonToggle();\n\t\t\t}\n\t\t};\n\n\t\treturn (\n\t\t\t<ToolbarGroup>\n\t\t\t\t<ToolbarButton\n\t\t\t\t\tclassName=\"components-toolbar__control block-library-colors-selector__toggle\"\n\t\t\t\t\tlabel={ __( 'Open Colors Selector' ) }\n\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\tonKeyDown={ openOnArrowDown }\n\t\t\t\t\ticon={\n\t\t\t\t\t\t<BackgroundColor>\n\t\t\t\t\t\t\t<TextColor>\n\t\t\t\t\t\t\t\t<ColorSelectorIcon />\n\t\t\t\t\t\t\t</TextColor>\n\t\t\t\t\t\t</BackgroundColor>\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t</ToolbarGroup>\n\t\t);\n\t};\n\nconst BlockColorsStyleSelector = ( { children, ...other } ) => {\n\tdeprecated( `wp.blockEditor.BlockColorsStyleSelector`, {\n\t\talternative: 'block supports API',\n\t\tsince: '6.1',\n\t\tversion: '6.3',\n\t} );\n\n\treturn (\n\t\t<Dropdown\n\t\t\tpopoverProps={ { placement: 'bottom-start' } }\n\t\t\tclassName=\"block-library-colors-selector\"\n\t\t\tcontentClassName=\"block-library-colors-selector__popover\"\n\t\t\trenderToggle={ renderToggleComponent( other ) }\n\t\t\trenderContent={ () => children }\n\t\t/>\n\t);\n};\n\nexport default BlockColorsStyleSelector;\n"],"mappings":"AAAA;AACA;AACA;AACA,SACCA,aAAa,EACbC,QAAQ,EACRC,YAAY,EACZC,GAAG,EACHC,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AGP,QAAU;MACpBQ,SAAS,EAAGN,eAAiB;MAC7BO,IAAI,eACHrB,IAAA,CAACW,eAAe;QAAAP,QAAA,eACfJ,IAAA,CAACU,SAAS;UAAAN,QAAA,eACTJ,IAAA,CAACM,iBAAiB,IAAE;QAAC,CACX;MAAC,CACI;IACjB,CACD;EAAC,CACW,CAAC;AAEjB,CAAC;AAEF,MAAMgB,wBAAwB,GAAGA,CAAE;EAAElB,QAAQ;EAAE,GAAGmB;AAAM,CAAC,KAAM;EAC9DzB,UAAU,CAAE,yCAAyC,EAAE;IACtD0B,WAAW,EAAE,oBAAoB;IACjCC,KAAK,EAAE,KAAK;IACZC,OAAO,EAAE;EACV,CAAE,CAAC;EAEH,oBACC1B,IAAA,CAACR,QAAQ;IACRmC,YAAY,EAAG;MAAEC,SAAS,EAAE;IAAe,CAAG;IAC9CpB,SAAS,EAAC,+BAA+B;IACzCqB,gBAAgB,EAAC,wCAAwC;IACzDC,YAAY,EAAGrB,qBAAqB,CAAEc,KAAM,CAAG;IAC/CQ,aAAa,EAAGA,CAAA,KAAM3B;EAAU,CAChC,CAAC;AAEJ,CAAC;AAED,eAAekB,wBAAwB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["colord","extend","namesPlugin","a11yPlugin","privateApis","componentsPrivateApis","unlock","kebabCase","getColorObjectByAttributeValues","colors","definedColor","customColor","colorObj","find","color","slug","getColorObjectByColorValue","colorValue","getColorClassName","colorContextName","colorSlug","undefined","getMostReadableColor","colordColor","getColorContrast","contrast","maxContrast","Math","max","map"],"sources":["@wordpress/block-editor/src/components/colors/utils.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { colord, extend } from 'colord';\nimport namesPlugin from 'colord/plugins/names';\nimport a11yPlugin from 'colord/plugins/a11y';\n\n/**\n * WordPress dependencies\n */\nimport { privateApis as componentsPrivateApis } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nextend( [ namesPlugin, a11yPlugin ] );\n\nconst { kebabCase } = unlock( componentsPrivateApis );\n\n/**\n * Provided an array of color objects as set by the theme or by the editor defaults,\n * and the values of the defined color or custom color returns a color object describing the color.\n *\n * @param {Array} colors Array of color objects as set by the theme or by the editor defaults.\n * @param {?string} definedColor A string containing the color slug.\n * @param {?string} customColor A string containing the customColor value.\n *\n * @return {?Object} If definedColor is passed and the name is found in colors,\n * the color object exactly as set by the theme or editor defaults is returned.\n * Otherwise, an object that just sets the color is defined.\n */\nexport const getColorObjectByAttributeValues = (\n\tcolors,\n\tdefinedColor,\n\tcustomColor\n) => {\n\tif ( definedColor ) {\n\t\tconst colorObj = colors?.find(\n\t\t\t( color ) => color.slug === definedColor\n\t\t);\n\n\t\tif ( colorObj ) {\n\t\t\treturn colorObj;\n\t\t}\n\t}\n\treturn {\n\t\tcolor: customColor,\n\t};\n};\n\n/**\n * Provided an array of color objects as set by the theme or by the editor defaults, and a color value returns the color object matching that value or undefined.\n *\n * @param {Array} colors Array of color objects as set by the theme or by the editor defaults.\n * @param {?string} colorValue A string containing the color value.\n *\n * @return {?Object} Color object included in the colors array whose color property equals colorValue.\n * Returns undefined if no color object matches this requirement.\n */\nexport const getColorObjectByColorValue = ( colors, colorValue ) => {\n\treturn colors?.find( ( color ) => color.color === colorValue );\n};\n\n/**\n * Returns a class based on the context a color is being used and its slug.\n *\n * @param {string} colorContextName Context/place where color is being used e.g: background, text etc...\n * @param {string} colorSlug Slug of the color.\n *\n * @return {?string} String with the class corresponding to the color in the provided context.\n * Returns undefined if either colorContextName or colorSlug are not provided.\n */\nexport function getColorClassName( colorContextName, colorSlug ) {\n\tif ( ! colorContextName || ! colorSlug ) {\n\t\treturn undefined;\n\t}\n\n\treturn `has-${ kebabCase( colorSlug ) }-${ colorContextName }`;\n}\n\n/**\n * Given an array of color objects and a color value returns the color value of the most readable color in the array.\n *\n * @param {Array} colors Array of color objects as set by the theme or by the editor defaults.\n * @param {?string} colorValue A string containing the color value.\n *\n * @return {string} String with the color value of the most readable color.\n */\nexport function getMostReadableColor( colors, colorValue ) {\n\tconst colordColor = colord( colorValue );\n\tconst getColorContrast = ( { color } ) => colordColor.contrast( color );\n\n\tconst maxContrast = Math.max( ...colors.map( getColorContrast ) );\n\treturn colors.find( ( color ) => getColorContrast( color ) === maxContrast )\n\t\t.color;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,MAAM,EAAEC,MAAM,QAAQ,QAAQ;AACvC,OAAOC,WAAW,MAAM,sBAAsB;AAC9C,OAAOC,UAAU,MAAM,qBAAqB;;AAE5C;AACA;AACA;AACA,SAASC,WAAW,IAAIC,qBAAqB,QAAQ,uBAAuB;;AAE5E;AACA;AACA;AACA,SAASC,MAAM,QAAQ,mBAAmB;AAE1CL,MAAM,CAAE,CAAEC,WAAW,EAAEC,UAAU,CAAG,CAAC;AAErC,MAAM;EAAEI;AAAU,CAAC,GAAGD,MAAM,CAAED,qBAAsB,CAAC;;AAErD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMG,+BAA+B,GAAGA,CAC9CC,MAAM,EACNC,YAAY,EACZC,WAAW,KACP;EACJ,IAAKD,YAAY,EAAG;IACnB,MAAME,QAAQ,GAAGH,MAAM,EAAEI,IAAI,CAC1BC,KAAK,IAAMA,KAAK,CAACC,IAAI,KAAKL,YAC7B,CAAC;IAED,IAAKE,QAAQ,EAAG;MACf,OAAOA,QAAQ;IAChB;EACD;EACA,OAAO;IACNE,KAAK,EAAEH;EACR,CAAC;AACF,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMK,0BAA0B,GAAGA,CAAEP,MAAM,EAAEQ,UAAU,KAAM;EACnE,OAAOR,MAAM,EAAEI,IAAI,CAAIC,KAAK,IAAMA,KAAK,CAACA,KAAK,KAAKG,UAAW,CAAC;AAC/D,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,iBAAiBA,CAAEC,gBAAgB,EAAEC,SAAS,EAAG;EAChE,IAAK,CAAED,gBAAgB,IAAI,CAAEC,SAAS,EAAG;IACxC,OAAOC,SAAS;EACjB;EAEA,OAAQ,OAAOd,SAAS,CAAEa,SAAU,CAAG,IAAID,gBAAkB,EAAC;AAC/D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASG,oBAAoBA,CAAEb,MAAM,EAAEQ,UAAU,EAAG;EAC1D,MAAMM,WAAW,GAAGvB,MAAM,CAAEiB,UAAW,CAAC;EACxC,MAAMO,gBAAgB,GAAGA,CAAE;IAAEV;EAAM,CAAC,KAAMS,WAAW,CAACE,QAAQ,CAAEX,KAAM,CAAC;EAEvE,MAAMY,WAAW,GAAGC,IAAI,CAACC,GAAG,CAAE,GAAGnB,MAAM,CAACoB,GAAG,CAAEL,gBAAiB,CAAE,CAAC;EACjE,OAAOf,MAAM,CAACI,IAAI,CAAIC,KAAK,IAAMU,gBAAgB,CAAEV,KAAM,CAAC,KAAKY,WAAY,CAAC,CAC1EZ,KAAK;AACR","ignoreList":[]}
1
+ {"version":3,"names":["colord","extend","namesPlugin","a11yPlugin","privateApis","componentsPrivateApis","unlock","kebabCase","getColorObjectByAttributeValues","colors","definedColor","customColor","colorObj","find","color","slug","getColorObjectByColorValue","colorValue","getColorClassName","colorContextName","colorSlug","undefined","getMostReadableColor","colordColor","getColorContrast","contrast","maxContrast","Math","max","map"],"sources":["@wordpress/block-editor/src/components/colors/utils.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { colord, extend } from 'colord';\nimport namesPlugin from 'colord/plugins/names';\nimport a11yPlugin from 'colord/plugins/a11y';\n\n/**\n * WordPress dependencies\n */\nimport { privateApis as componentsPrivateApis } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nextend( [ namesPlugin, a11yPlugin ] );\n\nconst { kebabCase } = unlock( componentsPrivateApis );\n\n/**\n * Provided an array of color objects as set by the theme or by the editor defaults,\n * and the values of the defined color or custom color returns a color object describing the color.\n *\n * @param {Array} colors Array of color objects as set by the theme or by the editor defaults.\n * @param {?string} definedColor A string containing the color slug.\n * @param {?string} customColor A string containing the customColor value.\n *\n * @return {?Object} If definedColor is passed and the name is found in colors,\n * the color object exactly as set by the theme or editor defaults is returned.\n * Otherwise, an object that just sets the color is defined.\n */\nexport const getColorObjectByAttributeValues = (\n\tcolors,\n\tdefinedColor,\n\tcustomColor\n) => {\n\tif ( definedColor ) {\n\t\tconst colorObj = colors?.find(\n\t\t\t( color ) => color.slug === definedColor\n\t\t);\n\n\t\tif ( colorObj ) {\n\t\t\treturn colorObj;\n\t\t}\n\t}\n\treturn {\n\t\tcolor: customColor,\n\t};\n};\n\n/**\n * Provided an array of color objects as set by the theme or by the editor defaults, and a color value returns the color object matching that value or undefined.\n *\n * @param {Array} colors Array of color objects as set by the theme or by the editor defaults.\n * @param {?string} colorValue A string containing the color value.\n *\n * @return {?Object} Color object included in the colors array whose color property equals colorValue.\n * Returns undefined if no color object matches this requirement.\n */\nexport const getColorObjectByColorValue = ( colors, colorValue ) => {\n\treturn colors?.find( ( color ) => color.color === colorValue );\n};\n\n/**\n * Returns a class based on the context a color is being used and its slug.\n *\n * @param {string} colorContextName Context/place where color is being used e.g: background, text etc...\n * @param {string} colorSlug Slug of the color.\n *\n * @return {?string} String with the class corresponding to the color in the provided context.\n * Returns undefined if either colorContextName or colorSlug are not provided.\n */\nexport function getColorClassName( colorContextName, colorSlug ) {\n\tif ( ! colorContextName || ! colorSlug ) {\n\t\treturn undefined;\n\t}\n\n\treturn `has-${ kebabCase( colorSlug ) }-${ colorContextName }`;\n}\n\n/**\n * Given an array of color objects and a color value returns the color value of the most readable color in the array.\n *\n * @param {Array} colors Array of color objects as set by the theme or by the editor defaults.\n * @param {?string} colorValue A string containing the color value.\n *\n * @return {string} String with the color value of the most readable color.\n */\nexport function getMostReadableColor( colors, colorValue ) {\n\tconst colordColor = colord( colorValue );\n\tconst getColorContrast = ( { color } ) => colordColor.contrast( color );\n\n\tconst maxContrast = Math.max( ...colors.map( getColorContrast ) );\n\treturn colors.find( ( color ) => getColorContrast( color ) === maxContrast )\n\t\t.color;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,MAAM,EAAEC,MAAM,QAAQ,QAAQ;AACvC,OAAOC,WAAW,MAAM,sBAAsB;AAC9C,OAAOC,UAAU,MAAM,qBAAqB;;AAE5C;AACA;AACA;AACA,SAASC,WAAW,IAAIC,qBAAqB,QAAQ,uBAAuB;;AAE5E;AACA;AACA;AACA,SAASC,MAAM,QAAQ,mBAAmB;AAE1CL,MAAM,CAAE,CAAEC,WAAW,EAAEC,UAAU,CAAG,CAAC;AAErC,MAAM;EAAEI;AAAU,CAAC,GAAGD,MAAM,CAAED,qBAAsB,CAAC;;AAErD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMG,+BAA+B,GAAGA,CAC9CC,MAAM,EACNC,YAAY,EACZC,WAAW,KACP;EACJ,IAAKD,YAAY,EAAG;IACnB,MAAME,QAAQ,GAAGH,MAAM,EAAEI,IAAI,CAC1BC,KAAK,IAAMA,KAAK,CAACC,IAAI,KAAKL,YAC7B,CAAC;IAED,IAAKE,QAAQ,EAAG;MACf,OAAOA,QAAQ;IAChB;EACD;EACA,OAAO;IACNE,KAAK,EAAEH;EACR,CAAC;AACF,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMK,0BAA0B,GAAGA,CAAEP,MAAM,EAAEQ,UAAU,KAAM;EACnE,OAAOR,MAAM,EAAEI,IAAI,CAAIC,KAAK,IAAMA,KAAK,CAACA,KAAK,KAAKG,UAAW,CAAC;AAC/D,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,iBAAiBA,CAAEC,gBAAgB,EAAEC,SAAS,EAAG;EAChE,IAAK,CAAED,gBAAgB,IAAI,CAAEC,SAAS,EAAG;IACxC,OAAOC,SAAS;EACjB;EAEA,OAAO,OAAQd,SAAS,CAAEa,SAAU,CAAC,IAAMD,gBAAgB,EAAG;AAC/D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASG,oBAAoBA,CAAEb,MAAM,EAAEQ,UAAU,EAAG;EAC1D,MAAMM,WAAW,GAAGvB,MAAM,CAAEiB,UAAW,CAAC;EACxC,MAAMO,gBAAgB,GAAGA,CAAE;IAAEV;EAAM,CAAC,KAAMS,WAAW,CAACE,QAAQ,CAAEX,KAAM,CAAC;EAEvE,MAAMY,WAAW,GAAGC,IAAI,CAACC,GAAG,CAAE,GAAGnB,MAAM,CAACoB,GAAG,CAAEL,gBAAiB,CAAE,CAAC;EACjE,OAAOf,MAAM,CAACI,IAAI,CAAIC,KAAK,IAAMU,gBAAgB,CAAEV,KAAM,CAAC,KAAKY,WAAY,CAAC,CAC1EZ,KAAK;AACR","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["useMemo","Component","compose","createHigherOrderComponent","privateApis","componentsPrivateApis","getColorClassName","getColorObjectByColorValue","getColorObjectByAttributeValues","getMostReadableColor","useSettings","unlock","jsx","_jsx","kebabCase","upperFirst","firstLetter","rest","toUpperCase","join","withCustomColorPalette","colorsArray","WrappedComponent","props","colors","withEditorColorPalette","userPalette","themePalette","defaultPalette","allColors","createColorHOC","colorTypes","withColorPalette","colorMap","reduce","colorObject","colorType","constructor","setters","createSetters","colorUtils","bind","state","colorValue","Object","keys","settersAccumulator","colorAttributeName","upperFirstColorAttributeName","customColorAttributeName","createSetColor","setAttributes","slug","undefined","getDerivedStateFromProps","attributes","previousState","entries","newState","colorContext","previousColorObject","previousColor","color","class","render","createCustomColorsHOC","withColors"],"sources":["@wordpress/block-editor/src/components/colors/with-colors.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo, Component } from '@wordpress/element';\nimport { compose, createHigherOrderComponent } from '@wordpress/compose';\nimport { privateApis as componentsPrivateApis } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport {\n\tgetColorClassName,\n\tgetColorObjectByColorValue,\n\tgetColorObjectByAttributeValues,\n\tgetMostReadableColor,\n} from './utils';\nimport { useSettings } from '../use-settings';\nimport { unlock } from '../../lock-unlock';\n\nconst { kebabCase } = unlock( componentsPrivateApis );\n\n/**\n * Capitalizes the first letter in a string.\n *\n * @param {string} str The string whose first letter the function will capitalize.\n *\n * @return {string} Capitalized string.\n */\nconst upperFirst = ( [ firstLetter, ...rest ] ) =>\n\tfirstLetter.toUpperCase() + rest.join( '' );\n\n/**\n * Higher order component factory for injecting the `colorsArray` argument as\n * the colors prop in the `withCustomColors` HOC.\n *\n * @param {Array} colorsArray An array of color objects.\n *\n * @return {Function} The higher order component.\n */\nconst withCustomColorPalette = ( colorsArray ) =>\n\tcreateHigherOrderComponent(\n\t\t( WrappedComponent ) => ( props ) => (\n\t\t\t<WrappedComponent { ...props } colors={ colorsArray } />\n\t\t),\n\t\t'withCustomColorPalette'\n\t);\n\n/**\n * Higher order component factory for injecting the editor colors as the\n * `colors` prop in the `withColors` HOC.\n *\n * @return {Function} The higher order component.\n */\nconst withEditorColorPalette = () =>\n\tcreateHigherOrderComponent(\n\t\t( WrappedComponent ) => ( props ) => {\n\t\t\tconst [ userPalette, themePalette, defaultPalette ] = useSettings(\n\t\t\t\t'color.palette.custom',\n\t\t\t\t'color.palette.theme',\n\t\t\t\t'color.palette.default'\n\t\t\t);\n\t\t\tconst allColors = useMemo(\n\t\t\t\t() => [\n\t\t\t\t\t...( userPalette || [] ),\n\t\t\t\t\t...( themePalette || [] ),\n\t\t\t\t\t...( defaultPalette || [] ),\n\t\t\t\t],\n\t\t\t\t[ userPalette, themePalette, defaultPalette ]\n\t\t\t);\n\t\t\treturn <WrappedComponent { ...props } colors={ allColors } />;\n\t\t},\n\t\t'withEditorColorPalette'\n\t);\n\n/**\n * Helper function used with `createHigherOrderComponent` to create\n * higher order components for managing color logic.\n *\n * @param {Array} colorTypes An array of color types (e.g. 'backgroundColor, borderColor).\n * @param {Function} withColorPalette A HOC for injecting the 'colors' prop into the WrappedComponent.\n *\n * @return {Component} The component that can be used as a HOC.\n */\nfunction createColorHOC( colorTypes, withColorPalette ) {\n\tconst colorMap = colorTypes.reduce( ( colorObject, colorType ) => {\n\t\treturn {\n\t\t\t...colorObject,\n\t\t\t...( typeof colorType === 'string'\n\t\t\t\t? { [ colorType ]: kebabCase( colorType ) }\n\t\t\t\t: colorType ),\n\t\t};\n\t}, {} );\n\n\treturn compose( [\n\t\twithColorPalette,\n\t\t( WrappedComponent ) => {\n\t\t\treturn class extends Component {\n\t\t\t\tconstructor( props ) {\n\t\t\t\t\tsuper( props );\n\n\t\t\t\t\tthis.setters = this.createSetters();\n\t\t\t\t\tthis.colorUtils = {\n\t\t\t\t\t\tgetMostReadableColor:\n\t\t\t\t\t\t\tthis.getMostReadableColor.bind( this ),\n\t\t\t\t\t};\n\n\t\t\t\t\tthis.state = {};\n\t\t\t\t}\n\n\t\t\t\tgetMostReadableColor( colorValue ) {\n\t\t\t\t\tconst { colors } = this.props;\n\t\t\t\t\treturn getMostReadableColor( colors, colorValue );\n\t\t\t\t}\n\n\t\t\t\tcreateSetters() {\n\t\t\t\t\treturn Object.keys( colorMap ).reduce(\n\t\t\t\t\t\t( settersAccumulator, colorAttributeName ) => {\n\t\t\t\t\t\t\tconst upperFirstColorAttributeName =\n\t\t\t\t\t\t\t\tupperFirst( colorAttributeName );\n\t\t\t\t\t\t\tconst customColorAttributeName = `custom${ upperFirstColorAttributeName }`;\n\t\t\t\t\t\t\tsettersAccumulator[\n\t\t\t\t\t\t\t\t`set${ upperFirstColorAttributeName }`\n\t\t\t\t\t\t\t] = this.createSetColor(\n\t\t\t\t\t\t\t\tcolorAttributeName,\n\t\t\t\t\t\t\t\tcustomColorAttributeName\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\treturn settersAccumulator;\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{}\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tcreateSetColor( colorAttributeName, customColorAttributeName ) {\n\t\t\t\t\treturn ( colorValue ) => {\n\t\t\t\t\t\tconst colorObject = getColorObjectByColorValue(\n\t\t\t\t\t\t\tthis.props.colors,\n\t\t\t\t\t\t\tcolorValue\n\t\t\t\t\t\t);\n\t\t\t\t\t\tthis.props.setAttributes( {\n\t\t\t\t\t\t\t[ colorAttributeName ]:\n\t\t\t\t\t\t\t\tcolorObject && colorObject.slug\n\t\t\t\t\t\t\t\t\t? colorObject.slug\n\t\t\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t\t\t[ customColorAttributeName ]:\n\t\t\t\t\t\t\t\tcolorObject && colorObject.slug\n\t\t\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t\t\t: colorValue,\n\t\t\t\t\t\t} );\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tstatic getDerivedStateFromProps(\n\t\t\t\t\t{ attributes, colors },\n\t\t\t\t\tpreviousState\n\t\t\t\t) {\n\t\t\t\t\treturn Object.entries( colorMap ).reduce(\n\t\t\t\t\t\t( newState, [ colorAttributeName, colorContext ] ) => {\n\t\t\t\t\t\t\tconst colorObject = getColorObjectByAttributeValues(\n\t\t\t\t\t\t\t\tcolors,\n\t\t\t\t\t\t\t\tattributes[ colorAttributeName ],\n\t\t\t\t\t\t\t\tattributes[\n\t\t\t\t\t\t\t\t\t`custom${ upperFirst(\n\t\t\t\t\t\t\t\t\t\tcolorAttributeName\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\n\t\t\t\t\t\t\tconst previousColorObject =\n\t\t\t\t\t\t\t\tpreviousState[ colorAttributeName ];\n\t\t\t\t\t\t\tconst previousColor = previousColorObject?.color;\n\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t * The \"and previousColorObject\" condition checks that a previous color object was already computed.\n\t\t\t\t\t\t\t * At the start previousColorObject and colorValue are both equal to undefined\n\t\t\t\t\t\t\t * bus as previousColorObject does not exist we should compute the object.\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\tpreviousColor === colorObject.color &&\n\t\t\t\t\t\t\t\tpreviousColorObject\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tnewState[ colorAttributeName ] =\n\t\t\t\t\t\t\t\t\tpreviousColorObject;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tnewState[ colorAttributeName ] = {\n\t\t\t\t\t\t\t\t\t...colorObject,\n\t\t\t\t\t\t\t\t\tclass: getColorClassName(\n\t\t\t\t\t\t\t\t\t\tcolorContext,\n\t\t\t\t\t\t\t\t\t\tcolorObject.slug\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\treturn newState;\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{}\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\trender() {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<WrappedComponent\n\t\t\t\t\t\t\t{ ...{\n\t\t\t\t\t\t\t\t...this.props,\n\t\t\t\t\t\t\t\tcolors: undefined,\n\t\t\t\t\t\t\t\t...this.state,\n\t\t\t\t\t\t\t\t...this.setters,\n\t\t\t\t\t\t\t\tcolorUtils: this.colorUtils,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t};\n\t\t},\n\t] );\n}\n\n/**\n * A higher-order component factory for creating a 'withCustomColors' HOC, which handles color logic\n * for class generation color value, retrieval and color attribute setting.\n *\n * Use this higher-order component to work with a custom set of colors.\n *\n * @example\n *\n * ```jsx\n * const CUSTOM_COLORS = [ { name: 'Red', slug: 'red', color: '#ff0000' }, { name: 'Blue', slug: 'blue', color: '#0000ff' } ];\n * const withCustomColors = createCustomColorsHOC( CUSTOM_COLORS );\n * // ...\n * export default compose(\n * withCustomColors( 'backgroundColor', 'borderColor' ),\n * MyColorfulComponent,\n * );\n * ```\n *\n * @param {Array} colorsArray The array of color objects (name, slug, color, etc... ).\n *\n * @return {Function} Higher-order component.\n */\nexport function createCustomColorsHOC( colorsArray ) {\n\treturn ( ...colorTypes ) => {\n\t\tconst withColorPalette = withCustomColorPalette( colorsArray );\n\t\treturn createHigherOrderComponent(\n\t\t\tcreateColorHOC( colorTypes, withColorPalette ),\n\t\t\t'withCustomColors'\n\t\t);\n\t};\n}\n\n/**\n * A higher-order component, which handles color logic for class generation color value, retrieval and color attribute setting.\n *\n * For use with the default editor/theme color palette.\n *\n * @example\n *\n * ```jsx\n * export default compose(\n * withColors( 'backgroundColor', { textColor: 'color' } ),\n * MyColorfulComponent,\n * );\n * ```\n *\n * @param {...(Object|string)} colorTypes The arguments can be strings or objects. If the argument is an object,\n * it should contain the color attribute name as key and the color context as value.\n * If the argument is a string the value should be the color attribute name,\n * the color context is computed by applying a kebab case transform to the value.\n * Color context represents the context/place where the color is going to be used.\n * The class name of the color is generated using 'has' followed by the color name\n * and ending with the color context all in kebab case e.g: has-green-background-color.\n *\n * @return {Function} Higher-order component.\n */\nexport default function withColors( ...colorTypes ) {\n\tconst withColorPalette = withEditorColorPalette();\n\treturn createHigherOrderComponent(\n\t\tcreateColorHOC( colorTypes, withColorPalette ),\n\t\t'withColors'\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,OAAO,EAAEC,SAAS,QAAQ,oBAAoB;AACvD,SAASC,OAAO,EAAEC,0BAA0B,QAAQ,oBAAoB;AACxE,SAASC,WAAW,IAAIC,qBAAqB,QAAQ,uBAAuB;;AAE5E;AACA;AACA;AACA,SACCC,iBAAiB,EACjBC,0BAA0B,EAC1BC,+BAA+B,EAC/BC,oBAAoB,QACd,SAAS;AAChB,SAASC,WAAW,QAAQ,iBAAiB;AAC7C,SAASC,MAAM,QAAQ,mBAAmB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;MACF;MAEAM,MAAMA,CAAA,EAAG;QACR,oBACCnD,IAAA,CAACS,gBAAgB;UAEf,GAAG,IAAI,CAACC,KAAK;UACbC,MAAM,EAAE6B,SAAS;UACjB,GAAG,IAAI,CAACX,KAAK;UACb,GAAG,IAAI,CAACJ,OAAO;UACfE,UAAU,EAAE,IAAI,CAACA;QAAU,CAE5B,CAAC;MAEJ;IACD,CAAC;EACF,CAAC,CACA,CAAC;AACJ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASyB,qBAAqBA,CAAE5C,WAAW,EAAG;EACpD,OAAO,CAAE,GAAGU,UAAU,KAAM;IAC3B,MAAMC,gBAAgB,GAAGZ,sBAAsB,CAAEC,WAAY,CAAC;IAC9D,OAAOlB,0BAA0B,CAChC2B,cAAc,CAAEC,UAAU,EAAEC,gBAAiB,CAAC,EAC9C,kBACD,CAAC;EACF,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASkC,UAAUA,CAAE,GAAGnC,UAAU,EAAG;EACnD,MAAMC,gBAAgB,GAAGP,sBAAsB,CAAC,CAAC;EACjD,OAAOtB,0BAA0B,CAChC2B,cAAc,CAAEC,UAAU,EAAEC,gBAAiB,CAAC,EAC9C,YACD,CAAC;AACF","ignoreList":[]}
1
+ {"version":3,"names":["useMemo","Component","compose","createHigherOrderComponent","privateApis","componentsPrivateApis","getColorClassName","getColorObjectByColorValue","getColorObjectByAttributeValues","getMostReadableColor","useSettings","unlock","jsx","_jsx","kebabCase","upperFirst","firstLetter","rest","toUpperCase","join","withCustomColorPalette","colorsArray","WrappedComponent","props","colors","withEditorColorPalette","userPalette","themePalette","defaultPalette","allColors","createColorHOC","colorTypes","withColorPalette","colorMap","reduce","colorObject","colorType","constructor","setters","createSetters","colorUtils","bind","state","colorValue","Object","keys","settersAccumulator","colorAttributeName","upperFirstColorAttributeName","customColorAttributeName","createSetColor","setAttributes","slug","undefined","getDerivedStateFromProps","attributes","previousState","entries","newState","colorContext","previousColorObject","previousColor","color","class","render","createCustomColorsHOC","withColors"],"sources":["@wordpress/block-editor/src/components/colors/with-colors.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo, Component } from '@wordpress/element';\nimport { compose, createHigherOrderComponent } from '@wordpress/compose';\nimport { privateApis as componentsPrivateApis } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport {\n\tgetColorClassName,\n\tgetColorObjectByColorValue,\n\tgetColorObjectByAttributeValues,\n\tgetMostReadableColor,\n} from './utils';\nimport { useSettings } from '../use-settings';\nimport { unlock } from '../../lock-unlock';\n\nconst { kebabCase } = unlock( componentsPrivateApis );\n\n/**\n * Capitalizes the first letter in a string.\n *\n * @param {string} str The string whose first letter the function will capitalize.\n *\n * @return {string} Capitalized string.\n */\nconst upperFirst = ( [ firstLetter, ...rest ] ) =>\n\tfirstLetter.toUpperCase() + rest.join( '' );\n\n/**\n * Higher order component factory for injecting the `colorsArray` argument as\n * the colors prop in the `withCustomColors` HOC.\n *\n * @param {Array} colorsArray An array of color objects.\n *\n * @return {Function} The higher order component.\n */\nconst withCustomColorPalette = ( colorsArray ) =>\n\tcreateHigherOrderComponent(\n\t\t( WrappedComponent ) => ( props ) => (\n\t\t\t<WrappedComponent { ...props } colors={ colorsArray } />\n\t\t),\n\t\t'withCustomColorPalette'\n\t);\n\n/**\n * Higher order component factory for injecting the editor colors as the\n * `colors` prop in the `withColors` HOC.\n *\n * @return {Function} The higher order component.\n */\nconst withEditorColorPalette = () =>\n\tcreateHigherOrderComponent(\n\t\t( WrappedComponent ) => ( props ) => {\n\t\t\tconst [ userPalette, themePalette, defaultPalette ] = useSettings(\n\t\t\t\t'color.palette.custom',\n\t\t\t\t'color.palette.theme',\n\t\t\t\t'color.palette.default'\n\t\t\t);\n\t\t\tconst allColors = useMemo(\n\t\t\t\t() => [\n\t\t\t\t\t...( userPalette || [] ),\n\t\t\t\t\t...( themePalette || [] ),\n\t\t\t\t\t...( defaultPalette || [] ),\n\t\t\t\t],\n\t\t\t\t[ userPalette, themePalette, defaultPalette ]\n\t\t\t);\n\t\t\treturn <WrappedComponent { ...props } colors={ allColors } />;\n\t\t},\n\t\t'withEditorColorPalette'\n\t);\n\n/**\n * Helper function used with `createHigherOrderComponent` to create\n * higher order components for managing color logic.\n *\n * @param {Array} colorTypes An array of color types (e.g. 'backgroundColor, borderColor).\n * @param {Function} withColorPalette A HOC for injecting the 'colors' prop into the WrappedComponent.\n *\n * @return {Component} The component that can be used as a HOC.\n */\nfunction createColorHOC( colorTypes, withColorPalette ) {\n\tconst colorMap = colorTypes.reduce( ( colorObject, colorType ) => {\n\t\treturn {\n\t\t\t...colorObject,\n\t\t\t...( typeof colorType === 'string'\n\t\t\t\t? { [ colorType ]: kebabCase( colorType ) }\n\t\t\t\t: colorType ),\n\t\t};\n\t}, {} );\n\n\treturn compose( [\n\t\twithColorPalette,\n\t\t( WrappedComponent ) => {\n\t\t\treturn class extends Component {\n\t\t\t\tconstructor( props ) {\n\t\t\t\t\tsuper( props );\n\n\t\t\t\t\tthis.setters = this.createSetters();\n\t\t\t\t\tthis.colorUtils = {\n\t\t\t\t\t\tgetMostReadableColor:\n\t\t\t\t\t\t\tthis.getMostReadableColor.bind( this ),\n\t\t\t\t\t};\n\n\t\t\t\t\tthis.state = {};\n\t\t\t\t}\n\n\t\t\t\tgetMostReadableColor( colorValue ) {\n\t\t\t\t\tconst { colors } = this.props;\n\t\t\t\t\treturn getMostReadableColor( colors, colorValue );\n\t\t\t\t}\n\n\t\t\t\tcreateSetters() {\n\t\t\t\t\treturn Object.keys( colorMap ).reduce(\n\t\t\t\t\t\t( settersAccumulator, colorAttributeName ) => {\n\t\t\t\t\t\t\tconst upperFirstColorAttributeName =\n\t\t\t\t\t\t\t\tupperFirst( colorAttributeName );\n\t\t\t\t\t\t\tconst customColorAttributeName = `custom${ upperFirstColorAttributeName }`;\n\t\t\t\t\t\t\tsettersAccumulator[\n\t\t\t\t\t\t\t\t`set${ upperFirstColorAttributeName }`\n\t\t\t\t\t\t\t] = this.createSetColor(\n\t\t\t\t\t\t\t\tcolorAttributeName,\n\t\t\t\t\t\t\t\tcustomColorAttributeName\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\treturn settersAccumulator;\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{}\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tcreateSetColor( colorAttributeName, customColorAttributeName ) {\n\t\t\t\t\treturn ( colorValue ) => {\n\t\t\t\t\t\tconst colorObject = getColorObjectByColorValue(\n\t\t\t\t\t\t\tthis.props.colors,\n\t\t\t\t\t\t\tcolorValue\n\t\t\t\t\t\t);\n\t\t\t\t\t\tthis.props.setAttributes( {\n\t\t\t\t\t\t\t[ colorAttributeName ]:\n\t\t\t\t\t\t\t\tcolorObject && colorObject.slug\n\t\t\t\t\t\t\t\t\t? colorObject.slug\n\t\t\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t\t\t[ customColorAttributeName ]:\n\t\t\t\t\t\t\t\tcolorObject && colorObject.slug\n\t\t\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t\t\t: colorValue,\n\t\t\t\t\t\t} );\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tstatic getDerivedStateFromProps(\n\t\t\t\t\t{ attributes, colors },\n\t\t\t\t\tpreviousState\n\t\t\t\t) {\n\t\t\t\t\treturn Object.entries( colorMap ).reduce(\n\t\t\t\t\t\t( newState, [ colorAttributeName, colorContext ] ) => {\n\t\t\t\t\t\t\tconst colorObject = getColorObjectByAttributeValues(\n\t\t\t\t\t\t\t\tcolors,\n\t\t\t\t\t\t\t\tattributes[ colorAttributeName ],\n\t\t\t\t\t\t\t\tattributes[\n\t\t\t\t\t\t\t\t\t`custom${ upperFirst(\n\t\t\t\t\t\t\t\t\t\tcolorAttributeName\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\n\t\t\t\t\t\t\tconst previousColorObject =\n\t\t\t\t\t\t\t\tpreviousState[ colorAttributeName ];\n\t\t\t\t\t\t\tconst previousColor = previousColorObject?.color;\n\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t * The \"and previousColorObject\" condition checks that a previous color object was already computed.\n\t\t\t\t\t\t\t * At the start previousColorObject and colorValue are both equal to undefined\n\t\t\t\t\t\t\t * bus as previousColorObject does not exist we should compute the object.\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\tpreviousColor === colorObject.color &&\n\t\t\t\t\t\t\t\tpreviousColorObject\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tnewState[ colorAttributeName ] =\n\t\t\t\t\t\t\t\t\tpreviousColorObject;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tnewState[ colorAttributeName ] = {\n\t\t\t\t\t\t\t\t\t...colorObject,\n\t\t\t\t\t\t\t\t\tclass: getColorClassName(\n\t\t\t\t\t\t\t\t\t\tcolorContext,\n\t\t\t\t\t\t\t\t\t\tcolorObject.slug\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\treturn newState;\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{}\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\trender() {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<WrappedComponent\n\t\t\t\t\t\t\t{ ...{\n\t\t\t\t\t\t\t\t...this.props,\n\t\t\t\t\t\t\t\tcolors: undefined,\n\t\t\t\t\t\t\t\t...this.state,\n\t\t\t\t\t\t\t\t...this.setters,\n\t\t\t\t\t\t\t\tcolorUtils: this.colorUtils,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t};\n\t\t},\n\t] );\n}\n\n/**\n * A higher-order component factory for creating a 'withCustomColors' HOC, which handles color logic\n * for class generation color value, retrieval and color attribute setting.\n *\n * Use this higher-order component to work with a custom set of colors.\n *\n * @example\n *\n * ```jsx\n * const CUSTOM_COLORS = [ { name: 'Red', slug: 'red', color: '#ff0000' }, { name: 'Blue', slug: 'blue', color: '#0000ff' } ];\n * const withCustomColors = createCustomColorsHOC( CUSTOM_COLORS );\n * // ...\n * export default compose(\n * withCustomColors( 'backgroundColor', 'borderColor' ),\n * MyColorfulComponent,\n * );\n * ```\n *\n * @param {Array} colorsArray The array of color objects (name, slug, color, etc... ).\n *\n * @return {Function} Higher-order component.\n */\nexport function createCustomColorsHOC( colorsArray ) {\n\treturn ( ...colorTypes ) => {\n\t\tconst withColorPalette = withCustomColorPalette( colorsArray );\n\t\treturn createHigherOrderComponent(\n\t\t\tcreateColorHOC( colorTypes, withColorPalette ),\n\t\t\t'withCustomColors'\n\t\t);\n\t};\n}\n\n/**\n * A higher-order component, which handles color logic for class generation color value, retrieval and color attribute setting.\n *\n * For use with the default editor/theme color palette.\n *\n * @example\n *\n * ```jsx\n * export default compose(\n * withColors( 'backgroundColor', { textColor: 'color' } ),\n * MyColorfulComponent,\n * );\n * ```\n *\n * @param {...(Object|string)} colorTypes The arguments can be strings or objects. If the argument is an object,\n * it should contain the color attribute name as key and the color context as value.\n * If the argument is a string the value should be the color attribute name,\n * the color context is computed by applying a kebab case transform to the value.\n * Color context represents the context/place where the color is going to be used.\n * The class name of the color is generated using 'has' followed by the color name\n * and ending with the color context all in kebab case e.g: has-green-background-color.\n *\n * @return {Function} Higher-order component.\n */\nexport default function withColors( ...colorTypes ) {\n\tconst withColorPalette = withEditorColorPalette();\n\treturn createHigherOrderComponent(\n\t\tcreateColorHOC( colorTypes, withColorPalette ),\n\t\t'withColors'\n\t);\n}\n"],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AAEC,UAAU,EAAEC,gBAAiB,CAAC,EAC9C,YACD,CAAC;AACF","ignoreList":[]}
@@ -14,8 +14,7 @@ import { BaseControl, __experimentalVStack as VStack, ColorPalette, GradientPick
14
14
  */
15
15
  import { useSettings } from '../use-settings';
16
16
  import { unlock } from '../../lock-unlock';
17
- import { jsx as _jsx } from "react/jsx-runtime";
18
- import { jsxs as _jsxs } from "react/jsx-runtime";
17
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
19
18
  const {
20
19
  Tabs
21
20
  } = unlock(componentsPrivateApis);