lynote-ui 0.0.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/README.md +24 -0
- package/dist/CompositeItem-DKYDWwo1.js +30 -0
- package/dist/CompositeItem-DKYDWwo1.js.map +1 -0
- package/dist/CompositeItem-DqbuwxxP.mjs +31 -0
- package/dist/CompositeItem-DqbuwxxP.mjs.map +1 -0
- package/dist/CompositeList-CLP_jD9H.js +151 -0
- package/dist/CompositeList-CLP_jD9H.js.map +1 -0
- package/dist/CompositeList-CM71m-RA.mjs +135 -0
- package/dist/CompositeList-CM71m-RA.mjs.map +1 -0
- package/dist/CompositeRoot-Clz7hqk6.mjs +291 -0
- package/dist/CompositeRoot-Clz7hqk6.mjs.map +1 -0
- package/dist/CompositeRoot-DhWDFM9v.js +307 -0
- package/dist/CompositeRoot-DhWDFM9v.js.map +1 -0
- package/dist/DialogRoot-C_3aVl-g.mjs +69 -0
- package/dist/DialogRoot-C_3aVl-g.mjs.map +1 -0
- package/dist/DialogRoot-D_7sM8HI.js +85 -0
- package/dist/DialogRoot-D_7sM8HI.js.map +1 -0
- package/dist/DialogTrigger-BqeNq2F6.mjs +532 -0
- package/dist/DialogTrigger-BqeNq2F6.mjs.map +1 -0
- package/dist/DialogTrigger-CgBPTG9W.js +548 -0
- package/dist/DialogTrigger-CgBPTG9W.js.map +1 -0
- package/dist/DirectionContext-BaCziR5k.mjs +12 -0
- package/dist/DirectionContext-BaCziR5k.mjs.map +1 -0
- package/dist/DirectionContext-BsZvU9q3.js +28 -0
- package/dist/DirectionContext-BsZvU9q3.js.map +1 -0
- package/dist/DirectionProvider-DaKrURtH.js +36 -0
- package/dist/DirectionProvider-DaKrURtH.js.map +1 -0
- package/dist/DirectionProvider-ttyWmQjZ.mjs +20 -0
- package/dist/DirectionProvider-ttyWmQjZ.mjs.map +1 -0
- package/dist/FieldItemContext-DRVgx-D1.mjs +13 -0
- package/dist/FieldItemContext-DRVgx-D1.mjs.map +1 -0
- package/dist/FieldItemContext-K2sFjft8.js +29 -0
- package/dist/FieldItemContext-K2sFjft8.js.map +1 -0
- package/dist/FloatingPortalLite-CEKehtqV.js +50 -0
- package/dist/FloatingPortalLite-CEKehtqV.js.map +1 -0
- package/dist/FloatingPortalLite-CsPfJ360.mjs +33 -0
- package/dist/FloatingPortalLite-CsPfJ360.mjs.map +1 -0
- package/dist/FormItem-BmgGAecB.mjs +185 -0
- package/dist/FormItem-BmgGAecB.mjs.map +1 -0
- package/dist/FormItem-xksTqxKD.js +200 -0
- package/dist/FormItem-xksTqxKD.js.map +1 -0
- package/dist/InternalBackdrop-B3WuVcuG.js +1021 -0
- package/dist/InternalBackdrop-B3WuVcuG.js.map +1 -0
- package/dist/InternalBackdrop-C7vtdMWQ.mjs +1005 -0
- package/dist/InternalBackdrop-C7vtdMWQ.mjs.map +1 -0
- package/dist/LabelableContext-DLLBESLn.mjs +213 -0
- package/dist/LabelableContext-DLLBESLn.mjs.map +1 -0
- package/dist/LabelableContext-DYy4DAX3.js +230 -0
- package/dist/LabelableContext-DYy4DAX3.js.map +1 -0
- package/dist/MenuSubmenuTrigger-95oBD6Dx.js +1659 -0
- package/dist/MenuSubmenuTrigger-95oBD6Dx.js.map +1 -0
- package/dist/MenuSubmenuTrigger-Bnw6ycbc.mjs +1643 -0
- package/dist/MenuSubmenuTrigger-Bnw6ycbc.mjs.map +1 -0
- package/dist/Separator-BKPk5Lcn.js +43 -0
- package/dist/Separator-BKPk5Lcn.js.map +1 -0
- package/dist/Separator-Dvb0TS9E.mjs +27 -0
- package/dist/Separator-Dvb0TS9E.mjs.map +1 -0
- package/dist/ToolbarRootContext-B_HxjkNI.mjs +11 -0
- package/dist/ToolbarRootContext-B_HxjkNI.mjs.map +1 -0
- package/dist/ToolbarRootContext-C8eU2VAC.js +27 -0
- package/dist/ToolbarRootContext-C8eU2VAC.js.map +1 -0
- package/dist/accordion/index.d.ts +6 -0
- package/dist/accordion/index.js +618 -0
- package/dist/accordion/index.js.map +1 -0
- package/dist/accordion/index.mjs +601 -0
- package/dist/accordion/index.mjs.map +1 -0
- package/dist/alert/index.d.ts +11 -0
- package/dist/alert/index.js +78 -0
- package/dist/alert/index.js.map +1 -0
- package/dist/alert/index.mjs +78 -0
- package/dist/alert/index.mjs.map +1 -0
- package/dist/alert-dialog/index.d.ts +18 -0
- package/dist/alert-dialog/index.js +240 -0
- package/dist/alert-dialog/index.js.map +1 -0
- package/dist/alert-dialog/index.mjs +223 -0
- package/dist/alert-dialog/index.mjs.map +1 -0
- package/dist/aspect-ratio/index.d.ts +4 -0
- package/dist/aspect-ratio/index.js +23 -0
- package/dist/aspect-ratio/index.js.map +1 -0
- package/dist/aspect-ratio/index.mjs +23 -0
- package/dist/aspect-ratio/index.mjs.map +1 -0
- package/dist/avatar/index.d.ts +11 -0
- package/dist/avatar/index.js +287 -0
- package/dist/avatar/index.js.map +1 -0
- package/dist/avatar/index.mjs +270 -0
- package/dist/avatar/index.mjs.map +1 -0
- package/dist/badge/index.d.ts +9 -0
- package/dist/badge/index.js +48 -0
- package/dist/badge/index.js.map +1 -0
- package/dist/badge/index.mjs +48 -0
- package/dist/badge/index.mjs.map +1 -0
- package/dist/breadcrumb/index.d.ts +10 -0
- package/dist/breadcrumb/index.js +123 -0
- package/dist/breadcrumb/index.js.map +1 -0
- package/dist/breadcrumb/index.mjs +123 -0
- package/dist/breadcrumb/index.mjs.map +1 -0
- package/dist/button/index.d.ts +9 -0
- package/dist/button/index.js +99 -0
- package/dist/button/index.js.map +1 -0
- package/dist/button/index.mjs +82 -0
- package/dist/button/index.mjs.map +1 -0
- package/dist/button-group/index.d.ts +12 -0
- package/dist/button-group/index.js +83 -0
- package/dist/button-group/index.js.map +1 -0
- package/dist/button-group/index.mjs +83 -0
- package/dist/button-group/index.mjs.map +1 -0
- package/dist/calendar/index.d.ts +10 -0
- package/dist/calendar/index.js +205 -0
- package/dist/calendar/index.js.map +1 -0
- package/dist/calendar/index.mjs +188 -0
- package/dist/calendar/index.mjs.map +1 -0
- package/dist/card/index.d.ts +11 -0
- package/dist/card/index.js +102 -0
- package/dist/card/index.js.map +1 -0
- package/dist/card/index.mjs +102 -0
- package/dist/card/index.mjs.map +1 -0
- package/dist/carousel/index.d.ts +28 -0
- package/dist/carousel/index.js +217 -0
- package/dist/carousel/index.js.map +1 -0
- package/dist/carousel/index.mjs +200 -0
- package/dist/carousel/index.mjs.map +1 -0
- package/dist/chart/index.d.ts +44 -0
- package/dist/chart/index.js +272 -0
- package/dist/chart/index.js.map +1 -0
- package/dist/chart/index.mjs +254 -0
- package/dist/chart/index.mjs.map +1 -0
- package/dist/checkbox/index.d.ts +3 -0
- package/dist/checkbox/index.js +425 -0
- package/dist/checkbox/index.js.map +1 -0
- package/dist/checkbox/index.mjs +408 -0
- package/dist/checkbox/index.mjs.map +1 -0
- package/dist/clamp-CRAygR8_.mjs +17 -0
- package/dist/clamp-CRAygR8_.mjs.map +1 -0
- package/dist/clamp-Cl34OJjs.js +33 -0
- package/dist/clamp-Cl34OJjs.js.map +1 -0
- package/dist/collapsible/index.d.ts +5 -0
- package/dist/collapsible/index.js +244 -0
- package/dist/collapsible/index.js.map +1 -0
- package/dist/collapsible/index.mjs +227 -0
- package/dist/collapsible/index.mjs.map +1 -0
- package/dist/combobox/index.d.ts +24 -0
- package/dist/combobox/index.js +294 -0
- package/dist/combobox/index.js.map +1 -0
- package/dist/combobox/index.mjs +277 -0
- package/dist/combobox/index.mjs.map +1 -0
- package/dist/command/index.d.ts +19 -0
- package/dist/command/index.js +174 -0
- package/dist/command/index.js.map +1 -0
- package/dist/command/index.mjs +174 -0
- package/dist/command/index.mjs.map +1 -0
- package/dist/composite-54CI9F0V.mjs +346 -0
- package/dist/composite-54CI9F0V.mjs.map +1 -0
- package/dist/composite-B6lEHrCV.mjs +119 -0
- package/dist/composite-B6lEHrCV.mjs.map +1 -0
- package/dist/composite-BT0EMBUB.js +118 -0
- package/dist/composite-BT0EMBUB.js.map +1 -0
- package/dist/composite-DhXBXmhV.js +345 -0
- package/dist/composite-DhXBXmhV.js.map +1 -0
- package/dist/constants-DAVIOz2s.js +18 -0
- package/dist/constants-DAVIOz2s.js.map +1 -0
- package/dist/constants-Dfh7hQez.mjs +19 -0
- package/dist/constants-Dfh7hQez.mjs.map +1 -0
- package/dist/context-menu/index.d.ts +29 -0
- package/dist/context-menu/index.js +458 -0
- package/dist/context-menu/index.js.map +1 -0
- package/dist/context-menu/index.mjs +441 -0
- package/dist/context-menu/index.mjs.map +1 -0
- package/dist/createBaseUIEventDetails-CRQSf9K3.mjs +79 -0
- package/dist/createBaseUIEventDetails-CRQSf9K3.mjs.map +1 -0
- package/dist/createBaseUIEventDetails-D39y2D9R.js +78 -0
- package/dist/createBaseUIEventDetails-D39y2D9R.js.map +1 -0
- package/dist/date-picker/index.d.ts +3 -0
- package/dist/date-picker/index.js +47 -0
- package/dist/date-picker/index.js.map +1 -0
- package/dist/date-picker/index.mjs +30 -0
- package/dist/date-picker/index.mjs.map +1 -0
- package/dist/detectBrowser-CT93wuqL.mjs +64 -0
- package/dist/detectBrowser-CT93wuqL.mjs.map +1 -0
- package/dist/detectBrowser-j_AUpd7-.js +63 -0
- package/dist/detectBrowser-j_AUpd7-.js.map +1 -0
- package/dist/dialog/index.d.ts +17 -0
- package/dist/dialog/index.js +153 -0
- package/dist/dialog/index.js.map +1 -0
- package/dist/dialog/index.mjs +153 -0
- package/dist/dialog/index.mjs.map +1 -0
- package/dist/direction/index.d.ts +1 -0
- package/dist/direction/index.js +7 -0
- package/dist/direction/index.js.map +1 -0
- package/dist/direction/index.mjs +7 -0
- package/dist/direction/index.mjs.map +1 -0
- package/dist/drawer/index.d.ts +13 -0
- package/dist/drawer/index.js +128 -0
- package/dist/drawer/index.js.map +1 -0
- package/dist/drawer/index.mjs +128 -0
- package/dist/drawer/index.mjs.map +1 -0
- package/dist/dropdown-menu/index.d.ts +29 -0
- package/dist/dropdown-menu/index.js +573 -0
- package/dist/dropdown-menu/index.js.map +1 -0
- package/dist/dropdown-menu/index.mjs +555 -0
- package/dist/dropdown-menu/index.mjs.map +1 -0
- package/dist/element-BtC-M4rb.mjs +103 -0
- package/dist/element-BtC-M4rb.mjs.map +1 -0
- package/dist/element-DAAyJrnp.js +102 -0
- package/dist/element-DAAyJrnp.js.map +1 -0
- package/dist/empty/index.d.ts +12 -0
- package/dist/empty/index.js +103 -0
- package/dist/empty/index.js.map +1 -0
- package/dist/empty/index.mjs +103 -0
- package/dist/empty/index.mjs.map +1 -0
- package/dist/event-BHxKjfyi.js +43 -0
- package/dist/event-BHxKjfyi.js.map +1 -0
- package/dist/event-CcyVszlp.mjs +44 -0
- package/dist/event-CcyVszlp.mjs.map +1 -0
- package/dist/field/index.d.ts +25 -0
- package/dist/field/index.js +219 -0
- package/dist/field/index.js.map +1 -0
- package/dist/field/index.mjs +219 -0
- package/dist/field/index.mjs.map +1 -0
- package/dist/floating-ui.utils-CMX6M1P8.js +149 -0
- package/dist/floating-ui.utils-CMX6M1P8.js.map +1 -0
- package/dist/floating-ui.utils-DoPG3M8C.mjs +150 -0
- package/dist/floating-ui.utils-DoPG3M8C.mjs.map +1 -0
- package/dist/floating-ui.utils.dom-BAD07kLX.mjs +176 -0
- package/dist/floating-ui.utils.dom-BAD07kLX.mjs.map +1 -0
- package/dist/floating-ui.utils.dom-djqmdyxg.js +175 -0
- package/dist/floating-ui.utils.dom-djqmdyxg.js.map +1 -0
- package/dist/form/components/Form.d.ts +4 -0
- package/dist/form/components/FormControl.d.ts +3 -0
- package/dist/form/components/FormDescription.d.ts +3 -0
- package/dist/form/components/FormField.d.ts +3 -0
- package/dist/form/components/FormItem.d.ts +7 -0
- package/dist/form/components/FormLabel.d.ts +3 -0
- package/dist/form/components/FormMessage.d.ts +4 -0
- package/dist/form/components/variants.d.ts +6 -0
- package/dist/form/context/index.d.ts +4 -0
- package/dist/form/hooks/useFormField.d.ts +14 -0
- package/dist/form/index.d.ts +11 -0
- package/dist/form/index.js +19 -0
- package/dist/form/index.js.map +1 -0
- package/dist/form/index.mjs +13 -0
- package/dist/form/index.mjs.map +1 -0
- package/dist/form/type.d.ts +48 -0
- package/dist/getEmptyRootContext-CBrvBF2x.mjs +17 -0
- package/dist/getEmptyRootContext-CBrvBF2x.mjs.map +1 -0
- package/dist/getEmptyRootContext-DrOPobKp.js +16 -0
- package/dist/getEmptyRootContext-DrOPobKp.js.map +1 -0
- package/dist/getPseudoElementBounds-CN2-zcsN.js +29 -0
- package/dist/getPseudoElementBounds-CN2-zcsN.js.map +1 -0
- package/dist/getPseudoElementBounds-i4YX-qQ2.mjs +30 -0
- package/dist/getPseudoElementBounds-i4YX-qQ2.mjs.map +1 -0
- package/dist/hooks/use-mobile.d.ts +1 -0
- package/dist/hover-card/index.d.ts +5 -0
- package/dist/hover-card/index.js +501 -0
- package/dist/hover-card/index.js.map +1 -0
- package/dist/hover-card/index.mjs +483 -0
- package/dist/hover-card/index.mjs.map +1 -0
- package/dist/index-B3i3Mf61.mjs +147 -0
- package/dist/index-B3i3Mf61.mjs.map +1 -0
- package/dist/index-zBgD3uv6.js +163 -0
- package/dist/index-zBgD3uv6.js.map +1 -0
- package/dist/index.d.ts +57 -0
- package/dist/index.js +393 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +384 -0
- package/dist/index.mjs.map +1 -0
- package/dist/inertValue-gSeyz2Lm.js +10 -0
- package/dist/inertValue-gSeyz2Lm.js.map +1 -0
- package/dist/inertValue-t5QI1CFn.mjs +11 -0
- package/dist/inertValue-t5QI1CFn.mjs.map +1 -0
- package/dist/input/index.d.ts +3 -0
- package/dist/input/index.js +167 -0
- package/dist/input/index.js.map +1 -0
- package/dist/input/index.mjs +150 -0
- package/dist/input/index.mjs.map +1 -0
- package/dist/input-group/index.d.ts +19 -0
- package/dist/input-group/index.js +146 -0
- package/dist/input-group/index.js.map +1 -0
- package/dist/input-group/index.mjs +146 -0
- package/dist/input-group/index.mjs.map +1 -0
- package/dist/input-otp/index.d.ts +11 -0
- package/dist/input-otp/index.js +84 -0
- package/dist/input-otp/index.js.map +1 -0
- package/dist/input-otp/index.mjs +67 -0
- package/dist/input-otp/index.mjs.map +1 -0
- package/dist/isElementDisabled-2KG8-O4B.mjs +7 -0
- package/dist/isElementDisabled-2KG8-O4B.mjs.map +1 -0
- package/dist/isElementDisabled-p2fc38Eq.js +6 -0
- package/dist/isElementDisabled-p2fc38Eq.js.map +1 -0
- package/dist/item/index.d.ts +23 -0
- package/dist/item/index.js +196 -0
- package/dist/item/index.js.map +1 -0
- package/dist/item/index.mjs +196 -0
- package/dist/item/index.mjs.map +1 -0
- package/dist/jsx-runtime-CPzt8Nmm.js +321 -0
- package/dist/jsx-runtime-CPzt8Nmm.js.map +1 -0
- package/dist/jsx-runtime-Dog7MAYX.mjs +322 -0
- package/dist/jsx-runtime-Dog7MAYX.mjs.map +1 -0
- package/dist/kbd/index.d.ts +3 -0
- package/dist/kbd/index.js +30 -0
- package/dist/kbd/index.js.map +1 -0
- package/dist/kbd/index.mjs +30 -0
- package/dist/kbd/index.mjs.map +1 -0
- package/dist/label/index.d.ts +3 -0
- package/dist/label/index.js +19 -0
- package/dist/label/index.js.map +1 -0
- package/dist/label/index.mjs +19 -0
- package/dist/label/index.mjs.map +1 -0
- package/dist/lib/cva.d.ts +1 -0
- package/dist/lib/index.d.ts +2 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/menubar/index.d.ts +29 -0
- package/dist/menubar/index.js +365 -0
- package/dist/menubar/index.js.map +1 -0
- package/dist/menubar/index.mjs +348 -0
- package/dist/menubar/index.mjs.map +1 -0
- package/dist/native-select/index.d.ts +8 -0
- package/dist/native-select/index.js +54 -0
- package/dist/native-select/index.js.map +1 -0
- package/dist/native-select/index.mjs +54 -0
- package/dist/native-select/index.mjs.map +1 -0
- package/dist/navigation-menu/index.d.ts +12 -0
- package/dist/navigation-menu/index.js +1702 -0
- package/dist/navigation-menu/index.js.map +1 -0
- package/dist/navigation-menu/index.mjs +1684 -0
- package/dist/navigation-menu/index.mjs.map +1 -0
- package/dist/owner-Cf_X0F_A.mjs +7 -0
- package/dist/owner-Cf_X0F_A.mjs.map +1 -0
- package/dist/owner-DohlhdQa.js +6 -0
- package/dist/owner-DohlhdQa.js.map +1 -0
- package/dist/pagination/index.d.ts +17 -0
- package/dist/pagination/index.js +129 -0
- package/dist/pagination/index.js.map +1 -0
- package/dist/pagination/index.mjs +129 -0
- package/dist/pagination/index.mjs.map +1 -0
- package/dist/popover/index.d.ts +12 -0
- package/dist/popover/index.js +83 -0
- package/dist/popover/index.js.map +1 -0
- package/dist/popover/index.mjs +83 -0
- package/dist/popover/index.mjs.map +1 -0
- package/dist/popupStateMapping-DKN5mXrh.js +2694 -0
- package/dist/popupStateMapping-DKN5mXrh.js.map +1 -0
- package/dist/popupStateMapping-Dvf6vjid.mjs +2678 -0
- package/dist/popupStateMapping-Dvf6vjid.mjs.map +1 -0
- package/dist/progress/index.d.ts +7 -0
- package/dist/progress/index.js +315 -0
- package/dist/progress/index.js.map +1 -0
- package/dist/progress/index.mjs +298 -0
- package/dist/progress/index.mjs.map +1 -0
- package/dist/radio-group/index.d.ts +5 -0
- package/dist/radio-group/index.js +549 -0
- package/dist/radio-group/index.js.map +1 -0
- package/dist/radio-group/index.mjs +532 -0
- package/dist/radio-group/index.mjs.map +1 -0
- package/dist/resizable/index.d.ts +7 -0
- package/dist/resizable/index.js +63 -0
- package/dist/resizable/index.js.map +1 -0
- package/dist/resizable/index.mjs +46 -0
- package/dist/resizable/index.mjs.map +1 -0
- package/dist/resolveAriaLabelledBy-BOrKNO_y.js +10 -0
- package/dist/resolveAriaLabelledBy-BOrKNO_y.js.map +1 -0
- package/dist/resolveAriaLabelledBy-JxsTST5s.mjs +11 -0
- package/dist/resolveAriaLabelledBy-JxsTST5s.mjs.map +1 -0
- package/dist/safePolygon-ClN7sX4N.mjs +710 -0
- package/dist/safePolygon-ClN7sX4N.mjs.map +1 -0
- package/dist/safePolygon-DzT-LXP_.js +727 -0
- package/dist/safePolygon-DzT-LXP_.js.map +1 -0
- package/dist/safeReact-V1Amqcv9.mjs +8 -0
- package/dist/safeReact-V1Amqcv9.mjs.map +1 -0
- package/dist/safeReact-j2phwwP4.js +24 -0
- package/dist/safeReact-j2phwwP4.js.map +1 -0
- package/dist/scroll-area/index.d.ts +4 -0
- package/dist/scroll-area/index.js +1017 -0
- package/dist/scroll-area/index.js.map +1 -0
- package/dist/scroll-area/index.mjs +1000 -0
- package/dist/scroll-area/index.mjs.map +1 -0
- package/dist/select/index.d.ts +15 -0
- package/dist/select/index.js +2311 -0
- package/dist/select/index.js.map +1 -0
- package/dist/select/index.mjs +2293 -0
- package/dist/select/index.mjs.map +1 -0
- package/dist/separator/index.d.ts +3 -0
- package/dist/separator/index.js +25 -0
- package/dist/separator/index.js.map +1 -0
- package/dist/separator/index.mjs +25 -0
- package/dist/separator/index.mjs.map +1 -0
- package/dist/serializeValue-BLvnTy3o.mjs +17 -0
- package/dist/serializeValue-BLvnTy3o.mjs.map +1 -0
- package/dist/serializeValue-rMlAxdiX.js +16 -0
- package/dist/serializeValue-rMlAxdiX.js.map +1 -0
- package/dist/sheet/index.d.ts +14 -0
- package/dist/sheet/index.js +135 -0
- package/dist/sheet/index.js.map +1 -0
- package/dist/sheet/index.mjs +135 -0
- package/dist/sheet/index.mjs.map +1 -0
- package/dist/sidebar/index.d.ts +64 -0
- package/dist/sidebar/index.js +671 -0
- package/dist/sidebar/index.js.map +1 -0
- package/dist/sidebar/index.mjs +654 -0
- package/dist/sidebar/index.mjs.map +1 -0
- package/dist/skeleton/index.d.ts +2 -0
- package/dist/skeleton/index.js +16 -0
- package/dist/skeleton/index.js.map +1 -0
- package/dist/skeleton/index.mjs +16 -0
- package/dist/skeleton/index.mjs.map +1 -0
- package/dist/slider/index.d.ts +3 -0
- package/dist/slider/index.js +1361 -0
- package/dist/slider/index.js.map +1 -0
- package/dist/slider/index.mjs +1344 -0
- package/dist/slider/index.mjs.map +1 -0
- package/dist/sonner/index.d.ts +3 -0
- package/dist/sonner/index.js +10 -0
- package/dist/sonner/index.js.map +1 -0
- package/dist/sonner/index.mjs +7 -0
- package/dist/sonner/index.mjs.map +1 -0
- package/dist/sonner/sonner.d.ts +3 -0
- package/dist/sonner-Ctpa1LLR.js +36 -0
- package/dist/sonner-Ctpa1LLR.js.map +1 -0
- package/dist/sonner-D0rALbMy.mjs +37 -0
- package/dist/sonner-D0rALbMy.mjs.map +1 -0
- package/dist/spinner/index.d.ts +2 -0
- package/dist/spinner/index.js +10 -0
- package/dist/spinner/index.js.map +1 -0
- package/dist/spinner/index.mjs +10 -0
- package/dist/spinner/index.mjs.map +1 -0
- package/dist/style.css +6284 -0
- package/dist/styles-BY9BExrL.js +17 -0
- package/dist/styles-BY9BExrL.js.map +1 -0
- package/dist/styles-DGdX19B5.mjs +18 -0
- package/dist/styles-DGdX19B5.mjs.map +1 -0
- package/dist/switch/index.d.ts +5 -0
- package/dist/switch/index.js +306 -0
- package/dist/switch/index.js.map +1 -0
- package/dist/switch/index.mjs +289 -0
- package/dist/switch/index.mjs.map +1 -0
- package/dist/table/index.d.ts +10 -0
- package/dist/table/index.js +115 -0
- package/dist/table/index.js.map +1 -0
- package/dist/table/index.mjs +115 -0
- package/dist/table/index.mjs.map +1 -0
- package/dist/tabs/index.d.ts +11 -0
- package/dist/tabs/index.js +718 -0
- package/dist/tabs/index.js.map +1 -0
- package/dist/tabs/index.mjs +701 -0
- package/dist/tabs/index.mjs.map +1 -0
- package/dist/textarea/index.d.ts +3 -0
- package/dist/textarea/index.js +19 -0
- package/dist/textarea/index.js.map +1 -0
- package/dist/textarea/index.mjs +19 -0
- package/dist/textarea/index.mjs.map +1 -0
- package/dist/toggle/index.d.ts +9 -0
- package/dist/toggle/index.js +9 -0
- package/dist/toggle/index.js.map +1 -0
- package/dist/toggle/index.mjs +9 -0
- package/dist/toggle/index.mjs.map +1 -0
- package/dist/toggle-group/index.d.ts +10 -0
- package/dist/toggle-group/index.js +199 -0
- package/dist/toggle-group/index.js.map +1 -0
- package/dist/toggle-group/index.mjs +182 -0
- package/dist/toggle-group/index.mjs.map +1 -0
- package/dist/tooltip/index.d.ts +6 -0
- package/dist/tooltip/index.js +940 -0
- package/dist/tooltip/index.js.map +1 -0
- package/dist/tooltip/index.mjs +922 -0
- package/dist/tooltip/index.mjs.map +1 -0
- package/dist/useAnchorPositioning-DEkPt210.mjs +2213 -0
- package/dist/useAnchorPositioning-DEkPt210.mjs.map +1 -0
- package/dist/useAnchorPositioning-jXRh4g8d.js +2229 -0
- package/dist/useAnchorPositioning-jXRh4g8d.js.map +1 -0
- package/dist/useAnimationFrame-Bgt4Euiv.js +100 -0
- package/dist/useAnimationFrame-Bgt4Euiv.js.map +1 -0
- package/dist/useAnimationFrame-CJsjFUv3.mjs +101 -0
- package/dist/useAnimationFrame-CJsjFUv3.mjs.map +1 -0
- package/dist/useAriaLabelledBy-AZCBHH3a.js +63 -0
- package/dist/useAriaLabelledBy-AZCBHH3a.js.map +1 -0
- package/dist/useAriaLabelledBy-Chelmb26.mjs +47 -0
- package/dist/useAriaLabelledBy-Chelmb26.mjs.map +1 -0
- package/dist/useBaseUiId-Dd6rCWZj.mjs +30 -0
- package/dist/useBaseUiId-Dd6rCWZj.mjs.map +1 -0
- package/dist/useBaseUiId-ZDgjliOe.js +46 -0
- package/dist/useBaseUiId-ZDgjliOe.js.map +1 -0
- package/dist/useButton-CcvYPR5H.js +246 -0
- package/dist/useButton-CcvYPR5H.js.map +1 -0
- package/dist/useButton-DbBdV6Ig.mjs +230 -0
- package/dist/useButton-DbBdV6Ig.mjs.map +1 -0
- package/dist/useClick-1DLd7znk.mjs +97 -0
- package/dist/useClick-1DLd7znk.mjs.map +1 -0
- package/dist/useClick-wsFFnZw6.js +113 -0
- package/dist/useClick-wsFFnZw6.js.map +1 -0
- package/dist/useCollapsiblePanel-DIdAXCDX.mjs +439 -0
- package/dist/useCollapsiblePanel-DIdAXCDX.mjs.map +1 -0
- package/dist/useCollapsiblePanel-OP0gCAiW.js +455 -0
- package/dist/useCollapsiblePanel-OP0gCAiW.js.map +1 -0
- package/dist/useCompositeItem-CP0qNLGv.mjs +43 -0
- package/dist/useCompositeItem-CP0qNLGv.mjs.map +1 -0
- package/dist/useCompositeItem-F8jky_8M.js +59 -0
- package/dist/useCompositeItem-F8jky_8M.js.map +1 -0
- package/dist/useCompositeListItem-CPSGNf6p.js +116 -0
- package/dist/useCompositeListItem-CPSGNf6p.js.map +1 -0
- package/dist/useCompositeListItem-CvqgwmCe.mjs +100 -0
- package/dist/useCompositeListItem-CvqgwmCe.mjs.map +1 -0
- package/dist/useControlled-DITi2kHX.mjs +38 -0
- package/dist/useControlled-DITi2kHX.mjs.map +1 -0
- package/dist/useControlled-DTjTIpeU.js +54 -0
- package/dist/useControlled-DTjTIpeU.js.map +1 -0
- package/dist/useFocus-BonLJ9UY.js +162 -0
- package/dist/useFocus-BonLJ9UY.js.map +1 -0
- package/dist/useFocus-D2m1G1R7.mjs +146 -0
- package/dist/useFocus-D2m1G1R7.mjs.map +1 -0
- package/dist/useIsoLayoutEffect-CAx-dEZM.mjs +8 -0
- package/dist/useIsoLayoutEffect-CAx-dEZM.mjs.map +1 -0
- package/dist/useIsoLayoutEffect-CYDr9Bko.js +24 -0
- package/dist/useIsoLayoutEffect-CYDr9Bko.js.map +1 -0
- package/dist/useLabelableId-BMQMbGuJ.mjs +67 -0
- package/dist/useLabelableId-BMQMbGuJ.mjs.map +1 -0
- package/dist/useLabelableId-C-dL4hfJ.js +83 -0
- package/dist/useLabelableId-C-dL4hfJ.js.map +1 -0
- package/dist/useOnFirstRender-BYSeF6Y1.js +28 -0
- package/dist/useOnFirstRender-BYSeF6Y1.js.map +1 -0
- package/dist/useOnFirstRender-_PvKQsmi.mjs +12 -0
- package/dist/useOnFirstRender-_PvKQsmi.mjs.map +1 -0
- package/dist/useOnMount-CzmIG4WC.js +25 -0
- package/dist/useOnMount-CzmIG4WC.js.map +1 -0
- package/dist/useOnMount-DN6FnE-7.mjs +9 -0
- package/dist/useOnMount-DN6FnE-7.mjs.map +1 -0
- package/dist/useOpenChangeComplete-B0xZNwMu.js +194 -0
- package/dist/useOpenChangeComplete-B0xZNwMu.js.map +1 -0
- package/dist/useOpenChangeComplete-DbPLu-k9.mjs +177 -0
- package/dist/useOpenChangeComplete-DbPLu-k9.mjs.map +1 -0
- package/dist/useRender-DKDvf6kd.mjs +8 -0
- package/dist/useRender-DKDvf6kd.mjs.map +1 -0
- package/dist/useRender-PucZeh4Y.js +7 -0
- package/dist/useRender-PucZeh4Y.js.map +1 -0
- package/dist/useRenderElement-CtyURhhF.js +427 -0
- package/dist/useRenderElement-CtyURhhF.js.map +1 -0
- package/dist/useRenderElement-DtkRtCHE.mjs +412 -0
- package/dist/useRenderElement-DtkRtCHE.mjs.map +1 -0
- package/dist/useRole-CuVJ_Qa_.js +125 -0
- package/dist/useRole-CuVJ_Qa_.js.map +1 -0
- package/dist/useRole-DzRWctvj.mjs +109 -0
- package/dist/useRole-DzRWctvj.mjs.map +1 -0
- package/dist/useStableCallback-8_xI9oDo.mjs +40 -0
- package/dist/useStableCallback-8_xI9oDo.mjs.map +1 -0
- package/dist/useStableCallback-CfE_knIO.js +56 -0
- package/dist/useStableCallback-CfE_knIO.js.map +1 -0
- package/dist/useSyncedFloatingRootContext-BhwJbN5C.js +237 -0
- package/dist/useSyncedFloatingRootContext-BhwJbN5C.js.map +1 -0
- package/dist/useSyncedFloatingRootContext-BiC-l-Yp.mjs +221 -0
- package/dist/useSyncedFloatingRootContext-BiC-l-Yp.mjs.map +1 -0
- package/dist/useTimeout-CSlJ10_7.js +45 -0
- package/dist/useTimeout-CSlJ10_7.js.map +1 -0
- package/dist/useTimeout-DP0d-UkF.mjs +46 -0
- package/dist/useTimeout-DP0d-UkF.mjs.map +1 -0
- package/dist/useTypeahead-De1veul8.mjs +697 -0
- package/dist/useTypeahead-De1veul8.mjs.map +1 -0
- package/dist/useTypeahead-JL7mFfnS.js +713 -0
- package/dist/useTypeahead-JL7mFfnS.js.map +1 -0
- package/dist/useValueAsRef-BPI-p5A3.mjs +22 -0
- package/dist/useValueAsRef-BPI-p5A3.mjs.map +1 -0
- package/dist/useValueAsRef-uSzmRbW_.js +21 -0
- package/dist/useValueAsRef-uSzmRbW_.js.map +1 -0
- package/dist/useValueChanged-CEUlHhs5.mjs +20 -0
- package/dist/useValueChanged-CEUlHhs5.mjs.map +1 -0
- package/dist/useValueChanged-CvJls2Pv.js +36 -0
- package/dist/useValueChanged-CvJls2Pv.js.map +1 -0
- package/dist/utils-H80jjgLf.mjs +9 -0
- package/dist/utils-H80jjgLf.mjs.map +1 -0
- package/dist/utils-ij3i9zTT.js +8 -0
- package/dist/utils-ij3i9zTT.js.map +1 -0
- package/dist/valueToPercent-CfYnVMaY.js +39 -0
- package/dist/valueToPercent-CfYnVMaY.js.map +1 -0
- package/dist/valueToPercent-DxMnLf8t.mjs +40 -0
- package/dist/valueToPercent-DxMnLf8t.mjs.map +1 -0
- package/dist/visuallyHidden-D_sL9-70.mjs +25 -0
- package/dist/visuallyHidden-D_sL9-70.mjs.map +1 -0
- package/dist/visuallyHidden-Dkg-c0_K.js +24 -0
- package/dist/visuallyHidden-Dkg-c0_K.js.map +1 -0
- package/package.json +382 -0
|
@@ -0,0 +1,2694 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
4
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5
|
+
const React = require("react");
|
|
6
|
+
const ReactDOM = require("react-dom");
|
|
7
|
+
const floatingUi_utils_dom = require("./floating-ui.utils.dom-djqmdyxg.js");
|
|
8
|
+
const useBaseUiId = require("./useBaseUiId-ZDgjliOe.js");
|
|
9
|
+
const useIsoLayoutEffect = require("./useIsoLayoutEffect-CYDr9Bko.js");
|
|
10
|
+
const useStableCallback = require("./useStableCallback-CfE_knIO.js");
|
|
11
|
+
const detectBrowser = require("./detectBrowser-j_AUpd7-.js");
|
|
12
|
+
const visuallyHidden = require("./visuallyHidden-Dkg-c0_K.js");
|
|
13
|
+
const jsxRuntime = require("./jsx-runtime-CPzt8Nmm.js");
|
|
14
|
+
const createBaseUIEventDetails = require("./createBaseUIEventDetails-D39y2D9R.js");
|
|
15
|
+
const useRenderElement = require("./useRenderElement-CtyURhhF.js");
|
|
16
|
+
const owner = require("./owner-DohlhdQa.js");
|
|
17
|
+
const element = require("./element-DAAyJrnp.js");
|
|
18
|
+
const useTimeout = require("./useTimeout-CSlJ10_7.js");
|
|
19
|
+
const event = require("./event-BHxKjfyi.js");
|
|
20
|
+
const constants = require("./constants-DAVIOz2s.js");
|
|
21
|
+
const useOpenChangeComplete = require("./useOpenChangeComplete-B0xZNwMu.js");
|
|
22
|
+
function _interopNamespaceDefault(e) {
|
|
23
|
+
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
24
|
+
if (e) {
|
|
25
|
+
for (const k in e) {
|
|
26
|
+
if (k !== "default") {
|
|
27
|
+
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
28
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
29
|
+
enumerable: true,
|
|
30
|
+
get: () => e[k]
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
n.default = e;
|
|
36
|
+
return Object.freeze(n);
|
|
37
|
+
}
|
|
38
|
+
const React__namespace = /* @__PURE__ */ _interopNamespaceDefault(React);
|
|
39
|
+
const ReactDOM__namespace = /* @__PURE__ */ _interopNamespaceDefault(ReactDOM);
|
|
40
|
+
const TYPEAHEAD_RESET_MS = 500;
|
|
41
|
+
const PATIENT_CLICK_THRESHOLD = 500;
|
|
42
|
+
const DISABLED_TRANSITIONS_STYLE = {
|
|
43
|
+
style: {
|
|
44
|
+
transition: "none"
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
const CLICK_TRIGGER_IDENTIFIER = "data-base-ui-click-trigger";
|
|
48
|
+
const DROPDOWN_COLLISION_AVOIDANCE = {
|
|
49
|
+
fallbackAxisSide: "none"
|
|
50
|
+
};
|
|
51
|
+
const POPUP_COLLISION_AVOIDANCE = {
|
|
52
|
+
fallbackAxisSide: "end"
|
|
53
|
+
};
|
|
54
|
+
const ownerVisuallyHidden = {
|
|
55
|
+
clipPath: "inset(50%)",
|
|
56
|
+
position: "fixed",
|
|
57
|
+
top: 0,
|
|
58
|
+
left: 0
|
|
59
|
+
};
|
|
60
|
+
function getNodeChildren(nodes, id, onlyOpenChildren = true) {
|
|
61
|
+
const directChildren = nodes.filter((node) => {
|
|
62
|
+
var _a;
|
|
63
|
+
return node.parentId === id && (!onlyOpenChildren || ((_a = node.context) == null ? void 0 : _a.open));
|
|
64
|
+
});
|
|
65
|
+
return directChildren.flatMap((child) => [child, ...getNodeChildren(nodes, child.id, onlyOpenChildren)]);
|
|
66
|
+
}
|
|
67
|
+
function getNodeAncestors(nodes, id) {
|
|
68
|
+
var _a;
|
|
69
|
+
let allAncestors = [];
|
|
70
|
+
let currentParentId = (_a = nodes.find((node) => node.id === id)) == null ? void 0 : _a.parentId;
|
|
71
|
+
while (currentParentId) {
|
|
72
|
+
const currentNode = nodes.find((node) => node.id === currentParentId);
|
|
73
|
+
currentParentId = currentNode == null ? void 0 : currentNode.parentId;
|
|
74
|
+
if (currentNode) {
|
|
75
|
+
allAncestors = allAncestors.concat(currentNode);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
return allAncestors;
|
|
79
|
+
}
|
|
80
|
+
/*!
|
|
81
|
+
* tabbable 6.4.0
|
|
82
|
+
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
83
|
+
*/
|
|
84
|
+
var candidateSelectors = ["input:not([inert]):not([inert] *)", "select:not([inert]):not([inert] *)", "textarea:not([inert]):not([inert] *)", "a[href]:not([inert]):not([inert] *)", "button:not([inert]):not([inert] *)", "[tabindex]:not(slot):not([inert]):not([inert] *)", "audio[controls]:not([inert]):not([inert] *)", "video[controls]:not([inert]):not([inert] *)", '[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)', "details>summary:first-of-type:not([inert]):not([inert] *)", "details:not([inert]):not([inert] *)"];
|
|
85
|
+
var candidateSelector = /* @__PURE__ */ candidateSelectors.join(",");
|
|
86
|
+
var NoElement = typeof Element === "undefined";
|
|
87
|
+
var matches = NoElement ? function() {
|
|
88
|
+
} : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;
|
|
89
|
+
var getRootNode = !NoElement && Element.prototype.getRootNode ? function(element2) {
|
|
90
|
+
var _element$getRootNode;
|
|
91
|
+
return element2 === null || element2 === void 0 ? void 0 : (_element$getRootNode = element2.getRootNode) === null || _element$getRootNode === void 0 ? void 0 : _element$getRootNode.call(element2);
|
|
92
|
+
} : function(element2) {
|
|
93
|
+
return element2 === null || element2 === void 0 ? void 0 : element2.ownerDocument;
|
|
94
|
+
};
|
|
95
|
+
var _isInert = function isInert(node, lookUp) {
|
|
96
|
+
var _node$getAttribute;
|
|
97
|
+
if (lookUp === void 0) {
|
|
98
|
+
lookUp = true;
|
|
99
|
+
}
|
|
100
|
+
var inertAtt = node === null || node === void 0 ? void 0 : (_node$getAttribute = node.getAttribute) === null || _node$getAttribute === void 0 ? void 0 : _node$getAttribute.call(node, "inert");
|
|
101
|
+
var inert = inertAtt === "" || inertAtt === "true";
|
|
102
|
+
var result = inert || lookUp && node && // closest does not exist on shadow roots, so we fall back to a manual
|
|
103
|
+
// lookup upward, in case it is not defined.
|
|
104
|
+
(typeof node.closest === "function" ? node.closest("[inert]") : _isInert(node.parentNode));
|
|
105
|
+
return result;
|
|
106
|
+
};
|
|
107
|
+
var isContentEditable = function isContentEditable2(node) {
|
|
108
|
+
var _node$getAttribute2;
|
|
109
|
+
var attValue = node === null || node === void 0 ? void 0 : (_node$getAttribute2 = node.getAttribute) === null || _node$getAttribute2 === void 0 ? void 0 : _node$getAttribute2.call(node, "contenteditable");
|
|
110
|
+
return attValue === "" || attValue === "true";
|
|
111
|
+
};
|
|
112
|
+
var getCandidates = function getCandidates2(el, includeContainer, filter) {
|
|
113
|
+
if (_isInert(el)) {
|
|
114
|
+
return [];
|
|
115
|
+
}
|
|
116
|
+
var candidates = Array.prototype.slice.apply(el.querySelectorAll(candidateSelector));
|
|
117
|
+
if (includeContainer && matches.call(el, candidateSelector)) {
|
|
118
|
+
candidates.unshift(el);
|
|
119
|
+
}
|
|
120
|
+
candidates = candidates.filter(filter);
|
|
121
|
+
return candidates;
|
|
122
|
+
};
|
|
123
|
+
var _getCandidatesIteratively = function getCandidatesIteratively(elements, includeContainer, options) {
|
|
124
|
+
var candidates = [];
|
|
125
|
+
var elementsToCheck = Array.from(elements);
|
|
126
|
+
while (elementsToCheck.length) {
|
|
127
|
+
var element2 = elementsToCheck.shift();
|
|
128
|
+
if (_isInert(element2, false)) {
|
|
129
|
+
continue;
|
|
130
|
+
}
|
|
131
|
+
if (element2.tagName === "SLOT") {
|
|
132
|
+
var assigned = element2.assignedElements();
|
|
133
|
+
var content = assigned.length ? assigned : element2.children;
|
|
134
|
+
var nestedCandidates = _getCandidatesIteratively(content, true, options);
|
|
135
|
+
if (options.flatten) {
|
|
136
|
+
candidates.push.apply(candidates, nestedCandidates);
|
|
137
|
+
} else {
|
|
138
|
+
candidates.push({
|
|
139
|
+
scopeParent: element2,
|
|
140
|
+
candidates: nestedCandidates
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
} else {
|
|
144
|
+
var validCandidate = matches.call(element2, candidateSelector);
|
|
145
|
+
if (validCandidate && options.filter(element2) && (includeContainer || !elements.includes(element2))) {
|
|
146
|
+
candidates.push(element2);
|
|
147
|
+
}
|
|
148
|
+
var shadowRoot = element2.shadowRoot || // check for an undisclosed shadow
|
|
149
|
+
typeof options.getShadowRoot === "function" && options.getShadowRoot(element2);
|
|
150
|
+
var validShadowRoot = !_isInert(shadowRoot, false) && (!options.shadowRootFilter || options.shadowRootFilter(element2));
|
|
151
|
+
if (shadowRoot && validShadowRoot) {
|
|
152
|
+
var _nestedCandidates = _getCandidatesIteratively(shadowRoot === true ? element2.children : shadowRoot.children, true, options);
|
|
153
|
+
if (options.flatten) {
|
|
154
|
+
candidates.push.apply(candidates, _nestedCandidates);
|
|
155
|
+
} else {
|
|
156
|
+
candidates.push({
|
|
157
|
+
scopeParent: element2,
|
|
158
|
+
candidates: _nestedCandidates
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
} else {
|
|
162
|
+
elementsToCheck.unshift.apply(elementsToCheck, element2.children);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
return candidates;
|
|
167
|
+
};
|
|
168
|
+
var hasTabIndex = function hasTabIndex2(node) {
|
|
169
|
+
return !isNaN(parseInt(node.getAttribute("tabindex"), 10));
|
|
170
|
+
};
|
|
171
|
+
var getTabIndex = function getTabIndex2(node) {
|
|
172
|
+
if (!node) {
|
|
173
|
+
throw new Error("No node provided");
|
|
174
|
+
}
|
|
175
|
+
if (node.tabIndex < 0) {
|
|
176
|
+
if ((/^(AUDIO|VIDEO|DETAILS)$/.test(node.tagName) || isContentEditable(node)) && !hasTabIndex(node)) {
|
|
177
|
+
return 0;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
return node.tabIndex;
|
|
181
|
+
};
|
|
182
|
+
var getSortOrderTabIndex = function getSortOrderTabIndex2(node, isScope) {
|
|
183
|
+
var tabIndex = getTabIndex(node);
|
|
184
|
+
if (tabIndex < 0 && isScope && !hasTabIndex(node)) {
|
|
185
|
+
return 0;
|
|
186
|
+
}
|
|
187
|
+
return tabIndex;
|
|
188
|
+
};
|
|
189
|
+
var sortOrderedTabbables = function sortOrderedTabbables2(a, b) {
|
|
190
|
+
return a.tabIndex === b.tabIndex ? a.documentOrder - b.documentOrder : a.tabIndex - b.tabIndex;
|
|
191
|
+
};
|
|
192
|
+
var isInput = function isInput2(node) {
|
|
193
|
+
return node.tagName === "INPUT";
|
|
194
|
+
};
|
|
195
|
+
var isHiddenInput = function isHiddenInput2(node) {
|
|
196
|
+
return isInput(node) && node.type === "hidden";
|
|
197
|
+
};
|
|
198
|
+
var isDetailsWithSummary = function isDetailsWithSummary2(node) {
|
|
199
|
+
var r = node.tagName === "DETAILS" && Array.prototype.slice.apply(node.children).some(function(child) {
|
|
200
|
+
return child.tagName === "SUMMARY";
|
|
201
|
+
});
|
|
202
|
+
return r;
|
|
203
|
+
};
|
|
204
|
+
var getCheckedRadio = function getCheckedRadio2(nodes, form) {
|
|
205
|
+
for (var i = 0; i < nodes.length; i++) {
|
|
206
|
+
if (nodes[i].checked && nodes[i].form === form) {
|
|
207
|
+
return nodes[i];
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
};
|
|
211
|
+
var isTabbableRadio = function isTabbableRadio2(node) {
|
|
212
|
+
if (!node.name) {
|
|
213
|
+
return true;
|
|
214
|
+
}
|
|
215
|
+
var radioScope = node.form || getRootNode(node);
|
|
216
|
+
var queryRadios = function queryRadios2(name) {
|
|
217
|
+
return radioScope.querySelectorAll('input[type="radio"][name="' + name + '"]');
|
|
218
|
+
};
|
|
219
|
+
var radioSet;
|
|
220
|
+
if (typeof window !== "undefined" && typeof window.CSS !== "undefined" && typeof window.CSS.escape === "function") {
|
|
221
|
+
radioSet = queryRadios(window.CSS.escape(node.name));
|
|
222
|
+
} else {
|
|
223
|
+
try {
|
|
224
|
+
radioSet = queryRadios(node.name);
|
|
225
|
+
} catch (err) {
|
|
226
|
+
console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s", err.message);
|
|
227
|
+
return false;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
var checked = getCheckedRadio(radioSet, node.form);
|
|
231
|
+
return !checked || checked === node;
|
|
232
|
+
};
|
|
233
|
+
var isRadio = function isRadio2(node) {
|
|
234
|
+
return isInput(node) && node.type === "radio";
|
|
235
|
+
};
|
|
236
|
+
var isNonTabbableRadio = function isNonTabbableRadio2(node) {
|
|
237
|
+
return isRadio(node) && !isTabbableRadio(node);
|
|
238
|
+
};
|
|
239
|
+
var isNodeAttached = function isNodeAttached2(node) {
|
|
240
|
+
var _nodeRoot;
|
|
241
|
+
var nodeRoot = node && getRootNode(node);
|
|
242
|
+
var nodeRootHost = (_nodeRoot = nodeRoot) === null || _nodeRoot === void 0 ? void 0 : _nodeRoot.host;
|
|
243
|
+
var attached = false;
|
|
244
|
+
if (nodeRoot && nodeRoot !== node) {
|
|
245
|
+
var _nodeRootHost, _nodeRootHost$ownerDo, _node$ownerDocument;
|
|
246
|
+
attached = !!((_nodeRootHost = nodeRootHost) !== null && _nodeRootHost !== void 0 && (_nodeRootHost$ownerDo = _nodeRootHost.ownerDocument) !== null && _nodeRootHost$ownerDo !== void 0 && _nodeRootHost$ownerDo.contains(nodeRootHost) || node !== null && node !== void 0 && (_node$ownerDocument = node.ownerDocument) !== null && _node$ownerDocument !== void 0 && _node$ownerDocument.contains(node));
|
|
247
|
+
while (!attached && nodeRootHost) {
|
|
248
|
+
var _nodeRoot2, _nodeRootHost2, _nodeRootHost2$ownerD;
|
|
249
|
+
nodeRoot = getRootNode(nodeRootHost);
|
|
250
|
+
nodeRootHost = (_nodeRoot2 = nodeRoot) === null || _nodeRoot2 === void 0 ? void 0 : _nodeRoot2.host;
|
|
251
|
+
attached = !!((_nodeRootHost2 = nodeRootHost) !== null && _nodeRootHost2 !== void 0 && (_nodeRootHost2$ownerD = _nodeRootHost2.ownerDocument) !== null && _nodeRootHost2$ownerD !== void 0 && _nodeRootHost2$ownerD.contains(nodeRootHost));
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
return attached;
|
|
255
|
+
};
|
|
256
|
+
var isZeroArea = function isZeroArea2(node) {
|
|
257
|
+
var _node$getBoundingClie = node.getBoundingClientRect(), width = _node$getBoundingClie.width, height = _node$getBoundingClie.height;
|
|
258
|
+
return width === 0 && height === 0;
|
|
259
|
+
};
|
|
260
|
+
var isHidden = function isHidden2(node, _ref) {
|
|
261
|
+
var displayCheck = _ref.displayCheck, getShadowRoot = _ref.getShadowRoot;
|
|
262
|
+
if (displayCheck === "full-native") {
|
|
263
|
+
if ("checkVisibility" in node) {
|
|
264
|
+
var visible = node.checkVisibility({
|
|
265
|
+
// Checking opacity might be desirable for some use cases, but natively,
|
|
266
|
+
// opacity zero elements _are_ focusable and tabbable.
|
|
267
|
+
checkOpacity: false,
|
|
268
|
+
opacityProperty: false,
|
|
269
|
+
contentVisibilityAuto: true,
|
|
270
|
+
visibilityProperty: true,
|
|
271
|
+
// This is an alias for `visibilityProperty`. Contemporary browsers
|
|
272
|
+
// support both. However, this alias has wider browser support (Chrome
|
|
273
|
+
// >= 105 and Firefox >= 106, vs. Chrome >= 121 and Firefox >= 122), so
|
|
274
|
+
// we include it anyway.
|
|
275
|
+
checkVisibilityCSS: true
|
|
276
|
+
});
|
|
277
|
+
return !visible;
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
if (getComputedStyle(node).visibility === "hidden") {
|
|
281
|
+
return true;
|
|
282
|
+
}
|
|
283
|
+
var isDirectSummary = matches.call(node, "details>summary:first-of-type");
|
|
284
|
+
var nodeUnderDetails = isDirectSummary ? node.parentElement : node;
|
|
285
|
+
if (matches.call(nodeUnderDetails, "details:not([open]) *")) {
|
|
286
|
+
return true;
|
|
287
|
+
}
|
|
288
|
+
if (!displayCheck || displayCheck === "full" || // full-native can run this branch when it falls through in case
|
|
289
|
+
// Element#checkVisibility is unsupported
|
|
290
|
+
displayCheck === "full-native" || displayCheck === "legacy-full") {
|
|
291
|
+
if (typeof getShadowRoot === "function") {
|
|
292
|
+
var originalNode = node;
|
|
293
|
+
while (node) {
|
|
294
|
+
var parentElement = node.parentElement;
|
|
295
|
+
var rootNode = getRootNode(node);
|
|
296
|
+
if (parentElement && !parentElement.shadowRoot && getShadowRoot(parentElement) === true) {
|
|
297
|
+
return isZeroArea(node);
|
|
298
|
+
} else if (node.assignedSlot) {
|
|
299
|
+
node = node.assignedSlot;
|
|
300
|
+
} else if (!parentElement && rootNode !== node.ownerDocument) {
|
|
301
|
+
node = rootNode.host;
|
|
302
|
+
} else {
|
|
303
|
+
node = parentElement;
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
node = originalNode;
|
|
307
|
+
}
|
|
308
|
+
if (isNodeAttached(node)) {
|
|
309
|
+
return !node.getClientRects().length;
|
|
310
|
+
}
|
|
311
|
+
if (displayCheck !== "legacy-full") {
|
|
312
|
+
return true;
|
|
313
|
+
}
|
|
314
|
+
} else if (displayCheck === "non-zero-area") {
|
|
315
|
+
return isZeroArea(node);
|
|
316
|
+
}
|
|
317
|
+
return false;
|
|
318
|
+
};
|
|
319
|
+
var isDisabledFromFieldset = function isDisabledFromFieldset2(node) {
|
|
320
|
+
if (/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(node.tagName)) {
|
|
321
|
+
var parentNode = node.parentElement;
|
|
322
|
+
while (parentNode) {
|
|
323
|
+
if (parentNode.tagName === "FIELDSET" && parentNode.disabled) {
|
|
324
|
+
for (var i = 0; i < parentNode.children.length; i++) {
|
|
325
|
+
var child = parentNode.children.item(i);
|
|
326
|
+
if (child.tagName === "LEGEND") {
|
|
327
|
+
return matches.call(parentNode, "fieldset[disabled] *") ? true : !child.contains(node);
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
return true;
|
|
331
|
+
}
|
|
332
|
+
parentNode = parentNode.parentElement;
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
return false;
|
|
336
|
+
};
|
|
337
|
+
var isNodeMatchingSelectorFocusable = function isNodeMatchingSelectorFocusable2(options, node) {
|
|
338
|
+
if (node.disabled || isHiddenInput(node) || isHidden(node, options) || // For a details element with a summary, the summary element gets the focus
|
|
339
|
+
isDetailsWithSummary(node) || isDisabledFromFieldset(node)) {
|
|
340
|
+
return false;
|
|
341
|
+
}
|
|
342
|
+
return true;
|
|
343
|
+
};
|
|
344
|
+
var isNodeMatchingSelectorTabbable = function isNodeMatchingSelectorTabbable2(options, node) {
|
|
345
|
+
if (isNonTabbableRadio(node) || getTabIndex(node) < 0 || !isNodeMatchingSelectorFocusable(options, node)) {
|
|
346
|
+
return false;
|
|
347
|
+
}
|
|
348
|
+
return true;
|
|
349
|
+
};
|
|
350
|
+
var isShadowRootTabbable = function isShadowRootTabbable2(shadowHostNode) {
|
|
351
|
+
var tabIndex = parseInt(shadowHostNode.getAttribute("tabindex"), 10);
|
|
352
|
+
if (isNaN(tabIndex) || tabIndex >= 0) {
|
|
353
|
+
return true;
|
|
354
|
+
}
|
|
355
|
+
return false;
|
|
356
|
+
};
|
|
357
|
+
var _sortByOrder = function sortByOrder(candidates) {
|
|
358
|
+
var regularTabbables = [];
|
|
359
|
+
var orderedTabbables = [];
|
|
360
|
+
candidates.forEach(function(item, i) {
|
|
361
|
+
var isScope = !!item.scopeParent;
|
|
362
|
+
var element2 = isScope ? item.scopeParent : item;
|
|
363
|
+
var candidateTabindex = getSortOrderTabIndex(element2, isScope);
|
|
364
|
+
var elements = isScope ? _sortByOrder(item.candidates) : element2;
|
|
365
|
+
if (candidateTabindex === 0) {
|
|
366
|
+
isScope ? regularTabbables.push.apply(regularTabbables, elements) : regularTabbables.push(element2);
|
|
367
|
+
} else {
|
|
368
|
+
orderedTabbables.push({
|
|
369
|
+
documentOrder: i,
|
|
370
|
+
tabIndex: candidateTabindex,
|
|
371
|
+
item,
|
|
372
|
+
isScope,
|
|
373
|
+
content: elements
|
|
374
|
+
});
|
|
375
|
+
}
|
|
376
|
+
});
|
|
377
|
+
return orderedTabbables.sort(sortOrderedTabbables).reduce(function(acc, sortable) {
|
|
378
|
+
sortable.isScope ? acc.push.apply(acc, sortable.content) : acc.push(sortable.content);
|
|
379
|
+
return acc;
|
|
380
|
+
}, []).concat(regularTabbables);
|
|
381
|
+
};
|
|
382
|
+
var tabbable = function tabbable2(container, options) {
|
|
383
|
+
options = options || {};
|
|
384
|
+
var candidates;
|
|
385
|
+
if (options.getShadowRoot) {
|
|
386
|
+
candidates = _getCandidatesIteratively([container], options.includeContainer, {
|
|
387
|
+
filter: isNodeMatchingSelectorTabbable.bind(null, options),
|
|
388
|
+
flatten: false,
|
|
389
|
+
getShadowRoot: options.getShadowRoot,
|
|
390
|
+
shadowRootFilter: isShadowRootTabbable
|
|
391
|
+
});
|
|
392
|
+
} else {
|
|
393
|
+
candidates = getCandidates(container, options.includeContainer, isNodeMatchingSelectorTabbable.bind(null, options));
|
|
394
|
+
}
|
|
395
|
+
return _sortByOrder(candidates);
|
|
396
|
+
};
|
|
397
|
+
var focusable = function focusable2(container, options) {
|
|
398
|
+
options = options || {};
|
|
399
|
+
var candidates;
|
|
400
|
+
if (options.getShadowRoot) {
|
|
401
|
+
candidates = _getCandidatesIteratively([container], options.includeContainer, {
|
|
402
|
+
filter: isNodeMatchingSelectorFocusable.bind(null, options),
|
|
403
|
+
flatten: true,
|
|
404
|
+
getShadowRoot: options.getShadowRoot
|
|
405
|
+
});
|
|
406
|
+
} else {
|
|
407
|
+
candidates = getCandidates(container, options.includeContainer, isNodeMatchingSelectorFocusable.bind(null, options));
|
|
408
|
+
}
|
|
409
|
+
return candidates;
|
|
410
|
+
};
|
|
411
|
+
var isTabbable = function isTabbable2(node, options) {
|
|
412
|
+
options = options || {};
|
|
413
|
+
if (!node) {
|
|
414
|
+
throw new Error("No node provided");
|
|
415
|
+
}
|
|
416
|
+
if (matches.call(node, candidateSelector) === false) {
|
|
417
|
+
return false;
|
|
418
|
+
}
|
|
419
|
+
return isNodeMatchingSelectorTabbable(options, node);
|
|
420
|
+
};
|
|
421
|
+
const getTabbableOptions = () => ({
|
|
422
|
+
getShadowRoot: true,
|
|
423
|
+
displayCheck: (
|
|
424
|
+
// JSDOM does not support the `tabbable` library. To solve this we can
|
|
425
|
+
// check if `ResizeObserver` is a real function (not polyfilled), which
|
|
426
|
+
// determines if the current environment is JSDOM-like.
|
|
427
|
+
typeof ResizeObserver === "function" && ResizeObserver.toString().includes("[native code]") ? "full" : "none"
|
|
428
|
+
)
|
|
429
|
+
});
|
|
430
|
+
function getTabbableIn(container, dir) {
|
|
431
|
+
const list = tabbable(container, getTabbableOptions());
|
|
432
|
+
const len = list.length;
|
|
433
|
+
if (len === 0) {
|
|
434
|
+
return void 0;
|
|
435
|
+
}
|
|
436
|
+
const active = element.activeElement(owner.ownerDocument(container));
|
|
437
|
+
const index = list.indexOf(active);
|
|
438
|
+
const nextIndex = index === -1 ? dir === 1 ? 0 : len - 1 : index + dir;
|
|
439
|
+
return list[nextIndex];
|
|
440
|
+
}
|
|
441
|
+
function getNextTabbable(referenceElement) {
|
|
442
|
+
return getTabbableIn(owner.ownerDocument(referenceElement).body, 1) || referenceElement;
|
|
443
|
+
}
|
|
444
|
+
function getPreviousTabbable(referenceElement) {
|
|
445
|
+
return getTabbableIn(owner.ownerDocument(referenceElement).body, -1) || referenceElement;
|
|
446
|
+
}
|
|
447
|
+
function getTabbableNearElement(referenceElement, dir) {
|
|
448
|
+
if (!referenceElement) {
|
|
449
|
+
return null;
|
|
450
|
+
}
|
|
451
|
+
const list = tabbable(owner.ownerDocument(referenceElement).body, getTabbableOptions());
|
|
452
|
+
const elementCount = list.length;
|
|
453
|
+
if (elementCount === 0) {
|
|
454
|
+
return null;
|
|
455
|
+
}
|
|
456
|
+
const index = list.indexOf(referenceElement);
|
|
457
|
+
if (index === -1) {
|
|
458
|
+
return null;
|
|
459
|
+
}
|
|
460
|
+
const nextIndex = (index + dir + elementCount) % elementCount;
|
|
461
|
+
return list[nextIndex];
|
|
462
|
+
}
|
|
463
|
+
function getTabbableAfterElement(referenceElement) {
|
|
464
|
+
return getTabbableNearElement(referenceElement, 1);
|
|
465
|
+
}
|
|
466
|
+
function getTabbableBeforeElement(referenceElement) {
|
|
467
|
+
return getTabbableNearElement(referenceElement, -1);
|
|
468
|
+
}
|
|
469
|
+
function isOutsideEvent(event2, container) {
|
|
470
|
+
const containerElement = container || event2.currentTarget;
|
|
471
|
+
const relatedTarget = event2.relatedTarget;
|
|
472
|
+
return !relatedTarget || !element.contains(containerElement, relatedTarget);
|
|
473
|
+
}
|
|
474
|
+
function disableFocusInside(container) {
|
|
475
|
+
const tabbableElements = tabbable(container, getTabbableOptions());
|
|
476
|
+
tabbableElements.forEach((element2) => {
|
|
477
|
+
element2.dataset.tabindex = element2.getAttribute("tabindex") || "";
|
|
478
|
+
element2.setAttribute("tabindex", "-1");
|
|
479
|
+
});
|
|
480
|
+
}
|
|
481
|
+
function enableFocusInside(container) {
|
|
482
|
+
const elements = container.querySelectorAll("[data-tabindex]");
|
|
483
|
+
elements.forEach((element2) => {
|
|
484
|
+
const tabindex = element2.dataset.tabindex;
|
|
485
|
+
delete element2.dataset.tabindex;
|
|
486
|
+
if (tabindex) {
|
|
487
|
+
element2.setAttribute("tabindex", tabindex);
|
|
488
|
+
} else {
|
|
489
|
+
element2.removeAttribute("tabindex");
|
|
490
|
+
}
|
|
491
|
+
});
|
|
492
|
+
}
|
|
493
|
+
const FocusGuard = /* @__PURE__ */ React__namespace.forwardRef(function FocusGuard2(props, ref) {
|
|
494
|
+
const [role, setRole] = React__namespace.useState();
|
|
495
|
+
useIsoLayoutEffect.useIsoLayoutEffect(() => {
|
|
496
|
+
if (detectBrowser.isSafari) {
|
|
497
|
+
setRole("button");
|
|
498
|
+
}
|
|
499
|
+
}, []);
|
|
500
|
+
const restProps = {
|
|
501
|
+
tabIndex: 0,
|
|
502
|
+
// Role is only for VoiceOver
|
|
503
|
+
role
|
|
504
|
+
};
|
|
505
|
+
return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx("span", {
|
|
506
|
+
...props,
|
|
507
|
+
ref,
|
|
508
|
+
style: visuallyHidden.visuallyHidden,
|
|
509
|
+
"aria-hidden": role ? void 0 : true,
|
|
510
|
+
...restProps,
|
|
511
|
+
"data-base-ui-focus-guard": ""
|
|
512
|
+
});
|
|
513
|
+
});
|
|
514
|
+
if (process.env.NODE_ENV !== "production") FocusGuard.displayName = "FocusGuard";
|
|
515
|
+
function createAttribute(name) {
|
|
516
|
+
return `data-base-ui-${name}`;
|
|
517
|
+
}
|
|
518
|
+
const PortalContext = /* @__PURE__ */ React__namespace.createContext(null);
|
|
519
|
+
if (process.env.NODE_ENV !== "production") PortalContext.displayName = "PortalContext";
|
|
520
|
+
const usePortalContext = () => React__namespace.useContext(PortalContext);
|
|
521
|
+
const attr = createAttribute("portal");
|
|
522
|
+
function useFloatingPortalNode(props = {}) {
|
|
523
|
+
const {
|
|
524
|
+
ref,
|
|
525
|
+
container: containerProp,
|
|
526
|
+
componentProps = useRenderElement.EMPTY_OBJECT,
|
|
527
|
+
elementProps
|
|
528
|
+
} = props;
|
|
529
|
+
const uniqueId = useBaseUiId.useId();
|
|
530
|
+
const portalContext = usePortalContext();
|
|
531
|
+
const parentPortalNode = portalContext == null ? void 0 : portalContext.portalNode;
|
|
532
|
+
const [containerElement, setContainerElement] = React__namespace.useState(null);
|
|
533
|
+
const [portalNode, setPortalNode] = React__namespace.useState(null);
|
|
534
|
+
const setPortalNodeRef = useStableCallback.useStableCallback((node) => {
|
|
535
|
+
if (node !== null) {
|
|
536
|
+
setPortalNode(node);
|
|
537
|
+
}
|
|
538
|
+
});
|
|
539
|
+
const containerRef = React__namespace.useRef(null);
|
|
540
|
+
useIsoLayoutEffect.useIsoLayoutEffect(() => {
|
|
541
|
+
if (containerProp === null) {
|
|
542
|
+
if (containerRef.current) {
|
|
543
|
+
containerRef.current = null;
|
|
544
|
+
setPortalNode(null);
|
|
545
|
+
setContainerElement(null);
|
|
546
|
+
}
|
|
547
|
+
return;
|
|
548
|
+
}
|
|
549
|
+
if (uniqueId == null) {
|
|
550
|
+
return;
|
|
551
|
+
}
|
|
552
|
+
const resolvedContainer = (containerProp && (floatingUi_utils_dom.isNode(containerProp) ? containerProp : containerProp.current)) ?? parentPortalNode ?? document.body;
|
|
553
|
+
if (resolvedContainer == null) {
|
|
554
|
+
if (containerRef.current) {
|
|
555
|
+
containerRef.current = null;
|
|
556
|
+
setPortalNode(null);
|
|
557
|
+
setContainerElement(null);
|
|
558
|
+
}
|
|
559
|
+
return;
|
|
560
|
+
}
|
|
561
|
+
if (containerRef.current !== resolvedContainer) {
|
|
562
|
+
containerRef.current = resolvedContainer;
|
|
563
|
+
setPortalNode(null);
|
|
564
|
+
setContainerElement(resolvedContainer);
|
|
565
|
+
}
|
|
566
|
+
}, [containerProp, parentPortalNode, uniqueId]);
|
|
567
|
+
const portalElement = useRenderElement.useRenderElement("div", componentProps, {
|
|
568
|
+
ref: [ref, setPortalNodeRef],
|
|
569
|
+
props: [{
|
|
570
|
+
id: uniqueId,
|
|
571
|
+
[attr]: ""
|
|
572
|
+
}, elementProps]
|
|
573
|
+
});
|
|
574
|
+
const portalSubtree = containerElement && portalElement ? /* @__PURE__ */ ReactDOM__namespace.createPortal(portalElement, containerElement) : null;
|
|
575
|
+
return {
|
|
576
|
+
portalNode,
|
|
577
|
+
portalSubtree
|
|
578
|
+
};
|
|
579
|
+
}
|
|
580
|
+
const FloatingPortal = /* @__PURE__ */ React__namespace.forwardRef(function FloatingPortal2(componentProps, forwardedRef) {
|
|
581
|
+
const {
|
|
582
|
+
children,
|
|
583
|
+
container,
|
|
584
|
+
className,
|
|
585
|
+
render,
|
|
586
|
+
renderGuards,
|
|
587
|
+
...elementProps
|
|
588
|
+
} = componentProps;
|
|
589
|
+
const {
|
|
590
|
+
portalNode,
|
|
591
|
+
portalSubtree
|
|
592
|
+
} = useFloatingPortalNode({
|
|
593
|
+
container,
|
|
594
|
+
ref: forwardedRef,
|
|
595
|
+
componentProps,
|
|
596
|
+
elementProps
|
|
597
|
+
});
|
|
598
|
+
const beforeOutsideRef = React__namespace.useRef(null);
|
|
599
|
+
const afterOutsideRef = React__namespace.useRef(null);
|
|
600
|
+
const beforeInsideRef = React__namespace.useRef(null);
|
|
601
|
+
const afterInsideRef = React__namespace.useRef(null);
|
|
602
|
+
const [focusManagerState, setFocusManagerState] = React__namespace.useState(null);
|
|
603
|
+
const modal = focusManagerState == null ? void 0 : focusManagerState.modal;
|
|
604
|
+
const open = focusManagerState == null ? void 0 : focusManagerState.open;
|
|
605
|
+
const shouldRenderGuards = typeof renderGuards === "boolean" ? renderGuards : !!focusManagerState && !focusManagerState.modal && focusManagerState.open && !!portalNode;
|
|
606
|
+
React__namespace.useEffect(() => {
|
|
607
|
+
if (!portalNode || modal) {
|
|
608
|
+
return void 0;
|
|
609
|
+
}
|
|
610
|
+
function onFocus(event2) {
|
|
611
|
+
if (portalNode && event2.relatedTarget && isOutsideEvent(event2)) {
|
|
612
|
+
const focusing = event2.type === "focusin";
|
|
613
|
+
const manageFocus = focusing ? enableFocusInside : disableFocusInside;
|
|
614
|
+
manageFocus(portalNode);
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
portalNode.addEventListener("focusin", onFocus, true);
|
|
618
|
+
portalNode.addEventListener("focusout", onFocus, true);
|
|
619
|
+
return () => {
|
|
620
|
+
portalNode.removeEventListener("focusin", onFocus, true);
|
|
621
|
+
portalNode.removeEventListener("focusout", onFocus, true);
|
|
622
|
+
};
|
|
623
|
+
}, [portalNode, modal]);
|
|
624
|
+
React__namespace.useEffect(() => {
|
|
625
|
+
if (!portalNode || open) {
|
|
626
|
+
return;
|
|
627
|
+
}
|
|
628
|
+
enableFocusInside(portalNode);
|
|
629
|
+
}, [open, portalNode]);
|
|
630
|
+
const portalContextValue = React__namespace.useMemo(() => ({
|
|
631
|
+
beforeOutsideRef,
|
|
632
|
+
afterOutsideRef,
|
|
633
|
+
beforeInsideRef,
|
|
634
|
+
afterInsideRef,
|
|
635
|
+
portalNode,
|
|
636
|
+
setFocusManagerState
|
|
637
|
+
}), [portalNode]);
|
|
638
|
+
return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs(React__namespace.Fragment, {
|
|
639
|
+
children: [portalSubtree, /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs(PortalContext.Provider, {
|
|
640
|
+
value: portalContextValue,
|
|
641
|
+
children: [shouldRenderGuards && portalNode && /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(FocusGuard, {
|
|
642
|
+
"data-type": "outside",
|
|
643
|
+
ref: beforeOutsideRef,
|
|
644
|
+
onFocus: (event2) => {
|
|
645
|
+
var _a;
|
|
646
|
+
if (isOutsideEvent(event2, portalNode)) {
|
|
647
|
+
(_a = beforeInsideRef.current) == null ? void 0 : _a.focus();
|
|
648
|
+
} else {
|
|
649
|
+
const domReference = focusManagerState ? focusManagerState.domReference : null;
|
|
650
|
+
const prevTabbable = getPreviousTabbable(domReference);
|
|
651
|
+
prevTabbable == null ? void 0 : prevTabbable.focus();
|
|
652
|
+
}
|
|
653
|
+
}
|
|
654
|
+
}), shouldRenderGuards && portalNode && /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx("span", {
|
|
655
|
+
"aria-owns": portalNode.id,
|
|
656
|
+
style: ownerVisuallyHidden
|
|
657
|
+
}), portalNode && /* @__PURE__ */ ReactDOM__namespace.createPortal(children, portalNode), shouldRenderGuards && portalNode && /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(FocusGuard, {
|
|
658
|
+
"data-type": "outside",
|
|
659
|
+
ref: afterOutsideRef,
|
|
660
|
+
onFocus: (event2) => {
|
|
661
|
+
var _a;
|
|
662
|
+
if (isOutsideEvent(event2, portalNode)) {
|
|
663
|
+
(_a = afterInsideRef.current) == null ? void 0 : _a.focus();
|
|
664
|
+
} else {
|
|
665
|
+
const domReference = focusManagerState ? focusManagerState.domReference : null;
|
|
666
|
+
const nextTabbable = getNextTabbable(domReference);
|
|
667
|
+
nextTabbable == null ? void 0 : nextTabbable.focus();
|
|
668
|
+
if (focusManagerState == null ? void 0 : focusManagerState.closeOnFocusOut) {
|
|
669
|
+
focusManagerState == null ? void 0 : focusManagerState.onOpenChange(false, createBaseUIEventDetails.createChangeEventDetails(createBaseUIEventDetails.focusOut, event2.nativeEvent));
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
}
|
|
673
|
+
})]
|
|
674
|
+
})]
|
|
675
|
+
});
|
|
676
|
+
});
|
|
677
|
+
if (process.env.NODE_ENV !== "production") FloatingPortal.displayName = "FloatingPortal";
|
|
678
|
+
function createEventEmitter() {
|
|
679
|
+
const map = /* @__PURE__ */ new Map();
|
|
680
|
+
return {
|
|
681
|
+
emit(event2, data) {
|
|
682
|
+
var _a;
|
|
683
|
+
(_a = map.get(event2)) == null ? void 0 : _a.forEach((listener) => listener(data));
|
|
684
|
+
},
|
|
685
|
+
on(event2, listener) {
|
|
686
|
+
if (!map.has(event2)) {
|
|
687
|
+
map.set(event2, /* @__PURE__ */ new Set());
|
|
688
|
+
}
|
|
689
|
+
map.get(event2).add(listener);
|
|
690
|
+
},
|
|
691
|
+
off(event2, listener) {
|
|
692
|
+
var _a;
|
|
693
|
+
(_a = map.get(event2)) == null ? void 0 : _a.delete(listener);
|
|
694
|
+
}
|
|
695
|
+
};
|
|
696
|
+
}
|
|
697
|
+
class FloatingTreeStore {
|
|
698
|
+
constructor() {
|
|
699
|
+
__publicField(this, "nodesRef", {
|
|
700
|
+
current: []
|
|
701
|
+
});
|
|
702
|
+
__publicField(this, "events", createEventEmitter());
|
|
703
|
+
}
|
|
704
|
+
addNode(node) {
|
|
705
|
+
this.nodesRef.current.push(node);
|
|
706
|
+
}
|
|
707
|
+
removeNode(node) {
|
|
708
|
+
const index = this.nodesRef.current.findIndex((n) => n === node);
|
|
709
|
+
if (index !== -1) {
|
|
710
|
+
this.nodesRef.current.splice(index, 1);
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
}
|
|
714
|
+
const FloatingNodeContext = /* @__PURE__ */ React__namespace.createContext(null);
|
|
715
|
+
if (process.env.NODE_ENV !== "production") FloatingNodeContext.displayName = "FloatingNodeContext";
|
|
716
|
+
const FloatingTreeContext = /* @__PURE__ */ React__namespace.createContext(null);
|
|
717
|
+
if (process.env.NODE_ENV !== "production") FloatingTreeContext.displayName = "FloatingTreeContext";
|
|
718
|
+
const useFloatingParentNodeId = () => {
|
|
719
|
+
var _a;
|
|
720
|
+
return ((_a = React__namespace.useContext(FloatingNodeContext)) == null ? void 0 : _a.id) || null;
|
|
721
|
+
};
|
|
722
|
+
const useFloatingTree = (externalTree) => {
|
|
723
|
+
const contextTree = React__namespace.useContext(FloatingTreeContext);
|
|
724
|
+
return externalTree ?? contextTree;
|
|
725
|
+
};
|
|
726
|
+
function useFloatingNodeId(externalTree) {
|
|
727
|
+
const id = useBaseUiId.useId();
|
|
728
|
+
const tree = useFloatingTree(externalTree);
|
|
729
|
+
const parentId = useFloatingParentNodeId();
|
|
730
|
+
useIsoLayoutEffect.useIsoLayoutEffect(() => {
|
|
731
|
+
if (!id) {
|
|
732
|
+
return void 0;
|
|
733
|
+
}
|
|
734
|
+
const node = {
|
|
735
|
+
id,
|
|
736
|
+
parentId
|
|
737
|
+
};
|
|
738
|
+
tree == null ? void 0 : tree.addNode(node);
|
|
739
|
+
return () => {
|
|
740
|
+
tree == null ? void 0 : tree.removeNode(node);
|
|
741
|
+
};
|
|
742
|
+
}, [tree, id, parentId]);
|
|
743
|
+
return id;
|
|
744
|
+
}
|
|
745
|
+
function FloatingNode(props) {
|
|
746
|
+
const {
|
|
747
|
+
children,
|
|
748
|
+
id
|
|
749
|
+
} = props;
|
|
750
|
+
const parentId = useFloatingParentNodeId();
|
|
751
|
+
return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(FloatingNodeContext.Provider, {
|
|
752
|
+
value: React__namespace.useMemo(() => ({
|
|
753
|
+
id,
|
|
754
|
+
parentId
|
|
755
|
+
}), [id, parentId]),
|
|
756
|
+
children
|
|
757
|
+
});
|
|
758
|
+
}
|
|
759
|
+
function FloatingTree(props) {
|
|
760
|
+
const {
|
|
761
|
+
children,
|
|
762
|
+
externalTree
|
|
763
|
+
} = props;
|
|
764
|
+
const tree = useRenderElement.useRefWithInit(() => externalTree ?? new FloatingTreeStore()).current;
|
|
765
|
+
return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(FloatingTreeContext.Provider, {
|
|
766
|
+
value: tree,
|
|
767
|
+
children
|
|
768
|
+
});
|
|
769
|
+
}
|
|
770
|
+
const bubbleHandlerKeys = {
|
|
771
|
+
intentional: "onClick",
|
|
772
|
+
sloppy: "onPointerDown"
|
|
773
|
+
};
|
|
774
|
+
function alwaysFalse() {
|
|
775
|
+
return false;
|
|
776
|
+
}
|
|
777
|
+
function normalizeProp(normalizable) {
|
|
778
|
+
return {
|
|
779
|
+
escapeKey: typeof normalizable === "boolean" ? normalizable : (normalizable == null ? void 0 : normalizable.escapeKey) ?? false,
|
|
780
|
+
outsidePress: typeof normalizable === "boolean" ? normalizable : (normalizable == null ? void 0 : normalizable.outsidePress) ?? true
|
|
781
|
+
};
|
|
782
|
+
}
|
|
783
|
+
function useDismiss(context, props = {}) {
|
|
784
|
+
const store = "rootStore" in context ? context.rootStore : context;
|
|
785
|
+
const open = store.useState("open");
|
|
786
|
+
const floatingElement = store.useState("floatingElement");
|
|
787
|
+
const {
|
|
788
|
+
dataRef
|
|
789
|
+
} = store.context;
|
|
790
|
+
const {
|
|
791
|
+
enabled = true,
|
|
792
|
+
escapeKey = true,
|
|
793
|
+
outsidePress: outsidePressProp = true,
|
|
794
|
+
outsidePressEvent = "sloppy",
|
|
795
|
+
referencePress = alwaysFalse,
|
|
796
|
+
referencePressEvent = "sloppy",
|
|
797
|
+
bubbles,
|
|
798
|
+
externalTree
|
|
799
|
+
} = props;
|
|
800
|
+
const tree = useFloatingTree(externalTree);
|
|
801
|
+
const outsidePressFn = useStableCallback.useStableCallback(typeof outsidePressProp === "function" ? outsidePressProp : () => false);
|
|
802
|
+
const outsidePress = typeof outsidePressProp === "function" ? outsidePressFn : outsidePressProp;
|
|
803
|
+
const outsidePressEnabled = outsidePress !== false;
|
|
804
|
+
const getOutsidePressEventProp = useStableCallback.useStableCallback(() => outsidePressEvent);
|
|
805
|
+
const pressStartedInsideRef = React__namespace.useRef(false);
|
|
806
|
+
const pressStartPreventedRef = React__namespace.useRef(false);
|
|
807
|
+
const suppressNextOutsideClickRef = React__namespace.useRef(false);
|
|
808
|
+
const {
|
|
809
|
+
escapeKey: escapeKeyBubbles,
|
|
810
|
+
outsidePress: outsidePressBubbles
|
|
811
|
+
} = normalizeProp(bubbles);
|
|
812
|
+
const touchStateRef = React__namespace.useRef(null);
|
|
813
|
+
const cancelDismissOnEndTimeout = useTimeout.useTimeout();
|
|
814
|
+
const clearInsideReactTreeTimeout = useTimeout.useTimeout();
|
|
815
|
+
const clearInsideReactTree = useStableCallback.useStableCallback(() => {
|
|
816
|
+
clearInsideReactTreeTimeout.clear();
|
|
817
|
+
dataRef.current.insideReactTree = false;
|
|
818
|
+
});
|
|
819
|
+
const isComposingRef = React__namespace.useRef(false);
|
|
820
|
+
const currentPointerTypeRef = React__namespace.useRef("");
|
|
821
|
+
const isReferencePressEnabled = useStableCallback.useStableCallback(referencePress);
|
|
822
|
+
const closeOnEscapeKeyDown = useStableCallback.useStableCallback((event$1) => {
|
|
823
|
+
var _a;
|
|
824
|
+
if (!open || !enabled || !escapeKey || event$1.key !== "Escape") {
|
|
825
|
+
return;
|
|
826
|
+
}
|
|
827
|
+
if (isComposingRef.current) {
|
|
828
|
+
return;
|
|
829
|
+
}
|
|
830
|
+
const nodeId = (_a = dataRef.current.floatingContext) == null ? void 0 : _a.nodeId;
|
|
831
|
+
const children = tree ? getNodeChildren(tree.nodesRef.current, nodeId) : [];
|
|
832
|
+
if (!escapeKeyBubbles) {
|
|
833
|
+
if (children.length > 0) {
|
|
834
|
+
let shouldDismiss = true;
|
|
835
|
+
children.forEach((child) => {
|
|
836
|
+
var _a2;
|
|
837
|
+
if (((_a2 = child.context) == null ? void 0 : _a2.open) && !child.context.dataRef.current.__escapeKeyBubbles) {
|
|
838
|
+
shouldDismiss = false;
|
|
839
|
+
}
|
|
840
|
+
});
|
|
841
|
+
if (!shouldDismiss) {
|
|
842
|
+
return;
|
|
843
|
+
}
|
|
844
|
+
}
|
|
845
|
+
}
|
|
846
|
+
const native = event.isReactEvent(event$1) ? event$1.nativeEvent : event$1;
|
|
847
|
+
const eventDetails = createBaseUIEventDetails.createChangeEventDetails(createBaseUIEventDetails.escapeKey, native);
|
|
848
|
+
store.setOpen(false, eventDetails);
|
|
849
|
+
if (!escapeKeyBubbles && !eventDetails.isPropagationAllowed) {
|
|
850
|
+
event$1.stopPropagation();
|
|
851
|
+
}
|
|
852
|
+
});
|
|
853
|
+
const markInsideReactTree = useStableCallback.useStableCallback(() => {
|
|
854
|
+
dataRef.current.insideReactTree = true;
|
|
855
|
+
clearInsideReactTreeTimeout.start(0, clearInsideReactTree);
|
|
856
|
+
});
|
|
857
|
+
React__namespace.useEffect(() => {
|
|
858
|
+
if (!open || !enabled) {
|
|
859
|
+
return void 0;
|
|
860
|
+
}
|
|
861
|
+
dataRef.current.__escapeKeyBubbles = escapeKeyBubbles;
|
|
862
|
+
dataRef.current.__outsidePressBubbles = outsidePressBubbles;
|
|
863
|
+
const compositionTimeout = new useTimeout.Timeout();
|
|
864
|
+
const preventedPressSuppressionTimeout = new useTimeout.Timeout();
|
|
865
|
+
function handleCompositionStart() {
|
|
866
|
+
compositionTimeout.clear();
|
|
867
|
+
isComposingRef.current = true;
|
|
868
|
+
}
|
|
869
|
+
function handleCompositionEnd() {
|
|
870
|
+
compositionTimeout.start(
|
|
871
|
+
// 0ms or 1ms don't work in Safari. 5ms appears to consistently work.
|
|
872
|
+
// Only apply to WebKit for the test to remain 0ms.
|
|
873
|
+
floatingUi_utils_dom.isWebKit() ? 5 : 0,
|
|
874
|
+
() => {
|
|
875
|
+
isComposingRef.current = false;
|
|
876
|
+
}
|
|
877
|
+
);
|
|
878
|
+
}
|
|
879
|
+
function suppressImmediateOutsideClickAfterPreventedStart() {
|
|
880
|
+
suppressNextOutsideClickRef.current = true;
|
|
881
|
+
preventedPressSuppressionTimeout.start(0, () => {
|
|
882
|
+
suppressNextOutsideClickRef.current = false;
|
|
883
|
+
});
|
|
884
|
+
}
|
|
885
|
+
function resetPressStartState() {
|
|
886
|
+
pressStartedInsideRef.current = false;
|
|
887
|
+
pressStartPreventedRef.current = false;
|
|
888
|
+
}
|
|
889
|
+
function getOutsidePressEvent() {
|
|
890
|
+
const type = currentPointerTypeRef.current;
|
|
891
|
+
const computedType = type === "pen" || !type ? "mouse" : type;
|
|
892
|
+
const outsidePressEventValue = getOutsidePressEventProp();
|
|
893
|
+
const resolved = typeof outsidePressEventValue === "function" ? outsidePressEventValue() : outsidePressEventValue;
|
|
894
|
+
if (typeof resolved === "string") {
|
|
895
|
+
return resolved;
|
|
896
|
+
}
|
|
897
|
+
return resolved[computedType];
|
|
898
|
+
}
|
|
899
|
+
function shouldIgnoreEvent(event2) {
|
|
900
|
+
const computedOutsidePressEvent = getOutsidePressEvent();
|
|
901
|
+
return computedOutsidePressEvent === "intentional" && event2.type !== "click" || computedOutsidePressEvent === "sloppy" && event2.type === "click";
|
|
902
|
+
}
|
|
903
|
+
function isEventWithinFloatingTree(event2) {
|
|
904
|
+
var _a;
|
|
905
|
+
const nodeId = (_a = dataRef.current.floatingContext) == null ? void 0 : _a.nodeId;
|
|
906
|
+
const targetIsInsideChildren = tree && getNodeChildren(tree.nodesRef.current, nodeId).some((node) => {
|
|
907
|
+
var _a2;
|
|
908
|
+
return element.isEventTargetWithin(event2, (_a2 = node.context) == null ? void 0 : _a2.elements.floating);
|
|
909
|
+
});
|
|
910
|
+
return element.isEventTargetWithin(event2, store.select("floatingElement")) || element.isEventTargetWithin(event2, store.select("domReferenceElement")) || targetIsInsideChildren;
|
|
911
|
+
}
|
|
912
|
+
function closeOnPressOutside(event2) {
|
|
913
|
+
var _a;
|
|
914
|
+
if (shouldIgnoreEvent(event2)) {
|
|
915
|
+
clearInsideReactTree();
|
|
916
|
+
return;
|
|
917
|
+
}
|
|
918
|
+
if (dataRef.current.insideReactTree) {
|
|
919
|
+
clearInsideReactTree();
|
|
920
|
+
return;
|
|
921
|
+
}
|
|
922
|
+
const target = element.getTarget(event2);
|
|
923
|
+
const inertSelector = `[${createAttribute("inert")}]`;
|
|
924
|
+
let markers = Array.from(owner.ownerDocument(store.select("floatingElement")).querySelectorAll(inertSelector));
|
|
925
|
+
const targetRoot = floatingUi_utils_dom.isElement(target) ? target.getRootNode() : null;
|
|
926
|
+
if (floatingUi_utils_dom.isShadowRoot(targetRoot)) {
|
|
927
|
+
markers = markers.concat(Array.from(targetRoot.querySelectorAll(inertSelector)));
|
|
928
|
+
}
|
|
929
|
+
const triggers = store.context.triggerElements;
|
|
930
|
+
if (target && (triggers.hasElement(target) || triggers.hasMatchingElement((trigger) => element.contains(trigger, target)))) {
|
|
931
|
+
return;
|
|
932
|
+
}
|
|
933
|
+
let targetRootAncestor = floatingUi_utils_dom.isElement(target) ? target : null;
|
|
934
|
+
while (targetRootAncestor && !floatingUi_utils_dom.isLastTraversableNode(targetRootAncestor)) {
|
|
935
|
+
const nextParent = floatingUi_utils_dom.getParentNode(targetRootAncestor);
|
|
936
|
+
if (floatingUi_utils_dom.isLastTraversableNode(nextParent) || !floatingUi_utils_dom.isElement(nextParent)) {
|
|
937
|
+
break;
|
|
938
|
+
}
|
|
939
|
+
targetRootAncestor = nextParent;
|
|
940
|
+
}
|
|
941
|
+
if (markers.length && floatingUi_utils_dom.isElement(target) && !element.isRootElement(target) && // Clicked on a direct ancestor (e.g. FloatingOverlay).
|
|
942
|
+
!element.contains(target, store.select("floatingElement")) && // If the target root element contains none of the markers, then the
|
|
943
|
+
// element was injected after the floating element rendered.
|
|
944
|
+
markers.every((marker) => !element.contains(targetRootAncestor, marker))) {
|
|
945
|
+
return;
|
|
946
|
+
}
|
|
947
|
+
if (floatingUi_utils_dom.isHTMLElement(target) && !("touches" in event2)) {
|
|
948
|
+
const lastTraversableNode = floatingUi_utils_dom.isLastTraversableNode(target);
|
|
949
|
+
const style = floatingUi_utils_dom.getComputedStyle(target);
|
|
950
|
+
const scrollRe = /auto|scroll/;
|
|
951
|
+
const isScrollableX = lastTraversableNode || scrollRe.test(style.overflowX);
|
|
952
|
+
const isScrollableY = lastTraversableNode || scrollRe.test(style.overflowY);
|
|
953
|
+
const canScrollX = isScrollableX && target.clientWidth > 0 && target.scrollWidth > target.clientWidth;
|
|
954
|
+
const canScrollY = isScrollableY && target.clientHeight > 0 && target.scrollHeight > target.clientHeight;
|
|
955
|
+
const isRTL = style.direction === "rtl";
|
|
956
|
+
const pressedVerticalScrollbar = canScrollY && (isRTL ? event2.offsetX <= target.offsetWidth - target.clientWidth : event2.offsetX > target.clientWidth);
|
|
957
|
+
const pressedHorizontalScrollbar = canScrollX && event2.offsetY > target.clientHeight;
|
|
958
|
+
if (pressedVerticalScrollbar || pressedHorizontalScrollbar) {
|
|
959
|
+
return;
|
|
960
|
+
}
|
|
961
|
+
}
|
|
962
|
+
if (isEventWithinFloatingTree(event2)) {
|
|
963
|
+
return;
|
|
964
|
+
}
|
|
965
|
+
if (getOutsidePressEvent() === "intentional" && suppressNextOutsideClickRef.current) {
|
|
966
|
+
preventedPressSuppressionTimeout.clear();
|
|
967
|
+
suppressNextOutsideClickRef.current = false;
|
|
968
|
+
return;
|
|
969
|
+
}
|
|
970
|
+
if (typeof outsidePress === "function" && !outsidePress(event2)) {
|
|
971
|
+
return;
|
|
972
|
+
}
|
|
973
|
+
const nodeId = (_a = dataRef.current.floatingContext) == null ? void 0 : _a.nodeId;
|
|
974
|
+
const children = tree ? getNodeChildren(tree.nodesRef.current, nodeId) : [];
|
|
975
|
+
if (children.length > 0) {
|
|
976
|
+
let shouldDismiss = true;
|
|
977
|
+
children.forEach((child) => {
|
|
978
|
+
var _a2;
|
|
979
|
+
if (((_a2 = child.context) == null ? void 0 : _a2.open) && !child.context.dataRef.current.__outsidePressBubbles) {
|
|
980
|
+
shouldDismiss = false;
|
|
981
|
+
}
|
|
982
|
+
});
|
|
983
|
+
if (!shouldDismiss) {
|
|
984
|
+
return;
|
|
985
|
+
}
|
|
986
|
+
}
|
|
987
|
+
store.setOpen(false, createBaseUIEventDetails.createChangeEventDetails(createBaseUIEventDetails.outsidePress, event2));
|
|
988
|
+
clearInsideReactTree();
|
|
989
|
+
}
|
|
990
|
+
function handlePointerDown(event2) {
|
|
991
|
+
if (getOutsidePressEvent() !== "sloppy" || event2.pointerType === "touch" || !store.select("open") || !enabled || element.isEventTargetWithin(event2, store.select("floatingElement")) || element.isEventTargetWithin(event2, store.select("domReferenceElement"))) {
|
|
992
|
+
return;
|
|
993
|
+
}
|
|
994
|
+
closeOnPressOutside(event2);
|
|
995
|
+
}
|
|
996
|
+
function handleTouchStart(event2) {
|
|
997
|
+
if (getOutsidePressEvent() !== "sloppy" || !store.select("open") || !enabled || element.isEventTargetWithin(event2, store.select("floatingElement")) || element.isEventTargetWithin(event2, store.select("domReferenceElement"))) {
|
|
998
|
+
return;
|
|
999
|
+
}
|
|
1000
|
+
const touch = event2.touches[0];
|
|
1001
|
+
if (touch) {
|
|
1002
|
+
touchStateRef.current = {
|
|
1003
|
+
startTime: Date.now(),
|
|
1004
|
+
startX: touch.clientX,
|
|
1005
|
+
startY: touch.clientY,
|
|
1006
|
+
dismissOnTouchEnd: false,
|
|
1007
|
+
dismissOnMouseDown: true
|
|
1008
|
+
};
|
|
1009
|
+
cancelDismissOnEndTimeout.start(1e3, () => {
|
|
1010
|
+
if (touchStateRef.current) {
|
|
1011
|
+
touchStateRef.current.dismissOnTouchEnd = false;
|
|
1012
|
+
touchStateRef.current.dismissOnMouseDown = false;
|
|
1013
|
+
}
|
|
1014
|
+
});
|
|
1015
|
+
}
|
|
1016
|
+
}
|
|
1017
|
+
function handleTouchStartCapture(event2) {
|
|
1018
|
+
currentPointerTypeRef.current = "touch";
|
|
1019
|
+
const target = element.getTarget(event2);
|
|
1020
|
+
function callback() {
|
|
1021
|
+
handleTouchStart(event2);
|
|
1022
|
+
target == null ? void 0 : target.removeEventListener(event2.type, callback);
|
|
1023
|
+
}
|
|
1024
|
+
target == null ? void 0 : target.addEventListener(event2.type, callback);
|
|
1025
|
+
}
|
|
1026
|
+
function closeOnPressOutsideCapture(event2) {
|
|
1027
|
+
cancelDismissOnEndTimeout.clear();
|
|
1028
|
+
if (event2.type === "pointerdown") {
|
|
1029
|
+
currentPointerTypeRef.current = event2.pointerType;
|
|
1030
|
+
}
|
|
1031
|
+
if (event2.type === "mousedown" && touchStateRef.current && !touchStateRef.current.dismissOnMouseDown) {
|
|
1032
|
+
return;
|
|
1033
|
+
}
|
|
1034
|
+
const target = element.getTarget(event2);
|
|
1035
|
+
function callback() {
|
|
1036
|
+
if (event2.type === "pointerdown") {
|
|
1037
|
+
handlePointerDown(event2);
|
|
1038
|
+
} else {
|
|
1039
|
+
closeOnPressOutside(event2);
|
|
1040
|
+
}
|
|
1041
|
+
target == null ? void 0 : target.removeEventListener(event2.type, callback);
|
|
1042
|
+
}
|
|
1043
|
+
target == null ? void 0 : target.addEventListener(event2.type, callback);
|
|
1044
|
+
}
|
|
1045
|
+
function handlePressEndCapture(event2) {
|
|
1046
|
+
if (!pressStartedInsideRef.current) {
|
|
1047
|
+
return;
|
|
1048
|
+
}
|
|
1049
|
+
const pressStartedInsideDefaultPrevented = pressStartPreventedRef.current;
|
|
1050
|
+
resetPressStartState();
|
|
1051
|
+
if (getOutsidePressEvent() !== "intentional") {
|
|
1052
|
+
return;
|
|
1053
|
+
}
|
|
1054
|
+
if (event2.type === "pointercancel") {
|
|
1055
|
+
if (pressStartedInsideDefaultPrevented) {
|
|
1056
|
+
suppressImmediateOutsideClickAfterPreventedStart();
|
|
1057
|
+
}
|
|
1058
|
+
return;
|
|
1059
|
+
}
|
|
1060
|
+
if (isEventWithinFloatingTree(event2)) {
|
|
1061
|
+
return;
|
|
1062
|
+
}
|
|
1063
|
+
if (pressStartedInsideDefaultPrevented) {
|
|
1064
|
+
suppressImmediateOutsideClickAfterPreventedStart();
|
|
1065
|
+
return;
|
|
1066
|
+
}
|
|
1067
|
+
if (typeof outsidePress === "function" && !outsidePress(event2)) {
|
|
1068
|
+
return;
|
|
1069
|
+
}
|
|
1070
|
+
preventedPressSuppressionTimeout.clear();
|
|
1071
|
+
suppressNextOutsideClickRef.current = true;
|
|
1072
|
+
clearInsideReactTree();
|
|
1073
|
+
}
|
|
1074
|
+
function handleTouchMove(event2) {
|
|
1075
|
+
if (getOutsidePressEvent() !== "sloppy" || !touchStateRef.current || element.isEventTargetWithin(event2, store.select("floatingElement")) || element.isEventTargetWithin(event2, store.select("domReferenceElement"))) {
|
|
1076
|
+
return;
|
|
1077
|
+
}
|
|
1078
|
+
const touch = event2.touches[0];
|
|
1079
|
+
if (!touch) {
|
|
1080
|
+
return;
|
|
1081
|
+
}
|
|
1082
|
+
const deltaX = Math.abs(touch.clientX - touchStateRef.current.startX);
|
|
1083
|
+
const deltaY = Math.abs(touch.clientY - touchStateRef.current.startY);
|
|
1084
|
+
const distance = Math.sqrt(deltaX * deltaX + deltaY * deltaY);
|
|
1085
|
+
if (distance > 5) {
|
|
1086
|
+
touchStateRef.current.dismissOnTouchEnd = true;
|
|
1087
|
+
}
|
|
1088
|
+
if (distance > 10) {
|
|
1089
|
+
closeOnPressOutside(event2);
|
|
1090
|
+
cancelDismissOnEndTimeout.clear();
|
|
1091
|
+
touchStateRef.current = null;
|
|
1092
|
+
}
|
|
1093
|
+
}
|
|
1094
|
+
function handleTouchMoveCapture(event2) {
|
|
1095
|
+
const target = element.getTarget(event2);
|
|
1096
|
+
function callback() {
|
|
1097
|
+
handleTouchMove(event2);
|
|
1098
|
+
target == null ? void 0 : target.removeEventListener(event2.type, callback);
|
|
1099
|
+
}
|
|
1100
|
+
target == null ? void 0 : target.addEventListener(event2.type, callback);
|
|
1101
|
+
}
|
|
1102
|
+
function handleTouchEnd(event2) {
|
|
1103
|
+
if (getOutsidePressEvent() !== "sloppy" || !touchStateRef.current || element.isEventTargetWithin(event2, store.select("floatingElement")) || element.isEventTargetWithin(event2, store.select("domReferenceElement"))) {
|
|
1104
|
+
return;
|
|
1105
|
+
}
|
|
1106
|
+
if (touchStateRef.current.dismissOnTouchEnd) {
|
|
1107
|
+
closeOnPressOutside(event2);
|
|
1108
|
+
}
|
|
1109
|
+
cancelDismissOnEndTimeout.clear();
|
|
1110
|
+
touchStateRef.current = null;
|
|
1111
|
+
}
|
|
1112
|
+
function handleTouchEndCapture(event2) {
|
|
1113
|
+
const target = element.getTarget(event2);
|
|
1114
|
+
function callback() {
|
|
1115
|
+
handleTouchEnd(event2);
|
|
1116
|
+
target == null ? void 0 : target.removeEventListener(event2.type, callback);
|
|
1117
|
+
}
|
|
1118
|
+
target == null ? void 0 : target.addEventListener(event2.type, callback);
|
|
1119
|
+
}
|
|
1120
|
+
const doc = owner.ownerDocument(floatingElement);
|
|
1121
|
+
if (escapeKey) {
|
|
1122
|
+
doc.addEventListener("keydown", closeOnEscapeKeyDown);
|
|
1123
|
+
doc.addEventListener("compositionstart", handleCompositionStart);
|
|
1124
|
+
doc.addEventListener("compositionend", handleCompositionEnd);
|
|
1125
|
+
}
|
|
1126
|
+
if (outsidePressEnabled) {
|
|
1127
|
+
doc.addEventListener("click", closeOnPressOutsideCapture, true);
|
|
1128
|
+
doc.addEventListener("pointerdown", closeOnPressOutsideCapture, true);
|
|
1129
|
+
doc.addEventListener("pointerup", handlePressEndCapture, true);
|
|
1130
|
+
doc.addEventListener("pointercancel", handlePressEndCapture, true);
|
|
1131
|
+
doc.addEventListener("mousedown", closeOnPressOutsideCapture, true);
|
|
1132
|
+
doc.addEventListener("mouseup", handlePressEndCapture, true);
|
|
1133
|
+
doc.addEventListener("touchstart", handleTouchStartCapture, true);
|
|
1134
|
+
doc.addEventListener("touchmove", handleTouchMoveCapture, true);
|
|
1135
|
+
doc.addEventListener("touchend", handleTouchEndCapture, true);
|
|
1136
|
+
}
|
|
1137
|
+
return () => {
|
|
1138
|
+
if (escapeKey) {
|
|
1139
|
+
doc.removeEventListener("keydown", closeOnEscapeKeyDown);
|
|
1140
|
+
doc.removeEventListener("compositionstart", handleCompositionStart);
|
|
1141
|
+
doc.removeEventListener("compositionend", handleCompositionEnd);
|
|
1142
|
+
}
|
|
1143
|
+
if (outsidePressEnabled) {
|
|
1144
|
+
doc.removeEventListener("click", closeOnPressOutsideCapture, true);
|
|
1145
|
+
doc.removeEventListener("pointerdown", closeOnPressOutsideCapture, true);
|
|
1146
|
+
doc.removeEventListener("pointerup", handlePressEndCapture, true);
|
|
1147
|
+
doc.removeEventListener("pointercancel", handlePressEndCapture, true);
|
|
1148
|
+
doc.removeEventListener("mousedown", closeOnPressOutsideCapture, true);
|
|
1149
|
+
doc.removeEventListener("mouseup", handlePressEndCapture, true);
|
|
1150
|
+
doc.removeEventListener("touchstart", handleTouchStartCapture, true);
|
|
1151
|
+
doc.removeEventListener("touchmove", handleTouchMoveCapture, true);
|
|
1152
|
+
doc.removeEventListener("touchend", handleTouchEndCapture, true);
|
|
1153
|
+
}
|
|
1154
|
+
compositionTimeout.clear();
|
|
1155
|
+
preventedPressSuppressionTimeout.clear();
|
|
1156
|
+
resetPressStartState();
|
|
1157
|
+
suppressNextOutsideClickRef.current = false;
|
|
1158
|
+
};
|
|
1159
|
+
}, [dataRef, floatingElement, escapeKey, outsidePressEnabled, outsidePress, open, enabled, escapeKeyBubbles, outsidePressBubbles, closeOnEscapeKeyDown, clearInsideReactTree, getOutsidePressEventProp, tree, store, cancelDismissOnEndTimeout]);
|
|
1160
|
+
React__namespace.useEffect(clearInsideReactTree, [outsidePress, clearInsideReactTree]);
|
|
1161
|
+
const reference = React__namespace.useMemo(() => ({
|
|
1162
|
+
onKeyDown: closeOnEscapeKeyDown,
|
|
1163
|
+
[bubbleHandlerKeys[referencePressEvent]]: (event2) => {
|
|
1164
|
+
if (!isReferencePressEnabled()) {
|
|
1165
|
+
return;
|
|
1166
|
+
}
|
|
1167
|
+
store.setOpen(false, createBaseUIEventDetails.createChangeEventDetails(createBaseUIEventDetails.triggerPress, event2.nativeEvent));
|
|
1168
|
+
},
|
|
1169
|
+
...referencePressEvent !== "intentional" && {
|
|
1170
|
+
onClick(event2) {
|
|
1171
|
+
if (!isReferencePressEnabled()) {
|
|
1172
|
+
return;
|
|
1173
|
+
}
|
|
1174
|
+
store.setOpen(false, createBaseUIEventDetails.createChangeEventDetails(createBaseUIEventDetails.triggerPress, event2.nativeEvent));
|
|
1175
|
+
}
|
|
1176
|
+
}
|
|
1177
|
+
}), [closeOnEscapeKeyDown, store, referencePressEvent, isReferencePressEnabled]);
|
|
1178
|
+
const markPressStartedInsideReactTree = useStableCallback.useStableCallback((event2) => {
|
|
1179
|
+
if (!open || !enabled || event2.button !== 0) {
|
|
1180
|
+
return;
|
|
1181
|
+
}
|
|
1182
|
+
const target = element.getTarget(event2.nativeEvent);
|
|
1183
|
+
if (!element.contains(store.select("floatingElement"), target)) {
|
|
1184
|
+
return;
|
|
1185
|
+
}
|
|
1186
|
+
if (!pressStartedInsideRef.current) {
|
|
1187
|
+
pressStartedInsideRef.current = true;
|
|
1188
|
+
pressStartPreventedRef.current = false;
|
|
1189
|
+
}
|
|
1190
|
+
});
|
|
1191
|
+
const markInsidePressStartPrevented = useStableCallback.useStableCallback((event2) => {
|
|
1192
|
+
if (!open || !enabled) {
|
|
1193
|
+
return;
|
|
1194
|
+
}
|
|
1195
|
+
if (!(event2.defaultPrevented || event2.nativeEvent.defaultPrevented)) {
|
|
1196
|
+
return;
|
|
1197
|
+
}
|
|
1198
|
+
if (pressStartedInsideRef.current) {
|
|
1199
|
+
pressStartPreventedRef.current = true;
|
|
1200
|
+
}
|
|
1201
|
+
});
|
|
1202
|
+
const floating = React__namespace.useMemo(() => ({
|
|
1203
|
+
onKeyDown: closeOnEscapeKeyDown,
|
|
1204
|
+
// `onMouseDown` may be blocked if `event.preventDefault()` is called in
|
|
1205
|
+
// `onPointerDown`, such as with <NumberField.ScrubArea>.
|
|
1206
|
+
// See https://github.com/mui/base-ui/pull/3379
|
|
1207
|
+
onPointerDown: markInsidePressStartPrevented,
|
|
1208
|
+
onMouseDown: markInsidePressStartPrevented,
|
|
1209
|
+
onClickCapture: markInsideReactTree,
|
|
1210
|
+
onMouseDownCapture(event2) {
|
|
1211
|
+
markInsideReactTree();
|
|
1212
|
+
markPressStartedInsideReactTree(event2);
|
|
1213
|
+
},
|
|
1214
|
+
onPointerDownCapture(event2) {
|
|
1215
|
+
markInsideReactTree();
|
|
1216
|
+
markPressStartedInsideReactTree(event2);
|
|
1217
|
+
},
|
|
1218
|
+
onMouseUpCapture: markInsideReactTree,
|
|
1219
|
+
onTouchEndCapture: markInsideReactTree,
|
|
1220
|
+
onTouchMoveCapture: markInsideReactTree
|
|
1221
|
+
}), [closeOnEscapeKeyDown, markInsideReactTree, markPressStartedInsideReactTree, markInsidePressStartPrevented]);
|
|
1222
|
+
return React__namespace.useMemo(() => enabled ? {
|
|
1223
|
+
reference,
|
|
1224
|
+
floating,
|
|
1225
|
+
trigger: reference
|
|
1226
|
+
} : {}, [enabled, reference, floating]);
|
|
1227
|
+
}
|
|
1228
|
+
var runIdentityFunctionCheck = (resultFunc, inputSelectorsResults, outputSelectorResult) => {
|
|
1229
|
+
if (inputSelectorsResults.length === 1 && inputSelectorsResults[0] === outputSelectorResult) {
|
|
1230
|
+
let isInputSameAsOutput = false;
|
|
1231
|
+
try {
|
|
1232
|
+
const emptyObject = {};
|
|
1233
|
+
if (resultFunc(emptyObject) === emptyObject)
|
|
1234
|
+
isInputSameAsOutput = true;
|
|
1235
|
+
} catch {
|
|
1236
|
+
}
|
|
1237
|
+
if (isInputSameAsOutput) {
|
|
1238
|
+
let stack = void 0;
|
|
1239
|
+
try {
|
|
1240
|
+
throw new Error();
|
|
1241
|
+
} catch (e) {
|
|
1242
|
+
({ stack } = e);
|
|
1243
|
+
}
|
|
1244
|
+
console.warn(
|
|
1245
|
+
"The result function returned its own inputs without modification. e.g\n`createSelector([state => state.todos], todos => todos)`\nThis could lead to inefficient memoization and unnecessary re-renders.\nEnsure transformation logic is in the result function, and extraction logic is in the input selectors.",
|
|
1246
|
+
{ stack }
|
|
1247
|
+
);
|
|
1248
|
+
}
|
|
1249
|
+
}
|
|
1250
|
+
};
|
|
1251
|
+
var runInputStabilityCheck = (inputSelectorResultsObject, options, inputSelectorArgs) => {
|
|
1252
|
+
const { memoize, memoizeOptions } = options;
|
|
1253
|
+
const { inputSelectorResults, inputSelectorResultsCopy } = inputSelectorResultsObject;
|
|
1254
|
+
const createAnEmptyObject = memoize(() => ({}), ...memoizeOptions);
|
|
1255
|
+
const areInputSelectorResultsEqual = createAnEmptyObject.apply(null, inputSelectorResults) === createAnEmptyObject.apply(null, inputSelectorResultsCopy);
|
|
1256
|
+
if (!areInputSelectorResultsEqual) {
|
|
1257
|
+
let stack = void 0;
|
|
1258
|
+
try {
|
|
1259
|
+
throw new Error();
|
|
1260
|
+
} catch (e) {
|
|
1261
|
+
({ stack } = e);
|
|
1262
|
+
}
|
|
1263
|
+
console.warn(
|
|
1264
|
+
"An input selector returned a different result when passed same arguments.\nThis means your output selector will likely run more frequently than intended.\nAvoid returning a new reference inside your input selector, e.g.\n`createSelector([state => state.todos.map(todo => todo.id)], todoIds => todoIds.length)`",
|
|
1265
|
+
{
|
|
1266
|
+
arguments: inputSelectorArgs,
|
|
1267
|
+
firstInputs: inputSelectorResults,
|
|
1268
|
+
secondInputs: inputSelectorResultsCopy,
|
|
1269
|
+
stack
|
|
1270
|
+
}
|
|
1271
|
+
);
|
|
1272
|
+
}
|
|
1273
|
+
};
|
|
1274
|
+
var globalDevModeChecks = {
|
|
1275
|
+
inputStabilityCheck: "once",
|
|
1276
|
+
identityFunctionCheck: "once"
|
|
1277
|
+
};
|
|
1278
|
+
var NOT_FOUND = /* @__PURE__ */ Symbol("NOT_FOUND");
|
|
1279
|
+
function assertIsFunction(func, errorMessage = `expected a function, instead received ${typeof func}`) {
|
|
1280
|
+
if (typeof func !== "function") {
|
|
1281
|
+
throw new TypeError(errorMessage);
|
|
1282
|
+
}
|
|
1283
|
+
}
|
|
1284
|
+
function assertIsObject(object, errorMessage = `expected an object, instead received ${typeof object}`) {
|
|
1285
|
+
if (typeof object !== "object") {
|
|
1286
|
+
throw new TypeError(errorMessage);
|
|
1287
|
+
}
|
|
1288
|
+
}
|
|
1289
|
+
function assertIsArrayOfFunctions(array, errorMessage = `expected all items to be functions, instead received the following types: `) {
|
|
1290
|
+
if (!array.every((item) => typeof item === "function")) {
|
|
1291
|
+
const itemTypes = array.map(
|
|
1292
|
+
(item) => typeof item === "function" ? `function ${item.name || "unnamed"}()` : typeof item
|
|
1293
|
+
).join(", ");
|
|
1294
|
+
throw new TypeError(`${errorMessage}[${itemTypes}]`);
|
|
1295
|
+
}
|
|
1296
|
+
}
|
|
1297
|
+
var ensureIsArray = (item) => {
|
|
1298
|
+
return Array.isArray(item) ? item : [item];
|
|
1299
|
+
};
|
|
1300
|
+
function getDependencies(createSelectorArgs) {
|
|
1301
|
+
const dependencies = Array.isArray(createSelectorArgs[0]) ? createSelectorArgs[0] : createSelectorArgs;
|
|
1302
|
+
assertIsArrayOfFunctions(
|
|
1303
|
+
dependencies,
|
|
1304
|
+
`createSelector expects all input-selectors to be functions, but received the following types: `
|
|
1305
|
+
);
|
|
1306
|
+
return dependencies;
|
|
1307
|
+
}
|
|
1308
|
+
function collectInputSelectorResults(dependencies, inputSelectorArgs) {
|
|
1309
|
+
const inputSelectorResults = [];
|
|
1310
|
+
const { length } = dependencies;
|
|
1311
|
+
for (let i = 0; i < length; i++) {
|
|
1312
|
+
inputSelectorResults.push(dependencies[i].apply(null, inputSelectorArgs));
|
|
1313
|
+
}
|
|
1314
|
+
return inputSelectorResults;
|
|
1315
|
+
}
|
|
1316
|
+
var getDevModeChecksExecutionInfo = (firstRun, devModeChecks) => {
|
|
1317
|
+
const { identityFunctionCheck, inputStabilityCheck } = {
|
|
1318
|
+
...globalDevModeChecks,
|
|
1319
|
+
...devModeChecks
|
|
1320
|
+
};
|
|
1321
|
+
return {
|
|
1322
|
+
identityFunctionCheck: {
|
|
1323
|
+
shouldRun: identityFunctionCheck === "always" || identityFunctionCheck === "once" && firstRun,
|
|
1324
|
+
run: runIdentityFunctionCheck
|
|
1325
|
+
},
|
|
1326
|
+
inputStabilityCheck: {
|
|
1327
|
+
shouldRun: inputStabilityCheck === "always" || inputStabilityCheck === "once" && firstRun,
|
|
1328
|
+
run: runInputStabilityCheck
|
|
1329
|
+
}
|
|
1330
|
+
};
|
|
1331
|
+
};
|
|
1332
|
+
function createSingletonCache(equals) {
|
|
1333
|
+
let entry;
|
|
1334
|
+
return {
|
|
1335
|
+
get(key) {
|
|
1336
|
+
if (entry && equals(entry.key, key)) {
|
|
1337
|
+
return entry.value;
|
|
1338
|
+
}
|
|
1339
|
+
return NOT_FOUND;
|
|
1340
|
+
},
|
|
1341
|
+
put(key, value) {
|
|
1342
|
+
entry = { key, value };
|
|
1343
|
+
},
|
|
1344
|
+
getEntries() {
|
|
1345
|
+
return entry ? [entry] : [];
|
|
1346
|
+
},
|
|
1347
|
+
clear() {
|
|
1348
|
+
entry = void 0;
|
|
1349
|
+
}
|
|
1350
|
+
};
|
|
1351
|
+
}
|
|
1352
|
+
function createLruCache(maxSize, equals) {
|
|
1353
|
+
let entries = [];
|
|
1354
|
+
function get(key) {
|
|
1355
|
+
const cacheIndex = entries.findIndex((entry) => equals(key, entry.key));
|
|
1356
|
+
if (cacheIndex > -1) {
|
|
1357
|
+
const entry = entries[cacheIndex];
|
|
1358
|
+
if (cacheIndex > 0) {
|
|
1359
|
+
entries.splice(cacheIndex, 1);
|
|
1360
|
+
entries.unshift(entry);
|
|
1361
|
+
}
|
|
1362
|
+
return entry.value;
|
|
1363
|
+
}
|
|
1364
|
+
return NOT_FOUND;
|
|
1365
|
+
}
|
|
1366
|
+
function put(key, value) {
|
|
1367
|
+
if (get(key) === NOT_FOUND) {
|
|
1368
|
+
entries.unshift({ key, value });
|
|
1369
|
+
if (entries.length > maxSize) {
|
|
1370
|
+
entries.pop();
|
|
1371
|
+
}
|
|
1372
|
+
}
|
|
1373
|
+
}
|
|
1374
|
+
function getEntries() {
|
|
1375
|
+
return entries;
|
|
1376
|
+
}
|
|
1377
|
+
function clear() {
|
|
1378
|
+
entries = [];
|
|
1379
|
+
}
|
|
1380
|
+
return { get, put, getEntries, clear };
|
|
1381
|
+
}
|
|
1382
|
+
var referenceEqualityCheck = (a, b) => a === b;
|
|
1383
|
+
function createCacheKeyComparator(equalityCheck) {
|
|
1384
|
+
return function areArgumentsShallowlyEqual(prev, next) {
|
|
1385
|
+
if (prev === null || next === null || prev.length !== next.length) {
|
|
1386
|
+
return false;
|
|
1387
|
+
}
|
|
1388
|
+
const { length } = prev;
|
|
1389
|
+
for (let i = 0; i < length; i++) {
|
|
1390
|
+
if (!equalityCheck(prev[i], next[i])) {
|
|
1391
|
+
return false;
|
|
1392
|
+
}
|
|
1393
|
+
}
|
|
1394
|
+
return true;
|
|
1395
|
+
};
|
|
1396
|
+
}
|
|
1397
|
+
function lruMemoize(func, equalityCheckOrOptions) {
|
|
1398
|
+
const providedOptions = typeof equalityCheckOrOptions === "object" ? equalityCheckOrOptions : { equalityCheck: equalityCheckOrOptions };
|
|
1399
|
+
const {
|
|
1400
|
+
equalityCheck = referenceEqualityCheck,
|
|
1401
|
+
maxSize = 1,
|
|
1402
|
+
resultEqualityCheck
|
|
1403
|
+
} = providedOptions;
|
|
1404
|
+
const comparator = createCacheKeyComparator(equalityCheck);
|
|
1405
|
+
let resultsCount = 0;
|
|
1406
|
+
const cache = maxSize <= 1 ? createSingletonCache(comparator) : createLruCache(maxSize, comparator);
|
|
1407
|
+
function memoized() {
|
|
1408
|
+
let value = cache.get(arguments);
|
|
1409
|
+
if (value === NOT_FOUND) {
|
|
1410
|
+
value = func.apply(null, arguments);
|
|
1411
|
+
resultsCount++;
|
|
1412
|
+
if (resultEqualityCheck) {
|
|
1413
|
+
const entries = cache.getEntries();
|
|
1414
|
+
const matchingEntry = entries.find(
|
|
1415
|
+
(entry) => resultEqualityCheck(entry.value, value)
|
|
1416
|
+
);
|
|
1417
|
+
if (matchingEntry) {
|
|
1418
|
+
value = matchingEntry.value;
|
|
1419
|
+
resultsCount !== 0 && resultsCount--;
|
|
1420
|
+
}
|
|
1421
|
+
}
|
|
1422
|
+
cache.put(arguments, value);
|
|
1423
|
+
}
|
|
1424
|
+
return value;
|
|
1425
|
+
}
|
|
1426
|
+
memoized.clearCache = () => {
|
|
1427
|
+
cache.clear();
|
|
1428
|
+
memoized.resetResultsCount();
|
|
1429
|
+
};
|
|
1430
|
+
memoized.resultsCount = () => resultsCount;
|
|
1431
|
+
memoized.resetResultsCount = () => {
|
|
1432
|
+
resultsCount = 0;
|
|
1433
|
+
};
|
|
1434
|
+
return memoized;
|
|
1435
|
+
}
|
|
1436
|
+
var StrongRef = class {
|
|
1437
|
+
constructor(value) {
|
|
1438
|
+
this.value = value;
|
|
1439
|
+
}
|
|
1440
|
+
deref() {
|
|
1441
|
+
return this.value;
|
|
1442
|
+
}
|
|
1443
|
+
};
|
|
1444
|
+
var Ref = typeof WeakRef !== "undefined" ? WeakRef : StrongRef;
|
|
1445
|
+
var UNTERMINATED = 0;
|
|
1446
|
+
var TERMINATED = 1;
|
|
1447
|
+
function createCacheNode() {
|
|
1448
|
+
return {
|
|
1449
|
+
s: UNTERMINATED,
|
|
1450
|
+
v: void 0,
|
|
1451
|
+
o: null,
|
|
1452
|
+
p: null
|
|
1453
|
+
};
|
|
1454
|
+
}
|
|
1455
|
+
function weakMapMemoize(func, options = {}) {
|
|
1456
|
+
let fnNode = createCacheNode();
|
|
1457
|
+
const { resultEqualityCheck } = options;
|
|
1458
|
+
let lastResult;
|
|
1459
|
+
let resultsCount = 0;
|
|
1460
|
+
function memoized() {
|
|
1461
|
+
var _a;
|
|
1462
|
+
let cacheNode = fnNode;
|
|
1463
|
+
const { length } = arguments;
|
|
1464
|
+
for (let i = 0, l = length; i < l; i++) {
|
|
1465
|
+
const arg = arguments[i];
|
|
1466
|
+
if (typeof arg === "function" || typeof arg === "object" && arg !== null) {
|
|
1467
|
+
let objectCache = cacheNode.o;
|
|
1468
|
+
if (objectCache === null) {
|
|
1469
|
+
cacheNode.o = objectCache = /* @__PURE__ */ new WeakMap();
|
|
1470
|
+
}
|
|
1471
|
+
const objectNode = objectCache.get(arg);
|
|
1472
|
+
if (objectNode === void 0) {
|
|
1473
|
+
cacheNode = createCacheNode();
|
|
1474
|
+
objectCache.set(arg, cacheNode);
|
|
1475
|
+
} else {
|
|
1476
|
+
cacheNode = objectNode;
|
|
1477
|
+
}
|
|
1478
|
+
} else {
|
|
1479
|
+
let primitiveCache = cacheNode.p;
|
|
1480
|
+
if (primitiveCache === null) {
|
|
1481
|
+
cacheNode.p = primitiveCache = /* @__PURE__ */ new Map();
|
|
1482
|
+
}
|
|
1483
|
+
const primitiveNode = primitiveCache.get(arg);
|
|
1484
|
+
if (primitiveNode === void 0) {
|
|
1485
|
+
cacheNode = createCacheNode();
|
|
1486
|
+
primitiveCache.set(arg, cacheNode);
|
|
1487
|
+
} else {
|
|
1488
|
+
cacheNode = primitiveNode;
|
|
1489
|
+
}
|
|
1490
|
+
}
|
|
1491
|
+
}
|
|
1492
|
+
const terminatedNode = cacheNode;
|
|
1493
|
+
let result;
|
|
1494
|
+
if (cacheNode.s === TERMINATED) {
|
|
1495
|
+
result = cacheNode.v;
|
|
1496
|
+
} else {
|
|
1497
|
+
result = func.apply(null, arguments);
|
|
1498
|
+
resultsCount++;
|
|
1499
|
+
if (resultEqualityCheck) {
|
|
1500
|
+
const lastResultValue = ((_a = lastResult == null ? void 0 : lastResult.deref) == null ? void 0 : _a.call(lastResult)) ?? lastResult;
|
|
1501
|
+
if (lastResultValue != null && resultEqualityCheck(lastResultValue, result)) {
|
|
1502
|
+
result = lastResultValue;
|
|
1503
|
+
resultsCount !== 0 && resultsCount--;
|
|
1504
|
+
}
|
|
1505
|
+
const needsWeakRef = typeof result === "object" && result !== null || typeof result === "function";
|
|
1506
|
+
lastResult = needsWeakRef ? new Ref(result) : result;
|
|
1507
|
+
}
|
|
1508
|
+
}
|
|
1509
|
+
terminatedNode.s = TERMINATED;
|
|
1510
|
+
terminatedNode.v = result;
|
|
1511
|
+
return result;
|
|
1512
|
+
}
|
|
1513
|
+
memoized.clearCache = () => {
|
|
1514
|
+
fnNode = createCacheNode();
|
|
1515
|
+
memoized.resetResultsCount();
|
|
1516
|
+
};
|
|
1517
|
+
memoized.resultsCount = () => resultsCount;
|
|
1518
|
+
memoized.resetResultsCount = () => {
|
|
1519
|
+
resultsCount = 0;
|
|
1520
|
+
};
|
|
1521
|
+
return memoized;
|
|
1522
|
+
}
|
|
1523
|
+
function createSelectorCreator(memoizeOrOptions, ...memoizeOptionsFromArgs) {
|
|
1524
|
+
const createSelectorCreatorOptions = typeof memoizeOrOptions === "function" ? {
|
|
1525
|
+
memoize: memoizeOrOptions,
|
|
1526
|
+
memoizeOptions: memoizeOptionsFromArgs
|
|
1527
|
+
} : memoizeOrOptions;
|
|
1528
|
+
const createSelector2 = (...createSelectorArgs) => {
|
|
1529
|
+
let recomputations = 0;
|
|
1530
|
+
let dependencyRecomputations = 0;
|
|
1531
|
+
let lastResult;
|
|
1532
|
+
let directlyPassedOptions = {};
|
|
1533
|
+
let resultFunc = createSelectorArgs.pop();
|
|
1534
|
+
if (typeof resultFunc === "object") {
|
|
1535
|
+
directlyPassedOptions = resultFunc;
|
|
1536
|
+
resultFunc = createSelectorArgs.pop();
|
|
1537
|
+
}
|
|
1538
|
+
assertIsFunction(
|
|
1539
|
+
resultFunc,
|
|
1540
|
+
`createSelector expects an output function after the inputs, but received: [${typeof resultFunc}]`
|
|
1541
|
+
);
|
|
1542
|
+
const combinedOptions = {
|
|
1543
|
+
...createSelectorCreatorOptions,
|
|
1544
|
+
...directlyPassedOptions
|
|
1545
|
+
};
|
|
1546
|
+
const {
|
|
1547
|
+
memoize,
|
|
1548
|
+
memoizeOptions = [],
|
|
1549
|
+
argsMemoize = weakMapMemoize,
|
|
1550
|
+
argsMemoizeOptions = [],
|
|
1551
|
+
devModeChecks = {}
|
|
1552
|
+
} = combinedOptions;
|
|
1553
|
+
const finalMemoizeOptions = ensureIsArray(memoizeOptions);
|
|
1554
|
+
const finalArgsMemoizeOptions = ensureIsArray(argsMemoizeOptions);
|
|
1555
|
+
const dependencies = getDependencies(createSelectorArgs);
|
|
1556
|
+
const memoizedResultFunc = memoize(function recomputationWrapper() {
|
|
1557
|
+
recomputations++;
|
|
1558
|
+
return resultFunc.apply(
|
|
1559
|
+
null,
|
|
1560
|
+
arguments
|
|
1561
|
+
);
|
|
1562
|
+
}, ...finalMemoizeOptions);
|
|
1563
|
+
let firstRun = true;
|
|
1564
|
+
const selector = argsMemoize(function dependenciesChecker() {
|
|
1565
|
+
dependencyRecomputations++;
|
|
1566
|
+
const inputSelectorResults = collectInputSelectorResults(
|
|
1567
|
+
dependencies,
|
|
1568
|
+
arguments
|
|
1569
|
+
);
|
|
1570
|
+
lastResult = memoizedResultFunc.apply(null, inputSelectorResults);
|
|
1571
|
+
if (process.env.NODE_ENV !== "production") {
|
|
1572
|
+
const { identityFunctionCheck, inputStabilityCheck } = getDevModeChecksExecutionInfo(firstRun, devModeChecks);
|
|
1573
|
+
if (identityFunctionCheck.shouldRun) {
|
|
1574
|
+
identityFunctionCheck.run(
|
|
1575
|
+
resultFunc,
|
|
1576
|
+
inputSelectorResults,
|
|
1577
|
+
lastResult
|
|
1578
|
+
);
|
|
1579
|
+
}
|
|
1580
|
+
if (inputStabilityCheck.shouldRun) {
|
|
1581
|
+
const inputSelectorResultsCopy = collectInputSelectorResults(
|
|
1582
|
+
dependencies,
|
|
1583
|
+
arguments
|
|
1584
|
+
);
|
|
1585
|
+
inputStabilityCheck.run(
|
|
1586
|
+
{ inputSelectorResults, inputSelectorResultsCopy },
|
|
1587
|
+
{ memoize, memoizeOptions: finalMemoizeOptions },
|
|
1588
|
+
arguments
|
|
1589
|
+
);
|
|
1590
|
+
}
|
|
1591
|
+
if (firstRun)
|
|
1592
|
+
firstRun = false;
|
|
1593
|
+
}
|
|
1594
|
+
return lastResult;
|
|
1595
|
+
}, ...finalArgsMemoizeOptions);
|
|
1596
|
+
return Object.assign(selector, {
|
|
1597
|
+
resultFunc,
|
|
1598
|
+
memoizedResultFunc,
|
|
1599
|
+
dependencies,
|
|
1600
|
+
dependencyRecomputations: () => dependencyRecomputations,
|
|
1601
|
+
resetDependencyRecomputations: () => {
|
|
1602
|
+
dependencyRecomputations = 0;
|
|
1603
|
+
},
|
|
1604
|
+
lastResult: () => lastResult,
|
|
1605
|
+
recomputations: () => recomputations,
|
|
1606
|
+
resetRecomputations: () => {
|
|
1607
|
+
recomputations = 0;
|
|
1608
|
+
},
|
|
1609
|
+
memoize,
|
|
1610
|
+
argsMemoize
|
|
1611
|
+
});
|
|
1612
|
+
};
|
|
1613
|
+
Object.assign(createSelector2, {
|
|
1614
|
+
withTypes: () => createSelector2
|
|
1615
|
+
});
|
|
1616
|
+
return createSelector2;
|
|
1617
|
+
}
|
|
1618
|
+
var createSelector$1 = /* @__PURE__ */ createSelectorCreator(weakMapMemoize);
|
|
1619
|
+
var createStructuredSelector = Object.assign(
|
|
1620
|
+
(inputSelectorsObject, selectorCreator = createSelector$1) => {
|
|
1621
|
+
assertIsObject(
|
|
1622
|
+
inputSelectorsObject,
|
|
1623
|
+
`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof inputSelectorsObject}`
|
|
1624
|
+
);
|
|
1625
|
+
const inputSelectorKeys = Object.keys(inputSelectorsObject);
|
|
1626
|
+
const dependencies = inputSelectorKeys.map(
|
|
1627
|
+
(key) => inputSelectorsObject[key]
|
|
1628
|
+
);
|
|
1629
|
+
const structuredSelector = selectorCreator(
|
|
1630
|
+
dependencies,
|
|
1631
|
+
(...inputSelectorResults) => {
|
|
1632
|
+
return inputSelectorResults.reduce((composition, value, index) => {
|
|
1633
|
+
composition[inputSelectorKeys[index]] = value;
|
|
1634
|
+
return composition;
|
|
1635
|
+
}, {});
|
|
1636
|
+
}
|
|
1637
|
+
);
|
|
1638
|
+
return structuredSelector;
|
|
1639
|
+
},
|
|
1640
|
+
{ withTypes: () => createStructuredSelector }
|
|
1641
|
+
);
|
|
1642
|
+
createSelectorCreator({
|
|
1643
|
+
memoize: lruMemoize,
|
|
1644
|
+
memoizeOptions: {
|
|
1645
|
+
maxSize: 1,
|
|
1646
|
+
equalityCheck: Object.is
|
|
1647
|
+
}
|
|
1648
|
+
});
|
|
1649
|
+
const createSelector = (a, b, c, d, e, f, ...other) => {
|
|
1650
|
+
if (other.length > 0) {
|
|
1651
|
+
throw new Error(process.env.NODE_ENV !== "production" ? "Unsupported number of selectors" : useRenderElement.formatErrorMessage(1));
|
|
1652
|
+
}
|
|
1653
|
+
let selector;
|
|
1654
|
+
if (a) {
|
|
1655
|
+
selector = a;
|
|
1656
|
+
} else {
|
|
1657
|
+
throw (
|
|
1658
|
+
/* minify-error-disabled */
|
|
1659
|
+
new Error("Missing arguments")
|
|
1660
|
+
);
|
|
1661
|
+
}
|
|
1662
|
+
return selector;
|
|
1663
|
+
};
|
|
1664
|
+
var shim = { exports: {} };
|
|
1665
|
+
var useSyncExternalStoreShim_production = {};
|
|
1666
|
+
/**
|
|
1667
|
+
* @license React
|
|
1668
|
+
* use-sync-external-store-shim.production.js
|
|
1669
|
+
*
|
|
1670
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
1671
|
+
*
|
|
1672
|
+
* This source code is licensed under the MIT license found in the
|
|
1673
|
+
* LICENSE file in the root directory of this source tree.
|
|
1674
|
+
*/
|
|
1675
|
+
var hasRequiredUseSyncExternalStoreShim_production;
|
|
1676
|
+
function requireUseSyncExternalStoreShim_production() {
|
|
1677
|
+
if (hasRequiredUseSyncExternalStoreShim_production) return useSyncExternalStoreShim_production;
|
|
1678
|
+
hasRequiredUseSyncExternalStoreShim_production = 1;
|
|
1679
|
+
var React$1 = React;
|
|
1680
|
+
function is(x, y) {
|
|
1681
|
+
return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
|
|
1682
|
+
}
|
|
1683
|
+
var objectIs = "function" === typeof Object.is ? Object.is : is, useState = React$1.useState, useEffect = React$1.useEffect, useLayoutEffect = React$1.useLayoutEffect, useDebugValue = React$1.useDebugValue;
|
|
1684
|
+
function useSyncExternalStore$2(subscribe, getSnapshot) {
|
|
1685
|
+
var value = getSnapshot(), _useState = useState({ inst: { value, getSnapshot } }), inst = _useState[0].inst, forceUpdate = _useState[1];
|
|
1686
|
+
useLayoutEffect(
|
|
1687
|
+
function() {
|
|
1688
|
+
inst.value = value;
|
|
1689
|
+
inst.getSnapshot = getSnapshot;
|
|
1690
|
+
checkIfSnapshotChanged(inst) && forceUpdate({ inst });
|
|
1691
|
+
},
|
|
1692
|
+
[subscribe, value, getSnapshot]
|
|
1693
|
+
);
|
|
1694
|
+
useEffect(
|
|
1695
|
+
function() {
|
|
1696
|
+
checkIfSnapshotChanged(inst) && forceUpdate({ inst });
|
|
1697
|
+
return subscribe(function() {
|
|
1698
|
+
checkIfSnapshotChanged(inst) && forceUpdate({ inst });
|
|
1699
|
+
});
|
|
1700
|
+
},
|
|
1701
|
+
[subscribe]
|
|
1702
|
+
);
|
|
1703
|
+
useDebugValue(value);
|
|
1704
|
+
return value;
|
|
1705
|
+
}
|
|
1706
|
+
function checkIfSnapshotChanged(inst) {
|
|
1707
|
+
var latestGetSnapshot = inst.getSnapshot;
|
|
1708
|
+
inst = inst.value;
|
|
1709
|
+
try {
|
|
1710
|
+
var nextValue = latestGetSnapshot();
|
|
1711
|
+
return !objectIs(inst, nextValue);
|
|
1712
|
+
} catch (error) {
|
|
1713
|
+
return true;
|
|
1714
|
+
}
|
|
1715
|
+
}
|
|
1716
|
+
function useSyncExternalStore$1(subscribe, getSnapshot) {
|
|
1717
|
+
return getSnapshot();
|
|
1718
|
+
}
|
|
1719
|
+
var shim2 = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2;
|
|
1720
|
+
useSyncExternalStoreShim_production.useSyncExternalStore = void 0 !== React$1.useSyncExternalStore ? React$1.useSyncExternalStore : shim2;
|
|
1721
|
+
return useSyncExternalStoreShim_production;
|
|
1722
|
+
}
|
|
1723
|
+
var useSyncExternalStoreShim_development = {};
|
|
1724
|
+
/**
|
|
1725
|
+
* @license React
|
|
1726
|
+
* use-sync-external-store-shim.development.js
|
|
1727
|
+
*
|
|
1728
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
1729
|
+
*
|
|
1730
|
+
* This source code is licensed under the MIT license found in the
|
|
1731
|
+
* LICENSE file in the root directory of this source tree.
|
|
1732
|
+
*/
|
|
1733
|
+
var hasRequiredUseSyncExternalStoreShim_development;
|
|
1734
|
+
function requireUseSyncExternalStoreShim_development() {
|
|
1735
|
+
if (hasRequiredUseSyncExternalStoreShim_development) return useSyncExternalStoreShim_development;
|
|
1736
|
+
hasRequiredUseSyncExternalStoreShim_development = 1;
|
|
1737
|
+
"production" !== process.env.NODE_ENV && (function() {
|
|
1738
|
+
function is(x, y) {
|
|
1739
|
+
return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
|
|
1740
|
+
}
|
|
1741
|
+
function useSyncExternalStore$2(subscribe, getSnapshot) {
|
|
1742
|
+
didWarnOld18Alpha || void 0 === React$1.startTransition || (didWarnOld18Alpha = true, console.error(
|
|
1743
|
+
"You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."
|
|
1744
|
+
));
|
|
1745
|
+
var value = getSnapshot();
|
|
1746
|
+
if (!didWarnUncachedGetSnapshot) {
|
|
1747
|
+
var cachedValue = getSnapshot();
|
|
1748
|
+
objectIs(value, cachedValue) || (console.error(
|
|
1749
|
+
"The result of getSnapshot should be cached to avoid an infinite loop"
|
|
1750
|
+
), didWarnUncachedGetSnapshot = true);
|
|
1751
|
+
}
|
|
1752
|
+
cachedValue = useState({
|
|
1753
|
+
inst: { value, getSnapshot }
|
|
1754
|
+
});
|
|
1755
|
+
var inst = cachedValue[0].inst, forceUpdate = cachedValue[1];
|
|
1756
|
+
useLayoutEffect(
|
|
1757
|
+
function() {
|
|
1758
|
+
inst.value = value;
|
|
1759
|
+
inst.getSnapshot = getSnapshot;
|
|
1760
|
+
checkIfSnapshotChanged(inst) && forceUpdate({ inst });
|
|
1761
|
+
},
|
|
1762
|
+
[subscribe, value, getSnapshot]
|
|
1763
|
+
);
|
|
1764
|
+
useEffect(
|
|
1765
|
+
function() {
|
|
1766
|
+
checkIfSnapshotChanged(inst) && forceUpdate({ inst });
|
|
1767
|
+
return subscribe(function() {
|
|
1768
|
+
checkIfSnapshotChanged(inst) && forceUpdate({ inst });
|
|
1769
|
+
});
|
|
1770
|
+
},
|
|
1771
|
+
[subscribe]
|
|
1772
|
+
);
|
|
1773
|
+
useDebugValue(value);
|
|
1774
|
+
return value;
|
|
1775
|
+
}
|
|
1776
|
+
function checkIfSnapshotChanged(inst) {
|
|
1777
|
+
var latestGetSnapshot = inst.getSnapshot;
|
|
1778
|
+
inst = inst.value;
|
|
1779
|
+
try {
|
|
1780
|
+
var nextValue = latestGetSnapshot();
|
|
1781
|
+
return !objectIs(inst, nextValue);
|
|
1782
|
+
} catch (error) {
|
|
1783
|
+
return true;
|
|
1784
|
+
}
|
|
1785
|
+
}
|
|
1786
|
+
function useSyncExternalStore$1(subscribe, getSnapshot) {
|
|
1787
|
+
return getSnapshot();
|
|
1788
|
+
}
|
|
1789
|
+
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
1790
|
+
var React$1 = React, objectIs = "function" === typeof Object.is ? Object.is : is, useState = React$1.useState, useEffect = React$1.useEffect, useLayoutEffect = React$1.useLayoutEffect, useDebugValue = React$1.useDebugValue, didWarnOld18Alpha = false, didWarnUncachedGetSnapshot = false, shim2 = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2;
|
|
1791
|
+
useSyncExternalStoreShim_development.useSyncExternalStore = void 0 !== React$1.useSyncExternalStore ? React$1.useSyncExternalStore : shim2;
|
|
1792
|
+
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
1793
|
+
})();
|
|
1794
|
+
return useSyncExternalStoreShim_development;
|
|
1795
|
+
}
|
|
1796
|
+
var hasRequiredShim;
|
|
1797
|
+
function requireShim() {
|
|
1798
|
+
if (hasRequiredShim) return shim.exports;
|
|
1799
|
+
hasRequiredShim = 1;
|
|
1800
|
+
if (process.env.NODE_ENV === "production") {
|
|
1801
|
+
shim.exports = requireUseSyncExternalStoreShim_production();
|
|
1802
|
+
} else {
|
|
1803
|
+
shim.exports = requireUseSyncExternalStoreShim_development();
|
|
1804
|
+
}
|
|
1805
|
+
return shim.exports;
|
|
1806
|
+
}
|
|
1807
|
+
var shimExports = requireShim();
|
|
1808
|
+
var withSelector = { exports: {} };
|
|
1809
|
+
var withSelector_production = {};
|
|
1810
|
+
/**
|
|
1811
|
+
* @license React
|
|
1812
|
+
* use-sync-external-store-shim/with-selector.production.js
|
|
1813
|
+
*
|
|
1814
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
1815
|
+
*
|
|
1816
|
+
* This source code is licensed under the MIT license found in the
|
|
1817
|
+
* LICENSE file in the root directory of this source tree.
|
|
1818
|
+
*/
|
|
1819
|
+
var hasRequiredWithSelector_production;
|
|
1820
|
+
function requireWithSelector_production() {
|
|
1821
|
+
if (hasRequiredWithSelector_production) return withSelector_production;
|
|
1822
|
+
hasRequiredWithSelector_production = 1;
|
|
1823
|
+
var React$1 = React, shim2 = requireShim();
|
|
1824
|
+
function is(x, y) {
|
|
1825
|
+
return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
|
|
1826
|
+
}
|
|
1827
|
+
var objectIs = "function" === typeof Object.is ? Object.is : is, useSyncExternalStore = shim2.useSyncExternalStore, useRef = React$1.useRef, useEffect = React$1.useEffect, useMemo = React$1.useMemo, useDebugValue = React$1.useDebugValue;
|
|
1828
|
+
withSelector_production.useSyncExternalStoreWithSelector = function(subscribe, getSnapshot, getServerSnapshot, selector, isEqual) {
|
|
1829
|
+
var instRef = useRef(null);
|
|
1830
|
+
if (null === instRef.current) {
|
|
1831
|
+
var inst = { hasValue: false, value: null };
|
|
1832
|
+
instRef.current = inst;
|
|
1833
|
+
} else inst = instRef.current;
|
|
1834
|
+
instRef = useMemo(
|
|
1835
|
+
function() {
|
|
1836
|
+
function memoizedSelector(nextSnapshot) {
|
|
1837
|
+
if (!hasMemo) {
|
|
1838
|
+
hasMemo = true;
|
|
1839
|
+
memoizedSnapshot = nextSnapshot;
|
|
1840
|
+
nextSnapshot = selector(nextSnapshot);
|
|
1841
|
+
if (void 0 !== isEqual && inst.hasValue) {
|
|
1842
|
+
var currentSelection = inst.value;
|
|
1843
|
+
if (isEqual(currentSelection, nextSnapshot))
|
|
1844
|
+
return memoizedSelection = currentSelection;
|
|
1845
|
+
}
|
|
1846
|
+
return memoizedSelection = nextSnapshot;
|
|
1847
|
+
}
|
|
1848
|
+
currentSelection = memoizedSelection;
|
|
1849
|
+
if (objectIs(memoizedSnapshot, nextSnapshot)) return currentSelection;
|
|
1850
|
+
var nextSelection = selector(nextSnapshot);
|
|
1851
|
+
if (void 0 !== isEqual && isEqual(currentSelection, nextSelection))
|
|
1852
|
+
return memoizedSnapshot = nextSnapshot, currentSelection;
|
|
1853
|
+
memoizedSnapshot = nextSnapshot;
|
|
1854
|
+
return memoizedSelection = nextSelection;
|
|
1855
|
+
}
|
|
1856
|
+
var hasMemo = false, memoizedSnapshot, memoizedSelection, maybeGetServerSnapshot = void 0 === getServerSnapshot ? null : getServerSnapshot;
|
|
1857
|
+
return [
|
|
1858
|
+
function() {
|
|
1859
|
+
return memoizedSelector(getSnapshot());
|
|
1860
|
+
},
|
|
1861
|
+
null === maybeGetServerSnapshot ? void 0 : function() {
|
|
1862
|
+
return memoizedSelector(maybeGetServerSnapshot());
|
|
1863
|
+
}
|
|
1864
|
+
];
|
|
1865
|
+
},
|
|
1866
|
+
[getSnapshot, getServerSnapshot, selector, isEqual]
|
|
1867
|
+
);
|
|
1868
|
+
var value = useSyncExternalStore(subscribe, instRef[0], instRef[1]);
|
|
1869
|
+
useEffect(
|
|
1870
|
+
function() {
|
|
1871
|
+
inst.hasValue = true;
|
|
1872
|
+
inst.value = value;
|
|
1873
|
+
},
|
|
1874
|
+
[value]
|
|
1875
|
+
);
|
|
1876
|
+
useDebugValue(value);
|
|
1877
|
+
return value;
|
|
1878
|
+
};
|
|
1879
|
+
return withSelector_production;
|
|
1880
|
+
}
|
|
1881
|
+
var withSelector_development = {};
|
|
1882
|
+
/**
|
|
1883
|
+
* @license React
|
|
1884
|
+
* use-sync-external-store-shim/with-selector.development.js
|
|
1885
|
+
*
|
|
1886
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
1887
|
+
*
|
|
1888
|
+
* This source code is licensed under the MIT license found in the
|
|
1889
|
+
* LICENSE file in the root directory of this source tree.
|
|
1890
|
+
*/
|
|
1891
|
+
var hasRequiredWithSelector_development;
|
|
1892
|
+
function requireWithSelector_development() {
|
|
1893
|
+
if (hasRequiredWithSelector_development) return withSelector_development;
|
|
1894
|
+
hasRequiredWithSelector_development = 1;
|
|
1895
|
+
"production" !== process.env.NODE_ENV && (function() {
|
|
1896
|
+
function is(x, y) {
|
|
1897
|
+
return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
|
|
1898
|
+
}
|
|
1899
|
+
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
1900
|
+
var React$1 = React, shim2 = requireShim(), objectIs = "function" === typeof Object.is ? Object.is : is, useSyncExternalStore = shim2.useSyncExternalStore, useRef = React$1.useRef, useEffect = React$1.useEffect, useMemo = React$1.useMemo, useDebugValue = React$1.useDebugValue;
|
|
1901
|
+
withSelector_development.useSyncExternalStoreWithSelector = function(subscribe, getSnapshot, getServerSnapshot, selector, isEqual) {
|
|
1902
|
+
var instRef = useRef(null);
|
|
1903
|
+
if (null === instRef.current) {
|
|
1904
|
+
var inst = { hasValue: false, value: null };
|
|
1905
|
+
instRef.current = inst;
|
|
1906
|
+
} else inst = instRef.current;
|
|
1907
|
+
instRef = useMemo(
|
|
1908
|
+
function() {
|
|
1909
|
+
function memoizedSelector(nextSnapshot) {
|
|
1910
|
+
if (!hasMemo) {
|
|
1911
|
+
hasMemo = true;
|
|
1912
|
+
memoizedSnapshot = nextSnapshot;
|
|
1913
|
+
nextSnapshot = selector(nextSnapshot);
|
|
1914
|
+
if (void 0 !== isEqual && inst.hasValue) {
|
|
1915
|
+
var currentSelection = inst.value;
|
|
1916
|
+
if (isEqual(currentSelection, nextSnapshot))
|
|
1917
|
+
return memoizedSelection = currentSelection;
|
|
1918
|
+
}
|
|
1919
|
+
return memoizedSelection = nextSnapshot;
|
|
1920
|
+
}
|
|
1921
|
+
currentSelection = memoizedSelection;
|
|
1922
|
+
if (objectIs(memoizedSnapshot, nextSnapshot))
|
|
1923
|
+
return currentSelection;
|
|
1924
|
+
var nextSelection = selector(nextSnapshot);
|
|
1925
|
+
if (void 0 !== isEqual && isEqual(currentSelection, nextSelection))
|
|
1926
|
+
return memoizedSnapshot = nextSnapshot, currentSelection;
|
|
1927
|
+
memoizedSnapshot = nextSnapshot;
|
|
1928
|
+
return memoizedSelection = nextSelection;
|
|
1929
|
+
}
|
|
1930
|
+
var hasMemo = false, memoizedSnapshot, memoizedSelection, maybeGetServerSnapshot = void 0 === getServerSnapshot ? null : getServerSnapshot;
|
|
1931
|
+
return [
|
|
1932
|
+
function() {
|
|
1933
|
+
return memoizedSelector(getSnapshot());
|
|
1934
|
+
},
|
|
1935
|
+
null === maybeGetServerSnapshot ? void 0 : function() {
|
|
1936
|
+
return memoizedSelector(maybeGetServerSnapshot());
|
|
1937
|
+
}
|
|
1938
|
+
];
|
|
1939
|
+
},
|
|
1940
|
+
[getSnapshot, getServerSnapshot, selector, isEqual]
|
|
1941
|
+
);
|
|
1942
|
+
var value = useSyncExternalStore(subscribe, instRef[0], instRef[1]);
|
|
1943
|
+
useEffect(
|
|
1944
|
+
function() {
|
|
1945
|
+
inst.hasValue = true;
|
|
1946
|
+
inst.value = value;
|
|
1947
|
+
},
|
|
1948
|
+
[value]
|
|
1949
|
+
);
|
|
1950
|
+
useDebugValue(value);
|
|
1951
|
+
return value;
|
|
1952
|
+
};
|
|
1953
|
+
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
1954
|
+
})();
|
|
1955
|
+
return withSelector_development;
|
|
1956
|
+
}
|
|
1957
|
+
var hasRequiredWithSelector;
|
|
1958
|
+
function requireWithSelector() {
|
|
1959
|
+
if (hasRequiredWithSelector) return withSelector.exports;
|
|
1960
|
+
hasRequiredWithSelector = 1;
|
|
1961
|
+
if (process.env.NODE_ENV === "production") {
|
|
1962
|
+
withSelector.exports = requireWithSelector_production();
|
|
1963
|
+
} else {
|
|
1964
|
+
withSelector.exports = requireWithSelector_development();
|
|
1965
|
+
}
|
|
1966
|
+
return withSelector.exports;
|
|
1967
|
+
}
|
|
1968
|
+
var withSelectorExports = requireWithSelector();
|
|
1969
|
+
const hooks = [];
|
|
1970
|
+
let currentInstance = void 0;
|
|
1971
|
+
function getInstance() {
|
|
1972
|
+
return currentInstance;
|
|
1973
|
+
}
|
|
1974
|
+
function register(hook) {
|
|
1975
|
+
hooks.push(hook);
|
|
1976
|
+
}
|
|
1977
|
+
function fastComponent(fn) {
|
|
1978
|
+
const FastComponent = (props, forwardedRef) => {
|
|
1979
|
+
const instance = useRenderElement.useRefWithInit(createInstance).current;
|
|
1980
|
+
let result;
|
|
1981
|
+
try {
|
|
1982
|
+
currentInstance = instance;
|
|
1983
|
+
for (const hook of hooks) {
|
|
1984
|
+
hook.before(instance);
|
|
1985
|
+
}
|
|
1986
|
+
result = fn(props, forwardedRef);
|
|
1987
|
+
for (const hook of hooks) {
|
|
1988
|
+
hook.after(instance);
|
|
1989
|
+
}
|
|
1990
|
+
instance.didInitialize = true;
|
|
1991
|
+
} finally {
|
|
1992
|
+
currentInstance = void 0;
|
|
1993
|
+
}
|
|
1994
|
+
return result;
|
|
1995
|
+
};
|
|
1996
|
+
FastComponent.displayName = fn.displayName || fn.name;
|
|
1997
|
+
return FastComponent;
|
|
1998
|
+
}
|
|
1999
|
+
function fastComponentRef(fn) {
|
|
2000
|
+
return /* @__PURE__ */ React__namespace.forwardRef(fastComponent(fn));
|
|
2001
|
+
}
|
|
2002
|
+
function createInstance() {
|
|
2003
|
+
return {
|
|
2004
|
+
didInitialize: false
|
|
2005
|
+
};
|
|
2006
|
+
}
|
|
2007
|
+
const canUseRawUseSyncExternalStore = useRenderElement.isReactVersionAtLeast(19);
|
|
2008
|
+
const useStoreImplementation = canUseRawUseSyncExternalStore ? useStoreFast : useStoreLegacy;
|
|
2009
|
+
function useStore(store, selector, a1, a2, a3) {
|
|
2010
|
+
return useStoreImplementation(store, selector, a1, a2, a3);
|
|
2011
|
+
}
|
|
2012
|
+
function useStoreR19(store, selector, a1, a2, a3) {
|
|
2013
|
+
const getSelection = React__namespace.useCallback(() => selector(store.getSnapshot(), a1, a2, a3), [store, selector, a1, a2, a3]);
|
|
2014
|
+
return shimExports.useSyncExternalStore(store.subscribe, getSelection, getSelection);
|
|
2015
|
+
}
|
|
2016
|
+
register({
|
|
2017
|
+
before(instance) {
|
|
2018
|
+
instance.syncIndex = 0;
|
|
2019
|
+
if (!instance.didInitialize) {
|
|
2020
|
+
instance.syncTick = 1;
|
|
2021
|
+
instance.syncHooks = [];
|
|
2022
|
+
instance.didChangeStore = true;
|
|
2023
|
+
instance.getSnapshot = () => {
|
|
2024
|
+
let didChange = false;
|
|
2025
|
+
for (let i = 0; i < instance.syncHooks.length; i += 1) {
|
|
2026
|
+
const hook = instance.syncHooks[i];
|
|
2027
|
+
const value = hook.selector(hook.store.state, hook.a1, hook.a2, hook.a3);
|
|
2028
|
+
if (hook.didChange || !Object.is(hook.value, value)) {
|
|
2029
|
+
didChange = true;
|
|
2030
|
+
hook.value = value;
|
|
2031
|
+
hook.didChange = false;
|
|
2032
|
+
}
|
|
2033
|
+
}
|
|
2034
|
+
if (didChange) {
|
|
2035
|
+
instance.syncTick += 1;
|
|
2036
|
+
}
|
|
2037
|
+
return instance.syncTick;
|
|
2038
|
+
};
|
|
2039
|
+
}
|
|
2040
|
+
},
|
|
2041
|
+
after(instance) {
|
|
2042
|
+
if (instance.syncHooks.length > 0) {
|
|
2043
|
+
if (instance.didChangeStore) {
|
|
2044
|
+
instance.didChangeStore = false;
|
|
2045
|
+
instance.subscribe = (onStoreChange) => {
|
|
2046
|
+
const stores = /* @__PURE__ */ new Set();
|
|
2047
|
+
for (const hook of instance.syncHooks) {
|
|
2048
|
+
stores.add(hook.store);
|
|
2049
|
+
}
|
|
2050
|
+
const unsubscribes = [];
|
|
2051
|
+
for (const store of stores) {
|
|
2052
|
+
unsubscribes.push(store.subscribe(onStoreChange));
|
|
2053
|
+
}
|
|
2054
|
+
return () => {
|
|
2055
|
+
for (const unsubscribe of unsubscribes) {
|
|
2056
|
+
unsubscribe();
|
|
2057
|
+
}
|
|
2058
|
+
};
|
|
2059
|
+
};
|
|
2060
|
+
}
|
|
2061
|
+
shimExports.useSyncExternalStore(instance.subscribe, instance.getSnapshot, instance.getSnapshot);
|
|
2062
|
+
}
|
|
2063
|
+
}
|
|
2064
|
+
});
|
|
2065
|
+
function useStoreFast(store, selector, a1, a2, a3) {
|
|
2066
|
+
const instance = getInstance();
|
|
2067
|
+
if (!instance) {
|
|
2068
|
+
return useStoreR19(store, selector, a1, a2, a3);
|
|
2069
|
+
}
|
|
2070
|
+
const index = instance.syncIndex;
|
|
2071
|
+
instance.syncIndex += 1;
|
|
2072
|
+
let hook;
|
|
2073
|
+
if (!instance.didInitialize) {
|
|
2074
|
+
hook = {
|
|
2075
|
+
store,
|
|
2076
|
+
selector,
|
|
2077
|
+
a1,
|
|
2078
|
+
a2,
|
|
2079
|
+
a3,
|
|
2080
|
+
value: selector(store.getSnapshot(), a1, a2, a3),
|
|
2081
|
+
didChange: false
|
|
2082
|
+
};
|
|
2083
|
+
instance.syncHooks.push(hook);
|
|
2084
|
+
} else {
|
|
2085
|
+
hook = instance.syncHooks[index];
|
|
2086
|
+
if (hook.store !== store || hook.selector !== selector || !Object.is(hook.a1, a1) || !Object.is(hook.a2, a2) || !Object.is(hook.a3, a3)) {
|
|
2087
|
+
if (hook.store !== store) {
|
|
2088
|
+
instance.didChangeStore = true;
|
|
2089
|
+
}
|
|
2090
|
+
hook.store = store;
|
|
2091
|
+
hook.selector = selector;
|
|
2092
|
+
hook.a1 = a1;
|
|
2093
|
+
hook.a2 = a2;
|
|
2094
|
+
hook.a3 = a3;
|
|
2095
|
+
hook.didChange = true;
|
|
2096
|
+
}
|
|
2097
|
+
}
|
|
2098
|
+
return hook.value;
|
|
2099
|
+
}
|
|
2100
|
+
function useStoreLegacy(store, selector, a1, a2, a3) {
|
|
2101
|
+
return withSelectorExports.useSyncExternalStoreWithSelector(store.subscribe, store.getSnapshot, store.getSnapshot, (state) => selector(state, a1, a2, a3));
|
|
2102
|
+
}
|
|
2103
|
+
class Store {
|
|
2104
|
+
/**
|
|
2105
|
+
* The current state of the store.
|
|
2106
|
+
* This property is updated immediately when the state changes as a result of calling {@link setState}, {@link update}, or {@link set}.
|
|
2107
|
+
* To subscribe to state changes, use the {@link useState} method. The value returned by {@link useState} is updated after the component renders (similarly to React's useState).
|
|
2108
|
+
* The values can be used directly (to avoid subscribing to the store) in effects or event handlers.
|
|
2109
|
+
*
|
|
2110
|
+
* Do not modify properties in state directly. Instead, use the provided methods to ensure proper state management and listener notification.
|
|
2111
|
+
*/
|
|
2112
|
+
// Internal state to handle recursive `setState()` calls
|
|
2113
|
+
constructor(state) {
|
|
2114
|
+
/**
|
|
2115
|
+
* Registers a listener that will be called whenever the store's state changes.
|
|
2116
|
+
*
|
|
2117
|
+
* @param fn The listener function to be called on state changes.
|
|
2118
|
+
* @returns A function to unsubscribe the listener.
|
|
2119
|
+
*/
|
|
2120
|
+
__publicField(this, "subscribe", (fn) => {
|
|
2121
|
+
this.listeners.add(fn);
|
|
2122
|
+
return () => {
|
|
2123
|
+
this.listeners.delete(fn);
|
|
2124
|
+
};
|
|
2125
|
+
});
|
|
2126
|
+
/**
|
|
2127
|
+
* Returns the current state of the store.
|
|
2128
|
+
*/
|
|
2129
|
+
__publicField(this, "getSnapshot", () => {
|
|
2130
|
+
return this.state;
|
|
2131
|
+
});
|
|
2132
|
+
this.state = state;
|
|
2133
|
+
this.listeners = /* @__PURE__ */ new Set();
|
|
2134
|
+
this.updateTick = 0;
|
|
2135
|
+
}
|
|
2136
|
+
/**
|
|
2137
|
+
* Updates the entire store's state and notifies all registered listeners.
|
|
2138
|
+
*
|
|
2139
|
+
* @param newState The new state to set for the store.
|
|
2140
|
+
*/
|
|
2141
|
+
setState(newState) {
|
|
2142
|
+
if (this.state === newState) {
|
|
2143
|
+
return;
|
|
2144
|
+
}
|
|
2145
|
+
this.state = newState;
|
|
2146
|
+
this.updateTick += 1;
|
|
2147
|
+
const currentTick = this.updateTick;
|
|
2148
|
+
for (const listener of this.listeners) {
|
|
2149
|
+
if (currentTick !== this.updateTick) {
|
|
2150
|
+
return;
|
|
2151
|
+
}
|
|
2152
|
+
listener(newState);
|
|
2153
|
+
}
|
|
2154
|
+
}
|
|
2155
|
+
/**
|
|
2156
|
+
* Merges the provided changes into the current state and notifies listeners if there are changes.
|
|
2157
|
+
*
|
|
2158
|
+
* @param changes An object containing the changes to apply to the current state.
|
|
2159
|
+
*/
|
|
2160
|
+
update(changes) {
|
|
2161
|
+
for (const key in changes) {
|
|
2162
|
+
if (!Object.is(this.state[key], changes[key])) {
|
|
2163
|
+
this.setState({
|
|
2164
|
+
...this.state,
|
|
2165
|
+
...changes
|
|
2166
|
+
});
|
|
2167
|
+
return;
|
|
2168
|
+
}
|
|
2169
|
+
}
|
|
2170
|
+
}
|
|
2171
|
+
/**
|
|
2172
|
+
* Sets a specific key in the store's state to a new value and notifies listeners if the value has changed.
|
|
2173
|
+
*
|
|
2174
|
+
* @param key The key in the store's state to update.
|
|
2175
|
+
* @param value The new value to set for the specified key.
|
|
2176
|
+
*/
|
|
2177
|
+
set(key, value) {
|
|
2178
|
+
if (!Object.is(this.state[key], value)) {
|
|
2179
|
+
this.setState({
|
|
2180
|
+
...this.state,
|
|
2181
|
+
[key]: value
|
|
2182
|
+
});
|
|
2183
|
+
}
|
|
2184
|
+
}
|
|
2185
|
+
/**
|
|
2186
|
+
* Gives the state a new reference and updates all registered listeners.
|
|
2187
|
+
*/
|
|
2188
|
+
notifyAll() {
|
|
2189
|
+
const newState = {
|
|
2190
|
+
...this.state
|
|
2191
|
+
};
|
|
2192
|
+
this.setState(newState);
|
|
2193
|
+
}
|
|
2194
|
+
use(selector, a1, a2, a3) {
|
|
2195
|
+
return useStore(this, selector, a1, a2, a3);
|
|
2196
|
+
}
|
|
2197
|
+
}
|
|
2198
|
+
class ReactStore extends Store {
|
|
2199
|
+
/**
|
|
2200
|
+
* Creates a new ReactStore instance.
|
|
2201
|
+
*
|
|
2202
|
+
* @param state Initial state of the store.
|
|
2203
|
+
* @param context Non-reactive context values.
|
|
2204
|
+
* @param selectors Optional selectors for use with `useState`.
|
|
2205
|
+
*/
|
|
2206
|
+
constructor(state, context = {}, selectors2) {
|
|
2207
|
+
super(state);
|
|
2208
|
+
this.context = context;
|
|
2209
|
+
this.selectors = selectors2;
|
|
2210
|
+
}
|
|
2211
|
+
/**
|
|
2212
|
+
* Non-reactive values such as refs, callbacks, etc.
|
|
2213
|
+
*/
|
|
2214
|
+
/**
|
|
2215
|
+
* Synchronizes a single external value into the store.
|
|
2216
|
+
*
|
|
2217
|
+
* Note that the while the value in `state` is updated immediately, the value returned
|
|
2218
|
+
* by `useState` is updated before the next render (similarly to React's `useState`).
|
|
2219
|
+
*/
|
|
2220
|
+
useSyncedValue(key, value) {
|
|
2221
|
+
React__namespace.useDebugValue(key);
|
|
2222
|
+
useIsoLayoutEffect.useIsoLayoutEffect(() => {
|
|
2223
|
+
if (this.state[key] !== value) {
|
|
2224
|
+
this.set(key, value);
|
|
2225
|
+
}
|
|
2226
|
+
}, [key, value]);
|
|
2227
|
+
}
|
|
2228
|
+
/**
|
|
2229
|
+
* Synchronizes a single external value into the store and
|
|
2230
|
+
* cleans it up (sets to `undefined`) on unmount.
|
|
2231
|
+
*
|
|
2232
|
+
* Note that the while the value in `state` is updated immediately, the value returned
|
|
2233
|
+
* by `useState` is updated before the next render (similarly to React's `useState`).
|
|
2234
|
+
*/
|
|
2235
|
+
useSyncedValueWithCleanup(key, value) {
|
|
2236
|
+
const store = this;
|
|
2237
|
+
useIsoLayoutEffect.useIsoLayoutEffect(() => {
|
|
2238
|
+
if (store.state[key] !== value) {
|
|
2239
|
+
store.set(key, value);
|
|
2240
|
+
}
|
|
2241
|
+
return () => {
|
|
2242
|
+
store.set(key, void 0);
|
|
2243
|
+
};
|
|
2244
|
+
}, [store, key, value]);
|
|
2245
|
+
}
|
|
2246
|
+
/**
|
|
2247
|
+
* Synchronizes multiple external values into the store.
|
|
2248
|
+
*
|
|
2249
|
+
* Note that the while the values in `state` are updated immediately, the values returned
|
|
2250
|
+
* by `useState` are updated before the next render (similarly to React's `useState`).
|
|
2251
|
+
*/
|
|
2252
|
+
useSyncedValues(statePart) {
|
|
2253
|
+
const store = this;
|
|
2254
|
+
if (process.env.NODE_ENV !== "production") {
|
|
2255
|
+
React__namespace.useDebugValue(statePart, (p) => Object.keys(p));
|
|
2256
|
+
const keys = React__namespace.useRef(Object.keys(statePart)).current;
|
|
2257
|
+
const nextKeys = Object.keys(statePart);
|
|
2258
|
+
if (keys.length !== nextKeys.length || keys.some((key, index) => key !== nextKeys[index])) {
|
|
2259
|
+
console.error("ReactStore.useSyncedValues expects the same prop keys on every render. Keys should be stable.");
|
|
2260
|
+
}
|
|
2261
|
+
}
|
|
2262
|
+
const dependencies = Object.values(statePart);
|
|
2263
|
+
useIsoLayoutEffect.useIsoLayoutEffect(() => {
|
|
2264
|
+
store.update(statePart);
|
|
2265
|
+
}, [store, ...dependencies]);
|
|
2266
|
+
}
|
|
2267
|
+
/**
|
|
2268
|
+
* Registers a controllable prop pair (`controlled`, `defaultValue`) for a specific key. If `controlled`
|
|
2269
|
+
* is non-undefined, the store's state at `key` is updated to match `controlled`.
|
|
2270
|
+
*/
|
|
2271
|
+
useControlledProp(key, controlled) {
|
|
2272
|
+
React__namespace.useDebugValue(key);
|
|
2273
|
+
const isControlled = controlled !== void 0;
|
|
2274
|
+
useIsoLayoutEffect.useIsoLayoutEffect(() => {
|
|
2275
|
+
if (isControlled && !Object.is(this.state[key], controlled)) {
|
|
2276
|
+
super.setState({
|
|
2277
|
+
...this.state,
|
|
2278
|
+
[key]: controlled
|
|
2279
|
+
});
|
|
2280
|
+
}
|
|
2281
|
+
}, [key, controlled, isControlled]);
|
|
2282
|
+
if (process.env.NODE_ENV !== "production") {
|
|
2283
|
+
const cache = this.controlledValues ?? (this.controlledValues = /* @__PURE__ */ new Map());
|
|
2284
|
+
if (!cache.has(key)) {
|
|
2285
|
+
cache.set(key, isControlled);
|
|
2286
|
+
}
|
|
2287
|
+
const previouslyControlled = cache.get(key);
|
|
2288
|
+
if (previouslyControlled !== void 0 && previouslyControlled !== isControlled) {
|
|
2289
|
+
console.error(`A component is changing the ${isControlled ? "" : "un"}controlled state of ${key.toString()} to be ${isControlled ? "un" : ""}controlled. Elements should not switch from uncontrolled to controlled (or vice versa).`);
|
|
2290
|
+
}
|
|
2291
|
+
}
|
|
2292
|
+
}
|
|
2293
|
+
/** Gets the current value from the store using a selector with the provided key.
|
|
2294
|
+
*
|
|
2295
|
+
* @param key Key of the selector to use.
|
|
2296
|
+
*/
|
|
2297
|
+
select(key, a1, a2, a3) {
|
|
2298
|
+
const selector = this.selectors[key];
|
|
2299
|
+
return selector(this.state, a1, a2, a3);
|
|
2300
|
+
}
|
|
2301
|
+
/**
|
|
2302
|
+
* Returns a value from the store's state using a selector function.
|
|
2303
|
+
* Used to subscribe to specific parts of the state.
|
|
2304
|
+
* This methods causes a rerender whenever the selected state changes.
|
|
2305
|
+
*
|
|
2306
|
+
* @param key Key of the selector to use.
|
|
2307
|
+
*/
|
|
2308
|
+
useState(key, a1, a2, a3) {
|
|
2309
|
+
React__namespace.useDebugValue(key);
|
|
2310
|
+
return useStore(this, this.selectors[key], a1, a2, a3);
|
|
2311
|
+
}
|
|
2312
|
+
/**
|
|
2313
|
+
* Wraps a function with `useStableCallback` to ensure it has a stable reference
|
|
2314
|
+
* and assigns it to the context.
|
|
2315
|
+
*
|
|
2316
|
+
* @param key Key of the event callback. Must be a function in the context.
|
|
2317
|
+
* @param fn Function to assign.
|
|
2318
|
+
*/
|
|
2319
|
+
useContextCallback(key, fn) {
|
|
2320
|
+
React__namespace.useDebugValue(key);
|
|
2321
|
+
const stableFunction = useStableCallback.useStableCallback(fn ?? useRenderElement.NOOP);
|
|
2322
|
+
this.context[key] = stableFunction;
|
|
2323
|
+
}
|
|
2324
|
+
/**
|
|
2325
|
+
* Returns a stable setter function for a specific key in the store's state.
|
|
2326
|
+
* It's commonly used to pass as a ref callback to React elements.
|
|
2327
|
+
*
|
|
2328
|
+
* @param key Key of the state to set.
|
|
2329
|
+
*/
|
|
2330
|
+
useStateSetter(key) {
|
|
2331
|
+
const ref = React__namespace.useRef(void 0);
|
|
2332
|
+
if (ref.current === void 0) {
|
|
2333
|
+
ref.current = (value) => {
|
|
2334
|
+
this.set(key, value);
|
|
2335
|
+
};
|
|
2336
|
+
}
|
|
2337
|
+
return ref.current;
|
|
2338
|
+
}
|
|
2339
|
+
/**
|
|
2340
|
+
* Observes changes derived from the store's selectors and calls the listener when the selected value changes.
|
|
2341
|
+
*
|
|
2342
|
+
* @param key Key of the selector to observe.
|
|
2343
|
+
* @param listener Listener function called when the selector result changes.
|
|
2344
|
+
*/
|
|
2345
|
+
observe(selector, listener) {
|
|
2346
|
+
let selectFn;
|
|
2347
|
+
if (typeof selector === "function") {
|
|
2348
|
+
selectFn = selector;
|
|
2349
|
+
} else {
|
|
2350
|
+
selectFn = this.selectors[selector];
|
|
2351
|
+
}
|
|
2352
|
+
let prevValue = selectFn(this.state);
|
|
2353
|
+
listener(prevValue, prevValue, this);
|
|
2354
|
+
return this.subscribe((nextState) => {
|
|
2355
|
+
const nextValue = selectFn(nextState);
|
|
2356
|
+
if (!Object.is(prevValue, nextValue)) {
|
|
2357
|
+
const oldValue = prevValue;
|
|
2358
|
+
prevValue = nextValue;
|
|
2359
|
+
listener(nextValue, oldValue, this);
|
|
2360
|
+
}
|
|
2361
|
+
});
|
|
2362
|
+
}
|
|
2363
|
+
}
|
|
2364
|
+
const selectors = {
|
|
2365
|
+
open: createSelector((state) => state.open),
|
|
2366
|
+
domReferenceElement: createSelector((state) => state.domReferenceElement),
|
|
2367
|
+
referenceElement: createSelector((state) => state.positionReference ?? state.referenceElement),
|
|
2368
|
+
floatingElement: createSelector((state) => state.floatingElement),
|
|
2369
|
+
floatingId: createSelector((state) => state.floatingId)
|
|
2370
|
+
};
|
|
2371
|
+
class FloatingRootStore extends ReactStore {
|
|
2372
|
+
constructor(options) {
|
|
2373
|
+
const {
|
|
2374
|
+
nested,
|
|
2375
|
+
noEmit,
|
|
2376
|
+
onOpenChange,
|
|
2377
|
+
triggerElements,
|
|
2378
|
+
...initialState
|
|
2379
|
+
} = options;
|
|
2380
|
+
super({
|
|
2381
|
+
...initialState,
|
|
2382
|
+
positionReference: initialState.referenceElement,
|
|
2383
|
+
domReferenceElement: initialState.referenceElement
|
|
2384
|
+
}, {
|
|
2385
|
+
onOpenChange,
|
|
2386
|
+
dataRef: {
|
|
2387
|
+
current: {}
|
|
2388
|
+
},
|
|
2389
|
+
events: createEventEmitter(),
|
|
2390
|
+
nested,
|
|
2391
|
+
noEmit,
|
|
2392
|
+
triggerElements
|
|
2393
|
+
}, selectors);
|
|
2394
|
+
/**
|
|
2395
|
+
* Emits the `openchange` event through the internal event emitter and calls the `onOpenChange` handler with the provided arguments.
|
|
2396
|
+
*
|
|
2397
|
+
* @param newOpen The new open state.
|
|
2398
|
+
* @param eventDetails Details about the event that triggered the open state change.
|
|
2399
|
+
*/
|
|
2400
|
+
__publicField(this, "setOpen", (newOpen, eventDetails) => {
|
|
2401
|
+
var _a, _b;
|
|
2402
|
+
if (!newOpen || !this.state.open || // Prevent a pending hover-open from overwriting a click-open event, while allowing
|
|
2403
|
+
// click events to upgrade a hover-open.
|
|
2404
|
+
event.isClickLikeEvent(eventDetails.event)) {
|
|
2405
|
+
this.context.dataRef.current.openEvent = newOpen ? eventDetails.event : void 0;
|
|
2406
|
+
}
|
|
2407
|
+
if (!this.context.noEmit) {
|
|
2408
|
+
const details = {
|
|
2409
|
+
open: newOpen,
|
|
2410
|
+
reason: eventDetails.reason,
|
|
2411
|
+
nativeEvent: eventDetails.event,
|
|
2412
|
+
nested: this.context.nested,
|
|
2413
|
+
triggerElement: eventDetails.trigger
|
|
2414
|
+
};
|
|
2415
|
+
this.context.events.emit("openchange", details);
|
|
2416
|
+
}
|
|
2417
|
+
(_b = (_a = this.context).onOpenChange) == null ? void 0 : _b.call(_a, newOpen, eventDetails);
|
|
2418
|
+
});
|
|
2419
|
+
}
|
|
2420
|
+
}
|
|
2421
|
+
class PopupTriggerMap {
|
|
2422
|
+
constructor() {
|
|
2423
|
+
this.elementsSet = /* @__PURE__ */ new Set();
|
|
2424
|
+
this.idMap = /* @__PURE__ */ new Map();
|
|
2425
|
+
}
|
|
2426
|
+
/**
|
|
2427
|
+
* Adds a trigger element with the given ID.
|
|
2428
|
+
*
|
|
2429
|
+
* Note: The provided element is assumed to not be registered under multiple IDs.
|
|
2430
|
+
*/
|
|
2431
|
+
add(id, element2) {
|
|
2432
|
+
const existingElement = this.idMap.get(id);
|
|
2433
|
+
if (existingElement === element2) {
|
|
2434
|
+
return;
|
|
2435
|
+
}
|
|
2436
|
+
if (existingElement !== void 0) {
|
|
2437
|
+
this.elementsSet.delete(existingElement);
|
|
2438
|
+
}
|
|
2439
|
+
this.elementsSet.add(element2);
|
|
2440
|
+
this.idMap.set(id, element2);
|
|
2441
|
+
if (process.env.NODE_ENV !== "production") {
|
|
2442
|
+
if (this.elementsSet.size !== this.idMap.size) {
|
|
2443
|
+
throw new Error("Base UI: A trigger element cannot be registered under multiple IDs in PopupTriggerMap.");
|
|
2444
|
+
}
|
|
2445
|
+
}
|
|
2446
|
+
}
|
|
2447
|
+
/**
|
|
2448
|
+
* Removes the trigger element with the given ID.
|
|
2449
|
+
*/
|
|
2450
|
+
delete(id) {
|
|
2451
|
+
const element2 = this.idMap.get(id);
|
|
2452
|
+
if (element2) {
|
|
2453
|
+
this.elementsSet.delete(element2);
|
|
2454
|
+
this.idMap.delete(id);
|
|
2455
|
+
}
|
|
2456
|
+
}
|
|
2457
|
+
/**
|
|
2458
|
+
* Whether the given element is registered as a trigger.
|
|
2459
|
+
*/
|
|
2460
|
+
hasElement(element2) {
|
|
2461
|
+
return this.elementsSet.has(element2);
|
|
2462
|
+
}
|
|
2463
|
+
/**
|
|
2464
|
+
* Whether there is a registered trigger element matching the given predicate.
|
|
2465
|
+
*/
|
|
2466
|
+
hasMatchingElement(predicate) {
|
|
2467
|
+
for (const element2 of this.elementsSet) {
|
|
2468
|
+
if (predicate(element2)) {
|
|
2469
|
+
return true;
|
|
2470
|
+
}
|
|
2471
|
+
}
|
|
2472
|
+
return false;
|
|
2473
|
+
}
|
|
2474
|
+
/**
|
|
2475
|
+
* Returns the trigger element associated with the given ID, or undefined if no such element exists.
|
|
2476
|
+
*/
|
|
2477
|
+
getById(id) {
|
|
2478
|
+
return this.idMap.get(id);
|
|
2479
|
+
}
|
|
2480
|
+
/**
|
|
2481
|
+
* Returns an iterable of all registered trigger entries, where each entry is a tuple of [id, element].
|
|
2482
|
+
*/
|
|
2483
|
+
entries() {
|
|
2484
|
+
return this.idMap.entries();
|
|
2485
|
+
}
|
|
2486
|
+
/**
|
|
2487
|
+
* Returns an iterable of all registered trigger elements.
|
|
2488
|
+
*/
|
|
2489
|
+
elements() {
|
|
2490
|
+
return this.elementsSet.values();
|
|
2491
|
+
}
|
|
2492
|
+
/**
|
|
2493
|
+
* Returns the number of registered trigger elements.
|
|
2494
|
+
*/
|
|
2495
|
+
get size() {
|
|
2496
|
+
return this.idMap.size;
|
|
2497
|
+
}
|
|
2498
|
+
}
|
|
2499
|
+
function useInteractions(propsList = []) {
|
|
2500
|
+
const referenceDeps = propsList.map((key) => key == null ? void 0 : key.reference);
|
|
2501
|
+
const floatingDeps = propsList.map((key) => key == null ? void 0 : key.floating);
|
|
2502
|
+
const itemDeps = propsList.map((key) => key == null ? void 0 : key.item);
|
|
2503
|
+
const triggerDeps = propsList.map((key) => key == null ? void 0 : key.trigger);
|
|
2504
|
+
const getReferenceProps = React__namespace.useCallback(
|
|
2505
|
+
(userProps) => mergeProps(userProps, propsList, "reference"),
|
|
2506
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2507
|
+
referenceDeps
|
|
2508
|
+
);
|
|
2509
|
+
const getFloatingProps = React__namespace.useCallback(
|
|
2510
|
+
(userProps) => mergeProps(userProps, propsList, "floating"),
|
|
2511
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2512
|
+
floatingDeps
|
|
2513
|
+
);
|
|
2514
|
+
const getItemProps = React__namespace.useCallback(
|
|
2515
|
+
(userProps) => mergeProps(userProps, propsList, "item"),
|
|
2516
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2517
|
+
itemDeps
|
|
2518
|
+
);
|
|
2519
|
+
const getTriggerProps = React__namespace.useCallback(
|
|
2520
|
+
(userProps) => mergeProps(userProps, propsList, "trigger"),
|
|
2521
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2522
|
+
triggerDeps
|
|
2523
|
+
);
|
|
2524
|
+
return React__namespace.useMemo(() => ({
|
|
2525
|
+
getReferenceProps,
|
|
2526
|
+
getFloatingProps,
|
|
2527
|
+
getItemProps,
|
|
2528
|
+
getTriggerProps
|
|
2529
|
+
}), [getReferenceProps, getFloatingProps, getItemProps, getTriggerProps]);
|
|
2530
|
+
}
|
|
2531
|
+
function mergeProps(userProps, propsList, elementKey) {
|
|
2532
|
+
var _a;
|
|
2533
|
+
const eventHandlers = /* @__PURE__ */ new Map();
|
|
2534
|
+
const isItem = elementKey === "item";
|
|
2535
|
+
const outputProps = {};
|
|
2536
|
+
if (elementKey === "floating") {
|
|
2537
|
+
outputProps.tabIndex = -1;
|
|
2538
|
+
outputProps[constants.FOCUSABLE_ATTRIBUTE] = "";
|
|
2539
|
+
}
|
|
2540
|
+
for (const key in userProps) {
|
|
2541
|
+
if (isItem && userProps) {
|
|
2542
|
+
if (key === constants.ACTIVE_KEY || key === constants.SELECTED_KEY) {
|
|
2543
|
+
continue;
|
|
2544
|
+
}
|
|
2545
|
+
}
|
|
2546
|
+
outputProps[key] = userProps[key];
|
|
2547
|
+
}
|
|
2548
|
+
for (let i = 0; i < propsList.length; i += 1) {
|
|
2549
|
+
let props;
|
|
2550
|
+
const propsOrGetProps = (_a = propsList[i]) == null ? void 0 : _a[elementKey];
|
|
2551
|
+
if (typeof propsOrGetProps === "function") {
|
|
2552
|
+
props = userProps ? propsOrGetProps(userProps) : null;
|
|
2553
|
+
} else {
|
|
2554
|
+
props = propsOrGetProps;
|
|
2555
|
+
}
|
|
2556
|
+
if (!props) {
|
|
2557
|
+
continue;
|
|
2558
|
+
}
|
|
2559
|
+
mutablyMergeProps(outputProps, props, isItem, eventHandlers);
|
|
2560
|
+
}
|
|
2561
|
+
mutablyMergeProps(outputProps, userProps, isItem, eventHandlers);
|
|
2562
|
+
return outputProps;
|
|
2563
|
+
}
|
|
2564
|
+
function mutablyMergeProps(outputProps, props, isItem, eventHandlers) {
|
|
2565
|
+
var _a;
|
|
2566
|
+
for (const key in props) {
|
|
2567
|
+
const value = props[key];
|
|
2568
|
+
if (isItem && (key === constants.ACTIVE_KEY || key === constants.SELECTED_KEY)) {
|
|
2569
|
+
continue;
|
|
2570
|
+
}
|
|
2571
|
+
if (!key.startsWith("on")) {
|
|
2572
|
+
outputProps[key] = value;
|
|
2573
|
+
} else {
|
|
2574
|
+
if (!eventHandlers.has(key)) {
|
|
2575
|
+
eventHandlers.set(key, []);
|
|
2576
|
+
}
|
|
2577
|
+
if (typeof value === "function") {
|
|
2578
|
+
(_a = eventHandlers.get(key)) == null ? void 0 : _a.push(value);
|
|
2579
|
+
outputProps[key] = (...args) => {
|
|
2580
|
+
var _a2;
|
|
2581
|
+
return (_a2 = eventHandlers.get(key)) == null ? void 0 : _a2.map((fn) => fn(...args)).find((val) => val !== void 0);
|
|
2582
|
+
};
|
|
2583
|
+
}
|
|
2584
|
+
}
|
|
2585
|
+
}
|
|
2586
|
+
}
|
|
2587
|
+
let CommonPopupDataAttributes = (function(CommonPopupDataAttributes2) {
|
|
2588
|
+
CommonPopupDataAttributes2["open"] = "data-open";
|
|
2589
|
+
CommonPopupDataAttributes2["closed"] = "data-closed";
|
|
2590
|
+
CommonPopupDataAttributes2[CommonPopupDataAttributes2["startingStyle"] = useOpenChangeComplete.TransitionStatusDataAttributes.startingStyle] = "startingStyle";
|
|
2591
|
+
CommonPopupDataAttributes2[CommonPopupDataAttributes2["endingStyle"] = useOpenChangeComplete.TransitionStatusDataAttributes.endingStyle] = "endingStyle";
|
|
2592
|
+
CommonPopupDataAttributes2["anchorHidden"] = "data-anchor-hidden";
|
|
2593
|
+
CommonPopupDataAttributes2["side"] = "data-side";
|
|
2594
|
+
CommonPopupDataAttributes2["align"] = "data-align";
|
|
2595
|
+
return CommonPopupDataAttributes2;
|
|
2596
|
+
})({});
|
|
2597
|
+
let CommonTriggerDataAttributes = /* @__PURE__ */ (function(CommonTriggerDataAttributes2) {
|
|
2598
|
+
CommonTriggerDataAttributes2["popupOpen"] = "data-popup-open";
|
|
2599
|
+
CommonTriggerDataAttributes2["pressed"] = "data-pressed";
|
|
2600
|
+
return CommonTriggerDataAttributes2;
|
|
2601
|
+
})({});
|
|
2602
|
+
const TRIGGER_HOOK = {
|
|
2603
|
+
[CommonTriggerDataAttributes.popupOpen]: ""
|
|
2604
|
+
};
|
|
2605
|
+
const PRESSABLE_TRIGGER_HOOK = {
|
|
2606
|
+
[CommonTriggerDataAttributes.popupOpen]: "",
|
|
2607
|
+
[CommonTriggerDataAttributes.pressed]: ""
|
|
2608
|
+
};
|
|
2609
|
+
const POPUP_OPEN_HOOK = {
|
|
2610
|
+
[CommonPopupDataAttributes.open]: ""
|
|
2611
|
+
};
|
|
2612
|
+
const POPUP_CLOSED_HOOK = {
|
|
2613
|
+
[CommonPopupDataAttributes.closed]: ""
|
|
2614
|
+
};
|
|
2615
|
+
const ANCHOR_HIDDEN_HOOK = {
|
|
2616
|
+
[CommonPopupDataAttributes.anchorHidden]: ""
|
|
2617
|
+
};
|
|
2618
|
+
const triggerOpenStateMapping = {
|
|
2619
|
+
open(value) {
|
|
2620
|
+
if (value) {
|
|
2621
|
+
return TRIGGER_HOOK;
|
|
2622
|
+
}
|
|
2623
|
+
return null;
|
|
2624
|
+
}
|
|
2625
|
+
};
|
|
2626
|
+
const pressableTriggerOpenStateMapping = {
|
|
2627
|
+
open(value) {
|
|
2628
|
+
if (value) {
|
|
2629
|
+
return PRESSABLE_TRIGGER_HOOK;
|
|
2630
|
+
}
|
|
2631
|
+
return null;
|
|
2632
|
+
}
|
|
2633
|
+
};
|
|
2634
|
+
const popupStateMapping = {
|
|
2635
|
+
open(value) {
|
|
2636
|
+
if (value) {
|
|
2637
|
+
return POPUP_OPEN_HOOK;
|
|
2638
|
+
}
|
|
2639
|
+
return POPUP_CLOSED_HOOK;
|
|
2640
|
+
},
|
|
2641
|
+
anchorHidden(value) {
|
|
2642
|
+
if (value) {
|
|
2643
|
+
return ANCHOR_HIDDEN_HOOK;
|
|
2644
|
+
}
|
|
2645
|
+
return null;
|
|
2646
|
+
}
|
|
2647
|
+
};
|
|
2648
|
+
exports.CLICK_TRIGGER_IDENTIFIER = CLICK_TRIGGER_IDENTIFIER;
|
|
2649
|
+
exports.CommonPopupDataAttributes = CommonPopupDataAttributes;
|
|
2650
|
+
exports.CommonTriggerDataAttributes = CommonTriggerDataAttributes;
|
|
2651
|
+
exports.DISABLED_TRANSITIONS_STYLE = DISABLED_TRANSITIONS_STYLE;
|
|
2652
|
+
exports.DROPDOWN_COLLISION_AVOIDANCE = DROPDOWN_COLLISION_AVOIDANCE;
|
|
2653
|
+
exports.FloatingNode = FloatingNode;
|
|
2654
|
+
exports.FloatingPortal = FloatingPortal;
|
|
2655
|
+
exports.FloatingRootStore = FloatingRootStore;
|
|
2656
|
+
exports.FloatingTree = FloatingTree;
|
|
2657
|
+
exports.FloatingTreeStore = FloatingTreeStore;
|
|
2658
|
+
exports.FocusGuard = FocusGuard;
|
|
2659
|
+
exports.PATIENT_CLICK_THRESHOLD = PATIENT_CLICK_THRESHOLD;
|
|
2660
|
+
exports.POPUP_COLLISION_AVOIDANCE = POPUP_COLLISION_AVOIDANCE;
|
|
2661
|
+
exports.PopupTriggerMap = PopupTriggerMap;
|
|
2662
|
+
exports.ReactStore = ReactStore;
|
|
2663
|
+
exports.Store = Store;
|
|
2664
|
+
exports.TYPEAHEAD_RESET_MS = TYPEAHEAD_RESET_MS;
|
|
2665
|
+
exports.createAttribute = createAttribute;
|
|
2666
|
+
exports.createSelector = createSelector;
|
|
2667
|
+
exports.disableFocusInside = disableFocusInside;
|
|
2668
|
+
exports.enableFocusInside = enableFocusInside;
|
|
2669
|
+
exports.fastComponent = fastComponent;
|
|
2670
|
+
exports.fastComponentRef = fastComponentRef;
|
|
2671
|
+
exports.focusable = focusable;
|
|
2672
|
+
exports.getNextTabbable = getNextTabbable;
|
|
2673
|
+
exports.getNodeAncestors = getNodeAncestors;
|
|
2674
|
+
exports.getNodeChildren = getNodeChildren;
|
|
2675
|
+
exports.getPreviousTabbable = getPreviousTabbable;
|
|
2676
|
+
exports.getTabbableAfterElement = getTabbableAfterElement;
|
|
2677
|
+
exports.getTabbableBeforeElement = getTabbableBeforeElement;
|
|
2678
|
+
exports.getTabbableOptions = getTabbableOptions;
|
|
2679
|
+
exports.isOutsideEvent = isOutsideEvent;
|
|
2680
|
+
exports.isTabbable = isTabbable;
|
|
2681
|
+
exports.ownerVisuallyHidden = ownerVisuallyHidden;
|
|
2682
|
+
exports.popupStateMapping = popupStateMapping;
|
|
2683
|
+
exports.pressableTriggerOpenStateMapping = pressableTriggerOpenStateMapping;
|
|
2684
|
+
exports.tabbable = tabbable;
|
|
2685
|
+
exports.triggerOpenStateMapping = triggerOpenStateMapping;
|
|
2686
|
+
exports.useDismiss = useDismiss;
|
|
2687
|
+
exports.useFloatingNodeId = useFloatingNodeId;
|
|
2688
|
+
exports.useFloatingParentNodeId = useFloatingParentNodeId;
|
|
2689
|
+
exports.useFloatingPortalNode = useFloatingPortalNode;
|
|
2690
|
+
exports.useFloatingTree = useFloatingTree;
|
|
2691
|
+
exports.useInteractions = useInteractions;
|
|
2692
|
+
exports.usePortalContext = usePortalContext;
|
|
2693
|
+
exports.useStore = useStore;
|
|
2694
|
+
//# sourceMappingURL=popupStateMapping-DKN5mXrh.js.map
|