@anywayseo/tools 6.0.0 → 6.2.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 (81) hide show
  1. package/dist/components/index.cjs +3 -3
  2. package/dist/components/index.mjs +3 -3
  3. package/dist/components/seo/href-langs/index.d.ts +2 -2
  4. package/dist/components/seo/index.d.ts +2 -8
  5. package/dist/components/seo/open-graph/index.d.ts +8 -0
  6. package/dist/components/seo/utils.d.ts +2 -2
  7. package/dist/hooks/index.cjs +1 -1
  8. package/dist/hooks/index.mjs +1 -1
  9. package/dist/i18n/index.cjs +24 -12
  10. package/dist/i18n/index.mjs +24 -12
  11. package/dist/i18n/resources/bn/index.d.ts +331 -0
  12. package/dist/i18n/resources/cs/index.d.ts +331 -0
  13. package/dist/i18n/resources/el/index.d.ts +331 -0
  14. package/dist/i18n/resources/hu/index.d.ts +331 -0
  15. package/dist/i18n/resources/nb/index.d.ts +331 -0
  16. package/dist/i18n/resources/nl/index.d.ts +331 -0
  17. package/dist/i18n/resources/pl/index.d.ts +331 -0
  18. package/dist/i18n/resources/ro/index.d.ts +331 -0
  19. package/dist/i18n/resources/sr/index.d.ts +331 -0
  20. package/dist/i18n/resources/sv/index.d.ts +331 -0
  21. package/dist/i18n/resources/tr/index.d.ts +331 -0
  22. package/dist/i18n/resources/uz/index.d.ts +331 -0
  23. package/dist/{index-C7buhUOk.mjs → index-2sU4ya6z.mjs} +3 -3
  24. package/dist/{index-CUDzMwnz.mjs → index-B--qmL1V.mjs} +29 -20
  25. package/dist/{index-U-DmPFa7.mjs → index-B5WurBlm.mjs} +1 -1
  26. package/dist/{index-DJSBjQzq.js → index-BAxlqkw0.js} +2 -2
  27. package/dist/{index-BJsA8Upb.js → index-BKWX6mIo.js} +29 -20
  28. package/dist/{index-C1kr7Vd-.mjs → index-BS5T9Il4.mjs} +1 -1
  29. package/dist/{index-0AAkKSsc.mjs → index-BTfTkIed.mjs} +63 -9
  30. package/dist/{index-BhzKUTPZ.mjs → index-BtS01kyg.mjs} +45 -33
  31. package/dist/{index-RzByAgHO.mjs → index-C6A-3gBz.mjs} +4577 -432
  32. package/dist/{index-CBRFCYhV.js → index-CMLDQbgR.js} +4577 -432
  33. package/dist/{index-CVv755RW.js → index-CuIVcnIS.js} +1 -1
  34. package/dist/{index-BSAasfl2.js → index-CxuOu0E2.js} +3 -3
  35. package/dist/{index-DZc8PJET.js → index-DAPaiozu.js} +1 -1
  36. package/dist/{index-BU1gLt1p.js → index-DHKoOk4o.js} +54 -0
  37. package/dist/{index-B5SWTYZm.js → index-ISfgFSXE.js} +45 -33
  38. package/dist/{index-B5C9u9UE.mjs → index-TcBorTSf.mjs} +2 -2
  39. package/dist/index.cjs +11 -9
  40. package/dist/index.mjs +20 -18
  41. package/dist/layout/header/locale-switcher/icons/bangladesh/index.d.ts +2 -0
  42. package/dist/layout/header/locale-switcher/icons/belgium/index.d.ts +2 -0
  43. package/dist/layout/header/locale-switcher/icons/canada/index.d.ts +2 -0
  44. package/dist/layout/header/locale-switcher/icons/czechia/index.d.ts +2 -0
  45. package/dist/layout/header/locale-switcher/icons/greece/index.d.ts +2 -0
  46. package/dist/layout/header/locale-switcher/icons/hungary/index.d.ts +2 -0
  47. package/dist/layout/header/locale-switcher/icons/index.d.ts +20 -1
  48. package/dist/layout/header/locale-switcher/icons/india/index.d.ts +2 -0
  49. package/dist/layout/header/locale-switcher/icons/morocco/index.d.ts +2 -0
  50. package/dist/layout/header/locale-switcher/icons/netherlands/index.d.ts +2 -0
  51. package/dist/layout/header/locale-switcher/icons/nigeria/index.d.ts +2 -0
  52. package/dist/layout/header/locale-switcher/icons/norway/index.d.ts +2 -0
  53. package/dist/layout/header/locale-switcher/icons/poland/index.d.ts +2 -0
  54. package/dist/layout/header/locale-switcher/icons/romania/index.d.ts +2 -0
  55. package/dist/layout/header/locale-switcher/icons/serbia/index.d.ts +2 -0
  56. package/dist/layout/header/locale-switcher/icons/south-africa/index.d.ts +2 -0
  57. package/dist/layout/header/locale-switcher/icons/sweden/index.d.ts +2 -0
  58. package/dist/layout/header/locale-switcher/icons/switzerland/index.d.ts +2 -0
  59. package/dist/layout/header/locale-switcher/icons/turkey/index.d.ts +2 -0
  60. package/dist/layout/header/locale-switcher/icons/uzbekistan/index.d.ts +2 -0
  61. package/dist/layout/index.cjs +392 -48
  62. package/dist/layout/index.mjs +392 -48
  63. package/dist/providers/index.cjs +2 -2
  64. package/dist/providers/index.mjs +2 -2
  65. package/dist/types/api/strapi-page.d.ts +13 -12
  66. package/dist/types/content/seo/index.d.ts +56 -3
  67. package/dist/types/i18n/index.d.ts +1 -1
  68. package/dist/types/index.d.ts +1 -1
  69. package/dist/types/seo/index.d.ts +2 -0
  70. package/dist/types/seo/open-graph/index.d.ts +11 -0
  71. package/dist/utils/api/strapi-guards.d.ts +2 -1
  72. package/dist/utils/api/strapi-seo.d.ts +2 -13
  73. package/dist/utils/index.cjs +5 -3
  74. package/dist/utils/index.d.ts +1 -1
  75. package/dist/utils/index.mjs +14 -12
  76. package/dist/utils/seo/index.d.ts +2 -0
  77. package/dist/utils/{json-ld → seo/json-ld}/index.d.ts +1 -1
  78. package/dist/utils/seo/open-graph/index.d.ts +15 -0
  79. package/package.json +1 -1
  80. package/dist/components/seo/types.d.ts +0 -14
  81. /package/dist/types/{json-ld → seo/json-ld}/index.d.ts +0 -0
@@ -0,0 +1,331 @@
1
+ declare const dictionary: {
2
+ readonly pageNotFound: {
3
+ seo: {
4
+ title: string;
5
+ };
6
+ title: string;
7
+ description: string;
8
+ action: string;
9
+ };
10
+ readonly pageContacts: {
11
+ title: string;
12
+ text: string;
13
+ };
14
+ readonly pagePrivacyPolicy: {
15
+ title: string;
16
+ text: string;
17
+ sectionOne: {
18
+ title: string;
19
+ text: string;
20
+ };
21
+ sectionTwo: {
22
+ title: string;
23
+ textOne: string;
24
+ list: {
25
+ itemOne: string;
26
+ itemTwo: string;
27
+ };
28
+ textTwo: string;
29
+ };
30
+ sectionThree: {
31
+ title: string;
32
+ text: string;
33
+ };
34
+ sectionFour: {
35
+ title: string;
36
+ text: string;
37
+ };
38
+ sectionFive: {
39
+ title: string;
40
+ text: string;
41
+ };
42
+ sectionSix: {
43
+ title: string;
44
+ text: string;
45
+ textWithLink: {
46
+ contentStart: string;
47
+ link: string;
48
+ contentEnd: string;
49
+ };
50
+ };
51
+ };
52
+ readonly pageCookiePolicy: {
53
+ title: string;
54
+ text: string;
55
+ sectionOne: {
56
+ title: string;
57
+ textOne: string;
58
+ textTwo: string;
59
+ };
60
+ sectionTwo: {
61
+ title: string;
62
+ textOne: string;
63
+ list: {
64
+ itemOne: string;
65
+ itemTwo: string;
66
+ itemThree: string;
67
+ };
68
+ textTwo: string;
69
+ };
70
+ sectionThree: {
71
+ title: string;
72
+ list: {
73
+ itemOne: string;
74
+ itemTwo: string;
75
+ itemThree: string;
76
+ itemFour: string;
77
+ };
78
+ text: string;
79
+ };
80
+ };
81
+ readonly pageTermsAndConditions: {
82
+ title: string;
83
+ text: string;
84
+ sectionOne: {
85
+ title: string;
86
+ text: string;
87
+ list: {
88
+ itemOne: {
89
+ title: string;
90
+ description: string;
91
+ };
92
+ itemTwo: {
93
+ title: string;
94
+ description: string;
95
+ };
96
+ itemThree: {
97
+ title: string;
98
+ description: string;
99
+ };
100
+ itemFour: {
101
+ title: string;
102
+ description: string;
103
+ };
104
+ };
105
+ };
106
+ sectionTwo: {
107
+ title: string;
108
+ list: {
109
+ itemOne: {
110
+ title: string;
111
+ description: string;
112
+ };
113
+ itemTwo: {
114
+ title: string;
115
+ description: string;
116
+ };
117
+ itemThree: {
118
+ title: string;
119
+ description: string;
120
+ };
121
+ itemFour: {
122
+ title: string;
123
+ description: string;
124
+ };
125
+ };
126
+ };
127
+ sectionThree: {
128
+ title: string;
129
+ text: string;
130
+ };
131
+ sectionFour: {
132
+ title: string;
133
+ text: string;
134
+ list: {
135
+ itemOne: {
136
+ title: string;
137
+ description: string;
138
+ };
139
+ itemTwo: {
140
+ title: string;
141
+ description: string;
142
+ };
143
+ };
144
+ };
145
+ sectionFive: {
146
+ title: string;
147
+ text: string;
148
+ };
149
+ sectionSix: {
150
+ title: string;
151
+ textOne: string;
152
+ list: {
153
+ itemOne: string;
154
+ itemTwo: string;
155
+ itemThree: string;
156
+ };
157
+ textTwo: string;
158
+ textTwoWithLink: {
159
+ contentStart: string;
160
+ link: string;
161
+ contentEnd: string;
162
+ };
163
+ };
164
+ sectionSeven: {
165
+ title: string;
166
+ list: {
167
+ itemOne: {
168
+ title: string;
169
+ description: string;
170
+ };
171
+ itemTwo: {
172
+ title: string;
173
+ description: string;
174
+ };
175
+ };
176
+ };
177
+ };
178
+ readonly footer: {
179
+ copyright: string;
180
+ disclaimer: {
181
+ title: string;
182
+ description: string;
183
+ };
184
+ };
185
+ readonly article: {
186
+ meta: {
187
+ author: string;
188
+ publicationDate: string;
189
+ readingTime: {
190
+ label: string;
191
+ count_one: string;
192
+ count_few: string;
193
+ count_many: string;
194
+ count_other: string;
195
+ };
196
+ };
197
+ };
198
+ readonly casinoInfo: {
199
+ feature: {
200
+ RTP: string;
201
+ GAMES_COUNT: string;
202
+ MIN_DEPOSIT: string;
203
+ PAYOUT_SPEED: string;
204
+ };
205
+ };
206
+ readonly casinoTable: {
207
+ column: {
208
+ ID: string;
209
+ LOGO: string;
210
+ NAME: string;
211
+ LICENSE: string;
212
+ BONUS: string;
213
+ INFO: string;
214
+ ACTIONS: string;
215
+ };
216
+ row: {
217
+ logo: {
218
+ bestChoiceBadge: string;
219
+ };
220
+ actions: {
221
+ getBonus: string;
222
+ readReview: string;
223
+ };
224
+ };
225
+ };
226
+ readonly copyText: {
227
+ title: string;
228
+ };
229
+ readonly gameDemo: {
230
+ warning: string;
231
+ action: {
232
+ playForReal: string;
233
+ playForFree: string;
234
+ activateFullscreen: string;
235
+ deactivateFullscreen: string;
236
+ exit: string;
237
+ };
238
+ alert: {
239
+ title: string;
240
+ description: string;
241
+ };
242
+ };
243
+ readonly gameInfo: {
244
+ title: string;
245
+ group: {
246
+ general: string;
247
+ features: string;
248
+ };
249
+ feature: {
250
+ BONUS_FEATURES: string;
251
+ COMPATIBILITY: string;
252
+ FUNCTIONS: string;
253
+ DEVELOPER: string;
254
+ HAS_AUTOPLAY: string;
255
+ HAS_BONUS_PURCHASE: string;
256
+ HAS_COLLECTION_SYMBOLS: string;
257
+ HAS_DEMO: string;
258
+ HAS_FAST_SPIN: string;
259
+ HAS_FREE_SPINS: string;
260
+ HAS_PROGRESSIVE_JACKPOT: string;
261
+ LANGUAGES: string;
262
+ MAX_WIN: string;
263
+ MAX_BET: string;
264
+ MIN_BET: string;
265
+ NAME: string;
266
+ PAY_LINES: string;
267
+ REELS_NUMBER: string;
268
+ RELEASE_DATE: string;
269
+ ROWS_WITH_PINS: string;
270
+ RTP: string;
271
+ THEME: string;
272
+ TYPE: string;
273
+ VOLATILITY: string;
274
+ };
275
+ value: {
276
+ boolean: {
277
+ true: string;
278
+ false: string;
279
+ };
280
+ volatility: {
281
+ HIGH: string;
282
+ MEDIUM: string;
283
+ LOW: string;
284
+ };
285
+ };
286
+ };
287
+ readonly prosCons: {
288
+ advantages: string;
289
+ disadvantages: string;
290
+ };
291
+ readonly author: {
292
+ title: string;
293
+ action: {
294
+ expand: string;
295
+ collapse: string;
296
+ };
297
+ };
298
+ readonly contactForm: {
299
+ field: {
300
+ name: {
301
+ label: string;
302
+ placeholder: string;
303
+ };
304
+ email: {
305
+ label: string;
306
+ placeholder: string;
307
+ };
308
+ message: {
309
+ label: string;
310
+ placeholder: string;
311
+ };
312
+ };
313
+ notification: {
314
+ title: string;
315
+ description: string;
316
+ };
317
+ action: {
318
+ send: string;
319
+ };
320
+ };
321
+ readonly bonusCard: {
322
+ action: {
323
+ expand: string;
324
+ collapse: string;
325
+ };
326
+ };
327
+ readonly informer: {
328
+ [x: string]: string;
329
+ };
330
+ };
331
+ export default dictionary;
@@ -1,14 +1,14 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import { Flex, Container as Container$1, useColorModeValue, useToast, useClipboard, Text, IconButton, Button, Box, Stack, Card, Badge, Td, Tr, Table, Thead, Th, Tbody } from "@chakra-ui/react";
3
- import { L as Link, a as useSiteContext, I as Image, u as usePageContext } from "./index-U-DmPFa7.mjs";
3
+ import { L as Link, a as useSiteContext, I as Image, u as usePageContext } from "./index-B5WurBlm.mjs";
4
4
  import "@mdx-js/react";
5
5
  import { useTranslation } from "react-i18next";
6
6
  import { A as Animation } from "./index-BJRvnR8Q.mjs";
7
- import { a as CasinoCharacteristic, C as CasinoTableColumn } from "./index-RzByAgHO.mjs";
7
+ import { a as CasinoCharacteristic, C as CasinoTableColumn } from "./index-C6A-3gBz.mjs";
8
8
  import { CheckIcon, CopyIcon, StarIcon } from "@chakra-ui/icons";
9
9
  import "react";
10
10
  import "react-medium-image-zoom";
11
- import { u as usePrimaryColors } from "./index-C1kr7Vd-.mjs";
11
+ import { u as usePrimaryColors } from "./index-BS5T9Il4.mjs";
12
12
  import { b as formatNumber } from "./index-BPthShL-.mjs";
13
13
  const FacebookIcon = (props) => {
14
14
  return /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", "aria-label": "Facebook", ...props, children: [
@@ -1,5 +1,5 @@
1
1
  import { i as isRelativePath } from "./index-CQC6DRGf.mjs";
2
- import { b as isStrapiPageContext, a as isStrapiPageData, i as isStrapiContent } from "./index-0AAkKSsc.mjs";
2
+ import { c as isStrapiPageContext, b as isStrapiPageData, i as isStrapiContent, a as isStrapiRichText } from "./index-BTfTkIed.mjs";
3
3
  const DUMMY_PAGE_TYPE = "DUMMY";
4
4
  const NavigationSlug = {
5
5
  HEADER: "header-navigation",
@@ -92,15 +92,20 @@ function extractGame(content) {
92
92
  return null;
93
93
  }
94
94
  function parseReviewHeading(content) {
95
- const firstComponent = content ? content[0] : null;
96
- const firstRichText = firstComponent && (firstComponent == null ? void 0 : firstComponent.__typename) === "STRAPI__COMPONENT_CONTENT_RICH_TEXT" ? firstComponent.content.data.content : null;
97
- if (firstRichText) {
98
- const [title, description] = firstRichText.split("\n");
99
- if (title.startsWith("#")) {
100
- return { title: title.slice(1).trim(), description: description.trim() };
95
+ try {
96
+ const firstComponent = content ? content[0] : null;
97
+ const firstRichText = isStrapiRichText(firstComponent) ? firstComponent.data.content : null;
98
+ if (!firstRichText) {
99
+ return null;
101
100
  }
101
+ const [firstText, secondText = ""] = firstRichText.split("\n");
102
+ return {
103
+ title: firstText.startsWith("#") ? firstText.slice(1).trim() : firstText.trim(),
104
+ description: secondText.trim()
105
+ };
106
+ } catch (_) {
107
+ return null;
102
108
  }
103
- return null;
104
109
  }
105
110
  function extractReview(content, seo, createdAt, updatedAt) {
106
111
  if (content) {
@@ -120,33 +125,33 @@ function extractReview(content, seo, createdAt, updatedAt) {
120
125
  }
121
126
  return null;
122
127
  }
123
- function extractSeoData(pageData, pageContext) {
124
- const result = {
125
- locale: null,
126
- meta: { title: null, description: null },
127
- canonicalUrl: null,
128
- hrefLangs: [],
129
- structuredData: null
130
- };
128
+ function buildSeoFromStrapi(pageData, pageContext) {
129
+ const result = {};
131
130
  if (isStrapiPageContext(pageContext)) {
132
- result.hrefLangs = pageContext.hrefLangs ?? [];
131
+ result.hrefLangs = pageContext.hrefLangs;
133
132
  }
134
133
  if (isStrapiPageData(pageData)) {
135
134
  const { locale, seo, canonicalUrl, author, content, createdAt, updatedAt } = pageData ?? {};
136
135
  const { metaTitle, metaDescription } = seo ?? {};
137
- result.locale = locale ?? null;
138
- result.canonicalUrl = canonicalUrl ?? null;
136
+ result.lang = locale;
137
+ result.canonicalUrl = canonicalUrl;
139
138
  result.meta = { title: metaTitle ?? null, description: metaDescription ?? null };
140
139
  const structuredDataContent = {};
140
+ const openGraphContent = {};
141
141
  if (isStrapiContent(content)) {
142
142
  const review = extractReview(content, seo ?? null, createdAt ?? null, updatedAt ?? null);
143
143
  const game = extractGame(content);
144
144
  if (review && game) {
145
145
  structuredDataContent.review = review;
146
146
  structuredDataContent.game = game;
147
+ openGraphContent.article = {
148
+ createdAt: review.publishedAt,
149
+ updatedAt: review.updatedAt || review.publishedAt
150
+ };
147
151
  const reviewAuthor = extractAuthor(author ?? null);
148
152
  if (reviewAuthor) {
149
153
  structuredDataContent.author = reviewAuthor;
154
+ openGraphContent.article.author = reviewAuthor.name;
150
155
  }
151
156
  }
152
157
  }
@@ -155,6 +160,10 @@ function extractSeoData(pageData, pageContext) {
155
160
  entity: "game-review",
156
161
  content: structuredDataContent
157
162
  } : null;
163
+ result.openGraph = openGraphContent ? {
164
+ options: { withTwitterCard: true },
165
+ content: openGraphContent
166
+ } : null;
158
167
  }
159
168
  return result;
160
169
  }
@@ -188,6 +197,6 @@ export {
188
197
  getLocale as a,
189
198
  getLocales as b,
190
199
  getNavigation as c,
191
- extractSeoData as e,
200
+ buildSeoFromStrapi as d,
192
201
  getSiteName as g
193
202
  };
@@ -6,7 +6,7 @@ import { Link as Link$2 } from "gatsby";
6
6
  import "@mdx-js/react";
7
7
  import "react-i18next";
8
8
  import "./index-BJRvnR8Q.mjs";
9
- import "./index-RzByAgHO.mjs";
9
+ import "./index-C6A-3gBz.mjs";
10
10
  import "@chakra-ui/icons";
11
11
  import { u as useLocalization } from "./index-DHURrUMW.mjs";
12
12
  import { c as isAbsolutePath, i as isRelativePath } from "./index-CQC6DRGf.mjs";
@@ -3,9 +3,9 @@ const jsxRuntime = require("react/jsx-runtime");
3
3
  const react = require("@mdx-js/react");
4
4
  require("react-i18next");
5
5
  require("@chakra-ui/react");
6
- const index$1 = require("./index-DZc8PJET.js");
6
+ const index$1 = require("./index-DAPaiozu.js");
7
7
  require("./index-C6MG_f24.js");
8
- require("./index-CBRFCYhV.js");
8
+ require("./index-CMLDQbgR.js");
9
9
  require("@chakra-ui/icons");
10
10
  require("react");
11
11
  const index = require("./index-DDg_PkD2.js");
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  const index = require("./index-CAjUjAgI.js");
3
- const index$1 = require("./index-BU1gLt1p.js");
3
+ const index$1 = require("./index-DHKoOk4o.js");
4
4
  const DUMMY_PAGE_TYPE = "DUMMY";
5
5
  const NavigationSlug = {
6
6
  HEADER: "header-navigation",
@@ -93,15 +93,20 @@ function extractGame(content) {
93
93
  return null;
94
94
  }
95
95
  function parseReviewHeading(content) {
96
- const firstComponent = content ? content[0] : null;
97
- const firstRichText = firstComponent && (firstComponent == null ? void 0 : firstComponent.__typename) === "STRAPI__COMPONENT_CONTENT_RICH_TEXT" ? firstComponent.content.data.content : null;
98
- if (firstRichText) {
99
- const [title, description] = firstRichText.split("\n");
100
- if (title.startsWith("#")) {
101
- return { title: title.slice(1).trim(), description: description.trim() };
96
+ try {
97
+ const firstComponent = content ? content[0] : null;
98
+ const firstRichText = index$1.isStrapiRichText(firstComponent) ? firstComponent.data.content : null;
99
+ if (!firstRichText) {
100
+ return null;
102
101
  }
102
+ const [firstText, secondText = ""] = firstRichText.split("\n");
103
+ return {
104
+ title: firstText.startsWith("#") ? firstText.slice(1).trim() : firstText.trim(),
105
+ description: secondText.trim()
106
+ };
107
+ } catch (_) {
108
+ return null;
103
109
  }
104
- return null;
105
110
  }
106
111
  function extractReview(content, seo, createdAt, updatedAt) {
107
112
  if (content) {
@@ -121,33 +126,33 @@ function extractReview(content, seo, createdAt, updatedAt) {
121
126
  }
122
127
  return null;
123
128
  }
124
- function extractSeoData(pageData, pageContext) {
125
- const result = {
126
- locale: null,
127
- meta: { title: null, description: null },
128
- canonicalUrl: null,
129
- hrefLangs: [],
130
- structuredData: null
131
- };
129
+ function buildSeoFromStrapi(pageData, pageContext) {
130
+ const result = {};
132
131
  if (index$1.isStrapiPageContext(pageContext)) {
133
- result.hrefLangs = pageContext.hrefLangs ?? [];
132
+ result.hrefLangs = pageContext.hrefLangs;
134
133
  }
135
134
  if (index$1.isStrapiPageData(pageData)) {
136
135
  const { locale, seo, canonicalUrl, author, content, createdAt, updatedAt } = pageData ?? {};
137
136
  const { metaTitle, metaDescription } = seo ?? {};
138
- result.locale = locale ?? null;
139
- result.canonicalUrl = canonicalUrl ?? null;
137
+ result.lang = locale;
138
+ result.canonicalUrl = canonicalUrl;
140
139
  result.meta = { title: metaTitle ?? null, description: metaDescription ?? null };
141
140
  const structuredDataContent = {};
141
+ const openGraphContent = {};
142
142
  if (index$1.isStrapiContent(content)) {
143
143
  const review = extractReview(content, seo ?? null, createdAt ?? null, updatedAt ?? null);
144
144
  const game = extractGame(content);
145
145
  if (review && game) {
146
146
  structuredDataContent.review = review;
147
147
  structuredDataContent.game = game;
148
+ openGraphContent.article = {
149
+ createdAt: review.publishedAt,
150
+ updatedAt: review.updatedAt || review.publishedAt
151
+ };
148
152
  const reviewAuthor = extractAuthor(author ?? null);
149
153
  if (reviewAuthor) {
150
154
  structuredDataContent.author = reviewAuthor;
155
+ openGraphContent.article.author = reviewAuthor.name;
151
156
  }
152
157
  }
153
158
  }
@@ -156,6 +161,10 @@ function extractSeoData(pageData, pageContext) {
156
161
  entity: "game-review",
157
162
  content: structuredDataContent
158
163
  } : null;
164
+ result.openGraph = openGraphContent ? {
165
+ options: { withTwitterCard: true },
166
+ content: openGraphContent
167
+ } : null;
159
168
  }
160
169
  return result;
161
170
  }
@@ -185,7 +194,7 @@ function getLocales(defaultLocaleCode, locales) {
185
194
  return 0;
186
195
  });
187
196
  }
188
- exports.extractSeoData = extractSeoData;
197
+ exports.buildSeoFromStrapi = buildSeoFromStrapi;
189
198
  exports.getLocale = getLocale;
190
199
  exports.getLocales = getLocales;
191
200
  exports.getNavigation = getNavigation;
@@ -1,6 +1,6 @@
1
1
  import { useColorModeValue } from "@chakra-ui/react";
2
2
  import "./index-BJRvnR8Q.mjs";
3
- import "./index-RzByAgHO.mjs";
3
+ import "./index-C6A-3gBz.mjs";
4
4
  import { L as LIGHT_THEME_COLOR, D as DARK_THEME_COLOR } from "./index-BRVKhbs6.mjs";
5
5
  function usePrimaryColors() {
6
6
  const color = useColorModeValue(LIGHT_THEME_COLOR, DARK_THEME_COLOR);
@@ -4,6 +4,11 @@ function isStrapiContent(array) {
4
4
  (item) => typeof item === "object" && item !== null && "__typename" in item && typeof item.__typename === "string"
5
5
  );
6
6
  }
7
+ function isStrapiRichText(value) {
8
+ return Boolean(
9
+ value && typeof value === "object" && "__typename" in value && value.__typename === "STRAPI__COMPONENT_CONTENT_RICH_TEXT"
10
+ );
11
+ }
7
12
  function isStrapiPageData(data) {
8
13
  const maybe = data;
9
14
  return Boolean(typeof data === "object" && maybe.content);
@@ -119,6 +124,53 @@ function buildGameReviewSchema(params) {
119
124
  }
120
125
  };
121
126
  }
127
+ function buildOpenGraphMeta(params) {
128
+ const { site, page, lang, content } = params;
129
+ const { article, image } = content ?? {};
130
+ const type = article ? "article" : "website";
131
+ const meta = [
132
+ { property: "og:site_name", content: site.name },
133
+ { property: "og:locale", content: lang },
134
+ { property: "og:type", content: type },
135
+ { property: "og:url", content: page.url },
136
+ { property: "og:title", content: page.title },
137
+ { property: "og:description", content: page.description }
138
+ ];
139
+ if (image) {
140
+ const imageMeta = [
141
+ { property: "og:image", content: image.url },
142
+ { property: "og:image:alt", content: image.alt }
143
+ ];
144
+ if (image.width && image.height) {
145
+ imageMeta.push(
146
+ { property: "og:image:width", content: String(image.width) },
147
+ { property: "og:image:height", content: String(image.height) }
148
+ );
149
+ }
150
+ meta.push(...imageMeta);
151
+ }
152
+ if (article) {
153
+ const articleMeta = [
154
+ { property: "og:article:published_time", content: article.createdAt },
155
+ { property: "og:article:modified_time", content: article.updatedAt }
156
+ ];
157
+ if (article.author) {
158
+ articleMeta.push({ property: "og:article:author", content: article.author });
159
+ }
160
+ if (article.section) {
161
+ articleMeta.push({ property: "og:article:section", content: article.section });
162
+ }
163
+ if (article.tags && article.tags.length) {
164
+ const articleTags = article.tags.map((tag) => ({
165
+ property: "og:article:tag",
166
+ content: tag
167
+ }));
168
+ articleMeta.push(...articleTags);
169
+ }
170
+ meta.push(...articleMeta);
171
+ }
172
+ return meta;
173
+ }
122
174
  function randomComparator() {
123
175
  return Math.random() - 0.5;
124
176
  }
@@ -131,16 +183,18 @@ function getSeededRandomComparator(seed) {
131
183
  return () => seededRandom(safeSeed + index++) - 0.5;
132
184
  }
133
185
  export {
134
- isStrapiPageData as a,
135
- isStrapiPageContext as b,
136
- buildGraph as c,
137
- buildOrganizationSchema as d,
138
- buildWebsiteSchema as e,
139
- getEntitySchema as f,
186
+ isStrapiRichText as a,
187
+ isStrapiPageData as b,
188
+ isStrapiPageContext as c,
189
+ buildGraph as d,
190
+ buildOrganizationSchema as e,
191
+ buildWebsiteSchema as f,
140
192
  getCurrencySymbol as g,
141
- buildWebpageSchema as h,
193
+ getEntitySchema as h,
142
194
  isStrapiContent as i,
143
- buildGameReviewSchema as j,
144
- getSeededRandomComparator as k,
195
+ buildWebpageSchema as j,
196
+ buildGameReviewSchema as k,
197
+ buildOpenGraphMeta as l,
198
+ getSeededRandomComparator as m,
145
199
  randomComparator as r
146
200
  };