@astryx-vue/core 0.36.0 → 0.36.2
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-rndlABEe.js → AlertDialog-Dz8T0KIa.js} +5 -5
- package/dist/AppShell/index.js +1 -1
- package/dist/{AppShell-eVrOpRqn.js → AppShell-ClZ2Y8cu.js} +2 -2
- package/dist/AvatarGroup/index.d.ts +1 -1
- package/dist/AvatarGroup/index.js +1 -1
- package/dist/{AvatarGroup-BEBUEhxF.js → AvatarGroup-DhSPWemf.js} +1 -1
- package/dist/Banner/index.d.ts +1 -1
- package/dist/Banner/index.js +1 -1
- package/dist/{Banner-CVBNGDsD.js → Banner-DeauKxQw.js} +1 -1
- package/dist/BottomSheet/index.d.ts +1 -1
- package/dist/BottomSheet/index.js +2 -2
- package/dist/{BottomSheet-B3qXtKQj.js → BottomSheet-CRHPDrmS.js} +3 -3
- package/dist/{BottomSheet-C6vet4pm.js → BottomSheet-CYsGu9GP.js} +48 -18
- package/dist/Breadcrumbs/index.js +2 -2
- package/dist/{Breadcrumbs-B-w_yw-n.js → Breadcrumbs-nO9YHygD.js} +1 -1
- package/dist/Button/index.d.ts +1 -1
- package/dist/Button/index.js +1 -1
- package/dist/{Button-DTdlisqJ.js → Button-V6i-PeBt.js} +2 -2
- package/dist/ButtonGroup/index.d.ts +1 -1
- package/dist/ButtonGroup/index.js +1 -1
- package/dist/{ButtonGroup-Bjzs-HAG.js → ButtonGroup-CEDeeGkY.js} +2 -2
- 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-DjySyeDR.js → Carousel-5NYWpta1.js} +1 -1
- package/dist/Center/index.d.ts +1 -1
- package/dist/Chat/index.d.ts +1 -1
- package/dist/Chat/index.js +1 -1
- package/dist/{Chat-DQ6BGAvP.js → Chat-BRtDKajd.js} +231 -13
- package/dist/CheckboxInput/index.d.ts +1 -1
- package/dist/CheckboxInput/index.js +1 -1
- package/dist/{CheckboxInput-DSW8yq92.js → CheckboxInput-ixAs3zkT.js} +4 -4
- package/dist/CheckboxList/index.d.ts +1 -1
- package/dist/CheckboxList/index.js +1 -1
- package/dist/{CheckboxListItem-B2E2O1AE.js → CheckboxListItem-DoWYdLf-.js} +4 -4
- package/dist/ClickableCard/index.d.ts +1 -1
- package/dist/ClickableCard/index.js +1 -1
- package/dist/{ClickableCard-D4EGX9Dh.js → ClickableCard-DuOcbNlt.js} +1 -1
- package/dist/Code/index.js +2 -2
- package/dist/{Code-BqqB2kUM.js → Code-qHt8uZqb.js} +1 -1
- package/dist/{CodeBlock-D7ZJQV5Q.js → CodeBlock-2zigEFFD.js} +1 -1
- package/dist/Collapsible/index.d.ts +1 -1
- package/dist/Collapsible/index.js +1 -1
- package/dist/{Collapsible-C5xSG7oP.js → Collapsible-DfVihLCR.js} +2 -2
- package/dist/CommandPalette/index.d.ts +1 -1
- package/dist/CommandPalette/index.js +1 -1
- package/dist/{CommandPalette-BUNdrxrB.js → CommandPalette-D07roA0D.js} +2 -2
- package/dist/ComplexSelector/index.js +1 -1
- package/dist/{ComplexSelector-m9wi7E0j.js → ComplexSelector-7OdAby6v.js} +2 -2
- package/dist/ContextMenu/index.d.ts +1 -1
- package/dist/ContextMenu/index.js +2 -2
- package/dist/{ContextMenu-BEHfVIAq.js → ContextMenu-BIJyyObZ.js} +4 -4
- package/dist/DateInput/index.d.ts +1 -1
- package/dist/DateInput/index.js +1 -1
- package/dist/{DateInput-CHeetz7k.js → DateInput-BNKoPL3j.js} +4 -4
- package/dist/DateRangeInput/index.d.ts +1 -1
- package/dist/DateRangeInput/index.js +1 -1
- package/dist/{DateRangeInput-D524C1wc.js → DateRangeInput-CGDlPnUb.js} +3 -3
- package/dist/DateTimeInput/index.d.ts +1 -1
- package/dist/DateTimeInput/index.js +1 -1
- package/dist/{DateTimeInput-sEJ-bSXg.js → DateTimeInput-CRWUAh75.js} +5 -5
- package/dist/Dialog/index.d.ts +1 -1
- package/dist/Dialog/index.js +3 -3
- package/dist/{Dialog-DS3xE1B7.js → Dialog-BxijA4zr.js} +3 -3
- package/dist/{Dialog-nyLGClca.js → Dialog-CXa-tu02.js} +1 -1
- package/dist/{DialogHeader-u_AaZpyZ.js → DialogHeader-D7f97ksG.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-DqUdaZFh.js → Drawer-C3t7NKiF.js} +2 -2
- package/dist/DropdownMenu/index.js +2 -2
- package/dist/{DropdownMenu-DlAON5Jf.js → DropdownMenu-Bklf6ekH.js} +7 -7
- package/dist/Field/index.js +3 -3
- package/dist/{Field-YNS4XxpR.js → Field-CZndbiqR.js} +1 -1
- package/dist/{FieldInfoTip-DFlIBJlR.js → FieldInfoTip-Ii7lSYS8.js} +1 -1
- package/dist/{FieldLabel-i0gos7hU.js → FieldLabel-ru3qavED.js} +1 -1
- package/dist/FileInput/index.d.ts +1 -1
- package/dist/FileInput/index.js +1 -1
- package/dist/{FileInput-DYVzAtvz.js → FileInput-BtVTN7LN.js} +3 -3
- package/dist/HoverCard/index.d.ts +1 -1
- package/dist/IconButton/index.js +1 -1
- package/dist/{IconButton-DXt8DtsN.js → IconButton-4BXILpv-.js} +1 -1
- package/dist/InfoTip/index.d.ts +1 -1
- package/dist/InfoTip/index.js +1 -1
- package/dist/{InfoTip--fZOD0ux.js → InfoTip-D2MzKXZH.js} +1 -1
- package/dist/{InputClearButton-LF0iVTVF.js → InputClearButton-Cm5Q3KK2.js} +1 -1
- package/dist/InputGroup/index.js +1 -1
- package/dist/{InputGroup-D4CPVzo0.js → InputGroup-CjB_XpEy.js} +1 -1
- package/dist/{Item-BKISM91o.js → Item-CKYsTbM4.js} +1 -1
- package/dist/Layout/index.js +2 -2
- package/dist/{Layout-BwSvAsLi.js → Layout-BDS2ZN6C.js} +1 -1
- package/dist/{LayoutPanel-CmzJQpnL.js → LayoutPanel-D56PBM4I.js} +2 -2
- package/dist/Lightbox/index.js +1 -1
- package/dist/{Lightbox-B32Yh8Uy.js → Lightbox-CnTXrgq6.js} +3 -3
- package/dist/Link/index.d.ts +1 -1
- package/dist/Link/index.js +1 -1
- package/dist/{Link-DSXyw9MW.js → Link-BnM830Xa.js} +1 -1
- package/dist/List/index.d.ts +1 -1
- package/dist/List/index.js +2 -2
- package/dist/{ListItem-D3iEhvU2.js → ListItem-B1ztelEC.js} +2 -2
- package/dist/Markdown/index.d.ts +1 -1
- package/dist/Markdown/index.js +1 -1
- package/dist/{Markdown-BY5Bju8w.js → Markdown-JjZLAFq2.js} +2 -2
- package/dist/MobileNav/index.js +1 -1
- package/dist/{MobileNavToggle-sC6GPVKQ.js → MobileNavToggle-CjlgmcSf.js} +3 -3
- package/dist/MoreMenu/index.d.ts +1 -1
- package/dist/MoreMenu/index.js +1 -1
- package/dist/{MoreMenu-CcavOuxV.js → MoreMenu-CGTbwTyw.js} +4 -4
- package/dist/MultiSelector/index.d.ts +1 -1
- package/dist/MultiSelector/index.js +1 -1
- package/dist/{MultiSelector-Diu5zHbP.js → MultiSelector-BjFYfRqV.js} +4 -4
- package/dist/NavItem/index.d.ts +1 -1
- package/dist/NavItem/index.js +1 -1
- package/dist/{NavItem-DlW8noR6.js → NavItem-DTO-BEfc.js} +1 -1
- package/dist/NavMenu/index.js +2 -2
- package/dist/{NavMenu-J2kmtb1B.js → NavMenu-BflnhBtX.js} +1 -1
- package/dist/{NavMenuItem-DItNRTDZ.js → NavMenuItem-CrFrczWe.js} +2 -2
- package/dist/NumberInput/index.d.ts +1 -1
- package/dist/NumberInput/index.js +1 -1
- package/dist/{NumberInput-vhm5TQon.js → NumberInput-vWUcgJU8.js} +5 -3
- package/dist/Outline/index.js +1 -1
- package/dist/{Outline-CVIDd0fN.js → Outline-D4DJTfKp.js} +1 -1
- package/dist/OverflowList/index.d.ts +1 -1
- package/dist/OverflowList/index.js +1 -1
- package/dist/{OverflowList-DjWWBOkx.js → OverflowList-D9Ua6e3-.js} +1 -1
- package/dist/Overlay/index.d.ts +1 -1
- package/dist/Pagination/index.d.ts +1 -1
- package/dist/Pagination/index.js +1 -1
- package/dist/{Pagination-DKsePQjC.js → Pagination-DGcl38z9.js} +3 -3
- package/dist/{PanGestureRecognizer-C7hNunjF.js → PanGestureRecognizer-C-gk9mOy.js} +1 -1
- package/dist/{PickerWheel-Bf7xe6g6.js → PickerWheel-sIOSfcfO.js} +5 -5
- package/dist/Popover/index.d.ts +1 -1
- package/dist/Popover/index.js +1 -1
- package/dist/{Popover-CKgepPJ6.js → Popover-DlCqmkYD.js} +5 -5
- package/dist/PowerSearch/index.d.ts +1 -1
- package/dist/PowerSearch/index.js +1 -1
- package/dist/{PowerSearch-mYkORxjD.js → PowerSearch-BKhXYPRO.js} +19 -19
- package/dist/{PressTracker-DL75qEq_.js → PressTracker-CPRIrG4f.js} +2 -2
- package/dist/ProgressBar/index.d.ts +1 -1
- package/dist/Radio/index.d.ts +1 -1
- package/dist/Radio/index.js +1 -1
- package/dist/{RadioGroup-C-S-SnbH.js → RadioGroup-OLFNjvKt.js} +4 -4
- package/dist/RadioList/index.d.ts +1 -1
- package/dist/RadioList/index.js +1 -1
- package/dist/{RadioListItem-DzKVK4DZ.js → RadioListItem-BAEF0vc8.js} +1 -1
- package/dist/Resizable/index.d.ts +1 -1
- package/dist/Resizable/index.js +1 -1
- package/dist/{ResizeHandle-CaZEB4Py.js → ResizeHandle-Bd4TdK7E.js} +1 -1
- package/dist/ScrollableArea/index.d.ts +1 -1
- package/dist/SegmentedControl/index.d.ts +1 -1
- package/dist/SegmentedControl/index.js +1 -1
- package/dist/{SegmentedControl-Bp7dpEjn.js → SegmentedControl-C0xXOVTv.js} +8 -8
- package/dist/SelectableCard/index.d.ts +1 -1
- package/dist/SelectableCard/index.js +1 -1
- package/dist/{SelectableCard-DPWaUCGZ.js → SelectableCard-B2QbpWiT.js} +1 -1
- package/dist/Selector/index.d.ts +1 -1
- package/dist/Selector/index.js +1 -1
- package/dist/{Selector-CJmeuWhN.js → Selector-CHq3XHwH.js} +2 -2
- package/dist/SideNav/index.d.ts +1 -1
- package/dist/SideNav/index.js +1 -1
- package/dist/{SideNav-D-AQqNPx.js → SideNav-D8jQrwtL.js} +5 -5
- package/dist/Slider/index.js +1 -1
- package/dist/{Slider-DU-Yl3fd.js → Slider-Bd5fxqRa.js} +7 -7
- package/dist/Stack/index.d.ts +1 -1
- package/dist/Stepper/index.d.ts +1 -1
- package/dist/Stepper/index.js +1 -1
- package/dist/{Stepper-67SsxUne.js → Stepper-3oMdVe0c.js} +1 -1
- package/dist/Switch/index.d.ts +1 -1
- package/dist/Switch/index.js +1 -1
- package/dist/{Switch-C6qaebkX.js → Switch-COKmqJQU.js} +8 -8
- package/dist/TabList/index.d.ts +1 -1
- package/dist/TabList/index.js +1 -1
- package/dist/{TabList-TbJ6y1gN.js → TabList-DjRutwar.js} +2 -2
- package/dist/Table/index.d.ts +1 -1
- package/dist/Table/index.js +1 -1
- package/dist/{Table-DG_GVUF4.js → Table-waEj3x_o.js} +10 -10
- package/dist/TextArea/index.d.ts +1 -1
- package/dist/TextArea/index.js +1 -1
- package/dist/{TextArea-D6EtmxTk.js → TextArea-BtBC4IoD.js} +6 -4
- package/dist/TextInput/index.d.ts +1 -1
- package/dist/TextInput/index.js +1 -1
- package/dist/{TextInput-AngvgtdT.js → TextInput-cotkU2bC.js} +6 -4
- package/dist/Thumbnail/index.js +1 -1
- package/dist/{Thumbnail-DExkxw8a.js → Thumbnail-oqrKH-co.js} +2 -2
- package/dist/{TimeField-D5M2UxST.js → TimeField-BXQCZIwP.js} +3 -3
- package/dist/TimeInput/index.d.ts +1 -1
- package/dist/TimeInput/index.js +1 -1
- package/dist/{TimeInput-CvjvLrIh.js → TimeInput-C_ZssG1D.js} +2 -2
- package/dist/Timestamp/index.d.ts +1 -1
- package/dist/Timestamp/index.js +1 -1
- package/dist/{Timestamp-CeSb1A8c.js → Timestamp-CfzqAAX2.js} +1 -1
- package/dist/Toast/index.js +1 -1
- package/dist/{Toast-B2Fq-JYA.js → Toast-W6aKxXlF.js} +3 -3
- package/dist/ToggleButton/index.d.ts +1 -1
- package/dist/ToggleButton/index.js +1 -1
- package/dist/{ToggleButton-Bn8yLHbh.js → ToggleButton-Ditxp2jT.js} +3 -3
- package/dist/Token/index.js +1 -1
- package/dist/{Token-Dpxh42Mw.js → Token-Dk6MPUkH.js} +1 -1
- package/dist/Tokenizer/index.d.ts +1 -1
- package/dist/Tokenizer/index.js +1 -1
- package/dist/{Tokenizer-B3EnI98V.js → Tokenizer-hmGkGVG7.js} +7 -7
- package/dist/Toolbar/index.d.ts +1 -1
- package/dist/Tooltip/index.d.ts +1 -1
- package/dist/TopNav/index.d.ts +1 -1
- package/dist/TopNav/index.js +1 -1
- package/dist/{TopNav-D7mzM7pu.js → TopNav-D7jH9iwk.js} +3 -3
- package/dist/TreeList/index.js +1 -1
- package/dist/{TreeList-BmeXFFqr.js → TreeList-Dnx-uco3.js} +1 -1
- package/dist/Typeahead/index.d.ts +1 -1
- package/dist/Typeahead/index.js +1 -1
- package/dist/{Typeahead-kLp9UG-Q.js → Typeahead-Cx086Mmv.js} +3 -3
- package/dist/{accessibleName-Zr1_WoBg.js → accessibleName-CHrrgpAy.js} +2 -2
- package/dist/{boxHold-Bh1fTcXx.js → boxHold-D1G2s1tG.js} +4 -4
- package/dist/{browserClickWait-CiUtuWNK.js → browserClickWait-Cb550_M2.js} +2 -2
- package/dist/{clickGuard-Bd-jBj_G.js → clickGuard-BkegH2NW.js} +1 -1
- package/dist/composables/index.js +8 -8
- package/dist/{composables-Bb1xEruY.js → composables-CpG7bhuQ.js} +3 -3
- package/dist/{focusLeaving-DMkbxFkF.js → focusLeaving-BbZ69DYV.js} +1 -1
- package/dist/{focusReturn-DfZS7TCp.js → focusReturn-BeSRm0xD.js} +34 -3
- package/dist/{geometry-0e0f5Mjv.js → geometry-BRW7FETc.js} +6 -195
- package/dist/{haptics-DIfaJavG.js → haptics-BEgivjBd.js} +2 -2
- package/dist/{holdEntranceInput-DWqsAYll.js → holdEntranceInput-CROBPhuO.js} +1 -1
- package/dist/{index-BCAgC3fu.d.ts → index-BGUuyAMO.d.ts} +6 -6
- package/dist/{index-ZbNwGVkS.d.ts → index-BKnyTWPM.d.ts} +1 -1
- package/dist/{index-CBOv5j3c.d.ts → index-BQ3cm7mP.d.ts} +2 -2
- package/dist/{index-DlFmIGsl.d.ts → index-BRr4ANpr.d.ts} +9 -9
- package/dist/{index-DHUCHxn2.d.ts → index-BWWirRm3.d.ts} +1 -1
- package/dist/{index--kbwaSXW.d.ts → index-BWzEt0gT.d.ts} +2 -2
- package/dist/{index-ZKBj_1nu.d.ts → index-BfFpUr1B.d.ts} +1 -1
- package/dist/{index-BB9acgK8.d.ts → index-BgT6mH3U.d.ts} +1 -1
- package/dist/{index-CTjkJP4x.d.ts → index-Bgk1Rj2A.d.ts} +1 -1
- package/dist/{index-BDZCJ9ri.d.ts → index-BuubzuE8.d.ts} +2 -2
- package/dist/{index-CZ29Xu_E.d.ts → index-Bwh8O-v8.d.ts} +1 -1
- package/dist/{index-DXKtwGqX.d.ts → index-C0smuLQ8.d.ts} +83 -83
- package/dist/{index-BjqoHLMq.d.ts → index-C1e8LNx2.d.ts} +1 -1
- package/dist/{index-CEdv6aN_.d.ts → index-C6Iv6sgd.d.ts} +3 -3
- package/dist/{index-1yvu_vpF.d.ts → index-CAJMHw-g.d.ts} +4 -4
- package/dist/{index-0RIgvtdm.d.ts → index-CArP_6wv.d.ts} +1 -1
- package/dist/{index-DofC9Rll.d.ts → index-CJdOt5Cc.d.ts} +2 -2
- package/dist/{index-mK1ICsVg.d.ts → index-Cm36VS1A.d.ts} +2 -2
- package/dist/{index-C8wfe0Mr.d.ts → index-D05JGsT3.d.ts} +1 -1
- package/dist/{index-BKYQ4e7M.d.ts → index-D2B3ysZr.d.ts} +1 -1
- package/dist/{index-J83fLEyo.d.ts → index-DA3DMFds.d.ts} +4 -4
- package/dist/{index-Ak1b0V24.d.ts → index-DlH0BI35.d.ts} +1 -1
- package/dist/{index-DVX2jlTQ.d.ts → index-DsWEyz1N.d.ts} +3 -3
- package/dist/{index-DYabo8TI.d.ts → index-SWw-WMTO.d.ts} +2 -2
- package/dist/{index-COgrQZIL.d.ts → index-Xc3q9f84.d.ts} +3 -3
- package/dist/{index-C93nwgTW.d.ts → index-gmY3A_Iw.d.ts} +1 -1
- package/dist/{index-yQc-te9a.d.ts → index-ql9ApSTF.d.ts} +2 -2
- package/dist/index.d.ts +27 -27
- package/dist/index.js +87 -87
- package/dist/inputAge-C-SoLwpD.js +42 -0
- package/dist/{inputHold-CvjeOOWT.js → inputHold-B53XZ8if.js} +2 -2
- package/dist/{inputHoldState-Cg1r8Ib7.js → inputHoldState-Bav14W7v.js} +1 -1
- package/dist/{inputStream-DkMWPYac.js → inputStream-DmPkJ1aU.js} +24 -1
- package/dist/{layerFocusReturn-CEvrMbxH.js → layerFocusReturn-uixUCSc8.js} +1 -1
- package/dist/{lazyBottomSheet-DlHcPsAT.js → lazyBottomSheet-zUe1mYmM.js} +1 -1
- package/dist/{resizableChannel-CaaqGvXj.js → resizableChannel-DpbFJbto.js} +1 -1
- package/dist/rideKeyboard-BCzVooOd.js +1635 -0
- package/dist/{scrollView-DcPpdCrj.js → scrollView-BGBtu5JP.js} +2 -42
- package/dist/selectionRanges-DB5jesLz.js +194 -0
- package/dist/{springs-DjAn_oV5.js → springs-CPk0tpwL.js} +1 -1
- package/dist/{useActionGroupTracking-DjIdPbfL.js → useActionGroupTracking-C-nLjHyn.js} +3 -2
- package/dist/{useChatStreamScroll-DEp17Yq9.js → useChatStreamScroll-3mJvbNtI.js} +31 -5
- package/dist/{useFocusTrap-DcjriBe1.js → useFocusTrap-Bj9GskLh.js} +1 -1
- package/dist/{useGestureRecognizer-DDd-6Km-.js → useGestureRecognizer-Di-YKr93.js} +1 -1
- package/dist/{useInputStatusIcon-m6l4qBmA.js → useInputStatusIcon-CXP2kRSe.js} +1 -1
- package/dist/{useMenuEntranceHold-C4LOzKIS.js → useMenuEntranceHold-DMHMzaRW.js} +1 -1
- package/dist/{useMenuPress-BDPqPten.js → useMenuPress-kjmot8Bn.js} +4 -4
- package/dist/useMobileKeyboard-BDPV51xl.js +806 -0
- package/dist/{usePressFeedback-D2mWzgoJ.js → usePressFeedback-CF4ISMfb.js} +3 -2
- package/dist/{useResizable-Bwv-j_9N.js → useResizable-7-uUaJ7x.js} +2 -2
- package/dist/{useRestoreFocus-DS7uQWok.js → useRestoreFocus-m3rsqE4d.js} +1 -1
- package/dist/{useTouchHitArea-DL9D10Rq.js → useTouchHitArea-CkHMLZ34.js} +1 -1
- package/package.json +1 -1
- package/styles/bottom-sheet.css +16 -0
- package/styles/chat.css +6 -0
|
@@ -0,0 +1,806 @@
|
|
|
1
|
+
import { l as isNode, n as deepActiveElement, o as isDocument } from "./flatTree-BB4yPMNL.js";
|
|
2
|
+
import { t as SCROLLABLE_OVERFLOW } from "./scrollView-BGBtu5JP.js";
|
|
3
|
+
import { a as sharedState, o as sharedWeakMap } from "./sharedRealm-BYHklCVM.js";
|
|
4
|
+
import { a as subscribeInput } from "./inputStream-DmPkJ1aU.js";
|
|
5
|
+
import { t as useMediaQuery } from "./useMediaQuery-BzXGT1Aw.js";
|
|
6
|
+
import { t as animatorFor } from "./animator-Bptiubcx.js";
|
|
7
|
+
import { t as KEYBOARD_SPRING } from "./springs-CPk0tpwL.js";
|
|
8
|
+
import { t as TOUCH_QUERY } from "./touchQueries-xy5IeZfe.js";
|
|
9
|
+
import { t as useAttachment } from "./useAttachment-CGiD9rt6.js";
|
|
10
|
+
import { n as observeResize } from "./sharedResizeObserver-BekhnB3E.js";
|
|
11
|
+
import { A as riddenAnimators, C as hasOwnTranslate, D as nearestFixedAncestor, E as isMovedByApp, F as subscribeKeyboardHeight, I as layoutViewportHeight, M as getKeyboardHeight, N as isKeyboardMeasurable, O as registerKeyboardTarget, P as isTextEntryControl, S as followsKeyboard, T as isInsideKeyboardTarget, _ as refuseFocusReveal, a as revealWithKeyboard, b as fixedContainerOf, c as claimTapFocus, d as claimKeyboardScrollBack, f as stopKeyboardScrollBack, g as keyboardProfileOf, h as hidesField, i as revealDistance, j as findTextEntryControl, k as restingBottom, l as watchRevealPan, m as getKeyboardLayoutGuide, n as bandOf, o as scrollBy, p as bringsUpKeyboard, r as deliverTap, s as watchPans, t as rideKeyboard, u as distanceIntoBand, v as coveredBy, w as isDockedContainer, x as focusedFieldIn, y as drawnOffsetOf } from "./rideKeyboard-BCzVooOd.js";
|
|
12
|
+
import { readonly, shallowRef, toValue, watch } from "vue";
|
|
13
|
+
//#region src/utils/scrollingAncestor.ts
|
|
14
|
+
/**
|
|
15
|
+
* @file scrollingAncestor.ts
|
|
16
|
+
* @input An element, and an optional ancestor where the walk stops.
|
|
17
|
+
* @output The element's nearest ancestor that scrolls on the block axis, and
|
|
18
|
+
* `nearestScroller`, which falls back to the document's scroller.
|
|
19
|
+
* @position Shared by the keyboard module's reveals, Outline's scroll spy
|
|
20
|
+
* and the List reorder's edge autoscroll.
|
|
21
|
+
*/
|
|
22
|
+
/**
|
|
23
|
+
* The nearest ancestor of `element` that scrolls on the block axis: its
|
|
24
|
+
* `overflow-y` lets it scroll and its content is taller than its box. The walk
|
|
25
|
+
* ends after `bound` when one is given, and at the document's root otherwise.
|
|
26
|
+
* Null when no ancestor in that range scrolls.
|
|
27
|
+
*/
|
|
28
|
+
function scrollingAncestor(element, bound) {
|
|
29
|
+
const view = element.ownerDocument.defaultView;
|
|
30
|
+
if (view == null) return null;
|
|
31
|
+
for (let node = element.parentElement; node != null; node = node.parentElement) {
|
|
32
|
+
if (SCROLLABLE_OVERFLOW.has(view.getComputedStyle(node).overflowY) && node.scrollHeight > node.clientHeight) return node;
|
|
33
|
+
if (node === bound) return null;
|
|
34
|
+
}
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* The element that scrolls `element` into view: its nearest ancestor that
|
|
39
|
+
* scrolls on the block axis, or else the document's scroller.
|
|
40
|
+
*/
|
|
41
|
+
function nearestScroller(element) {
|
|
42
|
+
const doc = element.ownerDocument;
|
|
43
|
+
const scroller = scrollingAncestor(element);
|
|
44
|
+
return scroller == null || scroller === doc.body || scroller === doc.documentElement ? doc.scrollingElement ?? doc.documentElement : scroller;
|
|
45
|
+
}
|
|
46
|
+
//#endregion
|
|
47
|
+
//#region src/keyboard/keyboardRide.ts
|
|
48
|
+
function liftFor(target, animator, height, offset, win, isHostOwned) {
|
|
49
|
+
if (!isHostOwned && (!isDockedContainer(target) || isMovedByApp(target))) return 0;
|
|
50
|
+
const targetCovered = coveredBy(restingBottom(target, animator), height, 0, win);
|
|
51
|
+
const field = focusedFieldIn(target);
|
|
52
|
+
if (field != null) {
|
|
53
|
+
if (!isHostOwned) return targetCovered;
|
|
54
|
+
const fieldCovered = coveredBy(restingBottom(field, animator), height, offset, win);
|
|
55
|
+
return Math.max(targetCovered, fieldCovered);
|
|
56
|
+
}
|
|
57
|
+
if (isTextEntryControl(target.ownerDocument.activeElement)) return 0;
|
|
58
|
+
return animator.get("y") < 0 ? targetCovered : 0;
|
|
59
|
+
}
|
|
60
|
+
function exceedsRoom(container, height, win) {
|
|
61
|
+
return height > 1 && container.getBoundingClientRect().height > layoutViewportHeight(win) - height + 1;
|
|
62
|
+
}
|
|
63
|
+
function focusedScrollerIn(container) {
|
|
64
|
+
const field = focusedFieldIn(container);
|
|
65
|
+
const scroller = field == null ? null : scrollingAncestor(field, container);
|
|
66
|
+
return field == null || scroller == null ? null : {
|
|
67
|
+
field,
|
|
68
|
+
scroller
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
function fieldLift(target, animator, height, offset, win) {
|
|
72
|
+
if (!isDockedContainer(target) || isMovedByApp(target)) return 0;
|
|
73
|
+
const overlap = coveredBy(restingBottom(target, animator), height, 0, win);
|
|
74
|
+
const field = focusedFieldIn(target);
|
|
75
|
+
if (field == null) return isTextEntryControl(target.ownerDocument.activeElement) ? 0 : Math.min(Math.max(0, -animator.get("y")), overlap);
|
|
76
|
+
const need = coveredBy(restingBottom(field, animator), height, offset, win);
|
|
77
|
+
return Math.min(need, overlap);
|
|
78
|
+
}
|
|
79
|
+
function clearanceAtReport(target, animator, height, win) {
|
|
80
|
+
const field = focusedFieldIn(target);
|
|
81
|
+
if (field == null) return null;
|
|
82
|
+
const need = coveredBy(restingBottom(field, animator), height, 4, win);
|
|
83
|
+
return need > 0 ? -need : null;
|
|
84
|
+
}
|
|
85
|
+
const currentRides = sharedWeakMap("keyboard/keyboard-target/current-rides", 1);
|
|
86
|
+
function rideWithKeyboard(target, offset, win, isHostOwned) {
|
|
87
|
+
currentRides.get(target)?.();
|
|
88
|
+
const animator = animatorFor(target);
|
|
89
|
+
riddenAnimators.set(target, animator);
|
|
90
|
+
const guide = keyboardProfileOf(win) === "chromium" ? getKeyboardLayoutGuide(win) : null;
|
|
91
|
+
let state = "riding";
|
|
92
|
+
let stopReports = null;
|
|
93
|
+
let stopGuide = null;
|
|
94
|
+
const pans = watchPans(win, (focused) => target.contains(focused), guide != null);
|
|
95
|
+
let frame = 0;
|
|
96
|
+
let pendingSlide = null;
|
|
97
|
+
let stopFocusIns = () => {};
|
|
98
|
+
const end = () => {
|
|
99
|
+
state = "ended";
|
|
100
|
+
stopReports?.();
|
|
101
|
+
stopGuide?.();
|
|
102
|
+
stopReports = null;
|
|
103
|
+
stopGuide = null;
|
|
104
|
+
pans.stop();
|
|
105
|
+
stopFocusIns();
|
|
106
|
+
if (frame !== 0) {
|
|
107
|
+
win.cancelAnimationFrame(frame);
|
|
108
|
+
frame = 0;
|
|
109
|
+
}
|
|
110
|
+
if (currentRides.get(target) === end) currentRides.delete(target);
|
|
111
|
+
};
|
|
112
|
+
currentRides.set(target, end);
|
|
113
|
+
const place = (height, transition) => {
|
|
114
|
+
if (state === "ended") return;
|
|
115
|
+
const isTooTall = !isHostOwned && exceedsRoom(target, height, win);
|
|
116
|
+
const inside = isTooTall ? focusedScrollerIn(target) : null;
|
|
117
|
+
const lift = !isTooTall ? liftFor(target, animator, height, offset, win, isHostOwned) : inside == null ? fieldLift(target, animator, height, offset, win) : 0;
|
|
118
|
+
const y = lift > 0 ? -lift : 0;
|
|
119
|
+
const revealBy = inside == null ? 0 : revealDistance(inside.field, inside.scroller, height, offset, win, y - animator.get("y"));
|
|
120
|
+
if (inside != null && Math.abs(revealBy) > 1) scrollBy(inside.scroller, revealBy, win);
|
|
121
|
+
if (y !== 0 || animator.get("y") !== 0) {
|
|
122
|
+
if (transition == null) animator.set({ y });
|
|
123
|
+
else {
|
|
124
|
+
const atReport = transition.kind === "show" ? clearanceAtReport(target, animator, height, win) : null;
|
|
125
|
+
if (atReport != null && y < atReport && atReport < animator.get("y")) animator.set({ y: atReport });
|
|
126
|
+
rideKeyboard(animator, { y }, transition);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
if (state === "waiting" && height <= 1) end();
|
|
130
|
+
};
|
|
131
|
+
const placeOnNextFrame = (slide) => {
|
|
132
|
+
if (slide != null) pendingSlide = slide;
|
|
133
|
+
if (frame !== 0) return;
|
|
134
|
+
frame = win.requestAnimationFrame(() => {
|
|
135
|
+
frame = 0;
|
|
136
|
+
const next = pendingSlide;
|
|
137
|
+
pendingSlide = null;
|
|
138
|
+
place(next?.to ?? guide?.inset ?? getKeyboardHeight(win), next);
|
|
139
|
+
});
|
|
140
|
+
};
|
|
141
|
+
stopReports = subscribeKeyboardHeight(win, (event) => {
|
|
142
|
+
if (event.type === "viewport") {
|
|
143
|
+
if (guide == null) placeOnNextFrame(null);
|
|
144
|
+
pans.report(event.height);
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
if (guide != null) stopGuide = guide.subscribe(placeOnNextFrame);
|
|
148
|
+
stopFocusIns = subscribeInput(win, "focusin", () => placeOnNextFrame(null));
|
|
149
|
+
placeOnNextFrame(null);
|
|
150
|
+
return (isFinal = false) => {
|
|
151
|
+
if (state === "ended") return;
|
|
152
|
+
if (isFinal || getKeyboardHeight(win) <= 1) {
|
|
153
|
+
end();
|
|
154
|
+
if (animator.get("y") !== 0) animator.set({ y: 0 });
|
|
155
|
+
} else state = "waiting";
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
//#endregion
|
|
159
|
+
//#region src/keyboard/keyboardTarget.ts
|
|
160
|
+
/**
|
|
161
|
+
* Keeps the focused field inside `target` above the keyboard until the
|
|
162
|
+
* returned call. `'ride'` moves `target` with the keyboard, on its slide
|
|
163
|
+
* where the browser reports one. `'reveal'` scrolls the field into place in
|
|
164
|
+
* `target`, a scroller. The target claims focus moves into its fields, so the
|
|
165
|
+
* browser never pans the page to them, and it registers as a keyboard target.
|
|
166
|
+
*
|
|
167
|
+
* @example
|
|
168
|
+
* ```
|
|
169
|
+
* const stop = followKeyboard(dock, {move: 'ride', offset: FIELD_OFFSET});
|
|
170
|
+
* ```
|
|
171
|
+
*/
|
|
172
|
+
function followKeyboard(target, { move, offset }) {
|
|
173
|
+
const doc = target.ownerDocument;
|
|
174
|
+
const win = doc.defaultView;
|
|
175
|
+
if (!followsKeyboard(win)) return () => {};
|
|
176
|
+
const unregister = registerKeyboardTarget(target);
|
|
177
|
+
const stopScrollBack = claimKeyboardScrollBack(win);
|
|
178
|
+
const stopClaim = refuseFocusReveal(doc, { claim: (destination) => destination instanceof win.HTMLElement && destination !== target && target.contains(destination) && isTextEntryControl(destination) ? destination : null });
|
|
179
|
+
const stopTaps = claimTapFocus(target, {
|
|
180
|
+
claim: (touched) => {
|
|
181
|
+
const control = findTextEntryControl(touched, target);
|
|
182
|
+
return control != null && control !== doc.activeElement ? control : null;
|
|
183
|
+
},
|
|
184
|
+
deliver: deliverTap
|
|
185
|
+
});
|
|
186
|
+
const stopMoving = move === "ride" ? rideWithKeyboard(target, offset, win, true) : revealWithKeyboard(target, () => focusedFieldIn(target), target, offset, win);
|
|
187
|
+
return () => {
|
|
188
|
+
stopMoving(true);
|
|
189
|
+
stopTaps();
|
|
190
|
+
stopClaim();
|
|
191
|
+
stopScrollBack();
|
|
192
|
+
unregister();
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
function canBringUp(field, scroller, offset, win) {
|
|
196
|
+
const range = scroller.scrollHeight - scroller.clientHeight - scroller.scrollTop;
|
|
197
|
+
const box = field.getBoundingClientRect();
|
|
198
|
+
if (range < box.top - scroller.getBoundingClientRect().top - 1) return false;
|
|
199
|
+
const height = getKeyboardHeight(win);
|
|
200
|
+
if (height <= 1) return true;
|
|
201
|
+
const band = bandOf(scroller, height, offset, win);
|
|
202
|
+
return band.bottom - band.top >= box.height - 1;
|
|
203
|
+
}
|
|
204
|
+
function placementOf(field, offset, win) {
|
|
205
|
+
if (isInsideKeyboardTarget(field)) return null;
|
|
206
|
+
const container = fixedContainerOf(field);
|
|
207
|
+
if (container === "floating" || container === "fills-viewport") return revealWithin(field, nearestFixedAncestor(field), offset, win);
|
|
208
|
+
if (container == null) {
|
|
209
|
+
const scroller = nearestScroller(field);
|
|
210
|
+
return scroller.scrollHeight > scroller.clientHeight ? {
|
|
211
|
+
reveal: scroller,
|
|
212
|
+
unplaced: "document"
|
|
213
|
+
} : null;
|
|
214
|
+
}
|
|
215
|
+
const view = field.ownerDocument.defaultView;
|
|
216
|
+
return view != null && hasOwnTranslate(container.docked, view) ? revealWithin(field, container.docked, offset, win) : { ride: container.docked };
|
|
217
|
+
}
|
|
218
|
+
function revealWithin(field, container, offset, win) {
|
|
219
|
+
const scroller = container == null ? null : scrollingAncestor(field, container);
|
|
220
|
+
return scroller == null || !canBringUp(field, scroller, offset, win) ? null : {
|
|
221
|
+
reveal: scroller,
|
|
222
|
+
unplaced: "fixed"
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* Keeps `field` above the on-screen keyboard until the returned call. On focus,
|
|
227
|
+
* `placementOf` decides who moves it. A claimed focus move or tap arrives
|
|
228
|
+
* without the browser's reveal. Where no placement fits, the browser's own
|
|
229
|
+
* reveal stays.
|
|
230
|
+
*
|
|
231
|
+
* @example
|
|
232
|
+
* ```
|
|
233
|
+
* const stop = keepFieldAboveKeyboard(input);
|
|
234
|
+
* ```
|
|
235
|
+
*/
|
|
236
|
+
function keepFieldAboveKeyboard(field, { offset = 10 } = {}) {
|
|
237
|
+
const doc = field.ownerDocument;
|
|
238
|
+
const win = doc.defaultView;
|
|
239
|
+
if (!followsKeyboard(win)) return () => {};
|
|
240
|
+
const stopScrollBack = claimKeyboardScrollBack(win);
|
|
241
|
+
const stopClaim = refuseFocusReveal(doc, { claim: (destination) => destination === field && placementOf(field, offset, win) != null ? field : null });
|
|
242
|
+
const stopTaps = claimTapFocus(field, {
|
|
243
|
+
claim: () => doc.activeElement !== field && placementOf(field, offset, win) != null ? field : null,
|
|
244
|
+
deliver: deliverTap
|
|
245
|
+
});
|
|
246
|
+
let stopSession = null;
|
|
247
|
+
let stoppedSession = null;
|
|
248
|
+
const onFocus = () => {
|
|
249
|
+
if (stopSession != null) return;
|
|
250
|
+
const placement = placementOf(field, offset, win);
|
|
251
|
+
if (placement == null) return;
|
|
252
|
+
stopKeyboardScrollBack(win);
|
|
253
|
+
stopSession = "ride" in placement ? rideWithKeyboard(placement.ride, offset, win, false) : revealWithKeyboard(field, () => doc.activeElement === field ? field : null, placement.reveal, offset, win, placement.unplaced);
|
|
254
|
+
};
|
|
255
|
+
const onBlur = () => {
|
|
256
|
+
stopSession?.();
|
|
257
|
+
stoppedSession = stopSession ?? stoppedSession;
|
|
258
|
+
stopSession = null;
|
|
259
|
+
};
|
|
260
|
+
field.addEventListener("focus", onFocus);
|
|
261
|
+
field.addEventListener("blur", onBlur);
|
|
262
|
+
if (doc.activeElement === field) onFocus();
|
|
263
|
+
return () => {
|
|
264
|
+
field.removeEventListener("focus", onFocus);
|
|
265
|
+
field.removeEventListener("blur", onBlur);
|
|
266
|
+
stopSession?.(true);
|
|
267
|
+
stoppedSession?.(true);
|
|
268
|
+
stopSession = null;
|
|
269
|
+
stoppedSession = null;
|
|
270
|
+
stopTaps();
|
|
271
|
+
stopClaim();
|
|
272
|
+
stopScrollBack();
|
|
273
|
+
};
|
|
274
|
+
}
|
|
275
|
+
//#endregion
|
|
276
|
+
//#region src/keyboard/sheetKeyboardBody.ts
|
|
277
|
+
/**
|
|
278
|
+
* The custom property on the body's content box that holds the keyboard's
|
|
279
|
+
* inset, CSS px. The sheet's stylesheet lays it out as the content box's
|
|
280
|
+
* `::after` block size, after the content's own children.
|
|
281
|
+
*/
|
|
282
|
+
const KEYBOARD_INSET_PROPERTY = "--_keyboard-inset";
|
|
283
|
+
/** The keyboard's top in the layout viewport, CSS px. */
|
|
284
|
+
function getObstructionTop() {
|
|
285
|
+
return layoutViewportHeight(window) - getKeyboardHeight(window);
|
|
286
|
+
}
|
|
287
|
+
function overlapOf(bodyBottom, obstructionTop) {
|
|
288
|
+
const overlap = bodyBottom - obstructionTop;
|
|
289
|
+
return overlap > 1 ? overlap : 0;
|
|
290
|
+
}
|
|
291
|
+
function isVisualViewportRecovered() {
|
|
292
|
+
return getKeyboardHeight(window) <= .5;
|
|
293
|
+
}
|
|
294
|
+
function mayKeepKeyboard() {
|
|
295
|
+
const target = deepActiveElement(document);
|
|
296
|
+
return target != null && (bringsUpKeyboard(target) || hidesField(target));
|
|
297
|
+
}
|
|
298
|
+
/** The focused text-entry control inside `body`, if any. */
|
|
299
|
+
function focusedControlIn(body) {
|
|
300
|
+
const active = document.activeElement;
|
|
301
|
+
return active instanceof HTMLElement && body.contains(active) && isTextEntryControl(active) ? active : null;
|
|
302
|
+
}
|
|
303
|
+
/** Creates the body's side of a sheet that reserves the keyboard's inset. */
|
|
304
|
+
function createSheetKeyboardBody({ body, offset, isExpanded, layout, guide, ownsFocusTransitions, onInset }) {
|
|
305
|
+
let laidOutInset = 0;
|
|
306
|
+
let insetRange = 0;
|
|
307
|
+
const content = () => {
|
|
308
|
+
const first = body.firstElementChild;
|
|
309
|
+
return first instanceof HTMLElement ? first : null;
|
|
310
|
+
};
|
|
311
|
+
const writeInset = (inset) => {
|
|
312
|
+
const changes = inset !== laidOutInset;
|
|
313
|
+
const rangeBefore = changes ? body.scrollHeight : 0;
|
|
314
|
+
laidOutInset = inset;
|
|
315
|
+
const box = content();
|
|
316
|
+
const value = inset > 0 ? `${inset}px` : "";
|
|
317
|
+
if (box != null && box.style.getPropertyValue("--_keyboard-inset") !== value) {
|
|
318
|
+
if (inset > 0) box.style.setProperty(KEYBOARD_INSET_PROPERTY, value);
|
|
319
|
+
else box.style.removeProperty(KEYBOARD_INSET_PROPERTY);
|
|
320
|
+
}
|
|
321
|
+
onInset(inset);
|
|
322
|
+
if (changes) insetRange = inset === 0 ? 0 : Math.max(0, insetRange + body.scrollHeight - rangeBefore);
|
|
323
|
+
};
|
|
324
|
+
const self = {
|
|
325
|
+
keyboardGeometry: null,
|
|
326
|
+
smoothTarget: null,
|
|
327
|
+
documentScrollAtKeyboard: null,
|
|
328
|
+
keyboardObstructionTop: null,
|
|
329
|
+
bodyScrollTopAtKeyboard: null,
|
|
330
|
+
writeInset,
|
|
331
|
+
clearKeyboardLayout: () => {
|
|
332
|
+
writeInset(0);
|
|
333
|
+
if (self.bodyScrollTopAtKeyboard != null) {
|
|
334
|
+
self.smoothTarget = null;
|
|
335
|
+
body.scrollTop = self.bodyScrollTopAtKeyboard;
|
|
336
|
+
}
|
|
337
|
+
self.keyboardGeometry = null;
|
|
338
|
+
self.keyboardObstructionTop = null;
|
|
339
|
+
self.bodyScrollTopAtKeyboard = null;
|
|
340
|
+
self.documentScrollAtKeyboard = null;
|
|
341
|
+
layout.hasLayout = false;
|
|
342
|
+
layout.retainLayout = false;
|
|
343
|
+
},
|
|
344
|
+
scrollControlIntoSafeArea: (control, smoothly, ride = null) => {
|
|
345
|
+
const measuredBodyRect = body.getBoundingClientRect();
|
|
346
|
+
const measuredControlRect = control.getBoundingClientRect();
|
|
347
|
+
const obstructionTop = getObstructionTop();
|
|
348
|
+
const clearance = overlapOf(measuredBodyRect.bottom, obstructionTop) > 0 ? offset : 0;
|
|
349
|
+
const safeTop = measuredBodyRect.top;
|
|
350
|
+
const safeBottom = Math.min(measuredBodyRect.bottom, obstructionTop - clearance);
|
|
351
|
+
const pending = self.smoothDistanceLeft() + self.rideOffset();
|
|
352
|
+
const controlBottom = measuredControlRect.bottom - pending;
|
|
353
|
+
const controlTop = measuredControlRect.top - pending;
|
|
354
|
+
const distance = distanceIntoBand(controlTop, controlBottom, safeTop, safeBottom);
|
|
355
|
+
if (distance > 0) scrollBodyBy(distance, smoothly, ride, Math.max(0, obstructionTop - safeBottom - 4));
|
|
356
|
+
else if (distance < 0) scrollBodyBy(distance, smoothly, ride);
|
|
357
|
+
},
|
|
358
|
+
smoothDistanceLeft: () => {
|
|
359
|
+
if (self.smoothTarget == null) return 0;
|
|
360
|
+
const maxScroll = Math.max(body.scrollTop, body.scrollHeight - body.clientHeight);
|
|
361
|
+
const left = Math.min(self.smoothTarget, maxScroll) - body.scrollTop;
|
|
362
|
+
return Math.abs(left) < 1 ? 0 : left;
|
|
363
|
+
},
|
|
364
|
+
applyKeyboardGeometry: (geometry) => {
|
|
365
|
+
const obstructionTop = getObstructionTop();
|
|
366
|
+
if (isVisualViewportRecovered()) {
|
|
367
|
+
self.clearKeyboardLayout();
|
|
368
|
+
return;
|
|
369
|
+
}
|
|
370
|
+
if (overlapOf(geometry.bodyBottom, obstructionTop) === 0) {
|
|
371
|
+
self.clearKeyboardLayout();
|
|
372
|
+
return;
|
|
373
|
+
}
|
|
374
|
+
writeInset(Math.max(0, geometry.bodyBottom - (obstructionTop - offset)));
|
|
375
|
+
},
|
|
376
|
+
restingScrollTop: () => {
|
|
377
|
+
const scrollTop = body.scrollTop;
|
|
378
|
+
const maxAtRest = Math.max(0, body.scrollHeight - insetRange - body.clientHeight);
|
|
379
|
+
let resting = Math.min(maxAtRest, self.bodyScrollTopAtKeyboard ?? scrollTop);
|
|
380
|
+
const active = focusedControlIn(body);
|
|
381
|
+
if (isExpanded() && active != null) {
|
|
382
|
+
const bodyRect = body.getBoundingClientRect();
|
|
383
|
+
const rect = active.getBoundingClientRect();
|
|
384
|
+
const shift = scrollTop - resting - self.rideOffset();
|
|
385
|
+
if (rect.bottom + shift > bodyRect.bottom) resting += rect.bottom + shift - bodyRect.bottom;
|
|
386
|
+
else if (rect.top + shift < bodyRect.top) resting += rect.top + shift - bodyRect.top;
|
|
387
|
+
resting = Math.min(maxAtRest, Math.max(0, resting));
|
|
388
|
+
}
|
|
389
|
+
return resting;
|
|
390
|
+
},
|
|
391
|
+
contentAnimator: () => {
|
|
392
|
+
const box = content();
|
|
393
|
+
return guide != null && box != null ? animatorFor(box) : null;
|
|
394
|
+
},
|
|
395
|
+
unguidedAnimator: () => {
|
|
396
|
+
const box = content();
|
|
397
|
+
return ownsFocusTransitions && guide == null && box != null ? animatorFor(box) : null;
|
|
398
|
+
},
|
|
399
|
+
rideOffset: () => {
|
|
400
|
+
const box = content();
|
|
401
|
+
return box != null ? drawnOffsetOf(box) : 0;
|
|
402
|
+
},
|
|
403
|
+
showOnSlide: (atReport) => {
|
|
404
|
+
const transition = guide?.transition;
|
|
405
|
+
return transition != null && transition.kind === "show" && transition.animated && transition.curve != null && (atReport || performance.now() < transition.start + transition.curve.durationMs) ? transition : null;
|
|
406
|
+
}
|
|
407
|
+
};
|
|
408
|
+
function scrollBodyBy(distance, smoothly, ride = null, within = null) {
|
|
409
|
+
self.smoothTarget = null;
|
|
410
|
+
const animator = ride == null ? null : self.contentAnimator();
|
|
411
|
+
if (ride != null && animator != null) {
|
|
412
|
+
const before = body.scrollTop;
|
|
413
|
+
body.scrollTop = before + distance;
|
|
414
|
+
const moved = body.scrollTop - before;
|
|
415
|
+
if (moved !== 0) {
|
|
416
|
+
const from = animator.get("y", ride.start) + moved;
|
|
417
|
+
animator.set({ y: within == null ? from : Math.min(from, within) });
|
|
418
|
+
rideKeyboard(animator, { y: 0 }, ride, { entrance: within != null });
|
|
419
|
+
}
|
|
420
|
+
return;
|
|
421
|
+
}
|
|
422
|
+
if (typeof body.scrollBy !== "function") {
|
|
423
|
+
body.scrollTop += distance;
|
|
424
|
+
return;
|
|
425
|
+
}
|
|
426
|
+
const reduceMotion = typeof window.matchMedia === "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
427
|
+
const behavior = smoothly && !reduceMotion ? "smooth" : "instant";
|
|
428
|
+
if (behavior === "smooth") self.smoothTarget = body.scrollTop + distance;
|
|
429
|
+
body.scrollBy({
|
|
430
|
+
top: distance,
|
|
431
|
+
behavior
|
|
432
|
+
});
|
|
433
|
+
}
|
|
434
|
+
return self;
|
|
435
|
+
}
|
|
436
|
+
//#endregion
|
|
437
|
+
//#region src/keyboard/sheetKeyboardHold.ts
|
|
438
|
+
function rideKeyboardSpring(animator, y) {
|
|
439
|
+
return animator.animate({ y }, { spring: KEYBOARD_SPRING });
|
|
440
|
+
}
|
|
441
|
+
/** Creates how a sheet's content moves while the keyboard goes. */
|
|
442
|
+
function createSheetKeyboardHolds({ body, keyboard, layout, guide, reveal }) {
|
|
443
|
+
let heldHide = null;
|
|
444
|
+
const keepDrawnPlace = () => {
|
|
445
|
+
const animator = keyboard.unguidedAnimator();
|
|
446
|
+
if (animator == null) return () => {};
|
|
447
|
+
const drawnBefore = animator.get("y") - body.scrollTop;
|
|
448
|
+
return () => {
|
|
449
|
+
const y = drawnBefore + body.scrollTop;
|
|
450
|
+
if (Math.abs(y - animator.get("y")) < .5) return;
|
|
451
|
+
animator.set({ y });
|
|
452
|
+
rideKeyboardSpring(animator, 0);
|
|
453
|
+
};
|
|
454
|
+
};
|
|
455
|
+
const holdThroughUnguidedHide = () => {
|
|
456
|
+
const animator = keyboard.unguidedAnimator();
|
|
457
|
+
if (animator == null || heldHide != null) return;
|
|
458
|
+
const drop = body.scrollTop - keyboard.restingScrollTop();
|
|
459
|
+
if (drop === 0) return;
|
|
460
|
+
const hold = {
|
|
461
|
+
release: () => {
|
|
462
|
+
if (heldHide === hold) heldHide = null;
|
|
463
|
+
},
|
|
464
|
+
onReveal: () => {
|
|
465
|
+
const active = document.activeElement;
|
|
466
|
+
if (active instanceof HTMLElement && body.contains(active) && mayKeepKeyboard()) {
|
|
467
|
+
hold.release();
|
|
468
|
+
rideKeyboardSpring(animator, 0);
|
|
469
|
+
return true;
|
|
470
|
+
}
|
|
471
|
+
if (isVisualViewportRecovered()) {
|
|
472
|
+
hold.release();
|
|
473
|
+
const y = animator.get("y");
|
|
474
|
+
const velocity = animator.getVelocity("y");
|
|
475
|
+
const scrollBefore = body.scrollTop;
|
|
476
|
+
keyboard.clearKeyboardLayout();
|
|
477
|
+
const shift = scrollBefore - body.scrollTop;
|
|
478
|
+
if (Math.abs(y - shift) < .5) animator.set({ y: 0 });
|
|
479
|
+
else {
|
|
480
|
+
animator.set({ y: y - shift });
|
|
481
|
+
animator.animate({ y: 0 }, {
|
|
482
|
+
spring: KEYBOARD_SPRING,
|
|
483
|
+
velocity: { y: velocity }
|
|
484
|
+
});
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
return false;
|
|
488
|
+
}
|
|
489
|
+
};
|
|
490
|
+
heldHide = hold;
|
|
491
|
+
rideKeyboardSpring(animator, drop);
|
|
492
|
+
};
|
|
493
|
+
const holdInsetThrough = (transition) => {
|
|
494
|
+
heldHide?.release();
|
|
495
|
+
const animator = keyboard.contentAnimator();
|
|
496
|
+
const drop = body.scrollTop - keyboard.restingScrollTop();
|
|
497
|
+
const handle = animator != null && drop !== 0 ? rideKeyboard(animator, { y: drop }, transition) : null;
|
|
498
|
+
let timer;
|
|
499
|
+
let landed = false;
|
|
500
|
+
const commit = () => {
|
|
501
|
+
reveal();
|
|
502
|
+
animator?.set({ y: 0 });
|
|
503
|
+
};
|
|
504
|
+
const hold = {
|
|
505
|
+
release: () => {
|
|
506
|
+
clearTimeout(timer);
|
|
507
|
+
if (heldHide === hold) heldHide = null;
|
|
508
|
+
},
|
|
509
|
+
onReveal: () => {
|
|
510
|
+
if (landed && isVisualViewportRecovered()) {
|
|
511
|
+
hold.release();
|
|
512
|
+
commit();
|
|
513
|
+
}
|
|
514
|
+
return false;
|
|
515
|
+
}
|
|
516
|
+
};
|
|
517
|
+
heldHide = hold;
|
|
518
|
+
const land = () => {
|
|
519
|
+
if (heldHide !== hold) return;
|
|
520
|
+
landed = true;
|
|
521
|
+
if (layout.hasLayout && !isVisualViewportRecovered()) return;
|
|
522
|
+
hold.release();
|
|
523
|
+
commit();
|
|
524
|
+
};
|
|
525
|
+
if (handle == null) {
|
|
526
|
+
const end = transition.start + (transition.curve?.durationMs ?? 0);
|
|
527
|
+
timer = setTimeout(land, Math.max(0, end - performance.now()));
|
|
528
|
+
} else handle.finished.then(land);
|
|
529
|
+
};
|
|
530
|
+
return {
|
|
531
|
+
blocksReveal: () => heldHide != null && heldHide.onReveal?.() !== true,
|
|
532
|
+
keepDrawnPlace,
|
|
533
|
+
holdThroughUnguidedHide,
|
|
534
|
+
followGuide: () => guide?.subscribe((transition) => {
|
|
535
|
+
if (transition.curve == null) return;
|
|
536
|
+
if (transition.kind === "hide") {
|
|
537
|
+
if (layout.hasLayout && transition.animated) holdInsetThrough(transition);
|
|
538
|
+
return;
|
|
539
|
+
}
|
|
540
|
+
if (heldHide != null) {
|
|
541
|
+
heldHide.release();
|
|
542
|
+
const animator = keyboard.contentAnimator();
|
|
543
|
+
if (animator != null) rideKeyboard(animator, { y: 0 }, transition);
|
|
544
|
+
}
|
|
545
|
+
}) ?? (() => {}),
|
|
546
|
+
stop: () => {
|
|
547
|
+
heldHide?.release();
|
|
548
|
+
(keyboard.contentAnimator() ?? keyboard.unguidedAnimator())?.set({ y: 0 });
|
|
549
|
+
}
|
|
550
|
+
};
|
|
551
|
+
}
|
|
552
|
+
//#endregion
|
|
553
|
+
//#region src/keyboard/sheetKeyboard.ts
|
|
554
|
+
const reveals = sharedState("keyboard/use-mobile-keyboard/reveals-at-report", 1, () => ({ atReport: /* @__PURE__ */ new WeakSet() }));
|
|
555
|
+
/**
|
|
556
|
+
* Keeps a focused field in `sheet`'s `body` above the on-screen keyboard.
|
|
557
|
+
* Returns the release.
|
|
558
|
+
*/
|
|
559
|
+
function attachSheetKeyboard(sheet, body, { offset, isExpanded, isOpen, isPageScrollLocked, isTouch, layout, onInset }) {
|
|
560
|
+
const unregister = registerKeyboardTarget(sheet);
|
|
561
|
+
const guide = isTouch && keyboardProfileOf(window) === "chromium" ? getKeyboardLayoutGuide(window) : null;
|
|
562
|
+
const ownsFocusTransitions = isTouch && isKeyboardMeasurable(window);
|
|
563
|
+
const keyboard = createSheetKeyboardBody({
|
|
564
|
+
body,
|
|
565
|
+
offset,
|
|
566
|
+
isExpanded,
|
|
567
|
+
layout,
|
|
568
|
+
guide,
|
|
569
|
+
ownsFocusTransitions,
|
|
570
|
+
onInset
|
|
571
|
+
});
|
|
572
|
+
const holds = createSheetKeyboardHolds({
|
|
573
|
+
body,
|
|
574
|
+
keyboard,
|
|
575
|
+
layout,
|
|
576
|
+
guide,
|
|
577
|
+
reveal: () => revealFocusedControl()
|
|
578
|
+
});
|
|
579
|
+
const claimFocusTransitions = () => refuseFocusReveal(document, {
|
|
580
|
+
isActive: isExpanded,
|
|
581
|
+
claim: (destination) => findTextEntryControl(destination, body),
|
|
582
|
+
park: (origin) => {
|
|
583
|
+
if (isOpen() && findTextEntryControl(origin, body)) sheet.focus({ preventScroll: true });
|
|
584
|
+
}
|
|
585
|
+
});
|
|
586
|
+
function revealFocusedControl(atReport = false) {
|
|
587
|
+
if (holds.blocksReveal()) return;
|
|
588
|
+
const obstructionTop = getObstructionTop();
|
|
589
|
+
const focusedControl = focusedControlIn(body);
|
|
590
|
+
if (layout.hasLayout && isVisualViewportRecovered()) {
|
|
591
|
+
const settle = holds.keepDrawnPlace();
|
|
592
|
+
keyboard.clearKeyboardLayout();
|
|
593
|
+
if (isExpanded() && focusedControl != null) keyboard.scrollControlIntoSafeArea(focusedControl, false);
|
|
594
|
+
settle();
|
|
595
|
+
return;
|
|
596
|
+
}
|
|
597
|
+
if (!isExpanded() || focusedControl == null) {
|
|
598
|
+
if (layout.retainLayout && keyboard.keyboardGeometry) {
|
|
599
|
+
const settle = holds.keepDrawnPlace();
|
|
600
|
+
keyboard.applyKeyboardGeometry(keyboard.keyboardGeometry);
|
|
601
|
+
settle();
|
|
602
|
+
if (isExpanded() && layout.hasLayout && !mayKeepKeyboard()) holds.holdThroughUnguidedHide();
|
|
603
|
+
return;
|
|
604
|
+
}
|
|
605
|
+
keyboard.clearKeyboardLayout();
|
|
606
|
+
return;
|
|
607
|
+
}
|
|
608
|
+
if (layout.hasLayout && keyboard.keyboardObstructionTop != null && obstructionTop > keyboard.keyboardObstructionTop + .5 && keyboard.bodyScrollTopAtKeyboard != null) {
|
|
609
|
+
keyboard.smoothTarget = null;
|
|
610
|
+
body.scrollTop = keyboard.bodyScrollTopAtKeyboard;
|
|
611
|
+
keyboard.keyboardObstructionTop = obstructionTop;
|
|
612
|
+
}
|
|
613
|
+
layout.retainLayout = false;
|
|
614
|
+
const measuredBodyRect = body.getBoundingClientRect();
|
|
615
|
+
const overlap = overlapOf(measuredBodyRect.bottom, obstructionTop);
|
|
616
|
+
const clearance = overlap > 0 ? offset : 0;
|
|
617
|
+
keyboard.keyboardGeometry = overlap > 0 ? { bodyBottom: measuredBodyRect.bottom } : null;
|
|
618
|
+
if (overlap > 0 && !layout.hasLayout) {
|
|
619
|
+
keyboard.keyboardObstructionTop = obstructionTop;
|
|
620
|
+
keyboard.bodyScrollTopAtKeyboard = body.scrollTop;
|
|
621
|
+
if (isPageScrollLocked) keyboard.documentScrollAtKeyboard = {
|
|
622
|
+
x: window.scrollX,
|
|
623
|
+
y: window.scrollY
|
|
624
|
+
};
|
|
625
|
+
}
|
|
626
|
+
layout.hasLayout = overlap > 0;
|
|
627
|
+
keyboard.writeInset(overlap > 0 ? Math.max(0, measuredBodyRect.bottom - (obstructionTop - clearance)) : 0);
|
|
628
|
+
keyboard.scrollControlIntoSafeArea(focusedControl, overlap > 0 && !reveals.atReport.has(window), overlap > 0 ? keyboard.showOnSlide(atReport) : null);
|
|
629
|
+
}
|
|
630
|
+
const unsubscribeGuide = holds.followGuide();
|
|
631
|
+
let animationFrame = 0;
|
|
632
|
+
const scheduleReveal = () => {
|
|
633
|
+
cancelAnimationFrame(animationFrame);
|
|
634
|
+
animationFrame = requestAnimationFrame(() => revealFocusedControl());
|
|
635
|
+
};
|
|
636
|
+
const handleDocumentScroll = () => {
|
|
637
|
+
const expected = keyboard.documentScrollAtKeyboard;
|
|
638
|
+
if (expected == null || window.scrollX === expected.x && window.scrollY === expected.y) return;
|
|
639
|
+
window.scrollTo(expected.x, expected.y);
|
|
640
|
+
const focused = focusedControlIn(body);
|
|
641
|
+
if (focused != null) keyboard.scrollControlIntoSafeArea(focused, false);
|
|
642
|
+
};
|
|
643
|
+
let stopObserving = [];
|
|
644
|
+
const refreshObservedLayout = () => {
|
|
645
|
+
if (typeof ResizeObserver === "undefined") return;
|
|
646
|
+
for (const stop of stopObserving) stop();
|
|
647
|
+
stopObserving = [];
|
|
648
|
+
const targets = /* @__PURE__ */ new Set([body, sheet]);
|
|
649
|
+
for (const child of body.children) targets.add(child);
|
|
650
|
+
const activeElement = document.activeElement;
|
|
651
|
+
if (activeElement instanceof HTMLElement && body.contains(activeElement)) for (let element = activeElement; element && element !== body; element = element.parentElement) targets.add(element);
|
|
652
|
+
for (const target of targets) stopObserving.push(observeResize(target, scheduleReveal));
|
|
653
|
+
};
|
|
654
|
+
const mutationObserver = typeof MutationObserver === "undefined" ? null : new MutationObserver((records) => {
|
|
655
|
+
if (records.every((record) => record.type === "attributes" && record.target === body)) return;
|
|
656
|
+
refreshObservedLayout();
|
|
657
|
+
scheduleReveal();
|
|
658
|
+
});
|
|
659
|
+
const handleFocusIn = () => {
|
|
660
|
+
refreshObservedLayout();
|
|
661
|
+
scheduleReveal();
|
|
662
|
+
};
|
|
663
|
+
const handleFocusOut = () => {
|
|
664
|
+
layout.retainLayout = layout.hasLayout;
|
|
665
|
+
scheduleReveal();
|
|
666
|
+
};
|
|
667
|
+
const handleSheetTransitionEnd = (event) => {
|
|
668
|
+
if (event.target === sheet && event.propertyName === "transform") scheduleReveal();
|
|
669
|
+
};
|
|
670
|
+
const stopClaiming = ownsFocusTransitions ? claimFocusTransitions() : null;
|
|
671
|
+
let lastHeight = getKeyboardHeight(window);
|
|
672
|
+
const revealPan = isTouch ? watchRevealPan(window, {
|
|
673
|
+
owns: (focused) => layout.hasLayout && body.contains(focused),
|
|
674
|
+
onTouch: () => {
|
|
675
|
+
keyboard.smoothTarget = null;
|
|
676
|
+
}
|
|
677
|
+
}) : null;
|
|
678
|
+
const unsubscribe = subscribeKeyboardHeight(window, (event) => {
|
|
679
|
+
if (event.type !== "viewport") return;
|
|
680
|
+
if (event.height !== lastHeight) {
|
|
681
|
+
lastHeight = event.height;
|
|
682
|
+
revealPan?.report();
|
|
683
|
+
cancelAnimationFrame(animationFrame);
|
|
684
|
+
revealFocusedControl(true);
|
|
685
|
+
return;
|
|
686
|
+
}
|
|
687
|
+
if (revealPan?.isRevealPan(event.height) === true) {
|
|
688
|
+
reveals.atReport.add(window);
|
|
689
|
+
cancelAnimationFrame(animationFrame);
|
|
690
|
+
const distanceLeft = keyboard.smoothDistanceLeft();
|
|
691
|
+
if (distanceLeft === 0) revealFocusedControl();
|
|
692
|
+
const activeElement = document.activeElement;
|
|
693
|
+
const dialog = sheet.closest("dialog");
|
|
694
|
+
if (dialog != null && activeElement instanceof HTMLElement && activeElement.getBoundingClientRect().bottom - keyboard.rideOffset() - distanceLeft <= getObstructionTop()) revealPan?.putBack(dialog);
|
|
695
|
+
return;
|
|
696
|
+
}
|
|
697
|
+
scheduleReveal();
|
|
698
|
+
});
|
|
699
|
+
body.addEventListener("focusin", handleFocusIn);
|
|
700
|
+
body.addEventListener("focusout", handleFocusOut);
|
|
701
|
+
sheet.addEventListener("transitionend", handleSheetTransitionEnd);
|
|
702
|
+
const stopDocumentScroll = subscribeInput(window, "scroll", (event) => {
|
|
703
|
+
const target = event.target;
|
|
704
|
+
if (!isNode(target) || isDocument(target)) handleDocumentScroll();
|
|
705
|
+
});
|
|
706
|
+
mutationObserver?.observe(body, {
|
|
707
|
+
attributes: true,
|
|
708
|
+
characterData: true,
|
|
709
|
+
childList: true,
|
|
710
|
+
subtree: true
|
|
711
|
+
});
|
|
712
|
+
refreshObservedLayout();
|
|
713
|
+
scheduleReveal();
|
|
714
|
+
return () => {
|
|
715
|
+
unregister();
|
|
716
|
+
cancelAnimationFrame(animationFrame);
|
|
717
|
+
stopClaiming?.();
|
|
718
|
+
unsubscribe();
|
|
719
|
+
unsubscribeGuide();
|
|
720
|
+
holds.stop();
|
|
721
|
+
revealPan?.stop();
|
|
722
|
+
body.removeEventListener("focusin", handleFocusIn);
|
|
723
|
+
body.removeEventListener("focusout", handleFocusOut);
|
|
724
|
+
sheet.removeEventListener("transitionend", handleSheetTransitionEnd);
|
|
725
|
+
stopDocumentScroll();
|
|
726
|
+
for (const stop of stopObserving) stop();
|
|
727
|
+
mutationObserver?.disconnect();
|
|
728
|
+
keyboard.writeInset(0);
|
|
729
|
+
layout.hasLayout = false;
|
|
730
|
+
layout.retainLayout = false;
|
|
731
|
+
};
|
|
732
|
+
}
|
|
733
|
+
//#endregion
|
|
734
|
+
//#region src/keyboard/useMobileKeyboard.ts
|
|
735
|
+
/**
|
|
736
|
+
* Keeps a focused field in `target`'s element above the on-screen keyboard
|
|
737
|
+
* (see README.md). A sheet passes its panel and body, and the composable
|
|
738
|
+
* reserves the inset at the end of the body's content. Returns the inset the
|
|
739
|
+
* keyboard takes there, CSS px, or 0 without a keyboard, and a dismiss.
|
|
740
|
+
*
|
|
741
|
+
* Every option is read when it is used, so a listener always sees the
|
|
742
|
+
* current value.
|
|
743
|
+
*
|
|
744
|
+
* @example
|
|
745
|
+
* ```
|
|
746
|
+
* const keyboard = useMobileKeyboard(panel, { move: 'ride', inset: true, body, offset: 48, isEnabled, isExpanded, isOpen, isPageScrollLocked })
|
|
747
|
+
* ```
|
|
748
|
+
*/
|
|
749
|
+
function useMobileKeyboard(target, options = {}) {
|
|
750
|
+
const move = () => options.move;
|
|
751
|
+
const reservesInset = () => options.inset ?? false;
|
|
752
|
+
const offset = () => toValue(options.offset) ?? 10;
|
|
753
|
+
const isEnabled = () => toValue(options.isEnabled) ?? true;
|
|
754
|
+
const isExpanded = () => toValue(options.isExpanded) ?? true;
|
|
755
|
+
const isOpen = () => toValue(options.isOpen) ?? true;
|
|
756
|
+
const isPageScrollLocked = () => toValue(options.isPageScrollLocked) ?? false;
|
|
757
|
+
const inset = shallowRef(0);
|
|
758
|
+
const layout = {
|
|
759
|
+
hasLayout: false,
|
|
760
|
+
retainLayout: false
|
|
761
|
+
};
|
|
762
|
+
const isTouch = useMediaQuery(TOUCH_QUERY);
|
|
763
|
+
const dismiss = (focusTarget) => {
|
|
764
|
+
const element = toValue(target);
|
|
765
|
+
const activeElement = document.activeElement;
|
|
766
|
+
if (!isEnabled() || element == null || !(activeElement instanceof HTMLElement) || activeElement === element || !element.contains(activeElement)) return;
|
|
767
|
+
layout.retainLayout = layout.hasLayout;
|
|
768
|
+
if (focusTarget == null) activeElement.blur();
|
|
769
|
+
else focusTarget.focus({ preventScroll: true });
|
|
770
|
+
};
|
|
771
|
+
watch(() => isEnabled() && !isOpen(), (closing) => {
|
|
772
|
+
if (closing) dismiss();
|
|
773
|
+
}, {
|
|
774
|
+
immediate: true,
|
|
775
|
+
flush: "sync"
|
|
776
|
+
});
|
|
777
|
+
useAttachment(target, (element) => {
|
|
778
|
+
const how = move();
|
|
779
|
+
if (!isEnabled() || reservesInset() || !isTouch.value) return () => {};
|
|
780
|
+
return how == null ? keepFieldAboveKeyboard(element, { offset: offset() }) : followKeyboard(element, {
|
|
781
|
+
move: how,
|
|
782
|
+
offset: offset()
|
|
783
|
+
});
|
|
784
|
+
}, () => `${isEnabled()}|${move()}|${reservesInset()}|${offset()}|${isTouch.value}`);
|
|
785
|
+
useAttachment(target, (sheet) => {
|
|
786
|
+
const body = toValue(options.body);
|
|
787
|
+
if (!isEnabled() || !reservesInset() || body == null) return () => {};
|
|
788
|
+
return attachSheetKeyboard(sheet, body, {
|
|
789
|
+
offset: offset(),
|
|
790
|
+
isExpanded,
|
|
791
|
+
isOpen,
|
|
792
|
+
isPageScrollLocked: isPageScrollLocked(),
|
|
793
|
+
isTouch: isTouch.value,
|
|
794
|
+
layout,
|
|
795
|
+
onInset: (value) => {
|
|
796
|
+
inset.value = value;
|
|
797
|
+
}
|
|
798
|
+
});
|
|
799
|
+
}, () => `${isEnabled()}|${reservesInset()}|${isPageScrollLocked()}|${isTouch.value}|${offset()}|${toValue(options.body) != null}`);
|
|
800
|
+
return {
|
|
801
|
+
inset: readonly(inset),
|
|
802
|
+
dismiss
|
|
803
|
+
};
|
|
804
|
+
}
|
|
805
|
+
//#endregion
|
|
806
|
+
export { useMobileKeyboard as t };
|