@astryx-vue/core 0.41.1 → 0.42.1

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 (265) hide show
  1. package/dist/AlertDialog/index.js +1 -1
  2. package/dist/{AlertDialog-DxrO48Kg.js → AlertDialog-Cld8wc2u.js} +3 -3
  3. package/dist/AvatarGroup/index.d.ts +1 -1
  4. package/dist/AvatarGroup/index.js +1 -1
  5. package/dist/{AvatarGroup-BZ5iG7M-.js → AvatarGroup-CU1zqtTi.js} +1 -1
  6. package/dist/Banner/index.d.ts +1 -1
  7. package/dist/Banner/index.js +1 -1
  8. package/dist/{Banner-0YtnbBU6.js → Banner-5KOS4fe8.js} +1 -1
  9. package/dist/BottomSheet/index.d.ts +1 -1
  10. package/dist/Breadcrumbs/index.d.ts +2 -2
  11. package/dist/Breadcrumbs/index.js +2 -2
  12. package/dist/{Breadcrumbs-9KMHiyXr.js → Breadcrumbs-aups8a9Y.js} +1 -1
  13. package/dist/Button/index.d.ts +1 -1
  14. package/dist/Button/index.js +1 -1
  15. package/dist/{Button-ClyetTf6.js → Button-tVILPfaj.js} +2 -2
  16. package/dist/ButtonGroup/index.d.ts +1 -1
  17. package/dist/ButtonGroup/index.js +1 -1
  18. package/dist/{ButtonGroup-tk0H2O8q.js → ButtonGroup-D7p8oEry.js} +2 -2
  19. package/dist/Calendar/index.d.ts +1 -1
  20. package/dist/Calendar/index.js +2 -2
  21. package/dist/{Calendar-CfhOlgQJ.js → Calendar-Brz2iDeZ.js} +1 -1
  22. package/dist/{Calendar-DbAQvHgy.js → Calendar-C1E1ZiaS.js} +1 -1
  23. package/dist/Carousel/index.d.ts +1 -1
  24. package/dist/Carousel/index.js +1 -1
  25. package/dist/{Carousel-utfvjW5p.js → Carousel-DlHeba5J.js} +1 -1
  26. package/dist/Center/index.d.ts +1 -1
  27. package/dist/Chat/index.d.ts +1 -1
  28. package/dist/Chat/index.js +1 -1
  29. package/dist/{Chat-DL583Xle.js → Chat-B54dCjhV.js} +3 -3
  30. package/dist/CheckboxInput/index.d.ts +1 -1
  31. package/dist/CheckboxInput/index.js +1 -1
  32. package/dist/{CheckboxInput-BQH87pfn.js → CheckboxInput-BhKf3JOh.js} +4 -4
  33. package/dist/CheckboxList/index.d.ts +1 -1
  34. package/dist/CheckboxList/index.js +1 -1
  35. package/dist/{CheckboxListItem-BL7gDglY.js → CheckboxListItem-BhLPvY5v.js} +4 -4
  36. package/dist/ClickableCard/index.d.ts +1 -1
  37. package/dist/ClickableCard/index.js +1 -1
  38. package/dist/{ClickableCard-CdByvXDr.js → ClickableCard-DyBa2X4I.js} +1 -1
  39. package/dist/Code/index.js +2 -2
  40. package/dist/{Code-KvqZ1ZES.js → Code-BtJV5J-h.js} +1 -1
  41. package/dist/{CodeBlock-e2rlXQWO.js → CodeBlock-D1i3lEK3.js} +1 -1
  42. package/dist/Collapsible/index.js +1 -1
  43. package/dist/{Collapsible-CTc7irlw.js → Collapsible-CXbcOn80.js} +1 -1
  44. package/dist/CommandPalette/index.js +1 -1
  45. package/dist/{CommandPalette-PBYSDIpx.js → CommandPalette-DyjB9xE_.js} +1 -1
  46. package/dist/ComplexSelector/index.js +1 -1
  47. package/dist/{ComplexSelector-CPg5jcdL.js → ComplexSelector-MRuOupEd.js} +2 -2
  48. package/dist/ContextMenu/index.d.ts +2 -2
  49. package/dist/ContextMenu/index.js +2 -2
  50. package/dist/{ContextMenu-DcZEviKv.js → ContextMenu-Bb8ALZmI.js} +1 -1
  51. package/dist/DateInput/index.d.ts +1 -1
  52. package/dist/DateInput/index.js +1 -1
  53. package/dist/{DateInput-C4qtEFDW.js → DateInput-DNWMgvU1.js} +579 -78
  54. package/dist/DateRangeInput/index.d.ts +1 -1
  55. package/dist/DateRangeInput/index.js +1 -1
  56. package/dist/{DateRangeInput-CGqCQAlT.js → DateRangeInput-B8ZWK6sm.js} +4 -4
  57. package/dist/DateTimeInput/index.d.ts +1 -1
  58. package/dist/DateTimeInput/index.js +1 -1
  59. package/dist/{DateTimeInput-CAirxttc.js → DateTimeInput--BzV0yww.js} +4 -4
  60. package/dist/Dialog/index.d.ts +1 -1
  61. package/dist/Dialog/index.js +1 -1
  62. package/dist/{DialogHeader-BS8mjD8z.js → DialogHeader-B4cnOihd.js} +1 -1
  63. package/dist/Drawer/index.d.ts +1 -1
  64. package/dist/Drawer/index.js +1 -1
  65. package/dist/{Drawer-Cq1Y_1iJ.js → Drawer-dk9etcN3.js} +1 -1
  66. package/dist/DropdownMenu/index.d.ts +2 -2
  67. package/dist/DropdownMenu/index.js +2 -2
  68. package/dist/{DropdownMenu-CSn1OQ2D.js → DropdownMenu-DUGWNcnG.js} +3 -3
  69. package/dist/{DropdownMenuRadioItem.vue-BFCbIBfb.d.ts → DropdownMenuRadioItem.vue-BrcSzOfA.d.ts} +1 -1
  70. package/dist/Field/index.js +3 -3
  71. package/dist/{Field-BzGwGqwa.js → Field-B_GThk2X.js} +1 -1
  72. package/dist/{FieldInfoTip-DqsdZxo0.js → FieldInfoTip-jhm02XZs.js} +1 -1
  73. package/dist/{FieldLabel-DdMLaCP_.js → FieldLabel-C0XDwWCd.js} +1 -1
  74. package/dist/FileInput/index.js +1 -1
  75. package/dist/{FileInput-B_BXknEU.js → FileInput-CbXrw3RO.js} +3 -3
  76. package/dist/{geometry-ae8bOxQ5.js → GestureHost-DXCQkur5.js} +1 -28
  77. package/dist/HoverCard/index.d.ts +1 -1
  78. package/dist/IconButton/index.js +1 -1
  79. package/dist/{IconButton-kj1M_L7a.js → IconButton-CU1kvO7X.js} +1 -1
  80. package/dist/InfoTip/index.d.ts +1 -1
  81. package/dist/InfoTip/index.js +1 -1
  82. package/dist/{InfoTip-DJIb8b29.js → InfoTip-BwxUx7Hk.js} +1 -1
  83. package/dist/{InputClearButton-wd0VoZja.js → InputClearButton-CN8J7JOl.js} +1 -1
  84. package/dist/InputGroup/index.d.ts +1 -1
  85. package/dist/InputGroup/index.js +1 -1
  86. package/dist/{InputGroup-DGiF9Xaz.js → InputGroup-Ca-SOzyp.js} +1 -1
  87. package/dist/InternationalizationProvider/index.d.ts +1 -1
  88. package/dist/InternationalizationProvider/index.js +2 -1
  89. package/dist/{InternationalizationProvider-C37KH-mM.js → InternationalizationProvider-CfP0uroW.js} +5 -61
  90. package/dist/Item-D8Ads8bS.js +1476 -0
  91. package/dist/Lightbox/index.js +1 -1
  92. package/dist/{Lightbox-Fu6RCX0k.js → Lightbox-CkxNUYwN.js} +7 -6
  93. package/dist/Link/index.d.ts +1 -1
  94. package/dist/Link/index.js +1 -1
  95. package/dist/{Link-zPVCNAM6.js → Link-B5CJso43.js} +1 -1
  96. package/dist/List/index.d.ts +3 -2
  97. package/dist/List/index.js +4 -4
  98. package/dist/{List-D4w6clf-.js → List-KQNWaT-8.js} +2 -2
  99. package/dist/{ListItem-uvJaYGOJ.js → ListItem-C4BtWXV4.js} +8 -3
  100. package/dist/Markdown/index.d.ts +1 -1
  101. package/dist/Markdown/index.js +1 -1
  102. package/dist/{Markdown-BiXz75mz.js → Markdown-BFV7g8oa.js} +118 -59
  103. package/dist/MoreMenu/index.d.ts +1 -1
  104. package/dist/MoreMenu/index.js +1 -1
  105. package/dist/{MoreMenu-CgT9SajI.js → MoreMenu-D0HoYZU0.js} +2 -2
  106. package/dist/MultiSelector/index.d.ts +1 -1
  107. package/dist/MultiSelector/index.js +1 -1
  108. package/dist/{MultiSelector-CaL3UDIc.js → MultiSelector-BLESAk-K.js} +3 -3
  109. package/dist/NavItem/index.d.ts +1 -1
  110. package/dist/NavItem/index.js +1 -1
  111. package/dist/{NavItem-D_1ecPv_.js → NavItem-BR639emm.js} +1 -1
  112. package/dist/NavMenu/index.js +1 -1
  113. package/dist/{NavMenuItem-DqBCA1VP.js → NavMenuItem-C9e62bSc.js} +1 -1
  114. package/dist/NumberInput/index.d.ts +1 -1
  115. package/dist/NumberInput/index.js +1 -1
  116. package/dist/{NumberInput-0lTA5weY.js → NumberInput-C7cRBlQm.js} +3 -3
  117. package/dist/Outline/index.js +1 -1
  118. package/dist/{Outline-BoxN40Bd.js → Outline-BcZMmO9Y.js} +1 -1
  119. package/dist/OverflowList/index.d.ts +1 -1
  120. package/dist/OverflowList/index.js +1 -1
  121. package/dist/{OverflowList-7oui4oT5.js → OverflowList-cjl0AaEP.js} +1 -1
  122. package/dist/Pagination/index.d.ts +1 -1
  123. package/dist/Pagination/index.js +1 -1
  124. package/dist/{Pagination-BrkX0lga.js → Pagination-BnA277o8.js} +2 -2
  125. package/dist/{PanGestureRecognizer-BFSO5U4N.js → PanGestureRecognizer-KxZE-pUT.js} +2 -1
  126. package/dist/{PickerWheel-CWT7l-9Q.js → PickerWheel-YgYMcbJF.js} +4 -4
  127. package/dist/Popover/index.d.ts +1 -1
  128. package/dist/Popover/index.js +1 -1
  129. package/dist/{Popover-BZ4VWDtv.js → Popover-DfO-mkcm.js} +1 -1
  130. package/dist/PowerSearch/index.d.ts +1 -1
  131. package/dist/PowerSearch/index.js +1 -1
  132. package/dist/{PowerSearch-BSoQJbHK.js → PowerSearch-BjAYndzP.js} +20 -20
  133. package/dist/{PressTracker-DDRxFc0Y.js → PressTracker-C8_fTdjp.js} +1 -1
  134. package/dist/ProgressBar/index.d.ts +1 -1
  135. package/dist/Radio/index.d.ts +1 -1
  136. package/dist/Radio/index.js +1 -1
  137. package/dist/{RadioGroup-CrRm7H51.js → RadioGroup-CVOlUPbf.js} +4 -4
  138. package/dist/RadioList/index.d.ts +1 -1
  139. package/dist/RadioList/index.js +1 -1
  140. package/dist/{RadioListItem-iPD3y2Eo.js → RadioListItem-5y613Xrt.js} +1 -1
  141. package/dist/ScrollableArea/index.d.ts +1 -1
  142. package/dist/SegmentedControl/index.js +1 -1
  143. package/dist/{SegmentedControl-D8A_jaFC.js → SegmentedControl-D32lkJFq.js} +6 -6
  144. package/dist/SelectableCard/index.d.ts +1 -1
  145. package/dist/SelectableCard/index.js +1 -1
  146. package/dist/{SelectableCard-DIruuGBa.js → SelectableCard-C2hl7HBW.js} +1 -1
  147. package/dist/Selector/index.d.ts +1 -1
  148. package/dist/Selector/index.js +1 -1
  149. package/dist/{Selector-CFdM10Uc.js → Selector-Dw_0e0zY.js} +1 -1
  150. package/dist/SideNav/index.d.ts +1 -1
  151. package/dist/SideNav/index.js +1 -1
  152. package/dist/{SideNav-Cl1H-baW.js → SideNav-dsff7R2R.js} +2 -2
  153. package/dist/Slider/index.js +1 -1
  154. package/dist/{Slider-Bd3wpFo7.js → Slider-CUgeJ1z4.js} +6 -6
  155. package/dist/Stack/index.d.ts +1 -1
  156. package/dist/Stepper/index.js +1 -1
  157. package/dist/{Stepper-CZU_Zvi5.js → Stepper-BYZasZK7.js} +1 -1
  158. package/dist/Swipe/index.d.ts +3 -0
  159. package/dist/Swipe/index.js +2 -0
  160. package/dist/Switch/index.d.ts +1 -1
  161. package/dist/Switch/index.js +1 -1
  162. package/dist/{Switch-BpkKyz98.js → Switch-BtcR2oin.js} +6 -6
  163. package/dist/TabList/index.js +1 -1
  164. package/dist/{TabList-DZ2i0QIt.js → TabList-O34fxJlZ.js} +1 -1
  165. package/dist/Table/index.d.ts +1 -1
  166. package/dist/Table/index.js +1 -1
  167. package/dist/{Table-fSipO9Ju.js → Table-BrvIqSdi.js} +11 -11
  168. package/dist/{TapGestureRecognizer-DCiP88h8.js → TapGestureRecognizer-o0LVjFFm.js} +3 -2
  169. package/dist/TextArea/index.d.ts +1 -1
  170. package/dist/TextArea/index.js +1 -1
  171. package/dist/{TextArea-D5aDDlgr.js → TextArea-TO_A1D_W.js} +4 -4
  172. package/dist/TextInput/index.d.ts +1 -1
  173. package/dist/TextInput/index.js +1 -1
  174. package/dist/{TextInput-CVRWRtoL.js → TextInput-jIBboBDS.js} +4 -4
  175. package/dist/Thumbnail/index.js +1 -1
  176. package/dist/{Thumbnail-zFN5p6dk.js → Thumbnail-CRltyNsq.js} +2 -2
  177. package/dist/{TimeField-B49DgkyR.js → TimeField-DBKAGPKU.js} +2 -2
  178. package/dist/TimeInput/index.d.ts +1 -1
  179. package/dist/TimeInput/index.js +1 -1
  180. package/dist/{TimeInput-BoFij92p.js → TimeInput-CEUlNlhY.js} +2 -2
  181. package/dist/Timestamp/index.d.ts +1 -1
  182. package/dist/Timestamp/index.js +1 -1
  183. package/dist/{Timestamp-DunFvQYG.js → Timestamp-s4Nksy5i.js} +1 -1
  184. package/dist/Toast/index.js +1 -1
  185. package/dist/{Toast-BnIq3gzw.js → Toast-BsW7tvzK.js} +3 -3
  186. package/dist/ToggleButton/index.d.ts +1 -1
  187. package/dist/ToggleButton/index.js +1 -1
  188. package/dist/{ToggleButton-CLgj6yLQ.js → ToggleButton-DZgHhJd7.js} +3 -3
  189. package/dist/Token/index.d.ts +1 -1
  190. package/dist/Token/index.js +1 -1
  191. package/dist/{Token-BPjnWrHl.js → Token-B6mV8hyk.js} +1 -1
  192. package/dist/Tokenizer/index.d.ts +1 -1
  193. package/dist/Tokenizer/index.js +1 -1
  194. package/dist/{Tokenizer-CMv-Bi0y.js → Tokenizer-BvCiuyhk.js} +5 -5
  195. package/dist/Toolbar/index.d.ts +1 -1
  196. package/dist/Tooltip/index.d.ts +1 -1
  197. package/dist/TopNav/index.d.ts +1 -1
  198. package/dist/TopNav/index.js +1 -1
  199. package/dist/{TopNav-DUkn4CMv.js → TopNav-xKD14HTR.js} +2 -2
  200. package/dist/TreeList/index.js +1 -1
  201. package/dist/{TreeList-o5MrA7rz.js → TreeList-BOr0GpJC.js} +1 -1
  202. package/dist/Typeahead/index.js +1 -1
  203. package/dist/{Typeahead-DXlsxjkQ.js → Typeahead-C18-lx2P.js} +3 -3
  204. package/dist/{accessibleName-9UI6HUaA.js → accessibleName-Br2Ex6ub.js} +1 -1
  205. package/dist/{boxHold-DfsWCZLh.js → boxHold-BCbXt9_d.js} +1 -1
  206. package/dist/{chat-BUFYB3bA.js → chat-DPxoTm_S.js} +2 -0
  207. package/dist/composables/index.js +5 -4
  208. package/dist/{composables-Dzpv7G2Z.js → composables-BTTLiP-q.js} +6 -476
  209. package/dist/context-BNCjTOCB.js +60 -0
  210. package/dist/createSwipe-DXObfkyb.js +77 -0
  211. package/dist/geometry-BDCUnbgh.js +28 -0
  212. package/dist/{index-ZKBj_1nu.d.ts → index-3LdpzxQZ.d.ts} +2 -2
  213. package/dist/{index-DYabo8TI.d.ts → index-B44fLswd.d.ts} +2 -2
  214. package/dist/{index-C2dLjYoW.d.ts → index-B8XkUCzI.d.ts} +1 -1
  215. package/dist/{index-0RIgvtdm.d.ts → index-CArP_6wv.d.ts} +1 -1
  216. package/dist/{index-CbA8rR_b.d.ts → index-CBOv5j3c.d.ts} +1 -1
  217. package/dist/{index-COgrQZIL.d.ts → index-CdvmnNMH.d.ts} +1 -1
  218. package/dist/{index-uWIhWgDN.d.ts → index-ChHpLHhd.d.ts} +48 -47
  219. package/dist/{index-BB9acgK8.d.ts → index-D7ShT2c-.d.ts} +2 -2
  220. package/dist/{index-BItxjc3w.d.ts → index-DOqxWQJp.d.ts} +1 -1
  221. package/dist/index-DPsvfn2V.d.ts +25 -0
  222. package/dist/{index-DofC9Rll.d.ts → index-Dk50Zh3F.d.ts} +2 -2
  223. package/dist/{index-BDJQW9cW.d.ts → index-DwUUuRyC.d.ts} +54 -1
  224. package/dist/{index-CJT9kM7e.d.ts → index-HzXA230A.d.ts} +2 -2
  225. package/dist/{index-DgNCHxvu.d.ts → index-J83fLEyo.d.ts} +2 -2
  226. package/dist/{index-CuW4AQ7M.d.ts → index-MOtVbTwK.d.ts} +2 -2
  227. package/dist/{index-YP5WRwXH.d.ts → index-MiZ3p4b6.d.ts} +6 -6
  228. package/dist/{index-COqeB2ug.d.ts → index-Nln6FiRr.d.ts} +1 -1
  229. package/dist/{index-4_uuTfaY.d.ts → index-VWHtgjGh.d.ts} +1 -1
  230. package/dist/{index-LYiWcVDD.d.ts → index-WqOwd8r8.d.ts} +3 -3
  231. package/dist/{index-BKnyTWPM.d.ts → index-ZbNwGVkS.d.ts} +1 -1
  232. package/dist/{index-CCa_dvoF.d.ts → index-m-fFGq2e.d.ts} +2 -2
  233. package/dist/{index-BenG-F5d.d.ts → index-maTGrWjF.d.ts} +1 -1
  234. package/dist/{index-BFPb14Xj.d.ts → index-zjungCKE.d.ts} +6 -6
  235. package/dist/index.d.ts +29 -27
  236. package/dist/index.js +87 -83
  237. package/dist/itemSlots-DA-FyuMF.js +539 -0
  238. package/dist/{loadCatalog-DfwwR4ox.d.ts → loadCatalog-Cm394Q3F.d.ts} +2 -0
  239. package/dist/{loadCatalog-Dvlsgn71.js → loadCatalog-DXx3soG1.js} +2 -1
  240. package/dist/locale/index.d.ts +2 -2
  241. package/dist/locale/index.js +3 -3
  242. package/dist/{locale-BgXR3tSm.js → locale-5NXEHp0U.js} +1 -1
  243. package/dist/{pressSlot-5Bp-B175.js → pressSlot-31XyOhUS.js} +20 -2
  244. package/dist/scrollAnchoring-CNplZXRt.js +60 -0
  245. package/dist/{snapPagingCatcher-RkUaZdWD.js → snapPagingCatcher-BA7qwhj3.js} +3 -2
  246. package/dist/swipeHost-B2OlVVZt.d.ts +73 -0
  247. package/dist/{types-D9mwL8sz.d.ts → types-wKC-Ws-M.d.ts} +29 -10
  248. package/dist/{useActionGroupTracking-Cujjrmt3.js → useActionGroupTracking-CioHSqgG.js} +2 -2
  249. package/dist/{useCalendarGrid-0WvxbeFC.js → useCalendarGrid-BpBA8UZa.js} +1 -1
  250. package/dist/{useChatStreamScroll-BQpGHGAr.js → useChatStreamScroll-CGHtw12w.js} +1 -59
  251. package/dist/{useGestureRecognizer-CtfxP4uw.js → useGestureRecognizer-BSy0RhLT.js} +1 -1
  252. package/dist/{useInputStatusIcon-2sRn-Nbf.js → useInputStatusIcon-D0xNp9jO.js} +1 -1
  253. package/dist/{usePressFeedback-Ber7MRiI.js → usePressFeedback-D4oohqP5.js} +1 -1
  254. package/dist/{useTouchHitArea-B6g7fhfF.js → useTouchHitArea-rwyNMxFb.js} +1 -1
  255. package/dist/utils/index.d.ts +2 -2
  256. package/dist/utils/index.js +3 -2
  257. package/dist/utils-DkwunocO.js +348 -0
  258. package/package.json +5 -1
  259. package/styles/date-input.css +36 -0
  260. package/styles/list.css +125 -69
  261. package/styles/markdown.css +17 -0
  262. package/dist/Item-DC1v56yE.js +0 -723
  263. package/dist/itemSlots-BxUu7hje.js +0 -54
  264. package/dist/utils-BW62BpDR.js +0 -135
  265. package/dist/{index-D8lv2BiD.d.ts → index-J6YRJ7Ul.d.ts} +1 -1
@@ -0,0 +1,348 @@
1
+ import { l as isNode, o as isDocument } from "./flatTree-BB4yPMNL.js";
2
+ import { a as subscribeInput } from "./inputStream-DmPkJ1aU.js";
3
+ import { t as getGestureHost } from "./GestureHost-DXCQkur5.js";
4
+ import { r as watchCoarsePointer, t as isCoarsePointer } from "./coarsePointer-BWNSUIY8.js";
5
+ import { t as useAttachment } from "./useAttachment-CGiD9rt6.js";
6
+ //#region src/gestures/fingerScroll.ts
7
+ /**
8
+ * Where the browser sends no `scrollend`, how long a finger-driven scroller
9
+ * stays quiet (no scroll event) before its scroll counts as ended, in ms:
10
+ * longer than the gap between a momentum scroll's events, short enough that
11
+ * a program's scroll right after it is not read as the finger's.
12
+ */
13
+ const SCROLL_END_FALLBACK_MS = 150;
14
+ const watches = /* @__PURE__ */ new WeakMap();
15
+ /**
16
+ * A scroller's finger scroll is over at `at`. It stops counting as the
17
+ * finger's, and its span stays readable. Then its end listeners hear of it,
18
+ * so one that reads isFingerScroll already reads false.
19
+ */
20
+ function endFingerScroll(watch, scroller, at) {
21
+ if (!watch.fingerScrollers.delete(scroller)) return;
22
+ watch.lastFingerScrolls.set(scroller, {
23
+ start: watch.fingerScrollStarts.get(scroller) ?? at,
24
+ end: at
25
+ });
26
+ watch.fingerScrollStarts.delete(scroller);
27
+ for (const listener of [...watch.endListeners.get(scroller) ?? []]) listener();
28
+ }
29
+ function start(host, watch) {
30
+ const doc = host.document;
31
+ const now = () => (doc.defaultView?.performance ?? performance).now();
32
+ const scrollerOf = (event) => {
33
+ const target = event.target === doc ? doc : event.target;
34
+ return isNode(target) ? target : null;
35
+ };
36
+ const endScroll = (scroller) => {
37
+ if (!watch.fingerScrollers.has(scroller)) return;
38
+ if (host.isFingerDownIn(scroller)) watch.endedWhileDown.add(scroller);
39
+ else endFingerScroll(watch, scroller, now());
40
+ };
41
+ const scrollEndFallbacks = /* @__PURE__ */ new Map();
42
+ const clearScrollEndFallback = (scroller) => {
43
+ const timer = scrollEndFallbacks.get(scroller);
44
+ if (timer != null) {
45
+ clearTimeout(timer);
46
+ scrollEndFallbacks.delete(scroller);
47
+ }
48
+ };
49
+ const hasScrollEnd = () => {
50
+ const view = doc.defaultView;
51
+ return view != null && "onscrollend" in view;
52
+ };
53
+ const onScroll = (event) => {
54
+ const scroller = scrollerOf(event);
55
+ if (scroller == null || !watch.scrollers.has(scroller) || host.isOwnScroll(scroller)) return;
56
+ watch.endedWhileDown.delete(scroller);
57
+ if (host.isFingerDownIn(scroller)) {
58
+ if (!watch.fingerScrollers.has(scroller)) watch.fingerScrollStarts.set(scroller, watch.landings.get(scroller) ?? now());
59
+ watch.fingerScrollers.add(scroller);
60
+ }
61
+ if (watch.fingerScrollers.has(scroller) && !hasScrollEnd()) {
62
+ clearScrollEndFallback(scroller);
63
+ scrollEndFallbacks.set(scroller, setTimeout(() => {
64
+ scrollEndFallbacks.delete(scroller);
65
+ endScroll(scroller);
66
+ }, SCROLL_END_FALLBACK_MS));
67
+ }
68
+ };
69
+ const onScrollEnd = (event) => {
70
+ const scroller = scrollerOf(event);
71
+ if (scroller != null) endScroll(scroller);
72
+ };
73
+ const onFingers = () => {
74
+ for (const scroller of watch.scrollers.keys()) if (!host.isFingerDownIn(scroller)) watch.landings.delete(scroller);
75
+ else if (!watch.landings.has(scroller)) watch.landings.set(scroller, now());
76
+ for (const scroller of watch.endedWhileDown) if (!host.isFingerDownIn(scroller)) {
77
+ watch.endedWhileDown.delete(scroller);
78
+ endFingerScroll(watch, scroller, now());
79
+ }
80
+ };
81
+ const view = doc.defaultView;
82
+ let unsubscribers = [];
83
+ const listen = (on) => {
84
+ if (view == null || on === unsubscribers.length > 0) return;
85
+ if (on) unsubscribers = [subscribeInput(view, "scroll", onScroll), subscribeInput(view, "scrollend", onScrollEnd)];
86
+ else {
87
+ for (const stop of unsubscribers.splice(0)) stop();
88
+ for (const scroller of [...scrollEndFallbacks.keys()]) clearScrollEndFallback(scroller);
89
+ watch.endedWhileDown.clear();
90
+ watch.landings.clear();
91
+ for (const scroller of [...watch.fingerScrollers]) endFingerScroll(watch, scroller, now());
92
+ }
93
+ };
94
+ const stopWatchingPointer = watchCoarsePointer(view, listen);
95
+ listen(isCoarsePointer(view));
96
+ const unsubscribe = host.onFingersChange(onFingers);
97
+ const release = host.retain();
98
+ return () => {
99
+ stopWatchingPointer();
100
+ listen(false);
101
+ unsubscribe();
102
+ release();
103
+ };
104
+ }
105
+ /**
106
+ * Keep track of whether the scrolls of `scroller` (an element in `host`'s
107
+ * document, or the document itself) are a finger's, for isFingerScroll,
108
+ * until the returned function runs. `onEnd`, when given, runs each time a
109
+ * finger's scroll on the scroller ends (its `scrollend` after the lift, the
110
+ * lift after a `scrollend` that came while the finger rested, the quiet
111
+ * fallback, or the pointer turning fine), after isFingerScroll turns false.
112
+ * Stopping the watch does not call it.
113
+ * Internal: not exported from the package.
114
+ */
115
+ function watchFingerScrolls(host, scroller, onEnd) {
116
+ let watch = watches.get(host);
117
+ if (watch == null) {
118
+ watch = {
119
+ scrollers: /* @__PURE__ */ new Map(),
120
+ fingerScrollers: /* @__PURE__ */ new Set(),
121
+ endedWhileDown: /* @__PURE__ */ new Set(),
122
+ endListeners: /* @__PURE__ */ new Map(),
123
+ landings: /* @__PURE__ */ new Map(),
124
+ fingerScrollStarts: /* @__PURE__ */ new Map(),
125
+ lastFingerScrolls: /* @__PURE__ */ new Map(),
126
+ stop: null
127
+ };
128
+ watches.set(host, watch);
129
+ }
130
+ const owned = watch;
131
+ owned.scrollers.set(scroller, (owned.scrollers.get(scroller) ?? 0) + 1);
132
+ const listener = onEnd == null ? null : () => onEnd();
133
+ if (listener != null) {
134
+ const listeners = owned.endListeners.get(scroller) ?? /* @__PURE__ */ new Set();
135
+ listeners.add(listener);
136
+ owned.endListeners.set(scroller, listeners);
137
+ }
138
+ owned.stop ??= start(host, owned);
139
+ let isWatching = true;
140
+ return () => {
141
+ if (!isWatching) return;
142
+ isWatching = false;
143
+ if (listener != null) {
144
+ const listeners = owned.endListeners.get(scroller);
145
+ listeners?.delete(listener);
146
+ if (listeners?.size === 0) owned.endListeners.delete(scroller);
147
+ }
148
+ const count = (owned.scrollers.get(scroller) ?? 1) - 1;
149
+ if (count > 0) {
150
+ owned.scrollers.set(scroller, count);
151
+ return;
152
+ }
153
+ owned.scrollers.delete(scroller);
154
+ owned.fingerScrollers.delete(scroller);
155
+ owned.endedWhileDown.delete(scroller);
156
+ owned.landings.delete(scroller);
157
+ owned.fingerScrollStarts.delete(scroller);
158
+ owned.lastFingerScrolls.delete(scroller);
159
+ if (owned.scrollers.size === 0) {
160
+ owned.stop?.();
161
+ owned.stop = null;
162
+ }
163
+ };
164
+ }
165
+ /**
166
+ * Whether the scroll now moving a watched `scroller` is a finger's. Given a
167
+ * time on the page's clock (`performance.now()`, like an IntersectionObserver
168
+ * entry's `time`), whether the scroll at that time was a finger's. A finger's
169
+ * scroll runs from the finger's landing to its end, momentum included. A
170
+ * report that runs late, such as an IntersectionObserver callback on a busy
171
+ * page, passes the time it describes.
172
+ * Internal: not exported from the package.
173
+ */
174
+ function isFingerScroll(host, scroller, at) {
175
+ const watch = watches.get(host);
176
+ if (watch == null) return false;
177
+ if (at == null) return watch.fingerScrollers.has(scroller);
178
+ const start = watch.fingerScrollStarts.get(scroller);
179
+ if (start != null && at >= start) return true;
180
+ const last = watch.lastFingerScrolls.get(scroller);
181
+ return last != null && at >= last.start && at <= last.end;
182
+ }
183
+ //#endregion
184
+ //#region src/gestures/useFingerScroll.ts
185
+ /** The document a scroller is in: itself, for the page's own scroll. */
186
+ function documentOf(node) {
187
+ return isDocument(node) ? node : node.ownerDocument;
188
+ }
189
+ /**
190
+ * Watch a scroller's finger scrolls. Pass a ref or getter naming a
191
+ * scrolling element, or the document for the page's own scroll. Returns a
192
+ * reader: `true` while the scroller's scroll is a finger's. Given a time on
193
+ * the page's clock (`performance.now()`, as an IntersectionObserver entry's
194
+ * `time` is), it reads whether the scroll at that time was a finger's.
195
+ * Internal: exported from the package only as `unstable_useFingerScroll`.
196
+ */
197
+ function useFingerScroll(scroller, { onEnd } = {}) {
198
+ /** The node the watch is on now, for the reader. */
199
+ let watched = null;
200
+ useAttachment(scroller, (node) => {
201
+ watched = node;
202
+ const stop = watchFingerScrolls(getGestureHost(documentOf(node)), node, () => onEnd?.());
203
+ return () => {
204
+ stop();
205
+ watched = null;
206
+ };
207
+ });
208
+ return (at) => {
209
+ const node = watched;
210
+ return node != null && isFingerScroll(getGestureHost(documentOf(node)), node, at);
211
+ };
212
+ }
213
+ //#endregion
214
+ //#region src/utils/chainEventHandlers.ts
215
+ /**
216
+ * 把多个事件处理函数串成一个。每个函数都会按参数顺序执行。
217
+ *
218
+ * 和「前一个调用了 preventDefault 就跳过后面」不同:组件自己的处理函数
219
+ * 不能把事件藏起来,调用方也不能用 preventDefault 取消组件的行为。
220
+ */
221
+ function chainEventHandlers(...handlers) {
222
+ return (event) => {
223
+ for (const handler of handlers) handler?.(event);
224
+ };
225
+ }
226
+ //#endregion
227
+ //#region src/utils/dateTypes.ts
228
+ /** Weekday names indexed by {@link DayOfWeek} (0 = Sunday). */
229
+ const WEEKDAY_NAMES = [
230
+ "sun",
231
+ "mon",
232
+ "tue",
233
+ "wed",
234
+ "thu",
235
+ "fri",
236
+ "sat"
237
+ ];
238
+ /**
239
+ * Normalize a weekday to its numeric {@link DayOfWeek}. Accepts either a
240
+ * number (0–6) or a three-letter day name ('sun'–'sat', case-insensitive),
241
+ * so APIs like `weekStartsOn` can take whichever is more readable at the
242
+ * call site. Unrecognized values fall back to 0 (Sunday).
243
+ */
244
+ function normalizeDayOfWeek(value) {
245
+ if (typeof value === "number") return value;
246
+ const index = WEEKDAY_NAMES.indexOf(value.toLowerCase());
247
+ return index === -1 ? 0 : index;
248
+ }
249
+ //#endregion
250
+ //#region src/utils/groupItems.ts
251
+ /** 读出条目上的组名。不是字符串就不算分组。空字符串仍算一个组名。 */
252
+ function getItemGroup(item) {
253
+ const aux = item.auxiliaryData;
254
+ if (aux == null || typeof aux !== "object") return void 0;
255
+ const group = aux.group;
256
+ return typeof group === "string" ? group : void 0;
257
+ }
258
+ /**
259
+ * 按 `auxiliaryData.group` 分组,组的先后跟它们第一次出现的顺序。
260
+ * 没有任何组名时,返回一组 `heading: null`。
261
+ */
262
+ function groupItems(items, { ungroupedFirst = false } = {}) {
263
+ if (!items.some((item) => getItemGroup(item) != null)) return [{
264
+ heading: null,
265
+ items: [...items]
266
+ }];
267
+ const groupOrder = [];
268
+ const groups = /* @__PURE__ */ new Map();
269
+ const ungrouped = [];
270
+ for (const item of items) {
271
+ const group = getItemGroup(item);
272
+ if (group != null) {
273
+ const list = groups.get(group);
274
+ if (list) list.push(item);
275
+ else {
276
+ groupOrder.push(group);
277
+ groups.set(group, [item]);
278
+ }
279
+ } else ungrouped.push(item);
280
+ }
281
+ const namedGroups = groupOrder.map((heading) => ({
282
+ heading,
283
+ items: groups.get(heading) ?? []
284
+ }));
285
+ const ungroupedGroup = ungrouped.length > 0 ? [{
286
+ heading: null,
287
+ items: ungrouped
288
+ }] : [];
289
+ return ungroupedFirst ? [...ungroupedGroup, ...namedGroups] : [...namedGroups, ...ungroupedGroup];
290
+ }
291
+ //#endregion
292
+ //#region src/utils/inputAria.ts
293
+ function joinAriaIDs(...values) {
294
+ const ids = values.flatMap((value) => typeof value === "string" ? value.trim().split(/\s+/) : []).filter(Boolean);
295
+ if (ids.length === 0) return;
296
+ return Array.from(new Set(ids)).join(" ");
297
+ }
298
+ /**
299
+ * Builds ARIA label/description wiring for an input.
300
+ *
301
+ * Standalone inputs keep their normal native label association. Grouped inputs
302
+ * are named by the visible InputGroup label plus their own input label, and
303
+ * inherit group description/status text in addition to input-local text.
304
+ */
305
+ function getInputARIA(labelID, describedByIDs = [], inputGroup) {
306
+ return {
307
+ ariaLabelledBy: inputGroup ? joinAriaIDs(inputGroup.labelID, labelID) : void 0,
308
+ ariaDescribedBy: joinAriaIDs(inputGroup?.describedByIDs, ...describedByIDs)
309
+ };
310
+ }
311
+ //#endregion
312
+ //#region src/utils/parseStyleKey.ts
313
+ /** 把驼峰属性名变成主题用的 data 属性名,例如 listStyle → data-list-style。 */
314
+ function themeDataAttributeName(prop) {
315
+ return `data-${prop.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase()}`;
316
+ }
317
+ /** 双引号 CSS 属性选择器里的值转义。 */
318
+ function escapeAttributeValue(value) {
319
+ let escaped = "";
320
+ for (const char of value) {
321
+ const codePoint = char.codePointAt(0) ?? 0;
322
+ if (char === "\"" || char === "\\" || codePoint < 32 || codePoint === 127) escaped += `\\${(codePoint === 0 ? 65533 : codePoint).toString(16)} `;
323
+ else escaped += char;
324
+ }
325
+ return escaped;
326
+ }
327
+ /**
328
+ * 把组件样式键编成 data 属性选择器后缀。
329
+ *
330
+ * `prop:value` 选择 `[data-prop="value"]`。裸状态选择 `[data-state="state"]`。
331
+ * `+` 把多个条件接在同一个组件目标上。轴名留在选择器里,避免不同属性的相同值撞在一起。
332
+ *
333
+ * @example
334
+ * parseStyleKey('base') // ''
335
+ * parseStyleKey('variant:secondary') // '[data-variant="secondary"]'
336
+ * parseStyleKey('checked+disabled') // '[data-checked="checked"][data-disabled="disabled"]'
337
+ */
338
+ function parseStyleKey(key) {
339
+ if (key === "base") return "";
340
+ return key.split("+").map((part) => {
341
+ const separator = part.indexOf(":");
342
+ const prop = separator === -1 ? part : part.slice(0, separator);
343
+ const value = separator === -1 ? part : part.slice(separator + 1);
344
+ return `[${themeDataAttributeName(prop)}="${escapeAttributeValue(value)}"]`;
345
+ }).join("");
346
+ }
347
+ //#endregion
348
+ export { groupItems as a, useFingerScroll as c, getItemGroup as i, getInputARIA as n, normalizeDayOfWeek as o, joinAriaIDs as r, chainEventHandlers as s, parseStyleKey as t };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@astryx-vue/core",
3
3
  "type": "module",
4
- "version": "0.41.1",
4
+ "version": "0.42.1",
5
5
  "description": "Vue 3 components for the unofficial astryx-vue port of Astryx. Not affiliated with Meta.",
6
6
  "author": "ShenQingchuan",
7
7
  "license": "MIT",
@@ -212,6 +212,10 @@
212
212
  "types": "./dist/Stepper/index.d.ts",
213
213
  "import": "./dist/Stepper/index.js"
214
214
  },
215
+ "./Swipe": {
216
+ "types": "./dist/Swipe/index.d.ts",
217
+ "import": "./dist/Swipe/index.js"
218
+ },
215
219
  "./Table": {
216
220
  "types": "./dist/Table/index.d.ts",
217
221
  "import": "./dist/Table/index.js"
@@ -274,6 +274,42 @@
274
274
  cursor: default;
275
275
  }
276
276
 
277
+ .astryx-date-touch-months {
278
+ display: flex;
279
+ flex-direction: column;
280
+ min-width: 0;
281
+ }
282
+
283
+ /*
284
+ * 横向按月吸附的滚动区。每个吸附点都是整整一屏,所以每个月只有一个停靠位置。
285
+ * 不加 `scroll-snap-stop: always`:那样每次甩动最多翻一个月,「往后三个月」该是一甩,不是三下。
286
+ * `pan-x` 让浏览器只管横向平移,竖向的交给底部面板下拉收起。
287
+ */
288
+ .astryx-date-touch-scroller {
289
+ position: relative;
290
+ box-sizing: border-box;
291
+ overflow-x: auto;
292
+ overflow-y: hidden;
293
+ scroll-snap-type: x mandatory;
294
+ overscroll-behavior: contain;
295
+ scrollbar-width: none;
296
+ touch-action: pan-x;
297
+ }
298
+
299
+ .astryx-date-touch-scroller::-webkit-scrollbar {
300
+ display: none;
301
+ }
302
+
303
+ .astryx-date-touch-track {
304
+ display: grid;
305
+ }
306
+
307
+ .astryx-date-touch-pane {
308
+ grid-row: 1;
309
+ min-width: 0;
310
+ scroll-snap-align: start;
311
+ }
312
+
277
313
  .astryx-date-touch-wheels,
278
314
  .astryx-time-wheels {
279
315
  display: grid;
package/styles/list.css CHANGED
@@ -45,7 +45,7 @@
45
45
  grid-column: 1 / -1;
46
46
  }
47
47
 
48
- .astryx-list[data-list-style='decimal'] > .astryx-list-item:not(.astryx-item--swipe):has(> .astryx-item__marker-content) {
48
+ .astryx-list[data-list-style='decimal'] > .astryx-list-item:has(> .astryx-item__marker-content) {
49
49
  display: grid;
50
50
  grid-template-columns: subgrid;
51
51
  }
@@ -129,16 +129,10 @@
129
129
  /*
130
130
  * `bleed`: the row fills the list, so its text sits on the container's
131
131
  * padding line, never closer to the row's edge than its own inset. Square
132
- * corners make it meet the container's straight sides, like table rows. A
133
- * swiping row keeps this padding on its inner surface instead of the root,
134
- * which already carries the swipe panels.
132
+ * corners make it meet the container's straight sides, like table rows.
135
133
  */
136
134
  .astryx-list[data-edge='bleed'] > .astryx-list-item {
137
135
  border-radius: 0;
138
- }
139
-
140
- .astryx-list[data-edge='bleed'] > .astryx-list-item:not(.astryx-item--swipe),
141
- .astryx-list[data-edge='bleed'] > .astryx-list-item > .astryx-item__surface {
142
136
  padding-inline-start: max(var(--container-padding-inline-start, 0px), var(--astryx-item-inset-inline));
143
137
  padding-inline-end: max(var(--container-padding-inline-end, 0px), var(--astryx-item-inset-inline));
144
138
  }
@@ -250,8 +244,7 @@
250
244
  * 第一行中心;插槽比这一行高时把文字压下去。纯 CSS,不测量。
251
245
  * 生成内容用空替代文本,读屏器读不到任何东西。
252
246
  */
253
- .astryx-item[data-align='first-line'] > :is(.astryx-item__start, .astryx-item__end)::before,
254
- .astryx-item--swipe[data-align='first-line'] > .astryx-item__surface > :is(.astryx-item__start, .astryx-item__end)::before {
247
+ .astryx-item[data-align='first-line'] > :is(.astryx-item__start, .astryx-item__end)::before {
255
248
  content: "\200B";
256
249
  content: "\200B" / "";
257
250
  inline-size: 0;
@@ -370,7 +363,7 @@
370
363
  * 行只为自己的按钮或链接画环;委托模式下嵌套控件就是行的唯一 Tab 停点,照旧画在行上。
371
364
  * 起止插槽里的其他控件自己画环,同一次聚焦不会出现两个环。
372
365
  */
373
- .astryx-item:has(> .astryx-item__content:focus-visible, > .astryx-item__surface > .astryx-item__content:focus-visible),
366
+ .astryx-item:has(> .astryx-item__content:focus-visible),
374
367
  .astryx-item--delegate:has(:focus-visible) {
375
368
  outline: 2px solid var(--astryx-list-item-focus, light-dark(#0064e0, #2694fe));
376
369
  outline-offset: 3px;
@@ -451,106 +444,169 @@
451
444
  -webkit-line-clamp: var(--astryx-item-clamp-lines, 2);
452
445
  }
453
446
 
447
+ /*
448
+ * 横滑的行:根按手势每帧写在它上面的位移平移(见 Swipe/useSwipeAction.ts)。
449
+ * pan-y 让浏览器继续滚动列表;pinch-zoom 把在行上开始的双指缩放留给浏览器,页面仍可缩放。
450
+ */
454
451
  .astryx-item.astryx-item--swipe {
455
- position: relative;
456
- overflow: clip;
457
- padding: 0;
458
- /* pan-y 让浏览器继续滚动列表;pinch-zoom 把双指缩放留给浏览器,页面仍可缩放。 */
459
452
  touch-action: pan-y pinch-zoom;
460
- --_item-swipe-dir: 1;
461
- --_item-swipe-travel: 0;
462
- --_item-swipe-duration: 0s;
453
+ transform: translate3d(var(--_item-swipe-travel, 0px), 0, 0);
463
454
  }
464
455
 
465
- .astryx-item--swipe > .astryx-item__surface {
466
- position: relative;
467
- z-index: 1;
468
- display: flex;
469
- align-items: center;
470
- gap: var(--astryx-spacing-2, 8px);
471
- width: 100%;
472
- min-width: 0;
473
- padding-inline: var(--astryx-item-inset-inline);
474
- background: var(--astryx-color-background-surface, light-dark(#fff, #262626));
475
- transform: translateX(calc(var(--_item-swipe-travel) * var(--_item-swipe-dir) * 1px));
476
- transition: transform var(--_item-swipe-duration) var(--astryx-ease-standard, cubic-bezier(0.24, 1, 0.4, 1));
456
+ /*
457
+ * 一侧的窗口:行的静止盒子。它按位移反向平移,所以停在行静止的地方,并把轨道裁到那个盒子和圆角。
458
+ * 透明、不接点按:只有操作接触摸。
459
+ */
460
+ .astryx-item__swipe-window {
461
+ position: absolute;
462
+ inset: 0;
463
+ overflow: clip;
464
+ border-radius: inherit;
465
+ pointer-events: none;
466
+ transform: translate3d(calc(-1 * var(--_item-swipe-travel, 0px)), 0, 0);
477
467
  }
478
468
 
479
- .astryx-item--swipe[data-align='start'] > .astryx-item__surface {
480
- align-items: flex-start;
469
+ /*
470
+ * 轨道:静止时在窗口旁边,一个像素都不露。它跟着行走,所以窗口里露出的部分正好是行空出来的地方。
471
+ * 两倍行宽覆盖所有位移(含滑出)。操作从贴着行的那一边排成一行。::before 是盖满时的底色:
472
+ * 盖满面板的那个操作的颜色,只在它盖满时显示。
473
+ */
474
+ .astryx-item__swipe-track {
475
+ position: absolute;
476
+ inset-block: 0;
477
+ width: 200%;
478
+ overflow: clip;
479
+ border-radius: inherit;
480
+ display: flex;
481
+ isolation: isolate;
482
+ background-color: var(--astryx-color-background-surface, light-dark(#fff, #262626));
483
+ transform: translate3d(var(--_item-swipe-travel, 0px), 0, 0);
481
484
  }
482
485
 
483
- .astryx-item--swipe[data-align='first-line'] > .astryx-item__surface {
484
- align-items: baseline;
486
+ .astryx-item__swipe-track::before {
487
+ content: "";
488
+ position: absolute;
489
+ inset: 0;
490
+ z-index: -1;
491
+ opacity: 0;
492
+ pointer-events: none;
485
493
  }
486
494
 
487
- .astryx-item--swipe[data-density='compact'] > .astryx-item__surface {
488
- padding-block: var(--astryx-spacing-1, 4px);
495
+ .astryx-item__swipe-track[data-covered]::before {
496
+ opacity: 1;
489
497
  }
490
498
 
491
- .astryx-item--swipe[data-density='balanced'] > .astryx-item__surface {
492
- padding-block: var(--astryx-spacing-2, 8px);
499
+ .astryx-item__swipe-track[data-fill='neutral']::before {
500
+ background-color: var(--astryx-color-neutral, light-dark(rgb(0 0 0 / 0.06), rgb(255 255 255 / 0.1)));
493
501
  }
494
502
 
495
- .astryx-item--swipe[data-density='spacious'] > .astryx-item__surface {
496
- padding-block: var(--astryx-spacing-3, 12px);
503
+ .astryx-item__swipe-track[data-fill='accent']::before {
504
+ background-color: var(--astryx-color-accent, #25252a);
497
505
  }
498
506
 
499
- .astryx-item__swipe-panel {
500
- position: absolute;
501
- z-index: 0;
502
- inset-block: 0;
503
- display: flex;
507
+ .astryx-item__swipe-track[data-fill='destructive']::before {
508
+ background-color: var(--astryx-color-error, #a50c25);
504
509
  }
505
510
 
506
- .astryx-item__swipe-panel[data-side='leading'] {
507
- inset-inline-start: 0;
511
+ /* 最外侧操作在最后、贴着外缘。leading 一侧外缘是行内开头,所以从轨道的行内末尾反向排。 */
512
+ .astryx-item__swipe-track[data-side='leading'] {
513
+ inset-inline-end: 100%;
508
514
  flex-direction: row-reverse;
509
515
  }
510
516
 
511
- .astryx-item__swipe-panel[data-side='trailing'] {
512
- inset-inline-end: 0;
517
+ .astryx-item__swipe-track[data-side='trailing'] {
518
+ inset-inline-start: 100%;
513
519
  }
514
520
 
515
- .astryx-item__swipe-action {
516
- display: inline-flex;
521
+ /*
522
+ * 操作贴着轨道的位置:轨道走多少它就往回退多少,所以一直钉在外缘,直到行把它们全部露出(开宽),
523
+ * 之后跟着行走。
524
+ */
525
+ .astryx-item__swipe-entry {
526
+ --_item-swipe-entries-x: calc(var(--_item-swipe-pin, 0px) - var(--_item-swipe-sign, 1) * min(var(--_item-swipe-sign, 1) * var(--_item-swipe-travel, 0px), var(--_item-swipe-open, 0px)));
527
+ box-sizing: border-box;
528
+ display: flex;
529
+ flex-direction: column;
530
+ flex-shrink: 0;
517
531
  align-items: center;
518
532
  justify-content: center;
519
533
  gap: var(--astryx-spacing-1, 4px);
520
- min-width: 4.5rem;
521
- padding-inline: var(--astryx-spacing-2, 8px);
534
+ min-width: 72px;
535
+ height: 100%;
536
+ margin: 0;
537
+ padding-inline: var(--astryx-spacing-3, 12px);
522
538
  border: 0;
523
- background: var(--astryx-color-background-muted, #e5e5e5);
524
- color: var(--astryx-color-text-primary, #171717);
525
- font: inherit;
539
+ appearance: none;
526
540
  cursor: pointer;
541
+ font-family: var(--astryx-font-family-body, inherit);
542
+ font-size: var(--astryx-text-supporting-size, 0.8125rem);
543
+ font-weight: var(--astryx-font-weight-medium, 500);
544
+ line-height: var(--astryx-text-supporting-leading, 1.3846);
545
+ white-space: nowrap;
546
+ pointer-events: auto;
547
+ transform: translate3d(var(--_item-swipe-entries-x), 0, 0);
548
+ }
549
+
550
+ .astryx-item__swipe-entry:focus-visible {
551
+ outline: 2px solid var(--astryx-list-item-focus, light-dark(#0064e0, #2694fe));
552
+ outline-offset: -2px;
553
+ }
554
+
555
+ .astryx-item__swipe-entry[data-variant='neutral'] {
556
+ background-color: var(--astryx-color-neutral, light-dark(rgb(0 0 0 / 0.06), rgb(255 255 255 / 0.1)));
557
+ color: var(--astryx-color-text-primary, light-dark(#171717, #f5f5f5));
527
558
  }
528
559
 
529
- .astryx-item__swipe-action[data-variant='accent'] {
530
- background: var(--astryx-color-accent, #25252a);
560
+ .astryx-item__swipe-entry[data-variant='accent'] {
561
+ background-color: var(--astryx-color-accent, #25252a);
531
562
  color: var(--astryx-color-on-accent, #fff);
532
563
  }
533
564
 
534
- .astryx-item__swipe-action[data-variant='destructive'] {
535
- background: var(--astryx-color-error, #a50c25);
565
+ .astryx-item__swipe-entry[data-variant='destructive'] {
566
+ background-color: var(--astryx-color-error, #a50c25);
536
567
  color: var(--astryx-color-on-error, #fff);
537
568
  }
538
569
 
539
- .astryx-item__swipe-action[aria-disabled='true'] {
540
- opacity: 0.5;
570
+ /* 被别的操作盖住的操作立即隐藏、不淡出,颜色不会和盖住它的那个混在一起。 */
571
+ .astryx-item__swipe-entry--covered {
572
+ opacity: 0;
573
+ }
574
+
575
+ /* 半透明用滤镜做,操作自己的 opacity 留给盖满。 */
576
+ .astryx-item__swipe-entry[data-disabled] {
577
+ filter: opacity(0.5);
541
578
  cursor: default;
542
579
  }
543
580
 
544
- @media (prefers-reduced-motion: reduce) {
545
- .astryx-item,
546
- .astryx-item__surface {
547
- transition: none;
548
- }
581
+ /*
582
+ * 最外侧操作:它的颜色画在它旁边一直到行的外缘,填满行过了开宽后露出的地方,看起来像操作被拉长;
583
+ * 滑出时整行都是它的颜色。确认的全滑里它随操作的钉位滑到行边。
584
+ */
585
+ .astryx-item__swipe-entry--outer {
586
+ position: relative;
587
+ transform: translate3d(calc(var(--_item-swipe-entries-x) + var(--_item-swipe-slide, 0px) * var(--_item-swipe-confirm, 0)), 0, 0);
588
+ }
589
+
590
+ .astryx-item__swipe-entry--outer::after {
591
+ content: "";
592
+ position: absolute;
593
+ inset-block: 0;
594
+ width: 100vw;
595
+ background-color: inherit;
596
+ pointer-events: none;
597
+ }
598
+
599
+ .astryx-item__swipe-track[data-side='leading'] > .astryx-item__swipe-entry--outer::after {
600
+ inset-inline-end: 100%;
601
+ }
602
+
603
+ .astryx-item__swipe-track[data-side='trailing'] > .astryx-item__swipe-entry--outer::after {
604
+ inset-inline-start: 100%;
549
605
  }
550
606
 
551
- /* 强制配色会把危险操作的底色换成 ButtonFace,补一圈边让按钮的形状还看得见。 */
607
+ /* 强制配色会把危险操作的底色换成 Canvas,补一圈边让它的形状还看得见;用边框不用描边,焦点环不受影响。 */
552
608
  @media (forced-colors: active) {
553
- .astryx-item__swipe-action[data-variant='destructive'] {
609
+ .astryx-item__swipe-entry[data-variant='destructive'] {
554
610
  border: 1px solid CanvasText;
555
611
  }
556
612
  }