.
This commit is contained in:
+18
@@ -0,0 +1,18 @@
|
||||
'use client';
|
||||
import { jsx as _jsx } from "react/jsx-runtime";
|
||||
// This is a client component that only renders during SSR,
|
||||
// but will be replaced during streaming with an icon insertion script tag.
|
||||
// We don't want it to be presented anywhere so it's only visible during streaming,
|
||||
// right after the icon meta tags so that browser can pick it up as soon as it's rendered.
|
||||
// Note: we don't just emit the script here because we only need the script if it's not in the head,
|
||||
// and we need it to be hoistable alongside the other metadata but sync scripts are not hoistable.
|
||||
export const IconMark = ()=>{
|
||||
if (typeof window !== 'undefined') {
|
||||
return null;
|
||||
}
|
||||
return /*#__PURE__*/ _jsx("meta", {
|
||||
name: "\xabnxt-icon\xbb"
|
||||
});
|
||||
};
|
||||
|
||||
//# sourceMappingURL=icon-mark.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../../../src/lib/metadata/generate/icon-mark.tsx"],"sourcesContent":["'use client'\n\n// This is a client component that only renders during SSR,\n// but will be replaced during streaming with an icon insertion script tag.\n// We don't want it to be presented anywhere so it's only visible during streaming,\n// right after the icon meta tags so that browser can pick it up as soon as it's rendered.\n// Note: we don't just emit the script here because we only need the script if it's not in the head,\n// and we need it to be hoistable alongside the other metadata but sync scripts are not hoistable.\nexport const IconMark = () => {\n if (typeof window !== 'undefined') {\n return null\n }\n return <meta name=\"«nxt-icon»\" />\n}\n"],"names":["IconMark","window","meta","name"],"mappings":"AAAA;;AAEA,2DAA2D;AAC3D,2EAA2E;AAC3E,mFAAmF;AACnF,0FAA0F;AAC1F,oGAAoG;AACpG,kGAAkG;AAClG,OAAO,MAAMA,WAAW;IACtB,IAAI,OAAOC,WAAW,aAAa;QACjC,OAAO;IACT;IACA,qBAAO,KAACC;QAAKC,MAAK;;AACpB,EAAC","ignoreList":[0]}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
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);
|
||||
}
|
||||
function getOrigin(url) {
|
||||
let origin = undefined;
|
||||
if (typeof url === 'string') {
|
||||
try {
|
||||
url = new URL(url);
|
||||
origin = url.origin;
|
||||
} catch {}
|
||||
}
|
||||
return origin;
|
||||
}
|
||||
export { resolveAsArrayOrUndefined, resolveArray, getOrigin };
|
||||
|
||||
//# sourceMappingURL=utils.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../../../src/lib/metadata/generate/utils.ts"],"sourcesContent":["function resolveArray<T>(value: T | T[]): T[] {\n if (Array.isArray(value)) {\n return value as any\n }\n return [value] as any\n}\n\nfunction resolveAsArrayOrUndefined<T>(\n value: T | T[] | undefined | null\n): T extends undefined | null ? undefined : T[] {\n if (typeof value === 'undefined' || value === null) {\n return undefined as any\n }\n return resolveArray(value) as any\n}\n\nfunction getOrigin(url: string | URL): string | undefined {\n let origin = undefined\n if (typeof url === 'string') {\n try {\n url = new URL(url)\n origin = url.origin\n } catch {}\n }\n return origin\n}\n\nexport { resolveAsArrayOrUndefined, resolveArray, getOrigin }\n"],"names":["resolveArray","value","Array","isArray","resolveAsArrayOrUndefined","undefined","getOrigin","url","origin","URL"],"mappings":"AAAA,SAASA,aAAgBC,KAAc;IACrC,IAAIC,MAAMC,OAAO,CAACF,QAAQ;QACxB,OAAOA;IACT;IACA,OAAO;QAACA;KAAM;AAChB;AAEA,SAASG,0BACPH,KAAiC;IAEjC,IAAI,OAAOA,UAAU,eAAeA,UAAU,MAAM;QAClD,OAAOI;IACT;IACA,OAAOL,aAAaC;AACtB;AAEA,SAASK,UAAUC,GAAiB;IAClC,IAAIC,SAASH;IACb,IAAI,OAAOE,QAAQ,UAAU;QAC3B,IAAI;YACFA,MAAM,IAAIE,IAAIF;YACdC,SAASD,IAAIC,MAAM;QACrB,EAAE,OAAM,CAAC;IACX;IACA,OAAOA;AACT;AAEA,SAASJ,yBAAyB,EAAEJ,YAAY,EAAEM,SAAS,GAAE","ignoreList":[0]}
|
||||
Reference in New Issue
Block a user