@anywayseo/tools 3.1.2 → 4.0.1
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/base/grid/index.d.ts +3 -4
- package/dist/components/base/grid/utils.d.ts +2 -2
- package/dist/components/bonus-card/content/index.d.ts +2 -1
- package/dist/components/bonus-card/index.d.ts +2 -2
- package/dist/components/bonus-card/title/index.d.ts +3 -1
- package/dist/components/bonus-card-grid/index.d.ts +10 -0
- package/dist/components/feature-card-grid/index.d.ts +9 -0
- package/dist/components/game-card/index.d.ts +2 -2
- package/dist/components/game-card-grid/index.d.ts +12 -0
- package/dist/components/index.cjs +5 -3
- package/dist/components/index.d.ts +4 -2
- package/dist/components/index.mjs +16 -14
- package/dist/components/strapi-component/external-image/index.d.ts +7 -0
- package/dist/components/strapi-component/index.d.ts +9 -0
- package/dist/components/strapi-component/rich-text/index.d.ts +6 -0
- package/dist/components/strapi-component/utils.d.ts +3 -0
- package/dist/components/strapi-content-renderer/index.d.ts +8 -0
- package/dist/components/strapi-content-renderer/utils.d.ts +2 -0
- package/dist/{index-eta4hdHD.js → index-BIs07X4D.js} +202 -39
- package/dist/{index-Cte2-g6s.js → index-Bw7vqsyw.js} +15 -0
- package/dist/{index-Cin-9-As.mjs → index-CNKZLV-n.mjs} +213 -50
- package/dist/{index-25M8hPOF.mjs → index-DLy2LYCD.mjs} +15 -0
- package/dist/index.cjs +8 -4
- package/dist/index.mjs +21 -17
- package/dist/types/components/bonus-card/index.d.ts +7 -0
- package/dist/types/components/common/index.d.ts +2 -1
- package/dist/types/components/external-image/index.d.ts +14 -0
- package/dist/types/components/game-card/index.d.ts +1 -0
- package/dist/types/components/grid/index.d.ts +3 -0
- package/dist/types/components/index.d.ts +3 -0
- package/dist/types/components/strapi-component/index.d.ts +5 -0
- package/dist/utils/index.cjs +3 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.mjs +5 -3
- package/dist/utils/sorting/index.d.ts +2 -0
- package/package.json +2 -1
- package/dist/components/base/grid/types.d.ts +0 -3
- package/dist/components/features/index.d.ts +0 -7
- package/dist/components/rich-text-renderer/index.d.ts +0 -6
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { BoxPositionProps, KeyGetter, RenderFunction } from '../../../types';
|
|
2
|
-
import { ColumnsConfig, SpacingConfig } from './types';
|
|
1
|
+
import { BoxPositionProps, GridColumns, GridGap, KeyGetter, RenderFunction } from '../../../types';
|
|
3
2
|
type GridProps<T> = {
|
|
4
3
|
items: T[];
|
|
5
|
-
columns?:
|
|
6
|
-
gap?:
|
|
4
|
+
columns?: GridColumns;
|
|
5
|
+
gap?: GridGap;
|
|
7
6
|
getKey?: KeyGetter<T>;
|
|
8
7
|
render: RenderFunction<T>;
|
|
9
8
|
} & BoxPositionProps;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const defaultColumns:
|
|
1
|
+
import { GridColumns } from '../../../types';
|
|
2
|
+
export declare const defaultColumns: GridColumns;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
-
import { IBonusCard } from '../../../types';
|
|
2
|
+
import { Color, IBonusCard } from '../../../types';
|
|
3
3
|
type BonusCardContentProps = {
|
|
4
4
|
content: IBonusCard['content'];
|
|
5
|
+
buttonColor?: Color;
|
|
5
6
|
};
|
|
6
7
|
declare const BonusCardContent: FC<BonusCardContentProps>;
|
|
7
8
|
export default BonusCardContent;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
-
import { IBonusCard } from '../../types';
|
|
3
|
-
type BonusCardProps = IBonusCard & {
|
|
2
|
+
import { IBonusCard, IBonusCardCustomizationProps } from '../../types';
|
|
3
|
+
type BonusCardProps = IBonusCard & IBonusCardCustomizationProps & {
|
|
4
4
|
className?: string;
|
|
5
5
|
};
|
|
6
6
|
declare const BonusCard: FC<BonusCardProps>;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
-
import { IBonusCard } from '../../../types';
|
|
2
|
+
import { IBonusCard, Color } from '../../../types';
|
|
3
3
|
type BonusCardTitleProps = {
|
|
4
4
|
content: IBonusCard['title'];
|
|
5
|
+
color?: Color;
|
|
6
|
+
textColor?: Color;
|
|
5
7
|
};
|
|
6
8
|
declare const BonusCardTitle: FC<BonusCardTitleProps>;
|
|
7
9
|
export default BonusCardTitle;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { BoxPositionProps, GridColumns, GridGap, IBonusCard, IBonusCardCustomizationProps } from '../../types';
|
|
3
|
+
type BonusCardGridProps = {
|
|
4
|
+
items: IBonusCard[];
|
|
5
|
+
columns?: GridColumns;
|
|
6
|
+
gap?: GridGap;
|
|
7
|
+
cardCustomization?: IBonusCardCustomizationProps;
|
|
8
|
+
} & BoxPositionProps;
|
|
9
|
+
declare const BonusCardGrid: FC<BonusCardGridProps>;
|
|
10
|
+
export default BonusCardGrid;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { BoxPositionProps, GridColumns, GridGap, IFeature } from '../../types';
|
|
3
|
+
type FeatureCardGridProps = {
|
|
4
|
+
items: IFeature[];
|
|
5
|
+
columns?: GridColumns;
|
|
6
|
+
gap?: GridGap;
|
|
7
|
+
} & BoxPositionProps;
|
|
8
|
+
declare const FeatureCardGrid: FC<FeatureCardGridProps>;
|
|
9
|
+
export default FeatureCardGrid;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
-
import { IGameCard } from '../../types';
|
|
2
|
+
import { GameCardHeight, IGameCard } from '../../types';
|
|
3
3
|
type GameCardProps = IGameCard & {
|
|
4
|
-
height?:
|
|
4
|
+
height?: GameCardHeight;
|
|
5
5
|
};
|
|
6
6
|
declare const GameCard: FC<GameCardProps>;
|
|
7
7
|
export default GameCard;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { BoxPositionProps, GameCardHeight, GridColumns, GridGap, IGameCard } from '../../types';
|
|
3
|
+
type GameCardGridProps = {
|
|
4
|
+
items: IGameCard[];
|
|
5
|
+
columns?: GridColumns;
|
|
6
|
+
gap?: GridGap;
|
|
7
|
+
cardHeight?: GameCardHeight;
|
|
8
|
+
order?: 'default' | 'random';
|
|
9
|
+
randomSeed?: number;
|
|
10
|
+
} & BoxPositionProps;
|
|
11
|
+
declare const GameCardGrid: FC<GameCardGridProps>;
|
|
12
|
+
export default GameCardGrid;
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const index = require("../index-
|
|
3
|
+
const index = require("../index-BIs07X4D.js");
|
|
4
4
|
exports.Author = index.Author;
|
|
5
5
|
exports.AuthorCard = index.AuthorCard;
|
|
6
6
|
exports.BonusCard = index.BonusCard;
|
|
7
|
+
exports.BonusCardGrid = index.BonusCardGrid;
|
|
7
8
|
exports.Center = index.Center;
|
|
8
9
|
exports.ContactForm = index.ContactForm;
|
|
9
10
|
exports.Faq = index.Faq;
|
|
10
11
|
exports.FeatureCard = index.FeatureCard;
|
|
11
|
-
exports.
|
|
12
|
+
exports.FeatureCardGrid = index.FeatureCardGrid;
|
|
12
13
|
exports.GameCard = index.GameCard;
|
|
14
|
+
exports.GameCardGrid = index.GameCardGrid;
|
|
13
15
|
exports.GameDemo = index.GameDemo;
|
|
14
16
|
exports.GameInfo = index.GameInfo;
|
|
15
17
|
exports.Grid = index.Grid;
|
|
@@ -20,8 +22,8 @@ exports.List = index.List;
|
|
|
20
22
|
exports.NotFound = index.NotFound;
|
|
21
23
|
exports.ProsCons = index.ProsCons;
|
|
22
24
|
exports.PulseButton = index.PulseButton;
|
|
23
|
-
exports.RichTextRenderer = index.RichTextRenderer;
|
|
24
25
|
exports.Seo = index.Seo;
|
|
26
|
+
exports.StrapiContentRenderer = index.StrapiContentRenderer;
|
|
25
27
|
exports.Table = index.Table;
|
|
26
28
|
exports.Tabs = index.Tabs;
|
|
27
29
|
exports.Tip = index.Tip;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
export * from './base';
|
|
2
2
|
export { default as AuthorCard } from './author-card';
|
|
3
3
|
export { default as BonusCard } from './bonus-card';
|
|
4
|
+
export { default as BonusCardGrid } from './bonus-card-grid';
|
|
4
5
|
export { default as ContactForm } from './contact-form';
|
|
5
6
|
export { default as Faq } from './faq';
|
|
6
7
|
export { default as FeatureCard } from './feature-card';
|
|
7
|
-
export { default as
|
|
8
|
+
export { default as FeatureCardGrid } from './feature-card-grid';
|
|
8
9
|
export { default as GameCard } from './game-card';
|
|
10
|
+
export { default as GameCardGrid } from './game-card-grid';
|
|
9
11
|
export { default as GameDemo } from './game-demo';
|
|
10
12
|
export { default as GameInfo } from './game-info';
|
|
11
13
|
export { default as HowTo } from './how-to';
|
|
@@ -13,8 +15,8 @@ export { default as Layout } from './layout';
|
|
|
13
15
|
export { default as List } from './list';
|
|
14
16
|
export { default as NotFound } from './not-found';
|
|
15
17
|
export { default as ProsCons } from './pros-cons';
|
|
16
|
-
export { default as RichTextRenderer } from './rich-text-renderer';
|
|
17
18
|
export { default as Seo } from './seo';
|
|
19
|
+
export { default as StrapiContentRenderer } from './strapi-content-renderer';
|
|
18
20
|
export { default as Table } from './table';
|
|
19
21
|
export { default as Tabs } from './tabs';
|
|
20
22
|
export { default as Tip } from './tip';
|
|
@@ -1,27 +1,29 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { k, A, B, a, l, C, F, b, c, G, d, e, f, m, H, L, n, g, N, P, o, S, h, T, i, j } from "../index-CNKZLV-n.mjs";
|
|
2
2
|
export {
|
|
3
|
-
|
|
3
|
+
k as Author,
|
|
4
4
|
A as AuthorCard,
|
|
5
5
|
B as BonusCard,
|
|
6
|
-
|
|
6
|
+
a as BonusCardGrid,
|
|
7
|
+
l as Center,
|
|
7
8
|
C as ContactForm,
|
|
8
9
|
F as Faq,
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
b as FeatureCard,
|
|
11
|
+
c as FeatureCardGrid,
|
|
11
12
|
G as GameCard,
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
d as GameCardGrid,
|
|
14
|
+
e as GameDemo,
|
|
15
|
+
f as GameInfo,
|
|
16
|
+
m as Grid,
|
|
15
17
|
H as HowTo,
|
|
16
18
|
L as Layout,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
+
n as LinkButton,
|
|
20
|
+
g as List,
|
|
19
21
|
N as NotFound,
|
|
20
22
|
P as ProsCons,
|
|
21
|
-
|
|
22
|
-
R as RichTextRenderer,
|
|
23
|
+
o as PulseButton,
|
|
23
24
|
S as Seo,
|
|
25
|
+
h as StrapiContentRenderer,
|
|
24
26
|
T as Table,
|
|
25
|
-
|
|
26
|
-
|
|
27
|
+
i as Tabs,
|
|
28
|
+
j as Tip
|
|
27
29
|
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { IGatsbyImageFile, ExternalImageComponent, ExternalImageComponentProps } from '../../../types';
|
|
3
|
+
type ExternalImageProps = ExternalImageComponentProps<IGatsbyImageFile> & {
|
|
4
|
+
component: ExternalImageComponent;
|
|
5
|
+
};
|
|
6
|
+
declare const ExternalImage: FC<ExternalImageProps>;
|
|
7
|
+
export default ExternalImage;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { StrapiComponentType, ExternalImageComponent } from '../../types';
|
|
3
|
+
type StrapiComponentProps = {
|
|
4
|
+
type: StrapiComponentType;
|
|
5
|
+
props: any;
|
|
6
|
+
imageComponent: ExternalImageComponent;
|
|
7
|
+
};
|
|
8
|
+
declare const StrapiComponent: FC<StrapiComponentProps>;
|
|
9
|
+
export default StrapiComponent;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { ExternalImageComponent } from '../../types';
|
|
3
|
+
type StrapiContentRendererProps = {
|
|
4
|
+
content: unknown;
|
|
5
|
+
imageComponent: ExternalImageComponent;
|
|
6
|
+
};
|
|
7
|
+
declare const StrapiContentRenderer: FC<StrapiContentRendererProps>;
|
|
8
|
+
export default StrapiContentRenderer;
|
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
const jsxRuntime = require("react/jsx-runtime");
|
|
3
3
|
const react$1 = require("@chakra-ui/react");
|
|
4
4
|
const reactI18next = require("react-i18next");
|
|
5
|
-
const index = require("./index-
|
|
5
|
+
const index = require("./index-Bw7vqsyw.js");
|
|
6
6
|
const i18n = require("./index-Biz1dDqA.js");
|
|
7
7
|
require("@ctrl/tinycolor");
|
|
8
8
|
const react = require("react");
|
|
9
9
|
const icons = require("@chakra-ui/icons");
|
|
10
|
-
const index$1 = require("./index-IpSV-c71.js");
|
|
11
10
|
const react$2 = require("@mdx-js/react");
|
|
12
11
|
const index$2 = require("./index-BhsXlbd8.js");
|
|
13
|
-
const i18n$1 = require("i18next");
|
|
14
12
|
const gatsby = require("gatsby");
|
|
13
|
+
const index$1 = require("./index-IpSV-c71.js");
|
|
14
|
+
const i18n$1 = require("i18next");
|
|
15
15
|
const Markdown = require("react-markdown");
|
|
16
16
|
const ONE_LINE_HEIGHT = 24;
|
|
17
17
|
const Bio = ({ content, maxLines = 1 }) => {
|
|
@@ -118,14 +118,14 @@ const AuthorCard = ({ author, ...boxProps }) => {
|
|
|
118
118
|
)
|
|
119
119
|
] });
|
|
120
120
|
};
|
|
121
|
-
const BonusCardContent = ({ content }) => {
|
|
121
|
+
const BonusCardContent = ({ content, buttonColor }) => {
|
|
122
122
|
const { t } = reactI18next.useTranslation("author");
|
|
123
123
|
return /* @__PURE__ */ jsxRuntime.jsx(react$1.Popover, { autoFocus: false, isLazy: true, lazyBehavior: "keepMounted", children: ({ isOpen }) => /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
124
|
-
/* @__PURE__ */ jsxRuntime.jsx(react$1.PopoverTrigger, { children: /* @__PURE__ */ jsxRuntime.jsx(react$1.Button, { size: "sm", variant: "link", color:
|
|
124
|
+
/* @__PURE__ */ jsxRuntime.jsx(react$1.PopoverTrigger, { children: /* @__PURE__ */ jsxRuntime.jsx(react$1.Button, { size: "sm", variant: "link", color: buttonColor, children: isOpen ? t("action.collapse") : t("action.expand") }) }),
|
|
125
125
|
/* @__PURE__ */ jsxRuntime.jsx(react$1.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(react$1.PopoverContent, { children: /* @__PURE__ */ jsxRuntime.jsx(react$1.PopoverBody, { children: Array.isArray(content) ? /* @__PURE__ */ jsxRuntime.jsx(react$1.Stack, { children: content.map((paragraph, index2) => /* @__PURE__ */ jsxRuntime.jsx(react$1.Text, { as: "span", children: paragraph }, index2)) }) : /* @__PURE__ */ jsxRuntime.jsx(react$1.Text, { children: content }) }) }) })
|
|
126
126
|
] }) });
|
|
127
127
|
};
|
|
128
|
-
const BonusCardTitle = ({ content }) => {
|
|
128
|
+
const BonusCardTitle = ({ content, color, textColor }) => {
|
|
129
129
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
130
130
|
react$1.Text,
|
|
131
131
|
{
|
|
@@ -134,22 +134,33 @@ const BonusCardTitle = ({ content }) => {
|
|
|
134
134
|
py: 1,
|
|
135
135
|
px: 2,
|
|
136
136
|
borderRadius: "md",
|
|
137
|
-
bg:
|
|
138
|
-
|
|
137
|
+
bg: color,
|
|
138
|
+
fontSize: "md",
|
|
139
139
|
fontWeight: "bold",
|
|
140
|
-
|
|
140
|
+
color: textColor,
|
|
141
141
|
children: content
|
|
142
142
|
}
|
|
143
143
|
);
|
|
144
144
|
};
|
|
145
|
-
const BonusCard = ({
|
|
145
|
+
const BonusCard = ({
|
|
146
|
+
title,
|
|
147
|
+
subtitle,
|
|
148
|
+
content,
|
|
149
|
+
link,
|
|
150
|
+
image,
|
|
151
|
+
color = "linear-gradient(90deg, #3b1f47, #731d58)",
|
|
152
|
+
textColor = "whiteAlpha.900",
|
|
153
|
+
titleColor = "yellow",
|
|
154
|
+
titleTextColor = "black",
|
|
155
|
+
className
|
|
156
|
+
}) => {
|
|
146
157
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
147
158
|
react$1.Card,
|
|
148
159
|
{
|
|
149
160
|
as: "article",
|
|
150
161
|
h: "full",
|
|
151
|
-
color:
|
|
152
|
-
bg:
|
|
162
|
+
color: textColor,
|
|
163
|
+
bg: color,
|
|
153
164
|
_before: image ? {
|
|
154
165
|
content: '""',
|
|
155
166
|
position: "absolute",
|
|
@@ -166,15 +177,33 @@ const BonusCard = ({ title, subtitle, content, link, image, className }) => {
|
|
|
166
177
|
className,
|
|
167
178
|
children: [
|
|
168
179
|
/* @__PURE__ */ jsxRuntime.jsxs(react$1.CardBody, { as: "section", pb: 0, flex: 1, children: [
|
|
169
|
-
/* @__PURE__ */ jsxRuntime.jsx(BonusCardTitle, { content: title }),
|
|
180
|
+
/* @__PURE__ */ jsxRuntime.jsx(BonusCardTitle, { content: title, color: titleColor, textColor: titleTextColor }),
|
|
170
181
|
/* @__PURE__ */ jsxRuntime.jsx(react$1.Text, { fontSize: "2xl", fontWeight: "bold", my: 2, children: subtitle }),
|
|
171
|
-
/* @__PURE__ */ jsxRuntime.jsx(BonusCardContent, { content })
|
|
182
|
+
/* @__PURE__ */ jsxRuntime.jsx(BonusCardContent, { content, buttonColor: textColor })
|
|
172
183
|
] }),
|
|
173
184
|
/* @__PURE__ */ jsxRuntime.jsx(react$1.CardFooter, { as: "footer", p: 4, children: /* @__PURE__ */ jsxRuntime.jsx(LinkButton, { ...link, width: "full" }) })
|
|
174
185
|
]
|
|
175
186
|
}
|
|
176
187
|
);
|
|
177
188
|
};
|
|
189
|
+
const BonusCardGrid = ({
|
|
190
|
+
items,
|
|
191
|
+
columns = { base: 1, md: 2, lg: 3 },
|
|
192
|
+
gap = 4,
|
|
193
|
+
cardCustomization,
|
|
194
|
+
...boxProps
|
|
195
|
+
}) => {
|
|
196
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
197
|
+
Grid,
|
|
198
|
+
{
|
|
199
|
+
items,
|
|
200
|
+
columns,
|
|
201
|
+
gap,
|
|
202
|
+
render: (item) => /* @__PURE__ */ jsxRuntime.jsx(BonusCard, { ...item, ...cardCustomization }),
|
|
203
|
+
...boxProps
|
|
204
|
+
}
|
|
205
|
+
);
|
|
206
|
+
};
|
|
178
207
|
const ContactForm = ({ ...boxProps }) => {
|
|
179
208
|
const toast = react$1.useToast();
|
|
180
209
|
const { t } = reactI18next.useTranslation("contactForm");
|
|
@@ -267,13 +296,18 @@ const FeatureCard = ({ title, description }) => {
|
|
|
267
296
|
/* @__PURE__ */ jsxRuntime.jsx(react$1.CardBody, { as: "section", pt: 0, children: /* @__PURE__ */ jsxRuntime.jsx(react$1.Text, { color: "gray.500", children: description }) })
|
|
268
297
|
] });
|
|
269
298
|
};
|
|
270
|
-
const
|
|
299
|
+
const FeatureCardGrid = ({
|
|
300
|
+
items,
|
|
301
|
+
columns = { base: 1, md: 2, lg: 3 },
|
|
302
|
+
gap = 4,
|
|
303
|
+
...boxProps
|
|
304
|
+
}) => {
|
|
271
305
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
272
306
|
Grid,
|
|
273
307
|
{
|
|
274
|
-
items
|
|
275
|
-
columns
|
|
276
|
-
gap
|
|
308
|
+
items,
|
|
309
|
+
columns,
|
|
310
|
+
gap,
|
|
277
311
|
getKey: ({ title }) => title,
|
|
278
312
|
render: (item) => /* @__PURE__ */ jsxRuntime.jsx(FeatureCard, { ...item }),
|
|
279
313
|
...boxProps
|
|
@@ -303,6 +337,30 @@ const GameCard = ({ name, description, image, link, height = "auto" }) => {
|
|
|
303
337
|
}
|
|
304
338
|
);
|
|
305
339
|
};
|
|
340
|
+
const GameCardGrid = ({
|
|
341
|
+
items,
|
|
342
|
+
columns = { base: 1, md: 2, lg: 3 },
|
|
343
|
+
gap = 4,
|
|
344
|
+
cardHeight = "full",
|
|
345
|
+
order = "default",
|
|
346
|
+
randomSeed,
|
|
347
|
+
...boxProps
|
|
348
|
+
}) => {
|
|
349
|
+
let sortedItems = items;
|
|
350
|
+
if (order === "random") {
|
|
351
|
+
sortedItems = [...items].sort(randomSeed ? index.getSeedRandomComparator(randomSeed) : index.randomComparator);
|
|
352
|
+
}
|
|
353
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
354
|
+
Grid,
|
|
355
|
+
{
|
|
356
|
+
items: sortedItems,
|
|
357
|
+
columns,
|
|
358
|
+
gap,
|
|
359
|
+
render: (item) => /* @__PURE__ */ jsxRuntime.jsx(GameCard, { ...item, height: cardHeight }),
|
|
360
|
+
...boxProps
|
|
361
|
+
}
|
|
362
|
+
);
|
|
363
|
+
};
|
|
306
364
|
const GameDemoContent = ({ src, isFullscreen, isLoaded, onLoad, onToggleFullscreen }) => {
|
|
307
365
|
const { t } = reactI18next.useTranslation("gameDemo");
|
|
308
366
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
@@ -913,10 +971,6 @@ const ProsCons = ({ items, ...boxProps }) => {
|
|
|
913
971
|
/* @__PURE__ */ jsxRuntime.jsx(ProsConsCard, { itemType: "cons", items: cons })
|
|
914
972
|
] });
|
|
915
973
|
};
|
|
916
|
-
const RichTextRenderer = ({ content }) => {
|
|
917
|
-
const components = react$2.useMDXComponents();
|
|
918
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Markdown, { components, children: content });
|
|
919
|
-
};
|
|
920
974
|
function replacePlaceholders(text, placeholders) {
|
|
921
975
|
Object.entries(placeholders).forEach(([placeholder, replacement]) => {
|
|
922
976
|
const regex = new RegExp(`{{${placeholder}}}`, "g");
|
|
@@ -973,21 +1027,6 @@ const Table = ({
|
|
|
973
1027
|
}
|
|
974
1028
|
);
|
|
975
1029
|
};
|
|
976
|
-
const Tabs = ({ items, render, ...boxProps }) => {
|
|
977
|
-
const { tabs, panels } = react.useMemo(() => {
|
|
978
|
-
const tabs2 = [];
|
|
979
|
-
const panels2 = [];
|
|
980
|
-
items.forEach(({ content, ...tab }) => {
|
|
981
|
-
tabs2.push(tab);
|
|
982
|
-
panels2.push(content);
|
|
983
|
-
});
|
|
984
|
-
return { tabs: tabs2, panels: panels2 };
|
|
985
|
-
}, []);
|
|
986
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(react$1.Tabs, { overflow: "hidden", colorScheme: "brand", ...boxProps, children: [
|
|
987
|
-
/* @__PURE__ */ jsxRuntime.jsx(react$1.TabList, { overflow: "auto hidden", children: tabs.map(({ label, icon }, index2) => /* @__PURE__ */ jsxRuntime.jsx(react$1.Tab, { children: /* @__PURE__ */ jsxRuntime.jsx(react$1.Text, { as: "h3", isTruncated: true, children: icon ? `${icon} ${label}` : label }) }, index2)) }),
|
|
988
|
-
/* @__PURE__ */ jsxRuntime.jsx(react$1.TabPanels, { children: panels.map((panel, index2) => /* @__PURE__ */ jsxRuntime.jsx(react$1.TabPanel, { children: render ? render(panel) : panel }, index2)) })
|
|
989
|
-
] });
|
|
990
|
-
};
|
|
991
1030
|
const Tip = ({ tip, author = null, ...boxProps }) => {
|
|
992
1031
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
993
1032
|
react$1.Card,
|
|
@@ -1013,15 +1052,139 @@ const Tip = ({ tip, author = null, ...boxProps }) => {
|
|
|
1013
1052
|
}
|
|
1014
1053
|
);
|
|
1015
1054
|
};
|
|
1055
|
+
const ExternalImage = ({ image, component: ImageComponent, alt = "", ...imageProps }) => {
|
|
1056
|
+
var _a, _b;
|
|
1057
|
+
const imageData = (_b = (_a = image == null ? void 0 : image.localFile) == null ? void 0 : _a.childImageSharp) == null ? void 0 : _b.gatsbyImageData;
|
|
1058
|
+
return imageData ? /* @__PURE__ */ jsxRuntime.jsx(ImageComponent, { image: imageData, alt, ...imageProps }) : /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {});
|
|
1059
|
+
};
|
|
1060
|
+
const RichText = ({ content }) => {
|
|
1061
|
+
const components = react$2.useMDXComponents();
|
|
1062
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Markdown, { components, children: content });
|
|
1063
|
+
};
|
|
1064
|
+
function extractItemsFromJson(content) {
|
|
1065
|
+
return content.strapi_json_value;
|
|
1066
|
+
}
|
|
1067
|
+
const StrapiComponent = ({ type, props, imageComponent }) => {
|
|
1068
|
+
switch (type) {
|
|
1069
|
+
case "STRAPI__COMPONENT_CONTENT_FAQ":
|
|
1070
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Faq, { items: props.items, mb: 4 });
|
|
1071
|
+
case "STRAPI__COMPONENT_CONTENT_FEATURES":
|
|
1072
|
+
return /* @__PURE__ */ jsxRuntime.jsx(FeatureCardGrid, { items: props.items, mb: 4 });
|
|
1073
|
+
case "STRAPI__COMPONENT_CONTENT_GAME_DEMO":
|
|
1074
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1075
|
+
GameDemo,
|
|
1076
|
+
{
|
|
1077
|
+
name: props.name,
|
|
1078
|
+
src: props.src,
|
|
1079
|
+
previewImage: /* @__PURE__ */ jsxRuntime.jsx(ExternalImage, { image: props.previewImage, alt: props.name, component: imageComponent }),
|
|
1080
|
+
mb: 4
|
|
1081
|
+
}
|
|
1082
|
+
);
|
|
1083
|
+
case "STRAPI__COMPONENT_CONTENT_GAME_INFO":
|
|
1084
|
+
return /* @__PURE__ */ jsxRuntime.jsx(GameInfo, { info: { ...props } });
|
|
1085
|
+
case "STRAPI__COMPONENT_CONTENT_HOW_TO":
|
|
1086
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1087
|
+
HowTo,
|
|
1088
|
+
{
|
|
1089
|
+
steps: props.steps.map((step) => {
|
|
1090
|
+
return {
|
|
1091
|
+
...step,
|
|
1092
|
+
thumbnail: /* @__PURE__ */ jsxRuntime.jsx(ExternalImage, { image: step.thumbnail, alt: step.title, component: imageComponent })
|
|
1093
|
+
};
|
|
1094
|
+
}),
|
|
1095
|
+
mb: 4
|
|
1096
|
+
}
|
|
1097
|
+
);
|
|
1098
|
+
case "STRAPI__COMPONENT_CONTENT_LIST":
|
|
1099
|
+
return /* @__PURE__ */ jsxRuntime.jsx(List, { bullet: props.bullet, items: extractItemsFromJson(props.content) });
|
|
1100
|
+
case "STRAPI__COMPONENT_CONTENT_MEDIA":
|
|
1101
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1102
|
+
ExternalImage,
|
|
1103
|
+
{
|
|
1104
|
+
component: imageComponent,
|
|
1105
|
+
image: props.file,
|
|
1106
|
+
alt: props.alternativeText,
|
|
1107
|
+
style: { display: "inline-block", marginBottom: 16 }
|
|
1108
|
+
}
|
|
1109
|
+
);
|
|
1110
|
+
case "STRAPI__COMPONENT_CONTENT_PROS_CONS":
|
|
1111
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ProsCons, { items: { ...props }, mb: 4 });
|
|
1112
|
+
case "STRAPI__COMPONENT_CONTENT_RICH_TEXT":
|
|
1113
|
+
return /* @__PURE__ */ jsxRuntime.jsx(RichText, { content: props.content.data.content });
|
|
1114
|
+
case "STRAPI__COMPONENT_CONTENT_TABLE":
|
|
1115
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1116
|
+
Table,
|
|
1117
|
+
{
|
|
1118
|
+
columnNumber: props.columnNumber,
|
|
1119
|
+
items: extractItemsFromJson(props.content),
|
|
1120
|
+
caption: props.caption,
|
|
1121
|
+
bordered: props.bordered,
|
|
1122
|
+
scrollable: props.scrollable,
|
|
1123
|
+
striped: props.striped,
|
|
1124
|
+
mb: 4
|
|
1125
|
+
}
|
|
1126
|
+
);
|
|
1127
|
+
case "STRAPI__COMPONENT_CONTENT_TIP":
|
|
1128
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1129
|
+
Tip,
|
|
1130
|
+
{
|
|
1131
|
+
tip: props.tip,
|
|
1132
|
+
author: props.author ? {
|
|
1133
|
+
...props.author,
|
|
1134
|
+
avatar: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1135
|
+
ExternalImage,
|
|
1136
|
+
{
|
|
1137
|
+
component: imageComponent,
|
|
1138
|
+
image: props.author.avatar,
|
|
1139
|
+
alt: props.author.name,
|
|
1140
|
+
style: { borderRadius: "50%" }
|
|
1141
|
+
}
|
|
1142
|
+
)
|
|
1143
|
+
} : null,
|
|
1144
|
+
mb: 4
|
|
1145
|
+
}
|
|
1146
|
+
);
|
|
1147
|
+
default:
|
|
1148
|
+
return null;
|
|
1149
|
+
}
|
|
1150
|
+
};
|
|
1151
|
+
function isStrapiContent(array) {
|
|
1152
|
+
return Array.isArray(array) && array.every(
|
|
1153
|
+
(item) => typeof item === "object" && item !== null && "__typename" in item && typeof item.__typename === "string"
|
|
1154
|
+
);
|
|
1155
|
+
}
|
|
1156
|
+
const StrapiContentRenderer = ({ content, imageComponent }) => {
|
|
1157
|
+
if (!isStrapiContent(content)) {
|
|
1158
|
+
return null;
|
|
1159
|
+
}
|
|
1160
|
+
return content.map(({ __typename: type, ...props }, index2) => /* @__PURE__ */ jsxRuntime.jsx(StrapiComponent, { type, props, imageComponent }, index2));
|
|
1161
|
+
};
|
|
1162
|
+
const Tabs = ({ items, render, ...boxProps }) => {
|
|
1163
|
+
const { tabs, panels } = react.useMemo(() => {
|
|
1164
|
+
const tabs2 = [];
|
|
1165
|
+
const panels2 = [];
|
|
1166
|
+
items.forEach(({ content, ...tab }) => {
|
|
1167
|
+
tabs2.push(tab);
|
|
1168
|
+
panels2.push(content);
|
|
1169
|
+
});
|
|
1170
|
+
return { tabs: tabs2, panels: panels2 };
|
|
1171
|
+
}, []);
|
|
1172
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(react$1.Tabs, { overflow: "hidden", colorScheme: "brand", ...boxProps, children: [
|
|
1173
|
+
/* @__PURE__ */ jsxRuntime.jsx(react$1.TabList, { overflow: "auto hidden", children: tabs.map(({ label, icon }, index2) => /* @__PURE__ */ jsxRuntime.jsx(react$1.Tab, { children: /* @__PURE__ */ jsxRuntime.jsx(react$1.Text, { as: "h3", isTruncated: true, children: icon ? `${icon} ${label}` : label }) }, index2)) }),
|
|
1174
|
+
/* @__PURE__ */ jsxRuntime.jsx(react$1.TabPanels, { children: panels.map((panel, index2) => /* @__PURE__ */ jsxRuntime.jsx(react$1.TabPanel, { children: render ? render(panel) : panel }, index2)) })
|
|
1175
|
+
] });
|
|
1176
|
+
};
|
|
1016
1177
|
exports.Author = Author;
|
|
1017
1178
|
exports.AuthorCard = AuthorCard;
|
|
1018
1179
|
exports.BonusCard = BonusCard;
|
|
1180
|
+
exports.BonusCardGrid = BonusCardGrid;
|
|
1019
1181
|
exports.Center = Center;
|
|
1020
1182
|
exports.ContactForm = ContactForm;
|
|
1021
1183
|
exports.Faq = Faq;
|
|
1022
1184
|
exports.FeatureCard = FeatureCard;
|
|
1023
|
-
exports.
|
|
1185
|
+
exports.FeatureCardGrid = FeatureCardGrid;
|
|
1024
1186
|
exports.GameCard = GameCard;
|
|
1187
|
+
exports.GameCardGrid = GameCardGrid;
|
|
1025
1188
|
exports.GameDemo = GameDemo;
|
|
1026
1189
|
exports.GameInfo = GameInfo;
|
|
1027
1190
|
exports.Grid = Grid;
|
|
@@ -1032,8 +1195,8 @@ exports.List = List;
|
|
|
1032
1195
|
exports.NotFound = NotFound;
|
|
1033
1196
|
exports.ProsCons = ProsCons;
|
|
1034
1197
|
exports.PulseButton = PulseButton;
|
|
1035
|
-
exports.RichTextRenderer = RichTextRenderer;
|
|
1036
1198
|
exports.Seo = Seo;
|
|
1199
|
+
exports.StrapiContentRenderer = StrapiContentRenderer;
|
|
1037
1200
|
exports.Table = Table;
|
|
1038
1201
|
exports.Tabs = Tabs;
|
|
1039
1202
|
exports.Tip = Tip;
|
|
@@ -91,12 +91,27 @@ function getCurrencySymbol(currencyCode) {
|
|
|
91
91
|
}).replace(/\d/g, "").trim();
|
|
92
92
|
return symbol;
|
|
93
93
|
}
|
|
94
|
+
function randomComparator() {
|
|
95
|
+
return Math.random() - 0.5;
|
|
96
|
+
}
|
|
97
|
+
function lcg(seed) {
|
|
98
|
+
const a = 1664525;
|
|
99
|
+
const c = 1013904223;
|
|
100
|
+
const m = 2 ** 31;
|
|
101
|
+
return (a * seed + c) % m / m;
|
|
102
|
+
}
|
|
103
|
+
function getSeedRandomComparator(seed) {
|
|
104
|
+
const safeSeed = Math.abs(seed) % Number.MAX_SAFE_INTEGER;
|
|
105
|
+
return () => lcg(safeSeed) - 0.5;
|
|
106
|
+
}
|
|
94
107
|
exports.Animation = Animation;
|
|
95
108
|
exports.formatDate = formatDate;
|
|
96
109
|
exports.formatNumber = formatNumber;
|
|
97
110
|
exports.getCurrencySymbol = getCurrencySymbol;
|
|
98
111
|
exports.getCurrentMonth = getCurrentMonth;
|
|
99
112
|
exports.getCurrentYear = getCurrentYear;
|
|
113
|
+
exports.getSeedRandomComparator = getSeedRandomComparator;
|
|
100
114
|
exports.parseNumber = parseNumber;
|
|
115
|
+
exports.randomComparator = randomComparator;
|
|
101
116
|
exports.round = round;
|
|
102
117
|
exports.toFixedTwo = toFixedTwo;
|