@wordpress/block-editor 11.2.0 → 11.3.1

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 (675) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/README.md +28 -4
  3. package/build/components/alignment-control/ui.js +1 -1
  4. package/build/components/alignment-control/ui.js.map +1 -1
  5. package/build/components/autocomplete/index.js +2 -7
  6. package/build/components/autocomplete/index.js.map +1 -1
  7. package/build/components/block-actions/index.js +7 -2
  8. package/build/components/block-actions/index.js.map +1 -1
  9. package/build/components/block-alignment-matrix-control/index.js +2 -2
  10. package/build/components/block-alignment-matrix-control/index.js.map +1 -1
  11. package/build/components/block-card/index.js +2 -4
  12. package/build/components/block-card/index.js.map +1 -1
  13. package/build/components/block-edit/index.js +8 -0
  14. package/build/components/block-edit/index.js.map +1 -1
  15. package/build/components/block-inspector/index.js +15 -14
  16. package/build/components/block-inspector/index.js.map +1 -1
  17. package/build/components/block-list/use-in-between-inserter.js +5 -0
  18. package/build/components/block-list/use-in-between-inserter.js.map +1 -1
  19. package/build/components/block-lock/modal.js +0 -1
  20. package/build/components/block-lock/modal.js.map +1 -1
  21. package/build/components/block-mover/mover-description.js +2 -2
  22. package/build/components/block-mover/mover-description.js.map +1 -1
  23. package/build/components/block-navigation/dropdown.js +3 -1
  24. package/build/components/block-navigation/dropdown.js.map +1 -1
  25. package/build/components/block-pattern-setup/index.js +1 -1
  26. package/build/components/block-pattern-setup/index.js.map +1 -1
  27. package/build/components/block-pattern-setup/use-patterns-setup.js +2 -2
  28. package/build/components/block-pattern-setup/use-patterns-setup.js.map +1 -1
  29. package/build/components/block-patterns-list/index.js +31 -3
  30. package/build/components/block-patterns-list/index.js.map +1 -1
  31. package/build/components/block-preview/auto.js +9 -11
  32. package/build/components/block-preview/auto.js.map +1 -1
  33. package/build/components/block-preview/index.js +32 -8
  34. package/build/components/block-preview/index.js.map +1 -1
  35. package/build/components/block-selection-clearer/index.js +1 -1
  36. package/build/components/block-selection-clearer/index.js.map +1 -1
  37. package/build/components/block-settings/container.native.js +7 -33
  38. package/build/components/block-settings/container.native.js.map +1 -1
  39. package/build/components/block-settings-menu/block-settings-dropdown.js +12 -6
  40. package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  41. package/build/components/block-settings-menu-controls/index.js +2 -8
  42. package/build/components/block-settings-menu-controls/index.js.map +1 -1
  43. package/build/components/block-switcher/utils.js +1 -1
  44. package/build/components/block-switcher/utils.js.map +1 -1
  45. package/build/components/block-tools/selected-block-popover.js +55 -47
  46. package/build/components/block-tools/selected-block-popover.js.map +1 -1
  47. package/build/components/block-vertical-alignment-control/icons.js +15 -1
  48. package/build/components/block-vertical-alignment-control/icons.js.map +1 -1
  49. package/build/components/block-vertical-alignment-control/ui.js +9 -4
  50. package/build/components/block-vertical-alignment-control/ui.js.map +1 -1
  51. package/build/components/color-style-selector/index.js +3 -1
  52. package/build/components/color-style-selector/index.js.map +1 -1
  53. package/build/components/date-format-picker/index.js +3 -4
  54. package/build/components/date-format-picker/index.js.map +1 -1
  55. package/build/components/font-family/index.js +1 -7
  56. package/build/components/font-family/index.js.map +1 -1
  57. package/build/components/font-sizes/fluid-utils.js +1 -1
  58. package/build/components/font-sizes/fluid-utils.js.map +1 -1
  59. package/build/components/font-sizes/utils.js +1 -1
  60. package/build/components/font-sizes/utils.js.map +1 -1
  61. package/build/components/global-styles/context.js +22 -0
  62. package/build/components/global-styles/context.js.map +1 -0
  63. package/build/components/global-styles/hooks.js +142 -0
  64. package/build/components/global-styles/hooks.js.map +1 -0
  65. package/build/components/global-styles/index.js +42 -0
  66. package/build/components/global-styles/index.js.map +1 -0
  67. package/build/components/global-styles/typography-utils.js +92 -0
  68. package/build/components/global-styles/typography-utils.js.map +1 -0
  69. package/build/components/global-styles/use-global-styles-output.js +974 -0
  70. package/build/components/global-styles/use-global-styles-output.js.map +1 -0
  71. package/build/components/global-styles/utils.js +340 -0
  72. package/build/components/global-styles/utils.js.map +1 -0
  73. package/build/components/height-control/index.js +13 -1
  74. package/build/components/height-control/index.js.map +1 -1
  75. package/build/components/iframe/index.js +5 -3
  76. package/build/components/iframe/index.js.map +1 -1
  77. package/build/components/image-editor/constants.js +1 -1
  78. package/build/components/image-editor/constants.js.map +1 -1
  79. package/build/components/image-editor/context.js +1 -2
  80. package/build/components/image-editor/context.js.map +1 -1
  81. package/build/components/image-editor/cropper.js +3 -1
  82. package/build/components/image-editor/cropper.js.map +1 -1
  83. package/build/components/image-editor/index.js +13 -9
  84. package/build/components/image-editor/index.js.map +1 -1
  85. package/build/components/image-editor/use-transform-image.js +11 -35
  86. package/build/components/image-editor/use-transform-image.js.map +1 -1
  87. package/build/components/image-size-control/index.js +1 -7
  88. package/build/components/image-size-control/index.js.map +1 -1
  89. package/build/components/index.js +8 -24
  90. package/build/components/index.js.map +1 -1
  91. package/build/components/inner-blocks/index.js +22 -32
  92. package/build/components/inner-blocks/index.js.map +1 -1
  93. package/build/components/inner-blocks/index.native.js +8 -23
  94. package/build/components/inner-blocks/index.native.js.map +1 -1
  95. package/build/components/inner-blocks/use-block-context.js +53 -0
  96. package/build/components/inner-blocks/use-block-context.js.map +1 -0
  97. package/build/components/inserter/block-patterns-explorer/explorer.js +0 -1
  98. package/build/components/inserter/block-patterns-explorer/explorer.js.map +1 -1
  99. package/build/components/inserter/block-patterns-tab.js +9 -2
  100. package/build/components/inserter/block-patterns-tab.js.map +1 -1
  101. package/build/components/inserter/block-types-tab.js +2 -2
  102. package/build/components/inserter/block-types-tab.js.map +1 -1
  103. package/build/components/inserter/hooks/use-patterns-state.js +1 -7
  104. package/build/components/inserter/hooks/use-patterns-state.js.map +1 -1
  105. package/build/components/inserter/index.js +5 -4
  106. package/build/components/inserter/index.js.map +1 -1
  107. package/build/components/inserter/media-tab/hooks.js +142 -56
  108. package/build/components/inserter/media-tab/hooks.js.map +1 -1
  109. package/build/components/inserter/media-tab/media-list.js +74 -21
  110. package/build/components/inserter/media-tab/media-list.js.map +1 -1
  111. package/build/components/inserter/media-tab/media-panel.js +11 -13
  112. package/build/components/inserter/media-tab/media-panel.js.map +1 -1
  113. package/build/components/inserter/media-tab/media-tab.js +6 -3
  114. package/build/components/inserter/media-tab/media-tab.js.map +1 -1
  115. package/build/components/inserter/media-tab/utils.js +26 -15
  116. package/build/components/inserter/media-tab/utils.js.map +1 -1
  117. package/build/components/inserter/menu.js +4 -0
  118. package/build/components/inserter/menu.js.map +1 -1
  119. package/build/components/inserter/preview-panel.js +5 -3
  120. package/build/components/inserter/preview-panel.js.map +1 -1
  121. package/build/components/inserter/search-results.js +2 -7
  122. package/build/components/inserter/search-results.js.map +1 -1
  123. package/build/components/inserter-list-item/index.js +1 -9
  124. package/build/components/inserter-list-item/index.js.map +1 -1
  125. package/build/components/inspector-controls/fill.js +15 -2
  126. package/build/components/inspector-controls/fill.js.map +1 -1
  127. package/build/components/inspector-controls/fill.native.js +14 -1
  128. package/build/components/inspector-controls/fill.native.js.map +1 -1
  129. package/build/components/inspector-controls/groups.js +4 -0
  130. package/build/components/inspector-controls/groups.js.map +1 -1
  131. package/build/components/inspector-controls/index.js +2 -2
  132. package/build/components/inspector-controls/index.js.map +1 -1
  133. package/build/components/inspector-controls/slot.js +14 -1
  134. package/build/components/inspector-controls/slot.js.map +1 -1
  135. package/build/components/inspector-controls/slot.native.js +14 -1
  136. package/build/components/inspector-controls/slot.native.js.map +1 -1
  137. package/build/components/inspector-controls-tabs/advanced-controls-panel.js +1 -1
  138. package/build/components/inspector-controls-tabs/advanced-controls-panel.js.map +1 -1
  139. package/build/components/inspector-controls-tabs/index.js +2 -2
  140. package/build/components/inspector-controls-tabs/index.js.map +1 -1
  141. package/build/components/inspector-controls-tabs/position-controls-panel.js +1 -1
  142. package/build/components/inspector-controls-tabs/position-controls-panel.js.map +1 -1
  143. package/build/components/inspector-controls-tabs/styles-tab.js +6 -4
  144. package/build/components/inspector-controls-tabs/styles-tab.js.map +1 -1
  145. package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js +17 -12
  146. package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +1 -1
  147. package/build/components/justify-content-control/ui.js +8 -1
  148. package/build/components/justify-content-control/ui.js.map +1 -1
  149. package/build/components/link-control/index.js +45 -17
  150. package/build/components/link-control/index.js.map +1 -1
  151. package/build/components/list-view/block.js +1 -1
  152. package/build/components/list-view/block.js.map +1 -1
  153. package/build/components/list-view/use-list-view-drop-zone.js +1 -1
  154. package/build/components/list-view/use-list-view-drop-zone.js.map +1 -1
  155. package/build/components/media-upload/index.native.js +4 -1
  156. package/build/components/media-upload/index.native.js.map +1 -1
  157. package/build/components/off-canvas-editor/appender.js +50 -3
  158. package/build/components/off-canvas-editor/appender.js.map +1 -1
  159. package/build/components/off-canvas-editor/block-contents.js +3 -1
  160. package/build/components/off-canvas-editor/block-contents.js.map +1 -1
  161. package/build/components/off-canvas-editor/block-select-button.js +10 -4
  162. package/build/components/off-canvas-editor/block-select-button.js.map +1 -1
  163. package/build/components/off-canvas-editor/block.js +6 -27
  164. package/build/components/off-canvas-editor/block.js.map +1 -1
  165. package/build/components/off-canvas-editor/branch.js +25 -10
  166. package/build/components/off-canvas-editor/branch.js.map +1 -1
  167. package/build/components/off-canvas-editor/index.js +27 -20
  168. package/build/components/off-canvas-editor/index.js.map +1 -1
  169. package/build/components/off-canvas-editor/link-ui.js +2 -2
  170. package/build/components/off-canvas-editor/link-ui.js.map +1 -1
  171. package/build/components/off-canvas-editor/use-list-view-drop-zone.js +1 -1
  172. package/build/components/off-canvas-editor/use-list-view-drop-zone.js.map +1 -1
  173. package/build/components/provider/index.js +21 -9
  174. package/build/components/provider/index.js.map +1 -1
  175. package/build/components/provider/index.native.js +5 -6
  176. package/build/components/provider/index.native.js.map +1 -1
  177. package/build/components/rich-text/use-before-input-rules.js +11 -3
  178. package/build/components/rich-text/use-before-input-rules.js.map +1 -1
  179. package/build/components/rich-text/utils.js +1 -1
  180. package/build/components/rich-text/utils.js.map +1 -1
  181. package/build/components/spacing-sizes-control/utils.js +2 -8
  182. package/build/components/spacing-sizes-control/utils.js.map +1 -1
  183. package/build/components/tool-selector/index.js +3 -1
  184. package/build/components/tool-selector/index.js.map +1 -1
  185. package/build/components/url-popover/image-url-input-ui.js +7 -8
  186. package/build/components/url-popover/image-url-input-ui.js.map +1 -1
  187. package/build/components/use-block-display-information/index.js +1 -1
  188. package/build/components/use-block-display-information/index.js.map +1 -1
  189. package/build/experiments.js +45 -0
  190. package/build/experiments.js.map +1 -0
  191. package/build/experiments.native.js +40 -0
  192. package/build/experiments.native.js.map +1 -0
  193. package/build/hooks/anchor.js +2 -1
  194. package/build/hooks/anchor.js.map +1 -1
  195. package/build/hooks/border.js +1 -1
  196. package/build/hooks/border.js.map +1 -1
  197. package/build/hooks/child-layout.js +5 -1
  198. package/build/hooks/child-layout.js.map +1 -1
  199. package/build/hooks/color-panel.js +1 -1
  200. package/build/hooks/color-panel.js.map +1 -1
  201. package/build/hooks/color.js +3 -3
  202. package/build/hooks/color.js.map +1 -1
  203. package/build/hooks/custom-class-name.js +2 -1
  204. package/build/hooks/custom-class-name.js.map +1 -1
  205. package/build/hooks/dimensions.js +7 -5
  206. package/build/hooks/dimensions.js.map +1 -1
  207. package/build/hooks/margin.js +1 -0
  208. package/build/hooks/margin.js.map +1 -1
  209. package/build/hooks/padding.js +1 -0
  210. package/build/hooks/padding.js.map +1 -1
  211. package/build/hooks/position.js +39 -17
  212. package/build/hooks/position.js.map +1 -1
  213. package/build/hooks/typography.js +1 -1
  214. package/build/hooks/typography.js.map +1 -1
  215. package/build/hooks/use-color-props.js +3 -3
  216. package/build/hooks/use-color-props.js.map +1 -1
  217. package/build/hooks/utils.js +69 -3
  218. package/build/hooks/utils.js.map +1 -1
  219. package/build/index.js +10 -1
  220. package/build/index.js.map +1 -1
  221. package/build/layouts/constrained.js +3 -0
  222. package/build/layouts/constrained.js.map +1 -1
  223. package/build/layouts/flex.js +59 -9
  224. package/build/layouts/flex.js.map +1 -1
  225. package/build/layouts/flow.js +0 -18
  226. package/build/layouts/flow.js.map +1 -1
  227. package/build/store/actions.js +3 -30
  228. package/build/store/actions.js.map +1 -1
  229. package/build/store/defaults.js +5 -2
  230. package/build/store/defaults.js.map +1 -1
  231. package/build/store/index.js +11 -2
  232. package/build/store/index.js.map +1 -1
  233. package/build/store/private-actions.js +78 -0
  234. package/build/store/private-actions.js.map +1 -0
  235. package/build/store/private-selectors.js +32 -0
  236. package/build/store/private-selectors.js.map +1 -0
  237. package/build/store/reducer.js +1 -1
  238. package/build/store/reducer.js.map +1 -1
  239. package/build/store/selectors.js +60 -48
  240. package/build/store/selectors.js.map +1 -1
  241. package/build/utils/block-variation-transforms.js +1 -1
  242. package/build/utils/block-variation-transforms.js.map +1 -1
  243. package/build/utils/parse-css-unit-to-px.js +1 -1
  244. package/build/utils/parse-css-unit-to-px.js.map +1 -1
  245. package/build/utils/transform-styles/index.js +1 -7
  246. package/build/utils/transform-styles/index.js.map +1 -1
  247. package/build-module/components/alignment-control/ui.js +1 -1
  248. package/build-module/components/alignment-control/ui.js.map +1 -1
  249. package/build-module/components/autocomplete/index.js +2 -6
  250. package/build-module/components/autocomplete/index.js.map +1 -1
  251. package/build-module/components/block-actions/index.js +7 -2
  252. package/build-module/components/block-actions/index.js.map +1 -1
  253. package/build-module/components/block-alignment-matrix-control/index.js +2 -2
  254. package/build-module/components/block-alignment-matrix-control/index.js.map +1 -1
  255. package/build-module/components/block-card/index.js +2 -4
  256. package/build-module/components/block-card/index.js.map +1 -1
  257. package/build-module/components/block-edit/index.js +7 -0
  258. package/build-module/components/block-edit/index.js.map +1 -1
  259. package/build-module/components/block-inspector/index.js +15 -14
  260. package/build-module/components/block-inspector/index.js.map +1 -1
  261. package/build-module/components/block-list/use-in-between-inserter.js +5 -0
  262. package/build-module/components/block-list/use-in-between-inserter.js.map +1 -1
  263. package/build-module/components/block-lock/modal.js +0 -1
  264. package/build-module/components/block-lock/modal.js.map +1 -1
  265. package/build-module/components/block-mover/mover-description.js +2 -2
  266. package/build-module/components/block-mover/mover-description.js.map +1 -1
  267. package/build-module/components/block-navigation/dropdown.js +3 -1
  268. package/build-module/components/block-navigation/dropdown.js.map +1 -1
  269. package/build-module/components/block-pattern-setup/index.js +1 -1
  270. package/build-module/components/block-pattern-setup/index.js.map +1 -1
  271. package/build-module/components/block-pattern-setup/use-patterns-setup.js +2 -2
  272. package/build-module/components/block-pattern-setup/use-patterns-setup.js.map +1 -1
  273. package/build-module/components/block-patterns-list/index.js +32 -3
  274. package/build-module/components/block-patterns-list/index.js.map +1 -1
  275. package/build-module/components/block-preview/auto.js +9 -11
  276. package/build-module/components/block-preview/auto.js.map +1 -1
  277. package/build-module/components/block-preview/index.js +31 -8
  278. package/build-module/components/block-preview/index.js.map +1 -1
  279. package/build-module/components/block-selection-clearer/index.js +1 -1
  280. package/build-module/components/block-selection-clearer/index.js.map +1 -1
  281. package/build-module/components/block-settings/container.native.js +6 -30
  282. package/build-module/components/block-settings/container.native.js.map +1 -1
  283. package/build-module/components/block-settings-menu/block-settings-dropdown.js +12 -6
  284. package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  285. package/build-module/components/block-settings-menu-controls/index.js +2 -7
  286. package/build-module/components/block-settings-menu-controls/index.js.map +1 -1
  287. package/build-module/components/block-switcher/utils.js +1 -1
  288. package/build-module/components/block-switcher/utils.js.map +1 -1
  289. package/build-module/components/block-tools/selected-block-popover.js +55 -48
  290. package/build-module/components/block-tools/selected-block-popover.js.map +1 -1
  291. package/build-module/components/block-vertical-alignment-control/icons.js +12 -0
  292. package/build-module/components/block-vertical-alignment-control/icons.js.map +1 -1
  293. package/build-module/components/block-vertical-alignment-control/ui.js +10 -5
  294. package/build-module/components/block-vertical-alignment-control/ui.js.map +1 -1
  295. package/build-module/components/color-style-selector/index.js +3 -1
  296. package/build-module/components/color-style-selector/index.js.map +1 -1
  297. package/build-module/components/date-format-picker/index.js +4 -5
  298. package/build-module/components/date-format-picker/index.js.map +1 -1
  299. package/build-module/components/font-family/index.js +1 -6
  300. package/build-module/components/font-family/index.js.map +1 -1
  301. package/build-module/components/font-sizes/fluid-utils.js +1 -1
  302. package/build-module/components/font-sizes/fluid-utils.js.map +1 -1
  303. package/build-module/components/font-sizes/utils.js +1 -1
  304. package/build-module/components/font-sizes/utils.js.map +1 -1
  305. package/build-module/components/global-styles/context.js +12 -0
  306. package/build-module/components/global-styles/context.js.map +1 -0
  307. package/build-module/components/global-styles/hooks.js +121 -0
  308. package/build-module/components/global-styles/hooks.js.map +1 -0
  309. package/build-module/components/global-styles/index.js +4 -0
  310. package/build-module/components/global-styles/index.js.map +1 -0
  311. package/build-module/components/global-styles/typography-utils.js +84 -0
  312. package/build-module/components/global-styles/typography-utils.js.map +1 -0
  313. package/build-module/components/global-styles/use-global-styles-output.js +930 -0
  314. package/build-module/components/global-styles/use-global-styles-output.js.map +1 -0
  315. package/build-module/components/global-styles/utils.js +321 -0
  316. package/build-module/components/global-styles/utils.js.map +1 -0
  317. package/build-module/components/height-control/index.js +14 -1
  318. package/build-module/components/height-control/index.js.map +1 -1
  319. package/build-module/components/iframe/index.js +6 -4
  320. package/build-module/components/iframe/index.js.map +1 -1
  321. package/build-module/components/image-editor/constants.js +1 -1
  322. package/build-module/components/image-editor/constants.js.map +1 -1
  323. package/build-module/components/image-editor/context.js +1 -2
  324. package/build-module/components/image-editor/context.js.map +1 -1
  325. package/build-module/components/image-editor/cropper.js +3 -1
  326. package/build-module/components/image-editor/cropper.js.map +1 -1
  327. package/build-module/components/image-editor/index.js +13 -3
  328. package/build-module/components/image-editor/index.js.map +1 -1
  329. package/build-module/components/image-editor/use-transform-image.js +12 -37
  330. package/build-module/components/image-editor/use-transform-image.js.map +1 -1
  331. package/build-module/components/image-size-control/index.js +1 -6
  332. package/build-module/components/image-size-control/index.js.map +1 -1
  333. package/build-module/components/index.js +2 -3
  334. package/build-module/components/index.js.map +1 -1
  335. package/build-module/components/inner-blocks/index.js +21 -32
  336. package/build-module/components/inner-blocks/index.js.map +1 -1
  337. package/build-module/components/inner-blocks/index.native.js +9 -22
  338. package/build-module/components/inner-blocks/index.native.js.map +1 -1
  339. package/build-module/components/inner-blocks/use-block-context.js +43 -0
  340. package/build-module/components/inner-blocks/use-block-context.js.map +1 -0
  341. package/build-module/components/inserter/block-patterns-explorer/explorer.js +0 -1
  342. package/build-module/components/inserter/block-patterns-explorer/explorer.js.map +1 -1
  343. package/build-module/components/inserter/block-patterns-tab.js +9 -2
  344. package/build-module/components/inserter/block-patterns-tab.js.map +1 -1
  345. package/build-module/components/inserter/block-types-tab.js +3 -3
  346. package/build-module/components/inserter/block-types-tab.js.map +1 -1
  347. package/build-module/components/inserter/hooks/use-patterns-state.js +1 -6
  348. package/build-module/components/inserter/hooks/use-patterns-state.js.map +1 -1
  349. package/build-module/components/inserter/index.js +5 -4
  350. package/build-module/components/inserter/index.js.map +1 -1
  351. package/build-module/components/inserter/media-tab/hooks.js +145 -56
  352. package/build-module/components/inserter/media-tab/hooks.js.map +1 -1
  353. package/build-module/components/inserter/media-tab/media-list.js +74 -24
  354. package/build-module/components/inserter/media-tab/media-list.js.map +1 -1
  355. package/build-module/components/inserter/media-tab/media-panel.js +14 -14
  356. package/build-module/components/inserter/media-tab/media-panel.js.map +1 -1
  357. package/build-module/components/inserter/media-tab/media-tab.js +7 -4
  358. package/build-module/components/inserter/media-tab/media-tab.js.map +1 -1
  359. package/build-module/components/inserter/media-tab/utils.js +27 -15
  360. package/build-module/components/inserter/media-tab/utils.js.map +1 -1
  361. package/build-module/components/inserter/menu.js +4 -0
  362. package/build-module/components/inserter/menu.js.map +1 -1
  363. package/build-module/components/inserter/preview-panel.js +5 -3
  364. package/build-module/components/inserter/preview-panel.js.map +1 -1
  365. package/build-module/components/inserter/search-results.js +2 -6
  366. package/build-module/components/inserter/search-results.js.map +1 -1
  367. package/build-module/components/inserter-list-item/index.js +1 -9
  368. package/build-module/components/inserter-list-item/index.js.map +1 -1
  369. package/build-module/components/inspector-controls/fill.js +14 -2
  370. package/build-module/components/inspector-controls/fill.js.map +1 -1
  371. package/build-module/components/inspector-controls/fill.native.js +13 -1
  372. package/build-module/components/inspector-controls/fill.native.js.map +1 -1
  373. package/build-module/components/inspector-controls/groups.js +4 -0
  374. package/build-module/components/inspector-controls/groups.js.map +1 -1
  375. package/build-module/components/inspector-controls/index.js +2 -2
  376. package/build-module/components/inspector-controls/index.js.map +1 -1
  377. package/build-module/components/inspector-controls/slot.js +13 -1
  378. package/build-module/components/inspector-controls/slot.js.map +1 -1
  379. package/build-module/components/inspector-controls/slot.native.js +13 -1
  380. package/build-module/components/inspector-controls/slot.native.js.map +1 -1
  381. package/build-module/components/inspector-controls-tabs/advanced-controls-panel.js +1 -1
  382. package/build-module/components/inspector-controls-tabs/advanced-controls-panel.js.map +1 -1
  383. package/build-module/components/inspector-controls-tabs/index.js +2 -2
  384. package/build-module/components/inspector-controls-tabs/index.js.map +1 -1
  385. package/build-module/components/inspector-controls-tabs/position-controls-panel.js +1 -1
  386. package/build-module/components/inspector-controls-tabs/position-controls-panel.js.map +1 -1
  387. package/build-module/components/inspector-controls-tabs/styles-tab.js +6 -4
  388. package/build-module/components/inspector-controls-tabs/styles-tab.js.map +1 -1
  389. package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js +17 -12
  390. package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +1 -1
  391. package/build-module/components/justify-content-control/ui.js +9 -2
  392. package/build-module/components/justify-content-control/ui.js.map +1 -1
  393. package/build-module/components/link-control/index.js +45 -16
  394. package/build-module/components/link-control/index.js.map +1 -1
  395. package/build-module/components/list-view/block.js +1 -1
  396. package/build-module/components/list-view/block.js.map +1 -1
  397. package/build-module/components/list-view/use-list-view-drop-zone.js +1 -1
  398. package/build-module/components/list-view/use-list-view-drop-zone.js.map +1 -1
  399. package/build-module/components/media-upload/index.native.js +4 -1
  400. package/build-module/components/media-upload/index.native.js.map +1 -1
  401. package/build-module/components/off-canvas-editor/appender.js +47 -4
  402. package/build-module/components/off-canvas-editor/appender.js.map +1 -1
  403. package/build-module/components/off-canvas-editor/block-contents.js +2 -1
  404. package/build-module/components/off-canvas-editor/block-contents.js.map +1 -1
  405. package/build-module/components/off-canvas-editor/block-select-button.js +9 -4
  406. package/build-module/components/off-canvas-editor/block-select-button.js.map +1 -1
  407. package/build-module/components/off-canvas-editor/block.js +6 -25
  408. package/build-module/components/off-canvas-editor/block.js.map +1 -1
  409. package/build-module/components/off-canvas-editor/branch.js +23 -11
  410. package/build-module/components/off-canvas-editor/branch.js.map +1 -1
  411. package/build-module/components/off-canvas-editor/index.js +27 -19
  412. package/build-module/components/off-canvas-editor/index.js.map +1 -1
  413. package/build-module/components/off-canvas-editor/link-ui.js +2 -2
  414. package/build-module/components/off-canvas-editor/link-ui.js.map +1 -1
  415. package/build-module/components/off-canvas-editor/use-list-view-drop-zone.js +1 -1
  416. package/build-module/components/off-canvas-editor/use-list-view-drop-zone.js.map +1 -1
  417. package/build-module/components/provider/index.js +16 -9
  418. package/build-module/components/provider/index.js.map +1 -1
  419. package/build-module/components/provider/index.native.js +4 -4
  420. package/build-module/components/provider/index.native.js.map +1 -1
  421. package/build-module/components/rich-text/use-before-input-rules.js +10 -2
  422. package/build-module/components/rich-text/use-before-input-rules.js.map +1 -1
  423. package/build-module/components/rich-text/utils.js +1 -1
  424. package/build-module/components/rich-text/utils.js.map +1 -1
  425. package/build-module/components/spacing-sizes-control/utils.js +2 -7
  426. package/build-module/components/spacing-sizes-control/utils.js.map +1 -1
  427. package/build-module/components/tool-selector/index.js +3 -1
  428. package/build-module/components/tool-selector/index.js.map +1 -1
  429. package/build-module/components/url-popover/image-url-input-ui.js +8 -8
  430. package/build-module/components/url-popover/image-url-input-ui.js.map +1 -1
  431. package/build-module/components/use-block-display-information/index.js +1 -1
  432. package/build-module/components/use-block-display-information/index.js.map +1 -1
  433. package/build-module/experiments.js +25 -0
  434. package/build-module/experiments.js.map +1 -0
  435. package/build-module/experiments.native.js +23 -0
  436. package/build-module/experiments.native.js.map +1 -0
  437. package/build-module/hooks/anchor.js +2 -1
  438. package/build-module/hooks/anchor.js.map +1 -1
  439. package/build-module/hooks/border.js +1 -1
  440. package/build-module/hooks/border.js.map +1 -1
  441. package/build-module/hooks/child-layout.js +5 -1
  442. package/build-module/hooks/child-layout.js.map +1 -1
  443. package/build-module/hooks/color-panel.js +1 -1
  444. package/build-module/hooks/color-panel.js.map +1 -1
  445. package/build-module/hooks/color.js +3 -3
  446. package/build-module/hooks/color.js.map +1 -1
  447. package/build-module/hooks/custom-class-name.js +2 -1
  448. package/build-module/hooks/custom-class-name.js.map +1 -1
  449. package/build-module/hooks/dimensions.js +6 -5
  450. package/build-module/hooks/dimensions.js.map +1 -1
  451. package/build-module/hooks/margin.js +1 -0
  452. package/build-module/hooks/margin.js.map +1 -1
  453. package/build-module/hooks/padding.js +1 -0
  454. package/build-module/hooks/padding.js.map +1 -1
  455. package/build-module/hooks/position.js +36 -16
  456. package/build-module/hooks/position.js.map +1 -1
  457. package/build-module/hooks/typography.js +1 -1
  458. package/build-module/hooks/typography.js.map +1 -1
  459. package/build-module/hooks/use-color-props.js +3 -3
  460. package/build-module/hooks/use-color-props.js.map +1 -1
  461. package/build-module/hooks/utils.js +70 -4
  462. package/build-module/hooks/utils.js.map +1 -1
  463. package/build-module/index.js +1 -0
  464. package/build-module/index.js.map +1 -1
  465. package/build-module/layouts/constrained.js +3 -0
  466. package/build-module/layouts/constrained.js.map +1 -1
  467. package/build-module/layouts/flex.js +60 -10
  468. package/build-module/layouts/flex.js.map +1 -1
  469. package/build-module/layouts/flow.js +0 -18
  470. package/build-module/layouts/flow.js.map +1 -1
  471. package/build-module/store/actions.js +2 -26
  472. package/build-module/store/actions.js.map +1 -1
  473. package/build-module/store/defaults.js +5 -2
  474. package/build-module/store/defaults.js.map +1 -1
  475. package/build-module/store/index.js +8 -2
  476. package/build-module/store/index.js.map +1 -1
  477. package/build-module/store/private-actions.js +66 -0
  478. package/build-module/store/private-actions.js.map +1 -0
  479. package/build-module/store/private-selectors.js +23 -0
  480. package/build-module/store/private-selectors.js.map +1 -0
  481. package/build-module/store/reducer.js +1 -1
  482. package/build-module/store/reducer.js.map +1 -1
  483. package/build-module/store/selectors.js +48 -37
  484. package/build-module/store/selectors.js.map +1 -1
  485. package/build-module/utils/block-variation-transforms.js +1 -1
  486. package/build-module/utils/block-variation-transforms.js.map +1 -1
  487. package/build-module/utils/parse-css-unit-to-px.js +1 -1
  488. package/build-module/utils/parse-css-unit-to-px.js.map +1 -1
  489. package/build-module/utils/transform-styles/index.js +1 -6
  490. package/build-module/utils/transform-styles/index.js.map +1 -1
  491. package/build-style/content-rtl.css +283 -3
  492. package/build-style/content.css +283 -3
  493. package/build-style/style-rtl.css +105 -221
  494. package/build-style/style.css +105 -221
  495. package/package.json +30 -29
  496. package/src/components/alignment-control/test/__snapshots__/index.js.snap +3 -3
  497. package/src/components/alignment-control/test/index.js +5 -15
  498. package/src/components/alignment-control/ui.js +1 -1
  499. package/src/components/autocomplete/index.js +3 -6
  500. package/src/components/block-actions/index.js +9 -0
  501. package/src/components/block-alignment-control/test/index.js +3 -11
  502. package/src/components/block-alignment-matrix-control/index.js +1 -2
  503. package/src/components/block-card/index.js +1 -4
  504. package/src/components/block-content-overlay/content.scss +4 -4
  505. package/src/components/block-edit/index.js +15 -1
  506. package/src/components/block-icon/content.scss +31 -0
  507. package/src/components/block-inspector/index.js +13 -17
  508. package/src/components/block-list/use-in-between-inserter.js +5 -0
  509. package/src/components/block-lock/modal.js +0 -1
  510. package/src/components/block-mover/mover-description.js +2 -2
  511. package/src/components/block-mover/stories/index.js +3 -3
  512. package/src/components/block-navigation/dropdown.js +1 -1
  513. package/src/components/block-pattern-setup/index.js +1 -4
  514. package/src/components/block-pattern-setup/use-patterns-setup.js +2 -5
  515. package/src/components/block-patterns-list/index.js +29 -3
  516. package/src/components/block-preview/README.md +9 -9
  517. package/src/components/block-preview/auto.js +9 -11
  518. package/src/components/block-preview/content.scss +23 -0
  519. package/src/components/block-preview/index.js +40 -10
  520. package/src/components/block-preview/style.scss +0 -23
  521. package/src/components/block-selection-clearer/index.js +1 -1
  522. package/src/components/block-selection-clearer/test/index.js +6 -6
  523. package/src/components/block-settings/container.native.js +7 -26
  524. package/src/components/block-settings-menu/block-settings-dropdown.js +13 -5
  525. package/src/components/block-settings-menu-controls/index.js +2 -10
  526. package/src/components/block-switcher/test/index.js +43 -44
  527. package/src/components/block-switcher/utils.js +1 -1
  528. package/src/components/block-tools/selected-block-popover.js +77 -80
  529. package/src/components/block-tools/style.scss +0 -1
  530. package/src/components/block-variation-picker/{style.scss → content.scss} +0 -0
  531. package/src/components/block-vertical-alignment-control/icons.js +12 -0
  532. package/src/components/block-vertical-alignment-control/test/index.js +3 -11
  533. package/src/components/block-vertical-alignment-control/ui.js +16 -6
  534. package/src/components/color-style-selector/index.js +1 -1
  535. package/src/components/colors/test/with-colors.js +2 -8
  536. package/src/components/date-format-picker/index.js +23 -24
  537. package/src/components/date-format-picker/style.scss +0 -6
  538. package/src/components/default-block-appender/content.scss +18 -0
  539. package/src/components/default-block-appender/test/index.js +2 -8
  540. package/src/components/font-family/index.js +1 -6
  541. package/src/components/font-sizes/fluid-utils.js +1 -1
  542. package/src/components/font-sizes/utils.js +1 -1
  543. package/src/components/global-styles/README.md +77 -0
  544. package/src/components/global-styles/context.js +15 -0
  545. package/src/components/global-styles/hooks.js +145 -0
  546. package/src/components/global-styles/index.js +7 -0
  547. package/src/components/global-styles/test/typography-utils.js +393 -0
  548. package/src/components/global-styles/test/use-global-styles-output.js +814 -0
  549. package/src/components/global-styles/test/utils.js +206 -0
  550. package/src/components/global-styles/typography-utils.js +87 -0
  551. package/src/components/global-styles/use-global-styles-output.js +1088 -0
  552. package/src/components/global-styles/utils.js +373 -0
  553. package/src/components/height-control/README.md +55 -0
  554. package/src/components/height-control/index.js +13 -1
  555. package/src/components/iframe/index.js +8 -2
  556. package/src/components/image-editor/constants.js +1 -1
  557. package/src/components/image-editor/context.js +5 -9
  558. package/src/components/image-editor/cropper.js +3 -1
  559. package/src/components/image-editor/index.js +13 -4
  560. package/src/components/image-editor/use-transform-image.js +14 -55
  561. package/src/components/image-size-control/index.js +1 -6
  562. package/src/components/index.js +2 -6
  563. package/src/components/inner-blocks/index.js +29 -33
  564. package/src/components/inner-blocks/index.native.js +27 -47
  565. package/src/components/inner-blocks/use-block-context.js +47 -0
  566. package/src/components/inserter/block-patterns-explorer/explorer.js +0 -1
  567. package/src/components/inserter/block-patterns-tab.js +9 -1
  568. package/src/components/inserter/block-types-tab.js +3 -4
  569. package/src/components/inserter/hooks/use-patterns-state.js +1 -6
  570. package/src/components/inserter/index.js +3 -4
  571. package/src/components/inserter/media-tab/hooks.js +167 -65
  572. package/src/components/inserter/media-tab/media-list.js +94 -26
  573. package/src/components/inserter/media-tab/media-panel.js +9 -20
  574. package/src/components/inserter/media-tab/media-tab.js +12 -4
  575. package/src/components/inserter/media-tab/utils.js +20 -10
  576. package/src/components/inserter/menu.js +8 -0
  577. package/src/components/inserter/preview-panel.js +4 -2
  578. package/src/components/inserter/search-results.js +2 -6
  579. package/src/components/inserter/stories/index.js +9 -9
  580. package/src/components/inserter/style.scss +58 -11
  581. package/src/components/inserter-list-item/index.js +0 -7
  582. package/src/components/inspector-controls/README.md +3 -7
  583. package/src/components/inspector-controls/fill.js +15 -1
  584. package/src/components/inspector-controls/fill.native.js +14 -1
  585. package/src/components/inspector-controls/groups.js +3 -0
  586. package/src/components/inspector-controls/index.js +2 -6
  587. package/src/components/inspector-controls/slot.js +14 -1
  588. package/src/components/inspector-controls/slot.native.js +14 -1
  589. package/src/components/inspector-controls-tabs/advanced-controls-panel.js +1 -1
  590. package/src/components/inspector-controls-tabs/index.js +2 -4
  591. package/src/components/inspector-controls-tabs/position-controls-panel.js +1 -1
  592. package/src/components/inspector-controls-tabs/styles-tab.js +5 -7
  593. package/src/components/inspector-controls-tabs/use-inspector-controls-tabs.js +21 -10
  594. package/src/components/justify-content-control/ui.js +9 -0
  595. package/src/components/link-control/index.js +59 -23
  596. package/src/components/link-control/style.scss +7 -24
  597. package/src/components/link-control/test/index.js +134 -5
  598. package/src/components/list-view/block.js +1 -1
  599. package/src/components/list-view/use-list-view-drop-zone.js +1 -1
  600. package/src/components/media-replace-flow/test/index.js +4 -12
  601. package/src/components/media-upload/index.native.js +2 -2
  602. package/src/components/off-canvas-editor/README.md +2 -2
  603. package/src/components/off-canvas-editor/appender.js +93 -37
  604. package/src/components/off-canvas-editor/block-contents.js +2 -1
  605. package/src/components/off-canvas-editor/block-select-button.js +12 -1
  606. package/src/components/off-canvas-editor/block.js +3 -42
  607. package/src/components/off-canvas-editor/branch.js +32 -5
  608. package/src/components/off-canvas-editor/index.js +20 -20
  609. package/src/components/off-canvas-editor/link-ui.js +2 -2
  610. package/src/components/off-canvas-editor/style.scss +5 -1
  611. package/src/components/off-canvas-editor/use-list-view-drop-zone.js +1 -1
  612. package/src/components/provider/index.js +33 -14
  613. package/src/components/provider/index.native.js +4 -3
  614. package/src/components/provider/test/experimental-provider.js +94 -0
  615. package/src/components/provider/test/use-block-sync.js +10 -0
  616. package/src/components/responsive-block-control/test/index.js +1 -5
  617. package/src/components/rich-text/use-before-input-rules.js +10 -2
  618. package/src/components/rich-text/utils.js +1 -1
  619. package/src/components/spacing-sizes-control/utils.js +2 -7
  620. package/src/components/tool-selector/index.js +1 -1
  621. package/src/components/url-input/test/button.js +24 -24
  622. package/src/components/url-popover/image-url-input-ui.js +7 -8
  623. package/src/components/url-popover/style.scss +0 -10
  624. package/src/components/use-block-display-information/index.js +1 -1
  625. package/src/components/warning/{style.scss → content.scss} +0 -0
  626. package/src/components/warning/test/index.js +1 -5
  627. package/src/content.scss +7 -0
  628. package/src/experiments.js +27 -0
  629. package/src/experiments.native.js +25 -0
  630. package/src/hooks/anchor.js +2 -1
  631. package/src/hooks/border.js +1 -1
  632. package/src/hooks/child-layout.js +6 -1
  633. package/src/hooks/color-panel.js +1 -1
  634. package/src/hooks/color.js +3 -3
  635. package/src/hooks/custom-class-name.js +2 -1
  636. package/src/hooks/dimensions.js +6 -6
  637. package/src/hooks/layout.scss +4 -0
  638. package/src/hooks/margin.js +1 -0
  639. package/src/hooks/padding.js +1 -0
  640. package/src/hooks/position.js +56 -36
  641. package/src/hooks/test/align.native.js +1 -1
  642. package/src/hooks/test/utils.js +104 -0
  643. package/src/hooks/typography.js +1 -1
  644. package/src/hooks/use-color-props.js +3 -3
  645. package/src/hooks/utils.js +68 -2
  646. package/src/index.js +1 -0
  647. package/src/layouts/constrained.js +3 -0
  648. package/src/layouts/flex.js +66 -14
  649. package/src/layouts/flow.js +0 -9
  650. package/src/store/actions.js +2 -26
  651. package/src/store/defaults.js +7 -2
  652. package/src/store/index.js +8 -2
  653. package/src/store/private-actions.js +65 -0
  654. package/src/store/private-selectors.js +20 -0
  655. package/src/store/reducer.js +1 -1
  656. package/src/store/selectors.js +103 -62
  657. package/src/store/test/actions.js +0 -18
  658. package/src/store/test/private-actions.js +22 -0
  659. package/src/store/test/private-selectors.js +52 -0
  660. package/src/store/test/selectors.js +52 -54
  661. package/src/style.scss +3 -5
  662. package/src/utils/block-variation-transforms.js +1 -1
  663. package/src/utils/parse-css-unit-to-px.js +3 -1
  664. package/src/utils/test/parse-css-unit-to-px.js +16 -24
  665. package/src/utils/transform-styles/index.js +1 -6
  666. package/build/components/inner-blocks/get-block-context.js +0 -45
  667. package/build/components/inner-blocks/get-block-context.js.map +0 -1
  668. package/build/components/off-canvas-editor/block-edit-button.js +0 -50
  669. package/build/components/off-canvas-editor/block-edit-button.js.map +0 -1
  670. package/build-module/components/inner-blocks/get-block-context.js +0 -37
  671. package/build-module/components/inner-blocks/get-block-context.js.map +0 -1
  672. package/build-module/components/off-canvas-editor/block-edit-button.js +0 -35
  673. package/build-module/components/off-canvas-editor/block-edit-button.js.map +0 -1
  674. package/src/components/inner-blocks/get-block-context.js +0 -39
  675. package/src/components/off-canvas-editor/block-edit-button.js +0 -27
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/tool-selector/index.js"],"names":["Dropdown","Button","MenuItemsChoice","SVG","Path","NavigableMenu","__","useSelect","useDispatch","forwardRef","Icon","edit","editIcon","store","blockEditorStore","selectIcon","ToolSelector","props","ref","mode","select","__unstableGetEditorMode","__unstableSetEditorMode","isOpen","onToggle","value","label"],"mappings":";;;AAAA;AACA;AACA;AACA,SACCA,QADD,EAECC,MAFD,EAGCC,eAHD,EAICC,GAJD,EAKCC,IALD,EAMCC,aAND,QAOO,uBAPP;AAQA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,SAAT,EAAoBC,WAApB,QAAuC,iBAAvC;AACA,SAASC,UAAT,QAA2B,oBAA3B;AACA,SAASC,IAAT,EAAeC,IAAI,IAAIC,QAAvB,QAAuC,kBAAvC;AAEA;AACA;AACA;;AACA,SAASC,KAAK,IAAIC,gBAAlB,QAA0C,aAA1C;AAEA,MAAMC,UAAU,GACf,cAAC,GAAD;AACC,EAAA,KAAK,EAAC,4BADP;AAEC,EAAA,KAAK,EAAC,IAFP;AAGC,EAAA,MAAM,EAAC,IAHR;AAIC,EAAA,OAAO,EAAC;AAJT,GAMC,cAAC,IAAD;AAAM,EAAA,CAAC,EAAC;AAAR,EAND,CADD;;AAWA,SAASC,YAAT,CAAuBC,KAAvB,EAA8BC,GAA9B,EAAoC;AACnC,QAAMC,IAAI,GAAGZ,SAAS,CACnBa,MAAF,IAAcA,MAAM,CAAEN,gBAAF,CAAN,CAA2BO,uBAA3B,EADO,EAErB,EAFqB,CAAtB;AAIA,QAAM;AAAEC,IAAAA;AAAF,MAA8Bd,WAAW,CAAEM,gBAAF,CAA/C;AAEA,SACC,cAAC,QAAD;AACC,IAAA,YAAY,EAAG;AAAA,UAAE;AAAES,QAAAA,MAAF;AAAUC,QAAAA;AAAV,OAAF;AAAA,aACd,cAAC,MAAD,eACMP,KADN;AAEC,QAAA,GAAG,EAAGC,GAFP;AAGC,QAAA,IAAI,EAAGC,IAAI,KAAK,YAAT,GAAwBJ,UAAxB,GAAqCH,QAH7C;AAIC,yBAAgBW,MAJjB;AAKC,yBAAc,MALf;AAMC,QAAA,OAAO,EAAGC;AACV;AAPD;AAQC,QAAA,KAAK,EAAGlB,EAAE,CAAE,OAAF;AARX,SADc;AAAA,KADhB;AAaC,IAAA,QAAQ,EAAC,cAbV;AAcC,IAAA,aAAa,EAAG,MACf,8BACC,cAAC,aAAD;AAAe,MAAA,IAAI,EAAC,MAApB;AAA2B,oBAAaA,EAAE,CAAE,OAAF;AAA1C,OACC,cAAC,eAAD;AACC,MAAA,KAAK,EACJa,IAAI,KAAK,YAAT,GAAwB,YAAxB,GAAuC,MAFzC;AAIC,MAAA,QAAQ,EAAGG,uBAJZ;AAKC,MAAA,OAAO,EAAG,CACT;AACCG,QAAAA,KAAK,EAAE,MADR;AAECC,QAAAA,KAAK,EACJ,8BACC,cAAC,IAAD;AAAM,UAAA,IAAI,EAAGd;AAAb,UADD,EAEGN,EAAE,CAAE,MAAF,CAFL;AAHF,OADS,EAUT;AACCmB,QAAAA,KAAK,EAAE,YADR;AAECC,QAAAA,KAAK,EACJ,8BACGX,UADH,EAEGT,EAAE,CAAE,QAAF,CAFL;AAHF,OAVS;AALX,MADD,CADD,EA6BC;AAAK,MAAA,SAAS,EAAC;AAAf,OACGA,EAAE,CACH,kJADG,CADL,CA7BD;AAfF,IADD;AAsDA;;AAED,eAAeG,UAAU,CAAEO,YAAF,CAAzB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tDropdown,\n\tButton,\n\tMenuItemsChoice,\n\tSVG,\n\tPath,\n\tNavigableMenu,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { forwardRef } from '@wordpress/element';\nimport { Icon, edit as editIcon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\n\nconst selectIcon = (\n\t<SVG\n\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\twidth=\"24\"\n\t\theight=\"24\"\n\t\tviewBox=\"0 0 24 24\"\n\t>\n\t\t<Path d=\"M9.4 20.5L5.2 3.8l14.6 9-2 .3c-.2 0-.4.1-.7.1-.9.2-1.6.3-2.2.5-.8.3-1.4.5-1.8.8-.4.3-.8.8-1.3 1.5-.4.5-.8 1.2-1.2 2l-.3.6-.9 1.9zM7.6 7.1l2.4 9.3c.2-.4.5-.8.7-1.1.6-.8 1.1-1.4 1.6-1.8.5-.4 1.3-.8 2.2-1.1l1.2-.3-8.1-5z\" />\n\t</SVG>\n);\n\nfunction ToolSelector( props, ref ) {\n\tconst mode = useSelect(\n\t\t( select ) => select( blockEditorStore ).__unstableGetEditorMode(),\n\t\t[]\n\t);\n\tconst { __unstableSetEditorMode } = useDispatch( blockEditorStore );\n\n\treturn (\n\t\t<Dropdown\n\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t<Button\n\t\t\t\t\t{ ...props }\n\t\t\t\t\tref={ ref }\n\t\t\t\t\ticon={ mode === 'navigation' ? selectIcon : editIcon }\n\t\t\t\t\taria-expanded={ isOpen }\n\t\t\t\t\taria-haspopup=\"true\"\n\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\t\t\tlabel={ __( 'Tools' ) }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\tposition=\"bottom right\"\n\t\t\trenderContent={ () => (\n\t\t\t\t<>\n\t\t\t\t\t<NavigableMenu role=\"menu\" aria-label={ __( 'Tools' ) }>\n\t\t\t\t\t\t<MenuItemsChoice\n\t\t\t\t\t\t\tvalue={\n\t\t\t\t\t\t\t\tmode === 'navigation' ? 'navigation' : 'edit'\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tonSelect={ __unstableSetEditorMode }\n\t\t\t\t\t\t\tchoices={ [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tvalue: 'edit',\n\t\t\t\t\t\t\t\t\tlabel: (\n\t\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t\t<Icon icon={ editIcon } />\n\t\t\t\t\t\t\t\t\t\t\t{ __( 'Edit' ) }\n\t\t\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tvalue: 'navigation',\n\t\t\t\t\t\t\t\t\tlabel: (\n\t\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t\t{ selectIcon }\n\t\t\t\t\t\t\t\t\t\t\t{ __( 'Select' ) }\n\t\t\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t] }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</NavigableMenu>\n\t\t\t\t\t<div className=\"block-editor-tool-selector__help\">\n\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t'Tools provide different interactions for selecting, navigating, and editing blocks. Toggle between select and edit by pressing Escape and Enter.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t</div>\n\t\t\t\t</>\n\t\t\t) }\n\t\t/>\n\t);\n}\n\nexport default forwardRef( ToolSelector );\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/tool-selector/index.js"],"names":["Dropdown","Button","MenuItemsChoice","SVG","Path","NavigableMenu","__","useSelect","useDispatch","forwardRef","Icon","edit","editIcon","store","blockEditorStore","selectIcon","ToolSelector","props","ref","mode","select","__unstableGetEditorMode","__unstableSetEditorMode","isOpen","onToggle","placement","value","label"],"mappings":";;;AAAA;AACA;AACA;AACA,SACCA,QADD,EAECC,MAFD,EAGCC,eAHD,EAICC,GAJD,EAKCC,IALD,EAMCC,aAND,QAOO,uBAPP;AAQA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,SAAT,EAAoBC,WAApB,QAAuC,iBAAvC;AACA,SAASC,UAAT,QAA2B,oBA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B,GAAuC,MAFzC;AAIC,MAAA,QAAQ,EAAGG,uBAJZ;AAKC,MAAA,OAAO,EAAG,CACT;AACCI,QAAAA,KAAK,EAAE,MADR;AAECC,QAAAA,KAAK,EACJ,8BACC,cAAC,IAAD;AAAM,UAAA,IAAI,EAAGf;AAAb,UADD,EAEGN,EAAE,CAAE,MAAF,CAFL;AAHF,OADS,EAUT;AACCoB,QAAAA,KAAK,EAAE,YADR;AAECC,QAAAA,KAAK,EACJ,8BACGZ,UADH,EAEGT,EAAE,CAAE,QAAF,CAFL;AAHF,OAVS;AALX,MADD,CADD,EA6BC;AAAK,MAAA,SAAS,EAAC;AAAf,OACGA,EAAE,CACH,kJADG,CADL,CA7BD;AAfF,IADD;AAsDA;;AAED,eAAeG,UAAU,CAAEO,YAAF,CAAzB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tDropdown,\n\tButton,\n\tMenuItemsChoice,\n\tSVG,\n\tPath,\n\tNavigableMenu,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { forwardRef } from '@wordpress/element';\nimport { Icon, edit as editIcon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\n\nconst selectIcon = (\n\t<SVG\n\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\twidth=\"24\"\n\t\theight=\"24\"\n\t\tviewBox=\"0 0 24 24\"\n\t>\n\t\t<Path d=\"M9.4 20.5L5.2 3.8l14.6 9-2 .3c-.2 0-.4.1-.7.1-.9.2-1.6.3-2.2.5-.8.3-1.4.5-1.8.8-.4.3-.8.8-1.3 1.5-.4.5-.8 1.2-1.2 2l-.3.6-.9 1.9zM7.6 7.1l2.4 9.3c.2-.4.5-.8.7-1.1.6-.8 1.1-1.4 1.6-1.8.5-.4 1.3-.8 2.2-1.1l1.2-.3-8.1-5z\" />\n\t</SVG>\n);\n\nfunction ToolSelector( props, ref ) {\n\tconst mode = useSelect(\n\t\t( select ) => select( blockEditorStore ).__unstableGetEditorMode(),\n\t\t[]\n\t);\n\tconst { __unstableSetEditorMode } = useDispatch( blockEditorStore );\n\n\treturn (\n\t\t<Dropdown\n\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t<Button\n\t\t\t\t\t{ ...props }\n\t\t\t\t\tref={ ref }\n\t\t\t\t\ticon={ mode === 'navigation' ? selectIcon : editIcon }\n\t\t\t\t\taria-expanded={ isOpen }\n\t\t\t\t\taria-haspopup=\"true\"\n\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\t\t\tlabel={ __( 'Tools' ) }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\tpopoverProps={ { placement: 'bottom-start' } }\n\t\t\trenderContent={ () => (\n\t\t\t\t<>\n\t\t\t\t\t<NavigableMenu role=\"menu\" aria-label={ __( 'Tools' ) }>\n\t\t\t\t\t\t<MenuItemsChoice\n\t\t\t\t\t\t\tvalue={\n\t\t\t\t\t\t\t\tmode === 'navigation' ? 'navigation' : 'edit'\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tonSelect={ __unstableSetEditorMode }\n\t\t\t\t\t\t\tchoices={ [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tvalue: 'edit',\n\t\t\t\t\t\t\t\t\tlabel: (\n\t\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t\t<Icon icon={ editIcon } />\n\t\t\t\t\t\t\t\t\t\t\t{ __( 'Edit' ) }\n\t\t\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tvalue: 'navigation',\n\t\t\t\t\t\t\t\t\tlabel: (\n\t\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t\t{ selectIcon }\n\t\t\t\t\t\t\t\t\t\t\t{ __( 'Select' ) }\n\t\t\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t] }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</NavigableMenu>\n\t\t\t\t\t<div className=\"block-editor-tool-selector__help\">\n\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t'Tools provide different interactions for selecting, navigating, and editing blocks. Toggle between select and edit by pressing Escape and Enter.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t</div>\n\t\t\t\t</>\n\t\t\t) }\n\t\t/>\n\t);\n}\n\nexport default forwardRef( ToolSelector );\n"]}
@@ -1,16 +1,11 @@
1
1
  import { createElement, Fragment } from "@wordpress/element";
2
2
 
3
- /**
4
- * External dependencies
5
- */
6
- import { map } from 'lodash';
7
3
  /**
8
4
  * WordPress dependencies
9
5
  */
10
-
11
6
  import { __ } from '@wordpress/i18n';
12
7
  import { useRef, useState, useCallback } from '@wordpress/element';
13
- import { ToolbarButton, Button, NavigableMenu, MenuItem, ToggleControl, TextControl, SVG, Path } from '@wordpress/components';
8
+ import { ToolbarButton, Button, NavigableMenu, MenuItem, ToggleControl, TextControl, SVG, Path, __experimentalVStack as VStack } from '@wordpress/components';
14
9
  import { link as linkIcon, close } from '@wordpress/icons';
15
10
  /**
16
11
  * Internal dependencies
@@ -203,15 +198,20 @@ const ImageURLInputUI = _ref => {
203
198
  });
204
199
  };
205
200
 
206
- const advancedOptions = createElement(Fragment, null, createElement(ToggleControl, {
201
+ const advancedOptions = createElement(VStack, {
202
+ spacing: "3"
203
+ }, createElement(ToggleControl, {
204
+ __nextHasNoMarginBottom: true,
207
205
  label: __('Open in new tab'),
208
206
  onChange: onSetNewTab,
209
207
  checked: linkTarget === '_blank'
210
208
  }), createElement(TextControl, {
209
+ __nextHasNoMarginBottom: true,
211
210
  label: __('Link rel'),
212
211
  value: rel !== null && rel !== void 0 ? rel : '',
213
212
  onChange: onSetLinkRel
214
213
  }), createElement(TextControl, {
214
+ __nextHasNoMarginBottom: true,
215
215
  label: __('Link CSS Class'),
216
216
  value: linkClass || '',
217
217
  onChange: onSetLinkClass
@@ -230,7 +230,7 @@ const ImageURLInputUI = _ref => {
230
230
  onFocusOutside: onFocusOutside(),
231
231
  onClose: closeLinkUI,
232
232
  renderSettings: () => advancedOptions,
233
- additionalControls: !linkEditorValue && createElement(NavigableMenu, null, map(getLinkDestinations(), link => createElement(MenuItem, {
233
+ additionalControls: !linkEditorValue && createElement(NavigableMenu, null, getLinkDestinations().map(link => createElement(MenuItem, {
234
234
  key: link.linkDestination,
235
235
  icon: link.icon,
236
236
  onClick: () => {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/url-popover/image-url-input-ui.js"],"names":["map","__","useRef","useState","useCallback","ToolbarButton","Button","NavigableMenu","MenuItem","ToggleControl","TextControl","SVG","Path","link","linkIcon","close","URLPopover","LINK_DESTINATION_NONE","LINK_DESTINATION_CUSTOM","LINK_DESTINATION_MEDIA","LINK_DESTINATION_ATTACHMENT","NEW_TAB_REL","icon","ImageURLInputUI","linkDestination","onChangeUrl","url","mediaType","mediaUrl","mediaLink","linkTarget","linkClass","rel","isOpen","setIsOpen","popoverAnchor","setPopoverAnchor","openLinkUI","isEditingLink","setIsEditingLink","urlInput","setUrlInput","autocompleteRef","startEditLink","stopEditLink","closeLinkUI","getUpdatedLinkTargetSettings","value","newLinkTarget","undefined","updatedRel","rels","split","forEach","relVal","includes","push","join","filter","length","onFocusOutside","event","autocompleteElement","current","contains","target","onSubmitLinkChange","selectedDestination","getLinkDestinations","find","destination","href","preventDefault","onLinkRemove","linkDestinations","title","onSetHref","linkDestinationInput","onSetNewTab","updatedLinkTarget","onSetLinkRel","onSetLinkClass","advancedOptions","linkEditorValue","urlLabel","__experimentalImageURLInputUI"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,GAAT,QAAoB,QAApB;AAEA;AACA;AACA;;AACA,SAASC,EAAT,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AAF,IAASY,aAAX,KACD,cAAC,UAAD,CAAY,UAAZ;AACC,IAAA,SAAS,EAAC,qDADX;AAEC,IAAA,KAAK,EAAG6C,eAFT;AAGC,IAAA,kBAAkB,EAAG1C,WAHtB;AAIC,IAAA,QAAQ,EAAGyB,kBAAkB,EAJ9B;AAKC,IAAA,eAAe,EAAGxB;AALnB,IA1BF,EAkCGhB,GAAG,IAAI,CAAEY,aAAT,IACD,8BACC,cAAC,UAAD,CAAY,UAAZ;AACC,IAAA,SAAS,EAAC,qDADX;AAEC,IAAA,GAAG,EAAGZ,GAFP;AAGC,IAAA,eAAe,EAAGiB,aAHnB;AAIC,IAAA,QAAQ,EAAGyC;AAJZ,IADD,EAOC,cAAC,MAAD;AACC,IAAA,IAAI,EAAGrE,KADR;AAEC,IAAA,KAAK,EAAGd,EAAE,CAAE,aAAF,CAFX;AAGC,IAAA,OAAO,EAAGwE;AAHX,IAPD,CAnCF,CAVF,CADD;AAgEA,CA1QD;;AA4QA,SAASlD,eAAe,IAAI8D,6BAA5B","sourcesContent":["/**\n * External dependencies\n */\nimport { map } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useRef, useState, useCallback } from '@wordpress/element';\nimport {\n\tToolbarButton,\n\tButton,\n\tNavigableMenu,\n\tMenuItem,\n\tToggleControl,\n\tTextControl,\n\tSVG,\n\tPath,\n} from '@wordpress/components';\nimport { link as linkIcon, close } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport URLPopover from './index';\n\nconst LINK_DESTINATION_NONE = 'none';\nconst LINK_DESTINATION_CUSTOM = 'custom';\nconst LINK_DESTINATION_MEDIA = 'media';\nconst LINK_DESTINATION_ATTACHMENT = 'attachment';\nconst NEW_TAB_REL = [ 'noreferrer', 'noopener' ];\n\nconst icon = (\n\t<SVG viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n\t\t<Path d=\"M0,0h24v24H0V0z\" fill=\"none\" />\n\t\t<Path d=\"m19 5v14h-14v-14h14m0-2h-14c-1.1 0-2 0.9-2 2v14c0 1.1 0.9 2 2 2h14c1.1 0 2-0.9 2-2v-14c0-1.1-0.9-2-2-2z\" />\n\t\t<Path d=\"m14.14 11.86l-3 3.87-2.14-2.59-3 3.86h12l-3.86-5.14z\" />\n\t</SVG>\n);\n\nconst ImageURLInputUI = ( {\n\tlinkDestination,\n\tonChangeUrl,\n\turl,\n\tmediaType = 'image',\n\tmediaUrl,\n\tmediaLink,\n\tlinkTarget,\n\tlinkClass,\n\trel,\n} ) => {\n\tconst [ isOpen, setIsOpen ] = useState( false );\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the popover's anchor updates.\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState( null );\n\tconst openLinkUI = useCallback( () => {\n\t\tsetIsOpen( true );\n\t} );\n\n\tconst [ isEditingLink, setIsEditingLink ] = useState( false );\n\tconst [ urlInput, setUrlInput ] = useState( null );\n\n\tconst autocompleteRef = useRef( null );\n\n\tconst startEditLink = useCallback( () => {\n\t\tif (\n\t\t\tlinkDestination === LINK_DESTINATION_MEDIA ||\n\t\t\tlinkDestination === LINK_DESTINATION_ATTACHMENT\n\t\t) {\n\t\t\tsetUrlInput( '' );\n\t\t}\n\t\tsetIsEditingLink( true );\n\t} );\n\n\tconst stopEditLink = useCallback( () => {\n\t\tsetIsEditingLink( false );\n\t} );\n\n\tconst closeLinkUI = useCallback( () => {\n\t\tsetUrlInput( null );\n\t\tstopEditLink();\n\t\tsetIsOpen( false );\n\t} );\n\n\tconst getUpdatedLinkTargetSettings = ( value ) => {\n\t\tconst newLinkTarget = value ? '_blank' : undefined;\n\n\t\tlet updatedRel;\n\t\tif ( newLinkTarget ) {\n\t\t\tconst rels = ( rel ?? '' ).split( ' ' );\n\t\t\tNEW_TAB_REL.forEach( ( relVal ) => {\n\t\t\t\tif ( ! rels.includes( relVal ) ) {\n\t\t\t\t\trels.push( relVal );\n\t\t\t\t}\n\t\t\t} );\n\t\t\tupdatedRel = rels.join( ' ' );\n\t\t} else {\n\t\t\tconst rels = ( rel ?? '' )\n\t\t\t\t.split( ' ' )\n\t\t\t\t.filter(\n\t\t\t\t\t( relVal ) => NEW_TAB_REL.includes( relVal ) === false\n\t\t\t\t);\n\t\t\tupdatedRel = rels.length ? rels.join( ' ' ) : undefined;\n\t\t}\n\n\t\treturn {\n\t\t\tlinkTarget: newLinkTarget,\n\t\t\trel: updatedRel,\n\t\t};\n\t};\n\n\tconst onFocusOutside = useCallback( () => {\n\t\treturn ( event ) => {\n\t\t\t// The autocomplete suggestions list renders in a separate popover (in a portal),\n\t\t\t// so onFocusOutside fails to detect that a click on a suggestion occurred in the\n\t\t\t// LinkContainer. Detect clicks on autocomplete suggestions using a ref here, and\n\t\t\t// return to avoid the popover being closed.\n\t\t\tconst autocompleteElement = autocompleteRef.current;\n\t\t\tif (\n\t\t\t\tautocompleteElement &&\n\t\t\t\tautocompleteElement.contains( event.target )\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsetIsOpen( false );\n\t\t\tsetUrlInput( null );\n\t\t\tstopEditLink();\n\t\t};\n\t} );\n\n\tconst onSubmitLinkChange = useCallback( () => {\n\t\treturn ( event ) => {\n\t\t\tif ( urlInput ) {\n\t\t\t\t// It is possible the entered URL actually matches a named link destination.\n\t\t\t\t// This check will ensure our link destination is correct.\n\t\t\t\tconst selectedDestination =\n\t\t\t\t\tgetLinkDestinations().find(\n\t\t\t\t\t\t( destination ) => destination.url === urlInput\n\t\t\t\t\t)?.linkDestination || LINK_DESTINATION_CUSTOM;\n\n\t\t\t\tonChangeUrl( {\n\t\t\t\t\thref: urlInput,\n\t\t\t\t\tlinkDestination: selectedDestination,\n\t\t\t\t} );\n\t\t\t}\n\t\t\tstopEditLink();\n\t\t\tsetUrlInput( null );\n\t\t\tevent.preventDefault();\n\t\t};\n\t} );\n\n\tconst onLinkRemove = useCallback( () => {\n\t\tonChangeUrl( {\n\t\t\tlinkDestination: LINK_DESTINATION_NONE,\n\t\t\thref: '',\n\t\t} );\n\t} );\n\n\tconst getLinkDestinations = () => {\n\t\tconst linkDestinations = [\n\t\t\t{\n\t\t\t\tlinkDestination: LINK_DESTINATION_MEDIA,\n\t\t\t\ttitle: __( 'Media File' ),\n\t\t\t\turl: mediaType === 'image' ? mediaUrl : undefined,\n\t\t\t\ticon,\n\t\t\t},\n\t\t];\n\t\tif ( mediaType === 'image' && mediaLink ) {\n\t\t\tlinkDestinations.push( {\n\t\t\t\tlinkDestination: LINK_DESTINATION_ATTACHMENT,\n\t\t\t\ttitle: __( 'Attachment Page' ),\n\t\t\t\turl: mediaType === 'image' ? mediaLink : undefined,\n\t\t\t\ticon: (\n\t\t\t\t\t<SVG viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n\t\t\t\t\t\t<Path d=\"M0 0h24v24H0V0z\" fill=\"none\" />\n\t\t\t\t\t\t<Path d=\"M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zM6 20V4h7v5h5v11H6z\" />\n\t\t\t\t\t</SVG>\n\t\t\t\t),\n\t\t\t} );\n\t\t}\n\t\treturn linkDestinations;\n\t};\n\n\tconst onSetHref = ( value ) => {\n\t\tconst linkDestinations = getLinkDestinations();\n\t\tlet linkDestinationInput;\n\t\tif ( ! value ) {\n\t\t\tlinkDestinationInput = LINK_DESTINATION_NONE;\n\t\t} else {\n\t\t\tlinkDestinationInput = (\n\t\t\t\tlinkDestinations.find( ( destination ) => {\n\t\t\t\t\treturn destination.url === value;\n\t\t\t\t} ) || { linkDestination: LINK_DESTINATION_CUSTOM }\n\t\t\t).linkDestination;\n\t\t}\n\t\tonChangeUrl( {\n\t\t\tlinkDestination: linkDestinationInput,\n\t\t\thref: value,\n\t\t} );\n\t};\n\n\tconst onSetNewTab = ( value ) => {\n\t\tconst updatedLinkTarget = getUpdatedLinkTargetSettings( value );\n\t\tonChangeUrl( updatedLinkTarget );\n\t};\n\n\tconst onSetLinkRel = ( value ) => {\n\t\tonChangeUrl( { rel: value } );\n\t};\n\n\tconst onSetLinkClass = ( value ) => {\n\t\tonChangeUrl( { linkClass: value } );\n\t};\n\n\tconst advancedOptions = (\n\t\t<>\n\t\t\t<ToggleControl\n\t\t\t\tlabel={ __( 'Open in new tab' ) }\n\t\t\t\tonChange={ onSetNewTab }\n\t\t\t\tchecked={ linkTarget === '_blank' }\n\t\t\t/>\n\t\t\t<TextControl\n\t\t\t\tlabel={ __( 'Link rel' ) }\n\t\t\t\tvalue={ rel ?? '' }\n\t\t\t\tonChange={ onSetLinkRel }\n\t\t\t/>\n\t\t\t<TextControl\n\t\t\t\tlabel={ __( 'Link CSS Class' ) }\n\t\t\t\tvalue={ linkClass || '' }\n\t\t\t\tonChange={ onSetLinkClass }\n\t\t\t/>\n\t\t</>\n\t);\n\n\tconst linkEditorValue = urlInput !== null ? urlInput : url;\n\n\tconst urlLabel = (\n\t\tgetLinkDestinations().find(\n\t\t\t( destination ) => destination.linkDestination === linkDestination\n\t\t) || {}\n\t).title;\n\n\treturn (\n\t\t<>\n\t\t\t<ToolbarButton\n\t\t\t\ticon={ linkIcon }\n\t\t\t\tclassName=\"components-toolbar__control\"\n\t\t\t\tlabel={ url ? __( 'Edit link' ) : __( 'Insert link' ) }\n\t\t\t\taria-expanded={ isOpen }\n\t\t\t\tonClick={ openLinkUI }\n\t\t\t\tref={ setPopoverAnchor }\n\t\t\t/>\n\t\t\t{ isOpen && (\n\t\t\t\t<URLPopover\n\t\t\t\t\tanchor={ popoverAnchor }\n\t\t\t\t\tonFocusOutside={ onFocusOutside() }\n\t\t\t\t\tonClose={ closeLinkUI }\n\t\t\t\t\trenderSettings={ () => advancedOptions }\n\t\t\t\t\tadditionalControls={\n\t\t\t\t\t\t! linkEditorValue && (\n\t\t\t\t\t\t\t<NavigableMenu>\n\t\t\t\t\t\t\t\t{ map( getLinkDestinations(), ( link ) => (\n\t\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\t\tkey={ link.linkDestination }\n\t\t\t\t\t\t\t\t\t\ticon={ link.icon }\n\t\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\t\tsetUrlInput( null );\n\t\t\t\t\t\t\t\t\t\t\tonSetHref( link.url );\n\t\t\t\t\t\t\t\t\t\t\tstopEditLink();\n\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ link.title }\n\t\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t\t\t</NavigableMenu>\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t>\n\t\t\t\t\t{ ( ! url || isEditingLink ) && (\n\t\t\t\t\t\t<URLPopover.LinkEditor\n\t\t\t\t\t\t\tclassName=\"block-editor-format-toolbar__link-container-content\"\n\t\t\t\t\t\t\tvalue={ linkEditorValue }\n\t\t\t\t\t\t\tonChangeInputValue={ setUrlInput }\n\t\t\t\t\t\t\tonSubmit={ onSubmitLinkChange() }\n\t\t\t\t\t\t\tautocompleteRef={ autocompleteRef }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ url && ! isEditingLink && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<URLPopover.LinkViewer\n\t\t\t\t\t\t\t\tclassName=\"block-editor-format-toolbar__link-container-content\"\n\t\t\t\t\t\t\t\turl={ url }\n\t\t\t\t\t\t\t\tonEditLinkClick={ startEditLink }\n\t\t\t\t\t\t\t\turlLabel={ urlLabel }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\ticon={ close }\n\t\t\t\t\t\t\t\tlabel={ __( 'Remove link' ) }\n\t\t\t\t\t\t\t\tonClick={ onLinkRemove }\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</URLPopover>\n\t\t\t) }\n\t\t</>\n\t);\n};\n\nexport { ImageURLInputUI as __experimentalImageURLInputUI };\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/url-popover/image-url-input-ui.js"],"names":["__","useRef","useState","useCallback","ToolbarButton","Button","NavigableMenu","MenuItem","ToggleControl","TextControl","SVG","Path","__experimentalVStack","VStack","link","linkIcon","close","URLPopover","LINK_DESTINATION_NONE","LINK_DESTINATION_CUSTOM","LINK_DESTINATION_MEDIA","LINK_DESTINATION_ATTACHMENT","NEW_TAB_REL","icon","ImageURLInputUI","linkDestination","onChangeUrl","url","mediaType","mediaUrl","mediaLink","linkTarget","linkClass","rel","isOpen","setIsOpen","popoverAnchor","setPopoverAnchor","openLinkUI","isEditingLink","setIsEditingLink","urlInput","setUrlInput","autocompleteRef","startEditLink","stopEditLink","closeLinkUI","getUpdatedLinkTargetSettings","value","newLinkTarget","undefined","updatedRel","rels","split","forEach","relVal","includes","push","join","filter","length","onFocusOutside","event","autocompleteElement","current","contains","target","onSubmitLinkChange","selectedDestination","getLinkDestinations","find","destination","href","preventDefault","onLinkRemove","linkDestinations","title","onSetHref","linkDestinationInput","onSetNewTab","updatedLinkTarget","onSetLinkRel","onSetLinkClass","advancedOptions","linkEditorValue","urlLabel","map","__experimentalImageURLInputUI"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SAASC,MAAT,EAAiBC,QAAjB,EAA2BC,WAA3B,QAA8C,oBAA9C;AACA,SACCC,aADD,EAECC,MAFD,EAGCC,aAHD,EAICC,QAJD,EAKCC,aALD,EAMCC,WAND,EAOCC,GAPD,EAQCC,IARD,EASCC,oBAAoB,IAAIC,MATzB,QAUO,uBAVP;AAWA,SAASC,IAAI,IAAIC,QAAjB,EAA2BC,KAA3B,QAAwC,kBAAxC;AAEA;AACA;AACA;;AACA,OAAOC,UAAP,MAAuB,SAAvB;AAEA,MAAMC,qBAAqB,GAAG,M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AAGxB;AALnB,IA1BF,EAkCGhB,GAAG,IAAI,CAAEY,aAAT,IACD,8BACC,cAAC,UAAD,CAAY,UAAZ;AACC,IAAA,SAAS,EAAC,qDADX;AAEC,IAAA,GAAG,EAAGZ,GAFP;AAGC,IAAA,eAAe,EAAGiB,aAHnB;AAIC,IAAA,QAAQ,EAAGyC;AAJZ,IADD,EAOC,cAAC,MAAD;AACC,IAAA,IAAI,EAAGrE,KADR;AAEC,IAAA,KAAK,EAAGhB,EAAE,CAAE,aAAF,CAFX;AAGC,IAAA,OAAO,EAAG0E;AAHX,IAPD,CAnCF,CAVF,CADD;AAgEA,CA7QD;;AA+QA,SAASlD,eAAe,IAAI+D,6BAA5B","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useRef, useState, useCallback } from '@wordpress/element';\nimport {\n\tToolbarButton,\n\tButton,\n\tNavigableMenu,\n\tMenuItem,\n\tToggleControl,\n\tTextControl,\n\tSVG,\n\tPath,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { link as linkIcon, close } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport URLPopover from './index';\n\nconst LINK_DESTINATION_NONE = 'none';\nconst LINK_DESTINATION_CUSTOM = 'custom';\nconst LINK_DESTINATION_MEDIA = 'media';\nconst LINK_DESTINATION_ATTACHMENT = 'attachment';\nconst NEW_TAB_REL = [ 'noreferrer', 'noopener' ];\n\nconst icon = (\n\t<SVG viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n\t\t<Path d=\"M0,0h24v24H0V0z\" fill=\"none\" />\n\t\t<Path d=\"m19 5v14h-14v-14h14m0-2h-14c-1.1 0-2 0.9-2 2v14c0 1.1 0.9 2 2 2h14c1.1 0 2-0.9 2-2v-14c0-1.1-0.9-2-2-2z\" />\n\t\t<Path d=\"m14.14 11.86l-3 3.87-2.14-2.59-3 3.86h12l-3.86-5.14z\" />\n\t</SVG>\n);\n\nconst ImageURLInputUI = ( {\n\tlinkDestination,\n\tonChangeUrl,\n\turl,\n\tmediaType = 'image',\n\tmediaUrl,\n\tmediaLink,\n\tlinkTarget,\n\tlinkClass,\n\trel,\n} ) => {\n\tconst [ isOpen, setIsOpen ] = useState( false );\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the popover's anchor updates.\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState( null );\n\tconst openLinkUI = useCallback( () => {\n\t\tsetIsOpen( true );\n\t} );\n\n\tconst [ isEditingLink, setIsEditingLink ] = useState( false );\n\tconst [ urlInput, setUrlInput ] = useState( null );\n\n\tconst autocompleteRef = useRef( null );\n\n\tconst startEditLink = useCallback( () => {\n\t\tif (\n\t\t\tlinkDestination === LINK_DESTINATION_MEDIA ||\n\t\t\tlinkDestination === LINK_DESTINATION_ATTACHMENT\n\t\t) {\n\t\t\tsetUrlInput( '' );\n\t\t}\n\t\tsetIsEditingLink( true );\n\t} );\n\n\tconst stopEditLink = useCallback( () => {\n\t\tsetIsEditingLink( false );\n\t} );\n\n\tconst closeLinkUI = useCallback( () => {\n\t\tsetUrlInput( null );\n\t\tstopEditLink();\n\t\tsetIsOpen( false );\n\t} );\n\n\tconst getUpdatedLinkTargetSettings = ( value ) => {\n\t\tconst newLinkTarget = value ? '_blank' : undefined;\n\n\t\tlet updatedRel;\n\t\tif ( newLinkTarget ) {\n\t\t\tconst rels = ( rel ?? '' ).split( ' ' );\n\t\t\tNEW_TAB_REL.forEach( ( relVal ) => {\n\t\t\t\tif ( ! rels.includes( relVal ) ) {\n\t\t\t\t\trels.push( relVal );\n\t\t\t\t}\n\t\t\t} );\n\t\t\tupdatedRel = rels.join( ' ' );\n\t\t} else {\n\t\t\tconst rels = ( rel ?? '' )\n\t\t\t\t.split( ' ' )\n\t\t\t\t.filter(\n\t\t\t\t\t( relVal ) => NEW_TAB_REL.includes( relVal ) === false\n\t\t\t\t);\n\t\t\tupdatedRel = rels.length ? rels.join( ' ' ) : undefined;\n\t\t}\n\n\t\treturn {\n\t\t\tlinkTarget: newLinkTarget,\n\t\t\trel: updatedRel,\n\t\t};\n\t};\n\n\tconst onFocusOutside = useCallback( () => {\n\t\treturn ( event ) => {\n\t\t\t// The autocomplete suggestions list renders in a separate popover (in a portal),\n\t\t\t// so onFocusOutside fails to detect that a click on a suggestion occurred in the\n\t\t\t// LinkContainer. Detect clicks on autocomplete suggestions using a ref here, and\n\t\t\t// return to avoid the popover being closed.\n\t\t\tconst autocompleteElement = autocompleteRef.current;\n\t\t\tif (\n\t\t\t\tautocompleteElement &&\n\t\t\t\tautocompleteElement.contains( event.target )\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsetIsOpen( false );\n\t\t\tsetUrlInput( null );\n\t\t\tstopEditLink();\n\t\t};\n\t} );\n\n\tconst onSubmitLinkChange = useCallback( () => {\n\t\treturn ( event ) => {\n\t\t\tif ( urlInput ) {\n\t\t\t\t// It is possible the entered URL actually matches a named link destination.\n\t\t\t\t// This check will ensure our link destination is correct.\n\t\t\t\tconst selectedDestination =\n\t\t\t\t\tgetLinkDestinations().find(\n\t\t\t\t\t\t( destination ) => destination.url === urlInput\n\t\t\t\t\t)?.linkDestination || LINK_DESTINATION_CUSTOM;\n\n\t\t\t\tonChangeUrl( {\n\t\t\t\t\thref: urlInput,\n\t\t\t\t\tlinkDestination: selectedDestination,\n\t\t\t\t} );\n\t\t\t}\n\t\t\tstopEditLink();\n\t\t\tsetUrlInput( null );\n\t\t\tevent.preventDefault();\n\t\t};\n\t} );\n\n\tconst onLinkRemove = useCallback( () => {\n\t\tonChangeUrl( {\n\t\t\tlinkDestination: LINK_DESTINATION_NONE,\n\t\t\thref: '',\n\t\t} );\n\t} );\n\n\tconst getLinkDestinations = () => {\n\t\tconst linkDestinations = [\n\t\t\t{\n\t\t\t\tlinkDestination: LINK_DESTINATION_MEDIA,\n\t\t\t\ttitle: __( 'Media File' ),\n\t\t\t\turl: mediaType === 'image' ? mediaUrl : undefined,\n\t\t\t\ticon,\n\t\t\t},\n\t\t];\n\t\tif ( mediaType === 'image' && mediaLink ) {\n\t\t\tlinkDestinations.push( {\n\t\t\t\tlinkDestination: LINK_DESTINATION_ATTACHMENT,\n\t\t\t\ttitle: __( 'Attachment Page' ),\n\t\t\t\turl: mediaType === 'image' ? mediaLink : undefined,\n\t\t\t\ticon: (\n\t\t\t\t\t<SVG viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n\t\t\t\t\t\t<Path d=\"M0 0h24v24H0V0z\" fill=\"none\" />\n\t\t\t\t\t\t<Path d=\"M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zM6 20V4h7v5h5v11H6z\" />\n\t\t\t\t\t</SVG>\n\t\t\t\t),\n\t\t\t} );\n\t\t}\n\t\treturn linkDestinations;\n\t};\n\n\tconst onSetHref = ( value ) => {\n\t\tconst linkDestinations = getLinkDestinations();\n\t\tlet linkDestinationInput;\n\t\tif ( ! value ) {\n\t\t\tlinkDestinationInput = LINK_DESTINATION_NONE;\n\t\t} else {\n\t\t\tlinkDestinationInput = (\n\t\t\t\tlinkDestinations.find( ( destination ) => {\n\t\t\t\t\treturn destination.url === value;\n\t\t\t\t} ) || { linkDestination: LINK_DESTINATION_CUSTOM }\n\t\t\t).linkDestination;\n\t\t}\n\t\tonChangeUrl( {\n\t\t\tlinkDestination: linkDestinationInput,\n\t\t\thref: value,\n\t\t} );\n\t};\n\n\tconst onSetNewTab = ( value ) => {\n\t\tconst updatedLinkTarget = getUpdatedLinkTargetSettings( value );\n\t\tonChangeUrl( updatedLinkTarget );\n\t};\n\n\tconst onSetLinkRel = ( value ) => {\n\t\tonChangeUrl( { rel: value } );\n\t};\n\n\tconst onSetLinkClass = ( value ) => {\n\t\tonChangeUrl( { linkClass: value } );\n\t};\n\n\tconst advancedOptions = (\n\t\t<VStack spacing=\"3\">\n\t\t\t<ToggleControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\tlabel={ __( 'Open in new tab' ) }\n\t\t\t\tonChange={ onSetNewTab }\n\t\t\t\tchecked={ linkTarget === '_blank' }\n\t\t\t/>\n\t\t\t<TextControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\tlabel={ __( 'Link rel' ) }\n\t\t\t\tvalue={ rel ?? '' }\n\t\t\t\tonChange={ onSetLinkRel }\n\t\t\t/>\n\t\t\t<TextControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\tlabel={ __( 'Link CSS Class' ) }\n\t\t\t\tvalue={ linkClass || '' }\n\t\t\t\tonChange={ onSetLinkClass }\n\t\t\t/>\n\t\t</VStack>\n\t);\n\n\tconst linkEditorValue = urlInput !== null ? urlInput : url;\n\n\tconst urlLabel = (\n\t\tgetLinkDestinations().find(\n\t\t\t( destination ) => destination.linkDestination === linkDestination\n\t\t) || {}\n\t).title;\n\n\treturn (\n\t\t<>\n\t\t\t<ToolbarButton\n\t\t\t\ticon={ linkIcon }\n\t\t\t\tclassName=\"components-toolbar__control\"\n\t\t\t\tlabel={ url ? __( 'Edit link' ) : __( 'Insert link' ) }\n\t\t\t\taria-expanded={ isOpen }\n\t\t\t\tonClick={ openLinkUI }\n\t\t\t\tref={ setPopoverAnchor }\n\t\t\t/>\n\t\t\t{ isOpen && (\n\t\t\t\t<URLPopover\n\t\t\t\t\tanchor={ popoverAnchor }\n\t\t\t\t\tonFocusOutside={ onFocusOutside() }\n\t\t\t\t\tonClose={ closeLinkUI }\n\t\t\t\t\trenderSettings={ () => advancedOptions }\n\t\t\t\t\tadditionalControls={\n\t\t\t\t\t\t! linkEditorValue && (\n\t\t\t\t\t\t\t<NavigableMenu>\n\t\t\t\t\t\t\t\t{ getLinkDestinations().map( ( link ) => (\n\t\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\t\tkey={ link.linkDestination }\n\t\t\t\t\t\t\t\t\t\ticon={ link.icon }\n\t\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\t\tsetUrlInput( null );\n\t\t\t\t\t\t\t\t\t\t\tonSetHref( link.url );\n\t\t\t\t\t\t\t\t\t\t\tstopEditLink();\n\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ link.title }\n\t\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t\t\t</NavigableMenu>\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t>\n\t\t\t\t\t{ ( ! url || isEditingLink ) && (\n\t\t\t\t\t\t<URLPopover.LinkEditor\n\t\t\t\t\t\t\tclassName=\"block-editor-format-toolbar__link-container-content\"\n\t\t\t\t\t\t\tvalue={ linkEditorValue }\n\t\t\t\t\t\t\tonChangeInputValue={ setUrlInput }\n\t\t\t\t\t\t\tonSubmit={ onSubmitLinkChange() }\n\t\t\t\t\t\t\tautocompleteRef={ autocompleteRef }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ url && ! isEditingLink && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<URLPopover.LinkViewer\n\t\t\t\t\t\t\t\tclassName=\"block-editor-format-toolbar__link-container-content\"\n\t\t\t\t\t\t\t\turl={ url }\n\t\t\t\t\t\t\t\tonEditLinkClick={ startEditLink }\n\t\t\t\t\t\t\t\turlLabel={ urlLabel }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\ticon={ close }\n\t\t\t\t\t\t\t\tlabel={ __( 'Remove link' ) }\n\t\t\t\t\t\t\t\tonClick={ onLinkRemove }\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</URLPopover>\n\t\t\t) }\n\t\t</>\n\t);\n};\n\nexport { ImageURLInputUI as __experimentalImageURLInputUI };\n"]}
@@ -29,7 +29,7 @@ import { store as blockEditorStore } from '../../store';
29
29
  * 1. Block's client id to extract it's current attributes.
30
30
  * 2. A block variation should have set `isActive` prop to a proper function.
31
31
  *
32
- * If for any reason a block variaton match cannot be found,
32
+ * If for any reason a block variation match cannot be found,
33
33
  * the returned information come from the Block Type.
34
34
  * If no blockType is found with the provided clientId, returns null.
35
35
  *
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/use-block-display-information/index.js"],"names":["useSelect","store","blocksStore","isReusableBlock","isTemplatePart","blockEditorStore","useBlockDisplayInformation","clientId","select","getBlockName","getBlockAttributes","getBlockType","getActiveBlockVariation","blockName","blockType","attributes","match","isSynced","blockTypeInfo","title","icon","description","anchor"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAT,QAA0B,iBAA1B;AACA,SACCC,KAAK,IAAIC,WADV,EAECC,eAFD,EAGCC,cAHD,QAIO,mBAJP;AAMA;AACA;AACA;;AACA,SAASH,KAAK,IAAII,gBAAlB,QAA0C,aAA1C;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,eAAe,SAASC,0BAAT,CAAqCC,QAArC,EAAgD;AAC9D,SAAOP,SAAS,CACbQ,MAAF,IAAc;AACb,QAAK,CAAED,QAAP,EAAkB,OAAO,IAAP;AAClB,UAAM;AAAEE,MAAAA,YAAF;AAAgBC,MAAAA;AAAhB,QACLF,MAAM,CAAEH,gBAAF,CADP;AAEA,UAAM;AAAEM,MAAAA,YAAF;AAAgBC,MAAAA;AAAhB,QACLJ,MAAM,CAAEN,WAAF,CADP;AAEA,UAAMW,SAAS,GAAGJ,YAAY,CAAEF,QAAF,CAA9B;AACA,UAAMO,SAAS,GAAGH,YAAY,CAAEE,SAAF,CAA9B;AACA,QAAK,CAAEC,SAAP,EAAmB,OAAO,IAAP;AACnB,UAAMC,UAAU,GAAGL,kBAAkB,CAAEH,QAAF,CAArC;AACA,UAAMS,KAAK,GAAGJ,uBAAuB,CAAEC,SAAF,EAAaE,UAAb,CAArC;AACA,UAAME,QAAQ,GACbd,eAAe,CAAEW,SAAF,CAAf,IAAgCV,cAAc,CAAEU,SAAF,CAD/C;AAEA,UAAMI,aAAa,GAAG;AACrBD,MAAAA,QADqB;AAErBE,MAAAA,KAAK,EAAEL,SAAS,CAACK,KAFI;AAGrBC,MAAAA,IAAI,EAAEN,SAAS,CAACM,IAHK;AAIrBC,MAAAA,WAAW,EAAEP,SAAS,CAACO,WAJF;AAKrBC,MAAAA,MAAM,EAAEP,UAAF,aAAEA,UAAF,uBAAEA,UAAU,CAAEO;AALC,KAAtB;AAOA,QAAK,CAAEN,KAAP,EAAe,OAAOE,aAAP;AAEf,WAAO;AACND,MAAAA,QADM;AAENE,MAAAA,KAAK,EAAEH,KAAK,CAACG,KAAN,IAAeL,SAAS,CAACK,KAF1B;AAGNC,MAAAA,IAAI,EAAEJ,KAAK,CAACI,IAAN,IAAcN,SAAS,CAACM,IAHxB;AAINC,MAAAA,WAAW,EAAEL,KAAK,CAACK,WAAN,IAAqBP,SAAS,CAACO,WAJtC;AAKNC,MAAAA,MAAM,EAAEP,UAAF,aAAEA,UAAF,uBAAEA,UAAU,CAAEO;AALd,KAAP;AAOA,GA9Bc,EA+Bf,CAAEf,QAAF,CA/Be,CAAhB;AAiCA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport {\n\tstore as blocksStore,\n\tisReusableBlock,\n\tisTemplatePart,\n} from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\n\n/** @typedef {import('@wordpress/blocks').WPIcon} WPIcon */\n\n/**\n * Contains basic block's information for display reasons.\n *\n * @typedef {Object} WPBlockDisplayInformation\n *\n * @property {boolean} isSynced True if is a reusable block or template part\n * @property {string} title Human-readable block type label.\n * @property {WPIcon} icon Block type icon.\n * @property {string} description A detailed block type description.\n * @property {string} anchor HTML anchor.\n */\n\n/**\n * Hook used to try to find a matching block variation and return\n * the appropriate information for display reasons. In order to\n * to try to find a match we need to things:\n * 1. Block's client id to extract it's current attributes.\n * 2. A block variation should have set `isActive` prop to a proper function.\n *\n * If for any reason a block variaton match cannot be found,\n * the returned information come from the Block Type.\n * If no blockType is found with the provided clientId, returns null.\n *\n * @param {string} clientId Block's client id.\n * @return {?WPBlockDisplayInformation} Block's display information, or `null` when the block or its type not found.\n */\n\nexport default function useBlockDisplayInformation( clientId ) {\n\treturn useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! clientId ) return null;\n\t\t\tconst { getBlockName, getBlockAttributes } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst { getBlockType, getActiveBlockVariation } =\n\t\t\t\tselect( blocksStore );\n\t\t\tconst blockName = getBlockName( clientId );\n\t\t\tconst blockType = getBlockType( blockName );\n\t\t\tif ( ! blockType ) return null;\n\t\t\tconst attributes = getBlockAttributes( clientId );\n\t\t\tconst match = getActiveBlockVariation( blockName, attributes );\n\t\t\tconst isSynced =\n\t\t\t\tisReusableBlock( blockType ) || isTemplatePart( blockType );\n\t\t\tconst blockTypeInfo = {\n\t\t\t\tisSynced,\n\t\t\t\ttitle: blockType.title,\n\t\t\t\ticon: blockType.icon,\n\t\t\t\tdescription: blockType.description,\n\t\t\t\tanchor: attributes?.anchor,\n\t\t\t};\n\t\t\tif ( ! match ) return blockTypeInfo;\n\n\t\t\treturn {\n\t\t\t\tisSynced,\n\t\t\t\ttitle: match.title || blockType.title,\n\t\t\t\ticon: match.icon || blockType.icon,\n\t\t\t\tdescription: match.description || blockType.description,\n\t\t\t\tanchor: attributes?.anchor,\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/use-block-display-information/index.js"],"names":["useSelect","store","blocksStore","isReusableBlock","isTemplatePart","blockEditorStore","useBlockDisplayInformation","clientId","select","getBlockName","getBlockAttributes","getBlockType","getActiveBlockVariation","blockName","blockType","attributes","match","isSynced","blockTypeInfo","title","icon","description","anchor"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAT,QAA0B,iBAA1B;AACA,SACCC,KAAK,IAAIC,WADV,EAECC,eAFD,EAGCC,cAHD,QAIO,mBAJP;AAMA;AACA;AACA;;AACA,SAASH,KAAK,IAAII,gBAAlB,QAA0C,aAA1C;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,eAAe,SAASC,0BAAT,CAAqCC,QAArC,EAAgD;AAC9D,SAAOP,SAAS,CACbQ,MAAF,IAAc;AACb,QAAK,CAAED,QAAP,EAAkB,OAAO,IAAP;AAClB,UAAM;AAAEE,MAAAA,YAAF;AAAgBC,MAAAA;AAAhB,QACLF,MAAM,CAAEH,gBAAF,CADP;AAEA,UAAM;AAAEM,MAAAA,YAAF;AAAgBC,MAAAA;AAAhB,QACLJ,MAAM,CAAEN,WAAF,CADP;AAEA,UAAMW,SAAS,GAAGJ,YAAY,CAAEF,QAAF,CAA9B;AACA,UAAMO,SAAS,GAAGH,YAAY,CAAEE,SAAF,CAA9B;AACA,QAAK,CAAEC,SAAP,EAAmB,OAAO,IAAP;AACnB,UAAMC,UAAU,GAAGL,kBAAkB,CAAEH,QAAF,CAArC;AACA,UAAMS,KAAK,GAAGJ,uBAAuB,CAAEC,SAAF,EAAaE,UAAb,CAArC;AACA,UAAME,QAAQ,GACbd,eAAe,CAAEW,SAAF,CAAf,IAAgCV,cAAc,CAAEU,SAAF,CAD/C;AAEA,UAAMI,aAAa,GAAG;AACrBD,MAAAA,QADqB;AAErBE,MAAAA,KAAK,EAAEL,SAAS,CAACK,KAFI;AAGrBC,MAAAA,IAAI,EAAEN,SAAS,CAACM,IAHK;AAIrBC,MAAAA,WAAW,EAAEP,SAAS,CAACO,WAJF;AAKrBC,MAAAA,MAAM,EAAEP,UAAF,aAAEA,UAAF,uBAAEA,UAAU,CAAEO;AALC,KAAtB;AAOA,QAAK,CAAEN,KAAP,EAAe,OAAOE,aAAP;AAEf,WAAO;AACND,MAAAA,QADM;AAENE,MAAAA,KAAK,EAAEH,KAAK,CAACG,KAAN,IAAeL,SAAS,CAACK,KAF1B;AAGNC,MAAAA,IAAI,EAAEJ,KAAK,CAACI,IAAN,IAAcN,SAAS,CAACM,IAHxB;AAINC,MAAAA,WAAW,EAAEL,KAAK,CAACK,WAAN,IAAqBP,SAAS,CAACO,WAJtC;AAKNC,MAAAA,MAAM,EAAEP,UAAF,aAAEA,UAAF,uBAAEA,UAAU,CAAEO;AALd,KAAP;AAOA,GA9Bc,EA+Bf,CAAEf,QAAF,CA/Be,CAAhB;AAiCA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport {\n\tstore as blocksStore,\n\tisReusableBlock,\n\tisTemplatePart,\n} from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\n\n/** @typedef {import('@wordpress/blocks').WPIcon} WPIcon */\n\n/**\n * Contains basic block's information for display reasons.\n *\n * @typedef {Object} WPBlockDisplayInformation\n *\n * @property {boolean} isSynced True if is a reusable block or template part\n * @property {string} title Human-readable block type label.\n * @property {WPIcon} icon Block type icon.\n * @property {string} description A detailed block type description.\n * @property {string} anchor HTML anchor.\n */\n\n/**\n * Hook used to try to find a matching block variation and return\n * the appropriate information for display reasons. In order to\n * to try to find a match we need to things:\n * 1. Block's client id to extract it's current attributes.\n * 2. A block variation should have set `isActive` prop to a proper function.\n *\n * If for any reason a block variation match cannot be found,\n * the returned information come from the Block Type.\n * If no blockType is found with the provided clientId, returns null.\n *\n * @param {string} clientId Block's client id.\n * @return {?WPBlockDisplayInformation} Block's display information, or `null` when the block or its type not found.\n */\n\nexport default function useBlockDisplayInformation( clientId ) {\n\treturn useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! clientId ) return null;\n\t\t\tconst { getBlockName, getBlockAttributes } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst { getBlockType, getActiveBlockVariation } =\n\t\t\t\tselect( blocksStore );\n\t\t\tconst blockName = getBlockName( clientId );\n\t\t\tconst blockType = getBlockType( blockName );\n\t\t\tif ( ! blockType ) return null;\n\t\t\tconst attributes = getBlockAttributes( clientId );\n\t\t\tconst match = getActiveBlockVariation( blockName, attributes );\n\t\t\tconst isSynced =\n\t\t\t\tisReusableBlock( blockType ) || isTemplatePart( blockType );\n\t\t\tconst blockTypeInfo = {\n\t\t\t\tisSynced,\n\t\t\t\ttitle: blockType.title,\n\t\t\t\ticon: blockType.icon,\n\t\t\t\tdescription: blockType.description,\n\t\t\t\tanchor: attributes?.anchor,\n\t\t\t};\n\t\t\tif ( ! match ) return blockTypeInfo;\n\n\t\t\treturn {\n\t\t\t\tisSynced,\n\t\t\t\ttitle: match.title || blockType.title,\n\t\t\t\ticon: match.icon || blockType.icon,\n\t\t\t\tdescription: match.description || blockType.description,\n\t\t\t\tanchor: attributes?.anchor,\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n}\n"]}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/experiments';
5
+ /**
6
+ * Internal dependencies
7
+ */
8
+
9
+ import * as globalStyles from './components/global-styles';
10
+ import { ExperimentalBlockEditorProvider } from './components/provider';
11
+ import OffCanvasEditor from './components/off-canvas-editor';
12
+ export const {
13
+ lock,
14
+ unlock
15
+ } = __dangerousOptInToUnstableAPIsOnlyForCoreModules('I know using unstable features means my plugin or theme will inevitably break on the next WordPress release.', '@wordpress/block-editor');
16
+ /**
17
+ * Experimental @wordpress/block-editor APIs.
18
+ */
19
+
20
+ export const experiments = {};
21
+ lock(experiments, { ...globalStyles,
22
+ ExperimentalBlockEditorProvider,
23
+ OffCanvasEditor
24
+ });
25
+ //# sourceMappingURL=experiments.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["@wordpress/block-editor/src/experiments.js"],"names":["__dangerousOptInToUnstableAPIsOnlyForCoreModules","globalStyles","ExperimentalBlockEditorProvider","OffCanvasEditor","lock","unlock","experiments"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,gDAAT,QAAiE,wBAAjE;AAEA;AACA;AACA;;AACA,OAAO,KAAKC,YAAZ,MAA8B,4BAA9B;AACA,SAASC,+BAAT,QAAgD,uBAAhD;AACA,OAAOC,eAAP,MAA4B,gCAA5B;AAEA,OAAO,MAAM;AAAEC,EAAAA,IAAF;AAAQC,EAAAA;AAAR,IACZL,gDAAgD,CAC/C,8GAD+C,EAE/C,yBAF+C,CAD1C;AAMP;AACA;AACA;;AACA,OAAO,MAAMM,WAAW,GAAG,EAApB;AACPF,IAAI,CAAEE,WAAF,EAAe,EAClB,GAAGL,YADe;AAElBC,EAAAA,+BAFkB;AAGlBC,EAAAA;AAHkB,CAAf,CAAJ","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/experiments';\n\n/**\n * Internal dependencies\n */\nimport * as globalStyles from './components/global-styles';\nimport { ExperimentalBlockEditorProvider } from './components/provider';\nimport OffCanvasEditor from './components/off-canvas-editor';\n\nexport const { lock, unlock } =\n\t__dangerousOptInToUnstableAPIsOnlyForCoreModules(\n\t\t'I know using unstable features means my plugin or theme will inevitably break on the next WordPress release.',\n\t\t'@wordpress/block-editor'\n\t);\n\n/**\n * Experimental @wordpress/block-editor APIs.\n */\nexport const experiments = {};\nlock( experiments, {\n\t...globalStyles,\n\tExperimentalBlockEditorProvider,\n\tOffCanvasEditor,\n} );\n"]}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/experiments';
5
+ /**
6
+ * Internal dependencies
7
+ */
8
+
9
+ import * as globalStyles from './components/global-styles';
10
+ import { ExperimentalBlockEditorProvider } from './components/provider';
11
+ export const {
12
+ lock,
13
+ unlock
14
+ } = __dangerousOptInToUnstableAPIsOnlyForCoreModules('I know using unstable features means my plugin or theme will inevitably break on the next WordPress release.', '@wordpress/block-editor');
15
+ /**
16
+ * Experimental @wordpress/block-editor APIs.
17
+ */
18
+
19
+ export const experiments = {};
20
+ lock(experiments, { ...globalStyles,
21
+ ExperimentalBlockEditorProvider
22
+ });
23
+ //# sourceMappingURL=experiments.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["@wordpress/block-editor/src/experiments.native.js"],"names":["__dangerousOptInToUnstableAPIsOnlyForCoreModules","globalStyles","ExperimentalBlockEditorProvider","lock","unlock","experiments"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,gDAAT,QAAiE,wBAAjE;AAEA;AACA;AACA;;AACA,OAAO,KAAKC,YAAZ,MAA8B,4BAA9B;AACA,SAASC,+BAAT,QAAgD,uBAAhD;AAEA,OAAO,MAAM;AAAEC,EAAAA,IAAF;AAAQC,EAAAA;AAAR,IACZJ,gDAAgD,CAC/C,8GAD+C,EAE/C,yBAF+C,CAD1C;AAMP;AACA;AACA;;AACA,OAAO,MAAMK,WAAW,GAAG,EAApB;AACPF,IAAI,CAAEE,WAAF,EAAe,EAClB,GAAGJ,YADe;AAElBC,EAAAA;AAFkB,CAAf,CAAJ","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/experiments';\n\n/**\n * Internal dependencies\n */\nimport * as globalStyles from './components/global-styles';\nimport { ExperimentalBlockEditorProvider } from './components/provider';\n\nexport const { lock, unlock } =\n\t__dangerousOptInToUnstableAPIsOnlyForCoreModules(\n\t\t'I know using unstable features means my plugin or theme will inevitably break on the next WordPress release.',\n\t\t'@wordpress/block-editor'\n\t);\n\n/**\n * Experimental @wordpress/block-editor APIs.\n */\nexport const experiments = {};\nlock( experiments, {\n\t...globalStyles,\n\tExperimentalBlockEditorProvider,\n} );\n"]}
@@ -69,6 +69,7 @@ export const withInspectorControl = createHigherOrderComponent(BlockEdit => {
69
69
  if (hasAnchor && props.isSelected) {
70
70
  const isWeb = Platform.OS === 'web';
71
71
  const textControl = createElement(TextControl, {
72
+ __nextHasNoMarginBottom: true,
72
73
  className: "html-anchor-control",
73
74
  label: __('HTML anchor'),
74
75
  help: createElement(Fragment, null, __('Enter a word or two — without spaces — to make a unique web address just for this block, called an “anchor.” Then, you’ll be able to link directly to this section of your page.'), isWeb && createElement(ExternalLink, {
@@ -86,7 +87,7 @@ export const withInspectorControl = createHigherOrderComponent(BlockEdit => {
86
87
  autoComplete: "off"
87
88
  });
88
89
  return createElement(Fragment, null, createElement(BlockEdit, props), isWeb && createElement(InspectorControls, {
89
- __experimentalGroup: "advanced"
90
+ group: "advanced"
90
91
  }, textControl), !isWeb && props.name === 'core/heading' && createElement(InspectorControls, null, createElement(PanelBody, {
91
92
  title: __('Heading settings')
92
93
  }, textControl)));
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/hooks/anchor.js"],"names":["addFilter","PanelBody","TextControl","ExternalLink","__","hasBlockSupport","createHigherOrderComponent","Platform","InspectorControls","ANCHOR_REGEX","ANCHOR_SCHEMA","type","source","attribute","selector","addAttribute","settings","attributes","anchor","withInspectorControl","BlockEdit","props","hasAnchor","name","isSelected","isWeb","OS","textControl","nextValue","replace","setAttributes","addSaveProps","extraProps","blockType","id"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,SAAT,QAA0B,kBAA1B;AACA,SAASC,SAAT,EAAoBC,WAApB,EAAiCC,YAAjC,QAAqD,uBAArD;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,eAAT,QAAgC,mBAAhC;AACA,SAASC,0BAAT,QAA2C,oBAA3C;AACA,SAASC,QAAT,QAAyB,oBAAzB;AAEA;AACA;AACA;;AACA,SAASC,iBAAT,QAAk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P;AACA;AAEDhC,SAAS,CAAE,0BAAF,EAA8B,uBAA9B,EAAuDe,YAAvD,CAAT;AACAf,SAAS,CACR,kBADQ,EAER,2CAFQ,EAGRmB,oBAHQ,CAAT;AAKAnB,SAAS,CACR,kCADQ,EAER,wBAFQ,EAGR+B,YAHQ,CAAT","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { addFilter } from '@wordpress/hooks';\nimport { PanelBody, TextControl, ExternalLink } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { hasBlockSupport } from '@wordpress/blocks';\nimport { createHigherOrderComponent } from '@wordpress/compose';\nimport { Platform } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { InspectorControls } from '../components';\n\n/**\n * Regular expression matching invalid anchor characters for replacement.\n *\n * @type {RegExp}\n */\nconst ANCHOR_REGEX = /[\\s#]/g;\n\nconst ANCHOR_SCHEMA = {\n\ttype: 'string',\n\tsource: 'attribute',\n\tattribute: 'id',\n\tselector: '*',\n};\n\n/**\n * Filters registered block settings, extending attributes with anchor using ID\n * of the first node.\n *\n * @param {Object} settings Original block settings.\n *\n * @return {Object} Filtered block settings.\n */\nexport function addAttribute( settings ) {\n\t// Allow blocks to specify their own attribute definition with default values if needed.\n\tif ( 'type' in ( settings.attributes?.anchor ?? {} ) ) {\n\t\treturn settings;\n\t}\n\tif ( hasBlockSupport( settings, 'anchor' ) ) {\n\t\t// Gracefully handle if settings.attributes is undefined.\n\t\tsettings.attributes = {\n\t\t\t...settings.attributes,\n\t\t\tanchor: ANCHOR_SCHEMA,\n\t\t};\n\t}\n\n\treturn settings;\n}\n\n/**\n * Override the default edit UI to include a new block inspector control for\n * assigning the anchor ID, if block supports anchor.\n *\n * @param {WPComponent} BlockEdit Original component.\n *\n * @return {WPComponent} Wrapped component.\n */\nexport const withInspectorControl = createHigherOrderComponent(\n\t( BlockEdit ) => {\n\t\treturn ( props ) => {\n\t\t\tconst hasAnchor = hasBlockSupport( props.name, 'anchor' );\n\n\t\t\tif ( hasAnchor && props.isSelected ) {\n\t\t\t\tconst isWeb = Platform.OS === 'web';\n\t\t\t\tconst textControl = (\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\tclassName=\"html-anchor-control\"\n\t\t\t\t\t\tlabel={ __( 'HTML anchor' ) }\n\t\t\t\t\t\thelp={\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'Enter a word or two — without spaces — to make a unique web address just for this block, called an “anchor.” Then, you’ll be able to link directly to this section of your page.'\n\t\t\t\t\t\t\t\t) }\n\n\t\t\t\t\t\t\t\t{ isWeb && (\n\t\t\t\t\t\t\t\t\t<ExternalLink\n\t\t\t\t\t\t\t\t\t\thref={ __(\n\t\t\t\t\t\t\t\t\t\t\t'https://wordpress.org/support/article/page-jumps/'\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ __( 'Learn more about anchors' ) }\n\t\t\t\t\t\t\t\t\t</ExternalLink>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvalue={ props.attributes.anchor || '' }\n\t\t\t\t\t\tplaceholder={ ! isWeb ? __( 'Add an anchor' ) : null }\n\t\t\t\t\t\tonChange={ ( nextValue ) => {\n\t\t\t\t\t\t\tnextValue = nextValue.replace( ANCHOR_REGEX, '-' );\n\t\t\t\t\t\t\tprops.setAttributes( {\n\t\t\t\t\t\t\t\tanchor: nextValue,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tautoCapitalize=\"none\"\n\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t/>\n\t\t\t\t);\n\n\t\t\t\treturn (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<BlockEdit { ...props } />\n\t\t\t\t\t\t{ isWeb && (\n\t\t\t\t\t\t\t<InspectorControls __experimentalGroup=\"advanced\">\n\t\t\t\t\t\t\t\t{ textControl }\n\t\t\t\t\t\t\t</InspectorControls>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ /*\n\t\t\t\t\t\t * We plan to remove scoping anchors to 'core/heading' to support\n\t\t\t\t\t\t * anchors for all eligble blocks. Additionally we plan to explore\n\t\t\t\t\t\t * leveraging InspectorAdvancedControls instead of a custom\n\t\t\t\t\t\t * PanelBody title. https://github.com/WordPress/gutenberg/issues/28363\n\t\t\t\t\t\t */ }\n\t\t\t\t\t\t{ ! isWeb && props.name === 'core/heading' && (\n\t\t\t\t\t\t\t<InspectorControls>\n\t\t\t\t\t\t\t\t<PanelBody title={ __( 'Heading settings' ) }>\n\t\t\t\t\t\t\t\t\t{ textControl }\n\t\t\t\t\t\t\t\t</PanelBody>\n\t\t\t\t\t\t\t</InspectorControls>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</>\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn <BlockEdit { ...props } />;\n\t\t};\n\t},\n\t'withInspectorControl'\n);\n\n/**\n * Override props assigned to save component to inject anchor ID, if block\n * supports anchor. This is only applied if the block's save result is an\n * element and not a markup string.\n *\n * @param {Object} extraProps Additional props applied to save element.\n * @param {Object} blockType Block type.\n * @param {Object} attributes Current block attributes.\n *\n * @return {Object} Filtered props applied to save element.\n */\nexport function addSaveProps( extraProps, blockType, attributes ) {\n\tif ( hasBlockSupport( blockType, 'anchor' ) ) {\n\t\textraProps.id = attributes.anchor === '' ? null : attributes.anchor;\n\t}\n\n\treturn extraProps;\n}\n\naddFilter( 'blocks.registerBlockType', 'core/anchor/attribute', addAttribute );\naddFilter(\n\t'editor.BlockEdit',\n\t'core/editor/anchor/with-inspector-control',\n\twithInspectorControl\n);\naddFilter(\n\t'blocks.getSaveContent.extraProps',\n\t'core/anchor/save-props',\n\taddSaveProps\n);\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/hooks/anchor.js"],"names":["addFilter","PanelBody","TextControl","ExternalLink","__","hasBlockSupport","createHigherOrderComponent","Platform","InspectorControls","ANCHOR_REGEX","ANCHOR_SCHEMA","type","source","attribute","selector","addAttribute","settings","attributes","anchor","withInspectorControl","BlockEdit","props","hasAnchor","name","isSelected","isWeb","OS","textControl","nextValue","replace","setAttributes","addSaveProps","extraProps","blockType","id"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,SAAT,QAA0B,kBAA1B;AACA,SAASC,SAAT,EAAoBC,WAApB,EAAiCC,YAAjC,QAAqD,uBAArD;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,eAAT,QAAgC,mBAAhC;AACA,SAASC,0BAAT,QAA2C,oBAA3C;AACA,SAASC,QAAT,QAAyB,oBAAzB;AAEA;AACA;AACA;;AACA,SAASC,iBAAT,QAAkC,eAAlC;AAEA;AACA;AACA;AACA;AACA;;AACA,MAAMC,YAAY,GAAG,QAArB;AAEA,MAAMC,aAAa,GAAG;AACrBC,EAAAA,IAAI,EAAE,QADe;AAErBC,EAAAA,MAAM,EAAE,WAFa;AAGrBC,EAAAA,SAAS,EAAE,IAHU;AAIrBC,EAAAA,QAAQ,EAAE;AAJW,CAAtB;AAOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASC,YAAT,CAAuBC,QAAvB,EAAkC;AAAA;;AACxC;AACA,MAAK,4DAAYA,QAAQ,CAACC,UAArB,yDAAY,qBAAqBC,MAAjC,yEAA2C,EAA3C,CAAL,EAAuD;AACtD,WAAOF,QAAP;AACA;;AACD,MAAKX,eAAe,CAAEW,QAAF,EAAY,QAAZ,CAApB,EAA6C;AAC5C;AACAA,IAAAA,QAAQ,CAACC,UAAT,GAAsB,EACrB,GAAGD,QAAQ,CAACC,UADS;AAErBC,MAAAA,MAAM,EAAER;AAFa,KAAtB;AAIA;;AAED,SAAOM,QAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMG,oBAAoB,GAAGb,0BAA0B,CAC3Dc,SAAF,IAAi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AK,EAAGnB,EAAE,CAAE,kBAAF;AAArB,SACGuB,WADH,CADD,CAdF,CADD;AAuBA;;AAED,WAAO,cAAC,SAAD,EAAgBN,KAAhB,CAAP;AACA,GAlED;AAmEA,CArE4D,EAsE7D,sBAtE6D,CAAvD;AAyEP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASU,YAAT,CAAuBC,UAAvB,EAAmCC,SAAnC,EAA8ChB,UAA9C,EAA2D;AACjE,MAAKZ,eAAe,CAAE4B,SAAF,EAAa,QAAb,CAApB,EAA8C;AAC7CD,IAAAA,UAAU,CAACE,EAAX,GAAgBjB,UAAU,CAACC,MAAX,KAAsB,EAAtB,GAA2B,IAA3B,GAAkCD,UAAU,CAACC,MAA7D;AACA;;AAED,SAAOc,UAAP;AACA;AAEDhC,SAAS,CAAE,0BAAF,EAA8B,uBAA9B,EAAuDe,YAAvD,CAAT;AACAf,SAAS,CACR,kBADQ,EAER,2CAFQ,EAGRmB,oBAHQ,CAAT;AAKAnB,SAAS,CACR,kCADQ,EAER,wBAFQ,EAGR+B,YAHQ,CAAT","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { addFilter } from '@wordpress/hooks';\nimport { PanelBody, TextControl, ExternalLink } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { hasBlockSupport } from '@wordpress/blocks';\nimport { createHigherOrderComponent } from '@wordpress/compose';\nimport { Platform } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { InspectorControls } from '../components';\n\n/**\n * Regular expression matching invalid anchor characters for replacement.\n *\n * @type {RegExp}\n */\nconst ANCHOR_REGEX = /[\\s#]/g;\n\nconst ANCHOR_SCHEMA = {\n\ttype: 'string',\n\tsource: 'attribute',\n\tattribute: 'id',\n\tselector: '*',\n};\n\n/**\n * Filters registered block settings, extending attributes with anchor using ID\n * of the first node.\n *\n * @param {Object} settings Original block settings.\n *\n * @return {Object} Filtered block settings.\n */\nexport function addAttribute( settings ) {\n\t// Allow blocks to specify their own attribute definition with default values if needed.\n\tif ( 'type' in ( settings.attributes?.anchor ?? {} ) ) {\n\t\treturn settings;\n\t}\n\tif ( hasBlockSupport( settings, 'anchor' ) ) {\n\t\t// Gracefully handle if settings.attributes is undefined.\n\t\tsettings.attributes = {\n\t\t\t...settings.attributes,\n\t\t\tanchor: ANCHOR_SCHEMA,\n\t\t};\n\t}\n\n\treturn settings;\n}\n\n/**\n * Override the default edit UI to include a new block inspector control for\n * assigning the anchor ID, if block supports anchor.\n *\n * @param {WPComponent} BlockEdit Original component.\n *\n * @return {WPComponent} Wrapped component.\n */\nexport const withInspectorControl = createHigherOrderComponent(\n\t( BlockEdit ) => {\n\t\treturn ( props ) => {\n\t\t\tconst hasAnchor = hasBlockSupport( props.name, 'anchor' );\n\n\t\t\tif ( hasAnchor && props.isSelected ) {\n\t\t\t\tconst isWeb = Platform.OS === 'web';\n\t\t\t\tconst textControl = (\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tclassName=\"html-anchor-control\"\n\t\t\t\t\t\tlabel={ __( 'HTML anchor' ) }\n\t\t\t\t\t\thelp={\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'Enter a word or two — without spaces — to make a unique web address just for this block, called an “anchor.” Then, you’ll be able to link directly to this section of your page.'\n\t\t\t\t\t\t\t\t) }\n\n\t\t\t\t\t\t\t\t{ isWeb && (\n\t\t\t\t\t\t\t\t\t<ExternalLink\n\t\t\t\t\t\t\t\t\t\thref={ __(\n\t\t\t\t\t\t\t\t\t\t\t'https://wordpress.org/support/article/page-jumps/'\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ __( 'Learn more about anchors' ) }\n\t\t\t\t\t\t\t\t\t</ExternalLink>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvalue={ props.attributes.anchor || '' }\n\t\t\t\t\t\tplaceholder={ ! isWeb ? __( 'Add an anchor' ) : null }\n\t\t\t\t\t\tonChange={ ( nextValue ) => {\n\t\t\t\t\t\t\tnextValue = nextValue.replace( ANCHOR_REGEX, '-' );\n\t\t\t\t\t\t\tprops.setAttributes( {\n\t\t\t\t\t\t\t\tanchor: nextValue,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tautoCapitalize=\"none\"\n\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t/>\n\t\t\t\t);\n\n\t\t\t\treturn (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<BlockEdit { ...props } />\n\t\t\t\t\t\t{ isWeb && (\n\t\t\t\t\t\t\t<InspectorControls group=\"advanced\">\n\t\t\t\t\t\t\t\t{ textControl }\n\t\t\t\t\t\t\t</InspectorControls>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ /*\n\t\t\t\t\t\t * We plan to remove scoping anchors to 'core/heading' to support\n\t\t\t\t\t\t * anchors for all eligble blocks. Additionally we plan to explore\n\t\t\t\t\t\t * leveraging InspectorAdvancedControls instead of a custom\n\t\t\t\t\t\t * PanelBody title. https://github.com/WordPress/gutenberg/issues/28363\n\t\t\t\t\t\t */ }\n\t\t\t\t\t\t{ ! isWeb && props.name === 'core/heading' && (\n\t\t\t\t\t\t\t<InspectorControls>\n\t\t\t\t\t\t\t\t<PanelBody title={ __( 'Heading settings' ) }>\n\t\t\t\t\t\t\t\t\t{ textControl }\n\t\t\t\t\t\t\t\t</PanelBody>\n\t\t\t\t\t\t\t</InspectorControls>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</>\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn <BlockEdit { ...props } />;\n\t\t};\n\t},\n\t'withInspectorControl'\n);\n\n/**\n * Override props assigned to save component to inject anchor ID, if block\n * supports anchor. This is only applied if the block's save result is an\n * element and not a markup string.\n *\n * @param {Object} extraProps Additional props applied to save element.\n * @param {Object} blockType Block type.\n * @param {Object} attributes Current block attributes.\n *\n * @return {Object} Filtered props applied to save element.\n */\nexport function addSaveProps( extraProps, blockType, attributes ) {\n\tif ( hasBlockSupport( blockType, 'anchor' ) ) {\n\t\textraProps.id = attributes.anchor === '' ? null : attributes.anchor;\n\t}\n\n\treturn extraProps;\n}\n\naddFilter( 'blocks.registerBlockType', 'core/anchor/attribute', addAttribute );\naddFilter(\n\t'editor.BlockEdit',\n\t'core/editor/anchor/with-inspector-control',\n\twithInspectorControl\n);\naddFilter(\n\t'blocks.getSaveContent.extraProps',\n\t'core/anchor/save-props',\n\taddSaveProps\n);\n"]}
@@ -278,7 +278,7 @@ export function BorderPanel(props) {
278
278
 
279
279
  const hydratedBorder = getBorderObject(attributes, colors);
280
280
  return createElement(InspectorControls, {
281
- __experimentalGroup: "border"
281
+ group: "border"
282
282
  }, (isWidthSupported || isColorSupported) && createElement(ToolsPanelItem, {
283
283
  hasValue: () => hasBorderValue(props),
284
284
  label: __('Border'),
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/hooks/border.js"],"names":["classnames","getBlockSupport","__experimentalBorderBoxControl","BorderBoxControl","__experimentalHasSplitBorders","hasSplitBorders","__experimentalIsDefinedBorder","isDefinedBorder","__experimentalToolsPanelItem","ToolsPanelItem","createHigherOrderComponent","Platform","addFilter","__","BorderRadiusEdit","hasBorderRadiusValue","resetBorderRadius","getColorClassName","InspectorControls","useMultipleOriginColorsAndGradients","useSetting","cleanEmptyObject","shouldSkipSerialization","BORDER_SUPPORT_KEY","borderSides","hasBorderValue","props","borderColor","style","attributes","border","resetBorder","setAttributes","undefined","radius","resetBorderFilter","newAttributes","getColorByProperty","colors","property","value","matchedColor","some","origin","color","getMultiOriginColor","namedColor","customColor","colorObject","getBorderObject","borderStyles","hydratedBorderStyles","forEach","side","colorSlug","getColorSlugFromVariable","exec","BorderPanel","clientId","isSupported","hasBorderSupport","name","isColorSupported","isRadiusSupported","isStyleSupported","isWidthSupported","isDisabled","every","Boolean","defaultBorderControls","showBorderByDefault","width","onBorderChange","newBorder","newBorderStyles","newBorderColor","top","right","bottom","left","slug","newStyle","hydratedBorder","blockName","feature","OS","support","removeBorderAttribute","attribute","addAttributes","settings","type","addSaveProps","blockType","borderClasses","getBorderClasses","newClassName","className","borderColorClass","addEditProps","existingGetEditWrapperProps","getEditWrapperProps","withBorderColorPaletteStyles","BlockListBlock","borderColorValue","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","extraStyles","wrapperProps"],"mappings":";;;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,eAAT,QAAgC,mBAAhC;AACA,SACCC,8BAA8B,IAAIC,gBADnC,EAECC,6BAA6B,IAAIC,eAFlC,EAGCC,6BAA6B,IAAIC,eAHlC,EAICC,4BAA4B,IAAIC,cAJjC,QAKO,uBALP;AAMA,SAASC,0BAAT,QAA2C,oBAA3C;AACA,SAASC,QAAT,QAAyB,oBAAzB;AACA,SAASC,SAAT,QAA0B,kBAA1B;AACA,SAASC,EAAT,QAAmB,iBAAnB;AAEA;AACA;AACA;;AACA,SACCC,gBADD,EAECC,oBAFD,EAGCC,iBAHD,QAIO,iBAJP;AAKA,SAASC,iBAAT,QAAkC,sBAAlC;AACA,OAAOC,iBAAP,MAA8B,kCAA9B;AACA,OAAOC,mCAAP,MAAgD,yEAAhD;AACA,OAAOC,UAAP,MAAuB,2BAAvB;AACA,SAASC,gBAAT,EAA2BC,uBAA3B,QAA0D,SAA1D;AAEA,OAAO,MAAMC,kBAAkB,GAAG,sBAA3B;AAEP,MAAMC,WAAW,GAAG,CAAE,KAAF,EAAS,OAAT,EAAkB,QAAlB,EAA4B,MAA5B,CAApB;;AAEA,MAAMC,cAAc,GAAKC,KAAF,IAAa;AACnC,QAAM;AAAEC,IAAAA,WAAF;AAAeC,IAAAA;AAAf,MAAyBF,KAAK,CA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F,yCAAEA,KAAK,CAAEE,MAAT,0EAAE,eAAeiD,IAAjB,wDAAE,oBAAqBnC,KAAvB;AAFmB,GAAF,CAAtD;AAKA,QAAMiE,WAAW,GAAG;AACnBJ,IAAAA,cAAc,EAAEA,cAAc,IAAID,gBADf;AAEnBE,IAAAA,gBAAgB,EAAEA,gBAAgB,IAAIF,gBAFnB;AAGnBG,IAAAA,iBAAiB,EAAEA,iBAAiB,IAAIH,gBAHrB;AAInBI,IAAAA,eAAe,EAAEA,eAAe,IAAIJ;AAJjB,GAApB;AAOA,MAAIM,YAAY,GAAGpF,KAAK,CAACoF,YAAzB;AACAA,EAAAA,YAAY,GAAG,EACd,GAAGpF,KAAK,CAACoF,YADK;AAEdlF,IAAAA,KAAK,EAAE,EACN,2BAAGF,KAAK,CAACoF,YAAT,wDAAG,oBAAoBlF,KAAvB,CADM;AAEN,SAAGiF;AAFG;AAFO,GAAf;AAQA,SAAO,cAAC,cAAD,eAAqBnF,KAArB;AAA6B,IAAA,YAAY,EAAGoF;AAA5C,KAAP;AACA,CAtDoE,CAA/D;AAyDPlG,SAAS,CACR,0BADQ,EAER,2BAFQ,EAGR6E,aAHQ,CAAT;AAMA7E,SAAS,CACR,kCADQ,EAER,0BAFQ,EAGRgF,YAHQ,CAAT;AAMAhF,SAAS,CACR,0BADQ,EAER,0BAFQ,EAGRuF,YAHQ,CAAT;AAMAvF,SAAS,CACR,uBADQ,EAER,8CAFQ,EAGR0F,4BAHQ,CAAT","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { getBlockSupport } from '@wordpress/blocks';\nimport {\n\t__experimentalBorderBoxControl as BorderBoxControl,\n\t__experimentalHasSplitBorders as hasSplitBorders,\n\t__experimentalIsDefinedBorder as isDefinedBorder,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\nimport { createHigherOrderComponent } from '@wordpress/compose';\nimport { Platform } from '@wordpress/element';\nimport { addFilter } from '@wordpress/hooks';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport {\n\tBorderRadiusEdit,\n\thasBorderRadiusValue,\n\tresetBorderRadius,\n} from './border-radius';\nimport { getColorClassName } from '../components/colors';\nimport InspectorControls from '../components/inspector-controls';\nimport useMultipleOriginColorsAndGradients from '../components/colors-gradients/use-multiple-origin-colors-and-gradients';\nimport useSetting from '../components/use-setting';\nimport { cleanEmptyObject, shouldSkipSerialization } from './utils';\n\nexport const BORDER_SUPPORT_KEY = '__experimentalBorder';\n\nconst borderSides = [ 'top', 'right', 'bottom', 'left' ];\n\nconst hasBorderValue = ( props ) => {\n\tconst { borderColor, style } = props.attributes;\n\treturn isDefinedBorder( style?.border ) || !! borderColor;\n};\n\n// The border color, style, and width are omitted so they get undefined. The\n// border radius is separate and must retain its selection.\nconst resetBorder = ( { attributes = {}, setAttributes } ) => {\n\tconst { style } = attributes;\n\tsetAttributes( {\n\t\tborderColor: undefined,\n\t\tstyle: {\n\t\t\t...style,\n\t\t\tborder: cleanEmptyObject( {\n\t\t\t\tradius: style?.border?.radius,\n\t\t\t} ),\n\t\t},\n\t} );\n};\n\nconst resetBorderFilter = ( newAttributes ) => ( {\n\t...newAttributes,\n\tborderColor: undefined,\n\tstyle: {\n\t\t...newAttributes.style,\n\t\tborder: {\n\t\t\tradius: newAttributes.style?.border?.radius,\n\t\t},\n\t},\n} );\n\nconst getColorByProperty = ( colors, property, value ) => {\n\tlet matchedColor;\n\n\tcolors.some( ( origin ) =>\n\t\torigin.colors.some( ( color ) => {\n\t\t\tif ( color[ property ] === value ) {\n\t\t\t\tmatchedColor = color;\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t} )\n\t);\n\n\treturn matchedColor;\n};\n\nexport const getMultiOriginColor = ( { colors, namedColor, customColor } ) => {\n\t// Search each origin (default, theme, or user) for matching color by name.\n\tif ( namedColor ) {\n\t\tconst colorObject = getColorByProperty( colors, 'slug', namedColor );\n\t\tif ( colorObject ) {\n\t\t\treturn colorObject;\n\t\t}\n\t}\n\n\t// Skip if no custom color or matching named color.\n\tif ( ! customColor ) {\n\t\treturn { color: undefined };\n\t}\n\n\t// Attempt to find color via custom color value or build new object.\n\tconst colorObject = getColorByProperty( colors, 'color', customColor );\n\treturn colorObject ? colorObject : { color: customColor };\n};\n\nconst getBorderObject = ( attributes, colors ) => {\n\tconst { borderColor, style } = attributes;\n\tconst { border: borderStyles } = style || {};\n\n\t// If we have a named color for a flat border. Fetch that color object and\n\t// apply that color's value to the color property within the style object.\n\tif ( borderColor ) {\n\t\tconst { color } = getMultiOriginColor( {\n\t\t\tcolors,\n\t\t\tnamedColor: borderColor,\n\t\t} );\n\n\t\treturn color ? { ...borderStyles, color } : borderStyles;\n\t}\n\n\t// Individual side border color slugs are stored within the border style\n\t// object. If we don't have a border styles object we have nothing further\n\t// to hydrate.\n\tif ( ! borderStyles ) {\n\t\treturn borderStyles;\n\t}\n\n\t// If we have named colors for the individual side borders, retrieve their\n\t// related color objects and apply the real color values to the split\n\t// border objects.\n\tconst hydratedBorderStyles = { ...borderStyles };\n\tborderSides.forEach( ( side ) => {\n\t\tconst colorSlug = getColorSlugFromVariable(\n\t\t\thydratedBorderStyles[ side ]?.color\n\t\t);\n\t\tif ( colorSlug ) {\n\t\t\tconst { color } = getMultiOriginColor( {\n\t\t\t\tcolors,\n\t\t\t\tnamedColor: colorSlug,\n\t\t\t} );\n\t\t\thydratedBorderStyles[ side ] = {\n\t\t\t\t...hydratedBorderStyles[ side ],\n\t\t\t\tcolor,\n\t\t\t};\n\t\t}\n\t} );\n\n\treturn hydratedBorderStyles;\n};\n\nfunction getColorSlugFromVariable( value ) {\n\tconst namedColor = /var:preset\\|color\\|(.+)/.exec( value );\n\tif ( namedColor && namedColor[ 1 ] ) {\n\t\treturn namedColor[ 1 ];\n\t}\n\treturn null;\n}\n\nexport function BorderPanel( props ) {\n\tconst { attributes, clientId, setAttributes } = props;\n\tconst { style } = attributes;\n\tconst { colors } = useMultipleOriginColorsAndGradients();\n\n\tconst isSupported = hasBorderSupport( props.name );\n\tconst isColorSupported =\n\t\tuseSetting( 'border.color' ) && hasBorderSupport( props.name, 'color' );\n\tconst isRadiusSupported =\n\t\tuseSetting( 'border.radius' ) &&\n\t\thasBorderSupport( props.name, 'radius' );\n\tconst isStyleSupported =\n\t\tuseSetting( 'border.style' ) && hasBorderSupport( props.name, 'style' );\n\tconst isWidthSupported =\n\t\tuseSetting( 'border.width' ) && hasBorderSupport( props.name, 'width' );\n\n\tconst isDisabled = [\n\t\t! isColorSupported,\n\t\t! isRadiusSupported,\n\t\t! isStyleSupported,\n\t\t! isWidthSupported,\n\t].every( Boolean );\n\n\tif ( isDisabled || ! isSupported ) {\n\t\treturn null;\n\t}\n\n\tconst defaultBorderControls = getBlockSupport( props.name, [\n\t\tBORDER_SUPPORT_KEY,\n\t\t'__experimentalDefaultControls',\n\t] );\n\n\tconst showBorderByDefault =\n\t\tdefaultBorderControls?.color || defaultBorderControls?.width;\n\n\tconst onBorderChange = ( newBorder ) => {\n\t\t// Filter out named colors and apply them to appropriate block\n\t\t// attributes so that CSS classes can be used to apply those colors.\n\t\t// e.g. has-primary-border-top-color.\n\n\t\tlet newBorderStyles = { ...newBorder };\n\t\tlet newBorderColor;\n\n\t\tif ( hasSplitBorders( newBorder ) ) {\n\t\t\t// For each side check if the side has a color value set\n\t\t\t// If so, determine if it belongs to a named color, in which case\n\t\t\t// we update the color property.\n\t\t\t//\n\t\t\t// This deliberately overwrites `newBorderStyles` to avoid mutating\n\t\t\t// the passed object which causes problems otherwise.\n\t\t\tnewBorderStyles = {\n\t\t\t\ttop: { ...newBorder.top },\n\t\t\t\tright: { ...newBorder.right },\n\t\t\t\tbottom: { ...newBorder.bottom },\n\t\t\t\tleft: { ...newBorder.left },\n\t\t\t};\n\n\t\t\tborderSides.forEach( ( side ) => {\n\t\t\t\tif ( newBorder[ side ]?.color ) {\n\t\t\t\t\tconst colorObject = getMultiOriginColor( {\n\t\t\t\t\t\tcolors,\n\t\t\t\t\t\tcustomColor: newBorder[ side ]?.color,\n\t\t\t\t\t} );\n\n\t\t\t\t\tif ( colorObject.slug ) {\n\t\t\t\t\t\tnewBorderStyles[\n\t\t\t\t\t\t\tside\n\t\t\t\t\t\t].color = `var:preset|color|${ colorObject.slug }`;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} );\n\t\t} else if ( newBorder?.color ) {\n\t\t\t// We have a flat border configuration. Apply named color slug to\n\t\t\t// `borderColor` attribute and clear color style property if found.\n\t\t\tconst customColor = newBorder?.color;\n\t\t\tconst colorObject = getMultiOriginColor( { colors, customColor } );\n\n\t\t\tif ( colorObject.slug ) {\n\t\t\t\tnewBorderColor = colorObject.slug;\n\t\t\t\tnewBorderStyles.color = undefined;\n\t\t\t}\n\t\t}\n\n\t\t// Ensure previous border radius styles are maintained and clean\n\t\t// overall result for empty objects or properties.\n\t\tconst newStyle = cleanEmptyObject( {\n\t\t\t...style,\n\t\t\tborder: { radius: style?.border?.radius, ...newBorderStyles },\n\t\t} );\n\n\t\tsetAttributes( {\n\t\t\tstyle: newStyle,\n\t\t\tborderColor: newBorderColor,\n\t\t} );\n\t};\n\n\tconst hydratedBorder = getBorderObject( attributes, colors );\n\n\treturn (\n\t\t<InspectorControls __experimentalGroup=\"border\">\n\t\t\t{ ( isWidthSupported || isColorSupported ) && (\n\t\t\t\t<ToolsPanelItem\n\t\t\t\t\thasValue={ () => hasBorderValue( props ) }\n\t\t\t\t\tlabel={ __( 'Border' ) }\n\t\t\t\t\tonDeselect={ () => resetBorder( props ) }\n\t\t\t\t\tisShownByDefault={ showBorderByDefault }\n\t\t\t\t\tresetAllFilter={ resetBorderFilter }\n\t\t\t\t\tpanelId={ clientId }\n\t\t\t\t>\n\t\t\t\t\t<BorderBoxControl\n\t\t\t\t\t\tcolors={ colors }\n\t\t\t\t\t\tenableAlpha={ true }\n\t\t\t\t\t\tenableStyle={ isStyleSupported }\n\t\t\t\t\t\tonChange={ onBorderChange }\n\t\t\t\t\t\tpopoverOffset={ 40 }\n\t\t\t\t\t\tpopoverPlacement=\"left-start\"\n\t\t\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\t\t\tvalue={ hydratedBorder }\n\t\t\t\t\t\t__experimentalIsRenderedInSidebar={ true }\n\t\t\t\t\t/>\n\t\t\t\t</ToolsPanelItem>\n\t\t\t) }\n\t\t\t{ isRadiusSupported && (\n\t\t\t\t<ToolsPanelItem\n\t\t\t\t\thasValue={ () => hasBorderRadiusValue( props ) }\n\t\t\t\t\tlabel={ __( 'Radius' ) }\n\t\t\t\t\tonDeselect={ () => resetBorderRadius( props ) }\n\t\t\t\t\tisShownByDefault={ defaultBorderControls?.radius }\n\t\t\t\t\tresetAllFilter={ ( newAttributes ) => ( {\n\t\t\t\t\t\t...newAttributes,\n\t\t\t\t\t\tstyle: {\n\t\t\t\t\t\t\t...newAttributes.style,\n\t\t\t\t\t\t\tborder: {\n\t\t\t\t\t\t\t\t...newAttributes.style?.border,\n\t\t\t\t\t\t\t\tradius: undefined,\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\tpanelId={ clientId }\n\t\t\t\t>\n\t\t\t\t\t<BorderRadiusEdit { ...props } />\n\t\t\t\t</ToolsPanelItem>\n\t\t\t) }\n\t\t</InspectorControls>\n\t);\n}\n\n/**\n * Determine whether there is block support for border properties.\n *\n * @param {string} blockName Block name.\n * @param {string} feature Border feature to check support for.\n *\n * @return {boolean} Whether there is support.\n */\nexport function hasBorderSupport( blockName, feature = 'any' ) {\n\tif ( Platform.OS !== 'web' ) {\n\t\treturn false;\n\t}\n\n\tconst support = getBlockSupport( blockName, BORDER_SUPPORT_KEY );\n\n\tif ( support === true ) {\n\t\treturn true;\n\t}\n\n\tif ( feature === 'any' ) {\n\t\treturn !! (\n\t\t\tsupport?.color ||\n\t\t\tsupport?.radius ||\n\t\t\tsupport?.width ||\n\t\t\tsupport?.style\n\t\t);\n\t}\n\n\treturn !! support?.[ feature ];\n}\n\n/**\n * Returns a new style object where the specified border attribute has been\n * removed.\n *\n * @param {Object} style Styles from block attributes.\n * @param {string} attribute The border style attribute to clear.\n *\n * @return {Object} Style object with the specified attribute removed.\n */\nexport function removeBorderAttribute( style, attribute ) {\n\treturn cleanEmptyObject( {\n\t\t...style,\n\t\tborder: {\n\t\t\t...style?.border,\n\t\t\t[ attribute ]: undefined,\n\t\t},\n\t} );\n}\n\n/**\n * Filters registered block settings, extending attributes to include\n * `borderColor` if needed.\n *\n * @param {Object} settings Original block settings.\n *\n * @return {Object} Updated block settings.\n */\nfunction addAttributes( settings ) {\n\tif ( ! hasBorderSupport( settings, 'color' ) ) {\n\t\treturn settings;\n\t}\n\n\t// Allow blocks to specify default value if needed.\n\tif ( settings.attributes.borderColor ) {\n\t\treturn settings;\n\t}\n\n\t// Add new borderColor attribute to block settings.\n\treturn {\n\t\t...settings,\n\t\tattributes: {\n\t\t\t...settings.attributes,\n\t\t\tborderColor: {\n\t\t\t\ttype: 'string',\n\t\t\t},\n\t\t},\n\t};\n}\n\n/**\n * Override props assigned to save component to inject border color.\n *\n * @param {Object} props Additional props applied to save element.\n * @param {Object} blockType Block type definition.\n * @param {Object} attributes Block's attributes.\n *\n * @return {Object} Filtered props to apply to save element.\n */\nfunction addSaveProps( props, blockType, attributes ) {\n\tif (\n\t\t! hasBorderSupport( blockType, 'color' ) ||\n\t\tshouldSkipSerialization( blockType, BORDER_SUPPORT_KEY, 'color' )\n\t) {\n\t\treturn props;\n\t}\n\n\tconst borderClasses = getBorderClasses( attributes );\n\tconst newClassName = classnames( props.className, borderClasses );\n\n\t// If we are clearing the last of the previous classes in `className`\n\t// set it to `undefined` to avoid rendering empty DOM attributes.\n\tprops.className = newClassName ? newClassName : undefined;\n\n\treturn props;\n}\n\n/**\n * Generates a CSS class name consisting of all the applicable border color\n * classes given the current block attributes.\n *\n * @param {Object} attributes Block's attributes.\n *\n * @return {string} CSS class name.\n */\nexport function getBorderClasses( attributes ) {\n\tconst { borderColor, style } = attributes;\n\tconst borderColorClass = getColorClassName( 'border-color', borderColor );\n\n\treturn classnames( {\n\t\t'has-border-color': borderColor || style?.border?.color,\n\t\t[ borderColorClass ]: !! borderColorClass,\n\t} );\n}\n\n/**\n * Filters the registered block settings to apply border color styles and\n * classnames to the block edit wrapper.\n *\n * @param {Object} settings Original block settings.\n *\n * @return {Object} Filtered block settings.\n */\nfunction addEditProps( settings ) {\n\tif (\n\t\t! hasBorderSupport( settings, 'color' ) ||\n\t\tshouldSkipSerialization( settings, BORDER_SUPPORT_KEY, 'color' )\n\t) {\n\t\treturn settings;\n\t}\n\n\tconst existingGetEditWrapperProps = settings.getEditWrapperProps;\n\tsettings.getEditWrapperProps = ( attributes ) => {\n\t\tlet props = {};\n\n\t\tif ( existingGetEditWrapperProps ) {\n\t\t\tprops = existingGetEditWrapperProps( attributes );\n\t\t}\n\n\t\treturn addSaveProps( props, settings, attributes );\n\t};\n\n\treturn settings;\n}\n\n/**\n * This adds inline styles for color palette colors.\n * Ideally, this is not needed and themes should load their palettes on the editor.\n *\n * @param {Function} BlockListBlock Original component.\n *\n * @return {Function} Wrapped component.\n */\nexport const withBorderColorPaletteStyles = createHigherOrderComponent(\n\t( BlockListBlock ) => ( props ) => {\n\t\tconst { name, attributes } = props;\n\t\tconst { borderColor, style } = attributes;\n\t\tconst { colors } = useMultipleOriginColorsAndGradients();\n\n\t\tif (\n\t\t\t! hasBorderSupport( name, 'color' ) ||\n\t\t\tshouldSkipSerialization( name, BORDER_SUPPORT_KEY, 'color' )\n\t\t) {\n\t\t\treturn <BlockListBlock { ...props } />;\n\t\t}\n\n\t\tconst { color: borderColorValue } = getMultiOriginColor( {\n\t\t\tcolors,\n\t\t\tnamedColor: borderColor,\n\t\t} );\n\t\tconst { color: borderTopColor } = getMultiOriginColor( {\n\t\t\tcolors,\n\t\t\tnamedColor: getColorSlugFromVariable( style?.border?.top?.color ),\n\t\t} );\n\t\tconst { color: borderRightColor } = getMultiOriginColor( {\n\t\t\tcolors,\n\t\t\tnamedColor: getColorSlugFromVariable( style?.border?.right?.color ),\n\t\t} );\n\n\t\tconst { color: borderBottomColor } = getMultiOriginColor( {\n\t\t\tcolors,\n\t\t\tnamedColor: getColorSlugFromVariable(\n\t\t\t\tstyle?.border?.bottom?.color\n\t\t\t),\n\t\t} );\n\t\tconst { color: borderLeftColor } = getMultiOriginColor( {\n\t\t\tcolors,\n\t\t\tnamedColor: getColorSlugFromVariable( style?.border?.left?.color ),\n\t\t} );\n\n\t\tconst extraStyles = {\n\t\t\tborderTopColor: borderTopColor || borderColorValue,\n\t\t\tborderRightColor: borderRightColor || borderColorValue,\n\t\t\tborderBottomColor: borderBottomColor || borderColorValue,\n\t\t\tborderLeftColor: borderLeftColor || borderColorValue,\n\t\t};\n\n\t\tlet wrapperProps = props.wrapperProps;\n\t\twrapperProps = {\n\t\t\t...props.wrapperProps,\n\t\t\tstyle: {\n\t\t\t\t...props.wrapperProps?.style,\n\t\t\t\t...extraStyles,\n\t\t\t},\n\t\t};\n\n\t\treturn <BlockListBlock { ...props } wrapperProps={ wrapperProps } />;\n\t}\n);\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/border/addAttributes',\n\taddAttributes\n);\n\naddFilter(\n\t'blocks.getSaveContent.extraProps',\n\t'core/border/addSaveProps',\n\taddSaveProps\n);\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/border/addEditProps',\n\taddEditProps\n);\n\naddFilter(\n\t'editor.BlockListBlock',\n\t'core/border/with-border-color-palette-styles',\n\twithBorderColorPaletteStyles\n);\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/hooks/border.js"],"names":["classnames","getBlockSupport","__experimentalBorderBoxControl","BorderBoxControl","__experimentalHasSplitBorders","hasSplitBorders","__experimentalIsDefinedBorder","isDefinedBorder","__experimentalToolsPanelItem","ToolsPanelItem","createHigherOrderComponent","Platform","addFilter","__","BorderRadiusEdit","hasBorderRadiusValue","resetBorderRadius","getColorClassName","InspectorControls","useMultipleOriginColorsAndGradients","useSetting","cleanEmptyObject","shouldSkipSerialization","BORDER_SUPPORT_KEY","borderSides","hasBorderValue","props","borderColor","style","attributes","border","resetBorder","setAttributes","undefined","radius","resetBorderFilter","newAttributes","getColorByProperty","colors","property","value","matchedColor","some","origin","color","getMultiOriginColor","namedColor","customColor","colorObject","getBorderObject","borderStyles","hydratedBorderStyles","forEach","side","colorSlug","getColorSlugFromVariable","exec","BorderPanel","clientId","isSupported","hasBorderSupport","name","isColorSupported","isRadiusSupported","isStyleSupported","isWidthSupported","isDisabled","every","Boolean","defaultBorderControls","showBorderByDefault","width","onBorderChange","newBorder","newBorderStyles","newBorderColor","top","right","bottom","left","slug","newStyle","hydratedBorder","blockName","feature","OS","support","removeBorderAttribute","attribute","addAttributes","settings","type","addSaveProps","blockType","borderClasses","getBorderClasses","newClassName","className","borderColorClass","addEditProps","existingGetEditWrapperProps","getEditWrapperProps","withBorderColorPaletteStyles","BlockListBlock","borderColorValue","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","extraStyles","wrapperProps"],"mappings":";;;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,eAAT,QAAgC,mBAAhC;AACA,SACCC,8BAA8B,IAAIC,gBADnC,EAECC,6BAA6B,IAAIC,eAFlC,EAGCC,6BAA6B,IAAIC,eAHlC,EAICC,4BAA4B,IAAIC,cAJjC,QAKO,uBALP;AAMA,SAASC,0BAAT,QAA2C,oBAA3C;AACA,SAASC,QAAT,QAAyB,oBAAzB;AACA,SAASC,SAAT,QAA0B,kBAA1B;AACA,SAASC,EAAT,QAAmB,iBAAnB;AAEA;AACA;AACA;;AACA,SACCC,gBADD,EAECC,oBAFD,EAGCC,iBAHD,QAIO,iBAJP;AAKA,SAASC,iBAAT,QAAkC,sBAAlC;AACA,OAAOC,iBAAP,MAA8B,kCAA9B;AACA,OAAOC,mCAAP,MAAgD,yEAAhD;A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cesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { getBlockSupport } from '@wordpress/blocks';\nimport {\n\t__experimentalBorderBoxControl as BorderBoxControl,\n\t__experimentalHasSplitBorders as hasSplitBorders,\n\t__experimentalIsDefinedBorder as isDefinedBorder,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\nimport { createHigherOrderComponent } from '@wordpress/compose';\nimport { Platform } from '@wordpress/element';\nimport { addFilter } from '@wordpress/hooks';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport {\n\tBorderRadiusEdit,\n\thasBorderRadiusValue,\n\tresetBorderRadius,\n} from './border-radius';\nimport { getColorClassName } from '../components/colors';\nimport InspectorControls from '../components/inspector-controls';\nimport useMultipleOriginColorsAndGradients from '../components/colors-gradients/use-multiple-origin-colors-and-gradients';\nimport useSetting from '../components/use-setting';\nimport { cleanEmptyObject, shouldSkipSerialization } from './utils';\n\nexport const BORDER_SUPPORT_KEY = '__experimentalBorder';\n\nconst borderSides = [ 'top', 'right', 'bottom', 'left' ];\n\nconst hasBorderValue = ( props ) => {\n\tconst { borderColor, style } = props.attributes;\n\treturn isDefinedBorder( style?.border ) || !! borderColor;\n};\n\n// The border color, style, and width are omitted so they get undefined. The\n// border radius is separate and must retain its selection.\nconst resetBorder = ( { attributes = {}, setAttributes } ) => {\n\tconst { style } = attributes;\n\tsetAttributes( {\n\t\tborderColor: undefined,\n\t\tstyle: {\n\t\t\t...style,\n\t\t\tborder: cleanEmptyObject( {\n\t\t\t\tradius: style?.border?.radius,\n\t\t\t} ),\n\t\t},\n\t} );\n};\n\nconst resetBorderFilter = ( newAttributes ) => ( {\n\t...newAttributes,\n\tborderColor: undefined,\n\tstyle: {\n\t\t...newAttributes.style,\n\t\tborder: {\n\t\t\tradius: newAttributes.style?.border?.radius,\n\t\t},\n\t},\n} );\n\nconst getColorByProperty = ( colors, property, value ) => {\n\tlet matchedColor;\n\n\tcolors.some( ( origin ) =>\n\t\torigin.colors.some( ( color ) => {\n\t\t\tif ( color[ property ] === value ) {\n\t\t\t\tmatchedColor = color;\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t} )\n\t);\n\n\treturn matchedColor;\n};\n\nexport const getMultiOriginColor = ( { colors, namedColor, customColor } ) => {\n\t// Search each origin (default, theme, or user) for matching color by name.\n\tif ( namedColor ) {\n\t\tconst colorObject = getColorByProperty( colors, 'slug', namedColor );\n\t\tif ( colorObject ) {\n\t\t\treturn colorObject;\n\t\t}\n\t}\n\n\t// Skip if no custom color or matching named color.\n\tif ( ! customColor ) {\n\t\treturn { color: undefined };\n\t}\n\n\t// Attempt to find color via custom color value or build new object.\n\tconst colorObject = getColorByProperty( colors, 'color', customColor );\n\treturn colorObject ? colorObject : { color: customColor };\n};\n\nconst getBorderObject = ( attributes, colors ) => {\n\tconst { borderColor, style } = attributes;\n\tconst { border: borderStyles } = style || {};\n\n\t// If we have a named color for a flat border. Fetch that color object and\n\t// apply that color's value to the color property within the style object.\n\tif ( borderColor ) {\n\t\tconst { color } = getMultiOriginColor( {\n\t\t\tcolors,\n\t\t\tnamedColor: borderColor,\n\t\t} );\n\n\t\treturn color ? { ...borderStyles, color } : borderStyles;\n\t}\n\n\t// Individual side border color slugs are stored within the border style\n\t// object. If we don't have a border styles object we have nothing further\n\t// to hydrate.\n\tif ( ! borderStyles ) {\n\t\treturn borderStyles;\n\t}\n\n\t// If we have named colors for the individual side borders, retrieve their\n\t// related color objects and apply the real color values to the split\n\t// border objects.\n\tconst hydratedBorderStyles = { ...borderStyles };\n\tborderSides.forEach( ( side ) => {\n\t\tconst colorSlug = getColorSlugFromVariable(\n\t\t\thydratedBorderStyles[ side ]?.color\n\t\t);\n\t\tif ( colorSlug ) {\n\t\t\tconst { color } = getMultiOriginColor( {\n\t\t\t\tcolors,\n\t\t\t\tnamedColor: colorSlug,\n\t\t\t} );\n\t\t\thydratedBorderStyles[ side ] = {\n\t\t\t\t...hydratedBorderStyles[ side ],\n\t\t\t\tcolor,\n\t\t\t};\n\t\t}\n\t} );\n\n\treturn hydratedBorderStyles;\n};\n\nfunction getColorSlugFromVariable( value ) {\n\tconst namedColor = /var:preset\\|color\\|(.+)/.exec( value );\n\tif ( namedColor && namedColor[ 1 ] ) {\n\t\treturn namedColor[ 1 ];\n\t}\n\treturn null;\n}\n\nexport function BorderPanel( props ) {\n\tconst { attributes, clientId, setAttributes } = props;\n\tconst { style } = attributes;\n\tconst { colors } = useMultipleOriginColorsAndGradients();\n\n\tconst isSupported = hasBorderSupport( props.name );\n\tconst isColorSupported =\n\t\tuseSetting( 'border.color' ) && hasBorderSupport( props.name, 'color' );\n\tconst isRadiusSupported =\n\t\tuseSetting( 'border.radius' ) &&\n\t\thasBorderSupport( props.name, 'radius' );\n\tconst isStyleSupported =\n\t\tuseSetting( 'border.style' ) && hasBorderSupport( props.name, 'style' );\n\tconst isWidthSupported =\n\t\tuseSetting( 'border.width' ) && hasBorderSupport( props.name, 'width' );\n\n\tconst isDisabled = [\n\t\t! isColorSupported,\n\t\t! isRadiusSupported,\n\t\t! isStyleSupported,\n\t\t! isWidthSupported,\n\t].every( Boolean );\n\n\tif ( isDisabled || ! isSupported ) {\n\t\treturn null;\n\t}\n\n\tconst defaultBorderControls = getBlockSupport( props.name, [\n\t\tBORDER_SUPPORT_KEY,\n\t\t'__experimentalDefaultControls',\n\t] );\n\n\tconst showBorderByDefault =\n\t\tdefaultBorderControls?.color || defaultBorderControls?.width;\n\n\tconst onBorderChange = ( newBorder ) => {\n\t\t// Filter out named colors and apply them to appropriate block\n\t\t// attributes so that CSS classes can be used to apply those colors.\n\t\t// e.g. has-primary-border-top-color.\n\n\t\tlet newBorderStyles = { ...newBorder };\n\t\tlet newBorderColor;\n\n\t\tif ( hasSplitBorders( newBorder ) ) {\n\t\t\t// For each side check if the side has a color value set\n\t\t\t// If so, determine if it belongs to a named color, in which case\n\t\t\t// we update the color property.\n\t\t\t//\n\t\t\t// This deliberately overwrites `newBorderStyles` to avoid mutating\n\t\t\t// the passed object which causes problems otherwise.\n\t\t\tnewBorderStyles = {\n\t\t\t\ttop: { ...newBorder.top },\n\t\t\t\tright: { ...newBorder.right },\n\t\t\t\tbottom: { ...newBorder.bottom },\n\t\t\t\tleft: { ...newBorder.left },\n\t\t\t};\n\n\t\t\tborderSides.forEach( ( side ) => {\n\t\t\t\tif ( newBorder[ side ]?.color ) {\n\t\t\t\t\tconst colorObject = getMultiOriginColor( {\n\t\t\t\t\t\tcolors,\n\t\t\t\t\t\tcustomColor: newBorder[ side ]?.color,\n\t\t\t\t\t} );\n\n\t\t\t\t\tif ( colorObject.slug ) {\n\t\t\t\t\t\tnewBorderStyles[\n\t\t\t\t\t\t\tside\n\t\t\t\t\t\t].color = `var:preset|color|${ colorObject.slug }`;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} );\n\t\t} else if ( newBorder?.color ) {\n\t\t\t// We have a flat border configuration. Apply named color slug to\n\t\t\t// `borderColor` attribute and clear color style property if found.\n\t\t\tconst customColor = newBorder?.color;\n\t\t\tconst colorObject = getMultiOriginColor( { colors, customColor } );\n\n\t\t\tif ( colorObject.slug ) {\n\t\t\t\tnewBorderColor = colorObject.slug;\n\t\t\t\tnewBorderStyles.color = undefined;\n\t\t\t}\n\t\t}\n\n\t\t// Ensure previous border radius styles are maintained and clean\n\t\t// overall result for empty objects or properties.\n\t\tconst newStyle = cleanEmptyObject( {\n\t\t\t...style,\n\t\t\tborder: { radius: style?.border?.radius, ...newBorderStyles },\n\t\t} );\n\n\t\tsetAttributes( {\n\t\t\tstyle: newStyle,\n\t\t\tborderColor: newBorderColor,\n\t\t} );\n\t};\n\n\tconst hydratedBorder = getBorderObject( attributes, colors );\n\n\treturn (\n\t\t<InspectorControls group=\"border\">\n\t\t\t{ ( isWidthSupported || isColorSupported ) && (\n\t\t\t\t<ToolsPanelItem\n\t\t\t\t\thasValue={ () => hasBorderValue( props ) }\n\t\t\t\t\tlabel={ __( 'Border' ) }\n\t\t\t\t\tonDeselect={ () => resetBorder( props ) }\n\t\t\t\t\tisShownByDefault={ showBorderByDefault }\n\t\t\t\t\tresetAllFilter={ resetBorderFilter }\n\t\t\t\t\tpanelId={ clientId }\n\t\t\t\t>\n\t\t\t\t\t<BorderBoxControl\n\t\t\t\t\t\tcolors={ colors }\n\t\t\t\t\t\tenableAlpha={ true }\n\t\t\t\t\t\tenableStyle={ isStyleSupported }\n\t\t\t\t\t\tonChange={ onBorderChange }\n\t\t\t\t\t\tpopoverOffset={ 40 }\n\t\t\t\t\t\tpopoverPlacement=\"left-start\"\n\t\t\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\t\t\tvalue={ hydratedBorder }\n\t\t\t\t\t\t__experimentalIsRenderedInSidebar={ true }\n\t\t\t\t\t/>\n\t\t\t\t</ToolsPanelItem>\n\t\t\t) }\n\t\t\t{ isRadiusSupported && (\n\t\t\t\t<ToolsPanelItem\n\t\t\t\t\thasValue={ () => hasBorderRadiusValue( props ) }\n\t\t\t\t\tlabel={ __( 'Radius' ) }\n\t\t\t\t\tonDeselect={ () => resetBorderRadius( props ) }\n\t\t\t\t\tisShownByDefault={ defaultBorderControls?.radius }\n\t\t\t\t\tresetAllFilter={ ( newAttributes ) => ( {\n\t\t\t\t\t\t...newAttributes,\n\t\t\t\t\t\tstyle: {\n\t\t\t\t\t\t\t...newAttributes.style,\n\t\t\t\t\t\t\tborder: {\n\t\t\t\t\t\t\t\t...newAttributes.style?.border,\n\t\t\t\t\t\t\t\tradius: undefined,\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\tpanelId={ clientId }\n\t\t\t\t>\n\t\t\t\t\t<BorderRadiusEdit { ...props } />\n\t\t\t\t</ToolsPanelItem>\n\t\t\t) }\n\t\t</InspectorControls>\n\t);\n}\n\n/**\n * Determine whether there is block support for border properties.\n *\n * @param {string} blockName Block name.\n * @param {string} feature Border feature to check support for.\n *\n * @return {boolean} Whether there is support.\n */\nexport function hasBorderSupport( blockName, feature = 'any' ) {\n\tif ( Platform.OS !== 'web' ) {\n\t\treturn false;\n\t}\n\n\tconst support = getBlockSupport( blockName, BORDER_SUPPORT_KEY );\n\n\tif ( support === true ) {\n\t\treturn true;\n\t}\n\n\tif ( feature === 'any' ) {\n\t\treturn !! (\n\t\t\tsupport?.color ||\n\t\t\tsupport?.radius ||\n\t\t\tsupport?.width ||\n\t\t\tsupport?.style\n\t\t);\n\t}\n\n\treturn !! support?.[ feature ];\n}\n\n/**\n * Returns a new style object where the specified border attribute has been\n * removed.\n *\n * @param {Object} style Styles from block attributes.\n * @param {string} attribute The border style attribute to clear.\n *\n * @return {Object} Style object with the specified attribute removed.\n */\nexport function removeBorderAttribute( style, attribute ) {\n\treturn cleanEmptyObject( {\n\t\t...style,\n\t\tborder: {\n\t\t\t...style?.border,\n\t\t\t[ attribute ]: undefined,\n\t\t},\n\t} );\n}\n\n/**\n * Filters registered block settings, extending attributes to include\n * `borderColor` if needed.\n *\n * @param {Object} settings Original block settings.\n *\n * @return {Object} Updated block settings.\n */\nfunction addAttributes( settings ) {\n\tif ( ! hasBorderSupport( settings, 'color' ) ) {\n\t\treturn settings;\n\t}\n\n\t// Allow blocks to specify default value if needed.\n\tif ( settings.attributes.borderColor ) {\n\t\treturn settings;\n\t}\n\n\t// Add new borderColor attribute to block settings.\n\treturn {\n\t\t...settings,\n\t\tattributes: {\n\t\t\t...settings.attributes,\n\t\t\tborderColor: {\n\t\t\t\ttype: 'string',\n\t\t\t},\n\t\t},\n\t};\n}\n\n/**\n * Override props assigned to save component to inject border color.\n *\n * @param {Object} props Additional props applied to save element.\n * @param {Object} blockType Block type definition.\n * @param {Object} attributes Block's attributes.\n *\n * @return {Object} Filtered props to apply to save element.\n */\nfunction addSaveProps( props, blockType, attributes ) {\n\tif (\n\t\t! hasBorderSupport( blockType, 'color' ) ||\n\t\tshouldSkipSerialization( blockType, BORDER_SUPPORT_KEY, 'color' )\n\t) {\n\t\treturn props;\n\t}\n\n\tconst borderClasses = getBorderClasses( attributes );\n\tconst newClassName = classnames( props.className, borderClasses );\n\n\t// If we are clearing the last of the previous classes in `className`\n\t// set it to `undefined` to avoid rendering empty DOM attributes.\n\tprops.className = newClassName ? newClassName : undefined;\n\n\treturn props;\n}\n\n/**\n * Generates a CSS class name consisting of all the applicable border color\n * classes given the current block attributes.\n *\n * @param {Object} attributes Block's attributes.\n *\n * @return {string} CSS class name.\n */\nexport function getBorderClasses( attributes ) {\n\tconst { borderColor, style } = attributes;\n\tconst borderColorClass = getColorClassName( 'border-color', borderColor );\n\n\treturn classnames( {\n\t\t'has-border-color': borderColor || style?.border?.color,\n\t\t[ borderColorClass ]: !! borderColorClass,\n\t} );\n}\n\n/**\n * Filters the registered block settings to apply border color styles and\n * classnames to the block edit wrapper.\n *\n * @param {Object} settings Original block settings.\n *\n * @return {Object} Filtered block settings.\n */\nfunction addEditProps( settings ) {\n\tif (\n\t\t! hasBorderSupport( settings, 'color' ) ||\n\t\tshouldSkipSerialization( settings, BORDER_SUPPORT_KEY, 'color' )\n\t) {\n\t\treturn settings;\n\t}\n\n\tconst existingGetEditWrapperProps = settings.getEditWrapperProps;\n\tsettings.getEditWrapperProps = ( attributes ) => {\n\t\tlet props = {};\n\n\t\tif ( existingGetEditWrapperProps ) {\n\t\t\tprops = existingGetEditWrapperProps( attributes );\n\t\t}\n\n\t\treturn addSaveProps( props, settings, attributes );\n\t};\n\n\treturn settings;\n}\n\n/**\n * This adds inline styles for color palette colors.\n * Ideally, this is not needed and themes should load their palettes on the editor.\n *\n * @param {Function} BlockListBlock Original component.\n *\n * @return {Function} Wrapped component.\n */\nexport const withBorderColorPaletteStyles = createHigherOrderComponent(\n\t( BlockListBlock ) => ( props ) => {\n\t\tconst { name, attributes } = props;\n\t\tconst { borderColor, style } = attributes;\n\t\tconst { colors } = useMultipleOriginColorsAndGradients();\n\n\t\tif (\n\t\t\t! hasBorderSupport( name, 'color' ) ||\n\t\t\tshouldSkipSerialization( name, BORDER_SUPPORT_KEY, 'color' )\n\t\t) {\n\t\t\treturn <BlockListBlock { ...props } />;\n\t\t}\n\n\t\tconst { color: borderColorValue } = getMultiOriginColor( {\n\t\t\tcolors,\n\t\t\tnamedColor: borderColor,\n\t\t} );\n\t\tconst { color: borderTopColor } = getMultiOriginColor( {\n\t\t\tcolors,\n\t\t\tnamedColor: getColorSlugFromVariable( style?.border?.top?.color ),\n\t\t} );\n\t\tconst { color: borderRightColor } = getMultiOriginColor( {\n\t\t\tcolors,\n\t\t\tnamedColor: getColorSlugFromVariable( style?.border?.right?.color ),\n\t\t} );\n\n\t\tconst { color: borderBottomColor } = getMultiOriginColor( {\n\t\t\tcolors,\n\t\t\tnamedColor: getColorSlugFromVariable(\n\t\t\t\tstyle?.border?.bottom?.color\n\t\t\t),\n\t\t} );\n\t\tconst { color: borderLeftColor } = getMultiOriginColor( {\n\t\t\tcolors,\n\t\t\tnamedColor: getColorSlugFromVariable( style?.border?.left?.color ),\n\t\t} );\n\n\t\tconst extraStyles = {\n\t\t\tborderTopColor: borderTopColor || borderColorValue,\n\t\t\tborderRightColor: borderRightColor || borderColorValue,\n\t\t\tborderBottomColor: borderBottomColor || borderColorValue,\n\t\t\tborderLeftColor: borderLeftColor || borderColorValue,\n\t\t};\n\n\t\tlet wrapperProps = props.wrapperProps;\n\t\twrapperProps = {\n\t\t\t...props.wrapperProps,\n\t\t\tstyle: {\n\t\t\t\t...props.wrapperProps?.style,\n\t\t\t\t...extraStyles,\n\t\t\t},\n\t\t};\n\n\t\treturn <BlockListBlock { ...props } wrapperProps={ wrapperProps } />;\n\t}\n);\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/border/addAttributes',\n\taddAttributes\n);\n\naddFilter(\n\t'blocks.getSaveContent.extraProps',\n\t'core/border/addSaveProps',\n\taddSaveProps\n);\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/border/addEditProps',\n\taddEditProps\n);\n\naddFilter(\n\t'editor.BlockListBlock',\n\t'core/border/with-border-color-palette-styles',\n\twithBorderColorPaletteStyles\n);\n"]}
@@ -71,6 +71,7 @@ export function ChildLayoutEdit(_ref) {
71
71
  }
72
72
  }, []);
73
73
  return createElement(Fragment, null, createElement(ToggleGroupControl, {
74
+ __nextHasNoMarginBottom: true,
74
75
  size: '__unstable-large',
75
76
  label: childLayoutOrientation(parentLayout),
76
77
  value: selfStretch || 'fit',
@@ -128,9 +129,12 @@ export function hasChildLayoutSupport(_ref2) {
128
129
  } = _ref2;
129
130
  const {
130
131
  type: parentLayoutType = 'default',
132
+ default: {
133
+ type: defaultParentLayoutType = 'default'
134
+ } = {},
131
135
  allowSizingOnChildren = false
132
136
  } = parentLayout;
133
- const support = parentLayoutType === 'flex' && allowSizingOnChildren;
137
+ const support = (defaultParentLayoutType === 'flex' || parentLayoutType === 'flex') && allowSizingOnChildren;
134
138
  return support;
135
139
  }
136
140
  /**
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/hooks/child-layout.js"],"names":["__experimentalToggleGroupControl","ToggleGroupControl","__experimentalToggleGroupControlOption","ToggleGroupControlOption","__experimentalUnitControl","UnitControl","__","useEffect","useSetting","helpText","selfStretch","parentLayout","orientation","ChildLayoutEdit","attributes","setAttributes","__unstableParentLayout","style","layout","childLayout","flexSize","childLayoutOrientation","value","newFlexSize","hasChildLayoutSupport","type","parentLayoutType","allowSizingOnChildren","support","hasChildLayoutValue","props","undefined","resetChildLayout","useIsChildLayoutDisabled","isDisabled"],"mappings":";;AAAA;AACA;AACA;AACA,SACCA,gCAAgC,IAAIC,kBADrC,EAECC,sCAAsC,IAAIC,wBAF3C,EAGCC,yBAAyB,IAAIC,WAH9B,QAIO,uBAJP;AAKA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,SAAT,QAA0B,oBAA1B;AAEA;AACA;AACA;;AACA,OAAOC,UAAP,MAAuB,2BAAvB;;AAEA,SAASC,QAAT,CAAmBC,WAAnB,EAAgCC,YA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CR,IAAAA,sBAAsB,EAAEL,YAAY,GAAG;AADD,GAEnC;AACH,QAAM;AACLc,IAAAA,IAAI,EAAEC,gBAAgB,GAAG,SADpB;AAELC,IAAAA,qBAAqB,GAAG;AAFnB,MAGFhB,YAHJ;AAIA,QAAMiB,OAAO,GAAGF,gBAAgB,KAAK,MAArB,IAA+BC,qBAA/C;AAEA,SAAOC,OAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASC,mBAAT,CAA8BC,KAA9B,EAAsC;AAAA;;AAC5C,SAAO,0BAAAA,KAAK,CAAChB,UAAN,CAAiBG,KAAjB,gFAAwBC,MAAxB,MAAmCa,SAA1C;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASC,gBAAT,QAAgE;AAAA,MAArC;AAAElB,IAAAA,UAAU,GAAG,EAAf;AAAmBC,IAAAA;AAAnB,GAAqC;AACtE,QAAM;AAAEE,IAAAA;AAAF,MAAYH,UAAlB;AAEAC,EAAAA,aAAa,CAAE;AACdE,IAAAA,KAAK,EAAE,EACN,GAAGA,KADG;AAENC,MAAAA,MAAM,EAAEa;AAFF;AADO,GAAF,CAAb;AAMA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASE,wBAAT,CAAmCH,KAAnC,EAA2C;AACjD,QAAMI,UAAU,GAAG,CAAE1B,UAAU,CAAE,QAAF,CAA/B;AAEA,SAAO,CAAEgB,qBAAqB,CAAEM,KAAF,CAAvB,IAAoCI,UAA3C;AACA;AAED,OAAO,SAASb,sBAAT,CAAiCV,YAAjC,EAAgD;AACtD,QAAM;AAAEC,IAAAA,WAAW,GAAG;AAAhB,MAAiCD,YAAvC;AAEA,SAAOC,WAAW,KAAK,YAAhB,GAA+BN,EAAE,CAAE,OAAF,CAAjC,GAA+CA,EAAE,CAAE,QAAF,CAAxD;AACA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n\t__experimentalUnitControl as UnitControl,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport useSetting from '../components/use-setting';\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' ) {\n\t\tif ( orientation === 'horizontal' ) {\n\t\t\treturn __( 'Specify a fixed width.' );\n\t\t}\n\t\treturn __( 'Specify a fixed height.' );\n\t}\n\treturn __( 'Fit contents.' );\n}\n\n/**\n * Inspector controls containing the child layout related configuration.\n *\n * @param {Object} props Block props.\n * @param {Object} props.attributes Block attributes.\n * @param {Object} props.setAttributes Function to set block attributes.\n * @param {Object} props.__unstableParentLayout\n *\n * @return {WPElement} child layout edit element.\n */\nexport function ChildLayoutEdit( {\n\tattributes,\n\tsetAttributes,\n\t__unstableParentLayout: parentLayout,\n} ) {\n\tconst { style = {} } = attributes;\n\tconst { layout: childLayout = {} } = style;\n\tconst { selfStretch, flexSize } = childLayout;\n\n\tuseEffect( () => {\n\t\tif ( selfStretch === 'fixed' && ! flexSize ) {\n\t\t\tsetAttributes( {\n\t\t\t\tstyle: {\n\t\t\t\t\t...style,\n\t\t\t\t\tlayout: {\n\t\t\t\t\t\t...childLayout,\n\t\t\t\t\t\tselfStretch: 'fit',\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t} );\n\t\t}\n\t}, [] );\n\n\treturn (\n\t\t<>\n\t\t\t<ToggleGroupControl\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\tsetAttributes( {\n\t\t\t\t\t\tstyle: {\n\t\t\t\t\t\t\t...style,\n\t\t\t\t\t\t\tlayout: {\n\t\t\t\t\t\t\t\t...childLayout,\n\t\t\t\t\t\t\t\tselfStretch: value,\n\t\t\t\t\t\t\t\tflexSize: newFlexSize,\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\tisBlock={ true }\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={ __( 'Fit' ) }\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={ __( 'Fill' ) }\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={ __( 'Fixed' ) }\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\tsetAttributes( {\n\t\t\t\t\t\t\tstyle: {\n\t\t\t\t\t\t\t\t...style,\n\t\t\t\t\t\t\t\tlayout: {\n\t\t\t\t\t\t\t\t\t...childLayout,\n\t\t\t\t\t\t\t\t\tflexSize: value,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t} );\n\t\t\t\t\t} }\n\t\t\t\t\tvalue={ flexSize }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\n/**\n * Determines if there is child layout support.\n *\n * @param {Object} props Block Props object.\n * @param {Object} props.__unstableParentLayout Parent layout.\n *\n * @return {boolean} Whether there is support.\n */\nexport function hasChildLayoutSupport( {\n\t__unstableParentLayout: parentLayout = {},\n} ) {\n\tconst {\n\t\ttype: parentLayoutType = 'default',\n\t\tallowSizingOnChildren = false,\n\t} = parentLayout;\n\tconst support = parentLayoutType === 'flex' && allowSizingOnChildren;\n\n\treturn support;\n}\n\n/**\n * Checks if there is a current value in the child layout attributes.\n *\n * @param {Object} props Block props.\n * @return {boolean} Whether or not the block has a child layout value set.\n */\nexport function hasChildLayoutValue( props ) {\n\treturn props.attributes.style?.layout !== undefined;\n}\n\n/**\n * Resets the child layout attribute. This can be used when disabling\n * child layout controls for a block via a progressive discovery panel.\n *\n * @param {Object} props Block props.\n * @param {Object} props.attributes Block attributes.\n * @param {Object} props.setAttributes Function to set block attributes.\n */\nexport function resetChildLayout( { attributes = {}, setAttributes } ) {\n\tconst { style } = attributes;\n\n\tsetAttributes( {\n\t\tstyle: {\n\t\t\t...style,\n\t\t\tlayout: undefined,\n\t\t},\n\t} );\n}\n\n/**\n * Custom hook that checks if child layout settings have been disabled.\n *\n * @param {Object} props Block props.\n *\n * @return {boolean} Whether the child layout setting is disabled.\n */\nexport function useIsChildLayoutDisabled( props ) {\n\tconst isDisabled = ! useSetting( 'layout' );\n\n\treturn ! hasChildLayoutSupport( props ) || isDisabled;\n}\n\nexport function childLayoutOrientation( parentLayout ) {\n\tconst { orientation = 'horizontal' } = parentLayout;\n\n\treturn orientation === 'horizontal' ? __( 'Width' ) : __( 'Height' );\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/hooks/child-layout.js"],"names":["__experimentalToggleGroupControl","ToggleGroupControl","__experimentalToggleGroupControlOption","ToggleGroupControlOption","__experimentalUnitControl","UnitControl","__","useEffect","useSetting","helpText","selfStretch","parentLayout","orientation","ChildLayoutEdit","attributes","setAttributes","__unstableParentLayout","style","layout","childLayout","flexSize","childLayoutOrientation","value","newFlexSize","hasChildLayoutSupport","type","parentLayoutType","default","defaultParentLayoutType","allowSizingOnChildren","support","hasChildLayoutValue","props","undefined","resetChildLayout","useIsChildLayoutDisabled","isDisabled"],"mappings":";;AAAA;AACA;AACA;AACA,SACCA,gCAAgC,IAAIC,kBADrC,EAECC,sCAAsC,IAAIC,wBAF3C,EAGCC,yBAAyB,IAAIC,WAH9B,QAIO,uBAJP;AAKA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,SAAT,QAA0B,oBAA1B;AAEA;AACA;AACA;;AACA,OAAOC,UAAP,MAAuB,2BAAvB;;AAEA,SAASC,QAAT,CAAmBC,WAAnB,EAAgCC,YAAhC,EAA+C;AAC9C,QAAM;AAAEC,IAAAA,WAAW,GAAG;AAAhB,MAAiCD,YAAvC;;AAEA,MAAKD,WAAW,KAAK,MAArB,EAA8B;AAC7B,WAAOJ,EAAE,CAAE,kCAAF,CAAT;AACA;;AACD,MAAKI,WAAW,KAAK,OAArB,EAA+B;AAC9B,QAAKE,WAAW,KAAK,YAArB,EAAoC;AACnC,aAAON,EAAE,CAAE,wBAAF,CAAT;AACA;;AACD,WAAOA,EAAE,CAAE,yBAAF,CAAT;AACA;;AACD,SAAOA,EAAE,CAAE,eAAF,CAAT;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,OAAO,SAASO,eAAT,OAIH;AAAA,MAJ6B;AAChCC,IAAAA,UADgC;AAEhCC,IAAAA,aAFgC;AAGhCC,IAAAA,sBAAsB,EAAEL;AAHQ,GAI7B;AACH,QAAM;AAAEM,IAAAA,KAAK,GAAG;AAAV,MAAiBH,UAAvB;AACA,QAAM;AAAEI,IAAAA,MAAM,EAAEC,WAAW,GAAG;AAAxB,MAA+BF,KAArC;AACA,QAAM;AAAEP,IAAAA,WAAF;AAAeU,IAAAA;AAAf,MAA4BD,WAAlC;AAEAZ,EAAAA,SAAS,CAAE,MAAM;AAChB,QAAKG,WAAW,KAAK,OAAhB,IAA2B,CAAEU,QAAlC,EAA6C;AAC5CL,MAAAA,aAAa,C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AAFF;AADO,GAAF,CAAb;AAMA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASE,wBAAT,CAAmCH,KAAnC,EAA2C;AACjD,QAAMI,UAAU,GAAG,CAAE5B,UAAU,CAAE,QAAF,CAA/B;AAEA,SAAO,CAAEgB,qBAAqB,CAAEQ,KAAF,CAAvB,IAAoCI,UAA3C;AACA;AAED,OAAO,SAASf,sBAAT,CAAiCV,YAAjC,EAAgD;AACtD,QAAM;AAAEC,IAAAA,WAAW,GAAG;AAAhB,MAAiCD,YAAvC;AAEA,SAAOC,WAAW,KAAK,YAAhB,GAA+BN,EAAE,CAAE,OAAF,CAAjC,GAA+CA,EAAE,CAAE,QAAF,CAAxD;AACA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n\t__experimentalUnitControl as UnitControl,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport useSetting from '../components/use-setting';\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' ) {\n\t\tif ( orientation === 'horizontal' ) {\n\t\t\treturn __( 'Specify a fixed width.' );\n\t\t}\n\t\treturn __( 'Specify a fixed height.' );\n\t}\n\treturn __( 'Fit contents.' );\n}\n\n/**\n * Inspector controls containing the child layout related configuration.\n *\n * @param {Object} props Block props.\n * @param {Object} props.attributes Block attributes.\n * @param {Object} props.setAttributes Function to set block attributes.\n * @param {Object} props.__unstableParentLayout\n *\n * @return {WPElement} child layout edit element.\n */\nexport function ChildLayoutEdit( {\n\tattributes,\n\tsetAttributes,\n\t__unstableParentLayout: parentLayout,\n} ) {\n\tconst { style = {} } = attributes;\n\tconst { layout: childLayout = {} } = style;\n\tconst { selfStretch, flexSize } = childLayout;\n\n\tuseEffect( () => {\n\t\tif ( selfStretch === 'fixed' && ! flexSize ) {\n\t\t\tsetAttributes( {\n\t\t\t\tstyle: {\n\t\t\t\t\t...style,\n\t\t\t\t\tlayout: {\n\t\t\t\t\t\t...childLayout,\n\t\t\t\t\t\tselfStretch: 'fit',\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t} );\n\t\t}\n\t}, [] );\n\n\treturn (\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\tsetAttributes( {\n\t\t\t\t\t\tstyle: {\n\t\t\t\t\t\t\t...style,\n\t\t\t\t\t\t\tlayout: {\n\t\t\t\t\t\t\t\t...childLayout,\n\t\t\t\t\t\t\t\tselfStretch: value,\n\t\t\t\t\t\t\t\tflexSize: newFlexSize,\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\tisBlock={ true }\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={ __( 'Fit' ) }\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={ __( 'Fill' ) }\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={ __( 'Fixed' ) }\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\tsetAttributes( {\n\t\t\t\t\t\t\tstyle: {\n\t\t\t\t\t\t\t\t...style,\n\t\t\t\t\t\t\t\tlayout: {\n\t\t\t\t\t\t\t\t\t...childLayout,\n\t\t\t\t\t\t\t\t\tflexSize: value,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t} );\n\t\t\t\t\t} }\n\t\t\t\t\tvalue={ flexSize }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\n/**\n * Determines if there is child layout support.\n *\n * @param {Object} props Block Props object.\n * @param {Object} props.__unstableParentLayout Parent layout.\n *\n * @return {boolean} Whether there is support.\n */\nexport function hasChildLayoutSupport( {\n\t__unstableParentLayout: parentLayout = {},\n} ) {\n\tconst {\n\t\ttype: parentLayoutType = 'default',\n\t\tdefault: { type: defaultParentLayoutType = 'default' } = {},\n\t\tallowSizingOnChildren = false,\n\t} = parentLayout;\n\n\tconst support =\n\t\t( defaultParentLayoutType === 'flex' || parentLayoutType === 'flex' ) &&\n\t\tallowSizingOnChildren;\n\n\treturn support;\n}\n\n/**\n * Checks if there is a current value in the child layout attributes.\n *\n * @param {Object} props Block props.\n * @return {boolean} Whether or not the block has a child layout value set.\n */\nexport function hasChildLayoutValue( props ) {\n\treturn props.attributes.style?.layout !== undefined;\n}\n\n/**\n * Resets the child layout attribute. This can be used when disabling\n * child layout controls for a block via a progressive discovery panel.\n *\n * @param {Object} props Block props.\n * @param {Object} props.attributes Block attributes.\n * @param {Object} props.setAttributes Function to set block attributes.\n */\nexport function resetChildLayout( { attributes = {}, setAttributes } ) {\n\tconst { style } = attributes;\n\n\tsetAttributes( {\n\t\tstyle: {\n\t\t\t...style,\n\t\t\tlayout: undefined,\n\t\t},\n\t} );\n}\n\n/**\n * Custom hook that checks if child layout settings have been disabled.\n *\n * @param {Object} props Block props.\n *\n * @return {boolean} Whether the child layout setting is disabled.\n */\nexport function useIsChildLayoutDisabled( props ) {\n\tconst isDisabled = ! useSetting( 'layout' );\n\n\treturn ! hasChildLayoutSupport( props ) || isDisabled;\n}\n\nexport function childLayoutOrientation( parentLayout ) {\n\tconst { orientation = 'horizontal' } = parentLayout;\n\n\treturn orientation === 'horizontal' ? __( 'Width' ) : __( 'Height' );\n}\n"]}
@@ -77,7 +77,7 @@ export default function ColorPanel(_ref) {
77
77
  });
78
78
  const colorGradientSettings = useMultipleOriginColorsAndGradients();
79
79
  return createElement(InspectorControls, {
80
- __experimentalGroup: "color"
80
+ group: "color"
81
81
  }, createElement(ColorGradientSettingsDropdown, _extends({
82
82
  enableAlpha: enableAlpha,
83
83
  panelId: clientId,