@tesouro/embedded-components-react 0.5.198 → 0.5.201
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 +4 -0
- package/dist/index.js +1 -1
- package/dist/lib/ReceivablesWidget.d.ts +4 -0
- package/dist/lib/ReceivablesWidget.js +1 -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/index.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index10.js +47 -250
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index11.js +267 -65
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index12.js +66 -105
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index13.js +103 -214
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index14.js +226 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index5.js +67 -37
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index6.js +83 -79
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index14.js +207 -172
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index2.js +4 -0
- 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/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -4915,6 +4915,10 @@ interface ReceivableFormSheetLabels {
|
|
|
4915
4915
|
unitNone: string;
|
|
4916
4916
|
manageUnitsOption: string;
|
|
4917
4917
|
priceLabel: string;
|
|
4918
|
+
taxableLabel: string;
|
|
4919
|
+
taxRateLabel: string;
|
|
4920
|
+
taxRatePlaceholder: string;
|
|
4921
|
+
taxRateSuffix: string;
|
|
4918
4922
|
decreaseQuantityButton: string;
|
|
4919
4923
|
increaseQuantityButton: string;
|
|
4920
4924
|
addLineItemButton: string;
|
package/dist/index.js
CHANGED
|
@@ -27,7 +27,7 @@ import { InsightsWidget as L } from "./libs/tesouro-embedded-components-react/in
|
|
|
27
27
|
import { UploadReceiptWidget as R } from "./libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index2.js";
|
|
28
28
|
import { ExpenseManagementWidget as z } from "./libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index21.js";
|
|
29
29
|
import { InvoicingWidget as B } from "./libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index3.js";
|
|
30
|
-
import { ReceivablesWidget as V } from "./libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/
|
|
30
|
+
import { ReceivablesWidget as V } from "./libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index14.js";
|
|
31
31
|
import { SettingsSection as H } from "./libs/tesouro-embedded-components-react/settings-widget/feature/dist/index4.js";
|
|
32
32
|
import { HELP_FAQ_EN as U } from "./libs/tesouro-embedded-components-react/settings-widget/help/ui/contract/dist/index3.js";
|
|
33
33
|
import { SettingsWidget as W } from "./libs/tesouro-embedded-components-react/settings-widget/feature/dist/index6.js";
|
|
@@ -959,6 +959,10 @@ interface ReceivableFormSheetLabels {
|
|
|
959
959
|
unitNone: string;
|
|
960
960
|
manageUnitsOption: string;
|
|
961
961
|
priceLabel: string;
|
|
962
|
+
taxableLabel: string;
|
|
963
|
+
taxRateLabel: string;
|
|
964
|
+
taxRatePlaceholder: string;
|
|
965
|
+
taxRateSuffix: string;
|
|
962
966
|
decreaseQuantityButton: string;
|
|
963
967
|
increaseQuantityButton: string;
|
|
964
968
|
addLineItemButton: string;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { ReceivablesWidget as e } from "../libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/
|
|
1
|
+
import { ReceivablesWidget as e } from "../libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index14.js";
|
|
2
2
|
import "../libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index.js";
|
|
3
3
|
export { e as ReceivablesWidget };
|
|
@@ -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 };
|