@astryxdesign/core 0.7.11 → 0.7.12-canary.ccb4a6d

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 (533) hide show
  1. package/dist/AppShell/AppShellMobileContext.d.ts.map +1 -1
  2. package/dist/AppShell/AppShellMobileContext.js +4 -3
  3. package/dist/AppShell/useAppShellMainId.d.ts.map +1 -1
  4. package/dist/AppShell/useAppShellMainId.js +3 -2
  5. package/dist/Avatar/AvatarSizeContext.d.ts.map +1 -1
  6. package/dist/Avatar/AvatarSizeContext.js +2 -2
  7. package/dist/Avatar/AvatarStatusLabelContext.d.ts +2 -2
  8. package/dist/Avatar/AvatarStatusLabelContext.d.ts.map +1 -1
  9. package/dist/Avatar/AvatarStatusLabelContext.js +3 -3
  10. package/dist/AvatarGroup/AvatarGroupContext.d.ts.map +1 -1
  11. package/dist/AvatarGroup/AvatarGroupContext.js +2 -2
  12. package/dist/BottomSheet/BottomSheetHostContext.d.ts.map +1 -1
  13. package/dist/BottomSheet/BottomSheetHostContext.js +3 -2
  14. package/dist/BottomSheet/BottomSheetPanel.d.ts.map +1 -1
  15. package/dist/BottomSheet/BottomSheetPanel.js +48 -4
  16. package/dist/BottomSheet/BottomSheetSwitcherContext.d.ts.map +1 -1
  17. package/dist/BottomSheet/BottomSheetSwitcherContext.js +2 -2
  18. package/dist/BottomSheet/bottomSheetEscape.d.ts.map +1 -1
  19. package/dist/BottomSheet/bottomSheetEscape.js +2 -2
  20. package/dist/BottomSheet/bottomSheetStack.d.ts.map +1 -1
  21. package/dist/BottomSheet/bottomSheetStack.js +2 -13
  22. package/dist/BottomSheet/useSheetGestures.d.ts.map +1 -1
  23. package/dist/BottomSheet/useSheetGestures.js +25 -42
  24. package/dist/Breadcrumbs/Breadcrumbs.d.ts.map +1 -1
  25. package/dist/Breadcrumbs/Breadcrumbs.js +2 -2
  26. package/dist/Button/Button.d.ts.map +1 -1
  27. package/dist/Button/Button.js +12 -21
  28. package/dist/Button/buttonHitArea.d.ts.map +1 -1
  29. package/dist/Button/buttonHitArea.js +3 -3
  30. package/dist/ButtonGroup/ButtonGroup.d.ts.map +1 -1
  31. package/dist/ButtonGroup/ButtonGroup.js +13 -7
  32. package/dist/ButtonGroup/ButtonGroupContext.d.ts.map +1 -1
  33. package/dist/ButtonGroup/ButtonGroupContext.js +2 -2
  34. package/dist/Carousel/Carousel.d.ts.map +1 -1
  35. package/dist/Carousel/Carousel.js +24 -15
  36. package/dist/Chat/ChatContext.d.ts.map +1 -1
  37. package/dist/Chat/ChatContext.js +6 -5
  38. package/dist/Chat/useChatStreamScroll.d.ts.map +1 -1
  39. package/dist/Chat/useChatStreamScroll.js +7 -22
  40. package/dist/CheckboxInput/CheckboxRowPressContext.d.ts.map +1 -1
  41. package/dist/CheckboxInput/CheckboxRowPressContext.js +1 -1
  42. package/dist/CheckboxList/CheckboxListContext.d.ts.map +1 -1
  43. package/dist/CheckboxList/CheckboxListContext.js +1 -1
  44. package/dist/Collapsible/CollapsibleGroupContext.d.ts.map +1 -1
  45. package/dist/Collapsible/CollapsibleGroupContext.js +3 -3
  46. package/dist/CommandPalette/CommandPaletteContext.d.ts.map +1 -1
  47. package/dist/CommandPalette/CommandPaletteContext.js +4 -3
  48. package/dist/CommandPalette/busyStartSettle.d.ts.map +1 -1
  49. package/dist/CommandPalette/busyStartSettle.js +2 -2
  50. package/dist/DateInput/TouchDateField.d.ts.map +1 -1
  51. package/dist/DateInput/TouchDateField.js +41 -4
  52. package/dist/Dialog/DialogContext.d.ts.map +1 -1
  53. package/dist/Dialog/DialogContext.js +3 -2
  54. package/dist/DropdownMenu/DropdownMenuContext.d.ts.map +1 -1
  55. package/dist/DropdownMenu/DropdownMenuContext.js +6 -5
  56. package/dist/DropdownMenu/lazyMenuBottomSheet.d.ts.map +1 -1
  57. package/dist/DropdownMenu/lazyMenuBottomSheet.js +4 -15
  58. package/dist/DropdownMenu/menuRegionStops.d.ts.map +1 -1
  59. package/dist/DropdownMenu/menuRegionStops.js +2 -37
  60. package/dist/FormLayout/FormLayoutContext.d.ts.map +1 -1
  61. package/dist/FormLayout/FormLayoutContext.js +2 -2
  62. package/dist/Heading/Heading.d.ts.map +1 -1
  63. package/dist/Heading/Heading.js +19 -16
  64. package/dist/HoverCard/HoverCard.d.ts +1 -2
  65. package/dist/HoverCard/HoverCard.d.ts.map +1 -1
  66. package/dist/HoverCard/useHoverCard.d.ts +1 -2
  67. package/dist/HoverCard/useHoverCard.d.ts.map +1 -1
  68. package/dist/HoverCard/useHoverCard.js +5 -1
  69. package/dist/Icon/IconDefaultSizeContext.d.ts.map +1 -1
  70. package/dist/Icon/IconDefaultSizeContext.js +2 -2
  71. package/dist/InputGroup/InputGroupContext.d.ts.map +1 -1
  72. package/dist/InputGroup/InputGroupContext.js +2 -2
  73. package/dist/InputGroup/InputGroupInternalContext.d.ts.map +1 -1
  74. package/dist/InputGroup/InputGroupInternalContext.js +2 -2
  75. package/dist/InteractiveRoleContext/InteractiveRoleContext.d.ts.map +1 -1
  76. package/dist/InteractiveRoleContext/InteractiveRoleContext.js +5 -3
  77. package/dist/Item/ItemDescriptionContext.d.ts.map +1 -1
  78. package/dist/Item/ItemDescriptionContext.js +3 -3
  79. package/dist/Item/ItemListRowContext.d.ts.map +1 -1
  80. package/dist/Item/ItemListRowContext.js +3 -3
  81. package/dist/Item/ItemMarkerColumnsContext.d.ts +1 -1
  82. package/dist/Item/ItemMarkerColumnsContext.d.ts.map +1 -1
  83. package/dist/Item/ItemMarkerColumnsContext.js +2 -2
  84. package/dist/Layer/LayerContext.d.ts.map +1 -1
  85. package/dist/Layer/LayerContext.js +3 -2
  86. package/dist/Layer/LayerDepthContext.d.ts.map +1 -1
  87. package/dist/Layer/LayerDepthContext.js +3 -2
  88. package/dist/Layer/LayerTouch.d.ts +3 -2
  89. package/dist/Layer/LayerTouch.d.ts.map +1 -1
  90. package/dist/Layer/LayerTouch.js +3 -2
  91. package/dist/Layer/anchorName.d.ts.map +1 -1
  92. package/dist/Layer/anchorName.js +5 -1
  93. package/dist/Layer/inputHold.d.ts.map +1 -1
  94. package/dist/Layer/inputHold.js +115 -13
  95. package/dist/Layer/layerScopedContext.d.ts +5 -2
  96. package/dist/Layer/layerScopedContext.d.ts.map +1 -1
  97. package/dist/Layer/layerScopedContext.js +27 -10
  98. package/dist/Layer/layerSlideRules.d.ts +28 -26
  99. package/dist/Layer/layerSlideRules.d.ts.map +1 -1
  100. package/dist/Layer/layerSlideRules.js +41 -40
  101. package/dist/Layer/outsidePress.d.ts +21 -3
  102. package/dist/Layer/outsidePress.d.ts.map +1 -1
  103. package/dist/Layer/outsidePress.js +119 -29
  104. package/dist/Layer/settledBox.d.ts +9 -8
  105. package/dist/Layer/settledBox.d.ts.map +1 -1
  106. package/dist/Layer/settledBox.js +169 -49
  107. package/dist/Layer/toastHost.d.ts.map +1 -1
  108. package/dist/Layer/toastHost.js +3 -2
  109. package/dist/Layer/useLayer.d.ts.map +1 -1
  110. package/dist/Layer/useLayer.js +172 -60
  111. package/dist/Layer/useLayerKeyboardClearance.d.ts +14 -2
  112. package/dist/Layer/useLayerKeyboardClearance.d.ts.map +1 -1
  113. package/dist/Layer/useLayerKeyboardClearance.js +83 -12
  114. package/dist/Layer/useTouchTrigger.d.ts +21 -1
  115. package/dist/Layer/useTouchTrigger.d.ts.map +1 -1
  116. package/dist/Layer/useTouchTrigger.js +61 -37
  117. package/dist/Layout/Layout.d.ts +1 -1
  118. package/dist/Layout/Layout.d.ts.map +1 -1
  119. package/dist/Layout/Layout.js +10 -6
  120. package/dist/Layout/LayoutAreaContext.d.ts.map +1 -1
  121. package/dist/Layout/LayoutAreaContext.js +3 -3
  122. package/dist/Layout/LayoutContent.d.ts +6 -6
  123. package/dist/Layout/LayoutContent.js +9 -9
  124. package/dist/Layout/LayoutDividerContext.d.ts.map +1 -1
  125. package/dist/Layout/LayoutDividerContext.js +2 -2
  126. package/dist/Layout/LayoutSlotsContext.d.ts.map +1 -1
  127. package/dist/Layout/LayoutSlotsContext.js +2 -2
  128. package/dist/Link/LinkContext.d.ts +16 -0
  129. package/dist/Link/LinkContext.d.ts.map +1 -1
  130. package/dist/Link/LinkContext.js +3 -3
  131. package/dist/List/List.d.ts +12 -1
  132. package/dist/List/List.d.ts.map +1 -1
  133. package/dist/List/List.js +29 -10
  134. package/dist/List/ListContext.d.ts +18 -3
  135. package/dist/List/ListContext.d.ts.map +1 -1
  136. package/dist/List/ListContext.js +9 -6
  137. package/dist/List/ListItem.d.ts +13 -4
  138. package/dist/List/ListItem.d.ts.map +1 -1
  139. package/dist/List/ListItem.js +37 -10
  140. package/dist/List/listLayoutUpdates.d.ts +34 -0
  141. package/dist/List/listLayoutUpdates.d.ts.map +1 -0
  142. package/dist/List/listLayoutUpdates.js +539 -0
  143. package/dist/Markdown/Markdown.d.ts.map +1 -1
  144. package/dist/Markdown/Markdown.js +57 -10
  145. package/dist/Markdown/blockDirection.d.ts +26 -0
  146. package/dist/Markdown/blockDirection.d.ts.map +1 -0
  147. package/dist/Markdown/blockDirection.js +68 -0
  148. package/dist/Markdown/plugins/HeadingLinksRenderer.d.ts +3 -1
  149. package/dist/Markdown/plugins/HeadingLinksRenderer.d.ts.map +1 -1
  150. package/dist/Markdown/plugins/HeadingLinksRenderer.js +3 -1
  151. package/dist/MetadataList/MetadataListContext.d.ts.map +1 -1
  152. package/dist/MetadataList/MetadataListContext.js +2 -2
  153. package/dist/NavMenu/NavMenuContext.d.ts.map +1 -1
  154. package/dist/NavMenu/NavMenuContext.js +5 -4
  155. package/dist/Popover/Popover.d.ts.map +1 -1
  156. package/dist/Popover/Popover.js +9 -9
  157. package/dist/Popover/usePopover.d.ts.map +1 -1
  158. package/dist/Popover/usePopover.js +11 -8
  159. package/dist/RadioList/RadioList.d.ts.map +1 -1
  160. package/dist/RadioList/RadioList.js +2 -2
  161. package/dist/RadioList/RadioListReasonContext.d.ts.map +1 -1
  162. package/dist/RadioList/RadioListReasonContext.js +1 -1
  163. package/dist/SegmentedControl/SegmentedControlContext.d.ts.map +1 -1
  164. package/dist/SegmentedControl/SegmentedControlContext.js +2 -2
  165. package/dist/SelectableCard/selectableCardInput.d.ts.map +1 -1
  166. package/dist/SelectableCard/selectableCardInput.js +2 -2
  167. package/dist/Selector/SelectorRowLayoutContext.d.ts.map +1 -1
  168. package/dist/Selector/SelectorRowLayoutContext.js +2 -2
  169. package/dist/SideNav/SideNavCollapseButton.d.ts +4 -3
  170. package/dist/SideNav/SideNavCollapseButton.d.ts.map +1 -1
  171. package/dist/SideNav/SideNavCollapseContext.d.ts.map +1 -1
  172. package/dist/SideNav/SideNavCollapseContext.js +4 -3
  173. package/dist/SideNav/SideNavFocusTargetsContext.d.ts.map +1 -1
  174. package/dist/SideNav/SideNavFocusTargetsContext.js +2 -2
  175. package/dist/SideNav/SideNavItem.d.ts.map +1 -1
  176. package/dist/SideNav/SideNavItem.js +3 -2
  177. package/dist/SideNav/SideNavRenderContext.d.ts.map +1 -1
  178. package/dist/SideNav/SideNavRenderContext.js +4 -3
  179. package/dist/SideNav/railMotion.d.ts +40 -0
  180. package/dist/SideNav/railMotion.d.ts.map +1 -1
  181. package/dist/SideNav/railMotion.js +2 -2
  182. package/dist/SizeContext/SizeContext.d.ts.map +1 -1
  183. package/dist/SizeContext/SizeContext.js +2 -2
  184. package/dist/SnapPaging/SnapPaging.d.ts.map +1 -1
  185. package/dist/SnapPaging/SnapPaging.js +162 -36
  186. package/dist/SnapPaging/snapPagingValue.d.ts +29 -3
  187. package/dist/SnapPaging/snapPagingValue.d.ts.map +1 -1
  188. package/dist/SnapPaging/snapPagingValue.js +38 -6
  189. package/dist/Spinner/SpinnerOwnerContext.d.ts.map +1 -1
  190. package/dist/Spinner/SpinnerOwnerContext.js +2 -2
  191. package/dist/Stepper/StepperContext.d.ts.map +1 -1
  192. package/dist/Stepper/StepperContext.js +3 -3
  193. package/dist/Switch/useSwitchTouch.d.ts.map +1 -1
  194. package/dist/Switch/useSwitchTouch.js +8 -3
  195. package/dist/TabList/TabListContext.d.ts.map +1 -1
  196. package/dist/TabList/TabListContext.js +2 -2
  197. package/dist/Table/BaseTable.d.ts +3 -2
  198. package/dist/Table/BaseTable.d.ts.map +1 -1
  199. package/dist/Table/BaseTable.js +73 -16
  200. package/dist/Table/Table.d.ts.map +1 -1
  201. package/dist/Table/Table.js +3 -2
  202. package/dist/Table/TableContext.d.ts.map +1 -1
  203. package/dist/Table/TableContext.js +2 -2
  204. package/dist/Table/index.d.ts +1 -1
  205. package/dist/Table/index.d.ts.map +1 -1
  206. package/dist/Table/plugins/filtering/useTableFiltering.d.ts.map +1 -1
  207. package/dist/Table/plugins/filtering/useTableFiltering.js +4 -3
  208. package/dist/Table/plugins/rowExpansion/useTableRowExpansion.d.ts.map +1 -1
  209. package/dist/Table/plugins/rowExpansion/useTableRowExpansion.js +5 -3
  210. package/dist/Table/plugins/rowIndex/useTableRowIndex.d.ts +16 -18
  211. package/dist/Table/plugins/rowIndex/useTableRowIndex.d.ts.map +1 -1
  212. package/dist/Table/plugins/rowIndex/useTableRowIndex.js +48 -39
  213. package/dist/Table/plugins/selection/useTableSelection.d.ts.map +1 -1
  214. package/dist/Table/plugins/selection/useTableSelection.js +4 -2
  215. package/dist/Table/plugins/stickyColumns/useTableStickyColumns.d.ts.map +1 -1
  216. package/dist/Table/plugins/stickyColumns/useTableStickyColumns.js +1 -0
  217. package/dist/Table/plugins/tree/useTableTreeData.d.ts.map +1 -1
  218. package/dist/Table/plugins/tree/useTableTreeData.js +3 -2
  219. package/dist/Table/tableRowContextUsage.d.ts +21 -0
  220. package/dist/Table/tableRowContextUsage.d.ts.map +1 -0
  221. package/dist/Table/tableRowContextUsage.js +88 -0
  222. package/dist/Table/types.d.ts +58 -5
  223. package/dist/Table/types.d.ts.map +1 -1
  224. package/dist/Table/useBaseTablePlugins.d.ts.map +1 -1
  225. package/dist/Table/useBaseTablePlugins.js +5 -2
  226. package/dist/Text/Text.d.ts.map +1 -1
  227. package/dist/Text/Text.js +18 -14
  228. package/dist/Text/TruncationTooltip.d.ts +45 -0
  229. package/dist/Text/TruncationTooltip.d.ts.map +1 -0
  230. package/dist/Text/TruncationTooltip.js +123 -0
  231. package/dist/Text/textClampContext.d.ts.map +1 -1
  232. package/dist/Text/textClampContext.js +1 -1
  233. package/dist/TimeInput/TimeInput.d.ts.map +1 -1
  234. package/dist/TimeInput/TimeInput.js +4 -0
  235. package/dist/ToggleButton/ToggleButtonGroup.d.ts.map +1 -1
  236. package/dist/ToggleButton/ToggleButtonGroup.js +2 -2
  237. package/dist/Token/TokenNamingContext.d.ts.map +1 -1
  238. package/dist/Token/TokenNamingContext.js +2 -2
  239. package/dist/Tokenizer/TokenizerClearAllMessageContext.d.ts.map +1 -1
  240. package/dist/Tokenizer/TokenizerClearAllMessageContext.js +2 -2
  241. package/dist/Tokenizer/TokenizerItemRemovableContext.d.ts +12 -0
  242. package/dist/Tokenizer/TokenizerItemRemovableContext.d.ts.map +1 -1
  243. package/dist/Tokenizer/TokenizerItemRemovableContext.js +2 -2
  244. package/dist/Toolbar/Toolbar.d.ts.map +1 -1
  245. package/dist/Toolbar/Toolbar.js +12 -6
  246. package/dist/Tooltip/tooltipPresentInterest.d.ts +29 -0
  247. package/dist/Tooltip/tooltipPresentInterest.d.ts.map +1 -0
  248. package/dist/Tooltip/tooltipPresentInterest.js +29 -0
  249. package/dist/Tooltip/useTooltip.d.ts.map +1 -1
  250. package/dist/Tooltip/useTooltip.js +30 -4
  251. package/dist/TopNav/TopNavContext.d.ts.map +1 -1
  252. package/dist/TopNav/TopNavContext.js +2 -2
  253. package/dist/TopNav/TopNavMobileContentContext.d.ts +1 -1
  254. package/dist/TopNav/TopNavMobileContentContext.d.ts.map +1 -1
  255. package/dist/TopNav/TopNavMobileContentContext.js +4 -3
  256. package/dist/TopNav/TopNavRenderContext.d.ts.map +1 -1
  257. package/dist/TopNav/TopNavRenderContext.js +4 -3
  258. package/dist/Typeahead/busyIndicatorLane.d.ts.map +1 -1
  259. package/dist/Typeahead/busyIndicatorLane.js +3 -2
  260. package/dist/Typeahead/committedChoicesKey.d.ts.map +1 -1
  261. package/dist/Typeahead/committedChoicesKey.js +3 -2
  262. package/dist/Typeahead/trailingKeyDown.d.ts.map +1 -1
  263. package/dist/Typeahead/trailingKeyDown.js +3 -2
  264. package/dist/astryx.css +18 -8
  265. package/dist/gestures/GestureArena.d.ts +2 -0
  266. package/dist/gestures/GestureArena.d.ts.map +1 -1
  267. package/dist/gestures/GestureArena.js +8 -1
  268. package/dist/gestures/GestureRecognizer.d.ts +6 -0
  269. package/dist/gestures/GestureRecognizer.d.ts.map +1 -1
  270. package/dist/gestures/GestureRecognizer.js +9 -0
  271. package/dist/gestures/PressTracker.d.ts.map +1 -1
  272. package/dist/gestures/PressTracker.js +9 -4
  273. package/dist/hooks/focusableSelector.d.ts +13 -1
  274. package/dist/hooks/focusableSelector.d.ts.map +1 -1
  275. package/dist/hooks/focusableSelector.js +22 -2
  276. package/dist/hooks/longPressDetector.d.ts.map +1 -1
  277. package/dist/hooks/longPressDetector.js +1 -25
  278. package/dist/hooks/pressGroupContext.d.ts.map +1 -1
  279. package/dist/hooks/pressGroupContext.js +1 -1
  280. package/dist/hooks/useActionGroupTracking.d.ts +18 -1
  281. package/dist/hooks/useActionGroupTracking.d.ts.map +1 -1
  282. package/dist/hooks/useActionGroupTracking.js +13 -2
  283. package/dist/hooks/useAnnounce.d.ts.map +1 -1
  284. package/dist/hooks/useAnnounce.js +3 -2
  285. package/dist/hooks/useFocusTrap.d.ts +11 -0
  286. package/dist/hooks/useFocusTrap.d.ts.map +1 -1
  287. package/dist/hooks/useFocusTrap.js +47 -2
  288. package/dist/hooks/useListFocus.d.ts +7 -0
  289. package/dist/hooks/useListFocus.d.ts.map +1 -1
  290. package/dist/hooks/useListFocus.js +20 -3
  291. package/dist/hooks/usePager.d.ts.map +1 -1
  292. package/dist/hooks/usePager.js +26 -3
  293. package/dist/hooks/useScrollOverflow.d.ts +22 -0
  294. package/dist/hooks/useScrollOverflow.d.ts.map +1 -1
  295. package/dist/hooks/useScrollOverflow.js +67 -11
  296. package/dist/i18n/InternationalizationContext.d.ts +19 -0
  297. package/dist/i18n/InternationalizationContext.d.ts.map +1 -1
  298. package/dist/i18n/InternationalizationContext.js +3 -3
  299. package/dist/i18n/englishFallback.d.ts.map +1 -1
  300. package/dist/i18n/englishFallback.js +5 -1
  301. package/dist/i18n/firstStrongDirection.d.ts +7 -0
  302. package/dist/i18n/firstStrongDirection.d.ts.map +1 -0
  303. package/dist/i18n/firstStrongDirection.js +65 -0
  304. package/dist/i18n/generated-locales/en.generated.d.ts.map +1 -1
  305. package/dist/i18n/generated-locales/en.generated.js +1 -0
  306. package/dist/i18n/generated-locales/pseudo.generated.d.ts.map +1 -1
  307. package/dist/i18n/generated-locales/pseudo.generated.js +1 -0
  308. package/dist/internal/scroll-anchoring.d.ts +16 -0
  309. package/dist/internal/scroll-anchoring.d.ts.map +1 -0
  310. package/dist/internal/scroll-anchoring.js +16 -0
  311. package/dist/internal/touch.d.ts +2 -0
  312. package/dist/internal/touch.d.ts.map +1 -1
  313. package/dist/internal/touch.js +4 -1
  314. package/dist/motion/animatedLayout.d.ts +8 -0
  315. package/dist/motion/animatedLayout.d.ts.map +1 -1
  316. package/dist/motion/animatedLayout.js +51 -3
  317. package/dist/motion/animator.d.ts +19 -2
  318. package/dist/motion/animator.d.ts.map +1 -1
  319. package/dist/motion/animator.js +72 -7
  320. package/dist/privateAttributes/itemKey.stylex.d.ts +5 -0
  321. package/dist/privateAttributes/itemKey.stylex.d.ts.map +1 -0
  322. package/dist/privateAttributes/itemKey.stylex.js +25 -0
  323. package/dist/privateAttributes/leaving.stylex.d.ts +5 -0
  324. package/dist/privateAttributes/leaving.stylex.d.ts.map +1 -0
  325. package/dist/privateAttributes/leaving.stylex.js +23 -0
  326. package/dist/privateAttributes/press.stylex.d.ts.map +1 -1
  327. package/dist/privateAttributes/press.stylex.js +13 -3
  328. package/dist/privateAttributes/scrollAnchoring.stylex.d.ts +7 -0
  329. package/dist/privateAttributes/scrollAnchoring.stylex.d.ts.map +1 -0
  330. package/dist/privateAttributes/scrollAnchoring.stylex.js +50 -0
  331. package/dist/privateAttributes/travelling.stylex.d.ts +27 -0
  332. package/dist/privateAttributes/travelling.stylex.d.ts.map +1 -0
  333. package/dist/privateAttributes/travelling.stylex.js +51 -0
  334. package/dist/theme/Theme.d.ts.map +1 -1
  335. package/dist/theme/Theme.js +95 -49
  336. package/dist/theme/syntax/SyntaxTheme.d.ts.map +1 -1
  337. package/dist/theme/syntax/SyntaxTheme.js +3 -2
  338. package/dist/theme/useTheme.d.ts.map +1 -1
  339. package/dist/theme/useTheme.js +3 -2
  340. package/dist/utils/calendarSystem.d.ts.map +1 -1
  341. package/dist/utils/calendarSystem.js +4 -1
  342. package/dist/utils/flatTree.d.ts +13 -0
  343. package/dist/utils/flatTree.d.ts.map +1 -1
  344. package/dist/utils/flatTree.js +28 -4
  345. package/dist/utils/inputAge.d.ts +22 -0
  346. package/dist/utils/inputAge.d.ts.map +1 -0
  347. package/dist/utils/inputAge.js +54 -0
  348. package/dist/utils/inputStream.d.ts +8 -0
  349. package/dist/utils/inputStream.d.ts.map +1 -1
  350. package/dist/utils/inputStream.js +53 -3
  351. package/dist/utils/moduleLoader.d.ts +23 -0
  352. package/dist/utils/moduleLoader.d.ts.map +1 -0
  353. package/dist/utils/moduleLoader.js +31 -0
  354. package/dist/utils/pressFeedback.d.ts.map +1 -1
  355. package/dist/utils/pressFeedback.js +13 -8
  356. package/dist/utils/selectionLock.d.ts.map +1 -1
  357. package/dist/utils/selectionLock.js +7 -14
  358. package/dist/utils/sharedContext.d.ts +18 -0
  359. package/dist/utils/sharedContext.d.ts.map +1 -0
  360. package/dist/utils/sharedContext.js +33 -0
  361. package/dist/utils/sharedRealm.d.ts +24 -0
  362. package/dist/utils/sharedRealm.d.ts.map +1 -0
  363. package/dist/utils/sharedRealm.js +38 -0
  364. package/locales/en.json +4 -0
  365. package/locales/pseudo.json +3 -0
  366. package/package.json +10 -5
  367. package/src/AppShell/AppShellMobileContext.tsx +8 -3
  368. package/src/AppShell/useAppShellMainId.ts +7 -2
  369. package/src/Avatar/AvatarSizeContext.ts +6 -2
  370. package/src/Avatar/AvatarStatusLabelContext.ts +8 -3
  371. package/src/AvatarGroup/AvatarGroupContext.ts +7 -4
  372. package/src/BottomSheet/BottomSheetHostContext.ts +7 -3
  373. package/src/BottomSheet/BottomSheetPanel.tsx +56 -7
  374. package/src/BottomSheet/BottomSheetSwitcherContext.ts +7 -2
  375. package/src/BottomSheet/bottomSheetEscape.ts +6 -2
  376. package/src/BottomSheet/bottomSheetStack.ts +6 -14
  377. package/src/BottomSheet/useSheetGestures.ts +28 -48
  378. package/src/Breadcrumbs/Breadcrumbs.tsx +6 -5
  379. package/src/Button/Button.doc.mjs +3 -3
  380. package/src/Button/Button.tsx +10 -22
  381. package/src/Button/buttonHitArea.ts +7 -4
  382. package/src/ButtonGroup/ButtonGroup.doc.mjs +3 -3
  383. package/src/ButtonGroup/ButtonGroup.tsx +27 -16
  384. package/src/ButtonGroup/ButtonGroupContext.ts +7 -4
  385. package/src/Carousel/Carousel.tsx +33 -15
  386. package/src/Chat/ChatContext.tsx +23 -7
  387. package/src/Chat/useChatStreamScroll.ts +7 -26
  388. package/src/CheckboxInput/CheckboxRowPressContext.ts +5 -1
  389. package/src/CheckboxList/CheckboxListContext.tsx +5 -1
  390. package/src/Collapsible/CollapsibleGroupContext.tsx +11 -3
  391. package/src/CommandPalette/CommandPaletteContext.ts +8 -3
  392. package/src/CommandPalette/busyStartSettle.ts +6 -2
  393. package/src/DateInput/TouchDateField.tsx +62 -4
  394. package/src/Dialog/DialogContext.ts +7 -2
  395. package/src/DropdownMenu/DropdownMenuContext.tsx +18 -5
  396. package/src/DropdownMenu/lazyMenuBottomSheet.ts +6 -18
  397. package/src/DropdownMenu/menuRegionStops.ts +1 -49
  398. package/src/FormLayout/FormLayoutContext.ts +3 -3
  399. package/src/Heading/Heading.tsx +34 -18
  400. package/src/HoverCard/HoverCard.doc.mjs +3 -3
  401. package/src/HoverCard/HoverCard.tsx +1 -2
  402. package/src/HoverCard/useHoverCard.tsx +6 -2
  403. package/src/Icon/IconDefaultSizeContext.ts +6 -2
  404. package/src/IconButton/IconButton.doc.mjs +2 -2
  405. package/src/InputGroup/InputGroupContext.ts +7 -4
  406. package/src/InputGroup/InputGroupInternalContext.ts +6 -2
  407. package/src/InteractiveRoleContext/InteractiveRoleContext.ts +8 -3
  408. package/src/Item/ItemDescriptionContext.tsx +7 -3
  409. package/src/Item/ItemListRowContext.tsx +7 -3
  410. package/src/Item/ItemMarkerColumnsContext.tsx +7 -2
  411. package/src/Layer/LayerContext.ts +7 -2
  412. package/src/Layer/LayerDepthContext.tsx +3 -2
  413. package/src/Layer/LayerTouch.ts +6 -2
  414. package/src/Layer/anchorName.ts +8 -4
  415. package/src/Layer/inputHold.ts +138 -21
  416. package/src/Layer/layerScopedContext.tsx +34 -7
  417. package/src/Layer/layerSlideRules.ts +43 -40
  418. package/src/Layer/outsidePress.ts +144 -28
  419. package/src/Layer/settledBox.ts +216 -54
  420. package/src/Layer/toastHost.tsx +6 -2
  421. package/src/Layer/useLayer.tsx +200 -69
  422. package/src/Layer/useLayerKeyboardClearance.ts +90 -12
  423. package/src/Layer/useTouchTrigger.ts +89 -40
  424. package/src/Layout/Layout.doc.mjs +17 -0
  425. package/src/Layout/Layout.tsx +13 -9
  426. package/src/Layout/LayoutAreaContext.ts +8 -9
  427. package/src/Layout/LayoutContent.doc.mjs +11 -0
  428. package/src/Layout/LayoutContent.tsx +9 -9
  429. package/src/Layout/LayoutDividerContext.ts +6 -2
  430. package/src/Layout/LayoutSlotsContext.ts +6 -3
  431. package/src/Link/LinkContext.ts +7 -3
  432. package/src/List/List.doc.mjs +5 -0
  433. package/src/List/List.tsx +53 -5
  434. package/src/List/ListContext.tsx +28 -6
  435. package/src/List/ListItem.doc.mjs +11 -0
  436. package/src/List/ListItem.tsx +51 -14
  437. package/src/List/listLayoutUpdates.ts +603 -0
  438. package/src/Markdown/Markdown.tsx +93 -5
  439. package/src/Markdown/blockDirection.ts +100 -0
  440. package/src/Markdown/plugins/HeadingLinksRenderer.tsx +4 -0
  441. package/src/MetadataList/MetadataListContext.tsx +6 -2
  442. package/src/NavMenu/NavMenuContext.tsx +14 -5
  443. package/src/Popover/Popover.tsx +23 -16
  444. package/src/Popover/usePopover.tsx +21 -7
  445. package/src/RadioList/RadioList.tsx +7 -4
  446. package/src/RadioList/RadioListReasonContext.ts +1 -1
  447. package/src/Section/Section.doc.mjs +22 -0
  448. package/src/SegmentedControl/SegmentedControlContext.ts +6 -2
  449. package/src/SelectableCard/selectableCardInput.ts +6 -2
  450. package/src/Selector/SelectorRowLayoutContext.ts +6 -2
  451. package/src/SideNav/SideNavCollapseButton.doc.mjs +5 -5
  452. package/src/SideNav/SideNavCollapseButton.tsx +4 -3
  453. package/src/SideNav/SideNavCollapseContext.ts +12 -7
  454. package/src/SideNav/SideNavFocusTargetsContext.ts +6 -2
  455. package/src/SideNav/SideNavItem.tsx +6 -2
  456. package/src/SideNav/SideNavRenderContext.ts +9 -8
  457. package/src/SideNav/railMotion.ts +6 -2
  458. package/src/SizeContext/SizeContext.ts +6 -2
  459. package/src/SnapPaging/SnapPaging.ts +164 -39
  460. package/src/SnapPaging/snapPagingValue.ts +59 -12
  461. package/src/Spinner/SpinnerOwnerContext.ts +6 -2
  462. package/src/Stepper/StepperContext.ts +12 -3
  463. package/src/Switch/useSwitchTouch.ts +7 -5
  464. package/src/TabList/TabListContext.ts +7 -2
  465. package/src/Table/BaseTable.tsx +143 -19
  466. package/src/Table/Table.tsx +4 -3
  467. package/src/Table/TableContext.ts +6 -2
  468. package/src/Table/index.ts +2 -0
  469. package/src/Table/plugins/filtering/useTableFiltering.tsx +11 -3
  470. package/src/Table/plugins/rowExpansion/useTableRowExpansion.tsx +10 -3
  471. package/src/Table/plugins/rowIndex/useTableRowIndex.tsx +38 -29
  472. package/src/Table/plugins/selection/useTableSelection.tsx +7 -2
  473. package/src/Table/plugins/stickyColumns/useTableStickyColumns.tsx +1 -0
  474. package/src/Table/plugins/tree/useTableTreeData.tsx +6 -2
  475. package/src/Table/tableRowContextUsage.ts +105 -0
  476. package/src/Table/types.ts +60 -2
  477. package/src/Table/useBaseTablePlugins.ts +5 -2
  478. package/src/Table/useTableRowIndex.doc.mjs +6 -7
  479. package/src/Text/Text.tsx +34 -18
  480. package/src/Text/TruncationTooltip.tsx +179 -0
  481. package/src/Text/textClampContext.ts +5 -1
  482. package/src/TimeInput/TimeInput.tsx +4 -0
  483. package/src/ToggleButton/ToggleButtonGroup.tsx +6 -2
  484. package/src/Token/TokenNamingContext.ts +6 -2
  485. package/src/Tokenizer/TokenizerClearAllMessageContext.ts +4 -4
  486. package/src/Tokenizer/TokenizerItemRemovableContext.ts +3 -3
  487. package/src/Toolbar/Toolbar.tsx +16 -9
  488. package/src/Tooltip/tooltipPresentInterest.ts +43 -0
  489. package/src/Tooltip/useTooltip.tsx +33 -0
  490. package/src/TopNav/TopNavContext.ts +6 -2
  491. package/src/TopNav/TopNavMobileContentContext.ts +8 -3
  492. package/src/TopNav/TopNavRenderContext.ts +8 -4
  493. package/src/Typeahead/busyIndicatorLane.tsx +7 -2
  494. package/src/Typeahead/committedChoicesKey.tsx +4 -3
  495. package/src/Typeahead/trailingKeyDown.tsx +7 -2
  496. package/src/gestures/GestureArena.ts +8 -1
  497. package/src/gestures/GestureRecognizer.ts +9 -0
  498. package/src/gestures/PressTracker.ts +13 -4
  499. package/src/hooks/focusableSelector.ts +29 -1
  500. package/src/hooks/longPressDetector.ts +1 -35
  501. package/src/hooks/pressGroupContext.ts +5 -1
  502. package/src/hooks/useActionGroupTracking.ts +29 -2
  503. package/src/hooks/useAnnounce.ts +8 -4
  504. package/src/hooks/useFocusTrap.ts +62 -2
  505. package/src/hooks/useListFocus.ts +34 -7
  506. package/src/hooks/usePager.ts +30 -3
  507. package/src/hooks/useScrollOverflow.ts +65 -7
  508. package/src/i18n/InternationalizationContext.ts +12 -8
  509. package/src/i18n/englishFallback.ts +7 -1
  510. package/src/i18n/firstStrongDirection.ts +69 -0
  511. package/src/i18n/generated-locales/en.generated.ts +1 -0
  512. package/src/i18n/generated-locales/pseudo.generated.ts +1 -0
  513. package/src/internal/scroll-anchoring.ts +16 -0
  514. package/src/internal/touch.ts +4 -0
  515. package/src/motion/animatedLayout.ts +44 -3
  516. package/src/motion/animator.ts +97 -9
  517. package/src/privateAttributes/itemKey.stylex.ts +25 -0
  518. package/src/privateAttributes/leaving.stylex.ts +23 -0
  519. package/src/privateAttributes/press.stylex.ts +19 -7
  520. package/src/privateAttributes/scrollAnchoring.stylex.ts +50 -0
  521. package/src/privateAttributes/travelling.stylex.ts +88 -0
  522. package/src/theme/Theme.tsx +124 -60
  523. package/src/theme/syntax/SyntaxTheme.tsx +7 -2
  524. package/src/theme/useTheme.ts +7 -8
  525. package/src/utils/calendarSystem.ts +7 -1
  526. package/src/utils/flatTree.ts +31 -4
  527. package/src/utils/inputAge.ts +66 -0
  528. package/src/utils/inputStream.ts +52 -3
  529. package/src/utils/moduleLoader.ts +47 -0
  530. package/src/utils/pressFeedback.ts +16 -7
  531. package/src/utils/selectionLock.ts +8 -18
  532. package/src/utils/sharedContext.ts +42 -0
  533. package/src/utils/sharedRealm.ts +42 -0
@@ -1,3 +1,19 @@
1
+ export interface OutsidePressOptions {
2
+ /** The pointer types the watch follows; every type when omitted. */
3
+ readonly pointerTypes?: ReadonlyArray<string>;
4
+ /**
5
+ * A press outside also closes the layer as it begins to pan, or when the
6
+ * browser takes it. While one press outside is followed, other pointers are
7
+ * ignored. A new primary pointer starts a new press.
8
+ */
9
+ readonly closesOnPan?: boolean;
10
+ /**
11
+ * The shadow root the layer renders in. The document sees a press inside a
12
+ * closed root as a press on its host. So each root from this one out to the
13
+ * document judges presses too, and an inner root's judgment stands.
14
+ */
15
+ readonly root?: Node | null;
16
+ }
1
17
  /** Records that a layer in `doc` is closing because a press or focus went outside it. */
2
18
  export declare function noteOutsideDismissal(doc: Document): void;
3
19
  /** How many layers an outside press has closed in `doc` so far. */
@@ -9,13 +25,15 @@ export declare function outsideDismissalCount(doc: Document): number;
9
25
  * @param owner - The element that owns the layer (the field); its document is
10
26
  * watched.
11
27
  * @param isInside - Whether a press with this composed path is inside.
12
- * @param onOutside - Called once for each press that starts and ends outside.
28
+ * @param onOutside - Called once for each press that starts and ends outside,
29
+ * as native light dismiss does. With `closesOnPan`, also when that press
30
+ * pans or is cancelled.
13
31
  * @returns Stops watching.
14
32
  */
15
- export declare function watchOutsidePress(owner: Element, isInside: (path: ReadonlyArray<EventTarget>) => boolean, onOutside: () => void): () => void;
33
+ export declare function watchOutsidePress(owner: Element, isInside: (path: ReadonlyArray<EventTarget>) => boolean, onOutside: () => void, { pointerTypes, closesOnPan, root }?: OutsidePressOptions): () => void;
16
34
  export interface OutsidePressWatch {
17
35
  /** Start watching, replacing any watch already running. */
18
- start: (owner: Element, isInside: (path: ReadonlyArray<EventTarget>) => boolean, onOutside: () => void) => void;
36
+ start: (owner: Element, isInside: (path: ReadonlyArray<EventTarget>) => boolean, onOutside: () => void, options?: OutsidePressOptions) => void;
19
37
  /** Stop watching; does nothing when no watch is running. */
20
38
  stop: () => void;
21
39
  }
@@ -1 +1 @@
1
- {"version":3,"file":"outsidePress.d.ts","sourceRoot":"","sources":["../../src/Layer/outsidePress.ts"],"names":[],"mappings":"AAgCA,yFAAyF;AACzF,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,QAAQ,GAAG,IAAI,CAExD;AAED,mEAAmE;AACnE,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,QAAQ,GAAG,MAAM,CAE3D;AAED;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,OAAO,EACd,QAAQ,EAAE,CAAC,IAAI,EAAE,aAAa,CAAC,WAAW,CAAC,KAAK,OAAO,EACvD,SAAS,EAAE,MAAM,IAAI,GACpB,MAAM,IAAI,CA4BZ;AAED,M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aAAa,CAAC,WAAW,CAAC,KAAK,OAAO,EACvD,SAAS,EAAE,MAAM,IAAI,EACrB,EAAC,YAAY,EAAE,WAAmB,EAAE,IAAW,EAAC,GAAE,mBAAwB,GACzE,MAAM,IAAI,CAkIZ;AAED,MAAM,WAAW,iBAAiB;IAChC,2DAA2D;IAC3D,KAAK,EAAE,CACL,KAAK,EAAE,OAAO,EACd,QAAQ,EAAE,CAAC,IAAI,EAAE,aAAa,CAAC,WAAW,CAAC,KAAK,OAAO,EACvD,SAAS,EAAE,MAAM,IAAI,EACrB,OAAO,CAAC,EAAE,mBAAmB,KAC1B,IAAI,CAAC;IACV,4DAA4D;IAC5D,IAAI,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"}
@@ -4,27 +4,20 @@
4
4
 
5
5
  /**
6
6
  * @file outsidePress.ts
7
- * @input Listens for pointerdown, pointerup and pointercancel on a document
8
- * @output Exports watchOutsidePress and useOutsidePress, which owns one watch
9
- * for a component: start on show, stop on hide, stop on unmount;
10
- * noteOutsideDismissal and outsideDismissalCount, a per-document count of
11
- * layers that an outside press or focus move closed; and the
12
- * inside tests a text field's owner runs: isPressInsideOwnedLayer for a
13
- * press, isFocusInsideOwnedLayer for a blur
14
- * @position Internal to Layer; the outside-press dismissal for a manual
15
- * popover whose owner decides what counts as inside (a combobox's field
16
- * and its list). Not exported from the package.
17
- *
18
- * A press closes the layer only when it starts and ends outside, as native
19
- * light dismiss does: a pointerdown outside is remembered, the pointerup that
20
- * follows closes the layer if it is outside too, and a pointercancel (the
21
- * browser took the gesture for a scroll or a pinch) forgets it. Inside is
22
- * judged on the event's composed path, so a field or list inside an open
23
- * shadow root, which the document sees as its shadow host, is still inside.
7
+ * @input Pointer presses on a document and on the shadow roots around a
8
+ * given root; with closesOnPan, pan moves from core's input stream
9
+ * @output watchOutsidePress, and useOutsidePress, one watch per component.
10
+ * noteOutsideDismissal and outsideDismissalCount keep a per-document count
11
+ * of layers that an outside press or focus move closed. The inside tests
12
+ * are isPressInsideOwnedLayer and isFocusInsideOwnedLayer
13
+ * @position Internal to Layer: the outside-press dismissal for a manual
14
+ * popover whose owner decides what counts as inside. Not exported.
24
15
  */
25
16
  import { useCallback, useEffect, useMemo, useRef } from 'react';
26
- import { isElement, isNode, isShadowRoot } from "../utils/nodeType.js";
27
-
17
+ import { UIKIT_PAN } from "../motion/uikit/gestures.js";
18
+ import { shadowHostOf, shadowRootsOutward } from "../utils/flatTree.js";
19
+ import { subscribeInput } from "../utils/inputStream.js";
20
+ import { isElement, isNode } from "../utils/nodeType.js";
28
21
  // A modal host's backdrop press reads this. A press that closed a layer above
29
22
  // the host is that layer's, so the host stays open.
30
23
  const outsideDismissals = new WeakMap();
@@ -46,34 +39,131 @@ export function outsideDismissalCount(doc) {
46
39
  * @param owner - The element that owns the layer (the field); its document is
47
40
  * watched.
48
41
  * @param isInside - Whether a press with this composed path is inside.
49
- * @param onOutside - Called once for each press that starts and ends outside.
42
+ * @param onOutside - Called once for each press that starts and ends outside,
43
+ * as native light dismiss does. With `closesOnPan`, also when that press
44
+ * pans or is cancelled.
50
45
  * @returns Stops watching.
51
46
  */
52
- export function watchOutsidePress(owner, isInside, onOutside) {
47
+ export function watchOutsidePress(owner, isInside, onOutside, {
48
+ pointerTypes,
49
+ closesOnPan = false,
50
+ root = null
51
+ } = {}) {
53
52
  const doc = owner.ownerDocument;
53
+ const shadows = root == null ? [] : shadowRootsOutward(root);
54
54
  let startedOutside = false;
55
+ let panStart = null;
56
+ const follows = event => pointerTypes == null || pointerTypes.includes(event.pointerType);
57
+ const close = () => {
58
+ startedOutside = false;
59
+ panStart = null;
60
+ noteOutsideDismissal(doc);
61
+ onOutside();
62
+ };
55
63
 
56
64
  // Capture phase, so a press whose target stops propagation is still seen.
65
+ // An inner root's listener runs after the outer ones', so its judgment
66
+ // stands.
57
67
  const handleDown = event => {
68
+ if (!follows(event)) {
69
+ return;
70
+ }
71
+ if (closesOnPan && panStart != null && panStart.id !== event.pointerId && !event.isPrimary) {
72
+ return;
73
+ }
58
74
  startedOutside = !isInside(event.composedPath());
75
+ if (closesOnPan) {
76
+ panStart = startedOutside ? {
77
+ id: event.pointerId,
78
+ x: event.clientX,
79
+ y: event.clientY
80
+ } : null;
81
+ }
59
82
  };
60
- const handleUp = event => {
83
+ const handleMove = event => {
84
+ if (panStart?.id === event.pointerId && Math.max(Math.abs(event.clientX - panStart.x), Math.abs(event.clientY - panStart.y)) >= UIKIT_PAN.hysteresis.value) {
85
+ close();
86
+ }
87
+ };
88
+ const judgeUp = event => {
89
+ if (!follows(event) || closesOnPan && panStart?.id !== event.pointerId) {
90
+ return;
91
+ }
61
92
  const wasOutside = startedOutside;
62
93
  startedOutside = false;
94
+ panStart = null;
63
95
  if (wasOutside && !isInside(event.composedPath())) {
64
96
  noteOutsideDismissal(doc);
65
97
  onOutside();
66
98
  }
67
99
  };
68
- const handleCancel = () => {
69
- startedOutside = false;
100
+ // The document and each root see a lift inside a deeper closed root as a
101
+ // lift on that root's host. So each of them judges, in the capture phase,
102
+ // only a lift whose path does not hold the host below it. The innermost root
103
+ // judges every lift it sees. A host judges a lift on itself, which no root
104
+ // sees.
105
+ let judgedLift = null;
106
+ const judgeUpUnlessBelow = hostBelow => event => {
107
+ if (event === judgedLift || hostBelow != null && event.composedPath().includes(hostBelow)) {
108
+ return;
109
+ }
110
+ judgedLift = event;
111
+ judgeUp(event);
112
+ };
113
+ const handleUp = judgeUpUnlessBelow(shadows.at(-1)?.host ?? null);
114
+ const liftJudges = shadows.map(({
115
+ root: shadow,
116
+ host
117
+ }, index) => ({
118
+ shadow,
119
+ host,
120
+ handleRootUp: judgeUpUnlessBelow(index === 0 ? null : shadows[index - 1].host),
121
+ handleHostUp: judgeUpUnlessBelow(null)
122
+ }));
123
+ const handleCancel = event => {
124
+ if (!follows(event)) {
125
+ return;
126
+ }
127
+ if (closesOnPan && panStart?.id === event.pointerId) {
128
+ close();
129
+ } else if (!closesOnPan) {
130
+ startedOutside = false;
131
+ }
70
132
  };
71
- doc.addEventListener('pointerdown', handleDown, true);
133
+ const judges = [doc, ...shadows.map(({
134
+ root: shadow
135
+ }) => shadow)];
136
+ for (const target of judges) {
137
+ target.addEventListener('pointerdown', handleDown, true);
138
+ }
139
+ const view = doc.defaultView;
140
+ const stopMoves = closesOnPan && view != null ? subscribeInput(view, 'pointermove', handleMove) : null;
72
141
  doc.addEventListener('pointerup', handleUp, true);
142
+ for (const {
143
+ shadow,
144
+ host,
145
+ handleRootUp,
146
+ handleHostUp
147
+ } of liftJudges) {
148
+ shadow.addEventListener('pointerup', handleRootUp, true);
149
+ host.addEventListener('pointerup', handleHostUp);
150
+ }
73
151
  doc.addEventListener('pointercancel', handleCancel, true);
74
152
  return () => {
75
- doc.removeEventListener('pointerdown', handleDown, true);
153
+ for (const target of judges) {
154
+ target.removeEventListener('pointerdown', handleDown, true);
155
+ }
156
+ stopMoves?.();
76
157
  doc.removeEventListener('pointerup', handleUp, true);
158
+ for (const {
159
+ shadow,
160
+ host,
161
+ handleRootUp,
162
+ handleHostUp
163
+ } of liftJudges) {
164
+ shadow.removeEventListener('pointerup', handleRootUp, true);
165
+ host.removeEventListener('pointerup', handleHostUp);
166
+ }
77
167
  doc.removeEventListener('pointercancel', handleCancel, true);
78
168
  };
79
169
  }
@@ -89,9 +179,9 @@ export function useOutsidePress() {
89
179
  stopRef.current?.();
90
180
  stopRef.current = null;
91
181
  }, []);
92
- const start = useCallback((owner, isInside, onOutside) => {
182
+ const start = useCallback((owner, isInside, onOutside, options) => {
93
183
  stopRef.current?.();
94
- stopRef.current = watchOutsidePress(owner, isInside, onOutside);
184
+ stopRef.current = watchOutsidePress(owner, isInside, onOutside, options);
95
185
  }, []);
96
186
  // Stops the outside-press listeners on unmount.
97
187
  useEffect(() => stop, [stop]);
@@ -103,7 +193,7 @@ export function useOutsidePress() {
103
193
 
104
194
  /** Whether `node` is the layer with this id, or inside it across shadow roots. */
105
195
  function isWithinLayer(node, layerId) {
106
- for (let current = node; current != null; current = current.parentNode ?? (isShadowRoot(current) ? current.host : null)) {
196
+ for (let current = node; current != null; current = current.parentNode ?? shadowHostOf(current)) {
107
197
  if (isElement(current) && current.id === layerId) {
108
198
  return true;
109
199
  }
@@ -3,14 +3,15 @@
3
3
  * entry animation (or anything else) applies to it. A Tooltip enters from a
4
4
  * few pixels toward its trigger, scaled down. So the transformed box of a
5
5
  * tooltip that fits beside its trigger can read as covering it while it
6
- * enters. For this one read, the layer's transforms are overridden with
7
- * `none !important`, which outranks an animation. They are restored in the
8
- * same task, so no frame paints in between and the animation keeps running.
9
- * Where the engine still applies an animated transform under that override
10
- * (WebKit), the read box has that transform undone instead (`untransform`). A
11
- * layer that transitions a transform property is not overridden, since
12
- * restoring the value would start that transition. Its box has its transform
13
- * undone.
6
+ * enters. When the transform only translates and scales, `untransform` takes
7
+ * it out of one box read, if `canUndoByCalculation` and `carriesScale` allow
8
+ * it. Nothing is written, so the read forces no extra style or layout work.
9
+ * A layer that transitions a transform is also only read: restoring an
10
+ * overridden value would start that transition. Otherwise one read overrides
11
+ * the layer's transforms with `none !important`, which outranks an animation.
12
+ * The same task restores them, so no frame paints in between and the
13
+ * animation keeps running. WebKit still applies an animated transform under
14
+ * that override, so there the read box has that transform undone instead.
14
15
  */
15
16
  export declare function settledBox(layer: HTMLElement): DOMRect;
16
17
  //# sourceMappingURL=settledBox.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"settledBox.d.ts","sourceRoot":"","sources":["../../src/Layer/settledBox.ts"],"names":[],"mappings":"AAqFA;;;;;;;;;;;;;GAaG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAuCtD"}
1
+ {"version":3,"file":"settledBox.d.ts","sourceRoot":"","sources":["../../src/Layer/settledBox.ts"],"names":[],"mappings":"AAoOA;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAyDtD"}
@@ -16,62 +16,172 @@
16
16
  */
17
17
 
18
18
  const TRANSFORM_PROPERTIES = ['transform', 'translate', 'scale', 'rotate'];
19
+
20
+ /** A 2D affine matrix in the order CSS `matrix()` lists it: a, b, c, d, e, f. */
21
+
22
+ const IDENTITY = [1, 0, 0, 1, 0, 0];
23
+
24
+ /**
25
+ * Chromium and WebKit place layout boxes on a 1/64 px grid. The computed
26
+ * transform keeps six digits, so a derived edge can miss that grid by
27
+ * millionths of a px. An edge that close moves onto the grid. Firefox uses a
28
+ * 1/60 px grid, so its edges stay as derived.
29
+ */
30
+ const LAYOUT_UNITS_PER_PX = 64;
31
+ const GRID_TOLERANCE_PX = 1 / 2048;
32
+
33
+ /** How much nearer the scaled size must be, px, for the box to carry it. */
34
+ const SCALE_TOLERANCE_PX = 1 / 32;
19
35
  function hasTransform(style) {
20
36
  return TRANSFORM_PROPERTIES.some(name => {
21
37
  const value = style.getPropertyValue(name);
22
38
  return value !== '' && value !== 'none';
23
39
  });
24
40
  }
41
+ function isSet(value) {
42
+ return value !== '' && value !== 'none';
43
+ }
44
+ function multiply(m, n) {
45
+ return [m[0] * n[0] + m[2] * n[1], m[1] * n[0] + m[3] * n[1], m[0] * n[2] + m[2] * n[3], m[1] * n[2] + m[3] * n[3], m[0] * n[4] + m[2] * n[5] + m[4], m[1] * n[4] + m[3] * n[5] + m[5]];
46
+ }
25
47
 
26
48
  /**
27
- * `rect`, the box of an element whose computed style still carries a 2D
28
- * transform, with that transform undone. The transformed box's centre is the
29
- * image of the element's centre. So undoing the transform about its origin on
30
- * that centre gives the untransformed box, at the element's layout size. A
31
- * transform this cannot undo (3D, or a rotation in another unit) leaves `rect`
32
- * as it is.
49
+ * The element's whole 2D transform, as one matrix, or null for a transform
50
+ * this cannot read (3D, or a rotation in another unit). The individual
51
+ * transform properties apply before `transform`, in this order (CSS
52
+ * Transforms 2). An engine reports a computed `transform` as `matrix()`.
33
53
  */
34
- function untransform(rect, layer, style) {
35
- const set = value => value !== '' && value !== 'none';
36
- if (typeof DOMMatrix === 'undefined' || layer.offsetWidth <= 0) {
37
- return rect;
38
- }
39
- // The individual transform properties apply before `transform`, in this
40
- // order (CSS Transforms 2).
41
- let matrix = new DOMMatrix();
42
- if (set(style.translate)) {
43
- const [x = '0', y = '0', z] = style.translate.split(' ');
44
- if (z != null) {
45
- return rect;
54
+ function transformOf(style) {
55
+ const translate = style.getPropertyValue('translate');
56
+ const rotate = style.getPropertyValue('rotate');
57
+ const scale = style.getPropertyValue('scale');
58
+ const transform = style.getPropertyValue('transform');
59
+ let matrix = IDENTITY;
60
+ if (isSet(translate)) {
61
+ const [x = '0', y = '0', z] = translate.split(' ');
62
+ // The computed `translate` keeps a percentage, which is not a length.
63
+ if (z != null || !translate.split(' ').every(value => value.endsWith('px'))) {
64
+ return null;
46
65
  }
47
- matrix = matrix.translate(parseFloat(x), parseFloat(y));
66
+ matrix = multiply(matrix, [1, 0, 0, 1, parseFloat(x), parseFloat(y)]);
48
67
  }
49
- if (set(style.rotate)) {
50
- if (!/^-?[\d.]+deg$/.test(style.rotate)) {
51
- return rect;
68
+ if (isSet(rotate)) {
69
+ if (!/^-?[\d.]+deg$/.test(rotate)) {
70
+ return null;
52
71
  }
53
- matrix = matrix.rotate(parseFloat(style.rotate));
72
+ const angle = parseFloat(rotate) * Math.PI / 180;
73
+ const cos = Math.cos(angle);
74
+ const sin = Math.sin(angle);
75
+ matrix = multiply(matrix, [cos, sin, -sin, cos, 0, 0]);
54
76
  }
55
- if (set(style.scale)) {
56
- const [x = '1', y = x, z] = style.scale.split(' ');
77
+ if (isSet(scale)) {
78
+ const [x = '1', y = x, z] = scale.split(' ');
57
79
  if (z != null) {
58
- return rect;
80
+ return null;
59
81
  }
60
- matrix = matrix.scale(parseFloat(x), parseFloat(y));
82
+ matrix = multiply(matrix, [parseFloat(x), 0, 0, parseFloat(y), 0, 0]);
83
+ }
84
+ if (isSet(transform)) {
85
+ const listed = /^matrix\(([^)]*)\)$/.exec(transform);
86
+ const values = listed?.[1].split(',').map(value => parseFloat(value));
87
+ if (values?.length !== 6 || values.some(value => Number.isNaN(value))) {
88
+ return null;
89
+ }
90
+ matrix = multiply(matrix, values);
91
+ }
92
+ return matrix;
93
+ }
94
+
95
+ /**
96
+ * Whether the matrix only translates and scales: the box keeps its edges
97
+ * parallel to the axes, and its layout size is its transformed size over the
98
+ * scale.
99
+ */
100
+ function isAxisAligned([a, b, c, d]) {
101
+ return b === 0 && c === 0 && a !== 0 && d !== 0;
102
+ }
103
+
104
+ /**
105
+ * Whether the layer's transform can be taken out of its box by calculation.
106
+ * Not while one of its animations is pending: Chromium can then report the
107
+ * first keyframe before the box carries it. Not under a CSS zoom other than 1:
108
+ * the computed translation and origin are then in the layer's own px, not in
109
+ * the box's.
110
+ */
111
+ function canUndoByCalculation(layer) {
112
+ const zoom = layer.currentCSSZoom ?? 1;
113
+ if (zoom !== 1) {
114
+ return false;
61
115
  }
62
- if (set(style.transform)) {
63
- matrix = matrix.multiply(new DOMMatrix(style.transform));
116
+ return !(layer.getAnimations?.() ?? []).some(animation => animation.pending);
117
+ }
118
+
119
+ /** The layer's border-box size in layout px, unrounded, from its used size. */
120
+ function layoutSize(style) {
121
+ const px = name => parseFloat(style.getPropertyValue(name)) || 0;
122
+ const isContentBox = style.getPropertyValue('box-sizing') !== 'border-box';
123
+ const extra = sides => isContentBox ? sides.reduce((sum, side) => sum + px(`padding-${side}`) + px(`border-${side}-width`), 0) : 0;
124
+ return {
125
+ width: px('width') + extra(['left', 'right']),
126
+ height: px('height') + extra(['top', 'bottom'])
127
+ };
128
+ }
129
+
130
+ /**
131
+ * Whether the box read carries the scale of `matrix`. Right after a layer
132
+ * shows, Chromium can report its entrance's first frame in the computed style
133
+ * while the box read is still laid out without it. The box carries the scale
134
+ * only when its size is clearly nearer the layout size times the scale than
135
+ * the layout size itself. A scale too near 1 to tell them apart does not
136
+ * count.
137
+ */
138
+ function carriesScale(rect, style, [a,,, d]) {
139
+ const {
140
+ width,
141
+ height
142
+ } = layoutSize(style);
143
+ if (!(width > 0) || !(height > 0)) {
144
+ return false;
64
145
  }
65
- if (!matrix.is2D) {
146
+ const scaledError = Math.abs(rect.width - width * Math.abs(a)) + Math.abs(rect.height - height * Math.abs(d));
147
+ const unscaledError = Math.abs(rect.width - width) + Math.abs(rect.height - height);
148
+ return scaledError + SCALE_TOLERANCE_PX < unscaledError;
149
+ }
150
+ function onLayoutGrid(value) {
151
+ const snapped = Math.round(value * LAYOUT_UNITS_PER_PX) / LAYOUT_UNITS_PER_PX;
152
+ return Math.abs(snapped - value) < GRID_TOLERANCE_PX ? snapped : value;
153
+ }
154
+
155
+ /**
156
+ * `rect`, the box of an element whose computed style carries the 2D transform
157
+ * `matrix`, with that transform undone. The transformed box's centre is the
158
+ * image of the element's centre. So undoing the transform about its origin on
159
+ * that centre gives the untransformed box. A box that only translates and
160
+ * scales gets its layout size from the transformed size, exactly, and needs
161
+ * no other read. Any other box takes its layout size from `offsetWidth` and
162
+ * `offsetHeight`, which round to whole pixels.
163
+ */
164
+ function untransform(rect, layer, style, matrix) {
165
+ const [a, b, c, d, e, f] = matrix;
166
+ const isExact = isAxisAligned(matrix);
167
+ const width = isExact ? rect.width / Math.abs(a) : layer.offsetWidth;
168
+ const height = isExact ? rect.height / Math.abs(d) : layer.offsetHeight;
169
+ if (!isExact && width <= 0) {
66
170
  return rect;
67
171
  }
68
- const [originX = 0, originY = 0] = style.transformOrigin.split(' ').map(value => parseFloat(value));
69
- const width = layer.offsetWidth;
70
- const height = layer.offsetHeight;
71
- const centre = matrix.transformPoint(new DOMPoint(width / 2 - originX, height / 2 - originY));
72
- const left = rect.left + rect.width / 2 - centre.x - originX;
73
- const top = rect.top + rect.height / 2 - centre.y - originY;
74
- return new DOMRect(left, top, width, height);
172
+ const [originX = 0, originY = 0] = style.getPropertyValue('transform-origin').split(' ').map(value => parseFloat(value));
173
+ const x = width / 2 - originX;
174
+ const y = height / 2 - originY;
175
+ const centreX = a * x + c * y + e;
176
+ const centreY = b * x + d * y + f;
177
+ const left = rect.left + rect.width / 2 - centreX - originX;
178
+ const top = rect.top + rect.height / 2 - centreY - originY;
179
+ if (!isExact) {
180
+ return new DOMRect(left, top, width, height);
181
+ }
182
+ const snappedLeft = onLayoutGrid(left);
183
+ const snappedTop = onLayoutGrid(top);
184
+ return new DOMRect(snappedLeft, snappedTop, onLayoutGrid(left + width) - snappedLeft, onLayoutGrid(top + height) - snappedTop);
75
185
  }
76
186
 
77
187
  /**
@@ -79,14 +189,15 @@ function untransform(rect, layer, style) {
79
189
  * entry animation (or anything else) applies to it. A Tooltip enters from a
80
190
  * few pixels toward its trigger, scaled down. So the transformed box of a
81
191
  * tooltip that fits beside its trigger can read as covering it while it
82
- * enters. For this one read, the layer's transforms are overridden with
83
- * `none !important`, which outranks an animation. They are restored in the
84
- * same task, so no frame paints in between and the animation keeps running.
85
- * Where the engine still applies an animated transform under that override
86
- * (WebKit), the read box has that transform undone instead (`untransform`). A
87
- * layer that transitions a transform property is not overridden, since
88
- * restoring the value would start that transition. Its box has its transform
89
- * undone.
192
+ * enters. When the transform only translates and scales, `untransform` takes
193
+ * it out of one box read, if `canUndoByCalculation` and `carriesScale` allow
194
+ * it. Nothing is written, so the read forces no extra style or layout work.
195
+ * A layer that transitions a transform is also only read: restoring an
196
+ * overridden value would start that transition. Otherwise one read overrides
197
+ * the layer's transforms with `none !important`, which outranks an animation.
198
+ * The same task restores them, so no frame paints in between and the
199
+ * animation keeps running. WebKit still applies an animated transform under
200
+ * that override, so there the read box has that transform undone instead.
90
201
  */
91
202
  export function settledBox(layer) {
92
203
  const view = layer.ownerDocument.defaultView;
@@ -94,11 +205,19 @@ export function settledBox(layer) {
94
205
  if (style == null || !hasTransform(style)) {
95
206
  return layer.getBoundingClientRect();
96
207
  }
97
- const transitions = style.transitionProperty.split(',').map(p => p.trim());
98
- const durations = style.transitionDuration.split(',').map(parseFloat);
208
+ const matrix = transformOf(style);
209
+ if (matrix != null && isAxisAligned(matrix) && canUndoByCalculation(layer)) {
210
+ const rect = layer.getBoundingClientRect();
211
+ if (carriesScale(rect, style, matrix)) {
212
+ return untransform(rect, layer, style, matrix);
213
+ }
214
+ }
215
+ const transitions = style.getPropertyValue('transition-property').split(',').map(p => p.trim());
216
+ const durations = style.getPropertyValue('transition-duration').split(',').map(parseFloat);
99
217
  const transitioned = transitions.some((name, index) => (name === 'all' || TRANSFORM_PROPERTIES.includes(name)) && (durations[index % durations.length] ?? 0) > 0);
100
218
  if (transitioned) {
101
- return untransform(layer.getBoundingClientRect(), layer, style);
219
+ const rect = layer.getBoundingClientRect();
220
+ return matrix == null ? rect : untransform(rect, layer, style, matrix);
102
221
  }
103
222
  const saved = TRANSFORM_PROPERTIES.map(name => [name, layer.style.getPropertyValue(name), layer.style.getPropertyPriority(name)]);
104
223
  for (const name of TRANSFORM_PROPERTIES) {
@@ -106,7 +225,8 @@ export function settledBox(layer) {
106
225
  }
107
226
  const box = layer.getBoundingClientRect();
108
227
  const under = view?.getComputedStyle(layer);
109
- const settled = under != null && hasTransform(under) ? untransform(box, layer, under) : box;
228
+ const underMatrix = under != null && hasTransform(under) ? transformOf(under) : null;
229
+ const settled = under != null && underMatrix != null ? untransform(box, layer, under, underMatrix) : box;
110
230
  for (const [name, value, priority] of saved) {
111
231
  if (value === '') {
112
232
  layer.style.removeProperty(name);
@@ -1 +1 @@
1
- {"version":3,"file":"toastHost.d.ts","sourceRoot":"","sources":["../../src/Layer/toastHost.tsx"],"names":[],"mapp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AK,EAAE,UAAU,GAChB;IAAC,QAAQ,EAAE,CAAC,GAAG,SAAS,CAAC;IAAC,SAAS,EAAE,OAAO,CAAA;CAAC,CAS/C;AAED,yDAAyD;AACzD,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,EAAE,gBAAgB,CAAC,UAAU,CAAC,CAAC;IACxC,UAAU,CAAC,EAAE,gBAAgB,CAAC,YAAY,CAAC,CAAC;IAC5C,KAAK,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAClC,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAKD;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,aAAa,CAAC,cAAc,CAAC,GAAG,IAAI,CAQ3E;AAcD;;;GAGG;AACH,MAAM,WAAW,UAAU;IACzB,6EAA6E;IAC7E,QAAQ,CAAC,OAAO,EAAE,iBAAiB,CAAC;IACpC,oEAAoE;IACpE,OAAO,EAAE,CAAC,QAAQ,EAAE,iBAAiB,GAAG,IAAI,KAAK,IAAI,CAAC;CACvD;AAED,wBAAgB,gBAAgB,IAAI,UAAU,CAsD7C;AAED,6EAA6E;AAC7E,wBAAgB,mBAAmB,CAAC,EAAC,KAAK,EAAC,EAAE;IAAC,KAAK,EAAE,UAAU,CAAA;CAAC,QAgB/D;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,EAAC,QAAQ,EAAE,GAAG,MAAM,EAAC,EAAE,cAAc,+BAapE"}
@@ -14,7 +14,8 @@
14
14
  * SYNC: When modified, update /packages/core/src/Layer/toastHost.test.tsx and
15
15
  * /docs/architecture/layer-runtime.md
16
16
  */
17
- import { createContext, use, useEffect, useState, useSyncExternalStore } from 'react';
17
+ import { use, useEffect, useState, useSyncExternalStore } from 'react';
18
+ import { createSharedContext } from "../utils/sharedContext.js";
18
19
 
19
20
  /** Internal context value for toast state management. */
20
21
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
@@ -23,7 +24,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
23
24
  * provide it without importing Toast. With no provider it is null, and
24
25
  * `useToast` mounts a viewport of its own.
25
26
  */
26
- export const ToastContext = /*#__PURE__*/createContext(null);
27
+ export const ToastContext = createSharedContext('ToastContext', 1, null);
27
28
  ToastContext.displayName = 'ToastContext';
28
29
 
29
30
  /**
@@ -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,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,kBAAkB,CAAC;AA8JnD;;GAEG;AACH,UAAU,kBAAkB;IAC1B,aAAa,EAAE,KAAK,CAAC,mBAAmB,CAAC,WAAW,CAAC,CAAC;IACtD;;;OAGG;IACH,cAAc,EAAE,KAAK,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC;CACtD;AAED;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,KAAK,CAAC;AAEjE;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;AAExD;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC;;;;;;;;;;;;;;OAcG;IACH,WAAW,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAClC;;;OAGG;IACH,SAAS,CAAC,EAAE,cAAc,CAAC;IAC3B;;;OAGG;IACH,SAAS,CAAC,EAAE,cAAc,CAAC;IAC3B;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,YAAY,C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