@tesouro/embedded-components-react 0.7.14 → 0.7.16
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/dist/index.d.ts +11 -2
- package/dist/lib/AcceptDisclosuresWidget.d.ts +7 -0
- package/dist/lib/BankAccountOnboardingWidget.d.ts +4 -2
- package/dist/lib/WidgetSuite.d.ts +4 -2
- package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/feature/dist/lib/AcceptDisclosuresWidget/AcceptDisclosuresWidget.js +97 -97
- package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/ui/dist/lib/AcceptDisclosuresWidget/labels.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/BankAccountOnboardingWidget.js +441 -433
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/labels.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableForm.js +2 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableIssuePreflight.js +10 -10
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1990,10 +1990,12 @@ interface BankAccountOnboardingWidgetLabels {
|
|
|
1990
1990
|
personalReviewSubtitle: string;
|
|
1991
1991
|
/** Accessible title for the onboarding modal. */
|
|
1992
1992
|
modalTitle: string;
|
|
1993
|
-
/**
|
|
1993
|
+
/** Shown when submitting the application fails. */
|
|
1994
1994
|
submitFailedError: string;
|
|
1995
|
-
/**
|
|
1995
|
+
/** Shown when saving the application fails. */
|
|
1996
1996
|
genericRetryError: string;
|
|
1997
|
+
/** Shown when deleting the application fails. */
|
|
1998
|
+
deleteFailedError?: string;
|
|
1997
1999
|
/** Shown when the close prompt's "Save changes" has nothing valid to write. */
|
|
1998
2000
|
saveDraftNothingValidError: string;
|
|
1999
2001
|
/** Used when init has no bank name for disclaimers / result branding. */
|
|
@@ -4149,6 +4151,12 @@ interface AcceptDisclosuresWidgetLabels {
|
|
|
4149
4151
|
agreementCheckboxAriaLabel: string;
|
|
4150
4152
|
/** Fallback when the accept API fails without a usable message. */
|
|
4151
4153
|
acceptErrorFallback: string;
|
|
4154
|
+
/**
|
|
4155
|
+
* Shown when acceptance succeeded but the host could not continue to its
|
|
4156
|
+
* next step. Kept distinct from `acceptErrorFallback` because the disclosure
|
|
4157
|
+
* operation has already completed.
|
|
4158
|
+
*/
|
|
4159
|
+
continuationErrorFallback?: string;
|
|
4152
4160
|
/**
|
|
4153
4161
|
* Use `{bankName}` for the bank display name and `{documents}` for the
|
|
4154
4162
|
* conjunction list of titles the backend returned (same order as the links).
|
|
@@ -4204,6 +4212,7 @@ declare const ACCEPT_DISCLOSURES_WIDGET_LABELS_EN: {
|
|
|
4204
4212
|
acceptButton: string;
|
|
4205
4213
|
agreementCheckboxAriaLabel: string;
|
|
4206
4214
|
acceptErrorFallback: string;
|
|
4215
|
+
continuationErrorFallback: string;
|
|
4207
4216
|
agreementTextTemplate: string;
|
|
4208
4217
|
providerAttributionPrefix: string;
|
|
4209
4218
|
providerAttributionMiddle: string;
|
|
@@ -9,6 +9,12 @@ interface AcceptDisclosuresWidgetLabels {
|
|
|
9
9
|
agreementCheckboxAriaLabel: string;
|
|
10
10
|
/** Fallback when the accept API fails without a usable message. */
|
|
11
11
|
acceptErrorFallback: string;
|
|
12
|
+
/**
|
|
13
|
+
* Shown when acceptance succeeded but the host could not continue to its
|
|
14
|
+
* next step. Kept distinct from `acceptErrorFallback` because the disclosure
|
|
15
|
+
* operation has already completed.
|
|
16
|
+
*/
|
|
17
|
+
continuationErrorFallback?: string;
|
|
12
18
|
/**
|
|
13
19
|
* Use `{bankName}` for the bank display name and `{documents}` for the
|
|
14
20
|
* conjunction list of titles the backend returned (same order as the links).
|
|
@@ -64,6 +70,7 @@ declare const ACCEPT_DISCLOSURES_WIDGET_LABELS_EN: {
|
|
|
64
70
|
acceptButton: string;
|
|
65
71
|
agreementCheckboxAriaLabel: string;
|
|
66
72
|
acceptErrorFallback: string;
|
|
73
|
+
continuationErrorFallback: string;
|
|
67
74
|
agreementTextTemplate: string;
|
|
68
75
|
providerAttributionPrefix: string;
|
|
69
76
|
providerAttributionMiddle: string;
|
|
@@ -1058,10 +1058,12 @@ interface BankAccountOnboardingWidgetLabels {
|
|
|
1058
1058
|
personalReviewSubtitle: string;
|
|
1059
1059
|
/** Accessible title for the onboarding modal. */
|
|
1060
1060
|
modalTitle: string;
|
|
1061
|
-
/**
|
|
1061
|
+
/** Shown when submitting the application fails. */
|
|
1062
1062
|
submitFailedError: string;
|
|
1063
|
-
/**
|
|
1063
|
+
/** Shown when saving the application fails. */
|
|
1064
1064
|
genericRetryError: string;
|
|
1065
|
+
/** Shown when deleting the application fails. */
|
|
1066
|
+
deleteFailedError?: string;
|
|
1065
1067
|
/** Shown when the close prompt's "Save changes" has nothing valid to write. */
|
|
1066
1068
|
saveDraftNothingValidError: string;
|
|
1067
1069
|
/** Used when init has no bank name for disclaimers / result branding. */
|
|
@@ -1107,10 +1107,12 @@ interface BankAccountOnboardingWidgetLabels {
|
|
|
1107
1107
|
personalReviewSubtitle: string;
|
|
1108
1108
|
/** Accessible title for the onboarding modal. */
|
|
1109
1109
|
modalTitle: string;
|
|
1110
|
-
/**
|
|
1110
|
+
/** Shown when submitting the application fails. */
|
|
1111
1111
|
submitFailedError: string;
|
|
1112
|
-
/**
|
|
1112
|
+
/** Shown when saving the application fails. */
|
|
1113
1113
|
genericRetryError: string;
|
|
1114
|
+
/** Shown when deleting the application fails. */
|
|
1115
|
+
deleteFailedError?: string;
|
|
1114
1116
|
/** Shown when the close prompt's "Save changes" has nothing valid to write. */
|
|
1115
1117
|
saveDraftNothingValidError: string;
|
|
1116
1118
|
/** Used when init has no bank name for disclaimers / result branding. */
|
|
@@ -2,153 +2,153 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { ErrorState as i } from "../../../../../shared/ui/dist/lib/ErrorState/ErrorState.js";
|
|
5
|
+
import { personDisclosure as e } from "../../../../../shared/data-access/dist/lib/disclosures/personDisclosure.js";
|
|
6
|
+
import { useAcceptWidgetDisclosures as t } from "../../../../../shared/data-access/dist/lib/disclosures/useAcceptWidgetDisclosures.js";
|
|
7
|
+
import { useDisclosuresQuery as n } from "../../../../../shared/data-access/dist/lib/disclosures/useDisclosuresQuery.js";
|
|
8
|
+
import { ErrorState as r } from "../../../../../shared/ui/dist/lib/ErrorState/ErrorState.js";
|
|
10
9
|
import "../../../../../shared/ui/dist/index.js";
|
|
11
|
-
import { useAnalyticsTrack as
|
|
12
|
-
import { WidgetProvider as
|
|
13
|
-
import { useRefetchWidget as
|
|
10
|
+
import { useAnalyticsTrack as i } from "../../../../../shared/feature/dist/lib/analytics/hooks.js";
|
|
11
|
+
import { WidgetProvider as a } from "../../../../../shared/feature/dist/lib/WidgetProvider/WidgetProvider.js";
|
|
12
|
+
import { useRefetchWidget as o, useWidgetConfig as s, useWidgetInitStaleForToken as c } from "../../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
14
13
|
import "../../../../../shared/feature/dist/index.js";
|
|
15
|
-
import { AcceptDisclosuresWidgetAnalyticsEvent as
|
|
16
|
-
import { mergeAcceptDisclosuresWidgetLabels as
|
|
17
|
-
import { AcceptDisclosuresWidget as
|
|
14
|
+
import { AcceptDisclosuresWidgetAnalyticsEvent as l, WIDGET_NAME as u } from "../analytics/events.js";
|
|
15
|
+
import { mergeAcceptDisclosuresWidgetLabels as d } from "../../../../ui/dist/lib/AcceptDisclosuresWidget/labels.js";
|
|
16
|
+
import { AcceptDisclosuresWidget as f } from "../../../../ui/dist/lib/AcceptDisclosuresWidget/AcceptDisclosuresWidget.js";
|
|
18
17
|
import "../../../../ui/dist/index.js";
|
|
19
|
-
import { resolveAcceptDisclosuresContent as
|
|
20
|
-
import { acceptDisclosuresWidgetTestIds as
|
|
18
|
+
import { resolveAcceptDisclosuresContent as p } from "./resolveAcceptDisclosuresContent.js";
|
|
19
|
+
import { acceptDisclosuresWidgetTestIds as m } from "./testIds.js";
|
|
21
20
|
import "../../../../data-access/dist/index.js";
|
|
22
|
-
import { useCallback as
|
|
23
|
-
import { Fragment as
|
|
21
|
+
import { useCallback as h, useEffect as g, useRef as _, useState as v } from "react";
|
|
22
|
+
import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
24
23
|
//#region ../../libs/tesouro-embedded-components-react/accept-disclosures-widget/feature/dist/lib/AcceptDisclosuresWidget/AcceptDisclosuresWidget.js
|
|
25
|
-
function
|
|
26
|
-
return /* @__PURE__ */
|
|
24
|
+
function S(e, t, n) {
|
|
25
|
+
return /* @__PURE__ */ x(y, { children: [
|
|
27
26
|
n.providerAttributionPrefix,
|
|
28
|
-
/* @__PURE__ */
|
|
27
|
+
/* @__PURE__ */ b("strong", { children: e }),
|
|
29
28
|
n.providerAttributionMiddle,
|
|
30
29
|
t,
|
|
31
30
|
n.providerAttributionSuffix
|
|
32
31
|
] });
|
|
33
32
|
}
|
|
34
|
-
function
|
|
35
|
-
let
|
|
36
|
-
if (
|
|
37
|
-
|
|
38
|
-
}, [
|
|
39
|
-
title:
|
|
40
|
-
description:
|
|
41
|
-
retryLabel:
|
|
33
|
+
function C({ labels: t, onAccepted: a }) {
|
|
34
|
+
let o = i(), { initResponse: u } = s(), f = c(), m = d(t), { data: h, isError: _, refetch: v } = n({ userId: u?.userId ?? void 0 });
|
|
35
|
+
if (g(() => {
|
|
36
|
+
o(l.Mounted);
|
|
37
|
+
}, [o]), _) return /* @__PURE__ */ b(r, {
|
|
38
|
+
title: m.loadErrorTitle,
|
|
39
|
+
description: m.loadErrorFallback,
|
|
40
|
+
retryLabel: m.loadErrorRetryLabel,
|
|
42
41
|
onRetry: () => {
|
|
43
|
-
|
|
42
|
+
v();
|
|
44
43
|
},
|
|
45
44
|
testId: "accept-disclosures-load-error"
|
|
46
45
|
});
|
|
47
|
-
let
|
|
48
|
-
documents:
|
|
49
|
-
vspName:
|
|
50
|
-
bankName:
|
|
51
|
-
labels:
|
|
46
|
+
let y = e(h), x = p({
|
|
47
|
+
documents: h ? y?.documents ?? [] : void 0,
|
|
48
|
+
vspName: u?.vspName,
|
|
49
|
+
bankName: u?.bankName,
|
|
50
|
+
labels: t
|
|
52
51
|
});
|
|
53
|
-
if (!
|
|
54
|
-
let
|
|
55
|
-
if (
|
|
56
|
-
let
|
|
57
|
-
return /* @__PURE__ */
|
|
58
|
-
displayedVersion:
|
|
59
|
-
labelOverrides:
|
|
60
|
-
content:
|
|
61
|
-
labels:
|
|
62
|
-
onAccepted:
|
|
63
|
-
onDisclosuresVersionChanged:
|
|
64
|
-
},
|
|
52
|
+
if (!x) return null;
|
|
53
|
+
let S = y?.disclosureId ?? null;
|
|
54
|
+
if (f) return null;
|
|
55
|
+
let C = `${`user:${u?.userId ?? ""}`}:${S}:${x.vspName}:${x.bankName}:${x.agreementText}:${x.disclosureLinks.map((e) => e.href).join("|")}`;
|
|
56
|
+
return /* @__PURE__ */ b(w, {
|
|
57
|
+
displayedVersion: S,
|
|
58
|
+
labelOverrides: t,
|
|
59
|
+
content: x,
|
|
60
|
+
labels: m,
|
|
61
|
+
onAccepted: a,
|
|
62
|
+
onDisclosuresVersionChanged: v
|
|
63
|
+
}, C);
|
|
65
64
|
}
|
|
66
|
-
function
|
|
67
|
-
let [
|
|
68
|
-
|
|
69
|
-
}, []),
|
|
70
|
-
if (!(!
|
|
71
|
-
|
|
65
|
+
function w({ displayedVersion: e, labelOverrides: n, content: r, labels: i, onAccepted: a, onDisclosuresVersionChanged: s }) {
|
|
66
|
+
let [c, l] = v(!1), [u, d] = v(), [p, g] = v(!1), [y, x] = v(!1), C = _(!1), { mutateAsync: w } = t(), T = o(), E = h((e) => {
|
|
67
|
+
d(void 0), l(e);
|
|
68
|
+
}, []), D = h(async () => {
|
|
69
|
+
if (!(!c || p || y)) {
|
|
70
|
+
d(void 0), g(!0);
|
|
72
71
|
try {
|
|
73
|
-
if (!
|
|
74
|
-
await
|
|
75
|
-
} catch (
|
|
76
|
-
if (
|
|
77
|
-
|
|
72
|
+
if (!C.current) try {
|
|
73
|
+
await w({ displayedVersion: e }), C.current = !0;
|
|
74
|
+
} catch (e) {
|
|
75
|
+
if (e instanceof Error && e.name === "DisclosuresVersionChangedError") {
|
|
76
|
+
d(i.disclosuresUpdatedFallback), s();
|
|
78
77
|
return;
|
|
79
78
|
}
|
|
80
|
-
|
|
79
|
+
d(i.acceptErrorFallback);
|
|
81
80
|
return;
|
|
82
81
|
}
|
|
83
82
|
try {
|
|
84
|
-
await
|
|
85
|
-
} catch
|
|
86
|
-
|
|
83
|
+
await a?.();
|
|
84
|
+
} catch {
|
|
85
|
+
d(i.continuationErrorFallback);
|
|
87
86
|
return;
|
|
88
87
|
}
|
|
89
|
-
|
|
88
|
+
T(), x(!0);
|
|
90
89
|
} finally {
|
|
91
|
-
|
|
90
|
+
g(!1);
|
|
92
91
|
}
|
|
93
92
|
}
|
|
94
93
|
}, [
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
l,
|
|
99
|
-
m,
|
|
100
|
-
a.acceptErrorFallback,
|
|
101
|
-
a.disclosuresUpdatedFallback,
|
|
102
|
-
o,
|
|
94
|
+
w,
|
|
95
|
+
e,
|
|
96
|
+
y,
|
|
103
97
|
c,
|
|
104
|
-
|
|
98
|
+
p,
|
|
99
|
+
i.acceptErrorFallback,
|
|
100
|
+
i.continuationErrorFallback,
|
|
101
|
+
i.disclosuresUpdatedFallback,
|
|
102
|
+
a,
|
|
103
|
+
s,
|
|
104
|
+
T
|
|
105
105
|
]);
|
|
106
|
-
return /* @__PURE__ */
|
|
106
|
+
return /* @__PURE__ */ b(f, {
|
|
107
107
|
labels: {
|
|
108
|
-
...
|
|
109
|
-
title:
|
|
110
|
-
agreementCheckboxAriaLabel:
|
|
108
|
+
...n,
|
|
109
|
+
title: r.title,
|
|
110
|
+
agreementCheckboxAriaLabel: r.agreementCheckboxAriaLabel
|
|
111
111
|
},
|
|
112
|
-
providerAttribution:
|
|
113
|
-
agreementText:
|
|
114
|
-
disclosureLinks:
|
|
115
|
-
isAgreed:
|
|
116
|
-
onAgreedChange:
|
|
112
|
+
providerAttribution: S(r.vspName, r.bankName, i),
|
|
113
|
+
agreementText: r.agreementText,
|
|
114
|
+
disclosureLinks: r.disclosureLinks,
|
|
115
|
+
isAgreed: c,
|
|
116
|
+
onAgreedChange: E,
|
|
117
117
|
onAccept: () => {
|
|
118
|
-
|
|
118
|
+
D();
|
|
119
119
|
},
|
|
120
|
-
isSubmitting:
|
|
121
|
-
isAccepted:
|
|
122
|
-
errorMessage:
|
|
120
|
+
isSubmitting: p,
|
|
121
|
+
isAccepted: y,
|
|
122
|
+
errorMessage: u,
|
|
123
123
|
testIds: {
|
|
124
|
-
root:
|
|
125
|
-
providerAttribution:
|
|
126
|
-
disclosureLinks:
|
|
127
|
-
agreeCheckbox:
|
|
128
|
-
agreementText:
|
|
129
|
-
acceptButton:
|
|
130
|
-
error:
|
|
124
|
+
root: m.root,
|
|
125
|
+
providerAttribution: m.providerAttribution,
|
|
126
|
+
disclosureLinks: m.disclosureLinks,
|
|
127
|
+
agreeCheckbox: m.agreeCheckbox,
|
|
128
|
+
agreementText: m.agreementText,
|
|
129
|
+
acceptButton: m.acceptButton,
|
|
130
|
+
error: m.error
|
|
131
131
|
}
|
|
132
132
|
});
|
|
133
133
|
}
|
|
134
|
-
function
|
|
135
|
-
return /* @__PURE__ */
|
|
136
|
-
widgetName:
|
|
134
|
+
function T({ baseUrl: e, widgetToken: t, organizationId: n, configClient: r, gatewayRouting: i, linkComponent: o, implementation: s, uiFramework: c, errorFallback: l, onError: d, analytics: f, disclosuresAcceptance: p, providerLabels: m, ...h }) {
|
|
135
|
+
return /* @__PURE__ */ b(a, {
|
|
136
|
+
widgetName: u,
|
|
137
137
|
baseUrl: e,
|
|
138
138
|
widgetToken: t,
|
|
139
139
|
organizationId: n,
|
|
140
140
|
configClient: r,
|
|
141
141
|
gatewayRouting: i,
|
|
142
|
-
linkComponent:
|
|
142
|
+
linkComponent: o,
|
|
143
143
|
implementation: s,
|
|
144
144
|
uiFramework: c,
|
|
145
145
|
errorFallback: l,
|
|
146
|
-
onError:
|
|
146
|
+
onError: d,
|
|
147
147
|
analytics: f,
|
|
148
148
|
disclosuresAcceptance: p,
|
|
149
149
|
providerLabels: m,
|
|
150
|
-
children: /* @__PURE__ */
|
|
150
|
+
children: /* @__PURE__ */ b(C, { ...h })
|
|
151
151
|
});
|
|
152
152
|
}
|
|
153
153
|
//#endregion
|
|
154
|
-
export {
|
|
154
|
+
export { T as AcceptDisclosuresWidget };
|
|
@@ -4,6 +4,7 @@ var e = {
|
|
|
4
4
|
acceptButton: "Accept",
|
|
5
5
|
agreementCheckboxAriaLabel: "Agree to banking disclosures",
|
|
6
6
|
acceptErrorFallback: "Failed to accept disclosures",
|
|
7
|
+
continuationErrorFallback: "Disclosures accepted, but we could not continue. Please try again.",
|
|
7
8
|
agreementTextTemplate: "I agree to {bankName}'s {documents}.",
|
|
8
9
|
providerAttributionPrefix: "Banking services for ",
|
|
9
10
|
providerAttributionMiddle: " are provided by ",
|