@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.
Files changed (22) hide show
  1. package/dist/index.d.ts +9 -1
  2. package/dist/lib/ReceivablesWidget.d.ts +9 -1
  3. package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/data-access/dist/index.js +4 -3
  4. package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/feature/dist/index5.js +78 -77
  5. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index25.js +258 -257
  6. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index13.js +4 -4
  7. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index6.js +8 -4
  8. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index.js +4 -4
  9. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index13.js +62 -380
  10. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index14.js +369 -89
  11. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index15.js +73 -60
  12. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index16.js +80 -331
  13. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index17.js +344 -0
  14. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index2.js +10 -2
  15. package/dist/libs/tesouro-embedded-components-react/shared/bank-disclosures/feature/dist/lib/BankDisclosuresWidget/collectDisclosureDocuments.js +3 -4
  16. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +6 -5
  17. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/disclosures/personDisclosure.js +6 -0
  18. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/disclosures/useAcceptWidgetDisclosures.js +20 -19
  19. package/dist/libs/tesouro-embedded-components-react/shared/data-access-mocks/dist/lib/fixtures.js +27 -11
  20. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  21. package/dist/packages/shared-ui-shadcn/dist/index.js +1263 -1256
  22. 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 { 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 };