@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.
Files changed (24) hide show
  1. package/dist/index.d.ts +4 -0
  2. package/dist/index.js +1 -1
  3. package/dist/lib/ReceivablesWidget.d.ts +4 -0
  4. package/dist/lib/ReceivablesWidget.js +1 -1
  5. package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/data-access/dist/index.js +4 -3
  6. package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/feature/dist/index5.js +78 -77
  7. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index25.js +258 -257
  8. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index.js +1 -1
  9. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index10.js +47 -250
  10. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index11.js +267 -65
  11. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index12.js +66 -105
  12. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index13.js +103 -214
  13. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index14.js +226 -0
  14. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index5.js +67 -37
  15. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index6.js +83 -79
  16. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index14.js +207 -172
  17. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index2.js +4 -0
  18. package/dist/libs/tesouro-embedded-components-react/shared/bank-disclosures/feature/dist/lib/BankDisclosuresWidget/collectDisclosureDocuments.js +3 -4
  19. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +6 -5
  20. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/disclosures/personDisclosure.js +6 -0
  21. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/disclosures/useAcceptWidgetDisclosures.js +20 -19
  22. package/dist/libs/tesouro-embedded-components-react/shared/data-access-mocks/dist/lib/fixtures.js +27 -11
  23. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  24. 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/index13.js";
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/index13.js";
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 { useAcceptWidgetDisclosures as e } from "../../../shared/data-access/dist/lib/disclosures/useAcceptWidgetDisclosures.js";
2
- import { useDisclosuresQuery as t } from "../../../shared/data-access/dist/lib/disclosures/useDisclosuresQuery.js";
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 useAcceptWidgetDisclosures, t as useDisclosuresQuery };
5
+ export { e as personDisclosure, t as useAcceptWidgetDisclosures, n as useDisclosuresQuery };
@@ -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 { 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";
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 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";
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 l, WIDGET_NAME as u } from "./index2.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";
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 p } from "./index3.js";
19
- import { acceptDisclosuresWidgetTestIds as m } from "./index4.js";
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 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";
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 S(e, t, n) {
25
- return /* @__PURE__ */ x(y, { children: [
25
+ function C(e, t, n) {
26
+ return /* @__PURE__ */ S(b, { children: [
26
27
  n.providerAttributionPrefix,
27
- /* @__PURE__ */ b("strong", { children: e }),
28
+ /* @__PURE__ */ x("strong", { children: e }),
28
29
  n.providerAttributionMiddle,
29
30
  t,
30
31
  n.providerAttributionSuffix
31
32
  ] });
32
33
  }
33
- function C({ labels: t, onAccepted: a }) {
34
- let o = i(), { initResponse: u } = s(), f = c(), m = d(t), { data: h, isError: _, error: v, refetch: y } = 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: e(v) ?? m.loadErrorFallback,
40
- retryLabel: m.loadErrorRetryLabel,
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
- y();
43
+ b();
43
44
  },
44
45
  testId: "accept-disclosures-load-error"
45
46
  });
46
- let x = p({
47
- documents: h?.documents,
48
- vspName: u?.vspName,
49
- bankName: u?.bankName,
50
- labels: t
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 (!x) return null;
53
- let S = h?.version ?? 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: y
63
- }, C);
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 w({ displayedVersion: n, labelOverrides: r, content: i, labels: a, onAccepted: s, onDisclosuresVersionChanged: c }) {
66
- let [l, u] = v(!1), [d, p] = v(), [g, y] = v(!1), [x, C] = v(!1), w = _(!1), { mutateAsync: T } = t(), E = o(), D = h((e) => {
67
- p(void 0), u(e);
68
- }, []), O = h(async () => {
69
- if (!(!l || g || x)) {
70
- p(void 0), y(!0);
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: n }), w.current = !0;
74
+ await T({ displayedVersion: t }), w.current = !0;
74
75
  } catch (t) {
75
76
  if (t instanceof Error && t.name === "DisclosuresVersionChangedError") {
76
- p(a.disclosuresUpdatedFallback), c();
77
+ f(a.disclosuresUpdatedFallback), c();
77
78
  return;
78
79
  }
79
- p(e(t) ?? a.acceptErrorFallback);
80
+ f(e(t) ?? a.acceptErrorFallback);
80
81
  return;
81
82
  }
82
83
  try {
83
- await s?.();
84
+ await o?.();
84
85
  } catch (t) {
85
- p(e(t) ?? a.acceptErrorFallback);
86
+ f(e(t) ?? a.acceptErrorFallback);
86
87
  return;
87
88
  }
88
- E(), C(!0);
89
+ E(), S(!0);
89
90
  } finally {
90
- y(!1);
91
+ _(!1);
91
92
  }
92
93
  }
93
94
  }, [
94
95
  T,
95
- n,
96
- x,
96
+ t,
97
+ b,
97
98
  l,
98
- g,
99
+ m,
99
100
  a.acceptErrorFallback,
100
101
  a.disclosuresUpdatedFallback,
101
- s,
102
+ o,
102
103
  c,
103
104
  E
104
105
  ]);
105
- return /* @__PURE__ */ b(f, {
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: S(i.vspName, i.bankName, a),
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: g,
120
- isAccepted: x,
120
+ isSubmitting: m,
121
+ isAccepted: b,
121
122
  errorMessage: d,
122
123
  testIds: {
123
- root: m.root,
124
- providerAttribution: m.providerAttribution,
125
- disclosureLinks: m.disclosureLinks,
126
- agreeCheckbox: m.agreeCheckbox,
127
- agreementText: m.agreementText,
128
- acceptButton: m.acceptButton,
129
- error: m.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 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 }) {
134
- return /* @__PURE__ */ b(a, {
135
- widgetName: u,
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: o,
142
+ linkComponent: a,
142
143
  implementation: s,
143
144
  uiFramework: c,
144
145
  errorFallback: l,
145
- onError: d,
146
+ onError: u,
146
147
  analytics: f,
147
148
  disclosuresAcceptance: p,
148
149
  providerLabels: m,
149
- children: /* @__PURE__ */ b(C, { ...h })
150
+ children: /* @__PURE__ */ x(w, { ...h })
150
151
  });
151
152
  }
152
153
  //#endregion
153
- export { T as AcceptDisclosuresWidget };
154
+ export { E as AcceptDisclosuresWidget };