@wordpress/components 28.9.0 → 28.11.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 (1108) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/build/alignment-matrix-control/icon.js.map +1 -1
  3. package/build/alignment-matrix-control/types.js.map +1 -1
  4. package/build/alignment-matrix-control/utils.js.map +1 -1
  5. package/build/angle-picker-control/angle-circle.js.map +1 -1
  6. package/build/autocomplete/autocompleter-ui.js +5 -9
  7. package/build/autocomplete/autocompleter-ui.js.map +1 -1
  8. package/build/autocomplete/autocompleter-ui.native.js +2 -4
  9. package/build/autocomplete/autocompleter-ui.native.js.map +1 -1
  10. package/build/autocomplete/get-default-use-items.js.map +1 -1
  11. package/build/autocomplete/index.js +5 -5
  12. package/build/autocomplete/index.js.map +1 -1
  13. package/build/base-control/hooks.js.map +1 -1
  14. package/build/base-control/index.js.map +1 -1
  15. package/build/base-control/types.js.map +1 -1
  16. package/build/border-box-control/border-box-control/component.js +1 -0
  17. package/build/border-box-control/border-box-control/component.js.map +1 -1
  18. package/build/border-box-control/border-box-control/hook.js +6 -0
  19. package/build/border-box-control/border-box-control/hook.js.map +1 -1
  20. package/build/border-box-control/styles.js.map +1 -1
  21. package/build/border-box-control/utils.js.map +1 -1
  22. package/build/border-control/border-control/component.js +1 -0
  23. package/build/border-control/border-control/component.js.map +1 -1
  24. package/build/border-control/border-control/hook.js +6 -0
  25. package/build/border-control/border-control/hook.js.map +1 -1
  26. package/build/border-control/border-control-dropdown/component.js +12 -12
  27. package/build/border-control/border-control-dropdown/component.js.map +1 -1
  28. package/build/border-control/styles.js.map +1 -1
  29. package/build/box-control/axial-input-controls.js.map +1 -1
  30. package/build/box-control/icon.js.map +1 -1
  31. package/build/box-control/index.js.map +1 -1
  32. package/build/box-control/input-controls.js.map +1 -1
  33. package/build/button/index.native.js +1 -1
  34. package/build/button/index.native.js.map +1 -1
  35. package/build/card/card/component.js +1 -1
  36. package/build/card/card/component.js.map +1 -1
  37. package/build/card/styles.js.map +1 -1
  38. package/build/color-palette/index.js +1 -1
  39. package/build/color-palette/index.js.map +1 -1
  40. package/build/color-palette/index.native.js +3 -3
  41. package/build/color-palette/index.native.js.map +1 -1
  42. package/build/color-picker/index.native.js +0 -1
  43. package/build/color-picker/index.native.js.map +1 -1
  44. package/build/color-picker/styles.js.map +1 -1
  45. package/build/combobox-control/index.js +1 -1
  46. package/build/combobox-control/index.js.map +1 -1
  47. package/build/composite/legacy/index.js +5 -2
  48. package/build/composite/legacy/index.js.map +1 -1
  49. package/build/context/context-connect.js +1 -0
  50. package/build/context/context-connect.js.map +1 -1
  51. package/build/context/context-system-provider.js +1 -1
  52. package/build/context/context-system-provider.js.map +1 -1
  53. package/build/context/get-styled-class-name-from-key.js.map +1 -1
  54. package/build/custom-gradient-picker/gradient-bar/control-points.js +1 -1
  55. package/build/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
  56. package/build/custom-gradient-picker/index.js.map +1 -1
  57. package/build/custom-gradient-picker/serializer.js.map +1 -1
  58. package/build/custom-gradient-picker/utils.js.map +1 -1
  59. package/build/custom-select-control-v2/styles.js.map +1 -1
  60. package/build/dashicon/index.js.map +1 -1
  61. package/build/date-time/date/index.js +0 -1
  62. package/build/date-time/date/index.js.map +1 -1
  63. package/build/date-time/date/styles.js.map +1 -1
  64. package/build/date-time/time/timezone.js.map +1 -1
  65. package/build/draggable/index.js.map +1 -1
  66. package/build/drop-zone/index.js +1 -2
  67. package/build/drop-zone/index.js.map +1 -1
  68. package/build/duotone-picker/color-list-picker/index.js.map +1 -1
  69. package/build/duotone-picker/utils.js.map +1 -1
  70. package/build/elevation/hook.js.map +1 -1
  71. package/build/external-link/index.js +20 -23
  72. package/build/external-link/index.js.map +1 -1
  73. package/build/focal-point-picker/index.js.map +1 -1
  74. package/build/focal-point-picker/index.native.js.map +1 -1
  75. package/build/focal-point-picker/styles/focal-point-style.js.map +1 -1
  76. package/build/font-size-picker/index.js.map +1 -1
  77. package/build/font-size-picker/index.native.js +6 -6
  78. package/build/font-size-picker/index.native.js.map +1 -1
  79. package/build/form-token-field/index.js +2 -4
  80. package/build/form-token-field/index.js.map +1 -1
  81. package/build/form-token-field/suggestions-list.js +7 -3
  82. package/build/form-token-field/suggestions-list.js.map +1 -1
  83. package/build/form-token-field/token-input.js.map +1 -1
  84. package/build/form-token-field/token.js +1 -1
  85. package/build/form-token-field/token.js.map +1 -1
  86. package/build/gradient-picker/index.js.map +1 -1
  87. package/build/grid/hook.js.map +1 -1
  88. package/build/guide/page-control.js +1 -1
  89. package/build/guide/page-control.js.map +1 -1
  90. package/build/h-stack/hook.js.map +1 -1
  91. package/build/heading/hook.js.map +1 -1
  92. package/build/input-control/index.js.map +1 -1
  93. package/build/input-control/input-base.js.map +1 -1
  94. package/build/input-control/styles/input-control-styles.js.map +1 -1
  95. package/build/item-group/styles.js.map +1 -1
  96. package/build/{dropdown-menu-v2 → menu}/checkbox-item.js +8 -8
  97. package/build/menu/checkbox-item.js.map +1 -0
  98. package/build/{dropdown-menu-v2 → menu}/context.js +2 -2
  99. package/build/menu/context.js.map +1 -0
  100. package/build/{dropdown-menu-v2 → menu}/group-label.js +5 -5
  101. package/build/menu/group-label.js.map +1 -0
  102. package/build/{dropdown-menu-v2 → menu}/group.js +5 -5
  103. package/build/menu/group.js.map +1 -0
  104. package/build/{dropdown-menu-v2 → menu}/index.js +38 -38
  105. package/build/menu/index.js.map +1 -0
  106. package/build/{dropdown-menu-v2 → menu}/item-help-text.js +3 -3
  107. package/build/menu/item-help-text.js.map +1 -0
  108. package/build/{dropdown-menu-v2 → menu}/item-label.js +3 -3
  109. package/build/menu/item-label.js.map +1 -0
  110. package/build/{dropdown-menu-v2 → menu}/item.js +7 -7
  111. package/build/menu/item.js.map +1 -0
  112. package/build/{dropdown-menu-v2 → menu}/radio-item.js +8 -8
  113. package/build/menu/radio-item.js.map +1 -0
  114. package/build/{dropdown-menu-v2 → menu}/separator.js +6 -6
  115. package/build/menu/separator.js.map +1 -0
  116. package/build/menu/styles.js +150 -0
  117. package/build/menu/styles.js.map +1 -0
  118. package/build/menu/types.js.map +1 -0
  119. package/build/menu/use-temporary-focus-visible-fix.js.map +1 -0
  120. package/build/menu-group/index.js.map +1 -1
  121. package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js +3 -5
  122. package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js.map +1 -1
  123. package/build/mobile/bottom-sheet/cell.native.js +4 -4
  124. package/build/mobile/bottom-sheet/cell.native.js.map +1 -1
  125. package/build/mobile/bottom-sheet/index.native.js.map +1 -1
  126. package/build/mobile/bottom-sheet/range-cell.native.js +1 -1
  127. package/build/mobile/bottom-sheet/range-cell.native.js.map +1 -1
  128. package/build/mobile/bottom-sheet/range-text-input.native.js.map +1 -1
  129. package/build/mobile/bottom-sheet/stepper-cell/index.native.js +1 -1
  130. package/build/mobile/bottom-sheet/stepper-cell/index.native.js.map +1 -1
  131. package/build/mobile/bottom-sheet/sub-sheet/index.native.js +1 -3
  132. package/build/mobile/bottom-sheet/sub-sheet/index.native.js.map +1 -1
  133. package/build/mobile/bottom-sheet/switch-cell.native.js +4 -4
  134. package/build/mobile/bottom-sheet/switch-cell.native.js.map +1 -1
  135. package/build/mobile/bottom-sheet-select-control/index.native.js +2 -2
  136. package/build/mobile/bottom-sheet-select-control/index.native.js.map +1 -1
  137. package/build/mobile/color-settings/index.native.js +1 -3
  138. package/build/mobile/color-settings/index.native.js.map +1 -1
  139. package/build/mobile/color-settings/picker-screen.native.js +1 -3
  140. package/build/mobile/color-settings/picker-screen.native.js.map +1 -1
  141. package/build/mobile/cycle-select-control/index.native.js.map +1 -1
  142. package/build/mobile/gradient/index.native.js.map +1 -1
  143. package/build/mobile/image/index.native.js +1 -3
  144. package/build/mobile/image/index.native.js.map +1 -1
  145. package/build/mobile/keyboard-avoiding-view/index.ios.js +1 -3
  146. package/build/mobile/keyboard-avoiding-view/index.ios.js.map +1 -1
  147. package/build/mobile/link-picker/index.native.js +1 -1
  148. package/build/mobile/link-picker/index.native.js.map +1 -1
  149. package/build/mobile/link-picker/link-picker-results.native.js +2 -5
  150. package/build/mobile/link-picker/link-picker-results.native.js.map +1 -1
  151. package/build/mobile/link-picker/link-picker-screen.native.js +1 -3
  152. package/build/mobile/link-picker/link-picker-screen.native.js.map +1 -1
  153. package/build/mobile/link-settings/index.native.js +6 -18
  154. package/build/mobile/link-settings/index.native.js.map +1 -1
  155. package/build/mobile/link-settings/link-settings-screen.native.js +1 -3
  156. package/build/mobile/link-settings/link-settings-screen.native.js.map +1 -1
  157. package/build/mobile/picker/index.android.js.map +1 -1
  158. package/build/mobile/segmented-control/index.native.js +2 -6
  159. package/build/mobile/segmented-control/index.native.js.map +1 -1
  160. package/build/mobile/utils/get-px-from-css-unit.native.js.map +1 -1
  161. package/build/mobile/utils/use-unit-converter-to-mobile.native.js +2 -6
  162. package/build/mobile/utils/use-unit-converter-to-mobile.native.js.map +1 -1
  163. package/build/modal/aria-helper.js +2 -1
  164. package/build/modal/aria-helper.js.map +1 -1
  165. package/build/modal/index.js +2 -1
  166. package/build/modal/index.js.map +1 -1
  167. package/build/modal/use-modal-exit-animation.js.map +1 -1
  168. package/build/navigation/group/index.js.map +1 -1
  169. package/build/navigation/index.js +1 -2
  170. package/build/navigation/index.js.map +1 -1
  171. package/build/navigation/item/base.js.map +1 -1
  172. package/build/navigation/item/use-navigation-tree-item.js +2 -2
  173. package/build/navigation/item/use-navigation-tree-item.js.map +1 -1
  174. package/build/navigation/menu/index.js.map +1 -1
  175. package/build/navigation/menu/menu-title-search.js +4 -4
  176. package/build/navigation/menu/menu-title-search.js.map +1 -1
  177. package/build/navigation/menu/menu-title.js.map +1 -1
  178. package/build/navigation/menu/use-navigation-tree-menu.js +2 -2
  179. package/build/navigation/menu/use-navigation-tree-menu.js.map +1 -1
  180. package/build/navigation/styles/navigation-styles.js.map +1 -1
  181. package/build/navigator/navigator/component.js.map +1 -1
  182. package/build/navigator/navigator-button/hook.js.map +1 -1
  183. package/build/number-control/styles/number-control-styles.js.map +1 -1
  184. package/build/palette-edit/index.js +29 -4
  185. package/build/palette-edit/index.js.map +1 -1
  186. package/build/palette-edit/styles.js +13 -28
  187. package/build/palette-edit/styles.js.map +1 -1
  188. package/build/popover/index.js +1 -1
  189. package/build/popover/index.js.map +1 -1
  190. package/build/popover/overlay-middlewares.js.map +1 -1
  191. package/build/popover/utils.js.map +1 -1
  192. package/build/private-apis.js +4 -4
  193. package/build/private-apis.js.map +1 -1
  194. package/build/progress-bar/index.js.map +1 -1
  195. package/build/progress-bar/styles.js.map +1 -1
  196. package/build/query-controls/index.js.map +1 -1
  197. package/build/query-controls/index.native.js.map +1 -1
  198. package/build/radio-control/index.js.map +1 -1
  199. package/build/radio-control/index.native.js.map +1 -1
  200. package/build/radio-group/index.js +3 -1
  201. package/build/radio-group/index.js.map +1 -1
  202. package/build/range-control/index.js.map +1 -1
  203. package/build/range-control/index.native.js.map +1 -1
  204. package/build/range-control/rail.js.map +1 -1
  205. package/build/range-control/styles/range-control-styles.js +32 -32
  206. package/build/range-control/styles/range-control-styles.js.map +1 -1
  207. package/build/range-control/tooltip.js +1 -1
  208. package/build/range-control/tooltip.js.map +1 -1
  209. package/build/range-control/utils.js.map +1 -1
  210. package/build/resizable-box/resize-tooltip/label.js.map +1 -1
  211. package/build/resizable-box/resize-tooltip/utils.js.map +1 -1
  212. package/build/responsive-wrapper/index.js.map +1 -1
  213. package/build/sandbox/index.js +3 -6
  214. package/build/sandbox/index.js.map +1 -1
  215. package/build/sandbox/index.native.js +1 -3
  216. package/build/sandbox/index.native.js.map +1 -1
  217. package/build/search-control/index.js +6 -0
  218. package/build/search-control/index.js.map +1 -1
  219. package/build/search-control/index.native.js +1 -3
  220. package/build/search-control/index.native.js.map +1 -1
  221. package/build/search-control/types.js.map +1 -1
  222. package/build/select-control/index.js.map +1 -1
  223. package/build/select-control/index.native.js.map +1 -1
  224. package/build/slot-fill/bubbles-virtually/slot.js +1 -2
  225. package/build/slot-fill/bubbles-virtually/slot.js.map +1 -1
  226. package/build/slot-fill/fill.js +3 -6
  227. package/build/slot-fill/fill.js.map +1 -1
  228. package/build/slot-fill/index.js.map +1 -1
  229. package/build/spacer/hook.js +5 -3
  230. package/build/spacer/hook.js.map +1 -1
  231. package/build/spinner/styles.js.map +1 -1
  232. package/build/style-provider/index.js +1 -0
  233. package/build/style-provider/index.js.map +1 -1
  234. package/build/surface/hook.js.map +1 -1
  235. package/build/surface/styles.js.map +1 -1
  236. package/build/tab-panel/index.js +4 -1
  237. package/build/tab-panel/index.js.map +1 -1
  238. package/build/tabs/index.js +48 -113
  239. package/build/tabs/index.js.map +1 -1
  240. package/build/tabs/styles.js +31 -13
  241. package/build/tabs/styles.js.map +1 -1
  242. package/build/tabs/tab.js +30 -8
  243. package/build/tabs/tab.js.map +1 -1
  244. package/build/tabs/tablist.js +67 -56
  245. package/build/tabs/tablist.js.map +1 -1
  246. package/build/tabs/tabpanel.js.map +1 -1
  247. package/build/tabs/types.js.map +1 -1
  248. package/build/text/get-line-height.js.map +1 -1
  249. package/build/text/styles/text-mixins.native.js.map +1 -1
  250. package/build/text/utils.js.map +1 -1
  251. package/build/text-control/index.native.js.map +1 -1
  252. package/build/text-highlight/index.js.map +1 -1
  253. package/build/textarea-control/index.js.map +1 -1
  254. package/build/theme/color-algorithms.js.map +1 -1
  255. package/build/theme/styles.js.map +1 -1
  256. package/build/toggle-control/index.js.map +1 -1
  257. package/build/toggle-control/index.native.js.map +1 -1
  258. package/build/toggle-group-control/toggle-group-control/as-radio-group.js +9 -1
  259. package/build/toggle-group-control/toggle-group-control/as-radio-group.js.map +1 -1
  260. package/build/toggle-group-control/toggle-group-control/component.js +4 -61
  261. package/build/toggle-group-control/toggle-group-control/component.js.map +1 -1
  262. package/build/toggle-group-control/toggle-group-control-option-base/component.js +10 -10
  263. package/build/toggle-group-control/toggle-group-control-option-base/component.js.map +1 -1
  264. package/build/toggle-group-control/types.js.map +1 -1
  265. package/build/toolbar/toolbar/index.js +3 -0
  266. package/build/toolbar/toolbar/index.js.map +1 -1
  267. package/build/tools-panel/styles.js.map +1 -1
  268. package/build/tools-panel/tools-panel-header/component.js +1 -1
  269. package/build/tools-panel/tools-panel-header/component.js.map +1 -1
  270. package/build/tools-panel/tools-panel-item/hook.js +0 -2
  271. package/build/tools-panel/tools-panel-item/hook.js.map +1 -1
  272. package/build/tooltip/index.js +5 -1
  273. package/build/tooltip/index.js.map +1 -1
  274. package/build/tooltip/index.native.js +5 -15
  275. package/build/tooltip/index.native.js.map +1 -1
  276. package/build/unit-control/index.js.map +1 -1
  277. package/build/unit-control/index.native.js +2 -6
  278. package/build/unit-control/index.native.js.map +1 -1
  279. package/build/unit-control/utils.js.map +1 -1
  280. package/build/utils/breakpoint.js.map +1 -1
  281. package/build/utils/colors-values.js.map +1 -1
  282. package/build/utils/config-values.js.map +1 -1
  283. package/build/utils/deprecated-36px-size.js +27 -0
  284. package/build/utils/deprecated-36px-size.js.map +1 -0
  285. package/build/utils/element-rect.js +13 -2
  286. package/build/utils/element-rect.js.map +1 -1
  287. package/build/utils/font-size.js.map +1 -1
  288. package/build/utils/hooks/use-animated-offset-rect.js +81 -0
  289. package/build/utils/hooks/use-animated-offset-rect.js.map +1 -0
  290. package/build/utils/hooks/use-cx.js.map +1 -1
  291. package/build/utils/hooks/use-update-effect.js +0 -2
  292. package/build/utils/hooks/use-update-effect.js.map +1 -1
  293. package/build/utils/math.js +2 -2
  294. package/build/utils/math.js.map +1 -1
  295. package/build/utils/space.js.map +1 -1
  296. package/build/utils/unit-values.js.map +1 -1
  297. package/build/utils/use-responsive-value.js.map +1 -1
  298. package/build-module/alignment-matrix-control/cell.js +1 -2
  299. package/build-module/alignment-matrix-control/cell.js.map +1 -1
  300. package/build-module/alignment-matrix-control/icon.js.map +1 -1
  301. package/build-module/alignment-matrix-control/types.js.map +1 -1
  302. package/build-module/alignment-matrix-control/utils.js.map +1 -1
  303. package/build-module/angle-picker-control/angle-circle.js.map +1 -1
  304. package/build-module/angle-picker-control/index.js +1 -2
  305. package/build-module/angle-picker-control/index.js.map +1 -1
  306. package/build-module/autocomplete/autocompleter-ui.js +6 -12
  307. package/build-module/autocomplete/autocompleter-ui.js.map +1 -1
  308. package/build-module/autocomplete/autocompleter-ui.native.js +3 -6
  309. package/build-module/autocomplete/autocompleter-ui.native.js.map +1 -1
  310. package/build-module/autocomplete/get-default-use-items.js.map +1 -1
  311. package/build-module/autocomplete/index.js +6 -8
  312. package/build-module/autocomplete/index.js.map +1 -1
  313. package/build-module/base-control/hooks.js.map +1 -1
  314. package/build-module/base-control/index.js +1 -2
  315. package/build-module/base-control/index.js.map +1 -1
  316. package/build-module/base-control/index.native.js +1 -2
  317. package/build-module/base-control/index.native.js.map +1 -1
  318. package/build-module/base-control/types.js.map +1 -1
  319. package/build-module/border-box-control/border-box-control/component.js +2 -2
  320. package/build-module/border-box-control/border-box-control/component.js.map +1 -1
  321. package/build-module/border-box-control/border-box-control/hook.js +6 -0
  322. package/build-module/border-box-control/border-box-control/hook.js.map +1 -1
  323. package/build-module/border-box-control/border-box-control-split-controls/component.js +1 -2
  324. package/build-module/border-box-control/border-box-control-split-controls/component.js.map +1 -1
  325. package/build-module/border-box-control/styles.js.map +1 -1
  326. package/build-module/border-box-control/utils.js.map +1 -1
  327. package/build-module/border-control/border-control/component.js +2 -2
  328. package/build-module/border-control/border-control/component.js.map +1 -1
  329. package/build-module/border-control/border-control/hook.js +7 -0
  330. package/build-module/border-control/border-control/hook.js.map +1 -1
  331. package/build-module/border-control/border-control-dropdown/component.js +13 -15
  332. package/build-module/border-control/border-control-dropdown/component.js.map +1 -1
  333. package/build-module/border-control/styles.js.map +1 -1
  334. package/build-module/box-control/all-input-control.js +1 -3
  335. package/build-module/box-control/all-input-control.js.map +1 -1
  336. package/build-module/box-control/axial-input-controls.js +1 -3
  337. package/build-module/box-control/axial-input-controls.js.map +1 -1
  338. package/build-module/box-control/icon.js +1 -2
  339. package/build-module/box-control/icon.js.map +1 -1
  340. package/build-module/box-control/index.js +1 -2
  341. package/build-module/box-control/index.js.map +1 -1
  342. package/build-module/box-control/input-controls.js +1 -3
  343. package/build-module/box-control/input-controls.js.map +1 -1
  344. package/build-module/button/index.js +1 -3
  345. package/build-module/button/index.js.map +1 -1
  346. package/build-module/button/index.native.js +2 -3
  347. package/build-module/button/index.native.js.map +1 -1
  348. package/build-module/card/card/component.js +2 -3
  349. package/build-module/card/card/component.js.map +1 -1
  350. package/build-module/card/styles.js.map +1 -1
  351. package/build-module/checkbox-control/index.js +1 -2
  352. package/build-module/checkbox-control/index.js.map +1 -1
  353. package/build-module/circular-option-picker/circular-option-picker-option.js +1 -2
  354. package/build-module/circular-option-picker/circular-option-picker-option.js.map +1 -1
  355. package/build-module/circular-option-picker/circular-option-picker.js +1 -2
  356. package/build-module/circular-option-picker/circular-option-picker.js.map +1 -1
  357. package/build-module/color-indicator/index.native.js +1 -2
  358. package/build-module/color-indicator/index.native.js.map +1 -1
  359. package/build-module/color-palette/index.js +2 -3
  360. package/build-module/color-palette/index.js.map +1 -1
  361. package/build-module/color-palette/index.native.js +4 -6
  362. package/build-module/color-palette/index.native.js.map +1 -1
  363. package/build-module/color-picker/component.js +1 -2
  364. package/build-module/color-picker/component.js.map +1 -1
  365. package/build-module/color-picker/hsl-input.js +1 -3
  366. package/build-module/color-picker/hsl-input.js.map +1 -1
  367. package/build-module/color-picker/hsv-color-picker.native.js +1 -2
  368. package/build-module/color-picker/hsv-color-picker.native.js.map +1 -1
  369. package/build-module/color-picker/hue-picker.native.js +1 -2
  370. package/build-module/color-picker/hue-picker.native.js.map +1 -1
  371. package/build-module/color-picker/index.native.js +1 -4
  372. package/build-module/color-picker/index.native.js.map +1 -1
  373. package/build-module/color-picker/input-with-slider.js +1 -2
  374. package/build-module/color-picker/input-with-slider.js.map +1 -1
  375. package/build-module/color-picker/rgb-input.js +1 -3
  376. package/build-module/color-picker/rgb-input.js.map +1 -1
  377. package/build-module/color-picker/saturation-picker.native.js +1 -2
  378. package/build-module/color-picker/saturation-picker.native.js.map +1 -1
  379. package/build-module/color-picker/styles.js.map +1 -1
  380. package/build-module/combobox-control/index.js +2 -3
  381. package/build-module/combobox-control/index.js.map +1 -1
  382. package/build-module/composite/legacy/index.js +5 -2
  383. package/build-module/composite/legacy/index.js.map +1 -1
  384. package/build-module/confirm-dialog/component.js +1 -3
  385. package/build-module/confirm-dialog/component.js.map +1 -1
  386. package/build-module/context/context-connect.js +1 -0
  387. package/build-module/context/context-connect.js.map +1 -1
  388. package/build-module/context/context-system-provider.js +1 -1
  389. package/build-module/context/context-system-provider.js.map +1 -1
  390. package/build-module/context/get-styled-class-name-from-key.js.map +1 -1
  391. package/build-module/custom-gradient-picker/gradient-bar/control-points.js +2 -4
  392. package/build-module/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
  393. package/build-module/custom-gradient-picker/gradient-bar/index.js +1 -2
  394. package/build-module/custom-gradient-picker/gradient-bar/index.js.map +1 -1
  395. package/build-module/custom-gradient-picker/index.js +1 -2
  396. package/build-module/custom-gradient-picker/index.js.map +1 -1
  397. package/build-module/custom-gradient-picker/index.native.js +1 -3
  398. package/build-module/custom-gradient-picker/index.native.js.map +1 -1
  399. package/build-module/custom-gradient-picker/serializer.js.map +1 -1
  400. package/build-module/custom-gradient-picker/utils.js.map +1 -1
  401. package/build-module/custom-select-control/index.js +1 -3
  402. package/build-module/custom-select-control/index.js.map +1 -1
  403. package/build-module/custom-select-control-v2/custom-select.js +1 -2
  404. package/build-module/custom-select-control-v2/custom-select.js.map +1 -1
  405. package/build-module/custom-select-control-v2/item.js +1 -2
  406. package/build-module/custom-select-control-v2/item.js.map +1 -1
  407. package/build-module/custom-select-control-v2/styles.js.map +1 -1
  408. package/build-module/dashicon/index.js.map +1 -1
  409. package/build-module/date-time/date/index.js +1 -3
  410. package/build-module/date-time/date/index.js.map +1 -1
  411. package/build-module/date-time/date/styles.js.map +1 -1
  412. package/build-module/date-time/date-time/index.js +1 -3
  413. package/build-module/date-time/date-time/index.js.map +1 -1
  414. package/build-module/date-time/time/index.js +1 -2
  415. package/build-module/date-time/time/index.js.map +1 -1
  416. package/build-module/date-time/time/time-input/index.js +1 -2
  417. package/build-module/date-time/time/time-input/index.js.map +1 -1
  418. package/build-module/date-time/time/timezone.js.map +1 -1
  419. package/build-module/dimension-control/index.js +1 -3
  420. package/build-module/dimension-control/index.js.map +1 -1
  421. package/build-module/draggable/index.js +1 -3
  422. package/build-module/draggable/index.js.map +1 -1
  423. package/build-module/drop-zone/index.js +2 -4
  424. package/build-module/drop-zone/index.js.map +1 -1
  425. package/build-module/dropdown/index.js +1 -2
  426. package/build-module/dropdown/index.js.map +1 -1
  427. package/build-module/dropdown/index.native.js +1 -2
  428. package/build-module/dropdown/index.native.js.map +1 -1
  429. package/build-module/dropdown-menu/index.js +1 -2
  430. package/build-module/dropdown-menu/index.js.map +1 -1
  431. package/build-module/dropdown-menu/index.native.js +1 -2
  432. package/build-module/dropdown-menu/index.native.js.map +1 -1
  433. package/build-module/duotone-picker/color-list-picker/index.js +1 -3
  434. package/build-module/duotone-picker/color-list-picker/index.js.map +1 -1
  435. package/build-module/duotone-picker/duotone-picker.js +1 -2
  436. package/build-module/duotone-picker/duotone-picker.js.map +1 -1
  437. package/build-module/duotone-picker/utils.js.map +1 -1
  438. package/build-module/elevation/hook.js.map +1 -1
  439. package/build-module/external-link/index.js +21 -25
  440. package/build-module/external-link/index.js.map +1 -1
  441. package/build-module/external-link/index.native.js +1 -2
  442. package/build-module/external-link/index.native.js.map +1 -1
  443. package/build-module/focal-point-picker/controls.js +1 -2
  444. package/build-module/focal-point-picker/controls.js.map +1 -1
  445. package/build-module/focal-point-picker/focal-point.native.js +1 -2
  446. package/build-module/focal-point-picker/focal-point.native.js.map +1 -1
  447. package/build-module/focal-point-picker/grid.js +1 -2
  448. package/build-module/focal-point-picker/grid.js.map +1 -1
  449. package/build-module/focal-point-picker/index.js +1 -2
  450. package/build-module/focal-point-picker/index.js.map +1 -1
  451. package/build-module/focal-point-picker/index.native.js +1 -2
  452. package/build-module/focal-point-picker/index.native.js.map +1 -1
  453. package/build-module/focal-point-picker/styles/focal-point-style.js.map +1 -1
  454. package/build-module/focal-point-picker/tooltip/index.native.js +1 -2
  455. package/build-module/focal-point-picker/tooltip/index.native.js.map +1 -1
  456. package/build-module/font-size-picker/index.js +1 -2
  457. package/build-module/font-size-picker/index.js.map +1 -1
  458. package/build-module/font-size-picker/index.native.js +8 -10
  459. package/build-module/font-size-picker/index.native.js.map +1 -1
  460. package/build-module/form-file-upload/index.js +1 -2
  461. package/build-module/form-file-upload/index.js.map +1 -1
  462. package/build-module/form-toggle/index.js +1 -2
  463. package/build-module/form-toggle/index.js.map +1 -1
  464. package/build-module/form-token-field/index.js +3 -6
  465. package/build-module/form-token-field/index.js.map +1 -1
  466. package/build-module/form-token-field/suggestions-list.js +8 -5
  467. package/build-module/form-token-field/suggestions-list.js.map +1 -1
  468. package/build-module/form-token-field/token-input.js.map +1 -1
  469. package/build-module/form-token-field/token.js +2 -3
  470. package/build-module/form-token-field/token.js.map +1 -1
  471. package/build-module/gradient-picker/index.js +1 -2
  472. package/build-module/gradient-picker/index.js.map +1 -1
  473. package/build-module/grid/hook.js.map +1 -1
  474. package/build-module/guide/index.js +1 -2
  475. package/build-module/guide/index.js.map +1 -1
  476. package/build-module/guide/page-control.js +1 -1
  477. package/build-module/guide/page-control.js.map +1 -1
  478. package/build-module/h-stack/hook.js.map +1 -1
  479. package/build-module/heading/hook.js.map +1 -1
  480. package/build-module/higher-order/with-fallback-styles/index.js +3 -4
  481. package/build-module/higher-order/with-fallback-styles/index.js.map +1 -1
  482. package/build-module/input-control/index.js.map +1 -1
  483. package/build-module/input-control/input-base.js +1 -2
  484. package/build-module/input-control/input-base.js.map +1 -1
  485. package/build-module/input-control/styles/input-control-styles.js.map +1 -1
  486. package/build-module/item-group/styles.js.map +1 -1
  487. package/build-module/keyboard-shortcuts/index.js +1 -3
  488. package/build-module/keyboard-shortcuts/index.js.map +1 -1
  489. package/build-module/{dropdown-menu-v2 → menu}/checkbox-item.js +9 -10
  490. package/build-module/menu/checkbox-item.js.map +1 -0
  491. package/build-module/{dropdown-menu-v2 → menu}/context.js +1 -1
  492. package/build-module/menu/context.js.map +1 -0
  493. package/build-module/{dropdown-menu-v2 → menu}/group-label.js +5 -5
  494. package/build-module/menu/group-label.js.map +1 -0
  495. package/build-module/menu/group.js +21 -0
  496. package/build-module/menu/group.js.map +1 -0
  497. package/build-module/{dropdown-menu-v2 → menu}/index.js +47 -49
  498. package/build-module/menu/index.js.map +1 -0
  499. package/build-module/{dropdown-menu-v2 → menu}/item-help-text.js +2 -2
  500. package/build-module/menu/item-help-text.js.map +1 -0
  501. package/build-module/{dropdown-menu-v2 → menu}/item-label.js +2 -2
  502. package/build-module/menu/item-label.js.map +1 -0
  503. package/build-module/{dropdown-menu-v2 → menu}/item.js +8 -9
  504. package/build-module/menu/item.js.map +1 -0
  505. package/build-module/{dropdown-menu-v2 → menu}/radio-item.js +9 -10
  506. package/build-module/menu/radio-item.js.map +1 -0
  507. package/build-module/menu/separator.js +22 -0
  508. package/build-module/menu/separator.js.map +1 -0
  509. package/build-module/menu/styles.js +143 -0
  510. package/build-module/menu/styles.js.map +1 -0
  511. package/build-module/menu/types.js.map +1 -0
  512. package/build-module/menu/use-temporary-focus-visible-fix.js.map +1 -0
  513. package/build-module/menu-group/index.js +1 -2
  514. package/build-module/menu-group/index.js.map +1 -1
  515. package/build-module/menu-item/index.js +1 -2
  516. package/build-module/menu-item/index.js.map +1 -1
  517. package/build-module/menu-items-choice/index.js +1 -2
  518. package/build-module/menu-items-choice/index.js.map +1 -1
  519. package/build-module/mobile/badge/index.native.js +1 -3
  520. package/build-module/mobile/badge/index.native.js.map +1 -1
  521. package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js +4 -7
  522. package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js.map +1 -1
  523. package/build-module/mobile/bottom-sheet/cell.native.js +5 -6
  524. package/build-module/mobile/bottom-sheet/cell.native.js.map +1 -1
  525. package/build-module/mobile/bottom-sheet/color-cell.native.js +1 -2
  526. package/build-module/mobile/bottom-sheet/color-cell.native.js.map +1 -1
  527. package/build-module/mobile/bottom-sheet/index.native.js +1 -3
  528. package/build-module/mobile/bottom-sheet/index.native.js.map +1 -1
  529. package/build-module/mobile/bottom-sheet/link-suggestion-item-cell.native.js +1 -2
  530. package/build-module/mobile/bottom-sheet/link-suggestion-item-cell.native.js.map +1 -1
  531. package/build-module/mobile/bottom-sheet/nav-bar/back-button.native.js +1 -2
  532. package/build-module/mobile/bottom-sheet/nav-bar/back-button.native.js.map +1 -1
  533. package/build-module/mobile/bottom-sheet/range-cell.native.js +2 -3
  534. package/build-module/mobile/bottom-sheet/range-cell.native.js.map +1 -1
  535. package/build-module/mobile/bottom-sheet/range-text-input.native.js +1 -2
  536. package/build-module/mobile/bottom-sheet/range-text-input.native.js.map +1 -1
  537. package/build-module/mobile/bottom-sheet/stepper-cell/index.native.js +2 -3
  538. package/build-module/mobile/bottom-sheet/stepper-cell/index.native.js.map +1 -1
  539. package/build-module/mobile/bottom-sheet/stepper-cell/stepper.android.js +1 -2
  540. package/build-module/mobile/bottom-sheet/stepper-cell/stepper.android.js.map +1 -1
  541. package/build-module/mobile/bottom-sheet/stepper-cell/stepper.ios.js +1 -2
  542. package/build-module/mobile/bottom-sheet/stepper-cell/stepper.ios.js.map +1 -1
  543. package/build-module/mobile/bottom-sheet/sub-sheet/index.native.js +2 -6
  544. package/build-module/mobile/bottom-sheet/sub-sheet/index.native.js.map +1 -1
  545. package/build-module/mobile/bottom-sheet/switch-cell.native.js +4 -4
  546. package/build-module/mobile/bottom-sheet/switch-cell.native.js.map +1 -1
  547. package/build-module/mobile/bottom-sheet-select-control/index.native.js +3 -5
  548. package/build-module/mobile/bottom-sheet-select-control/index.native.js.map +1 -1
  549. package/build-module/mobile/bottom-sheet-text-control/index.native.js +1 -3
  550. package/build-module/mobile/bottom-sheet-text-control/index.native.js.map +1 -1
  551. package/build-module/mobile/color-settings/gradient-picker-screen.native.js +1 -2
  552. package/build-module/mobile/color-settings/gradient-picker-screen.native.js.map +1 -1
  553. package/build-module/mobile/color-settings/index.native.js +2 -5
  554. package/build-module/mobile/color-settings/index.native.js.map +1 -1
  555. package/build-module/mobile/color-settings/palette.screen.native.js +1 -3
  556. package/build-module/mobile/color-settings/palette.screen.native.js.map +1 -1
  557. package/build-module/mobile/color-settings/picker-screen.native.js +1 -3
  558. package/build-module/mobile/color-settings/picker-screen.native.js.map +1 -1
  559. package/build-module/mobile/cycle-select-control/index.native.js.map +1 -1
  560. package/build-module/mobile/focal-point-settings-panel/index.native.js +1 -2
  561. package/build-module/mobile/focal-point-settings-panel/index.native.js.map +1 -1
  562. package/build-module/mobile/gradient/index.native.js +1 -2
  563. package/build-module/mobile/gradient/index.native.js.map +1 -1
  564. package/build-module/mobile/html-text-input/index.native.js +1 -2
  565. package/build-module/mobile/html-text-input/index.native.js.map +1 -1
  566. package/build-module/mobile/image/icon-retry.native.js +1 -2
  567. package/build-module/mobile/image/icon-retry.native.js.map +1 -1
  568. package/build-module/mobile/image/image-editing-button.native.js +1 -2
  569. package/build-module/mobile/image/image-editing-button.native.js.map +1 -1
  570. package/build-module/mobile/image/index.native.js +2 -6
  571. package/build-module/mobile/image/index.native.js.map +1 -1
  572. package/build-module/mobile/keyboard-avoiding-view/index.ios.js +2 -5
  573. package/build-module/mobile/keyboard-avoiding-view/index.ios.js.map +1 -1
  574. package/build-module/mobile/link-picker/index.native.js +2 -3
  575. package/build-module/mobile/link-picker/index.native.js.map +1 -1
  576. package/build-module/mobile/link-picker/link-picker-results.native.js +2 -5
  577. package/build-module/mobile/link-picker/link-picker-results.native.js.map +1 -1
  578. package/build-module/mobile/link-picker/link-picker-screen.native.js +1 -3
  579. package/build-module/mobile/link-picker/link-picker-screen.native.js.map +1 -1
  580. package/build-module/mobile/link-settings/index.native.js +7 -21
  581. package/build-module/mobile/link-settings/index.native.js.map +1 -1
  582. package/build-module/mobile/link-settings/link-settings-navigation.native.js +1 -2
  583. package/build-module/mobile/link-settings/link-settings-navigation.native.js.map +1 -1
  584. package/build-module/mobile/link-settings/link-settings-screen.native.js +1 -3
  585. package/build-module/mobile/link-settings/link-settings-screen.native.js.map +1 -1
  586. package/build-module/mobile/picker/index.android.js +1 -2
  587. package/build-module/mobile/picker/index.android.js.map +1 -1
  588. package/build-module/mobile/segmented-control/index.native.js +3 -8
  589. package/build-module/mobile/segmented-control/index.native.js.map +1 -1
  590. package/build-module/mobile/utils/get-px-from-css-unit.native.js.map +1 -1
  591. package/build-module/mobile/utils/use-unit-converter-to-mobile.native.js +2 -6
  592. package/build-module/mobile/utils/use-unit-converter-to-mobile.native.js.map +1 -1
  593. package/build-module/modal/aria-helper.js +2 -1
  594. package/build-module/modal/aria-helper.js.map +1 -1
  595. package/build-module/modal/index.js +3 -4
  596. package/build-module/modal/index.js.map +1 -1
  597. package/build-module/modal/use-modal-exit-animation.js.map +1 -1
  598. package/build-module/navigation/back-button/index.js +1 -2
  599. package/build-module/navigation/back-button/index.js.map +1 -1
  600. package/build-module/navigation/group/index.js +1 -2
  601. package/build-module/navigation/group/index.js.map +1 -1
  602. package/build-module/navigation/index.js +1 -2
  603. package/build-module/navigation/index.js.map +1 -1
  604. package/build-module/navigation/item/base-content.js +1 -3
  605. package/build-module/navigation/item/base-content.js.map +1 -1
  606. package/build-module/navigation/item/base.js.map +1 -1
  607. package/build-module/navigation/item/index.js +1 -2
  608. package/build-module/navigation/item/index.js.map +1 -1
  609. package/build-module/navigation/item/use-navigation-tree-item.js +2 -2
  610. package/build-module/navigation/item/use-navigation-tree-item.js.map +1 -1
  611. package/build-module/navigation/menu/index.js +1 -2
  612. package/build-module/navigation/menu/index.js.map +1 -1
  613. package/build-module/navigation/menu/menu-title-search.js +4 -4
  614. package/build-module/navigation/menu/menu-title-search.js.map +1 -1
  615. package/build-module/navigation/menu/menu-title.js +1 -2
  616. package/build-module/navigation/menu/menu-title.js.map +1 -1
  617. package/build-module/navigation/menu/search-no-results-found.js +1 -2
  618. package/build-module/navigation/menu/search-no-results-found.js.map +1 -1
  619. package/build-module/navigation/menu/use-navigation-tree-menu.js +2 -2
  620. package/build-module/navigation/menu/use-navigation-tree-menu.js.map +1 -1
  621. package/build-module/navigation/styles/navigation-styles.js.map +1 -1
  622. package/build-module/navigator/navigator/component.js.map +1 -1
  623. package/build-module/navigator/navigator-button/hook.js.map +1 -1
  624. package/build-module/notice/index.js +1 -2
  625. package/build-module/notice/index.js.map +1 -1
  626. package/build-module/notice/index.native.js +1 -3
  627. package/build-module/notice/index.native.js.map +1 -1
  628. package/build-module/number-control/index.js +1 -3
  629. package/build-module/number-control/index.js.map +1 -1
  630. package/build-module/number-control/styles/number-control-styles.js.map +1 -1
  631. package/build-module/palette-edit/index.js +31 -9
  632. package/build-module/palette-edit/index.js.map +1 -1
  633. package/build-module/palette-edit/styles.js +13 -29
  634. package/build-module/palette-edit/styles.js.map +1 -1
  635. package/build-module/panel/actions.native.js +1 -2
  636. package/build-module/panel/actions.native.js.map +1 -1
  637. package/build-module/panel/body.js +1 -2
  638. package/build-module/panel/body.js.map +1 -1
  639. package/build-module/panel/body.native.js +1 -2
  640. package/build-module/panel/body.native.js.map +1 -1
  641. package/build-module/panel/header.js +1 -2
  642. package/build-module/panel/header.js.map +1 -1
  643. package/build-module/panel/index.js +1 -2
  644. package/build-module/panel/index.js.map +1 -1
  645. package/build-module/placeholder/index.js +1 -2
  646. package/build-module/placeholder/index.js.map +1 -1
  647. package/build-module/popover/index.js +2 -4
  648. package/build-module/popover/index.js.map +1 -1
  649. package/build-module/popover/overlay-middlewares.js.map +1 -1
  650. package/build-module/popover/utils.js.map +1 -1
  651. package/build-module/private-apis.js +3 -3
  652. package/build-module/private-apis.js.map +1 -1
  653. package/build-module/progress-bar/index.js +1 -2
  654. package/build-module/progress-bar/index.js.map +1 -1
  655. package/build-module/progress-bar/styles.js.map +1 -1
  656. package/build-module/query-controls/index.js.map +1 -1
  657. package/build-module/query-controls/index.native.js +1 -3
  658. package/build-module/query-controls/index.native.js.map +1 -1
  659. package/build-module/radio-control/index.js +1 -2
  660. package/build-module/radio-control/index.js.map +1 -1
  661. package/build-module/radio-control/index.native.js +1 -2
  662. package/build-module/radio-control/index.native.js.map +1 -1
  663. package/build-module/radio-group/index.js +3 -1
  664. package/build-module/radio-group/index.js.map +1 -1
  665. package/build-module/range-control/index.js +1 -2
  666. package/build-module/range-control/index.js.map +1 -1
  667. package/build-module/range-control/index.native.js.map +1 -1
  668. package/build-module/range-control/mark.js +1 -3
  669. package/build-module/range-control/mark.js.map +1 -1
  670. package/build-module/range-control/rail.js +1 -3
  671. package/build-module/range-control/rail.js.map +1 -1
  672. package/build-module/range-control/styles/range-control-styles.js +32 -32
  673. package/build-module/range-control/styles/range-control-styles.js.map +1 -1
  674. package/build-module/range-control/tooltip.js +1 -1
  675. package/build-module/range-control/tooltip.js.map +1 -1
  676. package/build-module/range-control/utils.js.map +1 -1
  677. package/build-module/resizable-box/index.js +1 -2
  678. package/build-module/resizable-box/index.js.map +1 -1
  679. package/build-module/resizable-box/resize-tooltip/index.js +1 -2
  680. package/build-module/resizable-box/resize-tooltip/index.js.map +1 -1
  681. package/build-module/resizable-box/resize-tooltip/label.js.map +1 -1
  682. package/build-module/resizable-box/resize-tooltip/utils.js.map +1 -1
  683. package/build-module/responsive-wrapper/index.js.map +1 -1
  684. package/build-module/sandbox/index.js +4 -8
  685. package/build-module/sandbox/index.js.map +1 -1
  686. package/build-module/sandbox/index.native.js +2 -5
  687. package/build-module/sandbox/index.native.js.map +1 -1
  688. package/build-module/search-control/index.js +6 -0
  689. package/build-module/search-control/index.js.map +1 -1
  690. package/build-module/search-control/index.native.js +2 -5
  691. package/build-module/search-control/index.native.js.map +1 -1
  692. package/build-module/search-control/types.js.map +1 -1
  693. package/build-module/select-control/index.js.map +1 -1
  694. package/build-module/select-control/index.native.js.map +1 -1
  695. package/build-module/slot-fill/bubbles-virtually/slot.js +1 -2
  696. package/build-module/slot-fill/bubbles-virtually/slot.js.map +1 -1
  697. package/build-module/slot-fill/fill.js +3 -6
  698. package/build-module/slot-fill/fill.js.map +1 -1
  699. package/build-module/slot-fill/index.js +1 -3
  700. package/build-module/slot-fill/index.js.map +1 -1
  701. package/build-module/slot-fill/slot.js +1 -2
  702. package/build-module/slot-fill/slot.js.map +1 -1
  703. package/build-module/snackbar/index.js +1 -2
  704. package/build-module/snackbar/index.js.map +1 -1
  705. package/build-module/snackbar/list.js +1 -2
  706. package/build-module/snackbar/list.js.map +1 -1
  707. package/build-module/spacer/hook.js +5 -3
  708. package/build-module/spacer/hook.js.map +1 -1
  709. package/build-module/spinner/index.js +1 -2
  710. package/build-module/spinner/index.js.map +1 -1
  711. package/build-module/spinner/styles.js.map +1 -1
  712. package/build-module/style-provider/index.js +1 -0
  713. package/build-module/style-provider/index.js.map +1 -1
  714. package/build-module/surface/hook.js.map +1 -1
  715. package/build-module/surface/styles.js.map +1 -1
  716. package/build-module/tab-panel/index.js +5 -3
  717. package/build-module/tab-panel/index.js.map +1 -1
  718. package/build-module/tabs/index.js +47 -112
  719. package/build-module/tabs/index.js.map +1 -1
  720. package/build-module/tabs/styles.js +29 -7
  721. package/build-module/tabs/styles.js.map +1 -1
  722. package/build-module/tabs/tab.js +30 -10
  723. package/build-module/tabs/tab.js.map +1 -1
  724. package/build-module/tabs/tablist.js +67 -56
  725. package/build-module/tabs/tablist.js.map +1 -1
  726. package/build-module/tabs/tabpanel.js.map +1 -1
  727. package/build-module/tabs/types.js.map +1 -1
  728. package/build-module/text/get-line-height.js.map +1 -1
  729. package/build-module/text/styles/text-mixins.native.js.map +1 -1
  730. package/build-module/text/utils.js.map +1 -1
  731. package/build-module/text-control/index.native.js.map +1 -1
  732. package/build-module/text-highlight/index.js +1 -2
  733. package/build-module/text-highlight/index.js.map +1 -1
  734. package/build-module/textarea-control/index.js.map +1 -1
  735. package/build-module/theme/color-algorithms.js.map +1 -1
  736. package/build-module/theme/styles.js.map +1 -1
  737. package/build-module/tip/index.js +1 -2
  738. package/build-module/tip/index.js.map +1 -1
  739. package/build-module/toggle-control/index.js +1 -2
  740. package/build-module/toggle-control/index.js.map +1 -1
  741. package/build-module/toggle-control/index.native.js.map +1 -1
  742. package/build-module/toggle-group-control/toggle-group-control/as-radio-group.js +10 -2
  743. package/build-module/toggle-group-control/toggle-group-control/as-radio-group.js.map +1 -1
  744. package/build-module/toggle-group-control/toggle-group-control/component.js +6 -66
  745. package/build-module/toggle-group-control/toggle-group-control/component.js.map +1 -1
  746. package/build-module/toggle-group-control/toggle-group-control-option-base/component.js +11 -12
  747. package/build-module/toggle-group-control/toggle-group-control-option-base/component.js.map +1 -1
  748. package/build-module/toggle-group-control/types.js.map +1 -1
  749. package/build-module/toolbar/toolbar/index.js +3 -0
  750. package/build-module/toolbar/toolbar/index.js.map +1 -1
  751. package/build-module/toolbar/toolbar-button/toolbar-button-container.native.js +2 -2
  752. package/build-module/toolbar/toolbar-button/toolbar-button-container.native.js.map +1 -1
  753. package/build-module/toolbar/toolbar-group/index.js +1 -2
  754. package/build-module/toolbar/toolbar-group/index.js.map +1 -1
  755. package/build-module/tools-panel/styles.js.map +1 -1
  756. package/build-module/tools-panel/tools-panel/component.js +1 -2
  757. package/build-module/tools-panel/tools-panel/component.js.map +1 -1
  758. package/build-module/tools-panel/tools-panel-header/component.js +2 -4
  759. package/build-module/tools-panel/tools-panel-header/component.js.map +1 -1
  760. package/build-module/tools-panel/tools-panel-item/hook.js +0 -2
  761. package/build-module/tools-panel/tools-panel-item/hook.js.map +1 -1
  762. package/build-module/tooltip/index.js +6 -3
  763. package/build-module/tooltip/index.js.map +1 -1
  764. package/build-module/tooltip/index.native.js +6 -18
  765. package/build-module/tooltip/index.native.js.map +1 -1
  766. package/build-module/tree-grid/cell.js +1 -2
  767. package/build-module/tree-grid/cell.js.map +1 -1
  768. package/build-module/unit-control/index.js.map +1 -1
  769. package/build-module/unit-control/index.native.js +3 -9
  770. package/build-module/unit-control/index.native.js.map +1 -1
  771. package/build-module/unit-control/utils.js.map +1 -1
  772. package/build-module/utils/breakpoint.js.map +1 -1
  773. package/build-module/utils/colors-values.js.map +1 -1
  774. package/build-module/utils/config-values.js.map +1 -1
  775. package/build-module/utils/deprecated-36px-size.js +19 -0
  776. package/build-module/utils/deprecated-36px-size.js.map +1 -0
  777. package/build-module/utils/element-rect.js +13 -2
  778. package/build-module/utils/element-rect.js.map +1 -1
  779. package/build-module/utils/font-size.js.map +1 -1
  780. package/build-module/utils/hooks/use-animated-offset-rect.js +75 -0
  781. package/build-module/utils/hooks/use-animated-offset-rect.js.map +1 -0
  782. package/build-module/utils/hooks/use-cx.js.map +1 -1
  783. package/build-module/utils/hooks/use-update-effect.js +0 -2
  784. package/build-module/utils/hooks/use-update-effect.js.map +1 -1
  785. package/build-module/utils/math.js +2 -2
  786. package/build-module/utils/math.js.map +1 -1
  787. package/build-module/utils/space.js.map +1 -1
  788. package/build-module/utils/unit-values.js.map +1 -1
  789. package/build-module/utils/use-responsive-value.js.map +1 -1
  790. package/build-style/style-rtl.css +14 -11
  791. package/build-style/style.css +14 -11
  792. package/build-types/alignment-matrix-control/types.d.ts +2 -0
  793. package/build-types/alignment-matrix-control/types.d.ts.map +1 -1
  794. package/build-types/animate/stories/index.story.d.ts.map +1 -1
  795. package/build-types/autocomplete/autocompleter-ui.d.ts.map +1 -1
  796. package/build-types/autocomplete/index.d.ts.map +1 -1
  797. package/build-types/base-control/stories/index.story.d.ts.map +1 -1
  798. package/build-types/base-control/types.d.ts +3 -0
  799. package/build-types/base-control/types.d.ts.map +1 -1
  800. package/build-types/border-box-control/border-box-control/component.d.ts +1 -0
  801. package/build-types/border-box-control/border-box-control/component.d.ts.map +1 -1
  802. package/build-types/border-box-control/border-box-control/hook.d.ts.map +1 -1
  803. package/build-types/border-control/border-control/component.d.ts +1 -0
  804. package/build-types/border-control/border-control/component.d.ts.map +1 -1
  805. package/build-types/border-control/border-control/hook.d.ts.map +1 -1
  806. package/build-types/border-control/border-control-dropdown/component.d.ts.map +1 -1
  807. package/build-types/border-control/stories/index.story.d.ts.map +1 -1
  808. package/build-types/button/stories/index.story.d.ts.map +1 -1
  809. package/build-types/card/stories/index.story.d.ts.map +1 -1
  810. package/build-types/composite/legacy/index.d.ts.map +1 -1
  811. package/build-types/composite/stories/index.story.d.ts.map +1 -1
  812. package/build-types/date-time/date/index.d.ts.map +1 -1
  813. package/build-types/disabled/stories/index.story.d.ts.map +1 -1
  814. package/build-types/draggable/stories/index.story.d.ts.map +1 -1
  815. package/build-types/drop-zone/index.d.ts.map +1 -1
  816. package/build-types/form-token-field/index.d.ts.map +1 -1
  817. package/build-types/form-token-field/suggestions-list.d.ts.map +1 -1
  818. package/build-types/item-group/stories/index.story.d.ts +1 -1
  819. package/build-types/item-group/stories/index.story.d.ts.map +1 -1
  820. package/build-types/keyboard-shortcuts/stories/index.story.d.ts.map +1 -1
  821. package/build-types/menu/checkbox-item.d.ts +3 -0
  822. package/build-types/menu/checkbox-item.d.ts.map +1 -0
  823. package/build-types/menu/context.d.ts +6 -0
  824. package/build-types/menu/context.d.ts.map +1 -0
  825. package/build-types/menu/group-label.d.ts +3 -0
  826. package/build-types/menu/group-label.d.ts.map +1 -0
  827. package/build-types/menu/group.d.ts +3 -0
  828. package/build-types/menu/group.d.ts.map +1 -0
  829. package/build-types/menu/index.d.ts +40 -0
  830. package/build-types/menu/index.d.ts.map +1 -0
  831. package/build-types/{dropdown-menu-v2 → menu}/item-help-text.d.ts +1 -1
  832. package/build-types/menu/item-help-text.d.ts.map +1 -0
  833. package/build-types/{dropdown-menu-v2 → menu}/item-label.d.ts +1 -1
  834. package/build-types/menu/item-label.d.ts.map +1 -0
  835. package/build-types/menu/item.d.ts +3 -0
  836. package/build-types/menu/item.d.ts.map +1 -0
  837. package/build-types/menu/radio-item.d.ts +3 -0
  838. package/build-types/menu/radio-item.d.ts.map +1 -0
  839. package/build-types/menu/separator.d.ts +3 -0
  840. package/build-types/menu/separator.d.ts.map +1 -0
  841. package/build-types/menu/stories/index.story.d.ts +16 -0
  842. package/build-types/menu/stories/index.story.d.ts.map +1 -0
  843. package/build-types/{dropdown-menu-v2 → menu}/styles.d.ts +13 -13
  844. package/build-types/menu/styles.d.ts.map +1 -0
  845. package/build-types/menu/test/index.d.ts.map +1 -0
  846. package/build-types/{dropdown-menu-v2 → menu}/types.d.ts +22 -21
  847. package/build-types/menu/types.d.ts.map +1 -0
  848. package/build-types/menu/use-temporary-focus-visible-fix.d.ts.map +1 -0
  849. package/build-types/modal/aria-helper.d.ts.map +1 -1
  850. package/build-types/navigable-container/stories/navigable-menu.story.d.ts.map +1 -1
  851. package/build-types/navigable-container/stories/tabbable-container.story.d.ts.map +1 -1
  852. package/build-types/navigation/index.d.ts.map +1 -1
  853. package/build-types/palette-edit/index.d.ts +3 -0
  854. package/build-types/palette-edit/index.d.ts.map +1 -1
  855. package/build-types/palette-edit/styles.d.ts +0 -256
  856. package/build-types/palette-edit/styles.d.ts.map +1 -1
  857. package/build-types/panel/stories/index.story.d.ts.map +1 -1
  858. package/build-types/radio-group/index.d.ts.map +1 -1
  859. package/build-types/range-control/styles/range-control-styles.d.ts +1 -1
  860. package/build-types/range-control/styles/range-control-styles.d.ts.map +1 -1
  861. package/build-types/resizable-box/stories/index.story.d.ts.map +1 -1
  862. package/build-types/sandbox/index.d.ts.map +1 -1
  863. package/build-types/sandbox/stories/index.story.d.ts.map +1 -1
  864. package/build-types/scroll-lock/stories/index.story.d.ts.map +1 -1
  865. package/build-types/search-control/index.d.ts.map +1 -1
  866. package/build-types/search-control/stories/index.story.d.ts +0 -8
  867. package/build-types/search-control/stories/index.story.d.ts.map +1 -1
  868. package/build-types/search-control/types.d.ts +3 -0
  869. package/build-types/search-control/types.d.ts.map +1 -1
  870. package/build-types/shortcut/stories/index.story.d.ts.map +1 -1
  871. package/build-types/slot-fill/bubbles-virtually/slot.d.ts.map +1 -1
  872. package/build-types/slot-fill/fill.d.ts.map +1 -1
  873. package/build-types/slot-fill/stories/index.story.d.ts.map +1 -1
  874. package/build-types/spacer/hook.d.ts.map +1 -1
  875. package/build-types/tab-panel/index.d.ts.map +1 -1
  876. package/build-types/tab-panel/stories/index.story.d.ts.map +1 -1
  877. package/build-types/tabs/index.d.ts +21 -8
  878. package/build-types/tabs/index.d.ts.map +1 -1
  879. package/build-types/tabs/stories/index.story.d.ts +1 -1
  880. package/build-types/tabs/stories/index.story.d.ts.map +1 -1
  881. package/build-types/tabs/styles.d.ts +13 -3
  882. package/build-types/tabs/styles.d.ts.map +1 -1
  883. package/build-types/tabs/tab.d.ts +0 -3
  884. package/build-types/tabs/tab.d.ts.map +1 -1
  885. package/build-types/tabs/tablist.d.ts.map +1 -1
  886. package/build-types/tabs/types.d.ts +85 -48
  887. package/build-types/tabs/types.d.ts.map +1 -1
  888. package/build-types/theme/stories/index.story.d.ts.map +1 -1
  889. package/build-types/toggle-group-control/toggle-group-control/as-radio-group.d.ts.map +1 -1
  890. package/build-types/toggle-group-control/toggle-group-control/component.d.ts.map +1 -1
  891. package/build-types/toggle-group-control/types.d.ts +1 -0
  892. package/build-types/toggle-group-control/types.d.ts.map +1 -1
  893. package/build-types/toolbar/toolbar/index.d.ts.map +1 -1
  894. package/build-types/tools-panel/tools-panel-item/hook.d.ts.map +1 -1
  895. package/build-types/tooltip/index.d.ts.map +1 -1
  896. package/build-types/utils/deprecated-36px-size.d.ts +6 -0
  897. package/build-types/utils/deprecated-36px-size.d.ts.map +1 -0
  898. package/build-types/utils/element-rect.d.ts +1 -1
  899. package/build-types/utils/element-rect.d.ts.map +1 -1
  900. package/build-types/utils/hooks/use-animated-offset-rect.d.ts +69 -0
  901. package/build-types/utils/hooks/use-animated-offset-rect.d.ts.map +1 -0
  902. package/build-types/utils/hooks/use-update-effect.d.ts.map +1 -1
  903. package/build-types/visually-hidden/stories/index.story.d.ts.map +1 -1
  904. package/package.json +21 -20
  905. package/schemas/docs-manifest.json +38 -0
  906. package/src/alignment-matrix-control/README.md +45 -36
  907. package/src/alignment-matrix-control/docs-manifest.json +12 -0
  908. package/src/alignment-matrix-control/types.ts +2 -0
  909. package/src/angle-picker-control/README.md +35 -23
  910. package/src/angle-picker-control/docs-manifest.json +5 -0
  911. package/src/animate/stories/index.story.tsx +2 -1
  912. package/src/autocomplete/autocompleter-ui.native.js +2 -4
  913. package/src/autocomplete/autocompleter-ui.tsx +2 -6
  914. package/src/autocomplete/index.tsx +4 -5
  915. package/src/base-control/README.md +58 -47
  916. package/src/base-control/docs-manifest.json +12 -0
  917. package/src/base-control/stories/index.story.tsx +4 -0
  918. package/src/base-control/types.ts +3 -0
  919. package/src/border-box-control/border-box-control/README.md +1 -0
  920. package/src/border-box-control/border-box-control/component.tsx +1 -0
  921. package/src/border-box-control/border-box-control/hook.ts +7 -0
  922. package/src/border-box-control/stories/index.story.tsx +1 -0
  923. package/src/border-box-control/test/index.tsx +1 -0
  924. package/src/border-control/border-control/README.md +1 -0
  925. package/src/border-control/border-control/component.tsx +1 -0
  926. package/src/border-control/border-control/hook.ts +7 -1
  927. package/src/border-control/border-control-dropdown/component.tsx +24 -12
  928. package/src/border-control/stories/index.story.tsx +1 -0
  929. package/src/border-control/test/index.js +1 -0
  930. package/src/button/stories/index.story.tsx +2 -1
  931. package/src/button/style.scss +5 -1
  932. package/src/card/stories/index.story.tsx +2 -1
  933. package/src/color-palette/index.native.js +1 -2
  934. package/src/color-palette/index.tsx +1 -1
  935. package/src/color-palette/style.scss +2 -4
  936. package/src/color-picker/index.native.js +0 -1
  937. package/src/composite/legacy/index.tsx +5 -2
  938. package/src/composite/stories/index.story.tsx +2 -1
  939. package/src/composite/test/index.tsx +629 -38
  940. package/src/custom-gradient-picker/gradient-bar/control-points.tsx +1 -1
  941. package/src/date-time/date/index.tsx +0 -1
  942. package/src/disabled/stories/index.story.tsx +2 -1
  943. package/src/draggable/stories/index.story.tsx +2 -1
  944. package/src/drop-zone/index.tsx +1 -2
  945. package/src/drop-zone/style.scss +1 -1
  946. package/src/font-size-picker/index.native.js +7 -7
  947. package/src/form-token-field/index.tsx +0 -3
  948. package/src/form-token-field/style.scss +4 -1
  949. package/src/form-token-field/suggestions-list.tsx +6 -0
  950. package/src/item-group/stories/index.story.tsx +8 -4
  951. package/src/keyboard-shortcuts/stories/index.story.tsx +2 -1
  952. package/src/{dropdown-menu-v2 → menu}/README.md +34 -34
  953. package/src/{dropdown-menu-v2 → menu}/checkbox-item.tsx +14 -14
  954. package/src/menu/context.tsx +13 -0
  955. package/src/{dropdown-menu-v2 → menu}/group-label.tsx +8 -8
  956. package/src/menu/group.tsx +26 -0
  957. package/src/{dropdown-menu-v2 → menu}/index.tsx +65 -70
  958. package/src/{dropdown-menu-v2 → menu}/item-help-text.tsx +3 -7
  959. package/src/{dropdown-menu-v2 → menu}/item-label.tsx +3 -7
  960. package/src/{dropdown-menu-v2 → menu}/item.tsx +13 -13
  961. package/src/{dropdown-menu-v2 → menu}/radio-item.tsx +14 -14
  962. package/src/menu/separator.tsx +27 -0
  963. package/src/menu/stories/index.story.tsx +542 -0
  964. package/src/{dropdown-menu-v2 → menu}/styles.ts +17 -17
  965. package/src/{dropdown-menu-v2 → menu}/test/index.tsx +145 -225
  966. package/src/{dropdown-menu-v2 → menu}/types.ts +24 -23
  967. package/src/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js +3 -5
  968. package/src/mobile/bottom-sheet/range-cell.native.js +1 -1
  969. package/src/mobile/bottom-sheet/stepper-cell/index.native.js +1 -1
  970. package/src/mobile/bottom-sheet/sub-sheet/index.native.js +1 -3
  971. package/src/mobile/bottom-sheet-select-control/index.native.js +2 -2
  972. package/src/mobile/color-settings/index.native.js +1 -3
  973. package/src/mobile/color-settings/picker-screen.native.js +1 -3
  974. package/src/mobile/image/index.native.js +1 -3
  975. package/src/mobile/keyboard-avoiding-view/index.ios.js +1 -3
  976. package/src/mobile/link-picker/link-picker-results.native.js +2 -5
  977. package/src/mobile/link-picker/link-picker-screen.native.js +1 -3
  978. package/src/mobile/link-settings/index.native.js +6 -18
  979. package/src/mobile/link-settings/link-settings-screen.native.js +1 -3
  980. package/src/mobile/segmented-control/index.native.js +2 -6
  981. package/src/mobile/utils/use-unit-converter-to-mobile.native.js +2 -6
  982. package/src/modal/aria-helper.ts +1 -0
  983. package/src/navigable-container/stories/navigable-menu.story.tsx +2 -1
  984. package/src/navigable-container/stories/tabbable-container.story.tsx +2 -1
  985. package/src/navigation/index.tsx +1 -2
  986. package/src/navigation/item/use-navigation-tree-item.tsx +2 -2
  987. package/src/navigation/menu/menu-title-search.tsx +2 -2
  988. package/src/navigation/menu/use-navigation-tree-menu.tsx +2 -2
  989. package/src/palette-edit/index.tsx +34 -10
  990. package/src/palette-edit/styles.ts +1 -67
  991. package/src/palette-edit/test/index.tsx +50 -1
  992. package/src/panel/stories/index.story.tsx +2 -1
  993. package/src/private-apis.ts +3 -3
  994. package/src/radio-group/index.tsx +2 -0
  995. package/src/range-control/styles/range-control-styles.ts +19 -10
  996. package/src/range-control/tooltip.tsx +1 -1
  997. package/src/resizable-box/stories/index.story.tsx +2 -1
  998. package/src/sandbox/index.native.js +1 -3
  999. package/src/sandbox/index.tsx +3 -6
  1000. package/src/sandbox/stories/index.story.tsx +2 -1
  1001. package/src/scroll-lock/stories/index.story.tsx +2 -1
  1002. package/src/search-control/README.md +2 -0
  1003. package/src/search-control/index.native.js +1 -3
  1004. package/src/search-control/index.tsx +7 -0
  1005. package/src/search-control/stories/index.story.tsx +0 -15
  1006. package/src/search-control/test/index.tsx +4 -1
  1007. package/src/search-control/types.ts +3 -0
  1008. package/src/shortcut/stories/index.story.tsx +2 -1
  1009. package/src/slot-fill/bubbles-virtually/slot.tsx +1 -2
  1010. package/src/slot-fill/fill.ts +3 -6
  1011. package/src/slot-fill/stories/index.story.tsx +2 -1
  1012. package/src/spacer/hook.ts +3 -2
  1013. package/src/tab-panel/index.tsx +3 -0
  1014. package/src/tab-panel/stories/index.story.tsx +2 -1
  1015. package/src/tab-panel/style.scss +1 -3
  1016. package/src/tabs/README.md +63 -21
  1017. package/src/tabs/index.tsx +112 -189
  1018. package/src/tabs/stories/index.story.tsx +5 -2
  1019. package/src/tabs/styles.ts +123 -46
  1020. package/src/tabs/tab.tsx +31 -5
  1021. package/src/tabs/tablist.tsx +74 -59
  1022. package/src/tabs/test/index.tsx +131 -118
  1023. package/src/tabs/types.ts +89 -49
  1024. package/src/theme/stories/index.story.tsx +2 -1
  1025. package/src/toggle-group-control/test/__snapshots__/index.tsx.snap +6 -6
  1026. package/src/toggle-group-control/test/index.tsx +39 -0
  1027. package/src/toggle-group-control/toggle-group-control/as-radio-group.tsx +11 -1
  1028. package/src/toggle-group-control/toggle-group-control/component.tsx +4 -98
  1029. package/src/toggle-group-control/toggle-group-control-option-base/component.tsx +15 -15
  1030. package/src/toggle-group-control/types.ts +1 -0
  1031. package/src/toolbar/toolbar/index.tsx +3 -0
  1032. package/src/tools-panel/tools-panel-header/component.tsx +1 -1
  1033. package/src/tools-panel/tools-panel-item/hook.ts +0 -2
  1034. package/src/tooltip/index.native.js +5 -15
  1035. package/src/tooltip/index.tsx +8 -1
  1036. package/src/tooltip/test/index.tsx +78 -0
  1037. package/src/unit-control/index.native.js +2 -6
  1038. package/src/utils/deprecated-36px-size.ts +24 -0
  1039. package/src/utils/element-rect.ts +14 -2
  1040. package/src/utils/hooks/use-animated-offset-rect.ts +119 -0
  1041. package/src/utils/hooks/use-update-effect.js +0 -2
  1042. package/src/visually-hidden/stories/index.story.tsx +2 -1
  1043. package/tsconfig.tsbuildinfo +1 -1
  1044. package/build/dropdown-menu-v2/checkbox-item.js.map +0 -1
  1045. package/build/dropdown-menu-v2/context.js.map +0 -1
  1046. package/build/dropdown-menu-v2/group-label.js.map +0 -1
  1047. package/build/dropdown-menu-v2/group.js.map +0 -1
  1048. package/build/dropdown-menu-v2/index.js.map +0 -1
  1049. package/build/dropdown-menu-v2/item-help-text.js.map +0 -1
  1050. package/build/dropdown-menu-v2/item-label.js.map +0 -1
  1051. package/build/dropdown-menu-v2/item.js.map +0 -1
  1052. package/build/dropdown-menu-v2/radio-item.js.map +0 -1
  1053. package/build/dropdown-menu-v2/separator.js.map +0 -1
  1054. package/build/dropdown-menu-v2/styles.js +0 -150
  1055. package/build/dropdown-menu-v2/styles.js.map +0 -1
  1056. package/build/dropdown-menu-v2/types.js.map +0 -1
  1057. package/build/dropdown-menu-v2/use-temporary-focus-visible-fix.js.map +0 -1
  1058. package/build-module/dropdown-menu-v2/checkbox-item.js.map +0 -1
  1059. package/build-module/dropdown-menu-v2/context.js.map +0 -1
  1060. package/build-module/dropdown-menu-v2/group-label.js.map +0 -1
  1061. package/build-module/dropdown-menu-v2/group.js +0 -21
  1062. package/build-module/dropdown-menu-v2/group.js.map +0 -1
  1063. package/build-module/dropdown-menu-v2/index.js.map +0 -1
  1064. package/build-module/dropdown-menu-v2/item-help-text.js.map +0 -1
  1065. package/build-module/dropdown-menu-v2/item-label.js.map +0 -1
  1066. package/build-module/dropdown-menu-v2/item.js.map +0 -1
  1067. package/build-module/dropdown-menu-v2/radio-item.js.map +0 -1
  1068. package/build-module/dropdown-menu-v2/separator.js +0 -22
  1069. package/build-module/dropdown-menu-v2/separator.js.map +0 -1
  1070. package/build-module/dropdown-menu-v2/styles.js +0 -143
  1071. package/build-module/dropdown-menu-v2/styles.js.map +0 -1
  1072. package/build-module/dropdown-menu-v2/types.js.map +0 -1
  1073. package/build-module/dropdown-menu-v2/use-temporary-focus-visible-fix.js.map +0 -1
  1074. package/build-types/dropdown-menu-v2/checkbox-item.d.ts +0 -3
  1075. package/build-types/dropdown-menu-v2/checkbox-item.d.ts.map +0 -1
  1076. package/build-types/dropdown-menu-v2/context.d.ts +0 -6
  1077. package/build-types/dropdown-menu-v2/context.d.ts.map +0 -1
  1078. package/build-types/dropdown-menu-v2/group-label.d.ts +0 -3
  1079. package/build-types/dropdown-menu-v2/group-label.d.ts.map +0 -1
  1080. package/build-types/dropdown-menu-v2/group.d.ts +0 -3
  1081. package/build-types/dropdown-menu-v2/group.d.ts.map +0 -1
  1082. package/build-types/dropdown-menu-v2/index.d.ts +0 -40
  1083. package/build-types/dropdown-menu-v2/index.d.ts.map +0 -1
  1084. package/build-types/dropdown-menu-v2/item-help-text.d.ts.map +0 -1
  1085. package/build-types/dropdown-menu-v2/item-label.d.ts.map +0 -1
  1086. package/build-types/dropdown-menu-v2/item.d.ts +0 -3
  1087. package/build-types/dropdown-menu-v2/item.d.ts.map +0 -1
  1088. package/build-types/dropdown-menu-v2/radio-item.d.ts +0 -3
  1089. package/build-types/dropdown-menu-v2/radio-item.d.ts.map +0 -1
  1090. package/build-types/dropdown-menu-v2/separator.d.ts +0 -3
  1091. package/build-types/dropdown-menu-v2/separator.d.ts.map +0 -1
  1092. package/build-types/dropdown-menu-v2/stories/index.story.d.ts +0 -16
  1093. package/build-types/dropdown-menu-v2/stories/index.story.d.ts.map +0 -1
  1094. package/build-types/dropdown-menu-v2/styles.d.ts.map +0 -1
  1095. package/build-types/dropdown-menu-v2/test/index.d.ts.map +0 -1
  1096. package/build-types/dropdown-menu-v2/types.d.ts.map +0 -1
  1097. package/build-types/dropdown-menu-v2/use-temporary-focus-visible-fix.d.ts.map +0 -1
  1098. package/src/dropdown-menu-v2/context.tsx +0 -13
  1099. package/src/dropdown-menu-v2/group.tsx +0 -26
  1100. package/src/dropdown-menu-v2/separator.tsx +0 -27
  1101. package/src/dropdown-menu-v2/stories/index.story.tsx +0 -639
  1102. /package/build/{dropdown-menu-v2 → menu}/types.js +0 -0
  1103. /package/build/{dropdown-menu-v2 → menu}/use-temporary-focus-visible-fix.js +0 -0
  1104. /package/build-module/{dropdown-menu-v2 → menu}/types.js +0 -0
  1105. /package/build-module/{dropdown-menu-v2 → menu}/use-temporary-focus-visible-fix.js +0 -0
  1106. /package/build-types/{dropdown-menu-v2 → menu}/test/index.d.ts +0 -0
  1107. /package/build-types/{dropdown-menu-v2 → menu}/use-temporary-focus-visible-fix.d.ts +0 -0
  1108. /package/src/{dropdown-menu-v2 → menu}/use-temporary-focus-visible-fix.ts +0 -0
@@ -1 +1 @@
1
- {"version":3,"names":["clsx","useLayoutEffect","useRef","useEffect","useState","useAnchor","useDebounce","useMergeRefs","useRefEffect","speak","__","_n","sprintf","getDefaultUseItems","Button","Popover","VisuallyHidden","createPortal","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","ListBox","items","onSelect","selectedIndex","instanceId","listBoxId","className","Component","id","role","children","map","option","index","key","accessibleWhenDisabled","disabled","isDisabled","variant","undefined","onClick","label","getAutoCompleterUI","autocompleter","_autocompleter$useIte","useItems","AutocompleterUI","filterValue","onChangeOptions","onReset","reset","contentRef","popoverAnchor","editableContentElement","current","needsA11yCompat","setNeedsA11yCompat","popoverRef","popoverRefs","node","ownerDocument","useOnClickOutside","debouncedSpeak","announce","options","length","focusOnMount","onClose","placement","anchor","ref","body","handler","listener","event","contains","target","document","addEventListener","removeEventListener"],"sources":["@wordpress/components/src/autocomplete/autocompleter-ui.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseLayoutEffect,\n\tuseRef,\n\tuseEffect,\n\tuseState,\n} from '@wordpress/element';\nimport { useAnchor } from '@wordpress/rich-text';\nimport { useDebounce, useMergeRefs, useRefEffect } from '@wordpress/compose';\nimport { speak } from '@wordpress/a11y';\nimport { __, _n, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport getDefaultUseItems from './get-default-use-items';\nimport Button from '../button';\nimport Popover from '../popover';\nimport { VisuallyHidden } from '../visually-hidden';\nimport { createPortal } from 'react-dom';\nimport type { AutocompleterUIProps, KeyedOption, WPCompleter } from './types';\n\ntype ListBoxProps = {\n\titems: KeyedOption[];\n\tonSelect: ( option: KeyedOption ) => void;\n\tselectedIndex: number;\n\tinstanceId: number;\n\tlistBoxId: string | undefined;\n\tclassName?: string;\n\tComponent?: React.ElementType;\n};\n\nfunction ListBox( {\n\titems,\n\tonSelect,\n\tselectedIndex,\n\tinstanceId,\n\tlistBoxId,\n\tclassName,\n\tComponent = 'div',\n}: ListBoxProps ) {\n\treturn (\n\t\t<Component\n\t\t\tid={ listBoxId }\n\t\t\trole=\"listbox\"\n\t\t\tclassName=\"components-autocomplete__results\"\n\t\t>\n\t\t\t{ items.map( ( option, index ) => (\n\t\t\t\t<Button\n\t\t\t\t\tkey={ option.key }\n\t\t\t\t\tid={ `components-autocomplete-item-${ instanceId }-${ option.key }` }\n\t\t\t\t\trole=\"option\"\n\t\t\t\t\taria-selected={ index === selectedIndex }\n\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\tdisabled={ option.isDisabled }\n\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t'components-autocomplete__result',\n\t\t\t\t\t\tclassName,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// Unused, for backwards compatibility.\n\t\t\t\t\t\t\t'is-selected': index === selectedIndex,\n\t\t\t\t\t\t}\n\t\t\t\t\t) }\n\t\t\t\t\tvariant={ index === selectedIndex ? 'primary' : undefined }\n\t\t\t\t\tonClick={ () => onSelect( option ) }\n\t\t\t\t>\n\t\t\t\t\t{ option.label }\n\t\t\t\t</Button>\n\t\t\t) ) }\n\t\t</Component>\n\t);\n}\n\nexport function getAutoCompleterUI( autocompleter: WPCompleter ) {\n\tconst useItems =\n\t\tautocompleter.useItems ?? getDefaultUseItems( autocompleter );\n\n\tfunction AutocompleterUI( {\n\t\tfilterValue,\n\t\tinstanceId,\n\t\tlistBoxId,\n\t\tclassName,\n\t\tselectedIndex,\n\t\tonChangeOptions,\n\t\tonSelect,\n\t\tonReset,\n\t\treset,\n\t\tcontentRef,\n\t}: AutocompleterUIProps ) {\n\t\tconst [ items ] = useItems( filterValue );\n\t\tconst popoverAnchor = useAnchor( {\n\t\t\teditableContentElement: contentRef.current,\n\t\t} );\n\n\t\tconst [ needsA11yCompat, setNeedsA11yCompat ] = useState( false );\n\t\tconst popoverRef = useRef< HTMLElement >( null );\n\t\tconst popoverRefs = useMergeRefs( [\n\t\t\tpopoverRef,\n\t\t\tuseRefEffect(\n\t\t\t\t( node ) => {\n\t\t\t\t\tif ( ! contentRef.current ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// If the popover is rendered in a different document than\n\t\t\t\t\t// the content, we need to duplicate the options list in the\n\t\t\t\t\t// content document so that it's available to the screen\n\t\t\t\t\t// readers, which check the DOM ID based aria-* attributes.\n\t\t\t\t\tsetNeedsA11yCompat(\n\t\t\t\t\t\tnode.ownerDocument !== contentRef.current.ownerDocument\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t\t[ contentRef ]\n\t\t\t),\n\t\t] );\n\n\t\tuseOnClickOutside( popoverRef, reset );\n\n\t\tconst debouncedSpeak = useDebounce( speak, 500 );\n\n\t\tfunction announce( options: Array< KeyedOption > ) {\n\t\t\tif ( ! debouncedSpeak ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ( !! options.length ) {\n\t\t\t\tif ( filterValue ) {\n\t\t\t\t\tdebouncedSpeak(\n\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t/* translators: %d: number of results. */\n\t\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t\t'%d result found, use up and down arrow keys to navigate.',\n\t\t\t\t\t\t\t\t'%d results found, use up and down arrow keys to navigate.',\n\t\t\t\t\t\t\t\toptions.length\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\toptions.length\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'assertive'\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\tdebouncedSpeak(\n\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t/* translators: %d: number of results. */\n\t\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t\t'Initial %d result loaded. Type to filter all available results. Use up and down arrow keys to navigate.',\n\t\t\t\t\t\t\t\t'Initial %d results loaded. Type to filter all available results. Use up and down arrow keys to navigate.',\n\t\t\t\t\t\t\t\toptions.length\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\toptions.length\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'assertive'\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tdebouncedSpeak( __( 'No results.' ), 'assertive' );\n\t\t\t}\n\t\t}\n\n\t\tuseLayoutEffect( () => {\n\t\t\tonChangeOptions( items );\n\t\t\tannounce( items );\n\t\t\t// Temporarily disabling exhaustive-deps to avoid introducing unexpected side effecst.\n\t\t\t// See https://github.com/WordPress/gutenberg/pull/41820\n\t\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t}, [ items ] );\n\n\t\tif ( items.length === 0 ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<Popover\n\t\t\t\t\tfocusOnMount={ false }\n\t\t\t\t\tonClose={ onReset }\n\t\t\t\t\tplacement=\"top-start\"\n\t\t\t\t\tclassName=\"components-autocomplete__popover\"\n\t\t\t\t\tanchor={ popoverAnchor }\n\t\t\t\t\tref={ popoverRefs }\n\t\t\t\t>\n\t\t\t\t\t<ListBox\n\t\t\t\t\t\titems={ items }\n\t\t\t\t\t\tonSelect={ onSelect }\n\t\t\t\t\t\tselectedIndex={ selectedIndex }\n\t\t\t\t\t\tinstanceId={ instanceId }\n\t\t\t\t\t\tlistBoxId={ listBoxId }\n\t\t\t\t\t\tclassName={ className }\n\t\t\t\t\t/>\n\t\t\t\t</Popover>\n\t\t\t\t{ contentRef.current &&\n\t\t\t\t\tneedsA11yCompat &&\n\t\t\t\t\tcreatePortal(\n\t\t\t\t\t\t<ListBox\n\t\t\t\t\t\t\titems={ items }\n\t\t\t\t\t\t\tonSelect={ onSelect }\n\t\t\t\t\t\t\tselectedIndex={ selectedIndex }\n\t\t\t\t\t\t\tinstanceId={ instanceId }\n\t\t\t\t\t\t\tlistBoxId={ listBoxId }\n\t\t\t\t\t\t\tclassName={ className }\n\t\t\t\t\t\t\tComponent={ VisuallyHidden }\n\t\t\t\t\t\t/>,\n\t\t\t\t\t\tcontentRef.current.ownerDocument.body\n\t\t\t\t\t) }\n\t\t\t</>\n\t\t);\n\t}\n\n\treturn AutocompleterUI;\n}\n\nfunction useOnClickOutside(\n\tref: React.RefObject< HTMLElement >,\n\thandler: AutocompleterUIProps[ 'reset' ]\n) {\n\tuseEffect( () => {\n\t\tconst listener = ( event: MouseEvent | TouchEvent ) => {\n\t\t\t// Do nothing if clicking ref's element or descendent elements, or if the ref is not referencing an element\n\t\t\tif (\n\t\t\t\t! ref.current ||\n\t\t\t\tref.current.contains( event.target as Node )\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\thandler( event );\n\t\t};\n\t\tdocument.addEventListener( 'mousedown', listener );\n\t\tdocument.addEventListener( 'touchstart', listener );\n\t\treturn () => {\n\t\t\tdocument.removeEventListener( 'mousedown', listener );\n\t\t\tdocument.removeEventListener( 'touchstart', listener );\n\t\t};\n\t\t// Disable reason: `ref` is a ref object and should not be included in a\n\t\t// hook's dependency list.\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [ handler ] );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SACCC,eAAe,EACfC,MAAM,EACNC,SAAS,EACTC,QAAQ,QACF,oBAAoB;AAC3B,SAASC,SAAS,QAAQ,sBAAsB;AAChD,SAASC,WAAW,EAAEC,YAAY,EAAEC,YAAY,QAAQ,oBAAoB;AAC5E,SAASC,KAAK,QAAQ,iBAAiB;AACvC,SAASC,EAAE,EAAEC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;;AAEjD;AACA;AACA;AACA,OAAOC,kBAAkB,MAAM,yBAAyB;AACxD,OAAOC,MAAM,MAAM,WAAW;AAC9B,OAAOC,OAAO,MAAM,YAAY;AAChC,SAASC,cAAc,QAAQ,oBAAoB;AACn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ACvB;AAEA,SAASe,iBAAiBA,CACzBS,GAAmC,EACnCE,OAAwC,EACvC;EACDzE,SAAS,CAAE,MAAM;IAChB,MAAM0E,QAAQ,GAAKC,KAA8B,IAAM;MACtD;MACA,IACC,CAAEJ,GAAG,CAAChB,OAAO,IACbgB,GAAG,CAAChB,OAAO,CAACqB,QAAQ,CAAED,KAAK,CAACE,MAAe,CAAC,EAC3C;QACD;MACD;MACAJ,OAAO,CAAEE,KAAM,CAAC;IACjB,CAAC;IACDG,QAAQ,CAACC,gBAAgB,CAAE,WAAW,EAAEL,QAAS,CAAC;IAClDI,QAAQ,CAACC,gBAAgB,CAAE,YAAY,EAAEL,QAAS,CAAC;IACnD,OAAO,MAAM;MACZI,QAAQ,CAACE,mBAAmB,CAAE,WAAW,EAAEN,QAAS,CAAC;MACrDI,QAAQ,CAACE,mBAAmB,CAAE,YAAY,EAAEN,QAAS,CAAC;IACvD,CAAC;IACD;IACA;IACA;EACD,CAAC,EAAE,CAAED,OAAO,CAAG,CAAC;AACjB","ignoreList":[]}
1
+ {"version":3,"names":["clsx","useLayoutEffect","useRef","useEffect","useState","useAnchor","useDebounce","useMergeRefs","useRefEffect","speak","__","_n","sprintf","getDefaultUseItems","Button","Popover","VisuallyHidden","createPortal","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","ListBox","items","onSelect","selectedIndex","instanceId","listBoxId","className","Component","id","role","children","map","option","index","key","accessibleWhenDisabled","disabled","isDisabled","variant","undefined","onClick","label","getAutoCompleterUI","autocompleter","_autocompleter$useIte","useItems","AutocompleterUI","filterValue","onChangeOptions","onReset","reset","contentRef","popoverAnchor","editableContentElement","current","needsA11yCompat","setNeedsA11yCompat","popoverRef","popoverRefs","node","ownerDocument","useOnClickOutside","debouncedSpeak","announce","options","length","focusOnMount","onClose","placement","anchor","ref","body","handler","listener","event","contains","target","document","addEventListener","removeEventListener"],"sources":["@wordpress/components/src/autocomplete/autocompleter-ui.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseLayoutEffect,\n\tuseRef,\n\tuseEffect,\n\tuseState,\n} from '@wordpress/element';\nimport { useAnchor } from '@wordpress/rich-text';\nimport { useDebounce, useMergeRefs, useRefEffect } from '@wordpress/compose';\nimport { speak } from '@wordpress/a11y';\nimport { __, _n, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport getDefaultUseItems from './get-default-use-items';\nimport Button from '../button';\nimport Popover from '../popover';\nimport { VisuallyHidden } from '../visually-hidden';\nimport { createPortal } from 'react-dom';\nimport type { AutocompleterUIProps, KeyedOption, WPCompleter } from './types';\n\ntype ListBoxProps = {\n\titems: KeyedOption[];\n\tonSelect: ( option: KeyedOption ) => void;\n\tselectedIndex: number;\n\tinstanceId: number;\n\tlistBoxId: string | undefined;\n\tclassName?: string;\n\tComponent?: React.ElementType;\n};\n\nfunction ListBox( {\n\titems,\n\tonSelect,\n\tselectedIndex,\n\tinstanceId,\n\tlistBoxId,\n\tclassName,\n\tComponent = 'div',\n}: ListBoxProps ) {\n\treturn (\n\t\t<Component\n\t\t\tid={ listBoxId }\n\t\t\trole=\"listbox\"\n\t\t\tclassName=\"components-autocomplete__results\"\n\t\t>\n\t\t\t{ items.map( ( option, index ) => (\n\t\t\t\t<Button\n\t\t\t\t\tkey={ option.key }\n\t\t\t\t\tid={ `components-autocomplete-item-${ instanceId }-${ option.key }` }\n\t\t\t\t\trole=\"option\"\n\t\t\t\t\taria-selected={ index === selectedIndex }\n\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\tdisabled={ option.isDisabled }\n\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t'components-autocomplete__result',\n\t\t\t\t\t\tclassName,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// Unused, for backwards compatibility.\n\t\t\t\t\t\t\t'is-selected': index === selectedIndex,\n\t\t\t\t\t\t}\n\t\t\t\t\t) }\n\t\t\t\t\tvariant={ index === selectedIndex ? 'primary' : undefined }\n\t\t\t\t\tonClick={ () => onSelect( option ) }\n\t\t\t\t>\n\t\t\t\t\t{ option.label }\n\t\t\t\t</Button>\n\t\t\t) ) }\n\t\t</Component>\n\t);\n}\n\nexport function getAutoCompleterUI( autocompleter: WPCompleter ) {\n\tconst useItems =\n\t\tautocompleter.useItems ?? getDefaultUseItems( autocompleter );\n\n\tfunction AutocompleterUI( {\n\t\tfilterValue,\n\t\tinstanceId,\n\t\tlistBoxId,\n\t\tclassName,\n\t\tselectedIndex,\n\t\tonChangeOptions,\n\t\tonSelect,\n\t\tonReset,\n\t\treset,\n\t\tcontentRef,\n\t}: AutocompleterUIProps ) {\n\t\tconst [ items ] = useItems( filterValue );\n\t\tconst popoverAnchor = useAnchor( {\n\t\t\teditableContentElement: contentRef.current,\n\t\t} );\n\n\t\tconst [ needsA11yCompat, setNeedsA11yCompat ] = useState( false );\n\t\tconst popoverRef = useRef< HTMLElement >( null );\n\t\tconst popoverRefs = useMergeRefs( [\n\t\t\tpopoverRef,\n\t\t\tuseRefEffect(\n\t\t\t\t( node ) => {\n\t\t\t\t\tif ( ! contentRef.current ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// If the popover is rendered in a different document than\n\t\t\t\t\t// the content, we need to duplicate the options list in the\n\t\t\t\t\t// content document so that it's available to the screen\n\t\t\t\t\t// readers, which check the DOM ID based aria-* attributes.\n\t\t\t\t\tsetNeedsA11yCompat(\n\t\t\t\t\t\tnode.ownerDocument !== contentRef.current.ownerDocument\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t\t[ contentRef ]\n\t\t\t),\n\t\t] );\n\n\t\tuseOnClickOutside( popoverRef, reset );\n\n\t\tconst debouncedSpeak = useDebounce( speak, 500 );\n\n\t\tfunction announce( options: Array< KeyedOption > ) {\n\t\t\tif ( ! debouncedSpeak ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ( !! options.length ) {\n\t\t\t\tif ( filterValue ) {\n\t\t\t\t\tdebouncedSpeak(\n\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t/* translators: %d: number of results. */\n\t\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t\t'%d result found, use up and down arrow keys to navigate.',\n\t\t\t\t\t\t\t\t'%d results found, use up and down arrow keys to navigate.',\n\t\t\t\t\t\t\t\toptions.length\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\toptions.length\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'assertive'\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\tdebouncedSpeak(\n\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t/* translators: %d: number of results. */\n\t\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t\t'Initial %d result loaded. Type to filter all available results. Use up and down arrow keys to navigate.',\n\t\t\t\t\t\t\t\t'Initial %d results loaded. Type to filter all available results. Use up and down arrow keys to navigate.',\n\t\t\t\t\t\t\t\toptions.length\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\toptions.length\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'assertive'\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tdebouncedSpeak( __( 'No results.' ), 'assertive' );\n\t\t\t}\n\t\t}\n\n\t\tuseLayoutEffect( () => {\n\t\t\tonChangeOptions( items );\n\t\t\tannounce( items );\n\t\t\t// We want to avoid introducing unexpected side effects.\n\t\t\t// See https://github.com/WordPress/gutenberg/pull/41820\n\t\t}, [ items ] );\n\n\t\tif ( items.length === 0 ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<Popover\n\t\t\t\t\tfocusOnMount={ false }\n\t\t\t\t\tonClose={ onReset }\n\t\t\t\t\tplacement=\"top-start\"\n\t\t\t\t\tclassName=\"components-autocomplete__popover\"\n\t\t\t\t\tanchor={ popoverAnchor }\n\t\t\t\t\tref={ popoverRefs }\n\t\t\t\t>\n\t\t\t\t\t<ListBox\n\t\t\t\t\t\titems={ items }\n\t\t\t\t\t\tonSelect={ onSelect }\n\t\t\t\t\t\tselectedIndex={ selectedIndex }\n\t\t\t\t\t\tinstanceId={ instanceId }\n\t\t\t\t\t\tlistBoxId={ listBoxId }\n\t\t\t\t\t\tclassName={ className }\n\t\t\t\t\t/>\n\t\t\t\t</Popover>\n\t\t\t\t{ contentRef.current &&\n\t\t\t\t\tneedsA11yCompat &&\n\t\t\t\t\tcreatePortal(\n\t\t\t\t\t\t<ListBox\n\t\t\t\t\t\t\titems={ items }\n\t\t\t\t\t\t\tonSelect={ onSelect }\n\t\t\t\t\t\t\tselectedIndex={ selectedIndex }\n\t\t\t\t\t\t\tinstanceId={ instanceId }\n\t\t\t\t\t\t\tlistBoxId={ listBoxId }\n\t\t\t\t\t\t\tclassName={ className }\n\t\t\t\t\t\t\tComponent={ VisuallyHidden }\n\t\t\t\t\t\t/>,\n\t\t\t\t\t\tcontentRef.current.ownerDocument.body\n\t\t\t\t\t) }\n\t\t\t</>\n\t\t);\n\t}\n\n\treturn AutocompleterUI;\n}\n\nfunction useOnClickOutside(\n\tref: React.RefObject< HTMLElement >,\n\thandler: AutocompleterUIProps[ 'reset' ]\n) {\n\tuseEffect( () => {\n\t\tconst listener = ( event: MouseEvent | TouchEvent ) => {\n\t\t\t// Do nothing if clicking ref's element or descendent elements, or if the ref is not referencing an element\n\t\t\tif (\n\t\t\t\t! ref.current ||\n\t\t\t\tref.current.contains( event.target as Node )\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\thandler( event );\n\t\t};\n\t\tdocument.addEventListener( 'mousedown', listener );\n\t\tdocument.addEventListener( 'touchstart', listener );\n\t\treturn () => {\n\t\t\tdocument.removeEventListener( 'mousedown', listener );\n\t\t\tdocument.removeEventListener( 'touchstart', listener );\n\t\t};\n\t}, [ handler, ref ] );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB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;QAAW,CACvB;MAAC,CACM,CAAC,EACRyB,UAAU,CAACG,OAAO,IACnBC,eAAe,IACf1C,YAAY,cACXE,IAAA,CAACK,OAAO;QACPC,KAAK,EAAGA,KAAO;QACfC,QAAQ,EAAGA,QAAU;QACrBC,aAAa,EAAGA,aAAe;QAC/BC,UAAU,EAAGA,UAAY;QACzBC,SAAS,EAAGA,SAAW;QACvBC,SAAS,EAAGA,SAAW;QACvBC,SAAS,EAAGf;MAAgB,CAC5B,CAAC,EACFuC,UAAU,CAACG,OAAO,CAACM,aAAa,CAACW,IAClC,CAAC;IAAA,CACD,CAAC;EAEL;EAEA,OAAOzB,eAAe;AACvB;AAEA,SAASe,iBAAiBA,CACzBS,GAAmC,EACnCE,OAAwC,EACvC;EACDzE,SAAS,CAAE,MAAM;IAChB,MAAM0E,QAAQ,GAAKC,KAA8B,IAAM;MACtD;MACA,IACC,CAAEJ,GAAG,CAAChB,OAAO,IACbgB,GAAG,CAAChB,OAAO,CAACqB,QAAQ,CAAED,KAAK,CAACE,MAAe,CAAC,EAC3C;QACD;MACD;MACAJ,OAAO,CAAEE,KAAM,CAAC;IACjB,CAAC;IACDG,QAAQ,CAACC,gBAAgB,CAAE,WAAW,EAAEL,QAAS,CAAC;IAClDI,QAAQ,CAACC,gBAAgB,CAAE,YAAY,EAAEL,QAAS,CAAC;IACnD,OAAO,MAAM;MACZI,QAAQ,CAACE,mBAAmB,CAAE,WAAW,EAAEN,QAAS,CAAC;MACrDI,QAAQ,CAACE,mBAAmB,CAAE,YAAY,EAAEN,QAAS,CAAC;IACvD,CAAC;EACF,CAAC,EAAE,CAAED,OAAO,EAAEF,GAAG,CAAG,CAAC;AACtB","ignoreList":[]}
@@ -18,8 +18,7 @@ import getDefaultUseItems from './get-default-use-items';
18
18
  import styles from './style.scss';
19
19
  import Icon from '../icon';
20
20
  import { __unstableAutocompletionItemsFill as AutocompletionItemsFill } from '../mobile/autocompletion-items';
21
- import { jsx as _jsx } from "react/jsx-runtime";
22
- import { jsxs as _jsxs } from "react/jsx-runtime";
21
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
23
22
  const {
24
23
  compose: stylesCompose
25
24
  } = StyleSheet;
@@ -57,9 +56,8 @@ export function getAutoCompleterUI(autocompleter) {
57
56
  } else if (isVisible && text.length === 0) {
58
57
  startAnimation(false);
59
58
  }
60
- // Temporarily disabling exhaustive-deps to avoid introducing unexpected side effecst.
59
+ // We want to avoid introducing unexpected side effects.
61
60
  // See https://github.com/WordPress/gutenberg/pull/41820
62
- // eslint-disable-next-line react-hooks/exhaustive-deps
63
61
  }, [items, isVisible, text]);
64
62
  const activeItemStyles = usePreferredColorSchemeStyle(styles['components-autocomplete__item-active'], styles['components-autocomplete__item-active-dark']);
65
63
  const iconStyles = usePreferredColorSchemeStyle(styles['components-autocomplete__icon'], styles['components-autocomplete__icon-active-dark']);
@@ -80,9 +78,8 @@ export function getAutoCompleterUI(autocompleter) {
80
78
  }
81
79
  });
82
80
  },
83
- // Temporarily disabling exhaustive-deps to avoid introducing unexpected side effecst.
81
+ // We want to avoid introducing unexpected side effects.
84
82
  // See https://github.com/WordPress/gutenberg/pull/41820
85
- // eslint-disable-next-line react-hooks/exhaustive-deps
86
83
  [isVisible]);
87
84
  const contentStyles = {
88
85
  transform: [{
@@ -1 +1 @@
1
- {"version":3,"names":["View","Animated","StyleSheet","Text","TouchableOpacity","ScrollView","useLayoutEffect","useEffect","useRef","useState","useCallback","__","sprintf","usePreferredColorSchemeStyle","BackgroundView","getDefaultUseItems","styles","Icon","__unstableAutocompletionItemsFill","AutocompletionItemsFill","jsx","_jsx","jsxs","_jsxs","compose","stylesCompose","getAutoCompleterUI","autocompleter","useItems","AutocompleterUI","filterValue","selectedIndex","onChangeOptions","onSelect","value","reset","items","filteredItems","filter","item","isDisabled","scrollViewRef","animationValue","Value","current","isVisible","setIsVisible","text","length","scrollTo","x","animated","startAnimation","activeItemStyles","iconStyles","activeIconStyles","textStyles","activeTextStyles","show","timing","toValue","duration","useNativeDriver","start","finished","contentStyles","transform","translateY","interpolate","inputRange","outputRange","height","children","style","testID","ref","horizontal","contentContainerStyle","showsHorizontalScrollIndicator","keyboardShouldPersistTaps","accessibilityLabel","map","option","index","isActive","itemStyle","textStyle","iconStyle","iconSource","icon","src","activeOpacity","onPress","title","size"],"sources":["@wordpress/components/src/autocomplete/autocompleter-ui.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport {\n\tView,\n\tAnimated,\n\tStyleSheet,\n\tText,\n\tTouchableOpacity,\n\tScrollView,\n} from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseLayoutEffect,\n\tuseEffect,\n\tuseRef,\n\tuseState,\n\tuseCallback,\n} from '@wordpress/element';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { usePreferredColorSchemeStyle } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport BackgroundView from './background-view';\nimport getDefaultUseItems from './get-default-use-items';\nimport styles from './style.scss';\nimport Icon from '../icon';\nimport { __unstableAutocompletionItemsFill as AutocompletionItemsFill } from '../mobile/autocompletion-items';\n\nconst { compose: stylesCompose } = StyleSheet;\n\nexport function getAutoCompleterUI( autocompleter ) {\n\tconst useItems = autocompleter.useItems\n\t\t? autocompleter.useItems\n\t\t: getDefaultUseItems( autocompleter );\n\n\tfunction AutocompleterUI( {\n\t\tfilterValue,\n\t\tselectedIndex,\n\t\tonChangeOptions,\n\t\tonSelect,\n\t\tvalue,\n\t\treset,\n\t} ) {\n\t\tconst [ items ] = useItems( filterValue );\n\t\tconst filteredItems = items.filter( ( item ) => ! item.isDisabled );\n\t\tconst scrollViewRef = useRef();\n\t\tconst animationValue = useRef( new Animated.Value( 0 ) ).current;\n\t\tconst [ isVisible, setIsVisible ] = useState( false );\n\t\tconst { text } = value;\n\n\t\tuseEffect( () => {\n\t\t\tif ( ! isVisible && text.length > 0 ) {\n\t\t\t\tsetIsVisible( true );\n\t\t\t}\n\t\t}, [ isVisible, text ] );\n\n\t\tuseLayoutEffect( () => {\n\t\t\tonChangeOptions( items );\n\t\t\tscrollViewRef.current?.scrollTo( { x: 0, animated: false } );\n\n\t\t\tif ( isVisible && text.length > 0 ) {\n\t\t\t\tstartAnimation( true );\n\t\t\t} else if ( isVisible && text.length === 0 ) {\n\t\t\t\tstartAnimation( false );\n\t\t\t}\n\t\t\t// Temporarily disabling exhaustive-deps to avoid introducing unexpected side effecst.\n\t\t\t// See https://github.com/WordPress/gutenberg/pull/41820\n\t\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t}, [ items, isVisible, text ] );\n\n\t\tconst activeItemStyles = usePreferredColorSchemeStyle(\n\t\t\tstyles[ 'components-autocomplete__item-active' ],\n\t\t\tstyles[ 'components-autocomplete__item-active-dark' ]\n\t\t);\n\n\t\tconst iconStyles = usePreferredColorSchemeStyle(\n\t\t\tstyles[ 'components-autocomplete__icon' ],\n\t\t\tstyles[ 'components-autocomplete__icon-active-dark' ]\n\t\t);\n\n\t\tconst activeIconStyles = usePreferredColorSchemeStyle(\n\t\t\tstyles[ 'components-autocomplete__icon-active ' ],\n\t\t\tstyles[ 'components-autocomplete__icon-active-dark' ]\n\t\t);\n\n\t\tconst textStyles = usePreferredColorSchemeStyle(\n\t\t\tstyles[ 'components-autocomplete__text' ],\n\t\t\tstyles[ 'components-autocomplete__text-dark' ]\n\t\t);\n\n\t\tconst activeTextStyles = usePreferredColorSchemeStyle(\n\t\t\tstyles[ 'components-autocomplete__text-active' ],\n\t\t\tstyles[ 'components-autocomplete__text-active-dark' ]\n\t\t);\n\n\t\tconst startAnimation = useCallback(\n\t\t\t( show ) => {\n\t\t\t\tAnimated.timing( animationValue, {\n\t\t\t\t\ttoValue: show ? 1 : 0,\n\t\t\t\t\tduration: show ? 200 : 100,\n\t\t\t\t\tuseNativeDriver: true,\n\t\t\t\t} ).start( ( { finished } ) => {\n\t\t\t\t\tif ( finished && ! show && isVisible ) {\n\t\t\t\t\t\tsetIsVisible( false );\n\t\t\t\t\t\treset();\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t},\n\t\t\t// Temporarily disabling exhaustive-deps to avoid introducing unexpected side effecst.\n\t\t\t// See https://github.com/WordPress/gutenberg/pull/41820\n\t\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t\t[ isVisible ]\n\t\t);\n\n\t\tconst contentStyles = {\n\t\t\ttransform: [\n\t\t\t\t{\n\t\t\t\t\ttranslateY: animationValue.interpolate( {\n\t\t\t\t\t\tinputRange: [ 0, 1 ],\n\t\t\t\t\t\toutputRange: [\n\t\t\t\t\t\t\tstyles[ 'components-autocomplete' ].height,\n\t\t\t\t\t\t\t0,\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\n\t\tif ( ! filteredItems.length > 0 || ! isVisible ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn (\n\t\t\t<AutocompletionItemsFill>\n\t\t\t\t<View style={ styles[ 'components-autocomplete' ] }>\n\t\t\t\t\t<Animated.View style={ contentStyles }>\n\t\t\t\t\t\t<BackgroundView>\n\t\t\t\t\t\t\t<ScrollView\n\t\t\t\t\t\t\t\ttestID=\"autocompleter\"\n\t\t\t\t\t\t\t\tref={ scrollViewRef }\n\t\t\t\t\t\t\t\thorizontal\n\t\t\t\t\t\t\t\tcontentContainerStyle={\n\t\t\t\t\t\t\t\t\tstyles[ 'components-autocomplete__content' ]\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tshowsHorizontalScrollIndicator={ false }\n\t\t\t\t\t\t\t\tkeyboardShouldPersistTaps=\"always\"\n\t\t\t\t\t\t\t\taccessibilityLabel={\n\t\t\t\t\t\t\t\t\t// translators: Slash inserter autocomplete results\n\t\t\t\t\t\t\t\t\t__( 'Slash inserter results' )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ filteredItems.map( ( option, index ) => {\n\t\t\t\t\t\t\t\t\tconst isActive = index === selectedIndex;\n\t\t\t\t\t\t\t\t\tconst itemStyle = stylesCompose(\n\t\t\t\t\t\t\t\t\t\tstyles[\n\t\t\t\t\t\t\t\t\t\t\t'components-autocomplete__item'\n\t\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t\t\tisActive && activeItemStyles\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\tconst textStyle = stylesCompose(\n\t\t\t\t\t\t\t\t\t\ttextStyles,\n\t\t\t\t\t\t\t\t\t\tisActive && activeTextStyles\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\tconst iconStyle = stylesCompose(\n\t\t\t\t\t\t\t\t\t\ticonStyles,\n\t\t\t\t\t\t\t\t\t\tisActive && activeIconStyles\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\tconst iconSource =\n\t\t\t\t\t\t\t\t\t\toption?.value?.icon?.src ||\n\t\t\t\t\t\t\t\t\t\toption?.value?.icon;\n\n\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t<TouchableOpacity\n\t\t\t\t\t\t\t\t\t\t\tactiveOpacity={ 0.5 }\n\t\t\t\t\t\t\t\t\t\t\tstyle={ itemStyle }\n\t\t\t\t\t\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\t\t\t\t\t\tonPress={ () => onSelect( option ) }\n\t\t\t\t\t\t\t\t\t\t\taccessibilityLabel={ sprintf(\n\t\t\t\t\t\t\t\t\t\t\t\t// translators: %s: Block name e.g. \"Image block\"\n\t\t\t\t\t\t\t\t\t\t\t\t__( '%s block' ),\n\t\t\t\t\t\t\t\t\t\t\t\toption?.value?.title\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t<View\n\t\t\t\t\t\t\t\t\t\t\t\tstyle={\n\t\t\t\t\t\t\t\t\t\t\t\t\tstyles[\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'components-autocomplete__icon'\n\t\t\t\t\t\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\t\t\t\t\t\t\ticon={ iconSource }\n\t\t\t\t\t\t\t\t\t\t\t\t\tsize={ 24 }\n\t\t\t\t\t\t\t\t\t\t\t\t\tstyle={ iconStyle }\n\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t</View>\n\t\t\t\t\t\t\t\t\t\t\t<Text style={ textStyle }>\n\t\t\t\t\t\t\t\t\t\t\t\t{ option?.value?.title }\n\t\t\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t\t\t</TouchableOpacity>\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t\t</ScrollView>\n\t\t\t\t\t\t</BackgroundView>\n\t\t\t\t\t</Animated.View>\n\t\t\t\t</View>\n\t\t\t</AutocompletionItemsFill>\n\t\t);\n\t}\n\n\treturn AutocompleterUI;\n}\n\nexport default getAutoCompleterUI;\n"],"mappings":"AAAA;AACA;AACA;AACA,SACCA,IAAI,EACJC,QAAQ,EACRC,UAAU,EACVC,IAAI,EACJC,gBAAgB,EAChBC,UAAU,QACJ,cAAc;;AAErB;AACA;AACA;AACA,SACCC,eAAe,EACfC,SAAS,EACTC,MAAM,EACNC,QAAQ,EACRC,WAAW,QACL,oBAAoB;AAC3B,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,4BAA4B,QAAQ,oBAAoB;;AAEjE;AACA;AACA;AACA,OAAOC,cAAc,MAAM,mBAAmB;AAC9C,OAAOC,kBAAkB,MAAM,yBAAyB;AACxD,OAAOC,MAAM,MAAM,cAAc;AACjC,OAAOC,IAAI,MAAM,SAAS;AAC1B,SAASC,iCAAiC,IAAIC,uBAAuB,QA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B,UAAU,EACV4B,QAAQ,IAAI3B,gBACb,CAAC;gBACD,MAAM8B,SAAS,GAAG9D,aAAa,CAC9B6B,UAAU,EACV8B,QAAQ,IAAI7B,gBACb,CAAC;gBACD,MAAMiC,UAAU,GACfN,MAAM,EAAEhD,KAAK,EAAEuD,IAAI,EAAEC,GAAG,IACxBR,MAAM,EAAEhD,KAAK,EAAEuD,IAAI;gBAEpB,oBACClE,KAAA,CAACnB,gBAAgB;kBAChBuF,aAAa,EAAG,GAAK;kBACrBlB,KAAK,EAAGY,SAAW;kBAEnBO,OAAO,EAAGA,CAAA,KAAM3D,QAAQ,CAAEiD,MAAO,CAAG;kBACpCF,kBAAkB,EAAGpE,OAAO;kBAC3B;kBACAD,EAAE,CAAE,UAAW,CAAC,EAChBuE,MAAM,EAAEhD,KAAK,EAAE2D,KAChB,CAAG;kBAAArB,QAAA,gBAEHnD,IAAA,CAACrB,IAAI;oBACJyE,KAAK,EACJzD,MAAM,CACL,+BAA+B,CAEhC;oBAAAwD,QAAA,eAEDnD,IAAA,CAACJ,IAAI;sBACJwE,IAAI,EAAGD,UAAY;sBACnBM,IAAI,EAAG,EAAI;sBACXrB,KAAK,EAAGc;oBAAW,CACnB;kBAAC,CACG,CAAC,eACPlE,IAAA,CAAClB,IAAI;oBAACsE,KAAK,EAAGa,SAAW;oBAAAd,QAAA,EACtBU,MAAM,EAAEhD,KAAK,EAAE2D;kBAAK,CACjB,CAAC;gBAAA,GAvBDV,KAwBW,CAAC;cAErB,CAAE;YAAC,CACQ;UAAC,CACE;QAAC,CACH;MAAC,CACX;IAAC,CACiB,CAAC;EAE5B;EAEA,OAAOtD,eAAe;AACvB;AAEA,eAAeH,kBAAkB","ignoreList":[]}
1
+ {"version":3,"names":["View","Animated","StyleSheet","Text","TouchableOpacity","ScrollView","useLayoutEffect","useEffect","useRef","useState","useCallback","__","sprintf","usePreferredColorSchemeStyle","BackgroundView","getDefaultUseItems","styles","Icon","__unstableAutocompletionItemsFill","AutocompletionItemsFill","jsx","_jsx","jsxs","_jsxs","compose","stylesCompose","getAutoCompleterUI","autocompleter","useItems","AutocompleterUI","filterValue","selectedIndex","onChangeOptions","onSelect","value","reset","items","filteredItems","filter","item","isDisabled","scrollViewRef","animationValue","Value","current","isVisible","setIsVisible","text","length","scrollTo","x","animated","startAnimation","activeItemStyles","iconStyles","activeIconStyles","textStyles","activeTextStyles","show","timing","toValue","duration","useNativeDriver","start","finished","contentStyles","transform","translateY","interpolate","inputRange","outputRange","height","children","style","testID","ref","horizontal","contentContainerStyle","showsHorizontalScrollIndicator","keyboardShouldPersistTaps","accessibilityLabel","map","option","index","isActive","itemStyle","textStyle","iconStyle","iconSource","icon","src","activeOpacity","onPress","title","size"],"sources":["@wordpress/components/src/autocomplete/autocompleter-ui.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport {\n\tView,\n\tAnimated,\n\tStyleSheet,\n\tText,\n\tTouchableOpacity,\n\tScrollView,\n} from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseLayoutEffect,\n\tuseEffect,\n\tuseRef,\n\tuseState,\n\tuseCallback,\n} from '@wordpress/element';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { usePreferredColorSchemeStyle } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport BackgroundView from './background-view';\nimport getDefaultUseItems from './get-default-use-items';\nimport styles from './style.scss';\nimport Icon from '../icon';\nimport { __unstableAutocompletionItemsFill as AutocompletionItemsFill } from '../mobile/autocompletion-items';\n\nconst { compose: stylesCompose } = StyleSheet;\n\nexport function getAutoCompleterUI( autocompleter ) {\n\tconst useItems = autocompleter.useItems\n\t\t? autocompleter.useItems\n\t\t: getDefaultUseItems( autocompleter );\n\n\tfunction AutocompleterUI( {\n\t\tfilterValue,\n\t\tselectedIndex,\n\t\tonChangeOptions,\n\t\tonSelect,\n\t\tvalue,\n\t\treset,\n\t} ) {\n\t\tconst [ items ] = useItems( filterValue );\n\t\tconst filteredItems = items.filter( ( item ) => ! item.isDisabled );\n\t\tconst scrollViewRef = useRef();\n\t\tconst animationValue = useRef( new Animated.Value( 0 ) ).current;\n\t\tconst [ isVisible, setIsVisible ] = useState( false );\n\t\tconst { text } = value;\n\n\t\tuseEffect( () => {\n\t\t\tif ( ! isVisible && text.length > 0 ) {\n\t\t\t\tsetIsVisible( true );\n\t\t\t}\n\t\t}, [ isVisible, text ] );\n\n\t\tuseLayoutEffect( () => {\n\t\t\tonChangeOptions( items );\n\t\t\tscrollViewRef.current?.scrollTo( { x: 0, animated: false } );\n\n\t\t\tif ( isVisible && text.length > 0 ) {\n\t\t\t\tstartAnimation( true );\n\t\t\t} else if ( isVisible && text.length === 0 ) {\n\t\t\t\tstartAnimation( false );\n\t\t\t}\n\t\t\t// We want to avoid introducing unexpected side effects.\n\t\t\t// See https://github.com/WordPress/gutenberg/pull/41820\n\t\t}, [ items, isVisible, text ] );\n\n\t\tconst activeItemStyles = usePreferredColorSchemeStyle(\n\t\t\tstyles[ 'components-autocomplete__item-active' ],\n\t\t\tstyles[ 'components-autocomplete__item-active-dark' ]\n\t\t);\n\n\t\tconst iconStyles = usePreferredColorSchemeStyle(\n\t\t\tstyles[ 'components-autocomplete__icon' ],\n\t\t\tstyles[ 'components-autocomplete__icon-active-dark' ]\n\t\t);\n\n\t\tconst activeIconStyles = usePreferredColorSchemeStyle(\n\t\t\tstyles[ 'components-autocomplete__icon-active ' ],\n\t\t\tstyles[ 'components-autocomplete__icon-active-dark' ]\n\t\t);\n\n\t\tconst textStyles = usePreferredColorSchemeStyle(\n\t\t\tstyles[ 'components-autocomplete__text' ],\n\t\t\tstyles[ 'components-autocomplete__text-dark' ]\n\t\t);\n\n\t\tconst activeTextStyles = usePreferredColorSchemeStyle(\n\t\t\tstyles[ 'components-autocomplete__text-active' ],\n\t\t\tstyles[ 'components-autocomplete__text-active-dark' ]\n\t\t);\n\n\t\tconst startAnimation = useCallback(\n\t\t\t( show ) => {\n\t\t\t\tAnimated.timing( animationValue, {\n\t\t\t\t\ttoValue: show ? 1 : 0,\n\t\t\t\t\tduration: show ? 200 : 100,\n\t\t\t\t\tuseNativeDriver: true,\n\t\t\t\t} ).start( ( { finished } ) => {\n\t\t\t\t\tif ( finished && ! show && isVisible ) {\n\t\t\t\t\t\tsetIsVisible( false );\n\t\t\t\t\t\treset();\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t},\n\t\t\t// We want to avoid introducing unexpected side effects.\n\t\t\t// See https://github.com/WordPress/gutenberg/pull/41820\n\t\t\t[ isVisible ]\n\t\t);\n\n\t\tconst contentStyles = {\n\t\t\ttransform: [\n\t\t\t\t{\n\t\t\t\t\ttranslateY: animationValue.interpolate( {\n\t\t\t\t\t\tinputRange: [ 0, 1 ],\n\t\t\t\t\t\toutputRange: [\n\t\t\t\t\t\t\tstyles[ 'components-autocomplete' ].height,\n\t\t\t\t\t\t\t0,\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\n\t\tif ( ! filteredItems.length > 0 || ! isVisible ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn (\n\t\t\t<AutocompletionItemsFill>\n\t\t\t\t<View style={ styles[ 'components-autocomplete' ] }>\n\t\t\t\t\t<Animated.View style={ contentStyles }>\n\t\t\t\t\t\t<BackgroundView>\n\t\t\t\t\t\t\t<ScrollView\n\t\t\t\t\t\t\t\ttestID=\"autocompleter\"\n\t\t\t\t\t\t\t\tref={ scrollViewRef }\n\t\t\t\t\t\t\t\thorizontal\n\t\t\t\t\t\t\t\tcontentContainerStyle={\n\t\t\t\t\t\t\t\t\tstyles[ 'components-autocomplete__content' ]\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tshowsHorizontalScrollIndicator={ false }\n\t\t\t\t\t\t\t\tkeyboardShouldPersistTaps=\"always\"\n\t\t\t\t\t\t\t\taccessibilityLabel={\n\t\t\t\t\t\t\t\t\t// translators: Slash inserter autocomplete results\n\t\t\t\t\t\t\t\t\t__( 'Slash inserter results' )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ filteredItems.map( ( option, index ) => {\n\t\t\t\t\t\t\t\t\tconst isActive = index === selectedIndex;\n\t\t\t\t\t\t\t\t\tconst itemStyle = stylesCompose(\n\t\t\t\t\t\t\t\t\t\tstyles[\n\t\t\t\t\t\t\t\t\t\t\t'components-autocomplete__item'\n\t\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t\t\tisActive && activeItemStyles\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\tconst textStyle = stylesCompose(\n\t\t\t\t\t\t\t\t\t\ttextStyles,\n\t\t\t\t\t\t\t\t\t\tisActive && activeTextStyles\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\tconst iconStyle = stylesCompose(\n\t\t\t\t\t\t\t\t\t\ticonStyles,\n\t\t\t\t\t\t\t\t\t\tisActive && activeIconStyles\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\tconst iconSource =\n\t\t\t\t\t\t\t\t\t\toption?.value?.icon?.src ||\n\t\t\t\t\t\t\t\t\t\toption?.value?.icon;\n\n\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t<TouchableOpacity\n\t\t\t\t\t\t\t\t\t\t\tactiveOpacity={ 0.5 }\n\t\t\t\t\t\t\t\t\t\t\tstyle={ itemStyle }\n\t\t\t\t\t\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\t\t\t\t\t\tonPress={ () => onSelect( option ) }\n\t\t\t\t\t\t\t\t\t\t\taccessibilityLabel={ sprintf(\n\t\t\t\t\t\t\t\t\t\t\t\t// translators: %s: Block name e.g. \"Image block\"\n\t\t\t\t\t\t\t\t\t\t\t\t__( '%s block' ),\n\t\t\t\t\t\t\t\t\t\t\t\toption?.value?.title\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t<View\n\t\t\t\t\t\t\t\t\t\t\t\tstyle={\n\t\t\t\t\t\t\t\t\t\t\t\t\tstyles[\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'components-autocomplete__icon'\n\t\t\t\t\t\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\t\t\t\t\t\t\ticon={ iconSource }\n\t\t\t\t\t\t\t\t\t\t\t\t\tsize={ 24 }\n\t\t\t\t\t\t\t\t\t\t\t\t\tstyle={ iconStyle }\n\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t</View>\n\t\t\t\t\t\t\t\t\t\t\t<Text style={ textStyle }>\n\t\t\t\t\t\t\t\t\t\t\t\t{ option?.value?.title }\n\t\t\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t\t\t</TouchableOpacity>\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t\t</ScrollView>\n\t\t\t\t\t\t</BackgroundView>\n\t\t\t\t\t</Animated.View>\n\t\t\t\t</View>\n\t\t\t</AutocompletionItemsFill>\n\t\t);\n\t}\n\n\treturn AutocompleterUI;\n}\n\nexport default getAutoCompleterUI;\n"],"mappings":"AAAA;AACA;AACA;AACA,SACCA,IAAI,EACJC,QAAQ,EACRC,UAAU,EACVC,IAAI,EACJC,gBAAgB,EAChBC,UAAU,QACJ,cAAc;;AAErB;AACA;AACA;AACA,SACCC,eAAe,EACfC,SAAS,EACTC,MAAM,EACNC,QAAQ,EACRC,WAAW,QACL,oBAAoB;AAC3B,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,4BAA4B,QAAQ,oBAAoB;;AAEjE;AACA;AACA;AACA,OAAOC,cAAc,MAAM,mBAAmB;AAC9C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useState","escapeRegExp","filterOptions","search","options","maxResults","filtered","i","length","option","keywords","label","isMatch","some","keyword","test","push","getDefaultUseItems","autocompleter","filterValue","items","setItems","isDebounced","loadOptions","promise","Promise","resolve","then","optionsData","canceled","keyedOptions","map","optionData","optionIndex","key","name","value","getOptionLabel","getOptionKeywords","isDisabled","isOptionDisabled","RegExp","cancel"],"sources":["@wordpress/components/src/autocomplete/get-default-use-items.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport removeAccents from 'remove-accents';\n\n/**\n * WordPress dependencies\n */\nimport { debounce } from '@wordpress/compose';\nimport { useLayoutEffect, useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { escapeRegExp } from '../utils/strings';\nimport type { CancelablePromise, KeyedOption, WPCompleter } from './types';\n\nfunction filterOptions(\n\tsearch: RegExp,\n\toptions: Array< KeyedOption > = [],\n\tmaxResults = 10\n) {\n\tconst filtered = [];\n\tfor ( let i = 0; i < options.length; i++ ) {\n\t\tconst option = options[ i ];\n\n\t\t// Merge label into keywords.\n\t\tlet { keywords = [] } = option;\n\t\tif ( 'string' === typeof option.label ) {\n\t\t\tkeywords = [ ...keywords, option.label ];\n\t\t}\n\n\t\tconst isMatch = keywords.some( ( keyword ) =>\n\t\t\tsearch.test( removeAccents( keyword ) )\n\t\t);\n\t\tif ( ! isMatch ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tfiltered.push( option );\n\n\t\t// Abort early if max reached.\n\t\tif ( filtered.length === maxResults ) {\n\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn filtered;\n}\n\nexport default function getDefaultUseItems( autocompleter: WPCompleter ) {\n\treturn ( filterValue: string ) => {\n\t\tconst [ items, setItems ] = useState< Array< KeyedOption > >( [] );\n\t\t/*\n\t\t * We support both synchronous and asynchronous retrieval of completer options\n\t\t * but internally treat all as async so we maintain a single, consistent code path.\n\t\t *\n\t\t * Because networks can be slow, and the internet is wonderfully unpredictable,\n\t\t * we don't want two promises updating the state at once. This ensures that only\n\t\t * the most recent promise will act on `optionsData`. This doesn't use the state\n\t\t * because `setState` is batched, and so there's no guarantee that setting\n\t\t * `activePromise` in the state would result in it actually being in `this.state`\n\t\t * before the promise resolves and we check to see if this is the active promise or not.\n\t\t */\n\t\tuseLayoutEffect( () => {\n\t\t\tconst { options, isDebounced } = autocompleter;\n\t\t\tconst loadOptions = debounce(\n\t\t\t\t() => {\n\t\t\t\t\tconst promise: CancelablePromise = Promise.resolve(\n\t\t\t\t\t\ttypeof options === 'function'\n\t\t\t\t\t\t\t? options( filterValue )\n\t\t\t\t\t\t\t: options\n\t\t\t\t\t).then( ( optionsData ) => {\n\t\t\t\t\t\tif ( promise.canceled ) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst keyedOptions = optionsData.map(\n\t\t\t\t\t\t\t( optionData, optionIndex ) => ( {\n\t\t\t\t\t\t\t\tkey: `${ autocompleter.name }-${ optionIndex }`,\n\t\t\t\t\t\t\t\tvalue: optionData,\n\t\t\t\t\t\t\t\tlabel: autocompleter.getOptionLabel(\n\t\t\t\t\t\t\t\t\toptionData\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tkeywords: autocompleter.getOptionKeywords\n\t\t\t\t\t\t\t\t\t? autocompleter.getOptionKeywords(\n\t\t\t\t\t\t\t\t\t\t\toptionData\n\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t: [],\n\t\t\t\t\t\t\t\tisDisabled: autocompleter.isOptionDisabled\n\t\t\t\t\t\t\t\t\t? autocompleter.isOptionDisabled(\n\t\t\t\t\t\t\t\t\t\t\toptionData\n\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t: false,\n\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t// Create a regular expression to filter the options.\n\t\t\t\t\t\tconst search = new RegExp(\n\t\t\t\t\t\t\t'(?:\\\\b|\\\\s|^)' + escapeRegExp( filterValue ),\n\t\t\t\t\t\t\t'i'\n\t\t\t\t\t\t);\n\t\t\t\t\t\tsetItems( filterOptions( search, keyedOptions ) );\n\t\t\t\t\t} );\n\n\t\t\t\t\treturn promise;\n\t\t\t\t},\n\t\t\t\tisDebounced ? 250 : 0\n\t\t\t);\n\n\t\t\tconst promise = loadOptions();\n\n\t\t\treturn () => {\n\t\t\t\tloadOptions.cancel();\n\t\t\t\tif ( promise ) {\n\t\t\t\t\tpromise.canceled = true;\n\t\t\t\t}\n\t\t\t};\n\t\t}, [ filterValue ] );\n\n\t\treturn [ items ] as const;\n\t};\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,aAAa,MAAM,gBAAgB;;AAE1C;AACA;AACA;AACA,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,eAAe,EAAEC,QAAQ,QAAQ,oBAAoB;;AAE9D;AACA;AACA;AACA,SAASC,YAAY,QAAQ,kBAAkB;AAG/C,SAASC,aAAaA,CACrBC,MAAc,EACdC,OAA6B,GAAG,EAAE,EAClCC,UAAU,GAAG,EAAE,EACd;EACD,MAAMC,QAAQ,GAAG,EAAE;EACnB,KAAM,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGH,OAAO,CAACI,MAAM,EAAED,CAAC,EAAE,EAAG;IAC1C,MAAME,MAAM,GAAGL,OAAO,CAAEG,CAAC,CAAE;;IAE3B;IACA,IAAI;MAAEG,QAAQ,GAAG;IAAG,CAAC,GAAGD,MAAM;IAC9B,IAAK,QAAQ,KAAK,OAAOA,MAAM,CAACE,KAAK,EAAG;MACvCD,QAAQ,GAAG,CAAE,GAAGA,QAAQ,EAAED,MAAM,CAACE,KAAK,CAAE;IACzC;IAEA,MAAMC,OAAO,GAAGF,QAAQ,CAACG,IAAI,CAAIC,OAAO,IACvCX,MAAM,CAACY,IAAI,CAAElB,aAAa,CAAEiB,OAAQ,CAAE,CACvC,CAAC;IACD,IAAK,CAAEF,OAAO,EAAG;MAChB;IACD;IAEAN,QAAQ,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Y,CAAC,EAC7C,GACD,CAAC;UACDE,QAAQ,CAAEnB,aAAa,CAAEC,MAAM,EAAE2B,YAAa,CAAE,CAAC;QAClD,CAAE,CAAC;QAEH,OAAON,OAAO;MACf,CAAC,EACDF,WAAW,GAAG,GAAG,GAAG,CACrB,CAAC;MAED,MAAME,OAAO,GAAGD,WAAW,CAAC,CAAC;MAE7B,OAAO,MAAM;QACZA,WAAW,CAACmB,MAAM,CAAC,CAAC;QACpB,IAAKlB,OAAO,EAAG;UACdA,OAAO,CAACK,QAAQ,GAAG,IAAI;QACxB;MACD,CAAC;IACF,CAAC,EAAE,CAAEV,WAAW,CAAG,CAAC;IAEpB,OAAO,CAAEC,KAAK,CAAE;EACjB,CAAC;AACF","ignoreList":[]}
1
+ {"version":3,"names":["removeAccents","debounce","useLayoutEffect","useState","escapeRegExp","filterOptions","search","options","maxResults","filtered","i","length","option","keywords","label","isMatch","some","keyword","test","push","getDefaultUseItems","autocompleter","filterValue","items","setItems","isDebounced","loadOptions","promise","Promise","resolve","then","optionsData","canceled","keyedOptions","map","optionData","optionIndex","key","name","value","getOptionLabel","getOptionKeywords","isDisabled","isOptionDisabled","RegExp","cancel"],"sources":["@wordpress/components/src/autocomplete/get-default-use-items.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport removeAccents from 'remove-accents';\n\n/**\n * WordPress dependencies\n */\nimport { debounce } from '@wordpress/compose';\nimport { useLayoutEffect, useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { escapeRegExp } from '../utils/strings';\nimport type { CancelablePromise, KeyedOption, WPCompleter } from './types';\n\nfunction filterOptions(\n\tsearch: RegExp,\n\toptions: Array< KeyedOption > = [],\n\tmaxResults = 10\n) {\n\tconst filtered = [];\n\tfor ( let i = 0; i < options.length; i++ ) {\n\t\tconst option = options[ i ];\n\n\t\t// Merge label into keywords.\n\t\tlet { keywords = [] } = option;\n\t\tif ( 'string' === typeof option.label ) {\n\t\t\tkeywords = [ ...keywords, option.label ];\n\t\t}\n\n\t\tconst isMatch = keywords.some( ( keyword ) =>\n\t\t\tsearch.test( removeAccents( keyword ) )\n\t\t);\n\t\tif ( ! isMatch ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tfiltered.push( option );\n\n\t\t// Abort early if max reached.\n\t\tif ( filtered.length === maxResults ) {\n\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn filtered;\n}\n\nexport default function getDefaultUseItems( autocompleter: WPCompleter ) {\n\treturn ( filterValue: string ) => {\n\t\tconst [ items, setItems ] = useState< Array< KeyedOption > >( [] );\n\t\t/*\n\t\t * We support both synchronous and asynchronous retrieval of completer options\n\t\t * but internally treat all as async so we maintain a single, consistent code path.\n\t\t *\n\t\t * Because networks can be slow, and the internet is wonderfully unpredictable,\n\t\t * we don't want two promises updating the state at once. This ensures that only\n\t\t * the most recent promise will act on `optionsData`. This doesn't use the state\n\t\t * because `setState` is batched, and so there's no guarantee that setting\n\t\t * `activePromise` in the state would result in it actually being in `this.state`\n\t\t * before the promise resolves and we check to see if this is the active promise or not.\n\t\t */\n\t\tuseLayoutEffect( () => {\n\t\t\tconst { options, isDebounced } = autocompleter;\n\t\t\tconst loadOptions = debounce(\n\t\t\t\t() => {\n\t\t\t\t\tconst promise: CancelablePromise = Promise.resolve(\n\t\t\t\t\t\ttypeof options === 'function'\n\t\t\t\t\t\t\t? options( filterValue )\n\t\t\t\t\t\t\t: options\n\t\t\t\t\t).then( ( optionsData ) => {\n\t\t\t\t\t\tif ( promise.canceled ) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst keyedOptions = optionsData.map(\n\t\t\t\t\t\t\t( optionData, optionIndex ) => ( {\n\t\t\t\t\t\t\t\tkey: `${ autocompleter.name }-${ optionIndex }`,\n\t\t\t\t\t\t\t\tvalue: optionData,\n\t\t\t\t\t\t\t\tlabel: autocompleter.getOptionLabel(\n\t\t\t\t\t\t\t\t\toptionData\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tkeywords: autocompleter.getOptionKeywords\n\t\t\t\t\t\t\t\t\t? autocompleter.getOptionKeywords(\n\t\t\t\t\t\t\t\t\t\t\toptionData\n\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t: [],\n\t\t\t\t\t\t\t\tisDisabled: autocompleter.isOptionDisabled\n\t\t\t\t\t\t\t\t\t? autocompleter.isOptionDisabled(\n\t\t\t\t\t\t\t\t\t\t\toptionData\n\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t: false,\n\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t// Create a regular expression to filter the options.\n\t\t\t\t\t\tconst search = new RegExp(\n\t\t\t\t\t\t\t'(?:\\\\b|\\\\s|^)' + escapeRegExp( filterValue ),\n\t\t\t\t\t\t\t'i'\n\t\t\t\t\t\t);\n\t\t\t\t\t\tsetItems( filterOptions( search, keyedOptions ) );\n\t\t\t\t\t} );\n\n\t\t\t\t\treturn promise;\n\t\t\t\t},\n\t\t\t\tisDebounced ? 250 : 0\n\t\t\t);\n\n\t\t\tconst promise = loadOptions();\n\n\t\t\treturn () => {\n\t\t\t\tloadOptions.cancel();\n\t\t\t\tif ( promise ) {\n\t\t\t\t\tpromise.canceled = true;\n\t\t\t\t}\n\t\t\t};\n\t\t}, [ filterValue ] );\n\n\t\treturn [ items ] as const;\n\t};\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,aAAa,MAAM,gBAAgB;;AAE1C;AACA;AACA;AACA,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,eAAe,EAAEC,QAAQ,QAAQ,oBAAoB;;AAE9D;AACA;AACA;AACA,SAASC,YAAY,QAAQ,kBAAkB;AAG/C,SAASC,aAAaA,CACrBC,MAAc,EACdC,OAA6B,GAAG,EAAE,EAClCC,UAAU,GAAG,EAAE,EACd;EACD,MAAMC,QAAQ,GAAG,EAAE;EACnB,KAAM,IAAIC,CAAC,GAAG,C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AAG,CACnC,CAAEC,UAAU,EAAEC,WAAW,MAAQ;YAChCC,GAAG,EAAE,GAAIhB,aAAa,CAACiB,IAAI,IAAMF,WAAW,EAAG;YAC/CG,KAAK,EAAEJ,UAAU;YACjBrB,KAAK,EAAEO,aAAa,CAACmB,cAAc,CAClCL,UACD,CAAC;YACDtB,QAAQ,EAAEQ,aAAa,CAACoB,iBAAiB,GACtCpB,aAAa,CAACoB,iBAAiB,CAC/BN,UACA,CAAC,GACD,EAAE;YACLO,UAAU,EAAErB,aAAa,CAACsB,gBAAgB,GACvCtB,aAAa,CAACsB,gBAAgB,CAC9BR,UACA,CAAC,GACD;UACJ,CAAC,CACF,CAAC;;UAED;UACA,MAAM7B,MAAM,GAAG,IAAIsC,MAAM,CACxB,eAAe,GAAGxC,YAAY,CAAEkB,WAAY,CAAC,EAC7C,GACD,CAAC;UACDE,QAAQ,CAAEnB,aAAa,CAAEC,MAAM,EAAE2B,YAAa,CAAE,CAAC;QAClD,CAAE,CAAC;QAEH,OAAON,OAAO;MACf,CAAC,EACDF,WAAW,GAAG,GAAG,GAAG,CACrB,CAAC;MAED,MAAME,OAAO,GAAGD,WAAW,CAAC,CAAC;MAE7B,OAAO,MAAM;QACZA,WAAW,CAACmB,MAAM,CAAC,CAAC;QACpB,IAAKlB,OAAO,EAAG;UACdA,OAAO,CAACK,QAAQ,GAAG,IAAI;QACxB;MACD,CAAC;IACF,CAAC,EAAE,CAAEV,WAAW,CAAG,CAAC;IAEpB,OAAO,CAAEC,KAAK,CAAE;EACjB,CAAC;AACF","ignoreList":[]}
@@ -1,3 +1,4 @@
1
+ /* wp:polyfill */
1
2
  /**
2
3
  * External dependencies
3
4
  */
@@ -18,9 +19,7 @@ import { isAppleOS } from '@wordpress/keycodes';
18
19
  import { getAutoCompleterUI } from './autocompleter-ui';
19
20
  import { escapeRegExp } from '../utils/strings';
20
21
  import { withIgnoreIMEEvents } from '../utils/with-ignore-ime-events';
21
- import { jsx as _jsx } from "react/jsx-runtime";
22
- import { Fragment as _Fragment } from "react/jsx-runtime";
23
- import { jsxs as _jsxs } from "react/jsx-runtime";
22
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
24
23
  const getNodeText = node => {
25
24
  if (node === null) {
26
25
  return '';
@@ -65,7 +64,7 @@ export function useAutocomplete({
65
64
  const [filterValue, setFilterValue] = useState('');
66
65
  const [autocompleter, setAutocompleter] = useState(null);
67
66
  const [AutocompleterUI, setAutocompleterUI] = useState(null);
68
- const backspacing = useRef(false);
67
+ const backspacingRef = useRef(false);
69
68
  function insertCompletion(replacement) {
70
69
  if (autocompleter === null) {
71
70
  return;
@@ -125,7 +124,7 @@ export function useAutocomplete({
125
124
  setFilteredOptions(options);
126
125
  }
127
126
  function handleKeyDown(event) {
128
- backspacing.current = event.key === 'Backspace';
127
+ backspacingRef.current = event.key === 'Backspace';
129
128
  if (!autocompleter) {
130
129
  return;
131
130
  }
@@ -240,7 +239,7 @@ export function useAutocomplete({
240
239
  //
241
240
  // Ex: "Some text @marcelo sekkkk" <--- "kkkk" caused a mismatch, but
242
241
  // if the user presses backspace here, it will show the completion popup again.
243
- const matchingWhileBackspacing = backspacing.current && wordsFromTrigger.length <= 3;
242
+ const matchingWhileBackspacing = backspacingRef.current && wordsFromTrigger.length <= 3;
244
243
  if (mismatch && !(matchingWhileBackspacing || hasOneTriggerWord)) {
245
244
  if (autocompleter) {
246
245
  reset();
@@ -273,9 +272,8 @@ export function useAutocomplete({
273
272
  setAutocompleter(completer);
274
273
  setAutocompleterUI(() => completer !== autocompleter ? getAutoCompleterUI(completer) : AutocompleterUI);
275
274
  setFilterValue(query === null ? '' : query);
276
- // Temporarily disabling exhaustive-deps to avoid introducing unexpected side effecst.
275
+ // We want to avoid introducing unexpected side effects.
277
276
  // See https://github.com/WordPress/gutenberg/pull/41820
278
- // eslint-disable-next-line react-hooks/exhaustive-deps
279
277
  }, [textContent]);
280
278
  const {
281
279
  key: selectedKey = ''
@@ -1 +1 @@
1
- {"version":3,"names":["removeAccents","renderToString","useEffect","useState","useRef","useMemo","useInstanceId","useMergeRefs","useRefEffect","create","slice","insert","isCollapsed","getTextContent","speak","isAppleOS","getAutoCompleterUI","escapeRegExp","withIgnoreIMEEvents","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","getNodeText","node","toString","Array","map","join","props","children","EMPTY_FILTERED_OPTIONS","AUTOCOMPLETE_HOOK_REFERENCE","useAutocomplete","record","onChange","onReplace","completers","contentRef","instanceId","selectedIndex","setSelectedIndex","filteredOptions","setFilteredOptions","filterValue","setFilterValue","autocompleter","setAutocompleter","AutocompleterUI","setAutocompleterUI","backspacing","insertCompletion","replacement","end","start","triggerPrefix","length","toInsert","html","select","option","getOptionCompletion","isDisabled","completion","value","isCompletionObject","obj","action","undefined","completionObject","reset","onChangeOptions","options","handleKeyDown","event","current","key","defaultPrevented","newIndex","label","preventDefault","textContent","completer","reduce","lastTrigger","currentCompleter","triggerIndex","lastIndexOf","lastTriggerIndex","allowContext","textWithoutTrigger","tooDistantFromTrigger","mismatch","wordsFromTrigger","split","hasOneTriggerWord","matchingWhileBackspacing","textAfterSelection","test","safeTrigger","text","match","RegExp","query","selectedKey","className","isExpanded","listBoxId","activeId","hasSelection","onKeyDown","popover","onSelect","useLastDifferentValue","history","Set","add","size","delete","from","useAutocompleteProps","ref","onKeyDownRef","previousRecord","mergedRefs","element","_onKeyDown","addEventListener","removeEventListener","didUserInput","Autocomplete","isSelected"],"sources":["@wordpress/components/src/autocomplete/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport removeAccents from 'remove-accents';\n\n/**\n * WordPress dependencies\n */\nimport {\n\trenderToString,\n\tuseEffect,\n\tuseState,\n\tuseRef,\n\tuseMemo,\n} from '@wordpress/element';\nimport { useInstanceId, useMergeRefs, useRefEffect } from '@wordpress/compose';\nimport {\n\tcreate,\n\tslice,\n\tinsert,\n\tisCollapsed,\n\tgetTextContent,\n} from '@wordpress/rich-text';\nimport { speak } from '@wordpress/a11y';\nimport { isAppleOS } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport { getAutoCompleterUI } from './autocompleter-ui';\nimport { escapeRegExp } from '../utils/strings';\nimport { withIgnoreIMEEvents } from '../utils/with-ignore-ime-events';\nimport type {\n\tAutocompleteProps,\n\tAutocompleterUIProps,\n\tInsertOption,\n\tKeyedOption,\n\tOptionCompletion,\n\tReplaceOption,\n\tUseAutocompleteProps,\n\tWPCompleter,\n} from './types';\n\nconst getNodeText = ( node: React.ReactNode ): string => {\n\tif ( node === null ) {\n\t\treturn '';\n\t}\n\n\tswitch ( typeof node ) {\n\t\tcase 'string':\n\t\tcase 'number':\n\t\t\treturn node.toString();\n\t\t\tbreak;\n\t\tcase 'boolean':\n\t\t\treturn '';\n\t\t\tbreak;\n\t\tcase 'object': {\n\t\t\tif ( node instanceof Array ) {\n\t\t\t\treturn node.map( getNodeText ).join( '' );\n\t\t\t}\n\t\t\tif ( 'props' in node ) {\n\t\t\t\treturn getNodeText( node.props.children );\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tdefault:\n\t\t\treturn '';\n\t}\n\n\treturn '';\n};\n\nconst EMPTY_FILTERED_OPTIONS: KeyedOption[] = [];\n\n// Used for generating the instance ID\nconst AUTOCOMPLETE_HOOK_REFERENCE = {};\n\nexport function useAutocomplete( {\n\trecord,\n\tonChange,\n\tonReplace,\n\tcompleters,\n\tcontentRef,\n}: UseAutocompleteProps ) {\n\tconst instanceId = useInstanceId( AUTOCOMPLETE_HOOK_REFERENCE );\n\tconst [ selectedIndex, setSelectedIndex ] = useState( 0 );\n\n\tconst [ filteredOptions, setFilteredOptions ] = useState<\n\t\tArray< KeyedOption >\n\t>( EMPTY_FILTERED_OPTIONS );\n\tconst [ filterValue, setFilterValue ] =\n\t\tuseState< AutocompleterUIProps[ 'filterValue' ] >( '' );\n\tconst [ autocompleter, setAutocompleter ] = useState< WPCompleter | null >(\n\t\tnull\n\t);\n\tconst [ AutocompleterUI, setAutocompleterUI ] = useState<\n\t\t( ( props: AutocompleterUIProps ) => JSX.Element | null ) | null\n\t>( null );\n\n\tconst backspacing = useRef( false );\n\n\tfunction insertCompletion( replacement: React.ReactNode ) {\n\t\tif ( autocompleter === null ) {\n\t\t\treturn;\n\t\t}\n\t\tconst end = record.start;\n\t\tconst start =\n\t\t\tend - autocompleter.triggerPrefix.length - filterValue.length;\n\t\tconst toInsert = create( { html: renderToString( replacement ) } );\n\n\t\tonChange( insert( record, toInsert, start, end ) );\n\t}\n\n\tfunction select( option: KeyedOption ) {\n\t\tconst { getOptionCompletion } = autocompleter || {};\n\n\t\tif ( option.isDisabled ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( getOptionCompletion ) {\n\t\t\tconst completion = getOptionCompletion( option.value, filterValue );\n\n\t\t\tconst isCompletionObject = (\n\t\t\t\tobj: OptionCompletion\n\t\t\t): obj is InsertOption | ReplaceOption => {\n\t\t\t\treturn (\n\t\t\t\t\tobj !== null &&\n\t\t\t\t\ttypeof obj === 'object' &&\n\t\t\t\t\t'action' in obj &&\n\t\t\t\t\tobj.action !== undefined &&\n\t\t\t\t\t'value' in obj &&\n\t\t\t\t\tobj.value !== undefined\n\t\t\t\t);\n\t\t\t};\n\n\t\t\tconst completionObject = isCompletionObject( completion )\n\t\t\t\t? completion\n\t\t\t\t: ( {\n\t\t\t\t\t\taction: 'insert-at-caret',\n\t\t\t\t\t\tvalue: completion,\n\t\t\t\t } as InsertOption );\n\n\t\t\tif ( 'replace' === completionObject.action ) {\n\t\t\t\tonReplace( [ completionObject.value ] );\n\t\t\t\t// When replacing, the component will unmount, so don't reset\n\t\t\t\t// state (below) on an unmounted component.\n\t\t\t\treturn;\n\t\t\t} else if ( 'insert-at-caret' === completionObject.action ) {\n\t\t\t\tinsertCompletion( completionObject.value );\n\t\t\t}\n\t\t}\n\n\t\t// Reset autocomplete state after insertion rather than before\n\t\t// so insertion events don't cause the completion menu to redisplay.\n\t\treset();\n\t}\n\n\tfunction reset() {\n\t\tsetSelectedIndex( 0 );\n\t\tsetFilteredOptions( EMPTY_FILTERED_OPTIONS );\n\t\tsetFilterValue( '' );\n\t\tsetAutocompleter( null );\n\t\tsetAutocompleterUI( null );\n\t}\n\n\t/**\n\t * Load options for an autocompleter.\n\t *\n\t * @param {Array} options\n\t */\n\tfunction onChangeOptions( options: Array< KeyedOption > ) {\n\t\tsetSelectedIndex(\n\t\t\toptions.length === filteredOptions.length ? selectedIndex : 0\n\t\t);\n\t\tsetFilteredOptions( options );\n\t}\n\n\tfunction handleKeyDown( event: KeyboardEvent ) {\n\t\tbackspacing.current = event.key === 'Backspace';\n\n\t\tif ( ! autocompleter ) {\n\t\t\treturn;\n\t\t}\n\t\tif ( filteredOptions.length === 0 ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( event.defaultPrevented ) {\n\t\t\treturn;\n\t\t}\n\n\t\tswitch ( event.key ) {\n\t\t\tcase 'ArrowUp': {\n\t\t\t\tconst newIndex =\n\t\t\t\t\t( selectedIndex === 0\n\t\t\t\t\t\t? filteredOptions.length\n\t\t\t\t\t\t: selectedIndex ) - 1;\n\t\t\t\tsetSelectedIndex( newIndex );\n\t\t\t\t// See the related PR as to why this is necessary: https://github.com/WordPress/gutenberg/pull/54902.\n\t\t\t\tif ( isAppleOS() ) {\n\t\t\t\t\tspeak(\n\t\t\t\t\t\tgetNodeText( filteredOptions[ newIndex ].label ),\n\t\t\t\t\t\t'assertive'\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tcase 'ArrowDown': {\n\t\t\t\tconst newIndex = ( selectedIndex + 1 ) % filteredOptions.length;\n\t\t\t\tsetSelectedIndex( newIndex );\n\t\t\t\tif ( isAppleOS() ) {\n\t\t\t\t\tspeak(\n\t\t\t\t\t\tgetNodeText( filteredOptions[ newIndex ].label ),\n\t\t\t\t\t\t'assertive'\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tcase 'Escape':\n\t\t\t\tsetAutocompleter( null );\n\t\t\t\tsetAutocompleterUI( null );\n\t\t\t\tevent.preventDefault();\n\t\t\t\tbreak;\n\n\t\t\tcase 'Enter':\n\t\t\t\tselect( filteredOptions[ selectedIndex ] );\n\t\t\t\tbreak;\n\n\t\t\tcase 'ArrowLeft':\n\t\t\tcase 'ArrowRight':\n\t\t\t\treset();\n\t\t\t\treturn;\n\n\t\t\tdefault:\n\t\t\t\treturn;\n\t\t}\n\n\t\t// Any handled key should prevent original behavior. This relies on\n\t\t// the early return in the default case.\n\t\tevent.preventDefault();\n\t}\n\n\t// textContent is a primitive (string), memoizing is not strictly necessary\n\t// but this is a preemptive performance improvement, since the autocompleter\n\t// is a potential bottleneck for the editor type metric.\n\tconst textContent = useMemo( () => {\n\t\tif ( isCollapsed( record ) ) {\n\t\t\treturn getTextContent( slice( record, 0 ) );\n\t\t}\n\t\treturn '';\n\t}, [ record ] );\n\n\tuseEffect( () => {\n\t\tif ( ! textContent ) {\n\t\t\tif ( autocompleter ) {\n\t\t\t\treset();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\t// Find the completer with the highest triggerPrefix index in the\n\t\t// textContent.\n\t\tconst completer = completers.reduce< WPCompleter | null >(\n\t\t\t( lastTrigger, currentCompleter ) => {\n\t\t\t\tconst triggerIndex = textContent.lastIndexOf(\n\t\t\t\t\tcurrentCompleter.triggerPrefix\n\t\t\t\t);\n\t\t\t\tconst lastTriggerIndex =\n\t\t\t\t\tlastTrigger !== null\n\t\t\t\t\t\t? textContent.lastIndexOf( lastTrigger.triggerPrefix )\n\t\t\t\t\t\t: -1;\n\n\t\t\t\treturn triggerIndex > lastTriggerIndex\n\t\t\t\t\t? currentCompleter\n\t\t\t\t\t: lastTrigger;\n\t\t\t},\n\t\t\tnull\n\t\t);\n\n\t\tif ( ! completer ) {\n\t\t\tif ( autocompleter ) {\n\t\t\t\treset();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tconst { allowContext, triggerPrefix } = completer;\n\t\tconst triggerIndex = textContent.lastIndexOf( triggerPrefix );\n\t\tconst textWithoutTrigger = textContent.slice(\n\t\t\ttriggerIndex + triggerPrefix.length\n\t\t);\n\n\t\tconst tooDistantFromTrigger = textWithoutTrigger.length > 50; // 50 chars seems to be a good limit.\n\t\t// This is a final barrier to prevent the effect from completing with\n\t\t// an extremely long string, which causes the editor to slow-down\n\t\t// significantly. This could happen, for example, if `matchingWhileBackspacing`\n\t\t// is true and one of the \"words\" end up being too long. If that's the case,\n\t\t// it will be caught by this guard.\n\t\tif ( tooDistantFromTrigger ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst mismatch = filteredOptions.length === 0;\n\t\tconst wordsFromTrigger = textWithoutTrigger.split( /\\s/ );\n\t\t// We need to allow the effect to run when not backspacing and if there\n\t\t// was a mismatch. i.e when typing a trigger + the match string or when\n\t\t// clicking in an existing trigger word on the page. We do that if we\n\t\t// detect that we have one word from trigger in the current textual context.\n\t\t//\n\t\t// Ex.: \"Some text @a\" <-- \"@a\" will be detected as the trigger word and\n\t\t// allow the effect to run. It will run until there's a mismatch.\n\t\tconst hasOneTriggerWord = wordsFromTrigger.length === 1;\n\t\t// This is used to allow the effect to run when backspacing and if\n\t\t// \"touching\" a word that \"belongs\" to a trigger. We consider a \"trigger\n\t\t// word\" any word up to the limit of 3 from the trigger character.\n\t\t// Anything beyond that is ignored if there's a mismatch. This allows\n\t\t// us to \"escape\" a mismatch when backspacing, but still imposing some\n\t\t// sane limits.\n\t\t//\n\t\t// Ex: \"Some text @marcelo sekkkk\" <--- \"kkkk\" caused a mismatch, but\n\t\t// if the user presses backspace here, it will show the completion popup again.\n\t\tconst matchingWhileBackspacing =\n\t\t\tbackspacing.current && wordsFromTrigger.length <= 3;\n\n\t\tif ( mismatch && ! ( matchingWhileBackspacing || hasOneTriggerWord ) ) {\n\t\t\tif ( autocompleter ) {\n\t\t\t\treset();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tconst textAfterSelection = getTextContent(\n\t\t\tslice( record, undefined, getTextContent( record ).length )\n\t\t);\n\n\t\tif (\n\t\t\tallowContext &&\n\t\t\t! allowContext(\n\t\t\t\ttextContent.slice( 0, triggerIndex ),\n\t\t\t\ttextAfterSelection\n\t\t\t)\n\t\t) {\n\t\t\tif ( autocompleter ) {\n\t\t\t\treset();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tif (\n\t\t\t/^\\s/.test( textWithoutTrigger ) ||\n\t\t\t/\\s\\s+$/.test( textWithoutTrigger )\n\t\t) {\n\t\t\tif ( autocompleter ) {\n\t\t\t\treset();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! /[\\u0000-\\uFFFF]*$/.test( textWithoutTrigger ) ) {\n\t\t\tif ( autocompleter ) {\n\t\t\t\treset();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tconst safeTrigger = escapeRegExp( completer.triggerPrefix );\n\t\tconst text = removeAccents( textContent );\n\t\tconst match = text\n\t\t\t.slice( text.lastIndexOf( completer.triggerPrefix ) )\n\t\t\t.match( new RegExp( `${ safeTrigger }([\\u0000-\\uFFFF]*)$` ) );\n\t\tconst query = match && match[ 1 ];\n\n\t\tsetAutocompleter( completer );\n\t\tsetAutocompleterUI( () =>\n\t\t\tcompleter !== autocompleter\n\t\t\t\t? getAutoCompleterUI( completer )\n\t\t\t\t: AutocompleterUI\n\t\t);\n\t\tsetFilterValue( query === null ? '' : query );\n\t\t// Temporarily disabling exhaustive-deps to avoid introducing unexpected side effecst.\n\t\t// See https://github.com/WordPress/gutenberg/pull/41820\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [ textContent ] );\n\n\tconst { key: selectedKey = '' } = filteredOptions[ selectedIndex ] || {};\n\tconst { className } = autocompleter || {};\n\tconst isExpanded = !! autocompleter && filteredOptions.length > 0;\n\tconst listBoxId = isExpanded\n\t\t? `components-autocomplete-listbox-${ instanceId }`\n\t\t: undefined;\n\tconst activeId = isExpanded\n\t\t? `components-autocomplete-item-${ instanceId }-${ selectedKey }`\n\t\t: null;\n\tconst hasSelection = record.start !== undefined;\n\n\treturn {\n\t\tlistBoxId,\n\t\tactiveId,\n\t\tonKeyDown: withIgnoreIMEEvents( handleKeyDown ),\n\t\tpopover: hasSelection && AutocompleterUI && (\n\t\t\t<AutocompleterUI\n\t\t\t\tclassName={ className }\n\t\t\t\tfilterValue={ filterValue }\n\t\t\t\tinstanceId={ instanceId }\n\t\t\t\tlistBoxId={ listBoxId }\n\t\t\t\tselectedIndex={ selectedIndex }\n\t\t\t\tonChangeOptions={ onChangeOptions }\n\t\t\t\tonSelect={ select }\n\t\t\t\tvalue={ record }\n\t\t\t\tcontentRef={ contentRef }\n\t\t\t\treset={ reset }\n\t\t\t/>\n\t\t),\n\t};\n}\n\nfunction useLastDifferentValue( value: UseAutocompleteProps[ 'record' ] ) {\n\tconst history = useRef< Set< typeof value > >( new Set() );\n\n\thistory.current.add( value );\n\n\t// Keep the history size to 2.\n\tif ( history.current.size > 2 ) {\n\t\thistory.current.delete( Array.from( history.current )[ 0 ] );\n\t}\n\n\treturn Array.from( history.current )[ 0 ];\n}\n\nexport function useAutocompleteProps( options: UseAutocompleteProps ) {\n\tconst ref = useRef< HTMLElement >( null );\n\tconst onKeyDownRef = useRef< ( event: KeyboardEvent ) => void >();\n\tconst { record } = options;\n\tconst previousRecord = useLastDifferentValue( record );\n\tconst { popover, listBoxId, activeId, onKeyDown } = useAutocomplete( {\n\t\t...options,\n\t\tcontentRef: ref,\n\t} );\n\tonKeyDownRef.current = onKeyDown;\n\n\tconst mergedRefs = useMergeRefs( [\n\t\tref,\n\t\tuseRefEffect( ( element: HTMLElement ) => {\n\t\t\tfunction _onKeyDown( event: KeyboardEvent ) {\n\t\t\t\tonKeyDownRef.current?.( event );\n\t\t\t}\n\t\t\telement.addEventListener( 'keydown', _onKeyDown );\n\t\t\treturn () => {\n\t\t\t\telement.removeEventListener( 'keydown', _onKeyDown );\n\t\t\t};\n\t\t}, [] ),\n\t] );\n\n\t// We only want to show the popover if the user has typed something.\n\tconst didUserInput = record.text !== previousRecord?.text;\n\n\tif ( ! didUserInput ) {\n\t\treturn { ref: mergedRefs };\n\t}\n\n\treturn {\n\t\tref: mergedRefs,\n\t\tchildren: popover,\n\t\t'aria-autocomplete': listBoxId ? 'list' : undefined,\n\t\t'aria-owns': listBoxId,\n\t\t'aria-activedescendant': activeId,\n\t};\n}\n\nexport default function Autocomplete( {\n\tchildren,\n\tisSelected,\n\t...options\n}: AutocompleteProps ) {\n\tconst { popover, ...props } = useAutocomplete( options );\n\treturn (\n\t\t<>\n\t\t\t{ children( props ) }\n\t\t\t{ isSelected && popover }\n\t\t</>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,aAAa,MAAM,gBAAgB;;AAE1C;AACA;AACA;AACA,SACCC,cAAc,EACdC,SAAS,EACTC,QAAQ,EACRC,MAAM,EACNC,OAAO,QACD,oBAAoB;AAC3B,SAASC,aAAa,EAAEC,YAAY,EAAEC,YAAY,QAAQ,oBAAoB;AAC9E,SACCC,MAAM,EACNC,KAAK,EACLC,MAAM,EACNC,WAAW,EACXC,cAAc,QACR,sBAAsB;AAC7B,SAASC,KAAK,QAAQ,iBAAiB;AACvC,SAASC,SAAS,QAAQ,qBAAqB;;AAE/C;AACA;AACA;AACA,SAASC,kBAAkB,QAAQ,oBAAoB;AACvD,SAASC,YAAY,QAAQ,kBAAkB;AAC/C,SAASC,mBAAmB,QAAQ,iCAAiC;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,QAAA,IAAAC,SAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAYtE,MAAMC,WAAW,GAAKC,IAAqB,IAAc;EACxD,IAAKA,IAAI,KAAK,IAAI,EAAG;IACpB,OAAO,EAAE;EACV;EAEA,QAAS,OAAOA,IAAI;IACnB,KAAK,QAAQ;IACb,KAAK,QAAQ;MACZ,OAAOA,IAAI,CAAC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AAG3D;AACe,CAAC,EAAG;EACtB,MAAM;IAAEuC,OAAO;IAAE,GAAGlF;EAAM,CAAC,GAAGI,eAAe,CAAEuC,OAAQ,CAAC;EACxD,oBACClD,KAAA,CAAAF,SAAA;IAAAU,QAAA,GACGA,QAAQ,CAAED,KAAM,CAAC,EACjBsG,UAAU,IAAIpB,OAAO;EAAA,CACtB,CAAC;AAEL","ignoreList":[]}
1
+ {"version":3,"names":["removeAccents","renderToString","useEffect","useState","useRef","useMemo","useInstanceId","useMergeRefs","useRefEffect","create","slice","insert","isCollapsed","getTextContent","speak","isAppleOS","getAutoCompleterUI","escapeRegExp","withIgnoreIMEEvents","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","getNodeText","node","toString","Array","map","join","props","children","EMPTY_FILTERED_OPTIONS","AUTOCOMPLETE_HOOK_REFERENCE","useAutocomplete","record","onChange","onReplace","completers","contentRef","instanceId","selectedIndex","setSelectedIndex","filteredOptions","setFilteredOptions","filterValue","setFilterValue","autocompleter","setAutocompleter","AutocompleterUI","setAutocompleterUI","backspacingRef","insertCompletion","replacement","end","start","triggerPrefix","length","toInsert","html","select","option","getOptionCompletion","isDisabled","completion","value","isCompletionObject","obj","action","undefined","completionObject","reset","onChangeOptions","options","handleKeyDown","event","current","key","defaultPrevented","newIndex","label","preventDefault","textContent","completer","reduce","lastTrigger","currentCompleter","triggerIndex","lastIndexOf","lastTriggerIndex","allowContext","textWithoutTrigger","tooDistantFromTrigger","mismatch","wordsFromTrigger","split","hasOneTriggerWord","matchingWhileBackspacing","textAfterSelection","test","safeTrigger","text","match","RegExp","query","selectedKey","className","isExpanded","listBoxId","activeId","hasSelection","onKeyDown","popover","onSelect","useLastDifferentValue","history","Set","add","size","delete","from","useAutocompleteProps","ref","onKeyDownRef","previousRecord","mergedRefs","element","_onKeyDown","addEventListener","removeEventListener","didUserInput","Autocomplete","isSelected"],"sources":["@wordpress/components/src/autocomplete/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport removeAccents from 'remove-accents';\n\n/**\n * WordPress dependencies\n */\nimport {\n\trenderToString,\n\tuseEffect,\n\tuseState,\n\tuseRef,\n\tuseMemo,\n} from '@wordpress/element';\nimport { useInstanceId, useMergeRefs, useRefEffect } from '@wordpress/compose';\nimport {\n\tcreate,\n\tslice,\n\tinsert,\n\tisCollapsed,\n\tgetTextContent,\n} from '@wordpress/rich-text';\nimport { speak } from '@wordpress/a11y';\nimport { isAppleOS } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport { getAutoCompleterUI } from './autocompleter-ui';\nimport { escapeRegExp } from '../utils/strings';\nimport { withIgnoreIMEEvents } from '../utils/with-ignore-ime-events';\nimport type {\n\tAutocompleteProps,\n\tAutocompleterUIProps,\n\tInsertOption,\n\tKeyedOption,\n\tOptionCompletion,\n\tReplaceOption,\n\tUseAutocompleteProps,\n\tWPCompleter,\n} from './types';\n\nconst getNodeText = ( node: React.ReactNode ): string => {\n\tif ( node === null ) {\n\t\treturn '';\n\t}\n\n\tswitch ( typeof node ) {\n\t\tcase 'string':\n\t\tcase 'number':\n\t\t\treturn node.toString();\n\t\t\tbreak;\n\t\tcase 'boolean':\n\t\t\treturn '';\n\t\t\tbreak;\n\t\tcase 'object': {\n\t\t\tif ( node instanceof Array ) {\n\t\t\t\treturn node.map( getNodeText ).join( '' );\n\t\t\t}\n\t\t\tif ( 'props' in node ) {\n\t\t\t\treturn getNodeText( node.props.children );\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tdefault:\n\t\t\treturn '';\n\t}\n\n\treturn '';\n};\n\nconst EMPTY_FILTERED_OPTIONS: KeyedOption[] = [];\n\n// Used for generating the instance ID\nconst AUTOCOMPLETE_HOOK_REFERENCE = {};\n\nexport function useAutocomplete( {\n\trecord,\n\tonChange,\n\tonReplace,\n\tcompleters,\n\tcontentRef,\n}: UseAutocompleteProps ) {\n\tconst instanceId = useInstanceId( AUTOCOMPLETE_HOOK_REFERENCE );\n\tconst [ selectedIndex, setSelectedIndex ] = useState( 0 );\n\n\tconst [ filteredOptions, setFilteredOptions ] = useState<\n\t\tArray< KeyedOption >\n\t>( EMPTY_FILTERED_OPTIONS );\n\tconst [ filterValue, setFilterValue ] =\n\t\tuseState< AutocompleterUIProps[ 'filterValue' ] >( '' );\n\tconst [ autocompleter, setAutocompleter ] = useState< WPCompleter | null >(\n\t\tnull\n\t);\n\tconst [ AutocompleterUI, setAutocompleterUI ] = useState<\n\t\t( ( props: AutocompleterUIProps ) => JSX.Element | null ) | null\n\t>( null );\n\n\tconst backspacingRef = useRef( false );\n\n\tfunction insertCompletion( replacement: React.ReactNode ) {\n\t\tif ( autocompleter === null ) {\n\t\t\treturn;\n\t\t}\n\t\tconst end = record.start;\n\t\tconst start =\n\t\t\tend - autocompleter.triggerPrefix.length - filterValue.length;\n\t\tconst toInsert = create( { html: renderToString( replacement ) } );\n\n\t\tonChange( insert( record, toInsert, start, end ) );\n\t}\n\n\tfunction select( option: KeyedOption ) {\n\t\tconst { getOptionCompletion } = autocompleter || {};\n\n\t\tif ( option.isDisabled ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( getOptionCompletion ) {\n\t\t\tconst completion = getOptionCompletion( option.value, filterValue );\n\n\t\t\tconst isCompletionObject = (\n\t\t\t\tobj: OptionCompletion\n\t\t\t): obj is InsertOption | ReplaceOption => {\n\t\t\t\treturn (\n\t\t\t\t\tobj !== null &&\n\t\t\t\t\ttypeof obj === 'object' &&\n\t\t\t\t\t'action' in obj &&\n\t\t\t\t\tobj.action !== undefined &&\n\t\t\t\t\t'value' in obj &&\n\t\t\t\t\tobj.value !== undefined\n\t\t\t\t);\n\t\t\t};\n\n\t\t\tconst completionObject = isCompletionObject( completion )\n\t\t\t\t? completion\n\t\t\t\t: ( {\n\t\t\t\t\t\taction: 'insert-at-caret',\n\t\t\t\t\t\tvalue: completion,\n\t\t\t\t } as InsertOption );\n\n\t\t\tif ( 'replace' === completionObject.action ) {\n\t\t\t\tonReplace( [ completionObject.value ] );\n\t\t\t\t// When replacing, the component will unmount, so don't reset\n\t\t\t\t// state (below) on an unmounted component.\n\t\t\t\treturn;\n\t\t\t} else if ( 'insert-at-caret' === completionObject.action ) {\n\t\t\t\tinsertCompletion( completionObject.value );\n\t\t\t}\n\t\t}\n\n\t\t// Reset autocomplete state after insertion rather than before\n\t\t// so insertion events don't cause the completion menu to redisplay.\n\t\treset();\n\t}\n\n\tfunction reset() {\n\t\tsetSelectedIndex( 0 );\n\t\tsetFilteredOptions( EMPTY_FILTERED_OPTIONS );\n\t\tsetFilterValue( '' );\n\t\tsetAutocompleter( null );\n\t\tsetAutocompleterUI( null );\n\t}\n\n\t/**\n\t * Load options for an autocompleter.\n\t *\n\t * @param {Array} options\n\t */\n\tfunction onChangeOptions( options: Array< KeyedOption > ) {\n\t\tsetSelectedIndex(\n\t\t\toptions.length === filteredOptions.length ? selectedIndex : 0\n\t\t);\n\t\tsetFilteredOptions( options );\n\t}\n\n\tfunction handleKeyDown( event: KeyboardEvent ) {\n\t\tbackspacingRef.current = event.key === 'Backspace';\n\n\t\tif ( ! autocompleter ) {\n\t\t\treturn;\n\t\t}\n\t\tif ( filteredOptions.length === 0 ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( event.defaultPrevented ) {\n\t\t\treturn;\n\t\t}\n\n\t\tswitch ( event.key ) {\n\t\t\tcase 'ArrowUp': {\n\t\t\t\tconst newIndex =\n\t\t\t\t\t( selectedIndex === 0\n\t\t\t\t\t\t? filteredOptions.length\n\t\t\t\t\t\t: selectedIndex ) - 1;\n\t\t\t\tsetSelectedIndex( newIndex );\n\t\t\t\t// See the related PR as to why this is necessary: https://github.com/WordPress/gutenberg/pull/54902.\n\t\t\t\tif ( isAppleOS() ) {\n\t\t\t\t\tspeak(\n\t\t\t\t\t\tgetNodeText( filteredOptions[ newIndex ].label ),\n\t\t\t\t\t\t'assertive'\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tcase 'ArrowDown': {\n\t\t\t\tconst newIndex = ( selectedIndex + 1 ) % filteredOptions.length;\n\t\t\t\tsetSelectedIndex( newIndex );\n\t\t\t\tif ( isAppleOS() ) {\n\t\t\t\t\tspeak(\n\t\t\t\t\t\tgetNodeText( filteredOptions[ newIndex ].label ),\n\t\t\t\t\t\t'assertive'\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tcase 'Escape':\n\t\t\t\tsetAutocompleter( null );\n\t\t\t\tsetAutocompleterUI( null );\n\t\t\t\tevent.preventDefault();\n\t\t\t\tbreak;\n\n\t\t\tcase 'Enter':\n\t\t\t\tselect( filteredOptions[ selectedIndex ] );\n\t\t\t\tbreak;\n\n\t\t\tcase 'ArrowLeft':\n\t\t\tcase 'ArrowRight':\n\t\t\t\treset();\n\t\t\t\treturn;\n\n\t\t\tdefault:\n\t\t\t\treturn;\n\t\t}\n\n\t\t// Any handled key should prevent original behavior. This relies on\n\t\t// the early return in the default case.\n\t\tevent.preventDefault();\n\t}\n\n\t// textContent is a primitive (string), memoizing is not strictly necessary\n\t// but this is a preemptive performance improvement, since the autocompleter\n\t// is a potential bottleneck for the editor type metric.\n\tconst textContent = useMemo( () => {\n\t\tif ( isCollapsed( record ) ) {\n\t\t\treturn getTextContent( slice( record, 0 ) );\n\t\t}\n\t\treturn '';\n\t}, [ record ] );\n\n\tuseEffect( () => {\n\t\tif ( ! textContent ) {\n\t\t\tif ( autocompleter ) {\n\t\t\t\treset();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\t// Find the completer with the highest triggerPrefix index in the\n\t\t// textContent.\n\t\tconst completer = completers.reduce< WPCompleter | null >(\n\t\t\t( lastTrigger, currentCompleter ) => {\n\t\t\t\tconst triggerIndex = textContent.lastIndexOf(\n\t\t\t\t\tcurrentCompleter.triggerPrefix\n\t\t\t\t);\n\t\t\t\tconst lastTriggerIndex =\n\t\t\t\t\tlastTrigger !== null\n\t\t\t\t\t\t? textContent.lastIndexOf( lastTrigger.triggerPrefix )\n\t\t\t\t\t\t: -1;\n\n\t\t\t\treturn triggerIndex > lastTriggerIndex\n\t\t\t\t\t? currentCompleter\n\t\t\t\t\t: lastTrigger;\n\t\t\t},\n\t\t\tnull\n\t\t);\n\n\t\tif ( ! completer ) {\n\t\t\tif ( autocompleter ) {\n\t\t\t\treset();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tconst { allowContext, triggerPrefix } = completer;\n\t\tconst triggerIndex = textContent.lastIndexOf( triggerPrefix );\n\t\tconst textWithoutTrigger = textContent.slice(\n\t\t\ttriggerIndex + triggerPrefix.length\n\t\t);\n\n\t\tconst tooDistantFromTrigger = textWithoutTrigger.length > 50; // 50 chars seems to be a good limit.\n\t\t// This is a final barrier to prevent the effect from completing with\n\t\t// an extremely long string, which causes the editor to slow-down\n\t\t// significantly. This could happen, for example, if `matchingWhileBackspacing`\n\t\t// is true and one of the \"words\" end up being too long. If that's the case,\n\t\t// it will be caught by this guard.\n\t\tif ( tooDistantFromTrigger ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst mismatch = filteredOptions.length === 0;\n\t\tconst wordsFromTrigger = textWithoutTrigger.split( /\\s/ );\n\t\t// We need to allow the effect to run when not backspacing and if there\n\t\t// was a mismatch. i.e when typing a trigger + the match string or when\n\t\t// clicking in an existing trigger word on the page. We do that if we\n\t\t// detect that we have one word from trigger in the current textual context.\n\t\t//\n\t\t// Ex.: \"Some text @a\" <-- \"@a\" will be detected as the trigger word and\n\t\t// allow the effect to run. It will run until there's a mismatch.\n\t\tconst hasOneTriggerWord = wordsFromTrigger.length === 1;\n\t\t// This is used to allow the effect to run when backspacing and if\n\t\t// \"touching\" a word that \"belongs\" to a trigger. We consider a \"trigger\n\t\t// word\" any word up to the limit of 3 from the trigger character.\n\t\t// Anything beyond that is ignored if there's a mismatch. This allows\n\t\t// us to \"escape\" a mismatch when backspacing, but still imposing some\n\t\t// sane limits.\n\t\t//\n\t\t// Ex: \"Some text @marcelo sekkkk\" <--- \"kkkk\" caused a mismatch, but\n\t\t// if the user presses backspace here, it will show the completion popup again.\n\t\tconst matchingWhileBackspacing =\n\t\t\tbackspacingRef.current && wordsFromTrigger.length <= 3;\n\n\t\tif ( mismatch && ! ( matchingWhileBackspacing || hasOneTriggerWord ) ) {\n\t\t\tif ( autocompleter ) {\n\t\t\t\treset();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tconst textAfterSelection = getTextContent(\n\t\t\tslice( record, undefined, getTextContent( record ).length )\n\t\t);\n\n\t\tif (\n\t\t\tallowContext &&\n\t\t\t! allowContext(\n\t\t\t\ttextContent.slice( 0, triggerIndex ),\n\t\t\t\ttextAfterSelection\n\t\t\t)\n\t\t) {\n\t\t\tif ( autocompleter ) {\n\t\t\t\treset();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tif (\n\t\t\t/^\\s/.test( textWithoutTrigger ) ||\n\t\t\t/\\s\\s+$/.test( textWithoutTrigger )\n\t\t) {\n\t\t\tif ( autocompleter ) {\n\t\t\t\treset();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! /[\\u0000-\\uFFFF]*$/.test( textWithoutTrigger ) ) {\n\t\t\tif ( autocompleter ) {\n\t\t\t\treset();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tconst safeTrigger = escapeRegExp( completer.triggerPrefix );\n\t\tconst text = removeAccents( textContent );\n\t\tconst match = text\n\t\t\t.slice( text.lastIndexOf( completer.triggerPrefix ) )\n\t\t\t.match( new RegExp( `${ safeTrigger }([\\u0000-\\uFFFF]*)$` ) );\n\t\tconst query = match && match[ 1 ];\n\n\t\tsetAutocompleter( completer );\n\t\tsetAutocompleterUI( () =>\n\t\t\tcompleter !== autocompleter\n\t\t\t\t? getAutoCompleterUI( completer )\n\t\t\t\t: AutocompleterUI\n\t\t);\n\t\tsetFilterValue( query === null ? '' : query );\n\t\t// We want to avoid introducing unexpected side effects.\n\t\t// See https://github.com/WordPress/gutenberg/pull/41820\n\t}, [ textContent ] );\n\n\tconst { key: selectedKey = '' } = filteredOptions[ selectedIndex ] || {};\n\tconst { className } = autocompleter || {};\n\tconst isExpanded = !! autocompleter && filteredOptions.length > 0;\n\tconst listBoxId = isExpanded\n\t\t? `components-autocomplete-listbox-${ instanceId }`\n\t\t: undefined;\n\tconst activeId = isExpanded\n\t\t? `components-autocomplete-item-${ instanceId }-${ selectedKey }`\n\t\t: null;\n\tconst hasSelection = record.start !== undefined;\n\n\treturn {\n\t\tlistBoxId,\n\t\tactiveId,\n\t\tonKeyDown: withIgnoreIMEEvents( handleKeyDown ),\n\t\tpopover: hasSelection && AutocompleterUI && (\n\t\t\t<AutocompleterUI\n\t\t\t\tclassName={ className }\n\t\t\t\tfilterValue={ filterValue }\n\t\t\t\tinstanceId={ instanceId }\n\t\t\t\tlistBoxId={ listBoxId }\n\t\t\t\tselectedIndex={ selectedIndex }\n\t\t\t\tonChangeOptions={ onChangeOptions }\n\t\t\t\tonSelect={ select }\n\t\t\t\tvalue={ record }\n\t\t\t\tcontentRef={ contentRef }\n\t\t\t\treset={ reset }\n\t\t\t/>\n\t\t),\n\t};\n}\n\nfunction useLastDifferentValue( value: UseAutocompleteProps[ 'record' ] ) {\n\tconst history = useRef< Set< typeof value > >( new Set() );\n\n\thistory.current.add( value );\n\n\t// Keep the history size to 2.\n\tif ( history.current.size > 2 ) {\n\t\thistory.current.delete( Array.from( history.current )[ 0 ] );\n\t}\n\n\treturn Array.from( history.current )[ 0 ];\n}\n\nexport function useAutocompleteProps( options: UseAutocompleteProps ) {\n\tconst ref = useRef< HTMLElement >( null );\n\tconst onKeyDownRef = useRef< ( event: KeyboardEvent ) => void >();\n\tconst { record } = options;\n\tconst previousRecord = useLastDifferentValue( record );\n\tconst { popover, listBoxId, activeId, onKeyDown } = useAutocomplete( {\n\t\t...options,\n\t\tcontentRef: ref,\n\t} );\n\tonKeyDownRef.current = onKeyDown;\n\n\tconst mergedRefs = useMergeRefs( [\n\t\tref,\n\t\tuseRefEffect( ( element: HTMLElement ) => {\n\t\t\tfunction _onKeyDown( event: KeyboardEvent ) {\n\t\t\t\tonKeyDownRef.current?.( event );\n\t\t\t}\n\t\t\telement.addEventListener( 'keydown', _onKeyDown );\n\t\t\treturn () => {\n\t\t\t\telement.removeEventListener( 'keydown', _onKeyDown );\n\t\t\t};\n\t\t}, [] ),\n\t] );\n\n\t// We only want to show the popover if the user has typed something.\n\tconst didUserInput = record.text !== previousRecord?.text;\n\n\tif ( ! didUserInput ) {\n\t\treturn { ref: mergedRefs };\n\t}\n\n\treturn {\n\t\tref: mergedRefs,\n\t\tchildren: popover,\n\t\t'aria-autocomplete': listBoxId ? 'list' : undefined,\n\t\t'aria-owns': listBoxId,\n\t\t'aria-activedescendant': activeId,\n\t};\n}\n\nexport default function Autocomplete( {\n\tchildren,\n\tisSelected,\n\t...options\n}: AutocompleteProps ) {\n\tconst { popover, ...props } = useAutocomplete( options );\n\treturn (\n\t\t<>\n\t\t\t{ children( props ) }\n\t\t\t{ isSelected && popover }\n\t\t</>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,aAAa,MAAM,gBAAgB;;AAE1C;AACA;AACA;AACA,SACCC,cAAc,EACdC,SAAS,EACTC,QAAQ,EACRC,MAAM,EACNC,OAAO,QACD,oBAAoB;AAC3B,SAASC,aAAa,EAAEC,YAAY,EAAEC,YAAY,QAAQ,oBAAoB;AAC9E,SACCC,MAAM,EACNC,KAAK,EACLC,MAAM,EACNC,WAAW,EACXC,cAAc,QACR,sBAAsB;AAC7B,SAASC,KAAK,QAAQ,iBAAiB;AACvC,SAASC,SAAS,QAAQ,qBAAqB;;AAE/C;AACA;AACA;AACA,SAASC,kBAAkB,QAAQ,oBAAoB;AACvD,SAASC,YAAY,QAAQ,kBAAkB;AAC/C,SAASC,mBAAmB,QAAQ,iCAAiC;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAA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IACjB,mBAAmB,EAAEJ,SAAS,GAAG,MAAM,GAAGvC,SAAS;IACnD,WAAW,EAAEuC,SAAS;IACtB,uBAAuB,EAAEC;EAC1B,CAAC;AACF;AAEA,eAAe,SAASsB,YAAYA,CAAE;EACrCpG,QAAQ;EACRqG,UAAU;EACV,GAAG3D;AACe,CAAC,EAAG;EACtB,MAAM;IAAEuC,OAAO;IAAE,GAAGlF;EAAM,CAAC,GAAGI,eAAe,CAAEuC,OAAQ,CAAC;EACxD,oBACClD,KAAA,CAAAF,SAAA;IAAAU,QAAA,GACGA,QAAQ,CAAED,KAAM,CAAC,EACjBsG,UAAU,IAAIpB,OAAO;EAAA,CACtB,CAAC;AAEL","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["useInstanceId","BaseControl","useBaseControlProps","props","help","id","preferredId","restProps","uniqueId","baseControlProps","controlProps"],"sources":["@wordpress/components/src/base-control/hooks.ts"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport BaseControl from '.';\nimport type { BaseControlProps } from './types';\n\n/**\n * Generate props for the `BaseControl` and the inner control itself.\n *\n * Namely, it takes care of generating a unique `id`, properly associating it with the `label` and `help` elements.\n *\n * @param props\n */\nexport function useBaseControlProps(\n\tprops: Omit< BaseControlProps, 'children' >\n) {\n\tconst { help, id: preferredId, ...restProps } = props;\n\n\tconst uniqueId = useInstanceId(\n\t\tBaseControl,\n\t\t'wp-components-base-control',\n\t\tpreferredId\n\t);\n\n\treturn {\n\t\tbaseControlProps: {\n\t\t\tid: uniqueId,\n\t\t\thelp,\n\t\t\t...restProps,\n\t\t},\n\t\tcontrolProps: {\n\t\t\tid: uniqueId,\n\t\t\t...( !! help ? { 'aria-describedby': `${ uniqueId }__help` } : {} ),\n\t\t},\n\t};\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,aAAa,QAAQ,oBAAoB;;AAElD;AACA;AACA;AACA,OAAOC,WAAW,MAAM,GAAG;AAG3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,mBAAmBA,CAClCC,KAA2C,EAC1C;EACD,MAAM;IAAEC,IAAI;IAAEC,EAAE,EAAEC,WAAW;IAAE,GAAGC;EAAU,CAAC,GAAGJ,KAAK;EAErD,MAAMK,QAAQ,GAAGR,aAAa,CAC7BC,WAAW,EACX,4BAA4B,EAC5BK,WACD,CAAC;EAED,OAAO;IACNG,gBAAgB,EAAE;MACjBJ,EAAE,EAAEG,QAAQ;MACZJ,IAAI;MACJ,GAAGG;IACJ,CAAC;IACDG,YAAY,EAAE;MACbL,EAAE,EAAEG,QAAQ;MACZ,IAAK,CAAC,CAAEJ,IAAI,GAAG;QAAE,kBAAkB,EAAG,GAAGI,QAAU;MAAQ,CAAC,GAAG,CAAC,CAAC;IAClE;EACD,CAAC;AACF","ignoreList":[]}
1
+ {"version":3,"names":["useInstanceId","BaseControl","useBaseControlProps","props","help","id","preferredId","restProps","uniqueId","baseControlProps","controlProps"],"sources":["@wordpress/components/src/base-control/hooks.ts"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport BaseControl from '.';\nimport type { BaseControlProps } from './types';\n\n/**\n * Generate props for the `BaseControl` and the inner control itself.\n *\n * Namely, it takes care of generating a unique `id`, properly associating it with the `label` and `help` elements.\n *\n * @param props\n */\nexport function useBaseControlProps(\n\tprops: Omit< BaseControlProps, 'children' >\n) {\n\tconst { help, id: preferredId, ...restProps } = props;\n\n\tconst uniqueId = useInstanceId(\n\t\tBaseControl,\n\t\t'wp-components-base-control',\n\t\tpreferredId\n\t);\n\n\treturn {\n\t\tbaseControlProps: {\n\t\t\tid: uniqueId,\n\t\t\thelp,\n\t\t\t...restProps,\n\t\t},\n\t\tcontrolProps: {\n\t\t\tid: uniqueId,\n\t\t\t...( !! help ? { 'aria-describedby': `${ uniqueId }__help` } : {} ),\n\t\t},\n\t};\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,aAAa,QAAQ,oBAAoB;;AAElD;AACA;AACA;AACA,OAAOC,WAAW,MAAM,GAAG;AAG3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,mBAAmBA,CAClCC,KAA2C,EAC1C;EACD,MAAM;IAAEC,IAAI;IAAEC,EAAE,EAAEC,WAAW;IAAE,GAAGC;EAAU,CAAC,GAAGJ,KAAK;EAErD,MAAMK,QAAQ,GAAGR,aAAa,CAC7BC,WAAW,EACX,4BAA4B,EAC5BK,WACD,CAAC;EAED,OAAO;IACNG,gBAAgB,EAAE;MACjBJ,EAAE,EAAEG,QAAQ;MACZJ,IAAI;MACJ,GAAGG;IACJ,CAAC;IACDG,YAAY,EAAE;MACbL,EAAE,EAAEG,QAAQ;MACZ,IAAK,CAAC,CAAEJ,IAAI,GAAG;QAAE,kBAAkB,EAAE,GAAII,QAAQ;MAAU,CAAC,GAAG,CAAC,CAAC;IAClE;EACD,CAAC;AACF","ignoreList":[]}
@@ -14,8 +14,7 @@ import { forwardRef } from '@wordpress/element';
14
14
  import { VisuallyHidden } from '../visually-hidden';
15
15
  import { Wrapper, StyledField, StyledLabel, StyledHelp, StyledVisualLabel } from './styles/base-control-styles';
16
16
  import { contextConnectWithoutRef, useContextSystem } from '../context';
17
- import { jsx as _jsx } from "react/jsx-runtime";
18
- import { jsxs as _jsxs } from "react/jsx-runtime";
17
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
19
18
  export { useBaseControlProps } from './hooks';
20
19
  const UnconnectedBaseControl = props => {
21
20
  const {
@@ -1 +1 @@
1
- {"version":3,"names":["clsx","deprecated","forwardRef","VisuallyHidden","Wrapper","StyledField","StyledLabel","StyledHelp","StyledVisualLabel","contextConnectWithoutRef","useContextSystem","jsx","_jsx","jsxs","_jsxs","useBaseControlProps","UnconnectedBaseControl","props","__nextHasNoMarginBottom","__associatedWPComponentName","id","label","hideLabelFromVision","help","className","children","since","version","hint","as","htmlFor","VisualLabel","undefined","UnforwardedVisualLabel","ref","restProps","BaseControl","Object","assign"],"sources":["@wordpress/components/src/base-control/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport deprecated from '@wordpress/deprecated';\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { VisuallyHidden } from '../visually-hidden';\nimport type { BaseControlProps, BaseControlVisualLabelProps } from './types';\nimport {\n\tWrapper,\n\tStyledField,\n\tStyledLabel,\n\tStyledHelp,\n\tStyledVisualLabel,\n} from './styles/base-control-styles';\nimport type { WordPressComponentProps } from '../context';\nimport { contextConnectWithoutRef, useContextSystem } from '../context';\n\nexport { useBaseControlProps } from './hooks';\n\nconst UnconnectedBaseControl = (\n\tprops: WordPressComponentProps< BaseControlProps, null >\n) => {\n\tconst {\n\t\t__nextHasNoMarginBottom = false,\n\t\t__associatedWPComponentName = 'BaseControl',\n\t\tid,\n\t\tlabel,\n\t\thideLabelFromVision = false,\n\t\thelp,\n\t\tclassName,\n\t\tchildren,\n\t} = useContextSystem( props, 'BaseControl' );\n\n\tif ( ! __nextHasNoMarginBottom ) {\n\t\tdeprecated(\n\t\t\t`Bottom margin styles for wp.components.${ __associatedWPComponentName }`,\n\t\t\t{\n\t\t\t\tsince: '6.7',\n\t\t\t\tversion: '7.0',\n\t\t\t\thint: 'Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version.',\n\t\t\t}\n\t\t);\n\t}\n\n\treturn (\n\t\t<Wrapper className={ className }>\n\t\t\t<StyledField\n\t\t\t\tclassName=\"components-base-control__field\"\n\t\t\t\t// TODO: Official deprecation for this should start after all internal usages have been migrated\n\t\t\t\t__nextHasNoMarginBottom={ __nextHasNoMarginBottom }\n\t\t\t>\n\t\t\t\t{ label &&\n\t\t\t\t\tid &&\n\t\t\t\t\t( hideLabelFromVision ? (\n\t\t\t\t\t\t<VisuallyHidden as=\"label\" htmlFor={ id }>\n\t\t\t\t\t\t\t{ label }\n\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<StyledLabel\n\t\t\t\t\t\t\tclassName=\"components-base-control__label\"\n\t\t\t\t\t\t\thtmlFor={ id }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ label }\n\t\t\t\t\t\t</StyledLabel>\n\t\t\t\t\t) ) }\n\t\t\t\t{ label &&\n\t\t\t\t\t! id &&\n\t\t\t\t\t( hideLabelFromVision ? (\n\t\t\t\t\t\t<VisuallyHidden as=\"label\">{ label }</VisuallyHidden>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<VisualLabel>{ label }</VisualLabel>\n\t\t\t\t\t) ) }\n\t\t\t\t{ children }\n\t\t\t</StyledField>\n\t\t\t{ !! help && (\n\t\t\t\t<StyledHelp\n\t\t\t\t\tid={ id ? id + '__help' : undefined }\n\t\t\t\t\tclassName=\"components-base-control__help\"\n\t\t\t\t\t__nextHasNoMarginBottom={ __nextHasNoMarginBottom }\n\t\t\t\t>\n\t\t\t\t\t{ help }\n\t\t\t\t</StyledHelp>\n\t\t\t) }\n\t\t</Wrapper>\n\t);\n};\n\nconst UnforwardedVisualLabel = (\n\tprops: WordPressComponentProps< BaseControlVisualLabelProps, 'span' >,\n\tref: ForwardedRef< any >\n) => {\n\tconst { className, children, ...restProps } = props;\n\n\treturn (\n\t\t<StyledVisualLabel\n\t\t\tref={ ref }\n\t\t\t{ ...restProps }\n\t\t\tclassName={ clsx( 'components-base-control__label', className ) }\n\t\t>\n\t\t\t{ children }\n\t\t</StyledVisualLabel>\n\t);\n};\n\nexport const VisualLabel = forwardRef( UnforwardedVisualLabel );\n\n/**\n * `BaseControl` is a component used to generate labels and help text for components handling user inputs.\n *\n * ```jsx\n * import { BaseControl, useBaseControlProps } from '@wordpress/components';\n *\n * // Render a `BaseControl` for a textarea input\n * const MyCustomTextareaControl = ({ children, ...baseProps }) => (\n * \t// `useBaseControlProps` is a convenience hook to get the props for the `BaseControl`\n * \t// and the inner control itself. Namely, it takes care of generating a unique `id`,\n * \t// properly associating it with the `label` and `help` elements.\n * \tconst { baseControlProps, controlProps } = useBaseControlProps( baseProps );\n *\n * \treturn (\n * \t\t<BaseControl { ...baseControlProps } __nextHasNoMarginBottom>\n * \t\t\t<textarea { ...controlProps }>\n * \t\t\t { children }\n * \t\t\t</textarea>\n * \t\t</BaseControl>\n * \t);\n * );\n * ```\n */\nexport const BaseControl = Object.assign(\n\tcontextConnectWithoutRef( UnconnectedBaseControl, 'BaseControl' ),\n\n\t{\n\t\t/**\n\t\t * `BaseControl.VisualLabel` is used to render a purely visual label inside a `BaseControl` component.\n\t\t *\n\t\t * It should only be used in cases where the children being rendered inside `BaseControl` are already accessibly labeled,\n\t\t * e.g., a button, but we want an additional visual label for that section equivalent to the labels `BaseControl` would\n\t\t * otherwise use if the `label` prop was passed.\n\t\t *\n\t\t * ```jsx\n\t\t * import { BaseControl } from '@wordpress/components';\n\t\t *\n\t\t * const MyBaseControl = () => (\n\t\t * \t<BaseControl\n\t\t * \t\t__nextHasNoMarginBottom\n\t\t * \t\thelp=\"This button is already accessibly labeled.\"\n\t\t * \t>\n\t\t * \t\t<BaseControl.VisualLabel>Author</BaseControl.VisualLabel>\n\t\t * \t\t<Button>Select an author</Button>\n\t\t * \t</BaseControl>\n\t\t * );\n\t\t * ```\n\t\t */\n\t\tVisualLabel,\n\t}\n);\n\nexport default BaseControl;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;AAGvB;AACA;AACA;AACA,OAAOC,UAAU,MAAM,uBAAuB;AAC9C,SAASC,UAAU,QAAQ,oBAAoB;;AAE/C;AACA;AACA;AACA,SAASC,cAAc,QAAQ,oBAAoB;AAEnD,SACCC,OAAO,EACPC,WAAW,EACXC,WAAW,EACXC,UAAU,EACVC,iBAAiB,QACX,8BAA8B;AAErC,SAASC,wBAAw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QAAQ;IAAA,CACE,CAAC,EACZ,CAAC,CAAEF,IAAI,iBACRX,IAAA,CAACL,UAAU;MACVa,EAAE,EAAGA,EAAE,GAAGA,EAAE,GAAG,QAAQ,GAAGY,SAAW;MACrCR,SAAS,EAAC,+BAA+B;MACzCN,uBAAuB,EAAGA,uBAAyB;MAAAO,QAAA,EAEjDF;IAAI,CACK,CACZ;EAAA,CACO,CAAC;AAEZ,CAAC;AAED,MAAMU,sBAAsB,GAAGA,CAC9BhB,KAAqE,EACrEiB,GAAwB,KACpB;EACJ,MAAM;IAAEV,SAAS;IAAEC,QAAQ;IAAE,GAAGU;EAAU,CAAC,GAAGlB,KAAK;EAEnD,oBACCL,IAAA,CAACJ,iBAAiB;IACjB0B,GAAG,EAAGA,GAAK;IAAA,GACNC,SAAS;IACdX,SAAS,EAAGxB,IAAI,CAAE,gCAAgC,EAAEwB,SAAU,CAAG;IAAAC,QAAA,EAE/DA;EAAQ,CACQ,CAAC;AAEtB,CAAC;AAED,OAAO,MAAMM,WAAW,GAAG7B,UAAU,CAAE+B,sBAAuB,CAAC;;AAE/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMG,WAAW,GAAGC,MAAM,CAACC,MAAM,CACvC7B,wBAAwB,CAAEO,sBAAsB,EAAE,aAAc,CAAC,EAEjE;EACC;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEe;AACD,CACD,CAAC;AAED,eAAeK,WAAW","ignoreList":[]}
1
+ {"version":3,"names":["clsx","deprecated","forwardRef","VisuallyHidden","Wrapper","StyledField","StyledLabel","StyledHelp","StyledVisualLabel","contextConnectWithoutRef","useContextSystem","jsx","_jsx","jsxs","_jsxs","useBaseControlProps","UnconnectedBaseControl","props","__nextHasNoMarginBottom","__associatedWPComponentName","id","label","hideLabelFromVision","help","className","children","since","version","hint","as","htmlFor","VisualLabel","undefined","UnforwardedVisualLabel","ref","restProps","BaseControl","Object","assign"],"sources":["@wordpress/components/src/base-control/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport deprecated from '@wordpress/deprecated';\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { VisuallyHidden } from '../visually-hidden';\nimport type { BaseControlProps, BaseControlVisualLabelProps } from './types';\nimport {\n\tWrapper,\n\tStyledField,\n\tStyledLabel,\n\tStyledHelp,\n\tStyledVisualLabel,\n} from './styles/base-control-styles';\nimport type { WordPressComponentProps } from '../context';\nimport { contextConnectWithoutRef, useContextSystem } from '../context';\n\nexport { useBaseControlProps } from './hooks';\n\nconst UnconnectedBaseControl = (\n\tprops: WordPressComponentProps< BaseControlProps, null >\n) => {\n\tconst {\n\t\t__nextHasNoMarginBottom = false,\n\t\t__associatedWPComponentName = 'BaseControl',\n\t\tid,\n\t\tlabel,\n\t\thideLabelFromVision = false,\n\t\thelp,\n\t\tclassName,\n\t\tchildren,\n\t} = useContextSystem( props, 'BaseControl' );\n\n\tif ( ! __nextHasNoMarginBottom ) {\n\t\tdeprecated(\n\t\t\t`Bottom margin styles for wp.components.${ __associatedWPComponentName }`,\n\t\t\t{\n\t\t\t\tsince: '6.7',\n\t\t\t\tversion: '7.0',\n\t\t\t\thint: 'Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version.',\n\t\t\t}\n\t\t);\n\t}\n\n\treturn (\n\t\t<Wrapper className={ className }>\n\t\t\t<StyledField\n\t\t\t\tclassName=\"components-base-control__field\"\n\t\t\t\t// TODO: Official deprecation for this should start after all internal usages have been migrated\n\t\t\t\t__nextHasNoMarginBottom={ __nextHasNoMarginBottom }\n\t\t\t>\n\t\t\t\t{ label &&\n\t\t\t\t\tid &&\n\t\t\t\t\t( hideLabelFromVision ? (\n\t\t\t\t\t\t<VisuallyHidden as=\"label\" htmlFor={ id }>\n\t\t\t\t\t\t\t{ label }\n\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<StyledLabel\n\t\t\t\t\t\t\tclassName=\"components-base-control__label\"\n\t\t\t\t\t\t\thtmlFor={ id }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ label }\n\t\t\t\t\t\t</StyledLabel>\n\t\t\t\t\t) ) }\n\t\t\t\t{ label &&\n\t\t\t\t\t! id &&\n\t\t\t\t\t( hideLabelFromVision ? (\n\t\t\t\t\t\t<VisuallyHidden as=\"label\">{ label }</VisuallyHidden>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<VisualLabel>{ label }</VisualLabel>\n\t\t\t\t\t) ) }\n\t\t\t\t{ children }\n\t\t\t</StyledField>\n\t\t\t{ !! help && (\n\t\t\t\t<StyledHelp\n\t\t\t\t\tid={ id ? id + '__help' : undefined }\n\t\t\t\t\tclassName=\"components-base-control__help\"\n\t\t\t\t\t__nextHasNoMarginBottom={ __nextHasNoMarginBottom }\n\t\t\t\t>\n\t\t\t\t\t{ help }\n\t\t\t\t</StyledHelp>\n\t\t\t) }\n\t\t</Wrapper>\n\t);\n};\n\nconst UnforwardedVisualLabel = (\n\tprops: WordPressComponentProps< BaseControlVisualLabelProps, 'span' >,\n\tref: ForwardedRef< any >\n) => {\n\tconst { className, children, ...restProps } = props;\n\n\treturn (\n\t\t<StyledVisualLabel\n\t\t\tref={ ref }\n\t\t\t{ ...restProps }\n\t\t\tclassName={ clsx( 'components-base-control__label', className ) }\n\t\t>\n\t\t\t{ children }\n\t\t</StyledVisualLabel>\n\t);\n};\n\nexport const VisualLabel = forwardRef( UnforwardedVisualLabel );\n\n/**\n * `BaseControl` is a component used to generate labels and help text for components handling user inputs.\n *\n * ```jsx\n * import { BaseControl, useBaseControlProps } from '@wordpress/components';\n *\n * // Render a `BaseControl` for a textarea input\n * const MyCustomTextareaControl = ({ children, ...baseProps }) => (\n * \t// `useBaseControlProps` is a convenience hook to get the props for the `BaseControl`\n * \t// and the inner control itself. Namely, it takes care of generating a unique `id`,\n * \t// properly associating it with the `label` and `help` elements.\n * \tconst { baseControlProps, controlProps } = useBaseControlProps( baseProps );\n *\n * \treturn (\n * \t\t<BaseControl { ...baseControlProps } __nextHasNoMarginBottom>\n * \t\t\t<textarea { ...controlProps }>\n * \t\t\t { children }\n * \t\t\t</textarea>\n * \t\t</BaseControl>\n * \t);\n * );\n * ```\n */\nexport const BaseControl = Object.assign(\n\tcontextConnectWithoutRef( UnconnectedBaseControl, 'BaseControl' ),\n\n\t{\n\t\t/**\n\t\t * `BaseControl.VisualLabel` is used to render a purely visual label inside a `BaseControl` component.\n\t\t *\n\t\t * It should only be used in cases where the children being rendered inside `BaseControl` are already accessibly labeled,\n\t\t * e.g., a button, but we want an additional visual label for that section equivalent to the labels `BaseControl` would\n\t\t * otherwise use if the `label` prop was passed.\n\t\t *\n\t\t * ```jsx\n\t\t * import { BaseControl } from '@wordpress/components';\n\t\t *\n\t\t * const MyBaseControl = () => (\n\t\t * \t<BaseControl\n\t\t * \t\t__nextHasNoMarginBottom\n\t\t * \t\thelp=\"This button is already accessibly labeled.\"\n\t\t * \t>\n\t\t * \t\t<BaseControl.VisualLabel>Author</BaseControl.VisualLabel>\n\t\t * \t\t<Button>Select an author</Button>\n\t\t * \t</BaseControl>\n\t\t * );\n\t\t * ```\n\t\t */\n\t\tVisualLabel,\n\t}\n);\n\nexport default BaseControl;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;AAGvB;AACA;AACA;AACA,OAAOC,UAAU,MAAM,uBAAuB;AAC9C,SAASC,UAAU,QAAQ,oBAAoB;;AAE/C;AACA;AACA;AACA,SAASC,cAAc,QAAQ,oBAAoB;AAEnD,SACCC,OAAO,EACPC,WAAW,EACXC,WAAW,EACXC,UAAU,EACVC,iBAAiB,Q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CAAe,CACnC,CAAE,EACFI,QAAQ;IAAA,CACE,CAAC,EACZ,CAAC,CAAEF,IAAI,iBACRX,IAAA,CAACL,UAAU;MACVa,EAAE,EAAGA,EAAE,GAAGA,EAAE,GAAG,QAAQ,GAAGY,SAAW;MACrCR,SAAS,EAAC,+BAA+B;MACzCN,uBAAuB,EAAGA,uBAAyB;MAAAO,QAAA,EAEjDF;IAAI,CACK,CACZ;EAAA,CACO,CAAC;AAEZ,CAAC;AAED,MAAMU,sBAAsB,GAAGA,CAC9BhB,KAAqE,EACrEiB,GAAwB,KACpB;EACJ,MAAM;IAAEV,SAAS;IAAEC,QAAQ;IAAE,GAAGU;EAAU,CAAC,GAAGlB,KAAK;EAEnD,oBACCL,IAAA,CAACJ,iBAAiB;IACjB0B,GAAG,EAAGA,GAAK;IAAA,GACNC,SAAS;IACdX,SAAS,EAAGxB,IAAI,CAAE,gCAAgC,EAAEwB,SAAU,CAAG;IAAAC,QAAA,EAE/DA;EAAQ,CACQ,CAAC;AAEtB,CAAC;AAED,OAAO,MAAMM,WAAW,GAAG7B,UAAU,CAAE+B,sBAAuB,CAAC;;AAE/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMG,WAAW,GAAGC,MAAM,CAACC,MAAM,CACvC7B,wBAAwB,CAAEO,sBAAsB,EAAE,aAAc,CAAC,EAEjE;EACC;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEe;AACD,CACD,CAAC;AAED,eAAeK,WAAW","ignoreList":[]}
@@ -2,8 +2,7 @@
2
2
  * External dependencies
3
3
  */
4
4
  import { Text, View } from 'react-native';
5
- import { jsx as _jsx } from "react/jsx-runtime";
6
- import { jsxs as _jsxs } from "react/jsx-runtime";
5
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
7
6
  export default function BaseControl({
8
7
  label,
9
8
  help,
@@ -1 +1 @@
1
- {"version":3,"names":["Text","View","jsx","_jsx","jsxs","_jsxs","BaseControl","label","help","children","accessible","accessibilityLabel"],"sources":["@wordpress/components/src/base-control/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { Text, View } from 'react-native';\n\nexport default function BaseControl( { label, help, children } ) {\n\treturn (\n\t\t<View accessible accessibilityLabel={ label }>\n\t\t\t{ label && <Text>{ label }</Text> }\n\t\t\t{ children }\n\t\t\t{ help && <Text>{ help }</Text> }\n\t\t</View>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,IAAI,EAAEC,IAAI,QAAQ,cAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAE1C,eAAe,SAASC,WAAWA,CAAE;EAAEC,KAAK;EAAEC,IAAI;EAAEC;AAAS,CAAC,EAAG;EAChE,oBACCJ,KAAA,CAACJ,IAAI;IAACS,UAAU;IAACC,kBAAkB,EAAGJ,KAAO;IAAAE,QAAA,GAC1CF,KAAK,iBAAIJ,IAAA,CAACH,IAAI;MAAAS,QAAA,EAAGF;IAAK,CAAQ,CAAC,EAC/BE,QAAQ,EACRD,IAAI,iBAAIL,IAAA,CAACH,IAAI;MAAAS,QAAA,EAAGD;IAAI,CAAQ,CAAC;EAAA,CAC1B,CAAC;AAET","ignoreList":[]}
1
+ {"version":3,"names":["Text","View","jsx","_jsx","jsxs","_jsxs","BaseControl","label","help","children","accessible","accessibilityLabel"],"sources":["@wordpress/components/src/base-control/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { Text, View } from 'react-native';\n\nexport default function BaseControl( { label, help, children } ) {\n\treturn (\n\t\t<View accessible accessibilityLabel={ label }>\n\t\t\t{ label && <Text>{ label }</Text> }\n\t\t\t{ children }\n\t\t\t{ help && <Text>{ help }</Text> }\n\t\t</View>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,IAAI,EAAEC,IAAI,QAAQ,cAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAE1C,eAAe,SAASC,WAAWA,CAAE;EAAEC,KAAK;EAAEC,IAAI;EAAEC;AAAS,CAAC,EAAG;EAChE,oBACCJ,KAAA,CAACJ,IAAI;IAACS,UAAU;IAACC,kBAAkB,EAAGJ,KAAO;IAAAE,QAAA,GAC1CF,KAAK,iBAAIJ,IAAA,CAACH,IAAI;MAAAS,QAAA,EAAGF;IAAK,CAAQ,CAAC,EAC/BE,QAAQ,EACRD,IAAI,iBAAIL,IAAA,CAACH,IAAI;MAAAS,QAAA,EAAGD;IAAI,CAAQ,CAAC;EAAA,CAC1B,CAAC;AAET","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["@wordpress/components/src/base-control/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ReactNode } from 'react';\n\nexport type BaseControlProps = {\n\t/**\n\t * Start opting into the new margin-free styles that will become the default in a future version.\n\t *\n\t * @default false\n\t */\n\t__nextHasNoMarginBottom?: boolean;\n\t/**\n\t * Temporary private prop for showing better deprecation messages,\n\t * e.g. `Some feature from wp.components.${ __associatedWPControl } is deprecated`.\n\t *\n\t * @ignore\n\t */\n\t__associatedWPComponentName?: string;\n\t/**\n\t * The HTML `id` of the control element (passed in as a child to `BaseControl`) to which labels and help text are being generated.\n\t * This is necessary to accessibly associate the label with that element.\n\t *\n\t * The recommended way is to use the `useBaseControlProps` hook, which takes care of generating a unique `id` for you.\n\t * Otherwise, if you choose to pass an explicit `id` to this prop, you are responsible for ensuring the uniqueness of the `id`.\n\t */\n\tid?: string;\n\t/**\n\t * Additional description for the control.\n\t *\n\t * Only use for meaningful description or instructions for the control. An element containing the description will be programmatically associated to the BaseControl by the means of an `aria-describedby` attribute.\n\t */\n\thelp?: ReactNode;\n\t/**\n\t * If this property is added, a label will be generated using label property as the content.\n\t */\n\tlabel?: ReactNode;\n\t/**\n\t * If true, the label will only be visible to screen readers.\n\t *\n\t * @default false\n\t */\n\thideLabelFromVision?: boolean;\n\tclassName?: string;\n\t/**\n\t * The content to be displayed within the `BaseControl`.\n\t */\n\tchildren: ReactNode;\n};\n\nexport type BaseControlVisualLabelProps = {\n\tchildren: ReactNode;\n};\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["@wordpress/components/src/base-control/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ReactNode } from 'react';\n\nexport type BaseControlProps = {\n\t/**\n\t * Start opting into the new margin-free styles that will become the default in a future version.\n\t *\n\t * @default false\n\t */\n\t__nextHasNoMarginBottom?: boolean;\n\t/**\n\t * Temporary private prop for showing better deprecation messages,\n\t * e.g. `Some feature from wp.components.${ __associatedWPControl } is deprecated`.\n\t *\n\t * @ignore\n\t */\n\t__associatedWPComponentName?: string;\n\t/**\n\t * The HTML `id` of the control element (passed in as a child to `BaseControl`) to which labels and help text are being generated.\n\t * This is necessary to accessibly associate the label with that element.\n\t *\n\t * The recommended way is to use the `useBaseControlProps` hook, which takes care of generating a unique `id` for you.\n\t * Otherwise, if you choose to pass an explicit `id` to this prop, you are responsible for ensuring the uniqueness of the `id`.\n\t */\n\tid?: string;\n\t/**\n\t * Additional description for the control.\n\t *\n\t * Only use for meaningful description or instructions for the control. An element containing the description will be programmatically associated to the BaseControl by the means of an `aria-describedby` attribute.\n\t */\n\thelp?: ReactNode;\n\t/**\n\t * If this property is added, a label will be generated using label property as the content.\n\t */\n\tlabel?: ReactNode;\n\t/**\n\t * If true, the label will only be visible to screen readers.\n\t *\n\t * @default false\n\t */\n\thideLabelFromVision?: boolean;\n\tclassName?: string;\n\t/**\n\t * The content to be displayed within the `BaseControl`.\n\t */\n\tchildren: ReactNode;\n};\n\nexport type BaseControlVisualLabelProps = {\n\t/**\n\t * The content to be displayed within the `BaseControl.VisualLabel`.\n\t */\n\tchildren: ReactNode;\n};\n"],"mappings":"","ignoreList":[]}
@@ -16,8 +16,7 @@ import { View } from '../../view';
16
16
  import { VisuallyHidden } from '../../visually-hidden';
17
17
  import { contextConnect } from '../../context';
18
18
  import { useBorderBoxControl } from './hook';
19
- import { jsx as _jsx } from "react/jsx-runtime";
20
- import { jsxs as _jsxs } from "react/jsx-runtime";
19
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
21
20
  const BorderLabel = props => {
22
21
  const {
23
22
  label,
@@ -146,6 +145,7 @@ const UnconnectedBorderBoxControl = (props, forwardedRef) => {
146
145
  *
147
146
  * return (
148
147
  * <BorderBoxControl
148
+ * __next40pxDefaultSize
149
149
  * colors={ colors }
150
150
  * label={ __( 'Borders' ) }
151
151
  * onChange={ onChange }
@@ -1 +1 @@
1
- {"version":3,"names":["__","useMemo","useState","useMergeRefs","BorderBoxControlLinkedButton","BorderBoxControlSplitControls","BorderControl","StyledLabel","View","VisuallyHidden","contextConnect","useBorderBoxControl","jsx","_jsx","jsxs","_jsxs","BorderLabel","props","label","hideLabelFromVision","as","children","UnconnectedBorderBoxControl","forwardedRef","className","colors","disableCustomColors","disableUnits","enableAlpha","enableStyle","hasMixedBorders","isLinked","linkedControlClassName","linkedValue","onLinkedChange","onSplitChange","popoverPlacement","popoverOffset","size","splitValue","toggleLinked","wrapperClassName","__experimentalIsRenderedInSidebar","otherProps","popoverAnchor","setPopoverAnchor","popoverProps","placement","offset","anchor","shift","undefined","mergedRef","ref","onChange","placeholder","__unstablePopoverProps","shouldSanitizeBorder","value","withSlider","width","onClick","BorderBoxControl"],"sources":["@wordpress/components/src/border-box-control/border-box-control/component.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useMemo, useState } from '@wordpress/element';\nimport { useMergeRefs } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport BorderBoxControlLinkedButton from '../border-box-control-linked-button';\nimport BorderBoxControlSplitControls from '../border-box-control-split-controls';\nimport { BorderControl } from '../../border-control';\nimport { StyledLabel } from '../../base-control/styles/base-control-styles';\nimport { View } from '../../view';\nimport { VisuallyHidden } from '../../visually-hidden';\nimport type { WordPressComponentProps } from '../../context';\nimport { contextConnect } from '../../context';\nimport { useBorderBoxControl } from './hook';\n\nimport type { BorderBoxControlProps } from '../types';\nimport type {\n\tLabelProps,\n\tBorderControlProps,\n} from '../../border-control/types';\n\nconst BorderLabel = ( props: LabelProps ) => {\n\tconst { label, hideLabelFromVision } = props;\n\n\tif ( ! label ) {\n\t\treturn null;\n\t}\n\n\treturn hideLabelFromVision ? (\n\t\t<VisuallyHidden as=\"label\">{ label }</VisuallyHidden>\n\t) : (\n\t\t<StyledLabel>{ label }</StyledLabel>\n\t);\n};\n\nconst UnconnectedBorderBoxControl = (\n\tprops: WordPressComponentProps< BorderBoxControlProps, 'div', false >,\n\tforwardedRef: React.ForwardedRef< any >\n) => {\n\tconst {\n\t\tclassName,\n\t\tcolors,\n\t\tdisableCustomColors,\n\t\tdisableUnits,\n\t\tenableAlpha,\n\t\tenableStyle,\n\t\thasMixedBorders,\n\t\thideLabelFromVision,\n\t\tisLinked,\n\t\tlabel,\n\t\tlinkedControlClassName,\n\t\tlinkedValue,\n\t\tonLinkedChange,\n\t\tonSplitChange,\n\t\tpopoverPlacement,\n\t\tpopoverOffset,\n\t\tsize,\n\t\tsplitValue,\n\t\ttoggleLinked,\n\t\twrapperClassName,\n\t\t__experimentalIsRenderedInSidebar,\n\t\t...otherProps\n\t} = useBorderBoxControl( props );\n\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the popover's anchor updates.\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState< Element | null >(\n\t\tnull\n\t);\n\n\t// Memoize popoverProps to avoid returning a new object every time.\n\tconst popoverProps: BorderControlProps[ '__unstablePopoverProps' ] =\n\t\tuseMemo(\n\t\t\t() =>\n\t\t\t\tpopoverPlacement\n\t\t\t\t\t? {\n\t\t\t\t\t\t\tplacement: popoverPlacement,\n\t\t\t\t\t\t\toffset: popoverOffset,\n\t\t\t\t\t\t\tanchor: popoverAnchor,\n\t\t\t\t\t\t\tshift: true,\n\t\t\t\t\t }\n\t\t\t\t\t: undefined,\n\t\t\t[ popoverPlacement, popoverOffset, popoverAnchor ]\n\t\t);\n\n\tconst mergedRef = useMergeRefs( [ setPopoverAnchor, forwardedRef ] );\n\treturn (\n\t\t<View className={ className } { ...otherProps } ref={ mergedRef }>\n\t\t\t<BorderLabel\n\t\t\t\tlabel={ label }\n\t\t\t\thideLabelFromVision={ hideLabelFromVision }\n\t\t\t/>\n\t\t\t<View className={ wrapperClassName }>\n\t\t\t\t{ isLinked ? (\n\t\t\t\t\t<BorderControl\n\t\t\t\t\t\tclassName={ linkedControlClassName }\n\t\t\t\t\t\tcolors={ colors }\n\t\t\t\t\t\tdisableUnits={ disableUnits }\n\t\t\t\t\t\tdisableCustomColors={ disableCustomColors }\n\t\t\t\t\t\tenableAlpha={ enableAlpha }\n\t\t\t\t\t\tenableStyle={ enableStyle }\n\t\t\t\t\t\tonChange={ onLinkedChange }\n\t\t\t\t\t\tplaceholder={\n\t\t\t\t\t\t\thasMixedBorders ? __( 'Mixed' ) : undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t\t__unstablePopoverProps={ popoverProps }\n\t\t\t\t\t\tshouldSanitizeBorder={ false } // This component will handle that.\n\t\t\t\t\t\tvalue={ linkedValue }\n\t\t\t\t\t\twithSlider\n\t\t\t\t\t\twidth={\n\t\t\t\t\t\t\tsize === '__unstable-large' ? '116px' : '110px'\n\t\t\t\t\t\t}\n\t\t\t\t\t\t__experimentalIsRenderedInSidebar={\n\t\t\t\t\t\t\t__experimentalIsRenderedInSidebar\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsize={ size }\n\t\t\t\t\t/>\n\t\t\t\t) : (\n\t\t\t\t\t<BorderBoxControlSplitControls\n\t\t\t\t\t\tcolors={ colors }\n\t\t\t\t\t\tdisableCustomColors={ disableCustomColors }\n\t\t\t\t\t\tenableAlpha={ enableAlpha }\n\t\t\t\t\t\tenableStyle={ enableStyle }\n\t\t\t\t\t\tonChange={ onSplitChange }\n\t\t\t\t\t\tpopoverPlacement={ popoverPlacement }\n\t\t\t\t\t\tpopoverOffset={ popoverOffset }\n\t\t\t\t\t\tvalue={ splitValue }\n\t\t\t\t\t\t__experimentalIsRenderedInSidebar={\n\t\t\t\t\t\t\t__experimentalIsRenderedInSidebar\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsize={ size }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t<BorderBoxControlLinkedButton\n\t\t\t\t\tonClick={ toggleLinked }\n\t\t\t\t\tisLinked={ isLinked }\n\t\t\t\t\tsize={ size }\n\t\t\t\t/>\n\t\t\t</View>\n\t\t</View>\n\t);\n};\n\n/**\n * An input control for the color, style, and width of the border of a box. The\n * border can be customized as a whole, or individually for each side of the box.\n *\n * ```jsx\n * import { BorderBoxControl } from '@wordpress/components';\n * import { __ } from '@wordpress/i18n';\n *\n * const colors = [\n * \t{ name: 'Blue 20', color: '#72aee6' },\n * \t// ...\n * ];\n *\n * const MyBorderBoxControl = () => {\n * \tconst defaultBorder = {\n * \t\tcolor: '#72aee6',\n * \t\tstyle: 'dashed',\n * \t\twidth: '1px',\n * \t};\n * \tconst [ borders, setBorders ] = useState( {\n * \t\ttop: defaultBorder,\n * \t\tright: defaultBorder,\n * \t\tbottom: defaultBorder,\n * \t\tleft: defaultBorder,\n * \t} );\n * \tconst onChange = ( newBorders ) => setBorders( newBorders );\n *\n * \treturn (\n * \t\t<BorderBoxControl\n * \t\t\tcolors={ colors }\n * \t\t\tlabel={ __( 'Borders' ) }\n * \t\t\tonChange={ onChange }\n * \t\t\tvalue={ borders }\n * \t\t/>\n * \t);\n * };\n * ```\n */\nexport const BorderBoxControl = contextConnect(\n\tUnconnectedBorderBoxControl,\n\t'BorderBoxControl'\n);\n\nexport default BorderBoxControl;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE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MAAM,CACb,CAAC,gBAEFzB,IAAA,CAACR,6BAA6B;QAC7BoB,MAAM,EAAGA,MAAQ;QACjBC,mBAAmB,EAAGA,mBAAqB;QAC3CE,WAAW,EAAGA,WAAa;QAC3BC,WAAW,EAAGA,WAAa;QAC3ByB,QAAQ,EAAGnB,aAAe;QAC1BC,gBAAgB,EAAGA,gBAAkB;QACrCC,aAAa,EAAGA,aAAe;QAC/BqB,KAAK,EAAGnB,UAAY;QACpBG,iCAAiC,EAChCA,iCACA;QACDJ,IAAI,EAAGA;MAAM,CACb,CACD,eACDzB,IAAA,CAACT,4BAA4B;QAC5ByD,OAAO,EAAGrB,YAAc;QACxBT,QAAQ,EAAGA,QAAU;QACrBO,IAAI,EAAGA;MAAM,CACb,CAAC;IAAA,CACG,CAAC;EAAA,CACF,CAAC;AAET,CAAC;;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,OAAO,MAAMwB,gBAAgB,GAAGpD,cAAc,CAC7CY,2BAA2B,EAC3B,kBACD,CAAC;AAED,eAAewC,gBAAgB","ignoreList":[]}
1
+ {"version":3,"names":["__","useMemo","useState","useMergeRefs","BorderBoxControlLinkedButton","BorderBoxControlSplitControls","BorderControl","StyledLabel","View","VisuallyHidden","contextConnect","useBorderBoxControl","jsx","_jsx","jsxs","_jsxs","BorderLabel","props","label","hideLabelFromVision","as","children","UnconnectedBorderBoxControl","forwardedRef","className","colors","disableCustomColors","disableUnits","enableAlpha","enableStyle","hasMixedBorders","isLinked","linkedControlClassName","linkedValue","onLinkedChange","onSplitChange","popoverPlacement","popoverOffset","size","splitValue","toggleLinked","wrapperClassName","__experimentalIsRenderedInSidebar","otherProps","popoverAnchor","setPopoverAnchor","popoverProps","placement","offset","anchor","shift","undefined","mergedRef","ref","onChange","placeholder","__unstablePopoverProps","shouldSanitizeBorder","value","withSlider","width","onClick","BorderBoxControl"],"sources":["@wordpress/components/src/border-box-control/border-box-control/component.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useMemo, useState } from '@wordpress/element';\nimport { useMergeRefs } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport BorderBoxControlLinkedButton from '../border-box-control-linked-button';\nimport BorderBoxControlSplitControls from '../border-box-control-split-controls';\nimport { BorderControl } from '../../border-control';\nimport { StyledLabel } from '../../base-control/styles/base-control-styles';\nimport { View } from '../../view';\nimport { VisuallyHidden } from '../../visually-hidden';\nimport type { WordPressComponentProps } from '../../context';\nimport { contextConnect } from '../../context';\nimport { useBorderBoxControl } from './hook';\n\nimport type { BorderBoxControlProps } from '../types';\nimport type {\n\tLabelProps,\n\tBorderControlProps,\n} from '../../border-control/types';\n\nconst BorderLabel = ( props: LabelProps ) => {\n\tconst { label, hideLabelFromVision } = props;\n\n\tif ( ! label ) {\n\t\treturn null;\n\t}\n\n\treturn hideLabelFromVision ? (\n\t\t<VisuallyHidden as=\"label\">{ label }</VisuallyHidden>\n\t) : (\n\t\t<StyledLabel>{ label }</StyledLabel>\n\t);\n};\n\nconst UnconnectedBorderBoxControl = (\n\tprops: WordPressComponentProps< BorderBoxControlProps, 'div', false >,\n\tforwardedRef: React.ForwardedRef< any >\n) => {\n\tconst {\n\t\tclassName,\n\t\tcolors,\n\t\tdisableCustomColors,\n\t\tdisableUnits,\n\t\tenableAlpha,\n\t\tenableStyle,\n\t\thasMixedBorders,\n\t\thideLabelFromVision,\n\t\tisLinked,\n\t\tlabel,\n\t\tlinkedControlClassName,\n\t\tlinkedValue,\n\t\tonLinkedChange,\n\t\tonSplitChange,\n\t\tpopoverPlacement,\n\t\tpopoverOffset,\n\t\tsize,\n\t\tsplitValue,\n\t\ttoggleLinked,\n\t\twrapperClassName,\n\t\t__experimentalIsRenderedInSidebar,\n\t\t...otherProps\n\t} = useBorderBoxControl( props );\n\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the popover's anchor updates.\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState< Element | null >(\n\t\tnull\n\t);\n\n\t// Memoize popoverProps to avoid returning a new object every time.\n\tconst popoverProps: BorderControlProps[ '__unstablePopoverProps' ] =\n\t\tuseMemo(\n\t\t\t() =>\n\t\t\t\tpopoverPlacement\n\t\t\t\t\t? {\n\t\t\t\t\t\t\tplacement: popoverPlacement,\n\t\t\t\t\t\t\toffset: popoverOffset,\n\t\t\t\t\t\t\tanchor: popoverAnchor,\n\t\t\t\t\t\t\tshift: true,\n\t\t\t\t\t }\n\t\t\t\t\t: undefined,\n\t\t\t[ popoverPlacement, popoverOffset, popoverAnchor ]\n\t\t);\n\n\tconst mergedRef = useMergeRefs( [ setPopoverAnchor, forwardedRef ] );\n\treturn (\n\t\t<View className={ className } { ...otherProps } ref={ mergedRef }>\n\t\t\t<BorderLabel\n\t\t\t\tlabel={ label }\n\t\t\t\thideLabelFromVision={ hideLabelFromVision }\n\t\t\t/>\n\t\t\t<View className={ wrapperClassName }>\n\t\t\t\t{ isLinked ? (\n\t\t\t\t\t<BorderControl\n\t\t\t\t\t\tclassName={ linkedControlClassName }\n\t\t\t\t\t\tcolors={ colors }\n\t\t\t\t\t\tdisableUnits={ disableUnits }\n\t\t\t\t\t\tdisableCustomColors={ disableCustomColors }\n\t\t\t\t\t\tenableAlpha={ enableAlpha }\n\t\t\t\t\t\tenableStyle={ enableStyle }\n\t\t\t\t\t\tonChange={ onLinkedChange }\n\t\t\t\t\t\tplaceholder={\n\t\t\t\t\t\t\thasMixedBorders ? __( 'Mixed' ) : undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t\t__unstablePopoverProps={ popoverProps }\n\t\t\t\t\t\tshouldSanitizeBorder={ false } // This component will handle that.\n\t\t\t\t\t\tvalue={ linkedValue }\n\t\t\t\t\t\twithSlider\n\t\t\t\t\t\twidth={\n\t\t\t\t\t\t\tsize === '__unstable-large' ? '116px' : '110px'\n\t\t\t\t\t\t}\n\t\t\t\t\t\t__experimentalIsRenderedInSidebar={\n\t\t\t\t\t\t\t__experimentalIsRenderedInSidebar\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsize={ size }\n\t\t\t\t\t/>\n\t\t\t\t) : (\n\t\t\t\t\t<BorderBoxControlSplitControls\n\t\t\t\t\t\tcolors={ colors }\n\t\t\t\t\t\tdisableCustomColors={ disableCustomColors }\n\t\t\t\t\t\tenableAlpha={ enableAlpha }\n\t\t\t\t\t\tenableStyle={ enableStyle }\n\t\t\t\t\t\tonChange={ onSplitChange }\n\t\t\t\t\t\tpopoverPlacement={ popoverPlacement }\n\t\t\t\t\t\tpopoverOffset={ popoverOffset }\n\t\t\t\t\t\tvalue={ splitValue }\n\t\t\t\t\t\t__experimentalIsRenderedInSidebar={\n\t\t\t\t\t\t\t__experimentalIsRenderedInSidebar\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsize={ size }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t<BorderBoxControlLinkedButton\n\t\t\t\t\tonClick={ toggleLinked }\n\t\t\t\t\tisLinked={ isLinked }\n\t\t\t\t\tsize={ size }\n\t\t\t\t/>\n\t\t\t</View>\n\t\t</View>\n\t);\n};\n\n/**\n * An input control for the color, style, and width of the border of a box. The\n * border can be customized as a whole, or individually for each side of the box.\n *\n * ```jsx\n * import { BorderBoxControl } from '@wordpress/components';\n * import { __ } from '@wordpress/i18n';\n *\n * const colors = [\n * \t{ name: 'Blue 20', color: '#72aee6' },\n * \t// ...\n * ];\n *\n * const MyBorderBoxControl = () => {\n * \tconst defaultBorder = {\n * \t\tcolor: '#72aee6',\n * \t\tstyle: 'dashed',\n * \t\twidth: '1px',\n * \t};\n * \tconst [ borders, setBorders ] = useState( {\n * \t\ttop: defaultBorder,\n * \t\tright: defaultBorder,\n * \t\tbottom: defaultBorder,\n * \t\tleft: defaultBorder,\n * \t} );\n * \tconst onChange = ( newBorders ) => setBorders( newBorders );\n *\n * \treturn (\n * \t\t<BorderBoxControl\n * \t\t\t__next40pxDefaultSize\n * \t\t\tcolors={ colors }\n * \t\t\tlabel={ __( 'Borders' ) }\n * \t\t\tonChange={ onChange }\n * \t\t\tvalue={ borders }\n * \t\t/>\n * \t);\n * };\n * ```\n */\nexport const BorderBoxControl = contextConnect(\n\tUnconnectedBorderBoxControl,\n\t'BorderBoxControl'\n);\n\nexport default BorderBoxControl;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,OAAO,EAAEC,QAAQ,QAAQ,oBAAoB;AACtD,SAASC,YAAY,QAAQ,oBAAoB;;AAEjD;AACA;AACA;AACA,OAAOC,4BAA4B,MAAM,qCAAqC;AAC9E,OAAOC,6BAA6B,MAAM,sCAAsC;AAChF,SAASC,aAAa,QAAQ,sBAAsB;AACpD,SAASC,WAAW,QAAQ,+CAA+C;AAC3E,SAASC,IAAI,QAAQ,YAAY;AACjC,SAASC,cAAc,QAAQ,uBAAuB;AAEtD,SAASC,cAAc,QAAQ,eAAe;AAC9C,SAASC,mBAAmB,QAAQ,QAAQ;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAQ7C,MAAMC,WAAW,GAAKC,KAAiB,IAAM;EAC5C,MAAM;IAAEC,KAAK;IAAEC;EAAoB,CAAC,GAAGF,KAAK;EAE5C,IAAK,CAAEC,KAAK,EAAG;IACd,OAAO,IAAI;EACZ;EAEA,OAAOC,mBAAmB,gBACzBN,IAAA,CAACJ,cAAc;IAACW,EAAE,EAAC,OAAO;IAAAC,QAAA,EAAGH;EAAK,CAAkB,CAAC,gBAErDL,IAAA,CAACN,WAAW;IAAAc,QAAA,EAAGH;EAAK,CAAe,CACnC;AACF,CAAC;AAED,MAAMI,2BAA2B,GAAGA,CACnCL,KAAqE,EACrEM,YAAuC,KACnC;EACJ,MAAM;IACLC,SA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,EAAGA,WAAa;QAC3ByB,QAAQ,EAAGpB,cAAgB;QAC3BqB,WAAW,EACVzB,eAAe,GAAG9B,EAAE,CAAE,OAAQ,CAAC,GAAGmD,SAClC;QACDK,sBAAsB,EAAGV,YAAc;QACvCW,oBAAoB,EAAG,KAAO,CAAC;QAAA;QAC/BC,KAAK,EAAGzB,WAAa;QACrB0B,UAAU;QACVC,KAAK,EACJtB,IAAI,KAAK,kBAAkB,GAAG,OAAO,GAAG,OACxC;QACDI,iCAAiC,EAChCA,iCACA;QACDJ,IAAI,EAAGA;MAAM,CACb,CAAC,gBAEFzB,IAAA,CAACR,6BAA6B;QAC7BoB,MAAM,EAAGA,MAAQ;QACjBC,mBAAmB,EAAGA,mBAAqB;QAC3CE,WAAW,EAAGA,WAAa;QAC3BC,WAAW,EAAGA,WAAa;QAC3ByB,QAAQ,EAAGnB,aAAe;QAC1BC,gBAAgB,EAAGA,gBAAkB;QACrCC,aAAa,EAAGA,aAAe;QAC/BqB,KAAK,EAAGnB,UAAY;QACpBG,iCAAiC,EAChCA,iCACA;QACDJ,IAAI,EAAGA;MAAM,CACb,CACD,eACDzB,IAAA,CAACT,4BAA4B;QAC5ByD,OAAO,EAAGrB,YAAc;QACxBT,QAAQ,EAAGA,QAAU;QACrBO,IAAI,EAAGA;MAAM,CACb,CAAC;IAAA,CACG,CAAC;EAAA,CACF,CAAC;AAET,CAAC;;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,OAAO,MAAMwB,gBAAgB,GAAGpD,cAAc,CAC7CY,2BAA2B,EAC3B,kBACD,CAAC;AAED,eAAewC,gBAAgB","ignoreList":[]}
@@ -10,6 +10,7 @@ import * as styles from '../styles';
10
10
  import { getBorderDiff, getCommonBorder, getSplitBorders, hasMixedBorders, hasSplitBorders, isCompleteBorder, isEmptyBorder } from '../utils';
11
11
  import { useContextSystem } from '../../context';
12
12
  import { useCx } from '../../utils/hooks/use-cx';
13
+ import { maybeWarnDeprecated36pxSize } from '../../utils/deprecated-36px-size';
13
14
  export function useBorderBoxControl(props) {
14
15
  const {
15
16
  className,
@@ -23,6 +24,11 @@ export function useBorderBoxControl(props) {
23
24
  __next40pxDefaultSize,
24
25
  ...otherProps
25
26
  } = useContextSystem(props, 'BorderBoxControl');
27
+ maybeWarnDeprecated36pxSize({
28
+ componentName: 'BorderBoxControl',
29
+ __next40pxDefaultSize,
30
+ size
31
+ });
26
32
  const computedSize = size === 'default' && __next40pxDefaultSize ? '__unstable-large' : size;
27
33
  const mixedBorders = hasMixedBorders(value);
28
34
  const splitBorders = hasSplitBorders(value);