@wordpress/components 25.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 (1415) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/build/alignment-matrix-control/cell.js +5 -6
  3. package/build/alignment-matrix-control/cell.js.map +1 -1
  4. package/build/alignment-matrix-control/icon.js +8 -9
  5. package/build/alignment-matrix-control/icon.js.map +1 -1
  6. package/build/alignment-matrix-control/index.js +10 -11
  7. package/build/alignment-matrix-control/index.js.map +1 -1
  8. package/build/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.js +6 -8
  9. package/build/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.js.map +1 -1
  10. package/build/alignment-matrix-control/styles/alignment-matrix-control-styles.js +6 -8
  11. package/build/alignment-matrix-control/styles/alignment-matrix-control-styles.js.map +1 -1
  12. package/build/alignment-matrix-control/utils.js +1 -2
  13. package/build/alignment-matrix-control/utils.js.map +1 -1
  14. package/build/angle-picker-control/angle-circle.js +6 -9
  15. package/build/angle-picker-control/angle-circle.js.map +1 -1
  16. package/build/angle-picker-control/styles/angle-picker-control-styles.js +3 -4
  17. package/build/angle-picker-control/styles/angle-picker-control-styles.js.map +1 -1
  18. package/build/animate/index.js +5 -6
  19. package/build/animate/index.js.map +1 -1
  20. package/build/autocomplete/autocompleter-ui.js +29 -33
  21. package/build/autocomplete/autocompleter-ui.js.map +1 -1
  22. package/build/autocomplete/autocompleter-ui.native.js +15 -22
  23. package/build/autocomplete/autocompleter-ui.native.js.map +1 -1
  24. package/build/autocomplete/background-view.android.js +3 -4
  25. package/build/autocomplete/background-view.android.js.map +1 -1
  26. package/build/autocomplete/background-view.ios.js +3 -4
  27. package/build/autocomplete/background-view.ios.js.map +1 -1
  28. package/build/autocomplete/get-default-use-items.js +1 -3
  29. package/build/autocomplete/get-default-use-items.js.map +1 -1
  30. package/build/autocomplete/index.js +18 -23
  31. package/build/autocomplete/index.js.map +1 -1
  32. package/build/base-control/index.js +14 -16
  33. package/build/base-control/index.js.map +1 -1
  34. package/build/base-control/index.native.js +5 -6
  35. package/build/base-control/index.native.js.map +1 -1
  36. package/build/base-control/styles/base-control-styles.js +6 -8
  37. package/build/base-control/styles/base-control-styles.js.map +1 -1
  38. package/build/border-box-control/border-box-control/hook.js +5 -5
  39. package/build/border-box-control/border-box-control/hook.js.map +1 -1
  40. package/build/border-box-control/border-box-control-split-controls/component.js +4 -4
  41. package/build/border-box-control/border-box-control-split-controls/component.js.map +1 -1
  42. package/build/border-box-control/styles.js +3 -3
  43. package/build/border-box-control/styles.js.map +1 -1
  44. package/build/border-box-control/utils.js +5 -8
  45. package/build/border-box-control/utils.js.map +1 -1
  46. package/build/border-control/border-control/component.js +1 -1
  47. package/build/border-control/border-control/component.js.map +1 -1
  48. package/build/border-control/border-control/hook.js +5 -5
  49. package/build/border-control/border-control/hook.js.map +1 -1
  50. package/build/border-control/border-control-dropdown/component.js +70 -67
  51. package/build/border-control/border-control-dropdown/component.js.map +1 -1
  52. package/build/border-control/border-control-dropdown/hook.js +4 -4
  53. package/build/border-control/border-control-dropdown/hook.js.map +1 -1
  54. package/build/box-control/all-input-control.js +11 -12
  55. package/build/box-control/all-input-control.js.map +1 -1
  56. package/build/box-control/axial-input-controls.js +12 -14
  57. package/build/box-control/axial-input-controls.js.map +1 -1
  58. package/build/box-control/icon.js +7 -9
  59. package/build/box-control/icon.js.map +1 -1
  60. package/build/box-control/index.js +22 -24
  61. package/build/box-control/index.js.map +1 -1
  62. package/build/box-control/input-controls.js +15 -18
  63. package/build/box-control/input-controls.js.map +1 -1
  64. package/build/box-control/linked-button.js +4 -5
  65. package/build/box-control/linked-button.js.map +1 -1
  66. package/build/box-control/styles/box-control-icon-styles.js +3 -4
  67. package/build/box-control/styles/box-control-icon-styles.js.map +1 -1
  68. package/build/box-control/styles/box-control-styles.js +9 -12
  69. package/build/box-control/styles/box-control-styles.js.map +1 -1
  70. package/build/box-control/styles/box-control-visualizer-styles.js +7 -11
  71. package/build/box-control/styles/box-control-visualizer-styles.js.map +1 -1
  72. package/build/box-control/unit-control.js +18 -22
  73. package/build/box-control/unit-control.js.map +1 -1
  74. package/build/box-control/utils.js +4 -10
  75. package/build/box-control/utils.js.map +1 -1
  76. package/build/button/deprecated.js +7 -8
  77. package/build/button/deprecated.js.map +1 -1
  78. package/build/button/index.js +15 -16
  79. package/build/button/index.js.map +1 -1
  80. package/build/button/index.native.js +5 -7
  81. package/build/button/index.native.js.map +1 -1
  82. package/build/card/card/hook.js +5 -6
  83. package/build/card/card/hook.js.map +1 -1
  84. package/build/circular-option-picker/index.js +27 -33
  85. package/build/circular-option-picker/index.js.map +1 -1
  86. package/build/clipboard-button/index.js +8 -9
  87. package/build/clipboard-button/index.js.map +1 -1
  88. package/build/color-control/index.native.js +7 -8
  89. package/build/color-control/index.native.js.map +1 -1
  90. package/build/color-indicator/index.native.js +10 -12
  91. package/build/color-indicator/index.native.js.map +1 -1
  92. package/build/color-palette/index.js +63 -72
  93. package/build/color-palette/index.js.map +1 -1
  94. package/build/color-palette/index.native.js +33 -47
  95. package/build/color-palette/index.native.js.map +1 -1
  96. package/build/color-palette/utils.js +2 -5
  97. package/build/color-palette/utils.js.map +1 -1
  98. package/build/color-picker/color-input.js +6 -7
  99. package/build/color-picker/color-input.js.map +1 -1
  100. package/build/color-picker/hex-input.js +8 -12
  101. package/build/color-picker/hex-input.js.map +1 -1
  102. package/build/color-picker/hsl-input.js +5 -6
  103. package/build/color-picker/hsl-input.js.map +1 -1
  104. package/build/color-picker/index.native.js +23 -30
  105. package/build/color-picker/index.native.js.map +1 -1
  106. package/build/color-picker/input-with-slider.js +8 -10
  107. package/build/color-picker/input-with-slider.js.map +1 -1
  108. package/build/color-picker/picker.js +5 -6
  109. package/build/color-picker/picker.js.map +1 -1
  110. package/build/color-picker/rgb-input.js +5 -6
  111. package/build/color-picker/rgb-input.js.map +1 -1
  112. package/build/color-picker/use-deprecated-props.js +1 -3
  113. package/build/color-picker/use-deprecated-props.js.map +1 -1
  114. package/build/combobox-control/index.js +3 -6
  115. package/build/combobox-control/index.js.map +1 -1
  116. package/build/combobox-control/styles.js +3 -6
  117. package/build/combobox-control/styles.js.map +1 -1
  118. package/build/confirm-dialog/component.js +1 -1
  119. package/build/confirm-dialog/component.js.map +1 -1
  120. package/build/custom-gradient-picker/gradient-bar/control-points.js +116 -131
  121. package/build/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
  122. package/build/custom-gradient-picker/gradient-bar/index.js +12 -14
  123. package/build/custom-gradient-picker/gradient-bar/index.js.map +1 -1
  124. package/build/custom-gradient-picker/gradient-bar/utils.js +4 -6
  125. package/build/custom-gradient-picker/gradient-bar/utils.js.map +1 -1
  126. package/build/custom-gradient-picker/index.js +19 -22
  127. package/build/custom-gradient-picker/index.js.map +1 -1
  128. package/build/custom-gradient-picker/index.native.js +7 -8
  129. package/build/custom-gradient-picker/index.native.js.map +1 -1
  130. package/build/custom-gradient-picker/serializer.js +15 -21
  131. package/build/custom-gradient-picker/serializer.js.map +1 -1
  132. package/build/custom-gradient-picker/utils.js +6 -9
  133. package/build/custom-gradient-picker/utils.js.map +1 -1
  134. package/build/custom-select-control/index.js +14 -21
  135. package/build/custom-select-control/index.js.map +1 -1
  136. package/build/dashicon/index.js +7 -8
  137. package/build/dashicon/index.js.map +1 -1
  138. package/build/dashicon/index.native.js +4 -5
  139. package/build/dashicon/index.native.js.map +1 -1
  140. package/build/date-time/date/index.js +24 -26
  141. package/build/date-time/date/index.js.map +1 -1
  142. package/build/date-time/date-time/index.js +9 -10
  143. package/build/date-time/date-time/index.js.map +1 -1
  144. package/build/date-time/time/index.js +11 -14
  145. package/build/date-time/time/index.js.map +1 -1
  146. package/build/dimension-control/index.js +8 -11
  147. package/build/dimension-control/index.js.map +1 -1
  148. package/build/disabled/index.js +6 -7
  149. package/build/disabled/index.js.map +1 -1
  150. package/build/disabled/index.native.js +3 -4
  151. package/build/disabled/index.native.js.map +1 -1
  152. package/build/divider/styles.js +21 -29
  153. package/build/divider/styles.js.map +1 -1
  154. package/build/draggable/index.js +14 -19
  155. package/build/draggable/index.js.map +1 -1
  156. package/build/draggable/index.native.js +17 -19
  157. package/build/draggable/index.native.js.map +1 -1
  158. package/build/drop-zone/index.js +11 -16
  159. package/build/drop-zone/index.js.map +1 -1
  160. package/build/drop-zone/provider.js +3 -4
  161. package/build/drop-zone/provider.js.map +1 -1
  162. package/build/dropdown/index.js +19 -23
  163. package/build/dropdown/index.js.map +1 -1
  164. package/build/dropdown/styles.js +3 -4
  165. package/build/dropdown/styles.js.map +1 -1
  166. package/build/dropdown-menu/index.js +9 -15
  167. package/build/dropdown-menu/index.js.map +1 -1
  168. package/build/dropdown-menu/index.native.js +22 -30
  169. package/build/dropdown-menu/index.native.js.map +1 -1
  170. package/build/dropdown-menu-v2/index.js +92 -57
  171. package/build/dropdown-menu-v2/index.js.map +1 -1
  172. package/build/dropdown-menu-v2/styles.js +25 -17
  173. package/build/dropdown-menu-v2/styles.js.map +1 -1
  174. package/build/duotone-picker/color-list-picker/index.js +16 -18
  175. package/build/duotone-picker/color-list-picker/index.js.map +1 -1
  176. package/build/duotone-picker/custom-duotone-bar.js +4 -5
  177. package/build/duotone-picker/custom-duotone-bar.js.map +1 -1
  178. package/build/duotone-picker/duotone-picker.js +15 -17
  179. package/build/duotone-picker/duotone-picker.js.map +1 -1
  180. package/build/duotone-picker/duotone-swatch.js +3 -4
  181. package/build/duotone-picker/duotone-swatch.js.map +1 -1
  182. package/build/duotone-picker/utils.js +14 -27
  183. package/build/duotone-picker/utils.js.map +1 -1
  184. package/build/external-link/index.js +1 -1
  185. package/build/external-link/index.js.map +1 -1
  186. package/build/external-link/index.native.js +4 -5
  187. package/build/external-link/index.native.js.map +1 -1
  188. package/build/focal-point-picker/controls.js +11 -10
  189. package/build/focal-point-picker/controls.js.map +1 -1
  190. package/build/focal-point-picker/focal-point.js +5 -6
  191. package/build/focal-point-picker/focal-point.js.map +1 -1
  192. package/build/focal-point-picker/focal-point.native.js +5 -6
  193. package/build/focal-point-picker/focal-point.native.js.map +1 -1
  194. package/build/focal-point-picker/grid.js +4 -5
  195. package/build/focal-point-picker/grid.js.map +1 -1
  196. package/build/focal-point-picker/index.js +33 -37
  197. package/build/focal-point-picker/index.js.map +1 -1
  198. package/build/focal-point-picker/index.native.js +10 -12
  199. package/build/focal-point-picker/index.native.js.map +1 -1
  200. package/build/focal-point-picker/media.js +11 -13
  201. package/build/focal-point-picker/media.js.map +1 -1
  202. package/build/focal-point-picker/styles/focal-point-picker-style.js +9 -14
  203. package/build/focal-point-picker/styles/focal-point-picker-style.js.map +1 -1
  204. package/build/focal-point-picker/styles/focal-point-style.js +3 -6
  205. package/build/focal-point-picker/styles/focal-point-style.js.map +1 -1
  206. package/build/focal-point-picker/tooltip/index.native.js +16 -21
  207. package/build/focal-point-picker/tooltip/index.native.js.map +1 -1
  208. package/build/focal-point-picker/utils.js +2 -4
  209. package/build/focal-point-picker/utils.js.map +1 -1
  210. package/build/focusable-iframe/index.js +4 -5
  211. package/build/focusable-iframe/index.js.map +1 -1
  212. package/build/font-size-picker/font-size-picker-select.js +3 -5
  213. package/build/font-size-picker/font-size-picker-select.js.map +1 -1
  214. package/build/font-size-picker/index.js +13 -19
  215. package/build/font-size-picker/index.js.map +1 -1
  216. package/build/font-size-picker/index.native.js +6 -7
  217. package/build/font-size-picker/index.native.js.map +1 -1
  218. package/build/font-size-picker/styles.js +24 -8
  219. package/build/font-size-picker/styles.js.map +1 -1
  220. package/build/footer-message-control/index.native.js +2 -3
  221. package/build/footer-message-control/index.native.js.map +1 -1
  222. package/build/form-file-upload/index.js +10 -13
  223. package/build/form-file-upload/index.js.map +1 -1
  224. package/build/form-token-field/index.js +4 -19
  225. package/build/form-token-field/index.js.map +1 -1
  226. package/build/form-token-field/styles.js +4 -7
  227. package/build/form-token-field/styles.js.map +1 -1
  228. package/build/form-token-field/suggestions-list.js +14 -15
  229. package/build/form-token-field/suggestions-list.js.map +1 -1
  230. package/build/form-token-field/token-input.js +2 -2
  231. package/build/form-token-field/token-input.js.map +1 -1
  232. package/build/form-token-field/token.js +14 -15
  233. package/build/form-token-field/token.js.map +1 -1
  234. package/build/gradient-picker/index.js +51 -58
  235. package/build/gradient-picker/index.js.map +1 -1
  236. package/build/guide/icons.js +13 -16
  237. package/build/guide/icons.js.map +1 -1
  238. package/build/guide/index.js +9 -12
  239. package/build/guide/index.js.map +1 -1
  240. package/build/guide/page-control.js +5 -6
  241. package/build/guide/page-control.js.map +1 -1
  242. package/build/h-stack/utils.js +1 -3
  243. package/build/h-stack/utils.js.map +1 -1
  244. package/build/higher-order/navigate-regions/index.js +16 -22
  245. package/build/higher-order/navigate-regions/index.js.map +1 -1
  246. package/build/higher-order/with-focus-outside/index.js +1 -1
  247. package/build/higher-order/with-focus-outside/index.js.map +1 -1
  248. package/build/higher-order/with-focus-outside/index.native.js +1 -1
  249. package/build/higher-order/with-focus-outside/index.native.js.map +1 -1
  250. package/build/higher-order/with-focus-return/index.js +13 -17
  251. package/build/higher-order/with-focus-return/index.js.map +1 -1
  252. package/build/icon/index.js +5 -7
  253. package/build/icon/index.js.map +1 -1
  254. package/build/input-control/backdrop.js +4 -5
  255. package/build/input-control/backdrop.js.map +1 -1
  256. package/build/input-control/index.js +22 -23
  257. package/build/input-control/index.js.map +1 -1
  258. package/build/input-control/input-base.js +16 -17
  259. package/build/input-control/input-base.js.map +1 -1
  260. package/build/input-control/input-field.js +26 -29
  261. package/build/input-control/input-field.js.map +1 -1
  262. package/build/input-control/label.js +6 -7
  263. package/build/input-control/label.js.map +1 -1
  264. package/build/input-control/reducer/reducer.js +2 -6
  265. package/build/input-control/reducer/reducer.js.map +1 -1
  266. package/build/input-control/styles/input-control-styles.js +32 -41
  267. package/build/input-control/styles/input-control-styles.js.map +1 -1
  268. package/build/input-control/utils.js +1 -3
  269. package/build/input-control/utils.js.map +1 -1
  270. package/build/keyboard-shortcuts/index.js +21 -26
  271. package/build/keyboard-shortcuts/index.js.map +1 -1
  272. package/build/menu-items-choice/index.js +6 -7
  273. package/build/menu-items-choice/index.js.map +1 -1
  274. package/build/mobile/audio-player/index.native.js +7 -8
  275. package/build/mobile/audio-player/index.native.js.map +1 -1
  276. package/build/mobile/badge/index.native.js +5 -6
  277. package/build/mobile/badge/index.native.js.map +1 -1
  278. package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js +10 -12
  279. package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js.map +1 -1
  280. package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js +10 -13
  281. package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js.map +1 -1
  282. package/build/mobile/bottom-sheet/button.native.js +18 -21
  283. package/build/mobile/bottom-sheet/button.native.js.map +1 -1
  284. package/build/mobile/bottom-sheet/cell.native.js +8 -4
  285. package/build/mobile/bottom-sheet/cell.native.js.map +1 -1
  286. package/build/mobile/bottom-sheet/color-cell.native.js +3 -1
  287. package/build/mobile/bottom-sheet/color-cell.native.js.map +1 -1
  288. package/build/mobile/bottom-sheet/footer-message-cell.native.js +4 -5
  289. package/build/mobile/bottom-sheet/footer-message-cell.native.js.map +1 -1
  290. package/build/mobile/bottom-sheet/footer-message-link/footer-message-link.native.js +4 -5
  291. package/build/mobile/bottom-sheet/footer-message-link/footer-message-link.native.js.map +1 -1
  292. package/build/mobile/bottom-sheet/index.native.js +19 -30
  293. package/build/mobile/bottom-sheet/index.native.js.map +1 -1
  294. package/build/mobile/bottom-sheet/link-cell.native.js +6 -7
  295. package/build/mobile/bottom-sheet/link-cell.native.js.map +1 -1
  296. package/build/mobile/bottom-sheet/link-suggestion-item-cell.native.js +5 -6
  297. package/build/mobile/bottom-sheet/link-suggestion-item-cell.native.js.map +1 -1
  298. package/build/mobile/bottom-sheet/lock-icon/index.native.js +33 -0
  299. package/build/mobile/bottom-sheet/lock-icon/index.native.js.map +1 -0
  300. package/build/mobile/bottom-sheet/nav-bar/action-button.native.js +6 -7
  301. package/build/mobile/bottom-sheet/nav-bar/action-button.native.js.map +1 -1
  302. package/build/mobile/bottom-sheet/nav-bar/apply-button.native.js +3 -4
  303. package/build/mobile/bottom-sheet/nav-bar/apply-button.native.js.map +1 -1
  304. package/build/mobile/bottom-sheet/nav-bar/back-button.native.js +12 -15
  305. package/build/mobile/bottom-sheet/nav-bar/back-button.native.js.map +1 -1
  306. package/build/mobile/bottom-sheet/nav-bar/heading.native.js +3 -4
  307. package/build/mobile/bottom-sheet/nav-bar/heading.native.js.map +1 -1
  308. package/build/mobile/bottom-sheet/nav-bar/index.native.js +3 -4
  309. package/build/mobile/bottom-sheet/nav-bar/index.native.js.map +1 -1
  310. package/build/mobile/bottom-sheet/radio-cell.native.js +4 -3
  311. package/build/mobile/bottom-sheet/radio-cell.native.js.map +1 -1
  312. package/build/mobile/bottom-sheet/range-cell.native.js +5 -2
  313. package/build/mobile/bottom-sheet/range-cell.native.js.map +1 -1
  314. package/build/mobile/bottom-sheet/range-text-input.native.js +5 -6
  315. package/build/mobile/bottom-sheet/range-text-input.native.js.map +1 -1
  316. package/build/mobile/bottom-sheet/ripple.native.js +10 -11
  317. package/build/mobile/bottom-sheet/ripple.native.js.map +1 -1
  318. package/build/mobile/bottom-sheet/stepper-cell/index.native.js +1 -2
  319. package/build/mobile/bottom-sheet/stepper-cell/index.native.js.map +1 -1
  320. package/build/mobile/bottom-sheet/stepper-cell/stepper.android.js +11 -12
  321. package/build/mobile/bottom-sheet/stepper-cell/stepper.android.js.map +1 -1
  322. package/build/mobile/bottom-sheet/stepper-cell/stepper.ios.js +11 -12
  323. package/build/mobile/bottom-sheet/stepper-cell/stepper.ios.js.map +1 -1
  324. package/build/mobile/bottom-sheet/sub-sheet/index.native.js +6 -7
  325. package/build/mobile/bottom-sheet/sub-sheet/index.native.js.map +1 -1
  326. package/build/mobile/bottom-sheet-select-control/index.native.js +9 -10
  327. package/build/mobile/bottom-sheet-select-control/index.native.js.map +1 -1
  328. package/build/mobile/bottom-sheet-text-control/index.native.js +11 -12
  329. package/build/mobile/bottom-sheet-text-control/index.native.js.map +1 -1
  330. package/build/mobile/color-settings/index.native.js +12 -13
  331. package/build/mobile/color-settings/index.native.js.map +1 -1
  332. package/build/mobile/color-settings/utils.native.js +2 -2
  333. package/build/mobile/color-settings/utils.native.js.map +1 -1
  334. package/build/mobile/cycle-select-control/index.native.js +11 -12
  335. package/build/mobile/cycle-select-control/index.native.js.map +1 -1
  336. package/build/mobile/focal-point-settings-panel/index.native.js +6 -7
  337. package/build/mobile/focal-point-settings-panel/index.native.js.map +1 -1
  338. package/build/mobile/global-styles-context/index.native.js +6 -14
  339. package/build/mobile/global-styles-context/index.native.js.map +1 -1
  340. package/build/mobile/global-styles-context/utils.native.js +69 -112
  341. package/build/mobile/global-styles-context/utils.native.js.map +1 -1
  342. package/build/mobile/gradient/index.native.js +26 -33
  343. package/build/mobile/gradient/index.native.js.map +1 -1
  344. package/build/mobile/html-text-input/index.native.js +3 -3
  345. package/build/mobile/html-text-input/index.native.js.map +1 -1
  346. package/build/mobile/image/image-editing-button.native.js +22 -26
  347. package/build/mobile/image/image-editing-button.native.js.map +1 -1
  348. package/build/mobile/image/index.native.js +31 -34
  349. package/build/mobile/image/index.native.js.map +1 -1
  350. package/build/mobile/keyboard-avoiding-view/index.ios.js +22 -29
  351. package/build/mobile/keyboard-avoiding-view/index.ios.js.map +1 -1
  352. package/build/mobile/keyboard-aware-flat-list/index.android.js +5 -6
  353. package/build/mobile/keyboard-aware-flat-list/index.android.js.map +1 -1
  354. package/build/mobile/keyboard-aware-flat-list/index.ios.js +9 -10
  355. package/build/mobile/keyboard-aware-flat-list/index.ios.js.map +1 -1
  356. package/build/mobile/keyboard-aware-flat-list/use-keyboard-offset.native.js +9 -14
  357. package/build/mobile/keyboard-aware-flat-list/use-keyboard-offset.native.js.map +1 -1
  358. package/build/mobile/layout-animation/index.native.js +1 -3
  359. package/build/mobile/layout-animation/index.native.js.map +1 -1
  360. package/build/mobile/link-picker/index.native.js +12 -16
  361. package/build/mobile/link-picker/index.native.js.map +1 -1
  362. package/build/mobile/link-picker/link-picker-results.native.js +34 -48
  363. package/build/mobile/link-picker/link-picker-results.native.js.map +1 -1
  364. package/build/mobile/link-picker/link-picker-screen.native.js +7 -10
  365. package/build/mobile/link-picker/link-picker-screen.native.js.map +1 -1
  366. package/build/mobile/link-settings/image-link-destinations-screen.native.js +8 -9
  367. package/build/mobile/link-settings/image-link-destinations-screen.native.js.map +1 -1
  368. package/build/mobile/link-settings/index.native.js +57 -58
  369. package/build/mobile/link-settings/index.native.js.map +1 -1
  370. package/build/mobile/media-edit/index.native.js +2 -2
  371. package/build/mobile/media-edit/index.native.js.map +1 -1
  372. package/build/mobile/picker/index.ios.js +3 -6
  373. package/build/mobile/picker/index.ios.js.map +1 -1
  374. package/build/mobile/segmented-control/index.native.js +16 -20
  375. package/build/mobile/segmented-control/index.native.js.map +1 -1
  376. package/build/mobile/utils/alignments.native.js +2 -6
  377. package/build/mobile/utils/alignments.native.js.map +1 -1
  378. package/build/mobile/utils/index.native.js +1 -2
  379. package/build/mobile/utils/index.native.js.map +1 -1
  380. package/build/mobile/utils/use-unit-converter-to-mobile.native.js +4 -7
  381. package/build/mobile/utils/use-unit-converter-to-mobile.native.js.map +1 -1
  382. package/build/modal/index.js +2 -2
  383. package/build/modal/index.js.map +1 -1
  384. package/build/navigable-container/container.js +2 -6
  385. package/build/navigable-container/container.js.map +1 -1
  386. package/build/navigable-container/menu.js +5 -7
  387. package/build/navigable-container/menu.js.map +1 -1
  388. package/build/navigable-container/tabbable.js +4 -6
  389. package/build/navigable-container/tabbable.js.map +1 -1
  390. package/build/navigation/back-button/index.js +8 -11
  391. package/build/navigation/back-button/index.js.map +1 -1
  392. package/build/navigation/group/index.js +5 -6
  393. package/build/navigation/group/index.js.map +1 -1
  394. package/build/navigation/index.js +8 -11
  395. package/build/navigation/index.js.map +1 -1
  396. package/build/navigation/item/base.js +1 -3
  397. package/build/navigation/item/base.js.map +1 -1
  398. package/build/navigation/menu/menu-title-search.js +11 -14
  399. package/build/navigation/menu/menu-title-search.js.map +1 -1
  400. package/build/navigation/menu/menu-title.js +8 -11
  401. package/build/navigation/menu/menu-title.js.map +1 -1
  402. package/build/navigation/menu/search-no-results-found.js +3 -4
  403. package/build/navigation/menu/search-no-results-found.js.map +1 -1
  404. package/build/navigator/navigator-back-button/hook.js +1 -1
  405. package/build/navigator/navigator-back-button/hook.js.map +1 -1
  406. package/build/navigator/navigator-button/hook.js +1 -1
  407. package/build/navigator/navigator-button/hook.js.map +1 -1
  408. package/build/navigator/navigator-provider/component.js +2 -6
  409. package/build/navigator/navigator-provider/component.js.map +1 -1
  410. package/build/navigator/navigator-screen/component.js +1 -1
  411. package/build/navigator/navigator-screen/component.js.map +1 -1
  412. package/build/notice/index.js +25 -29
  413. package/build/notice/index.js.map +1 -1
  414. package/build/notice/index.native.js +13 -18
  415. package/build/notice/index.native.js.map +1 -1
  416. package/build/notice/list.js +6 -8
  417. package/build/notice/list.js.map +1 -1
  418. package/build/number-control/index.js +24 -26
  419. package/build/number-control/index.js.map +1 -1
  420. package/build/number-control/styles/number-control-styles.js +6 -10
  421. package/build/number-control/styles/number-control-styles.js.map +1 -1
  422. package/build/palette-edit/index.js +83 -94
  423. package/build/palette-edit/index.js.map +1 -1
  424. package/build/panel/actions.native.js +8 -10
  425. package/build/panel/actions.native.js.map +1 -1
  426. package/build/panel/body.js +7 -10
  427. package/build/panel/body.js.map +1 -1
  428. package/build/panel/body.native.js +6 -7
  429. package/build/panel/body.native.js.map +1 -1
  430. package/build/panel/bottom-separator-cover.native.js +3 -4
  431. package/build/panel/bottom-separator-cover.native.js.map +1 -1
  432. package/build/panel/header.js +4 -5
  433. package/build/panel/header.js.map +1 -1
  434. package/build/panel/index.js +5 -6
  435. package/build/panel/index.js.map +1 -1
  436. package/build/panel/row.js +4 -5
  437. package/build/panel/row.js.map +1 -1
  438. package/build/popover/index.js +27 -31
  439. package/build/popover/index.js.map +1 -1
  440. package/build/popover/limit-shift.js +70 -75
  441. package/build/popover/limit-shift.js.map +1 -1
  442. package/build/popover/overlay-middlewares.js +7 -9
  443. package/build/popover/overlay-middlewares.js.map +1 -1
  444. package/build/popover/utils.js +26 -34
  445. package/build/popover/utils.js.map +1 -1
  446. package/build/private-apis.js +3 -0
  447. package/build/private-apis.js.map +1 -1
  448. package/build/query-controls/author-select.js +7 -8
  449. package/build/query-controls/author-select.js.map +1 -1
  450. package/build/query-controls/category-select.js +8 -9
  451. package/build/query-controls/category-select.js.map +1 -1
  452. package/build/query-controls/index.js +16 -17
  453. package/build/query-controls/index.js.map +1 -1
  454. package/build/query-controls/index.native.js +13 -14
  455. package/build/query-controls/index.native.js.map +1 -1
  456. package/build/radio-control/index.js +1 -1
  457. package/build/radio-control/index.js.map +1 -1
  458. package/build/radio-control/index.native.js +6 -7
  459. package/build/radio-control/index.native.js.map +1 -1
  460. package/build/radio-group/index.js +8 -9
  461. package/build/radio-group/index.js.map +1 -1
  462. package/build/radio-group/radio/index.js +5 -6
  463. package/build/radio-group/radio/index.js.map +1 -1
  464. package/build/range-control/index.js +1 -3
  465. package/build/range-control/index.js.map +1 -1
  466. package/build/range-control/index.native.js +19 -21
  467. package/build/range-control/index.native.js.map +1 -1
  468. package/build/range-control/rail.js +7 -9
  469. package/build/range-control/rail.js.map +1 -1
  470. package/build/range-control/styles/range-control-styles.js +37 -52
  471. package/build/range-control/styles/range-control-styles.js.map +1 -1
  472. package/build/range-control/tooltip.js +4 -5
  473. package/build/range-control/tooltip.js.map +1 -1
  474. package/build/resizable-box/index.js +8 -9
  475. package/build/resizable-box/index.js.map +1 -1
  476. package/build/resizable-box/resize-tooltip/index.js +12 -13
  477. package/build/resizable-box/resize-tooltip/index.js.map +1 -1
  478. package/build/resizable-box/resize-tooltip/label.js +6 -7
  479. package/build/resizable-box/resize-tooltip/label.js.map +1 -1
  480. package/build/resizable-box/resize-tooltip/utils.js +16 -19
  481. package/build/resizable-box/resize-tooltip/utils.js.map +1 -1
  482. package/build/responsive-wrapper/index.js +6 -8
  483. package/build/responsive-wrapper/index.js.map +1 -1
  484. package/build/sandbox/index.js +16 -23
  485. package/build/sandbox/index.js.map +1 -1
  486. package/build/sandbox/index.native.js +20 -26
  487. package/build/sandbox/index.native.js.map +1 -1
  488. package/build/search-control/index.js +14 -17
  489. package/build/search-control/index.js.map +1 -1
  490. package/build/search-control/index.native.js +7 -8
  491. package/build/search-control/index.native.js.map +1 -1
  492. package/build/select-control/index.js +9 -19
  493. package/build/select-control/index.js.map +1 -1
  494. package/build/select-control/index.native.js +11 -12
  495. package/build/select-control/index.native.js.map +1 -1
  496. package/build/select-control/styles/select-control-styles.js +19 -25
  497. package/build/select-control/styles/select-control-styles.js.map +1 -1
  498. package/build/slot-fill/bubbles-virtually/fill.js +4 -5
  499. package/build/slot-fill/bubbles-virtually/fill.js.map +1 -1
  500. package/build/slot-fill/bubbles-virtually/slot-fill-provider.js +4 -7
  501. package/build/slot-fill/bubbles-virtually/slot-fill-provider.js.map +1 -1
  502. package/build/slot-fill/bubbles-virtually/slot.js +6 -7
  503. package/build/slot-fill/bubbles-virtually/slot.js.map +1 -1
  504. package/build/slot-fill/fill.js +4 -5
  505. package/build/slot-fill/fill.js.map +1 -1
  506. package/build/slot-fill/index.js +8 -11
  507. package/build/slot-fill/index.js.map +1 -1
  508. package/build/slot-fill/index.native.js +4 -5
  509. package/build/slot-fill/index.native.js.map +1 -1
  510. package/build/slot-fill/provider.js +2 -2
  511. package/build/slot-fill/provider.js.map +1 -1
  512. package/build/slot-fill/slot.js +9 -12
  513. package/build/slot-fill/slot.js.map +1 -1
  514. package/build/snackbar/index.js +26 -31
  515. package/build/snackbar/index.js.map +1 -1
  516. package/build/snackbar/list.js +9 -8
  517. package/build/snackbar/list.js.map +1 -1
  518. package/build/spinner/index.js +4 -5
  519. package/build/spinner/index.js.map +1 -1
  520. package/build/style-provider/index.native.js +3 -4
  521. package/build/style-provider/index.native.js.map +1 -1
  522. package/build/surface/styles.js +6 -7
  523. package/build/surface/styles.js.map +1 -1
  524. package/build/tab-panel/index.js +35 -40
  525. package/build/tab-panel/index.js.map +1 -1
  526. package/build/text/styles/text-mixins.native.js +1 -3
  527. package/build/text/styles/text-mixins.native.js.map +1 -1
  528. package/build/text/utils.js +16 -17
  529. package/build/text/utils.js.map +1 -1
  530. package/build/text-control/index.native.js +12 -13
  531. package/build/text-control/index.native.js.map +1 -1
  532. package/build/textarea-control/index.native.js +7 -8
  533. package/build/textarea-control/index.native.js.map +1 -1
  534. package/build/theme/color-algorithms.js +1 -2
  535. package/build/theme/color-algorithms.js.map +1 -1
  536. package/build/theme/index.js +6 -7
  537. package/build/theme/index.js.map +1 -1
  538. package/build/theme/styles.js +4 -8
  539. package/build/theme/styles.js.map +1 -1
  540. package/build/toggle-control/index.js +9 -11
  541. package/build/toggle-control/index.js.map +1 -1
  542. package/build/toggle-control/index.native.js +9 -10
  543. package/build/toggle-control/index.native.js.map +1 -1
  544. package/build/toggle-group-control/toggle-group-control/as-button-group.js +9 -10
  545. package/build/toggle-group-control/toggle-group-control/as-button-group.js.map +1 -1
  546. package/build/toggle-group-control/toggle-group-control/as-radio-group.js +9 -10
  547. package/build/toggle-group-control/toggle-group-control/as-radio-group.js.map +1 -1
  548. package/build/toggle-group-control/toggle-group-control/styles.js +5 -8
  549. package/build/toggle-group-control/toggle-group-control/styles.js.map +1 -1
  550. package/build/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.js +7 -8
  551. package/build/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.js.map +1 -1
  552. package/build/toggle-group-control/toggle-group-control-option-base/component.js +5 -7
  553. package/build/toggle-group-control/toggle-group-control-option-base/component.js.map +1 -1
  554. package/build/toggle-group-control/toggle-group-control-option-base/styles.js +11 -15
  555. package/build/toggle-group-control/toggle-group-control-option-base/styles.js.map +1 -1
  556. package/build/toolbar/toolbar/index.js +23 -9
  557. package/build/toolbar/toolbar/index.js.map +1 -1
  558. package/build/toolbar/toolbar/toolbar-container.js +4 -5
  559. package/build/toolbar/toolbar/toolbar-container.js.map +1 -1
  560. package/build/toolbar/toolbar/toolbar-container.native.js +3 -6
  561. package/build/toolbar/toolbar/toolbar-container.native.js.map +1 -1
  562. package/build/toolbar/toolbar-button/index.js +10 -11
  563. package/build/toolbar/toolbar-button/index.js.map +1 -1
  564. package/build/toolbar/toolbar-button/toolbar-button-container.js +6 -9
  565. package/build/toolbar/toolbar-button/toolbar-button-container.js.map +1 -1
  566. package/build/toolbar/toolbar-group/index.js +9 -12
  567. package/build/toolbar/toolbar-group/index.js.map +1 -1
  568. package/build/toolbar/toolbar-group/toolbar-group-collapsed.js +5 -6
  569. package/build/toolbar/toolbar-group/toolbar-group-collapsed.js.map +1 -1
  570. package/build/toolbar/toolbar-group/toolbar-group-collapsed.native.js +6 -7
  571. package/build/toolbar/toolbar-group/toolbar-group-collapsed.native.js.map +1 -1
  572. package/build/toolbar/toolbar-group/toolbar-group-container.js +7 -10
  573. package/build/toolbar/toolbar-group/toolbar-group-container.js.map +1 -1
  574. package/build/toolbar/toolbar-group/toolbar-group-container.native.js +7 -10
  575. package/build/toolbar/toolbar-group/toolbar-group-container.native.js.map +1 -1
  576. package/build/toolbar/toolbar-item/index.js +5 -6
  577. package/build/toolbar/toolbar-item/index.js.map +1 -1
  578. package/build/toolbar/toolbar-item/index.native.js +4 -6
  579. package/build/toolbar/toolbar-item/index.native.js.map +1 -1
  580. package/build/tools-panel/tools-panel/hook.js +17 -25
  581. package/build/tools-panel/tools-panel/hook.js.map +1 -1
  582. package/build/tools-panel/tools-panel-header/component.js +14 -24
  583. package/build/tools-panel/tools-panel-header/component.js.map +1 -1
  584. package/build/tools-panel/tools-panel-item/hook.js +5 -7
  585. package/build/tools-panel/tools-panel-item/hook.js.map +1 -1
  586. package/build/tooltip/index.js +36 -43
  587. package/build/tooltip/index.js.map +1 -1
  588. package/build/tooltip/index.native.js +14 -19
  589. package/build/tooltip/index.native.js.map +1 -1
  590. package/build/tree-grid/cell.js +5 -6
  591. package/build/tree-grid/cell.js.map +1 -1
  592. package/build/tree-grid/index.js +12 -15
  593. package/build/tree-grid/index.js.map +1 -1
  594. package/build/tree-grid/item.js +4 -5
  595. package/build/tree-grid/item.js.map +1 -1
  596. package/build/tree-grid/roving-tab-index-item.js +6 -7
  597. package/build/tree-grid/roving-tab-index-item.js.map +1 -1
  598. package/build/tree-grid/roving-tab-index.js +3 -4
  599. package/build/tree-grid/roving-tab-index.js.map +1 -1
  600. package/build/tree-grid/row.js +8 -9
  601. package/build/tree-grid/row.js.map +1 -1
  602. package/build/tree-select/index.js +9 -11
  603. package/build/tree-select/index.js.map +1 -1
  604. package/build/truncate/utils.js +1 -3
  605. package/build/truncate/utils.js.map +1 -1
  606. package/build/ui/context/context-connect.js +1 -1
  607. package/build/ui/context/context-connect.js.map +1 -1
  608. package/build/ui/context/context-system-provider.js +7 -9
  609. package/build/ui/context/context-system-provider.js.map +1 -1
  610. package/build/ui/context/index.js +7 -0
  611. package/build/ui/context/index.js.map +1 -1
  612. package/build/ui/context/use-context-system.js +1 -1
  613. package/build/ui/context/use-context-system.js.map +1 -1
  614. package/build/ui/control-group/hook.js +1 -1
  615. package/build/ui/control-group/hook.js.map +1 -1
  616. package/build/ui/form-group/form-group-content.js +12 -13
  617. package/build/ui/form-group/form-group-content.js.map +1 -1
  618. package/build/ui/form-group/form-group-help.js +3 -4
  619. package/build/ui/form-group/form-group-help.js.map +1 -1
  620. package/build/ui/form-group/form-group-label.js +7 -8
  621. package/build/ui/form-group/form-group-label.js.map +1 -1
  622. package/build/ui/tooltip/component.js +1 -1
  623. package/build/ui/tooltip/component.js.map +1 -1
  624. package/build/ui/utils/colors.js +1 -3
  625. package/build/ui/utils/colors.js.map +1 -1
  626. package/build/ui/utils/font-size.js +2 -6
  627. package/build/ui/utils/font-size.js.map +1 -1
  628. package/build/ui/utils/get-high-dpi.js +1 -5
  629. package/build/ui/utils/get-high-dpi.js.map +1 -1
  630. package/build/ui/utils/space.js +1 -3
  631. package/build/ui/utils/space.js.map +1 -1
  632. package/build/ui/utils/use-responsive-value.js +2 -4
  633. package/build/ui/utils/use-responsive-value.js.map +1 -1
  634. package/build/unit-control/index.js +8 -8
  635. package/build/unit-control/index.js.map +1 -1
  636. package/build/unit-control/index.native.js +22 -23
  637. package/build/unit-control/index.native.js.map +1 -1
  638. package/build/unit-control/styles/unit-control-styles.js +6 -8
  639. package/build/unit-control/styles/unit-control-styles.js.map +1 -1
  640. package/build/unit-control/unit-select-control.js +11 -13
  641. package/build/unit-control/unit-select-control.js.map +1 -1
  642. package/build/unit-control/utils.js +12 -19
  643. package/build/unit-control/utils.js.map +1 -1
  644. package/build/utils/browsers.js +2 -10
  645. package/build/utils/browsers.js.map +1 -1
  646. package/build/utils/colors.js +1 -3
  647. package/build/utils/colors.js.map +1 -1
  648. package/build/utils/config-values.js +1 -0
  649. package/build/utils/config-values.js.map +1 -1
  650. package/build/utils/hooks/use-controlled-state.js +1 -2
  651. package/build/utils/hooks/use-controlled-state.js.map +1 -1
  652. package/build/utils/hooks/use-controlled-value.js +5 -6
  653. package/build/utils/hooks/use-controlled-value.js.map +1 -1
  654. package/build/utils/hooks/use-cx.js +1 -5
  655. package/build/utils/hooks/use-cx.js.map +1 -1
  656. package/build/utils/math.js +5 -17
  657. package/build/utils/math.js.map +1 -1
  658. package/build/utils/reduce-motion.js +1 -2
  659. package/build/utils/reduce-motion.js.map +1 -1
  660. package/build/utils/rtl.js +3 -9
  661. package/build/utils/rtl.js.map +1 -1
  662. package/build/utils/values.js +2 -6
  663. package/build/utils/values.js.map +1 -1
  664. package/build/z-stack/styles.js +14 -23
  665. package/build/z-stack/styles.js.map +1 -1
  666. package/build-module/alignment-matrix-control/cell.js +5 -6
  667. package/build-module/alignment-matrix-control/cell.js.map +1 -1
  668. package/build-module/alignment-matrix-control/icon.js +8 -9
  669. package/build-module/alignment-matrix-control/icon.js.map +1 -1
  670. package/build-module/alignment-matrix-control/index.js +10 -11
  671. package/build-module/alignment-matrix-control/index.js.map +1 -1
  672. package/build-module/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.js +6 -8
  673. package/build-module/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.js.map +1 -1
  674. package/build-module/alignment-matrix-control/styles/alignment-matrix-control-styles.js +6 -8
  675. package/build-module/alignment-matrix-control/styles/alignment-matrix-control-styles.js.map +1 -1
  676. package/build-module/alignment-matrix-control/utils.js +1 -2
  677. package/build-module/alignment-matrix-control/utils.js.map +1 -1
  678. package/build-module/angle-picker-control/angle-circle.js +6 -9
  679. package/build-module/angle-picker-control/angle-circle.js.map +1 -1
  680. package/build-module/angle-picker-control/styles/angle-picker-control-styles.js +3 -4
  681. package/build-module/angle-picker-control/styles/angle-picker-control-styles.js.map +1 -1
  682. package/build-module/animate/index.js +5 -6
  683. package/build-module/animate/index.js.map +1 -1
  684. package/build-module/autocomplete/autocompleter-ui.js +29 -33
  685. package/build-module/autocomplete/autocompleter-ui.js.map +1 -1
  686. package/build-module/autocomplete/autocompleter-ui.native.js +15 -22
  687. package/build-module/autocomplete/autocompleter-ui.native.js.map +1 -1
  688. package/build-module/autocomplete/background-view.android.js +3 -4
  689. package/build-module/autocomplete/background-view.android.js.map +1 -1
  690. package/build-module/autocomplete/background-view.ios.js +3 -4
  691. package/build-module/autocomplete/background-view.ios.js.map +1 -1
  692. package/build-module/autocomplete/get-default-use-items.js +1 -3
  693. package/build-module/autocomplete/get-default-use-items.js.map +1 -1
  694. package/build-module/autocomplete/index.js +18 -23
  695. package/build-module/autocomplete/index.js.map +1 -1
  696. package/build-module/base-control/index.js +14 -16
  697. package/build-module/base-control/index.js.map +1 -1
  698. package/build-module/base-control/index.native.js +5 -6
  699. package/build-module/base-control/index.native.js.map +1 -1
  700. package/build-module/base-control/styles/base-control-styles.js +6 -8
  701. package/build-module/base-control/styles/base-control-styles.js.map +1 -1
  702. package/build-module/border-box-control/border-box-control/hook.js +5 -5
  703. package/build-module/border-box-control/border-box-control/hook.js.map +1 -1
  704. package/build-module/border-box-control/border-box-control-split-controls/component.js +4 -4
  705. package/build-module/border-box-control/border-box-control-split-controls/component.js.map +1 -1
  706. package/build-module/border-box-control/styles.js +3 -3
  707. package/build-module/border-box-control/styles.js.map +1 -1
  708. package/build-module/border-box-control/utils.js +5 -8
  709. package/build-module/border-box-control/utils.js.map +1 -1
  710. package/build-module/border-control/border-control/component.js +1 -1
  711. package/build-module/border-control/border-control/component.js.map +1 -1
  712. package/build-module/border-control/border-control/hook.js +5 -5
  713. package/build-module/border-control/border-control/hook.js.map +1 -1
  714. package/build-module/border-control/border-control-dropdown/component.js +70 -67
  715. package/build-module/border-control/border-control-dropdown/component.js.map +1 -1
  716. package/build-module/border-control/border-control-dropdown/hook.js +4 -4
  717. package/build-module/border-control/border-control-dropdown/hook.js.map +1 -1
  718. package/build-module/box-control/all-input-control.js +11 -12
  719. package/build-module/box-control/all-input-control.js.map +1 -1
  720. package/build-module/box-control/axial-input-controls.js +12 -14
  721. package/build-module/box-control/axial-input-controls.js.map +1 -1
  722. package/build-module/box-control/icon.js +7 -9
  723. package/build-module/box-control/icon.js.map +1 -1
  724. package/build-module/box-control/index.js +22 -24
  725. package/build-module/box-control/index.js.map +1 -1
  726. package/build-module/box-control/input-controls.js +15 -18
  727. package/build-module/box-control/input-controls.js.map +1 -1
  728. package/build-module/box-control/linked-button.js +4 -5
  729. package/build-module/box-control/linked-button.js.map +1 -1
  730. package/build-module/box-control/styles/box-control-icon-styles.js +3 -4
  731. package/build-module/box-control/styles/box-control-icon-styles.js.map +1 -1
  732. package/build-module/box-control/styles/box-control-styles.js +9 -12
  733. package/build-module/box-control/styles/box-control-styles.js.map +1 -1
  734. package/build-module/box-control/styles/box-control-visualizer-styles.js +7 -11
  735. package/build-module/box-control/styles/box-control-visualizer-styles.js.map +1 -1
  736. package/build-module/box-control/unit-control.js +18 -22
  737. package/build-module/box-control/unit-control.js.map +1 -1
  738. package/build-module/box-control/utils.js +4 -10
  739. package/build-module/box-control/utils.js.map +1 -1
  740. package/build-module/button/deprecated.js +7 -8
  741. package/build-module/button/deprecated.js.map +1 -1
  742. package/build-module/button/index.js +15 -16
  743. package/build-module/button/index.js.map +1 -1
  744. package/build-module/button/index.native.js +5 -7
  745. package/build-module/button/index.native.js.map +1 -1
  746. package/build-module/card/card/hook.js +5 -6
  747. package/build-module/card/card/hook.js.map +1 -1
  748. package/build-module/circular-option-picker/index.js +27 -33
  749. package/build-module/circular-option-picker/index.js.map +1 -1
  750. package/build-module/clipboard-button/index.js +8 -9
  751. package/build-module/clipboard-button/index.js.map +1 -1
  752. package/build-module/color-control/index.native.js +7 -8
  753. package/build-module/color-control/index.native.js.map +1 -1
  754. package/build-module/color-indicator/index.native.js +10 -12
  755. package/build-module/color-indicator/index.native.js.map +1 -1
  756. package/build-module/color-palette/index.js +63 -72
  757. package/build-module/color-palette/index.js.map +1 -1
  758. package/build-module/color-palette/index.native.js +33 -47
  759. package/build-module/color-palette/index.native.js.map +1 -1
  760. package/build-module/color-palette/utils.js +2 -5
  761. package/build-module/color-palette/utils.js.map +1 -1
  762. package/build-module/color-picker/color-input.js +6 -7
  763. package/build-module/color-picker/color-input.js.map +1 -1
  764. package/build-module/color-picker/hex-input.js +8 -12
  765. package/build-module/color-picker/hex-input.js.map +1 -1
  766. package/build-module/color-picker/hsl-input.js +5 -6
  767. package/build-module/color-picker/hsl-input.js.map +1 -1
  768. package/build-module/color-picker/index.native.js +23 -30
  769. package/build-module/color-picker/index.native.js.map +1 -1
  770. package/build-module/color-picker/input-with-slider.js +8 -10
  771. package/build-module/color-picker/input-with-slider.js.map +1 -1
  772. package/build-module/color-picker/picker.js +5 -6
  773. package/build-module/color-picker/picker.js.map +1 -1
  774. package/build-module/color-picker/rgb-input.js +5 -6
  775. package/build-module/color-picker/rgb-input.js.map +1 -1
  776. package/build-module/color-picker/use-deprecated-props.js +1 -3
  777. package/build-module/color-picker/use-deprecated-props.js.map +1 -1
  778. package/build-module/combobox-control/index.js +3 -6
  779. package/build-module/combobox-control/index.js.map +1 -1
  780. package/build-module/combobox-control/styles.js +3 -6
  781. package/build-module/combobox-control/styles.js.map +1 -1
  782. package/build-module/confirm-dialog/component.js +1 -1
  783. package/build-module/confirm-dialog/component.js.map +1 -1
  784. package/build-module/custom-gradient-picker/gradient-bar/control-points.js +114 -129
  785. package/build-module/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
  786. package/build-module/custom-gradient-picker/gradient-bar/index.js +12 -14
  787. package/build-module/custom-gradient-picker/gradient-bar/index.js.map +1 -1
  788. package/build-module/custom-gradient-picker/gradient-bar/utils.js +4 -6
  789. package/build-module/custom-gradient-picker/gradient-bar/utils.js.map +1 -1
  790. package/build-module/custom-gradient-picker/index.js +19 -22
  791. package/build-module/custom-gradient-picker/index.js.map +1 -1
  792. package/build-module/custom-gradient-picker/index.native.js +7 -8
  793. package/build-module/custom-gradient-picker/index.native.js.map +1 -1
  794. package/build-module/custom-gradient-picker/serializer.js +15 -21
  795. package/build-module/custom-gradient-picker/serializer.js.map +1 -1
  796. package/build-module/custom-gradient-picker/utils.js +6 -9
  797. package/build-module/custom-gradient-picker/utils.js.map +1 -1
  798. package/build-module/custom-select-control/index.js +14 -21
  799. package/build-module/custom-select-control/index.js.map +1 -1
  800. package/build-module/dashicon/index.js +7 -8
  801. package/build-module/dashicon/index.js.map +1 -1
  802. package/build-module/dashicon/index.native.js +4 -5
  803. package/build-module/dashicon/index.native.js.map +1 -1
  804. package/build-module/date-time/date/index.js +24 -26
  805. package/build-module/date-time/date/index.js.map +1 -1
  806. package/build-module/date-time/date-time/index.js +9 -10
  807. package/build-module/date-time/date-time/index.js.map +1 -1
  808. package/build-module/date-time/time/index.js +11 -14
  809. package/build-module/date-time/time/index.js.map +1 -1
  810. package/build-module/dimension-control/index.js +8 -11
  811. package/build-module/dimension-control/index.js.map +1 -1
  812. package/build-module/disabled/index.js +6 -7
  813. package/build-module/disabled/index.js.map +1 -1
  814. package/build-module/disabled/index.native.js +3 -4
  815. package/build-module/disabled/index.native.js.map +1 -1
  816. package/build-module/divider/styles.js +21 -29
  817. package/build-module/divider/styles.js.map +1 -1
  818. package/build-module/draggable/index.js +14 -19
  819. package/build-module/draggable/index.js.map +1 -1
  820. package/build-module/draggable/index.native.js +17 -19
  821. package/build-module/draggable/index.native.js.map +1 -1
  822. package/build-module/drop-zone/index.js +11 -16
  823. package/build-module/drop-zone/index.js.map +1 -1
  824. package/build-module/drop-zone/provider.js +3 -4
  825. package/build-module/drop-zone/provider.js.map +1 -1
  826. package/build-module/dropdown/index.js +19 -23
  827. package/build-module/dropdown/index.js.map +1 -1
  828. package/build-module/dropdown/styles.js +3 -4
  829. package/build-module/dropdown/styles.js.map +1 -1
  830. package/build-module/dropdown-menu/index.js +9 -15
  831. package/build-module/dropdown-menu/index.js.map +1 -1
  832. package/build-module/dropdown-menu/index.native.js +22 -30
  833. package/build-module/dropdown-menu/index.native.js.map +1 -1
  834. package/build-module/dropdown-menu-v2/index.js +91 -58
  835. package/build-module/dropdown-menu-v2/index.js.map +1 -1
  836. package/build-module/dropdown-menu-v2/styles.js +26 -18
  837. package/build-module/dropdown-menu-v2/styles.js.map +1 -1
  838. package/build-module/duotone-picker/color-list-picker/index.js +16 -18
  839. package/build-module/duotone-picker/color-list-picker/index.js.map +1 -1
  840. package/build-module/duotone-picker/custom-duotone-bar.js +4 -5
  841. package/build-module/duotone-picker/custom-duotone-bar.js.map +1 -1
  842. package/build-module/duotone-picker/duotone-picker.js +15 -17
  843. package/build-module/duotone-picker/duotone-picker.js.map +1 -1
  844. package/build-module/duotone-picker/duotone-swatch.js +3 -4
  845. package/build-module/duotone-picker/duotone-swatch.js.map +1 -1
  846. package/build-module/duotone-picker/utils.js +14 -27
  847. package/build-module/duotone-picker/utils.js.map +1 -1
  848. package/build-module/external-link/index.js +1 -1
  849. package/build-module/external-link/index.js.map +1 -1
  850. package/build-module/external-link/index.native.js +4 -5
  851. package/build-module/external-link/index.native.js.map +1 -1
  852. package/build-module/focal-point-picker/controls.js +11 -10
  853. package/build-module/focal-point-picker/controls.js.map +1 -1
  854. package/build-module/focal-point-picker/focal-point.js +5 -6
  855. package/build-module/focal-point-picker/focal-point.js.map +1 -1
  856. package/build-module/focal-point-picker/focal-point.native.js +5 -6
  857. package/build-module/focal-point-picker/focal-point.native.js.map +1 -1
  858. package/build-module/focal-point-picker/grid.js +4 -5
  859. package/build-module/focal-point-picker/grid.js.map +1 -1
  860. package/build-module/focal-point-picker/index.js +33 -37
  861. package/build-module/focal-point-picker/index.js.map +1 -1
  862. package/build-module/focal-point-picker/index.native.js +10 -12
  863. package/build-module/focal-point-picker/index.native.js.map +1 -1
  864. package/build-module/focal-point-picker/media.js +11 -13
  865. package/build-module/focal-point-picker/media.js.map +1 -1
  866. package/build-module/focal-point-picker/styles/focal-point-picker-style.js +9 -14
  867. package/build-module/focal-point-picker/styles/focal-point-picker-style.js.map +1 -1
  868. package/build-module/focal-point-picker/styles/focal-point-style.js +3 -6
  869. package/build-module/focal-point-picker/styles/focal-point-style.js.map +1 -1
  870. package/build-module/focal-point-picker/tooltip/index.native.js +16 -21
  871. package/build-module/focal-point-picker/tooltip/index.native.js.map +1 -1
  872. package/build-module/focal-point-picker/utils.js +2 -4
  873. package/build-module/focal-point-picker/utils.js.map +1 -1
  874. package/build-module/focusable-iframe/index.js +4 -5
  875. package/build-module/focusable-iframe/index.js.map +1 -1
  876. package/build-module/font-size-picker/font-size-picker-select.js +3 -5
  877. package/build-module/font-size-picker/font-size-picker-select.js.map +1 -1
  878. package/build-module/font-size-picker/index.js +14 -18
  879. package/build-module/font-size-picker/index.js.map +1 -1
  880. package/build-module/font-size-picker/index.native.js +6 -7
  881. package/build-module/font-size-picker/index.native.js.map +1 -1
  882. package/build-module/font-size-picker/styles.js +20 -7
  883. package/build-module/font-size-picker/styles.js.map +1 -1
  884. package/build-module/footer-message-control/index.native.js +2 -3
  885. package/build-module/footer-message-control/index.native.js.map +1 -1
  886. package/build-module/form-file-upload/index.js +10 -13
  887. package/build-module/form-file-upload/index.js.map +1 -1
  888. package/build-module/form-token-field/index.js +4 -19
  889. package/build-module/form-token-field/index.js.map +1 -1
  890. package/build-module/form-token-field/styles.js +4 -7
  891. package/build-module/form-token-field/styles.js.map +1 -1
  892. package/build-module/form-token-field/suggestions-list.js +14 -15
  893. package/build-module/form-token-field/suggestions-list.js.map +1 -1
  894. package/build-module/form-token-field/token-input.js +2 -2
  895. package/build-module/form-token-field/token-input.js.map +1 -1
  896. package/build-module/form-token-field/token.js +14 -15
  897. package/build-module/form-token-field/token.js.map +1 -1
  898. package/build-module/gradient-picker/index.js +51 -58
  899. package/build-module/gradient-picker/index.js.map +1 -1
  900. package/build-module/guide/icons.js +13 -16
  901. package/build-module/guide/icons.js.map +1 -1
  902. package/build-module/guide/index.js +9 -12
  903. package/build-module/guide/index.js.map +1 -1
  904. package/build-module/guide/page-control.js +5 -6
  905. package/build-module/guide/page-control.js.map +1 -1
  906. package/build-module/h-stack/utils.js +1 -3
  907. package/build-module/h-stack/utils.js.map +1 -1
  908. package/build-module/higher-order/navigate-regions/index.js +16 -22
  909. package/build-module/higher-order/navigate-regions/index.js.map +1 -1
  910. package/build-module/higher-order/with-focus-outside/index.js +1 -1
  911. package/build-module/higher-order/with-focus-outside/index.js.map +1 -1
  912. package/build-module/higher-order/with-focus-outside/index.native.js +1 -1
  913. package/build-module/higher-order/with-focus-outside/index.native.js.map +1 -1
  914. package/build-module/higher-order/with-focus-return/index.js +13 -17
  915. package/build-module/higher-order/with-focus-return/index.js.map +1 -1
  916. package/build-module/icon/index.js +5 -7
  917. package/build-module/icon/index.js.map +1 -1
  918. package/build-module/input-control/backdrop.js +4 -5
  919. package/build-module/input-control/backdrop.js.map +1 -1
  920. package/build-module/input-control/index.js +22 -23
  921. package/build-module/input-control/index.js.map +1 -1
  922. package/build-module/input-control/input-base.js +16 -17
  923. package/build-module/input-control/input-base.js.map +1 -1
  924. package/build-module/input-control/input-field.js +26 -29
  925. package/build-module/input-control/input-field.js.map +1 -1
  926. package/build-module/input-control/label.js +6 -7
  927. package/build-module/input-control/label.js.map +1 -1
  928. package/build-module/input-control/reducer/reducer.js +2 -6
  929. package/build-module/input-control/reducer/reducer.js.map +1 -1
  930. package/build-module/input-control/styles/input-control-styles.js +32 -41
  931. package/build-module/input-control/styles/input-control-styles.js.map +1 -1
  932. package/build-module/input-control/utils.js +1 -3
  933. package/build-module/input-control/utils.js.map +1 -1
  934. package/build-module/keyboard-shortcuts/index.js +21 -26
  935. package/build-module/keyboard-shortcuts/index.js.map +1 -1
  936. package/build-module/menu-items-choice/index.js +6 -7
  937. package/build-module/menu-items-choice/index.js.map +1 -1
  938. package/build-module/mobile/audio-player/index.native.js +7 -8
  939. package/build-module/mobile/audio-player/index.native.js.map +1 -1
  940. package/build-module/mobile/badge/index.native.js +5 -6
  941. package/build-module/mobile/badge/index.native.js.map +1 -1
  942. package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js +10 -12
  943. package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js.map +1 -1
  944. package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js +10 -13
  945. package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js.map +1 -1
  946. package/build-module/mobile/bottom-sheet/button.native.js +18 -21
  947. package/build-module/mobile/bottom-sheet/button.native.js.map +1 -1
  948. package/build-module/mobile/bottom-sheet/cell.native.js +7 -4
  949. package/build-module/mobile/bottom-sheet/cell.native.js.map +1 -1
  950. package/build-module/mobile/bottom-sheet/color-cell.native.js +3 -1
  951. package/build-module/mobile/bottom-sheet/color-cell.native.js.map +1 -1
  952. package/build-module/mobile/bottom-sheet/footer-message-cell.native.js +4 -5
  953. package/build-module/mobile/bottom-sheet/footer-message-cell.native.js.map +1 -1
  954. package/build-module/mobile/bottom-sheet/footer-message-link/footer-message-link.native.js +4 -5
  955. package/build-module/mobile/bottom-sheet/footer-message-link/footer-message-link.native.js.map +1 -1
  956. package/build-module/mobile/bottom-sheet/index.native.js +19 -30
  957. package/build-module/mobile/bottom-sheet/index.native.js.map +1 -1
  958. package/build-module/mobile/bottom-sheet/link-cell.native.js +6 -7
  959. package/build-module/mobile/bottom-sheet/link-cell.native.js.map +1 -1
  960. package/build-module/mobile/bottom-sheet/link-suggestion-item-cell.native.js +5 -6
  961. package/build-module/mobile/bottom-sheet/link-suggestion-item-cell.native.js.map +1 -1
  962. package/build-module/mobile/bottom-sheet/lock-icon/index.native.js +21 -0
  963. package/build-module/mobile/bottom-sheet/lock-icon/index.native.js.map +1 -0
  964. package/build-module/mobile/bottom-sheet/nav-bar/action-button.native.js +6 -7
  965. package/build-module/mobile/bottom-sheet/nav-bar/action-button.native.js.map +1 -1
  966. package/build-module/mobile/bottom-sheet/nav-bar/apply-button.native.js +3 -4
  967. package/build-module/mobile/bottom-sheet/nav-bar/apply-button.native.js.map +1 -1
  968. package/build-module/mobile/bottom-sheet/nav-bar/back-button.native.js +12 -15
  969. package/build-module/mobile/bottom-sheet/nav-bar/back-button.native.js.map +1 -1
  970. package/build-module/mobile/bottom-sheet/nav-bar/heading.native.js +3 -4
  971. package/build-module/mobile/bottom-sheet/nav-bar/heading.native.js.map +1 -1
  972. package/build-module/mobile/bottom-sheet/nav-bar/index.native.js +3 -4
  973. package/build-module/mobile/bottom-sheet/nav-bar/index.native.js.map +1 -1
  974. package/build-module/mobile/bottom-sheet/radio-cell.native.js +3 -2
  975. package/build-module/mobile/bottom-sheet/radio-cell.native.js.map +1 -1
  976. package/build-module/mobile/bottom-sheet/range-cell.native.js +4 -2
  977. package/build-module/mobile/bottom-sheet/range-cell.native.js.map +1 -1
  978. package/build-module/mobile/bottom-sheet/range-text-input.native.js +5 -6
  979. package/build-module/mobile/bottom-sheet/range-text-input.native.js.map +1 -1
  980. package/build-module/mobile/bottom-sheet/ripple.native.js +10 -11
  981. package/build-module/mobile/bottom-sheet/ripple.native.js.map +1 -1
  982. package/build-module/mobile/bottom-sheet/stepper-cell/index.native.js +1 -2
  983. package/build-module/mobile/bottom-sheet/stepper-cell/index.native.js.map +1 -1
  984. package/build-module/mobile/bottom-sheet/stepper-cell/stepper.android.js +11 -12
  985. package/build-module/mobile/bottom-sheet/stepper-cell/stepper.android.js.map +1 -1
  986. package/build-module/mobile/bottom-sheet/stepper-cell/stepper.ios.js +11 -12
  987. package/build-module/mobile/bottom-sheet/stepper-cell/stepper.ios.js.map +1 -1
  988. package/build-module/mobile/bottom-sheet/sub-sheet/index.native.js +6 -7
  989. package/build-module/mobile/bottom-sheet/sub-sheet/index.native.js.map +1 -1
  990. package/build-module/mobile/bottom-sheet-select-control/index.native.js +9 -10
  991. package/build-module/mobile/bottom-sheet-select-control/index.native.js.map +1 -1
  992. package/build-module/mobile/bottom-sheet-text-control/index.native.js +11 -12
  993. package/build-module/mobile/bottom-sheet-text-control/index.native.js.map +1 -1
  994. package/build-module/mobile/color-settings/index.native.js +12 -13
  995. package/build-module/mobile/color-settings/index.native.js.map +1 -1
  996. package/build-module/mobile/color-settings/utils.native.js +2 -2
  997. package/build-module/mobile/color-settings/utils.native.js.map +1 -1
  998. package/build-module/mobile/cycle-select-control/index.native.js +11 -12
  999. package/build-module/mobile/cycle-select-control/index.native.js.map +1 -1
  1000. package/build-module/mobile/focal-point-settings-panel/index.native.js +6 -7
  1001. package/build-module/mobile/focal-point-settings-panel/index.native.js.map +1 -1
  1002. package/build-module/mobile/global-styles-context/index.native.js +6 -14
  1003. package/build-module/mobile/global-styles-context/index.native.js.map +1 -1
  1004. package/build-module/mobile/global-styles-context/utils.native.js +69 -112
  1005. package/build-module/mobile/global-styles-context/utils.native.js.map +1 -1
  1006. package/build-module/mobile/gradient/index.native.js +26 -33
  1007. package/build-module/mobile/gradient/index.native.js.map +1 -1
  1008. package/build-module/mobile/html-text-input/index.native.js +3 -3
  1009. package/build-module/mobile/html-text-input/index.native.js.map +1 -1
  1010. package/build-module/mobile/image/image-editing-button.native.js +22 -26
  1011. package/build-module/mobile/image/image-editing-button.native.js.map +1 -1
  1012. package/build-module/mobile/image/index.native.js +31 -34
  1013. package/build-module/mobile/image/index.native.js.map +1 -1
  1014. package/build-module/mobile/keyboard-avoiding-view/index.ios.js +22 -29
  1015. package/build-module/mobile/keyboard-avoiding-view/index.ios.js.map +1 -1
  1016. package/build-module/mobile/keyboard-aware-flat-list/index.android.js +5 -6
  1017. package/build-module/mobile/keyboard-aware-flat-list/index.android.js.map +1 -1
  1018. package/build-module/mobile/keyboard-aware-flat-list/index.ios.js +9 -10
  1019. package/build-module/mobile/keyboard-aware-flat-list/index.ios.js.map +1 -1
  1020. package/build-module/mobile/keyboard-aware-flat-list/use-keyboard-offset.native.js +9 -14
  1021. package/build-module/mobile/keyboard-aware-flat-list/use-keyboard-offset.native.js.map +1 -1
  1022. package/build-module/mobile/layout-animation/index.native.js +1 -2
  1023. package/build-module/mobile/layout-animation/index.native.js.map +1 -1
  1024. package/build-module/mobile/link-picker/index.native.js +12 -16
  1025. package/build-module/mobile/link-picker/index.native.js.map +1 -1
  1026. package/build-module/mobile/link-picker/link-picker-results.native.js +34 -48
  1027. package/build-module/mobile/link-picker/link-picker-results.native.js.map +1 -1
  1028. package/build-module/mobile/link-picker/link-picker-screen.native.js +7 -9
  1029. package/build-module/mobile/link-picker/link-picker-screen.native.js.map +1 -1
  1030. package/build-module/mobile/link-settings/image-link-destinations-screen.native.js +8 -9
  1031. package/build-module/mobile/link-settings/image-link-destinations-screen.native.js.map +1 -1
  1032. package/build-module/mobile/link-settings/index.native.js +57 -58
  1033. package/build-module/mobile/link-settings/index.native.js.map +1 -1
  1034. package/build-module/mobile/media-edit/index.native.js +2 -2
  1035. package/build-module/mobile/media-edit/index.native.js.map +1 -1
  1036. package/build-module/mobile/picker/index.ios.js +3 -6
  1037. package/build-module/mobile/picker/index.ios.js.map +1 -1
  1038. package/build-module/mobile/segmented-control/index.native.js +16 -20
  1039. package/build-module/mobile/segmented-control/index.native.js.map +1 -1
  1040. package/build-module/mobile/utils/alignments.native.js +2 -6
  1041. package/build-module/mobile/utils/alignments.native.js.map +1 -1
  1042. package/build-module/mobile/utils/index.native.js +1 -2
  1043. package/build-module/mobile/utils/index.native.js.map +1 -1
  1044. package/build-module/mobile/utils/use-unit-converter-to-mobile.native.js +4 -7
  1045. package/build-module/mobile/utils/use-unit-converter-to-mobile.native.js.map +1 -1
  1046. package/build-module/modal/index.js +2 -2
  1047. package/build-module/modal/index.js.map +1 -1
  1048. package/build-module/navigable-container/container.js +2 -6
  1049. package/build-module/navigable-container/container.js.map +1 -1
  1050. package/build-module/navigable-container/menu.js +5 -7
  1051. package/build-module/navigable-container/menu.js.map +1 -1
  1052. package/build-module/navigable-container/tabbable.js +4 -6
  1053. package/build-module/navigable-container/tabbable.js.map +1 -1
  1054. package/build-module/navigation/back-button/index.js +8 -11
  1055. package/build-module/navigation/back-button/index.js.map +1 -1
  1056. package/build-module/navigation/group/index.js +5 -6
  1057. package/build-module/navigation/group/index.js.map +1 -1
  1058. package/build-module/navigation/index.js +8 -11
  1059. package/build-module/navigation/index.js.map +1 -1
  1060. package/build-module/navigation/item/base.js +1 -3
  1061. package/build-module/navigation/item/base.js.map +1 -1
  1062. package/build-module/navigation/menu/menu-title-search.js +11 -14
  1063. package/build-module/navigation/menu/menu-title-search.js.map +1 -1
  1064. package/build-module/navigation/menu/menu-title.js +8 -11
  1065. package/build-module/navigation/menu/menu-title.js.map +1 -1
  1066. package/build-module/navigation/menu/search-no-results-found.js +3 -4
  1067. package/build-module/navigation/menu/search-no-results-found.js.map +1 -1
  1068. package/build-module/navigator/navigator-back-button/hook.js +1 -1
  1069. package/build-module/navigator/navigator-back-button/hook.js.map +1 -1
  1070. package/build-module/navigator/navigator-button/hook.js +1 -1
  1071. package/build-module/navigator/navigator-button/hook.js.map +1 -1
  1072. package/build-module/navigator/navigator-provider/component.js +2 -6
  1073. package/build-module/navigator/navigator-provider/component.js.map +1 -1
  1074. package/build-module/navigator/navigator-screen/component.js +1 -1
  1075. package/build-module/navigator/navigator-screen/component.js.map +1 -1
  1076. package/build-module/notice/index.js +25 -29
  1077. package/build-module/notice/index.js.map +1 -1
  1078. package/build-module/notice/index.native.js +13 -18
  1079. package/build-module/notice/index.native.js.map +1 -1
  1080. package/build-module/notice/list.js +6 -8
  1081. package/build-module/notice/list.js.map +1 -1
  1082. package/build-module/number-control/index.js +24 -26
  1083. package/build-module/number-control/index.js.map +1 -1
  1084. package/build-module/number-control/styles/number-control-styles.js +6 -10
  1085. package/build-module/number-control/styles/number-control-styles.js.map +1 -1
  1086. package/build-module/palette-edit/index.js +83 -94
  1087. package/build-module/palette-edit/index.js.map +1 -1
  1088. package/build-module/panel/actions.native.js +8 -10
  1089. package/build-module/panel/actions.native.js.map +1 -1
  1090. package/build-module/panel/body.js +7 -10
  1091. package/build-module/panel/body.js.map +1 -1
  1092. package/build-module/panel/body.native.js +6 -7
  1093. package/build-module/panel/body.native.js.map +1 -1
  1094. package/build-module/panel/bottom-separator-cover.native.js +3 -4
  1095. package/build-module/panel/bottom-separator-cover.native.js.map +1 -1
  1096. package/build-module/panel/header.js +4 -5
  1097. package/build-module/panel/header.js.map +1 -1
  1098. package/build-module/panel/index.js +5 -6
  1099. package/build-module/panel/index.js.map +1 -1
  1100. package/build-module/panel/row.js +4 -5
  1101. package/build-module/panel/row.js.map +1 -1
  1102. package/build-module/popover/index.js +25 -31
  1103. package/build-module/popover/index.js.map +1 -1
  1104. package/build-module/popover/limit-shift.js +66 -71
  1105. package/build-module/popover/limit-shift.js.map +1 -1
  1106. package/build-module/popover/overlay-middlewares.js +7 -9
  1107. package/build-module/popover/overlay-middlewares.js.map +1 -1
  1108. package/build-module/popover/utils.js +26 -34
  1109. package/build-module/popover/utils.js.map +1 -1
  1110. package/build-module/private-apis.js +2 -0
  1111. package/build-module/private-apis.js.map +1 -1
  1112. package/build-module/query-controls/author-select.js +7 -8
  1113. package/build-module/query-controls/author-select.js.map +1 -1
  1114. package/build-module/query-controls/category-select.js +8 -9
  1115. package/build-module/query-controls/category-select.js.map +1 -1
  1116. package/build-module/query-controls/index.js +16 -17
  1117. package/build-module/query-controls/index.js.map +1 -1
  1118. package/build-module/query-controls/index.native.js +13 -14
  1119. package/build-module/query-controls/index.native.js.map +1 -1
  1120. package/build-module/radio-control/index.js +1 -1
  1121. package/build-module/radio-control/index.js.map +1 -1
  1122. package/build-module/radio-control/index.native.js +6 -7
  1123. package/build-module/radio-control/index.native.js.map +1 -1
  1124. package/build-module/radio-group/index.js +8 -9
  1125. package/build-module/radio-group/index.js.map +1 -1
  1126. package/build-module/radio-group/radio/index.js +5 -6
  1127. package/build-module/radio-group/radio/index.js.map +1 -1
  1128. package/build-module/range-control/index.js +1 -3
  1129. package/build-module/range-control/index.js.map +1 -1
  1130. package/build-module/range-control/index.native.js +19 -21
  1131. package/build-module/range-control/index.native.js.map +1 -1
  1132. package/build-module/range-control/rail.js +7 -9
  1133. package/build-module/range-control/rail.js.map +1 -1
  1134. package/build-module/range-control/styles/range-control-styles.js +37 -52
  1135. package/build-module/range-control/styles/range-control-styles.js.map +1 -1
  1136. package/build-module/range-control/tooltip.js +4 -5
  1137. package/build-module/range-control/tooltip.js.map +1 -1
  1138. package/build-module/resizable-box/index.js +8 -9
  1139. package/build-module/resizable-box/index.js.map +1 -1
  1140. package/build-module/resizable-box/resize-tooltip/index.js +12 -13
  1141. package/build-module/resizable-box/resize-tooltip/index.js.map +1 -1
  1142. package/build-module/resizable-box/resize-tooltip/label.js +6 -7
  1143. package/build-module/resizable-box/resize-tooltip/label.js.map +1 -1
  1144. package/build-module/resizable-box/resize-tooltip/utils.js +16 -19
  1145. package/build-module/resizable-box/resize-tooltip/utils.js.map +1 -1
  1146. package/build-module/responsive-wrapper/index.js +6 -8
  1147. package/build-module/responsive-wrapper/index.js.map +1 -1
  1148. package/build-module/sandbox/index.js +16 -23
  1149. package/build-module/sandbox/index.js.map +1 -1
  1150. package/build-module/sandbox/index.native.js +20 -26
  1151. package/build-module/sandbox/index.native.js.map +1 -1
  1152. package/build-module/search-control/index.js +14 -17
  1153. package/build-module/search-control/index.js.map +1 -1
  1154. package/build-module/search-control/index.native.js +7 -8
  1155. package/build-module/search-control/index.native.js.map +1 -1
  1156. package/build-module/select-control/index.js +9 -19
  1157. package/build-module/select-control/index.js.map +1 -1
  1158. package/build-module/select-control/index.native.js +11 -12
  1159. package/build-module/select-control/index.native.js.map +1 -1
  1160. package/build-module/select-control/styles/select-control-styles.js +19 -25
  1161. package/build-module/select-control/styles/select-control-styles.js.map +1 -1
  1162. package/build-module/slot-fill/bubbles-virtually/fill.js +4 -5
  1163. package/build-module/slot-fill/bubbles-virtually/fill.js.map +1 -1
  1164. package/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js +4 -7
  1165. package/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js.map +1 -1
  1166. package/build-module/slot-fill/bubbles-virtually/slot.js +6 -7
  1167. package/build-module/slot-fill/bubbles-virtually/slot.js.map +1 -1
  1168. package/build-module/slot-fill/fill.js +4 -5
  1169. package/build-module/slot-fill/fill.js.map +1 -1
  1170. package/build-module/slot-fill/index.js +8 -11
  1171. package/build-module/slot-fill/index.js.map +1 -1
  1172. package/build-module/slot-fill/index.native.js +4 -5
  1173. package/build-module/slot-fill/index.native.js.map +1 -1
  1174. package/build-module/slot-fill/provider.js +2 -2
  1175. package/build-module/slot-fill/provider.js.map +1 -1
  1176. package/build-module/slot-fill/slot.js +9 -12
  1177. package/build-module/slot-fill/slot.js.map +1 -1
  1178. package/build-module/snackbar/index.js +26 -31
  1179. package/build-module/snackbar/index.js.map +1 -1
  1180. package/build-module/snackbar/list.js +9 -8
  1181. package/build-module/snackbar/list.js.map +1 -1
  1182. package/build-module/spinner/index.js +4 -5
  1183. package/build-module/spinner/index.js.map +1 -1
  1184. package/build-module/style-provider/index.native.js +3 -4
  1185. package/build-module/style-provider/index.native.js.map +1 -1
  1186. package/build-module/surface/styles.js +6 -7
  1187. package/build-module/surface/styles.js.map +1 -1
  1188. package/build-module/tab-panel/index.js +36 -40
  1189. package/build-module/tab-panel/index.js.map +1 -1
  1190. package/build-module/text/styles/text-mixins.native.js +1 -3
  1191. package/build-module/text/styles/text-mixins.native.js.map +1 -1
  1192. package/build-module/text/utils.js +16 -17
  1193. package/build-module/text/utils.js.map +1 -1
  1194. package/build-module/text-control/index.native.js +12 -13
  1195. package/build-module/text-control/index.native.js.map +1 -1
  1196. package/build-module/textarea-control/index.native.js +7 -8
  1197. package/build-module/textarea-control/index.native.js.map +1 -1
  1198. package/build-module/theme/color-algorithms.js +1 -2
  1199. package/build-module/theme/color-algorithms.js.map +1 -1
  1200. package/build-module/theme/index.js +6 -7
  1201. package/build-module/theme/index.js.map +1 -1
  1202. package/build-module/theme/styles.js +4 -8
  1203. package/build-module/theme/styles.js.map +1 -1
  1204. package/build-module/toggle-control/index.js +9 -11
  1205. package/build-module/toggle-control/index.js.map +1 -1
  1206. package/build-module/toggle-control/index.native.js +9 -10
  1207. package/build-module/toggle-control/index.native.js.map +1 -1
  1208. package/build-module/toggle-group-control/toggle-group-control/as-button-group.js +9 -10
  1209. package/build-module/toggle-group-control/toggle-group-control/as-button-group.js.map +1 -1
  1210. package/build-module/toggle-group-control/toggle-group-control/as-radio-group.js +9 -10
  1211. package/build-module/toggle-group-control/toggle-group-control/as-radio-group.js.map +1 -1
  1212. package/build-module/toggle-group-control/toggle-group-control/styles.js +5 -8
  1213. package/build-module/toggle-group-control/toggle-group-control/styles.js.map +1 -1
  1214. package/build-module/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.js +7 -8
  1215. package/build-module/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.js.map +1 -1
  1216. package/build-module/toggle-group-control/toggle-group-control-option-base/component.js +5 -7
  1217. package/build-module/toggle-group-control/toggle-group-control-option-base/component.js.map +1 -1
  1218. package/build-module/toggle-group-control/toggle-group-control-option-base/styles.js +11 -15
  1219. package/build-module/toggle-group-control/toggle-group-control-option-base/styles.js.map +1 -1
  1220. package/build-module/toolbar/toolbar/index.js +20 -8
  1221. package/build-module/toolbar/toolbar/index.js.map +1 -1
  1222. package/build-module/toolbar/toolbar/toolbar-container.js +4 -5
  1223. package/build-module/toolbar/toolbar/toolbar-container.js.map +1 -1
  1224. package/build-module/toolbar/toolbar/toolbar-container.native.js +3 -6
  1225. package/build-module/toolbar/toolbar/toolbar-container.native.js.map +1 -1
  1226. package/build-module/toolbar/toolbar-button/index.js +10 -11
  1227. package/build-module/toolbar/toolbar-button/index.js.map +1 -1
  1228. package/build-module/toolbar/toolbar-button/toolbar-button-container.js +6 -9
  1229. package/build-module/toolbar/toolbar-button/toolbar-button-container.js.map +1 -1
  1230. package/build-module/toolbar/toolbar-group/index.js +9 -12
  1231. package/build-module/toolbar/toolbar-group/index.js.map +1 -1
  1232. package/build-module/toolbar/toolbar-group/toolbar-group-collapsed.js +5 -6
  1233. package/build-module/toolbar/toolbar-group/toolbar-group-collapsed.js.map +1 -1
  1234. package/build-module/toolbar/toolbar-group/toolbar-group-collapsed.native.js +6 -7
  1235. package/build-module/toolbar/toolbar-group/toolbar-group-collapsed.native.js.map +1 -1
  1236. package/build-module/toolbar/toolbar-group/toolbar-group-container.js +7 -10
  1237. package/build-module/toolbar/toolbar-group/toolbar-group-container.js.map +1 -1
  1238. package/build-module/toolbar/toolbar-group/toolbar-group-container.native.js +7 -10
  1239. package/build-module/toolbar/toolbar-group/toolbar-group-container.native.js.map +1 -1
  1240. package/build-module/toolbar/toolbar-item/index.js +5 -6
  1241. package/build-module/toolbar/toolbar-item/index.js.map +1 -1
  1242. package/build-module/toolbar/toolbar-item/index.native.js +4 -6
  1243. package/build-module/toolbar/toolbar-item/index.native.js.map +1 -1
  1244. package/build-module/tools-panel/tools-panel/hook.js +17 -25
  1245. package/build-module/tools-panel/tools-panel/hook.js.map +1 -1
  1246. package/build-module/tools-panel/tools-panel-header/component.js +14 -24
  1247. package/build-module/tools-panel/tools-panel-header/component.js.map +1 -1
  1248. package/build-module/tools-panel/tools-panel-item/hook.js +5 -7
  1249. package/build-module/tools-panel/tools-panel-item/hook.js.map +1 -1
  1250. package/build-module/tooltip/index.js +36 -43
  1251. package/build-module/tooltip/index.js.map +1 -1
  1252. package/build-module/tooltip/index.native.js +14 -19
  1253. package/build-module/tooltip/index.native.js.map +1 -1
  1254. package/build-module/tree-grid/cell.js +5 -6
  1255. package/build-module/tree-grid/cell.js.map +1 -1
  1256. package/build-module/tree-grid/index.js +12 -15
  1257. package/build-module/tree-grid/index.js.map +1 -1
  1258. package/build-module/tree-grid/item.js +4 -5
  1259. package/build-module/tree-grid/item.js.map +1 -1
  1260. package/build-module/tree-grid/roving-tab-index-item.js +6 -7
  1261. package/build-module/tree-grid/roving-tab-index-item.js.map +1 -1
  1262. package/build-module/tree-grid/roving-tab-index.js +3 -4
  1263. package/build-module/tree-grid/roving-tab-index.js.map +1 -1
  1264. package/build-module/tree-grid/row.js +8 -9
  1265. package/build-module/tree-grid/row.js.map +1 -1
  1266. package/build-module/tree-select/index.js +9 -11
  1267. package/build-module/tree-select/index.js.map +1 -1
  1268. package/build-module/truncate/utils.js +1 -3
  1269. package/build-module/truncate/utils.js.map +1 -1
  1270. package/build-module/ui/context/context-connect.js +1 -1
  1271. package/build-module/ui/context/context-connect.js.map +1 -1
  1272. package/build-module/ui/context/context-system-provider.js +7 -9
  1273. package/build-module/ui/context/context-system-provider.js.map +1 -1
  1274. package/build-module/ui/context/index.js +1 -1
  1275. package/build-module/ui/context/index.js.map +1 -1
  1276. package/build-module/ui/context/use-context-system.js +1 -1
  1277. package/build-module/ui/context/use-context-system.js.map +1 -1
  1278. package/build-module/ui/control-group/hook.js +1 -1
  1279. package/build-module/ui/control-group/hook.js.map +1 -1
  1280. package/build-module/ui/form-group/form-group-content.js +12 -13
  1281. package/build-module/ui/form-group/form-group-content.js.map +1 -1
  1282. package/build-module/ui/form-group/form-group-help.js +3 -4
  1283. package/build-module/ui/form-group/form-group-help.js.map +1 -1
  1284. package/build-module/ui/form-group/form-group-label.js +7 -8
  1285. package/build-module/ui/form-group/form-group-label.js.map +1 -1
  1286. package/build-module/ui/tooltip/component.js +1 -1
  1287. package/build-module/ui/tooltip/component.js.map +1 -1
  1288. package/build-module/ui/utils/colors.js +1 -3
  1289. package/build-module/ui/utils/colors.js.map +1 -1
  1290. package/build-module/ui/utils/font-size.js +2 -6
  1291. package/build-module/ui/utils/font-size.js.map +1 -1
  1292. package/build-module/ui/utils/get-high-dpi.js +1 -5
  1293. package/build-module/ui/utils/get-high-dpi.js.map +1 -1
  1294. package/build-module/ui/utils/space.js +1 -3
  1295. package/build-module/ui/utils/space.js.map +1 -1
  1296. package/build-module/ui/utils/use-responsive-value.js +2 -4
  1297. package/build-module/ui/utils/use-responsive-value.js.map +1 -1
  1298. package/build-module/unit-control/index.js +8 -8
  1299. package/build-module/unit-control/index.js.map +1 -1
  1300. package/build-module/unit-control/index.native.js +22 -23
  1301. package/build-module/unit-control/index.native.js.map +1 -1
  1302. package/build-module/unit-control/styles/unit-control-styles.js +6 -8
  1303. package/build-module/unit-control/styles/unit-control-styles.js.map +1 -1
  1304. package/build-module/unit-control/unit-select-control.js +11 -13
  1305. package/build-module/unit-control/unit-select-control.js.map +1 -1
  1306. package/build-module/unit-control/utils.js +12 -19
  1307. package/build-module/unit-control/utils.js.map +1 -1
  1308. package/build-module/utils/browsers.js +2 -10
  1309. package/build-module/utils/browsers.js.map +1 -1
  1310. package/build-module/utils/colors.js +1 -3
  1311. package/build-module/utils/colors.js.map +1 -1
  1312. package/build-module/utils/config-values.js +1 -0
  1313. package/build-module/utils/config-values.js.map +1 -1
  1314. package/build-module/utils/hooks/use-controlled-state.js +1 -2
  1315. package/build-module/utils/hooks/use-controlled-state.js.map +1 -1
  1316. package/build-module/utils/hooks/use-controlled-value.js +5 -6
  1317. package/build-module/utils/hooks/use-controlled-value.js.map +1 -1
  1318. package/build-module/utils/hooks/use-cx.js +1 -5
  1319. package/build-module/utils/hooks/use-cx.js.map +1 -1
  1320. package/build-module/utils/math.js +5 -17
  1321. package/build-module/utils/math.js.map +1 -1
  1322. package/build-module/utils/reduce-motion.js +1 -2
  1323. package/build-module/utils/reduce-motion.js.map +1 -1
  1324. package/build-module/utils/rtl.js +3 -9
  1325. package/build-module/utils/rtl.js.map +1 -1
  1326. package/build-module/utils/values.js +2 -6
  1327. package/build-module/utils/values.js.map +1 -1
  1328. package/build-module/z-stack/styles.js +14 -23
  1329. package/build-module/z-stack/styles.js.map +1 -1
  1330. package/build-style/style-rtl.css +46 -13
  1331. package/build-style/style.css +48 -15
  1332. package/build-types/border-control/border-control-dropdown/component.d.ts.map +1 -1
  1333. package/build-types/button/deprecated.d.ts +6 -0
  1334. package/build-types/button/deprecated.d.ts.map +1 -1
  1335. package/build-types/button/index.d.ts.map +1 -1
  1336. package/build-types/button/stories/e2e/index.d.ts +14 -0
  1337. package/build-types/button/stories/e2e/index.d.ts.map +1 -0
  1338. package/build-types/button/types.d.ts +9 -0
  1339. package/build-types/button/types.d.ts.map +1 -1
  1340. package/build-types/color-palette/index.d.ts.map +1 -1
  1341. package/build-types/dropdown-menu-v2/index.d.ts +1 -1
  1342. package/build-types/dropdown-menu-v2/index.d.ts.map +1 -1
  1343. package/build-types/dropdown-menu-v2/stories/index.d.ts +2 -4
  1344. package/build-types/dropdown-menu-v2/stories/index.d.ts.map +1 -1
  1345. package/build-types/dropdown-menu-v2/styles.d.ts +4 -3
  1346. package/build-types/dropdown-menu-v2/styles.d.ts.map +1 -1
  1347. package/build-types/dropdown-menu-v2/types.d.ts +11 -1
  1348. package/build-types/dropdown-menu-v2/types.d.ts.map +1 -1
  1349. package/build-types/focal-point-picker/controls.d.ts.map +1 -1
  1350. package/build-types/font-size-picker/index.d.ts.map +1 -1
  1351. package/build-types/font-size-picker/styles.d.ts +11 -0
  1352. package/build-types/font-size-picker/styles.d.ts.map +1 -1
  1353. package/build-types/navigator/navigator-back-button/component.d.ts +1 -0
  1354. package/build-types/navigator/navigator-back-button/component.d.ts.map +1 -1
  1355. package/build-types/navigator/navigator-back-button/hook.d.ts +1 -0
  1356. package/build-types/navigator/navigator-back-button/hook.d.ts.map +1 -1
  1357. package/build-types/navigator/navigator-button/component.d.ts +1 -0
  1358. package/build-types/navigator/navigator-button/component.d.ts.map +1 -1
  1359. package/build-types/navigator/navigator-button/hook.d.ts +1 -0
  1360. package/build-types/navigator/navigator-button/hook.d.ts.map +1 -1
  1361. package/build-types/navigator/navigator-to-parent-button/component.d.ts +1 -0
  1362. package/build-types/navigator/navigator-to-parent-button/component.d.ts.map +1 -1
  1363. package/build-types/popover/index.d.ts +6 -0
  1364. package/build-types/popover/index.d.ts.map +1 -1
  1365. package/build-types/private-apis.d.ts.map +1 -1
  1366. package/build-types/snackbar/list.d.ts.map +1 -1
  1367. package/build-types/tab-panel/index.d.ts +1 -38
  1368. package/build-types/tab-panel/index.d.ts.map +1 -1
  1369. package/build-types/tab-panel/stories/index.d.ts +4 -3
  1370. package/build-types/tab-panel/stories/index.d.ts.map +1 -1
  1371. package/build-types/toolbar/toolbar/index.d.ts.map +1 -1
  1372. package/build-types/toolbar/toolbar-button/index.d.ts +6 -0
  1373. package/build-types/toolbar/toolbar-button/index.d.ts.map +1 -1
  1374. package/build-types/ui/context/index.d.ts +1 -1
  1375. package/build-types/ui/context/index.d.ts.map +1 -1
  1376. package/build-types/utils/config-values.d.ts +1 -0
  1377. package/package.json +19 -19
  1378. package/src/border-control/border-control-dropdown/component.tsx +23 -12
  1379. package/src/border-control/test/index.js +6 -6
  1380. package/src/button/index.tsx +2 -0
  1381. package/src/button/stories/e2e/index.tsx +58 -0
  1382. package/src/button/style.scss +12 -3
  1383. package/src/button/types.ts +9 -0
  1384. package/src/color-palette/index.tsx +47 -46
  1385. package/src/color-palette/style.scss +57 -19
  1386. package/src/color-palette/test/__snapshots__/index.tsx.snap +66 -50
  1387. package/src/color-palette/test/index.tsx +76 -13
  1388. package/src/dropdown-menu-v2/README.md +1 -1
  1389. package/src/dropdown-menu-v2/index.tsx +79 -27
  1390. package/src/dropdown-menu-v2/stories/index.tsx +28 -4
  1391. package/src/dropdown-menu-v2/styles.ts +42 -29
  1392. package/src/dropdown-menu-v2/types.ts +16 -1
  1393. package/src/focal-point-picker/controls.tsx +2 -0
  1394. package/src/focal-point-picker/test/index.js +9 -3
  1395. package/src/font-size-picker/index.tsx +5 -5
  1396. package/src/font-size-picker/styles.ts +9 -0
  1397. package/src/mobile/bottom-sheet/cell.native.js +8 -0
  1398. package/src/mobile/bottom-sheet/color-cell.native.js +3 -2
  1399. package/src/mobile/bottom-sheet/lock-icon/index.native.js +19 -0
  1400. package/src/mobile/bottom-sheet/lock-icon/styles.native.scss +8 -0
  1401. package/src/mobile/bottom-sheet/radio-cell.native.js +2 -1
  1402. package/src/mobile/bottom-sheet/range-cell.native.js +3 -0
  1403. package/src/mobile/bottom-sheet/styles.native.scss +5 -3
  1404. package/src/mobile/bottom-sheet-select-control/index.native.js +1 -1
  1405. package/src/mobile/bottom-sheet-text-control/index.native.js +1 -1
  1406. package/src/popover/index.tsx +1 -1
  1407. package/src/private-apis.ts +2 -0
  1408. package/src/slot-fill/README.md +26 -1
  1409. package/src/snackbar/list.tsx +1 -0
  1410. package/src/tab-panel/index.tsx +18 -12
  1411. package/src/toolbar/toolbar/index.tsx +24 -7
  1412. package/src/ui/context/index.ts +1 -0
  1413. package/src/utils/config-values.js +1 -0
  1414. package/src/view/README.md +2 -2
  1415. package/tsconfig.tsbuildinfo +1 -1
@@ -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,IAAAA,WAAW,GAAG,MAAM,CAAE,CAFvB;AAGCC,IAAAA,aAAa,GAAG,MAAM,CAAE,CAHzB;AAICC,IAAAA,UAAU,GAAG,MAAM,CAAE,CAJtB;AAKCC,IAAAA,oBALD;AAMC,OAAGC;AANJ,GAUC;AACD,QAAMC,SAAS,GAAG,0BACfC,KAAF,IAAsD;AACrD,UAAM;AAAEC,MAAAA,OAAF;AAAWC,MAAAA,OAAX;AAAoBC,MAAAA,OAApB;AAA6BC,MAAAA;AAA7B,QAAwCJ,KAA9C,CADqD,CAGrD;AACA;;AACA,UAAMK,qBAAqB,GAAGH,OAAO,IAAIC,OAAX,IAAsBC,MAApD;;AAEA,QACCC,qBAAqB,IACrB,CAAI,CAAEC,YAAF,EAAMC,cAAN,EAAYC,cAAZ,EAAkBC,eAAlB,EAAyBC,cAAzB,EAA+BC,aAA/B,CAAF,CAAqDC,QAArD,CACDX,OADC,CAFH,EAKE;AACD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D,CA8B/D;;AACA,UAAK,CAAEC,mBAAF,IAAyB,CAAEA,mBAAmB,CAACd,MAApD,EAA6D;AAC5D;AACA;AACA;AACA7B,QAAAA,KAAK,CAAC8B,cAAN;AACA;AACA,OArC8D,CAuC/D;;;AACA,YAAML,SAAS,GAAGC,IAAI,CAACE,GAAL,CACjBR,kBADiB,EAEjBuB,mBAAmB,CAACd,MAApB,GAA6B,CAFZ,CAAlB;AAIAc,MAAAA,mBAAmB,CAAElB,SAAF,CAAnB,CAAiCxC,KAAjC,GA5C+D,CA8C/D;AACA;;AACAW,MAAAA,UAAU,CAAEI,KAAF,EAASmB,SAAT,EAAoBc,IAAI,CAAES,YAAF,CAAxB,CAAV,CAhD+D,CAkD/D;AACA;;AACA1C,MAAAA,KAAK,CAAC8B,cAAN;AACA;AACD,GAzPgB,EA0PjB,CAAEpC,WAAF,EAAeC,aAAf,EAA8BC,UAA9B,CA1PiB,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,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/C;AACA,GAFM,CAAP;AAGA;AAED;AACA;AACA;AACA;;;AACA,SAASQ,mBAAT,CACC;AACCC,EAAAA,QADD;AAECC,EAAAA,WAAW,GAAG,MAAM,CAAE,CAFvB;AAGCC,EAAAA,aAAa,GAAG,MAAM,CAAE,CAHzB;AAICC,EAAAA,UAAU,GAAG,MAAM,CAAE,CAJtB;AAKCC,EAAAA,oBALD;AAMC,KAAGC;AANJ,CADD;AASC;AACAC,GAVD,EAWE;AACD,QAAMC,SAAS,GAAG,0BACfC,KAAF,IAAsD;AACrD,UAAM;AAAEC,MAAAA,OAAF;AAAWC,MAAAA,OAAX;AAAoBC,MAAAA,OAApB;AAA6BC,MAAAA;AAA7B,QAAwCJ,KAA9C,CADqD,CAGrD;AACA;;AACA,UAAMK,qBAAqB,GAAGH,OAAO,IAAIC,OAAX,IAAsBC,MAApD;;AAEA,QACCC,qBAAqB,IACrB,CAAI,CAAEC,YAAF,E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;;AACA,YAAMa,mBAAmB,GAAG7D,gBAAgB,CAC3CmD,IAAI,CAAES,YAAF,CADuC,CAA5C,CA1B+D,CA8B/D;;AACA,UAAK,CAAEC,mBAAF,IAAyB,CAAEA,mBAAmB,CAACd,MAApD,EAA6D;AAC5D;AACA;AACA;AACA7B,QAAAA,KAAK,CAAC8B,cAAN;AACA;AACA,OArC8D,CAuC/D;;;AACA,YAAML,SAAS,GAAGC,IAAI,CAACE,GAAL,CACjBR,kBADiB,EAEjBuB,mBAAmB,CAACd,MAApB,GAA6B,CAFZ,CAAlB;AAIAc,MAAAA,mBAAmB,CAAElB,SAAF,CAAnB,CAAiCxC,KAAjC,GA5C+D,CA8C/D;AACA;;AACAU,MAAAA,UAAU,CAAEK,KAAF,EAASmB,SAAT,EAAoBc,IAAI,CAAES,YAAF,CAAxB,CAAV,CAhD+D,CAkD/D;AACA;;AACA1C,MAAAA,KAAK,CAAC8B,cAAN;AACA;AACD,GAzPgB,EA0PjB,CAAErC,WAAF,EAAeC,aAAf,EAA8BC,UAA9B,CA1PiB,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,QA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;;AAEA,MAAKhB,aAAa,KAAKR,aAAa,CAACK,IAArC,EAA4C;AAC3C,WAAOiB,KAAP;AACA;;AAED,MAAIG,YAAJ;AACA,MAAIC,YAAJ;;AAEA,UAASlB,aAAT;AACC,SAAKR,aAAa,CAACE,IAAnB;AACCuB,MAAAA,YAAY,GAAG,CAAf;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"]}
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,UAFd,IAGAE,WAAW,GAAGC,UAAd,IAA4BH,UAJ7B,EAKE;AACD,WAAOH,IAAP;AACA,GAPD,MAOO,IAAKM,UAAU,KAAK,CAApB,EAAwB;AAC9B,WAAON,IAAI,CAACQ,KAAL,CAAY,CAAZ,EAAeH,WAAf,IAA+BE,WAAtC;AACA;;AACD,SACCP,IAAI,CAACQ,KAAL,CAAY,CAAZ,EAAeH,WAAf,IACAE,WADA,GAEAP,IAAI,CAACQ,KAAL,CAAYL,UAAU,GAAGG,UAAzB,CAHD;AAKA;;AAEM,SAASG,eAAT,CACNC,KAAa,GAAG,EADV,EAENC,KAFM,EAGL;AACD,QAAMC,WAAW,GAAG,EAAE,GAAGlB,sBAAL;AAA6B,OAAGiB;AAAhC,GAApB;AACA,QAAM;AAAEhB,IAAAA,QAAF;AAAYC,IAAAA,aAAZ;AAA2BC,IAAAA;AAA3B,MAAqCe,WAA3C;;AAEA,MAAKhB,aAAa,KAAKR,aAAa,CAACK,IAArC,EAA4C;AAC3C,WAAOiB,KAAP;AACA;;AAED,MAAIG,YAAJ;AACA,MAAIC,YAAJ;;AAEA,UAASlB,aAAT;AACC,SAAKR,aAAa,CAACE,IAAnB;AACCuB,MAAAA,YAAY,GAAG,CAAf;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,wBAA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,IAAAA,UAAU,GAAGjB,SAAS,CAAEQ,mCAAF,CAAtB;AACA,GATU,CAWX;;;AACA,MAAKR,SAAS,CAACkB,IAAV,IAAkBlB,SAAS,CAACkB,IAAV,CAAgBV,mCAAhB,CAAvB,EAAoE;AACnE;AACAS,IAAAA,UAAU,GAAGjB,SAAS,CAACkB,IAAV,CAAgBV,mCAAhB,CAAb;AACA;;AAED,SAAOS,UAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;;;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"]}
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;;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,QAA1B,EAAqC;AACpCM,IAAAA,eAAe,GAAG,CAAE,GAAGA,eAAL,EAAsBN,SAAtB,CAAlB;AACA,GAtBA,CAwBD;AACA;;;AACA,SAAOU,MAAM,CAACC,MAAP,CAAeN,gBAAf,EAAiC;AACvC,KAAEE,mCAAF,GAA8B,CAAE,GAAG,IAAIK,GAAJ,CAASN,eAAT,CAAL,CADS;AAEvCO,IAAAA,WAAW,EAAEb,SAF0B;AAGvCc,IAAAA,QAAQ,EAAG,IAAI,0DAA2Bd,SAA3B,CAAwC;AAHhB,GAAjC,CAAP;AAKA;AAED;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASe,mBAAT,CACNhB,SADM,EAEK;AACX,MAAK,CAAEA,SAAP,EAAmB,OAAO,EAAP;AAEnB,MAAIiB,UAAU,GAAG,EAAjB,CAHW,CAKX;;AACA,MAAKjB,SAAS,CAAEQ,mCAAF,CAAd,EAA6C;AAC5C;AACAS,IAAAA,UAAU,GAAGjB,SAAS,CAAEQ,mCAAF,CAAtB;AACA,GATU,CAWX;;;AACA,MAAKR,SAAS,CAACkB,IAAV,IAAkBlB,SAAS,CAACkB,IAAV,CAAgBV,mCAAhB,CAAvB,EAAoE;AACnE;AACAS,IAAAA,UAAU,GAAGjB,SAAS,CAACkB,IAAV,CAAgBV,mCAAhB,CAAb;AACA;;AAED,SAAOS,UAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;;;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"]}
@@ -49,10 +49,9 @@ const useComponentsContext = () => (0, _element.useContext)(ComponentsContext);
49
49
 
50
50
  exports.useComponentsContext = useComponentsContext;
51
51
 
52
- function useContextSystemBridge(_ref) {
53
- let {
54
- value
55
- } = _ref;
52
+ function useContextSystemBridge({
53
+ value
54
+ }) {
56
55
  const parentContext = useComponentsContext();
57
56
  const valueRef = (0, _element.useRef)(value);
58
57
  (0, _utils.useUpdateEffect)(() => {
@@ -101,11 +100,10 @@ function useContextSystemBridge(_ref) {
101
100
  */
102
101
 
103
102
 
104
- const BaseContextSystemProvider = _ref2 => {
105
- let {
106
- children,
107
- value
108
- } = _ref2;
103
+ const BaseContextSystemProvider = ({
104
+ children,
105
+ value
106
+ }) => {
109
107
  const contextValue = useContextSystemBridge({
110
108
  value
111
109
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/ui/context/context-system-provider.js"],"names":["ComponentsContext","useComponentsContext","useContextSystemBridge","value","parentContext","valueRef","current","JSON","stringify","config","isMergeableObject","isPlainObject","BaseContextSystemProvider","children","contextValue","ContextSystemProvider"],"mappings":";;;;;;;;;AAUA;;AAPA;;AACA;;AACA;;AAYA;;AAKA;;AAtBA;AACA;AACA;;AAKA;AACA;AACA;;AAUA;AACA;AACA;AAGO,MAAMA,iBAAiB,GAAG;AAChC;AAAqC,EADL,CAA1B;;;AAGA,MAAMC,oBAAoB,GAAG,MAAM,yBAAYD,iBAAZ,CAAnC;AAEP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;AACA,SAASE,sBAAT,OAA6C;AAAA,MAAZ;AAAEC,IAAAA;AAAF,GAAY;AAC5C,QAAMC,aAAa,GAAGH,oBAAoB,EAA1C;AAEA,QAAMI,QAAQ,GAAG,qBAAQF,KAAR,CAAjB;AAEA,8BAAiB,MAAM;AACtB,SACC;AACA,qBAAeE,QAAQ,CAACC,OAAxB,EAAiCH,KAAjC,KACA;AACAE,IAAAA,QAAQ,CAACC,OAAT,KAAqBH,KAJtB,EAKE;AACD,qHAAO,gCAAgCI,IAAI,CAACC,SAAL,CAAgBL,KAAhB,CAAyB,EAAhE;AACA;AACD,GATD,EASG,CAAEA,KAAF,CATH,EAL4C,CAgB5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,QAAMM,MAAM,GAAG,sBAAS,MAAM;AAC7B;AACA,WAAO,wBAAWL,aAAX,aAAWA,aAAX,cAAWA,aAAX,GAA4B,EAA5B,EAAgCD,KAAhC,aAAgCA,KAAhC,cAAgCA,KAAhC,GAAyC,EAAzC,EAA6C;AACnDO,MAAAA,iBAAiB,EAAEC;AADgC,KAA7C,CAAP;AAGA,GALc,EAKZ,CAAEP,aAAF,EAAiBD,KAAjB,CALY,CAAf;AAOA,SAAOM,MAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAMG,yBAAyB,GAAG,SAA2B;AAAA,MAAzB;AAAEC,IAAAA,QAAF;AAAYV,IAAAA;AAAZ,GAAyB;AAC5D,QAAMW,YAAY,GAAGZ,sBAAsB,CAAE;AAAEC,IAAAA;AAAF,GAAF,CAA3C;AAEA,SACC,4BAAC,iBAAD,CAAmB,QAAnB;AAA4B,IAAA,KAAK,EAAGW;AAApC,KACGD,QADH,CADD;AAKA,CARD;;AAUO,MAAME,qBAAqB,GAAG,mBAAMH,yBAAN,CAA9B","sourcesContent":["/**\n * External dependencies\n */\nimport deepmerge from 'deepmerge';\nimport fastDeepEqual from 'fast-deep-equal/es6';\nimport { isPlainObject } from 'is-plain-object';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tcreateContext,\n\tuseContext,\n\tuseRef,\n\tuseMemo,\n\tmemo,\n} from '@wordpress/element';\nimport warn from '@wordpress/warning';\n\n/**\n * Internal dependencies\n */\nimport { useUpdateEffect } from '../../utils';\n\nexport const ComponentsContext = createContext(\n\t/** @type {Record<string, any>} */ ( {} )\n);\nexport const useComponentsContext = () => useContext( ComponentsContext );\n\n/**\n * Consolidates incoming ContextSystem values with a (potential) parent ContextSystem value.\n *\n * Note: This function will warn if it detects an un-memoized `value`\n *\n * @param {Object} props\n * @param {Record<string, any>} props.value\n * @return {Record<string, any>} The consolidated value.\n */\nfunction useContextSystemBridge( { value } ) {\n\tconst parentContext = useComponentsContext();\n\n\tconst valueRef = useRef( value );\n\n\tuseUpdateEffect( () => {\n\t\tif (\n\t\t\t// Objects are equivalent.\n\t\t\tfastDeepEqual( valueRef.current, value ) &&\n\t\t\t// But not the same reference.\n\t\t\tvalueRef.current !== value\n\t\t) {\n\t\t\twarn( `Please memoize your context: ${ JSON.stringify( value ) }` );\n\t\t}\n\t}, [ value ] );\n\n\t// `parentContext` will always be memoized (i.e., the result of this hook itself)\n\t// or the default value from when the `ComponentsContext` was originally\n\t// initialized (which will never change, it's a static variable)\n\t// so this memoization will prevent `deepmerge()` from rerunning unless\n\t// the references to `value` change OR the `parentContext` has an actual material change\n\t// (because again, it's guaranteed to be memoized or a static reference to the empty object\n\t// so we know that the only changes for `parentContext` are material ones... i.e., why we\n\t// don't have to warn in the `useUpdateEffect` hook above for `parentContext` and we only\n\t// need to bother with the `value`). The `useUpdateEffect` above will ensure that we are\n\t// correctly warning when the `value` isn't being properly memoized. All of that to say\n\t// that this should be super safe to assume that `useMemo` will only run on actual\n\t// changes to the two dependencies, therefore saving us calls to `deepmerge()`!\n\tconst config = useMemo( () => {\n\t\t// Deep clone `parentContext` to avoid mutating it later.\n\t\treturn deepmerge( parentContext ?? {}, value ?? {}, {\n\t\t\tisMergeableObject: isPlainObject,\n\t\t} );\n\t}, [ parentContext, value ] );\n\n\treturn config;\n}\n\n/**\n * A Provider component that can modify props for connected components within\n * the Context system.\n *\n * @example\n * ```jsx\n * <ContextSystemProvider value={{ Button: { size: 'small' }}}>\n * <Button>...</Button>\n * </ContextSystemProvider>\n * ```\n *\n * @template {Record<string, any>} T\n * @param {Object} options\n * @param {import('react').ReactNode} options.children Children to render.\n * @param {T} options.value Props to render into connected components.\n * @return {JSX.Element} A Provider wrapped component.\n */\nconst BaseContextSystemProvider = ( { children, value } ) => {\n\tconst contextValue = useContextSystemBridge( { value } );\n\n\treturn (\n\t\t<ComponentsContext.Provider value={ contextValue }>\n\t\t\t{ children }\n\t\t</ComponentsContext.Provider>\n\t);\n};\n\nexport const ContextSystemProvider = memo( BaseContextSystemProvider );\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/ui/context/context-system-provider.js"],"names":["ComponentsContext","useComponentsContext","useContextSystemBridge","value","parentContext","valueRef","current","JSON","stringify","config","isMergeableObject","isPlainObject","BaseContextSystemProvider","children","contextValue","ContextSystemProvider"],"mappings":";;;;;;;;;AAUA;;AAPA;;AACA;;AACA;;AAYA;;AAKA;;AAtBA;AACA;AACA;;AAKA;AACA;AACA;;AAUA;AACA;AACA;AAGO,MAAMA,iBAAiB,GAAG;AAChC;AAAqC,EADL,CAA1B;;;AAGA,MAAMC,oBAAoB,GAAG,MAAM,yBAAYD,iBAAZ,CAAnC;AAEP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;AACA,SAASE,sBAAT,CAAiC;AAAEC,EAAAA;AAAF,CAAjC,EAA6C;AAC5C,QAAMC,aAAa,GAAGH,oBAAoB,EAA1C;AAEA,QAAMI,QAAQ,GAAG,qBAAQF,KAAR,CAAjB;AAEA,8BAAiB,MAAM;AACtB,SACC;AACA,qBAAeE,QAAQ,CAACC,OAAxB,EAAiCH,KAAjC,KACA;AACAE,IAAAA,QAAQ,CAACC,OAAT,KAAqBH,KAJtB,EAKE;AACD,qHAAO,gCAAgCI,IAAI,CAACC,SAAL,CAAgBL,KAAhB,CAAyB,EAAhE;AACA;AACD,GATD,EASG,CAAEA,KAAF,CATH,EAL4C,CAgB5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,QAAMM,MAAM,GAAG,sBAAS,MAAM;AAC7B;AACA,WAAO,wBAAWL,aAAX,aAAWA,aAAX,cAAWA,aAAX,GAA4B,EAA5B,EAAgCD,KAAhC,aAAgCA,KAAhC,cAAgCA,KAAhC,GAAyC,EAAzC,EAA6C;AACnDO,MAAAA,iBAAiB,EAAEC;AADgC,KAA7C,CAAP;AAGA,GALc,EAKZ,CAAEP,aAAF,EAAiBD,KAAjB,CALY,CAAf;AAOA,SAAOM,MAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAMG,yBAAyB,GAAG,CAAE;AAAEC,EAAAA,QAAF;AAAYV,EAAAA;AAAZ,CAAF,KAA2B;AAC5D,QAAMW,YAAY,GAAGZ,sBAAsB,CAAE;AAAEC,IAAAA;AAAF,GAAF,CAA3C;AAEA,SACC,4BAAC,iBAAD,CAAmB,QAAnB;AAA4B,IAAA,KAAK,EAAGW;AAApC,KACGD,QADH,CADD;AAKA,CARD;;AAUO,MAAME,qBAAqB,GAAG,mBAAMH,yBAAN,CAA9B","sourcesContent":["/**\n * External dependencies\n */\nimport deepmerge from 'deepmerge';\nimport fastDeepEqual from 'fast-deep-equal/es6';\nimport { isPlainObject } from 'is-plain-object';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tcreateContext,\n\tuseContext,\n\tuseRef,\n\tuseMemo,\n\tmemo,\n} from '@wordpress/element';\nimport warn from '@wordpress/warning';\n\n/**\n * Internal dependencies\n */\nimport { useUpdateEffect } from '../../utils';\n\nexport const ComponentsContext = createContext(\n\t/** @type {Record<string, any>} */ ( {} )\n);\nexport const useComponentsContext = () => useContext( ComponentsContext );\n\n/**\n * Consolidates incoming ContextSystem values with a (potential) parent ContextSystem value.\n *\n * Note: This function will warn if it detects an un-memoized `value`\n *\n * @param {Object} props\n * @param {Record<string, any>} props.value\n * @return {Record<string, any>} The consolidated value.\n */\nfunction useContextSystemBridge( { value } ) {\n\tconst parentContext = useComponentsContext();\n\n\tconst valueRef = useRef( value );\n\n\tuseUpdateEffect( () => {\n\t\tif (\n\t\t\t// Objects are equivalent.\n\t\t\tfastDeepEqual( valueRef.current, value ) &&\n\t\t\t// But not the same reference.\n\t\t\tvalueRef.current !== value\n\t\t) {\n\t\t\twarn( `Please memoize your context: ${ JSON.stringify( value ) }` );\n\t\t}\n\t}, [ value ] );\n\n\t// `parentContext` will always be memoized (i.e., the result of this hook itself)\n\t// or the default value from when the `ComponentsContext` was originally\n\t// initialized (which will never change, it's a static variable)\n\t// so this memoization will prevent `deepmerge()` from rerunning unless\n\t// the references to `value` change OR the `parentContext` has an actual material change\n\t// (because again, it's guaranteed to be memoized or a static reference to the empty object\n\t// so we know that the only changes for `parentContext` are material ones... i.e., why we\n\t// don't have to warn in the `useUpdateEffect` hook above for `parentContext` and we only\n\t// need to bother with the `value`). The `useUpdateEffect` above will ensure that we are\n\t// correctly warning when the `value` isn't being properly memoized. All of that to say\n\t// that this should be super safe to assume that `useMemo` will only run on actual\n\t// changes to the two dependencies, therefore saving us calls to `deepmerge()`!\n\tconst config = useMemo( () => {\n\t\t// Deep clone `parentContext` to avoid mutating it later.\n\t\treturn deepmerge( parentContext ?? {}, value ?? {}, {\n\t\t\tisMergeableObject: isPlainObject,\n\t\t} );\n\t}, [ parentContext, value ] );\n\n\treturn config;\n}\n\n/**\n * A Provider component that can modify props for connected components within\n * the Context system.\n *\n * @example\n * ```jsx\n * <ContextSystemProvider value={{ Button: { size: 'small' }}}>\n * <Button>...</Button>\n * </ContextSystemProvider>\n * ```\n *\n * @template {Record<string, any>} T\n * @param {Object} options\n * @param {import('react').ReactNode} options.children Children to render.\n * @param {T} options.value Props to render into connected components.\n * @return {JSX.Element} A Provider wrapped component.\n */\nconst BaseContextSystemProvider = ( { children, value } ) => {\n\tconst contextValue = useContextSystemBridge( { value } );\n\n\treturn (\n\t\t<ComponentsContext.Provider value={ contextValue }>\n\t\t\t{ children }\n\t\t</ComponentsContext.Provider>\n\t);\n};\n\nexport const ContextSystemProvider = memo( BaseContextSystemProvider );\n"]}
@@ -7,6 +7,7 @@ var _exportNames = {
7
7
  ContextSystemProvider: true,
8
8
  useComponentsContext: true,
9
9
  contextConnect: true,
10
+ contextConnectWithoutRef: true,
10
11
  hasConnectNamespace: true,
11
12
  getConnectNamespace: true,
12
13
  useContextSystem: true
@@ -23,6 +24,12 @@ Object.defineProperty(exports, "contextConnect", {
23
24
  return _contextConnect.contextConnect;
24
25
  }
25
26
  });
27
+ Object.defineProperty(exports, "contextConnectWithoutRef", {
28
+ enumerable: true,
29
+ get: function () {
30
+ return _contextConnect.contextConnectWithoutRef;
31
+ }
32
+ });
26
33
  Object.defineProperty(exports, "getConnectNamespace", {
27
34
  enumerable: true,
28
35
  get: function () {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/ui/context/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AAIA;;AAKA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA","sourcesContent":["export {\n\tContextSystemProvider,\n\tuseComponentsContext,\n} from './context-system-provider';\nexport {\n\tcontextConnect,\n\thasConnectNamespace,\n\tgetConnectNamespace,\n} from './context-connect';\nexport { useContextSystem } from './use-context-system';\nexport * from './wordpress-component';\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/ui/context/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AAIA;;AAMA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA","sourcesContent":["export {\n\tContextSystemProvider,\n\tuseComponentsContext,\n} from './context-system-provider';\nexport {\n\tcontextConnect,\n\tcontextConnectWithoutRef,\n\thasConnectNamespace,\n\tgetConnectNamespace,\n} from './context-connect';\nexport { useContextSystem } from './use-context-system';\nexport * from './wordpress-component';\n"]}
@@ -46,7 +46,7 @@ function useContextSystem(props, namespace) {
46
46
  typeof process !== "undefined" && process.env && process.env.NODE_ENV !== "production" ? (0, _warning.default)('useContextSystem: Please provide a namespace') : void 0;
47
47
  }
48
48
 
49
- const contextProps = (contextSystemProps === null || contextSystemProps === void 0 ? void 0 : contextSystemProps[namespace]) || {};
49
+ const contextProps = contextSystemProps?.[namespace] || {};
50
50
  /* eslint-disable jsdoc/no-undefined-types */
51
51
 
52
52
  /** @type {ConnectedProps<P>} */
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/ui/context/use-context-system.js"],"names":["useContextSystem","props","namespace","contextSystemProps","contextProps","finalComponentProps","_overrides","overrideProps","otherContextProps","initialMergedProps","Object","entries","length","assign","cx","classes","className","rendered","renderChildren","children","key","undefined"],"mappings":";;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AACA;;AAXA;AACA;AACA;;AAGA;AACA;AACA;;AAMA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,gBAAT,CAA2BC,KAA3B,EAAkCC,SAAlC,EAA8C;AACpD,QAAMC,kBAAkB,GAAG,kDAA3B;;AACA,MAAK,OAAOD,SAAP,KAAqB,WAA1B,EAAwC;AACvC,mHAAM,8CAAN;AACA;;AAED,QAAME,YAAY,GAAG,CAAAD,kBAAkB,SAAlB,IAAAA,kBAAkB,WAAlB,YAAAA,kBAAkB,CAAID,SAAJ,CAAlB,KAAqC,EAA1D;AAEA;;AACA;AACA;;AACA,QAAMG,mBAAmB,GAAG,EAC3B,GAAG,mCADwB;AAE3B,OAAG,yBAAcH,SAAd;AAFwB,GAA5B;AAIA;;AAEA,QAAM;AAAEI,IAAAA,UAAU,EAAEC,aAAd;AAA6B,OAAGC;AAAhC,MAAsDJ,YAA5D;AAEA,QAAMK,kBAAkB,GAAGC,MAAM,CAACC,OAAP,CAAgBH,iBAAhB,EAAoCI,MAApC,GACxBF,MAAM,CAACG,MAAP,CAAe,EAAf,EAAmBL,iBAAnB,EAAsCP,KAAtC,CADwB,GAExBA,KAFH;AAIA,QAAMa,EAAE,GAAG,mBAAX;AAEA,QAAMC,OAAO,GAAGD,EAAE,CACjB,0DAA2BZ,SAA3B,CADiB,EAEjBD,KAAK,CAACe,SAFW,CAAlB,CAzBoD,CA8BpD;;AACA,QAAMC,QAAQ,GACb,OAAOR,kBAAkB,CAACS,cAA1B,KAA6C,UAA7C,GACGT,kBAAkB,CAACS,cAAnB,CAAmCT,kBAAnC,CADH,GAEGA,kBAAkB,CAACU,QAHvB;;AAKA,OAAM,MAAMC,GAAZ,IAAmBX,kBAAnB,EAAwC;AACvC;AACAJ,IAAAA,mBAAmB,CAAEe,GAAF,CAAnB,GAA6BX,kBAAkB,CAAEW,GAAF,CAA/C;AACA;;AAED,OAAM,MAAMA,GAAZ,IAAmBb,aAAnB,EAAmC;AAClC;AACAF,IAAAA,mBAAmB,CAAEe,GAAF,CAAnB,GAA6Bb,aAAa,CAAEa,GAAF,CAA1C;AACA,GA5CmD,CA8CpD;AACA;;;AACA,MAAKH,QAAQ,KAAKI,SAAlB,EAA8B;AAC7B;AACAhB,IAAAA,mBAAmB,CAACc,QAApB,GAA+BF,QAA/B;AACA;;AAEDZ,EAAAA,mBAAmB,CAACW,SAApB,GAAgCD,OAAhC;AAEA,SAAOV,mBAAP;AACA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport warn from '@wordpress/warning';\n\n/**\n * Internal dependencies\n */\nimport { useComponentsContext } from './context-system-provider';\nimport { getNamespace, getConnectedNamespace } from './utils';\nimport { getStyledClassNameFromKey } from './get-styled-class-name-from-key';\nimport { useCx } from '../../utils/hooks/use-cx';\n\n/**\n * @template TProps\n * @typedef {TProps & { className: string }} ConnectedProps\n */\n\n/**\n * Custom hook that derives registered props from the Context system.\n * These derived props are then consolidated with incoming component props.\n *\n * @template {{ className?: string }} P\n * @param {P} props Incoming props from the component.\n * @param {string} namespace The namespace to register and to derive context props from.\n * @return {ConnectedProps<P>} The connected props.\n */\nexport function useContextSystem( props, namespace ) {\n\tconst contextSystemProps = useComponentsContext();\n\tif ( typeof namespace === 'undefined' ) {\n\t\twarn( 'useContextSystem: Please provide a namespace' );\n\t}\n\n\tconst contextProps = contextSystemProps?.[ namespace ] || {};\n\n\t/* eslint-disable jsdoc/no-undefined-types */\n\t/** @type {ConnectedProps<P>} */\n\t// @ts-ignore We fill in the missing properties below\n\tconst finalComponentProps = {\n\t\t...getConnectedNamespace(),\n\t\t...getNamespace( namespace ),\n\t};\n\t/* eslint-enable jsdoc/no-undefined-types */\n\n\tconst { _overrides: overrideProps, ...otherContextProps } = contextProps;\n\n\tconst initialMergedProps = Object.entries( otherContextProps ).length\n\t\t? Object.assign( {}, otherContextProps, props )\n\t\t: props;\n\n\tconst cx = useCx();\n\n\tconst classes = cx(\n\t\tgetStyledClassNameFromKey( namespace ),\n\t\tprops.className\n\t);\n\n\t// Provides the ability to customize the render of the component.\n\tconst rendered =\n\t\ttypeof initialMergedProps.renderChildren === 'function'\n\t\t\t? initialMergedProps.renderChildren( initialMergedProps )\n\t\t\t: initialMergedProps.children;\n\n\tfor ( const key in initialMergedProps ) {\n\t\t// @ts-ignore filling in missing props\n\t\tfinalComponentProps[ key ] = initialMergedProps[ key ];\n\t}\n\n\tfor ( const key in overrideProps ) {\n\t\t// @ts-ignore filling in missing props\n\t\tfinalComponentProps[ key ] = overrideProps[ key ];\n\t}\n\n\t// Setting an `undefined` explicitly can cause unintended overwrites\n\t// when a `cloneElement()` is involved.\n\tif ( rendered !== undefined ) {\n\t\t// @ts-ignore\n\t\tfinalComponentProps.children = rendered;\n\t}\n\n\tfinalComponentProps.className = classes;\n\n\treturn finalComponentProps;\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/ui/context/use-context-system.js"],"names":["useContextSystem","props","namespace","contextSystemProps","contextProps","finalComponentProps","_overrides","overrideProps","otherContextProps","initialMergedProps","Object","entries","length","assign","cx","classes","className","rendered","renderChildren","children","key","undefined"],"mappings":";;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AACA;;AAXA;AACA;AACA;;AAGA;AACA;AACA;;AAMA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,gBAAT,CAA2BC,KAA3B,EAAkCC,SAAlC,EAA8C;AACpD,QAAMC,kBAAkB,GAAG,kDAA3B;;AACA,MAAK,OAAOD,SAAP,KAAqB,WAA1B,EAAwC;AACvC,mHAAM,8CAAN;AACA;;AAED,QAAME,YAAY,GAAGD,kBAAkB,GAAID,SAAJ,CAAlB,IAAqC,EAA1D;AAEA;;AACA;AACA;;AACA,QAAMG,mBAAmB,GAAG,EAC3B,GAAG,mCADwB;AAE3B,OAAG,yBAAcH,SAAd;AAFwB,GAA5B;AAIA;;AAEA,QAAM;AAAEI,IAAAA,UAAU,EAAEC,aAAd;AAA6B,OAAGC;AAAhC,MAAsDJ,YAA5D;AAEA,QAAMK,kBAAkB,GAAGC,MAAM,CAACC,OAAP,CAAgBH,iBAAhB,EAAoCI,MAApC,GACxBF,MAAM,CAACG,MAAP,CAAe,EAAf,EAAmBL,iBAAnB,EAAsCP,KAAtC,CADwB,GAExBA,KAFH;AAIA,QAAMa,EAAE,GAAG,mBAAX;AAEA,QAAMC,OAAO,GAAGD,EAAE,CACjB,0DAA2BZ,SAA3B,CADiB,EAEjBD,KAAK,CAACe,SAFW,CAAlB,CAzBoD,CA8BpD;;AACA,QAAMC,QAAQ,GACb,OAAOR,kBAAkB,CAACS,cAA1B,KAA6C,UAA7C,GACGT,kBAAkB,CAACS,cAAnB,CAAmCT,kBAAnC,CADH,GAEGA,kBAAkB,CAACU,QAHvB;;AAKA,OAAM,MAAMC,GAAZ,IAAmBX,kBAAnB,EAAwC;AACvC;AACAJ,IAAAA,mBAAmB,CAAEe,GAAF,CAAnB,GAA6BX,kBAAkB,CAAEW,GAAF,CAA/C;AACA;;AAED,OAAM,MAAMA,GAAZ,IAAmBb,aAAnB,EAAmC;AAClC;AACAF,IAAAA,mBAAmB,CAAEe,GAAF,CAAnB,GAA6Bb,aAAa,CAAEa,GAAF,CAA1C;AACA,GA5CmD,CA8CpD;AACA;;;AACA,MAAKH,QAAQ,KAAKI,SAAlB,EAA8B;AAC7B;AACAhB,IAAAA,mBAAmB,CAACc,QAApB,GAA+BF,QAA/B;AACA;;AAEDZ,EAAAA,mBAAmB,CAACW,SAApB,GAAgCD,OAAhC;AAEA,SAAOV,mBAAP;AACA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport warn from '@wordpress/warning';\n\n/**\n * Internal dependencies\n */\nimport { useComponentsContext } from './context-system-provider';\nimport { getNamespace, getConnectedNamespace } from './utils';\nimport { getStyledClassNameFromKey } from './get-styled-class-name-from-key';\nimport { useCx } from '../../utils/hooks/use-cx';\n\n/**\n * @template TProps\n * @typedef {TProps & { className: string }} ConnectedProps\n */\n\n/**\n * Custom hook that derives registered props from the Context system.\n * These derived props are then consolidated with incoming component props.\n *\n * @template {{ className?: string }} P\n * @param {P} props Incoming props from the component.\n * @param {string} namespace The namespace to register and to derive context props from.\n * @return {ConnectedProps<P>} The connected props.\n */\nexport function useContextSystem( props, namespace ) {\n\tconst contextSystemProps = useComponentsContext();\n\tif ( typeof namespace === 'undefined' ) {\n\t\twarn( 'useContextSystem: Please provide a namespace' );\n\t}\n\n\tconst contextProps = contextSystemProps?.[ namespace ] || {};\n\n\t/* eslint-disable jsdoc/no-undefined-types */\n\t/** @type {ConnectedProps<P>} */\n\t// @ts-ignore We fill in the missing properties below\n\tconst finalComponentProps = {\n\t\t...getConnectedNamespace(),\n\t\t...getNamespace( namespace ),\n\t};\n\t/* eslint-enable jsdoc/no-undefined-types */\n\n\tconst { _overrides: overrideProps, ...otherContextProps } = contextProps;\n\n\tconst initialMergedProps = Object.entries( otherContextProps ).length\n\t\t? Object.assign( {}, otherContextProps, props )\n\t\t: props;\n\n\tconst cx = useCx();\n\n\tconst classes = cx(\n\t\tgetStyledClassNameFromKey( namespace ),\n\t\tprops.className\n\t);\n\n\t// Provides the ability to customize the render of the component.\n\tconst rendered =\n\t\ttypeof initialMergedProps.renderChildren === 'function'\n\t\t\t? initialMergedProps.renderChildren( initialMergedProps )\n\t\t\t: initialMergedProps.children;\n\n\tfor ( const key in initialMergedProps ) {\n\t\t// @ts-ignore filling in missing props\n\t\tfinalComponentProps[ key ] = initialMergedProps[ key ];\n\t}\n\n\tfor ( const key in overrideProps ) {\n\t\t// @ts-ignore filling in missing props\n\t\tfinalComponentProps[ key ] = overrideProps[ key ];\n\t}\n\n\t// Setting an `undefined` explicitly can cause unintended overwrites\n\t// when a `cloneElement()` is involved.\n\tif ( rendered !== undefined ) {\n\t\t// @ts-ignore\n\t\tfinalComponentProps.children = rendered;\n\t}\n\n\tfinalComponentProps.className = classes;\n\n\treturn finalComponentProps;\n}\n"]}
@@ -47,7 +47,7 @@ function useControlGroup(props) {
47
47
  const isOnly = isFirst && isLast;
48
48
  const isMiddle = !isFirst && !isLast; // @ts-ignore
49
49
 
50
- const _key = (child === null || child === void 0 ? void 0 : child.key) || index;
50
+ const _key = child?.key || index;
51
51
  /** @type {import('@emotion/react').SerializedStyles | undefined} */
52
52
 
53
53
 
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/ui/control-group/hook.js"],"names":["useControlGroup","props","children","className","direction","templateColumns","otherProps","validChildren","isVertical","isGrid","cx","classes","styles","itemFocus","itemGrid","clonedChildren","map","child","index","isFirst","isLast","length","isOnly","isMiddle","_key","key","first","firstRow","last","lastRow","contextStyles","middle","contextProps"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;;;;;AAPA;AACA;AACA;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QAAAA,IAAI,GAAGhB,MAAM,CAACiB,OAAd;AACA,OAFD,MAEO;AACND,QAAAA,IAAI,GAAGhB,MAAM,CAACgB,IAAd;AACA;AACD;;AAED,UAAME,aAAa,GAAGpB,EAAE,CAAEgB,KAAF,EAASH,QAAQ,IAAIX,MAAM,CAACmB,MAA5B,EAAoCH,IAApC,CAAxB;AAEA,UAAMI,YAAY,GAAG;AACpBb,MAAAA,OADoB;AAEpBC,MAAAA,MAFoB;AAGpBG,MAAAA,QAHoB;AAIpBD,MAAAA,MAJoB;AAKpBd,MAAAA,UALoB;AAMpBI,MAAAA,MAAM,EAAEkB;AANY,KAArB;AASA,WACC,4BAAC,6BAAD,CAAqB,QAArB;AACC,MAAA,GAAG,EAAGN,IADP;AAEC,MAAA,KAAK,EAAGQ;AAFT,OAIGf,KAJH,CADD;AAQA,GAhDD,CAFD;AAoDA,SAAO,EACN,GAAGX,UADG;AAENJ,IAAAA,QAAQ,EAAEa,cAFJ;AAGNZ,IAAAA,SAAS,EAAEQ,OAHL;AAINP,IAAAA,SAJM;AAKNC,IAAAA;AALM,GAAP;AAOA","sourcesContent":["/**\n * Internal dependencies\n */\nimport { getValidChildren } from '../utils/get-valid-children';\nimport { useContextSystem } from '../context';\nimport { ControlGroupContext } from './context';\nimport * as styles from './styles';\nimport { useCx } from '../../utils/hooks/use-cx';\n\n/**\n * @param {import('../context').WordPressComponentProps<import('./types').Props, 'div'>} props\n */\nexport function useControlGroup( props ) {\n\tconst {\n\t\tchildren,\n\t\tclassName,\n\t\tdirection = 'row',\n\t\ttemplateColumns,\n\t\t...otherProps\n\t} = useContextSystem( props, 'ControlGroup' );\n\n\tconst validChildren = getValidChildren( children );\n\tconst isVertical = direction === 'column';\n\tconst isGrid = !! templateColumns;\n\n\tconst cx = useCx();\n\n\tconst classes = cx(\n\t\tstyles.itemFocus,\n\t\tisGrid && styles.itemGrid,\n\t\tclassName\n\t);\n\n\tconst clonedChildren =\n\t\tvalidChildren &&\n\t\tvalidChildren.map( ( child, index ) => {\n\t\t\tconst isFirst = index === 0;\n\t\t\tconst isLast = index + 1 === validChildren.length;\n\t\t\tconst isOnly = isFirst && isLast;\n\t\t\tconst isMiddle = ! isFirst && ! isLast;\n\n\t\t\t// @ts-ignore\n\t\t\tconst _key = child?.key || index;\n\n\t\t\t/** @type {import('@emotion/react').SerializedStyles | undefined} */\n\t\t\tlet first;\n\t\t\tif ( isFirst ) {\n\t\t\t\tif ( isVertical ) {\n\t\t\t\t\tfirst = styles.firstRow;\n\t\t\t\t} else {\n\t\t\t\t\tfirst = styles.first;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/** @type {import('@emotion/react').SerializedStyles | undefined} */\n\t\t\tlet last;\n\t\t\tif ( isLast ) {\n\t\t\t\tif ( isVertical ) {\n\t\t\t\t\tlast = styles.lastRow;\n\t\t\t\t} else {\n\t\t\t\t\tlast = styles.last;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst contextStyles = cx( first, isMiddle && styles.middle, last );\n\n\t\t\tconst contextProps = {\n\t\t\t\tisFirst,\n\t\t\t\tisLast,\n\t\t\t\tisMiddle,\n\t\t\t\tisOnly,\n\t\t\t\tisVertical,\n\t\t\t\tstyles: contextStyles,\n\t\t\t};\n\n\t\t\treturn (\n\t\t\t\t<ControlGroupContext.Provider\n\t\t\t\t\tkey={ _key }\n\t\t\t\t\tvalue={ contextProps }\n\t\t\t\t>\n\t\t\t\t\t{ child }\n\t\t\t\t</ControlGroupContext.Provider>\n\t\t\t);\n\t\t} );\n\n\treturn {\n\t\t...otherProps,\n\t\tchildren: clonedChildren,\n\t\tclassName: classes,\n\t\tdirection,\n\t\ttemplateColumns,\n\t};\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/ui/control-group/hook.js"],"names":["useControlGroup","props","children","className","direction","templateColumns","otherProps","validChildren","isVertical","isGrid","cx","classes","styles","itemFocus","itemGrid","clonedChildren","map","child","index","isFirst","isLast","length","isOnly","isMiddle","_key","key","first","firstRow","last","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,MAAL,EAAc;AACb,UAAKZ,UAAL,EAAkB;AACjBoB,QAAAA,IAAI,GAAGhB,MAAM,CAACiB,OAAd;AACA,OAFD,MAEO;AACND,QAAAA,IAAI,GAAGhB,MAAM,CAACgB,IAAd;AACA;AACD;;AAED,UAAME,aAAa,GAAGpB,EAAE,CAAEgB,KAAF,EAASH,QAAQ,IAAIX,MAAM,CAACmB,MAA5B,EAAoCH,IAApC,CAAxB;AAEA,UAAMI,YAAY,GAAG;AACpBb,MAAAA,OADoB;AAEpBC,MAAAA,MAFoB;AAGpBG,MAAAA,QAHoB;AAIpBD,MAAAA,MAJoB;AAKpBd,MAAAA,UALoB;AAMpBI,MAAAA,MAAM,EAAEkB;AANY,KAArB;AASA,WACC,4BAAC,6BAAD,CAAqB,QAArB;AACC,MAAA,GAAG,EAAGN,IADP;AAEC,MAAA,KAAK,EAAGQ;AAFT,OAIGf,KAJH,CADD;AAQA,GAhDD,CAFD;AAoDA,SAAO,EACN,GAAGX,UADG;AAENJ,IAAAA,QAAQ,EAAEa,cAFJ;AAGNZ,IAAAA,SAAS,EAAEQ,OAHL;AAINP,IAAAA,SAJM;AAKNC,IAAAA;AALM,GAAP;AAOA","sourcesContent":["/**\n * Internal dependencies\n */\nimport { getValidChildren } from '../utils/get-valid-children';\nimport { useContextSystem } from '../context';\nimport { ControlGroupContext } from './context';\nimport * as styles from './styles';\nimport { useCx } from '../../utils/hooks/use-cx';\n\n/**\n * @param {import('../context').WordPressComponentProps<import('./types').Props, 'div'>} props\n */\nexport function useControlGroup( props ) {\n\tconst {\n\t\tchildren,\n\t\tclassName,\n\t\tdirection = 'row',\n\t\ttemplateColumns,\n\t\t...otherProps\n\t} = useContextSystem( props, 'ControlGroup' );\n\n\tconst validChildren = getValidChildren( children );\n\tconst isVertical = direction === 'column';\n\tconst isGrid = !! templateColumns;\n\n\tconst cx = useCx();\n\n\tconst classes = cx(\n\t\tstyles.itemFocus,\n\t\tisGrid && styles.itemGrid,\n\t\tclassName\n\t);\n\n\tconst clonedChildren =\n\t\tvalidChildren &&\n\t\tvalidChildren.map( ( child, index ) => {\n\t\t\tconst isFirst = index === 0;\n\t\t\tconst isLast = index + 1 === validChildren.length;\n\t\t\tconst isOnly = isFirst && isLast;\n\t\t\tconst isMiddle = ! isFirst && ! isLast;\n\n\t\t\t// @ts-ignore\n\t\t\tconst _key = child?.key || index;\n\n\t\t\t/** @type {import('@emotion/react').SerializedStyles | undefined} */\n\t\t\tlet first;\n\t\t\tif ( isFirst ) {\n\t\t\t\tif ( isVertical ) {\n\t\t\t\t\tfirst = styles.firstRow;\n\t\t\t\t} else {\n\t\t\t\t\tfirst = styles.first;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/** @type {import('@emotion/react').SerializedStyles | undefined} */\n\t\t\tlet last;\n\t\t\tif ( isLast ) {\n\t\t\t\tif ( isVertical ) {\n\t\t\t\t\tlast = styles.lastRow;\n\t\t\t\t} else {\n\t\t\t\t\tlast = styles.last;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst contextStyles = cx( first, isMiddle && styles.middle, last );\n\n\t\t\tconst contextProps = {\n\t\t\t\tisFirst,\n\t\t\t\tisLast,\n\t\t\t\tisMiddle,\n\t\t\t\tisOnly,\n\t\t\t\tisVertical,\n\t\t\t\tstyles: contextStyles,\n\t\t\t};\n\n\t\t\treturn (\n\t\t\t\t<ControlGroupContext.Provider\n\t\t\t\t\tkey={ _key }\n\t\t\t\t\tvalue={ contextProps }\n\t\t\t\t>\n\t\t\t\t\t{ child }\n\t\t\t\t</ControlGroupContext.Provider>\n\t\t\t);\n\t\t} );\n\n\treturn {\n\t\t...otherProps,\n\t\tchildren: clonedChildren,\n\t\tclassName: classes,\n\t\tdirection,\n\t\ttemplateColumns,\n\t};\n}\n"]}
@@ -30,19 +30,18 @@ var _formGroupLabel = _interopRequireDefault(require("./form-group-label"));
30
30
  /**
31
31
  * @param {import('../context').WordPressComponentProps<import('./types').FormGroupContentProps, 'label', false>} props
32
32
  */
33
- function FormGroupContent(_ref) {
34
- let {
35
- alignLabel,
36
- children,
37
- help,
38
- horizontal = false,
39
- id,
40
- label,
41
- labelHidden,
42
- spacing = 2,
43
- truncate,
44
- ...props
45
- } = _ref;
33
+ function FormGroupContent({
34
+ alignLabel,
35
+ children,
36
+ help,
37
+ horizontal = false,
38
+ id,
39
+ label,
40
+ labelHidden,
41
+ spacing = 2,
42
+ truncate,
43
+ ...props
44
+ }) {
46
45
  const contextProps = (0, _element.useMemo)(() => ({
47
46
  id,
48
47
  horizontal