@astryxdesign/core 0.7.6-canary.f73623d → 0.7.6-canary.f899313

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 (921) hide show
  1. package/dist/Badge/Badge.d.ts.map +1 -1
  2. package/dist/Badge/Badge.js +2 -1
  3. package/dist/ComplexSelector/ComplexSelector.d.ts.map +1 -1
  4. package/dist/ComplexSelector/ComplexSelector.js +8 -2
  5. package/dist/DateInput/MonthScroller.d.ts.map +1 -1
  6. package/dist/DateInput/MonthScroller.js +17 -18
  7. package/dist/DateRangeInput/DateRangeInput.d.ts.map +1 -1
  8. package/dist/DateRangeInput/DateRangeInput.js +8 -4
  9. package/dist/DropdownMenu/DropdownMenuGroup.d.ts.map +1 -1
  10. package/dist/DropdownMenu/DropdownMenuGroup.js +2 -1
  11. package/dist/Field/FieldLabel.d.ts.map +1 -1
  12. package/dist/Field/FieldLabel.js +27 -2
  13. package/dist/FieldStatus/FieldStatus.d.ts +3 -0
  14. package/dist/FieldStatus/FieldStatus.d.ts.map +1 -1
  15. package/dist/FieldStatus/FieldStatus.js +1 -0
  16. package/dist/FileInput/FileInput.d.ts +3 -0
  17. package/dist/FileInput/FileInput.d.ts.map +1 -1
  18. package/dist/FileInput/FileInput.js +59 -33
  19. package/dist/Layer/useTouchTrigger.d.ts +9 -0
  20. package/dist/Layer/useTouchTrigger.d.ts.map +1 -1
  21. package/dist/Layer/useTouchTrigger.js +1 -1
  22. package/dist/Link/Link.d.ts.map +1 -1
  23. package/dist/Link/Link.js +10 -1
  24. package/dist/MultiSelector/MultiSelector.d.ts.map +1 -1
  25. package/dist/MultiSelector/MultiSelector.js +19 -9
  26. package/dist/NumberInput/NumberInput.d.ts.map +1 -1
  27. package/dist/NumberInput/NumberInput.js +11 -15
  28. package/dist/Selector/Selector.d.ts.map +1 -1
  29. package/dist/Selector/Selector.js +9 -6
  30. package/dist/Selector/hooks.js +2 -2
  31. package/dist/Slider/Slider.d.ts.map +1 -1
  32. package/dist/Slider/Slider.js +82 -10
  33. package/dist/Token/Token.d.ts +1 -1
  34. package/dist/Token/Token.d.ts.map +1 -1
  35. package/dist/Token/Token.js +15 -0
  36. package/dist/Tokenizer/Tokenizer.d.ts.map +1 -1
  37. package/dist/Tokenizer/Tokenizer.js +16 -1
  38. package/dist/Typeahead/BaseTypeahead.d.ts.map +1 -1
  39. package/dist/Typeahead/BaseTypeahead.js +10 -3
  40. package/dist/Typeahead/Typeahead.d.ts.map +1 -1
  41. package/dist/Typeahead/Typeahead.js +36 -10
  42. package/dist/astryx.css +1 -1
  43. package/dist/i18n/useListFormatter.d.ts +9 -0
  44. package/dist/i18n/useListFormatter.d.ts.map +1 -0
  45. package/dist/i18n/useListFormatter.js +41 -0
  46. package/package.json +18 -5
  47. package/src/Badge/Badge.tsx +2 -1
  48. package/src/Chat/ChatMessage.spec.md +64 -65
  49. package/src/Citation/Citation.spec.md +60 -47
  50. package/src/ComplexSelector/ComplexSelector.tsx +19 -2
  51. package/src/DateInput/DateInput.spec.md +74 -57
  52. package/src/DateInput/MonthScroller.tsx +15 -17
  53. package/src/DateRangeInput/DateRangeInput.tsx +18 -3
  54. package/src/DropdownMenu/DropdownMenuGroup.tsx +2 -1
  55. package/src/Field/Field.doc.mjs +2 -1
  56. package/src/Field/FieldLabel.doc.mjs +4 -2
  57. package/src/Field/FieldLabel.spec.md +30 -21
  58. package/src/Field/FieldLabel.tsx +37 -3
  59. package/src/FieldStatus/FieldStatus.tsx +7 -0
  60. package/src/FileInput/FileInput.tsx +69 -28
  61. package/src/FormLayout/FormLayout.spec.md +11 -19
  62. package/src/Layer/useTouchTrigger.ts +1 -1
  63. package/src/Lightbox/Lightbox.spec.md +249 -61
  64. package/src/Link/Link.tsx +9 -2
  65. package/src/MultiSelector/MultiSelector.spec.md +121 -114
  66. package/src/MultiSelector/MultiSelector.tsx +19 -5
  67. package/src/NumberInput/NumberInput.tsx +11 -18
  68. package/src/ProgressBar/ProgressBar.spec.md +143 -119
  69. package/src/Selector/Selector.tsx +16 -6
  70. package/src/Selector/hooks.ts +2 -2
  71. package/src/Slider/Slider.spec.md +18 -16
  72. package/src/Slider/Slider.tsx +101 -9
  73. package/src/Token/Token.spec.md +24 -23
  74. package/src/Token/Token.tsx +15 -0
  75. package/src/Tokenizer/Tokenizer.tsx +10 -0
  76. package/src/Typeahead/BaseTypeahead.tsx +18 -2
  77. package/src/Typeahead/Typeahead.tsx +40 -9
  78. package/src/i18n/useListFormatter.ts +42 -0
  79. package/dist/Item/ItemMarkerColumns.a11y.chromium.spec.d.ts +0 -2
  80. package/dist/Item/ItemMarkerColumns.a11y.chromium.spec.js +0 -132
  81. package/dist/Lightbox/LightboxKeyboard.a11y.browser.spec.d.ts +0 -2
  82. package/dist/Lightbox/LightboxKeyboard.a11y.browser.spec.js +0 -78
  83. package/dist/Lightbox/LightboxViewport.a11y.browser.spec.d.ts +0 -2
  84. package/dist/Lightbox/LightboxViewport.a11y.browser.spec.js +0 -66
  85. package/dist/List/ListMarkers.a11y.chromium.spec.d.ts +0 -2
  86. package/dist/List/ListMarkers.a11y.chromium.spec.js +0 -677
  87. package/dist/Markdown/Markdown.fr23.bench.d.ts +0 -2
  88. package/dist/Markdown/Markdown.fr23.bench.d.ts.map +0 -1
  89. package/dist/Markdown/Markdown.fr23.bench.js +0 -152
  90. package/dist/Markdown/MarkdownTable.a11y.chromium.spec.d.ts +0 -2
  91. package/dist/Markdown/MarkdownTable.a11y.chromium.spec.js +0 -590
  92. package/dist/Markdown/plugins/headingLinks.a11y.chromium.spec.d.ts +0 -2
  93. package/dist/Markdown/plugins/headingLinks.a11y.chromium.spec.js +0 -657
  94. package/dist/MobileNav/MobileNavPinchZoom.a11y.chromium.spec.d.ts +0 -2
  95. package/dist/MobileNav/MobileNavPinchZoom.a11y.chromium.spec.js +0 -153
  96. package/dist/MultiSelector/CreateRow.a11y.chromium.spec.d.ts +0 -2
  97. package/dist/MultiSelector/CreateRow.a11y.chromium.spec.js +0 -117
  98. package/dist/MultiSelector/MultiSelector.disabledFocus.a11y.chromium.spec.d.ts +0 -2
  99. package/dist/MultiSelector/MultiSelector.disabledFocus.a11y.chromium.spec.js +0 -49
  100. package/dist/MultiSelector/OptionActions.a11y.chromium.spec.d.ts +0 -2
  101. package/dist/MultiSelector/OptionActions.a11y.chromium.spec.js +0 -273
  102. package/dist/Outline/OutlineFocus.a11y.chromium.spec.d.ts +0 -2
  103. package/dist/Outline/OutlineFocus.a11y.chromium.spec.js +0 -421
  104. package/dist/Typeahead/BaseTypeahead.emptyState.a11y.chromium.spec.d.ts +0 -2
  105. package/dist/Typeahead/BaseTypeahead.emptyState.a11y.chromium.spec.js +0 -118
  106. package/dist/reset.a11y.chromium.spec.d.ts +0 -2
  107. package/dist/reset.a11y.chromium.spec.js +0 -231
  108. package/dist/reset.until-found.a11y.browser.spec.d.ts +0 -2
  109. package/dist/reset.until-found.a11y.browser.spec.js +0 -72
  110. package/src/AlertDialog/AlertDialog.test.tsx +0 -519
  111. package/src/AlertDialog/__tests__/AlertDialog.a11y.chromium.spec.ts +0 -128
  112. package/src/AlertDialog/__tests__/AlertDialog.a11y.renders.tsx +0 -52
  113. package/src/AlertDialog/__tests__/AlertDialog.a11y.states.ts +0 -68
  114. package/src/AlertDialog/__tests__/AlertDialog.a11y.test.tsx +0 -144
  115. package/src/AlertDialog/useImperativeAlertDialog.test.tsx +0 -163
  116. package/src/AppShell/AppShell.test.tsx +0 -1310
  117. package/src/AppShell/__tests__/AppShellMainKeyboard.a11y.browser.spec.ts +0 -534
  118. package/src/AppShell/observeMainOverflow.test.ts +0 -173
  119. package/src/AspectRatio/AspectRatio.test.tsx +0 -398
  120. package/src/AspectRatio/__tests__/AspectRatioFitLayers.a11y.browser.spec.ts +0 -158
  121. package/src/Avatar/Avatar.test.tsx +0 -867
  122. package/src/Avatar/AvatarStatusDot.test.tsx +0 -306
  123. package/src/Avatar/__tests__/AvatarForcedColors.a11y.chromium.spec.ts +0 -126
  124. package/src/AvatarGroup/AvatarGroup.test.tsx +0 -313
  125. package/src/AvatarGroup/AvatarGroupOverflow.test.tsx +0 -263
  126. package/src/Badge/Badge.test.tsx +0 -125
  127. package/src/Badge/__tests__/BadgeLargerText.a11y.chromium.spec.ts +0 -260
  128. package/src/Banner/Banner.test.tsx +0 -879
  129. package/src/Blockquote/Blockquote.test.tsx +0 -121
  130. package/src/BottomSheet/BottomSheet.test.tsx +0 -3154
  131. package/src/BottomSheet/BottomSheetEdgeTint.test.tsx +0 -248
  132. package/src/BottomSheet/BottomSheetKeyboard.test.tsx +0 -195
  133. package/src/BottomSheet/BottomSheetPanel.test.tsx +0 -549
  134. package/src/BottomSheet/BottomSheetReplace.test.tsx +0 -1638
  135. package/src/BottomSheet/BottomSheetStacking.announce.test.tsx +0 -246
  136. package/src/BottomSheet/BottomSheetStacking.test.tsx +0 -3184
  137. package/src/BottomSheet/BottomSheetSwitcher.test.tsx +0 -2010
  138. package/src/BottomSheet/__tests__/BottomSheetDrag.a11y.chromium.spec.ts +0 -129
  139. package/src/BottomSheet/__tests__/BottomSheetFocusReturn.a11y.browser.spec.ts +0 -97
  140. package/src/BottomSheet/__tests__/BottomSheetKeyboard.a11y.browser.spec.ts +0 -415
  141. package/src/BottomSheet/__tests__/BottomSheetNativeModal.a11y.browser.spec.ts +0 -462
  142. package/src/BottomSheet/__tests__/BottomSheetPinchZoom.a11y.chromium.spec.ts +0 -247
  143. package/src/BottomSheet/__tests__/BottomSheetToastOutlet.a11y.chromium.spec.ts +0 -83
  144. package/src/BottomSheet/snapOffsets.test.ts +0 -254
  145. package/src/BottomSheet/useSheetGestures.test.ts +0 -1690
  146. package/src/Breadcrumbs/Breadcrumbs.test.tsx +0 -921
  147. package/src/Breadcrumbs/__tests__/Breadcrumbs.a11y.chromium.spec.ts +0 -132
  148. package/src/Breadcrumbs/__tests__/Breadcrumbs.a11y.renders.tsx +0 -45
  149. package/src/Breadcrumbs/__tests__/Breadcrumbs.a11y.states.ts +0 -81
  150. package/src/Breadcrumbs/__tests__/Breadcrumbs.a11y.test.tsx +0 -125
  151. package/src/Button/Button.test.tsx +0 -864
  152. package/src/Button/__tests__/Button.a11y.chromium.spec.ts +0 -355
  153. package/src/Button/__tests__/Button.a11y.harnesses.tsx +0 -47
  154. package/src/Button/__tests__/Button.a11y.known-failures.ts +0 -25
  155. package/src/Button/__tests__/Button.a11y.renders.tsx +0 -139
  156. package/src/Button/__tests__/Button.a11y.states.ts +0 -317
  157. package/src/Button/__tests__/Button.a11y.test.tsx +0 -187
  158. package/src/ButtonGroup/ButtonGroup.test.tsx +0 -1025
  159. package/src/Calendar/Calendar.test.tsx +0 -2186
  160. package/src/Calendar/__tests__/Calendar.a11y.chromium.spec.ts +0 -141
  161. package/src/Calendar/__tests__/Calendar.a11y.known-failures.ts +0 -12
  162. package/src/Calendar/__tests__/Calendar.a11y.renders.tsx +0 -57
  163. package/src/Calendar/__tests__/Calendar.a11y.states.ts +0 -139
  164. package/src/Calendar/__tests__/Calendar.a11y.test.tsx +0 -137
  165. package/src/Calendar/dayCellUtils.test.ts +0 -520
  166. package/src/Calendar/getInitialFocusDate.test.ts +0 -94
  167. package/src/Calendar/getStandaloneShortWeekdayNames.test.ts +0 -54
  168. package/src/Calendar/hooks/useCalendarConstraints.test.ts +0 -153
  169. package/src/Calendar/hooks/useCalendarDays.test.ts +0 -265
  170. package/src/Calendar/hooks/useCalendarNavigation.test.ts +0 -252
  171. package/src/Card/Card.test.tsx +0 -202
  172. package/src/Carousel/Carousel.test.tsx +0 -1036
  173. package/src/Carousel/__tests__/Carousel.a11y.chromium.spec.ts +0 -207
  174. package/src/Carousel/__tests__/Carousel.a11y.known-failures.ts +0 -12
  175. package/src/Carousel/__tests__/Carousel.a11y.renders.tsx +0 -39
  176. package/src/Carousel/__tests__/Carousel.a11y.states.ts +0 -139
  177. package/src/Carousel/__tests__/Carousel.a11y.test.tsx +0 -127
  178. package/src/Center/Center.test.tsx +0 -406
  179. package/src/Chat/ChatComposer.test.tsx +0 -364
  180. package/src/Chat/ChatComposerDrawer.test.tsx +0 -130
  181. package/src/Chat/ChatComposerInput.test.tsx +0 -2136
  182. package/src/Chat/ChatComposerTokenElement.test.tsx +0 -85
  183. package/src/Chat/ChatDictationButton.test.tsx +0 -108
  184. package/src/Chat/ChatLayout.test.tsx +0 -311
  185. package/src/Chat/ChatLayoutScrollButton.test.tsx +0 -99
  186. package/src/Chat/ChatMessage.test.tsx +0 -344
  187. package/src/Chat/ChatMessageBubble.test.tsx +0 -294
  188. package/src/Chat/ChatMessageList.test.tsx +0 -198
  189. package/src/Chat/ChatMessageMetadata.test.tsx +0 -66
  190. package/src/Chat/ChatPastedTextToken.test.tsx +0 -71
  191. package/src/Chat/ChatSendButton.test.tsx +0 -309
  192. package/src/Chat/ChatSystemMessage.test.tsx +0 -189
  193. package/src/Chat/ChatTokenizedText.test.tsx +0 -163
  194. package/src/Chat/ChatToolCalls.test.tsx +0 -413
  195. package/src/Chat/__tests__/ChatLayoutScrollButton.a11y.chromium.spec.ts +0 -577
  196. package/src/Chat/__tests__/ChatLayoutScrollButtonSurface.a11y.chromium.spec.ts +0 -740
  197. package/src/Chat/__tests__/ChatMessageBubble.a11y.chromium.spec.ts +0 -457
  198. package/src/Chat/__tests__/ChatMessageBubble.auditProvenance.test.ts +0 -91
  199. package/src/Chat/__tests__/ChatMessageBubble.auditProvenance.ts +0 -91
  200. package/src/Chat/__tests__/ChatMessageList.a11y.chromium.spec.ts +0 -465
  201. package/src/Chat/__tests__/ChatMessageMetadata.a11y.chromium.spec.ts +0 -416
  202. package/src/Chat/__tests__/ChatSendButton.a11y.chromium.spec.ts +0 -1523
  203. package/src/Chat/__tests__/ChatSystemMessage.a11y.chromium.spec.ts +0 -1004
  204. package/src/Chat/__tests__/ChatTokenizedText.a11y.chromium.spec.ts +0 -574
  205. package/src/Chat/__tests__/useChatStreamScroll.a11y.chromium.spec.ts +0 -263
  206. package/src/Chat/__tests__/useChatStreamScroll.fixture.tsx +0 -61
  207. package/src/Chat/useChatDictation.test.tsx +0 -369
  208. package/src/Chat/useChatNewMessages.test.tsx +0 -209
  209. package/src/Chat/useChatPasteAsToken.test.ts +0 -191
  210. package/src/Chat/useChatStreamScroll.test.tsx +0 -381
  211. package/src/Chat/useTriggerMenu.test.tsx +0 -994
  212. package/src/CheckboxInput/CheckboxInput.test.tsx +0 -926
  213. package/src/CheckboxInput/__tests__/Checkbox.a11y.chromium.spec.ts +0 -354
  214. package/src/CheckboxInput/__tests__/Checkbox.a11y.known-failures.ts +0 -54
  215. package/src/CheckboxInput/__tests__/Checkbox.a11y.renders.tsx +0 -310
  216. package/src/CheckboxInput/__tests__/Checkbox.a11y.states.ts +0 -404
  217. package/src/CheckboxInput/__tests__/Checkbox.a11y.test.tsx +0 -128
  218. package/src/CheckboxList/CheckboxList.fr10.test.tsx +0 -51
  219. package/src/CheckboxList/CheckboxList.test.tsx +0 -1159
  220. package/src/CheckboxList/__tests__/CheckboxList.a11y.chromium.spec.ts +0 -1998
  221. package/src/Citation/Citation.test.tsx +0 -361
  222. package/src/ClickableCard/ClickableCard.test.tsx +0 -382
  223. package/src/Code/Code.test.tsx +0 -75
  224. package/src/CodeBlock/CodeBlock.highlightStyles.test.tsx +0 -87
  225. package/src/CodeBlock/CodeBlock.test.tsx +0 -752
  226. package/src/CodeBlock/CodeLanguage.test.tsx +0 -173
  227. package/src/CodeBlock/__tests__/CodeBlockCopyClearance.a11y.chromium.spec.ts +0 -325
  228. package/src/CodeBlock/__tests__/CodeBlockLanguages.a11y.chromium.spec.ts +0 -64
  229. package/src/CodeBlock/__tests__/CodeBlockOverflowStop.a11y.chromium.spec.ts +0 -126
  230. package/src/CodeBlock/__tests__/DiffRowPaint.a11y.chromium.spec.ts +0 -94
  231. package/src/CodeBlock/highlightRanges.test.ts +0 -253
  232. package/src/CodeBlock/languages.test.ts +0 -402
  233. package/src/CodeBlock/tokenizer.test.ts +0 -280
  234. package/src/CodeBlock/tokenizerBudget.test.ts +0 -112
  235. package/src/Collapsible/Collapsible.test.tsx +0 -620
  236. package/src/Collapsible/CollapsibleGroup.test.tsx +0 -656
  237. package/src/Collapsible/__tests__/Collapsible.a11y.chromium.spec.ts +0 -194
  238. package/src/Collapsible/__tests__/Collapsible.a11y.states.ts +0 -117
  239. package/src/Collapsible/__tests__/Collapsible.a11y.test.tsx +0 -140
  240. package/src/Collapsible/__tests__/CollapsibleGroup.a11y.chromium.spec.ts +0 -559
  241. package/src/Collapsible/__tests__/CollapsibleGroup.a11y.renders.tsx +0 -45
  242. package/src/Collapsible/__tests__/CollapsibleGroup.a11y.states.ts +0 -139
  243. package/src/Collapsible/__tests__/CollapsibleGroup.a11y.test.tsx +0 -135
  244. package/src/Collapsible/__tests__/CollapsibleGroupAccordion.a11y.chromium.spec.ts +0 -141
  245. package/src/Collapsible/useCollapsible.test.tsx +0 -236
  246. package/src/CommandPalette/CommandPalette.perf.test.ts +0 -100
  247. package/src/CommandPalette/CommandPalette.test.tsx +0 -750
  248. package/src/CommandPalette/CommandPaletteEmpty.test.tsx +0 -101
  249. package/src/CommandPalette/CommandPaletteFooter.test.tsx +0 -122
  250. package/src/CommandPalette/CommandPaletteGroup.test.tsx +0 -129
  251. package/src/CommandPalette/CommandPaletteInput.test.tsx +0 -539
  252. package/src/CommandPalette/CommandPaletteItem.test.tsx +0 -417
  253. package/src/CommandPalette/CommandPaletteList.test.tsx +0 -184
  254. package/src/CommandPalette/__tests__/CommandPalette.a11y.chromium.spec.ts +0 -600
  255. package/src/CommandPalette/__tests__/CommandPaletteEmptyAudit.a11y.chromium.spec.ts +0 -715
  256. package/src/CommandPalette/__tests__/CommandPaletteFooter.a11y.chromium.spec.ts +0 -582
  257. package/src/CommandPalette/__tests__/CommandPaletteInputAudit.a11y.chromium.spec.ts +0 -336
  258. package/src/CommandPalette/__tests__/CommandPaletteItemAudit.a11y.chromium.spec.ts +0 -523
  259. package/src/ComplexSelector/ComplexSelector.focusableDisabled.test.tsx +0 -76
  260. package/src/ComplexSelector/ComplexSelector.fr10.test.tsx +0 -262
  261. package/src/ComplexSelector/ComplexSelector.test.tsx +0 -1171
  262. package/src/ComplexSelector/__tests__/ComplexSelector.a11y.chromium.spec.ts +0 -965
  263. package/src/ContextMenu/ContextMenu.test.tsx +0 -1617
  264. package/src/ContextMenu/ContextMenu.triggerProps.test.tsx +0 -54
  265. package/src/ContextMenu/__tests__/ContextMenuAudit.a11y.chromium.spec.ts +0 -439
  266. package/src/ContextMenu/__tests__/ContextMenuCursorAnchor.a11y.browser.spec.ts +0 -154
  267. package/src/ContextMenu/__tests__/ContextMenuLongPress.a11y.chromium.spec.ts +0 -117
  268. package/src/DateInput/DateInput.fr10.test.tsx +0 -283
  269. package/src/DateInput/DateInput.test.tsx +0 -1571
  270. package/src/DateInput/DateInputTouch.test.tsx +0 -2948
  271. package/src/DateInput/MonthScrollerSettle.test.tsx +0 -165
  272. package/src/DateInput/NativeDateField.test.tsx +0 -741
  273. package/src/DateInput/Presentation.test.tsx +0 -121
  274. package/src/DateInput/__tests__/DateInputAudit.a11y.chromium.spec.ts +0 -577
  275. package/src/DateInput/__tests__/MonthScrollerSteps.interaction.browser.spec.ts +0 -312
  276. package/src/DateInput/__tests__/WheelPinchZoom.a11y.chromium.spec.ts +0 -171
  277. package/src/DateRangeInput/DateRangeInput.fr10.test.tsx +0 -165
  278. package/src/DateRangeInput/DateRangeInput.test.tsx +0 -1151
  279. package/src/DateTimeInput/DateTimeInput.fr10.test.tsx +0 -319
  280. package/src/DateTimeInput/DateTimeInput.test.tsx +0 -2656
  281. package/src/DateTimeInput/DateTimeInputTouch.test.tsx +0 -1071
  282. package/src/DateTimeInput/NativePickerSegments.test.tsx +0 -657
  283. package/src/DateTimeInput/Presentation.test.tsx +0 -89
  284. package/src/Dialog/Dialog.source-build.test.mjs +0 -43
  285. package/src/Dialog/Dialog.test.tsx +0 -1599
  286. package/src/Dialog/DialogHeader.test.tsx +0 -477
  287. package/src/Dialog/__tests__/Dialog.a11y.browser.spec.ts +0 -111
  288. package/src/Dialog/__tests__/Dialog.a11y.chromium.spec.ts +0 -218
  289. package/src/Dialog/__tests__/Dialog.a11y.known-failures.ts +0 -28
  290. package/src/Dialog/__tests__/Dialog.a11y.renders.tsx +0 -107
  291. package/src/Dialog/__tests__/Dialog.a11y.states.ts +0 -104
  292. package/src/Dialog/__tests__/Dialog.a11y.test.tsx +0 -102
  293. package/src/Dialog/__tests__/Dialog.reduced-motion.a11y.browser.spec.ts +0 -252
  294. package/src/Dialog/__tests__/DialogSecondDocument.a11y.browser.spec.ts +0 -202
  295. package/src/Dialog/useImperativeDialog.test.tsx +0 -78
  296. package/src/Divider/Divider.test.tsx +0 -155
  297. package/src/Drawer/Drawer.test.tsx +0 -1335
  298. package/src/Drawer/DrawerDirection.test.tsx +0 -127
  299. package/src/Drawer/DrawerHeader.test.tsx +0 -102
  300. package/src/Drawer/__tests__/DrawerAudit.a11y.chromium.spec.ts +0 -402
  301. package/src/Drawer/__tests__/DrawerHeaderAudit.a11y.chromium.spec.ts +0 -298
  302. package/src/Drawer/__tests__/DrawerNonModalPageScroll.a11y.chromium.spec.ts +0 -267
  303. package/src/DropdownMenu/DropdownMenu.ssr.test.tsx +0 -93
  304. package/src/DropdownMenu/DropdownMenu.test.tsx +0 -4498
  305. package/src/DropdownMenu/DropdownMenuContext.public.test.ts +0 -22
  306. package/src/DropdownMenu/DropdownMenuLazySheet.test.tsx +0 -126
  307. package/src/DropdownMenu/DropdownMenuSelectable.test.tsx +0 -635
  308. package/src/DropdownMenu/DropdownMenuSheetFirstOpen.test.tsx +0 -72
  309. package/src/DropdownMenu/DropdownMenuSubMenu.test.tsx +0 -2442
  310. package/src/DropdownMenu/__tests__/DropdownMenuDividerAudit.a11y.chromium.spec.ts +0 -281
  311. package/src/DropdownMenu/__tests__/DropdownMenuDrillIn.a11y.chromium.spec.ts +0 -175
  312. package/src/DropdownMenu/__tests__/DropdownMenuFocusReturn.a11y.browser.spec.ts +0 -74
  313. package/src/DropdownMenu/__tests__/DropdownMenuGroupAudit.a11y.chromium.spec.ts +0 -335
  314. package/src/DropdownMenu/__tests__/DropdownMenuItemAudit.a11y.chromium.spec.ts +0 -367
  315. package/src/DropdownMenu/__tests__/DropdownMenuRadioGroupAudit.a11y.chromium.spec.ts +0 -328
  316. package/src/DropdownMenu/__tests__/DropdownMenuRadioItemAudit.a11y.chromium.spec.ts +0 -540
  317. package/src/DropdownMenu/__tests__/DropdownMenuSubMenuAudit.a11y.chromium.spec.ts +0 -671
  318. package/src/DropdownMenu/__tests__/Menu.a11y.chromium.spec.ts +0 -158
  319. package/src/DropdownMenu/__tests__/Menu.a11y.known-failures.ts +0 -26
  320. package/src/DropdownMenu/__tests__/Menu.a11y.renders.tsx +0 -65
  321. package/src/DropdownMenu/__tests__/Menu.a11y.states.ts +0 -138
  322. package/src/DropdownMenu/__tests__/Menu.a11y.test.tsx +0 -136
  323. package/src/DropdownMenu/__tests__/MenuButton.a11y.chromium.spec.ts +0 -149
  324. package/src/DropdownMenu/__tests__/MenuButton.a11y.known-failures.ts +0 -12
  325. package/src/DropdownMenu/__tests__/MenuButton.a11y.renders.tsx +0 -67
  326. package/src/DropdownMenu/__tests__/MenuButton.a11y.states.ts +0 -141
  327. package/src/DropdownMenu/__tests__/MenuButton.a11y.test.tsx +0 -138
  328. package/src/DropdownMenu/__tests__/MenuHeaderFooter.a11y.chromium.spec.ts +0 -231
  329. package/src/DropdownMenu/__tests__/MenuHoverFocus.a11y.chromium.spec.ts +0 -238
  330. package/src/DropdownMenu/__tests__/MenuPinchZoom.a11y.chromium.spec.ts +0 -173
  331. package/src/DropdownMenu/__tests__/MenuPress.a11y.chromium.spec.ts +0 -503
  332. package/src/DropdownMenu/__tests__/SubMenuHeaderFooter.a11y.chromium.spec.ts +0 -268
  333. package/src/DropdownMenu/__tests__/warmMenuBottomSheet.tsx +0 -43
  334. package/src/DropdownMenu/lazyMenuBottomSheet.test.ts +0 -60
  335. package/src/EmptyState/EmptyState.announce.test.tsx +0 -227
  336. package/src/EmptyState/EmptyState.test.tsx +0 -284
  337. package/src/Field/Field.test.tsx +0 -800
  338. package/src/Field/FieldLabel.test.tsx +0 -244
  339. package/src/Field/InputClearButton.test.tsx +0 -395
  340. package/src/Field/__tests__/FieldLabelAudit.a11y.chromium.spec.ts +0 -297
  341. package/src/Field/fieldInputFamily.test.tsx +0 -160
  342. package/src/FieldStatus/FieldStatus.test.tsx +0 -482
  343. package/src/FieldStatus/__tests__/StatusMessage.a11y.chromium.spec.ts +0 -206
  344. package/src/FieldStatus/__tests__/StatusMessage.a11y.known-failures.ts +0 -13
  345. package/src/FieldStatus/__tests__/StatusMessage.a11y.renders.tsx +0 -287
  346. package/src/FieldStatus/__tests__/StatusMessage.a11y.states.ts +0 -302
  347. package/src/FieldStatus/__tests__/StatusMessage.a11y.test.tsx +0 -154
  348. package/src/FileInput/FileInput.fr10.test.tsx +0 -21
  349. package/src/FileInput/FileInput.test.tsx +0 -1291
  350. package/src/FormLayout/FormLayout.test.tsx +0 -444
  351. package/src/FormLayout/__snapshots__/FormLayout.test.tsx.snap +0 -46
  352. package/src/Grid/Grid.test.tsx +0 -509
  353. package/src/HStack/HStack.test.tsx +0 -129
  354. package/src/Heading/Heading.test.tsx +0 -328
  355. package/src/HoverCard/HoverCard.test.tsx +0 -1339
  356. package/src/Icon/Icon.test.tsx +0 -990
  357. package/src/Icon/globalIconRegistry.test.tsx +0 -613
  358. package/src/IconButton/IconButton.test.tsx +0 -156
  359. package/src/Indicator/Indicator.test.tsx +0 -389
  360. package/src/Indicator/indicatorRegistry.test.tsx +0 -106
  361. package/src/InputGroup/InputGroup.test.tsx +0 -502
  362. package/src/InteractiveRoleContext/InteractiveRoleContext.test.tsx +0 -185
  363. package/src/Item/Item.source-build.test.mjs +0 -88
  364. package/src/Item/Item.swipeLayer.test.tsx +0 -74
  365. package/src/Item/Item.test.tsx +0 -1515
  366. package/src/Item/ItemMarkerColumns.a11y.chromium.spec.ts +0 -211
  367. package/src/Item/__tests__/ItemSwipeActions.a11y.chromium.spec.ts +0 -337
  368. package/src/Item/__tests__/ItemSwipePinchZoom.a11y.chromium.spec.ts +0 -186
  369. package/src/Kbd/Kbd.test.tsx +0 -299
  370. package/src/Layer/LayerProvider.test.tsx +0 -143
  371. package/src/Layer/__tests__/LayerBrowserHide.a11y.chromium.spec.ts +0 -126
  372. package/src/Layer/__tests__/LayerReducedMotion.a11y.chromium.spec.ts +0 -176
  373. package/src/Layer/__tests__/TouchTrigger.a11y.chromium.spec.ts +0 -200
  374. package/src/Layer/anchorName.test.ts +0 -146
  375. package/src/Layer/layerDismissalFamilies.test.tsx +0 -487
  376. package/src/Layer/layerDismissalInvariants.test.tsx +0 -501
  377. package/src/Layer/layerHost.test.ts +0 -117
  378. package/src/Layer/layerScopedContext.test.tsx +0 -499
  379. package/src/Layer/layerViewportInset.source-build.test.mjs +0 -90
  380. package/src/Layer/layerViewportInset.test.ts +0 -120
  381. package/src/Layer/popoverOperations.test.ts +0 -205
  382. package/src/Layer/useLayer.test.tsx +0 -2845
  383. package/src/Layer/useLayerDismissal.test.tsx +0 -580
  384. package/src/Layer/useTouchTrigger.test.ts +0 -70
  385. package/src/Layout/Layout.test.tsx +0 -375
  386. package/src/Layout/LayoutSlots.test.tsx +0 -376
  387. package/src/Layout/__tests__/Layout.a11y.chromium.spec.ts +0 -134
  388. package/src/Layout/__tests__/Layout.a11y.renders.tsx +0 -110
  389. package/src/Layout/__tests__/Layout.a11y.states.ts +0 -93
  390. package/src/Layout/__tests__/Layout.a11y.test.tsx +0 -142
  391. package/src/Layout/__tests__/childrenAsContent.test.tsx +0 -59
  392. package/src/Layout/__tests__/contentWidth.test.tsx +0 -303
  393. package/src/Layout/__tests__/edgeCompensation.test.tsx +0 -191
  394. package/src/Layout/__tests__/nestedPadding.test.tsx +0 -264
  395. package/src/Layout/overlayPaddingReset.test.tsx +0 -224
  396. package/src/Lightbox/Lightbox.test.tsx +0 -837
  397. package/src/Lightbox/LightboxKeyboard.a11y.browser.spec.ts +0 -78
  398. package/src/Lightbox/LightboxViewport.a11y.browser.spec.ts +0 -74
  399. package/src/Lightbox/useLightbox.test.tsx +0 -263
  400. package/src/Link/Link.test.tsx +0 -457
  401. package/src/Link/__tests__/Link.a11y.chromium.spec.ts +0 -153
  402. package/src/Link/__tests__/Link.a11y.renders.tsx +0 -97
  403. package/src/Link/__tests__/Link.a11y.states.ts +0 -104
  404. package/src/Link/__tests__/Link.a11y.test.tsx +0 -127
  405. package/src/Link/__tests__/Link.navigation.a11y.chromium.spec.ts +0 -262
  406. package/src/Link/__tests__/Link.truncation.a11y.chromium.spec.ts +0 -58
  407. package/src/Link/useLinkComponent.test.tsx +0 -572
  408. package/src/Link/useLinkify.test.tsx +0 -146
  409. package/src/List/List.test.tsx +0 -1052
  410. package/src/List/ListItem.source-build.test.mjs +0 -41
  411. package/src/List/ListMarkers.a11y.chromium.spec.ts +0 -904
  412. package/src/Markdown/Markdown.codeLanguages.test.tsx +0 -137
  413. package/src/Markdown/Markdown.fr23.bench.ts +0 -176
  414. package/src/Markdown/Markdown.fr23.perf.test.ts +0 -484
  415. package/src/Markdown/Markdown.helpers.perf.test.ts +0 -495
  416. package/src/Markdown/Markdown.public.test.ts +0 -309
  417. package/src/Markdown/Markdown.renderBoundary.test.tsx +0 -72
  418. package/src/Markdown/Markdown.rerender.test.tsx +0 -143
  419. package/src/Markdown/Markdown.test.tsx +0 -1383
  420. package/src/Markdown/MarkdownTable.a11y.chromium.spec.ts +0 -727
  421. package/src/Markdown/__tests__/MarkdownNesting.a11y.chromium.spec.ts +0 -102
  422. package/src/Markdown/angleDestinations.test.tsx +0 -104
  423. package/src/Markdown/ast.test.ts +0 -374
  424. package/src/Markdown/atxHeadingIndentation.test.tsx +0 -53
  425. package/src/Markdown/blockNesting.test.tsx +0 -124
  426. package/src/Markdown/blockquoteMarkers.test.tsx +0 -69
  427. package/src/Markdown/characterReferences.test.ts +0 -47
  428. package/src/Markdown/codeSpans.test.tsx +0 -65
  429. package/src/Markdown/emphasis.test.tsx +0 -214
  430. package/src/Markdown/fenceInfo.test.tsx +0 -47
  431. package/src/Markdown/imageAlt.test.tsx +0 -84
  432. package/src/Markdown/incremental.test.ts +0 -1198
  433. package/src/Markdown/incrementalIndentation.test.tsx +0 -36
  434. package/src/Markdown/indentedFences.test.tsx +0 -374
  435. package/src/Markdown/indentedTables.test.tsx +0 -53
  436. package/src/Markdown/linkBrackets.test.tsx +0 -116
  437. package/src/Markdown/linkDestinationLinear.test.tsx +0 -54
  438. package/src/Markdown/linkDestinations.test.tsx +0 -127
  439. package/src/Markdown/linkTextCode.test.tsx +0 -65
  440. package/src/Markdown/listBullets.test.tsx +0 -55
  441. package/src/Markdown/listContinuation.test.tsx +0 -94
  442. package/src/Markdown/listThematicBreak.test.tsx +0 -49
  443. package/src/Markdown/longLinkLabels.test.tsx +0 -49
  444. package/src/Markdown/openFenceFinalNewline.test.tsx +0 -85
  445. package/src/Markdown/parser.perf.test.ts +0 -398
  446. package/src/Markdown/parser.public.test.ts +0 -144
  447. package/src/Markdown/parser.test.ts +0 -1925
  448. package/src/Markdown/plugin-renderer/MarkdownPluginNodeRenderer.test.tsx +0 -300
  449. package/src/Markdown/plugins/frontmatter.test.tsx +0 -150
  450. package/src/Markdown/plugins/headingLinks.a11y.chromium.spec.ts +0 -856
  451. package/src/Markdown/plugins/headingLinks.ssr.test.tsx +0 -143
  452. package/src/Markdown/plugins/headingLinks.test.tsx +0 -637
  453. package/src/Markdown/plugins/protocol.test.tsx +0 -1083
  454. package/src/Markdown/plugins/semanticFence.test.tsx +0 -655
  455. package/src/Markdown/plugins/softBreaks.test.tsx +0 -172
  456. package/src/Markdown/plugins/sourceDecoration.test.tsx +0 -799
  457. package/src/Markdown/plugins/sourceLines.test.tsx +0 -715
  458. package/src/Markdown/plugins/textTransform.test.ts +0 -467
  459. package/src/Markdown/remark.test.tsx +0 -1877
  460. package/src/Markdown/streaming.test.ts +0 -148
  461. package/src/Markdown/streamingListShapes.test.tsx +0 -93
  462. package/src/Markdown/trailingSpaces.test.tsx +0 -45
  463. package/src/MetadataList/MetadataList.test.tsx +0 -383
  464. package/src/MobileNav/MobileNav.test.tsx +0 -296
  465. package/src/MobileNav/MobileNavCloseEdgeCases.test.tsx +0 -584
  466. package/src/MobileNav/MobileNavCloseTiming.test.ts +0 -58
  467. package/src/MobileNav/MobileNavCloseVisibility.test.tsx +0 -172
  468. package/src/MobileNav/MobileNavEntryAnimation.test.tsx +0 -212
  469. package/src/MobileNav/MobileNavFocus.test.tsx +0 -553
  470. package/src/MobileNav/MobileNavPinchZoom.a11y.chromium.spec.ts +0 -147
  471. package/src/MobileNav/MobileNavReopen.test.tsx +0 -118
  472. package/src/MobileNav/MobileNavScrollbarGutter.test.tsx +0 -109
  473. package/src/MobileNav/MobileNavToggle.test.tsx +0 -179
  474. package/src/MobileNav/__tests__/MobileNavHeader.a11y.chromium.spec.ts +0 -89
  475. package/src/MobileNav/__tests__/MobileNavWidth.a11y.chromium.spec.ts +0 -103
  476. package/src/MoreMenu/MoreMenu.test.tsx +0 -367
  477. package/src/MultiSelector/CreateRow.a11y.chromium.spec.ts +0 -148
  478. package/src/MultiSelector/MultiSelector.disabledFocus.a11y.chromium.spec.ts +0 -72
  479. package/src/MultiSelector/MultiSelector.focusableDisabled.test.tsx +0 -121
  480. package/src/MultiSelector/MultiSelector.fr10.test.tsx +0 -221
  481. package/src/MultiSelector/MultiSelector.test.tsx +0 -4971
  482. package/src/MultiSelector/OptionActions.a11y.chromium.spec.ts +0 -310
  483. package/src/MultiSelector/__tests__/MultiSelector.a11y.chromium.spec.ts +0 -46
  484. package/src/MultiSelector/__tests__/MultiSelector.listbox.a11y.test.tsx +0 -135
  485. package/src/NavIcon/NavIcon.test.tsx +0 -41
  486. package/src/NavMenu/NavHeadingMenu.test.tsx +0 -714
  487. package/src/NavMenu/__tests__/NavMenusSlideSelection.a11y.chromium.spec.ts +0 -137
  488. package/src/NumberInput/NumberInput.fr10.test.tsx +0 -21
  489. package/src/NumberInput/NumberInput.test.tsx +0 -2697
  490. package/src/NumberInput/__tests__/NumberInput.a11y.chromium.spec.ts +0 -124
  491. package/src/NumberInput/__tests__/NumberInput.a11y.known-failures.ts +0 -26
  492. package/src/NumberInput/__tests__/NumberInput.a11y.renders.tsx +0 -77
  493. package/src/NumberInput/__tests__/NumberInput.a11y.states.ts +0 -116
  494. package/src/NumberInput/__tests__/NumberInput.a11y.test.tsx +0 -154
  495. package/src/NumberInput/__tests__/NumberInput.coarse-pointer.a11y.chromium.spec.ts +0 -102
  496. package/src/NumberInput/numberInputCommit.test.ts +0 -72
  497. package/src/NumberInput/numberParser.docblock.test.ts +0 -234
  498. package/src/NumberInput/numberParser.test.ts +0 -222
  499. package/src/Outline/Outline.test.tsx +0 -1134
  500. package/src/Outline/OutlineFocus.a11y.chromium.spec.ts +0 -551
  501. package/src/Outline/parseOutlineFromMarkdown.test.ts +0 -104
  502. package/src/OverflowList/OverflowList.test.tsx +0 -1073
  503. package/src/Overlay/Overlay.test.tsx +0 -424
  504. package/src/Pagination/Pagination.test.tsx +0 -1754
  505. package/src/Popover/Popover.test.tsx +0 -1508
  506. package/src/Popover/PopoverPresentation.test.tsx +0 -952
  507. package/src/Popover/__tests__/PopoverSecondDocument.a11y.chromium.spec.ts +0 -267
  508. package/src/PowerSearch/PowerSearch.test.tsx +0 -1027
  509. package/src/PowerSearch/PowerSearchEditPopover.test.tsx +0 -1190
  510. package/src/PowerSearch/PowerSearchFilterEditor.test.tsx +0 -377
  511. package/src/PowerSearch/PowerSearchToken.test.tsx +0 -230
  512. package/src/PowerSearch/PowerSearchValueEditor.test.tsx +0 -754
  513. package/src/PowerSearch/formatFilterValue.test.ts +0 -339
  514. package/src/PowerSearch/resolveDateTimeRangePart.test.ts +0 -40
  515. package/src/PowerSearch/usePowerSearchConfig.test.ts +0 -832
  516. package/src/PowerSearch/usePowerSearchSource.test.ts +0 -621
  517. package/src/ProgressBar/ProgressBar.test.tsx +0 -928
  518. package/src/ProgressBar/__tests__/ProgressBar.a11y.chromium.spec.ts +0 -127
  519. package/src/ProgressBar/__tests__/ProgressBar.a11y.known-failures.ts +0 -12
  520. package/src/ProgressBar/__tests__/ProgressBar.a11y.renders.tsx +0 -38
  521. package/src/ProgressBar/__tests__/ProgressBar.a11y.states.ts +0 -123
  522. package/src/ProgressBar/__tests__/ProgressBar.a11y.test.tsx +0 -107
  523. package/src/ProgressBar/__tests__/ProgressBarMotion.a11y.chromium.spec.ts +0 -831
  524. package/src/RadioList/RadioList.fr10.test.tsx +0 -67
  525. package/src/RadioList/RadioList.test.tsx +0 -1051
  526. package/src/RadioList/RadioListItem.press.source-build.test.mjs +0 -80
  527. package/src/RadioList/__tests__/RadioGroup.a11y.chromium.spec.ts +0 -274
  528. package/src/RadioList/__tests__/RadioGroup.a11y.known-failures.ts +0 -12
  529. package/src/RadioList/__tests__/RadioGroup.a11y.renders.tsx +0 -232
  530. package/src/RadioList/__tests__/RadioGroup.a11y.states.ts +0 -503
  531. package/src/RadioList/__tests__/RadioGroup.a11y.test.tsx +0 -217
  532. package/src/Resizable/ResizeHandle.test.tsx +0 -1067
  533. package/src/Resizable/__tests__/ResizeHandle.a11y.chromium.spec.ts +0 -127
  534. package/src/Resizable/__tests__/ResizeHandle.a11y.known-failures.ts +0 -39
  535. package/src/Resizable/__tests__/ResizeHandle.a11y.renders.tsx +0 -80
  536. package/src/Resizable/__tests__/ResizeHandle.a11y.states.ts +0 -197
  537. package/src/Resizable/__tests__/ResizeHandle.a11y.test.tsx +0 -123
  538. package/src/Resizable/shippedDirections.test.ts +0 -462
  539. package/src/Resizable/useResizable.test.ts +0 -1725
  540. package/src/Resizable/utils.test.ts +0 -74
  541. package/src/ScrollableArea/ScrollableArea.test.tsx +0 -304
  542. package/src/Section/Section.test.tsx +0 -376
  543. package/src/SegmentedControl/SegmentedControl.test.tsx +0 -981
  544. package/src/SelectableCard/SelectableCard.test.tsx +0 -216
  545. package/src/Selector/Selector.focusableDisabled.test.tsx +0 -127
  546. package/src/Selector/Selector.fr10.test.tsx +0 -149
  547. package/src/Selector/Selector.sheetActiveDescendant.test.tsx +0 -95
  548. package/src/Selector/Selector.source-build.test.mjs +0 -79
  549. package/src/Selector/Selector.test.tsx +0 -5117
  550. package/src/Selector/__tests__/Combobox.a11y.known-failures.ts +0 -27
  551. package/src/Selector/__tests__/Combobox.a11y.states.ts +0 -145
  552. package/src/Selector/__tests__/ComboboxField.a11y.chromium.spec.ts +0 -458
  553. package/src/Selector/__tests__/EmptyStateAnnouncement.a11y.chromium.spec.ts +0 -91
  554. package/src/Selector/__tests__/Listbox.a11y.chromium.spec.ts +0 -131
  555. package/src/Selector/__tests__/Listbox.a11y.dom.ts +0 -38
  556. package/src/Selector/__tests__/Listbox.a11y.inventory.test.ts +0 -63
  557. package/src/Selector/__tests__/Listbox.a11y.known-failures.ts +0 -12
  558. package/src/Selector/__tests__/Listbox.a11y.states.ts +0 -232
  559. package/src/Selector/__tests__/Selector.a11y.chromium.spec.ts +0 -46
  560. package/src/Selector/__tests__/Selector.combobox.a11y.chromium.spec.ts +0 -109
  561. package/src/Selector/__tests__/Selector.combobox.a11y.test.tsx +0 -133
  562. package/src/Selector/__tests__/Selector.listbox.a11y.test.tsx +0 -128
  563. package/src/Selector/useCombobox.public.test.tsx +0 -89
  564. package/src/Selector/useCombobox.test.tsx +0 -444
  565. package/src/SideNav/SideNav.test.tsx +0 -4275
  566. package/src/SideNav/SideNavRailMotion.test.tsx +0 -620
  567. package/src/SideNav/__tests__/SideNavRailMotion.interaction.browser.spec.ts +0 -542
  568. package/src/SizeContext/SizeContext.test.tsx +0 -226
  569. package/src/Skeleton/Skeleton.test.tsx +0 -148
  570. package/src/Slider/Slider.fr10.test.tsx +0 -93
  571. package/src/Slider/Slider.test.tsx +0 -1661
  572. package/src/Slider/__tests__/Slider.a11y.chromium.spec.ts +0 -125
  573. package/src/Slider/__tests__/Slider.a11y.known-failures.ts +0 -12
  574. package/src/Slider/__tests__/Slider.a11y.renders.tsx +0 -42
  575. package/src/Slider/__tests__/Slider.a11y.states.ts +0 -106
  576. package/src/Slider/__tests__/Slider.a11y.test.tsx +0 -105
  577. package/src/Spinner/Spinner.test.tsx +0 -484
  578. package/src/Stack/Stack.test.tsx +0 -473
  579. package/src/Stack/StackItem.test.tsx +0 -105
  580. package/src/StatusDot/StatusDot.test.tsx +0 -213
  581. package/src/Stepper/Stepper.public.test.ts +0 -91
  582. package/src/Stepper/Stepper.test.tsx +0 -2130
  583. package/src/Switch/Switch.focusRing.source-build.test.mjs +0 -81
  584. package/src/Switch/Switch.test.tsx +0 -1136
  585. package/src/Switch/__tests__/Switch.a11y.chromium.spec.ts +0 -211
  586. package/src/Switch/__tests__/Switch.a11y.known-failures.ts +0 -28
  587. package/src/Switch/__tests__/Switch.a11y.states.ts +0 -275
  588. package/src/Switch/__tests__/Switch.a11y.test.tsx +0 -144
  589. package/src/TabList/TabList.test.tsx +0 -1755
  590. package/src/TabList/__tests__/TabListOverflow.interaction.browser.spec.ts +0 -99
  591. package/src/TabList/__tests__/TabPressPointer.interaction.browser.spec.ts +0 -163
  592. package/src/TabList/__tests__/Tabs.a11y.chromium.spec.ts +0 -199
  593. package/src/TabList/__tests__/Tabs.a11y.known-failures.ts +0 -12
  594. package/src/TabList/__tests__/Tabs.a11y.renders.tsx +0 -92
  595. package/src/TabList/__tests__/Tabs.a11y.states.ts +0 -247
  596. package/src/TabList/__tests__/Tabs.a11y.test.tsx +0 -153
  597. package/src/Table/Table.perf.test.tsx +0 -569
  598. package/src/Table/Table.test.tsx +0 -1883
  599. package/src/Table/TableHeaderCell.test.tsx +0 -291
  600. package/src/Table/TableSelectionToolbar.test.tsx +0 -109
  601. package/src/Table/__tests__/Table.a11y.chromium.spec.ts +0 -141
  602. package/src/Table/__tests__/Table.a11y.contracts.ts +0 -35
  603. package/src/Table/__tests__/Table.a11y.renders.tsx +0 -112
  604. package/src/Table/__tests__/Table.a11y.states.ts +0 -136
  605. package/src/Table/__tests__/Table.a11y.test.tsx +0 -198
  606. package/src/Table/__tests__/TableMinWidth.a11y.chromium.spec.ts +0 -75
  607. package/src/Table/__tests__/TableRowGlide.a11y.browser.spec.ts +0 -382
  608. package/src/Table/__tests__/TableScroll.a11y.chromium.spec.ts +0 -138
  609. package/src/Table/__tests__/TableStickyDividers.a11y.browser.spec.ts +0 -560
  610. package/src/Table/plugins/columnResize/useTableColumnResize.test.tsx +0 -941
  611. package/src/Table/plugins/columnSettings/useTableColumnSettings.test.tsx +0 -175
  612. package/src/Table/plugins/columnSettings/useTableColumnSettingsState.test.tsx +0 -296
  613. package/src/Table/plugins/filtering/useTableFilterState.test.tsx +0 -143
  614. package/src/Table/plugins/filtering/useTableFiltering.test.tsx +0 -357
  615. package/src/Table/plugins/groupedRows/useTableGroupedRows-perf.test.tsx +0 -112
  616. package/src/Table/plugins/groupedRows/useTableGroupedRows.test.tsx +0 -409
  617. package/src/Table/plugins/pagination/useTablePagination-perf.test.tsx +0 -232
  618. package/src/Table/plugins/pagination/useTablePagination.test.tsx +0 -666
  619. package/src/Table/plugins/rowExpansion/useTableRowExpansion.glide.test.tsx +0 -280
  620. package/src/Table/plugins/rowExpansion/useTableRowExpansion.test.tsx +0 -681
  621. package/src/Table/plugins/rowIndex/useTableRowIndex.test.tsx +0 -132
  622. package/src/Table/plugins/rowStatus/useTableRowStatus.public.test.ts +0 -92
  623. package/src/Table/plugins/rowStatus/useTableRowStatus.test.tsx +0 -519
  624. package/src/Table/plugins/selection/useTableSelection-perf.test.tsx +0 -258
  625. package/src/Table/plugins/selection/useTableSelection.test.tsx +0 -424
  626. package/src/Table/plugins/selection/useTableSelectionState.test.tsx +0 -451
  627. package/src/Table/plugins/sortable/__tests__/useTableSortable.a11y.test.tsx +0 -174
  628. package/src/Table/plugins/sortable/__tests__/useTableSortable.a11y.ts +0 -86
  629. package/src/Table/plugins/sortable/useTableSortable.test.tsx +0 -786
  630. package/src/Table/plugins/sortable/useTableSortableState.test.tsx +0 -580
  631. package/src/Table/plugins/stickyColumns/useTableStickyColumns.test.tsx +0 -334
  632. package/src/Table/plugins/tree/useTableTreeData-perf.test.tsx +0 -163
  633. package/src/Table/plugins/tree/useTableTreeData.test.tsx +0 -992
  634. package/src/Table/plugins/tree/useTableTreeState.test.tsx +0 -740
  635. package/src/Table/tableContextMenu.test.tsx +0 -208
  636. package/src/Text/Text.test.tsx +0 -405
  637. package/src/Text/useTruncation.test.tsx +0 -196
  638. package/src/TextArea/TextArea.fr10.test.tsx +0 -21
  639. package/src/TextArea/TextArea.test.tsx +0 -1317
  640. package/src/TextInput/TextInput.fr10.test.tsx +0 -21
  641. package/src/TextInput/TextInput.test.tsx +0 -1280
  642. package/src/TextInput/__tests__/TextInput.a11y.chromium.spec.ts +0 -214
  643. package/src/TextInput/__tests__/TextInput.a11y.known-failures.ts +0 -40
  644. package/src/TextInput/__tests__/TextInput.a11y.renders.tsx +0 -202
  645. package/src/TextInput/__tests__/TextInput.a11y.states.ts +0 -384
  646. package/src/TextInput/__tests__/TextInput.a11y.test.tsx +0 -130
  647. package/src/Thumbnail/Thumbnail.test.tsx +0 -384
  648. package/src/TimeInput/NativeTimeInput.test.tsx +0 -343
  649. package/src/TimeInput/Presentation.test.tsx +0 -192
  650. package/src/TimeInput/TimeInput.fr10.test.tsx +0 -312
  651. package/src/TimeInput/TimeInput.test.tsx +0 -907
  652. package/src/Timer/Timer.test.tsx +0 -302
  653. package/src/Timestamp/Timestamp.test.tsx +0 -1661
  654. package/src/Timestamp/tooltipEntries.test.ts +0 -566
  655. package/src/Toast/ToastViewport.modalHost.test.tsx +0 -891
  656. package/src/Toast/ToastViewport.test.tsx +0 -3130
  657. package/src/Toast/useToast.test.tsx +0 -258
  658. package/src/ToggleButton/ToggleButton.test.tsx +0 -1000
  659. package/src/ToggleButton/__tests__/ToggleButton.a11y.chromium.spec.ts +0 -177
  660. package/src/ToggleButton/__tests__/ToggleButton.a11y.renders.tsx +0 -133
  661. package/src/ToggleButton/__tests__/ToggleButton.a11y.states.ts +0 -167
  662. package/src/ToggleButton/__tests__/ToggleButton.a11y.test.tsx +0 -103
  663. package/src/Token/Token.test.tsx +0 -707
  664. package/src/Token/__tests__/TokenRemoveTarget.a11y.chromium.spec.ts +0 -87
  665. package/src/Tokenizer/Tokenizer.fr10.test.tsx +0 -28
  666. package/src/Tokenizer/Tokenizer.props-type.test.tsx +0 -126
  667. package/src/Tokenizer/Tokenizer.ssr.test.tsx +0 -196
  668. package/src/Tokenizer/Tokenizer.test.tsx +0 -2216
  669. package/src/Tokenizer/TokenizerBottomSheet.test.tsx +0 -2738
  670. package/src/Tokenizer/__tests__/TokenizerEndLane.a11y.chromium.spec.ts +0 -505
  671. package/src/Toolbar/Toolbar.test.tsx +0 -600
  672. package/src/Toolbar/__tests__/Toolbar.a11y.chromium.spec.ts +0 -176
  673. package/src/Toolbar/__tests__/Toolbar.a11y.renders.tsx +0 -63
  674. package/src/Toolbar/__tests__/Toolbar.a11y.states.ts +0 -142
  675. package/src/Toolbar/__tests__/Toolbar.a11y.test.tsx +0 -126
  676. package/src/Tooltip/Tooltip.test.tsx +0 -819
  677. package/src/Tooltip/__tests__/Tooltip.a11y.chromium.spec.ts +0 -141
  678. package/src/Tooltip/__tests__/Tooltip.a11y.renders.tsx +0 -86
  679. package/src/Tooltip/__tests__/Tooltip.a11y.states.ts +0 -132
  680. package/src/Tooltip/__tests__/Tooltip.a11y.test.tsx +0 -126
  681. package/src/Tooltip/__tests__/TooltipFocusReturn.a11y.chromium.spec.ts +0 -130
  682. package/src/Tooltip/__tests__/TooltipHoverBridge.a11y.chromium.spec.ts +0 -75
  683. package/src/Tooltip/__tests__/TooltipTallContent.a11y.browser.spec.ts +0 -673
  684. package/src/Tooltip/__tests__/TooltipTallContentTracking.a11y.browser.spec.ts +0 -1162
  685. package/src/Tooltip/useTooltip.test.tsx +0 -483
  686. package/src/TopNav/TopNav.test.tsx +0 -863
  687. package/src/TopNav/TopNavMegaMenu.reduced-motion.source-build.test.mjs +0 -83
  688. package/src/TopNav/TopNavMegaMenu.test.tsx +0 -1153
  689. package/src/TopNav/TopNavMenu.test.tsx +0 -502
  690. package/src/TopNav/__tests__/TopNavMobileLongHeading.a11y.chromium.spec.ts +0 -75
  691. package/src/TreeList/TreeList.test.tsx +0 -1737
  692. package/src/TreeList/__tests__/TreeList.a11y.chromium.spec.ts +0 -138
  693. package/src/TreeList/__tests__/TreeList.a11y.renders.tsx +0 -44
  694. package/src/TreeList/__tests__/TreeList.a11y.states.ts +0 -164
  695. package/src/TreeList/__tests__/TreeList.a11y.test.tsx +0 -138
  696. package/src/TreeList/__tests__/TreeListGuideAlignment.interaction.browser.spec.ts +0 -127
  697. package/src/TreeList/__tests__/TreeListRowNames.a11y.chromium.spec.ts +0 -83
  698. package/src/Typeahead/BaseTypeahead.emptyState.a11y.chromium.spec.ts +0 -138
  699. package/src/Typeahead/BaseTypeahead.test.tsx +0 -553
  700. package/src/Typeahead/Typeahead.fr10.test.tsx +0 -28
  701. package/src/Typeahead/Typeahead.test.tsx +0 -2984
  702. package/src/Typeahead/TypeaheadItem.test.tsx +0 -134
  703. package/src/VStack/VStack.test.tsx +0 -128
  704. package/src/VisuallyHidden/VisuallyHidden.test.tsx +0 -115
  705. package/src/__tests__/BusyOwnerAnnouncement.test.tsx +0 -853
  706. package/src/__tests__/CardPress.a11y.chromium.spec.ts +0 -353
  707. package/src/__tests__/DisabledTriggerFocus.a11y.chromium.spec.ts +0 -87
  708. package/src/__tests__/PressModality.a11y.chromium.spec.ts +0 -392
  709. package/src/__tests__/PressedState.a11y.chromium.spec.ts +0 -814
  710. package/src/__tests__/TestIcon.tsx +0 -26
  711. package/src/__tests__/babelPluginAddExtensions.test.ts +0 -190
  712. package/src/__tests__/fastRoleQueries.ts +0 -66
  713. package/src/__tests__/forcedColors.ts +0 -60
  714. package/src/__tests__/internalModulesNotExperimental.test.ts +0 -88
  715. package/src/__tests__/pressState.ts +0 -216
  716. package/src/__tests__/stubMatchMedia.test.ts +0 -79
  717. package/src/__tests__/stubMatchMedia.ts +0 -95
  718. package/src/__tests__/stylexDeclarations.ts +0 -51
  719. package/src/__tests__/unthemedLength.ts +0 -34
  720. package/src/docPropLiterals.test.ts +0 -964
  721. package/src/docPropReferences.test.ts +0 -178
  722. package/src/docs-script.test.mjs +0 -55
  723. package/src/gestures/__tests__/GestureHost.test.ts +0 -2136
  724. package/src/gestures/__tests__/LongPressGestureRecognizer.test.ts +0 -141
  725. package/src/gestures/__tests__/PanGestureRecognizer.test.ts +0 -327
  726. package/src/gestures/__tests__/PinchGestureRecognizer.test.ts +0 -74
  727. package/src/gestures/__tests__/PressTracker.test.ts +0 -275
  728. package/src/gestures/__tests__/ScreenEdgePanGestureRecognizer.test.ts +0 -498
  729. package/src/gestures/__tests__/SwipeGestureRecognizer.test.ts +0 -108
  730. package/src/gestures/__tests__/TapGestureRecognizer.test.ts +0 -154
  731. package/src/gestures/__tests__/VelocityTracker.streams.test.ts +0 -243
  732. package/src/gestures/__tests__/VelocityTracker.test.ts +0 -261
  733. package/src/gestures/__tests__/arena.test.ts +0 -864
  734. package/src/gestures/__tests__/arenaContinuous.test.ts +0 -207
  735. package/src/gestures/__tests__/arenaPinchSwipeEdge.test.ts +0 -193
  736. package/src/gestures/__tests__/arenaTapLongPress.test.ts +0 -211
  737. package/src/gestures/__tests__/browser/build-fixture.mjs +0 -46
  738. package/src/gestures/__tests__/browser/fixture.ts +0 -307
  739. package/src/gestures/__tests__/browser/gestures.interaction.browser.spec.ts +0 -1137
  740. package/src/gestures/__tests__/browserNegotiation.test.ts +0 -293
  741. package/src/gestures/__tests__/fixtures/pointer-streams/README.md +0 -82
  742. package/src/gestures/__tests__/fixtures/pointer-streams/android-chromium-fling.json +0 -130
  743. package/src/gestures/__tests__/fixtures/pointer-streams/android-chromium-slow.json +0 -860
  744. package/src/gestures/__tests__/fixtures/pointer-streams/android-chromium-stop-release.json +0 -357
  745. package/src/gestures/__tests__/fixtures/pointer-streams/android-firefox-fling.json +0 -66
  746. package/src/gestures/__tests__/fixtures/pointer-streams/android-firefox-slow.json +0 -268
  747. package/src/gestures/__tests__/fixtures/pointer-streams/android-firefox-stop-release.json +0 -128
  748. package/src/gestures/__tests__/fixtures/pointer-streams/capture.html +0 -123
  749. package/src/gestures/__tests__/fixtures/pointer-streams/desktop-chromium-mouse-fling.json +0 -64
  750. package/src/gestures/__tests__/fixtures/pointer-streams/desktop-chromium-mouse-slow.json +0 -268
  751. package/src/gestures/__tests__/fixtures/pointer-streams/desktop-chromium-mouse-stop-release.json +0 -124
  752. package/src/gestures/__tests__/fixtures/pointer-streams/desktop-chromium-pen-fling.json +0 -64
  753. package/src/gestures/__tests__/fixtures/pointer-streams/desktop-chromium-pen-slow.json +0 -268
  754. package/src/gestures/__tests__/fixtures/pointer-streams/desktop-chromium-pen-stop-release.json +0 -124
  755. package/src/gestures/__tests__/fixtures/pointer-streams/desktop-chromium-touch-fling.json +0 -84
  756. package/src/gestures/__tests__/fixtures/pointer-streams/desktop-chromium-touch-slow.json +0 -381
  757. package/src/gestures/__tests__/fixtures/pointer-streams/desktop-chromium-touch-stop-release.json +0 -171
  758. package/src/gestures/__tests__/fixtures/pointer-streams/ios-safari-fling.json +0 -45
  759. package/src/gestures/__tests__/fixtures/pointer-streams/ios-safari-slow.json +0 -101
  760. package/src/gestures/__tests__/fixtures/pointer-streams/ios-safari-stop-release.json +0 -130
  761. package/src/gestures/__tests__/haptics.test.ts +0 -187
  762. package/src/gestures/__tests__/harness.ts +0 -252
  763. package/src/gestures/__tests__/pressTrackerFactory.test.ts +0 -59
  764. package/src/gestures/__tests__/recognizerKind.test.ts +0 -78
  765. package/src/gestures/__tests__/touchActionRule.test.ts +0 -54
  766. package/src/gestures/__tests__/useGestureRecognizer.test.tsx +0 -570
  767. package/src/hooks/__tests__/MenuPressShadowRoot.a11y.chromium.spec.ts +0 -144
  768. package/src/hooks/__tests__/menuLinkClicks.ts +0 -71
  769. package/src/hooks/actionGroupTracker.exports.test.ts +0 -28
  770. package/src/hooks/actionGroupTracker.test.ts +0 -510
  771. package/src/hooks/computeOverflow.test.ts +0 -422
  772. package/src/hooks/deprecatedApis.public.test.ts +0 -33
  773. package/src/hooks/menuPressGesture.test.ts +0 -253
  774. package/src/hooks/scrollKeyboardDelegation.test.ts +0 -188
  775. package/src/hooks/scrollbarGutter.test.ts +0 -167
  776. package/src/hooks/useAnnounce.modal.test.tsx +0 -1291
  777. package/src/hooks/useAnnounce.replace.test.tsx +0 -516
  778. package/src/hooks/useAnnounce.test.tsx +0 -293
  779. package/src/hooks/useAnnounceRenderedText.adopters.test.tsx +0 -235
  780. package/src/hooks/useAutoMediaMode.test.ts +0 -109
  781. package/src/hooks/useBusyAnnouncement.adopters.test.tsx +0 -69
  782. package/src/hooks/useBusyAnnouncement.test.tsx +0 -112
  783. package/src/hooks/useClickableContainer.test.tsx +0 -236
  784. package/src/hooks/useClipboard.test.tsx +0 -151
  785. package/src/hooks/useContainerReveal.test.tsx +0 -163
  786. package/src/hooks/useDevWarning.test.tsx +0 -45
  787. package/src/hooks/useEntryAnimation.ssr.test.tsx +0 -143
  788. package/src/hooks/useFocusTrap.test.tsx +0 -635
  789. package/src/hooks/useFocusTrapEscapeShim.test.tsx +0 -166
  790. package/src/hooks/useGridFocus.test.tsx +0 -165
  791. package/src/hooks/useHotkeys.test.ts +0 -265
  792. package/src/hooks/useImageMode.test.ts +0 -133
  793. package/src/hooks/useInputContainer.test.tsx +0 -180
  794. package/src/hooks/useInputStatusIcon.test.tsx +0 -240
  795. package/src/hooks/useIsHydrating.test.tsx +0 -70
  796. package/src/hooks/useKeyboardHint.test.tsx +0 -92
  797. package/src/hooks/useListFocus.test.tsx +0 -664
  798. package/src/hooks/useLongPress.test.tsx +0 -152
  799. package/src/hooks/useMediaQuery.test.ts +0 -165
  800. package/src/hooks/useMenuHover.test.tsx +0 -536
  801. package/src/hooks/useMenuPress.test.tsx +0 -565
  802. package/src/hooks/useMergedRefs.test.tsx +0 -62
  803. package/src/hooks/useOverflow.test.ts +0 -504
  804. package/src/hooks/useRenamedProp.test.tsx +0 -95
  805. package/src/hooks/useScrollLock.test.ts +0 -248
  806. package/src/hooks/useScrollOverflow.test.tsx +0 -323
  807. package/src/hooks/useScrollableArea.test.tsx +0 -836
  808. package/src/hooks/useStreamingText.test.ts +0 -237
  809. package/src/hooks/useTreeFocus.test.tsx +0 -351
  810. package/src/hooks/useTypeahead.test.tsx +0 -351
  811. package/src/i18n/__tests__/InternationalizationProvider.test.tsx +0 -128
  812. package/src/i18n/__tests__/e2e-pagination.test.tsx +0 -172
  813. package/src/i18n/__tests__/e2e-powersearch.test.tsx +0 -166
  814. package/src/i18n/__tests__/getLocaleDirection.test.ts +0 -40
  815. package/src/i18n/__tests__/resolve.test.ts +0 -325
  816. package/src/i18n/__tests__/useCollator.test.tsx +0 -115
  817. package/src/i18n/__tests__/useDirection.test.tsx +0 -66
  818. package/src/i18n/__tests__/useLocale.test.tsx +0 -52
  819. package/src/i18n/useTranslator.test.tsx +0 -267
  820. package/src/inputFontFloor.test.ts +0 -106
  821. package/src/internal/tokenizer-presentation.test.ts +0 -29
  822. package/src/internal/touch.test.ts +0 -44
  823. package/src/motion/__tests__/animatedLayout.interaction.browser.spec.ts +0 -1613
  824. package/src/motion/__tests__/animatedLayoutAdopters.interaction.browser.spec.ts +0 -217
  825. package/src/motion/__tests__/animatedLayoutBundle.ts +0 -17
  826. package/src/motion/__tests__/animator.interaction.browser.spec.ts +0 -843
  827. package/src/motion/__tests__/motionBundle.ts +0 -14
  828. package/src/motion/animatedLayout.boundary.test.ts +0 -155
  829. package/src/motion/animatedLayout.swap.test.ts +0 -827
  830. package/src/motion/animatedLayout.test.ts +0 -1154
  831. package/src/motion/animatedLayoutAdopters.test.tsx +0 -500
  832. package/src/motion/animator.test.ts +0 -3746
  833. package/src/motion/bezier.test.ts +0 -52
  834. package/src/motion/coast.test.ts +0 -99
  835. package/src/motion/decay.test.ts +0 -120
  836. package/src/motion/projection.test.ts +0 -107
  837. package/src/motion/reducedMotion.test.ts +0 -129
  838. package/src/motion/reducedMotionPlan.test.ts +0 -208
  839. package/src/motion/resolveMotion.test.ts +0 -123
  840. package/src/motion/resolveSnapPoint.test.ts +0 -189
  841. package/src/motion/roles.test.ts +0 -273
  842. package/src/motion/rubberBand.test.ts +0 -88
  843. package/src/motion/selectPage.test.ts +0 -31
  844. package/src/motion/spring.test.ts +0 -650
  845. package/src/motion/uikit/gestures.test.ts +0 -89
  846. package/src/motion/uikit/springRows.test.ts +0 -71
  847. package/src/motion/uikit/tableImports.test.ts +0 -293
  848. package/src/motion/uikit/uikit.test.ts +0 -364
  849. package/src/motion/uikit/values.test.ts +0 -121
  850. package/src/naming.test.ts +0 -44
  851. package/src/postinstall.test.mjs +0 -216
  852. package/src/reset.a11y.chromium.spec.ts +0 -238
  853. package/src/reset.test.ts +0 -205
  854. package/src/reset.until-found.a11y.browser.spec.ts +0 -76
  855. package/src/reset.until-found.test.ts +0 -32
  856. package/src/serverSafeComponents.test.ts +0 -675
  857. package/src/stylexValidation.source-build.test.mjs +0 -42
  858. package/src/tailwind-theme.test.ts +0 -153
  859. package/src/theme/MediaTheme.dom.test.tsx +0 -97
  860. package/src/theme/Theme.test.tsx +0 -337
  861. package/src/theme/__tests__/SpacingRootFontSize.a11y.chromium.spec.ts +0 -199
  862. package/src/theme/contrast.test.ts +0 -94
  863. package/src/theme/declarationBoundary.test.ts +0 -126
  864. package/src/theme/defineTheme.test.ts +0 -2028
  865. package/src/theme/derivedVarRegistry.test.ts +0 -592
  866. package/src/theme/expandColorScale.test.ts +0 -651
  867. package/src/theme/expandMotionScale.test.ts +0 -145
  868. package/src/theme/expandRadiusScale.test.ts +0 -59
  869. package/src/theme/expandTypeScale.test.ts +0 -351
  870. package/src/theme/extensibleAxes.test.ts +0 -432
  871. package/src/theme/generateThemeRules.test.ts +0 -1870
  872. package/src/theme/hct.test.ts +0 -93
  873. package/src/theme/onMediaTokens.test.ts +0 -431
  874. package/src/theme/publicThemeHelperContract.test.ts +0 -67
  875. package/src/theme/syntax/defineSyntaxTheme.diff.test.ts +0 -91
  876. package/src/theme/syntax/serverSafeSyntax.test.ts +0 -68
  877. package/src/theme/syntax/useSyntaxTheme.diff.test.tsx +0 -40
  878. package/src/theme/themeAdaptations.test.ts +0 -1795
  879. package/src/theme/themeMotion.test.ts +0 -620
  880. package/src/theme/themeRegistry.test.ts +0 -59
  881. package/src/theme/themingTargets.test.ts +0 -589
  882. package/src/theme/tokenValueCompat.test.ts +0 -204
  883. package/src/theme/tokens.test.ts +0 -441
  884. package/src/theme/useTheme.test.tsx +0 -322
  885. package/src/unicodePropertyEscapes.source-build.test.mjs +0 -69
  886. package/src/utils/chainEventHandlers.test.ts +0 -39
  887. package/src/utils/characters.test.ts +0 -141
  888. package/src/utils/color.test.ts +0 -233
  889. package/src/utils/composeEventHandlers.test.ts +0 -71
  890. package/src/utils/customPropertyArmLayering.test.ts +0 -131
  891. package/src/utils/dateParser.test.ts +0 -402
  892. package/src/utils/dateTypes.test.ts +0 -40
  893. package/src/utils/devWarning.test.ts +0 -56
  894. package/src/utils/edgeAutoscroll.test.ts +0 -192
  895. package/src/utils/focusReturn.test.ts +0 -119
  896. package/src/utils/getKey.test.ts +0 -25
  897. package/src/utils/getNodeText.test.ts +0 -24
  898. package/src/utils/hitArea.test.ts +0 -628
  899. package/src/utils/ime.test.ts +0 -32
  900. package/src/utils/inputAria.test.ts +0 -39
  901. package/src/utils/interactionModality.test.ts +0 -144
  902. package/src/utils/isApplePlatform.test.ts +0 -61
  903. package/src/utils/mergeProps.test.ts +0 -166
  904. package/src/utils/mergeRefs.test.ts +0 -48
  905. package/src/utils/parseStyleKey.test.ts +0 -56
  906. package/src/utils/plainDate.test.ts +0 -938
  907. package/src/utils/presentation.test.ts +0 -380
  908. package/src/utils/pressFeedback.test.ts +0 -1012
  909. package/src/utils/pressGesture.test.ts +0 -332
  910. package/src/utils/pressPaintPriority.test.ts +0 -80
  911. package/src/utils/pressPaintSource.test.ts +0 -65
  912. package/src/utils/pressableCoverage.test.ts +0 -192
  913. package/src/utils/primaryClick.test.ts +0 -38
  914. package/src/utils/safeUrl.test.ts +0 -101
  915. package/src/utils/sharedMutationObserver.test.ts +0 -106
  916. package/src/utils/sharedResizeObserver.test.ts +0 -283
  917. package/src/utils/themeProps.test.ts +0 -62
  918. package/src/utils/timeFormat.test.ts +0 -204
  919. package/src/utils/timeParser.test.ts +0 -295
  920. package/src/utils/touchPresentation.test.ts +0 -462
  921. package/src/utils/unicodeDigits.test.ts +0 -44
@@ -1,2136 +0,0 @@
1
- // Copyright (c) Meta Platforms, Inc. and affiliates.
2
-
3
- /**
4
- * @file GestureHost.test.ts
5
- * @input A GestureHost on the jsdom document, real DOM listeners, and
6
- * dispatched touch, pointer, click, contextmenu and scroll events with
7
- * explicit timestamps
8
- * @output The DOM integration: hit-path collection (shadow DOM included),
9
- * touch-action negotiation, cancelling touchmove only while claimed,
10
- * click suppression and replay, browser takeover, the mouse path,
11
- * context menus, focus loss
12
- * @position jsdom integration tests of packages/core/src/gestures
13
- */
14
-
15
- import {afterEach, beforeEach, describe, expect, it, vi} from 'vitest';
16
- import {UIKIT_GESTURES} from '../../motion/uikit/gestures';
17
- import {GestureHost} from '../GestureHost';
18
- import {LongPressGestureRecognizer} from '../LongPressGestureRecognizer';
19
- import {PanGestureRecognizer} from '../PanGestureRecognizer';
20
- import {ScreenEdgePanGestureRecognizer} from '../ScreenEdgePanGestureRecognizer';
21
- import {TapGestureRecognizer} from '../TapGestureRecognizer';
22
- import {ManualClock, RecordingConsumer} from './harness';
23
- import type {GestureTouch} from '../types';
24
-
25
- interface Contact {
26
- id: number;
27
- x: number;
28
- y: number;
29
- target?: EventTarget;
30
- }
31
-
32
- function touch(
33
- type: 'touchstart' | 'touchmove' | 'touchend' | 'touchcancel',
34
- target: EventTarget,
35
- changed: Contact[],
36
- all: Contact[],
37
- time: number,
38
- cancelable = true,
39
- ): Event {
40
- const event = new Event(type, {bubbles: true, cancelable, composed: true});
41
- const toTouch = (contact: Contact) => ({
42
- identifier: contact.id,
43
- clientX: contact.x,
44
- clientY: contact.y,
45
- target: contact.target ?? target,
46
- });
47
- Object.defineProperty(event, 'changedTouches', {value: changed.map(toTouch)});
48
- Object.defineProperty(event, 'touches', {value: all.map(toTouch)});
49
- Object.defineProperty(event, 'timeStamp', {value: time});
50
- target.dispatchEvent(event);
51
- return event;
52
- }
53
-
54
- function pointer(
55
- type: string,
56
- target: EventTarget,
57
- init: {
58
- id?: number;
59
- pointerType: string;
60
- x: number;
61
- y: number;
62
- buttons?: number;
63
- time: number;
64
- },
65
- ): Event {
66
- const event = new PointerEvent(type, {
67
- bubbles: true,
68
- cancelable: true,
69
- composed: true,
70
- pointerId: init.id ?? 1,
71
- pointerType: init.pointerType,
72
- clientX: init.x,
73
- clientY: init.y,
74
- button: 0,
75
- buttons: init.buttons ?? 0,
76
- });
77
- Object.defineProperty(event, 'timeStamp', {value: init.time});
78
- target.dispatchEvent(event);
79
- return event;
80
- }
81
-
82
- let host: GestureHost;
83
- let clock: ManualClock;
84
- let detachers: (() => void)[];
85
-
86
- /** jsdom computes no layout: give a scroller its metrics. */
87
- function scrollable(
88
- element: HTMLElement,
89
- metrics: {
90
- scrollTop?: number;
91
- scrollHeight?: number;
92
- clientHeight?: number;
93
- scrollLeft?: number;
94
- scrollWidth?: number;
95
- clientWidth?: number;
96
- },
97
- ): void {
98
- for (const [key, value] of Object.entries(metrics)) {
99
- Object.defineProperty(element, key, {configurable: true, value});
100
- }
101
- }
102
-
103
- /**
104
- * jsdom drops `touch-action` from styles: elements under test carry it in
105
- * `data-touch-action`, and computed style reports it from there.
106
- */
107
- function touchActionFromData(): () => void {
108
- const original = window.getComputedStyle.bind(window);
109
- const spy = vi
110
- .spyOn(window, 'getComputedStyle')
111
- .mockImplementation((element: Element, pseudo?: string | null) => {
112
- const style = original(element, pseudo);
113
- // The author's rule outranks the host's zero-specificity rule, which
114
- // applies where the author sets nothing.
115
- const touchAction =
116
- element.getAttribute('data-touch-action') ??
117
- element.getAttribute('data-astryx-touch-action');
118
- if (touchAction == null) {
119
- return style;
120
- }
121
- return new Proxy(style, {
122
- get(target, key): string | number | object | null | undefined {
123
- if (key === 'touchAction') {
124
- return touchAction;
125
- }
126
- if (key === 'getPropertyValue') {
127
- return (name: string) =>
128
- name === 'touch-action'
129
- ? touchAction
130
- : target.getPropertyValue(name);
131
- }
132
- const value = Reflect.get(target, key) as
133
- string | number | object | null | undefined;
134
- return typeof value === 'function' ? value.bind(target) : value;
135
- },
136
- });
137
- });
138
- return () => spy.mockRestore();
139
- }
140
-
141
- /** The host's touch-action rules in a document or shadow root. */
142
- function hostRules(root: Document | ShadowRoot): string {
143
- const adopted = (root.adoptedStyleSheets ?? []).flatMap(sheet =>
144
- [...sheet.cssRules].map(rule => rule.cssText),
145
- );
146
- const styles = [...root.querySelectorAll('style')].map(
147
- style => style.textContent ?? '',
148
- );
149
- return [...adopted, ...styles].join('\n');
150
- }
151
-
152
- function mount(html: string): Record<string, HTMLElement> {
153
- document.body.innerHTML = html;
154
- const elements: Record<string, HTMLElement> = {};
155
- for (const element of document.querySelectorAll<HTMLElement>('[id]')) {
156
- elements[element.id] = element;
157
- }
158
- return elements;
159
- }
160
-
161
- beforeEach(() => {
162
- clock = new ManualClock();
163
- host = new GestureHost(document, {clock, isPrimaryPointerCoarse: () => true});
164
- detachers = [];
165
- });
166
-
167
- afterEach(() => {
168
- for (const detach of detachers) {
169
- detach();
170
- }
171
- document.body.innerHTML = '';
172
- });
173
-
174
- describe('GestureHost', () => {
175
- it("measures a screen-edge pan's view, so an edge-zone strip takes the axis at UIKit's 15 px, not 10 (spec:AST-094 FR18)", () => {
176
- const {strip} = mount('<div id="strip"></div>');
177
- strip.getBoundingClientRect = () =>
178
- DOMRect.fromRect({x: 0, y: 0, width: 40, height: 800});
179
- const pan = new ScreenEdgePanGestureRecognizer({
180
- name: 'edge',
181
- edges: ['leading'],
182
- });
183
- detachers.push(host.attach(strip, pan));
184
- const down = {id: 1, x: 5, y: 300};
185
- touch('touchstart', strip, [down], [down], 0);
186
- const at14 = {...down, x: 19};
187
- touch('touchmove', strip, [at14], [at14], 16);
188
- expect(pan.state).toBe('possible');
189
- const at15 = {...down, x: 20};
190
- touch('touchmove', strip, [at15], [at15], 32);
191
- expect(pan.state).toBe('began');
192
- touch('touchend', strip, [at15], [], 48);
193
- });
194
-
195
- it("re-derives a screen-edge pan's touch-action when its box or the viewport resizes, with no listener of its own (spec:AST-094 FR19, FR24, DEC-22)", () => {
196
- // jsdom has no ResizeObserver: a stand-in the test drives.
197
- const observed = new Set<Element>();
198
- const callbacks: (() => void)[] = [];
199
- class StandInResizeObserver {
200
- constructor(callback: () => void) {
201
- callbacks.push(callback);
202
- }
203
- observe(target: Element): void {
204
- observed.add(target);
205
- }
206
- unobserve(target: Element): void {
207
- observed.delete(target);
208
- }
209
- disconnect(): void {
210
- observed.clear();
211
- }
212
- }
213
- const original = Object.getOwnPropertyDescriptor(window, 'ResizeObserver');
214
- const width = Object.getOwnPropertyDescriptor(window, 'innerWidth');
215
- Object.defineProperty(window, 'ResizeObserver', {
216
- configurable: true,
217
- value: StandInResizeObserver,
218
- });
219
- const listen = vi.spyOn(window, 'addEventListener');
220
- try {
221
- const {strip, trail} = mount(
222
- '<div id="strip"></div><div id="trail"></div>',
223
- );
224
- let stripWidth = 40;
225
- strip.getBoundingClientRect = () =>
226
- DOMRect.fromRect({x: 0, y: 0, width: stripWidth, height: 800});
227
- trail.getBoundingClientRect = () =>
228
- DOMRect.fromRect({x: 1004, y: 0, width: 20, height: 800});
229
- Object.defineProperty(window, 'innerWidth', {
230
- configurable: true,
231
- value: 1024,
232
- });
233
- const leading = new ScreenEdgePanGestureRecognizer({name: 'edge'});
234
- const detachStrip = host.attach(strip, leading);
235
- // A leading pan in LTR watches the left side: the viewport cannot move
236
- // its band, so only its own box is watched.
237
- expect(observed).toEqual(new Set([strip]));
238
- const trailing = new ScreenEdgePanGestureRecognizer({
239
- name: 'back',
240
- edges: ['trailing'],
241
- });
242
- const detachTrail = host.attach(trail, trailing);
243
- // The trailing pan's band moves with the viewport: the root is watched.
244
- expect(observed).toEqual(
245
- new Set([strip, trail, document.documentElement]),
246
- );
247
- expect(strip.getAttribute('data-astryx-touch-action')).toBe(
248
- 'pan-y pinch-zoom',
249
- );
250
- expect(trail.getAttribute('data-astryx-touch-action')).toBe(
251
- 'pan-y pinch-zoom',
252
- );
253
- // The strip grows past the band: its claim goes.
254
- stripWidth = 390;
255
- callbacks.forEach(callback => callback());
256
- expect(strip.hasAttribute('data-astryx-touch-action')).toBe(false);
257
- // The viewport widens, so the root resizes: the trailing strip no
258
- // longer sits at its edge.
259
- Object.defineProperty(window, 'innerWidth', {
260
- configurable: true,
261
- value: 1280,
262
- });
263
- callbacks.forEach(callback => callback());
264
- expect(trail.hasAttribute('data-astryx-touch-action')).toBe(false);
265
- // A disabled pan is not watched (FR24).
266
- trailing.setEnabled(false);
267
- expect(observed).toEqual(new Set([strip]));
268
- // Nothing is watched once the last edge pan lets go, and no listener
269
- // was ever added for a resize.
270
- detachStrip();
271
- detachTrail();
272
- expect(observed.size).toBe(0);
273
- expect(listen).not.toHaveBeenCalledWith(
274
- 'resize',
275
- expect.anything(),
276
- expect.anything(),
277
- );
278
- } finally {
279
- listen.mockRestore();
280
- if (original == null) {
281
- delete (window as {ResizeObserver?: unknown}).ResizeObserver;
282
- } else {
283
- Object.defineProperty(window, 'ResizeObserver', original);
284
- }
285
- if (width != null) {
286
- Object.defineProperty(window, 'innerWidth', width);
287
- }
288
- }
289
- });
290
-
291
- it('tells a recognizer tracking a finger about a second finger on plain page content, and leaves that finger to the page (spec:AST-094 FR28)', () => {
292
- const {box} = mount('<div id="box"></div><p id="page">text</p>');
293
- const page = document.getElementById('page')!;
294
- const elsewhere: number[] = [];
295
- class Recorder extends LongPressGestureRecognizer {
296
- protected override touchBeganElsewhere(
297
- touches: ReadonlyArray<GestureTouch>,
298
- ): void {
299
- elsewhere.push(...touches.map(t => t.id));
300
- }
301
- }
302
- const recorder = new Recorder({name: 'recorder'});
303
- detachers.push(host.attach(box, recorder));
304
- const first = {id: 1, x: 10, y: 10};
305
- touch('touchstart', box, [first], [first], 0);
306
- const second = {id: 2, x: 200, y: 300};
307
- const start = touch('touchstart', page, [second], [first, second], 20);
308
- expect(elsewhere).toHaveLength(1);
309
- expect(start.defaultPrevented).toBe(false);
310
- const moved = {...second, y: 340};
311
- const move = touch('touchmove', page, [moved], [first, moved], 36);
312
- expect(move.defaultPrevented).toBe(false);
313
- const end = touch('touchend', page, [moved], [first], 50);
314
- expect(end.defaultPrevented).toBe(false);
315
- touch('touchend', box, [first], [], 60);
316
- });
317
-
318
- it('leaves a finger on plain page content alone when no finger is being tracked', () => {
319
- const {box} = mount('<div id="box"></div><p id="page">text</p>');
320
- const page = document.getElementById('page')!;
321
- const elsewhere: number[] = [];
322
- class Recorder extends LongPressGestureRecognizer {
323
- protected override touchBeganElsewhere(
324
- touches: ReadonlyArray<GestureTouch>,
325
- ): void {
326
- elsewhere.push(...touches.map(t => t.id));
327
- }
328
- }
329
- detachers.push(host.attach(box, new Recorder({name: 'recorder'})));
330
- const finger = {id: 1, x: 200, y: 300};
331
- touch('touchstart', page, [finger], [finger], 0);
332
- touch('touchend', page, [finger], [], 30);
333
- expect(elsewhere).toEqual([]);
334
- });
335
-
336
- it("does not read a recognizer's own scroll write as the browser taking the finger (spec:AST-094 FR30)", async () => {
337
- const {list} = mount('<div id="list"><div id="row"></div></div>');
338
- scrollable(list, {scrollHeight: 1000, clientHeight: 200});
339
- const row = document.getElementById('row')!;
340
- // Tolerant enough to keep tracking a finger that has travelled the
341
- // press slop: only such a finger's touch can be the browser's pan.
342
- const press = new LongPressGestureRecognizer({
343
- name: 'press',
344
- allowableMovement: 100,
345
- });
346
- detachers.push(host.attach(row, press));
347
- const finger = {id: 1, x: 10, y: 10};
348
- touch('touchstart', row, [finger], [finger], 0);
349
- const moved = {...finger, y: 40};
350
- touch('touchmove', row, [moved], [moved], 16);
351
- host.ownScroll(list);
352
- list.dispatchEvent(new Event('scroll'));
353
- expect(press.numberOfTouches).toBe(1);
354
- // After the next frame, a scroll nobody announced is the browser's again.
355
- await new Promise(resolve =>
356
- requestAnimationFrame(() => requestAnimationFrame(resolve)),
357
- );
358
- await new Promise(resolve => requestAnimationFrame(resolve));
359
- list.dispatchEvent(new Event('scroll'));
360
- expect(press.numberOfTouches).toBe(0);
361
- });
362
-
363
- it('watches the pointer kind only while something is attached (spec:AST-094 FR24)', () => {
364
- const {box} = mount('<div id="box"></div>');
365
- const add = vi.fn();
366
- const remove = vi.fn();
367
- const matchMedia = window.matchMedia;
368
- window.matchMedia = ((query: string) => ({
369
- matches: false,
370
- media: query,
371
- addEventListener: add,
372
- removeEventListener: remove,
373
- })) as unknown as typeof window.matchMedia;
374
- try {
375
- const host2 = new GestureHost(document, {clock});
376
- expect(add).not.toHaveBeenCalled();
377
- const detach = host2.attach(box, new PanGestureRecognizer());
378
- expect(add).toHaveBeenCalledTimes(1);
379
- detach();
380
- expect(remove).toHaveBeenCalledWith('change', add.mock.calls[0][1]);
381
- } finally {
382
- window.matchMedia = matchMedia;
383
- }
384
- });
385
-
386
- it('sets touch-action for every pointer while a recognizer is enabled (spec:AST-094 FR18, FR43)', () => {
387
- const {box} = mount('<div id="box"></div>');
388
- const mark = () => box.getAttribute('data-astryx-touch-action');
389
- let coarse = false;
390
- const host2 = new GestureHost(document, {
391
- clock,
392
- isPrimaryPointerCoarse: () => coarse,
393
- });
394
- const pan = new PanGestureRecognizer({direction: 'horizontal'});
395
- const detach = host2.attach(box, pan);
396
- // A touchscreen laptop's finger gets it as a phone's does.
397
- expect(mark()).toBe('pan-y pinch-zoom');
398
- pan.setEnabled(false);
399
- expect(mark()).toBeNull();
400
- pan.setEnabled(true);
401
- expect(mark()).toBe('pan-y pinch-zoom');
402
- coarse = true;
403
- host2.update(box);
404
- expect(mark()).toBe('pan-y pinch-zoom');
405
- detach();
406
- expect(mark()).toBeNull();
407
- });
408
-
409
- it('registers no document listener for a disabled consumer until it is enabled (spec:AST-094 FR24)', () => {
410
- const {box} = mount('<div id="box"></div>');
411
- const added = vi.spyOn(document, 'addEventListener');
412
- const removed = vi.spyOn(document, 'removeEventListener');
413
- added.mockClear();
414
- removed.mockClear();
415
- const types = (spy: typeof added) =>
416
- spy.mock.calls
417
- .map(call => call[0])
418
- .filter(t => /^(touch|pointer)/.test(t));
419
- const coarse = new GestureHost(document, {
420
- clock,
421
- isPrimaryPointerCoarse: () => true,
422
- });
423
- let enabled = false;
424
- const consumer = new RecordingConsumer();
425
- Object.assign(consumer, {isEnabled: () => enabled});
426
- const detach = coarse.attachConsumer(box, consumer);
427
- expect(types(added)).toEqual([]);
428
- enabled = true;
429
- coarse.update(box);
430
- expect(types(added)).toContain('touchstart');
431
- enabled = false;
432
- coarse.update(box);
433
- expect(types(removed)).toContain('touchstart');
434
- detach();
435
- });
436
-
437
- it('registers no page listener while idle where the primary pointer is fine, or while nothing enabled is attached (spec:AST-094 FR24, FR43)', () => {
438
- const {box} = mount('<div id="box"></div>');
439
- const added = vi.spyOn(document, 'addEventListener');
440
- const removed = vi.spyOn(document, 'removeEventListener');
441
- added.mockClear();
442
- removed.mockClear();
443
- const types = (spy: typeof added) =>
444
- spy.mock.calls
445
- .map(call => call[0])
446
- .filter(t => /^(touch|pointer)/.test(t));
447
- // A fine primary pointer: the page has no listener; the element keeps
448
- // one passive pointerdown for its press and, as a claimer, its blocking
449
- // touchmove (FR19, a listener FR24 counts apart).
450
- const fine = new GestureHost(document, {
451
- clock,
452
- isPrimaryPointerCoarse: () => false,
453
- });
454
- const boxAdded = vi.spyOn(box, 'addEventListener');
455
- const detachFine = fine.attach(box, new PanGestureRecognizer());
456
- expect(types(added)).toEqual([]);
457
- expect(boxAdded.mock.calls.map(call => [call[0], call[2]])).toEqual([
458
- ['touchmove', {passive: false}],
459
- ['pointerdown', {capture: true, passive: true}],
460
- ]);
461
- detachFine();
462
- boxAdded.mockClear();
463
- // A coarse one, with only a disabled recognizer: nothing at all.
464
- const coarse = new GestureHost(document, {
465
- clock,
466
- isPrimaryPointerCoarse: () => true,
467
- });
468
- const pan = new PanGestureRecognizer({isEnabled: false});
469
- const detach = coarse.attach(box, pan);
470
- expect(types(added)).toEqual([]);
471
- expect(boxAdded).not.toHaveBeenCalled();
472
- // Enabling it registers the listeners; disabling removes them.
473
- pan.setEnabled(true);
474
- expect(types(added)).toContain('touchstart');
475
- expect(boxAdded).toHaveBeenCalledWith('touchmove', expect.any(Function), {
476
- passive: false,
477
- });
478
- pan.setEnabled(false);
479
- expect(types(removed)).toContain('touchstart');
480
- detach();
481
- });
482
-
483
- it('sets touch-action on attach and restores it on detach; the long-press styles wait for a held press', () => {
484
- // The author's value is read in the next frame (FR18): fake the frame.
485
- vi.useFakeTimers({toFake: ['setTimeout', 'requestAnimationFrame']});
486
- detachers.push(() => vi.useRealTimers());
487
- const {box} = mount('<div id="box" style="color: red"></div>');
488
- const set = vi.spyOn(box.style, 'setProperty');
489
- const remove = vi.spyOn(box.style, 'removeProperty');
490
- const detachPan = host.attach(
491
- box,
492
- new PanGestureRecognizer({direction: 'horizontal'}),
493
- );
494
- const detachPress = host.attach(box, new LongPressGestureRecognizer());
495
- vi.advanceTimersByTime(16);
496
- expect(set).toHaveBeenCalledWith('touch-action', 'pan-y pinch-zoom');
497
- expect(set).not.toHaveBeenCalledWith('-webkit-touch-callout', 'none');
498
- detachPress();
499
- detachPan();
500
- expect(remove).toHaveBeenCalledWith('touch-action');
501
- });
502
- it("writes a touch-action no wider than the caller's own", () => {
503
- vi.useFakeTimers({toFake: ['setTimeout', 'requestAnimationFrame']});
504
- const restore = touchActionFromData();
505
- try {
506
- const {trigger, strip} = mount(
507
- '<div id="trigger" data-touch-action="none"></div><div id="strip" data-touch-action="pan-y"></div>',
508
- );
509
- const set = vi.spyOn(trigger.style, 'setProperty');
510
- const setStrip = vi.spyOn(strip.style, 'setProperty');
511
- detachers.push(
512
- host.attach(trigger, new LongPressGestureRecognizer({name: 'hold'})),
513
- host.attach(
514
- strip,
515
- new PanGestureRecognizer({name: 'h', direction: 'horizontal'}),
516
- ),
517
- );
518
- vi.advanceTimersByTime(16);
519
- // manipulation (the hold's) with none, and pan-y pinch-zoom (the
520
- // pan's) with pan-y, allow the caller's own: its rule stays in force.
521
- expect(window.getComputedStyle(trigger).touchAction).toBe('none');
522
- expect(window.getComputedStyle(strip).touchAction).toBe('pan-y');
523
- expect(set).not.toHaveBeenCalledWith('touch-action', expect.anything());
524
- expect(setStrip).not.toHaveBeenCalledWith(
525
- 'touch-action',
526
- expect.anything(),
527
- );
528
- } finally {
529
- restore();
530
- vi.useRealTimers();
531
- }
532
- });
533
- it('marks an element with its derived touch-action as it attaches, under a rule any author rule outranks, with no inline write and no style read (spec:AST-094 FR18, DEC-8)', () => {
534
- const restore = touchActionFromData();
535
- try {
536
- const {box} = mount('<div id="box"></div>');
537
- const set = vi.spyOn(box.style, 'setProperty');
538
- const read = vi.mocked(window.getComputedStyle);
539
- read.mockClear();
540
- detachers.push(
541
- host.attach(box, new PanGestureRecognizer({direction: 'horizontal'})),
542
- );
543
- expect(box.getAttribute('data-astryx-touch-action')).toBe(
544
- 'pan-y pinch-zoom',
545
- );
546
- expect(hostRules(document)).toContain(
547
- ':where([data-astryx-touch-action="pan-y pinch-zoom"])',
548
- );
549
- expect(set).not.toHaveBeenCalledWith('touch-action', expect.anything());
550
- expect(read).not.toHaveBeenCalled();
551
- } finally {
552
- restore();
553
- }
554
- });
555
- it('leaves no touch-action rule in a document or shadow root once its last marked element lets go (spec:AST-094 FR24)', () => {
556
- const restore = touchActionFromData();
557
- try {
558
- const {box, other, outer} = mount(
559
- '<div id="box"></div><div id="other"></div><div id="outer"></div>',
560
- );
561
- const shadow = outer.attachShadow({mode: 'open'});
562
- shadow.innerHTML = '<div id="inner"></div>';
563
- const inner = shadow.getElementById('inner') as HTMLElement;
564
- const releaseBox = host.attach(
565
- box,
566
- new PanGestureRecognizer({direction: 'horizontal'}),
567
- );
568
- const releaseOther = host.attach(
569
- other,
570
- new PanGestureRecognizer({direction: 'vertical'}),
571
- );
572
- const releaseInner = host.attach(
573
- inner,
574
- new PanGestureRecognizer({direction: 'horizontal'}),
575
- );
576
- expect(hostRules(document)).toContain('data-astryx-touch-action');
577
- expect(hostRules(shadow)).toContain('data-astryx-touch-action');
578
- // One element still marked keeps its root's rules.
579
- releaseBox();
580
- expect(hostRules(document)).toContain('data-astryx-touch-action');
581
- releaseOther();
582
- expect(hostRules(document)).not.toContain('data-astryx-touch-action');
583
- releaseInner();
584
- expect(hostRules(shadow)).not.toContain('data-astryx-touch-action');
585
- // A later attach brings its rule back.
586
- detachers.push(
587
- host.attach(box, new PanGestureRecognizer({direction: 'horizontal'})),
588
- );
589
- expect(hostRules(document)).toContain(
590
- ':where([data-astryx-touch-action="pan-y pinch-zoom"])',
591
- );
592
- } finally {
593
- restore();
594
- }
595
- });
596
- it("keeps an author rule in force from the first frame, and writes the intersection inline only where it is narrower than the author's (spec:AST-094 FR18)", () => {
597
- vi.useFakeTimers({toFake: ['setTimeout', 'requestAnimationFrame']});
598
- const restore = touchActionFromData();
599
- try {
600
- const {both, strip} = mount(
601
- '<div id="both" data-touch-action="pan-x pan-y"></div><div id="strip" data-touch-action="pan-y"></div>',
602
- );
603
- const setBoth = vi.spyOn(both.style, 'setProperty');
604
- const setStrip = vi.spyOn(strip.style, 'setProperty');
605
- detachers.push(
606
- host.attach(both, new PanGestureRecognizer({direction: 'horizontal'})),
607
- host.attach(strip, new PanGestureRecognizer({direction: 'horizontal'})),
608
- );
609
- // Before the host reads anything, the author's value stands.
610
- expect(both.getAttribute('data-astryx-touch-action')).toBe(
611
- 'pan-y pinch-zoom',
612
- );
613
- expect(window.getComputedStyle(both).touchAction).toBe('pan-x pan-y');
614
- expect(setBoth).not.toHaveBeenCalledWith(
615
- 'touch-action',
616
- expect.anything(),
617
- );
618
- vi.advanceTimersByTime(16);
619
- // pan-y pinch-zoom with pan-x pan-y allows pan-y: narrower than the
620
- // author's, so it is written.
621
- expect(setBoth).toHaveBeenLastCalledWith('touch-action', 'pan-y');
622
- // With pan-y it is the author's own value: nothing to write.
623
- expect(setStrip).not.toHaveBeenCalledWith(
624
- 'touch-action',
625
- expect.anything(),
626
- );
627
- } finally {
628
- restore();
629
- vi.useRealTimers();
630
- }
631
- });
632
- for (const {keyword, resolved, make, written} of [
633
- {
634
- keyword: 'initial',
635
- resolved: 'auto',
636
- make: () => new TapGestureRecognizer({name: 'tap'}),
637
- written: 'manipulation',
638
- },
639
- {
640
- keyword: 'inherit',
641
- resolved: 'pan-y',
642
- make: () =>
643
- new PanGestureRecognizer({name: 'h', direction: 'horizontal'}),
644
- written: null,
645
- },
646
- ]) {
647
- it(`reads a caller's inline \`touch-action: ${keyword}\` as what it resolves to, never intersecting the keyword itself (spec:AST-094 FR18, DEC-8)`, () => {
648
- vi.useFakeTimers({toFake: ['setTimeout', 'requestAnimationFrame']});
649
- const restore = touchActionFromData();
650
- try {
651
- // jsdom keeps no touch-action: the inline keyword stands in through
652
- // getPropertyValue, and what it resolves to through computed style.
653
- const {box} = mount(
654
- `<div id="box" data-touch-action="${resolved}"></div>`,
655
- );
656
- vi.spyOn(box.style, 'getPropertyValue').mockImplementation(name =>
657
- name === 'touch-action' ? keyword : '',
658
- );
659
- const set = vi.spyOn(box.style, 'setProperty');
660
- detachers.push(host.attach(box, make()));
661
- // A keyword names no touch-action of its own: nothing is written
662
- // from it at once, and never none.
663
- expect(set).not.toHaveBeenCalledWith('touch-action', expect.anything());
664
- vi.advanceTimersByTime(16);
665
- expect(set).not.toHaveBeenCalledWith('touch-action', 'none');
666
- if (written == null) {
667
- // What the derived value allows of it is its own value: nothing
668
- // to narrow.
669
- expect(set).not.toHaveBeenCalledWith(
670
- 'touch-action',
671
- expect.anything(),
672
- );
673
- } else {
674
- expect(set).toHaveBeenLastCalledWith('touch-action', written);
675
- }
676
- } finally {
677
- restore();
678
- vi.useRealTimers();
679
- }
680
- });
681
- }
682
- it('removes the mark when the last recognizer detaches', () => {
683
- const {box} = mount('<div id="box"></div>');
684
- const detach = host.attach(
685
- box,
686
- new PanGestureRecognizer({direction: 'horizontal'}),
687
- );
688
- expect(box.hasAttribute('data-astryx-touch-action')).toBe(true);
689
- detach();
690
- expect(box.hasAttribute('data-astryx-touch-action')).toBe(false);
691
- });
692
- it('adds the rule to the shadow root an element is in', () => {
693
- const {box} = mount('<div id="box"></div>');
694
- const shadow = box.attachShadow({mode: 'open'});
695
- const inner = document.createElement('div');
696
- shadow.append(inner);
697
- detachers.push(host.attach(inner, new LongPressGestureRecognizer()));
698
- expect(inner.getAttribute('data-astryx-touch-action')).toBe('manipulation');
699
- expect(hostRules(shadow)).toContain(
700
- ':where([data-astryx-touch-action="manipulation"])',
701
- );
702
- });
703
- it("is never wider than the author's touch-action, at any frame (spec:AST-094 FR18, DEC-8)", () => {
704
- vi.useFakeTimers({toFake: ['setTimeout', 'requestAnimationFrame']});
705
- const restore = touchActionFromData();
706
- try {
707
- const {trigger} = mount(
708
- '<div id="trigger" data-touch-action="none"></div>',
709
- );
710
- const set = vi.spyOn(trigger.style, 'setProperty');
711
- detachers.push(
712
- host.attach(trigger, new LongPressGestureRecognizer({name: 'hold'})),
713
- );
714
- // The author's none outranks the host's manipulation from the attach
715
- // on, and the read finds nothing to narrow.
716
- expect(window.getComputedStyle(trigger).touchAction).toBe('none');
717
- vi.advanceTimersByTime(16);
718
- expect(window.getComputedStyle(trigger).touchAction).toBe('none');
719
- expect(set).not.toHaveBeenCalledWith('touch-action', expect.anything());
720
- } finally {
721
- restore();
722
- vi.useRealTimers();
723
- }
724
- });
725
- it('gives an element attached while on screen its touch-action in the attach itself', () => {
726
- const restore = touchActionFromData();
727
- try {
728
- const {box} = mount('<div id="box"></div>');
729
- detachers.push(host.attach(box, new TapGestureRecognizer({name: 'tap'})));
730
- expect(window.getComputedStyle(box).touchAction).toBe('manipulation');
731
- } finally {
732
- restore();
733
- }
734
- });
735
- it("reads no computed style while attaching: a caller's inline touch-action applies at once, a stylesheet's is read in the next frame", () => {
736
- vi.useFakeTimers({toFake: ['setTimeout', 'requestAnimationFrame']});
737
- const restore = touchActionFromData();
738
- try {
739
- const {trigger, strip} = mount(
740
- '<div id="trigger" data-touch-action="none"></div><div id="strip"></div>',
741
- );
742
- // jsdom keeps no touch-action in a style: this stands in for the
743
- // caller's inline `touch-action: pan-y`.
744
- vi.spyOn(strip.style, 'getPropertyValue').mockImplementation(name =>
745
- name === 'touch-action' ? 'pan-y' : '',
746
- );
747
- const set = vi.spyOn(trigger.style, 'setProperty');
748
- const setStrip = vi.spyOn(strip.style, 'setProperty');
749
- const read = vi.mocked(window.getComputedStyle);
750
- read.mockClear();
751
- detachers.push(
752
- host.attach(trigger, new LongPressGestureRecognizer({name: 'hold'})),
753
- host.attach(
754
- strip,
755
- new PanGestureRecognizer({name: 'h', direction: 'horizontal'}),
756
- ),
757
- );
758
- // Attaching forces no style recalc over whatever just mounted.
759
- expect(read).not.toHaveBeenCalled();
760
- // The caller's inline value: pan-y pinch-zoom ∩ pan-y, at once.
761
- expect(setStrip).toHaveBeenLastCalledWith('touch-action', 'pan-y');
762
- // A stylesheet's value: read once in the next frame, where none is
763
- // already no wider than both allow.
764
- vi.advanceTimersByTime(16);
765
- expect(read).toHaveBeenCalledTimes(1);
766
- expect(set).not.toHaveBeenCalledWith('touch-action', expect.anything());
767
- } finally {
768
- restore();
769
- vi.useRealTimers();
770
- }
771
- });
772
-
773
- it('turns selection and the callout off for one held press, only where the hold does something (spec:AST-094 FR41)', () => {
774
- const {hold, plain} = mount(
775
- '<div><div id="hold"></div><div id="plain"></div></div>',
776
- );
777
- detachers.push(host.attach(hold, new LongPressGestureRecognizer()));
778
- detachers.push(host.attach(plain, new TapGestureRecognizer()));
779
- // jsdom drops the prefixed properties, so the writes are observed.
780
- const set = vi.spyOn(hold.style, 'setProperty');
781
- const remove = vi.spyOn(hold.style, 'removeProperty');
782
- const plainSet = vi.spyOn(plain.style, 'setProperty');
783
- const finger = {id: 1, x: 10, y: 10};
784
- touch('touchstart', hold, [finger], [finger], 0);
785
- expect(set).toHaveBeenCalledWith('-webkit-touch-callout', 'none');
786
- expect(set).toHaveBeenCalledWith('user-select', 'none');
787
- expect(remove).not.toHaveBeenCalledWith('user-select');
788
- touch('touchend', hold, [finger], [], 100);
789
- expect(remove).toHaveBeenCalledWith('-webkit-touch-callout');
790
- expect(remove).toHaveBeenCalledWith('user-select');
791
- const other = {id: 2, x: 10, y: 40};
792
- touch('touchstart', plain, [other], [other], 200);
793
- expect(plainSet).not.toHaveBeenCalledWith('user-select', 'none');
794
- touch('touchend', plain, [other], [], 260);
795
- });
796
-
797
- it('leaves selection and the callout alone on an element attached with manageStyle: false, whose styles the caller keeps', () => {
798
- const {hold} = mount('<div id="hold"></div>');
799
- detachers.push(
800
- host.attach(hold, new LongPressGestureRecognizer(), {manageStyle: false}),
801
- );
802
- const set = vi.spyOn(hold.style, 'setProperty');
803
- const remove = vi.spyOn(hold.style, 'removeProperty');
804
- const finger = {id: 1, x: 10, y: 10};
805
- touch('touchstart', hold, [finger], [finger], 0);
806
- touch('touchend', hold, [finger], [], 100);
807
- expect(set).not.toHaveBeenCalled();
808
- expect(remove).not.toHaveBeenCalled();
809
- });
810
-
811
- it('cancels touchmove only once a recognizer owns the touch, and swallows the click', () => {
812
- const {box, child} = mount('<div id="box"><span id="child">x</span></div>');
813
- const pan = new PanGestureRecognizer({name: 'pan'});
814
- const states: string[] = [];
815
- pan.addListener(r => states.push(r.state));
816
- detachers.push(host.attach(box, pan));
817
- const finger = {id: 7, x: 10, y: 10};
818
- touch('touchstart', child, [finger], [finger], 0);
819
- const early = touch(
820
- 'touchmove',
821
- child,
822
- [{...finger, x: 15}],
823
- [{...finger, x: 15}],
824
- 16,
825
- );
826
- expect(early.defaultPrevented).toBe(false);
827
- expect(pan.state).toBe('possible');
828
- const claimed = touch(
829
- 'touchmove',
830
- child,
831
- [{...finger, x: 30}],
832
- [{...finger, x: 30}],
833
- 32,
834
- );
835
- expect(claimed.defaultPrevented).toBe(true);
836
- expect(states).toEqual(['began']);
837
- const end = touch('touchend', child, [{...finger, x: 30}], [], 48);
838
- expect(end.defaultPrevented).toBe(true);
839
- expect(states).toEqual(['began', 'ended']);
840
- });
841
-
842
- it('leaves the touchend (and the click) alone when nothing claimed the touch', () => {
843
- const {box} = mount('<div id="box"></div>');
844
- const pan = new PanGestureRecognizer({name: 'pan'});
845
- detachers.push(host.attach(box, pan));
846
- const finger = {id: 1, x: 10, y: 10};
847
- touch('touchstart', box, [finger], [finger], 0);
848
- touch('touchmove', box, [{...finger, x: 13}], [{...finger, x: 13}], 16);
849
- const end = touch('touchend', box, [{...finger, x: 13}], [], 40);
850
- expect(end.defaultPrevented).toBe(false);
851
- });
852
-
853
- it('leaves a second finger no recognizer owns to the page while the claimed one is held (spec:AST-094 FR19)', () => {
854
- const {box} = mount('<div id="box"></div>');
855
- const pan = new PanGestureRecognizer({maximumNumberOfTouches: 1});
856
- detachers.push(host.attach(box, pan));
857
- const first = {id: 1, x: 10, y: 10};
858
- touch('touchstart', box, [first], [first], 0);
859
- const moved = {...first, x: 40};
860
- touch('touchmove', box, [moved], [moved], 16);
861
- const second = {id: 2, x: 200, y: 200};
862
- touch('touchstart', box, [second], [moved, second], 20);
863
- const pinchLike = touch(
864
- 'touchmove',
865
- box,
866
- [{...second, x: 260}],
867
- [moved, {...second, x: 260}],
868
- 32,
869
- );
870
- expect(pinchLike.defaultPrevented).toBe(false);
871
- expect(pan.state).toBe('began');
872
- expect(pan.numberOfTouches).toBe(1);
873
- // The claimed finger's own moves stay cancelled.
874
- const own = touch(
875
- 'touchmove',
876
- box,
877
- [{...moved, x: 60}],
878
- [
879
- {...moved, x: 60},
880
- {...second, x: 260},
881
- ],
882
- 48,
883
- );
884
- expect(own.defaultPrevented).toBe(true);
885
- });
886
-
887
- it('reads pointercancel on a finger as the browser taking it', () => {
888
- const {box} = mount('<div id="box"></div>');
889
- const pan = new PanGestureRecognizer({name: 'pan'});
890
- const view = new RecordingConsumer();
891
- const events: string[] = [];
892
- detachers.push(host.attach(box, pan), host.attachConsumer(box, view));
893
- pan.addTransitionListener((_r, _from, to) => events.push(to));
894
- const finger = {id: 3, x: 10, y: 10};
895
- touch('touchstart', box, [finger], [finger], 0);
896
- pointer('pointercancel', box, {
897
- id: 99,
898
- pointerType: 'touch',
899
- x: 10,
900
- y: 14,
901
- time: 20,
902
- });
903
- expect(events).toEqual(['failed', 'possible']);
904
- // The view's touch is cancelled, with no release.
905
- expect(view.events.map(event => event.split(':')[0])).toEqual([
906
- 'began',
907
- 'cancelled',
908
- ]);
909
- });
910
-
911
- it("pairs a finger's pointer with its touch: pointermoves inside the browser's touchmove slop count", () => {
912
- const {box} = mount('<div id="box"></div>');
913
- const pan = new PanGestureRecognizer({name: 'pan'});
914
- const states: string[] = [];
915
- pan.addListener(r => states.push(`${r.state}:${r.translation().x}`));
916
- detachers.push(host.attach(box, pan));
917
- // Chromium's order: pointerdown, then touchstart, at the same spot.
918
- pointer('pointerdown', box, {
919
- id: 21,
920
- pointerType: 'touch',
921
- x: 10,
922
- y: 10,
923
- buttons: 1,
924
- time: 0,
925
- });
926
- const finger = {id: 0, x: 10, y: 10};
927
- touch('touchstart', box, [finger], [finger], 0);
928
- // No touchmove yet (inside the slop), but the pointer moved 12 px.
929
- pointer('pointermove', box, {
930
- id: 21,
931
- pointerType: 'touch',
932
- x: 16,
933
- y: 10,
934
- buttons: 1,
935
- time: 16,
936
- });
937
- pointer('pointermove', box, {
938
- id: 21,
939
- pointerType: 'touch',
940
- x: 22,
941
- y: 10,
942
- buttons: 1,
943
- time: 32,
944
- });
945
- // Translation 2: the 10 px hysteresis is left out, as in UIKit.
946
- expect(states).toEqual(['began:2']);
947
- // The first touchmove (the same input as a pointermove) is cancelled
948
- // and not read twice.
949
- pointer('pointermove', box, {
950
- id: 21,
951
- pointerType: 'touch',
952
- x: 26,
953
- y: 10,
954
- buttons: 1,
955
- time: 48,
956
- });
957
- const first = touch(
958
- 'touchmove',
959
- box,
960
- [{...finger, x: 26}],
961
- [{...finger, x: 26}],
962
- 48,
963
- );
964
- expect(first.defaultPrevented).toBe(true);
965
- expect(states).toEqual(['began:2', 'changed:6']);
966
- // pointercancel names the finger exactly, whatever its coordinates say.
967
- pointer('pointercancel', box, {
968
- id: 21,
969
- pointerType: 'touch',
970
- x: 0,
971
- y: 0,
972
- time: 60,
973
- });
974
- expect(host.arena.getTouch(1)?.takenByBrowser).toBe(true);
975
- });
976
-
977
- it("gives a finger's target a passive touchmove listener unless a recognizer on that touch can claim while it moves (spec:AST-094 FR19)", () => {
978
- const {taps, pan} = mount(
979
- '<div id="taps"><span id="tapChild">t</span></div><div id="pan"><span id="panChild">p</span></div>',
980
- );
981
- detachers.push(host.attach(taps, new TapGestureRecognizer({name: 'tap'})));
982
- detachers.push(host.attach(pan, new PanGestureRecognizer({name: 'pan'})));
983
- const moveListenerFlags = (element: Element) => {
984
- const added = vi.spyOn(element, 'addEventListener');
985
- return () =>
986
- added.mock.calls
987
- .filter(([type]) => type === 'touchmove')
988
- .map(([, , options]) => (options as AddEventListenerOptions).passive);
989
- };
990
- const tapChild = taps.querySelector('#tapChild')!;
991
- const panChild = pan.querySelector('#panChild')!;
992
- const onTapChild = moveListenerFlags(tapChild);
993
- const onPanChild = moveListenerFlags(panChild);
994
- const tapFinger = {id: 1, x: 10, y: 10};
995
- touch('touchstart', tapChild, [tapFinger], [tapFinger], 0);
996
- const panFinger = {id: 2, x: 10, y: 10};
997
- touch('touchstart', panChild, [panFinger], [tapFinger, panFinger], 0);
998
- expect(onTapChild()).toEqual([true]);
999
- expect(onPanChild()).toEqual([false]);
1000
- touch('touchend', tapChild, [tapFinger], [panFinger], 20);
1001
- touch('touchend', panChild, [panFinger], [], 20);
1002
- });
1003
-
1004
- it('gives the blocking touchmove listener only to elements whose recognizers claim while moving', () => {
1005
- const {taps, pan, press, both, row} = mount(
1006
- '<div id="taps"></div><div id="pan"></div><div id="press"></div><div id="both"></div><div id="row"></div>',
1007
- );
1008
- const blocking = (element: HTMLElement) => {
1009
- const added = vi.spyOn(element, 'addEventListener');
1010
- const removed = vi.spyOn(element, 'removeEventListener');
1011
- return {
1012
- added: () =>
1013
- added.mock.calls.filter(([type, , options]) => {
1014
- const flags = options as AddEventListenerOptions | undefined;
1015
- return type === 'touchmove' && flags?.passive === false;
1016
- }).length,
1017
- removed: () =>
1018
- removed.mock.calls.filter(([type]) => type === 'touchmove').length,
1019
- };
1020
- };
1021
- // Taps claim only at the lift: a scroll starting on them never waits.
1022
- const onTaps = blocking(taps);
1023
- detachers.push(host.attach(taps, new TapGestureRecognizer({name: 'tap'})));
1024
- detachers.push(
1025
- host.attach(
1026
- taps,
1027
- new TapGestureRecognizer({name: 'double', numberOfTapsRequired: 2}),
1028
- ),
1029
- );
1030
- expect(onTaps.added()).toBe(0);
1031
- // A press consumer adds none either.
1032
- const onRow = blocking(row);
1033
- detachers.push(host.attachConsumer(row, new RecordingConsumer()));
1034
- expect(onRow.added()).toBe(0);
1035
- // A pan and a long press can take a moving touch: they get one.
1036
- const onPan = blocking(pan);
1037
- detachers.push(host.attach(pan, new PanGestureRecognizer({name: 'pan'})));
1038
- expect(onPan.added()).toBe(1);
1039
- const onPress = blocking(press);
1040
- detachers.push(
1041
- host.attach(press, new LongPressGestureRecognizer({name: 'press'})),
1042
- );
1043
- expect(onPress.added()).toBe(1);
1044
- // A tap beside a pan: the listener comes with the pan and leaves with it.
1045
- const onBoth = blocking(both);
1046
- detachers.push(host.attach(both, new TapGestureRecognizer({name: 'tap2'})));
1047
- expect(onBoth.added()).toBe(0);
1048
- const detachPan = host.attach(
1049
- both,
1050
- new PanGestureRecognizer({name: 'pan2', direction: 'horizontal'}),
1051
- );
1052
- expect(onBoth.added()).toBe(1);
1053
- detachPan();
1054
- expect(onBoth.removed()).toBe(1);
1055
- });
1056
-
1057
- it("leaves a one-way pan's touch to the page until the pan begins (spec:AST-094 FR19)", () => {
1058
- const {card} = mount('<div id="card"></div>');
1059
- const pan = new PanGestureRecognizer({name: 'pan', direction: 'up'});
1060
- detachers.push(host.attach(card, pan));
1061
- const finger = {id: 1, x: 50, y: 100};
1062
- touch('touchstart', card, [finger], [finger], 0);
1063
- const at = (y: number, time: number) =>
1064
- touch('touchmove', card, [{...finger, y}], [{...finger, y}], time);
1065
- expect(at(97, 16).defaultPrevented).toBe(false);
1066
- expect(at(95, 32).defaultPrevented).toBe(false);
1067
- expect(pan.state).toBe('possible');
1068
- expect(at(88, 48).defaultPrevented).toBe(true);
1069
- expect(pan.state).toBe('began');
1070
- touch('touchend', card, [{...finger, y: 88}], [], 64);
1071
- });
1072
-
1073
- it('leaves a scroll-edge pan to claim at its begin', () => {
1074
- const {sheet} = mount('<div id="sheet"></div>');
1075
- const pan = new PanGestureRecognizer({
1076
- name: 'sheet',
1077
- direction: 'down',
1078
- scrollEdge: true,
1079
- });
1080
- detachers.push(host.attach(sheet, pan));
1081
- const finger = {id: 1, x: 50, y: 100};
1082
- touch('touchstart', sheet, [finger], [finger], 0);
1083
- const at = (y: number, time: number) =>
1084
- touch('touchmove', sheet, [{...finger, y}], [{...finger, y}], time);
1085
- expect(at(107, 16).defaultPrevented).toBe(false);
1086
- expect(at(112, 32).defaultPrevented).toBe(true);
1087
- expect(pan.state).toBe('began');
1088
- touch('touchend', sheet, [{...finger, y: 112}], [], 48);
1089
- });
1090
-
1091
- it('names the pointer a finger, a pen or a mouse is driven by', () => {
1092
- const {box} = mount('<div id="box"></div>');
1093
- const press = new LongPressGestureRecognizer({name: 'press'});
1094
- detachers.push(host.attach(box, press));
1095
- // A finger: its pointerdown pairs with its touchstart.
1096
- pointer('pointerdown', box, {
1097
- id: 31,
1098
- pointerType: 'touch',
1099
- x: 10,
1100
- y: 10,
1101
- buttons: 1,
1102
- time: 0,
1103
- });
1104
- const finger = {id: 0, x: 10, y: 10};
1105
- touch('touchstart', box, [finger], [finger], 0);
1106
- const [held] = press.trackedTouches;
1107
- expect(host.pointerIdOf(held)).toBe(31);
1108
- expect(host.pointerIdOf(held.id)).toBe(31);
1109
- touch('touchend', box, [finger], [], 40);
1110
- // A pen is its own pointer.
1111
- pointer('pointerdown', box, {
1112
- id: 7,
1113
- pointerType: 'pen',
1114
- x: 10,
1115
- y: 10,
1116
- buttons: 1,
1117
- time: 100,
1118
- });
1119
- const [pen] = press.trackedTouches;
1120
- expect(host.pointerIdOf(pen)).toBe(7);
1121
- pointer('pointerup', box, {
1122
- id: 7,
1123
- pointerType: 'pen',
1124
- x: 10,
1125
- y: 10,
1126
- time: 140,
1127
- });
1128
- expect(host.pointerIdOf(pen)).toBeNull();
1129
- });
1130
-
1131
- it('reads a touchmove that can no longer be cancelled as the browser taking it, where it could pan', () => {
1132
- const {list, box} = mount(
1133
- '<div id="list" style="overflow-y: auto"><div id="box"></div></div>',
1134
- );
1135
- scrollable(list, {scrollTop: 0, scrollHeight: 1000, clientHeight: 400});
1136
- const tap = new TapGestureRecognizer({name: 'tap'});
1137
- const events: string[] = [];
1138
- tap.addTransitionListener((_r, _from, to) => events.push(to));
1139
- detachers.push(host.attach(box, tap));
1140
- const finger = {id: 1, x: 10, y: 30};
1141
- touch('touchstart', box, [finger], [finger], 0);
1142
- touch(
1143
- 'touchmove',
1144
- box,
1145
- [{...finger, y: 14}],
1146
- [{...finger, y: 14}],
1147
- 16,
1148
- false,
1149
- );
1150
- expect(events).toEqual(['failed', 'possible']);
1151
- });
1152
-
1153
- it('keeps a horizontal drag under pan-y when Chromium stops asking after one unconsumed move', () => {
1154
- const restore = touchActionFromData();
1155
- try {
1156
- const {list, row} = mount(
1157
- '<div id="list" style="overflow-y: auto"><div id="row" data-touch-action="pan-y pinch-zoom"></div></div>',
1158
- );
1159
- scrollable(list, {scrollTop: 0, scrollHeight: 1000, clientHeight: 400});
1160
- const consumer = new RecordingConsumer();
1161
- detachers.push(host.attachConsumer(row, consumer));
1162
- const finger = {id: 1, x: 100, y: 30};
1163
- touch('touchstart', row, [finger], [finger], 0);
1164
- // The first move goes unconsumed; Chromium sends the rest uncancelable
1165
- // although pan-y keeps it from panning sideways.
1166
- touch('touchmove', row, [{...finger, x: 120}], [{...finger, x: 120}], 16);
1167
- touch(
1168
- 'touchmove',
1169
- row,
1170
- [{...finger, x: 140, y: 33}],
1171
- [{...finger, x: 140, y: 33}],
1172
- 32,
1173
- false,
1174
- );
1175
- touch(
1176
- 'touchmove',
1177
- row,
1178
- [{...finger, x: 160, y: 35}],
1179
- [{...finger, x: 160, y: 35}],
1180
- 48,
1181
- false,
1182
- );
1183
- expect(consumer.events).toEqual([
1184
- 'began:1',
1185
- 'moved:1',
1186
- 'moved:1',
1187
- 'moved:1',
1188
- ]);
1189
- } finally {
1190
- restore();
1191
- }
1192
- });
1193
-
1194
- it('keeps a vertical drag under pan-x when Chromium stops asking after one unconsumed move', () => {
1195
- // The case above turned 90°: a row of a sideways list, dragged down.
1196
- const restore = touchActionFromData();
1197
- try {
1198
- const {list, row} = mount(
1199
- '<div id="list" style="overflow-x: auto"><div id="row" data-touch-action="pan-x pinch-zoom"></div></div>',
1200
- );
1201
- scrollable(list, {scrollLeft: 0, scrollWidth: 1000, clientWidth: 400});
1202
- const consumer = new RecordingConsumer();
1203
- detachers.push(host.attachConsumer(row, consumer));
1204
- const finger = {id: 1, x: 30, y: 100};
1205
- touch('touchstart', row, [finger], [finger], 0);
1206
- // The first move goes unconsumed; Chromium sends the rest uncancelable
1207
- // although pan-x keeps it from panning vertically.
1208
- touch('touchmove', row, [{...finger, y: 120}], [{...finger, y: 120}], 16);
1209
- touch(
1210
- 'touchmove',
1211
- row,
1212
- [{...finger, x: 33, y: 140}],
1213
- [{...finger, x: 33, y: 140}],
1214
- 32,
1215
- false,
1216
- );
1217
- touch(
1218
- 'touchmove',
1219
- row,
1220
- [{...finger, x: 35, y: 160}],
1221
- [{...finger, x: 35, y: 160}],
1222
- 48,
1223
- false,
1224
- );
1225
- expect(consumer.events).toEqual([
1226
- 'began:1',
1227
- 'moved:1',
1228
- 'moved:1',
1229
- 'moved:1',
1230
- ]);
1231
- } finally {
1232
- restore();
1233
- }
1234
- });
1235
-
1236
- it("judges only the first uncancelable move: a sideways drag that turns vertical stays the page's", () => {
1237
- const restore = touchActionFromData();
1238
- try {
1239
- const {list, row} = mount(
1240
- '<div id="list" style="overflow-y: auto"><div id="row" data-touch-action="pan-y pinch-zoom"></div></div>',
1241
- );
1242
- scrollable(list, {scrollTop: 0, scrollHeight: 1000, clientHeight: 400});
1243
- const consumer = new RecordingConsumer();
1244
- detachers.push(host.attachConsumer(row, consumer));
1245
- const finger = {id: 1, x: 100, y: 100};
1246
- touch('touchstart', row, [finger], [finger], 0);
1247
- touch('touchmove', row, [{...finger, x: 120}], [{...finger, x: 120}], 16);
1248
- touch(
1249
- 'touchmove',
1250
- row,
1251
- [{...finger, x: 130, y: 98}],
1252
- [{...finger, x: 130, y: 98}],
1253
- 32,
1254
- false,
1255
- );
1256
- // Chromium dropped the scroll when it began sideways; the finger
1257
- // turning upward later does not make it a pan.
1258
- touch(
1259
- 'touchmove',
1260
- row,
1261
- [{...finger, x: 132, y: 40}],
1262
- [{...finger, x: 132, y: 40}],
1263
- 48,
1264
- false,
1265
- );
1266
- expect(
1267
- consumer.events.filter(event => event.startsWith('cancelled')),
1268
- ).toEqual([]);
1269
- expect(consumer.events.at(-1)).toBe('moved:1');
1270
- } finally {
1271
- restore();
1272
- }
1273
- });
1274
-
1275
- it('reads a scroll above an unclaimed touch that has travelled as the browser taking it (spec:AST-094 FR20)', () => {
1276
- const {list, row} = mount('<div id="list"><div id="row"></div></div>');
1277
- const tap = new TapGestureRecognizer({name: 'tap'});
1278
- detachers.push(host.attach(row, tap));
1279
- const finger = {id: 1, x: 10, y: 10};
1280
- touch('touchstart', row, [finger], [finger], 0);
1281
- const moved = {...finger, y: 20};
1282
- touch('touchmove', row, [moved], [moved], 16);
1283
- list.dispatchEvent(new Event('scroll'));
1284
- expect(tap.state).toBe('possible');
1285
- expect(tap.numberOfTouches).toBe(0);
1286
- });
1287
-
1288
- it('lets a scroll take an unclaimed touch from 10 px of travel, straight or diagonal, and not before (spec:AST-094 FR20)', () => {
1289
- const takenAfter = (dx: number, dy: number) => {
1290
- const {list, row} = mount('<div id="list"><div id="row"></div></div>');
1291
- const consumer = new RecordingConsumer();
1292
- const detach = host.attachConsumer(row, consumer);
1293
- const finger = {id: 1, x: 10, y: 10};
1294
- touch('touchstart', row, [finger], [finger], 0);
1295
- const moved = {...finger, x: 10 + dx, y: 10 + dy};
1296
- touch('touchmove', row, [moved], [moved], 16);
1297
- list.dispatchEvent(new Event('scroll'));
1298
- const taken = consumer.events.some(event =>
1299
- event.startsWith('cancelled'),
1300
- );
1301
- touch('touchend', row, [moved], [], 32);
1302
- detach();
1303
- return taken;
1304
- };
1305
- // A still finger: the scroll is the page's own (anchoring, a carousel).
1306
- expect(takenAfter(0, 0)).toBe(false);
1307
- expect(takenAfter(0, 9)).toBe(false);
1308
- expect(takenAfter(0, 10)).toBe(true);
1309
- // 9.9 px and 11.3 px from where it landed.
1310
- expect(takenAfter(7, 7)).toBe(false);
1311
- expect(takenAfter(8, 8)).toBe(true);
1312
- });
1313
-
1314
- it('drives mouse input through Pointer Events', () => {
1315
- const {box} = mount('<div id="box"></div>');
1316
- const pan = new PanGestureRecognizer({name: 'pan'});
1317
- let released = {x: 0, y: 0};
1318
- pan.addListener(r => {
1319
- if (r.state === 'ended') {
1320
- released = r.velocity();
1321
- }
1322
- });
1323
- detachers.push(host.attach(box, pan));
1324
- pointer('pointerdown', box, {
1325
- pointerType: 'mouse',
1326
- x: 0,
1327
- y: 0,
1328
- buttons: 1,
1329
- time: 0,
1330
- });
1331
- for (let t = 8; t <= 96; t += 8) {
1332
- pointer('pointermove', box, {
1333
- pointerType: 'mouse',
1334
- x: t * 2,
1335
- y: 0,
1336
- buttons: 1,
1337
- time: t,
1338
- });
1339
- }
1340
- pointer('pointerup', box, {pointerType: 'mouse', x: 192, y: 0, time: 104});
1341
- expect(pan.state).toBe('possible');
1342
- expect(released.x).toBeCloseTo(2000, 0);
1343
- });
1344
-
1345
- it('cancels the context menu while a long press owns the touch', () => {
1346
- const {box} = mount('<div id="box"></div>');
1347
- const press = new LongPressGestureRecognizer({name: 'press'});
1348
- detachers.push(host.attach(box, press));
1349
- const finger = {id: 1, x: 10, y: 10};
1350
- touch('touchstart', box, [finger], [finger], 0);
1351
- const before = new MouseEvent('contextmenu', {
1352
- bubbles: true,
1353
- cancelable: true,
1354
- });
1355
- box.dispatchEvent(before);
1356
- expect(before.defaultPrevented).toBe(false);
1357
- host.arena.advanceTime(500);
1358
- expect(press.state).toBe('began');
1359
- const during = new MouseEvent('contextmenu', {
1360
- bubbles: true,
1361
- cancelable: true,
1362
- });
1363
- box.dispatchEvent(during);
1364
- expect(during.defaultPrevented).toBe(true);
1365
- });
1366
-
1367
- it('holds the click of a tap a double tap may claim, and replays it when the double tap fails', () => {
1368
- const {row, button} = mount(
1369
- '<div id="row"><button id="button">Go</button></div>',
1370
- );
1371
- const double = new TapGestureRecognizer({
1372
- name: 'double',
1373
- numberOfTapsRequired: 2,
1374
- });
1375
- detachers.push(host.attach(row, double));
1376
- const clicks: {target: EventTarget | null; detail: number}[] = [];
1377
- button.addEventListener('click', event =>
1378
- clicks.push({target: event.target, detail: event.detail}),
1379
- );
1380
- const finger = {id: 1, x: 10, y: 10};
1381
- touch('touchstart', button, [finger], [finger], 0);
1382
- const end = touch('touchend', button, [finger], [], 60);
1383
- expect(end.defaultPrevented).toBe(true);
1384
- expect(clicks).toEqual([]);
1385
- const interval = UIKIT_GESTURES.tap.maximumIntervalBetweenTaps.value;
1386
- host.arena.advanceTime(60 + interval);
1387
- expect(clicks).toEqual([{target: button, detail: 1}]);
1388
- });
1389
-
1390
- it('collects recognizers across shadow roots', () => {
1391
- const {outer} = mount('<div id="outer"></div>');
1392
- const shadow = outer.attachShadow({mode: 'open'});
1393
- shadow.innerHTML = '<span id="inner">x</span>';
1394
- const inner = shadow.getElementById('inner') as HTMLElement;
1395
- const tap = new TapGestureRecognizer({name: 'tap'});
1396
- const actions: string[] = [];
1397
- tap.addListener(r => actions.push(r.state));
1398
- detachers.push(host.attach(outer, tap));
1399
- const finger = {id: 1, x: 5, y: 5, target: inner};
1400
- touch('touchstart', inner, [finger], [finger], 0);
1401
- touch('touchend', inner, [finger], [], 50);
1402
- expect(actions).toEqual(['ended']);
1403
- });
1404
-
1405
- it('cancels every touch in flight when the window loses focus', () => {
1406
- const {box} = mount('<div id="box"></div>');
1407
- const pan = new PanGestureRecognizer({name: 'pan'});
1408
- const states: string[] = [];
1409
- pan.addListener(r => states.push(r.state));
1410
- detachers.push(host.attach(box, pan));
1411
- const finger = {id: 1, x: 10, y: 10};
1412
- touch('touchstart', box, [finger], [finger], 0);
1413
- touch('touchmove', box, [{...finger, x: 40}], [{...finger, x: 40}], 16);
1414
- window.dispatchEvent(new Event('blur'));
1415
- expect(states).toEqual(['began', 'cancelled']);
1416
- });
1417
-
1418
- it('finishes a gesture whose target left the document mid-gesture', () => {
1419
- const {box, child} = mount('<div id="box"><span id="child">x</span></div>');
1420
- const pan = new PanGestureRecognizer({name: 'pan'});
1421
- const states: string[] = [];
1422
- pan.addListener(r => states.push(r.state));
1423
- detachers.push(host.attach(box, pan));
1424
- const finger = {id: 1, x: 10, y: 10};
1425
- touch('touchstart', child, [finger], [finger], 0);
1426
- touch('touchmove', child, [{...finger, x: 40}], [{...finger, x: 40}], 16);
1427
- // A re-render replaces the span: its events no longer reach the document.
1428
- child.remove();
1429
- const move = touch(
1430
- 'touchmove',
1431
- child,
1432
- [{...finger, x: 60}],
1433
- [{...finger, x: 60}],
1434
- 32,
1435
- );
1436
- expect(move.defaultPrevented).toBe(true);
1437
- touch('touchend', child, [{...finger, x: 60}], [], 48);
1438
- // The move and the lift after the removal still reached the pan.
1439
- expect(states).toEqual(['began', 'changed', 'ended']);
1440
- expect(host.arena.touches).toEqual([]);
1441
- });
1442
-
1443
- it('cancels a finger the events say is no longer down', () => {
1444
- const {box} = mount('<div id="box"></div>');
1445
- const pan = new PanGestureRecognizer({name: 'pan'});
1446
- const states: string[] = [];
1447
- pan.addListener(r => states.push(r.state));
1448
- detachers.push(host.attach(box, pan));
1449
- const first = {id: 1, x: 10, y: 10};
1450
- touch('touchstart', box, [first], [first], 0);
1451
- touch('touchmove', box, [{...first, x: 40}], [{...first, x: 40}], 16);
1452
- // Its touchend went to a node outside the document; the next event for
1453
- // another finger no longer lists it.
1454
- const other = {id: 2, x: 300, y: 300};
1455
- touch('touchmove', document.body, [other], [other], 32);
1456
- expect(states).toEqual(['began', 'cancelled']);
1457
- });
1458
-
1459
- it('treats a reused finger number as a new touch', () => {
1460
- const {box} = mount('<div id="box"></div>');
1461
- const tap = new TapGestureRecognizer({name: 'tap'});
1462
- const states: string[] = [];
1463
- tap.addListener(r => states.push(r.state));
1464
- detachers.push(host.attach(box, tap));
1465
- const finger = {id: 4, x: 10, y: 10};
1466
- touch('touchstart', box, [finger], [finger], 0);
1467
- // No touchend reached us; the same identifier lands again.
1468
- touch('touchstart', box, [finger], [finger], 500);
1469
- touch('touchend', box, [finger], [], 560);
1470
- expect(states).toEqual(['ended']);
1471
- });
1472
-
1473
- it('cancels every finger on a touchcancel that names none', () => {
1474
- const {box} = mount('<div id="box"></div>');
1475
- const pan = new PanGestureRecognizer({name: 'pan'});
1476
- const states: string[] = [];
1477
- pan.addListener(r => states.push(r.state));
1478
- detachers.push(host.attach(box, pan));
1479
- const finger = {id: 1, x: 10, y: 10};
1480
- touch('touchstart', box, [finger], [finger], 0);
1481
- touch('touchmove', box, [{...finger, x: 40}], [{...finger, x: 40}], 16);
1482
- box.dispatchEvent(new Event('touchcancel', {bubbles: true}));
1483
- expect(states).toEqual(['began', 'cancelled']);
1484
- });
1485
-
1486
- it('reads epoch-stamped events on the arena clock', () => {
1487
- const {box} = mount('<div id="box"></div>');
1488
- const pan = new PanGestureRecognizer({name: 'pan'});
1489
- let released = {x: 0, y: 0};
1490
- pan.addListener(r => {
1491
- if (r.state === 'ended') {
1492
- released = r.velocity();
1493
- }
1494
- });
1495
- detachers.push(host.attach(box, pan));
1496
- const epoch = performance.timeOrigin + 5000;
1497
- const finger = {id: 1, x: 0, y: 10};
1498
- touch('touchstart', box, [finger], [finger], epoch);
1499
- for (let t = 8; t <= 96; t += 8) {
1500
- const at = {...finger, x: t};
1501
- touch('touchmove', box, [at], [at], epoch + t);
1502
- }
1503
- touch('touchend', box, [{...finger, x: 96}], [], epoch + 100);
1504
- expect(released.x).toBeCloseTo(1000, 0);
1505
- expect(host.arena.now()).toBeLessThan(1e9);
1506
- });
1507
-
1508
- it('ignores touches that land outside every attached element', () => {
1509
- const {box, elsewhere} = mount(
1510
- '<div id="box"></div><div id="elsewhere"></div>',
1511
- );
1512
- const pan = new PanGestureRecognizer({name: 'pan'});
1513
- detachers.push(host.attach(box, pan));
1514
- const finger = {id: 1, x: 10, y: 10};
1515
- touch('touchstart', elsewhere, [finger], [finger], 0);
1516
- const move = touch(
1517
- 'touchmove',
1518
- elsewhere,
1519
- [{...finger, x: 60}],
1520
- [{...finger, x: 60}],
1521
- 16,
1522
- );
1523
- expect(move.defaultPrevented).toBe(false);
1524
- expect(host.arena.touches).toEqual([]);
1525
- });
1526
- });
1527
-
1528
- describe('every pointer where the primary pointer is fine (spec:AST-094 FR19, FR24, FR43)', () => {
1529
- /** The page listeners live now, by type: what was added and not removed. */
1530
- function pageListeners(): () => string[] {
1531
- const counts = new Map<string, number>();
1532
- for (const target of [document, window] as EventTarget[]) {
1533
- const add = target.addEventListener.bind(target);
1534
- const remove = target.removeEventListener.bind(target);
1535
- vi.spyOn(target, 'addEventListener').mockImplementation(
1536
- (type, listener, options) => {
1537
- counts.set(type, (counts.get(type) ?? 0) + 1);
1538
- add(type, listener, options);
1539
- },
1540
- );
1541
- vi.spyOn(target, 'removeEventListener').mockImplementation(
1542
- (type, listener, options) => {
1543
- counts.set(type, (counts.get(type) ?? 0) - 1);
1544
- remove(type, listener, options);
1545
- },
1546
- );
1547
- }
1548
- return () =>
1549
- [...counts]
1550
- .filter(
1551
- ([type, count]) =>
1552
- count > 0 &&
1553
- /^(touch|pointer|click|blur|scroll|contextmenu|visibilitychange)/.test(
1554
- type,
1555
- ),
1556
- )
1557
- .map(([type]) => type)
1558
- .sort();
1559
- }
1560
-
1561
- function fineHost(): GestureHost {
1562
- return new GestureHost(document, {
1563
- clock,
1564
- isPrimaryPointerCoarse: () => false,
1565
- });
1566
- }
1567
-
1568
- /** A button press with the button and modifier given. */
1569
- function press(
1570
- target: EventTarget,
1571
- init: {pointerType: string; button: number; ctrlKey?: boolean},
1572
- ): void {
1573
- const event = new PointerEvent('pointerdown', {
1574
- bubbles: true,
1575
- cancelable: true,
1576
- composed: true,
1577
- pointerId: 9,
1578
- pointerType: init.pointerType,
1579
- clientX: 10,
1580
- clientY: 10,
1581
- button: init.button,
1582
- buttons: init.button === 0 ? 1 : 2,
1583
- ctrlKey: init.ctrlKey ?? false,
1584
- });
1585
- Object.defineProperty(event, 'timeStamp', {value: 0});
1586
- target.dispatchEvent(event);
1587
- }
1588
-
1589
- afterEach(() => {
1590
- vi.restoreAllMocks();
1591
- vi.useRealTimers();
1592
- });
1593
-
1594
- it('keeps one passive pointerdown listener on each element that uses a gesture and none on the page while idle; a disabled one keeps none', () => {
1595
- const {box, row, off} = mount(
1596
- '<div id="box"></div><div id="row"></div><div id="off"></div>',
1597
- );
1598
- const live = pageListeners();
1599
- const downs = (element: HTMLElement) => {
1600
- const spy = vi.spyOn(element, 'addEventListener');
1601
- return () => spy.mock.calls.filter(call => call[0] === 'pointerdown');
1602
- };
1603
- const boxDowns = downs(box);
1604
- const rowDowns = downs(row);
1605
- const offAdded = vi.spyOn(off, 'addEventListener');
1606
- const fine = fineHost();
1607
- detachers.push(
1608
- fine.attach(box, new PanGestureRecognizer({direction: 'horizontal'})),
1609
- fine.attach(row, new TapGestureRecognizer()),
1610
- fine.attach(off, new TapGestureRecognizer({isEnabled: false})),
1611
- );
1612
- expect(live()).toEqual([]);
1613
- expect(boxDowns()).toEqual([
1614
- ['pointerdown', expect.any(Function), {capture: true, passive: true}],
1615
- ]);
1616
- expect(rowDowns()).toHaveLength(1);
1617
- expect(offAdded).not.toHaveBeenCalled();
1618
- });
1619
-
1620
- it("installs the page listeners for a mouse's primary-button press, serves it to every recognizer on its path, and removes them as the press ends", () => {
1621
- vi.useFakeTimers({toFake: ['setTimeout', 'clearTimeout', 'performance']});
1622
- const {outer, box} = mount('<div id="outer"><div id="box"></div></div>');
1623
- const live = pageListeners();
1624
- const fine = fineHost();
1625
- const pan = new PanGestureRecognizer({
1626
- name: 'pan',
1627
- direction: 'horizontal',
1628
- });
1629
- const outerTap = new TapGestureRecognizer({name: 'outer'});
1630
- const states: string[] = [];
1631
- const outerTransitions: string[] = [];
1632
- pan.addListener(r => states.push(r.state));
1633
- outerTap.addTransitionListener((_current, _from, to) =>
1634
- outerTransitions.push(to),
1635
- );
1636
- detachers.push(fine.attach(box, pan), fine.attach(outer, outerTap));
1637
- pointer('pointerdown', box, {
1638
- pointerType: 'mouse',
1639
- x: 10,
1640
- y: 10,
1641
- buttons: 1,
1642
- time: 0,
1643
- });
1644
- expect(live()).toEqual(
1645
- expect.arrayContaining(['click', 'pointermove', 'pointerup']),
1646
- );
1647
- pointer('pointermove', box, {
1648
- pointerType: 'mouse',
1649
- x: 40,
1650
- y: 10,
1651
- buttons: 1,
1652
- time: 16,
1653
- });
1654
- pointer('pointerup', box, {pointerType: 'mouse', x: 40, y: 10, time: 32});
1655
- expect(states[0]).toBe('began');
1656
- expect(states[states.length - 1]).toBe('ended');
1657
- expect(outerTransitions).toContain('failed');
1658
- // The click the claimed lift owes is still swallowed (FR21): its
1659
- // listener alone stays, for the swallower's window.
1660
- expect(live()).toEqual(['click']);
1661
- vi.advanceTimersByTime(1001);
1662
- expect(live()).toEqual([]);
1663
- });
1664
-
1665
- it('removes every page listener at once after a press nothing claimed', () => {
1666
- const {box} = mount('<div id="box"></div>');
1667
- const live = pageListeners();
1668
- const fine = fineHost();
1669
- detachers.push(fine.attach(box, new PanGestureRecognizer()));
1670
- pointer('pointerdown', box, {
1671
- pointerType: 'mouse',
1672
- x: 10,
1673
- y: 10,
1674
- buttons: 1,
1675
- time: 0,
1676
- });
1677
- pointer('pointermove', box, {
1678
- pointerType: 'mouse',
1679
- x: 13,
1680
- y: 10,
1681
- buttons: 1,
1682
- time: 16,
1683
- });
1684
- pointer('pointerup', box, {pointerType: 'mouse', x: 13, y: 10, time: 40});
1685
- expect(live()).toEqual([]);
1686
- });
1687
-
1688
- it("starts no press for a right click, a pen's barrel button or a ctrl-click on macOS (spec:AST-094 FR43)", () => {
1689
- const {box} = mount('<div id="box"></div>');
1690
- const live = pageListeners();
1691
- const fine = fineHost();
1692
- const tap = new TapGestureRecognizer({name: 'tap'});
1693
- const transitions: string[] = [];
1694
- tap.addTransitionListener((_current, _from, to) => transitions.push(to));
1695
- detachers.push(fine.attach(box, tap));
1696
- press(box, {pointerType: 'mouse', button: 2});
1697
- press(box, {pointerType: 'pen', button: 2});
1698
- vi.spyOn(navigator, 'platform', 'get').mockReturnValue('MacIntel');
1699
- press(box, {pointerType: 'mouse', button: 0, ctrlKey: true});
1700
- expect(live()).toEqual([]);
1701
- expect(transitions).toEqual([]);
1702
- expect(host.arena.touches).toEqual([]);
1703
- });
1704
-
1705
- it('serves a pen press, and keeps no pointer listener after it', () => {
1706
- const {box} = mount('<div id="box"></div>');
1707
- const live = pageListeners();
1708
- const fine = fineHost();
1709
- const pan = new PanGestureRecognizer({direction: 'horizontal'});
1710
- const states: string[] = [];
1711
- pan.addListener(r => states.push(r.state));
1712
- detachers.push(fine.attach(box, pan));
1713
- pointer('pointerdown', box, {
1714
- id: 3,
1715
- pointerType: 'pen',
1716
- x: 10,
1717
- y: 10,
1718
- buttons: 1,
1719
- time: 0,
1720
- });
1721
- pointer('pointermove', box, {
1722
- id: 3,
1723
- pointerType: 'pen',
1724
- x: 40,
1725
- y: 10,
1726
- buttons: 1,
1727
- time: 16,
1728
- });
1729
- pointer('pointerup', box, {
1730
- id: 3,
1731
- pointerType: 'pen',
1732
- x: 40,
1733
- y: 10,
1734
- time: 32,
1735
- });
1736
- expect(states[0]).toBe('began');
1737
- expect(states[states.length - 1]).toBe('ended');
1738
- expect(live().filter(type => type !== 'click')).toEqual([]);
1739
- });
1740
-
1741
- it("serves a touchscreen laptop's finger: its pointerdown brings the page listeners, its touches are read, and a claim cancels its touchmove and its lift", () => {
1742
- const {box} = mount('<div id="box"></div>');
1743
- const live = pageListeners();
1744
- const fine = fineHost();
1745
- const pan = new PanGestureRecognizer({direction: 'horizontal'});
1746
- const states: string[] = [];
1747
- pan.addListener(r => states.push(r.state));
1748
- detachers.push(fine.attach(box, pan));
1749
- const finger = {id: 1, x: 10, y: 10};
1750
- const moved = {id: 1, x: 40, y: 10};
1751
- pointer('pointerdown', box, {
1752
- id: 5,
1753
- pointerType: 'touch',
1754
- x: 10,
1755
- y: 10,
1756
- buttons: 1,
1757
- time: 0,
1758
- });
1759
- expect(live()).toEqual(expect.arrayContaining(['touchstart', 'touchend']));
1760
- touch('touchstart', box, [finger], [finger], 0);
1761
- const move = touch('touchmove', box, [moved], [moved], 16);
1762
- expect(states).toContain('began');
1763
- expect(move.defaultPrevented).toBe(true);
1764
- pointer('pointerup', box, {
1765
- id: 5,
1766
- pointerType: 'touch',
1767
- x: 40,
1768
- y: 10,
1769
- time: 32,
1770
- });
1771
- const lift = touch('touchend', box, [moved], [], 32);
1772
- expect(lift.defaultPrevented).toBe(true);
1773
- expect(states[states.length - 1]).toBe('ended');
1774
- expect(live().filter(type => type !== 'click')).toEqual([]);
1775
- });
1776
-
1777
- it('serves an action group like every attachment: its press reaches every recognizer on its path (family:action-groups FR5)', () => {
1778
- const {outer, group, one} = mount(
1779
- '<div id="outer"><div id="group"><button id="one"></button></div></div>',
1780
- );
1781
- const fine = fineHost();
1782
- const outerPan = new PanGestureRecognizer({direction: 'horizontal'});
1783
- const outerStates: string[] = [];
1784
- outerPan.addListener(r => outerStates.push(r.state));
1785
- detachers.push(
1786
- fine.attach(group, new TapGestureRecognizer(), {actionGroup: true}),
1787
- fine.attach(outer, outerPan),
1788
- );
1789
- pointer('pointerdown', one, {
1790
- pointerType: 'mouse',
1791
- x: 10,
1792
- y: 10,
1793
- buttons: 1,
1794
- time: 0,
1795
- });
1796
- pointer('pointermove', one, {
1797
- pointerType: 'mouse',
1798
- x: 40,
1799
- y: 10,
1800
- buttons: 1,
1801
- time: 16,
1802
- });
1803
- pointer('pointerup', one, {pointerType: 'mouse', x: 40, y: 10, time: 32});
1804
- expect(outerStates).toContain('began');
1805
- });
1806
-
1807
- it("re-syncs when only some of an element's recognizers detach: one left disabled keeps no pointerdown, page listener or ResizeObserver (spec:AST-094 FR24)", () => {
1808
- const {box} = mount('<div id="box"></div>');
1809
- const live = pageListeners();
1810
- // Where the primary pointer is fine: the element's one pointerdown goes
1811
- // with its last enabled recognizer.
1812
- const boxRemoved = vi.spyOn(box, 'removeEventListener');
1813
- const fine = fineHost();
1814
- const detachPan = fine.attach(box, new PanGestureRecognizer());
1815
- detachers.push(
1816
- fine.attach(box, new TapGestureRecognizer({isEnabled: false})),
1817
- );
1818
- detachPan();
1819
- expect(
1820
- boxRemoved.mock.calls.filter(call => call[0] === 'pointerdown'),
1821
- ).toHaveLength(1);
1822
- // A press consumer's detach re-syncs as a recognizer's does.
1823
- const {pad} = mount('<div id="box"></div><div id="pad"></div>');
1824
- const padRemoved = vi.spyOn(pad, 'removeEventListener');
1825
- const detachConsumer = fine.attachConsumer(pad, new RecordingConsumer());
1826
- detachers.push(
1827
- fine.attach(pad, new TapGestureRecognizer({isEnabled: false})),
1828
- );
1829
- detachConsumer();
1830
- expect(
1831
- padRemoved.mock.calls.filter(call => call[0] === 'pointerdown'),
1832
- ).toHaveLength(1);
1833
- // Where it is coarse: the page's listeners go too.
1834
- const coarse = new GestureHost(document, {
1835
- clock,
1836
- isPrimaryPointerCoarse: () => true,
1837
- });
1838
- const {row} = mount('<div id="row"></div>');
1839
- const detachRowPan = coarse.attach(row, new PanGestureRecognizer());
1840
- detachers.push(
1841
- coarse.attach(row, new TapGestureRecognizer({isEnabled: false})),
1842
- );
1843
- expect(live()).toContain('touchstart');
1844
- detachRowPan();
1845
- expect(live()).toEqual([]);
1846
- });
1847
-
1848
- it("watches the viewport once a touch-down finds a leading pan's direction switched in place to the right edge, and stops when it switches back (spec:AST-094 FR18, FR24, DEC-22)", () => {
1849
- const observed = new Set<Element>();
1850
- class StandInResizeObserver {
1851
- observe(target: Element): void {
1852
- observed.add(target);
1853
- }
1854
- unobserve(target: Element): void {
1855
- observed.delete(target);
1856
- }
1857
- disconnect(): void {
1858
- observed.clear();
1859
- }
1860
- }
1861
- const original = Object.getOwnPropertyDescriptor(window, 'ResizeObserver');
1862
- Object.defineProperty(window, 'ResizeObserver', {
1863
- configurable: true,
1864
- value: StandInResizeObserver,
1865
- });
1866
- try {
1867
- const {strip} = mount('<div id="strip" style="direction: ltr"></div>');
1868
- detachers.push(
1869
- host.attach(
1870
- strip,
1871
- new ScreenEdgePanGestureRecognizer({
1872
- name: 'edge',
1873
- edges: ['leading'],
1874
- }),
1875
- ),
1876
- );
1877
- // Under LTR the leading edge is the left one: its band stays put.
1878
- expect(observed.has(document.documentElement)).toBe(false);
1879
- // The page turns RTL in place; the next touch-down measures again, and
1880
- // the leading edge is the right one, whose band moves with the viewport.
1881
- strip.style.direction = 'rtl';
1882
- const first = {id: 1, x: 4, y: 300};
1883
- touch('touchstart', strip, [first], [first], 0);
1884
- touch('touchend', strip, [first], [], 40);
1885
- expect(observed.has(document.documentElement)).toBe(true);
1886
- // Back to LTR in place: the root is watched for nothing, and goes.
1887
- strip.style.direction = 'ltr';
1888
- const second = {id: 2, x: 4, y: 300};
1889
- touch('touchstart', strip, [second], [second], 200);
1890
- touch('touchend', strip, [second], [], 240);
1891
- expect(observed.has(document.documentElement)).toBe(false);
1892
- } finally {
1893
- if (original == null) {
1894
- delete (window as {ResizeObserver?: unknown}).ResizeObserver;
1895
- } else {
1896
- Object.defineProperty(window, 'ResizeObserver', original);
1897
- }
1898
- }
1899
- });
1900
-
1901
- it("stops watching a screen-edge pan's box when it detaches while a disabled recognizer stays on the element (spec:AST-094 FR24)", () => {
1902
- const observed = new Set<Element>();
1903
- class StandInResizeObserver {
1904
- observe(target: Element): void {
1905
- observed.add(target);
1906
- }
1907
- unobserve(target: Element): void {
1908
- observed.delete(target);
1909
- }
1910
- disconnect(): void {
1911
- observed.clear();
1912
- }
1913
- }
1914
- const original = Object.getOwnPropertyDescriptor(window, 'ResizeObserver');
1915
- Object.defineProperty(window, 'ResizeObserver', {
1916
- configurable: true,
1917
- value: StandInResizeObserver,
1918
- });
1919
- try {
1920
- const {strip} = mount('<div id="strip"></div>');
1921
- const fine = fineHost();
1922
- const detachEdge = fine.attach(
1923
- strip,
1924
- new ScreenEdgePanGestureRecognizer({name: 'edge'}),
1925
- );
1926
- detachers.push(
1927
- fine.attach(strip, new TapGestureRecognizer({isEnabled: false})),
1928
- );
1929
- expect(observed).toEqual(new Set([strip]));
1930
- detachEdge();
1931
- expect(observed.size).toBe(0);
1932
- } finally {
1933
- if (original == null) {
1934
- delete (window as {ResizeObserver?: unknown}).ResizeObserver;
1935
- } else {
1936
- Object.defineProperty(window, 'ResizeObserver', original);
1937
- }
1938
- }
1939
- });
1940
-
1941
- it('removes the element listener on detach and leaves nothing on the page', () => {
1942
- const {box} = mount('<div id="box"></div>');
1943
- const live = pageListeners();
1944
- const boxRemoved = vi.spyOn(box, 'removeEventListener');
1945
- const fine = fineHost();
1946
- const detach = fine.attach(box, new TapGestureRecognizer());
1947
- detach();
1948
- expect(boxRemoved).toHaveBeenCalledWith(
1949
- 'pointerdown',
1950
- expect.any(Function),
1951
- {capture: true, passive: true},
1952
- );
1953
- expect(live()).toEqual([]);
1954
- });
1955
-
1956
- it('gives a coarse primary pointer its page listeners and no element pointerdown', () => {
1957
- const {box} = mount('<div id="box"></div>');
1958
- const live = pageListeners();
1959
- const boxAdded = vi.spyOn(box, 'addEventListener');
1960
- const coarse = new GestureHost(document, {
1961
- clock,
1962
- isPrimaryPointerCoarse: () => true,
1963
- });
1964
- detachers.push(coarse.attach(box, new TapGestureRecognizer()));
1965
- expect(live()).toEqual(
1966
- expect.arrayContaining(['pointerdown', 'touchstart']),
1967
- );
1968
- expect(
1969
- boxAdded.mock.calls.filter(call => call[0] === 'pointerdown'),
1970
- ).toEqual([]);
1971
- });
1972
- });
1973
-
1974
- describe("inputMode 'pointer-events'", () => {
1975
- /** A clock whose timers the test fires. */
1976
- class TimerClock {
1977
- time = 0;
1978
- private readonly timers = new Map<number, () => void>();
1979
- private next = 1;
1980
- now(): number {
1981
- return this.time;
1982
- }
1983
- setTimeout(callback: () => void): number {
1984
- const id = this.next++;
1985
- this.timers.set(id, callback);
1986
- return id;
1987
- }
1988
- clearTimeout(id: number): void {
1989
- this.timers.delete(id);
1990
- }
1991
- /** Runs every timer, and the ones they set, at `time`. */
1992
- fireAll(time: number): void {
1993
- this.time = time;
1994
- while (this.timers.size > 0) {
1995
- const due = [...this.timers.values()];
1996
- this.timers.clear();
1997
- for (const callback of due) {
1998
- callback();
1999
- }
2000
- }
2001
- }
2002
- }
2003
-
2004
- it("tracks a finger once, from its pointer events, so a still finger's long press begins", () => {
2005
- const {box} = mount('<div id="box"></div>');
2006
- const timers = new TimerClock();
2007
- const pointerHost = new GestureHost(document, {
2008
- clock: timers,
2009
- inputMode: 'pointer-events',
2010
- isPrimaryPointerCoarse: () => true,
2011
- });
2012
- const press = new LongPressGestureRecognizer();
2013
- const states: string[] = [];
2014
- press.addListener(r => states.push(r.state));
2015
- detachers.push(pointerHost.attach(box, press));
2016
- // A browser with Touch Events sends both for one finger.
2017
- pointer('pointerdown', box, {
2018
- pointerType: 'touch',
2019
- x: 10,
2020
- y: 10,
2021
- buttons: 1,
2022
- time: 0,
2023
- });
2024
- const finger = {id: 7, x: 10, y: 10};
2025
- touch('touchstart', box, [finger], [finger], 0);
2026
- expect(press.numberOfTouches).toBe(1);
2027
- timers.fireAll(800);
2028
- expect(states).toContain('began');
2029
- pointer('pointerup', box, {pointerType: 'touch', x: 10, y: 10, time: 820});
2030
- touch('touchend', box, [finger], [], 820);
2031
- expect(states).toContain('ended');
2032
- });
2033
-
2034
- it("cancels a claimed finger's touchmove, matching its touches to its pointer", () => {
2035
- const {box} = mount('<div id="box"></div>');
2036
- const pointerHost = new GestureHost(document, {
2037
- clock,
2038
- inputMode: 'pointer-events',
2039
- isPrimaryPointerCoarse: () => true,
2040
- });
2041
- const pan = new PanGestureRecognizer({direction: 'horizontal'});
2042
- detachers.push(pointerHost.attach(box, pan));
2043
- pointer('pointerdown', box, {
2044
- pointerType: 'touch',
2045
- x: 10,
2046
- y: 10,
2047
- buttons: 1,
2048
- time: 0,
2049
- });
2050
- const finger = {id: 7, x: 10, y: 10};
2051
- touch('touchstart', box, [finger], [finger], 0);
2052
- // Before the pan claims, the browser keeps the move.
2053
- const early = {...finger, x: 14};
2054
- pointer('pointermove', box, {
2055
- pointerType: 'touch',
2056
- x: 14,
2057
- y: 10,
2058
- buttons: 1,
2059
- time: 8,
2060
- });
2061
- expect(touch('touchmove', box, [early], [early], 8).defaultPrevented).toBe(
2062
- false,
2063
- );
2064
- // Past its hysteresis the pan owns the finger: its touchmoves are cancelled.
2065
- const claimed = {...finger, x: 40};
2066
- pointer('pointermove', box, {
2067
- pointerType: 'touch',
2068
- x: 40,
2069
- y: 10,
2070
- buttons: 1,
2071
- time: 32,
2072
- });
2073
- expect(pan.state).toBe('began');
2074
- expect(
2075
- touch('touchmove', box, [claimed], [claimed], 32).defaultPrevented,
2076
- ).toBe(true);
2077
- });
2078
-
2079
- it("cancels a claimed finger's touchend, and leaves an unclaimed one's alone", () => {
2080
- const {box, other} = mount('<div id="box"></div><div id="other"></div>');
2081
- const pointerHost = new GestureHost(document, {
2082
- clock,
2083
- inputMode: 'pointer-events',
2084
- isPrimaryPointerCoarse: () => true,
2085
- });
2086
- const pan = new PanGestureRecognizer({direction: 'horizontal'});
2087
- detachers.push(
2088
- pointerHost.attach(box, pan),
2089
- pointerHost.attach(other, new TapGestureRecognizer()),
2090
- );
2091
- // A pan that claims, then lifts: its touchend is cancelled (FR21).
2092
- pointer('pointerdown', box, {
2093
- pointerType: 'touch',
2094
- x: 10,
2095
- y: 10,
2096
- buttons: 1,
2097
- time: 0,
2098
- });
2099
- const finger = {id: 7, x: 10, y: 10};
2100
- touch('touchstart', box, [finger], [finger], 0);
2101
- pointer('pointermove', box, {
2102
- pointerType: 'touch',
2103
- x: 40,
2104
- y: 10,
2105
- buttons: 1,
2106
- time: 32,
2107
- });
2108
- expect(pan.state).toBe('began');
2109
- pointer('pointerup', box, {pointerType: 'touch', x: 40, y: 10, time: 48});
2110
- const lifted = {...finger, x: 40};
2111
- expect(touch('touchend', box, [lifted], [], 48).defaultPrevented).toBe(
2112
- true,
2113
- );
2114
- // A tap nobody claimed before its lift keeps its touchend.
2115
- pointer('pointerdown', other, {
2116
- id: 2,
2117
- pointerType: 'touch',
2118
- x: 10,
2119
- y: 80,
2120
- buttons: 1,
2121
- time: 400,
2122
- });
2123
- const second = {id: 8, x: 10, y: 80};
2124
- touch('touchstart', other, [second], [second], 400);
2125
- pointer('pointerup', other, {
2126
- id: 2,
2127
- pointerType: 'touch',
2128
- x: 10,
2129
- y: 80,
2130
- time: 460,
2131
- });
2132
- expect(touch('touchend', other, [second], [], 460).defaultPrevented).toBe(
2133
- false,
2134
- );
2135
- });
2136
- });