@dotss/tictoccroc 0.0.33 → 0.0.35
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/shared/components/Image/Image.mjs +124 -123
- package/dist/shared/components/Masonry/Masonry.mjs +192 -185
- package/dist/shared/components/Masonry/Masonry.utils.d.ts +2 -0
- package/dist/shared/components/Masonry/Masonry.utils.mjs +57 -52
- package/dist/shared/components/Masonry/MasonryBlock/MasonryBlock.d.ts +7 -2
- package/dist/shared/components/Masonry/MasonryBlock/MasonryBlock.mjs +99 -94
- package/dist/shared/components/MediaDialog/MediaDialog.mjs +96 -95
- package/dist/shared/hooks/useInView/useInView.mjs +35 -17
- package/dist/shared/hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.d.ts +2 -2
- package/package.json +1 -1
|
@@ -1,132 +1,137 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { Flexbox as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { findImageInChildren as
|
|
7
|
-
|
|
1
|
+
import { jsxs as E, jsx as b } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as q, useMemo as D, useState as v, useRef as V, useImperativeHandle as $, useEffect as k, Children as z, isValidElement as G, cloneElement as J } from "react";
|
|
3
|
+
import { Flexbox as g, Skeleton as K } from "@dotss/ui";
|
|
4
|
+
import O from "@dotss/ui/core/useTheme";
|
|
5
|
+
import P from "../../Image/Image.mjs";
|
|
6
|
+
import { findImageInChildren as Q } from "../Masonry.utils.mjs";
|
|
7
|
+
import U from "../../../hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.mjs";
|
|
8
|
+
const a = q(
|
|
8
9
|
({
|
|
9
|
-
children:
|
|
10
|
-
width:
|
|
11
|
-
height:
|
|
12
|
-
spacing:
|
|
13
|
-
borderRadius:
|
|
14
|
-
direction:
|
|
10
|
+
children: u,
|
|
11
|
+
width: h = 0,
|
|
12
|
+
height: p = 0,
|
|
13
|
+
spacing: w = 2,
|
|
14
|
+
borderRadius: d = 0,
|
|
15
|
+
direction: C = "vertical",
|
|
15
16
|
setInnerRef: t,
|
|
16
|
-
|
|
17
|
+
sourceMetadataMap: S,
|
|
18
|
+
onLoad: T,
|
|
19
|
+
onManualLoad: l,
|
|
17
20
|
...e
|
|
18
|
-
},
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
(
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}, [
|
|
41
|
-
|
|
21
|
+
}, x) => {
|
|
22
|
+
const { spacing: j } = O(), r = D(() => {
|
|
23
|
+
var n, f;
|
|
24
|
+
return ((f = (n = Q(u)) == null ? void 0 : n.props) == null ? void 0 : f.src) ?? "";
|
|
25
|
+
}, [u]), i = S == null ? void 0 : S.get(r), [s, H] = v((i == null ? void 0 : i.width) ?? h ?? 0), [c, W] = v((i == null ? void 0 : i.height) ?? p ?? 0), [A, y] = v(!1), o = V(null), m = !r || !!r && A;
|
|
26
|
+
$(x, () => o.current);
|
|
27
|
+
const B = (n) => {
|
|
28
|
+
n.propertyName !== "padding-top" && n.propertyName !== "padding-left" || y(!0);
|
|
29
|
+
}, F = () => y(!0);
|
|
30
|
+
return U(() => {
|
|
31
|
+
if (!(i != null && i.loaded) && o.current && r) {
|
|
32
|
+
const n = o.current.querySelector("img");
|
|
33
|
+
if (!n || !n.complete) return;
|
|
34
|
+
const { naturalWidth: f, naturalHeight: I, src: N } = n;
|
|
35
|
+
l == null || l(f, I, N);
|
|
36
|
+
}
|
|
37
|
+
}, [r, i == null ? void 0 : i.loaded, l]), k(() => {
|
|
38
|
+
H((i == null ? void 0 : i.width) ?? h ?? 0), W((i == null ? void 0 : i.height) ?? p ?? 0);
|
|
39
|
+
}, [h, p, i == null ? void 0 : i.width, i == null ? void 0 : i.height]), k(() => {
|
|
40
|
+
if (!(i != null && i.loaded) || (i == null ? void 0 : i.width) !== s || (i == null ? void 0 : i.height) !== c) return;
|
|
41
|
+
const n = setTimeout(() => y(!0), 300);
|
|
42
|
+
return () => clearTimeout(n);
|
|
43
|
+
}, [i, s, c]), k(() => {
|
|
44
|
+
t == null || t(o.current);
|
|
45
|
+
}, [t]), /* @__PURE__ */ E(
|
|
46
|
+
g,
|
|
42
47
|
{
|
|
43
|
-
ref:
|
|
48
|
+
ref: o,
|
|
44
49
|
flexDirection: "column",
|
|
45
50
|
...e,
|
|
46
51
|
inlineCSS: {
|
|
52
|
+
contain: "content",
|
|
47
53
|
transform: "translate3d(0, 0, 0)",
|
|
48
54
|
breakInside: "avoid",
|
|
49
55
|
...e == null ? void 0 : e.inlineCSS
|
|
50
56
|
},
|
|
51
57
|
children: [
|
|
52
|
-
|
|
53
|
-
|
|
58
|
+
C === "vertical" && /* @__PURE__ */ b(
|
|
59
|
+
g,
|
|
54
60
|
{
|
|
55
61
|
inlineCSS: {
|
|
56
|
-
minHeight: j.content(
|
|
62
|
+
minHeight: j.content(w)
|
|
57
63
|
}
|
|
58
64
|
}
|
|
59
65
|
),
|
|
60
|
-
/* @__PURE__ */
|
|
61
|
-
|
|
66
|
+
/* @__PURE__ */ E(
|
|
67
|
+
g,
|
|
62
68
|
{
|
|
63
|
-
onTransitionEnd:
|
|
69
|
+
onTransitionEnd: B,
|
|
64
70
|
inlineCSS: {
|
|
65
71
|
position: "relative",
|
|
66
72
|
overflow: "hidden",
|
|
67
73
|
scrollbarWidth: "none",
|
|
74
|
+
borderRadius: d,
|
|
68
75
|
"&::-webkit-scrollbar": {
|
|
69
76
|
display: "none"
|
|
70
77
|
},
|
|
71
78
|
...e == null ? void 0 : e.inlineCSS
|
|
72
79
|
},
|
|
73
|
-
style:
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
transition: "padding-top 0.3s 0.1s"
|
|
80
|
+
style: C === "vertical" ? {
|
|
81
|
+
paddingTop: `calc(${c / s} * 100%)`,
|
|
82
|
+
transition: "padding-top 0.3s"
|
|
77
83
|
} : {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
transition: "padding-top 0.3s 0.1s, padding-left 0.3s 0.1s"
|
|
84
|
+
paddingLeft: s,
|
|
85
|
+
paddingTop: c,
|
|
86
|
+
transition: "padding-top 0.3s, padding-left 0.3s"
|
|
82
87
|
},
|
|
83
|
-
children:
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
borderRadius: o,
|
|
102
|
-
inlineCSS: {
|
|
103
|
-
position: "absolute",
|
|
104
|
-
top: 0,
|
|
105
|
-
left: 0,
|
|
106
|
-
width: "100%",
|
|
107
|
-
height: "100%",
|
|
108
|
-
opacity: !p || w ? 0 : 1,
|
|
109
|
-
transition: "opacity 0.3s 0.1s",
|
|
110
|
-
pointerEvents: w ? "none" : void 0,
|
|
111
|
-
zIndex: 2
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
),
|
|
115
|
-
z.toArray(s).filter(N).map((n) => n.type === $ || n.type === "img" ? D(n, {
|
|
116
|
-
width: g,
|
|
117
|
-
height: d,
|
|
88
|
+
children: [
|
|
89
|
+
/* @__PURE__ */ b(
|
|
90
|
+
g,
|
|
91
|
+
{
|
|
92
|
+
inlineCSS: {
|
|
93
|
+
position: "absolute",
|
|
94
|
+
top: 0,
|
|
95
|
+
left: 0,
|
|
96
|
+
width: "100%",
|
|
97
|
+
height: "100%",
|
|
98
|
+
opacity: m ? 1 : 0,
|
|
99
|
+
transition: "opacity 0.3s"
|
|
100
|
+
},
|
|
101
|
+
style: {
|
|
102
|
+
borderRadius: d > 0 ? d : 0
|
|
103
|
+
},
|
|
104
|
+
children: z.toArray(u).filter(G).map((n) => n.type === P || n.type === "img" ? J(n, {
|
|
105
|
+
width: i == null ? void 0 : i.originWidth,
|
|
118
106
|
draggable: !1,
|
|
119
107
|
style: {
|
|
120
|
-
overflow: "hidden",
|
|
121
108
|
objectFit: "cover",
|
|
122
109
|
...n.props.style
|
|
123
110
|
},
|
|
124
111
|
...n.props,
|
|
125
|
-
enableFallback: !0
|
|
112
|
+
enableFallback: !0,
|
|
113
|
+
onLoad: T,
|
|
114
|
+
onError: F
|
|
126
115
|
}) : n)
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
116
|
+
}
|
|
117
|
+
),
|
|
118
|
+
/* @__PURE__ */ b(
|
|
119
|
+
K,
|
|
120
|
+
{
|
|
121
|
+
borderRadius: 0,
|
|
122
|
+
inlineCSS: {
|
|
123
|
+
position: "absolute",
|
|
124
|
+
top: 0,
|
|
125
|
+
left: 0,
|
|
126
|
+
width: "100%",
|
|
127
|
+
height: "100%",
|
|
128
|
+
opacity: m ? 0 : 1,
|
|
129
|
+
transition: "opacity 0.3s",
|
|
130
|
+
pointerEvents: m ? "none" : void 0
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
)
|
|
134
|
+
]
|
|
130
135
|
}
|
|
131
136
|
)
|
|
132
137
|
]
|
|
@@ -135,5 +140,5 @@ const U = B(
|
|
|
135
140
|
}
|
|
136
141
|
);
|
|
137
142
|
export {
|
|
138
|
-
|
|
143
|
+
a as default
|
|
139
144
|
};
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { Flexbox as
|
|
1
|
+
import { jsxs as B, jsx as x } from "react/jsx-runtime";
|
|
2
|
+
import { useState as v, useRef as i, Children as nt, isValidElement as ct, useEffect as N, cloneElement as Yt } from "react";
|
|
3
|
+
import { Flexbox as $, Typography as at, IconButton as $t } from "@dotss/ui";
|
|
4
4
|
import wt from "@dotss/ui/core/useTheme";
|
|
5
5
|
import Xt from "@dotss/ui/Dialog";
|
|
6
|
-
import
|
|
6
|
+
import st from "./MediaBlock/MediaBlock.mjs";
|
|
7
7
|
import Rt from "../Swiper/Swiper.mjs";
|
|
8
8
|
function Dt({
|
|
9
|
-
children:
|
|
10
|
-
open:
|
|
11
|
-
onClose:
|
|
9
|
+
children: V,
|
|
10
|
+
open: w = !1,
|
|
11
|
+
onClose: Z,
|
|
12
12
|
onSwipe: q,
|
|
13
|
-
initialPage:
|
|
14
|
-
title:
|
|
15
|
-
loop:
|
|
16
|
-
fallback:
|
|
17
|
-
...
|
|
13
|
+
initialPage: J = 0,
|
|
14
|
+
title: K,
|
|
15
|
+
loop: ut = !1,
|
|
16
|
+
fallback: it,
|
|
17
|
+
...E
|
|
18
18
|
}) {
|
|
19
19
|
const {
|
|
20
|
-
palette: { grey:
|
|
21
|
-
} = wt(), [
|
|
22
|
-
l.current && t.stopPropagation(),
|
|
20
|
+
palette: { grey: ot, etc: Q }
|
|
21
|
+
} = wt(), [lt, _] = v(!1), [G, ft] = v(J), [ht, mt] = v("100vh"), [U, b] = v(1), [gt, Y] = v(!1), o = i(null), e = i(1), k = i(1), tt = i(3), y = i(0), M = i(0), W = i(0), A = i(0), n = i(0), c = i(0), l = i(!1), h = i(!1), D = i(null), X = i(0), C = i(0), dt = nt.toArray(V).filter((r) => ct(r)).filter((r) => r.type === st), pt = nt.toArray(V).filter((r) => ct(r)).filter((r) => r.type !== st), xt = (r) => (t) => {
|
|
22
|
+
l.current && t.stopPropagation(), W.current = t.clientX - n.current, A.current = t.clientY - c.current, h.current = e.current > 1, r == null || r(t);
|
|
23
23
|
}, yt = (r) => (t) => {
|
|
24
24
|
if (!h.current) return;
|
|
25
|
-
n.current = t.clientX -
|
|
25
|
+
n.current = t.clientX - W.current, c.current = t.clientY - A.current;
|
|
26
26
|
const u = t.currentTarget, { width: s, height: a } = u.getBoundingClientRect(), d = s / e.current, m = a / e.current, f = Math.max(
|
|
27
27
|
0,
|
|
28
28
|
(d * e.current - o.current.offsetWidth) / 2
|
|
@@ -37,11 +37,11 @@ function Dt({
|
|
|
37
37
|
Math.max(c.current, -g),
|
|
38
38
|
g
|
|
39
39
|
), t.currentTarget.style.cursor = "grabbing", t.currentTarget.style.transition = "none", t.currentTarget.style.transform = `translate3d(${n.current}px, ${c.current}px, 0) scale(${e.current})`, r == null || r(t);
|
|
40
|
-
},
|
|
40
|
+
}, rt = (r) => (t) => {
|
|
41
41
|
h.current && (t.currentTarget.style.cursor = "grab"), h.current = !1, r == null || r(t);
|
|
42
42
|
}, Mt = (r) => (t) => {
|
|
43
|
-
if (
|
|
44
|
-
|
|
43
|
+
if (W.current = t.touches[0].clientX - n.current, A.current = t.touches[0].clientY - c.current, l.current = t.touches.length === 2, h.current = t.touches.length === 1 && e.current > 1, l.current) {
|
|
44
|
+
Y(!0);
|
|
45
45
|
const u = t.touches[1].clientX - t.touches[0].clientX, s = t.touches[1].clientY - t.touches[0].clientY;
|
|
46
46
|
y.current = Math.hypot(u, s);
|
|
47
47
|
}
|
|
@@ -52,26 +52,26 @@ function Dt({
|
|
|
52
52
|
const a = t.touches[1].clientX - t.touches[0].clientX, d = t.touches[1].clientY - t.touches[0].clientY;
|
|
53
53
|
M.current = Math.hypot(a, d);
|
|
54
54
|
const m = M.current / y.current, f = Math.min(
|
|
55
|
-
Math.max(
|
|
56
|
-
|
|
57
|
-
), g = (t.touches[0].clientX + t.touches[1].clientX) / 2, p = (t.touches[0].clientY + t.touches[1].clientY) / 2, { left:
|
|
58
|
-
n.current -= L * (
|
|
59
|
-
const
|
|
55
|
+
Math.max(k.current, e.current * m),
|
|
56
|
+
tt.current
|
|
57
|
+
), g = (t.touches[0].clientX + t.touches[1].clientX) / 2, p = (t.touches[0].clientY + t.touches[1].clientY) / 2, { left: S, top: F, width: R, height: I } = t.currentTarget.getBoundingClientRect(), O = R / e.current, z = I / e.current, L = g - S - R / 2, j = p - F - I / 2, T = f / e.current;
|
|
58
|
+
n.current -= L * (T - 1), c.current -= j * (T - 1), e.current = f, b(f), Y(!0);
|
|
59
|
+
const H = Math.max(
|
|
60
60
|
0,
|
|
61
|
-
(
|
|
62
|
-
),
|
|
61
|
+
(O * e.current - o.current.offsetWidth) / 2
|
|
62
|
+
), P = Math.max(
|
|
63
63
|
0,
|
|
64
64
|
(z * e.current - o.current.offsetHeight) / 2
|
|
65
65
|
);
|
|
66
66
|
n.current = Math.min(
|
|
67
|
-
Math.max(n.current, -
|
|
68
|
-
T
|
|
69
|
-
), c.current = Math.min(
|
|
70
|
-
Math.max(c.current, -H),
|
|
67
|
+
Math.max(n.current, -H),
|
|
71
68
|
H
|
|
69
|
+
), c.current = Math.min(
|
|
70
|
+
Math.max(c.current, -P),
|
|
71
|
+
P
|
|
72
72
|
), y.current = M.current, t.currentTarget.style.transition = "none", t.currentTarget.style.transform = `translate3d(${n.current}px, ${c.current}px, 0) scale(${e.current})`;
|
|
73
73
|
} else if (h.current && s) {
|
|
74
|
-
n.current = t.touches[0].clientX -
|
|
74
|
+
n.current = t.touches[0].clientX - W.current, c.current = t.touches[0].clientY - A.current;
|
|
75
75
|
const { width: a, height: d } = t.currentTarget.getBoundingClientRect(), m = a / e.current, f = d / e.current, g = Math.max(
|
|
76
76
|
0,
|
|
77
77
|
(m * e.current - o.current.offsetWidth) / 2
|
|
@@ -88,7 +88,7 @@ function Dt({
|
|
|
88
88
|
), t.currentTarget.style.transition = "none", t.currentTarget.style.transform = `translate3d(${n.current}px, ${c.current}px, 0) scale(${e.current})`;
|
|
89
89
|
}
|
|
90
90
|
r == null || r(t);
|
|
91
|
-
},
|
|
91
|
+
}, et = (r) => (t) => {
|
|
92
92
|
const u = e.current;
|
|
93
93
|
if (l.current && u > 1.2) {
|
|
94
94
|
const s = Math.abs(
|
|
@@ -103,11 +103,11 @@ function Dt({
|
|
|
103
103
|
Math.max(c.current, -a),
|
|
104
104
|
a
|
|
105
105
|
), t.currentTarget.style.transition = "transform 0.3s", t.currentTarget.style.transform = `translate3d(${n.current}px, ${c.current}px, 0) scale(${e.current})`;
|
|
106
|
-
} else l.current && u <= 1.2 && (n.current = 0, c.current = 0, y.current = 0, M.current = 0, e.current = 1, l.current = !1, h.current = !1,
|
|
106
|
+
} else l.current && u <= 1.2 && (n.current = 0, c.current = 0, y.current = 0, M.current = 0, e.current = 1, l.current = !1, h.current = !1, b(1), Y(!1), t.currentTarget.style.transition = "transform 0.3s", t.currentTarget.style.transform = `translate3d(${n.current}px, ${c.current}px, 0) scale(${e.current})`);
|
|
107
107
|
h.current = !1, r == null || r(t);
|
|
108
108
|
}, St = ({ currentPage: r }) => {
|
|
109
109
|
var u;
|
|
110
|
-
r !==
|
|
110
|
+
r !== G ? (n.current = 0, c.current = 0, y.current = 0, e.current = 1, M.current = 0, l.current = !1, h.current = !1, b(1), Array.from(((u = D.current) == null ? void 0 : u.getElementsByTagName("img")) || []).forEach((a) => {
|
|
111
111
|
a.style.cursor = "default", a.style.transition = "transform 0.1s 0.1s", a.style.transform = "translate3d(0, 0, 0) scale(1)";
|
|
112
112
|
})) : e.current > 1.2 && (l.current = !0), q == null || q(r), ft(r);
|
|
113
113
|
}, bt = () => {
|
|
@@ -115,19 +115,19 @@ function Dt({
|
|
|
115
115
|
};
|
|
116
116
|
return N(() => {
|
|
117
117
|
var u;
|
|
118
|
-
const r = Array.from(((u =
|
|
119
|
-
s.preventDefault(), l.current = !0,
|
|
118
|
+
const r = Array.from(((u = D.current) == null ? void 0 : u.getElementsByTagName("img")) || []), t = (s) => {
|
|
119
|
+
s.preventDefault(), l.current = !0, Y(!0);
|
|
120
120
|
const a = s.currentTarget, d = s.deltaY > 0 ? -0.1 : 0.1, m = Math.min(
|
|
121
|
-
Math.max(
|
|
122
|
-
|
|
123
|
-
), { left: f, top: g, width: p, height:
|
|
124
|
-
n.current -= I * (z - 1), c.current -=
|
|
121
|
+
Math.max(k.current, e.current + d),
|
|
122
|
+
tt.current
|
|
123
|
+
), { left: f, top: g, width: p, height: S } = a.getBoundingClientRect(), F = p / e.current, R = S / e.current, I = s.clientX - f - p / 2, O = s.clientY - g - S / 2, z = m / e.current;
|
|
124
|
+
n.current -= I * (z - 1), c.current -= O * (z - 1), e.current = m, b(m);
|
|
125
125
|
const L = Math.max(
|
|
126
126
|
0,
|
|
127
127
|
(F * e.current - o.current.offsetWidth) / 2
|
|
128
128
|
), j = Math.max(
|
|
129
129
|
0,
|
|
130
|
-
(
|
|
130
|
+
(R * e.current - o.current.offsetHeight) / 2
|
|
131
131
|
);
|
|
132
132
|
n.current = Math.min(
|
|
133
133
|
Math.max(n.current, -L),
|
|
@@ -136,23 +136,23 @@ function Dt({
|
|
|
136
136
|
Math.max(c.current, -j),
|
|
137
137
|
j
|
|
138
138
|
), l.current = !0, a.style.cursor = "grab", a.style.transition = "none", a.style.transform = `translate3d(${n.current}px, ${c.current}px, 0) scale(${e.current})`, C.current && cancelAnimationFrame(C.current), C.current = requestAnimationFrame(() => {
|
|
139
|
-
const
|
|
140
|
-
if (
|
|
141
|
-
const
|
|
139
|
+
const T = e.current;
|
|
140
|
+
if (T > 1) {
|
|
141
|
+
const H = Math.max(
|
|
142
142
|
0,
|
|
143
143
|
(F * e.current - o.current.offsetWidth) / 2
|
|
144
|
-
),
|
|
144
|
+
), P = Math.max(
|
|
145
145
|
0,
|
|
146
|
-
(
|
|
146
|
+
(R * e.current - o.current.offsetHeight) / 2
|
|
147
147
|
);
|
|
148
148
|
n.current = Math.min(
|
|
149
|
-
Math.max(n.current, -
|
|
150
|
-
T
|
|
151
|
-
), c.current = Math.min(
|
|
152
|
-
Math.max(c.current, -H),
|
|
149
|
+
Math.max(n.current, -H),
|
|
153
150
|
H
|
|
151
|
+
), c.current = Math.min(
|
|
152
|
+
Math.max(c.current, -P),
|
|
153
|
+
P
|
|
154
154
|
), a.style.cursor = "default", a.style.transition = "transform 0.3s", a.style.transform = `translate3d(${n.current}px, ${c.current}px, 0) scale(${e.current})`;
|
|
155
|
-
} else
|
|
155
|
+
} else T <= 1.2 && (n.current = 0, c.current = 0, y.current = 0, M.current = 0, e.current = 1, l.current = !1, h.current = !1, b(1), Y(!1), a.style.cursor = "default", a.style.transition = "transform 0.3s", a.style.transform = `translate3d(${n.current}px, ${c.current}px, 0) scale(${e.current})`);
|
|
156
156
|
});
|
|
157
157
|
};
|
|
158
158
|
return r.forEach((s) => {
|
|
@@ -162,35 +162,35 @@ function Dt({
|
|
|
162
162
|
s.removeEventListener("wheel", t);
|
|
163
163
|
});
|
|
164
164
|
};
|
|
165
|
-
}, [
|
|
165
|
+
}, [lt]), N(() => {
|
|
166
166
|
const r = () => {
|
|
167
167
|
var u;
|
|
168
|
-
const t = (u =
|
|
168
|
+
const t = (u = D.current) == null ? void 0 : u.offsetHeight;
|
|
169
169
|
t && mt(`${t}px`);
|
|
170
170
|
};
|
|
171
171
|
return r(), window.addEventListener("resize", r), () => {
|
|
172
172
|
window.removeEventListener("resize", r);
|
|
173
173
|
};
|
|
174
|
-
}, []), N(() => (
|
|
175
|
-
|
|
176
|
-
}) :
|
|
177
|
-
|
|
178
|
-
}), [
|
|
179
|
-
C.current && cancelAnimationFrame(C.current),
|
|
180
|
-
}), [
|
|
174
|
+
}, []), N(() => (w ? X.current = requestAnimationFrame(() => {
|
|
175
|
+
_(!0);
|
|
176
|
+
}) : _(!1), () => {
|
|
177
|
+
X.current && cancelAnimationFrame(X.current);
|
|
178
|
+
}), [w]), N(() => (w && (e.current = 1, b(1), Y(!1), n.current = 0, c.current = 0, y.current = 0, M.current = 0, l.current = !1, h.current = !1), () => {
|
|
179
|
+
C.current && cancelAnimationFrame(C.current), X.current && cancelAnimationFrame(X.current);
|
|
180
|
+
}), [w]), /* @__PURE__ */ B(
|
|
181
181
|
Xt,
|
|
182
182
|
{
|
|
183
183
|
ref: o,
|
|
184
|
-
open:
|
|
185
|
-
onClose:
|
|
184
|
+
open: w,
|
|
185
|
+
onClose: Z,
|
|
186
186
|
fullScreen: !0,
|
|
187
187
|
hideStatusBar: !0,
|
|
188
188
|
hideSystemNavigationBar: !0,
|
|
189
189
|
"aria-modal": !0,
|
|
190
|
-
"aria-labelledby":
|
|
191
|
-
...
|
|
190
|
+
"aria-labelledby": K ? "media-dialog-title" : void 0,
|
|
191
|
+
...E,
|
|
192
192
|
inlineCSS: {
|
|
193
|
-
backgroundColor:
|
|
193
|
+
backgroundColor: ot.black,
|
|
194
194
|
scrollbarWidth: "none",
|
|
195
195
|
"&::-webkit-scrollbar": {
|
|
196
196
|
display: "none"
|
|
@@ -201,11 +201,11 @@ function Dt({
|
|
|
201
201
|
display: "none"
|
|
202
202
|
}
|
|
203
203
|
},
|
|
204
|
-
...
|
|
204
|
+
...E == null ? void 0 : E.inlineCSS
|
|
205
205
|
},
|
|
206
206
|
children: [
|
|
207
207
|
/* @__PURE__ */ x(
|
|
208
|
-
|
|
208
|
+
$,
|
|
209
209
|
{
|
|
210
210
|
"aria-hidden": !0,
|
|
211
211
|
inlineCSS: {
|
|
@@ -214,13 +214,13 @@ function Dt({
|
|
|
214
214
|
left: 0,
|
|
215
215
|
width: "100%",
|
|
216
216
|
minHeight: "var(--status-bar-height, 0px)",
|
|
217
|
-
backgroundColor:
|
|
217
|
+
backgroundColor: Q.dimmed01,
|
|
218
218
|
zIndex: 2
|
|
219
219
|
}
|
|
220
220
|
}
|
|
221
221
|
),
|
|
222
222
|
/* @__PURE__ */ x(
|
|
223
|
-
|
|
223
|
+
$,
|
|
224
224
|
{
|
|
225
225
|
tag: "header",
|
|
226
226
|
inlineCSS: {
|
|
@@ -228,11 +228,11 @@ function Dt({
|
|
|
228
228
|
top: "var(--status-bar-height, 0px)",
|
|
229
229
|
left: 0,
|
|
230
230
|
width: "100%",
|
|
231
|
-
backgroundColor:
|
|
231
|
+
backgroundColor: Q.dimmed01,
|
|
232
232
|
zIndex: 2
|
|
233
233
|
},
|
|
234
|
-
children: /* @__PURE__ */
|
|
235
|
-
|
|
234
|
+
children: /* @__PURE__ */ B(
|
|
235
|
+
$,
|
|
236
236
|
{
|
|
237
237
|
alignItems: "center",
|
|
238
238
|
p: 2,
|
|
@@ -245,9 +245,9 @@ function Dt({
|
|
|
245
245
|
maxHeight: 56
|
|
246
246
|
},
|
|
247
247
|
children: [
|
|
248
|
-
/* @__PURE__ */ x(
|
|
248
|
+
/* @__PURE__ */ x($, {}),
|
|
249
249
|
/* @__PURE__ */ x(
|
|
250
|
-
|
|
250
|
+
at,
|
|
251
251
|
{
|
|
252
252
|
id: "media-dialog-title",
|
|
253
253
|
tag: "div",
|
|
@@ -258,19 +258,19 @@ function Dt({
|
|
|
258
258
|
inlineCSS: {
|
|
259
259
|
flexGrow: 1
|
|
260
260
|
},
|
|
261
|
-
children:
|
|
261
|
+
children: K
|
|
262
262
|
}
|
|
263
263
|
),
|
|
264
|
-
/* @__PURE__ */ x(
|
|
264
|
+
/* @__PURE__ */ x($, { justifyContent: "flex-end", children: /* @__PURE__ */ x($t, { name: "CloseLine", color: "tertiary", onClick: Z, "aria-label": "창 닫기" }) })
|
|
265
265
|
]
|
|
266
266
|
}
|
|
267
267
|
)
|
|
268
268
|
}
|
|
269
269
|
),
|
|
270
270
|
/* @__PURE__ */ x(
|
|
271
|
-
|
|
271
|
+
$,
|
|
272
272
|
{
|
|
273
|
-
ref:
|
|
273
|
+
ref: D,
|
|
274
274
|
alignItems: "center",
|
|
275
275
|
justifyContent: "center",
|
|
276
276
|
inlineCSS: {
|
|
@@ -285,28 +285,29 @@ function Dt({
|
|
|
285
285
|
{
|
|
286
286
|
onSwipe: St,
|
|
287
287
|
onSwiping: bt,
|
|
288
|
-
initialPage:
|
|
289
|
-
loop:
|
|
288
|
+
initialPage: J,
|
|
289
|
+
loop: ut,
|
|
290
290
|
disableSwipe: gt,
|
|
291
291
|
children: dt.map(
|
|
292
|
-
(r) => {
|
|
293
|
-
var
|
|
292
|
+
(r, t) => {
|
|
293
|
+
var u, s, a, d, m, f, g, p, S;
|
|
294
294
|
return Yt(r, {
|
|
295
|
-
fallback:
|
|
295
|
+
fallback: it,
|
|
296
296
|
...r.props,
|
|
297
297
|
imageProps: {
|
|
298
298
|
...r.props.imageProps,
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
299
|
+
lazy: G - 1 > t || G + 1 < t,
|
|
300
|
+
onMouseDown: xt((u = r.props.imageProps) == null ? void 0 : u.onMouseDown),
|
|
301
|
+
onMouseMove: yt((s = r.props.imageProps) == null ? void 0 : s.onMouseMove),
|
|
302
|
+
onMouseUp: rt((a = r.props.imageProps) == null ? void 0 : a.onMouseUp),
|
|
303
|
+
onMouseOut: rt((d = r.props.imageProps) == null ? void 0 : d.onMouseOut),
|
|
304
|
+
onTouchStart: Mt((m = r.props.imageProps) == null ? void 0 : m.onTouchStart),
|
|
305
|
+
onTouchMove: Ct((f = r.props.imageProps) == null ? void 0 : f.onTouchMove),
|
|
306
|
+
onTouchEnd: et((g = r.props.imageProps) == null ? void 0 : g.onTouchEnd),
|
|
307
|
+
onTouchCancel: et((p = r.props.imageProps) == null ? void 0 : p.onTouchCancel),
|
|
307
308
|
style: {
|
|
308
309
|
maxHeight: ht,
|
|
309
|
-
...(
|
|
310
|
+
...(S = r.props.imageProps) == null ? void 0 : S.style
|
|
310
311
|
}
|
|
311
312
|
}
|
|
312
313
|
});
|
|
@@ -317,9 +318,9 @@ function Dt({
|
|
|
317
318
|
}
|
|
318
319
|
),
|
|
319
320
|
pt,
|
|
320
|
-
/* @__PURE__ */
|
|
321
|
-
|
|
322
|
-
|
|
321
|
+
/* @__PURE__ */ B(at, { role: "status", visuallyHidden: !0, children: [
|
|
322
|
+
U > 1 && "이미지가 확대되었어요.",
|
|
323
|
+
U <= 1 && "이미지가 원래 크기로 복원되었어요."
|
|
323
324
|
] })
|
|
324
325
|
]
|
|
325
326
|
}
|