@tesouro/embedded-components-react 0.2.323 → 0.2.325

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 (39) hide show
  1. package/README.md +20 -25
  2. package/dist/experimental/WidgetSuite.d.ts +5 -5
  3. package/dist/experimental/index.d.ts +5 -5
  4. package/dist/index.css +53 -0
  5. package/dist/index.d.ts +21 -41
  6. package/dist/lib/AcceptDisclosuresWidget.d.ts +14 -34
  7. package/dist/lib/BalancesWidget.d.ts +5 -5
  8. package/dist/lib/BankAccountOnboardingWidget.d.ts +5 -5
  9. package/dist/lib/BankAccountsWidget.d.ts +5 -5
  10. package/dist/lib/BillPayWidget.d.ts +5 -5
  11. package/dist/lib/CardDetailsWidget.d.ts +5 -5
  12. package/dist/lib/CardsWidget.d.ts +5 -5
  13. package/dist/lib/ChartOfAccountsWidget.d.ts +5 -5
  14. package/dist/lib/CounterpartsWidget.d.ts +5 -5
  15. package/dist/lib/CreateCardWidget.d.ts +5 -5
  16. package/dist/lib/ExpenseApprovalPoliciesWidget.d.ts +5 -5
  17. package/dist/lib/ExpenseManagementWidget.d.ts +5 -5
  18. package/dist/lib/ExpenseRequirementsWidget.d.ts +5 -5
  19. package/dist/lib/HelpWidget.d.ts +5 -5
  20. package/dist/lib/InsightsWidget.d.ts +5 -5
  21. package/dist/lib/InvoicingWidget.d.ts +5 -5
  22. package/dist/lib/LinkedAccountsWidget.d.ts +5 -5
  23. package/dist/lib/ProductsWidget.d.ts +5 -5
  24. package/dist/lib/ProfileWidget.d.ts +5 -5
  25. package/dist/lib/ReceiptMatchWidget.d.ts +5 -5
  26. package/dist/lib/ReceivablesWidget.d.ts +5 -5
  27. package/dist/lib/SettingsWidget.d.ts +5 -5
  28. package/dist/lib/TagsWidget.d.ts +5 -5
  29. package/dist/lib/TeamWidget.d.ts +5 -5
  30. package/dist/lib/TransfersWidget.d.ts +5 -5
  31. package/dist/lib/WidgetProvider.d.ts +12 -12
  32. package/dist/lib/WidgetProviderPublic.d.ts +5 -5
  33. package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/feature/dist/index4.js +57 -68
  34. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/disclosures/useDisclosuresQuery.js +2 -4
  35. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/WidgetProvider.js +79 -80
  36. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/isDisclosuresAcceptanceRequired.js +1 -4
  37. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  38. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index3.js +1 -1
  39. package/package.json +2 -1
@@ -4,30 +4,30 @@
4
4
  "use client";
5
5
  import { registerQueryClient as e, unregisterQueryClient as t } from "../../../../data-access/dist/lib/clientRegistry.js";
6
6
  import { createEmbeddedClient as n } from "../../../../data-access/dist/lib/createEmbeddedClient.js";
7
- import { EmbedApiProvider as r, useEmbedApi as ee } from "../../../../data-access/dist/lib/EmbedApiContext.js";
7
+ import { EmbedApiProvider as ee, useEmbedApi as te } from "../../../../data-access/dist/lib/EmbedApiContext.js";
8
8
  import "../../../../data-access/dist/index.js";
9
- import { getGlobalSnapshot as te, subscribeToGlobal as ne } from "./globalStore.js";
10
- import { configureEmbeddedClient as re } from "../analytics/client.js";
11
- import { generateCorrelationId as ie } from "../analytics/ids.js";
12
- import { WidgetContext as ae } from "./WidgetContext.js";
13
- import { noop as oe, resolveOrgId as se, useAuthEpoch as ce } from "./utils.js";
14
- import { useWidgetFetch as le } from "./useWidgetFetch.js";
15
- import { deriveWidgetInitState as ue, useWidgetInitPublisher as de } from "./useWidgetInitPublisher.js";
16
- import { resolveUIFramework as fe } from "../../../../ui/dist/lib/UIContext/UIContext.js";
17
- import { UIProvider as pe } from "../../../../ui/dist/lib/UIContext/UIProvider.js";
18
- import { useDesignSystemEnsurer as me, useFrameworkRenderer as he } from "../../../../ui/dist/lib/UIContext/uiRendererRegistry.js";
19
- import { HostIsolationScope as ge } from "../../../../ui/dist/lib/HostIsolationScope/HostIsolationScope.js";
20
- import { ErrorState as i } from "../../../../ui/dist/lib/ErrorState/ErrorState.js";
9
+ import { getGlobalSnapshot as ne, subscribeToGlobal as re } from "./globalStore.js";
10
+ import { configureEmbeddedClient as ie } from "../analytics/client.js";
11
+ import { generateCorrelationId as r } from "../analytics/ids.js";
12
+ import { WidgetContext as i } from "./WidgetContext.js";
13
+ import { noop as ae, resolveOrgId as oe, useAuthEpoch as se } from "./utils.js";
14
+ import { useWidgetFetch as ce } from "./useWidgetFetch.js";
15
+ import { deriveWidgetInitState as le, useWidgetInitPublisher as ue } from "./useWidgetInitPublisher.js";
16
+ import { resolveUIFramework as de } from "../../../../ui/dist/lib/UIContext/UIContext.js";
17
+ import { UIProvider as fe } from "../../../../ui/dist/lib/UIContext/UIProvider.js";
18
+ import { useDesignSystemEnsurer as pe, useFrameworkRenderer as me } from "../../../../ui/dist/lib/UIContext/uiRendererRegistry.js";
19
+ import { HostIsolationScope as he } from "../../../../ui/dist/lib/HostIsolationScope/HostIsolationScope.js";
20
+ import { ErrorState as a } from "../../../../ui/dist/lib/ErrorState/ErrorState.js";
21
21
  import "../../../../ui/dist/index.js";
22
- import { DEFAULT_LABELS as a } from "./labels.js";
23
- import { WidgetErrorBoundary as _e } from "./WidgetErrorBoundary.js";
24
- import { DISCLOSURES_REQUIRED_TEST_ID as o, isAuthenticatedDisclosuresReacceptance as s, shouldGateOnDisclosuresAcceptance as ve } from "./isDisclosuresAcceptanceRequired.js";
25
- import { useContext as ye, useEffect as c, useMemo as l, useRef as u, useState as d, useSyncExternalStore as be } from "react";
22
+ import { DEFAULT_LABELS as o } from "./labels.js";
23
+ import { WidgetErrorBoundary as ge } from "./WidgetErrorBoundary.js";
24
+ import { DISCLOSURES_REQUIRED_TEST_ID as s, shouldGateOnDisclosuresAcceptance as _e } from "./isDisclosuresAcceptanceRequired.js";
25
+ import { useContext as ve, useEffect as c, useMemo as l, useRef as u, useState as d, useSyncExternalStore as ye } from "react";
26
26
  import { jsx as f } from "react/jsx-runtime";
27
- import { QueryClient as xe, QueryClientProvider as Se } from "@tanstack/react-query";
27
+ import { QueryClient as be, QueryClientProvider as xe } from "@tanstack/react-query";
28
28
  //#region ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/WidgetProvider.js
29
- function p({ children: he, baseUrl: i, widgetToken: a, organizationId: o, configClient: s, gatewayRouting: p, linkComponent: m, uiFramework: h, implementation: g, errorFallback: we, onError: Te, analytics: _, disclosuresAcceptance: Ee, widgetName: v }) {
30
- let y = ye(ae), b = be(ne, te, te), x = y?.resolved ?? b, De = y?.refetch ?? oe, Oe = y?.loading ?? !1, ke = y?.error ?? null, S = i ?? x.baseUrl, C = a === void 0 ? x.widgetToken : a, Ae = y ? y.cascadeOrgId : b.organizationId, w = o === void 0 ? Ae : o, T = s ?? x.configClient, E = p ?? x.gatewayRouting, D = m ?? x.linkComponent, O = h ?? x.uiFramework, k = g ?? x.implementation, A = Ee ?? y?.disclosuresAcceptance, j = y === null, M = j ? _ !== !1 : y.analytics.enabled, [je] = d(ie), N = j ? je : y.analytics.rootCorrelationId, [Me] = d(ie), P = v === void 0 ? y?.analytics.widgetName : v, F = v === void 0 ? y?.analytics.widgetInstanceId : Me, I = u({
29
+ function p({ children: me, baseUrl: a, widgetToken: o, organizationId: s, configClient: p, gatewayRouting: m, linkComponent: h, uiFramework: g, implementation: _, errorFallback: Ce, onError: we, analytics: v, disclosuresAcceptance: Te, widgetName: y }) {
30
+ let b = ve(i), Ee = ye(re, ne, ne), x = b?.resolved ?? Ee, De = b?.refetch ?? ae, Oe = b?.loading ?? !1, ke = b?.error ?? null, S = a ?? x.baseUrl, C = o === void 0 ? x.widgetToken : o, Ae = b ? b.cascadeOrgId : Ee.organizationId, w = s === void 0 ? Ae : s, T = p ?? x.configClient, E = m ?? x.gatewayRouting, D = h ?? x.linkComponent, O = g ?? x.uiFramework, k = _ ?? x.implementation, A = Te ?? b?.disclosuresAcceptance, j = b === null, M = j ? v !== !1 : b.analytics.enabled, [je] = d(r), N = j ? je : b.analytics.rootCorrelationId, [Me] = d(r), P = y === void 0 ? b?.analytics.widgetName : y, F = y === void 0 ? b?.analytics.widgetInstanceId : Me, I = u({
31
31
  enabled: M,
32
32
  organizationId: w,
33
33
  rootCorrelationId: N,
@@ -35,8 +35,8 @@ function p({ children: he, baseUrl: i, widgetToken: a, organizationId: o, config
35
35
  widgetInstanceId: F
36
36
  }), Ne = u(!1);
37
37
  c(() => {
38
- j || _ === void 0 || Ne.current || (Ne.current = !0, console.warn("[tesouro-embedded] `analytics` on a nested WidgetProvider is ignored in v1. Set it on the outermost RootWidgetProvider or standalone WidgetProvider instead."));
39
- }, [_, j]), c(() => {
38
+ j || v === void 0 || Ne.current || (Ne.current = !0, console.warn("[tesouro-embedded] `analytics` on a nested WidgetProvider is ignored in v1. Set it on the outermost RootWidgetProvider or standalone WidgetProvider instead."));
39
+ }, [v, j]), c(() => {
40
40
  if (!j || !M || !("window" in globalThis)) return;
41
41
  let e = !1;
42
42
  return import("../analytics/install.js").then(({ ensureAnalyticsAdapterInstalled: t }) => {
@@ -45,41 +45,41 @@ function p({ children: he, baseUrl: i, widgetToken: a, organizationId: o, config
45
45
  e = !0;
46
46
  };
47
47
  }, [j, M]);
48
- let L = me(fe(O));
48
+ let L = pe(de(O));
49
49
  c(() => {
50
50
  L && L().catch(() => {});
51
51
  }, [L]);
52
- let R = y === null || i !== void 0 || a !== void 0 || o !== void 0 || s != null || p !== void 0 || v !== void 0, z = u(C);
53
- z.current = C;
54
- let Pe = ee(), Fe = ce(C), B = l(() => {
55
- if (!R) return null;
56
- let e = re(n(S), {
57
- tokenRef: z,
52
+ let Pe = b === null || a !== void 0 || o !== void 0 || s !== void 0 || p != null || m !== void 0 || y !== void 0, R = u(C);
53
+ R.current = C;
54
+ let Fe = te(), Ie = se(C), z = l(() => {
55
+ if (!Pe) return null;
56
+ let e = ie(n(S), {
57
+ tokenRef: R,
58
58
  analyticsContextRef: I,
59
59
  gatewayRouting: E
60
60
  });
61
61
  return T ? T(e) : e;
62
62
  }, [
63
- R,
63
+ Pe,
64
64
  S,
65
65
  T,
66
66
  E
67
- ]), V = y === null || i !== void 0 || a !== void 0, Ie = V ? Fe : Pe.authEpoch, { result: H, loading: U, error: W, clearedForAuthChange: Le, initStaleForToken: G, refetch: Re } = le(V ? B : null, V ? C : void 0, I), K = V ? Re : De, q = V ? U : Oe, J = V ? W : ke, ze = y?.resolved.initResponse, Be = !V || !Le && !W && !H && !!C && !U, Y = Be ? ze : H ?? void 0, X = Be ? V || (y?.initResponseStaleForToken ?? !1) : G, Ve = y === null, He = l(() => Ve ? ue({
67
+ ]), B = b === null || a !== void 0 || o !== void 0, Le = B ? Ie : Fe.authEpoch, { result: V, loading: H, error: U, clearedForAuthChange: Re, initStaleForToken: W, refetch: ze } = ce(B ? z : null, B ? C : void 0, I), G = B ? ze : De, K = B ? H : Oe, q = B ? U : ke, Be = b?.resolved.initResponse, J = !B || !Re && !U && !V && !!C && !H, Y = J ? Be : V ?? void 0, X = J ? B || (b?.initResponseStaleForToken ?? !1) : W, Ve = b === null, He = l(() => Ve ? le({
68
68
  hasToken: !!C,
69
- loading: U,
70
- error: W,
71
- initResponse: H ?? void 0,
72
- initStaleForToken: G
69
+ loading: H,
70
+ error: U,
71
+ initResponse: V ?? void 0,
72
+ initStaleForToken: W
73
73
  }) : null, [
74
74
  Ve,
75
75
  C,
76
- U,
77
- W,
78
76
  H,
79
- G
77
+ U,
78
+ V,
79
+ W
80
80
  ]);
81
- de(He, C);
82
- let Z = se(w, X ? void 0 : Y?.organizationId), Q = l(() => ({
81
+ ue(He, C);
82
+ let Z = oe(w, X ? void 0 : Y?.organizationId), Q = l(() => ({
83
83
  enabled: M,
84
84
  organizationId: Z,
85
85
  rootCorrelationId: N,
@@ -93,7 +93,7 @@ function p({ children: he, baseUrl: i, widgetToken: a, organizationId: o, config
93
93
  F
94
94
  ]);
95
95
  I.current = Q;
96
- let [$] = d(() => y === null ? new xe({ defaultOptions: {
96
+ let [$] = d(() => b === null ? new be({ defaultOptions: {
97
97
  queries: {
98
98
  retry: !1,
99
99
  refetchOnWindowFocus: !1
@@ -106,23 +106,23 @@ function p({ children: he, baseUrl: i, widgetToken: a, organizationId: o, config
106
106
  return e(n), () => t(n);
107
107
  }, [$]);
108
108
  let Ue = l(() => ({
109
- baseUrl: i,
110
- widgetToken: a,
111
- organizationId: o,
112
- configClient: s,
113
- gatewayRouting: p,
114
- linkComponent: m,
115
- uiFramework: h,
116
- implementation: g
109
+ baseUrl: a,
110
+ widgetToken: o,
111
+ organizationId: s,
112
+ configClient: p,
113
+ gatewayRouting: m,
114
+ linkComponent: h,
115
+ uiFramework: g,
116
+ implementation: _
117
117
  }), [
118
- i,
119
118
  a,
120
119
  o,
121
120
  s,
122
121
  p,
123
122
  m,
124
123
  h,
125
- g
124
+ g,
125
+ _
126
126
  ]), We = l(() => ({
127
127
  baseUrl: S,
128
128
  widgetToken: C,
@@ -146,9 +146,9 @@ function p({ children: he, baseUrl: i, widgetToken: a, organizationId: o, config
146
146
  ]), Ge = l(() => ({
147
147
  resolved: We,
148
148
  own: Ue,
149
- refetch: K,
150
- loading: q,
151
- error: J,
149
+ refetch: G,
150
+ loading: K,
151
+ error: q,
152
152
  analytics: Q,
153
153
  cascadeOrgId: w,
154
154
  initResponseStaleForToken: X,
@@ -156,56 +156,55 @@ function p({ children: he, baseUrl: i, widgetToken: a, organizationId: o, config
156
156
  }), [
157
157
  We,
158
158
  Ue,
159
+ G,
159
160
  K,
160
161
  q,
161
- J,
162
162
  Q,
163
163
  w,
164
164
  X,
165
165
  A
166
- ]), Ke = /* @__PURE__ */ f(ae.Provider, {
166
+ ]), Ke = /* @__PURE__ */ f(i.Provider, {
167
167
  value: Ge,
168
- children: /* @__PURE__ */ f(pe, {
168
+ children: /* @__PURE__ */ f(fe, {
169
169
  linkComponent: D,
170
170
  uiFramework: O,
171
- children: /* @__PURE__ */ f(ge, { children: /* @__PURE__ */ f(_e, {
171
+ children: /* @__PURE__ */ f(he, { children: /* @__PURE__ */ f(ge, {
172
172
  resetKeys: [C],
173
- errorFallback: we,
174
- onError: Te,
175
- children: ve(Y, v) ? /* @__PURE__ */ f(Ce, {
176
- init: Y,
173
+ errorFallback: Ce,
174
+ onError: we,
175
+ children: _e(Y, y) ? /* @__PURE__ */ f(Se, {
177
176
  disclosuresAcceptance: A,
178
177
  initStaleForToken: X
179
- }) : he
178
+ }) : me
180
179
  }) })
181
180
  })
182
- }), qe = B ? /* @__PURE__ */ f(r, {
183
- client: B,
181
+ }), qe = z ? /* @__PURE__ */ f(ee, {
182
+ client: z,
184
183
  organizationId: Z,
185
184
  widgetToken: C,
186
- authEpoch: Ie,
185
+ authEpoch: Le,
187
186
  children: Ke
188
187
  }) : Ke;
189
- return $ ? /* @__PURE__ */ f(Se, {
188
+ return $ ? /* @__PURE__ */ f(xe, {
190
189
  client: $,
191
190
  children: qe
192
191
  }) : qe;
193
192
  }
194
- function Ce({ init: e, disclosuresAcceptance: t, initStaleForToken: n }) {
195
- let r = he("error-state") ?? i;
196
- return n ? /* @__PURE__ */ f(r, {
197
- title: a.disclosuresRefreshingTitle,
198
- description: a.disclosuresRefreshingDescription,
199
- testId: o,
193
+ function Se({ disclosuresAcceptance: e, initStaleForToken: t }) {
194
+ let n = me("error-state") ?? a;
195
+ return t ? /* @__PURE__ */ f(n, {
196
+ title: o.disclosuresRefreshingTitle,
197
+ description: o.disclosuresRefreshingDescription,
198
+ testId: s,
200
199
  className: "ttw:w-full ttw:rounded-xl ttw:border ttw:border-border ttw:bg-card ttw:py-7 ttw:text-card-foreground ttw:shadow-sm"
201
- }) : s(e) && t != null ? /* @__PURE__ */ f("div", {
202
- "data-testid": o,
203
- className: "ttw:w-full",
204
- children: t
205
- }) : /* @__PURE__ */ f(r, {
206
- title: a.disclosuresRequiredTitle,
207
- testId: o,
200
+ }) : e == null ? /* @__PURE__ */ f(n, {
201
+ title: o.disclosuresRequiredTitle,
202
+ testId: s,
208
203
  className: "ttw:w-full ttw:rounded-xl ttw:border ttw:border-border ttw:bg-card ttw:py-7 ttw:text-card-foreground ttw:shadow-sm"
204
+ }) : /* @__PURE__ */ f("div", {
205
+ "data-testid": s,
206
+ className: "ttw:w-full",
207
+ children: e
209
208
  });
210
209
  }
211
210
  //#endregion
@@ -13,8 +13,5 @@ function r(e) {
13
13
  function i(e, t) {
14
14
  return t !== void 0 && n(e) && !r(t);
15
15
  }
16
- function a(e) {
17
- return n(e) && e?.status === "ACTIVE";
18
- }
19
16
  //#endregion
20
- export { e as DISCLOSURES_REQUIRED_TEST_ID, a as isAuthenticatedDisclosuresReacceptance, n as isDisclosuresAcceptanceRequired, r as isDisclosuresGateExempt, i as shouldGateOnDisclosuresAcceptance };
17
+ export { e as DISCLOSURES_REQUIRED_TEST_ID, n as isDisclosuresAcceptanceRequired, r as isDisclosuresGateExempt, i as shouldGateOnDisclosuresAcceptance };
@@ -1,5 +1,5 @@
1
1
  //#region ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
2
- var e = "@tesouro/embedded-components-react", t = "0.2.323", n = "bca8b1f1ee001a1b0da8bb03d910813284be7971", r = Object.freeze({
2
+ var e = "@tesouro/embedded-components-react", t = "0.2.325", n = "cb1d36c4ebe94147e9bbf06c18f5f5b1c3b5965a", r = Object.freeze({
3
3
  library_name: e,
4
4
  library_version: t,
5
5
  library_sha: n
@@ -1,6 +1,6 @@
1
1
  //#region ../../libs/tesouro-embedded-components-react/widget-suite/feature/dist/index3.js
2
2
  function e(e) {
3
- return e ? e.disclosuresRequired === "REQUIRED" && !e.disclosuresAccepted : !1;
3
+ return e ? e.status === "INVITED" || e.disclosuresRequired === "REQUIRED" && !e.disclosuresAccepted : !1;
4
4
  }
5
5
  //#endregion
6
6
  export { e as needsDisclosureAcceptance };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tesouro/embedded-components-react",
3
- "version": "0.2.323",
3
+ "version": "0.2.325",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "packageDepSync": {
@@ -185,6 +185,7 @@
185
185
  "react-pdf": "^10.4.1",
186
186
  "react-script-hook": "^1.7.2",
187
187
  "react-use": "^17.6.1",
188
+ "react-webcam": "^7.2.0",
188
189
  "sonner": "^2.0.8",
189
190
  "tailwind-merge": "^3.6.0",
190
191
  "tailwind-variants": "^3.3.1",