reykit 1.0.213 → 1.0.215
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 +58 -44
- package/dist/src/component/Media.d.ts +13 -7
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -49129,7 +49129,8 @@ const [hk, gk] = Z4(
|
|
|
49129
49129
|
);
|
|
49130
49130
|
function K4({
|
|
49131
49131
|
path: a,
|
|
49132
|
-
|
|
49132
|
+
loading: i,
|
|
49133
|
+
...u
|
|
49133
49134
|
}) {
|
|
49134
49135
|
return /* @__PURE__ */ x.jsxs(pR, { children: [
|
|
49135
49136
|
/* @__PURE__ */ x.jsx(
|
|
@@ -49140,11 +49141,11 @@ function K4({
|
|
|
49140
49141
|
"img",
|
|
49141
49142
|
{
|
|
49142
49143
|
src: a,
|
|
49143
|
-
loading:
|
|
49144
|
+
loading: i,
|
|
49144
49145
|
className: "size-full object-cover"
|
|
49145
49146
|
}
|
|
49146
49147
|
),
|
|
49147
|
-
...
|
|
49148
|
+
...u,
|
|
49148
49149
|
nativeButton: !1
|
|
49149
49150
|
}
|
|
49150
49151
|
),
|
|
@@ -49165,7 +49166,8 @@ function K4({
|
|
|
49165
49166
|
}
|
|
49166
49167
|
function $4({
|
|
49167
49168
|
path: a,
|
|
49168
|
-
|
|
49169
|
+
preload: i,
|
|
49170
|
+
...u
|
|
49169
49171
|
}) {
|
|
49170
49172
|
return /* @__PURE__ */ x.jsxs(pR, { children: [
|
|
49171
49173
|
/* @__PURE__ */ x.jsx(
|
|
@@ -49176,12 +49178,12 @@ function $4({
|
|
|
49176
49178
|
"video",
|
|
49177
49179
|
{
|
|
49178
49180
|
src: a,
|
|
49179
|
-
preload:
|
|
49181
|
+
preload: i,
|
|
49180
49182
|
playsInline: !0,
|
|
49181
49183
|
className: "size-full object-cover"
|
|
49182
49184
|
}
|
|
49183
49185
|
),
|
|
49184
|
-
...
|
|
49186
|
+
...u,
|
|
49185
49187
|
nativeButton: !1
|
|
49186
49188
|
}
|
|
49187
49189
|
),
|
|
@@ -49207,41 +49209,46 @@ function $4({
|
|
|
49207
49209
|
function vk({
|
|
49208
49210
|
data: a,
|
|
49209
49211
|
orientation: i = "auto",
|
|
49210
|
-
|
|
49211
|
-
|
|
49212
|
-
|
|
49212
|
+
width: u = 2,
|
|
49213
|
+
showButton: d = !0,
|
|
49214
|
+
showControl: m = !0,
|
|
49215
|
+
language: g = "en"
|
|
49213
49216
|
}) {
|
|
49214
49217
|
i === "auto" && (i = PC(
|
|
49215
49218
|
"vertical",
|
|
49216
49219
|
"horizontal"
|
|
49217
49220
|
));
|
|
49218
|
-
const
|
|
49219
|
-
1: "basis-1/
|
|
49220
|
-
2: "basis-1/
|
|
49221
|
-
3: "basis-1/
|
|
49222
|
-
4: "basis-1/
|
|
49223
|
-
5: "basis-1/
|
|
49224
|
-
|
|
49221
|
+
const [v, b] = {
|
|
49222
|
+
1: ["basis-1/1", 2],
|
|
49223
|
+
2: ["basis-1/2", 3],
|
|
49224
|
+
3: ["basis-1/3", 3],
|
|
49225
|
+
4: ["basis-1/4", 4],
|
|
49226
|
+
5: ["basis-1/5", 4],
|
|
49227
|
+
6: ["basis-1/6", 5]
|
|
49228
|
+
}[u], [C, T] = Zo(1), [R, N] = Zo(), A = Dj(!1), M = /* @__PURE__ */ x.jsx("div", { className: "flex-1 text-sm md:text-base text-muted-foreground flex absolute max-md:-top-8 md:-bottom-8", children: { en: `${C} / ${a.length} item(s)`, zh: `第 ${C} / ${a.length} 个` }[g] });
|
|
49225
49229
|
return wE(() => {
|
|
49226
|
-
if (!
|
|
49227
|
-
const
|
|
49228
|
-
|
|
49230
|
+
if (!R) return;
|
|
49231
|
+
const O = () => {
|
|
49232
|
+
T(R.selectedScrollSnap() + 1);
|
|
49229
49233
|
};
|
|
49230
|
-
return
|
|
49231
|
-
|
|
49234
|
+
return O(), R.on("select", O), () => {
|
|
49235
|
+
R.off("select", O);
|
|
49232
49236
|
};
|
|
49233
|
-
}, [
|
|
49237
|
+
}, [R]), /* @__PURE__ */ x.jsxs("div", { className: "relative flex flex-col place-items-center gap-4 size-full", children: [
|
|
49238
|
+
m && i == "vertical" && M,
|
|
49234
49239
|
/* @__PURE__ */ x.jsxs(
|
|
49235
49240
|
O_,
|
|
49236
49241
|
{
|
|
49237
49242
|
opts: {
|
|
49238
49243
|
align: "center",
|
|
49239
|
-
loop: !0
|
|
49244
|
+
loop: !0,
|
|
49245
|
+
skipSnaps: !0,
|
|
49246
|
+
duration: 25
|
|
49240
49247
|
},
|
|
49241
|
-
setApi:
|
|
49242
|
-
onWheel: (
|
|
49243
|
-
|
|
49244
|
-
|
|
49248
|
+
setApi: N,
|
|
49249
|
+
onWheel: (O) => {
|
|
49250
|
+
A.current || (A.current = !0, O.deltaY > 0 ? R?.scrollNext() : R?.scrollPrev(), setTimeout(() => {
|
|
49251
|
+
A.current = !1;
|
|
49245
49252
|
}, 300));
|
|
49246
49253
|
},
|
|
49247
49254
|
orientation: i,
|
|
@@ -49249,28 +49256,35 @@ function vk({
|
|
|
49249
49256
|
"size-full",
|
|
49250
49257
|
'[&_[data-slot="carousel-content"]]:absolute',
|
|
49251
49258
|
'[&_[data-slot="carousel-content"]]:inset-0',
|
|
49252
|
-
'
|
|
49253
|
-
'min-md:[&_[data-slot="carousel-content"]>div]:w-full'
|
|
49259
|
+
'[&_[data-slot="carousel-content"]>div]:size-full'
|
|
49254
49260
|
),
|
|
49255
49261
|
children: [
|
|
49256
|
-
/* @__PURE__ */ x.jsx(
|
|
49257
|
-
|
|
49258
|
-
|
|
49259
|
-
|
|
49260
|
-
|
|
49261
|
-
|
|
49262
|
-
|
|
49263
|
-
|
|
49264
|
-
|
|
49265
|
-
|
|
49266
|
-
|
|
49267
|
-
|
|
49268
|
-
|
|
49269
|
-
|
|
49262
|
+
/* @__PURE__ */ x.jsx(N_, { className: "place-items-center m-1 md:m-2 size-full", children: a.map(({ type: O, path: z }, D) => {
|
|
49263
|
+
const U = Math.abs(D - C + 1);
|
|
49264
|
+
return /* @__PURE__ */ x.jsx(
|
|
49265
|
+
M_,
|
|
49266
|
+
{
|
|
49267
|
+
className: ie(
|
|
49268
|
+
v,
|
|
49269
|
+
"overflow-hidden border md:h-[90%] md:max-h-[95%] max-md:w-[90%] max-md:max-w-[95%]",
|
|
49270
|
+
"place-items-center flex p-0 rounded-2xl shadow-md my-1 md:mx-2"
|
|
49271
|
+
),
|
|
49272
|
+
children: Math.min(
|
|
49273
|
+
U,
|
|
49274
|
+
a.length - U
|
|
49275
|
+
) > b ? null : O === "image" ? /* @__PURE__ */ x.jsx(K4, { path: z }) : O === "video" ? /* @__PURE__ */ x.jsx($4, { path: z }) : null
|
|
49276
|
+
},
|
|
49277
|
+
D
|
|
49278
|
+
);
|
|
49279
|
+
}) }),
|
|
49280
|
+
d && /* @__PURE__ */ x.jsxs(x.Fragment, { children: [
|
|
49281
|
+
/* @__PURE__ */ x.jsx(A_, { size: "icon", className: "max-md:top-auto max-md:-bottom-12 max-md:left-1/3" }),
|
|
49282
|
+
/* @__PURE__ */ x.jsx(D_, { size: "icon", className: "max-md:-bottom-12 max-md:left-2/3" })
|
|
49283
|
+
] })
|
|
49270
49284
|
]
|
|
49271
49285
|
}
|
|
49272
49286
|
),
|
|
49273
|
-
|
|
49287
|
+
m && i == "horizontal" && M
|
|
49274
49288
|
] });
|
|
49275
49289
|
}
|
|
49276
49290
|
function yk({
|
|
@@ -4,17 +4,21 @@ import * as ui from './ui';
|
|
|
4
4
|
* Media component of pop up show image.
|
|
5
5
|
*
|
|
6
6
|
* @param path - Image path.
|
|
7
|
+
* @param loading - Loading scheme.
|
|
7
8
|
*/
|
|
8
|
-
export declare function PopupImage({ path, ...args }: {
|
|
9
|
+
export declare function PopupImage({ path, loading, ...args }: {
|
|
9
10
|
path: string;
|
|
11
|
+
loading?: 'eager' | 'lazy';
|
|
10
12
|
} & ComponentProps<typeof ui.DialogTrigger>): import("react/jsx-runtime").JSX.Element;
|
|
11
13
|
/**
|
|
12
14
|
* Media component of pop up show video.
|
|
13
15
|
*
|
|
14
16
|
* @param path - Video path.
|
|
17
|
+
* @param preload - Preload scheme.
|
|
15
18
|
*/
|
|
16
|
-
export declare function PopupVideo({ path, ...args }: {
|
|
19
|
+
export declare function PopupVideo({ path, preload, ...args }: {
|
|
17
20
|
path: string;
|
|
21
|
+
preload?: 'metadata' | 'aotu' | 'none';
|
|
18
22
|
} & ComponentProps<typeof ui.DialogTrigger>): import("react/jsx-runtime").JSX.Element;
|
|
19
23
|
/**
|
|
20
24
|
* Media component of carousel show image or video.
|
|
@@ -22,17 +26,19 @@ export declare function PopupVideo({ path, ...args }: {
|
|
|
22
26
|
* @param data - Media data.
|
|
23
27
|
* @param orientation - Carousel orientation.
|
|
24
28
|
* - `auto` : Automatic set, when is mobile, then is `vertical`, otherwise is `horizontal`.
|
|
25
|
-
* @param
|
|
26
|
-
* @param
|
|
29
|
+
* @param width - Show content width.
|
|
30
|
+
* @param showButton - Whether show button.
|
|
31
|
+
* @param showControl - Whether show controls.
|
|
27
32
|
* @param language - Language type.
|
|
28
33
|
*/
|
|
29
|
-
export declare function CarouselMedia({ data, orientation,
|
|
34
|
+
export declare function CarouselMedia({ data, orientation, width, showButton, showControl, language }: {
|
|
30
35
|
data: {
|
|
31
36
|
type: 'image' | 'video';
|
|
32
37
|
path: string;
|
|
33
38
|
}[];
|
|
34
39
|
orientation?: 'auto' | 'horizontal' | 'vertical';
|
|
35
|
-
|
|
36
|
-
|
|
40
|
+
width?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
41
|
+
showButton?: boolean;
|
|
42
|
+
showControl?: boolean;
|
|
37
43
|
language?: 'en' | 'zh';
|
|
38
44
|
}): import("react/jsx-runtime").JSX.Element;
|