@masters-ws/react-seo 1.0.0 → 1.1.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.
- package/README.md +142 -91
- package/dist/chunk-AAN7NRZE.mjs +235 -0
- package/dist/core/index.d.mts +1 -0
- package/dist/core/index.d.ts +1 -0
- package/dist/core/index.js +272 -0
- package/dist/core/index.mjs +28 -0
- package/dist/index-CGVLxGDj.d.mts +362 -0
- package/dist/index-CGVLxGDj.d.ts +362 -0
- package/dist/index.d.mts +3 -84
- package/dist/index.d.ts +3 -84
- package/dist/index.js +251 -1021
- package/dist/index.mjs +47 -1047
- package/package.json +32 -12
package/dist/index.js
CHANGED
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
2
|
var __defProp = Object.defineProperty;
|
|
4
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __commonJS = (cb, mod) => function __require() {
|
|
9
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
10
|
-
};
|
|
11
6
|
var __export = (target, all) => {
|
|
12
7
|
for (var name in all)
|
|
13
8
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -20,167 +15,8 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
20
15
|
}
|
|
21
16
|
return to;
|
|
22
17
|
};
|
|
23
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
24
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
25
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
26
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
27
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
28
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
29
|
-
mod
|
|
30
|
-
));
|
|
31
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
32
19
|
|
|
33
|
-
// node_modules/react-fast-compare/index.js
|
|
34
|
-
var require_react_fast_compare = __commonJS({
|
|
35
|
-
"node_modules/react-fast-compare/index.js"(exports2, module2) {
|
|
36
|
-
"use strict";
|
|
37
|
-
var hasElementType = typeof Element !== "undefined";
|
|
38
|
-
var hasMap = typeof Map === "function";
|
|
39
|
-
var hasSet = typeof Set === "function";
|
|
40
|
-
var hasArrayBuffer = typeof ArrayBuffer === "function" && !!ArrayBuffer.isView;
|
|
41
|
-
function equal(a, b) {
|
|
42
|
-
if (a === b) return true;
|
|
43
|
-
if (a && b && typeof a == "object" && typeof b == "object") {
|
|
44
|
-
if (a.constructor !== b.constructor) return false;
|
|
45
|
-
var length, i, keys;
|
|
46
|
-
if (Array.isArray(a)) {
|
|
47
|
-
length = a.length;
|
|
48
|
-
if (length != b.length) return false;
|
|
49
|
-
for (i = length; i-- !== 0; )
|
|
50
|
-
if (!equal(a[i], b[i])) return false;
|
|
51
|
-
return true;
|
|
52
|
-
}
|
|
53
|
-
var it;
|
|
54
|
-
if (hasMap && a instanceof Map && b instanceof Map) {
|
|
55
|
-
if (a.size !== b.size) return false;
|
|
56
|
-
it = a.entries();
|
|
57
|
-
while (!(i = it.next()).done)
|
|
58
|
-
if (!b.has(i.value[0])) return false;
|
|
59
|
-
it = a.entries();
|
|
60
|
-
while (!(i = it.next()).done)
|
|
61
|
-
if (!equal(i.value[1], b.get(i.value[0]))) return false;
|
|
62
|
-
return true;
|
|
63
|
-
}
|
|
64
|
-
if (hasSet && a instanceof Set && b instanceof Set) {
|
|
65
|
-
if (a.size !== b.size) return false;
|
|
66
|
-
it = a.entries();
|
|
67
|
-
while (!(i = it.next()).done)
|
|
68
|
-
if (!b.has(i.value[0])) return false;
|
|
69
|
-
return true;
|
|
70
|
-
}
|
|
71
|
-
if (hasArrayBuffer && ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {
|
|
72
|
-
length = a.length;
|
|
73
|
-
if (length != b.length) return false;
|
|
74
|
-
for (i = length; i-- !== 0; )
|
|
75
|
-
if (a[i] !== b[i]) return false;
|
|
76
|
-
return true;
|
|
77
|
-
}
|
|
78
|
-
if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;
|
|
79
|
-
if (a.valueOf !== Object.prototype.valueOf && typeof a.valueOf === "function" && typeof b.valueOf === "function") return a.valueOf() === b.valueOf();
|
|
80
|
-
if (a.toString !== Object.prototype.toString && typeof a.toString === "function" && typeof b.toString === "function") return a.toString() === b.toString();
|
|
81
|
-
keys = Object.keys(a);
|
|
82
|
-
length = keys.length;
|
|
83
|
-
if (length !== Object.keys(b).length) return false;
|
|
84
|
-
for (i = length; i-- !== 0; )
|
|
85
|
-
if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;
|
|
86
|
-
if (hasElementType && a instanceof Element) return false;
|
|
87
|
-
for (i = length; i-- !== 0; ) {
|
|
88
|
-
if ((keys[i] === "_owner" || keys[i] === "__v" || keys[i] === "__o") && a.$$typeof) {
|
|
89
|
-
continue;
|
|
90
|
-
}
|
|
91
|
-
if (!equal(a[keys[i]], b[keys[i]])) return false;
|
|
92
|
-
}
|
|
93
|
-
return true;
|
|
94
|
-
}
|
|
95
|
-
return a !== a && b !== b;
|
|
96
|
-
}
|
|
97
|
-
module2.exports = function isEqual(a, b) {
|
|
98
|
-
try {
|
|
99
|
-
return equal(a, b);
|
|
100
|
-
} catch (error) {
|
|
101
|
-
if ((error.message || "").match(/stack|recursion/i)) {
|
|
102
|
-
console.warn("react-fast-compare cannot handle circular refs");
|
|
103
|
-
return false;
|
|
104
|
-
}
|
|
105
|
-
throw error;
|
|
106
|
-
}
|
|
107
|
-
};
|
|
108
|
-
}
|
|
109
|
-
});
|
|
110
|
-
|
|
111
|
-
// node_modules/invariant/invariant.js
|
|
112
|
-
var require_invariant = __commonJS({
|
|
113
|
-
"node_modules/invariant/invariant.js"(exports2, module2) {
|
|
114
|
-
"use strict";
|
|
115
|
-
var NODE_ENV = process.env.NODE_ENV;
|
|
116
|
-
var invariant2 = function(condition, format, a, b, c, d, e, f) {
|
|
117
|
-
if (NODE_ENV !== "production") {
|
|
118
|
-
if (format === void 0) {
|
|
119
|
-
throw new Error("invariant requires an error message argument");
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
if (!condition) {
|
|
123
|
-
var error;
|
|
124
|
-
if (format === void 0) {
|
|
125
|
-
error = new Error(
|
|
126
|
-
"Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings."
|
|
127
|
-
);
|
|
128
|
-
} else {
|
|
129
|
-
var args = [a, b, c, d, e, f];
|
|
130
|
-
var argIndex = 0;
|
|
131
|
-
error = new Error(
|
|
132
|
-
format.replace(/%s/g, function() {
|
|
133
|
-
return args[argIndex++];
|
|
134
|
-
})
|
|
135
|
-
);
|
|
136
|
-
error.name = "Invariant Violation";
|
|
137
|
-
}
|
|
138
|
-
error.framesToPop = 1;
|
|
139
|
-
throw error;
|
|
140
|
-
}
|
|
141
|
-
};
|
|
142
|
-
module2.exports = invariant2;
|
|
143
|
-
}
|
|
144
|
-
});
|
|
145
|
-
|
|
146
|
-
// node_modules/shallowequal/index.js
|
|
147
|
-
var require_shallowequal = __commonJS({
|
|
148
|
-
"node_modules/shallowequal/index.js"(exports2, module2) {
|
|
149
|
-
"use strict";
|
|
150
|
-
module2.exports = function shallowEqual2(objA, objB, compare, compareContext) {
|
|
151
|
-
var ret = compare ? compare.call(compareContext, objA, objB) : void 0;
|
|
152
|
-
if (ret !== void 0) {
|
|
153
|
-
return !!ret;
|
|
154
|
-
}
|
|
155
|
-
if (objA === objB) {
|
|
156
|
-
return true;
|
|
157
|
-
}
|
|
158
|
-
if (typeof objA !== "object" || !objA || typeof objB !== "object" || !objB) {
|
|
159
|
-
return false;
|
|
160
|
-
}
|
|
161
|
-
var keysA = Object.keys(objA);
|
|
162
|
-
var keysB = Object.keys(objB);
|
|
163
|
-
if (keysA.length !== keysB.length) {
|
|
164
|
-
return false;
|
|
165
|
-
}
|
|
166
|
-
var bHasOwnProperty = Object.prototype.hasOwnProperty.bind(objB);
|
|
167
|
-
for (var idx = 0; idx < keysA.length; idx++) {
|
|
168
|
-
var key = keysA[idx];
|
|
169
|
-
if (!bHasOwnProperty(key)) {
|
|
170
|
-
return false;
|
|
171
|
-
}
|
|
172
|
-
var valueA = objA[key];
|
|
173
|
-
var valueB = objB[key];
|
|
174
|
-
ret = compare ? compare.call(compareContext, valueA, valueB, key) : void 0;
|
|
175
|
-
if (ret === false || ret === void 0 && valueA !== valueB) {
|
|
176
|
-
return false;
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
return true;
|
|
180
|
-
};
|
|
181
|
-
}
|
|
182
|
-
});
|
|
183
|
-
|
|
184
20
|
// src/index.ts
|
|
185
21
|
var index_exports = {};
|
|
186
22
|
__export(index_exports, {
|
|
@@ -201,830 +37,253 @@ __export(index_exports, {
|
|
|
201
37
|
SeoReview: () => SeoReview,
|
|
202
38
|
SeoTag: () => SeoTag,
|
|
203
39
|
SeoVideo: () => SeoVideo,
|
|
40
|
+
generateArticleSchema: () => generateArticleSchema,
|
|
41
|
+
generateBreadcrumbSchema: () => generateBreadcrumbSchema,
|
|
42
|
+
generateEventSchema: () => generateEventSchema,
|
|
43
|
+
generateFAQSchema: () => generateFAQSchema,
|
|
44
|
+
generateLocalBusinessSchema: () => generateLocalBusinessSchema,
|
|
45
|
+
generateOrganizationSchema: () => generateOrganizationSchema,
|
|
46
|
+
generatePaginatedTitle: () => generatePaginatedTitle,
|
|
47
|
+
generatePaginationLinks: () => generatePaginationLinks,
|
|
48
|
+
generateProductSchema: () => generateProductSchema,
|
|
49
|
+
generateVideoSchema: () => generateVideoSchema,
|
|
50
|
+
generateWebSiteSchema: () => generateWebSiteSchema,
|
|
204
51
|
toNextMetadata: () => toNextMetadata,
|
|
205
52
|
useSEOConfig: () => useSEOConfig
|
|
206
53
|
});
|
|
207
54
|
module.exports = __toCommonJS(index_exports);
|
|
208
55
|
|
|
209
|
-
// src/
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
// node_modules/react-helmet-async/lib/index.esm.js
|
|
213
|
-
var import_react = __toESM(require("react"));
|
|
214
|
-
var import_react_fast_compare = __toESM(require_react_fast_compare());
|
|
215
|
-
var import_invariant = __toESM(require_invariant());
|
|
216
|
-
var import_react2 = __toESM(require("react"));
|
|
217
|
-
var import_react3 = __toESM(require("react"));
|
|
218
|
-
var import_react4 = require("react");
|
|
219
|
-
var import_shallowequal = __toESM(require_shallowequal());
|
|
220
|
-
var TAG_NAMES = /* @__PURE__ */ ((TAG_NAMES2) => {
|
|
221
|
-
TAG_NAMES2["BASE"] = "base";
|
|
222
|
-
TAG_NAMES2["BODY"] = "body";
|
|
223
|
-
TAG_NAMES2["HEAD"] = "head";
|
|
224
|
-
TAG_NAMES2["HTML"] = "html";
|
|
225
|
-
TAG_NAMES2["LINK"] = "link";
|
|
226
|
-
TAG_NAMES2["META"] = "meta";
|
|
227
|
-
TAG_NAMES2["NOSCRIPT"] = "noscript";
|
|
228
|
-
TAG_NAMES2["SCRIPT"] = "script";
|
|
229
|
-
TAG_NAMES2["STYLE"] = "style";
|
|
230
|
-
TAG_NAMES2["TITLE"] = "title";
|
|
231
|
-
TAG_NAMES2["FRAGMENT"] = "Symbol(react.fragment)";
|
|
232
|
-
return TAG_NAMES2;
|
|
233
|
-
})(TAG_NAMES || {});
|
|
234
|
-
var SEO_PRIORITY_TAGS = {
|
|
235
|
-
link: { rel: ["amphtml", "canonical", "alternate"] },
|
|
236
|
-
script: { type: ["application/ld+json"] },
|
|
237
|
-
meta: {
|
|
238
|
-
charset: "",
|
|
239
|
-
name: ["generator", "robots", "description"],
|
|
240
|
-
property: [
|
|
241
|
-
"og:type",
|
|
242
|
-
"og:title",
|
|
243
|
-
"og:url",
|
|
244
|
-
"og:image",
|
|
245
|
-
"og:image:alt",
|
|
246
|
-
"og:description",
|
|
247
|
-
"twitter:url",
|
|
248
|
-
"twitter:title",
|
|
249
|
-
"twitter:description",
|
|
250
|
-
"twitter:image",
|
|
251
|
-
"twitter:image:alt",
|
|
252
|
-
"twitter:card",
|
|
253
|
-
"twitter:site"
|
|
254
|
-
]
|
|
255
|
-
}
|
|
256
|
-
};
|
|
257
|
-
var VALID_TAG_NAMES = Object.values(TAG_NAMES);
|
|
258
|
-
var REACT_TAG_MAP = {
|
|
259
|
-
accesskey: "accessKey",
|
|
260
|
-
charset: "charSet",
|
|
261
|
-
class: "className",
|
|
262
|
-
contenteditable: "contentEditable",
|
|
263
|
-
contextmenu: "contextMenu",
|
|
264
|
-
"http-equiv": "httpEquiv",
|
|
265
|
-
itemprop: "itemProp",
|
|
266
|
-
tabindex: "tabIndex"
|
|
267
|
-
};
|
|
268
|
-
var HTML_TAG_MAP = Object.entries(REACT_TAG_MAP).reduce(
|
|
269
|
-
(carry, [key, value]) => {
|
|
270
|
-
carry[value] = key;
|
|
271
|
-
return carry;
|
|
272
|
-
},
|
|
273
|
-
{}
|
|
274
|
-
);
|
|
275
|
-
var HELMET_ATTRIBUTE = "data-rh";
|
|
276
|
-
var HELMET_PROPS = {
|
|
277
|
-
DEFAULT_TITLE: "defaultTitle",
|
|
278
|
-
DEFER: "defer",
|
|
279
|
-
ENCODE_SPECIAL_CHARACTERS: "encodeSpecialCharacters",
|
|
280
|
-
ON_CHANGE_CLIENT_STATE: "onChangeClientState",
|
|
281
|
-
TITLE_TEMPLATE: "titleTemplate",
|
|
282
|
-
PRIORITIZE_SEO_TAGS: "prioritizeSeoTags"
|
|
283
|
-
};
|
|
284
|
-
var getInnermostProperty = (propsList, property) => {
|
|
285
|
-
for (let i = propsList.length - 1; i >= 0; i -= 1) {
|
|
286
|
-
const props = propsList[i];
|
|
287
|
-
if (Object.prototype.hasOwnProperty.call(props, property)) {
|
|
288
|
-
return props[property];
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
return null;
|
|
292
|
-
};
|
|
293
|
-
var getTitleFromPropsList = (propsList) => {
|
|
294
|
-
let innermostTitle = getInnermostProperty(
|
|
295
|
-
propsList,
|
|
296
|
-
"title"
|
|
297
|
-
/* TITLE */
|
|
298
|
-
);
|
|
299
|
-
const innermostTemplate = getInnermostProperty(propsList, HELMET_PROPS.TITLE_TEMPLATE);
|
|
300
|
-
if (Array.isArray(innermostTitle)) {
|
|
301
|
-
innermostTitle = innermostTitle.join("");
|
|
302
|
-
}
|
|
303
|
-
if (innermostTemplate && innermostTitle) {
|
|
304
|
-
return innermostTemplate.replace(/%s/g, () => innermostTitle);
|
|
305
|
-
}
|
|
306
|
-
const innermostDefaultTitle = getInnermostProperty(propsList, HELMET_PROPS.DEFAULT_TITLE);
|
|
307
|
-
return innermostTitle || innermostDefaultTitle || void 0;
|
|
308
|
-
};
|
|
309
|
-
var getOnChangeClientState = (propsList) => getInnermostProperty(propsList, HELMET_PROPS.ON_CHANGE_CLIENT_STATE) || (() => {
|
|
310
|
-
});
|
|
311
|
-
var getAttributesFromPropsList = (tagType, propsList) => propsList.filter((props) => typeof props[tagType] !== "undefined").map((props) => props[tagType]).reduce((tagAttrs, current) => ({ ...tagAttrs, ...current }), {});
|
|
312
|
-
var getBaseTagFromPropsList = (primaryAttributes, propsList) => propsList.filter((props) => typeof props[
|
|
313
|
-
"base"
|
|
314
|
-
/* BASE */
|
|
315
|
-
] !== "undefined").map((props) => props[
|
|
316
|
-
"base"
|
|
317
|
-
/* BASE */
|
|
318
|
-
]).reverse().reduce((innermostBaseTag, tag) => {
|
|
319
|
-
if (!innermostBaseTag.length) {
|
|
320
|
-
const keys = Object.keys(tag);
|
|
321
|
-
for (let i = 0; i < keys.length; i += 1) {
|
|
322
|
-
const attributeKey = keys[i];
|
|
323
|
-
const lowerCaseAttributeKey = attributeKey.toLowerCase();
|
|
324
|
-
if (primaryAttributes.indexOf(lowerCaseAttributeKey) !== -1 && tag[lowerCaseAttributeKey]) {
|
|
325
|
-
return innermostBaseTag.concat(tag);
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
return innermostBaseTag;
|
|
330
|
-
}, []);
|
|
331
|
-
var warn = (msg) => console && typeof console.warn === "function" && console.warn(msg);
|
|
332
|
-
var getTagsFromPropsList = (tagName, primaryAttributes, propsList) => {
|
|
333
|
-
const approvedSeenTags = {};
|
|
334
|
-
return propsList.filter((props) => {
|
|
335
|
-
if (Array.isArray(props[tagName])) {
|
|
336
|
-
return true;
|
|
337
|
-
}
|
|
338
|
-
if (typeof props[tagName] !== "undefined") {
|
|
339
|
-
warn(
|
|
340
|
-
`Helmet: ${tagName} should be of type "Array". Instead found type "${typeof props[tagName]}"`
|
|
341
|
-
);
|
|
342
|
-
}
|
|
343
|
-
return false;
|
|
344
|
-
}).map((props) => props[tagName]).reverse().reduce((approvedTags, instanceTags) => {
|
|
345
|
-
const instanceSeenTags = {};
|
|
346
|
-
instanceTags.filter((tag) => {
|
|
347
|
-
let primaryAttributeKey;
|
|
348
|
-
const keys2 = Object.keys(tag);
|
|
349
|
-
for (let i = 0; i < keys2.length; i += 1) {
|
|
350
|
-
const attributeKey = keys2[i];
|
|
351
|
-
const lowerCaseAttributeKey = attributeKey.toLowerCase();
|
|
352
|
-
if (primaryAttributes.indexOf(lowerCaseAttributeKey) !== -1 && !(primaryAttributeKey === "rel" && tag[primaryAttributeKey].toLowerCase() === "canonical") && !(lowerCaseAttributeKey === "rel" && tag[lowerCaseAttributeKey].toLowerCase() === "stylesheet")) {
|
|
353
|
-
primaryAttributeKey = lowerCaseAttributeKey;
|
|
354
|
-
}
|
|
355
|
-
if (primaryAttributes.indexOf(attributeKey) !== -1 && (attributeKey === "innerHTML" || attributeKey === "cssText" || attributeKey === "itemprop")) {
|
|
356
|
-
primaryAttributeKey = attributeKey;
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
|
-
if (!primaryAttributeKey || !tag[primaryAttributeKey]) {
|
|
360
|
-
return false;
|
|
361
|
-
}
|
|
362
|
-
const value = tag[primaryAttributeKey].toLowerCase();
|
|
363
|
-
if (!approvedSeenTags[primaryAttributeKey]) {
|
|
364
|
-
approvedSeenTags[primaryAttributeKey] = {};
|
|
365
|
-
}
|
|
366
|
-
if (!instanceSeenTags[primaryAttributeKey]) {
|
|
367
|
-
instanceSeenTags[primaryAttributeKey] = {};
|
|
368
|
-
}
|
|
369
|
-
if (!approvedSeenTags[primaryAttributeKey][value]) {
|
|
370
|
-
instanceSeenTags[primaryAttributeKey][value] = true;
|
|
371
|
-
return true;
|
|
372
|
-
}
|
|
373
|
-
return false;
|
|
374
|
-
}).reverse().forEach((tag) => approvedTags.push(tag));
|
|
375
|
-
const keys = Object.keys(instanceSeenTags);
|
|
376
|
-
for (let i = 0; i < keys.length; i += 1) {
|
|
377
|
-
const attributeKey = keys[i];
|
|
378
|
-
const tagUnion = {
|
|
379
|
-
...approvedSeenTags[attributeKey],
|
|
380
|
-
...instanceSeenTags[attributeKey]
|
|
381
|
-
};
|
|
382
|
-
approvedSeenTags[attributeKey] = tagUnion;
|
|
383
|
-
}
|
|
384
|
-
return approvedTags;
|
|
385
|
-
}, []).reverse();
|
|
386
|
-
};
|
|
387
|
-
var getAnyTrueFromPropsList = (propsList, checkedTag) => {
|
|
388
|
-
if (Array.isArray(propsList) && propsList.length) {
|
|
389
|
-
for (let index = 0; index < propsList.length; index += 1) {
|
|
390
|
-
const prop = propsList[index];
|
|
391
|
-
if (prop[checkedTag]) {
|
|
392
|
-
return true;
|
|
393
|
-
}
|
|
394
|
-
}
|
|
395
|
-
}
|
|
396
|
-
return false;
|
|
397
|
-
};
|
|
398
|
-
var reducePropsToState = (propsList) => ({
|
|
399
|
-
baseTag: getBaseTagFromPropsList([
|
|
400
|
-
"href"
|
|
401
|
-
/* HREF */
|
|
402
|
-
], propsList),
|
|
403
|
-
bodyAttributes: getAttributesFromPropsList("bodyAttributes", propsList),
|
|
404
|
-
defer: getInnermostProperty(propsList, HELMET_PROPS.DEFER),
|
|
405
|
-
encode: getInnermostProperty(propsList, HELMET_PROPS.ENCODE_SPECIAL_CHARACTERS),
|
|
406
|
-
htmlAttributes: getAttributesFromPropsList("htmlAttributes", propsList),
|
|
407
|
-
linkTags: getTagsFromPropsList(
|
|
408
|
-
"link",
|
|
409
|
-
[
|
|
410
|
-
"rel",
|
|
411
|
-
"href"
|
|
412
|
-
/* HREF */
|
|
413
|
-
],
|
|
414
|
-
propsList
|
|
415
|
-
),
|
|
416
|
-
metaTags: getTagsFromPropsList(
|
|
417
|
-
"meta",
|
|
418
|
-
[
|
|
419
|
-
"name",
|
|
420
|
-
"charset",
|
|
421
|
-
"http-equiv",
|
|
422
|
-
"property",
|
|
423
|
-
"itemprop"
|
|
424
|
-
/* ITEM_PROP */
|
|
425
|
-
],
|
|
426
|
-
propsList
|
|
427
|
-
),
|
|
428
|
-
noscriptTags: getTagsFromPropsList("noscript", [
|
|
429
|
-
"innerHTML"
|
|
430
|
-
/* INNER_HTML */
|
|
431
|
-
], propsList),
|
|
432
|
-
onChangeClientState: getOnChangeClientState(propsList),
|
|
433
|
-
scriptTags: getTagsFromPropsList(
|
|
434
|
-
"script",
|
|
435
|
-
[
|
|
436
|
-
"src",
|
|
437
|
-
"innerHTML"
|
|
438
|
-
/* INNER_HTML */
|
|
439
|
-
],
|
|
440
|
-
propsList
|
|
441
|
-
),
|
|
442
|
-
styleTags: getTagsFromPropsList("style", [
|
|
443
|
-
"cssText"
|
|
444
|
-
/* CSS_TEXT */
|
|
445
|
-
], propsList),
|
|
446
|
-
title: getTitleFromPropsList(propsList),
|
|
447
|
-
titleAttributes: getAttributesFromPropsList("titleAttributes", propsList),
|
|
448
|
-
prioritizeSeoTags: getAnyTrueFromPropsList(propsList, HELMET_PROPS.PRIORITIZE_SEO_TAGS)
|
|
449
|
-
});
|
|
450
|
-
var flattenArray = (possibleArray) => Array.isArray(possibleArray) ? possibleArray.join("") : possibleArray;
|
|
451
|
-
var checkIfPropsMatch = (props, toMatch) => {
|
|
452
|
-
const keys = Object.keys(props);
|
|
453
|
-
for (let i = 0; i < keys.length; i += 1) {
|
|
454
|
-
if (toMatch[keys[i]] && toMatch[keys[i]].includes(props[keys[i]])) {
|
|
455
|
-
return true;
|
|
456
|
-
}
|
|
457
|
-
}
|
|
458
|
-
return false;
|
|
459
|
-
};
|
|
460
|
-
var prioritizer = (elementsList, propsToMatch) => {
|
|
461
|
-
if (Array.isArray(elementsList)) {
|
|
462
|
-
return elementsList.reduce(
|
|
463
|
-
(acc, elementAttrs) => {
|
|
464
|
-
if (checkIfPropsMatch(elementAttrs, propsToMatch)) {
|
|
465
|
-
acc.priority.push(elementAttrs);
|
|
466
|
-
} else {
|
|
467
|
-
acc.default.push(elementAttrs);
|
|
468
|
-
}
|
|
469
|
-
return acc;
|
|
470
|
-
},
|
|
471
|
-
{ priority: [], default: [] }
|
|
472
|
-
);
|
|
473
|
-
}
|
|
474
|
-
return { default: elementsList, priority: [] };
|
|
475
|
-
};
|
|
476
|
-
var without = (obj, key) => {
|
|
56
|
+
// src/core/schemas.ts
|
|
57
|
+
function generateOrganizationSchema(config) {
|
|
477
58
|
return {
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
"script",
|
|
485
|
-
"style"
|
|
486
|
-
/* STYLE */
|
|
487
|
-
];
|
|
488
|
-
var encodeSpecialCharacters = (str, encode = true) => {
|
|
489
|
-
if (encode === false) {
|
|
490
|
-
return String(str);
|
|
491
|
-
}
|
|
492
|
-
return String(str).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
493
|
-
};
|
|
494
|
-
var generateElementAttributesAsString = (attributes) => Object.keys(attributes).reduce((str, key) => {
|
|
495
|
-
const attr = typeof attributes[key] !== "undefined" ? `${key}="${attributes[key]}"` : `${key}`;
|
|
496
|
-
return str ? `${str} ${attr}` : attr;
|
|
497
|
-
}, "");
|
|
498
|
-
var generateTitleAsString = (type, title, attributes, encode) => {
|
|
499
|
-
const attributeString = generateElementAttributesAsString(attributes);
|
|
500
|
-
const flattenedTitle = flattenArray(title);
|
|
501
|
-
return attributeString ? `<${type} ${HELMET_ATTRIBUTE}="true" ${attributeString}>${encodeSpecialCharacters(
|
|
502
|
-
flattenedTitle,
|
|
503
|
-
encode
|
|
504
|
-
)}</${type}>` : `<${type} ${HELMET_ATTRIBUTE}="true">${encodeSpecialCharacters(
|
|
505
|
-
flattenedTitle,
|
|
506
|
-
encode
|
|
507
|
-
)}</${type}>`;
|
|
508
|
-
};
|
|
509
|
-
var generateTagsAsString = (type, tags, encode = true) => tags.reduce((str, t) => {
|
|
510
|
-
const tag = t;
|
|
511
|
-
const attributeHtml = Object.keys(tag).filter(
|
|
512
|
-
(attribute) => !(attribute === "innerHTML" || attribute === "cssText")
|
|
513
|
-
).reduce((string, attribute) => {
|
|
514
|
-
const attr = typeof tag[attribute] === "undefined" ? attribute : `${attribute}="${encodeSpecialCharacters(tag[attribute], encode)}"`;
|
|
515
|
-
return string ? `${string} ${attr}` : attr;
|
|
516
|
-
}, "");
|
|
517
|
-
const tagContent = tag.innerHTML || tag.cssText || "";
|
|
518
|
-
const isSelfClosing = SELF_CLOSING_TAGS.indexOf(type) === -1;
|
|
519
|
-
return `${str}<${type} ${HELMET_ATTRIBUTE}="true" ${attributeHtml}${isSelfClosing ? `/>` : `>${tagContent}</${type}>`}`;
|
|
520
|
-
}, "");
|
|
521
|
-
var convertElementAttributesToReactProps = (attributes, initProps = {}) => Object.keys(attributes).reduce((obj, key) => {
|
|
522
|
-
const mapped = REACT_TAG_MAP[key];
|
|
523
|
-
obj[mapped || key] = attributes[key];
|
|
524
|
-
return obj;
|
|
525
|
-
}, initProps);
|
|
526
|
-
var generateTitleAsReactComponent = (_type, title, attributes) => {
|
|
527
|
-
const initProps = {
|
|
528
|
-
key: title,
|
|
529
|
-
[HELMET_ATTRIBUTE]: true
|
|
530
|
-
};
|
|
531
|
-
const props = convertElementAttributesToReactProps(attributes, initProps);
|
|
532
|
-
return [import_react3.default.createElement("title", props, title)];
|
|
533
|
-
};
|
|
534
|
-
var generateTagsAsReactComponent = (type, tags) => tags.map((tag, i) => {
|
|
535
|
-
const mappedTag = {
|
|
536
|
-
key: i,
|
|
537
|
-
[HELMET_ATTRIBUTE]: true
|
|
59
|
+
"@context": "https://schema.org",
|
|
60
|
+
"@type": "Organization",
|
|
61
|
+
"name": config.name,
|
|
62
|
+
"url": config.url,
|
|
63
|
+
"logo": config.logo,
|
|
64
|
+
"sameAs": config.socialLinks || []
|
|
538
65
|
};
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
66
|
+
}
|
|
67
|
+
function generateWebSiteSchema(config) {
|
|
68
|
+
return {
|
|
69
|
+
"@context": "https://schema.org",
|
|
70
|
+
"@type": "WebSite",
|
|
71
|
+
"name": config.name,
|
|
72
|
+
"url": config.url,
|
|
73
|
+
"potentialAction": {
|
|
74
|
+
"@type": "SearchAction",
|
|
75
|
+
"target": `${config.url}/search?q={search_term_string}`,
|
|
76
|
+
"query-input": "required name=search_term_string"
|
|
547
77
|
}
|
|
548
|
-
});
|
|
549
|
-
return import_react3.default.createElement(type, mappedTag);
|
|
550
|
-
});
|
|
551
|
-
var getMethodsForTag = (type, tags, encode = true) => {
|
|
552
|
-
switch (type) {
|
|
553
|
-
case "title":
|
|
554
|
-
return {
|
|
555
|
-
toComponent: () => generateTitleAsReactComponent(type, tags.title, tags.titleAttributes),
|
|
556
|
-
toString: () => generateTitleAsString(type, tags.title, tags.titleAttributes, encode)
|
|
557
|
-
};
|
|
558
|
-
case "bodyAttributes":
|
|
559
|
-
case "htmlAttributes":
|
|
560
|
-
return {
|
|
561
|
-
toComponent: () => convertElementAttributesToReactProps(tags),
|
|
562
|
-
toString: () => generateElementAttributesAsString(tags)
|
|
563
|
-
};
|
|
564
|
-
default:
|
|
565
|
-
return {
|
|
566
|
-
toComponent: () => generateTagsAsReactComponent(type, tags),
|
|
567
|
-
toString: () => generateTagsAsString(type, tags, encode)
|
|
568
|
-
};
|
|
569
|
-
}
|
|
570
|
-
};
|
|
571
|
-
var getPriorityMethods = ({ metaTags, linkTags, scriptTags, encode }) => {
|
|
572
|
-
const meta = prioritizer(metaTags, SEO_PRIORITY_TAGS.meta);
|
|
573
|
-
const link = prioritizer(linkTags, SEO_PRIORITY_TAGS.link);
|
|
574
|
-
const script = prioritizer(scriptTags, SEO_PRIORITY_TAGS.script);
|
|
575
|
-
const priorityMethods = {
|
|
576
|
-
toComponent: () => [
|
|
577
|
-
...generateTagsAsReactComponent("meta", meta.priority),
|
|
578
|
-
...generateTagsAsReactComponent("link", link.priority),
|
|
579
|
-
...generateTagsAsReactComponent("script", script.priority)
|
|
580
|
-
],
|
|
581
|
-
toString: () => (
|
|
582
|
-
// generate all the tags as strings and concatenate them
|
|
583
|
-
`${getMethodsForTag("meta", meta.priority, encode)} ${getMethodsForTag(
|
|
584
|
-
"link",
|
|
585
|
-
link.priority,
|
|
586
|
-
encode
|
|
587
|
-
)} ${getMethodsForTag("script", script.priority, encode)}`
|
|
588
|
-
)
|
|
589
78
|
};
|
|
79
|
+
}
|
|
80
|
+
function generateArticleSchema(data, config) {
|
|
81
|
+
const org = generateOrganizationSchema(config);
|
|
590
82
|
return {
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
83
|
+
"@context": "https://schema.org",
|
|
84
|
+
"@type": "NewsArticle",
|
|
85
|
+
"headline": data.title,
|
|
86
|
+
"description": data.description,
|
|
87
|
+
"image": data.image || config.logo,
|
|
88
|
+
"datePublished": data.publishedTime,
|
|
89
|
+
"dateModified": data.modifiedTime || data.publishedTime,
|
|
90
|
+
"mainEntityOfPage": data.url,
|
|
91
|
+
"author": data.author ? {
|
|
92
|
+
"@type": "Person",
|
|
93
|
+
"name": data.author.name,
|
|
94
|
+
"url": data.author.url
|
|
95
|
+
} : org,
|
|
96
|
+
"publisher": org
|
|
595
97
|
};
|
|
596
|
-
}
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
98
|
+
}
|
|
99
|
+
function generateProductSchema(data) {
|
|
100
|
+
return {
|
|
101
|
+
"@context": "https://schema.org",
|
|
102
|
+
"@type": "Product",
|
|
103
|
+
"name": data.name,
|
|
104
|
+
"description": data.description,
|
|
105
|
+
"image": data.image,
|
|
106
|
+
"sku": data.sku,
|
|
107
|
+
"brand": data.brand ? { "@type": "Brand", "name": data.brand } : void 0,
|
|
108
|
+
"offers": {
|
|
109
|
+
"@type": "Offer",
|
|
110
|
+
"url": data.url,
|
|
111
|
+
"priceCurrency": data.currency || "USD",
|
|
112
|
+
"price": data.price,
|
|
113
|
+
"availability": data.availability || "https://schema.org/InStock"
|
|
612
114
|
},
|
|
613
|
-
|
|
115
|
+
"aggregateRating": data.rating ? {
|
|
116
|
+
"@type": "AggregateRating",
|
|
117
|
+
"ratingValue": data.rating,
|
|
118
|
+
"reviewCount": data.reviewCount || 1
|
|
119
|
+
} : void 0
|
|
614
120
|
};
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
}
|
|
121
|
+
}
|
|
122
|
+
function generateFAQSchema(questions) {
|
|
618
123
|
return {
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
style: getMethodsForTag("style", styleTags, encode),
|
|
628
|
-
title: getMethodsForTag("title", { title, titleAttributes }, encode)
|
|
629
|
-
};
|
|
630
|
-
};
|
|
631
|
-
var server_default = mapStateOnServer;
|
|
632
|
-
var instances = [];
|
|
633
|
-
var isDocument = !!(typeof window !== "undefined" && window.document && window.document.createElement);
|
|
634
|
-
var HelmetData = class {
|
|
635
|
-
instances = [];
|
|
636
|
-
canUseDOM = isDocument;
|
|
637
|
-
context;
|
|
638
|
-
value = {
|
|
639
|
-
setHelmet: (serverState) => {
|
|
640
|
-
this.context.helmet = serverState;
|
|
641
|
-
},
|
|
642
|
-
helmetInstances: {
|
|
643
|
-
get: () => this.canUseDOM ? instances : this.instances,
|
|
644
|
-
add: (instance) => {
|
|
645
|
-
(this.canUseDOM ? instances : this.instances).push(instance);
|
|
646
|
-
},
|
|
647
|
-
remove: (instance) => {
|
|
648
|
-
const index = (this.canUseDOM ? instances : this.instances).indexOf(instance);
|
|
649
|
-
(this.canUseDOM ? instances : this.instances).splice(index, 1);
|
|
124
|
+
"@context": "https://schema.org",
|
|
125
|
+
"@type": "FAQPage",
|
|
126
|
+
"mainEntity": questions.map((item) => ({
|
|
127
|
+
"@type": "Question",
|
|
128
|
+
"name": item.q,
|
|
129
|
+
"acceptedAnswer": {
|
|
130
|
+
"@type": "Answer",
|
|
131
|
+
"text": item.a
|
|
650
132
|
}
|
|
651
|
-
}
|
|
133
|
+
}))
|
|
652
134
|
};
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
this.canUseDOM = canUseDOM || false;
|
|
656
|
-
if (!canUseDOM) {
|
|
657
|
-
context.helmet = server_default({
|
|
658
|
-
baseTag: [],
|
|
659
|
-
bodyAttributes: {},
|
|
660
|
-
encodeSpecialCharacters: true,
|
|
661
|
-
htmlAttributes: {},
|
|
662
|
-
linkTags: [],
|
|
663
|
-
metaTags: [],
|
|
664
|
-
noscriptTags: [],
|
|
665
|
-
scriptTags: [],
|
|
666
|
-
styleTags: [],
|
|
667
|
-
title: "",
|
|
668
|
-
titleAttributes: {}
|
|
669
|
-
});
|
|
670
|
-
}
|
|
671
|
-
}
|
|
672
|
-
};
|
|
673
|
-
var defaultValue = {};
|
|
674
|
-
var Context = import_react2.default.createContext(defaultValue);
|
|
675
|
-
var HelmetProvider = class _HelmetProvider extends import_react2.Component {
|
|
676
|
-
static canUseDOM = isDocument;
|
|
677
|
-
helmetData;
|
|
678
|
-
constructor(props) {
|
|
679
|
-
super(props);
|
|
680
|
-
this.helmetData = new HelmetData(this.props.context || {}, _HelmetProvider.canUseDOM);
|
|
681
|
-
}
|
|
682
|
-
render() {
|
|
683
|
-
return /* @__PURE__ */ import_react2.default.createElement(Context.Provider, { value: this.helmetData.value }, this.props.children);
|
|
684
|
-
}
|
|
685
|
-
};
|
|
686
|
-
var updateTags = (type, tags) => {
|
|
687
|
-
const headElement = document.head || document.querySelector(
|
|
688
|
-
"head"
|
|
689
|
-
/* HEAD */
|
|
690
|
-
);
|
|
691
|
-
const tagNodes = headElement.querySelectorAll(`${type}[${HELMET_ATTRIBUTE}]`);
|
|
692
|
-
const oldTags = [].slice.call(tagNodes);
|
|
693
|
-
const newTags = [];
|
|
694
|
-
let indexToDelete;
|
|
695
|
-
if (tags && tags.length) {
|
|
696
|
-
tags.forEach((tag) => {
|
|
697
|
-
const newElement = document.createElement(type);
|
|
698
|
-
for (const attribute in tag) {
|
|
699
|
-
if (Object.prototype.hasOwnProperty.call(tag, attribute)) {
|
|
700
|
-
if (attribute === "innerHTML") {
|
|
701
|
-
newElement.innerHTML = tag.innerHTML;
|
|
702
|
-
} else if (attribute === "cssText") {
|
|
703
|
-
if (newElement.styleSheet) {
|
|
704
|
-
newElement.styleSheet.cssText = tag.cssText;
|
|
705
|
-
} else {
|
|
706
|
-
newElement.appendChild(document.createTextNode(tag.cssText));
|
|
707
|
-
}
|
|
708
|
-
} else {
|
|
709
|
-
const attr = attribute;
|
|
710
|
-
const value = typeof tag[attr] === "undefined" ? "" : tag[attr];
|
|
711
|
-
newElement.setAttribute(attribute, value);
|
|
712
|
-
}
|
|
713
|
-
}
|
|
714
|
-
}
|
|
715
|
-
newElement.setAttribute(HELMET_ATTRIBUTE, "true");
|
|
716
|
-
if (oldTags.some((existingTag, index) => {
|
|
717
|
-
indexToDelete = index;
|
|
718
|
-
return newElement.isEqualNode(existingTag);
|
|
719
|
-
})) {
|
|
720
|
-
oldTags.splice(indexToDelete, 1);
|
|
721
|
-
} else {
|
|
722
|
-
newTags.push(newElement);
|
|
723
|
-
}
|
|
724
|
-
});
|
|
725
|
-
}
|
|
726
|
-
oldTags.forEach((tag) => tag.parentNode?.removeChild(tag));
|
|
727
|
-
newTags.forEach((tag) => headElement.appendChild(tag));
|
|
135
|
+
}
|
|
136
|
+
function generateBreadcrumbSchema(items) {
|
|
728
137
|
return {
|
|
729
|
-
|
|
730
|
-
|
|
138
|
+
"@context": "https://schema.org",
|
|
139
|
+
"@type": "BreadcrumbList",
|
|
140
|
+
"itemListElement": items.map((item, index) => ({
|
|
141
|
+
"@type": "ListItem",
|
|
142
|
+
"position": index + 1,
|
|
143
|
+
"name": item.name,
|
|
144
|
+
"item": item.item
|
|
145
|
+
}))
|
|
731
146
|
};
|
|
732
|
-
}
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
}
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
147
|
+
}
|
|
148
|
+
function generateVideoSchema(data) {
|
|
149
|
+
return {
|
|
150
|
+
"@context": "https://schema.org",
|
|
151
|
+
"@type": "VideoObject",
|
|
152
|
+
"name": data.name,
|
|
153
|
+
"description": data.description,
|
|
154
|
+
"thumbnailUrl": data.thumbnailUrl,
|
|
155
|
+
"uploadDate": data.uploadDate,
|
|
156
|
+
"duration": data.duration,
|
|
157
|
+
"contentUrl": data.contentUrl,
|
|
158
|
+
"embedUrl": data.embedUrl
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
function generateEventSchema(data) {
|
|
162
|
+
const isOnline = data.location && "url" in data.location;
|
|
163
|
+
return {
|
|
164
|
+
"@context": "https://schema.org",
|
|
165
|
+
"@type": "Event",
|
|
166
|
+
"name": data.name,
|
|
167
|
+
"description": data.description,
|
|
168
|
+
"startDate": data.startDate,
|
|
169
|
+
"endDate": data.endDate,
|
|
170
|
+
"eventAttendanceMode": isOnline ? "https://schema.org/OnlineEventAttendanceMode" : "https://schema.org/OfflineEventAttendanceMode",
|
|
171
|
+
"location": isOnline ? {
|
|
172
|
+
"@type": "VirtualLocation",
|
|
173
|
+
"url": data.location.url
|
|
174
|
+
} : data.location ? {
|
|
175
|
+
"@type": "Place",
|
|
176
|
+
"name": data.location.name,
|
|
177
|
+
"address": data.location.address
|
|
178
|
+
} : void 0,
|
|
179
|
+
"image": data.image,
|
|
180
|
+
"offers": data.offers ? {
|
|
181
|
+
"@type": "Offer",
|
|
182
|
+
"price": data.offers.price,
|
|
183
|
+
"priceCurrency": data.offers.currency,
|
|
184
|
+
"url": data.offers.url
|
|
185
|
+
} : void 0
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
function generateLocalBusinessSchema(data) {
|
|
189
|
+
return {
|
|
190
|
+
"@context": "https://schema.org",
|
|
191
|
+
"@type": "LocalBusiness",
|
|
192
|
+
"name": data.name,
|
|
193
|
+
"description": data.description,
|
|
194
|
+
"image": data.image,
|
|
195
|
+
"telephone": data.telephone,
|
|
196
|
+
"address": {
|
|
197
|
+
"@type": "PostalAddress",
|
|
198
|
+
"streetAddress": data.address.street,
|
|
199
|
+
"addressLocality": data.address.city,
|
|
200
|
+
"addressRegion": data.address.region,
|
|
201
|
+
"postalCode": data.address.postalCode,
|
|
202
|
+
"addressCountry": data.address.country
|
|
203
|
+
},
|
|
204
|
+
"geo": data.geo ? {
|
|
205
|
+
"@type": "GeoCoordinates",
|
|
206
|
+
"latitude": data.geo.lat,
|
|
207
|
+
"longitude": data.geo.lng
|
|
208
|
+
} : void 0,
|
|
209
|
+
"openingHours": data.openingHours,
|
|
210
|
+
"priceRange": data.priceRange
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
// src/core/metadata.ts
|
|
215
|
+
function toNextMetadata(props, config) {
|
|
216
|
+
const title = props.title ? `${props.title} | ${config.name}` : config.name;
|
|
217
|
+
const description = props.description || config.description;
|
|
218
|
+
const url = props.canonical || config.url;
|
|
219
|
+
const image = props.image || config.logo;
|
|
220
|
+
const metadata = {
|
|
781
221
|
title,
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
222
|
+
description,
|
|
223
|
+
keywords: props.keywords,
|
|
224
|
+
robots: props.noindex ? "noindex, nofollow" : props.robots || "index, follow",
|
|
225
|
+
alternates: {
|
|
226
|
+
canonical: props.noindex ? void 0 : url
|
|
227
|
+
},
|
|
228
|
+
openGraph: {
|
|
229
|
+
title: props.ogTitle || title,
|
|
230
|
+
description: props.ogDescription || description,
|
|
231
|
+
url,
|
|
232
|
+
siteName: config.name,
|
|
233
|
+
images: props.ogImage || image ? [{ url: props.ogImage || image }] : [],
|
|
234
|
+
type: props.ogType || (props.type === "article" ? "article" : "website"),
|
|
235
|
+
locale: props.ogLocale || config.language || "ar_SA"
|
|
236
|
+
},
|
|
237
|
+
twitter: {
|
|
238
|
+
card: props.twitterCard || "summary_large_image",
|
|
239
|
+
title: props.twitterTitle || title,
|
|
240
|
+
description: props.twitterDescription || description,
|
|
241
|
+
images: props.twitterImage || image ? [props.twitterImage || image] : [],
|
|
242
|
+
site: config.twitterHandle,
|
|
243
|
+
creator: config.twitterHandle
|
|
244
|
+
},
|
|
245
|
+
other: {}
|
|
794
246
|
};
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
if (newTags.length) {
|
|
800
|
-
addedTags[tagType] = newTags;
|
|
801
|
-
}
|
|
802
|
-
if (oldTags.length) {
|
|
803
|
-
removedTags[tagType] = tagUpdates[tagType].oldTags;
|
|
804
|
-
}
|
|
805
|
-
});
|
|
806
|
-
if (cb) {
|
|
807
|
-
cb();
|
|
808
|
-
}
|
|
809
|
-
onChangeClientState(newState, addedTags, removedTags);
|
|
810
|
-
};
|
|
811
|
-
var _helmetCallback = null;
|
|
812
|
-
var handleStateChangeOnClient = (newState) => {
|
|
813
|
-
if (_helmetCallback) {
|
|
814
|
-
cancelAnimationFrame(_helmetCallback);
|
|
815
|
-
}
|
|
816
|
-
if (newState.defer) {
|
|
817
|
-
_helmetCallback = requestAnimationFrame(() => {
|
|
818
|
-
commitTagChanges(newState, () => {
|
|
819
|
-
_helmetCallback = null;
|
|
820
|
-
});
|
|
247
|
+
if (props.alternates && props.alternates.length > 0) {
|
|
248
|
+
const languages = {};
|
|
249
|
+
props.alternates.forEach((alt) => {
|
|
250
|
+
languages[alt.hreflang] = alt.href;
|
|
821
251
|
});
|
|
822
|
-
|
|
823
|
-
commitTagChanges(newState);
|
|
824
|
-
_helmetCallback = null;
|
|
825
|
-
}
|
|
826
|
-
};
|
|
827
|
-
var client_default = handleStateChangeOnClient;
|
|
828
|
-
var HelmetDispatcher = class extends import_react4.Component {
|
|
829
|
-
rendered = false;
|
|
830
|
-
shouldComponentUpdate(nextProps) {
|
|
831
|
-
return !(0, import_shallowequal.default)(nextProps, this.props);
|
|
832
|
-
}
|
|
833
|
-
componentDidUpdate() {
|
|
834
|
-
this.emitChange();
|
|
835
|
-
}
|
|
836
|
-
componentWillUnmount() {
|
|
837
|
-
const { helmetInstances } = this.props.context;
|
|
838
|
-
helmetInstances.remove(this);
|
|
839
|
-
this.emitChange();
|
|
840
|
-
}
|
|
841
|
-
emitChange() {
|
|
842
|
-
const { helmetInstances, setHelmet } = this.props.context;
|
|
843
|
-
let serverState = null;
|
|
844
|
-
const state = reducePropsToState(
|
|
845
|
-
helmetInstances.get().map((instance) => {
|
|
846
|
-
const props = { ...instance.props };
|
|
847
|
-
delete props.context;
|
|
848
|
-
return props;
|
|
849
|
-
})
|
|
850
|
-
);
|
|
851
|
-
if (HelmetProvider.canUseDOM) {
|
|
852
|
-
client_default(state);
|
|
853
|
-
} else if (server_default) {
|
|
854
|
-
serverState = server_default(state);
|
|
855
|
-
}
|
|
856
|
-
setHelmet(serverState);
|
|
857
|
-
}
|
|
858
|
-
// componentWillMount will be deprecated
|
|
859
|
-
// for SSR, initialize on first render
|
|
860
|
-
// constructor is also unsafe in StrictMode
|
|
861
|
-
init() {
|
|
862
|
-
if (this.rendered) {
|
|
863
|
-
return;
|
|
864
|
-
}
|
|
865
|
-
this.rendered = true;
|
|
866
|
-
const { helmetInstances } = this.props.context;
|
|
867
|
-
helmetInstances.add(this);
|
|
868
|
-
this.emitChange();
|
|
869
|
-
}
|
|
870
|
-
render() {
|
|
871
|
-
this.init();
|
|
872
|
-
return null;
|
|
252
|
+
metadata.alternates.languages = languages;
|
|
873
253
|
}
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
encodeSpecialCharacters: true,
|
|
879
|
-
prioritizeSeoTags: false
|
|
254
|
+
metadata.appleWebApp = {
|
|
255
|
+
capable: true,
|
|
256
|
+
title: config.name,
|
|
257
|
+
statusBarStyle: "default"
|
|
880
258
|
};
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
default:
|
|
899
|
-
throw new Error(
|
|
900
|
-
`<${child.type} /> elements are self-closing and can not contain children. Refer to our API for more information.`
|
|
901
|
-
);
|
|
902
|
-
}
|
|
903
|
-
}
|
|
904
|
-
flattenArrayTypeChildren(child, arrayTypeChildren, newChildProps, nestedChildren) {
|
|
905
|
-
return {
|
|
906
|
-
...arrayTypeChildren,
|
|
907
|
-
[child.type]: [
|
|
908
|
-
...arrayTypeChildren[child.type] || [],
|
|
909
|
-
{
|
|
910
|
-
...newChildProps,
|
|
911
|
-
...this.mapNestedChildrenToProps(child, nestedChildren)
|
|
912
|
-
}
|
|
913
|
-
]
|
|
914
|
-
};
|
|
915
|
-
}
|
|
916
|
-
mapObjectTypeChildren(child, newProps, newChildProps, nestedChildren) {
|
|
917
|
-
switch (child.type) {
|
|
918
|
-
case "title":
|
|
919
|
-
return {
|
|
920
|
-
...newProps,
|
|
921
|
-
[child.type]: nestedChildren,
|
|
922
|
-
titleAttributes: { ...newChildProps }
|
|
923
|
-
};
|
|
924
|
-
case "body":
|
|
925
|
-
return {
|
|
926
|
-
...newProps,
|
|
927
|
-
bodyAttributes: { ...newChildProps }
|
|
928
|
-
};
|
|
929
|
-
case "html":
|
|
930
|
-
return {
|
|
931
|
-
...newProps,
|
|
932
|
-
htmlAttributes: { ...newChildProps }
|
|
933
|
-
};
|
|
934
|
-
default:
|
|
935
|
-
return {
|
|
936
|
-
...newProps,
|
|
937
|
-
[child.type]: { ...newChildProps }
|
|
938
|
-
};
|
|
939
|
-
}
|
|
940
|
-
}
|
|
941
|
-
mapArrayTypeChildrenToProps(arrayTypeChildren, newProps) {
|
|
942
|
-
let newFlattenedProps = { ...newProps };
|
|
943
|
-
Object.keys(arrayTypeChildren).forEach((arrayChildName) => {
|
|
944
|
-
newFlattenedProps = {
|
|
945
|
-
...newFlattenedProps,
|
|
946
|
-
[arrayChildName]: arrayTypeChildren[arrayChildName]
|
|
947
|
-
};
|
|
948
|
-
});
|
|
949
|
-
return newFlattenedProps;
|
|
950
|
-
}
|
|
951
|
-
warnOnInvalidChildren(child, nestedChildren) {
|
|
952
|
-
(0, import_invariant.default)(
|
|
953
|
-
VALID_TAG_NAMES.some((name) => child.type === name),
|
|
954
|
-
typeof child.type === "function" ? `You may be attempting to nest <Helmet> components within each other, which is not allowed. Refer to our API for more information.` : `Only elements types ${VALID_TAG_NAMES.join(
|
|
955
|
-
", "
|
|
956
|
-
)} are allowed. Helmet does not support rendering <${child.type}> elements. Refer to our API for more information.`
|
|
957
|
-
);
|
|
958
|
-
(0, import_invariant.default)(
|
|
959
|
-
!nestedChildren || typeof nestedChildren === "string" || Array.isArray(nestedChildren) && !nestedChildren.some((nestedChild) => typeof nestedChild !== "string"),
|
|
960
|
-
`Helmet expects a string as a child of <${child.type}>. Did you forget to wrap your children in braces? ( <${child.type}>{\`\`}</${child.type}> ) Refer to our API for more information.`
|
|
961
|
-
);
|
|
962
|
-
return true;
|
|
963
|
-
}
|
|
964
|
-
mapChildrenToProps(children, newProps) {
|
|
965
|
-
let arrayTypeChildren = {};
|
|
966
|
-
import_react.default.Children.forEach(children, (child) => {
|
|
967
|
-
if (!child || !child.props) {
|
|
968
|
-
return;
|
|
969
|
-
}
|
|
970
|
-
const { children: nestedChildren, ...childProps } = child.props;
|
|
971
|
-
const newChildProps = Object.keys(childProps).reduce((obj, key) => {
|
|
972
|
-
obj[HTML_TAG_MAP[key] || key] = childProps[key];
|
|
973
|
-
return obj;
|
|
974
|
-
}, {});
|
|
975
|
-
let { type } = child;
|
|
976
|
-
if (typeof type === "symbol") {
|
|
977
|
-
type = type.toString();
|
|
978
|
-
} else {
|
|
979
|
-
this.warnOnInvalidChildren(child, nestedChildren);
|
|
980
|
-
}
|
|
981
|
-
switch (type) {
|
|
982
|
-
case "Symbol(react.fragment)":
|
|
983
|
-
newProps = this.mapChildrenToProps(nestedChildren, newProps);
|
|
984
|
-
break;
|
|
985
|
-
case "link":
|
|
986
|
-
case "meta":
|
|
987
|
-
case "noscript":
|
|
988
|
-
case "script":
|
|
989
|
-
case "style":
|
|
990
|
-
arrayTypeChildren = this.flattenArrayTypeChildren(
|
|
991
|
-
child,
|
|
992
|
-
arrayTypeChildren,
|
|
993
|
-
newChildProps,
|
|
994
|
-
nestedChildren
|
|
995
|
-
);
|
|
996
|
-
break;
|
|
997
|
-
default:
|
|
998
|
-
newProps = this.mapObjectTypeChildren(child, newProps, newChildProps, nestedChildren);
|
|
999
|
-
break;
|
|
1000
|
-
}
|
|
1001
|
-
});
|
|
1002
|
-
return this.mapArrayTypeChildrenToProps(arrayTypeChildren, newProps);
|
|
1003
|
-
}
|
|
1004
|
-
render() {
|
|
1005
|
-
const { children, ...props } = this.props;
|
|
1006
|
-
let newProps = { ...props };
|
|
1007
|
-
let { helmetData } = props;
|
|
1008
|
-
if (children) {
|
|
1009
|
-
newProps = this.mapChildrenToProps(children, newProps);
|
|
1010
|
-
}
|
|
1011
|
-
if (helmetData && !(helmetData instanceof HelmetData)) {
|
|
1012
|
-
const data = helmetData;
|
|
1013
|
-
helmetData = new HelmetData(data.context, true);
|
|
1014
|
-
delete newProps.helmetData;
|
|
1015
|
-
}
|
|
1016
|
-
return helmetData ? /* @__PURE__ */ import_react.default.createElement(HelmetDispatcher, { ...newProps, context: helmetData.value }) : /* @__PURE__ */ import_react.default.createElement(Context.Consumer, null, (context) => /* @__PURE__ */ import_react.default.createElement(HelmetDispatcher, { ...newProps, context }));
|
|
1017
|
-
}
|
|
1018
|
-
};
|
|
259
|
+
if (config.themeColor) metadata.themeColor = config.themeColor;
|
|
260
|
+
if (config.manifest) metadata.manifest = config.manifest;
|
|
261
|
+
return metadata;
|
|
262
|
+
}
|
|
263
|
+
function generatePaginationLinks(baseUrl, currentPage, totalPages) {
|
|
264
|
+
const hasNext = currentPage < totalPages;
|
|
265
|
+
const hasPrev = currentPage > 1;
|
|
266
|
+
const cleanBase = baseUrl.split("?")[0];
|
|
267
|
+
return {
|
|
268
|
+
next: hasNext ? `${cleanBase}?page=${currentPage + 1}` : void 0,
|
|
269
|
+
prev: hasPrev ? currentPage === 2 ? cleanBase : `${cleanBase}?page=${currentPage - 1}` : void 0,
|
|
270
|
+
canonical: currentPage === 1 ? cleanBase : `${cleanBase}?page=${currentPage}`
|
|
271
|
+
};
|
|
272
|
+
}
|
|
273
|
+
function generatePaginatedTitle(title, page, suffix = "\u0635\u0641\u062D\u0629") {
|
|
274
|
+
return page > 1 ? `${title} - ${suffix} ${page}` : title;
|
|
275
|
+
}
|
|
1019
276
|
|
|
1020
277
|
// src/components/SEOProvider.tsx
|
|
278
|
+
var import_react = require("react");
|
|
279
|
+
var import_react_helmet_async = require("react-helmet-async");
|
|
1021
280
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
1022
|
-
var SEOContext = (0,
|
|
281
|
+
var SEOContext = (0, import_react.createContext)(void 0);
|
|
1023
282
|
var SEOProvider = ({ config, children, helmetContext }) => {
|
|
1024
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SEOContext.Provider, { value: { config }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(HelmetProvider, { context: helmetContext, children }) });
|
|
283
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SEOContext.Provider, { value: { config }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_helmet_async.HelmetProvider, { context: helmetContext, children }) });
|
|
1025
284
|
};
|
|
1026
285
|
var useSEOConfig = () => {
|
|
1027
|
-
const context = (0,
|
|
286
|
+
const context = (0, import_react.useContext)(SEOContext);
|
|
1028
287
|
if (!context) {
|
|
1029
288
|
throw new Error("useSEOConfig must be used within an SEOProvider");
|
|
1030
289
|
}
|
|
@@ -1032,6 +291,7 @@ var useSEOConfig = () => {
|
|
|
1032
291
|
};
|
|
1033
292
|
|
|
1034
293
|
// src/components/SEO.tsx
|
|
294
|
+
var import_react_helmet_async2 = require("react-helmet-async");
|
|
1035
295
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
1036
296
|
var SEO = (props) => {
|
|
1037
297
|
const config = useSEOConfig();
|
|
@@ -1111,7 +371,7 @@ var SEO = (props) => {
|
|
|
1111
371
|
schemas.push(props.schema);
|
|
1112
372
|
}
|
|
1113
373
|
}
|
|
1114
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Helmet, { children: [
|
|
374
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_react_helmet_async2.Helmet, { children: [
|
|
1115
375
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("title", { children: title }),
|
|
1116
376
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("meta", { name: "description", content: description }),
|
|
1117
377
|
props.keywords && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("meta", { name: "keywords", content: props.keywords.join(", ") }),
|
|
@@ -1160,6 +420,7 @@ var SEO = (props) => {
|
|
|
1160
420
|
};
|
|
1161
421
|
|
|
1162
422
|
// src/components/Breadcrumb.tsx
|
|
423
|
+
var import_react_helmet_async3 = require("react-helmet-async");
|
|
1163
424
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
1164
425
|
var Breadcrumb = ({
|
|
1165
426
|
items,
|
|
@@ -1178,7 +439,7 @@ var Breadcrumb = ({
|
|
|
1178
439
|
}))
|
|
1179
440
|
};
|
|
1180
441
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
|
|
1181
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Helmet, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("script", { type: "application/ld+json", children: JSON.stringify(schema) }) }),
|
|
442
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_helmet_async3.Helmet, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("script", { type: "application/ld+json", children: JSON.stringify(schema) }) }),
|
|
1182
443
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("nav", { className, "aria-label": "Breadcrumb", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("ol", { style: { display: "flex", listStyle: "none", padding: 0 }, children: items.map((item, index) => {
|
|
1183
444
|
const isLast = index === items.length - 1;
|
|
1184
445
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("li", { style: { display: "flex", alignItems: "center" }, children: [
|
|
@@ -1234,6 +495,7 @@ var SeoProduct = ({ item, ...rest }) => {
|
|
|
1234
495
|
};
|
|
1235
496
|
|
|
1236
497
|
// src/components/SeoFAQ.tsx
|
|
498
|
+
var import_react_helmet_async4 = require("react-helmet-async");
|
|
1237
499
|
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
1238
500
|
var SeoFAQ = ({ items }) => {
|
|
1239
501
|
const schema = {
|
|
@@ -1248,10 +510,11 @@ var SeoFAQ = ({ items }) => {
|
|
|
1248
510
|
}
|
|
1249
511
|
}))
|
|
1250
512
|
};
|
|
1251
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Helmet, { children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("script", { type: "application/ld+json", children: JSON.stringify(schema) }) });
|
|
513
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react_helmet_async4.Helmet, { children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("script", { type: "application/ld+json", children: JSON.stringify(schema) }) });
|
|
1252
514
|
};
|
|
1253
515
|
|
|
1254
516
|
// src/components/SeoVideo.tsx
|
|
517
|
+
var import_react_helmet_async5 = require("react-helmet-async");
|
|
1255
518
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
1256
519
|
var SeoVideo = ({ video }) => {
|
|
1257
520
|
const schema = {
|
|
@@ -1270,10 +533,11 @@ var SeoVideo = ({ video }) => {
|
|
|
1270
533
|
"userInteractionCount": video.interactionStatistic.viewCount
|
|
1271
534
|
} : void 0
|
|
1272
535
|
};
|
|
1273
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Helmet, { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("script", { type: "application/ld+json", children: JSON.stringify(schema) }) });
|
|
536
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react_helmet_async5.Helmet, { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("script", { type: "application/ld+json", children: JSON.stringify(schema) }) });
|
|
1274
537
|
};
|
|
1275
538
|
|
|
1276
539
|
// src/components/SeoEvent.tsx
|
|
540
|
+
var import_react_helmet_async6 = require("react-helmet-async");
|
|
1277
541
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1278
542
|
var SeoEvent = ({ event }) => {
|
|
1279
543
|
const schema = {
|
|
@@ -1310,10 +574,11 @@ var SeoEvent = ({ event }) => {
|
|
|
1310
574
|
"url": event.organizer.url
|
|
1311
575
|
} : void 0
|
|
1312
576
|
};
|
|
1313
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Helmet, { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("script", { type: "application/ld+json", children: JSON.stringify(schema) }) });
|
|
577
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_helmet_async6.Helmet, { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("script", { type: "application/ld+json", children: JSON.stringify(schema) }) });
|
|
1314
578
|
};
|
|
1315
579
|
|
|
1316
580
|
// src/components/SeoLocalBusiness.tsx
|
|
581
|
+
var import_react_helmet_async7 = require("react-helmet-async");
|
|
1317
582
|
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
1318
583
|
var SeoLocalBusiness = ({ business }) => {
|
|
1319
584
|
const schema = {
|
|
@@ -1341,7 +606,7 @@ var SeoLocalBusiness = ({ business }) => {
|
|
|
1341
606
|
} : void 0,
|
|
1342
607
|
"openingHours": business.openingHours
|
|
1343
608
|
};
|
|
1344
|
-
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Helmet, { children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("script", { type: "application/ld+json", children: JSON.stringify(schema) }) });
|
|
609
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react_helmet_async7.Helmet, { children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("script", { type: "application/ld+json", children: JSON.stringify(schema) }) });
|
|
1345
610
|
};
|
|
1346
611
|
|
|
1347
612
|
// src/components/SeoCategory.tsx
|
|
@@ -1432,6 +697,7 @@ var SeoAuthor = ({ author, page = 1, totalPage = 1, ...rest }) => {
|
|
|
1432
697
|
};
|
|
1433
698
|
|
|
1434
699
|
// src/components/SeoHowTo.tsx
|
|
700
|
+
var import_react_helmet_async8 = require("react-helmet-async");
|
|
1435
701
|
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1436
702
|
var SeoHowTo = ({ name, description, image, steps }) => {
|
|
1437
703
|
const schema = {
|
|
@@ -1458,10 +724,11 @@ var SeoHowTo = ({ name, description, image, steps }) => {
|
|
|
1458
724
|
};
|
|
1459
725
|
})
|
|
1460
726
|
};
|
|
1461
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Helmet, { children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("script", { type: "application/ld+json", children: JSON.stringify(schema) }) });
|
|
727
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_helmet_async8.Helmet, { children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("script", { type: "application/ld+json", children: JSON.stringify(schema) }) });
|
|
1462
728
|
};
|
|
1463
729
|
|
|
1464
730
|
// src/components/SeoReview.tsx
|
|
731
|
+
var import_react_helmet_async9 = require("react-helmet-async");
|
|
1465
732
|
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1466
733
|
var SeoReview = ({ itemReviewed, review }) => {
|
|
1467
734
|
const schema = {
|
|
@@ -1485,10 +752,11 @@ var SeoReview = ({ itemReviewed, review }) => {
|
|
|
1485
752
|
"worstRating": review.worstRating || 1
|
|
1486
753
|
}
|
|
1487
754
|
};
|
|
1488
|
-
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Helmet, { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("script", { type: "application/ld+json", children: JSON.stringify(schema) }) });
|
|
755
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_helmet_async9.Helmet, { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("script", { type: "application/ld+json", children: JSON.stringify(schema) }) });
|
|
1489
756
|
};
|
|
1490
757
|
|
|
1491
758
|
// src/components/SeoCourse.tsx
|
|
759
|
+
var import_react_helmet_async10 = require("react-helmet-async");
|
|
1492
760
|
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
1493
761
|
var SeoCourse = ({ course }) => {
|
|
1494
762
|
const schema = {
|
|
@@ -1503,10 +771,11 @@ var SeoCourse = ({ course }) => {
|
|
|
1503
771
|
},
|
|
1504
772
|
"image": course.image
|
|
1505
773
|
};
|
|
1506
|
-
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Helmet, { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("script", { type: "application/ld+json", children: JSON.stringify(schema) }) });
|
|
774
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_helmet_async10.Helmet, { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("script", { type: "application/ld+json", children: JSON.stringify(schema) }) });
|
|
1507
775
|
};
|
|
1508
776
|
|
|
1509
777
|
// src/components/SeoRecipe.tsx
|
|
778
|
+
var import_react_helmet_async11 = require("react-helmet-async");
|
|
1510
779
|
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1511
780
|
var SeoRecipe = ({ recipe }) => {
|
|
1512
781
|
const schema = {
|
|
@@ -1534,10 +803,11 @@ var SeoRecipe = ({ recipe }) => {
|
|
|
1534
803
|
"image": step.image
|
|
1535
804
|
}))
|
|
1536
805
|
};
|
|
1537
|
-
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Helmet, { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("script", { type: "application/ld+json", children: JSON.stringify(schema) }) });
|
|
806
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_helmet_async11.Helmet, { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("script", { type: "application/ld+json", children: JSON.stringify(schema) }) });
|
|
1538
807
|
};
|
|
1539
808
|
|
|
1540
809
|
// src/components/SeoJobPosting.tsx
|
|
810
|
+
var import_react_helmet_async12 = require("react-helmet-async");
|
|
1541
811
|
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1542
812
|
var SeoJobPosting = ({ job }) => {
|
|
1543
813
|
const schema = {
|
|
@@ -1580,59 +850,8 @@ var SeoJobPosting = ({ job }) => {
|
|
|
1580
850
|
}
|
|
1581
851
|
} : void 0
|
|
1582
852
|
};
|
|
1583
|
-
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Helmet, { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("script", { type: "application/ld+json", children: JSON.stringify(schema) }) });
|
|
853
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_helmet_async12.Helmet, { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("script", { type: "application/ld+json", children: JSON.stringify(schema) }) });
|
|
1584
854
|
};
|
|
1585
|
-
|
|
1586
|
-
// src/utils/next-adapter.ts
|
|
1587
|
-
function toNextMetadata(props, config) {
|
|
1588
|
-
const title = props.title ? `${props.title} | ${config.name}` : config.name;
|
|
1589
|
-
const description = props.description || config.description;
|
|
1590
|
-
const url = props.canonical || config.url;
|
|
1591
|
-
const image = props.image || config.logo;
|
|
1592
|
-
const metadata = {
|
|
1593
|
-
title,
|
|
1594
|
-
description,
|
|
1595
|
-
keywords: props.keywords,
|
|
1596
|
-
robots: props.noindex ? "noindex, nofollow" : props.robots || "index, follow",
|
|
1597
|
-
alternates: {
|
|
1598
|
-
canonical: props.noindex ? void 0 : url
|
|
1599
|
-
},
|
|
1600
|
-
openGraph: {
|
|
1601
|
-
title: props.ogTitle || title,
|
|
1602
|
-
description: props.ogDescription || description,
|
|
1603
|
-
url,
|
|
1604
|
-
siteName: config.name,
|
|
1605
|
-
images: props.ogImage || image ? [{ url: props.ogImage || image }] : [],
|
|
1606
|
-
type: props.ogType || (props.type === "article" ? "article" : "website"),
|
|
1607
|
-
locale: props.ogLocale || config.language || "ar_SA"
|
|
1608
|
-
},
|
|
1609
|
-
twitter: {
|
|
1610
|
-
card: props.twitterCard || "summary_large_image",
|
|
1611
|
-
title: props.twitterTitle || title,
|
|
1612
|
-
description: props.twitterDescription || description,
|
|
1613
|
-
images: props.twitterImage || image ? [props.twitterImage || image] : [],
|
|
1614
|
-
site: config.twitterHandle,
|
|
1615
|
-
creator: config.twitterHandle
|
|
1616
|
-
},
|
|
1617
|
-
other: {}
|
|
1618
|
-
};
|
|
1619
|
-
if (props.alternates && props.alternates.length > 0) {
|
|
1620
|
-
const languages = {};
|
|
1621
|
-
props.alternates.forEach((alt) => {
|
|
1622
|
-
languages[alt.hreflang] = alt.href;
|
|
1623
|
-
});
|
|
1624
|
-
metadata.alternates.languages = languages;
|
|
1625
|
-
}
|
|
1626
|
-
metadata.appleWebApp = {
|
|
1627
|
-
capable: true,
|
|
1628
|
-
title: config.name,
|
|
1629
|
-
statusBarStyle: "default"
|
|
1630
|
-
};
|
|
1631
|
-
if (props.dnsPrefetch) metadata.other["dns-prefetch"] = props.dnsPrefetch;
|
|
1632
|
-
if (config.themeColor) metadata.themeColor = config.themeColor;
|
|
1633
|
-
if (config.manifest) metadata.manifest = config.manifest;
|
|
1634
|
-
return metadata;
|
|
1635
|
-
}
|
|
1636
855
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1637
856
|
0 && (module.exports = {
|
|
1638
857
|
Breadcrumb,
|
|
@@ -1652,6 +871,17 @@ function toNextMetadata(props, config) {
|
|
|
1652
871
|
SeoReview,
|
|
1653
872
|
SeoTag,
|
|
1654
873
|
SeoVideo,
|
|
874
|
+
generateArticleSchema,
|
|
875
|
+
generateBreadcrumbSchema,
|
|
876
|
+
generateEventSchema,
|
|
877
|
+
generateFAQSchema,
|
|
878
|
+
generateLocalBusinessSchema,
|
|
879
|
+
generateOrganizationSchema,
|
|
880
|
+
generatePaginatedTitle,
|
|
881
|
+
generatePaginationLinks,
|
|
882
|
+
generateProductSchema,
|
|
883
|
+
generateVideoSchema,
|
|
884
|
+
generateWebSiteSchema,
|
|
1655
885
|
toNextMetadata,
|
|
1656
886
|
useSEOConfig
|
|
1657
887
|
});
|