@astryxdesign/core 0.7.7-canary.550ff21 → 0.7.7-canary.58c5b8a

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 (504) hide show
  1. package/dist/AlertDialog/AlertDialog.d.ts +4 -1
  2. package/dist/AlertDialog/AlertDialog.d.ts.map +1 -1
  3. package/dist/AlertDialog/AlertDialog.js +36 -6
  4. package/dist/AppShell/useCloseMobileDrawerOnActivate.d.ts +13 -0
  5. package/dist/AppShell/useCloseMobileDrawerOnActivate.d.ts.map +1 -0
  6. package/dist/AppShell/useCloseMobileDrawerOnActivate.js +45 -0
  7. package/dist/Avatar/Avatar.d.ts.map +1 -1
  8. package/dist/Avatar/Avatar.js +1 -1
  9. package/dist/BottomSheet/BottomSheet.d.ts.map +1 -1
  10. package/dist/BottomSheet/BottomSheet.js +79 -9
  11. package/dist/BottomSheet/BottomSheetPanel.d.ts.map +1 -1
  12. package/dist/BottomSheet/BottomSheetPanel.js +23 -4
  13. package/dist/BottomSheet/bottomSheetStack.d.ts.map +1 -1
  14. package/dist/BottomSheet/bottomSheetStack.js +5 -4
  15. package/dist/BottomSheet/useSheetGestures.d.ts.map +1 -1
  16. package/dist/BottomSheet/useSheetGestures.js +3 -1
  17. package/dist/Breadcrumbs/BreadcrumbItem.d.ts +2 -1
  18. package/dist/Breadcrumbs/BreadcrumbItem.d.ts.map +1 -1
  19. package/dist/Breadcrumbs/BreadcrumbItem.js +9 -4
  20. package/dist/Button/Button.d.ts.map +1 -1
  21. package/dist/Button/Button.js +50 -5
  22. package/dist/CheckboxList/CheckboxList.d.ts.map +1 -1
  23. package/dist/CheckboxList/CheckboxList.js +7 -1
  24. package/dist/CheckboxList/CheckboxListContext.d.ts +6 -0
  25. package/dist/CheckboxList/CheckboxListContext.d.ts.map +1 -1
  26. package/dist/CheckboxList/CheckboxListItem.d.ts.map +1 -1
  27. package/dist/CheckboxList/CheckboxListItem.js +10 -2
  28. package/dist/ComplexSelector/ComplexSelector.d.ts +4 -1
  29. package/dist/ComplexSelector/ComplexSelector.d.ts.map +1 -1
  30. package/dist/ComplexSelector/ComplexSelector.js +14 -4
  31. package/dist/DateInput/DateInput.d.ts.map +1 -1
  32. package/dist/DateInput/DateInput.js +5 -2
  33. package/dist/DateInput/MonthScroller.d.ts.map +1 -1
  34. package/dist/DateInput/MonthScroller.js +13 -27
  35. package/dist/DateInput/Wheel.d.ts +17 -1
  36. package/dist/DateInput/Wheel.d.ts.map +1 -1
  37. package/dist/DateInput/Wheel.js +161 -20
  38. package/dist/DateRangeInput/DateRangeInput.d.ts.map +1 -1
  39. package/dist/DateRangeInput/DateRangeInput.js +63 -49
  40. package/dist/DateTimeInput/DateTimeInput.d.ts.map +1 -1
  41. package/dist/DateTimeInput/DateTimeInput.js +5 -2
  42. package/dist/Dialog/Dialog.d.ts.map +1 -1
  43. package/dist/Dialog/Dialog.js +53 -15
  44. package/dist/Drawer/Drawer.d.ts.map +1 -1
  45. package/dist/Drawer/Drawer.js +15 -11
  46. package/dist/Drawer/useDrawerDialogPresence.d.ts.map +1 -1
  47. package/dist/Drawer/useDrawerDialogPresence.js +9 -1
  48. package/dist/DropdownMenu/DropdownMenu.d.ts.map +1 -1
  49. package/dist/DropdownMenu/DropdownMenu.js +20 -4
  50. package/dist/Field/Field.js +2 -2
  51. package/dist/Field/PanelSearchInput.d.ts +9 -1
  52. package/dist/Field/PanelSearchInput.d.ts.map +1 -1
  53. package/dist/Field/PanelSearchInput.js +3 -1
  54. package/dist/HoverCard/HoverCard.d.ts.map +1 -1
  55. package/dist/HoverCard/HoverCard.js +27 -2
  56. package/dist/Icon/Icon.d.ts +5 -1
  57. package/dist/Icon/Icon.d.ts.map +1 -1
  58. package/dist/Icon/Icon.js +5 -2
  59. package/dist/InfoTip/InfoTip.d.ts +63 -0
  60. package/dist/InfoTip/InfoTip.d.ts.map +1 -0
  61. package/dist/InfoTip/InfoTip.js +126 -0
  62. package/dist/InfoTip/index.d.ts +10 -0
  63. package/dist/InfoTip/index.d.ts.map +1 -0
  64. package/dist/InfoTip/index.js +12 -0
  65. package/dist/Layer/layerAnimations.stylex.d.ts +7 -8
  66. package/dist/Layer/layerAnimations.stylex.d.ts.map +1 -1
  67. package/dist/Layer/layerAnimations.stylex.js +25 -20
  68. package/dist/Layer/layerClickBoundary.d.ts +7 -1
  69. package/dist/Layer/layerClickBoundary.d.ts.map +1 -1
  70. package/dist/Layer/layerClickBoundary.js +2 -2
  71. package/dist/Layer/useBackdropPress.d.ts +27 -0
  72. package/dist/Layer/useBackdropPress.d.ts.map +1 -0
  73. package/dist/Layer/useBackdropPress.js +53 -0
  74. package/dist/Layer/usePressPin.d.ts +105 -0
  75. package/dist/Layer/usePressPin.d.ts.map +1 -0
  76. package/dist/Layer/usePressPin.js +413 -0
  77. package/dist/Layer/useTouchTrigger.d.ts +23 -1
  78. package/dist/Layer/useTouchTrigger.d.ts.map +1 -1
  79. package/dist/Layer/useTouchTrigger.js +45 -7
  80. package/dist/Lightbox/Lightbox.d.ts.map +1 -1
  81. package/dist/Lightbox/Lightbox.js +2 -1
  82. package/dist/MobileNav/MobileNav.js +0 -1
  83. package/dist/MultiSelector/hooks.d.ts.map +1 -1
  84. package/dist/MultiSelector/hooks.js +2 -4
  85. package/dist/Outline/Outline.d.ts +2 -4
  86. package/dist/Outline/Outline.d.ts.map +1 -1
  87. package/dist/Outline/Outline.js +4 -52
  88. package/dist/Outline/useOutlineFromMarkdown.d.ts.map +1 -1
  89. package/dist/Outline/useOutlineFromMarkdown.js +1 -0
  90. package/dist/Outline/useScrollSpy.js +3 -3
  91. package/dist/Popover/usePopover.d.ts.map +1 -1
  92. package/dist/Popover/usePopover.js +56 -7
  93. package/dist/PowerSearch/PowerSearch.d.ts +36 -3
  94. package/dist/PowerSearch/PowerSearch.d.ts.map +1 -1
  95. package/dist/PowerSearch/PowerSearch.js +571 -302
  96. package/dist/PowerSearch/PowerSearchBottomSheet.d.ts +100 -0
  97. package/dist/PowerSearch/PowerSearchBottomSheet.d.ts.map +1 -0
  98. package/dist/PowerSearch/PowerSearchBottomSheet.js +1913 -0
  99. package/dist/PowerSearch/PowerSearchEditPopover.d.ts +32 -1
  100. package/dist/PowerSearch/PowerSearchEditPopover.d.ts.map +1 -1
  101. package/dist/PowerSearch/PowerSearchEditPopover.js +17 -6
  102. package/dist/PowerSearch/PowerSearchValueEditor.d.ts +38 -3
  103. package/dist/PowerSearch/PowerSearchValueEditor.d.ts.map +1 -1
  104. package/dist/PowerSearch/PowerSearchValueEditor.js +170 -61
  105. package/dist/PowerSearch/formatFilterValue.d.ts +7 -0
  106. package/dist/PowerSearch/formatFilterValue.d.ts.map +1 -1
  107. package/dist/PowerSearch/formatFilterValue.js +11 -1
  108. package/dist/PowerSearch/formatTokenValue.d.ts +28 -0
  109. package/dist/PowerSearch/formatTokenValue.d.ts.map +1 -0
  110. package/dist/PowerSearch/formatTokenValue.js +160 -0
  111. package/dist/PowerSearch/powerSearchSheetUtils.d.ts +65 -0
  112. package/dist/PowerSearch/powerSearchSheetUtils.d.ts.map +1 -0
  113. package/dist/PowerSearch/powerSearchSheetUtils.js +168 -0
  114. package/dist/ProgressBar/ProgressBar.d.ts +1 -1
  115. package/dist/ProgressBar/ProgressBar.d.ts.map +1 -1
  116. package/dist/ProgressBar/ProgressBar.js +33 -6
  117. package/dist/RadioList/RadioList.d.ts.map +1 -1
  118. package/dist/RadioList/RadioList.js +8 -2
  119. package/dist/RadioList/RadioListItem.d.ts +1 -1
  120. package/dist/RadioList/RadioListItem.d.ts.map +1 -1
  121. package/dist/RadioList/RadioListItem.js +5 -3
  122. package/dist/Resizable/ResizeHandle.d.ts.map +1 -1
  123. package/dist/Resizable/ResizeHandle.js +118 -260
  124. package/dist/Resizable/resizeGesture.d.ts +91 -0
  125. package/dist/Resizable/resizeGesture.d.ts.map +1 -0
  126. package/dist/Resizable/resizeGesture.js +251 -0
  127. package/dist/SegmentedControl/SegmentedControl.d.ts +3 -1
  128. package/dist/SegmentedControl/SegmentedControl.d.ts.map +1 -1
  129. package/dist/SegmentedControl/SegmentedControl.js +115 -8
  130. package/dist/SegmentedControl/SegmentedControlContext.d.ts +6 -0
  131. package/dist/SegmentedControl/SegmentedControlContext.d.ts.map +1 -1
  132. package/dist/SegmentedControl/SegmentedControlItem.d.ts +1 -0
  133. package/dist/SegmentedControl/SegmentedControlItem.d.ts.map +1 -1
  134. package/dist/SegmentedControl/SegmentedControlItem.js +10 -2
  135. package/dist/SegmentedControl/useSegmentedSelectionMotion.d.ts +357 -0
  136. package/dist/SegmentedControl/useSegmentedSelectionMotion.d.ts.map +1 -0
  137. package/dist/SegmentedControl/useSegmentedSelectionMotion.js +1349 -0
  138. package/dist/SegmentedControl/useSegmentedTouchTracking.d.ts +70 -0
  139. package/dist/SegmentedControl/useSegmentedTouchTracking.d.ts.map +1 -0
  140. package/dist/SegmentedControl/useSegmentedTouchTracking.js +264 -0
  141. package/dist/Selector/Selector.d.ts.map +1 -1
  142. package/dist/Selector/Selector.js +96 -67
  143. package/dist/Selector/optionShape.d.ts +24 -0
  144. package/dist/Selector/optionShape.d.ts.map +1 -0
  145. package/dist/Selector/optionShape.js +48 -0
  146. package/dist/Selector/selectableOptionEntries.d.ts +20 -0
  147. package/dist/Selector/selectableOptionEntries.d.ts.map +1 -0
  148. package/dist/Selector/selectableOptionEntries.js +38 -0
  149. package/dist/Selector/utils.d.ts +2 -17
  150. package/dist/Selector/utils.d.ts.map +1 -1
  151. package/dist/Selector/utils.js +3 -51
  152. package/dist/SideNav/SideNavItem.d.ts.map +1 -1
  153. package/dist/SideNav/SideNavItem.js +3 -9
  154. package/dist/Slider/sliderTouchController.js +2 -2
  155. package/dist/Switch/Switch.d.ts +1 -1
  156. package/dist/Switch/Switch.d.ts.map +1 -1
  157. package/dist/Switch/Switch.js +200 -46
  158. package/dist/Switch/switchFill.d.ts +31 -0
  159. package/dist/Switch/switchFill.d.ts.map +1 -0
  160. package/dist/Switch/switchFill.js +88 -0
  161. package/dist/Switch/switchTouch.d.ts +74 -0
  162. package/dist/Switch/switchTouch.d.ts.map +1 -0
  163. package/dist/Switch/switchTouch.js +125 -0
  164. package/dist/Switch/useSwitchTouch.d.ts +276 -0
  165. package/dist/Switch/useSwitchTouch.d.ts.map +1 -0
  166. package/dist/Switch/useSwitchTouch.js +939 -0
  167. package/dist/TabList/Tab.d.ts.map +1 -1
  168. package/dist/TabList/Tab.js +4 -3
  169. package/dist/Table/BaseTable.d.ts.map +1 -1
  170. package/dist/Table/BaseTable.js +29 -8
  171. package/dist/TextInput/TextInput.d.ts +2 -2
  172. package/dist/TextInput/TextInput.d.ts.map +1 -1
  173. package/dist/TextInput/TextInput.js +10 -7
  174. package/dist/Toast/Toast.d.ts.map +1 -1
  175. package/dist/Toast/Toast.js +5 -0
  176. package/dist/Token/Token.d.ts +2 -2
  177. package/dist/Token/Token.d.ts.map +1 -1
  178. package/dist/Token/Token.js +13 -4
  179. package/dist/Token/TokenNamingContext.d.ts +14 -0
  180. package/dist/Token/TokenNamingContext.d.ts.map +1 -0
  181. package/dist/Token/TokenNamingContext.js +23 -0
  182. package/dist/Tokenizer/Tokenizer.d.ts +46 -59
  183. package/dist/Tokenizer/Tokenizer.d.ts.map +1 -1
  184. package/dist/Tokenizer/Tokenizer.js +44 -60
  185. package/dist/Tokenizer/TokenizerBottomSheet.d.ts +25 -28
  186. package/dist/Tokenizer/TokenizerBottomSheet.d.ts.map +1 -1
  187. package/dist/Tokenizer/TokenizerBottomSheet.js +157 -54
  188. package/dist/Tokenizer/TokenizerItemRemovableContext.d.ts +3 -0
  189. package/dist/Tokenizer/TokenizerItemRemovableContext.d.ts.map +1 -0
  190. package/dist/Tokenizer/TokenizerItemRemovableContext.js +19 -0
  191. package/dist/Tooltip/Tooltip.d.ts +24 -5
  192. package/dist/Tooltip/Tooltip.d.ts.map +1 -1
  193. package/dist/Tooltip/Tooltip.js +29 -5
  194. package/dist/Tooltip/useTooltip.d.ts +48 -5
  195. package/dist/Tooltip/useTooltip.d.ts.map +1 -1
  196. package/dist/Tooltip/useTooltip.js +90 -20
  197. package/dist/TopNav/TopNavItem.d.ts.map +1 -1
  198. package/dist/TopNav/TopNavItem.js +4 -7
  199. package/dist/TopNav/TopNavMegaMenuItem.d.ts.map +1 -1
  200. package/dist/TopNav/TopNavMegaMenuItem.js +4 -7
  201. package/dist/TopNav/TopNavMenu.d.ts.map +1 -1
  202. package/dist/TopNav/TopNavMenu.js +4 -7
  203. package/dist/Typeahead/Typeahead.d.ts.map +1 -1
  204. package/dist/Typeahead/Typeahead.js +26 -15
  205. package/dist/animator/createAnimator.d.ts +98 -0
  206. package/dist/animator/createAnimator.d.ts.map +1 -0
  207. package/dist/animator/createAnimator.js +259 -0
  208. package/dist/astryx.css +142 -7
  209. package/dist/gestures/GestureHost.d.ts +27 -1
  210. package/dist/gestures/GestureHost.d.ts.map +1 -1
  211. package/dist/gestures/GestureHost.js +161 -22
  212. package/dist/gestures/PressTracker.d.ts +6 -0
  213. package/dist/gestures/PressTracker.d.ts.map +1 -1
  214. package/dist/gestures/PressTracker.js +3 -0
  215. package/dist/gestures/types.d.ts +6 -0
  216. package/dist/gestures/types.d.ts.map +1 -1
  217. package/dist/gestures/usePressTracker.d.ts.map +1 -1
  218. package/dist/gestures/usePressTracker.js +1 -0
  219. package/dist/gestures/wheelSegmenter.d.ts +14 -3
  220. package/dist/gestures/wheelSegmenter.d.ts.map +1 -1
  221. package/dist/gestures/wheelSegmenter.js +32 -8
  222. package/dist/hooks/actionGroupTracker.d.ts +7 -4
  223. package/dist/hooks/actionGroupTracker.d.ts.map +1 -1
  224. package/dist/hooks/actionGroupTracker.js +19 -56
  225. package/dist/hooks/index.d.ts +1 -0
  226. package/dist/hooks/index.d.ts.map +1 -1
  227. package/dist/hooks/index.js +1 -0
  228. package/dist/hooks/pressGroupContext.d.ts +6 -0
  229. package/dist/hooks/pressGroupContext.d.ts.map +1 -0
  230. package/dist/hooks/pressGroupContext.js +20 -0
  231. package/dist/hooks/useActionGroupTracking.d.ts +53 -0
  232. package/dist/hooks/useActionGroupTracking.d.ts.map +1 -0
  233. package/dist/hooks/useActionGroupTracking.js +174 -0
  234. package/dist/hooks/useAnimator.d.ts +41 -0
  235. package/dist/hooks/useAnimator.d.ts.map +1 -0
  236. package/dist/hooks/useAnimator.js +70 -0
  237. package/dist/hooks/useAttachment.d.ts +16 -8
  238. package/dist/hooks/useAttachment.d.ts.map +1 -1
  239. package/dist/hooks/useAttachment.js +35 -15
  240. package/dist/hooks/useFocusTrap.d.ts +15 -0
  241. package/dist/hooks/useFocusTrap.d.ts.map +1 -1
  242. package/dist/hooks/useFocusTrap.js +13 -2
  243. package/dist/hooks/useHighlightedOptionScroll.d.ts +11 -1
  244. package/dist/hooks/useHighlightedOptionScroll.d.ts.map +1 -1
  245. package/dist/hooks/useHighlightedOptionScroll.js +112 -11
  246. package/dist/hooks/useInputStatusIcon.d.ts +1 -1
  247. package/dist/hooks/useInputStatusIcon.d.ts.map +1 -1
  248. package/dist/hooks/useInputStatusIcon.js +2 -2
  249. package/dist/hooks/useMediaQuery.d.ts +2 -1
  250. package/dist/hooks/useMediaQuery.d.ts.map +1 -1
  251. package/dist/hooks/useMediaQuery.js +7 -4
  252. package/dist/hooks/useMenuPress.d.ts.map +1 -1
  253. package/dist/hooks/useMenuPress.js +4 -2
  254. package/dist/hooks/usePager.d.ts +261 -0
  255. package/dist/hooks/usePager.d.ts.map +1 -0
  256. package/dist/hooks/usePager.js +1169 -0
  257. package/dist/i18n/generated-english/InfoTip/InfoTip.generated.d.ts +8 -0
  258. package/dist/i18n/generated-english/InfoTip/InfoTip.generated.d.ts.map +1 -0
  259. package/dist/i18n/generated-english/InfoTip/InfoTip.generated.js +12 -0
  260. package/dist/i18n/generated-english/PowerSearch/PowerSearch.generated.d.ts.map +1 -1
  261. package/dist/i18n/generated-english/PowerSearch/PowerSearch.generated.js +1 -0
  262. package/dist/i18n/generated-english/PowerSearch/PowerSearchBottomSheet.generated.d.ts +8 -0
  263. package/dist/i18n/generated-english/PowerSearch/PowerSearchBottomSheet.generated.d.ts.map +1 -0
  264. package/dist/i18n/generated-english/PowerSearch/PowerSearchBottomSheet.generated.js +42 -0
  265. package/dist/i18n/generated-english/PowerSearch/PowerSearchValueEditor.generated.d.ts.map +1 -1
  266. package/dist/i18n/generated-english/PowerSearch/PowerSearchValueEditor.generated.js +6 -0
  267. package/dist/i18n/generated-english/PowerSearch/formatTokenValue.generated.d.ts +8 -0
  268. package/dist/i18n/generated-english/PowerSearch/formatTokenValue.generated.d.ts.map +1 -0
  269. package/dist/i18n/generated-english/PowerSearch/formatTokenValue.generated.js +14 -0
  270. package/dist/i18n/generated-english/Tokenizer/TokenizerBottomSheet.generated.d.ts.map +1 -1
  271. package/dist/i18n/generated-english/Tokenizer/TokenizerBottomSheet.generated.js +7 -1
  272. package/dist/i18n/generated-locales/en.generated.d.ts.map +1 -1
  273. package/dist/i18n/generated-locales/en.generated.js +33 -1
  274. package/dist/i18n/generated-locales/pseudo.generated.d.ts.map +1 -1
  275. package/dist/i18n/generated-locales/pseudo.generated.js +33 -1
  276. package/dist/index.d.ts +2 -0
  277. package/dist/index.d.ts.map +1 -1
  278. package/dist/index.js +5 -0
  279. package/dist/internal/SheetConfirmation.d.ts +11 -0
  280. package/dist/internal/SheetConfirmation.d.ts.map +1 -0
  281. package/dist/internal/SheetConfirmation.js +92 -0
  282. package/dist/internal/sheetDraft.d.ts +35 -0
  283. package/dist/internal/sheetDraft.d.ts.map +1 -0
  284. package/dist/internal/sheetDraft.js +65 -0
  285. package/dist/internal/touch-sheet.d.ts +21 -0
  286. package/dist/internal/touch-sheet.d.ts.map +1 -0
  287. package/dist/internal/touch-sheet.js +19 -0
  288. package/dist/internal/useDismissSearchOnTouchDrag.d.ts +24 -0
  289. package/dist/internal/useDismissSearchOnTouchDrag.d.ts.map +1 -0
  290. package/dist/internal/useDismissSearchOnTouchDrag.js +56 -0
  291. package/dist/motion/animator.d.ts +14 -14
  292. package/dist/motion/animator.d.ts.map +1 -1
  293. package/dist/motion/animator.js +41 -18
  294. package/dist/motion/paging.d.ts +16 -5
  295. package/dist/motion/paging.d.ts.map +1 -1
  296. package/dist/motion/paging.js +34 -14
  297. package/dist/motion/reducedMotion.d.ts +24 -0
  298. package/dist/motion/reducedMotion.d.ts.map +1 -1
  299. package/dist/motion/reducedMotion.js +78 -1
  300. package/dist/motion/roles.d.ts +7 -1
  301. package/dist/motion/roles.d.ts.map +1 -1
  302. package/dist/motion/roles.js +20 -1
  303. package/dist/motion/uikit/alert.d.ts +41 -0
  304. package/dist/motion/uikit/alert.d.ts.map +1 -0
  305. package/dist/motion/uikit/alert.js +43 -0
  306. package/dist/motion/uikit/index.d.ts +7 -4
  307. package/dist/motion/uikit/index.d.ts.map +1 -1
  308. package/dist/motion/uikit/index.js +7 -4
  309. package/dist/motion/uikit/paging.d.ts +31 -20
  310. package/dist/motion/uikit/paging.d.ts.map +1 -1
  311. package/dist/motion/uikit/paging.js +41 -11
  312. package/dist/motion/uikit/progressBar.d.ts +27 -7
  313. package/dist/motion/uikit/progressBar.d.ts.map +1 -1
  314. package/dist/motion/uikit/progressBar.js +31 -11
  315. package/dist/motion/uikit/segmented.d.ts +55 -0
  316. package/dist/motion/uikit/segmented.d.ts.map +1 -0
  317. package/dist/motion/uikit/segmented.js +77 -0
  318. package/dist/motion/uikit/springs.d.ts +8 -42
  319. package/dist/motion/uikit/springs.d.ts.map +1 -1
  320. package/dist/motion/uikit/springs.js +12 -42
  321. package/dist/motion/uikit/switch.d.ts +166 -0
  322. package/dist/motion/uikit/switch.d.ts.map +1 -0
  323. package/dist/motion/uikit/switch.js +186 -0
  324. package/dist/privateAttributes/pressGroupItem.stylex.d.ts +15 -0
  325. package/dist/privateAttributes/pressGroupItem.stylex.d.ts.map +1 -0
  326. package/dist/privateAttributes/pressGroupItem.stylex.js +23 -0
  327. package/dist/privateAttributes/pressHoldsDrag.stylex.d.ts +18 -0
  328. package/dist/privateAttributes/pressHoldsDrag.stylex.d.ts.map +1 -0
  329. package/dist/privateAttributes/pressHoldsDrag.stylex.js +28 -0
  330. package/dist/privateAttributes/segmentTitle.stylex.d.ts +5 -0
  331. package/dist/privateAttributes/segmentTitle.stylex.d.ts.map +1 -0
  332. package/dist/privateAttributes/segmentTitle.stylex.js +22 -0
  333. package/dist/utils/browserClickWait.d.ts +35 -0
  334. package/dist/utils/browserClickWait.d.ts.map +1 -0
  335. package/dist/utils/browserClickWait.js +123 -0
  336. package/dist/utils/clickGuard.d.ts +14 -1
  337. package/dist/utils/clickGuard.d.ts.map +1 -1
  338. package/dist/utils/clickGuard.js +46 -1
  339. package/dist/utils/dateParser.d.ts.map +1 -1
  340. package/dist/utils/dateParser.js +12 -0
  341. package/dist/utils/interactionOverlay.stylex.d.ts +3 -2
  342. package/dist/utils/interactionOverlay.stylex.d.ts.map +1 -1
  343. package/dist/utils/interactionOverlay.stylex.js +3 -2
  344. package/dist/utils/pressFeedback.d.ts.map +1 -1
  345. package/dist/utils/pressFeedback.js +24 -6
  346. package/locales/en.json +128 -0
  347. package/locales/pseudo.json +96 -0
  348. package/package.json +13 -8
  349. package/src/AlertDialog/AlertDialog.doc.mjs +2 -2
  350. package/src/AlertDialog/AlertDialog.tsx +37 -5
  351. package/src/AppShell/useCloseMobileDrawerOnActivate.ts +52 -0
  352. package/src/Avatar/Avatar.tsx +3 -1
  353. package/src/BottomSheet/BottomSheet.tsx +95 -10
  354. package/src/BottomSheet/BottomSheetPanel.tsx +40 -5
  355. package/src/BottomSheet/bottomSheetStack.ts +8 -4
  356. package/src/BottomSheet/useSheetGestures.ts +3 -1
  357. package/src/Breadcrumbs/BreadcrumbItem.tsx +17 -4
  358. package/src/Button/Button.tsx +66 -7
  359. package/src/CheckboxList/CheckboxList.doc.mjs +4 -2
  360. package/src/CheckboxList/CheckboxList.tsx +6 -0
  361. package/src/CheckboxList/CheckboxListContext.tsx +6 -0
  362. package/src/CheckboxList/CheckboxListItem.tsx +11 -2
  363. package/src/ComplexSelector/ComplexSelector.tsx +20 -5
  364. package/src/DateInput/DateInput.tsx +8 -2
  365. package/src/DateInput/MonthScroller.tsx +18 -22
  366. package/src/DateInput/Wheel.tsx +172 -14
  367. package/src/DateRangeInput/DateRangeInput.doc.mjs +3 -2
  368. package/src/DateRangeInput/DateRangeInput.tsx +117 -71
  369. package/src/DateTimeInput/DateTimeInput.tsx +8 -2
  370. package/src/Dialog/Dialog.tsx +81 -15
  371. package/src/Drawer/Drawer.tsx +28 -11
  372. package/src/Drawer/useDrawerDialogPresence.ts +9 -1
  373. package/src/DropdownMenu/DropdownMenu.tsx +28 -6
  374. package/src/Field/Field.tsx +2 -2
  375. package/src/Field/PanelSearchInput.tsx +11 -0
  376. package/src/HoverCard/HoverCard.tsx +31 -1
  377. package/src/Icon/Icon.doc.mjs +49 -8
  378. package/src/Icon/Icon.tsx +15 -7
  379. package/src/InfoTip/InfoTip.doc.mjs +192 -0
  380. package/src/InfoTip/InfoTip.tsx +186 -0
  381. package/src/InfoTip/index.ts +14 -0
  382. package/src/Layer/layerAnimations.stylex.ts +24 -16
  383. package/src/Layer/layerClickBoundary.ts +2 -2
  384. package/src/Layer/useBackdropPress.ts +81 -0
  385. package/src/Layer/usePressPin.ts +576 -0
  386. package/src/Layer/useTouchTrigger.ts +56 -6
  387. package/src/Lightbox/Lightbox.tsx +2 -1
  388. package/src/MobileNav/MobileNav.tsx +1 -1
  389. package/src/MultiSelector/hooks.ts +2 -4
  390. package/src/Outline/Outline.doc.mjs +177 -51
  391. package/src/Outline/Outline.tsx +5 -57
  392. package/src/Outline/useOutlineFromMarkdown.doc.mjs +157 -0
  393. package/src/Outline/useOutlineFromMarkdown.ts +1 -0
  394. package/src/Outline/useScrollSpy.ts +3 -3
  395. package/src/Popover/usePopover.tsx +71 -9
  396. package/src/PowerSearch/PowerSearch.doc.mjs +55 -6
  397. package/src/PowerSearch/PowerSearch.tsx +798 -324
  398. package/src/PowerSearch/PowerSearchBottomSheet.tsx +2515 -0
  399. package/src/PowerSearch/PowerSearchEditPopover.tsx +28 -6
  400. package/src/PowerSearch/PowerSearchValueEditor.tsx +203 -38
  401. package/src/PowerSearch/formatFilterValue.ts +18 -1
  402. package/src/PowerSearch/formatTokenValue.ts +215 -0
  403. package/src/PowerSearch/powerSearchSheetUtils.ts +224 -0
  404. package/src/ProgressBar/ProgressBar.doc.mjs +4 -2
  405. package/src/ProgressBar/ProgressBar.tsx +67 -7
  406. package/src/RadioList/RadioList.doc.mjs +4 -2
  407. package/src/RadioList/RadioList.tsx +7 -2
  408. package/src/RadioList/RadioListItem.tsx +5 -3
  409. package/src/Resizable/ResizeHandle.tsx +133 -328
  410. package/src/Resizable/resizeGesture.ts +368 -0
  411. package/src/SegmentedControl/SegmentedControl.doc.mjs +3 -3
  412. package/src/SegmentedControl/SegmentedControl.tsx +179 -5
  413. package/src/SegmentedControl/SegmentedControlContext.ts +6 -0
  414. package/src/SegmentedControl/SegmentedControlItem.tsx +14 -2
  415. package/src/SegmentedControl/useSegmentedSelectionMotion.ts +1640 -0
  416. package/src/SegmentedControl/useSegmentedTouchTracking.ts +308 -0
  417. package/src/Selector/Selector.tsx +136 -89
  418. package/src/Selector/optionShape.ts +64 -0
  419. package/src/Selector/selectableOptionEntries.ts +39 -0
  420. package/src/Selector/utils.ts +9 -68
  421. package/src/SideNav/SideNavItem.tsx +3 -7
  422. package/src/Slider/sliderTouchController.ts +2 -2
  423. package/src/Switch/Switch.doc.mjs +3 -3
  424. package/src/Switch/Switch.tsx +412 -86
  425. package/src/Switch/switchFill.ts +106 -0
  426. package/src/Switch/switchTouch.ts +186 -0
  427. package/src/Switch/useSwitchTouch.ts +1051 -0
  428. package/src/TabList/Tab.tsx +5 -3
  429. package/src/Table/BaseTable.tsx +46 -12
  430. package/src/TextInput/TextInput.tsx +11 -10
  431. package/src/Toast/Toast.tsx +5 -0
  432. package/src/Token/Token.tsx +15 -4
  433. package/src/Token/TokenNamingContext.ts +28 -0
  434. package/src/Tokenizer/Tokenizer.doc.mjs +16 -0
  435. package/src/Tokenizer/Tokenizer.tsx +93 -88
  436. package/src/Tokenizer/TokenizerBottomSheet.tsx +219 -93
  437. package/src/Tokenizer/TokenizerItemRemovableContext.ts +24 -0
  438. package/src/Tooltip/Tooltip.doc.mjs +123 -39
  439. package/src/Tooltip/Tooltip.tsx +43 -9
  440. package/src/Tooltip/useTooltip.doc.mjs +171 -31
  441. package/src/Tooltip/useTooltip.tsx +137 -22
  442. package/src/TopNav/TopNavItem.tsx +6 -5
  443. package/src/TopNav/TopNavMegaMenuItem.tsx +6 -5
  444. package/src/TopNav/TopNavMenu.tsx +6 -5
  445. package/src/Typeahead/Typeahead.tsx +29 -15
  446. package/src/animator/createAnimator.doc.mjs +153 -0
  447. package/src/animator/createAnimator.ts +324 -0
  448. package/src/gestures/GestureHost.ts +205 -21
  449. package/src/gestures/PressTracker.ts +10 -0
  450. package/src/gestures/types.ts +6 -0
  451. package/src/gestures/usePressTracker.ts +2 -0
  452. package/src/gestures/wheelSegmenter.ts +36 -7
  453. package/src/hooks/actionGroupTracker.ts +32 -61
  454. package/src/hooks/index.ts +2 -0
  455. package/src/hooks/pressGroupContext.ts +21 -0
  456. package/src/hooks/useActionGroupTracking.ts +224 -0
  457. package/src/hooks/useAnimator.doc.mjs +109 -0
  458. package/src/hooks/useAnimator.ts +67 -0
  459. package/src/hooks/useAttachment.ts +56 -14
  460. package/src/hooks/useFocusTrap.ts +26 -2
  461. package/src/hooks/useHighlightedOptionScroll.ts +123 -15
  462. package/src/hooks/useInputStatusIcon.tsx +3 -2
  463. package/src/hooks/useMediaQuery.doc.mjs +2 -2
  464. package/src/hooks/useMediaQuery.ts +13 -4
  465. package/src/hooks/useMenuPress.ts +8 -2
  466. package/src/hooks/usePager.ts +1446 -0
  467. package/src/i18n/generated-english/InfoTip/InfoTip.generated.ts +13 -0
  468. package/src/i18n/generated-english/PowerSearch/PowerSearch.generated.ts +1 -0
  469. package/src/i18n/generated-english/PowerSearch/PowerSearchBottomSheet.generated.ts +43 -0
  470. package/src/i18n/generated-english/PowerSearch/PowerSearchValueEditor.generated.ts +6 -0
  471. package/src/i18n/generated-english/PowerSearch/formatTokenValue.generated.ts +15 -0
  472. package/src/i18n/generated-english/Tokenizer/TokenizerBottomSheet.generated.ts +7 -1
  473. package/src/i18n/generated-locales/en.generated.ts +43 -0
  474. package/src/i18n/generated-locales/pseudo.generated.ts +44 -0
  475. package/src/index.ts +14 -0
  476. package/src/internal/SheetConfirmation.tsx +101 -0
  477. package/src/internal/sheetDraft.ts +80 -0
  478. package/src/internal/touch-sheet.ts +21 -0
  479. package/src/internal/useDismissSearchOnTouchDrag.ts +69 -0
  480. package/src/motion/MEASUREMENTS.md +36 -27
  481. package/src/motion/README.md +11 -6
  482. package/src/motion/animator.ts +61 -29
  483. package/src/motion/paging.ts +37 -14
  484. package/src/motion/reducedMotion.ts +79 -1
  485. package/src/motion/roles.ts +20 -1
  486. package/src/motion/uikit/alert.ts +43 -0
  487. package/src/motion/uikit/index.ts +6 -5
  488. package/src/motion/uikit/paging.ts +41 -10
  489. package/src/motion/uikit/progressBar.ts +31 -11
  490. package/src/motion/uikit/segmented.ts +74 -0
  491. package/src/motion/uikit/springs.ts +12 -42
  492. package/src/motion/uikit/switch.ts +174 -0
  493. package/src/privateAttributes/pressGroupItem.stylex.ts +23 -0
  494. package/src/privateAttributes/pressHoldsDrag.stylex.ts +28 -0
  495. package/src/privateAttributes/segmentTitle.stylex.ts +22 -0
  496. package/src/utils/browserClickWait.ts +133 -0
  497. package/src/utils/clickGuard.ts +64 -1
  498. package/src/utils/dateParser.ts +16 -0
  499. package/src/utils/interactionOverlay.stylex.ts +3 -2
  500. package/src/utils/pressFeedback.ts +24 -6
  501. package/dist/internal/tokenizer-presentation.d.ts +0 -21
  502. package/dist/internal/tokenizer-presentation.d.ts.map +0 -1
  503. package/dist/internal/tokenizer-presentation.js +0 -21
  504. package/src/internal/tokenizer-presentation.ts +0 -25
@@ -110,8 +110,9 @@
110
110
  * click; a click held for a recognizer that may still recognize is
111
111
  * replayed if they all fail. Keyboard and assistive-technology clicks
112
112
  * (`detail === 0`) always pass.
113
- * - A `contextmenu` while a recognizer owns a touch is cancelled, so a long
114
- * press never also opens the browser's menu.
113
+ * - A `contextmenu` while a recognizer owns a touch, or while a press
114
+ * consumer holds the menu closed (`holdsContextMenu`), is cancelled. So a
115
+ * long press never also opens the browser's menu.
115
116
  * - When the app loses focus (a window blur, a hidden page), every touch in
116
117
  * flight is cancelled, as in UIKit; a finger the browser keeps alive lifts
117
118
  * on nothing: its `touchend` is cancelled (`spec:AST-094` FR28).
@@ -474,6 +475,16 @@ interface WheelFollow {
474
475
  /** The fingers' speed at that move, content px per ms. */
475
476
  speedX: number;
476
477
  speedY: number;
478
+ /**
479
+ * The reading behind that speed: the fingers' travel where it began, and
480
+ * its interval in ms.
481
+ */
482
+ readFromX: number;
483
+ readFromY: number;
484
+ readSpan: number;
485
+ /** The fingers' speed before that reading, content px per ms. */
486
+ priorSpeedX: number;
487
+ priorSpeedY: number;
477
488
  }
478
489
 
479
490
  /**
@@ -502,6 +513,39 @@ function absorbedDebt(debt: number, moved: number): number {
502
513
  return Math.sign(debt) * Math.max(0, Math.abs(debt) - Math.abs(moved) / 2);
503
514
  }
504
515
 
516
+ /**
517
+ * A stall held a bunched wheel's frames back, and the move just before it took
518
+ * their time. So the wheel joins that move's reading. It can restore what the
519
+ * late move lowered, but never passes the speed before it.
520
+ */
521
+ function joinReading(f: WheelFollow, trueX: number, trueY: number): void {
522
+ if (f.readSpan <= 0) {
523
+ return;
524
+ }
525
+ f.speedX = joinedSpeed(
526
+ f.speedX,
527
+ (trueX - f.readFromX) / f.readSpan,
528
+ f.priorSpeedX,
529
+ );
530
+ f.speedY = joinedSpeed(
531
+ f.speedY,
532
+ (trueY - f.readFromY) / f.readSpan,
533
+ f.priorSpeedY,
534
+ );
535
+ }
536
+
537
+ /**
538
+ * A joined reading, held to the speed before the late move. It only ever
539
+ * raises the current speed, in the current direction.
540
+ */
541
+ function joinedSpeed(current: number, reading: number, prior: number): number {
542
+ const held =
543
+ Math.sign(reading) * Math.min(Math.abs(reading), Math.abs(prior));
544
+ return held * current >= 0 && Math.abs(held) > Math.abs(current)
545
+ ? held
546
+ : current;
547
+ }
548
+
505
549
  /**
506
550
  * `target` where it is ahead of `shown` in the direction of `speed`, else
507
551
  * `shown`: a reconcile that never steps back.
@@ -687,6 +731,12 @@ export class GestureHost {
687
731
  * lift click (`spec:AST-094` FR28: nothing acts).
688
732
  */
689
733
  private readonly cancelledFingers = new Set<number>();
734
+ /**
735
+ * The pens and pointer-read fingers that the app's lost focus cancelled,
736
+ * by pointer id. Each is kept until its lift, which must not click either,
737
+ * or until a new press.
738
+ */
739
+ private readonly cancelledPointers = new Map<number, PointerKind>();
690
740
  /** Touch.identifier → the element the finger landed on. */
691
741
  private readonly touchTargets = new Map<number, EventTarget>();
692
742
  /**
@@ -711,6 +761,8 @@ export class GestureHost {
711
761
  private readonly processed = new WeakSet<Event>();
712
762
  /** pointerId → arena id, for live mouse and pen contacts. */
713
763
  private readonly pointerIds = new Map<number, number>();
764
+ /** Each contact's kind: a blur refuses a pen's or a pointer-read finger's lift, never a mouse's. */
765
+ private readonly pointerKinds = new Map<number, PointerKind>();
714
766
  /**
715
767
  * The boxes the host watches for screen-edge pans (syncLayoutWatch): each
716
768
  * element with an enabled one, and the root for one whose band moves with
@@ -1202,12 +1254,17 @@ export class GestureHost {
1202
1254
  * cancels it (or the click guard drops it, a late one included) and this one
1203
1255
  * is the tap's single activation.
1204
1256
  */
1205
- private clickRetargeted(target: EventTarget, x: number, y: number): void {
1257
+ private clickRetargeted(
1258
+ target: EventTarget,
1259
+ x: number,
1260
+ y: number,
1261
+ pointerType: string,
1262
+ ): void {
1206
1263
  const view = this.doc.defaultView;
1207
1264
  if (!(target instanceof Element) || !target.isConnected || view == null) {
1208
1265
  return;
1209
1266
  }
1210
- armClickGuard(this.doc);
1267
+ armClickGuard(this.doc, {takesLateMouse: pointerType === 'touch'});
1211
1268
  if (
1212
1269
  target instanceof view.HTMLElement &&
1213
1270
  target.matches('input, textarea, select, [contenteditable]')
@@ -1771,13 +1828,36 @@ export class GestureHost {
1771
1828
  }
1772
1829
  }
1773
1830
 
1774
- /** After a contact ends: an armed press that is over stops listening. */
1831
+ /**
1832
+ * A new press is a new gesture, as the click guard reads one, so the lifts
1833
+ * the blur cancelled owe nothing after it. A second finger keeps the other
1834
+ * fingers' refusals, since those fingers may still be down.
1835
+ */
1836
+ private dropCancelledLifts(event: PointerEvent): void {
1837
+ const isSecond = event.pointerType === 'touch' && event.isPrimary === false;
1838
+ for (const [pointerId, kind] of [...this.cancelledPointers]) {
1839
+ if (pointerId === event.pointerId || !(isSecond && kind === 'touch')) {
1840
+ this.cancelledPointers.delete(pointerId);
1841
+ }
1842
+ }
1843
+ }
1844
+
1845
+ /**
1846
+ * After a contact ends: an armed press that is over stops listening. A
1847
+ * contact the lost focus cancelled still owes its lift, so the press is
1848
+ * not over until that lift comes. A lift the page never hears ends it at
1849
+ * the next press, or at a cancel.
1850
+ */
1775
1851
  private releaseArmedPress(): void {
1776
1852
  if (!this.isArmedPress) {
1777
1853
  return;
1778
1854
  }
1779
1855
  queueMicrotask(() => {
1780
- if (this.isArmedPress && this.arena.touches.length === 0) {
1856
+ if (
1857
+ this.isArmedPress &&
1858
+ this.arena.touches.length === 0 &&
1859
+ this.cancelledPointers.size === 0
1860
+ ) {
1781
1861
  this.isArmedPress = false;
1782
1862
  this.syncKeptPresses();
1783
1863
  this.syncListeners();
@@ -1808,6 +1888,7 @@ export class GestureHost {
1808
1888
  return;
1809
1889
  }
1810
1890
  this.cancelledFingers.clear();
1891
+ this.cancelledPointers.clear();
1811
1892
  this.clearClaimedLifts();
1812
1893
  this.cancelCallerRead?.();
1813
1894
  this.cancelCallerRead = null;
@@ -2270,9 +2351,22 @@ export class GestureHost {
2270
2351
  }
2271
2352
  if (this.wheelSegment?.decaying === true) {
2272
2353
  // Undecided: the real deltas wait for the splitter while the
2273
- // fingers' last speed carries the pan on.
2354
+ // fingers' last speed carries the pan on. A held wheel with its own
2355
+ // frame ends the reading a stall's bunch joins.
2274
2356
  f.heldX += dx;
2275
2357
  f.heldY += dy;
2358
+ if (this.wheelSegment.bunched) {
2359
+ // A raised speed moves on from where the pan is shown, so the
2360
+ // position never jumps inside the bunch.
2361
+ const since = time - f.lastMove;
2362
+ const speedX = f.speedX;
2363
+ const speedY = f.speedY;
2364
+ joinReading(f, f.trueX - f.heldX, f.trueY - f.heldY);
2365
+ f.baseX += (speedX - f.speedX) * since;
2366
+ f.baseY += (speedY - f.speedY) * since;
2367
+ } else {
2368
+ f.readSpan = 0;
2369
+ }
2276
2370
  this.followProvisionally(gesture, f, time);
2277
2371
  return;
2278
2372
  }
@@ -2285,8 +2379,18 @@ export class GestureHost {
2285
2379
  const debtY = absorbedDebt(gesture.y - beforeY, dy);
2286
2380
  const trueX = beforeX - dx;
2287
2381
  const trueY = beforeY - dy;
2382
+ // A wheel the splitter reads as one stall's merge has no speed of its
2383
+ // own. It joins the reading of the move before its bunch, whose
2384
+ // interval holds its time.
2288
2385
  const elapsed = time - f.lastMove;
2289
- if (elapsed > 0) {
2386
+ if (this.wheelSegment?.bunched === true) {
2387
+ joinReading(f, trueX, trueY);
2388
+ } else if (elapsed > 0) {
2389
+ f.priorSpeedX = f.speedX;
2390
+ f.priorSpeedY = f.speedY;
2391
+ f.readFromX = f.trueX;
2392
+ f.readFromY = f.trueY;
2393
+ f.readSpan = elapsed;
2290
2394
  f.speedX = (trueX - f.trueX) / elapsed;
2291
2395
  f.speedY = (trueY - f.trueY) / elapsed;
2292
2396
  }
@@ -2437,6 +2541,11 @@ export class GestureHost {
2437
2541
  baseY: kept.y,
2438
2542
  speedX: 0,
2439
2543
  speedY: 0,
2544
+ readFromX: kept.x,
2545
+ readFromY: kept.y,
2546
+ readSpan: 0,
2547
+ priorSpeedX: 0,
2548
+ priorSpeedY: 0,
2440
2549
  };
2441
2550
  }
2442
2551
  this.arena.began(
@@ -2857,13 +2966,19 @@ export class GestureHost {
2857
2966
  if (locksSelectionFor('touch')) {
2858
2967
  toLock.push({id, target, consumerElement});
2859
2968
  }
2860
- // The finger's events keep going to what the engine hit.
2969
+ // The finger's events keep going to what the engine hit. A disabled
2970
+ // participant can never claim, so a scroll never waits on it.
2861
2971
  this.watchTarget(
2862
2972
  touch.identifier,
2863
2973
  native,
2864
- recognizers.some(claimsWhileMoving) || consumer?.keepsTouch != null,
2865
- consumer != null ||
2866
- recognizers.some(recognizer => recognizer.claimsTouches),
2974
+ recognizers.some(
2975
+ recognizer => recognizer.isEnabled && claimsWhileMoving(recognizer),
2976
+ ) ||
2977
+ (consumer?.keepsTouch != null && consumer.isEnabled?.() !== false),
2978
+ (consumer != null && consumer.isEnabled?.() !== false) ||
2979
+ recognizers.some(
2980
+ recognizer => recognizer.isEnabled && recognizer.claimsTouches,
2981
+ ),
2867
2982
  );
2868
2983
  this.lastFed.set(id, {x: touch.clientX, y: touch.clientY, time});
2869
2984
  this.pairTouch(id, {x: touch.clientX, y: touch.clientY, target: native});
@@ -2898,6 +3013,11 @@ export class GestureHost {
2898
3013
  for (const input of untracked) {
2899
3014
  this.arena.untrackedBegan(input);
2900
3015
  }
3016
+ // Again once the new fingers are delivered: a pinch's second finger may
3017
+ // have landed on another one-finger pan, the next row.
3018
+ if (this.fingerTargets.length > 1 && !this.isFingerClaimed()) {
3019
+ this.failUnclaimedLoneFingerPans();
3020
+ }
2901
3021
  // Stamped after the consumers judged the touch: the brake asks whether
2902
3022
  // an EARLIER finger is still driving a scroll.
2903
3023
  const landed = landedOn(event);
@@ -3143,7 +3263,14 @@ export class GestureHost {
3143
3263
  // A tap sent to what is drawn: the engine's click would hit the layout
3144
3264
  // position, so it is cancelled and the tap clicks what it touched.
3145
3265
  for (const end of retargetedEnds) {
3146
- if (this.clickRetargetedTap(end.landed, end, dispositions.get(end.id))) {
3266
+ if (
3267
+ this.clickRetargetedTap(
3268
+ end.landed,
3269
+ end,
3270
+ dispositions.get(end.id),
3271
+ 'touch',
3272
+ )
3273
+ ) {
3147
3274
  cancelsClick = true;
3148
3275
  }
3149
3276
  }
@@ -3151,7 +3278,7 @@ export class GestureHost {
3151
3278
  if (event.cancelable) {
3152
3279
  event.preventDefault();
3153
3280
  }
3154
- armClickGuard(this.doc);
3281
+ armClickGuard(this.doc, {takesLateMouse: true});
3155
3282
  }
3156
3283
  };
3157
3284
 
@@ -3165,6 +3292,7 @@ export class GestureHost {
3165
3292
  landed: {x: number; y: number; target: EventTarget} | undefined,
3166
3293
  end: {x: number; y: number},
3167
3294
  disposition: ClickDisposition | undefined,
3295
+ pointerType: string,
3168
3296
  ): boolean {
3169
3297
  if (landed == null || disposition !== 'allow') {
3170
3298
  return false;
@@ -3173,7 +3301,7 @@ export class GestureHost {
3173
3301
  if (moved > UIKIT_TAP.allowableMovement.value) {
3174
3302
  return false;
3175
3303
  }
3176
- this.clickRetargeted(landed.target, end.x, end.y);
3304
+ this.clickRetargeted(landed.target, end.x, end.y, pointerType);
3177
3305
  return true;
3178
3306
  }
3179
3307
 
@@ -3485,6 +3613,7 @@ export class GestureHost {
3485
3613
  if (!isPointerKind(event.pointerType)) {
3486
3614
  return;
3487
3615
  }
3616
+ this.dropCancelledLifts(event);
3488
3617
  if (event.pointerType === 'touch' && this.usesTouchEvents) {
3489
3618
  this.pairPointer(event.pointerId, {
3490
3619
  x: event.clientX,
@@ -3493,6 +3622,13 @@ export class GestureHost {
3493
3622
  });
3494
3623
  return;
3495
3624
  }
3625
+ if (event.pointerType === 'touch' && event.isPrimary === false) {
3626
+ // Fingers from pointer events: a second one, wherever either lands,
3627
+ // leaves the two to the page's pinch, as onTouchStart does. A finger
3628
+ // that is not the primary pointer is a second finger, even where the
3629
+ // host never heard the first.
3630
+ this.failUnclaimedLoneFingerPans();
3631
+ }
3496
3632
  // A right click, a pen's barrel button, or a ctrl-click on macOS (its
3497
3633
  // context click) starts no press (FR43).
3498
3634
  if (event.pointerType !== 'touch' && !isPrimaryClick(event)) {
@@ -3514,6 +3650,7 @@ export class GestureHost {
3514
3650
  }
3515
3651
  const id = this.nextId++;
3516
3652
  this.pointerIds.set(event.pointerId, id);
3653
+ this.pointerKinds.set(event.pointerId, event.pointerType);
3517
3654
  if (target !== landed && target != null) {
3518
3655
  this.retargeted.set(id, {x: event.clientX, y: event.clientY, target});
3519
3656
  }
@@ -3535,6 +3672,15 @@ export class GestureHost {
3535
3672
  consumer,
3536
3673
  },
3537
3674
  ]);
3675
+ if (
3676
+ event.pointerType === 'touch' &&
3677
+ event.isPrimary === false &&
3678
+ !this.isFingerClaimed()
3679
+ ) {
3680
+ // Again once this finger is delivered: it may have landed on another
3681
+ // one-finger pan.
3682
+ this.failUnclaimedLoneFingerPans();
3683
+ }
3538
3684
  if (locksSelectionFor(event.pointerType)) {
3539
3685
  // The presented target: what the pen is on, where the engine's own
3540
3686
  // hit test may still see the motion's start.
@@ -3593,9 +3739,14 @@ export class GestureHost {
3593
3739
  }
3594
3740
  const id = this.pointerIds.get(event.pointerId);
3595
3741
  if (id == null) {
3742
+ // A contact the lost focus cancelled: its lift clicks nothing.
3743
+ if (this.cancelledPointers.delete(event.pointerId)) {
3744
+ this.refuseCancelledLift(event);
3745
+ }
3596
3746
  return;
3597
3747
  }
3598
3748
  this.pointerIds.delete(event.pointerId);
3749
+ this.pointerKinds.delete(event.pointerId);
3599
3750
  this.unlockSelection(id);
3600
3751
  const dispositions = this.arena.ended([
3601
3752
  {id, x: event.clientX, y: event.clientY, time: eventTime(event)},
@@ -3607,9 +3758,10 @@ export class GestureHost {
3607
3758
  landed,
3608
3759
  {x: event.clientX, y: event.clientY},
3609
3760
  dispositions.get(id),
3761
+ event.pointerType,
3610
3762
  );
3611
3763
  if (!clicked && needsSuppression(dispositions)) {
3612
- armClickGuard(this.doc);
3764
+ armClickGuard(this.doc, {takesLateMouse: event.pointerType === 'touch'});
3613
3765
  }
3614
3766
  // A finger read from its pointer events: the touchend that follows the
3615
3767
  // lift is cancelled when a gesture took it, which the lift itself may
@@ -3698,9 +3850,12 @@ export class GestureHost {
3698
3850
  }
3699
3851
  return;
3700
3852
  }
3853
+ // A contact that ends in a cancel owes no refused lift.
3854
+ this.cancelledPointers.delete(event.pointerId);
3701
3855
  const id = this.pointerIds.get(event.pointerId);
3702
3856
  if (id != null) {
3703
3857
  this.pointerIds.delete(event.pointerId);
3858
+ this.pointerKinds.delete(event.pointerId);
3704
3859
  this.unlockSelection(id, true);
3705
3860
  this.retargeted.delete(id);
3706
3861
  this.arena.cancelled([id], eventTime(event));
@@ -3767,7 +3922,10 @@ export class GestureHost {
3767
3922
 
3768
3923
  private readonly onContextMenu = (event: MouseEvent): void => {
3769
3924
  for (const touch of this.arena.touches) {
3770
- if (this.arena.isClaimed(touch.id)) {
3925
+ if (
3926
+ this.arena.isClaimed(touch.id) ||
3927
+ this.arena.consumerOf(touch.id)?.holdsContextMenu?.(touch.id) === true
3928
+ ) {
3771
3929
  event.preventDefault();
3772
3930
  return;
3773
3931
  }
@@ -3902,20 +4060,26 @@ export class GestureHost {
3902
4060
  }
3903
4061
  }
3904
4062
  }
4063
+ /** Whether a finger's drag is claimed: then two fingers make no pinch. */
4064
+ private isFingerClaimed(): boolean {
4065
+ return this.arena.touches.some(
4066
+ touch => touch.pointerType === 'touch' && this.arena.isClaimed(touch.id),
4067
+ );
4068
+ }
3905
4069
 
3906
4070
  private readonly onVisibilityChange = (): void => {
3907
4071
  if (this.doc.visibilityState === 'hidden') {
3908
4072
  this.cancelEverything(this.arena.now());
3909
- // As at a blur: the press sends no further pointer event, so an armed
3910
- // press's page listeners go now (FR24).
4073
+ // As at a blur: an armed press's page listeners go once nothing is left
4074
+ // to hear.
3911
4075
  this.releaseArmedPress();
3912
4076
  }
3913
4077
  };
3914
4078
 
3915
4079
  private readonly onBlur = (): void => {
3916
4080
  this.cancelEverything(this.arena.now());
3917
- // The press a blur ends sends no further pointer event: an armed press's
3918
- // page listeners go now, as at its lift (FR24).
4081
+ // An armed press's page listeners go once nothing is left to hear. A pen
4082
+ // or a pointer-read finger the blur cancelled still owes its lift.
3919
4083
  this.releaseArmedPress();
3920
4084
  };
3921
4085
 
@@ -3938,8 +4102,27 @@ export class GestureHost {
3938
4102
  );
3939
4103
  }
3940
4104
 
4105
+ /**
4106
+ * The lift of a contact the lost focus cancelled: its click is refused,
4107
+ * and a finger's touchend after it is cancelled.
4108
+ */
4109
+ private refuseCancelledLift(event: PointerEvent): void {
4110
+ armClickGuard(this.doc, {takesLateMouse: event.pointerType === 'touch'});
4111
+ if (event.pointerType === 'touch') {
4112
+ // Noted as a claimed lift is: capped, and gone after its time.
4113
+ this.noteClaimedLift(event);
4114
+ }
4115
+ }
4116
+
3941
4117
  /** The app lost focus: UIKit cancels every touch in flight. */
3942
4118
  private cancelEverything(time: number): void {
4119
+ // The browser may keep a pen or a pointer-read finger down: its lift must
4120
+ // not click. A mouse button held through the blur keeps its click.
4121
+ for (const [pointerId, kind] of this.pointerKinds) {
4122
+ if (kind !== 'mouse') {
4123
+ this.cancelledPointers.set(pointerId, kind);
4124
+ }
4125
+ }
3943
4126
  const ids = [...this.pointerIds.values()];
3944
4127
  for (const id of ids) {
3945
4128
  this.unlockSelection(id, true);
@@ -3953,6 +4136,7 @@ export class GestureHost {
3953
4136
  }
3954
4137
  }
3955
4138
  this.pointerIds.clear();
4139
+ this.pointerKinds.clear();
3956
4140
  this.retargeted.clear();
3957
4141
  this.fingerPointers.clear();
3958
4142
  this.pendingPointers.clear();
@@ -95,6 +95,12 @@ export interface PressTrackerOptions {
95
95
  * does nothing passes none. @default undefined
96
96
  */
97
97
  selectionLock?: SelectionLock;
98
+ /**
99
+ * Whether the press of `touchId` holds the browser's context menu closed
100
+ * now; the host then cancels it. For a control whose hold acts, such as a
101
+ * switch. @default undefined
102
+ */
103
+ holdsContextMenu?: (touchId: number) => boolean;
98
104
  trackingExpansion?: number;
99
105
  /**
100
106
  * When the highlight waits `contentTouchDelay`: inside a scroller (a
@@ -312,6 +318,10 @@ export function createPressTracker(options: PressTrackerOptions): PressTracker {
312
318
  return options.isEnabled?.() !== false;
313
319
  },
314
320
 
321
+ holdsContextMenu(id: number): boolean {
322
+ return options.holdsContextMenu?.(id) === true;
323
+ },
324
+
315
325
  touchBegan(touch: GestureTouch): void {
316
326
  if (
317
327
  touchId != null ||
@@ -202,6 +202,12 @@ export interface TouchConsumer {
202
202
  * undefined and keeps the browser's long-press selection.
203
203
  */
204
204
  readonly selectionLock?: SelectionLock;
205
+ /**
206
+ * Whether this touch's press holds the browser's context menu closed now.
207
+ * A control whose hold acts uses it (a switch's hold toggles it). The host
208
+ * then cancels the menu, as for a claimed touch.
209
+ */
210
+ holdsContextMenu?(touchId: number): boolean;
205
211
  /**
206
212
  * Whether the consumer takes touches now (a disabled control does not).
207
213
  * The host listens only while something enabled is attached
@@ -132,6 +132,8 @@ export function usePressTracker(
132
132
  recognizer,
133
133
  ),
134
134
  isEnabled: () => optionsRef.current.isEnabled?.() ?? true,
135
+ holdsContextMenu: id =>
136
+ optionsRef.current.holdsContextMenu?.(id) === true,
135
137
  // The caller's brake, or the host's: a touch that stops a flick
136
138
  // presses nothing, as a UIKit control in a decelerating scroll view.
137
139
  isBraking: touch => {
@@ -3,8 +3,9 @@
3
3
  /**
4
4
  * @file wheelSegmenter.ts
5
5
  * @input A wheel stream's deltas along one axis, with their event times
6
- * @output Exports WheelSegmenter: splits the stream into gestures and reads
7
- * a trackpad's lift (the onset of momentum)
6
+ * @output Exports WheelSegmenter and isBunched. WheelSegmenter splits the
7
+ * stream into gestures and reads a trackpad's lift (the onset of momentum).
8
+ * isBunched tells one stall's merge from a frame.
8
9
  * @position Read by GestureHost.ts's wheel input: the web reports no
9
10
  * trackpad contact or phase, so both are inferred.
10
11
  */
@@ -22,15 +23,32 @@ export interface WheelSegment {
22
23
  readonly liftNow: boolean;
23
24
  /** This event shrank, so it may be momentum: hold it until known. */
24
25
  readonly decaying: boolean;
26
+ /** This event came so soon after the one before that it is a merge. */
27
+ readonly bunched: boolean;
25
28
  }
26
29
 
27
30
  /** Momentum arrives at frame rate: a pause this long ends it. */
28
31
  const MOMENTUM_GAP_MS = 50;
32
+ /**
33
+ * A wheel this close to the one before, ms, is one stall's merge. Frames come
34
+ * further apart at every display rate up to 500 Hz, which is 2 ms.
35
+ */
36
+ const BUNCHED_MS = 1.5;
29
37
  /** Shrinking deltas in a row before the lift is read. */
30
38
  const LIFT_RUN = 4;
31
39
  /** And how much of its size the run has lost by then. */
32
40
  const LIFT_DECAY = 0.8;
33
41
 
42
+ /**
43
+ * Whether a wheel `intervalMs` after the one before is one stall's merge, not
44
+ * a frame. A stalled page receives the wheels it held back together, within
45
+ * 1.5 ms of each other. The rule reads no history, so slow wheels never make
46
+ * a real frame look like a merge.
47
+ */
48
+ export function isBunched(intervalMs: number): boolean {
49
+ return intervalMs <= BUNCHED_MS;
50
+ }
51
+
34
52
  /**
35
53
  * A trackpad gesture has a finger phase and, after a fling, a momentum phase.
36
54
  * In the finger phase, deltas come while the fingers move, with pauses when
@@ -38,7 +56,8 @@ const LIFT_DECAY = 0.8;
38
56
  * shrink smoothly. The lift is the start of a run of shrinking deltas that
39
57
  * has lost a fifth of its size. In the finger phase, a pause of `idleMs`
40
58
  * ends the gesture. In the momentum phase, a reversal, a jump up against the
41
- * decay, or a pause of 50 ms starts a new gesture. Momentum never pauses,
59
+ * decay, or a pause of 50 ms starts a new gesture. A bunched wheel is never
60
+ * a jump. The decay reads it by its last step. Momentum never pauses,
42
61
  * reverses or grows.
43
62
  */
44
63
  export class WheelSegmenter {
@@ -55,6 +74,7 @@ export class WheelSegmenter {
55
74
  const size = Math.abs(delta);
56
75
  const sign = Math.sign(delta);
57
76
  const gap = time - this.last;
77
+ const bunched = this.count > 0 && isBunched(gap);
58
78
  let boundary: WheelBoundary | null = null;
59
79
  if (this.count === 0) {
60
80
  boundary = this.gesture === 0 ? 'first' : 'idle';
@@ -65,10 +85,16 @@ export class WheelSegmenter {
65
85
  boundary = 'reversal';
66
86
  } else if (gap >= MOMENTUM_GAP_MS) {
67
87
  boundary = 'gap';
68
- } else if (size >= 2 && size > this.previous * 1.3 + 0.5) {
88
+ } else if (!bunched && size >= 2 && size > this.previous * 1.3 + 0.5) {
69
89
  boundary = 'jump';
70
90
  }
71
91
  }
92
+ // A bunched wheel carries the steps of the frames it merged. The decay
93
+ // goes on from its last step, so the steps after it read as they are.
94
+ const steps =
95
+ boundary == null && bunched && this.previous > 0
96
+ ? Math.max(1, Math.round(size / this.previous))
97
+ : 1;
72
98
  if (boundary != null) {
73
99
  this.gesture += 1;
74
100
  this.phase = 'finger';
@@ -78,7 +104,9 @@ export class WheelSegmenter {
78
104
  let liftNow = false;
79
105
  let decaying = false;
80
106
  if (this.phase === 'finger' && this.count >= 3 && size > 0) {
81
- decaying = size <= this.previous * 0.995 && size >= this.previous * 0.5;
107
+ // A bunched wheel is read by its last step, as the decay goes on from it.
108
+ const step = size / steps;
109
+ decaying = step <= this.previous * 0.995 && step >= this.previous * 0.5;
82
110
  if (decaying) {
83
111
  if (this.run === 0) {
84
112
  this.runStart = this.previous;
@@ -87,13 +115,13 @@ export class WheelSegmenter {
87
115
  } else {
88
116
  this.run = 0;
89
117
  }
90
- if (this.run >= LIFT_RUN && size <= this.runStart * LIFT_DECAY) {
118
+ if (this.run >= LIFT_RUN && step <= this.runStart * LIFT_DECAY) {
91
119
  this.phase = 'momentum';
92
120
  liftNow = true;
93
121
  }
94
122
  }
95
123
  this.count += 1;
96
- this.previous = size;
124
+ this.previous = size / steps;
97
125
  if (sign !== 0) {
98
126
  this.sign = sign;
99
127
  }
@@ -104,6 +132,7 @@ export class WheelSegmenter {
104
132
  gesture: this.gesture,
105
133
  liftNow,
106
134
  decaying: decaying && !liftNow,
135
+ bunched: boundary == null && bunched,
107
136
  };
108
137
  }
109
138