@anywayseo/tools 3.1.1 → 4.0.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.
Files changed (44) hide show
  1. package/dist/components/base/grid/index.d.ts +3 -4
  2. package/dist/components/base/grid/utils.d.ts +2 -2
  3. package/dist/components/bonus-card/content/index.d.ts +2 -1
  4. package/dist/components/bonus-card/index.d.ts +5 -1
  5. package/dist/components/bonus-card/title/index.d.ts +3 -1
  6. package/dist/components/bonus-card-grid/index.d.ts +9 -0
  7. package/dist/components/feature-card-grid/index.d.ts +9 -0
  8. package/dist/components/game-card/index.d.ts +2 -2
  9. package/dist/components/game-card-grid/index.d.ts +12 -0
  10. package/dist/components/index.cjs +5 -3
  11. package/dist/components/index.d.ts +4 -2
  12. package/dist/components/index.mjs +16 -14
  13. package/dist/components/strapi-component/external-image/index.d.ts +7 -0
  14. package/dist/components/strapi-component/index.d.ts +9 -0
  15. package/dist/components/strapi-component/rich-text/index.d.ts +6 -0
  16. package/dist/components/strapi-component/utils.d.ts +3 -0
  17. package/dist/components/strapi-content-renderer/index.d.ts +8 -0
  18. package/dist/components/strapi-content-renderer/utils.d.ts +2 -0
  19. package/dist/{index-eta4hdHD.js → index-BmkMQFW1.js} +192 -39
  20. package/dist/{index-Cte2-g6s.js → index-Bw7vqsyw.js} +15 -0
  21. package/dist/{index-25M8hPOF.mjs → index-DLy2LYCD.mjs} +15 -0
  22. package/dist/{index-Cin-9-As.mjs → index-DbwY2gVh.mjs} +203 -50
  23. package/dist/index-DzEvPZny.mjs +87 -0
  24. package/dist/index-NsIHOkeN.js +86 -0
  25. package/dist/index.cjs +9 -7
  26. package/dist/index.mjs +23 -21
  27. package/dist/types/components/common/index.d.ts +2 -1
  28. package/dist/types/components/external-image/index.d.ts +14 -0
  29. package/dist/types/components/game-card/index.d.ts +1 -0
  30. package/dist/types/components/grid/index.d.ts +3 -0
  31. package/dist/types/components/index.d.ts +3 -0
  32. package/dist/types/components/strapi-component/index.d.ts +5 -0
  33. package/dist/utils/index.cjs +4 -4
  34. package/dist/utils/index.d.ts +1 -2
  35. package/dist/utils/index.mjs +7 -7
  36. package/dist/utils/sorting/index.d.ts +2 -0
  37. package/package.json +2 -1
  38. package/dist/components/base/grid/types.d.ts +0 -3
  39. package/dist/components/features/index.d.ts +0 -7
  40. package/dist/components/rich-text-renderer/index.d.ts +0 -6
  41. package/dist/index-CHnNtadm.mjs +0 -294
  42. package/dist/index-D2JqGE4u.js +0 -293
  43. package/dist/utils/api/index.d.ts +0 -1
  44. package/dist/utils/gatsby/index.d.ts +0 -3
@@ -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?: ColumnsConfig;
6
- gap?: SpacingConfig;
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 { ColumnsConfig } from './types';
2
- export declare const defaultColumns: ColumnsConfig;
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,10 @@
1
1
  import { FC } from 'react';
2
- import { IBonusCard } from '../../types';
2
+ import { IBonusCard, Color } from '../../types';
3
3
  type BonusCardProps = IBonusCard & {
4
+ color?: Color;
5
+ textColor?: Color;
6
+ titleColor?: Color;
7
+ titleTextColor?: Color;
4
8
  className?: string;
5
9
  };
6
10
  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,9 @@
1
+ import { FC } from 'react';
2
+ import { BoxPositionProps, GridColumns, GridGap, IBonusCard } from '../../types';
3
+ type BonusCardGridProps = {
4
+ items: IBonusCard[];
5
+ columns?: GridColumns;
6
+ gap?: GridGap;
7
+ } & BoxPositionProps;
8
+ declare const BonusCardGrid: FC<BonusCardGridProps>;
9
+ 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?: 'full' | 'auto';
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-eta4hdHD.js");
3
+ const index = require("../index-BmkMQFW1.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.Features = index.Features;
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 Features } from './features';
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 { h, A, B, i, C, F, a, b, G, c, d, j, H, L, k, e, N, P, l, R, S, T, f, g } from "../index-Cin-9-As.mjs";
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-DbwY2gVh.mjs";
2
2
  export {
3
- h as Author,
3
+ k as Author,
4
4
  A as AuthorCard,
5
5
  B as BonusCard,
6
- i as Center,
6
+ a as BonusCardGrid,
7
+ l as Center,
7
8
  C as ContactForm,
8
9
  F as Faq,
9
- a as FeatureCard,
10
- b as Features,
10
+ b as FeatureCard,
11
+ c as FeatureCardGrid,
11
12
  G as GameCard,
12
- c as GameDemo,
13
- d as GameInfo,
14
- j as Grid,
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
- k as LinkButton,
18
- e as List,
19
+ n as LinkButton,
20
+ g as List,
19
21
  N as NotFound,
20
22
  P as ProsCons,
21
- l as PulseButton,
22
- R as RichTextRenderer,
23
+ o as PulseButton,
23
24
  S as Seo,
25
+ h as StrapiContentRenderer,
24
26
  T as Table,
25
- f as Tabs,
26
- g as Tip
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,6 @@
1
+ import { FC } from 'react';
2
+ type RichTextProps = {
3
+ content: string;
4
+ };
5
+ declare const RichText: FC<RichTextProps>;
6
+ export default RichText;
@@ -0,0 +1,3 @@
1
+ export declare function extractItemsFromJson(content: {
2
+ ['strapi_json_value']: string[];
3
+ }): string[];
@@ -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;
@@ -0,0 +1,2 @@
1
+ import { IStrapiComponentFragment } from '../../types';
2
+ export declare function isStrapiContent(array: unknown): array is IStrapiComponentFragment[];
@@ -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-Cte2-g6s.js");
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: "white", children: isOpen ? t("action.collapse") : t("action.expand") }) }),
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: "yellow",
138
- color: "black",
137
+ bg: color,
138
+ fontSize: "md",
139
139
  fontWeight: "bold",
140
- fontSize: "lg",
140
+ color: textColor,
141
141
  children: content
142
142
  }
143
143
  );
144
144
  };
145
- const BonusCard = ({ title, subtitle, content, link, image, className }) => {
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: "whiteAlpha.900",
152
- bg: "linear-gradient(90deg, #3b1f47, #731d58)",
162
+ color: textColor,
163
+ bg: color,
153
164
  _before: image ? {
154
165
  content: '""',
155
166
  position: "absolute",
@@ -166,15 +177,23 @@ 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
+ ...boxProps
194
+ }) => {
195
+ return /* @__PURE__ */ jsxRuntime.jsx(Grid, { items, columns, gap, render: (item) => /* @__PURE__ */ jsxRuntime.jsx(BonusCard, { ...item }), ...boxProps });
196
+ };
178
197
  const ContactForm = ({ ...boxProps }) => {
179
198
  const toast = react$1.useToast();
180
199
  const { t } = reactI18next.useTranslation("contactForm");
@@ -267,13 +286,18 @@ const FeatureCard = ({ title, description }) => {
267
286
  /* @__PURE__ */ jsxRuntime.jsx(react$1.CardBody, { as: "section", pt: 0, children: /* @__PURE__ */ jsxRuntime.jsx(react$1.Text, { color: "gray.500", children: description }) })
268
287
  ] });
269
288
  };
270
- const Features = ({ features, ...boxProps }) => {
289
+ const FeatureCardGrid = ({
290
+ items,
291
+ columns = { base: 1, md: 2, lg: 3 },
292
+ gap = 4,
293
+ ...boxProps
294
+ }) => {
271
295
  return /* @__PURE__ */ jsxRuntime.jsx(
272
296
  Grid,
273
297
  {
274
- items: features,
275
- columns: { base: 1, md: 2, lg: 3 },
276
- gap: 10,
298
+ items,
299
+ columns,
300
+ gap,
277
301
  getKey: ({ title }) => title,
278
302
  render: (item) => /* @__PURE__ */ jsxRuntime.jsx(FeatureCard, { ...item }),
279
303
  ...boxProps
@@ -303,6 +327,30 @@ const GameCard = ({ name, description, image, link, height = "auto" }) => {
303
327
  }
304
328
  );
305
329
  };
330
+ const GameCardGrid = ({
331
+ items,
332
+ columns = { base: 1, md: 2, lg: 3 },
333
+ gap = 4,
334
+ cardHeight = "full",
335
+ order = "default",
336
+ randomSeed,
337
+ ...boxProps
338
+ }) => {
339
+ let sortedItems = items;
340
+ if (order === "random") {
341
+ sortedItems = [...items].sort(randomSeed ? index.getSeedRandomComparator(randomSeed) : index.randomComparator);
342
+ }
343
+ return /* @__PURE__ */ jsxRuntime.jsx(
344
+ Grid,
345
+ {
346
+ items: sortedItems,
347
+ columns,
348
+ gap,
349
+ render: (item) => /* @__PURE__ */ jsxRuntime.jsx(GameCard, { ...item, height: cardHeight }),
350
+ ...boxProps
351
+ }
352
+ );
353
+ };
306
354
  const GameDemoContent = ({ src, isFullscreen, isLoaded, onLoad, onToggleFullscreen }) => {
307
355
  const { t } = reactI18next.useTranslation("gameDemo");
308
356
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
@@ -913,10 +961,6 @@ const ProsCons = ({ items, ...boxProps }) => {
913
961
  /* @__PURE__ */ jsxRuntime.jsx(ProsConsCard, { itemType: "cons", items: cons })
914
962
  ] });
915
963
  };
916
- const RichTextRenderer = ({ content }) => {
917
- const components = react$2.useMDXComponents();
918
- return /* @__PURE__ */ jsxRuntime.jsx(Markdown, { components, children: content });
919
- };
920
964
  function replacePlaceholders(text, placeholders) {
921
965
  Object.entries(placeholders).forEach(([placeholder, replacement]) => {
922
966
  const regex = new RegExp(`{{${placeholder}}}`, "g");
@@ -973,21 +1017,6 @@ const Table = ({
973
1017
  }
974
1018
  );
975
1019
  };
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
1020
  const Tip = ({ tip, author = null, ...boxProps }) => {
992
1021
  return /* @__PURE__ */ jsxRuntime.jsxs(
993
1022
  react$1.Card,
@@ -1013,15 +1042,139 @@ const Tip = ({ tip, author = null, ...boxProps }) => {
1013
1042
  }
1014
1043
  );
1015
1044
  };
1045
+ const ExternalImage = ({ image, component: ImageComponent, alt = "", ...imageProps }) => {
1046
+ var _a, _b;
1047
+ const imageData = (_b = (_a = image == null ? void 0 : image.localFile) == null ? void 0 : _a.childImageSharp) == null ? void 0 : _b.gatsbyImageData;
1048
+ return imageData ? /* @__PURE__ */ jsxRuntime.jsx(ImageComponent, { image: imageData, alt, ...imageProps }) : /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {});
1049
+ };
1050
+ const RichText = ({ content }) => {
1051
+ const components = react$2.useMDXComponents();
1052
+ return /* @__PURE__ */ jsxRuntime.jsx(Markdown, { components, children: content });
1053
+ };
1054
+ function extractItemsFromJson(content) {
1055
+ return content.strapi_json_value;
1056
+ }
1057
+ const StrapiComponent = ({ type, props, imageComponent }) => {
1058
+ switch (type) {
1059
+ case "STRAPI__COMPONENT_CONTENT_FAQ":
1060
+ return /* @__PURE__ */ jsxRuntime.jsx(Faq, { items: props.items, mb: 4 });
1061
+ case "STRAPI__COMPONENT_CONTENT_FEATURES":
1062
+ return /* @__PURE__ */ jsxRuntime.jsx(FeatureCardGrid, { items: props.items, mb: 4 });
1063
+ case "STRAPI__COMPONENT_CONTENT_GAME_DEMO":
1064
+ return /* @__PURE__ */ jsxRuntime.jsx(
1065
+ GameDemo,
1066
+ {
1067
+ name: props.name,
1068
+ src: props.src,
1069
+ previewImage: /* @__PURE__ */ jsxRuntime.jsx(ExternalImage, { image: props.previewImage, alt: props.name, component: imageComponent }),
1070
+ mb: 4
1071
+ }
1072
+ );
1073
+ case "STRAPI__COMPONENT_CONTENT_GAME_INFO":
1074
+ return /* @__PURE__ */ jsxRuntime.jsx(GameInfo, { info: { ...props } });
1075
+ case "STRAPI__COMPONENT_CONTENT_HOW_TO":
1076
+ return /* @__PURE__ */ jsxRuntime.jsx(
1077
+ HowTo,
1078
+ {
1079
+ steps: props.steps.map((step) => {
1080
+ return {
1081
+ ...step,
1082
+ thumbnail: /* @__PURE__ */ jsxRuntime.jsx(ExternalImage, { image: step.thumbnail, alt: step.title, component: imageComponent })
1083
+ };
1084
+ }),
1085
+ mb: 4
1086
+ }
1087
+ );
1088
+ case "STRAPI__COMPONENT_CONTENT_LIST":
1089
+ return /* @__PURE__ */ jsxRuntime.jsx(List, { bullet: props.bullet, items: extractItemsFromJson(props.content) });
1090
+ case "STRAPI__COMPONENT_CONTENT_MEDIA":
1091
+ return /* @__PURE__ */ jsxRuntime.jsx(
1092
+ ExternalImage,
1093
+ {
1094
+ component: imageComponent,
1095
+ image: props.file,
1096
+ alt: props.alternativeText,
1097
+ style: { display: "inline-block", marginBottom: 16 }
1098
+ }
1099
+ );
1100
+ case "STRAPI__COMPONENT_CONTENT_PROS_CONS":
1101
+ return /* @__PURE__ */ jsxRuntime.jsx(ProsCons, { items: { ...props }, mb: 4 });
1102
+ case "STRAPI__COMPONENT_CONTENT_RICH_TEXT":
1103
+ return /* @__PURE__ */ jsxRuntime.jsx(RichText, { content: props.content.data.content });
1104
+ case "STRAPI__COMPONENT_CONTENT_TABLE":
1105
+ return /* @__PURE__ */ jsxRuntime.jsx(
1106
+ Table,
1107
+ {
1108
+ columnNumber: props.columnNumber,
1109
+ items: extractItemsFromJson(props.content),
1110
+ caption: props.caption,
1111
+ bordered: props.bordered,
1112
+ scrollable: props.scrollable,
1113
+ striped: props.striped,
1114
+ mb: 4
1115
+ }
1116
+ );
1117
+ case "STRAPI__COMPONENT_CONTENT_TIP":
1118
+ return /* @__PURE__ */ jsxRuntime.jsx(
1119
+ Tip,
1120
+ {
1121
+ tip: props.tip,
1122
+ author: props.author ? {
1123
+ ...props.author,
1124
+ avatar: /* @__PURE__ */ jsxRuntime.jsx(
1125
+ ExternalImage,
1126
+ {
1127
+ component: imageComponent,
1128
+ image: props.author.avatar,
1129
+ alt: props.author.name,
1130
+ style: { borderRadius: "50%" }
1131
+ }
1132
+ )
1133
+ } : null,
1134
+ mb: 4
1135
+ }
1136
+ );
1137
+ default:
1138
+ return null;
1139
+ }
1140
+ };
1141
+ function isStrapiContent(array) {
1142
+ return Array.isArray(array) && array.every(
1143
+ (item) => typeof item === "object" && item !== null && "__typename" in item && typeof item.__typename === "string"
1144
+ );
1145
+ }
1146
+ const StrapiContentRenderer = ({ content, imageComponent }) => {
1147
+ if (!isStrapiContent(content)) {
1148
+ return null;
1149
+ }
1150
+ return content.map(({ __typename: type, ...props }, index2) => /* @__PURE__ */ jsxRuntime.jsx(StrapiComponent, { type, props, imageComponent }, index2));
1151
+ };
1152
+ const Tabs = ({ items, render, ...boxProps }) => {
1153
+ const { tabs, panels } = react.useMemo(() => {
1154
+ const tabs2 = [];
1155
+ const panels2 = [];
1156
+ items.forEach(({ content, ...tab }) => {
1157
+ tabs2.push(tab);
1158
+ panels2.push(content);
1159
+ });
1160
+ return { tabs: tabs2, panels: panels2 };
1161
+ }, []);
1162
+ return /* @__PURE__ */ jsxRuntime.jsxs(react$1.Tabs, { overflow: "hidden", colorScheme: "brand", ...boxProps, children: [
1163
+ /* @__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)) }),
1164
+ /* @__PURE__ */ jsxRuntime.jsx(react$1.TabPanels, { children: panels.map((panel, index2) => /* @__PURE__ */ jsxRuntime.jsx(react$1.TabPanel, { children: render ? render(panel) : panel }, index2)) })
1165
+ ] });
1166
+ };
1016
1167
  exports.Author = Author;
1017
1168
  exports.AuthorCard = AuthorCard;
1018
1169
  exports.BonusCard = BonusCard;
1170
+ exports.BonusCardGrid = BonusCardGrid;
1019
1171
  exports.Center = Center;
1020
1172
  exports.ContactForm = ContactForm;
1021
1173
  exports.Faq = Faq;
1022
1174
  exports.FeatureCard = FeatureCard;
1023
- exports.Features = Features;
1175
+ exports.FeatureCardGrid = FeatureCardGrid;
1024
1176
  exports.GameCard = GameCard;
1177
+ exports.GameCardGrid = GameCardGrid;
1025
1178
  exports.GameDemo = GameDemo;
1026
1179
  exports.GameInfo = GameInfo;
1027
1180
  exports.Grid = Grid;
@@ -1032,8 +1185,8 @@ exports.List = List;
1032
1185
  exports.NotFound = NotFound;
1033
1186
  exports.ProsCons = ProsCons;
1034
1187
  exports.PulseButton = PulseButton;
1035
- exports.RichTextRenderer = RichTextRenderer;
1036
1188
  exports.Seo = Seo;
1189
+ exports.StrapiContentRenderer = StrapiContentRenderer;
1037
1190
  exports.Table = Table;
1038
1191
  exports.Tabs = Tabs;
1039
1192
  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;
@@ -90,11 +90,26 @@ function getCurrencySymbol(currencyCode) {
90
90
  }).replace(/\d/g, "").trim();
91
91
  return symbol;
92
92
  }
93
+ function randomComparator() {
94
+ return Math.random() - 0.5;
95
+ }
96
+ function lcg(seed) {
97
+ const a = 1664525;
98
+ const c = 1013904223;
99
+ const m = 2 ** 31;
100
+ return (a * seed + c) % m / m;
101
+ }
102
+ function getSeedRandomComparator(seed) {
103
+ const safeSeed = Math.abs(seed) % Number.MAX_SAFE_INTEGER;
104
+ return () => lcg(safeSeed) - 0.5;
105
+ }
93
106
  export {
94
107
  Animation as A,
95
108
  getCurrentMonth as a,
96
109
  formatNumber as b,
97
110
  getCurrencySymbol as c,
111
+ randomComparator as d,
112
+ getSeedRandomComparator as e,
98
113
  formatDate as f,
99
114
  getCurrentYear as g,
100
115
  parseNumber as p,