@wordpress/components 19.4.0 → 19.5.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 (406) hide show
  1. package/CHANGELOG.md +16 -1
  2. package/CONTRIBUTING.md +69 -2
  3. package/build/box-control/unit-control.js +2 -2
  4. package/build/box-control/unit-control.js.map +1 -1
  5. package/build/card/card/component.js +2 -2
  6. package/build/card/card/component.js.map +1 -1
  7. package/build/card/card-body/component.js +1 -1
  8. package/build/card/card-body/component.js.map +1 -1
  9. package/build/card/card-divider/component.js +1 -1
  10. package/build/card/card-divider/component.js.map +1 -1
  11. package/build/card/card-footer/component.js +1 -1
  12. package/build/card/card-footer/component.js.map +1 -1
  13. package/build/card/card-header/component.js +1 -1
  14. package/build/card/card-header/component.js.map +1 -1
  15. package/build/card/card-media/component.js +1 -1
  16. package/build/card/card-media/component.js.map +1 -1
  17. package/build/color-palette/index.native.js +35 -30
  18. package/build/color-palette/index.native.js.map +1 -1
  19. package/build/color-picker/component.js.map +1 -1
  20. package/build/color-picker/hex-input.js +6 -9
  21. package/build/color-picker/hex-input.js.map +1 -1
  22. package/build/confirm-dialog/component.js.map +1 -1
  23. package/build/divider/component.js.map +1 -1
  24. package/build/elevation/component.js +1 -1
  25. package/build/elevation/component.js.map +1 -1
  26. package/build/flex/flex/component.js +1 -1
  27. package/build/flex/flex/component.js.map +1 -1
  28. package/build/flex/flex-block/component.js +1 -1
  29. package/build/flex/flex-block/component.js.map +1 -1
  30. package/build/flex/flex-item/component.js +1 -1
  31. package/build/flex/flex-item/component.js.map +1 -1
  32. package/build/flyout/flyout/component.js +1 -1
  33. package/build/flyout/flyout/component.js.map +1 -1
  34. package/build/flyout/flyout-content/component.js +1 -1
  35. package/build/flyout/flyout-content/component.js.map +1 -1
  36. package/build/focal-point-picker/index.js +18 -12
  37. package/build/focal-point-picker/index.js.map +1 -1
  38. package/build/font-size-picker/index.js +0 -1
  39. package/build/font-size-picker/index.js.map +1 -1
  40. package/build/grid/component.js +1 -1
  41. package/build/grid/component.js.map +1 -1
  42. package/build/h-stack/component.js +1 -1
  43. package/build/h-stack/component.js.map +1 -1
  44. package/build/heading/component.js.map +1 -1
  45. package/build/index.js +12 -0
  46. package/build/index.js.map +1 -1
  47. package/build/index.native.js +15 -1
  48. package/build/index.native.js.map +1 -1
  49. package/build/input-control/index.js.map +1 -1
  50. package/build/input-control/input-base.js.map +1 -1
  51. package/build/input-control/input-field.js +7 -7
  52. package/build/input-control/input-field.js.map +1 -1
  53. package/build/input-control/reducer/reducer.js +3 -0
  54. package/build/input-control/reducer/reducer.js.map +1 -1
  55. package/build/item-group/item/component.js.map +1 -1
  56. package/build/item-group/item-group/component.js.map +1 -1
  57. package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js +1 -1
  58. package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js.map +1 -1
  59. package/build/mobile/color-settings/palette.screen.native.js +26 -9
  60. package/build/mobile/color-settings/palette.screen.native.js.map +1 -1
  61. package/build/mobile/global-styles-context/utils.native.js +63 -9
  62. package/build/mobile/global-styles-context/utils.native.js.map +1 -1
  63. package/build/mobile/inserter-button/index.native.js +3 -3
  64. package/build/mobile/inserter-button/index.native.js.map +1 -1
  65. package/build/mobile/inserter-button/sparkles.js +25 -0
  66. package/build/mobile/inserter-button/sparkles.js.map +1 -0
  67. package/build/navigator/index.js +16 -0
  68. package/build/navigator/index.js.map +1 -1
  69. package/build/navigator/navigator-back-button/component.js +72 -0
  70. package/build/navigator/navigator-back-button/component.js.map +1 -0
  71. package/build/navigator/navigator-back-button/hook.js +49 -0
  72. package/build/navigator/navigator-back-button/hook.js.map +1 -0
  73. package/build/navigator/navigator-back-button/index.js +16 -0
  74. package/build/navigator/navigator-back-button/index.js.map +1 -0
  75. package/build/navigator/navigator-button/component.js +71 -0
  76. package/build/navigator/navigator-button/component.js.map +1 -0
  77. package/build/navigator/navigator-button/hook.js +59 -0
  78. package/build/navigator/navigator-button/hook.js.map +1 -0
  79. package/build/navigator/navigator-button/index.js +16 -0
  80. package/build/navigator/navigator-button/index.js.map +1 -0
  81. package/build/navigator/navigator-provider/component.js +11 -21
  82. package/build/navigator/navigator-provider/component.js.map +1 -1
  83. package/build/navigator/navigator-screen/component.js +14 -22
  84. package/build/navigator/navigator-screen/component.js.map +1 -1
  85. package/build/resizable-box/index.js.map +1 -1
  86. package/build/resizable-box/resize-tooltip/index.js.map +1 -1
  87. package/build/resizable-box/resize-tooltip/label.js.map +1 -1
  88. package/build/scrollable/component.js +1 -1
  89. package/build/scrollable/component.js.map +1 -1
  90. package/build/select-control/index.js.map +1 -1
  91. package/build/spacer/component.js.map +1 -1
  92. package/build/surface/component.js +1 -1
  93. package/build/surface/component.js.map +1 -1
  94. package/build/text/component.js +1 -1
  95. package/build/text/component.js.map +1 -1
  96. package/build/text-control/index.js +2 -2
  97. package/build/text-control/index.js.map +1 -1
  98. package/build/toggle-group-control/toggle-group-control/component.js.map +1 -1
  99. package/build/toggle-group-control/toggle-group-control-option/component.js.map +1 -1
  100. package/build/tools-panel/tools-panel/component.js.map +1 -1
  101. package/build/tools-panel/tools-panel-header/component.js.map +1 -1
  102. package/build/tools-panel/tools-panel-item/component.js.map +1 -1
  103. package/build/tree-grid/index.js +50 -6
  104. package/build/tree-grid/index.js.map +1 -1
  105. package/build/truncate/component.js +1 -1
  106. package/build/truncate/component.js.map +1 -1
  107. package/build/ui/control-group/component.js +1 -1
  108. package/build/ui/control-group/component.js.map +1 -1
  109. package/build/ui/control-label/component.js +1 -1
  110. package/build/ui/control-label/component.js.map +1 -1
  111. package/build/ui/form-group/form-group.js +1 -1
  112. package/build/ui/form-group/form-group.js.map +1 -1
  113. package/build/ui/shortcut/component.js.map +1 -1
  114. package/build/ui/spinner/component.js +1 -1
  115. package/build/ui/spinner/component.js.map +1 -1
  116. package/build/ui/tooltip/component.js +1 -1
  117. package/build/ui/tooltip/component.js.map +1 -1
  118. package/build/ui/tooltip/content.js +1 -1
  119. package/build/ui/tooltip/content.js.map +1 -1
  120. package/build/unit-control/index.js.map +1 -1
  121. package/build/v-stack/component.js +1 -1
  122. package/build/v-stack/component.js.map +1 -1
  123. package/build/visually-hidden/component.js +1 -1
  124. package/build/visually-hidden/component.js.map +1 -1
  125. package/build/z-stack/component.js.map +1 -1
  126. package/build-module/box-control/unit-control.js +1 -1
  127. package/build-module/box-control/unit-control.js.map +1 -1
  128. package/build-module/card/card/component.js +2 -2
  129. package/build-module/card/card/component.js.map +1 -1
  130. package/build-module/card/card-body/component.js +1 -1
  131. package/build-module/card/card-body/component.js.map +1 -1
  132. package/build-module/card/card-divider/component.js +1 -1
  133. package/build-module/card/card-divider/component.js.map +1 -1
  134. package/build-module/card/card-footer/component.js +1 -1
  135. package/build-module/card/card-footer/component.js.map +1 -1
  136. package/build-module/card/card-header/component.js +1 -1
  137. package/build-module/card/card-header/component.js.map +1 -1
  138. package/build-module/card/card-media/component.js +1 -1
  139. package/build-module/card/card-media/component.js.map +1 -1
  140. package/build-module/color-palette/index.native.js +36 -31
  141. package/build-module/color-palette/index.native.js.map +1 -1
  142. package/build-module/color-picker/component.js.map +1 -1
  143. package/build-module/color-picker/hex-input.js +6 -9
  144. package/build-module/color-picker/hex-input.js.map +1 -1
  145. package/build-module/confirm-dialog/component.js.map +1 -1
  146. package/build-module/divider/component.js.map +1 -1
  147. package/build-module/elevation/component.js +1 -1
  148. package/build-module/elevation/component.js.map +1 -1
  149. package/build-module/flex/flex/component.js +1 -1
  150. package/build-module/flex/flex/component.js.map +1 -1
  151. package/build-module/flex/flex-block/component.js +1 -1
  152. package/build-module/flex/flex-block/component.js.map +1 -1
  153. package/build-module/flex/flex-item/component.js +1 -1
  154. package/build-module/flex/flex-item/component.js.map +1 -1
  155. package/build-module/flyout/flyout/component.js +1 -1
  156. package/build-module/flyout/flyout/component.js.map +1 -1
  157. package/build-module/flyout/flyout-content/component.js +1 -1
  158. package/build-module/flyout/flyout-content/component.js.map +1 -1
  159. package/build-module/focal-point-picker/index.js +18 -12
  160. package/build-module/focal-point-picker/index.js.map +1 -1
  161. package/build-module/font-size-picker/index.js +0 -1
  162. package/build-module/font-size-picker/index.js.map +1 -1
  163. package/build-module/grid/component.js +1 -1
  164. package/build-module/grid/component.js.map +1 -1
  165. package/build-module/h-stack/component.js +1 -1
  166. package/build-module/h-stack/component.js.map +1 -1
  167. package/build-module/heading/component.js.map +1 -1
  168. package/build-module/index.js +1 -1
  169. package/build-module/index.js.map +1 -1
  170. package/build-module/index.native.js +1 -1
  171. package/build-module/index.native.js.map +1 -1
  172. package/build-module/input-control/index.js.map +1 -1
  173. package/build-module/input-control/input-base.js.map +1 -1
  174. package/build-module/input-control/input-field.js +6 -6
  175. package/build-module/input-control/input-field.js.map +1 -1
  176. package/build-module/input-control/reducer/reducer.js +3 -0
  177. package/build-module/input-control/reducer/reducer.js.map +1 -1
  178. package/build-module/item-group/item/component.js.map +1 -1
  179. package/build-module/item-group/item-group/component.js.map +1 -1
  180. package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js +1 -1
  181. package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js.map +1 -1
  182. package/build-module/mobile/color-settings/palette.screen.native.js +27 -10
  183. package/build-module/mobile/color-settings/palette.screen.native.js.map +1 -1
  184. package/build-module/mobile/global-styles-context/utils.native.js +60 -10
  185. package/build-module/mobile/global-styles-context/utils.native.js.map +1 -1
  186. package/build-module/mobile/inserter-button/index.native.js +1 -1
  187. package/build-module/mobile/inserter-button/index.native.js.map +1 -1
  188. package/build-module/mobile/inserter-button/sparkles.js +16 -0
  189. package/build-module/mobile/inserter-button/sparkles.js.map +1 -0
  190. package/build-module/navigator/index.js +2 -0
  191. package/build-module/navigator/index.js.map +1 -1
  192. package/build-module/navigator/navigator-back-button/component.js +59 -0
  193. package/build-module/navigator/navigator-back-button/component.js.map +1 -0
  194. package/build-module/navigator/navigator-back-button/hook.js +36 -0
  195. package/build-module/navigator/navigator-back-button/hook.js.map +1 -0
  196. package/build-module/navigator/navigator-back-button/index.js +2 -0
  197. package/build-module/navigator/navigator-back-button/index.js.map +1 -0
  198. package/build-module/navigator/navigator-button/component.js +58 -0
  199. package/build-module/navigator/navigator-button/component.js.map +1 -0
  200. package/build-module/navigator/navigator-button/hook.js +46 -0
  201. package/build-module/navigator/navigator-button/hook.js.map +1 -0
  202. package/build-module/navigator/navigator-button/index.js +2 -0
  203. package/build-module/navigator/navigator-button/index.js.map +1 -0
  204. package/build-module/navigator/navigator-provider/component.js +11 -21
  205. package/build-module/navigator/navigator-provider/component.js.map +1 -1
  206. package/build-module/navigator/navigator-screen/component.js +13 -22
  207. package/build-module/navigator/navigator-screen/component.js.map +1 -1
  208. package/build-module/resizable-box/index.js.map +1 -1
  209. package/build-module/resizable-box/resize-tooltip/index.js.map +1 -1
  210. package/build-module/resizable-box/resize-tooltip/label.js.map +1 -1
  211. package/build-module/scrollable/component.js +1 -1
  212. package/build-module/scrollable/component.js.map +1 -1
  213. package/build-module/select-control/index.js +1 -1
  214. package/build-module/select-control/index.js.map +1 -1
  215. package/build-module/spacer/component.js.map +1 -1
  216. package/build-module/surface/component.js +1 -1
  217. package/build-module/surface/component.js.map +1 -1
  218. package/build-module/text/component.js +1 -1
  219. package/build-module/text/component.js.map +1 -1
  220. package/build-module/text-control/index.js +2 -2
  221. package/build-module/text-control/index.js.map +1 -1
  222. package/build-module/toggle-group-control/toggle-group-control/component.js.map +1 -1
  223. package/build-module/toggle-group-control/toggle-group-control-option/component.js.map +1 -1
  224. package/build-module/tools-panel/tools-panel/component.js.map +1 -1
  225. package/build-module/tools-panel/tools-panel-header/component.js.map +1 -1
  226. package/build-module/tools-panel/tools-panel-item/component.js.map +1 -1
  227. package/build-module/tree-grid/index.js +51 -7
  228. package/build-module/tree-grid/index.js.map +1 -1
  229. package/build-module/truncate/component.js +1 -1
  230. package/build-module/truncate/component.js.map +1 -1
  231. package/build-module/ui/control-group/component.js +1 -1
  232. package/build-module/ui/control-group/component.js.map +1 -1
  233. package/build-module/ui/control-label/component.js +1 -1
  234. package/build-module/ui/control-label/component.js.map +1 -1
  235. package/build-module/ui/form-group/form-group.js +1 -1
  236. package/build-module/ui/form-group/form-group.js.map +1 -1
  237. package/build-module/ui/shortcut/component.js.map +1 -1
  238. package/build-module/ui/spinner/component.js +1 -1
  239. package/build-module/ui/spinner/component.js.map +1 -1
  240. package/build-module/ui/tooltip/component.js +1 -1
  241. package/build-module/ui/tooltip/component.js.map +1 -1
  242. package/build-module/ui/tooltip/content.js +1 -1
  243. package/build-module/ui/tooltip/content.js.map +1 -1
  244. package/build-module/unit-control/index.js.map +1 -1
  245. package/build-module/v-stack/component.js +1 -1
  246. package/build-module/v-stack/component.js.map +1 -1
  247. package/build-module/visually-hidden/component.js +1 -1
  248. package/build-module/visually-hidden/component.js.map +1 -1
  249. package/build-module/z-stack/component.js.map +1 -1
  250. package/build-types/card/card-divider/hook.d.ts +0 -1
  251. package/build-types/card/card-divider/hook.d.ts.map +1 -1
  252. package/build-types/color-picker/styles.d.ts +2 -4
  253. package/build-types/color-picker/styles.d.ts.map +1 -1
  254. package/build-types/confirm-dialog/component.d.ts +2 -6
  255. package/build-types/confirm-dialog/component.d.ts.map +1 -1
  256. package/build-types/flyout/flyout/hook.d.ts +0 -1
  257. package/build-types/flyout/flyout/hook.d.ts.map +1 -1
  258. package/build-types/input-control/index.d.ts +3 -3
  259. package/build-types/input-control/index.d.ts.map +1 -1
  260. package/build-types/input-control/input-base.d.ts +2 -2
  261. package/build-types/input-control/input-base.d.ts.map +1 -1
  262. package/build-types/input-control/input-field.d.ts +1 -3
  263. package/build-types/input-control/input-field.d.ts.map +1 -1
  264. package/build-types/input-control/reducer/reducer.d.ts.map +1 -1
  265. package/build-types/input-control/types.d.ts +1 -1
  266. package/build-types/input-control/types.d.ts.map +1 -1
  267. package/build-types/navigator/index.d.ts +2 -0
  268. package/build-types/navigator/index.d.ts.map +1 -1
  269. package/build-types/navigator/navigator-back-button/component.d.ts +38 -0
  270. package/build-types/navigator/navigator-back-button/component.d.ts.map +1 -0
  271. package/build-types/navigator/navigator-back-button/hook.d.ts +282 -0
  272. package/build-types/navigator/navigator-back-button/hook.d.ts.map +1 -0
  273. package/build-types/navigator/navigator-back-button/index.d.ts +2 -0
  274. package/build-types/navigator/navigator-back-button/index.d.ts.map +1 -0
  275. package/build-types/navigator/navigator-button/component.d.ts +37 -0
  276. package/build-types/navigator/navigator-button/component.d.ts.map +1 -0
  277. package/build-types/navigator/navigator-button/hook.d.ts +282 -0
  278. package/build-types/navigator/navigator-button/hook.d.ts.map +1 -0
  279. package/build-types/navigator/navigator-button/index.d.ts +2 -0
  280. package/build-types/navigator/navigator-button/index.d.ts.map +1 -0
  281. package/build-types/navigator/navigator-provider/component.d.ts +10 -20
  282. package/build-types/navigator/navigator-provider/component.d.ts.map +1 -1
  283. package/build-types/navigator/navigator-screen/component.d.ts +10 -20
  284. package/build-types/navigator/navigator-screen/component.d.ts.map +1 -1
  285. package/build-types/navigator/types.d.ts +21 -0
  286. package/build-types/navigator/types.d.ts.map +1 -1
  287. package/build-types/number-control/styles/number-control-styles.d.ts +1 -1
  288. package/build-types/resizable-box/index.d.ts +2 -2
  289. package/build-types/resizable-box/index.d.ts.map +1 -1
  290. package/build-types/resizable-box/resize-tooltip/index.d.ts.map +1 -1
  291. package/build-types/select-control/index.d.ts +1 -3
  292. package/build-types/select-control/index.d.ts.map +1 -1
  293. package/build-types/ui/context/wordpress-component.d.ts +2 -6
  294. package/build-types/ui/context/wordpress-component.d.ts.map +1 -1
  295. package/build-types/unit-control/index.d.ts +1 -3
  296. package/build-types/unit-control/index.d.ts.map +1 -1
  297. package/build-types/z-stack/component.d.ts.map +1 -1
  298. package/package.json +8 -7
  299. package/src/alignment-matrix-control/README.md +4 -0
  300. package/src/alignment-matrix-control/stories/index.js +1 -1
  301. package/src/base-control/stories/index.js +65 -22
  302. package/src/box-control/stories/index.js +4 -1
  303. package/src/box-control/unit-control.js +1 -1
  304. package/src/card/card/component.js +1 -1
  305. package/src/card/card-body/component.js +1 -1
  306. package/src/card/card-divider/component.js +1 -1
  307. package/src/card/card-footer/component.js +1 -1
  308. package/src/card/card-header/component.js +1 -1
  309. package/src/card/card-media/component.js +1 -1
  310. package/src/color-palette/index.native.js +92 -75
  311. package/src/color-palette/style.native.scss +10 -5
  312. package/src/color-picker/component.tsx +2 -2
  313. package/src/color-picker/hex-input.tsx +9 -9
  314. package/src/confirm-dialog/component.tsx +2 -2
  315. package/src/divider/component.tsx +2 -2
  316. package/src/elevation/component.js +1 -1
  317. package/src/flex/flex/component.js +1 -1
  318. package/src/flex/flex-block/component.js +1 -1
  319. package/src/flex/flex-item/component.js +1 -1
  320. package/src/flyout/flyout/component.js +1 -1
  321. package/src/flyout/flyout-content/component.js +1 -1
  322. package/src/focal-point-picker/README.md +7 -0
  323. package/src/focal-point-picker/index.js +12 -7
  324. package/src/focal-point-picker/stories/index.js +30 -0
  325. package/src/focal-point-picker/test/index.js +44 -0
  326. package/src/font-size-picker/index.js +0 -1
  327. package/src/form-file-upload/README.md +1 -1
  328. package/src/form-file-upload/stories/index.js +51 -0
  329. package/src/grid/component.js +1 -1
  330. package/src/h-stack/component.js +1 -1
  331. package/src/heading/component.tsx +2 -2
  332. package/src/index.js +2 -0
  333. package/src/index.native.js +5 -1
  334. package/src/input-control/index.tsx +2 -2
  335. package/src/input-control/input-base.tsx +2 -2
  336. package/src/input-control/input-field.tsx +4 -6
  337. package/src/input-control/reducer/reducer.ts +3 -0
  338. package/src/input-control/stories/index.js +1 -1
  339. package/src/input-control/types.ts +1 -1
  340. package/src/item-group/item/component.tsx +2 -2
  341. package/src/item-group/item-group/component.tsx +2 -2
  342. package/src/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js +10 -1
  343. package/src/mobile/color-settings/palette.screen.native.js +39 -9
  344. package/src/mobile/color-settings/style.native.scss +4 -0
  345. package/src/mobile/global-styles-context/test/fixtures/theme.native.js +27 -0
  346. package/src/mobile/global-styles-context/test/utils.native.js +2 -2
  347. package/src/mobile/global-styles-context/utils.native.js +75 -6
  348. package/src/mobile/inserter-button/index.native.js +1 -2
  349. package/src/mobile/inserter-button/sparkles.js +15 -0
  350. package/src/navigation/stories/index.js +1 -1
  351. package/src/navigator/index.ts +2 -0
  352. package/src/navigator/navigator-back-button/README.md +31 -0
  353. package/src/navigator/navigator-back-button/component.tsx +62 -0
  354. package/src/navigator/navigator-back-button/hook.ts +40 -0
  355. package/src/navigator/navigator-back-button/index.ts +1 -0
  356. package/src/navigator/navigator-button/README.md +38 -0
  357. package/src/navigator/navigator-button/component.tsx +61 -0
  358. package/src/navigator/navigator-button/hook.ts +55 -0
  359. package/src/navigator/navigator-button/index.ts +1 -0
  360. package/src/navigator/navigator-provider/README.md +20 -33
  361. package/src/navigator/navigator-provider/component.tsx +12 -22
  362. package/src/navigator/navigator-screen/README.md +1 -1
  363. package/src/navigator/navigator-screen/component.tsx +14 -23
  364. package/src/navigator/stories/index.js +24 -37
  365. package/src/navigator/test/index.js +89 -34
  366. package/src/navigator/types.ts +26 -0
  367. package/src/number-control/stories/index.js +1 -1
  368. package/src/radio/stories/index.js +1 -1
  369. package/src/radio-group/stories/index.js +4 -1
  370. package/src/resizable-box/index.tsx +2 -2
  371. package/src/resizable-box/resize-tooltip/index.tsx +2 -2
  372. package/src/resizable-box/resize-tooltip/label.tsx +2 -2
  373. package/src/scrollable/component.js +1 -1
  374. package/src/select-control/index.tsx +2 -3
  375. package/src/spacer/component.tsx +2 -2
  376. package/src/surface/component.js +1 -1
  377. package/src/text/component.js +1 -1
  378. package/src/text-control/index.js +2 -2
  379. package/src/toggle-group-control/stories/index.js +1 -1
  380. package/src/toggle-group-control/toggle-group-control/component.tsx +2 -2
  381. package/src/toggle-group-control/toggle-group-control-option/component.tsx +2 -2
  382. package/src/tools-panel/stories/index.js +0 -1
  383. package/src/tools-panel/tools-panel/component.tsx +2 -2
  384. package/src/tools-panel/tools-panel-header/component.tsx +2 -2
  385. package/src/tools-panel/tools-panel-item/component.tsx +2 -2
  386. package/src/tree-grid/README.md +24 -1
  387. package/src/tree-grid/index.js +66 -7
  388. package/src/tree-grid/stories/index.js +4 -1
  389. package/src/tree-grid/test/__snapshots__/index.js.snap +1 -14
  390. package/src/tree-grid/test/index.js +226 -7
  391. package/src/truncate/component.js +1 -1
  392. package/src/ui/context/wordpress-component.ts +2 -2
  393. package/src/ui/control-group/component.js +1 -1
  394. package/src/ui/control-label/component.js +1 -1
  395. package/src/ui/form-group/form-group.js +1 -1
  396. package/src/ui/shortcut/component.tsx +2 -2
  397. package/src/ui/spinner/component.js +1 -1
  398. package/src/ui/tooltip/component.js +1 -1
  399. package/src/ui/tooltip/content.js +1 -1
  400. package/src/unit-control/index.tsx +2 -2
  401. package/src/unit-control/stories/index.js +1 -1
  402. package/src/v-stack/component.js +1 -1
  403. package/src/visually-hidden/component.js +1 -1
  404. package/src/z-stack/component.tsx +2 -2
  405. package/tsconfig.tsbuildinfo +1 -1
  406. package/src/tools-panel/stories/typography-panel.js +0 -215
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/heading/component.tsx"],"names":["Heading","props","forwardedRef","headerProps","ConnectedHeading"],"mappings":";;;;;;;;;;;;;AAQA;;AACA;;AACA;;AAVA;AACA;AACA;;AAGA;AACA;AACA;AAKA,SAASA,OAAT,CACCC,KADD,EAECC,YAFD,EAGE;AACD,QAAMC,WAAW,GAAG,sBAAYF,KAAZ,CAApB;AAEA,SAAO,4BAAC,UAAD,6BAAWE,WAAX;AAAyB,IAAA,GAAG,EAAGD;AAA/B,KAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAME,gBAAgB,GAAG,6BAAgBJ,OAAhB,EAAyB,SAAzB,CAAzB;eAEeI,gB","sourcesContent":["/**\n * External dependencies\n */\nimport type { Ref } from 'react';\n\n/**\n * Internal dependencies\n */\nimport { contextConnect, WordPressComponentProps } from '../ui/context';\nimport { View } from '../view';\nimport { useHeading, HeadingProps } from './hook';\n\nfunction Heading(\n\tprops: WordPressComponentProps< HeadingProps, 'h1' >,\n\tforwardedRef: Ref< any >\n) {\n\tconst headerProps = useHeading( props );\n\n\treturn <View { ...headerProps } ref={ forwardedRef } />;\n}\n\n/**\n * `Heading` renders headings and titles using the library's typography system.\n *\n * @example\n * ```jsx\n * import { Heading } from `@wordpress/components`\n *\n * function Example() {\n * return <Heading>Code is Poetry</Heading>;\n * }\n * ```\n */\nconst ConnectedHeading = contextConnect( Heading, 'Heading' );\n\nexport default ConnectedHeading;\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/heading/component.tsx"],"names":["Heading","props","forwardedRef","headerProps","ConnectedHeading"],"mappings":";;;;;;;;;;;;;AAQA;;AACA;;AACA;;AAVA;AACA;AACA;;AAGA;AACA;AACA;AAKA,SAASA,OAAT,CACCC,KADD,EAECC,YAFD,EAGE;AACD,QAAMC,WAAW,GAAG,sBAAYF,KAAZ,CAApB;AAEA,SAAO,4BAAC,UAAD,6BAAWE,WAAX;AAAyB,IAAA,GAAG,EAAGD;AAA/B,KAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAME,gBAAgB,GAAG,6BAAgBJ,OAAhB,EAAyB,SAAzB,CAAzB;eAEeI,gB","sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\n\n/**\n * Internal dependencies\n */\nimport { contextConnect, WordPressComponentProps } from '../ui/context';\nimport { View } from '../view';\nimport { useHeading, HeadingProps } from './hook';\n\nfunction Heading(\n\tprops: WordPressComponentProps< HeadingProps, 'h1' >,\n\tforwardedRef: ForwardedRef< any >\n) {\n\tconst headerProps = useHeading( props );\n\n\treturn <View { ...headerProps } ref={ forwardedRef } />;\n}\n\n/**\n * `Heading` renders headings and titles using the library's typography system.\n *\n * @example\n * ```jsx\n * import { Heading } from `@wordpress/components`\n *\n * function Example() {\n * return <Heading>Code is Poetry</Heading>;\n * }\n * ```\n */\nconst ConnectedHeading = contextConnect( Heading, 'Heading' );\n\nexport default ConnectedHeading;\n"]}
package/build/index.js CHANGED
@@ -719,6 +719,18 @@ Object.defineProperty(exports, "__experimentalNavigationMenu", {
719
719
  return _menu.default;
720
720
  }
721
721
  });
722
+ Object.defineProperty(exports, "__experimentalNavigatorBackButton", {
723
+ enumerable: true,
724
+ get: function () {
725
+ return _navigator.NavigatorBackButton;
726
+ }
727
+ });
728
+ Object.defineProperty(exports, "__experimentalNavigatorButton", {
729
+ enumerable: true,
730
+ get: function () {
731
+ return _navigator.NavigatorButton;
732
+ }
733
+ });
722
734
  Object.defineProperty(exports, "__experimentalNavigatorProvider", {
723
735
  enumerable: true,
724
736
  get: function () {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA;;AAYA;;AACA;;AAIA;;AACA;;AACA;;AAIA;;AACA;;AACA;;AACA;;AACA;;AAQA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAMA;;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;;AAIA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAKA;;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;;AAIA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AAMA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AAOA;;AACA;;AAGA;;AAIA;;AACA;;AACA;;AACA;;AACA;;AAIA;;AACA","sourcesContent":["// Primitives\nexport {\n\tSVG,\n\tPath,\n\tCircle,\n\tPolygon,\n\tRect,\n\tG,\n\tHorizontalRule,\n\tBlockQuotation,\n} from '@wordpress/primitives';\n\n// Components\nexport { default as __experimentalAlignmentMatrixControl } from './alignment-matrix-control';\nexport {\n\tdefault as Animate,\n\tgetAnimateClassName as __unstableGetAnimateClassName,\n} from './animate';\nexport { __unstableMotion } from './animation';\nexport { default as AnglePickerControl } from './angle-picker-control';\nexport {\n\tdefault as Autocomplete,\n\tuseAutocompleteProps as __unstableUseAutocompleteProps,\n} from './autocomplete';\nexport { default as BaseControl } from './base-control';\nexport { default as __experimentalBoxControl } from './box-control';\nexport { default as Button } from './button';\nexport { default as ButtonGroup } from './button-group';\nexport {\n\tCard,\n\tCardBody,\n\tCardDivider,\n\tCardFooter,\n\tCardHeader,\n\tCardMedia,\n} from './card';\nexport { default as CheckboxControl } from './checkbox-control';\nexport { default as ClipboardButton } from './clipboard-button';\nexport { default as __experimentalPaletteEdit } from './palette-edit';\nexport { default as ColorIndicator } from './color-indicator';\nexport { default as ColorPalette } from './color-palette';\nexport { ColorPicker } from './color-picker';\nexport { default as ComboboxControl } from './combobox-control';\nexport {\n\tComposite as __unstableComposite,\n\tCompositeGroup as __unstableCompositeGroup,\n\tCompositeItem as __unstableCompositeItem,\n\tuseCompositeState as __unstableUseCompositeState,\n} from './composite';\nexport { ConfirmDialog as __experimentalConfirmDialog } from './confirm-dialog';\nexport { default as CustomSelectControl } from './custom-select-control';\nexport { default as Dashicon } from './dashicon';\nexport { default as DateTimePicker, DatePicker, TimePicker } from './date-time';\nexport { default as __experimentalDimensionControl } from './dimension-control';\nexport { default as Disabled } from './disabled';\nexport { DisclosureContent as __unstableDisclosureContent } from './disclosure';\nexport { Divider as __experimentalDivider } from './divider';\nexport { default as Draggable } from './draggable';\nexport { default as DropZone } from './drop-zone';\nexport { default as DropZoneProvider } from './drop-zone/provider';\nexport { default as Dropdown } from './dropdown';\nexport { default as DropdownMenu } from './dropdown-menu';\nexport { DuotoneSwatch, DuotonePicker } from './duotone-picker';\nexport { Elevation as __experimentalElevation } from './elevation';\nexport { default as ExternalLink } from './external-link';\nexport { Flex, FlexBlock, FlexItem } from './flex';\nexport { Flyout as __experimentalFlyout } from './flyout';\nexport { default as FocalPointPicker } from './focal-point-picker';\nexport { default as FocusableIframe } from './focusable-iframe';\nexport { default as FontSizePicker } from './font-size-picker';\nexport { default as FormFileUpload } from './form-file-upload';\nexport { default as FormToggle } from './form-toggle';\nexport { default as FormTokenField } from './form-token-field';\nexport { default as GradientPicker } from './gradient-picker';\nexport { default as CustomGradientPicker } from './custom-gradient-picker';\nexport { Grid as __experimentalGrid } from './grid';\nexport { default as Guide } from './guide';\nexport { default as GuidePage } from './guide/page';\nexport { Heading as __experimentalHeading } from './heading';\nexport { HStack as __experimentalHStack } from './h-stack';\nexport { default as Icon } from './icon';\nexport { default as IconButton } from './button/deprecated';\nexport {\n\tItemGroup as __experimentalItemGroup,\n\tItem as __experimentalItem,\n} from './item-group';\nexport { default as __experimentalInputControl } from './input-control';\nexport { default as KeyboardShortcuts } from './keyboard-shortcuts';\nexport { default as MenuGroup } from './menu-group';\nexport { default as MenuItem } from './menu-item';\nexport { default as MenuItemsChoice } from './menu-items-choice';\nexport { default as Modal } from './modal';\nexport { default as ScrollLock } from './scroll-lock';\nexport { NavigableMenu, TabbableContainer } from './navigable-container';\nexport { default as __experimentalNavigation } from './navigation';\nexport { default as __experimentalNavigationBackButton } from './navigation/back-button';\nexport { default as __experimentalNavigationGroup } from './navigation/group';\nexport { default as __experimentalNavigationItem } from './navigation/item';\nexport { default as __experimentalNavigationMenu } from './navigation/menu';\nexport {\n\tNavigatorProvider as __experimentalNavigatorProvider,\n\tNavigatorScreen as __experimentalNavigatorScreen,\n\tuseNavigator as __experimentalUseNavigator,\n} from './navigator';\nexport { default as Notice } from './notice';\nexport { default as __experimentalNumberControl } from './number-control';\nexport { default as NoticeList } from './notice/list';\nexport { default as Panel } from './panel';\nexport { default as PanelBody } from './panel/body';\nexport { default as PanelHeader } from './panel/header';\nexport { default as PanelRow } from './panel/row';\nexport { default as Placeholder } from './placeholder';\nexport { default as Popover } from './popover';\nexport { default as QueryControls } from './query-controls';\nexport { default as __experimentalRadio } from './radio';\nexport { default as __experimentalRadioGroup } from './radio-group';\nexport { default as RadioControl } from './radio-control';\nexport { default as RangeControl } from './range-control';\nexport { default as ResizableBox } from './resizable-box';\nexport { default as ResponsiveWrapper } from './responsive-wrapper';\nexport { default as SandBox } from './sandbox';\nexport { default as SearchControl } from './search-control';\nexport { default as SelectControl } from './select-control';\nexport { default as Snackbar } from './snackbar';\nexport { default as SnackbarList } from './snackbar/list';\nexport { Spacer as __experimentalSpacer } from './spacer';\nexport { Scrollable as __experimentalScrollable } from './scrollable';\nexport { default as Spinner } from './spinner';\nexport { Surface as __experimentalSurface } from './surface';\nexport { default as TabPanel } from './tab-panel';\nexport { Text as __experimentalText } from './text';\nexport { default as TextControl } from './text-control';\nexport { default as TextareaControl } from './textarea-control';\nexport { default as TextHighlight } from './text-highlight';\nexport { default as Tip } from './tip';\nexport { default as ToggleControl } from './toggle-control';\nexport {\n\tToggleGroupControl as __experimentalToggleGroupControl,\n\tToggleGroupControlOption as __experimentalToggleGroupControlOption,\n} from './toggle-group-control';\nexport { default as Toolbar } from './toolbar';\nexport { default as ToolbarButton } from './toolbar-button';\nexport { default as ToolbarDropdownMenu } from './toolbar-dropdown-menu';\nexport { default as __experimentalToolbarContext } from './toolbar-context';\nexport { default as ToolbarGroup } from './toolbar-group';\nexport { default as ToolbarItem } from './toolbar-item';\nexport {\n\tToolsPanel as __experimentalToolsPanel,\n\tToolsPanelItem as __experimentalToolsPanelItem,\n\tToolsPanelContext as __experimentalToolsPanelContext,\n} from './tools-panel';\nexport { default as Tooltip } from './tooltip';\nexport {\n\tdefault as __experimentalTreeGrid,\n\tTreeGridRow as __experimentalTreeGridRow,\n\tTreeGridCell as __experimentalTreeGridCell,\n\tTreeGridItem as __experimentalTreeGridItem,\n} from './tree-grid';\nexport { default as TreeSelect } from './tree-select';\nexport { Truncate as __experimentalTruncate } from './truncate';\nexport {\n\tdefault as __experimentalUnitControl,\n\tuseCustomUnits as __experimentalUseCustomUnits,\n\tparseUnit as __experimentalParseUnit,\n} from './unit-control';\nexport { View as __experimentalView } from './view';\nexport { VisuallyHidden } from './visually-hidden';\nexport { VStack as __experimentalVStack } from './v-stack';\nexport { default as IsolatedEventContainer } from './isolated-event-container';\nexport {\n\tcreateSlotFill,\n\tSlot,\n\tFill,\n\tProvider as SlotFillProvider,\n\tuseSlot as __experimentalUseSlot,\n} from './slot-fill';\nexport { default as __experimentalStyleProvider } from './style-provider';\nexport { ZStack as __experimentalZStack } from './z-stack';\n\n// Higher-Order Components\nexport {\n\tdefault as navigateRegions,\n\tuseNavigateRegions as __unstableUseNavigateRegions,\n} from './higher-order/navigate-regions';\nexport { default as withConstrainedTabbing } from './higher-order/with-constrained-tabbing';\nexport { default as withFallbackStyles } from './higher-order/with-fallback-styles';\nexport { default as withFilters } from './higher-order/with-filters';\nexport { default as withFocusOutside } from './higher-order/with-focus-outside';\nexport {\n\tdefault as withFocusReturn,\n\tProvider as FocusReturnProvider,\n} from './higher-order/with-focus-return';\nexport { default as withNotices } from './higher-order/with-notices';\nexport { default as withSpokenMessages } from './higher-order/with-spoken-messages';\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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A;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAIA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAOA;;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;;AAIA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AAMA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AAOA;;AACA;;AAGA;;AAIA;;AACA;;AACA;;AACA;;AACA;;AAIA;;AACA","sourcesContent":["// Primitives\nexport {\n\tSVG,\n\tPath,\n\tCircle,\n\tPolygon,\n\tRect,\n\tG,\n\tHorizontalRule,\n\tBlockQuotation,\n} from '@wordpress/primitives';\n\n// Components\nexport { default as __experimentalAlignmentMatrixControl } from './alignment-matrix-control';\nexport {\n\tdefault as Animate,\n\tgetAnimateClassName as __unstableGetAnimateClassName,\n} from './animate';\nexport { __unstableMotion } from './animation';\nexport { default as AnglePickerControl } from './angle-picker-control';\nexport {\n\tdefault as Autocomplete,\n\tuseAutocompleteProps as __unstableUseAutocompleteProps,\n} from './autocomplete';\nexport { default as BaseControl } from './base-control';\nexport { default as __experimentalBoxControl } from './box-control';\nexport { default as Button } from './button';\nexport { default as ButtonGroup } from './button-group';\nexport {\n\tCard,\n\tCardBody,\n\tCardDivider,\n\tCardFooter,\n\tCardHeader,\n\tCardMedia,\n} from './card';\nexport { default as CheckboxControl } from './checkbox-control';\nexport { default as ClipboardButton } from './clipboard-button';\nexport { default as __experimentalPaletteEdit } from './palette-edit';\nexport { default as ColorIndicator } from './color-indicator';\nexport { default as ColorPalette } from './color-palette';\nexport { ColorPicker } from './color-picker';\nexport { default as ComboboxControl } from './combobox-control';\nexport {\n\tComposite as __unstableComposite,\n\tCompositeGroup as __unstableCompositeGroup,\n\tCompositeItem as __unstableCompositeItem,\n\tuseCompositeState as __unstableUseCompositeState,\n} from './composite';\nexport { ConfirmDialog as __experimentalConfirmDialog } from './confirm-dialog';\nexport { default as CustomSelectControl } from './custom-select-control';\nexport { default as Dashicon } from './dashicon';\nexport { default as DateTimePicker, DatePicker, TimePicker } from './date-time';\nexport { default as __experimentalDimensionControl } from './dimension-control';\nexport { default as Disabled } from './disabled';\nexport { DisclosureContent as __unstableDisclosureContent } from './disclosure';\nexport { Divider as __experimentalDivider } from './divider';\nexport { default as Draggable } from './draggable';\nexport { default as DropZone } from './drop-zone';\nexport { default as DropZoneProvider } from './drop-zone/provider';\nexport { default as Dropdown } from './dropdown';\nexport { default as DropdownMenu } from './dropdown-menu';\nexport { DuotoneSwatch, DuotonePicker } from './duotone-picker';\nexport { Elevation as __experimentalElevation } from './elevation';\nexport { default as ExternalLink } from './external-link';\nexport { Flex, FlexBlock, FlexItem } from './flex';\nexport { Flyout as __experimentalFlyout } from './flyout';\nexport { default as FocalPointPicker } from './focal-point-picker';\nexport { default as FocusableIframe } from './focusable-iframe';\nexport { default as FontSizePicker } from './font-size-picker';\nexport { default as FormFileUpload } from './form-file-upload';\nexport { default as FormToggle } from './form-toggle';\nexport { default as FormTokenField } from './form-token-field';\nexport { default as GradientPicker } from './gradient-picker';\nexport { default as CustomGradientPicker } from './custom-gradient-picker';\nexport { Grid as __experimentalGrid } from './grid';\nexport { default as Guide } from './guide';\nexport { default as GuidePage } from './guide/page';\nexport { Heading as __experimentalHeading } from './heading';\nexport { HStack as __experimentalHStack } from './h-stack';\nexport { default as Icon } from './icon';\nexport { default as IconButton } from './button/deprecated';\nexport {\n\tItemGroup as __experimentalItemGroup,\n\tItem as __experimentalItem,\n} from './item-group';\nexport { default as __experimentalInputControl } from './input-control';\nexport { default as KeyboardShortcuts } from './keyboard-shortcuts';\nexport { default as MenuGroup } from './menu-group';\nexport { default as MenuItem } from './menu-item';\nexport { default as MenuItemsChoice } from './menu-items-choice';\nexport { default as Modal } from './modal';\nexport { default as ScrollLock } from './scroll-lock';\nexport { NavigableMenu, TabbableContainer } from './navigable-container';\nexport { default as __experimentalNavigation } from './navigation';\nexport { default as __experimentalNavigationBackButton } from './navigation/back-button';\nexport { default as __experimentalNavigationGroup } from './navigation/group';\nexport { default as __experimentalNavigationItem } from './navigation/item';\nexport { default as __experimentalNavigationMenu } from './navigation/menu';\nexport {\n\tNavigatorProvider as __experimentalNavigatorProvider,\n\tNavigatorScreen as __experimentalNavigatorScreen,\n\tNavigatorButton as __experimentalNavigatorButton,\n\tNavigatorBackButton as __experimentalNavigatorBackButton,\n\tuseNavigator as __experimentalUseNavigator,\n} from './navigator';\nexport { default as Notice } from './notice';\nexport { default as __experimentalNumberControl } from './number-control';\nexport { default as NoticeList } from './notice/list';\nexport { default as Panel } from './panel';\nexport { default as PanelBody } from './panel/body';\nexport { default as PanelHeader } from './panel/header';\nexport { default as PanelRow } from './panel/row';\nexport { default as Placeholder } from './placeholder';\nexport { default as Popover } from './popover';\nexport { default as QueryControls } from './query-controls';\nexport { default as __experimentalRadio } from './radio';\nexport { default as __experimentalRadioGroup } from './radio-group';\nexport { default as RadioControl } from './radio-control';\nexport { default as RangeControl } from './range-control';\nexport { default as ResizableBox } from './resizable-box';\nexport { default as ResponsiveWrapper } from './responsive-wrapper';\nexport { default as SandBox } from './sandbox';\nexport { default as SearchControl } from './search-control';\nexport { default as SelectControl } from './select-control';\nexport { default as Snackbar } from './snackbar';\nexport { default as SnackbarList } from './snackbar/list';\nexport { Spacer as __experimentalSpacer } from './spacer';\nexport { Scrollable as __experimentalScrollable } from './scrollable';\nexport { default as Spinner } from './spinner';\nexport { Surface as __experimentalSurface } from './surface';\nexport { default as TabPanel } from './tab-panel';\nexport { Text as __experimentalText } from './text';\nexport { default as TextControl } from './text-control';\nexport { default as TextareaControl } from './textarea-control';\nexport { default as TextHighlight } from './text-highlight';\nexport { default as Tip } from './tip';\nexport { default as ToggleControl } from './toggle-control';\nexport {\n\tToggleGroupControl as __experimentalToggleGroupControl,\n\tToggleGroupControlOption as __experimentalToggleGroupControlOption,\n} from './toggle-group-control';\nexport { default as Toolbar } from './toolbar';\nexport { default as ToolbarButton } from './toolbar-button';\nexport { default as ToolbarDropdownMenu } from './toolbar-dropdown-menu';\nexport { default as __experimentalToolbarContext } from './toolbar-context';\nexport { default as ToolbarGroup } from './toolbar-group';\nexport { default as ToolbarItem } from './toolbar-item';\nexport {\n\tToolsPanel as __experimentalToolsPanel,\n\tToolsPanelItem as __experimentalToolsPanelItem,\n\tToolsPanelContext as __experimentalToolsPanelContext,\n} from './tools-panel';\nexport { default as Tooltip } from './tooltip';\nexport {\n\tdefault as __experimentalTreeGrid,\n\tTreeGridRow as __experimentalTreeGridRow,\n\tTreeGridCell as __experimentalTreeGridCell,\n\tTreeGridItem as __experimentalTreeGridItem,\n} from './tree-grid';\nexport { default as TreeSelect } from './tree-select';\nexport { Truncate as __experimentalTruncate } from './truncate';\nexport {\n\tdefault as __experimentalUnitControl,\n\tuseCustomUnits as __experimentalUseCustomUnits,\n\tparseUnit as __experimentalParseUnit,\n} from './unit-control';\nexport { View as __experimentalView } from './view';\nexport { VisuallyHidden } from './visually-hidden';\nexport { VStack as __experimentalVStack } from './v-stack';\nexport { default as IsolatedEventContainer } from './isolated-event-container';\nexport {\n\tcreateSlotFill,\n\tSlot,\n\tFill,\n\tProvider as SlotFillProvider,\n\tuseSlot as __experimentalUseSlot,\n} from './slot-fill';\nexport { default as __experimentalStyleProvider } from './style-provider';\nexport { ZStack as __experimentalZStack } from './z-stack';\n\n// Higher-Order Components\nexport {\n\tdefault as navigateRegions,\n\tuseNavigateRegions as __unstableUseNavigateRegions,\n} from './higher-order/navigate-regions';\nexport { default as withConstrainedTabbing } from './higher-order/with-constrained-tabbing';\nexport { default as withFallbackStyles } from './higher-order/with-fallback-styles';\nexport { default as withFilters } from './higher-order/with-filters';\nexport { default as withFocusOutside } from './higher-order/with-focus-outside';\nexport {\n\tdefault as withFocusReturn,\n\tProvider as FocusReturnProvider,\n} from './higher-order/with-focus-return';\nexport { default as withNotices } from './higher-order/with-notices';\nexport { default as withSpokenMessages } from './higher-order/with-spoken-messages';\n"]}
@@ -115,7 +115,9 @@ var _exportNames = {
115
115
  useGlobalStyles: true,
116
116
  withGlobalStyles: true,
117
117
  getMergedGlobalStyles: true,
118
- getGlobalStyles: true
118
+ getGlobalStyles: true,
119
+ getColorsAndGradients: true,
120
+ useMobileGlobalStylesColors: true
119
121
  };
120
122
  Object.defineProperty(exports, "ALIGNMENT_BREAKPOINTS", {
121
123
  enumerable: true,
@@ -693,6 +695,12 @@ Object.defineProperty(exports, "getClipboard", {
693
695
  return _clipboard.getClipboard;
694
696
  }
695
697
  });
698
+ Object.defineProperty(exports, "getColorsAndGradients", {
699
+ enumerable: true,
700
+ get: function () {
701
+ return _utils3.getColorsAndGradients;
702
+ }
703
+ });
696
704
  Object.defineProperty(exports, "getGlobalStyles", {
697
705
  enumerable: true,
698
706
  get: function () {
@@ -729,6 +737,12 @@ Object.defineProperty(exports, "useGlobalStyles", {
729
737
  return _globalStylesContext.useGlobalStyles;
730
738
  }
731
739
  });
740
+ Object.defineProperty(exports, "useMobileGlobalStylesColors", {
741
+ enumerable: true,
742
+ get: function () {
743
+ return _utils3.useMobileGlobalStylesColors;
744
+ }
745
+ });
732
746
  Object.defineProperty(exports, "withConstrainedTabbing", {
733
747
  enumerable: true,
734
748
  get: function () {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/index.native.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAGA;;AACA;;AAOA;;AAMA;;AAMA","sourcesContent":["export {\n\tSVG,\n\tPath,\n\tCircle,\n\tPolygon,\n\tRect,\n\tG,\n\tHorizontalRule,\n\tBlockQuotation,\n} from '@wordpress/primitives';\nexport { default as ColorIndicator } from './color-indicator';\nexport { default as ColorPalette } from './color-palette';\nexport { ColorPicker } from './color-picker';\nexport { default as Dashicon } from './dashicon';\nexport { default as Dropdown } from './dropdown';\nexport { default as DropdownMenu } from './dropdown-menu';\nexport { default as FocalPointPicker } from './focal-point-picker';\nexport { default as Toolbar } from './toolbar';\nexport { default as ToolbarButton } from './toolbar-button';\nexport { default as __experimentalToolbarContext } from './toolbar-context';\nexport { default as ToolbarGroup } from './toolbar-group';\nexport { default as ToolbarItem } from './toolbar-item';\nexport { default as ToolbarDropdownMenu } from './toolbar-dropdown-menu';\nexport { default as Tooltip } from './tooltip';\nexport { default as Icon } from './icon';\nexport { default as Spinner } from './spinner';\nexport {\n\tcreateSlotFill,\n\tSlot,\n\tFill,\n\tProvider as SlotFillProvider,\n} from './slot-fill';\n\nexport { default as __experimentalStyleProvider } from './style-provider';\nexport { default as BaseControl } from './base-control';\nexport { default as TextareaControl } from './textarea-control';\nexport { default as PanelBody } from './panel/body';\nexport { default as PanelActions } from './panel/actions';\nexport { default as Button } from './button';\nexport { default as __experimentalText } from './text';\nexport { default as ExternalLink } from './external-link';\nexport { default as TextControl } from './text-control';\nexport { default as ToggleControl } from './toggle-control';\nexport { default as SandBox } from './sandbox';\nexport { default as SearchControl } from './search-control';\nexport { default as SelectControl } from './select-control';\nexport { default as RangeControl } from './range-control';\nexport { default as ResizableBox } from './resizable-box';\nexport { default as FooterMessageControl } from './footer-message-control';\nexport { default as ColorControl } from './color-control';\nexport { default as QueryControls } from './query-controls';\nexport { default as Notice } from './notice';\nexport { default as NoticeList } from './notice/list';\nexport { default as RadioControl } from './radio-control';\nexport {\n\tdefault as UnitControl,\n\tuseCustomUnits as __experimentalUseCustomUnits,\n} from './unit-control';\nexport {\n\tCSS_UNITS as CSS_UNITS,\n\tfilterUnitsWithSettings as filterUnitsWithSettings,\n} from './unit-control/utils';\nexport { default as Disabled } from './disabled';\n\n// Higher-Order Components\nexport { default as withConstrainedTabbing } from './higher-order/with-constrained-tabbing';\nexport { default as withFallbackStyles } from './higher-order/with-fallback-styles';\nexport { default as withFilters } from './higher-order/with-filters';\nexport { default as FontSizePicker } from './font-size-picker'; // Intentionally called after slot-fill and withFilters.\nexport { default as withFocusOutside } from './higher-order/with-focus-outside';\nexport { default as withFocusReturn } from './higher-order/with-focus-return';\nexport { default as withNotices } from './higher-order/with-notices';\nexport { default as withSpokenMessages } from './higher-order/with-spoken-messages';\nexport * from './text';\n\n// Mobile Components\nexport {\n\t__unstableAutocompletionItemsFill,\n\t__unstableAutocompletionItemsSlot,\n} from './mobile/autocompletion-items';\nexport { default as Autocomplete } from './autocomplete';\nexport { default as BottomSheet } from './mobile/bottom-sheet';\nexport {\n\tBottomSheetConsumer,\n\tBottomSheetProvider,\n\tBottomSheetContext,\n} from './mobile/bottom-sheet/bottom-sheet-context';\nexport { default as BottomSheetSelectControl } from './mobile/bottom-sheet-select-control';\nexport { default as HTMLTextInput } from './mobile/html-text-input';\nexport { default as KeyboardAvoidingView } from './mobile/keyboard-avoiding-view';\nexport { default as KeyboardAwareFlatList } from './mobile/keyboard-aware-flat-list';\nexport { default as Picker } from './mobile/picker';\nexport { default as ReadableContentView } from './mobile/readable-content-view';\nexport { default as CycleSelectControl } from './mobile/cycle-select-control';\nexport { default as Gradient } from './mobile/gradient';\nexport { default as ColorSettings } from './mobile/color-settings';\nexport { default as SegmentedControls } from './mobile/segmented-control';\nexport { default as FocalPointSettingsPanel } from './mobile/focal-point-settings-panel';\nexport { default as BottomSheetTextControl } from './mobile/bottom-sheet-text-control';\nexport { default as FooterMessageLink } from './mobile/bottom-sheet/footer-message-link/footer-message-link';\nexport { LinkPicker } from './mobile/link-picker';\nexport { default as LinkPickerScreen } from './mobile/link-picker/link-picker-screen';\nexport { default as LinkSettings } from './mobile/link-settings';\nexport { default as LinkSettingsScreen } from './mobile/link-settings/link-settings-screen';\nexport { default as LinkSettingsNavigation } from './mobile/link-settings/link-settings-navigation';\nexport { default as ImageLinkDestinationsScreen } from './mobile/link-settings/image-link-destinations-screen';\nexport { default as SegmentedControl } from './mobile/segmented-control';\nexport { default as Image, IMAGE_DEFAULT_FOCAL_POINT } from './mobile/image';\nexport { default as ImageEditingButton } from './mobile/image/image-editing-button';\nexport { default as InserterButton } from './mobile/inserter-button';\nexport { setClipboard, getClipboard } from './mobile/clipboard';\nexport { default as AudioPlayer } from './mobile/audio-player';\nexport { default as Badge } from './mobile/badge';\nexport { default as Gridicons } from './mobile/gridicons';\n\n// Utils\nexport { colorsUtils } from './mobile/color-settings/utils';\nexport {\n\tWIDE_ALIGNMENTS,\n\tALIGNMENT_BREAKPOINTS,\n\talignmentHelpers,\n} from './mobile/utils/alignments';\n\n// Hooks\nexport {\n\tconvertUnitToMobile,\n\tuseConvertUnitToMobile,\n\tgetValueAndUnit,\n} from './mobile/utils/use-unit-converter-to-mobile';\n\nexport {\n\tdefault as GlobalStylesContext,\n\tuseGlobalStyles,\n\twithGlobalStyles,\n\tgetMergedGlobalStyles,\n} from './mobile/global-styles-context';\nexport { getGlobalStyles } from './mobile/global-styles-context/utils';\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/index.native.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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ourcesContent":["export {\n\tSVG,\n\tPath,\n\tCircle,\n\tPolygon,\n\tRect,\n\tG,\n\tHorizontalRule,\n\tBlockQuotation,\n} from '@wordpress/primitives';\nexport { default as ColorIndicator } from './color-indicator';\nexport { default as ColorPalette } from './color-palette';\nexport { ColorPicker } from './color-picker';\nexport { default as Dashicon } from './dashicon';\nexport { default as Dropdown } from './dropdown';\nexport { default as DropdownMenu } from './dropdown-menu';\nexport { default as FocalPointPicker } from './focal-point-picker';\nexport { default as Toolbar } from './toolbar';\nexport { default as ToolbarButton } from './toolbar-button';\nexport { default as __experimentalToolbarContext } from './toolbar-context';\nexport { default as ToolbarGroup } from './toolbar-group';\nexport { default as ToolbarItem } from './toolbar-item';\nexport { default as ToolbarDropdownMenu } from './toolbar-dropdown-menu';\nexport { default as Tooltip } from './tooltip';\nexport { default as Icon } from './icon';\nexport { default as Spinner } from './spinner';\nexport {\n\tcreateSlotFill,\n\tSlot,\n\tFill,\n\tProvider as SlotFillProvider,\n} from './slot-fill';\n\nexport { default as __experimentalStyleProvider } from './style-provider';\nexport { default as BaseControl } from './base-control';\nexport { default as TextareaControl } from './textarea-control';\nexport { default as PanelBody } from './panel/body';\nexport { default as PanelActions } from './panel/actions';\nexport { default as Button } from './button';\nexport { default as __experimentalText } from './text';\nexport { default as ExternalLink } from './external-link';\nexport { default as TextControl } from './text-control';\nexport { default as ToggleControl } from './toggle-control';\nexport { default as SandBox } from './sandbox';\nexport { default as SearchControl } from './search-control';\nexport { default as SelectControl } from './select-control';\nexport { default as RangeControl } from './range-control';\nexport { default as ResizableBox } from './resizable-box';\nexport { default as FooterMessageControl } from './footer-message-control';\nexport { default as ColorControl } from './color-control';\nexport { default as QueryControls } from './query-controls';\nexport { default as Notice } from './notice';\nexport { default as NoticeList } from './notice/list';\nexport { default as RadioControl } from './radio-control';\nexport {\n\tdefault as UnitControl,\n\tuseCustomUnits as __experimentalUseCustomUnits,\n} from './unit-control';\nexport {\n\tCSS_UNITS as CSS_UNITS,\n\tfilterUnitsWithSettings as filterUnitsWithSettings,\n} from './unit-control/utils';\nexport { default as Disabled } from './disabled';\n\n// Higher-Order Components\nexport { default as withConstrainedTabbing } from './higher-order/with-constrained-tabbing';\nexport { default as withFallbackStyles } from './higher-order/with-fallback-styles';\nexport { default as withFilters } from './higher-order/with-filters';\nexport { default as FontSizePicker } from './font-size-picker'; // Intentionally called after slot-fill and withFilters.\nexport { default as withFocusOutside } from './higher-order/with-focus-outside';\nexport { default as withFocusReturn } from './higher-order/with-focus-return';\nexport { default as withNotices } from './higher-order/with-notices';\nexport { default as withSpokenMessages } from './higher-order/with-spoken-messages';\nexport * from './text';\n\n// Mobile Components\nexport {\n\t__unstableAutocompletionItemsFill,\n\t__unstableAutocompletionItemsSlot,\n} from './mobile/autocompletion-items';\nexport { default as Autocomplete } from './autocomplete';\nexport { default as BottomSheet } from './mobile/bottom-sheet';\nexport {\n\tBottomSheetConsumer,\n\tBottomSheetProvider,\n\tBottomSheetContext,\n} from './mobile/bottom-sheet/bottom-sheet-context';\nexport { default as BottomSheetSelectControl } from './mobile/bottom-sheet-select-control';\nexport { default as HTMLTextInput } from './mobile/html-text-input';\nexport { default as KeyboardAvoidingView } from './mobile/keyboard-avoiding-view';\nexport { default as KeyboardAwareFlatList } from './mobile/keyboard-aware-flat-list';\nexport { default as Picker } from './mobile/picker';\nexport { default as ReadableContentView } from './mobile/readable-content-view';\nexport { default as CycleSelectControl } from './mobile/cycle-select-control';\nexport { default as Gradient } from './mobile/gradient';\nexport { default as ColorSettings } from './mobile/color-settings';\nexport { default as SegmentedControls } from './mobile/segmented-control';\nexport { default as FocalPointSettingsPanel } from './mobile/focal-point-settings-panel';\nexport { default as BottomSheetTextControl } from './mobile/bottom-sheet-text-control';\nexport { default as FooterMessageLink } from './mobile/bottom-sheet/footer-message-link/footer-message-link';\nexport { LinkPicker } from './mobile/link-picker';\nexport { default as LinkPickerScreen } from './mobile/link-picker/link-picker-screen';\nexport { default as LinkSettings } from './mobile/link-settings';\nexport { default as LinkSettingsScreen } from './mobile/link-settings/link-settings-screen';\nexport { default as LinkSettingsNavigation } from './mobile/link-settings/link-settings-navigation';\nexport { default as ImageLinkDestinationsScreen } from './mobile/link-settings/image-link-destinations-screen';\nexport { default as SegmentedControl } from './mobile/segmented-control';\nexport { default as Image, IMAGE_DEFAULT_FOCAL_POINT } from './mobile/image';\nexport { default as ImageEditingButton } from './mobile/image/image-editing-button';\nexport { default as InserterButton } from './mobile/inserter-button';\nexport { setClipboard, getClipboard } from './mobile/clipboard';\nexport { default as AudioPlayer } from './mobile/audio-player';\nexport { default as Badge } from './mobile/badge';\nexport { default as Gridicons } from './mobile/gridicons';\n\n// Utils\nexport { colorsUtils } from './mobile/color-settings/utils';\nexport {\n\tWIDE_ALIGNMENTS,\n\tALIGNMENT_BREAKPOINTS,\n\talignmentHelpers,\n} from './mobile/utils/alignments';\n\n// Hooks\nexport {\n\tconvertUnitToMobile,\n\tuseConvertUnitToMobile,\n\tgetValueAndUnit,\n} from './mobile/utils/use-unit-converter-to-mobile';\n\nexport {\n\tdefault as GlobalStylesContext,\n\tuseGlobalStyles,\n\twithGlobalStyles,\n\tgetMergedGlobalStyles,\n} from './mobile/global-styles-context';\nexport {\n\tgetGlobalStyles,\n\tgetColorsAndGradients,\n\tuseMobileGlobalStylesColors,\n} from './mobile/global-styles-context/utils';\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/input-control/index.tsx"],"names":["useUniqueId","idProp","instanceId","InputControl","id","ref","__unstableStateReducer","stateReducer","state","__unstableInputWidth","className","disabled","hideLabelFromVision","isPressEnterToChange","label","labelPosition","onChange","noop","onValidate","onKeyDown","prefix","size","suffix","value","props","isFocused","setIsFocused","classes","ForwardedComponent"],"mappings":";;;;;;;;;;AAWA;;;;AARA;;AACA;;AAMA;;AAMA;;AACA;;AAjBA;AACA;AACA;;AAKA;AACA;AACA;;AAIA;AACA;AACA;AAKA,SAASA,WAAT,CAAsBC,MAAtB,EAAwC;AACvC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,IAAA,MAAM,EAAGK,MAXV;AAYC,IAAA,IAAI,EAAGC,IAZR;AAaC,IAAA,MAAM,EAAGC;AAbV,KAeC,4BAAC,mBAAD,6BACME,KADN;AAEC,IAAA,SAAS,EAAC,iCAFX;AAGC,IAAA,QAAQ,EAAGb,QAHZ;AAIC,IAAA,EAAE,EAAGP,EAJN;AAKC,IAAA,SAAS,EAAGqB,SALb;AAMC,IAAA,oBAAoB,EAAGZ,oBANxB;AAOC,IAAA,QAAQ,EAAGG,QAPZ;AAQC,IAAA,SAAS,EAAGG,SARb;AASC,IAAA,UAAU,EAAGD,UATd;AAUC,IAAA,GAAG,EAAGb,GAVP;AAWC,IAAA,YAAY,EAAGqB,YAXhB;AAYC,IAAA,IAAI,EAAGL,IAZR;AAaC,IAAA,YAAY,EAAGd,YAbhB;AAcC,IAAA,KAAK,EAAGgB;AAdT,KAfD,CADD;AAkCA;;AAED,MAAMK,kBAAkB,GAAG,yBAAYzB,YAAZ,CAA3B;eAEeyB,kB","sourcesContent":["/**\n * External dependencies\n */\nimport { noop } from 'lodash';\nimport classNames from 'classnames';\nimport type { Ref } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport { useState, forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport InputBase from './input-base';\nimport InputField from './input-field';\nimport type { InputControlProps } from './types';\n\nfunction useUniqueId( idProp?: string ) {\n\tconst instanceId = useInstanceId( InputControl );\n\tconst id = `inspector-input-control-${ instanceId }`;\n\n\treturn idProp || id;\n}\n\nexport function InputControl(\n\t{\n\t\t__unstableStateReducer: stateReducer = ( state ) => state,\n\t\t__unstableInputWidth,\n\t\tclassName,\n\t\tdisabled = false,\n\t\thideLabelFromVision = false,\n\t\tid: idProp,\n\t\tisPressEnterToChange = false,\n\t\tlabel,\n\t\tlabelPosition = 'top',\n\t\tonChange = noop,\n\t\tonValidate = noop,\n\t\tonKeyDown = noop,\n\t\tprefix,\n\t\tsize = 'default',\n\t\tsuffix,\n\t\tvalue,\n\t\t...props\n\t}: InputControlProps,\n\tref: Ref< HTMLInputElement >\n) {\n\tconst [ isFocused, setIsFocused ] = useState( false );\n\n\tconst id = useUniqueId( idProp );\n\tconst classes = classNames( 'components-input-control', className );\n\n\treturn (\n\t\t<InputBase\n\t\t\t__unstableInputWidth={ __unstableInputWidth }\n\t\t\tclassName={ classes }\n\t\t\tdisabled={ disabled }\n\t\t\tgap={ 3 }\n\t\t\thideLabelFromVision={ hideLabelFromVision }\n\t\t\tid={ id }\n\t\t\tisFocused={ isFocused }\n\t\t\tjustify=\"left\"\n\t\t\tlabel={ label }\n\t\t\tlabelPosition={ labelPosition }\n\t\t\tprefix={ prefix }\n\t\t\tsize={ size }\n\t\t\tsuffix={ suffix }\n\t\t>\n\t\t\t<InputField\n\t\t\t\t{ ...props }\n\t\t\t\tclassName=\"components-input-control__input\"\n\t\t\t\tdisabled={ disabled }\n\t\t\t\tid={ id }\n\t\t\t\tisFocused={ isFocused }\n\t\t\t\tisPressEnterToChange={ isPressEnterToChange }\n\t\t\t\tonChange={ onChange }\n\t\t\t\tonKeyDown={ onKeyDown }\n\t\t\t\tonValidate={ onValidate }\n\t\t\t\tref={ ref }\n\t\t\t\tsetIsFocused={ setIsFocused }\n\t\t\t\tsize={ size }\n\t\t\t\tstateReducer={ stateReducer }\n\t\t\t\tvalue={ value }\n\t\t\t/>\n\t\t</InputBase>\n\t);\n}\n\nconst ForwardedComponent = forwardRef( InputControl );\n\nexport default ForwardedComponent;\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/input-control/index.tsx"],"names":["useUniqueId","idProp","instanceId","InputControl","id","ref","__unstableStateReducer","stateReducer","state","__unstableInputWidth","className","disabled","hideLabelFromVision","isPressEnterToChange","label","labelPosition","onChange","noop","onValidate","onKeyDown","prefix","size","suffix","value","props","isFocused","setIsFocused","classes","ForwardedComponent"],"mappings":";;;;;;;;;;AAWA;;;;AARA;;AACA;;AAMA;;AAMA;;AACA;;A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;AAQC,IAAA,OAAO,EAAC,MART;AASC,IAAA,KAAK,EAAGX,KATT;AAUC,IAAA,aAAa,EAAGC,aAVjB;AAWC,IAAA,MAAM,EAAGK,MAXV;AAYC,IAAA,IAAI,EAAGC,IAZR;AAaC,IAAA,MAAM,EAAGC;AAbV,KAeC,4BAAC,mBAAD,6BACME,KADN;AAEC,IAAA,SAAS,EAAC,iCAFX;AAGC,IAAA,QAAQ,EAAGb,QAHZ;AAIC,IAAA,EAAE,EAAGP,EAJN;AAKC,IAAA,SAAS,EAAGqB,SALb;AAMC,IAAA,oBAAoB,EAAGZ,oBANxB;AAOC,IAAA,QAAQ,EAAGG,QAPZ;AAQC,IAAA,SAAS,EAAGG,SARb;AASC,IAAA,UAAU,EAAGD,UATd;AAUC,IAAA,GAAG,EAAGb,GAVP;AAWC,IAAA,YAAY,EAAGqB,YAXhB;AAYC,IAAA,IAAI,EAAGL,IAZR;AAaC,IAAA,YAAY,EAAGd,YAbhB;AAcC,IAAA,KAAK,EAAGgB;AAdT,KAfD,CADD;AAkCA;;AAED,MAAMK,kBAAkB,GAAG,yBAAYzB,YAAZ,CAA3B;eAEeyB,kB","sourcesContent":["/**\n * External dependencies\n */\nimport { noop } from 'lodash';\nimport classNames from 'classnames';\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport { useState, forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport InputBase from './input-base';\nimport InputField from './input-field';\nimport type { InputControlProps } from './types';\n\nfunction useUniqueId( idProp?: string ) {\n\tconst instanceId = useInstanceId( InputControl );\n\tconst id = `inspector-input-control-${ instanceId }`;\n\n\treturn idProp || id;\n}\n\nexport function InputControl(\n\t{\n\t\t__unstableStateReducer: stateReducer = ( state ) => state,\n\t\t__unstableInputWidth,\n\t\tclassName,\n\t\tdisabled = false,\n\t\thideLabelFromVision = false,\n\t\tid: idProp,\n\t\tisPressEnterToChange = false,\n\t\tlabel,\n\t\tlabelPosition = 'top',\n\t\tonChange = noop,\n\t\tonValidate = noop,\n\t\tonKeyDown = noop,\n\t\tprefix,\n\t\tsize = 'default',\n\t\tsuffix,\n\t\tvalue,\n\t\t...props\n\t}: InputControlProps,\n\tref: ForwardedRef< HTMLInputElement >\n) {\n\tconst [ isFocused, setIsFocused ] = useState( false );\n\n\tconst id = useUniqueId( idProp );\n\tconst classes = classNames( 'components-input-control', className );\n\n\treturn (\n\t\t<InputBase\n\t\t\t__unstableInputWidth={ __unstableInputWidth }\n\t\t\tclassName={ classes }\n\t\t\tdisabled={ disabled }\n\t\t\tgap={ 3 }\n\t\t\thideLabelFromVision={ hideLabelFromVision }\n\t\t\tid={ id }\n\t\t\tisFocused={ isFocused }\n\t\t\tjustify=\"left\"\n\t\t\tlabel={ label }\n\t\t\tlabelPosition={ labelPosition }\n\t\t\tprefix={ prefix }\n\t\t\tsize={ size }\n\t\t\tsuffix={ suffix }\n\t\t>\n\t\t\t<InputField\n\t\t\t\t{ ...props }\n\t\t\t\tclassName=\"components-input-control__input\"\n\t\t\t\tdisabled={ disabled }\n\t\t\t\tid={ id }\n\t\t\t\tisFocused={ isFocused }\n\t\t\t\tisPressEnterToChange={ isPressEnterToChange }\n\t\t\t\tonChange={ onChange }\n\t\t\t\tonKeyDown={ onKeyDown }\n\t\t\t\tonValidate={ onValidate }\n\t\t\t\tref={ ref }\n\t\t\t\tsetIsFocused={ setIsFocused }\n\t\t\t\tsize={ size }\n\t\t\t\tstateReducer={ stateReducer }\n\t\t\t\tvalue={ value }\n\t\t\t/>\n\t\t</InputBase>\n\t);\n}\n\nconst ForwardedComponent = forwardRef( InputControl );\n\nexport default ForwardedComponent;\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/input-control/input-base.tsx"],"names":["useUniqueId","idProp","instanceId","InputBase","id","getUIFlexProps","labelPosition","props","direction","gap","justify","ref","__unstableInputWidth","children","className","disabled","hideLabelFromVision","isFocused","label","prefix","size","suffix","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wBAAD,6BACMX,KADN,EAEMF,cAAc,CAAEC,aAAF,CAFpB;AAGC,MAAA,SAAS,EAAGQ,SAHb;AAIC,MAAA,SAAS,EAAGG,SAJb;AAKC,MAAA,aAAa,EAAGX,aALjB;AAMC,MAAA,GAAG,EAAGK;AANP,QAQC,4BAAC,gCAAD,QACC,4BAAC,cAAD;AACC,MAAA,SAAS,EAAC,iCADX;AAEC,MAAA,mBAAmB,EAAGK,mBAFvB;AAGC,MAAA,aAAa,EAAGV,aAHjB;AAIC,MAAA,OAAO,EAAGF,EAJX;AAKC,MAAA,IAAI,EAAGgB;AALR,OAOGF,KAPH,CADD,CARD,EAmBC,4BAAC,6BAAD;AACC,MAAA,oBAAoB,EAAGN,oBADxB;AAEC,MAAA,SAAS,EAAC,qCAFX;AAGC,MAAA,QAAQ,EAAGG,QAHZ;AAIC,MAAA,SAAS,EAAGO,SAJb;AAKC,MAAA,aAAa,EAAGhB;AALjB,OAOGa,MAAM,IACP,4BAAC,0BAAD;AAAQ,MAAA,SAAS,EAAC;AAAlB,OACGA,MADH,CARF,EAYGN,QAZH,EAaGQ,MAAM,IACP,4BAAC,0BAAD;AAAQ,MAAA,SAAS,EAAC;AAAlB,OACGA,MADH,CAdF,EAkBC,4BAAC,iBAAD;AAAU,MAAA,QAAQ,EAAGN,QAArB;AAAgC,MAAA,SAAS,EAAGE;AAA5C,MAlBD,CAnBD;AAFD;AA2CA;;eAEc,yBAAYd,SAAZ,C","sourcesContent":["/**\n * External dependencies\n */\nimport type { Ref } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport Backdrop from './backdrop';\nimport Label from './label';\nimport {\n\tContainer,\n\tRoot,\n\tPrefix,\n\tSuffix,\n\tLabelWrapper,\n} from './styles/input-control-styles';\nimport type { InputBaseProps, LabelPosition } from './types';\n\nfunction useUniqueId( idProp?: string ) {\n\tconst instanceId = useInstanceId( InputBase );\n\tconst id = `input-base-control-${ instanceId }`;\n\n\treturn idProp || id;\n}\n\n// Adapter to map props for the new ui/flex compopnent.\nfunction getUIFlexProps( labelPosition?: LabelPosition ) {\n\tconst props: { direction?: string; gap?: number; justify?: string } = {};\n\tswitch ( labelPosition ) {\n\t\tcase 'top':\n\t\t\tprops.direction = 'column';\n\t\t\tprops.gap = 0;\n\t\t\tbreak;\n\t\tcase 'bottom':\n\t\t\tprops.direction = 'column-reverse';\n\t\t\tprops.gap = 0;\n\t\t\tbreak;\n\t\tcase 'edge':\n\t\t\tprops.justify = 'space-between';\n\t\t\tbreak;\n\t}\n\n\treturn props;\n}\n\nexport function InputBase(\n\t{\n\t\t__unstableInputWidth,\n\t\tchildren,\n\t\tclassName,\n\t\tdisabled = false,\n\t\thideLabelFromVision = false,\n\t\tlabelPosition,\n\t\tid: idProp,\n\t\tisFocused = false,\n\t\tlabel,\n\t\tprefix,\n\t\tsize = 'default',\n\t\tsuffix,\n\t\t...props\n\t}: InputBaseProps,\n\tref: Ref< HTMLDivElement >\n) {\n\tconst id = useUniqueId( idProp );\n\tconst hideLabel = hideLabelFromVision || ! label;\n\n\treturn (\n\t\t// @ts-expect-error The `direction` prop from Flex (FlexDirection) conflicts with legacy SVGAttributes `direction` (string) that come from React intrinsic prop definitions\n\t\t<Root\n\t\t\t{ ...props }\n\t\t\t{ ...getUIFlexProps( labelPosition ) }\n\t\t\tclassName={ className }\n\t\t\tisFocused={ isFocused }\n\t\t\tlabelPosition={ labelPosition }\n\t\t\tref={ ref }\n\t\t>\n\t\t\t<LabelWrapper>\n\t\t\t\t<Label\n\t\t\t\t\tclassName=\"components-input-control__label\"\n\t\t\t\t\thideLabelFromVision={ hideLabelFromVision }\n\t\t\t\t\tlabelPosition={ labelPosition }\n\t\t\t\t\thtmlFor={ id }\n\t\t\t\t\tsize={ size }\n\t\t\t\t>\n\t\t\t\t\t{ label }\n\t\t\t\t</Label>\n\t\t\t</LabelWrapper>\n\t\t\t<Container\n\t\t\t\t__unstableInputWidth={ __unstableInputWidth }\n\t\t\t\tclassName=\"components-input-control__container\"\n\t\t\t\tdisabled={ disabled }\n\t\t\t\thideLabel={ hideLabel }\n\t\t\t\tlabelPosition={ labelPosition }\n\t\t\t>\n\t\t\t\t{ prefix && (\n\t\t\t\t\t<Prefix className=\"components-input-control__prefix\">\n\t\t\t\t\t\t{ prefix }\n\t\t\t\t\t</Prefix>\n\t\t\t\t) }\n\t\t\t\t{ children }\n\t\t\t\t{ suffix && (\n\t\t\t\t\t<Suffix className=\"components-input-control__suffix\">\n\t\t\t\t\t\t{ suffix }\n\t\t\t\t\t</Suffix>\n\t\t\t\t) }\n\t\t\t\t<Backdrop disabled={ disabled } isFocused={ isFocused } />\n\t\t\t</Container>\n\t\t</Root>\n\t);\n}\n\nexport default forwardRef( InputBase );\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/input-control/input-base.tsx"],"names":["useUniqueId","idProp","instanceId","InputBase","id","getUIFlexProps","labelPosition","props","direction","gap","justify","ref","__unstableInputWidth","children","className","disabled","hideLabelFromVision","isFocused","label","prefix","size","suffix","hideLabel"],"mappings":";;;;;;;;;;AASA;;;;AADA;;AAMA;;AACA;;AACA;;AAhBA;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;AAYA,SAASA,WAAT,CAAsBC,MAAtB,EAAwC;AACvC,QAAMC,UAAU,GAAG,4BAAeC,SAAf,CAAnB;AACA,QAAMC,EAAE,GAAI,sBAAsBF,UAAY,EAA9C;AAEA,SAAOD,MAAM,IAAIG,EAAjB;AACA,C,CAED;;;AACA,SAASC,cAAT,CAAyBC,aAAzB,EAAyD;AACxD,QAAMC,KAA6D,GAAG,EAAtE;;AACA,UAASD,aAAT;AACC,SAAK,KAAL;AACCC,MAAAA,KAAK,CAACC,SAAN,GAAkB,QAAlB;AACAD,MAAAA,KAAK,CAACE,GAAN,GAAY,CAAZ;AACA;;AACD,SAAK,QAAL;AACCF,MAAAA,KAAK,CAACC,SAA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,SAJb;AAKC,MAAA,aAAa,EAAGhB;AALjB,OAOGa,MAAM,IACP,4BAAC,0BAAD;AAAQ,MAAA,SAAS,EAAC;AAAlB,OACGA,MADH,CARF,EAYGN,QAZH,EAaGQ,MAAM,IACP,4BAAC,0BAAD;AAAQ,MAAA,SAAS,EAAC;AAAlB,OACGA,MADH,CAdF,EAkBC,4BAAC,iBAAD;AAAU,MAAA,QAAQ,EAAGN,QAArB;AAAgC,MAAA,SAAS,EAAGE;AAA5C,MAlBD,CAnBD;AAFD;AA2CA;;eAEc,yBAAYd,SAAZ,C","sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport Backdrop from './backdrop';\nimport Label from './label';\nimport {\n\tContainer,\n\tRoot,\n\tPrefix,\n\tSuffix,\n\tLabelWrapper,\n} from './styles/input-control-styles';\nimport type { InputBaseProps, LabelPosition } from './types';\n\nfunction useUniqueId( idProp?: string ) {\n\tconst instanceId = useInstanceId( InputBase );\n\tconst id = `input-base-control-${ instanceId }`;\n\n\treturn idProp || id;\n}\n\n// Adapter to map props for the new ui/flex compopnent.\nfunction getUIFlexProps( labelPosition?: LabelPosition ) {\n\tconst props: { direction?: string; gap?: number; justify?: string } = {};\n\tswitch ( labelPosition ) {\n\t\tcase 'top':\n\t\t\tprops.direction = 'column';\n\t\t\tprops.gap = 0;\n\t\t\tbreak;\n\t\tcase 'bottom':\n\t\t\tprops.direction = 'column-reverse';\n\t\t\tprops.gap = 0;\n\t\t\tbreak;\n\t\tcase 'edge':\n\t\t\tprops.justify = 'space-between';\n\t\t\tbreak;\n\t}\n\n\treturn props;\n}\n\nexport function InputBase(\n\t{\n\t\t__unstableInputWidth,\n\t\tchildren,\n\t\tclassName,\n\t\tdisabled = false,\n\t\thideLabelFromVision = false,\n\t\tlabelPosition,\n\t\tid: idProp,\n\t\tisFocused = false,\n\t\tlabel,\n\t\tprefix,\n\t\tsize = 'default',\n\t\tsuffix,\n\t\t...props\n\t}: InputBaseProps,\n\tref: ForwardedRef< HTMLDivElement >\n) {\n\tconst id = useUniqueId( idProp );\n\tconst hideLabel = hideLabelFromVision || ! label;\n\n\treturn (\n\t\t// @ts-expect-error The `direction` prop from Flex (FlexDirection) conflicts with legacy SVGAttributes `direction` (string) that come from React intrinsic prop definitions\n\t\t<Root\n\t\t\t{ ...props }\n\t\t\t{ ...getUIFlexProps( labelPosition ) }\n\t\t\tclassName={ className }\n\t\t\tisFocused={ isFocused }\n\t\t\tlabelPosition={ labelPosition }\n\t\t\tref={ ref }\n\t\t>\n\t\t\t<LabelWrapper>\n\t\t\t\t<Label\n\t\t\t\t\tclassName=\"components-input-control__label\"\n\t\t\t\t\thideLabelFromVision={ hideLabelFromVision }\n\t\t\t\t\tlabelPosition={ labelPosition }\n\t\t\t\t\thtmlFor={ id }\n\t\t\t\t\tsize={ size }\n\t\t\t\t>\n\t\t\t\t\t{ label }\n\t\t\t\t</Label>\n\t\t\t</LabelWrapper>\n\t\t\t<Container\n\t\t\t\t__unstableInputWidth={ __unstableInputWidth }\n\t\t\t\tclassName=\"components-input-control__container\"\n\t\t\t\tdisabled={ disabled }\n\t\t\t\thideLabel={ hideLabel }\n\t\t\t\tlabelPosition={ labelPosition }\n\t\t\t>\n\t\t\t\t{ prefix && (\n\t\t\t\t\t<Prefix className=\"components-input-control__prefix\">\n\t\t\t\t\t\t{ prefix }\n\t\t\t\t\t</Prefix>\n\t\t\t\t) }\n\t\t\t\t{ children }\n\t\t\t\t{ suffix && (\n\t\t\t\t\t<Suffix className=\"components-input-control__suffix\">\n\t\t\t\t\t\t{ suffix }\n\t\t\t\t\t</Suffix>\n\t\t\t\t) }\n\t\t\t\t<Backdrop disabled={ disabled } isFocused={ isFocused } />\n\t\t\t</Container>\n\t\t</Root>\n\t);\n}\n\nexport default forwardRef( InputBase );\n"]}
@@ -13,7 +13,7 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
13
13
 
14
14
  var _lodash = require("lodash");
15
15
 
16
- var _reactUseGesture = require("react-use-gesture");
16
+ var _react = require("@use-gesture/react");
17
17
 
18
18
  var _keycodes = require("@wordpress/keycodes");
19
19
 
@@ -176,15 +176,12 @@ function InputField(_ref, ref) {
176
176
  }
177
177
  };
178
178
 
179
- const dragGestureProps = (0, _reactUseGesture.useDrag)(dragProps => {
179
+ const dragGestureProps = (0, _react.useDrag)(dragProps => {
180
180
  const {
181
181
  distance,
182
182
  dragging,
183
183
  event
184
- } = dragProps; // The event is persisted to prevent errors in components using this
185
- // to check if a modifier key was held while dragging.
186
-
187
- event.persist();
184
+ } = dragProps;
188
185
  if (!distance) return;
189
186
  event.stopPropagation();
190
187
  /**
@@ -207,7 +204,10 @@ function InputField(_ref, ref) {
207
204
  }
208
205
  }, {
209
206
  threshold: dragThreshold,
210
- enabled: isDragEnabled
207
+ enabled: isDragEnabled,
208
+ pointer: {
209
+ capture: false
210
+ }
211
211
  });
212
212
  const dragProps = isDragEnabled ? dragGestureProps() : {};
213
213
  /*
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/input-control/input-field.tsx"],"names":["InputField","ref","disabled","dragDirection","dragThreshold","id","isDragEnabled","isFocused","isPressEnterToChange","onBlur","noop","onChange","onDrag","onDragEnd","onDragStart","onFocus","onKeyDown","onValidate","size","setIsFocused","stateReducer","state","value","valueProp","type","props","change","commit","drag","dragEnd","dragStart","invalidate","pressDown","pressEnter","pressUp","reset","update","_event","isDragging","isDirty","wasDirtyOnBlur","dragCursor","current","event","handleOnBlur","handleOnCommit","handleOnFocus","handleOnChange","nextValue","target","currentTarget","err","handleOnKeyDown","keyCode","UP","DOWN","ENTER","preventDefault","dragGestureProps","dragProps","distance","dragging","persist","stopPropagation","threshold","enabled","handleOnMouseDown","onMouseDown","ownerDocument","activeElement","focus","ForwardedComponent"],"mappings":";;;;;;;;;AAkBA;;;;AA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,QAAQ,EAAGG,cATZ;AAUC,IAAA,OAAO,EAAGD,aAVX;AAWC,IAAA,SAAS,EAAGM,eAXb;AAYC,IAAA,WAAW,EAAGc,iBAZf;AAaC,IAAA,GAAG,EAAGjE,GAbP;AAcC,IAAA,SAAS,EAAGiB,IAdb;AAeC,IAAA,KAAK,EAAGI,KAfT;AAgBC,IAAA,IAAI,EAAGE;AAhBR,KADD;AAoBA;;AAED,MAAM+C,kBAAkB,GAAG,yBAAYvE,UAAZ,CAA3B;eAEeuE,kB","sourcesContent":["/**\n * External dependencies\n */\nimport { noop } from 'lodash';\nimport { useDrag } from 'react-use-gesture';\nimport type {\n\tSyntheticEvent,\n\tChangeEvent,\n\tKeyboardEvent,\n\tPointerEvent,\n\tFocusEvent,\n\tRef,\n\tMouseEvent,\n} from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef, useRef } from '@wordpress/element';\nimport { UP, DOWN, ENTER } from '@wordpress/keycodes';\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../ui/context';\nimport { useDragCursor } from './utils';\nimport { Input } from './styles/input-control-styles';\nimport { useInputControlStateReducer } from './reducer/reducer';\nimport { isValueEmpty } from '../utils/values';\nimport { useUpdateEffect } from '../utils';\nimport type { InputFieldProps } from './types';\n\nfunction InputField(\n\t{\n\t\tdisabled = false,\n\t\tdragDirection = 'n',\n\t\tdragThreshold = 10,\n\t\tid,\n\t\tisDragEnabled = false,\n\t\tisFocused,\n\t\tisPressEnterToChange = false,\n\t\tonBlur = noop,\n\t\tonChange = noop,\n\t\tonDrag = noop,\n\t\tonDragEnd = noop,\n\t\tonDragStart = noop,\n\t\tonFocus = noop,\n\t\tonKeyDown = noop,\n\t\tonValidate = noop,\n\t\tsize = 'default',\n\t\tsetIsFocused,\n\t\tstateReducer = ( state: any ) => state,\n\t\tvalue: valueProp,\n\t\ttype,\n\t\t...props\n\t}: WordPressComponentProps< InputFieldProps, 'input', false >,\n\tref: Ref< HTMLInputElement >\n) {\n\tconst {\n\t\t// State\n\t\tstate,\n\t\t// Actions\n\t\tchange,\n\t\tcommit,\n\t\tdrag,\n\t\tdragEnd,\n\t\tdragStart,\n\t\tinvalidate,\n\t\tpressDown,\n\t\tpressEnter,\n\t\tpressUp,\n\t\treset,\n\t\tupdate,\n\t} = useInputControlStateReducer( stateReducer, {\n\t\tisDragEnabled,\n\t\tvalue: valueProp,\n\t\tisPressEnterToChange,\n\t} );\n\n\tconst { _event, value, isDragging, isDirty } = state;\n\tconst wasDirtyOnBlur = useRef( false );\n\n\tconst dragCursor = useDragCursor( isDragging, dragDirection );\n\n\t/*\n\t * Handles synchronization of external and internal value state.\n\t * If not focused and did not hold a dirty value[1] on blur\n\t * updates the value from the props. Otherwise if not holding\n\t * a dirty value[1] propagates the value and event through onChange.\n\t * [1] value is only made dirty if isPressEnterToChange is true\n\t */\n\tuseUpdateEffect( () => {\n\t\tif ( valueProp === value ) {\n\t\t\treturn;\n\t\t}\n\t\tif ( ! isFocused && ! wasDirtyOnBlur.current ) {\n\t\t\tupdate( valueProp, _event as SyntheticEvent );\n\t\t} else if ( ! isDirty ) {\n\t\t\tonChange( value, {\n\t\t\t\tevent: _event as ChangeEvent< HTMLInputElement >,\n\t\t\t} );\n\t\t\twasDirtyOnBlur.current = false;\n\t\t}\n\t}, [ value, isDirty, isFocused, valueProp ] );\n\n\tconst handleOnBlur = ( event: FocusEvent< HTMLInputElement > ) => {\n\t\tonBlur( event );\n\t\tsetIsFocused?.( false );\n\n\t\t/**\n\t\t * If isPressEnterToChange is set, this commits the value to\n\t\t * the onChange callback.\n\t\t */\n\t\tif ( isPressEnterToChange && isDirty ) {\n\t\t\twasDirtyOnBlur.current = true;\n\t\t\tif ( ! isValueEmpty( value ) ) {\n\t\t\t\thandleOnCommit( event );\n\t\t\t} else {\n\t\t\t\treset( valueProp, event );\n\t\t\t}\n\t\t}\n\t};\n\n\tconst handleOnFocus = ( event: FocusEvent< HTMLInputElement > ) => {\n\t\tonFocus( event );\n\t\tsetIsFocused?.( true );\n\t};\n\n\tconst handleOnChange = ( event: ChangeEvent< HTMLInputElement > ) => {\n\t\tconst nextValue = event.target.value;\n\t\tchange( nextValue, event );\n\t};\n\n\tconst handleOnCommit = ( event: SyntheticEvent< HTMLInputElement > ) => {\n\t\tconst nextValue = event.currentTarget.value;\n\n\t\ttry {\n\t\t\tonValidate( nextValue );\n\t\t\tcommit( nextValue, event );\n\t\t} catch ( err ) {\n\t\t\tinvalidate( err, event );\n\t\t}\n\t};\n\n\tconst handleOnKeyDown = ( event: KeyboardEvent< HTMLInputElement > ) => {\n\t\tconst { keyCode } = event;\n\t\tonKeyDown( event );\n\n\t\tswitch ( keyCode ) {\n\t\t\tcase UP:\n\t\t\t\tpressUp( event );\n\t\t\t\tbreak;\n\n\t\t\tcase DOWN:\n\t\t\t\tpressDown( event );\n\t\t\t\tbreak;\n\n\t\t\tcase ENTER:\n\t\t\t\tpressEnter( event );\n\n\t\t\t\tif ( isPressEnterToChange ) {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\thandleOnCommit( event );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t};\n\n\tconst dragGestureProps = useDrag< PointerEvent< HTMLInputElement > >(\n\t\t( dragProps ) => {\n\t\t\tconst { distance, dragging, event } = dragProps;\n\t\t\t// The event is persisted to prevent errors in components using this\n\t\t\t// to check if a modifier key was held while dragging.\n\t\t\tevent.persist();\n\n\t\t\tif ( ! distance ) return;\n\t\t\tevent.stopPropagation();\n\n\t\t\t/**\n\t\t\t * Quick return if no longer dragging.\n\t\t\t * This prevents unnecessary value calculations.\n\t\t\t */\n\t\t\tif ( ! dragging ) {\n\t\t\t\tonDragEnd( dragProps );\n\t\t\t\tdragEnd( dragProps );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tonDrag( dragProps );\n\t\t\tdrag( dragProps );\n\n\t\t\tif ( ! isDragging ) {\n\t\t\t\tonDragStart( dragProps );\n\t\t\t\tdragStart( dragProps );\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tthreshold: dragThreshold,\n\t\t\tenabled: isDragEnabled,\n\t\t}\n\t);\n\n\tconst dragProps = isDragEnabled ? dragGestureProps() : {};\n\t/*\n\t * Works around the odd UA (e.g. Firefox) that does not focus inputs of\n\t * type=number when their spinner arrows are pressed.\n\t */\n\tlet handleOnMouseDown;\n\tif ( type === 'number' ) {\n\t\thandleOnMouseDown = ( event: MouseEvent< HTMLInputElement > ) => {\n\t\t\tprops.onMouseDown?.( event );\n\t\t\tif (\n\t\t\t\tevent.currentTarget !==\n\t\t\t\tevent.currentTarget.ownerDocument.activeElement\n\t\t\t) {\n\t\t\t\tevent.currentTarget.focus();\n\t\t\t}\n\t\t};\n\t}\n\n\treturn (\n\t\t<Input\n\t\t\t{ ...props }\n\t\t\t{ ...dragProps }\n\t\t\tclassName=\"components-input-control__input\"\n\t\t\tdisabled={ disabled }\n\t\t\tdragCursor={ dragCursor }\n\t\t\tisDragging={ isDragging }\n\t\t\tid={ id }\n\t\t\tonBlur={ handleOnBlur }\n\t\t\tonChange={ handleOnChange }\n\t\t\tonFocus={ handleOnFocus }\n\t\t\tonKeyDown={ handleOnKeyDown }\n\t\t\tonMouseDown={ handleOnMouseDown }\n\t\t\tref={ ref }\n\t\t\tinputSize={ size }\n\t\t\tvalue={ value }\n\t\t\ttype={ type }\n\t\t/>\n\t);\n}\n\nconst ForwardedComponent = forwardRef( InputField );\n\nexport default ForwardedComponent;\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/input-control/input-field.tsx"],"names":["InputField","ref","disabled","dragDirection","dragThreshold","id","isDragEnabled","isFocused","isPressEnterToChange","onBlur","noop","onChange","onDrag","onDragEnd","onDragStart","onFocus","onKeyDown","onValidate","size","setIsFocused","stateReducer","state","value","valueProp","type","props","change","commit","drag","dragEnd","dragStart","invalidate","pressDown","pressEnter","pressUp","reset","update","_event","isDragging","isDirty","wasDirtyOnBlur","dragCursor","current","event","handleOnBlur","handleOnCommit","handleOnFocus","handleOnChange","nextValue","target","currentTarget","err","handleOnKeyDown","keyCode","UP","DOWN","ENTER","preventDefault","dragGestureProps","dragProps","distance","dragging","stopPropagation","threshold","enabled","pointer","capture","handleOnMouseDown","onMouseDown","ownerDocument","activeElement","focus","ForwardedComponent"],"mappings":";;;;;;;;;AAkBA;;;;AAfA;;AACA;;AAeA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AA5BA;AACA;AACA;;AAaA;AACA;AACA;AAcA,SAASA,UAAT,OAwBCC,GAxBD,EAyBE;AAAA,MAxBD;AACCC,IAAAA,QAAQ,GAAG,KADZ;AAECC,IAAAA,aAAa,GAAG,GAFjB;AAGCC,IAAAA,aAAa,GAAG,EAHjB;AAICC,IAAAA,EAJD;AAKCC,IAAAA,aAAa,GAAG,KALjB;AAMCC,IAAAA,SAND;AAOCC,IAAAA,oBAAoB,GAAG,KAPxB;AAQCC,IAAAA,MAAM,GAAGC,YARV;AASCC,IAAAA,QAAQ,GAAGD,YATZ;AAUCE,IAAAA,MAAM,GAAGF,YAVV;AAWCG,IAAAA,SAAS,GAAGH,YAXb;AAYCI,IAAAA,WAAW,GAAGJ,YAZf;AAaCK,IAAAA,OAAO,GAAGL,YAbX;AAcCM,IAAAA,SAAS,GAAGN,YAdb;AAeCO,IAAAA,UAAU,GAAGP,YAfd;AAgBCQ,IAAAA,IAAI,GAAG,SAhBR;AAiBCC,IAAAA,YAjBD;AAkBCC,IAAAA,YAAY,GAAKC,KAAF,IAAkBA,KAlBlC;AAmBCC,IAAAA,KAAK,EAAEC,SAnBR;AAoBCC,IAAAA,IApBD;AAqBC,OAAGC;AArBJ,GAwBC;AACD,QAAM;AACL;AACAJ,IAAAA,KAFK;AAGL;AACAK,IAAAA,MAJK;AAKLC,IAAAA,MALK;AAMLC,IAAAA,IANK;AAOLC,IAAAA,OAPK;AAQLC,IAAAA,SARK;AASLC,IAAAA,UATK;AAULC,IAAAA,SAVK;AAWLC,IAAAA,UAXK;AAYLC,IAAAA,OAZK;AAaLC,IA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FN;AAGC,IAAA,SAAS,EAAC,iCAHX;AAIC,IAAA,QAAQ,EAAGzD,QAJZ;AAKC,IAAA,UAAU,EAAGuC,UALd;AAMC,IAAA,UAAU,EAAGH,UANd;AAOC,IAAA,EAAE,EAAGjC,EAPN;AAQC,IAAA,MAAM,EAAGuC,YARV;AASC,IAAA,QAAQ,EAAGG,cATZ;AAUC,IAAA,OAAO,EAAGD,aAVX;AAWC,IAAA,SAAS,EAAGM,eAXb;AAYC,IAAA,WAAW,EAAGe,iBAZf;AAaC,IAAA,GAAG,EAAGlE,GAbP;AAcC,IAAA,SAAS,EAAGiB,IAdb;AAeC,IAAA,KAAK,EAAGI,KAfT;AAgBC,IAAA,IAAI,EAAGE;AAhBR,KADD;AAoBA;;AAED,MAAMgD,kBAAkB,GAAG,yBAAYxE,UAAZ,CAA3B;eAEewE,kB","sourcesContent":["/**\n * External dependencies\n */\nimport { noop } from 'lodash';\nimport { useDrag } from '@use-gesture/react';\nimport type {\n\tSyntheticEvent,\n\tChangeEvent,\n\tKeyboardEvent,\n\tPointerEvent,\n\tFocusEvent,\n\tForwardedRef,\n\tMouseEvent,\n} from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef, useRef } from '@wordpress/element';\nimport { UP, DOWN, ENTER } from '@wordpress/keycodes';\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../ui/context';\nimport { useDragCursor } from './utils';\nimport { Input } from './styles/input-control-styles';\nimport { useInputControlStateReducer } from './reducer/reducer';\nimport { isValueEmpty } from '../utils/values';\nimport { useUpdateEffect } from '../utils';\nimport type { InputFieldProps } from './types';\n\nfunction InputField(\n\t{\n\t\tdisabled = false,\n\t\tdragDirection = 'n',\n\t\tdragThreshold = 10,\n\t\tid,\n\t\tisDragEnabled = false,\n\t\tisFocused,\n\t\tisPressEnterToChange = false,\n\t\tonBlur = noop,\n\t\tonChange = noop,\n\t\tonDrag = noop,\n\t\tonDragEnd = noop,\n\t\tonDragStart = noop,\n\t\tonFocus = noop,\n\t\tonKeyDown = noop,\n\t\tonValidate = noop,\n\t\tsize = 'default',\n\t\tsetIsFocused,\n\t\tstateReducer = ( state: any ) => state,\n\t\tvalue: valueProp,\n\t\ttype,\n\t\t...props\n\t}: WordPressComponentProps< InputFieldProps, 'input', false >,\n\tref: ForwardedRef< HTMLInputElement >\n) {\n\tconst {\n\t\t// State\n\t\tstate,\n\t\t// Actions\n\t\tchange,\n\t\tcommit,\n\t\tdrag,\n\t\tdragEnd,\n\t\tdragStart,\n\t\tinvalidate,\n\t\tpressDown,\n\t\tpressEnter,\n\t\tpressUp,\n\t\treset,\n\t\tupdate,\n\t} = useInputControlStateReducer( stateReducer, {\n\t\tisDragEnabled,\n\t\tvalue: valueProp,\n\t\tisPressEnterToChange,\n\t} );\n\n\tconst { _event, value, isDragging, isDirty } = state;\n\tconst wasDirtyOnBlur = useRef( false );\n\n\tconst dragCursor = useDragCursor( isDragging, dragDirection );\n\n\t/*\n\t * Handles synchronization of external and internal value state.\n\t * If not focused and did not hold a dirty value[1] on blur\n\t * updates the value from the props. Otherwise if not holding\n\t * a dirty value[1] propagates the value and event through onChange.\n\t * [1] value is only made dirty if isPressEnterToChange is true\n\t */\n\tuseUpdateEffect( () => {\n\t\tif ( valueProp === value ) {\n\t\t\treturn;\n\t\t}\n\t\tif ( ! isFocused && ! wasDirtyOnBlur.current ) {\n\t\t\tupdate( valueProp, _event as SyntheticEvent );\n\t\t} else if ( ! isDirty ) {\n\t\t\tonChange( value, {\n\t\t\t\tevent: _event as ChangeEvent< HTMLInputElement >,\n\t\t\t} );\n\t\t\twasDirtyOnBlur.current = false;\n\t\t}\n\t}, [ value, isDirty, isFocused, valueProp ] );\n\n\tconst handleOnBlur = ( event: FocusEvent< HTMLInputElement > ) => {\n\t\tonBlur( event );\n\t\tsetIsFocused?.( false );\n\n\t\t/**\n\t\t * If isPressEnterToChange is set, this commits the value to\n\t\t * the onChange callback.\n\t\t */\n\t\tif ( isPressEnterToChange && isDirty ) {\n\t\t\twasDirtyOnBlur.current = true;\n\t\t\tif ( ! isValueEmpty( value ) ) {\n\t\t\t\thandleOnCommit( event );\n\t\t\t} else {\n\t\t\t\treset( valueProp, event );\n\t\t\t}\n\t\t}\n\t};\n\n\tconst handleOnFocus = ( event: FocusEvent< HTMLInputElement > ) => {\n\t\tonFocus( event );\n\t\tsetIsFocused?.( true );\n\t};\n\n\tconst handleOnChange = ( event: ChangeEvent< HTMLInputElement > ) => {\n\t\tconst nextValue = event.target.value;\n\t\tchange( nextValue, event );\n\t};\n\n\tconst handleOnCommit = ( event: SyntheticEvent< HTMLInputElement > ) => {\n\t\tconst nextValue = event.currentTarget.value;\n\n\t\ttry {\n\t\t\tonValidate( nextValue );\n\t\t\tcommit( nextValue, event );\n\t\t} catch ( err ) {\n\t\t\tinvalidate( err, event );\n\t\t}\n\t};\n\n\tconst handleOnKeyDown = ( event: KeyboardEvent< HTMLInputElement > ) => {\n\t\tconst { keyCode } = event;\n\t\tonKeyDown( event );\n\n\t\tswitch ( keyCode ) {\n\t\t\tcase UP:\n\t\t\t\tpressUp( event );\n\t\t\t\tbreak;\n\n\t\t\tcase DOWN:\n\t\t\t\tpressDown( event );\n\t\t\t\tbreak;\n\n\t\t\tcase ENTER:\n\t\t\t\tpressEnter( event );\n\n\t\t\t\tif ( isPressEnterToChange ) {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\thandleOnCommit( event );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t};\n\n\tconst dragGestureProps = useDrag< PointerEvent< HTMLInputElement > >(\n\t\t( dragProps ) => {\n\t\t\tconst { distance, dragging, event } = dragProps;\n\n\t\t\tif ( ! distance ) return;\n\t\t\tevent.stopPropagation();\n\n\t\t\t/**\n\t\t\t * Quick return if no longer dragging.\n\t\t\t * This prevents unnecessary value calculations.\n\t\t\t */\n\t\t\tif ( ! dragging ) {\n\t\t\t\tonDragEnd( dragProps );\n\t\t\t\tdragEnd( dragProps );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tonDrag( dragProps );\n\t\t\tdrag( dragProps );\n\n\t\t\tif ( ! isDragging ) {\n\t\t\t\tonDragStart( dragProps );\n\t\t\t\tdragStart( dragProps );\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tthreshold: dragThreshold,\n\t\t\tenabled: isDragEnabled,\n\t\t\tpointer: { capture: false },\n\t\t}\n\t);\n\n\tconst dragProps = isDragEnabled ? dragGestureProps() : {};\n\t/*\n\t * Works around the odd UA (e.g. Firefox) that does not focus inputs of\n\t * type=number when their spinner arrows are pressed.\n\t */\n\tlet handleOnMouseDown;\n\tif ( type === 'number' ) {\n\t\thandleOnMouseDown = ( event: MouseEvent< HTMLInputElement > ) => {\n\t\t\tprops.onMouseDown?.( event );\n\t\t\tif (\n\t\t\t\tevent.currentTarget !==\n\t\t\t\tevent.currentTarget.ownerDocument.activeElement\n\t\t\t) {\n\t\t\t\tevent.currentTarget.focus();\n\t\t\t}\n\t\t};\n\t}\n\n\treturn (\n\t\t<Input\n\t\t\t{ ...props }\n\t\t\t{ ...dragProps }\n\t\t\tclassName=\"components-input-control__input\"\n\t\t\tdisabled={ disabled }\n\t\t\tdragCursor={ dragCursor }\n\t\t\tisDragging={ isDragging }\n\t\t\tid={ id }\n\t\t\tonBlur={ handleOnBlur }\n\t\t\tonChange={ handleOnChange }\n\t\t\tonFocus={ handleOnFocus }\n\t\t\tonKeyDown={ handleOnKeyDown }\n\t\t\tonMouseDown={ handleOnMouseDown }\n\t\t\tref={ ref }\n\t\t\tinputSize={ size }\n\t\t\tvalue={ value }\n\t\t\ttype={ type }\n\t\t/>\n\t);\n}\n\nconst ForwardedComponent = forwardRef( InputField );\n\nexport default ForwardedComponent;\n"]}
@@ -66,6 +66,9 @@ const composeStateReducers = function () {
66
66
  }
67
67
 
68
68
  return fns.reduceRight((state, fn) => {
69
+ // TODO: Assess whether this can be replaced with a more standard `compose` implementation
70
+ // like wp.data.compose() (aka lodash flowRight) or Redux compose().
71
+ // The current implementation only works by functions mutating the original state object.
69
72
  const fnState = fn(...args);
70
73
  return (0, _lodash.isEmpty)(fnState) ? state : { ...state,
71
74
  ...fnState
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/input-control/reducer/reducer.ts"],"names":["mergeInitialState","initialState","initialInputControlState","value","initialValue","composeStateReducers","fns","args","reduceRight","state","fn","fnState","inputControlStateReducer","composedStateReducers","action","nextState","type","actions","PRESS_UP","isDirty","PRESS_DOWN","DRAG_START","isDragging","DRAG_END","CHANGE","error","payload","isPressEnterToChange","COMMIT","RESET","UPDATE","INVALIDATE","event","_event","useInputControlStateReducer","stateReducer","initialStateReducer","dispatch","createChangeEvent","nextValue","persist","createKeyEvent","createDragEvent","change","invalidate","reset","commit","update","dragStart","drag","DRAG","dragEnd","pressUp","pressDown","pressEnter","PRESS_ENTER"],"mappings":";;;;;;;;AAGA;;AAMA;;AAKA;;AAMA;;;;;;AApBA;AACA;AACA;;AAIA;AACA;AACA;;AAGA;AACA;AACA;;AASA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,iBAAT,GAEc;AAAA,MADbC,YACa,uEADyBC,+BACzB;AACb,QAAM;AAAEC,IAAAA;AAAF,MAAYF,YAAlB;AAEA,SAAO,EACN,GAAGC,+BADG;AAEN,OAAGD,YAFG;AAGNG,IAAAA,YAAY,EAAED;AAHR,GAAP;AAKA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,MAAME,oBAAoB,GAAG,YAEjB;AAAA,oCADfC,GACe;AADfA,IAAAA,GACe;AAAA;;AAClB,SAAO,YAAe;AAAA,uCAAVC,IAAU;AAAVA,MAAAA,IAAU;AAAA;;AACrB,WAAOD,GAAG,CAACE,WAAJ,CAAiB,CAAEC,KAAF,EAASC,EAAT,KAAiB;AACxC,YAAMC,OAAO,GAAGD,EAAE,CAAE,GAAGH,IAAL,CAAlB;AACA,aAAO,qBAASI,OAAT,IAAqBF,KAArB,GAA6B,EAAE,GAAGA,KAAL;AAAY,WAAGE;A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GZ,cAAc,CAAExB,OAAO,CAACG,UAAV,CAAhC;AACA,QAAMkC,UAAU,GAAGb,cAAc,CAAExB,OAAO,CAACsC,WAAV,CAAjC;AAEA,SAAO;AACNZ,IAAAA,MADM;AAENG,IAAAA,MAFM;AAGNT,IAAAA,QAHM;AAINY,IAAAA,IAJM;AAKNE,IAAAA,OALM;AAMNH,IAAAA,SANM;AAONJ,IAAAA,UAPM;AAQNS,IAAAA,SARM;AASNC,IAAAA,UATM;AAUNF,IAAAA,OAVM;AAWNP,IAAAA,KAXM;AAYNpC,IAAAA,KAZM;AAaNsC,IAAAA;AAbM,GAAP;AAeA","sourcesContent":["/**\n * External dependencies\n */\nimport { isEmpty } from 'lodash';\nimport type { SyntheticEvent } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { useReducer } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport {\n\tInputState,\n\tStateReducer,\n\tinitialInputControlState,\n\tinitialStateReducer,\n} from './state';\nimport * as actions from './actions';\n\n/**\n * Prepares initialState for the reducer.\n *\n * @param initialState The initial state.\n * @return Prepared initialState for the reducer\n */\nfunction mergeInitialState(\n\tinitialState: Partial< InputState > = initialInputControlState\n): InputState {\n\tconst { value } = initialState;\n\n\treturn {\n\t\t...initialInputControlState,\n\t\t...initialState,\n\t\tinitialValue: value,\n\t} as InputState;\n}\n\n/**\n * Composes multiple stateReducers into a single stateReducer, building\n * the pipeline to control the flow for state and actions.\n *\n * @param fns State reducers.\n * @return The single composed stateReducer.\n */\nexport const composeStateReducers = (\n\t...fns: StateReducer[]\n): StateReducer => {\n\treturn ( ...args ) => {\n\t\treturn fns.reduceRight( ( state, fn ) => {\n\t\t\tconst fnState = fn( ...args );\n\t\t\treturn isEmpty( fnState ) ? state : { ...state, ...fnState };\n\t\t}, {} as InputState );\n\t};\n};\n\n/**\n * Creates a reducer that opens the channel for external state subscription\n * and modification.\n *\n * This technique uses the \"stateReducer\" design pattern:\n * https://kentcdodds.com/blog/the-state-reducer-pattern/\n *\n * @param composedStateReducers A custom reducer that can subscribe and modify state.\n * @return The reducer.\n */\nfunction inputControlStateReducer(\n\tcomposedStateReducers: StateReducer\n): StateReducer {\n\treturn ( state, action ) => {\n\t\tconst nextState = { ...state };\n\n\t\tswitch ( action.type ) {\n\t\t\t/**\n\t\t\t * Keyboard events\n\t\t\t */\n\t\t\tcase actions.PRESS_UP:\n\t\t\t\tnextState.isDirty = false;\n\t\t\t\tbreak;\n\n\t\t\tcase actions.PRESS_DOWN:\n\t\t\t\tnextState.isDirty = false;\n\t\t\t\tbreak;\n\n\t\t\t/**\n\t\t\t * Drag events\n\t\t\t */\n\t\t\tcase actions.DRAG_START:\n\t\t\t\tnextState.isDragging = true;\n\t\t\t\tbreak;\n\n\t\t\tcase actions.DRAG_END:\n\t\t\t\tnextState.isDragging = false;\n\t\t\t\tbreak;\n\n\t\t\t/**\n\t\t\t * Input events\n\t\t\t */\n\t\t\tcase actions.CHANGE:\n\t\t\t\tnextState.error = null;\n\t\t\t\tnextState.value = action.payload.value;\n\n\t\t\t\tif ( state.isPressEnterToChange ) {\n\t\t\t\t\tnextState.isDirty = true;\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase actions.COMMIT:\n\t\t\t\tnextState.value = action.payload.value;\n\t\t\t\tnextState.isDirty = false;\n\t\t\t\tbreak;\n\n\t\t\tcase actions.RESET:\n\t\t\t\tnextState.error = null;\n\t\t\t\tnextState.isDirty = false;\n\t\t\t\tnextState.value = action.payload.value || state.initialValue;\n\t\t\t\tbreak;\n\n\t\t\tcase actions.UPDATE:\n\t\t\t\tnextState.value = action.payload.value;\n\t\t\t\tnextState.isDirty = false;\n\t\t\t\tbreak;\n\n\t\t\t/**\n\t\t\t * Validation\n\t\t\t */\n\t\t\tcase actions.INVALIDATE:\n\t\t\t\tnextState.error = action.payload.error;\n\t\t\t\tbreak;\n\t\t}\n\n\t\tif ( action.payload.event ) {\n\t\t\tnextState._event = action.payload.event;\n\t\t}\n\n\t\t/**\n\t\t * Send the nextState + action to the composedReducers via\n\t\t * this \"bridge\" mechanism. This allows external stateReducers\n\t\t * to hook into actions, and modify state if needed.\n\t\t */\n\t\treturn composedStateReducers( nextState, action );\n\t};\n}\n\n/**\n * A custom hook that connects and external stateReducer with an internal\n * reducer. This hook manages the internal state of InputControl.\n * However, by connecting an external stateReducer function, other\n * components can react to actions as well as modify state before it is\n * applied.\n *\n * This technique uses the \"stateReducer\" design pattern:\n * https://kentcdodds.com/blog/the-state-reducer-pattern/\n *\n * @param stateReducer An external state reducer.\n * @param initialState The initial state for the reducer.\n * @return State, dispatch, and a collection of actions.\n */\nexport function useInputControlStateReducer(\n\tstateReducer: StateReducer = initialStateReducer,\n\tinitialState: Partial< InputState > = initialInputControlState\n) {\n\tconst [ state, dispatch ] = useReducer< StateReducer >(\n\t\tinputControlStateReducer( stateReducer ),\n\t\tmergeInitialState( initialState )\n\t);\n\n\tconst createChangeEvent = ( type: actions.ChangeEventAction[ 'type' ] ) => (\n\t\tnextValue: actions.ChangeEventAction[ 'payload' ][ 'value' ],\n\t\tevent: actions.ChangeEventAction[ 'payload' ][ 'event' ]\n\t) => {\n\t\t/**\n\t\t * Persist allows for the (Synthetic) event to be used outside of\n\t\t * this function call.\n\t\t * https://reactjs.org/docs/events.html#event-pooling\n\t\t */\n\t\tif ( event && event.persist ) {\n\t\t\tevent.persist();\n\t\t}\n\n\t\tdispatch( {\n\t\t\ttype,\n\t\t\tpayload: { value: nextValue, event },\n\t\t} as actions.InputAction );\n\t};\n\n\tconst createKeyEvent = ( type: actions.KeyEventAction[ 'type' ] ) => (\n\t\tevent: actions.KeyEventAction[ 'payload' ][ 'event' ]\n\t) => {\n\t\t/**\n\t\t * Persist allows for the (Synthetic) event to be used outside of\n\t\t * this function call.\n\t\t * https://reactjs.org/docs/events.html#event-pooling\n\t\t */\n\t\tif ( event && event.persist ) {\n\t\t\tevent.persist();\n\t\t}\n\n\t\tdispatch( { type, payload: { event } } );\n\t};\n\n\tconst createDragEvent = ( type: actions.DragEventAction[ 'type' ] ) => (\n\t\tpayload: actions.DragEventAction[ 'payload' ]\n\t) => {\n\t\tdispatch( { type, payload } );\n\t};\n\n\t/**\n\t * Actions for the reducer\n\t */\n\tconst change = createChangeEvent( actions.CHANGE );\n\tconst invalidate = ( error: unknown, event: SyntheticEvent ) =>\n\t\tdispatch( { type: actions.INVALIDATE, payload: { error, event } } );\n\tconst reset = createChangeEvent( actions.RESET );\n\tconst commit = createChangeEvent( actions.COMMIT );\n\tconst update = createChangeEvent( actions.UPDATE );\n\n\tconst dragStart = createDragEvent( actions.DRAG_START );\n\tconst drag = createDragEvent( actions.DRAG );\n\tconst dragEnd = createDragEvent( actions.DRAG_END );\n\n\tconst pressUp = createKeyEvent( actions.PRESS_UP );\n\tconst pressDown = createKeyEvent( actions.PRESS_DOWN );\n\tconst pressEnter = createKeyEvent( actions.PRESS_ENTER );\n\n\treturn {\n\t\tchange,\n\t\tcommit,\n\t\tdispatch,\n\t\tdrag,\n\t\tdragEnd,\n\t\tdragStart,\n\t\tinvalidate,\n\t\tpressDown,\n\t\tpressEnter,\n\t\tpressUp,\n\t\treset,\n\t\tstate,\n\t\tupdate,\n\t} as const;\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/input-control/reducer/reducer.ts"],"names":["mergeInitialState","initialState","initialInputControlState","value","initialValue","composeStateReducers","fns","args","reduceRight","state","fn","fnState","inputControlStateReducer","composedStateReducers","action","nextState","type","actions","PRESS_UP","isDirty","PRESS_DOWN","DRAG_START","isDragging","DRAG_END","CHANGE","error","payload","isPressEnterToChange","COMMIT","RESET","UPDATE","INVALIDATE","event","_event","useInputControlStateReducer","stateReducer","initialStateReducer","dispatch","createChangeEvent","nextValue","persist","createKeyEvent","createDragEvent","change","invalidate","reset","commit","update","dragStart","drag","DRAG","dragEnd","pressUp","pressDown","pressEnter","PRESS_ENTER"],"mappings":";;;;;;;;AAGA;;AAMA;;AAKA;;AAMA;;;;;;AApBA;AACA;AACA;;AAIA;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BO,KAAlB,KAClBK,QAAQ,CAAE;AAAErB,IAAAA,IAAI,EAAEC,OAAO,CAACc,UAAhB;AAA4BL,IAAAA,OAAO,EAAE;AAAED,MAAAA,KAAF;AAASO,MAAAA;AAAT;AAArC,GAAF,CADT;;AAEA,QAAMa,KAAK,GAAGP,iBAAiB,CAAErB,OAAO,CAACY,KAAV,CAA/B;AACA,QAAMiB,MAAM,GAAGR,iBAAiB,CAAErB,OAAO,CAACW,MAAV,CAAhC;AACA,QAAMmB,MAAM,GAAGT,iBAAiB,CAAErB,OAAO,CAACa,MAAV,CAAhC;AAEA,QAAMkB,SAAS,GAAGN,eAAe,CAAEzB,OAAO,CAACI,UAAV,CAAjC;AACA,QAAM4B,IAAI,GAAGP,eAAe,CAAEzB,OAAO,CAACiC,IAAV,CAA5B;AACA,QAAMC,OAAO,GAAGT,eAAe,CAAEzB,OAAO,CAACM,QAAV,CAA/B;AAEA,QAAM6B,OAAO,GAAGX,cAAc,CAAExB,OAAO,CAACC,QAAV,CAA9B;AACA,QAAMmC,SAAS,GAAGZ,cAAc,CAAExB,OAAO,CAACG,UAAV,CAAhC;AACA,QAAMkC,UAAU,GAAGb,cAAc,CAAExB,OAAO,CAACsC,WAAV,CAAjC;AAEA,SAAO;AACNZ,IAAAA,MADM;AAENG,IAAAA,MAFM;AAGNT,IAAAA,QAHM;AAINY,IAAAA,IAJM;AAKNE,IAAAA,OALM;AAMNH,IAAAA,SANM;AAONJ,IAAAA,UAPM;AAQNS,IAAAA,SARM;AASNC,IAAAA,UATM;AAUNF,IAAAA,OAVM;AAWNP,IAAAA,KAXM;AAYNpC,IAAAA,KAZM;AAaNsC,IAAAA;AAbM,GAAP;AAeA","sourcesContent":["/**\n * External dependencies\n */\nimport { isEmpty } from 'lodash';\nimport type { SyntheticEvent } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { useReducer } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport {\n\tInputState,\n\tStateReducer,\n\tinitialInputControlState,\n\tinitialStateReducer,\n} from './state';\nimport * as actions from './actions';\n\n/**\n * Prepares initialState for the reducer.\n *\n * @param initialState The initial state.\n * @return Prepared initialState for the reducer\n */\nfunction mergeInitialState(\n\tinitialState: Partial< InputState > = initialInputControlState\n): InputState {\n\tconst { value } = initialState;\n\n\treturn {\n\t\t...initialInputControlState,\n\t\t...initialState,\n\t\tinitialValue: value,\n\t} as InputState;\n}\n\n/**\n * Composes multiple stateReducers into a single stateReducer, building\n * the pipeline to control the flow for state and actions.\n *\n * @param fns State reducers.\n * @return The single composed stateReducer.\n */\nexport const composeStateReducers = (\n\t...fns: StateReducer[]\n): StateReducer => {\n\treturn ( ...args ) => {\n\t\treturn fns.reduceRight( ( state, fn ) => {\n\t\t\t// TODO: Assess whether this can be replaced with a more standard `compose` implementation\n\t\t\t// like wp.data.compose() (aka lodash flowRight) or Redux compose().\n\t\t\t// The current implementation only works by functions mutating the original state object.\n\t\t\tconst fnState = fn( ...args );\n\t\t\treturn isEmpty( fnState ) ? state : { ...state, ...fnState };\n\t\t}, {} as InputState );\n\t};\n};\n\n/**\n * Creates a reducer that opens the channel for external state subscription\n * and modification.\n *\n * This technique uses the \"stateReducer\" design pattern:\n * https://kentcdodds.com/blog/the-state-reducer-pattern/\n *\n * @param composedStateReducers A custom reducer that can subscribe and modify state.\n * @return The reducer.\n */\nfunction inputControlStateReducer(\n\tcomposedStateReducers: StateReducer\n): StateReducer {\n\treturn ( state, action ) => {\n\t\tconst nextState = { ...state };\n\n\t\tswitch ( action.type ) {\n\t\t\t/**\n\t\t\t * Keyboard events\n\t\t\t */\n\t\t\tcase actions.PRESS_UP:\n\t\t\t\tnextState.isDirty = false;\n\t\t\t\tbreak;\n\n\t\t\tcase actions.PRESS_DOWN:\n\t\t\t\tnextState.isDirty = false;\n\t\t\t\tbreak;\n\n\t\t\t/**\n\t\t\t * Drag events\n\t\t\t */\n\t\t\tcase actions.DRAG_START:\n\t\t\t\tnextState.isDragging = true;\n\t\t\t\tbreak;\n\n\t\t\tcase actions.DRAG_END:\n\t\t\t\tnextState.isDragging = false;\n\t\t\t\tbreak;\n\n\t\t\t/**\n\t\t\t * Input events\n\t\t\t */\n\t\t\tcase actions.CHANGE:\n\t\t\t\tnextState.error = null;\n\t\t\t\tnextState.value = action.payload.value;\n\n\t\t\t\tif ( state.isPressEnterToChange ) {\n\t\t\t\t\tnextState.isDirty = true;\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase actions.COMMIT:\n\t\t\t\tnextState.value = action.payload.value;\n\t\t\t\tnextState.isDirty = false;\n\t\t\t\tbreak;\n\n\t\t\tcase actions.RESET:\n\t\t\t\tnextState.error = null;\n\t\t\t\tnextState.isDirty = false;\n\t\t\t\tnextState.value = action.payload.value || state.initialValue;\n\t\t\t\tbreak;\n\n\t\t\tcase actions.UPDATE:\n\t\t\t\tnextState.value = action.payload.value;\n\t\t\t\tnextState.isDirty = false;\n\t\t\t\tbreak;\n\n\t\t\t/**\n\t\t\t * Validation\n\t\t\t */\n\t\t\tcase actions.INVALIDATE:\n\t\t\t\tnextState.error = action.payload.error;\n\t\t\t\tbreak;\n\t\t}\n\n\t\tif ( action.payload.event ) {\n\t\t\tnextState._event = action.payload.event;\n\t\t}\n\n\t\t/**\n\t\t * Send the nextState + action to the composedReducers via\n\t\t * this \"bridge\" mechanism. This allows external stateReducers\n\t\t * to hook into actions, and modify state if needed.\n\t\t */\n\t\treturn composedStateReducers( nextState, action );\n\t};\n}\n\n/**\n * A custom hook that connects and external stateReducer with an internal\n * reducer. This hook manages the internal state of InputControl.\n * However, by connecting an external stateReducer function, other\n * components can react to actions as well as modify state before it is\n * applied.\n *\n * This technique uses the \"stateReducer\" design pattern:\n * https://kentcdodds.com/blog/the-state-reducer-pattern/\n *\n * @param stateReducer An external state reducer.\n * @param initialState The initial state for the reducer.\n * @return State, dispatch, and a collection of actions.\n */\nexport function useInputControlStateReducer(\n\tstateReducer: StateReducer = initialStateReducer,\n\tinitialState: Partial< InputState > = initialInputControlState\n) {\n\tconst [ state, dispatch ] = useReducer< StateReducer >(\n\t\tinputControlStateReducer( stateReducer ),\n\t\tmergeInitialState( initialState )\n\t);\n\n\tconst createChangeEvent = ( type: actions.ChangeEventAction[ 'type' ] ) => (\n\t\tnextValue: actions.ChangeEventAction[ 'payload' ][ 'value' ],\n\t\tevent: actions.ChangeEventAction[ 'payload' ][ 'event' ]\n\t) => {\n\t\t/**\n\t\t * Persist allows for the (Synthetic) event to be used outside of\n\t\t * this function call.\n\t\t * https://reactjs.org/docs/events.html#event-pooling\n\t\t */\n\t\tif ( event && event.persist ) {\n\t\t\tevent.persist();\n\t\t}\n\n\t\tdispatch( {\n\t\t\ttype,\n\t\t\tpayload: { value: nextValue, event },\n\t\t} as actions.InputAction );\n\t};\n\n\tconst createKeyEvent = ( type: actions.KeyEventAction[ 'type' ] ) => (\n\t\tevent: actions.KeyEventAction[ 'payload' ][ 'event' ]\n\t) => {\n\t\t/**\n\t\t * Persist allows for the (Synthetic) event to be used outside of\n\t\t * this function call.\n\t\t * https://reactjs.org/docs/events.html#event-pooling\n\t\t */\n\t\tif ( event && event.persist ) {\n\t\t\tevent.persist();\n\t\t}\n\n\t\tdispatch( { type, payload: { event } } );\n\t};\n\n\tconst createDragEvent = ( type: actions.DragEventAction[ 'type' ] ) => (\n\t\tpayload: actions.DragEventAction[ 'payload' ]\n\t) => {\n\t\tdispatch( { type, payload } );\n\t};\n\n\t/**\n\t * Actions for the reducer\n\t */\n\tconst change = createChangeEvent( actions.CHANGE );\n\tconst invalidate = ( error: unknown, event: SyntheticEvent ) =>\n\t\tdispatch( { type: actions.INVALIDATE, payload: { error, event } } );\n\tconst reset = createChangeEvent( actions.RESET );\n\tconst commit = createChangeEvent( actions.COMMIT );\n\tconst update = createChangeEvent( actions.UPDATE );\n\n\tconst dragStart = createDragEvent( actions.DRAG_START );\n\tconst drag = createDragEvent( actions.DRAG );\n\tconst dragEnd = createDragEvent( actions.DRAG_END );\n\n\tconst pressUp = createKeyEvent( actions.PRESS_UP );\n\tconst pressDown = createKeyEvent( actions.PRESS_DOWN );\n\tconst pressEnter = createKeyEvent( actions.PRESS_ENTER );\n\n\treturn {\n\t\tchange,\n\t\tcommit,\n\t\tdispatch,\n\t\tdrag,\n\t\tdragEnd,\n\t\tdragStart,\n\t\tinvalidate,\n\t\tpressDown,\n\t\tpressEnter,\n\t\tpressUp,\n\t\treset,\n\t\tstate,\n\t\tupdate,\n\t} as const;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/item-group/item/component.tsx"],"names":["Item","props","forwardedRef","role","wrapperClassName","otherProps"],"mappings":";;;;;;;;;;;;;AASA;;AACA;;AACA;;AAXA;AACA;AACA;;AAGA;AACA;AACA;AAMA,SAASA,IAAT,CACCC,KADD,EAECC,YAFD,EAGE;AACD,QAAM;AAAEC,IAAAA,IAAF;AAAQC,IAAAA,gBAAR;AAA0B,OAAGC;AAA7B,MAA4C,mBAASJ,KAAT,CAAlD;AAEA,SACC;AAAK,IAAA,IAAI,EAAGE,IAAZ;AAAmB,IAAA,SAAS,EAAGC;AAA/B,KACC,4BAAC,UAAD,6BAAWC,UAAX;AAAwB,IAAA,GAAG,EAAGH;AAA9B,KADD,CADD;AAKA;;eAEc,6BAAgBF,IAAhB,EAAsB,MAAtB,C","sourcesContent":["/**\n * External dependencies\n */\nimport type { Ref } from 'react';\n\n/**\n * Internal dependencies\n */\nimport type { ItemProps } from '../types';\nimport { useItem } from './hook';\nimport { contextConnect, WordPressComponentProps } from '../../ui/context';\nimport { View } from '../../view';\n\nfunction Item(\n\tprops: WordPressComponentProps< ItemProps, 'div' >,\n\tforwardedRef: Ref< any >\n) {\n\tconst { role, wrapperClassName, ...otherProps } = useItem( props );\n\n\treturn (\n\t\t<div role={ role } className={ wrapperClassName }>\n\t\t\t<View { ...otherProps } ref={ forwardedRef } />\n\t\t</div>\n\t);\n}\n\nexport default contextConnect( Item, 'Item' );\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/item-group/item/component.tsx"],"names":["Item","props","forwardedRef","role","wrapperClassName","otherProps"],"mappings":";;;;;;;;;;;;;AASA;;AACA;;AACA;;AAXA;AACA;AACA;;AAGA;AACA;AACA;AAMA,SAASA,IAAT,CACCC,KADD,EAECC,YAFD,EAGE;AACD,QAAM;AAAEC,IAAAA,IAAF;AAAQC,IAAAA,gBAAR;AAA0B,OAAGC;AAA7B,MAA4C,mBAASJ,KAAT,CAAlD;AAEA,SACC;AAAK,IAAA,IAAI,EAAGE,IAAZ;AAAmB,IAAA,SAAS,EAAGC;AAA/B,KACC,4BAAC,UAAD,6BAAWC,UAAX;AAAwB,IAAA,GAAG,EAAGH;AAA9B,KADD,CADD;AAKA;;eAEc,6BAAgBF,IAAhB,EAAsB,MAAtB,C","sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\n\n/**\n * Internal dependencies\n */\nimport type { ItemProps } from '../types';\nimport { useItem } from './hook';\nimport { contextConnect, WordPressComponentProps } from '../../ui/context';\nimport { View } from '../../view';\n\nfunction Item(\n\tprops: WordPressComponentProps< ItemProps, 'div' >,\n\tforwardedRef: ForwardedRef< any >\n) {\n\tconst { role, wrapperClassName, ...otherProps } = useItem( props );\n\n\treturn (\n\t\t<div role={ role } className={ wrapperClassName }>\n\t\t\t<View { ...otherProps } ref={ forwardedRef } />\n\t\t</div>\n\t);\n}\n\nexport default contextConnect( Item, 'Item' );\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/item-group/item-group/component.tsx"],"names":["ItemGroup","props","forwardedRef","isBordered","isSeparated","size","sizeProp","otherProps","contextSize","spacedAround","contextValue"],"mappings":";;;;;;;;;;;;;AAQA;;AACA;;AACA;;AACA;;AAXA;AACA;AACA;;AAGA;AACA;AACA;AAOA,SAASA,SAAT,CACCC,KADD,EAECC,YAFD,EAGE;AACD,QAAM;AACLC,IAAAA,UADK;AAELC,IAAAA,WAFK;AAGLC,IAAAA,IAAI,EAAEC,QAHD;AAIL,OAAGC;AAJE,MAKF,wBAAcN,KAAd,CALJ;AAOA,QAAM;AAAEI,IAAAA,IAAI,EAAEG;AAAR,MAAwB,oCAA9B;AAEA,QAAMC,YAAY,GAAG,CAAEN,UAAF,IAAgB,CAAEC,WAAvC;AACA,QAAMC,IAAI,GAAGC,QAAQ,IAAIE,WAAzB;AAEA,QAAME,YAAY,GAAG;AACpBD,IAAAA,YADoB;AAEpBJ,IAAAA;AAFoB,GAArB;AAKA,SACC,4BAAC,0BAAD,CAAkB,QAAlB;AAA2B,IAAA,KAAK,EAAGK;AAAnC,KACC,4BAAC,UAAD,6BAAWH,UAAX;AAAwB,IAAA,GAAG,EAAGL;AAA9B,KADD,CADD;AAKA;;eAEc,6BAAgBF,SAAhB,EAA2B,WAA3B,C","sourcesContent":["/**\n * External dependencies\n */\nimport type { Ref } from 'react';\n\n/**\n * Internal dependencies\n */\nimport { contextConnect, WordPressComponentProps } from '../../ui/context';\nimport { useItemGroup } from './hook';\nimport { ItemGroupContext, useItemGroupContext } from '../context';\nimport { View } from '../../view';\nimport type { ItemGroupProps } from '../types';\n\nfunction ItemGroup(\n\tprops: WordPressComponentProps< ItemGroupProps, 'div' >,\n\tforwardedRef: Ref< any >\n) {\n\tconst {\n\t\tisBordered,\n\t\tisSeparated,\n\t\tsize: sizeProp,\n\t\t...otherProps\n\t} = useItemGroup( props );\n\n\tconst { size: contextSize } = useItemGroupContext();\n\n\tconst spacedAround = ! isBordered && ! isSeparated;\n\tconst size = sizeProp || contextSize;\n\n\tconst contextValue = {\n\t\tspacedAround,\n\t\tsize,\n\t};\n\n\treturn (\n\t\t<ItemGroupContext.Provider value={ contextValue }>\n\t\t\t<View { ...otherProps } ref={ forwardedRef } />\n\t\t</ItemGroupContext.Provider>\n\t);\n}\n\nexport default contextConnect( ItemGroup, 'ItemGroup' );\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/item-group/item-group/component.tsx"],"names":["ItemGroup","props","forwardedRef","isBordered","isSeparated","size","sizeProp","otherProps","contextSize","spacedAround","contextValue"],"mappings":";;;;;;;;;;;;;AAQA;;AACA;;AACA;;AACA;;AAXA;AACA;AACA;;AAGA;AACA;AACA;AAOA,SAASA,SAAT,CACCC,KADD,EAECC,YAFD,EAGE;AACD,QAAM;AACLC,IAAAA,UADK;AAELC,IAAAA,WAFK;AAGLC,IAAAA,IAAI,EAAEC,QAHD;AAIL,OAAGC;AAJE,MAKF,wBAAcN,KAAd,CALJ;AAOA,QAAM;AAAEI,IAAAA,IAAI,EAAEG;AAAR,MAAwB,oCAA9B;AAEA,QAAMC,YAAY,GAAG,CAAEN,UAAF,IAAgB,CAAEC,WAAvC;AACA,QAAMC,IAAI,GAAGC,QAAQ,IAAIE,WAAzB;AAEA,QAAME,YAAY,GAAG;AACpBD,IAAAA,YADoB;AAEpBJ,IAAAA;AAFoB,GAArB;AAKA,SACC,4BAAC,0BAAD,CAAkB,QAAlB;AAA2B,IAAA,KAAK,EAAGK;AAAnC,KACC,4BAAC,UAAD,6BAAWH,UAAX;AAAwB,IAAA,GAAG,EAAGL;AAA9B,KADD,CADD;AAKA;;eAEc,6BAAgBF,SAAhB,EAA2B,WAA3B,C","sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\n\n/**\n * Internal dependencies\n */\nimport { contextConnect, WordPressComponentProps } from '../../ui/context';\nimport { useItemGroup } from './hook';\nimport { ItemGroupContext, useItemGroupContext } from '../context';\nimport { View } from '../../view';\nimport type { ItemGroupProps } from '../types';\n\nfunction ItemGroup(\n\tprops: WordPressComponentProps< ItemGroupProps, 'div' >,\n\tforwardedRef: ForwardedRef< any >\n) {\n\tconst {\n\t\tisBordered,\n\t\tisSeparated,\n\t\tsize: sizeProp,\n\t\t...otherProps\n\t} = useItemGroup( props );\n\n\tconst { size: contextSize } = useItemGroupContext();\n\n\tconst spacedAround = ! isBordered && ! isSeparated;\n\tconst size = sizeProp || contextSize;\n\n\tconst contextValue = {\n\t\tspacedAround,\n\t\tsize,\n\t};\n\n\treturn (\n\t\t<ItemGroupContext.Provider value={ contextValue }>\n\t\t\t<View { ...otherProps } ref={ forwardedRef } />\n\t\t</ItemGroupContext.Provider>\n\t);\n}\n\nexport default contextConnect( ItemGroup, 'ItemGroup' );\n"]}
@@ -127,7 +127,7 @@ const BottomSheetNavigationScreen = _ref => {
127
127
  height: safeAreaBottomInset || _styles.default.scrollableContent.paddingBottom
128
128
  }
129
129
  }))));
130
- }, [children, isFocused, safeAreaBottomInset, listProps]);
130
+ }, [children, isFocused, safeAreaBottomInset, listProps, name, isScrollable, isNested, onLayout]);
131
131
  };
132
132
 
133
133
  var _default = BottomSheetNavigationScreen;
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js"],"names":["BottomSheetNavigationScreen","children","fullScreen","isScrollable","isNested","name","navigation","heightRef","maxHeight","isFocused","onHandleHardwareButtonPress","shouldEnableBottomSheetMaxHeight","setIsFullScreen","listProps","safeAreaBottomInset","BottomSheetContext","setHeight","BottomSheetNavigationContext","setHeightDebounce","canGoBack","goBack","current","onLayout","nativeEvent","height","layout","styles","scrollableContent","paddingBottom"],"mappings":";;;;;;;;;AAgBA;;AAbA;;AAKA;;AACA;;AAKA;;AAOA;;AACA;;AAtBA;AACA;AACA;;AASA;AACA;AACA;;AAKA;AACA;AACA;AAIA,MAAMA,2BAA2B,GAAG,QAM7B;AAAA,MAN+B;AACrCC,IAAAA,QADqC;AAErCC,IAAAA,UAFqC;AAGrCC,IAAAA,YAHqC;AAIrCC,IAAAA,QAJqC;AAKrCC,IAAAA;AALqC,GAM/B;AACN,QAAMC,UAAU,GAAG,4BAAnB;AACA,QAAMC,SAAS,GAAG,qBAAQ;AAAEC,IAAAA,SAAS,EAAE;AAAb,GAAR,CAAlB;AACA,QAAMC,SAAS,GAAG,2BAAlB;AACA,QAAM;AACLC,IAAAA,2BADK;AAELC,IAAAA,gCAFK;AAGLC,IAAAA,eAHK;AAILC,IAAAA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Cf,SAA/C,EAA2D;AAC1DF,MAAAA,SAAS,CAACc,OAAV,CAAkBb,SAAlB,GAA8BgB,MAA9B;AACAN,MAAAA,iBAAiB,CAAEM,MAAF,CAAjB;AACA;AACD,GAVD;;AAYA,SAAO,sBAAS,MAAM;AACrB,WAAOrB,YAAY,IAAIC,QAAhB,GACN,4BAAC,iBAAD;AACC,MAAA,QAAQ,EAAGkB,QADZ;AAEC,MAAA,MAAM,EAAI,qBAAqBjB,IAAM;AAFtC,OAIGJ,QAJH,CADM,GAQN,4BAAC,uBAAD,EAAiBY,SAAjB,EACC,4BAAC,+BAAD;AAAoB,MAAA,UAAU,EAAG;AAAjC,OACC,4BAAC,iBAAD;AACC,MAAA,QAAQ,EAAGS,QADZ;AAEC,MAAA,MAAM,EAAI,qBAAqBjB,IAAM;AAFtC,OAIGJ,QAJH,EAKG,CAAEG,QAAF,IACD,4BAAC,iBAAD;AACC,MAAA,KAAK,EAAG;AACPoB,QAAAA,MAAM,EACLV,mBAAmB,IACnBY,gBAAOC,iBAAP,CAAyBC;AAHnB;AADT,MANF,CADD,CADD,CARD;AA4BA,GA7BM,EA6BJ,CAAE3B,QAAF,EAAYQ,SAAZ,EAAuBK,mBAAvB,EAA4CD,SAA5C,CA7BI,CAAP;AA8BA,CA3GD;;eA6Geb,2B","sourcesContent":["/**\n * External dependencies\n */\nimport {\n\tuseIsFocused,\n\tuseNavigation,\n\tuseFocusEffect,\n} from '@react-navigation/native';\nimport { View, ScrollView, TouchableHighlight } from 'react-native';\nimport { debounce } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { BottomSheetContext } from '@wordpress/components';\n\nimport { useRef, useCallback, useContext, useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { BottomSheetNavigationContext } from './bottom-sheet-navigation-context';\nimport styles from './styles.scss';\n\nconst BottomSheetNavigationScreen = ( {\n\tchildren,\n\tfullScreen,\n\tisScrollable,\n\tisNested,\n\tname,\n} ) => {\n\tconst navigation = useNavigation();\n\tconst heightRef = useRef( { maxHeight: 0 } );\n\tconst isFocused = useIsFocused();\n\tconst {\n\t\tonHandleHardwareButtonPress,\n\t\tshouldEnableBottomSheetMaxHeight,\n\t\tsetIsFullScreen,\n\t\tlistProps,\n\t\tsafeAreaBottomInset,\n\t} = useContext( BottomSheetContext );\n\n\tconst { setHeight } = useContext( BottomSheetNavigationContext );\n\n\tconst setHeightDebounce = useCallback( debounce( setHeight, 10 ), [\n\t\tsetHeight,\n\t] );\n\n\tuseFocusEffect(\n\t\tuseCallback( () => {\n\t\t\tonHandleHardwareButtonPress( () => {\n\t\t\t\tif ( navigation.canGoBack() ) {\n\t\t\t\t\tshouldEnableBottomSheetMaxHeight( true );\n\t\t\t\t\tnavigation.goBack();\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\tonHandleHardwareButtonPress( null );\n\t\t\t\treturn false;\n\t\t\t} );\n\t\t\t/**\n\t\t\t * TODO: onHandleHardwareButtonPress stores a single value, which means\n\t\t\t * future invocations from sibling screens can replace the callback for\n\t\t\t * the currently active screen. Currently, the empty dependency array\n\t\t\t * passed to useCallback here is what prevents erroneous callback\n\t\t\t * replacements, but leveraging memoization to achieve this is brittle and\n\t\t\t * explicitly discouraged in the React documentation.\n\t\t\t * https://reactjs.org/docs/hooks-reference.html#usememo\n\t\t\t *\n\t\t\t * Ideally, we refactor onHandleHardwareButtonPress to manage multiple\n\t\t\t * callbacks triggered based upon which screen is currently active.\n\t\t\t *\n\t\t\t * Related: https://git.io/JD2no\n\t\t\t */\n\t\t}, [] )\n\t);\n\n\tuseFocusEffect(\n\t\tuseCallback( () => {\n\t\t\tif ( fullScreen ) {\n\t\t\t\tsetHeight( '100%' );\n\t\t\t\tsetIsFullScreen( true );\n\t\t\t} else if ( heightRef.current.maxHeight !== 0 ) {\n\t\t\t\tsetIsFullScreen( false );\n\t\t\t\tsetHeight( heightRef.current.maxHeight );\n\t\t\t}\n\t\t\treturn () => {};\n\t\t}, [ setHeight ] )\n\t);\n\n\tconst onLayout = ( { nativeEvent } ) => {\n\t\tif ( fullScreen ) {\n\t\t\treturn;\n\t\t}\n\t\tconst { height } = nativeEvent.layout;\n\n\t\tif ( heightRef.current.maxHeight !== height && isFocused ) {\n\t\t\theightRef.current.maxHeight = height;\n\t\t\tsetHeightDebounce( height );\n\t\t}\n\t};\n\n\treturn useMemo( () => {\n\t\treturn isScrollable || isNested ? (\n\t\t\t<View\n\t\t\t\tonLayout={ onLayout }\n\t\t\t\ttestID={ `navigation-screen-${ name }` }\n\t\t\t>\n\t\t\t\t{ children }\n\t\t\t</View>\n\t\t) : (\n\t\t\t<ScrollView { ...listProps }>\n\t\t\t\t<TouchableHighlight accessible={ false }>\n\t\t\t\t\t<View\n\t\t\t\t\t\tonLayout={ onLayout }\n\t\t\t\t\t\ttestID={ `navigation-screen-${ name }` }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ children }\n\t\t\t\t\t\t{ ! isNested && (\n\t\t\t\t\t\t\t<View\n\t\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\t\theight:\n\t\t\t\t\t\t\t\t\t\tsafeAreaBottomInset ||\n\t\t\t\t\t\t\t\t\t\tstyles.scrollableContent.paddingBottom,\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</View>\n\t\t\t\t</TouchableHighlight>\n\t\t\t</ScrollView>\n\t\t);\n\t}, [ children, isFocused, safeAreaBottomInset, listProps ] );\n};\n\nexport default BottomSheetNavigationScreen;\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js"],"names":["BottomSheetNavigationScreen","children","fullScreen","isScrollable","isNested","name","navigation","heightRef","maxHeight","isFocused","onHandleHardwareButtonPress","shouldEnableBottomSheetMaxHeight","setIsFullScreen","listProps","safeAreaBottomInset","BottomSheetContext","setHeight","BottomSheetNavigationContext","setHeightDebounce","canGoBack","goBack","current","onLayout","nativeEvent","height","layout","styles","scrollableContent","paddingBottom"],"mappings":";;;;;;;;;AAgBA;;AAbA;;AAKA;;AACA;;AAKA;;AAOA;;AACA;;AAtBA;AACA;AACA;;AASA;AACA;AACA;;AAKA;AACA;AACA;AAIA,MAAMA,2BAA2B,GAAG,QAM7B;AAAA,MAN+B;AACrCC,IAAAA,QADqC;AAErCC,IAAAA,UAFqC;AAGrCC,IAAAA,YAHqC;AAIrCC,IAAAA,QAJqC;AAKrCC,IAAAA;AALqC,GAM/B;AACN,QAAMC,UAAU,GAAG,4BAAnB;AACA,QAAMC,SAAS,GAAG,qBAAQ;AAAEC,IAAAA,SAAS,EAAE;AAAb,GAAR,CAAlB;AACA,QAAMC,SAAS,GAAG,2BAAlB;AACA,QAAM;AACLC,IAAAA,2BADK;AAELC,IAAAA,gCAFK;AAGLC,IAAAA,eAHK;AAILC,IAAAA,SAJK;AAKLC,IAAAA;AALK,MAMF,yBAAYC,8BAAZ,CANJ;AAQA,QAAM;AAAEC,IAAAA;AAAF,MAAgB,yBAAYC,0DAAZ,CAAtB;AAEA,QAAMC,iBAAiB,GAAG,0BAAa,sBAAUF,SAAV,EAAqB,EAArB,CAAb,EAAwC,CACjEA,SADiE,CAAxC,CAA1B;AAIA,8BACC,0BAAa,MAAM;AAClBN,IAAAA,2BAA2B,CAAE,MAAM;AAClC,UAAKJ,UAAU,CAACa,SAAX,EAAL,EAA8B;AAC7BR,QAAAA,gCAAgC,CAAE,IAAF,CAAhC;AACAL,QAAAA,UAAU,CAACc,MAAX;AACA,eAAO,IAAP;AACA;;AACDV,MAAAA,2BAA2B,CAAE,IAAF,CAA3B;AACA,aAAO,KAAP;AACA,KAR0B,CAA3B;AASA;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACG,GAxBD,EAwBG,EAxBH,CADD;AA4BA,8BACC,0BAAa,MAAM;AAClB,QAAKR,UAAL,EAAkB;AACjBc,MAAAA,SAAS,CAAE,M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;AA4BA,GA7BM,EA6BJ,CACF3B,QADE,EAEFQ,SAFE,EAGFK,mBAHE,EAIFD,SAJE,EAKFR,IALE,EAMFF,YANE,EAOFC,QAPE,EAQFkB,QARE,CA7BI,CAAP;AAuCA,CApHD;;eAsHetB,2B","sourcesContent":["/**\n * External dependencies\n */\nimport {\n\tuseIsFocused,\n\tuseNavigation,\n\tuseFocusEffect,\n} from '@react-navigation/native';\nimport { View, ScrollView, TouchableHighlight } from 'react-native';\nimport { debounce } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { BottomSheetContext } from '@wordpress/components';\n\nimport { useRef, useCallback, useContext, useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { BottomSheetNavigationContext } from './bottom-sheet-navigation-context';\nimport styles from './styles.scss';\n\nconst BottomSheetNavigationScreen = ( {\n\tchildren,\n\tfullScreen,\n\tisScrollable,\n\tisNested,\n\tname,\n} ) => {\n\tconst navigation = useNavigation();\n\tconst heightRef = useRef( { maxHeight: 0 } );\n\tconst isFocused = useIsFocused();\n\tconst {\n\t\tonHandleHardwareButtonPress,\n\t\tshouldEnableBottomSheetMaxHeight,\n\t\tsetIsFullScreen,\n\t\tlistProps,\n\t\tsafeAreaBottomInset,\n\t} = useContext( BottomSheetContext );\n\n\tconst { setHeight } = useContext( BottomSheetNavigationContext );\n\n\tconst setHeightDebounce = useCallback( debounce( setHeight, 10 ), [\n\t\tsetHeight,\n\t] );\n\n\tuseFocusEffect(\n\t\tuseCallback( () => {\n\t\t\tonHandleHardwareButtonPress( () => {\n\t\t\t\tif ( navigation.canGoBack() ) {\n\t\t\t\t\tshouldEnableBottomSheetMaxHeight( true );\n\t\t\t\t\tnavigation.goBack();\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\tonHandleHardwareButtonPress( null );\n\t\t\t\treturn false;\n\t\t\t} );\n\t\t\t/**\n\t\t\t * TODO: onHandleHardwareButtonPress stores a single value, which means\n\t\t\t * future invocations from sibling screens can replace the callback for\n\t\t\t * the currently active screen. Currently, the empty dependency array\n\t\t\t * passed to useCallback here is what prevents erroneous callback\n\t\t\t * replacements, but leveraging memoization to achieve this is brittle and\n\t\t\t * explicitly discouraged in the React documentation.\n\t\t\t * https://reactjs.org/docs/hooks-reference.html#usememo\n\t\t\t *\n\t\t\t * Ideally, we refactor onHandleHardwareButtonPress to manage multiple\n\t\t\t * callbacks triggered based upon which screen is currently active.\n\t\t\t *\n\t\t\t * Related: https://git.io/JD2no\n\t\t\t */\n\t\t}, [] )\n\t);\n\n\tuseFocusEffect(\n\t\tuseCallback( () => {\n\t\t\tif ( fullScreen ) {\n\t\t\t\tsetHeight( '100%' );\n\t\t\t\tsetIsFullScreen( true );\n\t\t\t} else if ( heightRef.current.maxHeight !== 0 ) {\n\t\t\t\tsetIsFullScreen( false );\n\t\t\t\tsetHeight( heightRef.current.maxHeight );\n\t\t\t}\n\t\t\treturn () => {};\n\t\t}, [ setHeight ] )\n\t);\n\n\tconst onLayout = ( { nativeEvent } ) => {\n\t\tif ( fullScreen ) {\n\t\t\treturn;\n\t\t}\n\t\tconst { height } = nativeEvent.layout;\n\n\t\tif ( heightRef.current.maxHeight !== height && isFocused ) {\n\t\t\theightRef.current.maxHeight = height;\n\t\t\tsetHeightDebounce( height );\n\t\t}\n\t};\n\n\treturn useMemo( () => {\n\t\treturn isScrollable || isNested ? (\n\t\t\t<View\n\t\t\t\tonLayout={ onLayout }\n\t\t\t\ttestID={ `navigation-screen-${ name }` }\n\t\t\t>\n\t\t\t\t{ children }\n\t\t\t</View>\n\t\t) : (\n\t\t\t<ScrollView { ...listProps }>\n\t\t\t\t<TouchableHighlight accessible={ false }>\n\t\t\t\t\t<View\n\t\t\t\t\t\tonLayout={ onLayout }\n\t\t\t\t\t\ttestID={ `navigation-screen-${ name }` }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ children }\n\t\t\t\t\t\t{ ! isNested && (\n\t\t\t\t\t\t\t<View\n\t\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\t\theight:\n\t\t\t\t\t\t\t\t\t\tsafeAreaBottomInset ||\n\t\t\t\t\t\t\t\t\t\tstyles.scrollableContent.paddingBottom,\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</View>\n\t\t\t\t</TouchableHighlight>\n\t\t\t</ScrollView>\n\t\t);\n\t}, [\n\t\tchildren,\n\t\tisFocused,\n\t\tsafeAreaBottomInset,\n\t\tlistProps,\n\t\tname,\n\t\tisScrollable,\n\t\tisNested,\n\t\tonLayout,\n\t] );\n};\n\nexport default BottomSheetNavigationScreen;\n"]}
@@ -48,6 +48,7 @@ const HIT_SLOP = {
48
48
  left: 8,
49
49
  right: 8
50
50
  };
51
+ const THEME_PALETTE_NAME = 'Theme';
51
52
 
52
53
  const PaletteScreen = () => {
53
54
  const route = (0, _native.useRoute)();
@@ -71,7 +72,10 @@ const PaletteScreen = () => {
71
72
  const [currentValue, setCurrentValue] = (0, _element.useState)(colorValue);
72
73
  const isGradientColor = isGradient(currentValue);
73
74
  const selectedSegmentIndex = isGradientColor ? 1 : 0;
75
+ const allAvailableColors = (0, _components.useMobileGlobalStylesColors)();
74
76
  const [currentSegment, setCurrentSegment] = (0, _element.useState)(segments[selectedSegmentIndex]);
77
+ const isGradientSegment = currentSegment === _utils.colorsUtils.segments[1];
78
+ const currentSegmentColors = !isGradientSegment ? defaultSettings.colors : defaultSettings.gradients;
75
79
  const horizontalSeparatorStyle = (0, _compose.usePreferredColorSchemeStyle)(_style.default.horizontalSeparator, _style.default.horizontalSeparatorDark);
76
80
  const clearButtonStyle = (0, _compose.usePreferredColorSchemeStyle)(_style.default.clearButton, _style.default.clearButtonDark);
77
81
  const selectedColorTextStyle = (0, _compose.usePreferredColorSchemeStyle)(_style.default.colorText, _style.default.colorTextDark);
@@ -167,15 +171,28 @@ const PaletteScreen = () => {
167
171
 
168
172
  return (0, _element.createElement)(_reactNative.View, null, !hideNavigation && (0, _element.createElement)(_navBar.default, null, (0, _element.createElement)(_navBar.default.BackButton, {
169
173
  onPress: navigation.goBack
170
- }), (0, _element.createElement)(_navBar.default.Heading, null, label, " ")), (0, _element.createElement)(_colorPalette.default, {
171
- setColor: setColor,
172
- activeColor: currentValue,
173
- isGradientColor: isGradientColor,
174
- currentSegment: currentSegment,
175
- onCustomPress: onCustomPress,
176
- shouldEnableBottomSheetScroll: shouldEnableBottomSheetScroll,
177
- defaultSettings: defaultSettings
178
- }), isCustomGadientShown && (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_reactNative.View, {
174
+ }), (0, _element.createElement)(_navBar.default.Heading, null, label, " ")), (0, _element.createElement)(_reactNative.View, {
175
+ style: _style.default.colorPalettes
176
+ }, currentSegmentColors.map((palette, paletteKey) => {
177
+ const paletteSettings = {
178
+ colors: palette.colors,
179
+ gradients: palette.gradients,
180
+ allColors: allAvailableColors
181
+ };
182
+ const enableCustomColor = !isGradientSegment && palette.name === THEME_PALETTE_NAME;
183
+ return (0, _element.createElement)(_colorPalette.default, {
184
+ enableCustomColor: enableCustomColor,
185
+ label: palette.name,
186
+ key: paletteKey,
187
+ setColor: setColor,
188
+ activeColor: currentValue,
189
+ isGradientColor: isGradientColor,
190
+ currentSegment: currentSegment,
191
+ onCustomPress: onCustomPress,
192
+ shouldEnableBottomSheetScroll: shouldEnableBottomSheetScroll,
193
+ defaultSettings: paletteSettings
194
+ });
195
+ })), isCustomGadientShown && (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_reactNative.View, {
179
196
  style: horizontalSeparatorStyle
180
197
  }), (0, _element.createElement)(_components.PanelBody, null, (0, _element.createElement)(_components.ColorControl, {
181
198
  label: (0, _i18n.__)('Customize Gradient'),