@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).
@@ -290,6 +291,28 @@ function absorbedDebt(debt, moved) {
290
291
  return Math.sign(debt) * Math.max(0, Math.abs(debt) - Math.abs(moved) / 2);
291
292
  }
292
293
 
294
+ /**
295
+ * A stall held a bunched wheel's frames back, and the move just before it took
296
+ * their time. So the wheel joins that move's reading. It can restore what the
297
+ * late move lowered, but never passes the speed before it.
298
+ */
299
+ function joinReading(f, trueX, trueY) {
300
+ if (f.readSpan <= 0) {
301
+ return;
302
+ }
303
+ f.speedX = joinedSpeed(f.speedX, (trueX - f.readFromX) / f.readSpan, f.priorSpeedX);
304
+ f.speedY = joinedSpeed(f.speedY, (trueY - f.readFromY) / f.readSpan, f.priorSpeedY);
305
+ }
306
+
307
+ /**
308
+ * A joined reading, held to the speed before the late move. It only ever
309
+ * raises the current speed, in the current direction.
310
+ */
311
+ function joinedSpeed(current, reading, prior) {
312
+ const held = Math.sign(reading) * Math.min(Math.abs(reading), Math.abs(prior));
313
+ return held * current >= 0 && Math.abs(held) > Math.abs(current) ? held : current;
314
+ }
315
+
293
316
  /**
294
317
  * `target` where it is ahead of `shown` in the direction of `speed`, else
295
318
  * `shown`: a reconcile that never steps back.
@@ -434,6 +457,12 @@ export class GestureHost {
434
457
  * lift click (`spec:AST-094` FR28: nothing acts).
435
458
  */
436
459
  cancelledFingers = new Set();
460
+ /**
461
+ * The pens and pointer-read fingers that the app's lost focus cancelled,
462
+ * by pointer id. Each is kept until its lift, which must not click either,
463
+ * or until a new press.
464
+ */
465
+ cancelledPointers = new Map();
437
466
  /** Touch.identifier → the element the finger landed on. */
438
467
  touchTargets = new Map();
439
468
  /**
@@ -455,6 +484,8 @@ export class GestureHost {
455
484
  processed = new WeakSet();
456
485
  /** pointerId → arena id, for live mouse and pen contacts. */
457
486
  pointerIds = new Map();
487
+ /** Each contact's kind: a blur refuses a pen's or a pointer-read finger's lift, never a mouse's. */
488
+ pointerKinds = new Map();
458
489
  /**
459
490
  * The boxes the host watches for screen-edge pans (syncLayoutWatch): each
460
491
  * element with an enabled one, and the root for one whose band moves with
@@ -912,12 +943,14 @@ export class GestureHost {
912
943
  * cancels it (or the click guard drops it, a late one included) and this one
913
944
  * is the tap's single activation.
914
945
  */
915
- clickRetargeted(target, x, y) {
946
+ clickRetargeted(target, x, y, pointerType) {
916
947
  const view = this.doc.defaultView;
917
948
  if (!(target instanceof Element) || !target.isConnected || view == null) {
918
949
  return;
919
950
  }
920
- armClickGuard(this.doc);
951
+ armClickGuard(this.doc, {
952
+ takesLateMouse: pointerType === 'touch'
953
+ });
921
954
  if (target instanceof view.HTMLElement && target.matches('input, textarea, select, [contenteditable]')) {
922
955
  target.focus();
923
956
  }
@@ -1395,13 +1428,32 @@ export class GestureHost {
1395
1428
  }
1396
1429
  }
1397
1430
 
1398
- /** After a contact ends: an armed press that is over stops listening. */
1431
+ /**
1432
+ * A new press is a new gesture, as the click guard reads one, so the lifts
1433
+ * the blur cancelled owe nothing after it. A second finger keeps the other
1434
+ * fingers' refusals, since those fingers may still be down.
1435
+ */
1436
+ dropCancelledLifts(event) {
1437
+ const isSecond = event.pointerType === 'touch' && event.isPrimary === false;
1438
+ for (const [pointerId, kind] of [...this.cancelledPointers]) {
1439
+ if (pointerId === event.pointerId || !(isSecond && kind === 'touch')) {
1440
+ this.cancelledPointers.delete(pointerId);
1441
+ }
1442
+ }
1443
+ }
1444
+
1445
+ /**
1446
+ * After a contact ends: an armed press that is over stops listening. A
1447
+ * contact the lost focus cancelled still owes its lift, so the press is
1448
+ * not over until that lift comes. A lift the page never hears ends it at
1449
+ * the next press, or at a cancel.
1450
+ */
1399
1451
  releaseArmedPress() {
1400
1452
  if (!this.isArmedPress) {
1401
1453
  return;
1402
1454
  }
1403
1455
  queueMicrotask(() => {
1404
- if (this.isArmedPress && this.arena.touches.length === 0) {
1456
+ if (this.isArmedPress && this.arena.touches.length === 0 && this.cancelledPointers.size === 0) {
1405
1457
  this.isArmedPress = false;
1406
1458
  this.syncKeptPresses();
1407
1459
  this.syncListeners();
@@ -1432,6 +1484,7 @@ export class GestureHost {
1432
1484
  return;
1433
1485
  }
1434
1486
  this.cancelledFingers.clear();
1487
+ this.cancelledPointers.clear();
1435
1488
  this.clearClaimedLifts();
1436
1489
  this.cancelCallerRead?.();
1437
1490
  this.cancelCallerRead = null;
@@ -1824,9 +1877,22 @@ export class GestureHost {
1824
1877
  }
1825
1878
  if (this.wheelSegment?.decaying === true) {
1826
1879
  // Undecided: the real deltas wait for the splitter while the
1827
- // fingers' last speed carries the pan on.
1880
+ // fingers' last speed carries the pan on. A held wheel with its own
1881
+ // frame ends the reading a stall's bunch joins.
1828
1882
  f.heldX += dx;
1829
1883
  f.heldY += dy;
1884
+ if (this.wheelSegment.bunched) {
1885
+ // A raised speed moves on from where the pan is shown, so the
1886
+ // position never jumps inside the bunch.
1887
+ const since = time - f.lastMove;
1888
+ const speedX = f.speedX;
1889
+ const speedY = f.speedY;
1890
+ joinReading(f, f.trueX - f.heldX, f.trueY - f.heldY);
1891
+ f.baseX += (speedX - f.speedX) * since;
1892
+ f.baseY += (speedY - f.speedY) * since;
1893
+ } else {
1894
+ f.readSpan = 0;
1895
+ }
1830
1896
  this.followProvisionally(gesture, f, time);
1831
1897
  return;
1832
1898
  }
@@ -1839,8 +1905,18 @@ export class GestureHost {
1839
1905
  const debtY = absorbedDebt(gesture.y - beforeY, dy);
1840
1906
  const trueX = beforeX - dx;
1841
1907
  const trueY = beforeY - dy;
1908
+ // A wheel the splitter reads as one stall's merge has no speed of its
1909
+ // own. It joins the reading of the move before its bunch, whose
1910
+ // interval holds its time.
1842
1911
  const elapsed = time - f.lastMove;
1843
- if (elapsed > 0) {
1912
+ if (this.wheelSegment?.bunched === true) {
1913
+ joinReading(f, trueX, trueY);
1914
+ } else if (elapsed > 0) {
1915
+ f.priorSpeedX = f.speedX;
1916
+ f.priorSpeedY = f.speedY;
1917
+ f.readFromX = f.trueX;
1918
+ f.readFromY = f.trueY;
1919
+ f.readSpan = elapsed;
1844
1920
  f.speedX = (trueX - f.trueX) / elapsed;
1845
1921
  f.speedY = (trueY - f.trueY) / elapsed;
1846
1922
  }
@@ -1975,7 +2051,12 @@ export class GestureHost {
1975
2051
  baseX: kept.x,
1976
2052
  baseY: kept.y,
1977
2053
  speedX: 0,
1978
- speedY: 0
2054
+ speedY: 0,
2055
+ readFromX: kept.x,
2056
+ readFromY: kept.y,
2057
+ readSpan: 0,
2058
+ priorSpeedX: 0,
2059
+ priorSpeedY: 0
1979
2060
  };
1980
2061
  }
1981
2062
  this.arena.began(kind === 'pan' ? [{
@@ -2362,8 +2443,9 @@ export class GestureHost {
2362
2443
  consumerElement
2363
2444
  });
2364
2445
  }
2365
- // The finger's events keep going to what the engine hit.
2366
- this.watchTarget(touch.identifier, native, recognizers.some(claimsWhileMoving) || consumer?.keepsTouch != null, consumer != null || recognizers.some(recognizer => recognizer.claimsTouches));
2446
+ // The finger's events keep going to what the engine hit. A disabled
2447
+ // participant can never claim, so a scroll never waits on it.
2448
+ this.watchTarget(touch.identifier, native, recognizers.some(recognizer => recognizer.isEnabled && claimsWhileMoving(recognizer)) || consumer?.keepsTouch != null && consumer.isEnabled?.() !== false, consumer != null && consumer.isEnabled?.() !== false || recognizers.some(recognizer => recognizer.isEnabled && recognizer.claimsTouches));
2367
2449
  this.lastFed.set(id, {
2368
2450
  x: touch.clientX,
2369
2451
  y: touch.clientY,
@@ -2407,6 +2489,11 @@ export class GestureHost {
2407
2489
  for (const input of untracked) {
2408
2490
  this.arena.untrackedBegan(input);
2409
2491
  }
2492
+ // Again once the new fingers are delivered: a pinch's second finger may
2493
+ // have landed on another one-finger pan, the next row.
2494
+ if (this.fingerTargets.length > 1 && !this.isFingerClaimed()) {
2495
+ this.failUnclaimedLoneFingerPans();
2496
+ }
2410
2497
  // Stamped after the consumers judged the touch: the brake asks whether
2411
2498
  // an EARLIER finger is still driving a scroll.
2412
2499
  const landed = landedOn(event);
@@ -2636,7 +2723,7 @@ export class GestureHost {
2636
2723
  // A tap sent to what is drawn: the engine's click would hit the layout
2637
2724
  // position, so it is cancelled and the tap clicks what it touched.
2638
2725
  for (const end of retargetedEnds) {
2639
- if (this.clickRetargetedTap(end.landed, end, dispositions.get(end.id))) {
2726
+ if (this.clickRetargetedTap(end.landed, end, dispositions.get(end.id), 'touch')) {
2640
2727
  cancelsClick = true;
2641
2728
  }
2642
2729
  }
@@ -2644,7 +2731,9 @@ export class GestureHost {
2644
2731
  if (event.cancelable) {
2645
2732
  event.preventDefault();
2646
2733
  }
2647
- armClickGuard(this.doc);
2734
+ armClickGuard(this.doc, {
2735
+ takesLateMouse: true
2736
+ });
2648
2737
  }
2649
2738
  };
2650
2739
 
@@ -2654,7 +2743,7 @@ export class GestureHost {
2654
2743
  * (a taken contact is no longer retargeted), and the finger stayed within
2655
2744
  * a tap's movement. Returns whether it clicked.
2656
2745
  */
2657
- clickRetargetedTap(landed, end, disposition) {
2746
+ clickRetargetedTap(landed, end, disposition, pointerType) {
2658
2747
  if (landed == null || disposition !== 'allow') {
2659
2748
  return false;
2660
2749
  }
@@ -2662,7 +2751,7 @@ export class GestureHost {
2662
2751
  if (moved > UIKIT_TAP.allowableMovement.value) {
2663
2752
  return false;
2664
2753
  }
2665
- this.clickRetargeted(landed.target, end.x, end.y);
2754
+ this.clickRetargeted(landed.target, end.x, end.y, pointerType);
2666
2755
  return true;
2667
2756
  }
2668
2757
  onTouchCancel = event => {
@@ -2930,6 +3019,7 @@ export class GestureHost {
2930
3019
  if (!isPointerKind(event.pointerType)) {
2931
3020
  return;
2932
3021
  }
3022
+ this.dropCancelledLifts(event);
2933
3023
  if (event.pointerType === 'touch' && this.usesTouchEvents) {
2934
3024
  this.pairPointer(event.pointerId, {
2935
3025
  x: event.clientX,
@@ -2938,6 +3028,13 @@ export class GestureHost {
2938
3028
  });
2939
3029
  return;
2940
3030
  }
3031
+ if (event.pointerType === 'touch' && event.isPrimary === false) {
3032
+ // Fingers from pointer events: a second one, wherever either lands,
3033
+ // leaves the two to the page's pinch, as onTouchStart does. A finger
3034
+ // that is not the primary pointer is a second finger, even where the
3035
+ // host never heard the first.
3036
+ this.failUnclaimedLoneFingerPans();
3037
+ }
2941
3038
  // A right click, a pen's barrel button, or a ctrl-click on macOS (its
2942
3039
  // context click) starts no press (FR43).
2943
3040
  if (event.pointerType !== 'touch' && !isPrimaryClick(event)) {
@@ -2955,6 +3052,7 @@ export class GestureHost {
2955
3052
  }
2956
3053
  const id = this.nextId++;
2957
3054
  this.pointerIds.set(event.pointerId, id);
3055
+ this.pointerKinds.set(event.pointerId, event.pointerType);
2958
3056
  if (target !== landed && target != null) {
2959
3057
  this.retargeted.set(id, {
2960
3058
  x: event.clientX,
@@ -2978,6 +3076,11 @@ export class GestureHost {
2978
3076
  recognizers,
2979
3077
  consumer
2980
3078
  }]);
3079
+ if (event.pointerType === 'touch' && event.isPrimary === false && !this.isFingerClaimed()) {
3080
+ // Again once this finger is delivered: it may have landed on another
3081
+ // one-finger pan.
3082
+ this.failUnclaimedLoneFingerPans();
3083
+ }
2981
3084
  if (locksSelectionFor(event.pointerType)) {
2982
3085
  // The presented target: what the pen is on, where the engine's own
2983
3086
  // hit test may still see the motion's start.
@@ -3024,9 +3127,14 @@ export class GestureHost {
3024
3127
  }
3025
3128
  const id = this.pointerIds.get(event.pointerId);
3026
3129
  if (id == null) {
3130
+ // A contact the lost focus cancelled: its lift clicks nothing.
3131
+ if (this.cancelledPointers.delete(event.pointerId)) {
3132
+ this.refuseCancelledLift(event);
3133
+ }
3027
3134
  return;
3028
3135
  }
3029
3136
  this.pointerIds.delete(event.pointerId);
3137
+ this.pointerKinds.delete(event.pointerId);
3030
3138
  this.unlockSelection(id);
3031
3139
  const dispositions = this.arena.ended([{
3032
3140
  id,
@@ -3040,9 +3148,11 @@ export class GestureHost {
3040
3148
  const clicked = this.clickRetargetedTap(landed, {
3041
3149
  x: event.clientX,
3042
3150
  y: event.clientY
3043
- }, dispositions.get(id));
3151
+ }, dispositions.get(id), event.pointerType);
3044
3152
  if (!clicked && needsSuppression(dispositions)) {
3045
- armClickGuard(this.doc);
3153
+ armClickGuard(this.doc, {
3154
+ takesLateMouse: event.pointerType === 'touch'
3155
+ });
3046
3156
  }
3047
3157
  // A finger read from its pointer events: the touchend that follows the
3048
3158
  // lift is cancelled when a gesture took it, which the lift itself may
@@ -3119,9 +3229,12 @@ export class GestureHost {
3119
3229
  }
3120
3230
  return;
3121
3231
  }
3232
+ // A contact that ends in a cancel owes no refused lift.
3233
+ this.cancelledPointers.delete(event.pointerId);
3122
3234
  const id = this.pointerIds.get(event.pointerId);
3123
3235
  if (id != null) {
3124
3236
  this.pointerIds.delete(event.pointerId);
3237
+ this.pointerKinds.delete(event.pointerId);
3125
3238
  this.unlockSelection(id, true);
3126
3239
  this.retargeted.delete(id);
3127
3240
  this.arena.cancelled([id], eventTime(event));
@@ -3178,7 +3291,7 @@ export class GestureHost {
3178
3291
  }
3179
3292
  onContextMenu = event => {
3180
3293
  for (const touch of this.arena.touches) {
3181
- if (this.arena.isClaimed(touch.id)) {
3294
+ if (this.arena.isClaimed(touch.id) || this.arena.consumerOf(touch.id)?.holdsContextMenu?.(touch.id) === true) {
3182
3295
  event.preventDefault();
3183
3296
  return;
3184
3297
  }
@@ -3291,18 +3404,22 @@ export class GestureHost {
3291
3404
  }
3292
3405
  }
3293
3406
  }
3407
+ /** Whether a finger's drag is claimed: then two fingers make no pinch. */
3408
+ isFingerClaimed() {
3409
+ return this.arena.touches.some(touch => touch.pointerType === 'touch' && this.arena.isClaimed(touch.id));
3410
+ }
3294
3411
  onVisibilityChange = () => {
3295
3412
  if (this.doc.visibilityState === 'hidden') {
3296
3413
  this.cancelEverything(this.arena.now());
3297
- // As at a blur: the press sends no further pointer event, so an armed
3298
- // press's page listeners go now (FR24).
3414
+ // As at a blur: an armed press's page listeners go once nothing is left
3415
+ // to hear.
3299
3416
  this.releaseArmedPress();
3300
3417
  }
3301
3418
  };
3302
3419
  onBlur = () => {
3303
3420
  this.cancelEverything(this.arena.now());
3304
- // The press a blur ends sends no further pointer event: an armed press's
3305
- // page listeners go now, as at its lift (FR24).
3421
+ // An armed press's page listeners go once nothing is left to hear. A pen
3422
+ // or a pointer-read finger the blur cancelled still owes its lift.
3306
3423
  this.releaseArmedPress();
3307
3424
  };
3308
3425
 
@@ -3322,8 +3439,29 @@ export class GestureHost {
3322
3439
  return this.inputMode === 'pointer-events' || view != null && !('ontouchstart' in view);
3323
3440
  }
3324
3441
 
3442
+ /**
3443
+ * The lift of a contact the lost focus cancelled: its click is refused,
3444
+ * and a finger's touchend after it is cancelled.
3445
+ */
3446
+ refuseCancelledLift(event) {
3447
+ armClickGuard(this.doc, {
3448
+ takesLateMouse: event.pointerType === 'touch'
3449
+ });
3450
+ if (event.pointerType === 'touch') {
3451
+ // Noted as a claimed lift is: capped, and gone after its time.
3452
+ this.noteClaimedLift(event);
3453
+ }
3454
+ }
3455
+
3325
3456
  /** The app lost focus: UIKit cancels every touch in flight. */
3326
3457
  cancelEverything(time) {
3458
+ // The browser may keep a pen or a pointer-read finger down: its lift must
3459
+ // not click. A mouse button held through the blur keeps its click.
3460
+ for (const [pointerId, kind] of this.pointerKinds) {
3461
+ if (kind !== 'mouse') {
3462
+ this.cancelledPointers.set(pointerId, kind);
3463
+ }
3464
+ }
3327
3465
  const ids = [...this.pointerIds.values()];
3328
3466
  for (const id of ids) {
3329
3467
  this.unlockSelection(id, true);
@@ -3337,6 +3475,7 @@ export class GestureHost {
3337
3475
  }
3338
3476
  }
3339
3477
  this.pointerIds.clear();
3478
+ this.pointerKinds.clear();
3340
3479
  this.retargeted.clear();
3341
3480
  this.fingerPointers.clear();
3342
3481
  this.pendingPointers.clear();
@@ -32,6 +32,12 @@ export interface PressTrackerOptions {
32
32
  * does nothing passes none. @default undefined
33
33
  */
34
34
  selectionLock?: SelectionLock;
35
+ /**
36
+ * Whether the press of `touchId` holds the browser's context menu closed
37
+ * now; the host then cancels it. For a control whose hold acts, such as a
38
+ * switch. @default undefined
39
+ */
40
+ holdsContextMenu?: (touchId: number) => boolean;
35
41
  trackingExpansion?: number;
36
42
  /**
37
43
  * When the highlight waits `contentTouchDelay`: inside a scroller (a
@@ -1 +1 @@
1
- {"version":3,"file":"PressTracker.d.ts","sourceRoot":"","sources":["../../src/gestures/PressTracker.ts"],"names":[],"mappings":"AAmDA,OAAO,KAAK,EAAC,iBAAiB,EAAE,aAAa,EAAC,MAAM,qBAAqB,CAAC;AAE1E,OAAO,KAAK,EAAC,YAAY,EAAE,aAAa,EAAC,MAAM,SAAS,CAAC;AAEzD,MAAM,MAAM,YAAY,GACpB,WAAW,GACX,iBAAiB,GACjB,kBAAkB,GAClB,gBAAgB,GAChB,eAAe,GACf,eAAe,GACf,gBAAgB,GAChB,aAAa,CAAC;AAElB,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,mBAAmB;IAClC,mEAAmE;IACnE,SAAS,EAAE,MAAM,WAAW,GAAG,IAAI,CAAC;IACpC,4EAA4E;IAC5E,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,YAAY,KAAK,IAAI,CAAC;IACpE,iBAAiB,CAAC,EAAE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,cAAc,CAAC;AAE3D;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAAE,iBAAiB,GAAG,OAAO,CAMtE;AAED;;;;;GAKG;AACH,MAAM,WAAW,YAAa,SAAQ,aAAa;IACjD,4DAA4D;IAC5D,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;IAChC,wCAAwC;IACxC,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAC7B,yEAAyE;IACzE,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;IAChC;;;OAGG;IACH,iBAAiB,EAAE,MAAM,CAAC;IAC1B;;;OAGG;IACH,SAAS,IAAI,OAAO,CAAC;IACrB,wBAAwB,CAAC,UAAU,EAAE,OAAO,GAAG,OAAO,CAAC;IACvD,6EAA6E;IAC7E,OAAO,IAAI,IAAI,CAAC;IAChB;;;;;;OAMG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC;IACnD,8EAA8E;IAC9E,QAAQ,CAAC,aAAa,EAAE,aAAa,GAAG,SAAS,CAAC;CACnD;AAED,4DAA4D;AAC5D,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,mBAAmB,GAAG,YAAY,CAyN7E"}
@@ -177,6 +177,9 @@ export function createPressTracker(options) {
177
177
  isEnabled() {
178
178
  return options.isEnabled?.() !== false;
179
179
  },
180
+ holdsContextMenu(id) {
181
+ return options.holdsContextMenu?.(id) === true;
182
+ },
180
183
  touchBegan(touch) {
181
184
  if (touchId != null || options.isEnabled?.() === false ||
182
185
  // The scroll brake is a finger's (`spec:AST-094` FR11, DEC-21).
@@ -167,6 +167,12 @@ export interface TouchConsumer {
167
167
  * undefined and keeps the browser's long-press selection.
168
168
  */
169
169
  readonly selectionLock?: SelectionLock;
170
+ /**
171
+ * Whether this touch's press holds the browser's context menu closed now.
172
+ * A control whose hold acts uses it (a switch's hold toggles it). The host
173
+ * then cancels the menu, as for a claimed touch.
174
+ */
175
+ holdsContextMenu?(touchId: number): boolean;
170
176
  /**
171
177
  * Whether the consumer takes touches now (a disabled control does not).
172
178
  * The host listens only while something enabled is attached
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/gestures/types.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,qBAAqB,CAAC;AAEvD;;;GAGG;AACH,MAAM,MAAM,YAAY,GACtB,UAAU,GAAG,OAAO,GAAG,SAAS,GAAG,OAAO,GAAG,WAAW,GAAG,QAAQ,CAAC;AAEtE,qEAAqE;AACrE,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,OAAO,GAAG,KAAK,CAAC;AAEpD;;;;;GAKG;AACH,MAAM,MAAM,UAAU,GAAG,YAAY,GAAG,UAAU,CAAC;AAEnD,MAAM,WAAW,KAAK;IACpB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,6EAA6E;AAC7E,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,8EAA8E;IAC9E,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,WAAW,CAAC;AAEnE;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC;;;;OAIG;IACH,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC;IAC3C,sEAAsE;IACtE,QAAQ,CAAC,gBAAgB,EAAE,OAAO,CAAC;IACnC;;;;OAIG;IACH,QAAQ,CAAC,eAAe,EAAE,OAAO,CAAC;CACnC;AAED;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,0DAA0D;IAC1D,QAAQ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@
1
- {"version":3,"file":"usePressTracker.d.ts","sourceRoot":"","sources":["../../src/gestures/usePressTracker.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAA4B,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAIhE,OAAO,EAGL,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACzB,MAAM,gBAAgB,CAAC;AAQxB,MAAM,MAAM,sBAAsB,GAAG,IAAI,CACvC,mBAAmB,EACnB,WAAW,GAAG,MAAM,CACrB,GAAG;IACF;;;;OAIG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC7B,GAAG,EAAE,SAAS,CAAC,OAAO,GAAG,IAAI,CAAC,EAC9B,OAAO,GAAE,sBAA2B,GACnC,YAAY,CAwJd"}
1
+ {"version":3,"file":"usePressTracker.d.ts","sourceRoot":"","sources":["../../src/gestures/usePressTracker.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAA4B,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAIhE,OAAO,EAGL,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACzB,MAAM,gBAAgB,CAAC;AAQxB,MAAM,MAAM,sBAAsB,GAAG,IAAI,CACvC,mBAAmB,EACnB,WAAW,GAAG,MAAM,CACrB,GAAG;IACF;;;;OAIG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC7B,GAAG,EAAE,SAAS,CAAC,OAAO,GAAG,IAAI,CAAC,EAC9B,OAAO,GAAE,sBAA2B,GACnC,YAAY,CA0Jd"}
@@ -100,6 +100,7 @@ export function usePressTracker(ref, options = {}) {
100
100
  // The caller's veto, read on every touch, else the tracker's own.
101
101
  vetoesAncestorRecognizer: recognizer => (optionsRef.current.vetoesAncestorRecognizer ?? vetoesSingleTap)(recognizer),
102
102
  isEnabled: () => optionsRef.current.isEnabled?.() ?? true,
103
+ holdsContextMenu: id => optionsRef.current.holdsContextMenu?.(id) === true,
103
104
  // The caller's brake, or the host's: a touch that stops a flick
104
105
  // presses nothing, as a UIKit control in a decelerating scroll view.
105
106
  isBraking: touch => {
@@ -1,8 +1,9 @@
1
1
  /**
2
2
  * @file wheelSegmenter.ts
3
3
  * @input A wheel stream's deltas along one axis, with their event times
4
- * @output Exports WheelSegmenter: splits the stream into gestures and reads
5
- * a trackpad's lift (the onset of momentum)
4
+ * @output Exports WheelSegmenter and isBunched. WheelSegmenter splits the
5
+ * stream into gestures and reads a trackpad's lift (the onset of momentum).
6
+ * isBunched tells one stall's merge from a frame.
6
7
  * @position Read by GestureHost.ts's wheel input: the web reports no
7
8
  * trackpad contact or phase, so both are inferred.
8
9
  */
@@ -18,7 +19,16 @@ export interface WheelSegment {
18
19
  readonly liftNow: boolean;
19
20
  /** This event shrank, so it may be momentum: hold it until known. */
20
21
  readonly decaying: boolean;
22
+ /** This event came so soon after the one before that it is a merge. */
23
+ readonly bunched: boolean;
21
24
  }
25
+ /**
26
+ * Whether a wheel `intervalMs` after the one before is one stall's merge, not
27
+ * a frame. A stalled page receives the wheels it held back together, within
28
+ * 1.5 ms of each other. The rule reads no history, so slow wheels never make
29
+ * a real frame look like a merge.
30
+ */
31
+ export declare function isBunched(intervalMs: number): boolean;
22
32
  /**
23
33
  * A trackpad gesture has a finger phase and, after a fling, a momentum phase.
24
34
  * In the finger phase, deltas come while the fingers move, with pauses when
@@ -26,7 +36,8 @@ export interface WheelSegment {
26
36
  * shrink smoothly. The lift is the start of a run of shrinking deltas that
27
37
  * has lost a fifth of its size. In the finger phase, a pause of `idleMs`
28
38
  * ends the gesture. In the momentum phase, a reversal, a jump up against the
29
- * decay, or a pause of 50 ms starts a new gesture. Momentum never pauses,
39
+ * decay, or a pause of 50 ms starts a new gesture. A bunched wheel is never
40
+ * a jump. The decay reads it by its last step. Momentum never pauses,
30
41
  * reverses or grows.
31
42
  */
32
43
  export declare class WheelSegmenter {
@@ -1 +1 @@
1
- {"version":3,"file":"wheelSegmenter.d.ts","sourceRoot":"","sources":["../../src/gestures/wheelSegmenter.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AAEH,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,MAAM,GAAG,UAAU,GAAG,MAAM,GAAG,KAAK,CAAC;AAC3E,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,UAAU,CAAC;AAE/C,MAAM,WAAW,YAAY;IAC3B,0EAA0E;IAC1E,QAAQ,CAAC,QAAQ,EAAE,aAAa,GAAG,IAAI,CAAC;IACxC,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC;IAC3B,6CAA6C;IAC7C,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,wEAAwE;IACxE,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,qEAAqE;IACrE,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;CAC5B;AASD;;;;;;;;;GASG;AACH,qBAAa,cAAc;IACzB,OAAO,SAAK;IACZ,KAAK,EAAE,UAAU,CAAY;IAC7B,OAAO,CAAC,IAAI,CAAa;IACzB,OAAO,CAAC,QAAQ,CAAK;IACrB,OAAO,CAAC,IAAI,CAAK;IACjB,OAAO,CAAC,KAAK,CAAK;IAClB,OAAO,CAAC,GAAG,CAAK;IAChB,OAAO,CAAC,QAAQ,CAAK;IAErB,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,YAAY;IAwD/D,2EAA2E;IAC3E,GAAG,IAAI,IAAI;CAGZ"}
1
+ {"version":3,"file":"wheelSegmenter.d.ts","sourceRoot":"","sources":["../../src/gestures/wheelSegmenter.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AAEH,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,MAAM,GAAG,UAAU,GAAG,MAAM,GAAG,KAAK,CAAC;AAC3E,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,UAAU,CAAC;AAE/C,MAAM,WAAW,YAAY;IAC3B,0EAA0E;IAC1E,QAAQ,CAAC,QAAQ,EAAE,aAAa,GAAG,IAAI,CAAC;IACxC,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC;IAC3B,6CAA6C;IAC7C,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,wEAAwE;IACxE,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,qEAAqE;IACrE,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,uEAAuE;IACvE,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;CAC3B;AAcD;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAErD;AAED;;;;;;;;;;GAUG;AACH,qBAAa,cAAc;IACzB,OAAO,SAAK;IACZ,KAAK,EAAE,UAAU,CAAY;IAC7B,OAAO,CAAC,IAAI,CAAa;IACzB,OAAO,CAAC,QAAQ,CAAK;IACrB,OAAO,CAAC,IAAI,CAAK;IACjB,OAAO,CAAC,KAAK,CAAK;IAClB,OAAO,CAAC,GAAG,CAAK;IAChB,OAAO,CAAC,QAAQ,CAAK;IAErB,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,YAAY;IAkE/D,2EAA2E;IAC3E,GAAG,IAAI,IAAI;CAGZ"}
@@ -3,19 +3,35 @@
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
  */
11
12
 
12
13
  /** Momentum arrives at frame rate: a pause this long ends it. */
13
14
  const MOMENTUM_GAP_MS = 50;
15
+ /**
16
+ * A wheel this close to the one before, ms, is one stall's merge. Frames come
17
+ * further apart at every display rate up to 500 Hz, which is 2 ms.
18
+ */
19
+ const BUNCHED_MS = 1.5;
14
20
  /** Shrinking deltas in a row before the lift is read. */
15
21
  const LIFT_RUN = 4;
16
22
  /** And how much of its size the run has lost by then. */
17
23
  const LIFT_DECAY = 0.8;
18
24
 
25
+ /**
26
+ * Whether a wheel `intervalMs` after the one before is one stall's merge, not
27
+ * a frame. A stalled page receives the wheels it held back together, within
28
+ * 1.5 ms of each other. The rule reads no history, so slow wheels never make
29
+ * a real frame look like a merge.
30
+ */
31
+ export function isBunched(intervalMs) {
32
+ return intervalMs <= BUNCHED_MS;
33
+ }
34
+
19
35
  /**
20
36
  * A trackpad gesture has a finger phase and, after a fling, a momentum phase.
21
37
  * In the finger phase, deltas come while the fingers move, with pauses when
@@ -23,7 +39,8 @@ const LIFT_DECAY = 0.8;
23
39
  * shrink smoothly. The lift is the start of a run of shrinking deltas that
24
40
  * has lost a fifth of its size. In the finger phase, a pause of `idleMs`
25
41
  * ends the gesture. In the momentum phase, a reversal, a jump up against the
26
- * decay, or a pause of 50 ms starts a new gesture. Momentum never pauses,
42
+ * decay, or a pause of 50 ms starts a new gesture. A bunched wheel is never
43
+ * a jump. The decay reads it by its last step. Momentum never pauses,
27
44
  * reverses or grows.
28
45
  */
29
46
  export class WheelSegmenter {
@@ -39,6 +56,7 @@ export class WheelSegmenter {
39
56
  const size = Math.abs(delta);
40
57
  const sign = Math.sign(delta);
41
58
  const gap = time - this.last;
59
+ const bunched = this.count > 0 && isBunched(gap);
42
60
  let boundary = null;
43
61
  if (this.count === 0) {
44
62
  boundary = this.gesture === 0 ? 'first' : 'idle';
@@ -49,10 +67,13 @@ export class WheelSegmenter {
49
67
  boundary = 'reversal';
50
68
  } else if (gap >= MOMENTUM_GAP_MS) {
51
69
  boundary = 'gap';
52
- } else if (size >= 2 && size > this.previous * 1.3 + 0.5) {
70
+ } else if (!bunched && size >= 2 && size > this.previous * 1.3 + 0.5) {
53
71
  boundary = 'jump';
54
72
  }
55
73
  }
74
+ // A bunched wheel carries the steps of the frames it merged. The decay
75
+ // goes on from its last step, so the steps after it read as they are.
76
+ const steps = boundary == null && bunched && this.previous > 0 ? Math.max(1, Math.round(size / this.previous)) : 1;
56
77
  if (boundary != null) {
57
78
  this.gesture += 1;
58
79
  this.phase = 'finger';
@@ -62,7 +83,9 @@ export class WheelSegmenter {
62
83
  let liftNow = false;
63
84
  let decaying = false;
64
85
  if (this.phase === 'finger' && this.count >= 3 && size > 0) {
65
- decaying = size <= this.previous * 0.995 && size >= this.previous * 0.5;
86
+ // A bunched wheel is read by its last step, as the decay goes on from it.
87
+ const step = size / steps;
88
+ decaying = step <= this.previous * 0.995 && step >= this.previous * 0.5;
66
89
  if (decaying) {
67
90
  if (this.run === 0) {
68
91
  this.runStart = this.previous;
@@ -71,13 +94,13 @@ export class WheelSegmenter {
71
94
  } else {
72
95
  this.run = 0;
73
96
  }
74
- if (this.run >= LIFT_RUN && size <= this.runStart * LIFT_DECAY) {
97
+ if (this.run >= LIFT_RUN && step <= this.runStart * LIFT_DECAY) {
75
98
  this.phase = 'momentum';
76
99
  liftNow = true;
77
100
  }
78
101
  }
79
102
  this.count += 1;
80
- this.previous = size;
103
+ this.previous = size / steps;
81
104
  if (sign !== 0) {
82
105
  this.sign = sign;
83
106
  }
@@ -87,7 +110,8 @@ export class WheelSegmenter {
87
110
  phase: this.phase,
88
111
  gesture: this.gesture,
89
112
  liftNow,
90
- decaying: decaying && !liftNow
113
+ decaying: decaying && !liftNow,
114
+ bunched: boundary == null && bunched
91
115
  };
92
116
  }
93
117