groove-dev 0.22.7 → 0.22.9

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.
Files changed (125) hide show
  1. package/node_modules/@groove-dev/daemon/src/api.js +12 -2
  2. package/node_modules/@groove-dev/daemon/src/gateways/manager.js +3 -0
  3. package/node_modules/@groove-dev/gui/dist/assets/{index-B6DQvtWt.js → index-BKZQfaOu.js} +19 -19
  4. package/node_modules/@groove-dev/gui/dist/assets/index-CDWObHaG.css +1 -0
  5. package/node_modules/@groove-dev/gui/dist/index.html +2 -2
  6. package/node_modules/@groove-dev/gui/src/components/agents/agent-feed.jsx +1 -1
  7. package/node_modules/@groove-dev/gui/src/views/agents.jsx +5 -2
  8. package/package.json +1 -1
  9. package/packages/daemon/src/api.js +12 -2
  10. package/packages/daemon/src/gateways/manager.js +3 -0
  11. package/packages/gui/dist/assets/{index-B6DQvtWt.js → index-BKZQfaOu.js} +19 -19
  12. package/packages/gui/dist/assets/index-CDWObHaG.css +1 -0
  13. package/packages/gui/dist/index.html +2 -2
  14. package/packages/gui/src/components/agents/agent-feed.jsx +1 -1
  15. package/packages/gui/src/views/agents.jsx +5 -2
  16. package/node_modules/@groove-dev/gui/dist/assets/index-DHaSTu1c.css +0 -1
  17. package/packages/gui/dist/assets/index-DHaSTu1c.css +0 -1
  18. package/packages/gui/node_modules/.vite/deps/@codemirror_autocomplete.js +0 -68
  19. package/packages/gui/node_modules/.vite/deps/@codemirror_autocomplete.js.map +0 -7
  20. package/packages/gui/node_modules/.vite/deps/@codemirror_commands.js +0 -1420
  21. package/packages/gui/node_modules/.vite/deps/@codemirror_commands.js.map +0 -7
  22. package/packages/gui/node_modules/.vite/deps/@codemirror_lang-css.js +0 -17
  23. package/packages/gui/node_modules/.vite/deps/@codemirror_lang-css.js.map +0 -7
  24. package/packages/gui/node_modules/.vite/deps/@codemirror_lang-html.js +0 -22
  25. package/packages/gui/node_modules/.vite/deps/@codemirror_lang-html.js.map +0 -7
  26. package/packages/gui/node_modules/.vite/deps/@codemirror_lang-javascript.js +0 -34
  27. package/packages/gui/node_modules/.vite/deps/@codemirror_lang-javascript.js.map +0 -7
  28. package/packages/gui/node_modules/.vite/deps/@codemirror_lang-json.js +0 -101
  29. package/packages/gui/node_modules/.vite/deps/@codemirror_lang-json.js.map +0 -7
  30. package/packages/gui/node_modules/.vite/deps/@codemirror_lang-markdown.js +0 -2534
  31. package/packages/gui/node_modules/.vite/deps/@codemirror_lang-markdown.js.map +0 -7
  32. package/packages/gui/node_modules/.vite/deps/@codemirror_lang-python.js +0 -789
  33. package/packages/gui/node_modules/.vite/deps/@codemirror_lang-python.js.map +0 -7
  34. package/packages/gui/node_modules/.vite/deps/@codemirror_language.js +0 -115
  35. package/packages/gui/node_modules/.vite/deps/@codemirror_language.js.map +0 -7
  36. package/packages/gui/node_modules/.vite/deps/@codemirror_search.js +0 -1136
  37. package/packages/gui/node_modules/.vite/deps/@codemirror_search.js.map +0 -7
  38. package/packages/gui/node_modules/.vite/deps/@codemirror_state.js +0 -63
  39. package/packages/gui/node_modules/.vite/deps/@codemirror_state.js.map +0 -7
  40. package/packages/gui/node_modules/.vite/deps/@codemirror_theme-one-dark.js +0 -179
  41. package/packages/gui/node_modules/.vite/deps/@codemirror_theme-one-dark.js.map +0 -7
  42. package/packages/gui/node_modules/.vite/deps/@codemirror_view.js +0 -104
  43. package/packages/gui/node_modules/.vite/deps/@codemirror_view.js.map +0 -7
  44. package/packages/gui/node_modules/.vite/deps/@radix-ui_react-dialog.js +0 -367
  45. package/packages/gui/node_modules/.vite/deps/@radix-ui_react-dialog.js.map +0 -7
  46. package/packages/gui/node_modules/.vite/deps/@radix-ui_react-scroll-area.js +0 -755
  47. package/packages/gui/node_modules/.vite/deps/@radix-ui_react-scroll-area.js.map +0 -7
  48. package/packages/gui/node_modules/.vite/deps/@radix-ui_react-select.js +0 -1254
  49. package/packages/gui/node_modules/.vite/deps/@radix-ui_react-select.js.map +0 -7
  50. package/packages/gui/node_modules/.vite/deps/@radix-ui_react-tabs.js +0 -436
  51. package/packages/gui/node_modules/.vite/deps/@radix-ui_react-tabs.js.map +0 -7
  52. package/packages/gui/node_modules/.vite/deps/@radix-ui_react-tooltip.js +0 -531
  53. package/packages/gui/node_modules/.vite/deps/@radix-ui_react-tooltip.js.map +0 -7
  54. package/packages/gui/node_modules/.vite/deps/@xterm_addon-fit.js +0 -46
  55. package/packages/gui/node_modules/.vite/deps/@xterm_addon-fit.js.map +0 -7
  56. package/packages/gui/node_modules/.vite/deps/@xterm_addon-web-links.js +0 -121
  57. package/packages/gui/node_modules/.vite/deps/@xterm_addon-web-links.js.map +0 -7
  58. package/packages/gui/node_modules/.vite/deps/@xterm_xterm.js +0 -9237
  59. package/packages/gui/node_modules/.vite/deps/@xterm_xterm.js.map +0 -7
  60. package/packages/gui/node_modules/.vite/deps/@xyflow_react.js +0 -9934
  61. package/packages/gui/node_modules/.vite/deps/@xyflow_react.js.map +0 -7
  62. package/packages/gui/node_modules/.vite/deps/_metadata.json +0 -265
  63. package/packages/gui/node_modules/.vite/deps/chunk-3EE34IFC.js +0 -5169
  64. package/packages/gui/node_modules/.vite/deps/chunk-3EE34IFC.js.map +0 -7
  65. package/packages/gui/node_modules/.vite/deps/chunk-3IB5EUP7.js +0 -2000
  66. package/packages/gui/node_modules/.vite/deps/chunk-3IB5EUP7.js.map +0 -7
  67. package/packages/gui/node_modules/.vite/deps/chunk-3LBP22MX.js +0 -1115
  68. package/packages/gui/node_modules/.vite/deps/chunk-3LBP22MX.js.map +0 -7
  69. package/packages/gui/node_modules/.vite/deps/chunk-3Q7HT7ZF.js +0 -701
  70. package/packages/gui/node_modules/.vite/deps/chunk-3Q7HT7ZF.js.map +0 -7
  71. package/packages/gui/node_modules/.vite/deps/chunk-44CLUOQE.js +0 -1776
  72. package/packages/gui/node_modules/.vite/deps/chunk-44CLUOQE.js.map +0 -7
  73. package/packages/gui/node_modules/.vite/deps/chunk-6DLNZUA5.js +0 -142
  74. package/packages/gui/node_modules/.vite/deps/chunk-6DLNZUA5.js.map +0 -7
  75. package/packages/gui/node_modules/.vite/deps/chunk-ACEP5X2F.js +0 -292
  76. package/packages/gui/node_modules/.vite/deps/chunk-ACEP5X2F.js.map +0 -7
  77. package/packages/gui/node_modules/.vite/deps/chunk-AZUN7XMC.js +0 -87
  78. package/packages/gui/node_modules/.vite/deps/chunk-AZUN7XMC.js.map +0 -7
  79. package/packages/gui/node_modules/.vite/deps/chunk-CDLO3JFW.js +0 -1004
  80. package/packages/gui/node_modules/.vite/deps/chunk-CDLO3JFW.js.map +0 -7
  81. package/packages/gui/node_modules/.vite/deps/chunk-HPXOV7QR.js +0 -23
  82. package/packages/gui/node_modules/.vite/deps/chunk-HPXOV7QR.js.map +0 -7
  83. package/packages/gui/node_modules/.vite/deps/chunk-HVFOBSCQ.js +0 -1062
  84. package/packages/gui/node_modules/.vite/deps/chunk-HVFOBSCQ.js.map +0 -7
  85. package/packages/gui/node_modules/.vite/deps/chunk-I2PYXDFH.js +0 -1106
  86. package/packages/gui/node_modules/.vite/deps/chunk-I2PYXDFH.js.map +0 -7
  87. package/packages/gui/node_modules/.vite/deps/chunk-JPXYHBLX.js +0 -306
  88. package/packages/gui/node_modules/.vite/deps/chunk-JPXYHBLX.js.map +0 -7
  89. package/packages/gui/node_modules/.vite/deps/chunk-JYDZ3XIW.js +0 -264
  90. package/packages/gui/node_modules/.vite/deps/chunk-JYDZ3XIW.js.map +0 -7
  91. package/packages/gui/node_modules/.vite/deps/chunk-PR4QN5HX.js +0 -42
  92. package/packages/gui/node_modules/.vite/deps/chunk-PR4QN5HX.js.map +0 -7
  93. package/packages/gui/node_modules/.vite/deps/chunk-QZQGPDRM.js +0 -2328
  94. package/packages/gui/node_modules/.vite/deps/chunk-QZQGPDRM.js.map +0 -7
  95. package/packages/gui/node_modules/.vite/deps/chunk-RE2FU7ZU.js +0 -10985
  96. package/packages/gui/node_modules/.vite/deps/chunk-RE2FU7ZU.js.map +0 -7
  97. package/packages/gui/node_modules/.vite/deps/chunk-UO4Y2XXS.js +0 -105
  98. package/packages/gui/node_modules/.vite/deps/chunk-UO4Y2XXS.js.map +0 -7
  99. package/packages/gui/node_modules/.vite/deps/chunk-VW6LO3QI.js +0 -9
  100. package/packages/gui/node_modules/.vite/deps/chunk-VW6LO3QI.js.map +0 -7
  101. package/packages/gui/node_modules/.vite/deps/chunk-YAD7VOVN.js +0 -280
  102. package/packages/gui/node_modules/.vite/deps/chunk-YAD7VOVN.js.map +0 -7
  103. package/packages/gui/node_modules/.vite/deps/chunk-YYJMNVCJ.js +0 -3459
  104. package/packages/gui/node_modules/.vite/deps/chunk-YYJMNVCJ.js.map +0 -7
  105. package/packages/gui/node_modules/.vite/deps/clsx.js +0 -22
  106. package/packages/gui/node_modules/.vite/deps/clsx.js.map +0 -7
  107. package/packages/gui/node_modules/.vite/deps/framer-motion.js +0 -12732
  108. package/packages/gui/node_modules/.vite/deps/framer-motion.js.map +0 -7
  109. package/packages/gui/node_modules/.vite/deps/lucide-react.js +0 -29653
  110. package/packages/gui/node_modules/.vite/deps/lucide-react.js.map +0 -7
  111. package/packages/gui/node_modules/.vite/deps/package.json +0 -3
  112. package/packages/gui/node_modules/.vite/deps/react-dom.js +0 -6
  113. package/packages/gui/node_modules/.vite/deps/react-dom.js.map +0 -7
  114. package/packages/gui/node_modules/.vite/deps/react-dom_client.js +0 -20217
  115. package/packages/gui/node_modules/.vite/deps/react-dom_client.js.map +0 -7
  116. package/packages/gui/node_modules/.vite/deps/react.js +0 -5
  117. package/packages/gui/node_modules/.vite/deps/react.js.map +0 -7
  118. package/packages/gui/node_modules/.vite/deps/react_jsx-dev-runtime.js +0 -278
  119. package/packages/gui/node_modules/.vite/deps/react_jsx-dev-runtime.js.map +0 -7
  120. package/packages/gui/node_modules/.vite/deps/react_jsx-runtime.js +0 -6
  121. package/packages/gui/node_modules/.vite/deps/react_jsx-runtime.js.map +0 -7
  122. package/packages/gui/node_modules/.vite/deps/tailwind-merge.js +0 -3263
  123. package/packages/gui/node_modules/.vite/deps/tailwind-merge.js.map +0 -7
  124. package/packages/gui/node_modules/.vite/deps/zustand.js +0 -56
  125. package/packages/gui/node_modules/.vite/deps/zustand.js.map +0 -7
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../../node_modules/@radix-ui/primitive/src/primitive.tsx", "../../../../../node_modules/@radix-ui/react-compose-refs/src/compose-refs.tsx", "../../../../../node_modules/@radix-ui/react-context/src/create-context.tsx", "../../../../../node_modules/@radix-ui/react-use-layout-effect/src/use-layout-effect.tsx", "../../../../../node_modules/@radix-ui/react-slot/src/slot.tsx", "../../../../../node_modules/@radix-ui/react-primitive/src/primitive.tsx", "../../../../../node_modules/@radix-ui/react-use-callback-ref/src/use-callback-ref.tsx"],
4
- "sourcesContent": ["/* eslint-disable no-restricted-properties */\n\n/* eslint-disable no-restricted-globals */\nexport const canUseDOM = !!(\n typeof window !== 'undefined' &&\n window.document &&\n window.document.createElement\n);\n/* eslint-enable no-restricted-globals */\n\nexport function composeEventHandlers<E extends { defaultPrevented: boolean }>(\n originalEventHandler?: (event: E) => void,\n ourEventHandler?: (event: E) => void,\n { checkForDefaultPrevented = true } = {}\n) {\n return function handleEvent(event: E) {\n originalEventHandler?.(event);\n\n if (checkForDefaultPrevented === false || !event.defaultPrevented) {\n return ourEventHandler?.(event);\n }\n };\n}\n\nexport function getOwnerWindow(element: Node | null | undefined) {\n if (!canUseDOM) {\n throw new Error('Cannot access window outside of the DOM');\n }\n // eslint-disable-next-line no-restricted-globals\n return element?.ownerDocument?.defaultView ?? window;\n}\n\nexport function getOwnerDocument(element: Node | null | undefined) {\n if (!canUseDOM) {\n throw new Error('Cannot access document outside of the DOM');\n }\n // eslint-disable-next-line no-restricted-globals\n return element?.ownerDocument ?? document;\n}\n\n/**\n * Lifted from https://github.com/ariakit/ariakit/blob/main/packages/ariakit-core/src/utils/dom.ts#L37\n * MIT License, Copyright (c) AriaKit.\n */\nexport function getActiveElement(\n node: Node | null | undefined,\n activeDescendant = false\n): HTMLElement | null {\n const { activeElement } = getOwnerDocument(node);\n if (!activeElement?.nodeName) {\n // `activeElement` might be an empty object if we're interacting with elements\n // inside of an iframe.\n return null;\n }\n\n if (isFrame(activeElement) && activeElement.contentDocument) {\n return getActiveElement(activeElement.contentDocument.body, activeDescendant);\n }\n\n if (activeDescendant) {\n const id = activeElement.getAttribute('aria-activedescendant');\n if (id) {\n const element = getOwnerDocument(activeElement).getElementById(id);\n if (element) {\n return element;\n }\n }\n }\n\n return activeElement as HTMLElement | null;\n}\n\nexport function isFrame(element: Element): element is HTMLIFrameElement {\n return element.tagName === 'IFRAME';\n}\n", "import * as React from 'react';\n\ntype PossibleRef<T> = React.Ref<T> | undefined;\n\n/**\n * Set a given ref to a given value\n * This utility takes care of different types of refs: callback refs and RefObject(s)\n */\nfunction setRef<T>(ref: PossibleRef<T>, value: T) {\n if (typeof ref === 'function') {\n return ref(value);\n } else if (ref !== null && ref !== undefined) {\n ref.current = value;\n }\n}\n\n/**\n * A utility to compose multiple refs together\n * Accepts callback refs and RefObject(s)\n */\nfunction composeRefs<T>(...refs: PossibleRef<T>[]): React.RefCallback<T> {\n return (node) => {\n let hasCleanup = false;\n const cleanups = refs.map((ref) => {\n const cleanup = setRef(ref, node);\n if (!hasCleanup && typeof cleanup == 'function') {\n hasCleanup = true;\n }\n return cleanup;\n });\n\n // React <19 will log an error to the console if a callback ref returns a\n // value. We don't use ref cleanups internally so this will only happen if a\n // user's ref callback returns a value, which we only expect if they are\n // using the cleanup functionality added in React 19.\n if (hasCleanup) {\n return () => {\n for (let i = 0; i < cleanups.length; i++) {\n const cleanup = cleanups[i];\n if (typeof cleanup == 'function') {\n cleanup();\n } else {\n setRef(refs[i], null);\n }\n }\n };\n }\n };\n}\n\n/**\n * A custom hook that composes multiple refs\n * Accepts callback refs and RefObject(s)\n */\nfunction useComposedRefs<T>(...refs: PossibleRef<T>[]): React.RefCallback<T> {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n return React.useCallback(composeRefs(...refs), refs);\n}\n\nexport { composeRefs, useComposedRefs };\n", "import * as React from 'react';\n\nfunction createContext<ContextValueType extends object | null>(\n rootComponentName: string,\n defaultContext?: ContextValueType\n) {\n const Context = React.createContext<ContextValueType | undefined>(defaultContext);\n\n const Provider: React.FC<ContextValueType & { children: React.ReactNode }> = (props) => {\n const { children, ...context } = props;\n // Only re-memoize when prop values change\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const value = React.useMemo(() => context, Object.values(context)) as ContextValueType;\n return <Context.Provider value={value}>{children}</Context.Provider>;\n };\n\n Provider.displayName = rootComponentName + 'Provider';\n\n function useContext(consumerName: string) {\n const context = React.useContext(Context);\n if (context) return context;\n if (defaultContext !== undefined) return defaultContext;\n // if a defaultContext wasn't specified, it's a required context.\n throw new Error(`\\`${consumerName}\\` must be used within \\`${rootComponentName}\\``);\n }\n\n return [Provider, useContext] as const;\n}\n\n/* -------------------------------------------------------------------------------------------------\n * createContextScope\n * -----------------------------------------------------------------------------------------------*/\n\ntype Scope<C = any> = { [scopeName: string]: React.Context<C>[] } | undefined;\ntype ScopeHook = (scope: Scope) => { [__scopeProp: string]: Scope };\ninterface CreateScope {\n scopeName: string;\n (): ScopeHook;\n}\n\nfunction createContextScope(scopeName: string, createContextScopeDeps: CreateScope[] = []) {\n let defaultContexts: any[] = [];\n\n /* -----------------------------------------------------------------------------------------------\n * createContext\n * ---------------------------------------------------------------------------------------------*/\n\n function createContext<ContextValueType extends object | null>(\n rootComponentName: string,\n defaultContext?: ContextValueType\n ) {\n const BaseContext = React.createContext<ContextValueType | undefined>(defaultContext);\n const index = defaultContexts.length;\n defaultContexts = [...defaultContexts, defaultContext];\n\n const Provider: React.FC<\n ContextValueType & { scope: Scope<ContextValueType>; children: React.ReactNode }\n > = (props) => {\n const { scope, children, ...context } = props;\n const Context = scope?.[scopeName]?.[index] || BaseContext;\n // Only re-memoize when prop values change\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const value = React.useMemo(() => context, Object.values(context)) as ContextValueType;\n return <Context.Provider value={value}>{children}</Context.Provider>;\n };\n\n Provider.displayName = rootComponentName + 'Provider';\n\n function useContext(consumerName: string, scope: Scope<ContextValueType | undefined>) {\n const Context = scope?.[scopeName]?.[index] || BaseContext;\n const context = React.useContext(Context);\n if (context) return context;\n if (defaultContext !== undefined) return defaultContext;\n // if a defaultContext wasn't specified, it's a required context.\n throw new Error(`\\`${consumerName}\\` must be used within \\`${rootComponentName}\\``);\n }\n\n return [Provider, useContext] as const;\n }\n\n /* -----------------------------------------------------------------------------------------------\n * createScope\n * ---------------------------------------------------------------------------------------------*/\n\n const createScope: CreateScope = () => {\n const scopeContexts = defaultContexts.map((defaultContext) => {\n return React.createContext(defaultContext);\n });\n return function useScope(scope: Scope) {\n const contexts = scope?.[scopeName] || scopeContexts;\n return React.useMemo(\n () => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),\n [scope, contexts]\n );\n };\n };\n\n createScope.scopeName = scopeName;\n return [createContext, composeContextScopes(createScope, ...createContextScopeDeps)] as const;\n}\n\n/* -------------------------------------------------------------------------------------------------\n * composeContextScopes\n * -----------------------------------------------------------------------------------------------*/\n\nfunction composeContextScopes(...scopes: CreateScope[]) {\n const baseScope = scopes[0];\n if (scopes.length === 1) return baseScope;\n\n const createScope: CreateScope = () => {\n const scopeHooks = scopes.map((createScope) => ({\n useScope: createScope(),\n scopeName: createScope.scopeName,\n }));\n\n return function useComposedScopes(overrideScopes) {\n const nextScopes = scopeHooks.reduce((nextScopes, { useScope, scopeName }) => {\n // We are calling a hook inside a callback which React warns against to avoid inconsistent\n // renders, however, scoping doesn't have render side effects so we ignore the rule.\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const scopeProps = useScope(overrideScopes);\n const currentScope = scopeProps[`__scope${scopeName}`];\n return { ...nextScopes, ...currentScope };\n }, {});\n\n return React.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);\n };\n };\n\n createScope.scopeName = baseScope.scopeName;\n return createScope;\n}\n\n/* -----------------------------------------------------------------------------------------------*/\n\nexport { createContext, createContextScope };\nexport type { CreateScope, Scope };\n", "import * as React from 'react';\n\n/**\n * On the server, React emits a warning when calling `useLayoutEffect`.\n * This is because neither `useLayoutEffect` nor `useEffect` run on the server.\n * We use this safe version which suppresses the warning by replacing it with a noop on the server.\n *\n * See: https://reactjs.org/docs/hooks-reference.html#uselayouteffect\n */\nconst useLayoutEffect = globalThis?.document ? React.useLayoutEffect : () => {};\n\nexport { useLayoutEffect };\n", "import * as React from 'react';\nimport { composeRefs } from '@radix-ui/react-compose-refs';\n\n/* -------------------------------------------------------------------------------------------------\n * Slot\n * -----------------------------------------------------------------------------------------------*/\n\ninterface SlotProps extends React.HTMLAttributes<HTMLElement> {\n children?: React.ReactNode;\n}\n\n/* @__NO_SIDE_EFFECTS__ */ export function createSlot(ownerName: string) {\n const SlotClone = createSlotClone(ownerName);\n const Slot = React.forwardRef<HTMLElement, SlotProps>((props, forwardedRef) => {\n const { children, ...slotProps } = props;\n const childrenArray = React.Children.toArray(children);\n const slottable = childrenArray.find(isSlottable);\n\n if (slottable) {\n // the new element to render is the one passed as a child of `Slottable`\n const newElement = slottable.props.children;\n\n const newChildren = childrenArray.map((child) => {\n if (child === slottable) {\n // because the new element will be the one rendered, we are only interested\n // in grabbing its children (`newElement.props.children`)\n if (React.Children.count(newElement) > 1) return React.Children.only(null);\n return React.isValidElement(newElement)\n ? (newElement.props as { children: React.ReactNode }).children\n : null;\n } else {\n return child;\n }\n });\n\n return (\n <SlotClone {...slotProps} ref={forwardedRef}>\n {React.isValidElement(newElement)\n ? React.cloneElement(newElement, undefined, newChildren)\n : null}\n </SlotClone>\n );\n }\n\n return (\n <SlotClone {...slotProps} ref={forwardedRef}>\n {children}\n </SlotClone>\n );\n });\n\n Slot.displayName = `${ownerName}.Slot`;\n return Slot;\n}\n\nconst Slot = createSlot('Slot');\n\n/* -------------------------------------------------------------------------------------------------\n * SlotClone\n * -----------------------------------------------------------------------------------------------*/\n\ninterface SlotCloneProps {\n children: React.ReactNode;\n}\n\n/* @__NO_SIDE_EFFECTS__ */ function createSlotClone(ownerName: string) {\n const SlotClone = React.forwardRef<any, SlotCloneProps>((props, forwardedRef) => {\n const { children, ...slotProps } = props;\n\n if (React.isValidElement(children)) {\n const childrenRef = getElementRef(children);\n const props = mergeProps(slotProps, children.props as AnyProps);\n // do not pass ref to React.Fragment for React 19 compatibility\n if (children.type !== React.Fragment) {\n props.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;\n }\n return React.cloneElement(children, props);\n }\n\n return React.Children.count(children) > 1 ? React.Children.only(null) : null;\n });\n\n SlotClone.displayName = `${ownerName}.SlotClone`;\n return SlotClone;\n}\n\n/* -------------------------------------------------------------------------------------------------\n * Slottable\n * -----------------------------------------------------------------------------------------------*/\n\nconst SLOTTABLE_IDENTIFIER = Symbol('radix.slottable');\n\ninterface SlottableProps {\n children: React.ReactNode;\n}\n\ninterface SlottableComponent extends React.FC<SlottableProps> {\n __radixId: symbol;\n}\n\n/* @__NO_SIDE_EFFECTS__ */ export function createSlottable(ownerName: string) {\n const Slottable: SlottableComponent = ({ children }) => {\n return <>{children}</>;\n };\n Slottable.displayName = `${ownerName}.Slottable`;\n Slottable.__radixId = SLOTTABLE_IDENTIFIER;\n return Slottable;\n}\n\nconst Slottable = createSlottable('Slottable');\n\n/* ---------------------------------------------------------------------------------------------- */\n\ntype AnyProps = Record<string, any>;\n\nfunction isSlottable(\n child: React.ReactNode\n): child is React.ReactElement<SlottableProps, typeof Slottable> {\n return (\n React.isValidElement(child) &&\n typeof child.type === 'function' &&\n '__radixId' in child.type &&\n child.type.__radixId === SLOTTABLE_IDENTIFIER\n );\n}\n\nfunction mergeProps(slotProps: AnyProps, childProps: AnyProps) {\n // all child props should override\n const overrideProps = { ...childProps };\n\n for (const propName in childProps) {\n const slotPropValue = slotProps[propName];\n const childPropValue = childProps[propName];\n\n const isHandler = /^on[A-Z]/.test(propName);\n if (isHandler) {\n // if the handler exists on both, we compose them\n if (slotPropValue && childPropValue) {\n overrideProps[propName] = (...args: unknown[]) => {\n const result = childPropValue(...args);\n slotPropValue(...args);\n return result;\n };\n }\n // but if it exists only on the slot, we use only this one\n else if (slotPropValue) {\n overrideProps[propName] = slotPropValue;\n }\n }\n // if it's `style`, we merge them\n else if (propName === 'style') {\n overrideProps[propName] = { ...slotPropValue, ...childPropValue };\n } else if (propName === 'className') {\n overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(' ');\n }\n }\n\n return { ...slotProps, ...overrideProps };\n}\n\n// Before React 19 accessing `element.props.ref` will throw a warning and suggest using `element.ref`\n// After React 19 accessing `element.ref` does the opposite.\n// https://github.com/facebook/react/pull/28348\n//\n// Access the ref using the method that doesn't yield a warning.\nfunction getElementRef(element: React.ReactElement) {\n // React <=18 in DEV\n let getter = Object.getOwnPropertyDescriptor(element.props, 'ref')?.get;\n let mayWarn = getter && 'isReactWarning' in getter && getter.isReactWarning;\n if (mayWarn) {\n return (element as any).ref;\n }\n\n // React 19 in DEV\n getter = Object.getOwnPropertyDescriptor(element, 'ref')?.get;\n mayWarn = getter && 'isReactWarning' in getter && getter.isReactWarning;\n if (mayWarn) {\n return (element.props as { ref?: React.Ref<unknown> }).ref;\n }\n\n // Not DEV\n return (element.props as { ref?: React.Ref<unknown> }).ref || (element as any).ref;\n}\n\nexport {\n Slot,\n Slottable,\n //\n Slot as Root,\n};\nexport type { SlotProps };\n", "import * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport { createSlot } from '@radix-ui/react-slot';\n\nconst NODES = [\n 'a',\n 'button',\n 'div',\n 'form',\n 'h2',\n 'h3',\n 'img',\n 'input',\n 'label',\n 'li',\n 'nav',\n 'ol',\n 'p',\n 'select',\n 'span',\n 'svg',\n 'ul',\n] as const;\n\ntype Primitives = { [E in (typeof NODES)[number]]: PrimitiveForwardRefComponent<E> };\ntype PrimitivePropsWithRef<E extends React.ElementType> = React.ComponentPropsWithRef<E> & {\n asChild?: boolean;\n};\n\ninterface PrimitiveForwardRefComponent<E extends React.ElementType>\n extends React.ForwardRefExoticComponent<PrimitivePropsWithRef<E>> {}\n\n/* -------------------------------------------------------------------------------------------------\n * Primitive\n * -----------------------------------------------------------------------------------------------*/\n\nconst Primitive = NODES.reduce((primitive, node) => {\n const Slot = createSlot(`Primitive.${node}`);\n const Node = React.forwardRef((props: PrimitivePropsWithRef<typeof node>, forwardedRef: any) => {\n const { asChild, ...primitiveProps } = props;\n const Comp: any = asChild ? Slot : node;\n\n if (typeof window !== 'undefined') {\n (window as any)[Symbol.for('radix-ui')] = true;\n }\n\n return <Comp {...primitiveProps} ref={forwardedRef} />;\n });\n\n Node.displayName = `Primitive.${node}`;\n\n return { ...primitive, [node]: Node };\n}, {} as Primitives);\n\n/* -------------------------------------------------------------------------------------------------\n * Utils\n * -----------------------------------------------------------------------------------------------*/\n\n/**\n * Flush custom event dispatch\n * https://github.com/radix-ui/primitives/pull/1378\n *\n * React batches *all* event handlers since version 18, this introduces certain considerations when using custom event types.\n *\n * Internally, React prioritises events in the following order:\n * - discrete\n * - continuous\n * - default\n *\n * https://github.com/facebook/react/blob/a8a4742f1c54493df00da648a3f9d26e3db9c8b5/packages/react-dom/src/events/ReactDOMEventListener.js#L294-L350\n *\n * `discrete` is an important distinction as updates within these events are applied immediately.\n * React however, is not able to infer the priority of custom event types due to how they are detected internally.\n * Because of this, it's possible for updates from custom events to be unexpectedly batched when\n * dispatched by another `discrete` event.\n *\n * In order to ensure that updates from custom events are applied predictably, we need to manually flush the batch.\n * This utility should be used when dispatching a custom event from within another `discrete` event, this utility\n * is not necessary when dispatching known event types, or if dispatching a custom type inside a non-discrete event.\n * For example:\n *\n * dispatching a known click \uD83D\uDC4E\n * target.dispatchEvent(new Event(\u2018click\u2019))\n *\n * dispatching a custom type within a non-discrete event \uD83D\uDC4E\n * onScroll={(event) => event.target.dispatchEvent(new CustomEvent(\u2018customType\u2019))}\n *\n * dispatching a custom type within a `discrete` event \uD83D\uDC4D\n * onPointerDown={(event) => dispatchDiscreteCustomEvent(event.target, new CustomEvent(\u2018customType\u2019))}\n *\n * Note: though React classifies `focus`, `focusin` and `focusout` events as `discrete`, it's not recommended to use\n * this utility with them. This is because it's possible for those handlers to be called implicitly during render\n * e.g. when focus is within a component as it is unmounted, or when managing focus on mount.\n */\n\nfunction dispatchDiscreteCustomEvent<E extends CustomEvent>(target: E['target'], event: E) {\n if (target) ReactDOM.flushSync(() => target.dispatchEvent(event));\n}\n\n/* -----------------------------------------------------------------------------------------------*/\n\nconst Root = Primitive;\n\nexport {\n Primitive,\n //\n Root,\n //\n dispatchDiscreteCustomEvent,\n};\nexport type { PrimitivePropsWithRef };\n", "import * as React from 'react';\n\n/**\n * A custom hook that converts a callback to a ref to avoid triggering re-renders when passed as a\n * prop or avoid re-executing effects when passed as a dependency\n */\nfunction useCallbackRef<T extends (...args: any[]) => any>(callback: T | undefined): T {\n const callbackRef = React.useRef(callback);\n\n React.useEffect(() => {\n callbackRef.current = callback;\n });\n\n // https://github.com/facebook/react/issues/19240\n return React.useMemo(() => ((...args) => callbackRef.current?.(...args)) as T, []);\n}\n\nexport { useCallbackRef };\n"],
5
- "mappings": ";;;;;;;;;;;;;;AAGO,IAAM,YAAY,CAAC,EACxB,OAAO,WAAW,eAClB,OAAO,YACP,OAAO,SAAS;AAIX,SAAS,qBACd,sBACA,iBACA,EAAE,2BAA2B,KAAK,IAAI,CAAC,GACvC;AACA,SAAO,SAAS,YAAY,OAAU;AACpC,iEAAuB;AAEvB,QAAI,6BAA6B,SAAS,CAAC,MAAM,kBAAkB;AACjE,aAAO,mDAAkB;IAC3B;EACF;AACF;;;ACtBA,YAAuB;AAQvB,SAAS,OAAU,KAAqB,OAAU;AAChD,MAAI,OAAO,QAAQ,YAAY;AAC7B,WAAO,IAAI,KAAK;EAClB,WAAW,QAAQ,QAAQ,QAAQ,QAAW;AAC5C,QAAI,UAAU;EAChB;AACF;AAMA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AAI,UAAU,CAAC,IAAI;IAC5C;AAEA,eAAO,yBAAC,MAAA,EAAM,GAAG,gBAAgB,KAAK,aAAA,CAAc;EACtD,CAAC;AAED,OAAK,cAAc,aAAa,IAAI;AAEpC,SAAO,EAAE,GAAG,WAAW,CAAC,IAAI,GAAG,KAAK;AACtC,GAAG,CAAC,CAAe;AA2CnB,SAAS,4BAAmD,QAAqB,OAAU;AACzF,MAAI,OAAiB,CAAA,mBAAU,MAAM,OAAO,cAAc,KAAK,CAAC;AAClE;;;ACjGA,IAAAC,SAAuB;AAMvB,SAAS,eAAkD,UAA4B;AACrF,QAAM,cAAoB,cAAO,QAAQ;AAEnC,EAAA,iBAAU,MAAM;AACpB,gBAAY,UAAU;EACxB,CAAC;AAGD,SAAa,eAAQ,MAAO,IAAI,SAAA;;AAAS,6BAAY,YAAZ,qCAAsB,GAAG;KAAa,CAAC,CAAC;AACnF;",
6
- "names": ["React", "createContext", "useContext", "createScope", "nextScopes", "React", "useLayoutEffect", "React", "import_jsx_runtime", "Slot", "props", "Slottable", "Fragment", "React", "import_jsx_runtime", "Slot", "React"]
7
- }
@@ -1,264 +0,0 @@
1
- import {
2
- Primitive,
3
- composeEventHandlers,
4
- dispatchDiscreteCustomEvent,
5
- useCallbackRef,
6
- useComposedRefs,
7
- useLayoutEffect2
8
- } from "./chunk-JPXYHBLX.js";
9
- import {
10
- require_react_dom
11
- } from "./chunk-YAD7VOVN.js";
12
- import {
13
- require_jsx_runtime
14
- } from "./chunk-ACEP5X2F.js";
15
- import {
16
- require_react
17
- } from "./chunk-CDLO3JFW.js";
18
- import {
19
- __toESM
20
- } from "./chunk-PR4QN5HX.js";
21
-
22
- // ../../node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs
23
- var React2 = __toESM(require_react(), 1);
24
-
25
- // ../../node_modules/@radix-ui/react-use-escape-keydown/dist/index.mjs
26
- var React = __toESM(require_react(), 1);
27
- function useEscapeKeydown(onEscapeKeyDownProp, ownerDocument = globalThis == null ? void 0 : globalThis.document) {
28
- const onEscapeKeyDown = useCallbackRef(onEscapeKeyDownProp);
29
- React.useEffect(() => {
30
- const handleKeyDown = (event) => {
31
- if (event.key === "Escape") {
32
- onEscapeKeyDown(event);
33
- }
34
- };
35
- ownerDocument.addEventListener("keydown", handleKeyDown, { capture: true });
36
- return () => ownerDocument.removeEventListener("keydown", handleKeyDown, { capture: true });
37
- }, [onEscapeKeyDown, ownerDocument]);
38
- }
39
-
40
- // ../../node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs
41
- var import_jsx_runtime = __toESM(require_jsx_runtime(), 1);
42
- var DISMISSABLE_LAYER_NAME = "DismissableLayer";
43
- var CONTEXT_UPDATE = "dismissableLayer.update";
44
- var POINTER_DOWN_OUTSIDE = "dismissableLayer.pointerDownOutside";
45
- var FOCUS_OUTSIDE = "dismissableLayer.focusOutside";
46
- var originalBodyPointerEvents;
47
- var DismissableLayerContext = React2.createContext({
48
- layers: /* @__PURE__ */ new Set(),
49
- layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
50
- branches: /* @__PURE__ */ new Set()
51
- });
52
- var DismissableLayer = React2.forwardRef(
53
- (props, forwardedRef) => {
54
- const {
55
- disableOutsidePointerEvents = false,
56
- onEscapeKeyDown,
57
- onPointerDownOutside,
58
- onFocusOutside,
59
- onInteractOutside,
60
- onDismiss,
61
- ...layerProps
62
- } = props;
63
- const context = React2.useContext(DismissableLayerContext);
64
- const [node, setNode] = React2.useState(null);
65
- const ownerDocument = (node == null ? void 0 : node.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document);
66
- const [, force] = React2.useState({});
67
- const composedRefs = useComposedRefs(forwardedRef, (node2) => setNode(node2));
68
- const layers = Array.from(context.layers);
69
- const [highestLayerWithOutsidePointerEventsDisabled] = [...context.layersWithOutsidePointerEventsDisabled].slice(-1);
70
- const highestLayerWithOutsidePointerEventsDisabledIndex = layers.indexOf(highestLayerWithOutsidePointerEventsDisabled);
71
- const index = node ? layers.indexOf(node) : -1;
72
- const isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0;
73
- const isPointerEventsEnabled = index >= highestLayerWithOutsidePointerEventsDisabledIndex;
74
- const pointerDownOutside = usePointerDownOutside((event) => {
75
- const target = event.target;
76
- const isPointerDownOnBranch = [...context.branches].some((branch) => branch.contains(target));
77
- if (!isPointerEventsEnabled || isPointerDownOnBranch) return;
78
- onPointerDownOutside == null ? void 0 : onPointerDownOutside(event);
79
- onInteractOutside == null ? void 0 : onInteractOutside(event);
80
- if (!event.defaultPrevented) onDismiss == null ? void 0 : onDismiss();
81
- }, ownerDocument);
82
- const focusOutside = useFocusOutside((event) => {
83
- const target = event.target;
84
- const isFocusInBranch = [...context.branches].some((branch) => branch.contains(target));
85
- if (isFocusInBranch) return;
86
- onFocusOutside == null ? void 0 : onFocusOutside(event);
87
- onInteractOutside == null ? void 0 : onInteractOutside(event);
88
- if (!event.defaultPrevented) onDismiss == null ? void 0 : onDismiss();
89
- }, ownerDocument);
90
- useEscapeKeydown((event) => {
91
- const isHighestLayer = index === context.layers.size - 1;
92
- if (!isHighestLayer) return;
93
- onEscapeKeyDown == null ? void 0 : onEscapeKeyDown(event);
94
- if (!event.defaultPrevented && onDismiss) {
95
- event.preventDefault();
96
- onDismiss();
97
- }
98
- }, ownerDocument);
99
- React2.useEffect(() => {
100
- if (!node) return;
101
- if (disableOutsidePointerEvents) {
102
- if (context.layersWithOutsidePointerEventsDisabled.size === 0) {
103
- originalBodyPointerEvents = ownerDocument.body.style.pointerEvents;
104
- ownerDocument.body.style.pointerEvents = "none";
105
- }
106
- context.layersWithOutsidePointerEventsDisabled.add(node);
107
- }
108
- context.layers.add(node);
109
- dispatchUpdate();
110
- return () => {
111
- if (disableOutsidePointerEvents && context.layersWithOutsidePointerEventsDisabled.size === 1) {
112
- ownerDocument.body.style.pointerEvents = originalBodyPointerEvents;
113
- }
114
- };
115
- }, [node, ownerDocument, disableOutsidePointerEvents, context]);
116
- React2.useEffect(() => {
117
- return () => {
118
- if (!node) return;
119
- context.layers.delete(node);
120
- context.layersWithOutsidePointerEventsDisabled.delete(node);
121
- dispatchUpdate();
122
- };
123
- }, [node, context]);
124
- React2.useEffect(() => {
125
- const handleUpdate = () => force({});
126
- document.addEventListener(CONTEXT_UPDATE, handleUpdate);
127
- return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate);
128
- }, []);
129
- return (0, import_jsx_runtime.jsx)(
130
- Primitive.div,
131
- {
132
- ...layerProps,
133
- ref: composedRefs,
134
- style: {
135
- pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? "auto" : "none" : void 0,
136
- ...props.style
137
- },
138
- onFocusCapture: composeEventHandlers(props.onFocusCapture, focusOutside.onFocusCapture),
139
- onBlurCapture: composeEventHandlers(props.onBlurCapture, focusOutside.onBlurCapture),
140
- onPointerDownCapture: composeEventHandlers(
141
- props.onPointerDownCapture,
142
- pointerDownOutside.onPointerDownCapture
143
- )
144
- }
145
- );
146
- }
147
- );
148
- DismissableLayer.displayName = DISMISSABLE_LAYER_NAME;
149
- var BRANCH_NAME = "DismissableLayerBranch";
150
- var DismissableLayerBranch = React2.forwardRef((props, forwardedRef) => {
151
- const context = React2.useContext(DismissableLayerContext);
152
- const ref = React2.useRef(null);
153
- const composedRefs = useComposedRefs(forwardedRef, ref);
154
- React2.useEffect(() => {
155
- const node = ref.current;
156
- if (node) {
157
- context.branches.add(node);
158
- return () => {
159
- context.branches.delete(node);
160
- };
161
- }
162
- }, [context.branches]);
163
- return (0, import_jsx_runtime.jsx)(Primitive.div, { ...props, ref: composedRefs });
164
- });
165
- DismissableLayerBranch.displayName = BRANCH_NAME;
166
- function usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis == null ? void 0 : globalThis.document) {
167
- const handlePointerDownOutside = useCallbackRef(onPointerDownOutside);
168
- const isPointerInsideReactTreeRef = React2.useRef(false);
169
- const handleClickRef = React2.useRef(() => {
170
- });
171
- React2.useEffect(() => {
172
- const handlePointerDown = (event) => {
173
- if (event.target && !isPointerInsideReactTreeRef.current) {
174
- let handleAndDispatchPointerDownOutsideEvent2 = function() {
175
- handleAndDispatchCustomEvent(
176
- POINTER_DOWN_OUTSIDE,
177
- handlePointerDownOutside,
178
- eventDetail,
179
- { discrete: true }
180
- );
181
- };
182
- var handleAndDispatchPointerDownOutsideEvent = handleAndDispatchPointerDownOutsideEvent2;
183
- const eventDetail = { originalEvent: event };
184
- if (event.pointerType === "touch") {
185
- ownerDocument.removeEventListener("click", handleClickRef.current);
186
- handleClickRef.current = handleAndDispatchPointerDownOutsideEvent2;
187
- ownerDocument.addEventListener("click", handleClickRef.current, { once: true });
188
- } else {
189
- handleAndDispatchPointerDownOutsideEvent2();
190
- }
191
- } else {
192
- ownerDocument.removeEventListener("click", handleClickRef.current);
193
- }
194
- isPointerInsideReactTreeRef.current = false;
195
- };
196
- const timerId = window.setTimeout(() => {
197
- ownerDocument.addEventListener("pointerdown", handlePointerDown);
198
- }, 0);
199
- return () => {
200
- window.clearTimeout(timerId);
201
- ownerDocument.removeEventListener("pointerdown", handlePointerDown);
202
- ownerDocument.removeEventListener("click", handleClickRef.current);
203
- };
204
- }, [ownerDocument, handlePointerDownOutside]);
205
- return {
206
- // ensures we check React component tree (not just DOM tree)
207
- onPointerDownCapture: () => isPointerInsideReactTreeRef.current = true
208
- };
209
- }
210
- function useFocusOutside(onFocusOutside, ownerDocument = globalThis == null ? void 0 : globalThis.document) {
211
- const handleFocusOutside = useCallbackRef(onFocusOutside);
212
- const isFocusInsideReactTreeRef = React2.useRef(false);
213
- React2.useEffect(() => {
214
- const handleFocus = (event) => {
215
- if (event.target && !isFocusInsideReactTreeRef.current) {
216
- const eventDetail = { originalEvent: event };
217
- handleAndDispatchCustomEvent(FOCUS_OUTSIDE, handleFocusOutside, eventDetail, {
218
- discrete: false
219
- });
220
- }
221
- };
222
- ownerDocument.addEventListener("focusin", handleFocus);
223
- return () => ownerDocument.removeEventListener("focusin", handleFocus);
224
- }, [ownerDocument, handleFocusOutside]);
225
- return {
226
- onFocusCapture: () => isFocusInsideReactTreeRef.current = true,
227
- onBlurCapture: () => isFocusInsideReactTreeRef.current = false
228
- };
229
- }
230
- function dispatchUpdate() {
231
- const event = new CustomEvent(CONTEXT_UPDATE);
232
- document.dispatchEvent(event);
233
- }
234
- function handleAndDispatchCustomEvent(name, handler, detail, { discrete }) {
235
- const target = detail.originalEvent.target;
236
- const event = new CustomEvent(name, { bubbles: false, cancelable: true, detail });
237
- if (handler) target.addEventListener(name, handler, { once: true });
238
- if (discrete) {
239
- dispatchDiscreteCustomEvent(target, event);
240
- } else {
241
- target.dispatchEvent(event);
242
- }
243
- }
244
-
245
- // ../../node_modules/@radix-ui/react-portal/dist/index.mjs
246
- var React3 = __toESM(require_react(), 1);
247
- var import_react_dom = __toESM(require_react_dom(), 1);
248
- var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1);
249
- var PORTAL_NAME = "Portal";
250
- var Portal = React3.forwardRef((props, forwardedRef) => {
251
- var _a;
252
- const { container: containerProp, ...portalProps } = props;
253
- const [mounted, setMounted] = React3.useState(false);
254
- useLayoutEffect2(() => setMounted(true), []);
255
- const container = containerProp || mounted && ((_a = globalThis == null ? void 0 : globalThis.document) == null ? void 0 : _a.body);
256
- return container ? import_react_dom.default.createPortal((0, import_jsx_runtime2.jsx)(Primitive.div, { ...portalProps, ref: forwardedRef }), container) : null;
257
- });
258
- Portal.displayName = PORTAL_NAME;
259
-
260
- export {
261
- DismissableLayer,
262
- Portal
263
- };
264
- //# sourceMappingURL=chunk-JYDZ3XIW.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../../node_modules/@radix-ui/react-dismissable-layer/src/dismissable-layer.tsx", "../../../../../node_modules/@radix-ui/react-use-escape-keydown/src/use-escape-keydown.tsx", "../../../../../node_modules/@radix-ui/react-portal/src/portal.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { Primitive, dispatchDiscreteCustomEvent } from '@radix-ui/react-primitive';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { useCallbackRef } from '@radix-ui/react-use-callback-ref';\nimport { useEscapeKeydown } from '@radix-ui/react-use-escape-keydown';\n\n/* -------------------------------------------------------------------------------------------------\n * DismissableLayer\n * -----------------------------------------------------------------------------------------------*/\n\nconst DISMISSABLE_LAYER_NAME = 'DismissableLayer';\nconst CONTEXT_UPDATE = 'dismissableLayer.update';\nconst POINTER_DOWN_OUTSIDE = 'dismissableLayer.pointerDownOutside';\nconst FOCUS_OUTSIDE = 'dismissableLayer.focusOutside';\n\nlet originalBodyPointerEvents: string;\n\nconst DismissableLayerContext = React.createContext({\n layers: new Set<DismissableLayerElement>(),\n layersWithOutsidePointerEventsDisabled: new Set<DismissableLayerElement>(),\n branches: new Set<DismissableLayerBranchElement>(),\n});\n\ntype DismissableLayerElement = React.ComponentRef<typeof Primitive.div>;\ntype PrimitiveDivProps = React.ComponentPropsWithoutRef<typeof Primitive.div>;\ninterface DismissableLayerProps extends PrimitiveDivProps {\n /**\n * When `true`, hover/focus/click interactions will be disabled on elements outside\n * the `DismissableLayer`. Users will need to click twice on outside elements to\n * interact with them: once to close the `DismissableLayer`, and again to trigger the element.\n */\n disableOutsidePointerEvents?: boolean;\n /**\n * Event handler called when the escape key is down.\n * Can be prevented.\n */\n onEscapeKeyDown?: (event: KeyboardEvent) => void;\n /**\n * Event handler called when the a `pointerdown` event happens outside of the `DismissableLayer`.\n * Can be prevented.\n */\n onPointerDownOutside?: (event: PointerDownOutsideEvent) => void;\n /**\n * Event handler called when the focus moves outside of the `DismissableLayer`.\n * Can be prevented.\n */\n onFocusOutside?: (event: FocusOutsideEvent) => void;\n /**\n * Event handler called when an interaction happens outside the `DismissableLayer`.\n * Specifically, when a `pointerdown` event happens outside or focus moves outside of it.\n * Can be prevented.\n */\n onInteractOutside?: (event: PointerDownOutsideEvent | FocusOutsideEvent) => void;\n /**\n * Handler called when the `DismissableLayer` should be dismissed\n */\n onDismiss?: () => void;\n}\n\nconst DismissableLayer = React.forwardRef<DismissableLayerElement, DismissableLayerProps>(\n (props, forwardedRef) => {\n const {\n disableOutsidePointerEvents = false,\n onEscapeKeyDown,\n onPointerDownOutside,\n onFocusOutside,\n onInteractOutside,\n onDismiss,\n ...layerProps\n } = props;\n const context = React.useContext(DismissableLayerContext);\n const [node, setNode] = React.useState<DismissableLayerElement | null>(null);\n const ownerDocument = node?.ownerDocument ?? globalThis?.document;\n const [, force] = React.useState({});\n const composedRefs = useComposedRefs(forwardedRef, (node) => setNode(node));\n const layers = Array.from(context.layers);\n const [highestLayerWithOutsidePointerEventsDisabled] = [...context.layersWithOutsidePointerEventsDisabled].slice(-1); // prettier-ignore\n const highestLayerWithOutsidePointerEventsDisabledIndex = layers.indexOf(highestLayerWithOutsidePointerEventsDisabled!); // prettier-ignore\n const index = node ? layers.indexOf(node) : -1;\n const isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0;\n const isPointerEventsEnabled = index >= highestLayerWithOutsidePointerEventsDisabledIndex;\n\n const pointerDownOutside = usePointerDownOutside((event) => {\n const target = event.target as HTMLElement;\n const isPointerDownOnBranch = [...context.branches].some((branch) => branch.contains(target));\n if (!isPointerEventsEnabled || isPointerDownOnBranch) return;\n onPointerDownOutside?.(event);\n onInteractOutside?.(event);\n if (!event.defaultPrevented) onDismiss?.();\n }, ownerDocument);\n\n const focusOutside = useFocusOutside((event) => {\n const target = event.target as HTMLElement;\n const isFocusInBranch = [...context.branches].some((branch) => branch.contains(target));\n if (isFocusInBranch) return;\n onFocusOutside?.(event);\n onInteractOutside?.(event);\n if (!event.defaultPrevented) onDismiss?.();\n }, ownerDocument);\n\n useEscapeKeydown((event) => {\n const isHighestLayer = index === context.layers.size - 1;\n if (!isHighestLayer) return;\n onEscapeKeyDown?.(event);\n if (!event.defaultPrevented && onDismiss) {\n event.preventDefault();\n onDismiss();\n }\n }, ownerDocument);\n\n React.useEffect(() => {\n if (!node) return;\n if (disableOutsidePointerEvents) {\n if (context.layersWithOutsidePointerEventsDisabled.size === 0) {\n originalBodyPointerEvents = ownerDocument.body.style.pointerEvents;\n ownerDocument.body.style.pointerEvents = 'none';\n }\n context.layersWithOutsidePointerEventsDisabled.add(node);\n }\n context.layers.add(node);\n dispatchUpdate();\n return () => {\n if (\n disableOutsidePointerEvents &&\n context.layersWithOutsidePointerEventsDisabled.size === 1\n ) {\n ownerDocument.body.style.pointerEvents = originalBodyPointerEvents;\n }\n };\n }, [node, ownerDocument, disableOutsidePointerEvents, context]);\n\n /**\n * We purposefully prevent combining this effect with the `disableOutsidePointerEvents` effect\n * because a change to `disableOutsidePointerEvents` would remove this layer from the stack\n * and add it to the end again so the layering order wouldn't be _creation order_.\n * We only want them to be removed from context stacks when unmounted.\n */\n React.useEffect(() => {\n return () => {\n if (!node) return;\n context.layers.delete(node);\n context.layersWithOutsidePointerEventsDisabled.delete(node);\n dispatchUpdate();\n };\n }, [node, context]);\n\n React.useEffect(() => {\n const handleUpdate = () => force({});\n document.addEventListener(CONTEXT_UPDATE, handleUpdate);\n return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate);\n }, []);\n\n return (\n <Primitive.div\n {...layerProps}\n ref={composedRefs}\n style={{\n pointerEvents: isBodyPointerEventsDisabled\n ? isPointerEventsEnabled\n ? 'auto'\n : 'none'\n : undefined,\n ...props.style,\n }}\n onFocusCapture={composeEventHandlers(props.onFocusCapture, focusOutside.onFocusCapture)}\n onBlurCapture={composeEventHandlers(props.onBlurCapture, focusOutside.onBlurCapture)}\n onPointerDownCapture={composeEventHandlers(\n props.onPointerDownCapture,\n pointerDownOutside.onPointerDownCapture\n )}\n />\n );\n }\n);\n\nDismissableLayer.displayName = DISMISSABLE_LAYER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DismissableLayerBranch\n * -----------------------------------------------------------------------------------------------*/\n\nconst BRANCH_NAME = 'DismissableLayerBranch';\n\ntype DismissableLayerBranchElement = React.ComponentRef<typeof Primitive.div>;\ninterface DismissableLayerBranchProps extends PrimitiveDivProps {}\n\nconst DismissableLayerBranch = React.forwardRef<\n DismissableLayerBranchElement,\n DismissableLayerBranchProps\n>((props, forwardedRef) => {\n const context = React.useContext(DismissableLayerContext);\n const ref = React.useRef<DismissableLayerBranchElement>(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n\n React.useEffect(() => {\n const node = ref.current;\n if (node) {\n context.branches.add(node);\n return () => {\n context.branches.delete(node);\n };\n }\n }, [context.branches]);\n\n return <Primitive.div {...props} ref={composedRefs} />;\n});\n\nDismissableLayerBranch.displayName = BRANCH_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\ntype PointerDownOutsideEvent = CustomEvent<{ originalEvent: PointerEvent }>;\ntype FocusOutsideEvent = CustomEvent<{ originalEvent: FocusEvent }>;\n\n/**\n * Listens for `pointerdown` outside a react subtree. We use `pointerdown` rather than `pointerup`\n * to mimic layer dismissing behaviour present in OS.\n * Returns props to pass to the node we want to check for outside events.\n */\nfunction usePointerDownOutside(\n onPointerDownOutside?: (event: PointerDownOutsideEvent) => void,\n ownerDocument: Document = globalThis?.document\n) {\n const handlePointerDownOutside = useCallbackRef(onPointerDownOutside) as EventListener;\n const isPointerInsideReactTreeRef = React.useRef(false);\n const handleClickRef = React.useRef(() => {});\n\n React.useEffect(() => {\n const handlePointerDown = (event: PointerEvent) => {\n if (event.target && !isPointerInsideReactTreeRef.current) {\n const eventDetail = { originalEvent: event };\n\n function handleAndDispatchPointerDownOutsideEvent() {\n handleAndDispatchCustomEvent(\n POINTER_DOWN_OUTSIDE,\n handlePointerDownOutside,\n eventDetail,\n { discrete: true }\n );\n }\n\n /**\n * On touch devices, we need to wait for a click event because browsers implement\n * a ~350ms delay between the time the user stops touching the display and when the\n * browser executres events. We need to ensure we don't reactivate pointer-events within\n * this timeframe otherwise the browser may execute events that should have been prevented.\n *\n * Additionally, this also lets us deal automatically with cancellations when a click event\n * isn't raised because the page was considered scrolled/drag-scrolled, long-pressed, etc.\n *\n * This is why we also continuously remove the previous listener, because we cannot be\n * certain that it was raised, and therefore cleaned-up.\n */\n if (event.pointerType === 'touch') {\n ownerDocument.removeEventListener('click', handleClickRef.current);\n handleClickRef.current = handleAndDispatchPointerDownOutsideEvent;\n ownerDocument.addEventListener('click', handleClickRef.current, { once: true });\n } else {\n handleAndDispatchPointerDownOutsideEvent();\n }\n } else {\n // We need to remove the event listener in case the outside click has been canceled.\n // See: https://github.com/radix-ui/primitives/issues/2171\n ownerDocument.removeEventListener('click', handleClickRef.current);\n }\n isPointerInsideReactTreeRef.current = false;\n };\n /**\n * if this hook executes in a component that mounts via a `pointerdown` event, the event\n * would bubble up to the document and trigger a `pointerDownOutside` event. We avoid\n * this by delaying the event listener registration on the document.\n * This is not React specific, but rather how the DOM works, ie:\n * ```\n * button.addEventListener('pointerdown', () => {\n * console.log('I will log');\n * document.addEventListener('pointerdown', () => {\n * console.log('I will also log');\n * })\n * });\n */\n const timerId = window.setTimeout(() => {\n ownerDocument.addEventListener('pointerdown', handlePointerDown);\n }, 0);\n return () => {\n window.clearTimeout(timerId);\n ownerDocument.removeEventListener('pointerdown', handlePointerDown);\n ownerDocument.removeEventListener('click', handleClickRef.current);\n };\n }, [ownerDocument, handlePointerDownOutside]);\n\n return {\n // ensures we check React component tree (not just DOM tree)\n onPointerDownCapture: () => (isPointerInsideReactTreeRef.current = true),\n };\n}\n\n/**\n * Listens for when focus happens outside a react subtree.\n * Returns props to pass to the root (node) of the subtree we want to check.\n */\nfunction useFocusOutside(\n onFocusOutside?: (event: FocusOutsideEvent) => void,\n ownerDocument: Document = globalThis?.document\n) {\n const handleFocusOutside = useCallbackRef(onFocusOutside) as EventListener;\n const isFocusInsideReactTreeRef = React.useRef(false);\n\n React.useEffect(() => {\n const handleFocus = (event: FocusEvent) => {\n if (event.target && !isFocusInsideReactTreeRef.current) {\n const eventDetail = { originalEvent: event };\n handleAndDispatchCustomEvent(FOCUS_OUTSIDE, handleFocusOutside, eventDetail, {\n discrete: false,\n });\n }\n };\n ownerDocument.addEventListener('focusin', handleFocus);\n return () => ownerDocument.removeEventListener('focusin', handleFocus);\n }, [ownerDocument, handleFocusOutside]);\n\n return {\n onFocusCapture: () => (isFocusInsideReactTreeRef.current = true),\n onBlurCapture: () => (isFocusInsideReactTreeRef.current = false),\n };\n}\n\nfunction dispatchUpdate() {\n const event = new CustomEvent(CONTEXT_UPDATE);\n document.dispatchEvent(event);\n}\n\nfunction handleAndDispatchCustomEvent<E extends CustomEvent, OriginalEvent extends Event>(\n name: string,\n handler: ((event: E) => void) | undefined,\n detail: { originalEvent: OriginalEvent } & (E extends CustomEvent<infer D> ? D : never),\n { discrete }: { discrete: boolean }\n) {\n const target = detail.originalEvent.target;\n const event = new CustomEvent(name, { bubbles: false, cancelable: true, detail });\n if (handler) target.addEventListener(name, handler as EventListener, { once: true });\n\n if (discrete) {\n dispatchDiscreteCustomEvent(target, event);\n } else {\n target.dispatchEvent(event);\n }\n}\n\nconst Root = DismissableLayer;\nconst Branch = DismissableLayerBranch;\n\nexport {\n DismissableLayer,\n DismissableLayerBranch,\n //\n Root,\n Branch,\n};\nexport type { DismissableLayerProps };\n", "import * as React from 'react';\nimport { useCallbackRef } from '@radix-ui/react-use-callback-ref';\n\n/**\n * Listens for when the escape key is down\n */\nfunction useEscapeKeydown(\n onEscapeKeyDownProp?: (event: KeyboardEvent) => void,\n ownerDocument: Document = globalThis?.document\n) {\n const onEscapeKeyDown = useCallbackRef(onEscapeKeyDownProp);\n\n React.useEffect(() => {\n const handleKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n onEscapeKeyDown(event);\n }\n };\n ownerDocument.addEventListener('keydown', handleKeyDown, { capture: true });\n return () => ownerDocument.removeEventListener('keydown', handleKeyDown, { capture: true });\n }, [onEscapeKeyDown, ownerDocument]);\n}\n\nexport { useEscapeKeydown };\n", "import * as React from 'react';\nimport ReactDOM from 'react-dom';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { useLayoutEffect } from '@radix-ui/react-use-layout-effect';\n\n/* -------------------------------------------------------------------------------------------------\n * Portal\n * -----------------------------------------------------------------------------------------------*/\n\nconst PORTAL_NAME = 'Portal';\n\ntype PortalElement = React.ComponentRef<typeof Primitive.div>;\ntype PrimitiveDivProps = React.ComponentPropsWithoutRef<typeof Primitive.div>;\ninterface PortalProps extends PrimitiveDivProps {\n /**\n * An optional container where the portaled content should be appended.\n */\n container?: Element | DocumentFragment | null;\n}\n\nconst Portal = React.forwardRef<PortalElement, PortalProps>((props, forwardedRef) => {\n const { container: containerProp, ...portalProps } = props;\n const [mounted, setMounted] = React.useState(false);\n useLayoutEffect(() => setMounted(true), []);\n const container = containerProp || (mounted && globalThis?.document?.body);\n return container\n ? ReactDOM.createPortal(<Primitive.div {...portalProps} ref={forwardedRef} />, container)\n : null;\n});\n\nPortal.displayName = PORTAL_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\nconst Root = Portal;\n\nexport {\n Portal,\n //\n Root,\n};\nexport type { PortalProps };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,SAAuB;;;ACAvB,YAAuB;AAMvB,SAAS,iBACP,qBACA,gBAA0B,yCAAY,UACtC;AACA,QAAM,kBAAkB,eAAe,mBAAmB;AAEpD,EAAA,gBAAU,MAAM;AACpB,UAAM,gBAAgB,CAAC,UAAyB;AAC9C,UAAI,MAAM,QAAQ,UAAU;AAC1B,wBAAgB,KAAK;MACvB;IACF;AACA,kBAAc,iBAAiB,WAAW,eAAe,EAAE,SAAS,KAAK,CAAC;AAC1E,WAAO,MAAM,cAAc,oBAAoB,WAAW,eAAe,EAAE,SAAS,KAAK,CAAC;EAC5F,GAAG,CAAC,iBAAiB,aAAa,CAAC;AACrC;;;ADqIM,yBAAA;AA/IN,IAAM,yBAAyB;AAC/B,IAAM,iBAAiB;AACvB,IAAM,uBAAuB;AAC7B,IAAM,gBAAgB;AAEtB,IAAI;AAEJ,IAAM,0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gCAA4B,QAAQ,KAAK;EAC3C,OAAO;AACL,WAAO,cAAc,KAAK;EAC5B;AACF;;;AE3VA,IAAAC,SAAuB;AACvB,uBAAqB;AAyBO,IAAAC,sBAAA;AAjB5B,IAAM,cAAc;AAWpB,IAAM,SAAe,kBAAuC,CAAC,OAAO,iBAAiB;;AACnF,QAAM,EAAE,WAAW,eAAe,GAAG,YAAY,IAAI;AACrD,QAAM,CAAC,SAAS,UAAU,IAAU,gBAAS,KAAK;AAClD,mBAAgB,MAAM,WAAW,IAAI,GAAG,CAAC,CAAC;AAC1C,QAAM,YAAY,iBAAkB,aAAW,8CAAY,aAAZ,mBAAsB;AACrE,SAAO,YACH,iBAAAC,QAAS,iBAAa,yBAAC,UAAU,KAAV,EAAe,GAAG,aAAa,KAAK,aAAA,CAAc,GAAI,SAAS,IACtF;AACN,CAAC;AAED,OAAO,cAAc;",
6
- "names": ["React", "node", "handleAndDispatchPointerDownOutsideEvent", "React", "import_jsx_runtime", "ReactDOM"]
7
- }
@@ -1,42 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
8
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
9
- }) : x)(function(x) {
10
- if (typeof require !== "undefined") return require.apply(this, arguments);
11
- throw Error('Dynamic require of "' + x + '" is not supported');
12
- });
13
- var __commonJS = (cb, mod) => function __require2() {
14
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
15
- };
16
- var __export = (target, all) => {
17
- for (var name in all)
18
- __defProp(target, name, { get: all[name], enumerable: true });
19
- };
20
- var __copyProps = (to, from, except, desc) => {
21
- if (from && typeof from === "object" || typeof from === "function") {
22
- for (let key of __getOwnPropNames(from))
23
- if (!__hasOwnProp.call(to, key) && key !== except)
24
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
25
- }
26
- return to;
27
- };
28
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
29
- // If the importer is in node compatibility mode or this is not an ESM
30
- // file that has been converted to a CommonJS file using a Babel-
31
- // compatible transform (i.e. "__esModule" has not been set), then set
32
- // "default" to the CommonJS "module.exports" for node compatibility.
33
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
34
- mod
35
- ));
36
-
37
- export {
38
- __require,
39
- __commonJS,
40
- __export,
41
- __toESM
42
- };
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": [],
4
- "sourcesContent": [],
5
- "mappings": "",
6
- "names": []
7
- }