@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.
Files changed (71) 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 +172 -146
  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 +6 -1
  8. package/dist/shared/components/Masonry/MasonryBlock/MasonryBlock.mjs +117 -66
  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 +330 -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/{ImageZoomDialog/ImageZoomDialogFooter/ImageZoomDialogFooter.mjs → MediaDialog/MediaDialogFooter/MediaDialogFooter.mjs} +1 -1
  21. package/dist/shared/components/MediaDialog/MediaDialogFooter/index.d.ts +2 -0
  22. package/dist/shared/components/MediaDialog/MediaDialogFooter/index.mjs +4 -0
  23. package/dist/shared/components/MediaDialog/MediaDialogToolbar/MediaDialogToolbar.d.ts +3 -0
  24. package/dist/shared/components/{ImageZoomDialog/ImageZoomDialogToolbar/ImageZoomDialogToolbar.mjs → MediaDialog/MediaDialogToolbar/MediaDialogToolbar.mjs} +6 -6
  25. package/dist/shared/components/MediaDialog/MediaDialogToolbar/index.d.ts +2 -0
  26. package/dist/shared/components/MediaDialog/MediaDialogToolbar/index.mjs +4 -0
  27. package/dist/shared/components/MediaDialog/index.d.ts +7 -0
  28. package/dist/shared/components/MediaDialog/index.mjs +12 -0
  29. package/dist/shared/components/Roller/Roller.d.ts +1 -1
  30. package/dist/shared/components/Roller/Roller.mjs +1 -1
  31. package/dist/shared/components/Roller/index.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 +54 -63
  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
@@ -1,77 +1,128 @@
1
- import { jsx as p } from "react/jsx-runtime";
2
- import { forwardRef as h, useState as m, useRef as k, useImperativeHandle as w, useEffect as c, Children as x, isValidElement as B, cloneElement as S } from "react";
3
- import { Flexbox as f } from "@dotss/ui";
4
- import C from "../../Image/Image.mjs";
5
- const j = h(
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: g,
8
- spacing: s = 2,
9
- width: e = 0,
10
- height: i = 0,
11
- borderRadius: d,
12
- direction: u = "vertical",
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
- ...r
15
- }, v) => {
16
- const [l, y] = m(e ?? 0), [a, b] = m(i ?? 0), n = k(null);
17
- return w(v, () => n.current), c(() => {
18
- y(e), b(i);
19
- }, [e, i]), c(() => {
20
- o == null || o(n.current);
21
- }, [o]), /* @__PURE__ */ p(
22
- f,
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: n,
25
- ...r,
35
+ ref: h,
36
+ flexDirection: "column",
37
+ ...e,
26
38
  inlineCSS: {
27
- scrollbarWidth: "none",
28
- transform: "translate3d(0, 0, 0)",
29
- "&::-webkit-scrollbar": {
30
- display: "none"
31
- }
39
+ breakInside: "avoid",
40
+ ...e == null ? void 0 : e.inlineCSS
32
41
  },
33
- style: u === "vertical" ? {
34
- ...r.style,
35
- position: "relative",
36
- marginBottom: s,
37
- borderRadius: d,
38
- paddingTop: `calc(${a / l} * 100%)`,
39
- transition: "padding-top 0.3s 0.1s",
40
- overflow: "hidden"
41
- } : {
42
- ...r.style,
43
- position: "relative",
44
- marginBottom: s,
45
- borderRadius: d,
46
- paddingLeft: l,
47
- paddingTop: a,
48
- transition: "padding-top 0.3s 0.1s, padding-left 0.3s 0.1s",
49
- overflow: "hidden"
50
- },
51
- children: /* @__PURE__ */ p(
52
- f,
53
- {
54
- inlineCSS: {
55
- position: "absolute",
56
- top: 0,
57
- left: 0,
58
- width: "100%",
59
- height: "100%",
60
- overflow: "auto",
61
- zIndex: 1
62
- },
63
- children: x.toArray(g).filter(B).map((t) => t.type === C || t.type === "img" ? S(t, {
64
- width: l,
65
- height: a,
66
- draggable: !1,
67
- ...t.props
68
- }) : t)
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
- j as default
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,2 @@
1
+ import { default as MediaBlock } from './MediaBlock';
2
+ export default MediaBlock;
@@ -0,0 +1,4 @@
1
+ import a from "./MediaBlock.mjs";
2
+ export {
3
+ a as default
4
+ };
@@ -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
+ };
@@ -0,0 +1,3 @@
1
+ import { PropsWithChildren } from 'react';
2
+ declare function MediaDialogContent({ children }: PropsWithChildren): import("@emotion/react/jsx-runtime").JSX.Element;
3
+ export default MediaDialogContent;
@@ -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 p({ children: n }) {
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
- p as default
22
+ c as default
23
23
  };
@@ -0,0 +1,2 @@
1
+ import { default as MediaDialogContent } from './MediaDialogContent';
2
+ export default MediaDialogContent;
@@ -0,0 +1,4 @@
1
+ import t from "./MediaDialogContent.mjs";
2
+ export {
3
+ t as default
4
+ };
@@ -0,0 +1,3 @@
1
+ import { PropsWithChildren } from 'react';
2
+ declare function MediaDialogFooter({ children }: PropsWithChildren): import("@emotion/react/jsx-runtime").JSX.Element;
3
+ export default MediaDialogFooter;