@tesouro/embedded-components-react 0.5.27 → 0.5.28
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.css +6 -6
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index128.js +3 -0
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index186.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index197.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index495.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index503.js +291 -351
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index506.js +13 -21
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index507.js +30 -30
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index509.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index615.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/package.json +1 -1
|
@@ -1,22 +1,14 @@
|
|
|
1
1
|
import { useEffect as e, useState as t } from "react";
|
|
2
2
|
//#region ../../libs/tesouro-embedded-components-react/monite-sdk/dist/index506.js
|
|
3
3
|
var n = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
inches: {
|
|
13
|
-
width: 8.27,
|
|
14
|
-
height: 11.69
|
|
15
|
-
}
|
|
16
|
-
}, r = () => {
|
|
17
|
-
let [r, i] = t({
|
|
18
|
-
width: 794,
|
|
19
|
-
height: 1123,
|
|
4
|
+
width: 8.5,
|
|
5
|
+
height: 11
|
|
6
|
+
}, r = {
|
|
7
|
+
width: 816,
|
|
8
|
+
height: 1056
|
|
9
|
+
}, i = () => {
|
|
10
|
+
let [i, a] = t({
|
|
11
|
+
...r,
|
|
20
12
|
dpi: 96
|
|
21
13
|
});
|
|
22
14
|
return e(() => {
|
|
@@ -36,12 +28,12 @@ var n = {
|
|
|
36
28
|
t = n;
|
|
37
29
|
break;
|
|
38
30
|
}
|
|
39
|
-
let r = window.devicePixelRatio || 1,
|
|
31
|
+
let r = window.devicePixelRatio || 1, i = t * r, o = document.createElement("div");
|
|
40
32
|
o.style.width = "1in", o.style.height = "1in", o.style.position = "absolute", o.style.left = "-9999px", document.body.appendChild(o);
|
|
41
33
|
let s = o.getBoundingClientRect(), c = Math.round(s.width);
|
|
42
34
|
document.body.removeChild(o);
|
|
43
|
-
let l = c > 0 ? c :
|
|
44
|
-
|
|
35
|
+
let l = c > 0 ? c : i, u = Math.round(n.width * l), d = Math.round(n.height * l);
|
|
36
|
+
a({
|
|
45
37
|
width: u,
|
|
46
38
|
height: d,
|
|
47
39
|
dpi: l
|
|
@@ -50,7 +42,7 @@ var n = {
|
|
|
50
42
|
return e(), window.addEventListener("resize", e), () => {
|
|
51
43
|
window.removeEventListener("resize", e);
|
|
52
44
|
};
|
|
53
|
-
}, []),
|
|
45
|
+
}, []), i;
|
|
54
46
|
};
|
|
55
47
|
//#endregion
|
|
56
|
-
export { r as
|
|
48
|
+
export { r as LETTER_PX, i as useLetterDimensions };
|
|
@@ -2,47 +2,47 @@ import { useIsMounted as e } from "./index28.js";
|
|
|
2
2
|
import "./index216.js";
|
|
3
3
|
import { useResizeObserver as t } from "./index504.js";
|
|
4
4
|
import { useWindowResize as n } from "./index505.js";
|
|
5
|
-
import {
|
|
6
|
-
import { useCallback as
|
|
5
|
+
import { LETTER_PX as r, useLetterDimensions as i } from "./index506.js";
|
|
6
|
+
import { useCallback as a, useEffect as o, useRef as s, useState as c } from "react";
|
|
7
7
|
//#region ../../libs/tesouro-embedded-components-react/monite-sdk/dist/index507.js
|
|
8
|
-
var
|
|
9
|
-
let { minWidth:
|
|
10
|
-
if (!
|
|
11
|
-
let e =
|
|
12
|
-
if (t <= 0 || n <= 0 ||
|
|
13
|
-
|
|
8
|
+
var l = (l, u, d = {}) => {
|
|
9
|
+
let { minWidth: f, minHeight: p, containerPadding: m = 96, minScale: h = 1, initialDelay: g = 100, useAdaptiveDimensions: _ = !0 } = d, [v, y] = c(1), b = s(!1), x = e(), S = i(), C = f ?? (_ ? S.width : r.width), w = p ?? (_ ? S.height : r.height), T = a(() => {
|
|
10
|
+
if (!l.current || !u.current || typeof window > "u" || !x.current) return;
|
|
11
|
+
let e = l.current, t = e.clientWidth - m, n = e.clientHeight - m;
|
|
12
|
+
if (t <= 0 || n <= 0 || C <= 0 || w <= 0) {
|
|
13
|
+
y(h);
|
|
14
14
|
return;
|
|
15
15
|
}
|
|
16
|
-
let r = t /
|
|
17
|
-
|
|
16
|
+
let r = t / C, i = n / w;
|
|
17
|
+
y(Math.max(Math.min(r, i), h));
|
|
18
18
|
}, [
|
|
19
|
-
c,
|
|
20
19
|
l,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
u,
|
|
21
|
+
x,
|
|
22
|
+
m,
|
|
24
23
|
C,
|
|
25
|
-
|
|
24
|
+
w,
|
|
25
|
+
h
|
|
26
26
|
]);
|
|
27
|
-
n(
|
|
28
|
-
let { observe:
|
|
29
|
-
return
|
|
27
|
+
n(T, 100);
|
|
28
|
+
let { observe: E, disconnect: D } = t(T, 50);
|
|
29
|
+
return o(() => {
|
|
30
30
|
if (typeof window > "u") return;
|
|
31
31
|
let e = setTimeout(() => {
|
|
32
|
-
|
|
33
|
-
},
|
|
34
|
-
return
|
|
35
|
-
clearTimeout(e),
|
|
32
|
+
T(), b.current = !0;
|
|
33
|
+
}, g);
|
|
34
|
+
return l.current && E(l.current), () => {
|
|
35
|
+
clearTimeout(e), D();
|
|
36
36
|
};
|
|
37
37
|
}, [
|
|
38
|
-
T,
|
|
39
38
|
E,
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
39
|
+
D,
|
|
40
|
+
g,
|
|
41
|
+
T,
|
|
42
|
+
l
|
|
43
|
+
]), o(() => {
|
|
44
|
+
l.current && b.current && E(l.current);
|
|
45
|
+
}, [l, E]), v;
|
|
46
46
|
};
|
|
47
47
|
//#endregion
|
|
48
|
-
export {
|
|
48
|
+
export { l as useAdaptiveScale };
|
|
@@ -29,8 +29,8 @@ var s = ({ address: s, counterpart: c, currency: l, invoiceData: u, entityData:
|
|
|
29
29
|
alignItems: "safe center"
|
|
30
30
|
},
|
|
31
31
|
children: /* @__PURE__ */ o(i, {
|
|
32
|
-
ratio:
|
|
33
|
-
className: e("ttw:max-w-[
|
|
32
|
+
ratio: 8.5 / 11,
|
|
33
|
+
className: e("ttw:max-w-[8.5in]", "ttw:min-w-[816px] ttw:min-h-[1056px]", "ttw:transition-transform ttw:duration-200 ttw:ease-in-out", "motion-reduce:ttw:transition-none", "ttw:origin-center", "ttw:shrink-0", "ttw:[contain:\"layout style\"]"),
|
|
34
34
|
style: { transform: `scale(${g})` },
|
|
35
35
|
children: /* @__PURE__ */ o("div", {
|
|
36
36
|
ref: m,
|