@tesouro/embedded-components-react 0.5.78 → 0.5.80
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 +9 -8
- package/dist/index.css +3 -0
- package/dist/index.d.ts +2924 -2873
- package/dist/index.js +8 -8
- package/dist/lib/WidgetSuite.d.ts +464 -18
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/useOrganizationOnboardingSuppression.js +4 -1
- 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/index16.js +104 -63
- package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index4.js +5 -0
- package/package.json +1 -1
|
@@ -8,94 +8,135 @@ import "../../ui/dist/index.js";
|
|
|
8
8
|
import { resolveWidgetSuiteLabels as n } from "./index4.js";
|
|
9
9
|
import { WIDGET_SUITE_DEFAULT_SECTIONS as r, WidgetSuiteSectionId as i } from "./index5.js";
|
|
10
10
|
import { WidgetSuiteProvider as a, useWidgetSuiteProvider as o } from "./index6.js";
|
|
11
|
-
import {
|
|
11
|
+
import { useEmbedApi as s } from "../../../shared/data-access/dist/lib/EmbedApiContext.js";
|
|
12
|
+
import { hasAnyScope as c } from "../../../shared/data-access/dist/lib/hasAnyScope.js";
|
|
13
|
+
import { OnboardingSuppressionReason as l } from "../../../shared/data-access/dist/lib/onboardingSuppressionReason.js";
|
|
14
|
+
import { useOrganizationOnboardingSuppression as u } from "../../../shared/data-access/dist/lib/useOrganizationOnboardingSuppression.js";
|
|
12
15
|
import "../../../shared/data-access/dist/index.js";
|
|
13
|
-
import { ErrorState as
|
|
16
|
+
import { ErrorState as d } from "../../../shared/ui/dist/lib/ErrorState/ErrorState.js";
|
|
14
17
|
import "../../../shared/ui/dist/index.js";
|
|
15
|
-
import { useAnalyticsTrack as
|
|
16
|
-
import { WidgetProvider as
|
|
17
|
-
import { useRefetchWidget as
|
|
18
|
+
import { useAnalyticsTrack as f } from "../../../shared/feature/dist/lib/analytics/hooks.js";
|
|
19
|
+
import { WidgetProvider as p } from "../../../shared/feature/dist/lib/WidgetProvider/WidgetProvider.js";
|
|
20
|
+
import { useRefetchWidget as m, useWidgetConfig as h, useWidgetError as g, useWidgetInitStaleForToken as _, useWidgetLoading as v } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
18
21
|
import "../../../shared/feature/dist/index.js";
|
|
19
|
-
import { WIDGET_SUITE_SECTIONS as
|
|
20
|
-
import { WIDGET_NAME as
|
|
21
|
-
import { needsDisclosureAcceptance as
|
|
22
|
-
import { AcceptDisclosuresWidget as
|
|
22
|
+
import { WIDGET_SUITE_SECTIONS as y } from "./index15.js";
|
|
23
|
+
import { WIDGET_NAME as b, WidgetSuiteAnalyticsEvent as x } from "./index2.js";
|
|
24
|
+
import { needsDisclosureAcceptance as S } from "./index3.js";
|
|
25
|
+
import { AcceptDisclosuresWidget as C } from "../../../accept-disclosures-widget/feature/dist/index5.js";
|
|
23
26
|
import "../../../accept-disclosures-widget/feature/dist/index.js";
|
|
24
|
-
import {
|
|
25
|
-
import
|
|
27
|
+
import { BankAccountOnboardingWidget as w } from "../../../bank-account-onboarding-widget/feature/dist/index22.js";
|
|
28
|
+
import "../../../bank-account-onboarding-widget/feature/dist/index.js";
|
|
29
|
+
import { useCallback as T, useEffect as E, useMemo as D, useRef as O, useState as k } from "react";
|
|
30
|
+
import { Fragment as A, jsx as j, jsxs as M } from "react/jsx-runtime";
|
|
26
31
|
//#region ../../libs/tesouro-embedded-components-react/widget-suite/feature/dist/index16.js
|
|
27
|
-
var
|
|
32
|
+
var N = {
|
|
28
33
|
initFailed: "widget-suite-init-failed",
|
|
29
|
-
disclosuresRefreshFailed: "widget-suite-disclosures-refresh-failed"
|
|
34
|
+
disclosuresRefreshFailed: "widget-suite-disclosures-refresh-failed",
|
|
35
|
+
applicationInFlight: "widget-suite-application-in-flight"
|
|
30
36
|
};
|
|
31
|
-
function
|
|
32
|
-
let { availableSections:
|
|
33
|
-
|
|
34
|
-
!
|
|
35
|
-
}, [
|
|
36
|
-
|
|
37
|
-
|
|
37
|
+
function P({ showSectionTitle: n = !0, onboardingDisclosureLinks: r }) {
|
|
38
|
+
let { availableSections: a, activeSection: s, labels: c, navigate: f } = o(), { initResponse: p } = h(), b = g(), x = _(), D = v(), P = m(), F = u(), [I, L] = k(!1), R = F.isResolved || I, z = T((e) => f(e), [f]), [B, V] = k(!1), ee = T(() => V(!0), []), [te, ne] = k(!1), H = S(p), U = c.disclosure, W = c.onboardingGate, G = p?.status === "INVITED", K = p?.status === "ACTIVE" || p?.status === "INACTIVE", q = !!(p && x), J = q && (G || K), Y = !p && !b || J && !b, X = !!p && !Y && !q && !G && !K && R && F.reason === l.OrganizationApplicationComplete && !te, Z = O(!1), [re, Q] = k(!1);
|
|
39
|
+
E(() => {
|
|
40
|
+
!H && B && V(!1);
|
|
41
|
+
}, [B, H]), E(() => {
|
|
42
|
+
F.isResolved && !I && L(!0);
|
|
43
|
+
}, [F.isResolved, I]), E(() => {
|
|
44
|
+
X ? Z.current || (Z.current = !0, Q(!0), P()) : (Z.current = !1, Q(!1));
|
|
45
|
+
}, [X, P]);
|
|
46
|
+
let $ = () => /* @__PURE__ */ j(e, {
|
|
38
47
|
isLoading: !0,
|
|
39
48
|
sections: [],
|
|
40
49
|
selectedSectionId: "",
|
|
41
|
-
onSectionChange:
|
|
42
|
-
labels:
|
|
50
|
+
onSectionChange: z,
|
|
51
|
+
labels: c.shell
|
|
43
52
|
});
|
|
44
|
-
if (
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
53
|
+
if (Y) return $();
|
|
54
|
+
if ((!p || J) && b) return /* @__PURE__ */ j(d, {
|
|
55
|
+
title: U.initFailedState.title,
|
|
56
|
+
description: U.initFailedState.body,
|
|
57
|
+
retryLabel: U.initFailedState.retryButton,
|
|
58
|
+
onRetry: P,
|
|
59
|
+
testId: N.initFailed
|
|
50
60
|
});
|
|
51
|
-
|
|
52
|
-
title:
|
|
53
|
-
description:
|
|
54
|
-
retryLabel:
|
|
55
|
-
onRetry:
|
|
56
|
-
testId:
|
|
57
|
-
}) : /* @__PURE__ */
|
|
58
|
-
|
|
59
|
-
|
|
61
|
+
let ie = () => B && b ? /* @__PURE__ */ j(d, {
|
|
62
|
+
title: U.refreshFailedState.title,
|
|
63
|
+
description: U.refreshFailedState.body,
|
|
64
|
+
retryLabel: U.refreshFailedState.retryButton,
|
|
65
|
+
onRetry: P,
|
|
66
|
+
testId: N.disclosuresRefreshFailed
|
|
67
|
+
}) : /* @__PURE__ */ j(C, { onAccepted: ee });
|
|
68
|
+
if (G || K) {
|
|
69
|
+
if (H) return ie();
|
|
70
|
+
} else return R ? F.reason === l.OrganizationApplicationStartedByOther ? /* @__PURE__ */ j(d, {
|
|
71
|
+
title: W.applicationInFlightState.title,
|
|
72
|
+
description: W.applicationInFlightState.body,
|
|
73
|
+
retryLabel: W.applicationInFlightState.retryButton,
|
|
74
|
+
onRetry: F.refetch,
|
|
75
|
+
testId: N.applicationInFlight
|
|
76
|
+
}) : X ? b || re && !D ? /* @__PURE__ */ j(d, {
|
|
77
|
+
title: U.initFailedState.title,
|
|
78
|
+
description: U.initFailedState.body,
|
|
79
|
+
retryLabel: U.initFailedState.retryButton,
|
|
80
|
+
onRetry: P,
|
|
81
|
+
testId: N.initFailed
|
|
82
|
+
}) : $() : /* @__PURE__ */ j(w, {
|
|
83
|
+
isFullScreenInline: !0,
|
|
84
|
+
onEmbeddedOnboardingCompletedSuccessfully: () => ne(!0),
|
|
85
|
+
onNavigateToDashboard: () => {
|
|
86
|
+
a.includes(i.Dashboard) && f(i.Dashboard), P();
|
|
87
|
+
},
|
|
88
|
+
disclosureLinks: r,
|
|
89
|
+
...c.onboarding
|
|
90
|
+
}) : $();
|
|
91
|
+
let ae = p?.bankName?.trim(), oe = ae ? c.sectionTitle.bankTagline.replaceAll("{bankName}", ae) : void 0, se = a.map((e) => {
|
|
92
|
+
let { Content: r } = y[e], a = c.menu[e], o = e === i.Accounts ? void 0 : oe;
|
|
60
93
|
return {
|
|
61
94
|
id: e,
|
|
62
95
|
label: a,
|
|
63
|
-
content: n ? /* @__PURE__ */
|
|
96
|
+
content: n ? /* @__PURE__ */ M(A, { children: [/* @__PURE__ */ j(t, {
|
|
64
97
|
title: a,
|
|
65
98
|
bankTagline: o
|
|
66
|
-
}), /* @__PURE__ */
|
|
99
|
+
}), /* @__PURE__ */ j(r, {})] }) : /* @__PURE__ */ j(r, {})
|
|
67
100
|
};
|
|
68
101
|
});
|
|
69
|
-
return /* @__PURE__ */
|
|
70
|
-
sections:
|
|
71
|
-
selectedSectionId:
|
|
72
|
-
onSectionChange:
|
|
73
|
-
labels:
|
|
102
|
+
return /* @__PURE__ */ j(e, {
|
|
103
|
+
sections: se,
|
|
104
|
+
selectedSectionId: s ?? "",
|
|
105
|
+
onSectionChange: z,
|
|
106
|
+
labels: c.shell
|
|
74
107
|
});
|
|
75
108
|
}
|
|
76
|
-
function
|
|
77
|
-
let d =
|
|
78
|
-
|
|
79
|
-
d(
|
|
109
|
+
function F({ sections: e = r, section: t, defaultSection: i, onSectionChange: o, labels: l, ...u }) {
|
|
110
|
+
let d = f();
|
|
111
|
+
E(() => {
|
|
112
|
+
d(x.Mounted);
|
|
80
113
|
}, [d]);
|
|
81
|
-
let { initResponse: p } =
|
|
82
|
-
|
|
83
|
-
|
|
114
|
+
let { initResponse: p } = h(), m = p?.scopes, { client: g, widgetToken: _ } = s(), v = p?.userId ?? null, [b, S] = k(v), [C, w] = k(0);
|
|
115
|
+
v !== b && (S(v), b !== null && w((e) => e + 1));
|
|
116
|
+
let [T, O] = k(g);
|
|
117
|
+
g !== T && (O(g), w((e) => e + 1));
|
|
118
|
+
let A = !!_, [M, N] = k(A);
|
|
119
|
+
A !== M && (N(A), w((e) => e + 1));
|
|
120
|
+
let F = p?.organizationId ?? null, [I, L] = k(F);
|
|
121
|
+
F !== I && (L(F), I !== null && w((e) => e + 1));
|
|
122
|
+
let R = D(() => n(l), [l]), z = e.filter((e) => {
|
|
123
|
+
let t = y[e];
|
|
124
|
+
return !!t && (!t.anyOfScopes || c(m, t.anyOfScopes));
|
|
84
125
|
});
|
|
85
|
-
return /* @__PURE__ */
|
|
126
|
+
return /* @__PURE__ */ j(a, {
|
|
86
127
|
sections: e,
|
|
87
|
-
availableSections:
|
|
128
|
+
availableSections: z,
|
|
88
129
|
grantedScopes: m,
|
|
89
|
-
labels:
|
|
130
|
+
labels: R,
|
|
90
131
|
section: t,
|
|
91
132
|
defaultSection: i,
|
|
92
133
|
onSectionChange: o,
|
|
93
|
-
children: /* @__PURE__ */
|
|
134
|
+
children: /* @__PURE__ */ j(P, { ...u }, C)
|
|
94
135
|
});
|
|
95
136
|
}
|
|
96
|
-
function
|
|
97
|
-
return /* @__PURE__ */
|
|
98
|
-
widgetName:
|
|
137
|
+
function I({ baseUrl: e, widgetToken: t, organizationId: n, configClient: r, gatewayRouting: i, linkComponent: a, implementation: o, uiFramework: s, errorFallback: c, onError: l, analytics: u, disclosuresAcceptance: d, providerLabels: f, ...m }) {
|
|
138
|
+
return /* @__PURE__ */ j(p, {
|
|
139
|
+
widgetName: b,
|
|
99
140
|
baseUrl: e,
|
|
100
141
|
widgetToken: t,
|
|
101
142
|
organizationId: n,
|
|
@@ -106,11 +147,11 @@ function A({ baseUrl: e, widgetToken: t, organizationId: n, configClient: r, gat
|
|
|
106
147
|
uiFramework: s,
|
|
107
148
|
errorFallback: c,
|
|
108
149
|
onError: l,
|
|
109
|
-
analytics:
|
|
110
|
-
disclosuresAcceptance:
|
|
111
|
-
providerLabels:
|
|
112
|
-
children: /* @__PURE__ */
|
|
150
|
+
analytics: u,
|
|
151
|
+
disclosuresAcceptance: d,
|
|
152
|
+
providerLabels: f,
|
|
153
|
+
children: /* @__PURE__ */ j(F, { ...m })
|
|
113
154
|
});
|
|
114
155
|
}
|
|
115
156
|
//#endregion
|
|
116
|
-
export {
|
|
157
|
+
export { N as WIDGET_SUITE_TEST_IDS, I as WidgetSuite, I as default };
|
|
@@ -26,6 +26,11 @@ var t = {
|
|
|
26
26
|
retryButton: "Try again"
|
|
27
27
|
}
|
|
28
28
|
},
|
|
29
|
+
onboardingGate: { applicationInFlightState: {
|
|
30
|
+
title: "Application in progress",
|
|
31
|
+
body: "Your organization's account application is already being set up by a teammate. Contact your organization admin for details.",
|
|
32
|
+
retryButton: "Check again"
|
|
33
|
+
} },
|
|
29
34
|
sections: {
|
|
30
35
|
dashboard: {},
|
|
31
36
|
cards: {
|