@tamagui/popover 2.7.7 → 3.0.0-beta.643.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/Popover.cjs +509 -664
- package/dist/cjs/Popover.native.cjs +603 -0
- package/dist/cjs/Popover.native.js +536 -691
- package/dist/cjs/Popover.native.js.map +1 -1
- package/dist/cjs/index.cjs +10 -11
- package/dist/cjs/index.native.cjs +22 -0
- package/dist/cjs/index.native.js +10 -10
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/useFloatingContext.cjs +202 -234
- package/dist/cjs/useFloatingContext.native.cjs +36 -0
- package/dist/cjs/useFloatingContext.native.js +20 -27
- package/dist/cjs/useFloatingContext.native.js.map +1 -1
- package/dist/esm/Popover.mjs +473 -617
- package/dist/esm/Popover.mjs.map +1 -1
- package/dist/esm/Popover.native.js +499 -644
- package/dist/esm/Popover.native.js.map +1 -1
- package/dist/esm/index.js +3 -3
- package/dist/esm/index.mjs +3 -3
- package/dist/esm/index.native.js +3 -3
- package/dist/esm/useFloatingContext.mjs +186 -208
- package/dist/esm/useFloatingContext.mjs.map +1 -1
- package/dist/esm/useFloatingContext.native.js +4 -2
- package/dist/esm/useFloatingContext.native.js.map +1 -1
- package/dist/jsx/Popover.mjs +473 -617
- package/dist/jsx/Popover.mjs.map +1 -1
- package/dist/jsx/Popover.native.cjs +603 -0
- package/dist/jsx/Popover.native.js +536 -691
- package/dist/jsx/Popover.native.js.map +1 -1
- package/dist/jsx/index.js +3 -3
- package/dist/jsx/index.mjs +3 -3
- package/dist/jsx/index.native.cjs +22 -0
- package/dist/jsx/index.native.js +10 -10
- package/dist/jsx/index.native.js.map +1 -1
- package/dist/jsx/useFloatingContext.mjs +186 -208
- package/dist/jsx/useFloatingContext.mjs.map +1 -1
- package/dist/jsx/useFloatingContext.native.cjs +36 -0
- package/dist/jsx/useFloatingContext.native.js +20 -27
- package/dist/jsx/useFloatingContext.native.js.map +1 -1
- package/package.json +22 -22
- package/src/Popover.tsx +115 -147
- package/types/Popover.d.ts +33 -109
- package/types/Popover.d.ts.map +1 -1
- package/types/useFloatingContext.d.ts.map +1 -1
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/index.mjs.map +0 -1
- package/dist/esm/index.native.js.map +0 -1
- package/dist/jsx/index.js.map +0 -1
- package/dist/jsx/index.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Fragment","jsx","jsxs","Adapt","AdaptParent","AdaptPortalContents","ProvideAdaptContext","useAdaptContext","useAdaptIsActive","Animate","ResetPresence","useComposedRefs","isWeb","useIsomorphicLayoutEffect","View","createStyledContext","useCreateShallowSetState","useEvent","useGet","DismissableBranch","FloatingOverrideContext","FocusScopeController","composeEventHandlers","withStaticProperties","Popper","PopperAnchor","PopperArrow","PopperArrowFrame","PopperContent","PopperContentFrame","PopperProvider","usePopperContext","Portal","needsPortalRepropagation","ScrollView","SheetController","YStack","useControllableState","React","useFloatingContext","needsRepropagation","openPopovers","Set","hasOpenPopovers","size","closeOpenPopovers","forEach","setOpen","closeLastOpenedPopover","last","Array","from","pop","PopoverContext","PopoverZIndexContext","createContext","PopoverAdaptHiddenContext","PopoverTriggerContext","usePopoverContext","useStyledContext","usePopoverTriggerContext","usePopoverOpen","scope","open","usePopoverTriggerSetup","triggerStateSettersRef","useRef","Map","activeTriggerIdRef","setActiveTrigger","id","prevId","current","_triggerStateSettersRef_current_get","get","_triggerStateSettersRef_current_get1","registerTrigger","setOpenState","set","unregisterTrigger","delete","useEffect","activeId","PopoverContextProvider","memo","param","children","onOpenChange","onOpenToggle","triggerRef","contentId","hasCustomAnchor","onCustomAnchorAdd","voidFn","onCustomAnchorRemove","anchorTo","adaptScope","breakpointActive","keepChildrenMounted","disableDismissable","hoverable","branches","useState","Provider","popoverScope","PopoverAnchor","forwardRef","PopoverAnchor2","props","forwardedRef","rest","ref","PopoverTrigger","PopoverTrigger2","disablePressTrigger","triggerContext","triggerId","useId","triggerElRef","composedTriggerRef","activateSelf","el","trigger","getState","onPress","onMouseEnter","onPressIn","onFocus","virtualRef","useMemo","getBoundingClientRect","DOMRect","fromRect","measure","c","x","y","width","height","measureInWindow","wrappedTrigger","asChild","PopoverContent","styleable","PopoverContent2","trapFocus","enableRemoveScroll","zIndex","zIndexProp","contentImplProps","context","zIndexFromContext","useContext","composedRefs","isRightClickOutsideRef","isFullyHidden","setIsFullyHidden","isAdaptFullyHidden","_contentImplProps_pointerEvents","PopoverPortal","passThrough","pointerEvents","PopoverContentImpl","disableOutsidePointerEvents","onCloseAutoFocus","event","_context_triggerRef_current","defaultPrevented","preventDefault","focus","onPointerDownOutside","originalEvent","detail","ctrlLeftClick","button","ctrlKey","checkDefaultPrevented","onFocusOutside","useParentContexts","popperContext","adaptContext","RepropagateParentContexts","PortalAdaptSafe","parentContexts","content","stackZIndex","fullscreen","PopoverContentImpl2","onOpenAutoFocus","disableFocusScope","onEscapeKeyDown","onInteractOutside","freezeContentsWhenHidden","lazyMount","forceUnmount","alwaysDisable","contentProps","handleExitComplete","useCallback","contents","disable","type","present","Boolean","onExitComplete","unstyled","backgroundColor","alignItems","PopoverClose","PopoverClose2","componentName","_context_onOpenChange","call","PopoverArrow","PopoverArrow2","PopoverScrollView","scrollEnabled","DEFAULT_SCOPE","Popover","Popover2","portal","PopoverInner","Anchor","Arrow","Trigger","Content","Close","FocusScope","PopoverInner2","openProp","defaultOpen","keepChildrenMountedProp","disableFocus","restProps","setHasCustomAnchor","viaRef","prop","defaultProp","transition","onChange","val","add","handleOpenChange","via","isAdapted","floatingContext","setAnchorToRaw","setAnchorTo","useImperativeHandle","toggle","prev","close","stayInFrame","PopoverSheetController","result","value","showSheet","useShowPopoverSheet","getShowSheet","setIsAdaptFullyHidden","_props_onOpenChange","onAnimationComplete","param2","isOpen","hidden"],"sources":["Popover.native.js"],"sourcesContent":["import { Fragment, jsx, jsxs } from \"react/jsx-runtime\";\n\nimport { Adapt, AdaptParent, AdaptPortalContents, ProvideAdaptContext, useAdaptContext, useAdaptIsActive } from \"@tamagui/adapt\";\nimport { Animate } from \"@tamagui/animate\";\nimport { ResetPresence } from \"@tamagui/animate-presence\";\nimport { useComposedRefs } from \"@tamagui/compose-refs\";\nimport { isWeb, useIsomorphicLayoutEffect } from \"@tamagui/constants\";\nimport { View, createStyledContext, useCreateShallowSetState, useEvent, useGet } from \"@tamagui/core\";\nimport { DismissableBranch } from \"@tamagui/dismissable\";\nimport { FloatingOverrideContext } from \"@tamagui/floating\";\nimport { FocusScopeController } from \"@tamagui/focus-scope\";\nimport { composeEventHandlers, withStaticProperties } from \"@tamagui/helpers\";\nimport { Popper, PopperAnchor, PopperArrow, PopperArrowFrame, PopperContent, PopperContentFrame, PopperProvider, usePopperContext } from \"@tamagui/popper\";\nimport { Portal, needsPortalRepropagation } from \"@tamagui/portal\";\nimport { ScrollView } from \"@tamagui/scroll-view\";\nimport { SheetController } from \"@tamagui/sheet/controller\";\nimport { YStack } from \"@tamagui/stacks\";\nimport { useControllableState } from \"@tamagui/use-controllable-state\";\nimport * as React from \"react\";\nimport { useFloatingContext } from \"./useFloatingContext\";\n\nvar needsRepropagation = needsPortalRepropagation();\nvar openPopovers = /* @__PURE__ */ new Set();\nvar hasOpenPopovers = function() {\n\treturn openPopovers.size > 0;\n};\nvar closeOpenPopovers = function() {\n\tif (openPopovers.size === 0) return false;\n\topenPopovers.forEach(function(setOpen) {\n\t\treturn setOpen(false);\n\t});\n\treturn true;\n};\nvar closeLastOpenedPopover = function() {\n\tif (openPopovers.size === 0) return false;\n\tvar last = Array.from(openPopovers).pop();\n\tif (last) {\n\t\tlast(false);\n\t\treturn true;\n\t}\n\treturn false;\n};\nvar PopoverContext = createStyledContext({}, \"Popover__\");\nvar PopoverZIndexContext = /* @__PURE__ */ React.createContext(void 0);\nvar PopoverAdaptHiddenContext = /* @__PURE__ */ React.createContext(true);\nvar PopoverTriggerContext = createStyledContext({}, \"PopoverTrigger__\");\nvar usePopoverContext = PopoverContext.useStyledContext;\nvar usePopoverTriggerContext = PopoverTriggerContext.useStyledContext;\nfunction usePopoverOpen(scope) {\n\treturn usePopoverContext(scope).open;\n}\nfunction usePopoverTriggerSetup(open) {\n\tvar triggerStateSettersRef = React.useRef(/* @__PURE__ */ new Map());\n\tvar activeTriggerIdRef = React.useRef(null);\n\tvar setActiveTrigger = useEvent(function(id) {\n\t\tvar prevId = activeTriggerIdRef.current;\n\t\tif (prevId === id) return;\n\t\tif (prevId) {\n\t\t\tvar _triggerStateSettersRef_current_get;\n\t\t\t(_triggerStateSettersRef_current_get = triggerStateSettersRef.current.get(prevId)) === null || _triggerStateSettersRef_current_get === void 0 || _triggerStateSettersRef_current_get(false);\n\t\t}\n\t\tactiveTriggerIdRef.current = id;\n\t\tif (id && open) {\n\t\t\tvar _triggerStateSettersRef_current_get1;\n\t\t\t(_triggerStateSettersRef_current_get1 = triggerStateSettersRef.current.get(id)) === null || _triggerStateSettersRef_current_get1 === void 0 || _triggerStateSettersRef_current_get1(true);\n\t\t}\n\t});\n\tvar registerTrigger = useEvent(function(id, setOpenState) {\n\t\ttriggerStateSettersRef.current.set(id, setOpenState);\n\t\tsetOpenState(activeTriggerIdRef.current === id && open);\n\t});\n\tvar unregisterTrigger = useEvent(function(id) {\n\t\ttriggerStateSettersRef.current.delete(id);\n\t\tif (activeTriggerIdRef.current === id) activeTriggerIdRef.current = null;\n\t});\n\tReact.useEffect(function() {\n\t\tif (!open) {\n\t\t\tsetActiveTrigger(null);\n\t\t\treturn;\n\t\t}\n\t\tvar activeId = activeTriggerIdRef.current;\n\t\tif (activeId) {\n\t\t\tvar _triggerStateSettersRef_current_get;\n\t\t\t(_triggerStateSettersRef_current_get = triggerStateSettersRef.current.get(activeId)) === null || _triggerStateSettersRef_current_get === void 0 || _triggerStateSettersRef_current_get(true);\n\t\t}\n\t}, [open, setActiveTrigger]);\n\treturn {\n\t\tsetActiveTrigger,\n\t\tregisterTrigger,\n\t\tunregisterTrigger\n\t};\n}\nvar PopoverContextProvider = /* @__PURE__ */ React.memo(function(param) {\n\tvar { scope, children, open, onOpenChange, onOpenToggle, triggerRef, id = \"\", contentId, hasCustomAnchor = false, onCustomAnchorAdd = voidFn, onCustomAnchorRemove = voidFn, anchorTo, adaptScope, breakpointActive, keepChildrenMounted, disableDismissable, hoverable } = param;\n\tvar [branches] = React.useState(function() {\n\t\treturn /* @__PURE__ */ new Set();\n\t});\n\tvar { setActiveTrigger, registerTrigger, unregisterTrigger } = usePopoverTriggerSetup(open);\n\treturn /* @__PURE__ */ jsx(PopoverContext.Provider, {\n\t\tscope,\n\t\tpopoverScope: scope,\n\t\tadaptScope,\n\t\tid,\n\t\tcontentId,\n\t\ttriggerRef,\n\t\topen,\n\t\tonOpenChange,\n\t\tonOpenToggle,\n\t\thasCustomAnchor,\n\t\tonCustomAnchorAdd,\n\t\tonCustomAnchorRemove,\n\t\tanchorTo,\n\t\tbranches,\n\t\tbreakpointActive,\n\t\tkeepChildrenMounted,\n\t\tdisableDismissable,\n\t\thoverable,\n\t\tchildren: /* @__PURE__ */ jsx(PopoverTriggerContext.Provider, {\n\t\t\tscope,\n\t\t\ttriggerRef,\n\t\t\thasCustomAnchor,\n\t\t\tanchorTo,\n\t\t\tbranches,\n\t\t\tonOpenToggle,\n\t\t\tsetActiveTrigger,\n\t\t\tregisterTrigger,\n\t\t\tunregisterTrigger,\n\t\t\tchildren\n\t\t})\n\t});\n});\nvar voidFn = function() {};\nvar PopoverAnchor = /* @__PURE__ */ React.memo(/* @__PURE__ */ React.forwardRef(function PopoverAnchor2(props, forwardedRef) {\n\tvar { scope, ...rest } = props;\n\tvar { onCustomAnchorAdd, onCustomAnchorRemove } = usePopoverContext(scope) || {};\n\tReact.useEffect(function() {\n\t\tonCustomAnchorAdd();\n\t\treturn function() {\n\t\t\treturn onCustomAnchorRemove();\n\t\t};\n\t}, [onCustomAnchorAdd, onCustomAnchorRemove]);\n\treturn /* @__PURE__ */ jsx(PopperAnchor, {\n\t\tscope,\n\t\t...rest,\n\t\tref: forwardedRef\n\t});\n}));\nvar PopoverTrigger = /* @__PURE__ */ React.memo(/* @__PURE__ */ React.forwardRef(function PopoverTrigger2(props, forwardedRef) {\n\tvar { scope, disablePressTrigger, ...rest } = props;\n\tvar triggerContext = usePopoverTriggerContext(scope);\n\tvar triggerId = React.useId();\n\tvar [open, setOpen] = React.useState(false);\n\tvar anchorTo = triggerContext.anchorTo;\n\tvar triggerElRef = React.useRef(null);\n\tvar composedTriggerRef = useComposedRefs(forwardedRef, triggerElRef);\n\tvar { registerTrigger, unregisterTrigger } = triggerContext;\n\tReact.useEffect(function() {\n\t\tregisterTrigger(triggerId, setOpen);\n\t\treturn function() {\n\t\t\tunregisterTrigger(triggerId);\n\t\t};\n\t}, [\n\t\tregisterTrigger,\n\t\tunregisterTrigger,\n\t\ttriggerId\n\t]);\n\tif (!rest.children) return null;\n\tvar activateSelf = function() {\n\t\ttriggerContext.setActiveTrigger(triggerId);\n\t\tvar el = triggerElRef.current;\n\t\tif (el) triggerContext.triggerRef.current = el;\n\t};\n\tvar trigger = /* @__PURE__ */ jsx(View, {\n\t\t\"aria-expanded\": open,\n\t\t\"data-state\": getState(open),\n\t\t...rest,\n\t\tref: composedTriggerRef,\n\t\tonPress: composeEventHandlers(rest.onPress, function() {\n\t\t\tif (disablePressTrigger) return;\n\t\t\ttriggerContext.setActiveTrigger(open ? null : triggerId);\n\t\t\ttriggerContext.onOpenToggle();\n\t\t}),\n\t\tonMouseEnter: composeEventHandlers(rest.onMouseEnter, activateSelf),\n\t\tonPressIn: composeEventHandlers(rest.onPressIn, activateSelf),\n\t\tonFocus: composeEventHandlers(rest.onFocus, activateSelf)\n\t});\n\tvar virtualRef = React.useMemo(function() {\n\t\tif (!anchorTo) return null;\n\t\treturn { current: {\n\t\t\tgetBoundingClientRect: function() {\n\t\t\t\treturn isWeb ? DOMRect.fromRect(anchorTo) : anchorTo;\n\t\t\t},\n\t\t\t...!isWeb && {\n\t\t\t\tmeasure: function(c) {\n\t\t\t\t\treturn c(anchorTo === null || anchorTo === void 0 ? void 0 : anchorTo.x, anchorTo === null || anchorTo === void 0 ? void 0 : anchorTo.y, anchorTo === null || anchorTo === void 0 ? void 0 : anchorTo.width, anchorTo === null || anchorTo === void 0 ? void 0 : anchorTo.height);\n\t\t\t\t},\n\t\t\t\tmeasureInWindow: function(c) {\n\t\t\t\t\treturn c(anchorTo === null || anchorTo === void 0 ? void 0 : anchorTo.x, anchorTo === null || anchorTo === void 0 ? void 0 : anchorTo.y, anchorTo === null || anchorTo === void 0 ? void 0 : anchorTo.width, anchorTo === null || anchorTo === void 0 ? void 0 : anchorTo.height);\n\t\t\t\t}\n\t\t\t}\n\t\t} };\n\t}, [\n\t\ttriggerContext.anchorTo,\n\t\tanchorTo === null || anchorTo === void 0 ? void 0 : anchorTo.x,\n\t\tanchorTo === null || anchorTo === void 0 ? void 0 : anchorTo.y,\n\t\tanchorTo === null || anchorTo === void 0 ? void 0 : anchorTo.height,\n\t\tanchorTo === null || anchorTo === void 0 ? void 0 : anchorTo.width\n\t]);\n\tvar wrappedTrigger = isWeb ? /* @__PURE__ */ jsx(DismissableBranch, {\n\t\tbranches: triggerContext.branches,\n\t\tchildren: trigger\n\t}) : trigger;\n\treturn triggerContext.hasCustomAnchor ? wrappedTrigger : /* @__PURE__ */ jsx(PopperAnchor, {\n\t\t...virtualRef && { virtualRef },\n\t\tscope,\n\t\tasChild: true,\n\t\tchildren: wrappedTrigger\n\t});\n}));\nvar PopoverContent = PopperContentFrame.styleable(function PopoverContent2(props, forwardedRef) {\n\tvar { trapFocus, enableRemoveScroll = false, zIndex: zIndexProp, scope, ...contentImplProps } = props;\n\tvar context = usePopoverContext(scope);\n\tvar zIndexFromContext = React.useContext(PopoverZIndexContext);\n\tvar zIndex = zIndexProp !== null && zIndexProp !== void 0 ? zIndexProp : zIndexFromContext;\n\tvar open = usePopoverOpen(scope);\n\tvar composedRefs = useComposedRefs(forwardedRef, React.useRef(null));\n\tvar isRightClickOutsideRef = React.useRef(false);\n\tvar [isFullyHidden, setIsFullyHidden] = React.useState(!open);\n\tuseIsomorphicLayoutEffect(function() {\n\t\tif (open && isFullyHidden) setIsFullyHidden(false);\n\t}, [open, isFullyHidden]);\n\tvar isAdaptFullyHidden = React.useContext(PopoverAdaptHiddenContext);\n\tif (!context.keepChildrenMounted) {\n\t\tif (context.breakpointActive) {\n\t\t\tif (!open && isAdaptFullyHidden) return null;\n\t\t} else if (isFullyHidden && !open) return null;\n\t}\n\tvar _contentImplProps_pointerEvents;\n\treturn /* @__PURE__ */ jsx(PopoverPortal, {\n\t\tpassThrough: context.breakpointActive,\n\t\tcontext,\n\t\topen,\n\t\tzIndex,\n\t\tchildren: /* @__PURE__ */ jsx(View, {\n\t\t\tpassThrough: context.breakpointActive,\n\t\t\tpointerEvents: open ? (_contentImplProps_pointerEvents = contentImplProps.pointerEvents) !== null && _contentImplProps_pointerEvents !== void 0 ? _contentImplProps_pointerEvents : \"auto\" : \"none\",\n\t\t\tchildren: /* @__PURE__ */ jsx(PopoverContentImpl, {\n\t\t\t\t...contentImplProps,\n\t\t\t\tcontext,\n\t\t\t\topen,\n\t\t\t\tenableRemoveScroll,\n\t\t\t\tref: composedRefs,\n\t\t\t\tsetIsFullyHidden,\n\t\t\t\tscope,\n\t\t\t\ttrapFocus: trapFocus !== null && trapFocus !== void 0 ? trapFocus : open,\n\t\t\t\tdisableOutsidePointerEvents: true,\n\t\t\t\tonCloseAutoFocus: props.onCloseAutoFocus === false ? void 0 : composeEventHandlers(props.onCloseAutoFocus, function(event) {\n\t\t\t\t\tvar _context_triggerRef_current;\n\t\t\t\t\tif (event.defaultPrevented) return;\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\tif (!isRightClickOutsideRef.current) (_context_triggerRef_current = context.triggerRef.current) === null || _context_triggerRef_current === void 0 || _context_triggerRef_current.focus();\n\t\t\t\t}),\n\t\t\t\tonPointerDownOutside: composeEventHandlers(props.onPointerDownOutside, function(event) {\n\t\t\t\t\tvar originalEvent = event.detail.originalEvent;\n\t\t\t\t\tvar ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;\n\t\t\t\t\tisRightClickOutsideRef.current = originalEvent.button === 2 || ctrlLeftClick;\n\t\t\t\t}, { checkDefaultPrevented: false }),\n\t\t\t\tonFocusOutside: composeEventHandlers(props.onFocusOutside, function(event) {\n\t\t\t\t\treturn event.preventDefault();\n\t\t\t\t}, { checkDefaultPrevented: false })\n\t\t\t})\n\t\t})\n\t});\n});\nvar useParentContexts = function(scope) {\n\tvar context = usePopoverContext(scope);\n\tvar triggerContext = usePopoverTriggerContext(scope);\n\treturn {\n\t\tpopperContext: usePopperContext(scope),\n\t\tadaptContext: useAdaptContext(context.adaptScope),\n\t\tcontext,\n\t\ttriggerContext\n\t};\n};\nfunction RepropagateParentContexts(param) {\n\tvar { adaptContext, children, context, triggerContext, popperContext } = param;\n\treturn /* @__PURE__ */ jsx(PopperProvider, {\n\t\tscope: context.popoverScope,\n\t\t...popperContext,\n\t\tchildren: /* @__PURE__ */ jsx(PopoverContext.Provider, {\n\t\t\tscope: context.popoverScope,\n\t\t\t...context,\n\t\t\tchildren: /* @__PURE__ */ jsx(PopoverTriggerContext.Provider, {\n\t\t\t\tscope: context.popoverScope,\n\t\t\t\t...triggerContext,\n\t\t\t\tchildren: /* @__PURE__ */ jsx(ProvideAdaptContext, {\n\t\t\t\t\t...adaptContext,\n\t\t\t\t\tchildren\n\t\t\t\t})\n\t\t\t})\n\t\t})\n\t});\n}\nvar PortalAdaptSafe = function(param) {\n\t\"use no memo\";\n\tvar { children, context } = param;\n\tif (needsRepropagation) {\n\t\tvar parentContexts = useParentContexts(context.popoverScope);\n\t\treturn /* @__PURE__ */ jsx(AdaptPortalContents, {\n\t\t\tscope: context.adaptScope,\n\t\t\tchildren: /* @__PURE__ */ jsx(RepropagateParentContexts, {\n\t\t\t\t...parentContexts,\n\t\t\t\tchildren\n\t\t\t})\n\t\t});\n\t}\n\treturn /* @__PURE__ */ jsx(AdaptPortalContents, {\n\t\tscope: context.adaptScope,\n\t\tchildren\n\t});\n};\nfunction PopoverPortal(param) {\n\t\"use no memo\";\n\tvar { context, open, zIndex, passThrough, children, onPress } = param;\n\tvar content = children;\n\tif (needsRepropagation) content = /* @__PURE__ */ jsx(RepropagateParentContexts, {\n\t\t...useParentContexts(context.popoverScope),\n\t\tchildren: content\n\t});\n\treturn /* @__PURE__ */ jsxs(Portal, {\n\t\tpassThrough,\n\t\tstackZIndex: true,\n\t\tzIndex,\n\t\tchildren: [!!open && !context.breakpointActive && !context.hoverable && /* @__PURE__ */ jsx(YStack, {\n\t\t\tfullscreen: true,\n\t\t\tonPress: composeEventHandlers(onPress, context.onOpenToggle)\n\t\t}), content]\n\t});\n}\nvar PopoverContentImpl = /* @__PURE__ */ React.forwardRef(function PopoverContentImpl2(props, forwardedRef) {\n\tvar { trapFocus, scope, onOpenAutoFocus, onCloseAutoFocus, disableOutsidePointerEvents, disableFocusScope, onEscapeKeyDown, onPointerDownOutside, onFocusOutside, onInteractOutside, children, enableRemoveScroll, freezeContentsWhenHidden, setIsFullyHidden, lazyMount, forceUnmount, context, open, alwaysDisable, ...contentProps } = props;\n\tvar { keepChildrenMounted, disableDismissable } = context;\n\tvar handleExitComplete = React.useCallback(function() {\n\t\tsetIsFullyHidden === null || setIsFullyHidden === void 0 || setIsFullyHidden(true);\n\t}, [setIsFullyHidden]);\n\tvar contents = /* @__PURE__ */ jsx(ResetPresence, {\n\t\tdisable: context.breakpointActive,\n\t\tchildren\n\t});\n\tReact.useCallback(function() {\n\t\tcontext.onOpenChange(false, \"press\");\n\t}, [context]);\n\tif (!context.breakpointActive) {}\n\treturn /* @__PURE__ */ jsx(Animate, {\n\t\ttype: \"presence\",\n\t\tpresent: Boolean(open),\n\t\tkeepChildrenMounted: Boolean(keepChildrenMounted),\n\t\tonExitComplete: handleExitComplete,\n\t\tlazyMount,\n\t\tpassThrough: context.breakpointActive,\n\t\tchildren: /* @__PURE__ */ jsx(PopperContent, {\n\t\t\tscope,\n\t\t\t\"data-state\": getState(open),\n\t\t\tid: context.contentId,\n\t\t\tref: forwardedRef,\n\t\t\tpassThrough: context.breakpointActive,\n\t\t\t...!contentProps.unstyled && {\n\t\t\t\tsize: \"$true\",\n\t\t\t\tbackgroundColor: \"$background\",\n\t\t\t\talignItems: \"center\"\n\t\t\t},\n\t\t\t...contentProps,\n\t\t\tchildren: /* @__PURE__ */ jsx(PortalAdaptSafe, {\n\t\t\t\tcontext,\n\t\t\t\tchildren: contents\n\t\t\t})\n\t\t}, context.contentId)\n\t});\n});\nvar PopoverClose = /* @__PURE__ */ React.forwardRef(function PopoverClose2(props, forwardedRef) {\n\tvar { scope, ...rest } = props;\n\tvar context = usePopoverContext(scope);\n\treturn /* @__PURE__ */ jsx(YStack, {\n\t\t...rest,\n\t\tref: forwardedRef,\n\t\tcomponentName: \"PopoverClose\",\n\t\tonPress: composeEventHandlers(props.onPress, function() {\n\t\t\tvar _context_onOpenChange;\n\t\t\treturn context === null || context === void 0 ? void 0 : (_context_onOpenChange = context.onOpenChange) === null || _context_onOpenChange === void 0 ? void 0 : _context_onOpenChange.call(context, false, \"press\");\n\t\t})\n\t});\n});\nvar PopoverArrow = PopperArrowFrame.styleable(function PopoverArrow2(props, forwardedRef) {\n\tvar { scope, ...rest } = props;\n\tif (useAdaptIsActive(usePopoverContext(scope).adaptScope)) return null;\n\treturn /* @__PURE__ */ jsx(PopperArrow, {\n\t\tscope,\n\t\tcomponentName: \"PopoverArrow\",\n\t\t...rest,\n\t\tref: forwardedRef\n\t});\n});\nvar PopoverScrollView = /* @__PURE__ */ React.forwardRef(function(param, ref) {\n\tvar { scope, ...props } = param;\n\tvar context = usePopoverContext(scope);\n\treturn /* @__PURE__ */ jsx(ScrollView, {\n\t\tref,\n\t\tpointerEvents: context.breakpointActive ? \"none\" : void 0,\n\t\tscrollEnabled: !context.breakpointActive,\n\t\tpassThrough: context.breakpointActive,\n\t\t...props\n\t});\n});\nvar DEFAULT_SCOPE = \"\";\nvar Popover = withStaticProperties(/* @__PURE__ */ React.forwardRef(function Popover2(param, ref) {\n\tvar { scope = DEFAULT_SCOPE, ...props } = param;\n\tvar id = React.useId();\n\tvar adaptScope = `PopoverAdapt${scope}`;\n\treturn /* @__PURE__ */ jsx(AdaptParent, {\n\t\tscope: adaptScope,\n\t\tportal: true,\n\t\tchildren: /* @__PURE__ */ jsx(PopoverInner, {\n\t\t\tadaptScope,\n\t\t\tref,\n\t\t\tid,\n\t\t\tscope,\n\t\t\t...props\n\t\t})\n\t});\n}), {\n\tAnchor: PopoverAnchor,\n\tArrow: PopoverArrow,\n\tTrigger: PopoverTrigger,\n\tContent: PopoverContent,\n\tClose: PopoverClose,\n\tAdapt,\n\tScrollView: PopoverScrollView,\n\tFocusScope: FocusScopeController\n});\nvar PopoverInner = /* @__PURE__ */ React.forwardRef(function PopoverInner2(props, forwardedRef) {\n\tvar { children, open: openProp, defaultOpen, onOpenChange, scope = DEFAULT_SCOPE, keepChildrenMounted: keepChildrenMountedProp, hoverable, disableFocus, disableDismissable, zIndex, id, adaptScope, ...restProps } = props;\n\tvar triggerRef = React.useRef(null);\n\tvar [hasCustomAnchor, setHasCustomAnchor] = React.useState(false);\n\tvar viaRef = React.useRef(void 0);\n\tvar [keepChildrenMounted] = useControllableState({\n\t\tprop: keepChildrenMountedProp,\n\t\tdefaultProp: false,\n\t\ttransition: keepChildrenMountedProp === \"lazy\"\n\t});\n\tvar [open, setOpen] = useControllableState({\n\t\tprop: openProp,\n\t\tdefaultProp: defaultOpen || false,\n\t\tonChange: function(val) {\n\t\t\tonOpenChange === null || onOpenChange === void 0 || onOpenChange(val, viaRef.current);\n\t\t}\n\t});\n\tReact.useEffect(function() {\n\t\tif (!open) return;\n\t\topenPopovers.add(setOpen);\n\t\treturn function() {\n\t\t\topenPopovers.delete(setOpen);\n\t\t};\n\t}, [open, setOpen]);\n\tvar handleOpenChange = useEvent(function(val, via) {\n\t\tviaRef.current = via;\n\t\tsetOpen(val);\n\t});\n\tvar isAdapted = useAdaptIsActive(adaptScope);\n\tvar floatingContext = useFloatingContext({\n\t\topen,\n\t\tsetOpen: handleOpenChange,\n\t\tdisable: isAdapted,\n\t\thoverable,\n\t\tdisableFocus\n\t});\n\tvar [anchorTo, setAnchorToRaw] = React.useState();\n\tvar setAnchorTo = useCreateShallowSetState(setAnchorToRaw);\n\tReact.useImperativeHandle(forwardedRef, function() {\n\t\treturn {\n\t\t\tanchorTo: setAnchorTo,\n\t\t\ttoggle: function() {\n\t\t\t\treturn setOpen(function(prev) {\n\t\t\t\t\treturn !prev;\n\t\t\t\t});\n\t\t\t},\n\t\t\topen: function() {\n\t\t\t\treturn setOpen(true);\n\t\t\t},\n\t\t\tclose: function() {\n\t\t\t\treturn setOpen(false);\n\t\t\t},\n\t\t\tsetOpen\n\t\t};\n\t});\n\tvar contentId = React.useId();\n\tvar onOpenToggle = useEvent(function() {\n\t\tif (open && isAdapted) return;\n\t\tsetOpen(!open);\n\t});\n\tvar onCustomAnchorAdd = React.useCallback(function() {\n\t\treturn setHasCustomAnchor(true);\n\t}, []);\n\tvar onCustomAnchorRemove = React.useCallback(function() {\n\t\treturn setHasCustomAnchor(false);\n\t}, []);\n\tvar contents = /* @__PURE__ */ jsx(Popper, {\n\t\topen,\n\t\tpassThrough: isAdapted,\n\t\tscope,\n\t\tstayInFrame: true,\n\t\t...restProps,\n\t\tchildren: /* @__PURE__ */ jsx(PopoverContextProvider, {\n\t\t\tscope,\n\t\t\topen,\n\t\t\tonOpenChange: handleOpenChange,\n\t\t\tonOpenToggle,\n\t\t\ttriggerRef,\n\t\t\tid,\n\t\t\tcontentId,\n\t\t\thasCustomAnchor,\n\t\t\tonCustomAnchorAdd,\n\t\t\tonCustomAnchorRemove,\n\t\t\tanchorTo,\n\t\t\tadaptScope,\n\t\t\tbreakpointActive: isAdapted,\n\t\t\tkeepChildrenMounted,\n\t\t\tdisableDismissable,\n\t\t\thoverable,\n\t\t\tchildren: /* @__PURE__ */ jsx(PopoverSheetController, {\n\t\t\t\tonOpenChange: setOpen,\n\t\t\t\topen,\n\t\t\t\tscope,\n\t\t\t\tchildren\n\t\t\t})\n\t\t})\n\t});\n\tvar result = /* @__PURE__ */ jsx(Fragment, { children: isWeb ? /* @__PURE__ */ jsx(FloatingOverrideContext.Provider, {\n\t\tvalue: floatingContext,\n\t\tchildren: contents\n\t}) : contents });\n\tif (zIndex !== void 0) return /* @__PURE__ */ jsx(PopoverZIndexContext.Provider, {\n\t\tvalue: zIndex,\n\t\tchildren: result\n\t});\n\treturn result;\n});\nfunction getState(open) {\n\treturn open ? \"open\" : \"closed\";\n}\nvar PopoverSheetController = function(param) {\n\tvar { open, scope, ...props } = param;\n\tvar context = usePopoverContext(scope);\n\tvar showSheet = useShowPopoverSheet(context, open);\n\tvar breakpointActive = context === null || context === void 0 ? void 0 : context.breakpointActive;\n\tvar getShowSheet = useGet(showSheet);\n\tvar [isAdaptFullyHidden, setIsAdaptFullyHidden] = React.useState(!open);\n\tif (open && isAdaptFullyHidden) setIsAdaptFullyHidden(false);\n\treturn /* @__PURE__ */ jsx(SheetController, {\n\t\tonOpenChange: function(val) {\n\t\t\tif (getShowSheet()) {\n\t\t\t\tvar _props_onOpenChange;\n\t\t\t\t(_props_onOpenChange = props.onOpenChange) === null || _props_onOpenChange === void 0 || _props_onOpenChange.call(props, val);\n\t\t\t}\n\t\t},\n\t\tonAnimationComplete: React.useCallback(function(param2) {\n\t\t\tvar { open: isOpen } = param2;\n\t\t\tif (!isOpen) setIsAdaptFullyHidden(true);\n\t\t}, []),\n\t\topen,\n\t\thidden: !breakpointActive,\n\t\tchildren: /* @__PURE__ */ jsx(PopoverAdaptHiddenContext.Provider, {\n\t\t\tvalue: isAdaptFullyHidden,\n\t\t\tchildren: props.children\n\t\t})\n\t});\n};\nvar useShowPopoverSheet = function(context, open) {\n\tvar isAdapted = useAdaptIsActive(context.adaptScope);\n\treturn open === false ? false : isAdapted;\n};\n\nexport { Popover, PopoverAnchor, PopoverArrow, PopoverClose, PopoverContent, PopoverContext, PopoverContextProvider, PopoverTrigger, PopoverTriggerContext, PopoverZIndexContext, closeLastOpenedPopover, closeOpenPopovers, hasOpenPopovers, usePopoverContext, usePopoverOpen, usePopoverTriggerContext, usePopoverTriggerSetup };"],"mappings":"AAAA,SAASA,QAAQ,EAAEC,GAAG,EAAEC,IAAI,QAAQ,mBAAmB;AAEvD,SAASC,KAAK,EAAEC,WAAW,EAAEC,mBAAmB,EAAEC,mBAAmB,EAAEC,eAAe,EAAEC,gBAAgB,QAAQ,gBAAgB;AAChI,SAASC,OAAO,QAAQ,kBAAkB;AAC1C,SAASC,aAAa,QAAQ,2BAA2B;AACzD,SAASC,eAAe,QAAQ,uBAAuB;AACvD,SAASC,KAAK,EAAEC,yBAAyB,QAAQ,oBAAoB;AACrE,SAASC,IAAI,EAAEC,mBAAmB,EAAEC,wBAAwB,EAAEC,QAAQ,EAAEC,MAAM,QAAQ,eAAe;AACrG,SAASC,iBAAiB,QAAQ,sBAAsB;AACxD,SAASC,uBAAuB,QAAQ,mBAAmB;AAC3D,SAASC,oBAAoB,QAAQ,sBAAsB;AAC3D,SAASC,oBAAoB,EAAEC,oBAAoB,QAAQ,kBAAkB;AAC7E,SAASC,MAAM,EAAEC,YAAY,EAAEC,WAAW,EAAEC,gBAAgB,EAAEC,aAAa,EAAEC,kBAAkB,EAAEC,cAAc,EAAEC,gBAAgB,QAAQ,iBAAiB;AAC1J,SAASC,MAAM,EAAEC,wBAAwB,QAAQ,iBAAiB;AAClE,SAASC,UAAU,QAAQ,sBAAsB;AACjD,SAASC,eAAe,QAAQ,2BAA2B;AAC3D,SAASC,MAAM,QAAQ,iBAAiB;AACxC,SAASC,oBAAoB,QAAQ,iCAAiC;AACtE,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,SAASC,kBAAkB,QAAQ,gCAAsB;AAEzD,IAAIC,kBAAkB,GAAGP,wBAAwB,CAAC,CAAC;AACnD,IAAIQ,YAAY,GAAG,eAAgB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oreList":[]}
|
|
1
|
+
{"version":3,"file":"Popover.native.js","names":[],"sources":["esm/Popover.native.js"],"sourcesContent":["import { Fragment, jsx, jsxs } from \"react/jsx-runtime\";\n\nimport { Adapt, AdaptParent, AdaptPortalContents, ProvideAdaptContext, useAdaptContext, useAdaptIsActive } from \"@tamagui/adapt\";\nimport { Animate } from \"@tamagui/animate\";\nimport { ResetPresence } from \"@tamagui/animate-presence\";\nimport { useComposedRefs } from \"@tamagui/compose-refs\";\nimport { isWeb, useIsomorphicLayoutEffect } from \"@tamagui/constants\";\nimport { View, createRefComponent, createStyledContext, createStyledHOC, useCreateShallowSetState, useEvent } from \"@tamagui/core\";\nimport { DismissableBranch } from \"@tamagui/dismissable\";\nimport { FloatingOverrideContext } from \"@tamagui/floating\";\nimport { FocusScopeController } from \"@tamagui/focus-scope\";\nimport { composeEventHandlers, withStaticProperties } from \"@tamagui/helpers\";\nimport { Popper, PopperAnchor, PopperArrow, PopperArrowFrame, PopperContent, PopperContentFrame, PopperProvider, usePopperContext } from \"@tamagui/popper\";\nimport { Portal, needsPortalRepropagation } from \"@tamagui/portal\";\nimport { ScrollView } from \"@tamagui/scroll-view\";\nimport { YStack } from \"@tamagui/stacks\";\nimport { useControllableState } from \"@tamagui/use-controllable-state\";\nimport * as React from \"react\";\nimport { useFloatingContext } from \"./useFloatingContext\";\n\nvar needsRepropagation = needsPortalRepropagation();\nvar openPopovers = /* @__PURE__ */ new Set();\nvar hasOpenPopovers = function() {\n\treturn openPopovers.size > 0;\n};\nvar closeOpenPopovers = function() {\n\tif (openPopovers.size === 0) return false;\n\topenPopovers.forEach(function(setOpen) {\n\t\treturn setOpen(false);\n\t});\n\treturn true;\n};\nvar closeLastOpenedPopover = function() {\n\tif (openPopovers.size === 0) return false;\n\tvar last = Array.from(openPopovers).pop();\n\tif (last) {\n\t\tlast(false);\n\t\treturn true;\n\t}\n\treturn false;\n};\nvar PopoverContext = createStyledContext({}, \"Popover__\");\nvar PopoverZIndexContext = /* @__PURE__ */ React.createContext(void 0);\nvar PopoverTriggerContext = createStyledContext({}, \"PopoverTrigger__\");\nvar usePopoverContext = PopoverContext.useStyledContext;\nvar usePopoverTriggerContext = PopoverTriggerContext.useStyledContext;\nfunction usePopoverOpen(scope) {\n\treturn usePopoverContext(scope).open;\n}\nfunction usePopoverTriggerSetup(open) {\n\tvar triggerStateSettersRef = React.useRef(/* @__PURE__ */ new Map());\n\tvar activeTriggerIdRef = React.useRef(null);\n\tvar setActiveTrigger = useEvent(function(id) {\n\t\tvar prevId = activeTriggerIdRef.current;\n\t\tif (prevId === id) return;\n\t\tif (prevId) {\n\t\t\tvar _triggerStateSettersRef_current_get;\n\t\t\t(_triggerStateSettersRef_current_get = triggerStateSettersRef.current.get(prevId)) === null || _triggerStateSettersRef_current_get === void 0 || _triggerStateSettersRef_current_get(false);\n\t\t}\n\t\tactiveTriggerIdRef.current = id;\n\t\tif (id && open) {\n\t\t\tvar _triggerStateSettersRef_current_get1;\n\t\t\t(_triggerStateSettersRef_current_get1 = triggerStateSettersRef.current.get(id)) === null || _triggerStateSettersRef_current_get1 === void 0 || _triggerStateSettersRef_current_get1(true);\n\t\t}\n\t});\n\tvar registerTrigger = useEvent(function(id, setOpenState) {\n\t\ttriggerStateSettersRef.current.set(id, setOpenState);\n\t\tsetOpenState(activeTriggerIdRef.current === id && open);\n\t});\n\tvar unregisterTrigger = useEvent(function(id) {\n\t\ttriggerStateSettersRef.current.delete(id);\n\t\tif (activeTriggerIdRef.current === id) activeTriggerIdRef.current = null;\n\t});\n\tReact.useEffect(function() {\n\t\tif (!open) {\n\t\t\tsetActiveTrigger(null);\n\t\t\treturn;\n\t\t}\n\t\tvar activeId = activeTriggerIdRef.current;\n\t\tif (activeId) {\n\t\t\tvar _triggerStateSettersRef_current_get;\n\t\t\t(_triggerStateSettersRef_current_get = triggerStateSettersRef.current.get(activeId)) === null || _triggerStateSettersRef_current_get === void 0 || _triggerStateSettersRef_current_get(true);\n\t\t}\n\t}, [open, setActiveTrigger]);\n\treturn {\n\t\tsetActiveTrigger,\n\t\tregisterTrigger,\n\t\tunregisterTrigger\n\t};\n}\nvar PopoverContextProvider = /* @__PURE__ */ React.memo(function(param) {\n\tvar { scope, children, open, onOpenChange, onOpenToggle, triggerRef, id = \"\", contentId, hasCustomAnchor = false, onCustomAnchorAdd = voidFn, onCustomAnchorRemove = voidFn, anchorTo, adaptScope, breakpointActive, keepChildrenMounted, disableDismissable, hoverable } = param;\n\tvar [branches] = React.useState(function() {\n\t\treturn /* @__PURE__ */ new Set();\n\t});\n\tvar { setActiveTrigger, registerTrigger, unregisterTrigger } = usePopoverTriggerSetup(open);\n\treturn /* @__PURE__ */ jsx(PopoverContext.Provider, {\n\t\tscope,\n\t\tpopoverScope: scope,\n\t\tadaptScope,\n\t\tid,\n\t\tcontentId,\n\t\ttriggerRef,\n\t\topen,\n\t\tonOpenChange,\n\t\tonOpenToggle,\n\t\thasCustomAnchor,\n\t\tonCustomAnchorAdd,\n\t\tonCustomAnchorRemove,\n\t\tanchorTo,\n\t\tbranches,\n\t\tbreakpointActive,\n\t\tkeepChildrenMounted,\n\t\tdisableDismissable,\n\t\thoverable,\n\t\tchildren: /* @__PURE__ */ jsx(PopoverTriggerContext.Provider, {\n\t\t\tscope,\n\t\t\ttriggerRef,\n\t\t\thasCustomAnchor,\n\t\t\tanchorTo,\n\t\t\tbranches,\n\t\t\tonOpenToggle,\n\t\t\tsetActiveTrigger,\n\t\t\tregisterTrigger,\n\t\t\tunregisterTrigger,\n\t\t\tchildren\n\t\t})\n\t});\n});\nvar voidFn = function() {};\nvar PopoverAnchor = /* @__PURE__ */ React.memo(createRefComponent(function PopoverAnchor2(props, forwardedRef) {\n\tvar { scope, ...rest } = props;\n\tvar { onCustomAnchorAdd, onCustomAnchorRemove } = usePopoverContext(scope) || {};\n\tReact.useEffect(function() {\n\t\tonCustomAnchorAdd();\n\t\treturn function() {\n\t\t\treturn onCustomAnchorRemove();\n\t\t};\n\t}, [onCustomAnchorAdd, onCustomAnchorRemove]);\n\treturn /* @__PURE__ */ jsx(PopperAnchor, {\n\t\tscope,\n\t\t...rest,\n\t\tref: forwardedRef\n\t});\n}));\nvar PopoverTrigger = /* @__PURE__ */ React.memo(createRefComponent(function PopoverTrigger2(props, forwardedRef) {\n\tvar { scope, disablePressTrigger, ...rest } = props;\n\tvar triggerContext = usePopoverTriggerContext(scope);\n\tvar triggerId = React.useId();\n\tvar [open, setOpen] = React.useState(false);\n\tvar anchorTo = triggerContext.anchorTo;\n\tvar triggerElRef = React.useRef(null);\n\tvar composedTriggerRef = useComposedRefs(forwardedRef, triggerElRef);\n\tvar { registerTrigger, unregisterTrigger } = triggerContext;\n\tReact.useEffect(function() {\n\t\tregisterTrigger(triggerId, setOpen);\n\t\treturn function() {\n\t\t\tunregisterTrigger(triggerId);\n\t\t};\n\t}, [\n\t\tregisterTrigger,\n\t\tunregisterTrigger,\n\t\ttriggerId\n\t]);\n\tif (!rest.children) return null;\n\tvar activateSelf = function() {\n\t\ttriggerContext.setActiveTrigger(triggerId);\n\t\tvar el = triggerElRef.current;\n\t\tif (el) triggerContext.triggerRef.current = el;\n\t};\n\tvar trigger = /* @__PURE__ */ jsx(View, {\n\t\t\"aria-expanded\": open,\n\t\t\"data-state\": getState(open),\n\t\t...rest,\n\t\tref: composedTriggerRef,\n\t\tonPress: composeEventHandlers(rest.onPress, function() {\n\t\t\tif (disablePressTrigger) return;\n\t\t\ttriggerContext.setActiveTrigger(open ? null : triggerId);\n\t\t\ttriggerContext.onOpenToggle();\n\t\t}),\n\t\tonMouseEnter: composeEventHandlers(rest.onMouseEnter, activateSelf),\n\t\tonPressIn: composeEventHandlers(rest.onPressIn, activateSelf),\n\t\tonFocus: composeEventHandlers(rest.onFocus, activateSelf)\n\t});\n\tvar virtualRef = React.useMemo(function() {\n\t\tif (!anchorTo) return null;\n\t\treturn { current: {\n\t\t\tgetBoundingClientRect: function() {\n\t\t\t\treturn isWeb ? DOMRect.fromRect(anchorTo) : anchorTo;\n\t\t\t},\n\t\t\t...!isWeb && {\n\t\t\t\tmeasure: function(c) {\n\t\t\t\t\treturn c(anchorTo === null || anchorTo === void 0 ? void 0 : anchorTo.x, anchorTo === null || anchorTo === void 0 ? void 0 : anchorTo.y, anchorTo === null || anchorTo === void 0 ? void 0 : anchorTo.width, anchorTo === null || anchorTo === void 0 ? void 0 : anchorTo.height);\n\t\t\t\t},\n\t\t\t\tmeasureInWindow: function(c) {\n\t\t\t\t\treturn c(anchorTo === null || anchorTo === void 0 ? void 0 : anchorTo.x, anchorTo === null || anchorTo === void 0 ? void 0 : anchorTo.y, anchorTo === null || anchorTo === void 0 ? void 0 : anchorTo.width, anchorTo === null || anchorTo === void 0 ? void 0 : anchorTo.height);\n\t\t\t\t}\n\t\t\t}\n\t\t} };\n\t}, [\n\t\ttriggerContext.anchorTo,\n\t\tanchorTo === null || anchorTo === void 0 ? void 0 : anchorTo.x,\n\t\tanchorTo === null || anchorTo === void 0 ? void 0 : anchorTo.y,\n\t\tanchorTo === null || anchorTo === void 0 ? void 0 : anchorTo.height,\n\t\tanchorTo === null || anchorTo === void 0 ? void 0 : anchorTo.width\n\t]);\n\tvar wrappedTrigger = isWeb ? /* @__PURE__ */ jsx(DismissableBranch, {\n\t\tbranches: triggerContext.branches,\n\t\tchildren: trigger\n\t}) : trigger;\n\treturn triggerContext.hasCustomAnchor ? wrappedTrigger : /* @__PURE__ */ jsx(PopperAnchor, {\n\t\t...virtualRef && { virtualRef },\n\t\tscope,\n\t\tasChild: true,\n\t\tchildren: wrappedTrigger\n\t});\n}));\nvar PopoverContent = createStyledHOC(PopperContentFrame, function PopoverContent2(props, forwardedRef) {\n\tvar { trapFocus, enableRemoveScroll = false, zIndex: zIndexProp, scope, forceMount, ...contentImplProps } = props;\n\tvar context = usePopoverContext(scope);\n\tvar adaptContext = useAdaptContext(context.adaptScope);\n\tvar zIndexFromContext = React.useContext(PopoverZIndexContext);\n\tvar zIndex = zIndexProp !== null && zIndexProp !== void 0 ? zIndexProp : zIndexFromContext;\n\tvar open = usePopoverOpen(scope);\n\tvar composedRefs = useComposedRefs(forwardedRef, React.useRef(null));\n\tvar isRightClickOutsideRef = React.useRef(false);\n\tvar [isFullyHidden, setIsFullyHidden] = React.useState(!open);\n\tuseIsomorphicLayoutEffect(function() {\n\t\tif (open && isFullyHidden) setIsFullyHidden(false);\n\t}, [open, isFullyHidden]);\n\tif (!forceMount && !context.keepChildrenMounted) {\n\t\tif (context.breakpointActive) {\n\t\t\tif (!open && adaptContext.targetFullyHidden) return null;\n\t\t} else if (isFullyHidden && !open) return null;\n\t}\n\tvar _contentImplProps_pointerEvents;\n\treturn /* @__PURE__ */ jsx(PopoverPortal, {\n\t\tpassThrough: context.breakpointActive,\n\t\tcontext,\n\t\topen,\n\t\tvisuallyActive: open || !isFullyHidden,\n\t\tzIndex,\n\t\tchildren: /* @__PURE__ */ jsx(View, {\n\t\t\tpassThrough: context.breakpointActive,\n\t\t\tpointerEvents: open ? (_contentImplProps_pointerEvents = contentImplProps.pointerEvents) !== null && _contentImplProps_pointerEvents !== void 0 ? _contentImplProps_pointerEvents : \"auto\" : \"none\",\n\t\t\tchildren: /* @__PURE__ */ jsx(PopoverContentImpl, {\n\t\t\t\t...contentImplProps,\n\t\t\t\tcontext,\n\t\t\t\topen,\n\t\t\t\tforceMount,\n\t\t\t\tenableRemoveScroll,\n\t\t\t\tref: composedRefs,\n\t\t\t\tsetIsFullyHidden,\n\t\t\t\tscope,\n\t\t\t\ttrapFocus: trapFocus !== null && trapFocus !== void 0 ? trapFocus : open,\n\t\t\t\tdisableOutsidePointerEvents: true,\n\t\t\t\tonCloseAutoFocus: props.onCloseAutoFocus === false ? void 0 : composeEventHandlers(props.onCloseAutoFocus, function(event) {\n\t\t\t\t\tvar _context_triggerRef_current;\n\t\t\t\t\tif (event.isCanceled) return;\n\t\t\t\t\tevent.cancel();\n\t\t\t\t\tif (!isRightClickOutsideRef.current) (_context_triggerRef_current = context.triggerRef.current) === null || _context_triggerRef_current === void 0 || _context_triggerRef_current.focus();\n\t\t\t\t}),\n\t\t\t\tonPointerDownOutside: composeEventHandlers(props.onPointerDownOutside, function(event) {\n\t\t\t\t\tvar originalEvent = event.event;\n\t\t\t\t\tif (!originalEvent) return;\n\t\t\t\t\tvar ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;\n\t\t\t\t\tisRightClickOutsideRef.current = originalEvent.button === 2 || ctrlLeftClick;\n\t\t\t\t}, { checkDefaultPrevented: false }),\n\t\t\t\tonFocusOutside: composeEventHandlers(props.onFocusOutside, function(event) {\n\t\t\t\t\tif (trapFocus !== null && trapFocus !== void 0 ? trapFocus : open) event.cancel();\n\t\t\t\t}, { checkDefaultPrevented: false })\n\t\t\t})\n\t\t})\n\t});\n});\nvar useParentContexts = function(scope) {\n\tvar context = usePopoverContext(scope);\n\tvar triggerContext = usePopoverTriggerContext(scope);\n\treturn {\n\t\tpopperContext: usePopperContext(scope),\n\t\tadaptContext: useAdaptContext(context.adaptScope),\n\t\tcontext,\n\t\ttriggerContext\n\t};\n};\nfunction RepropagateParentContexts(param) {\n\tvar { adaptContext, children, context, triggerContext, popperContext } = param;\n\treturn /* @__PURE__ */ jsx(PopperProvider, {\n\t\tscope: context.popoverScope,\n\t\t...popperContext,\n\t\tchildren: /* @__PURE__ */ jsx(PopoverContext.Provider, {\n\t\t\tscope: context.popoverScope,\n\t\t\t...context,\n\t\t\tchildren: /* @__PURE__ */ jsx(PopoverTriggerContext.Provider, {\n\t\t\t\tscope: context.popoverScope,\n\t\t\t\t...triggerContext,\n\t\t\t\tchildren: /* @__PURE__ */ jsx(ProvideAdaptContext, {\n\t\t\t\t\t...adaptContext,\n\t\t\t\t\tchildren\n\t\t\t\t})\n\t\t\t})\n\t\t})\n\t});\n}\nvar PortalAdaptSafe = function(param) {\n\t\"use no memo\";\n\tvar { children, context } = param;\n\tif (needsRepropagation) {\n\t\tvar parentContexts = useParentContexts(context.popoverScope);\n\t\treturn /* @__PURE__ */ jsx(AdaptPortalContents, {\n\t\t\tscope: context.adaptScope,\n\t\t\tchildren: /* @__PURE__ */ jsx(RepropagateParentContexts, {\n\t\t\t\t...parentContexts,\n\t\t\t\tchildren\n\t\t\t})\n\t\t});\n\t}\n\treturn /* @__PURE__ */ jsx(AdaptPortalContents, {\n\t\tscope: context.adaptScope,\n\t\tchildren\n\t});\n};\nfunction PopoverPortal(param) {\n\t\"use no memo\";\n\tvar { context, open, visuallyActive, zIndex, passThrough, children, onPress } = param;\n\tvar content = children;\n\tif (needsRepropagation) content = /* @__PURE__ */ jsx(RepropagateParentContexts, {\n\t\t...useParentContexts(context.popoverScope),\n\t\tchildren: content\n\t});\n\treturn /* @__PURE__ */ jsxs(Portal, {\n\t\tpassThrough,\n\t\tstackZIndex: true,\n\t\tzIndex,\n\t\thidden: !visuallyActive,\n\t\tchildren: [!!open && !context.breakpointActive && !context.hoverable && /* @__PURE__ */ jsx(YStack, {\n\t\t\tposition: \"absolute\",\n\t\t\tinset: 0,\n\t\t\tonPress: composeEventHandlers(onPress, context.onOpenToggle)\n\t\t}), content]\n\t});\n}\nvar PopoverContentImpl = createRefComponent(function PopoverContentImpl2(props, forwardedRef) {\n\tvar { trapFocus, scope, onOpenAutoFocus, onCloseAutoFocus, disableOutsidePointerEvents, disableFocusScope, onEscapeKeyDown, onPointerDownOutside, onFocusOutside, onInteractOutside, children, enableRemoveScroll, freezeContentsWhenHidden, setIsFullyHidden, lazyMount, forceUnmount, forceMount, context, open, alwaysDisable, ...contentProps } = props;\n\tvar { disableDismissable } = context;\n\tvar keepChildrenMounted = context.keepChildrenMounted || forceMount;\n\tvar handleExitComplete = React.useCallback(function() {\n\t\tsetIsFullyHidden === null || setIsFullyHidden === void 0 || setIsFullyHidden(true);\n\t}, [setIsFullyHidden]);\n\tvar contents = /* @__PURE__ */ jsx(ResetPresence, {\n\t\tdisable: context.breakpointActive,\n\t\tchildren\n\t});\n\tReact.useCallback(function() {\n\t\tcontext.onOpenChange(false, \"press\");\n\t}, [context]);\n\tif (!context.breakpointActive) {}\n\treturn /* @__PURE__ */ jsx(Animate, {\n\t\ttype: \"presence\",\n\t\tpresent: Boolean(open),\n\t\tkeepChildrenMounted: Boolean(keepChildrenMounted),\n\t\tonExitComplete: handleExitComplete,\n\t\tlazyMount,\n\t\tpassThrough: context.breakpointActive,\n\t\tchildren: /* @__PURE__ */ jsx(PopperContent, {\n\t\t\tscope,\n\t\t\t\"data-state\": getState(open),\n\t\t\tid: context.contentId,\n\t\t\tref: forwardedRef,\n\t\t\tpassThrough: context.breakpointActive,\n\t\t\t...contentProps,\n\t\t\tchildren: /* @__PURE__ */ jsx(PortalAdaptSafe, {\n\t\t\t\tcontext,\n\t\t\t\tchildren: contents\n\t\t\t})\n\t\t}, context.contentId)\n\t});\n});\nvar PopoverClose = createRefComponent(function PopoverClose2(props, forwardedRef) {\n\tvar { scope, className, ...rest } = props;\n\tvar context = usePopoverContext(scope);\n\treturn /* @__PURE__ */ jsx(YStack, {\n\t\t...rest,\n\t\tref: forwardedRef,\n\t\tclassName: `is_PopoverClose ${className || \"\"}`.trim(),\n\t\tonPress: composeEventHandlers(props.onPress, function() {\n\t\t\tvar _context_onOpenChange;\n\t\t\treturn context === null || context === void 0 ? void 0 : (_context_onOpenChange = context.onOpenChange) === null || _context_onOpenChange === void 0 ? void 0 : _context_onOpenChange.call(context, false, \"press\");\n\t\t})\n\t});\n});\nvar PopoverArrow = createStyledHOC(PopperArrowFrame, function PopoverArrow2(props, forwardedRef) {\n\tvar { scope, className, ...rest } = props;\n\tif (useAdaptIsActive(usePopoverContext(scope).adaptScope)) return null;\n\treturn /* @__PURE__ */ jsx(PopperArrow, {\n\t\tscope,\n\t\tclassName: `is_PopoverArrow ${className || \"\"}`.trim(),\n\t\t...rest,\n\t\tref: forwardedRef\n\t});\n});\nvar PopoverScrollView = createRefComponent(function(param, ref) {\n\tvar { scope, ...props } = param;\n\tvar context = usePopoverContext(scope);\n\treturn /* @__PURE__ */ jsx(ScrollView, {\n\t\tref,\n\t\tpointerEvents: context.breakpointActive ? \"none\" : void 0,\n\t\tscrollEnabled: !context.breakpointActive,\n\t\tpassThrough: context.breakpointActive,\n\t\t...props\n\t});\n});\nvar DEFAULT_SCOPE = \"\";\nvar Popover = withStaticProperties(createRefComponent(function Popover2(param, ref) {\n\tvar { scope = DEFAULT_SCOPE, ...props } = param;\n\tvar id = React.useId();\n\tvar adaptScope = `PopoverAdapt${scope}`;\n\tvar { open: openProp, defaultOpen, onOpenChange } = props;\n\tvar viaRef = React.useRef(void 0);\n\tvar [open, setOpen] = useControllableState({\n\t\tprop: openProp,\n\t\tdefaultProp: defaultOpen || false,\n\t\tonChange: function(val) {\n\t\t\tonOpenChange === null || onOpenChange === void 0 || onOpenChange(val, viaRef.current);\n\t\t}\n\t});\n\tvar handleOpenChange = useEvent(function(val, via) {\n\t\tviaRef.current = via;\n\t\tsetOpen(val);\n\t});\n\tReact.useEffect(function() {\n\t\tif (!open) return;\n\t\topenPopovers.add(setOpen);\n\t\treturn function() {\n\t\t\topenPopovers.delete(setOpen);\n\t\t};\n\t}, [open, setOpen]);\n\treturn /* @__PURE__ */ jsx(AdaptParent, {\n\t\tscope: adaptScope,\n\t\topen,\n\t\tonOpenChange: setOpen,\n\t\tchildren: /* @__PURE__ */ jsx(PopoverInner, {\n\t\t\tadaptScope,\n\t\t\tref,\n\t\t\tid,\n\t\t\tscope,\n\t\t\topen,\n\t\t\tsetOpen,\n\t\t\thandleOpenChange,\n\t\t\t...props\n\t\t})\n\t});\n}), {\n\tAnchor: PopoverAnchor,\n\tArrow: PopoverArrow,\n\tTrigger: PopoverTrigger,\n\tContent: PopoverContent,\n\tClose: PopoverClose,\n\tAdapt,\n\tScrollView: PopoverScrollView,\n\tFocusScope: FocusScopeController\n});\nvar PopoverInner = createRefComponent(function PopoverInner2(props, forwardedRef) {\n\tvar { children, open: _openProp, defaultOpen: _defaultOpen, onOpenChange: _onOpenChange, scope = DEFAULT_SCOPE, keepChildrenMounted: keepChildrenMountedProp, hoverable, disableFocus, disableDismissable, zIndex, id, adaptScope, open, setOpen, handleOpenChange, ...restProps } = props;\n\tvar triggerRef = React.useRef(null);\n\tvar [hasCustomAnchor, setHasCustomAnchor] = React.useState(false);\n\tvar [keepChildrenMounted] = useControllableState({\n\t\tprop: keepChildrenMountedProp,\n\t\tdefaultProp: false,\n\t\ttransition: keepChildrenMountedProp === \"lazy\"\n\t});\n\tvar isAdapted = useAdaptIsActive(adaptScope);\n\tvar floatingContext = useFloatingContext({\n\t\topen,\n\t\tsetOpen: handleOpenChange,\n\t\tdisable: isAdapted,\n\t\thoverable,\n\t\tdisableFocus\n\t});\n\tvar [anchorTo, setAnchorToRaw] = React.useState();\n\tvar setAnchorTo = useCreateShallowSetState(setAnchorToRaw);\n\tReact.useImperativeHandle(forwardedRef, function() {\n\t\treturn {\n\t\t\tanchorTo: setAnchorTo,\n\t\t\ttoggle: function() {\n\t\t\t\treturn setOpen(function(prev) {\n\t\t\t\t\treturn !prev;\n\t\t\t\t});\n\t\t\t},\n\t\t\topen: function() {\n\t\t\t\treturn setOpen(true);\n\t\t\t},\n\t\t\tclose: function() {\n\t\t\t\treturn setOpen(false);\n\t\t\t},\n\t\t\tsetOpen\n\t\t};\n\t});\n\tvar contentId = React.useId();\n\tvar onOpenToggle = useEvent(function() {\n\t\tif (open && isAdapted) return;\n\t\tsetOpen(!open);\n\t});\n\tvar onCustomAnchorAdd = React.useCallback(function() {\n\t\treturn setHasCustomAnchor(true);\n\t}, []);\n\tvar onCustomAnchorRemove = React.useCallback(function() {\n\t\treturn setHasCustomAnchor(false);\n\t}, []);\n\tvar contents = /* @__PURE__ */ jsx(Popper, {\n\t\topen,\n\t\tpassThrough: isAdapted,\n\t\tscope,\n\t\tstayInFrame: true,\n\t\t...restProps,\n\t\tchildren: /* @__PURE__ */ jsx(PopoverContextProvider, {\n\t\t\tscope,\n\t\t\topen,\n\t\t\tonOpenChange: handleOpenChange,\n\t\t\tonOpenToggle,\n\t\t\ttriggerRef,\n\t\t\tid,\n\t\t\tcontentId,\n\t\t\thasCustomAnchor,\n\t\t\tonCustomAnchorAdd,\n\t\t\tonCustomAnchorRemove,\n\t\t\tanchorTo,\n\t\t\tadaptScope,\n\t\t\tbreakpointActive: isAdapted,\n\t\t\tkeepChildrenMounted,\n\t\t\tdisableDismissable,\n\t\t\thoverable,\n\t\t\tchildren\n\t\t})\n\t});\n\tvar result = /* @__PURE__ */ jsx(Fragment, { children: isWeb ? /* @__PURE__ */ jsx(FloatingOverrideContext.Provider, {\n\t\tvalue: floatingContext,\n\t\tchildren: contents\n\t}) : contents });\n\tif (zIndex !== void 0) return /* @__PURE__ */ jsx(PopoverZIndexContext.Provider, {\n\t\tvalue: zIndex,\n\t\tchildren: result\n\t});\n\treturn result;\n});\nfunction getState(open) {\n\treturn open ? \"open\" : \"closed\";\n}\n\nexport { Popover, PopoverAnchor, PopoverArrow, PopoverClose, PopoverContent, PopoverContext, PopoverContextProvider, PopoverTrigger, PopoverTriggerContext, PopoverZIndexContext, closeLastOpenedPopover, closeOpenPopovers, hasOpenPopovers, usePopoverContext, usePopoverOpen, usePopoverTriggerContext, usePopoverTriggerSetup };"],"mappings":";;;;;;;;;;;;;;;;;;;;AAoBA,IAAI,qBAAqB,yBAAyB;AAClD,IAAI,+BAA+B,IAAI,IAAI;AAC3C,IAAI,kBAAkB,WAAW;CAChC,OAAO,aAAa,OAAO;AAC5B;AACA,IAAI,oBAAoB,WAAW;CAClC,IAAI,aAAa,SAAS,GAAG,OAAO;CACpC,aAAa,QAAQ,SAAS,SAAS;EACtC,OAAO,QAAQ,KAAK;CACrB,CAAC;CACD,OAAO;AACR;AACA,IAAI,yBAAyB,WAAW;CACvC,IAAI,aAAa,SAAS,GAAG,OAAO;CACpC,IAAI,OAAO,MAAM,KAAK,YAAY,EAAE,IAAI;CACxC,IAAI,MAAM;EACT,KAAK,KAAK;EACV,OAAO;CACR;CACA,OAAO;AACR;AACA,IAAI,iBAAiB,oBAAoB,CAAC,GAAG,WAAW;AACx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"
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
export * from "./Popover.mjs"
|
|
2
|
+
|
|
3
|
+
export * from "./useFloatingContext.mjs"
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from "./Popover.mjs"
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
export * from "./Popover.mjs"
|
|
2
|
+
|
|
3
|
+
export * from "./useFloatingContext.mjs"
|
package/dist/esm/index.native.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from "./Popover.native.js"
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
export * from "./Popover.native.js"
|
|
2
|
+
|
|
3
|
+
export * from "./useFloatingContext.native.js"
|
|
@@ -1,213 +1,191 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { createFloatingEvents, safePolygon, useDelayGroup, useFloatingRaw, useFocus, useHover, useInteractions, useRole
|
|
3
|
-
const useFloatingContext = ({
|
|
4
|
-
open,
|
|
5
|
-
setOpen,
|
|
6
|
-
disable,
|
|
7
|
-
disableFocus,
|
|
8
|
-
hoverable,
|
|
9
|
-
role: roleProp = "dialog",
|
|
10
|
-
focus: focusProp,
|
|
11
|
-
groupId,
|
|
12
|
-
delay: delayProp,
|
|
13
|
-
restMs: restMsProp
|
|
14
|
-
}) => {
|
|
15
|
-
"use no memo";
|
|
2
|
+
import { PopupTriggerMap, createFloatingEvents, safePolygon, useDelayGroup, useFloatingRaw, useFocus, useHover, useInteractions, useRole } from "@tamagui/floating";
|
|
16
3
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
graceRef.current = setTimeout(() => {
|
|
202
|
-
if (openRef.current && !isOverFloatingRef.current && !handleCloseActiveRef.current) {
|
|
203
|
-
setOpen(false, "hover");
|
|
204
|
-
}
|
|
205
|
-
}, Math.max(250, closeDelay));
|
|
206
|
-
}
|
|
207
|
-
}, 40);
|
|
208
|
-
} : void 0
|
|
209
|
-
};
|
|
210
|
-
}, [setOpen]);
|
|
4
|
+
const useFloatingContext = ({ open, setOpen, disable, disableFocus, hoverable, role: roleProp = "dialog", focus: focusProp, groupId, delay: delayProp, restMs: restMsProp }) => {
|
|
5
|
+
"use no memo";
|
|
6
|
+
const openRef = React.useRef(open);
|
|
7
|
+
openRef.current = open;
|
|
8
|
+
const hoverableRef = React.useRef(hoverable);
|
|
9
|
+
hoverableRef.current = hoverable;
|
|
10
|
+
const disableRef = React.useRef(disable);
|
|
11
|
+
disableRef.current = disable;
|
|
12
|
+
const disableFocusRef = React.useRef(disableFocus);
|
|
13
|
+
disableFocusRef.current = disableFocus;
|
|
14
|
+
const roleRef = React.useRef(roleProp);
|
|
15
|
+
roleRef.current = roleProp;
|
|
16
|
+
const focusRef = React.useRef(focusProp);
|
|
17
|
+
focusRef.current = focusProp;
|
|
18
|
+
const groupIdRef = React.useRef(groupId);
|
|
19
|
+
groupIdRef.current = groupId;
|
|
20
|
+
const delayRef = React.useRef(delayProp);
|
|
21
|
+
delayRef.current = delayProp;
|
|
22
|
+
const restMsRef = React.useRef(restMsProp);
|
|
23
|
+
restMsRef.current = restMsProp;
|
|
24
|
+
const events = React.useMemo(() => createFloatingEvents(), []);
|
|
25
|
+
const triggerElements = React.useMemo(() => new PopupTriggerMap(), []);
|
|
26
|
+
React.useEffect(() => {
|
|
27
|
+
events.emit("openchange", { open });
|
|
28
|
+
}, [open, events]);
|
|
29
|
+
return React.useCallback((props) => {
|
|
30
|
+
const onTriggerRef = React.useRef(false);
|
|
31
|
+
const restTimerRef = React.useRef(void 0);
|
|
32
|
+
const graceRef = React.useRef(void 0);
|
|
33
|
+
const pendingCloseRef = React.useRef(false);
|
|
34
|
+
const isOverFloatingRef = React.useRef(false);
|
|
35
|
+
const handleCloseActiveRef = React.useRef(false);
|
|
36
|
+
React.useEffect(() => {
|
|
37
|
+
return () => {
|
|
38
|
+
clearTimeout(restTimerRef.current);
|
|
39
|
+
clearTimeout(graceRef.current);
|
|
40
|
+
};
|
|
41
|
+
}, []);
|
|
42
|
+
const onOpenChange = (val, event) => {
|
|
43
|
+
if (val && event?.type === "mouseenter") {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
if (!val && onTriggerRef.current && (event?.type === "mousemove" || event?.type === "mouseleave")) {
|
|
47
|
+
pendingCloseRef.current = true;
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
const type = event?.type === "mousemove" || event?.type === "mouseenter" || event?.type === "mouseleave" ? "hover" : "press";
|
|
51
|
+
setOpen(val, type);
|
|
52
|
+
};
|
|
53
|
+
const floating = useFloatingRaw({
|
|
54
|
+
...props,
|
|
55
|
+
open: openRef.current
|
|
56
|
+
});
|
|
57
|
+
const currentHoverable = hoverableRef.current;
|
|
58
|
+
const dataRef = React.useRef({});
|
|
59
|
+
dataRef.current.placement = floating.placement;
|
|
60
|
+
const floatingRefs = floating.refs;
|
|
61
|
+
const nullRef = { current: null };
|
|
62
|
+
const interactionContext = {
|
|
63
|
+
open: openRef.current,
|
|
64
|
+
onOpenChange,
|
|
65
|
+
refs: {
|
|
66
|
+
reference: floatingRefs?.reference || nullRef,
|
|
67
|
+
floating: floatingRefs?.floating || nullRef,
|
|
68
|
+
domReference: floatingRefs?.reference || nullRef
|
|
69
|
+
},
|
|
70
|
+
elements: {
|
|
71
|
+
get reference() {
|
|
72
|
+
return floatingRefs?.reference?.current || null;
|
|
73
|
+
},
|
|
74
|
+
get floating() {
|
|
75
|
+
return floatingRefs?.floating?.current || null;
|
|
76
|
+
},
|
|
77
|
+
get domReference() {
|
|
78
|
+
return floatingRefs?.reference?.current || null;
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
dataRef,
|
|
82
|
+
events,
|
|
83
|
+
triggerElements,
|
|
84
|
+
handleCloseActiveRef
|
|
85
|
+
};
|
|
86
|
+
const { delay: groupDelay, currentId: groupCurrentId } = useDelayGroup(interactionContext, { id: groupIdRef.current });
|
|
87
|
+
const isInActiveGroup = groupIdRef.current && groupCurrentId != null && typeof groupDelay === "object";
|
|
88
|
+
let delay;
|
|
89
|
+
let restMs;
|
|
90
|
+
if (isInActiveGroup) {
|
|
91
|
+
delay = groupDelay;
|
|
92
|
+
restMs = 0;
|
|
93
|
+
} else if (delayRef.current !== void 0) {
|
|
94
|
+
delay = delayRef.current;
|
|
95
|
+
restMs = restMsRef.current ?? 0;
|
|
96
|
+
} else {
|
|
97
|
+
delay = currentHoverable && typeof currentHoverable === "object" ? currentHoverable.delay ?? 0 : 0;
|
|
98
|
+
restMs = currentHoverable && typeof currentHoverable === "object" ? currentHoverable.restMs ?? 0 : 0;
|
|
99
|
+
}
|
|
100
|
+
const currentRole = roleRef.current;
|
|
101
|
+
const currentFocus = focusRef.current;
|
|
102
|
+
const { getReferenceProps, getFloatingProps: getFloatingPropsInner } = useInteractions([
|
|
103
|
+
currentHoverable ? useHover(interactionContext, {
|
|
104
|
+
enabled: !disableRef.current && !!currentHoverable,
|
|
105
|
+
delay,
|
|
106
|
+
restMs,
|
|
107
|
+
handleClose: safePolygon({
|
|
108
|
+
requireIntent: true,
|
|
109
|
+
buffer: 1,
|
|
110
|
+
__debug: typeof window !== "undefined" && new URLSearchParams(window.location.search).get("debug") === "safePolygon"
|
|
111
|
+
}),
|
|
112
|
+
...typeof currentHoverable === "object" && currentHoverable
|
|
113
|
+
}) : useHover(interactionContext, { enabled: false }),
|
|
114
|
+
useFocus(interactionContext, {
|
|
115
|
+
enabled: !disableRef.current && !disableFocusRef.current,
|
|
116
|
+
visibleOnly: true,
|
|
117
|
+
...currentFocus
|
|
118
|
+
}),
|
|
119
|
+
useRole(interactionContext, { role: currentRole })
|
|
120
|
+
]);
|
|
121
|
+
const getFloatingProps = currentHoverable ? (userProps) => {
|
|
122
|
+
const merged = getFloatingPropsInner(userProps);
|
|
123
|
+
const origEnter = merged.onMouseEnter;
|
|
124
|
+
const origLeave = merged.onMouseLeave;
|
|
125
|
+
return {
|
|
126
|
+
...merged,
|
|
127
|
+
onMouseEnter: (e) => {
|
|
128
|
+
isOverFloatingRef.current = true;
|
|
129
|
+
origEnter?.(e);
|
|
130
|
+
},
|
|
131
|
+
onMouseLeave: (e) => {
|
|
132
|
+
isOverFloatingRef.current = false;
|
|
133
|
+
origLeave?.(e);
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
} : getFloatingPropsInner;
|
|
137
|
+
const openDelay = typeof delay === "number" ? delay : delay?.open ?? 0;
|
|
138
|
+
const closeDelay = typeof delay === "number" ? delay : delay?.close ?? 0;
|
|
139
|
+
const setOpenWithDelay = () => {
|
|
140
|
+
clearTimeout(restTimerRef.current);
|
|
141
|
+
if (restMs && !openDelay) {
|
|
142
|
+
restTimerRef.current = setTimeout(() => {
|
|
143
|
+
setOpen(true, "hover");
|
|
144
|
+
}, restMs);
|
|
145
|
+
} else if (openDelay) {
|
|
146
|
+
restTimerRef.current = setTimeout(() => {
|
|
147
|
+
setOpen(true, "hover");
|
|
148
|
+
}, openDelay);
|
|
149
|
+
} else {
|
|
150
|
+
setOpen(true, "hover");
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
return {
|
|
154
|
+
...floating,
|
|
155
|
+
open: openRef.current,
|
|
156
|
+
triggerElements,
|
|
157
|
+
getReferenceProps,
|
|
158
|
+
getFloatingProps,
|
|
159
|
+
onHoverReference: currentHoverable ? (_event) => {
|
|
160
|
+
clearTimeout(graceRef.current);
|
|
161
|
+
onTriggerRef.current = true;
|
|
162
|
+
pendingCloseRef.current = false;
|
|
163
|
+
clearTimeout(restTimerRef.current);
|
|
164
|
+
if (openRef.current) return;
|
|
165
|
+
setOpenWithDelay();
|
|
166
|
+
} : void 0,
|
|
167
|
+
onLeaveReference: currentHoverable ? () => {
|
|
168
|
+
clearTimeout(restTimerRef.current);
|
|
169
|
+
clearTimeout(graceRef.current);
|
|
170
|
+
graceRef.current = setTimeout(() => {
|
|
171
|
+
onTriggerRef.current = false;
|
|
172
|
+
if (pendingCloseRef.current) {
|
|
173
|
+
pendingCloseRef.current = false;
|
|
174
|
+
setOpen(false, "hover");
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
if (openRef.current) {
|
|
178
|
+
graceRef.current = setTimeout(() => {
|
|
179
|
+
if (openRef.current && !isOverFloatingRef.current && !handleCloseActiveRef.current) {
|
|
180
|
+
setOpen(false, "hover");
|
|
181
|
+
}
|
|
182
|
+
}, Math.max(250, closeDelay));
|
|
183
|
+
}
|
|
184
|
+
}, 40);
|
|
185
|
+
} : void 0
|
|
186
|
+
};
|
|
187
|
+
}, [setOpen]);
|
|
211
188
|
};
|
|
189
|
+
|
|
212
190
|
export { useFloatingContext };
|
|
213
191
|
//# sourceMappingURL=useFloatingContext.mjs.map
|