@tamagui/create-menu 3.0.0-beta.669.1 → 3.0.0-beta.728.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/createBaseMenu.cjs +0 -1
- package/dist/cjs/createBaseMenu.native.cjs +3 -2
- package/dist/cjs/createBaseMenu.native.js +3 -2
- package/dist/cjs/createBaseMenu.native.js.map +1 -1
- package/dist/cjs/createNativeMenu/createNativeMenu.cjs +0 -1
- package/dist/cjs/createNativeMenu/createNativeMenu.native.cjs +0 -1
- package/dist/cjs/createNativeMenu/createNativeMenu.native.js +0 -1
- package/dist/cjs/createNativeMenu/createNativeMenu.native.js.map +1 -1
- package/dist/cjs/createNativeMenu/createNativeMenuTypes.cjs +0 -1
- package/dist/cjs/createNativeMenu/createNativeMenuTypes.native.cjs +0 -1
- package/dist/cjs/createNativeMenu/createNativeMenuTypes.native.js +0 -1
- package/dist/cjs/createNativeMenu/createNativeMenuTypes.native.js.map +1 -1
- package/dist/cjs/createNativeMenu/utils.cjs +0 -1
- package/dist/cjs/createNativeMenu/utils.native.cjs +0 -1
- package/dist/cjs/createNativeMenu/utils.native.js +0 -1
- package/dist/cjs/createNativeMenu/utils.native.js.map +1 -1
- package/dist/cjs/createNativeMenu/withNativeMenu.cjs +0 -1
- package/dist/cjs/createNativeMenu/withNativeMenu.native.cjs +0 -1
- package/dist/cjs/createNativeMenu/withNativeMenu.native.js +0 -1
- package/dist/cjs/createNativeMenu/withNativeMenu.native.js.map +1 -1
- package/dist/cjs/index.cjs +0 -1
- package/dist/cjs/index.native.cjs +0 -1
- package/dist/cjs/index.native.js +0 -1
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/esm/createBaseMenu.mjs.map +1 -1
- package/dist/esm/createBaseMenu.native.js +3 -1
- package/dist/esm/createBaseMenu.native.js.map +1 -1
- package/dist/esm/createNativeMenu/createNativeMenu.mjs.map +1 -1
- package/dist/esm/createNativeMenu/createNativeMenu.native.js.map +1 -1
- package/dist/esm/createNativeMenu/utils.mjs.map +1 -1
- package/dist/esm/createNativeMenu/utils.native.js.map +1 -1
- package/dist/jsx/createBaseMenu.mjs.map +1 -1
- package/dist/jsx/createBaseMenu.native.cjs +3 -2
- package/dist/jsx/createBaseMenu.native.js +3 -2
- package/dist/jsx/createBaseMenu.native.js.map +1 -1
- package/dist/jsx/createNativeMenu/createNativeMenu.mjs.map +1 -1
- package/dist/jsx/createNativeMenu/createNativeMenu.native.cjs +0 -1
- package/dist/jsx/createNativeMenu/createNativeMenu.native.js +0 -1
- package/dist/jsx/createNativeMenu/createNativeMenu.native.js.map +1 -1
- package/dist/jsx/createNativeMenu/createNativeMenuTypes.native.cjs +0 -1
- package/dist/jsx/createNativeMenu/createNativeMenuTypes.native.js +0 -1
- package/dist/jsx/createNativeMenu/createNativeMenuTypes.native.js.map +1 -1
- package/dist/jsx/createNativeMenu/utils.mjs.map +1 -1
- package/dist/jsx/createNativeMenu/utils.native.cjs +0 -1
- package/dist/jsx/createNativeMenu/utils.native.js +0 -1
- package/dist/jsx/createNativeMenu/utils.native.js.map +1 -1
- package/dist/jsx/createNativeMenu/withNativeMenu.native.cjs +0 -1
- package/dist/jsx/createNativeMenu/withNativeMenu.native.js +0 -1
- package/dist/jsx/createNativeMenu/withNativeMenu.native.js.map +1 -1
- package/dist/jsx/index.native.cjs +0 -1
- package/dist/jsx/index.native.js +0 -1
- package/dist/jsx/index.native.js.map +1 -1
- package/package.json +22 -22
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createNativeMenu.native.js","names":["_Fragment"],"sources":["esm/createNativeMenu/createNativeMenu.native.js"],"sourcesContent":["import { jsx as _jsx, Fragment as _Fragment } from \"react/jsx-runtime\";\nimport { getNativeMenuAdapter, NativeMenuContext, unstable_claimExternalPressOwnership, unstable_releaseExternalPressOwnership } from \"@tamagui/native\";\nimport { isWeb, withStaticProperties, isIos } from \"@tamagui/web\";\nimport React from \"react\";\nvar MAPPED_TYPES = [\n \"SubContent\",\n \"SubTrigger\",\n \"Content\",\n \"Sub\",\n \"Group\",\n \"Item\",\n \"ItemTitle\",\n \"ItemSubtitle\",\n \"ItemIcon\",\n \"ItemImage\",\n \"ItemIndicator\",\n \"Label\",\n \"Separator\",\n \"CheckboxItem\",\n \"Preview\",\n \"Auxiliary\"\n];\nvar CONTAINER_TYPES = [\n \"SubContent\",\n \"SubTrigger\",\n \"Content\",\n \"Sub\",\n \"Group\",\n \"Item\"\n];\nfunction getComponentType(displayName) {\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = MAPPED_TYPES[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var type = _step.value;\n if (displayName === type || displayName === `Menu${type}` || displayName === `ContextMenu${type}` || displayName.includes(`(${type})`)) {\n return type;\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n return null;\n}\nfunction isItemLike(props, displayName) {\n if (getComponentType(displayName)) return false;\n return \"onSelect\" in props || \"textValue\" in props;\n}\nfunction isPortalLike(displayName) {\n return displayName === \"Portal\" || displayName.includes(\"Portal\");\n}\nfunction isTriggerLike(displayName) {\n return displayName === \"Trigger\" || displayName.includes(\"(Trigger)\");\n}\nfunction composeHandlers(first, second) {\n return function() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n first === null || first === void 0 ? void 0 : first(...args);\n second === null || second === void 0 ? void 0 : second(...args);\n };\n}\nfunction getTriggerDebugName(menuType, props) {\n var childProps = /* @__PURE__ */ React.isValidElement(props.children) && props.children.props ? props.children.props : null;\n var prefix = menuType === \"ContextMenu\" ? \"ContextMenuTrigger\" : \"MenuTrigger\";\n var _childProps_testID, _ref;\n var detail = (_ref = (_childProps_testID = childProps === null || childProps === void 0 ? void 0 : childProps.testID) !== null && _childProps_testID !== void 0 ? _childProps_testID : childProps === null || childProps === void 0 ? void 0 : childProps.accessibilityLabel) !== null && _ref !== void 0 ? _ref : typeof props.textValue === \"string\" ? props.textValue : null;\n return [\n prefix,\n detail\n ].filter(Boolean).join(\":\") || prefix;\n}\nvar emptyStub = function() {\n return null;\n};\nfunction createWebStubs() {\n return {\n Menu: withStaticProperties(emptyStub, {\n Trigger: emptyStub,\n Content: emptyStub,\n Item: emptyStub,\n ItemTitle: emptyStub,\n ItemSubtitle: emptyStub,\n SubTrigger: emptyStub,\n Group: emptyStub,\n ItemIcon: emptyStub,\n Separator: emptyStub,\n CheckboxItem: emptyStub,\n ItemIndicator: emptyStub,\n ItemImage: emptyStub,\n Label: emptyStub,\n Arrow: emptyStub,\n Sub: emptyStub,\n SubContent: emptyStub,\n Preview: emptyStub,\n Portal: emptyStub,\n RadioGroup: emptyStub,\n RadioItem: emptyStub,\n Auxiliary: emptyStub\n })\n };\n}\nvar createNativeMenu = function(MenuType) {\n if (isWeb) {\n return createWebStubs();\n }\n var isContextMenu = MenuType === \"ContextMenu\";\n var isAndroid = !isIos && !isWeb;\n var resolved = null;\n var warned = false;\n function resolve() {\n if (resolved) return resolved;\n var adapter = getNativeMenuAdapter();\n if (!adapter) {\n if (!warned) {\n warned = true;\n console.warn(`Warning: Register a native menu adapter before rendering Tamagui native menus`);\n }\n return null;\n }\n var menu = isContextMenu ? adapter.ContextMenu : adapter.Menu;\n resolved = {\n menu,\n componentMap: {\n SubContent: menu.SubContent,\n SubTrigger: menu.SubTrigger,\n Content: menu.Content,\n Sub: menu.Sub,\n Group: menu.Group,\n Item: menu.Item,\n ItemTitle: menu.ItemTitle,\n ItemSubtitle: menu.ItemSubtitle,\n ItemIcon: menu.ItemIcon,\n ItemImage: menu.ItemImage,\n ItemIndicator: menu.ItemIndicator,\n Label: menu.Label,\n Separator: menu.Separator,\n CheckboxItem: menu.CheckboxItem,\n Preview: menu.Preview,\n Auxiliary: menu.Auxiliary\n }\n };\n return resolved;\n }\n function transformChildren(menu, map, children) {\n var shouldReverseOnIos = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false, triggerBoundaryHandlers = arguments.length > 4 ? arguments[4] : void 0, radioContext = arguments.length > 5 ? arguments[5] : void 0;\n var result = [];\n React.Children.forEach(children, function(child) {\n var _child_type;\n if (!/* @__PURE__ */ React.isValidElement(child)) {\n result.push(child);\n return;\n }\n var displayName = ((_child_type = child.type) === null || _child_type === void 0 ? void 0 : _child_type.displayName) || \"\";\n var props = child.props;\n if (isPortalLike(displayName)) {\n var inner = transformChildren(menu, map, props.children, false, triggerBoundaryHandlers, radioContext);\n React.Children.forEach(inner, function(c) {\n return result.push(c);\n });\n return;\n }\n if (displayName.includes(\"ScrollView\")) {\n var inner1 = transformChildren(menu, map, props.children, false, triggerBoundaryHandlers, radioContext);\n React.Children.forEach(inner1, function(c) {\n return result.push(c);\n });\n return;\n }\n if (isTriggerLike(displayName)) {\n var debugName = getTriggerDebugName(MenuType, props);\n var claim = function() {\n return triggerBoundaryHandlers === null || triggerBoundaryHandlers === void 0 ? void 0 : triggerBoundaryHandlers.claim(debugName);\n };\n var release = function() {\n return triggerBoundaryHandlers === null || triggerBoundaryHandlers === void 0 ? void 0 : triggerBoundaryHandlers.release(debugName);\n };\n var { children: triggerChildren, ...triggerProps } = props;\n result.push(/* @__PURE__ */ React.createElement(menu.Trigger, {\n ...triggerProps,\n key: child.key,\n onTouchStart: composeHandlers(claim, props.onTouchStart),\n onTouchEnd: composeHandlers(props.onTouchEnd, release),\n onTouchCancel: composeHandlers(props.onTouchCancel, release),\n onResponderGrant: composeHandlers(claim, props.onResponderGrant),\n onResponderRelease: composeHandlers(props.onResponderRelease, release),\n onResponderTerminate: composeHandlers(props.onResponderTerminate, release),\n onPressIn: composeHandlers(claim, props.onPressIn),\n onPressOut: composeHandlers(props.onPressOut, release)\n }, triggerChildren));\n return;\n }\n if (displayName.includes(\"RadioGroup\")) {\n var { value: rgValue, onValueChange: rgOnValueChange, children: rgChildren, ...rest } = props;\n result.push(/* @__PURE__ */ React.createElement(menu.Group, {\n ...rest,\n key: child.key\n }, transformChildren(menu, map, rgChildren, false, triggerBoundaryHandlers, {\n value: rgValue,\n onValueChange: rgOnValueChange\n })));\n return;\n }\n if (displayName.includes(\"RadioItem\") && radioContext) {\n var { value: itemValue, children: rChildren, ...rest1 } = props;\n var cleanChildren = React.Children.map(rChildren, function(c) {\n var _c_type;\n if (!/* @__PURE__ */ React.isValidElement(c)) return c;\n var dn = ((_c_type = c.type) === null || _c_type === void 0 ? void 0 : _c_type.displayName) || \"\";\n if (dn.includes(\"ItemIndicator\")) return null;\n return c;\n });\n result.push(/* @__PURE__ */ React.createElement(menu.CheckboxItem, {\n ...rest1,\n key: child.key,\n value: itemValue === radioContext.value ? \"on\" : \"off\",\n onValueChange: function() {\n var _radioContext_onValueChange;\n return (_radioContext_onValueChange = radioContext.onValueChange) === null || _radioContext_onValueChange === void 0 ? void 0 : _radioContext_onValueChange.call(radioContext, itemValue);\n }\n }, transformChildren(menu, map, cleanChildren, false, triggerBoundaryHandlers, radioContext)));\n return;\n }\n var componentType = getComponentType(displayName);\n if (componentType === \"CheckboxItem\") {\n var { checked, onCheckedChange, value, onValueChange, children: cbChildren, ...rest2 } = props;\n var finalValue = value !== null && value !== void 0 ? value : checked ? \"on\" : \"off\";\n var finalOnValueChange = onValueChange !== null && onValueChange !== void 0 ? onValueChange : onCheckedChange && function(v) {\n return onCheckedChange(v === \"on\");\n };\n var cleanChildren1 = React.Children.map(cbChildren, function(c) {\n var _c_type;\n if (!/* @__PURE__ */ React.isValidElement(c)) return c;\n var dn = ((_c_type = c.type) === null || _c_type === void 0 ? void 0 : _c_type.displayName) || \"\";\n if (dn.includes(\"ItemIndicator\")) return null;\n return c;\n });\n result.push(/* @__PURE__ */ React.createElement(menu.CheckboxItem, {\n ...rest2,\n key: child.key,\n value: finalValue,\n onValueChange: finalOnValueChange\n }, transformChildren(menu, map, cleanChildren1, false, triggerBoundaryHandlers, radioContext)));\n return;\n }\n if (componentType) {\n var { children: childChildren, ...restProps } = props;\n var AdapterComponent = map[componentType];\n var isContainer = CONTAINER_TYPES.includes(componentType);\n var shouldReverse = componentType === \"Content\" || componentType === \"SubContent\";\n result.push(/* @__PURE__ */ React.createElement(AdapterComponent, {\n ...restProps,\n key: child.key\n }, isContainer ? transformChildren(menu, map, childChildren, shouldReverse, triggerBoundaryHandlers, radioContext) : childChildren));\n return;\n }\n if (isItemLike(props, displayName)) {\n var { children: itemChildren, ...itemProps } = props;\n result.push(/* @__PURE__ */ React.createElement(menu.Item, {\n ...itemProps,\n key: child.key\n }, transformChildren(menu, map, itemChildren, false, triggerBoundaryHandlers, radioContext)));\n return;\n }\n result.push(child);\n });\n if (isIos && shouldReverseOnIos && !isContextMenu) {\n result.reverse();\n }\n return result;\n }\n function lazyAdapter(name, displayName) {\n var Comp = function(props) {\n var z = resolve();\n if (!z) return null;\n return /* @__PURE__ */ React.createElement(z.menu[name], props);\n };\n Comp.displayName = displayName || name;\n return Comp;\n }\n var Trigger = lazyAdapter(\"Trigger\");\n var Content = lazyAdapter(\"Content\");\n var Item = lazyAdapter(\"Item\");\n var ItemTitle = lazyAdapter(\"ItemTitle\");\n var ItemSubtitle = lazyAdapter(\"ItemSubtitle\");\n var ItemIcon = lazyAdapter(\"ItemIcon\");\n var ItemImage = lazyAdapter(\"ItemImage\");\n var ItemIndicator = lazyAdapter(\"ItemIndicator\");\n var Group = lazyAdapter(\"Group\");\n var Label = lazyAdapter(\"Label\");\n var Separator = lazyAdapter(\"Separator\");\n var Sub = lazyAdapter(\"Sub\");\n var SubTrigger = lazyAdapter(\"SubTrigger\");\n var SubContent = lazyAdapter(\"SubContent\");\n var Portal = function(param) {\n var { children } = param;\n return /* @__PURE__ */ _jsx(_Fragment, {\n children\n });\n };\n Portal.displayName = \"Portal\";\n var Arrow = function() {\n return null;\n };\n Arrow.displayName = \"Arrow\";\n var RadioGroup = function(param) {\n var { children } = param;\n return /* @__PURE__ */ _jsx(_Fragment, {\n children\n });\n };\n RadioGroup.displayName = `${MenuType}RadioGroup`;\n var RadioItem = function(param) {\n var { children } = param;\n return /* @__PURE__ */ _jsx(_Fragment, {\n children\n });\n };\n RadioItem.displayName = `${MenuType}RadioItem`;\n var CheckboxItem = function() {\n return null;\n };\n CheckboxItem.displayName = \"CheckboxItem\";\n var Preview = isContextMenu ? lazyAdapter(\"Preview\", `${MenuType}Preview`) : function() {\n return null;\n };\n Preview.displayName = `${MenuType}Preview`;\n var Auxiliary = isContextMenu ? lazyAdapter(\"Auxiliary\", `${MenuType}Auxiliary`) : function() {\n return null;\n };\n Auxiliary.displayName = `${MenuType}Auxiliary`;\n var Menu = function(param) {\n var { children, onOpenChange, onOpenWillChange } = param;\n var triggerOwnerRef = React.useRef(null);\n var claimTriggerBoundary = React.useCallback(function(debugName) {\n if (triggerOwnerRef.current) {\n unstable_releaseExternalPressOwnership(triggerOwnerRef.current, debugName);\n }\n triggerOwnerRef.current = unstable_claimExternalPressOwnership(debugName);\n }, []);\n var releaseTriggerBoundary = React.useCallback(function(debugName) {\n if (!triggerOwnerRef.current) return;\n unstable_releaseExternalPressOwnership(triggerOwnerRef.current, debugName);\n triggerOwnerRef.current = null;\n }, []);\n React.useEffect(function() {\n return releaseTriggerBoundary;\n }, [\n releaseTriggerBoundary\n ]);\n var z = resolve();\n if (!z) return null;\n var handleOpenChange = React.useCallback(function(isOpen) {\n if (!isOpen) {\n releaseTriggerBoundary();\n }\n onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(isOpen);\n }, [\n onOpenChange,\n releaseTriggerBoundary\n ]);\n var handleOpenWillChange = React.useCallback(function(willOpen) {\n if (!willOpen) {\n releaseTriggerBoundary();\n }\n onOpenWillChange === null || onOpenWillChange === void 0 ? void 0 : onOpenWillChange(willOpen);\n }, [\n onOpenWillChange,\n releaseTriggerBoundary\n ]);\n var rootProps = {\n onOpenChange: handleOpenChange\n };\n if (isContextMenu && onOpenWillChange) {\n rootProps.onOpenWillChange = handleOpenWillChange;\n }\n var content = /* @__PURE__ */ _jsx(z.menu.Root, {\n ...rootProps,\n children: transformChildren(z.menu, z.componentMap, children, false, {\n claim: claimTriggerBoundary,\n release: releaseTriggerBoundary\n })\n });\n if (isAndroid) {\n return /* @__PURE__ */ _jsx(NativeMenuContext.Provider, {\n value: true,\n children: content\n });\n }\n return content;\n };\n Menu.displayName = MenuType;\n return {\n Menu: withStaticProperties(Menu, {\n Trigger,\n Content,\n Item,\n ItemTitle,\n ItemSubtitle,\n ItemIcon,\n ItemImage,\n ItemIndicator,\n Group,\n Label,\n Separator,\n Sub,\n SubTrigger,\n SubContent,\n CheckboxItem,\n Portal,\n RadioGroup,\n RadioItem,\n Arrow,\n Preview,\n Auxiliary\n })\n };\n};\nexport {\n createNativeMenu\n};\n//# sourceMappingURL=createNativeMenu.js.map\n"],"mappings":";;;;;;AAIA,IAAI,eAAe;CACjB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AACA,IAAI,kBAAkB;CACpB;CACA;CACA;CACA;CACA;CACA;AACF;AACA,SAAS,iBAAiB,aAAa;CACrC,IAAI,4BAA4B,MAAM,oBAAoB,OAAO,iBAAiB,KAAK;CACvF,IAAI;EACF,KAAK,IAAI,YAAY,aAAa,OAAO,UAAU,GAAG,OAAO,EAAE,6BAA6B,QAAQ,UAAU,KAAK,GAAG,OAAO,4BAA4B,MAAM;GAC7J,IAAI,OAAO,MAAM;GACjB,IAAI,gBAAgB,QAAQ,gBAAgB,OAAO,UAAU,gBAAgB,cAAc,UAAU,YAAY,SAAS,IAAI,KAAK,EAAE,GAAG;IACtI,OAAO;GACT;EACF;CACF,SAAS,KAAK;EACZ,oBAAoB;EACpB,iBAAiB;CACnB,UAAU;EACR,IAAI;GACF,IAAI,CAAC,6BAA6B,UAAU,UAAU,MAAM;I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AAK,IAAI,iBAAiB,QAAQ;EAC/F,GAAG,CACD,kBACA,sBACF,CAAC;EACD,IAAI,YAAY,EACd,cAAc,iBAChB;EACA,IAAI,iBAAiB,kBAAkB;GACrC,UAAU,mBAAmB;EAC/B;EACA,IAAI,UAA0B,oBAAK,EAAE,KAAK,MAAM;GAC9C,GAAG;GACH,UAAU,kBAAkB,EAAE,MAAM,EAAE,cAAc,UAAU,OAAO;IACnE,OAAO;IACP,SAAS;GACX,CAAC;EACH,CAAC;EACD,IAAI,WAAW;GACb,OAAuB,oBAAK,kBAAkB,UAAU;IACtD,OAAO;IACP,UAAU;GACZ,CAAC;EACH;EACA,OAAO;CACT;CACA,KAAK,cAAc;CACnB,OAAO,EACL,MAAM,qBAAqB,MAAM;EAC/B;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC,EACH;AACF"}
|
|
1
|
+
{"version":3,"file":"createNativeMenu.native.js","names":["_Fragment"],"sources":["esm/createNativeMenu/createNativeMenu.native.js"],"sourcesContent":["import { jsx as _jsx, Fragment as _Fragment } from \"react/jsx-runtime\";\nimport { getNativeMenuAdapter, NativeMenuContext, unstable_claimExternalPressOwnership, unstable_releaseExternalPressOwnership } from \"@tamagui/native\";\nimport { isWeb, withStaticProperties, isIos } from \"@tamagui/web\";\nimport React from \"react\";\nvar MAPPED_TYPES = [\n \"SubContent\",\n \"SubTrigger\",\n \"Content\",\n \"Sub\",\n \"Group\",\n \"Item\",\n \"ItemTitle\",\n \"ItemSubtitle\",\n \"ItemIcon\",\n \"ItemImage\",\n \"ItemIndicator\",\n \"Label\",\n \"Separator\",\n \"CheckboxItem\",\n \"Preview\",\n \"Auxiliary\"\n];\nvar CONTAINER_TYPES = [\n \"SubContent\",\n \"SubTrigger\",\n \"Content\",\n \"Sub\",\n \"Group\",\n \"Item\"\n];\nfunction getComponentType(displayName) {\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = MAPPED_TYPES[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var type = _step.value;\n if (displayName === type || displayName === `Menu${type}` || displayName === `ContextMenu${type}` || displayName.includes(`(${type})`)) {\n return type;\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n return null;\n}\nfunction isItemLike(props, displayName) {\n if (getComponentType(displayName)) return false;\n return \"onSelect\" in props || \"textValue\" in props;\n}\nfunction isPortalLike(displayName) {\n return displayName === \"Portal\" || displayName.includes(\"Portal\");\n}\nfunction isTriggerLike(displayName) {\n return displayName === \"Trigger\" || displayName.includes(\"(Trigger)\");\n}\nfunction composeHandlers(first, second) {\n return function() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n first === null || first === void 0 ? void 0 : first(...args);\n second === null || second === void 0 ? void 0 : second(...args);\n };\n}\nfunction getTriggerDebugName(menuType, props) {\n var childProps = /* @__PURE__ */ React.isValidElement(props.children) && props.children.props ? props.children.props : null;\n var prefix = menuType === \"ContextMenu\" ? \"ContextMenuTrigger\" : \"MenuTrigger\";\n var _childProps_testID, _ref;\n var detail = (_ref = (_childProps_testID = childProps === null || childProps === void 0 ? void 0 : childProps.testID) !== null && _childProps_testID !== void 0 ? _childProps_testID : childProps === null || childProps === void 0 ? void 0 : childProps.accessibilityLabel) !== null && _ref !== void 0 ? _ref : typeof props.textValue === \"string\" ? props.textValue : null;\n return [\n prefix,\n detail\n ].filter(Boolean).join(\":\") || prefix;\n}\nvar emptyStub = function() {\n return null;\n};\nfunction createWebStubs() {\n return {\n Menu: withStaticProperties(emptyStub, {\n Trigger: emptyStub,\n Content: emptyStub,\n Item: emptyStub,\n ItemTitle: emptyStub,\n ItemSubtitle: emptyStub,\n SubTrigger: emptyStub,\n Group: emptyStub,\n ItemIcon: emptyStub,\n Separator: emptyStub,\n CheckboxItem: emptyStub,\n ItemIndicator: emptyStub,\n ItemImage: emptyStub,\n Label: emptyStub,\n Arrow: emptyStub,\n Sub: emptyStub,\n SubContent: emptyStub,\n Preview: emptyStub,\n Portal: emptyStub,\n RadioGroup: emptyStub,\n RadioItem: emptyStub,\n Auxiliary: emptyStub\n })\n };\n}\nvar createNativeMenu = function(MenuType) {\n if (isWeb) {\n return createWebStubs();\n }\n var isContextMenu = MenuType === \"ContextMenu\";\n var isAndroid = !isIos && !isWeb;\n var resolved = null;\n var warned = false;\n function resolve() {\n if (resolved) return resolved;\n var adapter = getNativeMenuAdapter();\n if (!adapter) {\n if (!warned) {\n warned = true;\n console.warn(`Warning: Register a native menu adapter before rendering Tamagui native menus`);\n }\n return null;\n }\n var menu = isContextMenu ? adapter.ContextMenu : adapter.Menu;\n resolved = {\n menu,\n componentMap: {\n SubContent: menu.SubContent,\n SubTrigger: menu.SubTrigger,\n Content: menu.Content,\n Sub: menu.Sub,\n Group: menu.Group,\n Item: menu.Item,\n ItemTitle: menu.ItemTitle,\n ItemSubtitle: menu.ItemSubtitle,\n ItemIcon: menu.ItemIcon,\n ItemImage: menu.ItemImage,\n ItemIndicator: menu.ItemIndicator,\n Label: menu.Label,\n Separator: menu.Separator,\n CheckboxItem: menu.CheckboxItem,\n Preview: menu.Preview,\n Auxiliary: menu.Auxiliary\n }\n };\n return resolved;\n }\n function transformChildren(menu, map, children) {\n var shouldReverseOnIos = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false, triggerBoundaryHandlers = arguments.length > 4 ? arguments[4] : void 0, radioContext = arguments.length > 5 ? arguments[5] : void 0;\n var result = [];\n React.Children.forEach(children, function(child) {\n var _child_type;\n if (!/* @__PURE__ */ React.isValidElement(child)) {\n result.push(child);\n return;\n }\n var displayName = ((_child_type = child.type) === null || _child_type === void 0 ? void 0 : _child_type.displayName) || \"\";\n var props = child.props;\n if (isPortalLike(displayName)) {\n var inner = transformChildren(menu, map, props.children, false, triggerBoundaryHandlers, radioContext);\n React.Children.forEach(inner, function(c) {\n return result.push(c);\n });\n return;\n }\n if (displayName.includes(\"ScrollView\")) {\n var inner1 = transformChildren(menu, map, props.children, false, triggerBoundaryHandlers, radioContext);\n React.Children.forEach(inner1, function(c) {\n return result.push(c);\n });\n return;\n }\n if (isTriggerLike(displayName)) {\n var debugName = getTriggerDebugName(MenuType, props);\n var claim = function() {\n return triggerBoundaryHandlers === null || triggerBoundaryHandlers === void 0 ? void 0 : triggerBoundaryHandlers.claim(debugName);\n };\n var release = function() {\n return triggerBoundaryHandlers === null || triggerBoundaryHandlers === void 0 ? void 0 : triggerBoundaryHandlers.release(debugName);\n };\n var { children: triggerChildren, ...triggerProps } = props;\n result.push(/* @__PURE__ */ React.createElement(menu.Trigger, {\n ...triggerProps,\n key: child.key,\n onTouchStart: composeHandlers(claim, props.onTouchStart),\n onTouchEnd: composeHandlers(props.onTouchEnd, release),\n onTouchCancel: composeHandlers(props.onTouchCancel, release),\n onResponderGrant: composeHandlers(claim, props.onResponderGrant),\n onResponderRelease: composeHandlers(props.onResponderRelease, release),\n onResponderTerminate: composeHandlers(props.onResponderTerminate, release),\n onPressIn: composeHandlers(claim, props.onPressIn),\n onPressOut: composeHandlers(props.onPressOut, release)\n }, triggerChildren));\n return;\n }\n if (displayName.includes(\"RadioGroup\")) {\n var { value: rgValue, onValueChange: rgOnValueChange, children: rgChildren, ...rest } = props;\n result.push(/* @__PURE__ */ React.createElement(menu.Group, {\n ...rest,\n key: child.key\n }, transformChildren(menu, map, rgChildren, false, triggerBoundaryHandlers, {\n value: rgValue,\n onValueChange: rgOnValueChange\n })));\n return;\n }\n if (displayName.includes(\"RadioItem\") && radioContext) {\n var { value: itemValue, children: rChildren, ...rest1 } = props;\n var cleanChildren = React.Children.map(rChildren, function(c) {\n var _c_type;\n if (!/* @__PURE__ */ React.isValidElement(c)) return c;\n var dn = ((_c_type = c.type) === null || _c_type === void 0 ? void 0 : _c_type.displayName) || \"\";\n if (dn.includes(\"ItemIndicator\")) return null;\n return c;\n });\n result.push(/* @__PURE__ */ React.createElement(menu.CheckboxItem, {\n ...rest1,\n key: child.key,\n value: itemValue === radioContext.value ? \"on\" : \"off\",\n onValueChange: function() {\n var _radioContext_onValueChange;\n return (_radioContext_onValueChange = radioContext.onValueChange) === null || _radioContext_onValueChange === void 0 ? void 0 : _radioContext_onValueChange.call(radioContext, itemValue);\n }\n }, transformChildren(menu, map, cleanChildren, false, triggerBoundaryHandlers, radioContext)));\n return;\n }\n var componentType = getComponentType(displayName);\n if (componentType === \"CheckboxItem\") {\n var { checked, onCheckedChange, value, onValueChange, children: cbChildren, ...rest2 } = props;\n var finalValue = value !== null && value !== void 0 ? value : checked ? \"on\" : \"off\";\n var finalOnValueChange = onValueChange !== null && onValueChange !== void 0 ? onValueChange : onCheckedChange && function(v) {\n return onCheckedChange(v === \"on\");\n };\n var cleanChildren1 = React.Children.map(cbChildren, function(c) {\n var _c_type;\n if (!/* @__PURE__ */ React.isValidElement(c)) return c;\n var dn = ((_c_type = c.type) === null || _c_type === void 0 ? void 0 : _c_type.displayName) || \"\";\n if (dn.includes(\"ItemIndicator\")) return null;\n return c;\n });\n result.push(/* @__PURE__ */ React.createElement(menu.CheckboxItem, {\n ...rest2,\n key: child.key,\n value: finalValue,\n onValueChange: finalOnValueChange\n }, transformChildren(menu, map, cleanChildren1, false, triggerBoundaryHandlers, radioContext)));\n return;\n }\n if (componentType) {\n var { children: childChildren, ...restProps } = props;\n var AdapterComponent = map[componentType];\n var isContainer = CONTAINER_TYPES.includes(componentType);\n var shouldReverse = componentType === \"Content\" || componentType === \"SubContent\";\n result.push(/* @__PURE__ */ React.createElement(AdapterComponent, {\n ...restProps,\n key: child.key\n }, isContainer ? transformChildren(menu, map, childChildren, shouldReverse, triggerBoundaryHandlers, radioContext) : childChildren));\n return;\n }\n if (isItemLike(props, displayName)) {\n var { children: itemChildren, ...itemProps } = props;\n result.push(/* @__PURE__ */ React.createElement(menu.Item, {\n ...itemProps,\n key: child.key\n }, transformChildren(menu, map, itemChildren, false, triggerBoundaryHandlers, radioContext)));\n return;\n }\n result.push(child);\n });\n if (isIos && shouldReverseOnIos && !isContextMenu) {\n result.reverse();\n }\n return result;\n }\n function lazyAdapter(name, displayName) {\n var Comp = function(props) {\n var z = resolve();\n if (!z) return null;\n return /* @__PURE__ */ React.createElement(z.menu[name], props);\n };\n Comp.displayName = displayName || name;\n return Comp;\n }\n var Trigger = lazyAdapter(\"Trigger\");\n var Content = lazyAdapter(\"Content\");\n var Item = lazyAdapter(\"Item\");\n var ItemTitle = lazyAdapter(\"ItemTitle\");\n var ItemSubtitle = lazyAdapter(\"ItemSubtitle\");\n var ItemIcon = lazyAdapter(\"ItemIcon\");\n var ItemImage = lazyAdapter(\"ItemImage\");\n var ItemIndicator = lazyAdapter(\"ItemIndicator\");\n var Group = lazyAdapter(\"Group\");\n var Label = lazyAdapter(\"Label\");\n var Separator = lazyAdapter(\"Separator\");\n var Sub = lazyAdapter(\"Sub\");\n var SubTrigger = lazyAdapter(\"SubTrigger\");\n var SubContent = lazyAdapter(\"SubContent\");\n var Portal = function(param) {\n var { children } = param;\n return /* @__PURE__ */ _jsx(_Fragment, {\n children\n });\n };\n Portal.displayName = \"Portal\";\n var Arrow = function() {\n return null;\n };\n Arrow.displayName = \"Arrow\";\n var RadioGroup = function(param) {\n var { children } = param;\n return /* @__PURE__ */ _jsx(_Fragment, {\n children\n });\n };\n RadioGroup.displayName = `${MenuType}RadioGroup`;\n var RadioItem = function(param) {\n var { children } = param;\n return /* @__PURE__ */ _jsx(_Fragment, {\n children\n });\n };\n RadioItem.displayName = `${MenuType}RadioItem`;\n var CheckboxItem = function() {\n return null;\n };\n CheckboxItem.displayName = \"CheckboxItem\";\n var Preview = isContextMenu ? lazyAdapter(\"Preview\", `${MenuType}Preview`) : function() {\n return null;\n };\n Preview.displayName = `${MenuType}Preview`;\n var Auxiliary = isContextMenu ? lazyAdapter(\"Auxiliary\", `${MenuType}Auxiliary`) : function() {\n return null;\n };\n Auxiliary.displayName = `${MenuType}Auxiliary`;\n var Menu = function(param) {\n var { children, onOpenChange, onOpenWillChange } = param;\n var triggerOwnerRef = React.useRef(null);\n var claimTriggerBoundary = React.useCallback(function(debugName) {\n if (triggerOwnerRef.current) {\n unstable_releaseExternalPressOwnership(triggerOwnerRef.current, debugName);\n }\n triggerOwnerRef.current = unstable_claimExternalPressOwnership(debugName);\n }, []);\n var releaseTriggerBoundary = React.useCallback(function(debugName) {\n if (!triggerOwnerRef.current) return;\n unstable_releaseExternalPressOwnership(triggerOwnerRef.current, debugName);\n triggerOwnerRef.current = null;\n }, []);\n React.useEffect(function() {\n return releaseTriggerBoundary;\n }, [\n releaseTriggerBoundary\n ]);\n var z = resolve();\n if (!z) return null;\n var handleOpenChange = React.useCallback(function(isOpen) {\n if (!isOpen) {\n releaseTriggerBoundary();\n }\n onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(isOpen);\n }, [\n onOpenChange,\n releaseTriggerBoundary\n ]);\n var handleOpenWillChange = React.useCallback(function(willOpen) {\n if (!willOpen) {\n releaseTriggerBoundary();\n }\n onOpenWillChange === null || onOpenWillChange === void 0 ? void 0 : onOpenWillChange(willOpen);\n }, [\n onOpenWillChange,\n releaseTriggerBoundary\n ]);\n var rootProps = {\n onOpenChange: handleOpenChange\n };\n if (isContextMenu && onOpenWillChange) {\n rootProps.onOpenWillChange = handleOpenWillChange;\n }\n var content = /* @__PURE__ */ _jsx(z.menu.Root, {\n ...rootProps,\n children: transformChildren(z.menu, z.componentMap, children, false, {\n claim: claimTriggerBoundary,\n release: releaseTriggerBoundary\n })\n });\n if (isAndroid) {\n return /* @__PURE__ */ _jsx(NativeMenuContext.Provider, {\n value: true,\n children: content\n });\n }\n return content;\n };\n Menu.displayName = MenuType;\n return {\n Menu: withStaticProperties(Menu, {\n Trigger,\n Content,\n Item,\n ItemTitle,\n ItemSubtitle,\n ItemIcon,\n ItemImage,\n ItemIndicator,\n Group,\n Label,\n Separator,\n Sub,\n SubTrigger,\n SubContent,\n CheckboxItem,\n Portal,\n RadioGroup,\n RadioItem,\n Arrow,\n Preview,\n Auxiliary\n })\n };\n};\nexport {\n createNativeMenu\n};\n//# sourceMappingURL=createNativeMenu.js.map\n"],"mappings":";;;;;;AAIA,IAAI,eAAe;CACjB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AACA,IAAI,kBAAkB;CACpB;CACA;CACA;CACA;CACA;CACA;AACF;AACA,SAAS,iBAAiB,aAAa;CACrC,IAAI,4BAA4B,MAAM,oBAAoB,OAAO,iBAAiB,KAAK;CACvF,IAAI;EACF,KAAK,IAAI,YAAY,aAAa,OAAO,SAAS,CAAC,GAAG,OAAO,EAAE,6BAA6B,QAAQ,UAAU,KAAK,EAAC,CAAE,OAAO,4BAA4B,MAAM;GAC7J,IAAI,OAAO,MAAM;GACjB,IAAI,gBAAgB,QAAQ,gBAAgB,OAAO,UAAU,gBAAgB,cAAc,UAAU,YAAY,SAAS,IAAI,KAAK,EAAE,GAAG;IACtI,OAAO;GACT;EACF;CACF,SAAS,KAAK;EACZ,oBAAoB;EACpB,iBAAiB;CACnB,UAAU;EACR,IAAI;GACF,IAAI,CAAC,6BAA6B,UAAU,UAAU,MAAM;IAC1D,UAAU,OAAO;GACnB;EACF,UAAU;GACR,IAAI,mBAAmB;IACrB,MAAM;GACR;EACF;CACF;CACA,OAAO;AACT;AACA,SAAS,WAAW,OAAO,aAAa;CACtC,IAAI,iBAAiB,WAAW,GAAG,OAAO;CAC1C,OAAO,cAAc,SAAS,eAAe;AAC/C;AACA,SAAS,aAAa,aAAa;CACjC,OAAO,gBAAgB,YAAY,YAAY,SAAS,QAAQ;AAClE;AACA,SAAS,cAAc,aAAa;CAClC,OAAO,gBAAgB,aAAa,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IAAI,WAAW;GACb,OAAuB,oBAAK,kBAAkB,UAAU;IACtD,OAAO;IACP,UAAU;GACZ,CAAC;EACH;EACA,OAAO;CACT;CACA,KAAK,cAAc;CACnB,OAAO,EACL,MAAM,qBAAqB,MAAM;EAC/B;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC,EACH;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","names":[],"sources":["esm/createNativeMenu/utils.js"],"sourcesContent":["import React, {\n Children,\n cloneElement,\n isValidElement\n} from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nfunction flattenChildrenKeyless(children) {\n const childrenArray = React.Children.toArray(children);\n return childrenArray.reduce((flatChildren, child) => {\n if (child.type === React.Fragment) {\n return flatChildren.concat(\n flattenChildren(child.props.children)\n );\n }\n flatChildren.push(child);\n return flatChildren;\n }, []);\n}\nfunction flattenChildren(children, displayNamesToIgnore, depth = 0, keys = []) {\n return Children.toArray(children).flatMap((elem) => {\n if (isValidElement(elem)) {\n if (typeof elem?.type == \"function\" && displayNamesToIgnore?.some(\n (skipDisplayName) => elem.type.displayName.includes(skipDisplayName)\n )) {\n return elem.props.children;\n }\n }\n return elem;\n }).reduce((acc, node, nodeIndex) => {\n if (node.type === React.Fragment) {\n acc.push.apply(\n acc,\n flattenChildren(\n node.props.children,\n displayNamesToIgnore,\n depth + 1,\n keys.concat(node.key || nodeIndex)\n )\n );\n } else {\n if (isValidElement(node)) {\n acc.push(\n cloneElement(node, {\n key: keys.concat(String(node.key)).join(\".\")\n })\n );\n } else if (typeof node === \"string\" || typeof node === \"number\") {\n acc.push(node);\n }\n }\n return acc;\n }, []);\n}\nconst pickChildren = (_children, targetChild, displayNamesToIgnore) => {\n const children = flattenChildren(_children, displayNamesToIgnore);\n const target = [];\n const withoutTargetChildren = React.Children.map(children, (item) => {\n if (!isValidElement(item)) return item;\n if (isInstanceOfComponent(item, targetChild)) {\n target.push(cloneElement(item));\n return null;\n }\n return item;\n });\n const targetChildren = target.length >= 0 ? target : void 0;\n return {\n targetChildren,\n withoutTargetChildren\n };\n};\nconst isInstanceOfComponent = (element, targetElement) => {\n const matches = element?.type === targetElement || typeof element?.type == \"function\" && (element?.type?.displayName === targetElement.displayName || element?.type?.displayName === targetElement.displayName + \"Wrapper\");\n return matches;\n};\nconst filterNull = (t) => {\n return t != null;\n};\nconst create = (Component, displayName) => {\n const MenuComponent = (props) => {\n return /* @__PURE__ */ jsx(Component, { ...props });\n };\n MenuComponent.displayName = displayName;\n return MenuComponent;\n};\nexport {\n create,\n filterNull,\n flattenChildren,\n flattenChildrenKeyless,\n isInstanceOfComponent,\n pickChildren\n};\n//# sourceMappingURL=utils.js.map\n"],"mappings":";;;;AAMA,SAAS,uBAAuB,UAAU;CACxC,MAAM,gBAAgB,MAAM,SAAS,QAAQ,QAAQ;CACrD,OAAO,cAAc,QAAQ,cAAc,UAAU;EACnD,IAAI,MAAM,SAAS,MAAM,UAAU;GACjC,OAAO,aAAa,OAClB,gBAAgB,MAAM,MAAM,QAAQ,CACtC;EACF;EACA,aAAa,KAAK,KAAK;EACvB,OAAO;CACT,GAAG,CAAC,CAAC;AACP;AACA,SAAS,gBAAgB,UAAU,sBAAsB,QAAQ,GAAG,OAAO,CAAC,GAAG;CAC7E,OAAO,SAAS,QAAQ,QAAQ,
|
|
1
|
+
{"version":3,"file":"utils.js","names":[],"sources":["esm/createNativeMenu/utils.js"],"sourcesContent":["import React, {\n Children,\n cloneElement,\n isValidElement\n} from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nfunction flattenChildrenKeyless(children) {\n const childrenArray = React.Children.toArray(children);\n return childrenArray.reduce((flatChildren, child) => {\n if (child.type === React.Fragment) {\n return flatChildren.concat(\n flattenChildren(child.props.children)\n );\n }\n flatChildren.push(child);\n return flatChildren;\n }, []);\n}\nfunction flattenChildren(children, displayNamesToIgnore, depth = 0, keys = []) {\n return Children.toArray(children).flatMap((elem) => {\n if (isValidElement(elem)) {\n if (typeof elem?.type == \"function\" && displayNamesToIgnore?.some(\n (skipDisplayName) => elem.type.displayName.includes(skipDisplayName)\n )) {\n return elem.props.children;\n }\n }\n return elem;\n }).reduce((acc, node, nodeIndex) => {\n if (node.type === React.Fragment) {\n acc.push.apply(\n acc,\n flattenChildren(\n node.props.children,\n displayNamesToIgnore,\n depth + 1,\n keys.concat(node.key || nodeIndex)\n )\n );\n } else {\n if (isValidElement(node)) {\n acc.push(\n cloneElement(node, {\n key: keys.concat(String(node.key)).join(\".\")\n })\n );\n } else if (typeof node === \"string\" || typeof node === \"number\") {\n acc.push(node);\n }\n }\n return acc;\n }, []);\n}\nconst pickChildren = (_children, targetChild, displayNamesToIgnore) => {\n const children = flattenChildren(_children, displayNamesToIgnore);\n const target = [];\n const withoutTargetChildren = React.Children.map(children, (item) => {\n if (!isValidElement(item)) return item;\n if (isInstanceOfComponent(item, targetChild)) {\n target.push(cloneElement(item));\n return null;\n }\n return item;\n });\n const targetChildren = target.length >= 0 ? target : void 0;\n return {\n targetChildren,\n withoutTargetChildren\n };\n};\nconst isInstanceOfComponent = (element, targetElement) => {\n const matches = element?.type === targetElement || typeof element?.type == \"function\" && (element?.type?.displayName === targetElement.displayName || element?.type?.displayName === targetElement.displayName + \"Wrapper\");\n return matches;\n};\nconst filterNull = (t) => {\n return t != null;\n};\nconst create = (Component, displayName) => {\n const MenuComponent = (props) => {\n return /* @__PURE__ */ jsx(Component, { ...props });\n };\n MenuComponent.displayName = displayName;\n return MenuComponent;\n};\nexport {\n create,\n filterNull,\n flattenChildren,\n flattenChildrenKeyless,\n isInstanceOfComponent,\n pickChildren\n};\n//# sourceMappingURL=utils.js.map\n"],"mappings":";;;;AAMA,SAAS,uBAAuB,UAAU;CACxC,MAAM,gBAAgB,MAAM,SAAS,QAAQ,QAAQ;CACrD,OAAO,cAAc,QAAQ,cAAc,UAAU;EACnD,IAAI,MAAM,SA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;CACD,MAAM,iBAAiB,OAAO,UAAU,IAAI,SAAS,KAAK;CAC1D,OAAO;EACL;EACA;CACF;AACF;AACA,MAAM,yBAAyB,SAAS,kBAAkB;CACxD,MAAM,UAAU,SAAS,SAAS,iBAAiB,OAAO,SAAS,QAAQ,eAAe,SAAS,MAAM,gBAAgB,cAAc,eAAe,SAAS,MAAM,gBAAgB,cAAc,cAAc;CACjN,OAAO;AACT;AACA,MAAM,cAAc,MAAM;CACxB,OAAO,KAAK;AACd;AACA,MAAM,UAAU,WAAW,gBAAgB;CACzC,MAAM,iBAAiB,UAAU;EAC/B,OAAuB,oBAAI,WAAW,EAAE,GAAG,MAAM,CAAC;CACpD;CACA,cAAc,cAAc;CAC5B,OAAO;AACT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.native.js","names":[],"sources":["esm/createNativeMenu/utils.native.js"],"sourcesContent":["import { jsx as _jsx } from \"react/jsx-runtime\";\nimport React, { Children, cloneElement, isValidElement } from \"react\";\nfunction flattenChildrenKeyless(children) {\n var childrenArray = React.Children.toArray(children);\n return childrenArray.reduce(function(flatChildren, child) {\n if (child.type === React.Fragment) {\n return flatChildren.concat(flattenChildren(child.props.children));\n }\n flatChildren.push(child);\n return flatChildren;\n }, []);\n}\nfunction flattenChildren(children, displayNamesToIgnore) {\n var depth = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 0, keys = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : [];\n return Children.toArray(children).flatMap(function(elem) {\n if (/* @__PURE__ */ isValidElement(elem)) {\n if (typeof (elem === null || elem === void 0 ? void 0 : elem.type) == \"function\" && (displayNamesToIgnore === null || displayNamesToIgnore === void 0 ? void 0 : displayNamesToIgnore.some(function(skipDisplayName) {\n return elem.type.displayName.includes(skipDisplayName);\n }))) {\n return elem.props.children;\n }\n }\n return elem;\n }).reduce(function(acc, node, nodeIndex) {\n if (node.type === React.Fragment) {\n acc.push.apply(acc, flattenChildren(node.props.children, displayNamesToIgnore, depth + 1, keys.concat(node.key || nodeIndex)));\n } else {\n if (/* @__PURE__ */ isValidElement(node)) {\n acc.push(/* @__PURE__ */ cloneElement(node, {\n key: keys.concat(String(node.key)).join(\".\")\n }));\n } else if (typeof node === \"string\" || typeof node === \"number\") {\n acc.push(node);\n }\n }\n return acc;\n }, []);\n}\nvar pickChildren = function(_children, targetChild, displayNamesToIgnore) {\n var children = flattenChildren(_children, displayNamesToIgnore);\n var target = [];\n var withoutTargetChildren = React.Children.map(children, function(item) {\n if (!/* @__PURE__ */ isValidElement(item)) return item;\n if (isInstanceOfComponent(item, targetChild)) {\n target.push(/* @__PURE__ */ cloneElement(item));\n return null;\n }\n return item;\n });\n var targetChildren = target.length >= 0 ? target : void 0;\n return {\n targetChildren,\n withoutTargetChildren\n };\n};\nvar isInstanceOfComponent = function(element, targetElement) {\n var _element_type, _element_type1;\n var matches = (element === null || element === void 0 ? void 0 : element.type) === targetElement || typeof (element === null || element === void 0 ? void 0 : element.type) == \"function\" && ((element === null || element === void 0 ? void 0 : (_element_type = element.type) === null || _element_type === void 0 ? void 0 : _element_type.displayName) === targetElement.displayName || (element === null || element === void 0 ? void 0 : (_element_type1 = element.type) === null || _element_type1 === void 0 ? void 0 : _element_type1.displayName) === targetElement.displayName + \"Wrapper\");\n return matches;\n};\nvar filterNull = function(t) {\n return t != null;\n};\nvar create = function(Component, displayName) {\n var MenuComponent = function(props) {\n return /* @__PURE__ */ _jsx(Component, {\n ...props\n });\n };\n MenuComponent.displayName = displayName;\n return MenuComponent;\n};\nexport {\n create,\n filterNull,\n flattenChildren,\n flattenChildrenKeyless,\n isInstanceOfComponent,\n pickChildren\n};\n//# sourceMappingURL=utils.js.map\n"],"mappings":";;;;AAEA,SAAS,uBAAuB,UAAU;CACxC,IAAI,gBAAgB,MAAM,SAAS,QAAQ,QAAQ;CACnD,OAAO,cAAc,OAAO,SAAS,cAAc,OAAO;EACxD,IAAI,MAAM,SAAS,MAAM,UAAU;GACjC,OAAO,aAAa,OAAO,gBAAgB,MAAM,MAAM,QAAQ,CAAC;EAClE;EACA,aAAa,KAAK,KAAK;EACvB,OAAO;CACT,GAAG,CAAC,CAAC;AACP;AACA,SAAS,gBAAgB,UAAU,sBAAsB;CACvD,IAAI,QAAQ,UAAU,SAAS,KAAK,UAAU,OAAO,KAAK,IAAI,UAAU,KAAK,GAAG,OAAO,UAAU,SAAS,KAAK,UAAU,OAAO,KAAK,IAAI,UAAU,KAAK,CAAC;CACzJ,OAAO,SAAS,QAAQ,QAAQ,
|
|
1
|
+
{"version":3,"file":"utils.native.js","names":[],"sources":["esm/createNativeMenu/utils.native.js"],"sourcesContent":["import { jsx as _jsx } from \"react/jsx-runtime\";\nimport React, { Children, cloneElement, isValidElement } from \"react\";\nfunction flattenChildrenKeyless(children) {\n var childrenArray = React.Children.toArray(children);\n return childrenArray.reduce(function(flatChildren, child) {\n if (child.type === React.Fragment) {\n return flatChildren.concat(flattenChildren(child.props.children));\n }\n flatChildren.push(child);\n return flatChildren;\n }, []);\n}\nfunction flattenChildren(children, displayNamesToIgnore) {\n var depth = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 0, keys = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : [];\n return Children.toArray(children).flatMap(function(elem) {\n if (/* @__PURE__ */ isValidElement(elem)) {\n if (typeof (elem === null || elem === void 0 ? void 0 : elem.type) == \"function\" && (displayNamesToIgnore === null || displayNamesToIgnore === void 0 ? void 0 : displayNamesToIgnore.some(function(skipDisplayName) {\n return elem.type.displayName.includes(skipDisplayName);\n }))) {\n return elem.props.children;\n }\n }\n return elem;\n }).reduce(function(acc, node, nodeIndex) {\n if (node.type === React.Fragment) {\n acc.push.apply(acc, flattenChildren(node.props.children, displayNamesToIgnore, depth + 1, keys.concat(node.key || nodeIndex)));\n } else {\n if (/* @__PURE__ */ isValidElement(node)) {\n acc.push(/* @__PURE__ */ cloneElement(node, {\n key: keys.concat(String(node.key)).join(\".\")\n }));\n } else if (typeof node === \"string\" || typeof node === \"number\") {\n acc.push(node);\n }\n }\n return acc;\n }, []);\n}\nvar pickChildren = function(_children, targetChild, displayNamesToIgnore) {\n var children = flattenChildren(_children, displayNamesToIgnore);\n var target = [];\n var withoutTargetChildren = React.Children.map(children, function(item) {\n if (!/* @__PURE__ */ isValidElement(item)) return item;\n if (isInstanceOfComponent(item, targetChild)) {\n target.push(/* @__PURE__ */ cloneElement(item));\n return null;\n }\n return item;\n });\n var targetChildren = target.length >= 0 ? target : void 0;\n return {\n targetChildren,\n withoutTargetChildren\n };\n};\nvar isInstanceOfComponent = function(element, targetElement) {\n var _element_type, _element_type1;\n var matches = (element === null || element === void 0 ? void 0 : element.type) === targetElement || typeof (element === null || element === void 0 ? void 0 : element.type) == \"function\" && ((element === null || element === void 0 ? void 0 : (_element_type = element.type) === null || _element_type === void 0 ? void 0 : _element_type.displayName) === targetElement.displayName || (element === null || element === void 0 ? void 0 : (_element_type1 = element.type) === null || _element_type1 === void 0 ? void 0 : _element_type1.displayName) === targetElement.displayName + \"Wrapper\");\n return matches;\n};\nvar filterNull = function(t) {\n return t != null;\n};\nvar create = function(Component, displayName) {\n var MenuComponent = function(props) {\n return /* @__PURE__ */ _jsx(Component, {\n ...props\n });\n };\n MenuComponent.displayName = displayName;\n return MenuComponent;\n};\nexport {\n create,\n filterNull,\n flattenChildren,\n flattenChildrenKeyless,\n isInstanceOfComponent,\n pickChildren\n};\n//# sourceMappingURL=utils.js.map\n"],"mappings":";;;;AAEA,SAAS,uBAAuB,UAAU;CACxC,IAAI,gBAAgB,MAAM,SAAS,QAAQ,QAAQ;CACnD,OAAO,cAAc,OAAO,SAAS,cAAc,OAAO;EACxD,IAAI,MAAM,SAAS,MAAM,UAAU;GACjC,OAAO,aAAa,OAAO,gBAAgB,MAAM,MAAM,QAAQ,CAAC;EAClE;EACA,aAAa,KAAK,KAAK;EACvB,OAAO;CACT,GAAG,CAAC,CAAC;AACP;AACA,SAAS,gBAAgB,UAAU,sBAAsB;CACvD,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sB,MAAM,WAAW,GAAG;GAC5C,OAAO,KAAqB,6BAAa,IAAI,CAAC;GAC9C,OAAO;EACT;EACA,OAAO;CACT,CAAC;CACD,IAAI,iBAAiB,OAAO,UAAU,IAAI,SAAS,KAAK;CACxD,OAAO;EACL;EACA;CACF;AACF;AACA,IAAI,wBAAwB,SAAS,SAAS,eAAe;CAC3D,IAAI,eAAe;CACnB,IAAI,WAAW,YAAY,QAAQ,YAAY,KAAK,IAAI,KAAK,IAAI,QAAQ,UAAU,iBAAiB,QAAQ,YAAY,QAAQ,YAAY,KAAK,IAAI,KAAK,IAAI,QAAQ,SAAS,gBAAgB,YAAY,QAAQ,YAAY,KAAK,IAAI,KAAK,KAAK,gBAAgB,QAAQ,UAAU,QAAQ,kBAAkB,KAAK,IAAI,KAAK,IAAI,cAAc,iBAAiB,cAAc,gBAAgB,YAAY,QAAQ,YAAY,KAAK,IAAI,KAAK,KAAK,iBAAiB,QAAQ,UAAU,QAAQ,mBAAmB,KAAK,IAAI,KAAK,IAAI,eAAe,iBAAiB,cAAc,cAAc;CAC5jB,OAAO;AACT;AACA,IAAI,aAAa,SAAS,GAAG;CAC3B,OAAO,KAAK;AACd;AACA,IAAI,SAAS,SAAS,WAAW,aAAa;CAC5C,IAAI,gBAAgB,SAAS,OAAO;EAClC,OAAuB,oBAAK,WAAW,EACrC,GAAG,MACL,CAAC;CACH;CACA,cAAc,cAAc;CAC5B,OAAO;AACT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createBaseMenu.js","names":["TamaguiImage","PortalPrimitive","DismissableLayer","Presence","Portal"],"sources":["jsx/createBaseMenu.js"],"sourcesContent":["import { createStyledHOC, createRefComponent } from \"@tamagui/core\";\nimport { Animate } from \"@tamagui/animate\";\nimport { AnimatePresence as Presence } from \"@tamagui/animate-presence\";\nimport { createCollection } from \"@tamagui/collection\";\nimport {\n Dismissable as DismissableLayer,\n dispatchDiscreteCustomEvent\n} from \"@tamagui/dismissable\";\nimport { useFocusGuards } from \"@tamagui/focus-guard\";\nimport { FocusScope } from \"@tamagui/focus-scope\";\nimport { Image as TamaguiImage } from \"@tamagui/image\";\nimport * as PopperPrimitive from \"@tamagui/popper\";\nimport { needsPortalRepropagation, Portal as PortalPrimitive } from \"@tamagui/portal\";\nimport { RemoveScroll } from \"@tamagui/remove-scroll\";\nimport { RovingFocusGroup } from \"@tamagui/roving-focus\";\nimport { useCallbackRef } from \"@tamagui/use-callback-ref\";\nimport { useDirection } from \"@tamagui/use-direction\";\nimport {\n composeEventHandlers,\n composeRefs,\n createStyledContext,\n isWeb,\n styled,\n Text,\n Theme,\n useComposedRefs,\n useIsTouchDevice,\n useThemeName,\n View,\n withStaticProperties\n} from \"@tamagui/web\";\nimport * as React from \"react\";\nimport { useId } from \"react\";\nimport { Fragment, jsx, jsxs } from \"react/jsx-runtime\";\nfunction whenMouse(handler) {\n return (event) => event.pointerType === \"mouse\" ? handler(event) : void 0;\n}\nconst SELECTION_KEYS = [\"Enter\", \" \"];\nconst FIRST_KEYS = [\"ArrowDown\", \"PageUp\", \"Home\"];\nconst LAST_KEYS = [\"ArrowUp\", \"PageDown\", \"End\"];\nconst FIRST_LAST_KEYS = [...FIRST_KEYS, ...LAST_KEYS];\nconst SUB_OPEN_KEYS = {\n ltr: [...SELECTION_KEYS, \"ArrowRight\"],\n rtl: [...SELECTION_KEYS, \"ArrowLeft\"]\n};\nconst SUB_CLOSE_KEYS = {\n ltr: [\"ArrowLeft\"],\n rtl: [\"ArrowRight\"]\n};\nconst MENU_NAME = \"Menu\";\nconst [Collection, useCollection] = createCollection(MENU_NAME);\nconst { Provider: MenuProvider, useStyledContext: useMenuContext } = createStyledContext();\nconst { Provider: MenuRootProvider, useStyledContext: useMenuRootContext } = createStyledContext();\nconst MENU_CONTEXT = \"MenuContext\";\nconst MenuImageFrame = styled(TamaguiImage, {\n displayName: \"MenuItemImage\"\n});\nfunction createBaseMenu() {\n const MenuComp = (props) => {\n const direction = useDirection(props.dir);\n const defaultPlacement = direction === \"rtl\" ? \"bottom-end\" : \"bottom-start\";\n const {\n scope = MENU_CONTEXT,\n open = false,\n children,\n dir,\n onOpenChange,\n modal = true,\n allowFlip = { padding: 10 },\n stayInFrame = { padding: 10 },\n placement = defaultPlacement,\n resize = true,\n offset = 10,\n ...rest\n } = props;\n const [content, setContent] = React.useState(null);\n const isUsingKeyboardRef = React.useRef(false);\n const handleOpenChange = useCallbackRef(onOpenChange);\n if (isWeb) {\n React.useEffect(() => {\n const handleKeyDown = () => {\n isUsingKeyboardRef.current = true;\n document.addEventListener(\"pointerdown\", handlePointer, {\n capture: true,\n once: true\n });\n document.addEventListener(\"pointermove\", handlePointer, {\n capture: true,\n once: true\n });\n };\n const handlePointer = () => isUsingKeyboardRef.current = false;\n document.addEventListener(\"keydown\", handleKeyDown, { capture: true });\n return () => {\n document.removeEventListener(\"keydown\", handleKeyDown, { capture: true });\n document.removeEventListener(\"pointerdown\", handlePointer, { capture: true });\n document.removeEventListener(\"pointermove\", handlePointer, { capture: true });\n };\n }, []);\n }\n return /* @__PURE__ */ jsx(\n PopperPrimitive.Popper,\n {\n scope,\n open,\n placement,\n allowFlip,\n stayInFrame,\n resize,\n offset,\n ...rest,\n children: /* @__PURE__ */ jsx(\n MenuProvider,\n {\n scope,\n open,\n onOpenChange: handleOpenChange,\n content,\n onContentChange: setContent,\n children: /* @__PURE__ */ jsx(\n MenuRootProvider,\n {\n scope,\n open,\n onClose: React.useCallback(() => handleOpenChange(false), [handleOpenChange]),\n isUsingKeyboardRef,\n dir: direction,\n modal,\n children: /* @__PURE__ */ jsx(MenuSubProvider, { scope, children })\n }\n )\n }\n )\n }\n );\n };\n const RepropagateMenuAndMenuRootProvider = (props) => {\n const {\n scope = MENU_CONTEXT,\n menuContext,\n rootContext,\n popperContext,\n menuSubContext,\n children\n } = props;\n return /* @__PURE__ */ jsx(PopperPrimitive.PopperProvider, { ...popperContext, scope, children: /* @__PURE__ */ jsx(MenuProvider, { scope, ...menuContext, children: /* @__PURE__ */ jsx(MenuRootProvider, { scope, ...rootContext, children: menuSubContext ? /* @__PURE__ */ jsx(MenuSubProvider, { scope, ...menuSubContext, children }) : children }) }) });\n };\n MenuComp.displayName = MENU_NAME;\n const ANCHOR_NAME = \"MenuAnchor\";\n const MenuAnchor = (props) => {\n return /* @__PURE__ */ jsx(PopperPrimitive.PopperAnchor, { scope: MENU_CONTEXT, ...props });\n };\n MenuAnchor.displayName = ANCHOR_NAME;\n const PORTAL_NAME = \"MenuPortal\";\n const { Provider: PortalProvider, useStyledContext: usePortalContext } = createStyledContext(void 0, \"Portal\");\n const MenuPortal = (props) => {\n const { scope = MENU_CONTEXT, forceMount, zIndex, children } = props;\n const menuContext = useMenuContext(scope);\n const rootContext = useMenuRootContext(scope);\n const popperContext = PopperPrimitive.usePopperContext(scope);\n const menuSubContext = useMenuSubContext(scope);\n const themeName = useThemeName();\n const themedChildren = /* @__PURE__ */ jsx(Theme, { forceClassName: true, name: themeName, children });\n const content = needsPortalRepropagation() ? /* @__PURE__ */ jsx(\n RepropagateMenuAndMenuRootProvider,\n {\n menuContext,\n rootContext,\n popperContext,\n menuSubContext,\n scope,\n children: themedChildren\n }\n ) : themedChildren;\n const isPresent = forceMount || rootContext.open && menuContext.open;\n return /* @__PURE__ */ jsx(Animate, { type: \"presence\", present: isPresent, children: /* @__PURE__ */ jsx(PortalPrimitive, { stackZIndex: true, children: /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(PortalProvider, { scope, forceMount, children: /* @__PURE__ */ jsxs(View, { zIndex: zIndex || 100, inset: 0, position: \"absolute\", children: [\n !!menuContext.open && !isWeb && /* @__PURE__ */ jsx(\n View,\n {\n inset: 0,\n position: \"absolute\",\n onPress: () => menuContext.onOpenChange(!menuContext.open)\n }\n ),\n content\n ] }) }) }) }) });\n };\n MenuPortal.displayName = PORTAL_NAME;\n const CONTENT_NAME = \"MenuContent\";\n const { Provider: MenuContentProvider, useStyledContext: useMenuContentContext } = createStyledContext();\n const MenuContentFrame = styled(PopperPrimitive.PopperContentFrame, {\n displayName: CONTENT_NAME\n });\n const MenuContent = createStyledHOC(\n MenuContentFrame,\n (props, forwardedRef) => {\n const scope = props.scope || MENU_CONTEXT;\n const portalContext = usePortalContext(scope);\n const { forceMount = portalContext.forceMount, ...contentProps } = props;\n const rootContext = useMenuRootContext(scope);\n return /* @__PURE__ */ jsx(Collection.Provider, { scope, children: /* @__PURE__ */ jsx(Collection.Slot, { scope, children: rootContext.modal ? /* @__PURE__ */ jsx(MenuRootContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsx(MenuRootContentNonModal, { ...contentProps, ref: forwardedRef }) }) });\n }\n );\n const MenuRootContentModal = createRefComponent((props, forwardedRef) => {\n const scope = props.scope || MENU_CONTEXT;\n const context = useMenuContext(scope);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n return /* @__PURE__ */ jsx(\n MenuContentImpl,\n {\n ...props,\n scope,\n ref: composedRefs,\n trapFocus: context.open,\n disableOutsidePointerEvents: context.open,\n disableOutsideScroll: false,\n onFocusOutside: composeEventHandlers(\n props.onFocusOutside,\n (event) => event.cancel(),\n { checkDefaultPrevented: false }\n ),\n onDismiss: () => context.onOpenChange(false)\n }\n );\n });\n const MenuRootContentNonModal = createRefComponent((props, forwardedRef) => {\n const scope = props.scope || MENU_CONTEXT;\n const context = useMenuContext(scope);\n return /* @__PURE__ */ jsx(\n MenuContentImpl,\n {\n ...props,\n scope,\n ref: forwardedRef,\n trapFocus: false,\n disableOutsidePointerEvents: false,\n disableOutsideScroll: false,\n onDismiss: () => context.onOpenChange(false)\n }\n );\n });\n const MenuContentImpl = createRefComponent((props, forwardedRef) => {\n const {\n scope = MENU_CONTEXT,\n loop = false,\n trapFocus,\n onOpenAutoFocus,\n onCloseAutoFocus,\n disableOutsidePointerEvents,\n onEntryFocus,\n onEscapeKeyDown,\n onPointerDownOutside,\n onFocusOutside,\n onInteractOutside,\n onDismiss,\n disableOutsideScroll,\n disableDismissOnScroll = false,\n ...contentProps\n } = props;\n const context = useMenuContext(scope);\n const rootContext = useMenuRootContext(scope);\n const popperContext = PopperPrimitive.usePopperContext(scope);\n const getItems = useCollection(scope);\n const [currentItemId, setCurrentItemId] = React.useState(null);\n const contentRef = React.useRef(null);\n const focusableContentRef = React.useRef(null);\n const composedRefs = useComposedRefs(\n forwardedRef,\n contentRef,\n context.onContentChange\n );\n const timerRef = React.useRef(0);\n const searchRef = React.useRef(\"\");\n const pointerGraceTimerRef = React.useRef(0);\n const pointerGraceIntentRef = React.useRef(null);\n const pointerDirRef = React.useRef(\"right\");\n const lastPointerXRef = React.useRef(0);\n const handleTypeaheadSearch = (key) => {\n const search = searchRef.current + key;\n const items = getItems().filter((item) => !item.disabled);\n const currentItem = document.activeElement;\n const currentMatch = items.find(\n (item) => item.ref.current === currentItem\n )?.textValue;\n const values = items.map((item) => item.textValue);\n const nextMatch = getNextMatch(values, search, currentMatch);\n const newItem = items.find((item) => item.textValue === nextMatch)?.ref.current;\n (function updateSearch(value) {\n searchRef.current = value;\n clearTimeout(timerRef.current);\n if (value !== \"\") timerRef.current = setTimeout(() => updateSearch(\"\"), 1e3);\n })(search);\n if (newItem) {\n setTimeout(() => newItem.focus());\n }\n };\n React.useEffect(() => {\n return () => clearTimeout(timerRef.current);\n }, []);\n React.useEffect(() => {\n if (!isWeb || !context.open) return;\n const frame = requestAnimationFrame(() => {\n const container = contentRef.current;\n const el = container?.querySelector(\"[data-tamagui-menu-content]\");\n if (el) focusableContentRef.current = el;\n });\n return () => cancelAnimationFrame(frame);\n }, [context.open]);\n React.useEffect(() => {\n if (!isWeb || disableDismissOnScroll || !context.open) return;\n const handleScroll = (event) => {\n const scrolled = event.target;\n if (!scrolled) return;\n const content2 = contentRef.current;\n if (content2?.contains(scrolled)) return;\n const reference = popperContext.refs?.reference?.current;\n const anchor = reference instanceof Element ? reference : reference?.contextElement ?? null;\n if (anchor && !scrolled.contains(anchor)) return;\n context.onOpenChange(false);\n };\n window.addEventListener(\"scroll\", handleScroll, { capture: true, passive: true });\n return () => {\n window.removeEventListener(\"scroll\", handleScroll, { capture: true });\n };\n }, [disableDismissOnScroll, context.open, context.onOpenChange, popperContext.refs]);\n if (isWeb) {\n useFocusGuards();\n }\n const isPointerMovingToSubmenu = React.useCallback((event) => {\n const isMovingTowards = pointerDirRef.current === pointerGraceIntentRef.current?.side;\n const inArea = isPointerInGraceArea(event, pointerGraceIntentRef.current?.area);\n return isMovingTowards && inArea;\n }, []);\n const content = /* @__PURE__ */ jsx(\n PopperPrimitive.PopperContent,\n {\n role: \"menu\",\n tabIndex: -1,\n \"aria-orientation\": \"vertical\",\n \"data-state\": getOpenState(context.open),\n \"data-tamagui-menu-content\": \"\",\n dir: rootContext.dir,\n scope: scope || MENU_CONTEXT,\n ...contentProps,\n ref: composedRefs,\n className: contentProps.transition ? void 0 : contentProps.className,\n ...isWeb ? {\n onKeyDown: composeEventHandlers(contentProps.onKeyDown, (event) => {\n const target = event.target;\n const isKeyDownInside = target.closest(\"[data-tamagui-menu-content]\") === event.currentTarget;\n const isModifierKey = event.ctrlKey || event.altKey || event.metaKey;\n const isCharacterKey = event.key.length === 1;\n if (isKeyDownInside) {\n if (event.key === \"Tab\") event.preventDefault();\n if (!isModifierKey && isCharacterKey) handleTypeaheadSearch(event.key);\n }\n const isOnContentFrame = event.target.hasAttribute(\n \"data-tamagui-menu-content\"\n );\n if (!isKeyDownInside || !isOnContentFrame) return;\n if (!FIRST_LAST_KEYS.includes(event.key)) return;\n event.preventDefault();\n const items = getItems().filter((item) => !item.disabled);\n const candidateNodes = items.map((item) => item.ref.current);\n if (LAST_KEYS.includes(event.key)) candidateNodes.reverse();\n focusFirst(candidateNodes, { focusVisible: true });\n }),\n // TODO\n // @ts-ignore\n onBlur: composeEventHandlers(props.onBlur, (event) => {\n if (!event.currentTarget?.contains(event.target)) {\n clearTimeout(timerRef.current);\n searchRef.current = \"\";\n }\n }),\n // TODO\n onPointerMove: composeEventHandlers(props.onPointerMove, (event) => {\n if (event.pointerType !== \"mouse\") return;\n const target = event.target;\n const pointerXHasChanged = lastPointerXRef.current !== event.clientX;\n if (event.currentTarget?.contains(target) && pointerXHasChanged) {\n const newDir = event.clientX > lastPointerXRef.current ? \"right\" : \"left\";\n pointerDirRef.current = newDir;\n lastPointerXRef.current = event.clientX;\n }\n })\n } : {}\n }\n );\n return /* @__PURE__ */ jsx(\n MenuContentProvider,\n {\n scope,\n searchRef,\n onItemEnter: React.useCallback(\n (event) => {\n if (isPointerMovingToSubmenu(event)) event.preventDefault();\n },\n [isPointerMovingToSubmenu]\n ),\n onItemLeave: React.useCallback(\n (event) => {\n if (isPointerMovingToSubmenu(event)) return;\n focusableContentRef.current?.focus();\n setCurrentItemId(null);\n },\n [isPointerMovingToSubmenu]\n ),\n onTriggerLeave: React.useCallback(\n (event) => {\n if (isPointerMovingToSubmenu(event)) event.preventDefault();\n },\n [isPointerMovingToSubmenu]\n ),\n pointerGraceTimerRef,\n onPointerGraceIntentChange: React.useCallback((intent) => {\n pointerGraceIntentRef.current = intent;\n }, []),\n children: /* @__PURE__ */ jsx(RemoveScroll, { enabled: disableOutsideScroll, children: /* @__PURE__ */ jsx(\n FocusScope,\n {\n asChild: false,\n trapped: trapFocus,\n onMountAutoFocus: composeEventHandlers(onOpenAutoFocus, (event) => {\n event.cancel();\n const content2 = document.querySelector(\n \"[data-tamagui-menu-content]\"\n );\n content2?.focus({ preventScroll: true });\n }),\n onUnmountAutoFocus: onCloseAutoFocus,\n children: /* @__PURE__ */ jsx(\n DismissableLayer,\n {\n disableOutsidePointerEvents,\n onEscapeKeyDown,\n onPointerDownOutside,\n onFocusOutside,\n onInteractOutside,\n onDismiss,\n asChild: true,\n children: /* @__PURE__ */ jsx(\n RovingFocusGroup,\n {\n asChild: true,\n __scopeRovingFocusGroup: scope || MENU_CONTEXT,\n dir: rootContext.dir,\n orientation: \"vertical\",\n loop,\n currentTabStopId: currentItemId,\n onCurrentTabStopIdChange: setCurrentItemId,\n onEntryFocus: composeEventHandlers(onEntryFocus, (event) => {\n if (!rootContext.isUsingKeyboardRef.current) {\n event.cancel();\n }\n }),\n children: content\n }\n )\n }\n )\n }\n ) })\n }\n );\n });\n MenuContent.displayName = CONTENT_NAME;\n const ITEM_NAME = \"MenuItem\";\n const ITEM_SELECT = \"menu.itemSelect\";\n const MenuItem = createStyledHOC(\n View,\n (props, forwardedRef) => {\n const {\n disabled = false,\n onSelect,\n preventCloseOnSelect,\n children,\n scope = MENU_CONTEXT,\n // filter out native-only props that shouldn't reach the DOM\n // @ts-ignore\n destructive,\n // @ts-ignore\n hidden,\n // @ts-ignore\n androidIconName,\n ...itemProps\n } = props;\n const ref = React.useRef(null);\n const rootContext = useMenuRootContext(scope);\n const contentContext = useMenuContentContext(scope);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const isPointerDownRef = React.useRef(false);\n const handleSelect = () => {\n const menuItem = ref.current;\n if (!disabled && menuItem) {\n if (isWeb) {\n const menuItemEl = menuItem;\n const itemSelectEvent = new CustomEvent(ITEM_SELECT, {\n bubbles: true,\n cancelable: true\n });\n menuItemEl.addEventListener(ITEM_SELECT, (event) => onSelect?.(event), {\n once: true\n });\n dispatchDiscreteCustomEvent(menuItemEl, itemSelectEvent);\n if (itemSelectEvent.defaultPrevented || preventCloseOnSelect) {\n isPointerDownRef.current = false;\n } else {\n rootContext.onClose();\n }\n } else {\n onSelect?.({ target: menuItem });\n isPointerDownRef.current = false;\n if (!preventCloseOnSelect) {\n rootContext.onClose();\n }\n }\n }\n };\n const content = typeof children === \"string\" ? /* @__PURE__ */ jsx(Text, { children }) : children;\n return /* @__PURE__ */ jsx(\n MenuItemImpl,\n {\n ...itemProps,\n scope,\n ref: composedRefs,\n disabled,\n onPress: composeEventHandlers(props.onPress, handleSelect),\n onPointerDown: (event) => {\n props.onPointerDown?.(event);\n isPointerDownRef.current = true;\n },\n onPointerUp: composeEventHandlers(props.onPointerUp, (event) => {\n if (isWeb) {\n if (!isPointerDownRef.current) event.currentTarget?.click();\n }\n }),\n ...isWeb ? {\n onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {\n const isTypingAhead = contentContext.searchRef.current !== \"\";\n if (disabled || isTypingAhead && event.key === \" \") return;\n if (SELECTION_KEYS.includes(event.key)) {\n event.currentTarget?.click();\n event.preventDefault();\n }\n })\n } : {},\n children: content\n }\n );\n }\n );\n const MenuItemImpl = createRefComponent((props, forwardedRef) => {\n const {\n scope = MENU_CONTEXT,\n className,\n disabled = false,\n textValue,\n ...itemProps\n } = props;\n const contentContext = useMenuContentContext(scope);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const [isFocused, setIsFocused] = React.useState(false);\n const [textContent, setTextContent] = React.useState(\"\");\n if (isWeb) {\n React.useEffect(() => {\n const menuItem = ref.current;\n if (menuItem) {\n setTextContent((menuItem.textContent ?? \"\").trim());\n }\n }, [itemProps.children]);\n }\n return /* @__PURE__ */ jsx(\n Collection.ItemSlot,\n {\n scope,\n disabled,\n textValue: textValue ?? textContent,\n children: /* @__PURE__ */ jsx(\n RovingFocusGroup.Item,\n {\n asChild: true,\n __scopeRovingFocusGroup: scope,\n tabIndex: disabled ? -1 : 0,\n children: /* @__PURE__ */ jsx(\n View,\n {\n className: `is_${ITEM_NAME} ${className || \"\"}`.trim(),\n role: \"menuitem\",\n \"data-highlighted\": isFocused ? \"\" : void 0,\n \"aria-disabled\": disabled || void 0,\n \"data-disabled\": disabled ? \"\" : void 0,\n ...itemProps,\n ref: composedRefs,\n onPointerMove: composeEventHandlers(props.onPointerMove, (event) => {\n if (event.pointerType !== \"mouse\") return;\n if (disabled) {\n contentContext.onItemLeave(event);\n } else {\n contentContext.onItemEnter(event);\n if (!event.defaultPrevented) {\n const item = event.currentTarget;\n item.focus({ preventScroll: true, focusVisible: false });\n }\n }\n }),\n onPointerLeave: composeEventHandlers(props.onPointerLeave, (event) => {\n contentContext.onItemLeave(event);\n }),\n onFocus: composeEventHandlers(props.onFocus, () => setIsFocused(true)),\n onBlur: composeEventHandlers(props.onBlur, () => setIsFocused(false))\n }\n )\n }\n )\n }\n );\n });\n MenuItem.displayName = ITEM_NAME;\n const ITEM_TITLE_NAME = \"MenuItemTitle\";\n const MenuItemTitle = createStyledHOC(\n Text,\n (props, forwardedRef) => {\n return /* @__PURE__ */ jsx(Text, { ...props, ref: forwardedRef });\n }\n );\n MenuItemTitle.displayName = ITEM_TITLE_NAME;\n const ITEM_SUB_TITLE_NAME = \"MenuItemSubTitle\";\n const MenuItemSubTitle = createStyledHOC(\n Text,\n (props, forwardedRef) => {\n return /* @__PURE__ */ jsx(Text, { ...props, ref: forwardedRef });\n }\n );\n MenuItemSubTitle.displayName = ITEM_SUB_TITLE_NAME;\n const ITEM_IMAGE = \"MenuItemImage\";\n const MenuItemImage = createRefComponent(\n (props, forwardedRef) => {\n const {\n // @ts-ignore - native menu ios config\n ios,\n // @ts-ignore\n androidIconName,\n ...rest\n } = props;\n return /* @__PURE__ */ jsx(MenuImageFrame, { ...rest, ref: forwardedRef });\n }\n );\n MenuItemImage.displayName = ITEM_IMAGE;\n const ITEM_ICON = \"MenuItemIcon\";\n const MenuItemIcon = createStyledHOC(View, (props, forwardedRef) => {\n const {\n // @ts-ignore\n ios,\n // @ts-ignore\n android,\n // @ts-ignore\n androidIconName,\n ...rest\n } = props;\n return /* @__PURE__ */ jsx(View, { ...rest, ref: forwardedRef });\n });\n MenuItemIcon.displayName = ITEM_ICON;\n const CHECKBOX_ITEM_NAME = \"MenuCheckboxItem\";\n const MenuCheckboxItem = createStyledHOC(\n View,\n (props, forwardedRef) => {\n const {\n checked = false,\n onCheckedChange,\n scope = MENU_CONTEXT,\n // filter out native-only props\n // @ts-ignore - native menu value state\n value,\n // @ts-ignore - native menu value change handler\n onValueChange,\n className,\n ...checkboxItemProps\n } = props;\n return /* @__PURE__ */ jsx(ItemIndicatorProvider, { scope, checked, children: /* @__PURE__ */ jsx(\n MenuItem,\n {\n className: `is_${CHECKBOX_ITEM_NAME} ${className || \"\"}`.trim(),\n role: isWeb ? \"menuitemcheckbox\" : \"menuitem\",\n \"aria-checked\": isIndeterminate(checked) ? \"mixed\" : checked,\n ...checkboxItemProps,\n scope,\n ref: forwardedRef,\n \"data-state\": getCheckedState(checked),\n onSelect: composeEventHandlers(\n checkboxItemProps.onSelect,\n () => onCheckedChange?.(isIndeterminate(checked) ? true : !checked),\n { checkDefaultPrevented: false }\n )\n }\n ) });\n }\n );\n MenuCheckboxItem.displayName = CHECKBOX_ITEM_NAME;\n const RADIO_GROUP_NAME = \"MenuRadioGroup\";\n const { Provider: RadioGroupProvider, useStyledContext: useRadioGroupContext } = createStyledContext();\n const MenuRadioGroup = createStyledHOC(\n View,\n (props, forwardedRef) => {\n const {\n value,\n onValueChange,\n scope = MENU_CONTEXT,\n className,\n ...groupProps\n } = props;\n const handleValueChange = useCallbackRef(onValueChange);\n return /* @__PURE__ */ jsx(RadioGroupProvider, { scope, value, onValueChange: handleValueChange, children: /* @__PURE__ */ jsx(\n View,\n {\n className: `is_${RADIO_GROUP_NAME} ${className || \"\"}`.trim(),\n ...groupProps,\n ref: forwardedRef\n }\n ) });\n }\n );\n MenuRadioGroup.displayName = RADIO_GROUP_NAME;\n const RADIO_ITEM_NAME = \"MenuRadioItem\";\n const MenuRadioItem = createStyledHOC(\n View,\n (props, forwardedRef) => {\n const { value, scope = MENU_CONTEXT, className, ...radioItemProps } = props;\n const context = useRadioGroupContext(scope);\n const checked = value === context.value;\n return /* @__PURE__ */ jsx(ItemIndicatorProvider, { scope, checked, children: /* @__PURE__ */ jsx(\n MenuItem,\n {\n className: `is_${RADIO_ITEM_NAME} ${className || \"\"}`.trim(),\n ...radioItemProps,\n scope,\n \"aria-checked\": checked,\n ref: forwardedRef,\n role: isWeb ? \"menuitemradio\" : \"menuitem\",\n \"data-state\": getCheckedState(checked),\n onSelect: composeEventHandlers(\n radioItemProps.onSelect,\n () => context.onValueChange?.(value),\n { checkDefaultPrevented: false }\n )\n }\n ) });\n }\n );\n MenuRadioItem.displayName = RADIO_ITEM_NAME;\n const ITEM_INDICATOR_NAME = \"MenuItemIndicator\";\n const { Provider: ItemIndicatorProvider, useStyledContext: useItemIndicatorContext } = createStyledContext();\n const MenuItemIndicator = createStyledHOC(\n View,\n (props, forwardedRef) => {\n const { scope = MENU_CONTEXT, className, forceMount, ...itemIndicatorProps } = props;\n const indicatorContext = useItemIndicatorContext(scope);\n return /* @__PURE__ */ jsx(Presence, { children: forceMount || isIndeterminate(indicatorContext.checked) || indicatorContext.checked === true ? /* @__PURE__ */ jsx(\n View,\n {\n className: `is_${ITEM_INDICATOR_NAME} ${className || \"\"}`.trim(),\n render: \"span\",\n ...itemIndicatorProps,\n ref: forwardedRef,\n \"data-state\": getCheckedState(indicatorContext.checked)\n }\n ) : null });\n }\n );\n MenuItemIndicator.displayName = ITEM_INDICATOR_NAME;\n const MenuArrow = createRefComponent(\n function MenuArrow2(props, forwardedRef) {\n const { scope = MENU_CONTEXT, className, ...rest } = props;\n return /* @__PURE__ */ jsx(\n PopperPrimitive.PopperArrow,\n {\n scope,\n className: `is_PopperArrow ${className || \"\"}`.trim(),\n ...rest,\n ref: forwardedRef\n }\n );\n }\n );\n const SUB_NAME = \"MenuSub\";\n const { Provider: MenuSubProvider, useStyledContext: useMenuSubContext } = createStyledContext();\n const MenuSub = (props) => {\n const isTouchDevice = useIsTouchDevice();\n const { scope = MENU_CONTEXT } = props;\n const rootContext = useMenuRootContext(scope);\n const parentPopperContext = PopperPrimitive.usePopperContext(scope);\n const parentSide = parentPopperContext.placement?.split(\"-\")[0];\n const isNestedSubmenu = parentSide === \"left\" || parentSide === \"right\";\n const defaultPlacement = isTouchDevice ? \"bottom\" : isNestedSubmenu ? `${parentSide}-start` : rootContext.dir === \"rtl\" ? \"left-start\" : \"right-start\";\n const {\n children,\n open = false,\n onOpenChange,\n allowFlip: allowFlipProp = { padding: 10 },\n stayInFrame = { padding: 10 },\n placement = defaultPlacement,\n ...rest\n } = props;\n const allowFlip = React.useMemo(() => {\n if (!isNestedSubmenu || typeof allowFlipProp === \"boolean\") return allowFlipProp;\n if (allowFlipProp.fallbackPlacements) return allowFlipProp;\n const side = placement.split(\"-\")[0];\n const align = placement.split(\"-\")[1] || \"start\";\n const otherAlign = align === \"start\" ? \"end\" : \"start\";\n if (side === \"left\" || side === \"right\") {\n const oppositeSide = side === \"right\" ? \"left\" : \"right\";\n return {\n ...typeof allowFlipProp === \"object\" ? allowFlipProp : {},\n fallbackPlacements: [\n `${side}-${otherAlign}`,\n `${oppositeSide}-${align}`,\n `${oppositeSide}-${otherAlign}`\n ]\n };\n }\n return allowFlipProp;\n }, [isNestedSubmenu, allowFlipProp, placement]);\n const parentMenuContext = useMenuContext(scope);\n const [trigger, setTrigger] = React.useState(null);\n const [content, setContent] = React.useState(null);\n const handleOpenChange = useCallbackRef(onOpenChange);\n React.useEffect(() => {\n if (parentMenuContext.open === false) handleOpenChange(false);\n return () => handleOpenChange(false);\n }, [parentMenuContext.open, handleOpenChange]);\n return /* @__PURE__ */ jsx(\n PopperPrimitive.Popper,\n {\n open,\n placement,\n allowFlip,\n stayInFrame,\n ...rest,\n scope,\n children: /* @__PURE__ */ jsx(\n MenuProvider,\n {\n scope,\n open,\n onOpenChange: handleOpenChange,\n content,\n onContentChange: setContent,\n children: /* @__PURE__ */ jsx(\n MenuSubProvider,\n {\n scope,\n contentId: useId(),\n triggerId: useId(),\n trigger,\n onTriggerChange: setTrigger,\n children\n }\n )\n }\n )\n }\n );\n };\n MenuSub.displayName = SUB_NAME;\n const SUB_TRIGGER_NAME = \"MenuSubTrigger\";\n const MenuSubTrigger = createRefComponent((props, forwardedRef) => {\n const scope = props.scope || MENU_CONTEXT;\n const context = useMenuContext(scope);\n const rootContext = useMenuRootContext(scope);\n const subContext = useMenuSubContext(scope);\n const contentContext = useMenuContentContext(scope);\n const popperContext = PopperPrimitive.usePopperContext(scope);\n const openTimerRef = React.useRef(null);\n const { pointerGraceTimerRef, onPointerGraceIntentChange } = contentContext;\n const effectiveDir = rootContext.dir;\n const clearOpenTimer = React.useCallback(() => {\n if (openTimerRef.current) window.clearTimeout(openTimerRef.current);\n openTimerRef.current = null;\n }, []);\n React.useEffect(() => clearOpenTimer, [clearOpenTimer]);\n React.useEffect(() => {\n const pointerGraceTimer = pointerGraceTimerRef.current;\n return () => {\n window.clearTimeout(pointerGraceTimer);\n onPointerGraceIntentChange(null);\n };\n }, [pointerGraceTimerRef, onPointerGraceIntentChange]);\n return /* @__PURE__ */ jsx(\n MenuAnchor,\n {\n className: `is_${SUB_TRIGGER_NAME}`,\n asChild: \"except-style\",\n scope,\n children: /* @__PURE__ */ jsx(\n MenuItemImpl,\n {\n id: subContext.triggerId,\n \"aria-haspopup\": \"menu\",\n \"aria-expanded\": context.open,\n \"aria-controls\": subContext.contentId,\n \"data-state\": getOpenState(context.open),\n ...props,\n ref: composeRefs(forwardedRef, subContext.onTriggerChange),\n onPress: (event) => {\n props.onPress?.(event);\n if (props.disabled || event.defaultPrevented) return;\n if (isWeb) {\n event.currentTarget.focus();\n }\n if (!context.open) context.onOpenChange(true);\n },\n onPointerMove: composeEventHandlers(\n props.onPointerMove,\n // @ts-ignore\n whenMouse((event) => {\n contentContext.onItemEnter(event);\n if (event.defaultPrevented) return;\n if (!props.disabled && !context.open && !openTimerRef.current) {\n contentContext.onPointerGraceIntentChange(null);\n openTimerRef.current = window.setTimeout(() => {\n context.onOpenChange(true);\n clearOpenTimer();\n }, 100);\n }\n })\n ),\n onPointerLeave: composeEventHandlers(props.onPointerLeave, (eventIn) => {\n const event = eventIn;\n clearOpenTimer();\n const contentRect = context.content?.getBoundingClientRect();\n if (contentRect) {\n const contentEl = context.content;\n const sideEl = contentEl?.dataset?.side ? contentEl : contentEl?.querySelector(\"[data-side]\");\n const side = sideEl?.dataset?.side || \"right\";\n const rightSide = side === \"right\";\n const bleed = rightSide ? -5 : 5;\n const contentNearEdge = contentRect[rightSide ? \"left\" : \"right\"];\n const contentFarEdge = contentRect[rightSide ? \"right\" : \"left\"];\n const polygon = {\n area: [\n // Apply a bleed on clientX to ensure that our exit point is\n // consistently within polygon bounds\n { x: event.clientX + bleed, y: event.clientY },\n { x: contentNearEdge, y: contentRect.top },\n { x: contentFarEdge, y: contentRect.top },\n { x: contentFarEdge, y: contentRect.bottom },\n { x: contentNearEdge, y: contentRect.bottom }\n ],\n side\n };\n contentContext.onPointerGraceIntentChange(polygon);\n window.clearTimeout(pointerGraceTimerRef.current);\n pointerGraceTimerRef.current = window.setTimeout(\n () => contentContext.onPointerGraceIntentChange(null),\n 300\n );\n } else if (isWeb && subContext.trigger) {\n const triggerEl = subContext.trigger;\n const triggerRect = triggerEl?.getBoundingClientRect();\n if (triggerRect) {\n const placementSide = popperContext.placement?.split(\"-\")[0];\n const side = placementSide === \"left\" || placementSide === \"right\" ? placementSide : rootContext.dir === \"rtl\" ? \"left\" : \"right\";\n const rightSide = side === \"right\";\n const bleed = rightSide ? -5 : 5;\n const nearEdge = rightSide ? triggerRect.right + 4 : triggerRect.left - 4;\n const farEdge = rightSide ? nearEdge + 200 : nearEdge - 200;\n const polygon = {\n area: [\n { x: event.clientX + bleed, y: event.clientY },\n { x: nearEdge, y: triggerRect.top - 50 },\n { x: farEdge, y: triggerRect.top - 50 },\n { x: farEdge, y: triggerRect.bottom + 50 },\n { x: nearEdge, y: triggerRect.bottom + 50 }\n ],\n side\n };\n contentContext.onPointerGraceIntentChange(polygon);\n window.clearTimeout(pointerGraceTimerRef.current);\n pointerGraceTimerRef.current = window.setTimeout(\n () => contentContext.onPointerGraceIntentChange(null),\n 300\n );\n }\n } else {\n contentContext.onTriggerLeave(event);\n if (event.defaultPrevented) return;\n contentContext.onPointerGraceIntentChange(null);\n }\n }),\n ...isWeb ? {\n onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {\n const isTypingAhead = contentContext.searchRef.current !== \"\";\n if (props.disabled || isTypingAhead && event.key === \" \") return;\n const willOpen = SUB_OPEN_KEYS[effectiveDir].includes(event.key);\n if (willOpen) {\n if (context.open && context.content) {\n const contentEl = context.content;\n const firstItem = contentEl.querySelector?.(\n '[role=\"menuitem\"]:not([data-disabled])'\n );\n if (firstItem) {\n firstItem.focus({ focusVisible: true });\n event.preventDefault();\n return;\n }\n }\n const triggerEl = event.currentTarget;\n popperContext.refs?.setReference(triggerEl);\n context.onOpenChange(true);\n requestAnimationFrame(() => {\n popperContext.update?.();\n });\n context.content?.focus({ focusVisible: true });\n event.preventDefault();\n }\n })\n } : null\n }\n )\n }\n );\n });\n MenuSubTrigger.displayName = SUB_TRIGGER_NAME;\n const SUB_CONTENT_NAME = \"MenuSubContent\";\n const MenuSubContentFrame = styled(PopperPrimitive.PopperContentFrame, {\n displayName: SUB_CONTENT_NAME\n });\n const MenuSubContent = createStyledHOC(\n MenuSubContentFrame,\n (props, forwardedRef) => {\n const scope = props.scope || MENU_CONTEXT;\n const portalContext = usePortalContext(scope);\n const { forceMount = portalContext.forceMount, ...subContentProps } = props;\n const context = useMenuContext(scope);\n const rootContext = useMenuRootContext(scope);\n const subContext = useMenuSubContext(scope);\n const popperContext = PopperPrimitive.usePopperContext(scope);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const placementSide = popperContext.placement?.split(\"-\")[0];\n const dataSide = placementSide === \"left\" || placementSide === \"right\" ? placementSide : rootContext.dir === \"rtl\" ? \"left\" : \"right\";\n const effectiveDir = rootContext.dir;\n return /* @__PURE__ */ jsx(Collection.Provider, { scope, children: /* @__PURE__ */ jsx(Collection.Slot, { scope, children: /* @__PURE__ */ jsx(\n MenuContentImpl,\n {\n id: subContext.contentId,\n \"aria-labelledby\": subContext.triggerId,\n ...subContentProps,\n ref: composedRefs,\n \"data-side\": dataSide,\n disableOutsidePointerEvents: false,\n disableOutsideScroll: false,\n trapFocus: false,\n onOpenAutoFocus: (event) => {\n if (rootContext.isUsingKeyboardRef.current) {\n const root = ref.current;\n const content = root?.querySelector?.(\n \"[data-tamagui-menu-content]\"\n );\n (content || root)?.focus({ preventScroll: true });\n }\n event.cancel();\n },\n onCloseAutoFocus: (event) => event.cancel(),\n onFocusOutside: composeEventHandlers(props.onFocusOutside, (event) => {\n if (event.event?.target !== subContext.trigger)\n context.onOpenChange(false);\n }),\n onEscapeKeyDown: composeEventHandlers(props.onEscapeKeyDown, (event) => {\n context.onOpenChange(false);\n subContext.trigger?.focus({ focusVisible: true });\n event.cancel();\n event.event?.preventDefault?.();\n }),\n ...isWeb ? {\n onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {\n const isKeyDownInside = event.currentTarget.contains(\n event.target\n );\n const isCloseKey = SUB_CLOSE_KEYS[effectiveDir].includes(event.key);\n if (isKeyDownInside && isCloseKey) {\n context.onOpenChange(false);\n subContext.trigger?.focus({ focusVisible: true });\n event.preventDefault();\n }\n })\n } : null\n }\n ) }) });\n }\n );\n MenuSubContent.displayName = SUB_CONTENT_NAME;\n const Anchor = MenuAnchor;\n const Portal = MenuPortal;\n const Content = MenuContent;\n const Group = createStyledHOC(View, (props, ref) => {\n return /* @__PURE__ */ jsx(View, { role: \"group\", ...props, ref });\n });\n Group.displayName = \"MenuGroup\";\n const Label = createStyledHOC(Text, (props, ref) => {\n return /* @__PURE__ */ jsx(Text, { ...props, ref });\n });\n Label.displayName = \"MenuLabel\";\n const Item = MenuItem;\n const CheckboxItem = MenuCheckboxItem;\n const RadioGroup = MenuRadioGroup;\n const RadioItem = MenuRadioItem;\n const ItemIndicator = MenuItemIndicator;\n const Separator = createStyledHOC(View, (props, ref) => {\n return /* @__PURE__ */ jsx(View, { role: \"separator\", \"aria-orientation\": \"horizontal\", ...props, ref });\n });\n Separator.displayName = \"MenuSeparator\";\n const Arrow = MenuArrow;\n const Sub = MenuSub;\n const SubTrigger = MenuSubTrigger;\n const SubContent = MenuSubContent;\n const ItemTitle = MenuItemTitle;\n const ItemSubtitle = MenuItemSubTitle;\n const ItemImage = MenuItemImage;\n const ItemIcon = MenuItemIcon;\n const Menu = withStaticProperties(MenuComp, {\n Anchor,\n Portal,\n Content,\n Group,\n Label,\n Item,\n CheckboxItem,\n RadioGroup,\n RadioItem,\n ItemIndicator,\n Separator,\n Arrow,\n Sub,\n SubTrigger,\n SubContent,\n ItemTitle,\n ItemSubtitle,\n ItemImage,\n ItemIcon\n });\n return {\n Menu\n };\n}\nfunction getOpenState(open) {\n return open ? \"open\" : \"closed\";\n}\nfunction isIndeterminate(checked) {\n return checked === \"indeterminate\";\n}\nfunction getCheckedState(checked) {\n return isIndeterminate(checked) ? \"indeterminate\" : checked ? \"checked\" : \"unchecked\";\n}\nfunction focusFirst(candidates, options) {\n const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;\n for (const candidate of candidates) {\n if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return;\n candidate.focus({ preventScroll: true, focusVisible: options?.focusVisible });\n if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return;\n }\n}\nfunction wrapArray(array, startIndex) {\n return array.map((_, index) => array[(startIndex + index) % array.length]);\n}\nfunction getNextMatch(values, search, currentMatch) {\n const isRepeated = search.length > 1 && Array.from(search).every((char) => char === search[0]);\n const normalizedSearch = isRepeated ? search[0] : search;\n const currentMatchIndex = currentMatch ? values.indexOf(currentMatch) : -1;\n let wrappedValues = wrapArray(values, Math.max(currentMatchIndex, 0));\n const excludeCurrentMatch = normalizedSearch.length === 1;\n if (excludeCurrentMatch) wrappedValues = wrappedValues.filter((v) => v !== currentMatch);\n const nextMatch = wrappedValues.find(\n (value) => value.toLowerCase().startsWith(normalizedSearch.toLowerCase())\n );\n return nextMatch !== currentMatch ? nextMatch : void 0;\n}\nfunction isPointInPolygon(point, polygon) {\n const { x, y } = point;\n let inside = false;\n for (let i = 0, j = polygon.length - 1; i < polygon.length; j = i++) {\n const xi = polygon[i].x;\n const yi = polygon[i].y;\n const xj = polygon[j].x;\n const yj = polygon[j].y;\n const intersect = yi > y !== yj > y && x < (xj - xi) * (y - yi) / (yj - yi) + xi;\n if (intersect) inside = !inside;\n }\n return inside;\n}\nfunction isPointerInGraceArea(event, area) {\n if (!area) return false;\n const cursorPos = { x: event.clientX, y: event.clientY };\n return isPointInPolygon(cursorPos, area);\n}\nexport {\n createBaseMenu\n};\n//# sourceMappingURL=createBaseMenu.js.map\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAkCA,SAAS,UAAU,SAAS;CAC1B,QAAQ,UAAU,MAAM,gBAAgB,UAAU,QAAQ,KAAK,IAAI,KAAK;AAC1E;AACA,MAAM,iBAAiB,CAAC,SAAS,GAAG;AACpC,MAAM,aAAa;CAAC;CAAa;CAAU;AAAM;AACjD,MAAM,YAAY;CAAC;CAAW;CAAY;AAAK;AAC/C,MAAM,kBAAkB,CAAC,GAAG,YAAY,GAAG,SAAS;AACpD,MAAM,gBAAgB;CACpB,KAAK,CAAC,GAAG,gBAAgB,YAAY;CACrC,KAAK,CAAC,GAAG,gBAAgB,WAAW;AACtC;AACA,MAAM,iBAAiB;CACrB,KAAK,CAAC,WAAW;CACjB,KAAK,CAAC,YAAY;AACpB;AACA,MAAM,YAAY;AAClB,MAAM,CAAC,YAAY,iBAAiB,iBAAiB,SAAS;AAC9D,MAAM,EAAE,UAAU,cAAc,kBAAkB,mBAAmB,oBAAoB;AACzF,MAAM,EAAE,UAAU,kBAAkB,kBAAkB,uBAAuB,oBAAoB;AACjG,MAAM,eAAe;AACrB,MAAM,iBAAiB,OAAOA,OAAc,EAC1C,aAAa,gBACf,CAAC;AACD,SAAS,iBAAiB;CACxB,MAAM,YAAY,UAAU;EAC1B,MAAM,YAAY,aAAa,MAAM,GAAG;EACxC,MAAM,mBAAmB,cAAc,QAAQ,eAAe;EAC9D,MAAM,EACJ,QAAQ,cACR,OAAO,OACP,UACA,KACA,cACA,QAAQ,MACR,YAAY,EAAE,SAAS,GAAG,GAC1B,cAAc,EAAE,SAAS,GAAG,GAC5B,YAAY,kBACZ,SAAS,MACT,SAAS,IACT,GAAG,SACD;EACJ,MAAM,CAAC,SAAS,cAAc,MAAM,SAAS,IA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AY,IAAI,CAAC;CACzE,IAAI,gBAAgB,UAAU,QAAQ,KAAK,IAAI,mBAAmB,CAAC,CAAC;CACpE,MAAM,sBAAsB,iBAAiB,WAAW;CACxD,IAAI,qBAAqB,gBAAgB,cAAc,QAAQ,MAAM,MAAM,YAAY;CACvF,MAAM,YAAY,cAAc,MAC7B,UAAU,MAAM,YAAY,EAAE,WAAW,iBAAiB,YAAY,CAAC,CAC1E;CACA,OAAO,cAAc,eAAe,YAAY,KAAK;AACvD;AACA,SAAS,iBAAiB,OAAO,SAAS;CACxC,MAAM,EAAE,GAAG,MAAM;CACjB,IAAI,SAAS;CACb,KAAK,IAAI,IAAI,GAAG,IAAI,QAAQ,SAAS,GAAG,IAAI,QAAQ,QAAQ,IAAI,KAAK;EACnE,MAAM,KAAK,QAAQ,GAAG;EACtB,MAAM,KAAK,QAAQ,GAAG;EACtB,MAAM,KAAK,QAAQ,GAAG;EACtB,MAAM,KAAK,QAAQ,GAAG;EACtB,MAAM,YAAY,KAAK,MAAM,KAAK,KAAK,KAAK,KAAK,OAAO,IAAI,OAAO,KAAK,MAAM;EAC9E,IAAI,WAAW,SAAS,CAAC;CAC3B;CACA,OAAO;AACT;AACA,SAAS,qBAAqB,OAAO,MAAM;CACzC,IAAI,CAAC,MAAM,OAAO;CAClB,MAAM,YAAY;EAAE,GAAG,MAAM;EAAS,GAAG,MAAM;CAAQ;CACvD,OAAO,iBAAiB,WAAW,IAAI;AACzC"}
|
|
1
|
+
{"version":3,"file":"createBaseMenu.js","names":["TamaguiImage","PortalPrimitive","DismissableLayer","Presence","Portal"],"sources":["jsx/createBaseMenu.js"],"sourcesContent":["import { createStyledHOC, createRefComponent } from \"@tamagui/core\";\nimport { Animate } from \"@tamagui/animate\";\nimport { AnimatePresence as Presence } from \"@tamagui/animate-presence\";\nimport { createCollection } from \"@tamagui/collection\";\nimport {\n Dismissable as DismissableLayer,\n dispatchDiscreteCustomEvent\n} from \"@tamagui/dismissable\";\nimport { useFocusGuards } from \"@tamagui/focus-guard\";\nimport { FocusScope } from \"@tamagui/focus-scope\";\nimport { Image as TamaguiImage } from \"@tamagui/image\";\nimport * as PopperPrimitive from \"@tamagui/popper\";\nimport { needsPortalRepropagation, Portal as PortalPrimitive } from \"@tamagui/portal\";\nimport { RemoveScroll } from \"@tamagui/remove-scroll\";\nimport { RovingFocusGroup } from \"@tamagui/roving-focus\";\nimport { useCallbackRef } from \"@tamagui/use-callback-ref\";\nimport { useDirection } from \"@tamagui/use-direction\";\nimport {\n composeEventHandlers,\n composeRefs,\n createStyledContext,\n isWeb,\n styled,\n Text,\n Theme,\n useComposedRefs,\n useIsTouchDevice,\n useThemeName,\n View,\n withStaticProperties\n} from \"@tamagui/web\";\nimport * as React from \"react\";\nimport { useId } from \"react\";\nimport { Fragment, jsx, jsxs } from \"react/jsx-runtime\";\nfunction whenMouse(handler) {\n return (event) => event.pointerType === \"mouse\" ? handler(event) : void 0;\n}\nconst SELECTION_KEYS = [\"Enter\", \" \"];\nconst FIRST_KEYS = [\"ArrowDown\", \"PageUp\", \"Home\"];\nconst LAST_KEYS = [\"ArrowUp\", \"PageDown\", \"End\"];\nconst FIRST_LAST_KEYS = [...FIRST_KEYS, ...LAST_KEYS];\nconst SUB_OPEN_KEYS = {\n ltr: [...SELECTION_KEYS, \"ArrowRight\"],\n rtl: [...SELECTION_KEYS, \"ArrowLeft\"]\n};\nconst SUB_CLOSE_KEYS = {\n ltr: [\"ArrowLeft\"],\n rtl: [\"ArrowRight\"]\n};\nconst MENU_NAME = \"Menu\";\nconst [Collection, useCollection] = createCollection(MENU_NAME);\nconst { Provider: MenuProvider, useStyledContext: useMenuContext } = createStyledContext();\nconst { Provider: MenuRootProvider, useStyledContext: useMenuRootContext } = createStyledContext();\nconst MENU_CONTEXT = \"MenuContext\";\nconst MenuImageFrame = styled(TamaguiImage, {\n displayName: \"MenuItemImage\"\n});\nfunction createBaseMenu() {\n const MenuComp = (props) => {\n const direction = useDirection(props.dir);\n const defaultPlacement = direction === \"rtl\" ? \"bottom-end\" : \"bottom-start\";\n const {\n scope = MENU_CONTEXT,\n open = false,\n children,\n dir,\n onOpenChange,\n modal = true,\n allowFlip = { padding: 10 },\n stayInFrame = { padding: 10 },\n placement = defaultPlacement,\n resize = true,\n offset = 10,\n ...rest\n } = props;\n const [content, setContent] = React.useState(null);\n const isUsingKeyboardRef = React.useRef(false);\n const handleOpenChange = useCallbackRef(onOpenChange);\n if (isWeb) {\n React.useEffect(() => {\n const handleKeyDown = () => {\n isUsingKeyboardRef.current = true;\n document.addEventListener(\"pointerdown\", handlePointer, {\n capture: true,\n once: true\n });\n document.addEventListener(\"pointermove\", handlePointer, {\n capture: true,\n once: true\n });\n };\n const handlePointer = () => isUsingKeyboardRef.current = false;\n document.addEventListener(\"keydown\", handleKeyDown, { capture: true });\n return () => {\n document.removeEventListener(\"keydown\", handleKeyDown, { capture: true });\n document.removeEventListener(\"pointerdown\", handlePointer, { capture: true });\n document.removeEventListener(\"pointermove\", handlePointer, { capture: true });\n };\n }, []);\n }\n return /* @__PURE__ */ jsx(\n PopperPrimitive.Popper,\n {\n scope,\n open,\n placement,\n allowFlip,\n stayInFrame,\n resize,\n offset,\n ...rest,\n children: /* @__PURE__ */ jsx(\n MenuProvider,\n {\n scope,\n open,\n onOpenChange: handleOpenChange,\n content,\n onContentChange: setContent,\n children: /* @__PURE__ */ jsx(\n MenuRootProvider,\n {\n scope,\n open,\n onClose: React.useCallback(() => handleOpenChange(false), [handleOpenChange]),\n isUsingKeyboardRef,\n dir: direction,\n modal,\n children: /* @__PURE__ */ jsx(MenuSubProvider, { scope, children })\n }\n )\n }\n )\n }\n );\n };\n const RepropagateMenuAndMenuRootProvider = (props) => {\n const {\n scope = MENU_CONTEXT,\n menuContext,\n rootContext,\n popperContext,\n menuSubContext,\n children\n } = props;\n return /* @__PURE__ */ jsx(PopperPrimitive.PopperProvider, { ...popperContext, scope, children: /* @__PURE__ */ jsx(MenuProvider, { scope, ...menuContext, children: /* @__PURE__ */ jsx(MenuRootProvider, { scope, ...rootContext, children: menuSubContext ? /* @__PURE__ */ jsx(MenuSubProvider, { scope, ...menuSubContext, children }) : children }) }) });\n };\n MenuComp.displayName = MENU_NAME;\n const ANCHOR_NAME = \"MenuAnchor\";\n const MenuAnchor = (props) => {\n return /* @__PURE__ */ jsx(PopperPrimitive.PopperAnchor, { scope: MENU_CONTEXT, ...props });\n };\n MenuAnchor.displayName = ANCHOR_NAME;\n const PORTAL_NAME = \"MenuPortal\";\n const { Provider: PortalProvider, useStyledContext: usePortalContext } = createStyledContext(void 0, \"Portal\");\n const MenuPortal = (props) => {\n const { scope = MENU_CONTEXT, forceMount, zIndex, children } = props;\n const menuContext = useMenuContext(scope);\n const rootContext = useMenuRootContext(scope);\n const popperContext = PopperPrimitive.usePopperContext(scope);\n const menuSubContext = useMenuSubContext(scope);\n const themeName = useThemeName();\n const themedChildren = /* @__PURE__ */ jsx(Theme, { forceClassName: true, name: themeName, children });\n const content = needsPortalRepropagation() ? /* @__PURE__ */ jsx(\n RepropagateMenuAndMenuRootProvider,\n {\n menuContext,\n rootContext,\n popperContext,\n menuSubContext,\n scope,\n children: themedChildren\n }\n ) : themedChildren;\n const isPresent = forceMount || rootContext.open && menuContext.open;\n return /* @__PURE__ */ jsx(Animate, { type: \"presence\", present: isPresent, children: /* @__PURE__ */ jsx(PortalPrimitive, { stackZIndex: true, children: /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(PortalProvider, { scope, forceMount, children: /* @__PURE__ */ jsxs(View, { zIndex: zIndex || 100, inset: 0, position: \"absolute\", children: [\n !!menuContext.open && !isWeb && /* @__PURE__ */ jsx(\n View,\n {\n inset: 0,\n position: \"absolute\",\n onPress: () => menuContext.onOpenChange(!menuContext.open)\n }\n ),\n content\n ] }) }) }) }) });\n };\n MenuPortal.displayName = PORTAL_NAME;\n const CONTENT_NAME = \"MenuContent\";\n const { Provider: MenuContentProvider, useStyledContext: useMenuContentContext } = createStyledContext();\n const MenuContentFrame = styled(PopperPrimitive.PopperContentFrame, {\n displayName: CONTENT_NAME\n });\n const MenuContent = createStyledHOC(\n MenuContentFrame,\n (props, forwardedRef) => {\n const scope = props.scope || MENU_CONTEXT;\n const portalContext = usePortalContext(scope);\n const { forceMount = portalContext.forceMount, ...contentProps } = props;\n const rootContext = useMenuRootContext(scope);\n return /* @__PURE__ */ jsx(Collection.Provider, { scope, children: /* @__PURE__ */ jsx(Collection.Slot, { scope, children: rootContext.modal ? /* @__PURE__ */ jsx(MenuRootContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsx(MenuRootContentNonModal, { ...contentProps, ref: forwardedRef }) }) });\n }\n );\n const MenuRootContentModal = createRefComponent((props, forwardedRef) => {\n const scope = props.scope || MENU_CONTEXT;\n const context = useMenuContext(scope);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n return /* @__PURE__ */ jsx(\n MenuContentImpl,\n {\n ...props,\n scope,\n ref: composedRefs,\n trapFocus: context.open,\n disableOutsidePointerEvents: context.open,\n disableOutsideScroll: false,\n onFocusOutside: composeEventHandlers(\n props.onFocusOutside,\n (event) => event.cancel(),\n { checkDefaultPrevented: false }\n ),\n onDismiss: () => context.onOpenChange(false)\n }\n );\n });\n const MenuRootContentNonModal = createRefComponent((props, forwardedRef) => {\n const scope = props.scope || MENU_CONTEXT;\n const context = useMenuContext(scope);\n return /* @__PURE__ */ jsx(\n MenuContentImpl,\n {\n ...props,\n scope,\n ref: forwardedRef,\n trapFocus: false,\n disableOutsidePointerEvents: false,\n disableOutsideScroll: false,\n onDismiss: () => context.onOpenChange(false)\n }\n );\n });\n const MenuContentImpl = createRefComponent((props, forwardedRef) => {\n const {\n scope = MENU_CONTEXT,\n loop = false,\n trapFocus,\n onOpenAutoFocus,\n onCloseAutoFocus,\n disableOutsidePointerEvents,\n onEntryFocus,\n onEscapeKeyDown,\n onPointerDownOutside,\n onFocusOutside,\n onInteractOutside,\n onDismiss,\n disableOutsideScroll,\n disableDismissOnScroll = false,\n ...contentProps\n } = props;\n const context = useMenuContext(scope);\n const rootContext = useMenuRootContext(scope);\n const popperContext = PopperPrimitive.usePopperContext(scope);\n const getItems = useCollection(scope);\n const [currentItemId, setCurrentItemId] = React.useState(null);\n const contentRef = React.useRef(null);\n const focusableContentRef = React.useRef(null);\n const composedRefs = useComposedRefs(\n forwardedRef,\n contentRef,\n context.onContentChange\n );\n const timerRef = React.useRef(0);\n const searchRef = React.useRef(\"\");\n const pointerGraceTimerRef = React.useRef(0);\n const pointerGraceIntentRef = React.useRef(null);\n const pointerDirRef = React.useRef(\"right\");\n const lastPointerXRef = React.useRef(0);\n const handleTypeaheadSearch = (key) => {\n const search = searchRef.current + key;\n const items = getItems().filter((item) => !item.disabled);\n const currentItem = document.activeElement;\n const currentMatch = items.find(\n (item) => item.ref.current === currentItem\n )?.textValue;\n const values = items.map((item) => item.textValue);\n const nextMatch = getNextMatch(values, search, currentMatch);\n const newItem = items.find((item) => item.textValue === nextMatch)?.ref.current;\n (function updateSearch(value) {\n searchRef.current = value;\n clearTimeout(timerRef.current);\n if (value !== \"\") timerRef.current = setTimeout(() => updateSearch(\"\"), 1e3);\n })(search);\n if (newItem) {\n setTimeout(() => newItem.focus());\n }\n };\n React.useEffect(() => {\n return () => clearTimeout(timerRef.current);\n }, []);\n React.useEffect(() => {\n if (!isWeb || !context.open) return;\n const frame = requestAnimationFrame(() => {\n const container = contentRef.current;\n const el = container?.querySelector(\"[data-tamagui-menu-content]\");\n if (el) focusableContentRef.current = el;\n });\n return () => cancelAnimationFrame(frame);\n }, [context.open]);\n React.useEffect(() => {\n if (!isWeb || disableDismissOnScroll || !context.open) return;\n const handleScroll = (event) => {\n const scrolled = event.target;\n if (!scrolled) return;\n const content2 = contentRef.current;\n if (content2?.contains(scrolled)) return;\n const reference = popperContext.refs?.reference?.current;\n const anchor = reference instanceof Element ? reference : reference?.contextElement ?? null;\n if (anchor && !scrolled.contains(anchor)) return;\n context.onOpenChange(false);\n };\n window.addEventListener(\"scroll\", handleScroll, { capture: true, passive: true });\n return () => {\n window.removeEventListener(\"scroll\", handleScroll, { capture: true });\n };\n }, [disableDismissOnScroll, context.open, context.onOpenChange, popperContext.refs]);\n if (isWeb) {\n useFocusGuards();\n }\n const isPointerMovingToSubmenu = React.useCallback((event) => {\n const isMovingTowards = pointerDirRef.current === pointerGraceIntentRef.current?.side;\n const inArea = isPointerInGraceArea(event, pointerGraceIntentRef.current?.area);\n return isMovingTowards && inArea;\n }, []);\n const content = /* @__PURE__ */ jsx(\n PopperPrimitive.PopperContent,\n {\n role: \"menu\",\n tabIndex: -1,\n \"aria-orientation\": \"vertical\",\n \"data-state\": getOpenState(context.open),\n \"data-tamagui-menu-content\": \"\",\n dir: rootContext.dir,\n scope: scope || MENU_CONTEXT,\n ...contentProps,\n ref: composedRefs,\n className: contentProps.transition ? void 0 : contentProps.className,\n ...isWeb ? {\n onKeyDown: composeEventHandlers(contentProps.onKeyDown, (event) => {\n const target = event.target;\n const isKeyDownInside = target.closest(\"[data-tamagui-menu-content]\") === event.currentTarget;\n const isModifierKey = event.ctrlKey || event.altKey || event.metaKey;\n const isCharacterKey = event.key.length === 1;\n if (isKeyDownInside) {\n if (event.key === \"Tab\") event.preventDefault();\n if (!isModifierKey && isCharacterKey) handleTypeaheadSearch(event.key);\n }\n const isOnContentFrame = event.target.hasAttribute(\n \"data-tamagui-menu-content\"\n );\n if (!isKeyDownInside || !isOnContentFrame) return;\n if (!FIRST_LAST_KEYS.includes(event.key)) return;\n event.preventDefault();\n const items = getItems().filter((item) => !item.disabled);\n const candidateNodes = items.map((item) => item.ref.current);\n if (LAST_KEYS.includes(event.key)) candidateNodes.reverse();\n focusFirst(candidateNodes, { focusVisible: true });\n }),\n // TODO\n // @ts-ignore\n onBlur: composeEventHandlers(props.onBlur, (event) => {\n if (!event.currentTarget?.contains(event.target)) {\n clearTimeout(timerRef.current);\n searchRef.current = \"\";\n }\n }),\n // TODO\n onPointerMove: composeEventHandlers(props.onPointerMove, (event) => {\n if (event.pointerType !== \"mouse\") return;\n const target = event.target;\n const pointerXHasChanged = lastPointerXRef.current !== event.clientX;\n if (event.currentTarget?.contains(target) && pointerXHasChanged) {\n const newDir = event.clientX > lastPointerXRef.current ? \"right\" : \"left\";\n pointerDirRef.current = newDir;\n lastPointerXRef.current = event.clientX;\n }\n })\n } : {}\n }\n );\n return /* @__PURE__ */ jsx(\n MenuContentProvider,\n {\n scope,\n searchRef,\n onItemEnter: React.useCallback(\n (event) => {\n if (isPointerMovingToSubmenu(event)) event.preventDefault();\n },\n [isPointerMovingToSubmenu]\n ),\n onItemLeave: React.useCallback(\n (event) => {\n if (isPointerMovingToSubmenu(event)) return;\n focusableContentRef.current?.focus();\n setCurrentItemId(null);\n },\n [isPointerMovingToSubmenu]\n ),\n onTriggerLeave: React.useCallback(\n (event) => {\n if (isPointerMovingToSubmenu(event)) event.preventDefault();\n },\n [isPointerMovingToSubmenu]\n ),\n pointerGraceTimerRef,\n onPointerGraceIntentChange: React.useCallback((intent) => {\n pointerGraceIntentRef.current = intent;\n }, []),\n children: /* @__PURE__ */ jsx(RemoveScroll, { enabled: disableOutsideScroll, children: /* @__PURE__ */ jsx(\n FocusScope,\n {\n asChild: false,\n trapped: trapFocus,\n onMountAutoFocus: composeEventHandlers(onOpenAutoFocus, (event) => {\n event.cancel();\n const content2 = document.querySelector(\n \"[data-tamagui-menu-content]\"\n );\n content2?.focus({ preventScroll: true });\n }),\n onUnmountAutoFocus: onCloseAutoFocus,\n children: /* @__PURE__ */ jsx(\n DismissableLayer,\n {\n disableOutsidePointerEvents,\n onEscapeKeyDown,\n onPointerDownOutside,\n onFocusOutside,\n onInteractOutside,\n onDismiss,\n asChild: true,\n children: /* @__PURE__ */ jsx(\n RovingFocusGroup,\n {\n asChild: true,\n __scopeRovingFocusGroup: scope || MENU_CONTEXT,\n dir: rootContext.dir,\n orientation: \"vertical\",\n loop,\n currentTabStopId: currentItemId,\n onCurrentTabStopIdChange: setCurrentItemId,\n onEntryFocus: composeEventHandlers(onEntryFocus, (event) => {\n if (!rootContext.isUsingKeyboardRef.current) {\n event.cancel();\n }\n }),\n children: content\n }\n )\n }\n )\n }\n ) })\n }\n );\n });\n MenuContent.displayName = CONTENT_NAME;\n const ITEM_NAME = \"MenuItem\";\n const ITEM_SELECT = \"menu.itemSelect\";\n const MenuItem = createStyledHOC(\n View,\n (props, forwardedRef) => {\n const {\n disabled = false,\n onSelect,\n preventCloseOnSelect,\n children,\n scope = MENU_CONTEXT,\n // filter out native-only props that shouldn't reach the DOM\n // @ts-ignore\n destructive,\n // @ts-ignore\n hidden,\n // @ts-ignore\n androidIconName,\n ...itemProps\n } = props;\n const ref = React.useRef(null);\n const rootContext = useMenuRootContext(scope);\n const contentContext = useMenuContentContext(scope);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const isPointerDownRef = React.useRef(false);\n const handleSelect = () => {\n const menuItem = ref.current;\n if (!disabled && menuItem) {\n if (isWeb) {\n const menuItemEl = menuItem;\n const itemSelectEvent = new CustomEvent(ITEM_SELECT, {\n bubbles: true,\n cancelable: true\n });\n menuItemEl.addEventListener(ITEM_SELECT, (event) => onSelect?.(event), {\n once: true\n });\n dispatchDiscreteCustomEvent(menuItemEl, itemSelectEvent);\n if (itemSelectEvent.defaultPrevented || preventCloseOnSelect) {\n isPointerDownRef.current = false;\n } else {\n rootContext.onClose();\n }\n } else {\n onSelect?.({ target: menuItem });\n isPointerDownRef.current = false;\n if (!preventCloseOnSelect) {\n rootContext.onClose();\n }\n }\n }\n };\n const content = typeof children === \"string\" ? /* @__PURE__ */ jsx(Text, { children }) : children;\n return /* @__PURE__ */ jsx(\n MenuItemImpl,\n {\n ...itemProps,\n scope,\n ref: composedRefs,\n disabled,\n onPress: composeEventHandlers(props.onPress, handleSelect),\n onPointerDown: (event) => {\n props.onPointerDown?.(event);\n isPointerDownRef.current = true;\n },\n onPointerUp: composeEventHandlers(props.onPointerUp, (event) => {\n if (isWeb) {\n if (!isPointerDownRef.current) event.currentTarget?.click();\n }\n }),\n ...isWeb ? {\n onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {\n const isTypingAhead = contentContext.searchRef.current !== \"\";\n if (disabled || isTypingAhead && event.key === \" \") return;\n if (SELECTION_KEYS.includes(event.key)) {\n event.currentTarget?.click();\n event.preventDefault();\n }\n })\n } : {},\n children: content\n }\n );\n }\n );\n const MenuItemImpl = createRefComponent((props, forwardedRef) => {\n const {\n scope = MENU_CONTEXT,\n className,\n disabled = false,\n textValue,\n ...itemProps\n } = props;\n const contentContext = useMenuContentContext(scope);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const [isFocused, setIsFocused] = React.useState(false);\n const [textContent, setTextContent] = React.useState(\"\");\n if (isWeb) {\n React.useEffect(() => {\n const menuItem = ref.current;\n if (menuItem) {\n setTextContent((menuItem.textContent ?? \"\").trim());\n }\n }, [itemProps.children]);\n }\n return /* @__PURE__ */ jsx(\n Collection.ItemSlot,\n {\n scope,\n disabled,\n textValue: textValue ?? textContent,\n children: /* @__PURE__ */ jsx(\n RovingFocusGroup.Item,\n {\n asChild: true,\n __scopeRovingFocusGroup: scope,\n tabIndex: disabled ? -1 : 0,\n children: /* @__PURE__ */ jsx(\n View,\n {\n className: `is_${ITEM_NAME} ${className || \"\"}`.trim(),\n role: \"menuitem\",\n \"data-highlighted\": isFocused ? \"\" : void 0,\n \"aria-disabled\": disabled || void 0,\n \"data-disabled\": disabled ? \"\" : void 0,\n ...itemProps,\n ref: composedRefs,\n onPointerMove: composeEventHandlers(props.onPointerMove, (event) => {\n if (event.pointerType !== \"mouse\") return;\n if (disabled) {\n contentContext.onItemLeave(event);\n } else {\n contentContext.onItemEnter(event);\n if (!event.defaultPrevented) {\n const item = event.currentTarget;\n item.focus({ preventScroll: true, focusVisible: false });\n }\n }\n }),\n onPointerLeave: composeEventHandlers(props.onPointerLeave, (event) => {\n contentContext.onItemLeave(event);\n }),\n onFocus: composeEventHandlers(props.onFocus, () => setIsFocused(true)),\n onBlur: composeEventHandlers(props.onBlur, () => setIsFocused(false))\n }\n )\n }\n )\n }\n );\n });\n MenuItem.displayName = ITEM_NAME;\n const ITEM_TITLE_NAME = \"MenuItemTitle\";\n const MenuItemTitle = createStyledHOC(\n Text,\n (props, forwardedRef) => {\n return /* @__PURE__ */ jsx(Text, { ...props, ref: forwardedRef });\n }\n );\n MenuItemTitle.displayName = ITEM_TITLE_NAME;\n const ITEM_SUB_TITLE_NAME = \"MenuItemSubTitle\";\n const MenuItemSubTitle = createStyledHOC(\n Text,\n (props, forwardedRef) => {\n return /* @__PURE__ */ jsx(Text, { ...props, ref: forwardedRef });\n }\n );\n MenuItemSubTitle.displayName = ITEM_SUB_TITLE_NAME;\n const ITEM_IMAGE = \"MenuItemImage\";\n const MenuItemImage = createRefComponent(\n (props, forwardedRef) => {\n const {\n // @ts-ignore - native menu ios config\n ios,\n // @ts-ignore\n androidIconName,\n ...rest\n } = props;\n return /* @__PURE__ */ jsx(MenuImageFrame, { ...rest, ref: forwardedRef });\n }\n );\n MenuItemImage.displayName = ITEM_IMAGE;\n const ITEM_ICON = \"MenuItemIcon\";\n const MenuItemIcon = createStyledHOC(View, (props, forwardedRef) => {\n const {\n // @ts-ignore\n ios,\n // @ts-ignore\n android,\n // @ts-ignore\n androidIconName,\n ...rest\n } = props;\n return /* @__PURE__ */ jsx(View, { ...rest, ref: forwardedRef });\n });\n MenuItemIcon.displayName = ITEM_ICON;\n const CHECKBOX_ITEM_NAME = \"MenuCheckboxItem\";\n const MenuCheckboxItem = createStyledHOC(\n View,\n (props, forwardedRef) => {\n const {\n checked = false,\n onCheckedChange,\n scope = MENU_CONTEXT,\n // filter out native-only props\n // @ts-ignore - native menu value state\n value,\n // @ts-ignore - native menu value change handler\n onValueChange,\n className,\n ...checkboxItemProps\n } = props;\n return /* @__PURE__ */ jsx(ItemIndicatorProvider, { scope, checked, children: /* @__PURE__ */ jsx(\n MenuItem,\n {\n className: `is_${CHECKBOX_ITEM_NAME} ${className || \"\"}`.trim(),\n role: isWeb ? \"menuitemcheckbox\" : \"menuitem\",\n \"aria-checked\": isIndeterminate(checked) ? \"mixed\" : checked,\n ...checkboxItemProps,\n scope,\n ref: forwardedRef,\n \"data-state\": getCheckedState(checked),\n onSelect: composeEventHandlers(\n checkboxItemProps.onSelect,\n () => onCheckedChange?.(isIndeterminate(checked) ? true : !checked),\n { checkDefaultPrevented: false }\n )\n }\n ) });\n }\n );\n MenuCheckboxItem.displayName = CHECKBOX_ITEM_NAME;\n const RADIO_GROUP_NAME = \"MenuRadioGroup\";\n const { Provider: RadioGroupProvider, useStyledContext: useRadioGroupContext } = createStyledContext();\n const MenuRadioGroup = createStyledHOC(\n View,\n (props, forwardedRef) => {\n const {\n value,\n onValueChange,\n scope = MENU_CONTEXT,\n className,\n ...groupProps\n } = props;\n const handleValueChange = useCallbackRef(onValueChange);\n return /* @__PURE__ */ jsx(RadioGroupProvider, { scope, value, onValueChange: handleValueChange, children: /* @__PURE__ */ jsx(\n View,\n {\n className: `is_${RADIO_GROUP_NAME} ${className || \"\"}`.trim(),\n ...groupProps,\n ref: forwardedRef\n }\n ) });\n }\n );\n MenuRadioGroup.displayName = RADIO_GROUP_NAME;\n const RADIO_ITEM_NAME = \"MenuRadioItem\";\n const MenuRadioItem = createStyledHOC(\n View,\n (props, forwardedRef) => {\n const { value, scope = MENU_CONTEXT, className, ...radioItemProps } = props;\n const context = useRadioGroupContext(scope);\n const checked = value === context.value;\n return /* @__PURE__ */ jsx(ItemIndicatorProvider, { scope, checked, children: /* @__PURE__ */ jsx(\n MenuItem,\n {\n className: `is_${RADIO_ITEM_NAME} ${className || \"\"}`.trim(),\n ...radioItemProps,\n scope,\n \"aria-checked\": checked,\n ref: forwardedRef,\n role: isWeb ? \"menuitemradio\" : \"menuitem\",\n \"data-state\": getCheckedState(checked),\n onSelect: composeEventHandlers(\n radioItemProps.onSelect,\n () => context.onValueChange?.(value),\n { checkDefaultPrevented: false }\n )\n }\n ) });\n }\n );\n MenuRadioItem.displayName = RADIO_ITEM_NAME;\n const ITEM_INDICATOR_NAME = \"MenuItemIndicator\";\n const { Provider: ItemIndicatorProvider, useStyledContext: useItemIndicatorContext } = createStyledContext();\n const MenuItemIndicator = createStyledHOC(\n View,\n (props, forwardedRef) => {\n const { scope = MENU_CONTEXT, className, forceMount, ...itemIndicatorProps } = props;\n const indicatorContext = useItemIndicatorContext(scope);\n return /* @__PURE__ */ jsx(Presence, { children: forceMount || isIndeterminate(indicatorContext.checked) || indicatorContext.checked === true ? /* @__PURE__ */ jsx(\n View,\n {\n className: `is_${ITEM_INDICATOR_NAME} ${className || \"\"}`.trim(),\n render: \"span\",\n ...itemIndicatorProps,\n ref: forwardedRef,\n \"data-state\": getCheckedState(indicatorContext.checked)\n }\n ) : null });\n }\n );\n MenuItemIndicator.displayName = ITEM_INDICATOR_NAME;\n const MenuArrow = createRefComponent(\n function MenuArrow2(props, forwardedRef) {\n const { scope = MENU_CONTEXT, className, ...rest } = props;\n return /* @__PURE__ */ jsx(\n PopperPrimitive.PopperArrow,\n {\n scope,\n className: `is_PopperArrow ${className || \"\"}`.trim(),\n ...rest,\n ref: forwardedRef\n }\n );\n }\n );\n const SUB_NAME = \"MenuSub\";\n const { Provider: MenuSubProvider, useStyledContext: useMenuSubContext } = createStyledContext();\n const MenuSub = (props) => {\n const isTouchDevice = useIsTouchDevice();\n const { scope = MENU_CONTEXT } = props;\n const rootContext = useMenuRootContext(scope);\n const parentPopperContext = PopperPrimitive.usePopperContext(scope);\n const parentSide = parentPopperContext.placement?.split(\"-\")[0];\n const isNestedSubmenu = parentSide === \"left\" || parentSide === \"right\";\n const defaultPlacement = isTouchDevice ? \"bottom\" : isNestedSubmenu ? `${parentSide}-start` : rootContext.dir === \"rtl\" ? \"left-start\" : \"right-start\";\n const {\n children,\n open = false,\n onOpenChange,\n allowFlip: allowFlipProp = { padding: 10 },\n stayInFrame = { padding: 10 },\n placement = defaultPlacement,\n ...rest\n } = props;\n const allowFlip = React.useMemo(() => {\n if (!isNestedSubmenu || typeof allowFlipProp === \"boolean\") return allowFlipProp;\n if (allowFlipProp.fallbackPlacements) return allowFlipProp;\n const side = placement.split(\"-\")[0];\n const align = placement.split(\"-\")[1] || \"start\";\n const otherAlign = align === \"start\" ? \"end\" : \"start\";\n if (side === \"left\" || side === \"right\") {\n const oppositeSide = side === \"right\" ? \"left\" : \"right\";\n return {\n ...typeof allowFlipProp === \"object\" ? allowFlipProp : {},\n fallbackPlacements: [\n `${side}-${otherAlign}`,\n `${oppositeSide}-${align}`,\n `${oppositeSide}-${otherAlign}`\n ]\n };\n }\n return allowFlipProp;\n }, [isNestedSubmenu, allowFlipProp, placement]);\n const parentMenuContext = useMenuContext(scope);\n const [trigger, setTrigger] = React.useState(null);\n const [content, setContent] = React.useState(null);\n const handleOpenChange = useCallbackRef(onOpenChange);\n React.useEffect(() => {\n if (parentMenuContext.open === false) handleOpenChange(false);\n return () => handleOpenChange(false);\n }, [parentMenuContext.open, handleOpenChange]);\n return /* @__PURE__ */ jsx(\n PopperPrimitive.Popper,\n {\n open,\n placement,\n allowFlip,\n stayInFrame,\n ...rest,\n scope,\n children: /* @__PURE__ */ jsx(\n MenuProvider,\n {\n scope,\n open,\n onOpenChange: handleOpenChange,\n content,\n onContentChange: setContent,\n children: /* @__PURE__ */ jsx(\n MenuSubProvider,\n {\n scope,\n contentId: useId(),\n triggerId: useId(),\n trigger,\n onTriggerChange: setTrigger,\n children\n }\n )\n }\n )\n }\n );\n };\n MenuSub.displayName = SUB_NAME;\n const SUB_TRIGGER_NAME = \"MenuSubTrigger\";\n const MenuSubTrigger = createRefComponent((props, forwardedRef) => {\n const scope = props.scope || MENU_CONTEXT;\n const context = useMenuContext(scope);\n const rootContext = useMenuRootContext(scope);\n const subContext = useMenuSubContext(scope);\n const contentContext = useMenuContentContext(scope);\n const popperContext = PopperPrimitive.usePopperContext(scope);\n const openTimerRef = React.useRef(null);\n const { pointerGraceTimerRef, onPointerGraceIntentChange } = contentContext;\n const effectiveDir = rootContext.dir;\n const clearOpenTimer = React.useCallback(() => {\n if (openTimerRef.current) window.clearTimeout(openTimerRef.current);\n openTimerRef.current = null;\n }, []);\n React.useEffect(() => clearOpenTimer, [clearOpenTimer]);\n React.useEffect(() => {\n const pointerGraceTimer = pointerGraceTimerRef.current;\n return () => {\n window.clearTimeout(pointerGraceTimer);\n onPointerGraceIntentChange(null);\n };\n }, [pointerGraceTimerRef, onPointerGraceIntentChange]);\n return /* @__PURE__ */ jsx(\n MenuAnchor,\n {\n className: `is_${SUB_TRIGGER_NAME}`,\n asChild: \"except-style\",\n scope,\n children: /* @__PURE__ */ jsx(\n MenuItemImpl,\n {\n id: subContext.triggerId,\n \"aria-haspopup\": \"menu\",\n \"aria-expanded\": context.open,\n \"aria-controls\": subContext.contentId,\n \"data-state\": getOpenState(context.open),\n ...props,\n ref: composeRefs(forwardedRef, subContext.onTriggerChange),\n onPress: (event) => {\n props.onPress?.(event);\n if (props.disabled || event.defaultPrevented) return;\n if (isWeb) {\n event.currentTarget.focus();\n }\n if (!context.open) context.onOpenChange(true);\n },\n onPointerMove: composeEventHandlers(\n props.onPointerMove,\n // @ts-ignore\n whenMouse((event) => {\n contentContext.onItemEnter(event);\n if (event.defaultPrevented) return;\n if (!props.disabled && !context.open && !openTimerRef.current) {\n contentContext.onPointerGraceIntentChange(null);\n openTimerRef.current = window.setTimeout(() => {\n context.onOpenChange(true);\n clearOpenTimer();\n }, 100);\n }\n })\n ),\n onPointerLeave: composeEventHandlers(props.onPointerLeave, (eventIn) => {\n const event = eventIn;\n clearOpenTimer();\n const contentRect = context.content?.getBoundingClientRect();\n if (contentRect) {\n const contentEl = context.content;\n const sideEl = contentEl?.dataset?.side ? contentEl : contentEl?.querySelector(\"[data-side]\");\n const side = sideEl?.dataset?.side || \"right\";\n const rightSide = side === \"right\";\n const bleed = rightSide ? -5 : 5;\n const contentNearEdge = contentRect[rightSide ? \"left\" : \"right\"];\n const contentFarEdge = contentRect[rightSide ? \"right\" : \"left\"];\n const polygon = {\n area: [\n // Apply a bleed on clientX to ensure that our exit point is\n // consistently within polygon bounds\n { x: event.clientX + bleed, y: event.clientY },\n { x: contentNearEdge, y: contentRect.top },\n { x: contentFarEdge, y: contentRect.top },\n { x: contentFarEdge, y: contentRect.bottom },\n { x: contentNearEdge, y: contentRect.bottom }\n ],\n side\n };\n contentContext.onPointerGraceIntentChange(polygon);\n window.clearTimeout(pointerGraceTimerRef.current);\n pointerGraceTimerRef.current = window.setTimeout(\n () => contentContext.onPointerGraceIntentChange(null),\n 300\n );\n } else if (isWeb && subContext.trigger) {\n const triggerEl = subContext.trigger;\n const triggerRect = triggerEl?.getBoundingClientRect();\n if (triggerRect) {\n const placementSide = popperContext.placement?.split(\"-\")[0];\n const side = placementSide === \"left\" || placementSide === \"right\" ? placementSide : rootContext.dir === \"rtl\" ? \"left\" : \"right\";\n const rightSide = side === \"right\";\n const bleed = rightSide ? -5 : 5;\n const nearEdge = rightSide ? triggerRect.right + 4 : triggerRect.left - 4;\n const farEdge = rightSide ? nearEdge + 200 : nearEdge - 200;\n const polygon = {\n area: [\n { x: event.clientX + bleed, y: event.clientY },\n { x: nearEdge, y: triggerRect.top - 50 },\n { x: farEdge, y: triggerRect.top - 50 },\n { x: farEdge, y: triggerRect.bottom + 50 },\n { x: nearEdge, y: triggerRect.bottom + 50 }\n ],\n side\n };\n contentContext.onPointerGraceIntentChange(polygon);\n window.clearTimeout(pointerGraceTimerRef.current);\n pointerGraceTimerRef.current = window.setTimeout(\n () => contentContext.onPointerGraceIntentChange(null),\n 300\n );\n }\n } else {\n contentContext.onTriggerLeave(event);\n if (event.defaultPrevented) return;\n contentContext.onPointerGraceIntentChange(null);\n }\n }),\n ...isWeb ? {\n onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {\n const isTypingAhead = contentContext.searchRef.current !== \"\";\n if (props.disabled || isTypingAhead && event.key === \" \") return;\n const willOpen = SUB_OPEN_KEYS[effectiveDir].includes(event.key);\n if (willOpen) {\n if (context.open && context.content) {\n const contentEl = context.content;\n const firstItem = contentEl.querySelector?.(\n '[role=\"menuitem\"]:not([data-disabled])'\n );\n if (firstItem) {\n firstItem.focus({ focusVisible: true });\n event.preventDefault();\n return;\n }\n }\n const triggerEl = event.currentTarget;\n popperContext.refs?.setReference(triggerEl);\n context.onOpenChange(true);\n requestAnimationFrame(() => {\n popperContext.update?.();\n });\n context.content?.focus({ focusVisible: true });\n event.preventDefault();\n }\n })\n } : null\n }\n )\n }\n );\n });\n MenuSubTrigger.displayName = SUB_TRIGGER_NAME;\n const SUB_CONTENT_NAME = \"MenuSubContent\";\n const MenuSubContentFrame = styled(PopperPrimitive.PopperContentFrame, {\n displayName: SUB_CONTENT_NAME\n });\n const MenuSubContent = createStyledHOC(\n MenuSubContentFrame,\n (props, forwardedRef) => {\n const scope = props.scope || MENU_CONTEXT;\n const portalContext = usePortalContext(scope);\n const { forceMount = portalContext.forceMount, ...subContentProps } = props;\n const context = useMenuContext(scope);\n const rootContext = useMenuRootContext(scope);\n const subContext = useMenuSubContext(scope);\n const popperContext = PopperPrimitive.usePopperContext(scope);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const placementSide = popperContext.placement?.split(\"-\")[0];\n const dataSide = placementSide === \"left\" || placementSide === \"right\" ? placementSide : rootContext.dir === \"rtl\" ? \"left\" : \"right\";\n const effectiveDir = rootContext.dir;\n return /* @__PURE__ */ jsx(Collection.Provider, { scope, children: /* @__PURE__ */ jsx(Collection.Slot, { scope, children: /* @__PURE__ */ jsx(\n MenuContentImpl,\n {\n id: subContext.contentId,\n \"aria-labelledby\": subContext.triggerId,\n ...subContentProps,\n ref: composedRefs,\n \"data-side\": dataSide,\n disableOutsidePointerEvents: false,\n disableOutsideScroll: false,\n trapFocus: false,\n onOpenAutoFocus: (event) => {\n if (rootContext.isUsingKeyboardRef.current) {\n const root = ref.current;\n const content = root?.querySelector?.(\n \"[data-tamagui-menu-content]\"\n );\n (content || root)?.focus({ preventScroll: true });\n }\n event.cancel();\n },\n onCloseAutoFocus: (event) => event.cancel(),\n onFocusOutside: composeEventHandlers(props.onFocusOutside, (event) => {\n if (event.event?.target !== subContext.trigger)\n context.onOpenChange(false);\n }),\n onEscapeKeyDown: composeEventHandlers(props.onEscapeKeyDown, (event) => {\n context.onOpenChange(false);\n subContext.trigger?.focus({ focusVisible: true });\n event.cancel();\n event.event?.preventDefault?.();\n }),\n ...isWeb ? {\n onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {\n const isKeyDownInside = event.currentTarget.contains(\n event.target\n );\n const isCloseKey = SUB_CLOSE_KEYS[effectiveDir].includes(event.key);\n if (isKeyDownInside && isCloseKey) {\n context.onOpenChange(false);\n subContext.trigger?.focus({ focusVisible: true });\n event.preventDefault();\n }\n })\n } : null\n }\n ) }) });\n }\n );\n MenuSubContent.displayName = SUB_CONTENT_NAME;\n const Anchor = MenuAnchor;\n const Portal = MenuPortal;\n const Content = MenuContent;\n const Group = createStyledHOC(View, (props, ref) => {\n return /* @__PURE__ */ jsx(View, { role: \"group\", ...props, ref });\n });\n Group.displayName = \"MenuGroup\";\n const Label = createStyledHOC(Text, (props, ref) => {\n return /* @__PURE__ */ jsx(Text, { ...props, ref });\n });\n Label.displayName = \"MenuLabel\";\n const Item = MenuItem;\n const CheckboxItem = MenuCheckboxItem;\n const RadioGroup = MenuRadioGroup;\n const RadioItem = MenuRadioItem;\n const ItemIndicator = MenuItemIndicator;\n const Separator = createStyledHOC(View, (props, ref) => {\n return /* @__PURE__ */ jsx(View, { role: \"separator\", \"aria-orientation\": \"horizontal\", ...props, ref });\n });\n Separator.displayName = \"MenuSeparator\";\n const Arrow = MenuArrow;\n const Sub = MenuSub;\n const SubTrigger = MenuSubTrigger;\n const SubContent = MenuSubContent;\n const ItemTitle = MenuItemTitle;\n const ItemSubtitle = MenuItemSubTitle;\n const ItemImage = MenuItemImage;\n const ItemIcon = MenuItemIcon;\n const Menu = withStaticProperties(MenuComp, {\n Anchor,\n Portal,\n Content,\n Group,\n Label,\n Item,\n CheckboxItem,\n RadioGroup,\n RadioItem,\n ItemIndicator,\n Separator,\n Arrow,\n Sub,\n SubTrigger,\n SubContent,\n ItemTitle,\n ItemSubtitle,\n ItemImage,\n ItemIcon\n });\n return {\n Menu\n };\n}\nfunction getOpenState(open) {\n return open ? \"open\" : \"closed\";\n}\nfunction isIndeterminate(checked) {\n return checked === \"indeterminate\";\n}\nfunction getCheckedState(checked) {\n return isIndeterminate(checked) ? \"indeterminate\" : checked ? \"checked\" : \"unchecked\";\n}\nfunction focusFirst(candidates, options) {\n const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;\n for (const candidate of candidates) {\n if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return;\n candidate.focus({ preventScroll: true, focusVisible: options?.focusVisible });\n if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return;\n }\n}\nfunction wrapArray(array, startIndex) {\n return array.map((_, index) => array[(startIndex + index) % array.length]);\n}\nfunction getNextMatch(values, search, currentMatch) {\n const isRepeated = search.length > 1 && Array.from(search).every((char) => char === search[0]);\n const normalizedSearch = isRepeated ? search[0] : search;\n const currentMatchIndex = currentMatch ? values.indexOf(currentMatch) : -1;\n let wrappedValues = wrapArray(values, Math.max(currentMatchIndex, 0));\n const excludeCurrentMatch = normalizedSearch.length === 1;\n if (excludeCurrentMatch) wrappedValues = wrappedValues.filter((v) => v !== currentMatch);\n const nextMatch = wrappedValues.find(\n (value) => value.toLowerCase().startsWith(normalizedSearch.toLowerCase())\n );\n return nextMatch !== currentMatch ? nextMatch : void 0;\n}\nfunction isPointInPolygon(point, polygon) {\n const { x, y } = point;\n let inside = false;\n for (let i = 0, j = polygon.length - 1; i < polygon.length; j = i++) {\n const xi = polygon[i].x;\n const yi = polygon[i].y;\n const xj = polygon[j].x;\n const yj = polygon[j].y;\n const intersect = yi > y !== yj > y && x < (xj - xi) * (y - yi) / (yj - yi) + xi;\n if (intersect) inside = !inside;\n }\n return inside;\n}\nfunction isPointerInGraceArea(event, area) {\n if (!area) return false;\n const cursorPos = { x: event.clientX, y: event.clientY };\n return isPointInPolygon(cursorPos, area);\n}\nexport {\n createBaseMenu\n};\n//# sourceMappingURL=createBaseMenu.js.map\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAkCA,SAAS,UAAU,SAAS;CAC1B,QAAQ,UAAU,MAAM,gBAAgB,UAAU,QAAQ,KAAK,IAAI,KAAK;AAC1E;AACA,MAAM,iBAAiB,CAAC,SAAS,GAAG;AACpC,MAAM,aAAa;CAAC;CAAa;CAAU;AAAM;AACjD,MAAM,YAAY;CAAC;CAAW;CAAY;AAAK;AAC/C,MAAM,kBAAkB,CAAC,GAAG,YAAY,GAAG,SAAS;AACpD,MAAM,gBAAgB;CACpB,KAAK,CAAC,GAAG,gBAAgB,YAAY;CACrC,KAAK,CAAC,GAAG,gBAAgB,WAAW;AACtC;AACA,MAAM,iBAAiB;CACrB,KAAK,CAAC,WAAW;CACjB,KAAK,CAAC,YAAY;AACpB;AACA,MAAM,YAAY;AAClB,MAAM,CAAC,YAAY,iBAAiB,iBAAiB,SAAS;AAC9D,MAAM,EAAE,UAAU,cAAc,kBAAkB,mBAAmB,oBAAoB;AACzF,MAAM,EAAE,UAAU,kBAAkB,kBAAkB,uBAAuB,oBAAoB;AACjG,MAAM,eAAe;AACrB,MAAM,iBAAiB,OAAOA,OAAc,EAC1C,aAAa,gBACf,CAAC;AACD,SAAS,iBAAiB;CACxB,MAAM,YAAY,UAAU;EAC1B,MAAM,YAAY,aAAa,MAAM,GAAG;EACxC,MAAM,mBAAmB,cAAc,QAAQ,eAAe;EAC9D,MAAM,EACJ,QAAQ,cACR,OAAO,OACP,UACA,KACA,cACA,QAAQ,MACR,YAAY,EAAE,SAAS,GAAG,GAC1B,cAAc,EAAE,SAAS,GAAG,GAC5B,YAAY,kBACZ,SAAS,MACT,SAAS,IACT,GAAG,SACD;EACJ,MAAM,CAAC,SAAS,cAAc,MAAM,SAAS,IAAI;EACjD,MA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7F,MAAM,mBAAmB,aAAa,OAAO,KAAK;CAClD,MAAM,oBAAoB,eAAe,OAAO,QAAQ,YAAY,IAAI,CAAC;CACzE,IAAI,gBAAgB,UAAU,QAAQ,KAAK,IAAI,mBAAmB,CAAC,CAAC;CACpE,MAAM,sBAAsB,iBAAiB,WAAW;CACxD,IAAI,qBAAqB,gBAAgB,cAAc,QAAQ,MAAM,MAAM,YAAY;CACvF,MAAM,YAAY,cAAc,MAC7B,UAAU,MAAM,YAAY,CAAC,CAAC,WAAW,iBAAiB,YAAY,CAAC,CAC1E;CACA,OAAO,cAAc,eAAe,YAAY,KAAK;AACvD;AACA,SAAS,iBAAiB,OAAO,SAAS;CACxC,MAAM,EAAE,GAAG,MAAM;CACjB,IAAI,SAAS;CACb,KAAK,IAAI,IAAI,GAAG,IAAI,QAAQ,SAAS,GAAG,IAAI,QAAQ,QAAQ,IAAI,KAAK;EACnE,MAAM,KAAK,QAAQ,EAAE,CAAC;EACtB,MAAM,KAAK,QAAQ,EAAE,CAAC;EACtB,MAAM,KAAK,QAAQ,EAAE,CAAC;EACtB,MAAM,KAAK,QAAQ,EAAE,CAAC;EACtB,MAAM,YAAY,KAAK,MAAM,KAAK,KAAK,KAAK,KAAK,OAAO,IAAI,OAAO,KAAK,MAAM;EAC9E,IAAI,WAAW,SAAS,CAAC;CAC3B;CACA,OAAO;AACT;AACA,SAAS,qBAAqB,OAAO,MAAM;CACzC,IAAI,CAAC,MAAM,OAAO;CAClB,MAAM,YAAY;EAAE,GAAG,MAAM;EAAS,GAAG,MAAM;CAAQ;CACvD,OAAO,iBAAiB,WAAW,IAAI;AACzC"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
3
|
var __create = Object.create;
|
|
5
4
|
var __defProp = Object.defineProperty;
|
|
6
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -146,7 +145,9 @@ function createBaseMenu() {
|
|
|
146
145
|
isUsingKeyboardRef,
|
|
147
146
|
dir: direction,
|
|
148
147
|
modal,
|
|
149
|
-
children:
|
|
148
|
+
children:
|
|
149
|
+
/** this provider is just to avoid crashing when using useSubMenuContext() inside MenuPortal */
|
|
150
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuSubProvider, {
|
|
150
151
|
scope,
|
|
151
152
|
children
|
|
152
153
|
})
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
3
|
var __create = Object.create;
|
|
5
4
|
var __defProp = Object.defineProperty;
|
|
6
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -146,7 +145,9 @@ function createBaseMenu() {
|
|
|
146
145
|
isUsingKeyboardRef,
|
|
147
146
|
dir: direction,
|
|
148
147
|
modal,
|
|
149
|
-
children:
|
|
148
|
+
children:
|
|
149
|
+
/** this provider is just to avoid crashing when using useSubMenuContext() inside MenuPortal */
|
|
150
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuSubProvider, {
|
|
150
151
|
scope,
|
|
151
152
|
children
|
|
152
153
|
})
|