@anywayseo/tools 3.0.2 → 3.1.1

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