@wordpress/components 28.1.0 → 28.3.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 (451) hide show
  1. package/CHANGELOG.md +179 -120
  2. package/build/animation/index.js.map +1 -1
  3. package/build/autocomplete/autocompleter-ui.js +1 -0
  4. package/build/autocomplete/autocompleter-ui.js.map +1 -1
  5. package/build/autocomplete/index.js.map +1 -1
  6. package/build/base-control/index.js +14 -7
  7. package/build/base-control/index.js.map +1 -1
  8. package/build/border-box-control/border-box-control-visualizer/component.js +0 -4
  9. package/build/border-box-control/border-box-control-visualizer/component.js.map +1 -1
  10. package/build/button/index.js +5 -3
  11. package/build/button/index.js.map +1 -1
  12. package/build/button/types.js.map +1 -1
  13. package/build/combobox-control/index.js +4 -1
  14. package/build/combobox-control/index.js.map +1 -1
  15. package/build/composite/current/index.js.map +1 -1
  16. package/build/custom-select-control-v2/custom-select.js +58 -36
  17. package/build/custom-select-control-v2/custom-select.js.map +1 -1
  18. package/build/custom-select-control-v2/default-component/index.js +0 -1
  19. package/build/custom-select-control-v2/default-component/index.js.map +1 -1
  20. package/build/custom-select-control-v2/item.js +2 -0
  21. package/build/custom-select-control-v2/item.js.map +1 -1
  22. package/build/custom-select-control-v2/legacy-component/index.js +33 -15
  23. package/build/custom-select-control-v2/legacy-component/index.js.map +1 -1
  24. package/build/custom-select-control-v2/styles.js +92 -65
  25. package/build/custom-select-control-v2/styles.js.map +1 -1
  26. package/build/custom-select-control-v2/types.js.map +1 -1
  27. package/build/date-time/date-time/index.js +3 -1
  28. package/build/date-time/date-time/index.js.map +1 -1
  29. package/build/date-time/index.js +7 -0
  30. package/build/date-time/index.js.map +1 -1
  31. package/build/date-time/time/index.js +62 -145
  32. package/build/date-time/time/index.js.map +1 -1
  33. package/build/date-time/time-input/index.js +159 -0
  34. package/build/date-time/time-input/index.js.map +1 -0
  35. package/build/date-time/types.js.map +1 -1
  36. package/build/date-time/utils.js +64 -0
  37. package/build/date-time/utils.js.map +1 -1
  38. package/build/disclosure/index.js +0 -1
  39. package/build/disclosure/index.js.map +1 -1
  40. package/build/divider/component.js +0 -1
  41. package/build/divider/component.js.map +1 -1
  42. package/build/divider/types.js.map +1 -1
  43. package/build/drop-zone/index.js +16 -79
  44. package/build/drop-zone/index.js.map +1 -1
  45. package/build/dropdown-menu/index.js +1 -0
  46. package/build/dropdown-menu/index.js.map +1 -1
  47. package/build/dropdown-menu-v2/index.js +0 -1
  48. package/build/dropdown-menu-v2/index.js.map +1 -1
  49. package/build/dropdown-menu-v2/styles.js +15 -16
  50. package/build/dropdown-menu-v2/styles.js.map +1 -1
  51. package/build/dropdown-menu-v2/types.js.map +1 -1
  52. package/build/font-size-picker/font-size-picker-select.js +2 -2
  53. package/build/font-size-picker/font-size-picker-select.js.map +1 -1
  54. package/build/font-size-picker/index.js +1 -1
  55. package/build/font-size-picker/index.js.map +1 -1
  56. package/build/font-size-picker/utils.js +0 -4
  57. package/build/font-size-picker/utils.js.map +1 -1
  58. package/build/form-token-field/token.js +4 -1
  59. package/build/form-token-field/token.js.map +1 -1
  60. package/build/higher-order/with-spoken-messages/index.js +1 -2
  61. package/build/higher-order/with-spoken-messages/index.js.map +1 -1
  62. package/build/lock-unlock.js +1 -1
  63. package/build/lock-unlock.js.map +1 -1
  64. package/build/menu-items-choice/types.js.map +1 -1
  65. package/build/palette-edit/index.js +30 -38
  66. package/build/palette-edit/index.js.map +1 -1
  67. package/build/palette-edit/types.js.map +1 -1
  68. package/build/popover/index.js +0 -4
  69. package/build/popover/index.js.map +1 -1
  70. package/build/popover/utils.js +0 -1
  71. package/build/popover/utils.js.map +1 -1
  72. package/build/private-apis.js +2 -4
  73. package/build/private-apis.js.map +1 -1
  74. package/build/progress-bar/styles.js +19 -13
  75. package/build/progress-bar/styles.js.map +1 -1
  76. package/build/radio-group/context.js +0 -1
  77. package/build/radio-group/context.js.map +1 -1
  78. package/build/radio-group/index.js +0 -1
  79. package/build/radio-group/index.js.map +1 -1
  80. package/build/radio-group/radio.js +0 -1
  81. package/build/radio-group/radio.js.map +1 -1
  82. package/build/range-control/index.js +4 -1
  83. package/build/range-control/index.js.map +1 -1
  84. package/build/range-control/styles/range-control-styles.js +34 -28
  85. package/build/range-control/styles/range-control-styles.js.map +1 -1
  86. package/build/resizable-box/resize-tooltip/utils.js.map +1 -1
  87. package/build/select-control/index.js +1 -2
  88. package/build/select-control/index.js.map +1 -1
  89. package/build/select-control/styles/select-control-styles.js +13 -8
  90. package/build/select-control/styles/select-control-styles.js.map +1 -1
  91. package/build/tab-panel/index.js +0 -1
  92. package/build/tab-panel/index.js.map +1 -1
  93. package/build/tabs/index.js +0 -1
  94. package/build/tabs/index.js.map +1 -1
  95. package/build/tabs/styles.js +3 -5
  96. package/build/tabs/styles.js.map +1 -1
  97. package/build/tabs/tablist.js +148 -37
  98. package/build/tabs/tablist.js.map +1 -1
  99. package/build/tabs/types.js.map +1 -1
  100. package/build/toggle-group-control/toggle-group-control/as-radio-group.js +0 -2
  101. package/build/toggle-group-control/toggle-group-control/as-radio-group.js.map +1 -1
  102. package/build/toggle-group-control/toggle-group-control/component.js +0 -2
  103. package/build/toggle-group-control/toggle-group-control/component.js.map +1 -1
  104. package/build/toggle-group-control/toggle-group-control-option-base/component.js +0 -4
  105. package/build/toggle-group-control/toggle-group-control-option-base/component.js.map +1 -1
  106. package/build/toolbar/toolbar/toolbar-container.js +0 -1
  107. package/build/toolbar/toolbar/toolbar-container.js.map +1 -1
  108. package/build/toolbar/toolbar/types.js.map +1 -1
  109. package/build/toolbar/toolbar-button/index.js +27 -19
  110. package/build/toolbar/toolbar-button/index.js.map +1 -1
  111. package/build/toolbar/toolbar-button/types.js.map +1 -1
  112. package/build/toolbar/toolbar-context/index.js +0 -1
  113. package/build/toolbar/toolbar-context/index.js.map +1 -1
  114. package/build/toolbar/toolbar-item/index.js +1 -1
  115. package/build/toolbar/toolbar-item/index.js.map +1 -1
  116. package/build/tooltip/index.js +3 -2
  117. package/build/tooltip/index.js.map +1 -1
  118. package/build/tooltip/types.js.map +1 -1
  119. package/build/unit-control/index.js +3 -3
  120. package/build/unit-control/index.js.map +1 -1
  121. package/build/unit-control/styles/unit-control-styles.js +7 -7
  122. package/build/unit-control/styles/unit-control-styles.js.map +1 -1
  123. package/build/utils/hooks/use-update-effect.js +4 -1
  124. package/build/utils/hooks/use-update-effect.js.map +1 -1
  125. package/build-module/animation/index.js +0 -1
  126. package/build-module/animation/index.js.map +1 -1
  127. package/build-module/autocomplete/autocompleter-ui.js +1 -0
  128. package/build-module/autocomplete/autocompleter-ui.js.map +1 -1
  129. package/build-module/autocomplete/index.js.map +1 -1
  130. package/build-module/base-control/index.js +13 -6
  131. package/build-module/base-control/index.js.map +1 -1
  132. package/build-module/border-box-control/border-box-control-visualizer/component.js +0 -4
  133. package/build-module/border-box-control/border-box-control-visualizer/component.js.map +1 -1
  134. package/build-module/button/index.js +5 -3
  135. package/build-module/button/index.js.map +1 -1
  136. package/build-module/button/types.js.map +1 -1
  137. package/build-module/combobox-control/index.js +4 -1
  138. package/build-module/combobox-control/index.js.map +1 -1
  139. package/build-module/composite/current/index.js +0 -3
  140. package/build-module/composite/current/index.js.map +1 -1
  141. package/build-module/custom-select-control-v2/custom-select.js +59 -38
  142. package/build-module/custom-select-control-v2/custom-select.js.map +1 -1
  143. package/build-module/custom-select-control-v2/default-component/index.js +0 -1
  144. package/build-module/custom-select-control-v2/default-component/index.js.map +1 -1
  145. package/build-module/custom-select-control-v2/item.js +2 -0
  146. package/build-module/custom-select-control-v2/item.js.map +1 -1
  147. package/build-module/custom-select-control-v2/legacy-component/index.js +33 -16
  148. package/build-module/custom-select-control-v2/legacy-component/index.js.map +1 -1
  149. package/build-module/custom-select-control-v2/styles.js +90 -63
  150. package/build-module/custom-select-control-v2/styles.js.map +1 -1
  151. package/build-module/custom-select-control-v2/types.js.map +1 -1
  152. package/build-module/date-time/date-time/index.js +4 -1
  153. package/build-module/date-time/date-time/index.js.map +1 -1
  154. package/build-module/date-time/index.js +2 -1
  155. package/build-module/date-time/index.js.map +1 -1
  156. package/build-module/date-time/time/index.js +65 -149
  157. package/build-module/date-time/time/index.js.map +1 -1
  158. package/build-module/date-time/time-input/index.js +151 -0
  159. package/build-module/date-time/time-input/index.js.map +1 -0
  160. package/build-module/date-time/types.js.map +1 -1
  161. package/build-module/date-time/utils.js +61 -0
  162. package/build-module/date-time/utils.js.map +1 -1
  163. package/build-module/disclosure/index.js +0 -1
  164. package/build-module/disclosure/index.js.map +1 -1
  165. package/build-module/divider/component.js +0 -1
  166. package/build-module/divider/component.js.map +1 -1
  167. package/build-module/divider/types.js.map +1 -1
  168. package/build-module/drop-zone/index.js +17 -80
  169. package/build-module/drop-zone/index.js.map +1 -1
  170. package/build-module/dropdown-menu/index.js +1 -0
  171. package/build-module/dropdown-menu/index.js.map +1 -1
  172. package/build-module/dropdown-menu-v2/index.js +0 -1
  173. package/build-module/dropdown-menu-v2/index.js.map +1 -1
  174. package/build-module/dropdown-menu-v2/styles.js +14 -15
  175. package/build-module/dropdown-menu-v2/styles.js.map +1 -1
  176. package/build-module/dropdown-menu-v2/types.js.map +1 -1
  177. package/build-module/font-size-picker/font-size-picker-select.js +1 -1
  178. package/build-module/font-size-picker/font-size-picker-select.js.map +1 -1
  179. package/build-module/font-size-picker/index.js +1 -1
  180. package/build-module/font-size-picker/index.js.map +1 -1
  181. package/build-module/font-size-picker/utils.js +0 -4
  182. package/build-module/font-size-picker/utils.js.map +1 -1
  183. package/build-module/form-token-field/token.js +4 -1
  184. package/build-module/form-token-field/token.js.map +1 -1
  185. package/build-module/higher-order/with-spoken-messages/index.js +1 -2
  186. package/build-module/higher-order/with-spoken-messages/index.js.map +1 -1
  187. package/build-module/lock-unlock.js +1 -1
  188. package/build-module/lock-unlock.js.map +1 -1
  189. package/build-module/menu-items-choice/types.js.map +1 -1
  190. package/build-module/palette-edit/index.js +31 -39
  191. package/build-module/palette-edit/index.js.map +1 -1
  192. package/build-module/palette-edit/types.js.map +1 -1
  193. package/build-module/popover/index.js +0 -3
  194. package/build-module/popover/index.js.map +1 -1
  195. package/build-module/popover/utils.js +0 -1
  196. package/build-module/popover/utils.js.map +1 -1
  197. package/build-module/private-apis.js +2 -4
  198. package/build-module/private-apis.js.map +1 -1
  199. package/build-module/progress-bar/styles.js +21 -13
  200. package/build-module/progress-bar/styles.js.map +1 -1
  201. package/build-module/radio-group/context.js +0 -1
  202. package/build-module/radio-group/context.js.map +1 -1
  203. package/build-module/radio-group/index.js +0 -1
  204. package/build-module/radio-group/index.js.map +1 -1
  205. package/build-module/radio-group/radio.js +0 -1
  206. package/build-module/radio-group/radio.js.map +1 -1
  207. package/build-module/range-control/index.js +4 -1
  208. package/build-module/range-control/index.js.map +1 -1
  209. package/build-module/range-control/styles/range-control-styles.js +34 -28
  210. package/build-module/range-control/styles/range-control-styles.js.map +1 -1
  211. package/build-module/resizable-box/resize-tooltip/utils.js.map +1 -1
  212. package/build-module/select-control/index.js +2 -3
  213. package/build-module/select-control/index.js.map +1 -1
  214. package/build-module/select-control/styles/select-control-styles.js +12 -7
  215. package/build-module/select-control/styles/select-control-styles.js.map +1 -1
  216. package/build-module/tab-panel/index.js +0 -1
  217. package/build-module/tab-panel/index.js.map +1 -1
  218. package/build-module/tabs/index.js +0 -1
  219. package/build-module/tabs/index.js.map +1 -1
  220. package/build-module/tabs/styles.js +3 -4
  221. package/build-module/tabs/styles.js.map +1 -1
  222. package/build-module/tabs/tablist.js +149 -38
  223. package/build-module/tabs/tablist.js.map +1 -1
  224. package/build-module/tabs/types.js.map +1 -1
  225. package/build-module/toggle-group-control/toggle-group-control/as-radio-group.js +0 -1
  226. package/build-module/toggle-group-control/toggle-group-control/as-radio-group.js.map +1 -1
  227. package/build-module/toggle-group-control/toggle-group-control/component.js +0 -1
  228. package/build-module/toggle-group-control/toggle-group-control/component.js.map +1 -1
  229. package/build-module/toggle-group-control/toggle-group-control-option-base/component.js +0 -2
  230. package/build-module/toggle-group-control/toggle-group-control-option-base/component.js.map +1 -1
  231. package/build-module/toolbar/toolbar/toolbar-container.js +0 -1
  232. package/build-module/toolbar/toolbar/toolbar-container.js.map +1 -1
  233. package/build-module/toolbar/toolbar/types.js.map +1 -1
  234. package/build-module/toolbar/toolbar-button/index.js +27 -19
  235. package/build-module/toolbar/toolbar-button/index.js.map +1 -1
  236. package/build-module/toolbar/toolbar-button/types.js.map +1 -1
  237. package/build-module/toolbar/toolbar-context/index.js +0 -1
  238. package/build-module/toolbar/toolbar-context/index.js.map +1 -1
  239. package/build-module/toolbar/toolbar-item/index.js +1 -1
  240. package/build-module/toolbar/toolbar-item/index.js.map +1 -1
  241. package/build-module/tooltip/index.js +3 -2
  242. package/build-module/tooltip/index.js.map +1 -1
  243. package/build-module/tooltip/types.js.map +1 -1
  244. package/build-module/unit-control/index.js +3 -3
  245. package/build-module/unit-control/index.js.map +1 -1
  246. package/build-module/unit-control/styles/unit-control-styles.js +7 -7
  247. package/build-module/unit-control/styles/unit-control-styles.js.map +1 -1
  248. package/build-module/utils/hooks/use-update-effect.js +4 -1
  249. package/build-module/utils/hooks/use-update-effect.js.map +1 -1
  250. package/build-style/style-rtl.css +46 -6
  251. package/build-style/style.css +46 -6
  252. package/build-types/animation/index.d.ts.map +1 -1
  253. package/build-types/autocomplete/autocompleter-ui.d.ts.map +1 -1
  254. package/build-types/autocomplete/index.d.ts.map +1 -1
  255. package/build-types/base-control/index.d.ts +6 -20
  256. package/build-types/base-control/index.d.ts.map +1 -1
  257. package/build-types/base-control/stories/index.story.d.ts.map +1 -1
  258. package/build-types/border-box-control/border-box-control-visualizer/component.d.ts.map +1 -1
  259. package/build-types/button/deprecated.d.ts +4 -4
  260. package/build-types/button/index.d.ts.map +1 -1
  261. package/build-types/button/stories/e2e/index.story.d.ts.map +1 -1
  262. package/build-types/button/types.d.ts +27 -10
  263. package/build-types/button/types.d.ts.map +1 -1
  264. package/build-types/combobox-control/index.d.ts.map +1 -1
  265. package/build-types/composite/current/index.d.ts.map +1 -1
  266. package/build-types/custom-select-control/stories/index.story.d.ts +15 -0
  267. package/build-types/custom-select-control/stories/index.story.d.ts.map +1 -1
  268. package/build-types/custom-select-control-v2/custom-select.d.ts +2 -2
  269. package/build-types/custom-select-control-v2/custom-select.d.ts.map +1 -1
  270. package/build-types/custom-select-control-v2/default-component/index.d.ts.map +1 -1
  271. package/build-types/custom-select-control-v2/item.d.ts.map +1 -1
  272. package/build-types/custom-select-control-v2/legacy-component/index.d.ts.map +1 -1
  273. package/build-types/custom-select-control-v2/stories/default.story.d.ts +6 -3
  274. package/build-types/custom-select-control-v2/stories/default.story.d.ts.map +1 -1
  275. package/build-types/custom-select-control-v2/styles.d.ts +18 -22
  276. package/build-types/custom-select-control-v2/styles.d.ts.map +1 -1
  277. package/build-types/custom-select-control-v2/types.d.ts +13 -2
  278. package/build-types/custom-select-control-v2/types.d.ts.map +1 -1
  279. package/build-types/date-time/date-time/index.d.ts.map +1 -1
  280. package/build-types/date-time/index.d.ts +2 -1
  281. package/build-types/date-time/index.d.ts.map +1 -1
  282. package/build-types/date-time/stories/time-input.story.d.ts +12 -0
  283. package/build-types/date-time/stories/time-input.story.d.ts.map +1 -0
  284. package/build-types/date-time/time/index.d.ts +1 -1
  285. package/build-types/date-time/time/index.d.ts.map +1 -1
  286. package/build-types/date-time/time-input/index.d.ts +5 -0
  287. package/build-types/date-time/time-input/index.d.ts.map +1 -0
  288. package/build-types/date-time/time-input/test/index.d.ts +2 -0
  289. package/build-types/date-time/time-input/test/index.d.ts.map +1 -0
  290. package/build-types/date-time/types.d.ts +54 -0
  291. package/build-types/date-time/types.d.ts.map +1 -1
  292. package/build-types/date-time/utils.d.ts +40 -0
  293. package/build-types/date-time/utils.d.ts.map +1 -1
  294. package/build-types/disclosure/index.d.ts.map +1 -1
  295. package/build-types/divider/component.d.ts.map +1 -1
  296. package/build-types/divider/types.d.ts.map +1 -1
  297. package/build-types/drop-zone/index.d.ts +3 -0
  298. package/build-types/drop-zone/index.d.ts.map +1 -1
  299. package/build-types/dropdown-menu/index.d.ts.map +1 -1
  300. package/build-types/dropdown-menu-v2/index.d.ts.map +1 -1
  301. package/build-types/dropdown-menu-v2/styles.d.ts.map +1 -1
  302. package/build-types/dropdown-menu-v2/types.d.ts.map +1 -1
  303. package/build-types/font-size-picker/styles.d.ts +1 -1
  304. package/build-types/font-size-picker/utils.d.ts.map +1 -1
  305. package/build-types/form-token-field/token.d.ts.map +1 -1
  306. package/build-types/higher-order/with-spoken-messages/index.d.ts +1 -2
  307. package/build-types/higher-order/with-spoken-messages/index.d.ts.map +1 -1
  308. package/build-types/menu-items-choice/types.d.ts +1 -1
  309. package/build-types/menu-items-choice/types.d.ts.map +1 -1
  310. package/build-types/navigator/navigator-back-button/component.d.ts +1 -1
  311. package/build-types/navigator/navigator-back-button/hook.d.ts +1 -1
  312. package/build-types/navigator/navigator-button/component.d.ts +1 -1
  313. package/build-types/navigator/navigator-button/hook.d.ts +1 -1
  314. package/build-types/navigator/navigator-to-parent-button/component.d.ts +1 -1
  315. package/build-types/palette-edit/index.d.ts.map +1 -1
  316. package/build-types/palette-edit/types.d.ts +1 -3
  317. package/build-types/palette-edit/types.d.ts.map +1 -1
  318. package/build-types/popover/index.d.ts.map +1 -1
  319. package/build-types/popover/utils.d.ts.map +1 -1
  320. package/build-types/private-apis.d.ts.map +1 -1
  321. package/build-types/progress-bar/styles.d.ts.map +1 -1
  322. package/build-types/radio-group/context.d.ts.map +1 -1
  323. package/build-types/radio-group/index.d.ts.map +1 -1
  324. package/build-types/radio-group/radio.d.ts.map +1 -1
  325. package/build-types/range-control/index.d.ts.map +1 -1
  326. package/build-types/range-control/styles/range-control-styles.d.ts.map +1 -1
  327. package/build-types/resizable-box/resize-tooltip/utils.d.ts +2 -2
  328. package/build-types/resizable-box/resize-tooltip/utils.d.ts.map +1 -1
  329. package/build-types/select-control/index.d.ts.map +1 -1
  330. package/build-types/select-control/styles/select-control-styles.d.ts +5 -0
  331. package/build-types/select-control/styles/select-control-styles.d.ts.map +1 -1
  332. package/build-types/tab-panel/index.d.ts.map +1 -1
  333. package/build-types/tabs/index.d.ts.map +1 -1
  334. package/build-types/tabs/stories/index.story.d.ts.map +1 -1
  335. package/build-types/tabs/styles.d.ts.map +1 -1
  336. package/build-types/tabs/tablist.d.ts.map +1 -1
  337. package/build-types/tabs/types.d.ts.map +1 -1
  338. package/build-types/theme/stories/index.story.d.ts.map +1 -1
  339. package/build-types/toggle-group-control/toggle-group-control/as-radio-group.d.ts.map +1 -1
  340. package/build-types/toggle-group-control/toggle-group-control/component.d.ts.map +1 -1
  341. package/build-types/toggle-group-control/toggle-group-control-option-base/component.d.ts.map +1 -1
  342. package/build-types/toolbar/toolbar/toolbar-container.d.ts.map +1 -1
  343. package/build-types/toolbar/toolbar/types.d.ts +6 -0
  344. package/build-types/toolbar/toolbar/types.d.ts.map +1 -1
  345. package/build-types/toolbar/toolbar-button/index.d.ts +3 -96
  346. package/build-types/toolbar/toolbar-button/index.d.ts.map +1 -1
  347. package/build-types/toolbar/toolbar-button/types.d.ts +18 -0
  348. package/build-types/toolbar/toolbar-button/types.d.ts.map +1 -1
  349. package/build-types/toolbar/toolbar-context/index.d.ts.map +1 -1
  350. package/build-types/toolbar/toolbar-item/index.d.ts +1 -3
  351. package/build-types/toolbar/toolbar-item/index.d.ts.map +1 -1
  352. package/build-types/tooltip/index.d.ts.map +1 -1
  353. package/build-types/tooltip/types.d.ts +4 -0
  354. package/build-types/tooltip/types.d.ts.map +1 -1
  355. package/build-types/unit-control/index.d.ts.map +1 -1
  356. package/build-types/unit-control/styles/unit-control-styles.d.ts.map +1 -1
  357. package/build-types/utils/hooks/use-update-effect.d.ts +1 -1
  358. package/build-types/utils/hooks/use-update-effect.d.ts.map +1 -1
  359. package/package.json +19 -19
  360. package/src/animation/index.tsx +0 -1
  361. package/src/autocomplete/autocompleter-ui.tsx +1 -0
  362. package/src/autocomplete/index.tsx +0 -1
  363. package/src/base-control/index.tsx +16 -6
  364. package/src/base-control/stories/index.story.tsx +0 -1
  365. package/src/border-box-control/border-box-control-visualizer/component.tsx +0 -5
  366. package/src/button/README.md +13 -0
  367. package/src/button/index.tsx +6 -4
  368. package/src/button/stories/e2e/index.story.tsx +2 -1
  369. package/src/button/test/index.tsx +17 -2
  370. package/src/button/types.ts +27 -10
  371. package/src/combobox-control/index.tsx +2 -0
  372. package/src/composite/current/index.ts +0 -2
  373. package/src/custom-select-control/stories/index.story.tsx +32 -3
  374. package/src/custom-select-control/test/index.js +247 -28
  375. package/src/custom-select-control-v2/custom-select.tsx +58 -23
  376. package/src/custom-select-control-v2/default-component/index.tsx +0 -1
  377. package/src/custom-select-control-v2/item.tsx +5 -1
  378. package/src/custom-select-control-v2/legacy-component/index.tsx +45 -16
  379. package/src/custom-select-control-v2/legacy-component/test/index.tsx +261 -43
  380. package/src/custom-select-control-v2/styles.ts +156 -74
  381. package/src/custom-select-control-v2/test/index.tsx +35 -5
  382. package/src/custom-select-control-v2/types.ts +19 -6
  383. package/src/date-time/README.md +8 -0
  384. package/src/date-time/date-time/index.tsx +2 -1
  385. package/src/date-time/index.ts +2 -1
  386. package/src/date-time/stories/time-input.story.tsx +36 -0
  387. package/src/date-time/time/index.tsx +77 -194
  388. package/src/date-time/time/test/index.tsx +61 -0
  389. package/src/date-time/time-input/index.tsx +196 -0
  390. package/src/date-time/time-input/test/index.tsx +171 -0
  391. package/src/date-time/types.ts +63 -0
  392. package/src/date-time/utils.ts +69 -0
  393. package/src/dimension-control/test/__snapshots__/index.test.js.snap +116 -96
  394. package/src/disclosure/index.tsx +0 -1
  395. package/src/divider/component.tsx +0 -1
  396. package/src/divider/types.ts +0 -1
  397. package/src/drop-zone/index.tsx +17 -76
  398. package/src/drop-zone/style.scss +51 -16
  399. package/src/dropdown-menu/index.tsx +1 -0
  400. package/src/dropdown-menu-v2/index.tsx +0 -1
  401. package/src/dropdown-menu-v2/styles.ts +0 -1
  402. package/src/dropdown-menu-v2/types.ts +0 -1
  403. package/src/font-size-picker/font-size-picker-select.tsx +1 -1
  404. package/src/font-size-picker/index.tsx +1 -1
  405. package/src/font-size-picker/test/index.tsx +6 -6
  406. package/src/font-size-picker/utils.ts +0 -5
  407. package/src/form-token-field/token.tsx +2 -0
  408. package/src/higher-order/navigate-regions/style.scss +25 -13
  409. package/src/higher-order/with-spoken-messages/index.tsx +1 -2
  410. package/src/lock-unlock.js +1 -1
  411. package/src/menu-items-choice/types.ts +2 -1
  412. package/src/palette-edit/index.tsx +33 -45
  413. package/src/palette-edit/test/index.tsx +3 -4
  414. package/src/palette-edit/types.ts +1 -3
  415. package/src/popover/index.tsx +0 -2
  416. package/src/popover/utils.ts +0 -1
  417. package/src/private-apis.ts +2 -5
  418. package/src/progress-bar/styles.ts +18 -9
  419. package/src/radio-group/context.tsx +0 -1
  420. package/src/radio-group/index.tsx +0 -1
  421. package/src/radio-group/radio.tsx +0 -1
  422. package/src/range-control/index.tsx +2 -0
  423. package/src/range-control/styles/range-control-styles.ts +6 -2
  424. package/src/resizable-box/resize-tooltip/utils.ts +1 -1
  425. package/src/select-control/index.tsx +3 -4
  426. package/src/select-control/styles/select-control-styles.ts +17 -6
  427. package/src/tab-panel/index.tsx +0 -1
  428. package/src/tabs/index.tsx +0 -1
  429. package/src/tabs/stories/index.story.tsx +25 -18
  430. package/src/tabs/styles.ts +18 -14
  431. package/src/tabs/tablist.tsx +187 -43
  432. package/src/tabs/types.ts +0 -1
  433. package/src/theme/stories/index.story.tsx +2 -0
  434. package/src/toggle-group-control/toggle-group-control/as-radio-group.tsx +0 -1
  435. package/src/toggle-group-control/toggle-group-control/component.tsx +0 -2
  436. package/src/toggle-group-control/toggle-group-control-option-base/component.tsx +0 -2
  437. package/src/toolbar/toolbar/README.md +9 -0
  438. package/src/toolbar/toolbar/style.scss +7 -0
  439. package/src/toolbar/toolbar/toolbar-container.tsx +0 -1
  440. package/src/toolbar/toolbar/types.ts +6 -0
  441. package/src/toolbar/toolbar-button/index.tsx +30 -17
  442. package/src/toolbar/toolbar-button/types.ts +19 -0
  443. package/src/toolbar/toolbar-context/index.ts +0 -1
  444. package/src/toolbar/toolbar-item/index.tsx +1 -1
  445. package/src/tooltip/index.tsx +3 -2
  446. package/src/tooltip/test/index.tsx +18 -0
  447. package/src/tooltip/types.ts +4 -0
  448. package/src/unit-control/index.tsx +3 -2
  449. package/src/unit-control/styles/unit-control-styles.ts +10 -4
  450. package/src/utils/hooks/use-update-effect.js +8 -1
  451. package/tsconfig.tsbuildinfo +1 -1
@@ -1 +1 @@
1
- {"version":3,"names":["clsx","useState","useRef","useEffect","useCallback","useMemo","__","sprintf","lineSolid","moreVertical","plus","__experimentalUseFocusOutside","useFocusOutside","useDebounce","Button","ColorPicker","FlexItem","HStack","ItemGroup","VStack","GradientPicker","ColorPalette","DropdownMenu","Popover","PaletteActionsContainer","PaletteEditStyles","PaletteHeading","IndicatorStyled","PaletteItem","NameContainer","NameInputControl","DoneButton","RemoveButton","PaletteEditContents","NavigableMenu","DEFAULT_GRADIENT","CustomGradientPicker","kebabCase","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","DEFAULT_COLOR","NameInput","value","onChange","label","hideLabelFromVision","getNameAndSlugForPosition","elements","slugPrefix","nameRegex","RegExp","position","reduce","previousValue","currentValue","slug","matches","match","id","parseInt","name","ColorPickerPopover","isGradient","element","popoverProps","receivedPopoverProps","onClose","shift","offset","resize","placement","className","children","color","enableAlpha","newColor","__experimentalIsRenderedInSidebar","gradient","newGradient","Option","canOnlyChangeValues","isEditing","onStartEditing","onRemove","onStopEditing","focusOutsideProps","popoverAnchor","setPopoverAnchor","anchor","undefined","as","onClick","trim","length","ref","justify","colorValue","nextName","size","icon","PaletteEditListView","editingElement","setEditingElement","elementsReference","current","debounceOnChange","spacing","isRounded","map","index","newElement","currentElement","currentIndex","newElements","filter","_currentElement","EMPTY_ARRAY","PaletteEdit","gradients","colors","paletteLabel","paletteLabelHeadingLevel","emptyMessage","canReset","setIsEditing","isAdding","elementsLength","hasElements","onSelectPaletteItem","newEditingElementIndex","selectedElement","key","level","isPressed","toggleProps","role","variant","clearable","disableCustomGradients","disableCustomColors"],"sources":["@wordpress/components/src/palette-edit/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseState,\n\tuseRef,\n\tuseEffect,\n\tuseCallback,\n\tuseMemo,\n} from '@wordpress/element';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { lineSolid, moreVertical, plus } from '@wordpress/icons';\nimport {\n\t__experimentalUseFocusOutside as useFocusOutside,\n\tuseDebounce,\n} from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport Button from '../button';\nimport { ColorPicker } from '../color-picker';\nimport { FlexItem } from '../flex';\nimport { HStack } from '../h-stack';\nimport { ItemGroup } from '../item-group';\nimport { VStack } from '../v-stack';\nimport GradientPicker from '../gradient-picker';\nimport ColorPalette from '../color-palette';\nimport DropdownMenu from '../dropdown-menu';\nimport Popover from '../popover';\nimport {\n\tPaletteActionsContainer,\n\tPaletteEditStyles,\n\tPaletteHeading,\n\tIndicatorStyled,\n\tPaletteItem,\n\tNameContainer,\n\tNameInputControl,\n\tDoneButton,\n\tRemoveButton,\n\tPaletteEditContents,\n} from './styles';\nimport { NavigableMenu } from '../navigable-container';\nimport { DEFAULT_GRADIENT } from '../custom-gradient-picker/constants';\nimport CustomGradientPicker from '../custom-gradient-picker';\nimport { kebabCase } from '../utils/strings';\nimport type {\n\tColor,\n\tColorPickerPopoverProps,\n\tGradient,\n\tNameInputProps,\n\tOptionProps,\n\tPaletteEditListViewProps,\n\tPaletteEditProps,\n\tPaletteElement,\n} from './types';\n\nconst DEFAULT_COLOR = '#000';\n\nfunction NameInput( { value, onChange, label }: NameInputProps ) {\n\treturn (\n\t\t<NameInputControl\n\t\t\tlabel={ label }\n\t\t\thideLabelFromVision\n\t\t\tvalue={ value }\n\t\t\tonChange={ onChange }\n\t\t/>\n\t);\n}\n\n/**\n * Returns a name and slug for a palette item. The name takes the format \"Color + id\".\n * To ensure there are no duplicate ids, this function checks all slugs.\n * It expects slugs to be in the format: slugPrefix + color- + number.\n * It then sets the id component of the new name based on the incremented id of the highest existing slug id.\n *\n * @param elements An array of color palette items.\n * @param slugPrefix The slug prefix used to match the element slug.\n *\n * @return A name and slug for the new palette item.\n */\nexport function getNameAndSlugForPosition(\n\telements: PaletteElement[],\n\tslugPrefix: string\n) {\n\tconst nameRegex = new RegExp( `^${ slugPrefix }color-([\\\\d]+)$` );\n\tconst position = elements.reduce( ( previousValue, currentValue ) => {\n\t\tif ( typeof currentValue?.slug === 'string' ) {\n\t\t\tconst matches = currentValue?.slug.match( nameRegex );\n\t\t\tif ( matches ) {\n\t\t\t\tconst id = parseInt( matches[ 1 ], 10 );\n\t\t\t\tif ( id >= previousValue ) {\n\t\t\t\t\treturn id + 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn previousValue;\n\t}, 1 );\n\n\treturn {\n\t\tname: sprintf(\n\t\t\t/* translators: %s: is an id for a custom color */\n\t\t\t__( 'Color %s' ),\n\t\t\tposition\n\t\t),\n\t\tslug: `${ slugPrefix }color-${ position }`,\n\t};\n}\n\nfunction ColorPickerPopover< T extends Color | Gradient >( {\n\tisGradient,\n\telement,\n\tonChange,\n\tpopoverProps: receivedPopoverProps,\n\tonClose = () => {},\n}: ColorPickerPopoverProps< T > ) {\n\tconst popoverProps: ColorPickerPopoverProps< T >[ 'popoverProps' ] =\n\t\tuseMemo(\n\t\t\t() => ( {\n\t\t\t\tshift: true,\n\t\t\t\toffset: 20,\n\t\t\t\t// Disabling resize as it would otherwise cause the popover to show\n\t\t\t\t// scrollbars while dragging the color picker's handle close to the\n\t\t\t\t// popover edge.\n\t\t\t\tresize: false,\n\t\t\t\tplacement: 'left-start',\n\t\t\t\t...receivedPopoverProps,\n\t\t\t\tclassName: clsx(\n\t\t\t\t\t'components-palette-edit__popover',\n\t\t\t\t\treceivedPopoverProps?.className\n\t\t\t\t),\n\t\t\t} ),\n\t\t\t[ receivedPopoverProps ]\n\t\t);\n\n\treturn (\n\t\t<Popover { ...popoverProps } onClose={ onClose }>\n\t\t\t{ ! isGradient && (\n\t\t\t\t<ColorPicker\n\t\t\t\t\tcolor={ element.color }\n\t\t\t\t\tenableAlpha\n\t\t\t\t\tonChange={ ( newColor ) => {\n\t\t\t\t\t\tonChange( {\n\t\t\t\t\t\t\t...element,\n\t\t\t\t\t\t\tcolor: newColor,\n\t\t\t\t\t\t} );\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ isGradient && (\n\t\t\t\t<div className=\"components-palette-edit__popover-gradient-picker\">\n\t\t\t\t\t<CustomGradientPicker\n\t\t\t\t\t\t__experimentalIsRenderedInSidebar\n\t\t\t\t\t\tvalue={ element.gradient }\n\t\t\t\t\t\tonChange={ ( newGradient ) => {\n\t\t\t\t\t\t\tonChange( {\n\t\t\t\t\t\t\t\t...element,\n\t\t\t\t\t\t\t\tgradient: newGradient,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</Popover>\n\t);\n}\n\nfunction Option< T extends Color | Gradient >( {\n\tcanOnlyChangeValues,\n\telement,\n\tonChange,\n\tisEditing,\n\tonStartEditing,\n\tonRemove,\n\tonStopEditing,\n\tpopoverProps: receivedPopoverProps,\n\tslugPrefix,\n\tisGradient,\n}: OptionProps< T > ) {\n\tconst focusOutsideProps = useFocusOutside( onStopEditing );\n\tconst value = isGradient ? element.gradient : element.color;\n\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the popover's anchor updates.\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState( null );\n\tconst popoverProps = useMemo(\n\t\t() => ( {\n\t\t\t...receivedPopoverProps,\n\t\t\t// Use the custom palette color item as the popover anchor.\n\t\t\tanchor: popoverAnchor,\n\t\t} ),\n\t\t[ popoverAnchor, receivedPopoverProps ]\n\t);\n\n\treturn (\n\t\t<PaletteItem\n\t\t\tclassName={ isEditing ? 'is-selected' : undefined }\n\t\t\tas={ isEditing ? 'div' : 'button' }\n\t\t\tonClick={ onStartEditing }\n\t\t\taria-label={\n\t\t\t\tisEditing\n\t\t\t\t\t? undefined\n\t\t\t\t\t: sprintf(\n\t\t\t\t\t\t\t// translators: %s is a color or gradient name, e.g. \"Red\".\n\t\t\t\t\t\t\t__( 'Edit: %s' ),\n\t\t\t\t\t\t\telement.name.trim().length ? element.name : value\n\t\t\t\t\t )\n\t\t\t}\n\t\t\tref={ setPopoverAnchor }\n\t\t\t{ ...( isEditing ? { ...focusOutsideProps } : {} ) }\n\t\t>\n\t\t\t<HStack justify=\"flex-start\">\n\t\t\t\t<IndicatorStyled colorValue={ value } />\n\t\t\t\t<FlexItem>\n\t\t\t\t\t{ isEditing && ! canOnlyChangeValues ? (\n\t\t\t\t\t\t<NameInput\n\t\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t\tisGradient\n\t\t\t\t\t\t\t\t\t? __( 'Gradient name' )\n\t\t\t\t\t\t\t\t\t: __( 'Color name' )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tvalue={ element.name }\n\t\t\t\t\t\t\tonChange={ ( nextName?: string ) =>\n\t\t\t\t\t\t\t\tonChange( {\n\t\t\t\t\t\t\t\t\t...element,\n\t\t\t\t\t\t\t\t\tname: nextName,\n\t\t\t\t\t\t\t\t\tslug:\n\t\t\t\t\t\t\t\t\t\tslugPrefix +\n\t\t\t\t\t\t\t\t\t\tkebabCase( nextName ?? '' ),\n\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<NameContainer>\n\t\t\t\t\t\t\t{ element.name.trim().length\n\t\t\t\t\t\t\t\t? element.name\n\t\t\t\t\t\t\t\t: /* Fall back to non-breaking space to maintain height */\n\t\t\t\t\t\t\t\t '\\u00A0' }\n\t\t\t\t\t\t</NameContainer>\n\t\t\t\t\t) }\n\t\t\t\t</FlexItem>\n\t\t\t\t{ isEditing && ! canOnlyChangeValues && (\n\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t<RemoveButton\n\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\ticon={ lineSolid }\n\t\t\t\t\t\t\tlabel={ __( 'Remove color' ) }\n\t\t\t\t\t\t\tonClick={ onRemove }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</FlexItem>\n\t\t\t\t) }\n\t\t\t</HStack>\n\t\t\t{ isEditing && (\n\t\t\t\t<ColorPickerPopover\n\t\t\t\t\tisGradient={ isGradient }\n\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\telement={ element }\n\t\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</PaletteItem>\n\t);\n}\n\nfunction PaletteEditListView< T extends Color | Gradient >( {\n\telements,\n\tonChange,\n\teditingElement,\n\tsetEditingElement,\n\tcanOnlyChangeValues,\n\tslugPrefix,\n\tisGradient,\n\tpopoverProps,\n}: PaletteEditListViewProps< T > ) {\n\t// When unmounting the component if there are empty elements (the user did not complete the insertion) clean them.\n\tconst elementsReference = useRef< typeof elements >();\n\tuseEffect( () => {\n\t\telementsReference.current = elements;\n\t}, [ elements ] );\n\n\tconst debounceOnChange = useDebounce( onChange, 100 );\n\n\treturn (\n\t\t<VStack spacing={ 3 }>\n\t\t\t<ItemGroup isRounded>\n\t\t\t\t{ elements.map( ( element, index ) => (\n\t\t\t\t\t<Option\n\t\t\t\t\t\tisGradient={ isGradient }\n\t\t\t\t\t\tcanOnlyChangeValues={ canOnlyChangeValues }\n\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\telement={ element }\n\t\t\t\t\t\tonStartEditing={ () => {\n\t\t\t\t\t\t\tif ( editingElement !== index ) {\n\t\t\t\t\t\t\t\tsetEditingElement( index );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tonChange={ ( newElement ) => {\n\t\t\t\t\t\t\tdebounceOnChange(\n\t\t\t\t\t\t\t\telements.map(\n\t\t\t\t\t\t\t\t\t( currentElement, currentIndex ) => {\n\t\t\t\t\t\t\t\t\t\tif ( currentIndex === index ) {\n\t\t\t\t\t\t\t\t\t\t\treturn newElement;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\treturn currentElement;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tonRemove={ () => {\n\t\t\t\t\t\t\tsetEditingElement( null );\n\t\t\t\t\t\t\tconst newElements = elements.filter(\n\t\t\t\t\t\t\t\t( _currentElement, currentIndex ) => {\n\t\t\t\t\t\t\t\t\tif ( currentIndex === index ) {\n\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tonChange(\n\t\t\t\t\t\t\t\tnewElements.length ? newElements : undefined\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tisEditing={ index === editingElement }\n\t\t\t\t\t\tonStopEditing={ () => {\n\t\t\t\t\t\t\tif ( index === editingElement ) {\n\t\t\t\t\t\t\t\tsetEditingElement( null );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tslugPrefix={ slugPrefix }\n\t\t\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\t\t/>\n\t\t\t\t) ) }\n\t\t\t</ItemGroup>\n\t\t</VStack>\n\t);\n}\n\nconst EMPTY_ARRAY: Color[] = [];\n\n/**\n * Allows editing a palette of colors or gradients.\n *\n * ```jsx\n * import { PaletteEdit } from '@wordpress/components';\n * const MyPaletteEdit = () => {\n * const [ controlledColors, setControlledColors ] = useState( colors );\n *\n * return (\n * <PaletteEdit\n * colors={ controlledColors }\n * onChange={ ( newColors?: Color[] ) => {\n * setControlledColors( newColors );\n * } }\n * paletteLabel=\"Here is a label\"\n * />\n * );\n * };\n * ```\n */\nexport function PaletteEdit( {\n\tgradients,\n\tcolors = EMPTY_ARRAY,\n\tonChange,\n\tpaletteLabel,\n\tpaletteLabelHeadingLevel = 2,\n\temptyMessage,\n\tcanOnlyChangeValues,\n\tcanReset,\n\tslugPrefix = '',\n\tpopoverProps,\n}: PaletteEditProps ) {\n\tconst isGradient = !! gradients;\n\tconst elements = isGradient ? gradients : colors;\n\tconst [ isEditing, setIsEditing ] = useState( false );\n\tconst [ editingElement, setEditingElement ] = useState<\n\t\tnumber | null | undefined\n\t>( null );\n\tconst isAdding =\n\t\tisEditing &&\n\t\t!! editingElement &&\n\t\telements[ editingElement ] &&\n\t\t! elements[ editingElement ].slug;\n\tconst elementsLength = elements.length;\n\tconst hasElements = elementsLength > 0;\n\tconst debounceOnChange = useDebounce( onChange, 100 );\n\tconst onSelectPaletteItem = useCallback(\n\t\t(\n\t\t\tvalue?: PaletteElement[ keyof PaletteElement ],\n\t\t\tnewEditingElementIndex?: number\n\t\t) => {\n\t\t\tconst selectedElement =\n\t\t\t\tnewEditingElementIndex === undefined\n\t\t\t\t\t? undefined\n\t\t\t\t\t: elements[ newEditingElementIndex ];\n\t\t\tconst key = isGradient ? 'gradient' : 'color';\n\t\t\t// Ensures that the index returned matches a known element value.\n\t\t\tif ( !! selectedElement && selectedElement[ key ] === value ) {\n\t\t\t\tsetEditingElement( newEditingElementIndex );\n\t\t\t} else {\n\t\t\t\tsetIsEditing( true );\n\t\t\t}\n\t\t},\n\t\t[ isGradient, elements ]\n\t);\n\n\treturn (\n\t\t<PaletteEditStyles>\n\t\t\t<HStack>\n\t\t\t\t<PaletteHeading level={ paletteLabelHeadingLevel }>\n\t\t\t\t\t{ paletteLabel }\n\t\t\t\t</PaletteHeading>\n\t\t\t\t<PaletteActionsContainer>\n\t\t\t\t\t{ hasElements && isEditing && (\n\t\t\t\t\t\t<DoneButton\n\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tsetIsEditing( false );\n\t\t\t\t\t\t\t\tsetEditingElement( null );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Done' ) }\n\t\t\t\t\t\t</DoneButton>\n\t\t\t\t\t) }\n\t\t\t\t\t{ ! canOnlyChangeValues && (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\tisPressed={ isAdding }\n\t\t\t\t\t\t\ticon={ plus }\n\t\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t\tisGradient\n\t\t\t\t\t\t\t\t\t? __( 'Add gradient' )\n\t\t\t\t\t\t\t\t\t: __( 'Add color' )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tconst { name, slug } =\n\t\t\t\t\t\t\t\t\tgetNameAndSlugForPosition(\n\t\t\t\t\t\t\t\t\t\telements,\n\t\t\t\t\t\t\t\t\t\tslugPrefix\n\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\tif ( !! gradients ) {\n\t\t\t\t\t\t\t\t\tonChange( [\n\t\t\t\t\t\t\t\t\t\t...gradients,\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tgradient: DEFAULT_GRADIENT,\n\t\t\t\t\t\t\t\t\t\t\tname,\n\t\t\t\t\t\t\t\t\t\t\tslug,\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t] );\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tonChange( [\n\t\t\t\t\t\t\t\t\t\t...colors,\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tcolor: DEFAULT_COLOR,\n\t\t\t\t\t\t\t\t\t\t\tname,\n\t\t\t\t\t\t\t\t\t\t\tslug,\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t] );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tsetIsEditing( true );\n\t\t\t\t\t\t\t\tsetEditingElement( elements.length );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\n\t\t\t\t\t{ hasElements &&\n\t\t\t\t\t\t( ! isEditing ||\n\t\t\t\t\t\t\t! canOnlyChangeValues ||\n\t\t\t\t\t\t\tcanReset ) && (\n\t\t\t\t\t\t\t<DropdownMenu\n\t\t\t\t\t\t\t\ticon={ moreVertical }\n\t\t\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t\t\tisGradient\n\t\t\t\t\t\t\t\t\t\t? __( 'Gradient options' )\n\t\t\t\t\t\t\t\t\t\t: __( 'Color options' )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\ttoggleProps={ {\n\t\t\t\t\t\t\t\t\tsize: 'small',\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ ( { onClose }: { onClose: () => void } ) => (\n\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t<NavigableMenu role=\"menu\">\n\t\t\t\t\t\t\t\t\t\t\t{ ! isEditing && (\n\t\t\t\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tsetIsEditing( true );\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"components-palette-edit__menu-button\"\n\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t{ __( 'Show details' ) }\n\t\t\t\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t{ ! canOnlyChangeValues && (\n\t\t\t\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tsetEditingElement(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnull\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tsetIsEditing( false );\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tonChange();\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"components-palette-edit__menu-button\"\n\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t{ isGradient\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t? __(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'Remove all gradients'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t: __(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'Remove all colors'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t ) }\n\t\t\t\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t{ canReset && (\n\t\t\t\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tsetEditingElement(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnull\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tonChange();\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t{ isGradient\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t? __( 'Reset gradient' )\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t: __( 'Reset colors' ) }\n\t\t\t\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t</NavigableMenu>\n\t\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</DropdownMenu>\n\t\t\t\t\t\t) }\n\t\t\t\t</PaletteActionsContainer>\n\t\t\t</HStack>\n\t\t\t{ hasElements && (\n\t\t\t\t<PaletteEditContents>\n\t\t\t\t\t{ isEditing && (\n\t\t\t\t\t\t<PaletteEditListView< ( typeof elements )[ number ] >\n\t\t\t\t\t\t\tcanOnlyChangeValues={ canOnlyChangeValues }\n\t\t\t\t\t\t\telements={ elements }\n\t\t\t\t\t\t\t// @ts-expect-error TODO: Don't know how to resolve\n\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t\teditingElement={ editingElement }\n\t\t\t\t\t\t\tsetEditingElement={ setEditingElement }\n\t\t\t\t\t\t\tslugPrefix={ slugPrefix }\n\t\t\t\t\t\t\tisGradient={ isGradient }\n\t\t\t\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ ! isEditing && editingElement !== null && (\n\t\t\t\t\t\t<ColorPickerPopover\n\t\t\t\t\t\t\tisGradient={ isGradient }\n\t\t\t\t\t\t\tonClose={ () => setEditingElement( null ) }\n\t\t\t\t\t\t\tonChange={ (\n\t\t\t\t\t\t\t\tnewElement: ( typeof elements )[ number ]\n\t\t\t\t\t\t\t) => {\n\t\t\t\t\t\t\t\tdebounceOnChange(\n\t\t\t\t\t\t\t\t\t// @ts-expect-error TODO: Don't know how to resolve\n\t\t\t\t\t\t\t\t\telements.map(\n\t\t\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t\t\tcurrentElement: ( typeof elements )[ number ],\n\t\t\t\t\t\t\t\t\t\t\tcurrentIndex: number\n\t\t\t\t\t\t\t\t\t\t) => {\n\t\t\t\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\t\t\t\tcurrentIndex === editingElement\n\t\t\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\t\t\treturn newElement;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\treturn currentElement;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\telement={ elements[ editingElement ?? -1 ] }\n\t\t\t\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ ! isEditing &&\n\t\t\t\t\t\t( isGradient ? (\n\t\t\t\t\t\t\t<GradientPicker\n\t\t\t\t\t\t\t\tgradients={ gradients }\n\t\t\t\t\t\t\t\tonChange={ onSelectPaletteItem }\n\t\t\t\t\t\t\t\tclearable={ false }\n\t\t\t\t\t\t\t\tdisableCustomGradients\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<ColorPalette\n\t\t\t\t\t\t\t\tcolors={ colors }\n\t\t\t\t\t\t\t\tonChange={ onSelectPaletteItem }\n\t\t\t\t\t\t\t\tclearable={ false }\n\t\t\t\t\t\t\t\tdisableCustomColors\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) ) }\n\t\t\t\t</PaletteEditContents>\n\t\t\t) }\n\t\t\t{ ! hasElements && emptyMessage && (\n\t\t\t\t<PaletteEditContents>{ emptyMessage }</PaletteEditContents>\n\t\t\t) }\n\t\t</PaletteEditStyles>\n\t);\n}\n\nexport default PaletteEdit;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SACCC,QAAQ,EACRC,MAAM,EACNC,SAAS,EACTC,WAAW,EACXC,OAAO,QACD,oBAAoB;AAC3B,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,SAAS,EAAEC,YAAY,EAAEC,IAAI,QAAQ,kBAAkB;AAChE,SACCC,6BAA6B,IAAIC,eAAe,EAChDC,WAAW,QACL,oBAAoB;;AAE3B;AACA;AACA;AACA,OAAOC,MAAM,MAAM,WAAW;AAC9B,SAASC,WAAW,QAAQ,iBAAiB;AAC7C,SAASC,QAAQ,QAAQ,SAAS;AAClC,SAASC,MAAM,QAAQ,YAAY;AACnC,SAASC,SAAS,QAAQ,eAAe;AACzC,SAASC,MAAM,QAAQ,YAAY;AACnC,OAAOC,cAAc,MAAM,oBAAoB;AAC/C,OAAOC,YAAY,MAAM,kBAAkB;AAC3C,OAAOC,YAAY,MAAM,kBAAkB;AAC3C,OAAOC,OAAO,MAAM,YAAY;AAChC,SACCC,uBAAuB,EACvBC,iBAAiB,EACjBC,cAAc,EACdC,eAAe,EACfC,WAAW,EACXC,aAAa,EACbC,gBAAgB,EAChBC,UAAU,EACVC,YAAY,EACZC,mBAAmB,QACb,UAAU;AACjB,SAASC,aAAa,QAAQ,wBAAwB;AACtD,SAASC,gBAAgB,QAAQ,qCAAqC;AACtE,OAAOC,oBAAoB,MAAM,2BAA2B;AAC5D,SAASC,SAAS,QAAQ,kBAAkB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAAA,SAAAC,QAAA,IAAAC,SAAA;AAY7C,MAAMC,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AC5CrC,YAAY,EAAGA;MAAc,CAC7B,CACD,EACC,CAAEiB,SAAS,KACVnB,UAAU,gBACX3B,IAAA,CAACnB,cAAc;QACdsG,SAAS,EAAGA,SAAW;QACvB3E,QAAQ,EAAGqF,mBAAqB;QAChCS,SAAS,EAAG,KAAO;QACnBC,sBAAsB;MAAA,CACtB,CAAC,gBAEFvG,IAAA,CAAClB,YAAY;QACZsG,MAAM,EAAGA,MAAQ;QACjB5E,QAAQ,EAAGqF,mBAAqB;QAChCS,SAAS,EAAG,KAAO;QACnBE,mBAAmB;MAAA,CACnB,CACD,CAAE;IAAA,CACgB,CACrB,EACC,CAAEZ,WAAW,IAAIL,YAAY,iBAC9BvF,IAAA,CAACN,mBAAmB;MAAA2C,QAAA,EAAGkD;IAAY,CAAuB,CAC1D;EAAA,CACiB,CAAC;AAEtB;AAEA,eAAeL,WAAW","ignoreList":[]}
1
+ {"version":3,"names":["clsx","useState","useRef","useEffect","useCallback","useMemo","__","sprintf","lineSolid","moreVertical","plus","useDebounce","Button","ColorPicker","FlexItem","HStack","ItemGroup","VStack","GradientPicker","ColorPalette","DropdownMenu","Popover","PaletteActionsContainer","PaletteEditStyles","PaletteHeading","IndicatorStyled","PaletteItem","NameContainer","NameInputControl","DoneButton","RemoveButton","PaletteEditContents","NavigableMenu","DEFAULT_GRADIENT","CustomGradientPicker","kebabCase","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","DEFAULT_COLOR","NameInput","value","onChange","label","hideLabelFromVision","getNameAndSlugForPosition","elements","slugPrefix","nameRegex","RegExp","position","reduce","previousValue","currentValue","slug","matches","match","id","parseInt","name","ColorPickerPopover","isGradient","element","popoverProps","receivedPopoverProps","onClose","shift","offset","resize","placement","className","children","color","enableAlpha","newColor","__experimentalIsRenderedInSidebar","gradient","newGradient","Option","canOnlyChangeValues","onRemove","isEditingColor","setIsEditingColor","popoverAnchor","setPopoverAnchor","anchor","ref","as","justify","onClick","trim","length","style","padding","colorValue","nextName","size","icon","PaletteEditListView","addColorRef","elementsReference","current","debounceOnChange","spacing","isRounded","map","index","newElement","currentElement","currentIndex","newElements","filter","_currentElement","undefined","focus","EMPTY_ARRAY","PaletteEdit","gradients","colors","paletteLabel","paletteLabelHeadingLevel","emptyMessage","canReset","isEditing","setIsEditing","editingElement","setEditingElement","isAdding","elementsLength","hasElements","onSelectPaletteItem","newEditingElementIndex","selectedElement","key","level","isPressed","toggleProps","role","variant","clearable","disableCustomGradients","disableCustomColors"],"sources":["@wordpress/components/src/palette-edit/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseState,\n\tuseRef,\n\tuseEffect,\n\tuseCallback,\n\tuseMemo,\n} from '@wordpress/element';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { lineSolid, moreVertical, plus } from '@wordpress/icons';\nimport { useDebounce } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport Button from '../button';\nimport { ColorPicker } from '../color-picker';\nimport { FlexItem } from '../flex';\nimport { HStack } from '../h-stack';\nimport { ItemGroup } from '../item-group';\nimport { VStack } from '../v-stack';\nimport GradientPicker from '../gradient-picker';\nimport ColorPalette from '../color-palette';\nimport DropdownMenu from '../dropdown-menu';\nimport Popover from '../popover';\nimport {\n\tPaletteActionsContainer,\n\tPaletteEditStyles,\n\tPaletteHeading,\n\tIndicatorStyled,\n\tPaletteItem,\n\tNameContainer,\n\tNameInputControl,\n\tDoneButton,\n\tRemoveButton,\n\tPaletteEditContents,\n} from './styles';\nimport { NavigableMenu } from '../navigable-container';\nimport { DEFAULT_GRADIENT } from '../custom-gradient-picker/constants';\nimport CustomGradientPicker from '../custom-gradient-picker';\nimport { kebabCase } from '../utils/strings';\nimport type {\n\tColor,\n\tColorPickerPopoverProps,\n\tGradient,\n\tNameInputProps,\n\tOptionProps,\n\tPaletteEditListViewProps,\n\tPaletteEditProps,\n\tPaletteElement,\n} from './types';\n\nconst DEFAULT_COLOR = '#000';\n\nfunction NameInput( { value, onChange, label }: NameInputProps ) {\n\treturn (\n\t\t<NameInputControl\n\t\t\tlabel={ label }\n\t\t\thideLabelFromVision\n\t\t\tvalue={ value }\n\t\t\tonChange={ onChange }\n\t\t/>\n\t);\n}\n\n/**\n * Returns a name and slug for a palette item. The name takes the format \"Color + id\".\n * To ensure there are no duplicate ids, this function checks all slugs.\n * It expects slugs to be in the format: slugPrefix + color- + number.\n * It then sets the id component of the new name based on the incremented id of the highest existing slug id.\n *\n * @param elements An array of color palette items.\n * @param slugPrefix The slug prefix used to match the element slug.\n *\n * @return A name and slug for the new palette item.\n */\nexport function getNameAndSlugForPosition(\n\telements: PaletteElement[],\n\tslugPrefix: string\n) {\n\tconst nameRegex = new RegExp( `^${ slugPrefix }color-([\\\\d]+)$` );\n\tconst position = elements.reduce( ( previousValue, currentValue ) => {\n\t\tif ( typeof currentValue?.slug === 'string' ) {\n\t\t\tconst matches = currentValue?.slug.match( nameRegex );\n\t\t\tif ( matches ) {\n\t\t\t\tconst id = parseInt( matches[ 1 ], 10 );\n\t\t\t\tif ( id >= previousValue ) {\n\t\t\t\t\treturn id + 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn previousValue;\n\t}, 1 );\n\n\treturn {\n\t\tname: sprintf(\n\t\t\t/* translators: %s: is an id for a custom color */\n\t\t\t__( 'Color %s' ),\n\t\t\tposition\n\t\t),\n\t\tslug: `${ slugPrefix }color-${ position }`,\n\t};\n}\n\nfunction ColorPickerPopover< T extends Color | Gradient >( {\n\tisGradient,\n\telement,\n\tonChange,\n\tpopoverProps: receivedPopoverProps,\n\tonClose = () => {},\n}: ColorPickerPopoverProps< T > ) {\n\tconst popoverProps: ColorPickerPopoverProps< T >[ 'popoverProps' ] =\n\t\tuseMemo(\n\t\t\t() => ( {\n\t\t\t\tshift: true,\n\t\t\t\toffset: 20,\n\t\t\t\t// Disabling resize as it would otherwise cause the popover to show\n\t\t\t\t// scrollbars while dragging the color picker's handle close to the\n\t\t\t\t// popover edge.\n\t\t\t\tresize: false,\n\t\t\t\tplacement: 'left-start',\n\t\t\t\t...receivedPopoverProps,\n\t\t\t\tclassName: clsx(\n\t\t\t\t\t'components-palette-edit__popover',\n\t\t\t\t\treceivedPopoverProps?.className\n\t\t\t\t),\n\t\t\t} ),\n\t\t\t[ receivedPopoverProps ]\n\t\t);\n\n\treturn (\n\t\t<Popover { ...popoverProps } onClose={ onClose }>\n\t\t\t{ ! isGradient && (\n\t\t\t\t<ColorPicker\n\t\t\t\t\tcolor={ element.color }\n\t\t\t\t\tenableAlpha\n\t\t\t\t\tonChange={ ( newColor ) => {\n\t\t\t\t\t\tonChange( {\n\t\t\t\t\t\t\t...element,\n\t\t\t\t\t\t\tcolor: newColor,\n\t\t\t\t\t\t} );\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ isGradient && (\n\t\t\t\t<div className=\"components-palette-edit__popover-gradient-picker\">\n\t\t\t\t\t<CustomGradientPicker\n\t\t\t\t\t\t__experimentalIsRenderedInSidebar\n\t\t\t\t\t\tvalue={ element.gradient }\n\t\t\t\t\t\tonChange={ ( newGradient ) => {\n\t\t\t\t\t\t\tonChange( {\n\t\t\t\t\t\t\t\t...element,\n\t\t\t\t\t\t\t\tgradient: newGradient,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</Popover>\n\t);\n}\n\nfunction Option< T extends Color | Gradient >( {\n\tcanOnlyChangeValues,\n\telement,\n\tonChange,\n\tonRemove,\n\tpopoverProps: receivedPopoverProps,\n\tslugPrefix,\n\tisGradient,\n}: OptionProps< T > ) {\n\tconst value = isGradient ? element.gradient : element.color;\n\tconst [ isEditingColor, setIsEditingColor ] = useState( false );\n\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the popover's anchor updates.\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState( null );\n\tconst popoverProps = useMemo(\n\t\t() => ( {\n\t\t\t...receivedPopoverProps,\n\t\t\t// Use the custom palette color item as the popover anchor.\n\t\t\tanchor: popoverAnchor,\n\t\t} ),\n\t\t[ popoverAnchor, receivedPopoverProps ]\n\t);\n\n\treturn (\n\t\t<PaletteItem ref={ setPopoverAnchor } as=\"div\">\n\t\t\t<HStack justify=\"flex-start\">\n\t\t\t\t<Button\n\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\tsetIsEditingColor( true );\n\t\t\t\t\t} }\n\t\t\t\t\taria-label={ sprintf(\n\t\t\t\t\t\t// translators: %s is a color or gradient name, e.g. \"Red\".\n\t\t\t\t\t\t__( 'Edit: %s' ),\n\t\t\t\t\t\telement.name.trim().length ? element.name : value\n\t\t\t\t\t) }\n\t\t\t\t\tstyle={ { padding: 0 } }\n\t\t\t\t>\n\t\t\t\t\t<IndicatorStyled colorValue={ value } />\n\t\t\t\t</Button>\n\t\t\t\t<FlexItem>\n\t\t\t\t\t{ ! canOnlyChangeValues ? (\n\t\t\t\t\t\t<NameInput\n\t\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t\tisGradient\n\t\t\t\t\t\t\t\t\t? __( 'Gradient name' )\n\t\t\t\t\t\t\t\t\t: __( 'Color name' )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tvalue={ element.name }\n\t\t\t\t\t\t\tonChange={ ( nextName?: string ) =>\n\t\t\t\t\t\t\t\tonChange( {\n\t\t\t\t\t\t\t\t\t...element,\n\t\t\t\t\t\t\t\t\tname: nextName,\n\t\t\t\t\t\t\t\t\tslug:\n\t\t\t\t\t\t\t\t\t\tslugPrefix +\n\t\t\t\t\t\t\t\t\t\tkebabCase( nextName ?? '' ),\n\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<NameContainer>\n\t\t\t\t\t\t\t{ element.name.trim().length\n\t\t\t\t\t\t\t\t? element.name\n\t\t\t\t\t\t\t\t: /* Fall back to non-breaking space to maintain height */\n\t\t\t\t\t\t\t\t '\\u00A0' }\n\t\t\t\t\t\t</NameContainer>\n\t\t\t\t\t) }\n\t\t\t\t</FlexItem>\n\t\t\t\t{ ! canOnlyChangeValues && (\n\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t<RemoveButton\n\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\ticon={ lineSolid }\n\t\t\t\t\t\t\tlabel={ sprintf(\n\t\t\t\t\t\t\t\t// translators: %s is a color or gradient name, e.g. \"Red\".\n\t\t\t\t\t\t\t\t__( 'Remove color: %s' ),\n\t\t\t\t\t\t\t\telement.name.trim().length\n\t\t\t\t\t\t\t\t\t? element.name\n\t\t\t\t\t\t\t\t\t: value\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tonClick={ onRemove }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</FlexItem>\n\t\t\t\t) }\n\t\t\t</HStack>\n\t\t\t{ isEditingColor && (\n\t\t\t\t<ColorPickerPopover\n\t\t\t\t\tisGradient={ isGradient }\n\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\telement={ element }\n\t\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\t\tonClose={ () => setIsEditingColor( false ) }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</PaletteItem>\n\t);\n}\n\nfunction PaletteEditListView< T extends Color | Gradient >( {\n\telements,\n\tonChange,\n\tcanOnlyChangeValues,\n\tslugPrefix,\n\tisGradient,\n\tpopoverProps,\n\taddColorRef,\n}: PaletteEditListViewProps< T > ) {\n\t// When unmounting the component if there are empty elements (the user did not complete the insertion) clean them.\n\tconst elementsReference = useRef< typeof elements >();\n\tuseEffect( () => {\n\t\telementsReference.current = elements;\n\t}, [ elements ] );\n\n\tconst debounceOnChange = useDebounce( onChange, 100 );\n\n\treturn (\n\t\t<VStack spacing={ 3 }>\n\t\t\t<ItemGroup isRounded>\n\t\t\t\t{ elements.map( ( element, index ) => (\n\t\t\t\t\t<Option\n\t\t\t\t\t\tisGradient={ isGradient }\n\t\t\t\t\t\tcanOnlyChangeValues={ canOnlyChangeValues }\n\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\telement={ element }\n\t\t\t\t\t\tonChange={ ( newElement ) => {\n\t\t\t\t\t\t\tdebounceOnChange(\n\t\t\t\t\t\t\t\telements.map(\n\t\t\t\t\t\t\t\t\t( currentElement, currentIndex ) => {\n\t\t\t\t\t\t\t\t\t\tif ( currentIndex === index ) {\n\t\t\t\t\t\t\t\t\t\t\treturn newElement;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\treturn currentElement;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tonRemove={ () => {\n\t\t\t\t\t\t\tconst newElements = elements.filter(\n\t\t\t\t\t\t\t\t( _currentElement, currentIndex ) => {\n\t\t\t\t\t\t\t\t\tif ( currentIndex === index ) {\n\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tonChange(\n\t\t\t\t\t\t\t\tnewElements.length ? newElements : undefined\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\taddColorRef.current?.focus();\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tslugPrefix={ slugPrefix }\n\t\t\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\t\t/>\n\t\t\t\t) ) }\n\t\t\t</ItemGroup>\n\t\t</VStack>\n\t);\n}\n\nconst EMPTY_ARRAY: Color[] = [];\n\n/**\n * Allows editing a palette of colors or gradients.\n *\n * ```jsx\n * import { PaletteEdit } from '@wordpress/components';\n * const MyPaletteEdit = () => {\n * const [ controlledColors, setControlledColors ] = useState( colors );\n *\n * return (\n * <PaletteEdit\n * colors={ controlledColors }\n * onChange={ ( newColors?: Color[] ) => {\n * setControlledColors( newColors );\n * } }\n * paletteLabel=\"Here is a label\"\n * />\n * );\n * };\n * ```\n */\nexport function PaletteEdit( {\n\tgradients,\n\tcolors = EMPTY_ARRAY,\n\tonChange,\n\tpaletteLabel,\n\tpaletteLabelHeadingLevel = 2,\n\temptyMessage,\n\tcanOnlyChangeValues,\n\tcanReset,\n\tslugPrefix = '',\n\tpopoverProps,\n}: PaletteEditProps ) {\n\tconst isGradient = !! gradients;\n\tconst elements = isGradient ? gradients : colors;\n\tconst [ isEditing, setIsEditing ] = useState( false );\n\tconst [ editingElement, setEditingElement ] = useState<\n\t\tnumber | null | undefined\n\t>( null );\n\tconst isAdding =\n\t\tisEditing &&\n\t\t!! editingElement &&\n\t\telements[ editingElement ] &&\n\t\t! elements[ editingElement ].slug;\n\tconst elementsLength = elements.length;\n\tconst hasElements = elementsLength > 0;\n\tconst debounceOnChange = useDebounce( onChange, 100 );\n\tconst onSelectPaletteItem = useCallback(\n\t\t(\n\t\t\tvalue?: PaletteElement[ keyof PaletteElement ],\n\t\t\tnewEditingElementIndex?: number\n\t\t) => {\n\t\t\tconst selectedElement =\n\t\t\t\tnewEditingElementIndex === undefined\n\t\t\t\t\t? undefined\n\t\t\t\t\t: elements[ newEditingElementIndex ];\n\t\t\tconst key = isGradient ? 'gradient' : 'color';\n\t\t\t// Ensures that the index returned matches a known element value.\n\t\t\tif ( !! selectedElement && selectedElement[ key ] === value ) {\n\t\t\t\tsetEditingElement( newEditingElementIndex );\n\t\t\t} else {\n\t\t\t\tsetIsEditing( true );\n\t\t\t}\n\t\t},\n\t\t[ isGradient, elements ]\n\t);\n\n\tconst addColorRef = useRef< HTMLButtonElement | null >( null );\n\n\treturn (\n\t\t<PaletteEditStyles>\n\t\t\t<HStack>\n\t\t\t\t<PaletteHeading level={ paletteLabelHeadingLevel }>\n\t\t\t\t\t{ paletteLabel }\n\t\t\t\t</PaletteHeading>\n\t\t\t\t<PaletteActionsContainer>\n\t\t\t\t\t{ hasElements && isEditing && (\n\t\t\t\t\t\t<DoneButton\n\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tsetIsEditing( false );\n\t\t\t\t\t\t\t\tsetEditingElement( null );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Done' ) }\n\t\t\t\t\t\t</DoneButton>\n\t\t\t\t\t) }\n\t\t\t\t\t{ ! canOnlyChangeValues && (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tref={ addColorRef }\n\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\tisPressed={ isAdding }\n\t\t\t\t\t\t\ticon={ plus }\n\t\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t\tisGradient\n\t\t\t\t\t\t\t\t\t? __( 'Add gradient' )\n\t\t\t\t\t\t\t\t\t: __( 'Add color' )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tconst { name, slug } =\n\t\t\t\t\t\t\t\t\tgetNameAndSlugForPosition(\n\t\t\t\t\t\t\t\t\t\telements,\n\t\t\t\t\t\t\t\t\t\tslugPrefix\n\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\tif ( !! gradients ) {\n\t\t\t\t\t\t\t\t\tonChange( [\n\t\t\t\t\t\t\t\t\t\t...gradients,\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tgradient: DEFAULT_GRADIENT,\n\t\t\t\t\t\t\t\t\t\t\tname,\n\t\t\t\t\t\t\t\t\t\t\tslug,\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t] );\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tonChange( [\n\t\t\t\t\t\t\t\t\t\t...colors,\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tcolor: DEFAULT_COLOR,\n\t\t\t\t\t\t\t\t\t\t\tname,\n\t\t\t\t\t\t\t\t\t\t\tslug,\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t] );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tsetIsEditing( true );\n\t\t\t\t\t\t\t\tsetEditingElement( elements.length );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\n\t\t\t\t\t{ hasElements &&\n\t\t\t\t\t\t( ! isEditing ||\n\t\t\t\t\t\t\t! canOnlyChangeValues ||\n\t\t\t\t\t\t\tcanReset ) && (\n\t\t\t\t\t\t\t<DropdownMenu\n\t\t\t\t\t\t\t\ticon={ moreVertical }\n\t\t\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t\t\tisGradient\n\t\t\t\t\t\t\t\t\t\t? __( 'Gradient options' )\n\t\t\t\t\t\t\t\t\t\t: __( 'Color options' )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\ttoggleProps={ {\n\t\t\t\t\t\t\t\t\tsize: 'small',\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ ( { onClose }: { onClose: () => void } ) => (\n\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t<NavigableMenu role=\"menu\">\n\t\t\t\t\t\t\t\t\t\t\t{ ! isEditing && (\n\t\t\t\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tsetIsEditing( true );\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"components-palette-edit__menu-button\"\n\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t{ __( 'Show details' ) }\n\t\t\t\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t{ ! canOnlyChangeValues && (\n\t\t\t\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tsetEditingElement(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnull\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tsetIsEditing( false );\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tonChange();\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"components-palette-edit__menu-button\"\n\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t{ isGradient\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t? __(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'Remove all gradients'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t: __(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'Remove all colors'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t ) }\n\t\t\t\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t{ canReset && (\n\t\t\t\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tsetEditingElement(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnull\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tonChange();\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t{ isGradient\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t? __( 'Reset gradient' )\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t: __( 'Reset colors' ) }\n\t\t\t\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t</NavigableMenu>\n\t\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</DropdownMenu>\n\t\t\t\t\t\t) }\n\t\t\t\t</PaletteActionsContainer>\n\t\t\t</HStack>\n\t\t\t{ hasElements && (\n\t\t\t\t<PaletteEditContents>\n\t\t\t\t\t{ isEditing && (\n\t\t\t\t\t\t<PaletteEditListView< ( typeof elements )[ number ] >\n\t\t\t\t\t\t\tcanOnlyChangeValues={ canOnlyChangeValues }\n\t\t\t\t\t\t\telements={ elements }\n\t\t\t\t\t\t\t// @ts-expect-error TODO: Don't know how to resolve\n\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t\tslugPrefix={ slugPrefix }\n\t\t\t\t\t\t\tisGradient={ isGradient }\n\t\t\t\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\t\t\t\taddColorRef={ addColorRef }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ ! isEditing && editingElement !== null && (\n\t\t\t\t\t\t<ColorPickerPopover\n\t\t\t\t\t\t\tisGradient={ isGradient }\n\t\t\t\t\t\t\tonClose={ () => setEditingElement( null ) }\n\t\t\t\t\t\t\tonChange={ (\n\t\t\t\t\t\t\t\tnewElement: ( typeof elements )[ number ]\n\t\t\t\t\t\t\t) => {\n\t\t\t\t\t\t\t\tdebounceOnChange(\n\t\t\t\t\t\t\t\t\t// @ts-expect-error TODO: Don't know how to resolve\n\t\t\t\t\t\t\t\t\telements.map(\n\t\t\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t\t\tcurrentElement: ( typeof elements )[ number ],\n\t\t\t\t\t\t\t\t\t\t\tcurrentIndex: number\n\t\t\t\t\t\t\t\t\t\t) => {\n\t\t\t\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\t\t\t\tcurrentIndex === editingElement\n\t\t\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\t\t\treturn newElement;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\treturn currentElement;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\telement={ elements[ editingElement ?? -1 ] }\n\t\t\t\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ ! isEditing &&\n\t\t\t\t\t\t( isGradient ? (\n\t\t\t\t\t\t\t<GradientPicker\n\t\t\t\t\t\t\t\tgradients={ gradients }\n\t\t\t\t\t\t\t\tonChange={ onSelectPaletteItem }\n\t\t\t\t\t\t\t\tclearable={ false }\n\t\t\t\t\t\t\t\tdisableCustomGradients\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<ColorPalette\n\t\t\t\t\t\t\t\tcolors={ colors }\n\t\t\t\t\t\t\t\tonChange={ onSelectPaletteItem }\n\t\t\t\t\t\t\t\tclearable={ false }\n\t\t\t\t\t\t\t\tdisableCustomColors\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) ) }\n\t\t\t\t</PaletteEditContents>\n\t\t\t) }\n\t\t\t{ ! hasElements && emptyMessage && (\n\t\t\t\t<PaletteEditContents>{ emptyMessage }</PaletteEditContents>\n\t\t\t) }\n\t\t</PaletteEditStyles>\n\t);\n}\n\nexport default PaletteEdit;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SACCC,QAAQ,EACRC,MAAM,EACNC,SAAS,EACTC,WAAW,EACXC,OAAO,QACD,oBAAoB;AAC3B,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,SAAS,EAAEC,YAAY,EAAEC,IAAI,QAAQ,kBAAkB;AAChE,SAASC,WAAW,QAAQ,oBAAoB;;AAEhD;AACA;AACA;AACA,OAAOC,MAAM,MAAM,WAAW;AAC9B,SAASC,WAAW,QAAQ,iBAAiB;AAC7C,SAASC,QAAQ,QAAQ,SAAS;AAClC,SAASC,MAAM,QAAQ,YAAY;AACnC,SAASC,SAAS,QAAQ,eAAe;AACzC,SAASC,MAAM,QAAQ,YAAY;AACnC,OAAOC,cAAc,MAAM,oBAAoB;AAC/C,OAAOC,YAAY,MAAM,kBAAkB;AAC3C,OAAOC,YAAY,MAAM,kBAAkB;AAC3C,OAAOC,OAAO,MAAM,YAAY;AAChC,SACCC,uBAAuB,EACvBC,iBAAiB,EACjBC,cAAc,EACdC,eAAe,EACfC,WAAW,EACXC,aAAa,EACbC,gBAAgB,EAChBC,UAAU,EACVC,YAAY,EACZC,mBAAmB,QACb,UAAU;AACjB,SAASC,aAAa,QAAQ,wBAAwB;AACtD,SAASC,gBAAgB,QAAQ,qCAAqC;AACtE,OAAOC,oBAAoB,MAAM,2BAA2B;AAC5D,SAASC,SAAS,QAAQ,kBAAkB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAAA,SAAAC,QAAA,IAAAC,SAAA;AA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AAc;QACdsG,SAAS,EAAGA,SAAW;QACvB3E,QAAQ,EAAGwF,mBAAqB;QAChCS,SAAS,EAAG,KAAO;QACnBC,sBAAsB;MAAA,CACtB,CAAC,gBAEF1G,IAAA,CAAClB,YAAY;QACZsG,MAAM,EAAGA,MAAQ;QACjB5E,QAAQ,EAAGwF,mBAAqB;QAChCS,SAAS,EAAG,KAAO;QACnBE,mBAAmB;MAAA,CACnB,CACD,CAAE;IAAA,CACgB,CACrB,EACC,CAAEZ,WAAW,IAAIR,YAAY,iBAC9BvF,IAAA,CAACN,mBAAmB;MAAA2C,QAAA,EAAGkD;IAAY,CAAuB,CAC1D;EAAA,CACiB,CAAC;AAEtB;AAEA,eAAeL,WAAW","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["@wordpress/components/src/palette-edit/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { Key, MouseEventHandler } from 'react';\n\n/**\n * Internal dependencies\n */\nimport type Popover from '../popover';\nimport type { HeadingSize } from '../heading/types';\n\nexport type Color = {\n\tcolor: string;\n\tname: string;\n\tslug: string;\n\tgradient?: never;\n};\n\nexport type Gradient = {\n\tgradient: string;\n\tname: string;\n\tslug: string;\n\tcolor?: never;\n};\n\nexport type PaletteElement = Color | Gradient;\n\nexport type BasePaletteEdit = {\n\t/**\n\t * Whether the user can only change the color or gradient values.\n\t * If true, they cannot change names or delete values.\n\t *\n\t * @default false\n\t */\n\tcanOnlyChangeValues?: boolean;\n\t/**\n\t * Whether the user can reset the editor.\n\t *\n\t * @default false\n\t */\n\tcanReset?: boolean;\n\t/**\n\t * A message to show if there's nothing to edit.\n\t */\n\temptyMessage?: string;\n\t/**\n\t * A heading label for the palette.\n\t */\n\tpaletteLabel: string;\n\t/**\n\t * The label's heading level.\n\t *\n\t * @default 2\n\t */\n\tpaletteLabelHeadingLevel?: HeadingSize;\n\t/**\n\t * The prefix for the element slug.\n\t *\n\t * @default ''\n\t */\n\tslugPrefix?: string;\n\t/**\n\t * Props to pass through to the underlying Popover component.\n\t */\n\tpopoverProps?: Omit<\n\t\tReact.ComponentPropsWithoutRef< typeof Popover >,\n\t\t'children'\n\t>;\n};\n\ntype PaletteEditColors = {\n\t/**\n\t * The colors in the palette.\n\t */\n\tcolors?: Color[];\n\t/**\n\t * Runs on changing the value.\n\t */\n\tonChange: ( values?: Color[] ) => void;\n\tgradients?: never;\n};\n\ntype PaletteEditGradients = {\n\t/**\n\t * The gradients in the palette.\n\t */\n\tgradients: Gradient[];\n\t/**\n\t * Runs on changing the value.\n\t */\n\tonChange: ( values?: Gradient[] ) => void;\n\tcolors?: never;\n};\n\nexport type PaletteEditProps = BasePaletteEdit &\n\t( PaletteEditColors | PaletteEditGradients );\n\ntype EditingElement = number | null;\n\nexport type ColorPickerPopoverProps< T extends Color | Gradient > = {\n\telement: T;\n\tonChange: ( newElement: T ) => void;\n\tisGradient?: T extends Gradient ? true : false;\n\tonClose?: () => void;\n\tpopoverProps?: PaletteEditProps[ 'popoverProps' ];\n};\n\nexport type NameInputProps = {\n\tlabel: string;\n\tonChange: ( nextName?: PaletteElement[ 'name' ] ) => void;\n\tvalue: PaletteElement[ 'name' ];\n};\n\nexport type OptionProps< T extends Color | Gradient > = {\n\telement: T;\n\tonChange: ( newElement: T ) => void;\n\tisGradient: T extends Gradient ? true : false;\n\tcanOnlyChangeValues: PaletteEditProps[ 'canOnlyChangeValues' ];\n\tisEditing: boolean;\n\tkey: Key;\n\tonRemove: MouseEventHandler< HTMLButtonElement >;\n\tonStartEditing: () => void;\n\tonStopEditing: () => void;\n\tpopoverProps?: PaletteEditProps[ 'popoverProps' ];\n\tslugPrefix: string;\n};\n\nexport type PaletteEditListViewProps< T extends Color | Gradient > = {\n\telements: T[];\n\tonChange: ( newElements?: T[] ) => void;\n\tisGradient: T extends Gradient ? true : false;\n\tcanOnlyChangeValues: PaletteEditProps[ 'canOnlyChangeValues' ];\n\teditingElement?: EditingElement;\n\tpopoverProps?: PaletteEditProps[ 'popoverProps' ];\n\tsetEditingElement: ( newEditingElement?: EditingElement ) => void;\n\tslugPrefix: string;\n};\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["@wordpress/components/src/palette-edit/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { Key, MouseEventHandler } from 'react';\n\n/**\n * Internal dependencies\n */\nimport type Popover from '../popover';\nimport type { HeadingSize } from '../heading/types';\n\nexport type Color = {\n\tcolor: string;\n\tname: string;\n\tslug: string;\n\tgradient?: never;\n};\n\nexport type Gradient = {\n\tgradient: string;\n\tname: string;\n\tslug: string;\n\tcolor?: never;\n};\n\nexport type PaletteElement = Color | Gradient;\n\nexport type BasePaletteEdit = {\n\t/**\n\t * Whether the user can only change the color or gradient values.\n\t * If true, they cannot change names or delete values.\n\t *\n\t * @default false\n\t */\n\tcanOnlyChangeValues?: boolean;\n\t/**\n\t * Whether the user can reset the editor.\n\t *\n\t * @default false\n\t */\n\tcanReset?: boolean;\n\t/**\n\t * A message to show if there's nothing to edit.\n\t */\n\temptyMessage?: string;\n\t/**\n\t * A heading label for the palette.\n\t */\n\tpaletteLabel: string;\n\t/**\n\t * The label's heading level.\n\t *\n\t * @default 2\n\t */\n\tpaletteLabelHeadingLevel?: HeadingSize;\n\t/**\n\t * The prefix for the element slug.\n\t *\n\t * @default ''\n\t */\n\tslugPrefix?: string;\n\t/**\n\t * Props to pass through to the underlying Popover component.\n\t */\n\tpopoverProps?: Omit<\n\t\tReact.ComponentPropsWithoutRef< typeof Popover >,\n\t\t'children'\n\t>;\n};\n\ntype PaletteEditColors = {\n\t/**\n\t * The colors in the palette.\n\t */\n\tcolors?: Color[];\n\t/**\n\t * Runs on changing the value.\n\t */\n\tonChange: ( values?: Color[] ) => void;\n\tgradients?: never;\n};\n\ntype PaletteEditGradients = {\n\t/**\n\t * The gradients in the palette.\n\t */\n\tgradients: Gradient[];\n\t/**\n\t * Runs on changing the value.\n\t */\n\tonChange: ( values?: Gradient[] ) => void;\n\tcolors?: never;\n};\n\nexport type PaletteEditProps = BasePaletteEdit &\n\t( PaletteEditColors | PaletteEditGradients );\n\ntype EditingElement = number | null;\n\nexport type ColorPickerPopoverProps< T extends Color | Gradient > = {\n\telement: T;\n\tonChange: ( newElement: T ) => void;\n\tisGradient?: T extends Gradient ? true : false;\n\tonClose?: () => void;\n\tpopoverProps?: PaletteEditProps[ 'popoverProps' ];\n};\n\nexport type NameInputProps = {\n\tlabel: string;\n\tonChange: ( nextName?: PaletteElement[ 'name' ] ) => void;\n\tvalue: PaletteElement[ 'name' ];\n};\n\nexport type OptionProps< T extends Color | Gradient > = {\n\telement: T;\n\tonChange: ( newElement: T ) => void;\n\tisGradient: T extends Gradient ? true : false;\n\tcanOnlyChangeValues: PaletteEditProps[ 'canOnlyChangeValues' ];\n\tkey: Key;\n\tonRemove: MouseEventHandler< HTMLButtonElement >;\n\tpopoverProps?: PaletteEditProps[ 'popoverProps' ];\n\tslugPrefix: string;\n};\n\nexport type PaletteEditListViewProps< T extends Color | Gradient > = {\n\telements: T[];\n\tonChange: ( newElements?: T[] ) => void;\n\tisGradient: T extends Gradient ? true : false;\n\tcanOnlyChangeValues: PaletteEditProps[ 'canOnlyChangeValues' ];\n\taddColorRef: React.RefObject< HTMLButtonElement >;\n\teditingElement?: EditingElement;\n\tpopoverProps?: PaletteEditProps[ 'popoverProps' ];\n\tsetEditingElement: ( newEditingElement?: EditingElement ) => void;\n\tslugPrefix: string;\n};\n"],"mappings":"","ignoreList":[]}
@@ -4,9 +4,6 @@
4
4
 
5
5
  import clsx from 'clsx';
6
6
  import { useFloating, flip as flipMiddleware, shift as shiftMiddleware, limitShift, autoUpdate, arrow, offset as offsetMiddleware, size } from '@floating-ui/react-dom';
7
- // eslint-disable-next-line no-restricted-imports
8
-
9
- // eslint-disable-next-line no-restricted-imports
10
7
  import { motion } from 'framer-motion';
11
8
 
12
9
  /**
@@ -1 +1 @@
1
- {"version":3,"names":["clsx","useFloating","flip","flipMiddleware","shift","shiftMiddleware","limitShift","autoUpdate","arrow","offset","offsetMiddleware","size","motion","useRef","useLayoutEffect","forwardRef","createContext","useContext","useMemo","useState","useCallback","createPortal","useReducedMotion","useViewportMatch","useMergeRefs","__experimentalUseDialog","useDialog","close","deprecated","Path","SVG","Button","ScrollLock","Slot","Fill","useSlot","computePopoverPosition","positionToPlacement","placementToMotionAnimationProps","getReferenceElement","contextConnect","useContextSystem","overlayMiddlewares","StyleProvider","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","SLOT_NAME","ArrowTriangle","xmlns","viewBox","className","role","children","d","vectorEffect","slotNameContext","undefined","fallbackContainerClassname","getPopoverFallbackContainer","container","document","body","querySelector","createElement","append","UnforwardedPopover","props","forwardedRef","animate","headerTitle","constrainTabbing","onClose","noArrow","position","placement","placementProp","offsetProp","focusOnMount","anchor","expandOnMobile","onFocusOutside","__unstableSlotName","resize","inline","variant","__unstableForcePosition","anchorRef","anchorRect","getAnchorRect","isAlternate","contentProps","computedFlipProp","computedResizeProp","since","version","alternative","computedVariant","arrowRef","fallbackReferenceElement","setFallbackReferenceElement","anchorRefFallback","node","isMobileViewport","isExpanded","hasArrow","normalizedPlacementFromProps","middleware","apply","sizeProps","_refs$floating$curren","firstElementChild","refs","floating","current","HTMLElement","Object","assign","style","maxHeight","availableHeight","overflow","crossAxis","limiter","padding","element","slotName","slot","onDialogClose","type","event","dialogRef","dialogProps","__unstableOnClose","x","y","strategy","update","computedPlacement","middlewareData","arrowData","whileElementsMounted","referenceParam","floatingParam","updateParam","layoutShift","animationFrame","arrowCallbackRef","anchorRefTop","top","anchorRefBottom","bottom","anchorRefStartContainer","startContainer","anchorRefCurrent","resultingReferenceElement","setReference","mergedFloatingRef","setFloating","left","shouldReduceMotion","shouldAnimate","animationFinished","setAnimationFinished","motionInlineStyles","otherMotionProps","animationProps","onAnimationComplete","isPositioned","content","div","ref","tabIndex","icon","onClick","split","join","Number","isFinite","shouldRenderWithinSlot","hasAnchor","name","Popover","PopoverSlot","bubblesVirtually","__unstableSlotNameProvider","Provider"],"sources":["@wordpress/components/src/popover/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef, SyntheticEvent, RefCallback } from 'react';\nimport clsx from 'clsx';\nimport {\n\tuseFloating,\n\tflip as flipMiddleware,\n\tshift as shiftMiddleware,\n\tlimitShift,\n\tautoUpdate,\n\tarrow,\n\toffset as offsetMiddleware,\n\tsize,\n} from '@floating-ui/react-dom';\n// eslint-disable-next-line no-restricted-imports\nimport type { HTMLMotionProps, MotionProps } from 'framer-motion';\n// eslint-disable-next-line no-restricted-imports\nimport { motion } from 'framer-motion';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseRef,\n\tuseLayoutEffect,\n\tforwardRef,\n\tcreateContext,\n\tuseContext,\n\tuseMemo,\n\tuseState,\n\tuseCallback,\n\tcreatePortal,\n} from '@wordpress/element';\nimport {\n\tuseReducedMotion,\n\tuseViewportMatch,\n\tuseMergeRefs,\n\t__experimentalUseDialog as useDialog,\n} from '@wordpress/compose';\nimport { close } from '@wordpress/icons';\nimport deprecated from '@wordpress/deprecated';\nimport { Path, SVG } from '@wordpress/primitives';\n\n/**\n * Internal dependencies\n */\nimport Button from '../button';\nimport ScrollLock from '../scroll-lock';\nimport { Slot, Fill, useSlot } from '../slot-fill';\nimport {\n\tcomputePopoverPosition,\n\tpositionToPlacement,\n\tplacementToMotionAnimationProps,\n\tgetReferenceElement,\n} from './utils';\nimport { contextConnect, useContextSystem } from '../context';\nimport type { WordPressComponentProps } from '../context';\nimport type {\n\tPopoverProps,\n\tPopoverAnchorRefReference,\n\tPopoverAnchorRefTopBottom,\n} from './types';\nimport { overlayMiddlewares } from './overlay-middlewares';\nimport { StyleProvider } from '../style-provider';\n\n/**\n * Name of slot in which popover should fill.\n *\n * @type {string}\n */\nexport const SLOT_NAME = 'Popover';\n\n// An SVG displaying a triangle facing down, filled with a solid\n// color and bordered in such a way to create an arrow-like effect.\n// Keeping the SVG's viewbox squared simplify the arrow positioning\n// calculations.\nconst ArrowTriangle = () => (\n\t<SVG\n\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\tviewBox=\"0 0 100 100\"\n\t\tclassName=\"components-popover__triangle\"\n\t\trole=\"presentation\"\n\t>\n\t\t<Path\n\t\t\tclassName=\"components-popover__triangle-bg\"\n\t\t\td=\"M 0 0 L 50 50 L 100 0\"\n\t\t/>\n\t\t<Path\n\t\t\tclassName=\"components-popover__triangle-border\"\n\t\t\td=\"M 0 0 L 50 50 L 100 0\"\n\t\t\tvectorEffect=\"non-scaling-stroke\"\n\t\t/>\n\t</SVG>\n);\n\nconst slotNameContext = createContext< string | undefined >( undefined );\n\nconst fallbackContainerClassname = 'components-popover__fallback-container';\nconst getPopoverFallbackContainer = () => {\n\tlet container = document.body.querySelector(\n\t\t'.' + fallbackContainerClassname\n\t);\n\tif ( ! container ) {\n\t\tcontainer = document.createElement( 'div' );\n\t\tcontainer.className = fallbackContainerClassname;\n\t\tdocument.body.append( container );\n\t}\n\n\treturn container;\n};\n\nconst UnforwardedPopover = (\n\tprops: Omit<\n\t\tWordPressComponentProps< PopoverProps, 'div', false >,\n\t\t// To avoid overlaps between the standard HTML attributes and the props\n\t\t// expected by `framer-motion`, omit all framer motion props from popover\n\t\t// props (except for `animate` and `children`, which are re-defined in `PopoverProps`).\n\t\tkeyof Omit< MotionProps, 'animate' | 'children' >\n\t>,\n\tforwardedRef: ForwardedRef< any >\n) => {\n\tconst {\n\t\tanimate = true,\n\t\theaderTitle,\n\t\tconstrainTabbing,\n\t\tonClose,\n\t\tchildren,\n\t\tclassName,\n\t\tnoArrow = true,\n\t\tposition,\n\t\tplacement: placementProp = 'bottom-start',\n\t\toffset: offsetProp = 0,\n\t\tfocusOnMount = 'firstElement',\n\t\tanchor,\n\t\texpandOnMobile,\n\t\tonFocusOutside,\n\t\t__unstableSlotName = SLOT_NAME,\n\t\tflip = true,\n\t\tresize = true,\n\t\tshift = false,\n\t\tinline = false,\n\t\tvariant,\n\n\t\t// Deprecated props\n\t\t__unstableForcePosition,\n\t\tanchorRef,\n\t\tanchorRect,\n\t\tgetAnchorRect,\n\t\tisAlternate,\n\n\t\t// Rest\n\t\t...contentProps\n\t} = useContextSystem( props, 'Popover' );\n\n\tlet computedFlipProp = flip;\n\tlet computedResizeProp = resize;\n\tif ( __unstableForcePosition !== undefined ) {\n\t\tdeprecated( '`__unstableForcePosition` prop in wp.components.Popover', {\n\t\t\tsince: '6.1',\n\t\t\tversion: '6.3',\n\t\t\talternative: '`flip={ false }` and `resize={ false }`',\n\t\t} );\n\n\t\t// Back-compat, set the `flip` and `resize` props\n\t\t// to `false` to replicate `__unstableForcePosition`.\n\t\tcomputedFlipProp = ! __unstableForcePosition;\n\t\tcomputedResizeProp = ! __unstableForcePosition;\n\t}\n\n\tif ( anchorRef !== undefined ) {\n\t\tdeprecated( '`anchorRef` prop in wp.components.Popover', {\n\t\t\tsince: '6.1',\n\t\t\talternative: '`anchor` prop',\n\t\t} );\n\t}\n\n\tif ( anchorRect !== undefined ) {\n\t\tdeprecated( '`anchorRect` prop in wp.components.Popover', {\n\t\t\tsince: '6.1',\n\t\t\talternative: '`anchor` prop',\n\t\t} );\n\t}\n\n\tif ( getAnchorRect !== undefined ) {\n\t\tdeprecated( '`getAnchorRect` prop in wp.components.Popover', {\n\t\t\tsince: '6.1',\n\t\t\talternative: '`anchor` prop',\n\t\t} );\n\t}\n\n\tconst computedVariant = isAlternate ? 'toolbar' : variant;\n\tif ( isAlternate !== undefined ) {\n\t\tdeprecated( '`isAlternate` prop in wp.components.Popover', {\n\t\t\tsince: '6.2',\n\t\t\talternative: \"`variant` prop with the `'toolbar'` value\",\n\t\t} );\n\t}\n\n\tconst arrowRef = useRef< HTMLElement | null >( null );\n\n\tconst [ fallbackReferenceElement, setFallbackReferenceElement ] =\n\t\tuseState< HTMLSpanElement | null >( null );\n\n\tconst anchorRefFallback: RefCallback< HTMLSpanElement > = useCallback(\n\t\t( node ) => {\n\t\t\tsetFallbackReferenceElement( node );\n\t\t},\n\t\t[]\n\t);\n\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst isExpanded = expandOnMobile && isMobileViewport;\n\tconst hasArrow = ! isExpanded && ! noArrow;\n\tconst normalizedPlacementFromProps = position\n\t\t? positionToPlacement( position )\n\t\t: placementProp;\n\n\tconst middleware = [\n\t\t...( placementProp === 'overlay' ? overlayMiddlewares() : [] ),\n\t\toffsetMiddleware( offsetProp ),\n\t\tcomputedFlipProp && flipMiddleware(),\n\t\tcomputedResizeProp &&\n\t\t\tsize( {\n\t\t\t\tapply( sizeProps ) {\n\t\t\t\t\tconst { firstElementChild } = refs.floating.current ?? {};\n\n\t\t\t\t\t// Only HTMLElement instances have the `style` property.\n\t\t\t\t\tif ( ! ( firstElementChild instanceof HTMLElement ) ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Reduce the height of the popover to the available space.\n\t\t\t\t\tObject.assign( firstElementChild.style, {\n\t\t\t\t\t\tmaxHeight: `${ sizeProps.availableHeight }px`,\n\t\t\t\t\t\toverflow: 'auto',\n\t\t\t\t\t} );\n\t\t\t\t},\n\t\t\t} ),\n\t\tshift &&\n\t\t\tshiftMiddleware( {\n\t\t\t\tcrossAxis: true,\n\t\t\t\tlimiter: limitShift(),\n\t\t\t\tpadding: 1, // Necessary to avoid flickering at the edge of the viewport.\n\t\t\t} ),\n\t\tarrow( { element: arrowRef } ),\n\t];\n\tconst slotName = useContext( slotNameContext ) || __unstableSlotName;\n\tconst slot = useSlot( slotName );\n\n\tlet onDialogClose;\n\n\tif ( onClose || onFocusOutside ) {\n\t\tonDialogClose = ( type: string | undefined, event: SyntheticEvent ) => {\n\t\t\t// Ideally the popover should have just a single onClose prop and\n\t\t\t// not three props that potentially do the same thing.\n\t\t\tif ( type === 'focus-outside' && onFocusOutside ) {\n\t\t\t\tonFocusOutside( event );\n\t\t\t} else if ( onClose ) {\n\t\t\t\tonClose();\n\t\t\t}\n\t\t};\n\t}\n\n\tconst [ dialogRef, dialogProps ] = useDialog( {\n\t\tconstrainTabbing,\n\t\tfocusOnMount,\n\t\t__unstableOnClose: onDialogClose,\n\t\t// @ts-expect-error The __unstableOnClose property needs to be deprecated first (see https://github.com/WordPress/gutenberg/pull/27675)\n\t\tonClose: onDialogClose,\n\t} );\n\n\tconst {\n\t\t// Positioning coordinates\n\t\tx,\n\t\ty,\n\t\t// Object with \"regular\" refs to both \"reference\" and \"floating\"\n\t\trefs,\n\t\t// Type of CSS position property to use (absolute or fixed)\n\t\tstrategy,\n\t\tupdate,\n\t\tplacement: computedPlacement,\n\t\tmiddlewareData: { arrow: arrowData },\n\t} = useFloating( {\n\t\tplacement:\n\t\t\tnormalizedPlacementFromProps === 'overlay'\n\t\t\t\t? undefined\n\t\t\t\t: normalizedPlacementFromProps,\n\t\tmiddleware,\n\t\twhileElementsMounted: ( referenceParam, floatingParam, updateParam ) =>\n\t\t\tautoUpdate( referenceParam, floatingParam, updateParam, {\n\t\t\t\tlayoutShift: false,\n\t\t\t\tanimationFrame: true,\n\t\t\t} ),\n\t} );\n\n\tconst arrowCallbackRef = useCallback(\n\t\t( node: HTMLElement | null ) => {\n\t\t\tarrowRef.current = node;\n\t\t\tupdate();\n\t\t},\n\t\t[ update ]\n\t);\n\n\t// When any of the possible anchor \"sources\" change,\n\t// recompute the reference element (real or virtual) and its owner document.\n\n\tconst anchorRefTop = ( anchorRef as PopoverAnchorRefTopBottom | undefined )\n\t\t?.top;\n\tconst anchorRefBottom = (\n\t\tanchorRef as PopoverAnchorRefTopBottom | undefined\n\t )?.bottom;\n\tconst anchorRefStartContainer = ( anchorRef as Range | undefined )\n\t\t?.startContainer;\n\tconst anchorRefCurrent = ( anchorRef as PopoverAnchorRefReference )\n\t\t?.current;\n\n\tuseLayoutEffect( () => {\n\t\tconst resultingReferenceElement = getReferenceElement( {\n\t\t\tanchor,\n\t\t\tanchorRef,\n\t\t\tanchorRect,\n\t\t\tgetAnchorRect,\n\t\t\tfallbackReferenceElement,\n\t\t} );\n\n\t\trefs.setReference( resultingReferenceElement );\n\t}, [\n\t\tanchor,\n\t\tanchorRef,\n\t\tanchorRefTop,\n\t\tanchorRefBottom,\n\t\tanchorRefStartContainer,\n\t\tanchorRefCurrent,\n\t\tanchorRect,\n\t\tgetAnchorRect,\n\t\tfallbackReferenceElement,\n\t\trefs,\n\t] );\n\n\tconst mergedFloatingRef = useMergeRefs( [\n\t\trefs.setFloating,\n\t\tdialogRef,\n\t\tforwardedRef,\n\t] );\n\n\tconst style = isExpanded\n\t\t? undefined\n\t\t: {\n\t\t\t\tposition: strategy,\n\t\t\t\ttop: 0,\n\t\t\t\tleft: 0,\n\t\t\t\t// `x` and `y` are framer-motion specific props and are shorthands\n\t\t\t\t// for `translateX` and `translateY`. Currently it is not possible\n\t\t\t\t// to use `translateX` and `translateY` because those values would\n\t\t\t\t// be overridden by the return value of the\n\t\t\t\t// `placementToMotionAnimationProps` function.\n\t\t\t\tx: computePopoverPosition( x ),\n\t\t\t\ty: computePopoverPosition( y ),\n\t\t };\n\n\tconst shouldReduceMotion = useReducedMotion();\n\tconst shouldAnimate = animate && ! isExpanded && ! shouldReduceMotion;\n\n\tconst [ animationFinished, setAnimationFinished ] = useState( false );\n\n\tconst { style: motionInlineStyles, ...otherMotionProps } = useMemo(\n\t\t() => placementToMotionAnimationProps( computedPlacement ),\n\t\t[ computedPlacement ]\n\t);\n\n\tconst animationProps: HTMLMotionProps< 'div' > = shouldAnimate\n\t\t? {\n\t\t\t\tstyle: {\n\t\t\t\t\t...motionInlineStyles,\n\t\t\t\t\t...style,\n\t\t\t\t},\n\t\t\t\tonAnimationComplete: () => setAnimationFinished( true ),\n\t\t\t\t...otherMotionProps,\n\t\t }\n\t\t: {\n\t\t\t\tanimate: false,\n\t\t\t\tstyle,\n\t\t };\n\n\t// When Floating UI has finished positioning and Framer Motion has finished animating\n\t// the popover, add the `is-positioned` class to signal that all transitions have finished.\n\tconst isPositioned =\n\t\t( ! shouldAnimate || animationFinished ) && x !== null && y !== null;\n\n\tlet content = (\n\t\t<motion.div\n\t\t\tclassName={ clsx( className, {\n\t\t\t\t'is-expanded': isExpanded,\n\t\t\t\t'is-positioned': isPositioned,\n\t\t\t\t// Use the 'alternate' classname for 'toolbar' variant for back compat.\n\t\t\t\t[ `is-${\n\t\t\t\t\tcomputedVariant === 'toolbar'\n\t\t\t\t\t\t? 'alternate'\n\t\t\t\t\t\t: computedVariant\n\t\t\t\t}` ]: computedVariant,\n\t\t\t} ) }\n\t\t\t{ ...animationProps }\n\t\t\t{ ...contentProps }\n\t\t\tref={ mergedFloatingRef }\n\t\t\t{ ...dialogProps }\n\t\t\ttabIndex={ -1 }\n\t\t>\n\t\t\t{ /* Prevents scroll on the document */ }\n\t\t\t{ isExpanded && <ScrollLock /> }\n\t\t\t{ isExpanded && (\n\t\t\t\t<div className=\"components-popover__header\">\n\t\t\t\t\t<span className=\"components-popover__header-title\">\n\t\t\t\t\t\t{ headerTitle }\n\t\t\t\t\t</span>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tclassName=\"components-popover__close\"\n\t\t\t\t\t\ticon={ close }\n\t\t\t\t\t\tonClick={ onClose }\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t\t<div className=\"components-popover__content\">{ children }</div>\n\t\t\t{ hasArrow && (\n\t\t\t\t<div\n\t\t\t\t\tref={ arrowCallbackRef }\n\t\t\t\t\tclassName={ [\n\t\t\t\t\t\t'components-popover__arrow',\n\t\t\t\t\t\t`is-${ computedPlacement.split( '-' )[ 0 ] }`,\n\t\t\t\t\t].join( ' ' ) }\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\tleft:\n\t\t\t\t\t\t\ttypeof arrowData?.x !== 'undefined' &&\n\t\t\t\t\t\t\tNumber.isFinite( arrowData.x )\n\t\t\t\t\t\t\t\t? `${ arrowData.x }px`\n\t\t\t\t\t\t\t\t: '',\n\t\t\t\t\t\ttop:\n\t\t\t\t\t\t\ttypeof arrowData?.y !== 'undefined' &&\n\t\t\t\t\t\t\tNumber.isFinite( arrowData.y )\n\t\t\t\t\t\t\t\t? `${ arrowData.y }px`\n\t\t\t\t\t\t\t\t: '',\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t<ArrowTriangle />\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</motion.div>\n\t);\n\n\tconst shouldRenderWithinSlot = slot.ref && ! inline;\n\tconst hasAnchor = anchorRef || anchorRect || anchor;\n\n\tif ( shouldRenderWithinSlot ) {\n\t\tcontent = <Fill name={ slotName }>{ content }</Fill>;\n\t} else if ( ! inline ) {\n\t\tcontent = createPortal(\n\t\t\t<StyleProvider document={ document }>{ content }</StyleProvider>,\n\t\t\tgetPopoverFallbackContainer()\n\t\t);\n\t}\n\n\tif ( hasAnchor ) {\n\t\treturn content;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<span ref={ anchorRefFallback } />\n\t\t\t{ content }\n\t\t</>\n\t);\n};\n\n/**\n * `Popover` renders its content in a floating modal. If no explicit anchor is passed via props, it anchors to its parent element by default.\n *\n * ```jsx\n * import { Button, Popover } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MyPopover = () => {\n * \tconst [ isVisible, setIsVisible ] = useState( false );\n * \tconst toggleVisible = () => {\n * \t\tsetIsVisible( ( state ) => ! state );\n * \t};\n *\n * \treturn (\n * \t\t<Button variant=\"secondary\" onClick={ toggleVisible }>\n * \t\t\tToggle Popover!\n * \t\t\t{ isVisible && <Popover>Popover is toggled!</Popover> }\n * \t\t</Button>\n * \t);\n * };\n * ```\n *\n */\nexport const Popover = contextConnect( UnforwardedPopover, 'Popover' );\n\nfunction PopoverSlot(\n\t{ name = SLOT_NAME }: { name?: string },\n\tref: ForwardedRef< any >\n) {\n\treturn (\n\t\t<Slot\n\t\t\tbubblesVirtually\n\t\t\tname={ name }\n\t\t\tclassName=\"popover-slot\"\n\t\t\tref={ ref }\n\t\t/>\n\t);\n}\n\n// @ts-expect-error For Legacy Reasons\nPopover.Slot = forwardRef( PopoverSlot );\n// @ts-expect-error For Legacy Reasons\nPopover.__unstableSlotNameProvider = slotNameContext.Provider;\n\nexport default Popover;\n"],"mappings":"AAAA;AACA;AACA;;AAEA,OAAOA,IAAI,MAAM,MAAM;AACvB,SACCC,WAAW,EACXC,IAAI,IAAIC,cAAc,EACtBC,KAAK,IAAIC,eAAe,EACxBC,UAAU,EACVC,UAAU,EACVC,KAAK,EACLC,MAAM,IAAIC,gBAAgB,EAC1BC,IAAI,QACE,wBAAwB;AAC/B;;AAEA;AACA,SAASC,MAAM,QAAQ,eAAe;;AAEtC;AACA;AACA;AACA,SACCC,MAAM,EACNC,eAAe,EACfC,UAAU,EACVC,aAAa,EACbC,UAAU,EACVC,OAAO,EACPC,QAAQ,EACRC,WAAW,EACXC,YAAY,QACN,oBAAoB;AAC3B,SACCC,gBAAgB,EAChBC,gBAAgB,EAChBC,YAAY,EACZC,uBAAuB,IAAIC,SAAS,QAC9B,oBAAoB;AAC3B,SAASC,KAAK,QAAQ,kBAAkB;AACxC,OAAOC,UAAU,MAAM,uBAAuB;AAC9C,SAASC,IAAI,EAAEC,GAAG,QAAQ,uBAAuB;;AAEjD;AACA;AACA;AACA,OAAOC,MAAM,MAAM,WAAW;AAC9B,OAAOC,UAAU,MAAM,gBAAgB;AACvC,SAASC,IAAI,EAAEC,IAAI,EAAEC,OAAO,QAAQ,cAAc;AAClD,SACCC,sBAAsB,EACtBC,mBAAmB,EACnBC,+BAA+B,EAC/BC,mBAAmB,QACb,SAAS;AAChB,SAASC,cAAc,EAAEC,gBAAgB,QAAQ,YAAY;AAO7D,SAASC,kBAAkB,QAAQ,uBAAuB;AAC1D,SAASC,aAAa,QAAQ,mBAAmB;;AAEjD;AACA;AACA;AACA;AACA;AAJA,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAAA,SAAAC,QAAA,IAAAC,SAAA;AAKA,OAAO,MAAMC,SAAS,GAAG,SAAS;;AA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AG;IACtBqF,OAAO,GAAGvJ,YAAY,eACrBwB,IAAA,CAACF,aAAa;MAACqB,QAAQ,EAAGA,QAAU;MAAAR,QAAA,EAAGoH;IAAO,CAAiB,CAAC,EAChE9G,2BAA2B,CAAC,CAC7B,CAAC;EACF;EAEA,IAAKyH,SAAS,EAAG;IAChB,OAAOX,OAAO;EACf;EAEA,oBACC7H,KAAA,CAAAE,SAAA;IAAAO,QAAA,gBACCX,IAAA;MAAMiI,GAAG,EAAGtE;IAAmB,CAAE,CAAC,EAChCoE,OAAO;EAAA,CACR,CAAC;AAEL,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMa,OAAO,GAAGjJ,cAAc,CAAE6B,kBAAkB,EAAE,SAAU,CAAC;AAEtE,SAASqH,WAAWA,CACnB;EAAEF,IAAI,GAAGtI;AAA6B,CAAC,EACvC4H,GAAwB,EACvB;EACD,oBACCjI,IAAA,CAACZ,IAAI;IACJ0J,gBAAgB;IAChBH,IAAI,EAAGA,IAAM;IACblI,SAAS,EAAC,cAAc;IACxBwH,GAAG,EAAGA;EAAK,CACX,CAAC;AAEJ;;AAEA;AACAW,OAAO,CAACxJ,IAAI,GAAGlB,UAAU,CAAE2K,WAAY,CAAC;AACxC;AACAD,OAAO,CAACG,0BAA0B,GAAGjI,eAAe,CAACkI,QAAQ;AAE7D,eAAeJ,OAAO","ignoreList":[]}
1
+ {"version":3,"names":["clsx","useFloating","flip","flipMiddleware","shift","shiftMiddleware","limitShift","autoUpdate","arrow","offset","offsetMiddleware","size","motion","useRef","useLayoutEffect","forwardRef","createContext","useContext","useMemo","useState","useCallback","createPortal","useReducedMotion","useViewportMatch","useMergeRefs","__experimentalUseDialog","useDialog","close","deprecated","Path","SVG","Button","ScrollLock","Slot","Fill","useSlot","computePopoverPosition","positionToPlacement","placementToMotionAnimationProps","getReferenceElement","contextConnect","useContextSystem","overlayMiddlewares","StyleProvider","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","SLOT_NAME","ArrowTriangle","xmlns","viewBox","className","role","children","d","vectorEffect","slotNameContext","undefined","fallbackContainerClassname","getPopoverFallbackContainer","container","document","body","querySelector","createElement","append","UnforwardedPopover","props","forwardedRef","animate","headerTitle","constrainTabbing","onClose","noArrow","position","placement","placementProp","offsetProp","focusOnMount","anchor","expandOnMobile","onFocusOutside","__unstableSlotName","resize","inline","variant","__unstableForcePosition","anchorRef","anchorRect","getAnchorRect","isAlternate","contentProps","computedFlipProp","computedResizeProp","since","version","alternative","computedVariant","arrowRef","fallbackReferenceElement","setFallbackReferenceElement","anchorRefFallback","node","isMobileViewport","isExpanded","hasArrow","normalizedPlacementFromProps","middleware","apply","sizeProps","_refs$floating$curren","firstElementChild","refs","floating","current","HTMLElement","Object","assign","style","maxHeight","availableHeight","overflow","crossAxis","limiter","padding","element","slotName","slot","onDialogClose","type","event","dialogRef","dialogProps","__unstableOnClose","x","y","strategy","update","computedPlacement","middlewareData","arrowData","whileElementsMounted","referenceParam","floatingParam","updateParam","layoutShift","animationFrame","arrowCallbackRef","anchorRefTop","top","anchorRefBottom","bottom","anchorRefStartContainer","startContainer","anchorRefCurrent","resultingReferenceElement","setReference","mergedFloatingRef","setFloating","left","shouldReduceMotion","shouldAnimate","animationFinished","setAnimationFinished","motionInlineStyles","otherMotionProps","animationProps","onAnimationComplete","isPositioned","content","div","ref","tabIndex","icon","onClick","split","join","Number","isFinite","shouldRenderWithinSlot","hasAnchor","name","Popover","PopoverSlot","bubblesVirtually","__unstableSlotNameProvider","Provider"],"sources":["@wordpress/components/src/popover/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef, SyntheticEvent, RefCallback } from 'react';\nimport clsx from 'clsx';\nimport {\n\tuseFloating,\n\tflip as flipMiddleware,\n\tshift as shiftMiddleware,\n\tlimitShift,\n\tautoUpdate,\n\tarrow,\n\toffset as offsetMiddleware,\n\tsize,\n} from '@floating-ui/react-dom';\nimport type { HTMLMotionProps, MotionProps } from 'framer-motion';\nimport { motion } from 'framer-motion';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseRef,\n\tuseLayoutEffect,\n\tforwardRef,\n\tcreateContext,\n\tuseContext,\n\tuseMemo,\n\tuseState,\n\tuseCallback,\n\tcreatePortal,\n} from '@wordpress/element';\nimport {\n\tuseReducedMotion,\n\tuseViewportMatch,\n\tuseMergeRefs,\n\t__experimentalUseDialog as useDialog,\n} from '@wordpress/compose';\nimport { close } from '@wordpress/icons';\nimport deprecated from '@wordpress/deprecated';\nimport { Path, SVG } from '@wordpress/primitives';\n\n/**\n * Internal dependencies\n */\nimport Button from '../button';\nimport ScrollLock from '../scroll-lock';\nimport { Slot, Fill, useSlot } from '../slot-fill';\nimport {\n\tcomputePopoverPosition,\n\tpositionToPlacement,\n\tplacementToMotionAnimationProps,\n\tgetReferenceElement,\n} from './utils';\nimport { contextConnect, useContextSystem } from '../context';\nimport type { WordPressComponentProps } from '../context';\nimport type {\n\tPopoverProps,\n\tPopoverAnchorRefReference,\n\tPopoverAnchorRefTopBottom,\n} from './types';\nimport { overlayMiddlewares } from './overlay-middlewares';\nimport { StyleProvider } from '../style-provider';\n\n/**\n * Name of slot in which popover should fill.\n *\n * @type {string}\n */\nexport const SLOT_NAME = 'Popover';\n\n// An SVG displaying a triangle facing down, filled with a solid\n// color and bordered in such a way to create an arrow-like effect.\n// Keeping the SVG's viewbox squared simplify the arrow positioning\n// calculations.\nconst ArrowTriangle = () => (\n\t<SVG\n\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\tviewBox=\"0 0 100 100\"\n\t\tclassName=\"components-popover__triangle\"\n\t\trole=\"presentation\"\n\t>\n\t\t<Path\n\t\t\tclassName=\"components-popover__triangle-bg\"\n\t\t\td=\"M 0 0 L 50 50 L 100 0\"\n\t\t/>\n\t\t<Path\n\t\t\tclassName=\"components-popover__triangle-border\"\n\t\t\td=\"M 0 0 L 50 50 L 100 0\"\n\t\t\tvectorEffect=\"non-scaling-stroke\"\n\t\t/>\n\t</SVG>\n);\n\nconst slotNameContext = createContext< string | undefined >( undefined );\n\nconst fallbackContainerClassname = 'components-popover__fallback-container';\nconst getPopoverFallbackContainer = () => {\n\tlet container = document.body.querySelector(\n\t\t'.' + fallbackContainerClassname\n\t);\n\tif ( ! container ) {\n\t\tcontainer = document.createElement( 'div' );\n\t\tcontainer.className = fallbackContainerClassname;\n\t\tdocument.body.append( container );\n\t}\n\n\treturn container;\n};\n\nconst UnforwardedPopover = (\n\tprops: Omit<\n\t\tWordPressComponentProps< PopoverProps, 'div', false >,\n\t\t// To avoid overlaps between the standard HTML attributes and the props\n\t\t// expected by `framer-motion`, omit all framer motion props from popover\n\t\t// props (except for `animate` and `children`, which are re-defined in `PopoverProps`).\n\t\tkeyof Omit< MotionProps, 'animate' | 'children' >\n\t>,\n\tforwardedRef: ForwardedRef< any >\n) => {\n\tconst {\n\t\tanimate = true,\n\t\theaderTitle,\n\t\tconstrainTabbing,\n\t\tonClose,\n\t\tchildren,\n\t\tclassName,\n\t\tnoArrow = true,\n\t\tposition,\n\t\tplacement: placementProp = 'bottom-start',\n\t\toffset: offsetProp = 0,\n\t\tfocusOnMount = 'firstElement',\n\t\tanchor,\n\t\texpandOnMobile,\n\t\tonFocusOutside,\n\t\t__unstableSlotName = SLOT_NAME,\n\t\tflip = true,\n\t\tresize = true,\n\t\tshift = false,\n\t\tinline = false,\n\t\tvariant,\n\n\t\t// Deprecated props\n\t\t__unstableForcePosition,\n\t\tanchorRef,\n\t\tanchorRect,\n\t\tgetAnchorRect,\n\t\tisAlternate,\n\n\t\t// Rest\n\t\t...contentProps\n\t} = useContextSystem( props, 'Popover' );\n\n\tlet computedFlipProp = flip;\n\tlet computedResizeProp = resize;\n\tif ( __unstableForcePosition !== undefined ) {\n\t\tdeprecated( '`__unstableForcePosition` prop in wp.components.Popover', {\n\t\t\tsince: '6.1',\n\t\t\tversion: '6.3',\n\t\t\talternative: '`flip={ false }` and `resize={ false }`',\n\t\t} );\n\n\t\t// Back-compat, set the `flip` and `resize` props\n\t\t// to `false` to replicate `__unstableForcePosition`.\n\t\tcomputedFlipProp = ! __unstableForcePosition;\n\t\tcomputedResizeProp = ! __unstableForcePosition;\n\t}\n\n\tif ( anchorRef !== undefined ) {\n\t\tdeprecated( '`anchorRef` prop in wp.components.Popover', {\n\t\t\tsince: '6.1',\n\t\t\talternative: '`anchor` prop',\n\t\t} );\n\t}\n\n\tif ( anchorRect !== undefined ) {\n\t\tdeprecated( '`anchorRect` prop in wp.components.Popover', {\n\t\t\tsince: '6.1',\n\t\t\talternative: '`anchor` prop',\n\t\t} );\n\t}\n\n\tif ( getAnchorRect !== undefined ) {\n\t\tdeprecated( '`getAnchorRect` prop in wp.components.Popover', {\n\t\t\tsince: '6.1',\n\t\t\talternative: '`anchor` prop',\n\t\t} );\n\t}\n\n\tconst computedVariant = isAlternate ? 'toolbar' : variant;\n\tif ( isAlternate !== undefined ) {\n\t\tdeprecated( '`isAlternate` prop in wp.components.Popover', {\n\t\t\tsince: '6.2',\n\t\t\talternative: \"`variant` prop with the `'toolbar'` value\",\n\t\t} );\n\t}\n\n\tconst arrowRef = useRef< HTMLElement | null >( null );\n\n\tconst [ fallbackReferenceElement, setFallbackReferenceElement ] =\n\t\tuseState< HTMLSpanElement | null >( null );\n\n\tconst anchorRefFallback: RefCallback< HTMLSpanElement > = useCallback(\n\t\t( node ) => {\n\t\t\tsetFallbackReferenceElement( node );\n\t\t},\n\t\t[]\n\t);\n\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst isExpanded = expandOnMobile && isMobileViewport;\n\tconst hasArrow = ! isExpanded && ! noArrow;\n\tconst normalizedPlacementFromProps = position\n\t\t? positionToPlacement( position )\n\t\t: placementProp;\n\n\tconst middleware = [\n\t\t...( placementProp === 'overlay' ? overlayMiddlewares() : [] ),\n\t\toffsetMiddleware( offsetProp ),\n\t\tcomputedFlipProp && flipMiddleware(),\n\t\tcomputedResizeProp &&\n\t\t\tsize( {\n\t\t\t\tapply( sizeProps ) {\n\t\t\t\t\tconst { firstElementChild } = refs.floating.current ?? {};\n\n\t\t\t\t\t// Only HTMLElement instances have the `style` property.\n\t\t\t\t\tif ( ! ( firstElementChild instanceof HTMLElement ) ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Reduce the height of the popover to the available space.\n\t\t\t\t\tObject.assign( firstElementChild.style, {\n\t\t\t\t\t\tmaxHeight: `${ sizeProps.availableHeight }px`,\n\t\t\t\t\t\toverflow: 'auto',\n\t\t\t\t\t} );\n\t\t\t\t},\n\t\t\t} ),\n\t\tshift &&\n\t\t\tshiftMiddleware( {\n\t\t\t\tcrossAxis: true,\n\t\t\t\tlimiter: limitShift(),\n\t\t\t\tpadding: 1, // Necessary to avoid flickering at the edge of the viewport.\n\t\t\t} ),\n\t\tarrow( { element: arrowRef } ),\n\t];\n\tconst slotName = useContext( slotNameContext ) || __unstableSlotName;\n\tconst slot = useSlot( slotName );\n\n\tlet onDialogClose;\n\n\tif ( onClose || onFocusOutside ) {\n\t\tonDialogClose = ( type: string | undefined, event: SyntheticEvent ) => {\n\t\t\t// Ideally the popover should have just a single onClose prop and\n\t\t\t// not three props that potentially do the same thing.\n\t\t\tif ( type === 'focus-outside' && onFocusOutside ) {\n\t\t\t\tonFocusOutside( event );\n\t\t\t} else if ( onClose ) {\n\t\t\t\tonClose();\n\t\t\t}\n\t\t};\n\t}\n\n\tconst [ dialogRef, dialogProps ] = useDialog( {\n\t\tconstrainTabbing,\n\t\tfocusOnMount,\n\t\t__unstableOnClose: onDialogClose,\n\t\t// @ts-expect-error The __unstableOnClose property needs to be deprecated first (see https://github.com/WordPress/gutenberg/pull/27675)\n\t\tonClose: onDialogClose,\n\t} );\n\n\tconst {\n\t\t// Positioning coordinates\n\t\tx,\n\t\ty,\n\t\t// Object with \"regular\" refs to both \"reference\" and \"floating\"\n\t\trefs,\n\t\t// Type of CSS position property to use (absolute or fixed)\n\t\tstrategy,\n\t\tupdate,\n\t\tplacement: computedPlacement,\n\t\tmiddlewareData: { arrow: arrowData },\n\t} = useFloating( {\n\t\tplacement:\n\t\t\tnormalizedPlacementFromProps === 'overlay'\n\t\t\t\t? undefined\n\t\t\t\t: normalizedPlacementFromProps,\n\t\tmiddleware,\n\t\twhileElementsMounted: ( referenceParam, floatingParam, updateParam ) =>\n\t\t\tautoUpdate( referenceParam, floatingParam, updateParam, {\n\t\t\t\tlayoutShift: false,\n\t\t\t\tanimationFrame: true,\n\t\t\t} ),\n\t} );\n\n\tconst arrowCallbackRef = useCallback(\n\t\t( node: HTMLElement | null ) => {\n\t\t\tarrowRef.current = node;\n\t\t\tupdate();\n\t\t},\n\t\t[ update ]\n\t);\n\n\t// When any of the possible anchor \"sources\" change,\n\t// recompute the reference element (real or virtual) and its owner document.\n\n\tconst anchorRefTop = ( anchorRef as PopoverAnchorRefTopBottom | undefined )\n\t\t?.top;\n\tconst anchorRefBottom = (\n\t\tanchorRef as PopoverAnchorRefTopBottom | undefined\n\t )?.bottom;\n\tconst anchorRefStartContainer = ( anchorRef as Range | undefined )\n\t\t?.startContainer;\n\tconst anchorRefCurrent = ( anchorRef as PopoverAnchorRefReference )\n\t\t?.current;\n\n\tuseLayoutEffect( () => {\n\t\tconst resultingReferenceElement = getReferenceElement( {\n\t\t\tanchor,\n\t\t\tanchorRef,\n\t\t\tanchorRect,\n\t\t\tgetAnchorRect,\n\t\t\tfallbackReferenceElement,\n\t\t} );\n\n\t\trefs.setReference( resultingReferenceElement );\n\t}, [\n\t\tanchor,\n\t\tanchorRef,\n\t\tanchorRefTop,\n\t\tanchorRefBottom,\n\t\tanchorRefStartContainer,\n\t\tanchorRefCurrent,\n\t\tanchorRect,\n\t\tgetAnchorRect,\n\t\tfallbackReferenceElement,\n\t\trefs,\n\t] );\n\n\tconst mergedFloatingRef = useMergeRefs( [\n\t\trefs.setFloating,\n\t\tdialogRef,\n\t\tforwardedRef,\n\t] );\n\n\tconst style = isExpanded\n\t\t? undefined\n\t\t: {\n\t\t\t\tposition: strategy,\n\t\t\t\ttop: 0,\n\t\t\t\tleft: 0,\n\t\t\t\t// `x` and `y` are framer-motion specific props and are shorthands\n\t\t\t\t// for `translateX` and `translateY`. Currently it is not possible\n\t\t\t\t// to use `translateX` and `translateY` because those values would\n\t\t\t\t// be overridden by the return value of the\n\t\t\t\t// `placementToMotionAnimationProps` function.\n\t\t\t\tx: computePopoverPosition( x ),\n\t\t\t\ty: computePopoverPosition( y ),\n\t\t };\n\n\tconst shouldReduceMotion = useReducedMotion();\n\tconst shouldAnimate = animate && ! isExpanded && ! shouldReduceMotion;\n\n\tconst [ animationFinished, setAnimationFinished ] = useState( false );\n\n\tconst { style: motionInlineStyles, ...otherMotionProps } = useMemo(\n\t\t() => placementToMotionAnimationProps( computedPlacement ),\n\t\t[ computedPlacement ]\n\t);\n\n\tconst animationProps: HTMLMotionProps< 'div' > = shouldAnimate\n\t\t? {\n\t\t\t\tstyle: {\n\t\t\t\t\t...motionInlineStyles,\n\t\t\t\t\t...style,\n\t\t\t\t},\n\t\t\t\tonAnimationComplete: () => setAnimationFinished( true ),\n\t\t\t\t...otherMotionProps,\n\t\t }\n\t\t: {\n\t\t\t\tanimate: false,\n\t\t\t\tstyle,\n\t\t };\n\n\t// When Floating UI has finished positioning and Framer Motion has finished animating\n\t// the popover, add the `is-positioned` class to signal that all transitions have finished.\n\tconst isPositioned =\n\t\t( ! shouldAnimate || animationFinished ) && x !== null && y !== null;\n\n\tlet content = (\n\t\t<motion.div\n\t\t\tclassName={ clsx( className, {\n\t\t\t\t'is-expanded': isExpanded,\n\t\t\t\t'is-positioned': isPositioned,\n\t\t\t\t// Use the 'alternate' classname for 'toolbar' variant for back compat.\n\t\t\t\t[ `is-${\n\t\t\t\t\tcomputedVariant === 'toolbar'\n\t\t\t\t\t\t? 'alternate'\n\t\t\t\t\t\t: computedVariant\n\t\t\t\t}` ]: computedVariant,\n\t\t\t} ) }\n\t\t\t{ ...animationProps }\n\t\t\t{ ...contentProps }\n\t\t\tref={ mergedFloatingRef }\n\t\t\t{ ...dialogProps }\n\t\t\ttabIndex={ -1 }\n\t\t>\n\t\t\t{ /* Prevents scroll on the document */ }\n\t\t\t{ isExpanded && <ScrollLock /> }\n\t\t\t{ isExpanded && (\n\t\t\t\t<div className=\"components-popover__header\">\n\t\t\t\t\t<span className=\"components-popover__header-title\">\n\t\t\t\t\t\t{ headerTitle }\n\t\t\t\t\t</span>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tclassName=\"components-popover__close\"\n\t\t\t\t\t\ticon={ close }\n\t\t\t\t\t\tonClick={ onClose }\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t\t<div className=\"components-popover__content\">{ children }</div>\n\t\t\t{ hasArrow && (\n\t\t\t\t<div\n\t\t\t\t\tref={ arrowCallbackRef }\n\t\t\t\t\tclassName={ [\n\t\t\t\t\t\t'components-popover__arrow',\n\t\t\t\t\t\t`is-${ computedPlacement.split( '-' )[ 0 ] }`,\n\t\t\t\t\t].join( ' ' ) }\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\tleft:\n\t\t\t\t\t\t\ttypeof arrowData?.x !== 'undefined' &&\n\t\t\t\t\t\t\tNumber.isFinite( arrowData.x )\n\t\t\t\t\t\t\t\t? `${ arrowData.x }px`\n\t\t\t\t\t\t\t\t: '',\n\t\t\t\t\t\ttop:\n\t\t\t\t\t\t\ttypeof arrowData?.y !== 'undefined' &&\n\t\t\t\t\t\t\tNumber.isFinite( arrowData.y )\n\t\t\t\t\t\t\t\t? `${ arrowData.y }px`\n\t\t\t\t\t\t\t\t: '',\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t<ArrowTriangle />\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</motion.div>\n\t);\n\n\tconst shouldRenderWithinSlot = slot.ref && ! inline;\n\tconst hasAnchor = anchorRef || anchorRect || anchor;\n\n\tif ( shouldRenderWithinSlot ) {\n\t\tcontent = <Fill name={ slotName }>{ content }</Fill>;\n\t} else if ( ! inline ) {\n\t\tcontent = createPortal(\n\t\t\t<StyleProvider document={ document }>{ content }</StyleProvider>,\n\t\t\tgetPopoverFallbackContainer()\n\t\t);\n\t}\n\n\tif ( hasAnchor ) {\n\t\treturn content;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<span ref={ anchorRefFallback } />\n\t\t\t{ content }\n\t\t</>\n\t);\n};\n\n/**\n * `Popover` renders its content in a floating modal. If no explicit anchor is passed via props, it anchors to its parent element by default.\n *\n * ```jsx\n * import { Button, Popover } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MyPopover = () => {\n * \tconst [ isVisible, setIsVisible ] = useState( false );\n * \tconst toggleVisible = () => {\n * \t\tsetIsVisible( ( state ) => ! state );\n * \t};\n *\n * \treturn (\n * \t\t<Button variant=\"secondary\" onClick={ toggleVisible }>\n * \t\t\tToggle Popover!\n * \t\t\t{ isVisible && <Popover>Popover is toggled!</Popover> }\n * \t\t</Button>\n * \t);\n * };\n * ```\n *\n */\nexport const Popover = contextConnect( UnforwardedPopover, 'Popover' );\n\nfunction PopoverSlot(\n\t{ name = SLOT_NAME }: { name?: string },\n\tref: ForwardedRef< any >\n) {\n\treturn (\n\t\t<Slot\n\t\t\tbubblesVirtually\n\t\t\tname={ name }\n\t\t\tclassName=\"popover-slot\"\n\t\t\tref={ ref }\n\t\t/>\n\t);\n}\n\n// @ts-expect-error For Legacy Reasons\nPopover.Slot = forwardRef( PopoverSlot );\n// @ts-expect-error For Legacy Reasons\nPopover.__unstableSlotNameProvider = slotNameContext.Provider;\n\nexport default Popover;\n"],"mappings":"AAAA;AACA;AACA;;AAEA,OAAOA,IAAI,MAAM,MAAM;AACvB,SACCC,WAAW,EACXC,IAAI,IAAIC,cAAc,EACtBC,KAAK,IAAIC,eAAe,EACxBC,UAAU,EACVC,UAAU,EACVC,KAAK,EACLC,MAAM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,EAAGtE;IAAmB,CAAE,CAAC,EAChCoE,OAAO;EAAA,CACR,CAAC;AAEL,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMa,OAAO,GAAGjJ,cAAc,CAAE6B,kBAAkB,EAAE,SAAU,CAAC;AAEtE,SAASqH,WAAWA,CACnB;EAAEF,IAAI,GAAGtI;AAA6B,CAAC,EACvC4H,GAAwB,EACvB;EACD,oBACCjI,IAAA,CAACZ,IAAI;IACJ0J,gBAAgB;IAChBH,IAAI,EAAGA,IAAM;IACblI,SAAS,EAAC,cAAc;IACxBwH,GAAG,EAAGA;EAAK,CACX,CAAC;AAEJ;;AAEA;AACAW,OAAO,CAACxJ,IAAI,GAAGlB,UAAU,CAAE2K,WAAY,CAAC;AACxC;AACAD,OAAO,CAACG,0BAA0B,GAAGjI,eAAe,CAACkI,QAAQ;AAE7D,eAAeJ,OAAO","ignoreList":[]}
@@ -1,7 +1,6 @@
1
1
  /**
2
2
  * External dependencies
3
3
  */
4
- // eslint-disable-next-line no-restricted-imports
5
4
 
6
5
  /**
7
6
  * Internal dependencies
@@ -1 +1 @@
1
- {"version":3,"names":["POSITION_TO_PLACEMENT","bottom","top","middle","positionToPlacement","position","_POSITION_TO_PLACEMEN","PLACEMENT_TO_ANIMATION_ORIGIN","originX","originY","right","left","overlay","placementToMotionAnimationProps","placement","translateProp","startsWith","translateDirection","style","initial","opacity","scale","animate","transition","duration","ease","isTopBottom","anchorRef","isRef","current","getReferenceElement","anchor","anchorRect","getAnchorRect","fallbackReferenceElement","_referenceElement","referenceElement","getBoundingClientRect","topRect","bottomRect","window","DOMRect","x","y","width","_rect$x","_rect$y","_rect$width","_rect$height","rect","height","parentElement","computePopoverPosition","c","Number","isNaN","undefined","Math","round"],"sources":["@wordpress/components/src/popover/utils.ts"],"sourcesContent":["/**\n * External dependencies\n */\n// eslint-disable-next-line no-restricted-imports\nimport type { MotionProps } from 'framer-motion';\nimport type { Placement, ReferenceType } from '@floating-ui/react-dom';\n\n/**\n * Internal dependencies\n */\nimport type {\n\tPopoverProps,\n\tPopoverAnchorRefReference,\n\tPopoverAnchorRefTopBottom,\n} from './types';\n\nconst POSITION_TO_PLACEMENT: Record<\n\tNonNullable< PopoverProps[ 'position' ] >,\n\tPlacement\n> = {\n\tbottom: 'bottom',\n\ttop: 'top',\n\t'middle left': 'left',\n\t'middle right': 'right',\n\t'bottom left': 'bottom-end',\n\t'bottom center': 'bottom',\n\t'bottom right': 'bottom-start',\n\t'top left': 'top-end',\n\t'top center': 'top',\n\t'top right': 'top-start',\n\t'middle left left': 'left',\n\t'middle left right': 'left',\n\t'middle left bottom': 'left-end',\n\t'middle left top': 'left-start',\n\t'middle right left': 'right',\n\t'middle right right': 'right',\n\t'middle right bottom': 'right-end',\n\t'middle right top': 'right-start',\n\t'bottom left left': 'bottom-end',\n\t'bottom left right': 'bottom-end',\n\t'bottom left bottom': 'bottom-end',\n\t'bottom left top': 'bottom-end',\n\t'bottom center left': 'bottom',\n\t'bottom center right': 'bottom',\n\t'bottom center bottom': 'bottom',\n\t'bottom center top': 'bottom',\n\t'bottom right left': 'bottom-start',\n\t'bottom right right': 'bottom-start',\n\t'bottom right bottom': 'bottom-start',\n\t'bottom right top': 'bottom-start',\n\t'top left left': 'top-end',\n\t'top left right': 'top-end',\n\t'top left bottom': 'top-end',\n\t'top left top': 'top-end',\n\t'top center left': 'top',\n\t'top center right': 'top',\n\t'top center bottom': 'top',\n\t'top center top': 'top',\n\t'top right left': 'top-start',\n\t'top right right': 'top-start',\n\t'top right bottom': 'top-start',\n\t'top right top': 'top-start',\n\t// `middle`/`middle center [corner?]` positions are associated to a fallback\n\t// `bottom` placement because there aren't any corresponding placement values.\n\tmiddle: 'bottom',\n\t'middle center': 'bottom',\n\t'middle center bottom': 'bottom',\n\t'middle center left': 'bottom',\n\t'middle center right': 'bottom',\n\t'middle center top': 'bottom',\n};\n\n/**\n * Converts the `Popover`'s legacy \"position\" prop to the new \"placement\" prop\n * (used by `floating-ui`).\n *\n * @param position The legacy position\n * @return The corresponding placement\n */\nexport const positionToPlacement = (\n\tposition: NonNullable< PopoverProps[ 'position' ] >\n) => POSITION_TO_PLACEMENT[ position ] ?? 'bottom';\n\n/**\n * @typedef AnimationOrigin\n * @type {Object}\n * @property {number} originX A number between 0 and 1 (in CSS logical properties jargon, 0 is \"start\", 0.5 is \"center\", and 1 is \"end\")\n * @property {number} originY A number between 0 and 1 (0 is top, 0.5 is center, and 1 is bottom)\n */\n\nconst PLACEMENT_TO_ANIMATION_ORIGIN: Record<\n\tNonNullable< PopoverProps[ 'placement' ] >,\n\t{ originX: number; originY: number }\n> = {\n\ttop: { originX: 0.5, originY: 1 }, // open from bottom, center\n\t'top-start': { originX: 0, originY: 1 }, // open from bottom, left\n\t'top-end': { originX: 1, originY: 1 }, // open from bottom, right\n\tright: { originX: 0, originY: 0.5 }, // open from middle, left\n\t'right-start': { originX: 0, originY: 0 }, // open from top, left\n\t'right-end': { originX: 0, originY: 1 }, // open from bottom, left\n\tbottom: { originX: 0.5, originY: 0 }, // open from top, center\n\t'bottom-start': { originX: 0, originY: 0 }, // open from top, left\n\t'bottom-end': { originX: 1, originY: 0 }, // open from top, right\n\tleft: { originX: 1, originY: 0.5 }, // open from middle, right\n\t'left-start': { originX: 1, originY: 0 }, // open from top, right\n\t'left-end': { originX: 1, originY: 1 }, // open from bottom, right\n\toverlay: { originX: 0.5, originY: 0.5 }, // open from center, center\n};\n\n/**\n * Given the floating-ui `placement`, compute the framer-motion props for the\n * popover's entry animation.\n *\n * @param placement A placement string from floating ui\n * @return The object containing the motion props\n */\nexport const placementToMotionAnimationProps = (\n\tplacement: NonNullable< PopoverProps[ 'placement' ] >\n): MotionProps => {\n\tconst translateProp =\n\t\tplacement.startsWith( 'top' ) || placement.startsWith( 'bottom' )\n\t\t\t? 'translateY'\n\t\t\t: 'translateX';\n\tconst translateDirection =\n\t\tplacement.startsWith( 'top' ) || placement.startsWith( 'left' )\n\t\t\t? 1\n\t\t\t: -1;\n\n\treturn {\n\t\tstyle: PLACEMENT_TO_ANIMATION_ORIGIN[ placement ],\n\t\tinitial: {\n\t\t\topacity: 0,\n\t\t\tscale: 0,\n\t\t\t[ translateProp ]: `${ 2 * translateDirection }em`,\n\t\t},\n\t\tanimate: { opacity: 1, scale: 1, [ translateProp ]: 0 },\n\t\ttransition: { duration: 0.1, ease: [ 0, 0, 0.2, 1 ] },\n\t};\n};\n\nfunction isTopBottom(\n\tanchorRef: PopoverProps[ 'anchorRef' ]\n): anchorRef is PopoverAnchorRefTopBottom {\n\treturn !! ( anchorRef as PopoverAnchorRefTopBottom )?.top;\n}\n\nfunction isRef(\n\tanchorRef: PopoverProps[ 'anchorRef' ]\n): anchorRef is PopoverAnchorRefReference {\n\treturn !! ( anchorRef as PopoverAnchorRefReference )?.current;\n}\n\nexport const getReferenceElement = ( {\n\tanchor,\n\tanchorRef,\n\tanchorRect,\n\tgetAnchorRect,\n\tfallbackReferenceElement,\n}: Pick<\n\tPopoverProps,\n\t'anchorRef' | 'anchorRect' | 'getAnchorRect' | 'anchor'\n> & {\n\tfallbackReferenceElement: Element | null;\n} ): ReferenceType | null => {\n\tlet referenceElement = null;\n\n\tif ( anchor ) {\n\t\treferenceElement = anchor;\n\t} else if ( isTopBottom( anchorRef ) ) {\n\t\t// Create a virtual element for the ref. The expectation is that\n\t\t// if anchorRef.top is defined, then anchorRef.bottom is defined too.\n\t\t// Seems to be used by the block toolbar, when multiple blocks are selected\n\t\t// (top and bottom blocks are used to calculate the resulting rect).\n\t\treferenceElement = {\n\t\t\tgetBoundingClientRect() {\n\t\t\t\tconst topRect = anchorRef.top.getBoundingClientRect();\n\t\t\t\tconst bottomRect = anchorRef.bottom.getBoundingClientRect();\n\t\t\t\treturn new window.DOMRect(\n\t\t\t\t\ttopRect.x,\n\t\t\t\t\ttopRect.y,\n\t\t\t\t\ttopRect.width,\n\t\t\t\t\tbottomRect.bottom - topRect.top\n\t\t\t\t);\n\t\t\t},\n\t\t};\n\t} else if ( isRef( anchorRef ) ) {\n\t\t// Standard React ref.\n\t\treferenceElement = anchorRef.current;\n\t} else if ( anchorRef ) {\n\t\t// If `anchorRef` holds directly the element's value (no `current` key)\n\t\t// This is a weird scenario and should be deprecated.\n\t\treferenceElement = anchorRef as Element;\n\t} else if ( anchorRect ) {\n\t\t// Create a virtual element for the ref.\n\t\treferenceElement = {\n\t\t\tgetBoundingClientRect() {\n\t\t\t\treturn anchorRect;\n\t\t\t},\n\t\t};\n\t} else if ( getAnchorRect ) {\n\t\t// Create a virtual element for the ref.\n\t\treferenceElement = {\n\t\t\tgetBoundingClientRect() {\n\t\t\t\tconst rect = getAnchorRect( fallbackReferenceElement );\n\t\t\t\treturn new window.DOMRect(\n\t\t\t\t\trect.x ?? rect.left,\n\t\t\t\t\trect.y ?? rect.top,\n\t\t\t\t\trect.width ?? rect.right - rect.left,\n\t\t\t\t\trect.height ?? rect.bottom - rect.top\n\t\t\t\t);\n\t\t\t},\n\t\t};\n\t} else if ( fallbackReferenceElement ) {\n\t\t// If no explicit ref is passed via props, fall back to\n\t\t// anchoring to the popover's parent node.\n\t\treferenceElement = fallbackReferenceElement.parentElement;\n\t}\n\n\t// Convert any `undefined` value to `null`.\n\treturn referenceElement ?? null;\n};\n\n/**\n * Computes the final coordinate that needs to be applied to the floating\n * element when applying transform inline styles, defaulting to `undefined`\n * if the provided value is `null` or `NaN`.\n *\n * @param c input coordinate (usually as returned from floating-ui)\n * @return The coordinate's value to be used for inline styles. An `undefined`\n * return value means \"no style set\" for this coordinate.\n */\nexport const computePopoverPosition = ( c: number | null ) =>\n\tc === null || Number.isNaN( c ) ? undefined : Math.round( c );\n"],"mappings":"AAAA;AACA;AACA;AACA;;AAIA;AACA;AACA;;AAOA,MAAMA,qBAGL,GAAG;EACHC,MAAM,EAAE,QAAQ;EAChBC,GAAG,EAAE,KAAK;EACV,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OAAA,GAAIG,IAAI,CAAC/C,GAAG,GAAA6C,WAAA,GAClBE,IAAI,CAACL,KAAK,cAAAG,WAAA,cAAAA,WAAA,GAAIE,IAAI,CAACvC,KAAK,GAAGuC,IAAI,CAACtC,IAAI,GAAAqC,YAAA,GACpCC,IAAI,CAACC,MAAM,cAAAF,YAAA,cAAAA,YAAA,GAAIC,IAAI,CAAChD,MAAM,GAAGgD,IAAI,CAAC/C,GACnC,CAAC;MACF;IACD,CAAC;EACF,CAAC,MAAM,IAAKgC,wBAAwB,EAAG;IACtC;IACA;IACAE,gBAAgB,GAAGF,wBAAwB,CAACiB,aAAa;EAC1D;;EAEA;EACA,QAAAhB,iBAAA,GAAOC,gBAAgB,cAAAD,iBAAA,cAAAA,iBAAA,GAAI,IAAI;AAChC,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMiB,sBAAsB,GAAKC,CAAgB,IACvDA,CAAC,KAAK,IAAI,IAAIC,MAAM,CAACC,KAAK,CAAEF,CAAE,CAAC,GAAGG,SAAS,GAAGC,IAAI,CAACC,KAAK,CAAEL,CAAE,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["POSITION_TO_PLACEMENT","bottom","top","middle","positionToPlacement","position","_POSITION_TO_PLACEMEN","PLACEMENT_TO_ANIMATION_ORIGIN","originX","originY","right","left","overlay","placementToMotionAnimationProps","placement","translateProp","startsWith","translateDirection","style","initial","opacity","scale","animate","transition","duration","ease","isTopBottom","anchorRef","isRef","current","getReferenceElement","anchor","anchorRect","getAnchorRect","fallbackReferenceElement","_referenceElement","referenceElement","getBoundingClientRect","topRect","bottomRect","window","DOMRect","x","y","width","_rect$x","_rect$y","_rect$width","_rect$height","rect","height","parentElement","computePopoverPosition","c","Number","isNaN","undefined","Math","round"],"sources":["@wordpress/components/src/popover/utils.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { MotionProps } from 'framer-motion';\nimport type { Placement, ReferenceType } from '@floating-ui/react-dom';\n\n/**\n * Internal dependencies\n */\nimport type {\n\tPopoverProps,\n\tPopoverAnchorRefReference,\n\tPopoverAnchorRefTopBottom,\n} from './types';\n\nconst POSITION_TO_PLACEMENT: Record<\n\tNonNullable< PopoverProps[ 'position' ] >,\n\tPlacement\n> = {\n\tbottom: 'bottom',\n\ttop: 'top',\n\t'middle left': 'left',\n\t'middle right': 'right',\n\t'bottom left': 'bottom-end',\n\t'bottom center': 'bottom',\n\t'bottom right': 'bottom-start',\n\t'top left': 'top-end',\n\t'top center': 'top',\n\t'top right': 'top-start',\n\t'middle left left': 'left',\n\t'middle left right': 'left',\n\t'middle left bottom': 'left-end',\n\t'middle left top': 'left-start',\n\t'middle right left': 'right',\n\t'middle right right': 'right',\n\t'middle right bottom': 'right-end',\n\t'middle right top': 'right-start',\n\t'bottom left left': 'bottom-end',\n\t'bottom left right': 'bottom-end',\n\t'bottom left bottom': 'bottom-end',\n\t'bottom left top': 'bottom-end',\n\t'bottom center left': 'bottom',\n\t'bottom center right': 'bottom',\n\t'bottom center bottom': 'bottom',\n\t'bottom center top': 'bottom',\n\t'bottom right left': 'bottom-start',\n\t'bottom right right': 'bottom-start',\n\t'bottom right bottom': 'bottom-start',\n\t'bottom right top': 'bottom-start',\n\t'top left left': 'top-end',\n\t'top left right': 'top-end',\n\t'top left bottom': 'top-end',\n\t'top left top': 'top-end',\n\t'top center left': 'top',\n\t'top center right': 'top',\n\t'top center bottom': 'top',\n\t'top center top': 'top',\n\t'top right left': 'top-start',\n\t'top right right': 'top-start',\n\t'top right bottom': 'top-start',\n\t'top right top': 'top-start',\n\t// `middle`/`middle center [corner?]` positions are associated to a fallback\n\t// `bottom` placement because there aren't any corresponding placement values.\n\tmiddle: 'bottom',\n\t'middle center': 'bottom',\n\t'middle center bottom': 'bottom',\n\t'middle center left': 'bottom',\n\t'middle center right': 'bottom',\n\t'middle center top': 'bottom',\n};\n\n/**\n * Converts the `Popover`'s legacy \"position\" prop to the new \"placement\" prop\n * (used by `floating-ui`).\n *\n * @param position The legacy position\n * @return The corresponding placement\n */\nexport const positionToPlacement = (\n\tposition: NonNullable< PopoverProps[ 'position' ] >\n) => POSITION_TO_PLACEMENT[ position ] ?? 'bottom';\n\n/**\n * @typedef AnimationOrigin\n * @type {Object}\n * @property {number} originX A number between 0 and 1 (in CSS logical properties jargon, 0 is \"start\", 0.5 is \"center\", and 1 is \"end\")\n * @property {number} originY A number between 0 and 1 (0 is top, 0.5 is center, and 1 is bottom)\n */\n\nconst PLACEMENT_TO_ANIMATION_ORIGIN: Record<\n\tNonNullable< PopoverProps[ 'placement' ] >,\n\t{ originX: number; originY: number }\n> = {\n\ttop: { originX: 0.5, originY: 1 }, // open from bottom, center\n\t'top-start': { originX: 0, originY: 1 }, // open from bottom, left\n\t'top-end': { originX: 1, originY: 1 }, // open from bottom, right\n\tright: { originX: 0, originY: 0.5 }, // open from middle, left\n\t'right-start': { originX: 0, originY: 0 }, // open from top, left\n\t'right-end': { originX: 0, originY: 1 }, // open from bottom, left\n\tbottom: { originX: 0.5, originY: 0 }, // open from top, center\n\t'bottom-start': { originX: 0, originY: 0 }, // open from top, left\n\t'bottom-end': { originX: 1, originY: 0 }, // open from top, right\n\tleft: { originX: 1, originY: 0.5 }, // open from middle, right\n\t'left-start': { originX: 1, originY: 0 }, // open from top, right\n\t'left-end': { originX: 1, originY: 1 }, // open from bottom, right\n\toverlay: { originX: 0.5, originY: 0.5 }, // open from center, center\n};\n\n/**\n * Given the floating-ui `placement`, compute the framer-motion props for the\n * popover's entry animation.\n *\n * @param placement A placement string from floating ui\n * @return The object containing the motion props\n */\nexport const placementToMotionAnimationProps = (\n\tplacement: NonNullable< PopoverProps[ 'placement' ] >\n): MotionProps => {\n\tconst translateProp =\n\t\tplacement.startsWith( 'top' ) || placement.startsWith( 'bottom' )\n\t\t\t? 'translateY'\n\t\t\t: 'translateX';\n\tconst translateDirection =\n\t\tplacement.startsWith( 'top' ) || placement.startsWith( 'left' )\n\t\t\t? 1\n\t\t\t: -1;\n\n\treturn {\n\t\tstyle: PLACEMENT_TO_ANIMATION_ORIGIN[ placement ],\n\t\tinitial: {\n\t\t\topacity: 0,\n\t\t\tscale: 0,\n\t\t\t[ translateProp ]: `${ 2 * translateDirection }em`,\n\t\t},\n\t\tanimate: { opacity: 1, scale: 1, [ translateProp ]: 0 },\n\t\ttransition: { duration: 0.1, ease: [ 0, 0, 0.2, 1 ] },\n\t};\n};\n\nfunction isTopBottom(\n\tanchorRef: PopoverProps[ 'anchorRef' ]\n): anchorRef is PopoverAnchorRefTopBottom {\n\treturn !! ( anchorRef as PopoverAnchorRefTopBottom )?.top;\n}\n\nfunction isRef(\n\tanchorRef: PopoverProps[ 'anchorRef' ]\n): anchorRef is PopoverAnchorRefReference {\n\treturn !! ( anchorRef as PopoverAnchorRefReference )?.current;\n}\n\nexport const getReferenceElement = ( {\n\tanchor,\n\tanchorRef,\n\tanchorRect,\n\tgetAnchorRect,\n\tfallbackReferenceElement,\n}: Pick<\n\tPopoverProps,\n\t'anchorRef' | 'anchorRect' | 'getAnchorRect' | 'anchor'\n> & {\n\tfallbackReferenceElement: Element | null;\n} ): ReferenceType | null => {\n\tlet referenceElement = null;\n\n\tif ( anchor ) {\n\t\treferenceElement = anchor;\n\t} else if ( isTopBottom( anchorRef ) ) {\n\t\t// Create a virtual element for the ref. The expectation is that\n\t\t// if anchorRef.top is defined, then anchorRef.bottom is defined too.\n\t\t// Seems to be used by the block toolbar, when multiple blocks are selected\n\t\t// (top and bottom blocks are used to calculate the resulting rect).\n\t\treferenceElement = {\n\t\t\tgetBoundingClientRect() {\n\t\t\t\tconst topRect = anchorRef.top.getBoundingClientRect();\n\t\t\t\tconst bottomRect = anchorRef.bottom.getBoundingClientRect();\n\t\t\t\treturn new window.DOMRect(\n\t\t\t\t\ttopRect.x,\n\t\t\t\t\ttopRect.y,\n\t\t\t\t\ttopRect.width,\n\t\t\t\t\tbottomRect.bottom - topRect.top\n\t\t\t\t);\n\t\t\t},\n\t\t};\n\t} else if ( isRef( anchorRef ) ) {\n\t\t// Standard React ref.\n\t\treferenceElement = anchorRef.current;\n\t} else if ( anchorRef ) {\n\t\t// If `anchorRef` holds directly the element's value (no `current` key)\n\t\t// This is a weird scenario and should be deprecated.\n\t\treferenceElement = anchorRef as Element;\n\t} else if ( anchorRect ) {\n\t\t// Create a virtual element for the ref.\n\t\treferenceElement = {\n\t\t\tgetBoundingClientRect() {\n\t\t\t\treturn anchorRect;\n\t\t\t},\n\t\t};\n\t} else if ( getAnchorRect ) {\n\t\t// Create a virtual element for the ref.\n\t\treferenceElement = {\n\t\t\tgetBoundingClientRect() {\n\t\t\t\tconst rect = getAnchorRect( fallbackReferenceElement );\n\t\t\t\treturn new window.DOMRect(\n\t\t\t\t\trect.x ?? rect.left,\n\t\t\t\t\trect.y ?? rect.top,\n\t\t\t\t\trect.width ?? rect.right - rect.left,\n\t\t\t\t\trect.height ?? rect.bottom - rect.top\n\t\t\t\t);\n\t\t\t},\n\t\t};\n\t} else if ( fallbackReferenceElement ) {\n\t\t// If no explicit ref is passed via props, fall back to\n\t\t// anchoring to the popover's parent node.\n\t\treferenceElement = fallbackReferenceElement.parentElement;\n\t}\n\n\t// Convert any `undefined` value to `null`.\n\treturn referenceElement ?? null;\n};\n\n/**\n * Computes the final coordinate that needs to be applied to the floating\n * element when applying transform inline styles, defaulting to `undefined`\n * if the provided value is `null` or `NaN`.\n *\n * @param c input coordinate (usually as returned from floating-ui)\n * @return The coordinate's value to be used for inline styles. An `undefined`\n * return value means \"no style set\" for this coordinate.\n */\nexport const computePopoverPosition = ( c: number | null ) =>\n\tc === null || Number.isNaN( c ) ? undefined : Math.round( c );\n"],"mappings":"AAAA;AACA;AACA;;AAIA;AACA;AACA;;AAOA,MAAMA,qBAGL,GAAG;EACHC,MAAM,EAAE,QAAQ;EAChBC,GAAG,EAAE,KAAK;EACV,aAAa,EAAE,MAAM;EACrB,cAAc,EAAE,OAAO;EACvB,aAAa,EAAE,YAAY;EAC3B,eAAe,EAAE,QA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AAAA,WAAA,GAAIE,IAAI,CAACvC,KAAK,GAAGuC,IAAI,CAACtC,IAAI,GAAAqC,YAAA,GACpCC,IAAI,CAACC,MAAM,cAAAF,YAAA,cAAAA,YAAA,GAAIC,IAAI,CAAChD,MAAM,GAAGgD,IAAI,CAAC/C,GACnC,CAAC;MACF;IACD,CAAC;EACF,CAAC,MAAM,IAAKgC,wBAAwB,EAAG;IACtC;IACA;IACAE,gBAAgB,GAAGF,wBAAwB,CAACiB,aAAa;EAC1D;;EAEA;EACA,QAAAhB,iBAAA,GAAOC,gBAAgB,cAAAD,iBAAA,cAAAA,iBAAA,GAAI,IAAI;AAChC,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMiB,sBAAsB,GAAKC,CAAgB,IACvDA,CAAC,KAAK,IAAI,IAAIC,MAAM,CAACC,KAAK,CAAEF,CAAE,CAAC,GAAGG,SAAS,GAAGC,IAAI,CAACC,KAAK,CAAEL,CAAE,CAAC","ignoreList":[]}
@@ -1,12 +1,9 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
-
5
1
  /**
6
2
  * Internal dependencies
7
3
  */
8
4
  import { Composite as CompositeV2, CompositeGroup as CompositeGroupV2, CompositeItem as CompositeItemV2, CompositeRow as CompositeRowV2, useCompositeStore as useCompositeStoreV2 } from './composite/v2';
9
5
  import { default as CustomSelectControl } from './custom-select-control';
6
+ import { default as CustomSelectControlV2Legacy } from './custom-select-control-v2/legacy-component';
10
7
  import { positionToPlacement as __experimentalPopoverLegacyPositionToPlacement } from './popover/utils';
11
8
  import { createPrivateSlotFill } from './slot-fill';
12
9
  import { DropdownMenu as DropdownMenuV2, DropdownMenuGroup as DropdownMenuGroupV2, DropdownMenuItem as DropdownMenuItemV2, DropdownMenuCheckboxItem as DropdownMenuCheckboxItemV2, DropdownMenuRadioItem as DropdownMenuRadioItemV2, DropdownMenuSeparator as DropdownMenuSeparatorV2, DropdownMenuItemLabel as DropdownMenuItemLabelV2, DropdownMenuItemHelpText as DropdownMenuItemHelpTextV2 } from './dropdown-menu-v2';
@@ -22,6 +19,7 @@ lock(privateApis, {
22
19
  CompositeItemV2,
23
20
  CompositeRowV2,
24
21
  useCompositeStoreV2,
22
+ CustomSelectControlV2Legacy,
25
23
  CustomSelectControl,
26
24
  __experimentalPopoverLegacyPositionToPlacement,
27
25
  createPrivateSlotFill,
@@ -1 +1 @@
1
- {"version":3,"names":["Composite","CompositeV2","CompositeGroup","CompositeGroupV2","CompositeItem","CompositeItemV2","CompositeRow","CompositeRowV2","useCompositeStore","useCompositeStoreV2","default","CustomSelectControl","positionToPlacement","__experimentalPopoverLegacyPositionToPlacement","createPrivateSlotFill","DropdownMenu","DropdownMenuV2","DropdownMenuGroup","DropdownMenuGroupV2","DropdownMenuItem","DropdownMenuItemV2","DropdownMenuCheckboxItem","DropdownMenuCheckboxItemV2","DropdownMenuRadioItem","DropdownMenuRadioItemV2","DropdownMenuSeparator","DropdownMenuSeparatorV2","DropdownMenuItemLabel","DropdownMenuItemLabelV2","DropdownMenuItemHelpText","DropdownMenuItemHelpTextV2","ComponentsContext","Theme","Tabs","kebabCase","lock","privateApis"],"sources":["@wordpress/components/src/private-apis.ts"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/private-apis';\n\n/**\n * Internal dependencies\n */\nimport {\n\tComposite as CompositeV2,\n\tCompositeGroup as CompositeGroupV2,\n\tCompositeItem as CompositeItemV2,\n\tCompositeRow as CompositeRowV2,\n\tuseCompositeStore as useCompositeStoreV2,\n} from './composite/v2';\nimport { default as CustomSelectControl } from './custom-select-control';\nimport { positionToPlacement as __experimentalPopoverLegacyPositionToPlacement } from './popover/utils';\nimport { createPrivateSlotFill } from './slot-fill';\nimport {\n\tDropdownMenu as DropdownMenuV2,\n\tDropdownMenuGroup as DropdownMenuGroupV2,\n\tDropdownMenuItem as DropdownMenuItemV2,\n\tDropdownMenuCheckboxItem as DropdownMenuCheckboxItemV2,\n\tDropdownMenuRadioItem as DropdownMenuRadioItemV2,\n\tDropdownMenuSeparator as DropdownMenuSeparatorV2,\n\tDropdownMenuItemLabel as DropdownMenuItemLabelV2,\n\tDropdownMenuItemHelpText as DropdownMenuItemHelpTextV2,\n} from './dropdown-menu-v2';\nimport { ComponentsContext } from './context/context-system-provider';\nimport Theme from './theme';\nimport Tabs from './tabs';\nimport { kebabCase } from './utils/strings';\nimport { lock } from './lock-unlock';\n\nexport const privateApis = {};\nlock( privateApis, {\n\tCompositeV2,\n\tCompositeGroupV2,\n\tCompositeItemV2,\n\tCompositeRowV2,\n\tuseCompositeStoreV2,\n\tCustomSelectControl,\n\t__experimentalPopoverLegacyPositionToPlacement,\n\tcreatePrivateSlotFill,\n\tComponentsContext,\n\tTabs,\n\tTheme,\n\tDropdownMenuV2,\n\tDropdownMenuGroupV2,\n\tDropdownMenuItemV2,\n\tDropdownMenuCheckboxItemV2,\n\tDropdownMenuRadioItemV2,\n\tDropdownMenuSeparatorV2,\n\tDropdownMenuItemLabelV2,\n\tDropdownMenuItemHelpTextV2,\n\tkebabCase,\n} );\n"],"mappings":"AAAA;AACA;AACA;;AAGA;AACA;AACA;AACA,SACCA,SAAS,IAAIC,WAAW,EACxBC,cAAc,IAAIC,gBAAgB,EAClCC,aAAa,IAAIC,eAAe,EAChCC,YAAY,IAAIC,cAAc,EAC9BC,iBAAiB,IAAIC,mBAAmB,QAClC,gBAAgB;AACvB,SAASC,OAAO,IAAIC,mBAAmB,QAAQ,yBAAyB;AACxE,SAASC,mBAAmB,IAAIC,8CAA8C,QAAQ,iBAAiB;AACvG,SAASC,qBAAqB,QAAQ,aAAa;AACnD,SACCC,YAAY,IAAIC,cAAc,EAC9BC,iBAAiB,IAAIC,mBAAmB,EACxCC,gBAAgB,IAAIC,kBAAkB,EACtCC,wBAAwB,IAAIC,0BAA0B,EACtDC,qBAAqB,IAAIC,uBAAuB,EAChDC,qBAAqB,IAAIC,uBAAuB,EAChDC,qBAAqB,IAAIC,uBAAuB,EAChDC,wBAAwB,IAAIC,0BAA0B,QAChD,oBAAoB;AAC3B,SAASC,iBAAiB,QAAQ,mCAAmC;AACrE,OAAOC,KAAK,MAAM,SAAS;AAC3B,OAAOC,IAAI,MAAM,QAAQ;AACzB,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,IAAI,QAAQ,eAAe;AAEpC,OAAO,MAAMC,WAAW,GAAG,CAAC,CAAC;AAC7BD,IAAI,CAAEC,WAAW,EAAE;EAClBnC,WAAW;EACXE,gBAAgB;EAChBE,eAAe;EACfE,cAAc;EACdE,mBAAmB;EACnBE,mBAAmB;EACnBE,8CAA8C;EAC9CC,qBAAqB;EACrBiB,iBAAiB;EACjBE,IAAI;EACJD,KAAK;EACLhB,cAAc;EACdE,mBAAmB;EACnBE,kBAAkB;EAClBE,0BAA0B;EAC1BE,uBAAuB;EACvBE,uBAAuB;EACvBE,uBAAuB;EACvBE,0BAA0B;EAC1BI;AACD,CAAE,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["Composite","CompositeV2","CompositeGroup","CompositeGroupV2","CompositeItem","CompositeItemV2","CompositeRow","CompositeRowV2","useCompositeStore","useCompositeStoreV2","default","CustomSelectControl","CustomSelectControlV2Legacy","positionToPlacement","__experimentalPopoverLegacyPositionToPlacement","createPrivateSlotFill","DropdownMenu","DropdownMenuV2","DropdownMenuGroup","DropdownMenuGroupV2","DropdownMenuItem","DropdownMenuItemV2","DropdownMenuCheckboxItem","DropdownMenuCheckboxItemV2","DropdownMenuRadioItem","DropdownMenuRadioItemV2","DropdownMenuSeparator","DropdownMenuSeparatorV2","DropdownMenuItemLabel","DropdownMenuItemLabelV2","DropdownMenuItemHelpText","DropdownMenuItemHelpTextV2","ComponentsContext","Theme","Tabs","kebabCase","lock","privateApis"],"sources":["@wordpress/components/src/private-apis.ts"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport {\n\tComposite as CompositeV2,\n\tCompositeGroup as CompositeGroupV2,\n\tCompositeItem as CompositeItemV2,\n\tCompositeRow as CompositeRowV2,\n\tuseCompositeStore as useCompositeStoreV2,\n} from './composite/v2';\nimport { default as CustomSelectControl } from './custom-select-control';\nimport { default as CustomSelectControlV2Legacy } from './custom-select-control-v2/legacy-component';\nimport { positionToPlacement as __experimentalPopoverLegacyPositionToPlacement } from './popover/utils';\nimport { createPrivateSlotFill } from './slot-fill';\nimport {\n\tDropdownMenu as DropdownMenuV2,\n\tDropdownMenuGroup as DropdownMenuGroupV2,\n\tDropdownMenuItem as DropdownMenuItemV2,\n\tDropdownMenuCheckboxItem as DropdownMenuCheckboxItemV2,\n\tDropdownMenuRadioItem as DropdownMenuRadioItemV2,\n\tDropdownMenuSeparator as DropdownMenuSeparatorV2,\n\tDropdownMenuItemLabel as DropdownMenuItemLabelV2,\n\tDropdownMenuItemHelpText as DropdownMenuItemHelpTextV2,\n} from './dropdown-menu-v2';\nimport { ComponentsContext } from './context/context-system-provider';\nimport Theme from './theme';\nimport Tabs from './tabs';\nimport { kebabCase } from './utils/strings';\nimport { lock } from './lock-unlock';\n\nexport const privateApis = {};\nlock( privateApis, {\n\tCompositeV2,\n\tCompositeGroupV2,\n\tCompositeItemV2,\n\tCompositeRowV2,\n\tuseCompositeStoreV2,\n\tCustomSelectControlV2Legacy,\n\tCustomSelectControl,\n\t__experimentalPopoverLegacyPositionToPlacement,\n\tcreatePrivateSlotFill,\n\tComponentsContext,\n\tTabs,\n\tTheme,\n\tDropdownMenuV2,\n\tDropdownMenuGroupV2,\n\tDropdownMenuItemV2,\n\tDropdownMenuCheckboxItemV2,\n\tDropdownMenuRadioItemV2,\n\tDropdownMenuSeparatorV2,\n\tDropdownMenuItemLabelV2,\n\tDropdownMenuItemHelpTextV2,\n\tkebabCase,\n} );\n"],"mappings":"AAAA;AACA;AACA;AACA,SACCA,SAAS,IAAIC,WAAW,EACxBC,cAAc,IAAIC,gBAAgB,EAClCC,aAAa,IAAIC,eAAe,EAChCC,YAAY,IAAIC,cAAc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