@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
@@ -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,18 +1,18 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const index = require("../index-Cte2-g6s.js");
4
- const index$1 = require("../index-D2JqGE4u.js");
3
+ const index = require("../index-Bw7vqsyw.js");
4
+ const index$1 = require("../index-NsIHOkeN.js");
5
5
  exports.Animation = index.Animation;
6
6
  exports.formatDate = index.formatDate;
7
7
  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;
15
17
  exports.generateColorPalette = index$1.generateColorPalette;
16
- exports.getValidSource = index$1.getValidSource;
17
18
  exports.transformSiteNavigation = index$1.transformSiteNavigation;
18
- exports.typeDefs = index$1.typeDefs;
@@ -1,7 +1,6 @@
1
1
  export * from './animation';
2
- export * from './api';
3
2
  export * from './date';
4
- export * from './gatsby';
5
3
  export * from './navigation';
6
4
  export * from './numbers';
5
+ export * from './sorting';
7
6
  export * from './theme';
@@ -1,18 +1,18 @@
1
- import { A, f, b, c, a, g, p, r, t } from "../index-25M8hPOF.mjs";
2
- import { e, b as b2, g as g2, a as a2, t as t2 } from "../index-CHnNtadm.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
- b2 as generateColorPalette,
8
+ g2 as generateColorPalette,
9
9
  c as getCurrencySymbol,
10
10
  a as getCurrentMonth,
11
11
  g as getCurrentYear,
12
- g2 as getValidSource,
12
+ e as getSeedRandomComparator,
13
13
  p as parseNumber,
14
+ d as randomComparator,
14
15
  r as round,
15
16
  t as toFixedTwo,
16
- a2 as transformSiteNavigation,
17
- t2 as typeDefs
17
+ t2 as transformSiteNavigation
18
18
  };
@@ -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.1",
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;
@@ -1,294 +0,0 @@
1
- import { TinyColor } from "@ctrl/tinycolor";
2
- const typeDefs = `
3
- # === BASE DEFINITIONS ===
4
- type Image {
5
- localFile: File @link(from: "localFile")
6
- alternativeText: String
7
- }
8
-
9
- type Seo {
10
- metaTitle: String
11
- metaDescription: String
12
- }
13
-
14
- type Author {
15
- name: String
16
- role: String
17
- bio: String
18
- avatar: Image
19
- }
20
-
21
- # === STRAPI DEFINITIONS ===
22
- type StrapiSite implements Node {
23
- id: ID!
24
- name: String
25
- lang: String
26
- currency: String
27
- theme: String
28
- primaryColor: String
29
- logo: Image
30
- seo: Seo
31
- }
32
-
33
- type StrapiPage implements Node {
34
- id: ID!
35
- title: String
36
- slug: String
37
- seo: Seo
38
- author: Author
39
- content: [ContentComponent]
40
- createdAt: Date @dateformat
41
- updatedAt: Date @dateformat
42
- }
43
-
44
- # === STRAPI NAVIGATION DEFINITIONS ===
45
- type StrapiNavigation implements Node {
46
- id: ID!
47
- items: [NavigationGroup!]
48
- }
49
-
50
- type NavigationGroup {
51
- name: String!
52
- slug: String!
53
- items: [NavigationItem!]
54
- }
55
-
56
- type NavigationItem {
57
- type: String!
58
- title: String!
59
- slug: String!
60
- path: String!
61
- menuAttached: Boolean!
62
- items: [NavigationItem!]
63
- }
64
-
65
- # === COMPONENT DEFINITIONS ===
66
- union ContentComponent =
67
- STRAPI__COMPONENT_CONTENT_FAQ
68
- | STRAPI__COMPONENT_CONTENT_FEATURES
69
- | STRAPI__COMPONENT_CONTENT_GAME_DEMO
70
- | STRAPI__COMPONENT_CONTENT_GAME_INFO
71
- | STRAPI__COMPONENT_CONTENT_HOW_TO
72
- | STRAPI__COMPONENT_CONTENT_LIST
73
- | STRAPI__COMPONENT_CONTENT_MEDIA
74
- | STRAPI__COMPONENT_CONTENT_PROS_CONS
75
- | STRAPI__COMPONENT_CONTENT_RICH_TEXT
76
- | STRAPI__COMPONENT_CONTENT_TABLE
77
- | STRAPI__COMPONENT_CONTENT_TIP
78
-
79
- type STRAPI__COMPONENT_CONTENT_FAQ {
80
- items: [FaqItem!]
81
- }
82
-
83
- type FaqItem {
84
- question: String
85
- answer: String
86
- }
87
-
88
- type STRAPI__COMPONENT_CONTENT_FEATURES {
89
- items: [ListItem!]
90
- }
91
-
92
- type STRAPI__COMPONENT_CONTENT_PROS_CONS {
93
- pros: [ListItem!]
94
- cons: [ListItem!]
95
- }
96
-
97
- type ListItem {
98
- title: String
99
- description: String
100
- }
101
-
102
- type STRAPI__COMPONENT_CONTENT_GAME_DEMO {
103
- name: String
104
- src: String
105
- previewImage: Image
106
- }
107
-
108
- type STRAPI__COMPONENT_CONTENT_GAME_INFO {
109
- general: GAME_GENERAL
110
- features: GAME_FEATURES
111
- }
112
-
113
- type GAME_GENERAL {
114
- NAME: String
115
- DEVELOPER: String
116
- RELEASE_DATE: Date @dateformat
117
- THEME: String
118
- TYPE: String
119
- VOLATILITY: String
120
- RTP: String
121
- PAY_LINES: String
122
- ROWS_WITH_PINS: String
123
- REELS_NUMBER: String
124
- MIN_BET: String
125
- MAX_BET: String
126
- MAX_WIN: String
127
- COMPATIBILITY: String
128
- }
129
-
130
- type GAME_FEATURES {
131
- HAS_DEMO: Boolean
132
- HAS_AUTOPLAY: Boolean
133
- HAS_FREE_SPINS: Boolean
134
- HAS_FAST_SPIN: Boolean
135
- HAS_BONUS_PURCHASE: Boolean
136
- HAS_COLLECTION_SYMBOLS: Boolean
137
- HAS_PROGRESSIVE_JACKPOT: Boolean
138
- BONUS_FEATURES: String
139
- FUNCTIONS: String
140
- LANGUAGES: String
141
- }
142
-
143
- type STRAPI__COMPONENT_CONTENT_HOW_TO {
144
- steps: [HowToStep!]
145
- }
146
-
147
- type HowToStep {
148
- title: String!
149
- description: String
150
- thumbnail: Image
151
- }
152
-
153
- type STRAPI__COMPONENT_CONTENT_TIP {
154
- tip: String
155
- author: Author
156
- }
157
-
158
- type STRAPI__COMPONENT_CONTENT_RICH_TEXT {
159
- content: RichTextContent
160
- }
161
-
162
- type RichTextContent {
163
- data: RichTextData
164
- }
165
-
166
- type RichTextData {
167
- content: String
168
- }
169
-
170
- type STRAPI__COMPONENT_CONTENT_LIST {
171
- bullet: String
172
- content: JsonValue
173
- }
174
-
175
- type STRAPI__COMPONENT_CONTENT_MEDIA {
176
- file: Image
177
- }
178
-
179
- type STRAPI__COMPONENT_CONTENT_TABLE {
180
- columnNumber: Int
181
- striped: Boolean
182
- bordered: Boolean
183
- scrollable: Boolean
184
- content: JsonValue
185
- caption: String
186
- }
187
-
188
- type JsonValue {
189
- strapi_json_value: JSON
190
- }
191
- `;
192
- function isValidSource(value) {
193
- if (!value) {
194
- return false;
195
- }
196
- const validSources = ["local", "remote"];
197
- return validSources.includes(value);
198
- }
199
- function getValidSource(source) {
200
- console.info("Selected source mode is:", source);
201
- if (isValidSource(source)) {
202
- return source;
203
- }
204
- console.warn('Invalid or missing GATSBY_SITE_SOURCE. Defaulting to "local".');
205
- return "local";
206
- }
207
- const DUMMY_PAGE_TYPE = "DUMMY";
208
- function isValidPath(value) {
209
- return typeof value === "string" && (value === "" || value.startsWith("/"));
210
- }
211
- function isValidType(value) {
212
- return typeof value === "string" && value !== DUMMY_PAGE_TYPE;
213
- }
214
- function transformNavItems(items, parentPath = "") {
215
- if (!items || !items.length) {
216
- return [];
217
- }
218
- const transformed = [];
219
- items.forEach((item) => {
220
- var _a;
221
- if (item && item.title && isValidType(item.type) && isValidPath(item.path)) {
222
- let path = `${parentPath}${item.path}`;
223
- let children = [];
224
- if ((_a = item.items) == null ? void 0 : _a.length) {
225
- path = "";
226
- children = transformNavItems(item.items, path);
227
- }
228
- transformed.push({ label: item.title, path, children });
229
- }
230
- });
231
- return transformed;
232
- }
233
- function transformSiteNavigation(strapiNavigation) {
234
- if (!strapiNavigation) {
235
- return null;
236
- }
237
- const navGroups = strapiNavigation.items;
238
- const headerNav = navGroups == null ? void 0 : navGroups.find((item) => (item == null ? void 0 : item.slug) === "header-navigation");
239
- const footerNav = navGroups == null ? void 0 : navGroups.find((item) => (item == null ? void 0 : item.slug) === "footer-navigation");
240
- return {
241
- header: transformNavItems(headerNav == null ? void 0 : headerNav.items),
242
- footer: transformNavItems(footerNav == null ? void 0 : footerNav.items)
243
- };
244
- }
245
- const DEFAULT_THEME = "system";
246
- const DEFAULT_COLOR = "#333333";
247
- const DefaultColorShadeMap = {
248
- 50: 52,
249
- 100: 40,
250
- 200: 30,
251
- 300: 20,
252
- 400: 10,
253
- 600: 10,
254
- 700: 20,
255
- 800: 30,
256
- 900: 40
257
- };
258
- function extractTheme(value, defaultTheme = DEFAULT_THEME) {
259
- let theme = defaultTheme;
260
- if (value) {
261
- const themes = ["dark", "light", "system"];
262
- const probablyTheme = value;
263
- if (themes.includes(probablyTheme)) {
264
- theme = probablyTheme;
265
- }
266
- }
267
- return theme;
268
- }
269
- function generateColorPalette(value, defaultColor = DEFAULT_COLOR, colorShadeMap = DefaultColorShadeMap) {
270
- let baseColor = defaultColor;
271
- if (value && typeof value === "string") {
272
- baseColor = value;
273
- }
274
- const color = new TinyColor(baseColor);
275
- return {
276
- 50: color.lighten(colorShadeMap[50]).toHexString(),
277
- 100: color.lighten(colorShadeMap[100]).toHexString(),
278
- 200: color.lighten(colorShadeMap[200]).toHexString(),
279
- 300: color.lighten(colorShadeMap[300]).toHexString(),
280
- 400: color.lighten(colorShadeMap[400]).toHexString(),
281
- 500: color.toHexString(),
282
- 600: color.darken(colorShadeMap[600]).toHexString(),
283
- 700: color.darken(colorShadeMap[700]).toHexString(),
284
- 800: color.darken(colorShadeMap[800]).toHexString(),
285
- 900: color.darken(colorShadeMap[900]).toHexString()
286
- };
287
- }
288
- export {
289
- transformSiteNavigation as a,
290
- generateColorPalette as b,
291
- extractTheme as e,
292
- getValidSource as g,
293
- typeDefs as t
294
- };