feat: migrate npm registry from Verdaccio to Gitea Packages
Some checks failed
Monorepo Pipeline / ⚡ Prioritize Release (push) Successful in 1s
Monorepo Pipeline / 🧹 Lint (push) Failing after 35s
Monorepo Pipeline / 🧪 Test (push) Failing after 35s
Monorepo Pipeline / 🏗️ Build (push) Failing after 12s
Monorepo Pipeline / 🚀 Release (push) Has been skipped
Monorepo Pipeline / 🐳 Build Image Processor (push) Has been skipped
Monorepo Pipeline / 🐳 Build Directus (Base) (push) Has been skipped
Monorepo Pipeline / 🐳 Build Gatekeeper (Product) (push) Has been skipped
Monorepo Pipeline / 🐳 Build Build-Base (push) Has been skipped
Monorepo Pipeline / 🐳 Build Production Runtime (push) Has been skipped

This commit is contained in:
2026-02-27 00:12:00 +01:00
parent efd1341762
commit 5da88356a8
69 changed files with 5397 additions and 114 deletions

View File

@@ -1,6 +1,27 @@
import { renderToFile } from "@react-pdf/renderer";
import { renderToFile, Font } from "@react-pdf/renderer";
import { createElement } from "react";
// Standard Font Registrations to prevent crashes when PDFs use custom web fonts
Font.register({
family: 'Outfit',
fonts: [
{ src: 'Helvetica' },
{ src: 'Helvetica-Bold', fontWeight: 'bold' },
],
});
Font.register({
family: 'Inter',
fonts: [
{ src: 'Helvetica' },
{ src: 'Helvetica-Bold', fontWeight: 'bold' },
],
});
import { EstimationPDF } from "../components/EstimationPDF.js";
import { ConceptPDF } from "../components/ConceptPDF.js";
import { InfoPDF } from "../components/InfoPDF.js";
import { AgbsPDF } from "../components/AgbsPDF.js";
import { PRICING } from "../logic/pricing/constants.js";
import { calculateTotals } from "../logic/pricing/calculator.js";
@@ -21,4 +42,33 @@ export class PdfEngine {
return outputPath;
}
async generateConceptPdf(concept: any, outputPath: string): Promise<string> {
await renderToFile(
createElement(ConceptPDF as any, {
concept,
} as any) as any,
outputPath
);
return outputPath;
}
async generateInfoPdf(outputPath: string, options: { headerIcon?: string; footerLogo?: string } = {}): Promise<string> {
await renderToFile(
createElement(InfoPDF as any, options as any) as any,
outputPath
);
return outputPath;
}
async generateAgbsPdf(outputPath: string, options: { headerIcon?: string; footerLogo?: string; mode?: "estimation" | "full" } = {}): Promise<string> {
await renderToFile(
createElement(AgbsPDF as any, options as any) as any,
outputPath
);
return outputPath;
}
}