@burdenoff/microfe-integrations 2026.830.1 → 2026.830.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/integrations/IntegrationsAdminRoot.d.ts.map +1 -1
- package/dist/integrations/IntegrationsAdminRoot.js +35 -26
- package/dist/integrations/IntegrationsAdminRoot.js.map +1 -1
- package/dist/integrations/IntegrationsRoot.d.ts.map +1 -1
- package/dist/integrations/IntegrationsRoot.js +47 -38
- package/dist/integrations/IntegrationsRoot.js.map +1 -1
- package/dist/integrations/components/AddConnectionDialog.d.ts.map +1 -1
- package/dist/integrations/components/AddConnectionDialog.js +151 -152
- package/dist/integrations/components/AddConnectionDialog.js.map +1 -1
- package/dist/integrations/components/AuthMethodSelector.d.ts.map +1 -1
- package/dist/integrations/components/AuthMethodSelector.js +48 -40
- package/dist/integrations/components/AuthMethodSelector.js.map +1 -1
- package/dist/integrations/components/AuthMethodsEditor.d.ts.map +1 -1
- package/dist/integrations/components/AuthMethodsEditor.js +207 -190
- package/dist/integrations/components/AuthMethodsEditor.js.map +1 -1
- package/dist/integrations/components/ConnectionCard.d.ts.map +1 -1
- package/dist/integrations/components/ConnectionCard.js +102 -98
- package/dist/integrations/components/ConnectionCard.js.map +1 -1
- package/dist/integrations/components/ConnectionStatusBadge.d.ts.map +1 -1
- package/dist/integrations/components/ConnectionStatusBadge.js +9 -5
- package/dist/integrations/components/ConnectionStatusBadge.js.map +1 -1
- package/dist/integrations/components/CredentialStorageSelector.d.ts.map +1 -1
- package/dist/integrations/components/CredentialStorageSelector.js +124 -121
- package/dist/integrations/components/CredentialStorageSelector.js.map +1 -1
- package/dist/integrations/components/ProviderCard.d.ts.map +1 -1
- package/dist/integrations/components/ProviderCard.js +25 -65
- package/dist/integrations/components/ProviderCard.js.map +1 -1
- package/dist/integrations/components/SchemaForm.d.ts.map +1 -1
- package/dist/integrations/components/SchemaForm.js +116 -111
- package/dist/integrations/components/SchemaForm.js.map +1 -1
- package/dist/integrations/hooks/useFormatDate.d.ts +7 -0
- package/dist/integrations/hooks/useFormatDate.d.ts.map +1 -0
- package/dist/integrations/hooks/useFormatDate.js +17 -0
- package/dist/integrations/hooks/useFormatDate.js.map +1 -0
- package/dist/integrations/hooks/useFormatLastUsed.d.ts +9 -0
- package/dist/integrations/hooks/useFormatLastUsed.d.ts.map +1 -0
- package/dist/integrations/hooks/useFormatLastUsed.js +15 -0
- package/dist/integrations/hooks/useFormatLastUsed.js.map +1 -0
- package/dist/integrations/hooks/useLabel.d.ts +13 -0
- package/dist/integrations/hooks/useLabel.d.ts.map +1 -0
- package/dist/integrations/hooks/useLabel.js +20 -0
- package/dist/integrations/hooks/useLabel.js.map +1 -0
- package/dist/integrations/hooks/useTr.d.ts +17 -0
- package/dist/integrations/hooks/useTr.d.ts.map +1 -0
- package/dist/integrations/hooks/useTr.js +14 -0
- package/dist/integrations/hooks/useTr.js.map +1 -0
- package/dist/integrations/pages/AddConnectionWizard.d.ts.map +1 -1
- package/dist/integrations/pages/AddConnectionWizard.js +396 -387
- package/dist/integrations/pages/AddConnectionWizard.js.map +1 -1
- package/dist/integrations/pages/ConnectionDetail.d.ts.map +1 -1
- package/dist/integrations/pages/ConnectionDetail.js +128 -128
- package/dist/integrations/pages/ConnectionDetail.js.map +1 -1
- package/dist/integrations/pages/ConnectionLogs.d.ts.map +1 -1
- package/dist/integrations/pages/ConnectionLogs.js +210 -181
- package/dist/integrations/pages/ConnectionLogs.js.map +1 -1
- package/dist/integrations/pages/ConnectionsList.d.ts.map +1 -1
- package/dist/integrations/pages/ConnectionsList.js +136 -115
- package/dist/integrations/pages/ConnectionsList.js.map +1 -1
- package/dist/integrations/pages/IntegrationsOverview.d.ts.map +1 -1
- package/dist/integrations/pages/IntegrationsOverview.js +76 -77
- package/dist/integrations/pages/IntegrationsOverview.js.map +1 -1
- package/dist/integrations/pages/IntegrationsSettings.d.ts.map +1 -1
- package/dist/integrations/pages/IntegrationsSettings.js +59 -61
- package/dist/integrations/pages/IntegrationsSettings.js.map +1 -1
- package/dist/integrations/pages/IntegrationsUserLandingPage.d.ts.map +1 -1
- package/dist/integrations/pages/IntegrationsUserLandingPage.js +29 -28
- package/dist/integrations/pages/IntegrationsUserLandingPage.js.map +1 -1
- package/dist/integrations/pages/ProviderCatalog.d.ts.map +1 -1
- package/dist/integrations/pages/ProviderCatalog.js +99 -141
- package/dist/integrations/pages/ProviderCatalog.js.map +1 -1
- package/dist/integrations/pages/ProviderDetail.d.ts.map +1 -1
- package/dist/integrations/pages/ProviderDetail.js +208 -220
- package/dist/integrations/pages/ProviderDetail.js.map +1 -1
- package/dist/integrations/pages/ProviderEditorPage.d.ts.map +1 -1
- package/dist/integrations/pages/ProviderEditorPage.js +262 -261
- package/dist/integrations/pages/ProviderEditorPage.js.map +1 -1
- package/dist/integrations/translations/en.d.ts +745 -0
- package/dist/integrations/translations/en.d.ts.map +1 -0
- package/dist/integrations/utils/integrationsHelpers.js +2 -16
- package/dist/integrations/utils/integrationsHelpers.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,56 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { useTr as e } from "../hooks/useTr.js";
|
|
2
|
+
import { cn as t } from "../utils/cn.js";
|
|
3
|
+
import { ProviderIcon as n } from "./ProviderIcon.js";
|
|
4
|
+
import { Link2 as r, Plug as i } from "lucide-react";
|
|
5
5
|
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
6
6
|
import { GlassCard as s } from "@burdenoff/fe-libs/ui";
|
|
7
7
|
//#region src/integrations/components/ProviderCard.tsx
|
|
8
8
|
var c = ({ provider: c, displayMode: l = "grid", onConnect: u, onClick: d }) => {
|
|
9
|
-
let
|
|
10
|
-
let r = f(e, n);
|
|
11
|
-
return r === e ? n ? Object.entries(n).reduce((e, [t, n]) => e.replace(`{{${t}}}`, String(n)).replace(`{${t}}`, String(n)), t) : t : r;
|
|
12
|
-
}, m = (e) => {
|
|
9
|
+
let f = e(), p = (e) => {
|
|
13
10
|
e.stopPropagation(), u?.(c);
|
|
14
|
-
}, h = (e) => {
|
|
15
|
-
switch (e) {
|
|
16
|
-
case "available": return p("integrations.providerCard.pluginStatus.available", "Available");
|
|
17
|
-
case "installed": return p("integrations.providerCard.pluginStatus.installed", "Installed");
|
|
18
|
-
case "update_available": return p("integrations.providerCard.pluginStatus.updateAvailable", "Update");
|
|
19
|
-
case "deprecated": return p("integrations.providerCard.pluginStatus.deprecated", "Deprecated");
|
|
20
|
-
default: return e;
|
|
21
|
-
}
|
|
22
|
-
}, g = (e) => {
|
|
23
|
-
switch (e) {
|
|
24
|
-
case "communication": return p("integrations.providerCard.category.communication", "Communication");
|
|
25
|
-
case "project_management": return p("integrations.providerCard.category.projectManagement", "Project Management");
|
|
26
|
-
case "cloud_storage": return p("integrations.providerCard.category.cloudStorage", "Cloud Storage");
|
|
27
|
-
case "productivity": return p("integrations.providerCard.category.productivity", "Productivity");
|
|
28
|
-
case "crm": return p("integrations.providerCard.category.crm", "CRM");
|
|
29
|
-
case "analytics": return p("integrations.providerCard.category.analytics", "Analytics");
|
|
30
|
-
case "developer_tools": return p("integrations.providerCard.category.developerTools", "Developer Tools");
|
|
31
|
-
case "marketing": return p("integrations.providerCard.category.marketing", "Marketing");
|
|
32
|
-
case "finance": return p("integrations.providerCard.category.finance", "Finance");
|
|
33
|
-
case "hr": return p("integrations.providerCard.category.hr", "Human Resources");
|
|
34
|
-
case "support": return p("integrations.providerCard.category.support", "Support");
|
|
35
|
-
case "social": return p("integrations.providerCard.category.social", "Social");
|
|
36
|
-
case "ai": return p("integrations.providerCard.category.ai", "AI & ML");
|
|
37
|
-
case "email": return p("integrations.providerCard.category.email", "Email");
|
|
38
|
-
case "calendar": return p("integrations.providerCard.category.calendar", "Calendar");
|
|
39
|
-
case "other": return p("integrations.providerCard.category.other", "Other");
|
|
40
|
-
default: return e;
|
|
41
|
-
}
|
|
42
|
-
}, _ = (e) => {
|
|
43
|
-
switch (e) {
|
|
44
|
-
case "oauth2": return p("integrations.providerCard.authType.oauth2", "OAuth 2.0");
|
|
45
|
-
case "api_key": return p("integrations.providerCard.authType.apiKey", "API Key");
|
|
46
|
-
case "basic_auth": return p("integrations.providerCard.authType.basicAuth", "Basic Auth");
|
|
47
|
-
case "bearer_token": return p("integrations.providerCard.authType.bearerToken", "Bearer Token");
|
|
48
|
-
case "service_account": return p("integrations.providerCard.authType.serviceAccount", "Service Account");
|
|
49
|
-
default: return e;
|
|
50
|
-
}
|
|
51
|
-
}, v = c.pluginStatus === "installed" ? "text-status-success-text bg-status-success-bg-subtle border-border-default" : c.pluginStatus === "update_available" ? "text-status-warning-text bg-status-warning-bg-subtle border-border-default" : c.pluginStatus === "deprecated" ? "text-status-error-text bg-status-error-bg-subtle border-border-default" : "text-text-secondary bg-bg-sunken border-border-subtle";
|
|
11
|
+
}, m = (e) => f(`integrations.pluginStatus.${e}`, e), h = (e) => f(`integrations.category.${e}`, e), g = (e) => f(`integrations.authType.${e}`, e), _ = c.pluginStatus === "installed" ? "text-status-success-text bg-status-success-bg-subtle border-border-default" : c.pluginStatus === "update_available" ? "text-status-warning-text bg-status-warning-bg-subtle border-border-default" : c.pluginStatus === "deprecated" ? "text-status-error-text bg-status-error-bg-subtle border-border-default" : "text-text-secondary bg-bg-sunken border-border-subtle";
|
|
52
12
|
return l === "list" ? /* @__PURE__ */ o(s, {
|
|
53
|
-
className:
|
|
13
|
+
className: t("group flex items-center gap-4 p-4 border-border-seam", "cursor-pointer hover:shadow-[var(--shadow-pop)] hover:border-border-strong", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]", "animate-in fade-in-0"),
|
|
54
14
|
onClick: () => d?.(c),
|
|
55
15
|
role: "button",
|
|
56
16
|
tabIndex: 0,
|
|
@@ -58,7 +18,7 @@ var c = ({ provider: c, displayMode: l = "grid", onConnect: u, onClick: d }) =>
|
|
|
58
18
|
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), d?.(c));
|
|
59
19
|
},
|
|
60
20
|
children: [
|
|
61
|
-
/* @__PURE__ */ a(
|
|
21
|
+
/* @__PURE__ */ a(n, {
|
|
62
22
|
provider: c,
|
|
63
23
|
size: 40
|
|
64
24
|
}),
|
|
@@ -70,8 +30,8 @@ var c = ({ provider: c, displayMode: l = "grid", onConnect: u, onClick: d }) =>
|
|
|
70
30
|
className: "font-semibold text-text-primary truncate",
|
|
71
31
|
children: c.name
|
|
72
32
|
}), /* @__PURE__ */ a("span", {
|
|
73
|
-
className:
|
|
74
|
-
children:
|
|
33
|
+
className: t("text-xs px-2 py-0.5 rounded-full border", _),
|
|
34
|
+
children: m(c.pluginStatus)
|
|
75
35
|
})]
|
|
76
36
|
}), /* @__PURE__ */ a("p", {
|
|
77
37
|
className: "text-sm text-text-secondary truncate mt-0.5",
|
|
@@ -83,27 +43,27 @@ var c = ({ provider: c, displayMode: l = "grid", onConnect: u, onClick: d }) =>
|
|
|
83
43
|
children: [
|
|
84
44
|
/* @__PURE__ */ a("span", {
|
|
85
45
|
className: "text-xs text-text-secondary",
|
|
86
|
-
children:
|
|
46
|
+
children: h(c.category)
|
|
87
47
|
}),
|
|
88
48
|
/* @__PURE__ */ a("span", {
|
|
89
49
|
className: "text-xs text-text-secondary",
|
|
90
|
-
children:
|
|
50
|
+
children: g(c.authType)
|
|
91
51
|
}),
|
|
92
52
|
/* @__PURE__ */ o("span", {
|
|
93
53
|
className: "inline-flex items-center gap-1 text-xs text-text-secondary",
|
|
94
|
-
children: [/* @__PURE__ */ a(
|
|
54
|
+
children: [/* @__PURE__ */ a(r, { size: 12 }), c.connectionCount]
|
|
95
55
|
}),
|
|
96
56
|
u && c.pluginStatus === "installed" && c.isEnabled && /* @__PURE__ */ a("button", {
|
|
97
57
|
type: "button",
|
|
98
|
-
onClick:
|
|
58
|
+
onClick: p,
|
|
99
59
|
className: "px-3 py-1.5 text-sm font-medium rounded-lg bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bg/90 transition-colors",
|
|
100
|
-
children:
|
|
60
|
+
children: f("integrations.providerCard.actions.connect", "Connect")
|
|
101
61
|
})
|
|
102
62
|
]
|
|
103
63
|
})
|
|
104
64
|
]
|
|
105
65
|
}) : /* @__PURE__ */ o(s, {
|
|
106
|
-
className:
|
|
66
|
+
className: t("group relative flex flex-col p-5 border-border-seam", "cursor-pointer hover:shadow-[var(--shadow-pop)] hover:border-border-strong", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]", "animate-in fade-in-0"),
|
|
107
67
|
onClick: () => d?.(c),
|
|
108
68
|
role: "button",
|
|
109
69
|
tabIndex: 0,
|
|
@@ -113,12 +73,12 @@ var c = ({ provider: c, displayMode: l = "grid", onConnect: u, onClick: d }) =>
|
|
|
113
73
|
children: [
|
|
114
74
|
/* @__PURE__ */ o("div", {
|
|
115
75
|
className: "flex items-start justify-between mb-3",
|
|
116
|
-
children: [/* @__PURE__ */ a(
|
|
76
|
+
children: [/* @__PURE__ */ a(n, {
|
|
117
77
|
provider: c,
|
|
118
78
|
size: 48
|
|
119
79
|
}), /* @__PURE__ */ a("span", {
|
|
120
|
-
className:
|
|
121
|
-
children:
|
|
80
|
+
className: t("text-xs px-2 py-0.5 rounded-full border", _),
|
|
81
|
+
children: m(c.pluginStatus)
|
|
122
82
|
})]
|
|
123
83
|
}),
|
|
124
84
|
/* @__PURE__ */ a("h3", {
|
|
@@ -133,10 +93,10 @@ var c = ({ provider: c, displayMode: l = "grid", onConnect: u, onClick: d }) =>
|
|
|
133
93
|
className: "flex items-center gap-2 flex-wrap mb-3",
|
|
134
94
|
children: [/* @__PURE__ */ a("span", {
|
|
135
95
|
className: "text-xs px-2 py-0.5 rounded-full bg-bg-sunken text-text-secondary",
|
|
136
|
-
children:
|
|
96
|
+
children: h(c.category)
|
|
137
97
|
}), /* @__PURE__ */ a("span", {
|
|
138
98
|
className: "text-xs px-2 py-0.5 rounded-full bg-bg-sunken text-text-secondary",
|
|
139
|
-
children:
|
|
99
|
+
children: g(c.authType)
|
|
140
100
|
})]
|
|
141
101
|
}),
|
|
142
102
|
/* @__PURE__ */ o("div", {
|
|
@@ -144,16 +104,16 @@ var c = ({ provider: c, displayMode: l = "grid", onConnect: u, onClick: d }) =>
|
|
|
144
104
|
children: [/* @__PURE__ */ o("span", {
|
|
145
105
|
className: "inline-flex items-center gap-1.5 text-sm text-text-secondary",
|
|
146
106
|
children: [
|
|
147
|
-
/* @__PURE__ */ a(
|
|
107
|
+
/* @__PURE__ */ a(i, { size: 14 }),
|
|
148
108
|
c.connectionCount,
|
|
149
109
|
" ",
|
|
150
|
-
c.connectionCount === 1 ?
|
|
110
|
+
c.connectionCount === 1 ? f("integrations.providerCard.connectionCount.single", "connection") : f("integrations.providerCard.connectionCount.multiple", "connections")
|
|
151
111
|
]
|
|
152
112
|
}), u && c.pluginStatus === "installed" && c.isEnabled && /* @__PURE__ */ a("button", {
|
|
153
113
|
type: "button",
|
|
154
|
-
onClick:
|
|
114
|
+
onClick: p,
|
|
155
115
|
className: "px-3 py-1.5 text-sm font-medium rounded-lg bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bg/90 transition-colors",
|
|
156
|
-
children:
|
|
116
|
+
children: f("integrations.providerCard.actions.connect", "Connect")
|
|
157
117
|
})]
|
|
158
118
|
})
|
|
159
119
|
]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProviderCard.js","names":[],"sources":["../../../src/integrations/components/ProviderCard.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { Plug, Link2 } from 'lucide-react';\nimport { cn } from '../utils/cn';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { GlassCard } from '@burdenoff/fe-libs/ui';\nimport type { IntegrationProvider } from '../types';\nimport { ProviderIcon } from './ProviderIcon';\n\ninterface ProviderCardProps {\n provider: IntegrationProvider;\n displayMode?: 'grid' | 'list';\n onConnect?: (provider: IntegrationProvider) => void;\n onClick?: (provider: IntegrationProvider) => void;\n}\n\n/**\n * Card component showing provider info (icon, name, category, auth type, connection count).\n * Has a \"Connect\" button.\n */\nexport const ProviderCard: FC<ProviderCardProps> = ({\n provider,\n displayMode = 'grid',\n onConnect,\n onClick,\n}) => {\n const { t } = useI18n();\n const tx = (key: string, fallback: string, params?: Record<string, string | number>) => {\n const translated = t(key, params);\n if (translated !== key) return translated;\n if (!params) return fallback;\n\n return Object.entries(params).reduce(\n (value, [paramKey, paramValue]) =>\n value\n .replace(`{{${paramKey}}}`, String(paramValue))\n .replace(`{${paramKey}}`, String(paramValue)),\n fallback\n );\n };\n\n const handleConnect = (e: React.MouseEvent) => {\n e.stopPropagation();\n onConnect?.(provider);\n };\n\n const getPluginStatusLabel = (status: IntegrationProvider['pluginStatus']) => {\n switch (status) {\n case 'available':\n return tx('integrations.providerCard.pluginStatus.available', 'Available');\n case 'installed':\n return tx('integrations.providerCard.pluginStatus.installed', 'Installed');\n case 'update_available':\n return tx('integrations.providerCard.pluginStatus.updateAvailable', 'Update');\n case 'deprecated':\n return tx('integrations.providerCard.pluginStatus.deprecated', 'Deprecated');\n default:\n return status;\n }\n };\n\n const getCategoryLabel = (category: IntegrationProvider['category']) => {\n switch (category) {\n case 'communication':\n return tx('integrations.providerCard.category.communication', 'Communication');\n case 'project_management':\n return tx('integrations.providerCard.category.projectManagement', 'Project Management');\n case 'cloud_storage':\n return tx('integrations.providerCard.category.cloudStorage', 'Cloud Storage');\n case 'productivity':\n return tx('integrations.providerCard.category.productivity', 'Productivity');\n case 'crm':\n return tx('integrations.providerCard.category.crm', 'CRM');\n case 'analytics':\n return tx('integrations.providerCard.category.analytics', 'Analytics');\n case 'developer_tools':\n return tx('integrations.providerCard.category.developerTools', 'Developer Tools');\n case 'marketing':\n return tx('integrations.providerCard.category.marketing', 'Marketing');\n case 'finance':\n return tx('integrations.providerCard.category.finance', 'Finance');\n case 'hr':\n return tx('integrations.providerCard.category.hr', 'Human Resources');\n case 'support':\n return tx('integrations.providerCard.category.support', 'Support');\n case 'social':\n return tx('integrations.providerCard.category.social', 'Social');\n case 'ai':\n return tx('integrations.providerCard.category.ai', 'AI & ML');\n case 'email':\n return tx('integrations.providerCard.category.email', 'Email');\n case 'calendar':\n return tx('integrations.providerCard.category.calendar', 'Calendar');\n case 'other':\n return tx('integrations.providerCard.category.other', 'Other');\n default:\n return category;\n }\n };\n\n const getAuthTypeLabel = (authType: IntegrationProvider['authType']) => {\n switch (authType) {\n case 'oauth2':\n return tx('integrations.providerCard.authType.oauth2', 'OAuth 2.0');\n case 'api_key':\n return tx('integrations.providerCard.authType.apiKey', 'API Key');\n case 'basic_auth':\n return tx('integrations.providerCard.authType.basicAuth', 'Basic Auth');\n case 'bearer_token':\n return tx('integrations.providerCard.authType.bearerToken', 'Bearer Token');\n case 'service_account':\n return tx('integrations.providerCard.authType.serviceAccount', 'Service Account');\n default:\n return authType;\n }\n };\n\n const pluginBadgeClass =\n provider.pluginStatus === 'installed'\n ? 'text-status-success-text bg-status-success-bg-subtle border-border-default'\n : provider.pluginStatus === 'update_available'\n ? 'text-status-warning-text bg-status-warning-bg-subtle border-border-default'\n : provider.pluginStatus === 'deprecated'\n ? 'text-status-error-text bg-status-error-bg-subtle border-border-default'\n : 'text-text-secondary bg-bg-sunken border-border-subtle';\n\n if (displayMode === 'list') {\n return (\n <GlassCard\n className={cn(\n 'group flex items-center gap-4 p-4 border-border-seam',\n 'cursor-pointer hover:shadow-[var(--shadow-pop)] hover:border-border-strong',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]',\n 'animate-in fade-in-0'\n )}\n onClick={() => onClick?.(provider)}\n role=\"button\"\n tabIndex={0}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n onClick?.(provider);\n }\n }}\n >\n <ProviderIcon provider={provider} size={40} />\n\n <div className=\"flex-1 min-w-0\">\n <div className=\"flex items-center gap-2\">\n <h3 className=\"font-semibold text-text-primary truncate\">{provider.name}</h3>\n <span className={cn('text-xs px-2 py-0.5 rounded-full border', pluginBadgeClass)}>\n {getPluginStatusLabel(provider.pluginStatus)}\n </span>\n </div>\n <p className=\"text-sm text-text-secondary truncate mt-0.5\">{provider.description}</p>\n </div>\n\n <div className=\"flex items-center gap-3 flex-shrink-0\">\n <span className=\"text-xs text-text-secondary\">{getCategoryLabel(provider.category)}</span>\n <span className=\"text-xs text-text-secondary\">{getAuthTypeLabel(provider.authType)}</span>\n <span className=\"inline-flex items-center gap-1 text-xs text-text-secondary\">\n <Link2 size={12} />\n {provider.connectionCount}\n </span>\n {onConnect && provider.pluginStatus === 'installed' && provider.isEnabled && (\n <button\n type=\"button\"\n onClick={handleConnect}\n className=\"px-3 py-1.5 text-sm font-medium rounded-lg bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bg/90 transition-colors\"\n >\n {tx('integrations.providerCard.actions.connect', 'Connect')}\n </button>\n )}\n </div>\n </GlassCard>\n );\n }\n\n return (\n <GlassCard\n className={cn(\n 'group relative flex flex-col p-5 border-border-seam',\n 'cursor-pointer hover:shadow-[var(--shadow-pop)] hover:border-border-strong',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]',\n 'animate-in fade-in-0'\n )}\n onClick={() => onClick?.(provider)}\n role=\"button\"\n tabIndex={0}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n onClick?.(provider);\n }\n }}\n >\n <div className=\"flex items-start justify-between mb-3\">\n <ProviderIcon provider={provider} size={48} />\n <span className={cn('text-xs px-2 py-0.5 rounded-full border', pluginBadgeClass)}>\n {getPluginStatusLabel(provider.pluginStatus)}\n </span>\n </div>\n\n <h3 className=\"font-semibold text-text-primary mb-1 truncate\">{provider.name}</h3>\n <p className=\"text-sm text-text-secondary line-clamp-2 mb-3 flex-1\">{provider.description}</p>\n\n <div className=\"flex items-center gap-2 flex-wrap mb-3\">\n <span className=\"text-xs px-2 py-0.5 rounded-full bg-bg-sunken text-text-secondary\">\n {getCategoryLabel(provider.category)}\n </span>\n <span className=\"text-xs px-2 py-0.5 rounded-full bg-bg-sunken text-text-secondary\">\n {getAuthTypeLabel(provider.authType)}\n </span>\n </div>\n\n <div className=\"flex items-center justify-between mt-auto pt-3 border-t border-border-seam\">\n <span className=\"inline-flex items-center gap-1.5 text-sm text-text-secondary\">\n <Plug size={14} />\n {provider.connectionCount}{' '}\n {provider.connectionCount === 1\n ? tx('integrations.providerCard.connectionCount.single', 'connection')\n : tx('integrations.providerCard.connectionCount.multiple', 'connections')}\n </span>\n {onConnect && provider.pluginStatus === 'installed' && provider.isEnabled && (\n <button\n type=\"button\"\n onClick={handleConnect}\n className=\"px-3 py-1.5 text-sm font-medium rounded-lg bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bg/90 transition-colors\"\n >\n {tx('integrations.providerCard.actions.connect', 'Connect')}\n </button>\n )}\n </div>\n </GlassCard>\n );\n};\n"],"mappings":";;;;;;;AAmBA,IAAa,KAAuC,EAClD,aACA,iBAAc,QACd,cACA,iBACI;CACJ,IAAM,EAAE,SAAM,GAAS,EACjB,KAAM,GAAa,GAAkB,MAA6C;EACtF,IAAM,IAAa,EAAE,GAAK,EAAO;AAIjC,SAHI,MAAe,IACd,IAEE,OAAO,QAAQ,EAAO,CAAC,QAC3B,GAAO,CAAC,GAAU,OACjB,EACG,QAAQ,KAAK,EAAS,KAAK,OAAO,EAAW,CAAC,CAC9C,QAAQ,IAAI,EAAS,IAAI,OAAO,EAAW,CAAC,EACjD,EACD,GARmB,IADW;IAY3B,KAAiB,MAAwB;AAE7C,EADA,EAAE,iBAAiB,EACnB,IAAY,EAAS;IAGjB,KAAwB,MAAgD;AAC5E,UAAQ,GAAR;GACE,KAAK,YACH,QAAO,EAAG,oDAAoD,YAAY;GAC5E,KAAK,YACH,QAAO,EAAG,oDAAoD,YAAY;GAC5E,KAAK,mBACH,QAAO,EAAG,0DAA0D,SAAS;GAC/E,KAAK,aACH,QA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AwB;KAAU,MAAM;KAAM,CAAA,EAC9C,kBAAC,QAAD;KAAM,WAAW,EAAG,2CAA2C,EAAiB;eAC7E,EAAqB,EAAS,aAAa;KACvC,CAAA,CACH;;GAEN,kBAAC,MAAD;IAAI,WAAU;cAAiD,EAAS;IAAU,CAAA;GAClF,kBAAC,KAAD;IAAG,WAAU;cAAwD,EAAS;IAAgB,CAAA;GAE9F,kBAAC,OAAD;IAAK,WAAU;cAAf,CACE,kBAAC,QAAD;KAAM,WAAU;eACb,EAAiB,EAAS,SAAS;KAC/B,CAAA,EACP,kBAAC,QAAD;KAAM,WAAU;eACb,EAAiB,EAAS,SAAS;KAC/B,CAAA,CACH;;GAEN,kBAAC,OAAD;IAAK,WAAU;cAAf,CACE,kBAAC,QAAD;KAAM,WAAU;eAAhB;MACE,kBAAC,GAAD,EAAM,MAAM,IAAM,CAAA;MACjB,EAAS;MAAiB;MAC1B,EAAS,oBAAoB,IAC1B,EAAG,oDAAoD,aAAa,GACpE,EAAG,sDAAsD,cAAc;MACtE;QACN,KAAa,EAAS,iBAAiB,eAAe,EAAS,aAC9D,kBAAC,UAAD;KACE,MAAK;KACL,SAAS;KACT,WAAU;eAET,EAAG,6CAA6C,UAAU;KACpD,CAAA,CAEP;;GACI"}
|
|
1
|
+
{"version":3,"file":"ProviderCard.js","names":[],"sources":["../../../src/integrations/components/ProviderCard.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { Plug, Link2 } from 'lucide-react';\nimport { cn } from '../utils/cn';\nimport { useTr } from '../hooks/useTr';\nimport { GlassCard } from '@burdenoff/fe-libs/ui';\nimport type { IntegrationProvider } from '../types';\nimport { ProviderIcon } from './ProviderIcon';\n\ninterface ProviderCardProps {\n provider: IntegrationProvider;\n displayMode?: 'grid' | 'list';\n onConnect?: (provider: IntegrationProvider) => void;\n onClick?: (provider: IntegrationProvider) => void;\n}\n\n/**\n * Card component showing provider info (icon, name, category, auth type, connection count).\n * Has a \"Connect\" button.\n */\nexport const ProviderCard: FC<ProviderCardProps> = ({\n provider,\n displayMode = 'grid',\n onConnect,\n onClick,\n}) => {\n const tr = useTr();\n\n const handleConnect = (e: React.MouseEvent) => {\n e.stopPropagation();\n onConnect?.(provider);\n };\n\n const getPluginStatusLabel = (status: IntegrationProvider['pluginStatus']) =>\n tr(`integrations.pluginStatus.${status}`, status);\n\n const getCategoryLabel = (category: IntegrationProvider['category']) =>\n tr(`integrations.category.${category}`, category);\n\n const getAuthTypeLabel = (authType: IntegrationProvider['authType']) =>\n tr(`integrations.authType.${authType}`, authType);\n\n const pluginBadgeClass =\n provider.pluginStatus === 'installed'\n ? 'text-status-success-text bg-status-success-bg-subtle border-border-default'\n : provider.pluginStatus === 'update_available'\n ? 'text-status-warning-text bg-status-warning-bg-subtle border-border-default'\n : provider.pluginStatus === 'deprecated'\n ? 'text-status-error-text bg-status-error-bg-subtle border-border-default'\n : 'text-text-secondary bg-bg-sunken border-border-subtle';\n\n if (displayMode === 'list') {\n return (\n <GlassCard\n className={cn(\n 'group flex items-center gap-4 p-4 border-border-seam',\n 'cursor-pointer hover:shadow-[var(--shadow-pop)] hover:border-border-strong',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]',\n 'animate-in fade-in-0'\n )}\n onClick={() => onClick?.(provider)}\n role=\"button\"\n tabIndex={0}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n onClick?.(provider);\n }\n }}\n >\n <ProviderIcon provider={provider} size={40} />\n\n <div className=\"flex-1 min-w-0\">\n <div className=\"flex items-center gap-2\">\n <h3 className=\"font-semibold text-text-primary truncate\">{provider.name}</h3>\n <span className={cn('text-xs px-2 py-0.5 rounded-full border', pluginBadgeClass)}>\n {getPluginStatusLabel(provider.pluginStatus)}\n </span>\n </div>\n <p className=\"text-sm text-text-secondary truncate mt-0.5\">{provider.description}</p>\n </div>\n\n <div className=\"flex items-center gap-3 flex-shrink-0\">\n <span className=\"text-xs text-text-secondary\">{getCategoryLabel(provider.category)}</span>\n <span className=\"text-xs text-text-secondary\">{getAuthTypeLabel(provider.authType)}</span>\n <span className=\"inline-flex items-center gap-1 text-xs text-text-secondary\">\n <Link2 size={12} />\n {provider.connectionCount}\n </span>\n {onConnect && provider.pluginStatus === 'installed' && provider.isEnabled && (\n <button\n type=\"button\"\n onClick={handleConnect}\n className=\"px-3 py-1.5 text-sm font-medium rounded-lg bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bg/90 transition-colors\"\n >\n {tr('integrations.providerCard.actions.connect', 'Connect')}\n </button>\n )}\n </div>\n </GlassCard>\n );\n }\n\n return (\n <GlassCard\n className={cn(\n 'group relative flex flex-col p-5 border-border-seam',\n 'cursor-pointer hover:shadow-[var(--shadow-pop)] hover:border-border-strong',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]',\n 'animate-in fade-in-0'\n )}\n onClick={() => onClick?.(provider)}\n role=\"button\"\n tabIndex={0}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n onClick?.(provider);\n }\n }}\n >\n <div className=\"flex items-start justify-between mb-3\">\n <ProviderIcon provider={provider} size={48} />\n <span className={cn('text-xs px-2 py-0.5 rounded-full border', pluginBadgeClass)}>\n {getPluginStatusLabel(provider.pluginStatus)}\n </span>\n </div>\n\n <h3 className=\"font-semibold text-text-primary mb-1 truncate\">{provider.name}</h3>\n <p className=\"text-sm text-text-secondary line-clamp-2 mb-3 flex-1\">{provider.description}</p>\n\n <div className=\"flex items-center gap-2 flex-wrap mb-3\">\n <span className=\"text-xs px-2 py-0.5 rounded-full bg-bg-sunken text-text-secondary\">\n {getCategoryLabel(provider.category)}\n </span>\n <span className=\"text-xs px-2 py-0.5 rounded-full bg-bg-sunken text-text-secondary\">\n {getAuthTypeLabel(provider.authType)}\n </span>\n </div>\n\n <div className=\"flex items-center justify-between mt-auto pt-3 border-t border-border-seam\">\n <span className=\"inline-flex items-center gap-1.5 text-sm text-text-secondary\">\n <Plug size={14} />\n {provider.connectionCount}{' '}\n {provider.connectionCount === 1\n ? tr('integrations.providerCard.connectionCount.single', 'connection')\n : tr('integrations.providerCard.connectionCount.multiple', 'connections')}\n </span>\n {onConnect && provider.pluginStatus === 'installed' && provider.isEnabled && (\n <button\n type=\"button\"\n onClick={handleConnect}\n className=\"px-3 py-1.5 text-sm font-medium rounded-lg bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bg/90 transition-colors\"\n >\n {tr('integrations.providerCard.actions.connect', 'Connect')}\n </button>\n )}\n </div>\n </GlassCard>\n );\n};\n"],"mappings":";;;;;;;AAmBA,IAAa,KAAuC,EAClD,aACA,iBAAc,QACd,cACA,iBACI;CACJ,IAAM,IAAK,GAAO,EAEZ,KAAiB,MAAwB;AAE7C,EADA,EAAE,iBAAiB,EACnB,IAAY,EAAS;IAGjB,KAAwB,MAC5B,EAAG,6BAA6B,KAAU,EAAO,EAE7C,KAAoB,MACxB,EAAG,yBAAyB,KAAY,EAAS,EAE7C,KAAoB,MACxB,EAAG,yBAAyB,KAAY,EAAS,EAE7C,IACJ,EAAS,iBAAiB,cACtB,+EACA,EAAS,iBAAiB,qBACxB,+EACA,EAAS,iBAAiB,eACxB,2EACA;AAsDV,QApDI,MAAgB,SAEhB,kBAAC,GAAD;EACE,WAAW,EACT,wDACA,8EACA,gGACA,uBACD;EACD,eAAe,IAAU,EAAS;EAClC,MAAK;EACL,UAAU;EACV,YAAY,MAAM;AAChB,IAAI,EAAE,QAAQ,WAAW,EAAE,QAAQ,SACjC,EAAE,gBAAgB,EAClB,IAAU,EAAS;;YAbzB;GAiBE,kBAAC,GAAD;IAAwB;IAAU,MAAM;IAAM,CAAA;GAE9C,kBAAC,OAAD;IAAK,WAAU;cAAf,CACE,kBAAC,OAAD;KAAK,WAAU;eAAf,CACE,kBAAC,MAAD;MAAI,WAAU;gBAA4C,EAAS;MAAU,CAAA,EAC7E,kBAAC,QAAD;MAAM,WAAW,EAAG,2CAA2C,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;GAEN,kBAAC,OAAD;IAAK,WAAU;cAAf,CACE,kBAAC,QAAD;KAAM,WAAU;eAAhB;MACE,kBAAC,GAAD,EAAM,MAAM,IAAM,CAAA;MACjB,EAAS;MAAiB;MAC1B,EAAS,oBAAoB,IAC1B,EAAG,oDAAoD,aAAa,GACpE,EAAG,sDAAsD,cAAc;MACtE;QACN,KAAa,EAAS,iBAAiB,eAAe,EAAS,aAC9D,kBAAC,UAAD;KACE,MAAK;KACL,SAAS;KACT,WAAU;eAET,EAAG,6CAA6C,UAAU;KACpD,CAAA,CAEP;;GACI"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SchemaForm.d.ts","sourceRoot":"","sources":["../../../src/integrations/components/SchemaForm.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,EAAiB,EAAE,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"SchemaForm.d.ts","sourceRoot":"","sources":["../../../src/integrations/components/SchemaForm.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,EAAiB,EAAE,EAAE,MAAM,OAAO,CAAC;AAK/C,MAAM,WAAW,cAAc;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;IACpC,IAAI,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACxD,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;IAC3C,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,OAAO,GAAG,UAAU,GAAG,IAAI,CAU/D;AAeD;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAS7F;AAUD;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAiB1F;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,UAAU,GAAG,IAAI,EACzB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC9B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CASzB;AAgBD,UAAU,eAAe;IACvB,MAAM,EAAE,UAAU,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;IACpD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,+EAA+E;IAC/E,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,UAAU,EAAE,EAAE,CAAC,eAAe,CA2B1C,CAAC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { useTr as e } from "../hooks/useTr.js";
|
|
2
|
+
import { useState as t } from "react";
|
|
3
|
+
import { Eye as n, EyeOff as r, Info as i } from "lucide-react";
|
|
4
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
4
5
|
//#region src/integrations/components/SchemaForm.tsx
|
|
5
|
-
function
|
|
6
|
+
function s(e) {
|
|
6
7
|
if (typeof e != "object" || !e || Array.isArray(e)) return null;
|
|
7
8
|
let t = e;
|
|
8
9
|
return typeof t.properties != "object" || t.properties === null ? null : {
|
|
@@ -10,27 +11,27 @@ function o(e) {
|
|
|
10
11
|
required: Array.isArray(t.required) ? t.required.filter((e) => typeof e == "string") : []
|
|
11
12
|
};
|
|
12
13
|
}
|
|
13
|
-
function
|
|
14
|
+
function c(e, t) {
|
|
14
15
|
return e.showIf ? Object.entries(e.showIf).every(([e, n]) => {
|
|
15
16
|
let r = t[e];
|
|
16
17
|
return Array.isArray(n) ? n.includes(r) : r === n;
|
|
17
18
|
}) : !0;
|
|
18
19
|
}
|
|
19
|
-
function
|
|
20
|
+
function l(e, t) {
|
|
20
21
|
return e.required.every((n) => {
|
|
21
22
|
let r = e.properties[n];
|
|
22
|
-
if (r && !
|
|
23
|
+
if (r && !c(r, t)) return !0;
|
|
23
24
|
let i = t[n];
|
|
24
25
|
return typeof i == "string" ? i.trim().length > 0 : i != null;
|
|
25
26
|
});
|
|
26
27
|
}
|
|
27
|
-
function
|
|
28
|
+
function u(e) {
|
|
28
29
|
return e.map((e) => typeof e == "string" ? {
|
|
29
30
|
label: e,
|
|
30
31
|
value: e
|
|
31
32
|
} : e);
|
|
32
33
|
}
|
|
33
|
-
function
|
|
34
|
+
function d(e) {
|
|
34
35
|
if (!e) return {};
|
|
35
36
|
let t = {}, n = new Set(e.required);
|
|
36
37
|
for (let [r, i] of Object.entries(e.properties)) {
|
|
@@ -42,21 +43,21 @@ function u(e) {
|
|
|
42
43
|
}
|
|
43
44
|
return t;
|
|
44
45
|
}
|
|
45
|
-
function
|
|
46
|
+
function f(e, t) {
|
|
46
47
|
if (!e) return t;
|
|
47
48
|
let n = {};
|
|
48
49
|
for (let [r, i] of Object.entries(t)) {
|
|
49
50
|
let a = e.properties[r];
|
|
50
|
-
a && !
|
|
51
|
+
a && !c(a, t) || (n[r] = i);
|
|
51
52
|
}
|
|
52
53
|
return n;
|
|
53
54
|
}
|
|
54
|
-
var
|
|
55
|
+
var p = typeof CSS < "u" && typeof CSS.supports == "function" && CSS.supports("-webkit-text-security", "disc"), m = ({ schema: e, values: t, onChange: n, disabled: r, idPrefix: i = "schema" }) => {
|
|
55
56
|
let o = new Set(e.required);
|
|
56
|
-
return /* @__PURE__ */
|
|
57
|
+
return /* @__PURE__ */ a("div", {
|
|
57
58
|
className: "space-y-3",
|
|
58
|
-
children: Object.entries(e.properties).filter(([, e]) =>
|
|
59
|
-
id: `${
|
|
59
|
+
children: Object.entries(e.properties).filter(([, e]) => c(e, t)).map(([e, s]) => /* @__PURE__ */ a(h, {
|
|
60
|
+
id: `${i}-${e}`,
|
|
60
61
|
name: e,
|
|
61
62
|
property: s,
|
|
62
63
|
value: t[e],
|
|
@@ -68,163 +69,167 @@ var f = typeof CSS < "u" && typeof CSS.supports == "function" && CSS.supports("-
|
|
|
68
69
|
})
|
|
69
70
|
}, e))
|
|
70
71
|
});
|
|
71
|
-
},
|
|
72
|
-
let [
|
|
73
|
-
if (
|
|
72
|
+
}, h = ({ id: s, name: c, property: l, value: d, required: f, disabled: m, onChange: h }) => {
|
|
73
|
+
let g = e(), [_, v] = t(!1), [y, b] = t(!1), x = l.title ?? c, S = l.placeholder ?? l.description ?? "";
|
|
74
|
+
if (l.type === "notice") return /* @__PURE__ */ o("div", {
|
|
74
75
|
className: "flex items-start gap-2 px-3 py-2 rounded-md bg-status-info-bg-subtle border border-border-default",
|
|
75
|
-
children: [/* @__PURE__ */ i
|
|
76
|
+
children: [/* @__PURE__ */ a(i, {
|
|
76
77
|
size: 14,
|
|
77
78
|
className: "text-status-info-text flex-shrink-0 mt-0.5"
|
|
78
|
-
}), /* @__PURE__ */
|
|
79
|
+
}), /* @__PURE__ */ a("span", {
|
|
79
80
|
className: "text-xs text-status-info-text",
|
|
80
|
-
children:
|
|
81
|
+
children: l.description ?? x
|
|
81
82
|
})]
|
|
82
83
|
});
|
|
83
|
-
let
|
|
84
|
+
let C = l.description ? /* @__PURE__ */ a("p", {
|
|
84
85
|
className: "mt-1 text-xs text-text-secondary",
|
|
85
|
-
children:
|
|
86
|
-
}) : null,
|
|
87
|
-
htmlFor:
|
|
86
|
+
children: l.description
|
|
87
|
+
}) : null, w = /* @__PURE__ */ o("label", {
|
|
88
|
+
htmlFor: s,
|
|
88
89
|
className: "block text-sm font-medium text-text-primary mb-1.5",
|
|
89
90
|
children: [
|
|
90
|
-
|
|
91
|
+
x,
|
|
91
92
|
" ",
|
|
92
|
-
|
|
93
|
+
f && /* @__PURE__ */ a("span", {
|
|
93
94
|
className: "text-status-error-text",
|
|
94
95
|
children: "*"
|
|
95
96
|
})
|
|
96
97
|
]
|
|
97
|
-
}),
|
|
98
|
-
if (
|
|
99
|
-
let e = !!(
|
|
100
|
-
return /* @__PURE__ */
|
|
98
|
+
}), T = "w-full px-3 py-2 border border-border-subtle rounded-md bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary disabled:opacity-50";
|
|
99
|
+
if (l.type === "boolean") {
|
|
100
|
+
let e = !!(d ?? l.default ?? !1);
|
|
101
|
+
return /* @__PURE__ */ o("div", {
|
|
101
102
|
className: "flex items-center gap-3",
|
|
102
|
-
children: [/* @__PURE__ */
|
|
103
|
+
children: [/* @__PURE__ */ a("button", {
|
|
103
104
|
type: "button",
|
|
104
105
|
role: "switch",
|
|
105
|
-
id:
|
|
106
|
+
id: s,
|
|
106
107
|
"aria-checked": e,
|
|
107
|
-
"aria-label":
|
|
108
|
-
onClick: () =>
|
|
109
|
-
disabled:
|
|
108
|
+
"aria-label": x,
|
|
109
|
+
onClick: () => h(!e),
|
|
110
|
+
disabled: m,
|
|
110
111
|
className: `relative inline-flex h-5 w-9 items-center rounded-full transition-colors disabled:opacity-50 ${e ? "bg-primary" : "bg-bg-muted"}`,
|
|
111
|
-
children: /* @__PURE__ */
|
|
112
|
-
}), /* @__PURE__ */
|
|
112
|
+
children: /* @__PURE__ */ a("span", { className: `inline-block h-3.5 w-3.5 transform rounded-full bg-white transition-transform ${e ? "translate-x-4.5" : "translate-x-0.5"}` })
|
|
113
|
+
}), /* @__PURE__ */ o("span", {
|
|
113
114
|
className: "text-sm font-medium text-text-primary",
|
|
114
|
-
children: [
|
|
115
|
+
children: [x, l.description && /* @__PURE__ */ o("span", {
|
|
115
116
|
className: "text-text-secondary font-normal ml-1",
|
|
116
|
-
children: ["— ",
|
|
117
|
+
children: ["— ", l.description]
|
|
117
118
|
})]
|
|
118
119
|
})]
|
|
119
120
|
});
|
|
120
121
|
}
|
|
121
|
-
if (
|
|
122
|
-
|
|
123
|
-
/* @__PURE__ */
|
|
124
|
-
id:
|
|
125
|
-
"aria-label":
|
|
126
|
-
value: String(
|
|
127
|
-
onChange: (e) =>
|
|
128
|
-
disabled:
|
|
129
|
-
className:
|
|
122
|
+
if (l.enum && l.enum.length > 0) return /* @__PURE__ */ o("div", { children: [
|
|
123
|
+
w,
|
|
124
|
+
/* @__PURE__ */ o("select", {
|
|
125
|
+
id: s,
|
|
126
|
+
"aria-label": x,
|
|
127
|
+
value: String(d ?? l.default ?? ""),
|
|
128
|
+
onChange: (e) => h(e.target.value),
|
|
129
|
+
disabled: m,
|
|
130
|
+
className: T,
|
|
130
131
|
children: [/* @__PURE__ */ a("option", {
|
|
131
132
|
value: "",
|
|
132
|
-
children:
|
|
133
|
-
}), l
|
|
133
|
+
children: g("integrations.schemaForm.select", "Select {{label}}", { label: x.toLowerCase() })
|
|
134
|
+
}), u(l.enum).map((e) => /* @__PURE__ */ a("option", {
|
|
134
135
|
value: e.value,
|
|
135
136
|
children: e.label
|
|
136
137
|
}, e.value))]
|
|
137
138
|
}),
|
|
138
|
-
|
|
139
|
+
C
|
|
139
140
|
] });
|
|
140
|
-
if (
|
|
141
|
-
|
|
142
|
-
/* @__PURE__ */
|
|
143
|
-
id:
|
|
144
|
-
"aria-label":
|
|
141
|
+
if (l.type === "number") return /* @__PURE__ */ o("div", { children: [
|
|
142
|
+
w,
|
|
143
|
+
/* @__PURE__ */ a("input", {
|
|
144
|
+
id: s,
|
|
145
|
+
"aria-label": x,
|
|
145
146
|
type: "number",
|
|
146
|
-
value:
|
|
147
|
-
onChange: (e) =>
|
|
148
|
-
placeholder:
|
|
149
|
-
disabled:
|
|
150
|
-
className:
|
|
147
|
+
value: d == null ? "" : String(d),
|
|
148
|
+
onChange: (e) => h(e.target.value === "" ? void 0 : Number(e.target.value)),
|
|
149
|
+
placeholder: S,
|
|
150
|
+
disabled: m,
|
|
151
|
+
className: T
|
|
151
152
|
}),
|
|
152
|
-
|
|
153
|
+
C
|
|
153
154
|
] });
|
|
154
|
-
if (
|
|
155
|
-
let e = !!
|
|
156
|
-
return e && !
|
|
157
|
-
|
|
158
|
-
/* @__PURE__ */
|
|
155
|
+
if (l.format === "textarea" || l.format === "json") {
|
|
156
|
+
let e = !!l.secret && !_, t = typeof d == "string" && d.length > 0;
|
|
157
|
+
return e && !p && t && !y ? /* @__PURE__ */ o("div", { children: [
|
|
158
|
+
w,
|
|
159
|
+
/* @__PURE__ */ o("div", {
|
|
159
160
|
className: "flex items-center justify-between gap-2 px-3 py-2 border border-border-subtle rounded-md bg-bg-surface",
|
|
160
|
-
children: [/* @__PURE__ */
|
|
161
|
+
children: [/* @__PURE__ */ a("span", {
|
|
161
162
|
className: "text-sm font-mono text-text-secondary select-none",
|
|
162
163
|
children: "••••••••••••"
|
|
163
|
-
}), /* @__PURE__ */
|
|
164
|
+
}), /* @__PURE__ */ o("button", {
|
|
164
165
|
type: "button",
|
|
165
|
-
onClick: () =>
|
|
166
|
-
disabled:
|
|
167
|
-
"aria-label":
|
|
166
|
+
onClick: () => v(!0),
|
|
167
|
+
disabled: m,
|
|
168
|
+
"aria-label": g("integrations.schemaForm.reveal", "Show {{label}}", { label: x }),
|
|
168
169
|
className: "inline-flex items-center gap-1 text-xs text-primary hover:underline disabled:opacity-50",
|
|
169
|
-
children: [
|
|
170
|
+
children: [
|
|
171
|
+
/* @__PURE__ */ a(n, { size: 14 }),
|
|
172
|
+
" ",
|
|
173
|
+
g("integrations.schemaForm.revealToEdit", "Reveal to edit")
|
|
174
|
+
]
|
|
170
175
|
})]
|
|
171
176
|
}),
|
|
172
|
-
|
|
173
|
-
] }) : /* @__PURE__ */
|
|
174
|
-
|
|
175
|
-
/* @__PURE__ */
|
|
177
|
+
C
|
|
178
|
+
] }) : /* @__PURE__ */ o("div", { children: [
|
|
179
|
+
w,
|
|
180
|
+
/* @__PURE__ */ o("div", {
|
|
176
181
|
className: "relative",
|
|
177
|
-
children: [/* @__PURE__ */
|
|
178
|
-
id:
|
|
179
|
-
"aria-label":
|
|
180
|
-
value: String(
|
|
181
|
-
onChange: (e) =>
|
|
182
|
-
onFocus: () =>
|
|
183
|
-
onBlur: () =>
|
|
184
|
-
placeholder:
|
|
185
|
-
disabled:
|
|
182
|
+
children: [/* @__PURE__ */ a("textarea", {
|
|
183
|
+
id: s,
|
|
184
|
+
"aria-label": x,
|
|
185
|
+
value: String(d ?? ""),
|
|
186
|
+
onChange: (e) => h(e.target.value),
|
|
187
|
+
onFocus: () => b(!0),
|
|
188
|
+
onBlur: () => b(!1),
|
|
189
|
+
placeholder: S,
|
|
190
|
+
disabled: m,
|
|
186
191
|
rows: 5,
|
|
187
192
|
autoComplete: "off",
|
|
188
193
|
spellCheck: !1,
|
|
189
194
|
style: e ? { WebkitTextSecurity: "disc" } : void 0,
|
|
190
|
-
className: `${
|
|
191
|
-
}),
|
|
195
|
+
className: `${T} font-mono ${l.secret ? "pr-10" : ""}`
|
|
196
|
+
}), l.secret && /* @__PURE__ */ a("button", {
|
|
192
197
|
type: "button",
|
|
193
|
-
onClick: () =>
|
|
194
|
-
"aria-label":
|
|
198
|
+
onClick: () => v((e) => !e),
|
|
199
|
+
"aria-label": _ ? g("integrations.schemaForm.hide", "Hide {{label}}", { label: x }) : g("integrations.schemaForm.reveal", "Show {{label}}", { label: x }),
|
|
195
200
|
className: "absolute right-2 top-2 text-text-secondary hover:text-text-primary",
|
|
196
|
-
children:
|
|
201
|
+
children: a(_ ? r : n, { size: 16 })
|
|
197
202
|
})]
|
|
198
203
|
}),
|
|
199
|
-
|
|
204
|
+
C
|
|
200
205
|
] });
|
|
201
206
|
}
|
|
202
|
-
return /* @__PURE__ */
|
|
203
|
-
|
|
204
|
-
/* @__PURE__ */
|
|
207
|
+
return /* @__PURE__ */ o("div", { children: [
|
|
208
|
+
w,
|
|
209
|
+
/* @__PURE__ */ o("div", {
|
|
205
210
|
className: "relative",
|
|
206
|
-
children: [/* @__PURE__ */
|
|
207
|
-
id:
|
|
208
|
-
"aria-label":
|
|
209
|
-
type:
|
|
210
|
-
value: String(
|
|
211
|
-
onChange: (e) =>
|
|
212
|
-
placeholder:
|
|
213
|
-
disabled:
|
|
211
|
+
children: [/* @__PURE__ */ a("input", {
|
|
212
|
+
id: s,
|
|
213
|
+
"aria-label": x,
|
|
214
|
+
type: l.secret && !_ ? "password" : "text",
|
|
215
|
+
value: String(d ?? ""),
|
|
216
|
+
onChange: (e) => h(e.target.value),
|
|
217
|
+
placeholder: S,
|
|
218
|
+
disabled: m,
|
|
214
219
|
autoComplete: "off",
|
|
215
|
-
className: `${
|
|
216
|
-
}),
|
|
220
|
+
className: `${T} ${l.secret ? "font-mono pr-10" : ""}`
|
|
221
|
+
}), l.secret && /* @__PURE__ */ a("button", {
|
|
217
222
|
type: "button",
|
|
218
|
-
onClick: () =>
|
|
219
|
-
"aria-label":
|
|
223
|
+
onClick: () => v((e) => !e),
|
|
224
|
+
"aria-label": _ ? g("integrations.schemaForm.hide", "Hide {{label}}", { label: x }) : g("integrations.schemaForm.reveal", "Show {{label}}", { label: x }),
|
|
220
225
|
className: "absolute right-2 top-1/2 -translate-y-1/2 text-text-secondary hover:text-text-primary",
|
|
221
|
-
children:
|
|
226
|
+
children: a(_ ? r : n, { size: 16 })
|
|
222
227
|
})]
|
|
223
228
|
}),
|
|
224
|
-
|
|
229
|
+
C
|
|
225
230
|
] });
|
|
226
231
|
};
|
|
227
232
|
//#endregion
|
|
228
|
-
export {
|
|
233
|
+
export { m as SchemaForm, d as initialValuesFromSchema, l as isSchemaComplete, s as parseFormSchema, f as visibleValues };
|
|
229
234
|
|
|
230
235
|
//# sourceMappingURL=SchemaForm.js.map
|