@burdenoff/fe-libs 2026.1119.8 → 2026.1119.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -21,25 +21,28 @@ function p(e) {
21
21
  let t = window.screenX + (window.innerWidth - d) / 2, n = window.screenY + (window.innerHeight - f) / 2;
22
22
  return window.open(e, "oauth_popup", `width=${d},height=${f},left=${t},top=${n},toolbar=no,menubar=no,scrollbars=yes,resizable=yes`);
23
23
  }
24
- function m({ api: e, callbackUrl: d, translate: f, onConnectionCreated: m, onError: h, onEvent: g, reconnectConnection: _ }) {
25
- let [v, y] = s(!1), [b, x] = s(!1), [S, C] = s(""), [w, T] = s(null), [E, D] = s(null), O = o(null), k = o(null), A = o(null);
26
- a(() => () => {
27
- O.current?.(), k.current && !k.current.closed && k.current.close();
24
+ function m({ api: e, callbackUrl: d, translate: f, onConnectionCreated: m, onError: h, onEvent: g, reconnectConnection: _, reconnectSettings: v }) {
25
+ let [y, b] = s(!1), [x, S] = s(!1), [C, w] = s(""), [T, E] = s(null), [D, O] = s(null), k = o(null), A = o(null), j = o(null), M = o(v ?? null);
26
+ a(() => {
27
+ M.current = v ?? null;
28
+ }, [v]), a(() => () => {
29
+ k.current?.(), A.current && !A.current.closed && A.current.close();
28
30
  }, []);
29
- let j = i((e) => {
30
- A.current = null, D(null), T(e), m?.(e);
31
- }, [m]), M = i((e) => {
32
- C(e), h?.(Error(e));
33
- }, [h]), N = i((t, n, i) => {
34
- k.current = n, D(null), x(!0), g?.({
31
+ let N = i((e) => {
32
+ j.current = null, O(null), E(e), m?.(e);
33
+ }, [m]), P = i((e) => {
34
+ w(e), h?.(Error(e));
35
+ }, [h]), F = i((t, n, i, a) => {
36
+ A.current = n, O(null), S(!0), g?.({
35
37
  type: "oauth-started",
36
38
  connectionId: t,
37
39
  providerKey: i.key
38
- }), O.current?.(), O.current = r({
40
+ }), k.current?.(), k.current = r({
39
41
  connectionId: t,
40
42
  popup: n,
41
43
  fetchConnection: () => e.getConnection(t),
42
- onSuccess: (e) => j({
44
+ baseline: a,
45
+ onSuccess: (e) => N({
43
46
  ...e,
44
47
  provider: i
45
48
  }),
@@ -49,94 +52,105 @@ function m({ api: e, callbackUrl: d, translate: f, onConnectionCreated: m, onErr
49
52
  connectionId: t,
50
53
  providerKey: i.key,
51
54
  error: e
52
- }), M(e);
55
+ }), P(e);
53
56
  },
54
57
  onSettled: () => {
55
- O.current = null, k.current = null, x(!1);
58
+ k.current = null, A.current = null, S(!1);
56
59
  }
57
60
  });
58
61
  }, [
59
62
  e,
60
63
  g,
61
- j,
62
- M
63
- ]), P = i(() => {
64
- if (!E) return;
65
- let e = p(E.redirectUrl);
66
- e && (C(""), N(E.connectionId, e, E.provider));
67
- }, [E, N]), F = i(() => {
68
- O.current?.(), O.current = null, k.current && !k.current.closed && k.current.close(), k.current = null, x(!1);
64
+ N,
65
+ P
66
+ ]), I = i(() => {
67
+ if (!D) return;
68
+ let e = p(D.redirectUrl);
69
+ e && (w(""), F(D.connectionId, e, D.provider, D.baseline));
70
+ }, [D, F]), L = i(() => {
71
+ k.current?.(), k.current = null, A.current && !A.current.closed && A.current.close(), A.current = null, S(!1);
69
72
  }, []);
70
73
  return {
71
74
  submit: i(async (r, i) => {
72
- if (v || b) return;
75
+ if (y || x) return;
73
76
  let a = n(r, f);
74
77
  if (a) {
75
- C(a);
78
+ w(a);
76
79
  return;
77
80
  }
78
81
  let { provider: o } = r;
79
- C(""), D(null), y(!0);
80
- let s = _ ? null : c(r), m = l(_, A.current, s);
82
+ w(""), O(null), b(!0);
83
+ let s = _ ? null : c(r), m = l(_, j.current, s);
81
84
  try {
82
- let n = await t(e, r, {
85
+ let n;
86
+ if (_) {
87
+ let e = M.current;
88
+ if (!e) throw Error(f("integrations.addConnection.reconnect.settingsUnavailable", "This connection's current settings could not be read. Close the dialog and try again."));
89
+ n = e;
90
+ }
91
+ let a = await t(e, r, {
83
92
  redirectUri: d,
84
93
  scopes: i,
85
94
  existing: m,
95
+ reconnectFrom: n,
96
+ onReconnectSaved: (e) => {
97
+ M.current = e;
98
+ },
86
99
  onCreated: (e) => {
87
- s !== null && (A.current = {
100
+ s !== null && (j.current = {
88
101
  inputKey: s,
89
102
  connection: e,
90
103
  announced: !1
91
104
  });
92
105
  }
93
106
  });
94
- if (u(n.connection.id, A.current, _) && (A.current?.connection.id === n.connection.id && (A.current.announced = !0), g?.({
107
+ if (u(a.connection.id, j.current, _) && (j.current?.connection.id === a.connection.id && (j.current.announced = !0), g?.({
95
108
  type: "connection-created",
96
- connectionId: n.connection.id,
109
+ connectionId: a.connection.id,
97
110
  providerKey: o.key
98
- })), n.kind === "done") {
99
- j({
100
- ...n.connection,
111
+ })), a.kind === "done") {
112
+ N({
113
+ ...a.connection,
101
114
  provider: o
102
115
  });
103
116
  return;
104
117
  }
105
- let a = p(n.redirectUrl);
106
- if (!a) {
107
- D({
108
- connectionId: n.connection.id,
109
- redirectUrl: n.redirectUrl,
110
- provider: o
111
- }), M(f("integrations.addConnection.authentication.popupBlocked", "Popup was blocked. Please allow popups for this site and try again.", { provider: o.name }));
118
+ let c = p(a.redirectUrl);
119
+ if (!c) {
120
+ O({
121
+ connectionId: a.connection.id,
122
+ redirectUrl: a.redirectUrl,
123
+ provider: o,
124
+ baseline: a.baseline
125
+ }), P(f("integrations.addConnection.authentication.popupBlocked", "Popup was blocked. Please allow popups for this site and try again.", { provider: o.name }));
112
126
  return;
113
127
  }
114
- N(n.connection.id, a, o);
128
+ F(a.connection.id, c, o, a.baseline);
115
129
  } catch (e) {
116
- M(e instanceof Error ? e.message : f("integrations.addConnection.errors.authFailed", "Authentication failed"));
130
+ P(e instanceof Error ? e.message : f("integrations.addConnection.errors.authFailed", "Authentication failed"));
117
131
  } finally {
118
- y(!1);
132
+ b(!1);
119
133
  }
120
134
  }, [
121
- v,
122
- b,
135
+ y,
136
+ x,
123
137
  f,
124
138
  e,
125
139
  d,
126
140
  g,
127
- j,
128
- M,
129
141
  N,
142
+ P,
143
+ F,
130
144
  _
131
145
  ]),
132
- busy: v || b,
133
- oauthWaiting: b,
134
- errorMessage: S,
135
- setErrorMessage: C,
136
- created: w,
137
- signInBlocked: E !== null,
138
- openBlockedSignIn: P,
139
- cancelSignIn: F
146
+ busy: y || x,
147
+ oauthWaiting: x,
148
+ errorMessage: C,
149
+ setErrorMessage: w,
150
+ created: T,
151
+ signInBlocked: D !== null,
152
+ openBlockedSignIn: I,
153
+ cancelSignIn: L
140
154
  };
141
155
  }
142
156
  export { c as createInputKey, l as reusableRecord, u as shouldAnnounce, m as useConnectionSubmit };
@@ -13,9 +13,9 @@ import { EMPTY_STORAGE as x, compatibleSecrets as S, defaultVault as C, withDefa
13
13
  import { POPULAR_PROVIDER_KEYS as T, groupByCategory as E, isPopularProvider as D, needsAdminSetup as O, pickableProviders as k, popularFirst as A } from "./connections/picker.js";
14
14
  import { ScopePicker as j } from "./connections/ScopePicker.js";
15
15
  import { createConnectionsApi as M, mapProvider as N, normalizeAuthType as P } from "./connections/api.js";
16
- import { buildCreateInput as F, collectsOwnClientId as I, flowForAuthType as L, resolveFlow as R, resolveMethod as z, resolveSchema as B, submitConnection as V, submittedValues as H, validateDraft as U } from "./connections/connectionFlow.js";
17
- import { isOAuthCallbackMessage as W, waitForOAuthCompletion as G } from "./connections/oauthPopup.js";
18
- import { getProviderAccent as K, getProviderIconName as q, getProviderImageSource as J, getProviderTextIcon as Y, normalizeProviderCategory as X } from "./connections/providerIdentity.js";
19
- import { isScopeChecked as Z, parseScopeOptions as Q, requestedScopes as $, toggleScope as ee } from "./connections/scopes.js";
20
- import { authTypeLabel as te, categoryLabel as ne } from "./connections/labels.js";
21
- export { t as CONNECTION_DIALOG_FRAME_CLASSES, y as CONNECT_MORE_OPTIONS_KEY, e as ConnectionDialog, v as CredentialStorageSelector, x as EMPTY_STORAGE, b as OneScreenConnectionForm, T as POPULAR_PROVIDER_KEYS, n as ProviderIcon, s as ResourceShareDialog, c as ResourceSharePanel, p as SHARE_PICKER_LIMIT, r as SHARE_TITLE_ID, j as ScopePicker, i as ShareConnectionDialog, f as VisibilityChoice, te as authTypeLabel, F as buildCreateInput, m as canManageSharing, ne as categoryLabel, I as collectsOwnClientId, S as compatibleSecrets, a as connectionShareCopy, o as connectionVisibilityCopy, h as createConnectionSharingApi, M as createConnectionsApi, g as createSharePrincipalLister, C as defaultVault, L as flowForAuthType, K as getProviderAccent, q as getProviderIconName, J as getProviderImageSource, Y as getProviderTextIcon, E as groupByCategory, W as isOAuthCallbackMessage, D as isPopularProvider, Z as isScopeChecked, _ as mapConnectionSharing, N as mapProvider, O as needsAdminSetup, P as normalizeAuthType, X as normalizeProviderCategory, Q as parseScopeOptions, k as pickableProviders, A as popularFirst, l as principalKey, $ as requestedScopes, R as resolveFlow, z as resolveMethod, B as resolveSchema, u as resourceShareInput, V as submitConnection, H as submittedValues, ee as toggleScope, d as useResourceSharingDraft, U as validateDraft, G as waitForOAuthCompletion, w as withDefaultVault };
16
+ import { applyReconnectUpdate as F, buildCreateInput as I, buildReconnectUpdate as L, collectsOwnClientId as R, flowForAuthType as z, isSecretField as B, reconnectEditsConfig as V, reconnectInitialValues as H, reconnectSchema as U, resolveFlow as W, resolveMethod as G, resolveSchema as K, submitConnection as q, submittedValues as J, validateDraft as Y } from "./connections/connectionFlow.js";
17
+ import { isOAuthCallbackMessage as X, waitForOAuthCompletion as Z } from "./connections/oauthPopup.js";
18
+ import { getProviderAccent as Q, getProviderIconName as $, getProviderImageSource as ee, getProviderTextIcon as te, normalizeProviderCategory as ne } from "./connections/providerIdentity.js";
19
+ import { isScopeChecked as re, parseScopeOptions as ie, requestedScopes as ae, toggleScope as oe } from "./connections/scopes.js";
20
+ import { authTypeLabel as se, categoryLabel as ce } from "./connections/labels.js";
21
+ export { t as CONNECTION_DIALOG_FRAME_CLASSES, y as CONNECT_MORE_OPTIONS_KEY, e as ConnectionDialog, v as CredentialStorageSelector, x as EMPTY_STORAGE, b as OneScreenConnectionForm, T as POPULAR_PROVIDER_KEYS, n as ProviderIcon, s as ResourceShareDialog, c as ResourceSharePanel, p as SHARE_PICKER_LIMIT, r as SHARE_TITLE_ID, j as ScopePicker, i as ShareConnectionDialog, f as VisibilityChoice, F as applyReconnectUpdate, se as authTypeLabel, I as buildCreateInput, L as buildReconnectUpdate, m as canManageSharing, ce as categoryLabel, R as collectsOwnClientId, S as compatibleSecrets, a as connectionShareCopy, o as connectionVisibilityCopy, h as createConnectionSharingApi, M as createConnectionsApi, g as createSharePrincipalLister, C as defaultVault, z as flowForAuthType, Q as getProviderAccent, $ as getProviderIconName, ee as getProviderImageSource, te as getProviderTextIcon, E as groupByCategory, X as isOAuthCallbackMessage, D as isPopularProvider, re as isScopeChecked, B as isSecretField, _ as mapConnectionSharing, N as mapProvider, O as needsAdminSetup, P as normalizeAuthType, ne as normalizeProviderCategory, ie as parseScopeOptions, k as pickableProviders, A as popularFirst, l as principalKey, V as reconnectEditsConfig, H as reconnectInitialValues, U as reconnectSchema, ae as requestedScopes, W as resolveFlow, G as resolveMethod, K as resolveSchema, u as resourceShareInput, q as submitConnection, J as submittedValues, oe as toggleScope, d as useResourceSharingDraft, Y as validateDraft, Z as waitForOAuthCompletion, w as withDefaultVault };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@burdenoff/fe-libs",
3
- "version": "2026.1119.8",
3
+ "version": "2026.1119.9",
4
4
  "description": "Burdenoff frontend primitives and domain libraries",
5
5
  "repository": {
6
6
  "type": "git",