@dotss/tictoccroc 0.0.2 → 0.0.3
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 +157 -139
- 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 +5 -0
- package/dist/shared/components/Masonry/MasonryBlock/MasonryBlock.mjs +93 -59
- 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 +327 -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/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/ScheduleEvent/ScheduleEvent.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 +53 -62
- 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
- /package/dist/shared/components/{ImageZoomDialog/ImageZoomDialogFooter/ImageZoomDialogFooter.mjs → MediaDialog/MediaDialogFooter/MediaDialogFooter.mjs} +0 -0
|
@@ -5,8 +5,8 @@ import D from "@dotss/ui/core/useTheme";
|
|
|
5
5
|
import E from "./CertificationItem/CertificationItem.mjs";
|
|
6
6
|
function z({
|
|
7
7
|
children: s,
|
|
8
|
-
hideTooltip: g = !1,
|
|
9
8
|
action: d,
|
|
9
|
+
showTooltip: g = !1,
|
|
10
10
|
enableToggle: f = !1,
|
|
11
11
|
...n
|
|
12
12
|
}) {
|
|
@@ -38,7 +38,7 @@ function z({
|
|
|
38
38
|
children: "자격증"
|
|
39
39
|
}
|
|
40
40
|
),
|
|
41
|
-
|
|
41
|
+
g && /* @__PURE__ */ t(
|
|
42
42
|
j,
|
|
43
43
|
{
|
|
44
44
|
open: x,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { FlexboxProps } from 'node_modules/@dotss/ui/Flexbox/Flexbox';
|
|
3
3
|
export interface EducationSectionProps extends FlexboxProps {
|
|
4
|
-
hideTooltip?: boolean;
|
|
5
4
|
action?: ReactNode;
|
|
5
|
+
showTooltip?: boolean;
|
|
6
6
|
enableToggle?: boolean;
|
|
7
7
|
}
|
|
8
|
-
declare function EducationSection({ children,
|
|
8
|
+
declare function EducationSection({ children, action, showTooltip, enableToggle, ...props }: EducationSectionProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
9
9
|
export default EducationSection;
|
|
@@ -5,8 +5,8 @@ import k from "@dotss/ui/core/useTheme";
|
|
|
5
5
|
import D from "./EducationItem/EducationItem.mjs";
|
|
6
6
|
function B({
|
|
7
7
|
children: s,
|
|
8
|
-
hideTooltip: y = !1,
|
|
9
8
|
action: d,
|
|
9
|
+
showTooltip: y = !1,
|
|
10
10
|
enableToggle: h = !1,
|
|
11
11
|
...i
|
|
12
12
|
}) {
|
|
@@ -38,7 +38,7 @@ function B({
|
|
|
38
38
|
children: "학력"
|
|
39
39
|
}
|
|
40
40
|
),
|
|
41
|
-
|
|
41
|
+
y && /* @__PURE__ */ e(
|
|
42
42
|
E,
|
|
43
43
|
{
|
|
44
44
|
open: g,
|
|
@@ -2,7 +2,7 @@ import "react/jsx-runtime";
|
|
|
2
2
|
import "react";
|
|
3
3
|
import "@dotss/ui";
|
|
4
4
|
import "@dotss/ui/core/useTheme";
|
|
5
|
-
import { L as a } from "../../../../LessonNotesSection-
|
|
5
|
+
import { L as a } from "../../../../LessonNotesSection-Bg1DHFxg.js";
|
|
6
6
|
export {
|
|
7
7
|
a as default
|
|
8
8
|
};
|
|
@@ -16,7 +16,7 @@ import { default as K } from "./AbilityCollection/AbilityCollection.mjs";
|
|
|
16
16
|
import { default as R } from "./AbilityCollection/AbilityBadge/AbilityBadge.mjs";
|
|
17
17
|
import { getAbilityCollection as j } from "./AbilityCollection/AbilityCollection.utils.mjs";
|
|
18
18
|
import { default as q } from "./AvailableScheduleSection/AvailableScheduleSection.mjs";
|
|
19
|
-
import { L as D } from "../../../LessonNotesSection-
|
|
19
|
+
import { L as D } from "../../../LessonNotesSection-Bg1DHFxg.js";
|
|
20
20
|
import { default as H } from "./LessonNotesSection/LessonNote/LessonNote.mjs";
|
|
21
21
|
import { default as M } from "./ParentReviewSection/ParentReviewSection.mjs";
|
|
22
22
|
import { default as Q } from "./ParentReviewSection/ParentReviewCard/ParentReviewCard.mjs";
|
package/package.json
CHANGED
|
@@ -1,196 +0,0 @@
|
|
|
1
|
-
import { jsx as f, jsxs as m } from "react/jsx-runtime";
|
|
2
|
-
import { useRef as i, Children as k, isValidElement as E, useEffect as y, cloneElement as I, forwardRef as T } from "react";
|
|
3
|
-
import { Flexbox as d, Typography as S, Button as F, Icon as $ } from "@dotss/ui";
|
|
4
|
-
import N from "@dotss/ui/core/useTheme";
|
|
5
|
-
import X from "./shared/components/Roller/RollerBlock/RollerBlock.mjs";
|
|
6
|
-
import j from "./teacher/profile/components/LessonNotesSection/LessonNote/LessonNote.mjs";
|
|
7
|
-
function B({ children: g, spacing: p = 2, edgeSpacing: l = 4, rowCount: n = 1, inlineCSS: b }) {
|
|
8
|
-
const o = i(null), c = i(!1), s = i(!0), D = i(0), v = i(0), u = i(0), R = k.toArray(g).filter(E).filter((e) => e.type === X || e.type === j), h = R.length, M = (e) => {
|
|
9
|
-
var t, r;
|
|
10
|
-
c.current = !0, D.current = e.clientX - (((t = o.current) == null ? void 0 : t.offsetLeft) || 0), v.current = ((r = o.current) == null ? void 0 : r.scrollLeft) || 0;
|
|
11
|
-
}, w = (e) => {
|
|
12
|
-
c.current && (e.currentTarget.style.cursor = "grabbing", o.current && (o.current.scrollLeft = v.current - (e.clientX - o.current.offsetLeft - D.current)));
|
|
13
|
-
}, A = (e) => {
|
|
14
|
-
var r;
|
|
15
|
-
c.current = !1, v.current !== ((r = o.current) == null ? void 0 : r.scrollLeft) ? (e.currentTarget.style.cursor = "grab", s.current = !1, u.current && cancelAnimationFrame(u.current), u.current = requestAnimationFrame(() => {
|
|
16
|
-
s.current = !0;
|
|
17
|
-
})) : s.current = !0;
|
|
18
|
-
}, C = (e) => (t) => {
|
|
19
|
-
var x;
|
|
20
|
-
t.stopPropagation();
|
|
21
|
-
const r = Number(t.currentTarget.getAttribute("aria-posinset")) - 1;
|
|
22
|
-
let a = r;
|
|
23
|
-
switch (t.key) {
|
|
24
|
-
case "ArrowRight": {
|
|
25
|
-
t.preventDefault(), r + n < h && (a = r + n);
|
|
26
|
-
break;
|
|
27
|
-
}
|
|
28
|
-
case "ArrowLeft": {
|
|
29
|
-
t.preventDefault(), r - n >= 0 && (a = r - n);
|
|
30
|
-
break;
|
|
31
|
-
}
|
|
32
|
-
case "ArrowDown": {
|
|
33
|
-
t.preventDefault(), (r + 1) % n !== 0 && r + 1 < h && (a = r + 1);
|
|
34
|
-
break;
|
|
35
|
-
}
|
|
36
|
-
case "ArrowUp": {
|
|
37
|
-
t.preventDefault(), r % n !== 0 && r - 1 >= 0 && (a = r - 1);
|
|
38
|
-
break;
|
|
39
|
-
}
|
|
40
|
-
case "Enter":
|
|
41
|
-
case " ": {
|
|
42
|
-
t.preventDefault(), t.currentTarget.click();
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
default:
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
if (a !== r) {
|
|
49
|
-
const L = (x = o.current) == null ? void 0 : x.children[a];
|
|
50
|
-
L == null || L.focus();
|
|
51
|
-
}
|
|
52
|
-
e == null || e(t);
|
|
53
|
-
};
|
|
54
|
-
return y(() => {
|
|
55
|
-
const e = o.current, t = (r) => {
|
|
56
|
-
s.current || r.stopPropagation();
|
|
57
|
-
};
|
|
58
|
-
return e == null || e.addEventListener("click", t), () => {
|
|
59
|
-
e == null || e.removeEventListener("click", t);
|
|
60
|
-
};
|
|
61
|
-
}, []), y(() => {
|
|
62
|
-
const e = o.current, t = (r) => {
|
|
63
|
-
r.stopPropagation();
|
|
64
|
-
};
|
|
65
|
-
return e == null || e.addEventListener("touchmove", t), () => {
|
|
66
|
-
e == null || e.removeEventListener("touchmove", t);
|
|
67
|
-
};
|
|
68
|
-
}, []), y(() => () => {
|
|
69
|
-
u.current && cancelAnimationFrame(u.current);
|
|
70
|
-
}, []), /* @__PURE__ */ f(
|
|
71
|
-
d,
|
|
72
|
-
{
|
|
73
|
-
ref: o,
|
|
74
|
-
alignItems: "baseline",
|
|
75
|
-
gap: p,
|
|
76
|
-
pl: l,
|
|
77
|
-
pr: l,
|
|
78
|
-
onMouseDown: M,
|
|
79
|
-
onMouseMove: w,
|
|
80
|
-
onMouseUp: A,
|
|
81
|
-
onMouseLeave: A,
|
|
82
|
-
role: "list",
|
|
83
|
-
"aria-roledescription": "carousel",
|
|
84
|
-
"aria-label": "슬라이더",
|
|
85
|
-
inlineCSS: {
|
|
86
|
-
display: "grid",
|
|
87
|
-
gridAutoFlow: "column",
|
|
88
|
-
gridAutoColumns: "min-content",
|
|
89
|
-
overflowX: "auto",
|
|
90
|
-
scrollbarWidth: "none",
|
|
91
|
-
cursor: "grab",
|
|
92
|
-
transform: "translate3d(0, 0, 0)",
|
|
93
|
-
"&::-webkit-scrollbar": {
|
|
94
|
-
display: "none"
|
|
95
|
-
},
|
|
96
|
-
...b
|
|
97
|
-
},
|
|
98
|
-
children: k.map(
|
|
99
|
-
R,
|
|
100
|
-
(e, t) => {
|
|
101
|
-
var r;
|
|
102
|
-
return I(e, {
|
|
103
|
-
role: "listitem",
|
|
104
|
-
tabIndex: 0,
|
|
105
|
-
"aria-roledescription": "slide",
|
|
106
|
-
"aria-posinset": t + 1,
|
|
107
|
-
"aria-setsize": h,
|
|
108
|
-
onKeyDown: C(e.props.onKeyDown),
|
|
109
|
-
...e.props,
|
|
110
|
-
style: {
|
|
111
|
-
...(r = e.props) == null ? void 0 : r.style,
|
|
112
|
-
gridRow: `${t % n + 1} / ${t % n + 1}`
|
|
113
|
-
}
|
|
114
|
-
});
|
|
115
|
-
}
|
|
116
|
-
)
|
|
117
|
-
}
|
|
118
|
-
);
|
|
119
|
-
}
|
|
120
|
-
const H = T(
|
|
121
|
-
({ children: g, totalCount: p = 0, onClickViewAll: l, ...n }, b) => {
|
|
122
|
-
const {
|
|
123
|
-
palette: { background: o },
|
|
124
|
-
spacing: c
|
|
125
|
-
} = N(), s = k.count(g);
|
|
126
|
-
return /* @__PURE__ */ m(
|
|
127
|
-
d,
|
|
128
|
-
{
|
|
129
|
-
ref: b,
|
|
130
|
-
tag: "section",
|
|
131
|
-
pt: 10,
|
|
132
|
-
pb: 10,
|
|
133
|
-
pl: 4,
|
|
134
|
-
pr: 4,
|
|
135
|
-
gap: 4,
|
|
136
|
-
flexDirection: "column",
|
|
137
|
-
"aria-labelledby": "lesson-notes-section-title",
|
|
138
|
-
...n,
|
|
139
|
-
inlineCSS: {
|
|
140
|
-
width: "100%",
|
|
141
|
-
backgroundColor: o.primary,
|
|
142
|
-
...n == null ? void 0 : n.inlineCSS
|
|
143
|
-
},
|
|
144
|
-
children: [
|
|
145
|
-
/* @__PURE__ */ m(d, { alignItems: "center", justifyContent: "space-between", gap: 1, children: [
|
|
146
|
-
/* @__PURE__ */ f(d, { alignItems: "center", gap: 2, children: /* @__PURE__ */ m(S, { id: "lesson-notes-section-title", tag: "h2", variant: "h2B", children: [
|
|
147
|
-
"선생님의 수업노트",
|
|
148
|
-
p > 0 && /* @__PURE__ */ m(
|
|
149
|
-
S,
|
|
150
|
-
{
|
|
151
|
-
tag: "span",
|
|
152
|
-
variant: "h4R",
|
|
153
|
-
color: "grey.70",
|
|
154
|
-
inlineCSS: { marginLeft: c.content(2), verticalAlign: 2 },
|
|
155
|
-
children: [
|
|
156
|
-
"(",
|
|
157
|
-
p.toLocaleString(),
|
|
158
|
-
"개)"
|
|
159
|
-
]
|
|
160
|
-
}
|
|
161
|
-
)
|
|
162
|
-
] }) }),
|
|
163
|
-
typeof l == "function" && /* @__PURE__ */ f(
|
|
164
|
-
F,
|
|
165
|
-
{
|
|
166
|
-
variant: "text",
|
|
167
|
-
size: "small",
|
|
168
|
-
color: "secondary",
|
|
169
|
-
endAdornment: /* @__PURE__ */ f($, { name: "ChevronRightLine" }),
|
|
170
|
-
onClick: l,
|
|
171
|
-
children: "전체보기"
|
|
172
|
-
}
|
|
173
|
-
)
|
|
174
|
-
] }),
|
|
175
|
-
/* @__PURE__ */ f(
|
|
176
|
-
B,
|
|
177
|
-
{
|
|
178
|
-
rowCount: 1,
|
|
179
|
-
spacing: 3,
|
|
180
|
-
inlineCSS: {
|
|
181
|
-
width: `calc(100% + ${c.content(8)}px)`,
|
|
182
|
-
gridAutoColumns: s > 1 ? `calc(100% - ${c.content(8)}px)` : "100%",
|
|
183
|
-
margin: `0 -${c.content(4)}px`
|
|
184
|
-
},
|
|
185
|
-
children: g
|
|
186
|
-
}
|
|
187
|
-
)
|
|
188
|
-
]
|
|
189
|
-
}
|
|
190
|
-
);
|
|
191
|
-
}
|
|
192
|
-
);
|
|
193
|
-
export {
|
|
194
|
-
H as L,
|
|
195
|
-
B as R
|
|
196
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { ImageProps } from '../../Image';
|
|
3
|
-
export interface ImageBlockProps extends Omit<ImageProps, 'wrapperProps' | 'style' | 'onLoad'> {
|
|
4
|
-
fallback?: ReactNode;
|
|
5
|
-
containerHeight: string;
|
|
6
|
-
}
|
|
7
|
-
declare function ImageBlock({ fallback, containerHeight, ...props }: ImageBlockProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
8
|
-
export default ImageBlock;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { jsxs as s, Fragment as i, jsx as n } from "react/jsx-runtime";
|
|
2
|
-
import { useState as d } from "react";
|
|
3
|
-
import l from "../../Image/Image.mjs";
|
|
4
|
-
function f({ fallback: a, containerHeight: e, ...t }) {
|
|
5
|
-
const [o, r] = d(!1);
|
|
6
|
-
return /* @__PURE__ */ s(i, { children: [
|
|
7
|
-
/* @__PURE__ */ n(
|
|
8
|
-
l,
|
|
9
|
-
{
|
|
10
|
-
...t,
|
|
11
|
-
onLoad: () => r(!0),
|
|
12
|
-
disabledResizing: !0,
|
|
13
|
-
draggable: !1,
|
|
14
|
-
wrapperProps: {
|
|
15
|
-
inlineCSS: {
|
|
16
|
-
overflow: "visible",
|
|
17
|
-
margin: "0 auto"
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
style: {
|
|
21
|
-
position: "static",
|
|
22
|
-
maxWidth: "100%",
|
|
23
|
-
maxHeight: e,
|
|
24
|
-
objectFit: "contain",
|
|
25
|
-
transform: "translate3d(0, 0, 0) scale(1)",
|
|
26
|
-
marginTop: "calc(var(--status-bar-height, 0px) * -1)",
|
|
27
|
-
zIndex: 1
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
),
|
|
31
|
-
!o && a
|
|
32
|
-
] });
|
|
33
|
-
}
|
|
34
|
-
export {
|
|
35
|
-
f as default
|
|
36
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { PropsWithChildren, ReactNode } from 'react';
|
|
2
|
-
export interface ImageZoomDialogProps {
|
|
3
|
-
open?: boolean;
|
|
4
|
-
onClose?: () => void;
|
|
5
|
-
onSwipe?: (page: number) => void;
|
|
6
|
-
sources: {
|
|
7
|
-
url: string;
|
|
8
|
-
alt: string;
|
|
9
|
-
}[];
|
|
10
|
-
initialPage?: number;
|
|
11
|
-
title?: ReactNode;
|
|
12
|
-
fallback?: ReactNode;
|
|
13
|
-
loop?: boolean;
|
|
14
|
-
}
|
|
15
|
-
declare function ImageZoomDialog({ children, open, onClose, onSwipe, sources, initialPage, title, fallback, loop }: PropsWithChildren<ImageZoomDialogProps>): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
16
|
-
export default ImageZoomDialog;
|
|
@@ -1,323 +0,0 @@
|
|
|
1
|
-
import { jsxs as q, jsx as d } from "react/jsx-runtime";
|
|
2
|
-
import { useState as W, useRef as u, useEffect as A } from "react";
|
|
3
|
-
import { Flexbox as w, Typography as et, IconButton as pt } from "@dotss/ui";
|
|
4
|
-
import yt from "@dotss/ui/core/useTheme";
|
|
5
|
-
import Ct from "@dotss/ui/Dialog";
|
|
6
|
-
import bt from "./ImageBlock/ImageBlock.mjs";
|
|
7
|
-
import Tt from "../Swiper/Swiper.mjs";
|
|
8
|
-
import St from "../Swiper/SwiperBlock/SwiperBlock.mjs";
|
|
9
|
-
function Wt({
|
|
10
|
-
children: nt,
|
|
11
|
-
open: $ = !1,
|
|
12
|
-
onClose: C,
|
|
13
|
-
onSwipe: P,
|
|
14
|
-
sources: L,
|
|
15
|
-
initialPage: G = 0,
|
|
16
|
-
title: U,
|
|
17
|
-
fallback: ct,
|
|
18
|
-
loop: at = !1
|
|
19
|
-
}) {
|
|
20
|
-
const {
|
|
21
|
-
palette: { grey: Z, etc: O }
|
|
22
|
-
} = yt(), [it, J] = W(!1), [st, ut] = W(G), [ot, b] = W(!1), [lt, ht] = W("100vh"), [K, T] = W(1), l = u(null), r = u(1), Q = u(1), V = u(3), g = u(0), x = u(0), B = u(0), D = u(0), e = u(0), n = u(0), o = u(!1), f = u(!1), k = u(null), Y = u(0), M = u(0), ft = (t) => {
|
|
23
|
-
o.current && t.stopPropagation(), B.current = t.clientX - e.current, D.current = t.clientY - n.current, f.current = r.current > 1;
|
|
24
|
-
}, mt = (t) => {
|
|
25
|
-
if (!f.current) return;
|
|
26
|
-
e.current = t.clientX - B.current, n.current = t.clientY - D.current;
|
|
27
|
-
const i = t.currentTarget, { width: s, height: a } = i.getBoundingClientRect(), c = s / r.current, p = a / r.current, h = Math.max(
|
|
28
|
-
0,
|
|
29
|
-
(c * r.current - l.current.offsetWidth) / 2
|
|
30
|
-
), m = Math.max(
|
|
31
|
-
0,
|
|
32
|
-
(p * r.current - l.current.offsetHeight) / 2
|
|
33
|
-
);
|
|
34
|
-
e.current = Math.min(
|
|
35
|
-
Math.max(e.current, -h),
|
|
36
|
-
h
|
|
37
|
-
), n.current = Math.min(
|
|
38
|
-
Math.max(n.current, -m),
|
|
39
|
-
m
|
|
40
|
-
), Math.abs(e.current) >= h && (o.current = !1, b(!1)), t.currentTarget.style.cursor = "grabbing", t.currentTarget.style.transition = "none", t.currentTarget.style.transform = `translate3d(${e.current}px, ${n.current}px, 0) scale(${r.current})`;
|
|
41
|
-
}, _ = (t) => {
|
|
42
|
-
f.current && (t.currentTarget.style.cursor = "grab"), f.current = !1;
|
|
43
|
-
}, dt = (t) => {
|
|
44
|
-
if (B.current = t.touches[0].clientX - e.current, D.current = t.touches[0].clientY - n.current, o.current = t.touches.length === 2, f.current = t.touches.length === 1 && r.current > 1, o.current) {
|
|
45
|
-
b(!0);
|
|
46
|
-
const i = t.touches[1].clientX - t.touches[0].clientX, s = t.touches[1].clientY - t.touches[0].clientY;
|
|
47
|
-
g.current = Math.hypot(i, s);
|
|
48
|
-
}
|
|
49
|
-
}, gt = (t) => {
|
|
50
|
-
const i = t.touches.length === 2, s = t.touches.length === 1;
|
|
51
|
-
if (o.current && i) {
|
|
52
|
-
const a = t.touches[1].clientX - t.touches[0].clientX, c = t.touches[1].clientY - t.touches[0].clientY;
|
|
53
|
-
x.current = Math.hypot(a, c);
|
|
54
|
-
const p = x.current / g.current, h = Math.min(
|
|
55
|
-
Math.max(Q.current, r.current * p),
|
|
56
|
-
V.current
|
|
57
|
-
), m = (t.touches[0].clientX + t.touches[1].clientX) / 2, y = (t.touches[0].clientY + t.touches[1].clientY) / 2, { left: S, top: I, width: X, height: v } = t.currentTarget.getBoundingClientRect(), j = X / r.current, N = v / r.current, F = m - S - X / 2, z = y - I - v / 2, R = h / r.current;
|
|
58
|
-
e.current -= F * (R - 1), n.current -= z * (R - 1), r.current = h, T(h);
|
|
59
|
-
const E = Math.max(
|
|
60
|
-
0,
|
|
61
|
-
(j * r.current - l.current.offsetWidth) / 2
|
|
62
|
-
), H = Math.max(
|
|
63
|
-
0,
|
|
64
|
-
(N * r.current - l.current.offsetHeight) / 2
|
|
65
|
-
);
|
|
66
|
-
e.current = Math.min(
|
|
67
|
-
Math.max(e.current, -E),
|
|
68
|
-
E
|
|
69
|
-
), n.current = Math.min(
|
|
70
|
-
Math.max(n.current, -H),
|
|
71
|
-
H
|
|
72
|
-
), g.current = x.current, t.currentTarget.style.transition = "none", t.currentTarget.style.transform = `translate3d(${e.current}px, ${n.current}px, 0) scale(${r.current})`;
|
|
73
|
-
} else if (f.current && s) {
|
|
74
|
-
e.current = t.touches[0].clientX - B.current, n.current = t.touches[0].clientY - D.current;
|
|
75
|
-
const { width: a, height: c } = t.currentTarget.getBoundingClientRect(), p = a / r.current, h = c / r.current, m = Math.max(
|
|
76
|
-
0,
|
|
77
|
-
(p * r.current - l.current.offsetWidth) / 2
|
|
78
|
-
), y = Math.max(
|
|
79
|
-
0,
|
|
80
|
-
(h * r.current - l.current.offsetHeight) / 2
|
|
81
|
-
);
|
|
82
|
-
e.current = Math.min(
|
|
83
|
-
Math.max(e.current, -m),
|
|
84
|
-
m
|
|
85
|
-
), n.current = Math.min(
|
|
86
|
-
Math.max(n.current, -y),
|
|
87
|
-
y
|
|
88
|
-
);
|
|
89
|
-
const S = Math.abs(e.current) >= m;
|
|
90
|
-
b(!S), t.currentTarget.style.transition = "none", t.currentTarget.style.transform = `translate3d(${e.current}px, ${n.current}px, 0) scale(${r.current})`;
|
|
91
|
-
}
|
|
92
|
-
}, tt = (t) => {
|
|
93
|
-
const i = r.current;
|
|
94
|
-
if (o.current && i > 1.2) {
|
|
95
|
-
const s = Math.abs(
|
|
96
|
-
(t.currentTarget.offsetWidth * r.current - l.current.offsetWidth) / 2
|
|
97
|
-
), a = Math.abs(
|
|
98
|
-
(t.currentTarget.offsetHeight * r.current - l.current.offsetHeight) / 2
|
|
99
|
-
);
|
|
100
|
-
e.current = Math.min(
|
|
101
|
-
Math.max(e.current, -s),
|
|
102
|
-
s
|
|
103
|
-
), n.current = Math.min(
|
|
104
|
-
Math.max(n.current, -a),
|
|
105
|
-
a
|
|
106
|
-
), t.currentTarget.style.transition = "transform 0.3s", t.currentTarget.style.transform = `translate3d(${e.current}px, ${n.current}px, 0) scale(${r.current})`;
|
|
107
|
-
} else o.current && i <= 1.2 && (e.current = 0, n.current = 0, g.current = 0, x.current = 0, r.current = 1, T(1), o.current = !1, f.current = !1, t.currentTarget.style.transition = "transform 0.3s", t.currentTarget.style.transform = `translate3d(${e.current}px, ${n.current}px, 0) scale(${r.current})`, b(!1));
|
|
108
|
-
f.current = !1;
|
|
109
|
-
}, xt = ({ currentPage: t }) => {
|
|
110
|
-
var s;
|
|
111
|
-
t !== st ? (e.current = 0, n.current = 0, g.current = 0, r.current = 1, T(1), x.current = 0, o.current = !1, f.current = !1, Array.from(((s = k.current) == null ? void 0 : s.getElementsByTagName("img")) || []).forEach((c) => {
|
|
112
|
-
c.style.cursor = "default", c.style.transition = "transform 0.1s 0.1s", c.style.transform = "translate3d(0, 0, 0) scale(1)";
|
|
113
|
-
})) : r.current > 1.2 && (o.current = !0), P == null || P(t), ut(t);
|
|
114
|
-
}, Mt = () => {
|
|
115
|
-
f.current = !1;
|
|
116
|
-
};
|
|
117
|
-
return A(() => {
|
|
118
|
-
var s;
|
|
119
|
-
const t = Array.from(((s = k.current) == null ? void 0 : s.getElementsByTagName("img")) || []), i = (a) => {
|
|
120
|
-
a.preventDefault(), o.current = !0, b(!0);
|
|
121
|
-
const c = a.currentTarget, p = a.deltaY > 0 ? -0.1 : 0.1, h = Math.min(
|
|
122
|
-
Math.max(Q.current, r.current + p),
|
|
123
|
-
V.current
|
|
124
|
-
), { left: m, top: y, width: S, height: I } = c.getBoundingClientRect(), X = S / r.current, v = I / r.current, j = a.clientX - m - S / 2, N = a.clientY - y - I / 2, F = h / r.current;
|
|
125
|
-
e.current -= j * (F - 1), n.current -= N * (F - 1), r.current = h, T(h);
|
|
126
|
-
const z = Math.max(
|
|
127
|
-
0,
|
|
128
|
-
(X * r.current - l.current.offsetWidth) / 2
|
|
129
|
-
), R = Math.max(
|
|
130
|
-
0,
|
|
131
|
-
(v * r.current - l.current.offsetHeight) / 2
|
|
132
|
-
);
|
|
133
|
-
e.current = Math.min(
|
|
134
|
-
Math.max(e.current, -z),
|
|
135
|
-
z
|
|
136
|
-
), n.current = Math.min(
|
|
137
|
-
Math.max(n.current, -R),
|
|
138
|
-
R
|
|
139
|
-
), o.current = !0, c.style.cursor = "grab", c.style.transition = "none", c.style.transform = `translate3d(${e.current}px, ${n.current}px, 0) scale(${r.current})`, M.current && cancelAnimationFrame(M.current), M.current = requestAnimationFrame(() => {
|
|
140
|
-
const E = r.current;
|
|
141
|
-
if (E > 1) {
|
|
142
|
-
const H = Math.max(
|
|
143
|
-
0,
|
|
144
|
-
(X * r.current - l.current.offsetWidth) / 2
|
|
145
|
-
), rt = Math.max(
|
|
146
|
-
0,
|
|
147
|
-
(v * r.current - l.current.offsetHeight) / 2
|
|
148
|
-
);
|
|
149
|
-
e.current = Math.min(
|
|
150
|
-
Math.max(e.current, -H),
|
|
151
|
-
H
|
|
152
|
-
), n.current = Math.min(
|
|
153
|
-
Math.max(n.current, -rt),
|
|
154
|
-
rt
|
|
155
|
-
), c.style.cursor = "default", c.style.transition = "transform 0.3s", c.style.transform = `translate3d(${e.current}px, ${n.current}px, 0) scale(${r.current})`;
|
|
156
|
-
} else E <= 1.2 && (b(!1), e.current = 0, n.current = 0, g.current = 0, x.current = 0, r.current = 1, T(1), o.current = !1, f.current = !1, c.style.cursor = "default", c.style.transition = "transform 0.3s", c.style.transform = `translate3d(${e.current}px, ${n.current}px, 0) scale(${r.current})`);
|
|
157
|
-
});
|
|
158
|
-
};
|
|
159
|
-
return t.forEach((a) => {
|
|
160
|
-
a.addEventListener("wheel", i);
|
|
161
|
-
}), () => {
|
|
162
|
-
M.current && cancelAnimationFrame(M.current), t.forEach((a) => {
|
|
163
|
-
a.removeEventListener("wheel", i);
|
|
164
|
-
});
|
|
165
|
-
};
|
|
166
|
-
}, [it]), A(() => {
|
|
167
|
-
const t = () => {
|
|
168
|
-
var s;
|
|
169
|
-
const i = (s = k.current) == null ? void 0 : s.offsetHeight;
|
|
170
|
-
i && ht(`${i}px`);
|
|
171
|
-
};
|
|
172
|
-
return t(), window.addEventListener("resize", t), () => {
|
|
173
|
-
window.removeEventListener("resize", t);
|
|
174
|
-
};
|
|
175
|
-
}, []), A(() => ($ ? Y.current = requestAnimationFrame(() => {
|
|
176
|
-
J(!0);
|
|
177
|
-
}) : J(!1), () => {
|
|
178
|
-
Y.current && cancelAnimationFrame(Y.current);
|
|
179
|
-
}), [$]), A(() => ($ && (r.current = 1, T(1), e.current = 0, n.current = 0, g.current = 0, x.current = 0, o.current = !1, f.current = !1), () => {
|
|
180
|
-
M.current && cancelAnimationFrame(M.current), Y.current && cancelAnimationFrame(Y.current);
|
|
181
|
-
}), [$]), A(() => {
|
|
182
|
-
L.length || C == null || C();
|
|
183
|
-
}, [L, C]), /* @__PURE__ */ q(
|
|
184
|
-
Ct,
|
|
185
|
-
{
|
|
186
|
-
ref: l,
|
|
187
|
-
open: $,
|
|
188
|
-
onClose: C,
|
|
189
|
-
fullScreen: !0,
|
|
190
|
-
statusBarColor: Z.black,
|
|
191
|
-
hideSystemNavigationBar: !0,
|
|
192
|
-
"aria-modal": !0,
|
|
193
|
-
"aria-labelledby": U ? "image-zoom-dialog-title" : void 0,
|
|
194
|
-
inlineCSS: {
|
|
195
|
-
backgroundColor: Z.black,
|
|
196
|
-
scrollbarWidth: "none",
|
|
197
|
-
"&::-webkit-scrollbar": {
|
|
198
|
-
display: "none"
|
|
199
|
-
},
|
|
200
|
-
"& > div": {
|
|
201
|
-
scrollbarWidth: "none",
|
|
202
|
-
"&::-webkit-scrollbar": {
|
|
203
|
-
display: "none"
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
},
|
|
207
|
-
children: [
|
|
208
|
-
/* @__PURE__ */ d(
|
|
209
|
-
w,
|
|
210
|
-
{
|
|
211
|
-
"aria-hidden": !0,
|
|
212
|
-
inlineCSS: {
|
|
213
|
-
position: "absolute",
|
|
214
|
-
top: 0,
|
|
215
|
-
left: 0,
|
|
216
|
-
width: "100%",
|
|
217
|
-
minHeight: "var(--status-bar-height, 0px)",
|
|
218
|
-
backgroundColor: O.dimmed01,
|
|
219
|
-
zIndex: 2
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
),
|
|
223
|
-
/* @__PURE__ */ d(
|
|
224
|
-
w,
|
|
225
|
-
{
|
|
226
|
-
tag: "header",
|
|
227
|
-
inlineCSS: {
|
|
228
|
-
position: "absolute",
|
|
229
|
-
top: "var(--status-bar-height, 0px)",
|
|
230
|
-
left: 0,
|
|
231
|
-
width: "100%",
|
|
232
|
-
backgroundColor: O.dimmed01,
|
|
233
|
-
zIndex: 2
|
|
234
|
-
},
|
|
235
|
-
children: /* @__PURE__ */ q(
|
|
236
|
-
w,
|
|
237
|
-
{
|
|
238
|
-
alignItems: "center",
|
|
239
|
-
p: 2,
|
|
240
|
-
inlineCSS: {
|
|
241
|
-
position: "relative",
|
|
242
|
-
display: "grid",
|
|
243
|
-
gridTemplateColumns: "1fr auto 1fr",
|
|
244
|
-
width: "100%",
|
|
245
|
-
minHeight: 56,
|
|
246
|
-
maxHeight: 56
|
|
247
|
-
},
|
|
248
|
-
children: [
|
|
249
|
-
/* @__PURE__ */ d(w, {}),
|
|
250
|
-
/* @__PURE__ */ d(
|
|
251
|
-
et,
|
|
252
|
-
{
|
|
253
|
-
id: "image-zoom-dialog-title",
|
|
254
|
-
tag: "div",
|
|
255
|
-
variant: "h4B",
|
|
256
|
-
noWrap: !0,
|
|
257
|
-
color: "grey.white",
|
|
258
|
-
"aria-label": "이미지 확대창",
|
|
259
|
-
inlineCSS: {
|
|
260
|
-
flexGrow: 1
|
|
261
|
-
},
|
|
262
|
-
children: U
|
|
263
|
-
}
|
|
264
|
-
),
|
|
265
|
-
/* @__PURE__ */ d(w, { justifyContent: "flex-end", children: /* @__PURE__ */ d(pt, { name: "CloseLine", color: "tertiary", onClick: C, "aria-label": "창 닫기" }) })
|
|
266
|
-
]
|
|
267
|
-
}
|
|
268
|
-
)
|
|
269
|
-
}
|
|
270
|
-
),
|
|
271
|
-
/* @__PURE__ */ d(
|
|
272
|
-
w,
|
|
273
|
-
{
|
|
274
|
-
ref: k,
|
|
275
|
-
alignItems: "center",
|
|
276
|
-
justifyContent: "center",
|
|
277
|
-
inlineCSS: {
|
|
278
|
-
position: "relative",
|
|
279
|
-
width: "100%",
|
|
280
|
-
height: "100%",
|
|
281
|
-
touchAction: "none"
|
|
282
|
-
},
|
|
283
|
-
children: /* @__PURE__ */ d(
|
|
284
|
-
Tt,
|
|
285
|
-
{
|
|
286
|
-
onSwipe: xt,
|
|
287
|
-
onSwiping: Mt,
|
|
288
|
-
initialPage: G,
|
|
289
|
-
disableSwipe: ot,
|
|
290
|
-
loop: at,
|
|
291
|
-
children: L.map(({ url: t, alt: i }) => /* @__PURE__ */ d(St, { children: /* @__PURE__ */ d(
|
|
292
|
-
bt,
|
|
293
|
-
{
|
|
294
|
-
src: t,
|
|
295
|
-
alt: i,
|
|
296
|
-
containerHeight: lt,
|
|
297
|
-
fallback: ct,
|
|
298
|
-
onMouseDown: ft,
|
|
299
|
-
onMouseMove: mt,
|
|
300
|
-
onMouseUp: _,
|
|
301
|
-
onMouseOut: _,
|
|
302
|
-
onTouchStart: dt,
|
|
303
|
-
onTouchMove: gt,
|
|
304
|
-
onTouchEnd: tt,
|
|
305
|
-
onTouchCancel: tt
|
|
306
|
-
}
|
|
307
|
-
) }, `image-${t}`))
|
|
308
|
-
}
|
|
309
|
-
)
|
|
310
|
-
}
|
|
311
|
-
),
|
|
312
|
-
nt,
|
|
313
|
-
/* @__PURE__ */ q(et, { role: "status", visuallyHidden: !0, children: [
|
|
314
|
-
K > 1 && "이미지가 확대되었어요.",
|
|
315
|
-
K <= 1 && "이미지가 원래 크기로 복원되었어요."
|
|
316
|
-
] })
|
|
317
|
-
]
|
|
318
|
-
}
|
|
319
|
-
);
|
|
320
|
-
}
|
|
321
|
-
export {
|
|
322
|
-
Wt as default
|
|
323
|
-
};
|