@burdenoff/fe-libs 2026.1119.8 → 2026.1120.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chrome/shell/SidebarProfileMenu.js +292 -286
- package/dist/connections/ConnectionDialogPanel.js +222 -203
- package/dist/connections/ConnectionFormTab.d.ts +6 -0
- package/dist/connections/ConnectionFormTab.js +2 -2
- package/dist/connections/api.d.ts +28 -0
- package/dist/connections/api.js +107 -71
- package/dist/connections/connectionFlow.d.ts +63 -1
- package/dist/connections/connectionFlow.js +139 -47
- package/dist/connections/index.d.ts +2 -2
- package/dist/connections/oauthPopup.d.ts +16 -1
- package/dist/connections/oauthPopup.js +45 -37
- package/dist/connections/useConnectionSubmit.d.ts +7 -2
- package/dist/connections/useConnectionSubmit.js +69 -55
- package/dist/connections.js +6 -6
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { initialValuesFromSchema as e } from "../credentials/schema.js";
|
|
2
2
|
import { cn as t } from "../lib/utils.js";
|
|
3
|
-
import { normalizeStorageMode as n,
|
|
4
|
-
import { ConnectionDetailsTab as
|
|
3
|
+
import { normalizeStorageMode as n, reconnectInitialValues as r, reconnectSchema as i, resolveFlow as a, resolveMethod as o, resolveSchema as ee, selectableMethods as s, supportedStorageModes as c } from "./connectionFlow.js";
|
|
4
|
+
import { ConnectionDetailsTab as l, ConnectionSharingTab as te } from "./ConnectionDetailsTab.js";
|
|
5
5
|
import { ConnectionFormTab as ne } from "./ConnectionFormTab.js";
|
|
6
6
|
import { OneScreenConnectionForm as re } from "./OneScreenConnectionForm.js";
|
|
7
7
|
import { DialogHeading as ie } from "./DialogHeading.js";
|
|
@@ -10,98 +10,116 @@ import { authTypeLabel as oe } from "./labels.js";
|
|
|
10
10
|
import { ProviderIcon as se } from "./ProviderIcon.js";
|
|
11
11
|
import { ProviderPickerPanel as ce } from "./ProviderPickerPanel.js";
|
|
12
12
|
import { parseScopeOptions as le, requestedScopes as ue } from "./scopes.js";
|
|
13
|
-
import { EMPTY_STORAGE as
|
|
14
|
-
import { useConnectionSubmit as
|
|
15
|
-
import { useCallback as
|
|
16
|
-
import { AlertCircle as
|
|
17
|
-
import { Fragment as
|
|
13
|
+
import { EMPTY_STORAGE as de } from "./storage.js";
|
|
14
|
+
import { useConnectionSubmit as fe } from "./useConnectionSubmit.js";
|
|
15
|
+
import { useCallback as u, useEffect as pe, useId as me, useMemo as d, useState as f } from "react";
|
|
16
|
+
import { AlertCircle as he, Check as ge, CheckCircle2 as _e, ExternalLink as ve, Info as ye, Link2 as be, Loader2 as xe, Share2 as Se, X as Ce } from "lucide-react";
|
|
17
|
+
import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
18
18
|
import * as we from "@radix-ui/react-dialog";
|
|
19
19
|
// src/connections/ConnectionDialogPanel.tsx
|
|
20
|
-
function Te(t, n) {
|
|
21
|
-
|
|
20
|
+
function Te(t, n, i = null) {
|
|
21
|
+
let s = o(t, n), c = ee(t, s), l = e(c);
|
|
22
|
+
return i ? r(c, a(t, s), l, i.config) : l;
|
|
22
23
|
}
|
|
23
|
-
var
|
|
24
|
-
let
|
|
25
|
-
id:
|
|
26
|
-
name:
|
|
24
|
+
var g = ({ api: e, onClose: r, callbackUrl: g, translate: _, providerId: Ee, providerKey: v, providerSource: De, requireVault: y, canCreateVault: Oe, defaultName: b, extraConfig: ke, showSharingTab: Ae, defaultVisibility: je, pickerTitle: Me, searchInputRef: Ne, onConnectionCreated: Pe, onError: Fe, onEvent: Ie, renderSuccessAction: x, navigationV2: S = !1, reconnect: C = null }) => {
|
|
25
|
+
let w = C?.providerId ?? Ee, T = !!(w || v), [E, Le] = f(null), [Re, ze] = f(T), [D, Be] = f("connection"), [O, k] = f(C?.name ?? b ?? ""), [A, j] = f(""), [Ve, He] = f(null), [M, N] = f({}), [P, F] = f(null), [I, L] = f(de), [R, z] = f(je), [Ue, We] = f(null), [B, Ge] = f(null), V = me(), H = u((e) => `${V}-${e}`, [V]), Ke = d(() => C ? {
|
|
26
|
+
id: C.connectionId,
|
|
27
|
+
name: C.name,
|
|
27
28
|
status: "",
|
|
28
29
|
errorMessage: null
|
|
29
|
-
} : null, [
|
|
30
|
+
} : null, [C]), { submit: qe, busy: U, oauthWaiting: W, errorMessage: Je, setErrorMessage: G, created: K, signInBlocked: Ye, openBlockedSignIn: Xe, cancelSignIn: Ze } = fe({
|
|
30
31
|
api: e,
|
|
31
|
-
callbackUrl:
|
|
32
|
-
translate:
|
|
33
|
-
onConnectionCreated:
|
|
34
|
-
onError:
|
|
35
|
-
onEvent:
|
|
36
|
-
reconnectConnection:
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
32
|
+
callbackUrl: g,
|
|
33
|
+
translate: _,
|
|
34
|
+
onConnectionCreated: Pe,
|
|
35
|
+
onError: Fe,
|
|
36
|
+
onEvent: Ie,
|
|
37
|
+
reconnectConnection: Ke,
|
|
38
|
+
reconnectSettings: B
|
|
39
|
+
}), Qe = C?.name, $e = C?.authMethodKey ?? null, q = u((e, t = null) => {
|
|
40
|
+
let r = t?.authMethodKey ?? $e;
|
|
41
|
+
Le(e), k(t?.name ?? Qe ?? b ?? `${e.name} Connection`), t && j(t.description ?? "");
|
|
42
|
+
let i = Te(e, r, t);
|
|
43
|
+
Ge(t ? {
|
|
44
|
+
...t,
|
|
45
|
+
formValues: i
|
|
46
|
+
} : null), He(r), N(i), L(n(de, c(e, o(e, r)))), F(null), G("");
|
|
40
47
|
}, [
|
|
41
48
|
b,
|
|
42
|
-
|
|
43
|
-
|
|
49
|
+
Qe,
|
|
50
|
+
$e,
|
|
44
51
|
G
|
|
45
|
-
]),
|
|
46
|
-
if (!
|
|
47
|
-
|
|
48
|
-
let t =
|
|
49
|
-
|
|
52
|
+
]), et = u((e) => {
|
|
53
|
+
if (!E) return;
|
|
54
|
+
He(e), N(Te(E, e));
|
|
55
|
+
let t = c(E, o(E, e));
|
|
56
|
+
L((e) => ({
|
|
50
57
|
...n(e, t),
|
|
51
58
|
secretId: ""
|
|
52
|
-
})),
|
|
53
|
-
}, [
|
|
54
|
-
|
|
55
|
-
if (!
|
|
56
|
-
let t = !1;
|
|
57
|
-
return e.getProvider({
|
|
58
|
-
id:
|
|
59
|
-
key:
|
|
60
|
-
}).then((e) => {
|
|
61
|
-
!t && e && q(e);
|
|
59
|
+
})), F(null), G("");
|
|
60
|
+
}, [E, G]), J = C?.connectionId ?? null;
|
|
61
|
+
pe(() => {
|
|
62
|
+
if (!T) return;
|
|
63
|
+
let t = !1, n = J ? e.getConnectionSettings(J).catch(() => null) : Promise.resolve(null);
|
|
64
|
+
return Promise.all([e.getProvider({
|
|
65
|
+
id: w ?? void 0,
|
|
66
|
+
key: v ?? void 0
|
|
67
|
+
}), n]).then(([e, n]) => {
|
|
68
|
+
!t && e && q(e, n);
|
|
62
69
|
}).catch(() => void 0).finally(() => {
|
|
63
|
-
t ||
|
|
70
|
+
t || ze(!1);
|
|
64
71
|
}), () => {
|
|
65
72
|
t = !0;
|
|
66
73
|
};
|
|
67
74
|
}, [
|
|
68
|
-
E,
|
|
69
75
|
T,
|
|
70
|
-
|
|
76
|
+
w,
|
|
77
|
+
v,
|
|
78
|
+
J,
|
|
71
79
|
e,
|
|
72
80
|
q
|
|
73
81
|
]);
|
|
74
|
-
let
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
82
|
+
let Y = E ? o(E, Ve) : null, X = E ? a(E, Y) : "fields", tt = _("integrations.addConnection.reconnect.keepSecretPlaceholder", "Leave blank to keep the saved value"), nt = d(() => {
|
|
83
|
+
if (!E) return null;
|
|
84
|
+
let e = ee(E, Y);
|
|
85
|
+
return C ? i(e, a(E, Y), tt) : e;
|
|
86
|
+
}, [
|
|
87
|
+
E,
|
|
88
|
+
Y,
|
|
89
|
+
C,
|
|
90
|
+
tt
|
|
91
|
+
]), rt = E ? C ? Y ? [Y] : [] : s(E) : [], Z = d(() => le(Y?.availableScopes ?? E?.availableScopes), [Y, E]), it = Y && Y.defaultScopes.length > 0 ? Y.defaultScopes : E?.defaultScopes ?? [], at = () => {
|
|
92
|
+
E && qe({
|
|
93
|
+
provider: E,
|
|
94
|
+
method: Y,
|
|
95
|
+
name: O,
|
|
96
|
+
description: A,
|
|
97
|
+
values: M,
|
|
98
|
+
storage: I,
|
|
99
|
+
requireVault: y,
|
|
100
|
+
extraConfig: ke,
|
|
101
|
+
visibility: R,
|
|
102
|
+
reconnect: !!C,
|
|
103
|
+
reconnectMethodKey: C ? B?.authMethodKey ?? C.authMethodKey ?? null : null
|
|
104
|
+
}, ue(P, Z));
|
|
105
|
+
}, ot = [
|
|
88
106
|
{
|
|
89
107
|
key: "connection",
|
|
90
|
-
label:
|
|
91
|
-
icon:
|
|
108
|
+
label: _("integrations.addConnection.tabs.connection", "Connection"),
|
|
109
|
+
icon: be
|
|
92
110
|
},
|
|
93
|
-
...
|
|
111
|
+
...Ae ? [{
|
|
94
112
|
key: "sharing",
|
|
95
|
-
label:
|
|
96
|
-
icon:
|
|
113
|
+
label: _("integrations.addConnection.tabs.sharing", "Sharing"),
|
|
114
|
+
icon: Se
|
|
97
115
|
}] : [],
|
|
98
116
|
{
|
|
99
117
|
key: "details",
|
|
100
|
-
label:
|
|
101
|
-
icon:
|
|
118
|
+
label: _("integrations.addConnection.tabs.details", "Details"),
|
|
119
|
+
icon: ye
|
|
102
120
|
}
|
|
103
|
-
], Q = (e) => H(`tab-${e}`),
|
|
104
|
-
let t =
|
|
121
|
+
], Q = (e) => H(`tab-${e}`), st = H("tabpanel"), ct = (e) => {
|
|
122
|
+
let t = ot.map((e) => e.key), n = t.indexOf(D), r = {
|
|
105
123
|
ArrowRight: n + 1,
|
|
106
124
|
ArrowDown: n + 1,
|
|
107
125
|
ArrowLeft: n - 1,
|
|
@@ -111,254 +129,255 @@ var m = ({ api: e, onClose: m, callbackUrl: h, translate: g, providerId: Ee, pro
|
|
|
111
129
|
}[e.key];
|
|
112
130
|
if (r === void 0) return;
|
|
113
131
|
let i = t[(r + t.length) % t.length];
|
|
114
|
-
e.preventDefault(),
|
|
115
|
-
}, $ = !!
|
|
116
|
-
return /* @__PURE__ */ p
|
|
117
|
-
/* @__PURE__ */
|
|
132
|
+
e.preventDefault(), Be(i), document.getElementById(Q(i))?.focus();
|
|
133
|
+
}, $ = !!E && !K, lt = K?.externalAccountEmail || K?.externalAccountName || "";
|
|
134
|
+
return /* @__PURE__ */ h(p, { children: [
|
|
135
|
+
/* @__PURE__ */ h("div", {
|
|
118
136
|
className: "flex flex-shrink-0 items-center justify-between border-b border-border-subtle px-5 py-4",
|
|
119
|
-
children: [/* @__PURE__ */
|
|
137
|
+
children: [/* @__PURE__ */ h("div", {
|
|
120
138
|
className: "flex min-w-0 items-center gap-3",
|
|
121
|
-
children: [
|
|
122
|
-
provider:
|
|
139
|
+
children: [E && /* @__PURE__ */ m(se, {
|
|
140
|
+
provider: E,
|
|
123
141
|
size: 32
|
|
124
|
-
}), /* @__PURE__ */
|
|
142
|
+
}), /* @__PURE__ */ h("div", {
|
|
125
143
|
className: "min-w-0",
|
|
126
|
-
children: [/* @__PURE__ */
|
|
144
|
+
children: [/* @__PURE__ */ m(ie, {
|
|
127
145
|
id: ae,
|
|
128
|
-
className: t("text-base font-semibold text-text-primary",
|
|
129
|
-
children:
|
|
130
|
-
}), /* @__PURE__ */
|
|
146
|
+
className: t("text-base font-semibold text-text-primary", E && "truncate"),
|
|
147
|
+
children: E ? S ? C ? _("integrations.addConnection.oneScreen.reconnectTitle", "Reconnect {{provider}}", { provider: E.name }) : _("integrations.addConnection.oneScreen.title", "Connect {{provider}}", { provider: E.name }) : _("integrations.addConnection.dialog.accountTitle", "{{provider}} account", { provider: E.name }) : Me ?? (S ? _("integrations.addConnection.oneScreen.pickerTitle", "Connect an app") : _("integrations.addConnection.dialog.title", "Add new credential"))
|
|
148
|
+
}), /* @__PURE__ */ m(we.Description, {
|
|
131
149
|
className: "text-xs text-text-secondary",
|
|
132
|
-
children:
|
|
150
|
+
children: E ? S ? _("integrations.addConnection.oneScreen.subtitle", "Your workflows can use this account once it is connected.", { provider: E.name }) : oe(Y?.authType ?? E.authType, _) : _("integrations.addConnection.dialog.subtitle", "Select an app or service to connect to")
|
|
133
151
|
})]
|
|
134
152
|
})]
|
|
135
|
-
}), /* @__PURE__ */
|
|
153
|
+
}), /* @__PURE__ */ m(we.Close, {
|
|
136
154
|
asChild: !0,
|
|
137
|
-
children: /* @__PURE__ */
|
|
155
|
+
children: /* @__PURE__ */ m("button", {
|
|
138
156
|
type: "button",
|
|
139
157
|
className: "flex-shrink-0 rounded-md p-1.5 text-text-secondary transition-colors hover:bg-accent hover:text-text-primary",
|
|
140
|
-
"aria-label":
|
|
141
|
-
children: /* @__PURE__ */
|
|
158
|
+
"aria-label": _("integrations.addConnection.actions.close", "Close dialog"),
|
|
159
|
+
children: /* @__PURE__ */ m(Ce, { size: 20 })
|
|
142
160
|
})
|
|
143
161
|
})]
|
|
144
162
|
}),
|
|
145
|
-
/* @__PURE__ */
|
|
163
|
+
/* @__PURE__ */ h("div", {
|
|
146
164
|
"data-testid": "add-connection-body",
|
|
147
165
|
className: "flex min-h-0 flex-1 flex-col overflow-hidden sm:flex-row",
|
|
148
166
|
children: [
|
|
149
|
-
!
|
|
167
|
+
!T && !E && /* @__PURE__ */ m(ce, {
|
|
150
168
|
api: e,
|
|
151
169
|
source: De,
|
|
152
|
-
translate:
|
|
153
|
-
searchInputRef:
|
|
154
|
-
onSelect: q,
|
|
155
|
-
navigationV2:
|
|
170
|
+
translate: _,
|
|
171
|
+
searchInputRef: Ne,
|
|
172
|
+
onSelect: (e) => q(e),
|
|
173
|
+
navigationV2: S
|
|
156
174
|
}),
|
|
157
|
-
|
|
175
|
+
T && !E && Re && /* @__PURE__ */ m("div", {
|
|
158
176
|
className: "flex flex-1 items-center justify-center p-8",
|
|
159
|
-
children: /* @__PURE__ */
|
|
177
|
+
children: /* @__PURE__ */ m(xe, {
|
|
160
178
|
size: 32,
|
|
161
179
|
className: "animate-spin text-text-secondary"
|
|
162
180
|
})
|
|
163
181
|
}),
|
|
164
|
-
|
|
182
|
+
T && !E && !Re && /* @__PURE__ */ h("div", {
|
|
165
183
|
className: "flex flex-1 flex-col items-center justify-center p-8 text-center",
|
|
166
|
-
children: [/* @__PURE__ */
|
|
184
|
+
children: [/* @__PURE__ */ m(he, {
|
|
167
185
|
size: 32,
|
|
168
186
|
className: "mb-3 text-text-secondary"
|
|
169
|
-
}), /* @__PURE__ */
|
|
187
|
+
}), /* @__PURE__ */ m("p", {
|
|
170
188
|
className: "text-sm text-text-secondary",
|
|
171
|
-
children:
|
|
189
|
+
children: _("integrations.addConnection.providerUnavailable", "This provider isn't available.")
|
|
172
190
|
})]
|
|
173
191
|
}),
|
|
174
|
-
|
|
192
|
+
E && K && /* @__PURE__ */ h("div", {
|
|
175
193
|
className: "flex flex-1 flex-col items-center justify-center p-8 text-center",
|
|
176
194
|
children: [
|
|
177
|
-
/* @__PURE__ */
|
|
195
|
+
/* @__PURE__ */ m("div", {
|
|
178
196
|
className: "mb-4 rounded-full bg-status-success-bg-subtle p-3",
|
|
179
|
-
children: /* @__PURE__ */
|
|
197
|
+
children: /* @__PURE__ */ m(_e, {
|
|
180
198
|
size: 48,
|
|
181
199
|
className: "text-status-success-text"
|
|
182
200
|
})
|
|
183
201
|
}),
|
|
184
|
-
/* @__PURE__ */
|
|
202
|
+
/* @__PURE__ */ m("h3", {
|
|
185
203
|
className: "mb-1 text-lg font-semibold text-text-primary",
|
|
186
|
-
children:
|
|
187
|
-
provider:
|
|
188
|
-
account:
|
|
189
|
-
}) :
|
|
204
|
+
children: S ? lt ? _("integrations.addConnection.oneScreen.successAs", "{{provider}} connected as {{account}}", {
|
|
205
|
+
provider: E.name,
|
|
206
|
+
account: lt
|
|
207
|
+
}) : _("integrations.addConnection.oneScreen.success", "{{provider}} connected", { provider: E.name }) : _("integrations.addConnection.success.title", "Connection Created!")
|
|
190
208
|
}),
|
|
191
|
-
/* @__PURE__ */
|
|
209
|
+
/* @__PURE__ */ m("p", {
|
|
192
210
|
className: "mb-6 text-sm text-text-secondary",
|
|
193
|
-
children:
|
|
211
|
+
children: _("integrations.addConnection.success.description", "Your {{provider}} connection has been set up successfully.", { provider: E.name })
|
|
194
212
|
}),
|
|
195
|
-
|
|
213
|
+
x ? x(K) : /* @__PURE__ */ m("button", {
|
|
196
214
|
type: "button",
|
|
197
|
-
onClick:
|
|
215
|
+
onClick: r,
|
|
198
216
|
className: "rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text transition-colors hover:bg-action-primary-bg/90",
|
|
199
|
-
children:
|
|
217
|
+
children: _("integrations.addConnection.actions.done", "Done")
|
|
200
218
|
})
|
|
201
219
|
]
|
|
202
220
|
}),
|
|
203
|
-
|
|
221
|
+
E && $ && S && /* @__PURE__ */ m("div", {
|
|
204
222
|
"data-testid": "add-connection-pane",
|
|
205
223
|
className: "min-h-0 min-w-0 flex-1 overflow-y-auto p-5",
|
|
206
|
-
children: /* @__PURE__ */
|
|
224
|
+
children: /* @__PURE__ */ m(re, {
|
|
207
225
|
api: e,
|
|
208
|
-
provider:
|
|
209
|
-
methods:
|
|
210
|
-
method:
|
|
211
|
-
flow:
|
|
212
|
-
schema:
|
|
213
|
-
name:
|
|
214
|
-
onNameChange:
|
|
215
|
-
description:
|
|
216
|
-
onDescriptionChange:
|
|
217
|
-
values:
|
|
218
|
-
setValues:
|
|
219
|
-
onMethodChange:
|
|
220
|
-
storage:
|
|
221
|
-
setStorage:
|
|
222
|
-
supportedStorageModes:
|
|
226
|
+
provider: E,
|
|
227
|
+
methods: rt,
|
|
228
|
+
method: Y,
|
|
229
|
+
flow: X,
|
|
230
|
+
schema: nt,
|
|
231
|
+
name: O,
|
|
232
|
+
onNameChange: k,
|
|
233
|
+
description: A,
|
|
234
|
+
onDescriptionChange: j,
|
|
235
|
+
values: M,
|
|
236
|
+
setValues: N,
|
|
237
|
+
onMethodChange: et,
|
|
238
|
+
storage: I,
|
|
239
|
+
setStorage: L,
|
|
240
|
+
supportedStorageModes: c(E, Y),
|
|
223
241
|
scopeOptions: Z,
|
|
224
|
-
defaultScopes:
|
|
225
|
-
scopeSelection:
|
|
226
|
-
setScopeSelection:
|
|
227
|
-
callbackUrl:
|
|
228
|
-
requireVault:
|
|
229
|
-
canCreateVault:
|
|
230
|
-
errorMessage:
|
|
242
|
+
defaultScopes: it,
|
|
243
|
+
scopeSelection: P,
|
|
244
|
+
setScopeSelection: F,
|
|
245
|
+
callbackUrl: g,
|
|
246
|
+
requireVault: y,
|
|
247
|
+
canCreateVault: Oe,
|
|
248
|
+
errorMessage: Je,
|
|
231
249
|
busy: U,
|
|
232
|
-
translate:
|
|
250
|
+
translate: _,
|
|
233
251
|
fieldId: H,
|
|
234
|
-
reconnect: !!
|
|
235
|
-
storageAtTop:
|
|
236
|
-
onVaultsLoaded:
|
|
237
|
-
sharing:
|
|
238
|
-
translate:
|
|
239
|
-
visibility:
|
|
240
|
-
onVisibilityChange:
|
|
252
|
+
reconnect: !!C,
|
|
253
|
+
storageAtTop: y && Ue === 0,
|
|
254
|
+
onVaultsLoaded: We,
|
|
255
|
+
sharing: Ae ? /* @__PURE__ */ m(te, {
|
|
256
|
+
translate: _,
|
|
257
|
+
visibility: R ?? "WORKSPACE",
|
|
258
|
+
onVisibilityChange: z,
|
|
241
259
|
idPrefix: V
|
|
242
260
|
}) : void 0,
|
|
243
|
-
about: /* @__PURE__ */
|
|
244
|
-
provider:
|
|
245
|
-
translate:
|
|
261
|
+
about: /* @__PURE__ */ m(l, {
|
|
262
|
+
provider: E,
|
|
263
|
+
translate: _
|
|
246
264
|
}),
|
|
247
|
-
signInBlocked:
|
|
248
|
-
onOpenSignIn:
|
|
265
|
+
signInBlocked: Ye,
|
|
266
|
+
onOpenSignIn: Xe
|
|
249
267
|
})
|
|
250
268
|
}),
|
|
251
|
-
|
|
269
|
+
E && $ && !S && /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m("div", {
|
|
252
270
|
role: "tablist",
|
|
253
271
|
"aria-labelledby": "add-connection-dialog-title",
|
|
254
272
|
"data-testid": "add-connection-tabs",
|
|
255
273
|
className: "flex flex-shrink-0 overflow-x-auto border-b border-border-subtle sm:block sm:w-40 sm:overflow-x-visible sm:border-b-0 sm:border-e sm:py-3",
|
|
256
|
-
children:
|
|
257
|
-
let n = e.icon, r =
|
|
258
|
-
return /* @__PURE__ */
|
|
274
|
+
children: ot.map((e) => {
|
|
275
|
+
let n = e.icon, r = D === e.key;
|
|
276
|
+
return /* @__PURE__ */ h("button", {
|
|
259
277
|
id: Q(e.key),
|
|
260
278
|
type: "button",
|
|
261
279
|
role: "tab",
|
|
262
280
|
"aria-selected": r,
|
|
263
|
-
"aria-controls":
|
|
281
|
+
"aria-controls": st,
|
|
264
282
|
tabIndex: r ? 0 : -1,
|
|
265
|
-
onClick: () =>
|
|
266
|
-
onKeyDown:
|
|
283
|
+
onClick: () => Be(e.key),
|
|
284
|
+
onKeyDown: ct,
|
|
267
285
|
className: t("flex min-w-max items-center gap-2 border-b-2 px-4 py-2 text-sm font-medium transition-colors sm:w-full sm:border-b-0 sm:border-s-2", r ? "border-primary bg-accent/50 text-text-primary" : "border-transparent text-text-secondary hover:bg-accent/30 hover:text-text-primary"),
|
|
268
|
-
children: [/* @__PURE__ */
|
|
286
|
+
children: [/* @__PURE__ */ m(n, {
|
|
269
287
|
size: 16,
|
|
270
288
|
"aria-hidden": "true"
|
|
271
289
|
}), e.label]
|
|
272
290
|
}, e.key);
|
|
273
291
|
})
|
|
274
|
-
}), /* @__PURE__ */
|
|
275
|
-
id:
|
|
292
|
+
}), /* @__PURE__ */ h("div", {
|
|
293
|
+
id: st,
|
|
276
294
|
role: "tabpanel",
|
|
277
|
-
"aria-labelledby": Q(
|
|
295
|
+
"aria-labelledby": Q(D),
|
|
278
296
|
"data-testid": "add-connection-pane",
|
|
279
297
|
className: "min-h-0 min-w-0 flex-1 overflow-y-auto p-5",
|
|
280
298
|
children: [
|
|
281
|
-
|
|
299
|
+
D === "connection" && /* @__PURE__ */ m(ne, {
|
|
282
300
|
api: e,
|
|
283
|
-
provider:
|
|
284
|
-
methods:
|
|
285
|
-
method:
|
|
286
|
-
flow:
|
|
287
|
-
schema:
|
|
288
|
-
name:
|
|
289
|
-
onNameChange:
|
|
290
|
-
description:
|
|
291
|
-
onDescriptionChange:
|
|
292
|
-
values:
|
|
293
|
-
setValues:
|
|
294
|
-
onMethodChange:
|
|
295
|
-
storage:
|
|
296
|
-
setStorage:
|
|
297
|
-
supportedStorageModes:
|
|
301
|
+
provider: E,
|
|
302
|
+
methods: rt,
|
|
303
|
+
method: Y,
|
|
304
|
+
flow: X,
|
|
305
|
+
schema: nt,
|
|
306
|
+
name: O,
|
|
307
|
+
onNameChange: k,
|
|
308
|
+
description: A,
|
|
309
|
+
onDescriptionChange: j,
|
|
310
|
+
values: M,
|
|
311
|
+
setValues: N,
|
|
312
|
+
onMethodChange: et,
|
|
313
|
+
storage: I,
|
|
314
|
+
setStorage: L,
|
|
315
|
+
supportedStorageModes: c(E, Y),
|
|
298
316
|
scopeOptions: Z,
|
|
299
|
-
defaultScopes:
|
|
300
|
-
scopeSelection:
|
|
301
|
-
setScopeSelection:
|
|
302
|
-
callbackUrl:
|
|
303
|
-
requireVault:
|
|
304
|
-
canCreateVault:
|
|
305
|
-
errorMessage:
|
|
317
|
+
defaultScopes: it,
|
|
318
|
+
scopeSelection: P,
|
|
319
|
+
setScopeSelection: F,
|
|
320
|
+
callbackUrl: g,
|
|
321
|
+
requireVault: y,
|
|
322
|
+
canCreateVault: Oe,
|
|
323
|
+
errorMessage: Je,
|
|
306
324
|
busy: U,
|
|
307
|
-
translate:
|
|
308
|
-
fieldId: H
|
|
325
|
+
translate: _,
|
|
326
|
+
fieldId: H,
|
|
327
|
+
reconnect: !!C
|
|
309
328
|
}),
|
|
310
|
-
|
|
311
|
-
translate:
|
|
312
|
-
visibility:
|
|
313
|
-
onVisibilityChange:
|
|
329
|
+
D === "sharing" && /* @__PURE__ */ m(te, {
|
|
330
|
+
translate: _,
|
|
331
|
+
visibility: R ?? "WORKSPACE",
|
|
332
|
+
onVisibilityChange: z,
|
|
314
333
|
idPrefix: V
|
|
315
334
|
}),
|
|
316
|
-
|
|
317
|
-
provider:
|
|
318
|
-
translate:
|
|
335
|
+
D === "details" && /* @__PURE__ */ m(l, {
|
|
336
|
+
provider: E,
|
|
337
|
+
translate: _
|
|
319
338
|
})
|
|
320
339
|
]
|
|
321
340
|
})] })
|
|
322
341
|
]
|
|
323
342
|
}),
|
|
324
|
-
|
|
343
|
+
E && $ && /* @__PURE__ */ h("div", {
|
|
325
344
|
"data-testid": "add-connection-footer",
|
|
326
345
|
className: "flex flex-shrink-0 items-center justify-end gap-2 border-t border-border-subtle px-5 py-3",
|
|
327
346
|
children: [
|
|
328
|
-
|
|
347
|
+
Ye && !S && /* @__PURE__ */ h("button", {
|
|
329
348
|
type: "button",
|
|
330
349
|
"data-testid": "open-sign-in-window",
|
|
331
|
-
onClick:
|
|
350
|
+
onClick: Xe,
|
|
332
351
|
className: "me-auto inline-flex items-center gap-1.5 rounded-md border border-border-subtle px-3 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-accent",
|
|
333
|
-
children: [/* @__PURE__ */
|
|
352
|
+
children: [/* @__PURE__ */ m(ve, {
|
|
334
353
|
size: 14,
|
|
335
354
|
"aria-hidden": "true"
|
|
336
|
-
}),
|
|
355
|
+
}), _("integrations.addConnection.actions.openSignInWindow", "Open sign-in window")]
|
|
337
356
|
}),
|
|
338
|
-
/* @__PURE__ */
|
|
357
|
+
/* @__PURE__ */ m("button", {
|
|
339
358
|
type: "button",
|
|
340
|
-
onClick:
|
|
359
|
+
onClick: S && W ? Ze : r,
|
|
341
360
|
"data-testid": "add-connection-cancel",
|
|
342
361
|
className: "rounded-md border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-accent",
|
|
343
|
-
children:
|
|
362
|
+
children: _("integrations.addConnection.actions.cancel", "Cancel")
|
|
344
363
|
}),
|
|
345
|
-
/* @__PURE__ */
|
|
364
|
+
/* @__PURE__ */ h("button", {
|
|
346
365
|
type: "button",
|
|
347
366
|
"data-testid": "add-connection-submit",
|
|
348
|
-
onClick:
|
|
349
|
-
disabled: U || !
|
|
367
|
+
onClick: at,
|
|
368
|
+
disabled: U || !O.trim(),
|
|
350
369
|
className: "inline-flex items-center gap-1.5 rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text transition-colors hover:bg-action-primary-bg/90 disabled:opacity-50",
|
|
351
|
-
children: [U ? /* @__PURE__ */
|
|
370
|
+
children: [U ? /* @__PURE__ */ m(xe, {
|
|
352
371
|
size: 14,
|
|
353
372
|
className: "animate-spin",
|
|
354
373
|
"aria-hidden": "true"
|
|
355
|
-
}) : /* @__PURE__ */
|
|
374
|
+
}) : /* @__PURE__ */ m(ge, {
|
|
356
375
|
size: 14,
|
|
357
376
|
"aria-hidden": "true"
|
|
358
|
-
}),
|
|
377
|
+
}), S ? W ? _("integrations.addConnection.oneScreen.waiting", "Waiting for {{provider}}…", { provider: E.name }) : X === "oauth2" ? _("integrations.addConnection.oneScreen.signIn", "Sign in with {{provider}}", { provider: E.name }) : _("integrations.addConnection.actions.connect", "Connect") : W ? _("integrations.addConnection.actions.waiting", "Waiting...") : _("integrations.addConnection.actions.connect", "Connect")]
|
|
359
378
|
})
|
|
360
379
|
]
|
|
361
380
|
})
|
|
362
381
|
] });
|
|
363
382
|
};
|
|
364
|
-
export {
|
|
383
|
+
export { g as ConnectionDialogPanel };
|
|
@@ -48,5 +48,11 @@ export interface ConnectionFormTabProps {
|
|
|
48
48
|
translate: Translator;
|
|
49
49
|
/** Namespaces this form's element ids. */
|
|
50
50
|
fieldId: (field: string) => string;
|
|
51
|
+
/**
|
|
52
|
+
* Signing in again on an existing connection. Where its credential is kept
|
|
53
|
+
* was chosen when it was made and cannot change here, so that choice is
|
|
54
|
+
* not shown.
|
|
55
|
+
*/
|
|
56
|
+
reconnect?: boolean;
|
|
51
57
|
}
|
|
52
58
|
export declare const ConnectionFormTab: FC<ConnectionFormTabProps>;
|
|
@@ -55,7 +55,7 @@ var _ = "{{ $secrets.<provider>.<name> }}", v = ({ values: e, translate: t }) =>
|
|
|
55
55
|
children: e
|
|
56
56
|
})]
|
|
57
57
|
});
|
|
58
|
-
}, b = ({ api: l, provider: u, methods: f, method: _, flow: b, schema: x, name: S, onNameChange: C, description: w, onDescriptionChange: T, values: E, setValues: D, onMethodChange: O, storage: k, setStorage: A, supportedStorageModes: j, scopeOptions: M, defaultScopes: N, scopeSelection: P, setScopeSelection: F, callbackUrl: I, requireVault: L, canCreateVault: R, errorMessage: z, busy: B, translate: V, fieldId: H }) => /* @__PURE__ */ g("div", {
|
|
58
|
+
}, b = ({ api: l, provider: u, methods: f, method: _, flow: b, schema: x, name: S, onNameChange: C, description: w, onDescriptionChange: T, values: E, setValues: D, onMethodChange: O, storage: k, setStorage: A, supportedStorageModes: j, scopeOptions: M, defaultScopes: N, scopeSelection: P, setScopeSelection: F, callbackUrl: I, requireVault: L, canCreateVault: R, errorMessage: z, busy: B, translate: V, fieldId: H, reconnect: U = !1 }) => /* @__PURE__ */ g("div", {
|
|
59
59
|
className: "space-y-5",
|
|
60
60
|
children: [
|
|
61
61
|
z && /* @__PURE__ */ g("div", {
|
|
@@ -102,7 +102,7 @@ var _ = "{{ $secrets.<provider>.<name> }}", v = ({ values: e, translate: t }) =>
|
|
|
102
102
|
disabled: B,
|
|
103
103
|
className: o
|
|
104
104
|
})] }),
|
|
105
|
-
i(b, u) && /* @__PURE__ */ h(a, {
|
|
105
|
+
!U && i(b, u) && /* @__PURE__ */ h(a, {
|
|
106
106
|
api: l,
|
|
107
107
|
value: k,
|
|
108
108
|
onChange: A,
|