@dotss/tictoccroc 0.11.1 → 0.12.0
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/index.mjs +100 -96
- package/dist/parent/b2b/components/ActionButtons/ActionButtons.mjs +5 -5
- package/dist/shared/components/Carousel/Carousel.mjs +104 -98
- package/dist/shared/components/Carousel/Carousel.utils.d.ts +8 -0
- package/dist/shared/components/Carousel/Carousel.utils.mjs +12 -0
- package/dist/shared/components/Carousel/Carousel.utils.test.d.ts +1 -0
- package/dist/shared/components/Image/Image.d.ts +1 -0
- package/dist/shared/components/Image/Image.mjs +102 -97
- package/dist/shared/components/Swiper/Swiper.mjs +137 -136
- package/dist/shared/components/Swiper/Swiper.utils.d.ts +10 -0
- package/dist/shared/components/Swiper/Swiper.utils.mjs +13 -2
- package/dist/shared/components/Swiper/Swiper.utils.test.d.ts +1 -0
- package/dist/shared/utils/getHoverChildrenScaleStyle/getHoverChildrenScaleStyle.d.ts +18 -0
- package/dist/shared/utils/getHoverChildrenScaleStyle/getHoverChildrenScaleStyle.mjs +9 -0
- package/dist/shared/utils/getHoverChildrenScaleStyle/getHoverChildrenScaleStyle.test.d.ts +1 -0
- package/dist/shared/utils/getHoverChildrenScaleStyle/index.d.ts +2 -0
- package/dist/shared/utils/getHoverChildrenScaleStyle/index.mjs +5 -0
- package/dist/shared/utils/index.d.ts +1 -0
- package/dist/shared/utils/index.mjs +2 -1
- package/dist/teacher/home/components/Carousel1Account/Carousel1Account.mjs +12 -12
- package/dist/teacher/home/components/Carousel2Account/Carousel2Account.mjs +14 -14
- package/dist/teacher/profile/components/KokTeacherCard/KokTeacherCard.d.ts +21 -0
- package/dist/teacher/profile/components/KokTeacherCard/KokTeacherCard.mjs +202 -0
- package/dist/teacher/profile/components/KokTeacherCard/KokTeacherCard.utils.d.ts +15 -0
- package/dist/teacher/profile/components/KokTeacherCard/KokTeacherCard.utils.mjs +175 -0
- package/dist/teacher/profile/components/KokTeacherCard/index.d.ts +4 -0
- package/dist/teacher/profile/components/KokTeacherCard/index.mjs +6 -0
- package/dist/teacher/profile/components/ProfileSummary/index.d.ts +1 -0
- package/dist/teacher/profile/components/ProfileSummary/index.mjs +4 -3
- package/dist/teacher/profile/components/index.d.ts +2 -0
- package/dist/teacher/profile/components/index.mjs +27 -24
- package/package.json +1 -1
|
@@ -2,53 +2,54 @@ import e from "../../hooks/useInView/index.mjs";
|
|
|
2
2
|
import t from "../../hooks/useIsomorphicLayoutEffect/index.mjs";
|
|
3
3
|
import n from "../../utils/getImageUrl/index.mjs";
|
|
4
4
|
import r from "./Image.error.mjs";
|
|
5
|
-
import { convertHeicToPng as ee, isHeicSource as
|
|
6
|
-
import { forwardRef as
|
|
7
|
-
import { Flexbox as
|
|
8
|
-
import
|
|
5
|
+
import { convertHeicToPng as ee, isHeicSource as te } from "./Image.utils.mjs";
|
|
6
|
+
import { forwardRef as i, useEffect as a, useImperativeHandle as ne, useRef as o, useState as s } from "react";
|
|
7
|
+
import { Flexbox as c, Skeleton as l } from "@dotss/ui";
|
|
8
|
+
import u from "@dotss/ui/hooks/useCheckHoverPossible/useCheckHoverPossible";
|
|
9
|
+
import { Fragment as re, jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
9
10
|
//#region shared/components/Image/Image.tsx
|
|
10
|
-
var
|
|
11
|
-
let F =
|
|
12
|
-
R.current = M,
|
|
11
|
+
var p = i(({ src: i, width: p, height: m, fit: h = "cover", position: g = "center", alt: _, scale: v = 2, onLoad: y, onLazyLoad: b, lazy: x = !1, borderRadius: S, disabledResizing: C = !1, withIntrinsicRatio: w = !1, enableBlurPlaceholder: T = !1, enableFallback: E = !1, enableErrorFallback: D = !0, renderErrorFallback: O, enableHoverScale: k = !1, wrapperProps: A = {}, inViewOptions: j = {}, onError: M, ...N }, P) => {
|
|
12
|
+
let F = o(null), I = o(!1), L = o(null), R = o(M);
|
|
13
|
+
R.current = M, ne(P, () => L.current);
|
|
13
14
|
let { isInView: z } = e(F, {
|
|
14
15
|
threshold: .4,
|
|
15
|
-
...
|
|
16
|
-
}),
|
|
16
|
+
...j
|
|
17
|
+
}), { isHoverPossible: B } = u(), [V, ie] = s(!1), [H, U] = s(!1), [W, G] = s(!1), [K, ae] = s(!1), [q, J] = s(n({
|
|
17
18
|
mode: "original",
|
|
18
|
-
src:
|
|
19
|
-
width:
|
|
20
|
-
height:
|
|
21
|
-
fit:
|
|
22
|
-
position:
|
|
23
|
-
scale:
|
|
24
|
-
disabledResizing:
|
|
25
|
-
})), Y = i
|
|
19
|
+
src: i,
|
|
20
|
+
width: p,
|
|
21
|
+
height: m,
|
|
22
|
+
fit: h,
|
|
23
|
+
position: g,
|
|
24
|
+
scale: v,
|
|
25
|
+
disabledResizing: C
|
|
26
|
+
})), Y = te(i), X = T ? n({
|
|
26
27
|
mode: "blur",
|
|
27
|
-
src:
|
|
28
|
-
width:
|
|
29
|
-
fit:
|
|
30
|
-
position:
|
|
28
|
+
src: i,
|
|
29
|
+
width: p,
|
|
30
|
+
fit: h,
|
|
31
|
+
position: g,
|
|
31
32
|
scale: 1 / 3,
|
|
32
|
-
disabledResizing:
|
|
33
|
+
disabledResizing: C
|
|
33
34
|
}) : null, Z = (e) => {
|
|
34
|
-
U(!0), G(!1), typeof
|
|
35
|
+
U(!0), G(!1), typeof y == "function" && y(e);
|
|
35
36
|
}, Q = (e) => {
|
|
36
37
|
Y && !q.startsWith("blob:") || (typeof M == "function" && M(e.nativeEvent), G(!0), U(!1));
|
|
37
|
-
}, $ = () =>
|
|
38
|
-
return
|
|
39
|
-
if (
|
|
38
|
+
}, $ = () => ae(!0);
|
|
39
|
+
return a(() => {
|
|
40
|
+
if (x && F.current) {
|
|
40
41
|
let e = () => {
|
|
41
|
-
z &&
|
|
42
|
+
z && ie(!0);
|
|
42
43
|
};
|
|
43
44
|
return e(), window.appScreenContent?.addEventListener("scroll", e), window.addEventListener("resize", e), window.addEventListener("orientationchange", e), () => {
|
|
44
45
|
window.appScreenContent?.removeEventListener("scroll", e), window.removeEventListener("resize", e), window.removeEventListener("orientationchange", e);
|
|
45
46
|
};
|
|
46
47
|
}
|
|
47
|
-
}),
|
|
48
|
-
typeof
|
|
49
|
-
}, [
|
|
48
|
+
}), a(() => {
|
|
49
|
+
typeof b == "function" && V && !I.current && (I.current = !0, b());
|
|
50
|
+
}, [b, V]), t(() => {
|
|
50
51
|
let e = L.current, t = !1, n = (e) => {
|
|
51
|
-
ee(
|
|
52
|
+
ee(i).then((n) => {
|
|
52
53
|
t || (J(URL.createObjectURL(n)), e.onload = () => {
|
|
53
54
|
e.style.opacity = "1", U(!0), G(!1), e.onload = null, e.onerror = null;
|
|
54
55
|
}, e.onerror = () => {
|
|
@@ -61,77 +62,79 @@ var h = a(({ src: a, width: h, height: g, fit: _ = "cover", position: v = "cente
|
|
|
61
62
|
})));
|
|
62
63
|
});
|
|
63
64
|
};
|
|
64
|
-
return e?.complete ? Y ? e.src.startsWith("blob:") || (e.style.transition = "opacity 0.3s", e.style.opacity = "0", n(e)) : e.naturalWidth > 0 ? (e.style.transition = "
|
|
65
|
+
return e?.complete ? Y ? e.src.startsWith("blob:") || (e.style.transition = "opacity 0.3s, transform 0.3s", e.style.opacity = "0", n(e)) : e.naturalWidth > 0 ? (e.style.transition = "transform 0.3s", e.style.opacity = "1", U(!0)) : (e.style.opacity = "0", G(!0)) : e && (e.style.transition = "opacity 0.3s, transform 0.3s", e.style.opacity = "0", e.onload = () => {
|
|
65
66
|
e.style.opacity = "1", U(!0), e.onload = null;
|
|
66
67
|
}, e.onerror = () => {
|
|
67
68
|
if (!Y) {
|
|
68
69
|
G(!0), e.onerror = null;
|
|
69
70
|
return;
|
|
70
71
|
}
|
|
71
|
-
G(!1), e.style.transition = "opacity 0.3s", e.style.opacity = "0", n(e);
|
|
72
|
+
G(!1), e.style.transition = "opacity 0.3s, transform 0.3s", e.style.opacity = "0", n(e);
|
|
72
73
|
}), () => {
|
|
73
74
|
t = !0, e && (e.onload = null, e.onerror = null);
|
|
74
75
|
};
|
|
75
76
|
}, [
|
|
76
|
-
|
|
77
|
-
|
|
77
|
+
V,
|
|
78
|
+
i,
|
|
78
79
|
Y
|
|
79
|
-
]),
|
|
80
|
+
]), a(() => {
|
|
80
81
|
J(n({
|
|
81
82
|
mode: "original",
|
|
82
|
-
src:
|
|
83
|
-
width:
|
|
84
|
-
height:
|
|
85
|
-
fit:
|
|
86
|
-
position:
|
|
87
|
-
scale:
|
|
88
|
-
disabledResizing:
|
|
83
|
+
src: i,
|
|
84
|
+
width: p,
|
|
85
|
+
height: m,
|
|
86
|
+
fit: h,
|
|
87
|
+
position: g,
|
|
88
|
+
scale: v,
|
|
89
|
+
disabledResizing: C
|
|
89
90
|
}));
|
|
90
91
|
}, [
|
|
91
|
-
|
|
92
|
+
i,
|
|
93
|
+
p,
|
|
94
|
+
m,
|
|
92
95
|
h,
|
|
93
96
|
g,
|
|
94
|
-
_,
|
|
95
97
|
v,
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
...j,
|
|
98
|
+
C
|
|
99
|
+
]), x ? /* @__PURE__ */ f(c, {
|
|
100
|
+
...A,
|
|
100
101
|
ref: F,
|
|
101
|
-
inlineCSS:
|
|
102
|
+
inlineCSS: w ? {
|
|
102
103
|
position: "relative",
|
|
103
|
-
paddingTop: `calc(100% / ${
|
|
104
|
+
paddingTop: `calc(100% / ${p} * ${m})`,
|
|
104
105
|
minWidth: "100%",
|
|
105
|
-
borderRadius:
|
|
106
|
+
borderRadius: S,
|
|
106
107
|
overflow: "hidden",
|
|
107
|
-
...
|
|
108
|
+
...k && B && { "&:hover img": { transform: "scale(1.03)" } },
|
|
109
|
+
...A?.inlineCSS
|
|
108
110
|
} : {
|
|
109
111
|
position: "relative",
|
|
110
|
-
width:
|
|
111
|
-
minWidth:
|
|
112
|
-
height:
|
|
113
|
-
borderRadius:
|
|
112
|
+
width: p,
|
|
113
|
+
minWidth: p,
|
|
114
|
+
height: m,
|
|
115
|
+
borderRadius: S,
|
|
114
116
|
overflow: "hidden",
|
|
115
|
-
...
|
|
117
|
+
...k && B && { "&:hover img": { transform: "scale(1.03)" } },
|
|
118
|
+
...A?.inlineCSS
|
|
116
119
|
},
|
|
117
120
|
children: [
|
|
118
|
-
|
|
121
|
+
E && /* @__PURE__ */ d(l, {
|
|
119
122
|
width: "100%",
|
|
120
123
|
height: "100%",
|
|
121
|
-
borderRadius:
|
|
124
|
+
borderRadius: S || 0,
|
|
122
125
|
inlineCSS: {
|
|
123
126
|
position: "absolute",
|
|
124
127
|
top: 0,
|
|
125
128
|
left: 0,
|
|
126
|
-
opacity: H ||
|
|
129
|
+
opacity: H || T && K ? 0 : 1,
|
|
127
130
|
transition: "opacity 0.3s"
|
|
128
131
|
}
|
|
129
132
|
}),
|
|
130
|
-
|
|
133
|
+
T && X && V && /* @__PURE__ */ d("img", {
|
|
131
134
|
src: X,
|
|
132
135
|
alt: "",
|
|
133
|
-
width:
|
|
134
|
-
height:
|
|
136
|
+
width: p,
|
|
137
|
+
height: m,
|
|
135
138
|
onLoad: $,
|
|
136
139
|
draggable: !1,
|
|
137
140
|
style: {
|
|
@@ -142,17 +145,17 @@ var h = a(({ src: a, width: h, height: g, fit: _ = "cover", position: v = "cente
|
|
|
142
145
|
height: "100%",
|
|
143
146
|
filter: "blur(5px)",
|
|
144
147
|
opacity: K && !H ? 1 : 0,
|
|
145
|
-
transition: "opacity 0.3s",
|
|
146
|
-
objectFit:
|
|
147
|
-
objectPosition:
|
|
148
|
+
transition: "opacity 0.3s, transform 0.3s",
|
|
149
|
+
objectFit: h,
|
|
150
|
+
objectPosition: g
|
|
148
151
|
}
|
|
149
152
|
}),
|
|
150
|
-
|
|
153
|
+
V && /* @__PURE__ */ f(re, { children: [/* @__PURE__ */ d("img", {
|
|
151
154
|
ref: L,
|
|
152
155
|
src: q,
|
|
153
|
-
alt:
|
|
154
|
-
width:
|
|
155
|
-
height:
|
|
156
|
+
alt: _,
|
|
157
|
+
width: p,
|
|
158
|
+
height: m,
|
|
156
159
|
onLoad: Z,
|
|
157
160
|
onError: Q,
|
|
158
161
|
"aria-hidden": W,
|
|
@@ -164,49 +167,51 @@ var h = a(({ src: a, width: h, height: g, fit: _ = "cover", position: v = "cente
|
|
|
164
167
|
left: 0,
|
|
165
168
|
width: "100%",
|
|
166
169
|
height: "100%",
|
|
167
|
-
transition: "opacity 0.3s",
|
|
170
|
+
transition: "opacity 0.3s, transform 0.3s",
|
|
168
171
|
...N.style
|
|
169
172
|
}
|
|
170
|
-
}),
|
|
173
|
+
}), D && W && (O?.() || /* @__PURE__ */ d(r, {}))] })
|
|
171
174
|
]
|
|
172
|
-
}) : /* @__PURE__ */
|
|
173
|
-
...
|
|
175
|
+
}) : /* @__PURE__ */ f(c, {
|
|
176
|
+
...A,
|
|
174
177
|
ref: F,
|
|
175
|
-
inlineCSS:
|
|
178
|
+
inlineCSS: w ? {
|
|
176
179
|
position: "relative",
|
|
177
|
-
paddingTop: `calc(100% / ${
|
|
180
|
+
paddingTop: `calc(100% / ${p} * ${m})`,
|
|
178
181
|
minWidth: "100%",
|
|
179
182
|
transition: "padding-top 0.2s",
|
|
180
|
-
borderRadius:
|
|
183
|
+
borderRadius: S,
|
|
181
184
|
overflow: "hidden",
|
|
182
|
-
...
|
|
185
|
+
...k && B && { "&:hover img": { transform: "scale(1.03)" } },
|
|
186
|
+
...A?.inlineCSS
|
|
183
187
|
} : {
|
|
184
188
|
position: "relative",
|
|
185
|
-
width:
|
|
186
|
-
minWidth:
|
|
187
|
-
height:
|
|
188
|
-
borderRadius:
|
|
189
|
+
width: p,
|
|
190
|
+
minWidth: p,
|
|
191
|
+
height: m,
|
|
192
|
+
borderRadius: S,
|
|
189
193
|
overflow: "hidden",
|
|
190
|
-
...
|
|
194
|
+
...k && B && { "&:hover img": { transform: "scale(1.03)" } },
|
|
195
|
+
...A?.inlineCSS
|
|
191
196
|
},
|
|
192
197
|
children: [
|
|
193
|
-
|
|
198
|
+
E && /* @__PURE__ */ d(l, {
|
|
194
199
|
width: "100%",
|
|
195
200
|
height: "100%",
|
|
196
|
-
borderRadius:
|
|
201
|
+
borderRadius: S || 0,
|
|
197
202
|
inlineCSS: {
|
|
198
203
|
position: "absolute",
|
|
199
204
|
top: 0,
|
|
200
205
|
left: 0,
|
|
201
|
-
opacity: H ||
|
|
206
|
+
opacity: H || T && K ? 0 : 1,
|
|
202
207
|
transition: "opacity 0.3s"
|
|
203
208
|
}
|
|
204
209
|
}),
|
|
205
|
-
|
|
210
|
+
T && X && /* @__PURE__ */ d("img", {
|
|
206
211
|
src: X,
|
|
207
212
|
alt: "",
|
|
208
|
-
width:
|
|
209
|
-
height:
|
|
213
|
+
width: p,
|
|
214
|
+
height: m,
|
|
210
215
|
onLoad: $,
|
|
211
216
|
draggable: !1,
|
|
212
217
|
style: {
|
|
@@ -220,12 +225,12 @@ var h = a(({ src: a, width: h, height: g, fit: _ = "cover", position: v = "cente
|
|
|
220
225
|
transition: "opacity 0.3s"
|
|
221
226
|
}
|
|
222
227
|
}),
|
|
223
|
-
/* @__PURE__ */
|
|
228
|
+
/* @__PURE__ */ d("img", {
|
|
224
229
|
ref: L,
|
|
225
230
|
src: q,
|
|
226
|
-
alt:
|
|
227
|
-
width:
|
|
228
|
-
height:
|
|
231
|
+
alt: _,
|
|
232
|
+
width: p,
|
|
233
|
+
height: m,
|
|
229
234
|
onLoad: Z,
|
|
230
235
|
onError: Q,
|
|
231
236
|
"aria-hidden": W,
|
|
@@ -237,13 +242,13 @@ var h = a(({ src: a, width: h, height: g, fit: _ = "cover", position: v = "cente
|
|
|
237
242
|
left: 0,
|
|
238
243
|
width: "100%",
|
|
239
244
|
height: "100%",
|
|
240
|
-
transition: "opacity 0.3s",
|
|
245
|
+
transition: "opacity 0.3s, transform 0.3s",
|
|
241
246
|
...N.style
|
|
242
247
|
}
|
|
243
248
|
}),
|
|
244
|
-
|
|
249
|
+
D && W && (O?.() || /* @__PURE__ */ d(r, {}))
|
|
245
250
|
]
|
|
246
251
|
});
|
|
247
252
|
});
|
|
248
253
|
//#endregion
|
|
249
|
-
export {
|
|
254
|
+
export { p as default };
|