@tesouro/embedded-components-react 0.5.197 → 0.5.200
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 +9 -1
- package/dist/lib/ReceivablesWidget.d.ts +9 -1
- package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/data-access/dist/index.js +4 -3
- package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/feature/dist/index5.js +78 -77
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index25.js +258 -257
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index13.js +4 -4
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index6.js +8 -4
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index.js +4 -4
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index13.js +62 -380
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index14.js +369 -89
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index15.js +73 -60
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index16.js +80 -331
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index17.js +344 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index2.js +10 -2
- package/dist/libs/tesouro-embedded-components-react/shared/bank-disclosures/feature/dist/lib/BankDisclosuresWidget/collectDisclosureDocuments.js +3 -4
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +6 -5
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/disclosures/personDisclosure.js +6 -0
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/disclosures/useAcceptWidgetDisclosures.js +20 -19
- package/dist/libs/tesouro-embedded-components-react/shared/data-access-mocks/dist/lib/fixtures.js +27 -11
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/dist/packages/shared-ui-shadcn/dist/index.js +1263 -1256
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -4903,7 +4903,6 @@ interface ReceivableFormSheetLabels {
|
|
|
4903
4903
|
currencyLabel: string;
|
|
4904
4904
|
issueDateLabel: string;
|
|
4905
4905
|
dueDateLabel: string;
|
|
4906
|
-
memoLabel: string;
|
|
4907
4906
|
paymentTermsLabel: string;
|
|
4908
4907
|
paymentTermsPlaceholder: string;
|
|
4909
4908
|
paymentTermsNone: string;
|
|
@@ -4923,6 +4922,15 @@ interface ReceivableFormSheetLabels {
|
|
|
4923
4922
|
cancelButton: string;
|
|
4924
4923
|
createButton: string;
|
|
4925
4924
|
updateButton: string;
|
|
4925
|
+
notesHeading: string;
|
|
4926
|
+
notesDescription: string;
|
|
4927
|
+
optionalSuffix: string;
|
|
4928
|
+
openingNoteLabel: string;
|
|
4929
|
+
openingNotePlaceholder: string;
|
|
4930
|
+
openingNoteDescription: string;
|
|
4931
|
+
closingNoteLabel: string;
|
|
4932
|
+
closingNotePlaceholder: string;
|
|
4933
|
+
closingNoteDescription: string;
|
|
4926
4934
|
}
|
|
4927
4935
|
interface ReceivableDetailsSheetLabels {
|
|
4928
4936
|
hiddenDescription: string;
|
|
@@ -947,7 +947,6 @@ interface ReceivableFormSheetLabels {
|
|
|
947
947
|
currencyLabel: string;
|
|
948
948
|
issueDateLabel: string;
|
|
949
949
|
dueDateLabel: string;
|
|
950
|
-
memoLabel: string;
|
|
951
950
|
paymentTermsLabel: string;
|
|
952
951
|
paymentTermsPlaceholder: string;
|
|
953
952
|
paymentTermsNone: string;
|
|
@@ -967,6 +966,15 @@ interface ReceivableFormSheetLabels {
|
|
|
967
966
|
cancelButton: string;
|
|
968
967
|
createButton: string;
|
|
969
968
|
updateButton: string;
|
|
969
|
+
notesHeading: string;
|
|
970
|
+
notesDescription: string;
|
|
971
|
+
optionalSuffix: string;
|
|
972
|
+
openingNoteLabel: string;
|
|
973
|
+
openingNotePlaceholder: string;
|
|
974
|
+
openingNoteDescription: string;
|
|
975
|
+
closingNoteLabel: string;
|
|
976
|
+
closingNotePlaceholder: string;
|
|
977
|
+
closingNoteDescription: string;
|
|
970
978
|
}
|
|
971
979
|
interface ReceivableDetailsSheetLabels {
|
|
972
980
|
hiddenDescription: string;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { personDisclosure as e } from "../../../shared/data-access/dist/lib/disclosures/personDisclosure.js";
|
|
2
|
+
import { useAcceptWidgetDisclosures as t } from "../../../shared/data-access/dist/lib/disclosures/useAcceptWidgetDisclosures.js";
|
|
3
|
+
import { useDisclosuresQuery as n } from "../../../shared/data-access/dist/lib/disclosures/useDisclosuresQuery.js";
|
|
3
4
|
import "../../../shared/data-access/dist/index.js";
|
|
4
|
-
export { e as
|
|
5
|
+
export { e as personDisclosure, t as useAcceptWidgetDisclosures, n as useDisclosuresQuery };
|
package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/feature/dist/index5.js
CHANGED
|
@@ -3,112 +3,113 @@
|
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
5
|
import { extractApiErrorMessage as e } from "../../../shared/util/dist/lib/apiErrors.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
6
|
+
import { personDisclosure as t } from "../../../shared/data-access/dist/lib/disclosures/personDisclosure.js";
|
|
7
|
+
import { useAcceptWidgetDisclosures as n } from "../../../shared/data-access/dist/lib/disclosures/useAcceptWidgetDisclosures.js";
|
|
8
|
+
import { useDisclosuresQuery as r } from "../../../shared/data-access/dist/lib/disclosures/useDisclosuresQuery.js";
|
|
9
|
+
import { ErrorState as i } from "../../../shared/ui/dist/lib/ErrorState/ErrorState.js";
|
|
9
10
|
import "../../../shared/ui/dist/index.js";
|
|
10
|
-
import { useAnalyticsTrack as
|
|
11
|
-
import { WidgetProvider as
|
|
12
|
-
import { useRefetchWidget as
|
|
11
|
+
import { useAnalyticsTrack as a } from "../../../shared/feature/dist/lib/analytics/hooks.js";
|
|
12
|
+
import { WidgetProvider as o } from "../../../shared/feature/dist/lib/WidgetProvider/WidgetProvider.js";
|
|
13
|
+
import { useRefetchWidget as s, useWidgetConfig as c, useWidgetInitStaleForToken as l } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
13
14
|
import "../../../shared/feature/dist/index.js";
|
|
14
|
-
import { AcceptDisclosuresWidgetAnalyticsEvent as
|
|
15
|
-
import { mergeAcceptDisclosuresWidgetLabels as
|
|
16
|
-
import { AcceptDisclosuresWidget as
|
|
15
|
+
import { AcceptDisclosuresWidgetAnalyticsEvent as u, WIDGET_NAME as d } from "./index2.js";
|
|
16
|
+
import { mergeAcceptDisclosuresWidgetLabels as f } from "../../ui/dist/lib/AcceptDisclosuresWidget/labels.js";
|
|
17
|
+
import { AcceptDisclosuresWidget as p } from "../../ui/dist/lib/AcceptDisclosuresWidget/AcceptDisclosuresWidget.js";
|
|
17
18
|
import "../../ui/dist/index.js";
|
|
18
|
-
import { resolveAcceptDisclosuresContent as
|
|
19
|
-
import { acceptDisclosuresWidgetTestIds as
|
|
19
|
+
import { resolveAcceptDisclosuresContent as m } from "./index3.js";
|
|
20
|
+
import { acceptDisclosuresWidgetTestIds as h } from "./index4.js";
|
|
20
21
|
import "../../data-access/dist/index.js";
|
|
21
|
-
import { useCallback as
|
|
22
|
-
import { Fragment as
|
|
22
|
+
import { useCallback as g, useEffect as _, useRef as v, useState as y } from "react";
|
|
23
|
+
import { Fragment as b, jsx as x, jsxs as S } from "react/jsx-runtime";
|
|
23
24
|
//#region ../../libs/tesouro-embedded-components-react/accept-disclosures-widget/feature/dist/index5.js
|
|
24
|
-
function
|
|
25
|
-
return /* @__PURE__ */
|
|
25
|
+
function C(e, t, n) {
|
|
26
|
+
return /* @__PURE__ */ S(b, { children: [
|
|
26
27
|
n.providerAttributionPrefix,
|
|
27
|
-
/* @__PURE__ */
|
|
28
|
+
/* @__PURE__ */ x("strong", { children: e }),
|
|
28
29
|
n.providerAttributionMiddle,
|
|
29
30
|
t,
|
|
30
31
|
n.providerAttributionSuffix
|
|
31
32
|
] });
|
|
32
33
|
}
|
|
33
|
-
function
|
|
34
|
-
let
|
|
35
|
-
if (
|
|
36
|
-
|
|
37
|
-
}, [
|
|
38
|
-
title:
|
|
39
|
-
description: e(
|
|
40
|
-
retryLabel:
|
|
34
|
+
function w({ labels: n, onAccepted: o }) {
|
|
35
|
+
let s = a(), { initResponse: d } = c(), p = l(), h = f(n), { data: g, isError: v, error: y, refetch: b } = r({ userId: d?.userId ?? void 0 });
|
|
36
|
+
if (_(() => {
|
|
37
|
+
s(u.Mounted);
|
|
38
|
+
}, [s]), v) return /* @__PURE__ */ x(i, {
|
|
39
|
+
title: h.loadErrorTitle,
|
|
40
|
+
description: e(y) ?? h.loadErrorFallback,
|
|
41
|
+
retryLabel: h.loadErrorRetryLabel,
|
|
41
42
|
onRetry: () => {
|
|
42
|
-
|
|
43
|
+
b();
|
|
43
44
|
},
|
|
44
45
|
testId: "accept-disclosures-load-error"
|
|
45
46
|
});
|
|
46
|
-
let
|
|
47
|
-
documents:
|
|
48
|
-
vspName:
|
|
49
|
-
bankName:
|
|
50
|
-
labels:
|
|
47
|
+
let S = t(g), C = m({
|
|
48
|
+
documents: g ? S?.documents ?? [] : void 0,
|
|
49
|
+
vspName: d?.vspName,
|
|
50
|
+
bankName: d?.bankName,
|
|
51
|
+
labels: n
|
|
51
52
|
});
|
|
52
|
-
if (!
|
|
53
|
-
let
|
|
54
|
-
if (
|
|
55
|
-
let
|
|
56
|
-
return /* @__PURE__ */
|
|
57
|
-
displayedVersion:
|
|
58
|
-
labelOverrides:
|
|
59
|
-
content:
|
|
60
|
-
labels:
|
|
61
|
-
onAccepted:
|
|
62
|
-
onDisclosuresVersionChanged:
|
|
63
|
-
},
|
|
53
|
+
if (!C) return null;
|
|
54
|
+
let w = S?.disclosureId ?? null;
|
|
55
|
+
if (p) return null;
|
|
56
|
+
let E = `${`user:${d?.userId ?? ""}`}:${w}:${C.vspName}:${C.bankName}:${C.agreementText}:${C.disclosureLinks.map((e) => e.href).join("|")}`;
|
|
57
|
+
return /* @__PURE__ */ x(T, {
|
|
58
|
+
displayedVersion: w,
|
|
59
|
+
labelOverrides: n,
|
|
60
|
+
content: C,
|
|
61
|
+
labels: h,
|
|
62
|
+
onAccepted: o,
|
|
63
|
+
onDisclosuresVersionChanged: b
|
|
64
|
+
}, E);
|
|
64
65
|
}
|
|
65
|
-
function
|
|
66
|
-
let [l, u] =
|
|
67
|
-
|
|
68
|
-
}, []), O =
|
|
69
|
-
if (!(!l ||
|
|
70
|
-
|
|
66
|
+
function T({ displayedVersion: t, labelOverrides: r, content: i, labels: a, onAccepted: o, onDisclosuresVersionChanged: c }) {
|
|
67
|
+
let [l, u] = y(!1), [d, f] = y(), [m, _] = y(!1), [b, S] = y(!1), w = v(!1), { mutateAsync: T } = n(), E = s(), D = g((e) => {
|
|
68
|
+
f(void 0), u(e);
|
|
69
|
+
}, []), O = g(async () => {
|
|
70
|
+
if (!(!l || m || b)) {
|
|
71
|
+
f(void 0), _(!0);
|
|
71
72
|
try {
|
|
72
73
|
if (!w.current) try {
|
|
73
|
-
await T({ displayedVersion:
|
|
74
|
+
await T({ displayedVersion: t }), w.current = !0;
|
|
74
75
|
} catch (t) {
|
|
75
76
|
if (t instanceof Error && t.name === "DisclosuresVersionChangedError") {
|
|
76
|
-
|
|
77
|
+
f(a.disclosuresUpdatedFallback), c();
|
|
77
78
|
return;
|
|
78
79
|
}
|
|
79
|
-
|
|
80
|
+
f(e(t) ?? a.acceptErrorFallback);
|
|
80
81
|
return;
|
|
81
82
|
}
|
|
82
83
|
try {
|
|
83
|
-
await
|
|
84
|
+
await o?.();
|
|
84
85
|
} catch (t) {
|
|
85
|
-
|
|
86
|
+
f(e(t) ?? a.acceptErrorFallback);
|
|
86
87
|
return;
|
|
87
88
|
}
|
|
88
|
-
E(),
|
|
89
|
+
E(), S(!0);
|
|
89
90
|
} finally {
|
|
90
|
-
|
|
91
|
+
_(!1);
|
|
91
92
|
}
|
|
92
93
|
}
|
|
93
94
|
}, [
|
|
94
95
|
T,
|
|
95
|
-
|
|
96
|
-
|
|
96
|
+
t,
|
|
97
|
+
b,
|
|
97
98
|
l,
|
|
98
|
-
|
|
99
|
+
m,
|
|
99
100
|
a.acceptErrorFallback,
|
|
100
101
|
a.disclosuresUpdatedFallback,
|
|
101
|
-
|
|
102
|
+
o,
|
|
102
103
|
c,
|
|
103
104
|
E
|
|
104
105
|
]);
|
|
105
|
-
return /* @__PURE__ */
|
|
106
|
+
return /* @__PURE__ */ x(p, {
|
|
106
107
|
labels: {
|
|
107
108
|
...r,
|
|
108
109
|
title: i.title,
|
|
109
110
|
agreementCheckboxAriaLabel: i.agreementCheckboxAriaLabel
|
|
110
111
|
},
|
|
111
|
-
providerAttribution:
|
|
112
|
+
providerAttribution: C(i.vspName, i.bankName, a),
|
|
112
113
|
agreementText: i.agreementText,
|
|
113
114
|
disclosureLinks: i.disclosureLinks,
|
|
114
115
|
isAgreed: l,
|
|
@@ -116,38 +117,38 @@ function w({ displayedVersion: n, labelOverrides: r, content: i, labels: a, onAc
|
|
|
116
117
|
onAccept: () => {
|
|
117
118
|
O();
|
|
118
119
|
},
|
|
119
|
-
isSubmitting:
|
|
120
|
-
isAccepted:
|
|
120
|
+
isSubmitting: m,
|
|
121
|
+
isAccepted: b,
|
|
121
122
|
errorMessage: d,
|
|
122
123
|
testIds: {
|
|
123
|
-
root:
|
|
124
|
-
providerAttribution:
|
|
125
|
-
disclosureLinks:
|
|
126
|
-
agreeCheckbox:
|
|
127
|
-
agreementText:
|
|
128
|
-
acceptButton:
|
|
129
|
-
error:
|
|
124
|
+
root: h.root,
|
|
125
|
+
providerAttribution: h.providerAttribution,
|
|
126
|
+
disclosureLinks: h.disclosureLinks,
|
|
127
|
+
agreeCheckbox: h.agreeCheckbox,
|
|
128
|
+
agreementText: h.agreementText,
|
|
129
|
+
acceptButton: h.acceptButton,
|
|
130
|
+
error: h.error
|
|
130
131
|
}
|
|
131
132
|
});
|
|
132
133
|
}
|
|
133
|
-
function
|
|
134
|
-
return /* @__PURE__ */
|
|
135
|
-
widgetName:
|
|
134
|
+
function E({ baseUrl: e, widgetToken: t, organizationId: n, configClient: r, gatewayRouting: i, linkComponent: a, implementation: s, uiFramework: c, errorFallback: l, onError: u, analytics: f, disclosuresAcceptance: p, providerLabels: m, ...h }) {
|
|
135
|
+
return /* @__PURE__ */ x(o, {
|
|
136
|
+
widgetName: d,
|
|
136
137
|
baseUrl: e,
|
|
137
138
|
widgetToken: t,
|
|
138
139
|
organizationId: n,
|
|
139
140
|
configClient: r,
|
|
140
141
|
gatewayRouting: i,
|
|
141
|
-
linkComponent:
|
|
142
|
+
linkComponent: a,
|
|
142
143
|
implementation: s,
|
|
143
144
|
uiFramework: c,
|
|
144
145
|
errorFallback: l,
|
|
145
|
-
onError:
|
|
146
|
+
onError: u,
|
|
146
147
|
analytics: f,
|
|
147
148
|
disclosuresAcceptance: p,
|
|
148
149
|
providerLabels: m,
|
|
149
|
-
children: /* @__PURE__ */
|
|
150
|
+
children: /* @__PURE__ */ x(w, { ...h })
|
|
150
151
|
});
|
|
151
152
|
}
|
|
152
153
|
//#endregion
|
|
153
|
-
export {
|
|
154
|
+
export { E as AcceptDisclosuresWidget };
|