@wordpress/components 28.13.1-next.082ed6819.0 → 29.0.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 (1020) hide show
  1. package/CHANGELOG.md +53 -2
  2. package/CONTRIBUTING.md +16 -16
  3. package/build/alignment-matrix-control/icon.js +1 -0
  4. package/build/alignment-matrix-control/icon.js.map +1 -1
  5. package/build/alignment-matrix-control/index.js +1 -0
  6. package/build/alignment-matrix-control/index.js.map +1 -1
  7. package/build/angle-picker-control/index.js +1 -1
  8. package/build/angle-picker-control/index.js.map +1 -1
  9. package/build/animation/index.js +0 -6
  10. package/build/animation/index.js.map +1 -1
  11. package/build/autocomplete/autocompleter-ui.js +1 -0
  12. package/build/autocomplete/autocompleter-ui.js.map +1 -1
  13. package/build/autocomplete/autocompleter-ui.native.js +1 -0
  14. package/build/autocomplete/autocompleter-ui.native.js.map +1 -1
  15. package/build/autocomplete/get-default-use-items.js +1 -0
  16. package/build/autocomplete/get-default-use-items.js.map +1 -1
  17. package/build/border-box-control/border-box-control-split-controls/component.js +1 -1
  18. package/build/border-box-control/border-box-control-split-controls/component.js.map +1 -1
  19. package/build/border-box-control/utils.js +1 -0
  20. package/build/border-box-control/utils.js.map +1 -1
  21. package/build/border-control/border-control/component.js +2 -0
  22. package/build/border-control/border-control/component.js.map +1 -1
  23. package/build/border-control/border-control-dropdown/component.js +1 -0
  24. package/build/border-control/border-control-dropdown/component.js.map +1 -1
  25. package/build/border-control/border-control-style-picker/component.js +1 -0
  26. package/build/border-control/border-control-style-picker/component.js.map +1 -1
  27. package/build/box-control/index.js +35 -28
  28. package/build/box-control/index.js.map +1 -1
  29. package/build/box-control/input-control.js +161 -0
  30. package/build/box-control/input-control.js.map +1 -0
  31. package/build/box-control/types.js.map +1 -1
  32. package/build/box-control/utils.js +51 -48
  33. package/build/box-control/utils.js.map +1 -1
  34. package/build/button/index.native.js +1 -0
  35. package/build/button/index.native.js.map +1 -1
  36. package/build/button/types.js.map +1 -1
  37. package/build/circular-option-picker/circular-option-picker-actions.js +1 -0
  38. package/build/circular-option-picker/circular-option-picker-actions.js.map +1 -1
  39. package/build/circular-option-picker/circular-option-picker-option.js +1 -0
  40. package/build/circular-option-picker/circular-option-picker-option.js.map +1 -1
  41. package/build/clipboard-button/index.js +5 -3
  42. package/build/clipboard-button/index.js.map +1 -1
  43. package/build/color-indicator/index.native.js +1 -0
  44. package/build/color-indicator/index.native.js.map +1 -1
  45. package/build/color-palette/index.js +1 -0
  46. package/build/color-palette/index.js.map +1 -1
  47. package/build/color-palette/utils.js +1 -0
  48. package/build/color-palette/utils.js.map +1 -1
  49. package/build/color-picker/input-with-slider.js +2 -2
  50. package/build/color-picker/input-with-slider.js.map +1 -1
  51. package/build/combobox-control/index.js +1 -0
  52. package/build/combobox-control/index.js.map +1 -1
  53. package/build/composite/item.js +0 -9
  54. package/build/composite/item.js.map +1 -1
  55. package/build/composite/legacy/index.js +1 -0
  56. package/build/composite/legacy/index.js.map +1 -1
  57. package/build/custom-gradient-picker/gradient-bar/control-points.js +3 -0
  58. package/build/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
  59. package/build/custom-gradient-picker/gradient-bar/index.js +1 -0
  60. package/build/custom-gradient-picker/gradient-bar/index.js.map +1 -1
  61. package/build/custom-gradient-picker/gradient-bar/utils.js +1 -0
  62. package/build/custom-gradient-picker/gradient-bar/utils.js.map +1 -1
  63. package/build/custom-gradient-picker/index.js +3 -0
  64. package/build/custom-gradient-picker/index.js.map +1 -1
  65. package/build/custom-gradient-picker/serializer.js +1 -0
  66. package/build/custom-gradient-picker/serializer.js.map +1 -1
  67. package/build/custom-gradient-picker/types.js.map +1 -1
  68. package/build/custom-gradient-picker/utils.js +1 -0
  69. package/build/custom-gradient-picker/utils.js.map +1 -1
  70. package/build/custom-select-control/index.js +11 -2
  71. package/build/custom-select-control/index.js.map +1 -1
  72. package/build/custom-select-control/types.js.map +1 -1
  73. package/build/dashicon/index.js +1 -0
  74. package/build/dashicon/index.js.map +1 -1
  75. package/build/date-time/date/index.js +1 -0
  76. package/build/date-time/date/index.js.map +1 -1
  77. package/build/date-time/date/use-lilius/index.js +1 -0
  78. package/build/date-time/date/use-lilius/index.js.map +1 -1
  79. package/build/date-time/time/index.js +1 -0
  80. package/build/date-time/time/index.js.map +1 -1
  81. package/build/dimension-control/index.js +1 -0
  82. package/build/dimension-control/index.js.map +1 -1
  83. package/build/dimension-control/sizes.js +1 -0
  84. package/build/dimension-control/sizes.js.map +1 -1
  85. package/build/draggable/index.js +1 -0
  86. package/build/draggable/index.js.map +1 -1
  87. package/build/draggable/index.native.js +1 -0
  88. package/build/draggable/index.native.js.map +1 -1
  89. package/build/drop-zone/index.js +19 -13
  90. package/build/drop-zone/index.js.map +1 -1
  91. package/build/drop-zone/types.js.map +1 -1
  92. package/build/dropdown-menu/index.js +2 -0
  93. package/build/dropdown-menu/index.js.map +1 -1
  94. package/build/dropdown-menu/index.native.js +1 -0
  95. package/build/dropdown-menu/index.native.js.map +1 -1
  96. package/build/duotone-picker/color-list-picker/index.js +10 -14
  97. package/build/duotone-picker/color-list-picker/index.js.map +1 -1
  98. package/build/duotone-picker/duotone-picker.js +1 -0
  99. package/build/duotone-picker/duotone-picker.js.map +1 -1
  100. package/build/duotone-picker/utils.js +1 -0
  101. package/build/duotone-picker/utils.js.map +1 -1
  102. package/build/font-size-picker/font-size-picker-select.js +2 -0
  103. package/build/font-size-picker/font-size-picker-select.js.map +1 -1
  104. package/build/font-size-picker/font-size-picker-toggle-group.js +1 -0
  105. package/build/font-size-picker/font-size-picker-toggle-group.js.map +1 -1
  106. package/build/font-size-picker/index.js +2 -0
  107. package/build/font-size-picker/index.js.map +1 -1
  108. package/build/font-size-picker/index.native.js +1 -0
  109. package/build/font-size-picker/index.native.js.map +1 -1
  110. package/build/font-size-picker/utils.js +1 -0
  111. package/build/font-size-picker/utils.js.map +1 -1
  112. package/build/form-file-upload/index.js +11 -1
  113. package/build/form-file-upload/index.js.map +1 -1
  114. package/build/form-file-upload/types.js.map +1 -1
  115. package/build/form-token-field/index.js +6 -0
  116. package/build/form-token-field/index.js.map +1 -1
  117. package/build/form-token-field/suggestions-list.js +1 -0
  118. package/build/form-token-field/suggestions-list.js.map +1 -1
  119. package/build/gradient-picker/index.js +3 -0
  120. package/build/gradient-picker/index.js.map +1 -1
  121. package/build/gradient-picker/types.js.map +1 -1
  122. package/build/guide/index.js +1 -0
  123. package/build/guide/index.js.map +1 -1
  124. package/build/guide/page-control.js +1 -0
  125. package/build/guide/page-control.js.map +1 -1
  126. package/build/h-stack/hook.js +1 -0
  127. package/build/h-stack/hook.js.map +1 -1
  128. package/build/higher-order/navigate-regions/index.js +1 -0
  129. package/build/higher-order/navigate-regions/index.js.map +1 -1
  130. package/build/higher-order/with-fallback-styles/index.js +1 -0
  131. package/build/higher-order/with-fallback-styles/index.js.map +1 -1
  132. package/build/higher-order/with-filters/index.js +1 -0
  133. package/build/higher-order/with-filters/index.js.map +1 -1
  134. package/build/higher-order/with-notices/index.js +1 -0
  135. package/build/higher-order/with-notices/index.js.map +1 -1
  136. package/build/icon/index.js +9 -0
  137. package/build/icon/index.js.map +1 -1
  138. package/build/index.js +0 -6
  139. package/build/index.js.map +1 -1
  140. package/build/keyboard-shortcuts/index.js +1 -0
  141. package/build/keyboard-shortcuts/index.js.map +1 -1
  142. package/build/menu/checkbox-item.js +5 -9
  143. package/build/menu/checkbox-item.js.map +1 -1
  144. package/build/menu/group-label.js +4 -1
  145. package/build/menu/group-label.js.map +1 -1
  146. package/build/menu/group.js +4 -1
  147. package/build/menu/group.js.map +1 -1
  148. package/build/menu/item-help-text.js +5 -0
  149. package/build/menu/item-help-text.js.map +1 -1
  150. package/build/menu/item-label.js +5 -0
  151. package/build/menu/item-label.js.map +1 -1
  152. package/build/menu/item.js +4 -8
  153. package/build/menu/item.js.map +1 -1
  154. package/build/menu/radio-item.js +5 -9
  155. package/build/menu/radio-item.js.map +1 -1
  156. package/build/menu/separator.js +5 -2
  157. package/build/menu/separator.js.map +1 -1
  158. package/build/menu/styles.js +16 -16
  159. package/build/menu/styles.js.map +1 -1
  160. package/build/menu-items-choice/index.js +1 -0
  161. package/build/menu-items-choice/index.js.map +1 -1
  162. package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js +1 -0
  163. package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js.map +1 -1
  164. package/build/mobile/bottom-sheet/keyboard-avoiding-view.native.js +1 -0
  165. package/build/mobile/bottom-sheet/keyboard-avoiding-view.native.js.map +1 -1
  166. package/build/mobile/bottom-sheet/picker-cell.native.js +1 -0
  167. package/build/mobile/bottom-sheet/picker-cell.native.js.map +1 -1
  168. package/build/mobile/bottom-sheet-select-control/index.native.js +1 -0
  169. package/build/mobile/bottom-sheet-select-control/index.native.js.map +1 -1
  170. package/build/mobile/color-settings/palette.screen.native.js +1 -0
  171. package/build/mobile/color-settings/palette.screen.native.js.map +1 -1
  172. package/build/mobile/gradient/index.native.js +1 -0
  173. package/build/mobile/gradient/index.native.js.map +1 -1
  174. package/build/mobile/media-edit/index.native.js +1 -0
  175. package/build/mobile/media-edit/index.native.js.map +1 -1
  176. package/build/mobile/picker/index.android.js +1 -0
  177. package/build/mobile/picker/index.android.js.map +1 -1
  178. package/build/mobile/picker/index.ios.js +1 -0
  179. package/build/mobile/picker/index.ios.js.map +1 -1
  180. package/build/mobile/segmented-control/index.native.js +1 -0
  181. package/build/mobile/segmented-control/index.native.js.map +1 -1
  182. package/build/mobile/utils/get-px-from-css-unit.native.js +1 -0
  183. package/build/mobile/utils/get-px-from-css-unit.native.js.map +1 -1
  184. package/build/modal/aria-helper.js +0 -1
  185. package/build/modal/aria-helper.js.map +1 -1
  186. package/build/modal/index.js +0 -1
  187. package/build/modal/index.js.map +1 -1
  188. package/build/navigable-container/container.js +1 -0
  189. package/build/navigable-container/container.js.map +1 -1
  190. package/build/navigation/group/index.js +1 -0
  191. package/build/navigation/group/index.js.map +1 -1
  192. package/build/navigation/menu/menu-title-search.js +1 -0
  193. package/build/navigation/menu/menu-title-search.js.map +1 -1
  194. package/build/navigation/menu/search-no-results-found.js +1 -0
  195. package/build/navigation/menu/search-no-results-found.js.map +1 -1
  196. package/build/navigation/styles/navigation-styles.js +12 -12
  197. package/build/navigation/styles/navigation-styles.js.map +1 -1
  198. package/build/navigator/navigator/component.js +1 -0
  199. package/build/navigator/navigator/component.js.map +1 -1
  200. package/build/navigator/navigator-screen/component.js +1 -0
  201. package/build/navigator/navigator-screen/component.js.map +1 -1
  202. package/build/navigator/utils/router.js +1 -0
  203. package/build/navigator/utils/router.js.map +1 -1
  204. package/build/notice/index.js +1 -0
  205. package/build/notice/index.js.map +1 -1
  206. package/build/notice/list.js +1 -0
  207. package/build/notice/list.js.map +1 -1
  208. package/build/notice/list.native.js +1 -0
  209. package/build/notice/list.native.js.map +1 -1
  210. package/build/number-control/index.js +8 -0
  211. package/build/number-control/index.js.map +1 -1
  212. package/build/number-control/types.js.map +1 -1
  213. package/build/palette-edit/index.js +1 -0
  214. package/build/palette-edit/index.js.map +1 -1
  215. package/build/panel/actions.native.js +1 -0
  216. package/build/panel/actions.native.js.map +1 -1
  217. package/build/query-controls/index.js +1 -0
  218. package/build/query-controls/index.js.map +1 -1
  219. package/build/query-controls/terms.js +1 -0
  220. package/build/query-controls/terms.js.map +1 -1
  221. package/build/radio-control/index.js +1 -0
  222. package/build/radio-control/index.js.map +1 -1
  223. package/build/radio-control/index.native.js +1 -0
  224. package/build/radio-control/index.native.js.map +1 -1
  225. package/build/range-control/index.js +2 -1
  226. package/build/range-control/index.js.map +1 -1
  227. package/build/range-control/mark.js +0 -1
  228. package/build/range-control/mark.js.map +1 -1
  229. package/build/range-control/rail.js +1 -0
  230. package/build/range-control/rail.js.map +1 -1
  231. package/build/range-control/styles/range-control-styles.js +33 -45
  232. package/build/range-control/styles/range-control-styles.js.map +1 -1
  233. package/build/resizable-box/index.js +10 -1
  234. package/build/resizable-box/index.js.map +1 -1
  235. package/build/sandbox/index.js +1 -0
  236. package/build/sandbox/index.js.map +1 -1
  237. package/build/sandbox/index.native.js +1 -0
  238. package/build/sandbox/index.native.js.map +1 -1
  239. package/build/search-control/index.native.js +1 -0
  240. package/build/search-control/index.native.js.map +1 -1
  241. package/build/select-control/index.js +1 -0
  242. package/build/select-control/index.js.map +1 -1
  243. package/build/slot-fill/bubbles-virtually/fill.js +8 -12
  244. package/build/slot-fill/bubbles-virtually/fill.js.map +1 -1
  245. package/build/slot-fill/bubbles-virtually/slot-fill-provider.js +7 -10
  246. package/build/slot-fill/bubbles-virtually/slot-fill-provider.js.map +1 -1
  247. package/build/slot-fill/bubbles-virtually/slot.js +4 -10
  248. package/build/slot-fill/bubbles-virtually/slot.js.map +1 -1
  249. package/build/slot-fill/provider.js +1 -0
  250. package/build/slot-fill/provider.js.map +1 -1
  251. package/build/slot-fill/slot.js +1 -0
  252. package/build/slot-fill/slot.js.map +1 -1
  253. package/build/slot-fill/types.js.map +1 -1
  254. package/build/snackbar/index.js +1 -0
  255. package/build/snackbar/index.js.map +1 -1
  256. package/build/snackbar/list.js +1 -0
  257. package/build/snackbar/list.js.map +1 -1
  258. package/build/style-provider/index.js +0 -1
  259. package/build/style-provider/index.js.map +1 -1
  260. package/build/tab-panel/index.js +1 -0
  261. package/build/tab-panel/index.js.map +1 -1
  262. package/build/tabs/index.js +1 -0
  263. package/build/tabs/index.js.map +1 -1
  264. package/build/tabs/tab.js +0 -17
  265. package/build/tabs/tab.js.map +1 -1
  266. package/build/text/utils.js +1 -0
  267. package/build/text/utils.js.map +1 -1
  268. package/build/theme/color-algorithms.js +1 -0
  269. package/build/theme/color-algorithms.js.map +1 -1
  270. package/build/toggle-group-control/toggle-group-control/styles.js +7 -7
  271. package/build/toggle-group-control/toggle-group-control/styles.js.map +1 -1
  272. package/build/toggle-group-control/toggle-group-control-option-base/styles.js +8 -8
  273. package/build/toggle-group-control/toggle-group-control-option-base/styles.js.map +1 -1
  274. package/build/toolbar/toolbar-button/index.js +2 -0
  275. package/build/toolbar/toolbar-button/index.js.map +1 -1
  276. package/build/toolbar/toolbar-group/index.js +1 -0
  277. package/build/toolbar/toolbar-group/index.js.map +1 -1
  278. package/build/tools-panel/tools-panel/component.js +2 -0
  279. package/build/tools-panel/tools-panel/component.js.map +1 -1
  280. package/build/tools-panel/tools-panel/hook.js +1 -0
  281. package/build/tools-panel/tools-panel/hook.js.map +1 -1
  282. package/build/tools-panel/tools-panel-header/component.js +1 -0
  283. package/build/tools-panel/tools-panel-header/component.js.map +1 -1
  284. package/build/tree-grid/cell.js +4 -1
  285. package/build/tree-grid/cell.js.map +1 -1
  286. package/build/tree-grid/index.js +1 -0
  287. package/build/tree-grid/index.js.map +1 -1
  288. package/build/tree-grid/types.js.map +1 -1
  289. package/build/tree-select/index.js +1 -0
  290. package/build/tree-select/index.js.map +1 -1
  291. package/build/unit-control/index.js +11 -1
  292. package/build/unit-control/index.js.map +1 -1
  293. package/build/unit-control/index.native.js +1 -0
  294. package/build/unit-control/index.native.js.map +1 -1
  295. package/build/unit-control/types.js.map +1 -1
  296. package/build/unit-control/unit-select-control.js +1 -0
  297. package/build/unit-control/unit-select-control.js.map +1 -1
  298. package/build/unit-control/utils.js +1 -0
  299. package/build/unit-control/utils.js.map +1 -1
  300. package/build/utils/colors-values.js +3 -0
  301. package/build/utils/colors-values.js.map +1 -1
  302. package/build/utils/config-values.js +0 -1
  303. package/build/utils/config-values.js.map +1 -1
  304. package/build/utils/get-valid-children.js +1 -0
  305. package/build/utils/get-valid-children.js.map +1 -1
  306. package/build/utils/hooks/use-animated-offset-rect.js +1 -0
  307. package/build/utils/hooks/use-animated-offset-rect.js.map +1 -1
  308. package/build/utils/hooks/use-cx.js +1 -0
  309. package/build/utils/hooks/use-cx.js.map +1 -1
  310. package/build/utils/math.js +1 -0
  311. package/build/utils/math.js.map +1 -1
  312. package/build/utils/rtl.js +1 -0
  313. package/build/utils/rtl.js.map +1 -1
  314. package/build/utils/values.js +1 -0
  315. package/build/utils/values.js.map +1 -1
  316. package/build/z-stack/component.js +1 -0
  317. package/build/z-stack/component.js.map +1 -1
  318. package/build-module/alignment-matrix-control/icon.js +1 -0
  319. package/build-module/alignment-matrix-control/icon.js.map +1 -1
  320. package/build-module/alignment-matrix-control/index.js +1 -0
  321. package/build-module/alignment-matrix-control/index.js.map +1 -1
  322. package/build-module/angle-picker-control/index.js +1 -1
  323. package/build-module/angle-picker-control/index.js.map +1 -1
  324. package/build-module/animation/index.js +1 -1
  325. package/build-module/animation/index.js.map +1 -1
  326. package/build-module/autocomplete/autocompleter-ui.js +1 -0
  327. package/build-module/autocomplete/autocompleter-ui.js.map +1 -1
  328. package/build-module/autocomplete/autocompleter-ui.native.js +1 -0
  329. package/build-module/autocomplete/autocompleter-ui.native.js.map +1 -1
  330. package/build-module/autocomplete/get-default-use-items.js +1 -0
  331. package/build-module/autocomplete/get-default-use-items.js.map +1 -1
  332. package/build-module/border-box-control/border-box-control-split-controls/component.js +1 -1
  333. package/build-module/border-box-control/border-box-control-split-controls/component.js.map +1 -1
  334. package/build-module/border-box-control/utils.js +1 -0
  335. package/build-module/border-box-control/utils.js.map +1 -1
  336. package/build-module/border-control/border-control/component.js +2 -0
  337. package/build-module/border-control/border-control/component.js.map +1 -1
  338. package/build-module/border-control/border-control-dropdown/component.js +1 -0
  339. package/build-module/border-control/border-control-dropdown/component.js.map +1 -1
  340. package/build-module/border-control/border-control-style-picker/component.js +1 -0
  341. package/build-module/border-control/border-control-style-picker/component.js.map +1 -1
  342. package/build-module/box-control/index.js +37 -30
  343. package/build-module/box-control/index.js.map +1 -1
  344. package/build-module/box-control/input-control.js +153 -0
  345. package/build-module/box-control/input-control.js.map +1 -0
  346. package/build-module/box-control/types.js.map +1 -1
  347. package/build-module/box-control/utils.js +48 -46
  348. package/build-module/box-control/utils.js.map +1 -1
  349. package/build-module/button/index.native.js +1 -0
  350. package/build-module/button/index.native.js.map +1 -1
  351. package/build-module/button/types.js.map +1 -1
  352. package/build-module/circular-option-picker/circular-option-picker-actions.js +1 -0
  353. package/build-module/circular-option-picker/circular-option-picker-actions.js.map +1 -1
  354. package/build-module/circular-option-picker/circular-option-picker-option.js +1 -0
  355. package/build-module/circular-option-picker/circular-option-picker-option.js.map +1 -1
  356. package/build-module/clipboard-button/index.js +5 -3
  357. package/build-module/clipboard-button/index.js.map +1 -1
  358. package/build-module/color-indicator/index.native.js +1 -0
  359. package/build-module/color-indicator/index.native.js.map +1 -1
  360. package/build-module/color-palette/index.js +1 -0
  361. package/build-module/color-palette/index.js.map +1 -1
  362. package/build-module/color-palette/utils.js +1 -0
  363. package/build-module/color-palette/utils.js.map +1 -1
  364. package/build-module/color-picker/input-with-slider.js +2 -2
  365. package/build-module/color-picker/input-with-slider.js.map +1 -1
  366. package/build-module/combobox-control/index.js +1 -0
  367. package/build-module/combobox-control/index.js.map +1 -1
  368. package/build-module/composite/item.js +0 -9
  369. package/build-module/composite/item.js.map +1 -1
  370. package/build-module/composite/legacy/index.js +1 -0
  371. package/build-module/composite/legacy/index.js.map +1 -1
  372. package/build-module/custom-gradient-picker/gradient-bar/control-points.js +3 -0
  373. package/build-module/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
  374. package/build-module/custom-gradient-picker/gradient-bar/index.js +1 -0
  375. package/build-module/custom-gradient-picker/gradient-bar/index.js.map +1 -1
  376. package/build-module/custom-gradient-picker/gradient-bar/utils.js +1 -0
  377. package/build-module/custom-gradient-picker/gradient-bar/utils.js.map +1 -1
  378. package/build-module/custom-gradient-picker/index.js +3 -0
  379. package/build-module/custom-gradient-picker/index.js.map +1 -1
  380. package/build-module/custom-gradient-picker/serializer.js +1 -0
  381. package/build-module/custom-gradient-picker/serializer.js.map +1 -1
  382. package/build-module/custom-gradient-picker/types.js.map +1 -1
  383. package/build-module/custom-gradient-picker/utils.js +1 -0
  384. package/build-module/custom-gradient-picker/utils.js.map +1 -1
  385. package/build-module/custom-select-control/index.js +11 -2
  386. package/build-module/custom-select-control/index.js.map +1 -1
  387. package/build-module/custom-select-control/types.js.map +1 -1
  388. package/build-module/dashicon/index.js +1 -0
  389. package/build-module/dashicon/index.js.map +1 -1
  390. package/build-module/date-time/date/index.js +1 -0
  391. package/build-module/date-time/date/index.js.map +1 -1
  392. package/build-module/date-time/date/use-lilius/index.js +1 -0
  393. package/build-module/date-time/date/use-lilius/index.js.map +1 -1
  394. package/build-module/date-time/time/index.js +1 -0
  395. package/build-module/date-time/time/index.js.map +1 -1
  396. package/build-module/dimension-control/index.js +1 -0
  397. package/build-module/dimension-control/index.js.map +1 -1
  398. package/build-module/dimension-control/sizes.js +1 -0
  399. package/build-module/dimension-control/sizes.js.map +1 -1
  400. package/build-module/draggable/index.js +1 -0
  401. package/build-module/draggable/index.js.map +1 -1
  402. package/build-module/draggable/index.native.js +1 -0
  403. package/build-module/draggable/index.native.js.map +1 -1
  404. package/build-module/drop-zone/index.js +19 -13
  405. package/build-module/drop-zone/index.js.map +1 -1
  406. package/build-module/drop-zone/types.js.map +1 -1
  407. package/build-module/dropdown-menu/index.js +2 -0
  408. package/build-module/dropdown-menu/index.js.map +1 -1
  409. package/build-module/dropdown-menu/index.native.js +1 -0
  410. package/build-module/dropdown-menu/index.native.js.map +1 -1
  411. package/build-module/duotone-picker/color-list-picker/index.js +11 -15
  412. package/build-module/duotone-picker/color-list-picker/index.js.map +1 -1
  413. package/build-module/duotone-picker/duotone-picker.js +1 -0
  414. package/build-module/duotone-picker/duotone-picker.js.map +1 -1
  415. package/build-module/duotone-picker/utils.js +1 -0
  416. package/build-module/duotone-picker/utils.js.map +1 -1
  417. package/build-module/font-size-picker/font-size-picker-select.js +2 -0
  418. package/build-module/font-size-picker/font-size-picker-select.js.map +1 -1
  419. package/build-module/font-size-picker/font-size-picker-toggle-group.js +1 -0
  420. package/build-module/font-size-picker/font-size-picker-toggle-group.js.map +1 -1
  421. package/build-module/font-size-picker/index.js +2 -0
  422. package/build-module/font-size-picker/index.js.map +1 -1
  423. package/build-module/font-size-picker/index.native.js +1 -0
  424. package/build-module/font-size-picker/index.native.js.map +1 -1
  425. package/build-module/font-size-picker/utils.js +1 -0
  426. package/build-module/font-size-picker/utils.js.map +1 -1
  427. package/build-module/form-file-upload/index.js +13 -2
  428. package/build-module/form-file-upload/index.js.map +1 -1
  429. package/build-module/form-file-upload/types.js.map +1 -1
  430. package/build-module/form-token-field/index.js +6 -0
  431. package/build-module/form-token-field/index.js.map +1 -1
  432. package/build-module/form-token-field/suggestions-list.js +1 -0
  433. package/build-module/form-token-field/suggestions-list.js.map +1 -1
  434. package/build-module/gradient-picker/index.js +3 -0
  435. package/build-module/gradient-picker/index.js.map +1 -1
  436. package/build-module/gradient-picker/types.js.map +1 -1
  437. package/build-module/guide/index.js +1 -0
  438. package/build-module/guide/index.js.map +1 -1
  439. package/build-module/guide/page-control.js +1 -0
  440. package/build-module/guide/page-control.js.map +1 -1
  441. package/build-module/h-stack/hook.js +1 -0
  442. package/build-module/h-stack/hook.js.map +1 -1
  443. package/build-module/higher-order/navigate-regions/index.js +1 -0
  444. package/build-module/higher-order/navigate-regions/index.js.map +1 -1
  445. package/build-module/higher-order/with-fallback-styles/index.js +1 -0
  446. package/build-module/higher-order/with-fallback-styles/index.js.map +1 -1
  447. package/build-module/higher-order/with-filters/index.js +1 -0
  448. package/build-module/higher-order/with-filters/index.js.map +1 -1
  449. package/build-module/higher-order/with-notices/index.js +1 -0
  450. package/build-module/higher-order/with-notices/index.js.map +1 -1
  451. package/build-module/icon/index.js +9 -0
  452. package/build-module/icon/index.js.map +1 -1
  453. package/build-module/index.js +1 -1
  454. package/build-module/index.js.map +1 -1
  455. package/build-module/keyboard-shortcuts/index.js +1 -0
  456. package/build-module/keyboard-shortcuts/index.js.map +1 -1
  457. package/build-module/menu/checkbox-item.js +5 -9
  458. package/build-module/menu/checkbox-item.js.map +1 -1
  459. package/build-module/menu/group-label.js +4 -1
  460. package/build-module/menu/group-label.js.map +1 -1
  461. package/build-module/menu/group.js +4 -1
  462. package/build-module/menu/group.js.map +1 -1
  463. package/build-module/menu/item-help-text.js +6 -1
  464. package/build-module/menu/item-help-text.js.map +1 -1
  465. package/build-module/menu/item-label.js +6 -1
  466. package/build-module/menu/item-label.js.map +1 -1
  467. package/build-module/menu/item.js +4 -8
  468. package/build-module/menu/item.js.map +1 -1
  469. package/build-module/menu/radio-item.js +5 -9
  470. package/build-module/menu/radio-item.js.map +1 -1
  471. package/build-module/menu/separator.js +5 -2
  472. package/build-module/menu/separator.js.map +1 -1
  473. package/build-module/menu/styles.js +16 -16
  474. package/build-module/menu/styles.js.map +1 -1
  475. package/build-module/menu-items-choice/index.js +1 -0
  476. package/build-module/menu-items-choice/index.js.map +1 -1
  477. package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js +1 -0
  478. package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js.map +1 -1
  479. package/build-module/mobile/bottom-sheet/keyboard-avoiding-view.native.js +1 -0
  480. package/build-module/mobile/bottom-sheet/keyboard-avoiding-view.native.js.map +1 -1
  481. package/build-module/mobile/bottom-sheet/picker-cell.native.js +1 -0
  482. package/build-module/mobile/bottom-sheet/picker-cell.native.js.map +1 -1
  483. package/build-module/mobile/bottom-sheet-select-control/index.native.js +1 -0
  484. package/build-module/mobile/bottom-sheet-select-control/index.native.js.map +1 -1
  485. package/build-module/mobile/color-settings/palette.screen.native.js +1 -0
  486. package/build-module/mobile/color-settings/palette.screen.native.js.map +1 -1
  487. package/build-module/mobile/gradient/index.native.js +1 -0
  488. package/build-module/mobile/gradient/index.native.js.map +1 -1
  489. package/build-module/mobile/media-edit/index.native.js +1 -0
  490. package/build-module/mobile/media-edit/index.native.js.map +1 -1
  491. package/build-module/mobile/picker/index.android.js +1 -0
  492. package/build-module/mobile/picker/index.android.js.map +1 -1
  493. package/build-module/mobile/picker/index.ios.js +1 -0
  494. package/build-module/mobile/picker/index.ios.js.map +1 -1
  495. package/build-module/mobile/segmented-control/index.native.js +1 -0
  496. package/build-module/mobile/segmented-control/index.native.js.map +1 -1
  497. package/build-module/mobile/utils/get-px-from-css-unit.native.js +1 -0
  498. package/build-module/mobile/utils/get-px-from-css-unit.native.js.map +1 -1
  499. package/build-module/modal/aria-helper.js +0 -1
  500. package/build-module/modal/aria-helper.js.map +1 -1
  501. package/build-module/modal/index.js +0 -1
  502. package/build-module/modal/index.js.map +1 -1
  503. package/build-module/navigable-container/container.js +1 -0
  504. package/build-module/navigable-container/container.js.map +1 -1
  505. package/build-module/navigation/group/index.js +1 -0
  506. package/build-module/navigation/group/index.js.map +1 -1
  507. package/build-module/navigation/menu/menu-title-search.js +1 -0
  508. package/build-module/navigation/menu/menu-title-search.js.map +1 -1
  509. package/build-module/navigation/menu/search-no-results-found.js +1 -0
  510. package/build-module/navigation/menu/search-no-results-found.js.map +1 -1
  511. package/build-module/navigation/styles/navigation-styles.js +12 -12
  512. package/build-module/navigation/styles/navigation-styles.js.map +1 -1
  513. package/build-module/navigator/navigator/component.js +1 -0
  514. package/build-module/navigator/navigator/component.js.map +1 -1
  515. package/build-module/navigator/navigator-screen/component.js +1 -0
  516. package/build-module/navigator/navigator-screen/component.js.map +1 -1
  517. package/build-module/navigator/utils/router.js +1 -0
  518. package/build-module/navigator/utils/router.js.map +1 -1
  519. package/build-module/notice/index.js +1 -0
  520. package/build-module/notice/index.js.map +1 -1
  521. package/build-module/notice/list.js +1 -0
  522. package/build-module/notice/list.js.map +1 -1
  523. package/build-module/notice/list.native.js +1 -0
  524. package/build-module/notice/list.native.js.map +1 -1
  525. package/build-module/number-control/index.js +8 -0
  526. package/build-module/number-control/index.js.map +1 -1
  527. package/build-module/number-control/types.js.map +1 -1
  528. package/build-module/palette-edit/index.js +1 -0
  529. package/build-module/palette-edit/index.js.map +1 -1
  530. package/build-module/panel/actions.native.js +1 -0
  531. package/build-module/panel/actions.native.js.map +1 -1
  532. package/build-module/query-controls/index.js +1 -0
  533. package/build-module/query-controls/index.js.map +1 -1
  534. package/build-module/query-controls/terms.js +1 -0
  535. package/build-module/query-controls/terms.js.map +1 -1
  536. package/build-module/radio-control/index.js +1 -0
  537. package/build-module/radio-control/index.js.map +1 -1
  538. package/build-module/radio-control/index.native.js +1 -0
  539. package/build-module/radio-control/index.native.js.map +1 -1
  540. package/build-module/range-control/index.js +2 -1
  541. package/build-module/range-control/index.js.map +1 -1
  542. package/build-module/range-control/mark.js +0 -1
  543. package/build-module/range-control/mark.js.map +1 -1
  544. package/build-module/range-control/rail.js +1 -0
  545. package/build-module/range-control/rail.js.map +1 -1
  546. package/build-module/range-control/styles/range-control-styles.js +33 -45
  547. package/build-module/range-control/styles/range-control-styles.js.map +1 -1
  548. package/build-module/resizable-box/index.js +10 -1
  549. package/build-module/resizable-box/index.js.map +1 -1
  550. package/build-module/sandbox/index.js +1 -0
  551. package/build-module/sandbox/index.js.map +1 -1
  552. package/build-module/sandbox/index.native.js +1 -0
  553. package/build-module/sandbox/index.native.js.map +1 -1
  554. package/build-module/search-control/index.native.js +1 -0
  555. package/build-module/search-control/index.native.js.map +1 -1
  556. package/build-module/select-control/index.js +1 -0
  557. package/build-module/select-control/index.js.map +1 -1
  558. package/build-module/slot-fill/bubbles-virtually/fill.js +9 -13
  559. package/build-module/slot-fill/bubbles-virtually/fill.js.map +1 -1
  560. package/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js +7 -10
  561. package/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js.map +1 -1
  562. package/build-module/slot-fill/bubbles-virtually/slot.js +4 -10
  563. package/build-module/slot-fill/bubbles-virtually/slot.js.map +1 -1
  564. package/build-module/slot-fill/provider.js +1 -0
  565. package/build-module/slot-fill/provider.js.map +1 -1
  566. package/build-module/slot-fill/slot.js +1 -0
  567. package/build-module/slot-fill/slot.js.map +1 -1
  568. package/build-module/slot-fill/types.js.map +1 -1
  569. package/build-module/snackbar/index.js +1 -0
  570. package/build-module/snackbar/index.js.map +1 -1
  571. package/build-module/snackbar/list.js +1 -0
  572. package/build-module/snackbar/list.js.map +1 -1
  573. package/build-module/style-provider/index.js +0 -1
  574. package/build-module/style-provider/index.js.map +1 -1
  575. package/build-module/tab-panel/index.js +1 -0
  576. package/build-module/tab-panel/index.js.map +1 -1
  577. package/build-module/tabs/index.js +1 -0
  578. package/build-module/tabs/index.js.map +1 -1
  579. package/build-module/tabs/tab.js +0 -15
  580. package/build-module/tabs/tab.js.map +1 -1
  581. package/build-module/text/utils.js +1 -0
  582. package/build-module/text/utils.js.map +1 -1
  583. package/build-module/theme/color-algorithms.js +1 -0
  584. package/build-module/theme/color-algorithms.js.map +1 -1
  585. package/build-module/toggle-group-control/toggle-group-control/styles.js +7 -7
  586. package/build-module/toggle-group-control/toggle-group-control/styles.js.map +1 -1
  587. package/build-module/toggle-group-control/toggle-group-control-option-base/styles.js +8 -8
  588. package/build-module/toggle-group-control/toggle-group-control-option-base/styles.js.map +1 -1
  589. package/build-module/toolbar/toolbar-button/index.js +2 -0
  590. package/build-module/toolbar/toolbar-button/index.js.map +1 -1
  591. package/build-module/toolbar/toolbar-group/index.js +1 -0
  592. package/build-module/toolbar/toolbar-group/index.js.map +1 -1
  593. package/build-module/tools-panel/tools-panel/component.js +2 -0
  594. package/build-module/tools-panel/tools-panel/component.js.map +1 -1
  595. package/build-module/tools-panel/tools-panel/hook.js +1 -0
  596. package/build-module/tools-panel/tools-panel/hook.js.map +1 -1
  597. package/build-module/tools-panel/tools-panel-header/component.js +1 -0
  598. package/build-module/tools-panel/tools-panel-header/component.js.map +1 -1
  599. package/build-module/tree-grid/cell.js +4 -1
  600. package/build-module/tree-grid/cell.js.map +1 -1
  601. package/build-module/tree-grid/index.js +1 -0
  602. package/build-module/tree-grid/index.js.map +1 -1
  603. package/build-module/tree-grid/types.js.map +1 -1
  604. package/build-module/tree-select/index.js +1 -0
  605. package/build-module/tree-select/index.js.map +1 -1
  606. package/build-module/unit-control/index.js +11 -1
  607. package/build-module/unit-control/index.js.map +1 -1
  608. package/build-module/unit-control/index.native.js +1 -0
  609. package/build-module/unit-control/index.native.js.map +1 -1
  610. package/build-module/unit-control/types.js.map +1 -1
  611. package/build-module/unit-control/unit-select-control.js +1 -0
  612. package/build-module/unit-control/unit-select-control.js.map +1 -1
  613. package/build-module/unit-control/utils.js +1 -0
  614. package/build-module/unit-control/utils.js.map +1 -1
  615. package/build-module/utils/colors-values.js +3 -0
  616. package/build-module/utils/colors-values.js.map +1 -1
  617. package/build-module/utils/config-values.js +0 -1
  618. package/build-module/utils/config-values.js.map +1 -1
  619. package/build-module/utils/get-valid-children.js +1 -0
  620. package/build-module/utils/get-valid-children.js.map +1 -1
  621. package/build-module/utils/hooks/use-animated-offset-rect.js +1 -0
  622. package/build-module/utils/hooks/use-animated-offset-rect.js.map +1 -1
  623. package/build-module/utils/hooks/use-cx.js +1 -0
  624. package/build-module/utils/hooks/use-cx.js.map +1 -1
  625. package/build-module/utils/math.js +1 -0
  626. package/build-module/utils/math.js.map +1 -1
  627. package/build-module/utils/rtl.js +1 -0
  628. package/build-module/utils/rtl.js.map +1 -1
  629. package/build-module/utils/values.js +1 -0
  630. package/build-module/utils/values.js.map +1 -1
  631. package/build-module/z-stack/component.js +1 -0
  632. package/build-module/z-stack/component.js.map +1 -1
  633. package/build-style/style-rtl.css +15 -11
  634. package/build-style/style.css +15 -11
  635. package/build-types/alignment-matrix-control/styles.d.ts.map +1 -1
  636. package/build-types/angle-picker-control/styles/angle-picker-control-styles.d.ts.map +1 -1
  637. package/build-types/animation/index.d.ts +1 -1
  638. package/build-types/animation/index.d.ts.map +1 -1
  639. package/build-types/base-control/hooks.d.ts +4 -4
  640. package/build-types/base-control/styles/base-control-styles.d.ts.map +1 -1
  641. package/build-types/border-box-control/border-box-control/hook.d.ts +83 -83
  642. package/build-types/border-box-control/border-box-control-linked-button/hook.d.ts +93 -93
  643. package/build-types/border-box-control/border-box-control-split-controls/hook.d.ts +83 -83
  644. package/build-types/border-box-control/border-box-control-visualizer/hook.d.ts +83 -83
  645. package/build-types/border-control/border-control/component.d.ts.map +1 -1
  646. package/build-types/border-control/border-control/hook.d.ts +83 -83
  647. package/build-types/border-control/border-control-dropdown/hook.d.ts +83 -83
  648. package/build-types/border-control/stories/index.story.d.ts.map +1 -1
  649. package/build-types/box-control/index.d.ts +14 -13
  650. package/build-types/box-control/index.d.ts.map +1 -1
  651. package/build-types/box-control/input-control.d.ts +3 -0
  652. package/build-types/box-control/input-control.d.ts.map +1 -0
  653. package/build-types/box-control/stories/index.story.d.ts +852 -816
  654. package/build-types/box-control/stories/index.story.d.ts.map +1 -1
  655. package/build-types/box-control/styles/box-control-icon-styles.d.ts.map +1 -1
  656. package/build-types/box-control/styles/box-control-styles.d.ts +3 -2
  657. package/build-types/box-control/styles/box-control-styles.d.ts.map +1 -1
  658. package/build-types/box-control/types.d.ts +25 -3
  659. package/build-types/box-control/types.d.ts.map +1 -1
  660. package/build-types/box-control/utils.d.ts +23 -15
  661. package/build-types/box-control/utils.d.ts.map +1 -1
  662. package/build-types/button/stories/index.story.d.ts +18 -0
  663. package/build-types/button/stories/index.story.d.ts.map +1 -1
  664. package/build-types/button/types.d.ts +6 -4
  665. package/build-types/button/types.d.ts.map +1 -1
  666. package/build-types/card/card/hook.d.ts +83 -83
  667. package/build-types/card/card-body/hook.d.ts +83 -83
  668. package/build-types/card/card-divider/hook.d.ts +84 -84
  669. package/build-types/card/card-footer/hook.d.ts +83 -83
  670. package/build-types/card/card-header/hook.d.ts +83 -83
  671. package/build-types/card/card-media/hook.d.ts +83 -83
  672. package/build-types/circular-option-picker/circular-option-picker-actions.d.ts.map +1 -1
  673. package/build-types/circular-option-picker/circular-option-picker-option.d.ts.map +1 -1
  674. package/build-types/clipboard-button/index.d.ts.map +1 -1
  675. package/build-types/color-picker/styles.d.ts +3 -2
  676. package/build-types/color-picker/styles.d.ts.map +1 -1
  677. package/build-types/combobox-control/stories/index.story.d.ts.map +1 -1
  678. package/build-types/composite/index.d.ts.map +1 -1
  679. package/build-types/composite/item.d.ts.map +1 -1
  680. package/build-types/context/constants.d.ts.map +1 -1
  681. package/build-types/context/get-styled-class-name-from-key.d.ts +1 -9
  682. package/build-types/context/get-styled-class-name-from-key.d.ts.map +1 -1
  683. package/build-types/custom-gradient-picker/gradient-bar/control-points.d.ts.map +1 -1
  684. package/build-types/custom-gradient-picker/index.d.ts +1 -1
  685. package/build-types/custom-gradient-picker/index.d.ts.map +1 -1
  686. package/build-types/custom-gradient-picker/types.d.ts +6 -0
  687. package/build-types/custom-gradient-picker/types.d.ts.map +1 -1
  688. package/build-types/custom-select-control/index.d.ts.map +1 -1
  689. package/build-types/custom-select-control/stories/index.story.d.ts.map +1 -1
  690. package/build-types/custom-select-control/types.d.ts +7 -0
  691. package/build-types/custom-select-control/types.d.ts.map +1 -1
  692. package/build-types/custom-select-control-v2/stories/index.story.d.ts.map +1 -1
  693. package/build-types/custom-select-control-v2/styles.d.ts.map +1 -1
  694. package/build-types/date-time/date/styles.d.ts.map +1 -1
  695. package/build-types/date-time/stories/date-time.story.d.ts.map +1 -1
  696. package/build-types/date-time/stories/date.story.d.ts.map +1 -1
  697. package/build-types/date-time/stories/time.story.d.ts.map +1 -1
  698. package/build-types/date-time/time/styles.d.ts +8 -4
  699. package/build-types/date-time/time/styles.d.ts.map +1 -1
  700. package/build-types/dimension-control/stories/index.story.d.ts.map +1 -1
  701. package/build-types/drop-zone/index.d.ts +1 -1
  702. package/build-types/drop-zone/index.d.ts.map +1 -1
  703. package/build-types/drop-zone/types.d.ts +5 -0
  704. package/build-types/drop-zone/types.d.ts.map +1 -1
  705. package/build-types/dropdown-menu/index.d.ts.map +1 -1
  706. package/build-types/duotone-picker/color-list-picker/index.d.ts.map +1 -1
  707. package/build-types/elevation/hook.d.ts +83 -83
  708. package/build-types/flex/flex/hook.d.ts +83 -83
  709. package/build-types/flex/flex-block/hook.d.ts +83 -83
  710. package/build-types/flex/flex-item/hook.d.ts +83 -83
  711. package/build-types/focal-point-picker/stories/index.story.d.ts.map +1 -1
  712. package/build-types/focal-point-picker/styles/focal-point-picker-style.d.ts +2 -1
  713. package/build-types/focal-point-picker/styles/focal-point-picker-style.d.ts.map +1 -1
  714. package/build-types/font-size-picker/font-size-picker-select.d.ts.map +1 -1
  715. package/build-types/font-size-picker/index.d.ts.map +1 -1
  716. package/build-types/font-size-picker/styles.d.ts.map +1 -1
  717. package/build-types/form-file-upload/index.d.ts +2 -1
  718. package/build-types/form-file-upload/index.d.ts.map +1 -1
  719. package/build-types/form-file-upload/stories/index.story.d.ts.map +1 -1
  720. package/build-types/form-file-upload/types.d.ts +10 -8
  721. package/build-types/form-file-upload/types.d.ts.map +1 -1
  722. package/build-types/form-token-field/index.d.ts.map +1 -1
  723. package/build-types/form-token-field/stories/index.story.d.ts.map +1 -1
  724. package/build-types/gradient-picker/index.d.ts +1 -1
  725. package/build-types/gradient-picker/index.d.ts.map +1 -1
  726. package/build-types/gradient-picker/types.d.ts +6 -0
  727. package/build-types/gradient-picker/types.d.ts.map +1 -1
  728. package/build-types/grid/hook.d.ts +83 -83
  729. package/build-types/h-stack/hook.d.ts +83 -83
  730. package/build-types/heading/hook.d.ts +82 -82
  731. package/build-types/higher-order/with-fallback-styles/index.d.ts +2 -2
  732. package/build-types/higher-order/with-filters/index.d.ts +4 -4
  733. package/build-types/icon/index.d.ts +23 -7
  734. package/build-types/icon/index.d.ts.map +1 -1
  735. package/build-types/icon/stories/index.story.d.ts +7 -1
  736. package/build-types/icon/stories/index.story.d.ts.map +1 -1
  737. package/build-types/index.d.ts +1 -1
  738. package/build-types/index.d.ts.map +1 -1
  739. package/build-types/input-control/styles/input-control-styles.d.ts.map +1 -1
  740. package/build-types/item-group/item/hook.d.ts +83 -83
  741. package/build-types/item-group/item-group/hook.d.ts +83 -83
  742. package/build-types/lock-unlock.d.ts +2 -2
  743. package/build-types/menu/checkbox-item.d.ts.map +1 -1
  744. package/build-types/menu/group-label.d.ts.map +1 -1
  745. package/build-types/menu/group.d.ts.map +1 -1
  746. package/build-types/menu/index.d.ts.map +1 -1
  747. package/build-types/menu/item-help-text.d.ts.map +1 -1
  748. package/build-types/menu/item-label.d.ts.map +1 -1
  749. package/build-types/menu/item.d.ts.map +1 -1
  750. package/build-types/menu/radio-item.d.ts.map +1 -1
  751. package/build-types/menu/separator.d.ts.map +1 -1
  752. package/build-types/menu/styles.d.ts.map +1 -1
  753. package/build-types/menu-item/stories/index.story.d.ts.map +1 -1
  754. package/build-types/navigation/styles/navigation-styles.d.ts.map +1 -1
  755. package/build-types/navigator/navigator-back-button/hook.d.ts +92 -92
  756. package/build-types/navigator/navigator-button/hook.d.ts +92 -92
  757. package/build-types/number-control/index.d.ts +2 -1
  758. package/build-types/number-control/index.d.ts.map +1 -1
  759. package/build-types/number-control/stories/index.story.d.ts +2 -1
  760. package/build-types/number-control/stories/index.story.d.ts.map +1 -1
  761. package/build-types/number-control/types.d.ts +7 -0
  762. package/build-types/number-control/types.d.ts.map +1 -1
  763. package/build-types/popover/stories/index.story.d.ts.map +1 -1
  764. package/build-types/progress-bar/styles.d.ts.map +1 -1
  765. package/build-types/range-control/index.d.ts +1 -1
  766. package/build-types/range-control/index.d.ts.map +1 -1
  767. package/build-types/range-control/mark.d.ts.map +1 -1
  768. package/build-types/range-control/styles/range-control-styles.d.ts +4 -3
  769. package/build-types/range-control/styles/range-control-styles.d.ts.map +1 -1
  770. package/build-types/resizable-box/index.d.ts.map +1 -1
  771. package/build-types/resizable-box/resize-tooltip/styles/resize-tooltip.styles.d.ts.map +1 -1
  772. package/build-types/resizable-box/stories/index.story.d.ts.map +1 -1
  773. package/build-types/scrollable/hook.d.ts +83 -83
  774. package/build-types/scrollable/stories/index.story.d.ts.map +1 -1
  775. package/build-types/select-control/index.d.ts.map +1 -1
  776. package/build-types/select-control/stories/index.story.d.ts.map +1 -1
  777. package/build-types/select-control/styles/select-control-styles.d.ts.map +1 -1
  778. package/build-types/slot-fill/bubbles-virtually/fill.d.ts.map +1 -1
  779. package/build-types/slot-fill/bubbles-virtually/slot-fill-provider.d.ts.map +1 -1
  780. package/build-types/slot-fill/bubbles-virtually/slot.d.ts.map +1 -1
  781. package/build-types/slot-fill/bubbles-virtually/use-slot-fills.d.ts +1 -1
  782. package/build-types/slot-fill/types.d.ts +4 -3
  783. package/build-types/slot-fill/types.d.ts.map +1 -1
  784. package/build-types/spacer/hook.d.ts +83 -83
  785. package/build-types/spinner/styles.d.ts.map +1 -1
  786. package/build-types/surface/hook.d.ts +83 -83
  787. package/build-types/tabs/tab.d.ts +3 -0
  788. package/build-types/tabs/tab.d.ts.map +1 -1
  789. package/build-types/text/hook.d.ts +83 -83
  790. package/build-types/toggle-group-control/toggle-group-control-option-base/styles.d.ts.map +1 -1
  791. package/build-types/toolbar/toolbar-button/index.d.ts.map +1 -1
  792. package/build-types/tools-panel/stories/index.story.d.ts.map +1 -1
  793. package/build-types/tools-panel/tools-panel/component.d.ts +2 -0
  794. package/build-types/tools-panel/tools-panel/component.d.ts.map +1 -1
  795. package/build-types/tools-panel/tools-panel/hook.d.ts +83 -83
  796. package/build-types/tools-panel/tools-panel-header/hook.d.ts +83 -83
  797. package/build-types/tools-panel/tools-panel-item/hook.d.ts +83 -83
  798. package/build-types/tree-grid/cell.d.ts.map +1 -1
  799. package/build-types/tree-grid/types.d.ts +1 -1
  800. package/build-types/tree-grid/types.d.ts.map +1 -1
  801. package/build-types/truncate/hook.d.ts +83 -83
  802. package/build-types/unit-control/index.d.ts +3 -2
  803. package/build-types/unit-control/index.d.ts.map +1 -1
  804. package/build-types/unit-control/stories/index.story.d.ts.map +1 -1
  805. package/build-types/unit-control/styles/unit-control-styles.d.ts +2 -1
  806. package/build-types/unit-control/styles/unit-control-styles.d.ts.map +1 -1
  807. package/build-types/unit-control/types.d.ts +7 -0
  808. package/build-types/unit-control/types.d.ts.map +1 -1
  809. package/build-types/utils/colors-values.d.ts +3 -0
  810. package/build-types/utils/colors-values.d.ts.map +1 -1
  811. package/build-types/utils/config-values.d.ts +0 -1
  812. package/build-types/utils/hooks/use-controlled-state.d.ts +1 -1
  813. package/build-types/utils/hooks/use-controlled-state.d.ts.map +1 -1
  814. package/build-types/utils/rtl.d.ts +1 -1
  815. package/build-types/utils/rtl.d.ts.map +1 -1
  816. package/build-types/v-stack/hook.d.ts +83 -83
  817. package/build-types/z-stack/styles.d.ts.map +1 -1
  818. package/package.json +20 -20
  819. package/src/alignment-matrix-control/stories/index.story.tsx +2 -2
  820. package/src/angle-picker-control/index.tsx +1 -1
  821. package/src/angle-picker-control/stories/index.story.tsx +2 -2
  822. package/src/animation/index.tsx +0 -1
  823. package/src/base-control/stories/index.story.tsx +1 -1
  824. package/src/border-box-control/border-box-control-split-controls/component.tsx +1 -1
  825. package/src/border-box-control/stories/index.story.tsx +1 -1
  826. package/src/border-control/border-control/component.tsx +2 -0
  827. package/src/border-control/stories/index.story.tsx +1 -1
  828. package/src/box-control/README.md +80 -60
  829. package/src/box-control/docs-manifest.json +5 -0
  830. package/src/box-control/index.tsx +47 -29
  831. package/src/box-control/input-control.tsx +197 -0
  832. package/src/box-control/stories/index.story.tsx +2 -1
  833. package/src/box-control/test/index.tsx +33 -26
  834. package/src/box-control/types.ts +80 -55
  835. package/src/box-control/utils.ts +62 -60
  836. package/src/button/README.md +108 -219
  837. package/src/button/docs-manifest.json +5 -0
  838. package/src/button/stories/best-practices.mdx +31 -0
  839. package/src/button/stories/index.story.tsx +18 -0
  840. package/src/button/types.ts +6 -4
  841. package/src/button-group/stories/index.story.tsx +1 -1
  842. package/src/card/stories/index.story.tsx +2 -2
  843. package/src/checkbox-control/stories/index.story.tsx +1 -1
  844. package/src/circular-option-picker/circular-option-picker-actions.tsx +1 -0
  845. package/src/circular-option-picker/circular-option-picker-option.tsx +1 -0
  846. package/src/circular-option-picker/stories/index.story.tsx +2 -2
  847. package/src/circular-option-picker/style.scss +2 -2
  848. package/src/clipboard-button/index.tsx +5 -3
  849. package/src/color-palette/stories/index.story.tsx +3 -3
  850. package/src/color-picker/input-with-slider.tsx +1 -1
  851. package/src/color-picker/stories/index.story.tsx +2 -2
  852. package/src/combobox-control/stories/index.story.tsx +1 -1
  853. package/src/composite/item.tsx +1 -19
  854. package/src/composite/stories/index.story.tsx +3 -3
  855. package/src/confirm-dialog/stories/index.story.tsx +1 -1
  856. package/src/custom-gradient-picker/gradient-bar/control-points.tsx +2 -0
  857. package/src/custom-gradient-picker/index.tsx +2 -0
  858. package/src/custom-gradient-picker/style.scss +1 -1
  859. package/src/custom-gradient-picker/types.ts +6 -0
  860. package/src/custom-select-control/README.md +2 -0
  861. package/src/custom-select-control/index.tsx +11 -2
  862. package/src/custom-select-control/stories/index.story.tsx +3 -2
  863. package/src/custom-select-control/test/index.tsx +13 -9
  864. package/src/custom-select-control/types.ts +7 -0
  865. package/src/custom-select-control-v2/stories/index.story.tsx +2 -2
  866. package/src/date-time/stories/date-time.story.tsx +4 -1
  867. package/src/date-time/stories/date.story.tsx +4 -1
  868. package/src/date-time/stories/time.story.tsx +4 -1
  869. package/src/dimension-control/stories/index.story.tsx +1 -1
  870. package/src/disabled/stories/index.story.tsx +3 -3
  871. package/src/divider/stories/index.story.tsx +1 -1
  872. package/src/draggable/stories/index.story.tsx +2 -2
  873. package/src/drop-zone/index.tsx +21 -24
  874. package/src/drop-zone/types.ts +5 -0
  875. package/src/dropdown/stories/index.story.tsx +7 -7
  876. package/src/dropdown-menu/index.tsx +4 -1
  877. package/src/dropdown-menu/stories/index.story.tsx +3 -3
  878. package/src/dropdown-menu/style.scss +1 -1
  879. package/src/duotone-picker/color-list-picker/index.tsx +8 -8
  880. package/src/duotone-picker/color-list-picker/style.scss +0 -6
  881. package/src/duotone-picker/stories/duotone-picker.story.tsx +1 -1
  882. package/src/flex/stories/index.story.tsx +1 -1
  883. package/src/font-size-picker/font-size-picker-select.tsx +1 -0
  884. package/src/font-size-picker/index.tsx +1 -0
  885. package/src/font-size-picker/stories/index.story.tsx +1 -1
  886. package/src/form-file-upload/README.md +58 -48
  887. package/src/form-file-upload/docs-manifest.json +5 -0
  888. package/src/form-file-upload/index.tsx +12 -1
  889. package/src/form-file-upload/stories/index.story.tsx +4 -3
  890. package/src/form-file-upload/test/index.tsx +5 -1
  891. package/src/form-file-upload/types.ts +10 -8
  892. package/src/form-token-field/README.md +1 -0
  893. package/src/form-token-field/index.tsx +7 -0
  894. package/src/form-token-field/stories/index.story.tsx +4 -2
  895. package/src/form-token-field/test/index.tsx +5 -1
  896. package/src/gradient-picker/README.md +8 -0
  897. package/src/gradient-picker/index.tsx +2 -0
  898. package/src/gradient-picker/stories/index.story.tsx +1 -1
  899. package/src/gradient-picker/types.ts +6 -0
  900. package/src/grid/stories/index.story.tsx +1 -1
  901. package/src/h-stack/stories/index.story.tsx +2 -2
  902. package/src/icon/README.md +22 -65
  903. package/src/icon/docs-manifest.json +5 -0
  904. package/src/icon/index.tsx +28 -13
  905. package/src/icon/stories/index.story.tsx +50 -8
  906. package/src/index.ts +1 -5
  907. package/src/input-control/stories/index.story.tsx +4 -4
  908. package/src/item-group/stories/index.story.tsx +2 -2
  909. package/src/menu/checkbox-item.tsx +9 -7
  910. package/src/menu/group-label.tsx +8 -1
  911. package/src/menu/group.tsx +8 -1
  912. package/src/menu/item-help-text.tsx +10 -1
  913. package/src/menu/item-label.tsx +10 -1
  914. package/src/menu/item.tsx +8 -6
  915. package/src/menu/radio-item.tsx +9 -7
  916. package/src/menu/separator.tsx +9 -2
  917. package/src/menu/stories/index.story.tsx +2 -2
  918. package/src/menu/styles.ts +1 -1
  919. package/src/menu-group/stories/index.story.tsx +1 -1
  920. package/src/menu-item/stories/index.story.tsx +1 -1
  921. package/src/menu-items-choice/stories/index.story.tsx +1 -1
  922. package/src/menu-items-choice/style.scss +1 -0
  923. package/src/modal/stories/index.story.tsx +2 -2
  924. package/src/modal/test/index.tsx +2 -1
  925. package/src/navigable-container/stories/navigable-menu.story.tsx +1 -1
  926. package/src/navigable-container/stories/tabbable-container.story.tsx +1 -1
  927. package/src/navigation/stories/index.story.tsx +4 -4
  928. package/src/navigation/styles/navigation-styles.tsx +3 -2
  929. package/src/navigator/stories/index.story.tsx +3 -3
  930. package/src/number-control/README.md +2 -1
  931. package/src/number-control/index.tsx +9 -0
  932. package/src/number-control/stories/index.story.tsx +2 -1
  933. package/src/number-control/test/index.tsx +5 -1
  934. package/src/number-control/types.ts +7 -0
  935. package/src/panel/stories/index.story.tsx +1 -1
  936. package/src/placeholder/stories/index.story.tsx +3 -3
  937. package/src/popover/stories/index.story.tsx +11 -9
  938. package/src/query-controls/stories/index.story.tsx +6 -6
  939. package/src/radio-control/stories/index.story.tsx +1 -1
  940. package/src/radio-group/stories/index.story.tsx +3 -3
  941. package/src/range-control/index.tsx +1 -0
  942. package/src/range-control/mark.tsx +0 -1
  943. package/src/range-control/stories/index.story.tsx +7 -7
  944. package/src/range-control/styles/range-control-styles.ts +18 -19
  945. package/src/resizable-box/index.tsx +10 -0
  946. package/src/resizable-box/stories/index.story.tsx +1 -1
  947. package/src/resizable-box/style.scss +8 -0
  948. package/src/responsive-wrapper/stories/index.story.tsx +1 -1
  949. package/src/sandbox/stories/index.story.tsx +1 -1
  950. package/src/scrollable/stories/index.story.tsx +2 -1
  951. package/src/search-control/stories/index.story.tsx +1 -1
  952. package/src/select-control/stories/index.story.tsx +1 -1
  953. package/src/slot-fill/bubbles-virtually/fill.tsx +7 -11
  954. package/src/slot-fill/bubbles-virtually/slot-fill-provider.tsx +2 -13
  955. package/src/slot-fill/bubbles-virtually/slot.tsx +4 -7
  956. package/src/slot-fill/stories/index.story.tsx +2 -2
  957. package/src/slot-fill/types.ts +4 -3
  958. package/src/snackbar/stories/index.story.tsx +4 -4
  959. package/src/snackbar/stories/list.story.tsx +2 -2
  960. package/src/surface/stories/index.story.tsx +1 -1
  961. package/src/tabs/tab.tsx +0 -18
  962. package/src/tabs/test/index.tsx +1492 -947
  963. package/src/text-control/stories/index.story.tsx +1 -1
  964. package/src/textarea-control/stories/index.story.tsx +1 -1
  965. package/src/theme/stories/index.story.tsx +1 -1
  966. package/src/toggle-control/stories/index.story.tsx +1 -1
  967. package/src/toggle-group-control/stories/index.story.tsx +1 -1
  968. package/src/toggle-group-control/test/__snapshots__/index.tsx.snap +22 -22
  969. package/src/toggle-group-control/toggle-group-control/styles.ts +1 -1
  970. package/src/toggle-group-control/toggle-group-control-option-base/styles.ts +6 -6
  971. package/src/toolbar/stories/index.story.tsx +1 -1
  972. package/src/toolbar/toolbar-button/index.tsx +2 -0
  973. package/src/tools-panel/stories/index.story.tsx +15 -3
  974. package/src/tools-panel/test/index.tsx +0 -17
  975. package/src/tools-panel/tools-panel/README.md +4 -0
  976. package/src/tools-panel/tools-panel/component.tsx +2 -0
  977. package/src/tooltip/stories/index.story.tsx +1 -1
  978. package/src/tree-grid/cell.tsx +5 -1
  979. package/src/tree-grid/stories/index.story.tsx +1 -1
  980. package/src/tree-grid/types.ts +1 -1
  981. package/src/tree-select/stories/index.story.tsx +1 -1
  982. package/src/unit-control/README.md +3 -3
  983. package/src/unit-control/index.tsx +11 -1
  984. package/src/unit-control/stories/index.story.tsx +5 -4
  985. package/src/unit-control/test/index.tsx +5 -1
  986. package/src/unit-control/types.ts +7 -0
  987. package/src/utils/colors-values.js +3 -0
  988. package/src/utils/config-values.js +0 -1
  989. package/src/view/stories/index.story.tsx +1 -1
  990. package/src/visually-hidden/stories/index.story.tsx +1 -1
  991. package/src/z-stack/stories/index.story.tsx +1 -1
  992. package/tsconfig.tsbuildinfo +1 -1
  993. package/build/box-control/all-input-control.js +0 -90
  994. package/build/box-control/all-input-control.js.map +0 -1
  995. package/build/box-control/axial-input-controls.js +0 -124
  996. package/build/box-control/axial-input-controls.js.map +0 -1
  997. package/build/box-control/input-controls.js +0 -132
  998. package/build/box-control/input-controls.js.map +0 -1
  999. package/build/menu/use-temporary-focus-visible-fix.js +0 -27
  1000. package/build/menu/use-temporary-focus-visible-fix.js.map +0 -1
  1001. package/build-module/box-control/all-input-control.js +0 -83
  1002. package/build-module/box-control/all-input-control.js.map +0 -1
  1003. package/build-module/box-control/axial-input-controls.js +0 -115
  1004. package/build-module/box-control/axial-input-controls.js.map +0 -1
  1005. package/build-module/box-control/input-controls.js +0 -123
  1006. package/build-module/box-control/input-controls.js.map +0 -1
  1007. package/build-module/menu/use-temporary-focus-visible-fix.js +0 -20
  1008. package/build-module/menu/use-temporary-focus-visible-fix.js.map +0 -1
  1009. package/build-types/box-control/all-input-control.d.ts +0 -3
  1010. package/build-types/box-control/all-input-control.d.ts.map +0 -1
  1011. package/build-types/box-control/axial-input-controls.d.ts +0 -3
  1012. package/build-types/box-control/axial-input-controls.d.ts.map +0 -1
  1013. package/build-types/box-control/input-controls.d.ts +0 -3
  1014. package/build-types/box-control/input-controls.d.ts.map +0 -1
  1015. package/build-types/menu/use-temporary-focus-visible-fix.d.ts +0 -8
  1016. package/build-types/menu/use-temporary-focus-visible-fix.d.ts.map +0 -1
  1017. package/src/box-control/all-input-control.tsx +0 -109
  1018. package/src/box-control/axial-input-controls.tsx +0 -164
  1019. package/src/box-control/input-controls.tsx +0 -166
  1020. package/src/menu/use-temporary-focus-visible-fix.ts +0 -22
@@ -1,3 +1,4 @@
1
+ /* wp:polyfill */
1
2
  "use strict";
2
3
 
3
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -1 +1 @@
1
- {"version":3,"names":["_dom","require","_element","_compose","_escapeHtml","_warning","_interopRequireDefault","_context","_useCx","_view","_context2","styles","_interopRequireWildcard","_useScreenAnimatePresence","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","UnconnectedNavigatorScreen","props","forwardedRef","test","path","globalThis","SCRIPT_DEBUG","warning","screenId","useId","children","className","onAnimationEnd","onAnimationEndProp","otherProps","useContextSystem","location","match","addScreen","removeScreen","useContext","NavigatorContext","isInitial","isBack","focusTargetSelector","skipFocus","isMatch","wrapperRef","useRef","skipAnimationAndFocusRestoration","useEffect","screen","id","escapeAttribute","animationStyles","shouldRenderScreen","screenProps","useScreenAnimatePresence","skipAnimation","cx","useCx","classes","useMemo","navigatorScreen","locationRef","current","wrapperEl","hasRestoredFocus","activeElement","ownerDocument","contains","elementToFocus","querySelector","firstTabbable","focus","tabbable","find","mergedWrapperRef","useMergeRefs","jsx","View","ref","NavigatorScreen","exports","contextConnect"],"sources":["@wordpress/components/src/navigator/navigator-screen/component.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { focus } from '@wordpress/dom';\nimport {\n\tuseContext,\n\tuseEffect,\n\tuseMemo,\n\tuseRef,\n\tuseId,\n} from '@wordpress/element';\nimport { useMergeRefs } from '@wordpress/compose';\nimport { escapeAttribute } from '@wordpress/escape-html';\nimport warning from '@wordpress/warning';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../../context';\nimport { contextConnect, useContextSystem } from '../../context';\nimport { useCx } from '../../utils/hooks/use-cx';\nimport { View } from '../../view';\nimport { NavigatorContext } from '../context';\nimport * as styles from '../styles';\nimport type { NavigatorScreenProps } from '../types';\nimport { useScreenAnimatePresence } from './use-screen-animate-presence';\n\nfunction UnconnectedNavigatorScreen(\n\tprops: WordPressComponentProps< NavigatorScreenProps, 'div', false >,\n\tforwardedRef: ForwardedRef< any >\n) {\n\tif ( ! /^\\//.test( props.path ) ) {\n\t\twarning(\n\t\t\t'wp.components.Navigator.Screen: the `path` should follow a URL-like scheme; it should start with and be separated by the `/` character.'\n\t\t);\n\t}\n\n\tconst screenId = useId();\n\n\tconst {\n\t\tchildren,\n\t\tclassName,\n\t\tpath,\n\t\tonAnimationEnd: onAnimationEndProp,\n\t\t...otherProps\n\t} = useContextSystem( props, 'Navigator.Screen' );\n\n\tconst { location, match, addScreen, removeScreen } =\n\t\tuseContext( NavigatorContext );\n\tconst { isInitial, isBack, focusTargetSelector, skipFocus } = location;\n\n\tconst isMatch = match === screenId;\n\tconst wrapperRef = useRef< HTMLDivElement >( null );\n\tconst skipAnimationAndFocusRestoration = !! isInitial && ! isBack;\n\n\t// Register / unregister screen with the navigator context.\n\tuseEffect( () => {\n\t\tconst screen = {\n\t\t\tid: screenId,\n\t\t\tpath: escapeAttribute( path ),\n\t\t};\n\t\taddScreen( screen );\n\t\treturn () => removeScreen( screen );\n\t}, [ screenId, path, addScreen, removeScreen ] );\n\n\t// Animation.\n\tconst { animationStyles, shouldRenderScreen, screenProps } =\n\t\tuseScreenAnimatePresence( {\n\t\t\tisMatch,\n\t\t\tisBack,\n\t\t\tonAnimationEnd: onAnimationEndProp,\n\t\t\tskipAnimation: skipAnimationAndFocusRestoration,\n\t\t} );\n\n\tconst cx = useCx();\n\tconst classes = useMemo(\n\t\t() => cx( styles.navigatorScreen, animationStyles, className ),\n\t\t[ className, cx, animationStyles ]\n\t);\n\n\t// Focus restoration\n\tconst locationRef = useRef( location );\n\tuseEffect( () => {\n\t\tlocationRef.current = location;\n\t}, [ location ] );\n\tuseEffect( () => {\n\t\tconst wrapperEl = wrapperRef.current;\n\t\t// Only attempt to restore focus:\n\t\t// - if the current location is not the initial one (to avoid moving focus on page load)\n\t\t// - when the screen becomes visible\n\t\t// - if the wrapper ref has been assigned\n\t\t// - if focus hasn't already been restored for the current location\n\t\t// - if the `skipFocus` option is not set to `true`. This is useful when we trigger the navigation outside of NavigatorScreen.\n\t\tif (\n\t\t\tskipAnimationAndFocusRestoration ||\n\t\t\t! isMatch ||\n\t\t\t! wrapperEl ||\n\t\t\tlocationRef.current.hasRestoredFocus ||\n\t\t\tskipFocus\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst activeElement = wrapperEl.ownerDocument.activeElement;\n\n\t\t// If an element is already focused within the wrapper do not focus the\n\t\t// element. This prevents inputs or buttons from losing focus unnecessarily.\n\t\tif ( wrapperEl.contains( activeElement ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet elementToFocus: HTMLElement | null = null;\n\n\t\t// When navigating back, if a selector is provided, use it to look for the\n\t\t// target element (assumed to be a node inside the current NavigatorScreen)\n\t\tif ( isBack && focusTargetSelector ) {\n\t\t\telementToFocus = wrapperEl.querySelector( focusTargetSelector );\n\t\t}\n\n\t\t// If the previous query didn't run or find any element to focus, fallback\n\t\t// to the first tabbable element in the screen (or the screen itself).\n\t\tif ( ! elementToFocus ) {\n\t\t\tconst [ firstTabbable ] = focus.tabbable.find( wrapperEl );\n\t\t\telementToFocus = firstTabbable ?? wrapperEl;\n\t\t}\n\n\t\tlocationRef.current.hasRestoredFocus = true;\n\t\telementToFocus.focus();\n\t}, [\n\t\tskipAnimationAndFocusRestoration,\n\t\tisMatch,\n\t\tisBack,\n\t\tfocusTargetSelector,\n\t\tskipFocus,\n\t] );\n\n\tconst mergedWrapperRef = useMergeRefs( [ forwardedRef, wrapperRef ] );\n\n\treturn shouldRenderScreen ? (\n\t\t<View\n\t\t\tref={ mergedWrapperRef }\n\t\t\tclassName={ classes }\n\t\t\t{ ...screenProps }\n\t\t\t{ ...otherProps }\n\t\t>\n\t\t\t{ children }\n\t\t</View>\n\t) : null;\n}\n\nexport const NavigatorScreen = contextConnect(\n\tUnconnectedNavigatorScreen,\n\t'Navigator.Screen'\n);\n"],"mappings":";;;;;;;AAQA,IAAAA,IAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAOA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAC,sBAAA,CAAAL,OAAA;AAMA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,KAAA,GAAAR,OAAA;AACA,IAAAS,SAAA,GAAAT,OAAA;AACA,IAAAU,MAAA,GAAAC,uBAAA,CAAAX,OAAA;AAEA,IAAAY,yBAAA,GAAAZ,OAAA;AAAyE,IAAAa,WAAA,GAAAb,OAAA;AAAA,SAAAc,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAA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AAEyB,UAAU,CAAG,CAAC;EAErE,OAAOQ,kBAAkB,gBACxB,IAAAxD,WAAA,CAAAgF,GAAA,EAACrF,KAAA,CAAAsF,IAAI;IACJC,GAAG,EAAGJ,gBAAkB;IACxB9C,SAAS,EAAG8B,OAAS;IAAA,GAChBL,WAAW;IAAA,GACXtB,UAAU;IAAAJ,QAAA,EAEbA;EAAQ,CACL,CAAC,GACJ,IAAI;AACT;AAEO,MAAMoD,eAAe,GAAAC,OAAA,CAAAD,eAAA,GAAG,IAAAE,uBAAc,EAC5ChE,0BAA0B,EAC1B,kBACD,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_dom","require","_element","_compose","_escapeHtml","_warning","_interopRequireDefault","_context","_useCx","_view","_context2","styles","_interopRequireWildcard","_useScreenAnimatePresence","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","UnconnectedNavigatorScreen","props","forwardedRef","test","path","globalThis","SCRIPT_DEBUG","warning","screenId","useId","children","className","onAnimationEnd","onAnimationEndProp","otherProps","useContextSystem","location","match","addScreen","removeScreen","useContext","NavigatorContext","isInitial","isBack","focusTargetSelector","skipFocus","isMatch","wrapperRef","useRef","skipAnimationAndFocusRestoration","useEffect","screen","id","escapeAttribute","animationStyles","shouldRenderScreen","screenProps","useScreenAnimatePresence","skipAnimation","cx","useCx","classes","useMemo","navigatorScreen","locationRef","current","wrapperEl","hasRestoredFocus","activeElement","ownerDocument","contains","elementToFocus","querySelector","firstTabbable","focus","tabbable","find","mergedWrapperRef","useMergeRefs","jsx","View","ref","NavigatorScreen","exports","contextConnect"],"sources":["@wordpress/components/src/navigator/navigator-screen/component.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { focus } from '@wordpress/dom';\nimport {\n\tuseContext,\n\tuseEffect,\n\tuseMemo,\n\tuseRef,\n\tuseId,\n} from '@wordpress/element';\nimport { useMergeRefs } from '@wordpress/compose';\nimport { escapeAttribute } from '@wordpress/escape-html';\nimport warning from '@wordpress/warning';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../../context';\nimport { contextConnect, useContextSystem } from '../../context';\nimport { useCx } from '../../utils/hooks/use-cx';\nimport { View } from '../../view';\nimport { NavigatorContext } from '../context';\nimport * as styles from '../styles';\nimport type { NavigatorScreenProps } from '../types';\nimport { useScreenAnimatePresence } from './use-screen-animate-presence';\n\nfunction UnconnectedNavigatorScreen(\n\tprops: WordPressComponentProps< NavigatorScreenProps, 'div', false >,\n\tforwardedRef: ForwardedRef< any >\n) {\n\tif ( ! /^\\//.test( props.path ) ) {\n\t\twarning(\n\t\t\t'wp.components.Navigator.Screen: the `path` should follow a URL-like scheme; it should start with and be separated by the `/` character.'\n\t\t);\n\t}\n\n\tconst screenId = useId();\n\n\tconst {\n\t\tchildren,\n\t\tclassName,\n\t\tpath,\n\t\tonAnimationEnd: onAnimationEndProp,\n\t\t...otherProps\n\t} = useContextSystem( props, 'Navigator.Screen' );\n\n\tconst { location, match, addScreen, removeScreen } =\n\t\tuseContext( NavigatorContext );\n\tconst { isInitial, isBack, focusTargetSelector, skipFocus } = location;\n\n\tconst isMatch = match === screenId;\n\tconst wrapperRef = useRef< HTMLDivElement >( null );\n\tconst skipAnimationAndFocusRestoration = !! isInitial && ! isBack;\n\n\t// Register / unregister screen with the navigator context.\n\tuseEffect( () => {\n\t\tconst screen = {\n\t\t\tid: screenId,\n\t\t\tpath: escapeAttribute( path ),\n\t\t};\n\t\taddScreen( screen );\n\t\treturn () => removeScreen( screen );\n\t}, [ screenId, path, addScreen, removeScreen ] );\n\n\t// Animation.\n\tconst { animationStyles, shouldRenderScreen, screenProps } =\n\t\tuseScreenAnimatePresence( {\n\t\t\tisMatch,\n\t\t\tisBack,\n\t\t\tonAnimationEnd: onAnimationEndProp,\n\t\t\tskipAnimation: skipAnimationAndFocusRestoration,\n\t\t} );\n\n\tconst cx = useCx();\n\tconst classes = useMemo(\n\t\t() => cx( styles.navigatorScreen, animationStyles, className ),\n\t\t[ className, cx, animationStyles ]\n\t);\n\n\t// Focus restoration\n\tconst locationRef = useRef( location );\n\tuseEffect( () => {\n\t\tlocationRef.current = location;\n\t}, [ location ] );\n\tuseEffect( () => {\n\t\tconst wrapperEl = wrapperRef.current;\n\t\t// Only attempt to restore focus:\n\t\t// - if the current location is not the initial one (to avoid moving focus on page load)\n\t\t// - when the screen becomes visible\n\t\t// - if the wrapper ref has been assigned\n\t\t// - if focus hasn't already been restored for the current location\n\t\t// - if the `skipFocus` option is not set to `true`. This is useful when we trigger the navigation outside of NavigatorScreen.\n\t\tif (\n\t\t\tskipAnimationAndFocusRestoration ||\n\t\t\t! isMatch ||\n\t\t\t! wrapperEl ||\n\t\t\tlocationRef.current.hasRestoredFocus ||\n\t\t\tskipFocus\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst activeElement = wrapperEl.ownerDocument.activeElement;\n\n\t\t// If an element is already focused within the wrapper do not focus the\n\t\t// element. This prevents inputs or buttons from losing focus unnecessarily.\n\t\tif ( wrapperEl.contains( activeElement ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet elementToFocus: HTMLElement | null = null;\n\n\t\t// When navigating back, if a selector is provided, use it to look for the\n\t\t// target element (assumed to be a node inside the current NavigatorScreen)\n\t\tif ( isBack && focusTargetSelector ) {\n\t\t\telementToFocus = wrapperEl.querySelector( focusTargetSelector );\n\t\t}\n\n\t\t// If the previous query didn't run or find any element to focus, fallback\n\t\t// to the first tabbable element in the screen (or the screen itself).\n\t\tif ( ! elementToFocus ) {\n\t\t\tconst [ firstTabbable ] = focus.tabbable.find( wrapperEl );\n\t\t\telementToFocus = firstTabbable ?? wrapperEl;\n\t\t}\n\n\t\tlocationRef.current.hasRestoredFocus = true;\n\t\telementToFocus.focus();\n\t}, [\n\t\tskipAnimationAndFocusRestoration,\n\t\tisMatch,\n\t\tisBack,\n\t\tfocusTargetSelector,\n\t\tskipFocus,\n\t] );\n\n\tconst mergedWrapperRef = useMergeRefs( [ forwardedRef, wrapperRef ] );\n\n\treturn shouldRenderScreen ? (\n\t\t<View\n\t\t\tref={ mergedWrapperRef }\n\t\t\tclassName={ classes }\n\t\t\t{ ...screenProps }\n\t\t\t{ ...otherProps }\n\t\t>\n\t\t\t{ children }\n\t\t</View>\n\t) : null;\n}\n\nexport const NavigatorScreen = contextConnect(\n\tUnconnectedNavigatorScreen,\n\t'Navigator.Screen'\n);\n"],"mappings":";;;;;;;;AAQA,IAAAA,IAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAOA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAC,sBAAA,CAAAL,OAAA;AAMA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,KAAA,GAAAR,OAAA;AACA,IAAAS,SAAA,GAAAT,OAAA;AACA,IAAAU,MAAA,GAAAC,uBAAA,CAAAX,OAAA;AAEA,IAAAY,yBAAA,GAAAZ,OAAA;AAAyE,IAAAa,WAAA,GAAAb,OAAA;AAAA,SAAAc,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAJ,wBAAAI,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CA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EAC5ChE,0BAA0B,EAC1B,kBACD,CAAC","ignoreList":[]}
@@ -1,3 +1,4 @@
1
+ /* wp:polyfill */
1
2
  "use strict";
2
3
 
3
4
  Object.defineProperty(exports, "__esModule", {
@@ -1 +1 @@
1
- {"version":3,"names":["_pathToRegexp","require","matchPath","path","pattern","matchingFunction","match","decode","decodeURIComponent","patternMatch","screens","screen","matched","params","id","undefined","findParent","startsWith","pathParts","split","parentPath","length","pop","potentialParentPath","join","find"],"sources":["@wordpress/components/src/navigator/utils/router.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport { match } from 'path-to-regexp';\n\n/**\n * Internal dependencies\n */\nimport type { Screen, MatchParams } from '../types';\n\nfunction matchPath( path: string, pattern: string ) {\n\tconst matchingFunction = match< MatchParams >( pattern, {\n\t\tdecode: decodeURIComponent,\n\t} );\n\treturn matchingFunction( path );\n}\n\nexport function patternMatch( path: string, screens: Screen[] ) {\n\tfor ( const screen of screens ) {\n\t\tconst matched = matchPath( path, screen.path );\n\t\tif ( matched ) {\n\t\t\treturn { params: matched.params, id: screen.id };\n\t\t}\n\t}\n\n\treturn undefined;\n}\n\nexport function findParent( path: string, screens: Screen[] ) {\n\tif ( ! path.startsWith( '/' ) ) {\n\t\treturn undefined;\n\t}\n\tconst pathParts = path.split( '/' );\n\tlet parentPath;\n\twhile ( pathParts.length > 1 && parentPath === undefined ) {\n\t\tpathParts.pop();\n\t\tconst potentialParentPath =\n\t\t\tpathParts.join( '/' ) === '' ? '/' : pathParts.join( '/' );\n\t\tif (\n\t\t\tscreens.find( ( screen ) => {\n\t\t\t\treturn matchPath( potentialParentPath, screen.path ) !== false;\n\t\t\t} )\n\t\t) {\n\t\t\tparentPath = potentialParentPath;\n\t\t}\n\t}\n\n\treturn parentPath;\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,aAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA;AACA;AACA;;AAGA,SAASC,SAASA,CAAEC,IAAY,EAAEC,OAAe,EAAG;EACnD,MAAMC,gBAAgB,GAAG,IAAAC,mBAAK,EAAiBF,OAAO,EAAE;IACvDG,MAAM,EAAEC;EACT,CAAE,CAAC;EACH,OAAOH,gBAAgB,CAAEF,IAAK,CAAC;AAChC;AAEO,SAASM,YAAYA,CAAEN,IAAY,EAAEO,OAAiB,EAAG;EAC/D,KAAM,MAAMC,MAAM,IAAID,OAAO,EAAG;IAC/B,MAAME,OAAO,GAAGV,SAAS,CAAEC,IAAI,EAAEQ,MAAM,CAACR,IAAK,CAAC;IAC9C,IAAKS,OAAO,EAAG;MACd,OAAO;QAAEC,MAAM,EAAED,OAAO,CAACC,MAAM;QAAEC,EAAE,EAAEH,MAAM,CAACG;MAAG,CAAC;IACjD;EACD;EAEA,OAAOC,SAAS;AACjB;AAEO,SAASC,UAAUA,CAAEb,IAAY,EAAEO,OAAiB,EAAG;EAC7D,IAAK,CAAEP,IAAI,CAACc,UAAU,CAAE,GAAI,CAAC,EAAG;IAC/B,OAAOF,SAAS;EACjB;EACA,MAAMG,SAAS,GAAGf,IAAI,CAACgB,KAAK,CAAE,GAAI,CAAC;EACnC,IAAIC,UAAU;EACd,OAAQF,SAAS,CAACG,MAAM,GAAG,CAAC,IAAID,UAAU,KAAKL,SAAS,EAAG;IAC1DG,SAAS,CAACI,GAAG,CAAC,CAAC;IACf,MAAMC,mBAAmB,GACxBL,SAAS,CAACM,IAAI,CAAE,GAAI,CAAC,KAAK,EAAE,GAAG,GAAG,GAAGN,SAAS,CAACM,IAAI,CAAE,GAAI,CAAC;IAC3D,IACCd,OAAO,CAACe,IAAI,CAAId,MAAM,IAAM;MAC3B,OAAOT,SAAS,CAAEqB,mBAAmB,EAAEZ,MAAM,CAACR,IAAK,CAAC,KAAK,KAAK;IAC/D,CAAE,CAAC,EACF;MACDiB,UAAU,GAAGG,mBAAmB;IACjC;EACD;EAEA,OAAOH,UAAU;AAClB","ignoreList":[]}
1
+ {"version":3,"names":["_pathToRegexp","require","matchPath","path","pattern","matchingFunction","match","decode","decodeURIComponent","patternMatch","screens","screen","matched","params","id","undefined","findParent","startsWith","pathParts","split","parentPath","length","pop","potentialParentPath","join","find"],"sources":["@wordpress/components/src/navigator/utils/router.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport { match } from 'path-to-regexp';\n\n/**\n * Internal dependencies\n */\nimport type { Screen, MatchParams } from '../types';\n\nfunction matchPath( path: string, pattern: string ) {\n\tconst matchingFunction = match< MatchParams >( pattern, {\n\t\tdecode: decodeURIComponent,\n\t} );\n\treturn matchingFunction( path );\n}\n\nexport function patternMatch( path: string, screens: Screen[] ) {\n\tfor ( const screen of screens ) {\n\t\tconst matched = matchPath( path, screen.path );\n\t\tif ( matched ) {\n\t\t\treturn { params: matched.params, id: screen.id };\n\t\t}\n\t}\n\n\treturn undefined;\n}\n\nexport function findParent( path: string, screens: Screen[] ) {\n\tif ( ! path.startsWith( '/' ) ) {\n\t\treturn undefined;\n\t}\n\tconst pathParts = path.split( '/' );\n\tlet parentPath;\n\twhile ( pathParts.length > 1 && parentPath === undefined ) {\n\t\tpathParts.pop();\n\t\tconst potentialParentPath =\n\t\t\tpathParts.join( '/' ) === '' ? '/' : pathParts.join( '/' );\n\t\tif (\n\t\t\tscreens.find( ( screen ) => {\n\t\t\t\treturn matchPath( potentialParentPath, screen.path ) !== false;\n\t\t\t} )\n\t\t) {\n\t\t\tparentPath = potentialParentPath;\n\t\t}\n\t}\n\n\treturn parentPath;\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,aAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA;AACA;AACA;;AAGA,SAASC,SAASA,CAAEC,IAAY,EAAEC,OAAe,EAAG;EACnD,MAAMC,gBAAgB,GAAG,IAAAC,mBAAK,EAAiBF,OAAO,EAAE;IACvDG,MAAM,EAAEC;EACT,CAAE,CAAC;EACH,OAAOH,gBAAgB,CAAEF,IAAK,CAAC;AAChC;AAEO,SAASM,YAAYA,CAAEN,IAAY,EAAEO,OAAiB,EAAG;EAC/D,KAAM,MAAMC,MAAM,IAAID,OAAO,EAAG;IAC/B,MAAME,OAAO,GAAGV,SAAS,CAAEC,IAAI,EAAEQ,MAAM,CAACR,IAAK,CAAC;IAC9C,IAAKS,OAAO,EAAG;MACd,OAAO;QAAEC,MAAM,EAAED,OAAO,CAACC,MAAM;QAAEC,EAAE,EAAEH,MAAM,CAACG;MAAG,CAAC;IACjD;EACD;EAEA,OAAOC,SAAS;AACjB;AAEO,SAASC,UAAUA,CAAEb,IAAY,EAAEO,OAAiB,EAAG;EAC7D,IAAK,CAAEP,IAAI,CAACc,UAAU,CAAE,GAAI,CAAC,EAAG;IAC/B,OAAOF,SAAS;EACjB;EACA,MAAMG,SAAS,GAAGf,IAAI,CAACgB,KAAK,CAAE,GAAI,CAAC;EACnC,IAAIC,UAAU;EACd,OAAQF,SAAS,CAACG,MAAM,GAAG,CAAC,IAAID,UAAU,KAAKL,SAAS,EAAG;IAC1DG,SAAS,CAACI,GAAG,CAAC,CAAC;IACf,MAAMC,mBAAmB,GACxBL,SAAS,CAACM,IAAI,CAAE,GAAI,CAAC,KAAK,EAAE,GAAG,GAAG,GAAGN,SAAS,CAACM,IAAI,CAAE,GAAI,CAAC;IAC3D,IACCd,OAAO,CAACe,IAAI,CAAId,MAAM,IAAM;MAC3B,OAAOT,SAAS,CAAEqB,mBAAmB,EAAEZ,MAAM,CAACR,IAAK,CAAC,KAAK,KAAK;IAC/D,CAAE,CAAC,EACF;MACDiB,UAAU,GAAGG,mBAAmB;IACjC;EACD;EAEA,OAAOH,UAAU;AAClB","ignoreList":[]}
@@ -1,3 +1,4 @@
1
+ /* wp:polyfill */
1
2
  "use strict";
2
3
 
3
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_i18n","_element","_a11y","_icons","_button","_visuallyHidden","_jsxRuntime","noop","useSpokenMessage","message","politeness","spokenMessage","renderToString","useEffect","speak","getDefaultPoliteness","status","getStatusLabel","__","Notice","className","children","onRemove","isDismissible","actions","__unstableHTML","onDismiss","classes","clsx","jsx","RawHTML","onDismissNotice","jsxs","VisuallyHidden","map","buttonCustomClasses","label","isPrimary","variant","noDefaultClasses","onClick","url","index","computedVariant","default","__next40pxDefaultSize","href","undefined","size","icon","close","_default","exports"],"sources":["@wordpress/components/src/notice/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { RawHTML, useEffect, renderToString } from '@wordpress/element';\nimport { speak } from '@wordpress/a11y';\nimport { close } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport Button from '../button';\nimport type { NoticeAction, NoticeProps } from './types';\nimport type { DeprecatedButtonProps } from '../button/types';\nimport { VisuallyHidden } from '../visually-hidden';\n\nconst noop = () => {};\n\n/**\n * Custom hook which announces the message with the given politeness, if a\n * valid message is provided.\n */\nfunction useSpokenMessage(\n\tmessage: NoticeProps[ 'spokenMessage' ],\n\tpoliteness: NoticeProps[ 'politeness' ]\n) {\n\tconst spokenMessage =\n\t\ttypeof message === 'string' ? message : renderToString( message );\n\n\tuseEffect( () => {\n\t\tif ( spokenMessage ) {\n\t\t\tspeak( spokenMessage, politeness );\n\t\t}\n\t}, [ spokenMessage, politeness ] );\n}\n\nfunction getDefaultPoliteness( status: NoticeProps[ 'status' ] ) {\n\tswitch ( status ) {\n\t\tcase 'success':\n\t\tcase 'warning':\n\t\tcase 'info':\n\t\t\treturn 'polite';\n\t\t// The default will also catch the 'error' status.\n\t\tdefault:\n\t\t\treturn 'assertive';\n\t}\n}\n\nfunction getStatusLabel( status: NoticeProps[ 'status' ] ) {\n\tswitch ( status ) {\n\t\tcase 'warning':\n\t\t\treturn __( 'Warning notice' );\n\t\tcase 'info':\n\t\t\treturn __( 'Information notice' );\n\t\tcase 'error':\n\t\t\treturn __( 'Error notice' );\n\t\t// The default will also catch the 'success' status.\n\t\tdefault:\n\t\t\treturn __( 'Notice' );\n\t}\n}\n\n/**\n * `Notice` is a component used to communicate feedback to the user.\n *\n *```jsx\n * import { Notice } from `@wordpress/components`;\n *\n * const MyNotice = () => (\n * <Notice status=\"error\">An unknown error occurred.</Notice>\n * );\n * ```\n */\nfunction Notice( {\n\tclassName,\n\tstatus = 'info',\n\tchildren,\n\tspokenMessage = children,\n\tonRemove = noop,\n\tisDismissible = true,\n\tactions = [],\n\tpoliteness = getDefaultPoliteness( status ),\n\t__unstableHTML,\n\t// onDismiss is a callback executed when the notice is dismissed.\n\t// It is distinct from onRemove, which _looks_ like a callback but is\n\t// actually the function to call to remove the notice from the UI.\n\tonDismiss = noop,\n}: NoticeProps ) {\n\tuseSpokenMessage( spokenMessage, politeness );\n\n\tconst classes = clsx( className, 'components-notice', 'is-' + status, {\n\t\t'is-dismissible': isDismissible,\n\t} );\n\n\tif ( __unstableHTML && typeof children === 'string' ) {\n\t\tchildren = <RawHTML>{ children }</RawHTML>;\n\t}\n\n\tconst onDismissNotice = () => {\n\t\tonDismiss();\n\t\tonRemove();\n\t};\n\n\treturn (\n\t\t<div className={ classes }>\n\t\t\t<VisuallyHidden>{ getStatusLabel( status ) }</VisuallyHidden>\n\t\t\t<div className=\"components-notice__content\">\n\t\t\t\t{ children }\n\t\t\t\t<div className=\"components-notice__actions\">\n\t\t\t\t\t{ actions.map(\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tclassName: buttonCustomClasses,\n\t\t\t\t\t\t\t\tlabel,\n\t\t\t\t\t\t\t\tisPrimary,\n\t\t\t\t\t\t\t\tvariant,\n\t\t\t\t\t\t\t\tnoDefaultClasses = false,\n\t\t\t\t\t\t\t\tonClick,\n\t\t\t\t\t\t\t\turl,\n\t\t\t\t\t\t\t}: NoticeAction &\n\t\t\t\t\t\t\t\t// `isPrimary` is a legacy prop included for\n\t\t\t\t\t\t\t\t// backcompat, but `variant` should be used\n\t\t\t\t\t\t\t\t// instead.\n\t\t\t\t\t\t\t\tPick< DeprecatedButtonProps, 'isPrimary' >,\n\t\t\t\t\t\t\tindex\n\t\t\t\t\t\t) => {\n\t\t\t\t\t\t\tlet computedVariant = variant;\n\t\t\t\t\t\t\tif ( variant !== 'primary' && ! noDefaultClasses ) {\n\t\t\t\t\t\t\t\tcomputedVariant = ! url ? 'secondary' : 'link';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\ttypeof computedVariant === 'undefined' &&\n\t\t\t\t\t\t\t\tisPrimary\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tcomputedVariant = 'primary';\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\t\t\t\thref={ url }\n\t\t\t\t\t\t\t\t\tvariant={ computedVariant }\n\t\t\t\t\t\t\t\t\tonClick={ url ? undefined : onClick }\n\t\t\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\t\t\t'components-notice__action',\n\t\t\t\t\t\t\t\t\t\tbuttonCustomClasses\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ label }\n\t\t\t\t\t\t\t\t</Button>\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</div>\n\t\t\t{ isDismissible && (\n\t\t\t\t<Button\n\t\t\t\t\tsize=\"small\"\n\t\t\t\t\tclassName=\"components-notice__dismiss\"\n\t\t\t\t\ticon={ close }\n\t\t\t\t\tlabel={ __( 'Close' ) }\n\t\t\t\t\tonClick={ onDismissNotice }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</div>\n\t);\n}\n\nexport default Notice;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,C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SAAS;UACTC,OAAO;UACPC,gBAAgB,GAAG,KAAK;UACxBC,OAAO;UACPC;QAKyC,CAAC,EAC3CC,KAAK,KACD;UACJ,IAAIC,eAAe,GAAGL,OAAO;UAC7B,IAAKA,OAAO,KAAK,SAAS,IAAI,CAAEC,gBAAgB,EAAG;YAClDI,eAAe,GAAG,CAAEF,GAAG,GAAG,WAAW,GAAG,MAAM;UAC/C;UACA,IACC,OAAOE,eAAe,KAAK,WAAW,IACtCN,SAAS,EACR;YACDM,eAAe,GAAG,SAAS;UAC5B;UAEA,oBACC,IAAArC,WAAA,CAAAuB,GAAA,EAACzB,OAAA,CAAAwC,OAAM;YACNC,qBAAqB;YAErBC,IAAI,EAAGL,GAAK;YACZH,OAAO,EAAGK,eAAiB;YAC3BH,OAAO,EAAGC,GAAG,GAAGM,SAAS,GAAGP,OAAS;YACrCpB,SAAS,EAAG,IAAAQ,aAAI,EACf,2BAA2B,EAC3BO,mBACD,CAAG;YAAAd,QAAA,EAEDe;UAAK,GATDM,KAUC,CAAC;QAEX,CACD;MAAC,CACG,CAAC;IAAA,CACF,CAAC,EACJnB,aAAa,iBACd,IAAAjB,WAAA,CAAAuB,GAAA,EAACzB,OAAA,CAAAwC,OAAM;MACNI,IAAI,EAAC,OAAO;MACZ5B,SAAS,EAAC,4BAA4B;MACtC6B,IAAI,EAAGC,YAAO;MACdd,KAAK,EAAG,IAAAlB,QAAE,EAAE,OAAQ,CAAG;MACvBsB,OAAO,EAAGT;IAAiB,CAC3B,CACD;EAAA,CACG,CAAC;AAER;AAAC,IAAAoB,QAAA,GAAAC,OAAA,CAAAR,OAAA,GAEczB,MAAM","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_i18n","_element","_a11y","_icons","_button","_visuallyHidden","_jsxRuntime","noop","useSpokenMessage","message","politeness","spokenMessage","renderToString","useEffect","speak","getDefaultPoliteness","status","getStatusLabel","__","Notice","className","children","onRemove","isDismissible","actions","__unstableHTML","onDismiss","classes","clsx","jsx","RawHTML","onDismissNotice","jsxs","VisuallyHidden","map","buttonCustomClasses","label","isPrimary","variant","noDefaultClasses","onClick","url","index","computedVariant","default","__next40pxDefaultSize","href","undefined","size","icon","close","_default","exports"],"sources":["@wordpress/components/src/notice/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { RawHTML, useEffect, renderToString } from '@wordpress/element';\nimport { speak } from '@wordpress/a11y';\nimport { close } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport Button from '../button';\nimport type { NoticeAction, NoticeProps } from './types';\nimport type { DeprecatedButtonProps } from '../button/types';\nimport { VisuallyHidden } from '../visually-hidden';\n\nconst noop = () => {};\n\n/**\n * Custom hook which announces the message with the given politeness, if a\n * valid message is provided.\n */\nfunction useSpokenMessage(\n\tmessage: NoticeProps[ 'spokenMessage' ],\n\tpoliteness: NoticeProps[ 'politeness' ]\n) {\n\tconst spokenMessage =\n\t\ttypeof message === 'string' ? message : renderToString( message );\n\n\tuseEffect( () => {\n\t\tif ( spokenMessage ) {\n\t\t\tspeak( spokenMessage, politeness );\n\t\t}\n\t}, [ spokenMessage, politeness ] );\n}\n\nfunction getDefaultPoliteness( status: NoticeProps[ 'status' ] ) {\n\tswitch ( status ) {\n\t\tcase 'success':\n\t\tcase 'warning':\n\t\tcase 'info':\n\t\t\treturn 'polite';\n\t\t// The default will also catch the 'error' status.\n\t\tdefault:\n\t\t\treturn 'assertive';\n\t}\n}\n\nfunction getStatusLabel( status: NoticeProps[ 'status' ] ) {\n\tswitch ( status ) {\n\t\tcase 'warning':\n\t\t\treturn __( 'Warning notice' );\n\t\tcase 'info':\n\t\t\treturn __( 'Information notice' );\n\t\tcase 'error':\n\t\t\treturn __( 'Error notice' );\n\t\t// The default will also catch the 'success' status.\n\t\tdefault:\n\t\t\treturn __( 'Notice' );\n\t}\n}\n\n/**\n * `Notice` is a component used to communicate feedback to the user.\n *\n *```jsx\n * import { Notice } from `@wordpress/components`;\n *\n * const MyNotice = () => (\n * <Notice status=\"error\">An unknown error occurred.</Notice>\n * );\n * ```\n */\nfunction Notice( {\n\tclassName,\n\tstatus = 'info',\n\tchildren,\n\tspokenMessage = children,\n\tonRemove = noop,\n\tisDismissible = true,\n\tactions = [],\n\tpoliteness = getDefaultPoliteness( status ),\n\t__unstableHTML,\n\t// onDismiss is a callback executed when the notice is dismissed.\n\t// It is distinct from onRemove, which _looks_ like a callback but is\n\t// actually the function to call to remove the notice from the UI.\n\tonDismiss = noop,\n}: NoticeProps ) {\n\tuseSpokenMessage( spokenMessage, politeness );\n\n\tconst classes = clsx( className, 'components-notice', 'is-' + status, {\n\t\t'is-dismissible': isDismissible,\n\t} );\n\n\tif ( __unstableHTML && typeof children === 'string' ) {\n\t\tchildren = <RawHTML>{ children }</RawHTML>;\n\t}\n\n\tconst onDismissNotice = () => {\n\t\tonDismiss();\n\t\tonRemove();\n\t};\n\n\treturn (\n\t\t<div className={ classes }>\n\t\t\t<VisuallyHidden>{ getStatusLabel( status ) }</VisuallyHidden>\n\t\t\t<div className=\"components-notice__content\">\n\t\t\t\t{ children }\n\t\t\t\t<div className=\"components-notice__actions\">\n\t\t\t\t\t{ actions.map(\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tclassName: buttonCustomClasses,\n\t\t\t\t\t\t\t\tlabel,\n\t\t\t\t\t\t\t\tisPrimary,\n\t\t\t\t\t\t\t\tvariant,\n\t\t\t\t\t\t\t\tnoDefaultClasses = false,\n\t\t\t\t\t\t\t\tonClick,\n\t\t\t\t\t\t\t\turl,\n\t\t\t\t\t\t\t}: NoticeAction &\n\t\t\t\t\t\t\t\t// `isPrimary` is a legacy prop included for\n\t\t\t\t\t\t\t\t// backcompat, but `variant` should be used\n\t\t\t\t\t\t\t\t// instead.\n\t\t\t\t\t\t\t\tPick< DeprecatedButtonProps, 'isPrimary' >,\n\t\t\t\t\t\t\tindex\n\t\t\t\t\t\t) => {\n\t\t\t\t\t\t\tlet computedVariant = variant;\n\t\t\t\t\t\t\tif ( variant !== 'primary' && ! noDefaultClasses ) {\n\t\t\t\t\t\t\t\tcomputedVariant = ! url ? 'secondary' : 'link';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\ttypeof computedVariant === 'undefined' &&\n\t\t\t\t\t\t\t\tisPrimary\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tcomputedVariant = 'primary';\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\t\t\t\thref={ url }\n\t\t\t\t\t\t\t\t\tvariant={ computedVariant }\n\t\t\t\t\t\t\t\t\tonClick={ url ? undefined : onClick }\n\t\t\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\t\t\t'components-notice__action',\n\t\t\t\t\t\t\t\t\t\tbuttonCustomClasses\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ label }\n\t\t\t\t\t\t\t\t</Button>\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</div>\n\t\t\t{ isDismissible && (\n\t\t\t\t<Button\n\t\t\t\t\tsize=\"small\"\n\t\t\t\t\tclassName=\"components-notice__dismiss\"\n\t\t\t\t\ticon={ close }\n\t\t\t\t\tlabel={ __( 'Close' ) }\n\t\t\t\t\tonClick={ onDismissNotice }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</div>\n\t);\n}\n\nexport default Notice;\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,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;UACPC;QAKyC,CAAC,EAC3CC,KAAK,KACD;UACJ,IAAIC,eAAe,GAAGL,OAAO;UAC7B,IAAKA,OAAO,KAAK,SAAS,IAAI,CAAEC,gBAAgB,EAAG;YAClDI,eAAe,GAAG,CAAEF,GAAG,GAAG,WAAW,GAAG,MAAM;UAC/C;UACA,IACC,OAAOE,eAAe,KAAK,WAAW,IACtCN,SAAS,EACR;YACDM,eAAe,GAAG,SAAS;UAC5B;UAEA,oBACC,IAAArC,WAAA,CAAAuB,GAAA,EAACzB,OAAA,CAAAwC,OAAM;YACNC,qBAAqB;YAErBC,IAAI,EAAGL,GAAK;YACZH,OAAO,EAAGK,eAAiB;YAC3BH,OAAO,EAAGC,GAAG,GAAGM,SAAS,GAAGP,OAAS;YACrCpB,SAAS,EAAG,IAAAQ,aAAI,EACf,2BAA2B,EAC3BO,mBACD,CAAG;YAAAd,QAAA,EAEDe;UAAK,GATDM,KAUC,CAAC;QAEX,CACD;MAAC,CACG,CAAC;IAAA,CACF,CAAC,EACJnB,aAAa,iBACd,IAAAjB,WAAA,CAAAuB,GAAA,EAACzB,OAAA,CAAAwC,OAAM;MACNI,IAAI,EAAC,OAAO;MACZ5B,SAAS,EAAC,4BAA4B;MACtC6B,IAAI,EAAGC,YAAO;MACdd,KAAK,EAAG,IAAAlB,QAAE,EAAE,OAAQ,CAAG;MACvBsB,OAAO,EAAGT;IAAiB,CAC3B,CACD;EAAA,CACG,CAAC;AAER;AAAC,IAAAoB,QAAA,GAAAC,OAAA,CAAAR,OAAA,GAEczB,MAAM","ignoreList":[]}
@@ -1,3 +1,4 @@
1
+ /* wp:polyfill */
1
2
  "use strict";
2
3
 
3
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_","_react","_jsxRuntime","noop","NoticeList","notices","onRemove","className","children","removeNotice","id","clsx","jsxs","reverse","map","notice","content","restNotice","createElement","default","key","_default","exports"],"sources":["@wordpress/components/src/notice/list.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * Internal dependencies\n */\nimport Notice from '.';\nimport type { WordPressComponentProps } from '../context';\nimport type { NoticeListProps } from './types';\n\nconst noop = () => {};\n\n/**\n * `NoticeList` is a component used to render a collection of notices.\n *\n *```jsx\n * import { Notice, NoticeList } from `@wordpress/components`;\n *\n * const MyNoticeList = () => {\n *\tconst [ notices, setNotices ] = useState( [\n *\t\t{\n *\t\t\tid: 'second-notice',\n *\t\t\tcontent: 'second notice content',\n *\t\t},\n *\t\t{\n *\t\t\tid: 'fist-notice',\n *\t\t\tcontent: 'first notice content',\n *\t\t},\n *\t] );\n *\n *\tconst removeNotice = ( id ) => {\n *\t\tsetNotices( notices.filter( ( notice ) => notice.id !== id ) );\n *\t};\n *\n *\treturn <NoticeList notices={ notices } onRemove={ removeNotice } />;\n *};\n *```\n */\nfunction NoticeList( {\n\tnotices,\n\tonRemove = noop,\n\tclassName,\n\tchildren,\n}: WordPressComponentProps< NoticeListProps, 'div', false > ) {\n\tconst removeNotice =\n\t\t( id: NoticeListProps[ 'notices' ][ number ][ 'id' ] ) => () =>\n\t\t\tonRemove( id );\n\n\tclassName = clsx( 'components-notice-list', className );\n\n\treturn (\n\t\t<div className={ className }>\n\t\t\t{ children }\n\t\t\t{ [ ...notices ].reverse().map( ( notice ) => {\n\t\t\t\tconst { content, ...restNotice } = notice;\n\t\t\t\treturn (\n\t\t\t\t\t<Notice\n\t\t\t\t\t\t{ ...restNotice }\n\t\t\t\t\t\tkey={ notice.id }\n\t\t\t\t\t\tonRemove={ removeNotice( notice.id ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ notice.content }\n\t\t\t\t\t</Notice>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</div>\n\t);\n}\n\nexport default NoticeList;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,CAAA,GAAAF,sBAAA,CAAAC,OAAA;AAAuB,IAAAE,MAAA,GAAAF,OAAA;AAAA,IAAAG,WAAA,GAAAH,OAAA;AARvB;AACA;AACA;;AAGA;AACA;AACA;;AAKA,MAAMI,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;;AAErB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,UAAUA,CAAE;EACpBC,OAAO;EACPC,QAAQ,GAAGH,IAAI;EACfI,SAAS;EACTC;AACyD,CAAC,EAAG;EAC7D,MAAMC,YAAY,GACfC,EAAkD,IAAM,MACzDJ,QAAQ,CAAEI,EAAG,CAAC;EAEhBH,SAAS,GAAG,IAAAI,aAAI,EAAE,wBAAwB,EAAEJ,SAAU,CAAC;EAEvD,oBACC,IAAAL,WAAA,CAAAU,IAAA;IAAKL,SAAS,EAAGA,SAAW;IAAAC,QAAA,GACzBA,QAAQ,EACR,CAAE,GAAGH,OAAO,CAAE,CAACQ,OAAO,CAAC,CAAC,CAACC,GAAG,CAAIC,MAAM,IAAM;MAC7C,MAAM;QAAEC,OAAO;QAAE,GAAGC;MAAW,CAAC,GAAGF,MAAM;MACzC,oBACC,IAAAd,MAAA,CAAAiB,aAAA,EAAClB,CAAA,CAAAmB,OAAM;QAAA,GACDF,UAAU;QACfG,GAAG,EAAGL,MAAM,CAACL,EAAI;QACjBJ,QAAQ,EAAGG,YAAY,CAAEM,MAAM,CAACL,EAAG;MAAG,GAEpCK,MAAM,CAACC,OACF,CAAC;IAEX,CAAE,CAAC;EAAA,CACC,CAAC;AAER;AAAC,IAAAK,QAAA,GAAAC,OAAA,CAAAH,OAAA,GAEcf,UAAU","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_","_react","_jsxRuntime","noop","NoticeList","notices","onRemove","className","children","removeNotice","id","clsx","jsxs","reverse","map","notice","content","restNotice","createElement","default","key","_default","exports"],"sources":["@wordpress/components/src/notice/list.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * Internal dependencies\n */\nimport Notice from '.';\nimport type { WordPressComponentProps } from '../context';\nimport type { NoticeListProps } from './types';\n\nconst noop = () => {};\n\n/**\n * `NoticeList` is a component used to render a collection of notices.\n *\n *```jsx\n * import { Notice, NoticeList } from `@wordpress/components`;\n *\n * const MyNoticeList = () => {\n *\tconst [ notices, setNotices ] = useState( [\n *\t\t{\n *\t\t\tid: 'second-notice',\n *\t\t\tcontent: 'second notice content',\n *\t\t},\n *\t\t{\n *\t\t\tid: 'fist-notice',\n *\t\t\tcontent: 'first notice content',\n *\t\t},\n *\t] );\n *\n *\tconst removeNotice = ( id ) => {\n *\t\tsetNotices( notices.filter( ( notice ) => notice.id !== id ) );\n *\t};\n *\n *\treturn <NoticeList notices={ notices } onRemove={ removeNotice } />;\n *};\n *```\n */\nfunction NoticeList( {\n\tnotices,\n\tonRemove = noop,\n\tclassName,\n\tchildren,\n}: WordPressComponentProps< NoticeListProps, 'div', false > ) {\n\tconst removeNotice =\n\t\t( id: NoticeListProps[ 'notices' ][ number ][ 'id' ] ) => () =>\n\t\t\tonRemove( id );\n\n\tclassName = clsx( 'components-notice-list', className );\n\n\treturn (\n\t\t<div className={ className }>\n\t\t\t{ children }\n\t\t\t{ [ ...notices ].reverse().map( ( notice ) => {\n\t\t\t\tconst { content, ...restNotice } = notice;\n\t\t\t\treturn (\n\t\t\t\t\t<Notice\n\t\t\t\t\t\t{ ...restNotice }\n\t\t\t\t\t\tkey={ notice.id }\n\t\t\t\t\t\tonRemove={ removeNotice( notice.id ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ notice.content }\n\t\t\t\t\t</Notice>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</div>\n\t);\n}\n\nexport default NoticeList;\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,CAAA,GAAAF,sBAAA,CAAAC,OAAA;AAAuB,IAAAE,MAAA,GAAAF,OAAA;AAAA,IAAAG,WAAA,GAAAH,OAAA;AARvB;AACA;AACA;;AAGA;AACA;AACA;;AAKA,MAAMI,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;;AAErB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,UAAUA,CAAE;EACpBC,OAAO;EACPC,QAAQ,GAAGH,IAAI;EACfI,SAAS;EACTC;AACyD,CAAC,EAAG;EAC7D,MAAMC,YAAY,GACfC,EAAkD,IAAM,MACzDJ,QAAQ,CAAEI,EAAG,CAAC;EAEhBH,SAAS,GAAG,IAAAI,aAAI,EAAE,wBAAwB,EAAEJ,SAAU,CAAC;EAEvD,oBACC,IAAAL,WAAA,CAAAU,IAAA;IAAKL,SAAS,EAAGA,SAAW;IAAAC,QAAA,GACzBA,QAAQ,EACR,CAAE,GAAGH,OAAO,CAAE,CAACQ,OAAO,CAAC,CAAC,CAACC,GAAG,CAAIC,MAAM,IAAM;MAC7C,MAAM;QAAEC,OAAO;QAAE,GAAGC;MAAW,CAAC,GAAGF,MAAM;MACzC,oBACC,IAAAd,MAAA,CAAAiB,aAAA,EAAClB,CAAA,CAAAmB,OAAM;QAAA,GACDF,UAAU;QACfG,GAAG,EAAGL,MAAM,CAACL,EAAI;QACjBJ,QAAQ,EAAGG,YAAY,CAAEM,MAAM,CAACL,EAAG;MAAG,GAEpCK,MAAM,CAACC,OACF,CAAC;IAEX,CAAE,CAAC;EAAA,CACC,CAAC;AAER;AAAC,IAAAK,QAAA,GAAAC,OAAA,CAAAH,OAAA,GAEcf,UAAU","ignoreList":[]}
@@ -1,3 +1,4 @@
1
+ /* wp:polyfill */
1
2
  "use strict";
2
3
 
3
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNative","require","_data","_notices","_","_interopRequireDefault","_style","_element","_react","_jsxRuntime","NoticeList","notices","useSelect","select","getNotices","noticesStore","removeNotice","useDispatch","onRemoveNotice","useCallback","id","length","jsx","View","style","styles","list","children","map","notice","createElement","default","key","onNoticeHidden","_default","exports"],"sources":["@wordpress/components/src/notice/list.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { View } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport Notice from './';\nimport styles from './style.scss';\nimport { useCallback } from '@wordpress/element';\n\nfunction NoticeList() {\n\tconst { notices } = useSelect( ( select ) => {\n\t\tconst { getNotices } = select( noticesStore );\n\t\treturn {\n\t\t\tnotices: getNotices(),\n\t\t};\n\t}, [] );\n\n\tconst { removeNotice } = useDispatch( noticesStore );\n\n\tconst onRemoveNotice = useCallback(\n\t\t( id ) => {\n\t\t\tremoveNotice( id );\n\t\t},\n\t\t[ removeNotice ]\n\t);\n\n\tif ( ! notices.length ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<View style={ styles.list }>\n\t\t\t{ notices.map( ( notice ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<Notice\n\t\t\t\t\t\t{ ...notice }\n\t\t\t\t\t\tkey={ notice.id }\n\t\t\t\t\t\tonNoticeHidden={ onRemoveNotice }\n\t\t\t\t\t></Notice>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</View>\n\t);\n}\n\nexport default NoticeList;\n"],"mappings":";;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAKA,IAAAG,CAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAD,sBAAA,CAAAJ,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AAAiD,IAAAO,MAAA,GAAAP,OAAA;AAAA,IAAAQ,WAAA,GAAAR,OAAA;AAhBjD;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;;AAKA,SAASS,UAAUA,CAAA,EAAG;EACrB,MAAM;IAAEC;EAAQ,CAAC,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IAC5C,MAAM;MAAEC;IAAW,CAAC,GAAGD,MAAM,CAAEE,cAAa,CAAC;IAC7C,OAAO;MACNJ,OAAO,EAAEG,UAAU,CAAC;IACrB,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,MAAM;IAAEE;EAAa,CAAC,GAAG,IAAAC,iBAAW,EAAEF,cAAa,CAAC;EAEpD,MAAMG,cAAc,GAAG,IAAAC,oBAAW,EAC/BC,EAAE,IAAM;IACTJ,YAAY,CAAEI,EAAG,CAAC;EACnB,CAAC,EACD,CAAEJ,YAAY,CACf,CAAC;EAED,IAAK,CAAEL,OAAO,CAACU,MAAM,EAAG;IACvB,OAAO,IAAI;EACZ;EAEA,oBACC,IAAAZ,WAAA,CAAAa,GAAA,EAACtB,YAAA,CAAAuB,IAAI;IAACC,KAAK,EAAGC,cAAM,CAACC,IAAM;IAAAC,QAAA,EACxBhB,OAAO,CAACiB,GAAG,CAAIC,MAAM,IAAM;MAC5B,oBACC,IAAArB,MAAA,CAAAsB,aAAA,EAAC1B,CAAA,CAAA2B,OAAM;QAAA,GACDF,MAAM;QACXG,GAAG,EAAGH,MAAM,CAACT,EAAI;QACjBa,cAAc,EAAGf;MAAgB,CACzB,CAAC;IAEZ,CAAE;EAAC,CACE,CAAC;AAET;AAAC,IAAAgB,QAAA,GAAAC,OAAA,CAAAJ,OAAA,GAEcrB,UAAU","ignoreList":[]}
1
+ {"version":3,"names":["_reactNative","require","_data","_notices","_","_interopRequireDefault","_style","_element","_react","_jsxRuntime","NoticeList","notices","useSelect","select","getNotices","noticesStore","removeNotice","useDispatch","onRemoveNotice","useCallback","id","length","jsx","View","style","styles","list","children","map","notice","createElement","default","key","onNoticeHidden","_default","exports"],"sources":["@wordpress/components/src/notice/list.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { View } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport Notice from './';\nimport styles from './style.scss';\nimport { useCallback } from '@wordpress/element';\n\nfunction NoticeList() {\n\tconst { notices } = useSelect( ( select ) => {\n\t\tconst { getNotices } = select( noticesStore );\n\t\treturn {\n\t\t\tnotices: getNotices(),\n\t\t};\n\t}, [] );\n\n\tconst { removeNotice } = useDispatch( noticesStore );\n\n\tconst onRemoveNotice = useCallback(\n\t\t( id ) => {\n\t\t\tremoveNotice( id );\n\t\t},\n\t\t[ removeNotice ]\n\t);\n\n\tif ( ! notices.length ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<View style={ styles.list }>\n\t\t\t{ notices.map( ( notice ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<Notice\n\t\t\t\t\t\t{ ...notice }\n\t\t\t\t\t\tkey={ notice.id }\n\t\t\t\t\t\tonNoticeHidden={ onRemoveNotice }\n\t\t\t\t\t></Notice>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</View>\n\t);\n}\n\nexport default NoticeList;\n"],"mappings":";;;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAKA,IAAAG,CAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAD,sBAAA,CAAAJ,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AAAiD,IAAAO,MAAA,GAAAP,OAAA;AAAA,IAAAQ,WAAA,GAAAR,OAAA;AAhBjD;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;;AAKA,SAASS,UAAUA,CAAA,EAAG;EACrB,MAAM;IAAEC;EAAQ,CAAC,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IAC5C,MAAM;MAAEC;IAAW,CAAC,GAAGD,MAAM,CAAEE,cAAa,CAAC;IAC7C,OAAO;MACNJ,OAAO,EAAEG,UAAU,CAAC;IACrB,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,MAAM;IAAEE;EAAa,CAAC,GAAG,IAAAC,iBAAW,EAAEF,cAAa,CAAC;EAEpD,MAAMG,cAAc,GAAG,IAAAC,oBAAW,EAC/BC,EAAE,IAAM;IACTJ,YAAY,CAAEI,EAAG,CAAC;EACnB,CAAC,EACD,CAAEJ,YAAY,CACf,CAAC;EAED,IAAK,CAAEL,OAAO,CAACU,MAAM,EAAG;IACvB,OAAO,IAAI;EACZ;EAEA,oBACC,IAAAZ,WAAA,CAAAa,GAAA,EAACtB,YAAA,CAAAuB,IAAI;IAACC,KAAK,EAAGC,cAAM,CAACC,IAAM;IAAAC,QAAA,EACxBhB,OAAO,CAACiB,GAAG,CAAIC,MAAM,IAAM;MAC5B,oBACC,IAAArB,MAAA,CAAAsB,aAAA,EAAC1B,CAAA,CAAA2B,OAAM;QAAA,GACDF,MAAM;QACXG,GAAG,EAAGH,MAAM,CAACT,EAAI;QACjBa,cAAc,EAAGf;MAAgB,CACzB,CAAC;IAEZ,CAAE;EAAC,CACE,CAAC;AAET;AAAC,IAAAgB,QAAA,GAAAC,OAAA,CAAAJ,OAAA,GAEcrB,UAAU","ignoreList":[]}
@@ -19,6 +19,7 @@ var _hStack = require("../h-stack");
19
19
  var _spacer = require("../spacer");
20
20
  var _utils = require("../utils");
21
21
  var _useDeprecatedProps = require("../utils/use-deprecated-props");
22
+ var _deprecated36pxSize = require("../utils/deprecated-36px-size");
22
23
  var _jsxRuntime = require("react/jsx-runtime");
23
24
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
24
25
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
@@ -56,8 +57,15 @@ function UnforwardedNumberControl(props, forwardedRef) {
56
57
  size = 'default',
57
58
  suffix,
58
59
  onChange = noop,
60
+ __shouldNotWarnDeprecated36pxSize,
59
61
  ...restProps
60
62
  } = (0, _useDeprecatedProps.useDeprecated36pxDefaultSizeProp)(props);
63
+ (0, _deprecated36pxSize.maybeWarnDeprecated36pxSize)({
64
+ componentName: 'NumberControl',
65
+ size,
66
+ __next40pxDefaultSize: restProps.__next40pxDefaultSize,
67
+ __shouldNotWarnDeprecated36pxSize
68
+ });
61
69
  if (hideHTMLArrows) {
62
70
  (0, _deprecated.default)('wp.components.NumberControl hideHTMLArrows prop ', {
63
71
  alternative: 'spinControls="none"',
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_element","_i18n","_icons","_compose","_deprecated","_numberControlStyles","inputControlActionTypes","_interopRequireWildcard","_math","_values","_hStack","_spacer","_utils","_useDeprecatedProps","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","noop","UnforwardedNumberControl","props","forwardedRef","__unstableStateReducer","stateReducerProp","className","dragDirection","hideHTMLArrows","spinControls","isDragEnabled","isShiftStepEnabled","label","max","Infinity","min","required","shiftStep","step","spinFactor","type","typeProp","value","valueProp","size","suffix","onChange","restProps","useDeprecated36pxDefaultSizeProp","deprecated","alternative","since","version","inputRef","useRef","mergedRef","useMergeRefs","isStepAny","baseStep","ensureNumber","baseSpin","baseValue","roundClamp","constrainValue","stepOverride","Math","autoComplete","undefined","classes","clsx","cx","useCx","spinButtonClasses","styles","smallSpinButtons","spinValue","direction","event","preventDefault","shift","shiftKey","delta","nextValue","isValueEmpty","add","subtract","numberControlStateReducer","state","action","nextState","payload","currentValue","PRESS_UP","PRESS_DOWN","DRAG","x","y","enableShift","modifier","directionModifier","isRTL","ceil","abs","sign","distance","PRESS_ENTER","COMMIT","applyEmptyValue","buildSpinButtonClickHandler","String","target","current","jsx","Input","inputMode","ref","_stateReducerProp","baseState","jsxs","Fragment","children","Spacer","marginBottom","marginRight","HStack","spacing","SpinButton","icon","plusIcon","__","onClick","resetIcon","NumberControl","exports","forwardRef","_default"],"sources":["@wordpress/components/src/number-control/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\nimport type { ForwardedRef, KeyboardEvent, MouseEvent } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { useRef, forwardRef } from '@wordpress/element';\nimport { isRTL, __ } from '@wordpress/i18n';\nimport { plus as plusIcon, reset as resetIcon } from '@wordpress/icons';\nimport { useMergeRefs } from '@wordpress/compose';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport { Input, SpinButton, styles } from './styles/number-control-styles';\nimport * as inputControlActionTypes from '../input-control/reducer/actions';\nimport { add, subtract, roundClamp } from '../utils/math';\nimport { ensureNumber, isValueEmpty } from '../utils/values';\nimport type { WordPressComponentProps } from '../context/wordpress-component';\nimport type { NumberControlProps } from './types';\nimport { HStack } from '../h-stack';\nimport { Spacer } from '../spacer';\nimport { useCx } from '../utils';\nimport { useDeprecated36pxDefaultSizeProp } from '../utils/use-deprecated-props';\n\nconst noop = () => {};\n\nfunction UnforwardedNumberControl(\n\tprops: WordPressComponentProps< NumberControlProps, 'input', false >,\n\tforwardedRef: ForwardedRef< any >\n) {\n\tconst {\n\t\t__unstableStateReducer: stateReducerProp,\n\t\tclassName,\n\t\tdragDirection = 'n',\n\t\thideHTMLArrows = false,\n\t\tspinControls = hideHTMLArrows ? 'none' : 'native',\n\t\tisDragEnabled = true,\n\t\tisShiftStepEnabled = true,\n\t\tlabel,\n\t\tmax = Infinity,\n\t\tmin = -Infinity,\n\t\trequired = false,\n\t\tshiftStep = 10,\n\t\tstep = 1,\n\t\tspinFactor = 1,\n\t\ttype: typeProp = 'number',\n\t\tvalue: valueProp,\n\t\tsize = 'default',\n\t\tsuffix,\n\t\tonChange = noop,\n\t\t...restProps\n\t} = useDeprecated36pxDefaultSizeProp< NumberControlProps >( props );\n\n\tif ( hideHTMLArrows ) {\n\t\tdeprecated( 'wp.components.NumberControl hideHTMLArrows prop ', {\n\t\t\talternative: 'spinControls=\"none\"',\n\t\t\tsince: '6.2',\n\t\t\tversion: '6.3',\n\t\t} );\n\t}\n\tconst inputRef = useRef< HTMLInputElement >();\n\tconst mergedRef = useMergeRefs( [ inputRef, forwardedRef ] );\n\n\tconst isStepAny = step === 'any';\n\tconst baseStep = isStepAny ? 1 : ensureNumber( step );\n\tconst baseSpin = ensureNumber( spinFactor ) * baseStep;\n\tconst baseValue = roundClamp( 0, min, max, baseStep );\n\tconst constrainValue = (\n\t\tvalue: number | string,\n\t\tstepOverride?: number\n\t) => {\n\t\t// When step is \"any\" clamp the value, otherwise round and clamp it.\n\t\t// Use '' + to convert to string for use in input value attribute.\n\t\treturn isStepAny\n\t\t\t? '' + Math.min( max, Math.max( min, ensureNumber( value ) ) )\n\t\t\t: '' + roundClamp( value, min, max, stepOverride ?? baseStep );\n\t};\n\n\tconst autoComplete = typeProp === 'number' ? 'off' : undefined;\n\tconst classes = clsx( 'components-number-control', className );\n\tconst cx = useCx();\n\tconst spinButtonClasses = cx( size === 'small' && styles.smallSpinButtons );\n\n\tconst spinValue = (\n\t\tvalue: string | number | undefined,\n\t\tdirection: 'up' | 'down',\n\t\tevent: KeyboardEvent | MouseEvent | undefined\n\t) => {\n\t\tevent?.preventDefault();\n\t\tconst shift = event?.shiftKey && isShiftStepEnabled;\n\t\tconst delta = shift ? ensureNumber( shiftStep ) * baseSpin : baseSpin;\n\t\tlet nextValue = isValueEmpty( value ) ? baseValue : value;\n\t\tif ( direction === 'up' ) {\n\t\t\tnextValue = add( nextValue, delta );\n\t\t} else if ( direction === 'down' ) {\n\t\t\tnextValue = subtract( nextValue, delta );\n\t\t}\n\t\treturn constrainValue( nextValue, shift ? delta : undefined );\n\t};\n\n\t/**\n\t * \"Middleware\" function that intercepts updates from InputControl.\n\t * This allows us to tap into actions to transform the (next) state for\n\t * InputControl.\n\t *\n\t * @return The updated state to apply to InputControl\n\t */\n\tconst numberControlStateReducer: NumberControlProps[ '__unstableStateReducer' ] =\n\t\t( state, action ) => {\n\t\t\tconst nextState = { ...state };\n\n\t\t\tconst { type, payload } = action;\n\t\t\tconst event = payload.event;\n\t\t\tconst currentValue = nextState.value;\n\n\t\t\t/**\n\t\t\t * Handles custom UP and DOWN Keyboard events\n\t\t\t */\n\t\t\tif (\n\t\t\t\ttype === inputControlActionTypes.PRESS_UP ||\n\t\t\t\ttype === inputControlActionTypes.PRESS_DOWN\n\t\t\t) {\n\t\t\t\tnextState.value = spinValue(\n\t\t\t\t\tcurrentValue,\n\t\t\t\t\ttype === inputControlActionTypes.PRESS_UP ? 'up' : 'down',\n\t\t\t\t\tevent as KeyboardEvent | undefined\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Handles drag to update events\n\t\t\t */\n\t\t\tif ( type === inputControlActionTypes.DRAG && isDragEnabled ) {\n\t\t\t\tconst [ x, y ] = payload.delta;\n\t\t\t\tconst enableShift = payload.shiftKey && isShiftStepEnabled;\n\t\t\t\tconst modifier = enableShift\n\t\t\t\t\t? ensureNumber( shiftStep ) * baseSpin\n\t\t\t\t\t: baseSpin;\n\n\t\t\t\tlet directionModifier;\n\t\t\t\tlet delta;\n\n\t\t\t\tswitch ( dragDirection ) {\n\t\t\t\t\tcase 'n':\n\t\t\t\t\t\tdelta = y;\n\t\t\t\t\t\tdirectionModifier = -1;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'e':\n\t\t\t\t\t\tdelta = x;\n\t\t\t\t\t\tdirectionModifier = isRTL() ? -1 : 1;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 's':\n\t\t\t\t\t\tdelta = y;\n\t\t\t\t\t\tdirectionModifier = 1;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'w':\n\t\t\t\t\t\tdelta = x;\n\t\t\t\t\t\tdirectionModifier = isRTL() ? 1 : -1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif ( delta !== 0 ) {\n\t\t\t\t\tdelta = Math.ceil( Math.abs( delta ) ) * Math.sign( delta );\n\t\t\t\t\tconst distance = delta * modifier * directionModifier;\n\n\t\t\t\t\tnextState.value = constrainValue(\n\t\t\t\t\t\t// @ts-expect-error TODO: Investigate if it's ok for currentValue to be undefined\n\t\t\t\t\t\tadd( currentValue, distance ),\n\t\t\t\t\t\tenableShift ? modifier : undefined\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Handles commit (ENTER key press or blur)\n\t\t\t */\n\t\t\tif (\n\t\t\t\ttype === inputControlActionTypes.PRESS_ENTER ||\n\t\t\t\ttype === inputControlActionTypes.COMMIT\n\t\t\t) {\n\t\t\t\tconst applyEmptyValue =\n\t\t\t\t\trequired === false && currentValue === '';\n\n\t\t\t\tnextState.value = applyEmptyValue\n\t\t\t\t\t? currentValue\n\t\t\t\t\t: // @ts-expect-error TODO: Investigate if it's ok for currentValue to be undefined\n\t\t\t\t\t constrainValue( currentValue );\n\t\t\t}\n\n\t\t\treturn nextState;\n\t\t};\n\n\tconst buildSpinButtonClickHandler =\n\t\t( direction: 'up' | 'down' ) =>\n\t\t( event: MouseEvent< HTMLButtonElement > ) =>\n\t\t\tonChange( String( spinValue( valueProp, direction, event ) ), {\n\t\t\t\t// Set event.target to the <input> so that consumers can use\n\t\t\t\t// e.g. event.target.validity.\n\t\t\t\tevent: {\n\t\t\t\t\t...event,\n\t\t\t\t\ttarget: inputRef.current!,\n\t\t\t\t},\n\t\t\t} );\n\n\treturn (\n\t\t<Input\n\t\t\tautoComplete={ autoComplete }\n\t\t\tinputMode=\"numeric\"\n\t\t\t{ ...restProps }\n\t\t\tclassName={ classes }\n\t\t\tdragDirection={ dragDirection }\n\t\t\thideHTMLArrows={ spinControls !== 'native' }\n\t\t\tisDragEnabled={ isDragEnabled }\n\t\t\tlabel={ label }\n\t\t\tmax={ max }\n\t\t\tmin={ min }\n\t\t\tref={ mergedRef }\n\t\t\trequired={ required }\n\t\t\tstep={ step }\n\t\t\ttype={ typeProp }\n\t\t\t// @ts-expect-error TODO: Resolve discrepancy between `value` types in InputControl based components\n\t\t\tvalue={ valueProp }\n\t\t\t__unstableStateReducer={ ( state, action ) => {\n\t\t\t\tconst baseState = numberControlStateReducer( state, action );\n\t\t\t\treturn stateReducerProp?.( baseState, action ) ?? baseState;\n\t\t\t} }\n\t\t\tsize={ size }\n\t\t\tsuffix={\n\t\t\t\tspinControls === 'custom' ? (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ suffix }\n\t\t\t\t\t\t<Spacer marginBottom={ 0 } marginRight={ 2 }>\n\t\t\t\t\t\t\t<HStack spacing={ 1 }>\n\t\t\t\t\t\t\t\t<SpinButton\n\t\t\t\t\t\t\t\t\tclassName={ spinButtonClasses }\n\t\t\t\t\t\t\t\t\ticon={ plusIcon }\n\t\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Increment' ) }\n\t\t\t\t\t\t\t\t\tonClick={ buildSpinButtonClickHandler(\n\t\t\t\t\t\t\t\t\t\t'up'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<SpinButton\n\t\t\t\t\t\t\t\t\tclassName={ spinButtonClasses }\n\t\t\t\t\t\t\t\t\ticon={ resetIcon }\n\t\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Decrement' ) }\n\t\t\t\t\t\t\t\t\tonClick={ buildSpinButtonClickHandler(\n\t\t\t\t\t\t\t\t\t\t'down'\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</HStack>\n\t\t\t\t\t\t</Spacer>\n\t\t\t\t\t</>\n\t\t\t\t) : (\n\t\t\t\t\tsuffix\n\t\t\t\t)\n\t\t\t}\n\t\t\tonChange={ onChange }\n\t\t/>\n\t);\n}\n\nexport const NumberControl = forwardRef( UnforwardedNumberControl );\n\nexport default NumberControl;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAMA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAN,sBAAA,CAAAC,OAAA;AAKA,IAAAM,oBAAA,GAAAN,OAAA;AACA,IAAAO,uBAAA,GAAAC,uBAAA,CAAAR,OAAA;AACA,IAAAS,KAAA,GAAAT,OAAA;AACA,IAAAU,OAAA,GAAAV,OAAA;AAGA,IAAAW,OAAA,GAAAX,OAAA;AACA,IAAAY,OAAA,GAAAZ,OAAA;AACA,IAAAa,MAAA,GAAAb,OAAA;AACA,IAAAc,mBAAA,GAAAd,OAAA;AAAiF,IAAAe,WAAA,GAAAf,OAAA;AAAA,SAAAgB,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,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2B,CACpC,IACD;UAAG,CACH,CAAC,eACF,IAAA7G,WAAA,CAAAiH,GAAA,EAAC1H,oBAAA,CAAAwI,UAAU;YACVpG,SAAS,EAAG8C,iBAAmB;YAC/BuD,IAAI,EAAGI,YAAW;YAClBvF,IAAI,EAAC,OAAO;YACZZ,KAAK,EAAG,IAAAiG,QAAE,EAAE,WAAY,CAAG;YAC3BC,OAAO,EAAGtB,2BAA2B,CACpC,MACD;UAAG,CACH,CAAC;QAAA,CACK;MAAC,CACF,CAAC;IAAA,CACR,CAAC,GAEH/D,MAED;IACDC,QAAQ,EAAGA;EAAU,CACrB,CAAC;AAEJ;AAEO,MAAMsF,aAAa,GAAAC,OAAA,CAAAD,aAAA,GAAG,IAAAE,mBAAU,EAAEjH,wBAAyB,CAAC;AAAC,IAAAkH,QAAA,GAAAF,OAAA,CAAA/H,OAAA,GAErD8H,aAAa","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_element","_i18n","_icons","_compose","_deprecated","_numberControlStyles","inputControlActionTypes","_interopRequireWildcard","_math","_values","_hStack","_spacer","_utils","_useDeprecatedProps","_deprecated36pxSize","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","noop","UnforwardedNumberControl","props","forwardedRef","__unstableStateReducer","stateReducerProp","className","dragDirection","hideHTMLArrows","spinControls","isDragEnabled","isShiftStepEnabled","label","max","Infinity","min","required","shiftStep","step","spinFactor","type","typeProp","value","valueProp","size","suffix","onChange","__shouldNotWarnDeprecated36pxSize","restProps","useDeprecated36pxDefaultSizeProp","maybeWarnDeprecated36pxSize","componentName","__next40pxDefaultSize","deprecated","alternative","since","version","inputRef","useRef","mergedRef","useMergeRefs","isStepAny","baseStep","ensureNumber","baseSpin","baseValue","roundClamp","constrainValue","stepOverride","Math","autoComplete","undefined","classes","clsx","cx","useCx","spinButtonClasses","styles","smallSpinButtons","spinValue","direction","event","preventDefault","shift","shiftKey","delta","nextValue","isValueEmpty","add","subtract","numberControlStateReducer","state","action","nextState","payload","currentValue","PRESS_UP","PRESS_DOWN","DRAG","x","y","enableShift","modifier","directionModifier","isRTL","ceil","abs","sign","distance","PRESS_ENTER","COMMIT","applyEmptyValue","buildSpinButtonClickHandler","String","target","current","jsx","Input","inputMode","ref","_stateReducerProp","baseState","jsxs","Fragment","children","Spacer","marginBottom","marginRight","HStack","spacing","SpinButton","icon","plusIcon","__","onClick","resetIcon","NumberControl","exports","forwardRef","_default"],"sources":["@wordpress/components/src/number-control/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\nimport type { ForwardedRef, KeyboardEvent, MouseEvent } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { useRef, forwardRef } from '@wordpress/element';\nimport { isRTL, __ } from '@wordpress/i18n';\nimport { plus as plusIcon, reset as resetIcon } from '@wordpress/icons';\nimport { useMergeRefs } from '@wordpress/compose';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport { Input, SpinButton, styles } from './styles/number-control-styles';\nimport * as inputControlActionTypes from '../input-control/reducer/actions';\nimport { add, subtract, roundClamp } from '../utils/math';\nimport { ensureNumber, isValueEmpty } from '../utils/values';\nimport type { WordPressComponentProps } from '../context/wordpress-component';\nimport type { NumberControlProps } from './types';\nimport { HStack } from '../h-stack';\nimport { Spacer } from '../spacer';\nimport { useCx } from '../utils';\nimport { useDeprecated36pxDefaultSizeProp } from '../utils/use-deprecated-props';\nimport { maybeWarnDeprecated36pxSize } from '../utils/deprecated-36px-size';\n\nconst noop = () => {};\n\nfunction UnforwardedNumberControl(\n\tprops: WordPressComponentProps< NumberControlProps, 'input', false >,\n\tforwardedRef: ForwardedRef< any >\n) {\n\tconst {\n\t\t__unstableStateReducer: stateReducerProp,\n\t\tclassName,\n\t\tdragDirection = 'n',\n\t\thideHTMLArrows = false,\n\t\tspinControls = hideHTMLArrows ? 'none' : 'native',\n\t\tisDragEnabled = true,\n\t\tisShiftStepEnabled = true,\n\t\tlabel,\n\t\tmax = Infinity,\n\t\tmin = -Infinity,\n\t\trequired = false,\n\t\tshiftStep = 10,\n\t\tstep = 1,\n\t\tspinFactor = 1,\n\t\ttype: typeProp = 'number',\n\t\tvalue: valueProp,\n\t\tsize = 'default',\n\t\tsuffix,\n\t\tonChange = noop,\n\t\t__shouldNotWarnDeprecated36pxSize,\n\t\t...restProps\n\t} = useDeprecated36pxDefaultSizeProp< NumberControlProps >( props );\n\n\tmaybeWarnDeprecated36pxSize( {\n\t\tcomponentName: 'NumberControl',\n\t\tsize,\n\t\t__next40pxDefaultSize: restProps.__next40pxDefaultSize,\n\t\t__shouldNotWarnDeprecated36pxSize,\n\t} );\n\n\tif ( hideHTMLArrows ) {\n\t\tdeprecated( 'wp.components.NumberControl hideHTMLArrows prop ', {\n\t\t\talternative: 'spinControls=\"none\"',\n\t\t\tsince: '6.2',\n\t\t\tversion: '6.3',\n\t\t} );\n\t}\n\tconst inputRef = useRef< HTMLInputElement >();\n\tconst mergedRef = useMergeRefs( [ inputRef, forwardedRef ] );\n\n\tconst isStepAny = step === 'any';\n\tconst baseStep = isStepAny ? 1 : ensureNumber( step );\n\tconst baseSpin = ensureNumber( spinFactor ) * baseStep;\n\tconst baseValue = roundClamp( 0, min, max, baseStep );\n\tconst constrainValue = (\n\t\tvalue: number | string,\n\t\tstepOverride?: number\n\t) => {\n\t\t// When step is \"any\" clamp the value, otherwise round and clamp it.\n\t\t// Use '' + to convert to string for use in input value attribute.\n\t\treturn isStepAny\n\t\t\t? '' + Math.min( max, Math.max( min, ensureNumber( value ) ) )\n\t\t\t: '' + roundClamp( value, min, max, stepOverride ?? baseStep );\n\t};\n\n\tconst autoComplete = typeProp === 'number' ? 'off' : undefined;\n\tconst classes = clsx( 'components-number-control', className );\n\tconst cx = useCx();\n\tconst spinButtonClasses = cx( size === 'small' && styles.smallSpinButtons );\n\n\tconst spinValue = (\n\t\tvalue: string | number | undefined,\n\t\tdirection: 'up' | 'down',\n\t\tevent: KeyboardEvent | MouseEvent | undefined\n\t) => {\n\t\tevent?.preventDefault();\n\t\tconst shift = event?.shiftKey && isShiftStepEnabled;\n\t\tconst delta = shift ? ensureNumber( shiftStep ) * baseSpin : baseSpin;\n\t\tlet nextValue = isValueEmpty( value ) ? baseValue : value;\n\t\tif ( direction === 'up' ) {\n\t\t\tnextValue = add( nextValue, delta );\n\t\t} else if ( direction === 'down' ) {\n\t\t\tnextValue = subtract( nextValue, delta );\n\t\t}\n\t\treturn constrainValue( nextValue, shift ? delta : undefined );\n\t};\n\n\t/**\n\t * \"Middleware\" function that intercepts updates from InputControl.\n\t * This allows us to tap into actions to transform the (next) state for\n\t * InputControl.\n\t *\n\t * @return The updated state to apply to InputControl\n\t */\n\tconst numberControlStateReducer: NumberControlProps[ '__unstableStateReducer' ] =\n\t\t( state, action ) => {\n\t\t\tconst nextState = { ...state };\n\n\t\t\tconst { type, payload } = action;\n\t\t\tconst event = payload.event;\n\t\t\tconst currentValue = nextState.value;\n\n\t\t\t/**\n\t\t\t * Handles custom UP and DOWN Keyboard events\n\t\t\t */\n\t\t\tif (\n\t\t\t\ttype === inputControlActionTypes.PRESS_UP ||\n\t\t\t\ttype === inputControlActionTypes.PRESS_DOWN\n\t\t\t) {\n\t\t\t\tnextState.value = spinValue(\n\t\t\t\t\tcurrentValue,\n\t\t\t\t\ttype === inputControlActionTypes.PRESS_UP ? 'up' : 'down',\n\t\t\t\t\tevent as KeyboardEvent | undefined\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Handles drag to update events\n\t\t\t */\n\t\t\tif ( type === inputControlActionTypes.DRAG && isDragEnabled ) {\n\t\t\t\tconst [ x, y ] = payload.delta;\n\t\t\t\tconst enableShift = payload.shiftKey && isShiftStepEnabled;\n\t\t\t\tconst modifier = enableShift\n\t\t\t\t\t? ensureNumber( shiftStep ) * baseSpin\n\t\t\t\t\t: baseSpin;\n\n\t\t\t\tlet directionModifier;\n\t\t\t\tlet delta;\n\n\t\t\t\tswitch ( dragDirection ) {\n\t\t\t\t\tcase 'n':\n\t\t\t\t\t\tdelta = y;\n\t\t\t\t\t\tdirectionModifier = -1;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'e':\n\t\t\t\t\t\tdelta = x;\n\t\t\t\t\t\tdirectionModifier = isRTL() ? -1 : 1;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 's':\n\t\t\t\t\t\tdelta = y;\n\t\t\t\t\t\tdirectionModifier = 1;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'w':\n\t\t\t\t\t\tdelta = x;\n\t\t\t\t\t\tdirectionModifier = isRTL() ? 1 : -1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif ( delta !== 0 ) {\n\t\t\t\t\tdelta = Math.ceil( Math.abs( delta ) ) * Math.sign( delta );\n\t\t\t\t\tconst distance = delta * modifier * directionModifier;\n\n\t\t\t\t\tnextState.value = constrainValue(\n\t\t\t\t\t\t// @ts-expect-error TODO: Investigate if it's ok for currentValue to be undefined\n\t\t\t\t\t\tadd( currentValue, distance ),\n\t\t\t\t\t\tenableShift ? modifier : undefined\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Handles commit (ENTER key press or blur)\n\t\t\t */\n\t\t\tif (\n\t\t\t\ttype === inputControlActionTypes.PRESS_ENTER ||\n\t\t\t\ttype === inputControlActionTypes.COMMIT\n\t\t\t) {\n\t\t\t\tconst applyEmptyValue =\n\t\t\t\t\trequired === false && currentValue === '';\n\n\t\t\t\tnextState.value = applyEmptyValue\n\t\t\t\t\t? currentValue\n\t\t\t\t\t: // @ts-expect-error TODO: Investigate if it's ok for currentValue to be undefined\n\t\t\t\t\t constrainValue( currentValue );\n\t\t\t}\n\n\t\t\treturn nextState;\n\t\t};\n\n\tconst buildSpinButtonClickHandler =\n\t\t( direction: 'up' | 'down' ) =>\n\t\t( event: MouseEvent< HTMLButtonElement > ) =>\n\t\t\tonChange( String( spinValue( valueProp, direction, event ) ), {\n\t\t\t\t// Set event.target to the <input> so that consumers can use\n\t\t\t\t// e.g. event.target.validity.\n\t\t\t\tevent: {\n\t\t\t\t\t...event,\n\t\t\t\t\ttarget: inputRef.current!,\n\t\t\t\t},\n\t\t\t} );\n\n\treturn (\n\t\t<Input\n\t\t\tautoComplete={ autoComplete }\n\t\t\tinputMode=\"numeric\"\n\t\t\t{ ...restProps }\n\t\t\tclassName={ classes }\n\t\t\tdragDirection={ dragDirection }\n\t\t\thideHTMLArrows={ spinControls !== 'native' }\n\t\t\tisDragEnabled={ isDragEnabled }\n\t\t\tlabel={ label }\n\t\t\tmax={ max }\n\t\t\tmin={ min }\n\t\t\tref={ mergedRef }\n\t\t\trequired={ required }\n\t\t\tstep={ step }\n\t\t\ttype={ typeProp }\n\t\t\t// @ts-expect-error TODO: Resolve discrepancy between `value` types in InputControl based components\n\t\t\tvalue={ valueProp }\n\t\t\t__unstableStateReducer={ ( state, action ) => {\n\t\t\t\tconst baseState = numberControlStateReducer( state, action );\n\t\t\t\treturn stateReducerProp?.( baseState, action ) ?? baseState;\n\t\t\t} }\n\t\t\tsize={ size }\n\t\t\tsuffix={\n\t\t\t\tspinControls === 'custom' ? (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ suffix }\n\t\t\t\t\t\t<Spacer marginBottom={ 0 } marginRight={ 2 }>\n\t\t\t\t\t\t\t<HStack spacing={ 1 }>\n\t\t\t\t\t\t\t\t<SpinButton\n\t\t\t\t\t\t\t\t\tclassName={ spinButtonClasses }\n\t\t\t\t\t\t\t\t\ticon={ plusIcon }\n\t\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Increment' ) }\n\t\t\t\t\t\t\t\t\tonClick={ buildSpinButtonClickHandler(\n\t\t\t\t\t\t\t\t\t\t'up'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<SpinButton\n\t\t\t\t\t\t\t\t\tclassName={ spinButtonClasses }\n\t\t\t\t\t\t\t\t\ticon={ resetIcon }\n\t\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Decrement' ) }\n\t\t\t\t\t\t\t\t\tonClick={ buildSpinButtonClickHandler(\n\t\t\t\t\t\t\t\t\t\t'down'\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</HStack>\n\t\t\t\t\t\t</Spacer>\n\t\t\t\t\t</>\n\t\t\t\t) : (\n\t\t\t\t\tsuffix\n\t\t\t\t)\n\t\t\t}\n\t\t\tonChange={ onChange }\n\t\t/>\n\t);\n}\n\nexport const NumberControl = forwardRef( UnforwardedNumberControl );\n\nexport default NumberControl;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAMA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAN,sBAAA,CAAAC,OAAA;AAKA,IAAAM,oBAAA,GAAAN,OAAA;AACA,IAAAO,uBAAA,GAAAC,uBAAA,CAAAR,OAAA;AACA,IAAAS,KAAA,GAAAT,OAAA;AACA,IAAAU,OAAA,GAAAV,OAAA;AAGA,IAAAW,OAAA,GAAAX,OAAA;AACA,IAAAY,OAAA,GAAAZ,OAAA;AACA,IAAAa,MAAA,GAAAb,OAAA;AACA,IAAAc,mBAAA,GAAAd,OAAA;AACA,IAAAe,mBAAA,GAAAf,OAAA;AAA4E,IAAAgB,WAAA,GAAAhB,OAAA;AAAA,SAAAiB,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OA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pB,IAAA7H,WAAA,CAAAqH,GAAA,EAAC/H,oBAAA,CAAA6I,UAAU;YACVxG,SAAS,EAAGkD,iBAAmB;YAC/BuD,IAAI,EAAGC,WAAU;YACjBxF,IAAI,EAAC,OAAO;YACZZ,KAAK,EAAG,IAAAqG,QAAE,EAAE,WAAY,CAAG;YAC3BC,OAAO,EAAGtB,2BAA2B,CACpC,IACD;UAAG,CACH,CAAC,eACF,IAAAjH,WAAA,CAAAqH,GAAA,EAAC/H,oBAAA,CAAA6I,UAAU;YACVxG,SAAS,EAAGkD,iBAAmB;YAC/BuD,IAAI,EAAGI,YAAW;YAClB3F,IAAI,EAAC,OAAO;YACZZ,KAAK,EAAG,IAAAqG,QAAE,EAAE,WAAY,CAAG;YAC3BC,OAAO,EAAGtB,2BAA2B,CACpC,MACD;UAAG,CACH,CAAC;QAAA,CACK;MAAC,CACF,CAAC;IAAA,CACR,CAAC,GAEHnE,MAED;IACDC,QAAQ,EAAGA;EAAU,CACrB,CAAC;AAEJ;AAEO,MAAM0F,aAAa,GAAAC,OAAA,CAAAD,aAAA,GAAG,IAAAE,mBAAU,EAAErH,wBAAyB,CAAC;AAAC,IAAAsH,QAAA,GAAAF,OAAA,CAAAnI,OAAA,GAErDkI,aAAa","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["@wordpress/components/src/number-control/types.ts"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport type { InputControlProps } from '../input-control/types';\n\nexport type NumberControlProps = Omit<\n\tInputControlProps,\n\t'isDragEnabled' | 'min' | 'max' | 'required' | 'step' | 'type' | 'value'\n> & {\n\t/**\n\t * If true, the default `input` HTML arrows will be hidden.\n\t *\n\t * @deprecated\n\t * @default false\n\t */\n\thideHTMLArrows?: boolean;\n\t/**\n\t * The type of spin controls to display. These are buttons that allow the\n\t * user to quickly increment and decrement the number.\n\t *\n\t * - 'none' - Do not show spin controls.\n\t * - 'native' - Use browser's native HTML `input` controls.\n\t * - 'custom' - Use plus and minus icon buttons.\n\t *\n\t * @default 'native'\n\t */\n\tspinControls?: 'none' | 'native' | 'custom';\n\t/**\n\t * If true, enables mouse drag gestures.\n\t *\n\t * @default true\n\t */\n\tisDragEnabled?: InputControlProps[ 'isDragEnabled' ];\n\t/**\n\t * If true, pressing `UP` or `DOWN` along with the `SHIFT` key will increment the\n\t * value by the `shiftStep` value.\n\t *\n\t * @default true\n\t */\n\tisShiftStepEnabled?: boolean;\n\t/**\n\t * The maximum `value` allowed.\n\t *\n\t * @default Infinity\n\t */\n\tmax?: number;\n\t/**\n\t * The minimum `value` allowed.\n\t *\n\t * @default -Infinity\n\t */\n\tmin?: number;\n\t/**\n\t * If `true` enforces a valid number within the control's min/max range.\n\t * If `false` allows an empty string as a valid value.\n\t *\n\t * @default false\n\t */\n\trequired?: InputControlProps[ 'required' ];\n\t/**\n\t * Amount to increment by when the `SHIFT` key is held down. This shift value is\n\t * a multiplier to the `step` value. For example, if the `step` value is `5`,\n\t * and `shiftStep` is `10`, each jump would increment/decrement by `50`.\n\t *\n\t * @default 10\n\t */\n\tshiftStep?: number;\n\t/**\n\t * Amount by which the `value` is changed when incrementing/decrementing.\n\t * It is also a factor in validation as `value` must be a multiple of `step`\n\t * (offset by `min`, if specified) to be valid. Accepts the special string value `any`\n\t * that voids the validation constraint and causes stepping actions to increment/decrement by `1`.\n\t *\n\t * @default 1\n\t */\n\tstep?: InputControlProps[ 'step' ];\n\t/**\n\t * Optional multiplication factor in spin changes. i.e. A spin changes\n\t * by `spinFactor * step` (if `step` is \"any\", 1 is used instead).\n\t *\n\t * @default 1\n\t */\n\tspinFactor?: number;\n\t/**\n\t * The `type` attribute of the `input` element.\n\t *\n\t * @default 'number'\n\t */\n\ttype?: InputControlProps[ 'type' ];\n\t/**\n\t * The value of the input.\n\t */\n\tvalue?: number | string;\n};\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["@wordpress/components/src/number-control/types.ts"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport type { InputControlProps } from '../input-control/types';\n\nexport type NumberControlProps = Omit<\n\tInputControlProps,\n\t'isDragEnabled' | 'min' | 'max' | 'required' | 'step' | 'type' | 'value'\n> & {\n\t/**\n\t * If true, the default `input` HTML arrows will be hidden.\n\t *\n\t * @deprecated\n\t * @default false\n\t */\n\thideHTMLArrows?: boolean;\n\t/**\n\t * The type of spin controls to display. These are buttons that allow the\n\t * user to quickly increment and decrement the number.\n\t *\n\t * - 'none' - Do not show spin controls.\n\t * - 'native' - Use browser's native HTML `input` controls.\n\t * - 'custom' - Use plus and minus icon buttons.\n\t *\n\t * @default 'native'\n\t */\n\tspinControls?: 'none' | 'native' | 'custom';\n\t/**\n\t * If true, enables mouse drag gestures.\n\t *\n\t * @default true\n\t */\n\tisDragEnabled?: InputControlProps[ 'isDragEnabled' ];\n\t/**\n\t * If true, pressing `UP` or `DOWN` along with the `SHIFT` key will increment the\n\t * value by the `shiftStep` value.\n\t *\n\t * @default true\n\t */\n\tisShiftStepEnabled?: boolean;\n\t/**\n\t * The maximum `value` allowed.\n\t *\n\t * @default Infinity\n\t */\n\tmax?: number;\n\t/**\n\t * The minimum `value` allowed.\n\t *\n\t * @default -Infinity\n\t */\n\tmin?: number;\n\t/**\n\t * If `true` enforces a valid number within the control's min/max range.\n\t * If `false` allows an empty string as a valid value.\n\t *\n\t * @default false\n\t */\n\trequired?: InputControlProps[ 'required' ];\n\t/**\n\t * Amount to increment by when the `SHIFT` key is held down. This shift value is\n\t * a multiplier to the `step` value. For example, if the `step` value is `5`,\n\t * and `shiftStep` is `10`, each jump would increment/decrement by `50`.\n\t *\n\t * @default 10\n\t */\n\tshiftStep?: number;\n\t/**\n\t * Amount by which the `value` is changed when incrementing/decrementing.\n\t * It is also a factor in validation as `value` must be a multiple of `step`\n\t * (offset by `min`, if specified) to be valid. Accepts the special string value `any`\n\t * that voids the validation constraint and causes stepping actions to increment/decrement by `1`.\n\t *\n\t * @default 1\n\t */\n\tstep?: InputControlProps[ 'step' ];\n\t/**\n\t * Optional multiplication factor in spin changes. i.e. A spin changes\n\t * by `spinFactor * step` (if `step` is \"any\", 1 is used instead).\n\t *\n\t * @default 1\n\t */\n\tspinFactor?: number;\n\t/**\n\t * The `type` attribute of the `input` element.\n\t *\n\t * @default 'number'\n\t */\n\ttype?: InputControlProps[ 'type' ];\n\t/**\n\t * The value of the input.\n\t */\n\tvalue?: number | string;\n\t/**\n\t * Do not throw a warning for the deprecated 36px default size.\n\t * For internal components of other components that already throw the warning.\n\t *\n\t * @ignore\n\t */\n\t__shouldNotWarnDeprecated36pxSize?: boolean;\n};\n"],"mappings":"","ignoreList":[]}
@@ -1,3 +1,4 @@
1
+ /* wp:polyfill */
1
2
  "use strict";
2
3
 
3
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_element","_i18n","_icons","_compose","_button","_colorPicker","_flex","_hStack","_itemGroup","_vStack","_gradientPicker","_colorPalette","_dropdownMenu","_popover","_styles","_navigableContainer","_constants","_customGradientPicker","_strings","_jsxRuntime","DEFAULT_COLOR","NameInput","value","onChange","label","jsx","NameInputControl","hideLabelFromVision","deduplicateElementSlugs","elements","slugCounts","map","element","_newSlug","newSlug","slug","getNameAndSlugForPosition","slugPrefix","nameRegex","RegExp","position","reduce","previousValue","currentValue","matches","match","id","parseInt","name","sprintf","__","ColorPickerPopover","isGradient","popoverProps","receivedPopoverProps","onClose","useMemo","shift","offset","resize","placement","className","clsx","jsxs","default","children","ColorPicker","color","enableAlpha","newColor","__experimentalIsRenderedInSidebar","gradient","newGradient","Option","canOnlyChangeValues","onRemove","isEditingColor","setIsEditingColor","useState","popoverAnchor","setPopoverAnchor","anchor","Item","ref","size","HStack","justify","onClick","trim","length","style","padding","IndicatorStyled","colorValue","FlexItem","nextName","kebabCase","NameContainer","RemoveButton","icon","lineSolid","PaletteEditListView","addColorRef","elementsReferenceRef","useRef","useEffect","current","debounceOnChange","useDebounce","updatedElements","VStack","spacing","ItemGroup","isRounded","isBordered","isSeparated","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","useCallback","newEditingElementIndex","selectedElement","key","PaletteEditStyles","PaletteHeading","level","PaletteActionsContainer","DoneButton","isPressed","plus","DEFAULT_GRADIENT","moreVertical","toggleProps","Fragment","NavigableMenu","role","__next40pxDefaultSize","variant","PaletteEditContents","clearable","disableCustomGradients","disableCustomColors","_default","exports"],"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 { Item, 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\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\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 * Deduplicates the slugs of the provided elements.\n */\nexport function deduplicateElementSlugs< T extends PaletteElement >(\n\telements: T[]\n) {\n\tconst slugCounts: { [ slug: string ]: number } = {};\n\n\treturn elements.map( ( element ) => {\n\t\tlet newSlug: string | undefined;\n\n\t\tconst { slug } = element;\n\t\tslugCounts[ slug ] = ( slugCounts[ slug ] || 0 ) + 1;\n\n\t\tif ( slugCounts[ slug ] > 1 ) {\n\t\t\tnewSlug = `${ slug }-${ slugCounts[ slug ] - 1 }`;\n\t\t}\n\n\t\treturn { ...element, slug: newSlug ?? slug };\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 PaletteElement >( {\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 PaletteElement >( {\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<Item ref={ setPopoverAnchor } size=\"small\">\n\t\t\t<HStack justify=\"flex-start\">\n\t\t\t\t<Button\n\t\t\t\t\tsize=\"small\"\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</Item>\n\t);\n}\n\nfunction PaletteEditListView< T extends PaletteElement >( {\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 elementsReferenceRef = useRef< typeof elements >();\n\tuseEffect( () => {\n\t\telementsReferenceRef.current = elements;\n\t}, [ elements ] );\n\n\tconst debounceOnChange = useDebounce(\n\t\t( updatedElements: T[] ) =>\n\t\t\tonChange( deduplicateElementSlugs( updatedElements ) ),\n\t\t100\n\t);\n\n\treturn (\n\t\t<VStack spacing={ 3 }>\n\t\t\t<ItemGroup isRounded isBordered isSeparated>\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\t__next40pxDefaultSize\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\t__next40pxDefaultSize\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\t__next40pxDefaultSize\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\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":";;;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AAOA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AAKA,IAAAK,OAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,YAAA,G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A,cAAc,GAAI,CAAC,CAAC,CAAI;QAC5ClF,YAAY,EAAGA;MAAc,CAC7B,CACD,EACC,CAAEgF,SAAS,KACVjF,UAAU,gBACX,IAAAjC,WAAA,CAAAM,GAAA,EAACf,eAAA,CAAAsD,OAAc;QACd+D,SAAS,EAAGA,SAAW;QACvBxG,QAAQ,EAAGqH,mBAAqB;QAChCqB,SAAS,EAAG,KAAO;QACnBC,sBAAsB;MAAA,CACtB,CAAC,gBAEF,IAAA/I,WAAA,CAAAM,GAAA,EAACd,aAAA,CAAAqD,OAAY;QACZgE,MAAM,EAAGA,MAAQ;QACjBzG,QAAQ,EAAGqH,mBAAqB;QAChCqB,SAAS,EAAG,KAAO;QACnBE,mBAAmB;MAAA,CACnB,CACD,CAAE;IAAA,CACgB,CACrB,EACC,CAAExB,WAAW,IAAIR,YAAY,iBAC9B,IAAAhH,WAAA,CAAAM,GAAA,EAACX,OAAA,CAAAkJ,mBAAmB;MAAA/F,QAAA,EAAGkE;IAAY,CAAuB,CAC1D;EAAA,CACiB,CAAC;AAEtB;AAAC,IAAAiC,QAAA,GAAAC,OAAA,CAAArG,OAAA,GAEc8D,WAAW","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_element","_i18n","_icons","_compose","_button","_colorPicker","_flex","_hStack","_itemGroup","_vStack","_gradientPicker","_colorPalette","_dropdownMenu","_popover","_styles","_navigableContainer","_constants","_customGradientPicker","_strings","_jsxRuntime","DEFAULT_COLOR","NameInput","value","onChange","label","jsx","NameInputControl","hideLabelFromVision","deduplicateElementSlugs","elements","slugCounts","map","element","_newSlug","newSlug","slug","getNameAndSlugForPosition","slugPrefix","nameRegex","RegExp","position","reduce","previousValue","currentValue","matches","match","id","parseInt","name","sprintf","__","ColorPickerPopover","isGradient","popoverProps","receivedPopoverProps","onClose","useMemo","shift","offset","resize","placement","className","clsx","jsxs","default","children","ColorPicker","color","enableAlpha","newColor","__experimentalIsRenderedInSidebar","gradient","newGradient","Option","canOnlyChangeValues","onRemove","isEditingColor","setIsEditingColor","useState","popoverAnchor","setPopoverAnchor","anchor","Item","ref","size","HStack","justify","onClick","trim","length","style","padding","IndicatorStyled","colorValue","FlexItem","nextName","kebabCase","NameContainer","RemoveButton","icon","lineSolid","PaletteEditListView","addColorRef","elementsReferenceRef","useRef","useEffect","current","debounceOnChange","useDebounce","updatedElements","VStack","spacing","ItemGroup","isRounded","isBordered","isSeparated","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","useCallback","newEditingElementIndex","selectedElement","key","PaletteEditStyles","PaletteHeading","level","PaletteActionsContainer","DoneButton","isPressed","plus","DEFAULT_GRADIENT","moreVertical","toggleProps","Fragment","NavigableMenu","role","__next40pxDefaultSize","variant","PaletteEditContents","clearable","disableCustomGradients","disableCustomColors","_default","exports"],"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 { Item, 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\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\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 * Deduplicates the slugs of the provided elements.\n */\nexport function deduplicateElementSlugs< T extends PaletteElement >(\n\telements: T[]\n) {\n\tconst slugCounts: { [ slug: string ]: number } = {};\n\n\treturn elements.map( ( element ) => {\n\t\tlet newSlug: string | undefined;\n\n\t\tconst { slug } = element;\n\t\tslugCounts[ slug ] = ( slugCounts[ slug ] || 0 ) + 1;\n\n\t\tif ( slugCounts[ slug ] > 1 ) {\n\t\t\tnewSlug = `${ slug }-${ slugCounts[ slug ] - 1 }`;\n\t\t}\n\n\t\treturn { ...element, slug: newSlug ?? slug };\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 PaletteElement >( {\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 PaletteElement >( {\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<Item ref={ setPopoverAnchor } size=\"small\">\n\t\t\t<HStack justify=\"flex-start\">\n\t\t\t\t<Button\n\t\t\t\t\tsize=\"small\"\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</Item>\n\t);\n}\n\nfunction PaletteEditListView< T extends PaletteElement >( {\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 elementsReferenceRef = useRef< typeof elements >();\n\tuseEffect( () => {\n\t\telementsReferenceRef.current = elements;\n\t}, [ elements ] );\n\n\tconst debounceOnChange = useDebounce(\n\t\t( updatedElements: T[] ) =>\n\t\t\tonChange( deduplicateElementSlugs( updatedElements ) ),\n\t\t100\n\t);\n\n\treturn (\n\t\t<VStack spacing={ 3 }>\n\t\t\t<ItemGroup isRounded isBordered isSeparated>\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\t__next40pxDefaultSize\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\t__next40pxDefaultSize\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\t__next40pxDefaultSize\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\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":";;;;;;;;;;;AAGA,IAAAA,KAAA,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GAAG,CACX,CACCuF,cAA6C,EAC7CC,YAAoB,KAChB;YACJ,IACCA,YAAY,KAAKgB,cAAc,EAC9B;cACD,OAAOlB,UAAU;YAClB;YACA,OAAOC,cAAc;UACtB,CACD,CACD,CAAC;QACF,CAAG;QACHtF,OAAO,EAAGH,QAAQ,CAAE0G,cAAc,aAAdA,cAAc,cAAdA,cAAc,GAAI,CAAC,CAAC,CAAI;QAC5ClF,YAAY,EAAGA;MAAc,CAC7B,CACD,EACC,CAAEgF,SAAS,KACVjF,UAAU,gBACX,IAAAjC,WAAA,CAAAM,GAAA,EAACf,eAAA,CAAAsD,OAAc;QACd+D,SAAS,EAAGA,SAAW;QACvBxG,QAAQ,EAAGqH,mBAAqB;QAChCqB,SAAS,EAAG,KAAO;QACnBC,sBAAsB;MAAA,CACtB,CAAC,gBAEF,IAAA/I,WAAA,CAAAM,GAAA,EAACd,aAAA,CAAAqD,OAAY;QACZgE,MAAM,EAAGA,MAAQ;QACjBzG,QAAQ,EAAGqH,mBAAqB;QAChCqB,SAAS,EAAG,KAAO;QACnBE,mBAAmB;MAAA,CACnB,CACD,CAAE;IAAA,CACgB,CACrB,EACC,CAAExB,WAAW,IAAIR,YAAY,iBAC9B,IAAAhH,WAAA,CAAAM,GAAA,EAACX,OAAA,CAAAkJ,mBAAmB;MAAA/F,QAAA,EAAGkE;IAAY,CAAuB,CAC1D;EAAA,CACiB,CAAC;AAEtB;AAAC,IAAAiC,QAAA,GAAAC,OAAA,CAAArG,OAAA,GAEc8D,WAAW","ignoreList":[]}
@@ -1,3 +1,4 @@
1
+ /* wp:polyfill */
1
2
  "use strict";
2
3
 
3
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNative","require","_compose","_element","_actions","_interopRequireDefault","_bottomSeparatorCover","_textControl","_jsxRuntime","PanelActions","actions","getStylesFromColorScheme","mappedActions","useMemo","map","label","onPress","jsx","default","labelStyle","styles","defaultLabelStyle","jsxs","View","style","panelActionsContainer","panelActionsContainerDark","children","_default","exports","withPreferredColorScheme"],"sources":["@wordpress/components/src/panel/actions.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { View } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { withPreferredColorScheme } from '@wordpress/compose';\nimport { useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport styles from './actions.scss';\nimport BottomSeparatorCover from './bottom-separator-cover';\nimport TextControl from '../text-control';\n\nfunction PanelActions( { actions, getStylesFromColorScheme } ) {\n\tconst mappedActions = useMemo( () => {\n\t\treturn actions.map( ( { label, onPress } ) => {\n\t\t\treturn (\n\t\t\t\t<TextControl\n\t\t\t\t\tlabel={ label }\n\t\t\t\t\tonPress={ onPress }\n\t\t\t\t\tlabelStyle={ styles.defaultLabelStyle }\n\t\t\t\t\tkey={ label }\n\t\t\t\t/>\n\t\t\t);\n\t\t} );\n\t}, [ actions ] );\n\n\treturn (\n\t\t<View\n\t\t\tstyle={ getStylesFromColorScheme(\n\t\t\t\tstyles.panelActionsContainer,\n\t\t\t\tstyles.panelActionsContainerDark\n\t\t\t) }\n\t\t>\n\t\t\t{ mappedActions }\n\t\t\t<BottomSeparatorCover />\n\t\t</View>\n\t);\n}\n\nexport default withPreferredColorScheme( PanelActions );\n"],"mappings":";;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAKA,IAAAG,QAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,qBAAA,GAAAD,sBAAA,CAAAJ,OAAA;AACA,IAAAM,YAAA,GAAAF,sBAAA,CAAAJ,OAAA;AAA0C,IAAAO,WAAA,GAAAP,OAAA;AAhB1C;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;;AAKA,SAASQ,YAAYA,CAAE;EAAEC,OAAO;EAAEC;AAAyB,CAAC,EAAG;EAC9D,MAAMC,aAAa,GAAG,IAAAC,gBAAO,EAAE,MAAM;IACpC,OAAOH,OAAO,CAACI,GAAG,CAAE,CAAE;MAAEC,KAAK;MAAEC;IAAQ,CAAC,KAAM;MAC7C,oBACC,IAAAR,WAAA,CAAAS,GAAA,EAACV,YAAA,CAAAW,OAAW;QACXH,KAAK,EAAGA,KAAO;QACfC,OAAO,EAAGA,OAAS;QACnBG,UAAU,EAAGC,gBAAM,CAACC;MAAmB,GACjCN,KACN,CAAC;IAEJ,CAAE,CAAC;EACJ,CAAC,EAAE,CAAEL,OAAO,CAAG,CAAC;EAEhB,oBACC,IAAAF,WAAA,CAAAc,IAAA,EAACtB,YAAA,CAAAuB,IAAI;IACJC,KAAK,EAAGb,wBAAwB,CAC/BS,gBAAM,CAACK,qBAAqB,EAC5BL,gBAAM,CAACM,yBACR,CAAG;IAAAC,QAAA,GAEDf,aAAa,eACf,IAAAJ,WAAA,CAAAS,GAAA,EAACX,qBAAA,CAAAY,OAAoB,IAAE,CAAC;EAAA,CACnB,CAAC;AAET;AAAC,IAAAU,QAAA,GAAAC,OAAA,CAAAX,OAAA,GAEc,IAAAY,iCAAwB,EAAErB,YAAa,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_reactNative","require","_compose","_element","_actions","_interopRequireDefault","_bottomSeparatorCover","_textControl","_jsxRuntime","PanelActions","actions","getStylesFromColorScheme","mappedActions","useMemo","map","label","onPress","jsx","default","labelStyle","styles","defaultLabelStyle","jsxs","View","style","panelActionsContainer","panelActionsContainerDark","children","_default","exports","withPreferredColorScheme"],"sources":["@wordpress/components/src/panel/actions.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { View } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { withPreferredColorScheme } from '@wordpress/compose';\nimport { useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport styles from './actions.scss';\nimport BottomSeparatorCover from './bottom-separator-cover';\nimport TextControl from '../text-control';\n\nfunction PanelActions( { actions, getStylesFromColorScheme } ) {\n\tconst mappedActions = useMemo( () => {\n\t\treturn actions.map( ( { label, onPress } ) => {\n\t\t\treturn (\n\t\t\t\t<TextControl\n\t\t\t\t\tlabel={ label }\n\t\t\t\t\tonPress={ onPress }\n\t\t\t\t\tlabelStyle={ styles.defaultLabelStyle }\n\t\t\t\t\tkey={ label }\n\t\t\t\t/>\n\t\t\t);\n\t\t} );\n\t}, [ actions ] );\n\n\treturn (\n\t\t<View\n\t\t\tstyle={ getStylesFromColorScheme(\n\t\t\t\tstyles.panelActionsContainer,\n\t\t\t\tstyles.panelActionsContainerDark\n\t\t\t) }\n\t\t>\n\t\t\t{ mappedActions }\n\t\t\t<BottomSeparatorCover />\n\t\t</View>\n\t);\n}\n\nexport default withPreferredColorScheme( PanelActions );\n"],"mappings":";;;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAKA,IAAAG,QAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,qBAAA,GAAAD,sBAAA,CAAAJ,OAAA;AACA,IAAAM,YAAA,GAAAF,sBAAA,CAAAJ,OAAA;AAA0C,IAAAO,WAAA,GAAAP,OAAA;AAhB1C;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;;AAKA,SAASQ,YAAYA,CAAE;EAAEC,OAAO;EAAEC;AAAyB,CAAC,EAAG;EAC9D,MAAMC,aAAa,GAAG,IAAAC,gBAAO,EAAE,MAAM;IACpC,OAAOH,OAAO,CAACI,GAAG,CAAE,CAAE;MAAEC,KAAK;MAAEC;IAAQ,CAAC,KAAM;MAC7C,oBACC,IAAAR,WAAA,CAAAS,GAAA,EAACV,YAAA,CAAAW,OAAW;QACXH,KAAK,EAAGA,KAAO;QACfC,OAAO,EAAGA,OAAS;QACnBG,UAAU,EAAGC,gBAAM,CAACC;MAAmB,GACjCN,KACN,CAAC;IAEJ,CAAE,CAAC;EACJ,CAAC,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