@tesouro/embedded-components-react 0.2.324 → 0.2.325
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/README.md +20 -25
- package/dist/experimental/WidgetSuite.d.ts +5 -5
- package/dist/experimental/index.d.ts +5 -5
- package/dist/index.d.ts +21 -41
- package/dist/lib/AcceptDisclosuresWidget.d.ts +14 -34
- package/dist/lib/BalancesWidget.d.ts +5 -5
- package/dist/lib/BankAccountOnboardingWidget.d.ts +5 -5
- package/dist/lib/BankAccountsWidget.d.ts +5 -5
- package/dist/lib/BillPayWidget.d.ts +5 -5
- package/dist/lib/CardDetailsWidget.d.ts +5 -5
- package/dist/lib/CardsWidget.d.ts +5 -5
- package/dist/lib/ChartOfAccountsWidget.d.ts +5 -5
- package/dist/lib/CounterpartsWidget.d.ts +5 -5
- package/dist/lib/CreateCardWidget.d.ts +5 -5
- package/dist/lib/ExpenseApprovalPoliciesWidget.d.ts +5 -5
- package/dist/lib/ExpenseManagementWidget.d.ts +5 -5
- package/dist/lib/ExpenseRequirementsWidget.d.ts +5 -5
- package/dist/lib/HelpWidget.d.ts +5 -5
- package/dist/lib/InsightsWidget.d.ts +5 -5
- package/dist/lib/InvoicingWidget.d.ts +5 -5
- package/dist/lib/LinkedAccountsWidget.d.ts +5 -5
- package/dist/lib/ProductsWidget.d.ts +5 -5
- package/dist/lib/ProfileWidget.d.ts +5 -5
- package/dist/lib/ReceiptMatchWidget.d.ts +5 -5
- package/dist/lib/ReceivablesWidget.d.ts +5 -5
- package/dist/lib/SettingsWidget.d.ts +5 -5
- package/dist/lib/TagsWidget.d.ts +5 -5
- package/dist/lib/TeamWidget.d.ts +5 -5
- package/dist/lib/TransfersWidget.d.ts +5 -5
- package/dist/lib/WidgetProvider.d.ts +12 -12
- package/dist/lib/WidgetProviderPublic.d.ts +5 -5
- package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/feature/dist/index4.js +57 -68
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/disclosures/useDisclosuresQuery.js +2 -4
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/WidgetProvider.js +79 -80
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/isDisclosuresAcceptanceRequired.js +1 -4
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index3.js +1 -1
- package/package.json +1 -1
|
@@ -4,30 +4,30 @@
|
|
|
4
4
|
"use client";
|
|
5
5
|
import { registerQueryClient as e, unregisterQueryClient as t } from "../../../../data-access/dist/lib/clientRegistry.js";
|
|
6
6
|
import { createEmbeddedClient as n } from "../../../../data-access/dist/lib/createEmbeddedClient.js";
|
|
7
|
-
import { EmbedApiProvider as
|
|
7
|
+
import { EmbedApiProvider as ee, useEmbedApi as te } from "../../../../data-access/dist/lib/EmbedApiContext.js";
|
|
8
8
|
import "../../../../data-access/dist/index.js";
|
|
9
|
-
import { getGlobalSnapshot as
|
|
10
|
-
import { configureEmbeddedClient as
|
|
11
|
-
import { generateCorrelationId as
|
|
12
|
-
import { WidgetContext as
|
|
13
|
-
import { noop as
|
|
14
|
-
import { useWidgetFetch as
|
|
15
|
-
import { deriveWidgetInitState as
|
|
16
|
-
import { resolveUIFramework as
|
|
17
|
-
import { UIProvider as
|
|
18
|
-
import { useDesignSystemEnsurer as
|
|
19
|
-
import { HostIsolationScope as
|
|
20
|
-
import { ErrorState as
|
|
9
|
+
import { getGlobalSnapshot as ne, subscribeToGlobal as re } from "./globalStore.js";
|
|
10
|
+
import { configureEmbeddedClient as ie } from "../analytics/client.js";
|
|
11
|
+
import { generateCorrelationId as r } from "../analytics/ids.js";
|
|
12
|
+
import { WidgetContext as i } from "./WidgetContext.js";
|
|
13
|
+
import { noop as ae, resolveOrgId as oe, useAuthEpoch as se } from "./utils.js";
|
|
14
|
+
import { useWidgetFetch as ce } from "./useWidgetFetch.js";
|
|
15
|
+
import { deriveWidgetInitState as le, useWidgetInitPublisher as ue } from "./useWidgetInitPublisher.js";
|
|
16
|
+
import { resolveUIFramework as de } from "../../../../ui/dist/lib/UIContext/UIContext.js";
|
|
17
|
+
import { UIProvider as fe } from "../../../../ui/dist/lib/UIContext/UIProvider.js";
|
|
18
|
+
import { useDesignSystemEnsurer as pe, useFrameworkRenderer as me } from "../../../../ui/dist/lib/UIContext/uiRendererRegistry.js";
|
|
19
|
+
import { HostIsolationScope as he } from "../../../../ui/dist/lib/HostIsolationScope/HostIsolationScope.js";
|
|
20
|
+
import { ErrorState as a } from "../../../../ui/dist/lib/ErrorState/ErrorState.js";
|
|
21
21
|
import "../../../../ui/dist/index.js";
|
|
22
|
-
import { DEFAULT_LABELS as
|
|
23
|
-
import { WidgetErrorBoundary as
|
|
24
|
-
import { DISCLOSURES_REQUIRED_TEST_ID as
|
|
25
|
-
import { useContext as
|
|
22
|
+
import { DEFAULT_LABELS as o } from "./labels.js";
|
|
23
|
+
import { WidgetErrorBoundary as ge } from "./WidgetErrorBoundary.js";
|
|
24
|
+
import { DISCLOSURES_REQUIRED_TEST_ID as s, shouldGateOnDisclosuresAcceptance as _e } from "./isDisclosuresAcceptanceRequired.js";
|
|
25
|
+
import { useContext as ve, useEffect as c, useMemo as l, useRef as u, useState as d, useSyncExternalStore as ye } from "react";
|
|
26
26
|
import { jsx as f } from "react/jsx-runtime";
|
|
27
|
-
import { QueryClient as
|
|
27
|
+
import { QueryClient as be, QueryClientProvider as xe } from "@tanstack/react-query";
|
|
28
28
|
//#region ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/WidgetProvider.js
|
|
29
|
-
function p({ children:
|
|
30
|
-
let
|
|
29
|
+
function p({ children: me, baseUrl: a, widgetToken: o, organizationId: s, configClient: p, gatewayRouting: m, linkComponent: h, uiFramework: g, implementation: _, errorFallback: Ce, onError: we, analytics: v, disclosuresAcceptance: Te, widgetName: y }) {
|
|
30
|
+
let b = ve(i), Ee = ye(re, ne, ne), x = b?.resolved ?? Ee, De = b?.refetch ?? ae, Oe = b?.loading ?? !1, ke = b?.error ?? null, S = a ?? x.baseUrl, C = o === void 0 ? x.widgetToken : o, Ae = b ? b.cascadeOrgId : Ee.organizationId, w = s === void 0 ? Ae : s, T = p ?? x.configClient, E = m ?? x.gatewayRouting, D = h ?? x.linkComponent, O = g ?? x.uiFramework, k = _ ?? x.implementation, A = Te ?? b?.disclosuresAcceptance, j = b === null, M = j ? v !== !1 : b.analytics.enabled, [je] = d(r), N = j ? je : b.analytics.rootCorrelationId, [Me] = d(r), P = y === void 0 ? b?.analytics.widgetName : y, F = y === void 0 ? b?.analytics.widgetInstanceId : Me, I = u({
|
|
31
31
|
enabled: M,
|
|
32
32
|
organizationId: w,
|
|
33
33
|
rootCorrelationId: N,
|
|
@@ -35,8 +35,8 @@ function p({ children: he, baseUrl: i, widgetToken: a, organizationId: o, config
|
|
|
35
35
|
widgetInstanceId: F
|
|
36
36
|
}), Ne = u(!1);
|
|
37
37
|
c(() => {
|
|
38
|
-
j ||
|
|
39
|
-
}, [
|
|
38
|
+
j || v === void 0 || Ne.current || (Ne.current = !0, console.warn("[tesouro-embedded] `analytics` on a nested WidgetProvider is ignored in v1. Set it on the outermost RootWidgetProvider or standalone WidgetProvider instead."));
|
|
39
|
+
}, [v, j]), c(() => {
|
|
40
40
|
if (!j || !M || !("window" in globalThis)) return;
|
|
41
41
|
let e = !1;
|
|
42
42
|
return import("../analytics/install.js").then(({ ensureAnalyticsAdapterInstalled: t }) => {
|
|
@@ -45,41 +45,41 @@ function p({ children: he, baseUrl: i, widgetToken: a, organizationId: o, config
|
|
|
45
45
|
e = !0;
|
|
46
46
|
};
|
|
47
47
|
}, [j, M]);
|
|
48
|
-
let L =
|
|
48
|
+
let L = pe(de(O));
|
|
49
49
|
c(() => {
|
|
50
50
|
L && L().catch(() => {});
|
|
51
51
|
}, [L]);
|
|
52
|
-
let
|
|
53
|
-
|
|
54
|
-
let
|
|
55
|
-
if (!
|
|
56
|
-
let e =
|
|
57
|
-
tokenRef:
|
|
52
|
+
let Pe = b === null || a !== void 0 || o !== void 0 || s !== void 0 || p != null || m !== void 0 || y !== void 0, R = u(C);
|
|
53
|
+
R.current = C;
|
|
54
|
+
let Fe = te(), Ie = se(C), z = l(() => {
|
|
55
|
+
if (!Pe) return null;
|
|
56
|
+
let e = ie(n(S), {
|
|
57
|
+
tokenRef: R,
|
|
58
58
|
analyticsContextRef: I,
|
|
59
59
|
gatewayRouting: E
|
|
60
60
|
});
|
|
61
61
|
return T ? T(e) : e;
|
|
62
62
|
}, [
|
|
63
|
-
|
|
63
|
+
Pe,
|
|
64
64
|
S,
|
|
65
65
|
T,
|
|
66
66
|
E
|
|
67
|
-
]),
|
|
67
|
+
]), B = b === null || a !== void 0 || o !== void 0, Le = B ? Ie : Fe.authEpoch, { result: V, loading: H, error: U, clearedForAuthChange: Re, initStaleForToken: W, refetch: ze } = ce(B ? z : null, B ? C : void 0, I), G = B ? ze : De, K = B ? H : Oe, q = B ? U : ke, Be = b?.resolved.initResponse, J = !B || !Re && !U && !V && !!C && !H, Y = J ? Be : V ?? void 0, X = J ? B || (b?.initResponseStaleForToken ?? !1) : W, Ve = b === null, He = l(() => Ve ? le({
|
|
68
68
|
hasToken: !!C,
|
|
69
|
-
loading:
|
|
70
|
-
error:
|
|
71
|
-
initResponse:
|
|
72
|
-
initStaleForToken:
|
|
69
|
+
loading: H,
|
|
70
|
+
error: U,
|
|
71
|
+
initResponse: V ?? void 0,
|
|
72
|
+
initStaleForToken: W
|
|
73
73
|
}) : null, [
|
|
74
74
|
Ve,
|
|
75
75
|
C,
|
|
76
|
-
U,
|
|
77
|
-
W,
|
|
78
76
|
H,
|
|
79
|
-
|
|
77
|
+
U,
|
|
78
|
+
V,
|
|
79
|
+
W
|
|
80
80
|
]);
|
|
81
|
-
|
|
82
|
-
let Z =
|
|
81
|
+
ue(He, C);
|
|
82
|
+
let Z = oe(w, X ? void 0 : Y?.organizationId), Q = l(() => ({
|
|
83
83
|
enabled: M,
|
|
84
84
|
organizationId: Z,
|
|
85
85
|
rootCorrelationId: N,
|
|
@@ -93,7 +93,7 @@ function p({ children: he, baseUrl: i, widgetToken: a, organizationId: o, config
|
|
|
93
93
|
F
|
|
94
94
|
]);
|
|
95
95
|
I.current = Q;
|
|
96
|
-
let [$] = d(() =>
|
|
96
|
+
let [$] = d(() => b === null ? new be({ defaultOptions: {
|
|
97
97
|
queries: {
|
|
98
98
|
retry: !1,
|
|
99
99
|
refetchOnWindowFocus: !1
|
|
@@ -106,23 +106,23 @@ function p({ children: he, baseUrl: i, widgetToken: a, organizationId: o, config
|
|
|
106
106
|
return e(n), () => t(n);
|
|
107
107
|
}, [$]);
|
|
108
108
|
let Ue = l(() => ({
|
|
109
|
-
baseUrl:
|
|
110
|
-
widgetToken:
|
|
111
|
-
organizationId:
|
|
112
|
-
configClient:
|
|
113
|
-
gatewayRouting:
|
|
114
|
-
linkComponent:
|
|
115
|
-
uiFramework:
|
|
116
|
-
implementation:
|
|
109
|
+
baseUrl: a,
|
|
110
|
+
widgetToken: o,
|
|
111
|
+
organizationId: s,
|
|
112
|
+
configClient: p,
|
|
113
|
+
gatewayRouting: m,
|
|
114
|
+
linkComponent: h,
|
|
115
|
+
uiFramework: g,
|
|
116
|
+
implementation: _
|
|
117
117
|
}), [
|
|
118
|
-
i,
|
|
119
118
|
a,
|
|
120
119
|
o,
|
|
121
120
|
s,
|
|
122
121
|
p,
|
|
123
122
|
m,
|
|
124
123
|
h,
|
|
125
|
-
g
|
|
124
|
+
g,
|
|
125
|
+
_
|
|
126
126
|
]), We = l(() => ({
|
|
127
127
|
baseUrl: S,
|
|
128
128
|
widgetToken: C,
|
|
@@ -146,9 +146,9 @@ function p({ children: he, baseUrl: i, widgetToken: a, organizationId: o, config
|
|
|
146
146
|
]), Ge = l(() => ({
|
|
147
147
|
resolved: We,
|
|
148
148
|
own: Ue,
|
|
149
|
-
refetch:
|
|
150
|
-
loading:
|
|
151
|
-
error:
|
|
149
|
+
refetch: G,
|
|
150
|
+
loading: K,
|
|
151
|
+
error: q,
|
|
152
152
|
analytics: Q,
|
|
153
153
|
cascadeOrgId: w,
|
|
154
154
|
initResponseStaleForToken: X,
|
|
@@ -156,56 +156,55 @@ function p({ children: he, baseUrl: i, widgetToken: a, organizationId: o, config
|
|
|
156
156
|
}), [
|
|
157
157
|
We,
|
|
158
158
|
Ue,
|
|
159
|
+
G,
|
|
159
160
|
K,
|
|
160
161
|
q,
|
|
161
|
-
J,
|
|
162
162
|
Q,
|
|
163
163
|
w,
|
|
164
164
|
X,
|
|
165
165
|
A
|
|
166
|
-
]), Ke = /* @__PURE__ */ f(
|
|
166
|
+
]), Ke = /* @__PURE__ */ f(i.Provider, {
|
|
167
167
|
value: Ge,
|
|
168
|
-
children: /* @__PURE__ */ f(
|
|
168
|
+
children: /* @__PURE__ */ f(fe, {
|
|
169
169
|
linkComponent: D,
|
|
170
170
|
uiFramework: O,
|
|
171
|
-
children: /* @__PURE__ */ f(
|
|
171
|
+
children: /* @__PURE__ */ f(he, { children: /* @__PURE__ */ f(ge, {
|
|
172
172
|
resetKeys: [C],
|
|
173
|
-
errorFallback:
|
|
174
|
-
onError:
|
|
175
|
-
children:
|
|
176
|
-
init: Y,
|
|
173
|
+
errorFallback: Ce,
|
|
174
|
+
onError: we,
|
|
175
|
+
children: _e(Y, y) ? /* @__PURE__ */ f(Se, {
|
|
177
176
|
disclosuresAcceptance: A,
|
|
178
177
|
initStaleForToken: X
|
|
179
|
-
}) :
|
|
178
|
+
}) : me
|
|
180
179
|
}) })
|
|
181
180
|
})
|
|
182
|
-
}), qe =
|
|
183
|
-
client:
|
|
181
|
+
}), qe = z ? /* @__PURE__ */ f(ee, {
|
|
182
|
+
client: z,
|
|
184
183
|
organizationId: Z,
|
|
185
184
|
widgetToken: C,
|
|
186
|
-
authEpoch:
|
|
185
|
+
authEpoch: Le,
|
|
187
186
|
children: Ke
|
|
188
187
|
}) : Ke;
|
|
189
|
-
return $ ? /* @__PURE__ */ f(
|
|
188
|
+
return $ ? /* @__PURE__ */ f(xe, {
|
|
190
189
|
client: $,
|
|
191
190
|
children: qe
|
|
192
191
|
}) : qe;
|
|
193
192
|
}
|
|
194
|
-
function
|
|
195
|
-
let
|
|
196
|
-
return
|
|
197
|
-
title:
|
|
198
|
-
description:
|
|
199
|
-
testId:
|
|
193
|
+
function Se({ disclosuresAcceptance: e, initStaleForToken: t }) {
|
|
194
|
+
let n = me("error-state") ?? a;
|
|
195
|
+
return t ? /* @__PURE__ */ f(n, {
|
|
196
|
+
title: o.disclosuresRefreshingTitle,
|
|
197
|
+
description: o.disclosuresRefreshingDescription,
|
|
198
|
+
testId: s,
|
|
200
199
|
className: "ttw:w-full ttw:rounded-xl ttw:border ttw:border-border ttw:bg-card ttw:py-7 ttw:text-card-foreground ttw:shadow-sm"
|
|
201
|
-
}) :
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
children: t
|
|
205
|
-
}) : /* @__PURE__ */ f(r, {
|
|
206
|
-
title: a.disclosuresRequiredTitle,
|
|
207
|
-
testId: o,
|
|
200
|
+
}) : e == null ? /* @__PURE__ */ f(n, {
|
|
201
|
+
title: o.disclosuresRequiredTitle,
|
|
202
|
+
testId: s,
|
|
208
203
|
className: "ttw:w-full ttw:rounded-xl ttw:border ttw:border-border ttw:bg-card ttw:py-7 ttw:text-card-foreground ttw:shadow-sm"
|
|
204
|
+
}) : /* @__PURE__ */ f("div", {
|
|
205
|
+
"data-testid": s,
|
|
206
|
+
className: "ttw:w-full",
|
|
207
|
+
children: e
|
|
209
208
|
});
|
|
210
209
|
}
|
|
211
210
|
//#endregion
|
|
@@ -13,8 +13,5 @@ function r(e) {
|
|
|
13
13
|
function i(e, t) {
|
|
14
14
|
return t !== void 0 && n(e) && !r(t);
|
|
15
15
|
}
|
|
16
|
-
function a(e) {
|
|
17
|
-
return n(e) && e?.status === "ACTIVE";
|
|
18
|
-
}
|
|
19
16
|
//#endregion
|
|
20
|
-
export { e as DISCLOSURES_REQUIRED_TEST_ID,
|
|
17
|
+
export { e as DISCLOSURES_REQUIRED_TEST_ID, n as isDisclosuresAcceptanceRequired, r as isDisclosuresGateExempt, i as shouldGateOnDisclosuresAcceptance };
|
package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
|
|
2
|
-
var e = "@tesouro/embedded-components-react", t = "0.2.
|
|
2
|
+
var e = "@tesouro/embedded-components-react", t = "0.2.325", n = "cb1d36c4ebe94147e9bbf06c18f5f5b1c3b5965a", r = Object.freeze({
|
|
3
3
|
library_name: e,
|
|
4
4
|
library_version: t,
|
|
5
5
|
library_sha: n
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//#region ../../libs/tesouro-embedded-components-react/widget-suite/feature/dist/index3.js
|
|
2
2
|
function e(e) {
|
|
3
|
-
return e ? e.disclosuresRequired === "REQUIRED" && !e.disclosuresAccepted : !1;
|
|
3
|
+
return e ? e.status === "INVITED" || e.disclosuresRequired === "REQUIRED" && !e.disclosuresAccepted : !1;
|
|
4
4
|
}
|
|
5
5
|
//#endregion
|
|
6
6
|
export { e as needsDisclosureAcceptance };
|