@wordpress/components 24.0.0 → 25.1.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 (1491) hide show
  1. package/CHANGELOG.md +49 -0
  2. package/CONTRIBUTING.md +10 -0
  3. package/build/alignment-matrix-control/cell.js +5 -6
  4. package/build/alignment-matrix-control/cell.js.map +1 -1
  5. package/build/alignment-matrix-control/icon.js +8 -9
  6. package/build/alignment-matrix-control/icon.js.map +1 -1
  7. package/build/alignment-matrix-control/index.js +10 -11
  8. package/build/alignment-matrix-control/index.js.map +1 -1
  9. package/build/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.js +6 -8
  10. package/build/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.js.map +1 -1
  11. package/build/alignment-matrix-control/styles/alignment-matrix-control-styles.js +6 -8
  12. package/build/alignment-matrix-control/styles/alignment-matrix-control-styles.js.map +1 -1
  13. package/build/alignment-matrix-control/utils.js +1 -2
  14. package/build/alignment-matrix-control/utils.js.map +1 -1
  15. package/build/angle-picker-control/angle-circle.js +6 -9
  16. package/build/angle-picker-control/angle-circle.js.map +1 -1
  17. package/build/angle-picker-control/styles/angle-picker-control-styles.js +3 -4
  18. package/build/angle-picker-control/styles/angle-picker-control-styles.js.map +1 -1
  19. package/build/animate/index.js +5 -6
  20. package/build/animate/index.js.map +1 -1
  21. package/build/autocomplete/autocompleter-ui.js +29 -33
  22. package/build/autocomplete/autocompleter-ui.js.map +1 -1
  23. package/build/autocomplete/autocompleter-ui.native.js +15 -22
  24. package/build/autocomplete/autocompleter-ui.native.js.map +1 -1
  25. package/build/autocomplete/background-view.android.js +3 -4
  26. package/build/autocomplete/background-view.android.js.map +1 -1
  27. package/build/autocomplete/background-view.ios.js +3 -4
  28. package/build/autocomplete/background-view.ios.js.map +1 -1
  29. package/build/autocomplete/get-default-use-items.js +1 -3
  30. package/build/autocomplete/get-default-use-items.js.map +1 -1
  31. package/build/autocomplete/index.js +18 -23
  32. package/build/autocomplete/index.js.map +1 -1
  33. package/build/base-control/index.js +14 -16
  34. package/build/base-control/index.js.map +1 -1
  35. package/build/base-control/index.native.js +5 -6
  36. package/build/base-control/index.native.js.map +1 -1
  37. package/build/base-control/styles/base-control-styles.js +6 -8
  38. package/build/base-control/styles/base-control-styles.js.map +1 -1
  39. package/build/border-box-control/border-box-control/hook.js +5 -5
  40. package/build/border-box-control/border-box-control/hook.js.map +1 -1
  41. package/build/border-box-control/border-box-control-split-controls/component.js +4 -4
  42. package/build/border-box-control/border-box-control-split-controls/component.js.map +1 -1
  43. package/build/border-box-control/styles.js +3 -3
  44. package/build/border-box-control/styles.js.map +1 -1
  45. package/build/border-box-control/utils.js +5 -8
  46. package/build/border-box-control/utils.js.map +1 -1
  47. package/build/border-control/border-control/component.js +1 -1
  48. package/build/border-control/border-control/component.js.map +1 -1
  49. package/build/border-control/border-control/hook.js +5 -5
  50. package/build/border-control/border-control/hook.js.map +1 -1
  51. package/build/border-control/border-control-dropdown/component.js +70 -67
  52. package/build/border-control/border-control-dropdown/component.js.map +1 -1
  53. package/build/border-control/border-control-dropdown/hook.js +4 -4
  54. package/build/border-control/border-control-dropdown/hook.js.map +1 -1
  55. package/build/box-control/all-input-control.js +11 -12
  56. package/build/box-control/all-input-control.js.map +1 -1
  57. package/build/box-control/axial-input-controls.js +12 -14
  58. package/build/box-control/axial-input-controls.js.map +1 -1
  59. package/build/box-control/icon.js +7 -9
  60. package/build/box-control/icon.js.map +1 -1
  61. package/build/box-control/index.js +22 -24
  62. package/build/box-control/index.js.map +1 -1
  63. package/build/box-control/input-controls.js +15 -18
  64. package/build/box-control/input-controls.js.map +1 -1
  65. package/build/box-control/linked-button.js +4 -5
  66. package/build/box-control/linked-button.js.map +1 -1
  67. package/build/box-control/styles/box-control-icon-styles.js +3 -4
  68. package/build/box-control/styles/box-control-icon-styles.js.map +1 -1
  69. package/build/box-control/styles/box-control-styles.js +9 -12
  70. package/build/box-control/styles/box-control-styles.js.map +1 -1
  71. package/build/box-control/styles/box-control-visualizer-styles.js +7 -11
  72. package/build/box-control/styles/box-control-visualizer-styles.js.map +1 -1
  73. package/build/box-control/unit-control.js +18 -22
  74. package/build/box-control/unit-control.js.map +1 -1
  75. package/build/box-control/utils.js +4 -10
  76. package/build/box-control/utils.js.map +1 -1
  77. package/build/button/deprecated.js +7 -8
  78. package/build/button/deprecated.js.map +1 -1
  79. package/build/button/index.js +15 -16
  80. package/build/button/index.js.map +1 -1
  81. package/build/button/index.native.js +5 -7
  82. package/build/button/index.native.js.map +1 -1
  83. package/build/card/card/hook.js +5 -6
  84. package/build/card/card/hook.js.map +1 -1
  85. package/build/circular-option-picker/index.js +27 -33
  86. package/build/circular-option-picker/index.js.map +1 -1
  87. package/build/clipboard-button/index.js +8 -9
  88. package/build/clipboard-button/index.js.map +1 -1
  89. package/build/color-control/index.native.js +7 -8
  90. package/build/color-control/index.native.js.map +1 -1
  91. package/build/color-indicator/index.native.js +10 -12
  92. package/build/color-indicator/index.native.js.map +1 -1
  93. package/build/color-palette/index.js +63 -72
  94. package/build/color-palette/index.js.map +1 -1
  95. package/build/color-palette/index.native.js +33 -47
  96. package/build/color-palette/index.native.js.map +1 -1
  97. package/build/color-palette/utils.js +2 -5
  98. package/build/color-palette/utils.js.map +1 -1
  99. package/build/color-picker/color-input.js +6 -7
  100. package/build/color-picker/color-input.js.map +1 -1
  101. package/build/color-picker/hex-input.js +8 -12
  102. package/build/color-picker/hex-input.js.map +1 -1
  103. package/build/color-picker/hsl-input.js +5 -6
  104. package/build/color-picker/hsl-input.js.map +1 -1
  105. package/build/color-picker/index.native.js +23 -30
  106. package/build/color-picker/index.native.js.map +1 -1
  107. package/build/color-picker/input-with-slider.js +8 -10
  108. package/build/color-picker/input-with-slider.js.map +1 -1
  109. package/build/color-picker/picker.js +5 -6
  110. package/build/color-picker/picker.js.map +1 -1
  111. package/build/color-picker/rgb-input.js +5 -6
  112. package/build/color-picker/rgb-input.js.map +1 -1
  113. package/build/color-picker/styles.js +8 -8
  114. package/build/color-picker/styles.js.map +1 -1
  115. package/build/color-picker/use-deprecated-props.js +1 -3
  116. package/build/color-picker/use-deprecated-props.js.map +1 -1
  117. package/build/combobox-control/index.js +3 -6
  118. package/build/combobox-control/index.js.map +1 -1
  119. package/build/combobox-control/styles.js +3 -6
  120. package/build/combobox-control/styles.js.map +1 -1
  121. package/build/confirm-dialog/component.js +1 -1
  122. package/build/confirm-dialog/component.js.map +1 -1
  123. package/build/custom-gradient-picker/gradient-bar/control-points.js +116 -131
  124. package/build/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
  125. package/build/custom-gradient-picker/gradient-bar/index.js +12 -14
  126. package/build/custom-gradient-picker/gradient-bar/index.js.map +1 -1
  127. package/build/custom-gradient-picker/gradient-bar/utils.js +4 -6
  128. package/build/custom-gradient-picker/gradient-bar/utils.js.map +1 -1
  129. package/build/custom-gradient-picker/index.js +19 -22
  130. package/build/custom-gradient-picker/index.js.map +1 -1
  131. package/build/custom-gradient-picker/index.native.js +7 -8
  132. package/build/custom-gradient-picker/index.native.js.map +1 -1
  133. package/build/custom-gradient-picker/serializer.js +15 -21
  134. package/build/custom-gradient-picker/serializer.js.map +1 -1
  135. package/build/custom-gradient-picker/utils.js +6 -9
  136. package/build/custom-gradient-picker/utils.js.map +1 -1
  137. package/build/custom-select-control/index.js +14 -21
  138. package/build/custom-select-control/index.js.map +1 -1
  139. package/build/dashicon/index.js +7 -8
  140. package/build/dashicon/index.js.map +1 -1
  141. package/build/dashicon/index.native.js +4 -5
  142. package/build/dashicon/index.native.js.map +1 -1
  143. package/build/date-time/date/index.js +24 -26
  144. package/build/date-time/date/index.js.map +1 -1
  145. package/build/date-time/date-time/index.js +11 -93
  146. package/build/date-time/date-time/index.js.map +1 -1
  147. package/build/date-time/date-time/styles.js +4 -19
  148. package/build/date-time/date-time/styles.js.map +1 -1
  149. package/build/date-time/time/index.js +11 -14
  150. package/build/date-time/time/index.js.map +1 -1
  151. package/build/dimension-control/index.js +8 -11
  152. package/build/dimension-control/index.js.map +1 -1
  153. package/build/disabled/index.js +6 -7
  154. package/build/disabled/index.js.map +1 -1
  155. package/build/disabled/index.native.js +3 -4
  156. package/build/disabled/index.native.js.map +1 -1
  157. package/build/divider/styles.js +21 -29
  158. package/build/divider/styles.js.map +1 -1
  159. package/build/draggable/index.js +14 -19
  160. package/build/draggable/index.js.map +1 -1
  161. package/build/draggable/index.native.js +17 -19
  162. package/build/draggable/index.native.js.map +1 -1
  163. package/build/drop-zone/index.js +11 -16
  164. package/build/drop-zone/index.js.map +1 -1
  165. package/build/drop-zone/provider.js +3 -4
  166. package/build/drop-zone/provider.js.map +1 -1
  167. package/build/dropdown/index.js +19 -23
  168. package/build/dropdown/index.js.map +1 -1
  169. package/build/dropdown/styles.js +3 -4
  170. package/build/dropdown/styles.js.map +1 -1
  171. package/build/dropdown-menu/index.js +96 -26
  172. package/build/dropdown-menu/index.js.map +1 -1
  173. package/build/dropdown-menu/index.native.js +22 -30
  174. package/build/dropdown-menu/index.native.js.map +1 -1
  175. package/build/dropdown-menu/types.js +6 -0
  176. package/build/dropdown-menu/types.js.map +1 -0
  177. package/build/dropdown-menu-v2/index.js +230 -0
  178. package/build/dropdown-menu-v2/index.js.map +1 -0
  179. package/build/dropdown-menu-v2/styles.js +184 -0
  180. package/build/dropdown-menu-v2/styles.js.map +1 -0
  181. package/build/dropdown-menu-v2/types.js +6 -0
  182. package/build/dropdown-menu-v2/types.js.map +1 -0
  183. package/build/duotone-picker/color-list-picker/index.js +16 -18
  184. package/build/duotone-picker/color-list-picker/index.js.map +1 -1
  185. package/build/duotone-picker/custom-duotone-bar.js +4 -5
  186. package/build/duotone-picker/custom-duotone-bar.js.map +1 -1
  187. package/build/duotone-picker/duotone-picker.js +15 -17
  188. package/build/duotone-picker/duotone-picker.js.map +1 -1
  189. package/build/duotone-picker/duotone-swatch.js +3 -4
  190. package/build/duotone-picker/duotone-swatch.js.map +1 -1
  191. package/build/duotone-picker/utils.js +14 -27
  192. package/build/duotone-picker/utils.js.map +1 -1
  193. package/build/external-link/index.js +1 -1
  194. package/build/external-link/index.js.map +1 -1
  195. package/build/external-link/index.native.js +4 -5
  196. package/build/external-link/index.native.js.map +1 -1
  197. package/build/focal-point-picker/controls.js +11 -10
  198. package/build/focal-point-picker/controls.js.map +1 -1
  199. package/build/focal-point-picker/focal-point.js +5 -6
  200. package/build/focal-point-picker/focal-point.js.map +1 -1
  201. package/build/focal-point-picker/focal-point.native.js +5 -6
  202. package/build/focal-point-picker/focal-point.native.js.map +1 -1
  203. package/build/focal-point-picker/grid.js +4 -5
  204. package/build/focal-point-picker/grid.js.map +1 -1
  205. package/build/focal-point-picker/index.js +33 -37
  206. package/build/focal-point-picker/index.js.map +1 -1
  207. package/build/focal-point-picker/index.native.js +10 -12
  208. package/build/focal-point-picker/index.native.js.map +1 -1
  209. package/build/focal-point-picker/media.js +11 -13
  210. package/build/focal-point-picker/media.js.map +1 -1
  211. package/build/focal-point-picker/styles/focal-point-picker-style.js +9 -14
  212. package/build/focal-point-picker/styles/focal-point-picker-style.js.map +1 -1
  213. package/build/focal-point-picker/styles/focal-point-style.js +3 -6
  214. package/build/focal-point-picker/styles/focal-point-style.js.map +1 -1
  215. package/build/focal-point-picker/tooltip/index.native.js +16 -21
  216. package/build/focal-point-picker/tooltip/index.native.js.map +1 -1
  217. package/build/focal-point-picker/utils.js +2 -4
  218. package/build/focal-point-picker/utils.js.map +1 -1
  219. package/build/focusable-iframe/index.js +4 -5
  220. package/build/focusable-iframe/index.js.map +1 -1
  221. package/build/font-size-picker/font-size-picker-select.js +3 -5
  222. package/build/font-size-picker/font-size-picker-select.js.map +1 -1
  223. package/build/font-size-picker/index.js +13 -19
  224. package/build/font-size-picker/index.js.map +1 -1
  225. package/build/font-size-picker/index.native.js +6 -7
  226. package/build/font-size-picker/index.native.js.map +1 -1
  227. package/build/font-size-picker/styles.js +24 -8
  228. package/build/font-size-picker/styles.js.map +1 -1
  229. package/build/footer-message-control/index.native.js +2 -3
  230. package/build/footer-message-control/index.native.js.map +1 -1
  231. package/build/form-file-upload/index.js +10 -13
  232. package/build/form-file-upload/index.js.map +1 -1
  233. package/build/form-token-field/index.js +4 -19
  234. package/build/form-token-field/index.js.map +1 -1
  235. package/build/form-token-field/styles.js +4 -7
  236. package/build/form-token-field/styles.js.map +1 -1
  237. package/build/form-token-field/suggestions-list.js +14 -15
  238. package/build/form-token-field/suggestions-list.js.map +1 -1
  239. package/build/form-token-field/token-input.js +2 -2
  240. package/build/form-token-field/token-input.js.map +1 -1
  241. package/build/form-token-field/token.js +14 -15
  242. package/build/form-token-field/token.js.map +1 -1
  243. package/build/gradient-picker/index.js +51 -58
  244. package/build/gradient-picker/index.js.map +1 -1
  245. package/build/guide/icons.js +13 -16
  246. package/build/guide/icons.js.map +1 -1
  247. package/build/guide/index.js +9 -12
  248. package/build/guide/index.js.map +1 -1
  249. package/build/guide/page-control.js +5 -6
  250. package/build/guide/page-control.js.map +1 -1
  251. package/build/h-stack/utils.js +1 -3
  252. package/build/h-stack/utils.js.map +1 -1
  253. package/build/higher-order/navigate-regions/index.js +16 -22
  254. package/build/higher-order/navigate-regions/index.js.map +1 -1
  255. package/build/higher-order/with-focus-outside/index.js +1 -1
  256. package/build/higher-order/with-focus-outside/index.js.map +1 -1
  257. package/build/higher-order/with-focus-outside/index.native.js +1 -1
  258. package/build/higher-order/with-focus-outside/index.native.js.map +1 -1
  259. package/build/higher-order/with-focus-return/index.js +13 -17
  260. package/build/higher-order/with-focus-return/index.js.map +1 -1
  261. package/build/icon/index.js +5 -7
  262. package/build/icon/index.js.map +1 -1
  263. package/build/index.native.js +0 -9
  264. package/build/index.native.js.map +1 -1
  265. package/build/input-control/backdrop.js +4 -5
  266. package/build/input-control/backdrop.js.map +1 -1
  267. package/build/input-control/index.js +22 -23
  268. package/build/input-control/index.js.map +1 -1
  269. package/build/input-control/input-base.js +16 -17
  270. package/build/input-control/input-base.js.map +1 -1
  271. package/build/input-control/input-field.js +26 -29
  272. package/build/input-control/input-field.js.map +1 -1
  273. package/build/input-control/label.js +6 -7
  274. package/build/input-control/label.js.map +1 -1
  275. package/build/input-control/reducer/reducer.js +2 -6
  276. package/build/input-control/reducer/reducer.js.map +1 -1
  277. package/build/input-control/styles/input-control-styles.js +62 -64
  278. package/build/input-control/styles/input-control-styles.js.map +1 -1
  279. package/build/input-control/utils.js +1 -3
  280. package/build/input-control/utils.js.map +1 -1
  281. package/build/keyboard-shortcuts/index.js +21 -26
  282. package/build/keyboard-shortcuts/index.js.map +1 -1
  283. package/build/menu-items-choice/index.js +6 -7
  284. package/build/menu-items-choice/index.js.map +1 -1
  285. package/build/mobile/audio-player/index.native.js +7 -8
  286. package/build/mobile/audio-player/index.native.js.map +1 -1
  287. package/build/mobile/badge/index.native.js +5 -6
  288. package/build/mobile/badge/index.native.js.map +1 -1
  289. package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js +10 -12
  290. package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js.map +1 -1
  291. package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js +10 -13
  292. package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js.map +1 -1
  293. package/build/mobile/bottom-sheet/button.native.js +18 -21
  294. package/build/mobile/bottom-sheet/button.native.js.map +1 -1
  295. package/build/mobile/bottom-sheet/cell.native.js +23 -11
  296. package/build/mobile/bottom-sheet/cell.native.js.map +1 -1
  297. package/build/mobile/bottom-sheet/color-cell.native.js +3 -1
  298. package/build/mobile/bottom-sheet/color-cell.native.js.map +1 -1
  299. package/build/mobile/bottom-sheet/footer-message-cell.native.js +4 -5
  300. package/build/mobile/bottom-sheet/footer-message-cell.native.js.map +1 -1
  301. package/build/mobile/bottom-sheet/footer-message-link/footer-message-link.native.js +4 -5
  302. package/build/mobile/bottom-sheet/footer-message-link/footer-message-link.native.js.map +1 -1
  303. package/build/mobile/bottom-sheet/index.native.js +19 -30
  304. package/build/mobile/bottom-sheet/index.native.js.map +1 -1
  305. package/build/mobile/bottom-sheet/link-cell.native.js +6 -7
  306. package/build/mobile/bottom-sheet/link-cell.native.js.map +1 -1
  307. package/build/mobile/bottom-sheet/link-suggestion-item-cell.native.js +5 -6
  308. package/build/mobile/bottom-sheet/link-suggestion-item-cell.native.js.map +1 -1
  309. package/build/mobile/bottom-sheet/lock-icon/index.native.js +33 -0
  310. package/build/mobile/bottom-sheet/lock-icon/index.native.js.map +1 -0
  311. package/build/mobile/bottom-sheet/nav-bar/action-button.native.js +6 -7
  312. package/build/mobile/bottom-sheet/nav-bar/action-button.native.js.map +1 -1
  313. package/build/mobile/bottom-sheet/nav-bar/apply-button.native.js +3 -4
  314. package/build/mobile/bottom-sheet/nav-bar/apply-button.native.js.map +1 -1
  315. package/build/mobile/bottom-sheet/nav-bar/back-button.native.js +12 -15
  316. package/build/mobile/bottom-sheet/nav-bar/back-button.native.js.map +1 -1
  317. package/build/mobile/bottom-sheet/nav-bar/heading.native.js +3 -4
  318. package/build/mobile/bottom-sheet/nav-bar/heading.native.js.map +1 -1
  319. package/build/mobile/bottom-sheet/nav-bar/index.native.js +3 -4
  320. package/build/mobile/bottom-sheet/nav-bar/index.native.js.map +1 -1
  321. package/build/mobile/bottom-sheet/radio-cell.native.js +4 -3
  322. package/build/mobile/bottom-sheet/radio-cell.native.js.map +1 -1
  323. package/build/mobile/bottom-sheet/range-cell.native.js +7 -3
  324. package/build/mobile/bottom-sheet/range-cell.native.js.map +1 -1
  325. package/build/mobile/bottom-sheet/range-text-input.native.js +5 -6
  326. package/build/mobile/bottom-sheet/range-text-input.native.js.map +1 -1
  327. package/build/mobile/bottom-sheet/ripple.native.js +10 -11
  328. package/build/mobile/bottom-sheet/ripple.native.js.map +1 -1
  329. package/build/mobile/bottom-sheet/stepper-cell/index.native.js +5 -4
  330. package/build/mobile/bottom-sheet/stepper-cell/index.native.js.map +1 -1
  331. package/build/mobile/bottom-sheet/stepper-cell/stepper.android.js +11 -12
  332. package/build/mobile/bottom-sheet/stepper-cell/stepper.android.js.map +1 -1
  333. package/build/mobile/bottom-sheet/stepper-cell/stepper.ios.js +11 -12
  334. package/build/mobile/bottom-sheet/stepper-cell/stepper.ios.js.map +1 -1
  335. package/build/mobile/bottom-sheet/sub-sheet/index.native.js +6 -7
  336. package/build/mobile/bottom-sheet/sub-sheet/index.native.js.map +1 -1
  337. package/build/mobile/bottom-sheet/switch-cell.native.js +8 -2
  338. package/build/mobile/bottom-sheet/switch-cell.native.js.map +1 -1
  339. package/build/mobile/bottom-sheet-select-control/index.native.js +11 -10
  340. package/build/mobile/bottom-sheet-select-control/index.native.js.map +1 -1
  341. package/build/mobile/bottom-sheet-text-control/index.native.js +13 -12
  342. package/build/mobile/bottom-sheet-text-control/index.native.js.map +1 -1
  343. package/build/mobile/color-settings/index.native.js +12 -13
  344. package/build/mobile/color-settings/index.native.js.map +1 -1
  345. package/build/mobile/color-settings/utils.native.js +2 -2
  346. package/build/mobile/color-settings/utils.native.js.map +1 -1
  347. package/build/mobile/cycle-select-control/index.native.js +11 -12
  348. package/build/mobile/cycle-select-control/index.native.js.map +1 -1
  349. package/build/mobile/focal-point-settings-panel/index.native.js +6 -7
  350. package/build/mobile/focal-point-settings-panel/index.native.js.map +1 -1
  351. package/build/mobile/global-styles-context/index.native.js +6 -14
  352. package/build/mobile/global-styles-context/index.native.js.map +1 -1
  353. package/build/mobile/global-styles-context/utils.native.js +69 -112
  354. package/build/mobile/global-styles-context/utils.native.js.map +1 -1
  355. package/build/mobile/gradient/index.native.js +26 -33
  356. package/build/mobile/gradient/index.native.js.map +1 -1
  357. package/build/mobile/html-text-input/index.native.js +3 -3
  358. package/build/mobile/html-text-input/index.native.js.map +1 -1
  359. package/build/mobile/image/image-editing-button.native.js +22 -26
  360. package/build/mobile/image/image-editing-button.native.js.map +1 -1
  361. package/build/mobile/image/index.native.js +31 -34
  362. package/build/mobile/image/index.native.js.map +1 -1
  363. package/build/mobile/keyboard-avoiding-view/index.ios.js +22 -29
  364. package/build/mobile/keyboard-avoiding-view/index.ios.js.map +1 -1
  365. package/build/mobile/keyboard-aware-flat-list/index.android.js +5 -6
  366. package/build/mobile/keyboard-aware-flat-list/index.android.js.map +1 -1
  367. package/build/mobile/keyboard-aware-flat-list/index.ios.js +9 -10
  368. package/build/mobile/keyboard-aware-flat-list/index.ios.js.map +1 -1
  369. package/build/mobile/keyboard-aware-flat-list/use-keyboard-offset.native.js +9 -14
  370. package/build/mobile/keyboard-aware-flat-list/use-keyboard-offset.native.js.map +1 -1
  371. package/build/mobile/layout-animation/index.native.js +1 -3
  372. package/build/mobile/layout-animation/index.native.js.map +1 -1
  373. package/build/mobile/link-picker/index.native.js +12 -16
  374. package/build/mobile/link-picker/index.native.js.map +1 -1
  375. package/build/mobile/link-picker/link-picker-results.native.js +34 -48
  376. package/build/mobile/link-picker/link-picker-results.native.js.map +1 -1
  377. package/build/mobile/link-picker/link-picker-screen.native.js +7 -10
  378. package/build/mobile/link-picker/link-picker-screen.native.js.map +1 -1
  379. package/build/mobile/link-settings/image-link-destinations-screen.native.js +8 -9
  380. package/build/mobile/link-settings/image-link-destinations-screen.native.js.map +1 -1
  381. package/build/mobile/link-settings/index.native.js +57 -58
  382. package/build/mobile/link-settings/index.native.js.map +1 -1
  383. package/build/mobile/media-edit/index.native.js +2 -2
  384. package/build/mobile/media-edit/index.native.js.map +1 -1
  385. package/build/mobile/picker/index.ios.js +3 -6
  386. package/build/mobile/picker/index.ios.js.map +1 -1
  387. package/build/mobile/segmented-control/index.native.js +16 -20
  388. package/build/mobile/segmented-control/index.native.js.map +1 -1
  389. package/build/mobile/utils/alignments.native.js +2 -6
  390. package/build/mobile/utils/alignments.native.js.map +1 -1
  391. package/build/mobile/utils/index.native.js +1 -2
  392. package/build/mobile/utils/index.native.js.map +1 -1
  393. package/build/mobile/utils/use-unit-converter-to-mobile.native.js +4 -7
  394. package/build/mobile/utils/use-unit-converter-to-mobile.native.js.map +1 -1
  395. package/build/modal/index.js +3 -4
  396. package/build/modal/index.js.map +1 -1
  397. package/build/navigable-container/container.js +2 -6
  398. package/build/navigable-container/container.js.map +1 -1
  399. package/build/navigable-container/menu.js +5 -7
  400. package/build/navigable-container/menu.js.map +1 -1
  401. package/build/navigable-container/tabbable.js +4 -6
  402. package/build/navigable-container/tabbable.js.map +1 -1
  403. package/build/navigation/back-button/index.js +8 -11
  404. package/build/navigation/back-button/index.js.map +1 -1
  405. package/build/navigation/group/index.js +5 -6
  406. package/build/navigation/group/index.js.map +1 -1
  407. package/build/navigation/index.js +8 -11
  408. package/build/navigation/index.js.map +1 -1
  409. package/build/navigation/item/base.js +1 -3
  410. package/build/navigation/item/base.js.map +1 -1
  411. package/build/navigation/menu/menu-title-search.js +11 -14
  412. package/build/navigation/menu/menu-title-search.js.map +1 -1
  413. package/build/navigation/menu/menu-title.js +8 -11
  414. package/build/navigation/menu/menu-title.js.map +1 -1
  415. package/build/navigation/menu/search-no-results-found.js +3 -4
  416. package/build/navigation/menu/search-no-results-found.js.map +1 -1
  417. package/build/navigator/navigator-back-button/hook.js +1 -1
  418. package/build/navigator/navigator-back-button/hook.js.map +1 -1
  419. package/build/navigator/navigator-button/hook.js +1 -1
  420. package/build/navigator/navigator-button/hook.js.map +1 -1
  421. package/build/navigator/navigator-provider/component.js +2 -6
  422. package/build/navigator/navigator-provider/component.js.map +1 -1
  423. package/build/navigator/navigator-screen/component.js +1 -1
  424. package/build/navigator/navigator-screen/component.js.map +1 -1
  425. package/build/notice/index.js +25 -29
  426. package/build/notice/index.js.map +1 -1
  427. package/build/notice/index.native.js +13 -18
  428. package/build/notice/index.native.js.map +1 -1
  429. package/build/notice/list.js +6 -8
  430. package/build/notice/list.js.map +1 -1
  431. package/build/number-control/index.js +24 -26
  432. package/build/number-control/index.js.map +1 -1
  433. package/build/number-control/styles/number-control-styles.js +6 -10
  434. package/build/number-control/styles/number-control-styles.js.map +1 -1
  435. package/build/palette-edit/index.js +83 -94
  436. package/build/palette-edit/index.js.map +1 -1
  437. package/build/panel/actions.native.js +8 -10
  438. package/build/panel/actions.native.js.map +1 -1
  439. package/build/panel/body.js +7 -10
  440. package/build/panel/body.js.map +1 -1
  441. package/build/panel/body.native.js +6 -7
  442. package/build/panel/body.native.js.map +1 -1
  443. package/build/panel/bottom-separator-cover.native.js +3 -4
  444. package/build/panel/bottom-separator-cover.native.js.map +1 -1
  445. package/build/panel/header.js +4 -5
  446. package/build/panel/header.js.map +1 -1
  447. package/build/panel/index.js +5 -6
  448. package/build/panel/index.js.map +1 -1
  449. package/build/panel/row.js +4 -5
  450. package/build/panel/row.js.map +1 -1
  451. package/build/popover/index.js +27 -31
  452. package/build/popover/index.js.map +1 -1
  453. package/build/popover/limit-shift.js +70 -75
  454. package/build/popover/limit-shift.js.map +1 -1
  455. package/build/popover/overlay-middlewares.js +7 -9
  456. package/build/popover/overlay-middlewares.js.map +1 -1
  457. package/build/popover/utils.js +26 -34
  458. package/build/popover/utils.js.map +1 -1
  459. package/build/private-apis.js +16 -1
  460. package/build/private-apis.js.map +1 -1
  461. package/build/query-controls/author-select.js +7 -8
  462. package/build/query-controls/author-select.js.map +1 -1
  463. package/build/query-controls/category-select.js +8 -9
  464. package/build/query-controls/category-select.js.map +1 -1
  465. package/build/query-controls/index.js +16 -17
  466. package/build/query-controls/index.js.map +1 -1
  467. package/build/query-controls/index.native.js +13 -14
  468. package/build/query-controls/index.native.js.map +1 -1
  469. package/build/radio-control/index.js +1 -1
  470. package/build/radio-control/index.js.map +1 -1
  471. package/build/radio-control/index.native.js +6 -7
  472. package/build/radio-control/index.native.js.map +1 -1
  473. package/build/radio-group/index.js +8 -9
  474. package/build/radio-group/index.js.map +1 -1
  475. package/build/radio-group/radio/index.js +5 -6
  476. package/build/radio-group/radio/index.js.map +1 -1
  477. package/build/range-control/index.js +1 -3
  478. package/build/range-control/index.js.map +1 -1
  479. package/build/range-control/index.native.js +23 -22
  480. package/build/range-control/index.native.js.map +1 -1
  481. package/build/range-control/rail.js +7 -9
  482. package/build/range-control/rail.js.map +1 -1
  483. package/build/range-control/styles/range-control-styles.js +37 -52
  484. package/build/range-control/styles/range-control-styles.js.map +1 -1
  485. package/build/range-control/tooltip.js +4 -5
  486. package/build/range-control/tooltip.js.map +1 -1
  487. package/build/resizable-box/index.js +8 -9
  488. package/build/resizable-box/index.js.map +1 -1
  489. package/build/resizable-box/resize-tooltip/index.js +12 -13
  490. package/build/resizable-box/resize-tooltip/index.js.map +1 -1
  491. package/build/resizable-box/resize-tooltip/label.js +6 -7
  492. package/build/resizable-box/resize-tooltip/label.js.map +1 -1
  493. package/build/resizable-box/resize-tooltip/utils.js +16 -19
  494. package/build/resizable-box/resize-tooltip/utils.js.map +1 -1
  495. package/build/responsive-wrapper/index.js +6 -8
  496. package/build/responsive-wrapper/index.js.map +1 -1
  497. package/build/sandbox/index.js +16 -23
  498. package/build/sandbox/index.js.map +1 -1
  499. package/build/sandbox/index.native.js +20 -26
  500. package/build/sandbox/index.native.js.map +1 -1
  501. package/build/search-control/index.js +14 -17
  502. package/build/search-control/index.js.map +1 -1
  503. package/build/search-control/index.native.js +7 -8
  504. package/build/search-control/index.native.js.map +1 -1
  505. package/build/select-control/index.js +9 -19
  506. package/build/select-control/index.js.map +1 -1
  507. package/build/select-control/index.native.js +11 -12
  508. package/build/select-control/index.native.js.map +1 -1
  509. package/build/select-control/styles/select-control-styles.js +19 -25
  510. package/build/select-control/styles/select-control-styles.js.map +1 -1
  511. package/build/slot-fill/bubbles-virtually/fill.js +4 -5
  512. package/build/slot-fill/bubbles-virtually/fill.js.map +1 -1
  513. package/build/slot-fill/bubbles-virtually/slot-fill-provider.js +4 -7
  514. package/build/slot-fill/bubbles-virtually/slot-fill-provider.js.map +1 -1
  515. package/build/slot-fill/bubbles-virtually/slot.js +6 -7
  516. package/build/slot-fill/bubbles-virtually/slot.js.map +1 -1
  517. package/build/slot-fill/fill.js +4 -5
  518. package/build/slot-fill/fill.js.map +1 -1
  519. package/build/slot-fill/index.js +8 -11
  520. package/build/slot-fill/index.js.map +1 -1
  521. package/build/slot-fill/index.native.js +4 -5
  522. package/build/slot-fill/index.native.js.map +1 -1
  523. package/build/slot-fill/provider.js +2 -2
  524. package/build/slot-fill/provider.js.map +1 -1
  525. package/build/slot-fill/slot.js +9 -12
  526. package/build/slot-fill/slot.js.map +1 -1
  527. package/build/snackbar/index.js +26 -31
  528. package/build/snackbar/index.js.map +1 -1
  529. package/build/snackbar/list.js +7 -8
  530. package/build/snackbar/list.js.map +1 -1
  531. package/build/spinner/index.js +4 -5
  532. package/build/spinner/index.js.map +1 -1
  533. package/build/style-provider/index.native.js +3 -4
  534. package/build/style-provider/index.native.js.map +1 -1
  535. package/build/surface/styles.js +6 -7
  536. package/build/surface/styles.js.map +1 -1
  537. package/build/tab-panel/index.js +35 -40
  538. package/build/tab-panel/index.js.map +1 -1
  539. package/build/text/styles/text-mixins.native.js +1 -3
  540. package/build/text/styles/text-mixins.native.js.map +1 -1
  541. package/build/text/utils.js +16 -17
  542. package/build/text/utils.js.map +1 -1
  543. package/build/text-control/index.native.js +12 -13
  544. package/build/text-control/index.native.js.map +1 -1
  545. package/build/textarea-control/index.native.js +7 -8
  546. package/build/textarea-control/index.native.js.map +1 -1
  547. package/build/theme/color-algorithms.js +1 -2
  548. package/build/theme/color-algorithms.js.map +1 -1
  549. package/build/theme/index.js +6 -7
  550. package/build/theme/index.js.map +1 -1
  551. package/build/theme/styles.js +4 -8
  552. package/build/theme/styles.js.map +1 -1
  553. package/build/toggle-control/index.js +9 -11
  554. package/build/toggle-control/index.js.map +1 -1
  555. package/build/toggle-control/index.native.js +9 -10
  556. package/build/toggle-control/index.native.js.map +1 -1
  557. package/build/toggle-group-control/toggle-group-control/as-button-group.js +9 -10
  558. package/build/toggle-group-control/toggle-group-control/as-button-group.js.map +1 -1
  559. package/build/toggle-group-control/toggle-group-control/as-radio-group.js +9 -10
  560. package/build/toggle-group-control/toggle-group-control/as-radio-group.js.map +1 -1
  561. package/build/toggle-group-control/toggle-group-control/styles.js +11 -14
  562. package/build/toggle-group-control/toggle-group-control/styles.js.map +1 -1
  563. package/build/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.js +7 -8
  564. package/build/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.js.map +1 -1
  565. package/build/toggle-group-control/toggle-group-control-option-base/component.js +5 -7
  566. package/build/toggle-group-control/toggle-group-control-option-base/component.js.map +1 -1
  567. package/build/toggle-group-control/toggle-group-control-option-base/styles.js +11 -15
  568. package/build/toggle-group-control/toggle-group-control-option-base/styles.js.map +1 -1
  569. package/build/toolbar/toolbar/index.js +23 -9
  570. package/build/toolbar/toolbar/index.js.map +1 -1
  571. package/build/toolbar/toolbar/toolbar-container.js +4 -5
  572. package/build/toolbar/toolbar/toolbar-container.js.map +1 -1
  573. package/build/toolbar/toolbar/toolbar-container.native.js +3 -6
  574. package/build/toolbar/toolbar/toolbar-container.native.js.map +1 -1
  575. package/build/toolbar/toolbar-button/index.js +10 -11
  576. package/build/toolbar/toolbar-button/index.js.map +1 -1
  577. package/build/toolbar/toolbar-button/toolbar-button-container.js +6 -9
  578. package/build/toolbar/toolbar-button/toolbar-button-container.js.map +1 -1
  579. package/build/toolbar/toolbar-group/index.js +9 -12
  580. package/build/toolbar/toolbar-group/index.js.map +1 -1
  581. package/build/toolbar/toolbar-group/toolbar-group-collapsed.js +5 -6
  582. package/build/toolbar/toolbar-group/toolbar-group-collapsed.js.map +1 -1
  583. package/build/toolbar/toolbar-group/toolbar-group-collapsed.native.js +6 -7
  584. package/build/toolbar/toolbar-group/toolbar-group-collapsed.native.js.map +1 -1
  585. package/build/toolbar/toolbar-group/toolbar-group-container.js +7 -10
  586. package/build/toolbar/toolbar-group/toolbar-group-container.js.map +1 -1
  587. package/build/toolbar/toolbar-group/toolbar-group-container.native.js +7 -10
  588. package/build/toolbar/toolbar-group/toolbar-group-container.native.js.map +1 -1
  589. package/build/toolbar/toolbar-item/index.js +5 -6
  590. package/build/toolbar/toolbar-item/index.js.map +1 -1
  591. package/build/toolbar/toolbar-item/index.native.js +4 -6
  592. package/build/toolbar/toolbar-item/index.native.js.map +1 -1
  593. package/build/tools-panel/tools-panel/hook.js +17 -25
  594. package/build/tools-panel/tools-panel/hook.js.map +1 -1
  595. package/build/tools-panel/tools-panel-header/component.js +14 -24
  596. package/build/tools-panel/tools-panel-header/component.js.map +1 -1
  597. package/build/tools-panel/tools-panel-item/hook.js +5 -7
  598. package/build/tools-panel/tools-panel-item/hook.js.map +1 -1
  599. package/build/tooltip/index.js +36 -43
  600. package/build/tooltip/index.js.map +1 -1
  601. package/build/tooltip/index.native.js +14 -19
  602. package/build/tooltip/index.native.js.map +1 -1
  603. package/build/tree-grid/cell.js +5 -6
  604. package/build/tree-grid/cell.js.map +1 -1
  605. package/build/tree-grid/index.js +12 -15
  606. package/build/tree-grid/index.js.map +1 -1
  607. package/build/tree-grid/item.js +4 -5
  608. package/build/tree-grid/item.js.map +1 -1
  609. package/build/tree-grid/roving-tab-index-item.js +6 -7
  610. package/build/tree-grid/roving-tab-index-item.js.map +1 -1
  611. package/build/tree-grid/roving-tab-index.js +3 -4
  612. package/build/tree-grid/roving-tab-index.js.map +1 -1
  613. package/build/tree-grid/row.js +8 -9
  614. package/build/tree-grid/row.js.map +1 -1
  615. package/build/tree-select/index.js +9 -11
  616. package/build/tree-select/index.js.map +1 -1
  617. package/build/truncate/utils.js +1 -3
  618. package/build/truncate/utils.js.map +1 -1
  619. package/build/ui/context/context-connect.js +1 -1
  620. package/build/ui/context/context-connect.js.map +1 -1
  621. package/build/ui/context/context-system-provider.js +7 -9
  622. package/build/ui/context/context-system-provider.js.map +1 -1
  623. package/build/ui/context/index.js +7 -0
  624. package/build/ui/context/index.js.map +1 -1
  625. package/build/ui/context/use-context-system.js +1 -1
  626. package/build/ui/context/use-context-system.js.map +1 -1
  627. package/build/ui/control-group/hook.js +1 -1
  628. package/build/ui/control-group/hook.js.map +1 -1
  629. package/build/ui/form-group/form-group-content.js +12 -13
  630. package/build/ui/form-group/form-group-content.js.map +1 -1
  631. package/build/ui/form-group/form-group-help.js +3 -4
  632. package/build/ui/form-group/form-group-help.js.map +1 -1
  633. package/build/ui/form-group/form-group-label.js +7 -8
  634. package/build/ui/form-group/form-group-label.js.map +1 -1
  635. package/build/ui/tooltip/component.js +1 -1
  636. package/build/ui/tooltip/component.js.map +1 -1
  637. package/build/ui/utils/colors.js +1 -3
  638. package/build/ui/utils/colors.js.map +1 -1
  639. package/build/ui/utils/font-size.js +2 -6
  640. package/build/ui/utils/font-size.js.map +1 -1
  641. package/build/ui/utils/get-high-dpi.js +1 -5
  642. package/build/ui/utils/get-high-dpi.js.map +1 -1
  643. package/build/ui/utils/space.js +1 -3
  644. package/build/ui/utils/space.js.map +1 -1
  645. package/build/ui/utils/use-responsive-value.js +2 -4
  646. package/build/ui/utils/use-responsive-value.js.map +1 -1
  647. package/build/unit-control/index.js +8 -8
  648. package/build/unit-control/index.js.map +1 -1
  649. package/build/unit-control/index.native.js +22 -23
  650. package/build/unit-control/index.native.js.map +1 -1
  651. package/build/unit-control/styles/unit-control-styles.js +6 -8
  652. package/build/unit-control/styles/unit-control-styles.js.map +1 -1
  653. package/build/unit-control/unit-select-control.js +11 -13
  654. package/build/unit-control/unit-select-control.js.map +1 -1
  655. package/build/unit-control/utils.js +12 -19
  656. package/build/unit-control/utils.js.map +1 -1
  657. package/build/utils/browsers.js +2 -10
  658. package/build/utils/browsers.js.map +1 -1
  659. package/build/utils/colors.js +1 -3
  660. package/build/utils/colors.js.map +1 -1
  661. package/build/utils/config-values.js +1 -0
  662. package/build/utils/config-values.js.map +1 -1
  663. package/build/utils/hooks/use-controlled-state.js +1 -2
  664. package/build/utils/hooks/use-controlled-state.js.map +1 -1
  665. package/build/utils/hooks/use-controlled-value.js +5 -6
  666. package/build/utils/hooks/use-controlled-value.js.map +1 -1
  667. package/build/utils/hooks/use-cx.js +1 -5
  668. package/build/utils/hooks/use-cx.js.map +1 -1
  669. package/build/utils/math.js +5 -17
  670. package/build/utils/math.js.map +1 -1
  671. package/build/utils/reduce-motion.js +1 -2
  672. package/build/utils/reduce-motion.js.map +1 -1
  673. package/build/utils/rtl.js +3 -9
  674. package/build/utils/rtl.js.map +1 -1
  675. package/build/utils/values.js +2 -6
  676. package/build/utils/values.js.map +1 -1
  677. package/build/z-stack/styles.js +14 -23
  678. package/build/z-stack/styles.js.map +1 -1
  679. package/build-module/alignment-matrix-control/cell.js +5 -6
  680. package/build-module/alignment-matrix-control/cell.js.map +1 -1
  681. package/build-module/alignment-matrix-control/icon.js +8 -9
  682. package/build-module/alignment-matrix-control/icon.js.map +1 -1
  683. package/build-module/alignment-matrix-control/index.js +10 -11
  684. package/build-module/alignment-matrix-control/index.js.map +1 -1
  685. package/build-module/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.js +6 -8
  686. package/build-module/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.js.map +1 -1
  687. package/build-module/alignment-matrix-control/styles/alignment-matrix-control-styles.js +6 -8
  688. package/build-module/alignment-matrix-control/styles/alignment-matrix-control-styles.js.map +1 -1
  689. package/build-module/alignment-matrix-control/utils.js +1 -2
  690. package/build-module/alignment-matrix-control/utils.js.map +1 -1
  691. package/build-module/angle-picker-control/angle-circle.js +6 -9
  692. package/build-module/angle-picker-control/angle-circle.js.map +1 -1
  693. package/build-module/angle-picker-control/styles/angle-picker-control-styles.js +3 -4
  694. package/build-module/angle-picker-control/styles/angle-picker-control-styles.js.map +1 -1
  695. package/build-module/animate/index.js +5 -6
  696. package/build-module/animate/index.js.map +1 -1
  697. package/build-module/autocomplete/autocompleter-ui.js +29 -33
  698. package/build-module/autocomplete/autocompleter-ui.js.map +1 -1
  699. package/build-module/autocomplete/autocompleter-ui.native.js +15 -22
  700. package/build-module/autocomplete/autocompleter-ui.native.js.map +1 -1
  701. package/build-module/autocomplete/background-view.android.js +3 -4
  702. package/build-module/autocomplete/background-view.android.js.map +1 -1
  703. package/build-module/autocomplete/background-view.ios.js +3 -4
  704. package/build-module/autocomplete/background-view.ios.js.map +1 -1
  705. package/build-module/autocomplete/get-default-use-items.js +1 -3
  706. package/build-module/autocomplete/get-default-use-items.js.map +1 -1
  707. package/build-module/autocomplete/index.js +18 -23
  708. package/build-module/autocomplete/index.js.map +1 -1
  709. package/build-module/base-control/index.js +14 -16
  710. package/build-module/base-control/index.js.map +1 -1
  711. package/build-module/base-control/index.native.js +5 -6
  712. package/build-module/base-control/index.native.js.map +1 -1
  713. package/build-module/base-control/styles/base-control-styles.js +6 -8
  714. package/build-module/base-control/styles/base-control-styles.js.map +1 -1
  715. package/build-module/border-box-control/border-box-control/hook.js +5 -5
  716. package/build-module/border-box-control/border-box-control/hook.js.map +1 -1
  717. package/build-module/border-box-control/border-box-control-split-controls/component.js +4 -4
  718. package/build-module/border-box-control/border-box-control-split-controls/component.js.map +1 -1
  719. package/build-module/border-box-control/styles.js +3 -3
  720. package/build-module/border-box-control/styles.js.map +1 -1
  721. package/build-module/border-box-control/utils.js +5 -8
  722. package/build-module/border-box-control/utils.js.map +1 -1
  723. package/build-module/border-control/border-control/component.js +1 -1
  724. package/build-module/border-control/border-control/component.js.map +1 -1
  725. package/build-module/border-control/border-control/hook.js +5 -5
  726. package/build-module/border-control/border-control/hook.js.map +1 -1
  727. package/build-module/border-control/border-control-dropdown/component.js +70 -67
  728. package/build-module/border-control/border-control-dropdown/component.js.map +1 -1
  729. package/build-module/border-control/border-control-dropdown/hook.js +4 -4
  730. package/build-module/border-control/border-control-dropdown/hook.js.map +1 -1
  731. package/build-module/box-control/all-input-control.js +11 -12
  732. package/build-module/box-control/all-input-control.js.map +1 -1
  733. package/build-module/box-control/axial-input-controls.js +12 -14
  734. package/build-module/box-control/axial-input-controls.js.map +1 -1
  735. package/build-module/box-control/icon.js +7 -9
  736. package/build-module/box-control/icon.js.map +1 -1
  737. package/build-module/box-control/index.js +22 -24
  738. package/build-module/box-control/index.js.map +1 -1
  739. package/build-module/box-control/input-controls.js +15 -18
  740. package/build-module/box-control/input-controls.js.map +1 -1
  741. package/build-module/box-control/linked-button.js +4 -5
  742. package/build-module/box-control/linked-button.js.map +1 -1
  743. package/build-module/box-control/styles/box-control-icon-styles.js +3 -4
  744. package/build-module/box-control/styles/box-control-icon-styles.js.map +1 -1
  745. package/build-module/box-control/styles/box-control-styles.js +9 -12
  746. package/build-module/box-control/styles/box-control-styles.js.map +1 -1
  747. package/build-module/box-control/styles/box-control-visualizer-styles.js +7 -11
  748. package/build-module/box-control/styles/box-control-visualizer-styles.js.map +1 -1
  749. package/build-module/box-control/unit-control.js +18 -22
  750. package/build-module/box-control/unit-control.js.map +1 -1
  751. package/build-module/box-control/utils.js +4 -10
  752. package/build-module/box-control/utils.js.map +1 -1
  753. package/build-module/button/deprecated.js +7 -8
  754. package/build-module/button/deprecated.js.map +1 -1
  755. package/build-module/button/index.js +15 -16
  756. package/build-module/button/index.js.map +1 -1
  757. package/build-module/button/index.native.js +5 -7
  758. package/build-module/button/index.native.js.map +1 -1
  759. package/build-module/card/card/hook.js +5 -6
  760. package/build-module/card/card/hook.js.map +1 -1
  761. package/build-module/circular-option-picker/index.js +27 -33
  762. package/build-module/circular-option-picker/index.js.map +1 -1
  763. package/build-module/clipboard-button/index.js +8 -9
  764. package/build-module/clipboard-button/index.js.map +1 -1
  765. package/build-module/color-control/index.native.js +7 -8
  766. package/build-module/color-control/index.native.js.map +1 -1
  767. package/build-module/color-indicator/index.native.js +10 -12
  768. package/build-module/color-indicator/index.native.js.map +1 -1
  769. package/build-module/color-palette/index.js +63 -72
  770. package/build-module/color-palette/index.js.map +1 -1
  771. package/build-module/color-palette/index.native.js +33 -47
  772. package/build-module/color-palette/index.native.js.map +1 -1
  773. package/build-module/color-palette/utils.js +2 -5
  774. package/build-module/color-palette/utils.js.map +1 -1
  775. package/build-module/color-picker/color-input.js +6 -7
  776. package/build-module/color-picker/color-input.js.map +1 -1
  777. package/build-module/color-picker/hex-input.js +8 -12
  778. package/build-module/color-picker/hex-input.js.map +1 -1
  779. package/build-module/color-picker/hsl-input.js +5 -6
  780. package/build-module/color-picker/hsl-input.js.map +1 -1
  781. package/build-module/color-picker/index.native.js +23 -30
  782. package/build-module/color-picker/index.native.js.map +1 -1
  783. package/build-module/color-picker/input-with-slider.js +8 -10
  784. package/build-module/color-picker/input-with-slider.js.map +1 -1
  785. package/build-module/color-picker/picker.js +5 -6
  786. package/build-module/color-picker/picker.js.map +1 -1
  787. package/build-module/color-picker/rgb-input.js +5 -6
  788. package/build-module/color-picker/rgb-input.js.map +1 -1
  789. package/build-module/color-picker/styles.js +8 -8
  790. package/build-module/color-picker/styles.js.map +1 -1
  791. package/build-module/color-picker/use-deprecated-props.js +1 -3
  792. package/build-module/color-picker/use-deprecated-props.js.map +1 -1
  793. package/build-module/combobox-control/index.js +3 -6
  794. package/build-module/combobox-control/index.js.map +1 -1
  795. package/build-module/combobox-control/styles.js +3 -6
  796. package/build-module/combobox-control/styles.js.map +1 -1
  797. package/build-module/confirm-dialog/component.js +1 -1
  798. package/build-module/confirm-dialog/component.js.map +1 -1
  799. package/build-module/custom-gradient-picker/gradient-bar/control-points.js +114 -129
  800. package/build-module/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
  801. package/build-module/custom-gradient-picker/gradient-bar/index.js +12 -14
  802. package/build-module/custom-gradient-picker/gradient-bar/index.js.map +1 -1
  803. package/build-module/custom-gradient-picker/gradient-bar/utils.js +4 -6
  804. package/build-module/custom-gradient-picker/gradient-bar/utils.js.map +1 -1
  805. package/build-module/custom-gradient-picker/index.js +19 -22
  806. package/build-module/custom-gradient-picker/index.js.map +1 -1
  807. package/build-module/custom-gradient-picker/index.native.js +7 -8
  808. package/build-module/custom-gradient-picker/index.native.js.map +1 -1
  809. package/build-module/custom-gradient-picker/serializer.js +15 -21
  810. package/build-module/custom-gradient-picker/serializer.js.map +1 -1
  811. package/build-module/custom-gradient-picker/utils.js +6 -9
  812. package/build-module/custom-gradient-picker/utils.js.map +1 -1
  813. package/build-module/custom-select-control/index.js +14 -21
  814. package/build-module/custom-select-control/index.js.map +1 -1
  815. package/build-module/dashicon/index.js +7 -8
  816. package/build-module/dashicon/index.js.map +1 -1
  817. package/build-module/dashicon/index.native.js +4 -5
  818. package/build-module/dashicon/index.native.js.map +1 -1
  819. package/build-module/date-time/date/index.js +24 -26
  820. package/build-module/date-time/date/index.js.map +1 -1
  821. package/build-module/date-time/date-time/index.js +14 -90
  822. package/build-module/date-time/date-time/index.js.map +1 -1
  823. package/build-module/date-time/date-time/styles.js +3 -17
  824. package/build-module/date-time/date-time/styles.js.map +1 -1
  825. package/build-module/date-time/time/index.js +11 -14
  826. package/build-module/date-time/time/index.js.map +1 -1
  827. package/build-module/dimension-control/index.js +8 -11
  828. package/build-module/dimension-control/index.js.map +1 -1
  829. package/build-module/disabled/index.js +6 -7
  830. package/build-module/disabled/index.js.map +1 -1
  831. package/build-module/disabled/index.native.js +3 -4
  832. package/build-module/disabled/index.native.js.map +1 -1
  833. package/build-module/divider/styles.js +21 -29
  834. package/build-module/divider/styles.js.map +1 -1
  835. package/build-module/draggable/index.js +14 -19
  836. package/build-module/draggable/index.js.map +1 -1
  837. package/build-module/draggable/index.native.js +17 -19
  838. package/build-module/draggable/index.native.js.map +1 -1
  839. package/build-module/drop-zone/index.js +11 -16
  840. package/build-module/drop-zone/index.js.map +1 -1
  841. package/build-module/drop-zone/provider.js +3 -4
  842. package/build-module/drop-zone/provider.js.map +1 -1
  843. package/build-module/dropdown/index.js +19 -23
  844. package/build-module/dropdown/index.js.map +1 -1
  845. package/build-module/dropdown/styles.js +3 -4
  846. package/build-module/dropdown/styles.js.map +1 -1
  847. package/build-module/dropdown-menu/index.js +96 -25
  848. package/build-module/dropdown-menu/index.js.map +1 -1
  849. package/build-module/dropdown-menu/index.native.js +22 -30
  850. package/build-module/dropdown-menu/index.native.js.map +1 -1
  851. package/build-module/dropdown-menu/types.js +2 -0
  852. package/build-module/dropdown-menu/types.js.map +1 -0
  853. package/build-module/dropdown-menu-v2/index.js +182 -0
  854. package/build-module/dropdown-menu-v2/index.js.map +1 -0
  855. package/build-module/dropdown-menu-v2/styles.js +161 -0
  856. package/build-module/dropdown-menu-v2/styles.js.map +1 -0
  857. package/build-module/dropdown-menu-v2/types.js +2 -0
  858. package/build-module/dropdown-menu-v2/types.js.map +1 -0
  859. package/build-module/duotone-picker/color-list-picker/index.js +16 -18
  860. package/build-module/duotone-picker/color-list-picker/index.js.map +1 -1
  861. package/build-module/duotone-picker/custom-duotone-bar.js +4 -5
  862. package/build-module/duotone-picker/custom-duotone-bar.js.map +1 -1
  863. package/build-module/duotone-picker/duotone-picker.js +15 -17
  864. package/build-module/duotone-picker/duotone-picker.js.map +1 -1
  865. package/build-module/duotone-picker/duotone-swatch.js +3 -4
  866. package/build-module/duotone-picker/duotone-swatch.js.map +1 -1
  867. package/build-module/duotone-picker/utils.js +14 -27
  868. package/build-module/duotone-picker/utils.js.map +1 -1
  869. package/build-module/external-link/index.js +1 -1
  870. package/build-module/external-link/index.js.map +1 -1
  871. package/build-module/external-link/index.native.js +4 -5
  872. package/build-module/external-link/index.native.js.map +1 -1
  873. package/build-module/focal-point-picker/controls.js +11 -10
  874. package/build-module/focal-point-picker/controls.js.map +1 -1
  875. package/build-module/focal-point-picker/focal-point.js +5 -6
  876. package/build-module/focal-point-picker/focal-point.js.map +1 -1
  877. package/build-module/focal-point-picker/focal-point.native.js +5 -6
  878. package/build-module/focal-point-picker/focal-point.native.js.map +1 -1
  879. package/build-module/focal-point-picker/grid.js +4 -5
  880. package/build-module/focal-point-picker/grid.js.map +1 -1
  881. package/build-module/focal-point-picker/index.js +33 -37
  882. package/build-module/focal-point-picker/index.js.map +1 -1
  883. package/build-module/focal-point-picker/index.native.js +10 -12
  884. package/build-module/focal-point-picker/index.native.js.map +1 -1
  885. package/build-module/focal-point-picker/media.js +11 -13
  886. package/build-module/focal-point-picker/media.js.map +1 -1
  887. package/build-module/focal-point-picker/styles/focal-point-picker-style.js +9 -14
  888. package/build-module/focal-point-picker/styles/focal-point-picker-style.js.map +1 -1
  889. package/build-module/focal-point-picker/styles/focal-point-style.js +3 -6
  890. package/build-module/focal-point-picker/styles/focal-point-style.js.map +1 -1
  891. package/build-module/focal-point-picker/tooltip/index.native.js +16 -21
  892. package/build-module/focal-point-picker/tooltip/index.native.js.map +1 -1
  893. package/build-module/focal-point-picker/utils.js +2 -4
  894. package/build-module/focal-point-picker/utils.js.map +1 -1
  895. package/build-module/focusable-iframe/index.js +4 -5
  896. package/build-module/focusable-iframe/index.js.map +1 -1
  897. package/build-module/font-size-picker/font-size-picker-select.js +3 -5
  898. package/build-module/font-size-picker/font-size-picker-select.js.map +1 -1
  899. package/build-module/font-size-picker/index.js +14 -18
  900. package/build-module/font-size-picker/index.js.map +1 -1
  901. package/build-module/font-size-picker/index.native.js +6 -7
  902. package/build-module/font-size-picker/index.native.js.map +1 -1
  903. package/build-module/font-size-picker/styles.js +20 -7
  904. package/build-module/font-size-picker/styles.js.map +1 -1
  905. package/build-module/footer-message-control/index.native.js +2 -3
  906. package/build-module/footer-message-control/index.native.js.map +1 -1
  907. package/build-module/form-file-upload/index.js +10 -13
  908. package/build-module/form-file-upload/index.js.map +1 -1
  909. package/build-module/form-token-field/index.js +4 -19
  910. package/build-module/form-token-field/index.js.map +1 -1
  911. package/build-module/form-token-field/styles.js +4 -7
  912. package/build-module/form-token-field/styles.js.map +1 -1
  913. package/build-module/form-token-field/suggestions-list.js +14 -15
  914. package/build-module/form-token-field/suggestions-list.js.map +1 -1
  915. package/build-module/form-token-field/token-input.js +2 -2
  916. package/build-module/form-token-field/token-input.js.map +1 -1
  917. package/build-module/form-token-field/token.js +14 -15
  918. package/build-module/form-token-field/token.js.map +1 -1
  919. package/build-module/gradient-picker/index.js +51 -58
  920. package/build-module/gradient-picker/index.js.map +1 -1
  921. package/build-module/guide/icons.js +13 -16
  922. package/build-module/guide/icons.js.map +1 -1
  923. package/build-module/guide/index.js +9 -12
  924. package/build-module/guide/index.js.map +1 -1
  925. package/build-module/guide/page-control.js +5 -6
  926. package/build-module/guide/page-control.js.map +1 -1
  927. package/build-module/h-stack/utils.js +1 -3
  928. package/build-module/h-stack/utils.js.map +1 -1
  929. package/build-module/higher-order/navigate-regions/index.js +16 -22
  930. package/build-module/higher-order/navigate-regions/index.js.map +1 -1
  931. package/build-module/higher-order/with-focus-outside/index.js +1 -1
  932. package/build-module/higher-order/with-focus-outside/index.js.map +1 -1
  933. package/build-module/higher-order/with-focus-outside/index.native.js +1 -1
  934. package/build-module/higher-order/with-focus-outside/index.native.js.map +1 -1
  935. package/build-module/higher-order/with-focus-return/index.js +13 -17
  936. package/build-module/higher-order/with-focus-return/index.js.map +1 -1
  937. package/build-module/icon/index.js +5 -7
  938. package/build-module/icon/index.js.map +1 -1
  939. package/build-module/index.native.js +0 -1
  940. package/build-module/index.native.js.map +1 -1
  941. package/build-module/input-control/backdrop.js +4 -5
  942. package/build-module/input-control/backdrop.js.map +1 -1
  943. package/build-module/input-control/index.js +22 -23
  944. package/build-module/input-control/index.js.map +1 -1
  945. package/build-module/input-control/input-base.js +16 -17
  946. package/build-module/input-control/input-base.js.map +1 -1
  947. package/build-module/input-control/input-field.js +26 -29
  948. package/build-module/input-control/input-field.js.map +1 -1
  949. package/build-module/input-control/label.js +6 -7
  950. package/build-module/input-control/label.js.map +1 -1
  951. package/build-module/input-control/reducer/reducer.js +2 -6
  952. package/build-module/input-control/reducer/reducer.js.map +1 -1
  953. package/build-module/input-control/styles/input-control-styles.js +62 -64
  954. package/build-module/input-control/styles/input-control-styles.js.map +1 -1
  955. package/build-module/input-control/utils.js +1 -3
  956. package/build-module/input-control/utils.js.map +1 -1
  957. package/build-module/keyboard-shortcuts/index.js +21 -26
  958. package/build-module/keyboard-shortcuts/index.js.map +1 -1
  959. package/build-module/menu-items-choice/index.js +6 -7
  960. package/build-module/menu-items-choice/index.js.map +1 -1
  961. package/build-module/mobile/audio-player/index.native.js +7 -8
  962. package/build-module/mobile/audio-player/index.native.js.map +1 -1
  963. package/build-module/mobile/badge/index.native.js +5 -6
  964. package/build-module/mobile/badge/index.native.js.map +1 -1
  965. package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js +10 -12
  966. package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js.map +1 -1
  967. package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js +10 -13
  968. package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js.map +1 -1
  969. package/build-module/mobile/bottom-sheet/button.native.js +18 -21
  970. package/build-module/mobile/bottom-sheet/button.native.js.map +1 -1
  971. package/build-module/mobile/bottom-sheet/cell.native.js +22 -11
  972. package/build-module/mobile/bottom-sheet/cell.native.js.map +1 -1
  973. package/build-module/mobile/bottom-sheet/color-cell.native.js +3 -1
  974. package/build-module/mobile/bottom-sheet/color-cell.native.js.map +1 -1
  975. package/build-module/mobile/bottom-sheet/footer-message-cell.native.js +4 -5
  976. package/build-module/mobile/bottom-sheet/footer-message-cell.native.js.map +1 -1
  977. package/build-module/mobile/bottom-sheet/footer-message-link/footer-message-link.native.js +4 -5
  978. package/build-module/mobile/bottom-sheet/footer-message-link/footer-message-link.native.js.map +1 -1
  979. package/build-module/mobile/bottom-sheet/index.native.js +19 -30
  980. package/build-module/mobile/bottom-sheet/index.native.js.map +1 -1
  981. package/build-module/mobile/bottom-sheet/link-cell.native.js +6 -7
  982. package/build-module/mobile/bottom-sheet/link-cell.native.js.map +1 -1
  983. package/build-module/mobile/bottom-sheet/link-suggestion-item-cell.native.js +5 -6
  984. package/build-module/mobile/bottom-sheet/link-suggestion-item-cell.native.js.map +1 -1
  985. package/build-module/mobile/bottom-sheet/lock-icon/index.native.js +21 -0
  986. package/build-module/mobile/bottom-sheet/lock-icon/index.native.js.map +1 -0
  987. package/build-module/mobile/bottom-sheet/nav-bar/action-button.native.js +6 -7
  988. package/build-module/mobile/bottom-sheet/nav-bar/action-button.native.js.map +1 -1
  989. package/build-module/mobile/bottom-sheet/nav-bar/apply-button.native.js +3 -4
  990. package/build-module/mobile/bottom-sheet/nav-bar/apply-button.native.js.map +1 -1
  991. package/build-module/mobile/bottom-sheet/nav-bar/back-button.native.js +12 -15
  992. package/build-module/mobile/bottom-sheet/nav-bar/back-button.native.js.map +1 -1
  993. package/build-module/mobile/bottom-sheet/nav-bar/heading.native.js +3 -4
  994. package/build-module/mobile/bottom-sheet/nav-bar/heading.native.js.map +1 -1
  995. package/build-module/mobile/bottom-sheet/nav-bar/index.native.js +3 -4
  996. package/build-module/mobile/bottom-sheet/nav-bar/index.native.js.map +1 -1
  997. package/build-module/mobile/bottom-sheet/radio-cell.native.js +3 -2
  998. package/build-module/mobile/bottom-sheet/radio-cell.native.js.map +1 -1
  999. package/build-module/mobile/bottom-sheet/range-cell.native.js +6 -3
  1000. package/build-module/mobile/bottom-sheet/range-cell.native.js.map +1 -1
  1001. package/build-module/mobile/bottom-sheet/range-text-input.native.js +5 -6
  1002. package/build-module/mobile/bottom-sheet/range-text-input.native.js.map +1 -1
  1003. package/build-module/mobile/bottom-sheet/ripple.native.js +10 -11
  1004. package/build-module/mobile/bottom-sheet/ripple.native.js.map +1 -1
  1005. package/build-module/mobile/bottom-sheet/stepper-cell/index.native.js +5 -4
  1006. package/build-module/mobile/bottom-sheet/stepper-cell/index.native.js.map +1 -1
  1007. package/build-module/mobile/bottom-sheet/stepper-cell/stepper.android.js +11 -12
  1008. package/build-module/mobile/bottom-sheet/stepper-cell/stepper.android.js.map +1 -1
  1009. package/build-module/mobile/bottom-sheet/stepper-cell/stepper.ios.js +11 -12
  1010. package/build-module/mobile/bottom-sheet/stepper-cell/stepper.ios.js.map +1 -1
  1011. package/build-module/mobile/bottom-sheet/sub-sheet/index.native.js +6 -7
  1012. package/build-module/mobile/bottom-sheet/sub-sheet/index.native.js.map +1 -1
  1013. package/build-module/mobile/bottom-sheet/switch-cell.native.js +7 -2
  1014. package/build-module/mobile/bottom-sheet/switch-cell.native.js.map +1 -1
  1015. package/build-module/mobile/bottom-sheet-select-control/index.native.js +11 -10
  1016. package/build-module/mobile/bottom-sheet-select-control/index.native.js.map +1 -1
  1017. package/build-module/mobile/bottom-sheet-text-control/index.native.js +13 -12
  1018. package/build-module/mobile/bottom-sheet-text-control/index.native.js.map +1 -1
  1019. package/build-module/mobile/color-settings/index.native.js +12 -13
  1020. package/build-module/mobile/color-settings/index.native.js.map +1 -1
  1021. package/build-module/mobile/color-settings/utils.native.js +2 -2
  1022. package/build-module/mobile/color-settings/utils.native.js.map +1 -1
  1023. package/build-module/mobile/cycle-select-control/index.native.js +11 -12
  1024. package/build-module/mobile/cycle-select-control/index.native.js.map +1 -1
  1025. package/build-module/mobile/focal-point-settings-panel/index.native.js +6 -7
  1026. package/build-module/mobile/focal-point-settings-panel/index.native.js.map +1 -1
  1027. package/build-module/mobile/global-styles-context/index.native.js +6 -14
  1028. package/build-module/mobile/global-styles-context/index.native.js.map +1 -1
  1029. package/build-module/mobile/global-styles-context/utils.native.js +69 -112
  1030. package/build-module/mobile/global-styles-context/utils.native.js.map +1 -1
  1031. package/build-module/mobile/gradient/index.native.js +26 -33
  1032. package/build-module/mobile/gradient/index.native.js.map +1 -1
  1033. package/build-module/mobile/html-text-input/index.native.js +3 -3
  1034. package/build-module/mobile/html-text-input/index.native.js.map +1 -1
  1035. package/build-module/mobile/image/image-editing-button.native.js +22 -26
  1036. package/build-module/mobile/image/image-editing-button.native.js.map +1 -1
  1037. package/build-module/mobile/image/index.native.js +31 -34
  1038. package/build-module/mobile/image/index.native.js.map +1 -1
  1039. package/build-module/mobile/keyboard-avoiding-view/index.ios.js +22 -29
  1040. package/build-module/mobile/keyboard-avoiding-view/index.ios.js.map +1 -1
  1041. package/build-module/mobile/keyboard-aware-flat-list/index.android.js +5 -6
  1042. package/build-module/mobile/keyboard-aware-flat-list/index.android.js.map +1 -1
  1043. package/build-module/mobile/keyboard-aware-flat-list/index.ios.js +9 -10
  1044. package/build-module/mobile/keyboard-aware-flat-list/index.ios.js.map +1 -1
  1045. package/build-module/mobile/keyboard-aware-flat-list/use-keyboard-offset.native.js +9 -14
  1046. package/build-module/mobile/keyboard-aware-flat-list/use-keyboard-offset.native.js.map +1 -1
  1047. package/build-module/mobile/layout-animation/index.native.js +1 -2
  1048. package/build-module/mobile/layout-animation/index.native.js.map +1 -1
  1049. package/build-module/mobile/link-picker/index.native.js +12 -16
  1050. package/build-module/mobile/link-picker/index.native.js.map +1 -1
  1051. package/build-module/mobile/link-picker/link-picker-results.native.js +34 -48
  1052. package/build-module/mobile/link-picker/link-picker-results.native.js.map +1 -1
  1053. package/build-module/mobile/link-picker/link-picker-screen.native.js +7 -9
  1054. package/build-module/mobile/link-picker/link-picker-screen.native.js.map +1 -1
  1055. package/build-module/mobile/link-settings/image-link-destinations-screen.native.js +8 -9
  1056. package/build-module/mobile/link-settings/image-link-destinations-screen.native.js.map +1 -1
  1057. package/build-module/mobile/link-settings/index.native.js +57 -58
  1058. package/build-module/mobile/link-settings/index.native.js.map +1 -1
  1059. package/build-module/mobile/media-edit/index.native.js +2 -2
  1060. package/build-module/mobile/media-edit/index.native.js.map +1 -1
  1061. package/build-module/mobile/picker/index.ios.js +3 -6
  1062. package/build-module/mobile/picker/index.ios.js.map +1 -1
  1063. package/build-module/mobile/segmented-control/index.native.js +16 -20
  1064. package/build-module/mobile/segmented-control/index.native.js.map +1 -1
  1065. package/build-module/mobile/utils/alignments.native.js +2 -6
  1066. package/build-module/mobile/utils/alignments.native.js.map +1 -1
  1067. package/build-module/mobile/utils/index.native.js +1 -2
  1068. package/build-module/mobile/utils/index.native.js.map +1 -1
  1069. package/build-module/mobile/utils/use-unit-converter-to-mobile.native.js +4 -7
  1070. package/build-module/mobile/utils/use-unit-converter-to-mobile.native.js.map +1 -1
  1071. package/build-module/modal/index.js +3 -4
  1072. package/build-module/modal/index.js.map +1 -1
  1073. package/build-module/navigable-container/container.js +2 -6
  1074. package/build-module/navigable-container/container.js.map +1 -1
  1075. package/build-module/navigable-container/menu.js +5 -7
  1076. package/build-module/navigable-container/menu.js.map +1 -1
  1077. package/build-module/navigable-container/tabbable.js +4 -6
  1078. package/build-module/navigable-container/tabbable.js.map +1 -1
  1079. package/build-module/navigation/back-button/index.js +8 -11
  1080. package/build-module/navigation/back-button/index.js.map +1 -1
  1081. package/build-module/navigation/group/index.js +5 -6
  1082. package/build-module/navigation/group/index.js.map +1 -1
  1083. package/build-module/navigation/index.js +8 -11
  1084. package/build-module/navigation/index.js.map +1 -1
  1085. package/build-module/navigation/item/base.js +1 -3
  1086. package/build-module/navigation/item/base.js.map +1 -1
  1087. package/build-module/navigation/menu/menu-title-search.js +11 -14
  1088. package/build-module/navigation/menu/menu-title-search.js.map +1 -1
  1089. package/build-module/navigation/menu/menu-title.js +8 -11
  1090. package/build-module/navigation/menu/menu-title.js.map +1 -1
  1091. package/build-module/navigation/menu/search-no-results-found.js +3 -4
  1092. package/build-module/navigation/menu/search-no-results-found.js.map +1 -1
  1093. package/build-module/navigator/navigator-back-button/hook.js +1 -1
  1094. package/build-module/navigator/navigator-back-button/hook.js.map +1 -1
  1095. package/build-module/navigator/navigator-button/hook.js +1 -1
  1096. package/build-module/navigator/navigator-button/hook.js.map +1 -1
  1097. package/build-module/navigator/navigator-provider/component.js +2 -6
  1098. package/build-module/navigator/navigator-provider/component.js.map +1 -1
  1099. package/build-module/navigator/navigator-screen/component.js +1 -1
  1100. package/build-module/navigator/navigator-screen/component.js.map +1 -1
  1101. package/build-module/notice/index.js +25 -29
  1102. package/build-module/notice/index.js.map +1 -1
  1103. package/build-module/notice/index.native.js +13 -18
  1104. package/build-module/notice/index.native.js.map +1 -1
  1105. package/build-module/notice/list.js +6 -8
  1106. package/build-module/notice/list.js.map +1 -1
  1107. package/build-module/number-control/index.js +24 -26
  1108. package/build-module/number-control/index.js.map +1 -1
  1109. package/build-module/number-control/styles/number-control-styles.js +6 -10
  1110. package/build-module/number-control/styles/number-control-styles.js.map +1 -1
  1111. package/build-module/palette-edit/index.js +83 -94
  1112. package/build-module/palette-edit/index.js.map +1 -1
  1113. package/build-module/panel/actions.native.js +8 -10
  1114. package/build-module/panel/actions.native.js.map +1 -1
  1115. package/build-module/panel/body.js +7 -10
  1116. package/build-module/panel/body.js.map +1 -1
  1117. package/build-module/panel/body.native.js +6 -7
  1118. package/build-module/panel/body.native.js.map +1 -1
  1119. package/build-module/panel/bottom-separator-cover.native.js +3 -4
  1120. package/build-module/panel/bottom-separator-cover.native.js.map +1 -1
  1121. package/build-module/panel/header.js +4 -5
  1122. package/build-module/panel/header.js.map +1 -1
  1123. package/build-module/panel/index.js +5 -6
  1124. package/build-module/panel/index.js.map +1 -1
  1125. package/build-module/panel/row.js +4 -5
  1126. package/build-module/panel/row.js.map +1 -1
  1127. package/build-module/popover/index.js +25 -31
  1128. package/build-module/popover/index.js.map +1 -1
  1129. package/build-module/popover/limit-shift.js +66 -71
  1130. package/build-module/popover/limit-shift.js.map +1 -1
  1131. package/build-module/popover/overlay-middlewares.js +7 -9
  1132. package/build-module/popover/overlay-middlewares.js.map +1 -1
  1133. package/build-module/popover/utils.js +26 -34
  1134. package/build-module/popover/utils.js.map +1 -1
  1135. package/build-module/private-apis.js +14 -1
  1136. package/build-module/private-apis.js.map +1 -1
  1137. package/build-module/query-controls/author-select.js +7 -8
  1138. package/build-module/query-controls/author-select.js.map +1 -1
  1139. package/build-module/query-controls/category-select.js +8 -9
  1140. package/build-module/query-controls/category-select.js.map +1 -1
  1141. package/build-module/query-controls/index.js +16 -17
  1142. package/build-module/query-controls/index.js.map +1 -1
  1143. package/build-module/query-controls/index.native.js +13 -14
  1144. package/build-module/query-controls/index.native.js.map +1 -1
  1145. package/build-module/radio-control/index.js +1 -1
  1146. package/build-module/radio-control/index.js.map +1 -1
  1147. package/build-module/radio-control/index.native.js +6 -7
  1148. package/build-module/radio-control/index.native.js.map +1 -1
  1149. package/build-module/radio-group/index.js +8 -9
  1150. package/build-module/radio-group/index.js.map +1 -1
  1151. package/build-module/radio-group/radio/index.js +5 -6
  1152. package/build-module/radio-group/radio/index.js.map +1 -1
  1153. package/build-module/range-control/index.js +1 -3
  1154. package/build-module/range-control/index.js.map +1 -1
  1155. package/build-module/range-control/index.native.js +23 -22
  1156. package/build-module/range-control/index.native.js.map +1 -1
  1157. package/build-module/range-control/rail.js +7 -9
  1158. package/build-module/range-control/rail.js.map +1 -1
  1159. package/build-module/range-control/styles/range-control-styles.js +37 -52
  1160. package/build-module/range-control/styles/range-control-styles.js.map +1 -1
  1161. package/build-module/range-control/tooltip.js +4 -5
  1162. package/build-module/range-control/tooltip.js.map +1 -1
  1163. package/build-module/resizable-box/index.js +8 -9
  1164. package/build-module/resizable-box/index.js.map +1 -1
  1165. package/build-module/resizable-box/resize-tooltip/index.js +12 -13
  1166. package/build-module/resizable-box/resize-tooltip/index.js.map +1 -1
  1167. package/build-module/resizable-box/resize-tooltip/label.js +6 -7
  1168. package/build-module/resizable-box/resize-tooltip/label.js.map +1 -1
  1169. package/build-module/resizable-box/resize-tooltip/utils.js +16 -19
  1170. package/build-module/resizable-box/resize-tooltip/utils.js.map +1 -1
  1171. package/build-module/responsive-wrapper/index.js +6 -8
  1172. package/build-module/responsive-wrapper/index.js.map +1 -1
  1173. package/build-module/sandbox/index.js +16 -23
  1174. package/build-module/sandbox/index.js.map +1 -1
  1175. package/build-module/sandbox/index.native.js +20 -26
  1176. package/build-module/sandbox/index.native.js.map +1 -1
  1177. package/build-module/search-control/index.js +14 -17
  1178. package/build-module/search-control/index.js.map +1 -1
  1179. package/build-module/search-control/index.native.js +7 -8
  1180. package/build-module/search-control/index.native.js.map +1 -1
  1181. package/build-module/select-control/index.js +9 -19
  1182. package/build-module/select-control/index.js.map +1 -1
  1183. package/build-module/select-control/index.native.js +11 -12
  1184. package/build-module/select-control/index.native.js.map +1 -1
  1185. package/build-module/select-control/styles/select-control-styles.js +19 -25
  1186. package/build-module/select-control/styles/select-control-styles.js.map +1 -1
  1187. package/build-module/slot-fill/bubbles-virtually/fill.js +4 -5
  1188. package/build-module/slot-fill/bubbles-virtually/fill.js.map +1 -1
  1189. package/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js +4 -7
  1190. package/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js.map +1 -1
  1191. package/build-module/slot-fill/bubbles-virtually/slot.js +6 -7
  1192. package/build-module/slot-fill/bubbles-virtually/slot.js.map +1 -1
  1193. package/build-module/slot-fill/fill.js +4 -5
  1194. package/build-module/slot-fill/fill.js.map +1 -1
  1195. package/build-module/slot-fill/index.js +8 -11
  1196. package/build-module/slot-fill/index.js.map +1 -1
  1197. package/build-module/slot-fill/index.native.js +4 -5
  1198. package/build-module/slot-fill/index.native.js.map +1 -1
  1199. package/build-module/slot-fill/provider.js +2 -2
  1200. package/build-module/slot-fill/provider.js.map +1 -1
  1201. package/build-module/slot-fill/slot.js +9 -12
  1202. package/build-module/slot-fill/slot.js.map +1 -1
  1203. package/build-module/snackbar/index.js +26 -31
  1204. package/build-module/snackbar/index.js.map +1 -1
  1205. package/build-module/snackbar/list.js +7 -8
  1206. package/build-module/snackbar/list.js.map +1 -1
  1207. package/build-module/spinner/index.js +4 -5
  1208. package/build-module/spinner/index.js.map +1 -1
  1209. package/build-module/style-provider/index.native.js +3 -4
  1210. package/build-module/style-provider/index.native.js.map +1 -1
  1211. package/build-module/surface/styles.js +6 -7
  1212. package/build-module/surface/styles.js.map +1 -1
  1213. package/build-module/tab-panel/index.js +36 -40
  1214. package/build-module/tab-panel/index.js.map +1 -1
  1215. package/build-module/text/styles/text-mixins.native.js +1 -3
  1216. package/build-module/text/styles/text-mixins.native.js.map +1 -1
  1217. package/build-module/text/utils.js +16 -17
  1218. package/build-module/text/utils.js.map +1 -1
  1219. package/build-module/text-control/index.native.js +12 -13
  1220. package/build-module/text-control/index.native.js.map +1 -1
  1221. package/build-module/textarea-control/index.native.js +7 -8
  1222. package/build-module/textarea-control/index.native.js.map +1 -1
  1223. package/build-module/theme/color-algorithms.js +1 -2
  1224. package/build-module/theme/color-algorithms.js.map +1 -1
  1225. package/build-module/theme/index.js +6 -7
  1226. package/build-module/theme/index.js.map +1 -1
  1227. package/build-module/theme/styles.js +4 -8
  1228. package/build-module/theme/styles.js.map +1 -1
  1229. package/build-module/toggle-control/index.js +9 -11
  1230. package/build-module/toggle-control/index.js.map +1 -1
  1231. package/build-module/toggle-control/index.native.js +9 -10
  1232. package/build-module/toggle-control/index.native.js.map +1 -1
  1233. package/build-module/toggle-group-control/toggle-group-control/as-button-group.js +9 -10
  1234. package/build-module/toggle-group-control/toggle-group-control/as-button-group.js.map +1 -1
  1235. package/build-module/toggle-group-control/toggle-group-control/as-radio-group.js +9 -10
  1236. package/build-module/toggle-group-control/toggle-group-control/as-radio-group.js.map +1 -1
  1237. package/build-module/toggle-group-control/toggle-group-control/styles.js +11 -14
  1238. package/build-module/toggle-group-control/toggle-group-control/styles.js.map +1 -1
  1239. package/build-module/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.js +7 -8
  1240. package/build-module/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.js.map +1 -1
  1241. package/build-module/toggle-group-control/toggle-group-control-option-base/component.js +5 -7
  1242. package/build-module/toggle-group-control/toggle-group-control-option-base/component.js.map +1 -1
  1243. package/build-module/toggle-group-control/toggle-group-control-option-base/styles.js +11 -15
  1244. package/build-module/toggle-group-control/toggle-group-control-option-base/styles.js.map +1 -1
  1245. package/build-module/toolbar/toolbar/index.js +20 -8
  1246. package/build-module/toolbar/toolbar/index.js.map +1 -1
  1247. package/build-module/toolbar/toolbar/toolbar-container.js +4 -5
  1248. package/build-module/toolbar/toolbar/toolbar-container.js.map +1 -1
  1249. package/build-module/toolbar/toolbar/toolbar-container.native.js +3 -6
  1250. package/build-module/toolbar/toolbar/toolbar-container.native.js.map +1 -1
  1251. package/build-module/toolbar/toolbar-button/index.js +10 -11
  1252. package/build-module/toolbar/toolbar-button/index.js.map +1 -1
  1253. package/build-module/toolbar/toolbar-button/toolbar-button-container.js +6 -9
  1254. package/build-module/toolbar/toolbar-button/toolbar-button-container.js.map +1 -1
  1255. package/build-module/toolbar/toolbar-group/index.js +9 -12
  1256. package/build-module/toolbar/toolbar-group/index.js.map +1 -1
  1257. package/build-module/toolbar/toolbar-group/toolbar-group-collapsed.js +5 -6
  1258. package/build-module/toolbar/toolbar-group/toolbar-group-collapsed.js.map +1 -1
  1259. package/build-module/toolbar/toolbar-group/toolbar-group-collapsed.native.js +6 -7
  1260. package/build-module/toolbar/toolbar-group/toolbar-group-collapsed.native.js.map +1 -1
  1261. package/build-module/toolbar/toolbar-group/toolbar-group-container.js +7 -10
  1262. package/build-module/toolbar/toolbar-group/toolbar-group-container.js.map +1 -1
  1263. package/build-module/toolbar/toolbar-group/toolbar-group-container.native.js +7 -10
  1264. package/build-module/toolbar/toolbar-group/toolbar-group-container.native.js.map +1 -1
  1265. package/build-module/toolbar/toolbar-item/index.js +5 -6
  1266. package/build-module/toolbar/toolbar-item/index.js.map +1 -1
  1267. package/build-module/toolbar/toolbar-item/index.native.js +4 -6
  1268. package/build-module/toolbar/toolbar-item/index.native.js.map +1 -1
  1269. package/build-module/tools-panel/tools-panel/hook.js +17 -25
  1270. package/build-module/tools-panel/tools-panel/hook.js.map +1 -1
  1271. package/build-module/tools-panel/tools-panel-header/component.js +14 -24
  1272. package/build-module/tools-panel/tools-panel-header/component.js.map +1 -1
  1273. package/build-module/tools-panel/tools-panel-item/hook.js +5 -7
  1274. package/build-module/tools-panel/tools-panel-item/hook.js.map +1 -1
  1275. package/build-module/tooltip/index.js +36 -43
  1276. package/build-module/tooltip/index.js.map +1 -1
  1277. package/build-module/tooltip/index.native.js +14 -19
  1278. package/build-module/tooltip/index.native.js.map +1 -1
  1279. package/build-module/tree-grid/cell.js +5 -6
  1280. package/build-module/tree-grid/cell.js.map +1 -1
  1281. package/build-module/tree-grid/index.js +12 -15
  1282. package/build-module/tree-grid/index.js.map +1 -1
  1283. package/build-module/tree-grid/item.js +4 -5
  1284. package/build-module/tree-grid/item.js.map +1 -1
  1285. package/build-module/tree-grid/roving-tab-index-item.js +6 -7
  1286. package/build-module/tree-grid/roving-tab-index-item.js.map +1 -1
  1287. package/build-module/tree-grid/roving-tab-index.js +3 -4
  1288. package/build-module/tree-grid/roving-tab-index.js.map +1 -1
  1289. package/build-module/tree-grid/row.js +8 -9
  1290. package/build-module/tree-grid/row.js.map +1 -1
  1291. package/build-module/tree-select/index.js +9 -11
  1292. package/build-module/tree-select/index.js.map +1 -1
  1293. package/build-module/truncate/utils.js +1 -3
  1294. package/build-module/truncate/utils.js.map +1 -1
  1295. package/build-module/ui/context/context-connect.js +1 -1
  1296. package/build-module/ui/context/context-connect.js.map +1 -1
  1297. package/build-module/ui/context/context-system-provider.js +7 -9
  1298. package/build-module/ui/context/context-system-provider.js.map +1 -1
  1299. package/build-module/ui/context/index.js +1 -1
  1300. package/build-module/ui/context/index.js.map +1 -1
  1301. package/build-module/ui/context/use-context-system.js +1 -1
  1302. package/build-module/ui/context/use-context-system.js.map +1 -1
  1303. package/build-module/ui/control-group/hook.js +1 -1
  1304. package/build-module/ui/control-group/hook.js.map +1 -1
  1305. package/build-module/ui/form-group/form-group-content.js +12 -13
  1306. package/build-module/ui/form-group/form-group-content.js.map +1 -1
  1307. package/build-module/ui/form-group/form-group-help.js +3 -4
  1308. package/build-module/ui/form-group/form-group-help.js.map +1 -1
  1309. package/build-module/ui/form-group/form-group-label.js +7 -8
  1310. package/build-module/ui/form-group/form-group-label.js.map +1 -1
  1311. package/build-module/ui/tooltip/component.js +1 -1
  1312. package/build-module/ui/tooltip/component.js.map +1 -1
  1313. package/build-module/ui/utils/colors.js +1 -3
  1314. package/build-module/ui/utils/colors.js.map +1 -1
  1315. package/build-module/ui/utils/font-size.js +2 -6
  1316. package/build-module/ui/utils/font-size.js.map +1 -1
  1317. package/build-module/ui/utils/get-high-dpi.js +1 -5
  1318. package/build-module/ui/utils/get-high-dpi.js.map +1 -1
  1319. package/build-module/ui/utils/space.js +1 -3
  1320. package/build-module/ui/utils/space.js.map +1 -1
  1321. package/build-module/ui/utils/use-responsive-value.js +2 -4
  1322. package/build-module/ui/utils/use-responsive-value.js.map +1 -1
  1323. package/build-module/unit-control/index.js +8 -8
  1324. package/build-module/unit-control/index.js.map +1 -1
  1325. package/build-module/unit-control/index.native.js +22 -23
  1326. package/build-module/unit-control/index.native.js.map +1 -1
  1327. package/build-module/unit-control/styles/unit-control-styles.js +6 -8
  1328. package/build-module/unit-control/styles/unit-control-styles.js.map +1 -1
  1329. package/build-module/unit-control/unit-select-control.js +11 -13
  1330. package/build-module/unit-control/unit-select-control.js.map +1 -1
  1331. package/build-module/unit-control/utils.js +12 -19
  1332. package/build-module/unit-control/utils.js.map +1 -1
  1333. package/build-module/utils/browsers.js +2 -10
  1334. package/build-module/utils/browsers.js.map +1 -1
  1335. package/build-module/utils/colors.js +1 -3
  1336. package/build-module/utils/colors.js.map +1 -1
  1337. package/build-module/utils/config-values.js +1 -0
  1338. package/build-module/utils/config-values.js.map +1 -1
  1339. package/build-module/utils/hooks/use-controlled-state.js +1 -2
  1340. package/build-module/utils/hooks/use-controlled-state.js.map +1 -1
  1341. package/build-module/utils/hooks/use-controlled-value.js +5 -6
  1342. package/build-module/utils/hooks/use-controlled-value.js.map +1 -1
  1343. package/build-module/utils/hooks/use-cx.js +1 -5
  1344. package/build-module/utils/hooks/use-cx.js.map +1 -1
  1345. package/build-module/utils/math.js +5 -17
  1346. package/build-module/utils/math.js.map +1 -1
  1347. package/build-module/utils/reduce-motion.js +1 -2
  1348. package/build-module/utils/reduce-motion.js.map +1 -1
  1349. package/build-module/utils/rtl.js +3 -9
  1350. package/build-module/utils/rtl.js.map +1 -1
  1351. package/build-module/utils/values.js +2 -6
  1352. package/build-module/utils/values.js.map +1 -1
  1353. package/build-module/z-stack/styles.js +14 -23
  1354. package/build-module/z-stack/styles.js.map +1 -1
  1355. package/build-style/style-rtl.css +57 -27
  1356. package/build-style/style.css +59 -29
  1357. package/build-types/border-control/border-control-dropdown/component.d.ts.map +1 -1
  1358. package/build-types/button/deprecated.d.ts +6 -0
  1359. package/build-types/button/deprecated.d.ts.map +1 -1
  1360. package/build-types/button/index.d.ts.map +1 -1
  1361. package/build-types/button/stories/e2e/index.d.ts +14 -0
  1362. package/build-types/button/stories/e2e/index.d.ts.map +1 -0
  1363. package/build-types/button/types.d.ts +9 -0
  1364. package/build-types/button/types.d.ts.map +1 -1
  1365. package/build-types/color-palette/index.d.ts.map +1 -1
  1366. package/build-types/color-picker/styles.d.ts.map +1 -1
  1367. package/build-types/date-time/date-time/index.d.ts +3 -4
  1368. package/build-types/date-time/date-time/index.d.ts.map +1 -1
  1369. package/build-types/date-time/date-time/styles.d.ts +0 -4
  1370. package/build-types/date-time/date-time/styles.d.ts.map +1 -1
  1371. package/build-types/date-time/stories/date-time.d.ts.map +1 -1
  1372. package/build-types/date-time/types.d.ts +0 -14
  1373. package/build-types/date-time/types.d.ts.map +1 -1
  1374. package/build-types/dropdown-menu/index.d.ts +83 -1
  1375. package/build-types/dropdown-menu/index.d.ts.map +1 -1
  1376. package/build-types/dropdown-menu/stories/index.d.ts +13 -0
  1377. package/build-types/dropdown-menu/stories/index.d.ts.map +1 -0
  1378. package/build-types/dropdown-menu/test/index.d.ts +2 -0
  1379. package/build-types/dropdown-menu/test/index.d.ts.map +1 -0
  1380. package/build-types/dropdown-menu/types.d.ts +134 -0
  1381. package/build-types/dropdown-menu/types.d.ts.map +1 -0
  1382. package/build-types/dropdown-menu-v2/index.d.ts +17 -0
  1383. package/build-types/dropdown-menu-v2/index.d.ts.map +1 -0
  1384. package/build-types/dropdown-menu-v2/stories/index.d.ts +11 -0
  1385. package/build-types/dropdown-menu-v2/stories/index.d.ts.map +1 -0
  1386. package/build-types/dropdown-menu-v2/styles.d.ts +42 -0
  1387. package/build-types/dropdown-menu-v2/styles.d.ts.map +1 -0
  1388. package/build-types/dropdown-menu-v2/test/index.d.ts +2 -0
  1389. package/build-types/dropdown-menu-v2/test/index.d.ts.map +1 -0
  1390. package/build-types/dropdown-menu-v2/types.d.ts +252 -0
  1391. package/build-types/dropdown-menu-v2/types.d.ts.map +1 -0
  1392. package/build-types/focal-point-picker/controls.d.ts.map +1 -1
  1393. package/build-types/font-size-picker/index.d.ts.map +1 -1
  1394. package/build-types/font-size-picker/styles.d.ts +11 -0
  1395. package/build-types/font-size-picker/styles.d.ts.map +1 -1
  1396. package/build-types/input-control/styles/input-control-styles.d.ts.map +1 -1
  1397. package/build-types/modal/index.d.ts.map +1 -1
  1398. package/build-types/navigator/navigator-back-button/component.d.ts +1 -0
  1399. package/build-types/navigator/navigator-back-button/component.d.ts.map +1 -1
  1400. package/build-types/navigator/navigator-back-button/hook.d.ts +1 -0
  1401. package/build-types/navigator/navigator-back-button/hook.d.ts.map +1 -1
  1402. package/build-types/navigator/navigator-button/component.d.ts +1 -0
  1403. package/build-types/navigator/navigator-button/component.d.ts.map +1 -1
  1404. package/build-types/navigator/navigator-button/hook.d.ts +1 -0
  1405. package/build-types/navigator/navigator-button/hook.d.ts.map +1 -1
  1406. package/build-types/navigator/navigator-to-parent-button/component.d.ts +1 -0
  1407. package/build-types/navigator/navigator-to-parent-button/component.d.ts.map +1 -1
  1408. package/build-types/popover/index.d.ts +6 -0
  1409. package/build-types/popover/index.d.ts.map +1 -1
  1410. package/build-types/private-apis.d.ts.map +1 -1
  1411. package/build-types/tab-panel/index.d.ts +1 -38
  1412. package/build-types/tab-panel/index.d.ts.map +1 -1
  1413. package/build-types/tab-panel/stories/index.d.ts +4 -3
  1414. package/build-types/tab-panel/stories/index.d.ts.map +1 -1
  1415. package/build-types/toggle-group-control/toggle-group-control/styles.d.ts.map +1 -1
  1416. package/build-types/toolbar/stories/index.d.ts.map +1 -1
  1417. package/build-types/toolbar/toolbar/index.d.ts.map +1 -1
  1418. package/build-types/toolbar/toolbar-button/index.d.ts +6 -0
  1419. package/build-types/toolbar/toolbar-button/index.d.ts.map +1 -1
  1420. package/build-types/ui/context/get-styled-class-name-from-key.d.ts +1 -10
  1421. package/build-types/ui/context/get-styled-class-name-from-key.d.ts.map +1 -1
  1422. package/build-types/ui/context/index.d.ts +1 -1
  1423. package/build-types/ui/context/index.d.ts.map +1 -1
  1424. package/build-types/utils/config-values.d.ts +1 -0
  1425. package/package.json +21 -20
  1426. package/src/border-control/border-control-dropdown/component.tsx +23 -12
  1427. package/src/border-control/test/index.js +6 -6
  1428. package/src/button/index.tsx +2 -0
  1429. package/src/button/stories/e2e/index.tsx +58 -0
  1430. package/src/button/style.scss +17 -15
  1431. package/src/button/types.ts +9 -0
  1432. package/src/color-palette/index.tsx +47 -46
  1433. package/src/color-palette/style.scss +57 -19
  1434. package/src/color-palette/test/__snapshots__/index.tsx.snap +66 -50
  1435. package/src/color-palette/test/index.tsx +76 -13
  1436. package/src/color-picker/styles.ts +7 -2
  1437. package/src/date-time/README.md +0 -16
  1438. package/src/date-time/date-time/index.tsx +17 -155
  1439. package/src/date-time/date-time/styles.ts +0 -4
  1440. package/src/date-time/stories/date-time.tsx +0 -4
  1441. package/src/date-time/types.ts +0 -16
  1442. package/src/dropdown-menu/README.md +12 -22
  1443. package/src/dropdown-menu/{index.js → index.tsx} +111 -25
  1444. package/src/dropdown-menu/stories/{index.js → index.tsx} +14 -22
  1445. package/src/dropdown-menu/test/{index.js → index.tsx} +6 -5
  1446. package/src/dropdown-menu/types.ts +143 -0
  1447. package/src/dropdown-menu-v2/README.md +392 -0
  1448. package/src/dropdown-menu-v2/index.tsx +293 -0
  1449. package/src/dropdown-menu-v2/stories/index.tsx +217 -0
  1450. package/src/dropdown-menu-v2/styles.ts +276 -0
  1451. package/src/dropdown-menu-v2/test/index.tsx +816 -0
  1452. package/src/dropdown-menu-v2/types.ts +265 -0
  1453. package/src/focal-point-picker/controls.tsx +2 -0
  1454. package/src/focal-point-picker/test/index.js +9 -3
  1455. package/src/font-size-picker/index.tsx +5 -5
  1456. package/src/font-size-picker/styles.ts +9 -0
  1457. package/src/index.native.js +0 -1
  1458. package/src/input-control/styles/input-control-styles.tsx +7 -0
  1459. package/src/mobile/bottom-sheet/cell.native.js +34 -5
  1460. package/src/mobile/bottom-sheet/color-cell.native.js +3 -2
  1461. package/src/mobile/bottom-sheet/lock-icon/index.native.js +19 -0
  1462. package/src/mobile/bottom-sheet/lock-icon/styles.native.scss +8 -0
  1463. package/src/mobile/bottom-sheet/radio-cell.native.js +2 -1
  1464. package/src/mobile/bottom-sheet/range-cell.native.js +5 -1
  1465. package/src/mobile/bottom-sheet/stepper-cell/index.native.js +2 -0
  1466. package/src/mobile/bottom-sheet/styles.native.scss +15 -1
  1467. package/src/mobile/bottom-sheet/switch-cell.native.js +10 -2
  1468. package/src/mobile/bottom-sheet-select-control/index.native.js +3 -1
  1469. package/src/mobile/bottom-sheet-text-control/index.native.js +3 -1
  1470. package/src/modal/index.tsx +1 -6
  1471. package/src/popover/index.tsx +1 -1
  1472. package/src/private-apis.ts +24 -0
  1473. package/src/range-control/index.native.js +3 -0
  1474. package/src/search-control/style.scss +2 -0
  1475. package/src/slot-fill/README.md +26 -1
  1476. package/src/tab-panel/index.tsx +18 -12
  1477. package/src/toggle-group-control/test/__snapshots__/index.tsx.snap +6 -2
  1478. package/src/toggle-group-control/toggle-group-control/styles.ts +6 -1
  1479. package/src/toolbar/stories/index.tsx +25 -28
  1480. package/src/toolbar/toolbar/index.tsx +24 -7
  1481. package/src/tooltip/style.scss +2 -2
  1482. package/src/ui/context/index.ts +1 -0
  1483. package/src/utils/config-values.js +1 -0
  1484. package/src/view/README.md +2 -2
  1485. package/tsconfig.tsbuildinfo +1 -1
  1486. package/build/mobile/readable-content-view/index.native.js +0 -97
  1487. package/build/mobile/readable-content-view/index.native.js.map +0 -1
  1488. package/build-module/mobile/readable-content-view/index.native.js +0 -81
  1489. package/build-module/mobile/readable-content-view/index.native.js.map +0 -1
  1490. package/src/mobile/readable-content-view/index.native.js +0 -85
  1491. package/src/mobile/readable-content-view/style.native.scss +0 -30
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/tooltip/index.native.js"],"names":["RIGHT_ALIGN_ARROW_OFFSET","TOOLTIP_VERTICAL_OFFSET","TooltipContext","onHandleScreenTouch","Fill","Slot","useKeyboardVisibility","keyboardVisible","setKeyboardVisible","previousKeyboardVisible","showListener","Keyboard","addListener","keyboardHideEvent","Platform","select","android","ios","hideListener","remove","Tooltip","children","position","text","visible","initialVisible","referenceElementRef","animationValue","Animated","Value","current","horizontalPosition","split","setVisible","animating","setAnimating","hidden","previousVisible","referenceLayout","setReferenceLayout","height","width","x","y","tooltipLayout","setTooltipLayout","startAnimation","getReferenceElementPosition","frameListener","timing","toValue","duration","useNativeDriver","delay","easing","Easing","out","quad","start","tooltipStyles","styles","tooltip","left","Math","floor","top","tooltipBoxStyles","tooltip__box","elevation","opacity","shadowColor","tooltip__shadow","color","shadowOffset","shadowOpacity","shadowRadius","transform","translateY","interpolate","inputRange","outputRange","arrowStyles","tooltip__arrow","requestAnimationFrame","measure","_x","_y","pageX","pageY","getTooltipLayout","nativeEvent","layout","ref","onLayout","tooltip__text","TooltipSlot","rest","handleScreenTouch","setHandleScreenTouch","callback","handleTouchStart","value","undefined","StyleSheet","absoluteFill"],"mappings":";;;;;;;;;AAgBA;;AAbA;;AAsBA;;AAKA;;AACA;;AA/BA;AACA;AACA;;AAWA;AACA;AACA;;AAYA;AACA;AACA;AAIA,MAAMA,wBAAwB,GAAG,EAAjC;AACA,MAAMC,uBAAuB,GAAG,CAAhC;AAEA,MAAMC,cAAc,GAAG,4BAAe;AACrCC,EAAAA,mBAAmB,EAAE,MAAM,CAAE;AADQ,CAAf,CAAvB;AAGA,MAAM;AAAEC,EAAAA,IAAF;AAAQC,EAAAA;AAAR,IAAiB,8BAAgB,SAAhB,CAAvB;;AAEA,MAAMC,qBAAqB,GAAG,MAAM;AACnC,QAAM,CAAEC,eAAF,EAAmBC,kBAAnB,IAA0C,uBAAU,KAAV,CAAhD;AACA,QAAMC,uBAAuB,GAAG,0BAAaF,eAAb,CAAhC;AAEA,0BAAW,MAAM;AAChB,UAAMG,YAAY,GAAGC,sBAASC,WAAT,CAAsB,iBAAtB,EAAyC,MAAM;AACnE,UAA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,GAAG,MAAM;AAC9BH,IAAAA,iBAAiB;AACjBC,IAAAA,oBAAoB,CAAE,IAAF,CAApB;AACA,GAHD,CANgD,CAUhD;AACA;AACA;AACA;;;AACA,QAAMG,KAAK,GAAG,sBAAS,OAAQ;AAAElG,IAAAA;AAAF,GAAR,CAAT,CAAd;AAEA,SACC,4BAAC,cAAD,CAAgB,QAAhB;AAAyB,IAAA,KAAK,EAAGkG;AAAjC,KACC,4BAAC,iBAAD;AACC,IAAA,YAAY,EACX,OAAOJ,iBAAP,KAA6B,UAA7B,GACGG,gBADH,GAEGE,SAJL;AAMC,IAAA,aAAa,EAAC,UANf;AAOC,IAAA,KAAK,EAAGC,wBAAWC,YAPpB;AAQC,IAAA,MAAM,EAAC;AARR,KAUGnF,QAVH,EAWC,4BAAC,IAAD,EAAW2E,IAAX,CAXD,CADD,CADD;AAiBA,CAjCD;;AAmCA5E,OAAO,CAACf,IAAR,GAAe0F,WAAf;eAEe3E,O","sourcesContent":["/**\n * External dependencies\n */\nimport {\n\tAnimated,\n\tEasing,\n\tKeyboard,\n\tPlatform,\n\tStyleSheet,\n\tText,\n\tView,\n} from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tcloneElement,\n\tcreateContext,\n\tuseContext,\n\tuseEffect,\n\tuseMemo,\n\tuseRef,\n\tuseState,\n} from '@wordpress/element';\nimport { usePrevious } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { createSlotFill } from '../slot-fill';\nimport styles from './style.scss';\n\nconst RIGHT_ALIGN_ARROW_OFFSET = 16;\nconst TOOLTIP_VERTICAL_OFFSET = 2;\n\nconst TooltipContext = createContext( {\n\tonHandleScreenTouch: () => {},\n} );\nconst { Fill, Slot } = createSlotFill( 'Tooltip' );\n\nconst useKeyboardVisibility = () => {\n\tconst [ keyboardVisible, setKeyboardVisible ] = useState( false );\n\tconst previousKeyboardVisible = usePrevious( keyboardVisible );\n\n\tuseEffect( () => {\n\t\tconst showListener = Keyboard.addListener( 'keyboardDidShow', () => {\n\t\t\tif ( previousKeyboardVisible !== true ) {\n\t\t\t\tsetKeyboardVisible( true );\n\t\t\t}\n\t\t} );\n\t\tconst keyboardHideEvent = Platform.select( {\n\t\t\tandroid: 'keyboardDidHide',\n\t\t\tios: 'keyboardWillHide',\n\t\t} );\n\t\tconst hideListener = Keyboard.addListener( keyboardHideEvent, () => {\n\t\t\tif ( previousKeyboardVisible !== false ) {\n\t\t\t\tsetKeyboardVisible( false );\n\t\t\t}\n\t\t} );\n\t\treturn () => {\n\t\t\tshowListener.remove();\n\t\t\thideListener.remove();\n\t\t};\n\t\t// Disable reason: deferring this refactor to the native team.\n\t\t// see https://github.com/WordPress/gutenberg/pull/41166\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [] );\n\n\treturn keyboardVisible;\n};\n\nconst Tooltip = ( {\n\tchildren,\n\tposition = 'top',\n\ttext,\n\tvisible: initialVisible = false,\n} ) => {\n\tconst referenceElementRef = useRef( null );\n\tconst animationValue = useRef( new Animated.Value( 0 ) ).current;\n\tconst [ , horizontalPosition = 'center' ] = position.split( ' ' );\n\tconst [ visible, setVisible ] = useState( initialVisible );\n\tconst [ animating, setAnimating ] = useState( false );\n\tconst hidden = ! visible && ! animating;\n\tconst previousVisible = usePrevious( visible );\n\tconst [ referenceLayout, setReferenceLayout ] = useState( {\n\t\theight: 0,\n\t\twidth: 0,\n\t\tx: 0,\n\t\ty: 0,\n\t} );\n\tconst [ tooltipLayout, setTooltipLayout ] = useState( {\n\t\theight: 0,\n\t\twidth: 0,\n\t} );\n\tconst { onHandleScreenTouch } = useContext( TooltipContext );\n\tconst keyboardVisible = useKeyboardVisibility();\n\n\t// Register callback to dismiss the tooltip whenever the screen is touched.\n\tuseEffect( () => {\n\t\tif ( visible ) {\n\t\t\tonHandleScreenTouch( () => {\n\t\t\t\tsetAnimating( true );\n\t\t\t\tsetVisible( false );\n\t\t\t} );\n\t\t}\n\t\treturn () => onHandleScreenTouch( null );\n\t\t// Disable reason: deferring this refactor to the native team.\n\t\t// see https://github.com/WordPress/gutenberg/pull/41166\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [ visible ] );\n\n\t// Manage visibility animation.\n\tuseEffect( () => {\n\t\tif (\n\t\t\t// Initial render and visibility enabled, animate show.\n\t\t\t( typeof previousVisible === 'undefined' && visible ) ||\n\t\t\t// Previously visible, animate hide\n\t\t\t( previousVisible && previousVisible !== visible )\n\t\t) {\n\t\t\tsetAnimating( true );\n\t\t\tstartAnimation();\n\t\t}\n\t\t// Disable reason: deferring this refactor to the native team.\n\t\t// see https://github.com/WordPress/gutenberg/pull/41166\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [ visible ] );\n\n\t// Manage tooltip visibility and position in relation to keyboard.\n\tuseEffect( () => {\n\t\tif ( ! visible ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Update tooltip position if keyboard is visible.\n\t\tif ( keyboardVisible ) {\n\t\t\tgetReferenceElementPosition();\n\t\t}\n\n\t\t// Hide tooltip if keyboard hides\n\t\tif ( typeof previousVisible !== 'undefined' && ! keyboardVisible ) {\n\t\t\tsetAnimating( true );\n\t\t\tsetVisible( false );\n\t\t}\n\t\t// Disable reason: deferring this refactor to the native team.\n\t\t// see https://github.com/WordPress/gutenberg/pull/41166\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [ visible, keyboardVisible ] );\n\n\t// Manage tooltip position during keyboard frame changes.\n\tuseEffect( () => {\n\t\tconst frameListener = Keyboard.addListener(\n\t\t\t'keyboardWillChangeFrame',\n\t\t\t() => {\n\t\t\t\tif ( visible ) {\n\t\t\t\t\tgetReferenceElementPosition();\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\treturn () => {\n\t\t\tframeListener.remove();\n\t\t};\n\t}, [ visible ] );\n\n\tconst startAnimation = () => {\n\t\tAnimated.timing( animationValue, {\n\t\t\ttoValue: visible ? 1 : 0,\n\t\t\tduration: visible ? 300 : 150,\n\t\t\tuseNativeDriver: true,\n\t\t\tdelay: visible ? 500 : 0,\n\t\t\teasing: Easing.out( Easing.quad ),\n\t\t} ).start( () => {\n\t\t\tsetAnimating( false );\n\t\t} );\n\t};\n\n\tconst tooltipStyles = [\n\t\tstyles.tooltip,\n\t\t{\n\t\t\tleft:\n\t\t\t\treferenceLayout.x +\n\t\t\t\tMath.floor( referenceLayout.width / 2 ) -\n\t\t\t\t( horizontalPosition === 'right'\n\t\t\t\t\t? RIGHT_ALIGN_ARROW_OFFSET\n\t\t\t\t\t: Math.floor( tooltipLayout.width / 2 ) ),\n\t\t\ttop:\n\t\t\t\treferenceLayout.y -\n\t\t\t\ttooltipLayout.height -\n\t\t\t\tTOOLTIP_VERTICAL_OFFSET,\n\t\t},\n\t];\n\tconst tooltipBoxStyles = [\n\t\tstyles.tooltip__box,\n\t\thorizontalPosition === 'right' && styles[ 'tooltip--rightAlign' ],\n\t\t{\n\t\t\televation: 2,\n\t\t\topacity: animationValue,\n\t\t\tshadowColor: styles.tooltip__shadow?.color,\n\t\t\tshadowOffset: { height: 2, width: 0 },\n\t\t\tshadowOpacity: 0.25,\n\t\t\tshadowRadius: 2,\n\t\t\ttransform: [\n\t\t\t\t{\n\t\t\t\t\ttranslateY: animationValue.interpolate( {\n\t\t\t\t\t\tinputRange: [ 0, 1 ],\n\t\t\t\t\t\toutputRange: [ visible ? 4 : -8, -8 ],\n\t\t\t\t\t} ),\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t];\n\tconst arrowStyles = [\n\t\tstyles.tooltip__arrow,\n\t\thorizontalPosition === 'right' &&\n\t\t\tstyles[ 'tooltip__arrow--rightAlign' ],\n\t];\n\n\tconst getReferenceElementPosition = () => {\n\t\t// rAF allows render to complete before calculating layout\n\t\t// eslint-disable-next-line no-undef\n\t\trequestAnimationFrame( () => {\n\t\t\tif ( ! referenceElementRef.current ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treferenceElementRef.current.measure(\n\t\t\t\t( _x, _y, width, height, pageX, pageY ) => {\n\t\t\t\t\tsetReferenceLayout( {\n\t\t\t\t\t\theight,\n\t\t\t\t\t\twidth,\n\t\t\t\t\t\tx: pageX,\n\t\t\t\t\t\ty: pageY,\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t);\n\t\t} );\n\t};\n\tconst getTooltipLayout = ( { nativeEvent } ) => {\n\t\tconst { height, width } = nativeEvent.layout;\n\t\tsetTooltipLayout( { height, width } );\n\t};\n\n\tif ( hidden ) {\n\t\treturn children;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{ cloneElement( children, {\n\t\t\t\tref: referenceElementRef,\n\t\t\t\tonLayout: getReferenceElementPosition,\n\t\t\t} ) }\n\t\t\t<Fill>\n\t\t\t\t<View onLayout={ getTooltipLayout } style={ tooltipStyles }>\n\t\t\t\t\t<Animated.View style={ tooltipBoxStyles }>\n\t\t\t\t\t\t<Text style={ styles.tooltip__text }>{ text }</Text>\n\t\t\t\t\t\t<View style={ arrowStyles } />\n\t\t\t\t\t</Animated.View>\n\t\t\t\t</View>\n\t\t\t</Fill>\n\t\t</>\n\t);\n};\n\nconst TooltipSlot = ( { children, ...rest } ) => {\n\tconst [ handleScreenTouch, setHandleScreenTouch ] = useState( null );\n\tconst onHandleScreenTouch = ( callback ) => {\n\t\t// Must use function to set state below as `callback` is a function itself.\n\t\tsetHandleScreenTouch( () => callback );\n\t};\n\tconst handleTouchStart = () => {\n\t\thandleScreenTouch();\n\t\tsetHandleScreenTouch( null );\n\t};\n\t// Memoize context value to avoid unnecessary rerenders of the Provider's children\n\t// Disable reason: deferring this refactor to the native team.\n\t// see https://github.com/WordPress/gutenberg/pull/41166\n\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\tconst value = useMemo( () => ( { onHandleScreenTouch } ) );\n\n\treturn (\n\t\t<TooltipContext.Provider value={ value }>\n\t\t\t<View\n\t\t\t\tonTouchStart={\n\t\t\t\t\ttypeof handleScreenTouch === 'function'\n\t\t\t\t\t\t? handleTouchStart\n\t\t\t\t\t\t: undefined\n\t\t\t\t}\n\t\t\t\tpointerEvents=\"box-none\"\n\t\t\t\tstyle={ StyleSheet.absoluteFill }\n\t\t\t\ttestID=\"tooltip-overlay\"\n\t\t\t>\n\t\t\t\t{ children }\n\t\t\t\t<Slot { ...rest } />\n\t\t\t</View>\n\t\t</TooltipContext.Provider>\n\t);\n};\n\nTooltip.Slot = TooltipSlot;\n\nexport default Tooltip;\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/tooltip/index.native.js"],"names":["RIGHT_ALIGN_ARROW_OFFSET","TOOLTIP_VERTICAL_OFFSET","TooltipContext","onHandleScreenTouch","Fill","Slot","useKeyboardVisibility","keyboardVisible","setKeyboardVisible","previousKeyboardVisible","showListener","Keyboard","addListener","keyboardHideEvent","Platform","select","android","ios","hideListener","remove","Tooltip","children","position","text","visible","initialVisible","referenceElementRef","animationValue","Animated","Value","current","horizontalPosition","split","setVisible","animating","setAnimating","hidden","previousVisible","referenceLayout","setReferenceLayout","height","width","x","y","tooltipLayout","setTooltipLayout","startAnimation","getReferenceElementPosition","frameListener","timing","toValue","duration","useNativeDriver","delay","easing","Easing","out","quad","start","tooltipStyles","styles","tooltip","left","Math","floor","top","tooltipBoxStyles","tooltip__box","elevation","opacity","shadowColor","tooltip__shadow","color","shadowOffset","shadowOpacity","shadowRadius","transform","translateY","interpolate","inputRange","outputRange","arrowStyles","tooltip__arrow","requestAnimationFrame","measure","_x","_y","pageX","pageY","getTooltipLayout","nativeEvent","layout","ref","onLayout","tooltip__text","TooltipSlot","rest","handleScreenTouch","setHandleScreenTouch","callback","handleTouchStart","value","undefined","StyleSheet","absoluteFill"],"mappings":";;;;;;;;;AAgBA;;AAbA;;AAsBA;;AAKA;;AACA;;AA/BA;AACA;AACA;;AAWA;AACA;AACA;;AAYA;AACA;AACA;AAIA,MAAMA,wBAAwB,GAAG,EAAjC;AACA,MAAMC,uBAAuB,GAAG,CAAhC;AAEA,MAAMC,cAAc,GAAG,4BAA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AM,IAAA,KAAK,EAAG0D;AAAd,IAFD,CADD,CADD,CALD,CADD;AAgBA,CA9LD;;AAgMA,MAAMc,WAAW,GAAG,CAAE;AAAE1E,EAAAA,QAAF;AAAY,KAAG2E;AAAf,CAAF,KAA6B;AAChD,QAAM,CAAEC,iBAAF,EAAqBC,oBAArB,IAA8C,uBAAU,IAAV,CAApD;;AACA,QAAM/F,mBAAmB,GAAKgG,QAAF,IAAgB;AAC3C;AACAD,IAAAA,oBAAoB,CAAE,MAAMC,QAAR,CAApB;AACA,GAHD;;AAIA,QAAMC,gBAAgB,GAAG,MAAM;AAC9BH,IAAAA,iBAAiB;AACjBC,IAAAA,oBAAoB,CAAE,IAAF,CAApB;AACA,GAHD,CANgD,CAUhD;AACA;AACA;AACA;;;AACA,QAAMG,KAAK,GAAG,sBAAS,OAAQ;AAAElG,IAAAA;AAAF,GAAR,CAAT,CAAd;AAEA,SACC,4BAAC,cAAD,CAAgB,QAAhB;AAAyB,IAAA,KAAK,EAAGkG;AAAjC,KACC,4BAAC,iBAAD;AACC,IAAA,YAAY,EACX,OAAOJ,iBAAP,KAA6B,UAA7B,GACGG,gBADH,GAEGE,SAJL;AAMC,IAAA,aAAa,EAAC,UANf;AAOC,IAAA,KAAK,EAAGC,wBAAWC,YAPpB;AAQC,IAAA,MAAM,EAAC;AARR,KAUGnF,QAVH,EAWC,4BAAC,IAAD,EAAW2E,IAAX,CAXD,CADD,CADD;AAiBA,CAjCD;;AAmCA5E,OAAO,CAACf,IAAR,GAAe0F,WAAf;eAEe3E,O","sourcesContent":["/**\n * External dependencies\n */\nimport {\n\tAnimated,\n\tEasing,\n\tKeyboard,\n\tPlatform,\n\tStyleSheet,\n\tText,\n\tView,\n} from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tcloneElement,\n\tcreateContext,\n\tuseContext,\n\tuseEffect,\n\tuseMemo,\n\tuseRef,\n\tuseState,\n} from '@wordpress/element';\nimport { usePrevious } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { createSlotFill } from '../slot-fill';\nimport styles from './style.scss';\n\nconst RIGHT_ALIGN_ARROW_OFFSET = 16;\nconst TOOLTIP_VERTICAL_OFFSET = 2;\n\nconst TooltipContext = createContext( {\n\tonHandleScreenTouch: () => {},\n} );\nconst { Fill, Slot } = createSlotFill( 'Tooltip' );\n\nconst useKeyboardVisibility = () => {\n\tconst [ keyboardVisible, setKeyboardVisible ] = useState( false );\n\tconst previousKeyboardVisible = usePrevious( keyboardVisible );\n\n\tuseEffect( () => {\n\t\tconst showListener = Keyboard.addListener( 'keyboardDidShow', () => {\n\t\t\tif ( previousKeyboardVisible !== true ) {\n\t\t\t\tsetKeyboardVisible( true );\n\t\t\t}\n\t\t} );\n\t\tconst keyboardHideEvent = Platform.select( {\n\t\t\tandroid: 'keyboardDidHide',\n\t\t\tios: 'keyboardWillHide',\n\t\t} );\n\t\tconst hideListener = Keyboard.addListener( keyboardHideEvent, () => {\n\t\t\tif ( previousKeyboardVisible !== false ) {\n\t\t\t\tsetKeyboardVisible( false );\n\t\t\t}\n\t\t} );\n\t\treturn () => {\n\t\t\tshowListener.remove();\n\t\t\thideListener.remove();\n\t\t};\n\t\t// Disable reason: deferring this refactor to the native team.\n\t\t// see https://github.com/WordPress/gutenberg/pull/41166\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [] );\n\n\treturn keyboardVisible;\n};\n\nconst Tooltip = ( {\n\tchildren,\n\tposition = 'top',\n\ttext,\n\tvisible: initialVisible = false,\n} ) => {\n\tconst referenceElementRef = useRef( null );\n\tconst animationValue = useRef( new Animated.Value( 0 ) ).current;\n\tconst [ , horizontalPosition = 'center' ] = position.split( ' ' );\n\tconst [ visible, setVisible ] = useState( initialVisible );\n\tconst [ animating, setAnimating ] = useState( false );\n\tconst hidden = ! visible && ! animating;\n\tconst previousVisible = usePrevious( visible );\n\tconst [ referenceLayout, setReferenceLayout ] = useState( {\n\t\theight: 0,\n\t\twidth: 0,\n\t\tx: 0,\n\t\ty: 0,\n\t} );\n\tconst [ tooltipLayout, setTooltipLayout ] = useState( {\n\t\theight: 0,\n\t\twidth: 0,\n\t} );\n\tconst { onHandleScreenTouch } = useContext( TooltipContext );\n\tconst keyboardVisible = useKeyboardVisibility();\n\n\t// Register callback to dismiss the tooltip whenever the screen is touched.\n\tuseEffect( () => {\n\t\tif ( visible ) {\n\t\t\tonHandleScreenTouch( () => {\n\t\t\t\tsetAnimating( true );\n\t\t\t\tsetVisible( false );\n\t\t\t} );\n\t\t}\n\t\treturn () => onHandleScreenTouch( null );\n\t\t// Disable reason: deferring this refactor to the native team.\n\t\t// see https://github.com/WordPress/gutenberg/pull/41166\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [ visible ] );\n\n\t// Manage visibility animation.\n\tuseEffect( () => {\n\t\tif (\n\t\t\t// Initial render and visibility enabled, animate show.\n\t\t\t( typeof previousVisible === 'undefined' && visible ) ||\n\t\t\t// Previously visible, animate hide\n\t\t\t( previousVisible && previousVisible !== visible )\n\t\t) {\n\t\t\tsetAnimating( true );\n\t\t\tstartAnimation();\n\t\t}\n\t\t// Disable reason: deferring this refactor to the native team.\n\t\t// see https://github.com/WordPress/gutenberg/pull/41166\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [ visible ] );\n\n\t// Manage tooltip visibility and position in relation to keyboard.\n\tuseEffect( () => {\n\t\tif ( ! visible ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Update tooltip position if keyboard is visible.\n\t\tif ( keyboardVisible ) {\n\t\t\tgetReferenceElementPosition();\n\t\t}\n\n\t\t// Hide tooltip if keyboard hides\n\t\tif ( typeof previousVisible !== 'undefined' && ! keyboardVisible ) {\n\t\t\tsetAnimating( true );\n\t\t\tsetVisible( false );\n\t\t}\n\t\t// Disable reason: deferring this refactor to the native team.\n\t\t// see https://github.com/WordPress/gutenberg/pull/41166\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [ visible, keyboardVisible ] );\n\n\t// Manage tooltip position during keyboard frame changes.\n\tuseEffect( () => {\n\t\tconst frameListener = Keyboard.addListener(\n\t\t\t'keyboardWillChangeFrame',\n\t\t\t() => {\n\t\t\t\tif ( visible ) {\n\t\t\t\t\tgetReferenceElementPosition();\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\treturn () => {\n\t\t\tframeListener.remove();\n\t\t};\n\t}, [ visible ] );\n\n\tconst startAnimation = () => {\n\t\tAnimated.timing( animationValue, {\n\t\t\ttoValue: visible ? 1 : 0,\n\t\t\tduration: visible ? 300 : 150,\n\t\t\tuseNativeDriver: true,\n\t\t\tdelay: visible ? 500 : 0,\n\t\t\teasing: Easing.out( Easing.quad ),\n\t\t} ).start( () => {\n\t\t\tsetAnimating( false );\n\t\t} );\n\t};\n\n\tconst tooltipStyles = [\n\t\tstyles.tooltip,\n\t\t{\n\t\t\tleft:\n\t\t\t\treferenceLayout.x +\n\t\t\t\tMath.floor( referenceLayout.width / 2 ) -\n\t\t\t\t( horizontalPosition === 'right'\n\t\t\t\t\t? RIGHT_ALIGN_ARROW_OFFSET\n\t\t\t\t\t: Math.floor( tooltipLayout.width / 2 ) ),\n\t\t\ttop:\n\t\t\t\treferenceLayout.y -\n\t\t\t\ttooltipLayout.height -\n\t\t\t\tTOOLTIP_VERTICAL_OFFSET,\n\t\t},\n\t];\n\tconst tooltipBoxStyles = [\n\t\tstyles.tooltip__box,\n\t\thorizontalPosition === 'right' && styles[ 'tooltip--rightAlign' ],\n\t\t{\n\t\t\televation: 2,\n\t\t\topacity: animationValue,\n\t\t\tshadowColor: styles.tooltip__shadow?.color,\n\t\t\tshadowOffset: { height: 2, width: 0 },\n\t\t\tshadowOpacity: 0.25,\n\t\t\tshadowRadius: 2,\n\t\t\ttransform: [\n\t\t\t\t{\n\t\t\t\t\ttranslateY: animationValue.interpolate( {\n\t\t\t\t\t\tinputRange: [ 0, 1 ],\n\t\t\t\t\t\toutputRange: [ visible ? 4 : -8, -8 ],\n\t\t\t\t\t} ),\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t];\n\tconst arrowStyles = [\n\t\tstyles.tooltip__arrow,\n\t\thorizontalPosition === 'right' &&\n\t\t\tstyles[ 'tooltip__arrow--rightAlign' ],\n\t];\n\n\tconst getReferenceElementPosition = () => {\n\t\t// rAF allows render to complete before calculating layout\n\t\t// eslint-disable-next-line no-undef\n\t\trequestAnimationFrame( () => {\n\t\t\tif ( ! referenceElementRef.current ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treferenceElementRef.current.measure(\n\t\t\t\t( _x, _y, width, height, pageX, pageY ) => {\n\t\t\t\t\tsetReferenceLayout( {\n\t\t\t\t\t\theight,\n\t\t\t\t\t\twidth,\n\t\t\t\t\t\tx: pageX,\n\t\t\t\t\t\ty: pageY,\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t);\n\t\t} );\n\t};\n\tconst getTooltipLayout = ( { nativeEvent } ) => {\n\t\tconst { height, width } = nativeEvent.layout;\n\t\tsetTooltipLayout( { height, width } );\n\t};\n\n\tif ( hidden ) {\n\t\treturn children;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{ cloneElement( children, {\n\t\t\t\tref: referenceElementRef,\n\t\t\t\tonLayout: getReferenceElementPosition,\n\t\t\t} ) }\n\t\t\t<Fill>\n\t\t\t\t<View onLayout={ getTooltipLayout } style={ tooltipStyles }>\n\t\t\t\t\t<Animated.View style={ tooltipBoxStyles }>\n\t\t\t\t\t\t<Text style={ styles.tooltip__text }>{ text }</Text>\n\t\t\t\t\t\t<View style={ arrowStyles } />\n\t\t\t\t\t</Animated.View>\n\t\t\t\t</View>\n\t\t\t</Fill>\n\t\t</>\n\t);\n};\n\nconst TooltipSlot = ( { children, ...rest } ) => {\n\tconst [ handleScreenTouch, setHandleScreenTouch ] = useState( null );\n\tconst onHandleScreenTouch = ( callback ) => {\n\t\t// Must use function to set state below as `callback` is a function itself.\n\t\tsetHandleScreenTouch( () => callback );\n\t};\n\tconst handleTouchStart = () => {\n\t\thandleScreenTouch();\n\t\tsetHandleScreenTouch( null );\n\t};\n\t// Memoize context value to avoid unnecessary rerenders of the Provider's children\n\t// Disable reason: deferring this refactor to the native team.\n\t// see https://github.com/WordPress/gutenberg/pull/41166\n\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\tconst value = useMemo( () => ( { onHandleScreenTouch } ) );\n\n\treturn (\n\t\t<TooltipContext.Provider value={ value }>\n\t\t\t<View\n\t\t\t\tonTouchStart={\n\t\t\t\t\ttypeof handleScreenTouch === 'function'\n\t\t\t\t\t\t? handleTouchStart\n\t\t\t\t\t\t: undefined\n\t\t\t\t}\n\t\t\t\tpointerEvents=\"box-none\"\n\t\t\t\tstyle={ StyleSheet.absoluteFill }\n\t\t\t\ttestID=\"tooltip-overlay\"\n\t\t\t>\n\t\t\t\t{ children }\n\t\t\t\t<Slot { ...rest } />\n\t\t\t</View>\n\t\t</TooltipContext.Provider>\n\t);\n};\n\nTooltip.Slot = TooltipSlot;\n\nexport default Tooltip;\n"]}
@@ -20,12 +20,11 @@ var _item = _interopRequireDefault(require("./item"));
20
20
  /**
21
21
  * Internal dependencies
22
22
  */
23
- function UnforwardedTreeGridCell(_ref, ref) {
24
- let {
25
- children,
26
- withoutGridItem = false,
27
- ...props
28
- } = _ref;
23
+ function UnforwardedTreeGridCell({
24
+ children,
25
+ withoutGridItem = false,
26
+ ...props
27
+ }, ref) {
29
28
  return (0, _element.createElement)("td", (0, _extends2.default)({}, props, {
30
29
  role: "gridcell"
31
30
  }), withoutGridItem ? (0, _element.createElement)(_element.Fragment, null, children) : (0, _element.createElement)(_item.default, {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/tree-grid/cell.tsx"],"names":["UnforwardedTreeGridCell","ref","children","withoutGridItem","props","TreeGridCell"],"mappings":";;;;;;;;;AAGA;;;;AAKA;;AARA;AACA;AACA;;AAGA;AACA;AACA;AAKA,SAASA,uBAAT,OAMCC,GAND,EAOE;AAAA,MAND;AACCC,IAAAA,QADD;AAECC,IAAAA,eAAe,GAAG,KAFnB;AAGC,OAAGC;AAHJ,GAMC;AACD,SACC,6DAASA,KAAT;AAAiB,IAAA,IAAI,EAAC;AAAtB,MACGD,eAAe,GAChB,qDAAID,QAAJ,CADgB,GAGhB,4BAAC,aAAD;AAAc,IAAA,GAAG,EAAGD;AAApB,KAA4BC,QAA5B,CAJF,CADD;AASA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,MAAMG,YAAY,GAAG,yBAAYL,uBAAZ,CAArB;;eAEQK,Y","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport TreeGridItem from './item';\nimport type { WordPressComponentProps } from '../ui/context';\nimport type { TreeGridCellProps } from './types';\n\nfunction UnforwardedTreeGridCell(\n\t{\n\t\tchildren,\n\t\twithoutGridItem = false,\n\t\t...props\n\t}: WordPressComponentProps< TreeGridCellProps, 'td', false >,\n\tref: React.ForwardedRef< any >\n) {\n\treturn (\n\t\t<td { ...props } role=\"gridcell\">\n\t\t\t{ withoutGridItem ? (\n\t\t\t\t<>{ children }</>\n\t\t\t) : (\n\t\t\t\t<TreeGridItem ref={ ref }>{ children }</TreeGridItem>\n\t\t\t) }\n\t\t</td>\n\t);\n}\n\n/**\n * `TreeGridCell` is used to create a tree hierarchy.\n * It is not a visually styled component, but instead helps with adding\n * keyboard navigation and roving tab index behaviors to tree grid structures.\n *\n * @see {@link https://www.w3.org/TR/wai-aria-practices/examples/treegrid/treegrid-1.html}\n */\nexport const TreeGridCell = forwardRef( UnforwardedTreeGridCell );\n\nexport default TreeGridCell;\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/tree-grid/cell.tsx"],"names":["UnforwardedTreeGridCell","children","withoutGridItem","props","ref","TreeGridCell"],"mappings":";;;;;;;;;AAGA;;;;AAKA;;AARA;AACA;AACA;;AAGA;AACA;AACA;AAKA,SAASA,uBAAT,CACC;AACCC,EAAAA,QADD;AAECC,EAAAA,eAAe,GAAG,KAFnB;AAGC,KAAGC;AAHJ,CADD,EAMCC,GAND,EAOE;AACD,SACC,6DAASD,KAAT;AAAiB,IAAA,IAAI,EAAC;AAAtB,MACGD,eAAe,GAChB,qDAAID,QAAJ,CADgB,GAGhB,4BAAC,aAAD;AAAc,IAAA,GAAG,EAAGG;AAApB,KAA4BH,QAA5B,CAJF,CADD;AASA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,MAAMI,YAAY,GAAG,yBAAYL,uBAAZ,CAArB;;eAEQK,Y","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport TreeGridItem from './item';\nimport type { WordPressComponentProps } from '../ui/context';\nimport type { TreeGridCellProps } from './types';\n\nfunction UnforwardedTreeGridCell(\n\t{\n\t\tchildren,\n\t\twithoutGridItem = false,\n\t\t...props\n\t}: WordPressComponentProps< TreeGridCellProps, 'td', false >,\n\tref: React.ForwardedRef< any >\n) {\n\treturn (\n\t\t<td { ...props } role=\"gridcell\">\n\t\t\t{ withoutGridItem ? (\n\t\t\t\t<>{ children }</>\n\t\t\t) : (\n\t\t\t\t<TreeGridItem ref={ ref }>{ children }</TreeGridItem>\n\t\t\t) }\n\t\t</td>\n\t);\n}\n\n/**\n * `TreeGridCell` is used to create a tree hierarchy.\n * It is not a visually styled component, but instead helps with adding\n * keyboard navigation and roving tab index behaviors to tree grid structures.\n *\n * @see {@link https://www.w3.org/TR/wai-aria-practices/examples/treegrid/treegrid-1.html}\n */\nexport const TreeGridCell = forwardRef( UnforwardedTreeGridCell );\n\nexport default TreeGridCell;\n"]}
@@ -73,17 +73,16 @@ function getRowFocusables(rowElement) {
73
73
  */
74
74
 
75
75
 
76
- function UnforwardedTreeGrid(_ref,
76
+ function UnforwardedTreeGrid({
77
+ children,
78
+ onExpandRow = () => {},
79
+ onCollapseRow = () => {},
80
+ onFocusRow = () => {},
81
+ applicationAriaLabel,
82
+ ...props
83
+ },
77
84
  /** A ref to the underlying DOM table element. */
78
85
  ref) {
79
- let {
80
- children,
81
- onExpandRow = () => {},
82
- onCollapseRow = () => {},
83
- onFocusRow = () => {},
84
- applicationAriaLabel,
85
- ...props
86
- } = _ref;
87
86
  const onKeyDown = (0, _element.useCallback)(event => {
88
87
  const {
89
88
  keyCode,
@@ -138,7 +137,7 @@ ref) {
138
137
 
139
138
  if (canExpandCollapse) {
140
139
  if (keyCode === _keycodes.LEFT) {
141
- var _activeRow$getAttribu, _getRowFocusables, _getRowFocusables$;
140
+ var _activeRow$getAttribu;
142
141
 
143
142
  // Left:
144
143
  // If a row is focused, and it is expanded, collapses the current row.
@@ -149,7 +148,7 @@ ref) {
149
148
  } // If a row is focused, and it is collapsed, moves to the parent row (if there is one).
150
149
 
151
150
 
152
- const level = Math.max(parseInt((_activeRow$getAttribu = activeRow === null || activeRow === void 0 ? void 0 : activeRow.getAttribute('aria-level')) !== null && _activeRow$getAttribu !== void 0 ? _activeRow$getAttribu : '1', 10) - 1, 1);
151
+ const level = Math.max(parseInt((_activeRow$getAttribu = activeRow?.getAttribute('aria-level')) !== null && _activeRow$getAttribu !== void 0 ? _activeRow$getAttribu : '1', 10) - 1, 1);
153
152
  const rows = Array.from(treeGridElement.querySelectorAll('[role="row"]'));
154
153
  let parentRow = activeRow;
155
154
  const currentRowIndex = rows.indexOf(activeRow);
@@ -163,7 +162,7 @@ ref) {
163
162
  }
164
163
  }
165
164
 
166
- (_getRowFocusables = getRowFocusables(parentRow)) === null || _getRowFocusables === void 0 ? void 0 : (_getRowFocusables$ = _getRowFocusables[0]) === null || _getRowFocusables$ === void 0 ? void 0 : _getRowFocusables$.focus();
165
+ getRowFocusables(parentRow)?.[0]?.focus();
167
166
  }
168
167
 
169
168
  if (keyCode === _keycodes.RIGHT) {
@@ -179,9 +178,7 @@ ref) {
179
178
  const focusableItems = getRowFocusables(activeRow);
180
179
 
181
180
  if (focusableItems.length > 0) {
182
- var _focusableItems$nextI;
183
-
184
- (_focusableItems$nextI = focusableItems[nextIndex]) === null || _focusableItems$nextI === void 0 ? void 0 : _focusableItems$nextI.focus();
181
+ focusableItems[nextIndex]?.focus();
185
182
  }
186
183
  } // Prevent key use for anything else. For example, Voiceover
187
184
  // will start reading text on continued use of left/right arrow
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/tree-grid/index.tsx"],"names":["getRowFocusables","rowElement","focusablesInRow","focus","focusable","find","sequential","filter","closest","UnforwardedTreeGrid","ref","children","onExpandRow","onCollapseRow","onFocusRow","applicationAriaLabel","props","onKeyDown","event","keyCode","metaKey","ctrlKey","altKey","hasModifierKeyPressed","UP","DOWN","LEFT","RIGHT","HOME","END","includes","stopPropagation","activeElement","document","currentTarget","treeGridElement","contains","activeRow","currentColumnIndex","indexOf","canExpandCollapse","cannotFocusNextColumn","getAttribute","nextIndex","Math","max","min","length","preventDefault","level","parseInt","rows","Array","from","querySelectorAll","parentRow","currentRowIndex","i","ariaLevel","focusableItems","nextRowIndex","focusablesInNextRow","TreeGrid"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA;;;;AADA;;AAEA;;AAKA;;AA4XA;;AACA;;AACA;;AAxYA;AACA;AACA;;AAKA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,gBAAT,CAA2BC,UAA3B,EAAqD;AACpD,QAAMC,eAAe,GAAGC,WAAMC,SAAN,CAAgBC,IAAhB,CAAsBJ,UAAtB,EAAkC;AACzDK,IAAAA,UAAU,EAAE;AAD6C,GAAlC,CAAxB;;AAIA,SAAOJ,eAAe,CAACK,MAAhB,CAA0BH,SAAF,IAAiB;AAC/C,WAAOA,SAAS,CAACI,OAAV,CAAmB,cAAnB,MAAwCP,UAA/C;AACA,GAFM,CAAP;AAGA;AAED;AACA;AACA;AACA;;;AACA,SAASQ,mBAAT;AASC;AACAC,GAVD,EAWE;AAAA,MAVD;AACCC,IAAAA,QADD;AAECC,IAA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AAAwB,kBAAaC;AAArC,KACC,gEACMC,KADN;AAEC,IAAA,IAAI,EAAC,UAFN;AAGC,IAAA,SAAS,EAAGC,SAHb;AAIC,IAAA,GAAG,EAAGP;AAJP,MAMC,2CAASC,QAAT,CAND,CADD,CAND,CADD;AAmBA;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,MAAMmD,QAAQ,GAAG,yBAAYrD,mBAAZ,CAAjB;;eAEQqD,Q","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { focus } from '@wordpress/dom';\nimport { forwardRef, useCallback } from '@wordpress/element';\nimport { UP, DOWN, LEFT, RIGHT, HOME, END } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport RovingTabIndexContainer from './roving-tab-index';\nimport type { TreeGridProps } from './types';\nimport type { WordPressComponentProps } from '../ui/context';\n\n/**\n * Return focusables in a row element, excluding those from other branches\n * nested within the row.\n *\n * @param rowElement The DOM element representing the row.\n *\n * @return The array of focusables in the row.\n */\nfunction getRowFocusables( rowElement: HTMLElement ) {\n\tconst focusablesInRow = focus.focusable.find( rowElement, {\n\t\tsequential: true,\n\t} );\n\n\treturn focusablesInRow.filter( ( focusable ) => {\n\t\treturn focusable.closest( '[role=\"row\"]' ) === rowElement;\n\t} );\n}\n\n/**\n * Renders both a table and tbody element, used to create a tree hierarchy.\n *\n */\nfunction UnforwardedTreeGrid(\n\t{\n\t\tchildren,\n\t\tonExpandRow = () => {},\n\t\tonCollapseRow = () => {},\n\t\tonFocusRow = () => {},\n\t\tapplicationAriaLabel,\n\t\t...props\n\t}: WordPressComponentProps< TreeGridProps, 'table', false >,\n\t/** A ref to the underlying DOM table element. */\n\tref: React.ForwardedRef< HTMLTableElement >\n) {\n\tconst onKeyDown = useCallback(\n\t\t( event: React.KeyboardEvent< HTMLTableElement > ) => {\n\t\t\tconst { keyCode, metaKey, ctrlKey, altKey } = event;\n\n\t\t\t// The shift key is intentionally absent from the following list,\n\t\t\t// to enable shift + up/down to select items from the list.\n\t\t\tconst hasModifierKeyPressed = metaKey || ctrlKey || altKey;\n\n\t\t\tif (\n\t\t\t\thasModifierKeyPressed ||\n\t\t\t\t! ( [ UP, DOWN, LEFT, RIGHT, HOME, END ] as number[] ).includes(\n\t\t\t\t\tkeyCode\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// The event will be handled, stop propagation.\n\t\t\tevent.stopPropagation();\n\n\t\t\tconst { activeElement } = document;\n\t\t\tconst { currentTarget: treeGridElement } = event;\n\n\t\t\tif (\n\t\t\t\t! activeElement ||\n\t\t\t\t! treeGridElement.contains( activeElement )\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Calculate the columnIndex of the active element.\n\t\t\tconst activeRow =\n\t\t\t\tactiveElement.closest< HTMLElement >( '[role=\"row\"]' );\n\n\t\t\tif ( ! activeRow ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst focusablesInRow = getRowFocusables( activeRow );\n\t\t\tconst currentColumnIndex = focusablesInRow.indexOf(\n\t\t\t\tactiveElement as HTMLElement\n\t\t\t);\n\t\t\tconst canExpandCollapse = 0 === currentColumnIndex;\n\t\t\tconst cannotFocusNextColumn =\n\t\t\t\tcanExpandCollapse &&\n\t\t\t\t( activeRow.getAttribute( 'data-expanded' ) === 'false' ||\n\t\t\t\t\tactiveRow.getAttribute( 'aria-expanded' ) === 'false' ) &&\n\t\t\t\tkeyCode === RIGHT;\n\n\t\t\tif ( ( [ LEFT, RIGHT ] as number[] ).includes( keyCode ) ) {\n\t\t\t\t// Calculate to the next element.\n\t\t\t\tlet nextIndex;\n\t\t\t\tif ( keyCode === LEFT ) {\n\t\t\t\t\tnextIndex = Math.max( 0, currentColumnIndex - 1 );\n\t\t\t\t} else {\n\t\t\t\t\tnextIndex = Math.min(\n\t\t\t\t\t\tcurrentColumnIndex + 1,\n\t\t\t\t\t\tfocusablesInRow.length - 1\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t// Focus is at the left most column.\n\t\t\t\tif ( canExpandCollapse ) {\n\t\t\t\t\tif ( keyCode === LEFT ) {\n\t\t\t\t\t\t// Left:\n\t\t\t\t\t\t// If a row is focused, and it is expanded, collapses the current row.\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tactiveRow.getAttribute( 'data-expanded' ) ===\n\t\t\t\t\t\t\t\t'true' ||\n\t\t\t\t\t\t\tactiveRow.getAttribute( 'aria-expanded' ) === 'true'\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tonCollapseRow( activeRow );\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// If a row is focused, and it is collapsed, moves to the parent row (if there is one).\n\t\t\t\t\t\tconst level = Math.max(\n\t\t\t\t\t\t\tparseInt(\n\t\t\t\t\t\t\t\tactiveRow?.getAttribute( 'aria-level' ) ?? '1',\n\t\t\t\t\t\t\t\t10\n\t\t\t\t\t\t\t) - 1,\n\t\t\t\t\t\t\t1\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconst rows = Array.from(\n\t\t\t\t\t\t\ttreeGridElement.querySelectorAll< HTMLElement >(\n\t\t\t\t\t\t\t\t'[role=\"row\"]'\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\t\tlet parentRow = activeRow;\n\t\t\t\t\t\tconst currentRowIndex = rows.indexOf( activeRow );\n\t\t\t\t\t\tfor ( let i = currentRowIndex; i >= 0; i-- ) {\n\t\t\t\t\t\t\tconst ariaLevel =\n\t\t\t\t\t\t\t\trows[ i ].getAttribute( 'aria-level' );\n\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\tariaLevel !== null &&\n\t\t\t\t\t\t\t\tparseInt( ariaLevel, 10 ) === level\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tparentRow = rows[ i ];\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tgetRowFocusables( parentRow )?.[ 0 ]?.focus();\n\t\t\t\t\t}\n\t\t\t\t\tif ( keyCode === RIGHT ) {\n\t\t\t\t\t\t// Right:\n\t\t\t\t\t\t// If a row is focused, and it is collapsed, expands the current row.\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tactiveRow.getAttribute( 'data-expanded' ) ===\n\t\t\t\t\t\t\t\t'false' ||\n\t\t\t\t\t\t\tactiveRow.getAttribute( 'aria-expanded' ) ===\n\t\t\t\t\t\t\t\t'false'\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tonExpandRow( activeRow );\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// If a row is focused, and it is expanded, focuses the next cell in the row.\n\t\t\t\t\t\tconst focusableItems = getRowFocusables( activeRow );\n\t\t\t\t\t\tif ( focusableItems.length > 0 ) {\n\t\t\t\t\t\t\tfocusableItems[ nextIndex ]?.focus();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// Prevent key use for anything else. For example, Voiceover\n\t\t\t\t\t// will start reading text on continued use of left/right arrow\n\t\t\t\t\t// keys.\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Focus the next element. If at most left column and row is collapsed, moving right is not allowed as this will expand. However, if row is collapsed, moving left is allowed.\n\t\t\t\tif ( cannotFocusNextColumn ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tfocusablesInRow[ nextIndex ].focus();\n\n\t\t\t\t// Prevent key use for anything else. This ensures Voiceover\n\t\t\t\t// doesn't try to handle key navigation.\n\t\t\t\tevent.preventDefault();\n\t\t\t} else if ( ( [ UP, DOWN ] as number[] ).includes( keyCode ) ) {\n\t\t\t\t// Calculate the rowIndex of the next row.\n\t\t\t\tconst rows = Array.from(\n\t\t\t\t\ttreeGridElement.querySelectorAll< HTMLElement >(\n\t\t\t\t\t\t'[role=\"row\"]'\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\tconst currentRowIndex = rows.indexOf( activeRow );\n\t\t\t\tlet nextRowIndex;\n\n\t\t\t\tif ( keyCode === UP ) {\n\t\t\t\t\tnextRowIndex = Math.max( 0, currentRowIndex - 1 );\n\t\t\t\t} else {\n\t\t\t\t\tnextRowIndex = Math.min(\n\t\t\t\t\t\tcurrentRowIndex + 1,\n\t\t\t\t\t\trows.length - 1\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t// Focus is either at the top or bottom edge of the grid. Do nothing.\n\t\t\t\tif ( nextRowIndex === currentRowIndex ) {\n\t\t\t\t\t// Prevent key use for anything else. For example, Voiceover\n\t\t\t\t\t// will start navigating horizontally when reaching the vertical\n\t\t\t\t\t// bounds of a table.\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Get the focusables in the next row.\n\t\t\t\tconst focusablesInNextRow = getRowFocusables(\n\t\t\t\t\trows[ nextRowIndex ]\n\t\t\t\t);\n\n\t\t\t\t// If for some reason there are no focusables in the next row, do nothing.\n\t\t\t\tif ( ! focusablesInNextRow || ! focusablesInNextRow.length ) {\n\t\t\t\t\t// Prevent key use for anything else. For example, Voiceover\n\t\t\t\t\t// will still focus text when using arrow keys, while this\n\t\t\t\t\t// component should limit navigation to focusables.\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Try to focus the element in the next row that's at a similar column to the activeElement.\n\t\t\t\tconst nextIndex = Math.min(\n\t\t\t\t\tcurrentColumnIndex,\n\t\t\t\t\tfocusablesInNextRow.length - 1\n\t\t\t\t);\n\t\t\t\tfocusablesInNextRow[ nextIndex ].focus();\n\n\t\t\t\t// Let consumers know the row that was originally focused,\n\t\t\t\t// and the row that is now in focus.\n\t\t\t\tonFocusRow( event, activeRow, rows[ nextRowIndex ] );\n\n\t\t\t\t// Prevent key use for anything else. This ensures Voiceover\n\t\t\t\t// doesn't try to handle key navigation.\n\t\t\t\tevent.preventDefault();\n\t\t\t} else if ( ( [ HOME, END ] as number[] ).includes( keyCode ) ) {\n\t\t\t\t// Calculate the rowIndex of the next row.\n\t\t\t\tconst rows = Array.from(\n\t\t\t\t\ttreeGridElement.querySelectorAll< HTMLElement >(\n\t\t\t\t\t\t'[role=\"row\"]'\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\tconst currentRowIndex = rows.indexOf( activeRow );\n\t\t\t\tlet nextRowIndex;\n\n\t\t\t\tif ( keyCode === HOME ) {\n\t\t\t\t\tnextRowIndex = 0;\n\t\t\t\t} else {\n\t\t\t\t\tnextRowIndex = rows.length - 1;\n\t\t\t\t}\n\n\t\t\t\t// Focus is either at the top or bottom edge of the grid. Do nothing.\n\t\t\t\tif ( nextRowIndex === currentRowIndex ) {\n\t\t\t\t\t// Prevent key use for anything else. For example, Voiceover\n\t\t\t\t\t// will start navigating horizontally when reaching the vertical\n\t\t\t\t\t// bounds of a table.\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Get the focusables in the next row.\n\t\t\t\tconst focusablesInNextRow = getRowFocusables(\n\t\t\t\t\trows[ nextRowIndex ]\n\t\t\t\t);\n\n\t\t\t\t// If for some reason there are no focusables in the next row, do nothing.\n\t\t\t\tif ( ! focusablesInNextRow || ! focusablesInNextRow.length ) {\n\t\t\t\t\t// Prevent key use for anything else. For example, Voiceover\n\t\t\t\t\t// will still focus text when using arrow keys, while this\n\t\t\t\t\t// component should limit navigation to focusables.\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Try to focus the element in the next row that's at a similar column to the activeElement.\n\t\t\t\tconst nextIndex = Math.min(\n\t\t\t\t\tcurrentColumnIndex,\n\t\t\t\t\tfocusablesInNextRow.length - 1\n\t\t\t\t);\n\t\t\t\tfocusablesInNextRow[ nextIndex ].focus();\n\n\t\t\t\t// Let consumers know the row that was originally focused,\n\t\t\t\t// and the row that is now in focus.\n\t\t\t\tonFocusRow( event, activeRow, rows[ nextRowIndex ] );\n\n\t\t\t\t// Prevent key use for anything else. This ensures Voiceover\n\t\t\t\t// doesn't try to handle key navigation.\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t},\n\t\t[ onExpandRow, onCollapseRow, onFocusRow ]\n\t);\n\n\t/* Disable reason: A treegrid is implemented using a table element. */\n\t/* eslint-disable jsx-a11y/no-noninteractive-element-to-interactive-role */\n\treturn (\n\t\t<RovingTabIndexContainer>\n\t\t\t{\n\t\t\t\t// Prevent browser mode from triggering in NVDA by wrapping List View\n\t\t\t\t// in a role=application wrapper.\n\t\t\t\t// see: https://github.com/WordPress/gutenberg/issues/43729\n\t\t\t }\n\t\t\t<div role=\"application\" aria-label={ applicationAriaLabel }>\n\t\t\t\t<table\n\t\t\t\t\t{ ...props }\n\t\t\t\t\trole=\"treegrid\"\n\t\t\t\t\tonKeyDown={ onKeyDown }\n\t\t\t\t\tref={ ref }\n\t\t\t\t>\n\t\t\t\t\t<tbody>{ children }</tbody>\n\t\t\t\t</table>\n\t\t\t</div>\n\t\t</RovingTabIndexContainer>\n\t);\n\t/* eslint-enable jsx-a11y/no-noninteractive-element-to-interactive-role */\n}\n\n/**\n * `TreeGrid` is used to create a tree hierarchy.\n * It is not a visually styled component, but instead helps with adding\n * keyboard navigation and roving tab index behaviors to tree grid structures.\n *\n * A tree grid is a hierarchical 2 dimensional UI component, for example it could be\n * used to implement a file system browser.\n *\n * A tree grid allows the user to navigate using arrow keys.\n * Up/down to navigate vertically across rows, and left/right to navigate horizontally\n * between focusables in a row.\n *\n * The `TreeGrid` renders both a `table` and `tbody` element, and is intended to be used\n * with `TreeGridRow` (`tr`) and `TreeGridCell` (`td`) to build out a grid.\n *\n * ```jsx\n * function TreeMenu() {\n * \treturn (\n * \t\t<TreeGrid>\n * \t\t\t<TreeGridRow level={ 1 } positionInSet={ 1 } setSize={ 2 }>\n * \t\t\t\t<TreeGridCell>\n * \t\t\t\t\t{ ( props ) => (\n * \t\t\t\t\t\t<Button onClick={ onSelect } { ...props }>Select</Button>\n * \t\t\t\t\t) }\n * \t\t\t\t</TreeGridCell>\n * \t\t\t\t<TreeGridCell>\n * \t\t\t\t\t{ ( props ) => (\n * \t\t\t\t\t\t<Button onClick={ onMove } { ...props }>Move</Button>\n * \t\t\t\t\t) }\n * \t\t\t\t</TreeGridCell>\n * \t\t\t</TreeGridRow>\n * \t\t\t<TreeGridRow level={ 1 } positionInSet={ 2 } setSize={ 2 }>\n * \t\t\t\t<TreeGridCell>\n * \t\t\t\t\t{ ( props ) => (\n * \t\t\t\t\t\t<Button onClick={ onSelect } { ...props }>Select</Button>\n * \t\t\t\t\t) }\n * \t\t\t\t</TreeGridCell>\n * \t\t\t\t<TreeGridCell>\n * \t\t\t\t\t{ ( props ) => (\n * \t\t\t\t\t\t<Button onClick={ onMove } { ...props }>Move</Button>\n * \t\t\t\t\t) }\n * \t\t\t\t</TreeGridCell>\n * \t\t\t</TreeGridRow>\n * \t\t\t<TreeGridRow level={ 2 } positionInSet={ 1 } setSize={ 1 }>\n * \t\t\t\t<TreeGridCell>\n * \t\t\t\t\t{ ( props ) => (\n * \t\t\t\t\t\t<Button onClick={ onSelect } { ...props }>Select</Button>\n * \t\t\t\t\t) }\n * \t\t\t\t</TreeGridCell>\n * \t\t\t\t<TreeGridCell>\n * \t\t\t\t\t{ ( props ) => (\n * \t\t\t\t\t\t<Button onClick={ onMove } { ...props }>Move</Button>\n * \t\t\t\t\t) }\n * \t\t\t\t</TreeGridCell>\n * \t\t\t</TreeGridRow>\n * \t\t</TreeGrid>\n * \t);\n * }\n * ```\n *\n * @see {@link https://www.w3.org/TR/wai-aria-practices/examples/treegrid/treegrid-1.html}\n */\nexport const TreeGrid = forwardRef( UnforwardedTreeGrid );\n\nexport default TreeGrid;\nexport { default as TreeGridRow } from './row';\nexport { default as TreeGridCell } from './cell';\nexport { default as TreeGridItem } from './item';\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/tree-grid/index.tsx"],"names":["getRowFocusables","rowElement","focusablesInRow","focus","focusable","find","sequential","filter","closest","UnforwardedTreeGrid","children","onExpandRow","onCollapseRow","onFocusRow","applicationAriaLabel","props","ref","onKeyDown","event","keyCode","metaKey","ctrlKey","altKey","hasModifierKeyPressed","UP","DOWN","LEFT","RIGHT","HOME","END","includes","stopPropagation","activeElement","document","currentTarget","treeGridElement","contains","activeRow","currentColumnIndex","indexOf","canExpandCollapse","cannotFocusNextColumn","getAttribute","nextIndex","Math","max","min","length","preventDefault","level","parseInt","rows","Array","from","querySelectorAll","parentRow","currentRowIndex","i","ariaLevel","focusableItems","nextRowIndex","focusablesInNextRow","TreeGrid"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA;;;;AADA;;AAEA;;AAKA;;AA4XA;;AACA;;AACA;;AAxYA;AACA;AACA;;AAKA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,gBAAT,CAA2BC,UAA3B,EAAqD;AACpD,QAAMC,eAAe,GAAGC,WAAMC,SAAN,CAAgBC,IAAhB,CAAsBJ,UAAtB,EAAkC;AACzDK,IAAAA,UAAU,EAAE;AAD6C,GAAlC,CAAxB;;AAIA,SAAOJ,eAAe,CAACK,MAAhB,CAA0BH,SAAF,IAAiB;AAC/C,WAAOA,SAAS,CAACI,OAAV,CAAmB,cAAnB,MAAwCP,UAA/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iB,CAAlB;AA6PA;;AACA;;AACA,SACC,4BAAC,uBAAD,QAMC;AAAK,IAAA,IAAI,EAAC,aAAV;AAAwB,kBAAaC;AAArC,KACC,gEACMC,KADN;AAEC,IAAA,IAAI,EAAC,UAFN;AAGC,IAAA,SAAS,EAAGE,SAHb;AAIC,IAAA,GAAG,EAAGD;AAJP,MAMC,2CAASN,QAAT,CAND,CADD,CAND,CADD;AAmBA;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,MAAMoD,QAAQ,GAAG,yBAAYrD,mBAAZ,CAAjB;;eAEQqD,Q","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { focus } from '@wordpress/dom';\nimport { forwardRef, useCallback } from '@wordpress/element';\nimport { UP, DOWN, LEFT, RIGHT, HOME, END } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport RovingTabIndexContainer from './roving-tab-index';\nimport type { TreeGridProps } from './types';\nimport type { WordPressComponentProps } from '../ui/context';\n\n/**\n * Return focusables in a row element, excluding those from other branches\n * nested within the row.\n *\n * @param rowElement The DOM element representing the row.\n *\n * @return The array of focusables in the row.\n */\nfunction getRowFocusables( rowElement: HTMLElement ) {\n\tconst focusablesInRow = focus.focusable.find( rowElement, {\n\t\tsequential: true,\n\t} );\n\n\treturn focusablesInRow.filter( ( focusable ) => {\n\t\treturn focusable.closest( '[role=\"row\"]' ) === rowElement;\n\t} );\n}\n\n/**\n * Renders both a table and tbody element, used to create a tree hierarchy.\n *\n */\nfunction UnforwardedTreeGrid(\n\t{\n\t\tchildren,\n\t\tonExpandRow = () => {},\n\t\tonCollapseRow = () => {},\n\t\tonFocusRow = () => {},\n\t\tapplicationAriaLabel,\n\t\t...props\n\t}: WordPressComponentProps< TreeGridProps, 'table', false >,\n\t/** A ref to the underlying DOM table element. */\n\tref: React.ForwardedRef< HTMLTableElement >\n) {\n\tconst onKeyDown = useCallback(\n\t\t( event: React.KeyboardEvent< HTMLTableElement > ) => {\n\t\t\tconst { keyCode, metaKey, ctrlKey, altKey } = event;\n\n\t\t\t// The shift key is intentionally absent from the following list,\n\t\t\t// to enable shift + up/down to select items from the list.\n\t\t\tconst hasModifierKeyPressed = metaKey || ctrlKey || altKey;\n\n\t\t\tif (\n\t\t\t\thasModifierKeyPressed ||\n\t\t\t\t! ( [ UP, DOWN, LEFT, RIGHT, HOME, END ] as number[] ).includes(\n\t\t\t\t\tkeyCode\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// The event will be handled, stop propagation.\n\t\t\tevent.stopPropagation();\n\n\t\t\tconst { activeElement } = document;\n\t\t\tconst { currentTarget: treeGridElement } = event;\n\n\t\t\tif (\n\t\t\t\t! activeElement ||\n\t\t\t\t! treeGridElement.contains( activeElement )\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Calculate the columnIndex of the active element.\n\t\t\tconst activeRow =\n\t\t\t\tactiveElement.closest< HTMLElement >( '[role=\"row\"]' );\n\n\t\t\tif ( ! activeRow ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst focusablesInRow = getRowFocusables( activeRow );\n\t\t\tconst currentColumnIndex = focusablesInRow.indexOf(\n\t\t\t\tactiveElement as HTMLElement\n\t\t\t);\n\t\t\tconst canExpandCollapse = 0 === currentColumnIndex;\n\t\t\tconst cannotFocusNextColumn =\n\t\t\t\tcanExpandCollapse &&\n\t\t\t\t( activeRow.getAttribute( 'data-expanded' ) === 'false' ||\n\t\t\t\t\tactiveRow.getAttribute( 'aria-expanded' ) === 'false' ) &&\n\t\t\t\tkeyCode === RIGHT;\n\n\t\t\tif ( ( [ LEFT, RIGHT ] as number[] ).includes( keyCode ) ) {\n\t\t\t\t// Calculate to the next element.\n\t\t\t\tlet nextIndex;\n\t\t\t\tif ( keyCode === LEFT ) {\n\t\t\t\t\tnextIndex = Math.max( 0, currentColumnIndex - 1 );\n\t\t\t\t} else {\n\t\t\t\t\tnextIndex = Math.min(\n\t\t\t\t\t\tcurrentColumnIndex + 1,\n\t\t\t\t\t\tfocusablesInRow.length - 1\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t// Focus is at the left most column.\n\t\t\t\tif ( canExpandCollapse ) {\n\t\t\t\t\tif ( keyCode === LEFT ) {\n\t\t\t\t\t\t// Left:\n\t\t\t\t\t\t// If a row is focused, and it is expanded, collapses the current row.\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tactiveRow.getAttribute( 'data-expanded' ) ===\n\t\t\t\t\t\t\t\t'true' ||\n\t\t\t\t\t\t\tactiveRow.getAttribute( 'aria-expanded' ) === 'true'\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tonCollapseRow( activeRow );\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// If a row is focused, and it is collapsed, moves to the parent row (if there is one).\n\t\t\t\t\t\tconst level = Math.max(\n\t\t\t\t\t\t\tparseInt(\n\t\t\t\t\t\t\t\tactiveRow?.getAttribute( 'aria-level' ) ?? '1',\n\t\t\t\t\t\t\t\t10\n\t\t\t\t\t\t\t) - 1,\n\t\t\t\t\t\t\t1\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconst rows = Array.from(\n\t\t\t\t\t\t\ttreeGridElement.querySelectorAll< HTMLElement >(\n\t\t\t\t\t\t\t\t'[role=\"row\"]'\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\t\tlet parentRow = activeRow;\n\t\t\t\t\t\tconst currentRowIndex = rows.indexOf( activeRow );\n\t\t\t\t\t\tfor ( let i = currentRowIndex; i >= 0; i-- ) {\n\t\t\t\t\t\t\tconst ariaLevel =\n\t\t\t\t\t\t\t\trows[ i ].getAttribute( 'aria-level' );\n\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\tariaLevel !== null &&\n\t\t\t\t\t\t\t\tparseInt( ariaLevel, 10 ) === level\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tparentRow = rows[ i ];\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tgetRowFocusables( parentRow )?.[ 0 ]?.focus();\n\t\t\t\t\t}\n\t\t\t\t\tif ( keyCode === RIGHT ) {\n\t\t\t\t\t\t// Right:\n\t\t\t\t\t\t// If a row is focused, and it is collapsed, expands the current row.\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tactiveRow.getAttribute( 'data-expanded' ) ===\n\t\t\t\t\t\t\t\t'false' ||\n\t\t\t\t\t\t\tactiveRow.getAttribute( 'aria-expanded' ) ===\n\t\t\t\t\t\t\t\t'false'\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tonExpandRow( activeRow );\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// If a row is focused, and it is expanded, focuses the next cell in the row.\n\t\t\t\t\t\tconst focusableItems = getRowFocusables( activeRow );\n\t\t\t\t\t\tif ( focusableItems.length > 0 ) {\n\t\t\t\t\t\t\tfocusableItems[ nextIndex ]?.focus();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// Prevent key use for anything else. For example, Voiceover\n\t\t\t\t\t// will start reading text on continued use of left/right arrow\n\t\t\t\t\t// keys.\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Focus the next element. If at most left column and row is collapsed, moving right is not allowed as this will expand. However, if row is collapsed, moving left is allowed.\n\t\t\t\tif ( cannotFocusNextColumn ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tfocusablesInRow[ nextIndex ].focus();\n\n\t\t\t\t// Prevent key use for anything else. This ensures Voiceover\n\t\t\t\t// doesn't try to handle key navigation.\n\t\t\t\tevent.preventDefault();\n\t\t\t} else if ( ( [ UP, DOWN ] as number[] ).includes( keyCode ) ) {\n\t\t\t\t// Calculate the rowIndex of the next row.\n\t\t\t\tconst rows = Array.from(\n\t\t\t\t\ttreeGridElement.querySelectorAll< HTMLElement >(\n\t\t\t\t\t\t'[role=\"row\"]'\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\tconst currentRowIndex = rows.indexOf( activeRow );\n\t\t\t\tlet nextRowIndex;\n\n\t\t\t\tif ( keyCode === UP ) {\n\t\t\t\t\tnextRowIndex = Math.max( 0, currentRowIndex - 1 );\n\t\t\t\t} else {\n\t\t\t\t\tnextRowIndex = Math.min(\n\t\t\t\t\t\tcurrentRowIndex + 1,\n\t\t\t\t\t\trows.length - 1\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t// Focus is either at the top or bottom edge of the grid. Do nothing.\n\t\t\t\tif ( nextRowIndex === currentRowIndex ) {\n\t\t\t\t\t// Prevent key use for anything else. For example, Voiceover\n\t\t\t\t\t// will start navigating horizontally when reaching the vertical\n\t\t\t\t\t// bounds of a table.\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Get the focusables in the next row.\n\t\t\t\tconst focusablesInNextRow = getRowFocusables(\n\t\t\t\t\trows[ nextRowIndex ]\n\t\t\t\t);\n\n\t\t\t\t// If for some reason there are no focusables in the next row, do nothing.\n\t\t\t\tif ( ! focusablesInNextRow || ! focusablesInNextRow.length ) {\n\t\t\t\t\t// Prevent key use for anything else. For example, Voiceover\n\t\t\t\t\t// will still focus text when using arrow keys, while this\n\t\t\t\t\t// component should limit navigation to focusables.\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Try to focus the element in the next row that's at a similar column to the activeElement.\n\t\t\t\tconst nextIndex = Math.min(\n\t\t\t\t\tcurrentColumnIndex,\n\t\t\t\t\tfocusablesInNextRow.length - 1\n\t\t\t\t);\n\t\t\t\tfocusablesInNextRow[ nextIndex ].focus();\n\n\t\t\t\t// Let consumers know the row that was originally focused,\n\t\t\t\t// and the row that is now in focus.\n\t\t\t\tonFocusRow( event, activeRow, rows[ nextRowIndex ] );\n\n\t\t\t\t// Prevent key use for anything else. This ensures Voiceover\n\t\t\t\t// doesn't try to handle key navigation.\n\t\t\t\tevent.preventDefault();\n\t\t\t} else if ( ( [ HOME, END ] as number[] ).includes( keyCode ) ) {\n\t\t\t\t// Calculate the rowIndex of the next row.\n\t\t\t\tconst rows = Array.from(\n\t\t\t\t\ttreeGridElement.querySelectorAll< HTMLElement >(\n\t\t\t\t\t\t'[role=\"row\"]'\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\tconst currentRowIndex = rows.indexOf( activeRow );\n\t\t\t\tlet nextRowIndex;\n\n\t\t\t\tif ( keyCode === HOME ) {\n\t\t\t\t\tnextRowIndex = 0;\n\t\t\t\t} else {\n\t\t\t\t\tnextRowIndex = rows.length - 1;\n\t\t\t\t}\n\n\t\t\t\t// Focus is either at the top or bottom edge of the grid. Do nothing.\n\t\t\t\tif ( nextRowIndex === currentRowIndex ) {\n\t\t\t\t\t// Prevent key use for anything else. For example, Voiceover\n\t\t\t\t\t// will start navigating horizontally when reaching the vertical\n\t\t\t\t\t// bounds of a table.\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Get the focusables in the next row.\n\t\t\t\tconst focusablesInNextRow = getRowFocusables(\n\t\t\t\t\trows[ nextRowIndex ]\n\t\t\t\t);\n\n\t\t\t\t// If for some reason there are no focusables in the next row, do nothing.\n\t\t\t\tif ( ! focusablesInNextRow || ! focusablesInNextRow.length ) {\n\t\t\t\t\t// Prevent key use for anything else. For example, Voiceover\n\t\t\t\t\t// will still focus text when using arrow keys, while this\n\t\t\t\t\t// component should limit navigation to focusables.\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Try to focus the element in the next row that's at a similar column to the activeElement.\n\t\t\t\tconst nextIndex = Math.min(\n\t\t\t\t\tcurrentColumnIndex,\n\t\t\t\t\tfocusablesInNextRow.length - 1\n\t\t\t\t);\n\t\t\t\tfocusablesInNextRow[ nextIndex ].focus();\n\n\t\t\t\t// Let consumers know the row that was originally focused,\n\t\t\t\t// and the row that is now in focus.\n\t\t\t\tonFocusRow( event, activeRow, rows[ nextRowIndex ] );\n\n\t\t\t\t// Prevent key use for anything else. This ensures Voiceover\n\t\t\t\t// doesn't try to handle key navigation.\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t},\n\t\t[ onExpandRow, onCollapseRow, onFocusRow ]\n\t);\n\n\t/* Disable reason: A treegrid is implemented using a table element. */\n\t/* eslint-disable jsx-a11y/no-noninteractive-element-to-interactive-role */\n\treturn (\n\t\t<RovingTabIndexContainer>\n\t\t\t{\n\t\t\t\t// Prevent browser mode from triggering in NVDA by wrapping List View\n\t\t\t\t// in a role=application wrapper.\n\t\t\t\t// see: https://github.com/WordPress/gutenberg/issues/43729\n\t\t\t }\n\t\t\t<div role=\"application\" aria-label={ applicationAriaLabel }>\n\t\t\t\t<table\n\t\t\t\t\t{ ...props }\n\t\t\t\t\trole=\"treegrid\"\n\t\t\t\t\tonKeyDown={ onKeyDown }\n\t\t\t\t\tref={ ref }\n\t\t\t\t>\n\t\t\t\t\t<tbody>{ children }</tbody>\n\t\t\t\t</table>\n\t\t\t</div>\n\t\t</RovingTabIndexContainer>\n\t);\n\t/* eslint-enable jsx-a11y/no-noninteractive-element-to-interactive-role */\n}\n\n/**\n * `TreeGrid` is used to create a tree hierarchy.\n * It is not a visually styled component, but instead helps with adding\n * keyboard navigation and roving tab index behaviors to tree grid structures.\n *\n * A tree grid is a hierarchical 2 dimensional UI component, for example it could be\n * used to implement a file system browser.\n *\n * A tree grid allows the user to navigate using arrow keys.\n * Up/down to navigate vertically across rows, and left/right to navigate horizontally\n * between focusables in a row.\n *\n * The `TreeGrid` renders both a `table` and `tbody` element, and is intended to be used\n * with `TreeGridRow` (`tr`) and `TreeGridCell` (`td`) to build out a grid.\n *\n * ```jsx\n * function TreeMenu() {\n * \treturn (\n * \t\t<TreeGrid>\n * \t\t\t<TreeGridRow level={ 1 } positionInSet={ 1 } setSize={ 2 }>\n * \t\t\t\t<TreeGridCell>\n * \t\t\t\t\t{ ( props ) => (\n * \t\t\t\t\t\t<Button onClick={ onSelect } { ...props }>Select</Button>\n * \t\t\t\t\t) }\n * \t\t\t\t</TreeGridCell>\n * \t\t\t\t<TreeGridCell>\n * \t\t\t\t\t{ ( props ) => (\n * \t\t\t\t\t\t<Button onClick={ onMove } { ...props }>Move</Button>\n * \t\t\t\t\t) }\n * \t\t\t\t</TreeGridCell>\n * \t\t\t</TreeGridRow>\n * \t\t\t<TreeGridRow level={ 1 } positionInSet={ 2 } setSize={ 2 }>\n * \t\t\t\t<TreeGridCell>\n * \t\t\t\t\t{ ( props ) => (\n * \t\t\t\t\t\t<Button onClick={ onSelect } { ...props }>Select</Button>\n * \t\t\t\t\t) }\n * \t\t\t\t</TreeGridCell>\n * \t\t\t\t<TreeGridCell>\n * \t\t\t\t\t{ ( props ) => (\n * \t\t\t\t\t\t<Button onClick={ onMove } { ...props }>Move</Button>\n * \t\t\t\t\t) }\n * \t\t\t\t</TreeGridCell>\n * \t\t\t</TreeGridRow>\n * \t\t\t<TreeGridRow level={ 2 } positionInSet={ 1 } setSize={ 1 }>\n * \t\t\t\t<TreeGridCell>\n * \t\t\t\t\t{ ( props ) => (\n * \t\t\t\t\t\t<Button onClick={ onSelect } { ...props }>Select</Button>\n * \t\t\t\t\t) }\n * \t\t\t\t</TreeGridCell>\n * \t\t\t\t<TreeGridCell>\n * \t\t\t\t\t{ ( props ) => (\n * \t\t\t\t\t\t<Button onClick={ onMove } { ...props }>Move</Button>\n * \t\t\t\t\t) }\n * \t\t\t\t</TreeGridCell>\n * \t\t\t</TreeGridRow>\n * \t\t</TreeGrid>\n * \t);\n * }\n * ```\n *\n * @see {@link https://www.w3.org/TR/wai-aria-practices/examples/treegrid/treegrid-1.html}\n */\nexport const TreeGrid = forwardRef( UnforwardedTreeGrid );\n\nexport default TreeGrid;\nexport { default as TreeGridRow } from './row';\nexport { default as TreeGridCell } from './cell';\nexport { default as TreeGridItem } from './item';\n"]}
@@ -20,11 +20,10 @@ var _rovingTabIndexItem = _interopRequireDefault(require("./roving-tab-index-ite
20
20
  /**
21
21
  * Internal dependencies
22
22
  */
23
- function UnforwardedTreeGridItem(_ref, ref) {
24
- let {
25
- children,
26
- ...props
27
- } = _ref;
23
+ function UnforwardedTreeGridItem({
24
+ children,
25
+ ...props
26
+ }, ref) {
28
27
  return (0, _element.createElement)(_rovingTabIndexItem.default, (0, _extends2.default)({
29
28
  ref: ref
30
29
  }, props), children);
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/tree-grid/item.tsx"],"names":["UnforwardedTreeGridItem","ref","children","props","TreeGridItem"],"mappings":";;;;;;;;;AAGA;;;;AAKA;;AARA;AACA;AACA;;AAGA;AACA;AACA;AAIA,SAASA,uBAAT,OAECC,GAFD,EAGE;AAAA,MAFD;AAAEC,IAAAA,QAAF;AAAY,OAAGC;AAAf,GAEC;AACD,SACC,4BAAC,2BAAD;AAAoB,IAAA,GAAG,EAAGF;AAA1B,KAAqCE,KAArC,GACGD,QADH,CADD;AAKA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,MAAME,YAAY,GAAG,yBAAYJ,uBAAZ,CAArB;;eAEQI,Y","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport RovingTabIndexItem from './roving-tab-index-item';\nimport type { RovingTabIndexItemProps } from './types';\n\nfunction UnforwardedTreeGridItem(\n\t{ children, ...props }: RovingTabIndexItemProps,\n\tref: React.ForwardedRef< any >\n) {\n\treturn (\n\t\t<RovingTabIndexItem ref={ ref } { ...props }>\n\t\t\t{ children }\n\t\t</RovingTabIndexItem>\n\t);\n}\n\n/**\n * `TreeGridItem` is used to create a tree hierarchy.\n * It is not a visually styled component, but instead helps with adding\n * keyboard navigation and roving tab index behaviors to tree grid structures.\n *\n * @see {@link https://www.w3.org/TR/wai-aria-practices/examples/treegrid/treegrid-1.html}\n */\nexport const TreeGridItem = forwardRef( UnforwardedTreeGridItem );\n\nexport default TreeGridItem;\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/tree-grid/item.tsx"],"names":["UnforwardedTreeGridItem","children","props","ref","TreeGridItem"],"mappings":";;;;;;;;;AAGA;;;;AAKA;;AARA;AACA;AACA;;AAGA;AACA;AACA;AAIA,SAASA,uBAAT,CACC;AAAEC,EAAAA,QAAF;AAAY,KAAGC;AAAf,CADD,EAECC,GAFD,EAGE;AACD,SACC,4BAAC,2BAAD;AAAoB,IAAA,GAAG,EAAGA;AAA1B,KAAqCD,KAArC,GACGD,QADH,CADD;AAKA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,MAAMG,YAAY,GAAG,yBAAYJ,uBAAZ,CAArB;;eAEQI,Y","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport RovingTabIndexItem from './roving-tab-index-item';\nimport type { RovingTabIndexItemProps } from './types';\n\nfunction UnforwardedTreeGridItem(\n\t{ children, ...props }: RovingTabIndexItemProps,\n\tref: React.ForwardedRef< any >\n) {\n\treturn (\n\t\t<RovingTabIndexItem ref={ ref } { ...props }>\n\t\t\t{ children }\n\t\t</RovingTabIndexItem>\n\t);\n}\n\n/**\n * `TreeGridItem` is used to create a tree hierarchy.\n * It is not a visually styled component, but instead helps with adding\n * keyboard navigation and roving tab index behaviors to tree grid structures.\n *\n * @see {@link https://www.w3.org/TR/wai-aria-practices/examples/treegrid/treegrid-1.html}\n */\nexport const TreeGridItem = forwardRef( UnforwardedTreeGridItem );\n\nexport default TreeGridItem;\n"]}
@@ -16,12 +16,11 @@ var _rovingTabIndexContext = require("./roving-tab-index-context");
16
16
  /**
17
17
  * Internal dependencies
18
18
  */
19
- const RovingTabIndexItem = (0, _element.forwardRef)(function UnforwardedRovingTabIndexItem(_ref, forwardedRef) {
20
- let {
21
- children,
22
- as: Component,
23
- ...props
24
- } = _ref;
19
+ const RovingTabIndexItem = (0, _element.forwardRef)(function UnforwardedRovingTabIndexItem({
20
+ children,
21
+ as: Component,
22
+ ...props
23
+ }, forwardedRef) {
25
24
  const localRef = (0, _element.useRef)();
26
25
  const ref = forwardedRef || localRef; // @ts-expect-error - We actually want to throw an error if this is undefined.
27
26
 
@@ -39,7 +38,7 @@ const RovingTabIndexItem = (0, _element.forwardRef)(function UnforwardedRovingTa
39
38
  'current' in ref ? ref.current : undefined) ? 0 : -1;
40
39
  }
41
40
 
42
- const onFocus = event => setLastFocusedElement === null || setLastFocusedElement === void 0 ? void 0 : setLastFocusedElement(event.target);
41
+ const onFocus = event => setLastFocusedElement?.(event.target);
43
42
 
44
43
  const allProps = {
45
44
  ref,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/tree-grid/roving-tab-index-item.tsx"],"names":["RovingTabIndexItem","UnforwardedRovingTabIndexItem","forwardedRef","children","as","Component","props","localRef","ref","lastFocusedElement","setLastFocusedElement","tabIndex","current","undefined","onFocus","event","target","allProps"],"mappings":";;;;;;;AAGA;;AAKA;;AARA;AACA;AACA;;AAGA;AACA;AACA;AAIO,MAAMA,kBAAkB,GAAG,yBACjC,SAASC,6BAAT,OAECC,YAFD,EAGE;AAAA,MAFD;AAAEC,IAAAA,QAAF;AAAYC,IAAAA,EAAE,EAAEC,SAAhB;AAA2B,OAAGC;AAA9B,GAEC;AACD,QAAMC,QAAQ,GAAG,sBAAjB;AACA,QAAMC,GAAG,GAAGN,YAAY,IAAIK,QAA5B,CAFC,CAGD;;AACA,QAAM;AAAEE,IAAAA,kBAAF;AAAsBC,IAAAA;AAAtB,MACL,sDADD;AAEA,MAAIC,QAAJ;;AAEA,MAAKF,kBAAL,EAA0B;AACzBE,IAAAA,QAAQ,GACPF,kBAAkB,OAClB;AACA;AACA;AACA;AACE,iBAAaD,GAAb,GAAmBA,GAAG,CAACI,OAAvB,GAAiCC,SALjB,CAAlB,GAMG,CANH,GAOG,CAAC,CARL;AASA;;AAED,QAAMC,OAA+C,GAAKC,KAAF,IACvDL,qBADuD,aACvDA,qBADuD,uBACvDA,qBAAqB,CAAIK,KAAK,CAACC,MAAV,CADtB;;AAEA,QAAMC,QAAQ,GAAG;AAAET,IAAAA,GAAF;AAAOG,IAAAA,QAAP;AAAiBG,IAAAA,OAAjB;AAA0B,OAAGR;AAA7B,GAAjB;;AAEA,MAAK,OAAOH,QAAP,KAAoB,UAAzB,EAAsC;AACrC,WAAOA,QAAQ,CAAEc,QAAF,CAAf;AACA;;AAED,MAAK,CAAEZ,SAAP,EAAmB,OAAO,IAAP;AAEnB,SAAO,4BAAC,SAAD,EAAgBY,QAAhB,EAA6Bd,QAA7B,CAAP;AACA,CAnCgC,CAA3B;;eAsCQH,kB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useRef, forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { useRovingTabIndexContext } from './roving-tab-index-context';\nimport type { RovingTabIndexItemProps } from './types';\n\nexport const RovingTabIndexItem = forwardRef(\n\tfunction UnforwardedRovingTabIndexItem(\n\t\t{ children, as: Component, ...props }: RovingTabIndexItemProps,\n\t\tforwardedRef: React.ForwardedRef< any >\n\t) {\n\t\tconst localRef = useRef< any >();\n\t\tconst ref = forwardedRef || localRef;\n\t\t// @ts-expect-error - We actually want to throw an error if this is undefined.\n\t\tconst { lastFocusedElement, setLastFocusedElement } =\n\t\t\tuseRovingTabIndexContext();\n\t\tlet tabIndex;\n\n\t\tif ( lastFocusedElement ) {\n\t\t\ttabIndex =\n\t\t\t\tlastFocusedElement ===\n\t\t\t\t// TODO: The original implementation simply used `ref.current` here, assuming\n\t\t\t\t// that a forwarded ref would always be an object, which is not necessarily true.\n\t\t\t\t// This workaround maintains the original runtime behavior in a type-safe way,\n\t\t\t\t// but should be revisited.\n\t\t\t\t( 'current' in ref ? ref.current : undefined )\n\t\t\t\t\t? 0\n\t\t\t\t\t: -1;\n\t\t}\n\n\t\tconst onFocus: React.FocusEventHandler< HTMLElement > = ( event ) =>\n\t\t\tsetLastFocusedElement?.( event.target );\n\t\tconst allProps = { ref, tabIndex, onFocus, ...props };\n\n\t\tif ( typeof children === 'function' ) {\n\t\t\treturn children( allProps );\n\t\t}\n\n\t\tif ( ! Component ) return null;\n\n\t\treturn <Component { ...allProps }>{ children }</Component>;\n\t}\n);\n\nexport default RovingTabIndexItem;\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/tree-grid/roving-tab-index-item.tsx"],"names":["RovingTabIndexItem","UnforwardedRovingTabIndexItem","children","as","Component","props","forwardedRef","localRef","ref","lastFocusedElement","setLastFocusedElement","tabIndex","current","undefined","onFocus","event","target","allProps"],"mappings":";;;;;;;AAGA;;AAKA;;AARA;AACA;AACA;;AAGA;AACA;AACA;AAIO,MAAMA,kBAAkB,GAAG,yBACjC,SAASC,6BAAT,CACC;AAAEC,EAAAA,QAAF;AAAYC,EAAAA,EAAE,EAAEC,SAAhB;AAA2B,KAAGC;AAA9B,CADD,EAECC,YAFD,EAGE;AACD,QAAMC,QAAQ,GAAG,sBAAjB;AACA,QAAMC,GAAG,GAAGF,YAAY,IAAIC,QAA5B,CAFC,CAGD;;AACA,QAAM;AAAEE,IAAAA,kBAAF;AAAsBC,IAAAA;AAAtB,MACL,sDADD;AAEA,MAAIC,QAAJ;;AAEA,MAAKF,kBAAL,EAA0B;AACzBE,IAAAA,QAAQ,GACPF,kBAAkB,OAClB;AACA;AACA;AACA;AACE,iBAAaD,GAAb,GAAmBA,GAAG,CAACI,OAAvB,GAAiCC,SALjB,CAAlB,GAMG,CANH,GAOG,CAAC,CARL;AASA;;AAED,QAAMC,OAA+C,GAAKC,KAAF,IACvDL,qBAAqB,GAAIK,KAAK,CAACC,MAAV,CADtB;;AAEA,QAAMC,QAAQ,GAAG;AAAET,IAAAA,GAAF;AAAOG,IAAAA,QAAP;AAAiBG,IAAAA,OAAjB;AAA0B,OAAGT;AAA7B,GAAjB;;AAEA,MAAK,OAAOH,QAAP,KAAoB,UAAzB,EAAsC;AACrC,WAAOA,QAAQ,CAAEe,QAAF,CAAf;AACA;;AAED,MAAK,CAAEb,SAAP,EAAmB,OAAO,IAAP;AAEnB,SAAO,4BAAC,SAAD,EAAgBa,QAAhB,EAA6Bf,QAA7B,CAAP;AACA,CAnCgC,CAA3B;;eAsCQF,kB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useRef, forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { useRovingTabIndexContext } from './roving-tab-index-context';\nimport type { RovingTabIndexItemProps } from './types';\n\nexport const RovingTabIndexItem = forwardRef(\n\tfunction UnforwardedRovingTabIndexItem(\n\t\t{ children, as: Component, ...props }: RovingTabIndexItemProps,\n\t\tforwardedRef: React.ForwardedRef< any >\n\t) {\n\t\tconst localRef = useRef< any >();\n\t\tconst ref = forwardedRef || localRef;\n\t\t// @ts-expect-error - We actually want to throw an error if this is undefined.\n\t\tconst { lastFocusedElement, setLastFocusedElement } =\n\t\t\tuseRovingTabIndexContext();\n\t\tlet tabIndex;\n\n\t\tif ( lastFocusedElement ) {\n\t\t\ttabIndex =\n\t\t\t\tlastFocusedElement ===\n\t\t\t\t// TODO: The original implementation simply used `ref.current` here, assuming\n\t\t\t\t// that a forwarded ref would always be an object, which is not necessarily true.\n\t\t\t\t// This workaround maintains the original runtime behavior in a type-safe way,\n\t\t\t\t// but should be revisited.\n\t\t\t\t( 'current' in ref ? ref.current : undefined )\n\t\t\t\t\t? 0\n\t\t\t\t\t: -1;\n\t\t}\n\n\t\tconst onFocus: React.FocusEventHandler< HTMLElement > = ( event ) =>\n\t\t\tsetLastFocusedElement?.( event.target );\n\t\tconst allProps = { ref, tabIndex, onFocus, ...props };\n\n\t\tif ( typeof children === 'function' ) {\n\t\t\treturn children( allProps );\n\t\t}\n\n\t\tif ( ! Component ) return null;\n\n\t\treturn <Component { ...allProps }>{ children }</Component>;\n\t}\n);\n\nexport default RovingTabIndexItem;\n"]}
@@ -22,10 +22,9 @@ var _rovingTabIndexContext = require("./roving-tab-index-context");
22
22
  *
23
23
  * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/components/src/tree-grid/README.md
24
24
  */
25
- function RovingTabIndex(_ref) {
26
- let {
27
- children
28
- } = _ref;
25
+ function RovingTabIndex({
26
+ children
27
+ }) {
29
28
  const [lastFocusedElement, setLastFocusedElement] = (0, _element.useState)(); // Use `useMemo` to avoid creation of a new object for the providerValue
30
29
  // on every render. Only create a new object when the `lastFocusedElement`
31
30
  // value changes.
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/tree-grid/roving-tab-index.tsx"],"names":["RovingTabIndex","children","lastFocusedElement","setLastFocusedElement","providerValue"],"mappings":";;;;;;;AAGA;;AAKA;;AARA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACe,SAASA,cAAT,OAIX;AAAA,MAJoC;AACvCC,IAAAA;AADuC,GAIpC;AACH,QAAM,CAAEC,kBAAF,EAAsBC,qBAAtB,IACL,wBADD,CADG,CAIH;AACA;AACA;;AACA,QAAMC,aAAa,GAAG,sBACrB,OAAQ;AAAEF,IAAAA,kBAAF;AAAsBC,IAAAA;AAAtB,GAAR,CADqB,EAErB,CAAED,kBAAF,CAFqB,CAAtB;AAKA,SACC,4BAAC,6CAAD;AAAwB,IAAA,KAAK,EAAGE;AAAhC,KACGH,QADH,CADD;AAKA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState, useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { RovingTabIndexProvider } from './roving-tab-index-context';\n\n/**\n * Provider for adding roving tab index behaviors to tree grid structures.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/components/src/tree-grid/README.md\n */\nexport default function RovingTabIndex( {\n\tchildren,\n}: {\n\tchildren: React.ReactNode;\n} ) {\n\tconst [ lastFocusedElement, setLastFocusedElement ] =\n\t\tuseState< HTMLElement >();\n\n\t// Use `useMemo` to avoid creation of a new object for the providerValue\n\t// on every render. Only create a new object when the `lastFocusedElement`\n\t// value changes.\n\tconst providerValue = useMemo(\n\t\t() => ( { lastFocusedElement, setLastFocusedElement } ),\n\t\t[ lastFocusedElement ]\n\t);\n\n\treturn (\n\t\t<RovingTabIndexProvider value={ providerValue }>\n\t\t\t{ children }\n\t\t</RovingTabIndexProvider>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/tree-grid/roving-tab-index.tsx"],"names":["RovingTabIndex","children","lastFocusedElement","setLastFocusedElement","providerValue"],"mappings":";;;;;;;AAGA;;AAKA;;AARA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACe,SAASA,cAAT,CAAyB;AACvCC,EAAAA;AADuC,CAAzB,EAIX;AACH,QAAM,CAAEC,kBAAF,EAAsBC,qBAAtB,IACL,wBADD,CADG,CAIH;AACA;AACA;;AACA,QAAMC,aAAa,GAAG,sBACrB,OAAQ;AAAEF,IAAAA,kBAAF;AAAsBC,IAAAA;AAAtB,GAAR,CADqB,EAErB,CAAED,kBAAF,CAFqB,CAAtB;AAKA,SACC,4BAAC,6CAAD;AAAwB,IAAA,KAAK,EAAGE;AAAhC,KACGH,QADH,CADD;AAKA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState, useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { RovingTabIndexProvider } from './roving-tab-index-context';\n\n/**\n * Provider for adding roving tab index behaviors to tree grid structures.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/components/src/tree-grid/README.md\n */\nexport default function RovingTabIndex( {\n\tchildren,\n}: {\n\tchildren: React.ReactNode;\n} ) {\n\tconst [ lastFocusedElement, setLastFocusedElement ] =\n\t\tuseState< HTMLElement >();\n\n\t// Use `useMemo` to avoid creation of a new object for the providerValue\n\t// on every render. Only create a new object when the `lastFocusedElement`\n\t// value changes.\n\tconst providerValue = useMemo(\n\t\t() => ( { lastFocusedElement, setLastFocusedElement } ),\n\t\t[ lastFocusedElement ]\n\t);\n\n\treturn (\n\t\t<RovingTabIndexProvider value={ providerValue }>\n\t\t\t{ children }\n\t\t</RovingTabIndexProvider>\n\t);\n}\n"]}
@@ -14,15 +14,14 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
14
14
  /**
15
15
  * WordPress dependencies
16
16
  */
17
- function UnforwardedTreeGridRow(_ref, ref) {
18
- let {
19
- children,
20
- level,
21
- positionInSet,
22
- setSize,
23
- isExpanded,
24
- ...props
25
- } = _ref;
17
+ function UnforwardedTreeGridRow({
18
+ children,
19
+ level,
20
+ positionInSet,
21
+ setSize,
22
+ isExpanded,
23
+ ...props
24
+ }, ref) {
26
25
  return (0, _element.createElement)("tr", (0, _extends2.default)({}, props, {
27
26
  ref: ref,
28
27
  role: "row",
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/tree-grid/row.tsx"],"names":["UnforwardedTreeGridRow","ref","children","level","positionInSet","setSize","isExpanded","props","TreeGridRow"],"mappings":";;;;;;;;;AAGA;;;;AAHA;AACA;AACA;AASA,SAASA,sBAAT,OASCC,GATD,EAUE;AAAA,MATD;AACCC,IAAAA,QADD;AAECC,IAAAA,KAFD;AAGCC,IAAAA,aAHD;AAICC,IAAAA,OAJD;AAKCC,IAAAA,UALD;AAMC,OAAGC;AANJ,GASC;AACD,SACC,6DACMA,KADN;AAEC,IAAA,GAAG,EAAGN,GAFP;AAGC,IAAA,IAAI,EAAC,KAHN;AAIC,kBAAaE,KAJd;AAKC,qBAAgBC,aALjB;AAMC,oBAAeC,OANhB;AAOC,qBAAgBC;AAPjB,MASGJ,QATH,CADD;AAaA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,MAAMM,WAAW,GAAG,yBAAYR,sBAAZ,CAApB;;eAEQQ,W","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../ui/context';\nimport type { TreeGridRowProps } from './types';\n\nfunction UnforwardedTreeGridRow(\n\t{\n\t\tchildren,\n\t\tlevel,\n\t\tpositionInSet,\n\t\tsetSize,\n\t\tisExpanded,\n\t\t...props\n\t}: WordPressComponentProps< TreeGridRowProps, 'tr', false >,\n\tref: React.ForwardedRef< HTMLTableRowElement >\n) {\n\treturn (\n\t\t<tr\n\t\t\t{ ...props }\n\t\t\tref={ ref }\n\t\t\trole=\"row\"\n\t\t\taria-level={ level }\n\t\t\taria-posinset={ positionInSet }\n\t\t\taria-setsize={ setSize }\n\t\t\taria-expanded={ isExpanded }\n\t\t>\n\t\t\t{ children }\n\t\t</tr>\n\t);\n}\n\n/**\n * `TreeGridRow` is used to create a tree hierarchy.\n * It is not a visually styled component, but instead helps with adding\n * keyboard navigation and roving tab index behaviors to tree grid structures.\n *\n * @see {@link https://www.w3.org/TR/wai-aria-practices/examples/treegrid/treegrid-1.html}\n */\nexport const TreeGridRow = forwardRef( UnforwardedTreeGridRow );\n\nexport default TreeGridRow;\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/tree-grid/row.tsx"],"names":["UnforwardedTreeGridRow","children","level","positionInSet","setSize","isExpanded","props","ref","TreeGridRow"],"mappings":";;;;;;;;;AAGA;;;;AAHA;AACA;AACA;AASA,SAASA,sBAAT,CACC;AACCC,EAAAA,QADD;AAECC,EAAAA,KAFD;AAGCC,EAAAA,aAHD;AAICC,EAAAA,OAJD;AAKCC,EAAAA,UALD;AAMC,KAAGC;AANJ,CADD,EASCC,GATD,EAUE;AACD,SACC,6DACMD,KADN;AAEC,IAAA,GAAG,EAAGC,GAFP;AAGC,IAAA,IAAI,EAAC,KAHN;AAIC,kBAAaL,KAJd;AAKC,qBAAgBC,aALjB;AAMC,oBAAeC,OANhB;AAOC,qBAAgBC;AAPjB,MASGJ,QATH,CADD;AAaA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,MAAMO,WAAW,GAAG,yBAAYR,sBAAZ,CAApB;;eAEQQ,W","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../ui/context';\nimport type { TreeGridRowProps } from './types';\n\nfunction UnforwardedTreeGridRow(\n\t{\n\t\tchildren,\n\t\tlevel,\n\t\tpositionInSet,\n\t\tsetSize,\n\t\tisExpanded,\n\t\t...props\n\t}: WordPressComponentProps< TreeGridRowProps, 'tr', false >,\n\tref: React.ForwardedRef< HTMLTableRowElement >\n) {\n\treturn (\n\t\t<tr\n\t\t\t{ ...props }\n\t\t\tref={ ref }\n\t\t\trole=\"row\"\n\t\t\taria-level={ level }\n\t\t\taria-posinset={ positionInSet }\n\t\t\taria-setsize={ setSize }\n\t\t\taria-expanded={ isExpanded }\n\t\t>\n\t\t\t{ children }\n\t\t</tr>\n\t);\n}\n\n/**\n * `TreeGridRow` is used to create a tree hierarchy.\n * It is not a visually styled component, but instead helps with adding\n * keyboard navigation and roving tab index behaviors to tree grid structures.\n *\n * @see {@link https://www.w3.org/TR/wai-aria-practices/examples/treegrid/treegrid-1.html}\n */\nexport const TreeGridRow = forwardRef( UnforwardedTreeGridRow );\n\nexport default TreeGridRow;\n"]}
@@ -23,8 +23,7 @@ var _selectControl = require("../select-control");
23
23
  /**
24
24
  * Internal dependencies
25
25
  */
26
- function getSelectOptions(tree) {
27
- let level = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
26
+ function getSelectOptions(tree, level = 0) {
28
27
  return tree.flatMap(treeNode => [{
29
28
  value: treeNode.id,
30
29
  label: '\u00A0'.repeat(level * 3) + (0, _htmlEntities.decodeEntities)(treeNode.name)
@@ -80,15 +79,14 @@ function getSelectOptions(tree) {
80
79
  */
81
80
 
82
81
 
83
- function TreeSelect(_ref) {
84
- let {
85
- label,
86
- noOptionLabel,
87
- onChange,
88
- selectedId,
89
- tree = [],
90
- ...props
91
- } = _ref;
82
+ function TreeSelect({
83
+ label,
84
+ noOptionLabel,
85
+ onChange,
86
+ selectedId,
87
+ tree = [],
88
+ ...props
89
+ }) {
92
90
  const options = (0, _element.useMemo)(() => {
93
91
  return [noOptionLabel && {
94
92
  value: '',
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/tree-select/index.tsx"],"names":["getSelectOptions","tree","level","flatMap","treeNode","value","id","label","repeat","name","children","TreeSelect","noOptionLabel","onChange","selectedId","props","options","filter","option"],"mappings":";;;;;;;;;;AAGA;;;;AACA;;AAKA;;AATA;AACA;AACA;;AAIA;AACA;AACA;AAIA,SAASA,gBAAT,CACCC,IADD,EAG+C;AAAA,MAD9CC,KAC8C,uEADtC,CACsC;AAC9C,SAAOD,IAAI,CAACE,OAAL,CAAgBC,QAAF,IAAgB,CACpC;AACCC,IAAAA,KAAK,EAAED,QAAQ,CAACE,EADjB;AAECC,IAAAA,KAAK,EACJ,SAASC,MAAT,CAAiBN,KAAK,GAAG,CAAzB,IAA+B,kCAAgBE,QAAQ,CAACK,IAAzB;AAHjC,GADoC,EAMpC,GAAGT,gBAAgB,CAAEI,QAAQ,CAACM,QAAT,IAAqB,EAAvB,EAA2BR,KAAK,GAAG,CAAnC,CANiB,CAA9B,CAAP;AAQA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAEO,SAASS,UAAT,OAOc;AAAA,MAPO;AAC3BJ,IAAAA,KAD2B;AAE3BK,IAAAA,aAF2B;AAG3BC,IAAAA,QAH2B;AAI3BC,IAAAA,UAJ2B;AAK3Bb,IAAAA,IAAI,GAAG,EALoB;AAM3B,OAAGc;AANwB,GAOP;AACpB,QAAMC,OAAO,GAAG,sBAAS,MAAM;AAC9B,WAAO,CACNJ,aAAa,IAAI;AAAEP,MAAAA,KAAK,EAAE,EAAT;AAAaE,MAAAA,KAAK,EAAEK;AAApB,KADX,EAEN,GAAGZ,gBAAgB,CAAEC,IAAF,CAFb,EAGLgB,MAHK,CAGWC,MAAR,IAA8C,CAAC,CAAEA,MAHpD,CAAP;AAIA,GALe,EAKb,CAAEN,aAAF,EAAiBX,IAAjB,CALa,CAAhB;AAOA,SACC,4BAAC,4BAAD;AACQM,IAAAA,KADR;AACeS,IAAAA,OADf;AACwBH,IAAAA,QADxB;AAEC,IAAA,KAAK,EAAGC;AAFT,KAGMC,KAHN,EADD;AAOA;;eAEcJ,U","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport { SelectControl } from '../select-control';\nimport type { TreeSelectProps, Tree, Truthy } from './types';\n\nfunction getSelectOptions(\n\ttree: Tree[],\n\tlevel = 0\n): NonNullable< TreeSelectProps[ 'options' ] > {\n\treturn tree.flatMap( ( treeNode ) => [\n\t\t{\n\t\t\tvalue: treeNode.id,\n\t\t\tlabel:\n\t\t\t\t'\\u00A0'.repeat( level * 3 ) + decodeEntities( treeNode.name ),\n\t\t},\n\t\t...getSelectOptions( treeNode.children || [], level + 1 ),\n\t] );\n}\n\n/**\n * TreeSelect component is used to generate select input fields.\n *\n * @example\n * ```jsx\n * import { TreeSelect } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MyTreeSelect = () => {\n * \tconst [ page, setPage ] = useState( 'p21' );\n *\n * \treturn (\n * \t\t<TreeSelect\n * \t\t\tlabel=\"Parent page\"\n * \t\t\tnoOptionLabel=\"No parent page\"\n * \t\t\tonChange={ ( newPage ) => setPage( newPage ) }\n * \t\t\tselectedId={ page }\n * \t\t\ttree={ [\n * \t\t\t\t{\n * \t\t\t\t\tname: 'Page 1',\n * \t\t\t\t\tid: 'p1',\n * \t\t\t\t\tchildren: [\n * \t\t\t\t\t\t{ name: 'Descend 1 of page 1', id: 'p11' },\n * \t\t\t\t\t\t{ name: 'Descend 2 of page 1', id: 'p12' },\n * \t\t\t\t\t],\n * \t\t\t\t},\n * \t\t\t\t{\n * \t\t\t\t\tname: 'Page 2',\n * \t\t\t\t\tid: 'p2',\n * \t\t\t\t\tchildren: [\n * \t\t\t\t\t\t{\n * \t\t\t\t\t\t\tname: 'Descend 1 of page 2',\n * \t\t\t\t\t\t\tid: 'p21',\n * \t\t\t\t\t\t\tchildren: [\n * \t\t\t\t\t\t\t\t{\n * \t\t\t\t\t\t\t\t\tname: 'Descend 1 of Descend 1 of page 2',\n * \t\t\t\t\t\t\t\t\tid: 'p211',\n * \t\t\t\t\t\t\t\t},\n * \t\t\t\t\t\t\t],\n * \t\t\t\t\t\t},\n * \t\t\t\t\t],\n * \t\t\t\t},\n * \t\t\t] }\n * \t\t/>\n * \t);\n * }\n * ```\n */\n\nexport function TreeSelect( {\n\tlabel,\n\tnoOptionLabel,\n\tonChange,\n\tselectedId,\n\ttree = [],\n\t...props\n}: TreeSelectProps ) {\n\tconst options = useMemo( () => {\n\t\treturn [\n\t\t\tnoOptionLabel && { value: '', label: noOptionLabel },\n\t\t\t...getSelectOptions( tree ),\n\t\t].filter( < T, >( option: T ): option is Truthy< T > => !! option );\n\t}, [ noOptionLabel, tree ] );\n\n\treturn (\n\t\t<SelectControl\n\t\t\t{ ...{ label, options, onChange } }\n\t\t\tvalue={ selectedId }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n\nexport default TreeSelect;\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/tree-select/index.tsx"],"names":["getSelectOptions","tree","level","flatMap","treeNode","value","id","label","repeat","name","children","TreeSelect","noOptionLabel","onChange","selectedId","props","options","filter","option"],"mappings":";;;;;;;;;;AAGA;;;;AACA;;AAKA;;AATA;AACA;AACA;;AAIA;AACA;AACA;AAIA,SAASA,gBAAT,CACCC,IADD,EAECC,KAAK,GAAG,CAFT,EAG+C;AAC9C,SAAOD,IAAI,CAACE,OAAL,CAAgBC,QAAF,IAAgB,CACpC;AACCC,IAAAA,KAAK,EAAED,QAAQ,CAACE,EADjB;AAECC,IAAAA,KAAK,EACJ,SAASC,MAAT,CAAiBN,KAAK,GAAG,CAAzB,IAA+B,kCAAgBE,QAAQ,CAACK,IAAzB;AAHjC,GADoC,EAMpC,GAAGT,gBAAgB,CAAEI,QAAQ,CAACM,QAAT,IAAqB,EAAvB,EAA2BR,KAAK,GAAG,CAAnC,CANiB,CAA9B,CAAP;AAQA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAEO,SAASS,UAAT,CAAqB;AAC3BJ,EAAAA,KAD2B;AAE3BK,EAAAA,aAF2B;AAG3BC,EAAAA,QAH2B;AAI3BC,EAAAA,UAJ2B;AAK3Bb,EAAAA,IAAI,GAAG,EALoB;AAM3B,KAAGc;AANwB,CAArB,EAOc;AACpB,QAAMC,OAAO,GAAG,sBAAS,MAAM;AAC9B,WAAO,CACNJ,aAAa,IAAI;AAAEP,MAAAA,KAAK,EAAE,EAAT;AAAaE,MAAAA,KAAK,EAAEK;AAApB,KADX,EAEN,GAAGZ,gBAAgB,CAAEC,IAAF,CAFb,EAGLgB,MAHK,CAGWC,MAAR,IAA8C,CAAC,CAAEA,MAHpD,CAAP;AAIA,GALe,EAKb,CAAEN,aAAF,EAAiBX,IAAjB,CALa,CAAhB;AAOA,SACC,4BAAC,4BAAD;AACQM,IAAAA,KADR;AACeS,IAAAA,OADf;AACwBH,IAAAA,QADxB;AAEC,IAAA,KAAK,EAAGC;AAFT,KAGMC,KAHN,EADD;AAOA;;eAEcJ,U","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport { SelectControl } from '../select-control';\nimport type { TreeSelectProps, Tree, Truthy } from './types';\n\nfunction getSelectOptions(\n\ttree: Tree[],\n\tlevel = 0\n): NonNullable< TreeSelectProps[ 'options' ] > {\n\treturn tree.flatMap( ( treeNode ) => [\n\t\t{\n\t\t\tvalue: treeNode.id,\n\t\t\tlabel:\n\t\t\t\t'\\u00A0'.repeat( level * 3 ) + decodeEntities( treeNode.name ),\n\t\t},\n\t\t...getSelectOptions( treeNode.children || [], level + 1 ),\n\t] );\n}\n\n/**\n * TreeSelect component is used to generate select input fields.\n *\n * @example\n * ```jsx\n * import { TreeSelect } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MyTreeSelect = () => {\n * \tconst [ page, setPage ] = useState( 'p21' );\n *\n * \treturn (\n * \t\t<TreeSelect\n * \t\t\tlabel=\"Parent page\"\n * \t\t\tnoOptionLabel=\"No parent page\"\n * \t\t\tonChange={ ( newPage ) => setPage( newPage ) }\n * \t\t\tselectedId={ page }\n * \t\t\ttree={ [\n * \t\t\t\t{\n * \t\t\t\t\tname: 'Page 1',\n * \t\t\t\t\tid: 'p1',\n * \t\t\t\t\tchildren: [\n * \t\t\t\t\t\t{ name: 'Descend 1 of page 1', id: 'p11' },\n * \t\t\t\t\t\t{ name: 'Descend 2 of page 1', id: 'p12' },\n * \t\t\t\t\t],\n * \t\t\t\t},\n * \t\t\t\t{\n * \t\t\t\t\tname: 'Page 2',\n * \t\t\t\t\tid: 'p2',\n * \t\t\t\t\tchildren: [\n * \t\t\t\t\t\t{\n * \t\t\t\t\t\t\tname: 'Descend 1 of page 2',\n * \t\t\t\t\t\t\tid: 'p21',\n * \t\t\t\t\t\t\tchildren: [\n * \t\t\t\t\t\t\t\t{\n * \t\t\t\t\t\t\t\t\tname: 'Descend 1 of Descend 1 of page 2',\n * \t\t\t\t\t\t\t\t\tid: 'p211',\n * \t\t\t\t\t\t\t\t},\n * \t\t\t\t\t\t\t],\n * \t\t\t\t\t\t},\n * \t\t\t\t\t],\n * \t\t\t\t},\n * \t\t\t] }\n * \t\t/>\n * \t);\n * }\n * ```\n */\n\nexport function TreeSelect( {\n\tlabel,\n\tnoOptionLabel,\n\tonChange,\n\tselectedId,\n\ttree = [],\n\t...props\n}: TreeSelectProps ) {\n\tconst options = useMemo( () => {\n\t\treturn [\n\t\t\tnoOptionLabel && { value: '', label: noOptionLabel },\n\t\t\t...getSelectOptions( tree ),\n\t\t].filter( < T, >( option: T ): option is Truthy< T > => !! option );\n\t}, [ noOptionLabel, tree ] );\n\n\treturn (\n\t\t<SelectControl\n\t\t\t{ ...{ label, options, onChange } }\n\t\t\tvalue={ selectedId }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n\nexport default TreeSelect;\n"]}
@@ -57,9 +57,7 @@ function truncateMiddle(word, headLength, tailLength, ellipsis) {
57
57
  return word.slice(0, frontLength) + truncateStr + word.slice(wordLength - backLength);
58
58
  }
59
59
 
60
- function truncateContent() {
61
- let words = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
62
- let props = arguments.length > 1 ? arguments[1] : undefined;
60
+ function truncateContent(words = '', props) {
63
61
  const mergedProps = { ...TRUNCATE_DEFAULT_PROPS,
64
62
  ...props
65
63
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/truncate/utils.ts"],"names":["TRUNCATE_ELLIPSIS","TRUNCATE_TYPE","auto","head","middle","tail","none","TRUNCATE_DEFAULT_PROPS","ellipsis","ellipsizeMode","limit","numberOfLines","truncateMiddle","word","headLength","tailLength","wordLength","length","frontLength","backLength","truncateStr","slice","truncateContent","words","props","mergedProps","truncateHead","truncateTail","Math","floor","truncatedContent"],"mappings":";;;;;;;;;AAGA;;AAHA;AACA;AACA;AAIO,MAAMA,iBAAiB,GAAG,GAA1B;;AACA,MAAMC,aAAa,GAAG;AAC5BC,EAAAA,IAAI,EAAE,MADsB;AAE5BC,EAAAA,IAAI,EAAE,MAFsB;AAG5BC,EAAAA,MAAM,EAAE,QAHoB;AAI5BC,EAAAA,IAAI,EAAE,MAJsB;AAK5BC,EAAAA,IAAI,EAAE;AALsB,CAAtB;;AAQA,MAAMC,sBAAsB,GAAG;AACrCC,EAAAA,QAAQ,EAAER,iBAD2B;AAErCS,EAAAA,aAAa,EAAER,aAAa,CAACC,IAFQ;AAGrCQ,EAAAA,KAAK,EAAE,CAH8B;AAIrCC,EAAAA,aAAa,EAAE;AAJsB,CAA/B,C,CAOP;AACA;;;;AACO,SAASC,cAAT,CACNC,IADM,EAENC,UAFM,EAGNC,UAHM,EAINP,QAJM,EAKL;AACD,MAAK,OAAOK,IAAP,KAAgB,QAArB,EAAgC;AAC/B,WAAO,EAAP;AACA;;AACD,QAAMG,UAAU,GAAGH,IAAI,CAACI,MAAxB,CAJC,CAKD;AACA;;AACA,QAAMC,WAAW,GAAG,CAAC,CAACJ,UAAtB,CAPC,CAOiC;AAClC;;AACA,QAAMK,UAAU,GAAG,CAAC,CAACJ,UAArB;AACA;;AACA,QAAMK,WAAW,GAAG,4BAAgBZ,QAAhB,IACjBA,QADiB,GAEjBR,iBAFH;;AAIA,MACGkB,WAAW,KAAK,CAAhB,IAAqBC,UAAU,KAAK,CAAtC,IACAD,WAAW,IAAIF,UADf,IAEAG,UAAU,IAAIH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B,GAEGe,KAHJ;AAKA,SAAOO,gBAAP;AACA","sourcesContent":["/**\n * Internal dependencies\n */\nimport { isValueDefined } from '../utils/values';\nimport type { TruncateProps } from './types';\n\nexport const TRUNCATE_ELLIPSIS = '…';\nexport const TRUNCATE_TYPE = {\n\tauto: 'auto',\n\thead: 'head',\n\tmiddle: 'middle',\n\ttail: 'tail',\n\tnone: 'none',\n} as const;\n\nexport const TRUNCATE_DEFAULT_PROPS = {\n\tellipsis: TRUNCATE_ELLIPSIS,\n\tellipsizeMode: TRUNCATE_TYPE.auto,\n\tlimit: 0,\n\tnumberOfLines: 0,\n};\n\n// Source\n// https://github.com/kahwee/truncate-middle\nexport function truncateMiddle(\n\tword: string,\n\theadLength: number,\n\ttailLength: number,\n\tellipsis: string\n) {\n\tif ( typeof word !== 'string' ) {\n\t\treturn '';\n\t}\n\tconst wordLength = word.length;\n\t// Setting default values\n\t// eslint-disable-next-line no-bitwise\n\tconst frontLength = ~~headLength; // Will cast to integer\n\t// eslint-disable-next-line no-bitwise\n\tconst backLength = ~~tailLength;\n\t/* istanbul ignore next */\n\tconst truncateStr = isValueDefined( ellipsis )\n\t\t? ellipsis\n\t\t: TRUNCATE_ELLIPSIS;\n\n\tif (\n\t\t( frontLength === 0 && backLength === 0 ) ||\n\t\tfrontLength >= wordLength ||\n\t\tbackLength >= wordLength ||\n\t\tfrontLength + backLength >= wordLength\n\t) {\n\t\treturn word;\n\t} else if ( backLength === 0 ) {\n\t\treturn word.slice( 0, frontLength ) + truncateStr;\n\t}\n\treturn (\n\t\tword.slice( 0, frontLength ) +\n\t\ttruncateStr +\n\t\tword.slice( wordLength - backLength )\n\t);\n}\n\nexport function truncateContent(\n\twords: string = '',\n\tprops: Omit< TruncateProps, 'children' >\n) {\n\tconst mergedProps = { ...TRUNCATE_DEFAULT_PROPS, ...props };\n\tconst { ellipsis, ellipsizeMode, limit } = mergedProps;\n\n\tif ( ellipsizeMode === TRUNCATE_TYPE.none ) {\n\t\treturn words;\n\t}\n\n\tlet truncateHead: number;\n\tlet truncateTail: number;\n\n\tswitch ( ellipsizeMode ) {\n\t\tcase TRUNCATE_TYPE.head:\n\t\t\ttruncateHead = 0;\n\t\t\ttruncateTail = limit;\n\t\t\tbreak;\n\t\tcase TRUNCATE_TYPE.middle:\n\t\t\ttruncateHead = Math.floor( limit / 2 );\n\t\t\ttruncateTail = Math.floor( limit / 2 );\n\t\t\tbreak;\n\t\tdefault:\n\t\t\ttruncateHead = limit;\n\t\t\ttruncateTail = 0;\n\t}\n\n\tconst truncatedContent =\n\t\tellipsizeMode !== TRUNCATE_TYPE.auto\n\t\t\t? truncateMiddle( words, truncateHead, truncateTail, ellipsis )\n\t\t\t: words;\n\n\treturn truncatedContent;\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/truncate/utils.ts"],"names":["TRUNCATE_ELLIPSIS","TRUNCATE_TYPE","auto","head","middle","tail","none","TRUNCATE_DEFAULT_PROPS","ellipsis","ellipsizeMode","limit","numberOfLines","truncateMiddle","word","headLength","tailLength","wordLength","length","frontLength","backLength","truncateStr","slice","truncateContent","words","props","mergedProps","truncateHead","truncateTail","Math","floor","truncatedContent"],"mappings":";;;;;;;;;AAGA;;AAHA;AACA;AACA;AAIO,MAAMA,iBAAiB,GAAG,GAA1B;;AACA,MAAMC,aAAa,GAAG;AAC5BC,EAAAA,IAAI,EAAE,MADsB;AAE5BC,EAAAA,IAAI,EAAE,MAFsB;AAG5BC,EAAAA,MAAM,EAAE,QAHoB;AAI5BC,EAAAA,IAAI,EAAE,MAJsB;AAK5BC,EAAAA,IAAI,EAAE;AALsB,CAAtB;;AAQA,MAAMC,sBAAsB,GAAG;AACrCC,EAAAA,QAAQ,EAAER,iBAD2B;AAErCS,EAAAA,aAAa,EAAER,aAAa,CAACC,IAFQ;AAGrCQ,EAAAA,KAAK,EAAE,CAH8B;AAIrCC,EAAAA,aAAa,EAAE;AAJsB,CAA/B,C,CAOP;AACA;;;;AACO,SAASC,cAAT,CACNC,IADM,E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f;AACAC,MAAAA,YAAY,GAAGjB,KAAf;AACA;;AACD,SAAKT,aAAa,CAACG,MAAnB;AACCsB,MAAAA,YAAY,GAAGE,IAAI,CAACC,KAAL,CAAYnB,KAAK,GAAG,CAApB,CAAf;AACAiB,MAAAA,YAAY,GAAGC,IAAI,CAACC,KAAL,CAAYnB,KAAK,GAAG,CAApB,CAAf;AACA;;AACD;AACCgB,MAAAA,YAAY,GAAGhB,KAAf;AACAiB,MAAAA,YAAY,GAAG,CAAf;AAXF;;AAcA,QAAMG,gBAAgB,GACrBrB,aAAa,KAAKR,aAAa,CAACC,IAAhC,GACGU,cAAc,CAAEW,KAAF,EAASG,YAAT,EAAuBC,YAAvB,EAAqCnB,QAArC,CADjB,GAEGe,KAHJ;AAKA,SAAOO,gBAAP;AACA","sourcesContent":["/**\n * Internal dependencies\n */\nimport { isValueDefined } from '../utils/values';\nimport type { TruncateProps } from './types';\n\nexport const TRUNCATE_ELLIPSIS = '…';\nexport const TRUNCATE_TYPE = {\n\tauto: 'auto',\n\thead: 'head',\n\tmiddle: 'middle',\n\ttail: 'tail',\n\tnone: 'none',\n} as const;\n\nexport const TRUNCATE_DEFAULT_PROPS = {\n\tellipsis: TRUNCATE_ELLIPSIS,\n\tellipsizeMode: TRUNCATE_TYPE.auto,\n\tlimit: 0,\n\tnumberOfLines: 0,\n};\n\n// Source\n// https://github.com/kahwee/truncate-middle\nexport function truncateMiddle(\n\tword: string,\n\theadLength: number,\n\ttailLength: number,\n\tellipsis: string\n) {\n\tif ( typeof word !== 'string' ) {\n\t\treturn '';\n\t}\n\tconst wordLength = word.length;\n\t// Setting default values\n\t// eslint-disable-next-line no-bitwise\n\tconst frontLength = ~~headLength; // Will cast to integer\n\t// eslint-disable-next-line no-bitwise\n\tconst backLength = ~~tailLength;\n\t/* istanbul ignore next */\n\tconst truncateStr = isValueDefined( ellipsis )\n\t\t? ellipsis\n\t\t: TRUNCATE_ELLIPSIS;\n\n\tif (\n\t\t( frontLength === 0 && backLength === 0 ) ||\n\t\tfrontLength >= wordLength ||\n\t\tbackLength >= wordLength ||\n\t\tfrontLength + backLength >= wordLength\n\t) {\n\t\treturn word;\n\t} else if ( backLength === 0 ) {\n\t\treturn word.slice( 0, frontLength ) + truncateStr;\n\t}\n\treturn (\n\t\tword.slice( 0, frontLength ) +\n\t\ttruncateStr +\n\t\tword.slice( wordLength - backLength )\n\t);\n}\n\nexport function truncateContent(\n\twords: string = '',\n\tprops: Omit< TruncateProps, 'children' >\n) {\n\tconst mergedProps = { ...TRUNCATE_DEFAULT_PROPS, ...props };\n\tconst { ellipsis, ellipsizeMode, limit } = mergedProps;\n\n\tif ( ellipsizeMode === TRUNCATE_TYPE.none ) {\n\t\treturn words;\n\t}\n\n\tlet truncateHead: number;\n\tlet truncateTail: number;\n\n\tswitch ( ellipsizeMode ) {\n\t\tcase TRUNCATE_TYPE.head:\n\t\t\ttruncateHead = 0;\n\t\t\ttruncateTail = limit;\n\t\t\tbreak;\n\t\tcase TRUNCATE_TYPE.middle:\n\t\t\ttruncateHead = Math.floor( limit / 2 );\n\t\t\ttruncateTail = Math.floor( limit / 2 );\n\t\t\tbreak;\n\t\tdefault:\n\t\t\ttruncateHead = limit;\n\t\t\ttruncateTail = 0;\n\t}\n\n\tconst truncatedContent =\n\t\tellipsizeMode !== TRUNCATE_TYPE.auto\n\t\t\t? truncateMiddle( words, truncateHead, truncateTail, ellipsis )\n\t\t\t: words;\n\n\treturn truncatedContent;\n}\n"]}
@@ -61,7 +61,7 @@ function contextConnectWithoutRef(Component, namespace) {
61
61
 
62
62
 
63
63
  function _contextConnect(Component, namespace, options) {
64
- const WrappedComponent = options !== null && options !== void 0 && options.forwardsRef ? (0, _element.forwardRef)(Component) : Component;
64
+ const WrappedComponent = options?.forwardsRef ? (0, _element.forwardRef)(Component) : Component;
65
65
 
66
66
  if (typeof namespace === 'undefined') {
67
67
  typeof process !== "undefined" && process.env && process.env.NODE_ENV !== "production" ? (0, _warning.default)('contextConnect: Please provide a namespace') : void 0;
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/ui/context/context-connect.ts"],"names":["contextConnect","Component","namespace","_contextConnect","forwardsRef","contextConnectWithoutRef","options","WrappedComponent","mergedNamespace","CONNECT_STATIC_NAMESPACE","Array","isArray","Object","assign","Set","displayName","selector","getConnectNamespace","namespaces","type","hasConnectNamespace","match","includes","some","result"],"mappings":";;;;;;;;;;;;AAQA;;AACA;;AAKA;;AACA;;AAfA;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;;AAcA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,cAAT,CAGNC,SAHM,EAQNC,SARM,EASL;AACD,SAAOC,eAAe,CAAEF,SAAF,EAAaC,SAAb,EAAwB;AAAEE,IAAAA,WAAW,EAAE;AAAf,GAAxB,CAAtB;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASC,wBAAT,CACNJ,SADM,EAENC,SAFM,EAGL;AACD,SAAOC,eAAe,CAAEF,SAAF,EAAaC,SAAb,CAAtB;AACA,C,CAED;AACA;AACA;;;AACA,SAASC,eAAT,CAICF,SAJD,EAKCC,SALD,EAMCI,OAND,EAUE;AACD,QAAMC,gBAAgB,GAAGD,OAAO,SAAP,IAAAA,OAAO,WAAP,IAAAA,OAAO,CAAEF,WAAT,GACtB,yBAAyCH,SAAzC,CADsB,GAEtBA,SAFH;;AAIA,MAAK,OAAOC,SAAP,KAAqB,WAA1B,EAAwC;AACvC,mHAAM,4CAAN;AACA,GAPA,CASD;;;AACA,MAAIM,eAAe,GAAGD,gBAAgB,CAAEE,mCAAF,CAAhB,IAAgD,CACrEP,SADqE,CAAtE;AAIA;AACD;AACA;;AACC,MAAKQ,KAAK,CAACC,OAAN,CAAeT,SAAf,CAAL,EAAkC;AACjCM,IAAAA,eAAe,GAAG,CAAE,GAAGA,eAAL,EAAsB,GAAGN,SAAzB,CAAlB;AACA;;AACD,MAAK,OAAOA,SAAP,KAAqB,Q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hB,SAAF,CAAnB,CAAiCqB,QAAjC,CAA2CE,MAA3C,CADM,CAAP;AAGA;;AAED,SAAO,KAAP;AACA","sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef, ReactChild, ReactNode } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\nimport warn from '@wordpress/warning';\n\n/**\n * Internal dependencies\n */\nimport { CONNECT_STATIC_NAMESPACE } from './constants';\nimport { getStyledClassNameFromKey } from './get-styled-class-name-from-key';\nimport type { WordPressComponentFromProps } from '.';\n\ntype AcceptsTwoArgs<\n\tF extends ( ...args: any ) => any,\n\tErrorMessage = never\n> = Parameters< F >[ 'length' ] extends 2 ? {} : ErrorMessage;\n\ntype ContextConnectOptions = {\n\tforwardsRef?: boolean;\n};\n\n/**\n * Forwards ref (React.ForwardRef) and \"Connects\" (or registers) a component\n * within the Context system under a specified namespace.\n *\n * @param Component The component to register into the Context system.\n * @param namespace The namespace to register the component under.\n * @return The connected WordPressComponent\n */\nexport function contextConnect<\n\tC extends ( props: any, ref: ForwardedRef< any > ) => JSX.Element | null\n>(\n\tComponent: C &\n\t\tAcceptsTwoArgs<\n\t\t\tC,\n\t\t\t'Warning: Your component function does not take a ref as the second argument. Did you mean to use `contextConnectWithoutRef`?'\n\t\t>,\n\tnamespace: string\n) {\n\treturn _contextConnect( Component, namespace, { forwardsRef: true } );\n}\n\n/**\n * \"Connects\" (or registers) a component within the Context system under a specified namespace.\n * Does not forward a ref.\n *\n * @param Component The component to register into the Context system.\n * @param namespace The namespace to register the component under.\n * @return The connected WordPressComponent\n */\nexport function contextConnectWithoutRef< P >(\n\tComponent: ( props: P ) => JSX.Element | null,\n\tnamespace: string\n) {\n\treturn _contextConnect( Component, namespace );\n}\n\n// This is an (experimental) evolution of the initial connect() HOC.\n// The hope is that we can improve render performance by removing functional\n// component wrappers.\nfunction _contextConnect<\n\tC extends ( props: any, ref: ForwardedRef< any > ) => JSX.Element | null,\n\tO extends ContextConnectOptions\n>(\n\tComponent: C,\n\tnamespace: string,\n\toptions?: O\n): WordPressComponentFromProps<\n\tParameters< C >[ 0 ],\n\tO[ 'forwardsRef' ] extends true ? true : false\n> {\n\tconst WrappedComponent = options?.forwardsRef\n\t\t? forwardRef< any, Parameters< C >[ 0 ] >( Component )\n\t\t: Component;\n\n\tif ( typeof namespace === 'undefined' ) {\n\t\twarn( 'contextConnect: Please provide a namespace' );\n\t}\n\n\t// @ts-expect-error internal property\n\tlet mergedNamespace = WrappedComponent[ CONNECT_STATIC_NAMESPACE ] || [\n\t\tnamespace,\n\t];\n\n\t/**\n\t * Consolidate (merge) namespaces before attaching it to the WrappedComponent.\n\t */\n\tif ( Array.isArray( namespace ) ) {\n\t\tmergedNamespace = [ ...mergedNamespace, ...namespace ];\n\t}\n\tif ( typeof namespace === 'string' ) {\n\t\tmergedNamespace = [ ...mergedNamespace, namespace ];\n\t}\n\n\t// @ts-expect-error We can't rely on inferred types here because of the\n\t// `as` prop polymorphism we're handling in https://github.com/WordPress/gutenberg/blob/9620bae6fef4fde7cc2b7833f416e240207cda29/packages/components/src/ui/context/wordpress-component.ts#L32-L33\n\treturn Object.assign( WrappedComponent, {\n\t\t[ CONNECT_STATIC_NAMESPACE ]: [ ...new Set( mergedNamespace ) ],\n\t\tdisplayName: namespace,\n\t\tselector: `.${ getStyledClassNameFromKey( namespace ) }`,\n\t} );\n}\n\n/**\n * Attempts to retrieve the connected namespace from a component.\n *\n * @param Component The component to retrieve a namespace from.\n * @return The connected namespaces.\n */\nexport function getConnectNamespace(\n\tComponent: ReactChild | undefined | {}\n): string[] {\n\tif ( ! Component ) return [];\n\n\tlet namespaces = [];\n\n\t// @ts-ignore internal property\n\tif ( Component[ CONNECT_STATIC_NAMESPACE ] ) {\n\t\t// @ts-ignore internal property\n\t\tnamespaces = Component[ CONNECT_STATIC_NAMESPACE ];\n\t}\n\n\t// @ts-ignore\n\tif ( Component.type && Component.type[ CONNECT_STATIC_NAMESPACE ] ) {\n\t\t// @ts-ignore\n\t\tnamespaces = Component.type[ CONNECT_STATIC_NAMESPACE ];\n\t}\n\n\treturn namespaces;\n}\n\n/**\n * Checks to see if a component is connected within the Context system.\n *\n * @param Component The component to retrieve a namespace from.\n * @param match The namespace to check.\n */\nexport function hasConnectNamespace(\n\tComponent: ReactNode,\n\tmatch: string[] | string\n): boolean {\n\tif ( ! Component ) return false;\n\n\tif ( typeof match === 'string' ) {\n\t\treturn getConnectNamespace( Component ).includes( match );\n\t}\n\tif ( Array.isArray( match ) ) {\n\t\treturn match.some( ( result ) =>\n\t\t\tgetConnectNamespace( Component ).includes( result )\n\t\t);\n\t}\n\n\treturn false;\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/ui/context/context-connect.ts"],"names":["contextConnect","Component","namespace","_contextConnect","forwardsRef","contextConnectWithoutRef","options","WrappedComponent","mergedNamespace","CONNECT_STATIC_NAMESPACE","Array","isArray","Object","assign","Set","displayName","selector","getConnectNamespace","namespaces","type","hasConnectNamespace","match","includes","some","result"],"mappings":";;;;;;;;;;;;AAQA;;AACA;;AAKA;;AACA;;AAfA;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;;AAcA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,cAAT,CAGNC,SAHM,EAQNC,SARM,EASL;AACD,SAAOC,eAAe,CAAEF,SAAF,EAAaC,SAAb,EAAwB;AAAEE,IAAAA,WAAW,EAAE;AAAf,GAAxB,CAAtB;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASC,wBAAT,CACNJ,SADM,EAENC,SAFM,EAGL;AACD,SAAOC,eAAe,CAAEF,SAAF,EAAaC,SAAb,CAAtB;AACA,C,CAED;AACA;AACA;;;AACA,SAASC,eAAT,CAICF,SAJD,EAKCC,SALD,EAMCI,OAND,EAUE;AACD,QAAMC,gBAAgB,GAAGD,OAAO,EAAEF,WAAT,GACtB,yBAAyCH,SAAzC,CADsB,GAEtBA,SAFH;;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AACO,SAASE,mBAAT,CACNnB,SADM,EAENoB,KAFM,EAGI;AACV,MAAK,CAAEpB,SAAP,EAAmB,OAAO,KAAP;;AAEnB,MAAK,OAAOoB,KAAP,KAAiB,QAAtB,EAAiC;AAChC,WAAOJ,mBAAmB,CAAEhB,SAAF,CAAnB,CAAiCqB,QAAjC,CAA2CD,KAA3C,CAAP;AACA;;AACD,MAAKX,KAAK,CAACC,OAAN,CAAeU,KAAf,CAAL,EAA8B;AAC7B,WAAOA,KAAK,CAACE,IAAN,CAAcC,MAAF,IAClBP,mBAAmB,CAAEhB,SAAF,CAAnB,CAAiCqB,QAAjC,CAA2CE,MAA3C,CADM,CAAP;AAGA;;AAED,SAAO,KAAP;AACA","sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef, ReactChild, ReactNode } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\nimport warn from '@wordpress/warning';\n\n/**\n * Internal dependencies\n */\nimport { CONNECT_STATIC_NAMESPACE } from './constants';\nimport { getStyledClassNameFromKey } from './get-styled-class-name-from-key';\nimport type { WordPressComponentFromProps } from '.';\n\ntype AcceptsTwoArgs<\n\tF extends ( ...args: any ) => any,\n\tErrorMessage = never\n> = Parameters< F >[ 'length' ] extends 2 ? {} : ErrorMessage;\n\ntype ContextConnectOptions = {\n\tforwardsRef?: boolean;\n};\n\n/**\n * Forwards ref (React.ForwardRef) and \"Connects\" (or registers) a component\n * within the Context system under a specified namespace.\n *\n * @param Component The component to register into the Context system.\n * @param namespace The namespace to register the component under.\n * @return The connected WordPressComponent\n */\nexport function contextConnect<\n\tC extends ( props: any, ref: ForwardedRef< any > ) => JSX.Element | null\n>(\n\tComponent: C &\n\t\tAcceptsTwoArgs<\n\t\t\tC,\n\t\t\t'Warning: Your component function does not take a ref as the second argument. Did you mean to use `contextConnectWithoutRef`?'\n\t\t>,\n\tnamespace: string\n) {\n\treturn _contextConnect( Component, namespace, { forwardsRef: true } );\n}\n\n/**\n * \"Connects\" (or registers) a component within the Context system under a specified namespace.\n * Does not forward a ref.\n *\n * @param Component The component to register into the Context system.\n * @param namespace The namespace to register the component under.\n * @return The connected WordPressComponent\n */\nexport function contextConnectWithoutRef< P >(\n\tComponent: ( props: P ) => JSX.Element | null,\n\tnamespace: string\n) {\n\treturn _contextConnect( Component, namespace );\n}\n\n// This is an (experimental) evolution of the initial connect() HOC.\n// The hope is that we can improve render performance by removing functional\n// component wrappers.\nfunction _contextConnect<\n\tC extends ( props: any, ref: ForwardedRef< any > ) => JSX.Element | null,\n\tO extends ContextConnectOptions\n>(\n\tComponent: C,\n\tnamespace: string,\n\toptions?: O\n): WordPressComponentFromProps<\n\tParameters< C >[ 0 ],\n\tO[ 'forwardsRef' ] extends true ? true : false\n> {\n\tconst WrappedComponent = options?.forwardsRef\n\t\t? forwardRef< any, Parameters< C >[ 0 ] >( Component )\n\t\t: Component;\n\n\tif ( typeof namespace === 'undefined' ) {\n\t\twarn( 'contextConnect: Please provide a namespace' );\n\t}\n\n\t// @ts-expect-error internal property\n\tlet mergedNamespace = WrappedComponent[ CONNECT_STATIC_NAMESPACE ] || [\n\t\tnamespace,\n\t];\n\n\t/**\n\t * Consolidate (merge) namespaces before attaching it to the WrappedComponent.\n\t */\n\tif ( Array.isArray( namespace ) ) {\n\t\tmergedNamespace = [ ...mergedNamespace, ...namespace ];\n\t}\n\tif ( typeof namespace === 'string' ) {\n\t\tmergedNamespace = [ ...mergedNamespace, namespace ];\n\t}\n\n\t// @ts-expect-error We can't rely on inferred types here because of the\n\t// `as` prop polymorphism we're handling in https://github.com/WordPress/gutenberg/blob/9620bae6fef4fde7cc2b7833f416e240207cda29/packages/components/src/ui/context/wordpress-component.ts#L32-L33\n\treturn Object.assign( WrappedComponent, {\n\t\t[ CONNECT_STATIC_NAMESPACE ]: [ ...new Set( mergedNamespace ) ],\n\t\tdisplayName: namespace,\n\t\tselector: `.${ getStyledClassNameFromKey( namespace ) }`,\n\t} );\n}\n\n/**\n * Attempts to retrieve the connected namespace from a component.\n *\n * @param Component The component to retrieve a namespace from.\n * @return The connected namespaces.\n */\nexport function getConnectNamespace(\n\tComponent: ReactChild | undefined | {}\n): string[] {\n\tif ( ! Component ) return [];\n\n\tlet namespaces = [];\n\n\t// @ts-ignore internal property\n\tif ( Component[ CONNECT_STATIC_NAMESPACE ] ) {\n\t\t// @ts-ignore internal property\n\t\tnamespaces = Component[ CONNECT_STATIC_NAMESPACE ];\n\t}\n\n\t// @ts-ignore\n\tif ( Component.type && Component.type[ CONNECT_STATIC_NAMESPACE ] ) {\n\t\t// @ts-ignore\n\t\tnamespaces = Component.type[ CONNECT_STATIC_NAMESPACE ];\n\t}\n\n\treturn namespaces;\n}\n\n/**\n * Checks to see if a component is connected within the Context system.\n *\n * @param Component The component to retrieve a namespace from.\n * @param match The namespace to check.\n */\nexport function hasConnectNamespace(\n\tComponent: ReactNode,\n\tmatch: string[] | string\n): boolean {\n\tif ( ! Component ) return false;\n\n\tif ( typeof match === 'string' ) {\n\t\treturn getConnectNamespace( Component ).includes( match );\n\t}\n\tif ( Array.isArray( match ) ) {\n\t\treturn match.some( ( result ) =>\n\t\t\tgetConnectNamespace( Component ).includes( result )\n\t\t);\n\t}\n\n\treturn false;\n}\n"]}