@wordpress/block-editor 14.6.0 → 14.7.1-next.082ed6819.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (332) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/components/block-controls/slot.js +6 -3
  3. package/build/components/block-controls/slot.js.map +1 -1
  4. package/build/components/block-inspector/index.js +1 -2
  5. package/build/components/block-inspector/index.js.map +1 -1
  6. package/build/components/block-list/block.js +14 -28
  7. package/build/components/block-list/block.js.map +1 -1
  8. package/build/components/block-lock/modal.js +1 -1
  9. package/build/components/block-lock/modal.js.map +1 -1
  10. package/build/components/block-manager/category.js +79 -0
  11. package/build/components/block-manager/category.js.map +1 -0
  12. package/build/components/block-manager/checklist.js +40 -0
  13. package/build/components/block-manager/checklist.js.map +1 -0
  14. package/build/components/block-manager/index.js +108 -0
  15. package/build/components/block-manager/index.js.map +1 -0
  16. package/build/components/block-patterns-list/index.js +23 -26
  17. package/build/components/block-patterns-list/index.js.map +1 -1
  18. package/build/components/block-popover/index.js +1 -1
  19. package/build/components/block-popover/index.js.map +1 -1
  20. package/build/components/block-preview/async.js +51 -0
  21. package/build/components/block-preview/async.js.map +1 -0
  22. package/build/components/block-preview/index.js +4 -1
  23. package/build/components/block-preview/index.js.map +1 -1
  24. package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  25. package/build/components/block-settings-menu/index.js.map +1 -1
  26. package/build/components/block-toolbar/change-design.js +1 -4
  27. package/build/components/block-toolbar/change-design.js.map +1 -1
  28. package/build/components/block-toolbar/index.js +7 -2
  29. package/build/components/block-toolbar/index.js.map +1 -1
  30. package/build/components/block-toolbar/switch-section-style.js +105 -0
  31. package/build/components/block-toolbar/switch-section-style.js.map +1 -0
  32. package/build/components/block-tools/index.js +12 -9
  33. package/build/components/block-tools/index.js.map +1 -1
  34. package/build/components/block-tools/use-block-toolbar-popover-props.js +1 -1
  35. package/build/components/block-tools/use-block-toolbar-popover-props.js.map +1 -1
  36. package/build/components/block-tools/use-show-block-tools.js +4 -1
  37. package/build/components/block-tools/use-show-block-tools.js.map +1 -1
  38. package/build/components/collab/block-comment-icon-slot.js +2 -6
  39. package/build/components/collab/block-comment-icon-slot.js.map +1 -1
  40. package/build/components/collab/block-comment-icon-toolbar-slot.js +2 -6
  41. package/build/components/collab/block-comment-icon-toolbar-slot.js.map +1 -1
  42. package/build/components/color-palette/with-color-context.js +4 -2
  43. package/build/components/color-palette/with-color-context.js.map +1 -1
  44. package/build/components/font-family/index.js +14 -13
  45. package/build/components/font-family/index.js.map +1 -1
  46. package/build/components/global-styles/dimensions-panel.js +26 -14
  47. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  48. package/build/components/global-styles/use-global-styles-output.js +1 -1
  49. package/build/components/global-styles/use-global-styles-output.js.map +1 -1
  50. package/build/components/iframe/get-compatibility-styles.js +4 -4
  51. package/build/components/iframe/get-compatibility-styles.js.map +1 -1
  52. package/build/components/iframe/index.js +156 -23
  53. package/build/components/iframe/index.js.map +1 -1
  54. package/build/components/inserter/block-patterns-explorer/pattern-list.js +2 -2
  55. package/build/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
  56. package/build/components/inserter/block-patterns-tab/index.js +1 -2
  57. package/build/components/inserter/block-patterns-tab/index.js.map +1 -1
  58. package/build/components/inserter/block-patterns-tab/pattern-category-previews.js +4 -6
  59. package/build/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
  60. package/build/components/inserter/block-patterns-tab/use-pattern-categories.js +3 -0
  61. package/build/components/inserter/block-patterns-tab/use-pattern-categories.js.map +1 -1
  62. package/build/components/inserter/block-patterns-tab/utils.js +5 -1
  63. package/build/components/inserter/block-patterns-tab/utils.js.map +1 -1
  64. package/build/components/inserter/category-tabs/index.js +7 -8
  65. package/build/components/inserter/category-tabs/index.js.map +1 -1
  66. package/build/components/inserter/hooks/use-block-types-state.js +1 -1
  67. package/build/components/inserter/hooks/use-block-types-state.js.map +1 -1
  68. package/build/components/inserter/hooks/use-patterns-paging.js +0 -5
  69. package/build/components/inserter/hooks/use-patterns-paging.js.map +1 -1
  70. package/build/components/inserter/search-results.js +0 -2
  71. package/build/components/inserter/search-results.js.map +1 -1
  72. package/build/components/inserter-draggable-blocks/index.js +2 -1
  73. package/build/components/inserter-draggable-blocks/index.js.map +1 -1
  74. package/build/components/inspector-controls/slot.js +7 -4
  75. package/build/components/inspector-controls/slot.js.map +1 -1
  76. package/build/components/inspector-controls-tabs/position-controls-panel.js +1 -1
  77. package/build/components/inspector-controls-tabs/position-controls-panel.js.map +1 -1
  78. package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js +4 -4
  79. package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +1 -1
  80. package/build/components/media-placeholder/index.js +33 -25
  81. package/build/components/media-placeholder/index.js.map +1 -1
  82. package/build/components/rich-text/index.js +1 -1
  83. package/build/components/rich-text/index.js.map +1 -1
  84. package/build/components/tabbed-sidebar/index.js +1 -1
  85. package/build/components/tabbed-sidebar/index.js.map +1 -1
  86. package/build/components/url-input/index.js +3 -1
  87. package/build/components/url-input/index.js.map +1 -1
  88. package/build/components/use-block-commands/index.js +5 -6
  89. package/build/components/use-block-commands/index.js.map +1 -1
  90. package/build/hooks/border.js +3 -3
  91. package/build/hooks/border.js.map +1 -1
  92. package/build/hooks/color.js +1 -1
  93. package/build/hooks/color.js.map +1 -1
  94. package/build/hooks/dimensions.js +2 -2
  95. package/build/hooks/dimensions.js.map +1 -1
  96. package/build/hooks/font-family.js +1 -1
  97. package/build/hooks/font-family.js.map +1 -1
  98. package/build/hooks/style.js +6 -6
  99. package/build/hooks/style.js.map +1 -1
  100. package/build/hooks/supports.js +7 -7
  101. package/build/hooks/supports.js.map +1 -1
  102. package/build/hooks/typography.js +6 -6
  103. package/build/hooks/typography.js.map +1 -1
  104. package/build/hooks/utils.js +3 -3
  105. package/build/hooks/utils.js.map +1 -1
  106. package/build/layouts/flex.js +11 -9
  107. package/build/layouts/flex.js.map +1 -1
  108. package/build/lock-unlock.js.map +1 -1
  109. package/build/private-apis.js +4 -4
  110. package/build/private-apis.js.map +1 -1
  111. package/build/store/private-selectors.js +3 -3
  112. package/build/store/private-selectors.js.map +1 -1
  113. package/build/store/selectors.js +12 -8
  114. package/build/store/selectors.js.map +1 -1
  115. package/build/store/utils.js +5 -4
  116. package/build/store/utils.js.map +1 -1
  117. package/build/utils/dom.js +27 -22
  118. package/build/utils/dom.js.map +1 -1
  119. package/build-module/components/block-controls/slot.js +6 -3
  120. package/build-module/components/block-controls/slot.js.map +1 -1
  121. package/build-module/components/block-inspector/index.js +1 -2
  122. package/build-module/components/block-inspector/index.js.map +1 -1
  123. package/build-module/components/block-list/block.js +15 -27
  124. package/build-module/components/block-list/block.js.map +1 -1
  125. package/build-module/components/block-lock/modal.js +1 -1
  126. package/build-module/components/block-lock/modal.js.map +1 -1
  127. package/build-module/components/block-manager/category.js +71 -0
  128. package/build-module/components/block-manager/category.js.map +1 -0
  129. package/build-module/components/block-manager/checklist.js +32 -0
  130. package/build-module/components/block-manager/checklist.js.map +1 -0
  131. package/build-module/components/block-manager/index.js +102 -0
  132. package/build-module/components/block-manager/index.js.map +1 -0
  133. package/build-module/components/block-patterns-list/index.js +23 -26
  134. package/build-module/components/block-patterns-list/index.js.map +1 -1
  135. package/build-module/components/block-popover/index.js +2 -2
  136. package/build-module/components/block-popover/index.js.map +1 -1
  137. package/build-module/components/block-preview/async.js +44 -0
  138. package/build-module/components/block-preview/async.js.map +1 -0
  139. package/build-module/components/block-preview/index.js +4 -1
  140. package/build-module/components/block-preview/index.js.map +1 -1
  141. package/build-module/components/block-settings-menu/block-settings-dropdown.js +2 -2
  142. package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  143. package/build-module/components/block-settings-menu/index.js +2 -2
  144. package/build-module/components/block-settings-menu/index.js.map +1 -1
  145. package/build-module/components/block-toolbar/change-design.js +1 -4
  146. package/build-module/components/block-toolbar/change-design.js.map +1 -1
  147. package/build-module/components/block-toolbar/index.js +7 -2
  148. package/build-module/components/block-toolbar/index.js.map +1 -1
  149. package/build-module/components/block-toolbar/switch-section-style.js +97 -0
  150. package/build-module/components/block-toolbar/switch-section-style.js.map +1 -0
  151. package/build-module/components/block-tools/index.js +13 -10
  152. package/build-module/components/block-tools/index.js.map +1 -1
  153. package/build-module/components/block-tools/use-block-toolbar-popover-props.js +2 -2
  154. package/build-module/components/block-tools/use-block-toolbar-popover-props.js.map +1 -1
  155. package/build-module/components/block-tools/use-show-block-tools.js +4 -1
  156. package/build-module/components/block-tools/use-show-block-tools.js.map +1 -1
  157. package/build-module/components/collab/block-comment-icon-slot.js +2 -6
  158. package/build-module/components/collab/block-comment-icon-slot.js.map +1 -1
  159. package/build-module/components/collab/block-comment-icon-toolbar-slot.js +2 -6
  160. package/build-module/components/collab/block-comment-icon-toolbar-slot.js.map +1 -1
  161. package/build-module/components/color-palette/with-color-context.js +4 -2
  162. package/build-module/components/color-palette/with-color-context.js.map +1 -1
  163. package/build-module/components/font-family/index.js +15 -14
  164. package/build-module/components/font-family/index.js.map +1 -1
  165. package/build-module/components/global-styles/dimensions-panel.js +26 -14
  166. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  167. package/build-module/components/global-styles/use-global-styles-output.js +1 -1
  168. package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
  169. package/build-module/components/iframe/get-compatibility-styles.js +4 -4
  170. package/build-module/components/iframe/get-compatibility-styles.js.map +1 -1
  171. package/build-module/components/iframe/index.js +157 -24
  172. package/build-module/components/iframe/index.js.map +1 -1
  173. package/build-module/components/inserter/block-patterns-explorer/pattern-list.js +2 -2
  174. package/build-module/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
  175. package/build-module/components/inserter/block-patterns-tab/index.js +1 -2
  176. package/build-module/components/inserter/block-patterns-tab/index.js.map +1 -1
  177. package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js +5 -7
  178. package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
  179. package/build-module/components/inserter/block-patterns-tab/use-pattern-categories.js +4 -1
  180. package/build-module/components/inserter/block-patterns-tab/use-pattern-categories.js.map +1 -1
  181. package/build-module/components/inserter/block-patterns-tab/utils.js +4 -0
  182. package/build-module/components/inserter/block-patterns-tab/utils.js.map +1 -1
  183. package/build-module/components/inserter/category-tabs/index.js +8 -9
  184. package/build-module/components/inserter/category-tabs/index.js.map +1 -1
  185. package/build-module/components/inserter/hooks/use-block-types-state.js +1 -1
  186. package/build-module/components/inserter/hooks/use-block-types-state.js.map +1 -1
  187. package/build-module/components/inserter/hooks/use-patterns-paging.js +1 -6
  188. package/build-module/components/inserter/hooks/use-patterns-paging.js.map +1 -1
  189. package/build-module/components/inserter/search-results.js +0 -2
  190. package/build-module/components/inserter/search-results.js.map +1 -1
  191. package/build-module/components/inserter-draggable-blocks/index.js +2 -1
  192. package/build-module/components/inserter-draggable-blocks/index.js.map +1 -1
  193. package/build-module/components/inspector-controls/slot.js +7 -4
  194. package/build-module/components/inspector-controls/slot.js.map +1 -1
  195. package/build-module/components/inspector-controls-tabs/position-controls-panel.js +1 -1
  196. package/build-module/components/inspector-controls-tabs/position-controls-panel.js.map +1 -1
  197. package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js +4 -4
  198. package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +1 -1
  199. package/build-module/components/media-placeholder/index.js +33 -25
  200. package/build-module/components/media-placeholder/index.js.map +1 -1
  201. package/build-module/components/rich-text/index.js +1 -1
  202. package/build-module/components/rich-text/index.js.map +1 -1
  203. package/build-module/components/tabbed-sidebar/index.js +1 -1
  204. package/build-module/components/tabbed-sidebar/index.js.map +1 -1
  205. package/build-module/components/url-input/index.js +3 -1
  206. package/build-module/components/url-input/index.js.map +1 -1
  207. package/build-module/components/use-block-commands/index.js +4 -4
  208. package/build-module/components/use-block-commands/index.js.map +1 -1
  209. package/build-module/hooks/border.js +3 -3
  210. package/build-module/hooks/border.js.map +1 -1
  211. package/build-module/hooks/color.js +1 -1
  212. package/build-module/hooks/color.js.map +1 -1
  213. package/build-module/hooks/dimensions.js +2 -2
  214. package/build-module/hooks/dimensions.js.map +1 -1
  215. package/build-module/hooks/font-family.js +1 -1
  216. package/build-module/hooks/font-family.js.map +1 -1
  217. package/build-module/hooks/style.js +6 -6
  218. package/build-module/hooks/style.js.map +1 -1
  219. package/build-module/hooks/supports.js +7 -7
  220. package/build-module/hooks/supports.js.map +1 -1
  221. package/build-module/hooks/typography.js +6 -6
  222. package/build-module/hooks/typography.js.map +1 -1
  223. package/build-module/hooks/utils.js +3 -3
  224. package/build-module/hooks/utils.js.map +1 -1
  225. package/build-module/layouts/flex.js +11 -9
  226. package/build-module/layouts/flex.js.map +1 -1
  227. package/build-module/lock-unlock.js.map +1 -1
  228. package/build-module/private-apis.js +6 -6
  229. package/build-module/private-apis.js.map +1 -1
  230. package/build-module/store/private-selectors.js +3 -3
  231. package/build-module/store/private-selectors.js.map +1 -1
  232. package/build-module/store/selectors.js +12 -8
  233. package/build-module/store/selectors.js.map +1 -1
  234. package/build-module/store/utils.js +3 -3
  235. package/build-module/store/utils.js.map +1 -1
  236. package/build-module/utils/dom.js +25 -21
  237. package/build-module/utils/dom.js.map +1 -1
  238. package/build-style/content-rtl.css +30 -15
  239. package/build-style/content.css +30 -15
  240. package/build-style/style-rtl.css +92 -3
  241. package/build-style/style.css +92 -3
  242. package/build-types/utils/dom.d.ts +7 -9
  243. package/build-types/utils/dom.d.ts.map +1 -1
  244. package/package.json +32 -31
  245. package/src/components/block-canvas/style.scss +1 -1
  246. package/src/components/block-controls/slot.js +5 -3
  247. package/src/components/block-inspector/index.js +0 -2
  248. package/src/components/block-inspector/style.scss +2 -1
  249. package/src/components/block-list/block.js +28 -48
  250. package/src/components/block-lock/modal.js +1 -1
  251. package/src/components/block-manager/category.js +102 -0
  252. package/src/components/block-manager/checklist.js +34 -0
  253. package/src/components/block-manager/index.js +127 -0
  254. package/src/components/block-manager/style.scss +82 -0
  255. package/src/components/block-mover/README.md +15 -8
  256. package/src/components/block-mover/stories/index.story.js +73 -71
  257. package/src/components/block-mover/style.scss +3 -0
  258. package/src/components/block-patterns-list/README.md +8 -8
  259. package/src/components/block-patterns-list/index.js +35 -51
  260. package/src/components/block-patterns-list/stories/index.story.js +2 -19
  261. package/src/components/block-popover/index.js +4 -4
  262. package/src/components/block-preview/async.js +43 -0
  263. package/src/components/block-preview/index.js +6 -1
  264. package/src/components/block-settings-menu/block-settings-dropdown.js +2 -2
  265. package/src/components/block-settings-menu/index.js +2 -2
  266. package/src/components/block-toolbar/change-design.js +1 -7
  267. package/src/components/block-toolbar/index.js +6 -0
  268. package/src/components/block-toolbar/switch-section-style.js +115 -0
  269. package/src/components/block-tools/index.js +26 -10
  270. package/src/components/block-tools/style.scss +12 -0
  271. package/src/components/block-tools/use-block-toolbar-popover-props.js +2 -2
  272. package/src/components/block-tools/use-show-block-tools.js +3 -1
  273. package/src/components/collab/block-comment-icon-slot.js +2 -6
  274. package/src/components/collab/block-comment-icon-toolbar-slot.js +3 -5
  275. package/src/components/color-palette/with-color-context.js +25 -7
  276. package/src/components/default-block-appender/content.scss +13 -19
  277. package/src/components/font-family/index.js +13 -13
  278. package/src/components/global-styles/dimensions-panel.js +22 -16
  279. package/src/components/global-styles/test/use-global-styles-output.js +1 -1
  280. package/src/components/global-styles/use-global-styles-output.js +1 -1
  281. package/src/components/iframe/content.scss +16 -3
  282. package/src/components/iframe/get-compatibility-styles.js +4 -9
  283. package/src/components/iframe/index.js +204 -44
  284. package/src/components/inserter/block-patterns-explorer/pattern-list.js +3 -6
  285. package/src/components/inserter/block-patterns-tab/index.js +0 -1
  286. package/src/components/inserter/block-patterns-tab/pattern-category-previews.js +15 -17
  287. package/src/components/inserter/block-patterns-tab/use-pattern-categories.js +8 -0
  288. package/src/components/inserter/block-patterns-tab/utils.js +5 -0
  289. package/src/components/inserter/category-tabs/index.js +8 -9
  290. package/src/components/inserter/hooks/use-block-types-state.js +6 -1
  291. package/src/components/inserter/hooks/use-patterns-paging.js +1 -6
  292. package/src/components/inserter/search-results.js +0 -6
  293. package/src/components/inserter-draggable-blocks/index.js +10 -1
  294. package/src/components/inspector-controls/README.md +2 -0
  295. package/src/components/inspector-controls/slot.js +6 -4
  296. package/src/components/inspector-controls-tabs/position-controls-panel.js +1 -3
  297. package/src/components/inspector-controls-tabs/use-inspector-controls-tabs.js +10 -10
  298. package/src/components/media-placeholder/index.js +41 -37
  299. package/src/components/provider/test/use-block-sync.js +3 -1
  300. package/src/components/rich-text/content.scss +15 -10
  301. package/src/components/rich-text/index.js +8 -1
  302. package/src/components/tabbed-sidebar/index.js +1 -1
  303. package/src/components/tabbed-sidebar/style.scss +1 -1
  304. package/src/components/url-input/index.js +3 -4
  305. package/src/components/use-block-commands/index.js +245 -234
  306. package/src/hooks/border.js +3 -9
  307. package/src/hooks/color.js +1 -1
  308. package/src/hooks/dimensions.js +2 -2
  309. package/src/hooks/font-family.js +1 -1
  310. package/src/hooks/style.js +6 -12
  311. package/src/hooks/supports.js +7 -7
  312. package/src/hooks/test/style.js +1 -2
  313. package/src/hooks/typography.js +6 -6
  314. package/src/hooks/utils.js +8 -3
  315. package/src/layouts/flex.js +26 -18
  316. package/src/private-apis.js +6 -6
  317. package/src/store/private-selectors.js +6 -7
  318. package/src/store/selectors.js +60 -45
  319. package/src/store/test/private-selectors.js +5 -0
  320. package/src/store/test/selectors.js +87 -58
  321. package/src/store/utils.js +12 -11
  322. package/src/style.scss +1 -0
  323. package/src/utils/dom.js +26 -21
  324. package/src/utils/test/dom.js +224 -0
  325. package/tsconfig.json +1 -0
  326. package/tsconfig.tsbuildinfo +1 -1
  327. package/build/components/block-info-slot-fill/index.js +0 -39
  328. package/build/components/block-info-slot-fill/index.js.map +0 -1
  329. package/build-module/components/block-info-slot-fill/index.js +0 -32
  330. package/build-module/components/block-info-slot-fill/index.js.map +0 -1
  331. package/src/components/block-info-slot-fill/index.js +0 -27
  332. /package/src/{lock-unlock.js → lock-unlock.ts} +0 -0
@@ -1 +1 @@
1
- {"version":3,"names":["clsx","__","sprintf","_n","Component","createRef","UP","DOWN","ENTER","TAB","BaseControl","Button","__experimentalInputControl","InputControl","Spinner","withSpokenMessages","Popover","compose","debounce","withInstanceId","withSafeTimeout","withSelect","isURL","store","blockEditorStore","Fragment","_Fragment","jsxs","_jsxs","jsx","_jsx","createElement","_createElement","isFunction","maybeFunc","URLInput","constructor","props","onChange","bind","onFocus","onKeyDown","selectLink","handleOnClick","bindSuggestionNode","autocompleteRef","inputRef","updateSuggestions","suggestionNodes","suggestionsRequest","state","suggestions","showSuggestions","suggestionsValue","selectedSuggestion","suggestionsListboxId","suggestionOptionIdPrefix","componentDidUpdate","prevProps","value","__experimentalShowInitialSuggestions","scrollIntoView","behavior","block","inline","disableSuggestions","length","componentDidMount","shouldShowInitialSuggestions","componentWillUnmount","cancel","index","ref","__experimentalFetchLinkSuggestions","fetchLinkSuggestions","__experimentalHandleURLSuggestions","handleURLSuggestions","isInitialSuggestions","trim","setState","loading","request","then","debouncedSpeak","catch","finally","newValue","event","keyCode","target","selectionStart","preventDefault","setSelectionRange","onSubmit","suggestion","previousIndex","nextIndex","speak","url","current","focus","getDerivedStateFromProps","instanceId","shouldShowSuggestions","hasValue","render","children","renderControl","renderSuggestions","label","className","isFullWidth","placeholder","__experimentalRenderControl","hideLabelFromVision","inputId","controlProps","id","inputProps","required","type","role","undefined","suffix","__nextHasNoMarginBottom","__next40pxDefaultSize","__experimentalRenderSuggestions","suggestionsListProps","buildSuggestionItemProps","tabIndex","isLoading","handleSuggestionClick","currentInputValue","placement","focusOnMount","map","key","onClick","title","select","getSettings"],"sources":["@wordpress/block-editor/src/components/url-input/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __, sprintf, _n } from '@wordpress/i18n';\nimport { Component, createRef } from '@wordpress/element';\nimport { UP, DOWN, ENTER, TAB } from '@wordpress/keycodes';\nimport {\n\tBaseControl,\n\tButton,\n\t__experimentalInputControl as InputControl,\n\tSpinner,\n\twithSpokenMessages,\n\tPopover,\n} from '@wordpress/components';\nimport {\n\tcompose,\n\tdebounce,\n\twithInstanceId,\n\twithSafeTimeout,\n} from '@wordpress/compose';\nimport { withSelect } from '@wordpress/data';\nimport { isURL } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\n\n/**\n * Whether the argument is a function.\n *\n * @param {*} maybeFunc The argument to check.\n * @return {boolean} True if the argument is a function, false otherwise.\n */\nfunction isFunction( maybeFunc ) {\n\treturn typeof maybeFunc === 'function';\n}\n\nclass URLInput extends Component {\n\tconstructor( props ) {\n\t\tsuper( props );\n\n\t\tthis.onChange = this.onChange.bind( this );\n\t\tthis.onFocus = this.onFocus.bind( this );\n\t\tthis.onKeyDown = this.onKeyDown.bind( this );\n\t\tthis.selectLink = this.selectLink.bind( this );\n\t\tthis.handleOnClick = this.handleOnClick.bind( this );\n\t\tthis.bindSuggestionNode = this.bindSuggestionNode.bind( this );\n\t\tthis.autocompleteRef = props.autocompleteRef || createRef();\n\t\tthis.inputRef = createRef();\n\t\tthis.updateSuggestions = debounce(\n\t\t\tthis.updateSuggestions.bind( this ),\n\t\t\t200\n\t\t);\n\n\t\tthis.suggestionNodes = [];\n\n\t\tthis.suggestionsRequest = null;\n\n\t\tthis.state = {\n\t\t\tsuggestions: [],\n\t\t\tshowSuggestions: false,\n\t\t\tsuggestionsValue: null,\n\t\t\tselectedSuggestion: null,\n\t\t\tsuggestionsListboxId: '',\n\t\t\tsuggestionOptionIdPrefix: '',\n\t\t};\n\t}\n\n\tcomponentDidUpdate( prevProps ) {\n\t\tconst { showSuggestions, selectedSuggestion } = this.state;\n\t\tconst { value, __experimentalShowInitialSuggestions = false } =\n\t\t\tthis.props;\n\n\t\t// Only have to worry about scrolling selected suggestion into view\n\t\t// when already expanded.\n\t\tif (\n\t\t\tshowSuggestions &&\n\t\t\tselectedSuggestion !== null &&\n\t\t\tthis.suggestionNodes[ selectedSuggestion ]\n\t\t) {\n\t\t\tthis.suggestionNodes[ selectedSuggestion ].scrollIntoView( {\n\t\t\t\tbehavior: 'instant',\n\t\t\t\tblock: 'nearest',\n\t\t\t\tinline: 'nearest',\n\t\t\t} );\n\t\t}\n\n\t\t// Update suggestions when the value changes.\n\t\tif ( prevProps.value !== value && ! this.props.disableSuggestions ) {\n\t\t\tif ( value?.length ) {\n\t\t\t\t// If the new value is not empty we need to update with suggestions for it.\n\t\t\t\tthis.updateSuggestions( value );\n\t\t\t} else if ( __experimentalShowInitialSuggestions ) {\n\t\t\t\t// If the new value is empty and we can show initial suggestions, then show initial suggestions.\n\t\t\t\tthis.updateSuggestions();\n\t\t\t}\n\t\t}\n\t}\n\n\tcomponentDidMount() {\n\t\tif ( this.shouldShowInitialSuggestions() ) {\n\t\t\tthis.updateSuggestions();\n\t\t}\n\t}\n\n\tcomponentWillUnmount() {\n\t\tthis.suggestionsRequest?.cancel?.();\n\t\tthis.suggestionsRequest = null;\n\t}\n\n\tbindSuggestionNode( index ) {\n\t\treturn ( ref ) => {\n\t\t\tthis.suggestionNodes[ index ] = ref;\n\t\t};\n\t}\n\n\tshouldShowInitialSuggestions() {\n\t\tconst { __experimentalShowInitialSuggestions = false, value } =\n\t\t\tthis.props;\n\t\treturn (\n\t\t\t__experimentalShowInitialSuggestions && ! ( value && value.length )\n\t\t);\n\t}\n\n\tupdateSuggestions( value = '' ) {\n\t\tconst {\n\t\t\t__experimentalFetchLinkSuggestions: fetchLinkSuggestions,\n\t\t\t__experimentalHandleURLSuggestions: handleURLSuggestions,\n\t\t} = this.props;\n\n\t\tif ( ! fetchLinkSuggestions ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Initial suggestions may only show if there is no value\n\t\t// (note: this includes whitespace).\n\t\tconst isInitialSuggestions = ! value?.length;\n\n\t\t// Trim only now we've determined whether or not it originally had a \"length\"\n\t\t// (even if that value was all whitespace).\n\t\tvalue = value.trim();\n\n\t\t// Allow a suggestions request if:\n\t\t// - there are at least 2 characters in the search input (except manual searches where\n\t\t// search input length is not required to trigger a fetch)\n\t\t// - this is a direct entry (eg: a URL)\n\t\tif (\n\t\t\t! isInitialSuggestions &&\n\t\t\t( value.length < 2 || ( ! handleURLSuggestions && isURL( value ) ) )\n\t\t) {\n\t\t\tthis.suggestionsRequest?.cancel?.();\n\t\t\tthis.suggestionsRequest = null;\n\n\t\t\tthis.setState( {\n\t\t\t\tsuggestions: [],\n\t\t\t\tshowSuggestions: false,\n\t\t\t\tsuggestionsValue: value,\n\t\t\t\tselectedSuggestion: null,\n\t\t\t\tloading: false,\n\t\t\t} );\n\n\t\t\treturn;\n\t\t}\n\n\t\tthis.setState( {\n\t\t\tselectedSuggestion: null,\n\t\t\tloading: true,\n\t\t} );\n\n\t\tconst request = fetchLinkSuggestions( value, {\n\t\t\tisInitialSuggestions,\n\t\t} );\n\n\t\trequest\n\t\t\t.then( ( suggestions ) => {\n\t\t\t\t// A fetch Promise doesn't have an abort option. It's mimicked by\n\t\t\t\t// comparing the request reference in on the instance, which is\n\t\t\t\t// reset or deleted on subsequent requests or unmounting.\n\t\t\t\tif ( this.suggestionsRequest !== request ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tthis.setState( {\n\t\t\t\t\tsuggestions,\n\t\t\t\t\tsuggestionsValue: value,\n\t\t\t\t\tloading: false,\n\t\t\t\t\tshowSuggestions: !! suggestions.length,\n\t\t\t\t} );\n\n\t\t\t\tif ( !! suggestions.length ) {\n\t\t\t\t\tthis.props.debouncedSpeak(\n\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t/* translators: %d: number of results. */\n\t\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t\t'%d result found, use up and down arrow keys to navigate.',\n\t\t\t\t\t\t\t\t'%d results found, use up and down arrow keys to navigate.',\n\t\t\t\t\t\t\t\tsuggestions.length\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tsuggestions.length\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'assertive'\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\tthis.props.debouncedSpeak(\n\t\t\t\t\t\t__( 'No results.' ),\n\t\t\t\t\t\t'assertive'\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} )\n\t\t\t.catch( () => {\n\t\t\t\tif ( this.suggestionsRequest !== request ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tthis.setState( {\n\t\t\t\t\tloading: false,\n\t\t\t\t} );\n\t\t\t} )\n\t\t\t.finally( () => {\n\t\t\t\t// If this is the current promise then reset the reference\n\t\t\t\t// to allow for checking if a new request is made.\n\t\t\t\tif ( this.suggestionsRequest === request ) {\n\t\t\t\t\tthis.suggestionsRequest = null;\n\t\t\t\t}\n\t\t\t} );\n\n\t\t// Note that this assignment is handled *before* the async search request\n\t\t// as a Promise always resolves on the next tick of the event loop.\n\t\tthis.suggestionsRequest = request;\n\t}\n\n\tonChange( newValue ) {\n\t\tthis.props.onChange( newValue );\n\t}\n\n\tonFocus() {\n\t\tconst { suggestions } = this.state;\n\t\tconst { disableSuggestions, value } = this.props;\n\n\t\t// When opening the link editor, if there's a value present, we want to load the suggestions pane with the results for this input search value\n\t\t// Don't re-run the suggestions on focus if there are already suggestions present (prevents searching again when tabbing between the input and buttons)\n\t\t// or there is already a request in progress.\n\t\tif (\n\t\t\tvalue &&\n\t\t\t! disableSuggestions &&\n\t\t\t! ( suggestions && suggestions.length ) &&\n\t\t\tthis.suggestionsRequest === null\n\t\t) {\n\t\t\t// Ensure the suggestions are updated with the current input value.\n\t\t\tthis.updateSuggestions( value );\n\t\t}\n\t}\n\n\tonKeyDown( event ) {\n\t\tthis.props.onKeyDown?.( event );\n\t\tconst { showSuggestions, selectedSuggestion, suggestions, loading } =\n\t\t\tthis.state;\n\n\t\t// If the suggestions are not shown or loading, we shouldn't handle the arrow keys\n\t\t// We shouldn't preventDefault to allow block arrow keys navigation.\n\t\tif ( ! showSuggestions || ! suggestions.length || loading ) {\n\t\t\t// In the Windows version of Firefox the up and down arrows don't move the caret\n\t\t\t// within an input field like they do for Mac Firefox/Chrome/Safari. This causes\n\t\t\t// a form of focus trapping that is disruptive to the user experience. This disruption\n\t\t\t// only happens if the caret is not in the first or last position in the text input.\n\t\t\t// See: https://github.com/WordPress/gutenberg/issues/5693#issuecomment-436684747\n\t\t\tswitch ( event.keyCode ) {\n\t\t\t\t// When UP is pressed, if the caret is at the start of the text, move it to the 0\n\t\t\t\t// position.\n\t\t\t\tcase UP: {\n\t\t\t\t\tif ( 0 !== event.target.selectionStart ) {\n\t\t\t\t\t\tevent.preventDefault();\n\n\t\t\t\t\t\t// Set the input caret to position 0.\n\t\t\t\t\t\tevent.target.setSelectionRange( 0, 0 );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t// When DOWN is pressed, if the caret is not at the end of the text, move it to the\n\t\t\t\t// last position.\n\t\t\t\tcase DOWN: {\n\t\t\t\t\tif (\n\t\t\t\t\t\tthis.props.value.length !== event.target.selectionStart\n\t\t\t\t\t) {\n\t\t\t\t\t\tevent.preventDefault();\n\n\t\t\t\t\t\t// Set the input caret to the last position.\n\t\t\t\t\t\tevent.target.setSelectionRange(\n\t\t\t\t\t\t\tthis.props.value.length,\n\t\t\t\t\t\t\tthis.props.value.length\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t// Submitting while loading should trigger onSubmit.\n\t\t\t\tcase ENTER: {\n\t\t\t\t\tif ( this.props.onSubmit ) {\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\tthis.props.onSubmit( null, event );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\tconst suggestion =\n\t\t\tthis.state.suggestions[ this.state.selectedSuggestion ];\n\n\t\tswitch ( event.keyCode ) {\n\t\t\tcase UP: {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tconst previousIndex = ! selectedSuggestion\n\t\t\t\t\t? suggestions.length - 1\n\t\t\t\t\t: selectedSuggestion - 1;\n\t\t\t\tthis.setState( {\n\t\t\t\t\tselectedSuggestion: previousIndex,\n\t\t\t\t} );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase DOWN: {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tconst nextIndex =\n\t\t\t\t\tselectedSuggestion === null ||\n\t\t\t\t\tselectedSuggestion === suggestions.length - 1\n\t\t\t\t\t\t? 0\n\t\t\t\t\t\t: selectedSuggestion + 1;\n\t\t\t\tthis.setState( {\n\t\t\t\t\tselectedSuggestion: nextIndex,\n\t\t\t\t} );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase TAB: {\n\t\t\t\tif ( this.state.selectedSuggestion !== null ) {\n\t\t\t\t\tthis.selectLink( suggestion );\n\t\t\t\t\t// Announce a link has been selected when tabbing away from the input field.\n\t\t\t\t\tthis.props.speak( __( 'Link selected.' ) );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase ENTER: {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tif ( this.state.selectedSuggestion !== null ) {\n\t\t\t\t\tthis.selectLink( suggestion );\n\n\t\t\t\t\tif ( this.props.onSubmit ) {\n\t\t\t\t\t\tthis.props.onSubmit( suggestion, event );\n\t\t\t\t\t}\n\t\t\t\t} else if ( this.props.onSubmit ) {\n\t\t\t\t\tthis.props.onSubmit( null, event );\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tselectLink( suggestion ) {\n\t\tthis.props.onChange( suggestion.url, suggestion );\n\t\tthis.setState( {\n\t\t\tselectedSuggestion: null,\n\t\t\tshowSuggestions: false,\n\t\t} );\n\t}\n\n\thandleOnClick( suggestion ) {\n\t\tthis.selectLink( suggestion );\n\t\t// Move focus to the input field when a link suggestion is clicked.\n\t\tthis.inputRef.current.focus();\n\t}\n\n\tstatic getDerivedStateFromProps(\n\t\t{\n\t\t\tvalue,\n\t\t\tinstanceId,\n\t\t\tdisableSuggestions,\n\t\t\t__experimentalShowInitialSuggestions = false,\n\t\t},\n\t\t{ showSuggestions }\n\t) {\n\t\tlet shouldShowSuggestions = showSuggestions;\n\n\t\tconst hasValue = value && value.length;\n\n\t\tif ( ! __experimentalShowInitialSuggestions && ! hasValue ) {\n\t\t\tshouldShowSuggestions = false;\n\t\t}\n\n\t\tif ( disableSuggestions === true ) {\n\t\t\tshouldShowSuggestions = false;\n\t\t}\n\n\t\treturn {\n\t\t\tshowSuggestions: shouldShowSuggestions,\n\t\t\tsuggestionsListboxId: `block-editor-url-input-suggestions-${ instanceId }`,\n\t\t\tsuggestionOptionIdPrefix: `block-editor-url-input-suggestion-${ instanceId }`,\n\t\t};\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ this.renderControl() }\n\t\t\t\t{ this.renderSuggestions() }\n\t\t\t</>\n\t\t);\n\t}\n\n\trenderControl() {\n\t\tconst {\n\t\t\tlabel = null,\n\t\t\tclassName,\n\t\t\tisFullWidth,\n\t\t\tinstanceId,\n\t\t\tplaceholder = __( 'Paste URL or type to search' ),\n\t\t\t__experimentalRenderControl: renderControl,\n\t\t\tvalue = '',\n\t\t\thideLabelFromVision = false,\n\t\t} = this.props;\n\n\t\tconst {\n\t\t\tloading,\n\t\t\tshowSuggestions,\n\t\t\tselectedSuggestion,\n\t\t\tsuggestionsListboxId,\n\t\t\tsuggestionOptionIdPrefix,\n\t\t} = this.state;\n\n\t\tconst inputId = `url-input-control-${ instanceId }`;\n\n\t\tconst controlProps = {\n\t\t\tid: inputId, // Passes attribute to label for the for attribute\n\t\t\tlabel,\n\t\t\tclassName: clsx( 'block-editor-url-input', className, {\n\t\t\t\t'is-full-width': isFullWidth,\n\t\t\t} ),\n\t\t\thideLabelFromVision,\n\t\t};\n\n\t\tconst inputProps = {\n\t\t\tid: inputId,\n\t\t\tvalue,\n\t\t\trequired: true,\n\t\t\ttype: 'text',\n\t\t\tonChange: this.onChange,\n\t\t\tonFocus: this.onFocus,\n\t\t\tplaceholder,\n\t\t\tonKeyDown: this.onKeyDown,\n\t\t\trole: 'combobox',\n\t\t\t'aria-label': label ? undefined : __( 'URL' ), // Ensure input always has an accessible label\n\t\t\t'aria-expanded': showSuggestions,\n\t\t\t'aria-autocomplete': 'list',\n\t\t\t'aria-owns': suggestionsListboxId,\n\t\t\t'aria-activedescendant':\n\t\t\t\tselectedSuggestion !== null\n\t\t\t\t\t? `${ suggestionOptionIdPrefix }-${ selectedSuggestion }`\n\t\t\t\t\t: undefined,\n\t\t\tref: this.inputRef,\n\t\t\tsuffix: this.props.suffix,\n\t\t};\n\n\t\tif ( renderControl ) {\n\t\t\treturn renderControl( controlProps, inputProps, loading );\n\t\t}\n\n\t\treturn (\n\t\t\t<BaseControl __nextHasNoMarginBottom { ...controlProps }>\n\t\t\t\t<InputControl { ...inputProps } __next40pxDefaultSize />\n\t\t\t\t{ loading && <Spinner /> }\n\t\t\t</BaseControl>\n\t\t);\n\t}\n\n\trenderSuggestions() {\n\t\tconst {\n\t\t\tclassName,\n\t\t\t__experimentalRenderSuggestions: renderSuggestions,\n\t\t} = this.props;\n\n\t\tconst {\n\t\t\tshowSuggestions,\n\t\t\tsuggestions,\n\t\t\tsuggestionsValue,\n\t\t\tselectedSuggestion,\n\t\t\tsuggestionsListboxId,\n\t\t\tsuggestionOptionIdPrefix,\n\t\t\tloading,\n\t\t} = this.state;\n\n\t\tif ( ! showSuggestions || suggestions.length === 0 ) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst suggestionsListProps = {\n\t\t\tid: suggestionsListboxId,\n\t\t\tref: this.autocompleteRef,\n\t\t\trole: 'listbox',\n\t\t};\n\n\t\tconst buildSuggestionItemProps = ( suggestion, index ) => {\n\t\t\treturn {\n\t\t\t\trole: 'option',\n\t\t\t\ttabIndex: '-1',\n\t\t\t\tid: `${ suggestionOptionIdPrefix }-${ index }`,\n\t\t\t\tref: this.bindSuggestionNode( index ),\n\t\t\t\t'aria-selected':\n\t\t\t\t\tindex === selectedSuggestion ? true : undefined,\n\t\t\t};\n\t\t};\n\n\t\tif ( isFunction( renderSuggestions ) ) {\n\t\t\treturn renderSuggestions( {\n\t\t\t\tsuggestions,\n\t\t\t\tselectedSuggestion,\n\t\t\t\tsuggestionsListProps,\n\t\t\t\tbuildSuggestionItemProps,\n\t\t\t\tisLoading: loading,\n\t\t\t\thandleSuggestionClick: this.handleOnClick,\n\t\t\t\tisInitialSuggestions: ! suggestionsValue?.length,\n\t\t\t\tcurrentInputValue: suggestionsValue,\n\t\t\t} );\n\t\t}\n\n\t\treturn (\n\t\t\t<Popover placement=\"bottom\" focusOnMount={ false }>\n\t\t\t\t<div\n\t\t\t\t\t{ ...suggestionsListProps }\n\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t'block-editor-url-input__suggestions',\n\t\t\t\t\t\t`${ className }__suggestions`\n\t\t\t\t\t) }\n\t\t\t\t>\n\t\t\t\t\t{ suggestions.map( ( suggestion, index ) => (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t{ ...buildSuggestionItemProps( suggestion, index ) }\n\t\t\t\t\t\t\tkey={ suggestion.id }\n\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\t'block-editor-url-input__suggestion',\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t'is-selected': index === selectedSuggestion,\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tonClick={ () => this.handleOnClick( suggestion ) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ suggestion.title }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t) ) }\n\t\t\t\t</div>\n\t\t\t</Popover>\n\t\t);\n\t}\n}\n\n/**\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/url-input/README.md\n */\nexport default compose(\n\twithSafeTimeout,\n\twithSpokenMessages,\n\twithInstanceId,\n\twithSelect( ( select, props ) => {\n\t\t// If a link suggestions handler is already provided then\n\t\t// bail.\n\t\tif ( isFunction( props.__experimentalFetchLinkSuggestions ) ) {\n\t\t\treturn;\n\t\t}\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\treturn {\n\t\t\t__experimentalFetchLinkSuggestions:\n\t\t\t\tgetSettings().__experimentalFetchLinkSuggestions,\n\t\t};\n\t} )\n)( URLInput );\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,EAAE,EAAEC,OAAO,EAAEC,EAAE,QAAQ,iBAAiB;AACjD,SAASC,SAAS,EAAEC,SAAS,QAAQ,oBAAoB;AACzD,SAASC,EAAE,EAAEC,IAAI,EAAEC,KAAK,EAAEC,GAAG,QAAQ,qBAAqB;AAC1D,SACCC,WAAW,EACXC,MAAM,EACNC,0BAA0B,IAAIC,YAAY,EAC1CC,OAAO,EACPC,kBAAkB,EAClBC,OAAO,QACD,uBAAuB;AAC9B,SACCC,OAAO,EACPC,QAAQ,EACRC,cAAc,EACdC,eAAe,QACT,oBAAoB;AAC3B,SAASC,UAAU,QAAQ,iBAAiB;AAC5C,SAASC,KAAK,QAAQ,gBAAgB;;AAEtC;AACA;AACA;AACA,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,aAAa;;AAEvD;AACA;AACA;AACA;AACA;AACA;AALA,SAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA,EAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,aAAA,IAAAC,cAAA;AAMA,SAASC,UAAUA,CAAEC,SAAS,EAAG;EAChC,OAAO,OAAOA,SAAS,KAAK,UAAU;AACvC;AAEA,MAAMC,QAAQ,SAAS/B,SAAS,CAAC;EAChCg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CAAExB,gBAAgB,EAAEa,MAAM;QAChDkE,iBAAiB,EAAE/E;MACpB,CAAE,CAAC;IACJ;IAEA,oBACCvB,IAAA,CAACd,OAAO;MAACqH,SAAS,EAAC,QAAQ;MAACC,YAAY,EAAG,KAAO;MAAA5B,QAAA,eACjD5E,IAAA;QAAA,GACMiG,oBAAoB;QACzBjB,SAAS,EAAG9G,IAAI,CACf,qCAAqC,EACrC,GAAI8G,SAAS,eACd,CAAG;QAAAJ,QAAA,EAEDvD,WAAW,CAACoF,GAAG,CAAE,CAAEzC,UAAU,EAAEvB,KAAK,kBACrCvC,cAAA,CAACrB,MAAM;UACNkH,qBAAqB;UAAA,GAChBG,wBAAwB,CAAElC,UAAU,EAAEvB,KAAM,CAAC;UAClDiE,GAAG,EAAG1C,UAAU,CAACuB,EAAI;UACrBP,SAAS,EAAG9G,IAAI,CACf,oCAAoC,EACpC;YACC,aAAa,EAAEuE,KAAK,KAAKjB;UAC1B,CACD,CAAG;UACHmF,OAAO,EAAGA,CAAA,KAAM,IAAI,CAAC9F,aAAa,CAAEmD,UAAW;QAAG,GAEhDA,UAAU,CAAC4C,KACN,CACP;MAAC,CACC;IAAC,CACE,CAAC;EAEZ;AACD;;AAEA;AACA;AACA;AACA,eAAezH,OAAO,CACrBG,eAAe,EACfL,kBAAkB,EAClBI,cAAc,EACdE,UAAU,CAAE,CAAEsH,MAAM,EAAEtG,KAAK,KAAM;EAChC;EACA;EACA,IAAKJ,UAAU,CAAEI,KAAK,CAACoC,kCAAmC,CAAC,EAAG;IAC7D;EACD;EACA,MAAM;IAAEmE;EAAY,CAAC,GAAGD,MAAM,CAAEnH,gBAAiB,CAAC;EAClD,OAAO;IACNiD,kCAAkC,EACjCmE,WAAW,CAAC,CAAC,CAACnE;EAChB,CAAC;AACF,CAAE,CACH,CAAC,CAAEtC,QAAS,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["clsx","__","sprintf","_n","Component","createRef","UP","DOWN","ENTER","TAB","BaseControl","Button","__experimentalInputControl","InputControl","Spinner","withSpokenMessages","Popover","compose","debounce","withInstanceId","withSafeTimeout","withSelect","isURL","store","blockEditorStore","Fragment","_Fragment","jsxs","_jsxs","jsx","_jsx","createElement","_createElement","isFunction","maybeFunc","URLInput","constructor","props","onChange","bind","onFocus","onKeyDown","selectLink","handleOnClick","bindSuggestionNode","autocompleteRef","inputRef","updateSuggestions","suggestionNodes","suggestionsRequest","state","suggestions","showSuggestions","suggestionsValue","selectedSuggestion","suggestionsListboxId","suggestionOptionIdPrefix","componentDidUpdate","prevProps","value","__experimentalShowInitialSuggestions","scrollIntoView","behavior","block","inline","disableSuggestions","length","componentDidMount","shouldShowInitialSuggestions","componentWillUnmount","cancel","index","ref","__experimentalFetchLinkSuggestions","fetchLinkSuggestions","__experimentalHandleURLSuggestions","handleURLSuggestions","isInitialSuggestions","trim","setState","loading","request","then","debouncedSpeak","catch","finally","newValue","event","keyCode","target","selectionStart","preventDefault","setSelectionRange","onSubmit","suggestion","previousIndex","nextIndex","speak","url","current","focus","getDerivedStateFromProps","instanceId","shouldShowSuggestions","hasValue","render","children","renderControl","renderSuggestions","label","className","isFullWidth","placeholder","__experimentalRenderControl","hideLabelFromVision","inputId","controlProps","id","inputProps","required","type","role","undefined","suffix","__nextHasNoMarginBottom","__next40pxDefaultSize","__experimentalRenderSuggestions","suggestionsListProps","buildSuggestionItemProps","tabIndex","isLoading","handleSuggestionClick","currentInputValue","placement","focusOnMount","map","key","onClick","title","select","getSettings"],"sources":["@wordpress/block-editor/src/components/url-input/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __, sprintf, _n } from '@wordpress/i18n';\nimport { Component, createRef } from '@wordpress/element';\nimport { UP, DOWN, ENTER, TAB } from '@wordpress/keycodes';\nimport {\n\tBaseControl,\n\tButton,\n\t__experimentalInputControl as InputControl,\n\tSpinner,\n\twithSpokenMessages,\n\tPopover,\n} from '@wordpress/components';\nimport {\n\tcompose,\n\tdebounce,\n\twithInstanceId,\n\twithSafeTimeout,\n} from '@wordpress/compose';\nimport { withSelect } from '@wordpress/data';\nimport { isURL } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\n\n/**\n * Whether the argument is a function.\n *\n * @param {*} maybeFunc The argument to check.\n * @return {boolean} True if the argument is a function, false otherwise.\n */\nfunction isFunction( maybeFunc ) {\n\treturn typeof maybeFunc === 'function';\n}\n\nclass URLInput extends Component {\n\tconstructor( props ) {\n\t\tsuper( props );\n\n\t\tthis.onChange = this.onChange.bind( this );\n\t\tthis.onFocus = this.onFocus.bind( this );\n\t\tthis.onKeyDown = this.onKeyDown.bind( this );\n\t\tthis.selectLink = this.selectLink.bind( this );\n\t\tthis.handleOnClick = this.handleOnClick.bind( this );\n\t\tthis.bindSuggestionNode = this.bindSuggestionNode.bind( this );\n\t\tthis.autocompleteRef = props.autocompleteRef || createRef();\n\t\tthis.inputRef = createRef();\n\t\tthis.updateSuggestions = debounce(\n\t\t\tthis.updateSuggestions.bind( this ),\n\t\t\t200\n\t\t);\n\n\t\tthis.suggestionNodes = [];\n\n\t\tthis.suggestionsRequest = null;\n\n\t\tthis.state = {\n\t\t\tsuggestions: [],\n\t\t\tshowSuggestions: false,\n\t\t\tsuggestionsValue: null,\n\t\t\tselectedSuggestion: null,\n\t\t\tsuggestionsListboxId: '',\n\t\t\tsuggestionOptionIdPrefix: '',\n\t\t};\n\t}\n\n\tcomponentDidUpdate( prevProps ) {\n\t\tconst { showSuggestions, selectedSuggestion } = this.state;\n\t\tconst { value, __experimentalShowInitialSuggestions = false } =\n\t\t\tthis.props;\n\n\t\t// Only have to worry about scrolling selected suggestion into view\n\t\t// when already expanded.\n\t\tif (\n\t\t\tshowSuggestions &&\n\t\t\tselectedSuggestion !== null &&\n\t\t\tthis.suggestionNodes[ selectedSuggestion ]\n\t\t) {\n\t\t\tthis.suggestionNodes[ selectedSuggestion ].scrollIntoView( {\n\t\t\t\tbehavior: 'instant',\n\t\t\t\tblock: 'nearest',\n\t\t\t\tinline: 'nearest',\n\t\t\t} );\n\t\t}\n\n\t\t// Update suggestions when the value changes.\n\t\tif ( prevProps.value !== value && ! this.props.disableSuggestions ) {\n\t\t\tif ( value?.length ) {\n\t\t\t\t// If the new value is not empty we need to update with suggestions for it.\n\t\t\t\tthis.updateSuggestions( value );\n\t\t\t} else if ( __experimentalShowInitialSuggestions ) {\n\t\t\t\t// If the new value is empty and we can show initial suggestions, then show initial suggestions.\n\t\t\t\tthis.updateSuggestions();\n\t\t\t}\n\t\t}\n\t}\n\n\tcomponentDidMount() {\n\t\tif ( this.shouldShowInitialSuggestions() ) {\n\t\t\tthis.updateSuggestions();\n\t\t}\n\t}\n\n\tcomponentWillUnmount() {\n\t\tthis.suggestionsRequest?.cancel?.();\n\t\tthis.suggestionsRequest = null;\n\t}\n\n\tbindSuggestionNode( index ) {\n\t\treturn ( ref ) => {\n\t\t\tthis.suggestionNodes[ index ] = ref;\n\t\t};\n\t}\n\n\tshouldShowInitialSuggestions() {\n\t\tconst { __experimentalShowInitialSuggestions = false, value } =\n\t\t\tthis.props;\n\t\treturn (\n\t\t\t__experimentalShowInitialSuggestions && ! ( value && value.length )\n\t\t);\n\t}\n\n\tupdateSuggestions( value = '' ) {\n\t\tconst {\n\t\t\t__experimentalFetchLinkSuggestions: fetchLinkSuggestions,\n\t\t\t__experimentalHandleURLSuggestions: handleURLSuggestions,\n\t\t} = this.props;\n\n\t\tif ( ! fetchLinkSuggestions ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Initial suggestions may only show if there is no value\n\t\t// (note: this includes whitespace).\n\t\tconst isInitialSuggestions = ! value?.length;\n\n\t\t// Trim only now we've determined whether or not it originally had a \"length\"\n\t\t// (even if that value was all whitespace).\n\t\tvalue = value.trim();\n\n\t\t// Allow a suggestions request if:\n\t\t// - there are at least 2 characters in the search input (except manual searches where\n\t\t// search input length is not required to trigger a fetch)\n\t\t// - this is a direct entry (eg: a URL)\n\t\tif (\n\t\t\t! isInitialSuggestions &&\n\t\t\t( value.length < 2 || ( ! handleURLSuggestions && isURL( value ) ) )\n\t\t) {\n\t\t\tthis.suggestionsRequest?.cancel?.();\n\t\t\tthis.suggestionsRequest = null;\n\n\t\t\tthis.setState( {\n\t\t\t\tsuggestions: [],\n\t\t\t\tshowSuggestions: false,\n\t\t\t\tsuggestionsValue: value,\n\t\t\t\tselectedSuggestion: null,\n\t\t\t\tloading: false,\n\t\t\t} );\n\n\t\t\treturn;\n\t\t}\n\n\t\tthis.setState( {\n\t\t\tselectedSuggestion: null,\n\t\t\tloading: true,\n\t\t} );\n\n\t\tconst request = fetchLinkSuggestions( value, {\n\t\t\tisInitialSuggestions,\n\t\t} );\n\n\t\trequest\n\t\t\t.then( ( suggestions ) => {\n\t\t\t\t// A fetch Promise doesn't have an abort option. It's mimicked by\n\t\t\t\t// comparing the request reference in on the instance, which is\n\t\t\t\t// reset or deleted on subsequent requests or unmounting.\n\t\t\t\tif ( this.suggestionsRequest !== request ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tthis.setState( {\n\t\t\t\t\tsuggestions,\n\t\t\t\t\tsuggestionsValue: value,\n\t\t\t\t\tloading: false,\n\t\t\t\t\tshowSuggestions: !! suggestions.length,\n\t\t\t\t} );\n\n\t\t\t\tif ( !! suggestions.length ) {\n\t\t\t\t\tthis.props.debouncedSpeak(\n\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t/* translators: %d: number of results. */\n\t\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t\t'%d result found, use up and down arrow keys to navigate.',\n\t\t\t\t\t\t\t\t'%d results found, use up and down arrow keys to navigate.',\n\t\t\t\t\t\t\t\tsuggestions.length\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tsuggestions.length\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'assertive'\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\tthis.props.debouncedSpeak(\n\t\t\t\t\t\t__( 'No results.' ),\n\t\t\t\t\t\t'assertive'\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} )\n\t\t\t.catch( () => {\n\t\t\t\tif ( this.suggestionsRequest !== request ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tthis.setState( {\n\t\t\t\t\tloading: false,\n\t\t\t\t} );\n\t\t\t} )\n\t\t\t.finally( () => {\n\t\t\t\t// If this is the current promise then reset the reference\n\t\t\t\t// to allow for checking if a new request is made.\n\t\t\t\tif ( this.suggestionsRequest === request ) {\n\t\t\t\t\tthis.suggestionsRequest = null;\n\t\t\t\t}\n\t\t\t} );\n\n\t\t// Note that this assignment is handled *before* the async search request\n\t\t// as a Promise always resolves on the next tick of the event loop.\n\t\tthis.suggestionsRequest = request;\n\t}\n\n\tonChange( newValue ) {\n\t\tthis.props.onChange( newValue );\n\t}\n\n\tonFocus() {\n\t\tconst { suggestions } = this.state;\n\t\tconst { disableSuggestions, value } = this.props;\n\n\t\t// When opening the link editor, if there's a value present, we want to load the suggestions pane with the results for this input search value\n\t\t// Don't re-run the suggestions on focus if there are already suggestions present (prevents searching again when tabbing between the input and buttons)\n\t\t// or there is already a request in progress.\n\t\tif (\n\t\t\tvalue &&\n\t\t\t! disableSuggestions &&\n\t\t\t! ( suggestions && suggestions.length ) &&\n\t\t\tthis.suggestionsRequest === null\n\t\t) {\n\t\t\t// Ensure the suggestions are updated with the current input value.\n\t\t\tthis.updateSuggestions( value );\n\t\t}\n\t}\n\n\tonKeyDown( event ) {\n\t\tthis.props.onKeyDown?.( event );\n\t\tconst { showSuggestions, selectedSuggestion, suggestions, loading } =\n\t\t\tthis.state;\n\n\t\t// If the suggestions are not shown or loading, we shouldn't handle the arrow keys\n\t\t// We shouldn't preventDefault to allow block arrow keys navigation.\n\t\tif ( ! showSuggestions || ! suggestions.length || loading ) {\n\t\t\t// In the Windows version of Firefox the up and down arrows don't move the caret\n\t\t\t// within an input field like they do for Mac Firefox/Chrome/Safari. This causes\n\t\t\t// a form of focus trapping that is disruptive to the user experience. This disruption\n\t\t\t// only happens if the caret is not in the first or last position in the text input.\n\t\t\t// See: https://github.com/WordPress/gutenberg/issues/5693#issuecomment-436684747\n\t\t\tswitch ( event.keyCode ) {\n\t\t\t\t// When UP is pressed, if the caret is at the start of the text, move it to the 0\n\t\t\t\t// position.\n\t\t\t\tcase UP: {\n\t\t\t\t\tif ( 0 !== event.target.selectionStart ) {\n\t\t\t\t\t\tevent.preventDefault();\n\n\t\t\t\t\t\t// Set the input caret to position 0.\n\t\t\t\t\t\tevent.target.setSelectionRange( 0, 0 );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t// When DOWN is pressed, if the caret is not at the end of the text, move it to the\n\t\t\t\t// last position.\n\t\t\t\tcase DOWN: {\n\t\t\t\t\tif (\n\t\t\t\t\t\tthis.props.value.length !== event.target.selectionStart\n\t\t\t\t\t) {\n\t\t\t\t\t\tevent.preventDefault();\n\n\t\t\t\t\t\t// Set the input caret to the last position.\n\t\t\t\t\t\tevent.target.setSelectionRange(\n\t\t\t\t\t\t\tthis.props.value.length,\n\t\t\t\t\t\t\tthis.props.value.length\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t// Submitting while loading should trigger onSubmit.\n\t\t\t\tcase ENTER: {\n\t\t\t\t\tif ( this.props.onSubmit ) {\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\tthis.props.onSubmit( null, event );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\tconst suggestion =\n\t\t\tthis.state.suggestions[ this.state.selectedSuggestion ];\n\n\t\tswitch ( event.keyCode ) {\n\t\t\tcase UP: {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tconst previousIndex = ! selectedSuggestion\n\t\t\t\t\t? suggestions.length - 1\n\t\t\t\t\t: selectedSuggestion - 1;\n\t\t\t\tthis.setState( {\n\t\t\t\t\tselectedSuggestion: previousIndex,\n\t\t\t\t} );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase DOWN: {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tconst nextIndex =\n\t\t\t\t\tselectedSuggestion === null ||\n\t\t\t\t\tselectedSuggestion === suggestions.length - 1\n\t\t\t\t\t\t? 0\n\t\t\t\t\t\t: selectedSuggestion + 1;\n\t\t\t\tthis.setState( {\n\t\t\t\t\tselectedSuggestion: nextIndex,\n\t\t\t\t} );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase TAB: {\n\t\t\t\tif ( this.state.selectedSuggestion !== null ) {\n\t\t\t\t\tthis.selectLink( suggestion );\n\t\t\t\t\t// Announce a link has been selected when tabbing away from the input field.\n\t\t\t\t\tthis.props.speak( __( 'Link selected.' ) );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase ENTER: {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tif ( this.state.selectedSuggestion !== null ) {\n\t\t\t\t\tthis.selectLink( suggestion );\n\n\t\t\t\t\tif ( this.props.onSubmit ) {\n\t\t\t\t\t\tthis.props.onSubmit( suggestion, event );\n\t\t\t\t\t}\n\t\t\t\t} else if ( this.props.onSubmit ) {\n\t\t\t\t\tthis.props.onSubmit( null, event );\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tselectLink( suggestion ) {\n\t\tthis.props.onChange( suggestion.url, suggestion );\n\t\tthis.setState( {\n\t\t\tselectedSuggestion: null,\n\t\t\tshowSuggestions: false,\n\t\t} );\n\t}\n\n\thandleOnClick( suggestion ) {\n\t\tthis.selectLink( suggestion );\n\t\t// Move focus to the input field when a link suggestion is clicked.\n\t\tthis.inputRef.current.focus();\n\t}\n\n\tstatic getDerivedStateFromProps(\n\t\t{\n\t\t\tvalue,\n\t\t\tinstanceId,\n\t\t\tdisableSuggestions,\n\t\t\t__experimentalShowInitialSuggestions = false,\n\t\t},\n\t\t{ showSuggestions }\n\t) {\n\t\tlet shouldShowSuggestions = showSuggestions;\n\n\t\tconst hasValue = value && value.length;\n\n\t\tif ( ! __experimentalShowInitialSuggestions && ! hasValue ) {\n\t\t\tshouldShowSuggestions = false;\n\t\t}\n\n\t\tif ( disableSuggestions === true ) {\n\t\t\tshouldShowSuggestions = false;\n\t\t}\n\n\t\treturn {\n\t\t\tshowSuggestions: shouldShowSuggestions,\n\t\t\tsuggestionsListboxId: `block-editor-url-input-suggestions-${ instanceId }`,\n\t\t\tsuggestionOptionIdPrefix: `block-editor-url-input-suggestion-${ instanceId }`,\n\t\t};\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ this.renderControl() }\n\t\t\t\t{ this.renderSuggestions() }\n\t\t\t</>\n\t\t);\n\t}\n\n\trenderControl() {\n\t\tconst {\n\t\t\tlabel = null,\n\t\t\tclassName,\n\t\t\tisFullWidth,\n\t\t\tinstanceId,\n\t\t\tplaceholder = __( 'Paste URL or type to search' ),\n\t\t\t__experimentalRenderControl: renderControl,\n\t\t\tvalue = '',\n\t\t\thideLabelFromVision = false,\n\t\t} = this.props;\n\n\t\tconst {\n\t\t\tloading,\n\t\t\tshowSuggestions,\n\t\t\tselectedSuggestion,\n\t\t\tsuggestionsListboxId,\n\t\t\tsuggestionOptionIdPrefix,\n\t\t} = this.state;\n\n\t\tconst inputId = `url-input-control-${ instanceId }`;\n\n\t\tconst controlProps = {\n\t\t\tid: inputId, // Passes attribute to label for the for attribute\n\t\t\tlabel,\n\t\t\tclassName: clsx( 'block-editor-url-input', className, {\n\t\t\t\t'is-full-width': isFullWidth,\n\t\t\t} ),\n\t\t\thideLabelFromVision,\n\t\t};\n\n\t\tconst inputProps = {\n\t\t\tid: inputId,\n\t\t\tvalue,\n\t\t\trequired: true,\n\t\t\ttype: 'text',\n\t\t\tonChange: this.onChange,\n\t\t\tonFocus: this.onFocus,\n\t\t\tplaceholder,\n\t\t\tonKeyDown: this.onKeyDown,\n\t\t\trole: 'combobox',\n\t\t\t'aria-label': label ? undefined : __( 'URL' ), // Ensure input always has an accessible label\n\t\t\t'aria-expanded': showSuggestions,\n\t\t\t'aria-autocomplete': 'list',\n\t\t\t'aria-owns': suggestionsListboxId,\n\t\t\t'aria-activedescendant':\n\t\t\t\tselectedSuggestion !== null\n\t\t\t\t\t? `${ suggestionOptionIdPrefix }-${ selectedSuggestion }`\n\t\t\t\t\t: undefined,\n\t\t\tref: this.inputRef,\n\t\t\tsuffix: this.props.suffix,\n\t\t};\n\n\t\tif ( renderControl ) {\n\t\t\treturn renderControl( controlProps, inputProps, loading );\n\t\t}\n\n\t\treturn (\n\t\t\t<BaseControl __nextHasNoMarginBottom { ...controlProps }>\n\t\t\t\t<InputControl { ...inputProps } __next40pxDefaultSize />\n\t\t\t\t{ loading && <Spinner /> }\n\t\t\t</BaseControl>\n\t\t);\n\t}\n\n\trenderSuggestions() {\n\t\tconst {\n\t\t\tclassName,\n\t\t\t__experimentalRenderSuggestions: renderSuggestions,\n\t\t} = this.props;\n\n\t\tconst {\n\t\t\tshowSuggestions,\n\t\t\tsuggestions,\n\t\t\tsuggestionsValue,\n\t\t\tselectedSuggestion,\n\t\t\tsuggestionsListboxId,\n\t\t\tsuggestionOptionIdPrefix,\n\t\t\tloading,\n\t\t} = this.state;\n\n\t\tif ( ! showSuggestions || suggestions.length === 0 ) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst suggestionsListProps = {\n\t\t\tid: suggestionsListboxId,\n\t\t\tref: this.autocompleteRef,\n\t\t\trole: 'listbox',\n\t\t};\n\n\t\tconst buildSuggestionItemProps = ( suggestion, index ) => {\n\t\t\treturn {\n\t\t\t\trole: 'option',\n\t\t\t\ttabIndex: '-1',\n\t\t\t\tid: `${ suggestionOptionIdPrefix }-${ index }`,\n\t\t\t\tref: this.bindSuggestionNode( index ),\n\t\t\t\t'aria-selected':\n\t\t\t\t\tindex === selectedSuggestion ? true : undefined,\n\t\t\t};\n\t\t};\n\n\t\tif ( isFunction( renderSuggestions ) ) {\n\t\t\treturn renderSuggestions( {\n\t\t\t\tsuggestions,\n\t\t\t\tselectedSuggestion,\n\t\t\t\tsuggestionsListProps,\n\t\t\t\tbuildSuggestionItemProps,\n\t\t\t\tisLoading: loading,\n\t\t\t\thandleSuggestionClick: this.handleOnClick,\n\t\t\t\tisInitialSuggestions: ! suggestionsValue?.length,\n\t\t\t\tcurrentInputValue: suggestionsValue,\n\t\t\t} );\n\t\t}\n\n\t\treturn (\n\t\t\t<Popover placement=\"bottom\" focusOnMount={ false }>\n\t\t\t\t<div\n\t\t\t\t\t{ ...suggestionsListProps }\n\t\t\t\t\tclassName={ clsx( 'block-editor-url-input__suggestions', {\n\t\t\t\t\t\t[ `${ className }__suggestions` ]: className,\n\t\t\t\t\t} ) }\n\t\t\t\t>\n\t\t\t\t\t{ suggestions.map( ( suggestion, index ) => (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t{ ...buildSuggestionItemProps( suggestion, index ) }\n\t\t\t\t\t\t\tkey={ suggestion.id }\n\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\t'block-editor-url-input__suggestion',\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t'is-selected': index === selectedSuggestion,\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tonClick={ () => this.handleOnClick( suggestion ) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ suggestion.title }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t) ) }\n\t\t\t\t</div>\n\t\t\t</Popover>\n\t\t);\n\t}\n}\n\n/**\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/url-input/README.md\n */\nexport default compose(\n\twithSafeTimeout,\n\twithSpokenMessages,\n\twithInstanceId,\n\twithSelect( ( select, props ) => {\n\t\t// If a link suggestions handler is already provided then\n\t\t// bail.\n\t\tif ( isFunction( props.__experimentalFetchLinkSuggestions ) ) {\n\t\t\treturn;\n\t\t}\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\treturn {\n\t\t\t__experimentalFetchLinkSuggestions:\n\t\t\t\tgetSettings().__experimentalFetchLinkSuggestions,\n\t\t};\n\t} )\n)( URLInput );\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,EAAE,EAAEC,OAAO,EAAEC,EAAE,QAAQ,iBAAiB;AACjD,SAASC,SAAS,EAAEC,SAAS,QAAQ,oBAAoB;AACzD,SAASC,EAAE,EAAEC,IAAI,EAAEC,KAAK,EAAEC,GAAG,QAAQ,qBAAqB;AAC1D,SACCC,WAAW,EACXC,MAAM,EACNC,0BAA0B,IAAIC,YAAY,EAC1CC,OAAO,EACPC,kBAAkB,EAClBC,OAAO,QACD,uBAAuB;AAC9B,SACCC,OAAO,EACPC,QAAQ,EACRC,cAAc,EACdC,eAAe,QACT,oBAAoB;AAC3B,SAASC,UAAU,QAAQ,iBAAiB;AAC5C,SAASC,KAAK,QAAQ,gBAAgB;;AAEtC;AACA;AACA;AACA,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,aAAa;;AAEvD;AACA;AACA;AACA;AACA;AACA;AALA,SAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA,EAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,aAAA,IAAAC,cAAA;AAMA,SAASC,UAAUA,CAAEC,SAAS,EAAG;EAChC,OAAO,OAAOA,SAAS,KAAK,UAAU;AACvC;AAEA,MAAMC,QAAQ,SAAS/B,SAAS,CAAC;EAChCgC,WAAWA,CAAEC,KAAK,EAAG;IACpB,KAAK,CAAEA,KAAM,CAAC;IAEd,IAAI,CAACC,QAAQ,GAAG,IAAI,CAACA,QAAQ,CAACC,IAAI,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,EAAC,QAAQ;MAACC,YAAY,EAAG,KAAO;MAAA5B,QAAA,eACjD5E,IAAA;QAAA,GACMiG,oBAAoB;QACzBjB,SAAS,EAAG9G,IAAI,CAAE,qCAAqC,EAAE;UACxD,CAAE,GAAI8G,SAAS,eAAgB,GAAIA;QACpC,CAAE,CAAG;QAAAJ,QAAA,EAEHvD,WAAW,CAACoF,GAAG,CAAE,CAAEzC,UAAU,EAAEvB,KAAK,kBACrCvC,cAAA,CAACrB,MAAM;UACNkH,qBAAqB;UAAA,GAChBG,wBAAwB,CAAElC,UAAU,EAAEvB,KAAM,CAAC;UAClDiE,GAAG,EAAG1C,UAAU,CAACuB,EAAI;UACrBP,SAAS,EAAG9G,IAAI,CACf,oCAAoC,EACpC;YACC,aAAa,EAAEuE,KAAK,KAAKjB;UAC1B,CACD,CAAG;UACHmF,OAAO,EAAGA,CAAA,KAAM,IAAI,CAAC9F,aAAa,CAAEmD,UAAW;QAAG,GAEhDA,UAAU,CAAC4C,KACN,CACP;MAAC,CACC;IAAC,CACE,CAAC;EAEZ;AACD;;AAEA;AACA;AACA;AACA,eAAezH,OAAO,CACrBG,eAAe,EACfL,kBAAkB,EAClBI,cAAc,EACdE,UAAU,CAAE,CAAEsH,MAAM,EAAEtG,KAAK,KAAM;EAChC;EACA;EACA,IAAKJ,UAAU,CAAEI,KAAK,CAACoC,kCAAmC,CAAC,EAAG;IAC7D;EACD;EACA,MAAM;IAAEmE;EAAY,CAAC,GAAGD,MAAM,CAAEnH,gBAAiB,CAAC;EAClD,OAAO;IACNiD,kCAAkC,EACjCmE,WAAW,CAAC,CAAC,CAACnE;EAChB,CAAC;AACF,CAAE,CACH,CAAC,CAAEtC,QAAS,CAAC","ignoreList":[]}
@@ -13,7 +13,7 @@ import { copy, trash as remove, plus as add, group, ungroup } from '@wordpress/i
13
13
  import BlockIcon from '../block-icon';
14
14
  import { store as blockEditorStore } from '../../store';
15
15
  import { jsx as _jsx } from "react/jsx-runtime";
16
- export const useTransformCommands = () => {
16
+ const getTransformCommands = () => function useTransformCommands() {
17
17
  const {
18
18
  replaceBlocks,
19
19
  multiSelect
@@ -111,7 +111,7 @@ export const useTransformCommands = () => {
111
111
  commands
112
112
  };
113
113
  };
114
- const useQuickActionsCommands = () => {
114
+ const getQuickActionsCommands = () => function useQuickActionsCommands() {
115
115
  const {
116
116
  clientIds,
117
117
  isUngroupable,
@@ -251,11 +251,11 @@ const useQuickActionsCommands = () => {
251
251
  export const useBlockCommands = () => {
252
252
  useCommandLoader({
253
253
  name: 'core/block-editor/blockTransforms',
254
- hook: useTransformCommands
254
+ hook: getTransformCommands()
255
255
  });
256
256
  useCommandLoader({
257
257
  name: 'core/block-editor/blockQuickActions',
258
- hook: useQuickActionsCommands,
258
+ hook: getQuickActionsCommands(),
259
259
  context: 'block-selection-edit'
260
260
  });
261
261
  };
@@ -1 +1 @@
1
- {"version":3,"names":["__","sprintf","hasBlockSupport","store","blocksStore","switchToBlockType","isTemplatePart","useSelect","useDispatch","useCommandLoader","copy","trash","remove","plus","add","group","ungroup","BlockIcon","blockEditorStore","jsx","_jsx","useTransformCommands","replaceBlocks","multiSelect","blocks","clientIds","canRemove","possibleBlockTransformations","invalidSelection","select","getBlockRootClientId","getBlockTransformItems","getSelectedBlockClientIds","getBlocksByClientId","canRemoveBlocks","selectedBlockClientIds","selectedBlocks","filter","block","length","rootClientId","isLoading","commands","isTemplate","selectForMultipleBlocks","insertedBlocks","clientId","onBlockTransform","name","newBlocks","hasPossibleBlockTransformations","map","transformation","title","icon","replace","label","callback","close","useQuickActionsCommands","isUngroupable","isGroupable","_isUngroupable","_isGroupable","canInsertBlockType","getDefaultBlockName","getGroupingBlockName","removeBlocks","duplicateBlocks","insertAfterBlock","insertBeforeBlock","onGroup","groupingBlockName","onUngroup","innerBlocks","canInsertDefaultBlock","canDuplicate","every","push","Array","isArray","command","useBlockCommands","hook","context"],"sources":["@wordpress/block-editor/src/components/use-block-commands/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\thasBlockSupport,\n\tstore as blocksStore,\n\tswitchToBlockType,\n\tisTemplatePart,\n} from '@wordpress/blocks';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useCommandLoader } from '@wordpress/commands';\nimport {\n\tcopy,\n\ttrash as remove,\n\tplus as add,\n\tgroup,\n\tungroup,\n} from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport BlockIcon from '../block-icon';\nimport { store as blockEditorStore } from '../../store';\n\nexport const useTransformCommands = () => {\n\tconst { replaceBlocks, multiSelect } = useDispatch( blockEditorStore );\n\tconst {\n\t\tblocks,\n\t\tclientIds,\n\t\tcanRemove,\n\t\tpossibleBlockTransformations,\n\t\tinvalidSelection,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetBlockRootClientId,\n\t\t\tgetBlockTransformItems,\n\t\t\tgetSelectedBlockClientIds,\n\t\t\tgetBlocksByClientId,\n\t\t\tcanRemoveBlocks,\n\t\t} = select( blockEditorStore );\n\n\t\tconst selectedBlockClientIds = getSelectedBlockClientIds();\n\t\tconst selectedBlocks = getBlocksByClientId( selectedBlockClientIds );\n\n\t\t// selectedBlocks can have `null`s when something tries to call `selectBlock` with an inexistent clientId.\n\t\t// These nulls will cause fatal errors down the line.\n\t\t// In order to prevent discrepancies between selectedBlockClientIds and selectedBlocks, we effectively treat the entire selection as invalid.\n\t\t// @see https://github.com/WordPress/gutenberg/pull/59410#issuecomment-2006304536\n\t\tif ( selectedBlocks.filter( ( block ) => ! block ).length > 0 ) {\n\t\t\treturn {\n\t\t\t\tinvalidSelection: true,\n\t\t\t};\n\t\t}\n\n\t\tconst rootClientId = getBlockRootClientId(\n\t\t\tselectedBlockClientIds[ 0 ]\n\t\t);\n\t\treturn {\n\t\t\tblocks: selectedBlocks,\n\t\t\tclientIds: selectedBlockClientIds,\n\t\t\tpossibleBlockTransformations: getBlockTransformItems(\n\t\t\t\tselectedBlocks,\n\t\t\t\trootClientId\n\t\t\t),\n\t\t\tcanRemove: canRemoveBlocks( selectedBlockClientIds ),\n\t\t\tinvalidSelection: false,\n\t\t};\n\t}, [] );\n\n\tif ( invalidSelection ) {\n\t\treturn {\n\t\t\tisLoading: false,\n\t\t\tcommands: [],\n\t\t};\n\t}\n\tconst isTemplate = blocks.length === 1 && isTemplatePart( blocks[ 0 ] );\n\n\tfunction selectForMultipleBlocks( insertedBlocks ) {\n\t\tif ( insertedBlocks.length > 1 ) {\n\t\t\tmultiSelect(\n\t\t\t\tinsertedBlocks[ 0 ].clientId,\n\t\t\t\tinsertedBlocks[ insertedBlocks.length - 1 ].clientId\n\t\t\t);\n\t\t}\n\t}\n\n\t// Simple block tranformation based on the `Block Transforms` API.\n\tfunction onBlockTransform( name ) {\n\t\tconst newBlocks = switchToBlockType( blocks, name );\n\t\treplaceBlocks( clientIds, newBlocks );\n\t\tselectForMultipleBlocks( newBlocks );\n\t}\n\n\t/**\n\t * The `isTemplate` check is a stopgap solution here.\n\t * Ideally, the Transforms API should handle this\n\t * by allowing to exclude blocks from wildcard transformations.\n\t */\n\tconst hasPossibleBlockTransformations =\n\t\t!! possibleBlockTransformations.length && canRemove && ! isTemplate;\n\n\tif (\n\t\t! clientIds ||\n\t\tclientIds.length < 1 ||\n\t\t! hasPossibleBlockTransformations\n\t) {\n\t\treturn { isLoading: false, commands: [] };\n\t}\n\n\tconst commands = possibleBlockTransformations.map( ( transformation ) => {\n\t\tconst { name, title, icon } = transformation;\n\t\treturn {\n\t\t\tname: 'core/block-editor/transform-to-' + name.replace( '/', '-' ),\n\t\t\t/* translators: %s: Block or block variation name. */\n\t\t\tlabel: sprintf( __( 'Transform to %s' ), title ),\n\t\t\ticon: <BlockIcon icon={ icon } />,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\tonBlockTransform( name );\n\t\t\t\tclose();\n\t\t\t},\n\t\t};\n\t} );\n\n\treturn { isLoading: false, commands };\n};\n\nconst useQuickActionsCommands = () => {\n\tconst { clientIds, isUngroupable, isGroupable } = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetSelectedBlockClientIds,\n\t\t\tisUngroupable: _isUngroupable,\n\t\t\tisGroupable: _isGroupable,\n\t\t} = select( blockEditorStore );\n\t\tconst selectedBlockClientIds = getSelectedBlockClientIds();\n\n\t\treturn {\n\t\t\tclientIds: selectedBlockClientIds,\n\t\t\tisUngroupable: _isUngroupable(),\n\t\t\tisGroupable: _isGroupable(),\n\t\t};\n\t}, [] );\n\tconst {\n\t\tcanInsertBlockType,\n\t\tgetBlockRootClientId,\n\t\tgetBlocksByClientId,\n\t\tcanRemoveBlocks,\n\t} = useSelect( blockEditorStore );\n\tconst { getDefaultBlockName, getGroupingBlockName } =\n\t\tuseSelect( blocksStore );\n\n\tconst blocks = getBlocksByClientId( clientIds );\n\n\tconst {\n\t\tremoveBlocks,\n\t\treplaceBlocks,\n\t\tduplicateBlocks,\n\t\tinsertAfterBlock,\n\t\tinsertBeforeBlock,\n\t} = useDispatch( blockEditorStore );\n\n\tconst onGroup = () => {\n\t\tif ( ! blocks.length ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst groupingBlockName = getGroupingBlockName();\n\n\t\t// Activate the `transform` on `core/group` which does the conversion.\n\t\tconst newBlocks = switchToBlockType( blocks, groupingBlockName );\n\n\t\tif ( ! newBlocks ) {\n\t\t\treturn;\n\t\t}\n\t\treplaceBlocks( clientIds, newBlocks );\n\t};\n\tconst onUngroup = () => {\n\t\tif ( ! blocks.length ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst innerBlocks = blocks[ 0 ].innerBlocks;\n\n\t\tif ( ! innerBlocks.length ) {\n\t\t\treturn;\n\t\t}\n\n\t\treplaceBlocks( clientIds, innerBlocks );\n\t};\n\n\tif ( ! clientIds || clientIds.length < 1 ) {\n\t\treturn { isLoading: false, commands: [] };\n\t}\n\n\tconst rootClientId = getBlockRootClientId( clientIds[ 0 ] );\n\tconst canInsertDefaultBlock = canInsertBlockType(\n\t\tgetDefaultBlockName(),\n\t\trootClientId\n\t);\n\tconst canDuplicate = blocks.every( ( block ) => {\n\t\treturn (\n\t\t\t!! block &&\n\t\t\thasBlockSupport( block.name, 'multiple', true ) &&\n\t\t\tcanInsertBlockType( block.name, rootClientId )\n\t\t);\n\t} );\n\tconst canRemove = canRemoveBlocks( clientIds );\n\n\tconst commands = [];\n\n\tif ( canDuplicate ) {\n\t\tcommands.push( {\n\t\t\tname: 'duplicate',\n\t\t\tlabel: __( 'Duplicate' ),\n\t\t\tcallback: () => duplicateBlocks( clientIds, true ),\n\t\t\ticon: copy,\n\t\t} );\n\t}\n\n\tif ( canInsertDefaultBlock ) {\n\t\tcommands.push(\n\t\t\t{\n\t\t\t\tname: 'add-before',\n\t\t\t\tlabel: __( 'Add before' ),\n\t\t\t\tcallback: () => {\n\t\t\t\t\tconst clientId = Array.isArray( clientIds )\n\t\t\t\t\t\t? clientIds[ 0 ]\n\t\t\t\t\t\t: clientId;\n\t\t\t\t\tinsertBeforeBlock( clientId );\n\t\t\t\t},\n\t\t\t\ticon: add,\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'add-after',\n\t\t\t\tlabel: __( 'Add after' ),\n\t\t\t\tcallback: () => {\n\t\t\t\t\tconst clientId = Array.isArray( clientIds )\n\t\t\t\t\t\t? clientIds[ clientIds.length - 1 ]\n\t\t\t\t\t\t: clientId;\n\t\t\t\t\tinsertAfterBlock( clientId );\n\t\t\t\t},\n\t\t\t\ticon: add,\n\t\t\t}\n\t\t);\n\t}\n\n\tif ( isGroupable ) {\n\t\tcommands.push( {\n\t\t\tname: 'Group',\n\t\t\tlabel: __( 'Group' ),\n\t\t\tcallback: onGroup,\n\t\t\ticon: group,\n\t\t} );\n\t}\n\n\tif ( isUngroupable ) {\n\t\tcommands.push( {\n\t\t\tname: 'ungroup',\n\t\t\tlabel: __( 'Ungroup' ),\n\t\t\tcallback: onUngroup,\n\t\t\ticon: ungroup,\n\t\t} );\n\t}\n\n\tif ( canRemove ) {\n\t\tcommands.push( {\n\t\t\tname: 'remove',\n\t\t\tlabel: __( 'Delete' ),\n\t\t\tcallback: () => removeBlocks( clientIds, true ),\n\t\t\ticon: remove,\n\t\t} );\n\t}\n\n\treturn {\n\t\tisLoading: false,\n\t\tcommands: commands.map( ( command ) => ( {\n\t\t\t...command,\n\t\t\tname: 'core/block-editor/action-' + command.name,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\tcommand.callback();\n\t\t\t\tclose();\n\t\t\t},\n\t\t} ) ),\n\t};\n};\n\nexport const useBlockCommands = () => {\n\tuseCommandLoader( {\n\t\tname: 'core/block-editor/blockTransforms',\n\t\thook: useTransformCommands,\n\t} );\n\tuseCommandLoader( {\n\t\tname: 'core/block-editor/blockQuickActions',\n\t\thook: useQuickActionsCommands,\n\t\tcontext: 'block-selection-edit',\n\t} );\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SACCC,eAAe,EACfC,KAAK,IAAIC,WAAW,EACpBC,iBAAiB,EACjBC,cAAc,QACR,mBAAmB;AAC1B,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,gBAAgB,QAAQ,qBAAqB;AACtD,SACCC,IAAI,EACJC,KAAK,IAAIC,MAAM,EACfC,IAAI,IAAIC,GAAG,EACXC,KAAK,EACLC,OAAO,QACD,kBAAkB;;AAEzB;AACA;AACA;AACA,OAAOC,SAAS,MAAM,eAAe;AACrC,SAASd,KAAK,IAAIe,gBAAgB,QAAQ,aAAa;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAExD,OAAO,MAAMC,oBAAoB,GAAGA,CAAA,KAAM;EACzC,MAAM;IAAEC,aAAa;IAAEC;EAAY,CAAC,GAAGf,WAAW,CAAEU,gBAAiB,CAAC;EACtE,MAAM;IACLM,MAAM;IACNC,SAAS;IACTC,SAAS;IACTC,4BAA4B;IAC5BC;EACD,CAAC,GAAGrB,SAAS,CAAIsB,MAAM,IA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MAChDS,QAAQ,EAAEA,CAAE;QAAEC;MAAM,CAAC,KAAM;QAC1BuB,OAAO,CAACxB,QAAQ,CAAC,CAAC;QAClBC,KAAK,CAAC,CAAC;MACR;IACD,CAAC,CAAG;EACL,CAAC;AACF,CAAC;AAED,OAAO,MAAMwB,gBAAgB,GAAGA,CAAA,KAAM;EACrCzE,gBAAgB,CAAE;IACjBuC,IAAI,EAAE,mCAAmC;IACzCmC,IAAI,EAAE9D;EACP,CAAE,CAAC;EACHZ,gBAAgB,CAAE;IACjBuC,IAAI,EAAE,qCAAqC;IAC3CmC,IAAI,EAAExB,uBAAuB;IAC7ByB,OAAO,EAAE;EACV,CAAE,CAAC;AACJ,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["__","sprintf","hasBlockSupport","store","blocksStore","switchToBlockType","isTemplatePart","useSelect","useDispatch","useCommandLoader","copy","trash","remove","plus","add","group","ungroup","BlockIcon","blockEditorStore","jsx","_jsx","getTransformCommands","useTransformCommands","replaceBlocks","multiSelect","blocks","clientIds","canRemove","possibleBlockTransformations","invalidSelection","select","getBlockRootClientId","getBlockTransformItems","getSelectedBlockClientIds","getBlocksByClientId","canRemoveBlocks","selectedBlockClientIds","selectedBlocks","filter","block","length","rootClientId","isLoading","commands","isTemplate","selectForMultipleBlocks","insertedBlocks","clientId","onBlockTransform","name","newBlocks","hasPossibleBlockTransformations","map","transformation","title","icon","replace","label","callback","close","getQuickActionsCommands","useQuickActionsCommands","isUngroupable","isGroupable","_isUngroupable","_isGroupable","canInsertBlockType","getDefaultBlockName","getGroupingBlockName","removeBlocks","duplicateBlocks","insertAfterBlock","insertBeforeBlock","onGroup","groupingBlockName","onUngroup","innerBlocks","canInsertDefaultBlock","canDuplicate","every","push","Array","isArray","command","useBlockCommands","hook","context"],"sources":["@wordpress/block-editor/src/components/use-block-commands/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\thasBlockSupport,\n\tstore as blocksStore,\n\tswitchToBlockType,\n\tisTemplatePart,\n} from '@wordpress/blocks';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useCommandLoader } from '@wordpress/commands';\nimport {\n\tcopy,\n\ttrash as remove,\n\tplus as add,\n\tgroup,\n\tungroup,\n} from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport BlockIcon from '../block-icon';\nimport { store as blockEditorStore } from '../../store';\n\nconst getTransformCommands = () =>\n\tfunction useTransformCommands() {\n\t\tconst { replaceBlocks, multiSelect } = useDispatch( blockEditorStore );\n\t\tconst {\n\t\t\tblocks,\n\t\t\tclientIds,\n\t\t\tcanRemove,\n\t\t\tpossibleBlockTransformations,\n\t\t\tinvalidSelection,\n\t\t} = useSelect( ( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockRootClientId,\n\t\t\t\tgetBlockTransformItems,\n\t\t\t\tgetSelectedBlockClientIds,\n\t\t\t\tgetBlocksByClientId,\n\t\t\t\tcanRemoveBlocks,\n\t\t\t} = select( blockEditorStore );\n\n\t\t\tconst selectedBlockClientIds = getSelectedBlockClientIds();\n\t\t\tconst selectedBlocks = getBlocksByClientId(\n\t\t\t\tselectedBlockClientIds\n\t\t\t);\n\n\t\t\t// selectedBlocks can have `null`s when something tries to call `selectBlock` with an inexistent clientId.\n\t\t\t// These nulls will cause fatal errors down the line.\n\t\t\t// In order to prevent discrepancies between selectedBlockClientIds and selectedBlocks, we effectively treat the entire selection as invalid.\n\t\t\t// @see https://github.com/WordPress/gutenberg/pull/59410#issuecomment-2006304536\n\t\t\tif ( selectedBlocks.filter( ( block ) => ! block ).length > 0 ) {\n\t\t\t\treturn {\n\t\t\t\t\tinvalidSelection: true,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tconst rootClientId = getBlockRootClientId(\n\t\t\t\tselectedBlockClientIds[ 0 ]\n\t\t\t);\n\t\t\treturn {\n\t\t\t\tblocks: selectedBlocks,\n\t\t\t\tclientIds: selectedBlockClientIds,\n\t\t\t\tpossibleBlockTransformations: getBlockTransformItems(\n\t\t\t\t\tselectedBlocks,\n\t\t\t\t\trootClientId\n\t\t\t\t),\n\t\t\t\tcanRemove: canRemoveBlocks( selectedBlockClientIds ),\n\t\t\t\tinvalidSelection: false,\n\t\t\t};\n\t\t}, [] );\n\n\t\tif ( invalidSelection ) {\n\t\t\treturn {\n\t\t\t\tisLoading: false,\n\t\t\t\tcommands: [],\n\t\t\t};\n\t\t}\n\t\tconst isTemplate = blocks.length === 1 && isTemplatePart( blocks[ 0 ] );\n\n\t\tfunction selectForMultipleBlocks( insertedBlocks ) {\n\t\t\tif ( insertedBlocks.length > 1 ) {\n\t\t\t\tmultiSelect(\n\t\t\t\t\tinsertedBlocks[ 0 ].clientId,\n\t\t\t\t\tinsertedBlocks[ insertedBlocks.length - 1 ].clientId\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// Simple block tranformation based on the `Block Transforms` API.\n\t\tfunction onBlockTransform( name ) {\n\t\t\tconst newBlocks = switchToBlockType( blocks, name );\n\t\t\treplaceBlocks( clientIds, newBlocks );\n\t\t\tselectForMultipleBlocks( newBlocks );\n\t\t}\n\n\t\t/**\n\t\t * The `isTemplate` check is a stopgap solution here.\n\t\t * Ideally, the Transforms API should handle this\n\t\t * by allowing to exclude blocks from wildcard transformations.\n\t\t */\n\t\tconst hasPossibleBlockTransformations =\n\t\t\t!! possibleBlockTransformations.length && canRemove && ! isTemplate;\n\n\t\tif (\n\t\t\t! clientIds ||\n\t\t\tclientIds.length < 1 ||\n\t\t\t! hasPossibleBlockTransformations\n\t\t) {\n\t\t\treturn { isLoading: false, commands: [] };\n\t\t}\n\n\t\tconst commands = possibleBlockTransformations.map(\n\t\t\t( transformation ) => {\n\t\t\t\tconst { name, title, icon } = transformation;\n\t\t\t\treturn {\n\t\t\t\t\tname:\n\t\t\t\t\t\t'core/block-editor/transform-to-' +\n\t\t\t\t\t\tname.replace( '/', '-' ),\n\t\t\t\t\t/* translators: %s: Block or block variation name. */\n\t\t\t\t\tlabel: sprintf( __( 'Transform to %s' ), title ),\n\t\t\t\t\ticon: <BlockIcon icon={ icon } />,\n\t\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\t\tonBlockTransform( name );\n\t\t\t\t\t\tclose();\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t}\n\t\t);\n\n\t\treturn { isLoading: false, commands };\n\t};\n\nconst getQuickActionsCommands = () =>\n\tfunction useQuickActionsCommands() {\n\t\tconst { clientIds, isUngroupable, isGroupable } = useSelect(\n\t\t\t( select ) => {\n\t\t\t\tconst {\n\t\t\t\t\tgetSelectedBlockClientIds,\n\t\t\t\t\tisUngroupable: _isUngroupable,\n\t\t\t\t\tisGroupable: _isGroupable,\n\t\t\t\t} = select( blockEditorStore );\n\t\t\t\tconst selectedBlockClientIds = getSelectedBlockClientIds();\n\n\t\t\t\treturn {\n\t\t\t\t\tclientIds: selectedBlockClientIds,\n\t\t\t\t\tisUngroupable: _isUngroupable(),\n\t\t\t\t\tisGroupable: _isGroupable(),\n\t\t\t\t};\n\t\t\t},\n\t\t\t[]\n\t\t);\n\t\tconst {\n\t\t\tcanInsertBlockType,\n\t\t\tgetBlockRootClientId,\n\t\t\tgetBlocksByClientId,\n\t\t\tcanRemoveBlocks,\n\t\t} = useSelect( blockEditorStore );\n\t\tconst { getDefaultBlockName, getGroupingBlockName } =\n\t\t\tuseSelect( blocksStore );\n\n\t\tconst blocks = getBlocksByClientId( clientIds );\n\n\t\tconst {\n\t\t\tremoveBlocks,\n\t\t\treplaceBlocks,\n\t\t\tduplicateBlocks,\n\t\t\tinsertAfterBlock,\n\t\t\tinsertBeforeBlock,\n\t\t} = useDispatch( blockEditorStore );\n\n\t\tconst onGroup = () => {\n\t\t\tif ( ! blocks.length ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst groupingBlockName = getGroupingBlockName();\n\n\t\t\t// Activate the `transform` on `core/group` which does the conversion.\n\t\t\tconst newBlocks = switchToBlockType( blocks, groupingBlockName );\n\n\t\t\tif ( ! newBlocks ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treplaceBlocks( clientIds, newBlocks );\n\t\t};\n\t\tconst onUngroup = () => {\n\t\t\tif ( ! blocks.length ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst innerBlocks = blocks[ 0 ].innerBlocks;\n\n\t\t\tif ( ! innerBlocks.length ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\treplaceBlocks( clientIds, innerBlocks );\n\t\t};\n\n\t\tif ( ! clientIds || clientIds.length < 1 ) {\n\t\t\treturn { isLoading: false, commands: [] };\n\t\t}\n\n\t\tconst rootClientId = getBlockRootClientId( clientIds[ 0 ] );\n\t\tconst canInsertDefaultBlock = canInsertBlockType(\n\t\t\tgetDefaultBlockName(),\n\t\t\trootClientId\n\t\t);\n\t\tconst canDuplicate = blocks.every( ( block ) => {\n\t\t\treturn (\n\t\t\t\t!! block &&\n\t\t\t\thasBlockSupport( block.name, 'multiple', true ) &&\n\t\t\t\tcanInsertBlockType( block.name, rootClientId )\n\t\t\t);\n\t\t} );\n\t\tconst canRemove = canRemoveBlocks( clientIds );\n\n\t\tconst commands = [];\n\n\t\tif ( canDuplicate ) {\n\t\t\tcommands.push( {\n\t\t\t\tname: 'duplicate',\n\t\t\t\tlabel: __( 'Duplicate' ),\n\t\t\t\tcallback: () => duplicateBlocks( clientIds, true ),\n\t\t\t\ticon: copy,\n\t\t\t} );\n\t\t}\n\n\t\tif ( canInsertDefaultBlock ) {\n\t\t\tcommands.push(\n\t\t\t\t{\n\t\t\t\t\tname: 'add-before',\n\t\t\t\t\tlabel: __( 'Add before' ),\n\t\t\t\t\tcallback: () => {\n\t\t\t\t\t\tconst clientId = Array.isArray( clientIds )\n\t\t\t\t\t\t\t? clientIds[ 0 ]\n\t\t\t\t\t\t\t: clientId;\n\t\t\t\t\t\tinsertBeforeBlock( clientId );\n\t\t\t\t\t},\n\t\t\t\t\ticon: add,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'add-after',\n\t\t\t\t\tlabel: __( 'Add after' ),\n\t\t\t\t\tcallback: () => {\n\t\t\t\t\t\tconst clientId = Array.isArray( clientIds )\n\t\t\t\t\t\t\t? clientIds[ clientIds.length - 1 ]\n\t\t\t\t\t\t\t: clientId;\n\t\t\t\t\t\tinsertAfterBlock( clientId );\n\t\t\t\t\t},\n\t\t\t\t\ticon: add,\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\n\t\tif ( isGroupable ) {\n\t\t\tcommands.push( {\n\t\t\t\tname: 'Group',\n\t\t\t\tlabel: __( 'Group' ),\n\t\t\t\tcallback: onGroup,\n\t\t\t\ticon: group,\n\t\t\t} );\n\t\t}\n\n\t\tif ( isUngroupable ) {\n\t\t\tcommands.push( {\n\t\t\t\tname: 'ungroup',\n\t\t\t\tlabel: __( 'Ungroup' ),\n\t\t\t\tcallback: onUngroup,\n\t\t\t\ticon: ungroup,\n\t\t\t} );\n\t\t}\n\n\t\tif ( canRemove ) {\n\t\t\tcommands.push( {\n\t\t\t\tname: 'remove',\n\t\t\t\tlabel: __( 'Delete' ),\n\t\t\t\tcallback: () => removeBlocks( clientIds, true ),\n\t\t\t\ticon: remove,\n\t\t\t} );\n\t\t}\n\n\t\treturn {\n\t\t\tisLoading: false,\n\t\t\tcommands: commands.map( ( command ) => ( {\n\t\t\t\t...command,\n\t\t\t\tname: 'core/block-editor/action-' + command.name,\n\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\tcommand.callback();\n\t\t\t\t\tclose();\n\t\t\t\t},\n\t\t\t} ) ),\n\t\t};\n\t};\n\nexport const useBlockCommands = () => {\n\tuseCommandLoader( {\n\t\tname: 'core/block-editor/blockTransforms',\n\t\thook: getTransformCommands(),\n\t} );\n\tuseCommandLoader( {\n\t\tname: 'core/block-editor/blockQuickActions',\n\t\thook: getQuickActionsCommands(),\n\t\tcontext: 'block-selection-edit',\n\t} );\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA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 import { useHasBorderPanel, useHasBorderPanelControls, BorderPanel as StylesBord
23
23
  import { store as blockEditorStore } from '../store';
24
24
  import { __ } from '@wordpress/i18n';
25
25
  import { jsx as _jsx } from "react/jsx-runtime";
26
- export const BORDER_SUPPORT_KEY = '__experimentalBorder';
26
+ export const BORDER_SUPPORT_KEY = 'border';
27
27
  export const SHADOW_SUPPORT_KEY = 'shadow';
28
28
  const getColorByProperty = (colors, property, value) => {
29
29
  let matchedColor;
@@ -156,8 +156,8 @@ export function BorderPanel({
156
156
  return null;
157
157
  }
158
158
  const defaultControls = {
159
- ...getBlockSupport(name, [BORDER_SUPPORT_KEY, '__experimentalDefaultControls']),
160
- ...getBlockSupport(name, [SHADOW_SUPPORT_KEY, '__experimentalDefaultControls'])
159
+ ...getBlockSupport(name, [BORDER_SUPPORT_KEY, 'defaultControls']),
160
+ ...getBlockSupport(name, [SHADOW_SUPPORT_KEY, 'defaultControls'])
161
161
  };
162
162
  return /*#__PURE__*/_jsx(StylesBorderPanel, {
163
163
  as: BordersInspectorControl,
@@ -1 +1 @@
1
- {"version":3,"names":["clsx","hasBlockSupport","getBlockSupport","__experimentalHasSplitBorders","hasSplitBorders","Platform","useCallback","useMemo","addFilter","useSelect","getColorClassName","InspectorControls","useMultipleOriginColorsAndGradients","cleanEmptyObject","shouldSkipSerialization","useBlockSettings","useHasBorderPanel","useHasBorderPanelControls","BorderPanel","StylesBorderPanel","store","blockEditorStore","__","jsx","_jsx","BORDER_SUPPORT_KEY","SHADOW_SUPPORT_KEY","getColorByProperty","colors","property","value","matchedColor","some","origin","color","getMultiOriginColor","namedColor","customColor","colorObject","undefined","getColorSlugFromVariable","exec","styleToAttributes","style","border","borderColor","borderColorValue","borderColorSlug","startsWith","substring","length","updatedStyle","attributesToStyle","attributes","BordersInspectorControl","label","children","resetAllFilter","attributesResetAllFilter","existingStyle","group","clientId","name","setAttributes","settings","isEnabled","selector","select","getBlockAttributes","onChange","newStyle","defaultControls","as","panelId","hasBorderSupport","blockName","feature","OS","support","radius","width","hasShadowSupport","useBorderPanelLabel","hasBorderControl","hasShadowControl","controls","hasBorderColor","hasBorderStyle","hasBorderWidth","hasBorderRadius","hasShadow","removeBorderAttribute","attribute","addAttributes","type","addSaveProps","props","blockNameOrType","borderClasses","getBorderClasses","newClassName","className","borderColorClass","useBlockProps","borderTopColor","top","borderRightColor","right","borderBottomColor","bottom","borderLeftColor","left","extraStyles","attributeKeys","hasSupport"],"sources":["@wordpress/block-editor/src/hooks/border.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { hasBlockSupport, getBlockSupport } from '@wordpress/blocks';\nimport { __experimentalHasSplitBorders as hasSplitBorders } from '@wordpress/components';\nimport { Platform, useCallback, useMemo } from '@wordpress/element';\nimport { addFilter } from '@wordpress/hooks';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { getColorClassName } from '../components/colors';\nimport InspectorControls from '../components/inspector-controls';\nimport useMultipleOriginColorsAndGradients from '../components/colors-gradients/use-multiple-origin-colors-and-gradients';\nimport {\n\tcleanEmptyObject,\n\tshouldSkipSerialization,\n\tuseBlockSettings,\n} from './utils';\nimport {\n\tuseHasBorderPanel,\n\tuseHasBorderPanelControls,\n\tBorderPanel as StylesBorderPanel,\n} from '../components/global-styles';\nimport { store as blockEditorStore } from '../store';\nimport { __ } from '@wordpress/i18n';\n\nexport const BORDER_SUPPORT_KEY = '__experimentalBorder';\nexport const SHADOW_SUPPORT_KEY = 'shadow';\n\nconst getColorByProperty = ( colors, property, value ) => {\n\tlet matchedColor;\n\n\tcolors.some( ( origin ) =>\n\t\torigin.colors.some( ( color ) => {\n\t\t\tif ( color[ property ] === value ) {\n\t\t\t\tmatchedColor = color;\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t} )\n\t);\n\n\treturn matchedColor;\n};\n\nexport const getMultiOriginColor = ( { colors, namedColor, customColor } ) => {\n\t// Search each origin (default, theme, or user) for matching color by name.\n\tif ( namedColor ) {\n\t\tconst colorObject = getColorByProperty( colors, 'slug', namedColor );\n\t\tif ( colorObject ) {\n\t\t\treturn colorObject;\n\t\t}\n\t}\n\n\t// Skip if no custom color or matching named color.\n\tif ( ! customColor ) {\n\t\treturn { color: undefined };\n\t}\n\n\t// Attempt to find color via custom color value or build new object.\n\tconst colorObject = getColorByProperty( colors, 'color', customColor );\n\treturn colorObject ? colorObject : { color: customColor };\n};\n\nfunction getColorSlugFromVariable( value ) {\n\tconst namedColor = /var:preset\\|color\\|(.+)/.exec( value );\n\tif ( namedColor && namedColor[ 1 ] ) {\n\t\treturn namedColor[ 1 ];\n\t}\n\treturn null;\n}\n\nfunction styleToAttributes( style ) {\n\tif ( hasSplitBorders( style?.border ) ) {\n\t\treturn {\n\t\t\tstyle,\n\t\t\tborderColor: undefined,\n\t\t};\n\t}\n\n\tconst borderColorValue = style?.border?.color;\n\tconst borderColorSlug = borderColorValue?.startsWith( 'var:preset|color|' )\n\t\t? borderColorValue.substring( 'var:preset|color|'.length )\n\t\t: undefined;\n\tconst updatedStyle = { ...style };\n\tupdatedStyle.border = {\n\t\t...updatedStyle.border,\n\t\tcolor: borderColorSlug ? undefined : borderColorValue,\n\t};\n\treturn {\n\t\tstyle: cleanEmptyObject( updatedStyle ),\n\t\tborderColor: borderColorSlug,\n\t};\n}\n\nfunction attributesToStyle( attributes ) {\n\tif ( hasSplitBorders( attributes.style?.border ) ) {\n\t\treturn attributes.style;\n\t}\n\treturn {\n\t\t...attributes.style,\n\t\tborder: {\n\t\t\t...attributes.style?.border,\n\t\t\tcolor: attributes.borderColor\n\t\t\t\t? 'var:preset|color|' + attributes.borderColor\n\t\t\t\t: attributes.style?.border?.color,\n\t\t},\n\t};\n}\n\nfunction BordersInspectorControl( { label, children, resetAllFilter } ) {\n\tconst attributesResetAllFilter = useCallback(\n\t\t( attributes ) => {\n\t\t\tconst existingStyle = attributesToStyle( attributes );\n\t\t\tconst updatedStyle = resetAllFilter( existingStyle );\n\t\t\treturn {\n\t\t\t\t...attributes,\n\t\t\t\t...styleToAttributes( updatedStyle ),\n\t\t\t};\n\t\t},\n\t\t[ resetAllFilter ]\n\t);\n\n\treturn (\n\t\t<InspectorControls\n\t\t\tgroup=\"border\"\n\t\t\tresetAllFilter={ attributesResetAllFilter }\n\t\t\tlabel={ label }\n\t\t>\n\t\t\t{ children }\n\t\t</InspectorControls>\n\t);\n}\n\nexport function BorderPanel( { clientId, name, setAttributes, settings } ) {\n\tconst isEnabled = useHasBorderPanel( settings );\n\tfunction selector( select ) {\n\t\tconst { style, borderColor } =\n\t\t\tselect( blockEditorStore ).getBlockAttributes( clientId ) || {};\n\t\treturn { style, borderColor };\n\t}\n\tconst { style, borderColor } = useSelect( selector, [ clientId ] );\n\tconst value = useMemo( () => {\n\t\treturn attributesToStyle( { style, borderColor } );\n\t}, [ style, borderColor ] );\n\n\tconst onChange = ( newStyle ) => {\n\t\tsetAttributes( styleToAttributes( newStyle ) );\n\t};\n\n\tif ( ! isEnabled ) {\n\t\treturn null;\n\t}\n\n\tconst defaultControls = {\n\t\t...getBlockSupport( name, [\n\t\t\tBORDER_SUPPORT_KEY,\n\t\t\t'__experimentalDefaultControls',\n\t\t] ),\n\t\t...getBlockSupport( name, [\n\t\t\tSHADOW_SUPPORT_KEY,\n\t\t\t'__experimentalDefaultControls',\n\t\t] ),\n\t};\n\n\treturn (\n\t\t<StylesBorderPanel\n\t\t\tas={ BordersInspectorControl }\n\t\t\tpanelId={ clientId }\n\t\t\tsettings={ settings }\n\t\t\tvalue={ value }\n\t\t\tonChange={ onChange }\n\t\t\tdefaultControls={ defaultControls }\n\t\t/>\n\t);\n}\n\n/**\n * Determine whether there is block support for border properties.\n *\n * @param {string} blockName Block name.\n * @param {string} feature Border feature to check support for.\n *\n * @return {boolean} Whether there is support.\n */\nexport function hasBorderSupport( blockName, feature = 'any' ) {\n\tif ( Platform.OS !== 'web' ) {\n\t\treturn false;\n\t}\n\n\tconst support = getBlockSupport( blockName, BORDER_SUPPORT_KEY );\n\n\tif ( support === true ) {\n\t\treturn true;\n\t}\n\n\tif ( feature === 'any' ) {\n\t\treturn !! (\n\t\t\tsupport?.color ||\n\t\t\tsupport?.radius ||\n\t\t\tsupport?.width ||\n\t\t\tsupport?.style\n\t\t);\n\t}\n\n\treturn !! support?.[ feature ];\n}\n\n/**\n * Determine whether there is block support for shadow properties.\n *\n * @param {string} blockName Block name.\n *\n * @return {boolean} Whether there is support.\n */\nexport function hasShadowSupport( blockName ) {\n\treturn hasBlockSupport( blockName, SHADOW_SUPPORT_KEY );\n}\n\nexport function useBorderPanelLabel( {\n\tblockName,\n\thasBorderControl,\n\thasShadowControl,\n} = {} ) {\n\tconst settings = useBlockSettings( blockName );\n\tconst controls = useHasBorderPanelControls( settings );\n\n\tif ( ! hasBorderControl && ! hasShadowControl && blockName ) {\n\t\thasBorderControl =\n\t\t\tcontrols?.hasBorderColor ||\n\t\t\tcontrols?.hasBorderStyle ||\n\t\t\tcontrols?.hasBorderWidth ||\n\t\t\tcontrols?.hasBorderRadius;\n\t\thasShadowControl = controls?.hasShadow;\n\t}\n\n\tif ( hasBorderControl && hasShadowControl ) {\n\t\treturn __( 'Border & Shadow' );\n\t}\n\n\tif ( hasShadowControl ) {\n\t\treturn __( 'Shadow' );\n\t}\n\n\treturn __( 'Border' );\n}\n\n/**\n * Returns a new style object where the specified border attribute has been\n * removed.\n *\n * @param {Object} style Styles from block attributes.\n * @param {string} attribute The border style attribute to clear.\n *\n * @return {Object} Style object with the specified attribute removed.\n */\nexport function removeBorderAttribute( style, attribute ) {\n\treturn cleanEmptyObject( {\n\t\t...style,\n\t\tborder: {\n\t\t\t...style?.border,\n\t\t\t[ attribute ]: undefined,\n\t\t},\n\t} );\n}\n\n/**\n * Filters registered block settings, extending attributes to include\n * `borderColor` if needed.\n *\n * @param {Object} settings Original block settings.\n *\n * @return {Object} Updated block settings.\n */\nfunction addAttributes( settings ) {\n\tif ( ! hasBorderSupport( settings, 'color' ) ) {\n\t\treturn settings;\n\t}\n\n\t// Allow blocks to specify default value if needed.\n\tif ( settings.attributes.borderColor ) {\n\t\treturn settings;\n\t}\n\n\t// Add new borderColor attribute to block settings.\n\treturn {\n\t\t...settings,\n\t\tattributes: {\n\t\t\t...settings.attributes,\n\t\t\tborderColor: {\n\t\t\t\ttype: 'string',\n\t\t\t},\n\t\t},\n\t};\n}\n\n/**\n * Override props assigned to save component to inject border color.\n *\n * @param {Object} props Additional props applied to save element.\n * @param {Object|string} blockNameOrType Block type definition.\n * @param {Object} attributes Block's attributes.\n *\n * @return {Object} Filtered props to apply to save element.\n */\nfunction addSaveProps( props, blockNameOrType, attributes ) {\n\tif (\n\t\t! hasBorderSupport( blockNameOrType, 'color' ) ||\n\t\tshouldSkipSerialization( blockNameOrType, BORDER_SUPPORT_KEY, 'color' )\n\t) {\n\t\treturn props;\n\t}\n\n\tconst borderClasses = getBorderClasses( attributes );\n\tconst newClassName = clsx( props.className, borderClasses );\n\n\t// If we are clearing the last of the previous classes in `className`\n\t// set it to `undefined` to avoid rendering empty DOM attributes.\n\tprops.className = newClassName ? newClassName : undefined;\n\n\treturn props;\n}\n\n/**\n * Generates a CSS class name consisting of all the applicable border color\n * classes given the current block attributes.\n *\n * @param {Object} attributes Block's attributes.\n *\n * @return {string} CSS class name.\n */\nexport function getBorderClasses( attributes ) {\n\tconst { borderColor, style } = attributes;\n\tconst borderColorClass = getColorClassName( 'border-color', borderColor );\n\n\treturn clsx( {\n\t\t'has-border-color': borderColor || style?.border?.color,\n\t\t[ borderColorClass ]: !! borderColorClass,\n\t} );\n}\n\nfunction useBlockProps( { name, borderColor, style } ) {\n\tconst { colors } = useMultipleOriginColorsAndGradients();\n\n\tif (\n\t\t! hasBorderSupport( name, 'color' ) ||\n\t\tshouldSkipSerialization( name, BORDER_SUPPORT_KEY, 'color' )\n\t) {\n\t\treturn {};\n\t}\n\n\tconst { color: borderColorValue } = getMultiOriginColor( {\n\t\tcolors,\n\t\tnamedColor: borderColor,\n\t} );\n\tconst { color: borderTopColor } = getMultiOriginColor( {\n\t\tcolors,\n\t\tnamedColor: getColorSlugFromVariable( style?.border?.top?.color ),\n\t} );\n\tconst { color: borderRightColor } = getMultiOriginColor( {\n\t\tcolors,\n\t\tnamedColor: getColorSlugFromVariable( style?.border?.right?.color ),\n\t} );\n\n\tconst { color: borderBottomColor } = getMultiOriginColor( {\n\t\tcolors,\n\t\tnamedColor: getColorSlugFromVariable( style?.border?.bottom?.color ),\n\t} );\n\tconst { color: borderLeftColor } = getMultiOriginColor( {\n\t\tcolors,\n\t\tnamedColor: getColorSlugFromVariable( style?.border?.left?.color ),\n\t} );\n\n\tconst extraStyles = {\n\t\tborderTopColor: borderTopColor || borderColorValue,\n\t\tborderRightColor: borderRightColor || borderColorValue,\n\t\tborderBottomColor: borderBottomColor || borderColorValue,\n\t\tborderLeftColor: borderLeftColor || borderColorValue,\n\t};\n\n\treturn addSaveProps(\n\t\t{ style: cleanEmptyObject( extraStyles ) || {} },\n\t\tname,\n\t\t{ borderColor, style }\n\t);\n}\n\nexport default {\n\tuseBlockProps,\n\taddSaveProps,\n\tattributeKeys: [ 'borderColor', 'style' ],\n\thasSupport( name ) {\n\t\treturn hasBorderSupport( name, 'color' );\n\t},\n};\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/border/addAttributes',\n\taddAttributes\n);\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,eAAe,EAAEC,eAAe,QAAQ,mBAAmB;AACpE,SAASC,6BAA6B,IAAIC,eAAe,QAAQ,uBAAuB;AACxF,SAASC,QAAQ,EAAEC,WAAW,EAAEC,OAAO,QAAQ,oBAAoB;AACnE,SAASC,SAAS,QAAQ,kBAAkB;AAC5C,SAASC,SAAS,QAAQ,iBAAiB;;AAE3C;AACA;AACA;AACA,SAASC,iBAAiB,QAAQ,sBAAsB;AACxD,OAAOC,iBAAiB,MAAM,k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ACrC,CAAC;EAED,OAAOiD,YAAY,CAClB;IAAEpD,KAAK,EAAE9B,gBAAgB,CAAEmG,WAAY,CAAC,IAAI,CAAC;EAAE,CAAC,EAChDlD,IAAI,EACJ;IAAEjB,WAAW;IAAEF;EAAM,CACtB,CAAC;AACF;AAEA,eAAe;EACd4D,aAAa;EACbR,YAAY;EACZkB,aAAa,EAAE,CAAE,aAAa,EAAE,OAAO,CAAE;EACzCC,UAAUA,CAAEpD,IAAI,EAAG;IAClB,OAAOY,gBAAgB,CAAEZ,IAAI,EAAE,OAAQ,CAAC;EACzC;AACD,CAAC;AAEDtD,SAAS,CACR,0BAA0B,EAC1B,2BAA2B,EAC3BqF,aACD,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["clsx","hasBlockSupport","getBlockSupport","__experimentalHasSplitBorders","hasSplitBorders","Platform","useCallback","useMemo","addFilter","useSelect","getColorClassName","InspectorControls","useMultipleOriginColorsAndGradients","cleanEmptyObject","shouldSkipSerialization","useBlockSettings","useHasBorderPanel","useHasBorderPanelControls","BorderPanel","StylesBorderPanel","store","blockEditorStore","__","jsx","_jsx","BORDER_SUPPORT_KEY","SHADOW_SUPPORT_KEY","getColorByProperty","colors","property","value","matchedColor","some","origin","color","getMultiOriginColor","namedColor","customColor","colorObject","undefined","getColorSlugFromVariable","exec","styleToAttributes","style","border","borderColor","borderColorValue","borderColorSlug","startsWith","substring","length","updatedStyle","attributesToStyle","attributes","BordersInspectorControl","label","children","resetAllFilter","attributesResetAllFilter","existingStyle","group","clientId","name","setAttributes","settings","isEnabled","selector","select","getBlockAttributes","onChange","newStyle","defaultControls","as","panelId","hasBorderSupport","blockName","feature","OS","support","radius","width","hasShadowSupport","useBorderPanelLabel","hasBorderControl","hasShadowControl","controls","hasBorderColor","hasBorderStyle","hasBorderWidth","hasBorderRadius","hasShadow","removeBorderAttribute","attribute","addAttributes","type","addSaveProps","props","blockNameOrType","borderClasses","getBorderClasses","newClassName","className","borderColorClass","useBlockProps","borderTopColor","top","borderRightColor","right","borderBottomColor","bottom","borderLeftColor","left","extraStyles","attributeKeys","hasSupport"],"sources":["@wordpress/block-editor/src/hooks/border.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { hasBlockSupport, getBlockSupport } from '@wordpress/blocks';\nimport { __experimentalHasSplitBorders as hasSplitBorders } from '@wordpress/components';\nimport { Platform, useCallback, useMemo } from '@wordpress/element';\nimport { addFilter } from '@wordpress/hooks';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { getColorClassName } from '../components/colors';\nimport InspectorControls from '../components/inspector-controls';\nimport useMultipleOriginColorsAndGradients from '../components/colors-gradients/use-multiple-origin-colors-and-gradients';\nimport {\n\tcleanEmptyObject,\n\tshouldSkipSerialization,\n\tuseBlockSettings,\n} from './utils';\nimport {\n\tuseHasBorderPanel,\n\tuseHasBorderPanelControls,\n\tBorderPanel as StylesBorderPanel,\n} from '../components/global-styles';\nimport { store as blockEditorStore } from '../store';\nimport { __ } from '@wordpress/i18n';\n\nexport const BORDER_SUPPORT_KEY = 'border';\nexport const SHADOW_SUPPORT_KEY = 'shadow';\n\nconst getColorByProperty = ( colors, property, value ) => {\n\tlet matchedColor;\n\n\tcolors.some( ( origin ) =>\n\t\torigin.colors.some( ( color ) => {\n\t\t\tif ( color[ property ] === value ) {\n\t\t\t\tmatchedColor = color;\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t} )\n\t);\n\n\treturn matchedColor;\n};\n\nexport const getMultiOriginColor = ( { colors, namedColor, customColor } ) => {\n\t// Search each origin (default, theme, or user) for matching color by name.\n\tif ( namedColor ) {\n\t\tconst colorObject = getColorByProperty( colors, 'slug', namedColor );\n\t\tif ( colorObject ) {\n\t\t\treturn colorObject;\n\t\t}\n\t}\n\n\t// Skip if no custom color or matching named color.\n\tif ( ! customColor ) {\n\t\treturn { color: undefined };\n\t}\n\n\t// Attempt to find color via custom color value or build new object.\n\tconst colorObject = getColorByProperty( colors, 'color', customColor );\n\treturn colorObject ? colorObject : { color: customColor };\n};\n\nfunction getColorSlugFromVariable( value ) {\n\tconst namedColor = /var:preset\\|color\\|(.+)/.exec( value );\n\tif ( namedColor && namedColor[ 1 ] ) {\n\t\treturn namedColor[ 1 ];\n\t}\n\treturn null;\n}\n\nfunction styleToAttributes( style ) {\n\tif ( hasSplitBorders( style?.border ) ) {\n\t\treturn {\n\t\t\tstyle,\n\t\t\tborderColor: undefined,\n\t\t};\n\t}\n\n\tconst borderColorValue = style?.border?.color;\n\tconst borderColorSlug = borderColorValue?.startsWith( 'var:preset|color|' )\n\t\t? borderColorValue.substring( 'var:preset|color|'.length )\n\t\t: undefined;\n\tconst updatedStyle = { ...style };\n\tupdatedStyle.border = {\n\t\t...updatedStyle.border,\n\t\tcolor: borderColorSlug ? undefined : borderColorValue,\n\t};\n\treturn {\n\t\tstyle: cleanEmptyObject( updatedStyle ),\n\t\tborderColor: borderColorSlug,\n\t};\n}\n\nfunction attributesToStyle( attributes ) {\n\tif ( hasSplitBorders( attributes.style?.border ) ) {\n\t\treturn attributes.style;\n\t}\n\treturn {\n\t\t...attributes.style,\n\t\tborder: {\n\t\t\t...attributes.style?.border,\n\t\t\tcolor: attributes.borderColor\n\t\t\t\t? 'var:preset|color|' + attributes.borderColor\n\t\t\t\t: attributes.style?.border?.color,\n\t\t},\n\t};\n}\n\nfunction BordersInspectorControl( { label, children, resetAllFilter } ) {\n\tconst attributesResetAllFilter = useCallback(\n\t\t( attributes ) => {\n\t\t\tconst existingStyle = attributesToStyle( attributes );\n\t\t\tconst updatedStyle = resetAllFilter( existingStyle );\n\t\t\treturn {\n\t\t\t\t...attributes,\n\t\t\t\t...styleToAttributes( updatedStyle ),\n\t\t\t};\n\t\t},\n\t\t[ resetAllFilter ]\n\t);\n\n\treturn (\n\t\t<InspectorControls\n\t\t\tgroup=\"border\"\n\t\t\tresetAllFilter={ attributesResetAllFilter }\n\t\t\tlabel={ label }\n\t\t>\n\t\t\t{ children }\n\t\t</InspectorControls>\n\t);\n}\n\nexport function BorderPanel( { clientId, name, setAttributes, settings } ) {\n\tconst isEnabled = useHasBorderPanel( settings );\n\tfunction selector( select ) {\n\t\tconst { style, borderColor } =\n\t\t\tselect( blockEditorStore ).getBlockAttributes( clientId ) || {};\n\t\treturn { style, borderColor };\n\t}\n\tconst { style, borderColor } = useSelect( selector, [ clientId ] );\n\tconst value = useMemo( () => {\n\t\treturn attributesToStyle( { style, borderColor } );\n\t}, [ style, borderColor ] );\n\n\tconst onChange = ( newStyle ) => {\n\t\tsetAttributes( styleToAttributes( newStyle ) );\n\t};\n\n\tif ( ! isEnabled ) {\n\t\treturn null;\n\t}\n\n\tconst defaultControls = {\n\t\t...getBlockSupport( name, [ BORDER_SUPPORT_KEY, 'defaultControls' ] ),\n\t\t...getBlockSupport( name, [ SHADOW_SUPPORT_KEY, 'defaultControls' ] ),\n\t};\n\n\treturn (\n\t\t<StylesBorderPanel\n\t\t\tas={ BordersInspectorControl }\n\t\t\tpanelId={ clientId }\n\t\t\tsettings={ settings }\n\t\t\tvalue={ value }\n\t\t\tonChange={ onChange }\n\t\t\tdefaultControls={ defaultControls }\n\t\t/>\n\t);\n}\n\n/**\n * Determine whether there is block support for border properties.\n *\n * @param {string} blockName Block name.\n * @param {string} feature Border feature to check support for.\n *\n * @return {boolean} Whether there is support.\n */\nexport function hasBorderSupport( blockName, feature = 'any' ) {\n\tif ( Platform.OS !== 'web' ) {\n\t\treturn false;\n\t}\n\n\tconst support = getBlockSupport( blockName, BORDER_SUPPORT_KEY );\n\n\tif ( support === true ) {\n\t\treturn true;\n\t}\n\n\tif ( feature === 'any' ) {\n\t\treturn !! (\n\t\t\tsupport?.color ||\n\t\t\tsupport?.radius ||\n\t\t\tsupport?.width ||\n\t\t\tsupport?.style\n\t\t);\n\t}\n\n\treturn !! support?.[ feature ];\n}\n\n/**\n * Determine whether there is block support for shadow properties.\n *\n * @param {string} blockName Block name.\n *\n * @return {boolean} Whether there is support.\n */\nexport function hasShadowSupport( blockName ) {\n\treturn hasBlockSupport( blockName, SHADOW_SUPPORT_KEY );\n}\n\nexport function useBorderPanelLabel( {\n\tblockName,\n\thasBorderControl,\n\thasShadowControl,\n} = {} ) {\n\tconst settings = useBlockSettings( blockName );\n\tconst controls = useHasBorderPanelControls( settings );\n\n\tif ( ! hasBorderControl && ! hasShadowControl && blockName ) {\n\t\thasBorderControl =\n\t\t\tcontrols?.hasBorderColor ||\n\t\t\tcontrols?.hasBorderStyle ||\n\t\t\tcontrols?.hasBorderWidth ||\n\t\t\tcontrols?.hasBorderRadius;\n\t\thasShadowControl = controls?.hasShadow;\n\t}\n\n\tif ( hasBorderControl && hasShadowControl ) {\n\t\treturn __( 'Border & Shadow' );\n\t}\n\n\tif ( hasShadowControl ) {\n\t\treturn __( 'Shadow' );\n\t}\n\n\treturn __( 'Border' );\n}\n\n/**\n * Returns a new style object where the specified border attribute has been\n * removed.\n *\n * @param {Object} style Styles from block attributes.\n * @param {string} attribute The border style attribute to clear.\n *\n * @return {Object} Style object with the specified attribute removed.\n */\nexport function removeBorderAttribute( style, attribute ) {\n\treturn cleanEmptyObject( {\n\t\t...style,\n\t\tborder: {\n\t\t\t...style?.border,\n\t\t\t[ attribute ]: undefined,\n\t\t},\n\t} );\n}\n\n/**\n * Filters registered block settings, extending attributes to include\n * `borderColor` if needed.\n *\n * @param {Object} settings Original block settings.\n *\n * @return {Object} Updated block settings.\n */\nfunction addAttributes( settings ) {\n\tif ( ! hasBorderSupport( settings, 'color' ) ) {\n\t\treturn settings;\n\t}\n\n\t// Allow blocks to specify default value if needed.\n\tif ( settings.attributes.borderColor ) {\n\t\treturn settings;\n\t}\n\n\t// Add new borderColor attribute to block settings.\n\treturn {\n\t\t...settings,\n\t\tattributes: {\n\t\t\t...settings.attributes,\n\t\t\tborderColor: {\n\t\t\t\ttype: 'string',\n\t\t\t},\n\t\t},\n\t};\n}\n\n/**\n * Override props assigned to save component to inject border color.\n *\n * @param {Object} props Additional props applied to save element.\n * @param {Object|string} blockNameOrType Block type definition.\n * @param {Object} attributes Block's attributes.\n *\n * @return {Object} Filtered props to apply to save element.\n */\nfunction addSaveProps( props, blockNameOrType, attributes ) {\n\tif (\n\t\t! hasBorderSupport( blockNameOrType, 'color' ) ||\n\t\tshouldSkipSerialization( blockNameOrType, BORDER_SUPPORT_KEY, 'color' )\n\t) {\n\t\treturn props;\n\t}\n\n\tconst borderClasses = getBorderClasses( attributes );\n\tconst newClassName = clsx( props.className, borderClasses );\n\n\t// If we are clearing the last of the previous classes in `className`\n\t// set it to `undefined` to avoid rendering empty DOM attributes.\n\tprops.className = newClassName ? newClassName : undefined;\n\n\treturn props;\n}\n\n/**\n * Generates a CSS class name consisting of all the applicable border color\n * classes given the current block attributes.\n *\n * @param {Object} attributes Block's attributes.\n *\n * @return {string} CSS class name.\n */\nexport function getBorderClasses( attributes ) {\n\tconst { borderColor, style } = attributes;\n\tconst borderColorClass = getColorClassName( 'border-color', borderColor );\n\n\treturn clsx( {\n\t\t'has-border-color': borderColor || style?.border?.color,\n\t\t[ borderColorClass ]: !! borderColorClass,\n\t} );\n}\n\nfunction useBlockProps( { name, borderColor, style } ) {\n\tconst { colors } = useMultipleOriginColorsAndGradients();\n\n\tif (\n\t\t! hasBorderSupport( name, 'color' ) ||\n\t\tshouldSkipSerialization( name, BORDER_SUPPORT_KEY, 'color' )\n\t) {\n\t\treturn {};\n\t}\n\n\tconst { color: borderColorValue } = getMultiOriginColor( {\n\t\tcolors,\n\t\tnamedColor: borderColor,\n\t} );\n\tconst { color: borderTopColor } = getMultiOriginColor( {\n\t\tcolors,\n\t\tnamedColor: getColorSlugFromVariable( style?.border?.top?.color ),\n\t} );\n\tconst { color: borderRightColor } = getMultiOriginColor( {\n\t\tcolors,\n\t\tnamedColor: getColorSlugFromVariable( style?.border?.right?.color ),\n\t} );\n\n\tconst { color: borderBottomColor } = getMultiOriginColor( {\n\t\tcolors,\n\t\tnamedColor: getColorSlugFromVariable( style?.border?.bottom?.color ),\n\t} );\n\tconst { color: borderLeftColor } = getMultiOriginColor( {\n\t\tcolors,\n\t\tnamedColor: getColorSlugFromVariable( style?.border?.left?.color ),\n\t} );\n\n\tconst extraStyles = {\n\t\tborderTopColor: borderTopColor || borderColorValue,\n\t\tborderRightColor: borderRightColor || borderColorValue,\n\t\tborderBottomColor: borderBottomColor || borderColorValue,\n\t\tborderLeftColor: borderLeftColor || borderColorValue,\n\t};\n\n\treturn addSaveProps(\n\t\t{ style: cleanEmptyObject( extraStyles ) || {} },\n\t\tname,\n\t\t{ borderColor, style }\n\t);\n}\n\nexport default {\n\tuseBlockProps,\n\taddSaveProps,\n\tattributeKeys: [ 'borderColor', 'style' ],\n\thasSupport( name ) {\n\t\treturn hasBorderSupport( name, 'color' );\n\t},\n};\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/border/addAttributes',\n\taddAttributes\n);\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,eAAe,EAAEC,eAAe,QAAQ,mBAAmB;AACpE,SAASC,6BAA6B,IAAIC,eAAe,QAAQ,uBAAuB;AACxF,SAASC,QAAQ,EAAEC,WAAW,EAAEC,OAAO,QAAQ,oBAAoB;AACnE,SAASC,SAAS,QAAQ,kBAAkB;AAC5C,SAASC,SAAS,QAAQ,iBAAiB;;AAE3C;AACA;AACA;AACA,SAASC,iBAAiB,QAAQ,sBAAsB;AACxD,OAAOC,iBAAiB,MAAM,kCAAkC;AAChE,OAAOC,mCAAmC,MAAM,yEAAyE;AACzH,SACCC,gBAAgB,EAChBC,uBAAuB,EACvBC,gBAAgB,QACV,SAAS;AAChB,SACCC,iBAAiB,EACjBC,yBAAyB,EACzBC,WAAW,IAAIC,iBAAiB,QAC1B,6BAA6B;AACpC,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,UAAU;AACpD,SAASC,EAAE,QAAQ,iBAAiB;AAAC,SAAAC,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EpD,IAAI,EAAG;IAClB,OAAOY,gBAAgB,CAAEZ,IAAI,EAAE,OAAQ,CAAC;EACzC;AACD,CAAC;AAEDtD,SAAS,CACR,0BAA0B,EAC1B,2BAA2B,EAC3BqF,aACD,CAAC","ignoreList":[]}
@@ -222,7 +222,7 @@ export function ColorEdit({
222
222
  if (!isEnabled) {
223
223
  return null;
224
224
  }
225
- const defaultControls = getBlockSupport(name, [COLOR_SUPPORT_KEY, '__experimentalDefaultControls']);
225
+ const defaultControls = getBlockSupport(name, [COLOR_SUPPORT_KEY, 'defaultControls']);
226
226
  const enableContrastChecking = Platform.OS === 'web' && !value?.color?.gradient && (settings?.color?.text || settings?.color?.link) &&
227
227
  // Contrast checking is enabled by default.
228
228
  // Deactivating it requires `enableContrastChecker` to have
@@ -1 +1 @@
1
- {"version":3,"names":["clsx","addFilter","getBlockSupport","useMemo","Platform","useCallback","useSelect","getColorClassName","getColorObjectByAttributeValues","__experimentalGetGradientClass","cleanEmptyObject","transformStyles","shouldSkipSerialization","getBackgroundImageClasses","useSettings","InspectorControls","useHasColorPanel","default","StylesColorPanel","BlockColorContrastChecker","store","blockEditorStore","jsx","_jsx","COLOR_SUPPORT_KEY","hasColorSupport","blockNameOrType","colorSupport","link","gradient","background","text","hasLinkColorSupport","blockType","OS","hasGradientSupport","gradients","hasBackgroundColorSupport","hasTextColorSupport","addAttributes","settings","attributes","backgroundColor","Object","assign","type","textColor","addSaveProps","props","hasGradient","style","shouldSerialize","feature","textClass","undefined","gradientClass","backgroundClass","serializeHasBackground","hasBackground","color","newClassName","className","elements","styleToAttributes","textColorValue","textColorSlug","startsWith","substring","length","backgroundColorValue","backgroundColorSlug","gradientValue","gradientSlug","updatedStyle","attributesToStyle","ColorInspectorControl","children","resetAllFilter","attributesResetAllFilter","existingStyle","group","ColorEdit","clientId","name","setAttributes","isEnabled","selector","select","getBlockAttributes","value","onChange","newStyle","defaultControls","enableContrastChecking","as","panelId","enableContrastChecker","useBlockProps","userPalette","themePalette","defaultPalette","colors","extraStyles","saveProps","hasBackgroundValue","attributeKeys","hasSupport","MIGRATION_PATHS","linkColor","addTransforms","result","source","index","results","destinationBlockType","activeSupports"],"sources":["@wordpress/block-editor/src/hooks/color.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { addFilter } from '@wordpress/hooks';\nimport { getBlockSupport } from '@wordpress/blocks';\nimport { useMemo, Platform, useCallback } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport {\n\tgetColorClassName,\n\tgetColorObjectByAttributeValues,\n} from '../components/colors';\nimport { __experimentalGetGradientClass } from '../components/gradients';\nimport {\n\tcleanEmptyObject,\n\ttransformStyles,\n\tshouldSkipSerialization,\n} from './utils';\nimport { getBackgroundImageClasses } from './background';\nimport { useSettings } from '../components/use-settings';\nimport InspectorControls from '../components/inspector-controls';\nimport {\n\tuseHasColorPanel,\n\tdefault as StylesColorPanel,\n} from '../components/global-styles/color-panel';\nimport BlockColorContrastChecker from './contrast-checker';\nimport { store as blockEditorStore } from '../store';\n\nexport const COLOR_SUPPORT_KEY = 'color';\n\nconst hasColorSupport = ( blockNameOrType ) => {\n\tconst colorSupport = getBlockSupport( blockNameOrType, COLOR_SUPPORT_KEY );\n\treturn (\n\t\tcolorSupport &&\n\t\t( colorSupport.link === true ||\n\t\t\tcolorSupport.gradient === true ||\n\t\t\tcolorSupport.background !== false ||\n\t\t\tcolorSupport.text !== false )\n\t);\n};\n\nconst hasLinkColorSupport = ( blockType ) => {\n\tif ( Platform.OS !== 'web' ) {\n\t\treturn false;\n\t}\n\n\tconst colorSupport = getBlockSupport( blockType, COLOR_SUPPORT_KEY );\n\n\treturn (\n\t\tcolorSupport !== null &&\n\t\ttypeof colorSupport === 'object' &&\n\t\t!! colorSupport.link\n\t);\n};\n\nconst hasGradientSupport = ( blockNameOrType ) => {\n\tconst colorSupport = getBlockSupport( blockNameOrType, COLOR_SUPPORT_KEY );\n\n\treturn (\n\t\tcolorSupport !== null &&\n\t\ttypeof colorSupport === 'object' &&\n\t\t!! colorSupport.gradients\n\t);\n};\n\nconst hasBackgroundColorSupport = ( blockType ) => {\n\tconst colorSupport = getBlockSupport( blockType, COLOR_SUPPORT_KEY );\n\n\treturn colorSupport && colorSupport.background !== false;\n};\n\nconst hasTextColorSupport = ( blockType ) => {\n\tconst colorSupport = getBlockSupport( blockType, COLOR_SUPPORT_KEY );\n\n\treturn colorSupport && colorSupport.text !== false;\n};\n\n/**\n * Filters registered block settings, extending attributes to include\n * `backgroundColor` and `textColor` attribute.\n *\n * @param {Object} settings Original block settings.\n *\n * @return {Object} Filtered block settings.\n */\nfunction addAttributes( settings ) {\n\tif ( ! hasColorSupport( settings ) ) {\n\t\treturn settings;\n\t}\n\n\t// Allow blocks to specify their own attribute definition with default values if needed.\n\tif ( ! settings.attributes.backgroundColor ) {\n\t\tObject.assign( settings.attributes, {\n\t\t\tbackgroundColor: {\n\t\t\t\ttype: 'string',\n\t\t\t},\n\t\t} );\n\t}\n\tif ( ! settings.attributes.textColor ) {\n\t\tObject.assign( settings.attributes, {\n\t\t\ttextColor: {\n\t\t\t\ttype: 'string',\n\t\t\t},\n\t\t} );\n\t}\n\n\tif ( hasGradientSupport( settings ) && ! settings.attributes.gradient ) {\n\t\tObject.assign( settings.attributes, {\n\t\t\tgradient: {\n\t\t\t\ttype: 'string',\n\t\t\t},\n\t\t} );\n\t}\n\n\treturn settings;\n}\n\n/**\n * Override props assigned to save component to inject colors classnames.\n *\n * @param {Object} props Additional props applied to save element.\n * @param {Object|string} blockNameOrType Block type.\n * @param {Object} attributes Block attributes.\n *\n * @return {Object} Filtered props applied to save element.\n */\nexport function addSaveProps( props, blockNameOrType, attributes ) {\n\tif (\n\t\t! hasColorSupport( blockNameOrType ) ||\n\t\tshouldSkipSerialization( blockNameOrType, COLOR_SUPPORT_KEY )\n\t) {\n\t\treturn props;\n\t}\n\n\tconst hasGradient = hasGradientSupport( blockNameOrType );\n\n\t// I'd have preferred to avoid the \"style\" attribute usage here\n\tconst { backgroundColor, textColor, gradient, style } = attributes;\n\n\tconst shouldSerialize = ( feature ) =>\n\t\t! shouldSkipSerialization(\n\t\t\tblockNameOrType,\n\t\t\tCOLOR_SUPPORT_KEY,\n\t\t\tfeature\n\t\t);\n\n\t// Primary color classes must come before the `has-text-color`,\n\t// `has-background` and `has-link-color` classes to maintain backwards\n\t// compatibility and avoid block invalidations.\n\tconst textClass = shouldSerialize( 'text' )\n\t\t? getColorClassName( 'color', textColor )\n\t\t: undefined;\n\n\tconst gradientClass = shouldSerialize( 'gradients' )\n\t\t? __experimentalGetGradientClass( gradient )\n\t\t: undefined;\n\n\tconst backgroundClass = shouldSerialize( 'background' )\n\t\t? getColorClassName( 'background-color', backgroundColor )\n\t\t: undefined;\n\n\tconst serializeHasBackground =\n\t\tshouldSerialize( 'background' ) || shouldSerialize( 'gradients' );\n\tconst hasBackground =\n\t\tbackgroundColor ||\n\t\tstyle?.color?.background ||\n\t\t( hasGradient && ( gradient || style?.color?.gradient ) );\n\n\tconst newClassName = clsx( props.className, textClass, gradientClass, {\n\t\t// Don't apply the background class if there's a custom gradient.\n\t\t[ backgroundClass ]:\n\t\t\t( ! hasGradient || ! style?.color?.gradient ) && !! backgroundClass,\n\t\t'has-text-color':\n\t\t\tshouldSerialize( 'text' ) && ( textColor || style?.color?.text ),\n\t\t'has-background': serializeHasBackground && hasBackground,\n\t\t'has-link-color':\n\t\t\tshouldSerialize( 'link' ) && style?.elements?.link?.color,\n\t} );\n\tprops.className = newClassName ? newClassName : undefined;\n\n\treturn props;\n}\n\nfunction styleToAttributes( style ) {\n\tconst textColorValue = style?.color?.text;\n\tconst textColorSlug = textColorValue?.startsWith( 'var:preset|color|' )\n\t\t? textColorValue.substring( 'var:preset|color|'.length )\n\t\t: undefined;\n\tconst backgroundColorValue = style?.color?.background;\n\tconst backgroundColorSlug = backgroundColorValue?.startsWith(\n\t\t'var:preset|color|'\n\t)\n\t\t? backgroundColorValue.substring( 'var:preset|color|'.length )\n\t\t: undefined;\n\tconst gradientValue = style?.color?.gradient;\n\tconst gradientSlug = gradientValue?.startsWith( 'var:preset|gradient|' )\n\t\t? gradientValue.substring( 'var:preset|gradient|'.length )\n\t\t: undefined;\n\tconst updatedStyle = { ...style };\n\tupdatedStyle.color = {\n\t\t...updatedStyle.color,\n\t\ttext: textColorSlug ? undefined : textColorValue,\n\t\tbackground: backgroundColorSlug ? undefined : backgroundColorValue,\n\t\tgradient: gradientSlug ? undefined : gradientValue,\n\t};\n\treturn {\n\t\tstyle: cleanEmptyObject( updatedStyle ),\n\t\ttextColor: textColorSlug,\n\t\tbackgroundColor: backgroundColorSlug,\n\t\tgradient: gradientSlug,\n\t};\n}\n\nfunction attributesToStyle( attributes ) {\n\treturn {\n\t\t...attributes.style,\n\t\tcolor: {\n\t\t\t...attributes.style?.color,\n\t\t\ttext: attributes.textColor\n\t\t\t\t? 'var:preset|color|' + attributes.textColor\n\t\t\t\t: attributes.style?.color?.text,\n\t\t\tbackground: attributes.backgroundColor\n\t\t\t\t? 'var:preset|color|' + attributes.backgroundColor\n\t\t\t\t: attributes.style?.color?.background,\n\t\t\tgradient: attributes.gradient\n\t\t\t\t? 'var:preset|gradient|' + attributes.gradient\n\t\t\t\t: attributes.style?.color?.gradient,\n\t\t},\n\t};\n}\n\nfunction ColorInspectorControl( { children, resetAllFilter } ) {\n\tconst attributesResetAllFilter = useCallback(\n\t\t( attributes ) => {\n\t\t\tconst existingStyle = attributesToStyle( attributes );\n\t\t\tconst updatedStyle = resetAllFilter( existingStyle );\n\t\t\treturn {\n\t\t\t\t...attributes,\n\t\t\t\t...styleToAttributes( updatedStyle ),\n\t\t\t};\n\t\t},\n\t\t[ resetAllFilter ]\n\t);\n\n\treturn (\n\t\t<InspectorControls\n\t\t\tgroup=\"color\"\n\t\t\tresetAllFilter={ attributesResetAllFilter }\n\t\t>\n\t\t\t{ children }\n\t\t</InspectorControls>\n\t);\n}\n\nexport function ColorEdit( { clientId, name, setAttributes, settings } ) {\n\tconst isEnabled = useHasColorPanel( settings );\n\tfunction selector( select ) {\n\t\tconst { style, textColor, backgroundColor, gradient } =\n\t\t\tselect( blockEditorStore ).getBlockAttributes( clientId ) || {};\n\t\treturn { style, textColor, backgroundColor, gradient };\n\t}\n\tconst { style, textColor, backgroundColor, gradient } = useSelect(\n\t\tselector,\n\t\t[ clientId ]\n\t);\n\tconst value = useMemo( () => {\n\t\treturn attributesToStyle( {\n\t\t\tstyle,\n\t\t\ttextColor,\n\t\t\tbackgroundColor,\n\t\t\tgradient,\n\t\t} );\n\t}, [ style, textColor, backgroundColor, gradient ] );\n\n\tconst onChange = ( newStyle ) => {\n\t\tsetAttributes( styleToAttributes( newStyle ) );\n\t};\n\n\tif ( ! isEnabled ) {\n\t\treturn null;\n\t}\n\n\tconst defaultControls = getBlockSupport( name, [\n\t\tCOLOR_SUPPORT_KEY,\n\t\t'__experimentalDefaultControls',\n\t] );\n\n\tconst enableContrastChecking =\n\t\tPlatform.OS === 'web' &&\n\t\t! value?.color?.gradient &&\n\t\t( settings?.color?.text || settings?.color?.link ) &&\n\t\t// Contrast checking is enabled by default.\n\t\t// Deactivating it requires `enableContrastChecker` to have\n\t\t// an explicit value of `false`.\n\t\tfalse !==\n\t\t\tgetBlockSupport( name, [\n\t\t\t\tCOLOR_SUPPORT_KEY,\n\t\t\t\t'enableContrastChecker',\n\t\t\t] );\n\n\treturn (\n\t\t<StylesColorPanel\n\t\t\tas={ ColorInspectorControl }\n\t\t\tpanelId={ clientId }\n\t\t\tsettings={ settings }\n\t\t\tvalue={ value }\n\t\t\tonChange={ onChange }\n\t\t\tdefaultControls={ defaultControls }\n\t\t\tenableContrastChecker={\n\t\t\t\tfalse !==\n\t\t\t\tgetBlockSupport( name, [\n\t\t\t\t\tCOLOR_SUPPORT_KEY,\n\t\t\t\t\t'enableContrastChecker',\n\t\t\t\t] )\n\t\t\t}\n\t\t>\n\t\t\t{ enableContrastChecking && (\n\t\t\t\t<BlockColorContrastChecker clientId={ clientId } />\n\t\t\t) }\n\t\t</StylesColorPanel>\n\t);\n}\n\nfunction useBlockProps( {\n\tname,\n\tbackgroundColor,\n\ttextColor,\n\tgradient,\n\tstyle,\n} ) {\n\tconst [ userPalette, themePalette, defaultPalette ] = useSettings(\n\t\t'color.palette.custom',\n\t\t'color.palette.theme',\n\t\t'color.palette.default'\n\t);\n\n\tconst colors = useMemo(\n\t\t() => [\n\t\t\t...( userPalette || [] ),\n\t\t\t...( themePalette || [] ),\n\t\t\t...( defaultPalette || [] ),\n\t\t],\n\t\t[ userPalette, themePalette, defaultPalette ]\n\t);\n\tif (\n\t\t! hasColorSupport( name ) ||\n\t\tshouldSkipSerialization( name, COLOR_SUPPORT_KEY )\n\t) {\n\t\treturn {};\n\t}\n\tconst extraStyles = {};\n\n\tif (\n\t\ttextColor &&\n\t\t! shouldSkipSerialization( name, COLOR_SUPPORT_KEY, 'text' )\n\t) {\n\t\textraStyles.color = getColorObjectByAttributeValues(\n\t\t\tcolors,\n\t\t\ttextColor\n\t\t)?.color;\n\t}\n\tif (\n\t\tbackgroundColor &&\n\t\t! shouldSkipSerialization( name, COLOR_SUPPORT_KEY, 'background' )\n\t) {\n\t\textraStyles.backgroundColor = getColorObjectByAttributeValues(\n\t\t\tcolors,\n\t\t\tbackgroundColor\n\t\t)?.color;\n\t}\n\n\tconst saveProps = addSaveProps( { style: extraStyles }, name, {\n\t\ttextColor,\n\t\tbackgroundColor,\n\t\tgradient,\n\t\tstyle,\n\t} );\n\n\tconst hasBackgroundValue =\n\t\tbackgroundColor ||\n\t\tstyle?.color?.background ||\n\t\tgradient ||\n\t\tstyle?.color?.gradient;\n\n\treturn {\n\t\t...saveProps,\n\t\tclassName: clsx(\n\t\t\tsaveProps.className,\n\t\t\t// Add background image classes in the editor, if not already handled by background color values.\n\t\t\t! hasBackgroundValue && getBackgroundImageClasses( style )\n\t\t),\n\t};\n}\n\nexport default {\n\tuseBlockProps,\n\taddSaveProps,\n\tattributeKeys: [ 'backgroundColor', 'textColor', 'gradient', 'style' ],\n\thasSupport: hasColorSupport,\n};\n\nconst MIGRATION_PATHS = {\n\tlinkColor: [ [ 'style', 'elements', 'link', 'color', 'text' ] ],\n\ttextColor: [ [ 'textColor' ], [ 'style', 'color', 'text' ] ],\n\tbackgroundColor: [\n\t\t[ 'backgroundColor' ],\n\t\t[ 'style', 'color', 'background' ],\n\t],\n\tgradient: [ [ 'gradient' ], [ 'style', 'color', 'gradient' ] ],\n};\n\nexport function addTransforms( result, source, index, results ) {\n\tconst destinationBlockType = result.name;\n\tconst activeSupports = {\n\t\tlinkColor: hasLinkColorSupport( destinationBlockType ),\n\t\ttextColor: hasTextColorSupport( destinationBlockType ),\n\t\tbackgroundColor: hasBackgroundColorSupport( destinationBlockType ),\n\t\tgradient: hasGradientSupport( destinationBlockType ),\n\t};\n\treturn transformStyles(\n\t\tactiveSupports,\n\t\tMIGRATION_PATHS,\n\t\tresult,\n\t\tsource,\n\t\tindex,\n\t\tresults\n\t);\n}\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/color/addAttribute',\n\taddAttributes\n);\n\naddFilter(\n\t'blocks.switchToBlockType.transformedBlock',\n\t'core/color/addTransforms',\n\taddTransforms\n);\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,SAAS,QAAQ,kBAAkB;AAC5C,SAASC,eAAe,QAAQ,mBAAmB;AACnD,SAASC,OAAO,EAAEC,QAAQ,EAAEC,WAAW,QAAQ,oBAAoB;AACnE,SAASC,SAAS,QAAQ,iBAAiB;;AAE3C;AACA;AACA;AACA,SACCC,iBAAiB,EACjBC,+BAA+B,QACzB,sBAAsB;AAC7B,SAASC,8BAA8B,QAAQ,yBAAyB;AACxE,SACCC,gBAAgB,EAChBC,eAAe,EACfC,uBAAuB,QACjB,SAAS;AAChB,SAASC,yBAAyB,QAAQ,cAAc;AACxD,SAASC,WA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OAAO,EAAE,UAAU,CAAE;AAC7D,CAAC;AAED,OAAO,SAASgF,aAAaA,CAAEC,MAAM,EAAEC,MAAM,EAAEC,KAAK,EAAEC,OAAO,EAAG;EAC/D,MAAMC,oBAAoB,GAAGJ,MAAM,CAAC3B,IAAI;EACxC,MAAMgC,cAAc,GAAG;IACtBP,SAAS,EAAE5E,mBAAmB,CAAEkF,oBAAqB,CAAC;IACtDpE,SAAS,EAAER,mBAAmB,CAAE4E,oBAAqB,CAAC;IACtDxE,eAAe,EAAEL,yBAAyB,CAAE6E,oBAAqB,CAAC;IAClErF,QAAQ,EAAEM,kBAAkB,CAAE+E,oBAAqB;EACpD,CAAC;EACD,OAAOvG,eAAe,CACrBwG,cAAc,EACdR,eAAe,EACfG,MAAM,EACNC,MAAM,EACNC,KAAK,EACLC,OACD,CAAC;AACF;AAEAhH,SAAS,CACR,0BAA0B,EAC1B,yBAAyB,EACzBsC,aACD,CAAC;AAEDtC,SAAS,CACR,2CAA2C,EAC3C,0BAA0B,EAC1B4G,aACD,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["clsx","addFilter","getBlockSupport","useMemo","Platform","useCallback","useSelect","getColorClassName","getColorObjectByAttributeValues","__experimentalGetGradientClass","cleanEmptyObject","transformStyles","shouldSkipSerialization","getBackgroundImageClasses","useSettings","InspectorControls","useHasColorPanel","default","StylesColorPanel","BlockColorContrastChecker","store","blockEditorStore","jsx","_jsx","COLOR_SUPPORT_KEY","hasColorSupport","blockNameOrType","colorSupport","link","gradient","background","text","hasLinkColorSupport","blockType","OS","hasGradientSupport","gradients","hasBackgroundColorSupport","hasTextColorSupport","addAttributes","settings","attributes","backgroundColor","Object","assign","type","textColor","addSaveProps","props","hasGradient","style","shouldSerialize","feature","textClass","undefined","gradientClass","backgroundClass","serializeHasBackground","hasBackground","color","newClassName","className","elements","styleToAttributes","textColorValue","textColorSlug","startsWith","substring","length","backgroundColorValue","backgroundColorSlug","gradientValue","gradientSlug","updatedStyle","attributesToStyle","ColorInspectorControl","children","resetAllFilter","attributesResetAllFilter","existingStyle","group","ColorEdit","clientId","name","setAttributes","isEnabled","selector","select","getBlockAttributes","value","onChange","newStyle","defaultControls","enableContrastChecking","as","panelId","enableContrastChecker","useBlockProps","userPalette","themePalette","defaultPalette","colors","extraStyles","saveProps","hasBackgroundValue","attributeKeys","hasSupport","MIGRATION_PATHS","linkColor","addTransforms","result","source","index","results","destinationBlockType","activeSupports"],"sources":["@wordpress/block-editor/src/hooks/color.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { addFilter } from '@wordpress/hooks';\nimport { getBlockSupport } from '@wordpress/blocks';\nimport { useMemo, Platform, useCallback } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport {\n\tgetColorClassName,\n\tgetColorObjectByAttributeValues,\n} from '../components/colors';\nimport { __experimentalGetGradientClass } from '../components/gradients';\nimport {\n\tcleanEmptyObject,\n\ttransformStyles,\n\tshouldSkipSerialization,\n} from './utils';\nimport { getBackgroundImageClasses } from './background';\nimport { useSettings } from '../components/use-settings';\nimport InspectorControls from '../components/inspector-controls';\nimport {\n\tuseHasColorPanel,\n\tdefault as StylesColorPanel,\n} from '../components/global-styles/color-panel';\nimport BlockColorContrastChecker from './contrast-checker';\nimport { store as blockEditorStore } from '../store';\n\nexport const COLOR_SUPPORT_KEY = 'color';\n\nconst hasColorSupport = ( blockNameOrType ) => {\n\tconst colorSupport = getBlockSupport( blockNameOrType, COLOR_SUPPORT_KEY );\n\treturn (\n\t\tcolorSupport &&\n\t\t( colorSupport.link === true ||\n\t\t\tcolorSupport.gradient === true ||\n\t\t\tcolorSupport.background !== false ||\n\t\t\tcolorSupport.text !== false )\n\t);\n};\n\nconst hasLinkColorSupport = ( blockType ) => {\n\tif ( Platform.OS !== 'web' ) {\n\t\treturn false;\n\t}\n\n\tconst colorSupport = getBlockSupport( blockType, COLOR_SUPPORT_KEY );\n\n\treturn (\n\t\tcolorSupport !== null &&\n\t\ttypeof colorSupport === 'object' &&\n\t\t!! colorSupport.link\n\t);\n};\n\nconst hasGradientSupport = ( blockNameOrType ) => {\n\tconst colorSupport = getBlockSupport( blockNameOrType, COLOR_SUPPORT_KEY );\n\n\treturn (\n\t\tcolorSupport !== null &&\n\t\ttypeof colorSupport === 'object' &&\n\t\t!! colorSupport.gradients\n\t);\n};\n\nconst hasBackgroundColorSupport = ( blockType ) => {\n\tconst colorSupport = getBlockSupport( blockType, COLOR_SUPPORT_KEY );\n\n\treturn colorSupport && colorSupport.background !== false;\n};\n\nconst hasTextColorSupport = ( blockType ) => {\n\tconst colorSupport = getBlockSupport( blockType, COLOR_SUPPORT_KEY );\n\n\treturn colorSupport && colorSupport.text !== false;\n};\n\n/**\n * Filters registered block settings, extending attributes to include\n * `backgroundColor` and `textColor` attribute.\n *\n * @param {Object} settings Original block settings.\n *\n * @return {Object} Filtered block settings.\n */\nfunction addAttributes( settings ) {\n\tif ( ! hasColorSupport( settings ) ) {\n\t\treturn settings;\n\t}\n\n\t// Allow blocks to specify their own attribute definition with default values if needed.\n\tif ( ! settings.attributes.backgroundColor ) {\n\t\tObject.assign( settings.attributes, {\n\t\t\tbackgroundColor: {\n\t\t\t\ttype: 'string',\n\t\t\t},\n\t\t} );\n\t}\n\tif ( ! settings.attributes.textColor ) {\n\t\tObject.assign( settings.attributes, {\n\t\t\ttextColor: {\n\t\t\t\ttype: 'string',\n\t\t\t},\n\t\t} );\n\t}\n\n\tif ( hasGradientSupport( settings ) && ! settings.attributes.gradient ) {\n\t\tObject.assign( settings.attributes, {\n\t\t\tgradient: {\n\t\t\t\ttype: 'string',\n\t\t\t},\n\t\t} );\n\t}\n\n\treturn settings;\n}\n\n/**\n * Override props assigned to save component to inject colors classnames.\n *\n * @param {Object} props Additional props applied to save element.\n * @param {Object|string} blockNameOrType Block type.\n * @param {Object} attributes Block attributes.\n *\n * @return {Object} Filtered props applied to save element.\n */\nexport function addSaveProps( props, blockNameOrType, attributes ) {\n\tif (\n\t\t! hasColorSupport( blockNameOrType ) ||\n\t\tshouldSkipSerialization( blockNameOrType, COLOR_SUPPORT_KEY )\n\t) {\n\t\treturn props;\n\t}\n\n\tconst hasGradient = hasGradientSupport( blockNameOrType );\n\n\t// I'd have preferred to avoid the \"style\" attribute usage here\n\tconst { backgroundColor, textColor, gradient, style } = attributes;\n\n\tconst shouldSerialize = ( feature ) =>\n\t\t! shouldSkipSerialization(\n\t\t\tblockNameOrType,\n\t\t\tCOLOR_SUPPORT_KEY,\n\t\t\tfeature\n\t\t);\n\n\t// Primary color classes must come before the `has-text-color`,\n\t// `has-background` and `has-link-color` classes to maintain backwards\n\t// compatibility and avoid block invalidations.\n\tconst textClass = shouldSerialize( 'text' )\n\t\t? getColorClassName( 'color', textColor )\n\t\t: undefined;\n\n\tconst gradientClass = shouldSerialize( 'gradients' )\n\t\t? __experimentalGetGradientClass( gradient )\n\t\t: undefined;\n\n\tconst backgroundClass = shouldSerialize( 'background' )\n\t\t? getColorClassName( 'background-color', backgroundColor )\n\t\t: undefined;\n\n\tconst serializeHasBackground =\n\t\tshouldSerialize( 'background' ) || shouldSerialize( 'gradients' );\n\tconst hasBackground =\n\t\tbackgroundColor ||\n\t\tstyle?.color?.background ||\n\t\t( hasGradient && ( gradient || style?.color?.gradient ) );\n\n\tconst newClassName = clsx( props.className, textClass, gradientClass, {\n\t\t// Don't apply the background class if there's a custom gradient.\n\t\t[ backgroundClass ]:\n\t\t\t( ! hasGradient || ! style?.color?.gradient ) && !! backgroundClass,\n\t\t'has-text-color':\n\t\t\tshouldSerialize( 'text' ) && ( textColor || style?.color?.text ),\n\t\t'has-background': serializeHasBackground && hasBackground,\n\t\t'has-link-color':\n\t\t\tshouldSerialize( 'link' ) && style?.elements?.link?.color,\n\t} );\n\tprops.className = newClassName ? newClassName : undefined;\n\n\treturn props;\n}\n\nfunction styleToAttributes( style ) {\n\tconst textColorValue = style?.color?.text;\n\tconst textColorSlug = textColorValue?.startsWith( 'var:preset|color|' )\n\t\t? textColorValue.substring( 'var:preset|color|'.length )\n\t\t: undefined;\n\tconst backgroundColorValue = style?.color?.background;\n\tconst backgroundColorSlug = backgroundColorValue?.startsWith(\n\t\t'var:preset|color|'\n\t)\n\t\t? backgroundColorValue.substring( 'var:preset|color|'.length )\n\t\t: undefined;\n\tconst gradientValue = style?.color?.gradient;\n\tconst gradientSlug = gradientValue?.startsWith( 'var:preset|gradient|' )\n\t\t? gradientValue.substring( 'var:preset|gradient|'.length )\n\t\t: undefined;\n\tconst updatedStyle = { ...style };\n\tupdatedStyle.color = {\n\t\t...updatedStyle.color,\n\t\ttext: textColorSlug ? undefined : textColorValue,\n\t\tbackground: backgroundColorSlug ? undefined : backgroundColorValue,\n\t\tgradient: gradientSlug ? undefined : gradientValue,\n\t};\n\treturn {\n\t\tstyle: cleanEmptyObject( updatedStyle ),\n\t\ttextColor: textColorSlug,\n\t\tbackgroundColor: backgroundColorSlug,\n\t\tgradient: gradientSlug,\n\t};\n}\n\nfunction attributesToStyle( attributes ) {\n\treturn {\n\t\t...attributes.style,\n\t\tcolor: {\n\t\t\t...attributes.style?.color,\n\t\t\ttext: attributes.textColor\n\t\t\t\t? 'var:preset|color|' + attributes.textColor\n\t\t\t\t: attributes.style?.color?.text,\n\t\t\tbackground: attributes.backgroundColor\n\t\t\t\t? 'var:preset|color|' + attributes.backgroundColor\n\t\t\t\t: attributes.style?.color?.background,\n\t\t\tgradient: attributes.gradient\n\t\t\t\t? 'var:preset|gradient|' + attributes.gradient\n\t\t\t\t: attributes.style?.color?.gradient,\n\t\t},\n\t};\n}\n\nfunction ColorInspectorControl( { children, resetAllFilter } ) {\n\tconst attributesResetAllFilter = useCallback(\n\t\t( attributes ) => {\n\t\t\tconst existingStyle = attributesToStyle( attributes );\n\t\t\tconst updatedStyle = resetAllFilter( existingStyle );\n\t\t\treturn {\n\t\t\t\t...attributes,\n\t\t\t\t...styleToAttributes( updatedStyle ),\n\t\t\t};\n\t\t},\n\t\t[ resetAllFilter ]\n\t);\n\n\treturn (\n\t\t<InspectorControls\n\t\t\tgroup=\"color\"\n\t\t\tresetAllFilter={ attributesResetAllFilter }\n\t\t>\n\t\t\t{ children }\n\t\t</InspectorControls>\n\t);\n}\n\nexport function ColorEdit( { clientId, name, setAttributes, settings } ) {\n\tconst isEnabled = useHasColorPanel( settings );\n\tfunction selector( select ) {\n\t\tconst { style, textColor, backgroundColor, gradient } =\n\t\t\tselect( blockEditorStore ).getBlockAttributes( clientId ) || {};\n\t\treturn { style, textColor, backgroundColor, gradient };\n\t}\n\tconst { style, textColor, backgroundColor, gradient } = useSelect(\n\t\tselector,\n\t\t[ clientId ]\n\t);\n\tconst value = useMemo( () => {\n\t\treturn attributesToStyle( {\n\t\t\tstyle,\n\t\t\ttextColor,\n\t\t\tbackgroundColor,\n\t\t\tgradient,\n\t\t} );\n\t}, [ style, textColor, backgroundColor, gradient ] );\n\n\tconst onChange = ( newStyle ) => {\n\t\tsetAttributes( styleToAttributes( newStyle ) );\n\t};\n\n\tif ( ! isEnabled ) {\n\t\treturn null;\n\t}\n\n\tconst defaultControls = getBlockSupport( name, [\n\t\tCOLOR_SUPPORT_KEY,\n\t\t'defaultControls',\n\t] );\n\n\tconst enableContrastChecking =\n\t\tPlatform.OS === 'web' &&\n\t\t! value?.color?.gradient &&\n\t\t( settings?.color?.text || settings?.color?.link ) &&\n\t\t// Contrast checking is enabled by default.\n\t\t// Deactivating it requires `enableContrastChecker` to have\n\t\t// an explicit value of `false`.\n\t\tfalse !==\n\t\t\tgetBlockSupport( name, [\n\t\t\t\tCOLOR_SUPPORT_KEY,\n\t\t\t\t'enableContrastChecker',\n\t\t\t] );\n\n\treturn (\n\t\t<StylesColorPanel\n\t\t\tas={ ColorInspectorControl }\n\t\t\tpanelId={ clientId }\n\t\t\tsettings={ settings }\n\t\t\tvalue={ value }\n\t\t\tonChange={ onChange }\n\t\t\tdefaultControls={ defaultControls }\n\t\t\tenableContrastChecker={\n\t\t\t\tfalse !==\n\t\t\t\tgetBlockSupport( name, [\n\t\t\t\t\tCOLOR_SUPPORT_KEY,\n\t\t\t\t\t'enableContrastChecker',\n\t\t\t\t] )\n\t\t\t}\n\t\t>\n\t\t\t{ enableContrastChecking && (\n\t\t\t\t<BlockColorContrastChecker clientId={ clientId } />\n\t\t\t) }\n\t\t</StylesColorPanel>\n\t);\n}\n\nfunction useBlockProps( {\n\tname,\n\tbackgroundColor,\n\ttextColor,\n\tgradient,\n\tstyle,\n} ) {\n\tconst [ userPalette, themePalette, defaultPalette ] = useSettings(\n\t\t'color.palette.custom',\n\t\t'color.palette.theme',\n\t\t'color.palette.default'\n\t);\n\n\tconst colors = useMemo(\n\t\t() => [\n\t\t\t...( userPalette || [] ),\n\t\t\t...( themePalette || [] ),\n\t\t\t...( defaultPalette || [] ),\n\t\t],\n\t\t[ userPalette, themePalette, defaultPalette ]\n\t);\n\tif (\n\t\t! hasColorSupport( name ) ||\n\t\tshouldSkipSerialization( name, COLOR_SUPPORT_KEY )\n\t) {\n\t\treturn {};\n\t}\n\tconst extraStyles = {};\n\n\tif (\n\t\ttextColor &&\n\t\t! shouldSkipSerialization( name, COLOR_SUPPORT_KEY, 'text' )\n\t) {\n\t\textraStyles.color = getColorObjectByAttributeValues(\n\t\t\tcolors,\n\t\t\ttextColor\n\t\t)?.color;\n\t}\n\tif (\n\t\tbackgroundColor &&\n\t\t! shouldSkipSerialization( name, COLOR_SUPPORT_KEY, 'background' )\n\t) {\n\t\textraStyles.backgroundColor = getColorObjectByAttributeValues(\n\t\t\tcolors,\n\t\t\tbackgroundColor\n\t\t)?.color;\n\t}\n\n\tconst saveProps = addSaveProps( { style: extraStyles }, name, {\n\t\ttextColor,\n\t\tbackgroundColor,\n\t\tgradient,\n\t\tstyle,\n\t} );\n\n\tconst hasBackgroundValue =\n\t\tbackgroundColor ||\n\t\tstyle?.color?.background ||\n\t\tgradient ||\n\t\tstyle?.color?.gradient;\n\n\treturn {\n\t\t...saveProps,\n\t\tclassName: clsx(\n\t\t\tsaveProps.className,\n\t\t\t// Add background image classes in the editor, if not already handled by background color values.\n\t\t\t! hasBackgroundValue && getBackgroundImageClasses( style )\n\t\t),\n\t};\n}\n\nexport default {\n\tuseBlockProps,\n\taddSaveProps,\n\tattributeKeys: [ 'backgroundColor', 'textColor', 'gradient', 'style' ],\n\thasSupport: hasColorSupport,\n};\n\nconst MIGRATION_PATHS = {\n\tlinkColor: [ [ 'style', 'elements', 'link', 'color', 'text' ] ],\n\ttextColor: [ [ 'textColor' ], [ 'style', 'color', 'text' ] ],\n\tbackgroundColor: [\n\t\t[ 'backgroundColor' ],\n\t\t[ 'style', 'color', 'background' ],\n\t],\n\tgradient: [ [ 'gradient' ], [ 'style', 'color', 'gradient' ] ],\n};\n\nexport function addTransforms( result, source, index, results ) {\n\tconst destinationBlockType = result.name;\n\tconst activeSupports = {\n\t\tlinkColor: hasLinkColorSupport( destinationBlockType ),\n\t\ttextColor: hasTextColorSupport( destinationBlockType ),\n\t\tbackgroundColor: hasBackgroundColorSupport( destinationBlockType ),\n\t\tgradient: hasGradientSupport( destinationBlockType ),\n\t};\n\treturn transformStyles(\n\t\tactiveSupports,\n\t\tMIGRATION_PATHS,\n\t\tresult,\n\t\tsource,\n\t\tindex,\n\t\tresults\n\t);\n}\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/color/addAttribute',\n\taddAttributes\n);\n\naddFilter(\n\t'blocks.switchToBlockType.transformedBlock',\n\t'core/color/addTransforms',\n\taddTransforms\n);\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,SAAS,QAAQ,kBAAkB;AAC5C,SAASC,eAAe,QAAQ,mBAAmB;AACnD,SAASC,OAAO,EAAEC,QAAQ,EAAEC,WAAW,QAAQ,oBAAoB;AACnE,SAASC,SAAS,QAAQ,iBAAiB;;AAE3C;AACA;AACA;AACA,SACCC,iBAAiB,EACjBC,+BAA+B,QACzB,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AAE,CAChB,CAAE,iBAAiB,CAAE,EACrB,CAAE,OAAO,EAAE,OAAO,EAAE,YAAY,CAAE,CAClC;EACDb,QAAQ,EAAE,CAAE,CAAE,UAAU,CAAE,EAAE,CAAE,OAAO,EAAE,OAAO,EAAE,UAAU,CAAE;AAC7D,CAAC;AAED,OAAO,SAASgF,aAAaA,CAAEC,MAAM,EAAEC,MAAM,EAAEC,KAAK,EAAEC,OAAO,EAAG;EAC/D,MAAMC,oBAAoB,GAAGJ,MAAM,CAAC3B,IAAI;EACxC,MAAMgC,cAAc,GAAG;IACtBP,SAAS,EAAE5E,mBAAmB,CAAEkF,oBAAqB,CAAC;IACtDpE,SAAS,EAAER,mBAAmB,CAAE4E,oBAAqB,CAAC;IACtDxE,eAAe,EAAEL,yBAAyB,CAAE6E,oBAAqB,CAAC;IAClErF,QAAQ,EAAEM,kBAAkB,CAAE+E,oBAAqB;EACpD,CAAC;EACD,OAAOvG,eAAe,CACrBwG,cAAc,EACdR,eAAe,EACfG,MAAM,EACNC,MAAM,EACNC,KAAK,EACLC,OACD,CAAC;AACF;AAEAhH,SAAS,CACR,0BAA0B,EAC1B,yBAAyB,EACzBsC,aACD,CAAC;AAEDtC,SAAS,CACR,2CAA2C,EAC3C,0BAA0B,EAC1B4G,aACD,CAAC","ignoreList":[]}
@@ -75,8 +75,8 @@ export function DimensionsPanel({
75
75
  if (!isEnabled) {
76
76
  return null;
77
77
  }
78
- const defaultDimensionsControls = getBlockSupport(name, [DIMENSIONS_SUPPORT_KEY, '__experimentalDefaultControls']);
79
- const defaultSpacingControls = getBlockSupport(name, [SPACING_SUPPORT_KEY, '__experimentalDefaultControls']);
78
+ const defaultDimensionsControls = getBlockSupport(name, [DIMENSIONS_SUPPORT_KEY, 'defaultControls']);
79
+ const defaultSpacingControls = getBlockSupport(name, [SPACING_SUPPORT_KEY, 'defaultControls']);
80
80
  const defaultControls = {
81
81
  ...defaultDimensionsControls,
82
82
  ...defaultSpacingControls