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