@anywayseo/tools 2.3.0 → 2.4.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/components/game-demo/index.d.ts +9 -3
- package/dist/components/game-demo/preview/index.d.ts +2 -1
- package/dist/components/index.cjs +1 -1
- package/dist/components/index.mjs +1 -1
- package/dist/components/tabs/index.d.ts +4 -1
- package/dist/{index-C5BWCSo_.js → index-BKBWEEyT.js} +8 -10
- package/dist/{index-DaSzU8Hb.mjs → index-DF1kFmrH.mjs} +8 -10
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/types/components/how-to/index.d.ts +2 -1
- package/dist/types/site/index.d.ts +0 -1
- package/package.json +1 -1
|
@@ -1,9 +1,15 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
1
|
+
import { FC, ReactElement } from 'react';
|
|
2
2
|
import { BoxPositionProps, ImageFit } from '../../types';
|
|
3
|
+
type GamePreviewImageProps = {
|
|
4
|
+
previewImage: string;
|
|
5
|
+
previewImageFit?: ImageFit;
|
|
6
|
+
} | {
|
|
7
|
+
previewImage: ReactElement;
|
|
8
|
+
previewImageFit?: never;
|
|
9
|
+
};
|
|
3
10
|
type GameDemoProps = {
|
|
4
11
|
name: string;
|
|
5
12
|
src: string;
|
|
6
|
-
|
|
7
|
-
} & BoxPositionProps;
|
|
13
|
+
} & BoxPositionProps & GamePreviewImageProps;
|
|
8
14
|
declare const GameDemo: FC<GameDemoProps>;
|
|
9
15
|
export default GameDemo;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const index = require("../index-
|
|
3
|
+
const index = require("../index-BKBWEEyT.js");
|
|
4
4
|
exports.Author = index.Author;
|
|
5
5
|
exports.BonusCard = index.BonusCard;
|
|
6
6
|
exports.Center = index.Center;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { BoxPositionProps, ITabItem, RenderFunction } from '../../types';
|
|
2
2
|
type TabsProps<T> = {
|
|
3
3
|
items: ITabItem<T>[];
|
|
4
|
+
} & BoxPositionProps & (T extends unknown[] ? {
|
|
4
5
|
render: RenderFunction<T>;
|
|
5
|
-
}
|
|
6
|
+
} : {
|
|
7
|
+
render?: never;
|
|
8
|
+
});
|
|
6
9
|
declare const Tabs: <T>({ items, render, ...boxProps }: TabsProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
7
10
|
export default Tabs;
|
|
@@ -363,18 +363,15 @@ const GameDemoContent = ({ src, isFullscreen, isLoaded, onLoad, onToggleFullscre
|
|
|
363
363
|
/* @__PURE__ */ jsxRuntime.jsx(react.AbsoluteCenter, { children: /* @__PURE__ */ jsxRuntime.jsx(react.Spinner, { size: "xl", thickness: "0.6rem", display: isLoaded ? "none" : "block", color: "brand.100" }) })
|
|
364
364
|
] });
|
|
365
365
|
};
|
|
366
|
-
const GameDemoPreview = ({ alt, imageFit = "contain", onPlay }) => {
|
|
367
|
-
var _a;
|
|
368
|
-
const { assets } = index.useSiteContext();
|
|
366
|
+
const GameDemoPreview = ({ image, alt, imageFit = "contain", onPlay }) => {
|
|
369
367
|
const { t } = reactI18next.useTranslation("gameDemo");
|
|
370
|
-
const
|
|
371
|
-
const gamePreviewImageComponent = typeof gamePreviewImage === "string" ? /* @__PURE__ */ jsxRuntime.jsx(react.Image, { src: gamePreviewImage, alt, objectFit: imageFit }) : gamePreviewImage;
|
|
368
|
+
const imageComponent = typeof image === "string" ? /* @__PURE__ */ jsxRuntime.jsx(react.Image, { src: image, alt, objectFit: imageFit }) : image;
|
|
372
369
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
373
|
-
|
|
370
|
+
imageComponent,
|
|
374
371
|
/* @__PURE__ */ jsxRuntime.jsx(react.AbsoluteCenter, { children: /* @__PURE__ */ jsxRuntime.jsx(PulseButton, { label: t("action.playForFree"), onClick: onPlay }) })
|
|
375
372
|
] });
|
|
376
373
|
};
|
|
377
|
-
const GameDemo = ({ name, src, previewImageFit, ...boxProps }) => {
|
|
374
|
+
const GameDemo = ({ name, src, previewImage, previewImageFit, ...boxProps }) => {
|
|
378
375
|
const [isRunning, setIsRunning] = react$1.useState(false);
|
|
379
376
|
const [isLoaded, setIsLoaded] = react$1.useState(false);
|
|
380
377
|
const { isOpen: isFullscreen, onToggle } = react.useDisclosure({ defaultIsOpen: false });
|
|
@@ -406,7 +403,7 @@ const GameDemo = ({ name, src, previewImageFit, ...boxProps }) => {
|
|
|
406
403
|
onLoad,
|
|
407
404
|
onToggleFullscreen: handleToggleFullscreen
|
|
408
405
|
}
|
|
409
|
-
) : /* @__PURE__ */ jsxRuntime.jsx(GameDemoPreview, { alt: name, imageFit: previewImageFit, onPlay: handlePlay })
|
|
406
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(GameDemoPreview, { image: previewImage, alt: name, imageFit: previewImageFit, onPlay: handlePlay })
|
|
410
407
|
}
|
|
411
408
|
);
|
|
412
409
|
};
|
|
@@ -495,10 +492,11 @@ const GameInfo = ({ info }) => {
|
|
|
495
492
|
};
|
|
496
493
|
const HowTo = ({ steps, ...boxProps }) => {
|
|
497
494
|
const { color, bgColor } = index$2.usePrimaryColors();
|
|
498
|
-
return /* @__PURE__ */ jsxRuntime.jsx(react.SimpleGrid, { as: "ol", columns: { base: 1, md: 2, lg: 3 }, gap: 4, p: 0, ...boxProps, children: steps.map(({ title, description }, index2) => /* @__PURE__ */ jsxRuntime.jsxs(react.Flex, { as: "li", alignItems: "flex-start", gap: 4, children: [
|
|
495
|
+
return /* @__PURE__ */ jsxRuntime.jsx(react.SimpleGrid, { as: "ol", columns: { base: 1, md: 2, lg: 3 }, gap: 4, p: 0, ...boxProps, children: steps.map(({ title, description, image }, index2) => /* @__PURE__ */ jsxRuntime.jsxs(react.Flex, { as: "li", alignItems: "flex-start", gap: 4, children: [
|
|
499
496
|
/* @__PURE__ */ jsxRuntime.jsx(react.Circle, { size: 12, bgColor, color, fontSize: "lg", fontWeight: "bold", children: String(index2 + 1) }),
|
|
500
497
|
/* @__PURE__ */ jsxRuntime.jsxs(react.Stack, { flex: 1, children: [
|
|
501
498
|
/* @__PURE__ */ jsxRuntime.jsx(react.Text, { fontSize: "lg", fontWeight: "bold", children: title }),
|
|
499
|
+
typeof image === "string" ? /* @__PURE__ */ jsxRuntime.jsx(react.Image, { src: image, alt: title, aspectRatio: "16/9", objectFit: "cover" }) : image,
|
|
502
500
|
/* @__PURE__ */ jsxRuntime.jsx(react.Text, { children: description })
|
|
503
501
|
] })
|
|
504
502
|
] }, index2)) });
|
|
@@ -981,7 +979,7 @@ const Tabs = ({ items, render, ...boxProps }) => {
|
|
|
981
979
|
}, []);
|
|
982
980
|
return /* @__PURE__ */ jsxRuntime.jsxs(react.Tabs, { overflow: "hidden", colorScheme: "brand", ...boxProps, children: [
|
|
983
981
|
/* @__PURE__ */ jsxRuntime.jsx(react.TabList, { overflow: "auto hidden", children: tabs.map(({ label, icon }, index2) => /* @__PURE__ */ jsxRuntime.jsx(react.Tab, { children: /* @__PURE__ */ jsxRuntime.jsx(react.Text, { as: "h3", isTruncated: true, children: icon ? `${icon} ${label}` : label }) }, index2)) }),
|
|
984
|
-
/* @__PURE__ */ jsxRuntime.jsx(react.TabPanels, { children: panels.map((panel, index2) => /* @__PURE__ */ jsxRuntime.jsx(react.TabPanel, { children: render(panel) }, index2)) })
|
|
982
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.TabPanels, { children: panels.map((panel, index2) => /* @__PURE__ */ jsxRuntime.jsx(react.TabPanel, { children: render ? render(panel) : panel }, index2)) })
|
|
985
983
|
] });
|
|
986
984
|
};
|
|
987
985
|
exports.Author = Author;
|
|
@@ -362,18 +362,15 @@ const GameDemoContent = ({ src, isFullscreen, isLoaded, onLoad, onToggleFullscre
|
|
|
362
362
|
/* @__PURE__ */ jsx(AbsoluteCenter, { children: /* @__PURE__ */ jsx(Spinner, { size: "xl", thickness: "0.6rem", display: isLoaded ? "none" : "block", color: "brand.100" }) })
|
|
363
363
|
] });
|
|
364
364
|
};
|
|
365
|
-
const GameDemoPreview = ({ alt, imageFit = "contain", onPlay }) => {
|
|
366
|
-
var _a;
|
|
367
|
-
const { assets } = useSiteContext();
|
|
365
|
+
const GameDemoPreview = ({ image, alt, imageFit = "contain", onPlay }) => {
|
|
368
366
|
const { t: t2 } = useTranslation("gameDemo");
|
|
369
|
-
const
|
|
370
|
-
const gamePreviewImageComponent = typeof gamePreviewImage === "string" ? /* @__PURE__ */ jsx(Image, { src: gamePreviewImage, alt, objectFit: imageFit }) : gamePreviewImage;
|
|
367
|
+
const imageComponent = typeof image === "string" ? /* @__PURE__ */ jsx(Image, { src: image, alt, objectFit: imageFit }) : image;
|
|
371
368
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
372
|
-
|
|
369
|
+
imageComponent,
|
|
373
370
|
/* @__PURE__ */ jsx(AbsoluteCenter, { children: /* @__PURE__ */ jsx(PulseButton, { label: t2("action.playForFree"), onClick: onPlay }) })
|
|
374
371
|
] });
|
|
375
372
|
};
|
|
376
|
-
const GameDemo = ({ name, src, previewImageFit, ...boxProps }) => {
|
|
373
|
+
const GameDemo = ({ name, src, previewImage, previewImageFit, ...boxProps }) => {
|
|
377
374
|
const [isRunning, setIsRunning] = useState(false);
|
|
378
375
|
const [isLoaded, setIsLoaded] = useState(false);
|
|
379
376
|
const { isOpen: isFullscreen, onToggle } = useDisclosure({ defaultIsOpen: false });
|
|
@@ -405,7 +402,7 @@ const GameDemo = ({ name, src, previewImageFit, ...boxProps }) => {
|
|
|
405
402
|
onLoad,
|
|
406
403
|
onToggleFullscreen: handleToggleFullscreen
|
|
407
404
|
}
|
|
408
|
-
) : /* @__PURE__ */ jsx(GameDemoPreview, { alt: name, imageFit: previewImageFit, onPlay: handlePlay })
|
|
405
|
+
) : /* @__PURE__ */ jsx(GameDemoPreview, { image: previewImage, alt: name, imageFit: previewImageFit, onPlay: handlePlay })
|
|
409
406
|
}
|
|
410
407
|
);
|
|
411
408
|
};
|
|
@@ -494,10 +491,11 @@ const GameInfo = ({ info }) => {
|
|
|
494
491
|
};
|
|
495
492
|
const HowTo = ({ steps, ...boxProps }) => {
|
|
496
493
|
const { color, bgColor } = usePrimaryColors();
|
|
497
|
-
return /* @__PURE__ */ jsx(SimpleGrid, { as: "ol", columns: { base: 1, md: 2, lg: 3 }, gap: 4, p: 0, ...boxProps, children: steps.map(({ title, description }, index) => /* @__PURE__ */ jsxs(Flex, { as: "li", alignItems: "flex-start", gap: 4, children: [
|
|
494
|
+
return /* @__PURE__ */ jsx(SimpleGrid, { as: "ol", columns: { base: 1, md: 2, lg: 3 }, gap: 4, p: 0, ...boxProps, children: steps.map(({ title, description, image }, index) => /* @__PURE__ */ jsxs(Flex, { as: "li", alignItems: "flex-start", gap: 4, children: [
|
|
498
495
|
/* @__PURE__ */ jsx(Circle, { size: 12, bgColor, color, fontSize: "lg", fontWeight: "bold", children: String(index + 1) }),
|
|
499
496
|
/* @__PURE__ */ jsxs(Stack, { flex: 1, children: [
|
|
500
497
|
/* @__PURE__ */ jsx(Text, { fontSize: "lg", fontWeight: "bold", children: title }),
|
|
498
|
+
typeof image === "string" ? /* @__PURE__ */ jsx(Image, { src: image, alt: title, aspectRatio: "16/9", objectFit: "cover" }) : image,
|
|
501
499
|
/* @__PURE__ */ jsx(Text, { children: description })
|
|
502
500
|
] })
|
|
503
501
|
] }, index)) });
|
|
@@ -980,7 +978,7 @@ const Tabs = ({ items, render, ...boxProps }) => {
|
|
|
980
978
|
}, []);
|
|
981
979
|
return /* @__PURE__ */ jsxs(Tabs$1, { overflow: "hidden", colorScheme: "brand", ...boxProps, children: [
|
|
982
980
|
/* @__PURE__ */ jsx(TabList, { overflow: "auto hidden", children: tabs.map(({ label, icon }, index) => /* @__PURE__ */ jsx(Tab, { children: /* @__PURE__ */ jsx(Text, { as: "h3", isTruncated: true, children: icon ? `${icon} ${label}` : label }) }, index)) }),
|
|
983
|
-
/* @__PURE__ */ jsx(TabPanels, { children: panels.map((panel, index) => /* @__PURE__ */ jsx(TabPanel, { children: render(panel) }, index)) })
|
|
981
|
+
/* @__PURE__ */ jsx(TabPanels, { children: panels.map((panel, index) => /* @__PURE__ */ jsx(TabPanel, { children: render ? render(panel) : panel }, index)) })
|
|
984
982
|
] });
|
|
985
983
|
};
|
|
986
984
|
export {
|
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const index = require("./index-
|
|
3
|
+
const index = require("./index-BKBWEEyT.js");
|
|
4
4
|
const index$1 = require("./index-IpSV-c71.js");
|
|
5
5
|
const i18n$1 = require("./index-uq_uSyaC.js");
|
|
6
6
|
const index$2 = require("./index-m97PmVsd.js");
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A, B, g, C, h, E, F, a, b, G, c, d, i, H, L, j, e, P, k, S, T, f } from "./index-
|
|
1
|
+
import { A, B, g, C, h, E, F, a, b, G, c, d, i, H, L, j, e, P, k, S, T, f } from "./index-DF1kFmrH.mjs";
|
|
2
2
|
import { u } from "./index-xuSxvz5z.mjs";
|
|
3
3
|
import { a as a2, G as G2, r } from "./index-DjBQjd1k.mjs";
|
|
4
4
|
import { M } from "./index-C-e_0aJJ.mjs";
|