@astryxdesign/core 0.7.17 → 0.7.18-canary.g32556bb

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 (473) hide show
  1. package/dist/AlertDialog/AlertDialog.d.ts.map +1 -1
  2. package/dist/AlertDialog/AlertDialog.js +7 -0
  3. package/dist/AppShell/AppShell.d.ts.map +1 -1
  4. package/dist/AppShell/AppShell.js +5 -3
  5. package/dist/AppShell/observeMainOverflow.d.ts +5 -0
  6. package/dist/AppShell/observeMainOverflow.d.ts.map +1 -1
  7. package/dist/AppShell/observeMainOverflow.js +39 -9
  8. package/dist/BottomSheet/BottomSheet.d.ts.map +1 -1
  9. package/dist/BottomSheet/BottomSheet.js +8 -0
  10. package/dist/BottomSheet/useSheetGestures.d.ts +8 -0
  11. package/dist/BottomSheet/useSheetGestures.d.ts.map +1 -1
  12. package/dist/BottomSheet/useSheetGestures.js +16 -1
  13. package/dist/Button/Button.d.ts.map +1 -1
  14. package/dist/Button/Button.js +3 -16
  15. package/dist/Card/Card.d.ts.map +1 -1
  16. package/dist/Card/Card.js +5 -1
  17. package/dist/Citation/Citation.d.ts.map +1 -1
  18. package/dist/Citation/Citation.js +2 -2
  19. package/dist/ClickableCard/ClickableCard.d.ts.map +1 -1
  20. package/dist/ClickableCard/ClickableCard.js +7 -2
  21. package/dist/DateInput/DateInput.d.ts +0 -3
  22. package/dist/DateInput/DateInput.d.ts.map +1 -1
  23. package/dist/DateInput/DateInput.js +3 -5
  24. package/dist/DateInput/NativeDateField.d.ts.map +1 -1
  25. package/dist/DateInput/NativeDateField.js +3 -5
  26. package/dist/DateInput/TouchDateField.d.ts.map +1 -1
  27. package/dist/DateInput/TouchDateField.js +2 -4
  28. package/dist/DateInput/useTypedDate.d.ts.map +1 -1
  29. package/dist/DateInput/useTypedDate.js +9 -6
  30. package/dist/DateRangeInput/DateRangeInput.d.ts.map +1 -1
  31. package/dist/DateRangeInput/DateRangeInput.js +13 -9
  32. package/dist/DateTimeInput/DateTimeInput.d.ts.map +1 -1
  33. package/dist/DateTimeInput/DateTimeInput.js +3 -15
  34. package/dist/DateTimeInput/TouchDateTimeField.d.ts.map +1 -1
  35. package/dist/DateTimeInput/TouchDateTimeField.js +2 -14
  36. package/dist/Dialog/Dialog.d.ts.map +1 -1
  37. package/dist/Dialog/Dialog.js +7 -1
  38. package/dist/Drawer/Drawer.d.ts.map +1 -1
  39. package/dist/Drawer/Drawer.js +7 -0
  40. package/dist/Field/Field.d.ts.map +1 -1
  41. package/dist/Field/Field.js +2 -1
  42. package/dist/Field/FieldLabel.d.ts.map +1 -1
  43. package/dist/Field/FieldLabel.js +9 -2
  44. package/dist/Field/InputClearButton.d.ts.map +1 -1
  45. package/dist/Field/InputClearButton.js +23 -0
  46. package/dist/Field/inputStyles.stylex.d.ts +22 -6
  47. package/dist/Field/inputStyles.stylex.d.ts.map +1 -1
  48. package/dist/Field/inputStyles.stylex.js +32 -0
  49. package/dist/FieldStatus/FieldStatus.d.ts.map +1 -1
  50. package/dist/FieldStatus/FieldStatus.js +7 -2
  51. package/dist/FileInput/FileInput.d.ts.map +1 -1
  52. package/dist/FileInput/FileInput.js +4 -4
  53. package/dist/InputGroup/InputGroup.d.ts.map +1 -1
  54. package/dist/InputGroup/InputGroup.js +6 -16
  55. package/dist/InputGroup/InputGroupText.d.ts.map +1 -1
  56. package/dist/InputGroup/InputGroupText.js +2 -8
  57. package/dist/Item/Item.d.ts.map +1 -1
  58. package/dist/Item/Item.js +8 -2
  59. package/dist/Kbd/Kbd.d.ts +3 -2
  60. package/dist/Kbd/Kbd.d.ts.map +1 -1
  61. package/dist/Kbd/Kbd.js +3 -2
  62. package/dist/Layer/gestureCounter.d.ts +5 -0
  63. package/dist/Layer/gestureCounter.d.ts.map +1 -1
  64. package/dist/Layer/gestureCounter.js +40 -4
  65. package/dist/Layer/inputHold.d.ts +13 -0
  66. package/dist/Layer/inputHold.d.ts.map +1 -1
  67. package/dist/Layer/inputHold.js +203 -14
  68. package/dist/Layer/layerHost.d.ts +3 -2
  69. package/dist/Layer/layerHost.d.ts.map +1 -1
  70. package/dist/Layer/layerHost.js +3 -2
  71. package/dist/Layer/outsidePanClaim.d.ts +17 -0
  72. package/dist/Layer/outsidePanClaim.d.ts.map +1 -1
  73. package/dist/Layer/outsidePanClaim.js +36 -8
  74. package/dist/Layer/outsidePress.d.ts +7 -1
  75. package/dist/Layer/outsidePress.d.ts.map +1 -1
  76. package/dist/Layer/outsidePress.js +9 -2
  77. package/dist/Layer/useLayer.d.ts +21 -5
  78. package/dist/Layer/useLayer.d.ts.map +1 -1
  79. package/dist/Layer/useLayer.js +63 -40
  80. package/dist/Lightbox/Lightbox.d.ts.map +1 -1
  81. package/dist/Lightbox/Lightbox.js +7 -0
  82. package/dist/MetadataList/MetadataList.d.ts +1 -1
  83. package/dist/MetadataList/MetadataList.d.ts.map +1 -1
  84. package/dist/MetadataList/MetadataList.js +8 -0
  85. package/dist/MultiSelector/MultiSelector.d.ts.map +1 -1
  86. package/dist/MultiSelector/MultiSelector.js +37 -17
  87. package/dist/NavIcon/NavIcon.d.ts +2 -2
  88. package/dist/NavIcon/NavIcon.d.ts.map +1 -1
  89. package/dist/NavIcon/NavIcon.js +2 -2
  90. package/dist/NavMenu/NavHeadingMenuItem.d.ts.map +1 -1
  91. package/dist/NavMenu/NavHeadingMenuItem.js +4 -3
  92. package/dist/NumberInput/NumberInput.d.ts +13 -5
  93. package/dist/NumberInput/NumberInput.d.ts.map +1 -1
  94. package/dist/NumberInput/NumberInput.js +6 -17
  95. package/dist/NumberInput/numberParser.d.ts +9 -2
  96. package/dist/NumberInput/numberParser.d.ts.map +1 -1
  97. package/dist/NumberInput/numberParser.js +15 -2
  98. package/dist/Overlay/OverlayScrim.d.ts.map +1 -1
  99. package/dist/Overlay/OverlayScrim.js +13 -4
  100. package/dist/Overlay/useOverlay.d.ts +1 -1
  101. package/dist/Pagination/Pagination.d.ts +3 -2
  102. package/dist/Pagination/Pagination.d.ts.map +1 -1
  103. package/dist/Pagination/Pagination.js +9 -2
  104. package/dist/Popover/usePopover.d.ts +37 -6
  105. package/dist/Popover/usePopover.d.ts.map +1 -1
  106. package/dist/Popover/usePopover.js +103 -20
  107. package/dist/PowerSearch/PowerSearch.d.ts +4 -1
  108. package/dist/PowerSearch/PowerSearch.d.ts.map +1 -1
  109. package/dist/PowerSearch/PowerSearch.js +3 -4
  110. package/dist/PowerSearch/PowerSearchBottomSheet.d.ts +1 -2
  111. package/dist/PowerSearch/PowerSearchBottomSheet.d.ts.map +1 -1
  112. package/dist/PowerSearch/PowerSearchBottomSheet.js +173 -185
  113. package/dist/PowerSearch/PowerSearchValueEditor.d.ts +0 -12
  114. package/dist/PowerSearch/PowerSearchValueEditor.d.ts.map +1 -1
  115. package/dist/PowerSearch/PowerSearchValueEditor.js +1 -51
  116. package/dist/PowerSearch/formatFilterValue.d.ts.map +1 -1
  117. package/dist/PowerSearch/formatFilterValue.js +6 -8
  118. package/dist/PowerSearch/formatTokenValue.d.ts +5 -10
  119. package/dist/PowerSearch/formatTokenValue.d.ts.map +1 -1
  120. package/dist/PowerSearch/formatTokenValue.js +21 -38
  121. package/dist/PowerSearch/relativeDateOptions.d.ts +30 -0
  122. package/dist/PowerSearch/relativeDateOptions.d.ts.map +1 -0
  123. package/dist/PowerSearch/relativeDateOptions.js +74 -0
  124. package/dist/ProgressBar/ProgressBar.d.ts +1 -1
  125. package/dist/ProgressBar/ProgressBar.d.ts.map +1 -1
  126. package/dist/ProgressBar/ProgressBar.js +20 -14
  127. package/dist/Resizable/createResizable.d.ts.map +1 -1
  128. package/dist/Resizable/createResizable.js +38 -4
  129. package/dist/SegmentedControl/SegmentedControlItem.d.ts.map +1 -1
  130. package/dist/SegmentedControl/SegmentedControlItem.js +5 -3
  131. package/dist/SelectableCard/SelectableCard.d.ts.map +1 -1
  132. package/dist/SelectableCard/SelectableCard.js +6 -2
  133. package/dist/Selector/Selector.d.ts.map +1 -1
  134. package/dist/Selector/Selector.js +2 -1
  135. package/dist/SideNav/SideNavItem.d.ts.map +1 -1
  136. package/dist/SideNav/SideNavItem.js +1 -1
  137. package/dist/Slider/Slider.d.ts.map +1 -1
  138. package/dist/Slider/Slider.js +53 -8
  139. package/dist/Stepper/Step.d.ts.map +1 -1
  140. package/dist/Stepper/Step.js +2 -2
  141. package/dist/TabList/Tab.d.ts.map +1 -1
  142. package/dist/TabList/Tab.js +2 -0
  143. package/dist/TabList/TabMenu.d.ts.map +1 -1
  144. package/dist/TabList/TabMenu.js +2 -0
  145. package/dist/Table/BaseTable.d.ts.map +1 -1
  146. package/dist/Table/BaseTable.js +30 -8
  147. package/dist/Table/Table.d.ts +9 -4
  148. package/dist/Table/Table.d.ts.map +1 -1
  149. package/dist/Table/Table.js +9 -4
  150. package/dist/Table/TableCell.d.ts.map +1 -1
  151. package/dist/Table/TableCell.js +2 -2
  152. package/dist/Table/TableHeaderCell.d.ts.map +1 -1
  153. package/dist/Table/TableHeaderCell.js +3 -7
  154. package/dist/Table/TableRow.d.ts.map +1 -1
  155. package/dist/Table/TableRow.js +10 -1
  156. package/dist/Table/plugins/rowExpansion/useTableRowExpansion.d.ts +11 -3
  157. package/dist/Table/plugins/rowExpansion/useTableRowExpansion.d.ts.map +1 -1
  158. package/dist/Table/plugins/rowExpansion/useTableRowExpansion.js +203 -51
  159. package/dist/Table/plugins/rowIndex/useTableRowIndex.d.ts.map +1 -1
  160. package/dist/Table/plugins/rowIndex/useTableRowIndex.js +4 -1
  161. package/dist/Table/plugins/rowStatus/useTableRowStatus.d.ts.map +1 -1
  162. package/dist/Table/plugins/rowStatus/useTableRowStatus.js +2 -0
  163. package/dist/Table/plugins/sortable/useTableSortable.d.ts.map +1 -1
  164. package/dist/Table/plugins/sortable/useTableSortable.js +18 -1
  165. package/dist/Table/plugins/stickyColumns/useTableStickyColumns.d.ts.map +1 -1
  166. package/dist/Table/plugins/stickyColumns/useTableStickyColumns.js +34 -24
  167. package/dist/Table/tableColumnAdmission.d.ts +7 -0
  168. package/dist/Table/tableColumnAdmission.d.ts.map +1 -1
  169. package/dist/Table/tableColumnAdmission.js +15 -0
  170. package/dist/Table/types.d.ts +5 -5
  171. package/dist/Text/Text.d.ts.map +1 -1
  172. package/dist/Text/Text.js +13 -8
  173. package/dist/Text/TruncationTooltip.d.ts +7 -39
  174. package/dist/Text/TruncationTooltip.d.ts.map +1 -1
  175. package/dist/Text/TruncationTooltip.js +47 -128
  176. package/dist/Text/cutText.d.ts +22 -0
  177. package/dist/Text/cutText.d.ts.map +1 -0
  178. package/dist/Text/cutText.js +92 -0
  179. package/dist/Text/cutTextOnKeyboardFocus.d.ts +41 -0
  180. package/dist/Text/cutTextOnKeyboardFocus.d.ts.map +1 -0
  181. package/dist/Text/cutTextOnKeyboardFocus.js +112 -0
  182. package/dist/Text/textClampContext.d.ts +1 -0
  183. package/dist/Text/textClampContext.d.ts.map +1 -1
  184. package/dist/Text/textClampContext.js +10 -5
  185. package/dist/Text/useTruncation.d.ts +23 -1
  186. package/dist/Text/useTruncation.d.ts.map +1 -1
  187. package/dist/Text/useTruncation.js +74 -28
  188. package/dist/TextInput/TextInput.d.ts +6 -6
  189. package/dist/Thumbnail/Thumbnail.js +4 -1
  190. package/dist/TimeInput/TimeInput.d.ts +0 -3
  191. package/dist/TimeInput/TimeInput.d.ts.map +1 -1
  192. package/dist/TimeInput/TimeInput.js +3 -5
  193. package/dist/TimeInput/TouchTimeField.d.ts.map +1 -1
  194. package/dist/TimeInput/TouchTimeField.js +3 -5
  195. package/dist/Timestamp/Timestamp.d.ts.map +1 -1
  196. package/dist/Timestamp/Timestamp.js +22 -16
  197. package/dist/Timestamp/TimestampHoverCard.d.ts +6 -3
  198. package/dist/Timestamp/TimestampHoverCard.d.ts.map +1 -1
  199. package/dist/Timestamp/TimestampHoverCard.js +30 -19
  200. package/dist/Timestamp/formatInstant.d.ts.map +1 -1
  201. package/dist/Timestamp/formatInstant.js +3 -3
  202. package/dist/Timestamp/tooltipEntries.d.ts.map +1 -1
  203. package/dist/Timestamp/tooltipEntries.js +4 -2
  204. package/dist/Toast/Toast.d.ts.map +1 -1
  205. package/dist/Toast/Toast.js +62 -31
  206. package/dist/Toast/ToastViewport.d.ts.map +1 -1
  207. package/dist/Toast/ToastViewport.js +35 -13
  208. package/dist/Toast/useToast.d.ts.map +1 -1
  209. package/dist/Toast/useToast.js +35 -14
  210. package/dist/Toolbar/Toolbar.d.ts.map +1 -1
  211. package/dist/Toolbar/Toolbar.js +20 -3
  212. package/dist/Tooltip/useTooltip.d.ts.map +1 -1
  213. package/dist/Tooltip/useTooltip.js +3 -3
  214. package/dist/astryx.css +41 -10
  215. package/dist/hooks/useAnnounceRenderedText.d.ts +10 -3
  216. package/dist/hooks/useAnnounceRenderedText.d.ts.map +1 -1
  217. package/dist/hooks/useAnnounceRenderedText.js +11 -3
  218. package/dist/hooks/useFocusTrap.d.ts +12 -0
  219. package/dist/hooks/useFocusTrap.d.ts.map +1 -1
  220. package/dist/hooks/useFocusTrap.js +13 -6
  221. package/dist/hooks/useHotkeys.d.ts +9 -1
  222. package/dist/hooks/useHotkeys.d.ts.map +1 -1
  223. package/dist/hooks/useHotkeys.js +52 -2
  224. package/dist/hooks/useInputStatusIcon.d.ts.map +1 -1
  225. package/dist/hooks/useInputStatusIcon.js +2 -1
  226. package/dist/hooks/useKeyboardHint.d.ts.map +1 -1
  227. package/dist/hooks/useKeyboardHint.js +4 -3
  228. package/dist/i18n/generated-english/DateRangeInput/DateRangeInput.generated.d.ts.map +1 -1
  229. package/dist/i18n/generated-english/DateRangeInput/DateRangeInput.generated.js +2 -0
  230. package/dist/i18n/generated-english/MultiSelector/MultiSelector.generated.d.ts.map +1 -1
  231. package/dist/i18n/generated-english/MultiSelector/MultiSelector.generated.js +1 -0
  232. package/dist/i18n/generated-english/PowerSearch/PowerSearchValueEditor.generated.d.ts.map +1 -1
  233. package/dist/i18n/generated-english/PowerSearch/PowerSearchValueEditor.generated.js +0 -6
  234. package/dist/i18n/generated-english/PowerSearch/relativeDateOptions.generated.d.ts +8 -0
  235. package/dist/i18n/generated-english/PowerSearch/relativeDateOptions.generated.d.ts.map +1 -0
  236. package/dist/i18n/generated-english/PowerSearch/relativeDateOptions.generated.js +17 -0
  237. package/dist/i18n/generated-english/Slider/Slider.generated.d.ts.map +1 -1
  238. package/dist/i18n/generated-english/Slider/Slider.generated.js +1 -0
  239. package/dist/i18n/generated-english/Thumbnail/Thumbnail.generated.d.ts.map +1 -1
  240. package/dist/i18n/generated-english/Thumbnail/Thumbnail.generated.js +1 -0
  241. package/dist/i18n/generated-locales/en.generated.d.ts.map +1 -1
  242. package/dist/i18n/generated-locales/en.generated.js +5 -0
  243. package/dist/i18n/generated-locales/pseudo.generated.d.ts.map +1 -1
  244. package/dist/i18n/generated-locales/pseudo.generated.js +5 -0
  245. package/dist/i18n/getLocaleDirection.d.ts +0 -16
  246. package/dist/i18n/getLocaleDirection.d.ts.map +1 -1
  247. package/dist/i18n/getLocaleDirection.js +16 -6
  248. package/dist/i18n/listFormat.d.ts +34 -0
  249. package/dist/i18n/listFormat.d.ts.map +1 -0
  250. package/dist/i18n/listFormat.js +45 -0
  251. package/dist/i18n/useListFormatter.d.ts +7 -3
  252. package/dist/i18n/useListFormatter.d.ts.map +1 -1
  253. package/dist/i18n/useListFormatter.js +16 -13
  254. package/dist/internal/module-loader.d.ts +15 -0
  255. package/dist/internal/module-loader.d.ts.map +1 -0
  256. package/dist/internal/module-loader.js +15 -0
  257. package/dist/motion/animatedLayout.d.ts +6 -0
  258. package/dist/motion/animatedLayout.d.ts.map +1 -1
  259. package/dist/motion/animatedLayout.js +201 -27
  260. package/dist/palette/color.d.ts +16 -0
  261. package/dist/palette/color.d.ts.map +1 -1
  262. package/dist/palette/color.js +37 -1
  263. package/dist/palette/derive-look.d.ts +235 -0
  264. package/dist/palette/derive-look.d.ts.map +1 -0
  265. package/dist/palette/derive-look.js +879 -0
  266. package/dist/palette/editor-look.d.ts +41 -0
  267. package/dist/palette/editor-look.d.ts.map +1 -0
  268. package/dist/palette/editor-look.js +401 -0
  269. package/dist/palette/mapping.d.ts +99 -6
  270. package/dist/palette/mapping.d.ts.map +1 -1
  271. package/dist/palette/mapping.js +68 -11
  272. package/dist/theme/tokens.d.ts +1 -1
  273. package/dist/theme/tokens.d.ts.map +1 -1
  274. package/dist/theme/tokens.js +1 -1
  275. package/dist/utils/characters.d.ts.map +1 -1
  276. package/dist/utils/characters.js +7 -0
  277. package/dist/utils/devWarning.d.ts +18 -0
  278. package/dist/utils/devWarning.d.ts.map +1 -1
  279. package/dist/utils/devWarning.js +30 -0
  280. package/dist/utils/focusReturn.d.ts +2 -0
  281. package/dist/utils/focusReturn.d.ts.map +1 -1
  282. package/dist/utils/focusReturn.js +3 -8
  283. package/dist/utils/hitArea.d.ts +4 -1
  284. package/dist/utils/hitArea.d.ts.map +1 -1
  285. package/dist/utils/hitArea.js +72 -9
  286. package/dist/utils/mergeProps.d.ts.map +1 -1
  287. package/dist/utils/mergeProps.js +53 -38
  288. package/dist/utils/scrollView.d.ts +2 -2
  289. package/dist/utils/scrollView.d.ts.map +1 -1
  290. package/dist/utils/scrollView.js +3 -3
  291. package/dist/utils/textDirection.d.ts +29 -5
  292. package/dist/utils/textDirection.d.ts.map +1 -1
  293. package/dist/utils/textDirection.js +56 -4
  294. package/dist/utils/themeProps.d.ts.map +1 -1
  295. package/dist/utils/themeProps.js +22 -3
  296. package/dist/utils/touchHitArea.d.ts.map +1 -1
  297. package/dist/utils/touchHitArea.js +4 -2
  298. package/dist/virtualization/useInlineListWindow.d.ts.map +1 -1
  299. package/dist/virtualization/useInlineListWindow.js +63 -4
  300. package/locales/en.json +26 -6
  301. package/locales/pseudo.json +15 -0
  302. package/package.json +10 -5
  303. package/src/AlertDialog/AlertDialog.tsx +15 -0
  304. package/src/AlertDialog/useImperativeAlertDialog.doc.mjs +7 -4
  305. package/src/AppShell/AppShell.tsx +6 -3
  306. package/src/AppShell/observeMainOverflow.ts +39 -9
  307. package/src/Badge/Badge.doc.mjs +3 -3
  308. package/src/BottomSheet/BottomSheet.tsx +15 -0
  309. package/src/BottomSheet/useSheetGestures.ts +26 -1
  310. package/src/Button/Button.tsx +3 -23
  311. package/src/Card/Card.doc.mjs +3 -3
  312. package/src/Card/Card.tsx +11 -6
  313. package/src/Chat/ChatSendButton.doc.mjs +6 -6
  314. package/src/Chat/ChatToolCalls.doc.mjs +1 -1
  315. package/src/CheckboxInput/CheckboxInput.doc.mjs +3 -3
  316. package/src/Citation/Citation.tsx +8 -2
  317. package/src/ClickableCard/ClickableCard.tsx +9 -2
  318. package/src/ComplexSelector/ComplexSelector.doc.mjs +3 -3
  319. package/src/ContextMenu/ContextMenuItem.doc.mjs +3 -3
  320. package/src/DateInput/DateInput.tsx +2 -4
  321. package/src/DateInput/NativeDateField.tsx +5 -4
  322. package/src/DateInput/TouchDateField.tsx +2 -3
  323. package/src/DateInput/useTypedDate.ts +13 -6
  324. package/src/DateRangeInput/DateRangeInput.tsx +14 -10
  325. package/src/DateTimeInput/DateTimeInput.tsx +2 -12
  326. package/src/DateTimeInput/TouchDateTimeField.tsx +2 -11
  327. package/src/Dialog/Dialog.tsx +15 -1
  328. package/src/Dialog/useImperativeDialog.doc.mjs +7 -4
  329. package/src/Drawer/Drawer.tsx +15 -0
  330. package/src/DropdownMenu/DropdownMenu.doc.mjs +1 -1
  331. package/src/DropdownMenu/DropdownMenuCheckboxItem.doc.mjs +3 -3
  332. package/src/DropdownMenu/DropdownMenuItem.doc.mjs +3 -3
  333. package/src/DropdownMenu/DropdownMenuRadioItem.doc.mjs +3 -3
  334. package/src/DropdownMenu/DropdownMenuSubMenu.doc.mjs +2 -2
  335. package/src/Field/Field.doc.mjs +1 -1
  336. package/src/Field/Field.tsx +2 -1
  337. package/src/Field/FieldLabel.doc.mjs +3 -3
  338. package/src/Field/FieldLabel.tsx +11 -3
  339. package/src/Field/InputClearButton.tsx +27 -0
  340. package/src/Field/inputStyles.stylex.ts +53 -6
  341. package/src/FieldStatus/FieldStatus.tsx +7 -2
  342. package/src/FileInput/FileInput.tsx +12 -2
  343. package/src/Icon/Icon.doc.mjs +17 -14
  344. package/src/Icon/useIcon.doc.mjs +6 -6
  345. package/src/IconButton/IconButton.doc.mjs +2 -2
  346. package/src/InfoTip/InfoTip.doc.mjs +1 -1
  347. package/src/InputGroup/InputGroup.tsx +5 -12
  348. package/src/InputGroup/InputGroupText.tsx +2 -3
  349. package/src/Item/Item.tsx +10 -1
  350. package/src/Kbd/Kbd.doc.mjs +5 -5
  351. package/src/Kbd/Kbd.tsx +3 -2
  352. package/src/Layer/gestureCounter.ts +39 -3
  353. package/src/Layer/inputHold.ts +241 -18
  354. package/src/Layer/layerHost.ts +3 -2
  355. package/src/Layer/outsidePanClaim.ts +50 -8
  356. package/src/Layer/outsidePress.ts +18 -4
  357. package/src/Layer/useLayer.tsx +128 -76
  358. package/src/Lightbox/Lightbox.tsx +15 -0
  359. package/src/MetadataList/MetadataList.tsx +8 -0
  360. package/src/MoreMenu/MoreMenu.doc.mjs +1 -1
  361. package/src/MultiSelector/MultiSelector.doc.mjs +2 -2
  362. package/src/MultiSelector/MultiSelector.tsx +45 -15
  363. package/src/NavIcon/NavIcon.doc.mjs +19 -10
  364. package/src/NavIcon/NavIcon.tsx +3 -2
  365. package/src/NavMenu/NavHeadingMenuItem.tsx +9 -3
  366. package/src/NumberInput/NumberInput.doc.mjs +12 -12
  367. package/src/NumberInput/NumberInput.tsx +12 -15
  368. package/src/NumberInput/numberParser.ts +15 -2
  369. package/src/Overlay/Overlay.doc.mjs +13 -1
  370. package/src/Overlay/OverlayScrim.tsx +45 -15
  371. package/src/Overlay/useOverlay.doc.mjs +7 -7
  372. package/src/Overlay/useOverlay.tsx +1 -1
  373. package/src/Pagination/Pagination.doc.mjs +9 -6
  374. package/src/Pagination/Pagination.tsx +15 -3
  375. package/src/Popover/usePopover.doc.mjs +14 -4
  376. package/src/Popover/usePopover.tsx +180 -23
  377. package/src/PowerSearch/PowerSearch.doc.mjs +165 -15
  378. package/src/PowerSearch/PowerSearch.tsx +6 -8
  379. package/src/PowerSearch/PowerSearchBottomSheet.tsx +182 -223
  380. package/src/PowerSearch/PowerSearchValueEditor.tsx +1 -51
  381. package/src/PowerSearch/formatFilterValue.ts +8 -9
  382. package/src/PowerSearch/formatTokenValue.ts +24 -42
  383. package/src/PowerSearch/relativeDateOptions.ts +84 -0
  384. package/src/ProgressBar/ProgressBar.doc.mjs +24 -5
  385. package/src/ProgressBar/ProgressBar.tsx +28 -18
  386. package/src/Resizable/createResizable.ts +46 -5
  387. package/src/SegmentedControl/SegmentedControlItem.tsx +4 -3
  388. package/src/SelectableCard/SelectableCard.tsx +8 -2
  389. package/src/Selector/Selector.doc.mjs +3 -3
  390. package/src/Selector/Selector.tsx +3 -1
  391. package/src/Selector/SelectorOption.doc.mjs +3 -3
  392. package/src/SideNav/SideNavItem.doc.mjs +6 -6
  393. package/src/SideNav/SideNavItem.tsx +3 -0
  394. package/src/Slider/Slider.tsx +48 -6
  395. package/src/Stepper/Step.tsx +7 -1
  396. package/src/Switch/Switch.doc.mjs +3 -3
  397. package/src/TabList/Tab.tsx +4 -0
  398. package/src/TabList/TabMenu.tsx +4 -0
  399. package/src/Table/BaseTable.tsx +35 -7
  400. package/src/Table/Table.doc.mjs +63 -6
  401. package/src/Table/Table.tsx +9 -4
  402. package/src/Table/TableCell.tsx +5 -2
  403. package/src/Table/TableHeaderCell.tsx +2 -8
  404. package/src/Table/TableRow.tsx +10 -1
  405. package/src/Table/plugins/rowExpansion/useTableRowExpansion.tsx +250 -53
  406. package/src/Table/plugins/rowIndex/useTableRowIndex.tsx +10 -1
  407. package/src/Table/plugins/rowStatus/useTableRowStatus.tsx +5 -0
  408. package/src/Table/plugins/sortable/useTableSortable.tsx +41 -2
  409. package/src/Table/plugins/stickyColumns/useTableStickyColumns.tsx +49 -20
  410. package/src/Table/tableColumnAdmission.ts +23 -0
  411. package/src/Table/types.ts +5 -5
  412. package/src/Table/useTableRowsVirtualization.doc.mjs +2 -2
  413. package/src/Text/Text.tsx +21 -7
  414. package/src/Text/TruncationTooltip.tsx +51 -184
  415. package/src/Text/cutText.tsx +126 -0
  416. package/src/Text/cutTextOnKeyboardFocus.tsx +158 -0
  417. package/src/Text/textClampContext.ts +14 -4
  418. package/src/Text/useTruncation.ts +85 -27
  419. package/src/TextArea/TextArea.doc.mjs +4 -4
  420. package/src/TextInput/TextInput.doc.mjs +3 -3
  421. package/src/Thumbnail/Thumbnail.tsx +1 -1
  422. package/src/TimeInput/TimeInput.tsx +3 -9
  423. package/src/TimeInput/TouchTimeField.tsx +6 -4
  424. package/src/Timestamp/Timestamp.tsx +29 -21
  425. package/src/Timestamp/TimestampHoverCard.tsx +44 -31
  426. package/src/Timestamp/formatInstant.ts +7 -3
  427. package/src/Timestamp/tooltipEntries.ts +4 -2
  428. package/src/Toast/Toast.doc.mjs +24 -37
  429. package/src/Toast/Toast.tsx +77 -29
  430. package/src/Toast/ToastViewport.tsx +33 -13
  431. package/src/Toast/useToast.tsx +42 -15
  432. package/src/Tokenizer/Tokenizer.doc.mjs +2 -2
  433. package/src/Toolbar/Toolbar.tsx +20 -6
  434. package/src/Tooltip/useTooltip.tsx +2 -1
  435. package/src/TopNav/TopNavMegaMenu.doc.mjs +13 -0
  436. package/src/TopNav/TopNavMenu.doc.mjs +2 -0
  437. package/src/Typeahead/Typeahead.doc.mjs +2 -2
  438. package/src/hooks/useAnnounceRenderedText.ts +15 -2
  439. package/src/hooks/useFocusTrap.ts +27 -4
  440. package/src/hooks/useHotkeys.doc.mjs +54 -11
  441. package/src/hooks/useHotkeys.ts +72 -3
  442. package/src/hooks/useInputStatusIcon.tsx +2 -1
  443. package/src/hooks/useKeyboardHint.tsx +3 -2
  444. package/src/i18n/generated-english/DateRangeInput/DateRangeInput.generated.ts +2 -0
  445. package/src/i18n/generated-english/MultiSelector/MultiSelector.generated.ts +1 -0
  446. package/src/i18n/generated-english/PowerSearch/PowerSearchValueEditor.generated.ts +0 -6
  447. package/src/i18n/generated-english/PowerSearch/relativeDateOptions.generated.ts +18 -0
  448. package/src/i18n/generated-english/Slider/Slider.generated.ts +1 -0
  449. package/src/i18n/generated-english/Thumbnail/Thumbnail.generated.ts +1 -0
  450. package/src/i18n/generated-locales/en.generated.ts +5 -0
  451. package/src/i18n/generated-locales/pseudo.generated.ts +5 -0
  452. package/src/i18n/getLocaleDirection.ts +57 -7
  453. package/src/i18n/listFormat.ts +55 -0
  454. package/src/i18n/useListFormatter.ts +22 -13
  455. package/src/internal/module-loader.ts +15 -0
  456. package/src/motion/animatedLayout.ts +215 -28
  457. package/src/palette/color.ts +41 -1
  458. package/src/palette/derive-look.ts +1186 -0
  459. package/src/palette/editor-look.ts +480 -0
  460. package/src/palette/mapping.ts +129 -15
  461. package/src/theme/SyntaxTheme.doc.mjs +1 -1
  462. package/src/theme/tokens.ts +2 -1
  463. package/src/theme/useThemeName.doc.mjs +1 -1
  464. package/src/utils/characters.ts +11 -0
  465. package/src/utils/devWarning.ts +35 -0
  466. package/src/utils/focusReturn.ts +3 -11
  467. package/src/utils/hitArea.ts +87 -18
  468. package/src/utils/mergeProps.ts +57 -34
  469. package/src/utils/scrollView.ts +3 -2
  470. package/src/utils/textDirection.ts +65 -5
  471. package/src/utils/themeProps.ts +22 -3
  472. package/src/utils/touchHitArea.ts +3 -2
  473. package/src/virtualization/useInlineListWindow.ts +102 -11
@@ -6,9 +6,9 @@
6
6
  * @file inputHold.ts
7
7
  * @input A layer root, what ends its hold (a promise or an animator handle),
8
8
  * and the hold's scope
9
- * @output holdInput, holdsTouch, isInHeldLayer and isInputShield: input held
10
- * away from a layer while it presents or dismisses, or while it dismisses
11
- * with focus kept inside
9
+ * @output holdInput, holdsTouch, isInHeldLayer, isInputShield, LATE_PRESS_MS
10
+ * and LATE_RELEASE_FRAMES: input held away from a layer while it presents
11
+ * or dismisses, or while it dismisses with focus kept inside
12
12
  * @position The Layer module's one input hold, for components whose layer
13
13
  * presents under a finger
14
14
  *
@@ -17,6 +17,7 @@
17
17
  */
18
18
  import { containsAlongFlatTree, deepActiveElement, parentAcrossShadow } from "../utils/flatTree.js";
19
19
  import { getDownPresses, getLastMousePoint, getLastPointerType, subscribeInput } from "../utils/inputStream.js";
20
+ import { timeOn } from "../utils/inputAge.js";
20
21
  import { isDocument, isElement, isHTMLElement, isNode } from "../utils/nodeType.js";
21
22
  import { observeMutations } from "../utils/sharedMutationObserver.js";
22
23
  import { realmValue, sharedKey } from "../utils/sharedRealm.js";
@@ -39,6 +40,8 @@ import { notifyTopLayerEntry } from "./modalOutlet.js";
39
40
 
40
41
  /** A document's press hold, while its window listeners are on. */
41
42
 
43
+ /** A hold that has ended: what it held, and when it began and ended. */
44
+
42
45
  // Registered, so the gesture host sees the layer holds of a swizzled copy as
43
46
  // it does the package's.
44
47
  const {
@@ -416,6 +419,8 @@ export function holdInput(layer, {
416
419
  openToEarlierPresses(state, layer.ownerDocument);
417
420
  }
418
421
  openToMouse(state, layer.ownerDocument);
422
+ const clock = layer.ownerDocument.defaultView?.performance;
423
+ const from = clock?.now() ?? 0;
419
424
  let isReleased = false;
420
425
  const release = () => {
421
426
  if (isReleased) {
@@ -426,6 +431,12 @@ export function holdInput(layer, {
426
431
  if (current == null) {
427
432
  return;
428
433
  }
434
+ pressHolds.get(layer.ownerDocument)?.ended({
435
+ layer,
436
+ scope,
437
+ from,
438
+ to: clock?.now() ?? from
439
+ });
429
440
  if (scope === 'viewport') {
430
441
  current.viewport -= 1;
431
442
  } else if (scope === 'surface') {
@@ -568,6 +579,24 @@ const CLICK_WINDOW_MS = 800;
568
579
 
569
580
  /** How long a held press is followed past the hold's end, at most. */
570
581
  const STRAY_PRESS_MS = 10_000;
582
+
583
+ /**
584
+ * How long after a hold ends a press that went down during it can still
585
+ * arrive, at most. A busy main thread dispatches a press late, after the
586
+ * task that ended the hold.
587
+ */
588
+ export const LATE_PRESS_MS = 500;
589
+
590
+ /**
591
+ * A release waits for late presses only after a long task. In a long task,
592
+ * the page draws no frame for more than this many of the hold's frame
593
+ * intervals. The release runs in that task or in the frame that ends it.
594
+ * The engine can dispatch input from that task after either.
595
+ */
596
+ export const LATE_RELEASE_FRAMES = 2;
597
+
598
+ /** The frame interval of a hold that sees fewer than two frames. */
599
+ const DEFAULT_FRAME_MS = 1000 / 60;
571
600
  const POINTER_EVENTS = ['pointerdown', 'pointermove', 'pointerup', 'pointercancel'];
572
601
  const TOUCH_EVENTS = ['touchstart', 'touchmove', 'touchend', 'touchcancel'];
573
602
  const PRESS_EVENTS = ['mousedown', 'mouseup', 'click', 'auxclick', 'dblclick', 'contextmenu'];
@@ -584,15 +613,36 @@ function pressHoldFor(doc) {
584
613
  return hold;
585
614
  }
586
615
 
616
+ /**
617
+ * Whether a hold of `scope` on `layer` holds a new press on `target`. Over
618
+ * the viewport, a press anywhere is held, and so is one during a dismissal,
619
+ * except one in another layer inside the dismissing layer. A `'surface'`
620
+ * hold holds only a press on the layer.
621
+ */
622
+ function isPressHeldBy(scope, layer, target) {
623
+ if (scope === 'viewport') {
624
+ return true;
625
+ }
626
+ if (scope === 'layer') {
627
+ return !(isNode(target) && isInNestedLayer(target, layer));
628
+ }
629
+ return isNode(target) && containsAlongFlatTree(layer, target);
630
+ }
631
+
587
632
  /**
588
633
  * Holds each finger or pen press that lands in `doc`'s window while any of
589
634
  * its layers is held. Each press is held to its own end, even past the
590
- * hold's end. A moving mouse passes through a presentation's shield. The
635
+ * hold's end. A press is judged by the time its event gives, when the finger
636
+ * went down. So a press that went down during a hold is held, though the
637
+ * engine dispatches it after the hold's end. That wait follows only a release
638
+ * in a long task, which the hold reads from the frames that the page draws
639
+ * while it holds. A moving mouse passes through a presentation's shield. The
591
640
  * hold hears input through the shared input stream, before its other
592
641
  * subscribers, and stops each held event there. So no document or element
593
642
  * listener hears it, and neither does press feedback or the gesture host.
594
- * There is one per document. Its subscriptions end once nothing is held and
595
- * the held presses and their clicks have ended.
643
+ * There is one per document. Its subscriptions end once nothing is held, the
644
+ * held presses and their clicks have ended, and no late press can still
645
+ * arrive.
596
646
  */
597
647
  function createPressHold(doc) {
598
648
  const view = doc.defaultView;
@@ -609,9 +659,64 @@ function createPressHold(doc) {
609
659
  let lastPress = null;
610
660
  /** Until when a click with no pointer type is a held press's. */
611
661
  let clickUntil = -Infinity;
662
+ /** Ended holds whose late presses can still arrive. */
663
+ const endedHolds = [];
664
+ /** Ends the watch for those holds' layers leaving the document. */
665
+ let stopWatchingLayers = null;
612
666
  let timer;
667
+ /** When the last frame began while a layer was held, or the hold began. */
668
+ let lastFrameAt = view.performance.now();
669
+ /** When the frame before the last one began. */
670
+ let frameBeforeAt = null;
671
+ /** The gaps between the latest frames, eight at most. */
672
+ const frameGaps = [];
673
+ let frameRequest = null;
613
674
  const now = () => view.performance.now();
614
675
  const isPressDown = () => pointers.size > 0 || touches.size > 0;
676
+
677
+ /** Notes each frame the page draws while a layer is held. */
678
+ const watchFrames = () => {
679
+ if (frameRequest != null || typeof view.requestAnimationFrame !== 'function') {
680
+ return;
681
+ }
682
+ frameRequest = view.requestAnimationFrame(frameTime => {
683
+ frameRequest = null;
684
+ // A layer that left the document ends its hold here.
685
+ if (!isListening || !holdsNewPress()) {
686
+ return;
687
+ }
688
+ const at = Math.min(frameTime, now());
689
+ if (frameBeforeAt != null) {
690
+ frameGaps.push(at - lastFrameAt);
691
+ if (frameGaps.length > 8) {
692
+ frameGaps.shift();
693
+ }
694
+ }
695
+ frameBeforeAt = lastFrameAt;
696
+ lastFrameAt = at;
697
+ watchFrames();
698
+ });
699
+ };
700
+ const stopWatchingFrames = () => {
701
+ if (frameRequest != null) {
702
+ view.cancelAnimationFrame?.(frameRequest);
703
+ frameRequest = null;
704
+ }
705
+ };
706
+
707
+ /**
708
+ * Whether a long task runs now, or ended with the frame that runs now. In
709
+ * it, the page draws no frame for more than LATE_RELEASE_FRAMES of the
710
+ * hold's frame intervals.
711
+ */
712
+ const isAfterLongTask = () => {
713
+ const gaps = [...frameGaps].sort((a, b) => a - b);
714
+ const interval = gaps.length > 0 ? gaps[Math.floor(gaps.length / 2)] : DEFAULT_FRAME_MS;
715
+ const longest = LATE_RELEASE_FRAMES * interval;
716
+ const sinceFrame = now() - lastFrameAt;
717
+ const endsLongGap = frameBeforeAt != null && sinceFrame <= interval && lastFrameAt - frameBeforeAt > longest;
718
+ return sinceFrame > longest || endsLongGap;
719
+ };
615
720
  const swallow = event => {
616
721
  if (event.cancelable) {
617
722
  event.preventDefault();
@@ -631,7 +736,8 @@ function createPressHold(doc) {
631
736
  timer = setTimeout(stop, STRAY_PRESS_MS);
632
737
  return;
633
738
  }
634
- const wait = clickUntil - now();
739
+ const lateUntil = Math.max(-Infinity, ...endedHolds.map(hold => hold.to + LATE_PRESS_MS));
740
+ const wait = Math.max(clickUntil, lateUntil) - now();
635
741
  if (wait > 0) {
636
742
  timer = setTimeout(stop, wait);
637
743
  } else {
@@ -639,6 +745,64 @@ function createPressHold(doc) {
639
745
  }
640
746
  };
641
747
 
748
+ /**
749
+ * When an input happened, on the page's clock. A wall-clock stamp keeps its
750
+ * age (`timeOn`). An input with no time, or a time ahead of now, counts as
751
+ * now.
752
+ */
753
+ const timeOfInput = event => Math.min(timeOn(view.performance, event.timeStamp) ?? now(), now());
754
+
755
+ /**
756
+ * Input from at or after a hold's end comes after every press that went
757
+ * down during that hold. So no late press of that hold is left.
758
+ */
759
+ const noteInputAt = time => {
760
+ if (forgetEndedHolds(hold => time >= hold.to)) {
761
+ settle();
762
+ }
763
+ };
764
+
765
+ /**
766
+ * Forgets each ended hold that `isDone` names, and each one past its late
767
+ * window. Returns whether it forgot one.
768
+ */
769
+ const forgetEndedHolds = isDone => {
770
+ const count = endedHolds.length;
771
+ for (let index = count - 1; index >= 0; index--) {
772
+ const hold = endedHolds[index];
773
+ if (isDone(hold) || now() > hold.to + LATE_PRESS_MS || !hold.layer.isConnected) {
774
+ endedHolds.splice(index, 1);
775
+ }
776
+ }
777
+ if (endedHolds.length === 0) {
778
+ stopWatchingLayers?.();
779
+ stopWatchingLayers = null;
780
+ }
781
+ return endedHolds.length < count;
782
+ };
783
+
784
+ /**
785
+ * A late press belongs to a layer still on the page. Once the layers of the
786
+ * ended holds have all left it, nothing waits for one.
787
+ */
788
+ const watchLayers = () => {
789
+ stopWatchingLayers ??= observeMutations(doc, {
790
+ childList: true,
791
+ subtree: true
792
+ }, () => {
793
+ if (forgetEndedHolds(() => false)) {
794
+ settle();
795
+ }
796
+ });
797
+ };
798
+
799
+ /**
800
+ * Whether a press that went down at `time` landed during a hold that has
801
+ * since ended, where that hold held a press on `target`. The press arrives
802
+ * at most LATE_PRESS_MS after that end.
803
+ */
804
+ const wasHeldAt = (target, time) => endedHolds.some(hold => hold.from <= time && time < hold.to && now() <= hold.to + LATE_PRESS_MS && isPressHeldBy(hold.scope, hold.layer, target));
805
+
642
806
  /** Whether a layer is still held (one that left the document is not). */
643
807
  const holdsNewPress = () => {
644
808
  if (isHolding) {
@@ -663,10 +827,7 @@ function createPressHold(doc) {
663
827
  if (state == null) {
664
828
  continue;
665
829
  }
666
- if (state.viewport > 0 || state.layer > 0 && !(isNode(target) && isInNestedLayer(target, layer))) {
667
- return true;
668
- }
669
- if (state.surface > 0 && isNode(target) && containsAlongFlatTree(layer, target)) {
830
+ if (state.viewport > 0 && isPressHeldBy('viewport', layer, target) || state.layer > 0 && isPressHeldBy('layer', layer, target) || state.surface > 0 && isPressHeldBy('surface', layer, target)) {
670
831
  return true;
671
832
  }
672
833
  }
@@ -737,6 +898,8 @@ function createPressHold(doc) {
737
898
  pointerType,
738
899
  type
739
900
  } = event;
901
+ const time = timeOfInput(event);
902
+ noteInputAt(time);
740
903
  if (HELD_POINTERS.has(pointerType) && type !== 'pointerdown' && !pointers.has(pointerId)) {
741
904
  followEarlierPress(event);
742
905
  }
@@ -749,7 +912,8 @@ function createPressHold(doc) {
749
912
  followPointer(pointerType);
750
913
  }
751
914
  if (type === 'pointerdown') {
752
- if (!HELD_POINTERS.has(pointerType) || !holdsPressAt(event.target)) {
915
+ const isHeld = HELD_POINTERS.has(pointerType) && (holdsPressAt(event.target) || wasHeldAt(event.target, time));
916
+ if (!isHeld) {
753
917
  // A mouse's press, or one after the hold: its click is its own, and a
754
918
  // held press with its id ended unheard.
755
919
  pointers.delete(pointerId);
@@ -760,6 +924,8 @@ function createPressHold(doc) {
760
924
  }
761
925
  pointers.add(pointerId);
762
926
  lastPress = 'held';
927
+ // A late press is held to its end: no stop runs while it is down.
928
+ settle();
763
929
  captureToShield(event);
764
930
  } else if (!pointers.has(pointerId)) {
765
931
  return false;
@@ -779,6 +945,8 @@ function createPressHold(doc) {
779
945
  touches: down,
780
946
  type
781
947
  } = event;
948
+ const time = timeOfInput(event);
949
+ noteInputAt(time);
782
950
  const changed = Array.from(changedTouches);
783
951
  if (type === 'touchstart') {
784
952
  // A held touch that the screen no longer has ended unheard. Its target,
@@ -790,7 +958,7 @@ function createPressHold(doc) {
790
958
  touches.delete(identifier);
791
959
  }
792
960
  }
793
- const heldTouches = changed.filter(touch => holdsPressAt(touch.target));
961
+ const heldTouches = changed.filter(touch => holdsPressAt(touch.target) || wasHeldAt(touch.target, time));
794
962
  if (heldTouches.length === 0) {
795
963
  // A touch after the hold, or one beside a layer held only to its
796
964
  // box, is a new one, whatever its identifier.
@@ -806,6 +974,7 @@ function createPressHold(doc) {
806
974
  touches.add(touch.identifier);
807
975
  }
808
976
  lastPress = 'held';
977
+ settle();
809
978
  // Never canceled: canceling a touch's start would cancel the page's
810
979
  // pinch-zoom with it.
811
980
  event.stopImmediatePropagation();
@@ -831,6 +1000,7 @@ function createPressHold(doc) {
831
1000
  return true;
832
1001
  };
833
1002
  const onPress = event => {
1003
+ noteInputAt(timeOfInput(event));
834
1004
  // A click a key or assistive technology sends counts no press.
835
1005
  if (event.detail === 0) {
836
1006
  return false;
@@ -859,6 +1029,10 @@ function createPressHold(doc) {
859
1029
  if (timer !== undefined) {
860
1030
  clearTimeout(timer);
861
1031
  }
1032
+ stopWatchingFrames();
1033
+ stopWatchingLayers?.();
1034
+ stopWatchingLayers = null;
1035
+ endedHolds.length = 0;
862
1036
  for (const unsubscribe of unsubscribers.splice(0)) {
863
1037
  unsubscribe();
864
1038
  }
@@ -880,21 +1054,36 @@ function createPressHold(doc) {
880
1054
  }))];
881
1055
  const pressHold = {
882
1056
  hold() {
1057
+ if (!isHolding) {
1058
+ lastFrameAt = now();
1059
+ frameBeforeAt = null;
1060
+ }
883
1061
  isHolding = true;
884
1062
  if (timer !== undefined) {
885
1063
  clearTimeout(timer);
886
1064
  timer = undefined;
887
1065
  }
1066
+ watchFrames();
888
1067
  },
889
1068
  release() {
890
1069
  if (!isHolding) {
891
1070
  return;
892
1071
  }
893
1072
  isHolding = false;
1073
+ stopWatchingFrames();
894
1074
  settle();
895
1075
  },
896
- holds: pointerId => pointers.has(pointerId)
1076
+ holds: pointerId => pointers.has(pointerId),
1077
+ ended(hold) {
1078
+ forgetEndedHolds(() => false);
1079
+ if (!isAfterLongTask() || !hold.layer.isConnected) {
1080
+ return;
1081
+ }
1082
+ endedHolds.push(hold);
1083
+ watchLayers();
1084
+ }
897
1085
  };
1086
+ watchFrames();
898
1087
  return pressHold;
899
1088
  }
900
1089
 
@@ -12,8 +12,9 @@
12
12
  * and custom properties; `document.body` may sit outside a nested scope.
13
13
  * - **Tab order.** Sequential focus follows DOM order, so a host near the
14
14
  * trigger keeps the layer's focusables next to it. (`show()` also passes
15
- * the trigger as the popover's invoker `source`, which pins focus order to
16
- * the invoker in browsers that support it.)
15
+ * an invoker `source`, the trigger unless the layer names another element
16
+ * or none, which pins focus order to the invoker in browsers that support
17
+ * it.)
17
18
  *
18
19
  * The outermost unsafe ancestor matters up to the nearest native dialog. A safe
19
20
  * div may itself sit inside an anchor; stopping at that div would still put the
@@ -1 +1 @@
1
- {"version":3,"file":"layerHost.d.ts","sourceRoot":"","sources":["../../src/Layer/layerHost.ts"],"names":[],"mappings":"AAwGA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,wBAAwB,CACtC,YAAY,EAAE,WAAW,GAAG,IAAI,GAC/B,WAAW,GAAG,IAAI,CA+BpB"}
1
+ {"version":3,"file":"layerHost.d.ts","sourceRoot":"","sources":["../../src/Layer/layerHost.ts"],"names":[],"mappings":"AAwGA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,wBAAwB,CACtC,YAAY,EAAE,WAAW,GAAG,IAAI,GAC/B,WAAW,GAAG,IAAI,CA+BpB"}
@@ -58,8 +58,9 @@ const UNSAFE_HOSTS = new Set([
58
58
  * and custom properties; `document.body` may sit outside a nested scope.
59
59
  * - **Tab order.** Sequential focus follows DOM order, so a host near the
60
60
  * trigger keeps the layer's focusables next to it. (`show()` also passes
61
- * the trigger as the popover's invoker `source`, which pins focus order to
62
- * the invoker in browsers that support it.)
61
+ * an invoker `source`, the trigger unless the layer names another element
62
+ * or none, which pins focus order to the invoker in browsers that support
63
+ * it.)
63
64
  *
64
65
  * The outermost unsafe ancestor matters up to the nearest native dialog. A safe
65
66
  * div may itself sit inside an anchor; stopping at that div would still put the
@@ -8,4 +8,21 @@
8
8
  * dismiss from it. Returns the function that stops watching.
9
9
  */
10
10
  export declare function watchOutsidePans(layer: HTMLElement): () => void;
11
+ /**
12
+ * Closes a manual popover for a press that starts and ends outside it. Its
13
+ * trigger counts as inside, so the trigger's own toggle answers a press on
14
+ * it. A press in a modal dialog that does not hold the layer belongs to that
15
+ * dialog. A touch pan is not a press. Returns the function that stops
16
+ * watching.
17
+ *
18
+ * @param layer - The open popover's layer element.
19
+ * @param triggerRef - The popover's trigger, if it has one.
20
+ * @param closesRef - Whether a press outside closes the popover now.
21
+ * @param dismiss - Closes the popover for a press outside it.
22
+ */
23
+ export declare function watchOutsidePresses(layer: HTMLElement, triggerRef: {
24
+ readonly current: Element | null;
25
+ }, closesRef: {
26
+ readonly current: boolean;
27
+ }, dismiss: () => void): () => void;
11
28
  //# sourceMappingURL=outsidePanClaim.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"outsidePanClaim.d.ts","sourceRoot":"","sources":["../../src/Layer/outsidePanClaim.ts"],"names":[],"mappings":"AAsBA;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,IAAI,CAgB/D"}
1
+ {"version":3,"file":"outsidePanClaim.d.ts","sourceRoot":"","sources":["../../src/Layer/outsidePanClaim.ts"],"names":[],"mappings":"AA8BA;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,IAAI,CAe/D;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,WAAW,EAClB,UAAU,EAAE;IAAC,QAAQ,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAAA;CAAC,EAC9C,SAAS,EAAE;IAAC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;CAAC,EACtC,OAAO,EAAE,MAAM,IAAI,GAClB,MAAM,IAAI,CAgBZ"}
@@ -4,21 +4,29 @@
4
4
 
5
5
  /**
6
6
  * @file outsidePanClaim.ts
7
- * @input An open auto layer; touches through Layer's outside-press watch
8
- * @output watchOutsidePans: claims for the layer a touch outside it that
9
- * begins a pan the browser could take as a scroll, until stopped
10
- * @position Internal to Layer. usePopover passes it to useLayer
11
- * (`watchesOutsidePans`), so a layer that never light-dismisses, such as
7
+ * @input An open layer; pointers through Layer's outside-press watch
8
+ * @output watchOutsidePans: claims for an auto layer a touch outside it that
9
+ * begins a pan the browser could take as a scroll, until stopped.
10
+ * watchOutsidePresses: closes a manual popover for a press outside it
11
+ * @position Internal to Layer. usePopover passes one of them to useLayer
12
+ * (`watchesOutside`), so a layer that never light-dismisses, such as
12
13
  * Carousel's, bundles none of it
13
14
  */
14
15
  import { claimPress } from "./gestureCounter.js";
15
16
  import { watchOutsidePress } from "./outsidePress.js";
16
17
  import { armClickGuard } from "../utils/clickGuard.js";
17
- import { isShadowRoot } from "../utils/nodeType.js";
18
+ import { containsAlongFlatTree } from "../utils/flatTree.js";
19
+ import { isModalDialog, isShadowRoot } from "../utils/nodeType.js";
18
20
 
19
21
  /** A layer the browser light-dismisses learns only of pans outside it. */
20
22
  function reportsNoOutsidePress() {}
21
23
 
24
+ /** The shadow root `layer` renders in, if any. */
25
+ function shadowRootOf(layer) {
26
+ const root = layer.getRootNode();
27
+ return isShadowRoot(root) ? root : null;
28
+ }
29
+
22
30
  /**
23
31
  * Claims for `layer` each touch that starts outside it and begins a pan the
24
32
  * browser could take as a scroll. Such a touch is a gesture, not an outside
@@ -29,14 +37,34 @@ function reportsNoOutsidePress() {}
29
37
  * dismiss from it. Returns the function that stops watching.
30
38
  */
31
39
  export function watchOutsidePans(layer) {
32
- const root = layer.getRootNode();
33
40
  return watchOutsidePress(layer, path => path.includes(layer), reportsNoOutsidePress, {
34
41
  pointerTypes: ['touch'],
35
- root: isShadowRoot(root) ? root : null,
42
+ root: shadowRootOf(layer),
36
43
  onPan: () => claimPress(layer, {
37
44
  onRelease: () => armClickGuard(layer.ownerDocument, {
38
45
  cancelsTouchEnd: true
39
46
  })
40
47
  })
41
48
  });
49
+ }
50
+
51
+ /**
52
+ * Closes a manual popover for a press that starts and ends outside it. Its
53
+ * trigger counts as inside, so the trigger's own toggle answers a press on
54
+ * it. A press in a modal dialog that does not hold the layer belongs to that
55
+ * dialog. A touch pan is not a press. Returns the function that stops
56
+ * watching.
57
+ *
58
+ * @param layer - The open popover's layer element.
59
+ * @param triggerRef - The popover's trigger, if it has one.
60
+ * @param closesRef - Whether a press outside closes the popover now.
61
+ * @param dismiss - Closes the popover for a press outside it.
62
+ */
63
+ export function watchOutsidePresses(layer, triggerRef, closesRef, dismiss) {
64
+ return watchOutsidePress(layer, path => !closesRef.current || path.includes(layer) || path.includes(triggerRef.current) ||
65
+ // Only a dialog element passes the check.
66
+ path.some(target => isModalDialog(target) && !containsAlongFlatTree(target, layer)), dismiss, {
67
+ ignoresPans: true,
68
+ root: shadowRootOf(layer)
69
+ });
42
70
  }
@@ -17,6 +17,12 @@ export interface OutsidePressOptions {
17
17
  * `closesOnPan`.
18
18
  */
19
19
  readonly onPan?: () => void;
20
+ /**
21
+ * A touch or pen press outside that pans past the shared pan distance is a
22
+ * gesture, not a press: its lift calls no `onOutside`. Ignored with
23
+ * `closesOnPan` or `onPan`.
24
+ */
25
+ readonly ignoresPans?: boolean;
20
26
  /**
21
27
  * Called as each press the watch follows begins, with whether it is
22
28
  * inside. The watch then judges no lift: a press that starts and ends
@@ -47,7 +53,7 @@ export declare function outsideDismissalCount(doc: Document): number;
47
53
  * pans or is cancelled.
48
54
  * @returns Stops watching.
49
55
  */
50
- export declare function watchOutsidePress(owner: Element, isInside: (path: ReadonlyArray<EventTarget>) => boolean, onOutside: () => void, { pointerTypes, closesOnPan, onPan, onPress, root, }?: OutsidePressOptions): () => void;
56
+ export declare function watchOutsidePress(owner: Element, isInside: (path: ReadonlyArray<EventTarget>) => boolean, onOutside: () => void, { pointerTypes, closesOnPan, onPan, onPress, ignoresPans, root, }?: OutsidePressOptions): () => void;
51
57
  export interface OutsidePressWatch {
52
58
  /** Start watching, replacing any watch already running. */
53
59
  start: (owner: Element, isInside: (path: ReadonlyArray<EventTarget>) => boolean, onOutside: () => void, options?: OutsidePressOptions) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"outsidePress.d.ts","sourceRoot":"","sources":["../../src/Layer/outsidePress.ts"],"names":[],"mappings":"AAwBA,MAAM,WAAW,mBAAmB;IAClC,oEAAoE;IACpE,QAAQ,CAAC,YAAY,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAC9C;;;;OAIG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;IAC/B;;;;;;;;OAQG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B;;;;;OAKG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IAC/C;;;;OAIG;IACH,QA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I,EAAE,MAAM,IAAI,CAAC;CAClB;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,IAAI,iBAAiB,CAgBnD;AAgBD;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,aAAa,CAAC,WAAW,CAAC,EAChC,KAAK,EAAE,OAAO,EACd,OAAO,EAAE,MAAM,GACd,OAAO,CAST;AAED;;;;;;;;;GASG;AACH,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,WAAW,GAAG,IAAI,EACxB,KAAK,EAAE,OAAO,GAAG,IAAI,GAAG,SAAS,EACjC,OAAO,EAAE,MAAM,GACd,OAAO,CAKT"}
@@ -51,11 +51,13 @@ export function watchOutsidePress(owner, isInside, onOutside, {
51
51
  closesOnPan = false,
52
52
  onPan,
53
53
  onPress,
54
+ ignoresPans = false,
54
55
  root = null
55
56
  } = {}) {
56
57
  const doc = owner.ownerDocument;
57
58
  const reportPan = closesOnPan ? undefined : onPan;
58
- const followsPans = closesOnPan || reportPan != null;
59
+ const skipsPans = ignoresPans && !closesOnPan && reportPan == null;
60
+ const followsPans = closesOnPan || reportPan != null || skipsPans;
59
61
  const shadows = root == null ? [] : shadowRootsOutward(root);
60
62
  let startedOutside = false;
61
63
  let panStart = null;
@@ -80,7 +82,7 @@ export function watchOutsidePress(owner, isInside, onOutside, {
80
82
  startedOutside = !isInside(event.composedPath());
81
83
  onPress?.(!startedOutside);
82
84
  if (followsPans) {
83
- panStart = startedOutside ? {
85
+ panStart = startedOutside && !(skipsPans && event.pointerType === 'mouse') ? {
84
86
  id: event.pointerId,
85
87
  x: event.clientX,
86
88
  y: event.clientY
@@ -99,6 +101,11 @@ export function watchOutsidePress(owner, isInside, onOutside, {
99
101
  }
100
102
  return;
101
103
  }
104
+ if (skipsPans) {
105
+ startedOutside = false;
106
+ panStart = null;
107
+ return;
108
+ }
102
109
  close();
103
110
  }
104
111
  };
@@ -284,12 +284,16 @@ interface InternalContextLayerOptions extends ContextLayerOptions {
284
284
  */
285
285
  onCloseStart?: () => void;
286
286
  /**
287
- * Watches the open layer for touches outside it that pan; returns the
288
- * function that stops watching. A light-dismiss layer is given one by its
289
- * owner (usePopover's `watchOutsidePans`). An anchored menu, which closes
290
- * as such a pan begins, is given none.
287
+ * Watches the open layer for pointers outside it; returns the function
288
+ * that stops watching. The layer starts it as it opens and stops it as it
289
+ * closes. A light-dismiss layer is given a pan watch by its owner
290
+ * (usePopover's `watchOutsidePans`), and a `'pageOrder'` popover its
291
+ * outside-press watch. An anchored menu, which closes as a pan begins, is
292
+ * given none. `dismiss` closes the layer for a press outside it and
293
+ * absorbs a `show()` from that same press, as the browser's light dismiss
294
+ * does.
291
295
  */
292
- watchesOutsidePans?: (layer: HTMLElement) => () => void;
296
+ watchesOutside?: (layer: HTMLElement, dismiss: () => void) => () => void;
293
297
  /**
294
298
  * Called with true when a `show()` that the layer accepted starts to wait
295
299
  * for a valid anchor, and with false when that wait ends. The owner reads
@@ -319,7 +323,19 @@ interface InternalContextLayerOptions extends ContextLayerOptions {
319
323
  * again here.
320
324
  */
321
325
  onPlacedAfresh?: () => void;
326
+ /**
327
+ * The element whose place in the sequential focus order the open layer
328
+ * takes, passed to `showPopover({source})`. Defaults to the trigger. Return
329
+ * null for a layer that takes its own DOM place.
330
+ */
331
+ getInvoker?: () => HTMLElement | null;
322
332
  }
333
+ /**
334
+ * `getInvoker` for a layer that holds nothing to focus, such as a tooltip or
335
+ * a hint. When a popover that names an invoker hides, the browser also drops
336
+ * the focus-order place of another open popover that names the same invoker.
337
+ */
338
+ export declare const noInvoker: () => null;
323
339
  /**
324
340
  * Compute the `position-try-fallbacks` list for a placement. Chromium tries
325
341
  * no more than five options after the layer's own position.
@@ -1 +1 @@
1
- {"version":3,"file":"useLayer.d.ts","sourceRoot":"","sources":["../../src/Layer/useLayer.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,EAQZ,KAAK,SAAS,EACd,KAAK,WAAW,EACjB,MAA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