@astryx-vue/core 0.33.4 → 0.34.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.
- package/dist/AlertDialog/index.js +1 -1
- package/dist/{AlertDialog-CwyMvZEI.js → AlertDialog-rndlABEe.js} +8 -8
- package/dist/AppShell/index.js +1 -1
- package/dist/{AppShell-4hWTPKSD.js → AppShell-eVrOpRqn.js} +5 -5
- package/dist/Avatar/index.js +1 -1
- package/dist/{Avatar-C6E6TYbe.js → Avatar-CpWBsTqf.js} +1 -1
- package/dist/AvatarGroup/index.d.ts +1 -1
- package/dist/AvatarGroup/index.js +1 -1
- package/dist/{AvatarGroup-BIPixZOb.js → AvatarGroup-BEBUEhxF.js} +1 -1
- package/dist/Banner/index.d.ts +1 -1
- package/dist/Banner/index.js +1 -1
- package/dist/{Banner-CMXebR4Y.js → Banner-CVBNGDsD.js} +1 -1
- package/dist/BottomSheet/index.js +2 -2
- package/dist/{BottomSheet-BmmGemH5.js → BottomSheet-B3qXtKQj.js} +1 -1
- package/dist/{BottomSheet-DKEUVLe5.js → BottomSheet-C6vet4pm.js} +8 -4
- package/dist/Breadcrumbs/index.js +2 -2
- package/dist/{Breadcrumbs-BPxPAEHQ.js → Breadcrumbs-B-w_yw-n.js} +1 -1
- package/dist/Button/index.d.ts +1 -1
- package/dist/Button/index.js +1 -1
- package/dist/{Button-B7PvGVt6.js → Button-DTdlisqJ.js} +4 -4
- package/dist/ButtonGroup/index.d.ts +1 -1
- package/dist/ButtonGroup/index.js +1 -1
- package/dist/{ButtonGroup-BkwQ0h97.js → ButtonGroup-Bjzs-HAG.js} +2 -2
- package/dist/Calendar/index.d.ts +1 -1
- package/dist/Carousel/index.d.ts +1 -1
- package/dist/Carousel/index.js +1 -1
- package/dist/{Carousel-BmfKiv69.js → Carousel-DjySyeDR.js} +1 -1
- package/dist/Chat/index.d.ts +1 -1
- package/dist/Chat/index.js +1 -1
- package/dist/{Chat-2AG37D51.js → Chat-DQ6BGAvP.js} +5 -5
- package/dist/CheckboxInput/index.d.ts +1 -1
- package/dist/CheckboxInput/index.js +1 -1
- package/dist/{CheckboxInput-rbMgS8ZL.js → CheckboxInput-DSW8yq92.js} +4 -4
- package/dist/CheckboxList/index.d.ts +1 -1
- package/dist/CheckboxList/index.js +1 -1
- package/dist/{CheckboxListItem-Ckt1Cwt_.js → CheckboxListItem-B2E2O1AE.js} +5 -5
- package/dist/ClickableCard/index.d.ts +1 -1
- package/dist/ClickableCard/index.js +1 -1
- package/dist/{ClickableCard-Dh0tOQv-.js → ClickableCard-D4EGX9Dh.js} +1 -1
- package/dist/Code/index.d.ts +3 -2
- package/dist/Code/index.js +3 -2
- package/dist/Code/languages/dockerfile/index.d.ts +5 -0
- package/dist/Code/languages/dockerfile/index.js +47 -0
- package/dist/Code/languages/graphql/index.d.ts +5 -0
- package/dist/Code/languages/graphql/index.js +24 -0
- package/dist/Code/languages/java/index.d.ts +5 -0
- package/dist/Code/languages/java/index.js +17 -0
- package/dist/Code/languages/lua/index.d.ts +5 -0
- package/dist/Code/languages/lua/index.js +14 -0
- package/dist/Code/languages/objective-c/index.d.ts +5 -0
- package/dist/Code/languages/objective-c/index.js +29 -0
- package/dist/Code/languages/powershell/index.d.ts +5 -0
- package/dist/Code/languages/powershell/index.js +36 -0
- package/dist/Code/languages/ruby/index.d.ts +5 -0
- package/dist/Code/languages/ruby/index.js +21 -0
- package/dist/Code/languages/thrift/index.d.ts +5 -0
- package/dist/Code/languages/thrift/index.js +15 -0
- package/dist/Code/languages/toml/index.d.ts +5 -0
- package/dist/Code/languages/toml/index.js +55 -0
- package/dist/{CodeBlock-ZluDuBT7.js → CodeBlock-D7ZJQV5Q.js} +309 -96
- package/dist/Collapsible/index.js +1 -1
- package/dist/{Collapsible-B_9H2wV_.js → Collapsible-C5xSG7oP.js} +3 -3
- package/dist/CommandPalette/index.js +1 -1
- package/dist/{CommandPalette-Cbr-WWC8.js → CommandPalette-BUNdrxrB.js} +2 -2
- package/dist/ComplexSelector/index.js +1 -1
- package/dist/{ComplexSelector-BPvBCUJk.js → ComplexSelector-m9wi7E0j.js} +2 -2
- package/dist/ContextMenu/index.d.ts +1 -1
- package/dist/ContextMenu/index.js +2 -2
- package/dist/{ContextMenu-BF4ALBZn.js → ContextMenu-BEHfVIAq.js} +5 -5
- package/dist/DateInput/index.d.ts +1 -1
- package/dist/DateInput/index.js +1 -1
- package/dist/{DateInput-C7PICKR2.js → DateInput-CHeetz7k.js} +5 -5
- package/dist/DateRangeInput/index.d.ts +1 -1
- package/dist/DateRangeInput/index.js +1 -1
- package/dist/{DateRangeInput-Dt-BA7AA.js → DateRangeInput-D524C1wc.js} +3 -3
- package/dist/DateTimeInput/index.d.ts +1 -1
- package/dist/DateTimeInput/index.js +1 -1
- package/dist/{DateTimeInput-XEESzGJf.js → DateTimeInput-2gTBrcbr.js} +5 -5
- package/dist/Dialog/index.js +3 -3
- package/dist/{Dialog-B1xC9xMC.js → Dialog-DS3xE1B7.js} +2 -2
- package/dist/{Dialog-BmdNX3NC.js → Dialog-nyLGClca.js} +1 -1
- package/dist/{DialogHeader-DcP4xAk3.js → DialogHeader-u_AaZpyZ.js} +2 -2
- package/dist/Drawer/index.d.ts +1 -1
- package/dist/Drawer/index.js +1 -1
- package/dist/{Drawer-CdHbZffI.js → Drawer-DqUdaZFh.js} +2 -2
- package/dist/DropdownMenu/index.js +2 -2
- package/dist/{DropdownMenu-C1494BkC.js → DropdownMenu-DlAON5Jf.js} +8 -8
- package/dist/EmptyState/index.js +1 -1
- package/dist/{EmptyState-BAP8BpDj.js → EmptyState-DU7uOI2G.js} +2 -2
- package/dist/Field/index.js +3 -3
- package/dist/{Field-KszpxUdx.js → Field-YNS4XxpR.js} +1 -1
- package/dist/{FieldInfoTip-CY9BTVtK.js → FieldInfoTip-DFlIBJlR.js} +1 -1
- package/dist/{FieldLabel-KPCTcJpO.js → FieldLabel-i0gos7hU.js} +1 -1
- package/dist/FileInput/index.d.ts +1 -1
- package/dist/FileInput/index.js +1 -1
- package/dist/{FileInput-BTIn6OoY.js → FileInput-DYVzAtvz.js} +3 -3
- package/dist/Heading/index.js +1 -1
- package/dist/{Heading-D94VFJtm.js → Heading-BZ0ydu2s.js} +1 -1
- package/dist/HoverCard/index.d.ts +1 -1
- package/dist/HoverCard/index.js +1 -1
- package/dist/{HoverCard-rwpyd6nt.js → HoverCard-BhHZE9q6.js} +4 -4
- package/dist/IconButton/index.js +1 -1
- package/dist/{IconButton-e5xeGow-.js → IconButton-DXt8DtsN.js} +1 -1
- package/dist/InfoTip/index.d.ts +1 -1
- package/dist/InfoTip/index.js +1 -1
- package/dist/{InfoTip-DpvV8zrm.js → InfoTip--fZOD0ux.js} +2 -2
- package/dist/{InputClearButton-BzxJH6mk.js → InputClearButton-LF0iVTVF.js} +1 -1
- package/dist/InputGroup/index.js +1 -1
- package/dist/{InputGroup-Bj4hksiI.js → InputGroup-D4CPVzo0.js} +1 -1
- package/dist/InternationalizationProvider/index.d.ts +1 -1
- package/dist/InternationalizationProvider/index.js +1 -1
- package/dist/{InternationalizationProvider-BGtwZDY0.js → InternationalizationProvider-DzNfleAX.js} +1 -1
- package/dist/{Item-D62Cibn1.js → Item-BKISM91o.js} +1 -1
- package/dist/{LayerContentBoundary-CTjEpdM4.js → LayerContentBoundary-D67fobWl.js} +1 -1
- package/dist/Layout/index.js +2 -2
- package/dist/{Layout-SJoCw8NC.js → Layout-BwSvAsLi.js} +1 -1
- package/dist/{LayoutPanel-DZN4RxX6.js → LayoutPanel-CmzJQpnL.js} +1 -1
- package/dist/Lightbox/index.js +1 -1
- package/dist/{Lightbox-FWtAn7X5.js → Lightbox-B32Yh8Uy.js} +1 -1
- package/dist/Link/index.d.ts +1 -1
- package/dist/Link/index.js +1 -1
- package/dist/{Link-BxK3lbA-.js → Link-DSXyw9MW.js} +2 -2
- package/dist/List/index.d.ts +1 -1
- package/dist/List/index.js +2 -2
- package/dist/{ListItem-B4jt3EXr.js → ListItem-D3iEhvU2.js} +4 -4
- package/dist/Markdown/index.d.ts +1 -1
- package/dist/Markdown/index.js +2 -2
- package/dist/Markdown/parser/index.js +1 -1
- package/dist/{Markdown-CsoseOGe.js → Markdown-BvWEX29v.js} +81 -6
- package/dist/MetadataList/index.d.ts +1 -1
- package/dist/MobileNav/index.js +1 -1
- package/dist/{MobileNavToggle-AgT6hzTg.js → MobileNavToggle-sC6GPVKQ.js} +2 -2
- package/dist/MoreMenu/index.d.ts +1 -1
- package/dist/MoreMenu/index.js +1 -1
- package/dist/{MoreMenu-4zcxptan.js → MoreMenu-CcavOuxV.js} +7 -7
- package/dist/MultiSelector/index.js +1 -1
- package/dist/{MultiSelector-LuAE71wE.js → MultiSelector-Diu5zHbP.js} +5 -5
- package/dist/{NavDisclosure-CSnUZY3k.js → NavDisclosure-BpYjtYo5.js} +1 -1
- package/dist/{NavHeadingSurface-C3fTf5--.js → NavHeadingSurface-CK9zMjFC.js} +1 -1
- package/dist/NavItem/index.js +1 -1
- package/dist/{NavItem-mcmzIshL.js → NavItem-DlW8noR6.js} +1 -1
- package/dist/NavMenu/index.js +3 -3
- package/dist/{NavMenu-Bp35Bk7_.js → NavMenu-J2kmtb1B.js} +2 -2
- package/dist/{NavMenuItem-DviXkleh.js → NavMenuItem-DItNRTDZ.js} +3 -3
- package/dist/NumberInput/index.d.ts +1 -1
- package/dist/NumberInput/index.js +1 -1
- package/dist/{NumberInput-CxzhFPQw.js → NumberInput-vhm5TQon.js} +3 -3
- package/dist/Outline/index.js +1 -1
- package/dist/{Outline-KpA-ffCT.js → Outline-CVIDd0fN.js} +3 -67
- package/dist/OverflowList/index.d.ts +1 -1
- package/dist/OverflowList/index.js +1 -1
- package/dist/{OverflowList-DRZxrAYq.js → OverflowList-DjWWBOkx.js} +2 -2
- package/dist/Pagination/index.js +1 -1
- package/dist/{Pagination-B3JMAlnl.js → Pagination-DKsePQjC.js} +2 -2
- package/dist/{PanGestureRecognizer-R5y8LZ9h.js → PanGestureRecognizer-C7hNunjF.js} +1 -1
- package/dist/PickerWheel-Bf7xe6g6.js +1131 -0
- package/dist/Popover/index.d.ts +1 -1
- package/dist/Popover/index.js +1 -1
- package/dist/{Popover-CQr95J2s.js → Popover-CKgepPJ6.js} +7 -7
- package/dist/PowerSearch/index.d.ts +1 -1
- package/dist/PowerSearch/index.js +1 -1
- package/dist/{PowerSearch-BEaqgsZa.js → PowerSearch-v_MRx2nn.js} +27 -27
- package/dist/{PressTracker-Dze87pxw.js → PressTracker-DL75qEq_.js} +2 -2
- package/dist/ProgressBar/index.d.ts +1 -1
- package/dist/ProgressBar/index.js +1 -1
- package/dist/{ProgressBar-ChgsiVRR.js → ProgressBar-B2ds3imd.js} +1 -1
- package/dist/Radio/index.d.ts +1 -1
- package/dist/Radio/index.js +1 -1
- package/dist/{RadioGroup-CpMYh9eL.js → RadioGroup-C-S-SnbH.js} +5 -5
- package/dist/RadioList/index.d.ts +1 -1
- package/dist/RadioList/index.js +1 -1
- package/dist/{RadioListItem-n-h5r1GO.js → RadioListItem-DzKVK4DZ.js} +1 -1
- package/dist/Resizable/index.js +1 -1
- package/dist/{ResizeHandle-J9-dAMuo.js → ResizeHandle-CaZEB4Py.js} +1 -1
- package/dist/ScrollableArea/index.d.ts +1 -1
- package/dist/SegmentedControl/index.js +1 -1
- package/dist/{SegmentedControl-nz9d6e0y.js → SegmentedControl-Bp7dpEjn.js} +10 -10
- package/dist/SelectableCard/index.d.ts +1 -1
- package/dist/SelectableCard/index.js +1 -1
- package/dist/{SelectableCard-C018jluo.js → SelectableCard-DPWaUCGZ.js} +1 -1
- package/dist/Selector/index.d.ts +1 -1
- package/dist/Selector/index.js +1 -1
- package/dist/{Selector-CW1jaM4F.js → Selector-CJmeuWhN.js} +3 -3
- package/dist/SideNav/index.d.ts +1 -1
- package/dist/SideNav/index.js +2 -2
- package/dist/{SideNav-DgRpBPuP.js → SideNav-D-AQqNPx.js} +9 -9
- package/dist/Slider/index.js +1 -1
- package/dist/{Slider-Bz72itTP.js → Slider-DU-Yl3fd.js} +9 -150
- package/dist/Stack/index.d.ts +1 -1
- package/dist/StatusDot/index.js +1 -1
- package/dist/{StatusDot-D7nVuPg7.js → StatusDot-Jw676Z_6.js} +1 -1
- package/dist/Stepper/index.d.ts +1 -1
- package/dist/Stepper/index.js +1 -1
- package/dist/{Stepper-Af_rH8C4.js → Stepper-67SsxUne.js} +1 -1
- package/dist/Switch/index.d.ts +1 -1
- package/dist/Switch/index.js +1 -1
- package/dist/{Switch-BYsb1gKn.js → Switch-C6qaebkX.js} +10 -10
- package/dist/TabList/index.d.ts +1 -1
- package/dist/TabList/index.js +1 -1
- package/dist/{TabList-Cgw2IuL-.js → TabList-TbJ6y1gN.js} +3 -3
- package/dist/Table/index.d.ts +1 -1
- package/dist/Table/index.js +1 -1
- package/dist/{Table-DzE-4_og.js → Table-CbMxkm2v.js} +14 -14
- package/dist/Text/index.js +1 -1
- package/dist/{Text-kwsIut3C.js → Text-bvai__ae.js} +1 -1
- package/dist/TextArea/index.d.ts +1 -1
- package/dist/TextArea/index.js +1 -1
- package/dist/{TextArea-DrYMTaZm.js → TextArea-D6EtmxTk.js} +4 -4
- package/dist/TextInput/index.d.ts +1 -1
- package/dist/TextInput/index.js +1 -1
- package/dist/{TextInput-B-1cuwcB.js → TextInput-AngvgtdT.js} +4 -4
- package/dist/Thumbnail/index.js +1 -1
- package/dist/{Thumbnail-DeMaRkDU.js → Thumbnail-DExkxw8a.js} +3 -3
- package/dist/{TimeField-C1Nv-fz3.js → TimeField-BNGg25yA.js} +9 -4
- package/dist/TimeInput/index.d.ts +1 -1
- package/dist/TimeInput/index.js +1 -1
- package/dist/{TimeInput-Dvh6qqHI.js → TimeInput-D8lwgHOR.js} +2 -2
- package/dist/Timer/index.d.ts +1 -1
- package/dist/Timer/index.js +1 -1
- package/dist/{Timer-B-9sSJWK.js → Timer-CO-JNJTI.js} +1 -1
- package/dist/Timestamp/index.d.ts +1 -1
- package/dist/Timestamp/index.js +1 -1
- package/dist/{Timestamp-wFkl39dn.js → Timestamp-CeSb1A8c.js} +3 -3
- package/dist/Toast/index.js +1 -1
- package/dist/{Toast-CO6Z1r1s.js → Toast-B2Fq-JYA.js} +4 -107
- package/dist/ToggleButton/index.d.ts +1 -1
- package/dist/ToggleButton/index.js +1 -1
- package/dist/{ToggleButton-DPpjDYxP.js → ToggleButton-Bn8yLHbh.js} +3 -3
- package/dist/Token/index.js +1 -1
- package/dist/{Token-DZkUAIYA.js → Token-Dpxh42Mw.js} +1 -1
- package/dist/Tokenizer/index.js +1 -1
- package/dist/{Tokenizer-CX7D4klL.js → Tokenizer-B3EnI98V.js} +12 -12
- package/dist/Toolbar/index.d.ts +1 -1
- package/dist/Tooltip/index.d.ts +1 -1
- package/dist/Tooltip/index.js +2 -2
- package/dist/{Tooltip-DyGaJUbl.js → Tooltip-BdG9g6c6.js} +1 -1
- package/dist/TopNav/index.d.ts +1 -1
- package/dist/TopNav/index.js +1 -1
- package/dist/{TopNav-D8Hc_kQ-.js → TopNav-D7mzM7pu.js} +5 -5
- package/dist/TreeList/index.js +1 -1
- package/dist/{TreeList-lNyuRBOk.js → TreeList-BmeXFFqr.js} +4 -4
- package/dist/Typeahead/index.js +2 -2
- package/dist/{Typeahead-BiosTaFo.js → Typeahead-kLp9UG-Q.js} +5 -5
- package/dist/{accessibleName-f5xApbXG.js → accessibleName-Zr1_WoBg.js} +1 -1
- package/dist/{animator-ozeBZ_zC.js → animator-Bptiubcx.js} +1 -1
- package/dist/{boxHold-YML2o6iP.js → boxHold-Bh1fTcXx.js} +5 -5
- package/dist/{browserClickWait-DIj9tkLa.js → browserClickWait-CiUtuWNK.js} +2 -2
- package/dist/{clickGuard-CxqcfBCJ.js → clickGuard-Bd-jBj_G.js} +2 -2
- package/dist/code-block-DCVrTLMZ.js +19 -0
- package/dist/composables/index.d.ts +1 -1
- package/dist/composables/index.js +10 -10
- package/dist/{composables-CPDafrux.js → composables-B6ebqwHY.js} +7 -68
- package/dist/{context-C1MPE6J5.js → context-Dweha8vW.js} +1 -1
- package/dist/decay-TluwbMlP.js +64 -0
- package/dist/{sharedRealm-DBtNH73I.js → flatTree-BB4yPMNL.js} +1 -57
- package/dist/{geometry-CGa3nNzZ.js → geometry-0e0f5Mjv.js} +9 -8
- package/dist/grammar-4Pn2745Q.d.ts +58 -0
- package/dist/grammar-Dz71GleT.js +144 -0
- package/dist/haptics-DIfaJavG.js +146 -0
- package/dist/{holdEntranceInput-C8B_DYYs.js → holdEntranceInput-DWqsAYll.js} +1 -1
- package/dist/{index-DYabo8TI.d.ts → index-B44fLswd.d.ts} +2 -2
- package/dist/{index-BdICULsZ.d.ts → index-BHoivOHG.d.ts} +506 -110
- package/dist/{index-CTv55aOa.d.ts → index-BRr_eg_u.d.ts} +1 -1
- package/dist/{index-DHUCHxn2.d.ts → index-BWWirRm3.d.ts} +1 -1
- package/dist/{index-B6GTqpW-.d.ts → index-BWzEt0gT.d.ts} +2 -2
- package/dist/{index-ChqMaV6N.d.ts → index-BZDl_iLU.d.ts} +61 -13
- package/dist/{index-DlsrR4Gm.d.ts → index-BZx7HHxY.d.ts} +1 -1
- package/dist/{index-BB9acgK8.d.ts → index-BgT6mH3U.d.ts} +1 -1
- package/dist/{index-C9uW39Mj.d.ts → index-Cm36VS1A.d.ts} +1 -1
- package/dist/{index-DhrnMYVh.d.ts → index-D1C2Nt3F.d.ts} +2 -2
- package/dist/{index-BU1HdDER.d.ts → index-D8VViJw0.d.ts} +3 -1
- package/dist/{index-BVx-HFp8.d.ts → index-D9t_l8pJ.d.ts} +1 -1
- package/dist/{index-jz9GfvS0.d.ts → index-DEJlE6_N.d.ts} +2 -2
- package/dist/{index-DofC9Rll.d.ts → index-Dk50Zh3F.d.ts} +2 -2
- package/dist/{index-CpkQlo1t.d.ts → index-E4L3DiiH.d.ts} +1 -1
- package/dist/{index-utZGF4GR.d.ts → index-NOXYEdOI.d.ts} +1 -1
- package/dist/{index-BA8exXNP.d.ts → index-X4S7_dmq.d.ts} +1 -1
- package/dist/{index-tdOyqA_U.d.ts → index-a6o69uPN.d.ts} +2 -2
- package/dist/index.d.ts +21 -21
- package/dist/index.js +108 -106
- package/dist/{inputHold-BJtjc9iI.js → inputHold-CvjeOOWT.js} +4 -4
- package/dist/{inputHoldState-BYi5FKZl.js → inputHoldState-Cg1r8Ib7.js} +2 -2
- package/dist/{inputStream-HXw2lZ-3.js → inputStream-DkMWPYac.js} +1 -1
- package/dist/{landing-BW6qLvC8.js → landing-CrVewjeb.js} +1 -1
- package/dist/{layerDepth-SGFJ5L6X.js → layerDepth-DRfWATFr.js} +1 -1
- package/dist/{lazyBottomSheet-Bg5E8lr3.js → lazyBottomSheet-DlHcPsAT.js} +1 -1
- package/dist/{loadCatalog-BODWYaNy.d.ts → loadCatalog-C_Cy_8WN.d.ts} +2 -0
- package/dist/{loadCatalog-DMOOMWtw.js → loadCatalog-VlWGFIMU.js} +6 -17
- package/dist/locale/index.d.ts +2 -2
- package/dist/locale/index.js +3 -2
- package/dist/{locale-C8X7gJlc.js → locale-U0KLmREA.js} +1 -1
- package/dist/{presentation-twEOzzJq.js → presentation-Cl58tYA6.js} +2 -1
- package/dist/{pressGesture-B3Efxs_z.js → pressGesture-CfBgXWRM.js} +13 -0
- package/dist/pressSlot-B6TvGkSO.js +222 -0
- package/dist/{publicParser-C8RBKNLA.js → publicParser-Dbu2LRTf.js} +2 -2
- package/dist/reducedMotion-D8-U7XFT.js +121 -0
- package/dist/{reportChange-DwOfucSf.js → reportChange-CUo2YNPB.js} +2 -2
- package/dist/{resizableChannel-BnwrR5tr.js → resizableChannel-CaaqGvXj.js} +3 -3
- package/dist/scrollView-DcPpdCrj.js +128 -0
- package/dist/{selectionLock-BrUpRS0E.js → selectionLock-BM8XEZQD.js} +2 -1
- package/dist/sharedRealm-BYHklCVM.js +57 -0
- package/dist/{stillPointerGate-BvCX7ddI.js → stillPointerGate-BU1CKW7m.js} +1 -1
- package/dist/{tooltipFocusRules-CxIlSnHw.js → tooltipFocusRules-GGASOH_U.js} +2 -2
- package/dist/{tooltipTriggerRules-CHNpQ6RL.js → tooltipTriggerRules-DIaGdkD_.js} +1 -1
- package/dist/{touchHold-CjNjGH7O.js → touchHold-CciGr8hU.js} +1 -1
- package/dist/{useActionGroupTracking-BTjuGF9J.js → useActionGroupTracking-DjIdPbfL.js} +4 -3
- package/dist/{useAnimatedLayout-CRAuCwTZ.js → useAnimatedLayout-Dq-cttfe.js} +1 -1
- package/dist/{useChatStreamScroll-DcNKcNTj.js → useChatStreamScroll-DEp17Yq9.js} +1 -1
- package/dist/{useDismiss-6SGAlkB_.js → useDismiss-CegXF2Zo.js} +1 -1
- package/dist/useGestureRecognizer-DDd-6Km-.js +106 -0
- package/dist/{useInputStatusIcon-Bl2JFlc3.js → useInputStatusIcon-m6l4qBmA.js} +1 -1
- package/dist/{useMenuEntranceHold-C-kHicUN.js → useMenuEntranceHold-C4LOzKIS.js} +1 -1
- package/dist/{useMenuPress-CF1GHP_7.js → useMenuPress-BDPqPten.js} +4 -4
- package/dist/usePressFeedback-D2mWzgoJ.js +380 -0
- package/dist/{useResizable-I0APFcMz.js → useResizable-Bwv-j_9N.js} +2 -2
- package/dist/{useTooltip-owvVSn_m.js → useTooltip-DCp4sTM1.js} +4 -4
- package/dist/{useTouchHitArea-BpEJXuu-.js → useTouchHitArea-DL9D10Rq.js} +2 -2
- package/dist/{useTouchTriggerInternal-5ExaYYSy.js → useTouchTriggerInternal-C_mowlpv.js} +1 -1
- package/dist/{useTruncationTooltip-DHI6q_EV.js → useTruncationTooltip-Du80jGdE.js} +3 -3
- package/dist/{useTypeaheadMenuConfig-COiZ4isy.js → useTypeaheadMenuConfig-B14t0HGE.js} +1 -1
- package/package.json +37 -1
- package/reset.css +14 -0
- package/styles/code.css +85 -8
- package/styles/date-input.css +69 -0
- package/styles/markdown.css +6 -5
- package/styles/progress-bar.css +25 -26
- package/dist/PickerWheel-DNX3yrUd.js +0 -82
- package/dist/index-C9ZssPUV.d.ts +0 -380
- package/dist/pressFeedback--_INTed0.js +0 -470
- package/dist/usePressFeedback-B_NavJu0.js +0 -49
|
@@ -1,470 +0,0 @@
|
|
|
1
|
-
import { g as isNode, m as isElement, p as isDocument, u as parentAcrossShadow } from "./sharedRealm-DBtNH73I.js";
|
|
2
|
-
import { i as subscribeInput } from "./inputStream-HXw2lZ-3.js";
|
|
3
|
-
import { o as UIKIT_PRESS } from "./gestures-yKyyMqeQ.js";
|
|
4
|
-
import { a as idlePressGesture, n as PRESS_ONSET_MS, o as pressGestureStep, r as PRESS_SCROLL_BRAKE_MS, t as PRESS_FLASH_MS } from "./pressGesture-B3Efxs_z.js";
|
|
5
|
-
import { n as hasInteractiveAncestor } from "./useClickableContainer-Dtjg-nkm.js";
|
|
6
|
-
//#region src/utils/inputAge.ts
|
|
7
|
-
/**
|
|
8
|
-
* @file inputAge.ts
|
|
9
|
-
* @input An input's time stamp, and its event or the node it landed on
|
|
10
|
-
* @output clockOf, timeOn and msSinceInput: the clock of the window that
|
|
11
|
-
* stamped an input, its time on that clock, and how long ago it happened
|
|
12
|
-
* @position Internal utility. The content-touch delay (utils/pressFeedback.ts,
|
|
13
|
-
* gestures/PressTracker.ts) and the long-press hold
|
|
14
|
-
* (hooks/longPressDetector.ts) count from the touch with it.
|
|
15
|
-
*/
|
|
16
|
-
/**
|
|
17
|
-
* The clock of the window that stamped an input: an event's `view`, or the
|
|
18
|
-
* window of the node it landed on. A same-origin iframe's clock or a popup's
|
|
19
|
-
* starts later than the page's. With neither, the clock is this window's.
|
|
20
|
-
*/
|
|
21
|
-
function clockOf(source) {
|
|
22
|
-
return (isNode(source) ? (isDocument(source) ? source : source.ownerDocument)?.defaultView : source?.view)?.performance ?? (typeof performance === "undefined" ? null : performance);
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* An event's time on its window's clock. jsdom stamps events with
|
|
26
|
-
* `Date.now()`. Such a stamp keeps its age on that clock, so a frozen system
|
|
27
|
-
* time keeps a delay's length. A stamp nearer `Date.now()` than the window's
|
|
28
|
-
* clock is that kind of stamp.
|
|
29
|
-
*/
|
|
30
|
-
function timeOn(clock, timeStamp) {
|
|
31
|
-
if (timeStamp == null || !Number.isFinite(timeStamp) || timeStamp <= 0) return;
|
|
32
|
-
if (clock != null && Math.abs(Date.now() - timeStamp) < Math.abs(clock.now() - timeStamp)) return clock.now() - (Date.now() - timeStamp);
|
|
33
|
-
return timeStamp;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* How long ago the input stamped `time` happened, on the clock of the window
|
|
37
|
-
* that stamped it (`clockOf(source)`). A busy main thread runs a listener
|
|
38
|
-
* late. An input with no time, or a time ahead of now, counts as now.
|
|
39
|
-
*/
|
|
40
|
-
function msSinceInput(time, source) {
|
|
41
|
-
const clock = clockOf(source);
|
|
42
|
-
const at = timeOn(clock, time);
|
|
43
|
-
return clock == null || at == null ? 0 : Math.max(0, clock.now() - at);
|
|
44
|
-
}
|
|
45
|
-
//#endregion
|
|
46
|
-
//#region src/utils/scrollView.ts
|
|
47
|
-
/**
|
|
48
|
-
* @file scrollView.ts
|
|
49
|
-
* @input An element and its computed styles
|
|
50
|
-
* @output Exports parseTouchAction, touchActionAllowsPan, rootOverflow,
|
|
51
|
-
* SCROLLABLE_OVERFLOW and isInsideScrollView: whether a touch on the
|
|
52
|
-
* element lands inside a box the browser can scroll
|
|
53
|
-
* @position The one definition of "inside a scroll view", shared by the
|
|
54
|
-
* press feedback controller (utils/pressFeedback.ts), the gesture core's
|
|
55
|
-
* native-scroll probe (gestures/nativeScroll.ts) and Layer's outside-press
|
|
56
|
-
* watch, so Core's main entry can ask it without the gesture core
|
|
57
|
-
*/
|
|
58
|
-
/** Overflow values that let a box scroll. */
|
|
59
|
-
const SCROLLABLE_OVERFLOW = /* @__PURE__ */ new Set([
|
|
60
|
-
"auto",
|
|
61
|
-
"scroll",
|
|
62
|
-
"overlay"
|
|
63
|
-
]);
|
|
64
|
-
/** How far a box must overflow, in px, before it counts as scrolling. */
|
|
65
|
-
const OVERFLOW_TOLERANCE_PX = 1;
|
|
66
|
-
/** Which pans a `touch-action` value lets the browser perform. */
|
|
67
|
-
function parseTouchAction(value) {
|
|
68
|
-
const tokens = value.trim().split(/\s+/);
|
|
69
|
-
if (tokens.includes("auto") || tokens.includes("manipulation")) return {
|
|
70
|
-
x: true,
|
|
71
|
-
y: true
|
|
72
|
-
};
|
|
73
|
-
if (tokens.includes("none")) return {
|
|
74
|
-
x: false,
|
|
75
|
-
y: false
|
|
76
|
-
};
|
|
77
|
-
return {
|
|
78
|
-
x: tokens.some((token) => token === "pan-x" || token === "pan-left" || token === "pan-right"),
|
|
79
|
-
y: tokens.some((token) => token === "pan-y" || token === "pan-up" || token === "pan-down")
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* The viewport's overflow on an axis. It scrolls unless the root or the body
|
|
84
|
-
* clips it, as a scroll lock does with `overflow: hidden`.
|
|
85
|
-
*/
|
|
86
|
-
function rootOverflow(doc, axis) {
|
|
87
|
-
const view = doc.defaultView;
|
|
88
|
-
if (view == null) return "hidden";
|
|
89
|
-
for (const element of [doc.documentElement, doc.body]) {
|
|
90
|
-
if (element == null) continue;
|
|
91
|
-
const style = view.getComputedStyle(element);
|
|
92
|
-
const value = axis === "x" ? style.overflowX : style.overflowY;
|
|
93
|
-
if (value === "hidden" || value === "clip") return "hidden";
|
|
94
|
-
}
|
|
95
|
-
return "auto";
|
|
96
|
-
}
|
|
97
|
-
function overflows(element, axis) {
|
|
98
|
-
return axis === "y" ? element.scrollHeight - element.clientHeight > OVERFLOW_TOLERANCE_PX : element.scrollWidth - element.clientWidth > OVERFLOW_TOLERANCE_PX;
|
|
99
|
-
}
|
|
100
|
-
/**
|
|
101
|
-
* Whether a touch on `element` lands inside a scroll view, UIKit's question
|
|
102
|
-
* for a touch: a box above it, the page included, overflows on an axis it
|
|
103
|
-
* scrolls, and `touch-action` on the way up leaves that axis to the browser.
|
|
104
|
-
* A `position: fixed` box ends the walk, because it does not move with any
|
|
105
|
-
* scroller above it. A wheel scrolls whatever `touch-action` says, so a
|
|
106
|
-
* wheel's question passes `readsTouchAction: false`.
|
|
107
|
-
*/
|
|
108
|
-
function isInsideScrollView(element, { readsTouchAction = true } = {}) {
|
|
109
|
-
const doc = element.ownerDocument;
|
|
110
|
-
const view = doc.defaultView;
|
|
111
|
-
if (view == null) return false;
|
|
112
|
-
const root = doc.scrollingElement ?? doc.documentElement;
|
|
113
|
-
let panX = true;
|
|
114
|
-
let panY = true;
|
|
115
|
-
for (let node = element; node != null;) {
|
|
116
|
-
if (isElement(node)) {
|
|
117
|
-
const style = view.getComputedStyle(node);
|
|
118
|
-
if (readsTouchAction) {
|
|
119
|
-
const pans = parseTouchAction(style.touchAction || "auto");
|
|
120
|
-
panX &&= pans.x;
|
|
121
|
-
panY &&= pans.y;
|
|
122
|
-
}
|
|
123
|
-
if (node === root || node === doc.documentElement) break;
|
|
124
|
-
if (panY && SCROLLABLE_OVERFLOW.has(style.overflowY) && overflows(node, "y") || panX && SCROLLABLE_OVERFLOW.has(style.overflowX) && overflows(node, "x")) return true;
|
|
125
|
-
if (style.position === "fixed") return false;
|
|
126
|
-
}
|
|
127
|
-
node = parentAcrossShadow(node);
|
|
128
|
-
}
|
|
129
|
-
return panY && SCROLLABLE_OVERFLOW.has(rootOverflow(doc, "y")) && overflows(root, "y") || panX && SCROLLABLE_OVERFLOW.has(rootOverflow(doc, "x")) && overflows(root, "x");
|
|
130
|
-
}
|
|
131
|
-
//#endregion
|
|
132
|
-
//#region src/composables/internal/pressSurface.ts
|
|
133
|
-
/**
|
|
134
|
-
* 触屏按压模型里「这一下按的是谁」的判断:从手指落点往上找最里层的可按元素。
|
|
135
|
-
*
|
|
136
|
-
* 可按元素分两种:
|
|
137
|
-
* - 普通可按元素(按钮、开关行……):手指落在它里面任何地方,都是按它。
|
|
138
|
-
* - 可按容器(列表行、TreeList 行、Token、可点卡片):额外带 `data-astryx-press-container`。
|
|
139
|
-
* 手指落在它里面的其他控件上(行尾的按钮、Token 的删除按钮、卡片里的输入框)时,
|
|
140
|
-
* 这一下不会触发容器自己的动作,所以容器不亮。
|
|
141
|
-
* 容器自己的动作元素(行里那个看不见的链接或按钮、Token 的主按钮)带 `data-astryx-press-action`,
|
|
142
|
-
* 落在它上面就是按容器。
|
|
143
|
-
*/
|
|
144
|
-
/** 可按元素的标记。控制器用 `closest()` 找它。 */
|
|
145
|
-
const PRESSABLE_ATTRIBUTE = "data-astryx-pressable";
|
|
146
|
-
/** 可按容器的标记:里面别的控件被按下时,容器不亮。 */
|
|
147
|
-
const PRESS_CONTAINER_ATTRIBUTE = "data-astryx-press-container";
|
|
148
|
-
/** 可按容器自己的动作元素:按它就是按容器。 */
|
|
149
|
-
const PRESS_ACTION_ATTRIBUTE = "data-astryx-press-action";
|
|
150
|
-
/** 按钮组、提示对话框跟踪滑动的动作带这个标记,值是组跟踪的指针类型,比如 `touch pen`。 */
|
|
151
|
-
const PRESS_GROUP_ITEM_ATTRIBUTE = "data-astryx-press-group-item";
|
|
152
|
-
/** 这个元素(或它外面)是不是由组来画 `pointerType` 这种指针的按压。 */
|
|
153
|
-
function isTrackedByGroup(element, pointerType) {
|
|
154
|
-
const marked = element.closest(`[${PRESS_GROUP_ITEM_ATTRIBUTE}]`);
|
|
155
|
-
return marked != null && (marked.getAttribute("data-astryx-press-group-item") ?? "").split(" ").includes(pointerType);
|
|
156
|
-
}
|
|
157
|
-
/** 不可用的元素怎么按都不画。 */
|
|
158
|
-
const DISABLED = ":disabled, [aria-disabled=\"true\"]";
|
|
159
|
-
/**
|
|
160
|
-
* 手指按在容器里的另一个控件上:那个控件接走这次按压,容器的动作不会执行。
|
|
161
|
-
* 落在容器自己的动作元素里不算。
|
|
162
|
-
*/
|
|
163
|
-
function landsOnNestedControl(target, container) {
|
|
164
|
-
const action = target.closest(`[${PRESS_ACTION_ATTRIBUTE}]`);
|
|
165
|
-
if (action != null && container.contains(action)) return false;
|
|
166
|
-
return hasInteractiveAncestor(target, container);
|
|
167
|
-
}
|
|
168
|
-
/**
|
|
169
|
-
* 手指下最里层的可按元素。里层优先:可按的行里有个按钮,按钮接走这次按压。
|
|
170
|
-
* 不可用的元素也会接走,但什么都不画,所以按在禁用控件上不会把外面那一行点亮。
|
|
171
|
-
* 可按容器里落在别的控件上时,同样什么都不画。
|
|
172
|
-
*/
|
|
173
|
-
function pressSurfaceAt(target) {
|
|
174
|
-
if (!(target instanceof Element)) return null;
|
|
175
|
-
const found = target.closest(`[${PRESSABLE_ATTRIBUTE}]`);
|
|
176
|
-
if (!(found instanceof HTMLElement) || found.matches(DISABLED)) return null;
|
|
177
|
-
if (found.hasAttribute("data-astryx-press-container") && target !== found && landsOnNestedControl(target, found)) return null;
|
|
178
|
-
return found;
|
|
179
|
-
}
|
|
180
|
-
//#endregion
|
|
181
|
-
//#region src/composables/internal/pressFeedback.ts
|
|
182
|
-
/**
|
|
183
|
-
* 触屏按压模型的 DOM 那一半:整个文档只有一个委托控制器,
|
|
184
|
-
* 在手指下最里层的可按元素上写 `data-astryx-press`。
|
|
185
|
-
*
|
|
186
|
-
* 为什么挂在文档上、而不是每个元素一套监听:虚拟列表可能有上千行,每行四个监听加一份状态
|
|
187
|
-
* 承受不起。这里整个文档就几个监听,一次按压只改一个元素的一个属性,不触发任何组件更新。
|
|
188
|
-
*
|
|
189
|
-
* 鼠标完全不管,CSS 的 `:active` 照旧。手指下,`@media (pointer: coarse)` 里的 `:active`
|
|
190
|
-
* 被样式丢掉,改由这里在按压成立时写 `on`,抬手淡出时写 `fading`。
|
|
191
|
-
* 样式见 `styles/pressable.css`。
|
|
192
|
-
*
|
|
193
|
-
* 手指只在滚动视图里才等:滚动视图外,落下那一帧就亮,和原生控件一样;
|
|
194
|
-
* 滚动视图里等 150ms,因为这次触摸可能变成滚动。这 150ms 从触摸自己的时间戳算起,
|
|
195
|
-
* 页面忙、监听函数跑晚了,不会让高亮跟着晚。
|
|
196
|
-
*/
|
|
197
|
-
/** 按压成立且手指还在时为 `on`,抬手淡出时为 `fading`,其余时候不存在。 */
|
|
198
|
-
const PRESSED_ATTRIBUTE = "data-astryx-press";
|
|
199
|
-
/** 手指离开后多久内的滚动还可能是那根手指甩出去的惯性。iOS 的惯性滚动会持续一两秒。 */
|
|
200
|
-
const PRESS_GESTURE_MEMORY_MS = UIKIT_PRESS.momentumMemory.value;
|
|
201
|
-
let live = null;
|
|
202
|
-
/**
|
|
203
|
-
* 手指或笔落在控件框上的这次接触(utils/boxHold.ts):记着它的指针、它开始的那次按压
|
|
204
|
-
* (刹车时没有)和框按住的收尾。刹车的接触也算,被滚动取消的也算,各自在自己的抬起或取消时结束。
|
|
205
|
-
* 只有抬起时按压还活着,才算「停着抬起」。
|
|
206
|
-
*/
|
|
207
|
-
let contact = null;
|
|
208
|
-
/** 结束这次框上的接触,并且只告诉框按住一次。 */
|
|
209
|
-
function endContact(isStillLift) {
|
|
210
|
-
const ended = contact;
|
|
211
|
-
contact = null;
|
|
212
|
-
ended?.end(isStillLift);
|
|
213
|
-
}
|
|
214
|
-
let boxHold = null;
|
|
215
|
-
/**
|
|
216
|
-
* 装上框按住。只有用到框组件(复选框、单选)的页面才加载它,
|
|
217
|
-
* 只有按钮和链接的页面不带这段代码。
|
|
218
|
-
*/
|
|
219
|
-
function installBoxHold(hold) {
|
|
220
|
-
boxHold = hold;
|
|
221
|
-
}
|
|
222
|
-
/** 有几个调用方装着控制器。大于 0 时监听才在。 */
|
|
223
|
-
let holders = 0;
|
|
224
|
-
/** 上一次「被手指带动」的滚动发生在什么时候、在哪个滚动容器里。只记手指带动的,程序滚动不算。 */
|
|
225
|
-
let lastScrollAt = 0;
|
|
226
|
-
let lastScroller = null;
|
|
227
|
-
/** 上一次手指在屏幕上是什么时候、落在哪里。 */
|
|
228
|
-
let lastTouchAt = 0;
|
|
229
|
-
let lastTouchTarget = null;
|
|
230
|
-
const TIMER_MS = {
|
|
231
|
-
fade: 175,
|
|
232
|
-
flash: PRESS_FLASH_MS,
|
|
233
|
-
onset: PRESS_ONSET_MS
|
|
234
|
-
};
|
|
235
|
-
const TIMER_EVENT = {
|
|
236
|
-
fade: "fadeEnd",
|
|
237
|
-
flash: "flashEnd",
|
|
238
|
-
onset: "onset"
|
|
239
|
-
};
|
|
240
|
-
/** 读出一个 CSS 时间值,单位毫秒。不是时间就返回 null。 */
|
|
241
|
-
function parseTimeMs(value) {
|
|
242
|
-
const match = /^\s*(-?(?:\d+(?:\.\d+)?|\.\d+))(ms|s)\s*$/.exec(value);
|
|
243
|
-
if (match == null) return null;
|
|
244
|
-
const amount = Number.parseFloat(match[1]);
|
|
245
|
-
return match[2] === "s" ? amount * 1e3 : amount;
|
|
246
|
-
}
|
|
247
|
-
function prefersReducedMotion() {
|
|
248
|
-
return typeof window !== "undefined" && typeof window.matchMedia === "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
249
|
-
}
|
|
250
|
-
/**
|
|
251
|
-
* 自定义属性读出来是原文,`calc(100ms + 75ms)` 这类写法不是纯时间。
|
|
252
|
-
* 让一个不显示的探针元素把这段原文当作 transition-duration,由浏览器算出实际长度,
|
|
253
|
-
* 和释放动画(用同一个 token 当时长)算出的结果一致。
|
|
254
|
-
*/
|
|
255
|
-
function resolveTimeMs(element, raw) {
|
|
256
|
-
const plain = parseTimeMs(raw);
|
|
257
|
-
if (plain != null || raw.trim() === "") return plain;
|
|
258
|
-
const probe = element.ownerDocument.createElement("span");
|
|
259
|
-
probe.style.setProperty("display", "none", "important");
|
|
260
|
-
probe.style.setProperty("transition-duration", raw, "important");
|
|
261
|
-
if (probe.style.getPropertyValue("transition-duration") === "") return null;
|
|
262
|
-
element.appendChild(probe);
|
|
263
|
-
try {
|
|
264
|
-
return parseTimeMs(getComputedStyle(probe).transitionDuration.split(",")[0] ?? "");
|
|
265
|
-
} finally {
|
|
266
|
-
probe.remove();
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
/**
|
|
270
|
-
* 抬手后淡出的时长:元素上主题的 `--astryx-duration-exit`,抬手时读一次,
|
|
271
|
-
* `calc()` 之类的写法按浏览器算出的长度算。
|
|
272
|
-
* 读不出时间(没主题、或不是时间值)就用默认的 PRESS_FADE_MS。
|
|
273
|
-
* 减少动态效果时不超过 {@link PRESS_FADE_REDUCED_MAX_MS}。
|
|
274
|
-
*/
|
|
275
|
-
function pressFadeMs(element) {
|
|
276
|
-
if (typeof getComputedStyle !== "function") return 175;
|
|
277
|
-
const ms = resolveTimeMs(element, getComputedStyle(element).getPropertyValue("--astryx-duration-exit"));
|
|
278
|
-
const exit = ms != null && ms >= 0 ? ms : 175;
|
|
279
|
-
return prefersReducedMotion() ? Math.min(exit, 200) : exit;
|
|
280
|
-
}
|
|
281
|
-
function paintElement(element, paint) {
|
|
282
|
-
if (paint === "none") element.removeAttribute(PRESSED_ATTRIBUTE);
|
|
283
|
-
else if (element.getAttribute("data-astryx-press") !== paint) element.setAttribute(PRESSED_ATTRIBUTE, paint);
|
|
284
|
-
}
|
|
285
|
-
function clearTimer() {
|
|
286
|
-
if (live?.timer != null) {
|
|
287
|
-
clearTimeout(live.timer);
|
|
288
|
-
live.timer = null;
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
/**
|
|
292
|
-
* 把一个事件交给状态机,再让 DOM 照答案画。
|
|
293
|
-
*
|
|
294
|
-
* 计时器规则:阶段没变、又没要新计时器的一步是路过,原来那个计时器必须留着。
|
|
295
|
-
* 如果每步都先清掉,会有三种手势最后停在「没人碰却亮着」:
|
|
296
|
-
* 等待期内手指在容差内抖了一下(真手指都会抖),onset 被清掉,按压永远不亮;
|
|
297
|
-
* 轻点的 100ms 闪亮期内来了 pointercancel 或滚动,flashEnd 被清掉,一直亮着;
|
|
298
|
-
* 淡出期内同样,`fading` 留在元素上。
|
|
299
|
-
*/
|
|
300
|
-
function apply(step, sinceEventMs = 0) {
|
|
301
|
-
if (live == null) return;
|
|
302
|
-
const phaseMoved = step.gesture.phase !== live.gesture.phase;
|
|
303
|
-
if (step.timer != null || phaseMoved) clearTimer();
|
|
304
|
-
live.gesture = step.gesture;
|
|
305
|
-
paintElement(live.element, step.paint);
|
|
306
|
-
if (step.gesture.phase === "idle") {
|
|
307
|
-
live = null;
|
|
308
|
-
return;
|
|
309
|
-
}
|
|
310
|
-
if (step.timer != null) {
|
|
311
|
-
const kind = step.timer;
|
|
312
|
-
const delay = kind === "fade" ? pressFadeMs(live.element) : kind === "onset" ? Math.max(0, TIMER_MS.onset - sinceEventMs) : TIMER_MS[kind];
|
|
313
|
-
live.timer = setTimeout(() => {
|
|
314
|
-
if (live != null) live.timer = null;
|
|
315
|
-
apply(pressGestureStep(live?.gesture ?? idlePressGesture(), { kind: TIMER_EVENT[kind] }));
|
|
316
|
-
}, delay);
|
|
317
|
-
}
|
|
318
|
-
}
|
|
319
|
-
/**
|
|
320
|
-
* 这次触摸是不是在给手指刚甩动的列表「刹车」。原生列表刹车时什么都不亮。
|
|
321
|
-
* 两个条件都要满足:滚动容器包着这个元素,而且那次滚动是手指在这个容器里带起来的。
|
|
322
|
-
*/
|
|
323
|
-
function scrollerIsBraking(element) {
|
|
324
|
-
if (Date.now() - lastScrollAt >= PRESS_SCROLL_BRAKE_MS) return false;
|
|
325
|
-
return lastScroller instanceof Node && lastScroller.contains(element);
|
|
326
|
-
}
|
|
327
|
-
/** 手势一死就让出唯一的跟踪槽位。变成滚动的手势以 pointercancel 结束,没有 pointerup。 */
|
|
328
|
-
function releaseIfDead() {
|
|
329
|
-
if (live?.gesture.phase === "dead") {
|
|
330
|
-
clearTimer();
|
|
331
|
-
live = null;
|
|
332
|
-
}
|
|
333
|
-
}
|
|
334
|
-
/** 擦掉颜色、忘掉手势,不经过状态机。 */
|
|
335
|
-
function finish() {
|
|
336
|
-
if (live == null) return;
|
|
337
|
-
clearTimer();
|
|
338
|
-
live.element.removeAttribute(PRESSED_ATTRIBUTE);
|
|
339
|
-
live = null;
|
|
340
|
-
}
|
|
341
|
-
function onPointerDown(event) {
|
|
342
|
-
if (event.pointerType === "mouse") return;
|
|
343
|
-
endContact(false);
|
|
344
|
-
if (live != null) {
|
|
345
|
-
const fingerIsUp = live.gesture.phase === "fading" || live.gesture.phase === "flash";
|
|
346
|
-
finish();
|
|
347
|
-
if (!fingerIsUp) return;
|
|
348
|
-
}
|
|
349
|
-
const element = event.target instanceof Element && isTrackedByGroup(event.target, event.pointerType) ? null : pressSurfaceAt(event.target);
|
|
350
|
-
const braking = element != null && scrollerIsBraking(element);
|
|
351
|
-
lastTouchAt = Date.now();
|
|
352
|
-
lastTouchTarget = event.target instanceof Node ? event.target : null;
|
|
353
|
-
if (element == null) return;
|
|
354
|
-
const end = boxHold?.start(element, event.target) ?? null;
|
|
355
|
-
const pressed = braking ? null : {
|
|
356
|
-
element,
|
|
357
|
-
gesture: idlePressGesture(),
|
|
358
|
-
pointerId: event.pointerId,
|
|
359
|
-
timer: null
|
|
360
|
-
};
|
|
361
|
-
if (end != null) contact = {
|
|
362
|
-
pointerId: event.pointerId,
|
|
363
|
-
live: pressed,
|
|
364
|
-
end
|
|
365
|
-
};
|
|
366
|
-
if (pressed == null) return;
|
|
367
|
-
live = pressed;
|
|
368
|
-
apply(pressGestureStep(live.gesture, {
|
|
369
|
-
kind: "down",
|
|
370
|
-
x: event.clientX,
|
|
371
|
-
y: event.clientY,
|
|
372
|
-
delayed: isInsideScrollView(element)
|
|
373
|
-
}), msSinceInput(event.timeStamp, event));
|
|
374
|
-
}
|
|
375
|
-
function isOtherPointer(event) {
|
|
376
|
-
return live == null || live.pointerId != null && event.pointerId !== live.pointerId;
|
|
377
|
-
}
|
|
378
|
-
function onPointerMove(event) {
|
|
379
|
-
if (isOtherPointer(event)) return;
|
|
380
|
-
apply(pressGestureStep(live.gesture, {
|
|
381
|
-
kind: "move",
|
|
382
|
-
x: event.clientX,
|
|
383
|
-
y: event.clientY
|
|
384
|
-
}));
|
|
385
|
-
}
|
|
386
|
-
function onPointerUp(event) {
|
|
387
|
-
if (event.pointerType === "mouse") return;
|
|
388
|
-
lastTouchAt = Date.now();
|
|
389
|
-
if (event.target instanceof Node) lastTouchTarget = event.target;
|
|
390
|
-
if (contact?.pointerId === event.pointerId) {
|
|
391
|
-
const pressed = contact.live;
|
|
392
|
-
endContact(pressed != null && live === pressed && pressed.gesture.phase !== "dead");
|
|
393
|
-
}
|
|
394
|
-
if (isOtherPointer(event)) return;
|
|
395
|
-
apply(pressGestureStep(live.gesture, { kind: "up" }));
|
|
396
|
-
releaseIfDead();
|
|
397
|
-
}
|
|
398
|
-
/** 滚动接管了手势,或者平台拿走了它。iOS 上 pointercancel 比第一个 scroll 事件还早到。 */
|
|
399
|
-
function onCancel(event) {
|
|
400
|
-
const pointerId = event?.pointerId;
|
|
401
|
-
if (pointerId != null && contact?.pointerId === pointerId) endContact(false);
|
|
402
|
-
if (live == null) return;
|
|
403
|
-
apply(pressGestureStep(live.gesture, { kind: "cancel" }));
|
|
404
|
-
releaseIfDead();
|
|
405
|
-
}
|
|
406
|
-
/** 文档里任何一处滚动。scroll 不冒泡,只能在捕获阶段听。 */
|
|
407
|
-
function onScroll(event) {
|
|
408
|
-
const scroller = event.target instanceof Node ? event.target : document;
|
|
409
|
-
if (Date.now() - lastTouchAt < PRESS_GESTURE_MEMORY_MS && lastTouchTarget != null && scroller.contains(lastTouchTarget)) {
|
|
410
|
-
lastScrollAt = Date.now();
|
|
411
|
-
lastScroller = scroller;
|
|
412
|
-
}
|
|
413
|
-
if (live == null) return;
|
|
414
|
-
if (scroller === document || scroller.contains(live.element)) onCancel();
|
|
415
|
-
}
|
|
416
|
-
/** 兜底:页面被切到后台时,不留下亮着的元素。 */
|
|
417
|
-
function onVisibilityChange() {
|
|
418
|
-
if (document.visibilityState === "hidden") {
|
|
419
|
-
endContact(false);
|
|
420
|
-
finish();
|
|
421
|
-
}
|
|
422
|
-
}
|
|
423
|
-
/** 控制器在共用输入流(utils/inputStream.ts)上的订阅,全都被动,只在有人持有时存在。 */
|
|
424
|
-
let unsubscribers = [];
|
|
425
|
-
function addListeners() {
|
|
426
|
-
unsubscribers = [
|
|
427
|
-
subscribeInput(window, "pointerdown", onPointerDown),
|
|
428
|
-
subscribeInput(window, "pointermove", onPointerMove),
|
|
429
|
-
subscribeInput(window, "pointerup", onPointerUp),
|
|
430
|
-
subscribeInput(window, "pointercancel", onCancel),
|
|
431
|
-
subscribeInput(window, "touchcancel", onCancel),
|
|
432
|
-
subscribeInput(window, "dragstart", onCancel),
|
|
433
|
-
subscribeInput(window, "scroll", onScroll),
|
|
434
|
-
subscribeInput(window, "visibilitychange", onVisibilityChange)
|
|
435
|
-
];
|
|
436
|
-
}
|
|
437
|
-
function removeListeners() {
|
|
438
|
-
endContact(false);
|
|
439
|
-
boxHold?.endWaits();
|
|
440
|
-
for (const unsubscribe of unsubscribers) unsubscribe();
|
|
441
|
-
unsubscribers = [];
|
|
442
|
-
}
|
|
443
|
-
function resetClocks() {
|
|
444
|
-
lastScrollAt = 0;
|
|
445
|
-
lastScroller = null;
|
|
446
|
-
lastTouchAt = 0;
|
|
447
|
-
lastTouchTarget = null;
|
|
448
|
-
}
|
|
449
|
-
/**
|
|
450
|
-
* 在这个文档上装好按压控制器。调多少次都只装一份,有人持有时监听就在。
|
|
451
|
-
* 返回释放函数:每次安装各调一次;最后一个释放时拆掉监听,并清掉颜色和刹车时钟。
|
|
452
|
-
* 服务端什么都不做。
|
|
453
|
-
*/
|
|
454
|
-
function installPressFeedback() {
|
|
455
|
-
if (typeof window === "undefined" || typeof document === "undefined") return () => void 0;
|
|
456
|
-
if (holders === 0) addListeners();
|
|
457
|
-
holders += 1;
|
|
458
|
-
let released = false;
|
|
459
|
-
return () => {
|
|
460
|
-
if (released) return;
|
|
461
|
-
released = true;
|
|
462
|
-
holders -= 1;
|
|
463
|
-
if (holders > 0) return;
|
|
464
|
-
removeListeners();
|
|
465
|
-
finish();
|
|
466
|
-
resetClocks();
|
|
467
|
-
};
|
|
468
|
-
}
|
|
469
|
-
//#endregion
|
|
470
|
-
export { PRESSABLE_ATTRIBUTE as a, PRESS_GROUP_ITEM_ATTRIBUTE as c, isInsideScrollView as d, parseTouchAction as f, msSinceInput as h, pressFadeMs as i, isTrackedByGroup as l, clockOf as m, installBoxHold as n, PRESS_ACTION_ATTRIBUTE as o, rootOverflow as p, installPressFeedback as r, PRESS_CONTAINER_ATTRIBUTE as s, PRESSED_ATTRIBUTE as t, SCROLLABLE_OVERFLOW as u };
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { a as PRESSABLE_ATTRIBUTE, o as PRESS_ACTION_ATTRIBUTE, r as installPressFeedback, s as PRESS_CONTAINER_ATTRIBUTE } from "./pressFeedback--_INTed0.js";
|
|
2
|
-
import { getCurrentInstance, getCurrentScope, onMounted, onScopeDispose } from "vue";
|
|
3
|
-
import "../styles/pressable.css";
|
|
4
|
-
//#region src/composables/usePressFeedback.ts
|
|
5
|
-
const MARKER_ONLY = Object.freeze({ [PRESSABLE_ATTRIBUTE]: "" });
|
|
6
|
-
const WITH_OVERLAY = Object.freeze({
|
|
7
|
-
[PRESSABLE_ATTRIBUTE]: "",
|
|
8
|
-
class: "astryx-pressable"
|
|
9
|
-
});
|
|
10
|
-
const CONTAINER_MARKER_ONLY = Object.freeze({
|
|
11
|
-
...MARKER_ONLY,
|
|
12
|
-
[PRESS_CONTAINER_ATTRIBUTE]: ""
|
|
13
|
-
});
|
|
14
|
-
const CONTAINER_WITH_OVERLAY = Object.freeze({
|
|
15
|
-
...WITH_OVERLAY,
|
|
16
|
-
[PRESS_CONTAINER_ATTRIBUTE]: ""
|
|
17
|
-
});
|
|
18
|
-
const ACTION_MARKER = Object.freeze({ [PRESS_ACTION_ATTRIBUTE]: "" });
|
|
19
|
-
/**
|
|
20
|
-
* 对应原版 Astryx 的 `hooks/usePressFeedback`。
|
|
21
|
-
*
|
|
22
|
-
* 把一个元素标成触屏按压模型的可按表面,并确保文档级控制器已经装上。
|
|
23
|
-
*
|
|
24
|
-
* 手指下,CSS 的 `:active` 落手就亮,滚动开始了还可能亮着。按压模型反过来:
|
|
25
|
-
* 滚动视图外,手指落下那一帧就亮;滚动视图里先等 150 毫秒确认是按压。
|
|
26
|
-
* 手指挪动超过 10 像素或者页面滚动,立刻作废,这次手势里不再亮回来;
|
|
27
|
-
* 太快的轻点在抬手时补亮;抬手后按主题的退出时长淡出。鼠标不受影响,`:active` 照旧。
|
|
28
|
-
*
|
|
29
|
-
* 一个文档只有一个控制器:第一个挂载的可按组件装上,最后一个卸载时拆掉。
|
|
30
|
-
* 调用它不会给元素加监听或状态,一次按压只改一个属性。服务端不装。
|
|
31
|
-
*/
|
|
32
|
-
function usePressFeedback(options = {}) {
|
|
33
|
-
let release = null;
|
|
34
|
-
const install = () => {
|
|
35
|
-
release ??= installPressFeedback();
|
|
36
|
-
};
|
|
37
|
-
if (getCurrentInstance() != null) onMounted(install);
|
|
38
|
-
else install();
|
|
39
|
-
if (getCurrentScope() != null) onScopeDispose(() => {
|
|
40
|
-
release?.();
|
|
41
|
-
release = null;
|
|
42
|
-
});
|
|
43
|
-
return {
|
|
44
|
-
pressableProps: options.isContainer === true ? options.hasOverlay === false ? CONTAINER_MARKER_ONLY : CONTAINER_WITH_OVERLAY : options.hasOverlay === false ? MARKER_ONLY : WITH_OVERLAY,
|
|
45
|
-
pressActionProps: ACTION_MARKER
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
//#endregion
|
|
49
|
-
export { usePressFeedback as t };
|