Show pending account invites and polish sign editor recovery
This commit is contained in:
@@ -25,6 +25,15 @@ export function escapeXml(value: string) {
|
||||
return value.replace(/[&<>"']/g, (c) => ({ "&": "&", "<": "<", ">": ">", '"': """, "'": "'" })[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")) ?? []);
|
||||
|
||||
Reference in New Issue
Block a user