inital commit

This commit is contained in:
2026-01-01 15:25:19 +05:30
commit f0ae49465a
36361 changed files with 4894111 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
import { _ as _tagged_template_literal_loose } from "@swc/helpers/_/_tagged_template_literal_loose";
function _templateObject() {
const data = _tagged_template_literal_loose([
"\n /* latin-ext */\n @font-face {\n font-family: '__nextjs-Geist';\n font-style: normal;\n font-weight: 400 600;\n font-display: swap;\n src: url(/__nextjs_font/geist-latin-ext.woff2) format('woff2');\n unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7,\n U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F,\n U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,\n U+A720-A7FF;\n }\n /* latin-ext */\n @font-face {\n font-family: '__nextjs-Geist Mono';\n font-style: normal;\n font-weight: 400 600;\n font-display: swap;\n src: url(/__nextjs_font/geist-mono-latin-ext.woff2) format('woff2');\n unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7,\n U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F,\n U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,\n U+A720-A7FF;\n }\n /* latin */\n @font-face {\n font-family: '__nextjs-Geist';\n font-style: normal;\n font-weight: 400 600;\n font-display: swap;\n src: url(/__nextjs_font/geist-latin.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,\n U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,\n U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n }\n /* latin */\n @font-face {\n font-family: '__nextjs-Geist Mono';\n font-style: normal;\n font-weight: 400 600;\n font-display: swap;\n src: url(/__nextjs_font/geist-mono-latin.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,\n U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,\n U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n }\n "
]);
_templateObject = function() {
return data;
};
return data;
}
import { css } from '../utils/css';
import { useInsertionEffect } from 'react';
export const FontStyles = ()=>{
useInsertionEffect(()=>{
const style = document.createElement('style');
style.textContent = css(_templateObject());
document.head.appendChild(style);
return ()=>{
document.head.removeChild(style);
};
}, []);
return null;
};
//# sourceMappingURL=font-styles.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../src/client/components/react-dev-overlay/font/font-styles.tsx"],"sourcesContent":["import { css } from '../utils/css'\nimport { useInsertionEffect } from 'react'\n\nexport const FontStyles = () => {\n useInsertionEffect(() => {\n const style = document.createElement('style')\n style.textContent = css`\n /* latin-ext */\n @font-face {\n font-family: '__nextjs-Geist';\n font-style: normal;\n font-weight: 400 600;\n font-display: swap;\n src: url(/__nextjs_font/geist-latin-ext.woff2) format('woff2');\n unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7,\n U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F,\n U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,\n U+A720-A7FF;\n }\n /* latin-ext */\n @font-face {\n font-family: '__nextjs-Geist Mono';\n font-style: normal;\n font-weight: 400 600;\n font-display: swap;\n src: url(/__nextjs_font/geist-mono-latin-ext.woff2) format('woff2');\n unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7,\n U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F,\n U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,\n U+A720-A7FF;\n }\n /* latin */\n @font-face {\n font-family: '__nextjs-Geist';\n font-style: normal;\n font-weight: 400 600;\n font-display: swap;\n src: url(/__nextjs_font/geist-latin.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,\n U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,\n U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n }\n /* latin */\n @font-face {\n font-family: '__nextjs-Geist Mono';\n font-style: normal;\n font-weight: 400 600;\n font-display: swap;\n src: url(/__nextjs_font/geist-mono-latin.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,\n U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,\n U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n }\n `\n document.head.appendChild(style)\n\n return () => {\n document.head.removeChild(style)\n }\n }, [])\n\n return null\n}\n"],"names":["css","useInsertionEffect","FontStyles","style","document","createElement","textContent","head","appendChild","removeChild"],"mappings":";;;;;;;;;;AAAA,SAASA,GAAG,QAAQ,eAAc;AAClC,SAASC,kBAAkB,QAAQ,QAAO;AAE1C,OAAO,MAAMC,aAAa;IACxBD,mBAAmB;QACjB,MAAME,QAAQC,SAASC,aAAa,CAAC;QACrCF,MAAMG,WAAW,GAAGN;QAgDpBI,SAASG,IAAI,CAACC,WAAW,CAACL;QAE1B,OAAO;YACLC,SAASG,IAAI,CAACE,WAAW,CAACN;QAC5B;IACF,GAAG,EAAE;IAEL,OAAO;AACT,EAAC"}

View File

@@ -0,0 +1,54 @@
import path from 'path';
import * as fs from 'fs/promises';
import { constants } from 'fs';
import * as Log from '../../../../build/output/log';
import { middlewareResponse } from '../server/middleware-response';
const FONT_PREFIX = '/__nextjs_font/';
const VALID_FONTS = [
'geist-latin-ext.woff2',
'geist-mono-latin-ext.woff2',
'geist-latin.woff2',
'geist-mono-latin.woff2'
];
const FONT_HEADERS = {
'Content-Type': 'font/woff2',
'Cache-Control': 'public, max-age=31536000, immutable'
};
export function getDevOverlayFontMiddleware() {
return async function devOverlayFontMiddleware(req, res, next) {
try {
const { pathname } = new URL("http://n" + req.url);
if (!pathname.startsWith(FONT_PREFIX)) {
return next();
}
const fontFile = pathname.replace(FONT_PREFIX, '');
if (!VALID_FONTS.includes(fontFile)) {
return middlewareResponse.notFound(res);
}
const fontPath = path.resolve(__dirname, fontFile);
const fileExists = await checkFileExists(fontPath);
if (!fileExists) {
return middlewareResponse.notFound(res);
}
const fontData = await fs.readFile(fontPath);
Object.entries(FONT_HEADERS).forEach((param)=>{
let [key, value] = param;
res.setHeader(key, value);
});
res.end(fontData);
} catch (err) {
Log.error('Failed to serve font:', err instanceof Error ? err.message : err);
return middlewareResponse.internalServerError(res);
}
};
}
async function checkFileExists(filePath) {
try {
await fs.access(filePath, constants.F_OK);
return true;
} catch (e) {
return false;
}
}
//# sourceMappingURL=get-dev-overlay-font-middleware.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../src/client/components/react-dev-overlay/font/get-dev-overlay-font-middleware.ts"],"sourcesContent":["import type { ServerResponse, IncomingMessage } from 'http'\nimport path from 'path'\nimport * as fs from 'fs/promises'\nimport { constants } from 'fs'\nimport * as Log from '../../../../build/output/log'\nimport { middlewareResponse } from '../server/middleware-response'\n\nconst FONT_PREFIX = '/__nextjs_font/'\n\nconst VALID_FONTS = [\n 'geist-latin-ext.woff2',\n 'geist-mono-latin-ext.woff2',\n 'geist-latin.woff2',\n 'geist-mono-latin.woff2',\n]\n\nconst FONT_HEADERS = {\n 'Content-Type': 'font/woff2',\n 'Cache-Control': 'public, max-age=31536000, immutable',\n} as const\n\nexport function getDevOverlayFontMiddleware() {\n return async function devOverlayFontMiddleware(\n req: IncomingMessage,\n res: ServerResponse,\n next: () => void\n ): Promise<void> {\n try {\n const { pathname } = new URL(`http://n${req.url}`)\n\n if (!pathname.startsWith(FONT_PREFIX)) {\n return next()\n }\n\n const fontFile = pathname.replace(FONT_PREFIX, '')\n if (!VALID_FONTS.includes(fontFile)) {\n return middlewareResponse.notFound(res)\n }\n\n const fontPath = path.resolve(__dirname, fontFile)\n const fileExists = await checkFileExists(fontPath)\n\n if (!fileExists) {\n return middlewareResponse.notFound(res)\n }\n\n const fontData = await fs.readFile(fontPath)\n Object.entries(FONT_HEADERS).forEach(([key, value]) => {\n res.setHeader(key, value)\n })\n res.end(fontData)\n } catch (err) {\n Log.error(\n 'Failed to serve font:',\n err instanceof Error ? err.message : err\n )\n return middlewareResponse.internalServerError(res)\n }\n }\n}\n\nasync function checkFileExists(filePath: string): Promise<boolean> {\n try {\n await fs.access(filePath, constants.F_OK)\n return true\n } catch {\n return false\n }\n}\n"],"names":["path","fs","constants","Log","middlewareResponse","FONT_PREFIX","VALID_FONTS","FONT_HEADERS","getDevOverlayFontMiddleware","devOverlayFontMiddleware","req","res","next","pathname","URL","url","startsWith","fontFile","replace","includes","notFound","fontPath","resolve","__dirname","fileExists","checkFileExists","fontData","readFile","Object","entries","forEach","key","value","setHeader","end","err","error","Error","message","internalServerError","filePath","access","F_OK"],"mappings":"AACA,OAAOA,UAAU,OAAM;AACvB,YAAYC,QAAQ,cAAa;AACjC,SAASC,SAAS,QAAQ,KAAI;AAC9B,YAAYC,SAAS,+BAA8B;AACnD,SAASC,kBAAkB,QAAQ,gCAA+B;AAElE,MAAMC,cAAc;AAEpB,MAAMC,cAAc;IAClB;IACA;IACA;IACA;CACD;AAED,MAAMC,eAAe;IACnB,gBAAgB;IAChB,iBAAiB;AACnB;AAEA,OAAO,SAASC;IACd,OAAO,eAAeC,yBACpBC,GAAoB,EACpBC,GAAmB,EACnBC,IAAgB;QAEhB,IAAI;YACF,MAAM,EAAEC,QAAQ,EAAE,GAAG,IAAIC,IAAI,AAAC,aAAUJ,IAAIK,GAAG;YAE/C,IAAI,CAACF,SAASG,UAAU,CAACX,cAAc;gBACrC,OAAOO;YACT;YAEA,MAAMK,WAAWJ,SAASK,OAAO,CAACb,aAAa;YAC/C,IAAI,CAAC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