2 Commits

Author SHA1 Message Date
DanielS
8c990b9628 add build action config 2026-06-22 21:12:46 +02:00
DanielS
ba24ee33e6 Fix invoice PDF table style, my-customers page dynamic rendering, add Supabase client import, disable cacheComponents
Files changed: 6 (7 insertions, 9 deletions)
2026-06-22 21:08:20 +02:00
733 changed files with 25612 additions and 9 deletions

View File

@@ -0,0 +1,18 @@
name: Production Build
on:
push:
branches:
- productive
jobs:
build:
runs-on: webserver
steps:
- name: Code auschecken
uses: actions/checkout@v4
- name: Abhängigkeiten installieren
run: npm install
- name: Production-Build generieren
run: npm run build

View File

@@ -0,0 +1,18 @@
name: Staging Build
on:
push:
branches:
- staging
jobs:
build:
runs-on: webserver
steps:
- name: Code auschecken
uses: actions/checkout@v4
- name: Abhängigkeiten installieren
run: npm install
- name: Staging-Build generieren
run: npm run build -- --configuration=staging

BIN
build-artifact.zip Normal file

Binary file not shown.

View File

@@ -0,0 +1 @@
czEjVggXDRFH51IopN6_9

View File

@@ -0,0 +1,28 @@
{
"/_global-error/page": "/_global-error",
"/_not-found/page": "/_not-found",
"/admin/categories/page": "/admin/categories",
"/admin/orders/page": "/admin/orders",
"/admin/page": "/admin",
"/admin/products/page": "/admin/products",
"/admin/users/page": "/admin/users",
"/api/admin/recent-orders/route": "/api/admin/recent-orders",
"/auth/confirm/route": "/auth/confirm",
"/auth/error/page": "/auth/error",
"/auth/forgot-password/page": "/auth/forgot-password",
"/auth/login/page": "/auth/login",
"/auth/sign-up-success/page": "/auth/sign-up-success",
"/auth/sign-up/page": "/auth/sign-up",
"/auth/update-password/page": "/auth/update-password",
"/favicon.ico/route": "/favicon.ico",
"/my-customers/[id]/page": "/my-customers/[id]",
"/my-customers/new/page": "/my-customers/new",
"/my-customers/page": "/my-customers",
"/my-orders/page": "/my-orders",
"/opengraph-image.png/route": "/opengraph-image.png",
"/order/page": "/order",
"/order/success/page": "/order/success",
"/page": "/",
"/protected/page": "/protected",
"/twitter-image.png/route": "/twitter-image.png"
}

View File

@@ -0,0 +1,23 @@
{
"pages": {
"/_app": []
},
"devFiles": [],
"polyfillFiles": [
"static/chunks/03~yq9q893hmn.js"
],
"lowPriorityFiles": [
"static/czEjVggXDRFH51IopN6_9/_buildManifest.js",
"static/czEjVggXDRFH51IopN6_9/_ssgManifest.js",
"static/czEjVggXDRFH51IopN6_9/_clientMiddlewareManifest.js"
],
"rootMainFiles": [
"static/chunks/0ze4gu236oq96.js",
"static/chunks/10qd__0r7a~.l.js",
"static/chunks/0-gaanm6h49z~.js",
"static/chunks/06c8h6921f-oo.js",
"static/chunks/15jasrm2107sy.js",
"static/chunks/181uojwh.t2ik.js",
"static/chunks/turbopack-0u.mb44r17v0_.js"
]
}

View File

@@ -0,0 +1,207 @@
module.exports = [
"[externals]/path [external] (path, cjs)", ((__turbopack_context__, module, exports) => {
const mod = __turbopack_context__.x("path", () => require("path"));
module.exports = mod;
}),
"[externals]/url [external] (url, cjs)", ((__turbopack_context__, module, exports) => {
const mod = __turbopack_context__.x("url", () => require("url"));
module.exports = mod;
}),
"[externals]/fs [external] (fs, cjs)", ((__turbopack_context__, module, exports) => {
const mod = __turbopack_context__.x("fs", () => require("fs"));
module.exports = mod;
}),
"[project]/postcss.config.mjs [postcss] (ecmascript)", ((__turbopack_context__) => {
"use strict";
__turbopack_context__.s([
"default",
()=>__TURBOPACK__default__export__
]);
/** @type {import('postcss-load-config').Config} */ const config = {
plugins: {
tailwindcss: {},
autoprefixer: {}
}
};
const __TURBOPACK__default__export__ = config;
}),
"[turbopack-node]/transforms/transforms.ts [postcss] (ecmascript)", ((__turbopack_context__) => {
"use strict";
/**
* Shared utilities for our 2 transform implementations.
*/ __turbopack_context__.s([
"fromPath",
()=>fromPath,
"getReadEnvVariables",
()=>getReadEnvVariables,
"toPath",
()=>toPath
]);
var __TURBOPACK__imported__module__$5b$externals$5d2f$path__$5b$external$5d$__$28$path$2c$__cjs$29$__ = __turbopack_context__.i("[externals]/path [external] (path, cjs)");
;
const contextDir = process.cwd();
const toPath = (file)=>{
const relPath = (0, __TURBOPACK__imported__module__$5b$externals$5d2f$path__$5b$external$5d$__$28$path$2c$__cjs$29$__["relative"])(contextDir, file);
if ((0, __TURBOPACK__imported__module__$5b$externals$5d2f$path__$5b$external$5d$__$28$path$2c$__cjs$29$__["isAbsolute"])(relPath)) {
throw new Error(`Cannot depend on path (${file}) outside of root directory (${contextDir})`);
}
return __TURBOPACK__imported__module__$5b$externals$5d2f$path__$5b$external$5d$__$28$path$2c$__cjs$29$__["sep"] !== '/' ? relPath.replaceAll(__TURBOPACK__imported__module__$5b$externals$5d2f$path__$5b$external$5d$__$28$path$2c$__cjs$29$__["sep"], '/') : relPath;
};
const fromPath = (path)=>{
return (0, __TURBOPACK__imported__module__$5b$externals$5d2f$path__$5b$external$5d$__$28$path$2c$__cjs$29$__["join"])(/* turbopackIgnore: true */ contextDir, __TURBOPACK__imported__module__$5b$externals$5d2f$path__$5b$external$5d$__$28$path$2c$__cjs$29$__["sep"] !== '/' ? path.replaceAll('/', __TURBOPACK__imported__module__$5b$externals$5d2f$path__$5b$external$5d$__$28$path$2c$__cjs$29$__["sep"]) : path);
};
// Patch process.env to track which env vars are read
const originalEnv = process.env;
const readEnvVars = new Set();
process.env = new Proxy(originalEnv, {
get (target, prop) {
if (typeof prop === 'string') {
// We register the env var as dependency on the
// current transform and all future transforms
// since the env var might be cached in module scope
// and influence them all
readEnvVars.add(prop);
}
return Reflect.get(target, prop);
},
set (target, prop, value) {
return Reflect.set(target, prop, value);
}
});
function getReadEnvVariables() {
return Array.from(readEnvVars);
}
}),
"[turbopack-node]/transforms/postcss.ts { CONFIG => \"[project]/postcss.config.mjs [postcss] (ecmascript)\" } [postcss] (ecmascript)", ((__turbopack_context__) => {
"use strict";
__turbopack_context__.s([
"default",
()=>transform,
"init",
()=>init
]);
// @ts-ignore
var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$postcss$2f$lib$2f$postcss$2e$mjs__$5b$postcss$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/postcss/lib/postcss.mjs [postcss] (ecmascript)");
// @ts-ignore
var __TURBOPACK__imported__module__$5b$project$5d2f$postcss$2e$config$2e$mjs__$5b$postcss$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/postcss.config.mjs [postcss] (ecmascript)");
var __TURBOPACK__imported__module__$5b$turbopack$2d$node$5d2f$transforms$2f$transforms$2e$ts__$5b$postcss$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[turbopack-node]/transforms/transforms.ts [postcss] (ecmascript)");
;
;
;
let processor;
const init = async (ipc)=>{
let config = __TURBOPACK__imported__module__$5b$project$5d2f$postcss$2e$config$2e$mjs__$5b$postcss$5d$__$28$ecmascript$29$__["default"];
if (typeof config === 'function') {
config = await config({
env: 'development'
});
}
if (typeof config === 'undefined') {
throw new Error('PostCSS config is undefined (make sure to export an function or object from config file)');
}
let plugins;
if (Array.isArray(config.plugins)) {
plugins = config.plugins.map((plugin)=>{
if (Array.isArray(plugin)) {
return plugin;
} else if (typeof plugin === 'string') {
return [
plugin,
{}
];
} else {
return plugin;
}
});
} else if (typeof config.plugins === 'object') {
plugins = Object.entries(config.plugins).filter(([, options])=>options);
} else {
plugins = [];
}
const loadedPlugins = plugins.map((plugin)=>{
if (Array.isArray(plugin)) {
const [arg, options] = plugin;
let pluginFactory = arg;
if (typeof pluginFactory === 'string') {
pluginFactory = require(/* turbopackIgnore: true */ pluginFactory);
}
if (pluginFactory.default) {
pluginFactory = pluginFactory.default;
}
return pluginFactory(options);
}
return plugin;
});
processor = (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$postcss$2f$lib$2f$postcss$2e$mjs__$5b$postcss$5d$__$28$ecmascript$29$__["default"])(loadedPlugins);
};
async function transform(ipc, cssContent, name, sourceMap) {
const { css, map, messages } = await processor.process(cssContent, {
from: name,
to: name,
map: sourceMap ? {
inline: false,
annotation: false
} : undefined
});
const assets = [];
const filePaths = [];
const buildFilePaths = [];
const directories = [];
for (const msg of messages){
switch(msg.type){
case 'asset':
assets.push({
file: msg.file,
content: msg.content,
sourceMap: !sourceMap ? undefined : typeof msg.sourceMap === 'string' ? msg.sourceMap : JSON.stringify(msg.sourceMap)
});
break;
case 'dependency':
case 'missing-dependency':
filePaths.push((0, __TURBOPACK__imported__module__$5b$turbopack$2d$node$5d2f$transforms$2f$transforms$2e$ts__$5b$postcss$5d$__$28$ecmascript$29$__["toPath"])(msg.file));
break;
case 'build-dependency':
buildFilePaths.push((0, __TURBOPACK__imported__module__$5b$turbopack$2d$node$5d2f$transforms$2f$transforms$2e$ts__$5b$postcss$5d$__$28$ecmascript$29$__["toPath"])(msg.file));
break;
case 'dir-dependency':
directories.push([
(0, __TURBOPACK__imported__module__$5b$turbopack$2d$node$5d2f$transforms$2f$transforms$2e$ts__$5b$postcss$5d$__$28$ecmascript$29$__["toPath"])(msg.dir),
msg.glob
]);
break;
case 'context-dependency':
directories.push([
(0, __TURBOPACK__imported__module__$5b$turbopack$2d$node$5d2f$transforms$2f$transforms$2e$ts__$5b$postcss$5d$__$28$ecmascript$29$__["toPath"])(msg.dir),
'**'
]);
break;
default:
break;
}
}
ipc.sendInfo({
type: 'dependencies',
filePaths,
directories,
buildFilePaths,
envVariables: (0, __TURBOPACK__imported__module__$5b$turbopack$2d$node$5d2f$transforms$2f$transforms$2e$ts__$5b$postcss$5d$__$28$ecmascript$29$__["getReadEnvVariables"])()
});
return {
css,
map: sourceMap ? JSON.stringify(map) : undefined,
assets
};
}
}),
];
//# sourceMappingURL=%5Broot-of-the-server%5D__0d-m0h0._.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,500 @@
module.exports = [
"[turbopack-node]/child_process/globals.ts [postcss] (ecmascript)", ((__turbopack_context__, module, exports) => {
// @ts-ignore
process.turbopack = {};
}),
"[externals]/node:net [external] (node:net, cjs)", ((__turbopack_context__, module, exports) => {
const mod = __turbopack_context__.x("node:net", () => require("node:net"));
module.exports = mod;
}),
"[externals]/node:stream [external] (node:stream, cjs)", ((__turbopack_context__, module, exports) => {
const mod = __turbopack_context__.x("node:stream", () => require("node:stream"));
module.exports = mod;
}),
"[turbopack-node]/compiled/stacktrace-parser/index.js [postcss] (ecmascript)", ((__turbopack_context__) => {
"use strict";
__turbopack_context__.s([
"parse",
()=>parse
]);
if (typeof __nccwpck_require__ !== "undefined") __nccwpck_require__.ab = ("TURBOPACK compile-time value", "/ROOT/compiled/stacktrace-parser") + "/";
var n = "<unknown>";
function parse(e) {
var r = e.split("\n");
return r.reduce(function(e, r) {
var n = parseChrome(r) || parseWinjs(r) || parseGecko(r) || parseNode(r) || parseJSC(r);
if (n) {
e.push(n);
}
return e;
}, []);
}
var a = /^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack|<anonymous>|\/|[a-z]:\\|\\\\).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i;
var l = /\((\S*)(?::(\d+))(?::(\d+))\)/;
function parseChrome(e) {
var r = a.exec(e);
if (!r) {
return null;
}
var u = r[2] && r[2].indexOf("native") === 0;
var t = r[2] && r[2].indexOf("eval") === 0;
var i = l.exec(r[2]);
if (t && i != null) {
r[2] = i[1];
r[3] = i[2];
r[4] = i[3];
}
return {
file: !u ? r[2] : null,
methodName: r[1] || n,
arguments: u ? [
r[2]
] : [],
lineNumber: r[3] ? +r[3] : null,
column: r[4] ? +r[4] : null
};
}
var u = /^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;
function parseWinjs(e) {
var r = u.exec(e);
if (!r) {
return null;
}
return {
file: r[2],
methodName: r[1] || n,
arguments: [],
lineNumber: +r[3],
column: r[4] ? +r[4] : null
};
}
var t = /^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i;
var i = /(\S+) line (\d+)(?: > eval line \d+)* > eval/i;
function parseGecko(e) {
var r = t.exec(e);
if (!r) {
return null;
}
var a = r[3] && r[3].indexOf(" > eval") > -1;
var l = i.exec(r[3]);
if (a && l != null) {
r[3] = l[1];
r[4] = l[2];
r[5] = null;
}
return {
file: r[3],
methodName: r[1] || n,
arguments: r[2] ? r[2].split(",") : [],
lineNumber: r[4] ? +r[4] : null,
column: r[5] ? +r[5] : null
};
}
var s = /^\s*(?:([^@]*)(?:\((.*?)\))?@)?(\S.*?):(\d+)(?::(\d+))?\s*$/i;
function parseJSC(e) {
var r = s.exec(e);
if (!r) {
return null;
}
return {
file: r[3],
methodName: r[1] || n,
arguments: [],
lineNumber: +r[4],
column: r[5] ? +r[5] : null
};
}
var o = /^\s*at (?:((?:\[object object\])?[^\\/]+(?: \[as \S+\])?) )?\(?(.*?):(\d+)(?::(\d+))?\)?\s*$/i;
function parseNode(e) {
var r = o.exec(e);
if (!r) {
return null;
}
return {
file: r[2],
methodName: r[1] || n,
arguments: [],
lineNumber: +r[3],
column: r[4] ? +r[4] : null
};
}
}),
"[turbopack-node]/error.ts [postcss] (ecmascript)", ((__turbopack_context__) => {
"use strict";
__turbopack_context__.s([
"default",
()=>isError,
"getProperError",
()=>getProperError,
"structuredError",
()=>structuredError
]);
var __TURBOPACK__imported__module__$5b$turbopack$2d$node$5d2f$compiled$2f$stacktrace$2d$parser$2f$index$2e$js__$5b$postcss$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[turbopack-node]/compiled/stacktrace-parser/index.js [postcss] (ecmascript)");
;
function isError(err) {
return typeof err === 'object' && err !== null && 'name' in err && 'message' in err;
}
function getProperError(err) {
if (isError(err)) {
return err;
}
if ("TURBOPACK compile-time falsy", 0) //TURBOPACK unreachable
;
return new Error(isPlainObject(err) ? JSON.stringify(err) : err + '');
}
function getObjectClassLabel(value) {
return Object.prototype.toString.call(value);
}
function isPlainObject(value) {
if (getObjectClassLabel(value) !== '[object Object]') {
return false;
}
const prototype = Object.getPrototypeOf(value);
/**
* this used to be previously:
*
* `return prototype === null || prototype === Object.prototype`
*
* but Edge Runtime expose Object from vm, being that kind of type-checking wrongly fail.
*
* It was changed to the current implementation since it's resilient to serialization.
*/ return prototype === null || prototype.hasOwnProperty('isPrototypeOf');
}
function structuredError(e) {
e = getProperError(e);
return {
name: e.name,
message: e.message,
stack: typeof e.stack === 'string' ? (0, __TURBOPACK__imported__module__$5b$turbopack$2d$node$5d2f$compiled$2f$stacktrace$2d$parser$2f$index$2e$js__$5b$postcss$5d$__$28$ecmascript$29$__["parse"])(e.stack) : [],
cause: e.cause ? structuredError(getProperError(e.cause)) : undefined
};
}
}),
"[turbopack-node]/child_process/index.ts [postcss] (ecmascript)", ((__turbopack_context__) => {
"use strict";
__turbopack_context__.s([
"IPC",
()=>IPC
]);
var __TURBOPACK__imported__module__$5b$externals$5d2f$node$3a$net__$5b$external$5d$__$28$node$3a$net$2c$__cjs$29$__ = __turbopack_context__.i("[externals]/node:net [external] (node:net, cjs)");
var __TURBOPACK__imported__module__$5b$externals$5d2f$node$3a$stream__$5b$external$5d$__$28$node$3a$stream$2c$__cjs$29$__ = __turbopack_context__.i("[externals]/node:stream [external] (node:stream, cjs)");
var __TURBOPACK__imported__module__$5b$turbopack$2d$node$5d2f$error$2e$ts__$5b$postcss$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[turbopack-node]/error.ts [postcss] (ecmascript)");
;
;
;
function createIpc(port) {
const socket = (0, __TURBOPACK__imported__module__$5b$externals$5d2f$node$3a$net__$5b$external$5d$__$28$node$3a$net$2c$__cjs$29$__["createConnection"])({
port,
host: '127.0.0.1'
});
/**
* A writable stream that writes to the socket.
* We don't write directly to the socket because we need to
* handle backpressure and wait for the socket to be drained
* before writing more data.
*/ const socketWritable = new __TURBOPACK__imported__module__$5b$externals$5d2f$node$3a$stream__$5b$external$5d$__$28$node$3a$stream$2c$__cjs$29$__["Writable"]({
write (chunk, _enc, cb) {
if (socket.write(chunk)) {
cb();
} else {
socket.once('drain', cb);
}
},
final (cb) {
socket.end(cb);
}
});
const packetQueue = [];
const recvPromiseResolveQueue = [];
function pushPacket(packet) {
const recvPromiseResolve = recvPromiseResolveQueue.shift();
if (recvPromiseResolve != null) {
recvPromiseResolve(JSON.parse(packet.toString('utf8')));
} else {
packetQueue.push(packet);
}
}
let state = {
type: 'waiting'
};
let buffer = Buffer.alloc(0);
socket.once('connect', ()=>{
socket.setNoDelay(true);
socket.on('data', (chunk)=>{
buffer = Buffer.concat([
buffer,
chunk
]);
loop: while(true){
switch(state.type){
case 'waiting':
{
if (buffer.length >= 4) {
const length = buffer.readUInt32BE(0);
buffer = buffer.subarray(4);
state = {
type: 'packet',
length
};
} else {
break loop;
}
break;
}
case 'packet':
{
if (buffer.length >= state.length) {
const packet = buffer.subarray(0, state.length);
buffer = buffer.subarray(state.length);
state = {
type: 'waiting'
};
pushPacket(packet);
} else {
break loop;
}
break;
}
default:
invariant(state, (state)=>`Unknown state type: ${state?.type}`);
}
}
});
});
// When the socket is closed, this process is no longer needed.
// This might happen e. g. when parent process is killed or
// node.js pool is garbage collected.
socket.once('close', ()=>{
process.exit(0);
});
// TODO(lukesandberg): some of the messages being sent are very large and contain lots
// of redundant information. Consider adding gzip compression to our stream.
function doSend(message) {
return new Promise((resolve, reject)=>{
// Reserve 4 bytes for our length prefix, we will over-write after encoding.
const packet = Buffer.from('0000' + message, 'utf8');
packet.writeUInt32BE(packet.length - 4, 0);
socketWritable.write(packet, (err)=>{
process.stderr.write(`TURBOPACK_OUTPUT_D\n`);
process.stdout.write(`TURBOPACK_OUTPUT_D\n`);
if (err != null) {
reject(err);
} else {
resolve();
}
});
});
}
function send(message) {
return doSend(JSON.stringify(message));
}
function sendReady() {
return doSend('');
}
return {
async recv () {
const packet = packetQueue.shift();
if (packet != null) {
return JSON.parse(packet.toString('utf8'));
}
const result = await new Promise((resolve)=>{
recvPromiseResolveQueue.push((result)=>{
resolve(result);
});
});
return result;
},
send (message) {
return send(message);
},
sendReady,
async sendError (error) {
let failed = false;
try {
await send({
type: 'error',
...(0, __TURBOPACK__imported__module__$5b$turbopack$2d$node$5d2f$error$2e$ts__$5b$postcss$5d$__$28$ecmascript$29$__["structuredError"])(error)
});
} catch (err) {
// There's nothing we can do about errors that happen after this point, we can't tell anyone
// about them.
console.error('failed to send error back to rust:', err);
failed = true;
}
await new Promise((res)=>socket.end(()=>res()));
process.exit(failed ? 1 : 0);
}
};
}
const PORT = process.argv[2];
const IPC = createIpc(parseInt(PORT, 10));
process.on('uncaughtException', (err)=>{
IPC.sendError(err);
});
process.on('unhandledRejection', (reason)=>{
IPC.sendError(reason instanceof Error ? reason : new Error(String(reason)));
});
const improveConsole = (name, stream, addStack)=>{
// @ts-ignore
const original = console[name];
// @ts-ignore
const stdio = process[stream];
// @ts-ignore
console[name] = (...args)=>{
stdio.write(`TURBOPACK_OUTPUT_B\n`);
original(...args);
if (addStack) {
const stack = new Error().stack?.replace(/^.+\n.+\n/, '') + '\n';
stdio.write('TURBOPACK_OUTPUT_S\n');
stdio.write(stack);
}
stdio.write('TURBOPACK_OUTPUT_E\n');
};
};
improveConsole('error', 'stderr', true);
improveConsole('warn', 'stderr', true);
improveConsole('count', 'stdout', true);
improveConsole('trace', 'stderr', false);
improveConsole('log', 'stdout', true);
improveConsole('group', 'stdout', true);
improveConsole('groupCollapsed', 'stdout', true);
improveConsole('table', 'stdout', true);
improveConsole('debug', 'stdout', true);
improveConsole('info', 'stdout', true);
improveConsole('dir', 'stdout', true);
improveConsole('dirxml', 'stdout', true);
improveConsole('timeEnd', 'stdout', true);
improveConsole('timeLog', 'stdout', true);
improveConsole('timeStamp', 'stdout', true);
improveConsole('assert', 'stderr', true);
/**
* Utility function to ensure all variants of an enum are handled.
*/ function invariant(never, computeMessage) {
throw new Error(`Invariant: ${computeMessage(never)}`);
}
}),
"[turbopack-node]/child_process/evaluate.ts [postcss] (ecmascript)", ((__turbopack_context__) => {
"use strict";
__turbopack_context__.s([
"run",
()=>run
]);
var __TURBOPACK__imported__module__$5b$turbopack$2d$node$5d2f$child_process$2f$index$2e$ts__$5b$postcss$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[turbopack-node]/child_process/index.ts [postcss] (ecmascript)");
;
const ipc = __TURBOPACK__imported__module__$5b$turbopack$2d$node$5d2f$child_process$2f$index$2e$ts__$5b$postcss$5d$__$28$ecmascript$29$__["IPC"];
const queue = [];
const run = async (moduleFactory)=>{
let nextId = 1;
const requests = new Map();
const internalIpc = {
sendInfo: (message)=>ipc.send({
type: 'info',
data: message
}),
sendRequest: (message)=>{
const id = nextId++;
let resolve, reject;
const promise = new Promise((res, rej)=>{
resolve = res;
reject = rej;
});
requests.set(id, {
resolve,
reject
});
return ipc.send({
type: 'request',
id,
data: message
}).then(()=>promise);
},
sendError: (error)=>{
return ipc.sendError(error);
}
};
// Initialize module and send ready message
let getValue;
try {
const module = await moduleFactory();
if (typeof module.init === 'function') {
await module.init();
}
getValue = module.default;
await ipc.sendReady();
} catch (err) {
await ipc.sendReady();
await ipc.sendError(err);
}
// Queue handling
let isRunning = false;
const run = async ()=>{
while(queue.length > 0){
const args = queue.shift();
try {
const value = await getValue(internalIpc, ...args);
await ipc.send({
type: 'end',
data: value === undefined ? undefined : JSON.stringify(value, null, 2),
duration: 0
});
} catch (e) {
await ipc.sendError(e);
}
}
isRunning = false;
};
// Communication handling
while(true){
const msg = await ipc.recv();
switch(msg.type){
case 'evaluate':
{
queue.push(msg.args);
if (!isRunning) {
isRunning = true;
run();
}
break;
}
case 'result':
{
const request = requests.get(msg.id);
if (request) {
requests.delete(msg.id);
if (msg.error) {
request.reject(new Error(msg.error));
} else {
request.resolve(msg.data);
}
}
break;
}
default:
{
console.error('unexpected message type', msg.type);
process.exit(1);
}
}
}
};
}),
"[turbopack-node]/child_process/evaluate.ts/evaluate.js { INNER => \"[turbopack-node]/transforms/postcss.ts { CONFIG => \\\"[project]/postcss.config.mjs [postcss] (ecmascript)\\\" } [postcss] (ecmascript)\", RUNTIME => \"[turbopack-node]/child_process/evaluate.ts [postcss] (ecmascript)\" } [postcss] (ecmascript)", ((__turbopack_context__) => {
"use strict";
__turbopack_context__.s([]);
var __TURBOPACK__imported__module__$5b$turbopack$2d$node$5d2f$child_process$2f$evaluate$2e$ts__$5b$postcss$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[turbopack-node]/child_process/evaluate.ts [postcss] (ecmascript)");
;
(0, __TURBOPACK__imported__module__$5b$turbopack$2d$node$5d2f$child_process$2f$evaluate$2e$ts__$5b$postcss$5d$__$28$ecmascript$29$__["run"])(()=>__turbopack_context__.A('[turbopack-node]/transforms/postcss.ts { CONFIG => "[project]/postcss.config.mjs [postcss] (ecmascript)" } [postcss] (ecmascript, async loader)'));
}),
];
//# sourceMappingURL=%5Broot-of-the-server%5D__0ubbtyl._.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,13 @@
module.exports = [
"[turbopack-node]/transforms/postcss.ts { CONFIG => \"[project]/postcss.config.mjs [postcss] (ecmascript)\" } [postcss] (ecmascript, async loader)", ((__turbopack_context__) => {
__turbopack_context__.v((parentImport) => {
return Promise.all([
"chunks/node_modules_13sb.px._.js",
"chunks/[root-of-the-server]__0d-m0h0._.js"
].map((chunk) => __turbopack_context__.l(chunk))).then(() => {
return parentImport("[turbopack-node]/transforms/postcss.ts { CONFIG => \"[project]/postcss.config.mjs [postcss] (ecmascript)\" } [postcss] (ecmascript)");
});
});
}),
];

View File

@@ -0,0 +1,5 @@
{
"version": 3,
"sources": [],
"sections": []
}

View File

@@ -0,0 +1,890 @@
const RUNTIME_PUBLIC_PATH = "chunks/[turbopack]_runtime.js";
const RELATIVE_ROOT_PATH = "..";
const ASSET_PREFIX = "/";
const WORKER_FORWARDED_GLOBALS = [];
/**
* This file contains runtime types and functions that are shared between all
* TurboPack ECMAScript runtimes.
*
* It will be prepended to the runtime code of each runtime.
*/ /* eslint-disable @typescript-eslint/no-unused-vars */ /// <reference path="./runtime-types.d.ts" />
/**
* Describes why a module was instantiated.
* Shared between browser and Node.js runtimes.
*/ var SourceType = /*#__PURE__*/ function(SourceType) {
/**
* The module was instantiated because it was included in an evaluated chunk's
* runtime.
* SourceData is a ChunkPath.
*/ SourceType[SourceType["Runtime"] = 0] = "Runtime";
/**
* The module was instantiated because a parent module imported it.
* SourceData is a ModuleId.
*/ SourceType[SourceType["Parent"] = 1] = "Parent";
/**
* The module was instantiated because it was included in a chunk's hot module
* update.
* SourceData is an array of ModuleIds or undefined.
*/ SourceType[SourceType["Update"] = 2] = "Update";
return SourceType;
}(SourceType || {});
/**
* Flag indicating which module object type to create when a module is merged. Set to `true`
* by each runtime that uses ModuleWithDirection (browser dev-base.ts, nodejs dev-base.ts,
* nodejs build-base.ts). Browser production (build-base.ts) leaves it as `false` since it
* uses plain Module objects.
*/ let createModuleWithDirectionFlag = false;
const REEXPORTED_OBJECTS = new WeakMap();
/**
* Constructs the `__turbopack_context__` object for a module.
*/ function Context(module, exports) {
this.m = module;
// We need to store this here instead of accessing it from the module object to:
// 1. Make it available to factories directly, since we rewrite `this` to
// `__turbopack_context__.e` in CJS modules.
// 2. Support async modules which rewrite `module.exports` to a promise, so we
// can still access the original exports object from functions like
// `esmExport`
// Ideally we could find a new approach for async modules and drop this property altogether.
this.e = exports;
}
const contextPrototype = Context.prototype;
const hasOwnProperty = Object.prototype.hasOwnProperty;
const toStringTag = typeof Symbol !== 'undefined' && Symbol.toStringTag;
function defineProp(obj, name, options) {
if (!hasOwnProperty.call(obj, name)) Object.defineProperty(obj, name, options);
}
function getOverwrittenModule(moduleCache, id) {
let module = moduleCache[id];
if (!module) {
if (createModuleWithDirectionFlag) {
// set in development modes for hmr support
module = createModuleWithDirection(id);
} else {
module = createModuleObject(id);
}
moduleCache[id] = module;
}
return module;
}
/**
* Creates the module object. Only done here to ensure all module objects have the same shape.
*/ function createModuleObject(id) {
return {
exports: {},
error: undefined,
id,
namespaceObject: undefined
};
}
function createModuleWithDirection(id) {
return {
exports: {},
error: undefined,
id,
namespaceObject: undefined,
parents: [],
children: []
};
}
const BindingTag_Value = 0;
/**
* Adds the getters to the exports object.
*/ function esm(exports, bindings) {
defineProp(exports, '__esModule', {
value: true
});
if (toStringTag) defineProp(exports, toStringTag, {
value: 'Module'
});
let i = 0;
while(i < bindings.length){
const propName = bindings[i++];
const tagOrFunction = bindings[i++];
if (typeof tagOrFunction === 'number') {
if (tagOrFunction === BindingTag_Value) {
defineProp(exports, propName, {
value: bindings[i++],
enumerable: true,
writable: false
});
} else {
throw new Error(`unexpected tag: ${tagOrFunction}`);
}
} else {
const getterFn = tagOrFunction;
if (typeof bindings[i] === 'function') {
const setterFn = bindings[i++];
defineProp(exports, propName, {
get: getterFn,
set: setterFn,
enumerable: true
});
} else {
defineProp(exports, propName, {
get: getterFn,
enumerable: true
});
}
}
}
Object.seal(exports);
}
/**
* Makes the module an ESM with exports
*/ function esmExport(bindings, id) {
let module;
let exports;
if (id != null) {
module = getOverwrittenModule(this.c, id);
exports = module.exports;
} else {
module = this.m;
exports = this.e;
}
module.namespaceObject = exports;
esm(exports, bindings);
}
contextPrototype.s = esmExport;
function ensureDynamicExports(module, exports) {
let reexportedObjects = REEXPORTED_OBJECTS.get(module);
if (!reexportedObjects) {
REEXPORTED_OBJECTS.set(module, reexportedObjects = []);
module.exports = module.namespaceObject = new Proxy(exports, {
get (target, prop) {
if (hasOwnProperty.call(target, prop) || prop === 'default' || prop === '__esModule') {
return Reflect.get(target, prop);
}
for (const obj of reexportedObjects){
const value = Reflect.get(obj, prop);
if (value !== undefined) return value;
}
return undefined;
},
ownKeys (target) {
const keys = Reflect.ownKeys(target);
for (const obj of reexportedObjects){
for (const key of Reflect.ownKeys(obj)){
if (key !== 'default' && !keys.includes(key)) keys.push(key);
}
}
return keys;
}
});
}
return reexportedObjects;
}
/**
* Dynamically exports properties from an object
*/ function dynamicExport(object, id) {
let module;
let exports;
if (id != null) {
module = getOverwrittenModule(this.c, id);
exports = module.exports;
} else {
module = this.m;
exports = this.e;
}
const reexportedObjects = ensureDynamicExports(module, exports);
if (typeof object === 'object' && object !== null) {
reexportedObjects.push(object);
}
}
contextPrototype.j = dynamicExport;
function exportValue(value, id) {
let module;
if (id != null) {
module = getOverwrittenModule(this.c, id);
} else {
module = this.m;
}
module.exports = value;
}
contextPrototype.v = exportValue;
function exportNamespace(namespace, id) {
let module;
if (id != null) {
module = getOverwrittenModule(this.c, id);
} else {
module = this.m;
}
module.exports = module.namespaceObject = namespace;
}
contextPrototype.n = exportNamespace;
function createGetter(obj, key) {
return ()=>obj[key];
}
/**
* @returns prototype of the object
*/ const getProto = Object.getPrototypeOf ? (obj)=>Object.getPrototypeOf(obj) : (obj)=>obj.__proto__;
/** Prototypes that are not expanded for exports */ const LEAF_PROTOTYPES = [
null,
getProto({}),
getProto([]),
getProto(getProto)
];
/**
* @param raw
* @param ns
* @param allowExportDefault
* * `false`: will have the raw module as default export
* * `true`: will have the default property as default export
*/ function interopEsm(raw, ns, allowExportDefault) {
const bindings = [];
let defaultLocation = -1;
for(let current = raw; (typeof current === 'object' || typeof current === 'function') && !LEAF_PROTOTYPES.includes(current); current = getProto(current)){
for (const key of Object.getOwnPropertyNames(current)){
bindings.push(key, createGetter(raw, key));
if (defaultLocation === -1 && key === 'default') {
defaultLocation = bindings.length - 1;
}
}
}
// this is not really correct
// we should set the `default` getter if the imported module is a `.cjs file`
if (!(allowExportDefault && defaultLocation >= 0)) {
// Replace the binding with one for the namespace itself in order to preserve iteration order.
if (defaultLocation >= 0) {
// Replace the getter with the value
bindings.splice(defaultLocation, 1, BindingTag_Value, raw);
} else {
bindings.push('default', BindingTag_Value, raw);
}
}
esm(ns, bindings);
return ns;
}
function createNS(raw) {
if (typeof raw === 'function') {
return function(...args) {
return raw.apply(this, args);
};
} else {
return Object.create(null);
}
}
function esmImport(id) {
const module = getOrInstantiateModuleFromParent(id, this.m);
// any ES module has to have `module.namespaceObject` defined.
if (module.namespaceObject) return module.namespaceObject;
// only ESM can be an async module, so we don't need to worry about exports being a promise here.
const raw = module.exports;
return module.namespaceObject = interopEsm(raw, createNS(raw), raw && raw.__esModule);
}
contextPrototype.i = esmImport;
function asyncLoader(moduleId) {
const loader = this.r(moduleId);
return loader(esmImport.bind(this));
}
contextPrototype.A = asyncLoader;
// Add a simple runtime require so that environments without one can still pass
// `typeof require` CommonJS checks so that exports are correctly registered.
const runtimeRequire = // @ts-ignore
typeof require === 'function' ? require : function require1() {
throw new Error('Unexpected use of runtime require');
};
contextPrototype.t = runtimeRequire;
function commonJsRequire(id) {
return getOrInstantiateModuleFromParent(id, this.m).exports;
}
contextPrototype.r = commonJsRequire;
/**
* Remove fragments and query parameters since they are never part of the context map keys
*
* This matches how we parse patterns at resolving time. Arguably we should only do this for
* strings passed to `import` but the resolve does it for `import` and `require` and so we do
* here as well.
*/ function parseRequest(request) {
// Per the URI spec fragments can contain `?` characters, so we should trim it off first
// https://datatracker.ietf.org/doc/html/rfc3986#section-3.5
const hashIndex = request.indexOf('#');
if (hashIndex !== -1) {
request = request.substring(0, hashIndex);
}
const queryIndex = request.indexOf('?');
if (queryIndex !== -1) {
request = request.substring(0, queryIndex);
}
return request;
}
/**
* `require.context` and require/import expression runtime.
*/ function moduleContext(map) {
function moduleContext(id) {
id = parseRequest(id);
if (hasOwnProperty.call(map, id)) {
return map[id].module();
}
const e = new Error(`Cannot find module '${id}'`);
e.code = 'MODULE_NOT_FOUND';
throw e;
}
moduleContext.keys = ()=>{
return Object.keys(map);
};
moduleContext.resolve = (id)=>{
id = parseRequest(id);
if (hasOwnProperty.call(map, id)) {
return map[id].id();
}
const e = new Error(`Cannot find module '${id}'`);
e.code = 'MODULE_NOT_FOUND';
throw e;
};
moduleContext.import = async (id)=>{
return await moduleContext(id);
};
return moduleContext;
}
contextPrototype.f = moduleContext;
/**
* Returns the path of a chunk defined by its data.
*/ function getChunkPath(chunkData) {
return typeof chunkData === 'string' ? chunkData : chunkData.path;
}
function isPromise(maybePromise) {
return maybePromise != null && typeof maybePromise === 'object' && 'then' in maybePromise && typeof maybePromise.then === 'function';
}
function isAsyncModuleExt(obj) {
return turbopackQueues in obj;
}
function createPromise() {
let resolve;
let reject;
const promise = new Promise((res, rej)=>{
reject = rej;
resolve = res;
});
return {
promise,
resolve: resolve,
reject: reject
};
}
// Load the CompressedmoduleFactories of a chunk into the `moduleFactories` Map.
// The CompressedModuleFactories format is
// - 1 or more module ids
// - a module factory function
// So walking this is a little complex but the flat structure is also fast to
// traverse, we can use `typeof` operators to distinguish the two cases.
function installCompressedModuleFactories(chunkModules, offset, moduleFactories, newModuleId) {
let i = offset;
while(i < chunkModules.length){
let end = i + 1;
// Find our factory function
while(end < chunkModules.length && typeof chunkModules[end] !== 'function'){
end++;
}
if (end === chunkModules.length) {
throw new Error('malformed chunk format, expected a factory function');
}
// Install the factory for each module ID that doesn't already have one.
// When some IDs in this group already have a factory, reuse that existing
// group factory for the missing IDs to keep all IDs in the group consistent.
// Otherwise, install the factory from this chunk.
const moduleFactoryFn = chunkModules[end];
let existingGroupFactory = undefined;
for(let j = i; j < end; j++){
const id = chunkModules[j];
const existingFactory = moduleFactories.get(id);
if (existingFactory) {
existingGroupFactory = existingFactory;
break;
}
}
const factoryToInstall = existingGroupFactory ?? moduleFactoryFn;
let didInstallFactory = false;
for(let j = i; j < end; j++){
const id = chunkModules[j];
if (!moduleFactories.has(id)) {
if (!didInstallFactory) {
if (factoryToInstall === moduleFactoryFn) {
applyModuleFactoryName(moduleFactoryFn);
}
didInstallFactory = true;
}
moduleFactories.set(id, factoryToInstall);
newModuleId?.(id);
}
}
i = end + 1; // end is pointing at the last factory advance to the next id or the end of the array.
}
}
// everything below is adapted from webpack
// https://github.com/webpack/webpack/blob/6be4065ade1e252c1d8dcba4af0f43e32af1bdc1/lib/runtime/AsyncModuleRuntimeModule.js#L13
const turbopackQueues = Symbol('turbopack queues');
const turbopackExports = Symbol('turbopack exports');
const turbopackError = Symbol('turbopack error');
function resolveQueue(queue) {
if (queue && queue.status !== 1) {
queue.status = 1;
queue.forEach((fn)=>fn.queueCount--);
queue.forEach((fn)=>fn.queueCount-- ? fn.queueCount++ : fn());
}
}
function wrapDeps(deps) {
return deps.map((dep)=>{
if (dep !== null && typeof dep === 'object') {
if (isAsyncModuleExt(dep)) return dep;
if (isPromise(dep)) {
const queue = Object.assign([], {
status: 0
});
const obj = {
[turbopackExports]: {},
[turbopackQueues]: (fn)=>fn(queue)
};
dep.then((res)=>{
obj[turbopackExports] = res;
resolveQueue(queue);
}, (err)=>{
obj[turbopackError] = err;
resolveQueue(queue);
});
return obj;
}
}
return {
[turbopackExports]: dep,
[turbopackQueues]: ()=>{}
};
});
}
function asyncModule(body, hasAwait) {
const module = this.m;
const queue = hasAwait ? Object.assign([], {
status: -1
}) : undefined;
const depQueues = new Set();
const { resolve, reject, promise: rawPromise } = createPromise();
const promise = Object.assign(rawPromise, {
[turbopackExports]: module.exports,
[turbopackQueues]: (fn)=>{
queue && fn(queue);
depQueues.forEach(fn);
promise['catch'](()=>{});
}
});
const attributes = {
get () {
return promise;
},
set (v) {
// Calling `esmExport` leads to this.
if (v !== promise) {
promise[turbopackExports] = v;
}
}
};
Object.defineProperty(module, 'exports', attributes);
Object.defineProperty(module, 'namespaceObject', attributes);
function handleAsyncDependencies(deps) {
const currentDeps = wrapDeps(deps);
const getResult = ()=>currentDeps.map((d)=>{
if (d[turbopackError]) throw d[turbopackError];
return d[turbopackExports];
});
const { promise, resolve } = createPromise();
const fn = Object.assign(()=>resolve(getResult), {
queueCount: 0
});
function fnQueue(q) {
if (q !== queue && !depQueues.has(q)) {
depQueues.add(q);
if (q && q.status === 0) {
fn.queueCount++;
q.push(fn);
}
}
}
currentDeps.map((dep)=>dep[turbopackQueues](fnQueue));
return fn.queueCount ? promise : getResult();
}
function asyncResult(err) {
if (err) {
reject(promise[turbopackError] = err);
} else {
resolve(promise[turbopackExports]);
}
resolveQueue(queue);
}
body(handleAsyncDependencies, asyncResult);
if (queue && queue.status === -1) {
queue.status = 0;
}
}
contextPrototype.a = asyncModule;
/**
* A pseudo "fake" URL object to resolve to its relative path.
*
* When UrlRewriteBehavior is set to relative, calls to the `new URL()` will construct url without base using this
* runtime function to generate context-agnostic urls between different rendering context, i.e ssr / client to avoid
* hydration mismatch.
*
* This is based on webpack's existing implementation:
* https://github.com/webpack/webpack/blob/87660921808566ef3b8796f8df61bd79fc026108/lib/runtime/RelativeUrlRuntimeModule.js
*/ const relativeURL = function relativeURL(inputUrl) {
const realUrl = new URL(inputUrl, 'x:/');
const values = {};
for(const key in realUrl)values[key] = realUrl[key];
values.href = inputUrl;
values.pathname = inputUrl.replace(/[?#].*/, '');
values.origin = values.protocol = '';
values.toString = values.toJSON = (..._args)=>inputUrl;
for(const key in values)Object.defineProperty(this, key, {
enumerable: true,
configurable: true,
value: values[key]
});
};
relativeURL.prototype = URL.prototype;
contextPrototype.U = relativeURL;
/**
* Utility function to ensure all variants of an enum are handled.
*/ function invariant(never, computeMessage) {
throw new Error(`Invariant: ${computeMessage(never)}`);
}
/**
* Constructs an error message for when a module factory is not available.
*/ function factoryNotAvailableMessage(moduleId, sourceType, sourceData) {
let instantiationReason;
switch(sourceType){
case 0:
instantiationReason = `as a runtime entry of chunk ${sourceData}`;
break;
case 1:
instantiationReason = `because it was required from module ${sourceData}`;
break;
case 2:
instantiationReason = 'because of an HMR update';
break;
default:
invariant(sourceType, (sourceType)=>`Unknown source type: ${sourceType}`);
}
return `Module ${moduleId} was instantiated ${instantiationReason}, but the module factory is not available.`;
}
/**
* A stub function to make `require` available but non-functional in ESM.
*/ function requireStub(_moduleId) {
throw new Error('dynamic usage of require is not supported');
}
contextPrototype.z = requireStub;
// Make `globalThis` available to the module in a way that cannot be shadowed by a local variable.
contextPrototype.g = globalThis;
function applyModuleFactoryName(factory) {
// Give the module factory a nice name to improve stack traces.
Object.defineProperty(factory, 'name', {
value: 'module evaluation'
});
}
/// <reference path="../shared/runtime/runtime-utils.ts" />
/// A 'base' utilities to support runtime can have externals.
/// Currently this is for node.js / edge runtime both.
/// If a fn requires node.js specific behavior, it should be placed in `node-external-utils` instead.
async function externalImport(id) {
let raw;
try {
raw = await import(id);
} catch (err) {
// TODO(alexkirsz) This can happen when a client-side module tries to load
// an external module we don't provide a shim for (e.g. querystring, url).
// For now, we fail semi-silently, but in the future this should be a
// compilation error.
throw new Error(`Failed to load external module ${id}: ${err}`);
}
if (raw && raw.__esModule && raw.default && 'default' in raw.default) {
return interopEsm(raw.default, createNS(raw), true);
}
return raw;
}
contextPrototype.y = externalImport;
function externalRequire(id, thunk, esm = false) {
let raw;
try {
raw = thunk();
} catch (err) {
// TODO(alexkirsz) This can happen when a client-side module tries to load
// an external module we don't provide a shim for (e.g. querystring, url).
// For now, we fail semi-silently, but in the future this should be a
// compilation error.
throw new Error(`Failed to load external module ${id}: ${err}`);
}
if (!esm || raw.__esModule) {
return raw;
}
return interopEsm(raw, createNS(raw), true);
}
externalRequire.resolve = (id, options)=>{
return require.resolve(id, options);
};
contextPrototype.x = externalRequire;
/* eslint-disable @typescript-eslint/no-unused-vars */ const path = require('path');
const relativePathToRuntimeRoot = path.relative(RUNTIME_PUBLIC_PATH, '.');
// Compute the relative path to the `distDir`.
const relativePathToDistRoot = path.join(relativePathToRuntimeRoot, RELATIVE_ROOT_PATH);
const RUNTIME_ROOT = path.resolve(__filename, relativePathToRuntimeRoot);
// Compute the absolute path to the root, by stripping distDir from the absolute path to this file.
const ABSOLUTE_ROOT = path.resolve(__filename, relativePathToDistRoot);
/**
* Returns an absolute path to the given module path.
* Module path should be relative, either path to a file or a directory.
*
* This fn allows to calculate an absolute path for some global static values, such as
* `__dirname` or `import.meta.url` that Turbopack will not embeds in compile time.
* See ImportMetaBinding::code_generation for the usage.
*/ function resolveAbsolutePath(modulePath) {
if (modulePath) {
return path.join(ABSOLUTE_ROOT, modulePath);
}
return ABSOLUTE_ROOT;
}
Context.prototype.P = resolveAbsolutePath;
/* eslint-disable @typescript-eslint/no-unused-vars */ /// <reference path="../shared/runtime/runtime-utils.ts" />
function readWebAssemblyAsResponse(path) {
const { createReadStream } = require('fs');
const { Readable } = require('stream');
const stream = createReadStream(path);
// @ts-ignore unfortunately there's a slight type mismatch with the stream.
return new Response(Readable.toWeb(stream), {
headers: {
'content-type': 'application/wasm'
}
});
}
async function compileWebAssemblyFromPath(path) {
const response = readWebAssemblyAsResponse(path);
return await WebAssembly.compileStreaming(response);
}
async function instantiateWebAssemblyFromPath(path, importsObj) {
const response = readWebAssemblyAsResponse(path);
const { instance } = await WebAssembly.instantiateStreaming(response, importsObj);
return instance.exports;
}
/* eslint-disable @typescript-eslint/no-unused-vars */ /// <reference path="../../shared/runtime/runtime-utils.ts" />
/// <reference path="../../shared-node/base-externals-utils.ts" />
/// <reference path="../../shared-node/node-externals-utils.ts" />
/// <reference path="../../shared-node/node-wasm-utils.ts" />
/// <reference path="./nodejs-globals.d.ts" />
/**
* Base Node.js runtime shared between production and development.
* Contains chunk loading, module caching, and other non-HMR functionality.
*/ process.env.TURBOPACK = '1';
const url = require('url');
const moduleFactories = new Map();
const moduleCache = Object.create(null);
/**
* Returns an absolute path to the given module's id.
*/ function resolvePathFromModule(moduleId) {
const exported = this.r(moduleId);
const exportedPath = exported?.default ?? exported;
if (typeof exportedPath !== 'string') {
return exported;
}
const strippedAssetPrefix = exportedPath.slice(ASSET_PREFIX.length);
const resolved = path.resolve(RUNTIME_ROOT, strippedAssetPrefix);
return url.pathToFileURL(resolved).href;
}
/**
* Exports a URL value. No suffix is added in Node.js runtime.
*/ function exportUrl(urlValue, id) {
exportValue.call(this, urlValue, id);
}
function loadRuntimeChunk(sourcePath, chunkData) {
if (typeof chunkData === 'string') {
loadRuntimeChunkPath(sourcePath, chunkData);
} else {
loadRuntimeChunkPath(sourcePath, chunkData.path);
}
}
const loadedChunks = new Set();
const unsupportedLoadChunk = Promise.resolve(undefined);
const loadedChunk = Promise.resolve(undefined);
const chunkCache = new Map();
function clearChunkCache() {
chunkCache.clear();
loadedChunks.clear();
}
function loadRuntimeChunkPath(sourcePath, chunkPath) {
if (!isJs(chunkPath)) {
// We only support loading JS chunks in Node.js.
// This branch can be hit when trying to load a CSS chunk.
return;
}
if (loadedChunks.has(chunkPath)) {
return;
}
try {
const resolved = path.resolve(RUNTIME_ROOT, chunkPath);
const chunkModules = require(resolved);
installCompressedModuleFactories(chunkModules, 0, moduleFactories);
loadedChunks.add(chunkPath);
} catch (cause) {
let errorMessage = `Failed to load chunk ${chunkPath}`;
if (sourcePath) {
errorMessage += ` from runtime for chunk ${sourcePath}`;
}
const error = new Error(errorMessage, {
cause
});
error.name = 'ChunkLoadError';
throw error;
}
}
function loadChunkAsync(chunkData) {
const chunkPath = typeof chunkData === 'string' ? chunkData : chunkData.path;
if (!isJs(chunkPath)) {
// We only support loading JS chunks in Node.js.
// This branch can be hit when trying to load a CSS chunk.
return unsupportedLoadChunk;
}
let entry = chunkCache.get(chunkPath);
if (entry === undefined) {
try {
// resolve to an absolute path to simplify `require` handling
const resolved = path.resolve(RUNTIME_ROOT, chunkPath);
// TODO: consider switching to `import()` to enable concurrent chunk loading and async file io
// However this is incompatible with hot reloading (since `import` doesn't use the require cache)
const chunkModules = require(resolved);
installCompressedModuleFactories(chunkModules, 0, moduleFactories);
entry = loadedChunk;
} catch (cause) {
const errorMessage = `Failed to load chunk ${chunkPath} from module ${this.m.id}`;
const error = new Error(errorMessage, {
cause
});
error.name = 'ChunkLoadError';
// Cache the failure promise, future requests will also get this same rejection
entry = Promise.reject(error);
}
chunkCache.set(chunkPath, entry);
}
// TODO: Return an instrumented Promise that React can use instead of relying on referential equality.
return entry;
}
contextPrototype.l = loadChunkAsync;
function loadChunkAsyncByUrl(chunkUrl) {
const path1 = url.fileURLToPath(new URL(chunkUrl, RUNTIME_ROOT));
return loadChunkAsync.call(this, path1);
}
contextPrototype.L = loadChunkAsyncByUrl;
function loadWebAssembly(chunkPath, _edgeModule, imports) {
const resolved = path.resolve(RUNTIME_ROOT, chunkPath);
return instantiateWebAssemblyFromPath(resolved, imports);
}
contextPrototype.w = loadWebAssembly;
function loadWebAssemblyModule(chunkPath, _edgeModule) {
const resolved = path.resolve(RUNTIME_ROOT, chunkPath);
return compileWebAssemblyFromPath(resolved);
}
contextPrototype.u = loadWebAssemblyModule;
/**
* Creates a Node.js worker thread by instantiating the given WorkerConstructor
* with the appropriate path and options, including forwarded globals.
*
* @param WorkerConstructor The Worker constructor from worker_threads
* @param workerPath Path to the worker entry chunk
* @param workerOptions options to pass to the Worker constructor (optional)
*/ function createWorker(WorkerConstructor, workerPath, workerOptions) {
// Build the forwarded globals object
const forwardedGlobals = {};
for (const name of WORKER_FORWARDED_GLOBALS){
forwardedGlobals[name] = globalThis[name];
}
// Merge workerData with forwarded globals
const existingWorkerData = workerOptions?.workerData || {};
const options = {
...workerOptions,
workerData: {
...typeof existingWorkerData === 'object' ? existingWorkerData : {},
__turbopack_globals__: forwardedGlobals
}
};
return new WorkerConstructor(workerPath, options);
}
const regexJsUrl = /\.js(?:\?[^#]*)?(?:#.*)?$/;
/**
* Checks if a given path/URL ends with .js, optionally followed by ?query or #fragment.
*/ function isJs(chunkUrlOrPath) {
return regexJsUrl.test(chunkUrlOrPath);
}
/* eslint-disable @typescript-eslint/no-unused-vars */ /// <reference path="./runtime-base.ts" />
/**
* Production Node.js runtime.
* Uses ModuleWithDirection and simple module instantiation without HMR support.
*/ // moduleCache and moduleFactories are declared in runtime-base.ts
// this is read in runtime-utils.ts so it creates a module with direction for hmr
createModuleWithDirectionFlag = true;
const nodeContextPrototype = Context.prototype;
nodeContextPrototype.q = exportUrl;
nodeContextPrototype.M = moduleFactories;
// Cast moduleCache to ModuleWithDirection for production mode
nodeContextPrototype.c = moduleCache;
nodeContextPrototype.R = resolvePathFromModule;
nodeContextPrototype.b = createWorker;
nodeContextPrototype.C = clearChunkCache;
function instantiateModule(id, sourceType, sourceData) {
const moduleFactory = moduleFactories.get(id);
if (typeof moduleFactory !== 'function') {
// This can happen if modules incorrectly handle HMR disposes/updates,
// e.g. when they keep a `setTimeout` around which still executes old code
// and contains e.g. a `require("something")` call.
throw new Error(factoryNotAvailableMessage(id, sourceType, sourceData));
}
const module1 = createModuleWithDirection(id);
const exports = module1.exports;
moduleCache[id] = module1;
const context = new Context(module1, exports);
// NOTE(alexkirsz) This can fail when the module encounters a runtime error.
try {
moduleFactory(context, module1, exports);
} catch (error) {
module1.error = error;
throw error;
}
;
module1.loaded = true;
if (module1.namespaceObject && module1.exports !== module1.namespaceObject) {
// in case of a circular dependency: cjs1 -> esm2 -> cjs1
interopEsm(module1.exports, module1.namespaceObject);
}
return module1;
}
/**
* Retrieves a module from the cache, or instantiate it if it is not cached.
*/ // @ts-ignore
function getOrInstantiateModuleFromParent(id, sourceModule) {
const module1 = moduleCache[id];
if (module1) {
if (module1.error) {
throw module1.error;
}
return module1;
}
return instantiateModule(id, SourceType.Parent, sourceModule.id);
}
/**
* Instantiates a runtime module.
*/ function instantiateRuntimeModule(chunkPath, moduleId) {
return instantiateModule(moduleId, SourceType.Runtime, chunkPath);
}
/**
* Retrieves a module from the cache, or instantiate it as a runtime module if it is not cached.
*/ // @ts-ignore TypeScript doesn't separate this module space from the browser runtime
function getOrInstantiateRuntimeModule(chunkPath, moduleId) {
const module1 = moduleCache[moduleId];
if (module1) {
if (module1.error) {
throw module1.error;
}
return module1;
}
return instantiateRuntimeModule(chunkPath, moduleId);
}
module.exports = (sourcePath)=>({
m: (id)=>getOrInstantiateRuntimeModule(sourcePath, id),
c: (chunkData)=>loadRuntimeChunk(sourcePath, chunkData)
});
//# sourceMappingURL=%5Bturbopack%5D_runtime.js.map

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
{"type": "commonjs"}

View File

@@ -0,0 +1,6 @@
var R=require("./chunks/[turbopack]_runtime.js")("postcss.js")
R.c("chunks/[turbopack-node]_transforms_postcss_ts_06e.r3r._.js")
R.c("chunks/[root-of-the-server]__0ubbtyl._.js")
R.m("[turbopack-node]/child_process/globals.ts [postcss] (ecmascript)")
R.m("[turbopack-node]/child_process/evaluate.ts/evaluate.js { INNER => \"[turbopack-node]/transforms/postcss.ts { CONFIG => \\\"[project]/postcss.config.mjs [postcss] (ecmascript)\\\" } [postcss] (ecmascript)\", RUNTIME => \"[turbopack-node]/child_process/evaluate.ts [postcss] (ecmascript)\" } [postcss] (ecmascript)")
module.exports=R.m("[turbopack-node]/child_process/evaluate.ts/evaluate.js { INNER => \"[turbopack-node]/transforms/postcss.ts { CONFIG => \\\"[project]/postcss.config.mjs [postcss] (ecmascript)\\\" } [postcss] (ecmascript)\", RUNTIME => \"[turbopack-node]/child_process/evaluate.ts [postcss] (ecmascript)\" } [postcss] (ecmascript)").exports

View File

@@ -0,0 +1,5 @@
{
"version": 3,
"sources": [],
"sections": []
}

1
build_temp/.next/cache/.previewinfo vendored Normal file
View File

@@ -0,0 +1 @@
{"previewModeId":"448d32298db3b0c38793886a3692c8c2","previewModeSigningKey":"c5cb172f94d84767588967a86044c9ee49921a9b2179519d52aa8aceecb0cd6f","previewModeEncryptionKey":"8a7d538464b6beea4e3323e6d9d86f4b70ecb99e19daffca604a9088baa07476","expireAt":1783363527187}

1
build_temp/.next/cache/.rscinfo vendored Normal file
View File

@@ -0,0 +1 @@
{"encryption.key":"3aeRfwg0+P9P6WojBQxvxnXB2/RQU+/5AuKoO1YfFV8=","encryption.expire_at":1783363527167}

1
build_temp/.next/cache/.tsbuildinfo vendored Normal file

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,6 @@
{
"buildStage": "static-generation",
"buildOptions": {
"useBuildWorker": "true"
}
}

View File

@@ -0,0 +1 @@
{"name":"Next.js","version":"16.2.4"}

View File

@@ -0,0 +1,357 @@
[
{
"route": "/protected",
"firstLoadUncompressedJsBytes": 887453,
"firstLoadChunkPaths": [
".next\\static\\chunks\\0usmzazea5o36.js",
".next\\static\\chunks\\0d3shmwh5_nmn.js",
".next\\static\\chunks\\012i7eyh17tl3.js",
".next\\static\\chunks\\0k5-k~sbs-wg6.js",
".next\\static\\chunks\\0qesjmrn7~1dz.js",
".next\\static\\chunks\\01_lw6dc6ltc-.js",
".next\\static\\chunks\\0l-wk1ive8m.1.js",
".next\\static\\chunks\\00gju7l2y3vh_.js",
".next\\static\\chunks\\0ze4gu236oq96.js",
".next\\static\\chunks\\10qd__0r7a~.l.js",
".next\\static\\chunks\\0-gaanm6h49z~.js",
".next\\static\\chunks\\06c8h6921f-oo.js",
".next\\static\\chunks\\15jasrm2107sy.js",
".next\\static\\chunks\\181uojwh.t2ik.js",
".next\\static\\chunks\\turbopack-0u.mb44r17v0_.js"
]
},
{
"route": "/admin/products",
"firstLoadUncompressedJsBytes": 815153,
"firstLoadChunkPaths": [
".next\\static\\chunks\\0usmzazea5o36.js",
".next\\static\\chunks\\0d3shmwh5_nmn.js",
".next\\static\\chunks\\0ka051yepewro.js",
".next\\static\\chunks\\0_psz~izxr78o.js",
".next\\static\\chunks\\01_lw6dc6ltc-.js",
".next\\static\\chunks\\0qj.s.uyzj2u6.js",
".next\\static\\chunks\\1535xxoug.k9i.js",
".next\\static\\chunks\\0k5-k~sbs-wg6.js",
".next\\static\\chunks\\0h2rh5ewa6gmd.js",
".next\\static\\chunks\\0ze4gu236oq96.js",
".next\\static\\chunks\\10qd__0r7a~.l.js",
".next\\static\\chunks\\0-gaanm6h49z~.js",
".next\\static\\chunks\\06c8h6921f-oo.js",
".next\\static\\chunks\\15jasrm2107sy.js",
".next\\static\\chunks\\181uojwh.t2ik.js",
".next\\static\\chunks\\turbopack-0u.mb44r17v0_.js"
]
},
{
"route": "/admin/categories",
"firstLoadUncompressedJsBytes": 810555,
"firstLoadChunkPaths": [
".next\\static\\chunks\\0usmzazea5o36.js",
".next\\static\\chunks\\0d3shmwh5_nmn.js",
".next\\static\\chunks\\0ka051yepewro.js",
".next\\static\\chunks\\0_psz~izxr78o.js",
".next\\static\\chunks\\01_lw6dc6ltc-.js",
".next\\static\\chunks\\0~pn4~wuwvr32.js",
".next\\static\\chunks\\0f7q1cdbakqnj.js",
".next\\static\\chunks\\0k5-k~sbs-wg6.js",
".next\\static\\chunks\\0h2rh5ewa6gmd.js",
".next\\static\\chunks\\0ze4gu236oq96.js",
".next\\static\\chunks\\10qd__0r7a~.l.js",
".next\\static\\chunks\\0-gaanm6h49z~.js",
".next\\static\\chunks\\06c8h6921f-oo.js",
".next\\static\\chunks\\15jasrm2107sy.js",
".next\\static\\chunks\\181uojwh.t2ik.js",
".next\\static\\chunks\\turbopack-0u.mb44r17v0_.js"
]
},
{
"route": "/auth/sign-up",
"firstLoadUncompressedJsBytes": 798825,
"firstLoadChunkPaths": [
".next\\static\\chunks\\0usmzazea5o36.js",
".next\\static\\chunks\\0d3shmwh5_nmn.js",
".next\\static\\chunks\\0.y2lp02b2t7q.js",
".next\\static\\chunks\\0qesjmrn7~1dz.js",
".next\\static\\chunks\\0k5-k~sbs-wg6.js",
".next\\static\\chunks\\0ze4gu236oq96.js",
".next\\static\\chunks\\10qd__0r7a~.l.js",
".next\\static\\chunks\\0-gaanm6h49z~.js",
".next\\static\\chunks\\06c8h6921f-oo.js",
".next\\static\\chunks\\15jasrm2107sy.js",
".next\\static\\chunks\\181uojwh.t2ik.js",
".next\\static\\chunks\\turbopack-0u.mb44r17v0_.js"
]
},
{
"route": "/auth/login",
"firstLoadUncompressedJsBytes": 798571,
"firstLoadChunkPaths": [
".next\\static\\chunks\\0usmzazea5o36.js",
".next\\static\\chunks\\0d3shmwh5_nmn.js",
".next\\static\\chunks\\020p4x66yuy~n.js",
".next\\static\\chunks\\0qesjmrn7~1dz.js",
".next\\static\\chunks\\0k5-k~sbs-wg6.js",
".next\\static\\chunks\\0ze4gu236oq96.js",
".next\\static\\chunks\\10qd__0r7a~.l.js",
".next\\static\\chunks\\0-gaanm6h49z~.js",
".next\\static\\chunks\\06c8h6921f-oo.js",
".next\\static\\chunks\\15jasrm2107sy.js",
".next\\static\\chunks\\181uojwh.t2ik.js",
".next\\static\\chunks\\turbopack-0u.mb44r17v0_.js"
]
},
{
"route": "/auth/forgot-password",
"firstLoadUncompressedJsBytes": 798560,
"firstLoadChunkPaths": [
".next\\static\\chunks\\0usmzazea5o36.js",
".next\\static\\chunks\\0d3shmwh5_nmn.js",
".next\\static\\chunks\\0hn13p7jlg6c8.js",
".next\\static\\chunks\\0qesjmrn7~1dz.js",
".next\\static\\chunks\\0k5-k~sbs-wg6.js",
".next\\static\\chunks\\0ze4gu236oq96.js",
".next\\static\\chunks\\10qd__0r7a~.l.js",
".next\\static\\chunks\\0-gaanm6h49z~.js",
".next\\static\\chunks\\06c8h6921f-oo.js",
".next\\static\\chunks\\15jasrm2107sy.js",
".next\\static\\chunks\\181uojwh.t2ik.js",
".next\\static\\chunks\\turbopack-0u.mb44r17v0_.js"
]
},
{
"route": "/auth/update-password",
"firstLoadUncompressedJsBytes": 792198,
"firstLoadChunkPaths": [
".next\\static\\chunks\\0usmzazea5o36.js",
".next\\static\\chunks\\0d3shmwh5_nmn.js",
".next\\static\\chunks\\07b46tf_nu-sm.js",
".next\\static\\chunks\\0qesjmrn7~1dz.js",
".next\\static\\chunks\\0k5-k~sbs-wg6.js",
".next\\static\\chunks\\0ze4gu236oq96.js",
".next\\static\\chunks\\10qd__0r7a~.l.js",
".next\\static\\chunks\\0-gaanm6h49z~.js",
".next\\static\\chunks\\06c8h6921f-oo.js",
".next\\static\\chunks\\15jasrm2107sy.js",
".next\\static\\chunks\\181uojwh.t2ik.js",
".next\\static\\chunks\\turbopack-0u.mb44r17v0_.js"
]
},
{
"route": "/admin/users",
"firstLoadUncompressedJsBytes": 732184,
"firstLoadChunkPaths": [
".next\\static\\chunks\\0usmzazea5o36.js",
".next\\static\\chunks\\0d3shmwh5_nmn.js",
".next\\static\\chunks\\0ka051yepewro.js",
".next\\static\\chunks\\0d83uz0cb9cr0.js",
".next\\static\\chunks\\0k5-k~sbs-wg6.js",
".next\\static\\chunks\\09ftf-8ix1ad~.js",
".next\\static\\chunks\\0h2rh5ewa6gmd.js",
".next\\static\\chunks\\0ze4gu236oq96.js",
".next\\static\\chunks\\10qd__0r7a~.l.js",
".next\\static\\chunks\\0-gaanm6h49z~.js",
".next\\static\\chunks\\06c8h6921f-oo.js",
".next\\static\\chunks\\15jasrm2107sy.js",
".next\\static\\chunks\\181uojwh.t2ik.js",
".next\\static\\chunks\\turbopack-0u.mb44r17v0_.js"
]
},
{
"route": "/order",
"firstLoadUncompressedJsBytes": 726412,
"firstLoadChunkPaths": [
".next\\static\\chunks\\0usmzazea5o36.js",
".next\\static\\chunks\\0d3shmwh5_nmn.js",
".next\\static\\chunks\\0k5-k~sbs-wg6.js",
".next\\static\\chunks\\083objkg2e851.js",
".next\\static\\chunks\\0ulw1svcbtk8z.js",
".next\\static\\chunks\\0ze4gu236oq96.js",
".next\\static\\chunks\\10qd__0r7a~.l.js",
".next\\static\\chunks\\0-gaanm6h49z~.js",
".next\\static\\chunks\\06c8h6921f-oo.js",
".next\\static\\chunks\\15jasrm2107sy.js",
".next\\static\\chunks\\181uojwh.t2ik.js",
".next\\static\\chunks\\turbopack-0u.mb44r17v0_.js"
]
},
{
"route": "/my-customers/[id]",
"firstLoadUncompressedJsBytes": 569382,
"firstLoadChunkPaths": [
".next\\static\\chunks\\0usmzazea5o36.js",
".next\\static\\chunks\\0d3shmwh5_nmn.js",
".next\\static\\chunks\\0d068foshfwl7.js",
".next\\static\\chunks\\0k5-k~sbs-wg6.js",
".next\\static\\chunks\\0ze4gu236oq96.js",
".next\\static\\chunks\\10qd__0r7a~.l.js",
".next\\static\\chunks\\0-gaanm6h49z~.js",
".next\\static\\chunks\\06c8h6921f-oo.js",
".next\\static\\chunks\\15jasrm2107sy.js",
".next\\static\\chunks\\181uojwh.t2ik.js",
".next\\static\\chunks\\turbopack-0u.mb44r17v0_.js"
]
},
{
"route": "/my-customers/new",
"firstLoadUncompressedJsBytes": 564226,
"firstLoadChunkPaths": [
".next\\static\\chunks\\0usmzazea5o36.js",
".next\\static\\chunks\\0d3shmwh5_nmn.js",
".next\\static\\chunks\\00-xpv69x~78w.js",
".next\\static\\chunks\\0k5-k~sbs-wg6.js",
".next\\static\\chunks\\0ze4gu236oq96.js",
".next\\static\\chunks\\10qd__0r7a~.l.js",
".next\\static\\chunks\\0-gaanm6h49z~.js",
".next\\static\\chunks\\06c8h6921f-oo.js",
".next\\static\\chunks\\15jasrm2107sy.js",
".next\\static\\chunks\\181uojwh.t2ik.js",
".next\\static\\chunks\\turbopack-0u.mb44r17v0_.js"
]
},
{
"route": "/admin",
"firstLoadUncompressedJsBytes": 555746,
"firstLoadChunkPaths": [
".next\\static\\chunks\\0usmzazea5o36.js",
".next\\static\\chunks\\0d3shmwh5_nmn.js",
".next\\static\\chunks\\0ka051yepewro.js",
".next\\static\\chunks\\091cxb_8k6p~y.js",
".next\\static\\chunks\\0k5-k~sbs-wg6.js",
".next\\static\\chunks\\0ze4gu236oq96.js",
".next\\static\\chunks\\10qd__0r7a~.l.js",
".next\\static\\chunks\\0-gaanm6h49z~.js",
".next\\static\\chunks\\06c8h6921f-oo.js",
".next\\static\\chunks\\15jasrm2107sy.js",
".next\\static\\chunks\\181uojwh.t2ik.js",
".next\\static\\chunks\\turbopack-0u.mb44r17v0_.js"
]
},
{
"route": "/order/success",
"firstLoadUncompressedJsBytes": 552889,
"firstLoadChunkPaths": [
".next\\static\\chunks\\0usmzazea5o36.js",
".next\\static\\chunks\\0d3shmwh5_nmn.js",
".next\\static\\chunks\\10n544c5bwzh9.js",
".next\\static\\chunks\\0k5-k~sbs-wg6.js",
".next\\static\\chunks\\0ze4gu236oq96.js",
".next\\static\\chunks\\10qd__0r7a~.l.js",
".next\\static\\chunks\\0-gaanm6h49z~.js",
".next\\static\\chunks\\06c8h6921f-oo.js",
".next\\static\\chunks\\15jasrm2107sy.js",
".next\\static\\chunks\\181uojwh.t2ik.js",
".next\\static\\chunks\\turbopack-0u.mb44r17v0_.js"
]
},
{
"route": "/admin/orders",
"firstLoadUncompressedJsBytes": 551609,
"firstLoadChunkPaths": [
".next\\static\\chunks\\0usmzazea5o36.js",
".next\\static\\chunks\\0d3shmwh5_nmn.js",
".next\\static\\chunks\\0ka051yepewro.js",
".next\\static\\chunks\\0vebka-_nqjml.js",
".next\\static\\chunks\\0k5-k~sbs-wg6.js",
".next\\static\\chunks\\0ze4gu236oq96.js",
".next\\static\\chunks\\10qd__0r7a~.l.js",
".next\\static\\chunks\\0-gaanm6h49z~.js",
".next\\static\\chunks\\06c8h6921f-oo.js",
".next\\static\\chunks\\15jasrm2107sy.js",
".next\\static\\chunks\\181uojwh.t2ik.js",
".next\\static\\chunks\\turbopack-0u.mb44r17v0_.js"
]
},
{
"route": "/",
"firstLoadUncompressedJsBytes": 523255,
"firstLoadChunkPaths": [
".next\\static\\chunks\\0usmzazea5o36.js",
".next\\static\\chunks\\0d3shmwh5_nmn.js",
".next\\static\\chunks\\0ka051yepewro.js",
".next\\static\\chunks\\0ze4gu236oq96.js",
".next\\static\\chunks\\10qd__0r7a~.l.js",
".next\\static\\chunks\\0-gaanm6h49z~.js",
".next\\static\\chunks\\06c8h6921f-oo.js",
".next\\static\\chunks\\15jasrm2107sy.js",
".next\\static\\chunks\\181uojwh.t2ik.js",
".next\\static\\chunks\\turbopack-0u.mb44r17v0_.js"
]
},
{
"route": "/my-customers",
"firstLoadUncompressedJsBytes": 523255,
"firstLoadChunkPaths": [
".next\\static\\chunks\\0usmzazea5o36.js",
".next\\static\\chunks\\0d3shmwh5_nmn.js",
".next\\static\\chunks\\0ka051yepewro.js",
".next\\static\\chunks\\0ze4gu236oq96.js",
".next\\static\\chunks\\10qd__0r7a~.l.js",
".next\\static\\chunks\\0-gaanm6h49z~.js",
".next\\static\\chunks\\06c8h6921f-oo.js",
".next\\static\\chunks\\15jasrm2107sy.js",
".next\\static\\chunks\\181uojwh.t2ik.js",
".next\\static\\chunks\\turbopack-0u.mb44r17v0_.js"
]
},
{
"route": "/my-orders",
"firstLoadUncompressedJsBytes": 523255,
"firstLoadChunkPaths": [
".next\\static\\chunks\\0usmzazea5o36.js",
".next\\static\\chunks\\0d3shmwh5_nmn.js",
".next\\static\\chunks\\0ka051yepewro.js",
".next\\static\\chunks\\0ze4gu236oq96.js",
".next\\static\\chunks\\10qd__0r7a~.l.js",
".next\\static\\chunks\\0-gaanm6h49z~.js",
".next\\static\\chunks\\06c8h6921f-oo.js",
".next\\static\\chunks\\15jasrm2107sy.js",
".next\\static\\chunks\\181uojwh.t2ik.js",
".next\\static\\chunks\\turbopack-0u.mb44r17v0_.js"
]
},
{
"route": "/_not-found",
"firstLoadUncompressedJsBytes": 517427,
"firstLoadChunkPaths": [
".next\\static\\chunks\\0usmzazea5o36.js",
".next\\static\\chunks\\0d3shmwh5_nmn.js",
".next\\static\\chunks\\0ze4gu236oq96.js",
".next\\static\\chunks\\10qd__0r7a~.l.js",
".next\\static\\chunks\\0-gaanm6h49z~.js",
".next\\static\\chunks\\06c8h6921f-oo.js",
".next\\static\\chunks\\15jasrm2107sy.js",
".next\\static\\chunks\\181uojwh.t2ik.js",
".next\\static\\chunks\\turbopack-0u.mb44r17v0_.js"
]
},
{
"route": "/auth/error",
"firstLoadUncompressedJsBytes": 517427,
"firstLoadChunkPaths": [
".next\\static\\chunks\\0usmzazea5o36.js",
".next\\static\\chunks\\0d3shmwh5_nmn.js",
".next\\static\\chunks\\0ze4gu236oq96.js",
".next\\static\\chunks\\10qd__0r7a~.l.js",
".next\\static\\chunks\\0-gaanm6h49z~.js",
".next\\static\\chunks\\06c8h6921f-oo.js",
".next\\static\\chunks\\15jasrm2107sy.js",
".next\\static\\chunks\\181uojwh.t2ik.js",
".next\\static\\chunks\\turbopack-0u.mb44r17v0_.js"
]
},
{
"route": "/auth/sign-up-success",
"firstLoadUncompressedJsBytes": 517427,
"firstLoadChunkPaths": [
".next\\static\\chunks\\0usmzazea5o36.js",
".next\\static\\chunks\\0d3shmwh5_nmn.js",
".next\\static\\chunks\\0ze4gu236oq96.js",
".next\\static\\chunks\\10qd__0r7a~.l.js",
".next\\static\\chunks\\0-gaanm6h49z~.js",
".next\\static\\chunks\\06c8h6921f-oo.js",
".next\\static\\chunks\\15jasrm2107sy.js",
".next\\static\\chunks\\181uojwh.t2ik.js",
".next\\static\\chunks\\turbopack-0u.mb44r17v0_.js"
]
}
]

View File

@@ -0,0 +1,6 @@
{
"version": 1,
"hasExportPathMap": false,
"exportTrailingSlash": false,
"isNextImageImported": false
}

View File

@@ -0,0 +1,13 @@
{
"pages": {
"/_app": []
},
"devFiles": [],
"polyfillFiles": [],
"lowPriorityFiles": [
"static/czEjVggXDRFH51IopN6_9/_buildManifest.js",
"static/czEjVggXDRFH51IopN6_9/_ssgManifest.js",
"static/czEjVggXDRFH51IopN6_9/_clientMiddlewareManifest.js"
],
"rootMainFiles": []
}

View File

@@ -0,0 +1,68 @@
{
"version": 1,
"images": {
"deviceSizes": [
640,
750,
828,
1080,
1200,
1920,
2048,
3840
],
"imageSizes": [
32,
48,
64,
96,
128,
256,
384
],
"path": "/_next/image",
"loader": "default",
"loaderFile": "",
"domains": [],
"disableStaticImages": false,
"minimumCacheTTL": 14400,
"formats": [
"image/webp"
],
"maximumRedirects": 3,
"maximumResponseBody": 50000000,
"dangerouslyAllowLocalIP": false,
"dangerouslyAllowSVG": false,
"contentSecurityPolicy": "script-src 'none'; frame-src 'none'; sandbox;",
"contentDispositionType": "attachment",
"localPatterns": [
{
"pathname": "^(?:(?!(?:^|\\/)\\.{1,2}(?:\\/|$))(?:(?:(?!(?:^|\\/)\\.{1,2}(?:\\/|$)).)*?)\\/?)$",
"search": ""
}
],
"remotePatterns": [],
"qualities": [
75
],
"unoptimized": false,
"customCacheHandler": false,
"sizes": [
640,
750,
828,
1080,
1200,
1920,
2048,
3840,
32,
48,
64,
96,
128,
256,
384
]
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,112 @@
<p align="center">
<img src="https://user-images.githubusercontent.com/5600341/27505816-c8bc37aa-587f-11e7-9a86-08a2d081a8b9.png" height="280px">
<p align="center">React renderer for creating PDF files on the browser and server<p>
<p align="center">
<a href="https://www.npmjs.com/package/@react-pdf/renderer">
<img src="https://img.shields.io/npm/v/@react-pdf/renderer?style=flat&colorA=000000&colorB=000000" />
</a>
<a href="https://opencollective.com/react-pdf">
<img src="https://img.shields.io/opencollective/all/react-pdf?style=flat&colorA=000000&colorB=000000" />
</a>
<a href="https://github.com/diegomura/react-pdf/blob/master/LICENSE">
<img src="https://img.shields.io/github/license/diegomura/react-pdf?style=flat&colorA=000000&colorB=000000" />
</a>
<a href="https://blockchain.com/btc/address/bc1qj223udztpmt5dck46dw0yap08yum63ht56h90v">
<img src="https://img.shields.io/badge/BTC-f5f5f5?style=flat&colorA=000000&colorB=000000" />
</a>
<a href="https://blockchain.com/eth/address/0x4e1DB76bA0858BbCAa4DD804418D0D9EcF77B1cC">
<img src="https://img.shields.io/badge/ETH-f5f5f5?style=flat&colorA=000000&colorB=000000" />
</a>
</p>
</p>
## How to install
```sh
yarn add @react-pdf/renderer
```
## How it works
```jsx
import React from 'react';
import { Document, Page, Text, View, StyleSheet } from '@react-pdf/renderer';
// Create styles
const styles = StyleSheet.create({
page: {
flexDirection: 'row',
backgroundColor: '#E4E4E4',
},
section: {
margin: 10,
padding: 10,
flexGrow: 1,
},
});
// Create Document Component
const MyDocument = () => (
<Document>
<Page size="A4" style={styles.page}>
<View style={styles.section}>
<Text>Section #1</Text>
</View>
<View style={styles.section}>
<Text>Section #2</Text>
</View>
</Page>
</Document>
);
```
### `Web.` Render in DOM
```jsx
import React from 'react';
import ReactDOM from 'react-dom';
import { PDFViewer } from '@react-pdf/renderer';
const App = () => (
<PDFViewer>
<MyDocument />
</PDFViewer>
);
ReactDOM.render(<App />, document.getElementById('root'));
```
### `Node.` Save in a file
```jsx
import React from 'react';
import ReactPDF from '@react-pdf/renderer';
ReactPDF.render(<MyDocument />, `${__dirname}/example.pdf`);
```
## Contributors
This project exists thanks to all the people who contribute. Looking to contribute? Please check our [[contribute]](https://github.com/diegomura/react-pdf/blob/master/.github/CONTRIBUTING.md) document for more details about how to setup a development environment and submitting code.
<a href="https://github.com/diegomura/react-pdf/blob/master/.github/CONTRIBUTING.md"><img src="https://opencollective.com/react-pdf/contributors.svg?width=890" /></a>
## Sponsors
Thank you to all our sponsors! [[Become a sponsors](https://opencollective.com/react-pdf#sponsors)]
<a href="https://opencollective.com/react-pdf#sponsors" target="_blank"><img src="https://opencollective.com/react-pdf/sponsors.svg?width=890"></a>
## Backers
Thank you to all our backers! [[Become a backer](https://opencollective.com/react-pdf#backer)]
<a href="https://opencollective.com/react-pdf#backers" target="_blank"><img src="https://opencollective.com/react-pdf/backers.svg?width=890"></a>
## License
MIT © [Diego Muracciole](http://github.com/diegomura)
---
[![](https://img.shields.io/npm/dt/@react-pdf/renderer.svg?style=flat)](https://www.npmjs.com/package/@react-pdf/renderer)

View File

@@ -0,0 +1,793 @@
/* eslint-disable max-classes-per-file */
import * as React from 'react';
import {
Style,
PageSize,
FontStore,
PDFVersion,
Orientation,
SourceObject,
SrcSet,
Sizes,
HyphenationCallback,
SVGPresentationAttributes,
Bookmark,
PageLayout,
PageMode,
HitSlop,
} from '@react-pdf/types';
declare class ReactPDF {
static default: typeof ReactPDF;
}
export = ReactPDF;
declare namespace ReactPDF {
interface Styles {
[key: string]: Style;
}
interface OnRenderProps {
blob?: Blob;
}
interface Permissions {
printing?: 'lowResolution' | 'highResolution';
modifying?: boolean;
copying?: boolean;
annotating?: boolean;
fillingForms?: boolean;
contentAccessibility?: boolean;
documentAssembly?: boolean;
}
interface DocumentProps {
style?: Style | Style[];
title?: string;
author?: string;
subject?: string;
creator?: string;
keywords?: string;
producer?: string;
language?: string;
creationDate?: Date;
modificationDate?: Date;
pdfVersion?: PDFVersion;
pageMode?: PageMode;
pageLayout?: PageLayout;
ownerPassword?: string;
userPassword?: string;
permissions?: Permissions;
onRender?: (props: OnRenderProps) => any;
}
/**
* This component represent the PDF document itself. It must be the root
* of your tree element structure, and under no circumstances should it be
* used as children of another react-pdf component. In addition, it should
* only have childs of type <Page />.
*/
export class Document extends React.Component<
React.PropsWithChildren<DocumentProps>
> {}
interface NodeProps {
id?: string;
style?: Style | Style[];
/**
* Render component in all wrapped pages.
* @see https://react-pdf.org/advanced#fixed-components
*/
fixed?: boolean;
/**
* Force the wrapping algorithm to start a new page when rendering the
* element.
* @see https://react-pdf.org/advanced#page-breaks
*/
break?: boolean;
/**
* Hint that no page wrapping should occur between all sibling elements following the element within n points
* @see https://react-pdf.org/advanced#orphan-&-widow-protection
*/
minPresenceAhead?: number;
}
interface PageProps extends NodeProps {
/**
* Enable page wrapping for this page.
* @see https://react-pdf.org/components#page-wrapping
*/
wrap?: boolean;
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
size?: PageSize;
orientation?: Orientation;
dpi?: number;
bookmark?: Bookmark;
}
/**
* Represents single page inside the PDF document, or a subset of them if
* using the wrapping feature. A <Document /> can contain as many pages as
* you want, but ensure not rendering a page inside any component besides
* Document.
*/
export class Page extends React.Component<
React.PropsWithChildren<PageProps>
> {}
interface ViewProps extends NodeProps {
id?: string;
/**
* Enable/disable page wrapping for element.
* @see https://react-pdf.org/components#page-wrapping
*/
wrap?: boolean;
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
render?: (props: {
pageNumber: number;
subPageNumber: number;
}) => React.ReactNode;
}
/**
* The most fundamental component for building a UI and is designed to be
* nested inside other views and can have 0 to many children.
*/
export class View extends React.Component<
React.PropsWithChildren<ViewProps>
> {}
interface BaseImageProps extends NodeProps {
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
cache?: boolean;
/**
* A comma-separated list of image sources with width descriptors.
* Works like the HTML img srcSet attribute.
* @example "small.jpg 300w, medium.jpg 600w, large.jpg 900w"
*/
srcSet?: SrcSet;
/**
* The intended display width of the image, used to select the best source
* from srcSet. Accepts a number (in points) or a string.
* Works like the HTML img sizes attribute.
* @example 300
* @example "300"
*/
sizes?: Sizes;
}
interface ImageWithSrcProp extends BaseImageProps {
src: SourceObject;
}
interface ImageWithSourceProp extends BaseImageProps {
source: SourceObject;
}
type ImageProps = ImageWithSrcProp | ImageWithSourceProp;
/**
* A React component for displaying network or local (Node only) JPG or
* PNG images, as well as base64 encoded image strings.
*/
export class Image extends React.Component<ImageProps> {}
interface BaseImageBackgroundProps extends NodeProps {
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
cache?: boolean;
/**
* A comma-separated list of image sources with width descriptors.
* Works like the HTML img srcSet attribute.
* @example "small.jpg 300w, medium.jpg 600w, large.jpg 900w"
*/
srcSet?: SrcSet;
/**
* The intended display width of the image, used to select the best source
* from srcSet. Accepts a number (in points) or a string.
* @example 300
*/
sizes?: Sizes;
/**
* Style applied to the background image.
*/
imageStyle?: Style;
}
interface ImageBackgroundWithSrcProp extends BaseImageBackgroundProps {
src: SourceObject;
}
interface ImageBackgroundWithSourceProp extends BaseImageBackgroundProps {
source: SourceObject;
}
type ImageBackgroundProps =
| ImageBackgroundWithSrcProp
| ImageBackgroundWithSourceProp;
/**
* A React component for displaying an image behind child content.
* Compatible with React Native's ImageBackground component.
* @see https://reactnative.dev/docs/imagebackground
*/
export class ImageBackground extends React.Component<
React.PropsWithChildren<ImageBackgroundProps>
> {}
interface TextProps extends NodeProps {
id?: string;
/**
* Enable/disable page wrapping for element.
* @see https://react-pdf.org/components#page-wrapping
*/
wrap?: boolean;
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
render?: (props: {
pageNumber: number;
totalPages: number;
subPageNumber: number;
subPageTotalPages: number;
}) => React.ReactNode;
/**
* Override the default hyphenation-callback
* @see https://react-pdf.org/fonts#registerhyphenationcallback
*/
hyphenationCallback?: HyphenationCallback;
/**
* Specifies the minimum number of lines in a text element that must be shown at the bottom of a page or its container.
* @see https://react-pdf.org/advanced#orphan-&-widow-protection
*/
orphans?: number;
/**
* Specifies the minimum number of lines in a text element that must be shown at the top of a page or its container..
* @see https://react-pdf.org/advanced#orphan-&-widow-protection
*/
widows?: number;
}
interface SVGTextProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
x: string | number;
y: string | number;
/**
* Override the default hyphenation-callback
* @see https://react-pdf.org/fonts#registerhyphenationcallback
*/
hyphenationCallback?: HyphenationCallback;
}
/**
* A React component for displaying text. Text supports nesting of other
* Text or Link components to create inline styling.
*/
export class Text extends React.Component<
React.PropsWithChildren<TextProps> | SVGTextProps
> {}
interface LinkProps extends NodeProps {
/**
* Enable/disable page wrapping for element.
* @see https://react-pdf.org/components#page-wrapping
*/
wrap?: boolean;
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
href?: string;
src?: string;
/**
* Extends the clickable area of the link beyond its visible bounds.
* Accepts a number (applied to all sides) or an object with top, bottom, left, right.
* @see https://reactnative.dev/docs/view#hitslop
*/
hitSlop?: HitSlop;
}
/**
* A React component for displaying a hyperlink. Links can be nested
* inside a Text component, or being inside any other valid primitive.
*/
export class Link extends React.Component<
React.PropsWithChildren<LinkProps>
> {}
interface FormCommonProps extends NodeProps {
name?: string;
required?: boolean;
noExport?: boolean;
readOnly?: boolean;
value?: number | string;
defaultValue?: number | string;
}
interface FieldSetProps extends NodeProps {
name: string;
}
export class FieldSet extends React.Component<
React.PropsWithChildren<FieldSetProps>
> {}
// see http://pdfkit.org/docs/forms.html#text_field_formatting
interface TextInputFormatting {
type:
| 'date'
| 'time'
| 'percent'
| 'number'
| 'zip'
| 'zipPlus4'
| 'phone'
| 'ssn';
param?: string;
nDec?: number;
sepComma?: boolean;
negStyle?: 'MinusBlack' | 'Red' | 'ParensBlack' | 'ParensRed';
currency?: string;
currencyPrepend?: boolean;
}
// see http://pdfkit.org/docs/forms.html#text_field_formatting
interface TextInputProps extends FormCommonProps {
align?: 'left' | 'center' | 'right';
multiline?: boolean;
/**
* The text will be masked (e.g. with asterisks).
*/
password?: boolean;
/**
* If set, text entered in the field is not spell-checked
*/
noSpell?: boolean;
format?: TextInputFormatting;
/**
* Sets the fontSize (default or 0 means auto sizing)
*/
fontSize?: number;
/**
* Sets the maximum length (characters) of the text in the field
*/
maxLength?: number;
}
export class TextInput extends React.Component<TextInputProps> {}
interface CheckboxProps extends FormCommonProps {
backgroundColor?: string;
borderColor?: string;
checked?: boolean;
onState?: string;
offState?: string;
xMark?: boolean;
}
export class Checkbox extends React.Component<CheckboxProps> {}
interface SelectAndListPropsBase extends FormCommonProps {
sort?: boolean;
edit?: boolean;
multiSelect?: boolean;
noSpell?: boolean;
select?: string[];
}
type SelectAndListPropsWithEdit = SelectAndListPropsBase & {
edit: true | false;
noSpell: boolean;
};
type SelectAndListPropsWithNoSpell = SelectAndListPropsBase & {
edit: boolean;
noSpell: true | false;
};
type SelectAndListProps =
| SelectAndListPropsWithEdit
| SelectAndListPropsWithNoSpell;
export class Select extends React.Component<SelectAndListProps> {}
export class List extends React.Component<SelectAndListProps> {}
interface NoteProps extends NodeProps {
children: string;
}
export class Note extends React.Component<NoteProps> {}
interface CanvasProps extends NodeProps {
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
paint: (
painter: any,
availableWidth: number,
availableHeight: number,
) => null;
}
export class Canvas extends React.Component<CanvasProps> {}
interface SVGProps extends NodeProps, SVGPresentationAttributes {
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
width?: string | number;
height?: string | number;
viewBox?: string;
preserveAspectRatio?: string;
}
/**
* The <SVG /> element is a container that defines a new coordinate system and viewport. It is used as the outermost element of SVG documents.
*/
export class Svg extends React.Component<React.PropsWithChildren<SVGProps>> {}
interface LineProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
x1: string | number;
x2: string | number;
y1: string | number;
y2: string | number;
}
/**
* The <Line /> element is used to create a line.
*/
export class Line extends React.Component<
React.PropsWithChildren<LineProps>
> {}
interface PolylineProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
points: string;
}
/**
* The <Polyline /> element is used to create any shape that consists of only straight lines (that is connected at several points).
*/
export class Polyline extends React.Component<
React.PropsWithChildren<PolylineProps>
> {}
interface PolygonProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
points: string;
}
/**
* The <Polygon /> element is used to create a graphic that contains at least three sides.
* Polygons are made of straight lines, and the shape is "closed" (all the lines connect up).
*/
export class Polygon extends React.Component<
React.PropsWithChildren<PolygonProps>
> {}
interface PathProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
d: string;
}
/**
* The <Path /> element is the most powerful element in the SVG library of basic shapes. It can be used to create lines, curves, arcs, and more.
*/
export class Path extends React.Component<
React.PropsWithChildren<PathProps>
> {}
interface RectProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
x?: string | number;
y?: string | number;
width: string | number;
height: string | number;
rx?: string | number;
ry?: string | number;
}
/**
* The <Rect /> element is used to create a rectangle and variations of a rectangle shape.
*/
export class Rect extends React.Component<
React.PropsWithChildren<RectProps>
> {}
interface CircleProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
cx?: string | number;
cy?: string | number;
r: string | number;
}
/**
* The <Circle /> element is used to create a circle.
*/
export class Circle extends React.Component<
React.PropsWithChildren<CircleProps>
> {}
interface EllipseProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
cx?: string | number;
cy?: string | number;
rx: string | number;
ry: string | number;
}
/**
* The <Ellipse /> element is used to create an ellipse.
* An ellipse is closely related to a circle. The difference is that an ellipse has an x and a y radius that differs from each other, while a circle has equal x and y radius.
*/
export class Ellipse extends React.Component<
React.PropsWithChildren<EllipseProps>
> {}
interface TspanProps extends SVGPresentationAttributes {
x?: string | number;
y?: string | number;
}
/**
* The <Tspan /> element defines a subtext within a <Text /> element or another <Tspan /> element.
* It allows for adjustment of the style and/or position of that subtext as needed.
*/
export class Tspan extends React.Component<
React.PropsWithChildren<TspanProps>
> {}
interface GProps extends SVGPresentationAttributes {
style?: Style;
}
/**
* The <G /> SVG element is a container used to group other SVG elements.
* Transformations applied to the <G /> element are performed on its child elements, and its attributes are inherited by its children.
*/
export class G extends React.Component<React.PropsWithChildren<GProps>> {}
interface StopProps {
offset: string | number;
stopColor: string;
stopOpacity?: string | number;
}
/**
* The SVG <Stop /> element defines a color and its position to use on a gradient. This element is always a child of a <LinearGradient /> or <RadialGradient /> element
*/
export class Stop extends React.Component<
React.PropsWithChildren<StopProps>
> {}
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
interface DefsProps {}
/**
* The <Defs /> element is used to store graphical objects that will be used at a later time. Objects created inside a <Defs /> element are not rendered directly. To display them you have to reference them
*/
export class Defs extends React.Component<
React.PropsWithChildren<DefsProps>
> {}
interface ClipPathProps {
id?: string;
}
/**
* The <ClipPath /> SVG element defines a clipping path, to be used by the clipPath property.
* A clipping path restricts the region to which paint can be applied. Conceptually, parts of the drawing that lie outside of the region bounded by the clipping path are not drawn.
*/
export class ClipPath extends React.Component<
React.PropsWithChildren<ClipPathProps>
> {}
interface MarkerProps {
id: string;
viewBox?: string;
refX?: string | number;
refY?: string | number;
markerWidth?: string | number;
markerHeight?: string | number;
orient?: 'auto' | 'auto-start-reverse' | number;
markerUnits?: 'strokeWidth' | 'userSpaceOnUse';
}
/**
* The <Marker /> SVG element defines a graphic used for drawing arrows or polymarkers on a given <Path />, <Line />, <Polyline />, or <Polygon /> element.
* Markers can be attached to shapes using the markerStart, markerMid, and markerEnd properties.
*/
export class Marker extends React.Component<
React.PropsWithChildren<MarkerProps>
> {}
interface LinearGradientProps {
id: string;
x1?: string | number;
x2?: string | number;
y1?: string | number;
y2?: string | number;
xlinkHref?: string;
gradientTransform?: string;
gradientUnits?: 'userSpaceOnUse' | 'objectBoundingBox';
}
/**
* The <LinearGradient /> element lets authors define linear gradients that can be applied to fill or stroke of graphical elements.
*/
export class LinearGradient extends React.Component<
React.PropsWithChildren<LinearGradientProps>
> {}
interface RadialGradientProps {
id: string;
cx?: string | number;
cy?: string | number;
r?: string | number;
fx?: string | number;
fy?: string | number;
xlinkHref?: string;
gradientTransform?: string;
gradientUnits?: 'userSpaceOnUse' | 'objectBoundingBox';
}
/**
* The <RadialGradient /> element lets authors define radial gradients that can be applied to fill or stroke of graphical elements.
*/
export class RadialGradient extends React.Component<
React.PropsWithChildren<RadialGradientProps>
> {}
interface BlobProviderParams {
blob: Blob | null;
url: string | null;
loading: boolean;
error: Error | null;
}
interface BlobProviderProps {
document: React.ReactElement<DocumentProps>;
children: (params: BlobProviderParams) => React.ReactNode;
}
/**
* Easy and declarative way of getting document's blob data without
* showing it on screen.
* @see https://react-pdf.org/advanced#on-the-fly-rendering
* @platform web
*/
export class BlobProvider extends React.Component<BlobProviderProps> {}
interface PDFViewerProps {
width?: number | string;
height?: number | string;
style?: Style | Style[];
className?: string;
children?: React.ReactElement<DocumentProps>;
innerRef?: React.Ref<HTMLIFrameElement>;
showToolbar?: boolean;
}
/**
* Iframe PDF viewer for client-side generated documents.
* @platform web
*/
export class PDFViewer extends React.Component<PDFViewerProps> {}
interface PDFDownloadLinkProps
extends Omit<
React.AnchorHTMLAttributes<HTMLAnchorElement>,
'href' | 'children'
> {
/** PDF filename. Alias for anchor tag `download` attribute. */
fileName?: string;
document: React.ReactElement<DocumentProps>;
children?: React.ReactNode | React.FC<BlobProviderParams>;
onClick?: React.AnchorHTMLAttributes<HTMLAnchorElement>['onClick'] &
((
event: React.MouseEvent<HTMLAnchorElement, MouseEvent>,
instance: UsePDFInstance,
) => void);
ref?: React.Ref<HTMLAnchorElement> | undefined;
}
/**
* Anchor tag to enable generate and download PDF documents on the fly.
* @see https://react-pdf.org/advanced#on-the-fly-rendering
* @platform web
*/
export class PDFDownloadLink extends React.Component<PDFDownloadLinkProps> {}
interface UsePDFInstance {
loading: boolean;
blob: Blob | null;
url: string | null;
error: string | null;
}
/**
* React hook for creating and updating a PDF document instance
* @platform web
*/
export function usePDF(options?: {
document?: React.ReactElement<DocumentProps>;
}): [
UsePDFInstance,
(newDocument: React.ReactElement<DocumentProps>) => void,
];
export const Font: FontStore;
export const StyleSheet: {
create: <T extends Styles>(styles: T) => T;
};
export const version: any;
export const PDFRenderer: any;
export const pdf: (initialValue?: React.ReactElement<DocumentProps>) => {
container: any;
isDirty: () => boolean;
toString: () => string;
toBlob: () => Promise<Blob>;
toBuffer: () => Promise<NodeJS.ReadableStream>;
on: (event: 'change', callback: () => void) => void;
updateContainer: (
document: React.ReactElement<any>,
callback?: () => void,
) => void;
removeListener: (event: 'change', callback: () => void) => void;
};
export const renderToStream: (
document: React.ReactElement<DocumentProps>,
) => Promise<NodeJS.ReadableStream>;
/**
* @deprecated use the `renderToBuffer` method
*/
export const renderToString: (
document: React.ReactElement<DocumentProps>,
) => Promise<string>;
export const renderToFile: (
document: React.ReactElement<DocumentProps>,
filePath: string,
callback?: (output: NodeJS.ReadableStream, _filePath: string) => any,
) => Promise<NodeJS.ReadableStream>;
const render: typeof renderToFile;
/**
* Render document into a nodejs buffer
* @platform node
*/
export const renderToBuffer: (
document: React.ReactElement<ReactPDF.DocumentProps>,
) => Promise<Buffer>;
}

View File

@@ -0,0 +1,793 @@
/* eslint-disable max-classes-per-file */
import * as React from 'react';
import {
Style,
PageSize,
FontStore,
PDFVersion,
Orientation,
SourceObject,
SrcSet,
Sizes,
HyphenationCallback,
SVGPresentationAttributes,
Bookmark,
PageLayout,
PageMode,
HitSlop,
} from '@react-pdf/types';
declare class ReactPDF {
static default: typeof ReactPDF;
}
export = ReactPDF;
declare namespace ReactPDF {
interface Styles {
[key: string]: Style;
}
interface OnRenderProps {
blob?: Blob;
}
interface Permissions {
printing?: 'lowResolution' | 'highResolution';
modifying?: boolean;
copying?: boolean;
annotating?: boolean;
fillingForms?: boolean;
contentAccessibility?: boolean;
documentAssembly?: boolean;
}
interface DocumentProps {
style?: Style | Style[];
title?: string;
author?: string;
subject?: string;
creator?: string;
keywords?: string;
producer?: string;
language?: string;
creationDate?: Date;
modificationDate?: Date;
pdfVersion?: PDFVersion;
pageMode?: PageMode;
pageLayout?: PageLayout;
ownerPassword?: string;
userPassword?: string;
permissions?: Permissions;
onRender?: (props: OnRenderProps) => any;
}
/**
* This component represent the PDF document itself. It must be the root
* of your tree element structure, and under no circumstances should it be
* used as children of another react-pdf component. In addition, it should
* only have childs of type <Page />.
*/
export class Document extends React.Component<
React.PropsWithChildren<DocumentProps>
> {}
interface NodeProps {
id?: string;
style?: Style | Style[];
/**
* Render component in all wrapped pages.
* @see https://react-pdf.org/advanced#fixed-components
*/
fixed?: boolean;
/**
* Force the wrapping algorithm to start a new page when rendering the
* element.
* @see https://react-pdf.org/advanced#page-breaks
*/
break?: boolean;
/**
* Hint that no page wrapping should occur between all sibling elements following the element within n points
* @see https://react-pdf.org/advanced#orphan-&-widow-protection
*/
minPresenceAhead?: number;
}
interface PageProps extends NodeProps {
/**
* Enable page wrapping for this page.
* @see https://react-pdf.org/components#page-wrapping
*/
wrap?: boolean;
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
size?: PageSize;
orientation?: Orientation;
dpi?: number;
bookmark?: Bookmark;
}
/**
* Represents single page inside the PDF document, or a subset of them if
* using the wrapping feature. A <Document /> can contain as many pages as
* you want, but ensure not rendering a page inside any component besides
* Document.
*/
export class Page extends React.Component<
React.PropsWithChildren<PageProps>
> {}
interface ViewProps extends NodeProps {
id?: string;
/**
* Enable/disable page wrapping for element.
* @see https://react-pdf.org/components#page-wrapping
*/
wrap?: boolean;
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
render?: (props: {
pageNumber: number;
subPageNumber: number;
}) => React.ReactNode;
}
/**
* The most fundamental component for building a UI and is designed to be
* nested inside other views and can have 0 to many children.
*/
export class View extends React.Component<
React.PropsWithChildren<ViewProps>
> {}
interface BaseImageProps extends NodeProps {
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
cache?: boolean;
/**
* A comma-separated list of image sources with width descriptors.
* Works like the HTML img srcSet attribute.
* @example "small.jpg 300w, medium.jpg 600w, large.jpg 900w"
*/
srcSet?: SrcSet;
/**
* The intended display width of the image, used to select the best source
* from srcSet. Accepts a number (in points) or a string.
* Works like the HTML img sizes attribute.
* @example 300
* @example "300"
*/
sizes?: Sizes;
}
interface ImageWithSrcProp extends BaseImageProps {
src: SourceObject;
}
interface ImageWithSourceProp extends BaseImageProps {
source: SourceObject;
}
type ImageProps = ImageWithSrcProp | ImageWithSourceProp;
/**
* A React component for displaying network or local (Node only) JPG or
* PNG images, as well as base64 encoded image strings.
*/
export class Image extends React.Component<ImageProps> {}
interface BaseImageBackgroundProps extends NodeProps {
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
cache?: boolean;
/**
* A comma-separated list of image sources with width descriptors.
* Works like the HTML img srcSet attribute.
* @example "small.jpg 300w, medium.jpg 600w, large.jpg 900w"
*/
srcSet?: SrcSet;
/**
* The intended display width of the image, used to select the best source
* from srcSet. Accepts a number (in points) or a string.
* @example 300
*/
sizes?: Sizes;
/**
* Style applied to the background image.
*/
imageStyle?: Style;
}
interface ImageBackgroundWithSrcProp extends BaseImageBackgroundProps {
src: SourceObject;
}
interface ImageBackgroundWithSourceProp extends BaseImageBackgroundProps {
source: SourceObject;
}
type ImageBackgroundProps =
| ImageBackgroundWithSrcProp
| ImageBackgroundWithSourceProp;
/**
* A React component for displaying an image behind child content.
* Compatible with React Native's ImageBackground component.
* @see https://reactnative.dev/docs/imagebackground
*/
export class ImageBackground extends React.Component<
React.PropsWithChildren<ImageBackgroundProps>
> {}
interface TextProps extends NodeProps {
id?: string;
/**
* Enable/disable page wrapping for element.
* @see https://react-pdf.org/components#page-wrapping
*/
wrap?: boolean;
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
render?: (props: {
pageNumber: number;
totalPages: number;
subPageNumber: number;
subPageTotalPages: number;
}) => React.ReactNode;
/**
* Override the default hyphenation-callback
* @see https://react-pdf.org/fonts#registerhyphenationcallback
*/
hyphenationCallback?: HyphenationCallback;
/**
* Specifies the minimum number of lines in a text element that must be shown at the bottom of a page or its container.
* @see https://react-pdf.org/advanced#orphan-&-widow-protection
*/
orphans?: number;
/**
* Specifies the minimum number of lines in a text element that must be shown at the top of a page or its container..
* @see https://react-pdf.org/advanced#orphan-&-widow-protection
*/
widows?: number;
}
interface SVGTextProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
x: string | number;
y: string | number;
/**
* Override the default hyphenation-callback
* @see https://react-pdf.org/fonts#registerhyphenationcallback
*/
hyphenationCallback?: HyphenationCallback;
}
/**
* A React component for displaying text. Text supports nesting of other
* Text or Link components to create inline styling.
*/
export class Text extends React.Component<
React.PropsWithChildren<TextProps> | SVGTextProps
> {}
interface LinkProps extends NodeProps {
/**
* Enable/disable page wrapping for element.
* @see https://react-pdf.org/components#page-wrapping
*/
wrap?: boolean;
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
href?: string;
src?: string;
/**
* Extends the clickable area of the link beyond its visible bounds.
* Accepts a number (applied to all sides) or an object with top, bottom, left, right.
* @see https://reactnative.dev/docs/view#hitslop
*/
hitSlop?: HitSlop;
}
/**
* A React component for displaying a hyperlink. Links can be nested
* inside a Text component, or being inside any other valid primitive.
*/
export class Link extends React.Component<
React.PropsWithChildren<LinkProps>
> {}
interface FormCommonProps extends NodeProps {
name?: string;
required?: boolean;
noExport?: boolean;
readOnly?: boolean;
value?: number | string;
defaultValue?: number | string;
}
interface FieldSetProps extends NodeProps {
name: string;
}
export class FieldSet extends React.Component<
React.PropsWithChildren<FieldSetProps>
> {}
// see http://pdfkit.org/docs/forms.html#text_field_formatting
interface TextInputFormatting {
type:
| 'date'
| 'time'
| 'percent'
| 'number'
| 'zip'
| 'zipPlus4'
| 'phone'
| 'ssn';
param?: string;
nDec?: number;
sepComma?: boolean;
negStyle?: 'MinusBlack' | 'Red' | 'ParensBlack' | 'ParensRed';
currency?: string;
currencyPrepend?: boolean;
}
// see http://pdfkit.org/docs/forms.html#text_field_formatting
interface TextInputProps extends FormCommonProps {
align?: 'left' | 'center' | 'right';
multiline?: boolean;
/**
* The text will be masked (e.g. with asterisks).
*/
password?: boolean;
/**
* If set, text entered in the field is not spell-checked
*/
noSpell?: boolean;
format?: TextInputFormatting;
/**
* Sets the fontSize (default or 0 means auto sizing)
*/
fontSize?: number;
/**
* Sets the maximum length (characters) of the text in the field
*/
maxLength?: number;
}
export class TextInput extends React.Component<TextInputProps> {}
interface CheckboxProps extends FormCommonProps {
backgroundColor?: string;
borderColor?: string;
checked?: boolean;
onState?: string;
offState?: string;
xMark?: boolean;
}
export class Checkbox extends React.Component<CheckboxProps> {}
interface SelectAndListPropsBase extends FormCommonProps {
sort?: boolean;
edit?: boolean;
multiSelect?: boolean;
noSpell?: boolean;
select?: string[];
}
type SelectAndListPropsWithEdit = SelectAndListPropsBase & {
edit: true | false;
noSpell: boolean;
};
type SelectAndListPropsWithNoSpell = SelectAndListPropsBase & {
edit: boolean;
noSpell: true | false;
};
type SelectAndListProps =
| SelectAndListPropsWithEdit
| SelectAndListPropsWithNoSpell;
export class Select extends React.Component<SelectAndListProps> {}
export class List extends React.Component<SelectAndListProps> {}
interface NoteProps extends NodeProps {
children: string;
}
export class Note extends React.Component<NoteProps> {}
interface CanvasProps extends NodeProps {
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
paint: (
painter: any,
availableWidth: number,
availableHeight: number,
) => null;
}
export class Canvas extends React.Component<CanvasProps> {}
interface SVGProps extends NodeProps, SVGPresentationAttributes {
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
width?: string | number;
height?: string | number;
viewBox?: string;
preserveAspectRatio?: string;
}
/**
* The <SVG /> element is a container that defines a new coordinate system and viewport. It is used as the outermost element of SVG documents.
*/
export class Svg extends React.Component<React.PropsWithChildren<SVGProps>> {}
interface LineProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
x1: string | number;
x2: string | number;
y1: string | number;
y2: string | number;
}
/**
* The <Line /> element is used to create a line.
*/
export class Line extends React.Component<
React.PropsWithChildren<LineProps>
> {}
interface PolylineProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
points: string;
}
/**
* The <Polyline /> element is used to create any shape that consists of only straight lines (that is connected at several points).
*/
export class Polyline extends React.Component<
React.PropsWithChildren<PolylineProps>
> {}
interface PolygonProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
points: string;
}
/**
* The <Polygon /> element is used to create a graphic that contains at least three sides.
* Polygons are made of straight lines, and the shape is "closed" (all the lines connect up).
*/
export class Polygon extends React.Component<
React.PropsWithChildren<PolygonProps>
> {}
interface PathProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
d: string;
}
/**
* The <Path /> element is the most powerful element in the SVG library of basic shapes. It can be used to create lines, curves, arcs, and more.
*/
export class Path extends React.Component<
React.PropsWithChildren<PathProps>
> {}
interface RectProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
x?: string | number;
y?: string | number;
width: string | number;
height: string | number;
rx?: string | number;
ry?: string | number;
}
/**
* The <Rect /> element is used to create a rectangle and variations of a rectangle shape.
*/
export class Rect extends React.Component<
React.PropsWithChildren<RectProps>
> {}
interface CircleProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
cx?: string | number;
cy?: string | number;
r: string | number;
}
/**
* The <Circle /> element is used to create a circle.
*/
export class Circle extends React.Component<
React.PropsWithChildren<CircleProps>
> {}
interface EllipseProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
cx?: string | number;
cy?: string | number;
rx: string | number;
ry: string | number;
}
/**
* The <Ellipse /> element is used to create an ellipse.
* An ellipse is closely related to a circle. The difference is that an ellipse has an x and a y radius that differs from each other, while a circle has equal x and y radius.
*/
export class Ellipse extends React.Component<
React.PropsWithChildren<EllipseProps>
> {}
interface TspanProps extends SVGPresentationAttributes {
x?: string | number;
y?: string | number;
}
/**
* The <Tspan /> element defines a subtext within a <Text /> element or another <Tspan /> element.
* It allows for adjustment of the style and/or position of that subtext as needed.
*/
export class Tspan extends React.Component<
React.PropsWithChildren<TspanProps>
> {}
interface GProps extends SVGPresentationAttributes {
style?: Style;
}
/**
* The <G /> SVG element is a container used to group other SVG elements.
* Transformations applied to the <G /> element are performed on its child elements, and its attributes are inherited by its children.
*/
export class G extends React.Component<React.PropsWithChildren<GProps>> {}
interface StopProps {
offset: string | number;
stopColor: string;
stopOpacity?: string | number;
}
/**
* The SVG <Stop /> element defines a color and its position to use on a gradient. This element is always a child of a <LinearGradient /> or <RadialGradient /> element
*/
export class Stop extends React.Component<
React.PropsWithChildren<StopProps>
> {}
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
interface DefsProps {}
/**
* The <Defs /> element is used to store graphical objects that will be used at a later time. Objects created inside a <Defs /> element are not rendered directly. To display them you have to reference them
*/
export class Defs extends React.Component<
React.PropsWithChildren<DefsProps>
> {}
interface ClipPathProps {
id?: string;
}
/**
* The <ClipPath /> SVG element defines a clipping path, to be used by the clipPath property.
* A clipping path restricts the region to which paint can be applied. Conceptually, parts of the drawing that lie outside of the region bounded by the clipping path are not drawn.
*/
export class ClipPath extends React.Component<
React.PropsWithChildren<ClipPathProps>
> {}
interface MarkerProps {
id: string;
viewBox?: string;
refX?: string | number;
refY?: string | number;
markerWidth?: string | number;
markerHeight?: string | number;
orient?: 'auto' | 'auto-start-reverse' | number;
markerUnits?: 'strokeWidth' | 'userSpaceOnUse';
}
/**
* The <Marker /> SVG element defines a graphic used for drawing arrows or polymarkers on a given <Path />, <Line />, <Polyline />, or <Polygon /> element.
* Markers can be attached to shapes using the markerStart, markerMid, and markerEnd properties.
*/
export class Marker extends React.Component<
React.PropsWithChildren<MarkerProps>
> {}
interface LinearGradientProps {
id: string;
x1?: string | number;
x2?: string | number;
y1?: string | number;
y2?: string | number;
xlinkHref?: string;
gradientTransform?: string;
gradientUnits?: 'userSpaceOnUse' | 'objectBoundingBox';
}
/**
* The <LinearGradient /> element lets authors define linear gradients that can be applied to fill or stroke of graphical elements.
*/
export class LinearGradient extends React.Component<
React.PropsWithChildren<LinearGradientProps>
> {}
interface RadialGradientProps {
id: string;
cx?: string | number;
cy?: string | number;
r?: string | number;
fx?: string | number;
fy?: string | number;
xlinkHref?: string;
gradientTransform?: string;
gradientUnits?: 'userSpaceOnUse' | 'objectBoundingBox';
}
/**
* The <RadialGradient /> element lets authors define radial gradients that can be applied to fill or stroke of graphical elements.
*/
export class RadialGradient extends React.Component<
React.PropsWithChildren<RadialGradientProps>
> {}
interface BlobProviderParams {
blob: Blob | null;
url: string | null;
loading: boolean;
error: Error | null;
}
interface BlobProviderProps {
document: React.ReactElement<DocumentProps>;
children: (params: BlobProviderParams) => React.ReactNode;
}
/**
* Easy and declarative way of getting document's blob data without
* showing it on screen.
* @see https://react-pdf.org/advanced#on-the-fly-rendering
* @platform web
*/
export class BlobProvider extends React.Component<BlobProviderProps> {}
interface PDFViewerProps {
width?: number | string;
height?: number | string;
style?: Style | Style[];
className?: string;
children?: React.ReactElement<DocumentProps>;
innerRef?: React.Ref<HTMLIFrameElement>;
showToolbar?: boolean;
}
/**
* Iframe PDF viewer for client-side generated documents.
* @platform web
*/
export class PDFViewer extends React.Component<PDFViewerProps> {}
interface PDFDownloadLinkProps
extends Omit<
React.AnchorHTMLAttributes<HTMLAnchorElement>,
'href' | 'children'
> {
/** PDF filename. Alias for anchor tag `download` attribute. */
fileName?: string;
document: React.ReactElement<DocumentProps>;
children?: React.ReactNode | React.FC<BlobProviderParams>;
onClick?: React.AnchorHTMLAttributes<HTMLAnchorElement>['onClick'] &
((
event: React.MouseEvent<HTMLAnchorElement, MouseEvent>,
instance: UsePDFInstance,
) => void);
ref?: React.Ref<HTMLAnchorElement> | undefined;
}
/**
* Anchor tag to enable generate and download PDF documents on the fly.
* @see https://react-pdf.org/advanced#on-the-fly-rendering
* @platform web
*/
export class PDFDownloadLink extends React.Component<PDFDownloadLinkProps> {}
interface UsePDFInstance {
loading: boolean;
blob: Blob | null;
url: string | null;
error: string | null;
}
/**
* React hook for creating and updating a PDF document instance
* @platform web
*/
export function usePDF(options?: {
document?: React.ReactElement<DocumentProps>;
}): [
UsePDFInstance,
(newDocument: React.ReactElement<DocumentProps>) => void,
];
export const Font: FontStore;
export const StyleSheet: {
create: <T extends Styles>(styles: T) => T;
};
export const version: any;
export const PDFRenderer: any;
export const pdf: (initialValue?: React.ReactElement<DocumentProps>) => {
container: any;
isDirty: () => boolean;
toString: () => string;
toBlob: () => Promise<Blob>;
toBuffer: () => Promise<NodeJS.ReadableStream>;
on: (event: 'change', callback: () => void) => void;
updateContainer: (
document: React.ReactElement<any>,
callback?: () => void,
) => void;
removeListener: (event: 'change', callback: () => void) => void;
};
export const renderToStream: (
document: React.ReactElement<DocumentProps>,
) => Promise<NodeJS.ReadableStream>;
/**
* @deprecated use the `renderToBuffer` method
*/
export const renderToString: (
document: React.ReactElement<DocumentProps>,
) => Promise<string>;
export const renderToFile: (
document: React.ReactElement<DocumentProps>,
filePath: string,
callback?: (output: NodeJS.ReadableStream, _filePath: string) => any,
) => Promise<NodeJS.ReadableStream>;
const render: typeof renderToFile;
/**
* Render document into a nodejs buffer
* @platform node
*/
export const renderToBuffer: (
document: React.ReactElement<ReactPDF.DocumentProps>,
) => Promise<Buffer>;
}

View File

@@ -0,0 +1,793 @@
/* eslint-disable max-classes-per-file */
import * as React from 'react';
import {
Style,
PageSize,
FontStore,
PDFVersion,
Orientation,
SourceObject,
SrcSet,
Sizes,
HyphenationCallback,
SVGPresentationAttributes,
Bookmark,
PageLayout,
PageMode,
HitSlop,
} from '@react-pdf/types';
declare class ReactPDF {
static default: typeof ReactPDF;
}
export = ReactPDF;
declare namespace ReactPDF {
interface Styles {
[key: string]: Style;
}
interface OnRenderProps {
blob?: Blob;
}
interface Permissions {
printing?: 'lowResolution' | 'highResolution';
modifying?: boolean;
copying?: boolean;
annotating?: boolean;
fillingForms?: boolean;
contentAccessibility?: boolean;
documentAssembly?: boolean;
}
interface DocumentProps {
style?: Style | Style[];
title?: string;
author?: string;
subject?: string;
creator?: string;
keywords?: string;
producer?: string;
language?: string;
creationDate?: Date;
modificationDate?: Date;
pdfVersion?: PDFVersion;
pageMode?: PageMode;
pageLayout?: PageLayout;
ownerPassword?: string;
userPassword?: string;
permissions?: Permissions;
onRender?: (props: OnRenderProps) => any;
}
/**
* This component represent the PDF document itself. It must be the root
* of your tree element structure, and under no circumstances should it be
* used as children of another react-pdf component. In addition, it should
* only have childs of type <Page />.
*/
export class Document extends React.Component<
React.PropsWithChildren<DocumentProps>
> {}
interface NodeProps {
id?: string;
style?: Style | Style[];
/**
* Render component in all wrapped pages.
* @see https://react-pdf.org/advanced#fixed-components
*/
fixed?: boolean;
/**
* Force the wrapping algorithm to start a new page when rendering the
* element.
* @see https://react-pdf.org/advanced#page-breaks
*/
break?: boolean;
/**
* Hint that no page wrapping should occur between all sibling elements following the element within n points
* @see https://react-pdf.org/advanced#orphan-&-widow-protection
*/
minPresenceAhead?: number;
}
interface PageProps extends NodeProps {
/**
* Enable page wrapping for this page.
* @see https://react-pdf.org/components#page-wrapping
*/
wrap?: boolean;
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
size?: PageSize;
orientation?: Orientation;
dpi?: number;
bookmark?: Bookmark;
}
/**
* Represents single page inside the PDF document, or a subset of them if
* using the wrapping feature. A <Document /> can contain as many pages as
* you want, but ensure not rendering a page inside any component besides
* Document.
*/
export class Page extends React.Component<
React.PropsWithChildren<PageProps>
> {}
interface ViewProps extends NodeProps {
id?: string;
/**
* Enable/disable page wrapping for element.
* @see https://react-pdf.org/components#page-wrapping
*/
wrap?: boolean;
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
render?: (props: {
pageNumber: number;
subPageNumber: number;
}) => React.ReactNode;
}
/**
* The most fundamental component for building a UI and is designed to be
* nested inside other views and can have 0 to many children.
*/
export class View extends React.Component<
React.PropsWithChildren<ViewProps>
> {}
interface BaseImageProps extends NodeProps {
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
cache?: boolean;
/**
* A comma-separated list of image sources with width descriptors.
* Works like the HTML img srcSet attribute.
* @example "small.jpg 300w, medium.jpg 600w, large.jpg 900w"
*/
srcSet?: SrcSet;
/**
* The intended display width of the image, used to select the best source
* from srcSet. Accepts a number (in points) or a string.
* Works like the HTML img sizes attribute.
* @example 300
* @example "300"
*/
sizes?: Sizes;
}
interface ImageWithSrcProp extends BaseImageProps {
src: SourceObject;
}
interface ImageWithSourceProp extends BaseImageProps {
source: SourceObject;
}
type ImageProps = ImageWithSrcProp | ImageWithSourceProp;
/**
* A React component for displaying network or local (Node only) JPG or
* PNG images, as well as base64 encoded image strings.
*/
export class Image extends React.Component<ImageProps> {}
interface BaseImageBackgroundProps extends NodeProps {
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
cache?: boolean;
/**
* A comma-separated list of image sources with width descriptors.
* Works like the HTML img srcSet attribute.
* @example "small.jpg 300w, medium.jpg 600w, large.jpg 900w"
*/
srcSet?: SrcSet;
/**
* The intended display width of the image, used to select the best source
* from srcSet. Accepts a number (in points) or a string.
* @example 300
*/
sizes?: Sizes;
/**
* Style applied to the background image.
*/
imageStyle?: Style;
}
interface ImageBackgroundWithSrcProp extends BaseImageBackgroundProps {
src: SourceObject;
}
interface ImageBackgroundWithSourceProp extends BaseImageBackgroundProps {
source: SourceObject;
}
type ImageBackgroundProps =
| ImageBackgroundWithSrcProp
| ImageBackgroundWithSourceProp;
/**
* A React component for displaying an image behind child content.
* Compatible with React Native's ImageBackground component.
* @see https://reactnative.dev/docs/imagebackground
*/
export class ImageBackground extends React.Component<
React.PropsWithChildren<ImageBackgroundProps>
> {}
interface TextProps extends NodeProps {
id?: string;
/**
* Enable/disable page wrapping for element.
* @see https://react-pdf.org/components#page-wrapping
*/
wrap?: boolean;
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
render?: (props: {
pageNumber: number;
totalPages: number;
subPageNumber: number;
subPageTotalPages: number;
}) => React.ReactNode;
/**
* Override the default hyphenation-callback
* @see https://react-pdf.org/fonts#registerhyphenationcallback
*/
hyphenationCallback?: HyphenationCallback;
/**
* Specifies the minimum number of lines in a text element that must be shown at the bottom of a page or its container.
* @see https://react-pdf.org/advanced#orphan-&-widow-protection
*/
orphans?: number;
/**
* Specifies the minimum number of lines in a text element that must be shown at the top of a page or its container..
* @see https://react-pdf.org/advanced#orphan-&-widow-protection
*/
widows?: number;
}
interface SVGTextProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
x: string | number;
y: string | number;
/**
* Override the default hyphenation-callback
* @see https://react-pdf.org/fonts#registerhyphenationcallback
*/
hyphenationCallback?: HyphenationCallback;
}
/**
* A React component for displaying text. Text supports nesting of other
* Text or Link components to create inline styling.
*/
export class Text extends React.Component<
React.PropsWithChildren<TextProps> | SVGTextProps
> {}
interface LinkProps extends NodeProps {
/**
* Enable/disable page wrapping for element.
* @see https://react-pdf.org/components#page-wrapping
*/
wrap?: boolean;
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
href?: string;
src?: string;
/**
* Extends the clickable area of the link beyond its visible bounds.
* Accepts a number (applied to all sides) or an object with top, bottom, left, right.
* @see https://reactnative.dev/docs/view#hitslop
*/
hitSlop?: HitSlop;
}
/**
* A React component for displaying a hyperlink. Links can be nested
* inside a Text component, or being inside any other valid primitive.
*/
export class Link extends React.Component<
React.PropsWithChildren<LinkProps>
> {}
interface FormCommonProps extends NodeProps {
name?: string;
required?: boolean;
noExport?: boolean;
readOnly?: boolean;
value?: number | string;
defaultValue?: number | string;
}
interface FieldSetProps extends NodeProps {
name: string;
}
export class FieldSet extends React.Component<
React.PropsWithChildren<FieldSetProps>
> {}
// see http://pdfkit.org/docs/forms.html#text_field_formatting
interface TextInputFormatting {
type:
| 'date'
| 'time'
| 'percent'
| 'number'
| 'zip'
| 'zipPlus4'
| 'phone'
| 'ssn';
param?: string;
nDec?: number;
sepComma?: boolean;
negStyle?: 'MinusBlack' | 'Red' | 'ParensBlack' | 'ParensRed';
currency?: string;
currencyPrepend?: boolean;
}
// see http://pdfkit.org/docs/forms.html#text_field_formatting
interface TextInputProps extends FormCommonProps {
align?: 'left' | 'center' | 'right';
multiline?: boolean;
/**
* The text will be masked (e.g. with asterisks).
*/
password?: boolean;
/**
* If set, text entered in the field is not spell-checked
*/
noSpell?: boolean;
format?: TextInputFormatting;
/**
* Sets the fontSize (default or 0 means auto sizing)
*/
fontSize?: number;
/**
* Sets the maximum length (characters) of the text in the field
*/
maxLength?: number;
}
export class TextInput extends React.Component<TextInputProps> {}
interface CheckboxProps extends FormCommonProps {
backgroundColor?: string;
borderColor?: string;
checked?: boolean;
onState?: string;
offState?: string;
xMark?: boolean;
}
export class Checkbox extends React.Component<CheckboxProps> {}
interface SelectAndListPropsBase extends FormCommonProps {
sort?: boolean;
edit?: boolean;
multiSelect?: boolean;
noSpell?: boolean;
select?: string[];
}
type SelectAndListPropsWithEdit = SelectAndListPropsBase & {
edit: true | false;
noSpell: boolean;
};
type SelectAndListPropsWithNoSpell = SelectAndListPropsBase & {
edit: boolean;
noSpell: true | false;
};
type SelectAndListProps =
| SelectAndListPropsWithEdit
| SelectAndListPropsWithNoSpell;
export class Select extends React.Component<SelectAndListProps> {}
export class List extends React.Component<SelectAndListProps> {}
interface NoteProps extends NodeProps {
children: string;
}
export class Note extends React.Component<NoteProps> {}
interface CanvasProps extends NodeProps {
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
paint: (
painter: any,
availableWidth: number,
availableHeight: number,
) => null;
}
export class Canvas extends React.Component<CanvasProps> {}
interface SVGProps extends NodeProps, SVGPresentationAttributes {
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
width?: string | number;
height?: string | number;
viewBox?: string;
preserveAspectRatio?: string;
}
/**
* The <SVG /> element is a container that defines a new coordinate system and viewport. It is used as the outermost element of SVG documents.
*/
export class Svg extends React.Component<React.PropsWithChildren<SVGProps>> {}
interface LineProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
x1: string | number;
x2: string | number;
y1: string | number;
y2: string | number;
}
/**
* The <Line /> element is used to create a line.
*/
export class Line extends React.Component<
React.PropsWithChildren<LineProps>
> {}
interface PolylineProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
points: string;
}
/**
* The <Polyline /> element is used to create any shape that consists of only straight lines (that is connected at several points).
*/
export class Polyline extends React.Component<
React.PropsWithChildren<PolylineProps>
> {}
interface PolygonProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
points: string;
}
/**
* The <Polygon /> element is used to create a graphic that contains at least three sides.
* Polygons are made of straight lines, and the shape is "closed" (all the lines connect up).
*/
export class Polygon extends React.Component<
React.PropsWithChildren<PolygonProps>
> {}
interface PathProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
d: string;
}
/**
* The <Path /> element is the most powerful element in the SVG library of basic shapes. It can be used to create lines, curves, arcs, and more.
*/
export class Path extends React.Component<
React.PropsWithChildren<PathProps>
> {}
interface RectProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
x?: string | number;
y?: string | number;
width: string | number;
height: string | number;
rx?: string | number;
ry?: string | number;
}
/**
* The <Rect /> element is used to create a rectangle and variations of a rectangle shape.
*/
export class Rect extends React.Component<
React.PropsWithChildren<RectProps>
> {}
interface CircleProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
cx?: string | number;
cy?: string | number;
r: string | number;
}
/**
* The <Circle /> element is used to create a circle.
*/
export class Circle extends React.Component<
React.PropsWithChildren<CircleProps>
> {}
interface EllipseProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
cx?: string | number;
cy?: string | number;
rx: string | number;
ry: string | number;
}
/**
* The <Ellipse /> element is used to create an ellipse.
* An ellipse is closely related to a circle. The difference is that an ellipse has an x and a y radius that differs from each other, while a circle has equal x and y radius.
*/
export class Ellipse extends React.Component<
React.PropsWithChildren<EllipseProps>
> {}
interface TspanProps extends SVGPresentationAttributes {
x?: string | number;
y?: string | number;
}
/**
* The <Tspan /> element defines a subtext within a <Text /> element or another <Tspan /> element.
* It allows for adjustment of the style and/or position of that subtext as needed.
*/
export class Tspan extends React.Component<
React.PropsWithChildren<TspanProps>
> {}
interface GProps extends SVGPresentationAttributes {
style?: Style;
}
/**
* The <G /> SVG element is a container used to group other SVG elements.
* Transformations applied to the <G /> element are performed on its child elements, and its attributes are inherited by its children.
*/
export class G extends React.Component<React.PropsWithChildren<GProps>> {}
interface StopProps {
offset: string | number;
stopColor: string;
stopOpacity?: string | number;
}
/**
* The SVG <Stop /> element defines a color and its position to use on a gradient. This element is always a child of a <LinearGradient /> or <RadialGradient /> element
*/
export class Stop extends React.Component<
React.PropsWithChildren<StopProps>
> {}
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
interface DefsProps {}
/**
* The <Defs /> element is used to store graphical objects that will be used at a later time. Objects created inside a <Defs /> element are not rendered directly. To display them you have to reference them
*/
export class Defs extends React.Component<
React.PropsWithChildren<DefsProps>
> {}
interface ClipPathProps {
id?: string;
}
/**
* The <ClipPath /> SVG element defines a clipping path, to be used by the clipPath property.
* A clipping path restricts the region to which paint can be applied. Conceptually, parts of the drawing that lie outside of the region bounded by the clipping path are not drawn.
*/
export class ClipPath extends React.Component<
React.PropsWithChildren<ClipPathProps>
> {}
interface MarkerProps {
id: string;
viewBox?: string;
refX?: string | number;
refY?: string | number;
markerWidth?: string | number;
markerHeight?: string | number;
orient?: 'auto' | 'auto-start-reverse' | number;
markerUnits?: 'strokeWidth' | 'userSpaceOnUse';
}
/**
* The <Marker /> SVG element defines a graphic used for drawing arrows or polymarkers on a given <Path />, <Line />, <Polyline />, or <Polygon /> element.
* Markers can be attached to shapes using the markerStart, markerMid, and markerEnd properties.
*/
export class Marker extends React.Component<
React.PropsWithChildren<MarkerProps>
> {}
interface LinearGradientProps {
id: string;
x1?: string | number;
x2?: string | number;
y1?: string | number;
y2?: string | number;
xlinkHref?: string;
gradientTransform?: string;
gradientUnits?: 'userSpaceOnUse' | 'objectBoundingBox';
}
/**
* The <LinearGradient /> element lets authors define linear gradients that can be applied to fill or stroke of graphical elements.
*/
export class LinearGradient extends React.Component<
React.PropsWithChildren<LinearGradientProps>
> {}
interface RadialGradientProps {
id: string;
cx?: string | number;
cy?: string | number;
r?: string | number;
fx?: string | number;
fy?: string | number;
xlinkHref?: string;
gradientTransform?: string;
gradientUnits?: 'userSpaceOnUse' | 'objectBoundingBox';
}
/**
* The <RadialGradient /> element lets authors define radial gradients that can be applied to fill or stroke of graphical elements.
*/
export class RadialGradient extends React.Component<
React.PropsWithChildren<RadialGradientProps>
> {}
interface BlobProviderParams {
blob: Blob | null;
url: string | null;
loading: boolean;
error: Error | null;
}
interface BlobProviderProps {
document: React.ReactElement<DocumentProps>;
children: (params: BlobProviderParams) => React.ReactNode;
}
/**
* Easy and declarative way of getting document's blob data without
* showing it on screen.
* @see https://react-pdf.org/advanced#on-the-fly-rendering
* @platform web
*/
export class BlobProvider extends React.Component<BlobProviderProps> {}
interface PDFViewerProps {
width?: number | string;
height?: number | string;
style?: Style | Style[];
className?: string;
children?: React.ReactElement<DocumentProps>;
innerRef?: React.Ref<HTMLIFrameElement>;
showToolbar?: boolean;
}
/**
* Iframe PDF viewer for client-side generated documents.
* @platform web
*/
export class PDFViewer extends React.Component<PDFViewerProps> {}
interface PDFDownloadLinkProps
extends Omit<
React.AnchorHTMLAttributes<HTMLAnchorElement>,
'href' | 'children'
> {
/** PDF filename. Alias for anchor tag `download` attribute. */
fileName?: string;
document: React.ReactElement<DocumentProps>;
children?: React.ReactNode | React.FC<BlobProviderParams>;
onClick?: React.AnchorHTMLAttributes<HTMLAnchorElement>['onClick'] &
((
event: React.MouseEvent<HTMLAnchorElement, MouseEvent>,
instance: UsePDFInstance,
) => void);
ref?: React.Ref<HTMLAnchorElement> | undefined;
}
/**
* Anchor tag to enable generate and download PDF documents on the fly.
* @see https://react-pdf.org/advanced#on-the-fly-rendering
* @platform web
*/
export class PDFDownloadLink extends React.Component<PDFDownloadLinkProps> {}
interface UsePDFInstance {
loading: boolean;
blob: Blob | null;
url: string | null;
error: string | null;
}
/**
* React hook for creating and updating a PDF document instance
* @platform web
*/
export function usePDF(options?: {
document?: React.ReactElement<DocumentProps>;
}): [
UsePDFInstance,
(newDocument: React.ReactElement<DocumentProps>) => void,
];
export const Font: FontStore;
export const StyleSheet: {
create: <T extends Styles>(styles: T) => T;
};
export const version: any;
export const PDFRenderer: any;
export const pdf: (initialValue?: React.ReactElement<DocumentProps>) => {
container: any;
isDirty: () => boolean;
toString: () => string;
toBlob: () => Promise<Blob>;
toBuffer: () => Promise<NodeJS.ReadableStream>;
on: (event: 'change', callback: () => void) => void;
updateContainer: (
document: React.ReactElement<any>,
callback?: () => void,
) => void;
removeListener: (event: 'change', callback: () => void) => void;
};
export const renderToStream: (
document: React.ReactElement<DocumentProps>,
) => Promise<NodeJS.ReadableStream>;
/**
* @deprecated use the `renderToBuffer` method
*/
export const renderToString: (
document: React.ReactElement<DocumentProps>,
) => Promise<string>;
export const renderToFile: (
document: React.ReactElement<DocumentProps>,
filePath: string,
callback?: (output: NodeJS.ReadableStream, _filePath: string) => any,
) => Promise<NodeJS.ReadableStream>;
const render: typeof renderToFile;
/**
* Render document into a nodejs buffer
* @platform node
*/
export const renderToBuffer: (
document: React.ReactElement<ReactPDF.DocumentProps>,
) => Promise<Buffer>;
}

View File

@@ -0,0 +1,473 @@
import * as primitives from '@react-pdf/primitives';
export * from '@react-pdf/primitives';
import queue from 'queue';
import { useRef, useState, useEffect, useCallback, forwardRef } from 'react';
import FontStore from '@react-pdf/font';
import renderPDF from '@react-pdf/render';
import PDFDocument from '@react-pdf/pdfkit';
import layoutDocument from '@react-pdf/layout';
import { upperFirst } from '@react-pdf/fns';
import Reconciler from '@react-pdf/reconciler';
import { jsx } from 'react/jsx-runtime';
const omitNils = object => Object.fromEntries(Object.entries(object).filter(_ref => {
let [, value] = _ref;
return value !== undefined;
}));
const createInstance = (type, _ref) => {
let {
style,
children,
...props
} = _ref;
return {
type,
box: {},
style: style || {},
props: props || {},
children: []
};
};
const createTextInstance = text => ({
type: 'TEXT_INSTANCE',
value: text
});
const appendChild = (parent, child) => {
const isParentText = parent.type === 'TEXT' || parent.type === 'LINK' || parent.type === 'TSPAN' || parent.type === 'NOTE';
const isChildTextInstance = child.type === 'TEXT_INSTANCE';
const isOrphanTextInstance = isChildTextInstance && !isParentText;
// Ignore orphan text instances.
// Caused by cases such as <>{name && <Text>{name}</Text>}</>
if (isOrphanTextInstance) {
console.warn(`Invalid '${child.value}' string child outside <Text> component`);
return;
}
parent.children.push(child);
};
const appendChildToContainer = (parentInstance, child) => {
if (parentInstance.type === 'ROOT') {
parentInstance.document = child;
} else {
appendChild(parentInstance, child);
}
};
const insertBefore = (parentInstance, child, beforeChild) => {
var _parentInstance$child;
const index = (_parentInstance$child = parentInstance.children) === null || _parentInstance$child === void 0 ? void 0 : _parentInstance$child.indexOf(beforeChild);
if (index === undefined) return;
if (index !== -1 && child) parentInstance.children.splice(index, 0, child);
};
const removeChild = (parentInstance, child) => {
var _parentInstance$child2;
const index = (_parentInstance$child2 = parentInstance.children) === null || _parentInstance$child2 === void 0 ? void 0 : _parentInstance$child2.indexOf(child);
if (index === undefined) return;
if (index !== -1) parentInstance.children.splice(index, 1);
};
const removeChildFromContainer = (parentInstance, child) => {
var _parentInstance$child3;
const index = (_parentInstance$child3 = parentInstance.children) === null || _parentInstance$child3 === void 0 ? void 0 : _parentInstance$child3.indexOf(child);
if (index === undefined) return;
if (index !== -1) parentInstance.children.splice(index, 1);
};
const commitTextUpdate = (textInstance, oldText, newText) => {
textInstance.value = newText;
};
const commitUpdate = (instance, updatePayload, type, oldProps, newProps) => {
const {
style,
...props
} = newProps;
instance.props = props;
instance.style = style;
};
const createRenderer = _ref2 => {
let {
onChange = () => {}
} = _ref2;
return Reconciler({
appendChild,
appendChildToContainer,
commitTextUpdate,
commitUpdate,
createInstance,
createTextInstance,
insertBefore,
removeChild,
removeChildFromContainer,
resetAfterCommit: onChange
});
};
var version$1 = "4.5.1";
var packageJson = {
version: version$1};
const {
version
} = packageJson;
const fontStore = new FontStore();
// We must keep a single renderer instance, otherwise React will complain
let renderer;
// The pdf instance acts as an event emitter for DOM usage.
// We only want to trigger an update when PDF content changes
const events = {};
const pdf = initialValue => {
const onChange = () => {
var _events$change;
const listeners = ((_events$change = events.change) === null || _events$change === void 0 ? void 0 : _events$change.slice()) || [];
for (let i = 0; i < listeners.length; i += 1) listeners[i]();
};
const container = {
type: 'ROOT',
document: null
};
renderer = renderer || createRenderer({
onChange
});
const mountNode = renderer.createContainer(container);
const updateContainer = (doc, callback) => {
renderer.updateContainer(doc, mountNode, null, callback);
};
if (initialValue) updateContainer(initialValue);
const render = async function (compress) {
if (compress === void 0) {
compress = true;
}
const props = container.document.props || {};
const {
pdfVersion,
language,
pageLayout,
pageMode,
title,
author,
subject,
keywords,
creator = 'react-pdf',
producer = 'react-pdf',
creationDate = new Date(),
modificationDate,
ownerPassword,
userPassword,
permissions
} = props;
const ctx = new PDFDocument({
compress,
pdfVersion,
lang: language,
displayTitle: true,
autoFirstPage: false,
ownerPassword,
userPassword,
permissions,
pageLayout,
info: omitNils({
Title: title,
Author: author,
Subject: subject,
Keywords: keywords,
Creator: creator,
Producer: producer,
CreationDate: creationDate,
ModificationDate: modificationDate
})
});
if (pageMode) {
ctx._root.data.PageMode = upperFirst(pageMode);
}
const layout = await layoutDocument(container.document, fontStore);
const fileStream = renderPDF(ctx, layout);
return {
layout,
fileStream
};
};
const callOnRender = function (params) {
if (params === void 0) {
params = {};
}
if (container.document.props.onRender) {
container.document.props.onRender(params);
}
};
const toBlob = async () => {
const chunks = [];
const {
layout: _INTERNAL__LAYOUT__DATA_,
fileStream: instance
} = await render();
return new Promise((resolve, reject) => {
instance.on('data', chunk => {
chunks.push(chunk instanceof Uint8Array ? chunk : new Uint8Array(chunk));
});
instance.on('end', () => {
try {
const blob = new Blob(chunks, {
type: 'application/pdf'
});
callOnRender({
blob,
_INTERNAL__LAYOUT__DATA_
});
resolve(blob);
} catch (error) {
reject(error);
}
});
});
};
// TODO: rename this method to `toStream` in next major release, because it return stream not a buffer
const toBuffer = async () => {
const {
layout: _INTERNAL__LAYOUT__DATA_,
fileStream
} = await render();
callOnRender({
_INTERNAL__LAYOUT__DATA_
});
return fileStream;
};
/*
* TODO: remove this method in next major release. it is buggy
* see
* - https://github.com/diegomura/react-pdf/issues/2112
* - https://github.com/diegomura/react-pdf/issues/2095
*/
const toString = async () => {
if (process.env.NODE_ENV === 'development') {
console.warn('`toString` is deprecated and will be removed in next major release');
}
let result = '';
const {
fileStream: instance
} = await render(false); // For some reason, when rendering to string if compress=true the document is blank
return new Promise((resolve, reject) => {
try {
instance.on('data', buffer => {
result += buffer;
});
instance.on('end', () => {
callOnRender();
resolve(result);
});
} catch (error) {
reject(error);
}
});
};
const on = (event, listener) => {
if (!events[event]) events[event] = [];
events[event].push(listener);
};
const removeListener = (event, listener) => {
if (!events[event]) return;
const idx = events[event].indexOf(listener);
if (idx > -1) events[event].splice(idx, 1);
};
return {
on,
container,
toBlob,
toBuffer,
toString,
removeListener,
updateContainer
};
};
const Font = fontStore;
const StyleSheet = {
create: s => s
};
/**
* PDF hook
*
* @param {Object} [options] hook options
* @returns {[Object, Function]} pdf state and update function
*/
const usePDF = function (_temp) {
let {
document
} = _temp === void 0 ? {} : _temp;
const pdfInstance = useRef(null);
const [state, setState] = useState({
url: null,
blob: null,
error: null,
loading: !!document
});
// Setup rendering queue
useEffect(() => {
const renderQueue = queue({
autostart: true,
concurrency: 1
});
const queueDocumentRender = () => {
setState(prev => ({
...prev,
loading: true
}));
renderQueue.splice(0, renderQueue.length, () => state.error ? Promise.resolve() : pdfInstance.current.toBlob());
};
const onRenderFailed = error => {
console.error(error);
setState(prev => ({
...prev,
loading: false,
error
}));
};
const onRenderSuccessful = blob => {
setState({
blob,
error: null,
loading: false,
url: URL.createObjectURL(blob)
});
};
pdfInstance.current = pdf();
pdfInstance.current.on('change', queueDocumentRender);
if (document) {
pdfInstance.current.updateContainer(document);
}
renderQueue.on('error', onRenderFailed);
renderQueue.on('success', onRenderSuccessful);
return () => {
renderQueue.end();
pdfInstance.current.removeListener('change', queueDocumentRender);
};
}, []);
// Revoke old unused url instances
useEffect(() => {
return () => {
if (state.url) {
URL.revokeObjectURL(state.url);
}
};
}, [state.url]);
const update = useCallback(newDoc => {
pdfInstance.current.updateContainer(newDoc);
}, []);
return [state, update];
};
const PDFViewer = _ref => {
let {
title,
style,
className,
children,
innerRef,
showToolbar = true,
...props
} = _ref;
const [instance, updateInstance] = usePDF();
useEffect(() => updateInstance(children), [children]);
const src = instance.url ? `${instance.url}#toolbar=${showToolbar ? 1 : 0}` : null;
return /*#__PURE__*/jsx("iframe", {
src: src,
title: title,
ref: innerRef,
style: style,
className: className,
...props
});
};
const BlobProvider = _ref => {
let {
document: doc,
children
} = _ref;
const [instance, updateInstance] = usePDF();
useEffect(() => updateInstance(doc), [doc]);
if (!doc) {
console.warn('You should pass a valid document to BlobProvider');
return null;
}
return children(instance);
};
const PDFDownloadLinkBase = (_ref, ref) => {
let {
fileName = 'document.pdf',
document: doc,
children,
onClick,
href,
...rest
} = _ref;
const [instance, updateInstance] = usePDF();
useEffect(() => updateInstance(doc), [doc]);
if (!doc) {
console.warn('You should pass a valid document to PDFDownloadLink');
return null;
}
const handleDownloadIE = () => {
if (instance && window.navigator.msSaveBlob) {
// IE
window.navigator.msSaveBlob(instance.blob, fileName);
}
};
const handleClick = event => {
handleDownloadIE();
if (typeof onClick === 'function') onClick(event, instance);
};
return /*#__PURE__*/jsx("a", {
href: instance.url,
download: fileName,
onClick: handleClick,
ref: ref,
...rest,
children: typeof children === 'function' ? children(instance) : children
});
};
const PDFDownloadLink = /*#__PURE__*/forwardRef(PDFDownloadLinkBase);
const throwEnvironmentError = name => {
throw new Error(`${name} is a Node specific API. You're either using this method in a browser, or your bundler is not loading react-pdf from the appropriate web build.`);
};
const renderToStream = () => {
throwEnvironmentError('renderToStream');
};
const renderToBuffer = () => {
throwEnvironmentError('renderToBuffer');
};
const renderToString = () => {
throwEnvironmentError('renderToString');
};
const renderToFile = () => {
throwEnvironmentError('renderToFile');
};
const render = () => {
throwEnvironmentError('render');
};
// TODO: remove this default export in next major release because it breaks tree-shacking
var index = {
pdf,
usePDF,
Font,
version,
StyleSheet,
PDFViewer,
BlobProvider,
PDFDownloadLink,
renderToStream,
renderToString,
renderToFile,
render,
...primitives
};
export { BlobProvider, Font, PDFDownloadLink, PDFViewer, StyleSheet, createRenderer, index as default, pdf, render, renderToBuffer, renderToFile, renderToStream, renderToString, usePDF, version };
//# sourceMappingURL=react-pdf.browser.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,793 @@
/* eslint-disable max-classes-per-file */
import * as React from 'react';
import {
Style,
PageSize,
FontStore,
PDFVersion,
Orientation,
SourceObject,
SrcSet,
Sizes,
HyphenationCallback,
SVGPresentationAttributes,
Bookmark,
PageLayout,
PageMode,
HitSlop,
} from '@react-pdf/types';
declare class ReactPDF {
static default: typeof ReactPDF;
}
export = ReactPDF;
declare namespace ReactPDF {
interface Styles {
[key: string]: Style;
}
interface OnRenderProps {
blob?: Blob;
}
interface Permissions {
printing?: 'lowResolution' | 'highResolution';
modifying?: boolean;
copying?: boolean;
annotating?: boolean;
fillingForms?: boolean;
contentAccessibility?: boolean;
documentAssembly?: boolean;
}
interface DocumentProps {
style?: Style | Style[];
title?: string;
author?: string;
subject?: string;
creator?: string;
keywords?: string;
producer?: string;
language?: string;
creationDate?: Date;
modificationDate?: Date;
pdfVersion?: PDFVersion;
pageMode?: PageMode;
pageLayout?: PageLayout;
ownerPassword?: string;
userPassword?: string;
permissions?: Permissions;
onRender?: (props: OnRenderProps) => any;
}
/**
* This component represent the PDF document itself. It must be the root
* of your tree element structure, and under no circumstances should it be
* used as children of another react-pdf component. In addition, it should
* only have childs of type <Page />.
*/
export class Document extends React.Component<
React.PropsWithChildren<DocumentProps>
> {}
interface NodeProps {
id?: string;
style?: Style | Style[];
/**
* Render component in all wrapped pages.
* @see https://react-pdf.org/advanced#fixed-components
*/
fixed?: boolean;
/**
* Force the wrapping algorithm to start a new page when rendering the
* element.
* @see https://react-pdf.org/advanced#page-breaks
*/
break?: boolean;
/**
* Hint that no page wrapping should occur between all sibling elements following the element within n points
* @see https://react-pdf.org/advanced#orphan-&-widow-protection
*/
minPresenceAhead?: number;
}
interface PageProps extends NodeProps {
/**
* Enable page wrapping for this page.
* @see https://react-pdf.org/components#page-wrapping
*/
wrap?: boolean;
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
size?: PageSize;
orientation?: Orientation;
dpi?: number;
bookmark?: Bookmark;
}
/**
* Represents single page inside the PDF document, or a subset of them if
* using the wrapping feature. A <Document /> can contain as many pages as
* you want, but ensure not rendering a page inside any component besides
* Document.
*/
export class Page extends React.Component<
React.PropsWithChildren<PageProps>
> {}
interface ViewProps extends NodeProps {
id?: string;
/**
* Enable/disable page wrapping for element.
* @see https://react-pdf.org/components#page-wrapping
*/
wrap?: boolean;
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
render?: (props: {
pageNumber: number;
subPageNumber: number;
}) => React.ReactNode;
}
/**
* The most fundamental component for building a UI and is designed to be
* nested inside other views and can have 0 to many children.
*/
export class View extends React.Component<
React.PropsWithChildren<ViewProps>
> {}
interface BaseImageProps extends NodeProps {
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
cache?: boolean;
/**
* A comma-separated list of image sources with width descriptors.
* Works like the HTML img srcSet attribute.
* @example "small.jpg 300w, medium.jpg 600w, large.jpg 900w"
*/
srcSet?: SrcSet;
/**
* The intended display width of the image, used to select the best source
* from srcSet. Accepts a number (in points) or a string.
* Works like the HTML img sizes attribute.
* @example 300
* @example "300"
*/
sizes?: Sizes;
}
interface ImageWithSrcProp extends BaseImageProps {
src: SourceObject;
}
interface ImageWithSourceProp extends BaseImageProps {
source: SourceObject;
}
type ImageProps = ImageWithSrcProp | ImageWithSourceProp;
/**
* A React component for displaying network or local (Node only) JPG or
* PNG images, as well as base64 encoded image strings.
*/
export class Image extends React.Component<ImageProps> {}
interface BaseImageBackgroundProps extends NodeProps {
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
cache?: boolean;
/**
* A comma-separated list of image sources with width descriptors.
* Works like the HTML img srcSet attribute.
* @example "small.jpg 300w, medium.jpg 600w, large.jpg 900w"
*/
srcSet?: SrcSet;
/**
* The intended display width of the image, used to select the best source
* from srcSet. Accepts a number (in points) or a string.
* @example 300
*/
sizes?: Sizes;
/**
* Style applied to the background image.
*/
imageStyle?: Style;
}
interface ImageBackgroundWithSrcProp extends BaseImageBackgroundProps {
src: SourceObject;
}
interface ImageBackgroundWithSourceProp extends BaseImageBackgroundProps {
source: SourceObject;
}
type ImageBackgroundProps =
| ImageBackgroundWithSrcProp
| ImageBackgroundWithSourceProp;
/**
* A React component for displaying an image behind child content.
* Compatible with React Native's ImageBackground component.
* @see https://reactnative.dev/docs/imagebackground
*/
export class ImageBackground extends React.Component<
React.PropsWithChildren<ImageBackgroundProps>
> {}
interface TextProps extends NodeProps {
id?: string;
/**
* Enable/disable page wrapping for element.
* @see https://react-pdf.org/components#page-wrapping
*/
wrap?: boolean;
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
render?: (props: {
pageNumber: number;
totalPages: number;
subPageNumber: number;
subPageTotalPages: number;
}) => React.ReactNode;
/**
* Override the default hyphenation-callback
* @see https://react-pdf.org/fonts#registerhyphenationcallback
*/
hyphenationCallback?: HyphenationCallback;
/**
* Specifies the minimum number of lines in a text element that must be shown at the bottom of a page or its container.
* @see https://react-pdf.org/advanced#orphan-&-widow-protection
*/
orphans?: number;
/**
* Specifies the minimum number of lines in a text element that must be shown at the top of a page or its container..
* @see https://react-pdf.org/advanced#orphan-&-widow-protection
*/
widows?: number;
}
interface SVGTextProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
x: string | number;
y: string | number;
/**
* Override the default hyphenation-callback
* @see https://react-pdf.org/fonts#registerhyphenationcallback
*/
hyphenationCallback?: HyphenationCallback;
}
/**
* A React component for displaying text. Text supports nesting of other
* Text or Link components to create inline styling.
*/
export class Text extends React.Component<
React.PropsWithChildren<TextProps> | SVGTextProps
> {}
interface LinkProps extends NodeProps {
/**
* Enable/disable page wrapping for element.
* @see https://react-pdf.org/components#page-wrapping
*/
wrap?: boolean;
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
href?: string;
src?: string;
/**
* Extends the clickable area of the link beyond its visible bounds.
* Accepts a number (applied to all sides) or an object with top, bottom, left, right.
* @see https://reactnative.dev/docs/view#hitslop
*/
hitSlop?: HitSlop;
}
/**
* A React component for displaying a hyperlink. Links can be nested
* inside a Text component, or being inside any other valid primitive.
*/
export class Link extends React.Component<
React.PropsWithChildren<LinkProps>
> {}
interface FormCommonProps extends NodeProps {
name?: string;
required?: boolean;
noExport?: boolean;
readOnly?: boolean;
value?: number | string;
defaultValue?: number | string;
}
interface FieldSetProps extends NodeProps {
name: string;
}
export class FieldSet extends React.Component<
React.PropsWithChildren<FieldSetProps>
> {}
// see http://pdfkit.org/docs/forms.html#text_field_formatting
interface TextInputFormatting {
type:
| 'date'
| 'time'
| 'percent'
| 'number'
| 'zip'
| 'zipPlus4'
| 'phone'
| 'ssn';
param?: string;
nDec?: number;
sepComma?: boolean;
negStyle?: 'MinusBlack' | 'Red' | 'ParensBlack' | 'ParensRed';
currency?: string;
currencyPrepend?: boolean;
}
// see http://pdfkit.org/docs/forms.html#text_field_formatting
interface TextInputProps extends FormCommonProps {
align?: 'left' | 'center' | 'right';
multiline?: boolean;
/**
* The text will be masked (e.g. with asterisks).
*/
password?: boolean;
/**
* If set, text entered in the field is not spell-checked
*/
noSpell?: boolean;
format?: TextInputFormatting;
/**
* Sets the fontSize (default or 0 means auto sizing)
*/
fontSize?: number;
/**
* Sets the maximum length (characters) of the text in the field
*/
maxLength?: number;
}
export class TextInput extends React.Component<TextInputProps> {}
interface CheckboxProps extends FormCommonProps {
backgroundColor?: string;
borderColor?: string;
checked?: boolean;
onState?: string;
offState?: string;
xMark?: boolean;
}
export class Checkbox extends React.Component<CheckboxProps> {}
interface SelectAndListPropsBase extends FormCommonProps {
sort?: boolean;
edit?: boolean;
multiSelect?: boolean;
noSpell?: boolean;
select?: string[];
}
type SelectAndListPropsWithEdit = SelectAndListPropsBase & {
edit: true | false;
noSpell: boolean;
};
type SelectAndListPropsWithNoSpell = SelectAndListPropsBase & {
edit: boolean;
noSpell: true | false;
};
type SelectAndListProps =
| SelectAndListPropsWithEdit
| SelectAndListPropsWithNoSpell;
export class Select extends React.Component<SelectAndListProps> {}
export class List extends React.Component<SelectAndListProps> {}
interface NoteProps extends NodeProps {
children: string;
}
export class Note extends React.Component<NoteProps> {}
interface CanvasProps extends NodeProps {
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
paint: (
painter: any,
availableWidth: number,
availableHeight: number,
) => null;
}
export class Canvas extends React.Component<CanvasProps> {}
interface SVGProps extends NodeProps, SVGPresentationAttributes {
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
width?: string | number;
height?: string | number;
viewBox?: string;
preserveAspectRatio?: string;
}
/**
* The <SVG /> element is a container that defines a new coordinate system and viewport. It is used as the outermost element of SVG documents.
*/
export class Svg extends React.Component<React.PropsWithChildren<SVGProps>> {}
interface LineProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
x1: string | number;
x2: string | number;
y1: string | number;
y2: string | number;
}
/**
* The <Line /> element is used to create a line.
*/
export class Line extends React.Component<
React.PropsWithChildren<LineProps>
> {}
interface PolylineProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
points: string;
}
/**
* The <Polyline /> element is used to create any shape that consists of only straight lines (that is connected at several points).
*/
export class Polyline extends React.Component<
React.PropsWithChildren<PolylineProps>
> {}
interface PolygonProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
points: string;
}
/**
* The <Polygon /> element is used to create a graphic that contains at least three sides.
* Polygons are made of straight lines, and the shape is "closed" (all the lines connect up).
*/
export class Polygon extends React.Component<
React.PropsWithChildren<PolygonProps>
> {}
interface PathProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
d: string;
}
/**
* The <Path /> element is the most powerful element in the SVG library of basic shapes. It can be used to create lines, curves, arcs, and more.
*/
export class Path extends React.Component<
React.PropsWithChildren<PathProps>
> {}
interface RectProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
x?: string | number;
y?: string | number;
width: string | number;
height: string | number;
rx?: string | number;
ry?: string | number;
}
/**
* The <Rect /> element is used to create a rectangle and variations of a rectangle shape.
*/
export class Rect extends React.Component<
React.PropsWithChildren<RectProps>
> {}
interface CircleProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
cx?: string | number;
cy?: string | number;
r: string | number;
}
/**
* The <Circle /> element is used to create a circle.
*/
export class Circle extends React.Component<
React.PropsWithChildren<CircleProps>
> {}
interface EllipseProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
cx?: string | number;
cy?: string | number;
rx: string | number;
ry: string | number;
}
/**
* The <Ellipse /> element is used to create an ellipse.
* An ellipse is closely related to a circle. The difference is that an ellipse has an x and a y radius that differs from each other, while a circle has equal x and y radius.
*/
export class Ellipse extends React.Component<
React.PropsWithChildren<EllipseProps>
> {}
interface TspanProps extends SVGPresentationAttributes {
x?: string | number;
y?: string | number;
}
/**
* The <Tspan /> element defines a subtext within a <Text /> element or another <Tspan /> element.
* It allows for adjustment of the style and/or position of that subtext as needed.
*/
export class Tspan extends React.Component<
React.PropsWithChildren<TspanProps>
> {}
interface GProps extends SVGPresentationAttributes {
style?: Style;
}
/**
* The <G /> SVG element is a container used to group other SVG elements.
* Transformations applied to the <G /> element are performed on its child elements, and its attributes are inherited by its children.
*/
export class G extends React.Component<React.PropsWithChildren<GProps>> {}
interface StopProps {
offset: string | number;
stopColor: string;
stopOpacity?: string | number;
}
/**
* The SVG <Stop /> element defines a color and its position to use on a gradient. This element is always a child of a <LinearGradient /> or <RadialGradient /> element
*/
export class Stop extends React.Component<
React.PropsWithChildren<StopProps>
> {}
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
interface DefsProps {}
/**
* The <Defs /> element is used to store graphical objects that will be used at a later time. Objects created inside a <Defs /> element are not rendered directly. To display them you have to reference them
*/
export class Defs extends React.Component<
React.PropsWithChildren<DefsProps>
> {}
interface ClipPathProps {
id?: string;
}
/**
* The <ClipPath /> SVG element defines a clipping path, to be used by the clipPath property.
* A clipping path restricts the region to which paint can be applied. Conceptually, parts of the drawing that lie outside of the region bounded by the clipping path are not drawn.
*/
export class ClipPath extends React.Component<
React.PropsWithChildren<ClipPathProps>
> {}
interface MarkerProps {
id: string;
viewBox?: string;
refX?: string | number;
refY?: string | number;
markerWidth?: string | number;
markerHeight?: string | number;
orient?: 'auto' | 'auto-start-reverse' | number;
markerUnits?: 'strokeWidth' | 'userSpaceOnUse';
}
/**
* The <Marker /> SVG element defines a graphic used for drawing arrows or polymarkers on a given <Path />, <Line />, <Polyline />, or <Polygon /> element.
* Markers can be attached to shapes using the markerStart, markerMid, and markerEnd properties.
*/
export class Marker extends React.Component<
React.PropsWithChildren<MarkerProps>
> {}
interface LinearGradientProps {
id: string;
x1?: string | number;
x2?: string | number;
y1?: string | number;
y2?: string | number;
xlinkHref?: string;
gradientTransform?: string;
gradientUnits?: 'userSpaceOnUse' | 'objectBoundingBox';
}
/**
* The <LinearGradient /> element lets authors define linear gradients that can be applied to fill or stroke of graphical elements.
*/
export class LinearGradient extends React.Component<
React.PropsWithChildren<LinearGradientProps>
> {}
interface RadialGradientProps {
id: string;
cx?: string | number;
cy?: string | number;
r?: string | number;
fx?: string | number;
fy?: string | number;
xlinkHref?: string;
gradientTransform?: string;
gradientUnits?: 'userSpaceOnUse' | 'objectBoundingBox';
}
/**
* The <RadialGradient /> element lets authors define radial gradients that can be applied to fill or stroke of graphical elements.
*/
export class RadialGradient extends React.Component<
React.PropsWithChildren<RadialGradientProps>
> {}
interface BlobProviderParams {
blob: Blob | null;
url: string | null;
loading: boolean;
error: Error | null;
}
interface BlobProviderProps {
document: React.ReactElement<DocumentProps>;
children: (params: BlobProviderParams) => React.ReactNode;
}
/**
* Easy and declarative way of getting document's blob data without
* showing it on screen.
* @see https://react-pdf.org/advanced#on-the-fly-rendering
* @platform web
*/
export class BlobProvider extends React.Component<BlobProviderProps> {}
interface PDFViewerProps {
width?: number | string;
height?: number | string;
style?: Style | Style[];
className?: string;
children?: React.ReactElement<DocumentProps>;
innerRef?: React.Ref<HTMLIFrameElement>;
showToolbar?: boolean;
}
/**
* Iframe PDF viewer for client-side generated documents.
* @platform web
*/
export class PDFViewer extends React.Component<PDFViewerProps> {}
interface PDFDownloadLinkProps
extends Omit<
React.AnchorHTMLAttributes<HTMLAnchorElement>,
'href' | 'children'
> {
/** PDF filename. Alias for anchor tag `download` attribute. */
fileName?: string;
document: React.ReactElement<DocumentProps>;
children?: React.ReactNode | React.FC<BlobProviderParams>;
onClick?: React.AnchorHTMLAttributes<HTMLAnchorElement>['onClick'] &
((
event: React.MouseEvent<HTMLAnchorElement, MouseEvent>,
instance: UsePDFInstance,
) => void);
ref?: React.Ref<HTMLAnchorElement> | undefined;
}
/**
* Anchor tag to enable generate and download PDF documents on the fly.
* @see https://react-pdf.org/advanced#on-the-fly-rendering
* @platform web
*/
export class PDFDownloadLink extends React.Component<PDFDownloadLinkProps> {}
interface UsePDFInstance {
loading: boolean;
blob: Blob | null;
url: string | null;
error: string | null;
}
/**
* React hook for creating and updating a PDF document instance
* @platform web
*/
export function usePDF(options?: {
document?: React.ReactElement<DocumentProps>;
}): [
UsePDFInstance,
(newDocument: React.ReactElement<DocumentProps>) => void,
];
export const Font: FontStore;
export const StyleSheet: {
create: <T extends Styles>(styles: T) => T;
};
export const version: any;
export const PDFRenderer: any;
export const pdf: (initialValue?: React.ReactElement<DocumentProps>) => {
container: any;
isDirty: () => boolean;
toString: () => string;
toBlob: () => Promise<Blob>;
toBuffer: () => Promise<NodeJS.ReadableStream>;
on: (event: 'change', callback: () => void) => void;
updateContainer: (
document: React.ReactElement<any>,
callback?: () => void,
) => void;
removeListener: (event: 'change', callback: () => void) => void;
};
export const renderToStream: (
document: React.ReactElement<DocumentProps>,
) => Promise<NodeJS.ReadableStream>;
/**
* @deprecated use the `renderToBuffer` method
*/
export const renderToString: (
document: React.ReactElement<DocumentProps>,
) => Promise<string>;
export const renderToFile: (
document: React.ReactElement<DocumentProps>,
filePath: string,
callback?: (output: NodeJS.ReadableStream, _filePath: string) => any,
) => Promise<NodeJS.ReadableStream>;
const render: typeof renderToFile;
/**
* Render document into a nodejs buffer
* @platform node
*/
export const renderToBuffer: (
document: React.ReactElement<ReactPDF.DocumentProps>,
) => Promise<Buffer>;
}

View File

@@ -0,0 +1,793 @@
/* eslint-disable max-classes-per-file */
import * as React from 'react';
import {
Style,
PageSize,
FontStore,
PDFVersion,
Orientation,
SourceObject,
SrcSet,
Sizes,
HyphenationCallback,
SVGPresentationAttributes,
Bookmark,
PageLayout,
PageMode,
HitSlop,
} from '@react-pdf/types';
declare class ReactPDF {
static default: typeof ReactPDF;
}
export = ReactPDF;
declare namespace ReactPDF {
interface Styles {
[key: string]: Style;
}
interface OnRenderProps {
blob?: Blob;
}
interface Permissions {
printing?: 'lowResolution' | 'highResolution';
modifying?: boolean;
copying?: boolean;
annotating?: boolean;
fillingForms?: boolean;
contentAccessibility?: boolean;
documentAssembly?: boolean;
}
interface DocumentProps {
style?: Style | Style[];
title?: string;
author?: string;
subject?: string;
creator?: string;
keywords?: string;
producer?: string;
language?: string;
creationDate?: Date;
modificationDate?: Date;
pdfVersion?: PDFVersion;
pageMode?: PageMode;
pageLayout?: PageLayout;
ownerPassword?: string;
userPassword?: string;
permissions?: Permissions;
onRender?: (props: OnRenderProps) => any;
}
/**
* This component represent the PDF document itself. It must be the root
* of your tree element structure, and under no circumstances should it be
* used as children of another react-pdf component. In addition, it should
* only have childs of type <Page />.
*/
export class Document extends React.Component<
React.PropsWithChildren<DocumentProps>
> {}
interface NodeProps {
id?: string;
style?: Style | Style[];
/**
* Render component in all wrapped pages.
* @see https://react-pdf.org/advanced#fixed-components
*/
fixed?: boolean;
/**
* Force the wrapping algorithm to start a new page when rendering the
* element.
* @see https://react-pdf.org/advanced#page-breaks
*/
break?: boolean;
/**
* Hint that no page wrapping should occur between all sibling elements following the element within n points
* @see https://react-pdf.org/advanced#orphan-&-widow-protection
*/
minPresenceAhead?: number;
}
interface PageProps extends NodeProps {
/**
* Enable page wrapping for this page.
* @see https://react-pdf.org/components#page-wrapping
*/
wrap?: boolean;
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
size?: PageSize;
orientation?: Orientation;
dpi?: number;
bookmark?: Bookmark;
}
/**
* Represents single page inside the PDF document, or a subset of them if
* using the wrapping feature. A <Document /> can contain as many pages as
* you want, but ensure not rendering a page inside any component besides
* Document.
*/
export class Page extends React.Component<
React.PropsWithChildren<PageProps>
> {}
interface ViewProps extends NodeProps {
id?: string;
/**
* Enable/disable page wrapping for element.
* @see https://react-pdf.org/components#page-wrapping
*/
wrap?: boolean;
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
render?: (props: {
pageNumber: number;
subPageNumber: number;
}) => React.ReactNode;
}
/**
* The most fundamental component for building a UI and is designed to be
* nested inside other views and can have 0 to many children.
*/
export class View extends React.Component<
React.PropsWithChildren<ViewProps>
> {}
interface BaseImageProps extends NodeProps {
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
cache?: boolean;
/**
* A comma-separated list of image sources with width descriptors.
* Works like the HTML img srcSet attribute.
* @example "small.jpg 300w, medium.jpg 600w, large.jpg 900w"
*/
srcSet?: SrcSet;
/**
* The intended display width of the image, used to select the best source
* from srcSet. Accepts a number (in points) or a string.
* Works like the HTML img sizes attribute.
* @example 300
* @example "300"
*/
sizes?: Sizes;
}
interface ImageWithSrcProp extends BaseImageProps {
src: SourceObject;
}
interface ImageWithSourceProp extends BaseImageProps {
source: SourceObject;
}
type ImageProps = ImageWithSrcProp | ImageWithSourceProp;
/**
* A React component for displaying network or local (Node only) JPG or
* PNG images, as well as base64 encoded image strings.
*/
export class Image extends React.Component<ImageProps> {}
interface BaseImageBackgroundProps extends NodeProps {
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
cache?: boolean;
/**
* A comma-separated list of image sources with width descriptors.
* Works like the HTML img srcSet attribute.
* @example "small.jpg 300w, medium.jpg 600w, large.jpg 900w"
*/
srcSet?: SrcSet;
/**
* The intended display width of the image, used to select the best source
* from srcSet. Accepts a number (in points) or a string.
* @example 300
*/
sizes?: Sizes;
/**
* Style applied to the background image.
*/
imageStyle?: Style;
}
interface ImageBackgroundWithSrcProp extends BaseImageBackgroundProps {
src: SourceObject;
}
interface ImageBackgroundWithSourceProp extends BaseImageBackgroundProps {
source: SourceObject;
}
type ImageBackgroundProps =
| ImageBackgroundWithSrcProp
| ImageBackgroundWithSourceProp;
/**
* A React component for displaying an image behind child content.
* Compatible with React Native's ImageBackground component.
* @see https://reactnative.dev/docs/imagebackground
*/
export class ImageBackground extends React.Component<
React.PropsWithChildren<ImageBackgroundProps>
> {}
interface TextProps extends NodeProps {
id?: string;
/**
* Enable/disable page wrapping for element.
* @see https://react-pdf.org/components#page-wrapping
*/
wrap?: boolean;
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
render?: (props: {
pageNumber: number;
totalPages: number;
subPageNumber: number;
subPageTotalPages: number;
}) => React.ReactNode;
/**
* Override the default hyphenation-callback
* @see https://react-pdf.org/fonts#registerhyphenationcallback
*/
hyphenationCallback?: HyphenationCallback;
/**
* Specifies the minimum number of lines in a text element that must be shown at the bottom of a page or its container.
* @see https://react-pdf.org/advanced#orphan-&-widow-protection
*/
orphans?: number;
/**
* Specifies the minimum number of lines in a text element that must be shown at the top of a page or its container..
* @see https://react-pdf.org/advanced#orphan-&-widow-protection
*/
widows?: number;
}
interface SVGTextProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
x: string | number;
y: string | number;
/**
* Override the default hyphenation-callback
* @see https://react-pdf.org/fonts#registerhyphenationcallback
*/
hyphenationCallback?: HyphenationCallback;
}
/**
* A React component for displaying text. Text supports nesting of other
* Text or Link components to create inline styling.
*/
export class Text extends React.Component<
React.PropsWithChildren<TextProps> | SVGTextProps
> {}
interface LinkProps extends NodeProps {
/**
* Enable/disable page wrapping for element.
* @see https://react-pdf.org/components#page-wrapping
*/
wrap?: boolean;
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
href?: string;
src?: string;
/**
* Extends the clickable area of the link beyond its visible bounds.
* Accepts a number (applied to all sides) or an object with top, bottom, left, right.
* @see https://reactnative.dev/docs/view#hitslop
*/
hitSlop?: HitSlop;
}
/**
* A React component for displaying a hyperlink. Links can be nested
* inside a Text component, or being inside any other valid primitive.
*/
export class Link extends React.Component<
React.PropsWithChildren<LinkProps>
> {}
interface FormCommonProps extends NodeProps {
name?: string;
required?: boolean;
noExport?: boolean;
readOnly?: boolean;
value?: number | string;
defaultValue?: number | string;
}
interface FieldSetProps extends NodeProps {
name: string;
}
export class FieldSet extends React.Component<
React.PropsWithChildren<FieldSetProps>
> {}
// see http://pdfkit.org/docs/forms.html#text_field_formatting
interface TextInputFormatting {
type:
| 'date'
| 'time'
| 'percent'
| 'number'
| 'zip'
| 'zipPlus4'
| 'phone'
| 'ssn';
param?: string;
nDec?: number;
sepComma?: boolean;
negStyle?: 'MinusBlack' | 'Red' | 'ParensBlack' | 'ParensRed';
currency?: string;
currencyPrepend?: boolean;
}
// see http://pdfkit.org/docs/forms.html#text_field_formatting
interface TextInputProps extends FormCommonProps {
align?: 'left' | 'center' | 'right';
multiline?: boolean;
/**
* The text will be masked (e.g. with asterisks).
*/
password?: boolean;
/**
* If set, text entered in the field is not spell-checked
*/
noSpell?: boolean;
format?: TextInputFormatting;
/**
* Sets the fontSize (default or 0 means auto sizing)
*/
fontSize?: number;
/**
* Sets the maximum length (characters) of the text in the field
*/
maxLength?: number;
}
export class TextInput extends React.Component<TextInputProps> {}
interface CheckboxProps extends FormCommonProps {
backgroundColor?: string;
borderColor?: string;
checked?: boolean;
onState?: string;
offState?: string;
xMark?: boolean;
}
export class Checkbox extends React.Component<CheckboxProps> {}
interface SelectAndListPropsBase extends FormCommonProps {
sort?: boolean;
edit?: boolean;
multiSelect?: boolean;
noSpell?: boolean;
select?: string[];
}
type SelectAndListPropsWithEdit = SelectAndListPropsBase & {
edit: true | false;
noSpell: boolean;
};
type SelectAndListPropsWithNoSpell = SelectAndListPropsBase & {
edit: boolean;
noSpell: true | false;
};
type SelectAndListProps =
| SelectAndListPropsWithEdit
| SelectAndListPropsWithNoSpell;
export class Select extends React.Component<SelectAndListProps> {}
export class List extends React.Component<SelectAndListProps> {}
interface NoteProps extends NodeProps {
children: string;
}
export class Note extends React.Component<NoteProps> {}
interface CanvasProps extends NodeProps {
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
paint: (
painter: any,
availableWidth: number,
availableHeight: number,
) => null;
}
export class Canvas extends React.Component<CanvasProps> {}
interface SVGProps extends NodeProps, SVGPresentationAttributes {
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
width?: string | number;
height?: string | number;
viewBox?: string;
preserveAspectRatio?: string;
}
/**
* The <SVG /> element is a container that defines a new coordinate system and viewport. It is used as the outermost element of SVG documents.
*/
export class Svg extends React.Component<React.PropsWithChildren<SVGProps>> {}
interface LineProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
x1: string | number;
x2: string | number;
y1: string | number;
y2: string | number;
}
/**
* The <Line /> element is used to create a line.
*/
export class Line extends React.Component<
React.PropsWithChildren<LineProps>
> {}
interface PolylineProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
points: string;
}
/**
* The <Polyline /> element is used to create any shape that consists of only straight lines (that is connected at several points).
*/
export class Polyline extends React.Component<
React.PropsWithChildren<PolylineProps>
> {}
interface PolygonProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
points: string;
}
/**
* The <Polygon /> element is used to create a graphic that contains at least three sides.
* Polygons are made of straight lines, and the shape is "closed" (all the lines connect up).
*/
export class Polygon extends React.Component<
React.PropsWithChildren<PolygonProps>
> {}
interface PathProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
d: string;
}
/**
* The <Path /> element is the most powerful element in the SVG library of basic shapes. It can be used to create lines, curves, arcs, and more.
*/
export class Path extends React.Component<
React.PropsWithChildren<PathProps>
> {}
interface RectProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
x?: string | number;
y?: string | number;
width: string | number;
height: string | number;
rx?: string | number;
ry?: string | number;
}
/**
* The <Rect /> element is used to create a rectangle and variations of a rectangle shape.
*/
export class Rect extends React.Component<
React.PropsWithChildren<RectProps>
> {}
interface CircleProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
cx?: string | number;
cy?: string | number;
r: string | number;
}
/**
* The <Circle /> element is used to create a circle.
*/
export class Circle extends React.Component<
React.PropsWithChildren<CircleProps>
> {}
interface EllipseProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
cx?: string | number;
cy?: string | number;
rx: string | number;
ry: string | number;
}
/**
* The <Ellipse /> element is used to create an ellipse.
* An ellipse is closely related to a circle. The difference is that an ellipse has an x and a y radius that differs from each other, while a circle has equal x and y radius.
*/
export class Ellipse extends React.Component<
React.PropsWithChildren<EllipseProps>
> {}
interface TspanProps extends SVGPresentationAttributes {
x?: string | number;
y?: string | number;
}
/**
* The <Tspan /> element defines a subtext within a <Text /> element or another <Tspan /> element.
* It allows for adjustment of the style and/or position of that subtext as needed.
*/
export class Tspan extends React.Component<
React.PropsWithChildren<TspanProps>
> {}
interface GProps extends SVGPresentationAttributes {
style?: Style;
}
/**
* The <G /> SVG element is a container used to group other SVG elements.
* Transformations applied to the <G /> element are performed on its child elements, and its attributes are inherited by its children.
*/
export class G extends React.Component<React.PropsWithChildren<GProps>> {}
interface StopProps {
offset: string | number;
stopColor: string;
stopOpacity?: string | number;
}
/**
* The SVG <Stop /> element defines a color and its position to use on a gradient. This element is always a child of a <LinearGradient /> or <RadialGradient /> element
*/
export class Stop extends React.Component<
React.PropsWithChildren<StopProps>
> {}
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
interface DefsProps {}
/**
* The <Defs /> element is used to store graphical objects that will be used at a later time. Objects created inside a <Defs /> element are not rendered directly. To display them you have to reference them
*/
export class Defs extends React.Component<
React.PropsWithChildren<DefsProps>
> {}
interface ClipPathProps {
id?: string;
}
/**
* The <ClipPath /> SVG element defines a clipping path, to be used by the clipPath property.
* A clipping path restricts the region to which paint can be applied. Conceptually, parts of the drawing that lie outside of the region bounded by the clipping path are not drawn.
*/
export class ClipPath extends React.Component<
React.PropsWithChildren<ClipPathProps>
> {}
interface MarkerProps {
id: string;
viewBox?: string;
refX?: string | number;
refY?: string | number;
markerWidth?: string | number;
markerHeight?: string | number;
orient?: 'auto' | 'auto-start-reverse' | number;
markerUnits?: 'strokeWidth' | 'userSpaceOnUse';
}
/**
* The <Marker /> SVG element defines a graphic used for drawing arrows or polymarkers on a given <Path />, <Line />, <Polyline />, or <Polygon /> element.
* Markers can be attached to shapes using the markerStart, markerMid, and markerEnd properties.
*/
export class Marker extends React.Component<
React.PropsWithChildren<MarkerProps>
> {}
interface LinearGradientProps {
id: string;
x1?: string | number;
x2?: string | number;
y1?: string | number;
y2?: string | number;
xlinkHref?: string;
gradientTransform?: string;
gradientUnits?: 'userSpaceOnUse' | 'objectBoundingBox';
}
/**
* The <LinearGradient /> element lets authors define linear gradients that can be applied to fill or stroke of graphical elements.
*/
export class LinearGradient extends React.Component<
React.PropsWithChildren<LinearGradientProps>
> {}
interface RadialGradientProps {
id: string;
cx?: string | number;
cy?: string | number;
r?: string | number;
fx?: string | number;
fy?: string | number;
xlinkHref?: string;
gradientTransform?: string;
gradientUnits?: 'userSpaceOnUse' | 'objectBoundingBox';
}
/**
* The <RadialGradient /> element lets authors define radial gradients that can be applied to fill or stroke of graphical elements.
*/
export class RadialGradient extends React.Component<
React.PropsWithChildren<RadialGradientProps>
> {}
interface BlobProviderParams {
blob: Blob | null;
url: string | null;
loading: boolean;
error: Error | null;
}
interface BlobProviderProps {
document: React.ReactElement<DocumentProps>;
children: (params: BlobProviderParams) => React.ReactNode;
}
/**
* Easy and declarative way of getting document's blob data without
* showing it on screen.
* @see https://react-pdf.org/advanced#on-the-fly-rendering
* @platform web
*/
export class BlobProvider extends React.Component<BlobProviderProps> {}
interface PDFViewerProps {
width?: number | string;
height?: number | string;
style?: Style | Style[];
className?: string;
children?: React.ReactElement<DocumentProps>;
innerRef?: React.Ref<HTMLIFrameElement>;
showToolbar?: boolean;
}
/**
* Iframe PDF viewer for client-side generated documents.
* @platform web
*/
export class PDFViewer extends React.Component<PDFViewerProps> {}
interface PDFDownloadLinkProps
extends Omit<
React.AnchorHTMLAttributes<HTMLAnchorElement>,
'href' | 'children'
> {
/** PDF filename. Alias for anchor tag `download` attribute. */
fileName?: string;
document: React.ReactElement<DocumentProps>;
children?: React.ReactNode | React.FC<BlobProviderParams>;
onClick?: React.AnchorHTMLAttributes<HTMLAnchorElement>['onClick'] &
((
event: React.MouseEvent<HTMLAnchorElement, MouseEvent>,
instance: UsePDFInstance,
) => void);
ref?: React.Ref<HTMLAnchorElement> | undefined;
}
/**
* Anchor tag to enable generate and download PDF documents on the fly.
* @see https://react-pdf.org/advanced#on-the-fly-rendering
* @platform web
*/
export class PDFDownloadLink extends React.Component<PDFDownloadLinkProps> {}
interface UsePDFInstance {
loading: boolean;
blob: Blob | null;
url: string | null;
error: string | null;
}
/**
* React hook for creating and updating a PDF document instance
* @platform web
*/
export function usePDF(options?: {
document?: React.ReactElement<DocumentProps>;
}): [
UsePDFInstance,
(newDocument: React.ReactElement<DocumentProps>) => void,
];
export const Font: FontStore;
export const StyleSheet: {
create: <T extends Styles>(styles: T) => T;
};
export const version: any;
export const PDFRenderer: any;
export const pdf: (initialValue?: React.ReactElement<DocumentProps>) => {
container: any;
isDirty: () => boolean;
toString: () => string;
toBlob: () => Promise<Blob>;
toBuffer: () => Promise<NodeJS.ReadableStream>;
on: (event: 'change', callback: () => void) => void;
updateContainer: (
document: React.ReactElement<any>,
callback?: () => void,
) => void;
removeListener: (event: 'change', callback: () => void) => void;
};
export const renderToStream: (
document: React.ReactElement<DocumentProps>,
) => Promise<NodeJS.ReadableStream>;
/**
* @deprecated use the `renderToBuffer` method
*/
export const renderToString: (
document: React.ReactElement<DocumentProps>,
) => Promise<string>;
export const renderToFile: (
document: React.ReactElement<DocumentProps>,
filePath: string,
callback?: (output: NodeJS.ReadableStream, _filePath: string) => any,
) => Promise<NodeJS.ReadableStream>;
const render: typeof renderToFile;
/**
* Render document into a nodejs buffer
* @platform node
*/
export const renderToBuffer: (
document: React.ReactElement<ReactPDF.DocumentProps>,
) => Promise<Buffer>;
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,793 @@
/* eslint-disable max-classes-per-file */
import * as React from 'react';
import {
Style,
PageSize,
FontStore,
PDFVersion,
Orientation,
SourceObject,
SrcSet,
Sizes,
HyphenationCallback,
SVGPresentationAttributes,
Bookmark,
PageLayout,
PageMode,
HitSlop,
} from '@react-pdf/types';
declare class ReactPDF {
static default: typeof ReactPDF;
}
export = ReactPDF;
declare namespace ReactPDF {
interface Styles {
[key: string]: Style;
}
interface OnRenderProps {
blob?: Blob;
}
interface Permissions {
printing?: 'lowResolution' | 'highResolution';
modifying?: boolean;
copying?: boolean;
annotating?: boolean;
fillingForms?: boolean;
contentAccessibility?: boolean;
documentAssembly?: boolean;
}
interface DocumentProps {
style?: Style | Style[];
title?: string;
author?: string;
subject?: string;
creator?: string;
keywords?: string;
producer?: string;
language?: string;
creationDate?: Date;
modificationDate?: Date;
pdfVersion?: PDFVersion;
pageMode?: PageMode;
pageLayout?: PageLayout;
ownerPassword?: string;
userPassword?: string;
permissions?: Permissions;
onRender?: (props: OnRenderProps) => any;
}
/**
* This component represent the PDF document itself. It must be the root
* of your tree element structure, and under no circumstances should it be
* used as children of another react-pdf component. In addition, it should
* only have childs of type <Page />.
*/
export class Document extends React.Component<
React.PropsWithChildren<DocumentProps>
> {}
interface NodeProps {
id?: string;
style?: Style | Style[];
/**
* Render component in all wrapped pages.
* @see https://react-pdf.org/advanced#fixed-components
*/
fixed?: boolean;
/**
* Force the wrapping algorithm to start a new page when rendering the
* element.
* @see https://react-pdf.org/advanced#page-breaks
*/
break?: boolean;
/**
* Hint that no page wrapping should occur between all sibling elements following the element within n points
* @see https://react-pdf.org/advanced#orphan-&-widow-protection
*/
minPresenceAhead?: number;
}
interface PageProps extends NodeProps {
/**
* Enable page wrapping for this page.
* @see https://react-pdf.org/components#page-wrapping
*/
wrap?: boolean;
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
size?: PageSize;
orientation?: Orientation;
dpi?: number;
bookmark?: Bookmark;
}
/**
* Represents single page inside the PDF document, or a subset of them if
* using the wrapping feature. A <Document /> can contain as many pages as
* you want, but ensure not rendering a page inside any component besides
* Document.
*/
export class Page extends React.Component<
React.PropsWithChildren<PageProps>
> {}
interface ViewProps extends NodeProps {
id?: string;
/**
* Enable/disable page wrapping for element.
* @see https://react-pdf.org/components#page-wrapping
*/
wrap?: boolean;
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
render?: (props: {
pageNumber: number;
subPageNumber: number;
}) => React.ReactNode;
}
/**
* The most fundamental component for building a UI and is designed to be
* nested inside other views and can have 0 to many children.
*/
export class View extends React.Component<
React.PropsWithChildren<ViewProps>
> {}
interface BaseImageProps extends NodeProps {
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
cache?: boolean;
/**
* A comma-separated list of image sources with width descriptors.
* Works like the HTML img srcSet attribute.
* @example "small.jpg 300w, medium.jpg 600w, large.jpg 900w"
*/
srcSet?: SrcSet;
/**
* The intended display width of the image, used to select the best source
* from srcSet. Accepts a number (in points) or a string.
* Works like the HTML img sizes attribute.
* @example 300
* @example "300"
*/
sizes?: Sizes;
}
interface ImageWithSrcProp extends BaseImageProps {
src: SourceObject;
}
interface ImageWithSourceProp extends BaseImageProps {
source: SourceObject;
}
type ImageProps = ImageWithSrcProp | ImageWithSourceProp;
/**
* A React component for displaying network or local (Node only) JPG or
* PNG images, as well as base64 encoded image strings.
*/
export class Image extends React.Component<ImageProps> {}
interface BaseImageBackgroundProps extends NodeProps {
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
cache?: boolean;
/**
* A comma-separated list of image sources with width descriptors.
* Works like the HTML img srcSet attribute.
* @example "small.jpg 300w, medium.jpg 600w, large.jpg 900w"
*/
srcSet?: SrcSet;
/**
* The intended display width of the image, used to select the best source
* from srcSet. Accepts a number (in points) or a string.
* @example 300
*/
sizes?: Sizes;
/**
* Style applied to the background image.
*/
imageStyle?: Style;
}
interface ImageBackgroundWithSrcProp extends BaseImageBackgroundProps {
src: SourceObject;
}
interface ImageBackgroundWithSourceProp extends BaseImageBackgroundProps {
source: SourceObject;
}
type ImageBackgroundProps =
| ImageBackgroundWithSrcProp
| ImageBackgroundWithSourceProp;
/**
* A React component for displaying an image behind child content.
* Compatible with React Native's ImageBackground component.
* @see https://reactnative.dev/docs/imagebackground
*/
export class ImageBackground extends React.Component<
React.PropsWithChildren<ImageBackgroundProps>
> {}
interface TextProps extends NodeProps {
id?: string;
/**
* Enable/disable page wrapping for element.
* @see https://react-pdf.org/components#page-wrapping
*/
wrap?: boolean;
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
render?: (props: {
pageNumber: number;
totalPages: number;
subPageNumber: number;
subPageTotalPages: number;
}) => React.ReactNode;
/**
* Override the default hyphenation-callback
* @see https://react-pdf.org/fonts#registerhyphenationcallback
*/
hyphenationCallback?: HyphenationCallback;
/**
* Specifies the minimum number of lines in a text element that must be shown at the bottom of a page or its container.
* @see https://react-pdf.org/advanced#orphan-&-widow-protection
*/
orphans?: number;
/**
* Specifies the minimum number of lines in a text element that must be shown at the top of a page or its container..
* @see https://react-pdf.org/advanced#orphan-&-widow-protection
*/
widows?: number;
}
interface SVGTextProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
x: string | number;
y: string | number;
/**
* Override the default hyphenation-callback
* @see https://react-pdf.org/fonts#registerhyphenationcallback
*/
hyphenationCallback?: HyphenationCallback;
}
/**
* A React component for displaying text. Text supports nesting of other
* Text or Link components to create inline styling.
*/
export class Text extends React.Component<
React.PropsWithChildren<TextProps> | SVGTextProps
> {}
interface LinkProps extends NodeProps {
/**
* Enable/disable page wrapping for element.
* @see https://react-pdf.org/components#page-wrapping
*/
wrap?: boolean;
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
href?: string;
src?: string;
/**
* Extends the clickable area of the link beyond its visible bounds.
* Accepts a number (applied to all sides) or an object with top, bottom, left, right.
* @see https://reactnative.dev/docs/view#hitslop
*/
hitSlop?: HitSlop;
}
/**
* A React component for displaying a hyperlink. Links can be nested
* inside a Text component, or being inside any other valid primitive.
*/
export class Link extends React.Component<
React.PropsWithChildren<LinkProps>
> {}
interface FormCommonProps extends NodeProps {
name?: string;
required?: boolean;
noExport?: boolean;
readOnly?: boolean;
value?: number | string;
defaultValue?: number | string;
}
interface FieldSetProps extends NodeProps {
name: string;
}
export class FieldSet extends React.Component<
React.PropsWithChildren<FieldSetProps>
> {}
// see http://pdfkit.org/docs/forms.html#text_field_formatting
interface TextInputFormatting {
type:
| 'date'
| 'time'
| 'percent'
| 'number'
| 'zip'
| 'zipPlus4'
| 'phone'
| 'ssn';
param?: string;
nDec?: number;
sepComma?: boolean;
negStyle?: 'MinusBlack' | 'Red' | 'ParensBlack' | 'ParensRed';
currency?: string;
currencyPrepend?: boolean;
}
// see http://pdfkit.org/docs/forms.html#text_field_formatting
interface TextInputProps extends FormCommonProps {
align?: 'left' | 'center' | 'right';
multiline?: boolean;
/**
* The text will be masked (e.g. with asterisks).
*/
password?: boolean;
/**
* If set, text entered in the field is not spell-checked
*/
noSpell?: boolean;
format?: TextInputFormatting;
/**
* Sets the fontSize (default or 0 means auto sizing)
*/
fontSize?: number;
/**
* Sets the maximum length (characters) of the text in the field
*/
maxLength?: number;
}
export class TextInput extends React.Component<TextInputProps> {}
interface CheckboxProps extends FormCommonProps {
backgroundColor?: string;
borderColor?: string;
checked?: boolean;
onState?: string;
offState?: string;
xMark?: boolean;
}
export class Checkbox extends React.Component<CheckboxProps> {}
interface SelectAndListPropsBase extends FormCommonProps {
sort?: boolean;
edit?: boolean;
multiSelect?: boolean;
noSpell?: boolean;
select?: string[];
}
type SelectAndListPropsWithEdit = SelectAndListPropsBase & {
edit: true | false;
noSpell: boolean;
};
type SelectAndListPropsWithNoSpell = SelectAndListPropsBase & {
edit: boolean;
noSpell: true | false;
};
type SelectAndListProps =
| SelectAndListPropsWithEdit
| SelectAndListPropsWithNoSpell;
export class Select extends React.Component<SelectAndListProps> {}
export class List extends React.Component<SelectAndListProps> {}
interface NoteProps extends NodeProps {
children: string;
}
export class Note extends React.Component<NoteProps> {}
interface CanvasProps extends NodeProps {
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
paint: (
painter: any,
availableWidth: number,
availableHeight: number,
) => null;
}
export class Canvas extends React.Component<CanvasProps> {}
interface SVGProps extends NodeProps, SVGPresentationAttributes {
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
width?: string | number;
height?: string | number;
viewBox?: string;
preserveAspectRatio?: string;
}
/**
* The <SVG /> element is a container that defines a new coordinate system and viewport. It is used as the outermost element of SVG documents.
*/
export class Svg extends React.Component<React.PropsWithChildren<SVGProps>> {}
interface LineProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
x1: string | number;
x2: string | number;
y1: string | number;
y2: string | number;
}
/**
* The <Line /> element is used to create a line.
*/
export class Line extends React.Component<
React.PropsWithChildren<LineProps>
> {}
interface PolylineProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
points: string;
}
/**
* The <Polyline /> element is used to create any shape that consists of only straight lines (that is connected at several points).
*/
export class Polyline extends React.Component<
React.PropsWithChildren<PolylineProps>
> {}
interface PolygonProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
points: string;
}
/**
* The <Polygon /> element is used to create a graphic that contains at least three sides.
* Polygons are made of straight lines, and the shape is "closed" (all the lines connect up).
*/
export class Polygon extends React.Component<
React.PropsWithChildren<PolygonProps>
> {}
interface PathProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
d: string;
}
/**
* The <Path /> element is the most powerful element in the SVG library of basic shapes. It can be used to create lines, curves, arcs, and more.
*/
export class Path extends React.Component<
React.PropsWithChildren<PathProps>
> {}
interface RectProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
x?: string | number;
y?: string | number;
width: string | number;
height: string | number;
rx?: string | number;
ry?: string | number;
}
/**
* The <Rect /> element is used to create a rectangle and variations of a rectangle shape.
*/
export class Rect extends React.Component<
React.PropsWithChildren<RectProps>
> {}
interface CircleProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
cx?: string | number;
cy?: string | number;
r: string | number;
}
/**
* The <Circle /> element is used to create a circle.
*/
export class Circle extends React.Component<
React.PropsWithChildren<CircleProps>
> {}
interface EllipseProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
cx?: string | number;
cy?: string | number;
rx: string | number;
ry: string | number;
}
/**
* The <Ellipse /> element is used to create an ellipse.
* An ellipse is closely related to a circle. The difference is that an ellipse has an x and a y radius that differs from each other, while a circle has equal x and y radius.
*/
export class Ellipse extends React.Component<
React.PropsWithChildren<EllipseProps>
> {}
interface TspanProps extends SVGPresentationAttributes {
x?: string | number;
y?: string | number;
}
/**
* The <Tspan /> element defines a subtext within a <Text /> element or another <Tspan /> element.
* It allows for adjustment of the style and/or position of that subtext as needed.
*/
export class Tspan extends React.Component<
React.PropsWithChildren<TspanProps>
> {}
interface GProps extends SVGPresentationAttributes {
style?: Style;
}
/**
* The <G /> SVG element is a container used to group other SVG elements.
* Transformations applied to the <G /> element are performed on its child elements, and its attributes are inherited by its children.
*/
export class G extends React.Component<React.PropsWithChildren<GProps>> {}
interface StopProps {
offset: string | number;
stopColor: string;
stopOpacity?: string | number;
}
/**
* The SVG <Stop /> element defines a color and its position to use on a gradient. This element is always a child of a <LinearGradient /> or <RadialGradient /> element
*/
export class Stop extends React.Component<
React.PropsWithChildren<StopProps>
> {}
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
interface DefsProps {}
/**
* The <Defs /> element is used to store graphical objects that will be used at a later time. Objects created inside a <Defs /> element are not rendered directly. To display them you have to reference them
*/
export class Defs extends React.Component<
React.PropsWithChildren<DefsProps>
> {}
interface ClipPathProps {
id?: string;
}
/**
* The <ClipPath /> SVG element defines a clipping path, to be used by the clipPath property.
* A clipping path restricts the region to which paint can be applied. Conceptually, parts of the drawing that lie outside of the region bounded by the clipping path are not drawn.
*/
export class ClipPath extends React.Component<
React.PropsWithChildren<ClipPathProps>
> {}
interface MarkerProps {
id: string;
viewBox?: string;
refX?: string | number;
refY?: string | number;
markerWidth?: string | number;
markerHeight?: string | number;
orient?: 'auto' | 'auto-start-reverse' | number;
markerUnits?: 'strokeWidth' | 'userSpaceOnUse';
}
/**
* The <Marker /> SVG element defines a graphic used for drawing arrows or polymarkers on a given <Path />, <Line />, <Polyline />, or <Polygon /> element.
* Markers can be attached to shapes using the markerStart, markerMid, and markerEnd properties.
*/
export class Marker extends React.Component<
React.PropsWithChildren<MarkerProps>
> {}
interface LinearGradientProps {
id: string;
x1?: string | number;
x2?: string | number;
y1?: string | number;
y2?: string | number;
xlinkHref?: string;
gradientTransform?: string;
gradientUnits?: 'userSpaceOnUse' | 'objectBoundingBox';
}
/**
* The <LinearGradient /> element lets authors define linear gradients that can be applied to fill or stroke of graphical elements.
*/
export class LinearGradient extends React.Component<
React.PropsWithChildren<LinearGradientProps>
> {}
interface RadialGradientProps {
id: string;
cx?: string | number;
cy?: string | number;
r?: string | number;
fx?: string | number;
fy?: string | number;
xlinkHref?: string;
gradientTransform?: string;
gradientUnits?: 'userSpaceOnUse' | 'objectBoundingBox';
}
/**
* The <RadialGradient /> element lets authors define radial gradients that can be applied to fill or stroke of graphical elements.
*/
export class RadialGradient extends React.Component<
React.PropsWithChildren<RadialGradientProps>
> {}
interface BlobProviderParams {
blob: Blob | null;
url: string | null;
loading: boolean;
error: Error | null;
}
interface BlobProviderProps {
document: React.ReactElement<DocumentProps>;
children: (params: BlobProviderParams) => React.ReactNode;
}
/**
* Easy and declarative way of getting document's blob data without
* showing it on screen.
* @see https://react-pdf.org/advanced#on-the-fly-rendering
* @platform web
*/
export class BlobProvider extends React.Component<BlobProviderProps> {}
interface PDFViewerProps {
width?: number | string;
height?: number | string;
style?: Style | Style[];
className?: string;
children?: React.ReactElement<DocumentProps>;
innerRef?: React.Ref<HTMLIFrameElement>;
showToolbar?: boolean;
}
/**
* Iframe PDF viewer for client-side generated documents.
* @platform web
*/
export class PDFViewer extends React.Component<PDFViewerProps> {}
interface PDFDownloadLinkProps
extends Omit<
React.AnchorHTMLAttributes<HTMLAnchorElement>,
'href' | 'children'
> {
/** PDF filename. Alias for anchor tag `download` attribute. */
fileName?: string;
document: React.ReactElement<DocumentProps>;
children?: React.ReactNode | React.FC<BlobProviderParams>;
onClick?: React.AnchorHTMLAttributes<HTMLAnchorElement>['onClick'] &
((
event: React.MouseEvent<HTMLAnchorElement, MouseEvent>,
instance: UsePDFInstance,
) => void);
ref?: React.Ref<HTMLAnchorElement> | undefined;
}
/**
* Anchor tag to enable generate and download PDF documents on the fly.
* @see https://react-pdf.org/advanced#on-the-fly-rendering
* @platform web
*/
export class PDFDownloadLink extends React.Component<PDFDownloadLinkProps> {}
interface UsePDFInstance {
loading: boolean;
blob: Blob | null;
url: string | null;
error: string | null;
}
/**
* React hook for creating and updating a PDF document instance
* @platform web
*/
export function usePDF(options?: {
document?: React.ReactElement<DocumentProps>;
}): [
UsePDFInstance,
(newDocument: React.ReactElement<DocumentProps>) => void,
];
export const Font: FontStore;
export const StyleSheet: {
create: <T extends Styles>(styles: T) => T;
};
export const version: any;
export const PDFRenderer: any;
export const pdf: (initialValue?: React.ReactElement<DocumentProps>) => {
container: any;
isDirty: () => boolean;
toString: () => string;
toBlob: () => Promise<Blob>;
toBuffer: () => Promise<NodeJS.ReadableStream>;
on: (event: 'change', callback: () => void) => void;
updateContainer: (
document: React.ReactElement<any>,
callback?: () => void,
) => void;
removeListener: (event: 'change', callback: () => void) => void;
};
export const renderToStream: (
document: React.ReactElement<DocumentProps>,
) => Promise<NodeJS.ReadableStream>;
/**
* @deprecated use the `renderToBuffer` method
*/
export const renderToString: (
document: React.ReactElement<DocumentProps>,
) => Promise<string>;
export const renderToFile: (
document: React.ReactElement<DocumentProps>,
filePath: string,
callback?: (output: NodeJS.ReadableStream, _filePath: string) => any,
) => Promise<NodeJS.ReadableStream>;
const render: typeof renderToFile;
/**
* Render document into a nodejs buffer
* @platform node
*/
export const renderToBuffer: (
document: React.ReactElement<ReactPDF.DocumentProps>,
) => Promise<Buffer>;
}

View File

@@ -0,0 +1,793 @@
/* eslint-disable max-classes-per-file */
import * as React from 'react';
import {
Style,
PageSize,
FontStore,
PDFVersion,
Orientation,
SourceObject,
SrcSet,
Sizes,
HyphenationCallback,
SVGPresentationAttributes,
Bookmark,
PageLayout,
PageMode,
HitSlop,
} from '@react-pdf/types';
declare class ReactPDF {
static default: typeof ReactPDF;
}
export = ReactPDF;
declare namespace ReactPDF {
interface Styles {
[key: string]: Style;
}
interface OnRenderProps {
blob?: Blob;
}
interface Permissions {
printing?: 'lowResolution' | 'highResolution';
modifying?: boolean;
copying?: boolean;
annotating?: boolean;
fillingForms?: boolean;
contentAccessibility?: boolean;
documentAssembly?: boolean;
}
interface DocumentProps {
style?: Style | Style[];
title?: string;
author?: string;
subject?: string;
creator?: string;
keywords?: string;
producer?: string;
language?: string;
creationDate?: Date;
modificationDate?: Date;
pdfVersion?: PDFVersion;
pageMode?: PageMode;
pageLayout?: PageLayout;
ownerPassword?: string;
userPassword?: string;
permissions?: Permissions;
onRender?: (props: OnRenderProps) => any;
}
/**
* This component represent the PDF document itself. It must be the root
* of your tree element structure, and under no circumstances should it be
* used as children of another react-pdf component. In addition, it should
* only have childs of type <Page />.
*/
export class Document extends React.Component<
React.PropsWithChildren<DocumentProps>
> {}
interface NodeProps {
id?: string;
style?: Style | Style[];
/**
* Render component in all wrapped pages.
* @see https://react-pdf.org/advanced#fixed-components
*/
fixed?: boolean;
/**
* Force the wrapping algorithm to start a new page when rendering the
* element.
* @see https://react-pdf.org/advanced#page-breaks
*/
break?: boolean;
/**
* Hint that no page wrapping should occur between all sibling elements following the element within n points
* @see https://react-pdf.org/advanced#orphan-&-widow-protection
*/
minPresenceAhead?: number;
}
interface PageProps extends NodeProps {
/**
* Enable page wrapping for this page.
* @see https://react-pdf.org/components#page-wrapping
*/
wrap?: boolean;
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
size?: PageSize;
orientation?: Orientation;
dpi?: number;
bookmark?: Bookmark;
}
/**
* Represents single page inside the PDF document, or a subset of them if
* using the wrapping feature. A <Document /> can contain as many pages as
* you want, but ensure not rendering a page inside any component besides
* Document.
*/
export class Page extends React.Component<
React.PropsWithChildren<PageProps>
> {}
interface ViewProps extends NodeProps {
id?: string;
/**
* Enable/disable page wrapping for element.
* @see https://react-pdf.org/components#page-wrapping
*/
wrap?: boolean;
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
render?: (props: {
pageNumber: number;
subPageNumber: number;
}) => React.ReactNode;
}
/**
* The most fundamental component for building a UI and is designed to be
* nested inside other views and can have 0 to many children.
*/
export class View extends React.Component<
React.PropsWithChildren<ViewProps>
> {}
interface BaseImageProps extends NodeProps {
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
cache?: boolean;
/**
* A comma-separated list of image sources with width descriptors.
* Works like the HTML img srcSet attribute.
* @example "small.jpg 300w, medium.jpg 600w, large.jpg 900w"
*/
srcSet?: SrcSet;
/**
* The intended display width of the image, used to select the best source
* from srcSet. Accepts a number (in points) or a string.
* Works like the HTML img sizes attribute.
* @example 300
* @example "300"
*/
sizes?: Sizes;
}
interface ImageWithSrcProp extends BaseImageProps {
src: SourceObject;
}
interface ImageWithSourceProp extends BaseImageProps {
source: SourceObject;
}
type ImageProps = ImageWithSrcProp | ImageWithSourceProp;
/**
* A React component for displaying network or local (Node only) JPG or
* PNG images, as well as base64 encoded image strings.
*/
export class Image extends React.Component<ImageProps> {}
interface BaseImageBackgroundProps extends NodeProps {
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
cache?: boolean;
/**
* A comma-separated list of image sources with width descriptors.
* Works like the HTML img srcSet attribute.
* @example "small.jpg 300w, medium.jpg 600w, large.jpg 900w"
*/
srcSet?: SrcSet;
/**
* The intended display width of the image, used to select the best source
* from srcSet. Accepts a number (in points) or a string.
* @example 300
*/
sizes?: Sizes;
/**
* Style applied to the background image.
*/
imageStyle?: Style;
}
interface ImageBackgroundWithSrcProp extends BaseImageBackgroundProps {
src: SourceObject;
}
interface ImageBackgroundWithSourceProp extends BaseImageBackgroundProps {
source: SourceObject;
}
type ImageBackgroundProps =
| ImageBackgroundWithSrcProp
| ImageBackgroundWithSourceProp;
/**
* A React component for displaying an image behind child content.
* Compatible with React Native's ImageBackground component.
* @see https://reactnative.dev/docs/imagebackground
*/
export class ImageBackground extends React.Component<
React.PropsWithChildren<ImageBackgroundProps>
> {}
interface TextProps extends NodeProps {
id?: string;
/**
* Enable/disable page wrapping for element.
* @see https://react-pdf.org/components#page-wrapping
*/
wrap?: boolean;
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
render?: (props: {
pageNumber: number;
totalPages: number;
subPageNumber: number;
subPageTotalPages: number;
}) => React.ReactNode;
/**
* Override the default hyphenation-callback
* @see https://react-pdf.org/fonts#registerhyphenationcallback
*/
hyphenationCallback?: HyphenationCallback;
/**
* Specifies the minimum number of lines in a text element that must be shown at the bottom of a page or its container.
* @see https://react-pdf.org/advanced#orphan-&-widow-protection
*/
orphans?: number;
/**
* Specifies the minimum number of lines in a text element that must be shown at the top of a page or its container..
* @see https://react-pdf.org/advanced#orphan-&-widow-protection
*/
widows?: number;
}
interface SVGTextProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
x: string | number;
y: string | number;
/**
* Override the default hyphenation-callback
* @see https://react-pdf.org/fonts#registerhyphenationcallback
*/
hyphenationCallback?: HyphenationCallback;
}
/**
* A React component for displaying text. Text supports nesting of other
* Text or Link components to create inline styling.
*/
export class Text extends React.Component<
React.PropsWithChildren<TextProps> | SVGTextProps
> {}
interface LinkProps extends NodeProps {
/**
* Enable/disable page wrapping for element.
* @see https://react-pdf.org/components#page-wrapping
*/
wrap?: boolean;
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
href?: string;
src?: string;
/**
* Extends the clickable area of the link beyond its visible bounds.
* Accepts a number (applied to all sides) or an object with top, bottom, left, right.
* @see https://reactnative.dev/docs/view#hitslop
*/
hitSlop?: HitSlop;
}
/**
* A React component for displaying a hyperlink. Links can be nested
* inside a Text component, or being inside any other valid primitive.
*/
export class Link extends React.Component<
React.PropsWithChildren<LinkProps>
> {}
interface FormCommonProps extends NodeProps {
name?: string;
required?: boolean;
noExport?: boolean;
readOnly?: boolean;
value?: number | string;
defaultValue?: number | string;
}
interface FieldSetProps extends NodeProps {
name: string;
}
export class FieldSet extends React.Component<
React.PropsWithChildren<FieldSetProps>
> {}
// see http://pdfkit.org/docs/forms.html#text_field_formatting
interface TextInputFormatting {
type:
| 'date'
| 'time'
| 'percent'
| 'number'
| 'zip'
| 'zipPlus4'
| 'phone'
| 'ssn';
param?: string;
nDec?: number;
sepComma?: boolean;
negStyle?: 'MinusBlack' | 'Red' | 'ParensBlack' | 'ParensRed';
currency?: string;
currencyPrepend?: boolean;
}
// see http://pdfkit.org/docs/forms.html#text_field_formatting
interface TextInputProps extends FormCommonProps {
align?: 'left' | 'center' | 'right';
multiline?: boolean;
/**
* The text will be masked (e.g. with asterisks).
*/
password?: boolean;
/**
* If set, text entered in the field is not spell-checked
*/
noSpell?: boolean;
format?: TextInputFormatting;
/**
* Sets the fontSize (default or 0 means auto sizing)
*/
fontSize?: number;
/**
* Sets the maximum length (characters) of the text in the field
*/
maxLength?: number;
}
export class TextInput extends React.Component<TextInputProps> {}
interface CheckboxProps extends FormCommonProps {
backgroundColor?: string;
borderColor?: string;
checked?: boolean;
onState?: string;
offState?: string;
xMark?: boolean;
}
export class Checkbox extends React.Component<CheckboxProps> {}
interface SelectAndListPropsBase extends FormCommonProps {
sort?: boolean;
edit?: boolean;
multiSelect?: boolean;
noSpell?: boolean;
select?: string[];
}
type SelectAndListPropsWithEdit = SelectAndListPropsBase & {
edit: true | false;
noSpell: boolean;
};
type SelectAndListPropsWithNoSpell = SelectAndListPropsBase & {
edit: boolean;
noSpell: true | false;
};
type SelectAndListProps =
| SelectAndListPropsWithEdit
| SelectAndListPropsWithNoSpell;
export class Select extends React.Component<SelectAndListProps> {}
export class List extends React.Component<SelectAndListProps> {}
interface NoteProps extends NodeProps {
children: string;
}
export class Note extends React.Component<NoteProps> {}
interface CanvasProps extends NodeProps {
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
paint: (
painter: any,
availableWidth: number,
availableHeight: number,
) => null;
}
export class Canvas extends React.Component<CanvasProps> {}
interface SVGProps extends NodeProps, SVGPresentationAttributes {
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
width?: string | number;
height?: string | number;
viewBox?: string;
preserveAspectRatio?: string;
}
/**
* The <SVG /> element is a container that defines a new coordinate system and viewport. It is used as the outermost element of SVG documents.
*/
export class Svg extends React.Component<React.PropsWithChildren<SVGProps>> {}
interface LineProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
x1: string | number;
x2: string | number;
y1: string | number;
y2: string | number;
}
/**
* The <Line /> element is used to create a line.
*/
export class Line extends React.Component<
React.PropsWithChildren<LineProps>
> {}
interface PolylineProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
points: string;
}
/**
* The <Polyline /> element is used to create any shape that consists of only straight lines (that is connected at several points).
*/
export class Polyline extends React.Component<
React.PropsWithChildren<PolylineProps>
> {}
interface PolygonProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
points: string;
}
/**
* The <Polygon /> element is used to create a graphic that contains at least three sides.
* Polygons are made of straight lines, and the shape is "closed" (all the lines connect up).
*/
export class Polygon extends React.Component<
React.PropsWithChildren<PolygonProps>
> {}
interface PathProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
d: string;
}
/**
* The <Path /> element is the most powerful element in the SVG library of basic shapes. It can be used to create lines, curves, arcs, and more.
*/
export class Path extends React.Component<
React.PropsWithChildren<PathProps>
> {}
interface RectProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
x?: string | number;
y?: string | number;
width: string | number;
height: string | number;
rx?: string | number;
ry?: string | number;
}
/**
* The <Rect /> element is used to create a rectangle and variations of a rectangle shape.
*/
export class Rect extends React.Component<
React.PropsWithChildren<RectProps>
> {}
interface CircleProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
cx?: string | number;
cy?: string | number;
r: string | number;
}
/**
* The <Circle /> element is used to create a circle.
*/
export class Circle extends React.Component<
React.PropsWithChildren<CircleProps>
> {}
interface EllipseProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
cx?: string | number;
cy?: string | number;
rx: string | number;
ry: string | number;
}
/**
* The <Ellipse /> element is used to create an ellipse.
* An ellipse is closely related to a circle. The difference is that an ellipse has an x and a y radius that differs from each other, while a circle has equal x and y radius.
*/
export class Ellipse extends React.Component<
React.PropsWithChildren<EllipseProps>
> {}
interface TspanProps extends SVGPresentationAttributes {
x?: string | number;
y?: string | number;
}
/**
* The <Tspan /> element defines a subtext within a <Text /> element or another <Tspan /> element.
* It allows for adjustment of the style and/or position of that subtext as needed.
*/
export class Tspan extends React.Component<
React.PropsWithChildren<TspanProps>
> {}
interface GProps extends SVGPresentationAttributes {
style?: Style;
}
/**
* The <G /> SVG element is a container used to group other SVG elements.
* Transformations applied to the <G /> element are performed on its child elements, and its attributes are inherited by its children.
*/
export class G extends React.Component<React.PropsWithChildren<GProps>> {}
interface StopProps {
offset: string | number;
stopColor: string;
stopOpacity?: string | number;
}
/**
* The SVG <Stop /> element defines a color and its position to use on a gradient. This element is always a child of a <LinearGradient /> or <RadialGradient /> element
*/
export class Stop extends React.Component<
React.PropsWithChildren<StopProps>
> {}
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
interface DefsProps {}
/**
* The <Defs /> element is used to store graphical objects that will be used at a later time. Objects created inside a <Defs /> element are not rendered directly. To display them you have to reference them
*/
export class Defs extends React.Component<
React.PropsWithChildren<DefsProps>
> {}
interface ClipPathProps {
id?: string;
}
/**
* The <ClipPath /> SVG element defines a clipping path, to be used by the clipPath property.
* A clipping path restricts the region to which paint can be applied. Conceptually, parts of the drawing that lie outside of the region bounded by the clipping path are not drawn.
*/
export class ClipPath extends React.Component<
React.PropsWithChildren<ClipPathProps>
> {}
interface MarkerProps {
id: string;
viewBox?: string;
refX?: string | number;
refY?: string | number;
markerWidth?: string | number;
markerHeight?: string | number;
orient?: 'auto' | 'auto-start-reverse' | number;
markerUnits?: 'strokeWidth' | 'userSpaceOnUse';
}
/**
* The <Marker /> SVG element defines a graphic used for drawing arrows or polymarkers on a given <Path />, <Line />, <Polyline />, or <Polygon /> element.
* Markers can be attached to shapes using the markerStart, markerMid, and markerEnd properties.
*/
export class Marker extends React.Component<
React.PropsWithChildren<MarkerProps>
> {}
interface LinearGradientProps {
id: string;
x1?: string | number;
x2?: string | number;
y1?: string | number;
y2?: string | number;
xlinkHref?: string;
gradientTransform?: string;
gradientUnits?: 'userSpaceOnUse' | 'objectBoundingBox';
}
/**
* The <LinearGradient /> element lets authors define linear gradients that can be applied to fill or stroke of graphical elements.
*/
export class LinearGradient extends React.Component<
React.PropsWithChildren<LinearGradientProps>
> {}
interface RadialGradientProps {
id: string;
cx?: string | number;
cy?: string | number;
r?: string | number;
fx?: string | number;
fy?: string | number;
xlinkHref?: string;
gradientTransform?: string;
gradientUnits?: 'userSpaceOnUse' | 'objectBoundingBox';
}
/**
* The <RadialGradient /> element lets authors define radial gradients that can be applied to fill or stroke of graphical elements.
*/
export class RadialGradient extends React.Component<
React.PropsWithChildren<RadialGradientProps>
> {}
interface BlobProviderParams {
blob: Blob | null;
url: string | null;
loading: boolean;
error: Error | null;
}
interface BlobProviderProps {
document: React.ReactElement<DocumentProps>;
children: (params: BlobProviderParams) => React.ReactNode;
}
/**
* Easy and declarative way of getting document's blob data without
* showing it on screen.
* @see https://react-pdf.org/advanced#on-the-fly-rendering
* @platform web
*/
export class BlobProvider extends React.Component<BlobProviderProps> {}
interface PDFViewerProps {
width?: number | string;
height?: number | string;
style?: Style | Style[];
className?: string;
children?: React.ReactElement<DocumentProps>;
innerRef?: React.Ref<HTMLIFrameElement>;
showToolbar?: boolean;
}
/**
* Iframe PDF viewer for client-side generated documents.
* @platform web
*/
export class PDFViewer extends React.Component<PDFViewerProps> {}
interface PDFDownloadLinkProps
extends Omit<
React.AnchorHTMLAttributes<HTMLAnchorElement>,
'href' | 'children'
> {
/** PDF filename. Alias for anchor tag `download` attribute. */
fileName?: string;
document: React.ReactElement<DocumentProps>;
children?: React.ReactNode | React.FC<BlobProviderParams>;
onClick?: React.AnchorHTMLAttributes<HTMLAnchorElement>['onClick'] &
((
event: React.MouseEvent<HTMLAnchorElement, MouseEvent>,
instance: UsePDFInstance,
) => void);
ref?: React.Ref<HTMLAnchorElement> | undefined;
}
/**
* Anchor tag to enable generate and download PDF documents on the fly.
* @see https://react-pdf.org/advanced#on-the-fly-rendering
* @platform web
*/
export class PDFDownloadLink extends React.Component<PDFDownloadLinkProps> {}
interface UsePDFInstance {
loading: boolean;
blob: Blob | null;
url: string | null;
error: string | null;
}
/**
* React hook for creating and updating a PDF document instance
* @platform web
*/
export function usePDF(options?: {
document?: React.ReactElement<DocumentProps>;
}): [
UsePDFInstance,
(newDocument: React.ReactElement<DocumentProps>) => void,
];
export const Font: FontStore;
export const StyleSheet: {
create: <T extends Styles>(styles: T) => T;
};
export const version: any;
export const PDFRenderer: any;
export const pdf: (initialValue?: React.ReactElement<DocumentProps>) => {
container: any;
isDirty: () => boolean;
toString: () => string;
toBlob: () => Promise<Blob>;
toBuffer: () => Promise<NodeJS.ReadableStream>;
on: (event: 'change', callback: () => void) => void;
updateContainer: (
document: React.ReactElement<any>,
callback?: () => void,
) => void;
removeListener: (event: 'change', callback: () => void) => void;
};
export const renderToStream: (
document: React.ReactElement<DocumentProps>,
) => Promise<NodeJS.ReadableStream>;
/**
* @deprecated use the `renderToBuffer` method
*/
export const renderToString: (
document: React.ReactElement<DocumentProps>,
) => Promise<string>;
export const renderToFile: (
document: React.ReactElement<DocumentProps>,
filePath: string,
callback?: (output: NodeJS.ReadableStream, _filePath: string) => any,
) => Promise<NodeJS.ReadableStream>;
const render: typeof renderToFile;
/**
* Render document into a nodejs buffer
* @platform node
*/
export const renderToBuffer: (
document: React.ReactElement<ReactPDF.DocumentProps>,
) => Promise<Buffer>;
}

View File

@@ -0,0 +1,368 @@
import * as primitives from '@react-pdf/primitives';
export * from '@react-pdf/primitives';
import fs from 'fs';
import { Buffer } from 'buffer';
import FontStore from '@react-pdf/font';
import renderPDF from '@react-pdf/render';
import PDFDocument from '@react-pdf/pdfkit';
import layoutDocument from '@react-pdf/layout';
import { upperFirst } from '@react-pdf/fns';
import Reconciler from '@react-pdf/reconciler';
const omitNils = object => Object.fromEntries(Object.entries(object).filter(_ref => {
let [, value] = _ref;
return value !== undefined;
}));
const createInstance = (type, _ref) => {
let {
style,
children,
...props
} = _ref;
return {
type,
box: {},
style: style || {},
props: props || {},
children: []
};
};
const createTextInstance = text => ({
type: 'TEXT_INSTANCE',
value: text
});
const appendChild = (parent, child) => {
const isParentText = parent.type === 'TEXT' || parent.type === 'LINK' || parent.type === 'TSPAN' || parent.type === 'NOTE';
const isChildTextInstance = child.type === 'TEXT_INSTANCE';
const isOrphanTextInstance = isChildTextInstance && !isParentText;
// Ignore orphan text instances.
// Caused by cases such as <>{name && <Text>{name}</Text>}</>
if (isOrphanTextInstance) {
console.warn(`Invalid '${child.value}' string child outside <Text> component`);
return;
}
parent.children.push(child);
};
const appendChildToContainer = (parentInstance, child) => {
if (parentInstance.type === 'ROOT') {
parentInstance.document = child;
} else {
appendChild(parentInstance, child);
}
};
const insertBefore = (parentInstance, child, beforeChild) => {
var _parentInstance$child;
const index = (_parentInstance$child = parentInstance.children) === null || _parentInstance$child === void 0 ? void 0 : _parentInstance$child.indexOf(beforeChild);
if (index === undefined) return;
if (index !== -1 && child) parentInstance.children.splice(index, 0, child);
};
const removeChild = (parentInstance, child) => {
var _parentInstance$child2;
const index = (_parentInstance$child2 = parentInstance.children) === null || _parentInstance$child2 === void 0 ? void 0 : _parentInstance$child2.indexOf(child);
if (index === undefined) return;
if (index !== -1) parentInstance.children.splice(index, 1);
};
const removeChildFromContainer = (parentInstance, child) => {
var _parentInstance$child3;
const index = (_parentInstance$child3 = parentInstance.children) === null || _parentInstance$child3 === void 0 ? void 0 : _parentInstance$child3.indexOf(child);
if (index === undefined) return;
if (index !== -1) parentInstance.children.splice(index, 1);
};
const commitTextUpdate = (textInstance, oldText, newText) => {
textInstance.value = newText;
};
const commitUpdate = (instance, updatePayload, type, oldProps, newProps) => {
const {
style,
...props
} = newProps;
instance.props = props;
instance.style = style;
};
const createRenderer = _ref2 => {
let {
onChange = () => {}
} = _ref2;
return Reconciler({
appendChild,
appendChildToContainer,
commitTextUpdate,
commitUpdate,
createInstance,
createTextInstance,
insertBefore,
removeChild,
removeChildFromContainer,
resetAfterCommit: onChange
});
};
var version$1 = "4.5.1";
var packageJson = {
version: version$1};
const {
version
} = packageJson;
const fontStore = new FontStore();
// We must keep a single renderer instance, otherwise React will complain
let renderer;
// The pdf instance acts as an event emitter for DOM usage.
// We only want to trigger an update when PDF content changes
const events = {};
const pdf = initialValue => {
const onChange = () => {
var _events$change;
const listeners = ((_events$change = events.change) === null || _events$change === void 0 ? void 0 : _events$change.slice()) || [];
for (let i = 0; i < listeners.length; i += 1) listeners[i]();
};
const container = {
type: 'ROOT',
document: null
};
renderer = renderer || createRenderer({
onChange
});
const mountNode = renderer.createContainer(container);
const updateContainer = (doc, callback) => {
renderer.updateContainer(doc, mountNode, null, callback);
};
if (initialValue) updateContainer(initialValue);
const render = async function (compress) {
if (compress === void 0) {
compress = true;
}
const props = container.document.props || {};
const {
pdfVersion,
language,
pageLayout,
pageMode,
title,
author,
subject,
keywords,
creator = 'react-pdf',
producer = 'react-pdf',
creationDate = new Date(),
modificationDate,
ownerPassword,
userPassword,
permissions
} = props;
const ctx = new PDFDocument({
compress,
pdfVersion,
lang: language,
displayTitle: true,
autoFirstPage: false,
ownerPassword,
userPassword,
permissions,
pageLayout,
info: omitNils({
Title: title,
Author: author,
Subject: subject,
Keywords: keywords,
Creator: creator,
Producer: producer,
CreationDate: creationDate,
ModificationDate: modificationDate
})
});
if (pageMode) {
ctx._root.data.PageMode = upperFirst(pageMode);
}
const layout = await layoutDocument(container.document, fontStore);
const fileStream = renderPDF(ctx, layout);
return {
layout,
fileStream
};
};
const callOnRender = function (params) {
if (params === void 0) {
params = {};
}
if (container.document.props.onRender) {
container.document.props.onRender(params);
}
};
const toBlob = async () => {
const chunks = [];
const {
layout: _INTERNAL__LAYOUT__DATA_,
fileStream: instance
} = await render();
return new Promise((resolve, reject) => {
instance.on('data', chunk => {
chunks.push(chunk instanceof Uint8Array ? chunk : new Uint8Array(chunk));
});
instance.on('end', () => {
try {
const blob = new Blob(chunks, {
type: 'application/pdf'
});
callOnRender({
blob,
_INTERNAL__LAYOUT__DATA_
});
resolve(blob);
} catch (error) {
reject(error);
}
});
});
};
// TODO: rename this method to `toStream` in next major release, because it return stream not a buffer
const toBuffer = async () => {
const {
layout: _INTERNAL__LAYOUT__DATA_,
fileStream
} = await render();
callOnRender({
_INTERNAL__LAYOUT__DATA_
});
return fileStream;
};
/*
* TODO: remove this method in next major release. it is buggy
* see
* - https://github.com/diegomura/react-pdf/issues/2112
* - https://github.com/diegomura/react-pdf/issues/2095
*/
const toString = async () => {
if (process.env.NODE_ENV === 'development') {
console.warn('`toString` is deprecated and will be removed in next major release');
}
let result = '';
const {
fileStream: instance
} = await render(false); // For some reason, when rendering to string if compress=true the document is blank
return new Promise((resolve, reject) => {
try {
instance.on('data', buffer => {
result += buffer;
});
instance.on('end', () => {
callOnRender();
resolve(result);
});
} catch (error) {
reject(error);
}
});
};
const on = (event, listener) => {
if (!events[event]) events[event] = [];
events[event].push(listener);
};
const removeListener = (event, listener) => {
if (!events[event]) return;
const idx = events[event].indexOf(listener);
if (idx > -1) events[event].splice(idx, 1);
};
return {
on,
container,
toBlob,
toBuffer,
toString,
removeListener,
updateContainer
};
};
const Font = fontStore;
const StyleSheet = {
create: s => s
};
/**
* @param {React.ReactElement} element
* @returns {Promise<NodeJS.ReadableStream>}
*/
const renderToStream = async element => {
const instance = pdf(element);
const stream = await instance.toBuffer();
return stream;
};
/**
* @param {React.ReactElement} element
* @param {string} filePath
* @param {Function} [callback]
*/
const renderToFile = async (element, filePath, callback) => {
const output = await renderToStream(element);
const stream = fs.createWriteStream(filePath);
output.pipe(stream);
return new Promise((resolve, reject) => {
stream.on('finish', () => {
if (callback) callback(output, filePath);
resolve(output);
});
stream.on('error', reject);
});
};
/**
* @param {React.ReactElement} element
* @returns {Promise<Buffer>}
*/
const renderToBuffer = element => renderToStream(element).then(stream => new Promise((resolve, reject) => {
const chunks = [];
stream.on('data', chunk => chunks.push(chunk));
stream.on('end', () => resolve(Buffer.concat(chunks)));
stream.on('error', error => reject(error));
}));
const renderToString = element => {
if (process.env.NODE_ENV === 'development') {
console.warn('`renderToString` is deprecated and will be removed in next major release, use `renderToBuffer` instead');
}
return renderToBuffer(element).then(buffer => buffer.toString());
};
const throwEnvironmentError = name => {
throw new Error(`${name} is a web specific API. You're either using this component on Node, or your bundler is not loading react-pdf from the appropriate web build.`);
};
const usePDF = () => {
throwEnvironmentError('usePDF');
};
const PDFViewer = () => {
throwEnvironmentError('PDFViewer');
};
const PDFDownloadLink = () => {
throwEnvironmentError('PDFDownloadLink');
};
const BlobProvider = () => {
throwEnvironmentError('BlobProvider');
};
const render = renderToFile;
// TODO: remove this default export in next major release because it breaks tree-shacking
var index = {
pdf,
Font,
version,
StyleSheet,
usePDF,
PDFViewer,
BlobProvider,
PDFDownloadLink,
renderToStream,
renderToString,
renderToFile,
render,
...primitives
};
export { BlobProvider, Font, PDFDownloadLink, PDFViewer, StyleSheet, createRenderer, index as default, pdf, render, renderToBuffer, renderToFile, renderToStream, renderToString, usePDF, version };
//# sourceMappingURL=react-pdf.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,793 @@
/* eslint-disable max-classes-per-file */
import * as React from 'react';
import {
Style,
PageSize,
FontStore,
PDFVersion,
Orientation,
SourceObject,
SrcSet,
Sizes,
HyphenationCallback,
SVGPresentationAttributes,
Bookmark,
PageLayout,
PageMode,
HitSlop,
} from '@react-pdf/types';
declare class ReactPDF {
static default: typeof ReactPDF;
}
export = ReactPDF;
declare namespace ReactPDF {
interface Styles {
[key: string]: Style;
}
interface OnRenderProps {
blob?: Blob;
}
interface Permissions {
printing?: 'lowResolution' | 'highResolution';
modifying?: boolean;
copying?: boolean;
annotating?: boolean;
fillingForms?: boolean;
contentAccessibility?: boolean;
documentAssembly?: boolean;
}
interface DocumentProps {
style?: Style | Style[];
title?: string;
author?: string;
subject?: string;
creator?: string;
keywords?: string;
producer?: string;
language?: string;
creationDate?: Date;
modificationDate?: Date;
pdfVersion?: PDFVersion;
pageMode?: PageMode;
pageLayout?: PageLayout;
ownerPassword?: string;
userPassword?: string;
permissions?: Permissions;
onRender?: (props: OnRenderProps) => any;
}
/**
* This component represent the PDF document itself. It must be the root
* of your tree element structure, and under no circumstances should it be
* used as children of another react-pdf component. In addition, it should
* only have childs of type <Page />.
*/
export class Document extends React.Component<
React.PropsWithChildren<DocumentProps>
> {}
interface NodeProps {
id?: string;
style?: Style | Style[];
/**
* Render component in all wrapped pages.
* @see https://react-pdf.org/advanced#fixed-components
*/
fixed?: boolean;
/**
* Force the wrapping algorithm to start a new page when rendering the
* element.
* @see https://react-pdf.org/advanced#page-breaks
*/
break?: boolean;
/**
* Hint that no page wrapping should occur between all sibling elements following the element within n points
* @see https://react-pdf.org/advanced#orphan-&-widow-protection
*/
minPresenceAhead?: number;
}
interface PageProps extends NodeProps {
/**
* Enable page wrapping for this page.
* @see https://react-pdf.org/components#page-wrapping
*/
wrap?: boolean;
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
size?: PageSize;
orientation?: Orientation;
dpi?: number;
bookmark?: Bookmark;
}
/**
* Represents single page inside the PDF document, or a subset of them if
* using the wrapping feature. A <Document /> can contain as many pages as
* you want, but ensure not rendering a page inside any component besides
* Document.
*/
export class Page extends React.Component<
React.PropsWithChildren<PageProps>
> {}
interface ViewProps extends NodeProps {
id?: string;
/**
* Enable/disable page wrapping for element.
* @see https://react-pdf.org/components#page-wrapping
*/
wrap?: boolean;
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
render?: (props: {
pageNumber: number;
subPageNumber: number;
}) => React.ReactNode;
}
/**
* The most fundamental component for building a UI and is designed to be
* nested inside other views and can have 0 to many children.
*/
export class View extends React.Component<
React.PropsWithChildren<ViewProps>
> {}
interface BaseImageProps extends NodeProps {
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
cache?: boolean;
/**
* A comma-separated list of image sources with width descriptors.
* Works like the HTML img srcSet attribute.
* @example "small.jpg 300w, medium.jpg 600w, large.jpg 900w"
*/
srcSet?: SrcSet;
/**
* The intended display width of the image, used to select the best source
* from srcSet. Accepts a number (in points) or a string.
* Works like the HTML img sizes attribute.
* @example 300
* @example "300"
*/
sizes?: Sizes;
}
interface ImageWithSrcProp extends BaseImageProps {
src: SourceObject;
}
interface ImageWithSourceProp extends BaseImageProps {
source: SourceObject;
}
type ImageProps = ImageWithSrcProp | ImageWithSourceProp;
/**
* A React component for displaying network or local (Node only) JPG or
* PNG images, as well as base64 encoded image strings.
*/
export class Image extends React.Component<ImageProps> {}
interface BaseImageBackgroundProps extends NodeProps {
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
cache?: boolean;
/**
* A comma-separated list of image sources with width descriptors.
* Works like the HTML img srcSet attribute.
* @example "small.jpg 300w, medium.jpg 600w, large.jpg 900w"
*/
srcSet?: SrcSet;
/**
* The intended display width of the image, used to select the best source
* from srcSet. Accepts a number (in points) or a string.
* @example 300
*/
sizes?: Sizes;
/**
* Style applied to the background image.
*/
imageStyle?: Style;
}
interface ImageBackgroundWithSrcProp extends BaseImageBackgroundProps {
src: SourceObject;
}
interface ImageBackgroundWithSourceProp extends BaseImageBackgroundProps {
source: SourceObject;
}
type ImageBackgroundProps =
| ImageBackgroundWithSrcProp
| ImageBackgroundWithSourceProp;
/**
* A React component for displaying an image behind child content.
* Compatible with React Native's ImageBackground component.
* @see https://reactnative.dev/docs/imagebackground
*/
export class ImageBackground extends React.Component<
React.PropsWithChildren<ImageBackgroundProps>
> {}
interface TextProps extends NodeProps {
id?: string;
/**
* Enable/disable page wrapping for element.
* @see https://react-pdf.org/components#page-wrapping
*/
wrap?: boolean;
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
render?: (props: {
pageNumber: number;
totalPages: number;
subPageNumber: number;
subPageTotalPages: number;
}) => React.ReactNode;
/**
* Override the default hyphenation-callback
* @see https://react-pdf.org/fonts#registerhyphenationcallback
*/
hyphenationCallback?: HyphenationCallback;
/**
* Specifies the minimum number of lines in a text element that must be shown at the bottom of a page or its container.
* @see https://react-pdf.org/advanced#orphan-&-widow-protection
*/
orphans?: number;
/**
* Specifies the minimum number of lines in a text element that must be shown at the top of a page or its container..
* @see https://react-pdf.org/advanced#orphan-&-widow-protection
*/
widows?: number;
}
interface SVGTextProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
x: string | number;
y: string | number;
/**
* Override the default hyphenation-callback
* @see https://react-pdf.org/fonts#registerhyphenationcallback
*/
hyphenationCallback?: HyphenationCallback;
}
/**
* A React component for displaying text. Text supports nesting of other
* Text or Link components to create inline styling.
*/
export class Text extends React.Component<
React.PropsWithChildren<TextProps> | SVGTextProps
> {}
interface LinkProps extends NodeProps {
/**
* Enable/disable page wrapping for element.
* @see https://react-pdf.org/components#page-wrapping
*/
wrap?: boolean;
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
href?: string;
src?: string;
/**
* Extends the clickable area of the link beyond its visible bounds.
* Accepts a number (applied to all sides) or an object with top, bottom, left, right.
* @see https://reactnative.dev/docs/view#hitslop
*/
hitSlop?: HitSlop;
}
/**
* A React component for displaying a hyperlink. Links can be nested
* inside a Text component, or being inside any other valid primitive.
*/
export class Link extends React.Component<
React.PropsWithChildren<LinkProps>
> {}
interface FormCommonProps extends NodeProps {
name?: string;
required?: boolean;
noExport?: boolean;
readOnly?: boolean;
value?: number | string;
defaultValue?: number | string;
}
interface FieldSetProps extends NodeProps {
name: string;
}
export class FieldSet extends React.Component<
React.PropsWithChildren<FieldSetProps>
> {}
// see http://pdfkit.org/docs/forms.html#text_field_formatting
interface TextInputFormatting {
type:
| 'date'
| 'time'
| 'percent'
| 'number'
| 'zip'
| 'zipPlus4'
| 'phone'
| 'ssn';
param?: string;
nDec?: number;
sepComma?: boolean;
negStyle?: 'MinusBlack' | 'Red' | 'ParensBlack' | 'ParensRed';
currency?: string;
currencyPrepend?: boolean;
}
// see http://pdfkit.org/docs/forms.html#text_field_formatting
interface TextInputProps extends FormCommonProps {
align?: 'left' | 'center' | 'right';
multiline?: boolean;
/**
* The text will be masked (e.g. with asterisks).
*/
password?: boolean;
/**
* If set, text entered in the field is not spell-checked
*/
noSpell?: boolean;
format?: TextInputFormatting;
/**
* Sets the fontSize (default or 0 means auto sizing)
*/
fontSize?: number;
/**
* Sets the maximum length (characters) of the text in the field
*/
maxLength?: number;
}
export class TextInput extends React.Component<TextInputProps> {}
interface CheckboxProps extends FormCommonProps {
backgroundColor?: string;
borderColor?: string;
checked?: boolean;
onState?: string;
offState?: string;
xMark?: boolean;
}
export class Checkbox extends React.Component<CheckboxProps> {}
interface SelectAndListPropsBase extends FormCommonProps {
sort?: boolean;
edit?: boolean;
multiSelect?: boolean;
noSpell?: boolean;
select?: string[];
}
type SelectAndListPropsWithEdit = SelectAndListPropsBase & {
edit: true | false;
noSpell: boolean;
};
type SelectAndListPropsWithNoSpell = SelectAndListPropsBase & {
edit: boolean;
noSpell: true | false;
};
type SelectAndListProps =
| SelectAndListPropsWithEdit
| SelectAndListPropsWithNoSpell;
export class Select extends React.Component<SelectAndListProps> {}
export class List extends React.Component<SelectAndListProps> {}
interface NoteProps extends NodeProps {
children: string;
}
export class Note extends React.Component<NoteProps> {}
interface CanvasProps extends NodeProps {
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
paint: (
painter: any,
availableWidth: number,
availableHeight: number,
) => null;
}
export class Canvas extends React.Component<CanvasProps> {}
interface SVGProps extends NodeProps, SVGPresentationAttributes {
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
width?: string | number;
height?: string | number;
viewBox?: string;
preserveAspectRatio?: string;
}
/**
* The <SVG /> element is a container that defines a new coordinate system and viewport. It is used as the outermost element of SVG documents.
*/
export class Svg extends React.Component<React.PropsWithChildren<SVGProps>> {}
interface LineProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
x1: string | number;
x2: string | number;
y1: string | number;
y2: string | number;
}
/**
* The <Line /> element is used to create a line.
*/
export class Line extends React.Component<
React.PropsWithChildren<LineProps>
> {}
interface PolylineProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
points: string;
}
/**
* The <Polyline /> element is used to create any shape that consists of only straight lines (that is connected at several points).
*/
export class Polyline extends React.Component<
React.PropsWithChildren<PolylineProps>
> {}
interface PolygonProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
points: string;
}
/**
* The <Polygon /> element is used to create a graphic that contains at least three sides.
* Polygons are made of straight lines, and the shape is "closed" (all the lines connect up).
*/
export class Polygon extends React.Component<
React.PropsWithChildren<PolygonProps>
> {}
interface PathProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
d: string;
}
/**
* The <Path /> element is the most powerful element in the SVG library of basic shapes. It can be used to create lines, curves, arcs, and more.
*/
export class Path extends React.Component<
React.PropsWithChildren<PathProps>
> {}
interface RectProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
x?: string | number;
y?: string | number;
width: string | number;
height: string | number;
rx?: string | number;
ry?: string | number;
}
/**
* The <Rect /> element is used to create a rectangle and variations of a rectangle shape.
*/
export class Rect extends React.Component<
React.PropsWithChildren<RectProps>
> {}
interface CircleProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
cx?: string | number;
cy?: string | number;
r: string | number;
}
/**
* The <Circle /> element is used to create a circle.
*/
export class Circle extends React.Component<
React.PropsWithChildren<CircleProps>
> {}
interface EllipseProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
cx?: string | number;
cy?: string | number;
rx: string | number;
ry: string | number;
}
/**
* The <Ellipse /> element is used to create an ellipse.
* An ellipse is closely related to a circle. The difference is that an ellipse has an x and a y radius that differs from each other, while a circle has equal x and y radius.
*/
export class Ellipse extends React.Component<
React.PropsWithChildren<EllipseProps>
> {}
interface TspanProps extends SVGPresentationAttributes {
x?: string | number;
y?: string | number;
}
/**
* The <Tspan /> element defines a subtext within a <Text /> element or another <Tspan /> element.
* It allows for adjustment of the style and/or position of that subtext as needed.
*/
export class Tspan extends React.Component<
React.PropsWithChildren<TspanProps>
> {}
interface GProps extends SVGPresentationAttributes {
style?: Style;
}
/**
* The <G /> SVG element is a container used to group other SVG elements.
* Transformations applied to the <G /> element are performed on its child elements, and its attributes are inherited by its children.
*/
export class G extends React.Component<React.PropsWithChildren<GProps>> {}
interface StopProps {
offset: string | number;
stopColor: string;
stopOpacity?: string | number;
}
/**
* The SVG <Stop /> element defines a color and its position to use on a gradient. This element is always a child of a <LinearGradient /> or <RadialGradient /> element
*/
export class Stop extends React.Component<
React.PropsWithChildren<StopProps>
> {}
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
interface DefsProps {}
/**
* The <Defs /> element is used to store graphical objects that will be used at a later time. Objects created inside a <Defs /> element are not rendered directly. To display them you have to reference them
*/
export class Defs extends React.Component<
React.PropsWithChildren<DefsProps>
> {}
interface ClipPathProps {
id?: string;
}
/**
* The <ClipPath /> SVG element defines a clipping path, to be used by the clipPath property.
* A clipping path restricts the region to which paint can be applied. Conceptually, parts of the drawing that lie outside of the region bounded by the clipping path are not drawn.
*/
export class ClipPath extends React.Component<
React.PropsWithChildren<ClipPathProps>
> {}
interface MarkerProps {
id: string;
viewBox?: string;
refX?: string | number;
refY?: string | number;
markerWidth?: string | number;
markerHeight?: string | number;
orient?: 'auto' | 'auto-start-reverse' | number;
markerUnits?: 'strokeWidth' | 'userSpaceOnUse';
}
/**
* The <Marker /> SVG element defines a graphic used for drawing arrows or polymarkers on a given <Path />, <Line />, <Polyline />, or <Polygon /> element.
* Markers can be attached to shapes using the markerStart, markerMid, and markerEnd properties.
*/
export class Marker extends React.Component<
React.PropsWithChildren<MarkerProps>
> {}
interface LinearGradientProps {
id: string;
x1?: string | number;
x2?: string | number;
y1?: string | number;
y2?: string | number;
xlinkHref?: string;
gradientTransform?: string;
gradientUnits?: 'userSpaceOnUse' | 'objectBoundingBox';
}
/**
* The <LinearGradient /> element lets authors define linear gradients that can be applied to fill or stroke of graphical elements.
*/
export class LinearGradient extends React.Component<
React.PropsWithChildren<LinearGradientProps>
> {}
interface RadialGradientProps {
id: string;
cx?: string | number;
cy?: string | number;
r?: string | number;
fx?: string | number;
fy?: string | number;
xlinkHref?: string;
gradientTransform?: string;
gradientUnits?: 'userSpaceOnUse' | 'objectBoundingBox';
}
/**
* The <RadialGradient /> element lets authors define radial gradients that can be applied to fill or stroke of graphical elements.
*/
export class RadialGradient extends React.Component<
React.PropsWithChildren<RadialGradientProps>
> {}
interface BlobProviderParams {
blob: Blob | null;
url: string | null;
loading: boolean;
error: Error | null;
}
interface BlobProviderProps {
document: React.ReactElement<DocumentProps>;
children: (params: BlobProviderParams) => React.ReactNode;
}
/**
* Easy and declarative way of getting document's blob data without
* showing it on screen.
* @see https://react-pdf.org/advanced#on-the-fly-rendering
* @platform web
*/
export class BlobProvider extends React.Component<BlobProviderProps> {}
interface PDFViewerProps {
width?: number | string;
height?: number | string;
style?: Style | Style[];
className?: string;
children?: React.ReactElement<DocumentProps>;
innerRef?: React.Ref<HTMLIFrameElement>;
showToolbar?: boolean;
}
/**
* Iframe PDF viewer for client-side generated documents.
* @platform web
*/
export class PDFViewer extends React.Component<PDFViewerProps> {}
interface PDFDownloadLinkProps
extends Omit<
React.AnchorHTMLAttributes<HTMLAnchorElement>,
'href' | 'children'
> {
/** PDF filename. Alias for anchor tag `download` attribute. */
fileName?: string;
document: React.ReactElement<DocumentProps>;
children?: React.ReactNode | React.FC<BlobProviderParams>;
onClick?: React.AnchorHTMLAttributes<HTMLAnchorElement>['onClick'] &
((
event: React.MouseEvent<HTMLAnchorElement, MouseEvent>,
instance: UsePDFInstance,
) => void);
ref?: React.Ref<HTMLAnchorElement> | undefined;
}
/**
* Anchor tag to enable generate and download PDF documents on the fly.
* @see https://react-pdf.org/advanced#on-the-fly-rendering
* @platform web
*/
export class PDFDownloadLink extends React.Component<PDFDownloadLinkProps> {}
interface UsePDFInstance {
loading: boolean;
blob: Blob | null;
url: string | null;
error: string | null;
}
/**
* React hook for creating and updating a PDF document instance
* @platform web
*/
export function usePDF(options?: {
document?: React.ReactElement<DocumentProps>;
}): [
UsePDFInstance,
(newDocument: React.ReactElement<DocumentProps>) => void,
];
export const Font: FontStore;
export const StyleSheet: {
create: <T extends Styles>(styles: T) => T;
};
export const version: any;
export const PDFRenderer: any;
export const pdf: (initialValue?: React.ReactElement<DocumentProps>) => {
container: any;
isDirty: () => boolean;
toString: () => string;
toBlob: () => Promise<Blob>;
toBuffer: () => Promise<NodeJS.ReadableStream>;
on: (event: 'change', callback: () => void) => void;
updateContainer: (
document: React.ReactElement<any>,
callback?: () => void,
) => void;
removeListener: (event: 'change', callback: () => void) => void;
};
export const renderToStream: (
document: React.ReactElement<DocumentProps>,
) => Promise<NodeJS.ReadableStream>;
/**
* @deprecated use the `renderToBuffer` method
*/
export const renderToString: (
document: React.ReactElement<DocumentProps>,
) => Promise<string>;
export const renderToFile: (
document: React.ReactElement<DocumentProps>,
filePath: string,
callback?: (output: NodeJS.ReadableStream, _filePath: string) => any,
) => Promise<NodeJS.ReadableStream>;
const render: typeof renderToFile;
/**
* Render document into a nodejs buffer
* @platform node
*/
export const renderToBuffer: (
document: React.ReactElement<ReactPDF.DocumentProps>,
) => Promise<Buffer>;
}

View File

@@ -0,0 +1,793 @@
/* eslint-disable max-classes-per-file */
import * as React from 'react';
import {
Style,
PageSize,
FontStore,
PDFVersion,
Orientation,
SourceObject,
SrcSet,
Sizes,
HyphenationCallback,
SVGPresentationAttributes,
Bookmark,
PageLayout,
PageMode,
HitSlop,
} from '@react-pdf/types';
declare class ReactPDF {
static default: typeof ReactPDF;
}
export = ReactPDF;
declare namespace ReactPDF {
interface Styles {
[key: string]: Style;
}
interface OnRenderProps {
blob?: Blob;
}
interface Permissions {
printing?: 'lowResolution' | 'highResolution';
modifying?: boolean;
copying?: boolean;
annotating?: boolean;
fillingForms?: boolean;
contentAccessibility?: boolean;
documentAssembly?: boolean;
}
interface DocumentProps {
style?: Style | Style[];
title?: string;
author?: string;
subject?: string;
creator?: string;
keywords?: string;
producer?: string;
language?: string;
creationDate?: Date;
modificationDate?: Date;
pdfVersion?: PDFVersion;
pageMode?: PageMode;
pageLayout?: PageLayout;
ownerPassword?: string;
userPassword?: string;
permissions?: Permissions;
onRender?: (props: OnRenderProps) => any;
}
/**
* This component represent the PDF document itself. It must be the root
* of your tree element structure, and under no circumstances should it be
* used as children of another react-pdf component. In addition, it should
* only have childs of type <Page />.
*/
export class Document extends React.Component<
React.PropsWithChildren<DocumentProps>
> {}
interface NodeProps {
id?: string;
style?: Style | Style[];
/**
* Render component in all wrapped pages.
* @see https://react-pdf.org/advanced#fixed-components
*/
fixed?: boolean;
/**
* Force the wrapping algorithm to start a new page when rendering the
* element.
* @see https://react-pdf.org/advanced#page-breaks
*/
break?: boolean;
/**
* Hint that no page wrapping should occur between all sibling elements following the element within n points
* @see https://react-pdf.org/advanced#orphan-&-widow-protection
*/
minPresenceAhead?: number;
}
interface PageProps extends NodeProps {
/**
* Enable page wrapping for this page.
* @see https://react-pdf.org/components#page-wrapping
*/
wrap?: boolean;
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
size?: PageSize;
orientation?: Orientation;
dpi?: number;
bookmark?: Bookmark;
}
/**
* Represents single page inside the PDF document, or a subset of them if
* using the wrapping feature. A <Document /> can contain as many pages as
* you want, but ensure not rendering a page inside any component besides
* Document.
*/
export class Page extends React.Component<
React.PropsWithChildren<PageProps>
> {}
interface ViewProps extends NodeProps {
id?: string;
/**
* Enable/disable page wrapping for element.
* @see https://react-pdf.org/components#page-wrapping
*/
wrap?: boolean;
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
render?: (props: {
pageNumber: number;
subPageNumber: number;
}) => React.ReactNode;
}
/**
* The most fundamental component for building a UI and is designed to be
* nested inside other views and can have 0 to many children.
*/
export class View extends React.Component<
React.PropsWithChildren<ViewProps>
> {}
interface BaseImageProps extends NodeProps {
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
cache?: boolean;
/**
* A comma-separated list of image sources with width descriptors.
* Works like the HTML img srcSet attribute.
* @example "small.jpg 300w, medium.jpg 600w, large.jpg 900w"
*/
srcSet?: SrcSet;
/**
* The intended display width of the image, used to select the best source
* from srcSet. Accepts a number (in points) or a string.
* Works like the HTML img sizes attribute.
* @example 300
* @example "300"
*/
sizes?: Sizes;
}
interface ImageWithSrcProp extends BaseImageProps {
src: SourceObject;
}
interface ImageWithSourceProp extends BaseImageProps {
source: SourceObject;
}
type ImageProps = ImageWithSrcProp | ImageWithSourceProp;
/**
* A React component for displaying network or local (Node only) JPG or
* PNG images, as well as base64 encoded image strings.
*/
export class Image extends React.Component<ImageProps> {}
interface BaseImageBackgroundProps extends NodeProps {
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
cache?: boolean;
/**
* A comma-separated list of image sources with width descriptors.
* Works like the HTML img srcSet attribute.
* @example "small.jpg 300w, medium.jpg 600w, large.jpg 900w"
*/
srcSet?: SrcSet;
/**
* The intended display width of the image, used to select the best source
* from srcSet. Accepts a number (in points) or a string.
* @example 300
*/
sizes?: Sizes;
/**
* Style applied to the background image.
*/
imageStyle?: Style;
}
interface ImageBackgroundWithSrcProp extends BaseImageBackgroundProps {
src: SourceObject;
}
interface ImageBackgroundWithSourceProp extends BaseImageBackgroundProps {
source: SourceObject;
}
type ImageBackgroundProps =
| ImageBackgroundWithSrcProp
| ImageBackgroundWithSourceProp;
/**
* A React component for displaying an image behind child content.
* Compatible with React Native's ImageBackground component.
* @see https://reactnative.dev/docs/imagebackground
*/
export class ImageBackground extends React.Component<
React.PropsWithChildren<ImageBackgroundProps>
> {}
interface TextProps extends NodeProps {
id?: string;
/**
* Enable/disable page wrapping for element.
* @see https://react-pdf.org/components#page-wrapping
*/
wrap?: boolean;
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
render?: (props: {
pageNumber: number;
totalPages: number;
subPageNumber: number;
subPageTotalPages: number;
}) => React.ReactNode;
/**
* Override the default hyphenation-callback
* @see https://react-pdf.org/fonts#registerhyphenationcallback
*/
hyphenationCallback?: HyphenationCallback;
/**
* Specifies the minimum number of lines in a text element that must be shown at the bottom of a page or its container.
* @see https://react-pdf.org/advanced#orphan-&-widow-protection
*/
orphans?: number;
/**
* Specifies the minimum number of lines in a text element that must be shown at the top of a page or its container..
* @see https://react-pdf.org/advanced#orphan-&-widow-protection
*/
widows?: number;
}
interface SVGTextProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
x: string | number;
y: string | number;
/**
* Override the default hyphenation-callback
* @see https://react-pdf.org/fonts#registerhyphenationcallback
*/
hyphenationCallback?: HyphenationCallback;
}
/**
* A React component for displaying text. Text supports nesting of other
* Text or Link components to create inline styling.
*/
export class Text extends React.Component<
React.PropsWithChildren<TextProps> | SVGTextProps
> {}
interface LinkProps extends NodeProps {
/**
* Enable/disable page wrapping for element.
* @see https://react-pdf.org/components#page-wrapping
*/
wrap?: boolean;
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
href?: string;
src?: string;
/**
* Extends the clickable area of the link beyond its visible bounds.
* Accepts a number (applied to all sides) or an object with top, bottom, left, right.
* @see https://reactnative.dev/docs/view#hitslop
*/
hitSlop?: HitSlop;
}
/**
* A React component for displaying a hyperlink. Links can be nested
* inside a Text component, or being inside any other valid primitive.
*/
export class Link extends React.Component<
React.PropsWithChildren<LinkProps>
> {}
interface FormCommonProps extends NodeProps {
name?: string;
required?: boolean;
noExport?: boolean;
readOnly?: boolean;
value?: number | string;
defaultValue?: number | string;
}
interface FieldSetProps extends NodeProps {
name: string;
}
export class FieldSet extends React.Component<
React.PropsWithChildren<FieldSetProps>
> {}
// see http://pdfkit.org/docs/forms.html#text_field_formatting
interface TextInputFormatting {
type:
| 'date'
| 'time'
| 'percent'
| 'number'
| 'zip'
| 'zipPlus4'
| 'phone'
| 'ssn';
param?: string;
nDec?: number;
sepComma?: boolean;
negStyle?: 'MinusBlack' | 'Red' | 'ParensBlack' | 'ParensRed';
currency?: string;
currencyPrepend?: boolean;
}
// see http://pdfkit.org/docs/forms.html#text_field_formatting
interface TextInputProps extends FormCommonProps {
align?: 'left' | 'center' | 'right';
multiline?: boolean;
/**
* The text will be masked (e.g. with asterisks).
*/
password?: boolean;
/**
* If set, text entered in the field is not spell-checked
*/
noSpell?: boolean;
format?: TextInputFormatting;
/**
* Sets the fontSize (default or 0 means auto sizing)
*/
fontSize?: number;
/**
* Sets the maximum length (characters) of the text in the field
*/
maxLength?: number;
}
export class TextInput extends React.Component<TextInputProps> {}
interface CheckboxProps extends FormCommonProps {
backgroundColor?: string;
borderColor?: string;
checked?: boolean;
onState?: string;
offState?: string;
xMark?: boolean;
}
export class Checkbox extends React.Component<CheckboxProps> {}
interface SelectAndListPropsBase extends FormCommonProps {
sort?: boolean;
edit?: boolean;
multiSelect?: boolean;
noSpell?: boolean;
select?: string[];
}
type SelectAndListPropsWithEdit = SelectAndListPropsBase & {
edit: true | false;
noSpell: boolean;
};
type SelectAndListPropsWithNoSpell = SelectAndListPropsBase & {
edit: boolean;
noSpell: true | false;
};
type SelectAndListProps =
| SelectAndListPropsWithEdit
| SelectAndListPropsWithNoSpell;
export class Select extends React.Component<SelectAndListProps> {}
export class List extends React.Component<SelectAndListProps> {}
interface NoteProps extends NodeProps {
children: string;
}
export class Note extends React.Component<NoteProps> {}
interface CanvasProps extends NodeProps {
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
paint: (
painter: any,
availableWidth: number,
availableHeight: number,
) => null;
}
export class Canvas extends React.Component<CanvasProps> {}
interface SVGProps extends NodeProps, SVGPresentationAttributes {
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
width?: string | number;
height?: string | number;
viewBox?: string;
preserveAspectRatio?: string;
}
/**
* The <SVG /> element is a container that defines a new coordinate system and viewport. It is used as the outermost element of SVG documents.
*/
export class Svg extends React.Component<React.PropsWithChildren<SVGProps>> {}
interface LineProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
x1: string | number;
x2: string | number;
y1: string | number;
y2: string | number;
}
/**
* The <Line /> element is used to create a line.
*/
export class Line extends React.Component<
React.PropsWithChildren<LineProps>
> {}
interface PolylineProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
points: string;
}
/**
* The <Polyline /> element is used to create any shape that consists of only straight lines (that is connected at several points).
*/
export class Polyline extends React.Component<
React.PropsWithChildren<PolylineProps>
> {}
interface PolygonProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
points: string;
}
/**
* The <Polygon /> element is used to create a graphic that contains at least three sides.
* Polygons are made of straight lines, and the shape is "closed" (all the lines connect up).
*/
export class Polygon extends React.Component<
React.PropsWithChildren<PolygonProps>
> {}
interface PathProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
d: string;
}
/**
* The <Path /> element is the most powerful element in the SVG library of basic shapes. It can be used to create lines, curves, arcs, and more.
*/
export class Path extends React.Component<
React.PropsWithChildren<PathProps>
> {}
interface RectProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
x?: string | number;
y?: string | number;
width: string | number;
height: string | number;
rx?: string | number;
ry?: string | number;
}
/**
* The <Rect /> element is used to create a rectangle and variations of a rectangle shape.
*/
export class Rect extends React.Component<
React.PropsWithChildren<RectProps>
> {}
interface CircleProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
cx?: string | number;
cy?: string | number;
r: string | number;
}
/**
* The <Circle /> element is used to create a circle.
*/
export class Circle extends React.Component<
React.PropsWithChildren<CircleProps>
> {}
interface EllipseProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
cx?: string | number;
cy?: string | number;
rx: string | number;
ry: string | number;
}
/**
* The <Ellipse /> element is used to create an ellipse.
* An ellipse is closely related to a circle. The difference is that an ellipse has an x and a y radius that differs from each other, while a circle has equal x and y radius.
*/
export class Ellipse extends React.Component<
React.PropsWithChildren<EllipseProps>
> {}
interface TspanProps extends SVGPresentationAttributes {
x?: string | number;
y?: string | number;
}
/**
* The <Tspan /> element defines a subtext within a <Text /> element or another <Tspan /> element.
* It allows for adjustment of the style and/or position of that subtext as needed.
*/
export class Tspan extends React.Component<
React.PropsWithChildren<TspanProps>
> {}
interface GProps extends SVGPresentationAttributes {
style?: Style;
}
/**
* The <G /> SVG element is a container used to group other SVG elements.
* Transformations applied to the <G /> element are performed on its child elements, and its attributes are inherited by its children.
*/
export class G extends React.Component<React.PropsWithChildren<GProps>> {}
interface StopProps {
offset: string | number;
stopColor: string;
stopOpacity?: string | number;
}
/**
* The SVG <Stop /> element defines a color and its position to use on a gradient. This element is always a child of a <LinearGradient /> or <RadialGradient /> element
*/
export class Stop extends React.Component<
React.PropsWithChildren<StopProps>
> {}
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
interface DefsProps {}
/**
* The <Defs /> element is used to store graphical objects that will be used at a later time. Objects created inside a <Defs /> element are not rendered directly. To display them you have to reference them
*/
export class Defs extends React.Component<
React.PropsWithChildren<DefsProps>
> {}
interface ClipPathProps {
id?: string;
}
/**
* The <ClipPath /> SVG element defines a clipping path, to be used by the clipPath property.
* A clipping path restricts the region to which paint can be applied. Conceptually, parts of the drawing that lie outside of the region bounded by the clipping path are not drawn.
*/
export class ClipPath extends React.Component<
React.PropsWithChildren<ClipPathProps>
> {}
interface MarkerProps {
id: string;
viewBox?: string;
refX?: string | number;
refY?: string | number;
markerWidth?: string | number;
markerHeight?: string | number;
orient?: 'auto' | 'auto-start-reverse' | number;
markerUnits?: 'strokeWidth' | 'userSpaceOnUse';
}
/**
* The <Marker /> SVG element defines a graphic used for drawing arrows or polymarkers on a given <Path />, <Line />, <Polyline />, or <Polygon /> element.
* Markers can be attached to shapes using the markerStart, markerMid, and markerEnd properties.
*/
export class Marker extends React.Component<
React.PropsWithChildren<MarkerProps>
> {}
interface LinearGradientProps {
id: string;
x1?: string | number;
x2?: string | number;
y1?: string | number;
y2?: string | number;
xlinkHref?: string;
gradientTransform?: string;
gradientUnits?: 'userSpaceOnUse' | 'objectBoundingBox';
}
/**
* The <LinearGradient /> element lets authors define linear gradients that can be applied to fill or stroke of graphical elements.
*/
export class LinearGradient extends React.Component<
React.PropsWithChildren<LinearGradientProps>
> {}
interface RadialGradientProps {
id: string;
cx?: string | number;
cy?: string | number;
r?: string | number;
fx?: string | number;
fy?: string | number;
xlinkHref?: string;
gradientTransform?: string;
gradientUnits?: 'userSpaceOnUse' | 'objectBoundingBox';
}
/**
* The <RadialGradient /> element lets authors define radial gradients that can be applied to fill or stroke of graphical elements.
*/
export class RadialGradient extends React.Component<
React.PropsWithChildren<RadialGradientProps>
> {}
interface BlobProviderParams {
blob: Blob | null;
url: string | null;
loading: boolean;
error: Error | null;
}
interface BlobProviderProps {
document: React.ReactElement<DocumentProps>;
children: (params: BlobProviderParams) => React.ReactNode;
}
/**
* Easy and declarative way of getting document's blob data without
* showing it on screen.
* @see https://react-pdf.org/advanced#on-the-fly-rendering
* @platform web
*/
export class BlobProvider extends React.Component<BlobProviderProps> {}
interface PDFViewerProps {
width?: number | string;
height?: number | string;
style?: Style | Style[];
className?: string;
children?: React.ReactElement<DocumentProps>;
innerRef?: React.Ref<HTMLIFrameElement>;
showToolbar?: boolean;
}
/**
* Iframe PDF viewer for client-side generated documents.
* @platform web
*/
export class PDFViewer extends React.Component<PDFViewerProps> {}
interface PDFDownloadLinkProps
extends Omit<
React.AnchorHTMLAttributes<HTMLAnchorElement>,
'href' | 'children'
> {
/** PDF filename. Alias for anchor tag `download` attribute. */
fileName?: string;
document: React.ReactElement<DocumentProps>;
children?: React.ReactNode | React.FC<BlobProviderParams>;
onClick?: React.AnchorHTMLAttributes<HTMLAnchorElement>['onClick'] &
((
event: React.MouseEvent<HTMLAnchorElement, MouseEvent>,
instance: UsePDFInstance,
) => void);
ref?: React.Ref<HTMLAnchorElement> | undefined;
}
/**
* Anchor tag to enable generate and download PDF documents on the fly.
* @see https://react-pdf.org/advanced#on-the-fly-rendering
* @platform web
*/
export class PDFDownloadLink extends React.Component<PDFDownloadLinkProps> {}
interface UsePDFInstance {
loading: boolean;
blob: Blob | null;
url: string | null;
error: string | null;
}
/**
* React hook for creating and updating a PDF document instance
* @platform web
*/
export function usePDF(options?: {
document?: React.ReactElement<DocumentProps>;
}): [
UsePDFInstance,
(newDocument: React.ReactElement<DocumentProps>) => void,
];
export const Font: FontStore;
export const StyleSheet: {
create: <T extends Styles>(styles: T) => T;
};
export const version: any;
export const PDFRenderer: any;
export const pdf: (initialValue?: React.ReactElement<DocumentProps>) => {
container: any;
isDirty: () => boolean;
toString: () => string;
toBlob: () => Promise<Blob>;
toBuffer: () => Promise<NodeJS.ReadableStream>;
on: (event: 'change', callback: () => void) => void;
updateContainer: (
document: React.ReactElement<any>,
callback?: () => void,
) => void;
removeListener: (event: 'change', callback: () => void) => void;
};
export const renderToStream: (
document: React.ReactElement<DocumentProps>,
) => Promise<NodeJS.ReadableStream>;
/**
* @deprecated use the `renderToBuffer` method
*/
export const renderToString: (
document: React.ReactElement<DocumentProps>,
) => Promise<string>;
export const renderToFile: (
document: React.ReactElement<DocumentProps>,
filePath: string,
callback?: (output: NodeJS.ReadableStream, _filePath: string) => any,
) => Promise<NodeJS.ReadableStream>;
const render: typeof renderToFile;
/**
* Render document into a nodejs buffer
* @platform node
*/
export const renderToBuffer: (
document: React.ReactElement<ReactPDF.DocumentProps>,
) => Promise<Buffer>;
}

View File

@@ -0,0 +1 @@
import*as e from"@react-pdf/primitives";export*from"@react-pdf/primitives";import r from"fs";import{Buffer as t}from"buffer";import o from"@react-pdf/font";import n from"@react-pdf/render";import i from"@react-pdf/pdfkit";import a from"@react-pdf/layout";import{upperFirst as s}from"@react-pdf/fns";import d from"@react-pdf/reconciler";const c=(e,r)=>{let{style:t,children:o,...n}=r;return{type:e,box:{},style:t||{},props:n||{},children:[]}},p=e=>({type:"TEXT_INSTANCE",value:e}),l=(e,r)=>{const t="TEXT"===e.type||"LINK"===e.type||"TSPAN"===e.type||"NOTE"===e.type;"TEXT_INSTANCE"!==r.type||t?e.children.push(r):console.warn(`Invalid '${r.value}' string child outside <Text> component`)},u=(e,r)=>{"ROOT"===e.type?e.document=r:l(e,r)},f=(e,r,t)=>{var o;const n=null===(o=e.children)||void 0===o?void 0:o.indexOf(t);void 0!==n&&-1!==n&&r&&e.children.splice(n,0,r)},m=(e,r)=>{var t;const o=null===(t=e.children)||void 0===t?void 0:t.indexOf(r);void 0!==o&&-1!==o&&e.children.splice(o,1)},v=(e,r)=>{var t;const o=null===(t=e.children)||void 0===t?void 0:t.indexOf(r);void 0!==o&&-1!==o&&e.children.splice(o,1)},w=(e,r,t)=>{e.value=t},y=(e,r,t,o,n)=>{const{style:i,...a}=n;e.props=a,e.style=i},h=e=>{let{onChange:r=(()=>{})}=e;return d({appendChild:l,appendChildToContainer:u,commitTextUpdate:w,commitUpdate:y,createInstance:c,createTextInstance:p,insertBefore:f,removeChild:m,removeChildFromContainer:v,resetAfterCommit:r})};var T={version:"4.5.1"};const{version:P}=T,g=new o;let b;const D={},S=e=>{const r={type:"ROOT",document:null};b=b||h({onChange:()=>{var e;const r=(null===(e=D.change)||void 0===e?void 0:e.slice())||[];for(let e=0;e<r.length;e+=1)r[e]()}});const t=b.createContainer(r),o=(e,r)=>{b.updateContainer(e,t,null,r)};e&&o(e);const d=async function(e){void 0===e&&(e=!0);const t=r.document.props||{},{pdfVersion:o,language:d,pageLayout:c,pageMode:p,title:l,author:u,subject:f,keywords:m,creator:v="react-pdf",producer:w="react-pdf",creationDate:y=new Date,modificationDate:h,ownerPassword:T,userPassword:P,permissions:b}=t,D=new i({compress:e,pdfVersion:o,lang:d,displayTitle:!0,autoFirstPage:!1,ownerPassword:T,userPassword:P,permissions:b,pageLayout:c,info:(S={Title:l,Author:u,Subject:f,Keywords:m,Creator:v,Producer:w,CreationDate:y,ModificationDate:h},Object.fromEntries(Object.entries(S).filter((e=>{let[,r]=e;return void 0!==r}))))});var S;p&&(D._root.data.PageMode=s(p));const _=await a(r.document,g);return{layout:_,fileStream:n(D,_)}},c=function(e){void 0===e&&(e={}),r.document.props.onRender&&r.document.props.onRender(e)};return{on:(e,r)=>{D[e]||(D[e]=[]),D[e].push(r)},container:r,toBlob:async()=>{const e=[],{layout:r,fileStream:t}=await d();return new Promise(((o,n)=>{t.on("data",(r=>{e.push(r instanceof Uint8Array?r:new Uint8Array(r))})),t.on("end",(()=>{try{const t=new Blob(e,{type:"application/pdf"});c({blob:t,_INTERNAL__LAYOUT__DATA_:r}),o(t)}catch(e){n(e)}}))}))},toBuffer:async()=>{const{layout:e,fileStream:r}=await d();return c({_INTERNAL__LAYOUT__DATA_:e}),r},toString:async()=>{"development"===process.env.NODE_ENV&&console.warn("`toString` is deprecated and will be removed in next major release");let e="";const{fileStream:r}=await d(!1);return new Promise(((t,o)=>{try{r.on("data",(r=>{e+=r})),r.on("end",(()=>{c(),t(e)}))}catch(e){o(e)}}))},removeListener:(e,r)=>{if(!D[e])return;const t=D[e].indexOf(r);t>-1&&D[e].splice(t,1)},updateContainer:o}},_=g,A={create:e=>e},C=async e=>{const r=S(e);return await r.toBuffer()},N=async(e,t,o)=>{const n=await C(e),i=r.createWriteStream(t);return n.pipe(i),new Promise(((e,r)=>{i.on("finish",(()=>{o&&o(n,t),e(n)})),i.on("error",r)}))},O=e=>C(e).then((e=>new Promise(((r,o)=>{const n=[];e.on("data",(e=>n.push(e))),e.on("end",(()=>r(t.concat(n)))),e.on("error",(e=>o(e)))})))),E=e=>("development"===process.env.NODE_ENV&&console.warn("`renderToString` is deprecated and will be removed in next major release, use `renderToBuffer` instead"),O(e).then((e=>e.toString()))),x=e=>{throw new Error(`${e} is a web specific API. You're either using this component on Node, or your bundler is not loading react-pdf from the appropriate web build.`)},F=()=>{x("usePDF")},L=()=>{x("PDFViewer")},I=()=>{x("PDFDownloadLink")},B=()=>{x("BlobProvider")},j=N;var R={pdf:S,Font:_,version:P,StyleSheet:A,usePDF:F,PDFViewer:L,BlobProvider:B,PDFDownloadLink:I,renderToStream:C,renderToString:E,renderToFile:N,render:j,...e};export{B as BlobProvider,_ as Font,I as PDFDownloadLink,L as PDFViewer,A as StyleSheet,h as createRenderer,R as default,S as pdf,j as render,O as renderToBuffer,N as renderToFile,C as renderToStream,E as renderToString,F as usePDF,P as version};

View File

@@ -0,0 +1,67 @@
{
"name": "@react-pdf/renderer",
"version": "4.5.1",
"license": "MIT",
"description": "Create PDF files on the browser and server",
"author": "Diego Muracciole <diegomuracciole@gmail.com>",
"homepage": "https://github.com/diegomura/react-pdf#readme",
"type": "module",
"main": "./lib/react-pdf.js",
"browser": {
"./lib/react-pdf.js": "./lib/react-pdf.browser.js"
},
"repository": {
"type": "git",
"url": "https://github.com/diegomura/react-pdf.git",
"directory": "packages/renderer"
},
"scripts": {
"build": "rimraf ./lib && rollup -c",
"watch": "rimraf ./lib && rollup -c -w",
"size": "size-limit",
"lint": "eslint src",
"test": "vitest && vitest --config vitest.browser.config.js"
},
"dependencies": {
"@babel/runtime": "^7.20.13",
"@react-pdf/fns": "3.1.3",
"@react-pdf/font": "^4.0.8",
"@react-pdf/layout": "^4.6.1",
"@react-pdf/pdfkit": "^5.1.1",
"@react-pdf/primitives": "^4.3.0",
"@react-pdf/reconciler": "^2.0.0",
"@react-pdf/render": "^4.5.1",
"@react-pdf/types": "^2.11.1",
"events": "^3.3.0",
"object-assign": "^4.1.1",
"prop-types": "^15.6.2",
"queue": "^6.0.1"
},
"peerDependencies": {
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
},
"lint-staged": {
"*.js": [
"yarn lint",
"prettier --write"
]
},
"files": [
"lib",
"index.d.ts"
],
"collective": {
"type": "opencollective",
"url": "https://opencollective.com/react-pdf",
"logo": "https://opencollective.com/opencollective/logo.txt"
},
"devDependencies": {
"@size-limit/preset-big-lib": "^11.0.1",
"assert": "^2.0.0",
"browserify-zlib": "^0.2.0",
"buffer": "^6.0.3",
"process": "^0.11.10",
"size-limit": "^11.0.1",
"util": "^0.12.4"
}
}

View File

@@ -0,0 +1 @@
{"type": "commonjs"}

View File

@@ -0,0 +1,340 @@
{
"version": 4,
"routes": {
"/": {
"experimentalBypassFor": [
{
"type": "header",
"key": "next-action"
},
{
"type": "header",
"key": "content-type",
"value": "multipart/form-data;.*"
}
],
"initialRevalidateSeconds": false,
"srcRoute": "/",
"dataRoute": "/index.rsc",
"allowHeader": [
"host",
"x-matched-path",
"x-prerender-revalidate",
"x-prerender-revalidate-if-generated",
"x-next-revalidated-tags",
"x-next-revalidate-tag-token"
]
},
"/_global-error": {
"experimentalBypassFor": [
{
"type": "header",
"key": "next-action"
},
{
"type": "header",
"key": "content-type",
"value": "multipart/form-data;.*"
}
],
"initialRevalidateSeconds": false,
"srcRoute": "/_global-error",
"dataRoute": "/_global-error.rsc",
"allowHeader": [
"host",
"x-matched-path",
"x-prerender-revalidate",
"x-prerender-revalidate-if-generated",
"x-next-revalidated-tags",
"x-next-revalidate-tag-token"
]
},
"/_not-found": {
"initialStatus": 404,
"experimentalBypassFor": [
{
"type": "header",
"key": "next-action"
},
{
"type": "header",
"key": "content-type",
"value": "multipart/form-data;.*"
}
],
"initialRevalidateSeconds": false,
"srcRoute": "/_not-found",
"dataRoute": "/_not-found.rsc",
"allowHeader": [
"host",
"x-matched-path",
"x-prerender-revalidate",
"x-prerender-revalidate-if-generated",
"x-next-revalidated-tags",
"x-next-revalidate-tag-token"
]
},
"/admin/users": {
"experimentalBypassFor": [
{
"type": "header",
"key": "next-action"
},
{
"type": "header",
"key": "content-type",
"value": "multipart/form-data;.*"
}
],
"initialRevalidateSeconds": false,
"srcRoute": "/admin/users",
"dataRoute": "/admin/users.rsc",
"allowHeader": [
"host",
"x-matched-path",
"x-prerender-revalidate",
"x-prerender-revalidate-if-generated",
"x-next-revalidated-tags",
"x-next-revalidate-tag-token"
]
},
"/auth/forgot-password": {
"experimentalBypassFor": [
{
"type": "header",
"key": "next-action"
},
{
"type": "header",
"key": "content-type",
"value": "multipart/form-data;.*"
}
],
"initialRevalidateSeconds": false,
"srcRoute": "/auth/forgot-password",
"dataRoute": "/auth/forgot-password.rsc",
"allowHeader": [
"host",
"x-matched-path",
"x-prerender-revalidate",
"x-prerender-revalidate-if-generated",
"x-next-revalidated-tags",
"x-next-revalidate-tag-token"
]
},
"/auth/login": {
"experimentalBypassFor": [
{
"type": "header",
"key": "next-action"
},
{
"type": "header",
"key": "content-type",
"value": "multipart/form-data;.*"
}
],
"initialRevalidateSeconds": false,
"srcRoute": "/auth/login",
"dataRoute": "/auth/login.rsc",
"allowHeader": [
"host",
"x-matched-path",
"x-prerender-revalidate",
"x-prerender-revalidate-if-generated",
"x-next-revalidated-tags",
"x-next-revalidate-tag-token"
]
},
"/auth/sign-up": {
"experimentalBypassFor": [
{
"type": "header",
"key": "next-action"
},
{
"type": "header",
"key": "content-type",
"value": "multipart/form-data;.*"
}
],
"initialRevalidateSeconds": false,
"srcRoute": "/auth/sign-up",
"dataRoute": "/auth/sign-up.rsc",
"allowHeader": [
"host",
"x-matched-path",
"x-prerender-revalidate",
"x-prerender-revalidate-if-generated",
"x-next-revalidated-tags",
"x-next-revalidate-tag-token"
]
},
"/auth/sign-up-success": {
"experimentalBypassFor": [
{
"type": "header",
"key": "next-action"
},
{
"type": "header",
"key": "content-type",
"value": "multipart/form-data;.*"
}
],
"initialRevalidateSeconds": false,
"srcRoute": "/auth/sign-up-success",
"dataRoute": "/auth/sign-up-success.rsc",
"allowHeader": [
"host",
"x-matched-path",
"x-prerender-revalidate",
"x-prerender-revalidate-if-generated",
"x-next-revalidated-tags",
"x-next-revalidate-tag-token"
]
},
"/auth/update-password": {
"experimentalBypassFor": [
{
"type": "header",
"key": "next-action"
},
{
"type": "header",
"key": "content-type",
"value": "multipart/form-data;.*"
}
],
"initialRevalidateSeconds": false,
"srcRoute": "/auth/update-password",
"dataRoute": "/auth/update-password.rsc",
"allowHeader": [
"host",
"x-matched-path",
"x-prerender-revalidate",
"x-prerender-revalidate-if-generated",
"x-next-revalidated-tags",
"x-next-revalidate-tag-token"
]
},
"/favicon.ico": {
"initialHeaders": {
"cache-control": "public, max-age=0, must-revalidate",
"content-type": "image/x-icon",
"x-next-cache-tags": "_N_T_/layout,_N_T_/favicon.ico/layout,_N_T_/favicon.ico/route,_N_T_/favicon.ico"
},
"experimentalBypassFor": [
{
"type": "header",
"key": "next-action"
},
{
"type": "header",
"key": "content-type",
"value": "multipart/form-data;.*"
}
],
"initialRevalidateSeconds": false,
"srcRoute": "/favicon.ico",
"dataRoute": null,
"allowHeader": [
"host",
"x-matched-path",
"x-prerender-revalidate",
"x-prerender-revalidate-if-generated",
"x-next-revalidated-tags",
"x-next-revalidate-tag-token"
]
},
"/my-customers/new": {
"experimentalBypassFor": [
{
"type": "header",
"key": "next-action"
},
{
"type": "header",
"key": "content-type",
"value": "multipart/form-data;.*"
}
],
"initialRevalidateSeconds": false,
"srcRoute": "/my-customers/new",
"dataRoute": "/my-customers/new.rsc",
"allowHeader": [
"host",
"x-matched-path",
"x-prerender-revalidate",
"x-prerender-revalidate-if-generated",
"x-next-revalidated-tags",
"x-next-revalidate-tag-token"
]
},
"/opengraph-image.png": {
"initialHeaders": {
"cache-control": "public, max-age=0, must-revalidate",
"content-type": "image/png",
"x-next-cache-tags": "_N_T_/layout,_N_T_/opengraph-image.png/layout,_N_T_/opengraph-image.png/route,_N_T_/opengraph-image.png"
},
"experimentalBypassFor": [
{
"type": "header",
"key": "next-action"
},
{
"type": "header",
"key": "content-type",
"value": "multipart/form-data;.*"
}
],
"initialRevalidateSeconds": false,
"srcRoute": "/opengraph-image.png",
"dataRoute": null,
"allowHeader": [
"host",
"x-matched-path",
"x-prerender-revalidate",
"x-prerender-revalidate-if-generated",
"x-next-revalidated-tags",
"x-next-revalidate-tag-token"
]
},
"/twitter-image.png": {
"initialHeaders": {
"cache-control": "public, max-age=0, must-revalidate",
"content-type": "image/png",
"x-next-cache-tags": "_N_T_/layout,_N_T_/twitter-image.png/layout,_N_T_/twitter-image.png/route,_N_T_/twitter-image.png"
},
"experimentalBypassFor": [
{
"type": "header",
"key": "next-action"
},
{
"type": "header",
"key": "content-type",
"value": "multipart/form-data;.*"
}
],
"initialRevalidateSeconds": false,
"srcRoute": "/twitter-image.png",
"dataRoute": null,
"allowHeader": [
"host",
"x-matched-path",
"x-prerender-revalidate",
"x-prerender-revalidate-if-generated",
"x-next-revalidated-tags",
"x-next-revalidate-tag-token"
]
}
},
"dynamicRoutes": {},
"notFoundRoutes": [],
"preview": {
"previewModeId": "448d32298db3b0c38793886a3692c8c2",
"previewModeSigningKey": "c5cb172f94d84767588967a86044c9ee49921a9b2179519d52aa8aceecb0cd6f",
"previewModeEncryptionKey": "8a7d538464b6beea4e3323e6d9d86f4b70ecb99e19daffca604a9088baa07476"
}
}

View File

@@ -0,0 +1,332 @@
self.__SERVER_FILES_MANIFEST={
"version": 1,
"config": {
"env": {},
"webpack": null,
"typescript": {
"ignoreBuildErrors": false
},
"typedRoutes": false,
"distDir": ".next",
"cleanDistDir": true,
"assetPrefix": "",
"cacheMaxMemorySize": 52428800,
"configOrigin": "next.config.ts",
"useFileSystemPublicRoutes": true,
"generateEtags": true,
"pageExtensions": [
"tsx",
"ts",
"jsx",
"js"
],
"poweredByHeader": true,
"compress": true,
"images": {
"deviceSizes": [
640,
750,
828,
1080,
1200,
1920,
2048,
3840
],
"imageSizes": [
32,
48,
64,
96,
128,
256,
384
],
"path": "/_next/image",
"loader": "default",
"loaderFile": "",
"domains": [],
"disableStaticImages": false,
"minimumCacheTTL": 14400,
"formats": [
"image/webp"
],
"maximumRedirects": 3,
"maximumResponseBody": 50000000,
"dangerouslyAllowLocalIP": false,
"dangerouslyAllowSVG": false,
"contentSecurityPolicy": "script-src 'none'; frame-src 'none'; sandbox;",
"contentDispositionType": "attachment",
"localPatterns": [
{
"pathname": "**",
"search": ""
}
],
"remotePatterns": [],
"qualities": [
75
],
"unoptimized": false,
"customCacheHandler": false
},
"devIndicators": {
"position": "bottom-left"
},
"onDemandEntries": {
"maxInactiveAge": 60000,
"pagesBufferLength": 5
},
"basePath": "",
"sassOptions": {},
"trailingSlash": false,
"i18n": null,
"productionBrowserSourceMaps": false,
"excludeDefaultMomentLocales": true,
"reactProductionProfiling": false,
"reactStrictMode": null,
"reactMaxHeadersLength": 6000,
"httpAgentOptions": {
"keepAlive": true
},
"logging": {
"serverFunctions": true,
"browserToTerminal": "warn"
},
"compiler": {},
"expireTime": 31536000,
"staticPageGenerationTimeout": 60,
"modularizeImports": {
"@mui/icons-material": {
"transform": "@mui/icons-material/{{member}}"
},
"lodash": {
"transform": "lodash/{{member}}"
}
},
"outputFileTracingRoot": "C:\\source\\webshop\\shop",
"cacheComponents": false,
"cacheLife": {
"default": {
"stale": 300,
"revalidate": 900,
"expire": 4294967294
},
"seconds": {
"stale": 30,
"revalidate": 1,
"expire": 60
},
"minutes": {
"stale": 300,
"revalidate": 60,
"expire": 3600
},
"hours": {
"stale": 300,
"revalidate": 3600,
"expire": 86400
},
"days": {
"stale": 300,
"revalidate": 86400,
"expire": 604800
},
"weeks": {
"stale": 300,
"revalidate": 604800,
"expire": 2592000
},
"max": {
"stale": 300,
"revalidate": 2592000,
"expire": 31536000
}
},
"cacheHandlers": {},
"experimental": {
"appNewScrollHandler": false,
"useSkewCookie": false,
"cssChunking": true,
"multiZoneDraftMode": false,
"appNavFailHandling": false,
"prerenderEarlyExit": true,
"serverMinification": true,
"linkNoTouchStart": false,
"caseSensitiveRoutes": false,
"cachedNavigations": false,
"partialFallbacks": false,
"dynamicOnHover": false,
"varyParams": false,
"prefetchInlining": false,
"preloadEntriesOnStart": true,
"clientRouterFilter": true,
"clientRouterFilterRedirects": false,
"fetchCacheKeyPrefix": "",
"proxyPrefetch": "flexible",
"optimisticClientCache": true,
"manualClientBasePath": false,
"cpus": 15,
"memoryBasedWorkersCount": false,
"imgOptConcurrency": null,
"imgOptTimeoutInSeconds": 7,
"imgOptMaxInputPixels": 268402689,
"imgOptSequentialRead": null,
"imgOptSkipMetadata": null,
"isrFlushToDisk": true,
"workerThreads": false,
"optimizeCss": false,
"nextScriptWorkers": false,
"scrollRestoration": false,
"externalDir": false,
"disableOptimizedLoading": false,
"gzipSize": true,
"craCompat": false,
"esmExternals": true,
"fullySpecified": false,
"swcTraceProfiling": false,
"forceSwcTransforms": false,
"largePageDataBytes": 128000,
"typedEnv": false,
"parallelServerCompiles": false,
"parallelServerBuildTraces": false,
"ppr": false,
"authInterrupts": false,
"webpackMemoryOptimizations": false,
"optimizeServerReact": true,
"strictRouteTypes": false,
"viewTransition": false,
"removeUncaughtErrorAndRejectionListeners": false,
"validateRSCRequestHeaders": false,
"staleTimes": {
"dynamic": 0,
"static": 300
},
"reactDebugChannel": true,
"serverComponentsHmrCache": true,
"staticGenerationMaxConcurrency": 8,
"staticGenerationMinPagesPerWorker": 25,
"transitionIndicator": false,
"gestureTransition": false,
"inlineCss": false,
"useCache": false,
"globalNotFound": false,
"browserDebugInfoInTerminal": "warn",
"lockDistDir": true,
"proxyClientMaxBodySize": 10485760,
"hideLogsAfterAbort": false,
"mcpServer": true,
"turbopackFileSystemCacheForDev": true,
"turbopackFileSystemCacheForBuild": false,
"turbopackInferModuleSideEffects": true,
"turbopackPluginRuntimeStrategy": "childProcesses",
"optimizePackageImports": [
"lucide-react",
"date-fns",
"lodash-es",
"ramda",
"antd",
"react-bootstrap",
"ahooks",
"@ant-design/icons",
"@headlessui/react",
"@headlessui-float/react",
"@heroicons/react/20/solid",
"@heroicons/react/24/solid",
"@heroicons/react/24/outline",
"@visx/visx",
"@tremor/react",
"rxjs",
"@mui/material",
"@mui/icons-material",
"recharts",
"react-use",
"effect",
"@effect/schema",
"@effect/platform",
"@effect/platform-node",
"@effect/platform-browser",
"@effect/platform-bun",
"@effect/sql",
"@effect/sql-mssql",
"@effect/sql-mysql2",
"@effect/sql-pg",
"@effect/sql-sqlite-node",
"@effect/sql-sqlite-bun",
"@effect/sql-sqlite-wasm",
"@effect/sql-sqlite-react-native",
"@effect/rpc",
"@effect/rpc-http",
"@effect/typeclass",
"@effect/experimental",
"@effect/opentelemetry",
"@material-ui/core",
"@material-ui/icons",
"@tabler/icons-react",
"mui-core",
"react-icons/ai",
"react-icons/bi",
"react-icons/bs",
"react-icons/cg",
"react-icons/ci",
"react-icons/di",
"react-icons/fa",
"react-icons/fa6",
"react-icons/fc",
"react-icons/fi",
"react-icons/gi",
"react-icons/go",
"react-icons/gr",
"react-icons/hi",
"react-icons/hi2",
"react-icons/im",
"react-icons/io",
"react-icons/io5",
"react-icons/lia",
"react-icons/lib",
"react-icons/lu",
"react-icons/md",
"react-icons/pi",
"react-icons/ri",
"react-icons/rx",
"react-icons/si",
"react-icons/sl",
"react-icons/tb",
"react-icons/tfi",
"react-icons/ti",
"react-icons/vsc",
"react-icons/wi"
],
"trustHostHeader": false,
"isExperimentalCompile": false
},
"htmlLimitedBots": "[\\w-]+-Google|Google-[\\w-]+|Chrome-Lighthouse|Slurp|DuckDuckBot|baiduspider|yandex|sogou|bitlybot|tumblr|vkShare|quora link preview|redditbot|ia_archiver|Bingbot|BingPreview|applebot|facebookexternalhit|facebookcatalog|Twitterbot|LinkedInBot|Slackbot|Discordbot|WhatsApp|SkypeUriPreview|Yeti|googleweblight",
"bundlePagesRouterDependencies": false,
"configFileName": "next.config.ts",
"turbopack": {
"root": "C:\\source\\webshop\\shop"
},
"distDirRoot": ".next"
},
"appDir": "C:\\source\\webshop\\shop",
"relativeAppDir": "",
"files": [
".next\\routes-manifest.json",
".next\\server\\pages-manifest.json",
".next\\build-manifest.json",
".next\\prerender-manifest.json",
".next\\server\\functions-config-manifest.json",
".next\\server\\middleware-manifest.json",
".next\\server\\middleware-build-manifest.js",
".next\\server\\app-paths-manifest.json",
".next\\app-path-routes-manifest.json",
".next\\server\\server-reference-manifest.js",
".next\\server\\server-reference-manifest.json",
".next\\server\\prefetch-hints.json",
".next\\BUILD_ID",
".next\\server\\next-font-manifest.js",
".next\\server\\next-font-manifest.json",
".next\\required-server-files.json"
],
"ignore": []
}

View File

@@ -0,0 +1,332 @@
{
"version": 1,
"config": {
"env": {},
"webpack": null,
"typescript": {
"ignoreBuildErrors": false
},
"typedRoutes": false,
"distDir": ".next",
"cleanDistDir": true,
"assetPrefix": "",
"cacheMaxMemorySize": 52428800,
"configOrigin": "next.config.ts",
"useFileSystemPublicRoutes": true,
"generateEtags": true,
"pageExtensions": [
"tsx",
"ts",
"jsx",
"js"
],
"poweredByHeader": true,
"compress": true,
"images": {
"deviceSizes": [
640,
750,
828,
1080,
1200,
1920,
2048,
3840
],
"imageSizes": [
32,
48,
64,
96,
128,
256,
384
],
"path": "/_next/image",
"loader": "default",
"loaderFile": "",
"domains": [],
"disableStaticImages": false,
"minimumCacheTTL": 14400,
"formats": [
"image/webp"
],
"maximumRedirects": 3,
"maximumResponseBody": 50000000,
"dangerouslyAllowLocalIP": false,
"dangerouslyAllowSVG": false,
"contentSecurityPolicy": "script-src 'none'; frame-src 'none'; sandbox;",
"contentDispositionType": "attachment",
"localPatterns": [
{
"pathname": "**",
"search": ""
}
],
"remotePatterns": [],
"qualities": [
75
],
"unoptimized": false,
"customCacheHandler": false
},
"devIndicators": {
"position": "bottom-left"
},
"onDemandEntries": {
"maxInactiveAge": 60000,
"pagesBufferLength": 5
},
"basePath": "",
"sassOptions": {},
"trailingSlash": false,
"i18n": null,
"productionBrowserSourceMaps": false,
"excludeDefaultMomentLocales": true,
"reactProductionProfiling": false,
"reactStrictMode": null,
"reactMaxHeadersLength": 6000,
"httpAgentOptions": {
"keepAlive": true
},
"logging": {
"serverFunctions": true,
"browserToTerminal": "warn"
},
"compiler": {},
"expireTime": 31536000,
"staticPageGenerationTimeout": 60,
"modularizeImports": {
"@mui/icons-material": {
"transform": "@mui/icons-material/{{member}}"
},
"lodash": {
"transform": "lodash/{{member}}"
}
},
"outputFileTracingRoot": "C:\\source\\webshop\\shop",
"cacheComponents": false,
"cacheLife": {
"default": {
"stale": 300,
"revalidate": 900,
"expire": 4294967294
},
"seconds": {
"stale": 30,
"revalidate": 1,
"expire": 60
},
"minutes": {
"stale": 300,
"revalidate": 60,
"expire": 3600
},
"hours": {
"stale": 300,
"revalidate": 3600,
"expire": 86400
},
"days": {
"stale": 300,
"revalidate": 86400,
"expire": 604800
},
"weeks": {
"stale": 300,
"revalidate": 604800,
"expire": 2592000
},
"max": {
"stale": 300,
"revalidate": 2592000,
"expire": 31536000
}
},
"cacheHandlers": {},
"experimental": {
"appNewScrollHandler": false,
"useSkewCookie": false,
"cssChunking": true,
"multiZoneDraftMode": false,
"appNavFailHandling": false,
"prerenderEarlyExit": true,
"serverMinification": true,
"linkNoTouchStart": false,
"caseSensitiveRoutes": false,
"cachedNavigations": false,
"partialFallbacks": false,
"dynamicOnHover": false,
"varyParams": false,
"prefetchInlining": false,
"preloadEntriesOnStart": true,
"clientRouterFilter": true,
"clientRouterFilterRedirects": false,
"fetchCacheKeyPrefix": "",
"proxyPrefetch": "flexible",
"optimisticClientCache": true,
"manualClientBasePath": false,
"cpus": 15,
"memoryBasedWorkersCount": false,
"imgOptConcurrency": null,
"imgOptTimeoutInSeconds": 7,
"imgOptMaxInputPixels": 268402689,
"imgOptSequentialRead": null,
"imgOptSkipMetadata": null,
"isrFlushToDisk": true,
"workerThreads": false,
"optimizeCss": false,
"nextScriptWorkers": false,
"scrollRestoration": false,
"externalDir": false,
"disableOptimizedLoading": false,
"gzipSize": true,
"craCompat": false,
"esmExternals": true,
"fullySpecified": false,
"swcTraceProfiling": false,
"forceSwcTransforms": false,
"largePageDataBytes": 128000,
"typedEnv": false,
"parallelServerCompiles": false,
"parallelServerBuildTraces": false,
"ppr": false,
"authInterrupts": false,
"webpackMemoryOptimizations": false,
"optimizeServerReact": true,
"strictRouteTypes": false,
"viewTransition": false,
"removeUncaughtErrorAndRejectionListeners": false,
"validateRSCRequestHeaders": false,
"staleTimes": {
"dynamic": 0,
"static": 300
},
"reactDebugChannel": true,
"serverComponentsHmrCache": true,
"staticGenerationMaxConcurrency": 8,
"staticGenerationMinPagesPerWorker": 25,
"transitionIndicator": false,
"gestureTransition": false,
"inlineCss": false,
"useCache": false,
"globalNotFound": false,
"browserDebugInfoInTerminal": "warn",
"lockDistDir": true,
"proxyClientMaxBodySize": 10485760,
"hideLogsAfterAbort": false,
"mcpServer": true,
"turbopackFileSystemCacheForDev": true,
"turbopackFileSystemCacheForBuild": false,
"turbopackInferModuleSideEffects": true,
"turbopackPluginRuntimeStrategy": "childProcesses",
"optimizePackageImports": [
"lucide-react",
"date-fns",
"lodash-es",
"ramda",
"antd",
"react-bootstrap",
"ahooks",
"@ant-design/icons",
"@headlessui/react",
"@headlessui-float/react",
"@heroicons/react/20/solid",
"@heroicons/react/24/solid",
"@heroicons/react/24/outline",
"@visx/visx",
"@tremor/react",
"rxjs",
"@mui/material",
"@mui/icons-material",
"recharts",
"react-use",
"effect",
"@effect/schema",
"@effect/platform",
"@effect/platform-node",
"@effect/platform-browser",
"@effect/platform-bun",
"@effect/sql",
"@effect/sql-mssql",
"@effect/sql-mysql2",
"@effect/sql-pg",
"@effect/sql-sqlite-node",
"@effect/sql-sqlite-bun",
"@effect/sql-sqlite-wasm",
"@effect/sql-sqlite-react-native",
"@effect/rpc",
"@effect/rpc-http",
"@effect/typeclass",
"@effect/experimental",
"@effect/opentelemetry",
"@material-ui/core",
"@material-ui/icons",
"@tabler/icons-react",
"mui-core",
"react-icons/ai",
"react-icons/bi",
"react-icons/bs",
"react-icons/cg",
"react-icons/ci",
"react-icons/di",
"react-icons/fa",
"react-icons/fa6",
"react-icons/fc",
"react-icons/fi",
"react-icons/gi",
"react-icons/go",
"react-icons/gr",
"react-icons/hi",
"react-icons/hi2",
"react-icons/im",
"react-icons/io",
"react-icons/io5",
"react-icons/lia",
"react-icons/lib",
"react-icons/lu",
"react-icons/md",
"react-icons/pi",
"react-icons/ri",
"react-icons/rx",
"react-icons/si",
"react-icons/sl",
"react-icons/tb",
"react-icons/tfi",
"react-icons/ti",
"react-icons/vsc",
"react-icons/wi"
],
"trustHostHeader": false,
"isExperimentalCompile": false
},
"htmlLimitedBots": "[\\w-]+-Google|Google-[\\w-]+|Chrome-Lighthouse|Slurp|DuckDuckBot|baiduspider|yandex|sogou|bitlybot|tumblr|vkShare|quora link preview|redditbot|ia_archiver|Bingbot|BingPreview|applebot|facebookexternalhit|facebookcatalog|Twitterbot|LinkedInBot|Slackbot|Discordbot|WhatsApp|SkypeUriPreview|Yeti|googleweblight",
"bundlePagesRouterDependencies": false,
"configFileName": "next.config.ts",
"turbopack": {
"root": "C:\\source\\webshop\\shop"
},
"distDirRoot": ".next"
},
"appDir": "C:\\source\\webshop\\shop",
"relativeAppDir": "",
"files": [
".next\\routes-manifest.json",
".next\\server\\pages-manifest.json",
".next\\build-manifest.json",
".next\\prerender-manifest.json",
".next\\server\\functions-config-manifest.json",
".next\\server\\middleware-manifest.json",
".next\\server\\middleware-build-manifest.js",
".next\\server\\app-paths-manifest.json",
".next\\app-path-routes-manifest.json",
".next\\server\\server-reference-manifest.js",
".next\\server\\server-reference-manifest.json",
".next\\server\\prefetch-hints.json",
".next\\BUILD_ID",
".next\\server\\next-font-manifest.js",
".next\\server\\next-font-manifest.json",
".next\\required-server-files.json"
],
"ignore": []
}

View File

@@ -0,0 +1,204 @@
{
"version": 3,
"pages404": true,
"appType": "app",
"caseSensitive": false,
"basePath": "",
"redirects": [
{
"source": "/:path+/",
"destination": "/:path+",
"internal": true,
"priority": true,
"statusCode": 308,
"regex": "^(?:/((?:[^/]+?)(?:/(?:[^/]+?))*))/$"
}
],
"headers": [],
"onMatchHeaders": [],
"rewrites": {
"beforeFiles": [],
"afterFiles": [],
"fallback": []
},
"dynamicRoutes": [
{
"page": "/my-customers/[id]",
"regex": "^/my\\-customers/([^/]+?)(?:/)?$",
"routeKeys": {
"nxtPid": "nxtPid"
},
"namedRegex": "^/my\\-customers/(?<nxtPid>[^/]+?)(?:/)?$"
}
],
"staticRoutes": [
{
"page": "/",
"regex": "^/(?:/)?$",
"routeKeys": {},
"namedRegex": "^/(?:/)?$"
},
{
"page": "/_global-error",
"regex": "^/_global\\-error(?:/)?$",
"routeKeys": {},
"namedRegex": "^/_global\\-error(?:/)?$"
},
{
"page": "/_not-found",
"regex": "^/_not\\-found(?:/)?$",
"routeKeys": {},
"namedRegex": "^/_not\\-found(?:/)?$"
},
{
"page": "/admin",
"regex": "^/admin(?:/)?$",
"routeKeys": {},
"namedRegex": "^/admin(?:/)?$"
},
{
"page": "/admin/categories",
"regex": "^/admin/categories(?:/)?$",
"routeKeys": {},
"namedRegex": "^/admin/categories(?:/)?$"
},
{
"page": "/admin/orders",
"regex": "^/admin/orders(?:/)?$",
"routeKeys": {},
"namedRegex": "^/admin/orders(?:/)?$"
},
{
"page": "/admin/products",
"regex": "^/admin/products(?:/)?$",
"routeKeys": {},
"namedRegex": "^/admin/products(?:/)?$"
},
{
"page": "/admin/users",
"regex": "^/admin/users(?:/)?$",
"routeKeys": {},
"namedRegex": "^/admin/users(?:/)?$"
},
{
"page": "/api/admin/recent-orders",
"regex": "^/api/admin/recent\\-orders(?:/)?$",
"routeKeys": {},
"namedRegex": "^/api/admin/recent\\-orders(?:/)?$"
},
{
"page": "/auth/confirm",
"regex": "^/auth/confirm(?:/)?$",
"routeKeys": {},
"namedRegex": "^/auth/confirm(?:/)?$"
},
{
"page": "/auth/error",
"regex": "^/auth/error(?:/)?$",
"routeKeys": {},
"namedRegex": "^/auth/error(?:/)?$"
},
{
"page": "/auth/forgot-password",
"regex": "^/auth/forgot\\-password(?:/)?$",
"routeKeys": {},
"namedRegex": "^/auth/forgot\\-password(?:/)?$"
},
{
"page": "/auth/login",
"regex": "^/auth/login(?:/)?$",
"routeKeys": {},
"namedRegex": "^/auth/login(?:/)?$"
},
{
"page": "/auth/sign-up",
"regex": "^/auth/sign\\-up(?:/)?$",
"routeKeys": {},
"namedRegex": "^/auth/sign\\-up(?:/)?$"
},
{
"page": "/auth/sign-up-success",
"regex": "^/auth/sign\\-up\\-success(?:/)?$",
"routeKeys": {},
"namedRegex": "^/auth/sign\\-up\\-success(?:/)?$"
},
{
"page": "/auth/update-password",
"regex": "^/auth/update\\-password(?:/)?$",
"routeKeys": {},
"namedRegex": "^/auth/update\\-password(?:/)?$"
},
{
"page": "/favicon.ico",
"regex": "^/favicon\\.ico(?:/)?$",
"routeKeys": {},
"namedRegex": "^/favicon\\.ico(?:/)?$"
},
{
"page": "/my-customers",
"regex": "^/my\\-customers(?:/)?$",
"routeKeys": {},
"namedRegex": "^/my\\-customers(?:/)?$"
},
{
"page": "/my-customers/new",
"regex": "^/my\\-customers/new(?:/)?$",
"routeKeys": {},
"namedRegex": "^/my\\-customers/new(?:/)?$"
},
{
"page": "/my-orders",
"regex": "^/my\\-orders(?:/)?$",
"routeKeys": {},
"namedRegex": "^/my\\-orders(?:/)?$"
},
{
"page": "/opengraph-image.png",
"regex": "^/opengraph\\-image\\.png(?:/)?$",
"routeKeys": {},
"namedRegex": "^/opengraph\\-image\\.png(?:/)?$"
},
{
"page": "/order",
"regex": "^/order(?:/)?$",
"routeKeys": {},
"namedRegex": "^/order(?:/)?$"
},
{
"page": "/order/success",
"regex": "^/order/success(?:/)?$",
"routeKeys": {},
"namedRegex": "^/order/success(?:/)?$"
},
{
"page": "/protected",
"regex": "^/protected(?:/)?$",
"routeKeys": {},
"namedRegex": "^/protected(?:/)?$"
},
{
"page": "/twitter-image.png",
"regex": "^/twitter\\-image\\.png(?:/)?$",
"routeKeys": {},
"namedRegex": "^/twitter\\-image\\.png(?:/)?$"
}
],
"dataRoutes": [],
"rsc": {
"header": "rsc",
"varyHeader": "rsc, next-router-state-tree, next-router-prefetch, next-router-segment-prefetch",
"prefetchHeader": "next-router-prefetch",
"didPostponeHeader": "x-nextjs-postponed",
"contentTypeHeader": "text/x-component",
"suffix": ".rsc",
"prefetchSegmentHeader": "next-router-segment-prefetch",
"prefetchSegmentSuffix": ".segment.rsc",
"prefetchSegmentDirSuffix": ".segments",
"clientParamParsing": false,
"dynamicRSCPrerender": false
},
"rewriteHeaders": {
"pathHeader": "x-nextjs-rewritten-path",
"queryHeader": "x-nextjs-rewritten-query"
}
}

View File

@@ -0,0 +1,28 @@
{
"/_global-error/page": "app/_global-error/page.js",
"/_not-found/page": "app/_not-found/page.js",
"/admin/categories/page": "app/admin/categories/page.js",
"/admin/orders/page": "app/admin/orders/page.js",
"/admin/page": "app/admin/page.js",
"/admin/products/page": "app/admin/products/page.js",
"/admin/users/page": "app/admin/users/page.js",
"/api/admin/recent-orders/route": "app/api/admin/recent-orders/route.js",
"/auth/confirm/route": "app/auth/confirm/route.js",
"/auth/error/page": "app/auth/error/page.js",
"/auth/forgot-password/page": "app/auth/forgot-password/page.js",
"/auth/login/page": "app/auth/login/page.js",
"/auth/sign-up-success/page": "app/auth/sign-up-success/page.js",
"/auth/sign-up/page": "app/auth/sign-up/page.js",
"/auth/update-password/page": "app/auth/update-password/page.js",
"/favicon.ico/route": "app/favicon.ico/route.js",
"/my-customers/[id]/page": "app/my-customers/[id]/page.js",
"/my-customers/new/page": "app/my-customers/new/page.js",
"/my-customers/page": "app/my-customers/page.js",
"/my-orders/page": "app/my-orders/page.js",
"/opengraph-image.png/route": "app/opengraph-image.png/route.js",
"/order/page": "app/order/page.js",
"/order/success/page": "app/order/success/page.js",
"/page": "app/page.js",
"/protected/page": "app/protected/page.js",
"/twitter-image.png/route": "app/twitter-image.png/route.js"
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,15 @@
{
"status": 500,
"headers": {
"x-nextjs-stale-time": "300",
"x-nextjs-prerender": "1",
"x-next-cache-tags": "_N_T_/layout,_N_T_/_global-error/layout,_N_T_/_global-error/page,_N_T_/_global-error"
},
"segmentPaths": [
"/_tree",
"/_full",
"/__PAGE__",
"/_index",
"/_head"
]
}

View File

@@ -0,0 +1,15 @@
1:"$Sreact.fragment"
2:I[39756,["/_next/static/chunks/01xlw8hd842-c.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"default"]
3:I[37457,["/_next/static/chunks/01xlw8hd842-c.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"default"]
4:I[97367,["/_next/static/chunks/01xlw8hd842-c.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"OutletBoundary"]
5:"$Sreact.suspense"
8:I[97367,["/_next/static/chunks/01xlw8hd842-c.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"ViewportBoundary"]
a:I[97367,["/_next/static/chunks/01xlw8hd842-c.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"MetadataBoundary"]
c:I[68027,["/_next/static/chunks/01xlw8hd842-c.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"default",1]
0:{"P":null,"c":["","_global-error"],"q":"","i":false,"f":[[["",{"children":["__PAGE__",{}]}],[["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":[["$","html",null,{"id":"__next_error__","children":[["$","head",null,{"children":[["$","title",null,{"children":"500: This page couldnt load"}],["$","style",null,{"dangerouslySetInnerHTML":{"__html":":root {--next-error-bg: #fff;--next-error-text: #171717;--next-error-title: #171717;--next-error-message: #171717;--next-error-digest: #666666;--next-error-btn-text: #fff;--next-error-btn-bg: #171717;--next-error-btn-border: none;--next-error-btn-secondary-text: #171717;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(0,0,0,0.08);}@media (prefers-color-scheme: dark) {:root {--next-error-bg: #0a0a0a;--next-error-text: #ededed;--next-error-title: #ededed;--next-error-message: #ededed;--next-error-digest: #a0a0a0;--next-error-btn-text: #0a0a0a;--next-error-btn-bg: #ededed;--next-error-btn-border: none;--next-error-btn-secondary-text: #ededed;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(255,255,255,0.14);}}body { margin: 0; color: var(--next-error-text); background: var(--next-error-bg); }"}}]]}],["$","body",null,{"children":["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","display":"flex","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"style":{"marginTop":"-32px","maxWidth":"325px","padding":"32px 28px","textAlign":"left"},"children":[["$","svg",null,{"width":"32","height":"32","viewBox":"-0.2 -1.5 32 32","fill":"none","style":{"marginBottom":"24px"},"children":["$","path",null,{"d":"M16.9328 0C18.0839 0.000116771 19.1334 0.658832 19.634 1.69531L31.4299 26.1309C32.0708 27.4588 31.1036 28.9999 29.6291 29H2.00215C0.527541 29 -0.439628 27.4588 0.201371 26.1309L11.9973 1.69531C12.4979 0.658823 13.5474 7.75066e-05 14.6984 0H16.9328ZM3.59493 26H28.0363L16.9328 3H14.6984L3.59493 26ZM15.8156 19C16.9202 19.0001 17.8156 19.8955 17.8156 21C17.8156 22.1045 16.9202 22.9999 15.8156 23C14.7111 23 13.8156 22.1046 13.8156 21C13.8156 19.8954 14.7111 19 15.8156 19ZM17.3156 16.5H14.3156V8.5H17.3156V16.5Z","fill":"var(--next-error-title)"}]}],["$","h1",null,{"style":{"fontSize":"24px","fontWeight":500,"letterSpacing":"-0.02em","lineHeight":"32px","margin":"0 0 12px 0","color":"var(--next-error-title)"},"children":"This page couldnt load"}],["$","p",null,{"style":{"fontSize":"14px","fontWeight":400,"lineHeight":"21px","margin":"0 0 20px 0","color":"var(--next-error-message)"},"children":"A server error occurred. Reload to try again."}],["$","form",null,{"style":{"margin":0},"children":["$","button",null,{"type":"submit","style":{"display":"inline-flex","alignItems":"center","justifyContent":"center","height":"32px","padding":"0 12px","fontSize":"14px","fontWeight":500,"lineHeight":"20px","borderRadius":"6px","cursor":"pointer","color":"var(--next-error-btn-text)","background":"var(--next-error-btn-bg)","border":"var(--next-error-btn-border)"},"children":"Reload"}]}]]}]}]}]]}],null,["$","$L4",null,{"children":["$","$5",null,{"name":"Next.MetadataOutlet","children":"$@6"}]}]]}],{},null,false,null]},null,false,"$@7"],["$","$1","h",{"children":[null,["$","$L8",null,{"children":"$L9"}],["$","div",null,{"hidden":true,"children":["$","$La",null,{"children":["$","$5",null,{"name":"Next.Metadata","children":"$Lb"}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],false]],"m":"$undefined","G":["$c",[]],"S":true,"h":null,"s":"$undefined","l":"$undefined","p":"$undefined","d":"$undefined","b":"czEjVggXDRFH51IopN6_9"}
d:[]
7:"$Wd"
9:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]
e:I[27201,["/_next/static/chunks/01xlw8hd842-c.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"IconMark"]
6:null
b:[["$","link","0",{"rel":"icon","href":"/favicon.ico?favicon.0x3dzn~oxb6tn.ico","sizes":"256x256","type":"image/x-icon"}],["$","$Le","1",{}]]

View File

@@ -0,0 +1,5 @@
1:"$Sreact.fragment"
2:I[97367,["/_next/static/chunks/01xlw8hd842-c.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"OutletBoundary"]
3:"$Sreact.suspense"
0:{"rsc":["$","$1","c",{"children":[["$","html",null,{"id":"__next_error__","children":[["$","head",null,{"children":[["$","title",null,{"children":"500: This page couldnt load"}],["$","style",null,{"dangerouslySetInnerHTML":{"__html":":root {--next-error-bg: #fff;--next-error-text: #171717;--next-error-title: #171717;--next-error-message: #171717;--next-error-digest: #666666;--next-error-btn-text: #fff;--next-error-btn-bg: #171717;--next-error-btn-border: none;--next-error-btn-secondary-text: #171717;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(0,0,0,0.08);}@media (prefers-color-scheme: dark) {:root {--next-error-bg: #0a0a0a;--next-error-text: #ededed;--next-error-title: #ededed;--next-error-message: #ededed;--next-error-digest: #a0a0a0;--next-error-btn-text: #0a0a0a;--next-error-btn-bg: #ededed;--next-error-btn-border: none;--next-error-btn-secondary-text: #ededed;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(255,255,255,0.14);}}body { margin: 0; color: var(--next-error-text); background: var(--next-error-bg); }"}}]]}],["$","body",null,{"children":["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","display":"flex","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"style":{"marginTop":"-32px","maxWidth":"325px","padding":"32px 28px","textAlign":"left"},"children":[["$","svg",null,{"width":"32","height":"32","viewBox":"-0.2 -1.5 32 32","fill":"none","style":{"marginBottom":"24px"},"children":["$","path",null,{"d":"M16.9328 0C18.0839 0.000116771 19.1334 0.658832 19.634 1.69531L31.4299 26.1309C32.0708 27.4588 31.1036 28.9999 29.6291 29H2.00215C0.527541 29 -0.439628 27.4588 0.201371 26.1309L11.9973 1.69531C12.4979 0.658823 13.5474 7.75066e-05 14.6984 0H16.9328ZM3.59493 26H28.0363L16.9328 3H14.6984L3.59493 26ZM15.8156 19C16.9202 19.0001 17.8156 19.8955 17.8156 21C17.8156 22.1045 16.9202 22.9999 15.8156 23C14.7111 23 13.8156 22.1046 13.8156 21C13.8156 19.8954 14.7111 19 15.8156 19ZM17.3156 16.5H14.3156V8.5H17.3156V16.5Z","fill":"var(--next-error-title)"}]}],["$","h1",null,{"style":{"fontSize":"24px","fontWeight":500,"letterSpacing":"-0.02em","lineHeight":"32px","margin":"0 0 12px 0","color":"var(--next-error-title)"},"children":"This page couldnt load"}],["$","p",null,{"style":{"fontSize":"14px","fontWeight":400,"lineHeight":"21px","margin":"0 0 20px 0","color":"var(--next-error-message)"},"children":"A server error occurred. Reload to try again."}],["$","form",null,{"style":{"margin":0},"children":["$","button",null,{"type":"submit","style":{"display":"inline-flex","alignItems":"center","justifyContent":"center","height":"32px","padding":"0 12px","fontSize":"14px","fontWeight":500,"lineHeight":"20px","borderRadius":"6px","cursor":"pointer","color":"var(--next-error-btn-text)","background":"var(--next-error-btn-bg)","border":"var(--next-error-btn-border)"},"children":"Reload"}]}]]}]}]}]]}],null,["$","$L2",null,{"children":["$","$3",null,{"name":"Next.MetadataOutlet","children":"$@4"}]}]]}],"isPartial":false,"staleTime":300,"varyParams":null,"buildId":"czEjVggXDRFH51IopN6_9"}
4:null

View File

@@ -0,0 +1,15 @@
1:"$Sreact.fragment"
2:I[39756,["/_next/static/chunks/01xlw8hd842-c.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"default"]
3:I[37457,["/_next/static/chunks/01xlw8hd842-c.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"default"]
4:I[97367,["/_next/static/chunks/01xlw8hd842-c.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"OutletBoundary"]
5:"$Sreact.suspense"
8:I[97367,["/_next/static/chunks/01xlw8hd842-c.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"ViewportBoundary"]
a:I[97367,["/_next/static/chunks/01xlw8hd842-c.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"MetadataBoundary"]
c:I[68027,["/_next/static/chunks/01xlw8hd842-c.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"default",1]
0:{"P":null,"c":["","_global-error"],"q":"","i":false,"f":[[["",{"children":["__PAGE__",{}]}],[["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":[["$","html",null,{"id":"__next_error__","children":[["$","head",null,{"children":[["$","title",null,{"children":"500: This page couldnt load"}],["$","style",null,{"dangerouslySetInnerHTML":{"__html":":root {--next-error-bg: #fff;--next-error-text: #171717;--next-error-title: #171717;--next-error-message: #171717;--next-error-digest: #666666;--next-error-btn-text: #fff;--next-error-btn-bg: #171717;--next-error-btn-border: none;--next-error-btn-secondary-text: #171717;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(0,0,0,0.08);}@media (prefers-color-scheme: dark) {:root {--next-error-bg: #0a0a0a;--next-error-text: #ededed;--next-error-title: #ededed;--next-error-message: #ededed;--next-error-digest: #a0a0a0;--next-error-btn-text: #0a0a0a;--next-error-btn-bg: #ededed;--next-error-btn-border: none;--next-error-btn-secondary-text: #ededed;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(255,255,255,0.14);}}body { margin: 0; color: var(--next-error-text); background: var(--next-error-bg); }"}}]]}],["$","body",null,{"children":["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","display":"flex","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"style":{"marginTop":"-32px","maxWidth":"325px","padding":"32px 28px","textAlign":"left"},"children":[["$","svg",null,{"width":"32","height":"32","viewBox":"-0.2 -1.5 32 32","fill":"none","style":{"marginBottom":"24px"},"children":["$","path",null,{"d":"M16.9328 0C18.0839 0.000116771 19.1334 0.658832 19.634 1.69531L31.4299 26.1309C32.0708 27.4588 31.1036 28.9999 29.6291 29H2.00215C0.527541 29 -0.439628 27.4588 0.201371 26.1309L11.9973 1.69531C12.4979 0.658823 13.5474 7.75066e-05 14.6984 0H16.9328ZM3.59493 26H28.0363L16.9328 3H14.6984L3.59493 26ZM15.8156 19C16.9202 19.0001 17.8156 19.8955 17.8156 21C17.8156 22.1045 16.9202 22.9999 15.8156 23C14.7111 23 13.8156 22.1046 13.8156 21C13.8156 19.8954 14.7111 19 15.8156 19ZM17.3156 16.5H14.3156V8.5H17.3156V16.5Z","fill":"var(--next-error-title)"}]}],["$","h1",null,{"style":{"fontSize":"24px","fontWeight":500,"letterSpacing":"-0.02em","lineHeight":"32px","margin":"0 0 12px 0","color":"var(--next-error-title)"},"children":"This page couldnt load"}],["$","p",null,{"style":{"fontSize":"14px","fontWeight":400,"lineHeight":"21px","margin":"0 0 20px 0","color":"var(--next-error-message)"},"children":"A server error occurred. Reload to try again."}],["$","form",null,{"style":{"margin":0},"children":["$","button",null,{"type":"submit","style":{"display":"inline-flex","alignItems":"center","justifyContent":"center","height":"32px","padding":"0 12px","fontSize":"14px","fontWeight":500,"lineHeight":"20px","borderRadius":"6px","cursor":"pointer","color":"var(--next-error-btn-text)","background":"var(--next-error-btn-bg)","border":"var(--next-error-btn-border)"},"children":"Reload"}]}]]}]}]}]]}],null,["$","$L4",null,{"children":["$","$5",null,{"name":"Next.MetadataOutlet","children":"$@6"}]}]]}],{},null,false,null]},null,false,"$@7"],["$","$1","h",{"children":[null,["$","$L8",null,{"children":"$L9"}],["$","div",null,{"hidden":true,"children":["$","$La",null,{"children":["$","$5",null,{"name":"Next.Metadata","children":"$Lb"}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],false]],"m":"$undefined","G":["$c",[]],"S":true,"h":null,"s":"$undefined","l":"$undefined","p":"$undefined","d":"$undefined","b":"czEjVggXDRFH51IopN6_9"}
d:[]
7:"$Wd"
9:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]
e:I[27201,["/_next/static/chunks/01xlw8hd842-c.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"IconMark"]
6:null
b:[["$","link","0",{"rel":"icon","href":"/favicon.ico?favicon.0x3dzn~oxb6tn.ico","sizes":"256x256","type":"image/x-icon"}],["$","$Le","1",{}]]

View File

@@ -0,0 +1,6 @@
1:"$Sreact.fragment"
2:I[97367,["/_next/static/chunks/01xlw8hd842-c.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"ViewportBoundary"]
3:I[97367,["/_next/static/chunks/01xlw8hd842-c.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"MetadataBoundary"]
4:"$Sreact.suspense"
5:I[27201,["/_next/static/chunks/01xlw8hd842-c.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"IconMark"]
0:{"rsc":["$","$1","h",{"children":[null,["$","$L2",null,{"children":[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]}],["$","div",null,{"hidden":true,"children":["$","$L3",null,{"children":["$","$4",null,{"name":"Next.Metadata","children":[["$","link","0",{"rel":"icon","href":"/favicon.ico?favicon.0x3dzn~oxb6tn.ico","sizes":"256x256","type":"image/x-icon"}],["$","$L5","1",{}]]}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],"isPartial":false,"staleTime":300,"varyParams":null,"buildId":"czEjVggXDRFH51IopN6_9"}

View File

@@ -0,0 +1,5 @@
1:"$Sreact.fragment"
2:I[39756,["/_next/static/chunks/01xlw8hd842-c.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"default"]
3:I[37457,["/_next/static/chunks/01xlw8hd842-c.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"default"]
4:[]
0:{"rsc":["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","template":["$","$L3",null,{}]}]]}],"isPartial":false,"staleTime":300,"varyParams":"$W4","buildId":"czEjVggXDRFH51IopN6_9"}

View File

@@ -0,0 +1 @@
0:{"tree":{"name":"","param":null,"prefetchHints":0,"slots":{"children":{"name":"__PAGE__","param":null,"prefetchHints":0,"slots":null}}},"staleTime":300,"buildId":"czEjVggXDRFH51IopN6_9"}

View File

@@ -0,0 +1,12 @@
var R=require("../../chunks/ssr/[turbopack]_runtime.js")("server/app/_global-error/page.js")
R.c("server/chunks/ssr/[root-of-the-server]__0~c929r._.js")
R.c("server/chunks/ssr/node_modules_next_dist_060d1m.._.js")
R.c("server/chunks/ssr/node_modules_next_dist_0ixdcs~._.js")
R.c("server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0nsg22r.js")
R.c("server/chunks/ssr/[root-of-the-server]__0.m8mql._.js")
R.c("server/chunks/ssr/[root-of-the-server]__0.angw.._.js")
R.c("server/chunks/ssr/node_modules_next_dist_compiled_@opentelemetry_api_index_0zv0b3p.js")
R.c("server/chunks/ssr/node_modules_next_dist_client_components_builtin_global-error_0lgvd_..js")
R.c("server/chunks/ssr/_next-internal_server_app__global-error_page_actions_0k77kol.js")
R.m(99158)
module.exports=R.m(99158).exports

View File

@@ -0,0 +1,5 @@
{
"version": 3,
"sources": [],
"sections": []
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,3 @@
{
"/_global-error/page": "app/_global-error/page.js"
}

View File

@@ -0,0 +1,19 @@
{
"devFiles": [],
"ampDevFiles": [],
"polyfillFiles": [
"static/chunks/03~yq9q893hmn.js"
],
"lowPriorityFiles": [],
"rootMainFiles": [
"static/chunks/0ze4gu236oq96.js",
"static/chunks/10qd__0r7a~.l.js",
"static/chunks/0-gaanm6h49z~.js",
"static/chunks/06c8h6921f-oo.js",
"static/chunks/15jasrm2107sy.js",
"static/chunks/181uojwh.t2ik.js",
"static/chunks/turbopack-0u.mb44r17v0_.js"
],
"pages": {},
"ampFirstPages": []
}

View File

@@ -0,0 +1,6 @@
{
"pages": {},
"app": {},
"appUsingSizeAdjust": false,
"pagesUsingSizeAdjust": false
}

View File

@@ -0,0 +1,4 @@
{
"node": {},
"edge": {}
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,16 @@
{
"status": 404,
"headers": {
"x-nextjs-stale-time": "300",
"x-nextjs-prerender": "1",
"x-next-cache-tags": "_N_T_/layout,_N_T_/_not-found/layout,_N_T_/_not-found/page,_N_T_/_not-found"
},
"segmentPaths": [
"/_tree",
"/_full",
"/_not-found/__PAGE__",
"/_not-found",
"/_index",
"/_head"
]
}

View File

@@ -0,0 +1,17 @@
1:"$Sreact.fragment"
2:I[63178,["/_next/static/chunks/0usmzazea5o36.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"ThemeProvider"]
3:I[39756,["/_next/static/chunks/0usmzazea5o36.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"default"]
4:I[37457,["/_next/static/chunks/0usmzazea5o36.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"default"]
5:I[97367,["/_next/static/chunks/0usmzazea5o36.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"OutletBoundary"]
6:"$Sreact.suspense"
9:I[97367,["/_next/static/chunks/0usmzazea5o36.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"ViewportBoundary"]
b:I[97367,["/_next/static/chunks/0usmzazea5o36.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"MetadataBoundary"]
d:I[68027,["/_next/static/chunks/0usmzazea5o36.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"default",1]
:HL["/_next/static/chunks/00s_sac~t0ps5.css","style"]
0:{"P":null,"c":["","_not-found"],"q":"","i":false,"f":[[["",{"children":["/_not-found",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",16],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/chunks/00s_sac~t0ps5.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/_next/static/chunks/0usmzazea5o36.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/_next/static/chunks/0d3shmwh5_nmn.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","suppressHydrationWarning":true,"children":["$","body",null,{"className":"geist_6ee70f7-module__6GiuUG__className antialiased","children":["$","$L2",null,{"attribute":"class","defaultTheme":"system","enableSystem":true,"disableTransitionOnChange":true,"children":["$","$L3",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L4",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L3",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L4",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:notFound:0:1:props:style","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:1:props:style","children":404}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:style","children":["$","h2",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:children:props:style","children":"This page could not be found."}]}]]}]}]],null,["$","$L5",null,{"children":["$","$6",null,{"name":"Next.MetadataOutlet","children":"$@7"}]}]]}],{},null,false,null]},null,false,"$@8"]},null,false,null],["$","$1","h",{"children":[["$","meta",null,{"name":"robots","content":"noindex"}],["$","$L9",null,{"children":"$La"}],["$","div",null,{"hidden":true,"children":["$","$Lb",null,{"children":["$","$6",null,{"name":"Next.Metadata","children":"$Lc"}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],false]],"m":"$undefined","G":["$d",[["$","link","0",{"rel":"stylesheet","href":"/_next/static/chunks/00s_sac~t0ps5.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]]],"S":true,"h":null,"s":"$undefined","l":"$undefined","p":"$undefined","d":"$undefined","b":"czEjVggXDRFH51IopN6_9"}
e:[]
8:"$We"
a:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]
f:I[27201,["/_next/static/chunks/0usmzazea5o36.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"IconMark"]
7:null
c:[["$","title","0",{"children":"CASPOS-Shop | Die Kasse"}],["$","meta","1",{"name":"description","content":"Konfigurieren und bestellen Sie Ihre maßgeschneiderte Business-Software in Minuten."}],["$","meta","2",{"property":"og:title","content":"CASPOS-Shop | Die Kasse"}],["$","meta","3",{"property":"og:description","content":"Konfigurieren und bestellen Sie Ihre maßgeschneiderte Business-Software in Minuten."}],["$","meta","4",{"property":"og:image","content":"http://localhost:3000/opengraph-image.png?opengraph-image.0rmepv3m6lsw4.png"}],["$","meta","5",{"property":"og:image:type","content":"image/png"}],["$","meta","6",{"property":"og:image:width","content":"1200"}],["$","meta","7",{"property":"og:image:height","content":"600"}],["$","meta","8",{"name":"twitter:card","content":"summary_large_image"}],["$","meta","9",{"name":"twitter:title","content":"CASPOS-Shop | Die Kasse"}],["$","meta","10",{"name":"twitter:description","content":"Konfigurieren und bestellen Sie Ihre maßgeschneiderte Business-Software in Minuten."}],["$","meta","11",{"name":"twitter:image","content":"http://localhost:3000/twitter-image.png?twitter-image.0rmepv3m6lsw4.png"}],["$","meta","12",{"name":"twitter:image:type","content":"image/png"}],["$","meta","13",{"name":"twitter:image:width","content":"1200"}],["$","meta","14",{"name":"twitter:image:height","content":"600"}],["$","link","15",{"rel":"icon","href":"/favicon.ico?favicon.0x3dzn~oxb6tn.ico","sizes":"256x256","type":"image/x-icon"}],["$","$Lf","16",{}]]

View File

@@ -0,0 +1,17 @@
1:"$Sreact.fragment"
2:I[63178,["/_next/static/chunks/0usmzazea5o36.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"ThemeProvider"]
3:I[39756,["/_next/static/chunks/0usmzazea5o36.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"default"]
4:I[37457,["/_next/static/chunks/0usmzazea5o36.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"default"]
5:I[97367,["/_next/static/chunks/0usmzazea5o36.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"OutletBoundary"]
6:"$Sreact.suspense"
9:I[97367,["/_next/static/chunks/0usmzazea5o36.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"ViewportBoundary"]
b:I[97367,["/_next/static/chunks/0usmzazea5o36.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"MetadataBoundary"]
d:I[68027,["/_next/static/chunks/0usmzazea5o36.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"default",1]
:HL["/_next/static/chunks/00s_sac~t0ps5.css","style"]
0:{"P":null,"c":["","_not-found"],"q":"","i":false,"f":[[["",{"children":["/_not-found",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",16],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/chunks/00s_sac~t0ps5.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/_next/static/chunks/0usmzazea5o36.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/_next/static/chunks/0d3shmwh5_nmn.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","suppressHydrationWarning":true,"children":["$","body",null,{"className":"geist_6ee70f7-module__6GiuUG__className antialiased","children":["$","$L2",null,{"attribute":"class","defaultTheme":"system","enableSystem":true,"disableTransitionOnChange":true,"children":["$","$L3",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L4",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L3",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L4",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:notFound:0:1:props:style","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:1:props:style","children":404}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:style","children":["$","h2",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:children:props:style","children":"This page could not be found."}]}]]}]}]],null,["$","$L5",null,{"children":["$","$6",null,{"name":"Next.MetadataOutlet","children":"$@7"}]}]]}],{},null,false,null]},null,false,"$@8"]},null,false,null],["$","$1","h",{"children":[["$","meta",null,{"name":"robots","content":"noindex"}],["$","$L9",null,{"children":"$La"}],["$","div",null,{"hidden":true,"children":["$","$Lb",null,{"children":["$","$6",null,{"name":"Next.Metadata","children":"$Lc"}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],false]],"m":"$undefined","G":["$d",[["$","link","0",{"rel":"stylesheet","href":"/_next/static/chunks/00s_sac~t0ps5.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]]],"S":true,"h":null,"s":"$undefined","l":"$undefined","p":"$undefined","d":"$undefined","b":"czEjVggXDRFH51IopN6_9"}
e:[]
8:"$We"
a:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]
f:I[27201,["/_next/static/chunks/0usmzazea5o36.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"IconMark"]
7:null
c:[["$","title","0",{"children":"CASPOS-Shop | Die Kasse"}],["$","meta","1",{"name":"description","content":"Konfigurieren und bestellen Sie Ihre maßgeschneiderte Business-Software in Minuten."}],["$","meta","2",{"property":"og:title","content":"CASPOS-Shop | Die Kasse"}],["$","meta","3",{"property":"og:description","content":"Konfigurieren und bestellen Sie Ihre maßgeschneiderte Business-Software in Minuten."}],["$","meta","4",{"property":"og:image","content":"http://localhost:3000/opengraph-image.png?opengraph-image.0rmepv3m6lsw4.png"}],["$","meta","5",{"property":"og:image:type","content":"image/png"}],["$","meta","6",{"property":"og:image:width","content":"1200"}],["$","meta","7",{"property":"og:image:height","content":"600"}],["$","meta","8",{"name":"twitter:card","content":"summary_large_image"}],["$","meta","9",{"name":"twitter:title","content":"CASPOS-Shop | Die Kasse"}],["$","meta","10",{"name":"twitter:description","content":"Konfigurieren und bestellen Sie Ihre maßgeschneiderte Business-Software in Minuten."}],["$","meta","11",{"name":"twitter:image","content":"http://localhost:3000/twitter-image.png?twitter-image.0rmepv3m6lsw4.png"}],["$","meta","12",{"name":"twitter:image:type","content":"image/png"}],["$","meta","13",{"name":"twitter:image:width","content":"1200"}],["$","meta","14",{"name":"twitter:image:height","content":"600"}],["$","link","15",{"rel":"icon","href":"/favicon.ico?favicon.0x3dzn~oxb6tn.ico","sizes":"256x256","type":"image/x-icon"}],["$","$Lf","16",{}]]

View File

@@ -0,0 +1,6 @@
1:"$Sreact.fragment"
2:I[97367,["/_next/static/chunks/0usmzazea5o36.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"ViewportBoundary"]
3:I[97367,["/_next/static/chunks/0usmzazea5o36.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"MetadataBoundary"]
4:"$Sreact.suspense"
5:I[27201,["/_next/static/chunks/0usmzazea5o36.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"IconMark"]
0:{"rsc":["$","$1","h",{"children":[["$","meta",null,{"name":"robots","content":"noindex"}],["$","$L2",null,{"children":[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]}],["$","div",null,{"hidden":true,"children":["$","$L3",null,{"children":["$","$4",null,{"name":"Next.Metadata","children":[["$","title","0",{"children":"CASPOS-Shop | Die Kasse"}],["$","meta","1",{"name":"description","content":"Konfigurieren und bestellen Sie Ihre maßgeschneiderte Business-Software in Minuten."}],["$","meta","2",{"property":"og:title","content":"CASPOS-Shop | Die Kasse"}],["$","meta","3",{"property":"og:description","content":"Konfigurieren und bestellen Sie Ihre maßgeschneiderte Business-Software in Minuten."}],["$","meta","4",{"property":"og:image","content":"http://localhost:3000/opengraph-image.png?opengraph-image.0rmepv3m6lsw4.png"}],["$","meta","5",{"property":"og:image:type","content":"image/png"}],["$","meta","6",{"property":"og:image:width","content":"1200"}],["$","meta","7",{"property":"og:image:height","content":"600"}],["$","meta","8",{"name":"twitter:card","content":"summary_large_image"}],["$","meta","9",{"name":"twitter:title","content":"CASPOS-Shop | Die Kasse"}],["$","meta","10",{"name":"twitter:description","content":"Konfigurieren und bestellen Sie Ihre maßgeschneiderte Business-Software in Minuten."}],["$","meta","11",{"name":"twitter:image","content":"http://localhost:3000/twitter-image.png?twitter-image.0rmepv3m6lsw4.png"}],["$","meta","12",{"name":"twitter:image:type","content":"image/png"}],["$","meta","13",{"name":"twitter:image:width","content":"1200"}],["$","meta","14",{"name":"twitter:image:height","content":"600"}],["$","link","15",{"rel":"icon","href":"/favicon.ico?favicon.0x3dzn~oxb6tn.ico","sizes":"256x256","type":"image/x-icon"}],["$","$L5","16",{}]]}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],"isPartial":false,"staleTime":300,"varyParams":null,"buildId":"czEjVggXDRFH51IopN6_9"}

View File

@@ -0,0 +1,6 @@
1:"$Sreact.fragment"
2:I[63178,["/_next/static/chunks/0usmzazea5o36.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"ThemeProvider"]
3:I[39756,["/_next/static/chunks/0usmzazea5o36.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"default"]
4:I[37457,["/_next/static/chunks/0usmzazea5o36.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"default"]
:HL["/_next/static/chunks/00s_sac~t0ps5.css","style"]
0:{"rsc":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/chunks/00s_sac~t0ps5.css","precedence":"next"}],["$","script","script-0",{"src":"/_next/static/chunks/0usmzazea5o36.js","async":true}],["$","script","script-1",{"src":"/_next/static/chunks/0d3shmwh5_nmn.js","async":true}]],["$","html",null,{"lang":"en","suppressHydrationWarning":true,"children":["$","body",null,{"className":"geist_6ee70f7-module__6GiuUG__className antialiased","children":["$","$L2",null,{"attribute":"class","defaultTheme":"system","enableSystem":true,"disableTransitionOnChange":true,"children":["$","$L3",null,{"parallelRouterKey":"children","template":["$","$L4",null,{}],"notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]]}]}]}]}]]}],"isPartial":false,"staleTime":300,"varyParams":null,"buildId":"czEjVggXDRFH51IopN6_9"}

View File

@@ -0,0 +1,5 @@
1:"$Sreact.fragment"
2:I[39756,["/_next/static/chunks/0usmzazea5o36.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"default"]
3:I[37457,["/_next/static/chunks/0usmzazea5o36.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"default"]
4:[]
0:{"rsc":["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","template":["$","$L3",null,{}]}]]}],"isPartial":false,"staleTime":300,"varyParams":"$W4","buildId":"czEjVggXDRFH51IopN6_9"}

View File

@@ -0,0 +1,5 @@
1:"$Sreact.fragment"
2:I[97367,["/_next/static/chunks/0usmzazea5o36.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"OutletBoundary"]
3:"$Sreact.suspense"
0:{"rsc":["$","$1","c",{"children":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],null,["$","$L2",null,{"children":["$","$3",null,{"name":"Next.MetadataOutlet","children":"$@4"}]}]]}],"isPartial":false,"staleTime":300,"varyParams":null,"buildId":"czEjVggXDRFH51IopN6_9"}
4:null

View File

@@ -0,0 +1,2 @@
:HL["/_next/static/chunks/00s_sac~t0ps5.css","style"]
0:{"tree":{"name":"","param":null,"prefetchHints":16,"slots":{"children":{"name":"/_not-found","param":null,"prefetchHints":0,"slots":{"children":{"name":"__PAGE__","param":null,"prefetchHints":0,"slots":null}}}}},"staleTime":300,"buildId":"czEjVggXDRFH51IopN6_9"}

View File

@@ -0,0 +1,15 @@
var R=require("../../chunks/ssr/[turbopack]_runtime.js")("server/app/_not-found/page.js")
R.c("server/chunks/ssr/[root-of-the-server]__07-.vk-._.js")
R.c("server/chunks/ssr/node_modules_next_dist_060d1m.._.js")
R.c("server/chunks/ssr/node_modules_next_dist_0ixdcs~._.js")
R.c("server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0gw4z76.js")
R.c("server/chunks/ssr/[root-of-the-server]__0.m8mql._.js")
R.c("server/chunks/ssr/[root-of-the-server]__0.angw.._.js")
R.c("server/chunks/ssr/node_modules_next_dist_compiled_@opentelemetry_api_index_0zv0b3p.js")
R.c("server/chunks/ssr/[root-of-the-server]__0btml7h._.js")
R.c("server/chunks/ssr/node_modules_next_dist_client_components_0inhx6q._.js")
R.c("server/chunks/ssr/node_modules_next_dist_client_components_builtin_forbidden_0ghu-f7.js")
R.c("server/chunks/ssr/node_modules_next_dist_client_components_builtin_unauthorized_0cjv-23.js")
R.c("server/chunks/ssr/_next-internal_server_app__not-found_page_actions_0eq97pa.js")
R.m(37047)
module.exports=R.m(37047).exports

View File

@@ -0,0 +1,5 @@
{
"version": 3,
"sources": [],
"sections": []
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,3 @@
{
"/_not-found/page": "app/_not-found/page.js"
}

View File

@@ -0,0 +1,19 @@
{
"devFiles": [],
"ampDevFiles": [],
"polyfillFiles": [
"static/chunks/03~yq9q893hmn.js"
],
"lowPriorityFiles": [],
"rootMainFiles": [
"static/chunks/0ze4gu236oq96.js",
"static/chunks/10qd__0r7a~.l.js",
"static/chunks/0-gaanm6h49z~.js",
"static/chunks/06c8h6921f-oo.js",
"static/chunks/15jasrm2107sy.js",
"static/chunks/181uojwh.t2ik.js",
"static/chunks/turbopack-0u.mb44r17v0_.js"
],
"pages": {},
"ampFirstPages": []
}

View File

@@ -0,0 +1,10 @@
{
"pages": {},
"app": {
"[project]/app/_not-found/page": [
"static/media/caa3a2e1cccd8315-s.p.09~u27dqhyhd6.woff2"
]
},
"appUsingSizeAdjust": true,
"pagesUsingSizeAdjust": false
}

View File

@@ -0,0 +1,4 @@
{
"node": {},
"edge": {}
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,20 @@
var R=require("../../../chunks/ssr/[turbopack]_runtime.js")("server/app/admin/categories/page.js")
R.c("server/chunks/ssr/[root-of-the-server]__0wflrfl._.js")
R.c("server/chunks/ssr/node_modules_next_dist_0ixdcs~._.js")
R.c("server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_13kui4y.js")
R.c("server/chunks/ssr/[root-of-the-server]__0.m8mql._.js")
R.c("server/chunks/ssr/[root-of-the-server]__0.angw.._.js")
R.c("server/chunks/ssr/node_modules_next_dist_compiled_@opentelemetry_api_index_0zv0b3p.js")
R.c("server/chunks/ssr/[root-of-the-server]__0btml7h._.js")
R.c("server/chunks/ssr/node_modules_next_dist_client_components_0inhx6q._.js")
R.c("server/chunks/ssr/node_modules_next_dist_client_components_builtin_forbidden_0ghu-f7.js")
R.c("server/chunks/ssr/node_modules_next_dist_client_components_builtin_unauthorized_0cjv-23.js")
R.c("server/chunks/ssr/node_modules_next_dist_client_components_builtin_global-error_0lgvd_..js")
R.c("server/chunks/ssr/_03nwkon._.js")
R.c("server/chunks/ssr/_0xd3tc_._.js")
R.c("server/chunks/ssr/node_modules_next_dist_05~t7f3._.js")
R.c("server/chunks/ssr/node_modules_0mbjt18._.js")
R.c("server/chunks/ssr/node_modules_next_0p22336._.js")
R.c("server/chunks/ssr/_0ltbyqh._.js")
R.m(43315)
module.exports=R.m(43315).exports

View File

@@ -0,0 +1,5 @@
{
"version": 3,
"sources": [],
"sections": []
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,3 @@
{
"/admin/categories/page": "app/admin/categories/page.js"
}

View File

@@ -0,0 +1,19 @@
{
"devFiles": [],
"ampDevFiles": [],
"polyfillFiles": [
"static/chunks/03~yq9q893hmn.js"
],
"lowPriorityFiles": [],
"rootMainFiles": [
"static/chunks/0ze4gu236oq96.js",
"static/chunks/10qd__0r7a~.l.js",
"static/chunks/0-gaanm6h49z~.js",
"static/chunks/06c8h6921f-oo.js",
"static/chunks/15jasrm2107sy.js",
"static/chunks/181uojwh.t2ik.js",
"static/chunks/turbopack-0u.mb44r17v0_.js"
],
"pages": {},
"ampFirstPages": []
}

View File

@@ -0,0 +1,10 @@
{
"pages": {},
"app": {
"[project]/app/admin/categories/page": [
"static/media/caa3a2e1cccd8315-s.p.09~u27dqhyhd6.woff2"
]
},
"appUsingSizeAdjust": true,
"pagesUsingSizeAdjust": false
}

View File

@@ -0,0 +1,101 @@
{
"node": {
"00c025951ac48bbc471c319f97bf1a8040d996e943": {
"workers": {
"app/admin/categories/page": {
"moduleId": 59130,
"async": false,
"exportedName": "getProducts",
"filename": "lib/actions/products.ts"
}
},
"exportedName": "getProducts",
"filename": "lib/actions/products.ts"
},
"00c33c218db92f0574a15792844c36b40835c2551f": {
"workers": {
"app/admin/categories/page": {
"moduleId": 59130,
"async": false,
"exportedName": "getCategories",
"filename": "lib/actions/products.ts"
}
},
"exportedName": "getCategories",
"filename": "lib/actions/products.ts"
},
"400e9b629f70ea93b510ba2950527adf41205870db": {
"workers": {
"app/admin/categories/page": {
"moduleId": 59130,
"async": false,
"exportedName": "deleteProduct",
"filename": "lib/actions/products.ts"
}
},
"exportedName": "deleteProduct",
"filename": "lib/actions/products.ts"
},
"407bdb7aaaf3a11c053fdd318f09738d3866a746b2": {
"workers": {
"app/admin/categories/page": {
"moduleId": 59130,
"async": false,
"exportedName": "createCategory",
"filename": "lib/actions/products.ts"
}
},
"exportedName": "createCategory",
"filename": "lib/actions/products.ts"
},
"40fe250b848634e555d6fa7c234529bc0c459a5f34": {
"workers": {
"app/admin/categories/page": {
"moduleId": 59130,
"async": false,
"exportedName": "deleteCategory",
"filename": "lib/actions/products.ts"
}
},
"exportedName": "deleteCategory",
"filename": "lib/actions/products.ts"
},
"604ec31c2cd7dd2e95a8ca506e3f6160189d8a40a5": {
"workers": {
"app/admin/categories/page": {
"moduleId": 59130,
"async": false,
"exportedName": "updateCategory",
"filename": "lib/actions/products.ts"
}
},
"exportedName": "updateCategory",
"filename": "lib/actions/products.ts"
},
"605638da51e488c9781483a4b154c1a2ce2578676c": {
"workers": {
"app/admin/categories/page": {
"moduleId": 59130,
"async": false,
"exportedName": "createProduct",
"filename": "lib/actions/products.ts"
}
},
"exportedName": "createProduct",
"filename": "lib/actions/products.ts"
},
"70b0a56442225be2d84273d7139da0338a60dd4c1b": {
"workers": {
"app/admin/categories/page": {
"moduleId": 59130,
"async": false,
"exportedName": "updateProduct",
"filename": "lib/actions/products.ts"
}
},
"exportedName": "updateProduct",
"filename": "lib/actions/products.ts"
}
},
"edge": {}
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,20 @@
var R=require("../../../chunks/ssr/[turbopack]_runtime.js")("server/app/admin/orders/page.js")
R.c("server/chunks/ssr/[root-of-the-server]__0z..g1z._.js")
R.c("server/chunks/ssr/lib_utils_ts_0ks3cu5._.js")
R.c("server/chunks/ssr/node_modules_next_dist_060d1m.._.js")
R.c("server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0djly_a.js")
R.c("server/chunks/ssr/node_modules_next_dist_0ixdcs~._.js")
R.c("server/chunks/ssr/node_modules_0mbjt18._.js")
R.c("server/chunks/ssr/_0ltbyqh._.js")
R.c("server/chunks/ssr/[root-of-the-server]__0.m8mql._.js")
R.c("server/chunks/ssr/[root-of-the-server]__0.angw.._.js")
R.c("server/chunks/ssr/node_modules_next_dist_compiled_@opentelemetry_api_index_0zv0b3p.js")
R.c("server/chunks/ssr/[root-of-the-server]__0btml7h._.js")
R.c("server/chunks/ssr/node_modules_next_dist_client_components_0inhx6q._.js")
R.c("server/chunks/ssr/node_modules_next_dist_client_components_builtin_forbidden_0ghu-f7.js")
R.c("server/chunks/ssr/node_modules_next_dist_client_components_builtin_unauthorized_0cjv-23.js")
R.c("server/chunks/ssr/node_modules_next_dist_client_components_builtin_global-error_0lgvd_..js")
R.c("server/chunks/ssr/_03nwkon._.js")
R.c("server/chunks/ssr/_next-internal_server_app_admin_orders_page_actions_11vjj6..js")
R.m(45232)
module.exports=R.m(45232).exports

View File

@@ -0,0 +1,5 @@
{
"version": 3,
"sources": [],
"sections": []
}

File diff suppressed because one or more lines are too long

Some files were not shown because too many files have changed in this diff Show More