@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.
@@ -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, resolveFlow as r, resolveMethod as i, resolveSchema as a, selectableMethods as o, supportedStorageModes as s } from "./connectionFlow.js";
4
- import { ConnectionDetailsTab as ee, ConnectionSharingTab as te } from "./ConnectionDetailsTab.js";
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 c } from "./storage.js";
14
- import { useConnectionSubmit as de } from "./useConnectionSubmit.js";
15
- import { useCallback as l, useEffect as fe, useId as pe, useMemo as u, useState as d } from "react";
16
- import { AlertCircle as me, Check as he, CheckCircle2 as ge, ExternalLink as _e, Info as ve, Link2 as ye, Loader2 as be, Share2 as xe, X as Se } from "lucide-react";
17
- import { Fragment as Ce, jsx as f, jsxs as p } from "react/jsx-runtime";
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
- return e(a(t, i(t, n)));
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 m = ({ api: e, onClose: m, callbackUrl: h, translate: g, providerId: Ee, providerKey: _, providerSource: De, requireVault: v, canCreateVault: y, defaultName: b, extraConfig: Oe, showSharingTab: x, defaultVisibility: ke, pickerTitle: Ae, searchInputRef: je, onConnectionCreated: Me, onError: Ne, onEvent: Pe, renderSuccessAction: S, navigationV2: C = !1, reconnect: w = null }) => {
24
- let T = w?.providerId ?? Ee, E = !!(T || _), [D, Fe] = d(null), [O, Ie] = d(E), [k, A] = d("connection"), [j, M] = d(w?.name ?? b ?? ""), [N, Le] = d(""), [Re, ze] = d(null), [P, F] = d({}), [I, L] = d(null), [R, z] = d(c), [B, Be] = d(ke), [Ve, He] = d(null), V = pe(), H = l((e) => `${V}-${e}`, [V]), Ue = u(() => w ? {
25
- id: w.connectionId,
26
- name: w.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, [w]), { submit: We, busy: U, oauthWaiting: W, errorMessage: Ge, setErrorMessage: G, created: K, signInBlocked: Ke, openBlockedSignIn: qe, cancelSignIn: Je } = de({
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: h,
32
- translate: g,
33
- onConnectionCreated: Me,
34
- onError: Ne,
35
- onEvent: Pe,
36
- reconnectConnection: Ue
37
- }), Ye = w?.name, Xe = w?.authMethodKey ?? null, q = l((e) => {
38
- let t = Xe;
39
- Fe(e), M(Ye ?? b ?? `${e.name} Connection`), ze(t), F(Te(e, t)), z(n(c, s(e, i(e, t)))), L(null), G("");
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
- Ye,
43
- Xe,
49
+ Qe,
50
+ $e,
44
51
  G
45
- ]), Ze = l((e) => {
46
- if (!D) return;
47
- ze(e), F(Te(D, e));
48
- let t = s(D, i(D, e));
49
- z((e) => ({
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
- })), L(null), G("");
53
- }, [D, G]);
54
- fe(() => {
55
- if (!E) return;
56
- let t = !1;
57
- return e.getProvider({
58
- id: T ?? void 0,
59
- key: _ ?? void 0
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 || Ie(!1);
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 J = D ? i(D, Re) : null, Y = D ? r(D, J) : "fields", X = u(() => D ? a(D, J) : null, [D, J]), Z = u(() => le(J?.availableScopes ?? D?.availableScopes), [J, D]), Qe = J && J.defaultScopes.length > 0 ? J.defaultScopes : D?.defaultScopes ?? [], $e = () => {
75
- D && We({
76
- provider: D,
77
- method: J,
78
- name: j,
79
- description: N,
80
- values: P,
81
- storage: R,
82
- requireVault: v,
83
- extraConfig: Oe,
84
- visibility: B,
85
- reconnect: !!w
86
- }, ue(I, Z));
87
- }, et = [
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: g("integrations.addConnection.tabs.connection", "Connection"),
91
- icon: ye
108
+ label: _("integrations.addConnection.tabs.connection", "Connection"),
109
+ icon: be
92
110
  },
93
- ...x ? [{
111
+ ...Ae ? [{
94
112
  key: "sharing",
95
- label: g("integrations.addConnection.tabs.sharing", "Sharing"),
96
- icon: xe
113
+ label: _("integrations.addConnection.tabs.sharing", "Sharing"),
114
+ icon: Se
97
115
  }] : [],
98
116
  {
99
117
  key: "details",
100
- label: g("integrations.addConnection.tabs.details", "Details"),
101
- icon: ve
118
+ label: _("integrations.addConnection.tabs.details", "Details"),
119
+ icon: ye
102
120
  }
103
- ], Q = (e) => H(`tab-${e}`), tt = H("tabpanel"), nt = (e) => {
104
- let t = et.map((e) => e.key), n = t.indexOf(k), r = {
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(), A(i), document.getElementById(Q(i))?.focus();
115
- }, $ = !!D && !K, rt = K?.externalAccountEmail || K?.externalAccountName || "";
116
- return /* @__PURE__ */ p(Ce, { children: [
117
- /* @__PURE__ */ p("div", {
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__ */ p("div", {
137
+ children: [/* @__PURE__ */ h("div", {
120
138
  className: "flex min-w-0 items-center gap-3",
121
- children: [D && /* @__PURE__ */ f(se, {
122
- provider: D,
139
+ children: [E && /* @__PURE__ */ m(se, {
140
+ provider: E,
123
141
  size: 32
124
- }), /* @__PURE__ */ p("div", {
142
+ }), /* @__PURE__ */ h("div", {
125
143
  className: "min-w-0",
126
- children: [/* @__PURE__ */ f(ie, {
144
+ children: [/* @__PURE__ */ m(ie, {
127
145
  id: ae,
128
- className: t("text-base font-semibold text-text-primary", D && "truncate"),
129
- children: D ? C ? w ? g("integrations.addConnection.oneScreen.reconnectTitle", "Reconnect {{provider}}", { provider: D.name }) : g("integrations.addConnection.oneScreen.title", "Connect {{provider}}", { provider: D.name }) : g("integrations.addConnection.dialog.accountTitle", "{{provider}} account", { provider: D.name }) : Ae ?? (C ? g("integrations.addConnection.oneScreen.pickerTitle", "Connect an app") : g("integrations.addConnection.dialog.title", "Add new credential"))
130
- }), /* @__PURE__ */ f(we.Description, {
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: D ? C ? g("integrations.addConnection.oneScreen.subtitle", "Your workflows can use this account once it is connected.", { provider: D.name }) : oe(J?.authType ?? D.authType, g) : g("integrations.addConnection.dialog.subtitle", "Select an app or service to connect to")
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__ */ f(we.Close, {
153
+ }), /* @__PURE__ */ m(we.Close, {
136
154
  asChild: !0,
137
- children: /* @__PURE__ */ f("button", {
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": g("integrations.addConnection.actions.close", "Close dialog"),
141
- children: /* @__PURE__ */ f(Se, { size: 20 })
158
+ "aria-label": _("integrations.addConnection.actions.close", "Close dialog"),
159
+ children: /* @__PURE__ */ m(Ce, { size: 20 })
142
160
  })
143
161
  })]
144
162
  }),
145
- /* @__PURE__ */ p("div", {
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
- !E && !D && /* @__PURE__ */ f(ce, {
167
+ !T && !E && /* @__PURE__ */ m(ce, {
150
168
  api: e,
151
169
  source: De,
152
- translate: g,
153
- searchInputRef: je,
154
- onSelect: q,
155
- navigationV2: C
170
+ translate: _,
171
+ searchInputRef: Ne,
172
+ onSelect: (e) => q(e),
173
+ navigationV2: S
156
174
  }),
157
- E && !D && O && /* @__PURE__ */ f("div", {
175
+ T && !E && Re && /* @__PURE__ */ m("div", {
158
176
  className: "flex flex-1 items-center justify-center p-8",
159
- children: /* @__PURE__ */ f(be, {
177
+ children: /* @__PURE__ */ m(xe, {
160
178
  size: 32,
161
179
  className: "animate-spin text-text-secondary"
162
180
  })
163
181
  }),
164
- E && !D && !O && /* @__PURE__ */ p("div", {
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__ */ f(me, {
184
+ children: [/* @__PURE__ */ m(he, {
167
185
  size: 32,
168
186
  className: "mb-3 text-text-secondary"
169
- }), /* @__PURE__ */ f("p", {
187
+ }), /* @__PURE__ */ m("p", {
170
188
  className: "text-sm text-text-secondary",
171
- children: g("integrations.addConnection.providerUnavailable", "This provider isn't available.")
189
+ children: _("integrations.addConnection.providerUnavailable", "This provider isn't available.")
172
190
  })]
173
191
  }),
174
- D && K && /* @__PURE__ */ p("div", {
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__ */ f("div", {
195
+ /* @__PURE__ */ m("div", {
178
196
  className: "mb-4 rounded-full bg-status-success-bg-subtle p-3",
179
- children: /* @__PURE__ */ f(ge, {
197
+ children: /* @__PURE__ */ m(_e, {
180
198
  size: 48,
181
199
  className: "text-status-success-text"
182
200
  })
183
201
  }),
184
- /* @__PURE__ */ f("h3", {
202
+ /* @__PURE__ */ m("h3", {
185
203
  className: "mb-1 text-lg font-semibold text-text-primary",
186
- children: C ? rt ? g("integrations.addConnection.oneScreen.successAs", "{{provider}} connected as {{account}}", {
187
- provider: D.name,
188
- account: rt
189
- }) : g("integrations.addConnection.oneScreen.success", "{{provider}} connected", { provider: D.name }) : g("integrations.addConnection.success.title", "Connection Created!")
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__ */ f("p", {
209
+ /* @__PURE__ */ m("p", {
192
210
  className: "mb-6 text-sm text-text-secondary",
193
- children: g("integrations.addConnection.success.description", "Your {{provider}} connection has been set up successfully.", { provider: D.name })
211
+ children: _("integrations.addConnection.success.description", "Your {{provider}} connection has been set up successfully.", { provider: E.name })
194
212
  }),
195
- S ? S(K) : /* @__PURE__ */ f("button", {
213
+ x ? x(K) : /* @__PURE__ */ m("button", {
196
214
  type: "button",
197
- onClick: m,
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: g("integrations.addConnection.actions.done", "Done")
217
+ children: _("integrations.addConnection.actions.done", "Done")
200
218
  })
201
219
  ]
202
220
  }),
203
- D && $ && C && /* @__PURE__ */ f("div", {
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__ */ f(re, {
224
+ children: /* @__PURE__ */ m(re, {
207
225
  api: e,
208
- provider: D,
209
- methods: o(D),
210
- method: J,
211
- flow: Y,
212
- schema: X,
213
- name: j,
214
- onNameChange: M,
215
- description: N,
216
- onDescriptionChange: Le,
217
- values: P,
218
- setValues: F,
219
- onMethodChange: Ze,
220
- storage: R,
221
- setStorage: z,
222
- supportedStorageModes: s(D, J),
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: Qe,
225
- scopeSelection: I,
226
- setScopeSelection: L,
227
- callbackUrl: h,
228
- requireVault: v,
229
- canCreateVault: y,
230
- errorMessage: Ge,
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: g,
250
+ translate: _,
233
251
  fieldId: H,
234
- reconnect: !!w,
235
- storageAtTop: v && Ve === 0,
236
- onVaultsLoaded: He,
237
- sharing: x ? /* @__PURE__ */ f(te, {
238
- translate: g,
239
- visibility: B ?? "WORKSPACE",
240
- onVisibilityChange: Be,
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__ */ f(ee, {
244
- provider: D,
245
- translate: g
261
+ about: /* @__PURE__ */ m(l, {
262
+ provider: E,
263
+ translate: _
246
264
  }),
247
- signInBlocked: Ke,
248
- onOpenSignIn: qe
265
+ signInBlocked: Ye,
266
+ onOpenSignIn: Xe
249
267
  })
250
268
  }),
251
- D && $ && !C && /* @__PURE__ */ p(Ce, { children: [/* @__PURE__ */ f("div", {
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: et.map((e) => {
257
- let n = e.icon, r = k === e.key;
258
- return /* @__PURE__ */ p("button", {
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": tt,
281
+ "aria-controls": st,
264
282
  tabIndex: r ? 0 : -1,
265
- onClick: () => A(e.key),
266
- onKeyDown: nt,
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__ */ f(n, {
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__ */ p("div", {
275
- id: tt,
292
+ }), /* @__PURE__ */ h("div", {
293
+ id: st,
276
294
  role: "tabpanel",
277
- "aria-labelledby": Q(k),
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
- k === "connection" && /* @__PURE__ */ f(ne, {
299
+ D === "connection" && /* @__PURE__ */ m(ne, {
282
300
  api: e,
283
- provider: D,
284
- methods: o(D),
285
- method: J,
286
- flow: Y,
287
- schema: X,
288
- name: j,
289
- onNameChange: M,
290
- description: N,
291
- onDescriptionChange: Le,
292
- values: P,
293
- setValues: F,
294
- onMethodChange: Ze,
295
- storage: R,
296
- setStorage: z,
297
- supportedStorageModes: s(D, J),
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: Qe,
300
- scopeSelection: I,
301
- setScopeSelection: L,
302
- callbackUrl: h,
303
- requireVault: v,
304
- canCreateVault: y,
305
- errorMessage: Ge,
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: g,
308
- fieldId: H
325
+ translate: _,
326
+ fieldId: H,
327
+ reconnect: !!C
309
328
  }),
310
- k === "sharing" && /* @__PURE__ */ f(te, {
311
- translate: g,
312
- visibility: B ?? "WORKSPACE",
313
- onVisibilityChange: Be,
329
+ D === "sharing" && /* @__PURE__ */ m(te, {
330
+ translate: _,
331
+ visibility: R ?? "WORKSPACE",
332
+ onVisibilityChange: z,
314
333
  idPrefix: V
315
334
  }),
316
- k === "details" && /* @__PURE__ */ f(ee, {
317
- provider: D,
318
- translate: g
335
+ D === "details" && /* @__PURE__ */ m(l, {
336
+ provider: E,
337
+ translate: _
319
338
  })
320
339
  ]
321
340
  })] })
322
341
  ]
323
342
  }),
324
- D && $ && /* @__PURE__ */ p("div", {
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
- Ke && !C && /* @__PURE__ */ p("button", {
347
+ Ye && !S && /* @__PURE__ */ h("button", {
329
348
  type: "button",
330
349
  "data-testid": "open-sign-in-window",
331
- onClick: qe,
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__ */ f(_e, {
352
+ children: [/* @__PURE__ */ m(ve, {
334
353
  size: 14,
335
354
  "aria-hidden": "true"
336
- }), g("integrations.addConnection.actions.openSignInWindow", "Open sign-in window")]
355
+ }), _("integrations.addConnection.actions.openSignInWindow", "Open sign-in window")]
337
356
  }),
338
- /* @__PURE__ */ f("button", {
357
+ /* @__PURE__ */ m("button", {
339
358
  type: "button",
340
- onClick: C && W ? Je : m,
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: g("integrations.addConnection.actions.cancel", "Cancel")
362
+ children: _("integrations.addConnection.actions.cancel", "Cancel")
344
363
  }),
345
- /* @__PURE__ */ p("button", {
364
+ /* @__PURE__ */ h("button", {
346
365
  type: "button",
347
366
  "data-testid": "add-connection-submit",
348
- onClick: $e,
349
- disabled: U || !j.trim(),
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__ */ f(be, {
370
+ children: [U ? /* @__PURE__ */ m(xe, {
352
371
  size: 14,
353
372
  className: "animate-spin",
354
373
  "aria-hidden": "true"
355
- }) : /* @__PURE__ */ f(he, {
374
+ }) : /* @__PURE__ */ m(ge, {
356
375
  size: 14,
357
376
  "aria-hidden": "true"
358
- }), C ? W ? g("integrations.addConnection.oneScreen.waiting", "Waiting for {{provider}}…", { provider: D.name }) : Y === "oauth2" ? g("integrations.addConnection.oneScreen.signIn", "Sign in with {{provider}}", { provider: D.name }) : g("integrations.addConnection.actions.connect", "Connect") : W ? g("integrations.addConnection.actions.waiting", "Waiting...") : g("integrations.addConnection.actions.connect", "Connect")]
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 { m as ConnectionDialogPanel };
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,