@anywayseo/tools 3.1.2 → 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 (38) 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.cjs +8 -4
  24. package/dist/index.mjs +21 -17
  25. package/dist/types/components/common/index.d.ts +2 -1
  26. package/dist/types/components/external-image/index.d.ts +14 -0
  27. package/dist/types/components/game-card/index.d.ts +1 -0
  28. package/dist/types/components/grid/index.d.ts +3 -0
  29. package/dist/types/components/index.d.ts +3 -0
  30. package/dist/types/components/strapi-component/index.d.ts +5 -0
  31. package/dist/utils/index.cjs +3 -1
  32. package/dist/utils/index.d.ts +1 -0
  33. package/dist/utils/index.mjs +5 -3
  34. package/dist/utils/sorting/index.d.ts +2 -0
  35. package/package.json +2 -1
  36. package/dist/components/base/grid/types.d.ts +0 -3
  37. package/dist/components/features/index.d.ts +0 -7
  38. 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?: 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,
@@ -1,16 +1,16 @@
1
1
  import { jsxs, jsx, Fragment } from "react/jsx-runtime";
2
2
  import { Box, Collapse, Text, Button, Flex, Stack, Image, Center as Center$1, SimpleGrid, Link, Card, CardHeader, Heading, CardBody, Popover, PopoverTrigger, Portal, PopoverContent, PopoverBody, CardFooter, useToast, useColorModeValue, VStack, FormControl, FormLabel, InputGroup, InputLeftElement, Input, Textarea, Accordion, AccordionItem, AccordionButton, AccordionIcon, AccordionPanel, LinkBox, LinkOverlay, IconButton, AbsoluteCenter, Spinner, useDisclosure, Divider, Circle, Container as Container$1, List as List$1, ListItem, Icon, ListIcon, TableContainer, Table as Table$1, Thead, Tr, Th, Tbody, Td, TableCaption, Tabs as Tabs$1, TabList, Tab, TabPanels, TabPanel } from "@chakra-ui/react";
3
3
  import { useTranslation } from "react-i18next";
4
- import { A as Animation, b as formatNumber, c as getCurrencySymbol, f as formatDate, g as getCurrentYear, a as getCurrentMonth } from "./index-25M8hPOF.mjs";
4
+ import { A as Animation, e as getSeedRandomComparator, d as randomComparator, b as formatNumber, c as getCurrencySymbol, f as formatDate, g as getCurrentYear, a as getCurrentMonth } from "./index-DLy2LYCD.mjs";
5
5
  import { a as GameCharacteristic } from "./index-DoBCANwf.mjs";
6
6
  import "@ctrl/tinycolor";
7
7
  import { useRef, useState, useLayoutEffect, Fragment as Fragment$1, forwardRef, useEffect, useMemo } from "react";
8
8
  import { EmailIcon, StarIcon, CloseIcon, ExternalLinkIcon, ChevronRightIcon, ChevronDownIcon, HamburgerIcon, ChevronUpIcon, WarningIcon, CheckCircleIcon } from "@chakra-ui/icons";
9
- import { u as usePrimaryColors } from "./index-xuSxvz5z.mjs";
10
9
  import { useMDXComponents } from "@mdx-js/react";
11
10
  import { u as useSiteContext } from "./index-BNb-P8a6.mjs";
12
- import { t } from "i18next";
13
11
  import { Link as Link$1 } from "gatsby";
12
+ import { u as usePrimaryColors } from "./index-xuSxvz5z.mjs";
13
+ import { t } from "i18next";
14
14
  import Markdown from "react-markdown";
15
15
  const ONE_LINE_HEIGHT = 24;
16
16
  const Bio = ({ content, maxLines = 1 }) => {
@@ -117,14 +117,14 @@ const AuthorCard = ({ author, ...boxProps }) => {
117
117
  )
118
118
  ] });
119
119
  };
120
- const BonusCardContent = ({ content }) => {
120
+ const BonusCardContent = ({ content, buttonColor }) => {
121
121
  const { t: t2 } = useTranslation("author");
122
122
  return /* @__PURE__ */ jsx(Popover, { autoFocus: false, isLazy: true, lazyBehavior: "keepMounted", children: ({ isOpen }) => /* @__PURE__ */ jsxs(Fragment, { children: [
123
- /* @__PURE__ */ jsx(PopoverTrigger, { children: /* @__PURE__ */ jsx(Button, { size: "sm", variant: "link", color: "white", children: isOpen ? t2("action.collapse") : t2("action.expand") }) }),
123
+ /* @__PURE__ */ jsx(PopoverTrigger, { children: /* @__PURE__ */ jsx(Button, { size: "sm", variant: "link", color: buttonColor, children: isOpen ? t2("action.collapse") : t2("action.expand") }) }),
124
124
  /* @__PURE__ */ jsx(Portal, { children: /* @__PURE__ */ jsx(PopoverContent, { children: /* @__PURE__ */ jsx(PopoverBody, { children: Array.isArray(content) ? /* @__PURE__ */ jsx(Stack, { children: content.map((paragraph, index) => /* @__PURE__ */ jsx(Text, { as: "span", children: paragraph }, index)) }) : /* @__PURE__ */ jsx(Text, { children: content }) }) }) })
125
125
  ] }) });
126
126
  };
127
- const BonusCardTitle = ({ content }) => {
127
+ const BonusCardTitle = ({ content, color, textColor }) => {
128
128
  return /* @__PURE__ */ jsx(
129
129
  Text,
130
130
  {
@@ -133,22 +133,33 @@ const BonusCardTitle = ({ content }) => {
133
133
  py: 1,
134
134
  px: 2,
135
135
  borderRadius: "md",
136
- bg: "yellow",
137
- color: "black",
136
+ bg: color,
137
+ fontSize: "md",
138
138
  fontWeight: "bold",
139
- fontSize: "lg",
139
+ color: textColor,
140
140
  children: content
141
141
  }
142
142
  );
143
143
  };
144
- const BonusCard = ({ title, subtitle, content, link, image, className }) => {
144
+ const BonusCard = ({
145
+ title,
146
+ subtitle,
147
+ content,
148
+ link,
149
+ image,
150
+ color = "linear-gradient(90deg, #3b1f47, #731d58)",
151
+ textColor = "whiteAlpha.900",
152
+ titleColor = "yellow",
153
+ titleTextColor = "black",
154
+ className
155
+ }) => {
145
156
  return /* @__PURE__ */ jsxs(
146
157
  Card,
147
158
  {
148
159
  as: "article",
149
160
  h: "full",
150
- color: "whiteAlpha.900",
151
- bg: "linear-gradient(90deg, #3b1f47, #731d58)",
161
+ color: textColor,
162
+ bg: color,
152
163
  _before: image ? {
153
164
  content: '""',
154
165
  position: "absolute",
@@ -165,15 +176,23 @@ const BonusCard = ({ title, subtitle, content, link, image, className }) => {
165
176
  className,
166
177
  children: [
167
178
  /* @__PURE__ */ jsxs(CardBody, { as: "section", pb: 0, flex: 1, children: [
168
- /* @__PURE__ */ jsx(BonusCardTitle, { content: title }),
179
+ /* @__PURE__ */ jsx(BonusCardTitle, { content: title, color: titleColor, textColor: titleTextColor }),
169
180
  /* @__PURE__ */ jsx(Text, { fontSize: "2xl", fontWeight: "bold", my: 2, children: subtitle }),
170
- /* @__PURE__ */ jsx(BonusCardContent, { content })
181
+ /* @__PURE__ */ jsx(BonusCardContent, { content, buttonColor: textColor })
171
182
  ] }),
172
183
  /* @__PURE__ */ jsx(CardFooter, { as: "footer", p: 4, children: /* @__PURE__ */ jsx(LinkButton, { ...link, width: "full" }) })
173
184
  ]
174
185
  }
175
186
  );
176
187
  };
188
+ const BonusCardGrid = ({
189
+ items,
190
+ columns = { base: 1, md: 2, lg: 3 },
191
+ gap = 4,
192
+ ...boxProps
193
+ }) => {
194
+ return /* @__PURE__ */ jsx(Grid, { items, columns, gap, render: (item) => /* @__PURE__ */ jsx(BonusCard, { ...item }), ...boxProps });
195
+ };
177
196
  const ContactForm = ({ ...boxProps }) => {
178
197
  const toast = useToast();
179
198
  const { t: t2 } = useTranslation("contactForm");
@@ -266,13 +285,18 @@ const FeatureCard = ({ title, description }) => {
266
285
  /* @__PURE__ */ jsx(CardBody, { as: "section", pt: 0, children: /* @__PURE__ */ jsx(Text, { color: "gray.500", children: description }) })
267
286
  ] });
268
287
  };
269
- const Features = ({ features, ...boxProps }) => {
288
+ const FeatureCardGrid = ({
289
+ items,
290
+ columns = { base: 1, md: 2, lg: 3 },
291
+ gap = 4,
292
+ ...boxProps
293
+ }) => {
270
294
  return /* @__PURE__ */ jsx(
271
295
  Grid,
272
296
  {
273
- items: features,
274
- columns: { base: 1, md: 2, lg: 3 },
275
- gap: 10,
297
+ items,
298
+ columns,
299
+ gap,
276
300
  getKey: ({ title }) => title,
277
301
  render: (item) => /* @__PURE__ */ jsx(FeatureCard, { ...item }),
278
302
  ...boxProps
@@ -302,6 +326,30 @@ const GameCard = ({ name, description, image, link, height = "auto" }) => {
302
326
  }
303
327
  );
304
328
  };
329
+ const GameCardGrid = ({
330
+ items,
331
+ columns = { base: 1, md: 2, lg: 3 },
332
+ gap = 4,
333
+ cardHeight = "full",
334
+ order = "default",
335
+ randomSeed,
336
+ ...boxProps
337
+ }) => {
338
+ let sortedItems = items;
339
+ if (order === "random") {
340
+ sortedItems = [...items].sort(randomSeed ? getSeedRandomComparator(randomSeed) : randomComparator);
341
+ }
342
+ return /* @__PURE__ */ jsx(
343
+ Grid,
344
+ {
345
+ items: sortedItems,
346
+ columns,
347
+ gap,
348
+ render: (item) => /* @__PURE__ */ jsx(GameCard, { ...item, height: cardHeight }),
349
+ ...boxProps
350
+ }
351
+ );
352
+ };
305
353
  const GameDemoContent = ({ src, isFullscreen, isLoaded, onLoad, onToggleFullscreen }) => {
306
354
  const { t: t2 } = useTranslation("gameDemo");
307
355
  return /* @__PURE__ */ jsxs(Fragment, { children: [
@@ -912,10 +960,6 @@ const ProsCons = ({ items, ...boxProps }) => {
912
960
  /* @__PURE__ */ jsx(ProsConsCard, { itemType: "cons", items: cons })
913
961
  ] });
914
962
  };
915
- const RichTextRenderer = ({ content }) => {
916
- const components = useMDXComponents();
917
- return /* @__PURE__ */ jsx(Markdown, { components, children: content });
918
- };
919
963
  function replacePlaceholders(text, placeholders) {
920
964
  Object.entries(placeholders).forEach(([placeholder, replacement]) => {
921
965
  const regex = new RegExp(`{{${placeholder}}}`, "g");
@@ -972,21 +1016,6 @@ const Table = ({
972
1016
  }
973
1017
  );
974
1018
  };
975
- const Tabs = ({ items, render, ...boxProps }) => {
976
- const { tabs, panels } = useMemo(() => {
977
- const tabs2 = [];
978
- const panels2 = [];
979
- items.forEach(({ content, ...tab }) => {
980
- tabs2.push(tab);
981
- panels2.push(content);
982
- });
983
- return { tabs: tabs2, panels: panels2 };
984
- }, []);
985
- return /* @__PURE__ */ jsxs(Tabs$1, { overflow: "hidden", colorScheme: "brand", ...boxProps, children: [
986
- /* @__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)) }),
987
- /* @__PURE__ */ jsx(TabPanels, { children: panels.map((panel, index) => /* @__PURE__ */ jsx(TabPanel, { children: render ? render(panel) : panel }, index)) })
988
- ] });
989
- };
990
1019
  const Tip = ({ tip, author = null, ...boxProps }) => {
991
1020
  return /* @__PURE__ */ jsxs(
992
1021
  Card,
@@ -1012,6 +1041,128 @@ const Tip = ({ tip, author = null, ...boxProps }) => {
1012
1041
  }
1013
1042
  );
1014
1043
  };
1044
+ const ExternalImage = ({ image, component: ImageComponent, alt = "", ...imageProps }) => {
1045
+ var _a, _b;
1046
+ const imageData = (_b = (_a = image == null ? void 0 : image.localFile) == null ? void 0 : _a.childImageSharp) == null ? void 0 : _b.gatsbyImageData;
1047
+ return imageData ? /* @__PURE__ */ jsx(ImageComponent, { image: imageData, alt, ...imageProps }) : /* @__PURE__ */ jsx(Fragment, {});
1048
+ };
1049
+ const RichText = ({ content }) => {
1050
+ const components = useMDXComponents();
1051
+ return /* @__PURE__ */ jsx(Markdown, { components, children: content });
1052
+ };
1053
+ function extractItemsFromJson(content) {
1054
+ return content.strapi_json_value;
1055
+ }
1056
+ const StrapiComponent = ({ type, props, imageComponent }) => {
1057
+ switch (type) {
1058
+ case "STRAPI__COMPONENT_CONTENT_FAQ":
1059
+ return /* @__PURE__ */ jsx(Faq, { items: props.items, mb: 4 });
1060
+ case "STRAPI__COMPONENT_CONTENT_FEATURES":
1061
+ return /* @__PURE__ */ jsx(FeatureCardGrid, { items: props.items, mb: 4 });
1062
+ case "STRAPI__COMPONENT_CONTENT_GAME_DEMO":
1063
+ return /* @__PURE__ */ jsx(
1064
+ GameDemo,
1065
+ {
1066
+ name: props.name,
1067
+ src: props.src,
1068
+ previewImage: /* @__PURE__ */ jsx(ExternalImage, { image: props.previewImage, alt: props.name, component: imageComponent }),
1069
+ mb: 4
1070
+ }
1071
+ );
1072
+ case "STRAPI__COMPONENT_CONTENT_GAME_INFO":
1073
+ return /* @__PURE__ */ jsx(GameInfo, { info: { ...props } });
1074
+ case "STRAPI__COMPONENT_CONTENT_HOW_TO":
1075
+ return /* @__PURE__ */ jsx(
1076
+ HowTo,
1077
+ {
1078
+ steps: props.steps.map((step) => {
1079
+ return {
1080
+ ...step,
1081
+ thumbnail: /* @__PURE__ */ jsx(ExternalImage, { image: step.thumbnail, alt: step.title, component: imageComponent })
1082
+ };
1083
+ }),
1084
+ mb: 4
1085
+ }
1086
+ );
1087
+ case "STRAPI__COMPONENT_CONTENT_LIST":
1088
+ return /* @__PURE__ */ jsx(List, { bullet: props.bullet, items: extractItemsFromJson(props.content) });
1089
+ case "STRAPI__COMPONENT_CONTENT_MEDIA":
1090
+ return /* @__PURE__ */ jsx(
1091
+ ExternalImage,
1092
+ {
1093
+ component: imageComponent,
1094
+ image: props.file,
1095
+ alt: props.alternativeText,
1096
+ style: { display: "inline-block", marginBottom: 16 }
1097
+ }
1098
+ );
1099
+ case "STRAPI__COMPONENT_CONTENT_PROS_CONS":
1100
+ return /* @__PURE__ */ jsx(ProsCons, { items: { ...props }, mb: 4 });
1101
+ case "STRAPI__COMPONENT_CONTENT_RICH_TEXT":
1102
+ return /* @__PURE__ */ jsx(RichText, { content: props.content.data.content });
1103
+ case "STRAPI__COMPONENT_CONTENT_TABLE":
1104
+ return /* @__PURE__ */ jsx(
1105
+ Table,
1106
+ {
1107
+ columnNumber: props.columnNumber,
1108
+ items: extractItemsFromJson(props.content),
1109
+ caption: props.caption,
1110
+ bordered: props.bordered,
1111
+ scrollable: props.scrollable,
1112
+ striped: props.striped,
1113
+ mb: 4
1114
+ }
1115
+ );
1116
+ case "STRAPI__COMPONENT_CONTENT_TIP":
1117
+ return /* @__PURE__ */ jsx(
1118
+ Tip,
1119
+ {
1120
+ tip: props.tip,
1121
+ author: props.author ? {
1122
+ ...props.author,
1123
+ avatar: /* @__PURE__ */ jsx(
1124
+ ExternalImage,
1125
+ {
1126
+ component: imageComponent,
1127
+ image: props.author.avatar,
1128
+ alt: props.author.name,
1129
+ style: { borderRadius: "50%" }
1130
+ }
1131
+ )
1132
+ } : null,
1133
+ mb: 4
1134
+ }
1135
+ );
1136
+ default:
1137
+ return null;
1138
+ }
1139
+ };
1140
+ function isStrapiContent(array) {
1141
+ return Array.isArray(array) && array.every(
1142
+ (item) => typeof item === "object" && item !== null && "__typename" in item && typeof item.__typename === "string"
1143
+ );
1144
+ }
1145
+ const StrapiContentRenderer = ({ content, imageComponent }) => {
1146
+ if (!isStrapiContent(content)) {
1147
+ return null;
1148
+ }
1149
+ return content.map(({ __typename: type, ...props }, index) => /* @__PURE__ */ jsx(StrapiComponent, { type, props, imageComponent }, index));
1150
+ };
1151
+ const Tabs = ({ items, render, ...boxProps }) => {
1152
+ const { tabs, panels } = useMemo(() => {
1153
+ const tabs2 = [];
1154
+ const panels2 = [];
1155
+ items.forEach(({ content, ...tab }) => {
1156
+ tabs2.push(tab);
1157
+ panels2.push(content);
1158
+ });
1159
+ return { tabs: tabs2, panels: panels2 };
1160
+ }, []);
1161
+ return /* @__PURE__ */ jsxs(Tabs$1, { overflow: "hidden", colorScheme: "brand", ...boxProps, children: [
1162
+ /* @__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)) }),
1163
+ /* @__PURE__ */ jsx(TabPanels, { children: panels.map((panel, index) => /* @__PURE__ */ jsx(TabPanel, { children: render ? render(panel) : panel }, index)) })
1164
+ ] });
1165
+ };
1015
1166
  export {
1016
1167
  AuthorCard as A,
1017
1168
  BonusCard as B,
@@ -1022,19 +1173,21 @@ export {
1022
1173
  Layout as L,
1023
1174
  NotFound as N,
1024
1175
  ProsCons as P,
1025
- RichTextRenderer as R,
1026
1176
  Seo as S,
1027
1177
  Table as T,
1028
- FeatureCard as a,
1029
- Features as b,
1030
- GameDemo as c,
1031
- GameInfo as d,
1032
- List as e,
1033
- Tabs as f,
1034
- Tip as g,
1035
- Author as h,
1036
- Center as i,
1037
- Grid as j,
1038
- LinkButton as k,
1039
- PulseButton as l
1178
+ BonusCardGrid as a,
1179
+ FeatureCard as b,
1180
+ FeatureCardGrid as c,
1181
+ GameCardGrid as d,
1182
+ GameDemo as e,
1183
+ GameInfo as f,
1184
+ List as g,
1185
+ StrapiContentRenderer as h,
1186
+ Tabs as i,
1187
+ Tip as j,
1188
+ Author as k,
1189
+ Center as l,
1190
+ Grid as m,
1191
+ LinkButton as n,
1192
+ PulseButton as o
1040
1193
  };
package/dist/index.cjs CHANGED
@@ -1,22 +1,24 @@
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
  const index$1 = require("./index-IpSV-c71.js");
5
5
  const i18n$1 = require("./index-Biz1dDqA.js");
6
6
  const index$2 = require("./index-d3V0A4lN.js");
7
7
  const index$3 = require("./index-BhsXlbd8.js");
8
- const index$4 = require("./index-Cte2-g6s.js");
8
+ const index$4 = require("./index-Bw7vqsyw.js");
9
9
  const index$5 = require("./index-NsIHOkeN.js");
10
10
  const i18n = require("i18next");
11
11
  exports.Author = index.Author;
12
12
  exports.AuthorCard = index.AuthorCard;
13
13
  exports.BonusCard = index.BonusCard;
14
+ exports.BonusCardGrid = index.BonusCardGrid;
14
15
  exports.Center = index.Center;
15
16
  exports.ContactForm = index.ContactForm;
16
17
  exports.Faq = index.Faq;
17
18
  exports.FeatureCard = index.FeatureCard;
18
- exports.Features = index.Features;
19
+ exports.FeatureCardGrid = index.FeatureCardGrid;
19
20
  exports.GameCard = index.GameCard;
21
+ exports.GameCardGrid = index.GameCardGrid;
20
22
  exports.GameDemo = index.GameDemo;
21
23
  exports.GameInfo = index.GameInfo;
22
24
  exports.Grid = index.Grid;
@@ -27,8 +29,8 @@ exports.List = index.List;
27
29
  exports.NotFound = index.NotFound;
28
30
  exports.ProsCons = index.ProsCons;
29
31
  exports.PulseButton = index.PulseButton;
30
- exports.RichTextRenderer = index.RichTextRenderer;
31
32
  exports.Seo = index.Seo;
33
+ exports.StrapiContentRenderer = index.StrapiContentRenderer;
32
34
  exports.Table = index.Table;
33
35
  exports.Tabs = index.Tabs;
34
36
  exports.Tip = index.Tip;
@@ -45,7 +47,9 @@ exports.formatNumber = index$4.formatNumber;
45
47
  exports.getCurrencySymbol = index$4.getCurrencySymbol;
46
48
  exports.getCurrentMonth = index$4.getCurrentMonth;
47
49
  exports.getCurrentYear = index$4.getCurrentYear;
50
+ exports.getSeedRandomComparator = index$4.getSeedRandomComparator;
48
51
  exports.parseNumber = index$4.parseNumber;
52
+ exports.randomComparator = index$4.randomComparator;
49
53
  exports.round = index$4.round;
50
54
  exports.toFixedTwo = index$4.toFixedTwo;
51
55
  exports.extractTheme = index$5.extractTheme;
package/dist/index.mjs CHANGED
@@ -1,50 +1,54 @@
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
  import { u } from "./index-xuSxvz5z.mjs";
3
3
  import { a as a2, G as G2, r } from "./index-DoBCANwf.mjs";
4
4
  import { M } from "./index-Bx3B21Dh.mjs";
5
5
  import { S as S2, u as u2 } from "./index-BNb-P8a6.mjs";
6
- import { A as A2, f as f2, b as b2, c as c2, a as a3, g as g2, p, r as r2, t } from "./index-25M8hPOF.mjs";
7
- import { e as e2, g as g3, t as t2 } from "./index-DzEvPZny.mjs";
6
+ import { A as A2, f as f2, b as b2, c as c2, a as a3, g as g2, e as e2, p, d as d2, r as r2, t } from "./index-DLy2LYCD.mjs";
7
+ import { e as e3, g as g3, t as t2 } from "./index-DzEvPZny.mjs";
8
8
  import { default as default2 } from "i18next";
9
9
  export {
10
10
  A2 as Animation,
11
- h as Author,
11
+ k as Author,
12
12
  A as AuthorCard,
13
13
  B as BonusCard,
14
- i as Center,
14
+ a as BonusCardGrid,
15
+ l as Center,
15
16
  C as ContactForm,
16
17
  F as Faq,
17
- a as FeatureCard,
18
- b as Features,
18
+ b as FeatureCard,
19
+ c as FeatureCardGrid,
19
20
  G as GameCard,
21
+ d as GameCardGrid,
20
22
  a2 as GameCharacteristic,
21
- c as GameDemo,
22
- d as GameInfo,
23
+ e as GameDemo,
24
+ f as GameInfo,
23
25
  G2 as GameVolatility,
24
- j as Grid,
26
+ m as Grid,
25
27
  H as HowTo,
26
28
  L as Layout,
27
- k as LinkButton,
28
- e as List,
29
+ n as LinkButton,
30
+ g as List,
29
31
  M as MdxProvider,
30
32
  N as NotFound,
31
33
  P as ProsCons,
32
- l as PulseButton,
33
- R as RichTextRenderer,
34
+ o as PulseButton,
34
35
  S as Seo,
35
36
  S2 as SiteProvider,
37
+ h as StrapiContentRenderer,
36
38
  T as Table,
37
- f as Tabs,
38
- g as Tip,
39
- e2 as extractTheme,
39
+ i as Tabs,
40
+ j as Tip,
41
+ e3 as extractTheme,
40
42
  f2 as formatDate,
41
43
  b2 as formatNumber,
42
44
  g3 as generateColorPalette,
43
45
  c2 as getCurrencySymbol,
44
46
  a3 as getCurrentMonth,
45
47
  g2 as getCurrentYear,
48
+ e2 as getSeedRandomComparator,
46
49
  default2 as i18n,
47
50
  p as parseNumber,
51
+ d2 as randomComparator,
48
52
  r as resources,
49
53
  r2 as round,
50
54
  t as toFixedTwo,
@@ -1,8 +1,9 @@
1
1
  import { Key, ReactElement } from 'react';
2
- import { BoxProps } from '@chakra-ui/react';
2
+ import { BoxProps, ColorProps } from '@chakra-ui/react';
3
3
  export type KeyGetter<T> = (item: T) => Key;
4
4
  export type RenderFunction<T> = (item: T) => ReactElement;
5
5
  type BoxPaddingProps = Pick<BoxProps, 'p' | 'pt' | 'pr' | 'pb' | 'pl' | 'px' | 'py' | 'ps' | 'pe'>;
6
6
  type BoxMarginProps = Pick<BoxProps, 'm' | 'mt' | 'mr' | 'mb' | 'ml' | 'mx' | 'my' | 'ms' | 'me'>;
7
7
  export type BoxPositionProps = BoxMarginProps & BoxPaddingProps;
8
+ export type Color = ColorProps['color'];
8
9
  export {};
@@ -0,0 +1,14 @@
1
+ import { FC } from 'react';
2
+ import { GatsbyImageProps, IGatsbyImageData } from 'gatsby-plugin-image';
3
+ export { type IGatsbyImageData };
4
+ export interface IGatsbyImageFile {
5
+ localFile?: {
6
+ childImageSharp?: {
7
+ gatsbyImageData?: unknown;
8
+ };
9
+ };
10
+ }
11
+ export type ExternalImageComponentProps<T> = Omit<GatsbyImageProps, 'image'> & {
12
+ image: T;
13
+ };
14
+ export type ExternalImageComponent = FC<ExternalImageComponentProps<IGatsbyImageData>>;
@@ -4,3 +4,4 @@ export interface IGameCard extends IGame {
4
4
  link?: ILink['url'];
5
5
  image?: string | ReactElement;
6
6
  }
7
+ export type GameCardHeight = 'full' | 'auto';
@@ -0,0 +1,3 @@
1
+ import { ResponsiveObject } from '@chakra-ui/react';
2
+ export type GridColumns = ResponsiveObject<number>;
3
+ export type GridGap = ResponsiveObject<number> | number;
@@ -1,10 +1,13 @@
1
1
  export * from './bonus-card';
2
2
  export * from './common';
3
+ export * from './external-image';
3
4
  export * from './faq';
4
5
  export * from './game-card';
5
6
  export * from './game-info';
7
+ export * from './grid';
6
8
  export * from './how-to';
7
9
  export * from './image';
8
10
  export * from './navigation';
9
11
  export * from './pros-cons';
12
+ export * from './strapi-component';
10
13
  export * from './tabs';
@@ -0,0 +1,5 @@
1
+ export type StrapiComponentType = 'STRAPI__COMPONENT_CONTENT_FAQ' | 'STRAPI__COMPONENT_CONTENT_FEATURES' | 'STRAPI__COMPONENT_CONTENT_GAME_DEMO' | 'STRAPI__COMPONENT_CONTENT_GAME_INFO' | 'STRAPI__COMPONENT_CONTENT_HOW_TO' | 'STRAPI__COMPONENT_CONTENT_LIST' | 'STRAPI__COMPONENT_CONTENT_MEDIA' | 'STRAPI__COMPONENT_CONTENT_PROS_CONS' | 'STRAPI__COMPONENT_CONTENT_RICH_TEXT' | 'STRAPI__COMPONENT_CONTENT_TABLE' | 'STRAPI__COMPONENT_CONTENT_TIP';
2
+ export interface IStrapiComponentFragment {
3
+ __typename: StrapiComponentType;
4
+ [prop: string]: unknown;
5
+ }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const index = require("../index-Cte2-g6s.js");
3
+ const index = require("../index-Bw7vqsyw.js");
4
4
  const index$1 = require("../index-NsIHOkeN.js");
5
5
  exports.Animation = index.Animation;
6
6
  exports.formatDate = index.formatDate;
@@ -8,7 +8,9 @@ exports.formatNumber = index.formatNumber;
8
8
  exports.getCurrencySymbol = index.getCurrencySymbol;
9
9
  exports.getCurrentMonth = index.getCurrentMonth;
10
10
  exports.getCurrentYear = index.getCurrentYear;
11
+ exports.getSeedRandomComparator = index.getSeedRandomComparator;
11
12
  exports.parseNumber = index.parseNumber;
13
+ exports.randomComparator = index.randomComparator;
12
14
  exports.round = index.round;
13
15
  exports.toFixedTwo = index.toFixedTwo;
14
16
  exports.extractTheme = index$1.extractTheme;
@@ -2,4 +2,5 @@ export * from './animation';
2
2
  export * from './date';
3
3
  export * from './navigation';
4
4
  export * from './numbers';
5
+ export * from './sorting';
5
6
  export * from './theme';
@@ -1,15 +1,17 @@
1
- import { A, f, b, c, a, g, p, r, t } from "../index-25M8hPOF.mjs";
2
- import { e, g as g2, t as t2 } from "../index-DzEvPZny.mjs";
1
+ import { A, f, b, c, a, g, e, p, d, r, t } from "../index-DLy2LYCD.mjs";
2
+ import { e as e2, g as g2, t as t2 } from "../index-DzEvPZny.mjs";
3
3
  export {
4
4
  A as Animation,
5
- e as extractTheme,
5
+ e2 as extractTheme,
6
6
  f as formatDate,
7
7
  b as formatNumber,
8
8
  g2 as generateColorPalette,
9
9
  c as getCurrencySymbol,
10
10
  a as getCurrentMonth,
11
11
  g as getCurrentYear,
12
+ e as getSeedRandomComparator,
12
13
  p as parseNumber,
14
+ d as randomComparator,
13
15
  r as round,
14
16
  t as toFixedTwo,
15
17
  t2 as transformSiteNavigation
@@ -0,0 +1,2 @@
1
+ export declare function randomComparator(): number;
2
+ export declare function getSeedRandomComparator(seed: number): () => number;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@anywayseo/tools",
3
3
  "description": "Shared UI Components and Modules",
4
- "version": "3.1.2",
4
+ "version": "4.0.0",
5
5
  "keywords": [
6
6
  "react",
7
7
  "ui",
@@ -97,6 +97,7 @@
97
97
  "@mdx-js/react": "^2.0.0",
98
98
  "framer-motion": "^12.0.6",
99
99
  "gatsby": "^5.0.0",
100
+ "gatsby-plugin-image": "^3.14.0",
100
101
  "i18next": "^24.0.0",
101
102
  "react": "^18.3.1",
102
103
  "react-dom": "^18.3.1",
@@ -1,3 +0,0 @@
1
- import { ResponsiveObject } from '@chakra-ui/react';
2
- export type ColumnsConfig = ResponsiveObject<number>;
3
- export type SpacingConfig = ResponsiveObject<number> | number;
@@ -1,7 +0,0 @@
1
- import { FC } from 'react';
2
- import { BoxPositionProps, IFeature } from '../../types';
3
- type FeaturesProps = {
4
- features: IFeature[];
5
- } & BoxPositionProps;
6
- declare const Features: FC<FeaturesProps>;
7
- export default Features;
@@ -1,6 +0,0 @@
1
- import { FC } from 'react';
2
- type RichTextRendererProps = {
3
- content: string;
4
- };
5
- declare const RichTextRenderer: FC<RichTextRendererProps>;
6
- export default RichTextRenderer;