@wordpress/components 28.14.1-next.cd6172eb0.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 (747) hide show
  1. package/CHANGELOG.md +16 -9
  2. package/build/alignment-matrix-control/icon.js +1 -0
  3. package/build/alignment-matrix-control/icon.js.map +1 -1
  4. package/build/alignment-matrix-control/index.js +1 -0
  5. package/build/alignment-matrix-control/index.js.map +1 -1
  6. package/build/animation/index.js +0 -6
  7. package/build/animation/index.js.map +1 -1
  8. package/build/autocomplete/autocompleter-ui.js +1 -0
  9. package/build/autocomplete/autocompleter-ui.js.map +1 -1
  10. package/build/autocomplete/autocompleter-ui.native.js +1 -0
  11. package/build/autocomplete/autocompleter-ui.native.js.map +1 -1
  12. package/build/autocomplete/get-default-use-items.js +1 -0
  13. package/build/autocomplete/get-default-use-items.js.map +1 -1
  14. package/build/autocomplete/index.js +1 -0
  15. package/build/autocomplete/index.js.map +1 -1
  16. package/build/border-box-control/utils.js +1 -0
  17. package/build/border-box-control/utils.js.map +1 -1
  18. package/build/border-control/border-control-dropdown/component.js +1 -0
  19. package/build/border-control/border-control-dropdown/component.js.map +1 -1
  20. package/build/border-control/border-control-style-picker/component.js +1 -0
  21. package/build/border-control/border-control-style-picker/component.js.map +1 -1
  22. package/build/box-control/index.js +13 -13
  23. package/build/box-control/index.js.map +1 -1
  24. package/build/box-control/input-control.js +161 -0
  25. package/build/box-control/input-control.js.map +1 -0
  26. package/build/box-control/types.js.map +1 -1
  27. package/build/box-control/utils.js +51 -48
  28. package/build/box-control/utils.js.map +1 -1
  29. package/build/button/index.native.js +1 -0
  30. package/build/button/index.native.js.map +1 -1
  31. package/build/button/types.js.map +1 -1
  32. package/build/color-indicator/index.native.js +1 -0
  33. package/build/color-indicator/index.native.js.map +1 -1
  34. package/build/color-palette/index.js +1 -0
  35. package/build/color-palette/index.js.map +1 -1
  36. package/build/color-palette/index.native.js +1 -0
  37. package/build/color-palette/index.native.js.map +1 -1
  38. package/build/color-palette/utils.js +1 -0
  39. package/build/color-palette/utils.js.map +1 -1
  40. package/build/combobox-control/index.js +1 -0
  41. package/build/combobox-control/index.js.map +1 -1
  42. package/build/composite/legacy/index.js +1 -0
  43. package/build/composite/legacy/index.js.map +1 -1
  44. package/build/context/context-connect.js +1 -0
  45. package/build/context/context-connect.js.map +1 -1
  46. package/build/custom-gradient-picker/gradient-bar/control-points.js +1 -0
  47. package/build/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
  48. package/build/custom-gradient-picker/gradient-bar/index.js +1 -0
  49. package/build/custom-gradient-picker/gradient-bar/index.js.map +1 -1
  50. package/build/custom-gradient-picker/gradient-bar/utils.js +1 -0
  51. package/build/custom-gradient-picker/gradient-bar/utils.js.map +1 -1
  52. package/build/custom-gradient-picker/index.js +1 -0
  53. package/build/custom-gradient-picker/index.js.map +1 -1
  54. package/build/custom-gradient-picker/serializer.js +1 -0
  55. package/build/custom-gradient-picker/serializer.js.map +1 -1
  56. package/build/custom-gradient-picker/utils.js +1 -0
  57. package/build/custom-gradient-picker/utils.js.map +1 -1
  58. package/build/custom-select-control/index.js +3 -2
  59. package/build/custom-select-control/index.js.map +1 -1
  60. package/build/dashicon/index.js +1 -0
  61. package/build/dashicon/index.js.map +1 -1
  62. package/build/date-time/date/index.js +1 -0
  63. package/build/date-time/date/index.js.map +1 -1
  64. package/build/date-time/date/use-lilius/index.js +1 -0
  65. package/build/date-time/date/use-lilius/index.js.map +1 -1
  66. package/build/date-time/time/index.js +1 -0
  67. package/build/date-time/time/index.js.map +1 -1
  68. package/build/dimension-control/index.js +1 -0
  69. package/build/dimension-control/index.js.map +1 -1
  70. package/build/dimension-control/sizes.js +1 -0
  71. package/build/dimension-control/sizes.js.map +1 -1
  72. package/build/draggable/index.js +1 -0
  73. package/build/draggable/index.js.map +1 -1
  74. package/build/draggable/index.native.js +1 -0
  75. package/build/draggable/index.native.js.map +1 -1
  76. package/build/dropdown-menu/index.js +1 -0
  77. package/build/dropdown-menu/index.js.map +1 -1
  78. package/build/dropdown-menu/index.native.js +1 -0
  79. package/build/dropdown-menu/index.native.js.map +1 -1
  80. package/build/duotone-picker/color-list-picker/index.js +1 -0
  81. package/build/duotone-picker/color-list-picker/index.js.map +1 -1
  82. package/build/duotone-picker/duotone-picker.js +1 -0
  83. package/build/duotone-picker/duotone-picker.js.map +1 -1
  84. package/build/duotone-picker/utils.js +1 -0
  85. package/build/duotone-picker/utils.js.map +1 -1
  86. package/build/external-link/index.js +1 -0
  87. package/build/external-link/index.js.map +1 -1
  88. package/build/font-size-picker/font-size-picker-select.js +1 -0
  89. package/build/font-size-picker/font-size-picker-select.js.map +1 -1
  90. package/build/font-size-picker/font-size-picker-toggle-group.js +1 -0
  91. package/build/font-size-picker/font-size-picker-toggle-group.js.map +1 -1
  92. package/build/font-size-picker/index.js +1 -0
  93. package/build/font-size-picker/index.js.map +1 -1
  94. package/build/font-size-picker/index.native.js +1 -0
  95. package/build/font-size-picker/index.native.js.map +1 -1
  96. package/build/font-size-picker/utils.js +1 -0
  97. package/build/font-size-picker/utils.js.map +1 -1
  98. package/build/form-token-field/index.js +1 -0
  99. package/build/form-token-field/index.js.map +1 -1
  100. package/build/form-token-field/suggestions-list.js +1 -0
  101. package/build/form-token-field/suggestions-list.js.map +1 -1
  102. package/build/gradient-picker/index.js +1 -0
  103. package/build/gradient-picker/index.js.map +1 -1
  104. package/build/guide/index.js +1 -0
  105. package/build/guide/index.js.map +1 -1
  106. package/build/guide/page-control.js +1 -0
  107. package/build/guide/page-control.js.map +1 -1
  108. package/build/h-stack/hook.js +1 -0
  109. package/build/h-stack/hook.js.map +1 -1
  110. package/build/higher-order/navigate-regions/index.js +1 -0
  111. package/build/higher-order/navigate-regions/index.js.map +1 -1
  112. package/build/higher-order/with-fallback-styles/index.js +1 -0
  113. package/build/higher-order/with-fallback-styles/index.js.map +1 -1
  114. package/build/higher-order/with-filters/index.js +1 -0
  115. package/build/higher-order/with-filters/index.js.map +1 -1
  116. package/build/higher-order/with-notices/index.js +1 -0
  117. package/build/higher-order/with-notices/index.js.map +1 -1
  118. package/build/index.js +0 -6
  119. package/build/index.js.map +1 -1
  120. package/build/keyboard-shortcuts/index.js +1 -0
  121. package/build/keyboard-shortcuts/index.js.map +1 -1
  122. package/build/menu/styles.js +16 -16
  123. package/build/menu/styles.js.map +1 -1
  124. package/build/menu-items-choice/index.js +1 -0
  125. package/build/menu-items-choice/index.js.map +1 -1
  126. package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js +1 -0
  127. package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js.map +1 -1
  128. package/build/mobile/bottom-sheet/keyboard-avoiding-view.native.js +1 -0
  129. package/build/mobile/bottom-sheet/keyboard-avoiding-view.native.js.map +1 -1
  130. package/build/mobile/bottom-sheet/picker-cell.native.js +1 -0
  131. package/build/mobile/bottom-sheet/picker-cell.native.js.map +1 -1
  132. package/build/mobile/bottom-sheet-select-control/index.native.js +1 -0
  133. package/build/mobile/bottom-sheet-select-control/index.native.js.map +1 -1
  134. package/build/mobile/color-settings/palette.screen.native.js +1 -0
  135. package/build/mobile/color-settings/palette.screen.native.js.map +1 -1
  136. package/build/mobile/gradient/index.native.js +1 -0
  137. package/build/mobile/gradient/index.native.js.map +1 -1
  138. package/build/mobile/media-edit/index.native.js +1 -0
  139. package/build/mobile/media-edit/index.native.js.map +1 -1
  140. package/build/mobile/picker/index.android.js +1 -0
  141. package/build/mobile/picker/index.android.js.map +1 -1
  142. package/build/mobile/picker/index.ios.js +1 -0
  143. package/build/mobile/picker/index.ios.js.map +1 -1
  144. package/build/mobile/segmented-control/index.native.js +1 -0
  145. package/build/mobile/segmented-control/index.native.js.map +1 -1
  146. package/build/mobile/utils/get-px-from-css-unit.native.js +1 -0
  147. package/build/mobile/utils/get-px-from-css-unit.native.js.map +1 -1
  148. package/build/navigable-container/container.js +1 -0
  149. package/build/navigable-container/container.js.map +1 -1
  150. package/build/navigation/group/index.js +1 -0
  151. package/build/navigation/group/index.js.map +1 -1
  152. package/build/navigation/menu/menu-title-search.js +1 -0
  153. package/build/navigation/menu/menu-title-search.js.map +1 -1
  154. package/build/navigation/menu/search-no-results-found.js +1 -0
  155. package/build/navigation/menu/search-no-results-found.js.map +1 -1
  156. package/build/navigation/styles/navigation-styles.js +12 -12
  157. package/build/navigation/styles/navigation-styles.js.map +1 -1
  158. package/build/navigator/navigator/component.js +1 -0
  159. package/build/navigator/navigator/component.js.map +1 -1
  160. package/build/navigator/navigator-screen/component.js +1 -0
  161. package/build/navigator/navigator-screen/component.js.map +1 -1
  162. package/build/navigator/utils/router.js +1 -0
  163. package/build/navigator/utils/router.js.map +1 -1
  164. package/build/notice/index.js +1 -0
  165. package/build/notice/index.js.map +1 -1
  166. package/build/notice/list.js +1 -0
  167. package/build/notice/list.js.map +1 -1
  168. package/build/notice/list.native.js +1 -0
  169. package/build/notice/list.native.js.map +1 -1
  170. package/build/palette-edit/index.js +1 -0
  171. package/build/palette-edit/index.js.map +1 -1
  172. package/build/panel/actions.native.js +1 -0
  173. package/build/panel/actions.native.js.map +1 -1
  174. package/build/query-controls/index.js +1 -0
  175. package/build/query-controls/index.js.map +1 -1
  176. package/build/query-controls/terms.js +1 -0
  177. package/build/query-controls/terms.js.map +1 -1
  178. package/build/radio-control/index.js +1 -0
  179. package/build/radio-control/index.js.map +1 -1
  180. package/build/radio-control/index.native.js +1 -0
  181. package/build/radio-control/index.native.js.map +1 -1
  182. package/build/range-control/mark.js +0 -1
  183. package/build/range-control/mark.js.map +1 -1
  184. package/build/range-control/rail.js +1 -0
  185. package/build/range-control/rail.js.map +1 -1
  186. package/build/range-control/styles/range-control-styles.js +33 -45
  187. package/build/range-control/styles/range-control-styles.js.map +1 -1
  188. package/build/resizable-box/index.js +1 -0
  189. package/build/resizable-box/index.js.map +1 -1
  190. package/build/sandbox/index.js +1 -0
  191. package/build/sandbox/index.js.map +1 -1
  192. package/build/sandbox/index.native.js +1 -0
  193. package/build/sandbox/index.native.js.map +1 -1
  194. package/build/search-control/index.native.js +1 -0
  195. package/build/search-control/index.native.js.map +1 -1
  196. package/build/select-control/index.js +1 -0
  197. package/build/select-control/index.js.map +1 -1
  198. package/build/slot-fill/bubbles-virtually/slot-fill-provider.js +1 -0
  199. package/build/slot-fill/bubbles-virtually/slot-fill-provider.js.map +1 -1
  200. package/build/slot-fill/provider.js +1 -0
  201. package/build/slot-fill/provider.js.map +1 -1
  202. package/build/slot-fill/slot.js +1 -0
  203. package/build/slot-fill/slot.js.map +1 -1
  204. package/build/snackbar/index.js +1 -0
  205. package/build/snackbar/index.js.map +1 -1
  206. package/build/snackbar/list.js +1 -0
  207. package/build/snackbar/list.js.map +1 -1
  208. package/build/tab-panel/index.js +1 -0
  209. package/build/tab-panel/index.js.map +1 -1
  210. package/build/tabs/index.js +1 -0
  211. package/build/tabs/index.js.map +1 -1
  212. package/build/text/utils.js +1 -0
  213. package/build/text/utils.js.map +1 -1
  214. package/build/theme/color-algorithms.js +1 -0
  215. package/build/theme/color-algorithms.js.map +1 -1
  216. package/build/toggle-group-control/toggle-group-control/styles.js +7 -7
  217. package/build/toggle-group-control/toggle-group-control/styles.js.map +1 -1
  218. package/build/toggle-group-control/toggle-group-control-option-base/styles.js +8 -8
  219. package/build/toggle-group-control/toggle-group-control-option-base/styles.js.map +1 -1
  220. package/build/toolbar/toolbar-group/index.js +1 -0
  221. package/build/toolbar/toolbar-group/index.js.map +1 -1
  222. package/build/tools-panel/tools-panel/hook.js +1 -0
  223. package/build/tools-panel/tools-panel/hook.js.map +1 -1
  224. package/build/tools-panel/tools-panel-header/component.js +1 -0
  225. package/build/tools-panel/tools-panel-header/component.js.map +1 -1
  226. package/build/tree-grid/cell.js +4 -1
  227. package/build/tree-grid/cell.js.map +1 -1
  228. package/build/tree-grid/index.js +1 -0
  229. package/build/tree-grid/index.js.map +1 -1
  230. package/build/tree-grid/types.js.map +1 -1
  231. package/build/tree-select/index.js +1 -0
  232. package/build/tree-select/index.js.map +1 -1
  233. package/build/unit-control/index.js +1 -0
  234. package/build/unit-control/index.js.map +1 -1
  235. package/build/unit-control/index.native.js +1 -0
  236. package/build/unit-control/index.native.js.map +1 -1
  237. package/build/unit-control/unit-select-control.js +1 -0
  238. package/build/unit-control/unit-select-control.js.map +1 -1
  239. package/build/unit-control/utils.js +1 -0
  240. package/build/unit-control/utils.js.map +1 -1
  241. package/build/utils/colors-values.js +3 -0
  242. package/build/utils/colors-values.js.map +1 -1
  243. package/build/utils/config-values.js +0 -1
  244. package/build/utils/config-values.js.map +1 -1
  245. package/build/utils/get-valid-children.js +1 -0
  246. package/build/utils/get-valid-children.js.map +1 -1
  247. package/build/utils/hooks/use-animated-offset-rect.js +1 -0
  248. package/build/utils/hooks/use-animated-offset-rect.js.map +1 -1
  249. package/build/utils/hooks/use-cx.js +1 -0
  250. package/build/utils/hooks/use-cx.js.map +1 -1
  251. package/build/utils/math.js +1 -0
  252. package/build/utils/math.js.map +1 -1
  253. package/build/utils/rtl.js +1 -0
  254. package/build/utils/rtl.js.map +1 -1
  255. package/build/utils/values.js +1 -0
  256. package/build/utils/values.js.map +1 -1
  257. package/build/z-stack/component.js +1 -0
  258. package/build/z-stack/component.js.map +1 -1
  259. package/build-module/alignment-matrix-control/icon.js +1 -0
  260. package/build-module/alignment-matrix-control/icon.js.map +1 -1
  261. package/build-module/alignment-matrix-control/index.js +1 -0
  262. package/build-module/alignment-matrix-control/index.js.map +1 -1
  263. package/build-module/animation/index.js +1 -1
  264. package/build-module/animation/index.js.map +1 -1
  265. package/build-module/autocomplete/autocompleter-ui.js +1 -0
  266. package/build-module/autocomplete/autocompleter-ui.js.map +1 -1
  267. package/build-module/autocomplete/autocompleter-ui.native.js +1 -0
  268. package/build-module/autocomplete/autocompleter-ui.native.js.map +1 -1
  269. package/build-module/autocomplete/get-default-use-items.js +1 -0
  270. package/build-module/autocomplete/get-default-use-items.js.map +1 -1
  271. package/build-module/autocomplete/index.js +1 -0
  272. package/build-module/autocomplete/index.js.map +1 -1
  273. package/build-module/border-box-control/utils.js +1 -0
  274. package/build-module/border-box-control/utils.js.map +1 -1
  275. package/build-module/border-control/border-control-dropdown/component.js +1 -0
  276. package/build-module/border-control/border-control-dropdown/component.js.map +1 -1
  277. package/build-module/border-control/border-control-style-picker/component.js +1 -0
  278. package/build-module/border-control/border-control-style-picker/component.js.map +1 -1
  279. package/build-module/box-control/index.js +15 -15
  280. package/build-module/box-control/index.js.map +1 -1
  281. package/build-module/box-control/input-control.js +153 -0
  282. package/build-module/box-control/input-control.js.map +1 -0
  283. package/build-module/box-control/types.js.map +1 -1
  284. package/build-module/box-control/utils.js +48 -46
  285. package/build-module/box-control/utils.js.map +1 -1
  286. package/build-module/button/index.native.js +1 -0
  287. package/build-module/button/index.native.js.map +1 -1
  288. package/build-module/button/types.js.map +1 -1
  289. package/build-module/color-indicator/index.native.js +1 -0
  290. package/build-module/color-indicator/index.native.js.map +1 -1
  291. package/build-module/color-palette/index.js +1 -0
  292. package/build-module/color-palette/index.js.map +1 -1
  293. package/build-module/color-palette/index.native.js +1 -0
  294. package/build-module/color-palette/index.native.js.map +1 -1
  295. package/build-module/color-palette/utils.js +1 -0
  296. package/build-module/color-palette/utils.js.map +1 -1
  297. package/build-module/combobox-control/index.js +1 -0
  298. package/build-module/combobox-control/index.js.map +1 -1
  299. package/build-module/composite/legacy/index.js +1 -0
  300. package/build-module/composite/legacy/index.js.map +1 -1
  301. package/build-module/context/context-connect.js +1 -0
  302. package/build-module/context/context-connect.js.map +1 -1
  303. package/build-module/custom-gradient-picker/gradient-bar/control-points.js +1 -0
  304. package/build-module/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
  305. package/build-module/custom-gradient-picker/gradient-bar/index.js +1 -0
  306. package/build-module/custom-gradient-picker/gradient-bar/index.js.map +1 -1
  307. package/build-module/custom-gradient-picker/gradient-bar/utils.js +1 -0
  308. package/build-module/custom-gradient-picker/gradient-bar/utils.js.map +1 -1
  309. package/build-module/custom-gradient-picker/index.js +1 -0
  310. package/build-module/custom-gradient-picker/index.js.map +1 -1
  311. package/build-module/custom-gradient-picker/serializer.js +1 -0
  312. package/build-module/custom-gradient-picker/serializer.js.map +1 -1
  313. package/build-module/custom-gradient-picker/utils.js +1 -0
  314. package/build-module/custom-gradient-picker/utils.js.map +1 -1
  315. package/build-module/custom-select-control/index.js +3 -2
  316. package/build-module/custom-select-control/index.js.map +1 -1
  317. package/build-module/dashicon/index.js +1 -0
  318. package/build-module/dashicon/index.js.map +1 -1
  319. package/build-module/date-time/date/index.js +1 -0
  320. package/build-module/date-time/date/index.js.map +1 -1
  321. package/build-module/date-time/date/use-lilius/index.js +1 -0
  322. package/build-module/date-time/date/use-lilius/index.js.map +1 -1
  323. package/build-module/date-time/time/index.js +1 -0
  324. package/build-module/date-time/time/index.js.map +1 -1
  325. package/build-module/dimension-control/index.js +1 -0
  326. package/build-module/dimension-control/index.js.map +1 -1
  327. package/build-module/dimension-control/sizes.js +1 -0
  328. package/build-module/dimension-control/sizes.js.map +1 -1
  329. package/build-module/draggable/index.js +1 -0
  330. package/build-module/draggable/index.js.map +1 -1
  331. package/build-module/draggable/index.native.js +1 -0
  332. package/build-module/draggable/index.native.js.map +1 -1
  333. package/build-module/dropdown-menu/index.js +1 -0
  334. package/build-module/dropdown-menu/index.js.map +1 -1
  335. package/build-module/dropdown-menu/index.native.js +1 -0
  336. package/build-module/dropdown-menu/index.native.js.map +1 -1
  337. package/build-module/duotone-picker/color-list-picker/index.js +1 -0
  338. package/build-module/duotone-picker/color-list-picker/index.js.map +1 -1
  339. package/build-module/duotone-picker/duotone-picker.js +1 -0
  340. package/build-module/duotone-picker/duotone-picker.js.map +1 -1
  341. package/build-module/duotone-picker/utils.js +1 -0
  342. package/build-module/duotone-picker/utils.js.map +1 -1
  343. package/build-module/external-link/index.js +1 -0
  344. package/build-module/external-link/index.js.map +1 -1
  345. package/build-module/font-size-picker/font-size-picker-select.js +1 -0
  346. package/build-module/font-size-picker/font-size-picker-select.js.map +1 -1
  347. package/build-module/font-size-picker/font-size-picker-toggle-group.js +1 -0
  348. package/build-module/font-size-picker/font-size-picker-toggle-group.js.map +1 -1
  349. package/build-module/font-size-picker/index.js +1 -0
  350. package/build-module/font-size-picker/index.js.map +1 -1
  351. package/build-module/font-size-picker/index.native.js +1 -0
  352. package/build-module/font-size-picker/index.native.js.map +1 -1
  353. package/build-module/font-size-picker/utils.js +1 -0
  354. package/build-module/font-size-picker/utils.js.map +1 -1
  355. package/build-module/form-token-field/index.js +1 -0
  356. package/build-module/form-token-field/index.js.map +1 -1
  357. package/build-module/form-token-field/suggestions-list.js +1 -0
  358. package/build-module/form-token-field/suggestions-list.js.map +1 -1
  359. package/build-module/gradient-picker/index.js +1 -0
  360. package/build-module/gradient-picker/index.js.map +1 -1
  361. package/build-module/guide/index.js +1 -0
  362. package/build-module/guide/index.js.map +1 -1
  363. package/build-module/guide/page-control.js +1 -0
  364. package/build-module/guide/page-control.js.map +1 -1
  365. package/build-module/h-stack/hook.js +1 -0
  366. package/build-module/h-stack/hook.js.map +1 -1
  367. package/build-module/higher-order/navigate-regions/index.js +1 -0
  368. package/build-module/higher-order/navigate-regions/index.js.map +1 -1
  369. package/build-module/higher-order/with-fallback-styles/index.js +1 -0
  370. package/build-module/higher-order/with-fallback-styles/index.js.map +1 -1
  371. package/build-module/higher-order/with-filters/index.js +1 -0
  372. package/build-module/higher-order/with-filters/index.js.map +1 -1
  373. package/build-module/higher-order/with-notices/index.js +1 -0
  374. package/build-module/higher-order/with-notices/index.js.map +1 -1
  375. package/build-module/index.js +1 -1
  376. package/build-module/index.js.map +1 -1
  377. package/build-module/keyboard-shortcuts/index.js +1 -0
  378. package/build-module/keyboard-shortcuts/index.js.map +1 -1
  379. package/build-module/menu/styles.js +16 -16
  380. package/build-module/menu/styles.js.map +1 -1
  381. package/build-module/menu-items-choice/index.js +1 -0
  382. package/build-module/menu-items-choice/index.js.map +1 -1
  383. package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js +1 -0
  384. package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js.map +1 -1
  385. package/build-module/mobile/bottom-sheet/keyboard-avoiding-view.native.js +1 -0
  386. package/build-module/mobile/bottom-sheet/keyboard-avoiding-view.native.js.map +1 -1
  387. package/build-module/mobile/bottom-sheet/picker-cell.native.js +1 -0
  388. package/build-module/mobile/bottom-sheet/picker-cell.native.js.map +1 -1
  389. package/build-module/mobile/bottom-sheet-select-control/index.native.js +1 -0
  390. package/build-module/mobile/bottom-sheet-select-control/index.native.js.map +1 -1
  391. package/build-module/mobile/color-settings/palette.screen.native.js +1 -0
  392. package/build-module/mobile/color-settings/palette.screen.native.js.map +1 -1
  393. package/build-module/mobile/gradient/index.native.js +1 -0
  394. package/build-module/mobile/gradient/index.native.js.map +1 -1
  395. package/build-module/mobile/media-edit/index.native.js +1 -0
  396. package/build-module/mobile/media-edit/index.native.js.map +1 -1
  397. package/build-module/mobile/picker/index.android.js +1 -0
  398. package/build-module/mobile/picker/index.android.js.map +1 -1
  399. package/build-module/mobile/picker/index.ios.js +1 -0
  400. package/build-module/mobile/picker/index.ios.js.map +1 -1
  401. package/build-module/mobile/segmented-control/index.native.js +1 -0
  402. package/build-module/mobile/segmented-control/index.native.js.map +1 -1
  403. package/build-module/mobile/utils/get-px-from-css-unit.native.js +1 -0
  404. package/build-module/mobile/utils/get-px-from-css-unit.native.js.map +1 -1
  405. package/build-module/navigable-container/container.js +1 -0
  406. package/build-module/navigable-container/container.js.map +1 -1
  407. package/build-module/navigation/group/index.js +1 -0
  408. package/build-module/navigation/group/index.js.map +1 -1
  409. package/build-module/navigation/menu/menu-title-search.js +1 -0
  410. package/build-module/navigation/menu/menu-title-search.js.map +1 -1
  411. package/build-module/navigation/menu/search-no-results-found.js +1 -0
  412. package/build-module/navigation/menu/search-no-results-found.js.map +1 -1
  413. package/build-module/navigation/styles/navigation-styles.js +12 -12
  414. package/build-module/navigation/styles/navigation-styles.js.map +1 -1
  415. package/build-module/navigator/navigator/component.js +1 -0
  416. package/build-module/navigator/navigator/component.js.map +1 -1
  417. package/build-module/navigator/navigator-screen/component.js +1 -0
  418. package/build-module/navigator/navigator-screen/component.js.map +1 -1
  419. package/build-module/navigator/utils/router.js +1 -0
  420. package/build-module/navigator/utils/router.js.map +1 -1
  421. package/build-module/notice/index.js +1 -0
  422. package/build-module/notice/index.js.map +1 -1
  423. package/build-module/notice/list.js +1 -0
  424. package/build-module/notice/list.js.map +1 -1
  425. package/build-module/notice/list.native.js +1 -0
  426. package/build-module/notice/list.native.js.map +1 -1
  427. package/build-module/palette-edit/index.js +1 -0
  428. package/build-module/palette-edit/index.js.map +1 -1
  429. package/build-module/panel/actions.native.js +1 -0
  430. package/build-module/panel/actions.native.js.map +1 -1
  431. package/build-module/query-controls/index.js +1 -0
  432. package/build-module/query-controls/index.js.map +1 -1
  433. package/build-module/query-controls/terms.js +1 -0
  434. package/build-module/query-controls/terms.js.map +1 -1
  435. package/build-module/radio-control/index.js +1 -0
  436. package/build-module/radio-control/index.js.map +1 -1
  437. package/build-module/radio-control/index.native.js +1 -0
  438. package/build-module/radio-control/index.native.js.map +1 -1
  439. package/build-module/range-control/mark.js +0 -1
  440. package/build-module/range-control/mark.js.map +1 -1
  441. package/build-module/range-control/rail.js +1 -0
  442. package/build-module/range-control/rail.js.map +1 -1
  443. package/build-module/range-control/styles/range-control-styles.js +33 -45
  444. package/build-module/range-control/styles/range-control-styles.js.map +1 -1
  445. package/build-module/resizable-box/index.js +1 -0
  446. package/build-module/resizable-box/index.js.map +1 -1
  447. package/build-module/sandbox/index.js +1 -0
  448. package/build-module/sandbox/index.js.map +1 -1
  449. package/build-module/sandbox/index.native.js +1 -0
  450. package/build-module/sandbox/index.native.js.map +1 -1
  451. package/build-module/search-control/index.native.js +1 -0
  452. package/build-module/search-control/index.native.js.map +1 -1
  453. package/build-module/select-control/index.js +1 -0
  454. package/build-module/select-control/index.js.map +1 -1
  455. package/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js +1 -0
  456. package/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js.map +1 -1
  457. package/build-module/slot-fill/provider.js +1 -0
  458. package/build-module/slot-fill/provider.js.map +1 -1
  459. package/build-module/slot-fill/slot.js +1 -0
  460. package/build-module/slot-fill/slot.js.map +1 -1
  461. package/build-module/snackbar/index.js +1 -0
  462. package/build-module/snackbar/index.js.map +1 -1
  463. package/build-module/snackbar/list.js +1 -0
  464. package/build-module/snackbar/list.js.map +1 -1
  465. package/build-module/tab-panel/index.js +1 -0
  466. package/build-module/tab-panel/index.js.map +1 -1
  467. package/build-module/tabs/index.js +1 -0
  468. package/build-module/tabs/index.js.map +1 -1
  469. package/build-module/text/utils.js +1 -0
  470. package/build-module/text/utils.js.map +1 -1
  471. package/build-module/theme/color-algorithms.js +1 -0
  472. package/build-module/theme/color-algorithms.js.map +1 -1
  473. package/build-module/toggle-group-control/toggle-group-control/styles.js +7 -7
  474. package/build-module/toggle-group-control/toggle-group-control/styles.js.map +1 -1
  475. package/build-module/toggle-group-control/toggle-group-control-option-base/styles.js +8 -8
  476. package/build-module/toggle-group-control/toggle-group-control-option-base/styles.js.map +1 -1
  477. package/build-module/toolbar/toolbar-group/index.js +1 -0
  478. package/build-module/toolbar/toolbar-group/index.js.map +1 -1
  479. package/build-module/tools-panel/tools-panel/hook.js +1 -0
  480. package/build-module/tools-panel/tools-panel/hook.js.map +1 -1
  481. package/build-module/tools-panel/tools-panel-header/component.js +1 -0
  482. package/build-module/tools-panel/tools-panel-header/component.js.map +1 -1
  483. package/build-module/tree-grid/cell.js +4 -1
  484. package/build-module/tree-grid/cell.js.map +1 -1
  485. package/build-module/tree-grid/index.js +1 -0
  486. package/build-module/tree-grid/index.js.map +1 -1
  487. package/build-module/tree-grid/types.js.map +1 -1
  488. package/build-module/tree-select/index.js +1 -0
  489. package/build-module/tree-select/index.js.map +1 -1
  490. package/build-module/unit-control/index.js +1 -0
  491. package/build-module/unit-control/index.js.map +1 -1
  492. package/build-module/unit-control/index.native.js +1 -0
  493. package/build-module/unit-control/index.native.js.map +1 -1
  494. package/build-module/unit-control/unit-select-control.js +1 -0
  495. package/build-module/unit-control/unit-select-control.js.map +1 -1
  496. package/build-module/unit-control/utils.js +1 -0
  497. package/build-module/unit-control/utils.js.map +1 -1
  498. package/build-module/utils/colors-values.js +3 -0
  499. package/build-module/utils/colors-values.js.map +1 -1
  500. package/build-module/utils/config-values.js +0 -1
  501. package/build-module/utils/config-values.js.map +1 -1
  502. package/build-module/utils/get-valid-children.js +1 -0
  503. package/build-module/utils/get-valid-children.js.map +1 -1
  504. package/build-module/utils/hooks/use-animated-offset-rect.js +1 -0
  505. package/build-module/utils/hooks/use-animated-offset-rect.js.map +1 -1
  506. package/build-module/utils/hooks/use-cx.js +1 -0
  507. package/build-module/utils/hooks/use-cx.js.map +1 -1
  508. package/build-module/utils/math.js +1 -0
  509. package/build-module/utils/math.js.map +1 -1
  510. package/build-module/utils/rtl.js +1 -0
  511. package/build-module/utils/rtl.js.map +1 -1
  512. package/build-module/utils/values.js +1 -0
  513. package/build-module/utils/values.js.map +1 -1
  514. package/build-module/z-stack/component.js +1 -0
  515. package/build-module/z-stack/component.js.map +1 -1
  516. package/build-style/style-rtl.css +3 -3
  517. package/build-style/style.css +3 -3
  518. package/build-types/alignment-matrix-control/styles.d.ts.map +1 -1
  519. package/build-types/angle-picker-control/styles/angle-picker-control-styles.d.ts.map +1 -1
  520. package/build-types/animation/index.d.ts +1 -1
  521. package/build-types/animation/index.d.ts.map +1 -1
  522. package/build-types/base-control/hooks.d.ts +4 -4
  523. package/build-types/base-control/styles/base-control-styles.d.ts.map +1 -1
  524. package/build-types/border-box-control/border-box-control/hook.d.ts +83 -83
  525. package/build-types/border-box-control/border-box-control-linked-button/hook.d.ts +93 -93
  526. package/build-types/border-box-control/border-box-control-split-controls/hook.d.ts +83 -83
  527. package/build-types/border-box-control/border-box-control-visualizer/hook.d.ts +83 -83
  528. package/build-types/border-control/border-control/hook.d.ts +83 -83
  529. package/build-types/border-control/border-control-dropdown/hook.d.ts +83 -83
  530. package/build-types/border-control/stories/index.story.d.ts.map +1 -1
  531. package/build-types/box-control/index.d.ts.map +1 -1
  532. package/build-types/box-control/input-control.d.ts +3 -0
  533. package/build-types/box-control/input-control.d.ts.map +1 -0
  534. package/build-types/box-control/stories/index.story.d.ts +816 -816
  535. package/build-types/box-control/stories/index.story.d.ts.map +1 -1
  536. package/build-types/box-control/styles/box-control-icon-styles.d.ts.map +1 -1
  537. package/build-types/box-control/types.d.ts +9 -1
  538. package/build-types/box-control/types.d.ts.map +1 -1
  539. package/build-types/box-control/utils.d.ts +23 -15
  540. package/build-types/box-control/utils.d.ts.map +1 -1
  541. package/build-types/button/stories/index.story.d.ts +18 -0
  542. package/build-types/button/stories/index.story.d.ts.map +1 -1
  543. package/build-types/button/types.d.ts +6 -4
  544. package/build-types/button/types.d.ts.map +1 -1
  545. package/build-types/card/card/hook.d.ts +83 -83
  546. package/build-types/card/card-body/hook.d.ts +83 -83
  547. package/build-types/card/card-divider/hook.d.ts +84 -84
  548. package/build-types/card/card-footer/hook.d.ts +83 -83
  549. package/build-types/card/card-header/hook.d.ts +83 -83
  550. package/build-types/card/card-media/hook.d.ts +83 -83
  551. package/build-types/color-picker/styles.d.ts.map +1 -1
  552. package/build-types/combobox-control/stories/index.story.d.ts.map +1 -1
  553. package/build-types/composite/index.d.ts.map +1 -1
  554. package/build-types/context/constants.d.ts.map +1 -1
  555. package/build-types/context/get-styled-class-name-from-key.d.ts +1 -9
  556. package/build-types/context/get-styled-class-name-from-key.d.ts.map +1 -1
  557. package/build-types/custom-select-control-v2/stories/index.story.d.ts.map +1 -1
  558. package/build-types/custom-select-control-v2/styles.d.ts.map +1 -1
  559. package/build-types/date-time/date/styles.d.ts.map +1 -1
  560. package/build-types/date-time/stories/date-time.story.d.ts.map +1 -1
  561. package/build-types/date-time/stories/date.story.d.ts.map +1 -1
  562. package/build-types/date-time/stories/time.story.d.ts.map +1 -1
  563. package/build-types/date-time/time/styles.d.ts.map +1 -1
  564. package/build-types/dimension-control/stories/index.story.d.ts.map +1 -1
  565. package/build-types/dropdown-menu/index.d.ts.map +1 -1
  566. package/build-types/elevation/hook.d.ts +83 -83
  567. package/build-types/flex/flex/hook.d.ts +83 -83
  568. package/build-types/flex/flex-block/hook.d.ts +83 -83
  569. package/build-types/flex/flex-item/hook.d.ts +83 -83
  570. package/build-types/focal-point-picker/stories/index.story.d.ts.map +1 -1
  571. package/build-types/focal-point-picker/styles/focal-point-picker-style.d.ts.map +1 -1
  572. package/build-types/font-size-picker/styles.d.ts.map +1 -1
  573. package/build-types/grid/hook.d.ts +83 -83
  574. package/build-types/h-stack/hook.d.ts +83 -83
  575. package/build-types/heading/hook.d.ts +82 -82
  576. package/build-types/higher-order/with-fallback-styles/index.d.ts +2 -2
  577. package/build-types/higher-order/with-filters/index.d.ts +4 -4
  578. package/build-types/index.d.ts +1 -1
  579. package/build-types/index.d.ts.map +1 -1
  580. package/build-types/input-control/styles/input-control-styles.d.ts.map +1 -1
  581. package/build-types/item-group/item/hook.d.ts +83 -83
  582. package/build-types/item-group/item-group/hook.d.ts +83 -83
  583. package/build-types/menu/styles.d.ts.map +1 -1
  584. package/build-types/menu-item/stories/index.story.d.ts.map +1 -1
  585. package/build-types/navigation/styles/navigation-styles.d.ts.map +1 -1
  586. package/build-types/navigator/navigator-back-button/hook.d.ts +92 -92
  587. package/build-types/navigator/navigator-button/hook.d.ts +92 -92
  588. package/build-types/popover/stories/index.story.d.ts.map +1 -1
  589. package/build-types/progress-bar/styles.d.ts.map +1 -1
  590. package/build-types/range-control/mark.d.ts.map +1 -1
  591. package/build-types/range-control/styles/range-control-styles.d.ts +2 -2
  592. package/build-types/range-control/styles/range-control-styles.d.ts.map +1 -1
  593. package/build-types/resizable-box/resize-tooltip/styles/resize-tooltip.styles.d.ts.map +1 -1
  594. package/build-types/resizable-box/stories/index.story.d.ts.map +1 -1
  595. package/build-types/scrollable/hook.d.ts +83 -83
  596. package/build-types/scrollable/stories/index.story.d.ts.map +1 -1
  597. package/build-types/select-control/index.d.ts.map +1 -1
  598. package/build-types/select-control/stories/index.story.d.ts.map +1 -1
  599. package/build-types/select-control/styles/select-control-styles.d.ts.map +1 -1
  600. package/build-types/spacer/hook.d.ts +83 -83
  601. package/build-types/spinner/styles.d.ts.map +1 -1
  602. package/build-types/surface/hook.d.ts +83 -83
  603. package/build-types/text/hook.d.ts +83 -83
  604. package/build-types/toggle-group-control/toggle-group-control-option-base/styles.d.ts.map +1 -1
  605. package/build-types/tools-panel/tools-panel/hook.d.ts +83 -83
  606. package/build-types/tools-panel/tools-panel-header/hook.d.ts +83 -83
  607. package/build-types/tools-panel/tools-panel-item/hook.d.ts +83 -83
  608. package/build-types/tree-grid/cell.d.ts.map +1 -1
  609. package/build-types/tree-grid/types.d.ts +1 -1
  610. package/build-types/tree-grid/types.d.ts.map +1 -1
  611. package/build-types/truncate/hook.d.ts +83 -83
  612. package/build-types/unit-control/styles/unit-control-styles.d.ts.map +1 -1
  613. package/build-types/utils/colors-values.d.ts +3 -0
  614. package/build-types/utils/colors-values.d.ts.map +1 -1
  615. package/build-types/utils/config-values.d.ts +0 -1
  616. package/build-types/utils/hooks/use-controlled-state.d.ts +1 -1
  617. package/build-types/utils/hooks/use-controlled-state.d.ts.map +1 -1
  618. package/build-types/utils/rtl.d.ts +1 -1
  619. package/build-types/utils/rtl.d.ts.map +1 -1
  620. package/build-types/v-stack/hook.d.ts +83 -83
  621. package/build-types/z-stack/styles.d.ts.map +1 -1
  622. package/package.json +19 -19
  623. package/src/alignment-matrix-control/stories/index.story.tsx +2 -2
  624. package/src/angle-picker-control/stories/index.story.tsx +2 -2
  625. package/src/animation/index.tsx +0 -1
  626. package/src/base-control/stories/index.story.tsx +1 -1
  627. package/src/border-box-control/stories/index.story.tsx +1 -1
  628. package/src/border-control/stories/index.story.tsx +1 -1
  629. package/src/box-control/index.tsx +24 -14
  630. package/src/box-control/input-control.tsx +197 -0
  631. package/src/box-control/stories/index.story.tsx +1 -1
  632. package/src/box-control/types.ts +9 -1
  633. package/src/box-control/utils.ts +62 -60
  634. package/src/button/README.md +108 -219
  635. package/src/button/docs-manifest.json +5 -0
  636. package/src/button/stories/best-practices.mdx +31 -0
  637. package/src/button/stories/index.story.tsx +18 -0
  638. package/src/button/types.ts +6 -4
  639. package/src/button-group/stories/index.story.tsx +1 -1
  640. package/src/card/stories/index.story.tsx +2 -2
  641. package/src/checkbox-control/stories/index.story.tsx +1 -1
  642. package/src/circular-option-picker/stories/index.story.tsx +2 -2
  643. package/src/color-palette/stories/index.story.tsx +3 -3
  644. package/src/color-picker/stories/index.story.tsx +2 -2
  645. package/src/combobox-control/stories/index.story.tsx +1 -1
  646. package/src/composite/stories/index.story.tsx +3 -3
  647. package/src/confirm-dialog/stories/index.story.tsx +1 -1
  648. package/src/custom-select-control/index.tsx +2 -2
  649. package/src/custom-select-control/stories/index.story.tsx +2 -2
  650. package/src/custom-select-control-v2/stories/index.story.tsx +2 -2
  651. package/src/date-time/stories/date-time.story.tsx +4 -1
  652. package/src/date-time/stories/date.story.tsx +4 -1
  653. package/src/date-time/stories/time.story.tsx +4 -1
  654. package/src/dimension-control/stories/index.story.tsx +1 -1
  655. package/src/disabled/stories/index.story.tsx +3 -3
  656. package/src/divider/stories/index.story.tsx +1 -1
  657. package/src/draggable/stories/index.story.tsx +2 -2
  658. package/src/dropdown/stories/index.story.tsx +7 -7
  659. package/src/dropdown-menu/index.tsx +3 -1
  660. package/src/dropdown-menu/stories/index.story.tsx +3 -3
  661. package/src/duotone-picker/stories/duotone-picker.story.tsx +1 -1
  662. package/src/flex/stories/index.story.tsx +1 -1
  663. package/src/font-size-picker/stories/index.story.tsx +1 -1
  664. package/src/form-file-upload/stories/index.story.tsx +3 -3
  665. package/src/form-token-field/stories/index.story.tsx +2 -2
  666. package/src/gradient-picker/stories/index.story.tsx +1 -1
  667. package/src/grid/stories/index.story.tsx +1 -1
  668. package/src/h-stack/stories/index.story.tsx +2 -2
  669. package/src/index.ts +1 -5
  670. package/src/input-control/stories/index.story.tsx +4 -4
  671. package/src/item-group/stories/index.story.tsx +2 -2
  672. package/src/menu/stories/index.story.tsx +2 -2
  673. package/src/menu/styles.ts +1 -1
  674. package/src/menu-group/stories/index.story.tsx +1 -1
  675. package/src/menu-item/stories/index.story.tsx +1 -1
  676. package/src/menu-items-choice/stories/index.story.tsx +1 -1
  677. package/src/modal/stories/index.story.tsx +2 -2
  678. package/src/modal/test/index.tsx +2 -1
  679. package/src/navigable-container/stories/navigable-menu.story.tsx +1 -1
  680. package/src/navigable-container/stories/tabbable-container.story.tsx +1 -1
  681. package/src/navigation/stories/index.story.tsx +4 -4
  682. package/src/navigation/styles/navigation-styles.tsx +3 -2
  683. package/src/navigator/stories/index.story.tsx +3 -3
  684. package/src/number-control/stories/index.story.tsx +1 -1
  685. package/src/panel/stories/index.story.tsx +1 -1
  686. package/src/placeholder/stories/index.story.tsx +3 -3
  687. package/src/popover/stories/index.story.tsx +11 -9
  688. package/src/query-controls/stories/index.story.tsx +6 -6
  689. package/src/radio-control/stories/index.story.tsx +1 -1
  690. package/src/radio-group/stories/index.story.tsx +3 -3
  691. package/src/range-control/mark.tsx +0 -1
  692. package/src/range-control/stories/index.story.tsx +7 -7
  693. package/src/range-control/styles/range-control-styles.ts +18 -19
  694. package/src/resizable-box/stories/index.story.tsx +1 -1
  695. package/src/responsive-wrapper/stories/index.story.tsx +1 -1
  696. package/src/sandbox/stories/index.story.tsx +1 -1
  697. package/src/scrollable/stories/index.story.tsx +2 -1
  698. package/src/search-control/stories/index.story.tsx +1 -1
  699. package/src/select-control/stories/index.story.tsx +1 -1
  700. package/src/slot-fill/stories/index.story.tsx +2 -2
  701. package/src/snackbar/stories/index.story.tsx +4 -4
  702. package/src/snackbar/stories/list.story.tsx +2 -2
  703. package/src/surface/stories/index.story.tsx +1 -1
  704. package/src/text-control/stories/index.story.tsx +1 -1
  705. package/src/textarea-control/stories/index.story.tsx +1 -1
  706. package/src/theme/stories/index.story.tsx +1 -1
  707. package/src/toggle-control/stories/index.story.tsx +1 -1
  708. package/src/toggle-group-control/stories/index.story.tsx +1 -1
  709. package/src/toggle-group-control/test/__snapshots__/index.tsx.snap +22 -22
  710. package/src/toggle-group-control/toggle-group-control/styles.ts +1 -1
  711. package/src/toggle-group-control/toggle-group-control-option-base/styles.ts +6 -6
  712. package/src/toolbar/stories/index.story.tsx +1 -1
  713. package/src/tools-panel/stories/index.story.tsx +3 -3
  714. package/src/tools-panel/test/index.tsx +0 -17
  715. package/src/tooltip/stories/index.story.tsx +1 -1
  716. package/src/tree-grid/cell.tsx +5 -1
  717. package/src/tree-grid/stories/index.story.tsx +1 -1
  718. package/src/tree-grid/types.ts +1 -1
  719. package/src/tree-select/stories/index.story.tsx +1 -1
  720. package/src/unit-control/stories/index.story.tsx +4 -4
  721. package/src/utils/colors-values.js +3 -0
  722. package/src/utils/config-values.js +0 -1
  723. package/src/view/stories/index.story.tsx +1 -1
  724. package/src/visually-hidden/stories/index.story.tsx +1 -1
  725. package/src/z-stack/stories/index.story.tsx +1 -1
  726. package/tsconfig.tsbuildinfo +1 -1
  727. package/build/box-control/all-input-control.js +0 -91
  728. package/build/box-control/all-input-control.js.map +0 -1
  729. package/build/box-control/axial-input-controls.js +0 -125
  730. package/build/box-control/axial-input-controls.js.map +0 -1
  731. package/build/box-control/input-controls.js +0 -133
  732. package/build/box-control/input-controls.js.map +0 -1
  733. package/build-module/box-control/all-input-control.js +0 -84
  734. package/build-module/box-control/all-input-control.js.map +0 -1
  735. package/build-module/box-control/axial-input-controls.js +0 -116
  736. package/build-module/box-control/axial-input-controls.js.map +0 -1
  737. package/build-module/box-control/input-controls.js +0 -124
  738. package/build-module/box-control/input-controls.js.map +0 -1
  739. package/build-types/box-control/all-input-control.d.ts +0 -3
  740. package/build-types/box-control/all-input-control.d.ts.map +0 -1
  741. package/build-types/box-control/axial-input-controls.d.ts +0 -3
  742. package/build-types/box-control/axial-input-controls.d.ts.map +0 -1
  743. package/build-types/box-control/input-controls.d.ts +0 -3
  744. package/build-types/box-control/input-controls.d.ts.map +0 -1
  745. package/src/box-control/all-input-control.tsx +0 -110
  746. package/src/box-control/axial-input-controls.tsx +0 -165
  747. package/src/box-control/input-controls.tsx +0 -167
@@ -1 +1 @@
1
- {"version":3,"names":["_compose","require","_element","_jsxRuntime","dragImageClass","cloneWrapperClass","clonePadding","bodyClass","Draggable","children","onDragStart","onDragOver","onDragEnd","appendToOwnerDocument","cloneClassname","elementId","transferData","__experimentalTransferDataType","transferDataType","__experimentalDragComponent","dragComponent","dragComponentRef","useRef","cleanupRef","end","event","preventDefault","current","start","ownerDocument","target","dataTransfer","setData","JSON","stringify","cloneWrapper","createElement","style","top","left","dragImage","setDragImage","classList","add","body","appendChild","x","y","clientX","clientY","transform","clonedDragComponent","innerHTML","element","getElementById","elementRect","getBoundingClientRect","elementWrapper","parentNode","elementTopOffset","elementLeftOffset","width","clone","cloneNode","id","Array","from","querySelectorAll","forEach","child","removeChild","cursorLeft","cursorTop","over","e","nextX","nextY","throttledDragOver","throttle","addEventListener","remove","removeEventListener","useEffect","jsxs","Fragment","onDraggableStart","onDraggableEnd","jsx","className","display","ref","_default","exports","default"],"sources":["@wordpress/components/src/draggable/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { DragEvent } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { throttle } from '@wordpress/compose';\nimport { useEffect, useRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { DraggableProps } from './types';\n\nconst dragImageClass = 'components-draggable__invisible-drag-image';\nconst cloneWrapperClass = 'components-draggable__clone';\nconst clonePadding = 0;\nconst bodyClass = 'is-dragging-components-draggable';\n\n/**\n * `Draggable` is a Component that provides a way to set up a cross-browser\n * (including IE) customizable drag image and the transfer data for the drag\n * event. It decouples the drag handle and the element to drag: use it by\n * wrapping the component that will become the drag handle and providing the DOM\n * ID of the element to drag.\n *\n * Note that the drag handle needs to declare the `draggable=\"true\"` property\n * and bind the `Draggable`s `onDraggableStart` and `onDraggableEnd` event\n * handlers to its own `onDragStart` and `onDragEnd` respectively. `Draggable`\n * takes care of the logic to setup the drag image and the transfer data, but is\n * not concerned with creating an actual DOM element that is draggable.\n *\n * ```jsx\n * import { Draggable, Panel, PanelBody } from '@wordpress/components';\n * import { Icon, more } from '@wordpress/icons';\n *\n * const MyDraggable = () => (\n * <div id=\"draggable-panel\">\n * <Panel header=\"Draggable panel\">\n * <PanelBody>\n * <Draggable elementId=\"draggable-panel\" transferData={ {} }>\n * { ( { onDraggableStart, onDraggableEnd } ) => (\n * <div\n * className=\"example-drag-handle\"\n * draggable\n * onDragStart={ onDraggableStart }\n * onDragEnd={ onDraggableEnd }\n * >\n * <Icon icon={ more } />\n * </div>\n * ) }\n * </Draggable>\n * </PanelBody>\n * </Panel>\n * </div>\n * );\n * ```\n */\nexport function Draggable( {\n\tchildren,\n\tonDragStart,\n\tonDragOver,\n\tonDragEnd,\n\tappendToOwnerDocument = false,\n\tcloneClassname,\n\telementId,\n\ttransferData,\n\t__experimentalTransferDataType: transferDataType = 'text',\n\t__experimentalDragComponent: dragComponent,\n}: DraggableProps ) {\n\tconst dragComponentRef = useRef< HTMLDivElement >( null );\n\tconst cleanupRef = useRef( () => {} );\n\n\t/**\n\t * Removes the element clone, resets cursor, and removes drag listener.\n\t *\n\t * @param event The non-custom DragEvent.\n\t */\n\tfunction end( event: DragEvent ) {\n\t\tevent.preventDefault();\n\t\tcleanupRef.current();\n\n\t\tif ( onDragEnd ) {\n\t\t\tonDragEnd( event );\n\t\t}\n\t}\n\n\t/**\n\t * This method does a couple of things:\n\t *\n\t * - Clones the current element and spawns clone over original element.\n\t * - Adds a fake temporary drag image to avoid browser defaults.\n\t * - Sets transfer data.\n\t * - Adds dragover listener.\n\t *\n\t * @param event The non-custom DragEvent.\n\t */\n\tfunction start( event: DragEvent ) {\n\t\tconst { ownerDocument } = event.target as HTMLElement;\n\n\t\tevent.dataTransfer.setData(\n\t\t\ttransferDataType,\n\t\t\tJSON.stringify( transferData )\n\t\t);\n\n\t\tconst cloneWrapper = ownerDocument.createElement( 'div' );\n\t\t// Reset position to 0,0. Natural stacking order will position this lower, even with a transform otherwise.\n\t\tcloneWrapper.style.top = '0';\n\t\tcloneWrapper.style.left = '0';\n\n\t\tconst dragImage = ownerDocument.createElement( 'div' );\n\n\t\t// Set a fake drag image to avoid browser defaults. Remove from DOM\n\t\t// right after. event.dataTransfer.setDragImage is not supported yet in\n\t\t// IE, we need to check for its existence first.\n\t\tif ( 'function' === typeof event.dataTransfer.setDragImage ) {\n\t\t\tdragImage.classList.add( dragImageClass );\n\t\t\townerDocument.body.appendChild( dragImage );\n\t\t\tevent.dataTransfer.setDragImage( dragImage, 0, 0 );\n\t\t}\n\n\t\tcloneWrapper.classList.add( cloneWrapperClass );\n\n\t\tif ( cloneClassname ) {\n\t\t\tcloneWrapper.classList.add( cloneClassname );\n\t\t}\n\n\t\tlet x = 0;\n\t\tlet y = 0;\n\t\t// If a dragComponent is defined, the following logic will clone the\n\t\t// HTML node and inject it into the cloneWrapper.\n\t\tif ( dragComponentRef.current ) {\n\t\t\t// Position dragComponent at the same position as the cursor.\n\t\t\tx = event.clientX;\n\t\t\ty = event.clientY;\n\t\t\tcloneWrapper.style.transform = `translate( ${ x }px, ${ y }px )`;\n\n\t\t\tconst clonedDragComponent = ownerDocument.createElement( 'div' );\n\t\t\tclonedDragComponent.innerHTML = dragComponentRef.current.innerHTML;\n\t\t\tcloneWrapper.appendChild( clonedDragComponent );\n\n\t\t\t// Inject the cloneWrapper into the DOM.\n\t\t\townerDocument.body.appendChild( cloneWrapper );\n\t\t} else {\n\t\t\tconst element = ownerDocument.getElementById(\n\t\t\t\telementId\n\t\t\t) as HTMLElement;\n\n\t\t\t// Prepare element clone and append to element wrapper.\n\t\t\tconst elementRect = element.getBoundingClientRect();\n\t\t\tconst elementWrapper = element.parentNode;\n\t\t\tconst elementTopOffset = elementRect.top;\n\t\t\tconst elementLeftOffset = elementRect.left;\n\n\t\t\tcloneWrapper.style.width = `${\n\t\t\t\telementRect.width + clonePadding * 2\n\t\t\t}px`;\n\n\t\t\tconst clone = element.cloneNode( true ) as HTMLElement;\n\t\t\tclone.id = `clone-${ elementId }`;\n\n\t\t\t// Position clone right over the original element (20px padding).\n\t\t\tx = elementLeftOffset - clonePadding;\n\t\t\ty = elementTopOffset - clonePadding;\n\t\t\tcloneWrapper.style.transform = `translate( ${ x }px, ${ y }px )`;\n\n\t\t\t// Hack: Remove iFrames as it's causing the embeds drag clone to freeze.\n\t\t\tArray.from< HTMLIFrameElement >(\n\t\t\t\tclone.querySelectorAll( 'iframe' )\n\t\t\t).forEach( ( child ) => child.parentNode?.removeChild( child ) );\n\n\t\t\tcloneWrapper.appendChild( clone );\n\n\t\t\t// Inject the cloneWrapper into the DOM.\n\t\t\tif ( appendToOwnerDocument ) {\n\t\t\t\townerDocument.body.appendChild( cloneWrapper );\n\t\t\t} else {\n\t\t\t\telementWrapper?.appendChild( cloneWrapper );\n\t\t\t}\n\t\t}\n\n\t\t// Mark the current cursor coordinates.\n\t\tlet cursorLeft = event.clientX;\n\t\tlet cursorTop = event.clientY;\n\n\t\tfunction over( e: DragEvent ) {\n\t\t\t// Skip doing any work if mouse has not moved.\n\t\t\tif ( cursorLeft === e.clientX && cursorTop === e.clientY ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst nextX = x + e.clientX - cursorLeft;\n\t\t\tconst nextY = y + e.clientY - cursorTop;\n\t\t\tcloneWrapper.style.transform = `translate( ${ nextX }px, ${ nextY }px )`;\n\t\t\tcursorLeft = e.clientX;\n\t\t\tcursorTop = e.clientY;\n\t\t\tx = nextX;\n\t\t\ty = nextY;\n\t\t\tif ( onDragOver ) {\n\t\t\t\tonDragOver( e );\n\t\t\t}\n\t\t}\n\n\t\t// Aim for 60fps (16 ms per frame) for now. We can potentially use requestAnimationFrame (raf) instead,\n\t\t// note that browsers may throttle raf below 60fps in certain conditions.\n\t\t// @ts-ignore\n\t\tconst throttledDragOver = throttle( over, 16 );\n\n\t\townerDocument.addEventListener( 'dragover', throttledDragOver );\n\n\t\t// Update cursor to 'grabbing', document wide.\n\t\townerDocument.body.classList.add( bodyClass );\n\n\t\tif ( onDragStart ) {\n\t\t\tonDragStart( event );\n\t\t}\n\n\t\tcleanupRef.current = () => {\n\t\t\t// Remove drag clone.\n\t\t\tif ( cloneWrapper && cloneWrapper.parentNode ) {\n\t\t\t\tcloneWrapper.parentNode.removeChild( cloneWrapper );\n\t\t\t}\n\n\t\t\tif ( dragImage && dragImage.parentNode ) {\n\t\t\t\tdragImage.parentNode.removeChild( dragImage );\n\t\t\t}\n\n\t\t\t// Reset cursor.\n\t\t\townerDocument.body.classList.remove( bodyClass );\n\n\t\t\townerDocument.removeEventListener( 'dragover', throttledDragOver );\n\t\t};\n\t}\n\n\tuseEffect(\n\t\t() => () => {\n\t\t\tcleanupRef.current();\n\t\t},\n\t\t[]\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t{ children( {\n\t\t\t\tonDraggableStart: start,\n\t\t\t\tonDraggableEnd: end,\n\t\t\t} ) }\n\t\t\t{ dragComponent && (\n\t\t\t\t<div\n\t\t\t\t\tclassName=\"components-draggable-drag-component-root\"\n\t\t\t\t\tstyle={ { display: 'none' } }\n\t\t\t\t\tref={ dragComponentRef }\n\t\t\t\t>\n\t\t\t\t\t{ dragComponent }\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport default Draggable;\n"],"mappings":";;;;;;;AAQA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAAuD,IAAAE,WAAA,GAAAF,OAAA;AATvD;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;;AAGA,MAAMG,cAAc,GAAG,4CAA4C;AACnE,MAAMC,iBAAiB,GAAG,6BAA6B;AACvD,MAAMC,YAAY,GAAG,CAAC;AACtB,MAAMC,SAAS,GAAG,kCAAkC;;AAE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X4E,gBAAgB,EAAEzD,KAAK;MACvB0D,cAAc,EAAE9D;IACjB,CAAE,CAAC,EACDJ,aAAa,iBACd,IAAAjB,WAAA,CAAAoF,GAAA;MACCC,SAAS,EAAC,0CAA0C;MACpDnD,KAAK,EAAG;QAAEoD,OAAO,EAAE;MAAO,CAAG;MAC7BC,GAAG,EAAGrE,gBAAkB;MAAAZ,QAAA,EAEtBW;IAAa,CACX,CACL;EAAA,CACA,CAAC;AAEL;AAAC,IAAAuE,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcrF,SAAS","ignoreList":[]}
1
+ {"version":3,"names":["_compose","require","_element","_jsxRuntime","dragImageClass","cloneWrapperClass","clonePadding","bodyClass","Draggable","children","onDragStart","onDragOver","onDragEnd","appendToOwnerDocument","cloneClassname","elementId","transferData","__experimentalTransferDataType","transferDataType","__experimentalDragComponent","dragComponent","dragComponentRef","useRef","cleanupRef","end","event","preventDefault","current","start","ownerDocument","target","dataTransfer","setData","JSON","stringify","cloneWrapper","createElement","style","top","left","dragImage","setDragImage","classList","add","body","appendChild","x","y","clientX","clientY","transform","clonedDragComponent","innerHTML","element","getElementById","elementRect","getBoundingClientRect","elementWrapper","parentNode","elementTopOffset","elementLeftOffset","width","clone","cloneNode","id","Array","from","querySelectorAll","forEach","child","removeChild","cursorLeft","cursorTop","over","e","nextX","nextY","throttledDragOver","throttle","addEventListener","remove","removeEventListener","useEffect","jsxs","Fragment","onDraggableStart","onDraggableEnd","jsx","className","display","ref","_default","exports","default"],"sources":["@wordpress/components/src/draggable/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { DragEvent } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { throttle } from '@wordpress/compose';\nimport { useEffect, useRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { DraggableProps } from './types';\n\nconst dragImageClass = 'components-draggable__invisible-drag-image';\nconst cloneWrapperClass = 'components-draggable__clone';\nconst clonePadding = 0;\nconst bodyClass = 'is-dragging-components-draggable';\n\n/**\n * `Draggable` is a Component that provides a way to set up a cross-browser\n * (including IE) customizable drag image and the transfer data for the drag\n * event. It decouples the drag handle and the element to drag: use it by\n * wrapping the component that will become the drag handle and providing the DOM\n * ID of the element to drag.\n *\n * Note that the drag handle needs to declare the `draggable=\"true\"` property\n * and bind the `Draggable`s `onDraggableStart` and `onDraggableEnd` event\n * handlers to its own `onDragStart` and `onDragEnd` respectively. `Draggable`\n * takes care of the logic to setup the drag image and the transfer data, but is\n * not concerned with creating an actual DOM element that is draggable.\n *\n * ```jsx\n * import { Draggable, Panel, PanelBody } from '@wordpress/components';\n * import { Icon, more } from '@wordpress/icons';\n *\n * const MyDraggable = () => (\n * <div id=\"draggable-panel\">\n * <Panel header=\"Draggable panel\">\n * <PanelBody>\n * <Draggable elementId=\"draggable-panel\" transferData={ {} }>\n * { ( { onDraggableStart, onDraggableEnd } ) => (\n * <div\n * className=\"example-drag-handle\"\n * draggable\n * onDragStart={ onDraggableStart }\n * onDragEnd={ onDraggableEnd }\n * >\n * <Icon icon={ more } />\n * </div>\n * ) }\n * </Draggable>\n * </PanelBody>\n * </Panel>\n * </div>\n * );\n * ```\n */\nexport function Draggable( {\n\tchildren,\n\tonDragStart,\n\tonDragOver,\n\tonDragEnd,\n\tappendToOwnerDocument = false,\n\tcloneClassname,\n\telementId,\n\ttransferData,\n\t__experimentalTransferDataType: transferDataType = 'text',\n\t__experimentalDragComponent: dragComponent,\n}: DraggableProps ) {\n\tconst dragComponentRef = useRef< HTMLDivElement >( null );\n\tconst cleanupRef = useRef( () => {} );\n\n\t/**\n\t * Removes the element clone, resets cursor, and removes drag listener.\n\t *\n\t * @param event The non-custom DragEvent.\n\t */\n\tfunction end( event: DragEvent ) {\n\t\tevent.preventDefault();\n\t\tcleanupRef.current();\n\n\t\tif ( onDragEnd ) {\n\t\t\tonDragEnd( event );\n\t\t}\n\t}\n\n\t/**\n\t * This method does a couple of things:\n\t *\n\t * - Clones the current element and spawns clone over original element.\n\t * - Adds a fake temporary drag image to avoid browser defaults.\n\t * - Sets transfer data.\n\t * - Adds dragover listener.\n\t *\n\t * @param event The non-custom DragEvent.\n\t */\n\tfunction start( event: DragEvent ) {\n\t\tconst { ownerDocument } = event.target as HTMLElement;\n\n\t\tevent.dataTransfer.setData(\n\t\t\ttransferDataType,\n\t\t\tJSON.stringify( transferData )\n\t\t);\n\n\t\tconst cloneWrapper = ownerDocument.createElement( 'div' );\n\t\t// Reset position to 0,0. Natural stacking order will position this lower, even with a transform otherwise.\n\t\tcloneWrapper.style.top = '0';\n\t\tcloneWrapper.style.left = '0';\n\n\t\tconst dragImage = ownerDocument.createElement( 'div' );\n\n\t\t// Set a fake drag image to avoid browser defaults. Remove from DOM\n\t\t// right after. event.dataTransfer.setDragImage is not supported yet in\n\t\t// IE, we need to check for its existence first.\n\t\tif ( 'function' === typeof event.dataTransfer.setDragImage ) {\n\t\t\tdragImage.classList.add( dragImageClass );\n\t\t\townerDocument.body.appendChild( dragImage );\n\t\t\tevent.dataTransfer.setDragImage( dragImage, 0, 0 );\n\t\t}\n\n\t\tcloneWrapper.classList.add( cloneWrapperClass );\n\n\t\tif ( cloneClassname ) {\n\t\t\tcloneWrapper.classList.add( cloneClassname );\n\t\t}\n\n\t\tlet x = 0;\n\t\tlet y = 0;\n\t\t// If a dragComponent is defined, the following logic will clone the\n\t\t// HTML node and inject it into the cloneWrapper.\n\t\tif ( dragComponentRef.current ) {\n\t\t\t// Position dragComponent at the same position as the cursor.\n\t\t\tx = event.clientX;\n\t\t\ty = event.clientY;\n\t\t\tcloneWrapper.style.transform = `translate( ${ x }px, ${ y }px )`;\n\n\t\t\tconst clonedDragComponent = ownerDocument.createElement( 'div' );\n\t\t\tclonedDragComponent.innerHTML = dragComponentRef.current.innerHTML;\n\t\t\tcloneWrapper.appendChild( clonedDragComponent );\n\n\t\t\t// Inject the cloneWrapper into the DOM.\n\t\t\townerDocument.body.appendChild( cloneWrapper );\n\t\t} else {\n\t\t\tconst element = ownerDocument.getElementById(\n\t\t\t\telementId\n\t\t\t) as HTMLElement;\n\n\t\t\t// Prepare element clone and append to element wrapper.\n\t\t\tconst elementRect = element.getBoundingClientRect();\n\t\t\tconst elementWrapper = element.parentNode;\n\t\t\tconst elementTopOffset = elementRect.top;\n\t\t\tconst elementLeftOffset = elementRect.left;\n\n\t\t\tcloneWrapper.style.width = `${\n\t\t\t\telementRect.width + clonePadding * 2\n\t\t\t}px`;\n\n\t\t\tconst clone = element.cloneNode( true ) as HTMLElement;\n\t\t\tclone.id = `clone-${ elementId }`;\n\n\t\t\t// Position clone right over the original element (20px padding).\n\t\t\tx = elementLeftOffset - clonePadding;\n\t\t\ty = elementTopOffset - clonePadding;\n\t\t\tcloneWrapper.style.transform = `translate( ${ x }px, ${ y }px )`;\n\n\t\t\t// Hack: Remove iFrames as it's causing the embeds drag clone to freeze.\n\t\t\tArray.from< HTMLIFrameElement >(\n\t\t\t\tclone.querySelectorAll( 'iframe' )\n\t\t\t).forEach( ( child ) => child.parentNode?.removeChild( child ) );\n\n\t\t\tcloneWrapper.appendChild( clone );\n\n\t\t\t// Inject the cloneWrapper into the DOM.\n\t\t\tif ( appendToOwnerDocument ) {\n\t\t\t\townerDocument.body.appendChild( cloneWrapper );\n\t\t\t} else {\n\t\t\t\telementWrapper?.appendChild( cloneWrapper );\n\t\t\t}\n\t\t}\n\n\t\t// Mark the current cursor coordinates.\n\t\tlet cursorLeft = event.clientX;\n\t\tlet cursorTop = event.clientY;\n\n\t\tfunction over( e: DragEvent ) {\n\t\t\t// Skip doing any work if mouse has not moved.\n\t\t\tif ( cursorLeft === e.clientX && cursorTop === e.clientY ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst nextX = x + e.clientX - cursorLeft;\n\t\t\tconst nextY = y + e.clientY - cursorTop;\n\t\t\tcloneWrapper.style.transform = `translate( ${ nextX }px, ${ nextY }px )`;\n\t\t\tcursorLeft = e.clientX;\n\t\t\tcursorTop = e.clientY;\n\t\t\tx = nextX;\n\t\t\ty = nextY;\n\t\t\tif ( onDragOver ) {\n\t\t\t\tonDragOver( e );\n\t\t\t}\n\t\t}\n\n\t\t// Aim for 60fps (16 ms per frame) for now. We can potentially use requestAnimationFrame (raf) instead,\n\t\t// note that browsers may throttle raf below 60fps in certain conditions.\n\t\t// @ts-ignore\n\t\tconst throttledDragOver = throttle( over, 16 );\n\n\t\townerDocument.addEventListener( 'dragover', throttledDragOver );\n\n\t\t// Update cursor to 'grabbing', document wide.\n\t\townerDocument.body.classList.add( bodyClass );\n\n\t\tif ( onDragStart ) {\n\t\t\tonDragStart( event );\n\t\t}\n\n\t\tcleanupRef.current = () => {\n\t\t\t// Remove drag clone.\n\t\t\tif ( cloneWrapper && cloneWrapper.parentNode ) {\n\t\t\t\tcloneWrapper.parentNode.removeChild( cloneWrapper );\n\t\t\t}\n\n\t\t\tif ( dragImage && dragImage.parentNode ) {\n\t\t\t\tdragImage.parentNode.removeChild( dragImage );\n\t\t\t}\n\n\t\t\t// Reset cursor.\n\t\t\townerDocument.body.classList.remove( bodyClass );\n\n\t\t\townerDocument.removeEventListener( 'dragover', throttledDragOver );\n\t\t};\n\t}\n\n\tuseEffect(\n\t\t() => () => {\n\t\t\tcleanupRef.current();\n\t\t},\n\t\t[]\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t{ children( {\n\t\t\t\tonDraggableStart: start,\n\t\t\t\tonDraggableEnd: end,\n\t\t\t} ) }\n\t\t\t{ dragComponent && (\n\t\t\t\t<div\n\t\t\t\t\tclassName=\"components-draggable-drag-component-root\"\n\t\t\t\t\tstyle={ { display: 'none' } }\n\t\t\t\t\tref={ dragComponentRef }\n\t\t\t\t>\n\t\t\t\t\t{ dragComponent }\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport default Draggable;\n"],"mappings":";;;;;;;;AAQA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAAuD,IAAAE,WAAA,GAAAF,OAAA;AATvD;A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,MAAM,MAAM;IACX3D,UAAU,CAACI,OAAO,CAAC,CAAC;EACrB,CAAC,EACD,EACD,CAAC;EAED,oBACC,IAAAxB,WAAA,CAAAgF,IAAA,EAAAhF,WAAA,CAAAiF,QAAA;IAAA3E,QAAA,GACGA,QAAQ,CAAE;MACX4E,gBAAgB,EAAEzD,KAAK;MACvB0D,cAAc,EAAE9D;IACjB,CAAE,CAAC,EACDJ,aAAa,iBACd,IAAAjB,WAAA,CAAAoF,GAAA;MACCC,SAAS,EAAC,0CAA0C;MACpDnD,KAAK,EAAG;QAAEoD,OAAO,EAAE;MAAO,CAAG;MAC7BC,GAAG,EAAGrE,gBAAkB;MAAAZ,QAAA,EAEtBW;IAAa,CACX,CACL;EAAA,CACA,CAAC;AAEL;AAAC,IAAAuE,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcrF,SAAS","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":["_reactNativeGestureHandler","require","_reactNativeReanimated","_interopRequireWildcard","_element","_style","_interopRequireDefault","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","Context","createContext","Provider","Draggable","children","onDragEnd","onDragOver","onDragStart","testID","isDragging","useSharedValue","isPanActive","draggingId","panGestureRef","useRef","currentFirstTouchId","initialPosition","x","y","lastPosition","useAnimatedReaction","value","result","previous","id","getFirstTouchEvent","event","allTouches","find","touch","panGesture","Gesture","Pan","manualActivation","onTouchesDown","firstEvent","onTouchesMove","state","activate","end","onTouchesCancelled","_event","onEnd","withRef","shouldCancelWhenOutside","withTestId","providerValue","useMemo","jsx","GestureDetector","gesture","View","style","styles","draggable__container","DraggableTrigger","enabled","maxDistance","minDuration","onLongPress","onLongPressEnd","useContext","gestureHandler","useAnimatedGestureHandler","onActive","runOnJS","LongPressGestureHandler","minDurationMs","maxDist","simultaneousHandlers","onGestureEvent","exports","_default"],"sources":["@wordpress/components/src/draggable/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport {\n\tGesture,\n\tGestureDetector,\n\tLongPressGestureHandler,\n} from 'react-native-gesture-handler';\nimport Animated, {\n\tuseSharedValue,\n\trunOnJS,\n\tuseAnimatedReaction,\n\tuseAnimatedGestureHandler,\n} from 'react-native-reanimated';\n\n/**\n * WordPress dependencies\n */\nimport { createContext, useContext, useRef, useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\n\nconst Context = createContext( {} );\nconst { Provider } = Context;\n\n/**\n * Draggable component.\n *\n * @param {Object} props Component props.\n * @param {JSX.Element} props.children Children to be rendered.\n * @param {Function} [props.onDragEnd] Callback when dragging ends.\n * @param {Function} [props.onDragOver] Callback when dragging happens over an element.\n * @param {Function} [props.onDragStart] Callback when dragging starts.\n * @param {string} [props.testID] Id used for querying the pan gesture in tests.\n *\n * @return {JSX.Element} The component to be rendered.\n */\nconst Draggable = ( {\n\tchildren,\n\tonDragEnd,\n\tonDragOver,\n\tonDragStart,\n\ttestID,\n} ) => {\n\tconst isDragging = useSharedValue( false );\n\tconst isPanActive = useSharedValue( false );\n\tconst draggingId = useSharedValue( '' );\n\tconst panGestureRef = useRef();\n\tconst currentFirstTouchId = useSharedValue( null );\n\n\tconst initialPosition = {\n\t\tx: useSharedValue( 0 ),\n\t\ty: useSharedValue( 0 ),\n\t};\n\tconst lastPosition = {\n\t\tx: useSharedValue( 0 ),\n\t\ty: useSharedValue( 0 ),\n\t};\n\n\tuseAnimatedReaction(\n\t\t() => isDragging.value,\n\t\t( result, previous ) => {\n\t\t\tif ( result === previous ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( result ) {\n\t\t\t\tif ( onDragStart ) {\n\t\t\t\t\tonDragStart( {\n\t\t\t\t\t\tx: initialPosition.x.value,\n\t\t\t\t\t\ty: initialPosition.y.value,\n\t\t\t\t\t\tid: draggingId.value,\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t} else if ( previous !== null && onDragEnd ) {\n\t\t\t\tonDragEnd( {\n\t\t\t\t\tx: lastPosition.x.value,\n\t\t\t\t\ty: lastPosition.y.value,\n\t\t\t\t\tid: draggingId.value,\n\t\t\t\t} );\n\t\t\t}\n\t\t}\n\t);\n\n\tfunction getFirstTouchEvent( event ) {\n\t\t'worklet';\n\n\t\treturn event.allTouches.find(\n\t\t\t( touch ) => touch.id === currentFirstTouchId.value\n\t\t);\n\t}\n\n\tconst panGesture = Gesture.Pan()\n\t\t.manualActivation( true )\n\t\t.onTouchesDown( ( event ) => {\n\t\t\tif ( ! currentFirstTouchId.value ) {\n\t\t\t\tconst firstEvent = event.allTouches[ 0 ];\n\t\t\t\tconst { x = 0, y = 0 } = firstEvent;\n\n\t\t\t\tcurrentFirstTouchId.value = firstEvent.id;\n\n\t\t\t\tinitialPosition.x.value = x;\n\t\t\t\tinitialPosition.y.value = y;\n\t\t\t}\n\t\t} )\n\t\t.onTouchesMove( ( event, state ) => {\n\t\t\tif ( ! isPanActive.value && isDragging.value ) {\n\t\t\t\tisPanActive.value = true;\n\t\t\t\tstate.activate();\n\t\t\t}\n\n\t\t\tif ( isPanActive.value && isDragging.value ) {\n\t\t\t\tconst firstEvent = getFirstTouchEvent( event );\n\n\t\t\t\tif ( ! firstEvent ) {\n\t\t\t\t\tstate.end();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tlastPosition.x.value = firstEvent.x;\n\t\t\t\tlastPosition.y.value = firstEvent.y;\n\n\t\t\t\tif ( onDragOver ) {\n\t\t\t\t\tonDragOver( firstEvent );\n\t\t\t\t}\n\t\t\t}\n\t\t} )\n\t\t.onTouchesCancelled( ( _event, state ) => {\n\t\t\tstate.end();\n\t\t} )\n\t\t.onEnd( () => {\n\t\t\tcurrentFirstTouchId.value = null;\n\t\t\tisPanActive.value = false;\n\t\t\tisDragging.value = false;\n\t\t} )\n\t\t.withRef( panGestureRef )\n\t\t.shouldCancelWhenOutside( false )\n\t\t.withTestId( testID );\n\n\tconst providerValue = useMemo( () => {\n\t\treturn { panGestureRef, isDragging, isPanActive, draggingId };\n\t}, [\n\t\t// `isDragging`, `isPanActive` and `draggingId` are created using the\n\t\t// `useSharedValue` hook provided by the `react-native-reanimated`, which in\n\t\t// theory should guarantee that the value of these variables remains stable.\n\t\t// ESLint can't pick this up, and that's why they have to be specified as\n\t\t// dependencies for this hook call.\n\t\tisDragging,\n\t\tisPanActive,\n\t\tdraggingId,\n\t] );\n\n\treturn (\n\t\t<GestureDetector gesture={ panGesture }>\n\t\t\t<Animated.View style={ styles.draggable__container }>\n\t\t\t\t<Provider value={ providerValue }>{ children }</Provider>\n\t\t\t</Animated.View>\n\t\t</GestureDetector>\n\t);\n};\n\n/**\n * Draggable trigger component.\n *\n * This component acts as the trigger for the dragging functionality.\n *\n * @param {Object} props Component props.\n * @param {JSX.Element} props.children Children to be rendered.\n * @param {*} props.id Identifier passed within the event callbacks.\n * @param {boolean} [props.enabled] Enables the long-press gesture.\n * @param {number} [props.maxDistance] Maximum distance, that defines how far the finger is allowed to travel during a long press gesture.\n * @param {number} [props.minDuration] Minimum time, that a finger must remain pressed on the corresponding view.\n * @param {Function} [props.onLongPress] Callback when long-press gesture is triggered over an element.\n * @param {Function} [props.onLongPressEnd] Callback when long-press gesture ends.\n * @param {string} [props.testID] Id used for querying the long-press gesture handler in tests.\n *\n * @return {JSX.Element} The component to be rendered.\n */\nconst DraggableTrigger = ( {\n\tchildren,\n\tenabled = true,\n\tid,\n\tmaxDistance = 1000,\n\tminDuration = 500,\n\tonLongPress,\n\tonLongPressEnd,\n\ttestID,\n} ) => {\n\tconst { panGestureRef, isDragging, isPanActive, draggingId } =\n\t\tuseContext( Context );\n\n\tconst gestureHandler = useAnimatedGestureHandler( {\n\t\tonActive: () => {\n\t\t\tif ( isDragging.value ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tdraggingId.value = id;\n\t\t\tisDragging.value = true;\n\t\t\tif ( onLongPress ) {\n\t\t\t\trunOnJS( onLongPress )( id );\n\t\t\t}\n\t\t},\n\t\tonEnd: () => {\n\t\t\tif ( ! isPanActive.value ) {\n\t\t\t\tisDragging.value = false;\n\t\t\t}\n\n\t\t\tif ( onLongPressEnd ) {\n\t\t\t\trunOnJS( onLongPressEnd )( id );\n\t\t\t}\n\t\t},\n\t} );\n\n\treturn (\n\t\t<LongPressGestureHandler\n\t\t\tenabled={ enabled }\n\t\t\tminDurationMs={ minDuration }\n\t\t\tmaxDist={ maxDistance }\n\t\t\tsimultaneousHandlers={ panGestureRef }\n\t\t\tshouldCancelWhenOutside={ false }\n\t\t\tonGestureEvent={ gestureHandler }\n\t\t\ttestID={ testID }\n\t\t>\n\t\t\t{ children }\n\t\t</LongPressGestureHandler>\n\t);\n};\n\nexport { DraggableTrigger };\nexport default Draggable;\n"],"mappings":";;;;;;;AAGA,IAAAA,0BAAA,GAAAC,OAAA;AAKA,IAAAC,sBAAA,GAAAC,uBAAA,CAAAF,OAAA;AAUA,IAAAG,QAAA,GAAAH,OAAA;AAKA,IAAAI,MAAA,GAAAC,sBAAA,CAAAL,OAAA;AAAkC,IAAAM,WAAA,GAAAN,OAAA;AAAA,SAAAO,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,SAAAN,wBAAAM,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,O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,KAAM;MACf,IAAKvD,UAAU,CAACY,KAAK,EAAG;QACvB;MACD;MAEAT,UAAU,CAACS,KAAK,GAAGG,EAAE;MACrBf,UAAU,CAACY,KAAK,GAAG,IAAI;MACvB,IAAKsC,WAAW,EAAG;QAClB,IAAAM,8BAAO,EAAEN,WAAY,CAAC,CAAEnC,EAAG,CAAC;MAC7B;IACD,CAAC;IACDkB,KAAK,EAAEA,CAAA,KAAM;MACZ,IAAK,CAAE/B,WAAW,CAACU,KAAK,EAAG;QAC1BZ,UAAU,CAACY,KAAK,GAAG,KAAK;MACzB;MAEA,IAAKuC,cAAc,EAAG;QACrB,IAAAK,8BAAO,EAAEL,cAAe,CAAC,CAAEpC,EAAG,CAAC;MAChC;IACD;EACD,CAAE,CAAC;EAEH,oBACC,IAAA7C,WAAA,CAAAqE,GAAA,EAAC5E,0BAAA,CAAA8F,uBAAuB;IACvBV,OAAO,EAAGA,OAAS;IACnBW,aAAa,EAAGT,WAAa;IAC7BU,OAAO,EAAGX,WAAa;IACvBY,oBAAoB,EAAGxD,aAAe;IACtC+B,uBAAuB,EAAG,KAAO;IACjC0B,cAAc,EAAGR,cAAgB;IACjCtD,MAAM,EAAGA,MAAQ;IAAAJ,QAAA,EAEfA;EAAQ,CACc,CAAC;AAE5B,CAAC;AAACmE,OAAA,CAAAhB,gBAAA,GAAAA,gBAAA;AAAA,IAAAiB,QAAA,GAAAD,OAAA,CAAArF,OAAA,GAGaiB,SAAS","ignoreList":[]}
1
+ {"version":3,"names":["_reactNativeGestureHandler","require","_reactNativeReanimated","_interopRequireWildcard","_element","_style","_interopRequireDefault","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","Context","createContext","Provider","Draggable","children","onDragEnd","onDragOver","onDragStart","testID","isDragging","useSharedValue","isPanActive","draggingId","panGestureRef","useRef","currentFirstTouchId","initialPosition","x","y","lastPosition","useAnimatedReaction","value","result","previous","id","getFirstTouchEvent","event","allTouches","find","touch","panGesture","Gesture","Pan","manualActivation","onTouchesDown","firstEvent","onTouchesMove","state","activate","end","onTouchesCancelled","_event","onEnd","withRef","shouldCancelWhenOutside","withTestId","providerValue","useMemo","jsx","GestureDetector","gesture","View","style","styles","draggable__container","DraggableTrigger","enabled","maxDistance","minDuration","onLongPress","onLongPressEnd","useContext","gestureHandler","useAnimatedGestureHandler","onActive","runOnJS","LongPressGestureHandler","minDurationMs","maxDist","simultaneousHandlers","onGestureEvent","exports","_default"],"sources":["@wordpress/components/src/draggable/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport {\n\tGesture,\n\tGestureDetector,\n\tLongPressGestureHandler,\n} from 'react-native-gesture-handler';\nimport Animated, {\n\tuseSharedValue,\n\trunOnJS,\n\tuseAnimatedReaction,\n\tuseAnimatedGestureHandler,\n} from 'react-native-reanimated';\n\n/**\n * WordPress dependencies\n */\nimport { createContext, useContext, useRef, useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\n\nconst Context = createContext( {} );\nconst { Provider } = Context;\n\n/**\n * Draggable component.\n *\n * @param {Object} props Component props.\n * @param {JSX.Element} props.children Children to be rendered.\n * @param {Function} [props.onDragEnd] Callback when dragging ends.\n * @param {Function} [props.onDragOver] Callback when dragging happens over an element.\n * @param {Function} [props.onDragStart] Callback when dragging starts.\n * @param {string} [props.testID] Id used for querying the pan gesture in tests.\n *\n * @return {JSX.Element} The component to be rendered.\n */\nconst Draggable = ( {\n\tchildren,\n\tonDragEnd,\n\tonDragOver,\n\tonDragStart,\n\ttestID,\n} ) => {\n\tconst isDragging = useSharedValue( false );\n\tconst isPanActive = useSharedValue( false );\n\tconst draggingId = useSharedValue( '' );\n\tconst panGestureRef = useRef();\n\tconst currentFirstTouchId = useSharedValue( null );\n\n\tconst initialPosition = {\n\t\tx: useSharedValue( 0 ),\n\t\ty: useSharedValue( 0 ),\n\t};\n\tconst lastPosition = {\n\t\tx: useSharedValue( 0 ),\n\t\ty: useSharedValue( 0 ),\n\t};\n\n\tuseAnimatedReaction(\n\t\t() => isDragging.value,\n\t\t( result, previous ) => {\n\t\t\tif ( result === previous ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( result ) {\n\t\t\t\tif ( onDragStart ) {\n\t\t\t\t\tonDragStart( {\n\t\t\t\t\t\tx: initialPosition.x.value,\n\t\t\t\t\t\ty: initialPosition.y.value,\n\t\t\t\t\t\tid: draggingId.value,\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t} else if ( previous !== null && onDragEnd ) {\n\t\t\t\tonDragEnd( {\n\t\t\t\t\tx: lastPosition.x.value,\n\t\t\t\t\ty: lastPosition.y.value,\n\t\t\t\t\tid: draggingId.value,\n\t\t\t\t} );\n\t\t\t}\n\t\t}\n\t);\n\n\tfunction getFirstTouchEvent( event ) {\n\t\t'worklet';\n\n\t\treturn event.allTouches.find(\n\t\t\t( touch ) => touch.id === currentFirstTouchId.value\n\t\t);\n\t}\n\n\tconst panGesture = Gesture.Pan()\n\t\t.manualActivation( true )\n\t\t.onTouchesDown( ( event ) => {\n\t\t\tif ( ! currentFirstTouchId.value ) {\n\t\t\t\tconst firstEvent = event.allTouches[ 0 ];\n\t\t\t\tconst { x = 0, y = 0 } = firstEvent;\n\n\t\t\t\tcurrentFirstTouchId.value = firstEvent.id;\n\n\t\t\t\tinitialPosition.x.value = x;\n\t\t\t\tinitialPosition.y.value = y;\n\t\t\t}\n\t\t} )\n\t\t.onTouchesMove( ( event, state ) => {\n\t\t\tif ( ! isPanActive.value && isDragging.value ) {\n\t\t\t\tisPanActive.value = true;\n\t\t\t\tstate.activate();\n\t\t\t}\n\n\t\t\tif ( isPanActive.value && isDragging.value ) {\n\t\t\t\tconst firstEvent = getFirstTouchEvent( event );\n\n\t\t\t\tif ( ! firstEvent ) {\n\t\t\t\t\tstate.end();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tlastPosition.x.value = firstEvent.x;\n\t\t\t\tlastPosition.y.value = firstEvent.y;\n\n\t\t\t\tif ( onDragOver ) {\n\t\t\t\t\tonDragOver( firstEvent );\n\t\t\t\t}\n\t\t\t}\n\t\t} )\n\t\t.onTouchesCancelled( ( _event, state ) => {\n\t\t\tstate.end();\n\t\t} )\n\t\t.onEnd( () => {\n\t\t\tcurrentFirstTouchId.value = null;\n\t\t\tisPanActive.value = false;\n\t\t\tisDragging.value = false;\n\t\t} )\n\t\t.withRef( panGestureRef )\n\t\t.shouldCancelWhenOutside( false )\n\t\t.withTestId( testID );\n\n\tconst providerValue = useMemo( () => {\n\t\treturn { panGestureRef, isDragging, isPanActive, draggingId };\n\t}, [\n\t\t// `isDragging`, `isPanActive` and `draggingId` are created using the\n\t\t// `useSharedValue` hook provided by the `react-native-reanimated`, which in\n\t\t// theory should guarantee that the value of these variables remains stable.\n\t\t// ESLint can't pick this up, and that's why they have to be specified as\n\t\t// dependencies for this hook call.\n\t\tisDragging,\n\t\tisPanActive,\n\t\tdraggingId,\n\t] );\n\n\treturn (\n\t\t<GestureDetector gesture={ panGesture }>\n\t\t\t<Animated.View style={ styles.draggable__container }>\n\t\t\t\t<Provider value={ providerValue }>{ children }</Provider>\n\t\t\t</Animated.View>\n\t\t</GestureDetector>\n\t);\n};\n\n/**\n * Draggable trigger component.\n *\n * This component acts as the trigger for the dragging functionality.\n *\n * @param {Object} props Component props.\n * @param {JSX.Element} props.children Children to be rendered.\n * @param {*} props.id Identifier passed within the event callbacks.\n * @param {boolean} [props.enabled] Enables the long-press gesture.\n * @param {number} [props.maxDistance] Maximum distance, that defines how far the finger is allowed to travel during a long press gesture.\n * @param {number} [props.minDuration] Minimum time, that a finger must remain pressed on the corresponding view.\n * @param {Function} [props.onLongPress] Callback when long-press gesture is triggered over an element.\n * @param {Function} [props.onLongPressEnd] Callback when long-press gesture ends.\n * @param {string} [props.testID] Id used for querying the long-press gesture handler in tests.\n *\n * @return {JSX.Element} The component to be rendered.\n */\nconst DraggableTrigger = ( {\n\tchildren,\n\tenabled = true,\n\tid,\n\tmaxDistance = 1000,\n\tminDuration = 500,\n\tonLongPress,\n\tonLongPressEnd,\n\ttestID,\n} ) => {\n\tconst { panGestureRef, isDragging, isPanActive, draggingId } =\n\t\tuseContext( Context );\n\n\tconst gestureHandler = useAnimatedGestureHandler( {\n\t\tonActive: () => {\n\t\t\tif ( isDragging.value ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tdraggingId.value = id;\n\t\t\tisDragging.value = true;\n\t\t\tif ( onLongPress ) {\n\t\t\t\trunOnJS( onLongPress )( id );\n\t\t\t}\n\t\t},\n\t\tonEnd: () => {\n\t\t\tif ( ! isPanActive.value ) {\n\t\t\t\tisDragging.value = false;\n\t\t\t}\n\n\t\t\tif ( onLongPressEnd ) {\n\t\t\t\trunOnJS( onLongPressEnd )( id );\n\t\t\t}\n\t\t},\n\t} );\n\n\treturn (\n\t\t<LongPressGestureHandler\n\t\t\tenabled={ enabled }\n\t\t\tminDurationMs={ minDuration }\n\t\t\tmaxDist={ maxDistance }\n\t\t\tsimultaneousHandlers={ panGestureRef }\n\t\t\tshouldCancelWhenOutside={ false }\n\t\t\tonGestureEvent={ gestureHandler }\n\t\t\ttestID={ testID }\n\t\t>\n\t\t\t{ children }\n\t\t</LongPressGestureHandler>\n\t);\n};\n\nexport { DraggableTrigger };\nexport default Draggable;\n"],"mappings":";;;;;;;;AAGA,IAAAA,0BAAA,GAAAC,OAAA;AAKA,IAAAC,sBAAA,GAAAC,uBAAA,CAAAF,OAAA;AAUA,IAAAG,QAAA,GAAAH,OAAA;AAKA,IAAAI,MAAA,GAAAC,sBAAA,CAAAL,OAAA;AAAkC,IAAAM,WAAA,GAAAN,OAAA;AAAA,SAAAO,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CA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RequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_icons","_context","_button","_dropdown","_navigableContainer","_jsxRuntime","mergeProps","defaultProps","props","mergedProps","className","clsx","isFunction","maybeFunc","UnconnectedDropdownMenu","dropdownMenuProps","children","controls","icon","menu","label","popoverProps","toggleProps","menuProps","disableOpenOnArrowDown","text","noIcons","open","defaultOpen","onToggle","onToggleProp","variant","useContextSystem","length","controlSets","Array","isArray","mergedPopoverProps","jsx","default","renderToggle","isOpen","_toggleProps$showTool","openOnArrowDown","event","code","preventDefault","as","Toggle","Button","restToggleProps","mergedToggleProps","onClick","onKeyDown","showTooltip","renderContent","mergedMenuProps","jsxs","NavigableMenu","role","flatMap","controlSet","indexOfSet","map","control","indexOfControl","__next40pxDefaultSize","stopPropagation","onClose","isActive","title","undefined","accessibleWhenDisabled","disabled","isDisabled","join","DropdownMenu","exports","contextConnectWithoutRef","_default"],"sources":["@wordpress/components/src/dropdown-menu/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { menu } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { contextConnectWithoutRef, useContextSystem } from '../context';\nimport Button from '../button';\nimport Dropdown from '../dropdown';\nimport { NavigableMenu } from '../navigable-container';\nimport type {\n\tDropdownMenuProps,\n\tDropdownOption,\n\tDropdownMenuInternalContext,\n} from './types';\n\nfunction mergeProps<\n\tT extends { className?: string; [ key: string ]: unknown },\n>( defaultProps: Partial< T > = {}, props: T = {} as T ) {\n\tconst mergedProps: T = {\n\t\t...defaultProps,\n\t\t...props,\n\t};\n\n\tif ( props.className && defaultProps.className ) {\n\t\tmergedProps.className = clsx( props.className, defaultProps.className );\n\t}\n\n\treturn mergedProps;\n}\n\nfunction isFunction( maybeFunc: unknown ): maybeFunc is () => void {\n\treturn typeof maybeFunc === 'function';\n}\n\nfunction UnconnectedDropdownMenu( dropdownMenuProps: DropdownMenuProps ) {\n\tconst {\n\t\tchildren,\n\t\tclassName,\n\t\tcontrols,\n\t\ticon = menu,\n\t\tlabel,\n\t\tpopoverProps,\n\t\ttoggleProps,\n\t\tmenuProps,\n\t\tdisableOpenOnArrowDown = false,\n\t\ttext,\n\t\tnoIcons,\n\n\t\topen,\n\t\tdefaultOpen,\n\t\tonToggle: onToggleProp,\n\n\t\t// Context\n\t\tvariant,\n\t} = useContextSystem< DropdownMenuProps & DropdownMenuInternalContext >(\n\t\tdropdownMenuProps,\n\t\t'DropdownMenu'\n\t);\n\n\tif ( ! controls?.length && ! isFunction( children ) ) {\n\t\treturn null;\n\t}\n\n\t// Normalize controls to nested array of objects (sets of controls)\n\tlet controlSets: DropdownOption[][];\n\tif ( controls?.length ) {\n\t\t// @ts-expect-error The check below is needed because `DropdownMenus`\n\t\t// rendered by `ToolBarGroup` receive controls as a nested array.\n\t\tcontrolSets = controls;\n\t\tif ( ! Array.isArray( controlSets[ 0 ] ) ) {\n\t\t\t// This is not ideal, but at this point we know that `controls` is\n\t\t\t// not a nested array, even if TypeScript doesn't.\n\t\t\tcontrolSets = [ controls as DropdownOption[] ];\n\t\t}\n\t}\n\n\tconst mergedPopoverProps = mergeProps(\n\t\t{\n\t\t\tclassName: 'components-dropdown-menu__popover',\n\t\t\tvariant,\n\t\t},\n\t\tpopoverProps\n\t);\n\n\treturn (\n\t\t<Dropdown\n\t\t\tclassName={ className }\n\t\t\tpopoverProps={ mergedPopoverProps }\n\t\t\trenderToggle={ ( { isOpen, onToggle } ) => {\n\t\t\t\tconst openOnArrowDown = ( event: React.KeyboardEvent ) => {\n\t\t\t\t\tif ( disableOpenOnArrowDown ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ! isOpen && event.code === 'ArrowDown' ) {\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\tonToggle();\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tconst { as: Toggle = Button, ...restToggleProps } =\n\t\t\t\t\ttoggleProps ?? {};\n\n\t\t\t\tconst mergedToggleProps = mergeProps(\n\t\t\t\t\t{\n\t\t\t\t\t\tclassName: clsx( 'components-dropdown-menu__toggle', {\n\t\t\t\t\t\t\t'is-opened': isOpen,\n\t\t\t\t\t\t} ),\n\t\t\t\t\t},\n\t\t\t\t\trestToggleProps\n\t\t\t\t);\n\n\t\t\t\treturn (\n\t\t\t\t\t<Toggle\n\t\t\t\t\t\t{ ...mergedToggleProps }\n\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\tonClick={\n\t\t\t\t\t\t\t( ( event ) => {\n\t\t\t\t\t\t\t\tonToggle();\n\t\t\t\t\t\t\t\tif ( mergedToggleProps.onClick ) {\n\t\t\t\t\t\t\t\t\tmergedToggleProps.onClick( event );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} ) as React.MouseEventHandler< HTMLButtonElement >\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonKeyDown={\n\t\t\t\t\t\t\t( ( event ) => {\n\t\t\t\t\t\t\t\topenOnArrowDown( event );\n\t\t\t\t\t\t\t\tif ( mergedToggleProps.onKeyDown ) {\n\t\t\t\t\t\t\t\t\tmergedToggleProps.onKeyDown( event );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} ) as React.KeyboardEventHandler< HTMLButtonElement >\n\t\t\t\t\t\t}\n\t\t\t\t\t\taria-haspopup=\"true\"\n\t\t\t\t\t\taria-expanded={ isOpen }\n\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t\ttext={ text }\n\t\t\t\t\t\tshowTooltip={ toggleProps?.showTooltip ?? true }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ mergedToggleProps.children }\n\t\t\t\t\t</Toggle>\n\t\t\t\t);\n\t\t\t} }\n\t\t\trenderContent={ ( props ) => {\n\t\t\t\tconst mergedMenuProps = mergeProps(\n\t\t\t\t\t{\n\t\t\t\t\t\t'aria-label': label,\n\t\t\t\t\t\tclassName: clsx( 'components-dropdown-menu__menu', {\n\t\t\t\t\t\t\t'no-icons': noIcons,\n\t\t\t\t\t\t} ),\n\t\t\t\t\t},\n\t\t\t\t\tmenuProps\n\t\t\t\t);\n\n\t\t\t\treturn (\n\t\t\t\t\t<NavigableMenu { ...mergedMenuProps } role=\"menu\">\n\t\t\t\t\t\t{ isFunction( children ) ? children( props ) : null }\n\t\t\t\t\t\t{ controlSets?.flatMap( ( controlSet, indexOfSet ) =>\n\t\t\t\t\t\t\tcontrolSet.map( ( control, indexOfControl ) => (\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={ [\n\t\t\t\t\t\t\t\t\t\tindexOfSet,\n\t\t\t\t\t\t\t\t\t\tindexOfControl,\n\t\t\t\t\t\t\t\t\t].join() }\n\t\t\t\t\t\t\t\t\tonClick={ ( event ) => {\n\t\t\t\t\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\t\t\t\t\tprops.onClose();\n\t\t\t\t\t\t\t\t\t\tif ( control.onClick ) {\n\t\t\t\t\t\t\t\t\t\t\tcontrol.onClick();\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\tclassName={ clsx(\n\t\t\t\t\t\t\t\t\t\t'components-dropdown-menu__menu-item',\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t'has-separator':\n\t\t\t\t\t\t\t\t\t\t\t\tindexOfSet > 0 &&\n\t\t\t\t\t\t\t\t\t\t\t\tindexOfControl === 0,\n\t\t\t\t\t\t\t\t\t\t\t'is-active': control.isActive,\n\t\t\t\t\t\t\t\t\t\t\t'is-icon-only': ! control.title,\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\ticon={ control.icon }\n\t\t\t\t\t\t\t\t\tlabel={ control.label }\n\t\t\t\t\t\t\t\t\taria-checked={\n\t\t\t\t\t\t\t\t\t\tcontrol.role === 'menuitemcheckbox' ||\n\t\t\t\t\t\t\t\t\t\tcontrol.role === 'menuitemradio'\n\t\t\t\t\t\t\t\t\t\t\t? control.isActive\n\t\t\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\trole={\n\t\t\t\t\t\t\t\t\t\tcontrol.role === 'menuitemcheckbox' ||\n\t\t\t\t\t\t\t\t\t\tcontrol.role === 'menuitemradio'\n\t\t\t\t\t\t\t\t\t\t\t? control.role\n\t\t\t\t\t\t\t\t\t\t\t: 'menuitem'\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\t\t\t\t\tdisabled={ control.isDisabled }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ control.title }\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</NavigableMenu>\n\t\t\t\t);\n\t\t\t} }\n\t\t\topen={ open }\n\t\t\tdefaultOpen={ defaultOpen }\n\t\t\tonToggle={ onToggleProp }\n\t\t/>\n\t);\n}\n\n/**\n *\n * The DropdownMenu displays a list of actions (each contained in a MenuItem,\n * MenuItemsChoice, or MenuGroup) in a compact way. It appears in a Popover\n * after the user has interacted with an element (a button or icon) or when\n * they perform a specific action.\n *\n * Render a Dropdown Menu with a set of controls:\n *\n * ```jsx\n * import { DropdownMenu } from '@wordpress/components';\n * import {\n * \tmore,\n * \tarrowLeft,\n * \tarrowRight,\n * \tarrowUp,\n * \tarrowDown,\n * } from '@wordpress/icons';\n *\n * const MyDropdownMenu = () => (\n * \t<DropdownMenu\n * \t\ticon={ more }\n * \t\tlabel=\"Select a direction\"\n * \t\tcontrols={ [\n * \t\t\t{\n * \t\t\t\ttitle: 'Up',\n * \t\t\t\ticon: arrowUp,\n * \t\t\t\tonClick: () => console.log( 'up' ),\n * \t\t\t},\n * \t\t\t{\n * \t\t\t\ttitle: 'Right',\n * \t\t\t\ticon: arrowRight,\n * \t\t\t\tonClick: () => console.log( 'right' ),\n * \t\t\t},\n * \t\t\t{\n * \t\t\t\ttitle: 'Down',\n * \t\t\t\ticon: arrowDown,\n * \t\t\t\tonClick: () => console.log( 'down' ),\n * \t\t\t},\n * \t\t\t{\n * \t\t\t\ttitle: 'Left',\n * \t\t\t\ticon: arrowLeft,\n * \t\t\t\tonClick: () => console.log( 'left' ),\n * \t\t\t},\n * \t\t] }\n * \t/>\n * );\n * ```\n *\n * Alternatively, specify a `children` function which returns elements valid for\n * use in a DropdownMenu: `MenuItem`, `MenuItemsChoice`, or `MenuGroup`.\n *\n * ```jsx\n * import { DropdownMenu, MenuGroup, MenuItem } from '@wordpress/components';\n * import { more, arrowUp, arrowDown, trash } from '@wordpress/icons';\n *\n * const MyDropdownMenu = () => (\n * \t<DropdownMenu icon={ more } label=\"Select a direction\">\n * \t\t{ ( { onClose } ) => (\n * \t\t\t<>\n * \t\t\t\t<MenuGroup>\n * \t\t\t\t\t<MenuItem icon={ arrowUp } onClick={ onClose }>\n * \t\t\t\t\t\tMove Up\n * \t\t\t\t\t</MenuItem>\n * \t\t\t\t\t<MenuItem icon={ arrowDown } onClick={ onClose }>\n * \t\t\t\t\t\tMove Down\n * \t\t\t\t\t</MenuItem>\n * \t\t\t\t</MenuGroup>\n * \t\t\t\t<MenuGroup>\n * \t\t\t\t\t<MenuItem icon={ trash } onClick={ onClose }>\n * \t\t\t\t\t\tRemove\n * \t\t\t\t\t</MenuItem>\n * \t\t\t\t</MenuGroup>\n * \t\t\t</>\n * \t\t) }\n * \t</DropdownMenu>\n * );\n * ```\n *\n */\nexport const DropdownMenu = contextConnectWithoutRef(\n\tUnconnectedDropdownMenu,\n\t'DropdownMenu'\n);\n\nexport default DropdownMenu;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBA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ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM8C,YAAY,GAAAC,OAAA,CAAAD,YAAA,GAAG,IAAAE,iCAAwB,EACnDhE,uBAAuB,EACvB,cACD,CAAC;AAAC,IAAAiE,QAAA,GAAAF,OAAA,CAAAtC,OAAA,GAEaqC,YAAY","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_icons","_context","_button","_dropdown","_navigableContainer","_jsxRuntime","mergeProps","defaultProps","props","mergedProps","className","clsx","isFunction","maybeFunc","UnconnectedDropdownMenu","dropdownMenuProps","children","controls","icon","menu","label","popoverProps","toggleProps","menuProps","disableOpenOnArrowDown","text","noIcons","open","defaultOpen","onToggle","onToggleProp","variant","useContextSystem","length","controlSets","Array","isArray","mergedPopoverProps","jsx","default","renderToggle","isOpen","_toggleProps$showTool","openOnArrowDown","event","code","preventDefault","as","Toggle","Button","restToggleProps","mergedToggleProps","onClick","onKeyDown","showTooltip","renderContent","mergedMenuProps","jsxs","NavigableMenu","role","flatMap","controlSet","indexOfSet","map","control","indexOfControl","__next40pxDefaultSize","stopPropagation","onClose","isActive","title","undefined","accessibleWhenDisabled","disabled","isDisabled","join","DropdownMenu","exports","contextConnectWithoutRef","_default"],"sources":["@wordpress/components/src/dropdown-menu/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { menu } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { contextConnectWithoutRef, useContextSystem } from '../context';\nimport Button from '../button';\nimport Dropdown from '../dropdown';\nimport { NavigableMenu } from '../navigable-container';\nimport type {\n\tDropdownMenuProps,\n\tDropdownOption,\n\tDropdownMenuInternalContext,\n} from './types';\n\nfunction mergeProps<\n\tT extends { className?: string; [ key: string ]: unknown },\n>( defaultProps: Partial< T > = {}, props: T = {} as T ) {\n\tconst mergedProps: T = {\n\t\t...defaultProps,\n\t\t...props,\n\t};\n\n\tif ( props.className && defaultProps.className ) {\n\t\tmergedProps.className = clsx( props.className, defaultProps.className );\n\t}\n\n\treturn mergedProps;\n}\n\nfunction isFunction( maybeFunc: unknown ): maybeFunc is () => void {\n\treturn typeof maybeFunc === 'function';\n}\n\nfunction UnconnectedDropdownMenu( dropdownMenuProps: DropdownMenuProps ) {\n\tconst {\n\t\tchildren,\n\t\tclassName,\n\t\tcontrols,\n\t\ticon = menu,\n\t\tlabel,\n\t\tpopoverProps,\n\t\ttoggleProps,\n\t\tmenuProps,\n\t\tdisableOpenOnArrowDown = false,\n\t\ttext,\n\t\tnoIcons,\n\n\t\topen,\n\t\tdefaultOpen,\n\t\tonToggle: onToggleProp,\n\n\t\t// Context\n\t\tvariant,\n\t} = useContextSystem< DropdownMenuProps & DropdownMenuInternalContext >(\n\t\tdropdownMenuProps,\n\t\t'DropdownMenu'\n\t);\n\n\tif ( ! controls?.length && ! isFunction( children ) ) {\n\t\treturn null;\n\t}\n\n\t// Normalize controls to nested array of objects (sets of controls)\n\tlet controlSets: DropdownOption[][];\n\tif ( controls?.length ) {\n\t\t// @ts-expect-error The check below is needed because `DropdownMenus`\n\t\t// rendered by `ToolBarGroup` receive controls as a nested array.\n\t\tcontrolSets = controls;\n\t\tif ( ! Array.isArray( controlSets[ 0 ] ) ) {\n\t\t\t// This is not ideal, but at this point we know that `controls` is\n\t\t\t// not a nested array, even if TypeScript doesn't.\n\t\t\tcontrolSets = [ controls as DropdownOption[] ];\n\t\t}\n\t}\n\n\tconst mergedPopoverProps = mergeProps(\n\t\t{\n\t\t\tclassName: 'components-dropdown-menu__popover',\n\t\t\tvariant,\n\t\t},\n\t\tpopoverProps\n\t);\n\n\treturn (\n\t\t<Dropdown\n\t\t\tclassName={ className }\n\t\t\tpopoverProps={ mergedPopoverProps }\n\t\t\trenderToggle={ ( { isOpen, onToggle } ) => {\n\t\t\t\tconst openOnArrowDown = ( event: React.KeyboardEvent ) => {\n\t\t\t\t\tif ( disableOpenOnArrowDown ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ! isOpen && event.code === 'ArrowDown' ) {\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\tonToggle();\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tconst { as: Toggle = Button, ...restToggleProps } =\n\t\t\t\t\ttoggleProps ?? {};\n\n\t\t\t\tconst mergedToggleProps = mergeProps(\n\t\t\t\t\t{\n\t\t\t\t\t\tclassName: clsx( 'components-dropdown-menu__toggle', {\n\t\t\t\t\t\t\t'is-opened': isOpen,\n\t\t\t\t\t\t} ),\n\t\t\t\t\t},\n\t\t\t\t\trestToggleProps\n\t\t\t\t);\n\n\t\t\t\treturn (\n\t\t\t\t\t<Toggle\n\t\t\t\t\t\t{ ...mergedToggleProps }\n\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\tonClick={\n\t\t\t\t\t\t\t( ( event ) => {\n\t\t\t\t\t\t\t\tonToggle();\n\t\t\t\t\t\t\t\tif ( mergedToggleProps.onClick ) {\n\t\t\t\t\t\t\t\t\tmergedToggleProps.onClick( event );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} ) as React.MouseEventHandler< HTMLButtonElement >\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonKeyDown={\n\t\t\t\t\t\t\t( ( event ) => {\n\t\t\t\t\t\t\t\topenOnArrowDown( event );\n\t\t\t\t\t\t\t\tif ( mergedToggleProps.onKeyDown ) {\n\t\t\t\t\t\t\t\t\tmergedToggleProps.onKeyDown( event );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} ) as React.KeyboardEventHandler< HTMLButtonElement >\n\t\t\t\t\t\t}\n\t\t\t\t\t\taria-haspopup=\"true\"\n\t\t\t\t\t\taria-expanded={ isOpen }\n\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t\ttext={ text }\n\t\t\t\t\t\tshowTooltip={ toggleProps?.showTooltip ?? true }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ mergedToggleProps.children }\n\t\t\t\t\t</Toggle>\n\t\t\t\t);\n\t\t\t} }\n\t\t\trenderContent={ ( props ) => {\n\t\t\t\tconst mergedMenuProps = mergeProps(\n\t\t\t\t\t{\n\t\t\t\t\t\t'aria-label': label,\n\t\t\t\t\t\tclassName: clsx( 'components-dropdown-menu__menu', {\n\t\t\t\t\t\t\t'no-icons': noIcons,\n\t\t\t\t\t\t} ),\n\t\t\t\t\t},\n\t\t\t\t\tmenuProps\n\t\t\t\t);\n\n\t\t\t\treturn (\n\t\t\t\t\t<NavigableMenu { ...mergedMenuProps } role=\"menu\">\n\t\t\t\t\t\t{ isFunction( children ) ? children( props ) : null }\n\t\t\t\t\t\t{ controlSets?.flatMap( ( controlSet, indexOfSet ) =>\n\t\t\t\t\t\t\tcontrolSet.map( ( control, indexOfControl ) => (\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={ [\n\t\t\t\t\t\t\t\t\t\tindexOfSet,\n\t\t\t\t\t\t\t\t\t\tindexOfControl,\n\t\t\t\t\t\t\t\t\t].join() }\n\t\t\t\t\t\t\t\t\tonClick={ (\n\t\t\t\t\t\t\t\t\t\tevent: React.MouseEvent< HTMLButtonElement >\n\t\t\t\t\t\t\t\t\t) => {\n\t\t\t\t\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\t\t\t\t\tprops.onClose();\n\t\t\t\t\t\t\t\t\t\tif ( control.onClick ) {\n\t\t\t\t\t\t\t\t\t\t\tcontrol.onClick();\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\tclassName={ clsx(\n\t\t\t\t\t\t\t\t\t\t'components-dropdown-menu__menu-item',\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t'has-separator':\n\t\t\t\t\t\t\t\t\t\t\t\tindexOfSet > 0 &&\n\t\t\t\t\t\t\t\t\t\t\t\tindexOfControl === 0,\n\t\t\t\t\t\t\t\t\t\t\t'is-active': control.isActive,\n\t\t\t\t\t\t\t\t\t\t\t'is-icon-only': ! control.title,\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\ticon={ control.icon }\n\t\t\t\t\t\t\t\t\tlabel={ control.label }\n\t\t\t\t\t\t\t\t\taria-checked={\n\t\t\t\t\t\t\t\t\t\tcontrol.role === 'menuitemcheckbox' ||\n\t\t\t\t\t\t\t\t\t\tcontrol.role === 'menuitemradio'\n\t\t\t\t\t\t\t\t\t\t\t? control.isActive\n\t\t\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\trole={\n\t\t\t\t\t\t\t\t\t\tcontrol.role === 'menuitemcheckbox' ||\n\t\t\t\t\t\t\t\t\t\tcontrol.role === 'menuitemradio'\n\t\t\t\t\t\t\t\t\t\t\t? control.role\n\t\t\t\t\t\t\t\t\t\t\t: 'menuitem'\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\t\t\t\t\tdisabled={ control.isDisabled }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ control.title }\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</NavigableMenu>\n\t\t\t\t);\n\t\t\t} }\n\t\t\topen={ open }\n\t\t\tdefaultOpen={ defaultOpen }\n\t\t\tonToggle={ onToggleProp }\n\t\t/>\n\t);\n}\n\n/**\n *\n * The DropdownMenu displays a list of actions (each contained in a MenuItem,\n * MenuItemsChoice, or MenuGroup) in a compact way. It appears in a Popover\n * after the user has interacted with an element (a button or icon) or when\n * they perform a specific action.\n *\n * Render a Dropdown Menu with a set of controls:\n *\n * ```jsx\n * import { DropdownMenu } from '@wordpress/components';\n * import {\n * \tmore,\n * \tarrowLeft,\n * \tarrowRight,\n * \tarrowUp,\n * \tarrowDown,\n * } from '@wordpress/icons';\n *\n * const MyDropdownMenu = () => (\n * \t<DropdownMenu\n * \t\ticon={ more }\n * \t\tlabel=\"Select a direction\"\n * \t\tcontrols={ [\n * \t\t\t{\n * \t\t\t\ttitle: 'Up',\n * \t\t\t\ticon: arrowUp,\n * \t\t\t\tonClick: () => console.log( 'up' ),\n * \t\t\t},\n * \t\t\t{\n * \t\t\t\ttitle: 'Right',\n * \t\t\t\ticon: arrowRight,\n * \t\t\t\tonClick: () => console.log( 'right' ),\n * \t\t\t},\n * \t\t\t{\n * \t\t\t\ttitle: 'Down',\n * \t\t\t\ticon: arrowDown,\n * \t\t\t\tonClick: () => console.log( 'down' ),\n * \t\t\t},\n * \t\t\t{\n * \t\t\t\ttitle: 'Left',\n * \t\t\t\ticon: arrowLeft,\n * \t\t\t\tonClick: () => console.log( 'left' ),\n * \t\t\t},\n * \t\t] }\n * \t/>\n * );\n * ```\n *\n * Alternatively, specify a `children` function which returns elements valid for\n * use in a DropdownMenu: `MenuItem`, `MenuItemsChoice`, or `MenuGroup`.\n *\n * ```jsx\n * import { DropdownMenu, MenuGroup, MenuItem } from '@wordpress/components';\n * import { more, arrowUp, arrowDown, trash } from '@wordpress/icons';\n *\n * const MyDropdownMenu = () => (\n * \t<DropdownMenu icon={ more } label=\"Select a direction\">\n * \t\t{ ( { onClose } ) => (\n * \t\t\t<>\n * \t\t\t\t<MenuGroup>\n * \t\t\t\t\t<MenuItem icon={ arrowUp } onClick={ onClose }>\n * \t\t\t\t\t\tMove Up\n * \t\t\t\t\t</MenuItem>\n * \t\t\t\t\t<MenuItem icon={ arrowDown } onClick={ onClose }>\n * \t\t\t\t\t\tMove Down\n * \t\t\t\t\t</MenuItem>\n * \t\t\t\t</MenuGroup>\n * \t\t\t\t<MenuGroup>\n * \t\t\t\t\t<MenuItem icon={ trash } onClick={ onClose }>\n * \t\t\t\t\t\tRemove\n * \t\t\t\t\t</MenuItem>\n * \t\t\t\t</MenuGroup>\n * \t\t\t</>\n * \t\t) }\n * \t</DropdownMenu>\n * );\n * ```\n *\n */\nexport const DropdownMenu = contextConnectWithoutRef(\n\tUnconnectedDropdownMenu,\n\t'DropdownMenu'\n);\n\nexport default DropdownMenu;\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,MAAA,GAAAD,OAAA;AAKA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,SAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,mBAAA,GAAAL,OAAA;AAAuD,IAAAM,WAAA,GAAAN,OAAA;AAhBvD;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAWA,SAASO,UAAUA,CAEhBC,YAA0B,GAAG,CAAC,CAAC,EAAEC,KAAQ,GAAG,CAAC,CAAM,EAAG;EACxD,MAAMC,WAAc,GAAG;IACtB,GAAGF,YAAY;IACf,GAAGC;EACJ,CAAC;EAED,IAAKA,KAAK,CAACE,SAAS,IAAIH,YAAY,CAACG,SAAS,EAAG;IAChDD,WAAW,CAACC,SAAS,GAAG,IAAAC,aAAI,EAAEH,KAAK,CAACE,SAAS,EAAEH,YAAY,CAACG,SAAU,CAAC;EACxE;EAEA,OAAOD,WAAW;AACnB;AAEA,SAASG,UAAUA,CAAEC,SAAkB,EAA4B;EAClE,OAAO,OAAOA,SAAS,KAAK,UAAU;AACvC;AAEA,SAASC,uBAAuBA,CAAEC,iBAAoC,EAAG;EACxE,MAAM;IACLC,QAAQ;IACRN,SAAS;IACTO,QAAQ;IACRC,IAAI,GAAGC,WAAI;IACXC,KAAK;IACLC,YAAY;IACZC,WAAW;IACXC,SAAS;IACTC,sBAAsB,GAAG,KAAK;IAC9BC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AC;AAEJ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;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;AACA;AACA;AACA;AACO,MAAM8C,YAAY,GAAAC,OAAA,CAAAD,YAAA,GAAG,IAAAE,iCAAwB,EACnDhE,uBAAuB,EACvB,cACD,CAAC;AAAC,IAAAiE,QAAA,GAAAF,OAAA,CAAAtC,OAAA,GAEaqC,YAAY","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","_reactNative","_compose","_icons","_button","_dropdown","_bottomSheet","_body","_jsxRuntime","mergeProps","defaultProps","props","mergedProps","className","clsx","isFunction","maybeFunc","DropdownMenu","children","controls","icon","menu","label","popoverProps","toggleProps","length","controlSets","Array","isArray","mergedPopoverProps","jsx","default","renderToggle","isOpen","onToggle","mergedToggleProps","onClick","event","renderContent","onClose","jsxs","hideHeader","isVisible","title","style","paddingLeft","paddingRight","flatMap","controlSet","indexOfSet","map","control","indexOfControl","Cell","onPress","editable","leftAlign","isSelected","isActive","separatorType","Platform","OS","join","_default","exports","withPreferredColorScheme"],"sources":["@wordpress/components/src/dropdown-menu/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\nimport { Platform } from 'react-native';\n/**\n * WordPress dependencies\n */\nimport { withPreferredColorScheme } from '@wordpress/compose';\nimport { menu } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport Button from '../button';\nimport Dropdown from '../dropdown';\nimport BottomSheet from '../mobile/bottom-sheet';\nimport PanelBody from '../panel/body';\n\nfunction mergeProps( defaultProps = {}, props = {} ) {\n\tconst mergedProps = {\n\t\t...defaultProps,\n\t\t...props,\n\t};\n\n\tif ( props.className && defaultProps.className ) {\n\t\tmergedProps.className = clsx( props.className, defaultProps.className );\n\t}\n\n\treturn mergedProps;\n}\n\n/**\n * Whether the argument is a function.\n *\n * @param {*} maybeFunc The argument to check.\n * @return {boolean} True if the argument is a function, false otherwise.\n */\nfunction isFunction( maybeFunc ) {\n\treturn typeof maybeFunc === 'function';\n}\n\nfunction DropdownMenu( {\n\tchildren,\n\tclassName,\n\tcontrols,\n\ticon = menu,\n\tlabel,\n\tpopoverProps,\n\ttoggleProps,\n} ) {\n\tif ( ! controls?.length && ! isFunction( children ) ) {\n\t\treturn null;\n\t}\n\n\t// Normalize controls to nested array of objects (sets of controls)\n\tlet controlSets;\n\tif ( controls?.length ) {\n\t\tcontrolSets = controls;\n\t\tif ( ! Array.isArray( controlSets[ 0 ] ) ) {\n\t\t\tcontrolSets = [ controlSets ];\n\t\t}\n\t}\n\tconst mergedPopoverProps = mergeProps(\n\t\t{\n\t\t\tclassName: 'components-dropdown-menu__popover',\n\t\t},\n\t\tpopoverProps\n\t);\n\n\treturn (\n\t\t<Dropdown\n\t\t\tclassName={ clsx( 'components-dropdown-menu', className ) }\n\t\t\tpopoverProps={ mergedPopoverProps }\n\t\t\trenderToggle={ ( { isOpen, onToggle } ) => {\n\t\t\t\tconst mergedToggleProps = mergeProps(\n\t\t\t\t\t{\n\t\t\t\t\t\tclassName: clsx( 'components-dropdown-menu__toggle', {\n\t\t\t\t\t\t\t'is-opened': isOpen,\n\t\t\t\t\t\t} ),\n\t\t\t\t\t},\n\t\t\t\t\ttoggleProps\n\t\t\t\t);\n\n\t\t\t\treturn (\n\t\t\t\t\t<Button\n\t\t\t\t\t\t{ ...mergedToggleProps }\n\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\tonClick={ ( event ) => {\n\t\t\t\t\t\t\tonToggle( event );\n\t\t\t\t\t\t\tif ( mergedToggleProps.onClick ) {\n\t\t\t\t\t\t\t\tmergedToggleProps.onClick( event );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} }\n\t\t\t\t\t\taria-haspopup=\"true\"\n\t\t\t\t\t\taria-expanded={ isOpen }\n\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ mergedToggleProps.children }\n\t\t\t\t\t</Button>\n\t\t\t\t);\n\t\t\t} }\n\t\t\trenderContent={ ( { isOpen, onClose, ...props } ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<BottomSheet\n\t\t\t\t\t\thideHeader\n\t\t\t\t\t\tisVisible={ isOpen }\n\t\t\t\t\t\tonClose={ onClose }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ isFunction( children ) ? children( props ) : null }\n\t\t\t\t\t\t<PanelBody\n\t\t\t\t\t\t\ttitle={ label }\n\t\t\t\t\t\t\tstyle={ { paddingLeft: 0, paddingRight: 0 } }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ controlSets?.flatMap(\n\t\t\t\t\t\t\t\t( controlSet, indexOfSet ) =>\n\t\t\t\t\t\t\t\t\tcontrolSet.map(\n\t\t\t\t\t\t\t\t\t\t( control, indexOfControl ) => (\n\t\t\t\t\t\t\t\t\t\t\t<BottomSheet.Cell\n\t\t\t\t\t\t\t\t\t\t\t\tkey={ [\n\t\t\t\t\t\t\t\t\t\t\t\t\tindexOfSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tindexOfControl,\n\t\t\t\t\t\t\t\t\t\t\t\t].join() }\n\t\t\t\t\t\t\t\t\t\t\t\tlabel={ control.title }\n\t\t\t\t\t\t\t\t\t\t\t\tonPress={ () => {\n\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\tif ( control.onClick ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tcontrol.onClick();\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\teditable={ false }\n\t\t\t\t\t\t\t\t\t\t\t\ticon={ control.icon }\n\t\t\t\t\t\t\t\t\t\t\t\tleftAlign\n\t\t\t\t\t\t\t\t\t\t\t\tisSelected={ control.isActive }\n\t\t\t\t\t\t\t\t\t\t\t\tseparatorType={\n\t\t\t\t\t\t\t\t\t\t\t\t\tPlatform.OS === 'android'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t? 'none'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t: 'leftMargin'\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/>\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) }\n\t\t\t\t\t\t</PanelBody>\n\t\t\t\t\t</BottomSheet>\n\t\t\t\t);\n\t\t\t} }\n\t\t/>\n\t);\n}\n\nexport default withPreferredColorScheme( DropdownMenu );\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAIA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAKA,IAAAI,OAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,SAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,YAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,KAAA,GAAAR,sBAAA,CAAAC,OAAA;AAAsC,IAAAQ,WAAA,GAAAR,OAAA;AAjBtC;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;;AAMA,SAASS,UAAUA,CAAEC,Y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AAW,CAACsB,IAAI;YAKhB/B,KAAK,EAAG6B,OAAO,CAACR,KAAO;YACvBW,OAAO,EAAGA,CAAA,KAAM;cACff,OAAO,CAAC,CAAC;cACT,IAAKY,OAAO,CAACf,OAAO,EAAG;gBACtBe,OAAO,CAACf,OAAO,CAAC,CAAC;cAClB;YACD,CAAG;YACHmB,QAAQ,EAAG,KAAO;YAClBnC,IAAI,EAAG+B,OAAO,CAAC/B,IAAM;YACrBoC,SAAS;YACTC,UAAU,EAAGN,OAAO,CAACO,QAAU;YAC/BC,aAAa,EACZC,qBAAQ,CAACC,EAAE,KAAK,SAAS,GACtB,MAAM,GACN;UACH,GAnBK,CACLZ,UAAU,EACVG,cAAc,CACd,CAACU,IAAI,CAAC,CAiBP,CAEH,CACF;QAAC,CACS,CAAC;MAAA,CACA,CAAC;IAEhB;EAAG,CACH,CAAC;AAEJ;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAjC,OAAA,GAEc,IAAAkC,iCAAwB,EAAEhD,YAAa,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_reactNative","_compose","_icons","_button","_dropdown","_bottomSheet","_body","_jsxRuntime","mergeProps","defaultProps","props","mergedProps","className","clsx","isFunction","maybeFunc","DropdownMenu","children","controls","icon","menu","label","popoverProps","toggleProps","length","controlSets","Array","isArray","mergedPopoverProps","jsx","default","renderToggle","isOpen","onToggle","mergedToggleProps","onClick","event","renderContent","onClose","jsxs","hideHeader","isVisible","title","style","paddingLeft","paddingRight","flatMap","controlSet","indexOfSet","map","control","indexOfControl","Cell","onPress","editable","leftAlign","isSelected","isActive","separatorType","Platform","OS","join","_default","exports","withPreferredColorScheme"],"sources":["@wordpress/components/src/dropdown-menu/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\nimport { Platform } from 'react-native';\n/**\n * WordPress dependencies\n */\nimport { withPreferredColorScheme } from '@wordpress/compose';\nimport { menu } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport Button from '../button';\nimport Dropdown from '../dropdown';\nimport BottomSheet from '../mobile/bottom-sheet';\nimport PanelBody from '../panel/body';\n\nfunction mergeProps( defaultProps = {}, props = {} ) {\n\tconst mergedProps = {\n\t\t...defaultProps,\n\t\t...props,\n\t};\n\n\tif ( props.className && defaultProps.className ) {\n\t\tmergedProps.className = clsx( props.className, defaultProps.className );\n\t}\n\n\treturn mergedProps;\n}\n\n/**\n * Whether the argument is a function.\n *\n * @param {*} maybeFunc The argument to check.\n * @return {boolean} True if the argument is a function, false otherwise.\n */\nfunction isFunction( maybeFunc ) {\n\treturn typeof maybeFunc === 'function';\n}\n\nfunction DropdownMenu( {\n\tchildren,\n\tclassName,\n\tcontrols,\n\ticon = menu,\n\tlabel,\n\tpopoverProps,\n\ttoggleProps,\n} ) {\n\tif ( ! controls?.length && ! isFunction( children ) ) {\n\t\treturn null;\n\t}\n\n\t// Normalize controls to nested array of objects (sets of controls)\n\tlet controlSets;\n\tif ( controls?.length ) {\n\t\tcontrolSets = controls;\n\t\tif ( ! Array.isArray( controlSets[ 0 ] ) ) {\n\t\t\tcontrolSets = [ controlSets ];\n\t\t}\n\t}\n\tconst mergedPopoverProps = mergeProps(\n\t\t{\n\t\t\tclassName: 'components-dropdown-menu__popover',\n\t\t},\n\t\tpopoverProps\n\t);\n\n\treturn (\n\t\t<Dropdown\n\t\t\tclassName={ clsx( 'components-dropdown-menu', className ) }\n\t\t\tpopoverProps={ mergedPopoverProps }\n\t\t\trenderToggle={ ( { isOpen, onToggle } ) => {\n\t\t\t\tconst mergedToggleProps = mergeProps(\n\t\t\t\t\t{\n\t\t\t\t\t\tclassName: clsx( 'components-dropdown-menu__toggle', {\n\t\t\t\t\t\t\t'is-opened': isOpen,\n\t\t\t\t\t\t} ),\n\t\t\t\t\t},\n\t\t\t\t\ttoggleProps\n\t\t\t\t);\n\n\t\t\t\treturn (\n\t\t\t\t\t<Button\n\t\t\t\t\t\t{ ...mergedToggleProps }\n\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\tonClick={ ( event ) => {\n\t\t\t\t\t\t\tonToggle( event );\n\t\t\t\t\t\t\tif ( mergedToggleProps.onClick ) {\n\t\t\t\t\t\t\t\tmergedToggleProps.onClick( event );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} }\n\t\t\t\t\t\taria-haspopup=\"true\"\n\t\t\t\t\t\taria-expanded={ isOpen }\n\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ mergedToggleProps.children }\n\t\t\t\t\t</Button>\n\t\t\t\t);\n\t\t\t} }\n\t\t\trenderContent={ ( { isOpen, onClose, ...props } ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<BottomSheet\n\t\t\t\t\t\thideHeader\n\t\t\t\t\t\tisVisible={ isOpen }\n\t\t\t\t\t\tonClose={ onClose }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ isFunction( children ) ? children( props ) : null }\n\t\t\t\t\t\t<PanelBody\n\t\t\t\t\t\t\ttitle={ label }\n\t\t\t\t\t\t\tstyle={ { paddingLeft: 0, paddingRight: 0 } }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ controlSets?.flatMap(\n\t\t\t\t\t\t\t\t( controlSet, indexOfSet ) =>\n\t\t\t\t\t\t\t\t\tcontrolSet.map(\n\t\t\t\t\t\t\t\t\t\t( control, indexOfControl ) => (\n\t\t\t\t\t\t\t\t\t\t\t<BottomSheet.Cell\n\t\t\t\t\t\t\t\t\t\t\t\tkey={ [\n\t\t\t\t\t\t\t\t\t\t\t\t\tindexOfSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tindexOfControl,\n\t\t\t\t\t\t\t\t\t\t\t\t].join() }\n\t\t\t\t\t\t\t\t\t\t\t\tlabel={ control.title }\n\t\t\t\t\t\t\t\t\t\t\t\tonPress={ () => {\n\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\tif ( control.onClick ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tcontrol.onClick();\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\teditable={ false }\n\t\t\t\t\t\t\t\t\t\t\t\ticon={ control.icon }\n\t\t\t\t\t\t\t\t\t\t\t\tleftAlign\n\t\t\t\t\t\t\t\t\t\t\t\tisSelected={ control.isActive }\n\t\t\t\t\t\t\t\t\t\t\t\tseparatorType={\n\t\t\t\t\t\t\t\t\t\t\t\t\tPlatform.OS === 'android'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t? 'none'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t: 'leftMargin'\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/>\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) }\n\t\t\t\t\t\t</PanelBody>\n\t\t\t\t\t</BottomSheet>\n\t\t\t\t);\n\t\t\t} }\n\t\t/>\n\t);\n}\n\nexport default withPreferredColorScheme( DropdownMenu );\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAIA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAKA,IAAAI,OAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,SAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,YAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,KAAA,GAAAR,sBAAA,CAAAC,OAAA;AAAsC,IAAAQ,WAAA,GAAAR,OAAA;AAjBtC;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;;AAMA,SAASS,UAAUA,CAAEC,YAAY,GAAG,CAAC,CAAC,EAAEC,KAAK,GAAG,CAAC,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CAACR,KAAO;YACvBW,OAAO,EAAGA,CAAA,KAAM;cACff,OAAO,CAAC,CAAC;cACT,IAAKY,OAAO,CAACf,OAAO,EAAG;gBACtBe,OAAO,CAACf,OAAO,CAAC,CAAC;cAClB;YACD,CAAG;YACHmB,QAAQ,EAAG,KAAO;YAClBnC,IAAI,EAAG+B,OAAO,CAAC/B,IAAM;YACrBoC,SAAS;YACTC,UAAU,EAAGN,OAAO,CAACO,QAAU;YAC/BC,aAAa,EACZC,qBAAQ,CAACC,EAAE,KAAK,SAAS,GACtB,MAAM,GACN;UACH,GAnBK,CACLZ,UAAU,EACVG,cAAc,CACd,CAACU,IAAI,CAAC,CAiBP,CAEH,CACF;QAAC,CACS,CAAC;MAAA,CACA,CAAC;IAEhB;EAAG,CACH,CAAC;AAEJ;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAjC,OAAA,GAEc,IAAAkC,iCAAwB,EAAEhD,YAAa,CAAC","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":["_element","require","_icons","_i18n","_button","_interopRequireDefault","_colorPalette","_colorIndicator","_icon","_compose","_jsxRuntime","ColorOption","label","value","colors","disableCustomColors","enableAlpha","onChange","isOpen","setIsOpen","useState","idRoot","useInstanceId","labelId","contentId","jsxs","Fragment","children","jsx","default","__next40pxDefaultSize","className","id","onClick","prev","icon","colorValue","swatch","text","role","__","clearable","ColorListPicker","labels","map","index","newColor","newColors","slice","_default","exports"],"sources":["@wordpress/components/src/duotone-picker/color-list-picker/index.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState } from '@wordpress/element';\nimport { swatch } from '@wordpress/icons';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport Button from '../../button';\nimport ColorPalette from '../../color-palette';\nimport ColorIndicator from '../../color-indicator';\nimport Icon from '../../icon';\nimport type { ColorListPickerProps, ColorOptionProps } from './types';\nimport { useInstanceId } from '@wordpress/compose';\n\nfunction ColorOption( {\n\tlabel,\n\tvalue,\n\tcolors,\n\tdisableCustomColors,\n\tenableAlpha,\n\tonChange,\n}: ColorOptionProps ) {\n\tconst [ isOpen, setIsOpen ] = useState( false );\n\tconst idRoot = useInstanceId( ColorOption, 'color-list-picker-option' );\n\tconst labelId = `${ idRoot }__label`;\n\tconst contentId = `${ idRoot }__content`;\n\n\treturn (\n\t\t<>\n\t\t\t<Button\n\t\t\t\t__next40pxDefaultSize\n\t\t\t\tclassName=\"components-color-list-picker__swatch-button\"\n\t\t\t\tid={ labelId }\n\t\t\t\tonClick={ () => setIsOpen( ( prev ) => ! prev ) }\n\t\t\t\taria-expanded={ isOpen }\n\t\t\t\taria-controls={ contentId }\n\t\t\t\ticon={\n\t\t\t\t\tvalue ? (\n\t\t\t\t\t\t<ColorIndicator\n\t\t\t\t\t\t\tcolorValue={ value }\n\t\t\t\t\t\t\tclassName=\"components-color-list-picker__swatch-color\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<Icon icon={ swatch } />\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\ttext={ label }\n\t\t\t/>\n\t\t\t<div\n\t\t\t\trole=\"group\"\n\t\t\t\tid={ contentId }\n\t\t\t\taria-labelledby={ labelId }\n\t\t\t\taria-hidden={ ! isOpen }\n\t\t\t>\n\t\t\t\t{ isOpen && (\n\t\t\t\t\t<ColorPalette\n\t\t\t\t\t\taria-label={ __( 'Color options' ) }\n\t\t\t\t\t\tclassName=\"components-color-list-picker__color-picker\"\n\t\t\t\t\t\tcolors={ colors }\n\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\tclearable={ false }\n\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\tdisableCustomColors={ disableCustomColors }\n\t\t\t\t\t\tenableAlpha={ enableAlpha }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t</>\n\t);\n}\n\nfunction ColorListPicker( {\n\tcolors,\n\tlabels,\n\tvalue = [],\n\tdisableCustomColors,\n\tenableAlpha,\n\tonChange,\n}: ColorListPickerProps ) {\n\treturn (\n\t\t<div className=\"components-color-list-picker\">\n\t\t\t{ labels.map( ( label, index ) => (\n\t\t\t\t<ColorOption\n\t\t\t\t\tkey={ index }\n\t\t\t\t\tlabel={ label }\n\t\t\t\t\tvalue={ value[ index ] }\n\t\t\t\t\tcolors={ colors }\n\t\t\t\t\tdisableCustomColors={ disableCustomColors }\n\t\t\t\t\tenableAlpha={ enableAlpha }\n\t\t\t\t\tonChange={ ( newColor ) => {\n\t\t\t\t\t\tconst newColors: ( string | undefined )[] =\n\t\t\t\t\t\t\tvalue.slice();\n\t\t\t\t\t\tnewColors[ index ] = newColor;\n\t\t\t\t\t\tonChange( newColors );\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t</div>\n\t);\n}\n\nexport default ColorListPicker;\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AAKA,IAAAG,OAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,aAAA,GAAAD,sBAAA,CAAAJ,OAAA;AACA,IAAAM,eAAA,GAAAF,sBAAA,CAAAJ,OAAA;AACA,IAAAO,KAAA,GAAAH,sBAAA,CAAAJ,OAAA;AAEA,IAAAQ,QAAA,GAAAR,OAAA;AAAmD,IAAAS,WAAA,GAAAT,OAAA;AAfnD;AACA;AACA;;AAKA;AACA;AACA;;AAQA,SAASU,WAAWA,CAAE;EACrBC,KAAK;EACLC,KAAK;EACLC,MAAM;EACNC,mBAAmB;EACnBC,WAAW;EACXC;AACiB,CAAC,EAAG;EACrB,MAAM,CAAEC,MAAM,EAAEC,SAAS,CAAE,GAAG,IAAAC,iBAAQ,EAAE,K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qB;QAC3CC,WAAW,EAAGA;MAAa,CAC3B;IACD,CACG,CAAC;EAAA,CACL,CAAC;AAEL;AAEA,SAAS0B,eAAeA,CAAE;EACzB5B,MAAM;EACN6B,MAAM;EACN9B,KAAK,GAAG,EAAE;EACVE,mBAAmB;EACnBC,WAAW;EACXC;AACqB,CAAC,EAAG;EACzB,oBACC,IAAAP,WAAA,CAAAkB,GAAA;IAAKG,SAAS,EAAC,8BAA8B;IAAAJ,QAAA,EAC1CgB,MAAM,CAACC,GAAG,CAAE,CAAEhC,KAAK,EAAEiC,KAAK,kBAC3B,IAAAnC,WAAA,CAAAkB,GAAA,EAACjB,WAAW;MAEXC,KAAK,EAAGA,KAAO;MACfC,KAAK,EAAGA,KAAK,CAAEgC,KAAK,CAAI;MACxB/B,MAAM,EAAGA,MAAQ;MACjBC,mBAAmB,EAAGA,mBAAqB;MAC3CC,WAAW,EAAGA,WAAa;MAC3BC,QAAQ,EAAK6B,QAAQ,IAAM;QAC1B,MAAMC,SAAmC,GACxClC,KAAK,CAACmC,KAAK,CAAC,CAAC;QACdD,SAAS,CAAEF,KAAK,CAAE,GAAGC,QAAQ;QAC7B7B,QAAQ,CAAE8B,SAAU,CAAC;MACtB;IAAG,GAXGF,KAYN,CACA;EAAC,CACC,CAAC;AAER;AAAC,IAAAI,QAAA,GAAAC,OAAA,CAAArB,OAAA,GAEca,eAAe","ignoreList":[]}
1
+ {"version":3,"names":["_element","require","_icons","_i18n","_button","_interopRequireDefault","_colorPalette","_colorIndicator","_icon","_compose","_jsxRuntime","ColorOption","label","value","colors","disableCustomColors","enableAlpha","onChange","isOpen","setIsOpen","useState","idRoot","useInstanceId","labelId","contentId","jsxs","Fragment","children","jsx","default","__next40pxDefaultSize","className","id","onClick","prev","icon","colorValue","swatch","text","role","__","clearable","ColorListPicker","labels","map","index","newColor","newColors","slice","_default","exports"],"sources":["@wordpress/components/src/duotone-picker/color-list-picker/index.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState } from '@wordpress/element';\nimport { swatch } from '@wordpress/icons';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport Button from '../../button';\nimport ColorPalette from '../../color-palette';\nimport ColorIndicator from '../../color-indicator';\nimport Icon from '../../icon';\nimport type { ColorListPickerProps, ColorOptionProps } from './types';\nimport { useInstanceId } from '@wordpress/compose';\n\nfunction ColorOption( {\n\tlabel,\n\tvalue,\n\tcolors,\n\tdisableCustomColors,\n\tenableAlpha,\n\tonChange,\n}: ColorOptionProps ) {\n\tconst [ isOpen, setIsOpen ] = useState( false );\n\tconst idRoot = useInstanceId( ColorOption, 'color-list-picker-option' );\n\tconst labelId = `${ idRoot }__label`;\n\tconst contentId = `${ idRoot }__content`;\n\n\treturn (\n\t\t<>\n\t\t\t<Button\n\t\t\t\t__next40pxDefaultSize\n\t\t\t\tclassName=\"components-color-list-picker__swatch-button\"\n\t\t\t\tid={ labelId }\n\t\t\t\tonClick={ () => setIsOpen( ( prev ) => ! prev ) }\n\t\t\t\taria-expanded={ isOpen }\n\t\t\t\taria-controls={ contentId }\n\t\t\t\ticon={\n\t\t\t\t\tvalue ? (\n\t\t\t\t\t\t<ColorIndicator\n\t\t\t\t\t\t\tcolorValue={ value }\n\t\t\t\t\t\t\tclassName=\"components-color-list-picker__swatch-color\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<Icon icon={ swatch } />\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\ttext={ label }\n\t\t\t/>\n\t\t\t<div\n\t\t\t\trole=\"group\"\n\t\t\t\tid={ contentId }\n\t\t\t\taria-labelledby={ labelId }\n\t\t\t\taria-hidden={ ! isOpen }\n\t\t\t>\n\t\t\t\t{ isOpen && (\n\t\t\t\t\t<ColorPalette\n\t\t\t\t\t\taria-label={ __( 'Color options' ) }\n\t\t\t\t\t\tclassName=\"components-color-list-picker__color-picker\"\n\t\t\t\t\t\tcolors={ colors }\n\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\tclearable={ false }\n\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\tdisableCustomColors={ disableCustomColors }\n\t\t\t\t\t\tenableAlpha={ enableAlpha }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t</>\n\t);\n}\n\nfunction ColorListPicker( {\n\tcolors,\n\tlabels,\n\tvalue = [],\n\tdisableCustomColors,\n\tenableAlpha,\n\tonChange,\n}: ColorListPickerProps ) {\n\treturn (\n\t\t<div className=\"components-color-list-picker\">\n\t\t\t{ labels.map( ( label, index ) => (\n\t\t\t\t<ColorOption\n\t\t\t\t\tkey={ index }\n\t\t\t\t\tlabel={ label }\n\t\t\t\t\tvalue={ value[ index ] }\n\t\t\t\t\tcolors={ colors }\n\t\t\t\t\tdisableCustomColors={ disableCustomColors }\n\t\t\t\t\tenableAlpha={ enableAlpha }\n\t\t\t\t\tonChange={ ( newColor ) => {\n\t\t\t\t\t\tconst newColors: ( string | undefined )[] =\n\t\t\t\t\t\t\tvalue.slice();\n\t\t\t\t\t\tnewColors[ index ] = newColor;\n\t\t\t\t\t\tonChange( newColors );\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t</div>\n\t);\n}\n\nexport default ColorListPicker;\n"],"mappings":";;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AAKA,IAAAG,OAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,aAAA,GAAAD,sBAAA,CAAAJ,OAAA;AACA,IAAAM,eAAA,GAAAF,sBAAA,CAAAJ,OAAA;AACA,IAAAO,KAAA,GAAAH,sBAAA,CAAAJ,OAAA;AAEA,IAAAQ,QAAA,GAAAR,OAAA;AAAmD,IAAAS,WAAA,GAAAT,OAAA;AAfnD;AACA;AACA;;AAKA;AACA;AACA;;AAQA,SAASU,WAAWA,CAAE;EACrBC,KA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,EAAC,4CAA4C;QACtDjB,MAAM,EAAGA,MAAQ;QACjBD,KAAK,EAAGA,KAAO;QACf4B,SAAS,EAAG,KAAO;QACnBxB,QAAQ,EAAGA,QAAU;QACrBF,mBAAmB,EAAGA,mBAAqB;QAC3CC,WAAW,EAAGA;MAAa,CAC3B;IACD,CACG,CAAC;EAAA,CACL,CAAC;AAEL;AAEA,SAAS0B,eAAeA,CAAE;EACzB5B,MAAM;EACN6B,MAAM;EACN9B,KAAK,GAAG,EAAE;EACVE,mBAAmB;EACnBC,WAAW;EACXC;AACqB,CAAC,EAAG;EACzB,oBACC,IAAAP,WAAA,CAAAkB,GAAA;IAAKG,SAAS,EAAC,8BAA8B;IAAAJ,QAAA,EAC1CgB,MAAM,CAACC,GAAG,CAAE,CAAEhC,KAAK,EAAEiC,KAAK,kBAC3B,IAAAnC,WAAA,CAAAkB,GAAA,EAACjB,WAAW;MAEXC,KAAK,EAAGA,KAAO;MACfC,KAAK,EAAGA,KAAK,CAAEgC,KAAK,CAAI;MACxB/B,MAAM,EAAGA,MAAQ;MACjBC,mBAAmB,EAAGA,mBAAqB;MAC3CC,WAAW,EAAGA,WAAa;MAC3BC,QAAQ,EAAK6B,QAAQ,IAAM;QAC1B,MAAMC,SAAmC,GACxClC,KAAK,CAACmC,KAAK,CAAC,CAAC;QACdD,SAAS,CAAEF,KAAK,CAAE,GAAGC,QAAQ;QAC7B7B,QAAQ,CAAE8B,SAAU,CAAC;MACtB;IAAG,GAXGF,KAYN,CACA;EAAC,CACC,CAAC;AAER;AAAC,IAAAI,QAAA,GAAAC,OAAA,CAAArB,OAAA,GAEca,eAAe","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":["_es","_interopRequireDefault","require","_element","_i18n","_colorListPicker","_circularOptionPicker","_vStack","_customDuotoneBar","_utils","_spacer","_jsxRuntime","DuotonePicker","asButtons","loop","clearable","unsetable","colorPalette","duotonePalette","disableCustomColors","disableCustomDuotone","value","onChange","ariaLabel","ariaLabelledby","otherProps","defaultDark","defaultLight","useMemo","getDefaultColors","isUnset","unsetOptionLabel","__","unsetOption","jsx","default","Option","isSelected","tooltipText","className","onClick","undefined","duotoneOptions","map","colors","slug","name","style","background","getGradientFromCSSColors","color","sprintf","label","fastDeepEqual","metaProps","_metaProps","options","actions","ButtonAction","accessibleWhenDisabled","disabled","children","Spacer","paddingTop","length","jsxs","VStack","spacing","labels","enableAlpha","newColors","newValue","_default","exports"],"sources":["@wordpress/components/src/duotone-picker/duotone-picker.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport fastDeepEqual from 'fast-deep-equal/es6';\n\n/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport ColorListPicker from './color-list-picker';\nimport CircularOptionPicker from '../circular-option-picker';\nimport { VStack } from '../v-stack';\n\nimport CustomDuotoneBar from './custom-duotone-bar';\nimport { getDefaultColors, getGradientFromCSSColors } from './utils';\nimport { Spacer } from '../spacer';\nimport type { DuotonePickerProps } from './types';\n\n/**\n * ```jsx\n * import { DuotonePicker, DuotoneSwatch } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const DUOTONE_PALETTE = [\n * \t{ colors: [ '#8c00b7', '#fcff41' ], name: 'Purple and yellow', slug: 'purple-yellow' },\n * \t{ colors: [ '#000097', '#ff4747' ], name: 'Blue and red', slug: 'blue-red' },\n * ];\n *\n * const COLOR_PALETTE = [\n * \t{ color: '#ff4747', name: 'Red', slug: 'red' },\n * \t{ color: '#fcff41', name: 'Yellow', slug: 'yellow' },\n * \t{ color: '#000097', name: 'Blue', slug: 'blue' },\n * \t{ color: '#8c00b7', name: 'Purple', slug: 'purple' },\n * ];\n *\n * const Example = () => {\n * \tconst [ duotone, setDuotone ] = useState( [ '#000000', '#ffffff' ] );\n * \treturn (\n * \t\t<>\n * \t\t\t<DuotonePicker\n * \t\t\t\tduotonePalette={ DUOTONE_PALETTE }\n * \t\t\t\tcolorPalette={ COLOR_PALETTE }\n * \t\t\t\tvalue={ duotone }\n * \t\t\t\tonChange={ setDuotone }\n * \t\t\t/>\n * \t\t\t<DuotoneSwatch values={ duotone } />\n * \t\t</>\n * \t);\n * };\n * ```\n */\nfunction DuotonePicker( {\n\tasButtons,\n\tloop,\n\tclearable = true,\n\tunsetable = true,\n\tcolorPalette,\n\tduotonePalette,\n\tdisableCustomColors,\n\tdisableCustomDuotone,\n\tvalue,\n\tonChange,\n\t'aria-label': ariaLabel,\n\t'aria-labelledby': ariaLabelledby,\n\t...otherProps\n}: DuotonePickerProps ) {\n\tconst [ defaultDark, defaultLight ] = useMemo(\n\t\t() => getDefaultColors( colorPalette ),\n\t\t[ colorPalette ]\n\t);\n\n\tconst isUnset = value === 'unset';\n\tconst unsetOptionLabel = __( 'Unset' );\n\n\tconst unsetOption = (\n\t\t<CircularOptionPicker.Option\n\t\t\tkey=\"unset\"\n\t\t\tvalue=\"unset\"\n\t\t\tisSelected={ isUnset }\n\t\t\ttooltipText={ unsetOptionLabel }\n\t\t\taria-label={ unsetOptionLabel }\n\t\t\tclassName=\"components-duotone-picker__color-indicator\"\n\t\t\tonClick={ () => {\n\t\t\t\tonChange( isUnset ? undefined : 'unset' );\n\t\t\t} }\n\t\t/>\n\t);\n\n\tconst duotoneOptions = duotonePalette.map( ( { colors, slug, name } ) => {\n\t\tconst style = {\n\t\t\tbackground: getGradientFromCSSColors( colors, '135deg' ),\n\t\t\tcolor: 'transparent',\n\t\t};\n\t\tconst tooltipText =\n\t\t\tname ??\n\t\t\tsprintf(\n\t\t\t\t// translators: %s: duotone code e.g: \"dark-grayscale\" or \"7f7f7f-ffffff\".\n\t\t\t\t__( 'Duotone code: %s' ),\n\t\t\t\tslug\n\t\t\t);\n\t\tconst label = name\n\t\t\t? sprintf(\n\t\t\t\t\t// translators: %s: The name of the option e.g: \"Dark grayscale\".\n\t\t\t\t\t__( 'Duotone: %s' ),\n\t\t\t\t\tname\n\t\t\t )\n\t\t\t: tooltipText;\n\t\tconst isSelected = fastDeepEqual( colors, value );\n\n\t\treturn (\n\t\t\t<CircularOptionPicker.Option\n\t\t\t\tkey={ slug }\n\t\t\t\tvalue={ colors }\n\t\t\t\tisSelected={ isSelected }\n\t\t\t\taria-label={ label }\n\t\t\t\ttooltipText={ tooltipText }\n\t\t\t\tstyle={ style }\n\t\t\t\tonClick={ () => {\n\t\t\t\t\tonChange( isSelected ? undefined : colors );\n\t\t\t\t} }\n\t\t\t/>\n\t\t);\n\t} );\n\n\tlet metaProps:\n\t\t| { asButtons: false; loop?: boolean; 'aria-label': string }\n\t\t| { asButtons: false; loop?: boolean; 'aria-labelledby': string }\n\t\t| { asButtons: true };\n\n\tif ( asButtons ) {\n\t\tmetaProps = { asButtons: true };\n\t} else {\n\t\tconst _metaProps: { asButtons: false; loop?: boolean } = {\n\t\t\tasButtons: false,\n\t\t\tloop,\n\t\t};\n\n\t\tif ( ariaLabel ) {\n\t\t\tmetaProps = { ..._metaProps, 'aria-label': ariaLabel };\n\t\t} else if ( ariaLabelledby ) {\n\t\t\tmetaProps = {\n\t\t\t\t..._metaProps,\n\t\t\t\t'aria-labelledby': ariaLabelledby,\n\t\t\t};\n\t\t} else {\n\t\t\tmetaProps = {\n\t\t\t\t..._metaProps,\n\t\t\t\t'aria-label': __( 'Custom color picker.' ),\n\t\t\t};\n\t\t}\n\t}\n\n\tconst options = unsetable\n\t\t? [ unsetOption, ...duotoneOptions ]\n\t\t: duotoneOptions;\n\n\treturn (\n\t\t<CircularOptionPicker\n\t\t\t{ ...otherProps }\n\t\t\t{ ...metaProps }\n\t\t\toptions={ options }\n\t\t\tactions={\n\t\t\t\t!! clearable && (\n\t\t\t\t\t<CircularOptionPicker.ButtonAction\n\t\t\t\t\t\tonClick={ () => onChange( undefined ) }\n\t\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\t\tdisabled={ ! value }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Clear' ) }\n\t\t\t\t\t</CircularOptionPicker.ButtonAction>\n\t\t\t\t)\n\t\t\t}\n\t\t>\n\t\t\t<Spacer paddingTop={ options.length === 0 ? 0 : 4 }>\n\t\t\t\t<VStack spacing={ 3 }>\n\t\t\t\t\t{ ! disableCustomColors && ! disableCustomDuotone && (\n\t\t\t\t\t\t<CustomDuotoneBar\n\t\t\t\t\t\t\tvalue={ isUnset ? undefined : value }\n\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ ! disableCustomDuotone && (\n\t\t\t\t\t\t<ColorListPicker\n\t\t\t\t\t\t\tlabels={ [ __( 'Shadows' ), __( 'Highlights' ) ] }\n\t\t\t\t\t\t\tcolors={ colorPalette }\n\t\t\t\t\t\t\tvalue={ isUnset ? undefined : value }\n\t\t\t\t\t\t\tdisableCustomColors={ disableCustomColors }\n\t\t\t\t\t\t\tenableAlpha\n\t\t\t\t\t\t\tonChange={ ( newColors ) => {\n\t\t\t\t\t\t\t\tif ( ! newColors[ 0 ] ) {\n\t\t\t\t\t\t\t\t\tnewColors[ 0 ] = defaultDark;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif ( ! newColors[ 1 ] ) {\n\t\t\t\t\t\t\t\t\tnewColors[ 1 ] = defaultLight;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tconst newValue =\n\t\t\t\t\t\t\t\t\tnewColors.length >= 2\n\t\t\t\t\t\t\t\t\t\t? newColors\n\t\t\t\t\t\t\t\t\t\t: undefined;\n\t\t\t\t\t\t\t\t// @ts-expect-error TODO: The color arrays for a DuotonePicker should be a tuple of two colors,\n\t\t\t\t\t\t\t\t// but it's currently typed as a string[].\n\t\t\t\t\t\t\t\t// See also https://github.com/WordPress/gutenberg/pull/49060#discussion_r1136951035\n\t\t\t\t\t\t\t\tonChange( newValue );\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</VStack>\n\t\t\t</Spacer>\n\t\t</CircularOptionPicker>\n\t);\n}\n\nexport default DuotonePicker;\n"],"mappings":";;;;;;;AAGA,IAAAA,GAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AAKA,IAAAG,gBAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,qBAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AAEA,IAAAM,iBAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,OAAA,GAAAR,OAAA;AAAmC,IAAAS,WAAA,GAAAT,OAAA;AApBnC;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;;AAUA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASU,aAAaA,CAAE;EACvBC,SAAS;EACTC,IAAI;EACJC,SAAS,GAAG,IAAI;EAChBC,SAAS,GAAG,IAAI;EAChBC,YAAY;EACZC,cAAc;EACdC,mBAAmB;EACnBC,oBAAoB;EACpBC,KAAK;EACLC,QAAQ;EACR,YAAY,EAAEC,SAAS;EACvB,iBAAiB,EAAEC,cAAc;EACjC,GAAGC;AACgB,CAAC,EAAG;EACvB,MAAM,CAAEC,WAAW,EAAEC,YAAY,CAAE,GAAG,IAAAC,gBAAO,EAC5C,MAAM,IAAAC,uBAAgB,EAAEZ,YAAa,CAAC,EACtC,CAAEA,YAAY,CACf,CAAC;EAED,MAAMa,OAAO,GAAGT,KAAK,KAAK,OAAO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["_es","_interopRequireDefault","require","_element","_i18n","_colorListPicker","_circularOptionPicker","_vStack","_customDuotoneBar","_utils","_spacer","_jsxRuntime","DuotonePicker","asButtons","loop","clearable","unsetable","colorPalette","duotonePalette","disableCustomColors","disableCustomDuotone","value","onChange","ariaLabel","ariaLabelledby","otherProps","defaultDark","defaultLight","useMemo","getDefaultColors","isUnset","unsetOptionLabel","__","unsetOption","jsx","default","Option","isSelected","tooltipText","className","onClick","undefined","duotoneOptions","map","colors","slug","name","style","background","getGradientFromCSSColors","color","sprintf","label","fastDeepEqual","metaProps","_metaProps","options","actions","ButtonAction","accessibleWhenDisabled","disabled","children","Spacer","paddingTop","length","jsxs","VStack","spacing","labels","enableAlpha","newColors","newValue","_default","exports"],"sources":["@wordpress/components/src/duotone-picker/duotone-picker.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport fastDeepEqual from 'fast-deep-equal/es6';\n\n/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport ColorListPicker from './color-list-picker';\nimport CircularOptionPicker from '../circular-option-picker';\nimport { VStack } from '../v-stack';\n\nimport CustomDuotoneBar from './custom-duotone-bar';\nimport { getDefaultColors, getGradientFromCSSColors } from './utils';\nimport { Spacer } from '../spacer';\nimport type { DuotonePickerProps } from './types';\n\n/**\n * ```jsx\n * import { DuotonePicker, DuotoneSwatch } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const DUOTONE_PALETTE = [\n * \t{ colors: [ '#8c00b7', '#fcff41' ], name: 'Purple and yellow', slug: 'purple-yellow' },\n * \t{ colors: [ '#000097', '#ff4747' ], name: 'Blue and red', slug: 'blue-red' },\n * ];\n *\n * const COLOR_PALETTE = [\n * \t{ color: '#ff4747', name: 'Red', slug: 'red' },\n * \t{ color: '#fcff41', name: 'Yellow', slug: 'yellow' },\n * \t{ color: '#000097', name: 'Blue', slug: 'blue' },\n * \t{ color: '#8c00b7', name: 'Purple', slug: 'purple' },\n * ];\n *\n * const Example = () => {\n * \tconst [ duotone, setDuotone ] = useState( [ '#000000', '#ffffff' ] );\n * \treturn (\n * \t\t<>\n * \t\t\t<DuotonePicker\n * \t\t\t\tduotonePalette={ DUOTONE_PALETTE }\n * \t\t\t\tcolorPalette={ COLOR_PALETTE }\n * \t\t\t\tvalue={ duotone }\n * \t\t\t\tonChange={ setDuotone }\n * \t\t\t/>\n * \t\t\t<DuotoneSwatch values={ duotone } />\n * \t\t</>\n * \t);\n * };\n * ```\n */\nfunction DuotonePicker( {\n\tasButtons,\n\tloop,\n\tclearable = true,\n\tunsetable = true,\n\tcolorPalette,\n\tduotonePalette,\n\tdisableCustomColors,\n\tdisableCustomDuotone,\n\tvalue,\n\tonChange,\n\t'aria-label': ariaLabel,\n\t'aria-labelledby': ariaLabelledby,\n\t...otherProps\n}: DuotonePickerProps ) {\n\tconst [ defaultDark, defaultLight ] = useMemo(\n\t\t() => getDefaultColors( colorPalette ),\n\t\t[ colorPalette ]\n\t);\n\n\tconst isUnset = value === 'unset';\n\tconst unsetOptionLabel = __( 'Unset' );\n\n\tconst unsetOption = (\n\t\t<CircularOptionPicker.Option\n\t\t\tkey=\"unset\"\n\t\t\tvalue=\"unset\"\n\t\t\tisSelected={ isUnset }\n\t\t\ttooltipText={ unsetOptionLabel }\n\t\t\taria-label={ unsetOptionLabel }\n\t\t\tclassName=\"components-duotone-picker__color-indicator\"\n\t\t\tonClick={ () => {\n\t\t\t\tonChange( isUnset ? undefined : 'unset' );\n\t\t\t} }\n\t\t/>\n\t);\n\n\tconst duotoneOptions = duotonePalette.map( ( { colors, slug, name } ) => {\n\t\tconst style = {\n\t\t\tbackground: getGradientFromCSSColors( colors, '135deg' ),\n\t\t\tcolor: 'transparent',\n\t\t};\n\t\tconst tooltipText =\n\t\t\tname ??\n\t\t\tsprintf(\n\t\t\t\t// translators: %s: duotone code e.g: \"dark-grayscale\" or \"7f7f7f-ffffff\".\n\t\t\t\t__( 'Duotone code: %s' ),\n\t\t\t\tslug\n\t\t\t);\n\t\tconst label = name\n\t\t\t? sprintf(\n\t\t\t\t\t// translators: %s: The name of the option e.g: \"Dark grayscale\".\n\t\t\t\t\t__( 'Duotone: %s' ),\n\t\t\t\t\tname\n\t\t\t )\n\t\t\t: tooltipText;\n\t\tconst isSelected = fastDeepEqual( colors, value );\n\n\t\treturn (\n\t\t\t<CircularOptionPicker.Option\n\t\t\t\tkey={ slug }\n\t\t\t\tvalue={ colors }\n\t\t\t\tisSelected={ isSelected }\n\t\t\t\taria-label={ label }\n\t\t\t\ttooltipText={ tooltipText }\n\t\t\t\tstyle={ style }\n\t\t\t\tonClick={ () => {\n\t\t\t\t\tonChange( isSelected ? undefined : colors );\n\t\t\t\t} }\n\t\t\t/>\n\t\t);\n\t} );\n\n\tlet metaProps:\n\t\t| { asButtons: false; loop?: boolean; 'aria-label': string }\n\t\t| { asButtons: false; loop?: boolean; 'aria-labelledby': string }\n\t\t| { asButtons: true };\n\n\tif ( asButtons ) {\n\t\tmetaProps = { asButtons: true };\n\t} else {\n\t\tconst _metaProps: { asButtons: false; loop?: boolean } = {\n\t\t\tasButtons: false,\n\t\t\tloop,\n\t\t};\n\n\t\tif ( ariaLabel ) {\n\t\t\tmetaProps = { ..._metaProps, 'aria-label': ariaLabel };\n\t\t} else if ( ariaLabelledby ) {\n\t\t\tmetaProps = {\n\t\t\t\t..._metaProps,\n\t\t\t\t'aria-labelledby': ariaLabelledby,\n\t\t\t};\n\t\t} else {\n\t\t\tmetaProps = {\n\t\t\t\t..._metaProps,\n\t\t\t\t'aria-label': __( 'Custom color picker.' ),\n\t\t\t};\n\t\t}\n\t}\n\n\tconst options = unsetable\n\t\t? [ unsetOption, ...duotoneOptions ]\n\t\t: duotoneOptions;\n\n\treturn (\n\t\t<CircularOptionPicker\n\t\t\t{ ...otherProps }\n\t\t\t{ ...metaProps }\n\t\t\toptions={ options }\n\t\t\tactions={\n\t\t\t\t!! clearable && (\n\t\t\t\t\t<CircularOptionPicker.ButtonAction\n\t\t\t\t\t\tonClick={ () => onChange( undefined ) }\n\t\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\t\tdisabled={ ! value }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Clear' ) }\n\t\t\t\t\t</CircularOptionPicker.ButtonAction>\n\t\t\t\t)\n\t\t\t}\n\t\t>\n\t\t\t<Spacer paddingTop={ options.length === 0 ? 0 : 4 }>\n\t\t\t\t<VStack spacing={ 3 }>\n\t\t\t\t\t{ ! disableCustomColors && ! disableCustomDuotone && (\n\t\t\t\t\t\t<CustomDuotoneBar\n\t\t\t\t\t\t\tvalue={ isUnset ? undefined : value }\n\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ ! disableCustomDuotone && (\n\t\t\t\t\t\t<ColorListPicker\n\t\t\t\t\t\t\tlabels={ [ __( 'Shadows' ), __( 'Highlights' ) ] }\n\t\t\t\t\t\t\tcolors={ colorPalette }\n\t\t\t\t\t\t\tvalue={ isUnset ? undefined : value }\n\t\t\t\t\t\t\tdisableCustomColors={ disableCustomColors }\n\t\t\t\t\t\t\tenableAlpha\n\t\t\t\t\t\t\tonChange={ ( newColors ) => {\n\t\t\t\t\t\t\t\tif ( ! newColors[ 0 ] ) {\n\t\t\t\t\t\t\t\t\tnewColors[ 0 ] = defaultDark;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif ( ! newColors[ 1 ] ) {\n\t\t\t\t\t\t\t\t\tnewColors[ 1 ] = defaultLight;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tconst newValue =\n\t\t\t\t\t\t\t\t\tnewColors.length >= 2\n\t\t\t\t\t\t\t\t\t\t? newColors\n\t\t\t\t\t\t\t\t\t\t: undefined;\n\t\t\t\t\t\t\t\t// @ts-expect-error TODO: The color arrays for a DuotonePicker should be a tuple of two colors,\n\t\t\t\t\t\t\t\t// but it's currently typed as a string[].\n\t\t\t\t\t\t\t\t// See also https://github.com/WordPress/gutenberg/pull/49060#discussion_r1136951035\n\t\t\t\t\t\t\t\tonChange( newValue );\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</VStack>\n\t\t\t</Spacer>\n\t\t</CircularOptionPicker>\n\t);\n}\n\nexport default DuotonePicker;\n"],"mappings":";;;;;;;;AAGA,IAAAA,GAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AAKA,IAAAG,gBAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,qBAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AAEA,IAAAM,iBAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,OAAA,GAAAR,OAAA;AAAmC,IAAAS,WAAA,GAAAT,OAAA;AApBnC;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;;AAUA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASU,aAAaA,CAAE;EACvBC,SAAS;EACTC,IAAI;EACJC,SAAS,GAAG,IAAI;EAChBC,SAAS,GAAG,IAAI;EAChBC,YAAY;EACZC,cAAc;EACdC,mBAAmB;EACnBC,oBAAoB;EACpBC,KAAK;EACLC,QAAQ;EACR,YAAY,EAAEC,SAAS;EACvB,iBAAiB,EAAEC,cAAc;EACjC,GAAGC;AACgB,CAAC,EAAG;EACvB,MAAM,CAAEC,WAAW,EAAEC,YAAY,CAAE,GAAG,IAAAC,gBAAO,EAC5C,MAAM,IAAAC,uBAAgB,EAAEZ,YAAa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AC,QAAA,GAAAC,OAAA,CAAAtC,OAAA,GAEcvB,aAAa","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":["_colord","require","_names","_interopRequireDefault","extend","namesPlugin","getDefaultColors","palette","length","map","color","brightness","colord","reduce","min","max","current","getGradientFromCSSColors","colors","angle","l","stops","c","i","join","getColorStopsFromColors","position","getColorsFromColorStops","colorStops"],"sources":["@wordpress/components/src/duotone-picker/utils.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport { colord, extend } from 'colord';\nimport namesPlugin from 'colord/plugins/names';\n\n/**\n * Internal dependencies\n */\nimport type { DuotonePickerProps } from './types';\n\nextend( [ namesPlugin ] );\n\n/**\n * Object representation for a color.\n *\n * @typedef {Object} RGBColor\n * @property {number} r Red component of the color in the range [0,1].\n * @property {number} g Green component of the color in the range [0,1].\n * @property {number} b Blue component of the color in the range [0,1].\n */\n\n/**\n * Calculate the brightest and darkest values from a color palette.\n *\n * @param palette Color palette for the theme.\n *\n * @return Tuple of the darkest color and brightest color.\n */\nexport function getDefaultColors(\n\tpalette: DuotonePickerProps[ 'colorPalette' ]\n) {\n\t// A default dark and light color are required.\n\tif ( ! palette || palette.length < 2 ) {\n\t\treturn [ '#000', '#fff' ];\n\t}\n\n\treturn palette\n\t\t.map( ( { color } ) => ( {\n\t\t\tcolor,\n\t\t\tbrightness: colord( color ).brightness(),\n\t\t} ) )\n\t\t.reduce(\n\t\t\t( [ min, max ], current ) => {\n\t\t\t\treturn [\n\t\t\t\t\tcurrent.brightness <= min.brightness ? current : min,\n\t\t\t\t\tcurrent.brightness >= max.brightness ? current : max,\n\t\t\t\t];\n\t\t\t},\n\t\t\t[\n\t\t\t\t{ brightness: 1, color: '' },\n\t\t\t\t{ brightness: 0, color: '' },\n\t\t\t]\n\t\t)\n\t\t.map( ( { color } ) => color );\n}\n\n/**\n * Generate a duotone gradient from a list of colors.\n *\n * @param colors CSS color strings.\n * @param angle CSS gradient angle.\n *\n * @return CSS gradient string for the duotone swatch.\n */\nexport function getGradientFromCSSColors(\n\tcolors: string[] = [],\n\tangle = '90deg'\n) {\n\tconst l = 100 / colors.length;\n\n\tconst stops = colors\n\t\t.map( ( c, i ) => `${ c } ${ i * l }%, ${ c } ${ ( i + 1 ) * l }%` )\n\t\t.join( ', ' );\n\n\treturn `linear-gradient( ${ angle }, ${ stops } )`;\n}\n\n/**\n * Convert a color array to an array of color stops.\n *\n * @param colors CSS colors array\n *\n * @return Color stop information.\n */\nexport function getColorStopsFromColors( colors: string[] ) {\n\treturn colors.map( ( color, i ) => ( {\n\t\tposition: ( i * 100 ) / ( colors.length - 1 ),\n\t\tcolor,\n\t} ) );\n}\n\n/**\n * Convert a color stop array to an array colors.\n *\n * @param colorStops Color stop information.\n *\n * @return CSS colors array.\n */\nexport function getColorsFromColorStops(\n\tcolorStops: { position: number; color: string }[] = []\n) {\n\treturn colorStops.map( ( { color } ) => color );\n}\n"],"mappings":";;;;;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AAJA;AACA;AACA;;AAIA;AACA;AACA;;AAGA,IAAAG,cAAM,EAAE,CAAEC,cAAW,CAAG,CAAC;;AAEzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,gBAAgBA,CAC/BC,OAA6C,EAC5C;EACD;EACA,IAAK,CAAEA,OAAO,IAAIA,OAAO,CAACC,MAAM,GAAG,CAAC,EAAG;IACtC,OAAO,CAAE,MAAM,EAAE,MAAM,CAAE;EAC1B;EAEA,OAAOD,OAAO,CACZE,GAAG,CAAE,CAAE;IAAEC;EAAM,CAAC,MAAQ;IACxBA,KAAK;IACLC,UAAU,EAAE,IAAAC,cAAM,EAAEF,KAAM,CAAC,CA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A;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASiB,uBAAuBA,CACtCC,UAAiD,GAAG,EAAE,EACrD;EACD,OAAOA,UAAU,CAACnB,GAAG,CAAE,CAAE;IAAEC;EAAM,CAAC,KAAMA,KAAM,CAAC;AAChD","ignoreList":[]}
1
+ {"version":3,"names":["_colord","require","_names","_interopRequireDefault","extend","namesPlugin","getDefaultColors","palette","length","map","color","brightness","colord","reduce","min","max","current","getGradientFromCSSColors","colors","angle","l","stops","c","i","join","getColorStopsFromColors","position","getColorsFromColorStops","colorStops"],"sources":["@wordpress/components/src/duotone-picker/utils.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport { colord, extend } from 'colord';\nimport namesPlugin from 'colord/plugins/names';\n\n/**\n * Internal dependencies\n */\nimport type { DuotonePickerProps } from './types';\n\nextend( [ namesPlugin ] );\n\n/**\n * Object representation for a color.\n *\n * @typedef {Object} RGBColor\n * @property {number} r Red component of the color in the range [0,1].\n * @property {number} g Green component of the color in the range [0,1].\n * @property {number} b Blue component of the color in the range [0,1].\n */\n\n/**\n * Calculate the brightest and darkest values from a color palette.\n *\n * @param palette Color palette for the theme.\n *\n * @return Tuple of the darkest color and brightest color.\n */\nexport function getDefaultColors(\n\tpalette: DuotonePickerProps[ 'colorPalette' ]\n) {\n\t// A default dark and light color are required.\n\tif ( ! palette || palette.length < 2 ) {\n\t\treturn [ '#000', '#fff' ];\n\t}\n\n\treturn palette\n\t\t.map( ( { color } ) => ( {\n\t\t\tcolor,\n\t\t\tbrightness: colord( color ).brightness(),\n\t\t} ) )\n\t\t.reduce(\n\t\t\t( [ min, max ], current ) => {\n\t\t\t\treturn [\n\t\t\t\t\tcurrent.brightness <= min.brightness ? current : min,\n\t\t\t\t\tcurrent.brightness >= max.brightness ? current : max,\n\t\t\t\t];\n\t\t\t},\n\t\t\t[\n\t\t\t\t{ brightness: 1, color: '' },\n\t\t\t\t{ brightness: 0, color: '' },\n\t\t\t]\n\t\t)\n\t\t.map( ( { color } ) => color );\n}\n\n/**\n * Generate a duotone gradient from a list of colors.\n *\n * @param colors CSS color strings.\n * @param angle CSS gradient angle.\n *\n * @return CSS gradient string for the duotone swatch.\n */\nexport function getGradientFromCSSColors(\n\tcolors: string[] = [],\n\tangle = '90deg'\n) {\n\tconst l = 100 / colors.length;\n\n\tconst stops = colors\n\t\t.map( ( c, i ) => `${ c } ${ i * l }%, ${ c } ${ ( i + 1 ) * l }%` )\n\t\t.join( ', ' );\n\n\treturn `linear-gradient( ${ angle }, ${ stops } )`;\n}\n\n/**\n * Convert a color array to an array of color stops.\n *\n * @param colors CSS colors array\n *\n * @return Color stop information.\n */\nexport function getColorStopsFromColors( colors: string[] ) {\n\treturn colors.map( ( color, i ) => ( {\n\t\tposition: ( i * 100 ) / ( colors.length - 1 ),\n\t\tcolor,\n\t} ) );\n}\n\n/**\n * Convert a color stop array to an array colors.\n *\n * @param colorStops Color stop information.\n *\n * @return CSS colors array.\n */\nexport function getColorsFromColorStops(\n\tcolorStops: { position: number; color: string }[] = []\n) {\n\treturn colorStops.map( ( { color } ) => color );\n}\n"],"mappings":";;;;;;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AAJA;AACA;AACA;;AAIA;AACA;AACA;;AAGA,IAAAG,cAAM,EAAE,CAAEC,cAAW,CAAG,CAAC;;AAEzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,gBAAgBA,CAC/BC,OAA6C,EAC5C;EACD;EACA,IAAK,CAAEA,OAAO,IAAIA,OAAO,CAACC,MAAM,GAAG,CAAC,EAAG;IACtC,OAAO,CAAE,MAAM,EAAE,MAAM,CAAE;EAC1B;EAEA,OAAOD,OAAO,CACZE,GAAG,CAAE,CAAE;IAAEC;EAAM,CAAC,MAAQ;IACxBA,KAAK;IACLC,UAAU,EAAE,IAAAC,cAAM,EAAEF,KAAM,CAAC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AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASiB,uBAAuBA,CACtCC,UAAiD,GAAG,EAAE,EACrD;EACD,OAAOA,UAAU,CAACnB,GAAG,CAAE,CAAE;IAAEC;EAAM,CAAC,KAAMA,KAAM,CAAC;AAChD","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","_jsxRuntime","UnforwardedExternalLink","props","ref","href","children","className","rel","additionalProps","optimizedRel","Set","split","filter","Boolean","join","classes","clsx","isInternalAnchor","startsWith","onClickHandler","event","preventDefault","onClick","jsxs","target","jsx","__","ExternalLink","exports","forwardRef","_default","default"],"sources":["@wordpress/components/src/external-link/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { ExternalLinkProps } from './types';\nimport type { WordPressComponentProps } from '../context';\n\nfunction UnforwardedExternalLink(\n\tprops: Omit<\n\t\tWordPressComponentProps< ExternalLinkProps, 'a', false >,\n\t\t'target'\n\t>,\n\tref: ForwardedRef< HTMLAnchorElement >\n) {\n\tconst { href, children, className, rel = '', ...additionalProps } = props;\n\tconst optimizedRel = [\n\t\t...new Set(\n\t\t\t[\n\t\t\t\t...rel.split( ' ' ),\n\t\t\t\t'external',\n\t\t\t\t'noreferrer',\n\t\t\t\t'noopener',\n\t\t\t].filter( Boolean )\n\t\t),\n\t].join( ' ' );\n\tconst classes = clsx( 'components-external-link', className );\n\t/* Anchor links are perceived as external links.\n\tThis constant helps check for on page anchor links,\n\tto prevent them from being opened in the editor. */\n\tconst isInternalAnchor = !! href?.startsWith( '#' );\n\n\tconst onClickHandler = (\n\t\tevent: React.MouseEvent< HTMLAnchorElement, MouseEvent >\n\t) => {\n\t\tif ( isInternalAnchor ) {\n\t\t\tevent.preventDefault();\n\t\t}\n\n\t\tif ( props.onClick ) {\n\t\t\tprops.onClick( event );\n\t\t}\n\t};\n\n\treturn (\n\t\t/* eslint-disable react/jsx-no-target-blank */\n\t\t<a\n\t\t\t{ ...additionalProps }\n\t\t\tclassName={ classes }\n\t\t\thref={ href }\n\t\t\tonClick={ onClickHandler }\n\t\t\ttarget=\"_blank\"\n\t\t\trel={ optimizedRel }\n\t\t\tref={ ref }\n\t\t>\n\t\t\t<span className=\"components-external-link__contents\">\n\t\t\t\t{ children }\n\t\t\t</span>\n\t\t\t<span\n\t\t\t\tclassName=\"components-external-link__icon\"\n\t\t\t\taria-label={\n\t\t\t\t\t/* translators: accessibility text */\n\t\t\t\t\t__( '(opens in a new tab)' )\n\t\t\t\t}\n\t\t\t>\n\t\t\t\t&#8599;\n\t\t\t</span>\n\t\t</a>\n\t\t/* eslint-enable react/jsx-no-target-blank */\n\t);\n}\n\n/**\n * Link to an external resource.\n *\n * ```jsx\n * import { ExternalLink } from '@wordpress/components';\n *\n * const MyExternalLink = () => (\n * <ExternalLink href=\"https://wordpress.org\">WordPress.org</ExternalLink>\n * );\n * ```\n */\nexport const ExternalLink = forwardRef( UnforwardedExternalLink );\n\nexport default ExternalLink;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAMA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAAgD,IAAAG,WAAA,GAAAH,OAAA;AAVhD;AACA;AACA;;AAIA;AACA;AACA;;AAIA;AACA;AACA;;AAIA,SAASI,uBAAuBA,CAC/BC,KAGC,EACDC,GAAsC,EACrC;EACD,MAAM;IAAEC,IAAI;IAAEC,QAAQ;IAAEC,SAAS;IAAEC,GAAG,GAAG,EAAE;IAAE,GAAGC;EAAgB,CAAC,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,mBAAU,EAAE5B,uBAAwB,CAAC;AAAC,IAAA6B,QAAA,GAAAF,OAAA,CAAAG,OAAA,GAEnDJ,YAAY","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_i18n","_element","_jsxRuntime","UnforwardedExternalLink","props","ref","href","children","className","rel","additionalProps","optimizedRel","Set","split","filter","Boolean","join","classes","clsx","isInternalAnchor","startsWith","onClickHandler","event","preventDefault","onClick","jsxs","target","jsx","__","ExternalLink","exports","forwardRef","_default","default"],"sources":["@wordpress/components/src/external-link/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { ExternalLinkProps } from './types';\nimport type { WordPressComponentProps } from '../context';\n\nfunction UnforwardedExternalLink(\n\tprops: Omit<\n\t\tWordPressComponentProps< ExternalLinkProps, 'a', false >,\n\t\t'target'\n\t>,\n\tref: ForwardedRef< HTMLAnchorElement >\n) {\n\tconst { href, children, className, rel = '', ...additionalProps } = props;\n\tconst optimizedRel = [\n\t\t...new Set(\n\t\t\t[\n\t\t\t\t...rel.split( ' ' ),\n\t\t\t\t'external',\n\t\t\t\t'noreferrer',\n\t\t\t\t'noopener',\n\t\t\t].filter( Boolean )\n\t\t),\n\t].join( ' ' );\n\tconst classes = clsx( 'components-external-link', className );\n\t/* Anchor links are perceived as external links.\n\tThis constant helps check for on page anchor links,\n\tto prevent them from being opened in the editor. */\n\tconst isInternalAnchor = !! href?.startsWith( '#' );\n\n\tconst onClickHandler = (\n\t\tevent: React.MouseEvent< HTMLAnchorElement, MouseEvent >\n\t) => {\n\t\tif ( isInternalAnchor ) {\n\t\t\tevent.preventDefault();\n\t\t}\n\n\t\tif ( props.onClick ) {\n\t\t\tprops.onClick( event );\n\t\t}\n\t};\n\n\treturn (\n\t\t/* eslint-disable react/jsx-no-target-blank */\n\t\t<a\n\t\t\t{ ...additionalProps }\n\t\t\tclassName={ classes }\n\t\t\thref={ href }\n\t\t\tonClick={ onClickHandler }\n\t\t\ttarget=\"_blank\"\n\t\t\trel={ optimizedRel }\n\t\t\tref={ ref }\n\t\t>\n\t\t\t<span className=\"components-external-link__contents\">\n\t\t\t\t{ children }\n\t\t\t</span>\n\t\t\t<span\n\t\t\t\tclassName=\"components-external-link__icon\"\n\t\t\t\taria-label={\n\t\t\t\t\t/* translators: accessibility text */\n\t\t\t\t\t__( '(opens in a new tab)' )\n\t\t\t\t}\n\t\t\t>\n\t\t\t\t&#8599;\n\t\t\t</span>\n\t\t</a>\n\t\t/* eslint-enable react/jsx-no-target-blank */\n\t);\n}\n\n/**\n * Link to an external resource.\n *\n * ```jsx\n * import { ExternalLink } from '@wordpress/components';\n *\n * const MyExternalLink = () => (\n * <ExternalLink href=\"https://wordpress.org\">WordPress.org</ExternalLink>\n * );\n * ```\n */\nexport const ExternalLink = forwardRef( UnforwardedExternalLink );\n\nexport default ExternalLink;\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAMA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAAgD,IAAAG,WAAA,GAAAH,OAAA;AAVhD;AACA;AACA;;AAIA;AACA;AACA;;AAIA;AACA;AACA;;AAIA,SAASI,uBAAuBA,CAC/BC,KAGC,EACDC,GAAsC,EACrC;EACD,MAAM;IAAEC,IAAI;IAAEC,QAAQ;IAAEC,SAAS;IAAEC,GAAG,GAAG,EAAE;IAAE,GAAGC;EAAgB,CAAC,GAAGN,KAAK;EACzE,MAAMO,YAAY,GAAG,CACpB,GAAG,IAAIC,GAAG,CACT,CACC,GAAGH,GAAG,CAACI,KAAK,CAAE,GAAI,CAAC,EACnB,UAAU,EACV,YAAY,EACZ,UAAU,CACV,CAACC,MAAM,CAAEC,OAAQ,CACnB,CAAC,CACD,CAACC,IAAI,CAAE,GAAI,CAAC;EACb,MAAMC,OAAO,GAAG,IAAAC,aAAI,EAAE,0BAA0B,EAAEV,SAAU,CAAC;EAC7D;AACD;AACA;EACC,MAAMW,gBAAgB,GAAG,CAAC,CAAEb,IAAI,EAAEc,UAAU,CAAE,GAAI,CAAC;EAEnD,MAAMC,cAAc,GACnBC,KAAwD,IACpD;IACJ,IAAKH,gBAAgB,EAAG;MACvBG,KAAK,CAACC,cAAc,CAAC,CAAC;IACvB;IAEA,IAAKnB,KAAK,CAACoB,OAAO,EAAG;MACpBpB,KAAK,CAACoB,OAAO,CAAEF,KAAM,CAAC;IACvB;EACD,CAAC;EAED,qBACC,8CACA,IAAApB,WAAA,CAAAuB,IAAA;IAAA,GACMf,eAAe;IACpBF,SAAS,EAAGS,OAAS;IACrBX,IAAI,EAAGA,IAAM;IACbkB,OAAO,EAAGH,cAAgB;IAC1BK,MAAM,EAAC,QAAQ;IACfjB,GAAG,EAAGE,YAAc;IACpBN,GAAG,EAAGA,GAAK;IAAAE,QAAA,gBAEX,IAAAL,WAAA,CAAAyB,GAAA;MAAMnB,SAAS,EAAC,oCAAoC;MAAAD,QAAA,EACjDA;IAAQ,CACL,CAAC,eACP,IAAAL,WAAA,CAAAyB,GAAA;MACCnB,SAAS,EAAC,gCAAgC;MAC1C,cACC;MACA,IAAAoB,QAAE,EAAE,sBAAuB,CAC3B;MAAArB,QAAA,EACD;IAED,CAAM,CAAC;EAAA,CACL;EACH;AAEF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMsB,YAAY,GAAAC,OAAA,CAAAD,YAAA,GAAG,IAAAE,mBAAU,EAAE5B,uBAAwB,CAAC;AAAC,IAAA6B,QAAA,GAAAF,OAAA,CAAAG,OAAA,GAEnDJ,YAAY","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":["_i18n","require","_customSelectControl","_interopRequireDefault","_unitControl","_utils","_jsxRuntime","DEFAULT_OPTION","key","name","__","value","undefined","CUSTOM_OPTION","FontSizePickerSelect","props","_options$find","__next40pxDefaultSize","fontSizes","disableCustomFontSizes","size","onChange","onSelectCustom","areAllSizesSameUnit","getCommonSizeUnit","options","map","fontSize","hint","quantity","parseQuantityAndUnitFromRawValue","String","isSimpleCssValue","slug","selectedOption","find","option","jsx","default","__shouldNotWarnDeprecated36pxSize","className","label","hideLabelFromVision","describedBy","sprintf","showSelectedHint","selectedItem","_default","exports"],"sources":["@wordpress/components/src/font-size-picker/font-size-picker-select.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport CustomSelectControl from '../custom-select-control';\nimport { parseQuantityAndUnitFromRawValue } from '../unit-control';\nimport type {\n\tFontSizePickerSelectProps,\n\tFontSizePickerSelectOption,\n} from './types';\nimport { getCommonSizeUnit, isSimpleCssValue } from './utils';\n\nconst DEFAULT_OPTION: FontSizePickerSelectOption = {\n\tkey: 'default',\n\tname: __( 'Default' ),\n\tvalue: undefined,\n};\n\nconst CUSTOM_OPTION: FontSizePickerSelectOption = {\n\tkey: 'custom',\n\tname: __( 'Custom' ),\n};\n\nconst FontSizePickerSelect = ( props: FontSizePickerSelectProps ) => {\n\tconst {\n\t\t__next40pxDefaultSize,\n\t\tfontSizes,\n\t\tvalue,\n\t\tdisableCustomFontSizes,\n\t\tsize,\n\t\tonChange,\n\t\tonSelectCustom,\n\t} = props;\n\n\tconst areAllSizesSameUnit = !! getCommonSizeUnit( fontSizes );\n\n\tconst options: FontSizePickerSelectOption[] = [\n\t\tDEFAULT_OPTION,\n\t\t...fontSizes.map( ( fontSize ) => {\n\t\t\tlet hint;\n\t\t\tif ( areAllSizesSameUnit ) {\n\t\t\t\tconst [ quantity ] = parseQuantityAndUnitFromRawValue(\n\t\t\t\t\tfontSize.size\n\t\t\t\t);\n\t\t\t\tif ( quantity !== undefined ) {\n\t\t\t\t\thint = String( quantity );\n\t\t\t\t}\n\t\t\t} else if ( isSimpleCssValue( fontSize.size ) ) {\n\t\t\t\thint = String( fontSize.size );\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tkey: fontSize.slug,\n\t\t\t\tname: fontSize.name || fontSize.slug,\n\t\t\t\tvalue: fontSize.size,\n\t\t\t\thint,\n\t\t\t};\n\t\t} ),\n\t\t...( disableCustomFontSizes ? [] : [ CUSTOM_OPTION ] ),\n\t];\n\n\tconst selectedOption = value\n\t\t? options.find( ( option ) => option.value === value ) ?? CUSTOM_OPTION\n\t\t: DEFAULT_OPTION;\n\n\treturn (\n\t\t<CustomSelectControl\n\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\t__shouldNotWarnDeprecated36pxSize\n\t\t\tclassName=\"components-font-size-picker__select\"\n\t\t\tlabel={ __( 'Font size' ) }\n\t\t\thideLabelFromVision\n\t\t\tdescribedBy={ sprintf(\n\t\t\t\t// translators: %s: Currently selected font size.\n\t\t\t\t__( 'Currently selected font size: %s' ),\n\t\t\t\tselectedOption.name\n\t\t\t) }\n\t\t\toptions={ options }\n\t\t\tvalue={ selectedOption }\n\t\t\tshowSelectedHint\n\t\t\tonChange={ ( {\n\t\t\t\tselectedItem,\n\t\t\t}: {\n\t\t\t\tselectedItem: FontSizePickerSelectOption;\n\t\t\t} ) => {\n\t\t\t\tif ( selectedItem === CUSTOM_OPTION ) {\n\t\t\t\t\tonSelectCustom();\n\t\t\t\t} else {\n\t\t\t\t\tonChange( selectedItem.value );\n\t\t\t\t}\n\t\t\t} }\n\t\t\tsize={ size }\n\t\t/>\n\t);\n};\n\nexport default FontSizePickerSelect;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAKA,IAAAC,oBAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,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,IAAI;MACpBQ;IACD,CAAC;EACF,CAAE,CAAC,EACH,IAAKT,sBAAsB,GAAG,EAAE,GAAG,CAAEN,aAAa,CAAE,CAAE,CACtD;EAED,MAAMqB,cAAc,GAAGvB,KAAK,IAAAK,aAAA,GACzBS,OAAO,CAACU,IAAI,CAAIC,MAAM,IAAMA,MAAM,CAACzB,KAAK,KAAKA,KAAM,CAAC,cAAAK,aAAA,cAAAA,aAAA,GAAIH,aAAa,GACrEN,cAAc;EAEjB,oBACC,IAAAD,WAAA,CAAA+B,GAAA,EAACnC,oBAAA,CAAAoC,OAAmB;IACnBrB,qBAAqB,EAAGA,qBAAuB;IAC/CsB,iCAAiC;IACjCC,SAAS,EAAC,qCAAqC;IAC/CC,KAAK,EAAG,IAAA/B,QAAE,EAAE,WAAY,CAAG;IAC3BgC,mBAAmB;IACnBC,WAAW,EAAG,IAAAC,aAAO;IACpB;IACA,IAAAlC,QAAE,EAAE,kCAAmC,CAAC,EACxCwB,cAAc,CAACzB,IAChB,CAAG;IACHgB,OAAO,EAAGA,OAAS;IACnBd,KAAK,EAAGuB,cAAgB;IACxBW,gBAAgB;IAChBxB,QAAQ,EAAGA,CAAE;MACZyB;IAGD,CAAC,KAAM;MACN,IAAKA,YAAY,KAAKjC,aAAa,EAAG;QACrCS,cAAc,CAAC,CAAC;MACjB,CAAC,MAAM;QACND,QAAQ,CAAEyB,YAAY,CAACnC,KAAM,CAAC;MAC/B;IACD,CAAG;IACHS,IAAI,EAAGA;EAAM,CACb,CAAC;AAEJ,CAAC;AAAC,IAAA2B,QAAA,GAAAC,OAAA,CAAAV,OAAA,GAEaxB,oBAAoB","ignoreList":[]}
1
+ {"version":3,"names":["_i18n","require","_customSelectControl","_interopRequireDefault","_unitControl","_utils","_jsxRuntime","DEFAULT_OPTION","key","name","__","value","undefined","CUSTOM_OPTION","FontSizePickerSelect","props","_options$find","__next40pxDefaultSize","fontSizes","disableCustomFontSizes","size","onChange","onSelectCustom","areAllSizesSameUnit","getCommonSizeUnit","options","map","fontSize","hint","quantity","parseQuantityAndUnitFromRawValue","String","isSimpleCssValue","slug","selectedOption","find","option","jsx","default","__shouldNotWarnDeprecated36pxSize","className","label","hideLabelFromVision","describedBy","sprintf","showSelectedHint","selectedItem","_default","exports"],"sources":["@wordpress/components/src/font-size-picker/font-size-picker-select.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport CustomSelectControl from '../custom-select-control';\nimport { parseQuantityAndUnitFromRawValue } from '../unit-control';\nimport type {\n\tFontSizePickerSelectProps,\n\tFontSizePickerSelectOption,\n} from './types';\nimport { getCommonSizeUnit, isSimpleCssValue } from './utils';\n\nconst DEFAULT_OPTION: FontSizePickerSelectOption = {\n\tkey: 'default',\n\tname: __( 'Default' ),\n\tvalue: undefined,\n};\n\nconst CUSTOM_OPTION: FontSizePickerSelectOption = {\n\tkey: 'custom',\n\tname: __( 'Custom' ),\n};\n\nconst FontSizePickerSelect = ( props: FontSizePickerSelectProps ) => {\n\tconst {\n\t\t__next40pxDefaultSize,\n\t\tfontSizes,\n\t\tvalue,\n\t\tdisableCustomFontSizes,\n\t\tsize,\n\t\tonChange,\n\t\tonSelectCustom,\n\t} = props;\n\n\tconst areAllSizesSameUnit = !! getCommonSizeUnit( fontSizes );\n\n\tconst options: FontSizePickerSelectOption[] = [\n\t\tDEFAULT_OPTION,\n\t\t...fontSizes.map( ( fontSize ) => {\n\t\t\tlet hint;\n\t\t\tif ( areAllSizesSameUnit ) {\n\t\t\t\tconst [ quantity ] = parseQuantityAndUnitFromRawValue(\n\t\t\t\t\tfontSize.size\n\t\t\t\t);\n\t\t\t\tif ( quantity !== undefined ) {\n\t\t\t\t\thint = String( quantity );\n\t\t\t\t}\n\t\t\t} else if ( isSimpleCssValue( fontSize.size ) ) {\n\t\t\t\thint = String( fontSize.size );\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tkey: fontSize.slug,\n\t\t\t\tname: fontSize.name || fontSize.slug,\n\t\t\t\tvalue: fontSize.size,\n\t\t\t\thint,\n\t\t\t};\n\t\t} ),\n\t\t...( disableCustomFontSizes ? [] : [ CUSTOM_OPTION ] ),\n\t];\n\n\tconst selectedOption = value\n\t\t? options.find( ( option ) => option.value === value ) ?? CUSTOM_OPTION\n\t\t: DEFAULT_OPTION;\n\n\treturn (\n\t\t<CustomSelectControl\n\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\t__shouldNotWarnDeprecated36pxSize\n\t\t\tclassName=\"components-font-size-picker__select\"\n\t\t\tlabel={ __( 'Font size' ) }\n\t\t\thideLabelFromVision\n\t\t\tdescribedBy={ sprintf(\n\t\t\t\t// translators: %s: Currently selected font size.\n\t\t\t\t__( 'Currently selected font size: %s' ),\n\t\t\t\tselectedOption.name\n\t\t\t) }\n\t\t\toptions={ options }\n\t\t\tvalue={ selectedOption }\n\t\t\tshowSelectedHint\n\t\t\tonChange={ ( {\n\t\t\t\tselectedItem,\n\t\t\t}: {\n\t\t\t\tselectedItem: FontSizePickerSelectOption;\n\t\t\t} ) => {\n\t\t\t\tif ( selectedItem === CUSTOM_OPTION ) {\n\t\t\t\t\tonSelectCustom();\n\t\t\t\t} else {\n\t\t\t\t\tonChange( selectedItem.value );\n\t\t\t\t}\n\t\t\t} }\n\t\t\tsize={ size }\n\t\t/>\n\t);\n};\n\nexport default FontSizePickerSelect;\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAKA,IAAAC,oBAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AAKA,IAAAI,MAAA,GAAAJ,OAAA;AAA8D,IAAAK,WAAA,GAAAL,OAAA;AAd9D;AACA;AACA;;AAGA;AACA;AACA;;AASA,MAAMM,cAA0C,GAAG;EAClDC,GAAG,EAAE,SAAS;EACdC,IAAI,EAAE,IAAAC,QAAE,EAAE,SAAU,CAAC;EACrBC,KAAK,EAAEC;A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A,KAAM,CAAC,cAAAK,aAAA,cAAAA,aAAA,GAAIH,aAAa,GACrEN,cAAc;EAEjB,oBACC,IAAAD,WAAA,CAAA+B,GAAA,EAACnC,oBAAA,CAAAoC,OAAmB;IACnBrB,qBAAqB,EAAGA,qBAAuB;IAC/CsB,iCAAiC;IACjCC,SAAS,EAAC,qCAAqC;IAC/CC,KAAK,EAAG,IAAA/B,QAAE,EAAE,WAAY,CAAG;IAC3BgC,mBAAmB;IACnBC,WAAW,EAAG,IAAAC,aAAO;IACpB;IACA,IAAAlC,QAAE,EAAE,kCAAmC,CAAC,EACxCwB,cAAc,CAACzB,IAChB,CAAG;IACHgB,OAAO,EAAGA,OAAS;IACnBd,KAAK,EAAGuB,cAAgB;IACxBW,gBAAgB;IAChBxB,QAAQ,EAAGA,CAAE;MACZyB;IAGD,CAAC,KAAM;MACN,IAAKA,YAAY,KAAKjC,aAAa,EAAG;QACrCS,cAAc,CAAC,CAAC;MACjB,CAAC,MAAM;QACND,QAAQ,CAAEyB,YAAY,CAACnC,KAAM,CAAC;MAC/B;IACD,CAAG;IACHS,IAAI,EAAGA;EAAM,CACb,CAAC;AAEJ,CAAC;AAAC,IAAA2B,QAAA,GAAAC,OAAA,CAAAV,OAAA,GAEaxB,oBAAoB","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":["_i18n","require","_toggleGroupControl","_constants","_jsxRuntime","FontSizePickerToggleGroup","props","fontSizes","value","__next40pxDefaultSize","size","onChange","jsx","ToggleGroupControl","__nextHasNoMarginBottom","__shouldNotWarnDeprecated36pxSize","label","__","hideLabelFromVision","isBlock","children","map","fontSize","index","ToggleGroupControlOption","T_SHIRT_ABBREVIATIONS","name","T_SHIRT_NAMES","showTooltip","slug","_default","exports","default"],"sources":["@wordpress/components/src/font-size-picker/font-size-picker-toggle-group.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport {\n\tToggleGroupControl,\n\tToggleGroupControlOption,\n} from '../toggle-group-control';\nimport { T_SHIRT_ABBREVIATIONS, T_SHIRT_NAMES } from './constants';\nimport type { FontSizePickerToggleGroupProps } from './types';\n\nconst FontSizePickerToggleGroup = ( props: FontSizePickerToggleGroupProps ) => {\n\tconst { fontSizes, value, __next40pxDefaultSize, size, onChange } = props;\n\treturn (\n\t\t<ToggleGroupControl\n\t\t\t__nextHasNoMarginBottom\n\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\t__shouldNotWarnDeprecated36pxSize\n\t\t\tlabel={ __( 'Font size' ) }\n\t\t\thideLabelFromVision\n\t\t\tvalue={ value }\n\t\t\tonChange={ onChange }\n\t\t\tisBlock\n\t\t\tsize={ size }\n\t\t>\n\t\t\t{ fontSizes.map( ( fontSize, index ) => (\n\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\tkey={ fontSize.slug }\n\t\t\t\t\tvalue={ fontSize.size }\n\t\t\t\t\tlabel={ T_SHIRT_ABBREVIATIONS[ index ] }\n\t\t\t\t\taria-label={ fontSize.name || T_SHIRT_NAMES[ index ] }\n\t\t\t\t\tshowTooltip\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t</ToggleGroupControl>\n\t);\n};\n\nexport default FontSizePickerToggleGroup;\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAKA,IAAAC,mBAAA,GAAAD,OAAA;AAIA,IAAAE,UAAA,GAAAF,OAAA;AAAmE,IAAAG,WAAA,GAAAH,OAAA;AAZnE;AACA;AACA;;AAGA;AACA;AACA;;AAQA,MAAMI,yBAAyB,GAAKC,KAAqC,IAAM;EAC9E,MAAM;IAAEC,SAAS;IAAEC,KAAK;IAAEC,qBAAqB;IAAEC,IAAI;IAAEC;EAAS,CAAC,GAAGL,KAAK;EACzE,oBACC,IAAAF,WAAA,CAAAQ,GAAA,EAACV,mBAAA,CAAAW,kBAAkB;IAClBC,uBAAuB;IACvBL,qBAAqB,EAAGA,qBAAuB;IAC/CM,iCAAiC;IACjCC,KAAK,EAAG,IAAAC,QAAE,EAAE,WAAY,CAAG;IAC3BC,mBAAmB;IACnBV,KAAK,EAAGA,KAAO;IACfG,QAAQ,EAAGA,QAAU;IACrBQ,OAAO;IACPT,IAAI,EAAGA,IAAM;IAAAU,QAAA,EAEXb,SAAS,CAACc,GAAG,CAAE,CAAEC,QAAQ,EAAEC,KAAK,kBACjC,IAAAnB,WAAA,CAAAQ,GAAA,EAACV,mBAAA,CAAAsB,wBAAwB;MAExBhB,KAAK,EAAGc,QAAQ,CAACZ,IAAM;MACvBM,KAAK,EAAGS,gCAAqB,CAAEF,KAAK,CAAI;MACxC,cAAaD,QAAQ,CAACI,IAAI,IAAIC,wBAAa,CAAEJ,KAAK,CAAI;MACtDK,WAAW;IAAA,GAJLN,QAAQ,CAACO,IAKf,CACA;EAAC,CACgB,CAAC;AAEvB,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEa3B,yBAAyB","ignoreList":[]}
1
+ {"version":3,"names":["_i18n","require","_toggleGroupControl","_constants","_jsxRuntime","FontSizePickerToggleGroup","props","fontSizes","value","__next40pxDefaultSize","size","onChange","jsx","ToggleGroupControl","__nextHasNoMarginBottom","__shouldNotWarnDeprecated36pxSize","label","__","hideLabelFromVision","isBlock","children","map","fontSize","index","ToggleGroupControlOption","T_SHIRT_ABBREVIATIONS","name","T_SHIRT_NAMES","showTooltip","slug","_default","exports","default"],"sources":["@wordpress/components/src/font-size-picker/font-size-picker-toggle-group.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport {\n\tToggleGroupControl,\n\tToggleGroupControlOption,\n} from '../toggle-group-control';\nimport { T_SHIRT_ABBREVIATIONS, T_SHIRT_NAMES } from './constants';\nimport type { FontSizePickerToggleGroupProps } from './types';\n\nconst FontSizePickerToggleGroup = ( props: FontSizePickerToggleGroupProps ) => {\n\tconst { fontSizes, value, __next40pxDefaultSize, size, onChange } = props;\n\treturn (\n\t\t<ToggleGroupControl\n\t\t\t__nextHasNoMarginBottom\n\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\t__shouldNotWarnDeprecated36pxSize\n\t\t\tlabel={ __( 'Font size' ) }\n\t\t\thideLabelFromVision\n\t\t\tvalue={ value }\n\t\t\tonChange={ onChange }\n\t\t\tisBlock\n\t\t\tsize={ size }\n\t\t>\n\t\t\t{ fontSizes.map( ( fontSize, index ) => (\n\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\tkey={ fontSize.slug }\n\t\t\t\t\tvalue={ fontSize.size }\n\t\t\t\t\tlabel={ T_SHIRT_ABBREVIATIONS[ index ] }\n\t\t\t\t\taria-label={ fontSize.name || T_SHIRT_NAMES[ index ] }\n\t\t\t\t\tshowTooltip\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t</ToggleGroupControl>\n\t);\n};\n\nexport default FontSizePickerToggleGroup;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAKA,IAAAC,mBAAA,GAAAD,OAAA;AAIA,IAAAE,UAAA,GAAAF,OAAA;AAAmE,IAAAG,WAAA,GAAAH,OAAA;AAZnE;AACA;AACA;;AAGA;AACA;AACA;;AAQA,MAAMI,yBAAyB,GAAKC,KAAqC,IAAM;EAC9E,MAAM;IAAEC,SAAS;IAAEC,KAAK;IAAEC,qBAAqB;IAAEC,IAAI;IAAEC;EAAS,CAAC,GAAGL,KAAK;EACzE,oBACC,IAAAF,WAAA,CAAAQ,GAAA,EAACV,mBAAA,CAAAW,kBAAkB;IAClBC,uBAAuB;IACvBL,qBAAqB,EAAGA,qBAAuB;IAC/CM,iCAAiC;IACjCC,KAAK,EAAG,IAAAC,QAAE,EAAE,WAAY,CAAG;IAC3BC,mBAAmB;IACnBV,KAAK,EAAGA,KAAO;IACfG,QAAQ,EAAGA,QAAU;IACrBQ,OAAO;IACPT,IAAI,EAAGA,IAAM;IAAAU,QAAA,EAEXb,SAAS,CAACc,GAAG,CAAE,CAAEC,QAAQ,EAAEC,KAAK,kBACjC,IAAAnB,WAAA,CAAAQ,GAAA,EAACV,mBAAA,CAAAsB,wBAAwB;MAExBhB,KAAK,EAAGc,QAAQ,CAACZ,IAAM;MACvBM,KAAK,EAAGS,gCAAqB,CAAEF,KAAK,CAAI;MACxC,cAAaD,QAAQ,CAACI,IAAI,IAAIC,wBAAa,CAAEJ,KAAK,CAAI;MACtDK,WAAW;IAAA,GAJLN,QAAQ,CAACO,IAKf,CACA;EAAC,CACgB,CAAC;AAEvB,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEa3B,yBAAyB","ignoreList":[]}
@@ -1,3 +1,4 @@
1
+ /* wp:polyfill */
1
2
  "use strict";
2
3
 
3
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");