@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.
Files changed (72) hide show
  1. package/dist/LessonNotesSection-Bg1DHFxg.js +208 -0
  2. package/dist/index.mjs +102 -100
  3. package/dist/shared/components/Carousel/Carousel.mjs +87 -82
  4. package/dist/shared/components/Masonry/Masonry.mjs +157 -139
  5. package/dist/shared/components/Masonry/Masonry.utils.d.ts +5 -1
  6. package/dist/shared/components/Masonry/Masonry.utils.mjs +53 -52
  7. package/dist/shared/components/Masonry/MasonryBlock/MasonryBlock.d.ts +5 -0
  8. package/dist/shared/components/Masonry/MasonryBlock/MasonryBlock.mjs +93 -59
  9. package/dist/shared/components/MediaDialog/MediaBlock/MediaBlock.d.ts +9 -0
  10. package/dist/shared/components/MediaDialog/MediaBlock/MediaBlock.mjs +70 -0
  11. package/dist/shared/components/MediaDialog/MediaBlock/index.d.ts +2 -0
  12. package/dist/shared/components/MediaDialog/MediaBlock/index.mjs +4 -0
  13. package/dist/shared/components/MediaDialog/MediaDialog.d.ts +13 -0
  14. package/dist/shared/components/MediaDialog/MediaDialog.mjs +327 -0
  15. package/dist/shared/components/MediaDialog/MediaDialogContent/MediaDialogContent.d.ts +3 -0
  16. package/dist/shared/components/{ImageZoomDialog/ImageZoomDialogContent/ImageZoomDialogContent.mjs → MediaDialog/MediaDialogContent/MediaDialogContent.mjs} +2 -2
  17. package/dist/shared/components/MediaDialog/MediaDialogContent/index.d.ts +2 -0
  18. package/dist/shared/components/MediaDialog/MediaDialogContent/index.mjs +4 -0
  19. package/dist/shared/components/MediaDialog/MediaDialogFooter/MediaDialogFooter.d.ts +3 -0
  20. package/dist/shared/components/MediaDialog/MediaDialogFooter/index.d.ts +2 -0
  21. package/dist/shared/components/MediaDialog/MediaDialogFooter/index.mjs +4 -0
  22. package/dist/shared/components/MediaDialog/MediaDialogToolbar/MediaDialogToolbar.d.ts +3 -0
  23. package/dist/shared/components/{ImageZoomDialog/ImageZoomDialogToolbar/ImageZoomDialogToolbar.mjs → MediaDialog/MediaDialogToolbar/MediaDialogToolbar.mjs} +6 -6
  24. package/dist/shared/components/MediaDialog/MediaDialogToolbar/index.d.ts +2 -0
  25. package/dist/shared/components/MediaDialog/MediaDialogToolbar/index.mjs +4 -0
  26. package/dist/shared/components/MediaDialog/index.d.ts +7 -0
  27. package/dist/shared/components/MediaDialog/index.mjs +12 -0
  28. package/dist/shared/components/Roller/Roller.d.ts +1 -1
  29. package/dist/shared/components/Roller/Roller.mjs +1 -1
  30. package/dist/shared/components/Roller/index.mjs +1 -1
  31. package/dist/shared/components/Scheduler/ScheduleEvent/ScheduleEvent.mjs +1 -1
  32. package/dist/shared/components/Scheduler/Scheduler.d.ts +2 -1
  33. package/dist/shared/components/Scheduler/Scheduler.mjs +224 -220
  34. package/dist/shared/components/Swiper/Swiper.mjs +53 -62
  35. package/dist/shared/components/index.d.ts +2 -2
  36. package/dist/shared/components/index.mjs +36 -34
  37. package/dist/teacher/profile/components/AbilityCollection/AbilityBadge/AbilityBadge.mjs +49 -47
  38. package/dist/teacher/profile/components/AbilityCollection/AbilityCollection.mjs +27 -28
  39. package/dist/teacher/profile/components/AbilityCollection/AbilityCollection.utils.mjs +2 -2
  40. package/dist/teacher/profile/components/ActivityGallery/ActivityGallery.mjs +52 -47
  41. package/dist/teacher/profile/components/ActivityGallery/ActivityGalleryItem/ActivityGalleryItem.d.ts +3 -2
  42. package/dist/teacher/profile/components/ActivityGallery/ActivityGalleryItem/ActivityGalleryItem.mjs +33 -61
  43. package/dist/teacher/profile/components/AvailableScheduleSection/AvailableScheduleSection.mjs +38 -24
  44. package/dist/teacher/profile/components/CareerSection/CareerSection.d.ts +2 -2
  45. package/dist/teacher/profile/components/CareerSection/CareerSection.mjs +2 -2
  46. package/dist/teacher/profile/components/CertificationSection/CertificationSection.d.ts +2 -2
  47. package/dist/teacher/profile/components/CertificationSection/CertificationSection.mjs +2 -2
  48. package/dist/teacher/profile/components/EducationSection/EducationSection.d.ts +2 -2
  49. package/dist/teacher/profile/components/EducationSection/EducationSection.mjs +2 -2
  50. package/dist/teacher/profile/components/LessonNotesSection/LessonNotesSection.mjs +1 -1
  51. package/dist/teacher/profile/components/LessonNotesSection/index.mjs +1 -1
  52. package/dist/teacher/profile/components/index.mjs +1 -1
  53. package/package.json +1 -1
  54. package/dist/LessonNotesSection-a2QNdQtj.js +0 -196
  55. package/dist/shared/components/ImageZoomDialog/ImageBlock/ImageBlock.d.ts +0 -8
  56. package/dist/shared/components/ImageZoomDialog/ImageBlock/ImageBlock.mjs +0 -36
  57. package/dist/shared/components/ImageZoomDialog/ImageBlock/index.d.ts +0 -2
  58. package/dist/shared/components/ImageZoomDialog/ImageBlock/index.mjs +0 -4
  59. package/dist/shared/components/ImageZoomDialog/ImageZoomDialog.d.ts +0 -16
  60. package/dist/shared/components/ImageZoomDialog/ImageZoomDialog.mjs +0 -323
  61. package/dist/shared/components/ImageZoomDialog/ImageZoomDialogContent/ImageZoomDialogContent.d.ts +0 -3
  62. package/dist/shared/components/ImageZoomDialog/ImageZoomDialogContent/index.d.ts +0 -2
  63. package/dist/shared/components/ImageZoomDialog/ImageZoomDialogContent/index.mjs +0 -4
  64. package/dist/shared/components/ImageZoomDialog/ImageZoomDialogFooter/ImageZoomDialogFooter.d.ts +0 -3
  65. package/dist/shared/components/ImageZoomDialog/ImageZoomDialogFooter/index.d.ts +0 -2
  66. package/dist/shared/components/ImageZoomDialog/ImageZoomDialogFooter/index.mjs +0 -4
  67. package/dist/shared/components/ImageZoomDialog/ImageZoomDialogToolbar/ImageZoomDialogToolbar.d.ts +0 -3
  68. package/dist/shared/components/ImageZoomDialog/ImageZoomDialogToolbar/index.d.ts +0 -2
  69. package/dist/shared/components/ImageZoomDialog/ImageZoomDialogToolbar/index.mjs +0 -4
  70. package/dist/shared/components/ImageZoomDialog/index.d.ts +0 -6
  71. package/dist/shared/components/ImageZoomDialog/index.mjs +0 -10
  72. /package/dist/shared/components/{ImageZoomDialog/ImageZoomDialogFooter/ImageZoomDialogFooter.mjs → MediaDialog/MediaDialogFooter/MediaDialogFooter.mjs} +0 -0
@@ -1,67 +1,67 @@
1
- import { jsxs as ce, jsx as k } from "react/jsx-runtime";
2
- import { useState as J, useRef as g, Children as Q, isValidElement as ie, useCallback as ae, useEffect as C, cloneElement as le } from "react";
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 ue from "@dotss/ui/core/useTheme";
5
- import fe from "./CarouselSlide/CarouselSlide.mjs";
6
- function ve({
7
- children: Z,
8
- spacing: _ = 2,
9
- edgeSpacing: K = 4,
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: x = 1,
12
- renderPagination: A,
13
- ...O
11
+ step: D = 1,
12
+ renderPagination: z,
13
+ ...T
14
14
  }) {
15
- const { spacing: z } = ue(), [l, $] = J(1), [w, ee] = J(0), L = g(null), o = g(null), u = g(null), I = g(0), Y = g(0), R = g(0), b = g(!1), T = g(!0), D = g(0), v = z.content(_), y = z.content(K), X = Q.toArray(Z).filter(ie).filter((e) => e.type === fe), M = X.length, F = (e, t) => {
16
- I.current = e, Y.current = t;
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 = -R.current >= e && l + 1 <= w, r = -R.current <= -e && l - 1 >= 1;
21
- b.current = !1, T.current = !1, R.current = 0;
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 : r ? c = l - 1 : T.current = !0, o.current.style.transition = "transform 0.2s", o.current.style.cursor = "grab", S(c);
24
- }, S = ae(
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, m, E;
26
+ var h, g, E;
27
27
  if (!o.current) return;
28
- $(e);
29
- const r = e === 1, c = e === w, s = (((h = L.current) == null ? void 0 : h.offsetWidth) || 0) - y, f = (((E = (m = u.current) == null ? void 0 : m.children[0]) == null ? void 0 : E.clientWidth) || 0) + v, i = (s - f * Math.floor(s / f) - v) / 2, d = f * (e - 1) - i;
30
- r ? 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)`;
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, w]
33
- ), te = (e) => F(e.touches[0].clientX, e.touches[0].clientY), ne = (e) => {
34
- b.current = !0, F(e.clientX, e.clientY);
35
- }, re = (e) => {
36
- o.current && (o.current.style.transition = "transform 0.2s", o.current.style.cursor = "grab", S(e));
37
- }, se = (e) => (t) => {
38
- var N, U, q, G, V, B;
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 r = Array.from(((N = u.current) == null ? void 0 : N.children) || []).indexOf(t.currentTarget), c = (((U = L.current) == null ? void 0 : U.offsetWidth) || 0) - y * 2, s = (((G = (q = u.current) == null ? void 0 : q.children[0]) == null ? void 0 : G.clientWidth) || 0) + v, i = Math.floor(c / (s / x)) * a, d = (l - 1) * i, h = d + i - 1, m = ((V = u.current) == null ? void 0 : V.children.length) || 0, E = r % a, j = Math.floor(r / a);
41
- let p = r;
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 n = (j + 1) * a + E;
46
- n < m && (p = n);
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 n = (j - 1) * a + E;
52
- n >= 0 && (p = n);
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 n = r + 1;
58
- n < m && n % a > E && (p = n);
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 n = r - 1;
64
- n >= 0 && n % a < E && (p = n);
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 (p >= d && p <= h) {
76
- const n = (B = u.current) == null ? void 0 : B.children[p];
77
- n == null || n.focus();
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
- p >= 0 && p < m && (D.current = requestAnimationFrame(() => {
81
- var H;
82
- const n = (H = u.current) == null ? void 0 : H.children[p];
83
- n == null || n.focus();
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
- }, oe = (e) => {
86
- e.propertyName === "transform" && (T.current = !0);
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 = () => S(l);
92
+ const e = () => R(l);
90
93
  return e(), window.addEventListener("resize", e), () => {
91
94
  window.removeEventListener("resize", e);
92
95
  };
93
- }, [S, l]), C(() => {
96
+ }, [R, l]), C(() => {
94
97
  const e = () => {
95
98
  var i, d, h;
96
- const t = (((i = L.current) == null ? void 0 : i.offsetWidth) || 0) - y * 2, r = (((h = (d = u.current) == null ? void 0 : d.children[0]) == null ? void 0 : h.clientWidth) || 0) + v, c = Math.floor(t / (r / x)), s = Math.ceil(M / (a || 1)), f = Math.max(s - (c - 1), 1);
97
- $((m) => m > f ? f : m), ee(f);
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, x, a]), C(() => {
105
+ }, [y, v, M, D, a]), C(() => {
103
106
  const e = o.current, t = (s, f, i) => {
104
- if (!e || w <= 1) return;
105
- e.style.transition = "none", e.style.cursor = "grabbing", R.current = s - I.current;
106
- const d = f - Y.current, h = 5;
107
- b.current = b.current || Math.abs(R.current) > h && Math.abs(d) < h * 2, b.current && (i.cancelable && (i.stopPropagation(), i.preventDefault()), e.style.transition = "none", e.style.cursor = "grabbing", S(l, R.current));
108
- }, r = (s) => t(s.touches[0].clientX, s.touches[0].clientY, s), c = (s) => {
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", r)), () => {
112
- e && (e.removeEventListener("mousemove", c), e.removeEventListener("touchmove", r));
114
+ return e && (e.addEventListener("mousemove", c), e.addEventListener("touchmove", n)), () => {
115
+ e && (e.removeEventListener("mousemove", c), e.removeEventListener("touchmove", n));
113
116
  };
114
- }, [S, l, w]), C(() => () => {
115
- D.current && cancelAnimationFrame(D.current);
117
+ }, [R, l, S]), C(() => () => {
118
+ k.current && cancelAnimationFrame(k.current);
116
119
  }, []), C(() => {
117
- const e = u.current, t = (r) => {
118
- T.current || r.stopPropagation();
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__ */ ce(
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__ */ k(
140
+ /* @__PURE__ */ A(
137
141
  W,
138
142
  {
139
- ref: L,
143
+ ref: x,
140
144
  inlineCSS: {
141
145
  overflow: "hidden"
142
146
  },
143
- children: /* @__PURE__ */ k(
147
+ children: /* @__PURE__ */ A(
144
148
  W,
145
149
  {
146
150
  ref: o,
147
- onMouseDown: ne,
151
+ onMouseDown: se,
148
152
  onMouseUp: P,
149
153
  onMouseLeave: P,
150
- onTouchStart: te,
154
+ onTouchStart: re,
151
155
  onTouchEnd: P,
152
156
  onTouchCancel: P,
153
- onTransitionEnd: oe,
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__ */ k(
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: Q.map(
173
- X,
176
+ children: Z.map(
177
+ N,
174
178
  (e, t) => {
175
- var r;
176
- return le(e, {
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: se(e.props.onKeyDown),
187
+ onKeyDown: ce(e.props.onKeyDown),
188
+ onFocus: ae(e.props.onFocus),
184
189
  ...e.props,
185
190
  style: {
186
- ...(r = e.props) == null ? void 0 : r.style,
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 A == "function" && A({ page: l, totalPages: w, onChange: re })
203
+ typeof z == "function" && z({ page: l, totalPages: S, onChange: oe })
199
204
  ]
200
205
  }
201
206
  );
202
207
  }
203
208
  export {
204
- ve as default
209
+ Ee as default
205
210
  };