reykit 1.0.225 → 1.0.227
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 +31 -27
- package/dist/src/component/Media.d.ts +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -49275,33 +49275,34 @@ function bk({
|
|
|
49275
49275
|
width: u = 2,
|
|
49276
49276
|
showButton: f = !0,
|
|
49277
49277
|
showControl: m = !0,
|
|
49278
|
-
language: g = "en"
|
|
49278
|
+
language: g = "en",
|
|
49279
|
+
...v
|
|
49279
49280
|
}) {
|
|
49280
49281
|
i === "auto" && (i = C0(
|
|
49281
49282
|
"vertical",
|
|
49282
49283
|
"horizontal"
|
|
49283
49284
|
));
|
|
49284
|
-
const
|
|
49285
|
+
const b = C0(
|
|
49285
49286
|
"icon",
|
|
49286
49287
|
"icon-lg"
|
|
49287
|
-
), [
|
|
49288
|
+
), [C, T] = {
|
|
49288
49289
|
1: ["basis-1/1", 2],
|
|
49289
49290
|
2: ["basis-1/2", 3],
|
|
49290
49291
|
3: ["basis-1/3", 3],
|
|
49291
49292
|
4: ["basis-1/4", 4],
|
|
49292
49293
|
5: ["basis-1/5", 4],
|
|
49293
49294
|
6: ["basis-1/6", 5]
|
|
49294
|
-
}[u], [
|
|
49295
|
+
}[u], [R, N] = co(1), [A, M] = co(), O = KA(!1), z = /* @__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: `${R} / ${a.length} item(s)`, zh: `第 ${R} / ${a.length} 个` }[g] });
|
|
49295
49296
|
return OE(() => {
|
|
49296
|
-
if (!
|
|
49297
|
-
const
|
|
49298
|
-
|
|
49297
|
+
if (!A) return;
|
|
49298
|
+
const D = () => {
|
|
49299
|
+
N(A.selectedScrollSnap() + 1);
|
|
49299
49300
|
};
|
|
49300
|
-
return
|
|
49301
|
-
|
|
49301
|
+
return D(), A.on("select", D), () => {
|
|
49302
|
+
A.off("select", D);
|
|
49302
49303
|
};
|
|
49303
|
-
}, [
|
|
49304
|
-
m && i == "vertical" &&
|
|
49304
|
+
}, [A]), /* @__PURE__ */ x.jsx("div", { ...v, children: /* @__PURE__ */ x.jsxs("div", { className: "relative flex flex-col place-items-center gap-4 size-full", children: [
|
|
49305
|
+
m && i == "vertical" && z,
|
|
49305
49306
|
/* @__PURE__ */ x.jsxs(
|
|
49306
49307
|
M_,
|
|
49307
49308
|
{
|
|
@@ -49311,10 +49312,10 @@ function bk({
|
|
|
49311
49312
|
skipSnaps: !0,
|
|
49312
49313
|
duration: 25
|
|
49313
49314
|
},
|
|
49314
|
-
setApi:
|
|
49315
|
-
onWheel: (
|
|
49316
|
-
|
|
49317
|
-
|
|
49315
|
+
setApi: M,
|
|
49316
|
+
onWheel: (D) => {
|
|
49317
|
+
O.current || (O.current = !0, D.deltaY > 0 ? A?.scrollNext() : A?.scrollPrev(), setTimeout(() => {
|
|
49318
|
+
O.current = !1;
|
|
49318
49319
|
}, 300));
|
|
49319
49320
|
},
|
|
49320
49321
|
orientation: i,
|
|
@@ -49322,36 +49323,39 @@ function bk({
|
|
|
49322
49323
|
"size-full",
|
|
49323
49324
|
'[&_[data-slot="carousel-content"]]:absolute',
|
|
49324
49325
|
'[&_[data-slot="carousel-content"]]:inset-0',
|
|
49325
|
-
'[&_[data-slot="carousel-content"]
|
|
49326
|
+
'[&_[data-slot="carousel-content"]]:size-full',
|
|
49327
|
+
'[&_[data-slot="carousel-content"]]:flex',
|
|
49328
|
+
'[&_[data-slot="carousel-content"]]:place-content-center',
|
|
49329
|
+
'[&_[data-slot="carousel-content"]]:place-items-center'
|
|
49326
49330
|
),
|
|
49327
49331
|
children: [
|
|
49328
|
-
/* @__PURE__ */ x.jsx(A_, { className: "place-items-center m-1 md:m-2 size-full", children: a.map(({ type:
|
|
49329
|
-
const
|
|
49332
|
+
/* @__PURE__ */ x.jsx(A_, { className: "flex place-items-center m-1 md:m-2 size-full", children: a.map(({ type: D, path: U }, V) => {
|
|
49333
|
+
const _ = Math.abs(V - R + 1);
|
|
49330
49334
|
return /* @__PURE__ */ x.jsx(
|
|
49331
49335
|
D_,
|
|
49332
49336
|
{
|
|
49333
49337
|
className: ie(
|
|
49334
|
-
|
|
49338
|
+
C,
|
|
49335
49339
|
"overflow-hidden border md:h-[95%] md:max-h-[95%] max-md:w-[95%] max-md:max-w-[95%]",
|
|
49336
49340
|
"place-items-center flex p-0 rounded-2xl shadow-md my-1 md:mx-2"
|
|
49337
49341
|
),
|
|
49338
49342
|
children: Math.min(
|
|
49339
|
-
|
|
49340
|
-
a.length -
|
|
49341
|
-
) >
|
|
49343
|
+
_,
|
|
49344
|
+
a.length - _
|
|
49345
|
+
) > T ? null : D === "image" ? /* @__PURE__ */ x.jsx(F4, { path: U }) : D === "video" ? /* @__PURE__ */ x.jsx(J4, { path: U }) : null
|
|
49342
49346
|
},
|
|
49343
|
-
|
|
49347
|
+
V
|
|
49344
49348
|
);
|
|
49345
49349
|
}) }),
|
|
49346
49350
|
f && /* @__PURE__ */ x.jsxs(x.Fragment, { children: [
|
|
49347
|
-
/* @__PURE__ */ x.jsx(z_, { size:
|
|
49348
|
-
/* @__PURE__ */ x.jsx(__, { size:
|
|
49351
|
+
/* @__PURE__ */ x.jsx(z_, { size: b, className: "max-md:top-auto max-md:-bottom-12 max-md:left-1/3" }),
|
|
49352
|
+
/* @__PURE__ */ x.jsx(__, { size: b, className: "max-md:-bottom-12 max-md:left-2/3" })
|
|
49349
49353
|
] })
|
|
49350
49354
|
]
|
|
49351
49355
|
}
|
|
49352
49356
|
),
|
|
49353
|
-
m && i == "horizontal" &&
|
|
49354
|
-
] });
|
|
49357
|
+
m && i == "horizontal" && z
|
|
49358
|
+
] }) });
|
|
49355
49359
|
}
|
|
49356
49360
|
function xk({
|
|
49357
49361
|
children: a,
|
|
@@ -31,7 +31,7 @@ export declare function PopupVideo({ path, preload, ...args }: {
|
|
|
31
31
|
* @param showControl - Whether show controls.
|
|
32
32
|
* @param language - Language type.
|
|
33
33
|
*/
|
|
34
|
-
export declare function CarouselMedia({ data, orientation, width, showButton, showControl, language }: {
|
|
34
|
+
export declare function CarouselMedia({ data, orientation, width, showButton, showControl, language, ...args }: {
|
|
35
35
|
data: {
|
|
36
36
|
type: 'image' | 'video';
|
|
37
37
|
path: string;
|
|
@@ -41,4 +41,4 @@ export declare function CarouselMedia({ data, orientation, width, showButton, sh
|
|
|
41
41
|
showButton?: boolean;
|
|
42
42
|
showControl?: boolean;
|
|
43
43
|
language?: 'en' | 'zh';
|
|
44
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
44
|
+
} & ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|