@astryx-vue/core 0.29.0 → 0.30.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-B195FgtL.js → AlertDialog-B_p1yL3k.js} +9 -9
- package/dist/AppShell/index.d.ts +1 -1
- package/dist/AppShell/index.js +1 -1
- package/dist/{AppShell-CxUmt6hX.js → AppShell-D3KZSLvb.js} +5 -5
- package/dist/Avatar/index.js +1 -1
- package/dist/{Avatar-DpFHPRlE.js → Avatar-IVvsyeGV.js} +1 -1
- package/dist/AvatarGroup/index.d.ts +1 -1
- package/dist/AvatarGroup/index.js +1 -1
- package/dist/{AvatarGroup-DT5RbxDa.js → AvatarGroup-Dd-yDDNz.js} +2 -2
- package/dist/Banner/index.d.ts +1 -1
- package/dist/Banner/index.js +1 -1
- package/dist/{Banner-DVU5-fWC.js → Banner-DKmvoMxD.js} +1 -1
- package/dist/BottomSheet/index.d.ts +1 -1
- package/dist/BottomSheet/index.js +2 -2
- package/dist/{BottomSheet-DVe5Nw9Z.js → BottomSheet-Btf8Yn8k.js} +881 -302
- package/dist/{BottomSheet-D3893Ymj.js → BottomSheet-CQGtoh2x.js} +8 -2
- package/dist/Breadcrumbs/index.js +2 -2
- package/dist/{Breadcrumbs-CQa-Jjnn.js → Breadcrumbs-D6825HQI.js} +1 -1
- package/dist/Button/index.d.ts +1 -1
- package/dist/Button/index.js +1 -1
- package/dist/{Button-yJiHoWps.js → Button-DdPty46q.js} +5 -5
- package/dist/ButtonGroup/index.d.ts +1 -1
- package/dist/ButtonGroup/index.js +1 -1
- package/dist/{ButtonGroup-CUN_rC57.js → ButtonGroup-oI99JAyN.js} +3 -3
- package/dist/{ButtonTooltip-CNKOQHYR.js → ButtonTooltip-ZpQP-aQg.js} +1 -1
- package/dist/Calendar/index.d.ts +1 -1
- package/dist/Card/index.d.ts +1 -1
- package/dist/Carousel/index.d.ts +1 -1
- package/dist/Carousel/index.js +1 -1
- package/dist/{Carousel-DPhwOTjx.js → Carousel-BNr79JpP.js} +1 -1
- package/dist/Chat/index.d.ts +1 -1
- package/dist/Chat/index.js +1 -1
- package/dist/{Chat-Bg1IuDMt.js → Chat-BadS0fEx.js} +4 -4
- package/dist/CheckboxInput/index.d.ts +1 -1
- package/dist/CheckboxInput/index.js +1 -1
- package/dist/{CheckboxInput-C-UseBJo.js → CheckboxInput-CzP8gP3v.js} +4 -4
- package/dist/CheckboxList/index.d.ts +1 -1
- package/dist/CheckboxList/index.js +1 -1
- package/dist/{CheckboxList-DGM-cgX5.js → CheckboxListItem-CxBjpX3d.js} +5 -5
- package/dist/ClickableCard/index.d.ts +1 -1
- package/dist/ClickableCard/index.js +1 -1
- package/dist/{ClickableCard-ChmOwgYq.js → ClickableCard-B86P2aiM.js} +1 -1
- package/dist/Code/index.d.ts +1 -1
- package/dist/Code/index.js +1 -1
- package/dist/{CodeBlock-3QLhu3jZ.js → CodeBlock-Cgm4uOhG.js} +1 -1
- package/dist/Collapsible/index.d.ts +1 -1
- package/dist/Collapsible/index.js +1 -1
- package/dist/{Collapsible-B2vrr_YP.js → Collapsible-CfTN722D.js} +3 -3
- package/dist/CommandPalette/index.js +1 -1
- package/dist/{CommandPalette-CtY5ZCR7.js → CommandPalette-BgVwGtdA.js} +2 -2
- package/dist/ComplexSelector/index.d.ts +1 -1
- package/dist/ComplexSelector/index.js +1 -1
- package/dist/{ComplexSelector-CZiUA6Gm.js → ComplexSelector-DqWJVx7H.js} +4 -4
- package/dist/ContextMenu/index.d.ts +1 -1
- package/dist/ContextMenu/index.js +2 -2
- package/dist/{ContextMenu-8I420g7H.js → ContextMenu-C9dJGu3M.js} +4 -4
- package/dist/DateInput/index.d.ts +1 -1
- package/dist/DateInput/index.js +1 -1
- package/dist/{DateInput-KZF_A_31.js → DateInput-CGKaozkw.js} +4 -4
- package/dist/DateRangeInput/index.d.ts +1 -1
- package/dist/DateRangeInput/index.js +1 -1
- package/dist/{DateRangeInput-4GCWgLFN.js → DateRangeInput-BVHXgzXz.js} +4 -4
- package/dist/DateTimeInput/index.d.ts +1 -1
- package/dist/DateTimeInput/index.js +1 -1
- package/dist/{DateTimeInput-BGcdOmRp.js → DateTimeInput-DRm3lekJ.js} +5 -5
- package/dist/Dialog/index.d.ts +1 -1
- package/dist/Dialog/index.js +3 -3
- package/dist/{Dialog-CKDlXonX.js → Dialog-BN-NycQr.js} +1 -1
- package/dist/{Dialog-DjhG_vpE.js → Dialog-Dt0gNuMT.js} +2 -2
- package/dist/{DialogHeader-C1Bz4Knk.js → DialogHeader-CSH2_5v-.js} +2 -2
- package/dist/Divider/index.d.ts +1 -1
- package/dist/Drawer/index.d.ts +1 -1
- package/dist/Drawer/index.js +1 -1
- package/dist/{Drawer-BqcPP0z7.js → Drawer-PeMgE4iA.js} +2 -2
- package/dist/DropdownMenu/index.js +3 -3
- package/dist/{DropdownMenu-CSqkl-Xl.js → DropdownMenu-C9bvYZPt.js} +6 -6
- package/dist/{DropdownMenu-B-dBiomz.js → DropdownMenu-_lQQyQCn.js} +7 -7
- package/dist/EmptyState/index.js +1 -1
- package/dist/{EmptyState-DNjqNAT3.js → EmptyState-BGo1nrnT.js} +2 -2
- package/dist/Field/index.js +3 -3
- package/dist/{Field-DrUMz0oj.js → Field-D-fRqyso.js} +1 -1
- package/dist/{FieldInfoTip-DmDOcxU1.js → FieldInfoTip-Bstp5Lvd.js} +2 -2
- package/dist/{FieldLabel-DsFZnW1l.js → FieldLabel-lV_qLaGp.js} +1 -1
- package/dist/FileInput/index.js +1 -1
- package/dist/{FileInput-0u4zjJfx.js → FileInput-CTNnDIkm.js} +4 -4
- package/dist/Heading/index.d.ts +1 -1
- package/dist/Heading/index.js +1 -1
- package/dist/{Heading-BG1PBVkf.js → Heading-BFK3PftX.js} +1 -1
- package/dist/HoverCard/index.d.ts +1 -1
- package/dist/HoverCard/index.js +1 -1
- package/dist/{HoverCard-Fr6RLRR8.js → HoverCard-DGjsPn-Q.js} +3 -3
- package/dist/IconButton/index.js +1 -1
- package/dist/{IconButton-CEjiXpUg.js → IconButton-DPezhVBA.js} +1 -1
- package/dist/InfoTip/index.d.ts +1 -1
- package/dist/InfoTip/index.js +1 -1
- package/dist/{InfoTip-CKRaCO6I.js → InfoTip-B4BFfLtT.js} +2 -2
- package/dist/{InputClearButton-ByUJXRmY.js → InputClearButton-CxU3iv-5.js} +1 -1
- package/dist/InputGroup/index.js +1 -1
- package/dist/{InputGroup-H8DP0TAG.js → InputGroup-CraWGK6Y.js} +1 -1
- package/dist/{Item-C8UAQwFQ.js → Item-C9u_kQUO.js} +15 -14
- package/dist/Lightbox/index.js +1 -1
- package/dist/{Lightbox-LI6h7LFn.js → Lightbox-BNUG9CQ1.js} +1 -1
- package/dist/Link/index.d.ts +1 -1
- package/dist/Link/index.js +1 -1
- package/dist/{Link-Dx2ql41g.js → Link-Bwgpn-di.js} +2 -2
- package/dist/List/index.d.ts +1 -1
- package/dist/List/index.js +2 -2
- package/dist/{ListItem-BlrEngDO.js → ListItem-_lOmngHp.js} +2 -2
- package/dist/Markdown/index.js +1 -1
- package/dist/{Markdown-BHWf2IOO.js → Markdown-BlEi5UGN.js} +3 -3
- package/dist/MetadataList/index.d.ts +1 -1
- package/dist/MobileNav/index.js +1 -1
- package/dist/{MobileNavToggle-D5yGMHU4.js → MobileNavToggle-wVa9dzH1.js} +1 -1
- package/dist/MoreMenu/index.d.ts +1 -1
- package/dist/MoreMenu/index.js +1 -1
- package/dist/{MoreMenu-GPcHAauX.js → MoreMenu-MmvMRWv5.js} +6 -6
- package/dist/MultiSelector/index.d.ts +1 -1
- package/dist/MultiSelector/index.js +1 -1
- package/dist/{MultiSelector-BSA613nO.js → MultiSelector-DXrKQLmq.js} +7 -7
- package/dist/{NavDisclosure-B66SHKdd.js → NavDisclosure-DsUYuMJr.js} +1 -1
- package/dist/{NavHeadingSurface-BZCzkCPJ.js → NavHeadingSurface-QdM33nOf.js} +1 -1
- package/dist/NavItem/index.d.ts +1 -1
- package/dist/NavItem/index.js +1 -1
- package/dist/{NavItem-kj9FbbFS.js → NavItem-D4xHjSTo.js} +1 -1
- package/dist/NavMenu/index.js +3 -3
- package/dist/{NavMenu-BoKuJq-K.js → NavMenu-NCg3VjAQ.js} +3 -3
- package/dist/{NavMenuItem-Ez3_K8iI.js → NavMenuItem-Bla6fYVl.js} +4 -4
- package/dist/NumberInput/index.d.ts +1 -1
- package/dist/NumberInput/index.js +1 -1
- package/dist/{NumberInput-lqUmTsqB.js → NumberInput-DicgvFte.js} +4 -4
- package/dist/Outline/index.js +1 -1
- package/dist/{Outline-DI9MZnuQ.js → Outline-DlO_97b4.js} +3 -3
- package/dist/OverflowList/index.d.ts +1 -1
- package/dist/OverflowList/index.js +1 -1
- package/dist/{OverflowList-B6En7wIj.js → OverflowList-BYYz3ePw.js} +2 -2
- package/dist/Pagination/index.d.ts +1 -1
- package/dist/Pagination/index.js +1 -1
- package/dist/{Pagination-DWfvdCpK.js → Pagination-DM_W9Ue-.js} +3 -3
- package/dist/Popover/index.d.ts +1 -1
- package/dist/Popover/index.js +1 -1
- package/dist/{Popover-CB5UYJZc.js → Popover-CxReY-4u.js} +8 -8
- package/dist/PowerSearch/index.d.ts +2 -2
- package/dist/PowerSearch/index.js +1 -1
- package/dist/PowerSearch-BwUWZG3p.js +4829 -0
- package/dist/ProgressBar/index.d.ts +1 -1
- package/dist/ProgressBar/index.js +1 -1
- package/dist/{ProgressBar-yw2BCtB_.js → ProgressBar-DCAEXJuP.js} +1 -1
- package/dist/Radio/index.d.ts +1 -1
- package/dist/Radio/index.js +1 -1
- package/dist/{RadioGroup-B8QoJyJu.js → RadioGroup-CsJYGjyx.js} +4 -4
- package/dist/RadioList/index.d.ts +1 -1
- package/dist/RadioList/index.js +1 -1
- package/dist/{RadioList-BEv82wbs.js → RadioListItem-Yc3K82YE.js} +1 -1
- package/dist/Resizable/index.d.ts +1 -1
- package/dist/ScrollableArea/index.d.ts +1 -1
- package/dist/SegmentedControl/index.js +1 -1
- package/dist/{SegmentedControl-BkWz-I2J.js → SegmentedControl-C-F5dkcG.js} +3 -3
- package/dist/SelectableCard/index.d.ts +1 -1
- package/dist/SelectableCard/index.js +1 -1
- package/dist/{SelectableCard-GRWYx3iD.js → SelectableCard-CwfpgsS8.js} +1 -1
- package/dist/Selector/index.d.ts +1 -1
- package/dist/Selector/index.js +1 -1
- package/dist/{Selector-4sexgsUO.js → Selector-bH99g1vj.js} +5 -5
- package/dist/SideNav/index.d.ts +1 -1
- package/dist/SideNav/index.js +2 -2
- package/dist/{SideNav-B_0Fv-ZU.js → SideNav-C1ZxusAB.js} +9 -9
- package/dist/Slider/index.js +1 -1
- package/dist/{Slider-Bmksx8ng.js → Slider-Bq_7Nskr.js} +3 -3
- package/dist/Stack/index.d.ts +1 -1
- package/dist/StatusDot/index.js +1 -1
- package/dist/{StatusDot-Bz4l43St.js → StatusDot-DFJavm30.js} +1 -1
- package/dist/Stepper/index.d.ts +1 -1
- package/dist/Stepper/index.js +1 -1
- package/dist/{Stepper-CCuggsov.js → Stepper-CWluGqBs.js} +1 -1
- package/dist/Switch/index.d.ts +1 -1
- package/dist/Switch/index.js +1 -1
- package/dist/{Switch-CeNEvvTn.js → Switch-DTPvMAxd.js} +3 -3
- package/dist/TabList/index.d.ts +1 -1
- package/dist/TabList/index.js +1 -1
- package/dist/{TabList-BLLxHXwu.js → TabList-C4i7UZkp.js} +4 -4
- package/dist/Table/index.d.ts +1 -1
- package/dist/Table/index.js +1 -1
- package/dist/{Table-Ck4haR13.js → Table-ClHIgsKO.js} +15 -15
- package/dist/Text/index.d.ts +1 -1
- package/dist/Text/index.js +1 -1
- package/dist/{Text-DkSHitKh.js → Text-D48QFTtL.js} +1 -1
- package/dist/TextArea/index.d.ts +1 -1
- package/dist/TextArea/index.js +1 -1
- package/dist/{TextArea-CAcjMvls.js → TextArea-J2_wct0p.js} +5 -5
- package/dist/TextInput/index.d.ts +1 -1
- package/dist/TextInput/index.js +1 -1
- package/dist/{TextInput-BvQQTG75.js → TextInput-Da1TYd57.js} +5 -5
- package/dist/Thumbnail/index.js +1 -1
- package/dist/{Thumbnail-Bv-M13fy.js → Thumbnail-1LsaJ4_m.js} +3 -3
- package/dist/{TimeField-B83zAjAA.js → TimeField-i5ESA500.js} +4 -4
- package/dist/TimeInput/index.d.ts +1 -1
- package/dist/TimeInput/index.js +1 -1
- package/dist/{TimeInput-BoIZG-dF.js → TimeInput-frnKZo1M.js} +2 -2
- package/dist/Timer/index.d.ts +1 -1
- package/dist/Timer/index.js +1 -1
- package/dist/{Timer-qjI_QrCz.js → Timer-DgQdZAEa.js} +1 -1
- package/dist/Timestamp/index.d.ts +1 -1
- package/dist/Timestamp/index.js +1 -1
- package/dist/{Timestamp-CJ_HUcek.js → Timestamp-SseS_qtf.js} +3 -3
- package/dist/Toast/index.js +1 -1
- package/dist/{Toast-CFpOSuAr.js → Toast-tAq4S96S.js} +149 -20
- package/dist/ToggleButton/index.d.ts +1 -1
- package/dist/ToggleButton/index.js +1 -1
- package/dist/{ToggleButton-BtXMvoOA.js → ToggleButton-B6hBzeVl.js} +3 -3
- package/dist/Token/index.js +1 -1
- package/dist/{Token-C7Dt5ygK.js → Token-DTGUCgpn.js} +1 -1
- package/dist/Tokenizer/index.d.ts +1 -1
- package/dist/Tokenizer/index.js +1 -1
- package/dist/{Tokenizer-DrkIayoF.js → Tokenizer-iFZAuIwu.js} +166 -155
- package/dist/Toolbar/index.d.ts +1 -1
- package/dist/Toolbar/index.js +1 -1
- package/dist/{Toolbar-DSWH8ll4.js → Toolbar-BHkPxDxA.js} +1 -1
- package/dist/Tooltip/index.d.ts +1 -1
- package/dist/Tooltip/index.js +2 -2
- package/dist/{Tooltip-ByLqPCP7.js → Tooltip-CxzlUVN0.js} +1 -1
- package/dist/TopNav/index.d.ts +1 -1
- package/dist/TopNav/index.js +1 -1
- package/dist/{TopNav-Rcz2zriX.js → TopNav-CcIayfsW.js} +6 -6
- package/dist/TreeList/index.d.ts +1 -1
- package/dist/TreeList/index.js +1 -1
- package/dist/{TreeList-Dh0uAj2B.js → TreeList-Da_OKrv_.js} +4 -4
- package/dist/Typeahead/index.d.ts +1 -1
- package/dist/Typeahead/index.js +2 -2
- package/dist/{Typeahead-D2O3n477.js → Typeahead-BD6xXNKh.js} +6 -6
- package/dist/VelocityTracker-DgjmootV.js +165 -0
- package/dist/{animator-BGq5a6vT.js → animator-CEHDYTfQ.js} +29 -173
- package/dist/{batch-BhaAWUIt.js → batch-D2a2MsSW.js} +4 -19
- package/dist/bezier-Dko5MnTp.js +37 -0
- package/dist/{clickGuard-FrlnECMp.js → clickGuard-C3VmOLhI.js} +2 -1
- package/dist/composables/index.js +10 -10
- package/dist/composables-Bs0O_SRd.js +2548 -0
- package/dist/{context-jtpQfR6F.js → context-NKb_prrS.js} +2 -2
- package/dist/{edge-CJIswPTX.js → edge-tj-cLZYh.js} +1 -1
- package/dist/{edgeRide-Drk4V-MC.js → edgeRide-DcUqLXE2.js} +4 -4
- package/dist/{handle-BazRxHwq.js → handle-CwxCHapJ.js} +1 -1
- package/dist/{holdEntranceInput-DMCOeRqu.js → holdEntranceInput-DgimbgGm.js} +1 -1
- package/dist/{index-Ct8M2d4q.d.ts → index-3qz8Qztx.d.ts} +5 -5
- package/dist/{index-DPklTi3o.d.ts → index-B-3EGjfQ.d.ts} +2 -2
- package/dist/{index-X4S7_dmq.d.ts → index-BA8exXNP.d.ts} +1 -1
- package/dist/{index-DIkdln91.d.ts → index-BIqW3_GP.d.ts} +2 -2
- package/dist/{index-BR3MOBYd.d.ts → index-BgT6mH3U.d.ts} +2 -2
- package/dist/{index-CTjkJP4x.d.ts → index-Bgk1Rj2A.d.ts} +1 -1
- package/dist/{index-BqQlY3fL.d.ts → index-Bu4R0WZA.d.ts} +2 -2
- package/dist/{index-ChqMaV6N.d.ts → index-Bzi3A980.d.ts} +1 -1
- package/dist/{index-I64GPV90.d.ts → index-C6IcBhAn.d.ts} +3 -3
- package/dist/{index-C4S65SAW.d.ts → index-CKnr0JlT.d.ts} +1 -1
- package/dist/{index-mK1ICsVg.d.ts → index-Cm36VS1A.d.ts} +2 -2
- package/dist/{index-6fLylXRI.d.ts → index-Cw4CUe06.d.ts} +5 -5
- package/dist/{index-C8wfe0Mr.d.ts → index-D05JGsT3.d.ts} +1 -1
- package/dist/{index-BFGtLIp8.d.ts → index-D14kSf-g.d.ts} +2 -2
- package/dist/{index-In41wHf3.d.ts → index-DGe-ApvN.d.ts} +4 -4
- package/dist/{index-D8l_CmL-.d.ts → index-DIw5D3zj.d.ts} +2 -2
- package/dist/{index-ZXrvTM3A.d.ts → index-DVS4jM-l.d.ts} +2 -2
- package/dist/{index-DPhQZXYw.d.ts → index-DYabo8TI.d.ts} +1 -1
- package/dist/{index-BtqvPjAf.d.ts → index-DofC9Rll.d.ts} +1 -1
- package/dist/{index-aHC2C89h.d.ts → index-Ea2V_FSK.d.ts} +4 -4
- package/dist/{index-CBOv5j3c.d.ts → index-FeZXsFO-.d.ts} +3 -3
- package/dist/{index-DVX2jlTQ.d.ts → index-JE1HrzdJ.d.ts} +2 -2
- package/dist/{index-DCyYldjP.d.ts → index-T5bzxQ30.d.ts} +1 -1
- package/dist/{index-CdvmnNMH.d.ts → index-YKCx03zD.d.ts} +1 -1
- package/dist/{index-NOxH5oYj.d.ts → index-etx25Eq-.d.ts} +1 -1
- package/dist/{index-B9iQwixh.d.ts → index-m3DOxOw6.d.ts} +80 -69
- package/dist/{index-yQc-te9a.d.ts → index-ql9ApSTF.d.ts} +2 -2
- package/dist/{index-CtYlR9Cu.d.ts → index-rdwI-mcm.d.ts} +1 -1
- package/dist/{index-NOXYEdOI.d.ts → index-utZGF4GR.d.ts} +1 -1
- package/dist/{index-C89cIh4E.d.ts → index-waTkqxTz.d.ts} +1 -1
- package/dist/index.d.ts +31 -31
- package/dist/index.js +102 -100
- package/dist/{inputHold-BmChuR9x.js → inputHold-DW2LYHb5.js} +4 -4
- package/dist/{inputHoldState-pblUT4oh.js → inputHoldState-xntIqr5W.js} +2 -1
- package/dist/{inputStream-LZdK8luP.js → inputStream-bPd9eB2b.js} +2 -49
- package/dist/isRtlElement-NHuH48AA.js +23 -0
- package/dist/{landing-CBaXCGEg.js → landing-Bi7X7w_7.js} +3 -3
- package/dist/{lazyBottomSheet-BK8yIqcZ.js → lazyBottomSheet-BVZ1yH8g.js} +1 -1
- package/dist/{timing-CSHWQbTJ.js → linearEasing-ScK9LqAY.js} +30 -1
- package/dist/{useLayerMountTarget-BmZyeKWE.js → mount-7R_s-bHB.js} +15 -42
- package/dist/{bezier-Df-yGuNZ.js → presentation-Cy_yf56y.js} +2 -39
- package/dist/{pressFeedback-DVR5V1b6.js → pressFeedback-9dqGYjxv.js} +2 -2
- package/dist/{resolveMotion-CurhYTVC.js → resolveMotion-1cwESYvK.js} +202 -1
- package/dist/resolveSnapPoint-DdZyBkT4.js +717 -0
- package/dist/{flatTree-BB4yPMNL.js → sharedRealm-H1OrlP0V.js} +49 -1
- package/dist/{stillPointerGate-D3loXLh7.js → stillPointerGate-BbMABRyU.js} +1 -1
- package/dist/{themeTiming-BFDOPRjK.js → themeTiming-NUkH9HsU.js} +1 -1
- package/dist/{tooltipFocusRules-DvVDuqZI.js → tooltipFocusRules-CpUOvFEU.js} +1 -1
- package/dist/{tooltipTriggerRules-DyPyWOdP.js → tooltipTriggerRules-zN2xGd9K.js} +1 -1
- package/dist/{touchHold-CFJlSClt.js → touchHold-DXtx7npm.js} +1 -1
- package/dist/{triggerVariant-DG0VhG-X.js → triggerVariant-DPuBmzpp.js} +1 -1
- package/dist/{useActionGroupTracking-C6BzQzvp.js → useActionGroupTracking-CLFF7FI2.js} +2 -2
- package/dist/{useAnimatedLayout-DC2l3WrE.js → useAnimatedLayout-DWWc31RR.js} +1 -1
- package/dist/{composables-BTRbNgmR.js → useAttachment-BuNyeUXy.js} +44 -3464
- package/dist/{useChatStreamScroll-Cv51kRT0.js → useChatStreamScroll-CuMzkXgD.js} +1 -1
- package/dist/{useDismiss-C7_S7qUA.js → useDismiss-BKtyCwx4.js} +1 -1
- package/dist/{useInputStatusIcon-CGj9gMj8.js → useInputStatusIcon-BqV6YzTV.js} +1 -1
- package/dist/useLayerMountTarget-zwZQglr2.js +44 -0
- package/dist/{useListFocus-CkHfsZp0.js → useListFocus-Ccd_HU9T.js} +2 -23
- package/dist/{useMenuDrillIn-BQx6lQMz.js → useMenuDrillIn-Cj6MM77J.js} +1 -1
- package/dist/{useMenuEntranceHold-buV5S9yk.js → useMenuEntranceHold-HznOwIry.js} +1 -1
- package/dist/{useMenuHover-CfQtWMg-.js → useMenuHover-DoBatZeD.js} +1 -1
- package/dist/{useMenuPress-DU6pAIHy.js → useMenuPress-DcwVUsQO.js} +3 -3
- package/dist/{usePressFeedback-BhNcuxQv.js → usePressFeedback-DHdmAsMp.js} +1 -1
- package/dist/{useTooltip-Bsm43vbi.js → useTooltip-DvBKna-w.js} +3 -3
- package/dist/{useTouchHitArea-CNZyA18Y.js → useTouchHitArea-SY1ITxSJ.js} +2 -2
- package/dist/{useTruncationTooltip-wc6Lzz34.js → useTruncationTooltip-DNAii2Nv.js} +3 -3
- package/dist/{useTypeaheadMenuConfig-Do0jOyEm.js → useTypeaheadMenuConfig-BT9Lwsu7.js} +1 -1
- package/package.json +1 -1
- package/styles/bottom-sheet.css +33 -8
- package/styles/power-search-sheet.css +205 -0
- package/styles.css +1 -0
- package/dist/PowerSearch-q3jvh5Tw.js +0 -2797
|
@@ -1,6 +1,13 @@
|
|
|
1
|
-
import { c as
|
|
1
|
+
import { c as deepActiveElement, h as isNode, m as isHTMLElement, s as containsAlongFlatTree } from "./sharedRealm-H1OrlP0V.js";
|
|
2
|
+
import { i as defaultPrefersReducedMotion, n as resolveMoveTiming } from "./resolveMotion-1cwESYvK.js";
|
|
3
|
+
import { p as scroll } from "./pressGesture-BzIBmKF2.js";
|
|
2
4
|
import { r as resetLayerScopedContext } from "./scopedProvide-C-Df7c15.js";
|
|
5
|
+
import { r as provideNestedLayerMountTarget } from "./mount-7R_s-bHB.js";
|
|
3
6
|
import { i as isTopLayer, n as useLayerDepth, o as pushLayer, s as isImeKeyEvent, t as provideLayerDepth } from "./layerDepth-D3Rh8T5C.js";
|
|
7
|
+
import { t as useMediaQuery } from "./useMediaQuery-BzXGT1Aw.js";
|
|
8
|
+
import { r as SETTLE_THRESHOLD, t as animatorFor } from "./animator-CEHDYTfQ.js";
|
|
9
|
+
import { r as springs, t as resolveSnapPoint } from "./resolveSnapPoint-DdZyBkT4.js";
|
|
10
|
+
import { t as VelocityTracker } from "./VelocityTracker-DgjmootV.js";
|
|
4
11
|
import { t as focusForLastInput } from "./focusReturn-DfZS7TCp.js";
|
|
5
12
|
import { t as useFocusTrap } from "./useFocusTrap-BD9POtMp.js";
|
|
6
13
|
import { t as useRestoreFocus } from "./useRestoreFocus-DS7uQWok.js";
|
|
@@ -11,7 +18,7 @@ import { t as createModalOutletHandle } from "./modalOutlet-Drr9a16b.js";
|
|
|
11
18
|
import { o as provideLayoutContainer } from "./context-D-Hwh-Jf.js";
|
|
12
19
|
import { t as useScrollbars } from "./useScrollbars-Ch0xqJWO.js";
|
|
13
20
|
import { t as bottomSheetEscapeKey } from "./escape-DzSxSmez.js";
|
|
14
|
-
import { Fragment, computed, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, getCurrentInstance, inject, mergeModels, mergeProps, nextTick, normalizeClass, normalizeStyle, onBeforeUnmount, onMounted, onScopeDispose, onUpdated, openBlock, provide, ref, renderSlot, toValue, unref, useAttrs, useModel, useTemplateRef, watch, withCtx } from "vue";
|
|
21
|
+
import { Fragment, computed, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, getCurrentInstance, inject, mergeModels, mergeProps, nextTick, normalizeClass, normalizeStyle, onBeforeUnmount, onMounted, onScopeDispose, onUpdated, openBlock, provide, ref, renderSlot, shallowRef, toValue, unref, useAttrs, useModel, useTemplateRef, watch, withCtx } from "vue";
|
|
15
22
|
import "../styles/bottom-sheet.css";
|
|
16
23
|
//#region \0rolldown/runtime.js
|
|
17
24
|
var __defProp = Object.defineProperty;
|
|
@@ -119,6 +126,82 @@ function holdKeptInside(layer, until) {
|
|
|
119
126
|
return release;
|
|
120
127
|
}
|
|
121
128
|
//#endregion
|
|
129
|
+
//#region src/BottomSheet/sheetDragExit.ts
|
|
130
|
+
/** How many more frames a drag's close looks for its scrim's fade to adopt. */
|
|
131
|
+
const MAX_SCRIM_FADE_ADOPT_FRAMES = 3;
|
|
132
|
+
/** Without Web Animations the animator jumps to its end, so the stylesheet's exit runs instead. */
|
|
133
|
+
function supportsWebAnimations() {
|
|
134
|
+
return typeof Element !== "undefined" && typeof Element.prototype.animate === "function";
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* How a drag's close plays: the close spring's move from where the finger
|
|
138
|
+
* left the sheet, timed as the shared animator times it, and its progress
|
|
139
|
+
* toward the point where the sheet leaves view. The surface reaches below the
|
|
140
|
+
* screen (the reserve), so it leaves view before the spring settles, and the
|
|
141
|
+
* scrim is clear by then.
|
|
142
|
+
*/
|
|
143
|
+
function dragExitFade(element, exit) {
|
|
144
|
+
const viewportHeight = element.ownerDocument.defaultView?.innerHeight ?? 0;
|
|
145
|
+
const shown = Math.max(0, viewportHeight - element.getBoundingClientRect().top);
|
|
146
|
+
return resolveMoveTiming(element, springs.sheetDismissSwipe, {
|
|
147
|
+
from: 0,
|
|
148
|
+
to: exit.distance,
|
|
149
|
+
velocity: exit.velocity,
|
|
150
|
+
epsilon: SETTLE_THRESHOLD.y
|
|
151
|
+
}, Math.min(exit.distance, shown));
|
|
152
|
+
}
|
|
153
|
+
/** The running fade that clears the scrim behind `panel`, if any. */
|
|
154
|
+
function clearingScrimFade(panel) {
|
|
155
|
+
const dialog = panel.closest("dialog");
|
|
156
|
+
const doc = panel.ownerDocument;
|
|
157
|
+
if (dialog == null || typeof doc.getAnimations !== "function") return void 0;
|
|
158
|
+
const fades = doc.getAnimations().filter((animation) => {
|
|
159
|
+
const effect = animation.effect;
|
|
160
|
+
return effect?.target === dialog && animation.transitionProperty === "opacity" && Number(effect.getKeyframes().at(-1)?.opacity) === 0;
|
|
161
|
+
});
|
|
162
|
+
const onBackdrop = fades.filter((fade) => fade.effect.pseudoElement === "::backdrop");
|
|
163
|
+
return (onBackdrop.length > 0 ? onBackdrop : fades.filter((fade) => !fade.effect.pseudoElement)).at(-1);
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Plays a touch drag's close on the shared animator with the dismiss swipe's
|
|
167
|
+
* spring, from the release speed. The scrim's CSS fade takes the close's start
|
|
168
|
+
* time, so the two end together. Returns the cleanup: a reopen during the
|
|
169
|
+
* exit takes the sheet back from where it is.
|
|
170
|
+
*/
|
|
171
|
+
function playDragExit(element, exit, callbacks) {
|
|
172
|
+
const handle = animatorFor(element).animate({ y: exit.distance }, {
|
|
173
|
+
spring: springs.sheetDismissSwipe,
|
|
174
|
+
velocity: { y: exit.velocity }
|
|
175
|
+
});
|
|
176
|
+
let isCurrent = true;
|
|
177
|
+
let isFinished = false;
|
|
178
|
+
let frame = null;
|
|
179
|
+
handle.started.then((start) => {
|
|
180
|
+
const adopt = (framesLeft) => {
|
|
181
|
+
frame = null;
|
|
182
|
+
if (!isCurrent) return;
|
|
183
|
+
const fade = clearingScrimFade(element);
|
|
184
|
+
if (fade != null) fade.startTime = start;
|
|
185
|
+
else if (framesLeft > 0 && typeof requestAnimationFrame === "function") frame = requestAnimationFrame(() => adopt(framesLeft - 1));
|
|
186
|
+
};
|
|
187
|
+
adopt(MAX_SCRIM_FADE_ADOPT_FRAMES);
|
|
188
|
+
});
|
|
189
|
+
handle.finished.then(() => {
|
|
190
|
+
isFinished = true;
|
|
191
|
+
callbacks.onSettled();
|
|
192
|
+
if (isCurrent) callbacks.complete();
|
|
193
|
+
});
|
|
194
|
+
return () => {
|
|
195
|
+
isCurrent = false;
|
|
196
|
+
if (frame != null) cancelAnimationFrame(frame);
|
|
197
|
+
if (!isFinished) handle.retarget({ y: 0 });
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
/** A hidden sheet can stay mounted, so the exit's offset goes back to 0. */
|
|
201
|
+
function resetDragExit(element) {
|
|
202
|
+
animatorFor(element).set({ y: 0 });
|
|
203
|
+
}
|
|
204
|
+
//#endregion
|
|
122
205
|
//#region src/BottomSheet/sheetTransition.ts
|
|
123
206
|
const BACKSTOP_BUFFER_MS = 50;
|
|
124
207
|
function parseTransitionTime(value) {
|
|
@@ -275,14 +358,49 @@ function resolveSettleOffset(value, offsets, dir, baseOffset) {
|
|
|
275
358
|
function visibleHeightForOffset(sheetHeight, offset, offscreenBlockEndInset) {
|
|
276
359
|
return Math.max(0, sheetHeight - offscreenBlockEndInset - offset);
|
|
277
360
|
}
|
|
278
|
-
|
|
361
|
+
//#endregion
|
|
362
|
+
//#region src/motion/rubberBand.ts
|
|
363
|
+
/**
|
|
364
|
+
* @file rubberBand.ts
|
|
365
|
+
* @input An overflow past an edge, the scroll view's dimension and UIKit's
|
|
366
|
+
* rubber-band coefficient
|
|
367
|
+
* @output Exports `rubberBand` (finger overflow → displayed overflow), its
|
|
368
|
+
* inverse, its slope, and the clamp/unclamp pair over a [min, max] range
|
|
369
|
+
* @position Pure math; no DOM, no React
|
|
370
|
+
*
|
|
371
|
+
* UIScrollView resists a drag past its content edge with
|
|
372
|
+
* b = (1 − 1 ÷ (x·c ÷ d + 1))·d
|
|
373
|
+
* where x is how far the finger has gone past the edge, d the scroll view's
|
|
374
|
+
* size on that axis and c = 0.55 (uikit/scroll.ts records the sources). The
|
|
375
|
+
* displayed overflow b approaches d but never reaches it, and its slope at
|
|
376
|
+
* the edge is c: the first points of overflow move at 55 % of the finger.
|
|
377
|
+
*
|
|
378
|
+
* The inverse matters for spec:AST-094 FR6 (a finger catches any animation
|
|
379
|
+
* mid-flight): a finger that lands on content still bouncing back has to
|
|
380
|
+
* resume the drag from the finger position that would produce the overflow
|
|
381
|
+
* on screen, or the content jumps.
|
|
382
|
+
*/
|
|
383
|
+
/**
|
|
384
|
+
* Displayed overflow for a finger `overflow` past the edge (signed: the sign
|
|
385
|
+
* is kept). `dimension` is the scroll view's size on the axis.
|
|
386
|
+
*/
|
|
387
|
+
function rubberBand(overflow, dimension, coefficient = scroll.rubberBand.coefficient) {
|
|
388
|
+
if (!(dimension > 0)) return 0;
|
|
389
|
+
const banded = (1 - 1 / (Math.abs(overflow) * coefficient / dimension + 1)) * dimension;
|
|
390
|
+
return overflow < 0 ? -banded : banded;
|
|
391
|
+
}
|
|
392
|
+
/** On a touch device the reserve covers a pull of the whole viewport: 40% of it. */
|
|
393
|
+
const RESERVE_VIEWPORT_SHARE = .4;
|
|
394
|
+
/** Below the shortest stop, a slow mouse drag past this share of its height dismisses. */
|
|
279
395
|
const DISMISS_OVERSHOOT_RATIO = .4;
|
|
280
396
|
/** Within this many px of a stop the live drag eases toward it. */
|
|
281
397
|
const MAGNET_RANGE = 40;
|
|
282
|
-
/**
|
|
398
|
+
/** A mouse's or a pen's stretch past fully open: a resisted fraction, capped at MIN_RESERVE. */
|
|
283
399
|
const OVERSCROLL_RESISTANCE = .35;
|
|
284
|
-
|
|
285
|
-
|
|
400
|
+
/** The reserve a sheet keeps on a touch device whose layout viewport is `viewportHeight` tall. */
|
|
401
|
+
function sheetReserve(viewportHeight) {
|
|
402
|
+
return Math.max(48, Math.ceil(viewportHeight * RESERVE_VIEWPORT_SHARE));
|
|
403
|
+
}
|
|
286
404
|
/**
|
|
287
405
|
* Whether a gesture that lands on `target` began inside another layer rendered
|
|
288
406
|
* in this sheet's content: a `<dialog>` between the target and the body.
|
|
@@ -295,10 +413,6 @@ function isInsideNestedLayer(target, body) {
|
|
|
295
413
|
for (let element = target instanceof Element ? target : null; element != null && element !== body; element = element.parentElement) if (element.localName === "dialog") return true;
|
|
296
414
|
return false;
|
|
297
415
|
}
|
|
298
|
-
/** Scroll edges a body gesture may arm on, or `null` when the gesture belongs to a nested layer. */
|
|
299
|
-
function armingEdges(body, target) {
|
|
300
|
-
return isInsideNestedLayer(target, body) ? null : blockScrollEdges(body, target);
|
|
301
|
-
}
|
|
302
416
|
function magnetize(value, targets) {
|
|
303
417
|
if (targets.length === 0) return value;
|
|
304
418
|
let nearest = targets[0];
|
|
@@ -308,6 +422,19 @@ function magnetize(value, targets) {
|
|
|
308
422
|
const t = distance / MAGNET_RANGE;
|
|
309
423
|
return value + (nearest - value) * (1 - t * t);
|
|
310
424
|
}
|
|
425
|
+
/**
|
|
426
|
+
* The offset a drag shows for the raw offset `raw` under the finger. Past
|
|
427
|
+
* fully open, a finger stretches on UIKit's rubber band over the visible
|
|
428
|
+
* height and never past the reserve; a mouse or a pen moves a resisted
|
|
429
|
+
* fraction capped at MIN_RESERVE. Past the shortest stop nothing pulls, so it
|
|
430
|
+
* never fights a drag to close. Between stops, the drag eases into a stop
|
|
431
|
+
* within MAGNET_RANGE.
|
|
432
|
+
*/
|
|
433
|
+
function stretchedOffset(raw, offsets, context) {
|
|
434
|
+
if (raw < 0) return context.pointerType === "touch" ? Math.max(-context.reserve, rubberBand(raw, context.height - context.reserve, scroll.rubberBand.coefficient)) : Math.max(-48, raw * OVERSCROLL_RESISTANCE);
|
|
435
|
+
if (raw > (offsets[offsets.length - 1] ?? 0)) return raw;
|
|
436
|
+
return magnetize(raw, offsets);
|
|
437
|
+
}
|
|
311
438
|
function renderedBlockEndPadding(element) {
|
|
312
439
|
const value = Number.parseFloat(getComputedStyle(element).paddingBlockEnd);
|
|
313
440
|
return Number.isFinite(value) ? value : 0;
|
|
@@ -323,57 +450,165 @@ function hapticTick() {
|
|
|
323
450
|
if (typeof window !== "undefined" && window.matchMedia?.("(prefers-reduced-motion: reduce)").matches) return;
|
|
324
451
|
navigator.vibrate(8);
|
|
325
452
|
}
|
|
326
|
-
/**
|
|
327
|
-
function
|
|
328
|
-
const
|
|
329
|
-
|
|
330
|
-
t: startT
|
|
331
|
-
};
|
|
332
|
-
const elapsed = lastT - first.t;
|
|
333
|
-
return elapsed > 0 ? (lastY - first.y) / elapsed : 0;
|
|
453
|
+
/** Offset past which a slow mouse or pen drag dismisses instead of snapping back. */
|
|
454
|
+
function dismissTravelFor(height, offsets, reserve) {
|
|
455
|
+
const maxOffset = offsets[offsets.length - 1] ?? 0;
|
|
456
|
+
return maxOffset + visibleHeightForOffset(height, maxOffset, reserve) * DISMISS_OVERSHOOT_RATIO;
|
|
334
457
|
}
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
458
|
+
//#endregion
|
|
459
|
+
//#region src/BottomSheet/sheetScrollChain.ts
|
|
460
|
+
/**
|
|
461
|
+
* The boxes a touch on the sheet's body can scroll, and the edges they sit at.
|
|
462
|
+
*
|
|
463
|
+
* The body is where the sheet listens, but it is not always what scrolls: a
|
|
464
|
+
* host can pin a header and footer around a scrolling middle, or lay a
|
|
465
|
+
* scrolling grid inside the sheet. The browser scrolls the innermost box that
|
|
466
|
+
* has room and then chains outward, so a pull belongs to the sheet only when
|
|
467
|
+
* every box in the chain sits at the edge the pull opposes.
|
|
468
|
+
*/
|
|
469
|
+
/** A box a finger or a wheel can scroll along the block axis. */
|
|
470
|
+
function isBlockScroller(element) {
|
|
471
|
+
if (element.scrollHeight - element.clientHeight <= 1) return false;
|
|
472
|
+
const { overflowY } = getComputedStyle(element);
|
|
473
|
+
return overflowY === "auto" || overflowY === "scroll";
|
|
343
474
|
}
|
|
344
|
-
/**
|
|
345
|
-
function
|
|
346
|
-
const
|
|
347
|
-
|
|
475
|
+
/** Every scroller between `target` and `body`, innermost first, then the body itself. */
|
|
476
|
+
function scrollChainUnder(target, body) {
|
|
477
|
+
const chain = [];
|
|
478
|
+
for (let element = target instanceof Element ? target : null; element != null && element !== body; element = element.parentElement) if (element instanceof HTMLElement && isBlockScroller(element)) chain.push(element);
|
|
479
|
+
chain.push(body);
|
|
480
|
+
return chain;
|
|
481
|
+
}
|
|
482
|
+
/** Nothing in the chain can scroll up any further, so a pull down is the sheet's. */
|
|
483
|
+
function chainAtTop(chain) {
|
|
484
|
+
return chain.every((element) => element.scrollTop <= 0);
|
|
348
485
|
}
|
|
349
|
-
|
|
350
|
-
|
|
486
|
+
/** Nothing in the chain can scroll down any further, so a pull up is the sheet's. */
|
|
487
|
+
function chainAtBottom(chain) {
|
|
488
|
+
return chain.every((element) => element.scrollTop + element.clientHeight >= element.scrollHeight - 1);
|
|
489
|
+
}
|
|
490
|
+
/** Whether any box in the chain has content to scroll. */
|
|
491
|
+
function chainScrolls(chain) {
|
|
492
|
+
return chain.some((element) => element.scrollHeight - element.clientHeight > 1);
|
|
351
493
|
}
|
|
352
494
|
/**
|
|
353
|
-
*
|
|
354
|
-
*
|
|
355
|
-
*
|
|
495
|
+
* iOS rubber-bands a scroller past its end even under `overscroll-behavior:
|
|
496
|
+
* contain`. While the content sits at its end mid-pull, `none` holds it still,
|
|
497
|
+
* so only the sheet moves. Returns the undo.
|
|
356
498
|
*/
|
|
357
|
-
function
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
499
|
+
function holdAtEnd(chain) {
|
|
500
|
+
const previous = chain.map((element) => element.style.overscrollBehaviorY);
|
|
501
|
+
for (const element of chain) element.style.overscrollBehaviorY = "none";
|
|
502
|
+
return () => {
|
|
503
|
+
chain.forEach((element, index) => {
|
|
504
|
+
element.style.overscrollBehaviorY = previous[index] ?? "";
|
|
505
|
+
});
|
|
506
|
+
};
|
|
507
|
+
}
|
|
508
|
+
//#endregion
|
|
509
|
+
//#region src/BottomSheet/sheetPointerArm.ts
|
|
510
|
+
/**
|
|
511
|
+
* The handle's drag for every pointer, and the body's pull down at its top for
|
|
512
|
+
* a mouse or a pen. A finger's pull on the body belongs to the touch listeners
|
|
513
|
+
* alone, so a touch-down never arms here.
|
|
514
|
+
*/
|
|
515
|
+
function createSheetPointerArm(drive) {
|
|
516
|
+
let arm = null;
|
|
517
|
+
function reset() {
|
|
518
|
+
arm = null;
|
|
519
|
+
}
|
|
520
|
+
/** A second pointer is a pinch. The browser keeps the zoom; the sheet lets go. */
|
|
521
|
+
function yieldToPinch(pointerId) {
|
|
522
|
+
const active = drive.dragPointerId();
|
|
523
|
+
if (active == null || active === pointerId) return false;
|
|
524
|
+
drive.cancel();
|
|
525
|
+
return true;
|
|
526
|
+
}
|
|
527
|
+
function onPointerMove(event) {
|
|
528
|
+
if (drive.dragPointerId() != null) {
|
|
529
|
+
if (drive.isTouchDrag() || yieldToPinch(event.pointerId)) return;
|
|
530
|
+
if (event.cancelable) event.preventDefault();
|
|
531
|
+
drive.move(event.clientY, event.timeStamp);
|
|
532
|
+
return;
|
|
365
533
|
}
|
|
366
|
-
|
|
367
|
-
|
|
534
|
+
const armed = arm;
|
|
535
|
+
if (armed == null || armed.pointerId !== event.pointerId) return;
|
|
536
|
+
const delta = event.clientY - armed.startY;
|
|
537
|
+
armed.tracker.add(0, event.clientY, event.timeStamp);
|
|
538
|
+
if (delta > 8 && chainAtTop(armed.scrollers)) {
|
|
539
|
+
arm = null;
|
|
540
|
+
drive.begin({
|
|
541
|
+
pointerId: armed.pointerId,
|
|
542
|
+
pointerType: armed.pointerType,
|
|
543
|
+
startY: armed.startY,
|
|
544
|
+
tracker: armed.tracker
|
|
545
|
+
}, event.clientY, event.timeStamp);
|
|
546
|
+
if (event.cancelable) event.preventDefault();
|
|
547
|
+
drive.move(event.clientY, event.timeStamp);
|
|
548
|
+
} else if (delta < 0) {
|
|
549
|
+
arm = null;
|
|
550
|
+
drive.detach();
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
function onPointerUp(event) {
|
|
554
|
+
const active = drive.dragPointerId();
|
|
555
|
+
if (active != null && (active !== event.pointerId || drive.isTouchDrag())) return;
|
|
556
|
+
arm = null;
|
|
557
|
+
if (active == null) {
|
|
558
|
+
drive.detach();
|
|
559
|
+
return;
|
|
560
|
+
}
|
|
561
|
+
drive.end(event.clientY, event.timeStamp);
|
|
562
|
+
}
|
|
563
|
+
function onPointerCancel(event) {
|
|
564
|
+
const active = drive.dragPointerId();
|
|
565
|
+
if (active != null && (active !== event.pointerId || drive.isTouchDrag())) return;
|
|
566
|
+
drive.cancel();
|
|
567
|
+
}
|
|
568
|
+
function onHandlePointerDown(event) {
|
|
569
|
+
if (event.button != null && event.button !== 0) return;
|
|
570
|
+
if (yieldToPinch(event.pointerId)) return;
|
|
571
|
+
drive.attach();
|
|
572
|
+
const tracker = new VelocityTracker();
|
|
573
|
+
drive.begin({
|
|
574
|
+
pointerId: event.pointerId,
|
|
575
|
+
pointerType: event.pointerType,
|
|
576
|
+
startY: event.clientY,
|
|
577
|
+
tracker
|
|
578
|
+
}, event.clientY, event.timeStamp);
|
|
579
|
+
if (event.cancelable) event.preventDefault();
|
|
580
|
+
}
|
|
581
|
+
function onBodyPointerDown(event) {
|
|
582
|
+
if (yieldToPinch(event.pointerId)) return;
|
|
583
|
+
arm = null;
|
|
584
|
+
if (event.pointerType === "touch" || event.button != null && event.button !== 0) return;
|
|
585
|
+
const body = drive.body();
|
|
586
|
+
if (!body || isInsideNestedLayer(event.target, body)) return;
|
|
587
|
+
const scrollers = scrollChainUnder(event.target, body);
|
|
588
|
+
if (!chainAtTop(scrollers)) return;
|
|
589
|
+
const tracker = new VelocityTracker();
|
|
590
|
+
tracker.add(0, event.clientY, event.timeStamp);
|
|
591
|
+
arm = {
|
|
592
|
+
pointerId: event.pointerId,
|
|
593
|
+
pointerType: event.pointerType,
|
|
594
|
+
startY: event.clientY,
|
|
595
|
+
scrollers,
|
|
596
|
+
tracker
|
|
597
|
+
};
|
|
598
|
+
drive.attach();
|
|
368
599
|
}
|
|
369
600
|
return {
|
|
370
|
-
|
|
371
|
-
|
|
601
|
+
onPointerMove,
|
|
602
|
+
onPointerUp,
|
|
603
|
+
onPointerCancel,
|
|
604
|
+
onHandlePointerDown,
|
|
605
|
+
onBodyPointerDown,
|
|
606
|
+
reset
|
|
372
607
|
};
|
|
373
608
|
}
|
|
374
609
|
//#endregion
|
|
375
610
|
//#region src/BottomSheet/sheetPointerSession.ts
|
|
376
|
-
/** Window pointer listeners
|
|
611
|
+
/** Window pointer listeners, the body's non-passive touch listeners, and the interruptions that cancel a drag. */
|
|
377
612
|
function createSheetPointerSession(handlers) {
|
|
378
613
|
let body = null;
|
|
379
614
|
let listening = false;
|
|
@@ -406,12 +641,20 @@ function createSheetPointerSession(handlers) {
|
|
|
406
641
|
element.addEventListener("touchend", handlers.onTouchEnd);
|
|
407
642
|
element.addEventListener("touchcancel", handlers.onTouchEnd);
|
|
408
643
|
}
|
|
644
|
+
function onVisibilityChange() {
|
|
645
|
+
if (document.visibilityState === "hidden") handlers.onInterrupt();
|
|
646
|
+
}
|
|
409
647
|
function destroy() {
|
|
410
648
|
detach();
|
|
411
649
|
setBody(null);
|
|
412
|
-
if (typeof window
|
|
650
|
+
if (typeof window === "undefined") return;
|
|
651
|
+
window.removeEventListener("blur", handlers.onInterrupt);
|
|
652
|
+
document.removeEventListener("visibilitychange", onVisibilityChange);
|
|
653
|
+
}
|
|
654
|
+
if (typeof window !== "undefined") {
|
|
655
|
+
window.addEventListener("blur", handlers.onInterrupt);
|
|
656
|
+
document.addEventListener("visibilitychange", onVisibilityChange);
|
|
413
657
|
}
|
|
414
|
-
if (typeof window !== "undefined") window.addEventListener("blur", handlers.onWindowBlur);
|
|
415
658
|
return {
|
|
416
659
|
attach,
|
|
417
660
|
detach,
|
|
@@ -420,10 +663,298 @@ function createSheetPointerSession(handlers) {
|
|
|
420
663
|
};
|
|
421
664
|
}
|
|
422
665
|
//#endregion
|
|
666
|
+
//#region src/motion/uikit/sheet.ts
|
|
667
|
+
/**
|
|
668
|
+
* @file sheet.ts
|
|
669
|
+
* @input Nothing; data only
|
|
670
|
+
* @output Exports `sheet`, the sheet's release constants. They say when
|
|
671
|
+
* UISheetPresentationController counts a release as a flick and how near a
|
|
672
|
+
* detent a flick counts as on it. They also give how far ahead a release is
|
|
673
|
+
* projected, and the speed below which it is not
|
|
674
|
+
* @position The sheet domain of the UIKit constants table (motion/uikit).
|
|
675
|
+
* Its springs are `springs.sheetPresent`, `.sheetDismiss`, `.sheetDetent`,
|
|
676
|
+
* `.sheetReleaseFast` and `.sheetDismissSwipe`
|
|
677
|
+
*
|
|
678
|
+
* Read from UIKit with a `[.medium(), .large()]` sheet in an injected host
|
|
679
|
+
* app. Speeds are in pt/s (CSS px/s).
|
|
680
|
+
*/
|
|
681
|
+
const sheet = { release: {
|
|
682
|
+
/**
|
|
683
|
+
* Release speed (pt/s, in either direction) from which UIKit's sheet
|
|
684
|
+
* counts a release as a flick. A sheet's flick goes at least to the next
|
|
685
|
+
* position beyond where it is in its direction (`detentTolerance`). It
|
|
686
|
+
* goes on past it when its projection passes it. The same speed
|
|
687
|
+
* switches UIKit's settle from `springs.sheetDetent` (critically damped)
|
|
688
|
+
* to `springs.sheetReleaseFast` (80 % damping). An interactive dismissal
|
|
689
|
+
* at it takes `springs.sheetDismissSwipe`. Inside the measured bracket.
|
|
690
|
+
* @source measured: UIKit lab (injected host app), iOS 26.2 simulator,
|
|
691
|
+
* iPhone 17 Pro, Oct 23 and Oct 24 2026. Of 134 drag releases, 55 had
|
|
692
|
+
* their CASpringAnimation read. Every one up to 996.7 pt/s had damping
|
|
693
|
+
* 36.515 (ζ 1), and every one from 1028.3 pt/s on had 29.212 (ζ 0.8).
|
|
694
|
+
* So the switch lies in (996.7, 1028.3]. With a 0.1 s projection, all
|
|
695
|
+
* 134 outcomes fit a flick threshold from 997 to 1028 pt/s.
|
|
696
|
+
*/
|
|
697
|
+
fastSpeed: 1008,
|
|
698
|
+
/**
|
|
699
|
+
* How far ahead a release is projected, as seconds of its velocity.
|
|
700
|
+
* UIKit's sheet projects a release to `offset + velocity × this`, and the
|
|
701
|
+
* dismissed position (fully off screen) counts as one of its positions.
|
|
702
|
+
* A slow release settles on the position nearest this landing. A flick
|
|
703
|
+
* goes to the first position at or past it. Inside the measured bracket.
|
|
704
|
+
* @source measured: UIKit lab (injected host app), iOS 26.2 simulator,
|
|
705
|
+
* iPhone 17 Pro, Oct 23 to Oct 25 2026. There were 164 drag releases
|
|
706
|
+
* of a [.medium(), .large()] sheet, from 0 to 4000 pt/s. Each gave the
|
|
707
|
+
* offset and velocity of its last drag update and the detent it
|
|
708
|
+
* settled on. With `fastSpeed`'s flick branch and no projection below
|
|
709
|
+
* 250 pt/s, every release fits any value from 0.092 to 0.104 s.
|
|
710
|
+
*/
|
|
711
|
+
projectionSeconds: .1,
|
|
712
|
+
/**
|
|
713
|
+
* Release speed (pt/s) below which a release is not projected: the sheet
|
|
714
|
+
* settles on the position nearest where it was let go. Core cancels a
|
|
715
|
+
* release that moves back toward its start before this applies. Inside
|
|
716
|
+
* the measured bracket.
|
|
717
|
+
* @source measured: UIKit lab (injected host app), iOS 26.2 simulator,
|
|
718
|
+
* iPhone 17 Pro, Oct 25 2026. There were 30 releases of drags from the
|
|
719
|
+
* medium detent. Each went past the midpoint toward large, or most of
|
|
720
|
+
* the way to gone, then turned back. Each one let go at up to 244 pt/s
|
|
721
|
+
* settled on the position nearest where it was let go. From 250.6 pt/s
|
|
722
|
+
* on, the projection decided. So the switch lies in (244, 250.6].
|
|
723
|
+
*/
|
|
724
|
+
minProjectionSpeed: 250,
|
|
725
|
+
/**
|
|
726
|
+
* How close to a position (pt) a flick's offset counts as on it, so the
|
|
727
|
+
* next position beyond is the one after it. Inside the measured bracket.
|
|
728
|
+
* @source measured: UIKit lab (injected host app), iOS 26.2 simulator,
|
|
729
|
+
* iPhone 17 Pro, Oct 24 2026. Two flicks released exactly on the medium
|
|
730
|
+
* detent went on to the next position in their direction. One released
|
|
731
|
+
* 6.7 pt above it, moving down, stopped at medium. So any value from 0
|
|
732
|
+
* to 6.6 pt fits.
|
|
733
|
+
*/
|
|
734
|
+
detentTolerance: 1
|
|
735
|
+
} };
|
|
736
|
+
//#endregion
|
|
737
|
+
//#region src/BottomSheet/sheetRelease.ts
|
|
738
|
+
const PROJECTION_FACTOR = .998 / .0020000000000000018;
|
|
739
|
+
/** A mouse or pen release shorter than this is judged where it was let go. */
|
|
740
|
+
const PROJECTION_MIN_TRAVEL = 48;
|
|
741
|
+
/**
|
|
742
|
+
* A touch release takes UIKit's sheet values, with closed counted as one more
|
|
743
|
+
* position. It is projected 0.1 s ahead, a release under 250 px/s is not
|
|
744
|
+
* projected, and from 1008 px/s it is a flick that lands on the first position
|
|
745
|
+
* at or past its projection. A release moving back toward where the drag
|
|
746
|
+
* began cancels to that stop.
|
|
747
|
+
*/
|
|
748
|
+
function resolveTouchRelease(input) {
|
|
749
|
+
const { offsets, height, offset, velocity } = input;
|
|
750
|
+
const maxOffset = offsets[offsets.length - 1] ?? 0;
|
|
751
|
+
const shortestHeight = visibleHeightForOffset(height, maxOffset, input.reserve);
|
|
752
|
+
const { fastSpeed, minProjectionSpeed, projectionSeconds, detentTolerance } = sheet.release;
|
|
753
|
+
const points = [...offsets, maxOffset + shortestHeight];
|
|
754
|
+
const { index } = resolveSnapPoint({
|
|
755
|
+
points,
|
|
756
|
+
position: offset,
|
|
757
|
+
velocity: velocity * 1e3,
|
|
758
|
+
flickThreshold: input.travel > 8 ? fastSpeed : Number.POSITIVE_INFINITY,
|
|
759
|
+
tolerance: detentTolerance,
|
|
760
|
+
flickPastProjection: true,
|
|
761
|
+
projection: {
|
|
762
|
+
seconds: projectionSeconds,
|
|
763
|
+
minSpeed: minProjectionSpeed
|
|
764
|
+
},
|
|
765
|
+
start: input.baseOffset
|
|
766
|
+
});
|
|
767
|
+
if (index === points.length - 1) return {
|
|
768
|
+
kind: "close",
|
|
769
|
+
exit: {
|
|
770
|
+
distance: Math.max(0, height - offset),
|
|
771
|
+
velocity: velocity * 1e3
|
|
772
|
+
}
|
|
773
|
+
};
|
|
774
|
+
return {
|
|
775
|
+
kind: "settle",
|
|
776
|
+
target: points[index] ?? maxOffset
|
|
777
|
+
};
|
|
778
|
+
}
|
|
779
|
+
/**
|
|
780
|
+
* A mouse or pen release coasts on the scroll view's deceleration. One that
|
|
781
|
+
* would coast past the dismiss line closes the sheet; any other settles on
|
|
782
|
+
* the stop nearest where it would come to rest, in the drag's direction.
|
|
783
|
+
*/
|
|
784
|
+
function resolvePointerRelease(input) {
|
|
785
|
+
const { offsets, offset } = input;
|
|
786
|
+
const maxOffset = offsets[offsets.length - 1] ?? 0;
|
|
787
|
+
const projected = input.travel > PROJECTION_MIN_TRAVEL ? offset + input.velocity * PROJECTION_FACTOR : offset;
|
|
788
|
+
if (input.dir > 0 && projected > dismissTravelFor(input.height, offsets, input.reserve)) return {
|
|
789
|
+
kind: "close",
|
|
790
|
+
exit: null
|
|
791
|
+
};
|
|
792
|
+
return {
|
|
793
|
+
kind: "settle",
|
|
794
|
+
target: resolveSettleOffset(Math.min(Math.max(projected, 0), maxOffset), offsets, input.dir, input.baseOffset)
|
|
795
|
+
};
|
|
796
|
+
}
|
|
797
|
+
/** Where a drag's release takes the sheet: a stop to settle on, or the close. */
|
|
798
|
+
function resolveSheetRelease(input) {
|
|
799
|
+
return input.isTouch ? resolveTouchRelease(input) : resolvePointerRelease(input);
|
|
800
|
+
}
|
|
801
|
+
//#endregion
|
|
802
|
+
//#region src/BottomSheet/sheetTouchArm.ts
|
|
803
|
+
/**
|
|
804
|
+
* Travel past the point where a scroll ran out of content before the sheet
|
|
805
|
+
* takes the rest of the pull: continuous with the scroll, yet a swipe that
|
|
806
|
+
* merely comes to rest on the last pixel starts no drag on jitter.
|
|
807
|
+
*/
|
|
808
|
+
const CONTENT_END_HANDOFF_SLOP = 4;
|
|
809
|
+
/** An Apple Pencil raises touch events marked `stylus`; its drag is a pen's. */
|
|
810
|
+
function touchPointerType(touch) {
|
|
811
|
+
return touch.touchType === "stylus" ? "pen" : "touch";
|
|
812
|
+
}
|
|
813
|
+
function findTouch(event, id) {
|
|
814
|
+
return id == null ? void 0 : Array.from(event.changedTouches).find((touch) => touch.identifier === id);
|
|
815
|
+
}
|
|
816
|
+
/**
|
|
817
|
+
* The body's touch path. Non-passive `touchmove` is the reliable scroll-to-drag
|
|
818
|
+
* hand-off on touch: cancelling a move at a scroll edge stops the native
|
|
819
|
+
* scroll and drives the sheet instead. Every touch on the body is tracked,
|
|
820
|
+
* not only one that begins at an edge, because a swipe that starts mid-content
|
|
821
|
+
* and scrolls to the end has to hand off too.
|
|
822
|
+
*/
|
|
823
|
+
function createSheetTouchArm(drive) {
|
|
824
|
+
let arm = null;
|
|
825
|
+
function releaseContentHold() {
|
|
826
|
+
if (arm?.releaseContentHold != null) {
|
|
827
|
+
arm.releaseContentHold();
|
|
828
|
+
arm.releaseContentHold = null;
|
|
829
|
+
}
|
|
830
|
+
}
|
|
831
|
+
function reset() {
|
|
832
|
+
releaseContentHold();
|
|
833
|
+
arm = null;
|
|
834
|
+
}
|
|
835
|
+
function promote(armed, touch, startY, timeStamp) {
|
|
836
|
+
drive.begin({
|
|
837
|
+
pointerId: armed.id,
|
|
838
|
+
pointerType: touchPointerType(touch),
|
|
839
|
+
startY,
|
|
840
|
+
tracker: armed.tracker
|
|
841
|
+
}, touch.clientY, timeStamp);
|
|
842
|
+
drive.move(touch.clientY, timeStamp);
|
|
843
|
+
}
|
|
844
|
+
function onTouchStart(event) {
|
|
845
|
+
const body = event.currentTarget;
|
|
846
|
+
if (event.touches.length > 1) {
|
|
847
|
+
reset();
|
|
848
|
+
drive.yieldToPinch();
|
|
849
|
+
return;
|
|
850
|
+
}
|
|
851
|
+
reset();
|
|
852
|
+
const touch = event.changedTouches[0];
|
|
853
|
+
if (!touch || isInsideNestedLayer(event.target, body)) return;
|
|
854
|
+
const scrollers = scrollChainUnder(event.target, body);
|
|
855
|
+
const bottom = chainAtBottom(scrollers) && (drive.activeOffset() > 0 || !chainScrolls(scrollers));
|
|
856
|
+
const tracker = new VelocityTracker();
|
|
857
|
+
tracker.add(0, touch.clientY, event.timeStamp);
|
|
858
|
+
arm = {
|
|
859
|
+
id: touch.identifier,
|
|
860
|
+
startX: touch.clientX,
|
|
861
|
+
startY: touch.clientY,
|
|
862
|
+
scrollers,
|
|
863
|
+
top: chainAtTop(scrollers),
|
|
864
|
+
bottom,
|
|
865
|
+
contentEndY: null,
|
|
866
|
+
promotedAtContentEnd: false,
|
|
867
|
+
releaseContentHold: null,
|
|
868
|
+
tracker
|
|
869
|
+
};
|
|
870
|
+
}
|
|
871
|
+
function moveDrag(event) {
|
|
872
|
+
const touch = findTouch(event, drive.dragPointerId());
|
|
873
|
+
if (!touch) return;
|
|
874
|
+
const armed = arm;
|
|
875
|
+
if (armed?.promotedAtContentEnd && armed.contentEndY != null) {
|
|
876
|
+
if (touch.clientY >= armed.contentEndY) {
|
|
877
|
+
armed.contentEndY = null;
|
|
878
|
+
armed.promotedAtContentEnd = false;
|
|
879
|
+
releaseContentHold();
|
|
880
|
+
drive.cancel();
|
|
881
|
+
return;
|
|
882
|
+
}
|
|
883
|
+
drive.move(touch.clientY, event.timeStamp);
|
|
884
|
+
return;
|
|
885
|
+
}
|
|
886
|
+
if (event.cancelable) event.preventDefault();
|
|
887
|
+
drive.move(touch.clientY, event.timeStamp);
|
|
888
|
+
}
|
|
889
|
+
function onTouchMove(event) {
|
|
890
|
+
if (event.touches.length > 1) {
|
|
891
|
+
reset();
|
|
892
|
+
drive.yieldToPinch();
|
|
893
|
+
return;
|
|
894
|
+
}
|
|
895
|
+
if (drive.dragPointerId() != null) {
|
|
896
|
+
moveDrag(event);
|
|
897
|
+
return;
|
|
898
|
+
}
|
|
899
|
+
const armed = arm;
|
|
900
|
+
const touch = findTouch(event, armed?.id);
|
|
901
|
+
if (armed == null || !touch) return;
|
|
902
|
+
const delta = touch.clientY - armed.startY;
|
|
903
|
+
armed.tracker.add(0, touch.clientY, event.timeStamp);
|
|
904
|
+
const opposesTop = armed.top && delta > 0 && chainAtTop(armed.scrollers);
|
|
905
|
+
const opposesBottom = armed.bottom && delta < 0 && chainAtBottom(armed.scrollers);
|
|
906
|
+
const sideways = Math.abs(touch.clientX - armed.startX);
|
|
907
|
+
const isMostlyVertical = Math.abs(delta) > sideways;
|
|
908
|
+
if ((opposesTop || opposesBottom) && Math.abs(delta) >= 5 && isMostlyVertical && event.cancelable) event.preventDefault();
|
|
909
|
+
if (isMostlyVertical && (opposesTop && delta > 8 || opposesBottom && delta < -8)) {
|
|
910
|
+
if (event.cancelable) event.preventDefault();
|
|
911
|
+
reset();
|
|
912
|
+
promote(armed, touch, armed.startY, event.timeStamp);
|
|
913
|
+
return;
|
|
914
|
+
}
|
|
915
|
+
if (Math.max(Math.abs(delta), sideways) > 8 && (armed.top || armed.bottom)) {
|
|
916
|
+
if (!isMostlyVertical) {
|
|
917
|
+
reset();
|
|
918
|
+
return;
|
|
919
|
+
}
|
|
920
|
+
armed.top = false;
|
|
921
|
+
armed.bottom = false;
|
|
922
|
+
}
|
|
923
|
+
if (armed.top && delta <= -5 && !chainAtBottom(armed.scrollers)) armed.top = false;
|
|
924
|
+
if (armed.bottom && delta >= 5 && !chainAtTop(armed.scrollers)) armed.bottom = false;
|
|
925
|
+
if (chainAtBottom(armed.scrollers)) {
|
|
926
|
+
if (armed.contentEndY == null) {
|
|
927
|
+
armed.contentEndY = touch.clientY;
|
|
928
|
+
armed.releaseContentHold ??= holdAtEnd(armed.scrollers);
|
|
929
|
+
} else if (armed.contentEndY - touch.clientY >= CONTENT_END_HANDOFF_SLOP) {
|
|
930
|
+
armed.promotedAtContentEnd = true;
|
|
931
|
+
promote(armed, touch, armed.contentEndY, event.timeStamp);
|
|
932
|
+
}
|
|
933
|
+
} else {
|
|
934
|
+
armed.contentEndY = null;
|
|
935
|
+
releaseContentHold();
|
|
936
|
+
}
|
|
937
|
+
}
|
|
938
|
+
function onTouchEnd(event) {
|
|
939
|
+
reset();
|
|
940
|
+
const pointerId = drive.dragPointerId();
|
|
941
|
+
if (pointerId == null) return;
|
|
942
|
+
const touch = findTouch(event, pointerId);
|
|
943
|
+
if (touch) drive.end(touch.clientY, event.timeStamp);
|
|
944
|
+
else if (event.touches.length === 0) drive.cancel();
|
|
945
|
+
}
|
|
946
|
+
return {
|
|
947
|
+
onTouchStart,
|
|
948
|
+
onTouchMove,
|
|
949
|
+
onTouchEnd,
|
|
950
|
+
reset
|
|
951
|
+
};
|
|
952
|
+
}
|
|
953
|
+
//#endregion
|
|
423
954
|
//#region src/BottomSheet/useSheetGestures.ts
|
|
424
955
|
/** Drag, snap, and settle behavior of the sheet panel. */
|
|
425
956
|
function useSheetGestures(options) {
|
|
426
|
-
const { panel, body, isOpen, canDismiss, getSnapHeights, onScrimOpacity, onSnap, onDismiss } = options;
|
|
957
|
+
const { panel, body, isOpen, canDismiss, reserve, getSnapHeights, onScrimOpacity, onSnap, onDismiss } = options;
|
|
427
958
|
const isDragging = ref(false);
|
|
428
959
|
const isReconciling = ref(false);
|
|
429
960
|
const isOverflowing = ref(false);
|
|
@@ -433,13 +964,22 @@ function useSheetGestures(options) {
|
|
|
433
964
|
const scrollPreservationInset = ref(0);
|
|
434
965
|
const scrimOpacity = ref(1);
|
|
435
966
|
const sheetHeight = ref(0);
|
|
967
|
+
const heldClose = ref(null);
|
|
968
|
+
const dragExit = ref(null);
|
|
969
|
+
const isDismissedByTouchDrag = ref(false);
|
|
436
970
|
let dragState = null;
|
|
437
|
-
|
|
438
|
-
let
|
|
971
|
+
/** The scrim of the stop a drag's close left, until the host answers the close. */
|
|
972
|
+
let pendingDismissal = null;
|
|
439
973
|
let reconcileToken = 0;
|
|
440
974
|
let observer = null;
|
|
441
975
|
let session;
|
|
442
976
|
const activeOffset = computed(() => isDragging.value ? dragOffset.value : settledOffset.value);
|
|
977
|
+
/** Dragging above the base stop restores the full layout height below the viewport. */
|
|
978
|
+
const layoutOffset = computed(() => {
|
|
979
|
+
if (heldClose.value != null) return heldClose.value.layoutOffset;
|
|
980
|
+
if (isDragging.value) return dragOffset.value < settledOffset.value ? 0 : settledLayoutOffset.value;
|
|
981
|
+
return settledLayoutOffset.value;
|
|
982
|
+
});
|
|
443
983
|
function measureNaturalHeight() {
|
|
444
984
|
const element = panel.value;
|
|
445
985
|
if (!element) return 0;
|
|
@@ -454,14 +994,23 @@ function useSheetGestures(options) {
|
|
|
454
994
|
const measured = measureNaturalHeight();
|
|
455
995
|
if (measured > 0) sheetHeight.value = measured;
|
|
456
996
|
const height = measured > 0 ? measured : sheetHeight.value;
|
|
457
|
-
const
|
|
997
|
+
const inset = reserve.value;
|
|
998
|
+
const visible = visibleHeightForOffset(height, 0, inset);
|
|
458
999
|
const offsets = computeDetentOffsets(visible, getSnapHeights());
|
|
459
1000
|
return {
|
|
460
1001
|
height,
|
|
461
1002
|
offsets,
|
|
462
|
-
peekOffset: peekOffsetFor(offsets, visible)
|
|
1003
|
+
peekOffset: peekOffsetFor(offsets, visible),
|
|
1004
|
+
reserve: inset
|
|
463
1005
|
};
|
|
464
1006
|
}
|
|
1007
|
+
function scrimFor(offset, detents) {
|
|
1008
|
+
return scrimOpacityForOffset(offset, detents.offsets, dismissTravelFor(detents.height, detents.offsets, detents.reserve), detents.peekOffset);
|
|
1009
|
+
}
|
|
1010
|
+
function reportScrim(opacity) {
|
|
1011
|
+
scrimOpacity.value = opacity;
|
|
1012
|
+
onScrimOpacity(opacity);
|
|
1013
|
+
}
|
|
465
1014
|
async function reconcileLayout(targetLayoutOffset) {
|
|
466
1015
|
const token = ++reconcileToken;
|
|
467
1016
|
isReconciling.value = true;
|
|
@@ -475,248 +1024,163 @@ function useSheetGestures(options) {
|
|
|
475
1024
|
}
|
|
476
1025
|
function settleAt(target, fromOffset, detents) {
|
|
477
1026
|
const targetLayoutOffset = target === detents.peekOffset ? 0 : target;
|
|
478
|
-
const dismissOffset = dismissTravelFor(detents.height, detents.offsets);
|
|
479
1027
|
settledOffset.value = target;
|
|
480
1028
|
scrollPreservationInset.value = Math.max(0, fromOffset - targetLayoutOffset - naturalEndGapFor(body.value));
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
onSnap(visibleHeightForOffset(detents.height, target, 48));
|
|
1029
|
+
reportScrim(scrimFor(target, detents));
|
|
1030
|
+
onSnap(visibleHeightForOffset(detents.height, target, detents.reserve));
|
|
484
1031
|
if (target !== fromOffset) hapticTick();
|
|
485
1032
|
if (targetLayoutOffset === settledLayoutOffset.value && !isReconciling.value) return;
|
|
486
1033
|
reconcileLayout(targetLayoutOffset);
|
|
487
1034
|
}
|
|
488
|
-
function
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
1035
|
+
function clearDragClose() {
|
|
1036
|
+
pendingDismissal = null;
|
|
1037
|
+
heldClose.value = null;
|
|
1038
|
+
dragExit.value = null;
|
|
1039
|
+
isDismissedByTouchDrag.value = false;
|
|
1040
|
+
}
|
|
1041
|
+
/**
|
|
1042
|
+
* Asks the host to close. The sheet holds where the finger left it, so the
|
|
1043
|
+
* exit starts from there. The host answers in its next render: a host that
|
|
1044
|
+
* keeps the sheet open sends it back to its stop, the scrim with it.
|
|
1045
|
+
*/
|
|
1046
|
+
function closeSheet(exit, state) {
|
|
1047
|
+
if (!canDismiss.value) {
|
|
1048
|
+
settleAt(state.offsets[state.offsets.length - 1] ?? 0, state.baseOffset, state);
|
|
495
1049
|
return;
|
|
496
1050
|
}
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
state.
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
1051
|
+
heldClose.value = {
|
|
1052
|
+
offset: dragOffset.value,
|
|
1053
|
+
layoutOffset: layoutOffset.value
|
|
1054
|
+
};
|
|
1055
|
+
isDismissedByTouchDrag.value = state.pointerType === "touch";
|
|
1056
|
+
dragExit.value = exit;
|
|
1057
|
+
const request = { restingScrim: scrimFor(state.baseOffset, state) };
|
|
1058
|
+
pendingDismissal = request;
|
|
1059
|
+
onDismiss();
|
|
1060
|
+
nextTick(() => {
|
|
1061
|
+
if (pendingDismissal !== request) return;
|
|
1062
|
+
pendingDismissal = null;
|
|
1063
|
+
if (!isOpen.value) return;
|
|
1064
|
+
clearDragClose();
|
|
1065
|
+
reportScrim(request.restingScrim);
|
|
508
1066
|
});
|
|
509
|
-
state.travel = Math.max(state.travel, Math.abs(delta));
|
|
510
|
-
state.dir = delta === 0 ? 0 : Math.sign(delta);
|
|
511
|
-
const next = dragOffsetFrom(state.baseOffset, delta, state.offsets);
|
|
512
|
-
state.rawOffset = next.raw;
|
|
513
|
-
dragOffset.value = next.shown;
|
|
514
|
-
scrimOpacity.value = scrimOpacityForOffset(next.raw, state.offsets, dismissTravelFor(state.height, state.offsets), state.peekOffset);
|
|
515
|
-
onScrimOpacity(scrimOpacity.value);
|
|
516
1067
|
}
|
|
517
|
-
function beginDrag(
|
|
1068
|
+
function beginDrag(start, clientY, timeStamp) {
|
|
1069
|
+
clearDragClose();
|
|
1070
|
+
start.tracker.add(0, clientY, timeStamp);
|
|
518
1071
|
dragState = {
|
|
519
1072
|
...resolveDetents(),
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
startT: timeStamp,
|
|
523
|
-
lastY: clientY,
|
|
524
|
-
lastT: timeStamp,
|
|
525
|
-
samples: [{
|
|
526
|
-
y: clientY,
|
|
527
|
-
t: timeStamp
|
|
528
|
-
}],
|
|
529
|
-
baseOffset: settledOffset.value,
|
|
530
|
-
baseLayoutOffset: settledLayoutOffset.value,
|
|
531
|
-
rawOffset: settledOffset.value,
|
|
532
|
-
dir: 0,
|
|
533
|
-
travel: 0
|
|
1073
|
+
...start,
|
|
1074
|
+
baseOffset: settledOffset.value
|
|
534
1075
|
};
|
|
535
1076
|
dragOffset.value = settledOffset.value;
|
|
536
1077
|
isDragging.value = true;
|
|
537
1078
|
}
|
|
538
|
-
function
|
|
1079
|
+
function moveDrag(clientY, timeStamp) {
|
|
1080
|
+
const state = dragState;
|
|
1081
|
+
if (!state) return;
|
|
1082
|
+
state.tracker.add(0, clientY, timeStamp);
|
|
1083
|
+
const shown = stretchedOffset(state.baseOffset + clientY - state.startY, state.offsets, state);
|
|
1084
|
+
dragOffset.value = shown;
|
|
1085
|
+
reportScrim(scrimFor(shown, state));
|
|
1086
|
+
}
|
|
1087
|
+
function endDrag(clientY, timeStamp) {
|
|
539
1088
|
const state = dragState;
|
|
540
1089
|
dragState = null;
|
|
541
1090
|
session.detach();
|
|
542
1091
|
if (!state) return;
|
|
1092
|
+
const delta = clientY - state.startY;
|
|
1093
|
+
if (state.tracker.lastSample?.y !== clientY) state.tracker.add(0, clientY, timeStamp);
|
|
1094
|
+
const release = resolveSheetRelease({
|
|
1095
|
+
offset: Math.max(0, state.baseOffset + delta),
|
|
1096
|
+
velocity: state.tracker.velocity(timeStamp).y / 1e3,
|
|
1097
|
+
height: state.height || 1,
|
|
1098
|
+
dir: Math.sign(delta),
|
|
1099
|
+
travel: Math.abs(delta),
|
|
1100
|
+
baseOffset: state.baseOffset,
|
|
1101
|
+
offsets: state.offsets,
|
|
1102
|
+
reserve: state.reserve,
|
|
1103
|
+
isTouch: state.pointerType === "touch"
|
|
1104
|
+
});
|
|
1105
|
+
if (release.kind === "close") closeSheet(release.exit, state);
|
|
543
1106
|
isDragging.value = false;
|
|
544
|
-
|
|
545
|
-
const isFlick = Math.abs(velocity) > 1.2 && state.travel > 48;
|
|
546
|
-
if (state.dir > 0 && isFlick) {
|
|
547
|
-
dismissOrSettleShortest(state.baseOffset, state);
|
|
548
|
-
return;
|
|
549
|
-
}
|
|
550
|
-
if (state.dir < 0 && isFlick) {
|
|
551
|
-
settleAt(0, state.baseOffset, state);
|
|
552
|
-
return;
|
|
553
|
-
}
|
|
554
|
-
if (state.rawOffset > dismissTravelFor(state.height, state.offsets)) {
|
|
555
|
-
dismissOrSettleShortest(state.baseOffset, state);
|
|
556
|
-
return;
|
|
557
|
-
}
|
|
558
|
-
settleAt(resolveSettleOffset(state.rawOffset, state.offsets, state.dir, state.baseOffset), state.baseOffset, state);
|
|
1107
|
+
if (release.kind === "settle") settleAt(release.target, state.baseOffset, state);
|
|
559
1108
|
}
|
|
560
|
-
|
|
1109
|
+
/** The drag in flight returns to its stop; the arms keep tracking their contacts. */
|
|
1110
|
+
function dropDrag() {
|
|
561
1111
|
const state = dragState;
|
|
562
|
-
pendingBody = null;
|
|
563
|
-
touchArming = null;
|
|
564
1112
|
dragState = null;
|
|
565
1113
|
session.detach();
|
|
566
1114
|
if (!state) return;
|
|
567
1115
|
isDragging.value = false;
|
|
568
1116
|
dragOffset.value = state.baseOffset;
|
|
569
1117
|
settledOffset.value = state.baseOffset;
|
|
570
|
-
|
|
571
|
-
onScrimOpacity(scrimOpacity.value);
|
|
572
|
-
}
|
|
573
|
-
/** A second finger is a pinch. The browser keeps the zoom; the sheet lets go. */
|
|
574
|
-
function yieldToPinch(pointerId) {
|
|
575
|
-
if (dragState == null || dragState.pointerId === pointerId) return false;
|
|
576
|
-
cancelDrag();
|
|
577
|
-
return true;
|
|
578
|
-
}
|
|
579
|
-
function onPointerMove(event) {
|
|
580
|
-
if (dragState != null) {
|
|
581
|
-
if (yieldToPinch(event.pointerId)) return;
|
|
582
|
-
if (event.cancelable) event.preventDefault();
|
|
583
|
-
updateDrag(event.clientY, event.timeStamp);
|
|
584
|
-
return;
|
|
585
|
-
}
|
|
586
|
-
const pending = pendingBody;
|
|
587
|
-
if (pending == null || pending.pointerId !== event.pointerId) return;
|
|
588
|
-
const delta = event.clientY - pending.startY;
|
|
589
|
-
if (Math.abs(delta) < 8) return;
|
|
590
|
-
const pullingDown = delta > 0 && pending.atTop;
|
|
591
|
-
const pullingUp = delta < 0 && pending.atBottom && activeOffset.value > 0;
|
|
592
|
-
if (!pullingDown && !pullingUp) {
|
|
593
|
-
pendingBody = null;
|
|
594
|
-
session.detach();
|
|
595
|
-
return;
|
|
596
|
-
}
|
|
597
|
-
pendingBody = null;
|
|
598
|
-
beginDrag(pending.pointerId, pending.startY, event.timeStamp);
|
|
599
|
-
if (event.cancelable) event.preventDefault();
|
|
600
|
-
updateDrag(event.clientY, event.timeStamp);
|
|
601
|
-
}
|
|
602
|
-
function onPointerUp(event) {
|
|
603
|
-
if (dragState != null && dragState.pointerId !== event.pointerId) return;
|
|
604
|
-
pendingBody = null;
|
|
605
|
-
if (dragState == null) {
|
|
606
|
-
session.detach();
|
|
607
|
-
return;
|
|
608
|
-
}
|
|
609
|
-
endDrag();
|
|
610
|
-
}
|
|
611
|
-
function onPointerCancel(event) {
|
|
612
|
-
if (dragState != null && dragState.pointerId !== event.pointerId) return;
|
|
613
|
-
cancelDrag();
|
|
614
|
-
}
|
|
615
|
-
function onHandlePointerDown(event) {
|
|
616
|
-
if (event.button != null && event.button !== 0) return;
|
|
617
|
-
if (yieldToPinch(event.pointerId)) return;
|
|
618
|
-
session.attach();
|
|
619
|
-
beginDrag(event.pointerId, event.clientY, event.timeStamp);
|
|
620
|
-
if (event.cancelable) event.preventDefault();
|
|
621
|
-
}
|
|
622
|
-
function onBodyPointerDown(event) {
|
|
623
|
-
if (yieldToPinch(event.pointerId)) return;
|
|
624
|
-
if (event.pointerType === "touch") return;
|
|
625
|
-
if (event.button != null && event.button !== 0) return;
|
|
626
|
-
const element = body.value;
|
|
627
|
-
if (!element) return;
|
|
628
|
-
const edges = armingEdges(element, event.target);
|
|
629
|
-
if (edges == null) {
|
|
630
|
-
pendingBody = null;
|
|
631
|
-
return;
|
|
632
|
-
}
|
|
633
|
-
pendingBody = {
|
|
634
|
-
pointerId: event.pointerId,
|
|
635
|
-
startY: event.clientY,
|
|
636
|
-
atTop: edges.atTop,
|
|
637
|
-
atBottom: edges.atBottom
|
|
638
|
-
};
|
|
639
|
-
session.attach();
|
|
640
|
-
}
|
|
641
|
-
function onTouchStart(event) {
|
|
642
|
-
if (event.touches.length > 1) {
|
|
643
|
-
touchArming = null;
|
|
644
|
-
cancelDrag();
|
|
645
|
-
return;
|
|
646
|
-
}
|
|
647
|
-
const touch = event.changedTouches[0];
|
|
648
|
-
const element = body.value;
|
|
649
|
-
const edges = touch && element ? armingEdges(element, event.target) : null;
|
|
650
|
-
touchArming = touch && edges ? {
|
|
651
|
-
identifier: touch.identifier,
|
|
652
|
-
startY: touch.clientY,
|
|
653
|
-
...edges
|
|
654
|
-
} : null;
|
|
655
|
-
}
|
|
656
|
-
function onTouchMove(event) {
|
|
657
|
-
if (event.touches.length > 1) {
|
|
658
|
-
touchArming = null;
|
|
659
|
-
cancelDrag();
|
|
660
|
-
return;
|
|
661
|
-
}
|
|
662
|
-
const element = body.value;
|
|
663
|
-
if (dragState != null) {
|
|
664
|
-
const touch = Array.from(event.changedTouches).find((item) => item.identifier === dragState?.pointerId);
|
|
665
|
-
if (!touch) return;
|
|
666
|
-
if (event.cancelable) event.preventDefault();
|
|
667
|
-
updateDrag(touch.clientY, event.timeStamp);
|
|
668
|
-
return;
|
|
669
|
-
}
|
|
670
|
-
const arming = touchArming;
|
|
671
|
-
if (arming == null || !element) return;
|
|
672
|
-
const touch = Array.from(event.changedTouches).find((item) => item.identifier === arming.identifier);
|
|
673
|
-
if (!touch) return;
|
|
674
|
-
const delta = touch.clientY - arming.startY;
|
|
675
|
-
if (Math.abs(delta) < 8) return;
|
|
676
|
-
const pullingDown = delta > 0 && arming.atTop;
|
|
677
|
-
const pullingUp = delta < 0 && arming.atBottom && activeOffset.value > 0;
|
|
678
|
-
if (!pullingDown && !pullingUp) {
|
|
679
|
-
touchArming = null;
|
|
680
|
-
return;
|
|
681
|
-
}
|
|
682
|
-
touchArming = null;
|
|
683
|
-
if (event.cancelable) event.preventDefault();
|
|
684
|
-
beginDrag(arming.identifier, arming.startY, event.timeStamp);
|
|
685
|
-
updateDrag(touch.clientY, event.timeStamp);
|
|
1118
|
+
reportScrim(scrimFor(state.baseOffset, state));
|
|
686
1119
|
}
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
1120
|
+
const dragPointerId = () => dragState?.pointerId ?? null;
|
|
1121
|
+
const touchArm = createSheetTouchArm({
|
|
1122
|
+
activeOffset: () => activeOffset.value,
|
|
1123
|
+
dragPointerId: () => dragState?.viaTouch ? dragState.pointerId : null,
|
|
1124
|
+
begin: (start, clientY, timeStamp) => beginDrag({
|
|
1125
|
+
...start,
|
|
1126
|
+
viaTouch: true
|
|
1127
|
+
}, clientY, timeStamp),
|
|
1128
|
+
move: moveDrag,
|
|
1129
|
+
end: endDrag,
|
|
1130
|
+
cancel: dropDrag,
|
|
1131
|
+
yieldToPinch: cancelDrag
|
|
1132
|
+
});
|
|
1133
|
+
const pointerArm = createSheetPointerArm({
|
|
1134
|
+
body: () => body.value,
|
|
1135
|
+
dragPointerId,
|
|
1136
|
+
isTouchDrag: () => dragState?.viaTouch ?? false,
|
|
1137
|
+
attach: () => session.attach(),
|
|
1138
|
+
detach: () => session.detach(),
|
|
1139
|
+
begin: (start, clientY, timeStamp) => beginDrag({
|
|
1140
|
+
...start,
|
|
1141
|
+
viaTouch: false
|
|
1142
|
+
}, clientY, timeStamp),
|
|
1143
|
+
move: moveDrag,
|
|
1144
|
+
end: endDrag,
|
|
1145
|
+
cancel: cancelDrag
|
|
1146
|
+
});
|
|
1147
|
+
/** Every arm and any drag in flight let go: the sheet returns to its stop. */
|
|
1148
|
+
function cancelDrag() {
|
|
1149
|
+
pointerArm.reset();
|
|
1150
|
+
touchArm.reset();
|
|
1151
|
+
dropDrag();
|
|
691
1152
|
}
|
|
692
1153
|
function updateOverflow() {
|
|
693
1154
|
const element = body.value;
|
|
694
1155
|
isOverflowing.value = element != null && (element.scrollHeight > element.clientHeight + 1 || element.scrollWidth > element.clientWidth + 1);
|
|
695
1156
|
}
|
|
696
|
-
function recordSheetHeight() {
|
|
1157
|
+
function recordSheetHeight(height) {
|
|
697
1158
|
if (isDragging.value || settledLayoutOffset.value > 0 || isReconciling.value) return;
|
|
698
|
-
const height = panel.value?.getBoundingClientRect().height ?? 0;
|
|
699
1159
|
if (height > 0) sheetHeight.value = height;
|
|
700
1160
|
}
|
|
701
1161
|
session = createSheetPointerSession({
|
|
702
|
-
onPointerMove,
|
|
703
|
-
onPointerUp,
|
|
704
|
-
onPointerCancel,
|
|
705
|
-
onTouchStart,
|
|
706
|
-
onTouchMove,
|
|
707
|
-
onTouchEnd,
|
|
708
|
-
|
|
1162
|
+
onPointerMove: pointerArm.onPointerMove,
|
|
1163
|
+
onPointerUp: pointerArm.onPointerUp,
|
|
1164
|
+
onPointerCancel: pointerArm.onPointerCancel,
|
|
1165
|
+
onTouchStart: touchArm.onTouchStart,
|
|
1166
|
+
onTouchMove: touchArm.onTouchMove,
|
|
1167
|
+
onTouchEnd: touchArm.onTouchEnd,
|
|
1168
|
+
onInterrupt: () => cancelDrag()
|
|
709
1169
|
});
|
|
710
1170
|
watch(panel, (element) => {
|
|
711
1171
|
observer?.disconnect();
|
|
712
1172
|
observer = null;
|
|
713
|
-
if (!element
|
|
714
|
-
|
|
715
|
-
recordSheetHeight();
|
|
1173
|
+
if (!element) return;
|
|
1174
|
+
if (typeof ResizeObserver === "undefined") {
|
|
1175
|
+
recordSheetHeight(element.getBoundingClientRect().height);
|
|
1176
|
+
return;
|
|
1177
|
+
}
|
|
1178
|
+
observer = new ResizeObserver((entries) => {
|
|
1179
|
+
const entry = entries[entries.length - 1];
|
|
1180
|
+
recordSheetHeight(entry?.borderBoxSize?.[0]?.blockSize ?? element.getBoundingClientRect().height);
|
|
716
1181
|
updateOverflow();
|
|
717
1182
|
});
|
|
718
1183
|
observer.observe(element);
|
|
719
|
-
recordSheetHeight();
|
|
720
1184
|
}, { immediate: true });
|
|
721
1185
|
watch(body, (element) => {
|
|
722
1186
|
session.setBody(element);
|
|
@@ -728,16 +1192,15 @@ function useSheetGestures(options) {
|
|
|
728
1192
|
isReconciling.value = false;
|
|
729
1193
|
scrollPreservationInset.value = 0;
|
|
730
1194
|
if (!open) {
|
|
731
|
-
|
|
732
|
-
pendingBody = null;
|
|
733
|
-
touchArming = null;
|
|
1195
|
+
pendingDismissal = null;
|
|
734
1196
|
return;
|
|
735
1197
|
}
|
|
1198
|
+
clearDragClose();
|
|
736
1199
|
dragOffset.value = 0;
|
|
737
1200
|
settledOffset.value = 0;
|
|
738
1201
|
settledLayoutOffset.value = 0;
|
|
739
1202
|
scrimOpacity.value = 1;
|
|
740
|
-
nextTick(recordSheetHeight);
|
|
1203
|
+
if (typeof ResizeObserver === "undefined") nextTick(() => recordSheetHeight(panel.value?.getBoundingClientRect().height ?? 0));
|
|
741
1204
|
});
|
|
742
1205
|
watch(canDismiss, (allowed) => {
|
|
743
1206
|
if (!allowed) cancelDrag();
|
|
@@ -752,29 +1215,85 @@ function useSheetGestures(options) {
|
|
|
752
1215
|
isReconciling,
|
|
753
1216
|
isOverflowing,
|
|
754
1217
|
panelTransform: computed(() => {
|
|
755
|
-
const
|
|
756
|
-
const translation = activeOffset.value - layoutOffset;
|
|
1218
|
+
const translation = (heldClose.value?.offset ?? activeOffset.value) - layoutOffset.value;
|
|
757
1219
|
return translation !== 0 ? `translateY(${translation}px)` : void 0;
|
|
758
1220
|
}),
|
|
759
1221
|
panelHeight: computed(() => {
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
return `${Math.max(0, sheetHeight.value - layoutOffset)}px`;
|
|
1222
|
+
if (layoutOffset.value <= 0 || sheetHeight.value <= 0) return void 0;
|
|
1223
|
+
return `${Math.max(0, sheetHeight.value - layoutOffset.value)}px`;
|
|
763
1224
|
}),
|
|
764
1225
|
scrollPreservationInset,
|
|
765
1226
|
scrimOpacity,
|
|
766
|
-
|
|
767
|
-
|
|
1227
|
+
dragExit,
|
|
1228
|
+
isDismissedByTouchDrag,
|
|
1229
|
+
onHandlePointerDown: pointerArm.onHandlePointerDown,
|
|
1230
|
+
onBodyPointerDown: pointerArm.onBodyPointerDown,
|
|
768
1231
|
updateOverflow
|
|
769
1232
|
};
|
|
770
1233
|
}
|
|
771
1234
|
//#endregion
|
|
1235
|
+
//#region src/BottomSheet/useSheetReserve.ts
|
|
1236
|
+
const BLOCK_SIZE_PROPERTIES = [
|
|
1237
|
+
"height",
|
|
1238
|
+
"min-height",
|
|
1239
|
+
"max-height",
|
|
1240
|
+
"block-size",
|
|
1241
|
+
"min-block-size",
|
|
1242
|
+
"max-block-size"
|
|
1243
|
+
];
|
|
1244
|
+
function camelCase(property) {
|
|
1245
|
+
return property.replace(/-([a-z])/g, (_match, letter) => letter.toUpperCase());
|
|
1246
|
+
}
|
|
1247
|
+
/** Whether an inline `style` binding sets any block size. */
|
|
1248
|
+
function styleSetsBlockSize(style) {
|
|
1249
|
+
if (Array.isArray(style)) return style.some(styleSetsBlockSize);
|
|
1250
|
+
if (typeof style === "string") return BLOCK_SIZE_PROPERTIES.some((property) => new RegExp(`(^|;)\\s*${property}\\s*:`, "i").test(style));
|
|
1251
|
+
if (style == null || typeof style !== "object") return false;
|
|
1252
|
+
const record = style;
|
|
1253
|
+
return BLOCK_SIZE_PROPERTIES.some((property) => record[property] != null || record[camelCase(property)] != null);
|
|
1254
|
+
}
|
|
1255
|
+
/**
|
|
1256
|
+
* Whether the caller sizes the sheet through its fallthrough attributes: an
|
|
1257
|
+
* inline block size, or any class, whose rules can size it too. Nothing
|
|
1258
|
+
* extends such a sheet by the reserve.
|
|
1259
|
+
*/
|
|
1260
|
+
function isSizedByCaller(attrs) {
|
|
1261
|
+
const className = attrs.class;
|
|
1262
|
+
return (Array.isArray(className) ? className.length > 0 : className != null && className !== "" && !(typeof className === "object" && Object.keys(className).length === 0)) || styleSetsBlockSize(attrs.style);
|
|
1263
|
+
}
|
|
1264
|
+
/**
|
|
1265
|
+
* How far the sheet's surface reaches below the screen. Only a finger
|
|
1266
|
+
* stretches the sheet past MIN_RESERVE, so a device with a touch pointer keeps
|
|
1267
|
+
* 40% of the layout viewport while the sheet is presented, enough that a pull
|
|
1268
|
+
* past the top never shows the page under it. A device without one, and a
|
|
1269
|
+
* sheet the caller sizes, keep MIN_RESERVE.
|
|
1270
|
+
*/
|
|
1271
|
+
function useSheetReserve(isPresented, isSized) {
|
|
1272
|
+
const hasTouchPointer = useMediaQuery("(any-pointer: coarse)");
|
|
1273
|
+
const viewportHeight = shallowRef(0);
|
|
1274
|
+
const tracksViewport = computed(() => isPresented.value && hasTouchPointer.value && !isSized());
|
|
1275
|
+
watch(tracksViewport, (tracks, _previous, onCleanup) => {
|
|
1276
|
+
if (!tracks || typeof window === "undefined") {
|
|
1277
|
+
viewportHeight.value = 0;
|
|
1278
|
+
return;
|
|
1279
|
+
}
|
|
1280
|
+
const read = () => {
|
|
1281
|
+
viewportHeight.value = window.innerHeight;
|
|
1282
|
+
};
|
|
1283
|
+
read();
|
|
1284
|
+
window.addEventListener("resize", read);
|
|
1285
|
+
onCleanup(() => window.removeEventListener("resize", read));
|
|
1286
|
+
}, { immediate: true });
|
|
1287
|
+
return computed(() => viewportHeight.value > 0 ? sheetReserve(viewportHeight.value) : 48);
|
|
1288
|
+
}
|
|
1289
|
+
//#endregion
|
|
772
1290
|
//#region src/BottomSheet/BottomSheetPanel.vue
|
|
773
1291
|
const _hoisted_1$1 = [
|
|
774
1292
|
"data-state",
|
|
775
1293
|
"data-height",
|
|
776
1294
|
"data-dragging",
|
|
777
|
-
"data-reconciling"
|
|
1295
|
+
"data-reconciling",
|
|
1296
|
+
"data-exit"
|
|
778
1297
|
];
|
|
779
1298
|
const _hoisted_2$1 = [
|
|
780
1299
|
"data-keyboard",
|
|
@@ -802,7 +1321,8 @@ const _sfc_main$1 = /*@__PURE__*/ defineComponent({
|
|
|
802
1321
|
"scrimOpacity",
|
|
803
1322
|
"motionStart",
|
|
804
1323
|
"motionComplete",
|
|
805
|
-
"snap"
|
|
1324
|
+
"snap",
|
|
1325
|
+
"scrimFade"
|
|
806
1326
|
],
|
|
807
1327
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
808
1328
|
const props = __props;
|
|
@@ -820,6 +1340,8 @@ const _sfc_main$1 = /*@__PURE__*/ defineComponent({
|
|
|
820
1340
|
const content = useTemplateRef("content");
|
|
821
1341
|
useScrollbars(body);
|
|
822
1342
|
const isInteractive = computed(() => props.state === "open");
|
|
1343
|
+
const attrs = useAttrs();
|
|
1344
|
+
const reserve = useSheetReserve(computed(() => props.state !== "hidden"), () => isSizedByCaller(attrs));
|
|
823
1345
|
const heightKind = computed(() => {
|
|
824
1346
|
const height = props.height;
|
|
825
1347
|
return height === "hug" || height === "capped" || height === "tall" ? height : "custom";
|
|
@@ -834,6 +1356,7 @@ const _sfc_main$1 = /*@__PURE__*/ defineComponent({
|
|
|
834
1356
|
body,
|
|
835
1357
|
isOpen: isInteractive,
|
|
836
1358
|
canDismiss: computed(() => props.isSwipeDismissAllowed),
|
|
1359
|
+
reserve,
|
|
837
1360
|
getSnapHeights: () => {
|
|
838
1361
|
const points = props.snapPoints;
|
|
839
1362
|
if (!points?.length || typeof window === "undefined") return [];
|
|
@@ -843,12 +1366,27 @@ const _sfc_main$1 = /*@__PURE__*/ defineComponent({
|
|
|
843
1366
|
onSnap: (visibleHeight) => emit("snap", visibleHeight),
|
|
844
1367
|
onDismiss: () => emit("dismiss")
|
|
845
1368
|
});
|
|
1369
|
+
const isCrossFade = computed(() => gestures.isDismissedByTouchDrag.value && defaultPrefersReducedMotion());
|
|
1370
|
+
const playedDragExit = computed(() => {
|
|
1371
|
+
const exit = gestures.dragExit.value;
|
|
1372
|
+
return exit != null && !isCrossFade.value && !defaultPrefersReducedMotion() && supportsWebAnimations() ? exit : null;
|
|
1373
|
+
});
|
|
1374
|
+
const holdsDragClose = computed(() => gestures.dragExit.value != null && (playedDragExit.value != null || isCrossFade.value));
|
|
1375
|
+
watch(playedDragExit, (exit) => {
|
|
1376
|
+
emit("scrimFade", exit != null && panel.value != null ? dragExitFade(panel.value, exit) : null);
|
|
1377
|
+
}, { flush: "sync" });
|
|
846
1378
|
const panelStyle = computed(() => {
|
|
847
|
-
const style = {
|
|
1379
|
+
const style = {
|
|
1380
|
+
"--_sheet-budget": budget.value,
|
|
1381
|
+
"--_sheet-reserve": `${reserve.value}px`
|
|
1382
|
+
};
|
|
848
1383
|
if (isInteractive.value) {
|
|
849
1384
|
style.transform = gestures.panelTransform.value;
|
|
850
1385
|
style.height = gestures.panelHeight.value;
|
|
851
|
-
} else if (props.state === "exiting")
|
|
1386
|
+
} else if (props.state === "exiting") {
|
|
1387
|
+
style.height = gestures.panelHeight.value;
|
|
1388
|
+
if (holdsDragClose.value) style.transform = gestures.panelTransform.value ?? "translateY(0px)";
|
|
1389
|
+
}
|
|
852
1390
|
return style;
|
|
853
1391
|
});
|
|
854
1392
|
const bodyStyle = computed(() => {
|
|
@@ -857,17 +1395,38 @@ const _sfc_main$1 = /*@__PURE__*/ defineComponent({
|
|
|
857
1395
|
});
|
|
858
1396
|
const overflowTabStop = computed(() => isInteractive.value && gestures.isOverflowing.value);
|
|
859
1397
|
let cancelMotionWait = null;
|
|
1398
|
+
/** The element a swipe's close moved on the animator, until the sheet is hidden. */
|
|
1399
|
+
let dragExitElement = null;
|
|
860
1400
|
function waitForMotion(motion) {
|
|
861
1401
|
cancelMotionWait?.();
|
|
862
1402
|
emit("motionStart", motion);
|
|
863
|
-
|
|
1403
|
+
const complete = () => {
|
|
864
1404
|
cancelMotionWait = null;
|
|
865
1405
|
emit("motionComplete", motion);
|
|
866
|
-
}
|
|
1406
|
+
};
|
|
1407
|
+
const element = panel.value;
|
|
1408
|
+
const exit = playedDragExit.value;
|
|
1409
|
+
if (motion === "exiting" && exit != null && element != null) {
|
|
1410
|
+
dragExitElement = element;
|
|
1411
|
+
cancelMotionWait = playDragExit(element, exit, {
|
|
1412
|
+
onSettled: () => emit("scrimFade", null),
|
|
1413
|
+
complete
|
|
1414
|
+
});
|
|
1415
|
+
return;
|
|
1416
|
+
}
|
|
1417
|
+
cancelMotionWait = waitForTransition(element, motion === "exiting" && isCrossFade.value ? "opacity" : "transform", complete);
|
|
867
1418
|
}
|
|
868
1419
|
watch(() => props.state, (state) => {
|
|
869
|
-
if (state === "open" || state === "exiting")
|
|
870
|
-
|
|
1420
|
+
if (state === "open" || state === "exiting") {
|
|
1421
|
+
waitForMotion(state === "open" ? "entering" : "exiting");
|
|
1422
|
+
return;
|
|
1423
|
+
}
|
|
1424
|
+
cancelMotionWait?.();
|
|
1425
|
+
cancelMotionWait = null;
|
|
1426
|
+
if (dragExitElement != null) {
|
|
1427
|
+
resetDragExit(dragExitElement);
|
|
1428
|
+
dragExitElement = null;
|
|
1429
|
+
}
|
|
871
1430
|
}, { flush: "post" });
|
|
872
1431
|
onMounted(() => {
|
|
873
1432
|
gestures.updateOverflow();
|
|
@@ -893,6 +1452,7 @@ const _sfc_main$1 = /*@__PURE__*/ defineComponent({
|
|
|
893
1452
|
"data-height": heightKind.value,
|
|
894
1453
|
"data-dragging": unref(gestures).isDragging.value || void 0,
|
|
895
1454
|
"data-reconciling": unref(gestures).isReconciling.value || void 0,
|
|
1455
|
+
"data-exit": __props.state === "exiting" && isCrossFade.value ? "fade" : void 0,
|
|
896
1456
|
style: normalizeStyle(panelStyle.value),
|
|
897
1457
|
tabindex: "-1"
|
|
898
1458
|
}, [createElementVNode("div", {
|
|
@@ -1006,6 +1566,10 @@ const _hoisted_4 = [
|
|
|
1006
1566
|
"role"
|
|
1007
1567
|
];
|
|
1008
1568
|
const _hoisted_5 = { class: "astryx-bottom-sheet__positioner" };
|
|
1569
|
+
const _hoisted_6 = {
|
|
1570
|
+
ref: "layerHost",
|
|
1571
|
+
class: "astryx-bottom-sheet__layer-host"
|
|
1572
|
+
};
|
|
1009
1573
|
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
1010
1574
|
name: "AstryxBottomSheet",
|
|
1011
1575
|
inheritAttrs: false,
|
|
@@ -1059,6 +1623,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
1059
1623
|
});
|
|
1060
1624
|
const attrs = useAttrs();
|
|
1061
1625
|
const dialog = useTemplateRef("dialog");
|
|
1626
|
+
provideNestedLayerMountTarget(useTemplateRef("layerHost"));
|
|
1062
1627
|
const panel = useTemplateRef("panel");
|
|
1063
1628
|
const isPresented = ref(false);
|
|
1064
1629
|
const scrimOpacity = ref(1);
|
|
@@ -1072,7 +1637,13 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
1072
1637
|
});
|
|
1073
1638
|
const isDismissible = computed(() => props.purpose === "info");
|
|
1074
1639
|
const isSwipeDismissAllowed = computed(() => props.purpose === "info" && !props.isInline);
|
|
1075
|
-
const
|
|
1640
|
+
const scrimFade = ref(null);
|
|
1641
|
+
const isClosing = computed(() => !isOpen.value && isPresented.value);
|
|
1642
|
+
const dialogStyle = computed(() => ({
|
|
1643
|
+
"--_sheet-scrim-opacity": isClosing.value ? "0" : String(scrimOpacity.value),
|
|
1644
|
+
"--_sheet-scrim-duration": scrimFade.value == null ? void 0 : `${scrimFade.value.durationMs}ms`,
|
|
1645
|
+
"--_sheet-scrim-easing": scrimFade.value?.easing
|
|
1646
|
+
}));
|
|
1076
1647
|
useFocusTrap({
|
|
1077
1648
|
container: computed(() => panelElement()),
|
|
1078
1649
|
isEnabled: computed(() => !hosted.value && isOpen.value && props.hasScrim)
|
|
@@ -1191,7 +1762,10 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
1191
1762
|
openSheet();
|
|
1192
1763
|
}, { flush: "post" });
|
|
1193
1764
|
watch(isOpen, (value) => {
|
|
1194
|
-
if (value)
|
|
1765
|
+
if (value) {
|
|
1766
|
+
scrimOpacity.value = 1;
|
|
1767
|
+
return;
|
|
1768
|
+
}
|
|
1195
1769
|
isSettled.value = false;
|
|
1196
1770
|
isModalShown.value = false;
|
|
1197
1771
|
});
|
|
@@ -1293,7 +1867,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
1293
1867
|
ref: dialog,
|
|
1294
1868
|
class: normalizeClass(["astryx-bottom-sheet-dialog", {
|
|
1295
1869
|
"astryx-bottom-sheet-dialog--scrim": __props.hasScrim,
|
|
1296
|
-
"astryx-bottom-sheet-dialog--closing":
|
|
1870
|
+
"astryx-bottom-sheet-dialog--closing": isClosing.value
|
|
1297
1871
|
}]),
|
|
1298
1872
|
"data-settled": isSettled.value || void 0,
|
|
1299
1873
|
"aria-label": dialogLabel.value,
|
|
@@ -1304,35 +1878,40 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
1304
1878
|
onCancel,
|
|
1305
1879
|
onClick: onDialogClick,
|
|
1306
1880
|
onKeydown
|
|
1307
|
-
}, [
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1881
|
+
}, [
|
|
1882
|
+
createElementVNode("div", _hoisted_5, [createVNode(_sfc_main$1, mergeProps({
|
|
1883
|
+
ref_key: "panel",
|
|
1884
|
+
ref: panel
|
|
1885
|
+
}, panelAttrs(), {
|
|
1886
|
+
state: panelState.value,
|
|
1887
|
+
label: __props.label,
|
|
1888
|
+
height: __props.height,
|
|
1889
|
+
padding: __props.padding,
|
|
1890
|
+
"snap-points": __props.snapPoints,
|
|
1891
|
+
"is-swipe-dismiss-allowed": isSwipeDismissAllowed.value,
|
|
1892
|
+
onDismiss: requestClose,
|
|
1893
|
+
onScrimOpacity: _cache[4] || (_cache[4] = ($event) => scrimOpacity.value = $event),
|
|
1894
|
+
onScrimFade: _cache[5] || (_cache[5] = ($event) => scrimFade.value = $event),
|
|
1895
|
+
onSnap: _cache[6] || (_cache[6] = ($event) => emit("snap", $event)),
|
|
1896
|
+
onMotionStart: _cache[7] || (_cache[7] = ($event) => emit("motionStart", $event)),
|
|
1897
|
+
onMotionComplete: onPanelMotionComplete
|
|
1898
|
+
}), {
|
|
1899
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
1900
|
+
_: 3
|
|
1901
|
+
}, 16, [
|
|
1902
|
+
"state",
|
|
1903
|
+
"label",
|
|
1904
|
+
"height",
|
|
1905
|
+
"padding",
|
|
1906
|
+
"snap-points",
|
|
1907
|
+
"is-swipe-dismiss-allowed"
|
|
1908
|
+
])]),
|
|
1909
|
+
_cache[8] || (_cache[8] = createElementVNode("div", {
|
|
1910
|
+
class: "astryx-bottom-sheet__edge-tint",
|
|
1911
|
+
"aria-hidden": "true"
|
|
1912
|
+
}, null, -1)),
|
|
1913
|
+
createElementVNode("div", _hoisted_6, null, 512)
|
|
1914
|
+
], 46, _hoisted_4)], 2112));
|
|
1336
1915
|
};
|
|
1337
1916
|
}
|
|
1338
1917
|
});
|