@tesouro/embedded-components-react 0.5.123 → 0.5.124

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.
@@ -25,7 +25,7 @@ var h = u({
25
25
  isRowClickable: !1,
26
26
  onViewAllAccountsClicked: () => {}
27
27
  }), g = () => f(h), _ = ({ children: u, maxAccounts: f, onBalanceRowClick: g, onViewAllAccountsClick: _ }) => {
28
- let { data: v, isLoading: y, isError: b, refetch: x, hasNextPage: S, isFetchingNextPage: C } = t(), { initResponse: w } = s(), T = l(), E = c(), D = o(), O = T || y, k = !!E || b, A = d(() => {
28
+ let { data: v, isLoading: y, isError: b, refetch: x, hasNextPage: S, isFetchingNextPage: C } = t(), { initResponse: w } = s(), T = l(), E = c(), D = o(), O = T && !w || y, k = !!E || b, A = d(() => {
29
29
  D(), E || x();
30
30
  }, [
31
31
  D,
@@ -4,32 +4,30 @@
4
4
  "use client";
5
5
  import { getBankAccounts as e } from "../rest/sdk.gen.js";
6
6
  import { getBankAccountsOptions as t } from "../rest/@tanstack/react-query.gen.js";
7
- import { useEmbedApi as n } from "../EmbedApiContext.js";
8
- import { organizationHeaders as r } from "../organizationHeaders.js";
9
- import { getAllPagesNextPageParam as i, useAutoFetchNextPage as a } from "../allPages.js";
10
- import { useMemo as o } from "react";
11
- import { useInfiniteQuery as s } from "@tanstack/react-query";
7
+ import { useAuthEpochPlaceholder as n } from "../withAuthEpoch.js";
8
+ import { useEmbedApi as r } from "../EmbedApiContext.js";
9
+ import { organizationHeaders as i } from "../organizationHeaders.js";
10
+ import { getAllPagesNextPageParam as a, useAutoFetchNextPage as o } from "../allPages.js";
11
+ import { useMemo as s } from "react";
12
+ import { useInfiniteQuery as c } from "@tanstack/react-query";
12
13
  //#region ../../libs/tesouro-embedded-components-react/shared/data-access/dist/lib/bank-account/useAllBankAccountsQuery.js
13
- var c = 100;
14
- function l({ enabled: l } = {}) {
15
- let { client: u, organizationId: d, widgetToken: f, authEpoch: p } = n(), m = r(d), h = !!(d && f) && (l === !0 || l === void 0), g = t({
16
- client: u,
17
- headers: m,
18
- query: { limit: c }
19
- }), _ = s({
20
- queryKey: [
21
- ...g.queryKey,
22
- "all",
23
- { authEpoch: p }
24
- ],
25
- enabled: h,
14
+ var l = 100;
15
+ function u({ enabled: u } = {}) {
16
+ let { client: d, organizationId: f, widgetToken: p, authEpoch: m } = r(), h = i(f), g = !!(f && p) && (u === !0 || u === void 0), _ = [...t({
17
+ client: d,
18
+ headers: h,
19
+ query: { limit: l }
20
+ }).queryKey, "all"], v = n(f ? _ : void 0), y = c({
21
+ queryKey: [..._, { authEpoch: m }],
22
+ placeholderData: v,
23
+ enabled: g,
26
24
  initialPageParam: void 0,
27
25
  queryFn: async ({ signal: t, pageParam: n }) => {
28
26
  let { data: r } = await e({
29
- client: u,
30
- headers: m,
27
+ client: d,
28
+ headers: h,
31
29
  query: {
32
- limit: c,
30
+ limit: l,
33
31
  ...n ? { pagination_token: n } : {}
34
32
  },
35
33
  signal: t,
@@ -37,20 +35,20 @@ function l({ enabled: l } = {}) {
37
35
  });
38
36
  return r;
39
37
  },
40
- getNextPageParam: i
38
+ getNextPageParam: a
41
39
  });
42
- a(_, h);
43
- let v = o(() => {
44
- if (_.data) return {
45
- data: _.data.pages.flatMap((e) => e.data ?? []),
40
+ o(y, g);
41
+ let b = s(() => {
42
+ if (y.data) return {
43
+ data: y.data.pages.flatMap((e) => e.data ?? []),
46
44
  nextPaginationToken: null,
47
45
  prevPaginationToken: null
48
46
  };
49
- }, [_.data]);
47
+ }, [y.data]);
50
48
  return {
51
- ..._,
52
- data: v
49
+ ...y,
50
+ data: b
53
51
  };
54
52
  }
55
53
  //#endregion
56
- export { l as useAllBankAccountsQuery };
54
+ export { u as useAllBankAccountsQuery };
@@ -1,11 +1,16 @@
1
+ import { useMemo as e } from "react";
1
2
  //#region ../../libs/tesouro-embedded-components-react/shared/data-access/dist/lib/withAuthEpoch.js
2
- var e = (e) => e;
3
- function t(t, n) {
3
+ var t = (e) => e;
4
+ function n(t) {
5
+ let n = t && JSON.stringify(t);
6
+ return e(() => (e, t) => n === void 0 || t && JSON.stringify(t.queryKey.slice(0, -1)) === n ? e : void 0, [n]);
7
+ }
8
+ function r(e, n) {
4
9
  return {
5
- placeholderData: e,
6
- ...t,
7
- queryKey: [...t.queryKey, { authEpoch: n }]
10
+ placeholderData: t,
11
+ ...e,
12
+ queryKey: [...e.queryKey, { authEpoch: n }]
8
13
  };
9
14
  }
10
15
  //#endregion
11
- export { t as withAuthEpoch };
16
+ export { n as useAuthEpochPlaceholder, r as withAuthEpoch };
@@ -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.5.123", n = "e92880e7f411d0e09b599e39a5bd3d28d319b2eb", r = Object.freeze({
2
+ var e = "@tesouro/embedded-components-react", t = "0.5.124", n = "02feefabf2c21972814adc66f109f8a70b35b66e", r = Object.freeze({
3
3
  library_name: e,
4
4
  library_version: t,
5
5
  library_sha: n
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tesouro/embedded-components-react",
3
- "version": "0.5.123",
3
+ "version": "0.5.124",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "packageDepSync": {