@tesouro/embedded-components-react 0.9.32 → 0.9.34
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 +1 -1
- package/dist/lib/ReceivablesWidget.d.ts +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useSendReceivableWithPaymentLink.js +28 -34
- 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
|
@@ -6228,7 +6228,7 @@ interface ReceivableMessageLabels {
|
|
|
6228
6228
|
actionsSendSucceeded: string;
|
|
6229
6229
|
actionsSendFailed: string;
|
|
6230
6230
|
actionsSendWithoutPaymentLink: string;
|
|
6231
|
-
/**
|
|
6231
|
+
/** @deprecated Unused: sending no longer checks a payment-link scope. Kept so existing overrides still compile. */
|
|
6232
6232
|
actionsSendWithoutPaymentLinkScope: string;
|
|
6233
6233
|
actionsTitleSent: string;
|
|
6234
6234
|
actionsTitleIssued: string;
|
|
@@ -1661,7 +1661,7 @@ interface ReceivableMessageLabels {
|
|
|
1661
1661
|
actionsSendSucceeded: string;
|
|
1662
1662
|
actionsSendFailed: string;
|
|
1663
1663
|
actionsSendWithoutPaymentLink: string;
|
|
1664
|
-
/**
|
|
1664
|
+
/** @deprecated Unused: sending no longer checks a payment-link scope. Kept so existing overrides still compile. */
|
|
1665
1665
|
actionsSendWithoutPaymentLinkScope: string;
|
|
1666
1666
|
actionsTitleSent: string;
|
|
1667
1667
|
actionsTitleIssued: string;
|
|
@@ -3,36 +3,32 @@
|
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
5
|
import { toast as e } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
6
|
-
import {
|
|
7
|
-
import { useMyEntityQuery as n } from "../../../../../shared/data-access/dist/lib/useMyEntityQuery.js";
|
|
8
|
-
import { Scope as r } from "../../../../../shared/data-access/dist/lib/scopes.js";
|
|
6
|
+
import { useMyEntityQuery as t } from "../../../../../shared/data-access/dist/lib/useMyEntityQuery.js";
|
|
9
7
|
import "../../../../../shared/data-access/dist/index.js";
|
|
10
8
|
import "../../../../../shared/ui/dist/index.js";
|
|
11
|
-
import {
|
|
12
|
-
import "
|
|
13
|
-
import {
|
|
14
|
-
import { useCreatePaymentLinkMutation as o } from "../../../../data-access/dist/index7.js";
|
|
15
|
-
import { useSendReceivableEmailMutation as s } from "../../../../data-access/dist/index10.js";
|
|
9
|
+
import { useEntityPaymentMethodsQuery as n } from "../../../../data-access/dist/index5.js";
|
|
10
|
+
import { useCreatePaymentLinkMutation as r } from "../../../../data-access/dist/index7.js";
|
|
11
|
+
import { useSendReceivableEmailMutation as i } from "../../../../data-access/dist/index10.js";
|
|
16
12
|
import "../../../../data-access/dist/index.js";
|
|
17
|
-
import { getReceivePaymentMethods as
|
|
18
|
-
import { useCallback as
|
|
13
|
+
import { getReceivePaymentMethods as a } from "./preview.js";
|
|
14
|
+
import { useCallback as o, useEffect as s, useRef as c } from "react";
|
|
19
15
|
//#region ../../libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useSendReceivableWithPaymentLink.js
|
|
20
|
-
function
|
|
21
|
-
let
|
|
22
|
-
entityId:
|
|
23
|
-
enabled:
|
|
24
|
-
}),
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}, [
|
|
28
|
-
let
|
|
16
|
+
function l({ messages: l, documentType: u }) {
|
|
17
|
+
let d = u === "invoice", f = t({ enabled: d }), p = f.data?.id, m = n({
|
|
18
|
+
entityId: p,
|
|
19
|
+
enabled: d
|
|
20
|
+
}), h = r(), g = i(), _ = f.error || m.error ? void 0 : m.data?.data, v = c(void 0);
|
|
21
|
+
s(() => {
|
|
22
|
+
u || (v.current = void 0);
|
|
23
|
+
}, [u]);
|
|
24
|
+
let y = h.mutateAsync, b = g.mutateAsync, x = l.actionsSendWithoutPaymentLink;
|
|
29
25
|
return {
|
|
30
|
-
send:
|
|
31
|
-
if (!
|
|
32
|
-
let n = t.path.receivable_id, r =
|
|
33
|
-
return !
|
|
26
|
+
send: o(async (t) => {
|
|
27
|
+
if (!d) return b(t);
|
|
28
|
+
let n = t.path.receivable_id, r = a(_);
|
|
29
|
+
return !p || r.length === 0 ? e.error(x) : v.current !== n && (await y({ body: {
|
|
34
30
|
recipient: {
|
|
35
|
-
id:
|
|
31
|
+
id: p,
|
|
36
32
|
type: "entity"
|
|
37
33
|
},
|
|
38
34
|
payment_methods: r.map((e) => e.type),
|
|
@@ -40,19 +36,17 @@ function f({ messages: f, documentType: p }) {
|
|
|
40
36
|
id: n,
|
|
41
37
|
type: "receivable"
|
|
42
38
|
}
|
|
43
|
-
} }),
|
|
39
|
+
} }), v.current = n), b(t);
|
|
44
40
|
}, [
|
|
45
|
-
|
|
46
|
-
T,
|
|
41
|
+
d,
|
|
47
42
|
y,
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
D
|
|
43
|
+
p,
|
|
44
|
+
_,
|
|
45
|
+
b,
|
|
46
|
+
x
|
|
53
47
|
]),
|
|
54
|
-
isPending:
|
|
48
|
+
isPending: d && (f.isFetching || m.isFetching) || h.isPending || g.isPending
|
|
55
49
|
};
|
|
56
50
|
}
|
|
57
51
|
//#endregion
|
|
58
|
-
export {
|
|
52
|
+
export { l as useSendReceivableWithPaymentLink };
|
package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
CHANGED
|
@@ -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.9.
|
|
2
|
+
var e = "@tesouro/embedded-components-react", t = "0.9.34", n = "84b5f60983c6f63de60bf7571c4265ad29fb7dff", r = Object.freeze({
|
|
3
3
|
library_name: e,
|
|
4
4
|
library_version: t,
|
|
5
5
|
library_sha: n
|