Show pending account invites and polish sign editor recovery

This commit is contained in:
2026-09-10 10:10:07 -04:00
parent 6f400ac2cd
commit 74592718c1
11 changed files with 177 additions and 18 deletions
+9
View File
@@ -25,6 +25,15 @@ export function escapeXml(value: string) {
return value.replace(/[&<>"']/g, (c) => ({ "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&apos;" })[c]!);
}
export function signPrintMetrics(design: SignDesign) {
const paper = signPaper(design);
const landscape = paper.viewHeight < 850;
const scale = Math.min(850 / (landscape ? 1200 : 850), paper.viewHeight / (landscape ? 800 : 1100));
const widthInches = parseFloat(paper.width) / (paper.width.endsWith("mm") ? 25.4 : 1);
const qrUnits = design.layout === "compact" ? 320 : design.layout === "photo" ? 240 : design.layout === "typography" ? 340 : 370;
return { qrInches: widthInches / 850 * scale * qrUnits };
}
// Hard-wrap even unbroken names/URLs; no user input becomes SVG markup.
export function signLines(value: string, limit: number) {
const words = value.trim().split(/\s+/).flatMap(word => word.match(new RegExp(`.{1,${limit}}`, "gu")) ?? []);