Initial boiler plate project

This commit is contained in:
2024-09-24 03:52:46 +00:00
parent 6120b2d6c3
commit 154b93e267
10034 changed files with 2079352 additions and 2 deletions

View File

@ -0,0 +1,4 @@
import type { ResolvedMetadata } from '../types/metadata-interface';
export declare function AlternatesMetadata({ alternates, }: {
alternates: ResolvedMetadata['alternates'];
}): NonNullable<import("react/jsx-runtime").JSX.Element | (import("react/jsx-runtime").JSX.Element | null | undefined)[]>[] | null;

View File

@ -0,0 +1,55 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "AlternatesMetadata", {
enumerable: true,
get: function() {
return AlternatesMetadata;
}
});
const _jsxruntime = require("react/jsx-runtime");
const _react = /*#__PURE__*/ _interop_require_default(require("react"));
const _meta = require("./meta");
function _interop_require_default(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
function AlternateLink({ descriptor, ...props }) {
if (!descriptor.url) return null;
return /*#__PURE__*/ (0, _jsxruntime.jsx)("link", {
...props,
...descriptor.title && {
title: descriptor.title
},
href: descriptor.url.toString()
});
}
function AlternatesMetadata({ alternates }) {
if (!alternates) return null;
const { canonical, languages, media, types } = alternates;
return (0, _meta.MetaFilter)([
canonical ? AlternateLink({
rel: "canonical",
descriptor: canonical
}) : null,
languages ? Object.entries(languages).flatMap(([locale, descriptors])=>descriptors == null ? void 0 : descriptors.map((descriptor)=>AlternateLink({
rel: "alternate",
hrefLang: locale,
descriptor
}))) : null,
media ? Object.entries(media).flatMap(([mediaName, descriptors])=>descriptors == null ? void 0 : descriptors.map((descriptor)=>AlternateLink({
rel: "alternate",
media: mediaName,
descriptor
}))) : null,
types ? Object.entries(types).flatMap(([type, descriptors])=>descriptors == null ? void 0 : descriptors.map((descriptor)=>AlternateLink({
rel: "alternate",
type,
descriptor
}))) : null
]);
}
//# sourceMappingURL=alternate.js.map

View File

@ -0,0 +1 @@
{"version":3,"sources":["../../../../src/lib/metadata/generate/alternate.tsx"],"names":["AlternatesMetadata","AlternateLink","descriptor","props","url","link","title","href","toString","alternates","canonical","languages","media","types","MetaFilter","rel","Object","entries","flatMap","locale","descriptors","map","hrefLang","mediaName","type"],"mappings":";;;;+BAsBgBA;;;eAAAA;;;;8DAnBE;sBACS;;;;;;AAE3B,SAASC,cAAc,EACrBC,UAAU,EACV,GAAGC,OAGwC;IAC3C,IAAI,CAACD,WAAWE,GAAG,EAAE,OAAO;IAC5B,qBACE,qBAACC;QACE,GAAGF,KAAK;QACR,GAAID,WAAWI,KAAK,IAAI;YAAEA,OAAOJ,WAAWI,KAAK;QAAC,CAAC;QACpDC,MAAML,WAAWE,GAAG,CAACI,QAAQ;;AAGnC;AAEO,SAASR,mBAAmB,EACjCS,UAAU,EAGX;IACC,IAAI,CAACA,YAAY,OAAO;IAExB,MAAM,EAAEC,SAAS,EAAEC,SAAS,EAAEC,KAAK,EAAEC,KAAK,EAAE,GAAGJ;IAE/C,OAAOK,IAAAA,gBAAU,EAAC;QAChBJ,YACIT,cAAc;YAAEc,KAAK;YAAab,YAAYQ;QAAU,KACxD;QACJC,YACIK,OAAOC,OAAO,CAACN,WAAWO,OAAO,CAAC,CAAC,CAACC,QAAQC,YAAY,GACtDA,+BAAAA,YAAaC,GAAG,CAAC,CAACnB,aAChBD,cAAc;oBAAEc,KAAK;oBAAaO,UAAUH;oBAAQjB;gBAAW,OAGnE;QACJU,QACII,OAAOC,OAAO,CAACL,OAAOM,OAAO,CAAC,CAAC,CAACK,WAAWH,YAAY,GACrDA,+BAAAA,YAAaC,GAAG,CAAC,CAACnB,aAChBD,cAAc;oBAAEc,KAAK;oBAAaH,OAAOW;oBAAWrB;gBAAW,OAGnE;QACJW,QACIG,OAAOC,OAAO,CAACJ,OAAOK,OAAO,CAAC,CAAC,CAACM,MAAMJ,YAAY,GAChDA,+BAAAA,YAAaC,GAAG,CAAC,CAACnB,aAChBD,cAAc;oBAAEc,KAAK;oBAAaS;oBAAMtB;gBAAW,OAGvD;KACL;AACH"}

View File

@ -0,0 +1,23 @@
import type { ResolvedMetadata, ResolvedViewport } from '../types/metadata-interface';
import React from 'react';
export declare function ViewportMeta({ viewport }: {
viewport: ResolvedViewport;
}): React.ReactElement<any, string | React.JSXElementConstructor<any>>[];
export declare function BasicMeta({ metadata }: {
metadata: ResolvedMetadata;
}): NonNullable<import("react/jsx-runtime").JSX.Element | (import("react/jsx-runtime").JSX.Element | null)[]>[];
export declare function ItunesMeta({ itunes }: {
itunes: ResolvedMetadata['itunes'];
}): import("react/jsx-runtime").JSX.Element | null;
export declare function FacebookMeta({ facebook, }: {
facebook: ResolvedMetadata['facebook'];
}): import("react/jsx-runtime").JSX.Element[] | null;
export declare function FormatDetectionMeta({ formatDetection, }: {
formatDetection: ResolvedMetadata['formatDetection'];
}): import("react/jsx-runtime").JSX.Element | null;
export declare function AppleWebAppMeta({ appleWebApp, }: {
appleWebApp: ResolvedMetadata['appleWebApp'];
}): NonNullable<React.ReactElement<any, string | React.JSXElementConstructor<any>> | import("react/jsx-runtime").JSX.Element[]>[] | null;
export declare function VerificationMeta({ verification, }: {
verification: ResolvedMetadata['verification'];
}): NonNullable<React.ReactElement<any, string | React.JSXElementConstructor<any>> | React.ReactElement<any, string | React.JSXElementConstructor<any>>[]>[][] | null;

281
node_modules/next/dist/lib/metadata/generate/basic.js generated vendored Normal file
View File

@ -0,0 +1,281 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
0 && (module.exports = {
AppleWebAppMeta: null,
BasicMeta: null,
FacebookMeta: null,
FormatDetectionMeta: null,
ItunesMeta: null,
VerificationMeta: null,
ViewportMeta: null
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
AppleWebAppMeta: function() {
return AppleWebAppMeta;
},
BasicMeta: function() {
return BasicMeta;
},
FacebookMeta: function() {
return FacebookMeta;
},
FormatDetectionMeta: function() {
return FormatDetectionMeta;
},
ItunesMeta: function() {
return ItunesMeta;
},
VerificationMeta: function() {
return VerificationMeta;
},
ViewportMeta: function() {
return ViewportMeta;
}
});
const _jsxruntime = require("react/jsx-runtime");
const _react = /*#__PURE__*/ _interop_require_default(require("react"));
const _meta = require("./meta");
const _constants = require("../constants");
function _interop_require_default(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
// convert viewport object to string for viewport meta tag
function resolveViewportLayout(viewport) {
let resolved = null;
if (viewport && typeof viewport === "object") {
resolved = "";
for(const viewportKey_ in _constants.ViewportMetaKeys){
const viewportKey = viewportKey_;
if (viewportKey in viewport) {
let value = viewport[viewportKey];
if (typeof value === "boolean") value = value ? "yes" : "no";
if (resolved) resolved += ", ";
resolved += `${_constants.ViewportMetaKeys[viewportKey]}=${value}`;
}
}
}
return resolved;
}
function ViewportMeta({ viewport }) {
return (0, _meta.MetaFilter)([
(0, _meta.Meta)({
name: "viewport",
content: resolveViewportLayout(viewport)
}),
...viewport.themeColor ? viewport.themeColor.map((themeColor)=>(0, _meta.Meta)({
name: "theme-color",
content: themeColor.color,
media: themeColor.media
})) : [],
(0, _meta.Meta)({
name: "color-scheme",
content: viewport.colorScheme
})
]);
}
function BasicMeta({ metadata }) {
var _metadata_keywords, _metadata_robots, _metadata_robots1;
return (0, _meta.MetaFilter)([
/*#__PURE__*/ (0, _jsxruntime.jsx)("meta", {
charSet: "utf-8"
}),
metadata.title !== null && metadata.title.absolute ? /*#__PURE__*/ (0, _jsxruntime.jsx)("title", {
children: metadata.title.absolute
}) : null,
(0, _meta.Meta)({
name: "description",
content: metadata.description
}),
(0, _meta.Meta)({
name: "application-name",
content: metadata.applicationName
}),
...metadata.authors ? metadata.authors.map((author)=>[
author.url ? /*#__PURE__*/ (0, _jsxruntime.jsx)("link", {
rel: "author",
href: author.url.toString()
}) : null,
(0, _meta.Meta)({
name: "author",
content: author.name
})
]) : [],
metadata.manifest ? /*#__PURE__*/ (0, _jsxruntime.jsx)("link", {
rel: "manifest",
href: metadata.manifest.toString(),
crossOrigin: "use-credentials"
}) : null,
(0, _meta.Meta)({
name: "generator",
content: metadata.generator
}),
(0, _meta.Meta)({
name: "keywords",
content: (_metadata_keywords = metadata.keywords) == null ? void 0 : _metadata_keywords.join(",")
}),
(0, _meta.Meta)({
name: "referrer",
content: metadata.referrer
}),
(0, _meta.Meta)({
name: "creator",
content: metadata.creator
}),
(0, _meta.Meta)({
name: "publisher",
content: metadata.publisher
}),
(0, _meta.Meta)({
name: "robots",
content: (_metadata_robots = metadata.robots) == null ? void 0 : _metadata_robots.basic
}),
(0, _meta.Meta)({
name: "googlebot",
content: (_metadata_robots1 = metadata.robots) == null ? void 0 : _metadata_robots1.googleBot
}),
(0, _meta.Meta)({
name: "abstract",
content: metadata.abstract
}),
...metadata.archives ? metadata.archives.map((archive)=>/*#__PURE__*/ (0, _jsxruntime.jsx)("link", {
rel: "archives",
href: archive
})) : [],
...metadata.assets ? metadata.assets.map((asset)=>/*#__PURE__*/ (0, _jsxruntime.jsx)("link", {
rel: "assets",
href: asset
})) : [],
...metadata.bookmarks ? metadata.bookmarks.map((bookmark)=>/*#__PURE__*/ (0, _jsxruntime.jsx)("link", {
rel: "bookmarks",
href: bookmark
})) : [],
(0, _meta.Meta)({
name: "category",
content: metadata.category
}),
(0, _meta.Meta)({
name: "classification",
content: metadata.classification
}),
...metadata.other ? Object.entries(metadata.other).map(([name, content])=>{
if (Array.isArray(content)) {
return content.map((contentItem)=>(0, _meta.Meta)({
name,
content: contentItem
}));
} else {
return (0, _meta.Meta)({
name,
content
});
}
}) : []
]);
}
function ItunesMeta({ itunes }) {
if (!itunes) return null;
const { appId, appArgument } = itunes;
let content = `app-id=${appId}`;
if (appArgument) {
content += `, app-argument=${appArgument}`;
}
return /*#__PURE__*/ (0, _jsxruntime.jsx)("meta", {
name: "apple-itunes-app",
content: content
});
}
function FacebookMeta({ facebook }) {
if (!facebook) return null;
const { appId, admins } = facebook;
return (0, _meta.MetaFilter)([
appId ? /*#__PURE__*/ (0, _jsxruntime.jsx)("meta", {
property: "fb:app_id",
content: appId
}) : null,
...admins ? admins.map((admin)=>/*#__PURE__*/ (0, _jsxruntime.jsx)("meta", {
property: "fb:admins",
content: admin
})) : []
]);
}
const formatDetectionKeys = [
"telephone",
"date",
"address",
"email",
"url"
];
function FormatDetectionMeta({ formatDetection }) {
if (!formatDetection) return null;
let content = "";
for (const key of formatDetectionKeys){
if (key in formatDetection) {
if (content) content += ", ";
content += `${key}=no`;
}
}
return /*#__PURE__*/ (0, _jsxruntime.jsx)("meta", {
name: "format-detection",
content: content
});
}
function AppleWebAppMeta({ appleWebApp }) {
if (!appleWebApp) return null;
const { capable, title, startupImage, statusBarStyle } = appleWebApp;
return (0, _meta.MetaFilter)([
capable ? (0, _meta.Meta)({
name: "apple-mobile-web-app-capable",
content: "yes"
}) : null,
(0, _meta.Meta)({
name: "apple-mobile-web-app-title",
content: title
}),
startupImage ? startupImage.map((image)=>/*#__PURE__*/ (0, _jsxruntime.jsx)("link", {
href: image.url,
media: image.media,
rel: "apple-touch-startup-image"
})) : null,
statusBarStyle ? (0, _meta.Meta)({
name: "apple-mobile-web-app-status-bar-style",
content: statusBarStyle
}) : null
]);
}
function VerificationMeta({ verification }) {
if (!verification) return null;
return (0, _meta.MetaFilter)([
(0, _meta.MultiMeta)({
namePrefix: "google-site-verification",
contents: verification.google
}),
(0, _meta.MultiMeta)({
namePrefix: "y_key",
contents: verification.yahoo
}),
(0, _meta.MultiMeta)({
namePrefix: "yandex-verification",
contents: verification.yandex
}),
(0, _meta.MultiMeta)({
namePrefix: "me",
contents: verification.me
}),
...verification.other ? Object.entries(verification.other).map(([key, value])=>(0, _meta.MultiMeta)({
namePrefix: key,
contents: value
})) : []
]);
}
//# sourceMappingURL=basic.js.map

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,4 @@
import type { ResolvedMetadata } from '../types/metadata-interface';
export declare function IconsMetadata({ icons }: {
icons: ResolvedMetadata['icons'];
}): import("react/jsx-runtime").JSX.Element[][] | null;

66
node_modules/next/dist/lib/metadata/generate/icons.js generated vendored Normal file
View File

@ -0,0 +1,66 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "IconsMetadata", {
enumerable: true,
get: function() {
return IconsMetadata;
}
});
const _jsxruntime = require("react/jsx-runtime");
const _react = /*#__PURE__*/ _interop_require_default(require("react"));
const _meta = require("./meta");
function _interop_require_default(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
function IconDescriptorLink({ icon }) {
const { url, rel = "icon", ...props } = icon;
return /*#__PURE__*/ (0, _jsxruntime.jsx)("link", {
rel: rel,
href: url.toString(),
...props
});
}
function IconLink({ rel, icon }) {
if (typeof icon === "object" && !(icon instanceof URL)) {
if (!icon.rel && rel) icon.rel = rel;
return IconDescriptorLink({
icon
});
} else {
const href = icon.toString();
return /*#__PURE__*/ (0, _jsxruntime.jsx)("link", {
rel: rel,
href: href
});
}
}
function IconsMetadata({ icons }) {
if (!icons) return null;
const shortcutList = icons.shortcut;
const iconList = icons.icon;
const appleList = icons.apple;
const otherList = icons.other;
return (0, _meta.MetaFilter)([
shortcutList ? shortcutList.map((icon)=>IconLink({
rel: "shortcut icon",
icon
})) : null,
iconList ? iconList.map((icon)=>IconLink({
rel: "icon",
icon
})) : null,
appleList ? appleList.map((icon)=>IconLink({
rel: "apple-touch-icon",
icon
})) : null,
otherList ? otherList.map((icon)=>IconDescriptorLink({
icon
})) : null
]);
}
//# sourceMappingURL=icons.js.map

View File

@ -0,0 +1 @@
{"version":3,"sources":["../../../../src/lib/metadata/generate/icons.tsx"],"names":["IconsMetadata","IconDescriptorLink","icon","url","rel","props","link","href","toString","IconLink","URL","icons","shortcutList","shortcut","iconList","appleList","apple","otherList","other","MetaFilter","map"],"mappings":";;;;+BAsBgBA;;;eAAAA;;;;8DAnBE;sBACS;;;;;;AAE3B,SAASC,mBAAmB,EAAEC,IAAI,EAA4B;IAC5D,MAAM,EAAEC,GAAG,EAAEC,MAAM,MAAM,EAAE,GAAGC,OAAO,GAAGH;IAExC,qBAAO,qBAACI;QAAKF,KAAKA;QAAKG,MAAMJ,IAAIK,QAAQ;QAAK,GAAGH,KAAK;;AACxD;AAEA,SAASI,SAAS,EAAEL,GAAG,EAAEF,IAAI,EAAgC;IAC3D,IAAI,OAAOA,SAAS,YAAY,CAAEA,CAAAA,gBAAgBQ,GAAE,GAAI;QACtD,IAAI,CAACR,KAAKE,GAAG,IAAIA,KAAKF,KAAKE,GAAG,GAAGA;QACjC,OAAOH,mBAAmB;YAAEC;QAAK;IACnC,OAAO;QACL,MAAMK,OAAOL,KAAKM,QAAQ;QAC1B,qBAAO,qBAACF;YAAKF,KAAKA;YAAKG,MAAMA;;IAC/B;AACF;AAEO,SAASP,cAAc,EAAEW,KAAK,EAAwC;IAC3E,IAAI,CAACA,OAAO,OAAO;IAEnB,MAAMC,eAAeD,MAAME,QAAQ;IACnC,MAAMC,WAAWH,MAAMT,IAAI;IAC3B,MAAMa,YAAYJ,MAAMK,KAAK;IAC7B,MAAMC,YAAYN,MAAMO,KAAK;IAE7B,OAAOC,IAAAA,gBAAU,EAAC;QAChBP,eACIA,aAAaQ,GAAG,CAAC,CAAClB,OAASO,SAAS;gBAAEL,KAAK;gBAAiBF;YAAK,MACjE;QACJY,WAAWA,SAASM,GAAG,CAAC,CAAClB,OAASO,SAAS;gBAAEL,KAAK;gBAAQF;YAAK,MAAM;QACrEa,YACIA,UAAUK,GAAG,CAAC,CAAClB,OAASO,SAAS;gBAAEL,KAAK;gBAAoBF;YAAK,MACjE;QACJe,YAAYA,UAAUG,GAAG,CAAC,CAAClB,OAASD,mBAAmB;gBAAEC;YAAK,MAAM;KACrE;AACH"}

16
node_modules/next/dist/lib/metadata/generate/meta.d.ts generated vendored Normal file
View File

@ -0,0 +1,16 @@
import React from 'react';
export declare function Meta({ name, property, content, media, }: {
name?: string;
property?: string;
media?: string;
content: string | number | URL | null | undefined;
}): React.ReactElement | null;
export declare function MetaFilter<T extends {} | {}[]>(items: (T | null)[]): NonNullable<T>[];
type ExtendMetaContent = Record<string, undefined | string | URL | number | boolean | null | undefined>;
type MultiMetaContent = (ExtendMetaContent | string | URL | number)[] | null | undefined;
export declare function MultiMeta({ propertyPrefix, namePrefix, contents, }: {
propertyPrefix?: string;
namePrefix?: string;
contents?: MultiMetaContent | null;
}): NonNullable<React.ReactElement<any, string | React.JSXElementConstructor<any>> | React.ReactElement<any, string | React.JSXElementConstructor<any>>[]>[] | null;
export {};

123
node_modules/next/dist/lib/metadata/generate/meta.js generated vendored Normal file
View File

@ -0,0 +1,123 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
0 && (module.exports = {
Meta: null,
MetaFilter: null,
MultiMeta: null
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
Meta: function() {
return Meta;
},
MetaFilter: function() {
return MetaFilter;
},
MultiMeta: function() {
return MultiMeta;
}
});
const _jsxruntime = require("react/jsx-runtime");
const _react = /*#__PURE__*/ _interop_require_default(require("react"));
const _nonnullable = require("../../non-nullable");
function _interop_require_default(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
function Meta({ name, property, content, media }) {
if (typeof content !== "undefined" && content !== null && content !== "") {
return /*#__PURE__*/ (0, _jsxruntime.jsx)("meta", {
...name ? {
name
} : {
property
},
...media ? {
media
} : undefined,
content: typeof content === "string" ? content : content.toString()
});
}
return null;
}
function MetaFilter(items) {
const acc = [];
for (const item of items){
if (Array.isArray(item)) {
acc.push(...item.filter(_nonnullable.nonNullable));
} else if ((0, _nonnullable.nonNullable)(item)) {
acc.push(item);
}
}
return acc;
}
function camelToSnake(camelCaseStr) {
return camelCaseStr.replace(/([A-Z])/g, function(match) {
return "_" + match.toLowerCase();
});
}
const aliasPropPrefixes = new Set([
"og:image",
"twitter:image",
"og:video",
"og:audio"
]);
function getMetaKey(prefix, key) {
// Use `twitter:image` and `og:image` instead of `twitter:image:url` and `og:image:url`
// to be more compatible as it's a more common format.
// `og:video` & `og:audio` do not have a `:url` suffix alias
if (aliasPropPrefixes.has(prefix) && key === "url") {
return prefix;
}
if (prefix.startsWith("og:") || prefix.startsWith("twitter:")) {
key = camelToSnake(key);
}
return prefix + ":" + key;
}
function ExtendMeta({ content, namePrefix, propertyPrefix }) {
if (!content) return null;
return MetaFilter(Object.entries(content).map(([k, v])=>{
return typeof v === "undefined" ? null : Meta({
...propertyPrefix && {
property: getMetaKey(propertyPrefix, k)
},
...namePrefix && {
name: getMetaKey(namePrefix, k)
},
content: typeof v === "string" ? v : v == null ? void 0 : v.toString()
});
}));
}
function MultiMeta({ propertyPrefix, namePrefix, contents }) {
if (typeof contents === "undefined" || contents === null) {
return null;
}
return MetaFilter(contents.map((content)=>{
if (typeof content === "string" || typeof content === "number" || content instanceof URL) {
return Meta({
...propertyPrefix ? {
property: propertyPrefix
} : {
name: namePrefix
},
content
});
} else {
return ExtendMeta({
namePrefix,
propertyPrefix,
content
});
}
}));
}
//# sourceMappingURL=meta.js.map

View File

@ -0,0 +1 @@
{"version":3,"sources":["../../../../src/lib/metadata/generate/meta.tsx"],"names":["Meta","MetaFilter","MultiMeta","name","property","content","media","meta","undefined","toString","items","acc","item","Array","isArray","push","filter","nonNullable","camelToSnake","camelCaseStr","replace","match","toLowerCase","aliasPropPrefixes","Set","getMetaKey","prefix","key","has","startsWith","ExtendMeta","namePrefix","propertyPrefix","Object","entries","map","k","v","contents","URL"],"mappings":";;;;;;;;;;;;;;;;IAGgBA,IAAI;eAAJA;;IAuBAC,UAAU;eAAVA;;IAuEAC,SAAS;eAATA;;;;8DAjGE;6BACU;;;;;;AAErB,SAASF,KAAK,EACnBG,IAAI,EACJC,QAAQ,EACRC,OAAO,EACPC,KAAK,EAMN;IACC,IAAI,OAAOD,YAAY,eAAeA,YAAY,QAAQA,YAAY,IAAI;QACxE,qBACE,qBAACE;YACE,GAAIJ,OAAO;gBAAEA;YAAK,IAAI;gBAAEC;YAAS,CAAC;YAClC,GAAIE,QAAQ;gBAAEA;YAAM,IAAIE,SAAS;YAClCH,SAAS,OAAOA,YAAY,WAAWA,UAAUA,QAAQI,QAAQ;;IAGvE;IACA,OAAO;AACT;AAEO,SAASR,WACdS,KAAmB;IAEnB,MAAMC,MAAwB,EAAE;IAChC,KAAK,MAAMC,QAAQF,MAAO;QACxB,IAAIG,MAAMC,OAAO,CAACF,OAAO;YACvBD,IAAII,IAAI,IAAIH,KAAKI,MAAM,CAACC,wBAAW;QACrC,OAAO,IAAIA,IAAAA,wBAAW,EAACL,OAAO;YAC5BD,IAAII,IAAI,CAACH;QACX;IACF;IACA,OAAOD;AACT;AAWA,SAASO,aAAaC,YAAoB;IACxC,OAAOA,aAAaC,OAAO,CAAC,YAAY,SAAUC,KAAK;QACrD,OAAO,MAAMA,MAAMC,WAAW;IAChC;AACF;AAEA,MAAMC,oBAAoB,IAAIC,IAAI;IAChC;IACA;IACA;IACA;CACD;AACD,SAASC,WAAWC,MAAc,EAAEC,GAAW;IAC7C,uFAAuF;IACvF,sDAAsD;IACtD,4DAA4D;IAC5D,IAAIJ,kBAAkBK,GAAG,CAACF,WAAWC,QAAQ,OAAO;QAClD,OAAOD;IACT;IACA,IAAIA,OAAOG,UAAU,CAAC,UAAUH,OAAOG,UAAU,CAAC,aAAa;QAC7DF,MAAMT,aAAaS;IACrB;IACA,OAAOD,SAAS,MAAMC;AACxB;AAEA,SAASG,WAAW,EAClBzB,OAAO,EACP0B,UAAU,EACVC,cAAc,EAKf;IACC,IAAI,CAAC3B,SAAS,OAAO;IACrB,OAAOJ,WACLgC,OAAOC,OAAO,CAAC7B,SAAS8B,GAAG,CAAC,CAAC,CAACC,GAAGC,EAAE;QACjC,OAAO,OAAOA,MAAM,cAChB,OACArC,KAAK;YACH,GAAIgC,kBAAkB;gBAAE5B,UAAUqB,WAAWO,gBAAgBI;YAAG,CAAC;YACjE,GAAIL,cAAc;gBAAE5B,MAAMsB,WAAWM,YAAYK;YAAG,CAAC;YACrD/B,SAAS,OAAOgC,MAAM,WAAWA,IAAIA,qBAAAA,EAAG5B,QAAQ;QAClD;IACN;AAEJ;AAEO,SAASP,UAAU,EACxB8B,cAAc,EACdD,UAAU,EACVO,QAAQ,EAKT;IACC,IAAI,OAAOA,aAAa,eAAeA,aAAa,MAAM;QACxD,OAAO;IACT;IAEA,OAAOrC,WACLqC,SAASH,GAAG,CAAC,CAAC9B;QACZ,IACE,OAAOA,YAAY,YACnB,OAAOA,YAAY,YACnBA,mBAAmBkC,KACnB;YACA,OAAOvC,KAAK;gBACV,GAAIgC,iBACA;oBAAE5B,UAAU4B;gBAAe,IAC3B;oBAAE7B,MAAM4B;gBAAW,CAAC;gBACxB1B;YACF;QACF,OAAO;YACL,OAAOyB,WAAW;gBAChBC;gBACAC;gBACA3B;YACF;QACF;IACF;AAEJ"}

View File

@ -0,0 +1,11 @@
/// <reference types="react" />
import type { ResolvedMetadata } from '../types/metadata-interface';
export declare function OpenGraphMetadata({ openGraph, }: {
openGraph: ResolvedMetadata['openGraph'];
}): NonNullable<import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | NonNullable<import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>[]>[]>[] | null;
export declare function TwitterMetadata({ twitter, }: {
twitter: ResolvedMetadata['twitter'];
}): NonNullable<import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | (import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | null)[] | NonNullable<import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>[]>[]>[] | null;
export declare function AppLinksMeta({ appLinks, }: {
appLinks: ResolvedMetadata['appLinks'];
}): NonNullable<import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>[]>[][] | null;

View File

@ -0,0 +1,474 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
0 && (module.exports = {
AppLinksMeta: null,
OpenGraphMetadata: null,
TwitterMetadata: null
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
AppLinksMeta: function() {
return AppLinksMeta;
},
OpenGraphMetadata: function() {
return OpenGraphMetadata;
},
TwitterMetadata: function() {
return TwitterMetadata;
}
});
const _meta = require("./meta");
function OpenGraphMetadata({ openGraph }) {
var _openGraph_title, _openGraph_url, _openGraph_ttl;
if (!openGraph) {
return null;
}
let typedOpenGraph;
if ("type" in openGraph) {
const openGraphType = openGraph.type;
switch(openGraphType){
case "website":
typedOpenGraph = [
(0, _meta.Meta)({
property: "og:type",
content: "website"
})
];
break;
case "article":
var _openGraph_publishedTime, _openGraph_modifiedTime, _openGraph_expirationTime;
typedOpenGraph = [
(0, _meta.Meta)({
property: "og:type",
content: "article"
}),
(0, _meta.Meta)({
property: "article:published_time",
content: (_openGraph_publishedTime = openGraph.publishedTime) == null ? void 0 : _openGraph_publishedTime.toString()
}),
(0, _meta.Meta)({
property: "article:modified_time",
content: (_openGraph_modifiedTime = openGraph.modifiedTime) == null ? void 0 : _openGraph_modifiedTime.toString()
}),
(0, _meta.Meta)({
property: "article:expiration_time",
content: (_openGraph_expirationTime = openGraph.expirationTime) == null ? void 0 : _openGraph_expirationTime.toString()
}),
(0, _meta.MultiMeta)({
propertyPrefix: "article:author",
contents: openGraph.authors
}),
(0, _meta.Meta)({
property: "article:section",
content: openGraph.section
}),
(0, _meta.MultiMeta)({
propertyPrefix: "article:tag",
contents: openGraph.tags
})
];
break;
case "book":
typedOpenGraph = [
(0, _meta.Meta)({
property: "og:type",
content: "book"
}),
(0, _meta.Meta)({
property: "book:isbn",
content: openGraph.isbn
}),
(0, _meta.Meta)({
property: "book:release_date",
content: openGraph.releaseDate
}),
(0, _meta.MultiMeta)({
propertyPrefix: "book:author",
contents: openGraph.authors
}),
(0, _meta.MultiMeta)({
propertyPrefix: "book:tag",
contents: openGraph.tags
})
];
break;
case "profile":
typedOpenGraph = [
(0, _meta.Meta)({
property: "og:type",
content: "profile"
}),
(0, _meta.Meta)({
property: "profile:first_name",
content: openGraph.firstName
}),
(0, _meta.Meta)({
property: "profile:last_name",
content: openGraph.lastName
}),
(0, _meta.Meta)({
property: "profile:username",
content: openGraph.username
}),
(0, _meta.Meta)({
property: "profile:gender",
content: openGraph.gender
})
];
break;
case "music.song":
var _openGraph_duration;
typedOpenGraph = [
(0, _meta.Meta)({
property: "og:type",
content: "music.song"
}),
(0, _meta.Meta)({
property: "music:duration",
content: (_openGraph_duration = openGraph.duration) == null ? void 0 : _openGraph_duration.toString()
}),
(0, _meta.MultiMeta)({
propertyPrefix: "music:album",
contents: openGraph.albums
}),
(0, _meta.MultiMeta)({
propertyPrefix: "music:musician",
contents: openGraph.musicians
})
];
break;
case "music.album":
typedOpenGraph = [
(0, _meta.Meta)({
property: "og:type",
content: "music.album"
}),
(0, _meta.MultiMeta)({
propertyPrefix: "music:song",
contents: openGraph.songs
}),
(0, _meta.MultiMeta)({
propertyPrefix: "music:musician",
contents: openGraph.musicians
}),
(0, _meta.Meta)({
property: "music:release_date",
content: openGraph.releaseDate
})
];
break;
case "music.playlist":
typedOpenGraph = [
(0, _meta.Meta)({
property: "og:type",
content: "music.playlist"
}),
(0, _meta.MultiMeta)({
propertyPrefix: "music:song",
contents: openGraph.songs
}),
(0, _meta.MultiMeta)({
propertyPrefix: "music:creator",
contents: openGraph.creators
})
];
break;
case "music.radio_station":
typedOpenGraph = [
(0, _meta.Meta)({
property: "og:type",
content: "music.radio_station"
}),
(0, _meta.MultiMeta)({
propertyPrefix: "music:creator",
contents: openGraph.creators
})
];
break;
case "video.movie":
typedOpenGraph = [
(0, _meta.Meta)({
property: "og:type",
content: "video.movie"
}),
(0, _meta.MultiMeta)({
propertyPrefix: "video:actor",
contents: openGraph.actors
}),
(0, _meta.MultiMeta)({
propertyPrefix: "video:director",
contents: openGraph.directors
}),
(0, _meta.MultiMeta)({
propertyPrefix: "video:writer",
contents: openGraph.writers
}),
(0, _meta.Meta)({
property: "video:duration",
content: openGraph.duration
}),
(0, _meta.Meta)({
property: "video:release_date",
content: openGraph.releaseDate
}),
(0, _meta.MultiMeta)({
propertyPrefix: "video:tag",
contents: openGraph.tags
})
];
break;
case "video.episode":
typedOpenGraph = [
(0, _meta.Meta)({
property: "og:type",
content: "video.episode"
}),
(0, _meta.MultiMeta)({
propertyPrefix: "video:actor",
contents: openGraph.actors
}),
(0, _meta.MultiMeta)({
propertyPrefix: "video:director",
contents: openGraph.directors
}),
(0, _meta.MultiMeta)({
propertyPrefix: "video:writer",
contents: openGraph.writers
}),
(0, _meta.Meta)({
property: "video:duration",
content: openGraph.duration
}),
(0, _meta.Meta)({
property: "video:release_date",
content: openGraph.releaseDate
}),
(0, _meta.MultiMeta)({
propertyPrefix: "video:tag",
contents: openGraph.tags
}),
(0, _meta.Meta)({
property: "video:series",
content: openGraph.series
})
];
break;
case "video.tv_show":
typedOpenGraph = [
(0, _meta.Meta)({
property: "og:type",
content: "video.tv_show"
})
];
break;
case "video.other":
typedOpenGraph = [
(0, _meta.Meta)({
property: "og:type",
content: "video.other"
})
];
break;
default:
const _exhaustiveCheck = openGraphType;
throw new Error(`Invalid OpenGraph type: ${_exhaustiveCheck}`);
}
}
return (0, _meta.MetaFilter)([
(0, _meta.Meta)({
property: "og:determiner",
content: openGraph.determiner
}),
(0, _meta.Meta)({
property: "og:title",
content: (_openGraph_title = openGraph.title) == null ? void 0 : _openGraph_title.absolute
}),
(0, _meta.Meta)({
property: "og:description",
content: openGraph.description
}),
(0, _meta.Meta)({
property: "og:url",
content: (_openGraph_url = openGraph.url) == null ? void 0 : _openGraph_url.toString()
}),
(0, _meta.Meta)({
property: "og:site_name",
content: openGraph.siteName
}),
(0, _meta.Meta)({
property: "og:locale",
content: openGraph.locale
}),
(0, _meta.Meta)({
property: "og:country_name",
content: openGraph.countryName
}),
(0, _meta.Meta)({
property: "og:ttl",
content: (_openGraph_ttl = openGraph.ttl) == null ? void 0 : _openGraph_ttl.toString()
}),
(0, _meta.MultiMeta)({
propertyPrefix: "og:image",
contents: openGraph.images
}),
(0, _meta.MultiMeta)({
propertyPrefix: "og:video",
contents: openGraph.videos
}),
(0, _meta.MultiMeta)({
propertyPrefix: "og:audio",
contents: openGraph.audio
}),
(0, _meta.MultiMeta)({
propertyPrefix: "og:email",
contents: openGraph.emails
}),
(0, _meta.MultiMeta)({
propertyPrefix: "og:phone_number",
contents: openGraph.phoneNumbers
}),
(0, _meta.MultiMeta)({
propertyPrefix: "og:fax_number",
contents: openGraph.faxNumbers
}),
(0, _meta.MultiMeta)({
propertyPrefix: "og:locale:alternate",
contents: openGraph.alternateLocale
}),
...typedOpenGraph ? typedOpenGraph : []
]);
}
function TwitterAppItem({ app, type }) {
var _app_url_type, _app_url;
return [
(0, _meta.Meta)({
name: `twitter:app:name:${type}`,
content: app.name
}),
(0, _meta.Meta)({
name: `twitter:app:id:${type}`,
content: app.id[type]
}),
(0, _meta.Meta)({
name: `twitter:app:url:${type}`,
content: (_app_url = app.url) == null ? void 0 : (_app_url_type = _app_url[type]) == null ? void 0 : _app_url_type.toString()
})
];
}
function TwitterMetadata({ twitter }) {
var _twitter_title;
if (!twitter) return null;
const { card } = twitter;
return (0, _meta.MetaFilter)([
(0, _meta.Meta)({
name: "twitter:card",
content: card
}),
(0, _meta.Meta)({
name: "twitter:site",
content: twitter.site
}),
(0, _meta.Meta)({
name: "twitter:site:id",
content: twitter.siteId
}),
(0, _meta.Meta)({
name: "twitter:creator",
content: twitter.creator
}),
(0, _meta.Meta)({
name: "twitter:creator:id",
content: twitter.creatorId
}),
(0, _meta.Meta)({
name: "twitter:title",
content: (_twitter_title = twitter.title) == null ? void 0 : _twitter_title.absolute
}),
(0, _meta.Meta)({
name: "twitter:description",
content: twitter.description
}),
(0, _meta.MultiMeta)({
namePrefix: "twitter:image",
contents: twitter.images
}),
...card === "player" ? twitter.players.flatMap((player)=>[
(0, _meta.Meta)({
name: "twitter:player",
content: player.playerUrl.toString()
}),
(0, _meta.Meta)({
name: "twitter:player:stream",
content: player.streamUrl.toString()
}),
(0, _meta.Meta)({
name: "twitter:player:width",
content: player.width
}),
(0, _meta.Meta)({
name: "twitter:player:height",
content: player.height
})
]) : [],
...card === "app" ? [
TwitterAppItem({
app: twitter.app,
type: "iphone"
}),
TwitterAppItem({
app: twitter.app,
type: "ipad"
}),
TwitterAppItem({
app: twitter.app,
type: "googleplay"
})
] : []
]);
}
function AppLinksMeta({ appLinks }) {
if (!appLinks) return null;
return (0, _meta.MetaFilter)([
(0, _meta.MultiMeta)({
propertyPrefix: "al:ios",
contents: appLinks.ios
}),
(0, _meta.MultiMeta)({
propertyPrefix: "al:iphone",
contents: appLinks.iphone
}),
(0, _meta.MultiMeta)({
propertyPrefix: "al:ipad",
contents: appLinks.ipad
}),
(0, _meta.MultiMeta)({
propertyPrefix: "al:android",
contents: appLinks.android
}),
(0, _meta.MultiMeta)({
propertyPrefix: "al:windows_phone",
contents: appLinks.windows_phone
}),
(0, _meta.MultiMeta)({
propertyPrefix: "al:windows",
contents: appLinks.windows
}),
(0, _meta.MultiMeta)({
propertyPrefix: "al:windows_universal",
contents: appLinks.windows_universal
}),
(0, _meta.MultiMeta)({
propertyPrefix: "al:web",
contents: appLinks.web
})
]);
}
//# sourceMappingURL=opengraph.js.map

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,3 @@
declare function resolveArray<T>(value: T | T[]): T[];
declare function resolveAsArrayOrUndefined<T>(value: T | T[] | undefined | null): T extends undefined | null ? undefined : T[];
export { resolveAsArrayOrUndefined, resolveArray };

38
node_modules/next/dist/lib/metadata/generate/utils.js generated vendored Normal file
View File

@ -0,0 +1,38 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
0 && (module.exports = {
resolveArray: null,
resolveAsArrayOrUndefined: null
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
resolveArray: function() {
return resolveArray;
},
resolveAsArrayOrUndefined: function() {
return resolveAsArrayOrUndefined;
}
});
function resolveArray(value) {
if (Array.isArray(value)) {
return value;
}
return [
value
];
}
function resolveAsArrayOrUndefined(value) {
if (typeof value === "undefined" || value === null) {
return undefined;
}
return resolveArray(value);
}
//# sourceMappingURL=utils.js.map

View File

@ -0,0 +1 @@
{"version":3,"sources":["../../../../src/lib/metadata/generate/utils.ts"],"names":["resolveArray","resolveAsArrayOrUndefined","value","Array","isArray","undefined"],"mappings":";;;;;;;;;;;;;;;IAgBoCA,YAAY;eAAZA;;IAA3BC,yBAAyB;eAAzBA;;;AAhBT,SAASD,aAAgBE,KAAc;IACrC,IAAIC,MAAMC,OAAO,CAACF,QAAQ;QACxB,OAAOA;IACT;IACA,OAAO;QAACA;KAAM;AAChB;AAEA,SAASD,0BACPC,KAAiC;IAEjC,IAAI,OAAOA,UAAU,eAAeA,UAAU,MAAM;QAClD,OAAOG;IACT;IACA,OAAOL,aAAaE;AACtB"}