@astryx-vue/core 0.31.0 → 0.32.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-CvNtu0Jd.js → AlertDialog-JmxbMkeV.js} +8 -8
- package/dist/AppShell/index.js +1 -1
- package/dist/{AppShell-BmX6wqba.js → AppShell-mWlY4pE3.js} +4 -6
- package/dist/Avatar/index.js +1 -1
- package/dist/{Avatar-IVvsyeGV.js → Avatar-B-gSpEw4.js} +1 -1
- package/dist/AvatarGroup/index.d.ts +1 -1
- package/dist/AvatarGroup/index.js +1 -1
- package/dist/{AvatarGroup-Dd-yDDNz.js → AvatarGroup-CCFMtKks.js} +1 -1
- package/dist/Banner/index.d.ts +1 -1
- package/dist/Banner/index.js +1 -1
- package/dist/{Banner-DKmvoMxD.js → Banner-BJETFZr7.js} +1 -1
- package/dist/BottomSheet/index.d.ts +1 -1
- package/dist/BottomSheet/index.js +2 -2
- package/dist/{BottomSheet-BZ_yFoKC.js → BottomSheet-C6pQBvnU.js} +10 -38
- package/dist/{BottomSheet-B8_znPYE.js → BottomSheet-C_LoskZt.js} +3 -3
- package/dist/Breadcrumbs/index.d.ts +2 -2
- package/dist/Breadcrumbs/index.js +2 -2
- package/dist/{Breadcrumbs-CJpvbZsf.js → Breadcrumbs-D05OmNfd.js} +1 -1
- package/dist/Button/index.d.ts +1 -1
- package/dist/Button/index.js +1 -1
- package/dist/{Button-DdPty46q.js → Button-X7k1WCkW.js} +4 -4
- package/dist/ButtonGroup/index.d.ts +1 -1
- package/dist/ButtonGroup/index.js +1 -1
- package/dist/{ButtonGroup-oI99JAyN.js → ButtonGroup-D5E7QLWI.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-BNr79JpP.js → Carousel-Bpbx-2DK.js} +1 -1
- package/dist/Chat/index.d.ts +1 -1
- package/dist/Chat/index.js +1 -1
- package/dist/{Chat-BadS0fEx.js → Chat-D7Q2z9W2.js} +11 -11
- package/dist/CheckboxInput/index.d.ts +1 -1
- package/dist/CheckboxInput/index.js +1 -1
- package/dist/{CheckboxInput-CzP8gP3v.js → CheckboxInput-Cxtmdymo.js} +3 -3
- package/dist/CheckboxList/index.d.ts +1 -1
- package/dist/CheckboxList/index.js +1 -1
- package/dist/{CheckboxListItem-CxBjpX3d.js → CheckboxListItem-DJrx97cA.js} +5 -5
- package/dist/ClickableCard/index.d.ts +1 -1
- package/dist/ClickableCard/index.js +1 -1
- package/dist/{ClickableCard-B86P2aiM.js → ClickableCard-CLXCxaxo.js} +1 -1
- package/dist/Code/index.js +1 -1
- package/dist/{CodeBlock-Cgm4uOhG.js → CodeBlock-Bgxy15iD.js} +1 -1
- package/dist/Collapsible/index.js +1 -1
- package/dist/{Collapsible-DXl9RRaX.js → Collapsible-Cf5zttC-.js} +2 -3
- package/dist/CommandPalette/index.js +1 -1
- package/dist/{CommandPalette-BgVwGtdA.js → CommandPalette-CniaCqex.js} +2 -2
- package/dist/ComplexSelector/index.js +1 -1
- package/dist/{ComplexSelector-vna5wtig.js → ComplexSelector-DYeYZKON.js} +2 -2
- package/dist/ContextMenu/index.d.ts +2 -2
- package/dist/ContextMenu/index.js +2 -2
- package/dist/{ContextMenu-CE-FnLI6.js → ContextMenu-CLCgJG0C.js} +167 -142
- package/dist/DateInput/index.d.ts +1 -1
- package/dist/DateInput/index.js +1 -1
- package/dist/{DateInput-BCasoeIj.js → DateInput-BmEbQA1z.js} +10 -10
- package/dist/DateRangeInput/index.d.ts +1 -1
- package/dist/DateRangeInput/index.js +1 -1
- package/dist/{DateRangeInput-Bi97pjDX.js → DateRangeInput-CoA1PuGz.js} +5 -5
- package/dist/DateTimeInput/index.d.ts +1 -1
- package/dist/DateTimeInput/index.js +1 -1
- package/dist/{DateTimeInput-CKnvjLhi.js → DateTimeInput-CL0sp0ES.js} +5 -5
- package/dist/Dialog/index.js +3 -3
- package/dist/{Dialog-BN-NycQr.js → Dialog-C46xHdDO.js} +1 -1
- package/dist/{Dialog-Dt0gNuMT.js → Dialog-uzq24bX_.js} +2 -2
- package/dist/{DialogHeader-CSH2_5v-.js → DialogHeader-E0auaRKt.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-PeMgE4iA.js → Drawer-DfhhdBMZ.js} +2 -2
- package/dist/DropdownMenu/index.d.ts +2 -2
- package/dist/DropdownMenu/index.js +2 -3
- package/dist/{DropdownMenu-aYOIh9gZ.js → DropdownMenu-BWgt12MZ.js} +1083 -555
- package/dist/{DropdownMenuRadioItem.vue-C8rePTyz.d.ts → DropdownMenuRadioItem.vue-B4iwMWWD.d.ts} +16 -0
- package/dist/EmptyState/index.js +1 -1
- package/dist/{EmptyState-BGo1nrnT.js → EmptyState-C8WQltQk.js} +2 -2
- package/dist/Field/index.js +3 -3
- package/dist/{Field-D-fRqyso.js → Field-CrnwM-2A.js} +1 -1
- package/dist/{FieldInfoTip-Bstp5Lvd.js → FieldInfoTip-DqQP1T-d.js} +1 -1
- package/dist/{FieldLabel-lV_qLaGp.js → FieldLabel-CLxclKT2.js} +1 -1
- package/dist/FileInput/index.js +1 -1
- package/dist/{FileInput-CTNnDIkm.js → FileInput-BHFjo_zo.js} +3 -3
- package/dist/Heading/index.d.ts +1 -1
- package/dist/Heading/index.js +1 -1
- package/dist/{Heading-BFK3PftX.js → Heading-jYno4L3t.js} +1 -1
- package/dist/HoverCard/index.d.ts +1 -1
- package/dist/HoverCard/index.js +1 -1
- package/dist/{HoverCard-DGjsPn-Q.js → HoverCard-D_6idU4r.js} +4 -4
- package/dist/IconButton/index.js +1 -1
- package/dist/{IconButton-DPezhVBA.js → IconButton-B6m42AlL.js} +1 -1
- package/dist/InfoTip/index.d.ts +1 -1
- package/dist/InfoTip/index.js +1 -1
- package/dist/{InfoTip-B4BFfLtT.js → InfoTip-CUkTHca2.js} +2 -2
- package/dist/{InputClearButton-CxU3iv-5.js → InputClearButton-s_MEW25n.js} +1 -1
- package/dist/InputGroup/index.js +1 -1
- package/dist/{InputGroup-CraWGK6Y.js → InputGroup-42PbUmg-.js} +1 -1
- package/dist/InternationalizationProvider/index.js +1 -1
- package/dist/{InternationalizationProvider-C-hZoz8a.js → InternationalizationProvider-BAUKUK7N.js} +1 -1
- package/dist/{Item-C9u_kQUO.js → Item-C9Cs0Jqr.js} +1 -1
- package/dist/{LayerContentBoundary-LCQLyxBT.js → LayerContentBoundary-XvH9wmdg.js} +1 -1
- package/dist/Layout/index.d.ts +1 -1
- package/dist/Layout/index.js +2 -2
- package/dist/{Layout-094k14rN.js → Layout-tU7e1J1I.js} +1 -1
- package/dist/{LayoutPanel-BPboQAJj.js → LayoutPanel-D8t8F-sl.js} +22 -2
- package/dist/Lightbox/index.js +1 -1
- package/dist/{Lightbox-BNUG9CQ1.js → Lightbox-Bur4pvRo.js} +2 -2
- package/dist/Link/index.d.ts +1 -1
- package/dist/Link/index.js +1 -1
- package/dist/{Link-Bwgpn-di.js → Link-DVslj_GH.js} +2 -2
- package/dist/List/index.d.ts +1 -1
- package/dist/List/index.js +2 -2
- package/dist/{ListItem-_lOmngHp.js → ListItem-DOFfdRA_.js} +2 -2
- package/dist/Markdown/index.js +1 -1
- package/dist/{Markdown-BlEi5UGN.js → Markdown-Baq5r2Mp.js} +3 -3
- package/dist/MetadataList/index.d.ts +1 -1
- package/dist/MobileNav/index.js +1 -1
- package/dist/{MobileNavToggle-wVa9dzH1.js → MobileNavToggle-BV3fmVmO.js} +2 -2
- package/dist/MoreMenu/index.d.ts +1 -1
- package/dist/MoreMenu/index.js +1 -1
- package/dist/{MoreMenu-CXshllJj.js → MoreMenu-COSDjYyl.js} +45 -16
- package/dist/MultiSelector/index.d.ts +1 -1
- package/dist/MultiSelector/index.js +1 -1
- package/dist/{MultiSelector-Bs3Imw6k.js → MultiSelector-eJSx3iZR.js} +8 -8
- package/dist/{NavDisclosure-DsUYuMJr.js → NavDisclosure-B8G8t325.js} +1 -1
- package/dist/{NavHeadingSurface-QdM33nOf.js → NavHeadingSurface-BkNP_1au.js} +1 -1
- package/dist/NavItem/index.d.ts +1 -1
- package/dist/NavItem/index.js +1 -1
- package/dist/{NavItem-D4xHjSTo.js → NavItem-B7xpLk_x.js} +1 -1
- package/dist/NavMenu/index.js +3 -3
- package/dist/{NavMenu-NCg3VjAQ.js → NavMenu-C6OU4a5Z.js} +3 -3
- package/dist/{NavMenuItem-Bla6fYVl.js → NavMenuItem-BZuajqYL.js} +3 -3
- package/dist/NumberInput/index.d.ts +1 -1
- package/dist/NumberInput/index.js +1 -1
- package/dist/{NumberInput-DicgvFte.js → NumberInput-Dd4QQGZp.js} +3 -3
- package/dist/Outline/index.js +1 -1
- package/dist/{Outline-CnSt_KvS.js → Outline-coqRQ06s.js} +4 -3
- package/dist/OverflowList/index.d.ts +1 -1
- package/dist/OverflowList/index.js +1 -1
- package/dist/{OverflowList-BYYz3ePw.js → OverflowList-DS7cmNsr.js} +2 -2
- package/dist/Pagination/index.d.ts +1 -1
- package/dist/Pagination/index.js +1 -1
- package/dist/{Pagination-kJhH6sPF.js → Pagination-BWPJfO4_.js} +2 -2
- package/dist/Popover/index.d.ts +1 -1
- package/dist/Popover/index.js +1 -1
- package/dist/{Popover-CqL_AXQB.js → Popover-DnrZk22Y.js} +8 -8
- package/dist/PowerSearch/index.d.ts +1 -1
- package/dist/PowerSearch/index.js +1 -1
- package/dist/{PowerSearch-Ff2n7eJ2.js → PowerSearch-CDwASKYp.js} +27 -27
- package/dist/ProgressBar/index.d.ts +1 -1
- package/dist/ProgressBar/index.js +1 -1
- package/dist/{ProgressBar-DCAEXJuP.js → ProgressBar-C-HzrG8T.js} +1 -1
- package/dist/Radio/index.d.ts +1 -1
- package/dist/Radio/index.js +1 -1
- package/dist/{RadioGroup-CsJYGjyx.js → RadioGroup-B-AkUDI8.js} +4 -4
- package/dist/RadioList/index.d.ts +1 -1
- package/dist/RadioList/index.js +1 -1
- package/dist/{RadioListItem-Yc3K82YE.js → RadioListItem-DhmF7YNL.js} +1 -1
- package/dist/Resizable/index.d.ts +1 -1
- package/dist/Resizable/index.js +1 -1
- package/dist/{ResizeHandle-BMSbAFdP.js → ResizeHandle-CcS-NP4r.js} +21 -4
- package/dist/ScrollableArea/index.d.ts +1 -1
- package/dist/SegmentedControl/index.js +1 -1
- package/dist/{SegmentedControl-C-F5dkcG.js → SegmentedControl-BdbqWErg.js} +2 -2
- package/dist/SelectableCard/index.d.ts +1 -1
- package/dist/SelectableCard/index.js +1 -1
- package/dist/{SelectableCard-CwfpgsS8.js → SelectableCard-YzN6trLf.js} +1 -1
- package/dist/Selector/index.d.ts +1 -1
- package/dist/Selector/index.js +1 -1
- package/dist/{Selector-DgzSGUul.js → Selector-BNr_kb6Q.js} +6 -6
- package/dist/SideNav/index.d.ts +1 -1
- package/dist/SideNav/index.js +2 -2
- package/dist/{SideNav-DNQZ8l6b.js → SideNav-DnoR_4ml.js} +9 -11
- package/dist/Slider/index.js +1 -1
- package/dist/{Slider-Bq_7Nskr.js → Slider-DaHQhbA7.js} +2 -2
- package/dist/Stack/index.d.ts +1 -1
- package/dist/StatusDot/index.js +1 -1
- package/dist/{StatusDot-DFJavm30.js → StatusDot-B7T0et3H.js} +1 -1
- package/dist/Stepper/index.d.ts +1 -1
- package/dist/Stepper/index.js +1 -1
- package/dist/{Stepper-CWluGqBs.js → Stepper-C3ZFN-Gp.js} +1 -1
- package/dist/Switch/index.d.ts +1 -1
- package/dist/Switch/index.js +1 -1
- package/dist/{Switch-DTPvMAxd.js → Switch-B8HRxp3u.js} +2 -2
- package/dist/TabList/index.d.ts +1 -1
- package/dist/TabList/index.js +1 -1
- package/dist/{TabList-C4i7UZkp.js → TabList-BOQ0bvE3.js} +3 -3
- package/dist/Table/index.d.ts +2 -2
- package/dist/Table/index.js +1 -1
- package/dist/{Table-CqAV7l7W.js → Table-CoWGEhzQ.js} +13 -15
- package/dist/Text/index.d.ts +1 -1
- package/dist/Text/index.js +1 -1
- package/dist/{Text-D48QFTtL.js → Text-DqiV40AF.js} +1 -1
- package/dist/TextArea/index.d.ts +1 -1
- package/dist/TextArea/index.js +1 -1
- package/dist/{TextArea-J2_wct0p.js → TextArea-Vrx7Os5P.js} +4 -4
- package/dist/TextInput/index.d.ts +1 -1
- package/dist/TextInput/index.js +1 -1
- package/dist/{TextInput-Da1TYd57.js → TextInput-DOeUROX8.js} +4 -4
- package/dist/Thumbnail/index.js +1 -1
- package/dist/{Thumbnail-1LsaJ4_m.js → Thumbnail-BF53Z6jm.js} +3 -3
- package/dist/{TimeField-ojhX2ZOj.js → TimeField-CkGXOHTG.js} +4 -4
- package/dist/TimeInput/index.d.ts +1 -1
- package/dist/TimeInput/index.js +1 -1
- package/dist/{TimeInput-CfeDP72M.js → TimeInput-DCksf1di.js} +2 -2
- package/dist/Timer/index.js +1 -1
- package/dist/{Timer-DgQdZAEa.js → Timer-DDrODKow.js} +1 -1
- package/dist/Timestamp/index.d.ts +1 -1
- package/dist/Timestamp/index.js +1 -1
- package/dist/{Timestamp-SseS_qtf.js → Timestamp-CCzREXNN.js} +3 -3
- package/dist/Toast/index.js +1 -1
- package/dist/{Toast-yUVFaZiJ.js → Toast-CoAEdN_I.js} +2 -2
- package/dist/ToggleButton/index.d.ts +1 -1
- package/dist/ToggleButton/index.js +1 -1
- package/dist/{ToggleButton-B6hBzeVl.js → ToggleButton-DAW-pV4r.js} +3 -3
- package/dist/Token/index.d.ts +1 -1
- package/dist/Token/index.js +1 -1
- package/dist/{Token-DTGUCgpn.js → Token-DZmmnHEj.js} +1 -1
- package/dist/Tokenizer/index.js +1 -1
- package/dist/{Tokenizer-nSEekhN1.js → Tokenizer-DsPtN6tZ.js} +13 -13
- package/dist/Toolbar/index.d.ts +2 -2
- package/dist/Tooltip/index.d.ts +1 -1
- package/dist/Tooltip/index.js +2 -2
- package/dist/{Tooltip-CxzlUVN0.js → Tooltip-DhV7MkwU.js} +1 -1
- package/dist/TopNav/index.d.ts +1 -1
- package/dist/TopNav/index.js +1 -1
- package/dist/{TopNav-CcIayfsW.js → TopNav-Djli-IEz.js} +5 -5
- package/dist/TreeList/index.d.ts +1 -1
- package/dist/TreeList/index.js +1 -1
- package/dist/{TreeList-CsgXzBdm.js → TreeList-CqJ3xfhB.js} +3 -4
- package/dist/Typeahead/index.js +2 -2
- package/dist/{Typeahead-BD6xXNKh.js → Typeahead-Dowds5Z-.js} +6 -6
- package/dist/{VelocityTracker-DgjmootV.js → VelocityTracker-DVbtTSXR.js} +1 -1
- package/dist/{useMenuDrillIn-CMsgOcDP.js → accessibleName-CINO01Ek.js} +117 -27
- package/dist/{animator-C0kqgDUJ.js → animator-DLWdws2R.js} +3 -2
- package/dist/{assertOptions-DHfonaBU.js → assertOptions-BCEzojGr.js} +1 -1
- package/dist/composables/index.d.ts +3 -3
- package/dist/composables/index.js +13 -13
- package/dist/{composables-CVvk9709.js → composables-B7FrCjk6.js} +11 -7
- package/dist/{context-ZWA02GaM.js → context-C_rX8KGX.js} +1 -2
- package/dist/cssValues-Cr6PhYTx.js +223 -0
- package/dist/{pressGesture-BzIBmKF2.js → gestures-C8VhWve7.js} +2 -296
- package/dist/{index-DH_xZI84.d.ts → index-B-Z4GL8g.d.ts} +2 -2
- package/dist/{index-DYabo8TI.d.ts → index-B44fLswd.d.ts} +2 -2
- package/dist/{index-etx25Eq-.d.ts → index-Bwh8O-v8.d.ts} +1 -1
- package/dist/{index-mK1ICsVg.d.ts → index-C3JmGujU.d.ts} +1 -1
- package/dist/{index-CKnr0JlT.d.ts → index-C4S65SAW.d.ts} +1 -1
- package/dist/{index-D05JGsT3.d.ts → index-C8wfe0Mr.d.ts} +1 -1
- package/dist/{index-DE-QPNz0.d.ts → index-C943VIzi.d.ts} +3 -2
- package/dist/{index-DVX2jlTQ.d.ts → index-CUuUoX3h.d.ts} +1 -1
- package/dist/{index-COgrQZIL.d.ts → index-CdvmnNMH.d.ts} +1 -1
- package/dist/{index-C_iTVOHQ.d.ts → index-CilCxEvD.d.ts} +1 -1
- package/dist/{index-BgT6mH3U.d.ts → index-D7ShT2c-.d.ts} +1 -1
- package/dist/{index-ZKBj_1nu.d.ts → index-D8l_CmL-.d.ts} +1 -1
- package/dist/{index-DbNGGCM0.d.ts → index-DAz4l6Jw.d.ts} +1 -1
- package/dist/{index-DtY_R6Oh.d.ts → index-DIkdln91.d.ts} +2 -2
- package/dist/{index-Bh-GqMzd.d.ts → index-DLE-sASO.d.ts} +31 -3
- package/dist/{index-Q1oG9yIT.d.ts → index-DPklTi3o.d.ts} +1 -1
- package/dist/{index-DofC9Rll.d.ts → index-Dk50Zh3F.d.ts} +2 -2
- package/dist/{index-CG6dbyeb.d.ts → index-DoYrlaEI.d.ts} +3 -3
- package/dist/{index-CuW4AQ7M.d.ts → index-In41wHf3.d.ts} +2 -2
- package/dist/{index-utZGF4GR.d.ts → index-NOXYEdOI.d.ts} +1 -1
- package/dist/{index-Dp6MmjIo.d.ts → index-Rz4jwv4Q.d.ts} +52 -52
- package/dist/{index-0RIgvtdm.d.ts → index-ZXrvTM3A.d.ts} +2 -2
- package/dist/{index-CEtFUoIm.d.ts → index-o3JHyrk8.d.ts} +1 -1
- package/dist/{index-CtYlR9Cu.d.ts → index-rdwI-mcm.d.ts} +1 -1
- package/dist/{index-C89cIh4E.d.ts → index-waTkqxTz.d.ts} +1 -1
- package/dist/index.d.ts +29 -29
- package/dist/index.js +110 -110
- package/dist/{batch-DPlrpYU6.js → landing-DrnLUanQ.js} +812 -4
- package/dist/{layerDepth-D3Rh8T5C.js → layerDepth-BdZX0xSD.js} +2 -2
- package/dist/lazyBottomSheet-BUXYsz28.js +25 -0
- package/dist/linearEasing-BxWjPql6.js +282 -0
- package/dist/locale/index.js +3 -3
- package/dist/{locale-CVpkedoa.js → locale-C9LWi1y1.js} +1 -1
- package/dist/{menuActivation-BqiaK6ot.js → menuActivation-BQqnzKAX.js} +8 -1
- package/dist/{pressFeedback-9dqGYjxv.js → pressFeedback-CPzGi_88.js} +2 -1
- package/dist/pressGesture-BV4fYPIG.js +103 -0
- package/dist/resizableChannel-BeoqCSou.js +387 -0
- package/dist/resolveMotion-BLdMNTpf.js +117 -0
- package/dist/resolveSnapPoint-DygD-wmL.js +110 -0
- package/dist/roles-CPMsH5Ob.js +196 -0
- package/dist/rubberBand-DecgmtDj.js +123 -0
- package/dist/{resolveSnapPoint-DdZyBkT4.js → springs-BR66JuIm.js} +2 -182
- package/dist/{stillPointerGate-BbMABRyU.js → stillPointerGate-BChxtcd6.js} +1 -1
- package/dist/{themeTiming-D1U0redl.js → themeTiming-BA_wpgEn.js} +1 -1
- package/dist/{tooltipFocusRules-CpUOvFEU.js → tooltipFocusRules-CU8eUu3v.js} +2 -2
- package/dist/{tooltipTriggerRules-zN2xGd9K.js → tooltipTriggerRules-CKfpQu9d.js} +1 -1
- package/dist/{useActionGroupTracking-CLFF7FI2.js → useActionGroupTracking-iv0p__dY.js} +3 -3
- package/dist/{useAnimatedLayout-DWWc31RR.js → useAnimatedLayout-B_mZd526.js} +1 -1
- package/dist/{useAttachment-BuNyeUXy.js → useAttachment-BohgLE3o.js} +3 -3
- package/dist/{useCombobox-BqkTY3bw.js → useCombobox-BYRrwLe-.js} +1 -1
- package/dist/{useDismiss-BKtyCwx4.js → useDismiss-Qq0hUJoO.js} +1 -1
- package/dist/{useFocusTrap-BD9POtMp.js → useFocusTrap-CX-qEF-G.js} +1 -1
- package/dist/{useInputStatusIcon-BqV6YzTV.js → useInputStatusIcon-CYvxaJvt.js} +1 -1
- package/dist/{useMenuPress-DcwVUsQO.js → useMenuPress-DDvcJNRd.js} +72 -5
- package/dist/{usePressFeedback-DHdmAsMp.js → usePressFeedback-BuyFZkQO.js} +1 -1
- package/dist/{useResizable-hv4NYIUi.js → useResizable-BIaZZDJ2.js} +411 -85
- package/dist/{useResizable-CJd4JkbJ.d.ts → useResizable-CKDaU_se.d.ts} +10 -8
- package/dist/{useTooltip-DvBKna-w.js → useTooltip-CgJi5QQW.js} +4 -4
- package/dist/{useTouchHitArea-SY1ITxSJ.js → useTouchHitArea-Dsz80HzY.js} +1 -1
- package/dist/{useTouchTriggerInternal-Bl602PtA.js → useTouchTriggerInternal-BapohoUw.js} +1 -1
- package/dist/{useTruncationTooltip-DNAii2Nv.js → useTruncationTooltip-x1cQd8of.js} +3 -3
- package/dist/{useTypeahead-BGpvWkzm.js → useTypeahead-CZuT8Niw.js} +1 -1
- package/dist/{useTypeaheadMenuConfig-BT9Lwsu7.js → useTypeaheadMenuConfig-BMd42XKb.js} +2 -2
- package/package.json +1 -1
- package/styles/dropdown-menu.css +5 -0
- package/styles/resize-handle.css +2 -0
- package/dist/DropdownMenu-B_KDdI8P.js +0 -489
- package/dist/edge-DFaE6rUg.js +0 -164
- package/dist/edgeRide-UdNxbwxY.js +0 -500
- package/dist/handle-CwxCHapJ.js +0 -22
- package/dist/landing-CSCE9afT.js +0 -105
- package/dist/lazyBottomSheet-CbU1Pnfk.js +0 -16
- package/dist/linearEasing-BiRVC8Mq.js +0 -98
- package/dist/resizableChannel-LElsNkSY.js +0 -33
- package/dist/resolveMotion-B9NDPeUz.js +0 -508
- package/dist/useSubmenuMode-CZN9qrUo.js +0 -37
- package/dist/{index-BqhgeAT4.d.ts → index-D8lv2BiD.d.ts} +1 -1
- package/dist/{loadCatalog-FwMzmCx1.js → loadCatalog-zJKVLZ89.js} +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { a as sharedWeakMap, i as sharedState, o as sharedWeakSet, r as sharedMap } from "./sharedRealm-H1OrlP0V.js";
|
|
1
|
+
import { a as sharedWeakMap, i as sharedState, n as sharedKey, o as sharedWeakSet, r as sharedMap } from "./sharedRealm-H1OrlP0V.js";
|
|
2
|
+
import { a as settlingDuration, n as sampleCount, o as solveSpring, r as reducedMotionCrossFade, s as toSpring, t as linearEasing } from "./linearEasing-BxWjPql6.js";
|
|
2
3
|
import { r as themeReducesMotion } from "./reducedMotionMark-CYSyfURo.js";
|
|
3
4
|
import { a as registerPresentedOffset, c as writePresentedResolve, n as clearPresentedResolve, t as batchPresented } from "./presentation-Cy_yf56y.js";
|
|
4
|
-
import {
|
|
5
|
-
import { r as readThemeTokenText, t as readThemeTiming } from "./themeTiming-D1U0redl.js";
|
|
5
|
+
import { r as readThemeTokenText, t as readThemeTiming } from "./themeTiming-BA_wpgEn.js";
|
|
6
6
|
//#region src/motion/layout/glides.ts
|
|
7
7
|
/**
|
|
8
8
|
* @file glides.ts
|
|
@@ -614,6 +614,37 @@ function glideProgress(area) {
|
|
|
614
614
|
};
|
|
615
615
|
}
|
|
616
616
|
const releaseGlides = sharedWeakMap("motion/animated-layout/release-glides", 1);
|
|
617
|
+
/**
|
|
618
|
+
* Times the changes `area` and what it holds play in the next frame by
|
|
619
|
+
* `progress`, not the theme's move curve. A release settles on its spring.
|
|
620
|
+
* Reduce Motion still wins.
|
|
621
|
+
*/
|
|
622
|
+
function glideNextChange(area, progress) {
|
|
623
|
+
releaseGlides.set(area, progress);
|
|
624
|
+
const view = area.ownerDocument.defaultView;
|
|
625
|
+
view?.requestAnimationFrame(() => {
|
|
626
|
+
view.requestAnimationFrame(() => releaseGlides.delete(area));
|
|
627
|
+
});
|
|
628
|
+
}
|
|
629
|
+
/**
|
|
630
|
+
* `spring` from rest toward the end, released at `velocity` (fractions of
|
|
631
|
+
* the move per second, toward the end), as a glide's progress.
|
|
632
|
+
*/
|
|
633
|
+
function springGlide(spring, velocity) {
|
|
634
|
+
const physics = toSpring(spring);
|
|
635
|
+
const curve = solveSpring(physics, {
|
|
636
|
+
from: 0,
|
|
637
|
+
to: 1,
|
|
638
|
+
velocity
|
|
639
|
+
});
|
|
640
|
+
const durationMs = settlingDuration(physics, { initialVelocity: velocity }) * 1e3;
|
|
641
|
+
const remaining = (t) => t >= durationMs ? 0 : 1 - curve.value(t / 1e3);
|
|
642
|
+
return {
|
|
643
|
+
durationMs,
|
|
644
|
+
easing: linearEasing(durationMs, (t) => 1 - remaining(t)),
|
|
645
|
+
remaining
|
|
646
|
+
};
|
|
647
|
+
}
|
|
617
648
|
function releaseGlideFor(area) {
|
|
618
649
|
for (let at = area; at != null; at = at.parentElement) {
|
|
619
650
|
const progress = releaseGlides.get(at);
|
|
@@ -1061,4 +1092,781 @@ function flush(batch) {
|
|
|
1061
1092
|
}
|
|
1062
1093
|
}
|
|
1063
1094
|
//#endregion
|
|
1064
|
-
|
|
1095
|
+
//#region src/motion/layout/edge.ts
|
|
1096
|
+
/** Whether `element` lays its inline axis out right to left. */
|
|
1097
|
+
function isRtl(element) {
|
|
1098
|
+
return element.ownerDocument.defaultView?.getComputedStyle(element).direction === "rtl";
|
|
1099
|
+
}
|
|
1100
|
+
/**
|
|
1101
|
+
* The `clip-path` that hides `side` of an element from `edge`: `inset()`'s
|
|
1102
|
+
* sides are physical (top, right, bottom, left), so an inline edge is
|
|
1103
|
+
* mirrored right to left. `zero` is how the other three are written.
|
|
1104
|
+
*/
|
|
1105
|
+
function edgeClip(edge, side, zero, rtl) {
|
|
1106
|
+
const sides = [
|
|
1107
|
+
zero,
|
|
1108
|
+
zero,
|
|
1109
|
+
zero,
|
|
1110
|
+
zero
|
|
1111
|
+
];
|
|
1112
|
+
const index = edge === "block-start" ? 0 : edge === "block-end" ? 2 : edge === "inline-end" !== rtl ? 1 : 3;
|
|
1113
|
+
sides[index] = side;
|
|
1114
|
+
return `inset(${sides.join(" ")})`;
|
|
1115
|
+
}
|
|
1116
|
+
/** A hidden fraction of the element, as a percentage clip on `edge`. */
|
|
1117
|
+
function fractionClip(edge, hidden, rtl) {
|
|
1118
|
+
return edgeClip(edge, `${round(hidden * 100)}%`, "0", rtl);
|
|
1119
|
+
}
|
|
1120
|
+
/** A hidden length of the element, in its own px, as a clip on `edge`. */
|
|
1121
|
+
function pxClip(edge, hidden, rtl) {
|
|
1122
|
+
return edgeClip(edge, `${hidden}px`, "0px", rtl);
|
|
1123
|
+
}
|
|
1124
|
+
/**
|
|
1125
|
+
* The element's size along `edge`'s axis, in its own px (a scaled ancestor
|
|
1126
|
+
* divided out), read from the layout the caller already laid out.
|
|
1127
|
+
*/
|
|
1128
|
+
function extentOf(element, edge) {
|
|
1129
|
+
const rect = element.getBoundingClientRect();
|
|
1130
|
+
const scale = scaleOf(element, rect);
|
|
1131
|
+
return edge.startsWith("inline") ? rect.width / scale.x : rect.height / scale.y;
|
|
1132
|
+
}
|
|
1133
|
+
/**
|
|
1134
|
+
* The parts that slide inside an element revealed or concealed from a block
|
|
1135
|
+
* edge by `extent` px. They are its child elements that the band can show:
|
|
1136
|
+
* the area's visible part plus one viewport, or `extent` if larger, above and
|
|
1137
|
+
* below. A part past the band cannot come into view while it moves, so it
|
|
1138
|
+
* stays. The walk stops at the first child below the band, so its cost grows
|
|
1139
|
+
* with the changed size, never with the length of a list. A translation
|
|
1140
|
+
* cannot move text on its own, so an element with text of its own keeps the
|
|
1141
|
+
* clip (null).
|
|
1142
|
+
*/
|
|
1143
|
+
function slidingParts(element, edge, area, extent) {
|
|
1144
|
+
if (!edge.startsWith("block") || !(extent > 0)) return null;
|
|
1145
|
+
const view = element.ownerDocument.defaultView;
|
|
1146
|
+
const style = view?.getComputedStyle(element);
|
|
1147
|
+
if (view == null || style == null || paintsOwnBox(style) || ["::before", "::after"].some((pseudo) => {
|
|
1148
|
+
const { content } = view.getComputedStyle(element, pseudo);
|
|
1149
|
+
return content !== "" && content !== "none" && content !== "normal";
|
|
1150
|
+
})) return null;
|
|
1151
|
+
const band = bandFor(visibleRect(area), Math.max(view.innerHeight, extent));
|
|
1152
|
+
const parts = [];
|
|
1153
|
+
const scales = [];
|
|
1154
|
+
for (let node = element.firstChild; node != null; node = node.nextSibling) {
|
|
1155
|
+
if (node.nodeType === Node.TEXT_NODE) {
|
|
1156
|
+
if ((node.textContent ?? "").trim() !== "") return null;
|
|
1157
|
+
continue;
|
|
1158
|
+
}
|
|
1159
|
+
if (node.nodeType !== Node.ELEMENT_NODE) continue;
|
|
1160
|
+
const { display } = view.getComputedStyle(node);
|
|
1161
|
+
if (display === "inline" || display === "contents") return null;
|
|
1162
|
+
const box = node.getBoundingClientRect();
|
|
1163
|
+
if (box.top > band.end) break;
|
|
1164
|
+
if (box.bottom >= band.start) {
|
|
1165
|
+
if (glides.has(node)) return null;
|
|
1166
|
+
parts.push(node);
|
|
1167
|
+
scales.push(scaleOf(node, box, ownScaleOf(node)));
|
|
1168
|
+
}
|
|
1169
|
+
}
|
|
1170
|
+
if (parts.length === 0) return null;
|
|
1171
|
+
const inner = (side) => (Number.parseFloat(style.getPropertyValue(`border-${side}-width`)) || 0) + (Number.parseFloat(style.getPropertyValue(`padding-${side}`)) || 0);
|
|
1172
|
+
return {
|
|
1173
|
+
parts,
|
|
1174
|
+
scales,
|
|
1175
|
+
clip: edge === "block-end" ? `inset(${inner("top")}px 0px 0px 0px)` : `inset(0px 0px ${inner("bottom")}px 0px)`
|
|
1176
|
+
};
|
|
1177
|
+
}
|
|
1178
|
+
/**
|
|
1179
|
+
* Whether a style paints a box of its own: a fill, a border, a shadow, an
|
|
1180
|
+
* outline or a filter.
|
|
1181
|
+
*/
|
|
1182
|
+
function paintsOwnBox(style) {
|
|
1183
|
+
const isClear = (color) => color === "" || color === "transparent" || /^rgba\(.*,\s*0\)$/.test(color);
|
|
1184
|
+
return !isClear(style.backgroundColor) || style.backgroundImage !== "" && style.backgroundImage !== "none" || [
|
|
1185
|
+
"Top",
|
|
1186
|
+
"Right",
|
|
1187
|
+
"Bottom",
|
|
1188
|
+
"Left"
|
|
1189
|
+
].some((side) => style.getPropertyValue(`border-${side.toLowerCase()}-style`) !== "none" && Number.parseFloat(style.getPropertyValue(`border-${side.toLowerCase()}-width`)) > 0) || style.boxShadow !== "" && style.boxShadow !== "none" || style.borderImageSource !== "" && style.borderImageSource !== "none" || style.filter !== "" && style.filter !== "none" || style.outlineStyle !== "" && style.outlineStyle !== "none" && Number.parseFloat(style.outlineWidth) > 0;
|
|
1190
|
+
}
|
|
1191
|
+
/**
|
|
1192
|
+
* Where the parts sit when the element hides `hidden` px from `edge`. They
|
|
1193
|
+
* move that far towards it, so their far edge meets the content that rides
|
|
1194
|
+
* the same edge.
|
|
1195
|
+
*/
|
|
1196
|
+
function slideFrame(edge, hidden) {
|
|
1197
|
+
return { translate: `0px ${edge === "block-end" ? -hidden : hidden}px` };
|
|
1198
|
+
}
|
|
1199
|
+
/**
|
|
1200
|
+
* Clips `element` with `clip` while its parts slide, and returns what puts
|
|
1201
|
+
* its own `clip-path` back. The clip does not move, so it stays in step with
|
|
1202
|
+
* the parts and the content beside them on every engine.
|
|
1203
|
+
*/
|
|
1204
|
+
function holdSlideClip(element, clip) {
|
|
1205
|
+
const { style } = element;
|
|
1206
|
+
const value = style.getPropertyValue("clip-path");
|
|
1207
|
+
const priority = style.getPropertyPriority("clip-path");
|
|
1208
|
+
style.setProperty("clip-path", clip);
|
|
1209
|
+
return () => {
|
|
1210
|
+
if (value === "") style.removeProperty("clip-path");
|
|
1211
|
+
else style.setProperty("clip-path", value, priority);
|
|
1212
|
+
};
|
|
1213
|
+
}
|
|
1214
|
+
/**
|
|
1215
|
+
* The last element before `element` in the area that takes part in layout:
|
|
1216
|
+
* its previous sibling, or its nearest ancestor's below the area (the mirror
|
|
1217
|
+
* of `nextInFlow`, for a start edge).
|
|
1218
|
+
*/
|
|
1219
|
+
function previousInFlow(element, area) {
|
|
1220
|
+
const view = element.ownerDocument.defaultView;
|
|
1221
|
+
const lastBox = (from) => {
|
|
1222
|
+
const style = view?.getComputedStyle(from);
|
|
1223
|
+
if (style == null) return from;
|
|
1224
|
+
if (style.display === "contents") {
|
|
1225
|
+
for (let child = from.lastElementChild; child != null; child = child.previousElementSibling) {
|
|
1226
|
+
const box = lastBox(child);
|
|
1227
|
+
if (box != null) return box;
|
|
1228
|
+
}
|
|
1229
|
+
return null;
|
|
1230
|
+
}
|
|
1231
|
+
return takesPart(from, style) ? from : null;
|
|
1232
|
+
};
|
|
1233
|
+
let node = element;
|
|
1234
|
+
while (node != null && node !== area) {
|
|
1235
|
+
for (let sibling = node.previousElementSibling; sibling != null; sibling = sibling.previousElementSibling) {
|
|
1236
|
+
const box = lastBox(sibling);
|
|
1237
|
+
if (box != null) return box;
|
|
1238
|
+
}
|
|
1239
|
+
node = node.parentElement;
|
|
1240
|
+
}
|
|
1241
|
+
return null;
|
|
1242
|
+
}
|
|
1243
|
+
/**
|
|
1244
|
+
* The glide that moves `neighbour`: its own, or that of its nearest gliding
|
|
1245
|
+
* ancestor below the area that does not also hold `element` (one that holds
|
|
1246
|
+
* both moves the two together, so the edge does not ride it).
|
|
1247
|
+
*/
|
|
1248
|
+
function glideMoving(neighbour, element, area) {
|
|
1249
|
+
for (let node = neighbour; node != null && node !== area && !node.contains(element); node = node.parentElement) {
|
|
1250
|
+
const glide = glides.get(node);
|
|
1251
|
+
if (glide != null) return glide;
|
|
1252
|
+
}
|
|
1253
|
+
return null;
|
|
1254
|
+
}
|
|
1255
|
+
//#endregion
|
|
1256
|
+
//#region src/motion/layout/handle.ts
|
|
1257
|
+
/**
|
|
1258
|
+
* @file handle.ts
|
|
1259
|
+
* @position Internal to motion/layout; split from upstream motion/animatedLayout.ts
|
|
1260
|
+
*/
|
|
1261
|
+
const AREA = sharedKey("animated-layout/area", 1);
|
|
1262
|
+
/** The container a handle reads, or null for a value that is not a handle. */
|
|
1263
|
+
function readArea(handle) {
|
|
1264
|
+
const read = handle[AREA];
|
|
1265
|
+
return typeof read === "function" ? read() : null;
|
|
1266
|
+
}
|
|
1267
|
+
/** A handle over `area` (the container element, read when a change runs). */
|
|
1268
|
+
function createAnimatedLayout(area) {
|
|
1269
|
+
return Object.freeze(Object.defineProperty({}, AREA, { value: area }));
|
|
1270
|
+
}
|
|
1271
|
+
function areaOf(handle, element) {
|
|
1272
|
+
const area = readArea(handle);
|
|
1273
|
+
return area != null && area !== element && area.contains(element) ? area : null;
|
|
1274
|
+
}
|
|
1275
|
+
//#endregion
|
|
1276
|
+
//#region src/motion/layout/playChange.ts
|
|
1277
|
+
/** Each part's slide, by its motion: a stopped slide is no glide. */
|
|
1278
|
+
const slideTargets = sharedWeakMap("motion/animated-layout/slide-targets", 1);
|
|
1279
|
+
/**
|
|
1280
|
+
* The changed element's own animation, on the same motion as the content
|
|
1281
|
+
* after it (`spec:AST-105` FR4): content that appears reveals from its
|
|
1282
|
+
* block-end edge downward, or from the `edge` it is given (FR9), and its edge
|
|
1283
|
+
* rides the glide of the content on that side once it starts. A reveal that
|
|
1284
|
+
* reverses a running conceal (an adopter opens it again mid-exit, after
|
|
1285
|
+
* `releaseLayoutExit`) starts from what the element shows. Plays only with a
|
|
1286
|
+
* handle, inside its area and in the area's visible part. Returns the
|
|
1287
|
+
* entrance it started, or null when it played none.
|
|
1288
|
+
*/
|
|
1289
|
+
function playLayoutChange(handle, element, { edge = "block-end" } = {}) {
|
|
1290
|
+
if (handle == null) return null;
|
|
1291
|
+
const area = areaOf(handle, element);
|
|
1292
|
+
if (area == null) return null;
|
|
1293
|
+
if (!intersects(element.getBoundingClientRect(), visibleRect(area))) return null;
|
|
1294
|
+
const motion = layoutMotion(area);
|
|
1295
|
+
if (motion.kind === "instant") return null;
|
|
1296
|
+
const from = shownAtStart(element, 0);
|
|
1297
|
+
const batch = batches.get(area);
|
|
1298
|
+
const change = batch != null && [...batch.changed].some((changed) => changed === element || changed.contains(element)) ? changeStartOf(batch) : void 0;
|
|
1299
|
+
if (motion.kind === "fade") return safeAnimate(element, [{ opacity: from }, { opacity: 1 }], {
|
|
1300
|
+
duration: motion.durationMs,
|
|
1301
|
+
easing: motion.easing
|
|
1302
|
+
}, change);
|
|
1303
|
+
const { progress } = motion;
|
|
1304
|
+
const rtl = edge.startsWith("inline") && isRtl(element);
|
|
1305
|
+
const extent = edge.startsWith("block") ? extentOf(element, edge) : 0;
|
|
1306
|
+
const sliding = slidingParts(element, edge, area, extent);
|
|
1307
|
+
const partMotions = slideParts(sliding, progress, change, (remaining) => slideFrame(edge, (1 - from) * remaining * extent));
|
|
1308
|
+
const animation = safeAnimate(element, sampleKeyframes(progress, (remaining) => {
|
|
1309
|
+
const hidden = (1 - from) * remaining;
|
|
1310
|
+
return partMotions.length > 0 ? { opacity: 1 - hidden } : {
|
|
1311
|
+
opacity: 1 - hidden,
|
|
1312
|
+
clipPath: fractionClip(edge, hidden, rtl)
|
|
1313
|
+
};
|
|
1314
|
+
}), {
|
|
1315
|
+
duration: progress.durationMs,
|
|
1316
|
+
easing: "linear"
|
|
1317
|
+
}, change);
|
|
1318
|
+
if (animation == null) for (const part of partMotions) part.cancel();
|
|
1319
|
+
else rideEdge(element, area, edge, rtl, trackEdgeMotion(element, animation, (t) => 1 - (1 - from) * progress.remaining(t), partMotions, partMotions.length > 0 && sliding != null ? holdSlideClip(element, sliding.clip) : void 0), false);
|
|
1320
|
+
return animation;
|
|
1321
|
+
}
|
|
1322
|
+
/**
|
|
1323
|
+
* Plays each part's slide on the change's start, sampled like the glide.
|
|
1324
|
+
* `frame` turns the share of the motion still to come into a keyframe.
|
|
1325
|
+
*/
|
|
1326
|
+
function slideParts(sliding, progress, change, frame, fill) {
|
|
1327
|
+
const motions = [];
|
|
1328
|
+
for (const [index, part] of (sliding?.parts ?? []).entries()) {
|
|
1329
|
+
const motion = safeAnimate(part, sampleKeyframes(progress, frame), {
|
|
1330
|
+
duration: progress.durationMs,
|
|
1331
|
+
easing: "linear",
|
|
1332
|
+
fill
|
|
1333
|
+
}, change);
|
|
1334
|
+
if (motion != null) {
|
|
1335
|
+
motions.push(motion);
|
|
1336
|
+
const glide = {
|
|
1337
|
+
animation: motion,
|
|
1338
|
+
offsetAt: (t) => drawnOffset(motion, t),
|
|
1339
|
+
get durationMs() {
|
|
1340
|
+
return liveDuration(motion, progress.durationMs);
|
|
1341
|
+
},
|
|
1342
|
+
shownBefore: {
|
|
1343
|
+
x: 0,
|
|
1344
|
+
y: 0
|
|
1345
|
+
},
|
|
1346
|
+
scale: sliding?.scales[index] ?? {
|
|
1347
|
+
x: 1,
|
|
1348
|
+
y: 1
|
|
1349
|
+
}
|
|
1350
|
+
};
|
|
1351
|
+
glides.set(part, glide);
|
|
1352
|
+
slideTargets.set(motion, part);
|
|
1353
|
+
motion.addEventListener?.("finish", () => {
|
|
1354
|
+
if (glides.get(part) === glide) glides.delete(part);
|
|
1355
|
+
});
|
|
1356
|
+
}
|
|
1357
|
+
}
|
|
1358
|
+
return motions;
|
|
1359
|
+
}
|
|
1360
|
+
/**
|
|
1361
|
+
* The offset `animation` draws `t` ms in, read off its keyframes, a straight
|
|
1362
|
+
* line between each two. A slide that rides another glide reads that glide's
|
|
1363
|
+
* frames, so this follows it.
|
|
1364
|
+
*/
|
|
1365
|
+
function drawnOffset(animation, t) {
|
|
1366
|
+
const effect = animation.effect;
|
|
1367
|
+
if (effect == null || typeof effect.getKeyframes !== "function") return {
|
|
1368
|
+
x: 0,
|
|
1369
|
+
y: 0
|
|
1370
|
+
};
|
|
1371
|
+
const frames = effect.getKeyframes();
|
|
1372
|
+
const duration = Number(effect.getTiming().duration);
|
|
1373
|
+
const at = duration > 0 ? Math.min(1, Math.max(0, t / duration)) : 1;
|
|
1374
|
+
const offsetOf = (frame) => {
|
|
1375
|
+
const [x = 0, y = 0] = numbersIn(String(frame?.translate ?? ""));
|
|
1376
|
+
return {
|
|
1377
|
+
x,
|
|
1378
|
+
y,
|
|
1379
|
+
offset: frame?.computedOffset ?? 0
|
|
1380
|
+
};
|
|
1381
|
+
};
|
|
1382
|
+
let from = offsetOf(frames[0]);
|
|
1383
|
+
let to = offsetOf(frames[frames.length - 1]);
|
|
1384
|
+
for (const frame of frames) {
|
|
1385
|
+
const point = offsetOf(frame);
|
|
1386
|
+
if (point.offset <= at) from = point;
|
|
1387
|
+
if (point.offset >= at) {
|
|
1388
|
+
to = point;
|
|
1389
|
+
break;
|
|
1390
|
+
}
|
|
1391
|
+
}
|
|
1392
|
+
const span = to.offset - from.offset;
|
|
1393
|
+
const k = span > 0 ? (at - from.offset) / span : 0;
|
|
1394
|
+
return {
|
|
1395
|
+
x: from.x + (to.x - from.x) * k,
|
|
1396
|
+
y: from.y + (to.y - from.y) * k
|
|
1397
|
+
};
|
|
1398
|
+
}
|
|
1399
|
+
/** How many ms before `animation` started `glide` started: 0 in one change. */
|
|
1400
|
+
function startedBefore(glide, animation) {
|
|
1401
|
+
const shift = Number(animation.startTime) - Number(glide.animation.startTime);
|
|
1402
|
+
return Number.isFinite(shift) ? Math.max(0, shift) : 0;
|
|
1403
|
+
}
|
|
1404
|
+
/** `animation`'s length now, in ms, or `fallback` if it has none. */
|
|
1405
|
+
function liveDuration(animation, fallback) {
|
|
1406
|
+
const effect = animation.effect;
|
|
1407
|
+
const duration = Number(effect?.getTiming?.().duration);
|
|
1408
|
+
return duration > 0 ? duration : fallback;
|
|
1409
|
+
}
|
|
1410
|
+
/** Cancels a part's slide, and forgets it as the part's glide. */
|
|
1411
|
+
function stopGlideOf(animation) {
|
|
1412
|
+
const part = slideTargets.get(animation);
|
|
1413
|
+
if (part != null && glides.get(part)?.animation === animation) glides.delete(part);
|
|
1414
|
+
animation.cancel();
|
|
1415
|
+
}
|
|
1416
|
+
//#endregion
|
|
1417
|
+
//#region src/motion/layout/exit.ts
|
|
1418
|
+
/** The inline properties an exit sets, so a release removes exactly them. */
|
|
1419
|
+
const EXIT_PROPERTIES = [
|
|
1420
|
+
"margin-block-end",
|
|
1421
|
+
"margin-inline-end",
|
|
1422
|
+
"margin-block-start",
|
|
1423
|
+
"margin-inline-start",
|
|
1424
|
+
"pointer-events"
|
|
1425
|
+
];
|
|
1426
|
+
/**
|
|
1427
|
+
* The first element after `element` in the area that takes part in layout:
|
|
1428
|
+
* its next sibling, or its nearest ancestor's below the area. A wrapper's
|
|
1429
|
+
* edge is not used: a negative end margin can collapse through it.
|
|
1430
|
+
*/
|
|
1431
|
+
function nextInFlow(element, area) {
|
|
1432
|
+
const view = element.ownerDocument.defaultView;
|
|
1433
|
+
const firstBox = (from) => {
|
|
1434
|
+
const style = view?.getComputedStyle(from);
|
|
1435
|
+
if (style == null) return from;
|
|
1436
|
+
if (style.display === "contents") {
|
|
1437
|
+
for (let child = from.firstElementChild; child != null; child = child.nextElementSibling) {
|
|
1438
|
+
const box = firstBox(child);
|
|
1439
|
+
if (box != null) return box;
|
|
1440
|
+
}
|
|
1441
|
+
return null;
|
|
1442
|
+
}
|
|
1443
|
+
return takesPart(from, style) ? from : null;
|
|
1444
|
+
};
|
|
1445
|
+
let node = element;
|
|
1446
|
+
while (node != null && node !== area) {
|
|
1447
|
+
for (let sibling = node.nextElementSibling; sibling != null; sibling = sibling.nextElementSibling) {
|
|
1448
|
+
const box = firstBox(sibling);
|
|
1449
|
+
if (box != null) return box;
|
|
1450
|
+
}
|
|
1451
|
+
node = node.parentElement;
|
|
1452
|
+
}
|
|
1453
|
+
return null;
|
|
1454
|
+
}
|
|
1455
|
+
/**
|
|
1456
|
+
* An element's place: its block start, and its inline start (RTL read right
|
|
1457
|
+
* to left).
|
|
1458
|
+
*/
|
|
1459
|
+
function placeOf(element, rtl) {
|
|
1460
|
+
const rect = element.getBoundingClientRect();
|
|
1461
|
+
return {
|
|
1462
|
+
block: rect.top,
|
|
1463
|
+
inline: rtl ? -rect.right : rect.left
|
|
1464
|
+
};
|
|
1465
|
+
}
|
|
1466
|
+
/**
|
|
1467
|
+
* Keeps `element` where it is, in flow (so it scrolls and clips with its
|
|
1468
|
+
* container), while the content after it takes the place it takes once the
|
|
1469
|
+
* element is hidden: a negative end margin measured against that content,
|
|
1470
|
+
* so a gap or collapsing margins come out exact. Returns false, setting
|
|
1471
|
+
* nothing, when no margin reaches that place.
|
|
1472
|
+
*/
|
|
1473
|
+
function giveUpSpace(element, area, edge = "block-end") {
|
|
1474
|
+
const view = element.ownerDocument.defaultView;
|
|
1475
|
+
const parent = element.parentElement == null ? void 0 : view?.getComputedStyle(element.parentElement);
|
|
1476
|
+
const isRow = parent != null && parent.display.includes("flex") && parent.flexDirection.startsWith("row");
|
|
1477
|
+
const rtl = view?.getComputedStyle(element).direction === "rtl";
|
|
1478
|
+
const isStart = edge.endsWith("start");
|
|
1479
|
+
const property = edge === "block-end" ? isRow ? "margin-inline-end" : "margin-block-end" : `margin-${edge}`;
|
|
1480
|
+
const isInline = property.includes("inline");
|
|
1481
|
+
const size = isInline ? element.offsetWidth : element.offsetHeight;
|
|
1482
|
+
const next = nextInFlow(element, area);
|
|
1483
|
+
if (next == null && !isStart) {
|
|
1484
|
+
element.style.setProperty(property, `${-size}px`);
|
|
1485
|
+
return true;
|
|
1486
|
+
}
|
|
1487
|
+
const own = element.style.getPropertyValue(property);
|
|
1488
|
+
const ownPriority = element.style.getPropertyPriority(property);
|
|
1489
|
+
const axis = isInline ? "inline" : "block";
|
|
1490
|
+
const checked = [
|
|
1491
|
+
next,
|
|
1492
|
+
element.parentElement == null || element.parentElement === area ? null : nextInFlow(element.parentElement, area),
|
|
1493
|
+
isStart ? previousInFlow(element, area) : null,
|
|
1494
|
+
isStart ? element : null
|
|
1495
|
+
].filter((box) => box != null);
|
|
1496
|
+
if (checked.length === 0) return false;
|
|
1497
|
+
const scale = scaleOf(element, element.getBoundingClientRect());
|
|
1498
|
+
const position = element.style.getPropertyValue("position");
|
|
1499
|
+
const positionPriority = element.style.getPropertyPriority("position");
|
|
1500
|
+
const shown = isStart ? placeOf(element, rtl) : null;
|
|
1501
|
+
element.style.setProperty("position", "absolute", "important");
|
|
1502
|
+
const targets = checked.map((box) => box === element && shown != null ? shown : placeOf(box, rtl));
|
|
1503
|
+
const target = targets[0];
|
|
1504
|
+
if (position === "") element.style.removeProperty("position");
|
|
1505
|
+
else element.style.setProperty("position", position, positionPriority);
|
|
1506
|
+
const perPx = isRow ? scale.x : scale.y;
|
|
1507
|
+
element.style.setProperty(property, `${-size}px`);
|
|
1508
|
+
const guess = placeOf(checked[0], rtl)[axis];
|
|
1509
|
+
const correction = (target[axis] - guess) / perPx;
|
|
1510
|
+
element.style.setProperty(property, `${-size + correction}px`);
|
|
1511
|
+
if (checked.some((box, index) => {
|
|
1512
|
+
const landed = placeOf(box, rtl);
|
|
1513
|
+
return Math.abs(landed.block - targets[index].block) > 1 || Math.abs(landed.inline - targets[index].inline) > 1;
|
|
1514
|
+
})) {
|
|
1515
|
+
if (own === "") element.style.removeProperty(property);
|
|
1516
|
+
else element.style.setProperty(property, own, ownPriority);
|
|
1517
|
+
return false;
|
|
1518
|
+
}
|
|
1519
|
+
return true;
|
|
1520
|
+
}
|
|
1521
|
+
/** Exits holding an element back, so a release can stop one. */
|
|
1522
|
+
const exits = sharedWeakMap("motion/animated-layout/exits", 1);
|
|
1523
|
+
const replaced = sharedWeakMap("motion/animated-layout/replaced", 1);
|
|
1524
|
+
/**
|
|
1525
|
+
* The changed element's exit (`spec:AST-105` FR4): content that disappears
|
|
1526
|
+
* keeps its place on screen but gives up its space (a negative end margin
|
|
1527
|
+
* measured against the layout without it, so the content after it glides up
|
|
1528
|
+
* at once to exactly where it ends, and it still scrolls and clips with its
|
|
1529
|
+
* container), is inert (no focus, no pointer, nothing read), conceals upward
|
|
1530
|
+
* from its bottom edge on the same motion, and then `done` runs, when the
|
|
1531
|
+
* component hides or unmounts it. Under Reduce Motion with a coarse primary pointer it
|
|
1532
|
+
* fades instead. Call it in the layout effect of the commit that closes the
|
|
1533
|
+
* element, after the change's `animate()` reported it measured, in the same
|
|
1534
|
+
* task: the glide reads the layout once the element has given up its space.
|
|
1535
|
+
*
|
|
1536
|
+
* It conceals to its block-end edge by default, or to the `edge` it is given
|
|
1537
|
+
* (`spec:AST-105` FR9), and its edge rides the glide of the content on that
|
|
1538
|
+
* side once it starts; a conceal that reverses a running reveal (a close
|
|
1539
|
+
* while it opens) starts from what the element shows.
|
|
1540
|
+
*
|
|
1541
|
+
* Returns false, holding nothing, when the exit lands at once: no handle, a
|
|
1542
|
+
* close no change in the area measured, outside the area or its visible part,
|
|
1543
|
+
* Reduce Motion with a fine pointer, or a layout no end margin can free (a
|
|
1544
|
+
* grid track and its gap, a flex-row item that sets its row's height); in
|
|
1545
|
+
* that last case the content after it takes its final place at once too.
|
|
1546
|
+
* The component then hides the element itself.
|
|
1547
|
+
*/
|
|
1548
|
+
function holdLayoutExit(handle, element, done, { edge = "block-end" } = {}) {
|
|
1549
|
+
if (handle == null) return false;
|
|
1550
|
+
const area = areaOf(handle, element);
|
|
1551
|
+
if (area == null || !intersects(element.getBoundingClientRect(), visibleRect(area))) return false;
|
|
1552
|
+
const batch = batches.get(area);
|
|
1553
|
+
if (batch == null || ![...batch.changed].some((changed) => changed === element || changed.contains(element))) return false;
|
|
1554
|
+
const motion = layoutMotion(area);
|
|
1555
|
+
if (motion.kind === "instant") return false;
|
|
1556
|
+
releaseLayoutExit(element);
|
|
1557
|
+
const prior = {
|
|
1558
|
+
inert: element.hasAttribute("inert"),
|
|
1559
|
+
styles: EXIT_PROPERTIES.map((property) => [
|
|
1560
|
+
property,
|
|
1561
|
+
element.style.getPropertyValue(property),
|
|
1562
|
+
element.style.getPropertyPriority(property)
|
|
1563
|
+
])
|
|
1564
|
+
};
|
|
1565
|
+
if (!giveUpSpace(element, area, edge)) {
|
|
1566
|
+
for (const changed of [...batch.changed]) if (changed === element || changed.contains(element)) batch.changed.delete(changed);
|
|
1567
|
+
return false;
|
|
1568
|
+
}
|
|
1569
|
+
replaced.set(element, prior);
|
|
1570
|
+
element.setAttribute("inert", "");
|
|
1571
|
+
element.style.setProperty("pointer-events", "none");
|
|
1572
|
+
const from = shownAtStart(element, 1);
|
|
1573
|
+
const rtl = edge.startsWith("inline") && isRtl(element);
|
|
1574
|
+
const change = changeStartOf(batch);
|
|
1575
|
+
let animation;
|
|
1576
|
+
if (motion.kind === "fade") animation = safeAnimate(element, [{ opacity: from }, { opacity: 0 }], {
|
|
1577
|
+
duration: motion.durationMs,
|
|
1578
|
+
easing: motion.easing,
|
|
1579
|
+
fill: "forwards"
|
|
1580
|
+
}, change);
|
|
1581
|
+
else {
|
|
1582
|
+
const { progress } = motion;
|
|
1583
|
+
const extent = edge.startsWith("block") ? extentOf(element, edge) : 0;
|
|
1584
|
+
const sliding = slidingParts(element, edge, area, extent);
|
|
1585
|
+
const partMotions = slideParts(sliding, progress, change, (remaining) => slideFrame(edge, (1 - from * remaining) * extent), "forwards");
|
|
1586
|
+
animation = safeAnimate(element, sampleKeyframes(progress, (remaining) => {
|
|
1587
|
+
const shown = from * remaining;
|
|
1588
|
+
return partMotions.length > 0 ? { opacity: shown } : {
|
|
1589
|
+
opacity: shown,
|
|
1590
|
+
clipPath: fractionClip(edge, 1 - shown, rtl)
|
|
1591
|
+
};
|
|
1592
|
+
}), {
|
|
1593
|
+
duration: progress.durationMs,
|
|
1594
|
+
easing: "linear",
|
|
1595
|
+
fill: "forwards"
|
|
1596
|
+
}, change);
|
|
1597
|
+
if (animation == null) for (const part of partMotions) part.cancel();
|
|
1598
|
+
else rideEdge(element, area, edge, rtl, trackEdgeMotion(element, animation, (t) => from * progress.remaining(t), partMotions, partMotions.length > 0 && sliding != null ? holdSlideClip(element, sliding.clip) : void 0, true), true);
|
|
1599
|
+
}
|
|
1600
|
+
exits.set(element, animation);
|
|
1601
|
+
if (animation == null) {
|
|
1602
|
+
done();
|
|
1603
|
+
return true;
|
|
1604
|
+
}
|
|
1605
|
+
animation.addEventListener?.("finish", () => {
|
|
1606
|
+
if (exits.get(element) === animation) done();
|
|
1607
|
+
});
|
|
1608
|
+
return true;
|
|
1609
|
+
}
|
|
1610
|
+
/**
|
|
1611
|
+
* Puts an element `holdLayoutExit` held back: stops its exit and puts back
|
|
1612
|
+
* what the exit replaced (its `inert` and inline values as they were). Called
|
|
1613
|
+
* once the component has hidden the element, or when the element opens again
|
|
1614
|
+
* mid-exit.
|
|
1615
|
+
*/
|
|
1616
|
+
function releaseLayoutExit(element) {
|
|
1617
|
+
if (!exits.has(element)) return;
|
|
1618
|
+
const running = edgeMotions.get(element);
|
|
1619
|
+
if (running != null) {
|
|
1620
|
+
edgeMotions.delete(element);
|
|
1621
|
+
stoppedShown.set(element, {
|
|
1622
|
+
fraction: shownNow(running),
|
|
1623
|
+
at: timelineNow(element)
|
|
1624
|
+
});
|
|
1625
|
+
stopSlides(running);
|
|
1626
|
+
}
|
|
1627
|
+
const held = heldSlides.get(element);
|
|
1628
|
+
heldSlides.delete(element);
|
|
1629
|
+
if (held != null) stopSlides(held);
|
|
1630
|
+
exits.get(element)?.cancel();
|
|
1631
|
+
exits.delete(element);
|
|
1632
|
+
const prior = replaced.get(element);
|
|
1633
|
+
replaced.delete(element);
|
|
1634
|
+
if (prior?.inert !== true) element.removeAttribute("inert");
|
|
1635
|
+
for (const [property, value, priority] of prior?.styles ?? []) if (value === "") element.style.removeProperty(property);
|
|
1636
|
+
else element.style.setProperty(property, value, priority);
|
|
1637
|
+
}
|
|
1638
|
+
//#endregion
|
|
1639
|
+
//#region src/motion/layout/edgeRide.ts
|
|
1640
|
+
/** Each exit's motion, whose parts hold their slides until its release. */
|
|
1641
|
+
const heldSlides = sharedWeakMap("motion/animated-layout/held-slides", 1);
|
|
1642
|
+
/** Each element's running one-state reveal or conceal. */
|
|
1643
|
+
const edgeMotions = sharedWeakMap("motion/animated-layout/edge-motions", 1);
|
|
1644
|
+
/**
|
|
1645
|
+
* What a one-state motion an adopter stopped (`releaseLayoutExit`) showed,
|
|
1646
|
+
* and the timeline time it stopped at: a reveal started in the same frame,
|
|
1647
|
+
* the reversal that stopped it, starts there.
|
|
1648
|
+
*/
|
|
1649
|
+
const stoppedShown = sharedWeakMap("motion/animated-layout/stopped-shown", 1);
|
|
1650
|
+
function timelineNow(element) {
|
|
1651
|
+
return Number(element.ownerDocument.timeline?.currentTime ?? NaN);
|
|
1652
|
+
}
|
|
1653
|
+
/** What `motion` shows now, by its animation's own clock. */
|
|
1654
|
+
function shownNow(motion) {
|
|
1655
|
+
const time = Number(motion.animation.currentTime);
|
|
1656
|
+
return motion.shownAt(Number.isFinite(time) ? Math.max(0, time) : 0);
|
|
1657
|
+
}
|
|
1658
|
+
/**
|
|
1659
|
+
* What `element` shows as a reveal or conceal starts: where the one-state
|
|
1660
|
+
* motion this one reverses had got to (it stops there), or `atRest`, all of
|
|
1661
|
+
* it for a conceal and nothing for a reveal.
|
|
1662
|
+
*/
|
|
1663
|
+
function shownAtStart(element, atRest) {
|
|
1664
|
+
const running = edgeMotions.get(element);
|
|
1665
|
+
if (running != null) {
|
|
1666
|
+
edgeMotions.delete(element);
|
|
1667
|
+
const fraction = shownNow(running);
|
|
1668
|
+
running.animation.cancel();
|
|
1669
|
+
stopSlides(running);
|
|
1670
|
+
return fraction;
|
|
1671
|
+
}
|
|
1672
|
+
const stopped = stoppedShown.get(element);
|
|
1673
|
+
stoppedShown.delete(element);
|
|
1674
|
+
if (stopped != null && stopped.at === timelineNow(element)) return stopped.fraction;
|
|
1675
|
+
return atRest;
|
|
1676
|
+
}
|
|
1677
|
+
/** Stops `motion`'s sliding parts and puts back the element's clip, once. */
|
|
1678
|
+
function stopSlides(motion) {
|
|
1679
|
+
motion.release();
|
|
1680
|
+
}
|
|
1681
|
+
/** Records `animation` as `element`'s running one-state motion. */
|
|
1682
|
+
function trackEdgeMotion(element, animation, shownAt, slides = [], release = () => {}, isHeldToRelease = false) {
|
|
1683
|
+
let isReleased = false;
|
|
1684
|
+
const motion = {
|
|
1685
|
+
animation,
|
|
1686
|
+
shownAt,
|
|
1687
|
+
slides,
|
|
1688
|
+
release: () => {
|
|
1689
|
+
if (!isReleased) {
|
|
1690
|
+
isReleased = true;
|
|
1691
|
+
for (const slide of slides) stopGlideOf(slide);
|
|
1692
|
+
release();
|
|
1693
|
+
}
|
|
1694
|
+
}
|
|
1695
|
+
};
|
|
1696
|
+
edgeMotions.set(element, motion);
|
|
1697
|
+
if (isHeldToRelease) heldSlides.set(element, motion);
|
|
1698
|
+
animation.addEventListener?.("finish", () => {
|
|
1699
|
+
if (edgeMotions.get(element) === motion) {
|
|
1700
|
+
edgeMotions.delete(element);
|
|
1701
|
+
if (!isHeldToRelease) motion.release();
|
|
1702
|
+
}
|
|
1703
|
+
});
|
|
1704
|
+
return motion;
|
|
1705
|
+
}
|
|
1706
|
+
/**
|
|
1707
|
+
* After this commit's glides start (the batch flushes in a microtask queued
|
|
1708
|
+
* before this one), before the frame paints: once the content on `edge`'s
|
|
1709
|
+
* side glides, the moving edge rides that glide, frame by frame, so the two
|
|
1710
|
+
* never part, a reversal included (the glide carries its running motion).
|
|
1711
|
+
* `hiddenAt` turns that content's offset towards the edge's side into the
|
|
1712
|
+
* length the element hides; `frame` turns that length into a keyframe.
|
|
1713
|
+
* Without that glide (nothing on that side in the area, or nothing that
|
|
1714
|
+
* moves) the motion keeps its own curve. The animation is kept, its frames
|
|
1715
|
+
* replaced; `onRide` hears the ridden hidden length over time.
|
|
1716
|
+
*/
|
|
1717
|
+
function rideNeighbour(element, area, edge, rtl, animation, isCurrent, hiddenAt, frame, onRide) {
|
|
1718
|
+
const effect = animation.effect;
|
|
1719
|
+
if (effect == null || typeof effect.setKeyframes !== "function") return;
|
|
1720
|
+
queueMicrotask(() => {
|
|
1721
|
+
if (!isCurrent()) return;
|
|
1722
|
+
const isEnd = edge.endsWith("end");
|
|
1723
|
+
const neighbour = isEnd ? nextInFlow(element, area) : previousInFlow(element, area);
|
|
1724
|
+
const glide = neighbour == null ? null : glideMoving(neighbour, element, area);
|
|
1725
|
+
if (neighbour == null || glide == null) return;
|
|
1726
|
+
const own = glideMoving(element, neighbour, area);
|
|
1727
|
+
const glideAt = startedBefore(glide, animation);
|
|
1728
|
+
const ownAt = own == null ? 0 : startedBefore(own, animation);
|
|
1729
|
+
const durationMs = Math.max(glide.durationMs - glideAt, own == null ? 0 : own.durationMs - ownAt);
|
|
1730
|
+
const sign = isEnd ? 1 : -1;
|
|
1731
|
+
const hidden = (t) => {
|
|
1732
|
+
const offset = glide.offsetAt(glideAt + t);
|
|
1733
|
+
const moved = own?.offsetAt(ownAt + t) ?? {
|
|
1734
|
+
x: 0,
|
|
1735
|
+
y: 0
|
|
1736
|
+
};
|
|
1737
|
+
return hiddenAt(sign * (edge.startsWith("inline") ? (rtl ? -1 : 1) * (offset.x - moved.x) : offset.y - moved.y));
|
|
1738
|
+
};
|
|
1739
|
+
const frames = sampleOver(durationMs, (t) => frame(hidden(t)));
|
|
1740
|
+
effect.setKeyframes(frames);
|
|
1741
|
+
effect.updateTiming?.({ duration: durationMs });
|
|
1742
|
+
retimeSettle(animation, frames, durationMs);
|
|
1743
|
+
onRide(hidden, durationMs);
|
|
1744
|
+
});
|
|
1745
|
+
}
|
|
1746
|
+
/**
|
|
1747
|
+
* The one-state reveal or conceal rides the content on its edge's side: the
|
|
1748
|
+
* element shows what lies between its fixed edge and that content, a reveal
|
|
1749
|
+
* less by however far the content still is from its place towards it, a
|
|
1750
|
+
* conceal all of it less however far the content has come, fading with what
|
|
1751
|
+
* it hides.
|
|
1752
|
+
*/
|
|
1753
|
+
function rideEdge(element, area, edge, rtl, motion, isConceal) {
|
|
1754
|
+
const extent = extentOf(element, edge);
|
|
1755
|
+
if (!(extent > 0)) return;
|
|
1756
|
+
rideNeighbour(element, area, edge, rtl, motion.animation, () => edgeMotions.get(element) === motion, (towards) => Math.min(extent, Math.max(0, isConceal ? extent - towards : -towards)), (hidden) => motion.slides.length > 0 ? { opacity: 1 - hidden / extent } : {
|
|
1757
|
+
opacity: 1 - hidden / extent,
|
|
1758
|
+
clipPath: pxClip(edge, hidden, rtl)
|
|
1759
|
+
}, (hiddenAt, durationMs) => {
|
|
1760
|
+
motion.shownAt = (t) => 1 - hiddenAt(t) / extent;
|
|
1761
|
+
for (const slide of motion.slides) {
|
|
1762
|
+
const effect = slide.effect;
|
|
1763
|
+
const frames = sampleOver(durationMs, (t) => slideFrame(edge, hiddenAt(t)));
|
|
1764
|
+
effect?.setKeyframes?.(frames);
|
|
1765
|
+
effect?.updateTiming?.({ duration: durationMs });
|
|
1766
|
+
retimeSettle(slide, frames, durationMs);
|
|
1767
|
+
}
|
|
1768
|
+
});
|
|
1769
|
+
}
|
|
1770
|
+
//#endregion
|
|
1771
|
+
//#region src/motion/layout/reportChange.ts
|
|
1772
|
+
function resolve(target) {
|
|
1773
|
+
return typeof target === "function" ? target() : target.current;
|
|
1774
|
+
}
|
|
1775
|
+
/**
|
|
1776
|
+
* Report a size change of `target` to the handle's area. Call
|
|
1777
|
+
* `measureBefore()` before the change commits and `animate()` after it; the
|
|
1778
|
+
* content after `target`, up to the area, glides from its old place.
|
|
1779
|
+
* Changes in one area in one frame move together. Without a handle, or
|
|
1780
|
+
* outside its container, nothing moves.
|
|
1781
|
+
*/
|
|
1782
|
+
function reportLayoutChange(handle, target) {
|
|
1783
|
+
return {
|
|
1784
|
+
measureBefore() {
|
|
1785
|
+
const element = resolve(target);
|
|
1786
|
+
if (element == null || handle == null) return;
|
|
1787
|
+
const area = areaOf(handle, element);
|
|
1788
|
+
if (area == null) return;
|
|
1789
|
+
beginChange(element.ownerDocument);
|
|
1790
|
+
const batch = batchFor(area);
|
|
1791
|
+
if (batch.changed.has(element)) return;
|
|
1792
|
+
batch.changed.add(element);
|
|
1793
|
+
batch.changedSize += rectOf(element, batch.cache).height;
|
|
1794
|
+
batch.visible ??= visibleRect(area);
|
|
1795
|
+
batch.originBefore ??= originOf(area);
|
|
1796
|
+
batch.walksToBand ??= area.ownerDocument.defaultView?.getComputedStyle(area).getPropertyValue("overflow-anchor") === "none";
|
|
1797
|
+
const needed = Math.max(batch.visible.height, batch.changedSize);
|
|
1798
|
+
const walks = needed > batch.reach ? [...batch.changed] : [element];
|
|
1799
|
+
if (needed > batch.reach) batch.reach = Math.max(needed, batch.reach * 2);
|
|
1800
|
+
const band = bandFor(batch.visible, batch.reach);
|
|
1801
|
+
for (const changed of walks) {
|
|
1802
|
+
const candidates = collectCandidates(changed, area, band, batch.cache, batch.walksToBand, batch.ancestors, batch.befores);
|
|
1803
|
+
for (const [candidate, rect] of candidates) if (!batch.before.has(candidate)) batch.before.set(candidate, onGlideClock(candidate, rect, area));
|
|
1804
|
+
batch.candidates.set(changed, [...candidates.keys()]);
|
|
1805
|
+
}
|
|
1806
|
+
},
|
|
1807
|
+
animate(beforeMove) {
|
|
1808
|
+
const element = resolve(target);
|
|
1809
|
+
if (element == null || handle == null) return false;
|
|
1810
|
+
const area = areaOf(handle, element);
|
|
1811
|
+
const batch = area == null ? void 0 : batches.get(area);
|
|
1812
|
+
if (batch == null || !batch.changed.has(element)) return false;
|
|
1813
|
+
if (beforeMove != null) batch.beforeMove.push(beforeMove);
|
|
1814
|
+
if (!batch.scheduled) {
|
|
1815
|
+
batch.scheduled = true;
|
|
1816
|
+
queueMicrotask(() => batchPresented(() => flush(batch)));
|
|
1817
|
+
}
|
|
1818
|
+
return true;
|
|
1819
|
+
}
|
|
1820
|
+
};
|
|
1821
|
+
}
|
|
1822
|
+
//#endregion
|
|
1823
|
+
//#region src/motion/layout/landing.ts
|
|
1824
|
+
/**
|
|
1825
|
+
* A disclosure's indicator (its chevron) turns on the same motion as the
|
|
1826
|
+
* glide. Its CSS transition takes the theme's move curve and duration as the
|
|
1827
|
+
* glide reads them where the area is, and is immediate under Reduce Motion.
|
|
1828
|
+
* Without a handle the inline values are cleared, so the component's own
|
|
1829
|
+
* transition applies.
|
|
1830
|
+
*/
|
|
1831
|
+
function applyLayoutChangeTransition(handle, element) {
|
|
1832
|
+
if (element == null) return;
|
|
1833
|
+
const area = handle == null ? null : areaOf(handle, element);
|
|
1834
|
+
if (area == null) {
|
|
1835
|
+
transitionSettles.get(element)?.();
|
|
1836
|
+
element.style.removeProperty("transition-duration");
|
|
1837
|
+
element.style.removeProperty("transition-timing-function");
|
|
1838
|
+
return;
|
|
1839
|
+
}
|
|
1840
|
+
const motion = layoutMotion(area);
|
|
1841
|
+
if (motion.kind !== "glide") {
|
|
1842
|
+
transitionSettles.get(element)?.();
|
|
1843
|
+
element.style.setProperty("transition-duration", "0s");
|
|
1844
|
+
element.style.removeProperty("transition-timing-function");
|
|
1845
|
+
return;
|
|
1846
|
+
}
|
|
1847
|
+
const ms = Math.round(motion.progress.durationMs * 1e3) / 1e3;
|
|
1848
|
+
element.style.setProperty("transition-duration", `${ms}ms`);
|
|
1849
|
+
element.style.setProperty("transition-timing-function", motion.progress.easing);
|
|
1850
|
+
settleTransition(element, motion.progress);
|
|
1851
|
+
}
|
|
1852
|
+
/**
|
|
1853
|
+
* Lands `element`'s running glide at once: it takes its layout place, and a
|
|
1854
|
+
* later change starts from there (a change its caller lands rather than
|
|
1855
|
+
* animates, such as a rail that snaps).
|
|
1856
|
+
*/
|
|
1857
|
+
function landLayoutGlide(element) {
|
|
1858
|
+
const glide = glides.get(element);
|
|
1859
|
+
if (glide != null) {
|
|
1860
|
+
glides.delete(element);
|
|
1861
|
+
glide.animation.cancel();
|
|
1862
|
+
}
|
|
1863
|
+
}
|
|
1864
|
+
/**
|
|
1865
|
+
* The motion a change in `area` plays, for tests and for SideNav's rail
|
|
1866
|
+
* motion, which plays on the same clock (`component:SideNav` FR6).
|
|
1867
|
+
*/
|
|
1868
|
+
function layoutMotionFor(area) {
|
|
1869
|
+
return layoutMotion(area);
|
|
1870
|
+
}
|
|
1871
|
+
//#endregion
|
|
1872
|
+
export { glideOf as A, springGlide as C, intersects as D, safeAnimate as E, shownBoxAt as M, scaleOf as O, sampleOver as S, layoutStartFor as T, pxClip as _, rideNeighbour as a, layoutMotion as b, placeOf as c, areaOf as d, createAnimatedLayout as f, previousInFlow as g, isRtl as h, reportLayoutChange as i, glides as j, visibleRect as k, releaseLayoutExit as l, extentOf as m, landLayoutGlide as n, holdLayoutExit as o, readArea as p, layoutMotionFor as r, nextInFlow as s, applyLayoutChangeTransition as t, playLayoutChange as u, changeStartIn as v, beginChange as w, sampleKeyframes as x, glideNextChange as y };
|