@agent-native/core 0.11.0 → 0.11.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/dist/agent/thread-data-builder.d.ts +1 -0
  2. package/dist/agent/thread-data-builder.d.ts.map +1 -1
  3. package/dist/agent/thread-data-builder.js +1 -0
  4. package/dist/agent/thread-data-builder.js.map +1 -1
  5. package/dist/client/AgentPanel.d.ts.map +1 -1
  6. package/dist/client/AgentPanel.js +8 -45
  7. package/dist/client/AgentPanel.js.map +1 -1
  8. package/dist/client/AssistantChat.d.ts.map +1 -1
  9. package/dist/client/AssistantChat.js +76 -16
  10. package/dist/client/AssistantChat.js.map +1 -1
  11. package/dist/client/builder-frame.d.ts.map +1 -1
  12. package/dist/client/builder-frame.js +10 -3
  13. package/dist/client/builder-frame.js.map +1 -1
  14. package/dist/client/components/ui/dropdown-menu.js +2 -2
  15. package/dist/client/components/ui/dropdown-menu.js.map +1 -1
  16. package/dist/client/resources/ResourcesPanel.d.ts.map +1 -1
  17. package/dist/client/resources/ResourcesPanel.js +6 -6
  18. package/dist/client/resources/ResourcesPanel.js.map +1 -1
  19. package/dist/client/settings/useBuilderStatus.d.ts.map +1 -1
  20. package/dist/client/settings/useBuilderStatus.js +6 -2
  21. package/dist/client/settings/useBuilderStatus.js.map +1 -1
  22. package/dist/client/sharing/ShareButton.d.ts +2 -0
  23. package/dist/client/sharing/ShareButton.d.ts.map +1 -1
  24. package/dist/client/sharing/ShareButton.js +84 -24
  25. package/dist/client/sharing/ShareButton.js.map +1 -1
  26. package/dist/client/use-action.d.ts.map +1 -1
  27. package/dist/client/use-action.js +1 -0
  28. package/dist/client/use-action.js.map +1 -1
  29. package/dist/server/action-routes.d.ts.map +1 -1
  30. package/dist/server/action-routes.js +1 -0
  31. package/dist/server/action-routes.js.map +1 -1
  32. package/dist/server/agent-chat-plugin.d.ts +14 -0
  33. package/dist/server/agent-chat-plugin.d.ts.map +1 -1
  34. package/dist/server/agent-chat-plugin.js +77 -12
  35. package/dist/server/agent-chat-plugin.js.map +1 -1
  36. package/dist/server/builder-browser.d.ts +8 -6
  37. package/dist/server/builder-browser.d.ts.map +1 -1
  38. package/dist/server/builder-browser.js +54 -32
  39. package/dist/server/builder-browser.js.map +1 -1
  40. package/dist/server/core-routes-plugin.d.ts +7 -0
  41. package/dist/server/core-routes-plugin.d.ts.map +1 -1
  42. package/dist/server/core-routes-plugin.js +100 -74
  43. package/dist/server/core-routes-plugin.js.map +1 -1
  44. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"builder-frame.d.ts","sourceRoot":"","sources":["../../src/client/builder-frame.ts"],"names":[],"mappings":"AA2DA;;;;;;;;;;GAUG;AACH,wBAAgB,sBAAsB,IAAI,MAAM,GAAG,IAAI,CAgBtD;AAED,wBAAgB,gBAAgB,IAAI,OAAO,CAG1C;AAED,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAKpE;AAED,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,kBAAkB,GAAG,OAAO,CAyBnE;AAQD;;;;;;;;;;;GAWG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAI1E;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,gCAAgC,CAC9C,IAAI,EAAE,MAAM,GAAG,SAAS,GACvB,OAAO,CAIT"}
1
+ {"version":3,"file":"builder-frame.d.ts","sourceRoot":"","sources":["../../src/client/builder-frame.ts"],"names":[],"mappings":"AA6DA;;;;;;;;;;GAUG;AACH,wBAAgB,sBAAsB,IAAI,MAAM,GAAG,IAAI,CAgBtD;AAED,wBAAgB,gBAAgB,IAAI,OAAO,CAQ1C;AAED,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAKpE;AAED,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,kBAAkB,GAAG,OAAO,CAyBnE;AAQD;;;;;;;;;;;GAWG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAI1E;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,gCAAgC,CAC9C,IAAI,EAAE,MAAM,GAAG,SAAS,GACvB,OAAO,CAIT"}
@@ -52,8 +52,10 @@ function hasBuilderPreviewParams() {
52
52
  const params = new URLSearchParams(window.location.search);
53
53
  return (params.has("builder.space") ||
54
54
  params.has("builder.preview") ||
55
+ params.has("builder.frameEditing") ||
55
56
  params.has("builder.user.permissions") ||
56
- params.has("builder.user.role.name"));
57
+ params.has("builder.user.role.name") ||
58
+ params.has("__builder_editing__"));
57
59
  }
58
60
  /**
59
61
  * For *.builder.io / *.builder.my the parent origin alone is sufficient — those
@@ -86,9 +88,14 @@ export function getBuilderParentOrigin() {
86
88
  return null;
87
89
  }
88
90
  export function isInBuilderFrame() {
89
- if (typeof window === "undefined" || window.parent === window)
91
+ if (typeof window === "undefined")
90
92
  return false;
91
- return getBuilderParentOrigin() !== null;
93
+ if (getBuilderParentOrigin() !== null)
94
+ return true;
95
+ // Electron webviews run the preview as a top-level page, so there is no
96
+ // parent frame to inspect. Builder still marks those URLs with builder.*
97
+ // preview params, and sendToBuilderChat will use the console relay.
98
+ return hasBuilderPreviewParams();
92
99
  }
93
100
  export function isTrustedBuilderMessage(event) {
94
101
  if (typeof window === "undefined")
@@ -1 +1 @@
1
- {"version":3,"file":"builder-frame.js","sourceRoot":"","sources":["../../src/client/builder-frame.ts"],"names":[],"mappings":"AAAA,OAAO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AY,EAAE,CAAC,CACrD,CAAC;IACJ,CAAC;IAAC,MAAM,CAAC,CAAA,CAAC;IAEV,OAAO,IAAI,CAAC;AACd,CAAC;AAED,qEAAqE;AACrE,2EAA2E;AAC3E,8DAA8D;AAC9D,MAAM,qBAAqB,GACzB,kHAAkH,CAAC;AAErH;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,wBAAwB,CAAC,IAAwB;IAC/D,MAAM,CAAC,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IAC9B,IAAI,CAAC,CAAC;QAAE,OAAO,KAAK,CAAC;IACrB,OAAO,qBAAqB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACvC,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,gCAAgC,CAC9C,IAAwB;IAExB,IAAI,CAAC,gBAAgB,EAAE;QAAE,OAAO,KAAK,CAAC;IACtC,IAAI,CAAC,wBAAwB,CAAC,IAAI,CAAC;QAAE,OAAO,KAAK,CAAC;IAClD,OAAO,iBAAiB,CAAC,EAAE,OAAO,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;AAC3E,CAAC","sourcesContent":["import { getFrameOrigin } from \"./frame.js\";\n\nfunction normalizeOrigin(value: unknown): string | null {\n if (typeof value !== \"string\" || !value.trim()) return null;\n try {\n return new URL(value).origin;\n } catch {\n return null;\n }\n}\n\nfunction ancestorOrigin(): string | null {\n if (typeof window === \"undefined\") return null;\n const origins = (\n window.location as Location & { ancestorOrigins?: DOMStringList }\n ).ancestorOrigins;\n const first = origins?.[0];\n const fromAncestor = normalizeOrigin(first);\n if (fromAncestor) return fromAncestor;\n return normalizeOrigin(document.referrer);\n}\n\nfunction isStrictBuilderHost(origin: string | null): boolean {\n if (!origin) return false;\n try {\n const hostname = new URL(origin).hostname.toLowerCase();\n return (\n hostname === \"builder.io\" ||\n hostname.endsWith(\".builder.io\") ||\n hostname === \"builder.my\" ||\n hostname.endsWith(\".builder.my\")\n );\n } catch {\n return false;\n }\n}\n\nfunction isBuilderLikeOrigin(origin: string | null): boolean {\n if (!origin) return false;\n if (isStrictBuilderHost(origin)) return true;\n try {\n const hostname = new URL(origin).hostname.toLowerCase();\n return hostname === \"localhost\" || hostname === \"127.0.0.1\";\n } catch {\n return false;\n }\n}\n\nfunction hasBuilderPreviewParams(): boolean {\n if (typeof window === \"undefined\") return false;\n const params = new URLSearchParams(window.location.search);\n return (\n params.has(\"builder.space\") ||\n params.has(\"builder.preview\") ||\n params.has(\"builder.user.permissions\") ||\n params.has(\"builder.user.role.name\")\n );\n}\n\n/**\n * For *.builder.io / *.builder.my the parent origin alone is sufficient — those\n * are Builder-owned hosts and any iframe they load is by definition a Builder\n * editor session. For localhost we still require the legacy `?builder.*` query\n * params, because \"parent is localhost\" can mean anything in dev. The params\n * check existed historically as a belt-and-suspenders signal, but Builder's\n * Interact mode tunnels straight to the iframe URL without appending them, so\n * requiring them everywhere caused `isInBuilderFrame()` to return false for\n * real Builder editor sessions and `HomeChatPanel` submissions silently fell\n * through to `agentNative.submitChat` (which Builder ignores).\n */\nexport function getBuilderParentOrigin(): string | null {\n const frameOrigin = getFrameOrigin();\n if (frameOrigin) {\n if (isStrictBuilderHost(frameOrigin)) return frameOrigin;\n if (isBuilderLikeOrigin(frameOrigin) && hasBuilderPreviewParams()) {\n return frameOrigin;\n }\n }\n const origin = ancestorOrigin();\n if (origin) {\n if (isStrictBuilderHost(origin)) return origin;\n if (isBuilderLikeOrigin(origin) && hasBuilderPreviewParams()) {\n return origin;\n }\n }\n return null;\n}\n\nexport function isInBuilderFrame(): boolean {\n if (typeof window === \"undefined\" || window.parent === window) return false;\n return getBuilderParentOrigin() !== null;\n}\n\nexport function isTrustedBuilderMessage(event: MessageEvent): boolean {\n if (typeof window === \"undefined\") return false;\n const origin = getBuilderParentOrigin();\n if (!origin) return false;\n return event.origin === origin && event.source === window.parent;\n}\n\nexport interface BuilderChatMessage {\n message: string;\n context?: string;\n submit?: boolean;\n}\n\nexport function sendToBuilderChat(opts: BuilderChatMessage): boolean {\n if (typeof window === \"undefined\" || !opts.message?.trim()) return false;\n const target = window.parent !== window ? window.parent : window;\n const targetOrigin = getBuilderParentOrigin() ?? \"*\";\n const payload = {\n type: \"builder.submitChat\",\n data: {\n message: opts.message,\n context: opts.context,\n submit: opts.submit,\n },\n };\n target.postMessage(payload, targetOrigin);\n\n // Builder's Electron/webview relay watches console output because webviews\n // cannot always post directly to the app frame. Keep the payload small and\n // never include credential values in callers' context.\n try {\n console.log(\n \"BUILDER_PARENT_MESSAGE:\" +\n JSON.stringify({ message: payload, targetOrigin }),\n );\n } catch {}\n\n return true;\n}\n\n// Detect \"build/create/make/scaffold a new app/agent\" style prompts.\n// Within agent-native, \"agent\" and \"app\" are synonyms — every agent-native\n// app is an agent, so users phrase build requests either way.\nconst BUILD_APP_OR_AGENT_RE =\n /\\b(?:build|create|make|scaffold|generate)\\b[^.!?\\n]*?\\b(?:agent[-\\s]native\\s+)?(?:workspace\\s+)?(?:app|agent)\\b/i;\n\n/**\n * Returns true if `text` looks like a \"build me an app/agent\" request that\n * should hand off to the code-writing agent (Builder, local code agent, etc.)\n * rather than be answered by the embedded app's domain agent.\n *\n * Conservative: requires both an imperative build verb AND an explicit\n * \"app\" / \"agent\" target word in the same sentence. \"Build me a tool\",\n * \"build a recurring job\", \"create a destination\" do not match — they\n * don't end in \"app\"/\"agent\" so they stay on the local agent. \"Build me\n * an email app\" / \"create me an email agent\" do match — the target\n * word is \"app\" / \"agent\", not \"email\".\n */\nexport function isBuildAppOrAgentRequest(text: string | undefined): boolean {\n const t = (text ?? \"\").trim();\n if (!t) return false;\n return BUILD_APP_OR_AGENT_RE.test(t);\n}\n\n/**\n * If the user typed a \"build me an app/agent\" prompt while running inside\n * the Builder.io webview/iframe, hand the prompt up to the parent Builder\n * chat via `builder.submitChat`. Returns true when delegated.\n *\n * Why: Builder is the code-writing agent. When a workspace app (Dispatch,\n * Mail, etc.) is mounted inside Builder's webview and the user asks the\n * embedded chat to \"build an app\", the user almost certainly means the\n * already-open Builder chat session — not a separate Builder agent run\n * spawned through `start-workspace-app-creation`.\n */\nexport function tryDelegateBuildRequestToBuilder(\n text: string | undefined,\n): boolean {\n if (!isInBuilderFrame()) return false;\n if (!isBuildAppOrAgentRequest(text)) return false;\n return sendToBuilderChat({ message: (text ?? \"\").trim(), submit: true });\n}\n"]}
1
+ {"version":3,"file":"builder-frame.js","sourceRoot":"","sources":["../../src/client/builder-frame.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,SAAS,eAAe,CAAC,KAAc;IACrC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE;QAAE,OAAO,IAAI,CAAC;IAC5D,IAAI,CAAC;QACH,OAAO,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC;IAC/B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED,SAAS,cAAc;IACrB,IAAI,OAAO,MAAM,KAAK,WAAW;QAAE,OAAO,IAAI,CAAC;IAC/C,MAAM,OAAO,GACX,MAAM,CAAC,QACR,CAAC,eAAe,CAAC;IAClB,MAAM,KAAK,GAAG,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC;IAC3B,MAAM,YAAY,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC;IAC5C,IAAI,YAAY;QAAE,OAAO,YAAY,CAAC;IACtC,OAAO,eAAe,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AAC5C,CAAC;AAED,SAAS,mBAAmB,CAAC,MAAqB;IAChD,IAAI,CAAC,MAAM;QAAE,OAAO,KAAK,CAAC;IAC1B,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC,QA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AE,CAAC,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;AAC3E,CAAC","sourcesContent":["import { getFrameOrigin } from \"./frame.js\";\n\nfunction normalizeOrigin(value: unknown): string | null {\n if (typeof value !== \"string\" || !value.trim()) return null;\n try {\n return new URL(value).origin;\n } catch {\n return null;\n }\n}\n\nfunction ancestorOrigin(): string | null {\n if (typeof window === \"undefined\") return null;\n const origins = (\n window.location as Location & { ancestorOrigins?: DOMStringList }\n ).ancestorOrigins;\n const first = origins?.[0];\n const fromAncestor = normalizeOrigin(first);\n if (fromAncestor) return fromAncestor;\n return normalizeOrigin(document.referrer);\n}\n\nfunction isStrictBuilderHost(origin: string | null): boolean {\n if (!origin) return false;\n try {\n const hostname = new URL(origin).hostname.toLowerCase();\n return (\n hostname === \"builder.io\" ||\n hostname.endsWith(\".builder.io\") ||\n hostname === \"builder.my\" ||\n hostname.endsWith(\".builder.my\")\n );\n } catch {\n return false;\n }\n}\n\nfunction isBuilderLikeOrigin(origin: string | null): boolean {\n if (!origin) return false;\n if (isStrictBuilderHost(origin)) return true;\n try {\n const hostname = new URL(origin).hostname.toLowerCase();\n return hostname === \"localhost\" || hostname === \"127.0.0.1\";\n } catch {\n return false;\n }\n}\n\nfunction hasBuilderPreviewParams(): boolean {\n if (typeof window === \"undefined\") return false;\n const params = new URLSearchParams(window.location.search);\n return (\n params.has(\"builder.space\") ||\n params.has(\"builder.preview\") ||\n params.has(\"builder.frameEditing\") ||\n params.has(\"builder.user.permissions\") ||\n params.has(\"builder.user.role.name\") ||\n params.has(\"__builder_editing__\")\n );\n}\n\n/**\n * For *.builder.io / *.builder.my the parent origin alone is sufficient — those\n * are Builder-owned hosts and any iframe they load is by definition a Builder\n * editor session. For localhost we still require the legacy `?builder.*` query\n * params, because \"parent is localhost\" can mean anything in dev. The params\n * check existed historically as a belt-and-suspenders signal, but Builder's\n * Interact mode tunnels straight to the iframe URL without appending them, so\n * requiring them everywhere caused `isInBuilderFrame()` to return false for\n * real Builder editor sessions and `HomeChatPanel` submissions silently fell\n * through to `agentNative.submitChat` (which Builder ignores).\n */\nexport function getBuilderParentOrigin(): string | null {\n const frameOrigin = getFrameOrigin();\n if (frameOrigin) {\n if (isStrictBuilderHost(frameOrigin)) return frameOrigin;\n if (isBuilderLikeOrigin(frameOrigin) && hasBuilderPreviewParams()) {\n return frameOrigin;\n }\n }\n const origin = ancestorOrigin();\n if (origin) {\n if (isStrictBuilderHost(origin)) return origin;\n if (isBuilderLikeOrigin(origin) && hasBuilderPreviewParams()) {\n return origin;\n }\n }\n return null;\n}\n\nexport function isInBuilderFrame(): boolean {\n if (typeof window === \"undefined\") return false;\n if (getBuilderParentOrigin() !== null) return true;\n\n // Electron webviews run the preview as a top-level page, so there is no\n // parent frame to inspect. Builder still marks those URLs with builder.*\n // preview params, and sendToBuilderChat will use the console relay.\n return hasBuilderPreviewParams();\n}\n\nexport function isTrustedBuilderMessage(event: MessageEvent): boolean {\n if (typeof window === \"undefined\") return false;\n const origin = getBuilderParentOrigin();\n if (!origin) return false;\n return event.origin === origin && event.source === window.parent;\n}\n\nexport interface BuilderChatMessage {\n message: string;\n context?: string;\n submit?: boolean;\n}\n\nexport function sendToBuilderChat(opts: BuilderChatMessage): boolean {\n if (typeof window === \"undefined\" || !opts.message?.trim()) return false;\n const target = window.parent !== window ? window.parent : window;\n const targetOrigin = getBuilderParentOrigin() ?? \"*\";\n const payload = {\n type: \"builder.submitChat\",\n data: {\n message: opts.message,\n context: opts.context,\n submit: opts.submit,\n },\n };\n target.postMessage(payload, targetOrigin);\n\n // Builder's Electron/webview relay watches console output because webviews\n // cannot always post directly to the app frame. Keep the payload small and\n // never include credential values in callers' context.\n try {\n console.log(\n \"BUILDER_PARENT_MESSAGE:\" +\n JSON.stringify({ message: payload, targetOrigin }),\n );\n } catch {}\n\n return true;\n}\n\n// Detect \"build/create/make/scaffold a new app/agent\" style prompts.\n// Within agent-native, \"agent\" and \"app\" are synonyms — every agent-native\n// app is an agent, so users phrase build requests either way.\nconst BUILD_APP_OR_AGENT_RE =\n /\\b(?:build|create|make|scaffold|generate)\\b[^.!?\\n]*?\\b(?:agent[-\\s]native\\s+)?(?:workspace\\s+)?(?:app|agent)\\b/i;\n\n/**\n * Returns true if `text` looks like a \"build me an app/agent\" request that\n * should hand off to the code-writing agent (Builder, local code agent, etc.)\n * rather than be answered by the embedded app's domain agent.\n *\n * Conservative: requires both an imperative build verb AND an explicit\n * \"app\" / \"agent\" target word in the same sentence. \"Build me a tool\",\n * \"build a recurring job\", \"create a destination\" do not match — they\n * don't end in \"app\"/\"agent\" so they stay on the local agent. \"Build me\n * an email app\" / \"create me an email agent\" do match — the target\n * word is \"app\" / \"agent\", not \"email\".\n */\nexport function isBuildAppOrAgentRequest(text: string | undefined): boolean {\n const t = (text ?? \"\").trim();\n if (!t) return false;\n return BUILD_APP_OR_AGENT_RE.test(t);\n}\n\n/**\n * If the user typed a \"build me an app/agent\" prompt while running inside\n * the Builder.io webview/iframe, hand the prompt up to the parent Builder\n * chat via `builder.submitChat`. Returns true when delegated.\n *\n * Why: Builder is the code-writing agent. When a workspace app (Dispatch,\n * Mail, etc.) is mounted inside Builder's webview and the user asks the\n * embedded chat to \"build an app\", the user almost certainly means the\n * already-open Builder chat session — not a separate Builder agent run\n * spawned through `start-workspace-app-creation`.\n */\nexport function tryDelegateBuildRequestToBuilder(\n text: string | undefined,\n): boolean {\n if (!isInBuilderFrame()) return false;\n if (!isBuildAppOrAgentRequest(text)) return false;\n return sendToBuilderChat({ message: (text ?? \"\").trim(), submit: true });\n}\n"]}
@@ -12,10 +12,10 @@ const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
12
12
  const DropdownMenuSubTrigger = React.forwardRef(({ className, inset, children, ...props }, ref) => (_jsxs(DropdownMenuPrimitive.SubTrigger, { ref: ref, className: cn("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent", inset && "pl-8", className), ...props, children: [children, _jsx(IconChevronRight, { className: "ml-auto h-4 w-4" })] })));
13
13
  DropdownMenuSubTrigger.displayName =
14
14
  DropdownMenuPrimitive.SubTrigger.displayName;
15
- const DropdownMenuSubContent = React.forwardRef(({ className, ...props }, ref) => (_jsx(DropdownMenuPrimitive.SubContent, { ref: ref, className: cn("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", className), ...props })));
15
+ const DropdownMenuSubContent = React.forwardRef(({ className, ...props }, ref) => (_jsx(DropdownMenuPrimitive.SubContent, { ref: ref, className: cn("z-50 min-w-[8rem] origin-[--radix-dropdown-menu-content-transform-origin] overflow-hidden rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-lg will-change-[transform,opacity] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:duration-100 data-[state=open]:duration-150 data-[state=closed]:ease-in data-[state=open]:ease-out data-[side=bottom]:slide-in-from-top-1 data-[side=left]:slide-in-from-right-1 data-[side=right]:slide-in-from-left-1 data-[side=top]:slide-in-from-bottom-1", className), ...props })));
16
16
  DropdownMenuSubContent.displayName =
17
17
  DropdownMenuPrimitive.SubContent.displayName;
18
- const DropdownMenuContent = React.forwardRef(({ className, sideOffset = 4, ...props }, ref) => (_jsx(DropdownMenuPrimitive.Portal, { children: _jsx(DropdownMenuPrimitive.Content, { ref: ref, sideOffset: sideOffset, className: cn("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", className), ...props }) })));
18
+ const DropdownMenuContent = React.forwardRef(({ className, sideOffset = 4, ...props }, ref) => (_jsx(DropdownMenuPrimitive.Portal, { children: _jsx(DropdownMenuPrimitive.Content, { ref: ref, sideOffset: sideOffset, className: cn("z-50 min-w-[8rem] origin-[--radix-dropdown-menu-content-transform-origin] overflow-hidden rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-md will-change-[transform,opacity] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:duration-100 data-[state=open]:duration-150 data-[state=closed]:ease-in data-[state=open]:ease-out data-[side=bottom]:slide-in-from-top-1 data-[side=left]:slide-in-from-right-1 data-[side=right]:slide-in-from-left-1 data-[side=top]:slide-in-from-bottom-1", className), ...props }) })));
19
19
  DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
20
20
  const DropdownMenuItem = React.forwardRef(({ className, inset, ...props }, ref) => (_jsx(DropdownMenuPrimitive.Item, { ref: ref, className: cn("relative flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", inset && "pl-8", className), ...props })));
21
21
  DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
@@ -1 +1 @@
1
- {"version":3,"file":"dropdown-menu.js","sourceRoot":"","sources":["../../../../src/client/components/ui/dropdown-menu.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,qBAAqB,MAAM,+BAA+B,CAAC;AACv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BAAqB,CAAC,WAAW,GAAG,qBAAqB,CAAC,SAAS,CAAC,WAAW,CAAC;AAEhF,MAAM,oBAAoB,GAAG,CAAC,EAC5B,SAAS,EACT,GAAG,KAAK,EAC8B,EAAE,EAAE,CAAC,CAC3C,eACE,SAAS,EAAE,EAAE,CAAC,4CAA4C,EAAE,SAAS,CAAC,KAClE,KAAK,GACT,CACH,CAAC;AACF,oBAAoB,CAAC,WAAW,GAAG,sBAAsB,CAAC;AAE1D,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,wBAAwB,EACxB,qBAAqB,EACrB,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACpB,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EACf,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,GACvB,CAAC","sourcesContent":["import * as React from \"react\";\nimport * as DropdownMenuPrimitive from \"@radix-ui/react-dropdown-menu\";\nimport { IconCheck, IconChevronRight, IconCircle } from \"@tabler/icons-react\";\n\nimport { cn } from \"../../utils.js\";\n\nconst DropdownMenu = DropdownMenuPrimitive.Root;\nconst DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;\nconst DropdownMenuGroup = DropdownMenuPrimitive.Group;\nconst DropdownMenuPortal = DropdownMenuPrimitive.Portal;\nconst DropdownMenuSub = DropdownMenuPrimitive.Sub;\nconst DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;\n\nconst DropdownMenuSubTrigger = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {\n inset?: boolean;\n }\n>(({ className, inset, children, ...props }, ref) => (\n <DropdownMenuPrimitive.SubTrigger\n ref={ref}\n className={cn(\n \"flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent\",\n inset && \"pl-8\",\n className,\n )}\n {...props}\n >\n {children}\n <IconChevronRight className=\"ml-auto h-4 w-4\" />\n </DropdownMenuPrimitive.SubTrigger>\n));\nDropdownMenuSubTrigger.displayName =\n DropdownMenuPrimitive.SubTrigger.displayName;\n\nconst DropdownMenuSubContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.SubContent\n ref={ref}\n className={cn(\n \"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\n className,\n )}\n {...props}\n />\n));\nDropdownMenuSubContent.displayName =\n DropdownMenuPrimitive.SubContent.displayName;\n\nconst DropdownMenuContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>\n>(({ className, sideOffset = 4, ...props }, ref) => (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n \"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\n className,\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n));\nDropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;\n\nconst DropdownMenuItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Item\n ref={ref}\n className={cn(\n \"relative flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50\",\n inset && \"pl-8\",\n className,\n )}\n {...props}\n />\n));\nDropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;\n\nconst DropdownMenuCheckboxItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>\n>(({ className, children, checked, ...props }, ref) => (\n <DropdownMenuPrimitive.CheckboxItem\n ref={ref}\n className={cn(\n \"relative flex cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50\",\n className,\n )}\n checked={checked}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <IconCheck className=\"h-4 w-4\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n));\nDropdownMenuCheckboxItem.displayName =\n DropdownMenuPrimitive.CheckboxItem.displayName;\n\nconst DropdownMenuRadioItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>\n>(({ className, children, ...props }, ref) => (\n <DropdownMenuPrimitive.RadioItem\n ref={ref}\n className={cn(\n \"relative flex cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50\",\n className,\n )}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <IconCircle className=\"h-2 w-2 fill-current\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n));\nDropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;\n\nconst DropdownMenuLabel = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Label\n ref={ref}\n className={cn(\n \"px-2 py-1.5 text-xs font-semibold text-muted-foreground\",\n inset && \"pl-8\",\n className,\n )}\n {...props}\n />\n));\nDropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;\n\nconst DropdownMenuSeparator = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.Separator\n ref={ref}\n className={cn(\"-mx-1 my-1 h-px bg-muted\", className)}\n {...props}\n />\n));\nDropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;\n\nconst DropdownMenuShortcut = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) => (\n <span\n className={cn(\"ml-auto text-xs tracking-widest opacity-60\", className)}\n {...props}\n />\n);\nDropdownMenuShortcut.displayName = \"DropdownMenuShortcut\";\n\nexport {\n DropdownMenu,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuGroup,\n DropdownMenuPortal,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuRadioGroup,\n};\n"]}
1
+ {"version":3,"file":"dropdown-menu.js","sourceRoot":"","sources":["../../../../src/client/components/ui/dropdown-menu.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,qBAAqB,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAE9E,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AAEpC,MAAM,YAAY,GAAG,qBAAqB,CAAC,IAAI,CAAC;AAChD,MAAM,mBAAmB,GAAG,qBAAqB,CAAC,OAAO,CAAC;AAC1D,MAAM,iBAAiB,GAAG,qBAAqB,CAAC,KAAK,CAAC;AACtD,MAAM,kBAAkB,GAAG,qBAAqB,CAAC,MAAM,CAAC;AACxD,MAAM,eAAe,GAAG,qBAAqB,CAAC,GAAG,CAAC;AAClD,MAAM,sBAAsB,GAAG,qBAAqB,CAAC,UAAU,CAAC;AAEhE,MAAM,sBAAsB,GAAG,KAAK,CAAC,UAAU,CAK7C,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CACnD,MAAC,qBAAqB,CAAC,UAAU,IAC/B,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CACX,sIAAsI,EACtI,KAAK,IAAI,MAAM,EACf,SAAS,CACV,KACG,KAAK,aAER,QAAQ,EACT,KAAC,gBAAgB,IAAC,SAAS,EAAC,iBAAiB,GAAG,IACf,CACpC,CAAC,CAAC;AACH,sBAAsB,CAAC,WAAW;IAChC,qBAAqB,CAAC,UAAU,CAAC,WAAW,CAAC;AAE/C,MAAM,sBAAsB,GAAG,KAAK,CAAC,UAAU,CAG7C,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,WAAW,CAAC;AAExE,MAAM,qBAAqB,GAAG,KAAK,CAAC,UAAU,CAG5C,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CAClC,KAAC,qBAAqB,CAAC,SAAS,IAC9B,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CAAC,0BAA0B,EAAE,SAAS,CAAC,KAChD,KAAK,GACT,CACH,CAAC,CAAC;AACH,qBAAqB,CAAC,WAAW,GAAG,qBAAqB,CAAC,SAAS,CAAC,WAAW,CAAC;AAEhF,MAAM,oBAAoB,GAAG,CAAC,EAC5B,SAAS,EACT,GAAG,KAAK,EAC8B,EAAE,EAAE,CAAC,CAC3C,eACE,SAAS,EAAE,EAAE,CAAC,4CAA4C,EAAE,SAAS,CAAC,KAClE,KAAK,GACT,CACH,CAAC;AACF,oBAAoB,CAAC,WAAW,GAAG,sBAAsB,CAAC;AAE1D,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,wBAAwB,EACxB,qBAAqB,EACrB,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACpB,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EACf,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,GACvB,CAAC","sourcesContent":["import * as React from \"react\";\nimport * as DropdownMenuPrimitive from \"@radix-ui/react-dropdown-menu\";\nimport { IconCheck, IconChevronRight, IconCircle } from \"@tabler/icons-react\";\n\nimport { cn } from \"../../utils.js\";\n\nconst DropdownMenu = DropdownMenuPrimitive.Root;\nconst DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;\nconst DropdownMenuGroup = DropdownMenuPrimitive.Group;\nconst DropdownMenuPortal = DropdownMenuPrimitive.Portal;\nconst DropdownMenuSub = DropdownMenuPrimitive.Sub;\nconst DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;\n\nconst DropdownMenuSubTrigger = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {\n inset?: boolean;\n }\n>(({ className, inset, children, ...props }, ref) => (\n <DropdownMenuPrimitive.SubTrigger\n ref={ref}\n className={cn(\n \"flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent\",\n inset && \"pl-8\",\n className,\n )}\n {...props}\n >\n {children}\n <IconChevronRight className=\"ml-auto h-4 w-4\" />\n </DropdownMenuPrimitive.SubTrigger>\n));\nDropdownMenuSubTrigger.displayName =\n DropdownMenuPrimitive.SubTrigger.displayName;\n\nconst DropdownMenuSubContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.SubContent\n ref={ref}\n className={cn(\n \"z-50 min-w-[8rem] origin-[--radix-dropdown-menu-content-transform-origin] overflow-hidden rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-lg will-change-[transform,opacity] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:duration-100 data-[state=open]:duration-150 data-[state=closed]:ease-in data-[state=open]:ease-out data-[side=bottom]:slide-in-from-top-1 data-[side=left]:slide-in-from-right-1 data-[side=right]:slide-in-from-left-1 data-[side=top]:slide-in-from-bottom-1\",\n className,\n )}\n {...props}\n />\n));\nDropdownMenuSubContent.displayName =\n DropdownMenuPrimitive.SubContent.displayName;\n\nconst DropdownMenuContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>\n>(({ className, sideOffset = 4, ...props }, ref) => (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n \"z-50 min-w-[8rem] origin-[--radix-dropdown-menu-content-transform-origin] overflow-hidden rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-md will-change-[transform,opacity] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:duration-100 data-[state=open]:duration-150 data-[state=closed]:ease-in data-[state=open]:ease-out data-[side=bottom]:slide-in-from-top-1 data-[side=left]:slide-in-from-right-1 data-[side=right]:slide-in-from-left-1 data-[side=top]:slide-in-from-bottom-1\",\n className,\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n));\nDropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;\n\nconst DropdownMenuItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Item\n ref={ref}\n className={cn(\n \"relative flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50\",\n inset && \"pl-8\",\n className,\n )}\n {...props}\n />\n));\nDropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;\n\nconst DropdownMenuCheckboxItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>\n>(({ className, children, checked, ...props }, ref) => (\n <DropdownMenuPrimitive.CheckboxItem\n ref={ref}\n className={cn(\n \"relative flex cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50\",\n className,\n )}\n checked={checked}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <IconCheck className=\"h-4 w-4\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n));\nDropdownMenuCheckboxItem.displayName =\n DropdownMenuPrimitive.CheckboxItem.displayName;\n\nconst DropdownMenuRadioItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>\n>(({ className, children, ...props }, ref) => (\n <DropdownMenuPrimitive.RadioItem\n ref={ref}\n className={cn(\n \"relative flex cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50\",\n className,\n )}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <IconCircle className=\"h-2 w-2 fill-current\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n));\nDropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;\n\nconst DropdownMenuLabel = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Label\n ref={ref}\n className={cn(\n \"px-2 py-1.5 text-xs font-semibold text-muted-foreground\",\n inset && \"pl-8\",\n className,\n )}\n {...props}\n />\n));\nDropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;\n\nconst DropdownMenuSeparator = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.Separator\n ref={ref}\n className={cn(\"-mx-1 my-1 h-px bg-muted\", className)}\n {...props}\n />\n));\nDropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;\n\nconst DropdownMenuShortcut = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) => (\n <span\n className={cn(\"ml-auto text-xs tracking-widest opacity-60\", className)}\n {...props}\n />\n);\nDropdownMenuShortcut.displayName = \"DropdownMenuShortcut\";\n\nexport {\n DropdownMenu,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuGroup,\n DropdownMenuPortal,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuRadioGroup,\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ResourcesPanel.d.ts","sourceRoot":"","sources":["../../../src/client/resources/ResourcesPanel.tsx"],"names":[],"mappings":"AAk+BA,wBAAgB,cAAc,4CAqjB7B"}
1
+ {"version":3,"file":"ResourcesPanel.d.ts","sourceRoot":"","sources":["../../../src/client/resources/ResourcesPanel.tsx"],"names":[],"mappings":"AAk+BA,wBAAgB,cAAc,4CA0jB7B"}
@@ -666,18 +666,18 @@ export function ResourcesPanel() {
666
666
  handleUploadFiles(e.dataTransfer.files);
667
667
  }
668
668
  }, [handleUploadFiles]);
669
- return (_jsxs("div", { className: cn("relative flex h-full flex-col min-h-0", dragOver && "ring-2 ring-inset ring-accent"), onDragOver: handleDragOver, onDragLeave: handleDragLeave, onDrop: handleDrop, children: [isEditing ? (_jsxs("div", { className: "flex shrink-0 items-center justify-between border-b border-border px-2 py-1.5", children: [_jsxs("div", { className: "flex items-center gap-1.5 min-w-0", children: [_jsx(TooltipProvider, { delayDuration: 200, children: _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx("button", { onClick: handleBack, "aria-label": "Back to workspace", className: "flex h-6 w-6 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:text-foreground hover:bg-accent/50", children: _jsx(IconArrowLeft, { className: "h-3.5 w-3.5" }) }) }), _jsx(TooltipContent, { children: "Back to workspace" })] }) }), selectedMcpServer ? (_jsx(PathBreadcrumb, { path: `mcp-servers/${selectedMcpServer.name}.json` })) : resourceQuery.data ? (_jsx(PathBreadcrumb, { path: resourceQuery.data.path })) : null] }), _jsxs("div", { className: "flex items-center gap-1 shrink-0", children: [!selectedMcpServer &&
669
+ return (_jsxs("div", { className: cn("relative flex h-full flex-col min-h-0", dragOver && "ring-2 ring-inset ring-accent"), onDragOver: handleDragOver, onDragLeave: handleDragLeave, onDrop: handleDrop, children: [isEditing ? (_jsxs("div", { className: "flex shrink-0 items-center justify-between border-b border-border px-2 py-1.5", children: [_jsxs("div", { className: "flex items-center gap-1.5 min-w-0", children: [_jsx(TooltipProvider, { delayDuration: 200, children: _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx("button", { onClick: handleBack, "aria-label": "Back to workspace", className: "flex h-6 w-6 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:text-foreground hover:bg-accent/50", children: _jsx(IconArrowLeft, { className: "h-3.5 w-3.5" }) }) }), _jsx(TooltipContent, { children: "Back to workspace" })] }) }), selectedMcpServer ? (_jsx(PathBreadcrumb, { path: `mcp-servers/${selectedMcpServer.name}.json` })) : resourceQuery.data ? (_jsx(PathBreadcrumb, { path: resourceQuery.data.path })) : null] }), _jsxs("div", { className: "flex items-center gap-1 shrink-0", children: [!selectedMcpServer && resourceQuery.data && (_jsx("span", { "aria-live": "polite", className: "mr-1 w-16 text-right text-[11px] text-muted-foreground/60", children: saveStatus === "saving"
670
+ ? "Saving..."
671
+ : saveStatus === "saved"
672
+ ? "Saved"
673
+ : "" })), !selectedMcpServer &&
670
674
  resourceQuery.data &&
671
675
  (resourceQuery.data.mimeType === "text/markdown" ||
672
676
  resourceQuery.data.path.endsWith(".md")) && (_jsx("div", { className: "flex items-center gap-0.5 mr-1", children: _jsxs(TooltipProvider, { delayDuration: 200, children: [_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx("button", { onClick: () => setEditorView("visual"), "aria-label": "Visual editor", className: cn("flex h-6 w-6 items-center justify-center rounded-md", editorView === "visual"
673
677
  ? "bg-accent text-foreground"
674
678
  : "text-muted-foreground hover:text-foreground hover:bg-accent/50"), children: _jsx(IconEye, { className: "h-3.5 w-3.5" }) }) }), _jsx(TooltipContent, { children: "Visual editor" })] }), _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx("button", { onClick: () => setEditorView("code"), "aria-label": "Code editor", className: cn("flex h-6 w-6 items-center justify-center rounded-md", editorView === "code"
675
679
  ? "bg-accent text-foreground"
676
- : "text-muted-foreground hover:text-foreground hover:bg-accent/50"), children: _jsx(IconCode, { className: "h-3.5 w-3.5" }) }) }), _jsx(TooltipContent, { children: "Code editor" })] })] }) })), _jsx("span", { className: "text-[11px] text-muted-foreground/60 mr-1", children: saveStatus === "saving"
677
- ? "Saving..."
678
- : saveStatus === "saved"
679
- ? "Saved"
680
- : "" }), _jsx(TooltipProvider, { delayDuration: 200, children: _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx("button", { onClick: () => {
680
+ : "text-muted-foreground hover:text-foreground hover:bg-accent/50"), children: _jsx(IconCode, { className: "h-3.5 w-3.5" }) }) }), _jsx(TooltipContent, { children: "Code editor" })] })] }) })), _jsx(TooltipProvider, { delayDuration: 200, children: _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx("button", { onClick: () => {
681
681
  if (!selectedResourceId)
682
682
  return;
683
683
  if (toolbarDeleteConfirmId === selectedResourceId) {