@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,67 +1,67 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
1
|
+
import { jsxs as le, jsx as A } from "react/jsx-runtime";
|
|
2
|
+
import { useState as I, useRef as p, Children as Z, isValidElement as ue, useCallback as fe, useEffect as C, cloneElement as de } from "react";
|
|
3
3
|
import { Flexbox as W } from "@dotss/ui";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
function
|
|
7
|
-
children:
|
|
8
|
-
spacing:
|
|
9
|
-
edgeSpacing:
|
|
4
|
+
import he from "@dotss/ui/core/useTheme";
|
|
5
|
+
import me from "./CarouselSlide/CarouselSlide.mjs";
|
|
6
|
+
function Ee({
|
|
7
|
+
children: _,
|
|
8
|
+
spacing: K = 2,
|
|
9
|
+
edgeSpacing: O = 4,
|
|
10
10
|
rowCount: a = 2,
|
|
11
|
-
step:
|
|
12
|
-
renderPagination:
|
|
13
|
-
...
|
|
11
|
+
step: D = 1,
|
|
12
|
+
renderPagination: z,
|
|
13
|
+
...T
|
|
14
14
|
}) {
|
|
15
|
-
const { spacing:
|
|
16
|
-
|
|
15
|
+
const { spacing: $ } = he(), [l, Y] = I(1), [S, ee] = I(0), [te, ne] = I(0), x = p(null), o = p(null), u = p(null), X = p(0), F = p(0), w = p(0), b = p(!1), L = p(!0), k = p(0), v = $.content(K), y = $.content(O), N = Z.toArray(_).filter(ue).filter((e) => e.type === me), M = N.length, j = (e, t) => {
|
|
16
|
+
X.current = e, F.current = t;
|
|
17
17
|
}, P = () => {
|
|
18
18
|
var s;
|
|
19
19
|
if (!o.current || !b.current) return;
|
|
20
|
-
const e = (((s = u.current) == null ? void 0 : s.offsetWidth) || 0) * 0.01, t = -
|
|
21
|
-
b.current = !1,
|
|
20
|
+
const e = (((s = u.current) == null ? void 0 : s.offsetWidth) || 0) * 0.01, t = -w.current >= e && l + 1 <= S, n = -w.current <= -e && l - 1 >= 1;
|
|
21
|
+
b.current = !1, L.current = !1, w.current = 0;
|
|
22
22
|
let c = l;
|
|
23
|
-
t ? c = l + 1 :
|
|
24
|
-
},
|
|
23
|
+
t ? c = l + 1 : n ? c = l - 1 : L.current = !0, o.current.style.transition = "transform 0.2s", o.current.style.cursor = "grab", R(c);
|
|
24
|
+
}, R = fe(
|
|
25
25
|
(e, t = 0) => {
|
|
26
|
-
var h,
|
|
26
|
+
var h, g, E;
|
|
27
27
|
if (!o.current) return;
|
|
28
|
-
|
|
29
|
-
const
|
|
30
|
-
|
|
28
|
+
Y(e);
|
|
29
|
+
const n = e === 1, c = e === S, s = (((h = x.current) == null ? void 0 : h.offsetWidth) || 0) - y, f = (((E = (g = u.current) == null ? void 0 : g.children[0]) == null ? void 0 : E.clientWidth) || 0) + v, i = (s - f * Math.floor(s / f) - v) / 2, d = f * (e - 1) - i;
|
|
30
|
+
n ? o.current.style.transform = `translate3d(${t}px, 0, 0)` : c ? o.current.style.transform = `translate3d(${-(d - i) + t}px, 0, 0)` : o.current.style.transform = `translate3d(${-d + t}px, 0, 0)`;
|
|
31
31
|
},
|
|
32
|
-
[y, v,
|
|
33
|
-
),
|
|
34
|
-
b.current = !0,
|
|
35
|
-
},
|
|
36
|
-
o.current && (o.current.style.transition = "transform 0.2s", o.current.style.cursor = "grab",
|
|
37
|
-
},
|
|
38
|
-
var
|
|
32
|
+
[y, v, S]
|
|
33
|
+
), re = (e) => j(e.touches[0].clientX, e.touches[0].clientY), se = (e) => {
|
|
34
|
+
b.current = !0, j(e.clientX, e.clientY);
|
|
35
|
+
}, oe = (e) => {
|
|
36
|
+
o.current && (o.current.style.transition = "transform 0.2s", o.current.style.cursor = "grab", R(e));
|
|
37
|
+
}, ce = (e) => (t) => {
|
|
38
|
+
var q, G, V, B, H, J;
|
|
39
39
|
t.stopPropagation();
|
|
40
|
-
const
|
|
41
|
-
let
|
|
40
|
+
const n = Array.from(((q = u.current) == null ? void 0 : q.children) || []).indexOf(t.currentTarget), c = (((G = x.current) == null ? void 0 : G.offsetWidth) || 0) - y * 2, s = (((B = (V = u.current) == null ? void 0 : V.children[0]) == null ? void 0 : B.clientWidth) || 0) + v, i = Math.floor(c / (s / D)) * a, d = (l - 1) * i, h = d + i - 1, g = ((H = u.current) == null ? void 0 : H.children.length) || 0, E = n % a, U = Math.floor(n / a);
|
|
41
|
+
let m = n;
|
|
42
42
|
switch (t.key) {
|
|
43
43
|
case "ArrowRight": {
|
|
44
44
|
t.preventDefault();
|
|
45
|
-
const
|
|
46
|
-
|
|
45
|
+
const r = (U + 1) * a + E;
|
|
46
|
+
r < g && (m = r);
|
|
47
47
|
break;
|
|
48
48
|
}
|
|
49
49
|
case "ArrowLeft": {
|
|
50
50
|
t.preventDefault();
|
|
51
|
-
const
|
|
52
|
-
|
|
51
|
+
const r = (U - 1) * a + E;
|
|
52
|
+
r >= 0 && (m = r);
|
|
53
53
|
break;
|
|
54
54
|
}
|
|
55
55
|
case "ArrowDown": {
|
|
56
56
|
t.preventDefault();
|
|
57
|
-
const
|
|
58
|
-
|
|
57
|
+
const r = n + 1;
|
|
58
|
+
r < g && r % a > E && (m = r);
|
|
59
59
|
break;
|
|
60
60
|
}
|
|
61
61
|
case "ArrowUp": {
|
|
62
62
|
t.preventDefault();
|
|
63
|
-
const
|
|
64
|
-
|
|
63
|
+
const r = n - 1;
|
|
64
|
+
r >= 0 && r % a < E && (m = r);
|
|
65
65
|
break;
|
|
66
66
|
}
|
|
67
67
|
case "Enter":
|
|
@@ -72,55 +72,58 @@ function ve({
|
|
|
72
72
|
default:
|
|
73
73
|
return;
|
|
74
74
|
}
|
|
75
|
-
if (
|
|
76
|
-
const
|
|
77
|
-
|
|
75
|
+
if (m >= d && m <= h) {
|
|
76
|
+
const r = (J = u.current) == null ? void 0 : J.children[m];
|
|
77
|
+
r == null || r.focus();
|
|
78
78
|
return;
|
|
79
79
|
}
|
|
80
|
-
|
|
81
|
-
var
|
|
82
|
-
const
|
|
83
|
-
|
|
80
|
+
m >= 0 && m < g && (k.current = requestAnimationFrame(() => {
|
|
81
|
+
var Q;
|
|
82
|
+
const r = (Q = u.current) == null ? void 0 : Q.children[m];
|
|
83
|
+
r == null || r.focus();
|
|
84
84
|
})), e == null || e(t);
|
|
85
|
-
},
|
|
86
|
-
e.propertyName === "transform" && (
|
|
85
|
+
}, ie = (e) => {
|
|
86
|
+
e.propertyName === "transform" && (L.current = !0);
|
|
87
|
+
}, ae = (e) => (t) => {
|
|
88
|
+
const n = Number(t.currentTarget.getAttribute("aria-posinset")) - 1;
|
|
89
|
+
ne(n), e == null || e(t);
|
|
87
90
|
};
|
|
88
91
|
return C(() => {
|
|
89
|
-
const e = () =>
|
|
92
|
+
const e = () => R(l);
|
|
90
93
|
return e(), window.addEventListener("resize", e), () => {
|
|
91
94
|
window.removeEventListener("resize", e);
|
|
92
95
|
};
|
|
93
|
-
}, [
|
|
96
|
+
}, [R, l]), C(() => {
|
|
94
97
|
const e = () => {
|
|
95
98
|
var i, d, h;
|
|
96
|
-
const t = (((i =
|
|
97
|
-
|
|
99
|
+
const t = (((i = x.current) == null ? void 0 : i.offsetWidth) || 0) - y * 2, n = (((h = (d = u.current) == null ? void 0 : d.children[0]) == null ? void 0 : h.clientWidth) || 0) + v, c = Math.floor(t / (n / D)), s = Math.ceil(M / (a || 1)), f = Math.max(s - (c - 1), 1);
|
|
100
|
+
Y((g) => g > f ? f : g), ee(f);
|
|
98
101
|
};
|
|
99
102
|
return e(), window.addEventListener("resize", e), () => {
|
|
100
103
|
window.removeEventListener("resize", e);
|
|
101
104
|
};
|
|
102
|
-
}, [y, v, M,
|
|
105
|
+
}, [y, v, M, D, a]), C(() => {
|
|
103
106
|
const e = o.current, t = (s, f, i) => {
|
|
104
|
-
if (!e ||
|
|
105
|
-
e.style.transition = "none", e.style.cursor = "grabbing",
|
|
106
|
-
const d = f -
|
|
107
|
-
b.current = b.current || Math.abs(
|
|
108
|
-
},
|
|
107
|
+
if (!e || S <= 1) return;
|
|
108
|
+
e.style.transition = "none", e.style.cursor = "grabbing", w.current = s - X.current;
|
|
109
|
+
const d = f - F.current, h = 5;
|
|
110
|
+
b.current = b.current || Math.abs(w.current) > h && Math.abs(d) < h * 2, b.current && (i.cancelable && (i.stopPropagation(), i.preventDefault()), e.style.transition = "none", e.style.cursor = "grabbing", R(l, w.current));
|
|
111
|
+
}, n = (s) => t(s.touches[0].clientX, s.touches[0].clientY, s), c = (s) => {
|
|
109
112
|
b.current && t(s.clientX, s.clientY, s);
|
|
110
113
|
};
|
|
111
|
-
return e && (e.addEventListener("mousemove", c), e.addEventListener("touchmove",
|
|
112
|
-
e && (e.removeEventListener("mousemove", c), e.removeEventListener("touchmove",
|
|
114
|
+
return e && (e.addEventListener("mousemove", c), e.addEventListener("touchmove", n)), () => {
|
|
115
|
+
e && (e.removeEventListener("mousemove", c), e.removeEventListener("touchmove", n));
|
|
113
116
|
};
|
|
114
|
-
}, [
|
|
115
|
-
|
|
117
|
+
}, [R, l, S]), C(() => () => {
|
|
118
|
+
k.current && cancelAnimationFrame(k.current);
|
|
116
119
|
}, []), C(() => {
|
|
117
|
-
const e = u.current, t = (
|
|
118
|
-
|
|
120
|
+
const e = u.current, t = (n) => {
|
|
121
|
+
L.current || n.stopPropagation();
|
|
119
122
|
};
|
|
120
123
|
return e == null || e.addEventListener("click", t), () => {
|
|
121
124
|
e == null || e.removeEventListener("click", t);
|
|
122
125
|
};
|
|
123
|
-
}, []), /* @__PURE__ */
|
|
126
|
+
}, []), /* @__PURE__ */ le(
|
|
124
127
|
W,
|
|
125
128
|
{
|
|
126
129
|
flexDirection: "column",
|
|
@@ -128,29 +131,30 @@ function ve({
|
|
|
128
131
|
"aria-roledescription": "carousel",
|
|
129
132
|
"aria-label": "슬라이더",
|
|
130
133
|
flexGrow: 1,
|
|
134
|
+
...T,
|
|
131
135
|
inlineCSS: {
|
|
132
|
-
width: "100%"
|
|
136
|
+
width: "100%",
|
|
137
|
+
...T == null ? void 0 : T.inlineCSS
|
|
133
138
|
},
|
|
134
|
-
...O,
|
|
135
139
|
children: [
|
|
136
|
-
/* @__PURE__ */
|
|
140
|
+
/* @__PURE__ */ A(
|
|
137
141
|
W,
|
|
138
142
|
{
|
|
139
|
-
ref:
|
|
143
|
+
ref: x,
|
|
140
144
|
inlineCSS: {
|
|
141
145
|
overflow: "hidden"
|
|
142
146
|
},
|
|
143
|
-
children: /* @__PURE__ */
|
|
147
|
+
children: /* @__PURE__ */ A(
|
|
144
148
|
W,
|
|
145
149
|
{
|
|
146
150
|
ref: o,
|
|
147
|
-
onMouseDown:
|
|
151
|
+
onMouseDown: se,
|
|
148
152
|
onMouseUp: P,
|
|
149
153
|
onMouseLeave: P,
|
|
150
|
-
onTouchStart:
|
|
154
|
+
onTouchStart: re,
|
|
151
155
|
onTouchEnd: P,
|
|
152
156
|
onTouchCancel: P,
|
|
153
|
-
onTransitionEnd:
|
|
157
|
+
onTransitionEnd: ie,
|
|
154
158
|
inlineCSS: {
|
|
155
159
|
gap: v,
|
|
156
160
|
paddingLeft: y,
|
|
@@ -159,7 +163,7 @@ function ve({
|
|
|
159
163
|
transform: "translate3d(0, 0, 0)",
|
|
160
164
|
cursor: "grab"
|
|
161
165
|
},
|
|
162
|
-
children: /* @__PURE__ */
|
|
166
|
+
children: /* @__PURE__ */ A(
|
|
163
167
|
W,
|
|
164
168
|
{
|
|
165
169
|
ref: u,
|
|
@@ -169,21 +173,22 @@ function ve({
|
|
|
169
173
|
gridTemplateRows: "min-content",
|
|
170
174
|
transform: "translate3d(0, 0, 0)"
|
|
171
175
|
},
|
|
172
|
-
children:
|
|
173
|
-
|
|
176
|
+
children: Z.map(
|
|
177
|
+
N,
|
|
174
178
|
(e, t) => {
|
|
175
|
-
var
|
|
176
|
-
return
|
|
179
|
+
var n;
|
|
180
|
+
return de(e, {
|
|
177
181
|
role: "listitem",
|
|
178
|
-
tabIndex: 0,
|
|
182
|
+
tabIndex: t === te ? 0 : -1,
|
|
179
183
|
"aria-roledescription": "slide",
|
|
180
184
|
"aria-label": `${M}개 중 ${t + 1}번째 슬라이드`,
|
|
181
185
|
"aria-posinset": t + 1,
|
|
182
186
|
"aria-setsize": M,
|
|
183
|
-
onKeyDown:
|
|
187
|
+
onKeyDown: ce(e.props.onKeyDown),
|
|
188
|
+
onFocus: ae(e.props.onFocus),
|
|
184
189
|
...e.props,
|
|
185
190
|
style: {
|
|
186
|
-
...(
|
|
191
|
+
...(n = e.props) == null ? void 0 : n.style,
|
|
187
192
|
gridRow: `${t % a + 1} / ${t % a + 1}`
|
|
188
193
|
}
|
|
189
194
|
});
|
|
@@ -195,11 +200,11 @@ function ve({
|
|
|
195
200
|
)
|
|
196
201
|
}
|
|
197
202
|
),
|
|
198
|
-
typeof
|
|
203
|
+
typeof z == "function" && z({ page: l, totalPages: S, onChange: oe })
|
|
199
204
|
]
|
|
200
205
|
}
|
|
201
206
|
);
|
|
202
207
|
}
|
|
203
208
|
export {
|
|
204
|
-
|
|
209
|
+
Ee as default
|
|
205
210
|
};
|