@tesouro/embedded-components-react 0.2.280 → 0.2.282
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 +17 -14
- package/dist/experimental/WidgetSuite.d.ts +9 -1
- package/dist/experimental/index.d.ts +9 -1
- package/dist/index.css +20 -6
- package/dist/index.d.ts +46 -23
- package/dist/index.js +54 -53
- package/dist/lib/AcceptDisclosuresWidget.d.ts +9 -1
- package/dist/lib/BalancesWidget.d.ts +8 -0
- package/dist/lib/BankAccountOnboardingWidget.d.ts +9 -1
- package/dist/lib/BankAccountsWidget.d.ts +9 -1
- package/dist/lib/BillPayWidget.d.ts +8 -0
- package/dist/lib/BillPayWidget.js +1 -1
- package/dist/lib/CardDetailsWidget.d.ts +9 -1
- package/dist/lib/CardsWidget.d.ts +9 -1
- package/dist/lib/ChartOfAccountsWidget.d.ts +9 -1
- package/dist/lib/CounterpartsWidget.d.ts +9 -1
- package/dist/lib/CreateCardWidget.d.ts +9 -1
- package/dist/lib/ExpenseApprovalPoliciesWidget.d.ts +9 -1
- package/dist/lib/ExpenseManagementWidget.d.ts +9 -1
- package/dist/lib/ExpenseRequirementsWidget.d.ts +9 -1
- package/dist/lib/HelpWidget.d.ts +9 -1
- package/dist/lib/InsightsWidget.d.ts +8 -0
- package/dist/lib/InvoicingWidget.d.ts +9 -1
- package/dist/lib/LinkedAccountsWidget.d.ts +9 -1
- package/dist/lib/ProductsWidget.d.ts +9 -1
- package/dist/lib/ProfileWidget.d.ts +9 -1
- package/dist/lib/ReceiptMatchWidget.d.ts +9 -1
- package/dist/lib/ReceivablesWidget.d.ts +9 -1
- package/dist/lib/SettingsWidget.d.ts +9 -1
- package/dist/lib/TagsWidget.d.ts +9 -1
- package/dist/lib/TeamWidget.d.ts +9 -1
- package/dist/lib/TransfersWidget.d.ts +8 -0
- package/dist/lib/WidgetProvider.d.ts +25 -2
- package/dist/lib/WidgetProvider.js +8 -7
- package/dist/lib/WidgetProviderPublic.d.ts +8 -0
- package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/feature/dist/index4.js +3 -2
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index17.js +54 -53
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/index8.js +3 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js +9 -5
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index10.js +42 -39
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index12.js +69 -54
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index14.js +21 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index15.js +46 -40
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index16.js +81 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index17.js +46 -47
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index18.js +3 -11
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index19.js +2 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index2.js +5 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index20.js +43 -5
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index21.js +1 -102
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index22.js +11 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index23.js +9 -6
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index24.js +4 -5
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index25.js +127 -76
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index27.js +6 -6
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index28.js +7 -111
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index29.js +85 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index3.js +16 -12
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index30.js +2 -24
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index31.js +8 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index32.js +114 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index33.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index34.js +25 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index5.js +50 -49
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index6.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index7.js +25 -12
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index8.js +86 -69
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index9.js +2 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index.js +7 -7
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index13.js +17 -16
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index16.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index21.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index22.js +89 -124
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index24.js +2 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index25.js +31 -26
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index27.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index28.js +80 -77
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index36.js +20 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index37.js +228 -6
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index6.js +3 -2
- package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index8.js +3 -2
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/index8.js +3 -2
- package/dist/libs/tesouro-embedded-components-react/create-card-widget/feature/dist/index7.js +30 -29
- package/dist/libs/tesouro-embedded-components-react/expense-approval-policies-widget/feature/dist/lib/ExpenseApprovalPoliciesWidgetFeature.js +2 -1
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index3.js +3 -2
- package/dist/libs/tesouro-embedded-components-react/expense-receipt-match-widget/feature/dist/lib/ReceiptMatchWidget.js +7 -6
- package/dist/libs/tesouro-embedded-components-react/expense-requirements-widget/feature/dist/lib/ExpenseRequirementsWidget.js +2 -1
- package/dist/libs/tesouro-embedded-components-react/gl-code-table-widget/feature/dist/index8.js +5 -4
- package/dist/libs/tesouro-embedded-components-react/help-widget/feature/dist/index3.js +3 -2
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index12.js +3 -2
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index3.js +5 -4
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/index9.js +3 -2
- package/dist/libs/tesouro-embedded-components-react/products-widget/feature/dist/index8.js +3 -2
- package/dist/libs/tesouro-embedded-components-react/profile-widget/feature/dist/index4.js +3 -2
- package/dist/libs/tesouro-embedded-components-react/settings-widget/feature/dist/index6.js +3 -2
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +6 -6
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/reference-data/useLedgerAccountsQuery.js +53 -11
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/index.js +5 -5
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/RootWidgetProvider.js +69 -67
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/WidgetProvider.js +158 -132
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/hooks.js +7 -4
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/isDisclosuresAcceptanceRequired.js +20 -0
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/labels.js +6 -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/shared/ui/dist/index.js +9 -9
- package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/ErrorState/ErrorState.js +19 -18
- package/dist/libs/tesouro-embedded-components-react/tags-widget/feature/dist/index11.js +3 -2
- package/dist/libs/tesouro-embedded-components-react/team-widget/feature/dist/index17.js +3 -2
- package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index5.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index6.js +3 -2
- package/dist/packages/shared-ui-shadcn/dist/index.js +3445 -3413
- package/package.json +1 -1
|
@@ -3,88 +3,88 @@
|
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
5
|
import { registerQueryClient as e, unregisterQueryClient as t } from "../../../../data-access/dist/lib/clientRegistry.js";
|
|
6
|
-
import { createEmbeddedClient as
|
|
7
|
-
import { EmbedApiProvider as
|
|
6
|
+
import { createEmbeddedClient as ee } from "../../../../data-access/dist/lib/createEmbeddedClient.js";
|
|
7
|
+
import { EmbedApiProvider as n } 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
|
|
9
|
+
import { getGlobalSnapshot as r, subscribeToGlobal as i } from "./globalStore.js";
|
|
10
|
+
import { configureEmbeddedClient as te } from "../analytics/client.js";
|
|
11
|
+
import { generateCorrelationId as a } from "../analytics/ids.js";
|
|
12
12
|
import { WidgetContext as ne } from "./WidgetContext.js";
|
|
13
13
|
import { resolveOrgId as re, useAuthEpoch as ie } from "./utils.js";
|
|
14
14
|
import { useWidgetFetch as ae } from "./useWidgetFetch.js";
|
|
15
|
-
import { deriveWidgetInitState as oe, useWidgetInitPublisher as
|
|
16
|
-
import { resolveUIFramework as
|
|
15
|
+
import { deriveWidgetInitState as oe, useWidgetInitPublisher as se } from "./useWidgetInitPublisher.js";
|
|
16
|
+
import { resolveUIFramework as o } from "../../../../ui/dist/lib/UIContext/UIContext.js";
|
|
17
17
|
import { UIProvider as s } from "../../../../ui/dist/lib/UIContext/UIProvider.js";
|
|
18
18
|
import { useDesignSystemEnsurer as c } from "../../../../ui/dist/lib/UIContext/uiRendererRegistry.js";
|
|
19
19
|
import "../../../../ui/dist/index.js";
|
|
20
|
-
import { useEffect as l, useMemo as u, useRef as d, useState as f, useSyncExternalStore as
|
|
21
|
-
import { jsx as
|
|
22
|
-
import { QueryClient as
|
|
20
|
+
import { useEffect as l, useMemo as u, useRef as d, useState as f, useSyncExternalStore as p } from "react";
|
|
21
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
22
|
+
import { QueryClient as h, QueryClientProvider as ce } from "@tanstack/react-query";
|
|
23
23
|
//#region ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/RootWidgetProvider.js
|
|
24
|
-
function g({ children: g, baseUrl: _, widgetToken: v, organizationId: y, configClient: b, gatewayRouting: x, linkComponent: S, uiFramework: C, implementation: w, analytics: T, unstable_initResponseOverride: E }) {
|
|
25
|
-
let
|
|
26
|
-
enabled:
|
|
27
|
-
organizationId:
|
|
28
|
-
rootCorrelationId:
|
|
29
|
-
}), [
|
|
24
|
+
function g({ children: g, baseUrl: _, widgetToken: v, organizationId: y, configClient: b, gatewayRouting: x, linkComponent: S, uiFramework: C, implementation: w, analytics: T, unstable_initResponseOverride: E, disclosuresAcceptance: D }) {
|
|
25
|
+
let O = p(i, r, r), k = _ ?? O.baseUrl, A = v === void 0 ? O.widgetToken : v, j = y === void 0 ? O.organizationId : y, M = b ?? O.configClient, N = x ?? O.gatewayRouting, P = S ?? O.linkComponent, F = C ?? O.uiFramework, I = w ?? O.implementation, L = T !== !1, [R] = f(a), z = d({
|
|
26
|
+
enabled: L,
|
|
27
|
+
organizationId: j,
|
|
28
|
+
rootCorrelationId: R
|
|
29
|
+
}), [B] = f(() => new h({ defaultOptions: {
|
|
30
30
|
queries: {
|
|
31
31
|
retry: !1,
|
|
32
32
|
refetchOnWindowFocus: !1
|
|
33
33
|
},
|
|
34
34
|
mutations: { retry: !1 }
|
|
35
35
|
} }));
|
|
36
|
-
l(() => (e(
|
|
37
|
-
let
|
|
38
|
-
|
|
39
|
-
let
|
|
40
|
-
let e = ee(
|
|
41
|
-
tokenRef:
|
|
42
|
-
analyticsContextRef:
|
|
43
|
-
gatewayRouting:
|
|
36
|
+
l(() => (e(B), () => t(B)), [B]);
|
|
37
|
+
let V = d(A);
|
|
38
|
+
V.current = A;
|
|
39
|
+
let H = ie(A), U = u(() => {
|
|
40
|
+
let e = te(ee(k), {
|
|
41
|
+
tokenRef: V,
|
|
42
|
+
analyticsContextRef: z,
|
|
43
|
+
gatewayRouting: N
|
|
44
44
|
});
|
|
45
|
-
return
|
|
45
|
+
return M ? M(e) : e;
|
|
46
46
|
}, [
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
k,
|
|
48
|
+
M,
|
|
49
|
+
N
|
|
50
50
|
]);
|
|
51
51
|
l(() => {
|
|
52
|
-
if (!
|
|
52
|
+
if (!L || !("window" in globalThis)) return;
|
|
53
53
|
let e = !1;
|
|
54
54
|
return import("../analytics/install.js").then(({ ensureAnalyticsAdapterInstalled: t }) => {
|
|
55
55
|
e || t();
|
|
56
56
|
}), () => {
|
|
57
57
|
e = !0;
|
|
58
58
|
};
|
|
59
|
-
}, [
|
|
60
|
-
let
|
|
59
|
+
}, [L]);
|
|
60
|
+
let W = c(o(F));
|
|
61
61
|
l(() => {
|
|
62
|
-
|
|
63
|
-
}, [
|
|
64
|
-
let { result:
|
|
65
|
-
hasToken: !!
|
|
62
|
+
W && W().catch(() => {});
|
|
63
|
+
}, [W]);
|
|
64
|
+
let { result: le, loading: G, error: K, initStaleForToken: ue, refetch: q } = ae(E ? null : U, A, z), J = A ? E ?? le ?? void 0 : void 0, Y = !E && ue, X = re(j, Y ? void 0 : J?.organizationId), de = u(() => oe({
|
|
65
|
+
hasToken: !!A,
|
|
66
66
|
loading: G,
|
|
67
67
|
error: K,
|
|
68
68
|
initResponse: J,
|
|
69
69
|
initStaleForToken: Y
|
|
70
70
|
}), [
|
|
71
|
-
|
|
71
|
+
A,
|
|
72
72
|
G,
|
|
73
73
|
K,
|
|
74
74
|
J,
|
|
75
75
|
Y
|
|
76
76
|
]);
|
|
77
|
-
|
|
77
|
+
se(de, A);
|
|
78
78
|
let Z = u(() => ({
|
|
79
|
-
enabled:
|
|
79
|
+
enabled: L,
|
|
80
80
|
organizationId: X,
|
|
81
|
-
rootCorrelationId:
|
|
81
|
+
rootCorrelationId: R
|
|
82
82
|
}), [
|
|
83
|
-
|
|
83
|
+
L,
|
|
84
84
|
X,
|
|
85
|
-
|
|
85
|
+
R
|
|
86
86
|
]);
|
|
87
|
-
|
|
87
|
+
z.current = Z;
|
|
88
88
|
let Q = u(() => ({
|
|
89
89
|
baseUrl: _,
|
|
90
90
|
widgetToken: v,
|
|
@@ -104,34 +104,35 @@ function g({ children: g, baseUrl: _, widgetToken: v, organizationId: y, configC
|
|
|
104
104
|
C,
|
|
105
105
|
w
|
|
106
106
|
]), $ = u(() => ({
|
|
107
|
-
baseUrl:
|
|
108
|
-
widgetToken:
|
|
107
|
+
baseUrl: k,
|
|
108
|
+
widgetToken: A,
|
|
109
109
|
organizationId: X,
|
|
110
|
-
configClient:
|
|
111
|
-
gatewayRouting:
|
|
112
|
-
linkComponent:
|
|
113
|
-
uiFramework:
|
|
114
|
-
implementation:
|
|
110
|
+
configClient: M,
|
|
111
|
+
gatewayRouting: N,
|
|
112
|
+
linkComponent: P,
|
|
113
|
+
uiFramework: F,
|
|
114
|
+
implementation: I,
|
|
115
115
|
initResponse: J
|
|
116
116
|
}), [
|
|
117
|
-
O,
|
|
118
117
|
k,
|
|
118
|
+
A,
|
|
119
119
|
X,
|
|
120
|
-
j,
|
|
121
120
|
M,
|
|
122
121
|
N,
|
|
123
122
|
P,
|
|
124
123
|
F,
|
|
124
|
+
I,
|
|
125
125
|
J
|
|
126
|
-
]),
|
|
126
|
+
]), fe = u(() => ({
|
|
127
127
|
resolved: $,
|
|
128
128
|
own: Q,
|
|
129
129
|
refetch: q,
|
|
130
130
|
loading: G,
|
|
131
131
|
error: K,
|
|
132
132
|
analytics: Z,
|
|
133
|
-
cascadeOrgId:
|
|
134
|
-
initResponseStaleForToken: Y
|
|
133
|
+
cascadeOrgId: j,
|
|
134
|
+
initResponseStaleForToken: Y,
|
|
135
|
+
disclosuresAcceptance: D
|
|
135
136
|
}), [
|
|
136
137
|
$,
|
|
137
138
|
Q,
|
|
@@ -139,21 +140,22 @@ function g({ children: g, baseUrl: _, widgetToken: v, organizationId: y, configC
|
|
|
139
140
|
G,
|
|
140
141
|
K,
|
|
141
142
|
Z,
|
|
142
|
-
|
|
143
|
-
Y
|
|
143
|
+
j,
|
|
144
|
+
Y,
|
|
145
|
+
D
|
|
144
146
|
]);
|
|
145
|
-
return /* @__PURE__ */
|
|
146
|
-
client:
|
|
147
|
-
children: /* @__PURE__ */
|
|
148
|
-
client:
|
|
147
|
+
return /* @__PURE__ */ m(ce, {
|
|
148
|
+
client: B,
|
|
149
|
+
children: /* @__PURE__ */ m(n, {
|
|
150
|
+
client: U,
|
|
149
151
|
organizationId: X,
|
|
150
|
-
widgetToken:
|
|
151
|
-
authEpoch:
|
|
152
|
-
children: /* @__PURE__ */
|
|
153
|
-
value:
|
|
154
|
-
children: /* @__PURE__ */
|
|
155
|
-
linkComponent:
|
|
156
|
-
uiFramework:
|
|
152
|
+
widgetToken: A,
|
|
153
|
+
authEpoch: H,
|
|
154
|
+
children: /* @__PURE__ */ m(ne.Provider, {
|
|
155
|
+
value: fe,
|
|
156
|
+
children: /* @__PURE__ */ m(s, {
|
|
157
|
+
linkComponent: P,
|
|
158
|
+
uiFramework: F,
|
|
157
159
|
children: g
|
|
158
160
|
})
|
|
159
161
|
})
|
|
@@ -2,185 +2,211 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import { registerQueryClient as e, unregisterQueryClient as
|
|
6
|
-
import { createEmbeddedClient as
|
|
7
|
-
import { EmbedApiProvider as
|
|
5
|
+
import { registerQueryClient as e, unregisterQueryClient as t } from "../../../../data-access/dist/lib/clientRegistry.js";
|
|
6
|
+
import { createEmbeddedClient as n } from "../../../../data-access/dist/lib/createEmbeddedClient.js";
|
|
7
|
+
import { EmbedApiProvider as r, useEmbedApi as ee } 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
|
|
9
|
+
import { getGlobalSnapshot as te, subscribeToGlobal as ne } from "./globalStore.js";
|
|
10
|
+
import { configureEmbeddedClient as re } from "../analytics/client.js";
|
|
11
|
+
import { generateCorrelationId as ie } from "../analytics/ids.js";
|
|
12
|
+
import { WidgetContext as ae } from "./WidgetContext.js";
|
|
13
|
+
import { noop as oe, resolveOrgId as se, useAuthEpoch as ce } from "./utils.js";
|
|
14
|
+
import { useWidgetFetch as le } from "./useWidgetFetch.js";
|
|
15
|
+
import { deriveWidgetInitState as ue, useWidgetInitPublisher as de } from "./useWidgetInitPublisher.js";
|
|
16
|
+
import { resolveUIFramework as fe } from "../../../../ui/dist/lib/UIContext/UIContext.js";
|
|
17
|
+
import { UIProvider as pe } from "../../../../ui/dist/lib/UIContext/UIProvider.js";
|
|
18
|
+
import { useDesignSystemEnsurer as me, useFrameworkRenderer as he } from "../../../../ui/dist/lib/UIContext/uiRendererRegistry.js";
|
|
19
|
+
import { HostIsolationScope as ge } from "../../../../ui/dist/lib/HostIsolationScope/HostIsolationScope.js";
|
|
20
|
+
import { ErrorState as i } from "../../../../ui/dist/lib/ErrorState/ErrorState.js";
|
|
20
21
|
import "../../../../ui/dist/index.js";
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
22
|
+
import { DEFAULT_LABELS as a } from "./labels.js";
|
|
23
|
+
import { WidgetErrorBoundary as _e } from "./WidgetErrorBoundary.js";
|
|
24
|
+
import { DISCLOSURES_REQUIRED_TEST_ID as o, isAuthenticatedDisclosuresReacceptance as s, shouldGateOnDisclosuresAcceptance as ve } from "./isDisclosuresAcceptanceRequired.js";
|
|
25
|
+
import { useContext as ye, useEffect as c, useMemo as l, useRef as u, useState as d, useSyncExternalStore as be } from "react";
|
|
26
|
+
import { jsx as f } from "react/jsx-runtime";
|
|
27
|
+
import { QueryClient as xe, QueryClientProvider as Se } from "@tanstack/react-query";
|
|
25
28
|
//#region ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/WidgetProvider.js
|
|
26
|
-
function
|
|
27
|
-
let
|
|
29
|
+
function p({ children: he, baseUrl: i, widgetToken: a, organizationId: o, configClient: s, gatewayRouting: p, linkComponent: m, uiFramework: h, implementation: g, errorFallback: we, onError: Te, analytics: _, disclosuresAcceptance: Ee, widgetName: v }) {
|
|
30
|
+
let y = ye(ae), b = be(ne, te, te), x = y?.resolved ?? b, De = y?.refetch ?? oe, Oe = y?.loading ?? !1, ke = y?.error ?? null, S = i ?? x.baseUrl, C = a === void 0 ? x.widgetToken : a, Ae = y ? y.cascadeOrgId : b.organizationId, w = o === void 0 ? Ae : o, T = s ?? x.configClient, E = p ?? x.gatewayRouting, D = m ?? x.linkComponent, O = h ?? x.uiFramework, k = g ?? x.implementation, A = Ee ?? y?.disclosuresAcceptance, j = y === null, M = j ? _ !== !1 : y.analytics.enabled, [je] = d(ie), N = j ? je : y.analytics.rootCorrelationId, [Me] = d(ie), P = v === void 0 ? y?.analytics.widgetName : v, F = v === void 0 ? y?.analytics.widgetInstanceId : Me, I = u({
|
|
28
31
|
enabled: M,
|
|
29
|
-
organizationId:
|
|
32
|
+
organizationId: w,
|
|
30
33
|
rootCorrelationId: N,
|
|
31
34
|
widgetName: P,
|
|
32
35
|
widgetInstanceId: F
|
|
33
|
-
}),
|
|
34
|
-
|
|
35
|
-
j ||
|
|
36
|
-
}, [
|
|
36
|
+
}), Ne = u(!1);
|
|
37
|
+
c(() => {
|
|
38
|
+
j || _ === 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
|
+
}, [_, j]), c(() => {
|
|
37
40
|
if (!j || !M || !("window" in globalThis)) return;
|
|
38
41
|
let e = !1;
|
|
39
|
-
return import("../analytics/install.js").then(({ ensureAnalyticsAdapterInstalled:
|
|
40
|
-
e ||
|
|
42
|
+
return import("../analytics/install.js").then(({ ensureAnalyticsAdapterInstalled: t }) => {
|
|
43
|
+
e || t();
|
|
41
44
|
}), () => {
|
|
42
45
|
e = !0;
|
|
43
46
|
};
|
|
44
47
|
}, [j, M]);
|
|
45
|
-
let
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}, [
|
|
49
|
-
let
|
|
50
|
-
|
|
51
|
-
let
|
|
52
|
-
if (!
|
|
53
|
-
let e =
|
|
54
|
-
tokenRef:
|
|
48
|
+
let L = me(fe(O));
|
|
49
|
+
c(() => {
|
|
50
|
+
L && L().catch(() => {});
|
|
51
|
+
}, [L]);
|
|
52
|
+
let R = y === null || i !== void 0 || a !== void 0 || o !== void 0 || s != null || p !== void 0 || v !== void 0, z = u(C);
|
|
53
|
+
z.current = C;
|
|
54
|
+
let Pe = ee(), Fe = ce(C), B = l(() => {
|
|
55
|
+
if (!R) return null;
|
|
56
|
+
let e = re(n(S), {
|
|
57
|
+
tokenRef: z,
|
|
55
58
|
analyticsContextRef: I,
|
|
56
|
-
gatewayRouting:
|
|
59
|
+
gatewayRouting: E
|
|
57
60
|
});
|
|
58
|
-
return
|
|
61
|
+
return T ? T(e) : e;
|
|
59
62
|
}, [
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
]),
|
|
65
|
-
hasToken: !!
|
|
66
|
-
loading:
|
|
67
|
-
error:
|
|
68
|
-
initResponse:
|
|
69
|
-
initStaleForToken:
|
|
63
|
+
R,
|
|
64
|
+
S,
|
|
65
|
+
T,
|
|
66
|
+
E
|
|
67
|
+
]), V = y === null || i !== void 0 || a !== void 0, Ie = V ? Fe : Pe.authEpoch, { result: H, loading: U, error: W, clearedForAuthChange: Le, initStaleForToken: G, refetch: Re } = le(V ? B : null, V ? C : void 0, I), K = V ? Re : De, q = V ? U : Oe, J = V ? W : ke, ze = y?.resolved.initResponse, Be = !V || !Le && !W && !H && !!C && !U, Y = Be ? ze : H ?? void 0, X = Be ? V || (y?.initResponseStaleForToken ?? !1) : G, Ve = y === null, He = l(() => Ve ? ue({
|
|
68
|
+
hasToken: !!C,
|
|
69
|
+
loading: U,
|
|
70
|
+
error: W,
|
|
71
|
+
initResponse: H ?? void 0,
|
|
72
|
+
initStaleForToken: G
|
|
70
73
|
}) : null, [
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
W,
|
|
74
|
-
G,
|
|
74
|
+
Ve,
|
|
75
|
+
C,
|
|
75
76
|
U,
|
|
76
|
-
|
|
77
|
+
W,
|
|
78
|
+
H,
|
|
79
|
+
G
|
|
77
80
|
]);
|
|
78
|
-
|
|
79
|
-
let
|
|
81
|
+
de(He, C);
|
|
82
|
+
let Z = se(w, X ? void 0 : Y?.organizationId), Q = l(() => ({
|
|
80
83
|
enabled: M,
|
|
81
|
-
organizationId:
|
|
84
|
+
organizationId: Z,
|
|
82
85
|
rootCorrelationId: N,
|
|
83
86
|
widgetName: P,
|
|
84
87
|
widgetInstanceId: F
|
|
85
88
|
}), [
|
|
86
89
|
M,
|
|
87
|
-
|
|
90
|
+
Z,
|
|
88
91
|
N,
|
|
89
92
|
P,
|
|
90
93
|
F
|
|
91
94
|
]);
|
|
92
|
-
I.current =
|
|
93
|
-
let [
|
|
95
|
+
I.current = Q;
|
|
96
|
+
let [$] = d(() => y === null ? new xe({ defaultOptions: {
|
|
94
97
|
queries: {
|
|
95
98
|
retry: !1,
|
|
96
99
|
refetchOnWindowFocus: !1
|
|
97
100
|
},
|
|
98
101
|
mutations: { retry: !1 }
|
|
99
102
|
} }) : null);
|
|
100
|
-
|
|
101
|
-
if (
|
|
102
|
-
let
|
|
103
|
-
return e(
|
|
104
|
-
}, [
|
|
105
|
-
let
|
|
106
|
-
baseUrl:
|
|
107
|
-
widgetToken:
|
|
108
|
-
organizationId:
|
|
109
|
-
configClient:
|
|
110
|
-
gatewayRouting:
|
|
111
|
-
linkComponent:
|
|
112
|
-
uiFramework:
|
|
113
|
-
implementation:
|
|
103
|
+
c(() => {
|
|
104
|
+
if (!$) return;
|
|
105
|
+
let n = $;
|
|
106
|
+
return e(n), () => t(n);
|
|
107
|
+
}, [$]);
|
|
108
|
+
let Ue = l(() => ({
|
|
109
|
+
baseUrl: i,
|
|
110
|
+
widgetToken: a,
|
|
111
|
+
organizationId: o,
|
|
112
|
+
configClient: s,
|
|
113
|
+
gatewayRouting: p,
|
|
114
|
+
linkComponent: m,
|
|
115
|
+
uiFramework: h,
|
|
116
|
+
implementation: g
|
|
114
117
|
}), [
|
|
115
|
-
|
|
116
|
-
|
|
118
|
+
i,
|
|
119
|
+
a,
|
|
120
|
+
o,
|
|
121
|
+
s,
|
|
117
122
|
p,
|
|
118
123
|
m,
|
|
119
124
|
h,
|
|
120
|
-
g
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
implementation: A,
|
|
132
|
-
initResponse: q
|
|
125
|
+
g
|
|
126
|
+
]), We = l(() => ({
|
|
127
|
+
baseUrl: S,
|
|
128
|
+
widgetToken: C,
|
|
129
|
+
organizationId: Z,
|
|
130
|
+
configClient: T,
|
|
131
|
+
gatewayRouting: E,
|
|
132
|
+
linkComponent: D,
|
|
133
|
+
uiFramework: O,
|
|
134
|
+
implementation: k,
|
|
135
|
+
initResponse: Y
|
|
133
136
|
}), [
|
|
137
|
+
S,
|
|
134
138
|
C,
|
|
135
|
-
|
|
136
|
-
|
|
139
|
+
Z,
|
|
140
|
+
T,
|
|
137
141
|
E,
|
|
138
142
|
D,
|
|
139
143
|
O,
|
|
140
144
|
k,
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
145
|
+
Y
|
|
146
|
+
]), Ge = l(() => ({
|
|
147
|
+
resolved: We,
|
|
148
|
+
own: Ue,
|
|
149
|
+
refetch: K,
|
|
150
|
+
loading: q,
|
|
151
|
+
error: J,
|
|
152
|
+
analytics: Q,
|
|
153
|
+
cascadeOrgId: w,
|
|
154
|
+
initResponseStaleForToken: X,
|
|
155
|
+
disclosuresAcceptance: A
|
|
152
156
|
}), [
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
157
|
+
We,
|
|
158
|
+
Ue,
|
|
159
|
+
K,
|
|
160
|
+
q,
|
|
161
|
+
J,
|
|
162
|
+
Q,
|
|
163
|
+
w,
|
|
164
|
+
X,
|
|
165
|
+
A
|
|
166
|
+
]), Ke = /* @__PURE__ */ f(ae.Provider, {
|
|
167
|
+
value: Ge,
|
|
168
|
+
children: /* @__PURE__ */ f(pe, {
|
|
169
|
+
linkComponent: D,
|
|
170
|
+
uiFramework: O,
|
|
171
|
+
children: /* @__PURE__ */ f(ge, { children: /* @__PURE__ */ f(_e, {
|
|
172
|
+
resetKeys: [C],
|
|
173
|
+
errorFallback: we,
|
|
174
|
+
onError: Te,
|
|
175
|
+
children: ve(Y, v) ? /* @__PURE__ */ f(Ce, {
|
|
176
|
+
init: Y,
|
|
177
|
+
disclosuresAcceptance: A,
|
|
178
|
+
initStaleForToken: X
|
|
179
|
+
}) : he
|
|
171
180
|
}) })
|
|
172
181
|
})
|
|
173
|
-
}),
|
|
174
|
-
client:
|
|
175
|
-
organizationId:
|
|
176
|
-
widgetToken:
|
|
177
|
-
authEpoch:
|
|
178
|
-
children:
|
|
179
|
-
}) :
|
|
180
|
-
return
|
|
181
|
-
client:
|
|
182
|
-
children:
|
|
183
|
-
}) :
|
|
182
|
+
}), qe = B ? /* @__PURE__ */ f(r, {
|
|
183
|
+
client: B,
|
|
184
|
+
organizationId: Z,
|
|
185
|
+
widgetToken: C,
|
|
186
|
+
authEpoch: Ie,
|
|
187
|
+
children: Ke
|
|
188
|
+
}) : Ke;
|
|
189
|
+
return $ ? /* @__PURE__ */ f(Se, {
|
|
190
|
+
client: $,
|
|
191
|
+
children: qe
|
|
192
|
+
}) : qe;
|
|
193
|
+
}
|
|
194
|
+
function Ce({ init: e, disclosuresAcceptance: t, initStaleForToken: n }) {
|
|
195
|
+
let r = he("error-state") ?? i;
|
|
196
|
+
return n ? /* @__PURE__ */ f(r, {
|
|
197
|
+
title: a.disclosuresRefreshingTitle,
|
|
198
|
+
description: a.disclosuresRefreshingDescription,
|
|
199
|
+
testId: o,
|
|
200
|
+
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
|
+
}) : s(e) && t != null ? /* @__PURE__ */ f("div", {
|
|
202
|
+
"data-testid": o,
|
|
203
|
+
className: "ttw:w-full",
|
|
204
|
+
children: t
|
|
205
|
+
}) : /* @__PURE__ */ f(r, {
|
|
206
|
+
title: a.disclosuresRequiredTitle,
|
|
207
|
+
testId: o,
|
|
208
|
+
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"
|
|
209
|
+
});
|
|
184
210
|
}
|
|
185
211
|
//#endregion
|
|
186
|
-
export {
|
|
212
|
+
export { p as WidgetProvider, p as default };
|
package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/hooks.js
CHANGED
|
@@ -12,16 +12,19 @@ function s() {
|
|
|
12
12
|
return i(n)?.own ?? null;
|
|
13
13
|
}
|
|
14
14
|
function c() {
|
|
15
|
-
return i(n)?.
|
|
15
|
+
return i(n)?.disclosuresAcceptance;
|
|
16
16
|
}
|
|
17
17
|
function l() {
|
|
18
|
-
return i(n)?.
|
|
18
|
+
return i(n)?.initResponseStaleForToken ?? !1;
|
|
19
19
|
}
|
|
20
20
|
function u() {
|
|
21
|
-
return i(n)?.
|
|
21
|
+
return i(n)?.refetch ?? r;
|
|
22
22
|
}
|
|
23
23
|
function d() {
|
|
24
|
+
return i(n)?.loading ?? !1;
|
|
25
|
+
}
|
|
26
|
+
function f() {
|
|
24
27
|
return i(n)?.error ?? null;
|
|
25
28
|
}
|
|
26
29
|
//#endregion
|
|
27
|
-
export { s as useOwnWidgetConfig,
|
|
30
|
+
export { c as useDisclosuresAcceptanceSurface, s as useOwnWidgetConfig, u as useRefetchWidget, o as useWidgetConfig, f as useWidgetError, l as useWidgetInitStaleForToken, d as useWidgetLoading };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
//#region ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/isDisclosuresAcceptanceRequired.js
|
|
2
|
+
var e = "widget-disclosures-required", t = /* @__PURE__ */ new Set([
|
|
3
|
+
"accept_disclosures",
|
|
4
|
+
"onboarding",
|
|
5
|
+
"widget_suite"
|
|
6
|
+
]);
|
|
7
|
+
function n(e) {
|
|
8
|
+
return e?.disclosuresRequired === "REQUIRED" && e?.disclosuresAccepted === !1;
|
|
9
|
+
}
|
|
10
|
+
function r(e) {
|
|
11
|
+
return e !== void 0 && t.has(e);
|
|
12
|
+
}
|
|
13
|
+
function i(e, t) {
|
|
14
|
+
return t !== void 0 && n(e) && !r(t);
|
|
15
|
+
}
|
|
16
|
+
function a(e) {
|
|
17
|
+
return n(e) && e?.status === "ACTIVE";
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
export { e as DISCLOSURES_REQUIRED_TEST_ID, a as isAuthenticatedDisclosuresReacceptance, n as isDisclosuresAcceptanceRequired, r as isDisclosuresGateExempt, i as shouldGateOnDisclosuresAcceptance };
|
package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/labels.js
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
//#region ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/labels.js
|
|
2
|
-
var e = {
|
|
2
|
+
var e = {
|
|
3
|
+
errorBoundaryFallback: "Something went wrong loading this widget.",
|
|
4
|
+
disclosuresRequiredTitle: "Accept disclosures to continue",
|
|
5
|
+
disclosuresRefreshingTitle: "Updating your session",
|
|
6
|
+
disclosuresRefreshingDescription: "Please wait while we load the latest disclosures for this session."
|
|
7
|
+
};
|
|
3
8
|
//#endregion
|
|
4
9
|
export { e as DEFAULT_LABELS };
|
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.282", n = "14b9e18a8a97f8487169fcbc8d319c74a19e24dd", r = Object.freeze({
|
|
3
3
|
library_name: e,
|
|
4
4
|
library_version: t,
|
|
5
5
|
library_sha: n
|