@tesouro/embedded-components-react 0.11.220 → 0.11.221
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 +4 -3
- package/dist/index.css +6 -5
- package/dist/index.d.ts +6 -5
- package/dist/lib/BillPayWidget.d.ts +4 -3
- package/dist/lib/ReceivablesWidget.d.ts +2 -2
- package/dist/lib/WidgetSuite.d.ts +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/lib/BillPayWidget/BillPayWidget.js +61 -51
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index.js +6 -6
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index14.js +48 -37
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/ReceivablesWidget.js +105 -97
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index.js +21 -21
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index7.js +42 -35
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/WidgetProvider.js +119 -119
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/package.json +1 -1
|
@@ -15,134 +15,134 @@ import { useDesignSystemEnsurer as ne, useFrameworkRenderer as re } from "../../
|
|
|
15
15
|
import { HostIsolationScope as ie } from "../../../../ui/dist/lib/HostIsolationScope/HostIsolationScope.js";
|
|
16
16
|
import { ErrorState as s } from "../../../../ui/dist/lib/ErrorState/ErrorState.js";
|
|
17
17
|
import "../../../../ui/dist/index.js";
|
|
18
|
-
import { getGlobalSnapshot as
|
|
19
|
-
import { EmbeddedAnalyticsEvent as
|
|
20
|
-
import { configureEmbeddedClient as
|
|
21
|
-
import { generateCorrelationId as
|
|
22
|
-
import { WidgetContext as
|
|
23
|
-
import { noop as
|
|
24
|
-
import { useWidgetFetch as
|
|
25
|
-
import { deriveOrganizationStatus as
|
|
26
|
-
import { deriveWidgetInitState as
|
|
27
|
-
import { useTokenRefreshRef as
|
|
28
|
-
import { useAnalyticsTrack as
|
|
29
|
-
import { resolveProviderLabels as
|
|
30
|
-
import { WidgetErrorBoundary as
|
|
31
|
-
import { DISCLOSURES_REQUIRED_TEST_ID as
|
|
32
|
-
import { useContext as
|
|
33
|
-
import { jsx as
|
|
18
|
+
import { getGlobalSnapshot as c, subscribeToGlobal as ae } from "./globalStore.js";
|
|
19
|
+
import { EmbeddedAnalyticsEvent as l } from "../analytics/events.js";
|
|
20
|
+
import { configureEmbeddedClient as oe } from "../analytics/client.js";
|
|
21
|
+
import { generateCorrelationId as se } from "../analytics/ids.js";
|
|
22
|
+
import { WidgetContext as u } from "./WidgetContext.js";
|
|
23
|
+
import { noop as ce, resolveOrgId as le, useAuthEpoch as ue } from "./utils.js";
|
|
24
|
+
import { useWidgetFetch as de } from "./useWidgetFetch.js";
|
|
25
|
+
import { deriveOrganizationStatus as fe } from "./deriveOrganizationStatus.js";
|
|
26
|
+
import { deriveWidgetInitState as pe, useWidgetInitPublisher as me } from "./useWidgetInitPublisher.js";
|
|
27
|
+
import { useTokenRefreshRef as he } from "./useTokenRefreshRef.js";
|
|
28
|
+
import { useAnalyticsTrack as d } from "../analytics/hooks.js";
|
|
29
|
+
import { resolveProviderLabels as ge } from "./labels.js";
|
|
30
|
+
import { WidgetErrorBoundary as _e } from "./WidgetErrorBoundary.js";
|
|
31
|
+
import { DISCLOSURES_REQUIRED_TEST_ID as f, hasRenderableAcceptanceSurface as p, resolveDisclosuresBlockedReason as m, shouldGateOnDisclosuresAcceptance as ve } from "./isDisclosuresAcceptanceRequired.js";
|
|
32
|
+
import { useContext as ye, useEffect as h, useMemo as g, useRef as _, useState as v, useSyncExternalStore as be } from "react";
|
|
33
|
+
import { jsx as y, jsxs as xe } from "react/jsx-runtime";
|
|
34
34
|
import { QueryClient as Se, QueryClientProvider as Ce } from "@tanstack/react-query";
|
|
35
35
|
// ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/WidgetProvider.js
|
|
36
|
-
function
|
|
36
|
+
function b({ children: re, baseUrl: s, widgetToken: l, organizationId: d, configClient: f, gatewayRouting: p, linkComponent: m, uiFramework: b, errorFallback: Te, onError: Ee, analytics: x, disclosuresAcceptance: De, providerLabels: Oe, widgetName: S, header: ke }) {
|
|
37
37
|
e();
|
|
38
|
-
let
|
|
39
|
-
enabled:
|
|
38
|
+
let C = ye(u), Ae = be(ae, c, c), w = C?.resolved ?? Ae, je = C?.refetch ?? ce, Me = C?.loading ?? !1, Ne = C?.error ?? null, T = s ?? w.baseUrl, E = l === void 0 ? w.widgetToken : l, Pe = C ? C.cascadeOrgId : Ae.organizationId, D = d === void 0 ? Pe : d, O = f ?? w.configClient, k = p ?? w.gatewayRouting, A = m ?? w.linkComponent, j = b ?? w.uiFramework, M = De ?? C?.disclosuresAcceptance, N = Oe ?? C?.providerLabels, Fe = g(() => ge(N), [N]), P = C === null, F = P ? x !== !1 : C.analytics.enabled, [Ie] = v(se), I = P ? Ie : C.analytics.rootCorrelationId, [Le] = v(se), L = S === void 0 ? C?.analytics.widgetName : S, R = S === void 0 ? C?.analytics.widgetInstanceId : Le, z = _({
|
|
39
|
+
enabled: F,
|
|
40
40
|
organizationId: D,
|
|
41
|
-
rootCorrelationId:
|
|
42
|
-
widgetName:
|
|
43
|
-
widgetInstanceId:
|
|
44
|
-
}),
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}, [
|
|
48
|
-
if (!
|
|
41
|
+
rootCorrelationId: I,
|
|
42
|
+
widgetName: L,
|
|
43
|
+
widgetInstanceId: R
|
|
44
|
+
}), Re = _(!1);
|
|
45
|
+
h(() => {
|
|
46
|
+
P || x === void 0 || Re.current || (Re.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."));
|
|
47
|
+
}, [x, P]), h(() => {
|
|
48
|
+
if (!P || !F || !("window" in globalThis)) return;
|
|
49
49
|
let e = !1;
|
|
50
50
|
return import("../analytics/install.js").then(({ ensureAnalyticsAdapterInstalled: t }) => {
|
|
51
51
|
e || t();
|
|
52
52
|
}), () => {
|
|
53
53
|
e = !0;
|
|
54
54
|
};
|
|
55
|
-
}, [
|
|
56
|
-
let
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}, [
|
|
60
|
-
let
|
|
61
|
-
|
|
62
|
-
let
|
|
63
|
-
if (!
|
|
64
|
-
let e =
|
|
65
|
-
tokenRef:
|
|
66
|
-
analyticsContextRef:
|
|
67
|
-
clientSecretRef:
|
|
55
|
+
}, [P, F]);
|
|
56
|
+
let B = ne(ee(j));
|
|
57
|
+
h(() => {
|
|
58
|
+
B && B().catch(() => {});
|
|
59
|
+
}, [B]);
|
|
60
|
+
let V = C === null || s !== void 0 || l !== void 0 || d !== void 0 || f != null || p !== void 0 || S !== void 0, H = _(E);
|
|
61
|
+
H.current = E;
|
|
62
|
+
let ze = he(), Be = _(null), Ve = g(() => t(Be), []), He = o(), Ue = ue(E), U = g(() => {
|
|
63
|
+
if (!V) return null;
|
|
64
|
+
let e = oe(i(T), {
|
|
65
|
+
tokenRef: H,
|
|
66
|
+
analyticsContextRef: z,
|
|
67
|
+
clientSecretRef: Be,
|
|
68
68
|
gatewayRouting: k,
|
|
69
|
-
refreshTokenRef:
|
|
69
|
+
refreshTokenRef: ze
|
|
70
70
|
});
|
|
71
71
|
return O ? O(e) : e;
|
|
72
72
|
}, [
|
|
73
|
-
|
|
73
|
+
V,
|
|
74
74
|
T,
|
|
75
75
|
O,
|
|
76
76
|
k,
|
|
77
|
-
|
|
78
|
-
]),
|
|
77
|
+
ze
|
|
78
|
+
]), W = C === null || s !== void 0 || l !== void 0, We = W ? Ue : He.authEpoch, { result: G, loading: K, error: q, clearedForAuthChange: Ge, initStaleForToken: J, initReplacementPending: Ke, refetch: qe } = de(W ? U : null, W ? E : void 0, z), Je = W ? qe : je, Ye = W ? K : Me, Xe = W ? q : Ne, Ze = C?.resolved.initResponse, Qe = !W || !Ge && !q && !G && !!E && !K, Y = Qe ? Ze : G ?? void 0, X = Qe ? W || (C?.initResponseStaleForToken ?? !1) : J, $e = C === null, et = g(() => $e ? pe({
|
|
79
79
|
hasToken: !!E,
|
|
80
|
-
loading:
|
|
81
|
-
error:
|
|
82
|
-
initResponse:
|
|
83
|
-
initStaleForToken:
|
|
80
|
+
loading: K,
|
|
81
|
+
error: q,
|
|
82
|
+
initResponse: G ?? void 0,
|
|
83
|
+
initStaleForToken: J
|
|
84
84
|
}) : null, [
|
|
85
|
-
|
|
85
|
+
$e,
|
|
86
86
|
E,
|
|
87
|
-
G,
|
|
88
87
|
K,
|
|
89
|
-
|
|
90
|
-
|
|
88
|
+
q,
|
|
89
|
+
G,
|
|
90
|
+
J
|
|
91
91
|
]);
|
|
92
|
-
|
|
93
|
-
let Z =
|
|
92
|
+
me(et, E);
|
|
93
|
+
let Z = le(D, X ? void 0 : Y?.organizationId), tt = fe({
|
|
94
94
|
organizationId: Z,
|
|
95
95
|
cascadeOrgId: D,
|
|
96
|
-
ownsFetch:
|
|
97
|
-
parentStatus:
|
|
96
|
+
ownsFetch: W,
|
|
97
|
+
parentStatus: He.organizationStatus,
|
|
98
98
|
hasToken: !!E,
|
|
99
|
-
loading:
|
|
100
|
-
error:
|
|
101
|
-
hasResult: !!
|
|
102
|
-
initReplacementPending:
|
|
103
|
-
}), Q =
|
|
104
|
-
enabled:
|
|
99
|
+
loading: K,
|
|
100
|
+
error: q,
|
|
101
|
+
hasResult: !!G,
|
|
102
|
+
initReplacementPending: Ke
|
|
103
|
+
}), Q = g(() => ({
|
|
104
|
+
enabled: F,
|
|
105
105
|
organizationId: Z,
|
|
106
|
-
rootCorrelationId:
|
|
107
|
-
widgetName:
|
|
108
|
-
widgetInstanceId:
|
|
106
|
+
rootCorrelationId: I,
|
|
107
|
+
widgetName: L,
|
|
108
|
+
widgetInstanceId: R
|
|
109
109
|
}), [
|
|
110
|
-
|
|
110
|
+
F,
|
|
111
111
|
Z,
|
|
112
|
+
I,
|
|
112
113
|
L,
|
|
113
|
-
R
|
|
114
|
-
z
|
|
114
|
+
R
|
|
115
115
|
]);
|
|
116
|
-
|
|
117
|
-
let [$] =
|
|
116
|
+
z.current = Q;
|
|
117
|
+
let [$] = v(() => C === null ? new Se({ defaultOptions: {
|
|
118
118
|
queries: {
|
|
119
119
|
retry: !1,
|
|
120
120
|
refetchOnWindowFocus: !1
|
|
121
121
|
},
|
|
122
122
|
mutations: { retry: !1 }
|
|
123
123
|
} }) : null);
|
|
124
|
-
|
|
124
|
+
h(() => {
|
|
125
125
|
if (!$) return;
|
|
126
126
|
let e = $;
|
|
127
127
|
return n(e), () => r(e);
|
|
128
128
|
}, [$]);
|
|
129
|
-
let
|
|
129
|
+
let nt = g(() => ({
|
|
130
130
|
baseUrl: s,
|
|
131
|
-
widgetToken:
|
|
132
|
-
organizationId:
|
|
133
|
-
configClient:
|
|
134
|
-
gatewayRouting:
|
|
135
|
-
linkComponent:
|
|
136
|
-
uiFramework:
|
|
131
|
+
widgetToken: l,
|
|
132
|
+
organizationId: d,
|
|
133
|
+
configClient: f,
|
|
134
|
+
gatewayRouting: p,
|
|
135
|
+
linkComponent: m,
|
|
136
|
+
uiFramework: b
|
|
137
137
|
}), [
|
|
138
138
|
s,
|
|
139
|
-
|
|
140
|
-
u,
|
|
139
|
+
l,
|
|
141
140
|
d,
|
|
142
141
|
f,
|
|
143
142
|
p,
|
|
144
|
-
|
|
145
|
-
|
|
143
|
+
m,
|
|
144
|
+
b
|
|
145
|
+
]), rt = g(() => ({
|
|
146
146
|
baseUrl: T,
|
|
147
147
|
widgetToken: E,
|
|
148
148
|
organizationId: Z,
|
|
@@ -160,79 +160,79 @@ function y({ children: re, baseUrl: s, widgetToken: c, organizationId: u, config
|
|
|
160
160
|
A,
|
|
161
161
|
j,
|
|
162
162
|
Y
|
|
163
|
-
]),
|
|
164
|
-
resolved:
|
|
165
|
-
own:
|
|
166
|
-
refetch:
|
|
167
|
-
loading:
|
|
168
|
-
error:
|
|
163
|
+
]), it = g(() => ({
|
|
164
|
+
resolved: rt,
|
|
165
|
+
own: nt,
|
|
166
|
+
refetch: Je,
|
|
167
|
+
loading: Ye,
|
|
168
|
+
error: Xe,
|
|
169
169
|
analytics: Q,
|
|
170
170
|
cascadeOrgId: D,
|
|
171
171
|
initResponseStaleForToken: X,
|
|
172
172
|
disclosuresAcceptance: M,
|
|
173
173
|
providerLabels: N
|
|
174
174
|
}), [
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
qe,
|
|
175
|
+
rt,
|
|
176
|
+
nt,
|
|
178
177
|
Je,
|
|
179
178
|
Ye,
|
|
179
|
+
Xe,
|
|
180
180
|
Q,
|
|
181
181
|
D,
|
|
182
182
|
X,
|
|
183
183
|
M,
|
|
184
184
|
N
|
|
185
|
-
]),
|
|
186
|
-
value:
|
|
187
|
-
children: /* @__PURE__ */
|
|
185
|
+
]), at = /* @__PURE__ */ y(u.Provider, {
|
|
186
|
+
value: it,
|
|
187
|
+
children: /* @__PURE__ */ y(te, {
|
|
188
188
|
linkComponent: A,
|
|
189
189
|
uiFramework: j,
|
|
190
|
-
children: /* @__PURE__ */
|
|
190
|
+
children: /* @__PURE__ */ xe(ie, { children: [ke, /* @__PURE__ */ y(_e, {
|
|
191
191
|
resetKeys: [E],
|
|
192
192
|
errorFallback: Te,
|
|
193
193
|
onError: Ee,
|
|
194
|
-
labels:
|
|
195
|
-
children:
|
|
194
|
+
labels: Fe,
|
|
195
|
+
children: ve(Y, S) ? /* @__PURE__ */ y(we, {
|
|
196
196
|
disclosuresAcceptance: M,
|
|
197
197
|
initStaleForToken: X,
|
|
198
|
-
labels:
|
|
198
|
+
labels: Fe
|
|
199
199
|
}) : re
|
|
200
|
-
}) })
|
|
200
|
+
})] })
|
|
201
201
|
})
|
|
202
|
-
}),
|
|
203
|
-
client:
|
|
202
|
+
}), ot = U ? /* @__PURE__ */ y(a, {
|
|
203
|
+
client: U,
|
|
204
204
|
organizationId: Z,
|
|
205
205
|
widgetToken: E,
|
|
206
|
-
installClientSecret:
|
|
207
|
-
authEpoch:
|
|
208
|
-
organizationStatus:
|
|
209
|
-
children:
|
|
210
|
-
}) :
|
|
211
|
-
return $ ? /* @__PURE__ */
|
|
206
|
+
installClientSecret: Ve,
|
|
207
|
+
authEpoch: We,
|
|
208
|
+
organizationStatus: tt,
|
|
209
|
+
children: at
|
|
210
|
+
}) : at;
|
|
211
|
+
return $ ? /* @__PURE__ */ y(Ce, {
|
|
212
212
|
client: $,
|
|
213
|
-
children:
|
|
214
|
-
}) :
|
|
213
|
+
children: ot
|
|
214
|
+
}) : ot;
|
|
215
215
|
}
|
|
216
216
|
function we({ disclosuresAcceptance: e, initStaleForToken: t, labels: n }) {
|
|
217
|
-
let r = re("error-state") ?? s, i =
|
|
217
|
+
let r = re("error-state") ?? s, i = d(), a = p(e), o = m({
|
|
218
218
|
initStaleForToken: t,
|
|
219
219
|
hasAcceptanceSurface: a
|
|
220
220
|
});
|
|
221
|
-
return
|
|
222
|
-
i(
|
|
223
|
-
}, [o, i]), t ? /* @__PURE__ */
|
|
221
|
+
return h(() => {
|
|
222
|
+
i(l.WidgetDisclosuresBlocked, { reason: o }), console.info(`[disclosures] widget blocked: ${o}`);
|
|
223
|
+
}, [o, i]), t ? /* @__PURE__ */ y(r, {
|
|
224
224
|
title: n.disclosuresRefreshingTitle,
|
|
225
225
|
description: n.disclosuresRefreshingDescription,
|
|
226
|
-
testId:
|
|
226
|
+
testId: f,
|
|
227
227
|
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"
|
|
228
|
-
}) : a ? /* @__PURE__ */
|
|
229
|
-
"data-testid":
|
|
228
|
+
}) : a ? /* @__PURE__ */ y("div", {
|
|
229
|
+
"data-testid": f,
|
|
230
230
|
className: "ttw:w-full",
|
|
231
231
|
children: e
|
|
232
|
-
}) : /* @__PURE__ */
|
|
232
|
+
}) : /* @__PURE__ */ y(r, {
|
|
233
233
|
title: n.disclosuresRequiredTitle,
|
|
234
|
-
testId:
|
|
234
|
+
testId: f,
|
|
235
235
|
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"
|
|
236
236
|
});
|
|
237
237
|
}
|
|
238
|
-
export {
|
|
238
|
+
export { b as WidgetProvider, b as default };
|
package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
|
|
2
|
-
var e = "@tesouro/embedded-components-react", t = "0.11.
|
|
2
|
+
var e = "@tesouro/embedded-components-react", t = "0.11.221", n = "d6ab3e12650f9324437fda18bfb402f02879ce07", r = Object.freeze({
|
|
3
3
|
library_name: e,
|
|
4
4
|
library_version: t,
|
|
5
5
|
library_sha: n
|