reykit 1.0.210 → 1.0.212
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.js +43 -27
- package/dist/src/component/Media.d.ts +4 -1
- package/dist/src/lib/react.d.ts +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -27549,7 +27549,7 @@ function _0() {
|
|
|
27549
27549
|
}, []), i;
|
|
27550
27550
|
}
|
|
27551
27551
|
function PC(a, i) {
|
|
27552
|
-
return _0() ?
|
|
27552
|
+
return _0() ? a : i;
|
|
27553
27553
|
}
|
|
27554
27554
|
function T6(a, ...i) {
|
|
27555
27555
|
wE(
|
|
@@ -49139,7 +49139,9 @@ function K4({
|
|
|
49139
49139
|
render: /* @__PURE__ */ x.jsx(
|
|
49140
49140
|
"img",
|
|
49141
49141
|
{
|
|
49142
|
-
src: a
|
|
49142
|
+
src: a,
|
|
49143
|
+
loading: "lazy",
|
|
49144
|
+
className: "size-full object-cover"
|
|
49143
49145
|
}
|
|
49144
49146
|
),
|
|
49145
49147
|
...i,
|
|
@@ -49154,7 +49156,6 @@ function K4({
|
|
|
49154
49156
|
"img",
|
|
49155
49157
|
{
|
|
49156
49158
|
src: a,
|
|
49157
|
-
loading: "lazy",
|
|
49158
49159
|
className: "block max-w-[90vw] max-h-[90vh] w-auto h-auto object-contain"
|
|
49159
49160
|
}
|
|
49160
49161
|
)
|
|
@@ -49176,7 +49177,8 @@ function $4({
|
|
|
49176
49177
|
{
|
|
49177
49178
|
src: a,
|
|
49178
49179
|
preload: "metadata",
|
|
49179
|
-
playsInline: !0
|
|
49180
|
+
playsInline: !0,
|
|
49181
|
+
className: "size-full object-cover"
|
|
49180
49182
|
}
|
|
49181
49183
|
),
|
|
49182
49184
|
...i,
|
|
@@ -49205,23 +49207,30 @@ function $4({
|
|
|
49205
49207
|
function vk({
|
|
49206
49208
|
data: a,
|
|
49207
49209
|
orientation: i = "auto",
|
|
49208
|
-
|
|
49209
|
-
|
|
49210
|
+
showNum: u = 1,
|
|
49211
|
+
showCount: d = !0,
|
|
49212
|
+
language: m = "en"
|
|
49210
49213
|
}) {
|
|
49211
49214
|
i === "auto" && (i = PC(
|
|
49212
|
-
"
|
|
49213
|
-
"
|
|
49215
|
+
"vertical",
|
|
49216
|
+
"horizontal"
|
|
49214
49217
|
));
|
|
49215
|
-
const
|
|
49218
|
+
const g = {
|
|
49219
|
+
1: "basis-1/2",
|
|
49220
|
+
2: "basis-1/3",
|
|
49221
|
+
3: "basis-1/4",
|
|
49222
|
+
4: "basis-1/5",
|
|
49223
|
+
5: "basis-1/6"
|
|
49224
|
+
}[u], [v, b] = Zo(1), [C, T] = Zo(), R = Dj(!1);
|
|
49216
49225
|
return wE(() => {
|
|
49217
|
-
if (!
|
|
49218
|
-
const
|
|
49219
|
-
|
|
49226
|
+
if (!C) return;
|
|
49227
|
+
const N = () => {
|
|
49228
|
+
b(C.selectedScrollSnap() + 1);
|
|
49220
49229
|
};
|
|
49221
|
-
return
|
|
49222
|
-
|
|
49230
|
+
return N(), C.on("select", N), () => {
|
|
49231
|
+
C.off("select", N);
|
|
49223
49232
|
};
|
|
49224
|
-
}, [
|
|
49233
|
+
}, [C]), /* @__PURE__ */ x.jsxs("div", { className: "flex flex-col place-items-center gap-4 size-full", children: [
|
|
49225
49234
|
/* @__PURE__ */ x.jsxs(
|
|
49226
49235
|
O_,
|
|
49227
49236
|
{
|
|
@@ -49229,32 +49238,39 @@ function vk({
|
|
|
49229
49238
|
align: "center",
|
|
49230
49239
|
loop: !0
|
|
49231
49240
|
},
|
|
49232
|
-
setApi:
|
|
49233
|
-
onWheel: (
|
|
49234
|
-
|
|
49235
|
-
|
|
49241
|
+
setApi: T,
|
|
49242
|
+
onWheel: (N) => {
|
|
49243
|
+
R.current || (R.current = !0, N.deltaY > 0 ? C?.scrollNext() : C?.scrollPrev(), setTimeout(() => {
|
|
49244
|
+
R.current = !1;
|
|
49236
49245
|
}, 300));
|
|
49237
49246
|
},
|
|
49238
49247
|
orientation: i,
|
|
49239
|
-
className:
|
|
49248
|
+
className: ie(
|
|
49249
|
+
"size-full",
|
|
49250
|
+
'[&_[data-slot="carousel-content"]]:absolute',
|
|
49251
|
+
'[&_[data-slot="carousel-content"]]:inset-0',
|
|
49252
|
+
'md:[&_[data-slot="carousel-content"]>div]:h-full',
|
|
49253
|
+
'min-md:[&_[data-slot="carousel-content"]>div]:w-full'
|
|
49254
|
+
),
|
|
49240
49255
|
children: [
|
|
49241
49256
|
/* @__PURE__ */ x.jsx(A_, { size: "icon" }),
|
|
49242
|
-
/* @__PURE__ */ x.jsx(N_, { className: "place-items-center m-1 md:m-2 max-h-
|
|
49257
|
+
/* @__PURE__ */ x.jsx(N_, { className: "place-items-center m-1 md:m-2 max-h-1/1", children: a.map(({ type: N, path: A }, M) => /* @__PURE__ */ x.jsx(
|
|
49243
49258
|
M_,
|
|
49244
49259
|
{
|
|
49245
49260
|
className: ie(
|
|
49246
|
-
|
|
49247
|
-
"
|
|
49261
|
+
g,
|
|
49262
|
+
"overflow-hidden border md:h-[90%] md:max-h-[90%]",
|
|
49263
|
+
"place-items-center flex p-0 rounded-2xl shadow-md my-1 md:mx-2"
|
|
49248
49264
|
),
|
|
49249
|
-
children:
|
|
49265
|
+
children: N === "image" ? /* @__PURE__ */ x.jsx(K4, { path: A }) : N === "video" ? /* @__PURE__ */ x.jsx($4, { path: A }) : void 0
|
|
49250
49266
|
},
|
|
49251
|
-
|
|
49267
|
+
M
|
|
49252
49268
|
)) }),
|
|
49253
49269
|
/* @__PURE__ */ x.jsx(D_, { size: "icon" })
|
|
49254
49270
|
]
|
|
49255
49271
|
}
|
|
49256
49272
|
),
|
|
49257
|
-
/* @__PURE__ */ x.jsx("div", { className: "flex-1 text-sm text-muted-foreground hidden md:flex", children: { en: `${
|
|
49273
|
+
d && /* @__PURE__ */ x.jsx("div", { className: "flex-1 text-sm text-muted-foreground hidden md:flex", children: { en: `${v} / ${a.length} item(s)`, zh: `第 ${v} / ${a.length} 个` }[m] })
|
|
49258
49274
|
] });
|
|
49259
49275
|
}
|
|
49260
49276
|
function yk({
|
|
@@ -49354,7 +49370,7 @@ function Sk({
|
|
|
49354
49370
|
mobilePageSize: C = 10,
|
|
49355
49371
|
language: T = "en"
|
|
49356
49372
|
}) {
|
|
49357
|
-
const R = PC(
|
|
49373
|
+
const R = PC(C, b), [N, A] = Zo(R), [M, O] = Zo(1);
|
|
49358
49374
|
u || (u = Array.from(
|
|
49359
49375
|
new Set(
|
|
49360
49376
|
a.flatMap((ne) => Object.keys(ne))
|
|
@@ -22,14 +22,17 @@ export declare function PopupVideo({ path, ...args }: {
|
|
|
22
22
|
* @param data - Media data.
|
|
23
23
|
* @param orientation - Carousel orientation.
|
|
24
24
|
* - `auto` : Automatic set, when is mobile, then is `vertical`, otherwise is `horizontal`.
|
|
25
|
+
* @param showNum - Show content number.
|
|
26
|
+
* @param showCount - Whether show count text on non mobile client.
|
|
25
27
|
* @param language - Language type.
|
|
26
28
|
*/
|
|
27
|
-
export declare function CarouselMedia({ data, orientation, showCount, language }: {
|
|
29
|
+
export declare function CarouselMedia({ data, orientation, showNum, showCount, language }: {
|
|
28
30
|
data: {
|
|
29
31
|
type: 'image' | 'video';
|
|
30
32
|
path: string;
|
|
31
33
|
}[];
|
|
32
34
|
orientation?: 'auto' | 'horizontal' | 'vertical';
|
|
35
|
+
showNum?: 1 | 2 | 3 | 4 | 5;
|
|
33
36
|
showCount?: boolean;
|
|
34
37
|
language?: 'en' | 'zh';
|
|
35
38
|
}): import("react/jsx-runtime").JSX.Element;
|
package/dist/src/lib/react.d.ts
CHANGED
|
@@ -46,11 +46,11 @@ export declare function useIsMobile(): boolean;
|
|
|
46
46
|
/**
|
|
47
47
|
* Get value by client type.
|
|
48
48
|
*
|
|
49
|
-
* @param value - Value of non mobile client.
|
|
50
49
|
* @param mobileValue - Value of mobile client.
|
|
50
|
+
* @param value - Value of non mobile client.
|
|
51
51
|
* @returns Value.
|
|
52
52
|
*/
|
|
53
|
-
export declare function useValueByMobile<Value, MobileValue>(
|
|
53
|
+
export declare function useValueByMobile<Value, MobileValue>(mobileValue: MobileValue, value: Value): Value | MobileValue;
|
|
54
54
|
/**
|
|
55
55
|
* Execute once after rendering.
|
|
56
56
|
*
|